diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 3822456fa..f226e5549 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cig_wf660a', 'cybertan_eww622-a1', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap111', 'edgecore_ecw5211', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'edgecore_oap102', 'hfcl_ion4','hfcl_ion4xi_wp', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4xi_w', 'hfcl_ion4xi_HMR', 'hfcl_ion4x_w', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'indio_um-310ax-v1', 'indio_um-510axp-v1', 'indio_um-510axm-v1', 'sercomm_ap72tip', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018-v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ] + target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap111', 'edgecore_ecw5211', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'hfcl_ion4', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'sercomm_ap72tip', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018-v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ] steps: - uses: actions/checkout@v3 diff --git a/feeds/ipq807x/aq-fw-download/Makefile b/feeds/ipq807x/aq-fw-download/Makefile deleted file mode 100755 index 7e864b42a..000000000 --- a/feeds/ipq807x/aq-fw-download/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=aq-fw-download -PKG_BRANCH:=master -PKG_VERSION:=1.0 -PKG_RELEASE:=1 - -PKG_BUILD_DIR:=$(BUILD_DIR)/aq-fw-download - -include $(INCLUDE_DIR)/package.mk - -define AquantiaUtil - - define Package/aq-fw-download - SECTION:=utils - CATEGORY:=Utilities - DEPENDS:=@TARGET_ipq806x||TARGET_ipq||TARGET_ipq40xx||TARGET_ipq807x_32||TARGET_ipq807x - TITLE:=Aquantia FW downloader utitlity - endef - - define Package/aq-fw-download/description - Aquantia FW downloader utitlity - endef - -TARGET_CPPFLAGS := \ - -D_GNU_SOURCE \ - -I$(LINUX_SRC_DIR)/include \ - -I$(LINUX_SRC_DIR)/arch/$(LINUX_KARCH)/include \ - -I$(PKG_BUILD_DIR) \ - $(TARGET_CPPFLAGS) - - define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) - $(CP) ./src/* $(PKG_BUILD_DIR)/ - endef - - define Build/Compile - CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(TARGET_CONFIGURE_OPTS) - endef - - define Package/aq-fw-download/install - $(INSTALL_DIR) $$(1)/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/aq-fw-download $$(1)/sbin/aq-fw-download - endef - - $$(eval $$(call BuildPackage,aq-fw-download)) -endef - -#Build/Compile=true - -$(eval $(call AquantiaUtil)) diff --git a/feeds/ipq807x/aq-fw-download/src/Makefile b/feeds/ipq807x/aq-fw-download/src/Makefile deleted file mode 100755 index dc141be0e..000000000 --- a/feeds/ipq807x/aq-fw-download/src/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -ifndef CFLAGS -CFLAGS = -O2 -g -endif -INCLUDES=-Iinclude -Iinclude/registerMap \ - -Iinclude/registerMap/APPIA \ - -Iinclude/registerMap/HHD - -all: aq-fw-download - -%.o: %.c - $(CC) $(INCLUDES) $(CFLAGS) -c -o $@ $^ - -aq-fw-download: mdioBootLoadCLD.o src/AQ_PhyInterface.o src/AQ_API.o - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) diff --git a/feeds/ipq807x/aq-fw-download/src/include/AQ_API.h b/feeds/ipq807x/aq-fw-download/src/include/AQ_API.h deleted file mode 100755 index 9a0b4c20a..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/AQ_API.h +++ /dev/null @@ -1,246 +0,0 @@ -/* -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/*! \file - This file contains the AQ_API function and datatype declarations. */ - - -#ifndef AQ_API_TOKEN -#define AQ_API_TOKEN - -#include - -#include "AQ_User.h" -#include "AQ_ReturnCodes.h" - -/******************************************************************* - General -*******************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! This typedef defines the bool datatype which takes the values -true and false.*/ -typedef enum {False = 0, True = 1} AQ_boolean; - - -/*@}*/ - - -/******************************************************************* - Device Identity -*******************************************************************/ - -/*! \defgroup deviceIdentity Device Identity -All AQ_API functions accept a parameter identifying the target PHY that -should be acted upon. */ -/*@{*/ - - -/*! This enumeration is used to describe the different types of - Aquantia PHY.*/ -typedef enum -{ - /*! 1/2/4-port package, 40nm architechture.*/ - AQ_DEVICE_APPIA, - /*! 1/2/4-port package, 28nm architechture.*/ - AQ_DEVICE_HHD -} AQ_API_Device; - -/*! This structure is used to specify a particular Aquantia PHY port - within the system.*/ -typedef struct -{ - /*! The type of Aquantia PHY*/ - AQ_API_Device device; - /*! Uniquely identifies the port within the system. AQ_Port must be - defined to whatever data type is suitable for the platform. - AQ_API functions will never do anything with PHY_ID other than - pass it down to the platform's PHY register read/write - functions.*/ - AQ_Port PHY_ID; -} AQ_API_Port; - -/*@}*/ - - -/*! This function boot-loads the instruction and data memory (IRAM and - DRAM) of a set of Aquantia PHYs from a .cld format image file (the - same image file used to burn the FLASH). During boot-load of each - Aquantia PHY, the processor is halted, and after programming is - complete the processor is released. Note that calling this - function leaves the daisy-chain disabled to prevent RAM over- - write. To exit MDIO boot-load mode, use the function - AQ_API_EnableDaisyChain. - Unlike most of the other functions in this API, this function can - operate on a group of PHYs simultaneously. This is referred to as - gang-loading. To facilitate this, this function takes as - parameters 3 parallel arrays: PHY_IDs, provisioningAddresses, and - resultCodes. The length of these arrays must be identical, and is - specified by the num_PHY_IDs parameter. - In order to check the integrity of the boot-load operation, a - CRC-16 value is calculated over the IRAM and DRAM. After the image - has been loaded, this value is directly compared against each - PHY's Mailbox CRC-16 in 1E.0201. - The value of register 1E.C441 must be the same for all the boot- - loaded PHYs. This will be checked before the boot-load is - performed, and if a non-uniform value is read from any of the - PHYs, the function will fail before any writes are performed. - A separate result code is returned for each of the boot-loaded - PHYs, in the OUT parameter, resultCodes. - Individual Port Return codes: - AQ_RET_BOOTLOAD_PROVADDR_OOR: The specified provisioning address - was outside of the permitted range. - AQ_RET_BOOTLOAD_NONUNIFORM_REGVALS: The values of the register(s) - that must be uniform across the ports being bootloaded were not - uniform. - AQ_RET_BOOTLOAD_CRC_MISMATCH: The image was completely loaded into - memory, but the after the port exited bootload the running - checksum that was read from the uP memory mailbox was not the - expected value. This indicates that the memory has potentially - been corrupted, and the PHY should be reset before trying the - bootload again. - Overall Return codes (the return value from the function call): - AQ_RET_OK: all ports were successfully bootloaded. - AQ_RET_ERROR: One or more ports were not successfully bootloaded. - */ -AQ_Retcode AQ_API_WriteBootLoadImage -( - /*! An array identifying the target PHY ports.*/ - AQ_API_Port** ports, - /*! The length of the arrays ports, provisioningAddresses, and - resultCodes. These are parallel arrays, and must all be of the - same length.*/ - unsigned int numPorts, - /*! The provisioning addresses of each of the PHYs specified in - ports. This can range from 0 through 47, and is also known as - the daisy-chain address or the hop-count. If the PHYs are - connected to a FLASH using the daisy-chain, this is the distance - from the PHY to the FLASH, and is used to identify customized - provisioning for each PHY from the provisioning data within the - image. Otherwise, it is an arbitrary number. The length of this - array must match the length of ports.*/ - unsigned int* provisioningAddresses, - /*! OUT: The result code indicating success or failure of boot- - loading each of the PHYs specified in ports.*/ - AQ_Retcode* resultCodes, - /*! A pointer to the size of the image (in bytes) that is being - loaded into the Aquantia PHY.*/ - uint32_t* imageSizePointer, - /*! The image being loaded into the Aquantia PHY. This is the same - regardless of whether the target is internal RAM or FLASH.*/ - uint8_t* image, - /*! The 5-bit address to be used during the gang-loading operation. - During the boot-loading process, each of the PHYs specified in - ports will be changed such that they are addressed on the MDIO - bus at gangloadAddress. This allows all the PHYs to be loaded - simultaneously. Before returning, each PHY will be moved back to - its original MDIO address. If ports contains only a single - element, callers will probably want to use the PHY's original - MDIO address for this parameter.*/ - uint8_t gangload_MDIO_address, - /*! The address of the PHYs while in gangload mode. This is - ultimately some combination of the system address and the - gangload MDIO address, specified by gangload_MDIO_address. For - most platforms, gangload_MDIO_address and gangload_PHY_ID should - have the same value.*/ - AQ_API_Port* gangloadPort -); - -/*! This function boot-loads the instruction and data memory (IRAM and - DRAM) of a set of Aquantia PHYs from a .cld format image file (the - same image file used to burn the FLASH), as well as a separately - provided provisioning table image file.The provisioning table - image allows additional provisioning to be provided, beyond what - is built in to the .cld image. If provTableSizePointer or - provTableImage are NULL, this function behaves like - AQ_API_WriteBootLoadImage. - Aside from the additional provisioing table, this function behaves - exactly the same as AQ_API_WriteBootLoadImage. For additional - documentation and information on return codes, refer to - AQ_API_WriteBootLoadImage. - Individual Port Return codes (same as AQ_API_WriteBootLoadImage, - plus): - AQ_RET_BOOTLOAD_PROVTABLE_TOO_LARGE: The supplied provisioning - table image does not fit within the alloted space.*/ -AQ_Retcode AQ_API_WriteBootLoadImageWithProvTable -( - /*! An array identifying the target PHY ports.*/ - AQ_API_Port** ports, - /*! The length of the arrays ports, provisioningAddresses, and - resultCodes. These are parallel arrays, and must all be of the - same length.*/ - unsigned int numPorts, - /*! The provisioning addresses of each of the PHYs specified in - ports. This can range from 0 through 47, and is also known as - the daisy-chain address or the hop-count. If the PHYs are - connected to a FLASH using the daisy-chain, this is the distance - from the PHY to the FLASH, and is used to identify customized - provisioning for each PHY from the provisioning data within the - image. Otherwise, it is an arbitrary number. The length of this - array must match the length of ports.*/ - unsigned int* provisioningAddresses, - /*! OUT: The result code indicating success or failure of boot- - loading each of the PHYs specified in ports.*/ - AQ_Retcode* resultCodes, - /*! A pointer to the size of the image (in bytes) that is being - loaded into the Aquantia PHY.*/ - uint32_t* imageSizePointer, - /*! The image being loaded into the Aquantia PHY. This is the same - regardless of whether the target is internal RAM or FLASH.*/ - uint8_t* image, - /*! The 5-bit address to be used during the gang-loading operation. - During the boot-loading process, each of the PHYs specified in - ports will be changed such that they are addressed on the MDIO - bus at gangloadAddress. This allows all the PHYs to be loaded - simultaneously. Before returning, each PHY will be moved back to - its original MDIO address. If ports contains only a single - element, callers will probably want to use the PHY's original - MDIO address for this parameter.*/ - uint8_t gangload_MDIO_address, - /*! The address of the PHYs while in gangload mode. This is - ultimately some combination of the system address and the - gangload MDIO address, specified by gangload_MDIO_address. For - most platforms, gangload_MDIO_address and gangload_PHY_ID should - have the same value.*/ - AQ_API_Port* gangloadPort, - /*! A pointer to the size of the provTableImage (in bytes) that is - being loaded into the Aquantia PHY.*/ - uint32_t* provTableSizePointer, - /*! The additional provisioning table image being loaded into the - Aquantia PHY.*/ - uint8_t* provTableImage -); - -/*! Calling this function disables boot-loading and enables the daisy- - chain. This would typically be called after using MDIO boot- - loading on a daisy-chain enabled PHY. Re-enabling the daisy-chain - after performing an MDIO bootload will cause the PHY to reboot - from FLASH.*/ -AQ_Retcode AQ_API_EnableDaisyChain -( - /*! The target PHY port.*/ - AQ_API_Port* port -); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/feeds/ipq807x/aq-fw-download/src/include/AQ_PhyInterface.h b/feeds/ipq807x/aq-fw-download/src/include/AQ_PhyInterface.h deleted file mode 100755 index 66eb817be..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/AQ_PhyInterface.h +++ /dev/null @@ -1,171 +0,0 @@ -/* AQ_PhyInterface.h */ - -/*********************************************************************** -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* Description: -* -* Declares the base PHY register read and write functions that are -* called by the API functions. The platform integrator must provide -* the implementation of these routines. -* -***********************************************************************/ - - -/*! \file - * Declares the base PHY register read and write functions that are - * called by the API functions. The platform integrator must provide - * the implementation of these routines. */ - - -#ifndef AQ_PHY_INTERFACE_TOKEN -#define AQ_PHY_INTERFACE_TOKEN - - -#include "AQ_API.h" -#include "AQ_User.h" - - -#ifdef __cplusplus -extern "C" { -#endif - - -/******************************************************************* - MDIO Access Functions -*******************************************************************/ - -/*! \defgroup mdioAccessFunctions MDIO Access Functions -The MDIO access functions are required by the API to access the register space -of each Aquantia PHY deployed in a system. The body of these functions needs to -be written by the system designer, as the method of accessing the PHY will -be unique to the target system. They are designed to be generic read and -write access functions, as the MDIO addressing scheme relies on each -MMD to maintain a 16 bit address pointer that determines the register where -the next read or write is coming from. Consequently, various levels of -optimization of the MDIO interface are possible: from re-writing the MMD -address pointer on every transaction, to storing shadow copies of the MMD -address pointers and only updating the MMD address pointer as necessary. -Thus these functions leave the MDIO optimization to the system engineer. - */ -/*@{*/ - - -/*! Provides generic synchronous PHY register write functionality. It is the - * responsibility of the system designer to provide the specific MDIO address - * pointer updates, etc. in order to accomplish this write operation. - * It will be assumed that the write has been completed by the time this - * function returns.*/ -void AQ_API_MDIO_Write -( - /*! Uniquely identifies the port within the system. AQ_Port must be - * defined to a whatever data type is suitable for the platform.*/ - AQ_Port PHY_ID, - /*! The address of the MMD within the target PHY. */ - unsigned int MMD, - /*! The 16-bit address of the PHY register being written. */ - unsigned int address, - /*! The 16-bits of data to write to the specified PHY register. */ - unsigned int data -); - -/*! Provides generic synchronous PHY register read functionality. It is the - * responsibility of the system designer to provide the specific MDIO address - * pointer updates, etc. in order to accomplish this read operation.*/ -unsigned int AQ_API_MDIO_Read -( - /*! Uniquely identifies the port within the system. AQ_Port must be - * defined to a whatever data type is suitable for the platform.*/ - AQ_Port PHY_ID, - /*! The address of the MMD within the target PHY. */ - unsigned int MMD, - /*! The 16-bit address of the PHY register being read. */ - unsigned int address -); - -#ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - -/*! Provides generic asynchronous/buffered PHY register write functionality. - * It is the responsibility of the system designer to provide the specific - * MDIO address pointer updates, etc. in order to accomplish this write - * operation. The write need not necessarily have been completed by the time - * this function returns. All register reads and writes to a particular PHY_ID - * that are requested by calling AQ_API_MDIO_BlockWrite or AQ_API_MDIO_BlockRead - * MUST be performed in the order that the calls are made. */ -void AQ_API_MDIO_BlockWrite -( - /*! Uniquely identifies the port within the system. AQ_Port must be - * defined to a whatever data type is suitable for the platform.*/ - AQ_Port PHY_ID, - /*! The address of the MMD within the target PHY. */ - unsigned int MMD, - /*! The 16-bit address of the PHY register being written. */ - unsigned int address, - /*! The 16-bits of data to write to the specified PHY register. */ - unsigned int data -); - -/*! Provides generic asynchronous/buffered PHY register read functionality. - * It is the responsibility of the system designer to provide the specific - * MDIO address pointer updates, etc. in order to accomplish this read - * operation. All register reads and writes to a particular PHY_ID that - * are requested by calling AQ_API_MDIO_BlockWrite or AQ_API_MDIO_BlockRead - * MUST be performed in the order that the calls are made. The register value - * may subsequently be fetched by calling AQ_API_MDIO_BlockOperationExecute.*/ -void AQ_API_MDIO_BlockRead -( - /*! Uniquely identifies the port within the system. AQ_Port must be - * defined to a whatever data type is suitable for the platform.*/ - AQ_Port PHY_ID, - /*! The address of the MMD within the target PHY. */ - unsigned int MMD, - /*! The 16-bit address of the PHY register being read. */ - unsigned int address -); - -/* Retrieve the results of all PHY register reads to PHY_ID previously - * requested via calls to AQ_API_MDIO_BlockRead. The read and write - * operations previously performed by calls to AQ_API_MDIO_BlockRead and - * AQ_API_MDIO_BlockRead must have all been completed by the time this - * function returns, in the order that the calls were performed. The - * return value is an array representing the fetched results of all - * pending calls to AQ_API_MDIO_BlockRead, in the order that the calls - * were performed. Callers should track the number of pending block - * reads to determine the size of the returned array. */ -unsigned int * AQ_API_MDIO_BlockOperationExecute -( - /*! Uniquely identifies the port within the system. AQ_Port must be - * defined to a whatever data type is suitable for the platform.*/ - AQ_Port PHY_ID -); - -/* Returns the maximum number of asynchronous/buffered PHY register - * read/write operations. Callers will call AQ_API_MDIO_BlockOperationExecute - * before issuing additional calls to AQ_API_MDIO_BlockWrite or - * AQ_API_MDIO_BlockRead to avoid a buffer overflow. */ -unsigned int AQ_API_MDIO_MaxBlockOperations -( -); - -#endif - -/*@}*/ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/feeds/ipq807x/aq-fw-download/src/include/AQ_PlatformRoutines.h b/feeds/ipq807x/aq-fw-download/src/include/AQ_PlatformRoutines.h deleted file mode 100755 index 9a16d6408..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/AQ_PlatformRoutines.h +++ /dev/null @@ -1,71 +0,0 @@ -/*AQ_PlatformRoutines.h*/ - -/************************************************************************************ -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* Description: -* -* Declares the platform interface functions that will be called by AQ_API -* functions. The platform integrator must provide the implementation of -* these functions. -* -************************************************************************************/ - -/*! \file - * Declares the platform interface functions that will be called by AQ_API - * functions. The platform integrator must provide the implementation of - * these functions. */ - - -#ifndef AQ_PHY_PLATFORMROUTINES_TOKEN -#define AQ_PHY_PLATFORMROUTINES_TOKEN - -#include - -#include "AQ_API.h" -#include "AQ_User.h" -#include "AQ_ReturnCodes.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/******************************************************************* - Time Delay -*******************************************************************/ - -/*! \defgroup delay Time Delay - @{ -*/ - -/*! Returns after at least milliseconds have elapsed. This must be implemented - * in a platform-approriate way. AQ_API functions will call this function to - * block for the specified period of time. If necessary, PHY register reads - * may be performed on port to busy-wait. */ -void AQ_API_Wait -( - uint32_t milliseconds, /*!< The delay in milliseconds */ - AQ_API_Port* port /*!< The PHY to use if delay reads are necessary*/ -); - -/*@}*/ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/feeds/ipq807x/aq-fw-download/src/include/AQ_RegMacro.h b/feeds/ipq807x/aq-fw-download/src/include/AQ_RegMacro.h deleted file mode 100755 index 8dcca522b..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/AQ_RegMacro.h +++ /dev/null @@ -1,323 +0,0 @@ -/* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -/*! \file - This file contains macros for accessing the AQ PHYs' registers - using the device-specific register map data structures and definitions. -*/ - -#ifndef AQ_REG_MACRO_TOKEN -#define AQ_REG_MACRO_TOKEN - -#include "AQ_PhyInterface.h" - - -#define AQ_API_ReadRegister(id,reg,wd) AQ_API_ReadRegister_DeviceRestricted(APPIA_HHD,id,reg,wd) - -#define AQ_API_ReadRegister_DeviceRestricted(devices,id,reg,wd) AQ_API_ReadRegister_Devs_ ## devices(id,reg,wd) - -#define AQ_API_ReadRegister_Devs_APPIA(id,reg,wd) \ - ((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_Read (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd)) : \ - (0)) - -#define AQ_API_ReadRegister_Devs_HHD(id,reg,wd) \ - ((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_Read (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd)) : \ - (0)) - -#define AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,wd) \ - ((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_Read (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd)) : \ - ((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_Read (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd)) : \ - (0))) - -#define AQ_API_ReadRegister_Devs_HHD_APPIA(id,reg,wd) AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,wd) - - -#define AQ_API_WriteRegister(id,reg,wd,value) AQ_API_WriteRegister_DeviceRestricted(APPIA_HHD,id,reg,wd,value) - -#define AQ_API_WriteRegister_DeviceRestricted(devices,id,reg,wd,value) AQ_API_WriteRegister_Devs_ ## devices(id,reg,wd,value) - -#define AQ_API_WriteRegister_Devs_APPIA(id,reg,wd,value) \ - ((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_Write (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd),value) : \ - ((void)0)) - -#define AQ_API_WriteRegister_Devs_HHD(id,reg,wd,value) \ - ((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_Write (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd),value) : \ - ((void)0)) - -#define AQ_API_WriteRegister_Devs_APPIA_HHD(id,reg,wd,value) \ - ((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_Write (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd),value) : \ - ((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_Write (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd),value) : \ - ((void)0))) - -#define AQ_API_WriteRegister_Devs_HHD_APPIA(id,reg,wd,value) AQ_API_WriteRegister_Devs_APPIA_HHD(id,reg,wd,value) - - -#ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - -#define AQ_API_BlockReadRegister(id,reg,wd) AQ_API_BlockReadRegister_DeviceRestricted(APPIA_HHD,id,reg,wd) - -#define AQ_API_BlockReadRegister_DeviceRestricted(devices,id,reg,wd) AQ_API_BlockReadRegister_Devs_ ## devices(id,reg,wd) - -#define AQ_API_BlockReadRegister_Devs_APPIA(id,reg,wd) \ - ((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_BlockRead (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd)) : \ - ((void)0)) - -#define AQ_API_BlockReadRegister_Devs_HHD(id,reg,wd) \ - ((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_BlockRead (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd)) : \ - ((void)0)) - -#define AQ_API_BlockReadRegister_Devs_APPIA_HHD(id,reg,wd) \ - ((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_BlockRead (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd)) : \ - ((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_BlockRead (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd)) : \ - ((void)0))) - -#define AQ_API_BlockReadRegister_Devs_HHD_APPIA(id,reg,wd) AQ_API_BlockReadRegister_Devs_APPIA_HHD(id,reg,wd) - - -#define AQ_API_BlockWriteRegister(id,reg,wd,value) AQ_API_BlockWriteRegister_DeviceRestricted(APPIA_HHD,id,reg,wd,value) - -#define AQ_API_BlockWriteRegister_DeviceRestricted(devices,id,reg,wd,value) AQ_API_BlockWriteRegister_Devs_ ## devices(id,reg,wd,value) - -#define AQ_API_BlockWriteRegister_Devs_APPIA(id,reg,wd,value) \ - ((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_BlockWrite (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd),value) : \ - ((void)0)) - -#define AQ_API_BlockWriteRegister_Devs_HHD(id,reg,wd,value) \ - ((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_BlockWrite (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd),value) : \ - ((void)0)) - -#define AQ_API_BlockWriteRegister_Devs_APPIA_HHD(id,reg,wd,value) \ - ((port->device == AQ_DEVICE_HHD) ? AQ_API_MDIO_BlockWrite (id,reg ## _HHD_mmdAddress,(reg ## _HHD_baseRegisterAddress + wd),value) : \ - ((port->device == AQ_DEVICE_APPIA) ? AQ_API_MDIO_BlockWrite (id,reg ## _APPIA_mmdAddress,(reg ## _APPIA_baseRegisterAddress + wd),value) : \ - ((void)0))) - -#define AQ_API_BlockWriteRegister_Devs_HHD_APPIA(id,reg,wd,value) AQ_API_BlockWriteRegister_Devs_APPIA_HHD(id,reg,wd,value) - - -#endif - -#define AQ_API_Variable(reg) AQ_API_Variable_DeviceRestricted(APPIA_HHD,reg) - -#define AQ_API_Variable_DeviceRestricted(devices,reg) AQ_API_Variable_Devs_ ## devices(reg) - -#define AQ_API_Variable_Devs_APPIA(reg) uint8_t _local ## reg ## _space[ sizeof(reg ## _BiggestVersion) ];\ - reg ## _APPIA* _local ## reg ## _APPIA = (reg ## _APPIA*) _local ## reg ## _space; \ - -#define AQ_API_Variable_Devs_HHD(reg) uint8_t _local ## reg ## _space[ sizeof(reg ## _BiggestVersion) ];\ - reg ## _HHD* _local ## reg ## _HHD = (reg ## _HHD*) _local ## reg ## _space; \ - -#define AQ_API_Variable_Devs_APPIA_HHD(reg) uint8_t _local ## reg ## _space[ sizeof(reg ## _BiggestVersion) ];\ - reg ## _APPIA* _local ## reg ## _APPIA = (reg ## _APPIA*) _local ## reg ## _space; \ - reg ## _HHD* _local ## reg ## _HHD = (reg ## _HHD*) _local ## reg ## _space; \ - -#define AQ_API_Variable_Devs_HHD_APPIA(reg) AQ_API_Variable_Devs_APPIA_HHD(reg) - - -#define AQ_API_DeclareLocalStruct(reg,localvar) AQ_API_DeclareLocalStruct_DeviceRestricted(APPIA_HHD,reg,localvar) - -#define AQ_API_DeclareLocalStruct_DeviceRestricted(devices,reg,localvar) AQ_API_DeclareLocalStruct_Devs_ ## devices(reg,localvar) - -#define AQ_API_DeclareLocalStruct_Devs_APPIA(reg,localvar) uint8_t localvar ## _space[ sizeof(reg ## _BiggestVersion) ];\ - reg ## _APPIA* localvar ## _APPIA = (reg ## _APPIA*) localvar ## _space; \ - -#define AQ_API_DeclareLocalStruct_Devs_HHD(reg,localvar) uint8_t localvar ## _space[ sizeof(reg ## _BiggestVersion) ];\ - reg ## _HHD* localvar ## _HHD = (reg ## _HHD*) localvar ## _space; \ - -#define AQ_API_DeclareLocalStruct_Devs_APPIA_HHD(reg,localvar) uint8_t localvar ## _space[ sizeof(reg ## _BiggestVersion) ];\ - reg ## _APPIA* localvar ## _APPIA = (reg ## _APPIA*) localvar ## _space; \ - reg ## _HHD* localvar ## _HHD = (reg ## _HHD*) localvar ## _space; \ - -#define AQ_API_DeclareLocalStruct_Devs_HHD_APPIA(reg,localvar) AQ_API_DeclareLocalStruct_Devs_APPIA_HHD(reg,localvar) - - -#define AQ_API_Set(id,reg,field,value) AQ_API_Set_DeviceRestricted(APPIA_HHD,id,reg,field,value) - -#define AQ_API_Set_DeviceRestricted(devices,id,reg,field,value) AQ_API_Set_Devs_ ## devices(id,reg,field,value) - -#define AQ_API_Set_Devs_APPIA(id,reg,field,value) { \ - switch (port->device) { \ - case AQ_DEVICE_APPIA: \ - _local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field = AQ_API_ReadRegister_Devs_APPIA(id,reg,reg ## _APPIA_ ## field); \ - if (_local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field != value) \ - { \ - _local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field = value; \ - AQ_API_WriteRegister_Devs_APPIA(id,reg,reg ## _APPIA_ ## field,_local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field); \ - } \ - break; \ - default: break; \ - } \ -} - -#define AQ_API_Set_Devs_HHD(id,reg,field,value) { \ - switch (port->device) { \ - case AQ_DEVICE_HHD: \ - _local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field = AQ_API_ReadRegister_Devs_HHD(id,reg,reg ## _HHD_ ## field); \ - if (_local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field != value) \ - { \ - _local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field = value; \ - AQ_API_WriteRegister_Devs_HHD(id,reg,reg ## _HHD_ ## field,_local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field); \ - } \ - break; \ - default: break; \ - } \ -} - -#define AQ_API_Set_Devs_APPIA_HHD(id,reg,field,value) { \ - switch (port->device) { \ - case AQ_DEVICE_APPIA: \ - _local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field = AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,reg ## _APPIA_ ## field); \ - if (_local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field != value) \ - { \ - _local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field = value; \ - AQ_API_WriteRegister_Devs_APPIA_HHD(id,reg,reg ## _APPIA_ ## field,_local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field); \ - } \ - break; \ - case AQ_DEVICE_HHD: \ - _local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field = AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,reg ## _HHD_ ## field); \ - if (_local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field != value) \ - { \ - _local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field = value; \ - AQ_API_WriteRegister_Devs_APPIA_HHD(id,reg,reg ## _HHD_ ## field,_local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field); \ - } \ - break; \ - default: break; \ - } \ -} - -#define AQ_API_Set_Devs_HHD_APPIA(id,reg,field,value) AQ_API_Set_Devs_APPIA_HHD(id,reg,field,value) - - -#define AQ_API_Get(id,reg,field,value) AQ_API_Get_DeviceRestricted(APPIA_HHD,id,reg,field,value) - -#define AQ_API_Get_DeviceRestricted(devices,id,reg,field,value) AQ_API_Get_Devs_ ## devices(id,reg,field,value) - -#define AQ_API_Get_Devs_APPIA(id,reg,field,value) { \ - switch (port->device) { \ - case AQ_DEVICE_APPIA: \ - _local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field = AQ_API_ReadRegister_Devs_APPIA(id,reg,reg ## _APPIA_ ## field); \ - value = _local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field; \ - break; \ - default: value = 0; break; \ - } \ -} - -#define AQ_API_Get_Devs_HHD(id,reg,field,value) { \ - switch (port->device) { \ - case AQ_DEVICE_HHD: \ - _local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field = AQ_API_ReadRegister_Devs_HHD(id,reg,reg ## _HHD_ ## field); \ - value = _local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field; \ - break; \ - default: value = 0; break; \ - } \ -} - -#define AQ_API_Get_Devs_APPIA_HHD(id,reg,field,value) { \ - switch (port->device) { \ - case AQ_DEVICE_APPIA: \ - _local ## reg ## _APPIA->word_ ## reg ## _APPIA_ ## field = AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,reg ## _APPIA_ ## field); \ - value = _local ## reg ## _APPIA->bits_ ## reg ## _APPIA_ ## field.field; \ - break; \ - case AQ_DEVICE_HHD: \ - _local ## reg ## _HHD->word_ ## reg ## _HHD_ ## field = AQ_API_ReadRegister_Devs_APPIA_HHD(id,reg,reg ## _HHD_ ## field); \ - value = _local ## reg ## _HHD->bits_ ## reg ## _HHD_ ## field.field; \ - break; \ - default: value = 0; break; \ - } \ -} - -#define AQ_API_Get_Devs_HHD_APPIA(id,reg,field,value) AQ_API_Get_Devs_APPIA_HHD(id,reg,field,value) - - -#define AQ_API_BitfieldOfLocalStruct(reg,localvar,field) AQ_API_BitfieldOfLocalStruct_DeviceRestricted(APPIA_HHD,reg,localvar,field) - -#define AQ_API_BitfieldOfLocalStruct_DeviceRestricted(devices,reg,localvar,field) AQ_API_BitfieldOfLocalStruct_Devs_ ## devices(reg,localvar,field) - -#define AQ_API_BitfieldOfLocalStruct_Devs_APPIA(reg,localvar,field) \ - ((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->bits_ ## reg ## _APPIA ## _ ## field.field) : \ - (0)) - -#define AQ_API_BitfieldOfLocalStruct_Devs_HHD(reg,localvar,field) \ - ((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->bits_ ## reg ## _HHD ## _ ## field.field) : \ - (0)) - -#define AQ_API_BitfieldOfLocalStruct_Devs_APPIA_HHD(reg,localvar,field) \ - ((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->bits_ ## reg ## _HHD ## _ ## field.field) : \ - ((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->bits_ ## reg ## _APPIA ## _ ## field.field) : \ - (0))) - -#define AQ_API_BitfieldOfLocalStruct_Devs_HHD_APPIA(reg,localvar,field) AQ_API_BitfieldOfLocalStruct_Devs_APPIA_HHD(reg,localvar,field) - - -#define AQ_API_AssignBitfieldOfLocalStruct(reg,localvar,field,value) AQ_API_AssignBitfieldOfLocalStruct_DeviceRestricted(APPIA_HHD,reg,localvar,field,value) - -#define AQ_API_AssignBitfieldOfLocalStruct_DeviceRestricted(devices,reg,localvar,field,value) AQ_API_AssignBitfieldOfLocalStruct_Devs_ ## devices(reg,localvar,field,value) - -#define AQ_API_AssignBitfieldOfLocalStruct_Devs_APPIA(reg,localvar,field,value) \ - ((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->bits_ ## reg ## _APPIA ## _ ## field.field = value) : \ - (0)) - -#define AQ_API_AssignBitfieldOfLocalStruct_Devs_HHD(reg,localvar,field,value) \ - ((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->bits_ ## reg ## _HHD ## _ ## field.field = value) : \ - (0)) - -#define AQ_API_AssignBitfieldOfLocalStruct_Devs_APPIA_HHD(reg,localvar,field,value) \ - ((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->bits_ ## reg ## _HHD ## _ ## field.field = value) : \ - ((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->bits_ ## reg ## _APPIA ## _ ## field.field = value) : \ - (0))) - -#define AQ_API_AssignBitfieldOfLocalStruct_Devs_HHD_APPIA(reg,localvar,field,value) AQ_API_AssignBitfieldOfLocalStruct_Devs_APPIA_HHD(reg,localvar,field,value) - - -#define AQ_API_WordOfLocalStruct(localvar,wd) AQ_API_WordOfLocalStruct_DeviceRestricted(APPIA_HHD,localvar,wd) - -#define AQ_API_WordOfLocalStruct_DeviceRestricted(devices,localvar,wd) AQ_API_WordOfLocalStruct_Devs_ ## devices(localvar,wd) - -#define AQ_API_WordOfLocalStruct_Devs_APPIA(localvar,wd) \ - ((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->u ## wd.word_ ## wd) : \ - (0)) - -#define AQ_API_WordOfLocalStruct_Devs_HHD(localvar,wd) \ - ((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->u ## wd.word_ ## wd) : \ - (0)) - -#define AQ_API_WordOfLocalStruct_Devs_APPIA_HHD(localvar,wd) \ - ((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->u ## wd.word_ ## wd) : \ - ((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->u ## wd.word_ ## wd) : \ - (0))) - -#define AQ_API_WordOfLocalStruct_Devs_HHD_APPIA(localvar,wd) AQ_API_WordOfLocalStruct_Devs_APPIA_HHD(localvar,wd) - - -#define AQ_API_AssignWordOfLocalStruct(localvar,wd,value) AQ_API_AssignWordOfLocalStruct_DeviceRestricted(APPIA_HHD,localvar,wd,value) - -#define AQ_API_AssignWordOfLocalStruct_DeviceRestricted(devices,localvar,wd,value) AQ_API_AssignWordOfLocalStruct_Devs_ ## devices(localvar,wd,value) - -#define AQ_API_AssignWordOfLocalStruct_Devs_APPIA(localvar,wd,value) \ - ((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->u ## wd.word_ ## wd = value) : \ - (0)) - -#define AQ_API_AssignWordOfLocalStruct_Devs_HHD(localvar,wd,value) \ - ((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->u ## wd.word_ ## wd = value) : \ - (0)) - -#define AQ_API_AssignWordOfLocalStruct_Devs_APPIA_HHD(localvar,wd,value) \ - ((port->device == AQ_DEVICE_HHD) ? ((localvar ## _HHD)->u ## wd.word_ ## wd = value) : \ - ((port->device == AQ_DEVICE_APPIA) ? ((localvar ## _APPIA)->u ## wd.word_ ## wd = value) : \ - (0))) - -#define AQ_API_AssignWordOfLocalStruct_Devs_HHD_APPIA(localvar,wd,value) AQ_API_AssignWordOfLocalStruct_Devs_APPIA_HHD(localvar,wd,value) - - -#endif - diff --git a/feeds/ipq807x/aq-fw-download/src/include/AQ_ReturnCodes.h b/feeds/ipq807x/aq-fw-download/src/include/AQ_ReturnCodes.h deleted file mode 100755 index bff083b03..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/AQ_ReturnCodes.h +++ /dev/null @@ -1,113 +0,0 @@ -/* AQ_ReturnCodes.h */ - -/************************************************************************************ -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* Description: -* -* This file defines the AQ_API functions' integral return codes. -* -* -************************************************************************************/ - -/*! \file - This file defines the AQ_API functions' integral return codes. -*/ - -#ifndef AQ_RETURNCODES_TOKEN -#define AQ_RETURNCODES_TOKEN - - -/*! \defgroup ReturnCodes - @{ -*/ - -/*! Most AQ_API functions return AQ_Retcode to report success or failure. - * The values used are defined as preprocessor symbols in AQ_ReturnCodes.h. - * Callers should prefer to test the return values by equivalence to these - * symbols, rather than using the integer values directly, as these may - * not be stable across releases. The set of possible return codes that may - * be returned by a particular API function can be found in the function's - * documentation, as well as information on how to interpret each of the - * possible return codes. */ -typedef unsigned int AQ_Retcode; - -/*! \defgroup Success - @{ */ -#define AQ_RET_OK 0 -/*@}*/ - - -/*! \defgroup GeneralErrors - @{ */ -#define AQ_RET_ERROR 100 -#define AQ_RET_UP_BUSY_TIMEOUT 101 -/*@}*/ - -/*! \defgroup FunctionSpecificResults - @{ */ -#define AQ_RET_FLASH_READY 200 -#define AQ_RET_FLASH_READINESS_TIMEOUT 204 - -#define AQ_RET_FLASHINTF_READY 201 -#define AQ_RET_FLASHINTF_NOTREADY 202 -#define AQ_RET_FLASHINTF_READINESS_TIMEOUT 203 - -#define AQ_RET_FLASH_TYPE_UNKNOWN 205 -#define AQ_RET_FLASH_TYPE_BAD 206 - -#define AQ_RET_FLASH_IMAGE_CORRUPT 207 -#define AQ_RET_FLASH_IMAGE_TOO_LARGE 208 -#define AQ_RET_FLASH_IMAGE_MISMATCH 209 - -#define AQ_RET_FLASH_PAGE_SIZE_CHANGED 210 - -#define AQ_RET_BOOTLOAD_PROVADDR_OOR 211 -#define AQ_RET_BOOTLOAD_NONUNIFORM_REGVALS 212 -#define AQ_RET_BOOTLOAD_CRC_MISMATCH 213 -#define AQ_RET_BOOTLOAD_PROVTABLE_TOO_LARGE 228 - -#define AQ_RET_LOOPBACK_BAD_ENTRY_STATE 214 - -#define AQ_RET_DEBUGTRACE_FREEZE_TIMEOUT 215 -#define AQ_RET_DEBUGTRACE_UNFREEZE_TIMEOUT 216 - -#define AQ_RET_CABLEDIAG_ALREADY_RUNNING 217 -#define AQ_RET_CABLEDIAG_STILL_RUNNING 218 -#define AQ_RET_CABLEDIAG_BAD_PAIRSTATUS 219 -#define AQ_RET_CABLEDIAG_RESULTS_ALREDY_COLLECTED 220 -#define AQ_RET_CABLEDIAG_BAD_NUM_SAMPLES 221 -#define AQ_RET_CABLEDIAG_REPORTEDPAIR_MISMATCH 222 -#define AQ_RET_CABLEDIAG_REPORTEDPAIR_OOR 223 -#define AQ_RET_CABLEDIAG_STARTED_PAIR_B 224 -#define AQ_RET_CABLEDIAG_STARTED_PAIR_C 225 -#define AQ_RET_CABLEDIAG_STARTED_PAIR_D 226 -#define AQ_RET_CABLEDIAG_TXENABLE_MISMATCH 227 - -#define AQ_RET_SERDESEYE_BAD_SERDES_MODE 229 -#define AQ_RET_SERDESEYE_BAD_MEAS_COUNT 230 -#define AQ_RET_SERDESEYE_MEAS_TIMEOUT 231 -#define AQ_RET_SERDESEYE_LANE_OOR 232 -#define AQ_RET_SERDESEYE_COORD_OOR 233 - -#define AQ_RET_PIFMAILBOX_ERROR 234 -#define AQ_RET_PIFMAILBOX_TIMEOUT 235 - -#define AQ_RET_SEC_TABLE_INDEX_OOR 236 -/*@}*/ - -/*@}*/ - -#endif diff --git a/feeds/ipq807x/aq-fw-download/src/include/AQ_User.h b/feeds/ipq807x/aq-fw-download/src/include/AQ_User.h deleted file mode 100755 index c7526a7cb..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/AQ_User.h +++ /dev/null @@ -1,97 +0,0 @@ -/*AQ_User.h*/ - -/************************************************************************************ -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* Description: -* -* This file contains preprocessor symbol definitions and type definitions -* for the platform-integrator controlled compile-time AQ_API options. -* -************************************************************************************/ - -/*! \file - This file contains preprocessor symbol definitions and type definitions - for the platform-integrator controlled compile-time AQ_API options. -*/ - -#ifndef AQ_USER_TOKEN -#define AQ_USER_TOKEN - -/*! \defgroup User User Definitions -This module contains the definitions used to configure AQ_API behavior as desired. */ -/*@{*/ - - -/*! Specify the proper data type for AQ_Port. This will depend on the - * platform-specific implementation of the PHY register read/write functions.*/ -typedef unsigned int AQ_Port; - - -/*! If defined, AQ_API functions will print various error and info messages - * to stdout. If not, nothing will be printed and AQ_API.c will NOT include - * stdio.h. */ -#define AQ_VERBOSE - - -/*! If defined, the PHY interface supports block (asynchronous) read/write - * operation. If AQ_PHY_SUPPORTS_BLOCK_READ_WRITE is defined, then - * the API will call the block-operation functions and so implementations - * for each must be provided. If AQ_PHY_SUPPORTS_BLOCK_READ_WRITE is not - * defined, they will not be called, and need not be implemented. */ -#undef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - - -/*! If defined, time.h exists, and so the associated functions wil be used to - * compute the elapsed time spent in a polling loop, to ensure that the - * maximum time-out period will not be exceeded. If not defined, then - * AQ_MDIO_READS_PER_SECOND will be used to calculate the minimum possible - * elapsed time. */ -#define AQ_TIME_T_EXISTS - - -/*! The maximum number of synchronous PHY register reads that can be performed - * per second. A worst case number can be derived as follows: - * - * AQ_MDIO_READS_PER_SECOND = MDIO Clock Frequency / 64 - * - * If using MDIO preamble suppression, multiply this number by 2 - * - * For instance, if a 5MHz MDIO clock is being used without preamble supression - * AQ_MDIO_READS_PER_SECOND = 78125 - * - * If AQ_TIME_T_EXISTS is defined, this will be ignored and need not be - * defined. If AQ_TIME_T_EXISTS is not defined, this must be defined. */ -#define AQ_MDIO_READS_PER_SECOND 78125 - - -/*! If defined, after writing to one of the registers that can trigger a - * processor-intensive MDIO operation, AQ_API functions will poll the - * the "processor intensive MDIO operation in progress" bit and wait for it - * to be zero before proceeding. */ -#define AQ_ENABLE_UP_BUSY_CHECKS - - -/*! If defined, the register map header files containing reverse-packed - * structs will be included. If not, the register map header files containing - * non-reverse-packed structs will be included. The proper choice is typically - * a function of the endianness of the platform; on big-endian systems the - * reverse-packed structs should be used, and on little-endian systems the - * non-reverse-packed structs should be used. */ -/*#define AQ_REVERSED_BITFIELD_ORDERING*/ - -/*@}*/ -#endif - diff --git a/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers.h b/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers.h deleted file mode 100755 index a9485f5a4..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers.h +++ /dev/null @@ -1,5581 +0,0 @@ -/*! \file -* This file contains the data structures and doxygen comments -* for the Global Registers block. - */ - -/*! \addtogroup registerMap - @{ -*/ - -/*! \defgroup Global_registers Global Registers -* This module contains the data structures and doxygen comments -* for the Global Registers block. - */ -/*********************************************************************** -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* $Date: 2014/04/08 $ -* -* $Label: $ -* -* Description: -* -* This file contains the c header structures for the registers contained in the Global Registers block. -* -* The bit fields in this structure are from LSbit to MSbit -* -***********************************************************************/ - - -/*@{*/ -#ifndef AQ_APPIA_GLOBAL_REGS_HEADER -#define AQ_APPIA_GLOBAL_REGS_HEADER - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Control 1: 1E.0000 */ -/* Global Standard Control 1: 1E.0000 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Control 1 */ - union - { - struct - { - unsigned int reserved1 : 11; - /*! \brief 1E.0000.B R/WPD Low Power - AQ_GlobalStandardControl_1_APPIA.u0.bits_0.lowPower - - Provisionable Default = 0x0 - - 1 = Low-power mode - 0 = Normal operation - - - Notes: - A one written to this register causes the chip to enter low-power mode. This bit puts the entire chip in low-power mode, with only the MDIO and microprocessor functioning, and turns off the analog front-end: i.e. places it in high-impedance mode. Setting this bit also sets all of the Low Power bits in the other MMDs. */ - unsigned int lowPower : 1; /* 1E.0000.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Low-power mode - 0 = Normal operation - */ - unsigned int reserved0 : 2; - /*! \brief 1E.0000.E R/WSC Hard Reset - AQ_GlobalStandardControl_1_APPIA.u0.bits_0.hardReset - - Default = 0x0 - - 1 = Global hard reset - 0 = Normal operation - - - Notes: - Setting this bit initiates a global hard reset, equivalent to pulling the reset pin low. This is a level sensitive pin that connects into the power-on reset generation circuitry to initiate a complete power-on reset. */ - unsigned int hardReset : 1; /* 1E.0000.E R/WSC Default = 0x0 */ - /* 1 = Global hard reset - 0 = Normal operation - */ - /*! \brief 1E.0000.F R/WSC Soft Reset - AQ_GlobalStandardControl_1_APPIA.u0.bits_0.softReset - - Default = 0x1 - - 1 = Global soft reset - 0 = Normal operation - - - Notes: - Setting this bit initiates a global soft reset on all of the digital logic, including the microprocessor. Upon completion of the reset sequence, this bit is set back to 0. */ - unsigned int softReset : 1; /* 1E.0000.F R/WSC Default = 0x1 */ - /* 1 = Global soft reset - 0 = Normal operation - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardControl_1_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Device Identifier: 1E.0002 */ -/* Global Standard Device Identifier: 1E.0002 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Device Identifier */ - union - { - struct - { - /*! \brief 1E.0002.F:0 RO Device ID MSW [1F:10] - AQ_GlobalStandardDeviceIdentifier_APPIA.u0.bits_0.deviceIdMSW - - - - Bits 31 - 16 of Device ID - */ - unsigned int deviceIdMSW : 16; /* 1E.0002.F:0 RO */ - /* Bits 31 - 16 of Device ID */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Standard Device Identifier */ - union - { - struct - { - /*! \brief 1E.0003.F:0 RO Device ID LSW [F:0] - AQ_GlobalStandardDeviceIdentifier_APPIA.u1.bits_1.deviceIdLSW - - - - Bits 15 - 0 of Device ID - */ - unsigned int deviceIdLSW : 16; /* 1E.0003.F:0 RO */ - /* Bits 15 - 0 of Device ID */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalStandardDeviceIdentifier_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Devices in Package: 1E.0005 */ -/* Global Standard Devices in Package: 1E.0005 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Devices in Package */ - union - { - struct - { - /*! \brief 1E.0005.0 ROS Clause 22 Registers Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.clause_22RegistersPresent - - Default = 0x0 - - 1 = Clause 22 registers are present in package - 0 = Clause 22 registers are not present in package - - Notes: - This is always set to 0 in the PHY, as there are no Clause 22 registers in the device. */ - unsigned int clause_22RegistersPresent : 1; /* 1E.0005.0 ROS Default = 0x0 */ - /* 1 = Clause 22 registers are present in package - 0 = Clause 22 registers are not present in package */ - /*! \brief 1E.0005.1 ROS PMA Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.pmaPresent - - Default = 0x1 - - 1 = PMA is present in package - 0 = PMA is not present - - Notes: - This is always set to 1 as there is PMA functionality in the PHY. */ - unsigned int pmaPresent : 1; /* 1E.0005.1 ROS Default = 0x1 */ - /* 1 = PMA is present in package - 0 = PMA is not present */ - /*! \brief 1E.0005.2 ROS WIS Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.wisPresent - - Default = 0x0 - - 1 = WIS is present in package - 0 = WIS is not present in package - - Notes: - This is always set to 0, as there is no WIS functionality in the PHY. */ - unsigned int wisPresent : 1; /* 1E.0005.2 ROS Default = 0x0 */ - /* 1 = WIS is present in package - 0 = WIS is not present in package */ - /*! \brief 1E.0005.3 ROS PCS Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.pcsPresent - - Default = 0x1 - - 1 = PCS is present in package - 0 = PCS is not present in package - - Notes: - This is always set to 1 as there is PCS functionality in the PHY. */ - unsigned int pcsPresent : 1; /* 1E.0005.3 ROS Default = 0x1 */ - /* 1 = PCS is present in package - 0 = PCS is not present in package */ - /*! \brief 1E.0005.4 ROS PHY XS Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.phyXS_Present - - Default = 0x1 - - 1 = PHY XS is present in package - 0 = PHY XS is not present in package - - Notes: - This is always set to 1 as there is a PHY XS interface in the PHY. */ - unsigned int phyXS_Present : 1; /* 1E.0005.4 ROS Default = 0x1 */ - /* 1 = PHY XS is present in package - 0 = PHY XS is not present in package */ - /*! \brief 1E.0005.5 ROS DTE XS Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.dteXsPresent - - Default = 0x0 - - 1 = DTE XS is present in package - 0 = DTE XS is not present in package - - - Notes: - This is always set to 0, as there is no DTE XAUI interface in the PHY. */ - unsigned int dteXsPresent : 1; /* 1E.0005.5 ROS Default = 0x0 */ - /* 1 = DTE XS is present in package - 0 = DTE XS is not present in package - */ - /*! \brief 1E.0005.6 ROS TC Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.tcPresent - - Default = 0x0 - - 1 = TC is present in package - 0 = TC is not present in package - - Notes: - This is always set to 0, as there is no TC functionality in the PHY. */ - unsigned int tcPresent : 1; /* 1E.0005.6 ROS Default = 0x0 */ - /* 1 = TC is present in package - 0 = TC is not present in package */ - /*! \brief 1E.0005.7 ROS Autonegotiation Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.autonegotiationPresent - - Default = 0x1 - - 1 = Autonegotiation is present in package - 0 = Autonegotiation is not present in package - - Notes: - This is always set to 1, as there is Autonegotiation in the PHY. */ - unsigned int autonegotiationPresent : 1; /* 1E.0005.7 ROS Default = 0x1 */ - /* 1 = Autonegotiation is present in package - 0 = Autonegotiation is not present in package */ - unsigned int reserved0 : 8; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardDevicesInPackage_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Vendor Devices in Package: 1E.0006 */ -/* Global Standard Vendor Devices in Package: 1E.0006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Vendor Devices in Package */ - union - { - struct - { - unsigned int reserved0 : 13; - /*! \brief 1E.0006.D ROS Clause 22 Extension Present - AQ_GlobalStandardVendorDevicesInPackage_APPIA.u0.bits_0.clause_22ExtensionPresent - - Default = 0x1 - - 1 = Clause 22 Extension is present in package - 0 = Clause 22 Extension is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the GbE registers. */ - unsigned int clause_22ExtensionPresent : 1; /* 1E.0006.D ROS Default = 0x1 */ - /* 1 = Clause 22 Extension is present in package - 0 = Clause 22 Extension is not present in package */ - /*! \brief 1E.0006.E ROS Vendor Specific Device #1 Present - AQ_GlobalStandardVendorDevicesInPackage_APPIA.u0.bits_0.vendorSpecificDevice_1Present - - Default = 0x1 - - 1 = Device #1 is present in package - 0 = Device #1 is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the global control registers. */ - unsigned int vendorSpecificDevice_1Present : 1; /* 1E.0006.E ROS Default = 0x1 */ - /* 1 = Device #1 is present in package - 0 = Device #1 is not present in package */ - /*! \brief 1E.0006.F ROS Vendor Specific Device #2 Present - AQ_GlobalStandardVendorDevicesInPackage_APPIA.u0.bits_0.vendorSpecificDevice_2Present - - Default = 0x1 - - 1 = Device #2 is present in package - 0 = Device #2 is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the DSP PMA registers. */ - unsigned int vendorSpecificDevice_2Present : 1; /* 1E.0006.F ROS Default = 0x1 */ - /* 1 = Device #2 is present in package - 0 = Device #2 is not present in package */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardVendorDevicesInPackage_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Status 2: 1E.0008 */ -/* Global Standard Status 2: 1E.0008 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Status 2 */ - union - { - struct - { - unsigned int reserved0 : 14; - /*! \brief 1E.0008.F:E ROS Device Present [1:0] - AQ_GlobalStandardStatus_2_APPIA.u0.bits_0.devicePresent - - Default = 0x2 - - [F:E] - 0x3 = No device at this address - 0x2 = Device present at this address - 0x1 = No device at this address - 0x0 = No device at this address - - Notes: - This field is always set to 0x2, as the Global MMD resides here in the PHY. */ - unsigned int devicePresent : 2; /* 1E.0008.F:E ROS Default = 0x2 */ - /* [F:E] - 0x3 = No device at this address - 0x2 = Device present at this address - 0x1 = No device at this address - 0x0 = No device at this address */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardStatus_2_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Package Identifier: 1E.000E */ -/* Global Standard Package Identifier: 1E.000E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Package Identifier */ - union - { - struct - { - /*! \brief 1E.000E.F:0 RO Package ID MSW [1F:10] - AQ_GlobalStandardPackageIdentifier_APPIA.u0.bits_0.packageIdMSW - - - - Bits 31- 16 of Package ID - */ - unsigned int packageIdMSW : 16; /* 1E.000E.F:0 RO */ - /* Bits 31- 16 of Package ID */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Standard Package Identifier */ - union - { - struct - { - /*! \brief 1E.000F.F:0 RO Package ID LSW [F:0] - AQ_GlobalStandardPackageIdentifier_APPIA.u1.bits_1.packageIdLSW - - - - Bits 15 - 0 of Package ID - */ - unsigned int packageIdLSW : 16; /* 1E.000F.F:0 RO */ - /* Bits 15 - 0 of Package ID */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalStandardPackageIdentifier_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Firmware ID: 1E.0020 */ -/* Global Firmware ID: 1E.0020 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Firmware ID */ - union - { - struct - { - /*! \brief 1E.0020.7:0 RO Firmware Minor Revision Number [7:0] - AQ_GlobalFirmwareID_APPIA.u0.bits_0.firmwareMinorRevisionNumber - - - - [7:0] = Minor revision number - - Notes: - - - The lower six bits of major and minor firmware revision are exchanged in autonegotiation when the PHYID message is sent. */ - unsigned int firmwareMinorRevisionNumber : 8; /* 1E.0020.7:0 RO */ - /* [7:0] = Minor revision number */ - /*! \brief 1E.0020.F:8 RO Firmware Major Revision Number [7:0] - AQ_GlobalFirmwareID_APPIA.u0.bits_0.firmwareMajorRevisionNumber - - - - [F:8] = Major revision number - - Notes: - - - The lower six bits of major and minor firmware revision are exchanged in autonegotiation when the PHYID message is sent. */ - unsigned int firmwareMajorRevisionNumber : 8; /* 1E.0020.F:8 RO */ - /* [F:8] = Major revision number */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalFirmwareID_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip Identification: 1E.0021 */ -/* Global Chip Identification: 1E.0021 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip Identification */ - union - { - struct - { - /*! \brief 1E.0021.F:0 RO Chip Identification [F:0] - AQ_GlobalChipIdentification_APPIA.u0.bits_0.chipIdentification - - - - Hardware Chip ID - - Notes: - This value is a hard-coded chip ID */ - unsigned int chipIdentification : 16; /* 1E.0021.F:0 RO */ - /* Hardware Chip ID */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChipIdentification_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip Revision: 1E.0022 */ -/* Global Chip Revision: 1E.0022 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip Revision */ - union - { - struct - { - /*! \brief 1E.0022.F:0 RO Chip Revision [F:0] - AQ_GlobalChipRevision_APPIA.u0.bits_0.chipRevision - - - - Hardware Chip Revision - - Notes: - This value is a hard-coded chip revision */ - unsigned int chipRevision : 16; /* 1E.0022.F:0 RO */ - /* Hardware Chip Revision */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChipRevision_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global NVR Interface: 1E.0100 */ -/* Global NVR Interface: 1E.0100 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0100.7:0 R/W NVR Opcode [7:0] - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrOpcode - - Default = 0x03 - - NVR instruction opcode - - */ - unsigned int nvrOpcode : 8; /* 1E.0100.7:0 R/W Default = 0x03 */ - /* NVR instruction opcode - */ - /*! \brief 1E.0100.8 RO NVR Busy - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrBusy - - - - 1 = NVR is busy - 0 = NVR is ready - - - Notes: - When set to 1, the NVR is busy. A new NVR operation should not occur until this bit is 0. If the NVR clock is greater than 64/63 of the MDIO clock, this bit never needs to be polled when operating over the MDIO. */ - unsigned int nvrBusy : 1; /* 1E.0100.8 RO */ - /* 1 = NVR is busy - 0 = NVR is ready - */ - unsigned int reserved1 : 1; - /*! \brief 1E.0100.A R/W NVR Burst - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrBurst - - Default = 0x0 - - 0 = Single read or write operation of up to 4 bytes - 1 = Burst operation - - - Notes: - When this bit is set, the operation is a burst operation where more than 32-bits is read from the NVR or written to the NVR. This bit should be set to one until the last burst in the read or write operation, when it should be set to zero. It operates by gating the SPI clock, and not restarting it until new data is ready to be written, or the previous contents have been read. Each burst of data requires the NVR Execute Operation bit to be set to initiate the next phase. */ - unsigned int nvrBurst : 1; /* 1E.0100.A R/W Default = 0x0 */ - /* 0 = Single read or write operation of up to 4 bytes - 1 = Burst operation - */ - unsigned int reserved0 : 1; - /*! \brief 1E.0100.C R/WSC Reset NVR CRC - AQ_GlobalNvrInterface_APPIA.u0.bits_0.resetNvrCrc - - Default = 0x0 - - 1 = Reset NVR Mailbox CRC calculation register - - - Notes: - To prevent an erroneous answer, this bit should not be set at the same time the See NVR Operation Valid bit is set. */ - unsigned int resetNvrCrc : 1; /* 1E.0100.C R/WSC Default = 0x0 */ - /* 1 = Reset NVR Mailbox CRC calculation register - */ - /*! \brief 1E.0100.D R/W Freeze NVR CRC - AQ_GlobalNvrInterface_APPIA.u0.bits_0.freezeNvrCrc - - Default = 0x0 - - 1 = Freeze NVR Mailbox CRC calculation register - - - Notes: - To prevent an erroneous answer, this bit should not be set at the same time the See NVR Operation Valid bit is set. */ - unsigned int freezeNvrCrc : 1; /* 1E.0100.D R/W Default = 0x0 */ - /* 1 = Freeze NVR Mailbox CRC calculation register - */ - /*! \brief 1E.0100.E R/W NVR Write Mode - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrWriteMode - - Default = 0x0 - - 1 = Write to NVR - 0 = Read from NVR - - */ - unsigned int nvrWriteMode : 1; /* 1E.0100.E R/W Default = 0x0 */ - /* 1 = Write to NVR - 0 = Read from NVR - */ - /*! \brief 1E.0100.F R/WSC NVR Execute Operation - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrExecuteOperation - - Default = 0x0 - - 1 = Start NVR Operation - - - Notes: - When set to 1, the NVR operation will begin. Ensure that the uP is stalled using the See MCP Run Stall bit to ensure no NVR contention. */ - unsigned int nvrExecuteOperation : 1; /* 1E.0100.F R/WSC Default = 0x0 */ - /* 1 = Start NVR Operation - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0101.F:0 RO NVR Mailbox CRC [F:0] - AQ_GlobalNvrInterface_APPIA.u1.bits_1.nvrMailboxCrc - - - - The running CRC-16 of everything passing through the NVR interface - - - Notes: - The CRC-16 over all data written or read through the NVR interface. The CRC-16 is calculated by dividing the data by: - x^16 + x^12 + x^5 + 1 */ - unsigned int nvrMailboxCrc : 16; /* 1E.0101.F:0 RO */ - /* The running CRC-16 of everything passing through the NVR interface - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0102.7:0 R/W NVR Address MSW [17:10] - AQ_GlobalNvrInterface_APPIA.u2.bits_2.nvrAddressMSW - - Default = 0x00 - - NVR address MSW bits [17:10] - - - Notes: - The address of where to read and write from in the NVR. This is self-incrementing and will automatically increment after each read or write operation. The increment amount is based on the data length (i.e. increments by 4 if the data length is 4 bytes) */ - unsigned int nvrAddressMSW : 8; /* 1E.0102.7:0 R/W Default = 0x00 */ - /* NVR address MSW bits [17:10] - */ - unsigned int reserved0 : 8; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0103.F:0 R/W NVR Address LSW [F:0] - AQ_GlobalNvrInterface_APPIA.u3.bits_3.nvrAddressLSW - - Default = 0x0000 - - NVR address LSW bits [F:0] - - - Notes: - The address of where to read and write from in the NVR. This is self-incrementing and will automatically increment after each read or write operation. */ - unsigned int nvrAddressLSW : 16; /* 1E.0103.F:0 R/W Default = 0x0000 */ - /* NVR address LSW bits [F:0] - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0104.F:0 R/W NVR Data MSW [1F:10] - AQ_GlobalNvrInterface_APPIA.u4.bits_4.nvrDataMSW - - Default = 0x0000 - - NVR data MSW bits [1F:10] - - - Notes: - Data is stored and read-out from these registers in little-endian format for operations such as FLASH device ID, and for programming the processor. - - For instance the 64K Atmel device code reads out as two bytes 0x651F into the LSW register, whereas the datasheet indicates that 1F is the first byte read, followed by 65 as the second byte. - - To burst read and write these 4 bytes in the correct order (where DD is written to address x), they should be stored as: - - AA BB in the MSW - CC DD in the LSW. */ - unsigned int nvrDataMSW : 16; /* 1E.0104.F:0 R/W Default = 0x0000 */ - /* NVR data MSW bits [1F:10] - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0105.F:0 R/W NVR Data LSW [F:0] - AQ_GlobalNvrInterface_APPIA.u5.bits_5.nvrDataLSW - - Default = 0x0000 - - NVR data LSW bits [F:0] - - - Notes: - Data is stored and read-out from these registers in little-endian format for operations such as FLASH device ID, and for programming the processor. - - For instance the 64K Atmel device code reads out as two bytes 0x651F into the LSW register, whereas the datasheet indicates that 1F is the first byte read, followed by 65 as the second byte. - To burst read and write these 4 bytes in the correct order (where DD is written to address x), they should be stored as: - - AA BB in the MSW - CC DD in the LSW. */ - unsigned int nvrDataLSW : 16; /* 1E.0105.F:0 R/W Default = 0x0000 */ - /* NVR data LSW bits [F:0] - */ - } bits_5; - uint16_t word_5; - } u5; -} AQ_GlobalNvrInterface_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Mailbox Interface: 1E.0200 */ -/* Global Mailbox Interface: 1E.0200 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Mailbox Interface */ - union - { - struct - { - unsigned int reserved2 : 8; - /*! \brief 1E.0200.8 RO uP Mailbox Busy - AQ_GlobalMailboxInterface_APPIA.u0.bits_0.upMailboxBusy - - - - 1 = uP mailbox busy - 0 = uP mailbox ready - - - Notes: - In general the uP will respond within a few processor cycles to any PIF slave request, much faster than the MDIO. If the busy is asserted over multiple MDIO polling cycles, then a H/W error may have occured and a Global S/W reset or uP reset is required. */ - unsigned int upMailboxBusy : 1; /* 1E.0200.8 RO */ - /* 1 = uP mailbox busy - 0 = uP mailbox ready - */ - unsigned int reserved1 : 3; - /*! \brief 1E.0200.C R/WSC Reset uP Mailbox CRC - AQ_GlobalMailboxInterface_APPIA.u0.bits_0.resetUpMailboxCrc - - Default = 0x0 - - 1 = Reset uP mailbox CRC calculation register - - */ - unsigned int resetUpMailboxCrc : 1; /* 1E.0200.C R/WSC Default = 0x0 */ - /* 1 = Reset uP mailbox CRC calculation register - */ - unsigned int reserved0 : 1; - /*! \brief 1E.0200.E R/W uP Mailbox Write Mode - AQ_GlobalMailboxInterface_APPIA.u0.bits_0.upMailboxWriteMode - - Default = 0x0 - - 1 = Write - 0 = Read - - - Notes: - Mailbox direction */ - unsigned int upMailboxWriteMode : 1; /* 1E.0200.E R/W Default = 0x0 */ - /* 1 = Write - 0 = Read - */ - /*! \brief 1E.0200.F R/WSC uP Mailbox Execute Operation - AQ_GlobalMailboxInterface_APPIA.u0.bits_0.upMailboxExecuteOperation - - Default = 0x0 - - 1 = Start of mailbox Operation - - - Notes: - Indicates mailbox is loaded and ready */ - unsigned int upMailboxExecuteOperation : 1; /* 1E.0200.F R/WSC Default = 0x0 */ - /* 1 = Start of mailbox Operation - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0201.F:0 RO uP Mailbox CRC [F:0] - AQ_GlobalMailboxInterface_APPIA.u1.bits_1.upMailboxCrc - - - - The running CRC-16 of everything passing through the mailbox interface - - */ - unsigned int upMailboxCrc : 16; /* 1E.0201.F:0 RO */ - /* The running CRC-16 of everything passing through the mailbox interface - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0202.F:0 R/W uP Mailbox Address MSW [1F:10] - AQ_GlobalMailboxInterface_APPIA.u2.bits_2.upMailboxAddressMSW - - Default = 0x0000 - - uP Mailbox MSW address - - - Notes: - The address of where to read and write from in the Microcontroller Mailbox. This is self-incrementing and automatically increments after each read and write operation.PHY */ - unsigned int upMailboxAddressMSW : 16; /* 1E.0202.F:0 R/W Default = 0x0000 */ - /* uP Mailbox MSW address - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0203.1:0 RO uP Mailbox Address LSW Don't Care [1:0] - AQ_GlobalMailboxInterface_APPIA.u3.bits_3.upMailboxAddressLSW_Don_tCare - - - - Least significant uP LSW Mailbox address bits [1:0] - - - Notes: - These bits are always set to 0 since each memory access is on a 4-byte boundary. */ - unsigned int upMailboxAddressLSW_Don_tCare : 2; /* 1E.0203.1:0 RO */ - /* Least significant uP LSW Mailbox address bits [1:0] - */ - /*! \brief 1E.0203.F:2 R/W uP Mailbox Address LSW [F:2] - AQ_GlobalMailboxInterface_APPIA.u3.bits_3.upMailboxAddressLSW - - Default = 0x0000 - - uP LSW Mailbox address [F:2] - - - Notes: - The address of where to read and write from in the Microcontroller Mailbox. This is self-incrementing and automatically increments after each read and write operation.PHY */ - unsigned int upMailboxAddressLSW : 14; /* 1E.0203.F:2 R/W Default = 0x0000 */ - /* uP LSW Mailbox address [F:2] - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0204.F:0 R/W uP Mailbox Data MSW [1F:10] - AQ_GlobalMailboxInterface_APPIA.u4.bits_4.upMailboxDataMSW - - Default = 0x0000 - - uP Mailbox data MSW - - */ - unsigned int upMailboxDataMSW : 16; /* 1E.0204.F:0 R/W Default = 0x0000 */ - /* uP Mailbox data MSW - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0205.F:0 R/W uP Mailbox Data LSW [F:0] - AQ_GlobalMailboxInterface_APPIA.u5.bits_5.upMailboxDataLSW - - Default = 0x0000 - - uP Mailbox data LSW - - */ - unsigned int upMailboxDataLSW : 16; /* 1E.0205.F:0 R/W Default = 0x0000 */ - /* uP Mailbox data LSW - */ - } bits_5; - uint16_t word_5; - } u5; -} AQ_GlobalMailboxInterface_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Microprocessor Scratch Pad: 1E.0300 */ -/* Global Microprocessor Scratch Pad: 1E.0300 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Microprocessor Scratch Pad */ - union - { - struct - { - /*! \brief 1E.0300.F:0 R/W Scratch Pad 1[F:0] - AQ_GlobalMicroprocessorScratchPad_APPIA.u0.bits_0.scratchPad_1 - - Default = 0x0000 - - General Purpose Scratch Pad1 - */ - unsigned int scratchPad_1 : 16; /* 1E.0300.F:0 R/W Default = 0x0000 */ - /* General Purpose Scratch Pad1 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Microprocessor Scratch Pad */ - union - { - struct - { - /*! \brief 1E.0301.F:0 R/W Scratch Pad 2 [F:0] - AQ_GlobalMicroprocessorScratchPad_APPIA.u1.bits_1.scratchPad_2 - - Default = 0x0000 - - General Purpose Scratch P - */ - unsigned int scratchPad_2 : 16; /* 1E.0301.F:0 R/W Default = 0x0000 */ - /* General Purpose Scratch P */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalMicroprocessorScratchPad_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Control: 1E.C000 */ -/* Global Control: 1E.C000 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Control */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Control */ - union - { - struct - { - /*! \brief 1E.C001.0 R/W uP Run Stall - AQ_GlobalControl_APPIA.u1.bits_1.upRunStall - - Default = 0x0 - - 1 = uP Run Stall - 0 = uP normal mode - - - Notes: - Deactivates the uP. The PIF slave bus for inbound requests will still be active. This bit is muliplexed with the "MDIO Boot Load" pin with the See uP Run Stall Override bit as the select. When the "MDIO Boot Load" pin is asserted, the uP will be in Run Stall mode after reset. */ - unsigned int upRunStall : 1; /* 1E.C001.0 R/W Default = 0x0 */ - /* 1 = uP Run Stall - 0 = uP normal mode - */ - unsigned int reserved1 : 5; - /*! \brief 1E.C001.6 R/W uP Run Stall Override - AQ_GlobalControl_APPIA.u1.bits_1.upRunStallOverride - - Default = 0x0 - - 0 = uP Run Stall from "MDIO Boot Load" pin. - 1 = uP Run Stall from See MCP Run Stall bit - - - Notes: - This bit selects the uP Run Stall from either the "MDIO Boot Load" pin or the See MCP Run Stall bit. */ - unsigned int upRunStallOverride : 1; /* 1E.C001.6 R/W Default = 0x0 */ - /* 0 = uP Run Stall from "MDIO Boot Load" pin. - 1 = uP Run Stall from See MCP Run Stall bit - */ - unsigned int reserved0 : 8; - /*! \brief 1E.C001.F R/W uP Reset - AQ_GlobalControl_APPIA.u1.bits_1.upReset - - Default = 0x0 - - 1 = Reset - - - Notes: - Resets the uP and the PIF master and slave bus. Will be active for a minimum of 100 microseconds. */ - unsigned int upReset : 1; /* 1E.C001.F R/W Default = 0x0 */ - /* 1 = Reset - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalControl_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reset Control: 1E.C006 */ -/* Global Reset Control: 1E.C006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reset Control */ - union - { - struct - { - unsigned int reserved1 : 14; - /*! \brief 1E.C006.E R/WPD Global MMD Reset Disable - AQ_GlobalResetControl_APPIA.u0.bits_0.globalMMD_ResetDisable - - Provisionable Default = 0x0 - - 1 = Disable the S/W reset to the Global MMD registers - 0 = Enable the S/W reset to the Global MMD registers - - - Notes: - Setting this bit prevents a Global S/W reset or Global S/W reset from resetting the Global MMD registers */ - unsigned int globalMMD_ResetDisable : 1; /* 1E.C006.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Disable the S/W reset to the Global MMD registers - 0 = Enable the S/W reset to the Global MMD registers - */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalResetControl_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Diagnostic Provisioning: 1E.C400 */ -/* Global Diagnostic Provisioning: 1E.C400 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Diagnostic Provisioning */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C400.F R/WPD Enable Diagnostics - AQ_GlobalDiagnosticProvisioning_APPIA.u0.bits_0.enableDiagnostics - - Provisionable Default = 0x1 - - 1 = Chip performs diagnostics on power-up - */ - unsigned int enableDiagnostics : 1; /* 1E.C400.F R/WPD Provisionable Default = 0x1 */ - /* 1 = Chip performs diagnostics on power-up */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalDiagnosticProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Thermal Provisioning: 1E.C420 */ -/* Global Thermal Provisioning: 1E.C420 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C420.F:0 R/WPD Reserved 0 [F:0] - AQ_GlobalThermalProvisioning_APPIA.u0.bits_0.reserved_0 - - Provisionable Default = 0x0000 - - Internal reserved - do not modify - - */ - unsigned int reserved_0 : 16; /* 1E.C420.F:0 R/WPD Provisionable Default = 0x0000 */ - /* Internal reserved - do not modify - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C421.F:0 R/WPD High Temp Failure Threshold [F:0] - AQ_GlobalThermalProvisioning_APPIA.u1.bits_1.highTempFailureThreshold - - Provisionable Default = 0x4600 - - [F:0] of high temperature failure threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 70 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A000 - 1.A001: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. - High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int highTempFailureThreshold : 16; /* 1E.C421.F:0 R/WPD Provisionable Default = 0x4600 */ - /* [F:0] of high temperature failure threshold */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C422.F:0 R/WPD Low Temp Failure Threshold [F:0] - AQ_GlobalThermalProvisioning_APPIA.u2.bits_2.lowTempFailureThreshold - - Provisionable Default = 0x0000 - - [F:0] of low temperature failure threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 0 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A002 - 1.A003: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. - High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int lowTempFailureThreshold : 16; /* 1E.C422.F:0 R/WPD Provisionable Default = 0x0000 */ - /* [F:0] of low temperature failure threshold */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C423.F:0 R/WPD High Temp Warning Threshold [F:0] - AQ_GlobalThermalProvisioning_APPIA.u3.bits_3.highTempWarningThreshold - - Provisionable Default = 0x3C00 - - [F:0] of high temperature warning threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD008. Default is 60 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A004 - 1.A005: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. - High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int highTempWarningThreshold : 16; /* 1E.C423.F:0 R/WPD Provisionable Default = 0x3C00 */ - /* [F:0] of high temperature warning threshold */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C424.F:0 R/WPD Low Temp Warning Threshold [F:0] - AQ_GlobalThermalProvisioning_APPIA.u4.bits_4.lowTempWarningThreshold - - Provisionable Default = 0x0A00 - - [F:0] of low temperature warning threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 10 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A006 - 1.A007: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. - High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int lowTempWarningThreshold : 16; /* 1E.C424.F:0 R/WPD Provisionable Default = 0x0A00 */ - /* [F:0] of low temperature warning threshold */ - } bits_4; - uint16_t word_4; - } u4; -} AQ_GlobalThermalProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global LED Provisioning: 1E.C430 */ -/* Global LED Provisioning: 1E.C430 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C430.1:0 R/WPD LED #0 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_0ActivityStretch : 2; /* 1E.C430.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C430.2 R/WPD LED #0 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_0TransmitActivity : 1; /* 1E.C430.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C430.3 R/WPD LED #0 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_0ReceiveActivity : 1; /* 1E.C430.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C430.4 R/WPD LED #0 Connecting - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_0Connecting : 1; /* 1E.C430.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C430.5 R/WPD LED #0 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_0_100Mb_sLinkEstablished : 1; /* 1E.C430.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C430.6 R/WPD LED #0 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_0_1Gb_sLinkEstablished : 1; /* 1E.C430.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C430.7 R/WPD LED #0 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_0_10Gb_sLinkEstablished : 1; /* 1E.C430.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C430.8 R/WPD LED #0 Manual Set - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_0ManualSet : 1; /* 1E.C430.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - unsigned int reserved0 : 7; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C431.1:0 R/WPD LED #1 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_1ActivityStretch : 2; /* 1E.C431.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C431.2 R/WPD LED #1 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_1TransmitActivity : 1; /* 1E.C431.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C431.3 R/WPD LED #1 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_1ReceiveActivity : 1; /* 1E.C431.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C431.4 R/WPD LED #1 Connecting - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_1Connecting : 1; /* 1E.C431.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C431.5 R/WPD LED #1 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_1_100Mb_sLinkEstablished : 1; /* 1E.C431.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C431.6 R/WPD LED #1 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_1_1Gb_sLinkEstablished : 1; /* 1E.C431.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C431.7 R/WPD LED #1 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_1_10Gb_sLinkEstablished : 1; /* 1E.C431.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C431.8 R/WPD LED #1 Manual Set - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_1ManualSet : 1; /* 1E.C431.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - unsigned int reserved0 : 7; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C432.1:0 R/WPD LED #2 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_2ActivityStretch : 2; /* 1E.C432.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C432.2 R/WPD LED #2 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_2TransmitActivity : 1; /* 1E.C432.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C432.3 R/WPD LED #2 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_2ReceiveActivity : 1; /* 1E.C432.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C432.4 R/WPD LED #2 Connecting - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_2Connecting : 1; /* 1E.C432.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C432.5 R/WPD LED #2 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_2_100Mb_sLinkEstablished : 1; /* 1E.C432.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C432.6 R/WPD LED #2 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_2_1Gb_sLinkEstablished : 1; /* 1E.C432.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C432.7 R/WPD LED #2 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_2_10Gb_sLinkEstablished : 1; /* 1E.C432.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C432.8 R/WPD LED #2 Manual Set - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_2ManualSet : 1; /* 1E.C432.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - unsigned int reserved0 : 7; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C433.1:0 R/WPD LED #3 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_3ActivityStretch : 2; /* 1E.C433.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C433.2 R/WPD LED #3 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_3TransmitActivity : 1; /* 1E.C433.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C433.3 R/WPD LED #3 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_3ReceiveActivity : 1; /* 1E.C433.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C433.4 R/WPD LED #3 Connecting - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_3Connecting : 1; /* 1E.C433.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C433.5 R/WPD LED #3 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_3_100Mb_sLinkEstablished : 1; /* 1E.C433.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C433.6 R/WPD LED #3 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_3_1Gb_sLinkEstablished : 1; /* 1E.C433.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C433.7 R/WPD LED #3 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_3_10Gb_sLinkEstablished : 1; /* 1E.C433.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C433.8 R/WPD LED #3 Manual Set - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_3ManualSet : 1; /* 1E.C433.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - unsigned int reserved0 : 7; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C434.1:0 R/WPD LED #4 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_4ActivityStretch : 2; /* 1E.C434.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C434.2 R/WPD LED #4 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_4TransmitActivity : 1; /* 1E.C434.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C434.3 R/WPD LED #4 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_4ReceiveActivity : 1; /* 1E.C434.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C434.4 R/WPD LED #4 Connecting - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_4Connecting : 1; /* 1E.C434.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C434.5 R/WPD LED #4 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_4_100Mb_sLinkEstablished : 1; /* 1E.C434.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C434.6 R/WPD LED #4 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_4_1Gb_sLinkEstablished : 1; /* 1E.C434.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C434.7 R/WPD LED #4 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_4_10Gb_sLinkEstablished : 1; /* 1E.C434.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C434.8 R/WPD LED #4 Manual Set - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_4ManualSet : 1; /* 1E.C434.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - unsigned int reserved0 : 7; - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C435.1:0 R/WPD LED #5 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_5ActivityStretch : 2; /* 1E.C435.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C435.2 R/WPD LED #5 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_5TransmitActivity : 1; /* 1E.C435.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C435.3 R/WPD LED #5 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_5ReceiveActivity : 1; /* 1E.C435.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C435.4 R/WPD LED #5 Connecting - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_5Connecting : 1; /* 1E.C435.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C435.5 R/WPD LED #5 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_5_100Mb_sLinkEstablished : 1; /* 1E.C435.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C435.6 R/WPD LED #5 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_5_1Gb_sLinkEstablished : 1; /* 1E.C435.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C435.7 R/WPD LED #5 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_5_10Gb_sLinkEstablished : 1; /* 1E.C435.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C435.8 R/WPD LED #5 Manual Set - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_5ManualSet : 1; /* 1E.C435.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - unsigned int reserved0 : 7; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C437.0 R/WPD LED Operation Mode - AQ_GlobalLedProvisioning_APPIA.u7.bits_7.ledOperationMode - - Provisionable Default = 0x0 - - 1 = LED link activity in Mode #2 - 0 = LED link activity in classic mode - - - Notes: - When set to 1, the LED blinking rate is based on Mode #2 algorithm. When set to 0, the LED blinking rate is based on the classic algorithm. */ - unsigned int ledOperationMode : 1; /* 1E.C437.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED link activity in Mode #2 - 0 = LED link activity in classic mode - */ - unsigned int reserved0 : 15; - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C438.0 R/WPD LED #0 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u8.bits_8.led_0ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_0ManualActiveSelect : 1; /* 1E.C438.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - /*! \brief 1E.C438.1 R/WPD LED #0 Active High Select - AQ_GlobalLedProvisioning_APPIA.u8.bits_8.led_0ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #0 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_0ActiveHighSelect : 1; /* 1E.C438.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C438.2 R/WPD LED #0 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u8.bits_8.led_0DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_0DriveThreeStateSelect : 1; /* 1E.C438.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - unsigned int reserved0 : 13; - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C439.0 R/WPD LED #1 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u9.bits_9.led_1ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_1ManualActiveSelect : 1; /* 1E.C439.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - /*! \brief 1E.C439.1 R/WPD LED #1 Active High Select - AQ_GlobalLedProvisioning_APPIA.u9.bits_9.led_1ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #1 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_1ActiveHighSelect : 1; /* 1E.C439.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C439.2 R/WPD LED #1 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u9.bits_9.led_1DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_1DriveThreeStateSelect : 1; /* 1E.C439.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - unsigned int reserved0 : 13; - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Union for bit and word level access of word 10 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C43A.0 R/WPD LED #2 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u10.bits_10.led_2ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_2ManualActiveSelect : 1; /* 1E.C43A.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - /*! \brief 1E.C43A.1 R/WPD LED #2 Active High Select - AQ_GlobalLedProvisioning_APPIA.u10.bits_10.led_2ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #2 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_2ActiveHighSelect : 1; /* 1E.C43A.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C43A.2 R/WPD LED #2 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u10.bits_10.led_2DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_2DriveThreeStateSelect : 1; /* 1E.C43A.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - unsigned int reserved0 : 13; - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Union for bit and word level access of word 11 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C43B.0 R/WPD LED #3 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u11.bits_11.led_3ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_3ManualActiveSelect : 1; /* 1E.C43B.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - /*! \brief 1E.C43B.1 R/WPD LED #3 Active High Select - AQ_GlobalLedProvisioning_APPIA.u11.bits_11.led_3ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #3 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_3ActiveHighSelect : 1; /* 1E.C43B.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C43B.2 R/WPD LED #3 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u11.bits_11.led_3DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_3DriveThreeStateSelect : 1; /* 1E.C43B.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - unsigned int reserved0 : 13; - } bits_11; - uint16_t word_11; - } u11; - /*! \brief Union for bit and word level access of word 12 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C43C.0 R/WPD LED #4 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u12.bits_12.led_4ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_4ManualActiveSelect : 1; /* 1E.C43C.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - /*! \brief 1E.C43C.1 R/WPD LED #4 Active High Select - AQ_GlobalLedProvisioning_APPIA.u12.bits_12.led_4ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #4 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_4ActiveHighSelect : 1; /* 1E.C43C.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C43C.2 R/WPD LED #4 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u12.bits_12.led_4DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_4DriveThreeStateSelect : 1; /* 1E.C43C.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - unsigned int reserved0 : 13; - } bits_12; - uint16_t word_12; - } u12; - /*! \brief Union for bit and word level access of word 13 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C43D.0 R/WPD LED #5 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u13.bits_13.led_5ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_5ManualActiveSelect : 1; /* 1E.C43D.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - /*! \brief 1E.C43D.1 R/WPD LED #5 Active High Select - AQ_GlobalLedProvisioning_APPIA.u13.bits_13.led_5ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #5 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_5ActiveHighSelect : 1; /* 1E.C43D.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C43D.2 R/WPD LED #5 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u13.bits_13.led_5DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_5DriveThreeStateSelect : 1; /* 1E.C43D.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - unsigned int reserved0 : 13; - } bits_13; - uint16_t word_13; - } u13; -} AQ_GlobalLedProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global General Provisioning: 1E.C440 */ -/* Global General Provisioning: 1E.C440 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global General Provisioning */ - union - { - struct - { - /*! \brief 1E.C440.0 RO Gang Load MDIO Write Only - AQ_GlobalGeneralProvisioning_APPIA.u0.bits_0.gangLoadMdioWriteOnly - - - - 1 = MDIO gang load enable - - - Notes: - This bit enables gang load operation with the address specified in Bits 8:4. */ - unsigned int gangLoadMdioWriteOnly : 1; /* 1E.C440.0 RO */ - /* 1 = MDIO gang load enable - */ - unsigned int reserved1 : 3; - /*! \brief 1E.C440.8:4 R/WPD Gang Load MDIO Address [4:0] - AQ_GlobalGeneralProvisioning_APPIA.u0.bits_0.gangLoadMdioAddress - - Provisionable Default = 0x00 - - MDIO Address to be used during gang load operation - - - Notes: - Gang load operation is used to load data into multiple PHYs all connected to the same MDIO bus. The address for gang load operation is provided by these bits (8:4), and enabling is done by writing Bit 0. Disabling of gang load mode is done by writing the See MDIO Address Reset (1E.C441.2) bit. These will revert the PHY's MDIO address back to the address provided by the MDIO Address pins. During gang load operation, MDIO reads are disabled to prevent bus contention. */ - unsigned int gangLoadMdioAddress : 5; /* 1E.C440.8:4 R/WPD Provisionable Default = 0x00 */ - /* MDIO Address to be used during gang load operation - */ - unsigned int reserved0 : 7; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved2 : 2; - /*! \brief 1E.C441.2 R/WSC MDIO Address Reset - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioAddressReset - - Default = 0x0 - - 1 = Load MDIO Address with the address on the MDIO address pins - - - Notes: - Used to reset the address after gang load and enable MDIO reads again. */ - unsigned int mdioAddressReset : 1; /* 1E.C441.2 R/WSC Default = 0x0 */ - /* 1 = Load MDIO Address with the address on the MDIO address pins - */ - /*! \brief 1E.C441.3 R/WPD MDIO Preamble Detection Disable - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioPreambleDetectionDisable - - Provisionable Default = 0x0 - - 1 = Suppress preamble detection on MDIO - 0 = Enable preamble detection on MDIO - - */ - unsigned int mdioPreambleDetectionDisable : 1; /* 1E.C441.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = Suppress preamble detection on MDIO - 0 = Enable preamble detection on MDIO - */ - /*! \brief 1E.C441.4 R/WPD MDIO Drive Configuration - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioDriveConfiguration - - Provisionable Default = 0x0 - - 0 = MDIO driver is in normal mode - 1 = MDIO driver is in open drain mode - - - Notes: - When the MDIO driver is in open drain mode during a read cycle, "0" data will be actively driven out of the MDIO, "1" data will set the MDIO driver in high impedance state and an external pullup will set the MDIO line to "1". The Turn-Around "0" will also be actively driven out of the MDIO, therefore in open drain mode, the Turn-Around is still "Z0". */ - unsigned int mdioDriveConfiguration : 1; /* 1E.C441.4 R/WPD Provisionable Default = 0x0 */ - /* 0 = MDIO driver is in normal mode - 1 = MDIO driver is in open drain mode - */ - unsigned int reserved1 : 8; - /*! \brief 1E.C441.D R/WPD MDIO Read MSW First Enable - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioReadMSW_FirstEnable - - Provisionable Default = 0x0 - - 1 = MSW of counter must be read first - 0 = LSW of counter must be read first - - - Notes: - This bit configures whether the MSW or LSW must be read first for counters greater than 16 bits. */ - unsigned int mdioReadMSW_FirstEnable : 1; /* 1E.C441.D R/WPD Provisionable Default = 0x0 */ - /* 1 = MSW of counter must be read first - 0 = LSW of counter must be read first - */ - /*! \brief 1E.C441.E R/WPD MDIO Broadcast Mode Enable - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioBroadcastModeEnable - - Provisionable Default = 0x0 - - 1 = Enable broadcast on Address 0 - 0 = Disable broadcast on Address 0 - - - Notes: - When set, this bit enables gang-load operation on address zero, simultaneous with normal MDIO operation. Obviously, this requires that no PHY use address 0 as its normal operating address. As well, reads on MDIO Address 0 are disabled to prevent bus contention. */ - unsigned int mdioBroadcastModeEnable : 1; /* 1E.C441.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable broadcast on Address 0 - 0 = Disable broadcast on Address 0 - */ - unsigned int reserved0 : 1; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global General Provisioning */ - union - { - struct - { - /*! \brief 1E.C442.0 R/W Daisy Chain Reset - AQ_GlobalGeneralProvisioning_APPIA.u2.bits_2.daisyChainReset - - Default = 0x0 - - 1 = Reset the daisy chain - - - Notes: - Toggling this bit from 0 to 1 will reload the IRAM and DRAM and reset the uP. The uP will be in uP run stall during the reload process. After the reload process, uP run stall will be de-asserted adn the uP reset will be asserted. Note that before setting this bit, the See Soft Reset bit needs to be de-asserted. */ - unsigned int daisyChainReset : 1; /* 1E.C442.0 R/W Default = 0x0 */ - /* 1 = Reset the daisy chain - */ - unsigned int reserved0 : 15; - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalGeneralProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global NVR Provisioning: 1E.C450 */ -/* Global NVR Provisioning: 1E.C450 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global NVR Provisioning */ - union - { - struct - { - /*! \brief 1E.C450.1:0 R/WPD NVR Address Length [1:0] - AQ_GlobalNvrProvisioning_APPIA.u0.bits_0.nvrAddressLength - - Provisionable Default = 0x2 - - NVR address length ranges from 0 bytes up to 3 bytes. - - - Notes: - This sets the length of the address field used in read and write operations. Use of this field is enabled via Bit 8 of See Global NVR Provisioning 2: Address 1E.C451 . - */ - unsigned int nvrAddressLength : 2; /* 1E.C450.1:0 R/WPD Provisionable Default = 0x2 */ - /* NVR address length ranges from 0 bytes up to 3 bytes. - */ - unsigned int reserved2 : 2; - /*! \brief 1E.C450.6:4 R/WPD NVR Dummy Length [2:0] - AQ_GlobalNvrProvisioning_APPIA.u0.bits_0.nvrDummyLength - - Provisionable Default = 0x0 - - NVR dummy length ranges from 0 bytes to 4 bytes. - - - Notes: - This sets the length of the dummy field used in some maunfacturer's read status and write status operations. - */ - unsigned int nvrDummyLength : 3; /* 1E.C450.6:4 R/WPD Provisionable Default = 0x0 */ - /* NVR dummy length ranges from 0 bytes to 4 bytes. - */ - unsigned int reserved1 : 1; - /*! \brief 1E.C450.A:8 R/WPD NVR Data Length [2:0] - AQ_GlobalNvrProvisioning_APPIA.u0.bits_0.nvrDataLength - - Provisionable Default = 0x4 - - NVR data length ranges from 0 bytes to 4 bytes - - - Notes: - This sets the length of the data burst used in read and write operations. - */ - unsigned int nvrDataLength : 3; /* 1E.C450.A:8 R/WPD Provisionable Default = 0x4 */ - /* NVR data length ranges from 0 bytes to 4 bytes - */ - unsigned int reserved0 : 5; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global NVR Provisioning */ - union - { - struct - { - /*! \brief 1E.C451.7:0 R/WPD NVR Clock Divide [7:0] - AQ_GlobalNvrProvisioning_APPIA.u1.bits_1.nvrClockDivide - - Provisionable Default = 0xA0 - - NVR clock divide. Clock frequency is divided by the NVR clock divide + 1 - - */ - unsigned int nvrClockDivide : 8; /* 1E.C451.7:0 R/WPD Provisionable Default = 0xA0 */ - /* NVR clock divide. Clock frequency is divided by the NVR clock divide + 1 - */ - /*! \brief 1E.C451.8 R/WPD NVR Address Length Override - AQ_GlobalNvrProvisioning_APPIA.u1.bits_1.nvrAddressLengthOverride - - Provisionable Default = 0x0 - - 0 = NVR address length is based on the "NVR_SIZE" pin. - 1 = NVR address length is based on the See NVR Address Length [1:0] register. - - - Notes: - When the this bit = 0 and NVR_SIZE pin = 0, the NVR address length is 2 bytes. When this bit = 0 and the NVR_SIZE pin = 1, the NVR address length is 3 bytes. When this bit = 1 the NVR address length is from the See NVR Address Length [1:0] */ - unsigned int nvrAddressLengthOverride : 1; /* 1E.C451.8 R/WPD Provisionable Default = 0x0 */ - /* 0 = NVR address length is based on the "NVR_SIZE" pin. - 1 = NVR address length is based on the See NVR Address Length [1:0] register. - */ - unsigned int reserved0 : 7; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global NVR Provisioning */ - union - { - struct - { - /*! \brief 1E.C452.0 R/W NVR Daisy Chain Disable - AQ_GlobalNvrProvisioning_APPIA.u2.bits_2.nvrDaisyChainDisable - - Default = 0x0 - - 1 = Disable the Daisy Chain - - - Notes: - When in daisy chain master mode, the daisy chain and MDIO can both access the SPI. Setting this bit to 1 will disable the dasiy chain from accessing the SPI and force it into a reset state. */ - unsigned int nvrDaisyChainDisable : 1; /* 1E.C452.0 R/W Default = 0x0 */ - /* 1 = Disable the Daisy Chain - */ - /*! \brief 1E.C452.1 R/W NVR Daisy Chain Clock Divide Override - AQ_GlobalNvrProvisioning_APPIA.u2.bits_2.nvrDaisyChainClockDivideOverride - - Default = 0x0 - - 1 = Override NVR clock divide when in daisy chain master mode - - - - Notes: - When in daisy chain master mode, the clock divide configuration is received from the flash. This bit will override the clock divide configuration from the flash with the See NVR Clock Divide [7:0] . */ - unsigned int nvrDaisyChainClockDivideOverride : 1; /* 1E.C452.1 R/W Default = 0x0 */ - /* 1 = Override NVR clock divide when in daisy chain master mode - - */ - unsigned int reserved0 : 14; - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalNvrProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reserved Provisioning: 1E.C470 */ -/* Global Reserved Provisioning: 1E.C470 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved2 : 4; - /*! \brief 1E.C470.4 R/WSC Initiate Cable Diagnostics - AQ_GlobalReservedProvisioning_APPIA.u0.bits_0.initiateCableDiagnostics - - Default = 0x0 - - 1 = Perform cable diagnostics - - - Notes: - Perform cable diagnostics regardless of link state. If link is up, setting this bit will cause the link to drop while diagnostics are performed. This bit is self-clearing upon completion of the cable diagnostics. Further MDIO writes should be avoided until this bit has self-cleared, indicating completion of the diagnostic routine. */ - unsigned int initiateCableDiagnostics : 1; /* 1E.C470.4 R/WSC Default = 0x0 */ - /* 1 = Perform cable diagnostics - */ - /*! \brief 1E.C470.5 R/WSC Initiate Component Diagnostics - AQ_GlobalReservedProvisioning_APPIA.u0.bits_0.initiateComponentDiagnostics - - Default = 0x0 - - 1 = Perform component diagnostics - - - Notes: - Perform component diagnostics regardless of link state. If link is up, setting this bit will cause the link to drop while diagnostics are performed. This bit is self-clearing upon completion of the component diagnostics. Further MDIO writes should be avoided until this bit has self-cleared, indicating completion of the diagnostic routine. */ - unsigned int initiateComponentDiagnostics : 1; /* 1E.C470.5 R/WSC Default = 0x0 */ - /* 1 = Perform component diagnostics - */ - unsigned int reserved1 : 2; - unsigned int reserved0 : 5; - /*! \brief 1E.C470.E:D R/WPD Extended MDI Diagnostics Select [1:0] - AQ_GlobalReservedProvisioning_APPIA.u0.bits_0.extendedMdiDiagnosticsSelect - - Provisionable Default = 0x0 - - 0x0 = TDR Data - 0x1 = RFI Channel PSD - 0x2 = Noise PSD while the local Tx is Off - 0x3 = Noise PSD while the local Tx is On - - - Notes: - These bits select what sort of cable diagnostics to perform. For regular cable diagnostics, Bit F is set to zero, and the diagnostics are triggered by setting Bit 4. For extended diagnostics, Bit F is set to 1, and the desired extended diagnostics are selected by Bits E:D. The routine is then triggered by setting Bit 4. Each of the extended diagnostic routines present data for all for MDI pairs (A, B, C, D) consecutively, and after the data for each channel is gathered Bits F:D are reset. To get the data for the next pair, Bits F:D must be set back to the desired value (which must be the same as the initial channel). This continues until the data for all channels has been gathered. The address in memory where the data is stored is given in 1E.C802 and 1E.C804. - - For the case of PSD, the structure is as follows: - Int32 info - Int16 data[Len] - Info = Len << 16 | TxEnable << 8 | Pair (0 = A, etc.) - - For TDR: - Int32 info - Int16 tdr_A[Len] - Int16 tdr_B[Len] - Int16 tdr_C[Len] - Int16 tdr_D[Len] - - Info = Len << 16 | Channel - - TDR data is from the current pair to all other pairs. - - At the end of retrieving extended MDI diag data, the part will be reset. Conversly the only way to exit this routine once it starts is to issue a PMA reset. */ - unsigned int extendedMdiDiagnosticsSelect : 2; /* 1E.C470.E:D R/WPD Provisionable Default = 0x0 */ - /* 0x0 = TDR Data - 0x1 = RFI Channel PSD - 0x2 = Noise PSD while the local Tx is Off - 0x3 = Noise PSD while the local Tx is On - */ - /*! \brief 1E.C470.F R/WPD Diagnostics Select - AQ_GlobalReservedProvisioning_APPIA.u0.bits_0.diagnosticsSelect - - Provisionable Default = 0x0 - - 1 = Provide Extended MDI Diagnostics Information. - 0 = Provide normal cable diagnostics - - - Notes: - These bits select what sort of cable diagnostics to perform. For regular cable diagnostics, Bit F is set to zero, and the diagnostics are triggered by setting Bit 4. For extended diagnostics, Bit F is set to 1, and the desired extended diagnostics are selected by Bits E:D. The routine is then triggered by setting Bit 4. Each of the extended diagnostic routines present data for all for MDI pairs (A, B, C, D) consecutively, and after the data for each channel is gathered Bits F:D are reset. To get the data for the next pair, Bits F:D must be set back to the desired value (which must be the same as the initial channel). This continues until the data for all channels has been gathered. The address in memory where the data is stored is given in 1E.C802 and 1E.C804. - - For the case of PSD, the structure is as follows: - Int32 info - Int16 data[Len] - Info = Len << 16 | TxEnable << 8 | Pair (0 = A, etc.) - - For TDR: - Int32 info - Int16 tdr_A[Len] - Int16 tdr_B[Len] - Int16 tdr_C[Len] - Int16 tdr_D[Len] - - Info = Len << 16 | Channel - - TDR data is from the current pair to all other pairs. - - At the end of retrieving extended MDI diag data, the part will be reset. Conversly the only way to exit this routine once it starts is to issue a PMA reset. */ - unsigned int diagnosticsSelect : 1; /* 1E.C470.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Provide Extended MDI Diagnostics Information. - 0 = Provide normal cable diagnostics - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C471.5:0 R/WuP Daisy-Chain Hop-Count Override Value [5:0] - AQ_GlobalReservedProvisioning_APPIA.u1.bits_1.daisy_chainHop_countOverrideValue - - Default = 0x00 - - The value to use for the PHY's daisy-chain hop-count. Valid values are from 0 -> 47 - - - Notes: - Daisy-Chain Hop-Count Override should be used during MDIO boot-load operation, as the daisy-chain hop-count does not function when the daisy-chain is disabled (1E.C452.0). Setting this bit tells the processor where in the diasy-chain it is, so that the provisioning operation will function correctly. */ - unsigned int daisy_chainHop_countOverrideValue : 6; /* 1E.C471.5:0 R/WuP Default = 0x00 */ - /* The value to use for the PHY's daisy-chain hop-count. Valid values are from 0 -> 47 - */ - /*! \brief 1E.C471.6 R/WuP Enable Daisy-Chain Hop-Count Override - AQ_GlobalReservedProvisioning_APPIA.u1.bits_1.enableDaisy_chainHop_countOverride - - Default = 0x0 - - 1 = Hop-count is set by Bits 5:0 - 0 = Hop-count is determined by the daisy-chain - - - Notes: - Daisy-Chain Hop-Count Override should be used during MDIO boot-load operation, as the daisy-chain hop-count does not function when the daisy-chain is disabled (1E.C452.0). Setting this bit tells the processor where in the diasy-chain it is, so that the provisioning operation will function correctly. */ - unsigned int enableDaisy_chainHop_countOverride : 1; /* 1E.C471.6 R/WuP Default = 0x0 */ - /* 1 = Hop-count is set by Bits 5:0 - 0 = Hop-count is determined by the daisy-chain - */ - /*! \brief 1E.C471.F:7 R/WPD Reserved Provisioning 2 [8:0] - AQ_GlobalReservedProvisioning_APPIA.u1.bits_1.reservedProvisioning_2 - - Provisionable Default = 0x000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_2 : 9; /* 1E.C471.F:7 R/WPD Provisionable Default = 0x000 */ - /* Reserved for future use - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C472.0 R/WPDuP Enable 5th Channel RFI Cancellation - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.enable_5thChannelRfiCancellation - - Provisionable Default = 0x0 - - 1 = 5th channel and RFI cancellers operation enabled - 0 = 5th channel AFE is powered down, 5th channel digital is clock gated, RFI cancellers are disabled - - - Notes: - Note: The value of this bit at the time of Autonegotiation sets the local PHY behavior until the next time Autonegotiation occurs. */ - unsigned int enable_5thChannelRfiCancellation : 1; /* 1E.C472.0 R/WPDuP Provisionable Default = 0x0 */ - /* 1 = 5th channel and RFI cancellers operation enabled - 0 = 5th channel AFE is powered down, 5th channel digital is clock gated, RFI cancellers are disabled - */ - /*! \brief 1E.C472.1 R/WPDuP Enable XENPAK Register Space - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.enableXenpakRegisterSpace - - Provisionable Default = 0x0 - - 1 = XENPAK register space enabled - 0 = XENPAK register space disabled - - */ - unsigned int enableXenpakRegisterSpace : 1; /* 1E.C472.1 R/WPDuP Provisionable Default = 0x0 */ - /* 1 = XENPAK register space enabled - 0 = XENPAK register space disabled - */ - unsigned int reserved1 : 4; - /*! \brief 1E.C472.6 R/WPD Tunable External VDD Power Supply Present - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.tunableExternalVddPowerSupplyPresent - - Provisionable Default = 0x0 - - 1 = Tunable external VDD power supply present - 0 = No tunable external VDD power supply present - - - Notes: - - - - These bits must be set if tuning of external power supplies is desired (see Bits 7:6) */ - unsigned int tunableExternalVddPowerSupplyPresent : 1; /* 1E.C472.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Tunable external VDD power supply present - 0 = No tunable external VDD power supply present - */ - /*! \brief 1E.C472.7 R/WPD Tunable External LVDD Power Supply Present - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.tunableExternalLvddPowerSupplyPresent - - Provisionable Default = 0x0 - - 1 = Tunable external LVDD power supply present - 0 = No tunable external LVDD power supply present - - - Notes: - - - - These bits must be set if tuning of external power supplies is desired (see Bits 7:6) */ - unsigned int tunableExternalLvddPowerSupplyPresent : 1; /* 1E.C472.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Tunable external LVDD power supply present - 0 = No tunable external LVDD power supply present - */ - unsigned int reserved0 : 6; - /*! \brief 1E.C472.E R/WPD Enable VDD Power Supply Tuning - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.enableVddPowerSupplyTuning - - Provisionable Default = 0x0 - - 1 = Enable external VDD power supply tuning - 0 = Disable external VDD power supply tuning is disabled - - - Notes: - - - - These bits control whether the PHY attempts to tune the external VDD and LVDD power supplies via the PMBus. These bits are only operational if the external supplies are present (see Bits 7:6) */ - unsigned int enableVddPowerSupplyTuning : 1; /* 1E.C472.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable external VDD power supply tuning - 0 = Disable external VDD power supply tuning is disabled - */ - /*! \brief 1E.C472.F R/WPD Enable LVDD Power Supply Tuning - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.enableLvddPowerSupplyTuning - - Provisionable Default = 0x0 - - 1 = Enable external LVDD power supply tuning - 0 = Disable external LVDD power supply tuning is disabled - - - Notes: - - - - These bits control whether the PHY attempts to tune the external VDD and LVDD power supplies via the PMBus. These bits are only operational if the external supplies are present (see Bits 7:6) */ - unsigned int enableLvddPowerSupplyTuning : 1; /* 1E.C472.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable external LVDD power supply tuning - 0 = Disable external LVDD power supply tuning is disabled - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C474.7:0 R/WPD Training SNR [7:0] - AQ_GlobalReservedProvisioning_APPIA.u4.bits_4.trainingSNR - - Provisionable Default = 0x00 - - SNR during 10G training on the worst channel. SNR is in steps of 0.1dB - - - Notes: - The SNR margin that is enjoyed by the worst channel, over and above the minimum SNR required to operate at a BER of 10-12. It is reported with 0.1 dB of resolution to an accuracy of 0.5 dB within the range of -12.7 dB to 12.7 dB. The number is in offset binary, with 0.0 dB represented by 0x8000. - */ - unsigned int trainingSNR : 8; /* 1E.C474.7:0 R/WPD Provisionable Default = 0x00 */ - /* SNR during 10G training on the worst channel. SNR is in steps of 0.1dB - */ - unsigned int reserved0 : 8; - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved1 : 2; - /*! \brief 1E.C475.2 R/WPD Smart Power-Down Enable - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.smartPower_downEnable - - Provisionable Default = 0x0 - - 1 = Enable smart power down mode - 0 = Smart power-down mode disabled - - - Notes: - Smart power down (SPD) is the lowest power mode at which PHY is able to autonegotiate. SPD can be enabled with bit 1E.C475.2 */ - unsigned int smartPower_downEnable : 1; /* 1E.C475.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable smart power down mode - 0 = Smart power-down mode disabled - */ - /*! \brief 1E.C475.3 R/WPD Deadlock Avoidance Enable - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.deadlockAvoidanceEnable - - Provisionable Default = 0x0 - - 1 = SPD with deadlock avoidance: PHY transmits autonegotiation pulses (FLPs) at a slower rate (~ 1 FLP/ 100ms) than specified by autonegotiation standard (~1 FLP / 8.25ms). Receiver is active and able to detect the pulses. - 0 = SPD without deadlock avoidance: PHY transmitter is shut down, no autonegotiation pulses are sent on the line but the receiver is active and able to detect the pulses - - */ - unsigned int deadlockAvoidanceEnable : 1; /* 1E.C475.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = SPD with deadlock avoidance: PHY transmits autonegotiation pulses (FLPs) at a slower rate (~ 1 FLP/ 100ms) than specified by autonegotiation standard (~1 FLP / 8.25ms). Receiver is active and able to detect the pulses. - 0 = SPD without deadlock avoidance: PHY transmitter is shut down, no autonegotiation pulses are sent on the line but the receiver is active and able to detect the pulses - */ - /*! \brief 1E.C475.4 R/WPD CFR Support - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrSupport - - Provisionable Default = 0x0 - - 1 = Local PHY supports Cisco Fast Retrain - 0 = Local PHY does support Cisco Fast Retrain - - */ - unsigned int cfrSupport : 1; /* 1E.C475.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY supports Cisco Fast Retrain - 0 = Local PHY does support Cisco Fast Retrain - */ - /*! \brief 1E.C475.5 R/WPD CFR THP - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrTHP - - Provisionable Default = 0x0 - - 1 = Local PHY requires local PHY to enable THP - 0 = Local PHY does not require local PHY to enable THP - - */ - unsigned int cfrTHP : 1; /* 1E.C475.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires local PHY to enable THP - 0 = Local PHY does not require local PHY to enable THP - */ - /*! \brief 1E.C475.6 R/WPD CFR Extended Maxwait - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrExtendedMaxwait - - Provisionable Default = 0x0 - - 1 = Local PHY requires extended maxwait - 0 = Local PHY does not require extended maxwait - - */ - unsigned int cfrExtendedMaxwait : 1; /* 1E.C475.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires extended maxwait - 0 = Local PHY does not require extended maxwait - */ - /*! \brief 1E.C475.7 R/WPD CFR Disable Timer - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrDisableTimer - - Provisionable Default = 0x0 - - 1 = Local PHY requires cfr_disable timer - 0 = Local PHY does not require cfr_disable timer - - */ - unsigned int cfrDisableTimer : 1; /* 1E.C475.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires cfr_disable timer - 0 = Local PHY does not require cfr_disable timer - */ - /*! \brief 1E.C475.8 R/WPD CFR LP Support - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrLpSupport - - Provisionable Default = 0x0 - - 1 = Link partner supports Cisco Fast Retrain - 0 = Link partner does support Cisco Fast Retrain - - */ - unsigned int cfrLpSupport : 1; /* 1E.C475.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner supports Cisco Fast Retrain - 0 = Link partner does support Cisco Fast Retrain - */ - /*! \brief 1E.C475.9 R/WPD CFR LP THP - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrLpTHP - - Provisionable Default = 0x0 - - 1 = Link partner requires local PHY to enable THP - 0 = Link partner does not require local PHY to enable THP - - */ - unsigned int cfrLpTHP : 1; /* 1E.C475.9 R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires local PHY to enable THP - 0 = Link partner does not require local PHY to enable THP - */ - /*! \brief 1E.C475.A R/WPD CFR LP Extended Maxwait - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrLpExtendedMaxwait - - Provisionable Default = 0x0 - - 1 = Link partner requires extended maxwait - 0 = Link partner does not require extended maxwait - - */ - unsigned int cfrLpExtendedMaxwait : 1; /* 1E.C475.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires extended maxwait - 0 = Link partner does not require extended maxwait - */ - /*! \brief 1E.C475.B R/WPD CFR LP Disable Timer - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrLpDisableTimer - - Provisionable Default = 0x0 - - 1 = Link partner requires cfr_disable timer - 0 = Link partner does not require cfr_disable timer - - */ - unsigned int cfrLpDisableTimer : 1; /* 1E.C475.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires cfr_disable timer - 0 = Link partner does not require cfr_disable timer - */ - /*! \brief 1E.C475.C R/WPD Reserved Provisioning 6 - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.reservedProvisioning_6 - - Provisionable Default = 0x0 - - Reserved for future use - - */ - unsigned int reservedProvisioning_6 : 1; /* 1E.C475.C R/WPD Provisionable Default = 0x0 */ - /* Reserved for future use - */ - /*! \brief 1E.C475.D R/WPD Smart Power-Down Status - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.smartPower_downStatus - - Provisionable Default = 0x0 - - 1 = Smart Power-Down Active - 0 = Smart Power-Down Inactive - - */ - unsigned int smartPower_downStatus : 1; /* 1E.C475.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Smart Power-Down Active - 0 = Smart Power-Down Inactive - */ - unsigned int reserved0 : 2; - } bits_5; - uint16_t word_5; - } u5; -} AQ_GlobalReservedProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Cable Diagnostic Status: 1E.C800 */ -/* Global Cable Diagnostic Status: 1E.C800 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C800.2:0 RO Pair D Status [2:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u0.bits_0.pairDStatus - - - - (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair C - 010= Connected to Pair B - 001= Connected to Pair A - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK - - Notes: - This bitfield reports the result, for pair D, of running either cable diagnostics or component diagnostics. */ - unsigned int pairDStatus : 3; /* 1E.C800.2:0 RO */ - /* (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair C - 010= Connected to Pair B - 001= Connected to Pair A - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK */ - unsigned int reserved3 : 1; - /*! \brief 1E.C800.6:4 RO Pair C Status [2:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u0.bits_0.pairCStatus - - - - (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair B - 010= Connected to Pair A - 001= Connected to Pair D - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK - - Notes: - This bitfield reports the result, for pair C, of running either cable diagnostics or component diagnostics. */ - unsigned int pairCStatus : 3; /* 1E.C800.6:4 RO */ - /* (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair B - 010= Connected to Pair A - 001= Connected to Pair D - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK */ - unsigned int reserved2 : 1; - /*! \brief 1E.C800.A:8 RO Pair B Status [2:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u0.bits_0.pairBStatus - - - - (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair A - 010= Connected to Pair D - 001= Connected to Pair C - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK - - Notes: - This bitfield reports the result, for pair B, of running either cable diagnostics or component diagnostics. */ - unsigned int pairBStatus : 3; /* 1E.C800.A:8 RO */ - /* (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair A - 010= Connected to Pair D - 001= Connected to Pair C - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK */ - unsigned int reserved1 : 1; - /*! \brief 1E.C800.E:C RO Pair A Status [2:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u0.bits_0.pairAStatus - - - - (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair D - 010= Connected to Pair C - 001= Connected to Pair B - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK - - Notes: - This bitfield reports the result, for pair A, of running either cable diagnostics or component diagnostics. */ - unsigned int pairAStatus : 3; /* 1E.C800.E:C RO */ - /* (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair D - 010= Connected to Pair C - 001= Connected to Pair B - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C801.7:0 RO Pair A Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u1.bits_1.pairAReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair A - - Notes: - The distance to this reflection is given in See Global Reserved Status 1: Address 1E.C870 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairAReflection_2 : 8; /* 1E.C801.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair A */ - /*! \brief 1E.C801.F:8 RO Pair A Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u1.bits_1.pairAReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair A - - Notes: - The distance to this reflection is given in See Global Reserved Status 1: Address 1E.C870 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairAReflection_1 : 8; /* 1E.C801.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair A */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C802.F:0 RO Impulse Response MSW [F:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u2.bits_2.impulseResponseMSW - - - - The MSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type in 1E.C470.E:D - - - Notes: - See 1E.C470 for more information */ - unsigned int impulseResponseMSW : 16; /* 1E.C802.F:0 RO */ - /* The MSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type in 1E.C470.E:D - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C803.7:0 RO Pair B Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u3.bits_3.pairBReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair B - - Notes: - The distance to this reflection is given in See Global Reserved Status 2: Address 1E.C871 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairBReflection_2 : 8; /* 1E.C803.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair B */ - /*! \brief 1E.C803.F:8 RO Pair B Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u3.bits_3.pairBReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair B - - Notes: - The distance to this reflection is given in See Global Reserved Status 2: Address 1E.C871 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairBReflection_1 : 8; /* 1E.C803.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair B */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C804.F:0 RO Impulse Response LSW [F:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u4.bits_4.impulseResponseLSW - - - - The LSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type specified in 1E.C470.E:D - - - Notes: - See 1E.C470 for more information */ - unsigned int impulseResponseLSW : 16; /* 1E.C804.F:0 RO */ - /* The LSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type specified in 1E.C470.E:D - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C805.7:0 RO Pair C Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u5.bits_5.pairCReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair C - - Notes: - The distance to this reflection is given in See Global Reserved Status 3: Address 1E.C872 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairCReflection_2 : 8; /* 1E.C805.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair C */ - /*! \brief 1E.C805.F:8 RO Pair C Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u5.bits_5.pairCReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair C - - Notes: - The distance to this reflection is given in See Global Reserved Status 3: Address 1E.C872 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairCReflection_1 : 8; /* 1E.C805.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair C */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C806.F:0 RO Reserved 1 [F:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u6.bits_6.reserved_1 - - - - Reserved for future use - - */ - unsigned int reserved_1 : 16; /* 1E.C806.F:0 RO */ - /* Reserved for future use - */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C807.7:0 RO Pair D Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u7.bits_7.pairDReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair D - - Notes: - The distance to this reflection is given in See Global Reserved Status 4: Address 1E.C873 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairDReflection_2 : 8; /* 1E.C807.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair D */ - /*! \brief 1E.C807.F:8 RO Pair D Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u7.bits_7.pairDReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair D - - Notes: - The distance to this reflection is given in See Global Reserved Status 4: Address 1E.C873 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairDReflection_1 : 8; /* 1E.C807.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair D */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C808.F:0 RO Reserved 2[F:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u8.bits_8.reserved_2 - - - - Reserved for future use - - */ - unsigned int reserved_2 : 16; /* 1E.C808.F:0 RO */ - /* Reserved for future use - */ - } bits_8; - uint16_t word_8; - } u8; -} AQ_GlobalCableDiagnosticStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Thermal Status: 1E.C820 */ -/* Global Thermal Status: 1E.C820 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Thermal Status */ - union - { - struct - { - /*! \brief 1E.C820.F:0 RO Temperature [F:0] - AQ_GlobalThermalStatus_APPIA.u0.bits_0.temperature - - - - [F:0] of temperature - - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 70 degreesC. This is a mirror of the XENPAK register 1.A060 - 1.A061. The mirror is performed in H/W. */ - unsigned int temperature : 16; /* 1E.C820.F:0 RO */ - /* [F:0] of temperature - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Thermal Status */ - union - { - struct - { - /*! \brief 1E.C821.0 RO Temperature Ready - AQ_GlobalThermalStatus_APPIA.u1.bits_1.temperatureReady - - - - 1 = Temperature measurement is valid - - - Notes: - This is a mirror of the XENPAK register 1.A06E. */ - unsigned int temperatureReady : 1; /* 1E.C821.0 RO */ - /* 1 = Temperature measurement is valid - */ - unsigned int reserved0 : 15; - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalThermalStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global General Status: 1E.C830 */ -/* Global General Status: 1E.C830 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global General Status */ - union - { - struct - { - unsigned int reserved1 : 11; - /*! \brief 1E.C830.B RO Low Temperature Warning State - AQ_GlobalGeneralStatus_APPIA.u0.bits_0.lowTemperatureWarningState - - - - 1 = Low temperature warning threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A074.6 register. - - */ - unsigned int lowTemperatureWarningState : 1; /* 1E.C830.B RO */ - /* 1 = Low temperature warning threshold has been exceeded */ - /*! \brief 1E.C830.C RO High Temperature Warning State - AQ_GlobalGeneralStatus_APPIA.u0.bits_0.highTemperatureWarningState - - - - 1 = High temperature warning threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A074.7 register. - - */ - unsigned int highTemperatureWarningState : 1; /* 1E.C830.C RO */ - /* 1 = High temperature warning threshold has been exceeded */ - /*! \brief 1E.C830.D RO Low Temperature Failure State - AQ_GlobalGeneralStatus_APPIA.u0.bits_0.lowTemperatureFailureState - - - - 1 = Low temperature failure threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A070.6 register. - - */ - unsigned int lowTemperatureFailureState : 1; /* 1E.C830.D RO */ - /* 1 = Low temperature failure threshold has been exceeded */ - /*! \brief 1E.C830.E RO High Temperature Failure State - AQ_GlobalGeneralStatus_APPIA.u0.bits_0.highTemperatureFailureState - - - - 1 = High temperature failure threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A070.7 register. - - */ - unsigned int highTemperatureFailureState : 1; /* 1E.C830.E RO */ - /* 1 = High temperature failure threshold has been exceeded */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global General Status */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C831.F RO Processor Intensive MDIO Operation In- Progress - AQ_GlobalGeneralStatus_APPIA.u1.bits_1.processorIntensiveMdioOperationIn_Progress - - - - 1 = PHY microprocessor is busy with a processor-intensive MDIO operation - 0 = Processor-intensive MDIO operation completed - - - Notes: - This bit should may be used with certain processor-intensive MDIO commands (such as Loopbacks, Test Modes, Low power modes, Tx-Disable, Restart autoneg, Cable Diagnostics, etc.) that take longer than an MDIO cycle to complete. Upon receiving an MDIO command that involves the PHY's microprocessor, this bit is set, and when the command is completed, this bit is cleared. - - NOTE!!! This bit should be checked only after 1 ms of issuing a processor-intensive MDIO operation. - - The list of operations that set this bit are as follows: - - 1.0.0, PMA Loopback - 1.0.B, Low power mode - 1.9.4:0, Tx Disable - 1.84, 10G Test modes - 1.8000.5, XENPAK Control - 1.9000, XENPAK Rx Fault Enable - 1.9002, XENPAK Alarm Enable - 1.E400.F, External loopback - 3.0.B, Low power mode - 3.0.E, System PCS loopback - 3.C471.5, PRBS Test - 3.C471.6, PRBS Test - 3.E471.5, PRBS Test - 3.E471.6, PRBS Test - 4.0.B, Low power mode - 4.0.E, PHY-XS network loopback - 4.C440, Output clock control, Load SERDES parameters - 4.F802.E, System loopback - 4.C444.F:B, Loopback Control - 4.C444.4:2, Packet generation - 4.C445.C, SERDES calibration - 7.0.9, Restart autonegotiation - 1D.C280, 1G/100M Network loopback - 1D.C500, 1G System loopback - 1D.C501, 1G / 100M Test modes */ - unsigned int processorIntensiveMdioOperationIn_Progress : 1; /* 1E.C831.F RO */ - /* 1 = PHY microprocessor is busy with a processor-intensive MDIO operation - 0 = Processor-intensive MDIO operation completed - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalGeneralStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Pin Status: 1E.C840 */ -/* Global Pin Status: 1E.C840 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Pin Status */ - union - { - struct - { - /*! \brief 1E.C840.5:0 RO LED Pullup State [5:0] - AQ_GlobalPinStatus_APPIA.u0.bits_0.ledPullupState - - - - 1 = LED output pin is pulled high - 0 = LED output pin is pulled low - - */ - unsigned int ledPullupState : 6; /* 1E.C840.5:0 RO */ - /* 1 = LED output pin is pulled high - 0 = LED output pin is pulled low - */ - unsigned int reserved3 : 1; - /*! \brief 1E.C840.7 RO Tx Enable - AQ_GlobalPinStatus_APPIA.u0.bits_0.txEnable - - - - Current Value of Tx Enable pin - - - Notes: - 0 = Disable Transmitter */ - unsigned int txEnable : 1; /* 1E.C840.7 RO */ - /* Current Value of Tx Enable pin - */ - unsigned int reserved2 : 1; - /*! \brief 1E.C840.9 RO Package Connectivity - AQ_GlobalPinStatus_APPIA.u0.bits_0.packageConnectivity - - - - Value of the package connection pin - - */ - unsigned int packageConnectivity : 1; /* 1E.C840.9 RO */ - /* Value of the package connection pin - */ - unsigned int reserved1 : 3; - /*! \brief 1E.C840.E:D RO MDIO Boot Load [1:0] - AQ_GlobalPinStatus_APPIA.u0.bits_0.mdioBootLoad - - - - Value of MDIO Boot Load pins - - 0x3 = PHY #0 Slave Daisy Chain Boot - 0x2 = PHY #0 Master Daisy Chain Boot from Flash - 0x1 = MDIO Boot Load - 0x0 = Boot from Flash (PHY #0 only) - - - Notes: - NOTES: - - PHY #0 is the primary PHY, and PHY #1 is the secondary PHY - - PHY #1 is always in Slave Daisy Chain Boot from Flash when set to 0x2 or 0x3. */ - unsigned int mdioBootLoad : 2; /* 1E.C840.E:D RO */ - /* Value of MDIO Boot Load pins - - 0x3 = PHY #0 Slave Daisy Chain Boot - 0x2 = PHY #0 Master Daisy Chain Boot from Flash - 0x1 = MDIO Boot Load - 0x0 = Boot from Flash (PHY #0 only) - */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalPinStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Daisy Chain Status: 1E.C842 */ -/* Global Daisy Chain Status: 1E.C842 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Daisy Chain Status */ - union - { - struct - { - /*! \brief 1E.C842.F:0 RO Rx Daisy Chain Calculated CRC [F:0] - AQ_GlobalDaisyChainStatus_APPIA.u0.bits_0.rxDaisyChainCalculatedCrc - - - - Rx Daisy Chain Calculated CRC - - - Notes: - This is the calculated daisy chain CRC. */ - unsigned int rxDaisyChainCalculatedCrc : 16; /* 1E.C842.F:0 RO */ - /* Rx Daisy Chain Calculated CRC - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalDaisyChainStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Fault Message: 1E.C850 */ -/* Global Fault Message: 1E.C850 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Fault Message */ - union - { - struct - { - /*! \brief 1E.C850.F:0 RO Message [F:0] - AQ_GlobalFaultMessage_APPIA.u0.bits_0.message - - - - Error code describing fault - - Notes: - Code 0x8001: Firmware not compatible with chip architecture. This fault occurs when firmware compiled for a different Tensilica core is loaded. - Code 0x8002: VCO calibration failed. This occurs when the main PLLs on chip fail to lock: this is not possible to trigger. - Code 0x8003: XAUI calibration failed. This occurs when the XAUI PLLs fail to lock: this is not possible to trigger. - Code 0x8004: Failed to set operating voltages via PMBus. This only occurs when the processor has control over power supply voltage via an attached PMBus device and there is a protocol error on the I2C bus: this is not possible to trigger. - Code 0x8005: Unexpected device ID. This occurs if the device ID programmed into the internal E-Fuse registers in not valid: this is not possible to trigger. - Code 0x8006: Computed checksum does not match expected checksum. This occurs when the FLASH checksum check performed at boot time fails. This only occurs when the system boots from FLASH. - Code 0x8007: Detected a bit error in static memory. To trigger, corrupt one of the static regions. - Code 0xC001: Illegal Instruction exception. This occurs when the processor attempts to execute an illegal instruction. To trigger this, write an illegal instruction to program memory. It's possible that the bit error check will trigger before the illegal instruction is executed. - Code 0xC002 Instruction Fetch Error. Internal physical address or a data error during instruction fetch: this is not possible to trigger. - Code 0xC003 Load Store Error. Internal physical address or data error during load store operation: this is not possible to trigger.. - Code 0xC004 Privileged Instruction. Attempt to execute a privileged operation without sufficient privilege: this is not possible to trigger. - Code 0xC005 Unaligned Load or Store. Attempt to load or store data at an address which cannot be handled due to alignment: this is not possible to trigger. - Code 0xC006 Instruction fetch from prohibited space: this is not possible to trigger. - Code 0xC007 Data load from prohibited space: this is not possible to trigger. - Code 0xC008 Data store into prohibited space: this is not possible to trigger. */ - unsigned int message : 16; /* 1E.C850.F:0 RO */ - /* Error code describing fault */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalFaultMessage_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Primary Status: 1E.C851 */ -/* Global Primary Status: 1E.C851 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Primary Status */ - union - { - struct - { - /*! \brief 1E.C851.0 RO Primary Status - AQ_GlobalPrimaryStatus_APPIA.u0.bits_0.primaryStatus - - - - 1 = PHY is the primary PHY - 0 = PHY is is secondary PHY - - */ - unsigned int primaryStatus : 1; /* 1E.C851.0 RO */ - /* 1 = PHY is the primary PHY - 0 = PHY is is secondary PHY - */ - unsigned int reserved0 : 15; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalPrimaryStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Cable Diagnostic Impedance: 1E.C880 */ -/* Global Cable Diagnostic Impedance: 1E.C880 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C880.2:0 RO Pair A Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.pairAReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_4 : 3; /* 1E.C880.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.3 RO Reserved 4 - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.reserved_4 - - - - Reserved for future use - - */ - unsigned int reserved_4 : 1; /* 1E.C880.3 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C880.6:4 RO Pair A Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.pairAReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_3 : 3; /* 1E.C880.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.7 RO Reserved 3 - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.reserved_3 - - - - Reserved for future use - - */ - unsigned int reserved_3 : 1; /* 1E.C880.7 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C880.A:8 RO Pair A Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.pairAReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_2 : 3; /* 1E.C880.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.B RO Reserved 2 - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.reserved_2 - - - - Reserved for future use - - */ - unsigned int reserved_2 : 1; /* 1E.C880.B RO */ - /* Reserved for future use - */ - /*! \brief 1E.C880.E:C RO Pair A Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.pairAReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_1 : 3; /* 1E.C880.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.F RO Reserved 1 - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.reserved_1 - - - - Reserved for future use - - */ - unsigned int reserved_1 : 1; /* 1E.C880.F RO */ - /* Reserved for future use - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C881.2:0 RO Pair B Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.pairBReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_4 : 3; /* 1E.C881.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.3 RO Reserved 8 - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.reserved_8 - - - - Reserved for future use - - */ - unsigned int reserved_8 : 1; /* 1E.C881.3 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C881.6:4 RO Pair B Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.pairBReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_3 : 3; /* 1E.C881.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.7 RO Reserved 7 - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.reserved_7 - - - - Reserved for future use - - */ - unsigned int reserved_7 : 1; /* 1E.C881.7 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C881.A:8 RO Pair B Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.pairBReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_2 : 3; /* 1E.C881.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.B RO Reserved 6 - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.reserved_6 - - - - Reserved for future use - - */ - unsigned int reserved_6 : 1; /* 1E.C881.B RO */ - /* Reserved for future use - */ - /*! \brief 1E.C881.E:C RO Pair B Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.pairBReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_1 : 3; /* 1E.C881.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.F RO Reserved 5 - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.reserved_5 - - - - Reserved for future use - - */ - unsigned int reserved_5 : 1; /* 1E.C881.F RO */ - /* Reserved for future use - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C882.2:0 RO Pair C Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.pairCReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_4 : 3; /* 1E.C882.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.3 RO Reserved 12 - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.reserved_12 - - - - Reserved for future use - - */ - unsigned int reserved_12 : 1; /* 1E.C882.3 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C882.6:4 RO Pair C Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.pairCReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_3 : 3; /* 1E.C882.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.7 RO Reserved 11 - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.reserved_11 - - - - Reserved for future use - - */ - unsigned int reserved_11 : 1; /* 1E.C882.7 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C882.A:8 RO Pair C Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.pairCReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_2 : 3; /* 1E.C882.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.B RO Reserved 10 - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.reserved_10 - - - - Reserved for future use - - */ - unsigned int reserved_10 : 1; /* 1E.C882.B RO */ - /* Reserved for future use - */ - /*! \brief 1E.C882.E:C RO Pair C Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.pairCReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_1 : 3; /* 1E.C882.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.F RO Reserved 9 - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.reserved_9 - - - - Reserved for future use - - */ - unsigned int reserved_9 : 1; /* 1E.C882.F RO */ - /* Reserved for future use - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C883.2:0 RO Pair D Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.pairDReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_4 : 3; /* 1E.C883.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.3 RO Reserved 16 - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.reserved_16 - - - - Reserved for future use - - */ - unsigned int reserved_16 : 1; /* 1E.C883.3 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C883.6:4 RO Pair D Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.pairDReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_3 : 3; /* 1E.C883.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.7 RO Reserved 15 - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.reserved_15 - - - - Reserved for future use - - */ - unsigned int reserved_15 : 1; /* 1E.C883.7 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C883.A:8 RO Pair D Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.pairDReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_2 : 3; /* 1E.C883.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.B RO Reserved 14 - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.reserved_14 - - - - Reserved for future use - - */ - unsigned int reserved_14 : 1; /* 1E.C883.B RO */ - /* Reserved for future use - */ - /*! \brief 1E.C883.E:C RO Pair D Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.pairDReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_1 : 3; /* 1E.C883.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.F RO Reserved 13 - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.reserved_13 - - - - Reserved for future use - - */ - unsigned int reserved_13 : 1; /* 1E.C883.F RO */ - /* Reserved for future use - */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_GlobalCableDiagnosticImpedance_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Status: 1E.C884 */ -/* Global Status: 1E.C884 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Status */ - union - { - struct - { - /*! \brief 1E.C884.7:0 RO Cable Length [7:0] - AQ_GlobalStatus_APPIA.u0.bits_0.cableLength - - - - The estimated length of the cable in meters - - - Notes: - The length of the cable shown here is estimated from the cable diagnostic engine and should be accurate to +/-1m. */ - unsigned int cableLength : 8; /* 1E.C884.7:0 RO */ - /* The estimated length of the cable in meters - */ - /*! \brief 1E.C884.F:8 RO Reserved Status 0 [7:0] - AQ_GlobalStatus_APPIA.u0.bits_0.reservedStatus_0 - - - - Reserved for future use - - */ - unsigned int reservedStatus_0 : 8; /* 1E.C884.F:8 RO */ - /* Reserved for future use - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reserved Status: 1E.C885 */ -/* Global Reserved Status: 1E.C885 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C885.7:0 ROSPD ROM Revision [7:0] - AQ_GlobalReservedStatus_APPIA.u0.bits_0.romRevision - - Provisionable Default = 0x00 - - ROM Revision Number - - - Notes: - Customers may receive multiple ROM images that differ only in their provisioning. This field is used to differentiate those images. This field is used in conjunction with the firmware major and minor revision numbers to uniquely identify ROM images. */ - unsigned int romRevision : 8; /* 1E.C885.7:0 ROSPD Provisionable Default = 0x00 */ - /* ROM Revision Number - */ - /*! \brief 1E.C885.9:8 ROSPD XENPAK NVR Status [1:0] - AQ_GlobalReservedStatus_APPIA.u0.bits_0.xenpakNvrStatus - - Provisionable Default = 0x0 - - Status of XENPAK NVR: - 0: NVR not enabled - 1: Last NVR operation succeeded - 2: Last NVR operation failed - 3: Reserved - - - Notes: - XENPAK register space is mirrored in NVR (SPI ROM). This register indicates the status of the last NVR operation. */ - unsigned int xenpakNvrStatus : 2; /* 1E.C885.9:8 ROSPD Provisionable Default = 0x0 */ - /* Status of XENPAK NVR: - 0: NVR not enabled - 1: Last NVR operation succeeded - 2: Last NVR operation failed - 3: Reserved - */ - /*! \brief 1E.C885.F:A RO Nearly Seconds MSW[5:0] - AQ_GlobalReservedStatus_APPIA.u0.bits_0.nearlySecondsMSW - - - - Bits 16 to 21 of the 22 bit "Nearly Seconds" uptime counter. - - - Notes: - The "Nearly Seconds" counter is incremented every 1024 milliseconds. */ - unsigned int nearlySecondsMSW : 6; /* 1E.C885.F:A RO */ - /* Bits 16 to 21 of the 22 bit "Nearly Seconds" uptime counter. - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C886.F:0 RO Nearly Seconds LSW[F:0] - AQ_GlobalReservedStatus_APPIA.u1.bits_1.nearlySecondsLSW - - - - Bits 0 to 15 of the 22 bit "Nearly Seconds" uptime counter. - - - Notes: - The "Nearly Seconds" counter is incremented every 1024 milliseconds. */ - unsigned int nearlySecondsLSW : 16; /* 1E.C886.F:0 RO */ - /* Bits 0 to 15 of the 22 bit "Nearly Seconds" uptime counter. - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalReservedStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Alarms: 1E.CC00 */ -/* Global Alarms: 1E.CC00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Alarms */ - union - { - struct - { - /*! \brief 1E.CC00.0 LH Reserved Alarm D - AQ_GlobalAlarms_APPIA.u0.bits_0.reservedAlarmD - - - - Reserved for future use - - */ - unsigned int reservedAlarmD : 1; /* 1E.CC00.0 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.1 LH Reserved Alarm C - AQ_GlobalAlarms_APPIA.u0.bits_0.reservedAlarmC - - - - Reserved for future use - - */ - unsigned int reservedAlarmC : 1; /* 1E.CC00.1 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.2 LH Reserved Alarm B - AQ_GlobalAlarms_APPIA.u0.bits_0.reservedAlarmB - - - - Reserved for future use - - */ - unsigned int reservedAlarmB : 1; /* 1E.CC00.2 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.3 LH Reserved Alarm A - AQ_GlobalAlarms_APPIA.u0.bits_0.reservedAlarmA - - - - Reserved for future use - - */ - unsigned int reservedAlarmA : 1; /* 1E.CC00.3 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.4 LH Device Fault - AQ_GlobalAlarms_APPIA.u0.bits_0.deviceFault - - - - 1 = Fault - - Notes: - When set, a fault has been detected by the uP and the associated 16 bit error code is visible in See Global Configuration Fault Message: Address 1E.C850 */ - unsigned int deviceFault : 1; /* 1E.CC00.4 LH */ - /* 1 = Fault */ - unsigned int reserved2 : 1; - /*! \brief 1E.CC00.6 LH Reset completed - AQ_GlobalAlarms_APPIA.u0.bits_0.resetCompleted - - - - 1 = Chip wide reset completed - - Notes: - This bit is set by the microprocessor when it has completed it's initialization sequence. This bit is mirrored in 1.CC02.0 */ - unsigned int resetCompleted : 1; /* 1E.CC00.6 LH */ - /* 1 = Chip wide reset completed */ - unsigned int reserved1 : 4; - /*! \brief 1E.CC00.B LH Low Temperature Warning - AQ_GlobalAlarms_APPIA.u0.bits_0.lowTemperatureWarning - - - - 1 = Low temperature warning threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int lowTemperatureWarning : 1; /* 1E.CC00.B LH */ - /* 1 = Low temperature warning threshold has been exceeded - */ - /*! \brief 1E.CC00.C LH High Temperature Warning - AQ_GlobalAlarms_APPIA.u0.bits_0.highTemperatureWarning - - - - 1 = High temperature warning threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int highTemperatureWarning : 1; /* 1E.CC00.C LH */ - /* 1 = High temperature warning threshold has been exceeded - */ - /*! \brief 1E.CC00.D LH Low Temperature Failure - AQ_GlobalAlarms_APPIA.u0.bits_0.lowTemperatureFailure - - - - 1 = Low temperature failure threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int lowTemperatureFailure : 1; /* 1E.CC00.D LH */ - /* 1 = Low temperature failure threshold has been exceeded - */ - /*! \brief 1E.CC00.E LH High Temperature Failure - AQ_GlobalAlarms_APPIA.u0.bits_0.highTemperatureFailure - - - - 1 = High temperature failure threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int highTemperatureFailure : 1; /* 1E.CC00.E LH */ - /* 1 = High temperature failure threshold has been exceeded - */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Alarms */ - union - { - struct - { - /*! \brief 1E.CC01.0 LH Diagnostic Alarm - AQ_GlobalAlarms_APPIA.u1.bits_1.diagnosticAlarm - - - - 1 = Alarm triggered by a write to 1E.C470.7 - - - Notes: - A diagnostic alarm use to test system alarm circuitry */ - unsigned int diagnosticAlarm : 1; /* 1E.CC01.0 LH */ - /* 1 = Alarm triggered by a write to 1E.C470.7 - */ - unsigned int reserved1 : 6; - /*! \brief 1E.CC01.7 LH MDIO Command Handling Overflow - AQ_GlobalAlarms_APPIA.u1.bits_1.mdioCommandHandlingOverflow - - - - 1 = PHY was issued more MDIO requests than it could service in it's request buffer - - - Notes: - Assertion of this bit means that more MDIO commands were issued than FW could handle. */ - unsigned int mdioCommandHandlingOverflow : 1; /* 1E.CC01.7 LH */ - /* 1 = PHY was issued more MDIO requests than it could service in it's request buffer - */ - /*! \brief 1E.CC01.C:8 LH Reserved Alarms [4:0] - AQ_GlobalAlarms_APPIA.u1.bits_1.reservedAlarms - - - - Reserved for future use - - */ - unsigned int reservedAlarms : 5; /* 1E.CC01.C:8 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC01.D RO XENPAK Alarm - AQ_GlobalAlarms_APPIA.u1.bits_1.xenpakAlarm - - - - 1 = XENPAK Alarm - - - Notes: - This alarm is performed by H/W. */ - unsigned int xenpakAlarm : 1; /* 1E.CC01.D RO */ - /* 1 = XENPAK Alarm - */ - /*! \brief 1E.CC01.E LH Smart Power-Down Entered - AQ_GlobalAlarms_APPIA.u1.bits_1.smartPower_downEntered - - - - 1 = Smart Power-Down State Entered - - - Notes: - When this bit is set, it indicates that the Smart Power-Down state was entered */ - unsigned int smartPower_downEntered : 1; /* 1E.CC01.E LH */ - /* 1 = Smart Power-Down State Entered - */ - unsigned int reserved0 : 1; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Alarms */ - union - { - struct - { - /*! \brief 1E.CC02.0 LH Watchdog Timer Alarm - AQ_GlobalAlarms_APPIA.u2.bits_2.watchdogTimerAlarm - - - - 1 = Watchdog timer alarm - - */ - unsigned int watchdogTimerAlarm : 1; /* 1E.CC02.0 LH */ - /* 1 = Watchdog timer alarm - */ - /*! \brief 1E.CC02.1 LH MDIO Timeout Error - AQ_GlobalAlarms_APPIA.u2.bits_2.mdioTimeoutError - - - - 1 = MDIO timeout detected - - */ - unsigned int mdioTimeoutError : 1; /* 1E.CC02.1 LH */ - /* 1 = MDIO timeout detected - */ - /*! \brief 1E.CC02.2 LH MDIO MMD Error - AQ_GlobalAlarms_APPIA.u2.bits_2.mdioMMD_Error - - - - 1 = Invalid MMD address detected - - */ - unsigned int mdioMMD_Error : 1; /* 1E.CC02.2 LH */ - /* 1 = Invalid MMD address detected - */ - unsigned int reserved2 : 2; - /*! \brief 1E.CC02.5 LRF Tx Enable State Change - AQ_GlobalAlarms_APPIA.u2.bits_2.txEnableStateChange - - - - 1 = TX_EN pin has changed state - - */ - unsigned int txEnableStateChange : 1; /* 1E.CC02.5 LRF */ - /* 1 = TX_EN pin has changed state - */ - unsigned int reserved1 : 2; - /*! \brief 1E.CC02.9:8 LH uP IRAM Parity Error [1:0] - AQ_GlobalAlarms_APPIA.u2.bits_2.upIramParityError - - - - 1 = Parity error detected in the uP IRAM - - - Notes: - Bit 0 indicates a parity error was detected in the uP IRAM but was corrected. - Bit 1 indicates a multiple parity errors were detected in the uP IRAM and could not be corrected. - The uP IRAM is protected with ECC. */ - unsigned int upIramParityError : 2; /* 1E.CC02.9:8 LH */ - /* 1 = Parity error detected in the uP IRAM - */ - /*! \brief 1E.CC02.A LH uP DRAM Parity Error - AQ_GlobalAlarms_APPIA.u2.bits_2.upDramParityError - - - - 1 = Parity error detected in the uP DRAM - - */ - unsigned int upDramParityError : 1; /* 1E.CC02.A LH */ - /* 1 = Parity error detected in the uP DRAM - */ - unsigned int reserved0 : 3; - /*! \brief 1E.CC02.E LH Mailbox Operation: Complete - AQ_GlobalAlarms_APPIA.u2.bits_2.mailboxOperation_Complete - - - - 1 = Mailbox operation is complete - - - Notes: - Mailbox interface is ready interrupt for registers See Global Vendor Specific Control - Address 1E.C000 - See Global Vendor Specific Provisioning 5 - Address 1E.C404 */ - unsigned int mailboxOperation_Complete : 1; /* 1E.CC02.E LH */ - /* 1 = Mailbox operation is complete - */ - /*! \brief 1E.CC02.F LH NVR Operation Complete - AQ_GlobalAlarms_APPIA.u2.bits_2.nvrOperationComplete - - - - 1 = NVR operation is complete - - - Notes: - NVR interface is ready interrupt for registers See Global NVR Interface 1: Address 1E.100 - See Global NVR Provisioning Data MSW - Address 1E.17 . */ - unsigned int nvrOperationComplete : 1; /* 1E.CC02.F LH */ - /* 1 = NVR operation is complete - */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalAlarms_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Mask: 1E.D400 */ -/* Global Interrupt Mask: 1E.D400 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Mask */ - union - { - struct - { - /*! \brief 1E.D400.0 R/WPD Reserved Alarm D Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.reservedAlarmDMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmDMask : 1; /* 1E.D400.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.1 R/WPD Reserved Alarm C Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.reservedAlarmCMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmCMask : 1; /* 1E.D400.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.2 R/WPD Reserved Alarm B Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.reservedAlarmBMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmBMask : 1; /* 1E.D400.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.3 R/WPD Reserved Alarm A Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.reservedAlarmAMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmAMask : 1; /* 1E.D400.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.4 R/WPD Device Fault Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.deviceFaultMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int deviceFaultMask : 1; /* 1E.D400.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved2 : 1; - /*! \brief 1E.D400.6 R/WPD Reset completed Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.resetCompletedMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int resetCompletedMask : 1; /* 1E.D400.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved1 : 4; - /*! \brief 1E.D400.B R/WPD Low Temperature Warning Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.lowTemperatureWarningMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int lowTemperatureWarningMask : 1; /* 1E.D400.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.C R/WPD High Temperature Warning Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.highTemperatureWarningMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int highTemperatureWarningMask : 1; /* 1E.D400.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.D R/WPD Low Temperature Failure Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.lowTemperatureFailureMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int lowTemperatureFailureMask : 1; /* 1E.D400.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.E R/WPD High Temperature Failure Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.highTemperatureFailureMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int highTemperatureFailureMask : 1; /* 1E.D400.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Interrupt Mask */ - union - { - struct - { - /*! \brief 1E.D401.0 R/WPD Diagnostic Alarm Mask - AQ_GlobalInterruptMask_APPIA.u1.bits_1.diagnosticAlarmMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int diagnosticAlarmMask : 1; /* 1E.D401.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved1 : 6; - /*! \brief 1E.D401.7 R/WPD MDIO Command Handling Overflow Mask - AQ_GlobalInterruptMask_APPIA.u1.bits_1.mdioCommandHandlingOverflowMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int mdioCommandHandlingOverflowMask : 1; /* 1E.D401.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.C:8 R/WPD Reserved Alarms Mask [4:0] - AQ_GlobalInterruptMask_APPIA.u1.bits_1.reservedAlarmsMask - - Provisionable Default = 0x00 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmsMask : 5; /* 1E.D401.C:8 R/WPD Provisionable Default = 0x00 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.D R/WPD XENPAK Alarm Mask - AQ_GlobalInterruptMask_APPIA.u1.bits_1.xenpakAlarmMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int xenpakAlarmMask : 1; /* 1E.D401.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D401.E R/WPD Smart Power-Down Entered Mask - AQ_GlobalInterruptMask_APPIA.u1.bits_1.smartPower_downEnteredMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int smartPower_downEnteredMask : 1; /* 1E.D401.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved0 : 1; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Interrupt Mask */ - union - { - struct - { - /*! \brief 1E.D402.0 R/WPD Watchdog Timer Alarm Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.watchdogTimerAlarmMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int watchdogTimerAlarmMask : 1; /* 1E.D402.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.1 R/WPD MDIO Timeout Error Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.mdioTimeoutErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int mdioTimeoutErrorMask : 1; /* 1E.D402.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.2 R/WPD MDIO MMD Error Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.mdioMMD_ErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int mdioMMD_ErrorMask : 1; /* 1E.D402.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved2 : 2; - /*! \brief 1E.D402.5 R/WPD Tx Enable State Change Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.txEnableStateChangeMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int txEnableStateChangeMask : 1; /* 1E.D402.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved1 : 2; - /*! \brief 1E.D402.9:8 R/WPD uP IRAM Parity Error Mask [1:0] - AQ_GlobalInterruptMask_APPIA.u2.bits_2.upIramParityErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int upIramParityErrorMask : 2; /* 1E.D402.9:8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D402.A R/WPD uP DRAM Parity Error Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.upDramParityErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int upDramParityErrorMask : 1; /* 1E.D402.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved0 : 3; - /*! \brief 1E.D402.E R/WPD Mailbox Operation Complete Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.mailboxOperationCompleteMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - Notes: - Mailbox interface is ready interrupt for registers See Global Vendor Specific Control - Address 1E.C000 - See Global Vendor Specific Provisioning 5 - Address 1E.C404 */ - unsigned int mailboxOperationCompleteMask : 1; /* 1E.D402.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.F R/WPD NVR Operation Complete Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.nvrOperationCompleteMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - Notes: - NVR interface is ready interrupt for registers See Global NVR Interface 1: Address 1E.100 - See Global NVR Provisioning Data MSW - Address 1E.17 */ - unsigned int nvrOperationCompleteMask : 1; /* 1E.D402.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalInterruptMask_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip-Wide Standard Interrupt Flags: 1E.FC00 */ -/* Global Chip-Wide Standard Interrupt Flags: 1E.FC00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip-Wide Standard Interrupt Flags */ - union - { - struct - { - /*! \brief 1E.FC00.0 RO All Vendor Alarms Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.allVendorAlarmsInterrupt - - - - 1 = Interrupt in all vendor alarms - - - Notes: - An interrupt was generated from status register ( See Global Chip-Wide LASI Vendor Interrupt Flags: Address 1E.FC01 ) and the corresponding mask register. ( See Global Interrupt LASI Mask: Address 1E.FF01 ) */ - unsigned int allVendorAlarmsInterrupt : 1; /* 1E.FC00.0 RO */ - /* 1 = Interrupt in all vendor alarms - */ - unsigned int reserved0 : 5; - /*! \brief 1E.FC00.6 RO GbE Standard Alarms Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.gbeStandardAlarmsInterrupt - - - - 1 = Interrupt in GbE standard alarms - - - Notes: - An interrupt was generated from the TGE core. */ - unsigned int gbeStandardAlarmsInterrupt : 1; /* 1E.FC00.6 RO */ - /* 1 = Interrupt in GbE standard alarms - */ - /*! \brief 1E.FC00.7 RO Autonegotiation Standard Alarms 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.autonegotiationStandardAlarms_2Interrupt - - - - 1 = Interrupt in Autonegotiation standard alarms 2 - - - Notes: - An interrupt was generated from status register ( See Autonegotiation 10GBASE-T Status Register - Address 7.21 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int autonegotiationStandardAlarms_2Interrupt : 1; /* 1E.FC00.7 RO */ - /* 1 = Interrupt in Autonegotiation standard alarms 2 - */ - /*! \brief 1E.FC00.8 RO Autonegotiation Standard Alarms 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.autonegotiationStandardAlarms_1Interrupt - - - - 1 = Interrupt in Autonegotiation standard alarms 1 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See Autonegotiation Standard LASI Interrupt Mask 1: Address 7.D000 ) */ - unsigned int autonegotiationStandardAlarms_1Interrupt : 1; /* 1E.FC00.8 RO */ - /* 1 = Interrupt in Autonegotiation standard alarms 1 - */ - /*! \brief 1E.FC00.9 RO PHY XS Standard Alarms 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.phyXS_StandardAlarms_2Interrupt - - - - 1 = Interrupt in PHY XS standard alarms 2 - - - Notes: - An interrupt was generated from the status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int phyXS_StandardAlarms_2Interrupt : 1; /* 1E.FC00.9 RO */ - /* 1 = Interrupt in PHY XS standard alarms 2 - */ - /*! \brief 1E.FC00.A RO PHY XS Standard Alarms 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.phyXS_StandardAlarms_1Interrupt - - - - 1 = Interrupt in PHY XS standard alarms 1 - - - Notes: - An interrupt was generated from the status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int phyXS_StandardAlarms_1Interrupt : 1; /* 1E.FC00.A RO */ - /* 1 = Interrupt in PHY XS standard alarms 1 - */ - /*! \brief 1E.FC00.B RO PCS Standard Alarm 3 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pcsStandardAlarm_3Interrupt - - - - 1 = Interrupt in PCS standard alarms 3 - - - Notes: - An interrupt was generated from status register ( See PCS 10GBASE-T Status 2 - Address 3.21 ) and the corresponding mask register. ( See PCS Standard Interrupt Mask 1 - Address 3.E021 ) */ - unsigned int pcsStandardAlarm_3Interrupt : 1; /* 1E.FC00.B RO */ - /* 1 = Interrupt in PCS standard alarms 3 - */ - /*! \brief 1E.FC00.C RO PCS Standard Alarm 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pcsStandardAlarm_2Interrupt - - - - 1 = Interrupt in PCS standard alarms 2 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int pcsStandardAlarm_2Interrupt : 1; /* 1E.FC00.C RO */ - /* 1 = Interrupt in PCS standard alarms 2 - */ - /*! \brief 1E.FC00.D RO PCS Standard Alarm 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pcsStandardAlarm_1Interrupt - - - - 1 = Interrupt in PCS standard alarms 1 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int pcsStandardAlarm_1Interrupt : 1; /* 1E.FC00.D RO */ - /* 1 = Interrupt in PCS standard alarms 1 - */ - /*! \brief 1E.FC00.E RO PMA Standard Alarm 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pmaStandardAlarm_2Interrupt - - - - 1 = Interrupt in PMA standard alarms 2 - - - Notes: - An interrupt was generated from either bit 1.8.B or 1.8.A. - An interrupt was generated from status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int pmaStandardAlarm_2Interrupt : 1; /* 1E.FC00.E RO */ - /* 1 = Interrupt in PMA standard alarms 2 - */ - /*! \brief 1E.FC00.F RO PMA Standard Alarm 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pmaStandardAlarm_1Interrupt - - - - 1 = Interrupt in PMA standard alarms 1 - - - Notes: - An interrupt was generated from bit 1.1.2. - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int pmaStandardAlarm_1Interrupt : 1; /* 1E.FC00.F RO */ - /* 1 = Interrupt in PMA standard alarms 1 - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChip_wideStandardInterruptFlags_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip-Wide Vendor Interrupt Flags: 1E.FC01 */ -/* Global Chip-Wide Vendor Interrupt Flags: 1E.FC01 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip-Wide Vendor Interrupt Flags */ - union - { - struct - { - /*! \brief 1E.FC01.0 RO Global Alarms 3 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.globalAlarms_3Interrupt - - - - 1 = Interrupt in Global alarms 3 - - - Notes: - An interrupt was generated from status register ( See Global Vendor Alarms 2: Address 1E.CC01 ) and the corresponding mask register. ( See Global LASI Interrupt Mask 2: Address 1E.D401 ) */ - unsigned int globalAlarms_3Interrupt : 1; /* 1E.FC01.0 RO */ - /* 1 = Interrupt in Global alarms 3 - */ - /*! \brief 1E.FC01.1 RO Global Alarms 2 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.globalAlarms_2Interrupt - - - - 1 = Interrupt in Global alarms 2 - - - Notes: - An interrupt was generated from status register ( See Global Alarms 2: Address 1E.CC01 ) and the corresponding mask register. ( See Global LASI Interrupt Mask 2: Address 1E.D401 ) */ - unsigned int globalAlarms_2Interrupt : 1; /* 1E.FC01.1 RO */ - /* 1 = Interrupt in Global alarms 2 - */ - /*! \brief 1E.FC01.2 RO Global Alarms 1 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.globalAlarms_1Interrupt - - - - 1 = Interrupt in Global alarms 1 - - - Notes: - An interrupt was generated from status register ( See Global Vendor Alarms 1 - Address 1E.CC00 ) and the corresponding mask register. ( See Global Vendor Interrupt Mask - Address 1E.D400 ) */ - unsigned int globalAlarms_1Interrupt : 1; /* 1E.FC01.2 RO */ - /* 1 = Interrupt in Global alarms 1 - */ - unsigned int reserved0 : 8; - /*! \brief 1E.FC01.B RO GbE Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.gbeVendorAlarmInterrupt - - - - 1 = Interrupt in GbE vendor specific alarm - - - Notes: - A GbE alarm was generated. ( See GbE PHY Vendor Global LASI Interrupt Flags 1: Address 1D.FC00 ) */ - unsigned int gbeVendorAlarmInterrupt : 1; /* 1E.FC01.B RO */ - /* 1 = Interrupt in GbE vendor specific alarm - */ - /*! \brief 1E.FC01.C RO Autonegotiation Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.autonegotiationVendorAlarmInterrupt - - - - 1 = Interrupt in Autonegotiation vendor specific alarm - - - Notes: - An Autonegotiation alarm was generated. ( See Autonegotiation Vendor Global LASI Interrupt Flags 1: Address 7.FC00 ) */ - unsigned int autonegotiationVendorAlarmInterrupt : 1; /* 1E.FC01.C RO */ - /* 1 = Interrupt in Autonegotiation vendor specific alarm - */ - /*! \brief 1E.FC01.D RO PHY XS Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.phyXS_VendorAlarmInterrupt - - - - 1 = Interrupt in PHY XS vendor specific alarm - - - Notes: - A PHY XS alarm was generated. ( See PHY XS Vendor Global LASI Interrupt Flags 1: Address 4.FC00 ) */ - unsigned int phyXS_VendorAlarmInterrupt : 1; /* 1E.FC01.D RO */ - /* 1 = Interrupt in PHY XS vendor specific alarm - */ - /*! \brief 1E.FC01.E RO PCS Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.pcsVendorAlarmInterrupt - - - - 1 = Interrupt in PCS vendor specific alarm - - - Notes: - A PCS alarm was generated. ( See PHY XS Vendor Global Interrupt Flags 1- Address 4.F800 ) */ - unsigned int pcsVendorAlarmInterrupt : 1; /* 1E.FC01.E RO */ - /* 1 = Interrupt in PCS vendor specific alarm - */ - /*! \brief 1E.FC01.F RO PMA Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.pmaVendorAlarmInterrupt - - - - 1 = Interrupt in PMA vendor specific alarm - - - Notes: - A PMA alarm was generated. ( See PHY XS Vendor Global Interrupt Flags 1- Address 4.F800 ) */ - unsigned int pmaVendorAlarmInterrupt : 1; /* 1E.FC01.F RO */ - /* 1 = Interrupt in PMA vendor specific alarm - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChip_wideVendorInterruptFlags_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Chip-Wide Standard Mask: 1E.FF00 */ -/* Global Interrupt Chip-Wide Standard Mask: 1E.FF00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Chip-Wide Standard Mask */ - union - { - struct - { - /*! \brief 1E.FF00.0 R/WPD All Vendor Alarms Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.allVendorAlarmsInterruptMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int allVendorAlarmsInterruptMask : 1; /* 1E.FF00.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 5; - /*! \brief 1E.FF00.6 R/WPD Gbe Standard Alarms Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.gbeStandardAlarmsInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int gbeStandardAlarmsInterruptMask : 1; /* 1E.FF00.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.7 R/WPD Autonegotiation Standard Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.autonegotiationStandardAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationStandardAlarms_2InterruptMask : 1; /* 1E.FF00.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.8 R/WPD Autonegotiation Standard Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.autonegotiationStandardAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationStandardAlarms_1InterruptMask : 1; /* 1E.FF00.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.9 R/WPD PHY XS Standard Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.phyXS_StandardAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_StandardAlarms_2InterruptMask : 1; /* 1E.FF00.9 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.A R/WPD PHY XS Standard Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.phyXS_StandardAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_StandardAlarms_1InterruptMask : 1; /* 1E.FF00.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.B R/WPD PCS Standard Alarm 3 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pcsStandardAlarm_3InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_3InterruptMask : 1; /* 1E.FF00.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.C R/WPD PCS Standard Alarm 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pcsStandardAlarm_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_2InterruptMask : 1; /* 1E.FF00.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.D R/WPD PCS Standard Alarm 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pcsStandardAlarm_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_1InterruptMask : 1; /* 1E.FF00.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.E R/WPD PMA Standard Alarm 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pmaStandardAlarm_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaStandardAlarm_2InterruptMask : 1; /* 1E.FF00.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.F R/WPD PMA Standard Alarm 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pmaStandardAlarm_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaStandardAlarm_1InterruptMask : 1; /* 1E.FF00.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalInterruptChip_wideStandardMask_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Chip-Wide Vendor Mask: 1E.FF01 */ -/* Global Interrupt Chip-Wide Vendor Mask: 1E.FF01 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Chip-Wide Vendor Mask */ - union - { - struct - { - /*! \brief 1E.FF01.0 R/WPD Global Alarms 3 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.globalAlarms_3InterruptMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_3InterruptMask : 1; /* 1E.FF01.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.1 R/WPD Global Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.globalAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_2InterruptMask : 1; /* 1E.FF01.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.2 R/WPD Global Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.globalAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_1InterruptMask : 1; /* 1E.FF01.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 8; - /*! \brief 1E.FF01.B R/WPD GbE Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.gbeVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int gbeVendorAlarmInterruptMask : 1; /* 1E.FF01.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.C R/WPD Autonegotiation Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.autonegotiationVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationVendorAlarmInterruptMask : 1; /* 1E.FF01.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.D R/WPD PHY XS Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.phyXS_VendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_VendorAlarmInterruptMask : 1; /* 1E.FF01.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.E R/WPD PCS Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.pcsVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsVendorAlarmInterruptMask : 1; /* 1E.FF01.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.F R/WPD PMA Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.pmaVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaVendorAlarmInterruptMask : 1; /* 1E.FF01.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalInterruptChip_wideVendorMask_APPIA; - -#endif -/*@}*/ -/*@}*/ diff --git a/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers_Defines.h b/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers_Defines.h deleted file mode 100755 index 9c7bb5cb5..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers_Defines.h +++ /dev/null @@ -1,2134 +0,0 @@ -/*! \file -* This file contains the compiler assist macros and doxygen comments -* for the Global Registers block. -*/ - -/*! \defgroup Global_registers_Defines Global Registers Defines -* This module contains the compiler assist macros and doxygen comments -* for the Global Registers block. -*/ -/*********************************************************************** -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* $File: //depot/icm/proj/Dena/rev1.0/c/Systems/tools/windows/regMapParser/src/gencheaders.py $ -* -* $Revision: #10 $ -* -* $DateTime: 2014/04/08 16:55:58 $ -* -* $Author: joshd $ -* -* $Label: $ -* -* Description: -* -* This file contains the compiler assist macros for the registers contained in the Global Registers block. -* -* -***********************************************************************/ - - -/*@{*/ -#ifndef AQ_APPIA_GLOBAL_REGS_DEFINES_HEADER -#define AQ_APPIA_GLOBAL_REGS_DEFINES_HEADER - - -/*-----------------------------------------------------------------------------*/ -/*Access macro definitions */ -/*-----------------------------------------------------------------------------*/ -/*! \brief Base register address of structure AQ_GlobalStandardControl_1_APPIA */ -#define AQ_GlobalStandardControl_1_APPIA_baseRegisterAddress 0x0000 -/*! \brief MMD address of structure AQ_GlobalStandardControl_1_APPIA */ -#define AQ_GlobalStandardControl_1_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure softReset in AQ_GlobalStandardControl_1_APPIA */ -#define AQ_GlobalStandardControl_1_APPIA_softReset 0 -/*! \brief Preprocessor variable to relate field to bit position in structure softReset in AQ_GlobalStandardControl_1_APPIA */ -#define bits_AQ_GlobalStandardControl_1_APPIA_softReset u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure softReset in AQ_GlobalStandardControl_1_APPIA */ -#define word_AQ_GlobalStandardControl_1_APPIA_softReset u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure hardReset in AQ_GlobalStandardControl_1_APPIA */ -#define AQ_GlobalStandardControl_1_APPIA_hardReset 0 -/*! \brief Preprocessor variable to relate field to bit position in structure hardReset in AQ_GlobalStandardControl_1_APPIA */ -#define bits_AQ_GlobalStandardControl_1_APPIA_hardReset u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure hardReset in AQ_GlobalStandardControl_1_APPIA */ -#define word_AQ_GlobalStandardControl_1_APPIA_hardReset u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowPower in AQ_GlobalStandardControl_1_APPIA */ -#define AQ_GlobalStandardControl_1_APPIA_lowPower 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowPower in AQ_GlobalStandardControl_1_APPIA */ -#define bits_AQ_GlobalStandardControl_1_APPIA_lowPower u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowPower in AQ_GlobalStandardControl_1_APPIA */ -#define word_AQ_GlobalStandardControl_1_APPIA_lowPower u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalStandardDeviceIdentifier_APPIA */ -#define AQ_GlobalStandardDeviceIdentifier_APPIA_baseRegisterAddress 0x0002 -/*! \brief MMD address of structure AQ_GlobalStandardDeviceIdentifier_APPIA */ -#define AQ_GlobalStandardDeviceIdentifier_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure deviceIdMSW in AQ_GlobalStandardDeviceIdentifier_APPIA */ -#define AQ_GlobalStandardDeviceIdentifier_APPIA_deviceIdMSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure deviceIdMSW in AQ_GlobalStandardDeviceIdentifier_APPIA */ -#define bits_AQ_GlobalStandardDeviceIdentifier_APPIA_deviceIdMSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure deviceIdMSW in AQ_GlobalStandardDeviceIdentifier_APPIA */ -#define word_AQ_GlobalStandardDeviceIdentifier_APPIA_deviceIdMSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure deviceIdLSW in AQ_GlobalStandardDeviceIdentifier_APPIA */ -#define AQ_GlobalStandardDeviceIdentifier_APPIA_deviceIdLSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure deviceIdLSW in AQ_GlobalStandardDeviceIdentifier_APPIA */ -#define bits_AQ_GlobalStandardDeviceIdentifier_APPIA_deviceIdLSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure deviceIdLSW in AQ_GlobalStandardDeviceIdentifier_APPIA */ -#define word_AQ_GlobalStandardDeviceIdentifier_APPIA_deviceIdLSW u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_baseRegisterAddress 0x0005 -/*! \brief MMD address of structure AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_autonegotiationPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardDevicesInPackage_APPIA_autonegotiationPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardDevicesInPackage_APPIA_autonegotiationPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure tcPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_tcPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure tcPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardDevicesInPackage_APPIA_tcPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure tcPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardDevicesInPackage_APPIA_tcPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure dteXsPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_dteXsPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure dteXsPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardDevicesInPackage_APPIA_dteXsPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure dteXsPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardDevicesInPackage_APPIA_dteXsPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_Present in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_phyXS_Present 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_Present in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardDevicesInPackage_APPIA_phyXS_Present u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_Present in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardDevicesInPackage_APPIA_phyXS_Present u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_pcsPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardDevicesInPackage_APPIA_pcsPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardDevicesInPackage_APPIA_pcsPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure wisPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_wisPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure wisPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardDevicesInPackage_APPIA_wisPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure wisPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardDevicesInPackage_APPIA_wisPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pmaPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_pmaPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardDevicesInPackage_APPIA_pmaPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardDevicesInPackage_APPIA_pmaPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure clause_22RegistersPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define AQ_GlobalStandardDevicesInPackage_APPIA_clause_22RegistersPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure clause_22RegistersPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardDevicesInPackage_APPIA_clause_22RegistersPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure clause_22RegistersPresent in AQ_GlobalStandardDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardDevicesInPackage_APPIA_clause_22RegistersPresent u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define AQ_GlobalStandardVendorDevicesInPackage_APPIA_baseRegisterAddress 0x0006 -/*! \brief MMD address of structure AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define AQ_GlobalStandardVendorDevicesInPackage_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure vendorSpecificDevice_2Present in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define AQ_GlobalStandardVendorDevicesInPackage_APPIA_vendorSpecificDevice_2Present 0 -/*! \brief Preprocessor variable to relate field to bit position in structure vendorSpecificDevice_2Present in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardVendorDevicesInPackage_APPIA_vendorSpecificDevice_2Present u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure vendorSpecificDevice_2Present in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardVendorDevicesInPackage_APPIA_vendorSpecificDevice_2Present u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure vendorSpecificDevice_1Present in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define AQ_GlobalStandardVendorDevicesInPackage_APPIA_vendorSpecificDevice_1Present 0 -/*! \brief Preprocessor variable to relate field to bit position in structure vendorSpecificDevice_1Present in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardVendorDevicesInPackage_APPIA_vendorSpecificDevice_1Present u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure vendorSpecificDevice_1Present in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardVendorDevicesInPackage_APPIA_vendorSpecificDevice_1Present u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure clause_22ExtensionPresent in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define AQ_GlobalStandardVendorDevicesInPackage_APPIA_clause_22ExtensionPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure clause_22ExtensionPresent in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define bits_AQ_GlobalStandardVendorDevicesInPackage_APPIA_clause_22ExtensionPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure clause_22ExtensionPresent in AQ_GlobalStandardVendorDevicesInPackage_APPIA */ -#define word_AQ_GlobalStandardVendorDevicesInPackage_APPIA_clause_22ExtensionPresent u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalStandardStatus_2_APPIA */ -#define AQ_GlobalStandardStatus_2_APPIA_baseRegisterAddress 0x0008 -/*! \brief MMD address of structure AQ_GlobalStandardStatus_2_APPIA */ -#define AQ_GlobalStandardStatus_2_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure devicePresent in AQ_GlobalStandardStatus_2_APPIA */ -#define AQ_GlobalStandardStatus_2_APPIA_devicePresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure devicePresent in AQ_GlobalStandardStatus_2_APPIA */ -#define bits_AQ_GlobalStandardStatus_2_APPIA_devicePresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure devicePresent in AQ_GlobalStandardStatus_2_APPIA */ -#define word_AQ_GlobalStandardStatus_2_APPIA_devicePresent u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalStandardPackageIdentifier_APPIA */ -#define AQ_GlobalStandardPackageIdentifier_APPIA_baseRegisterAddress 0x000E -/*! \brief MMD address of structure AQ_GlobalStandardPackageIdentifier_APPIA */ -#define AQ_GlobalStandardPackageIdentifier_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure packageIdMSW in AQ_GlobalStandardPackageIdentifier_APPIA */ -#define AQ_GlobalStandardPackageIdentifier_APPIA_packageIdMSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure packageIdMSW in AQ_GlobalStandardPackageIdentifier_APPIA */ -#define bits_AQ_GlobalStandardPackageIdentifier_APPIA_packageIdMSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure packageIdMSW in AQ_GlobalStandardPackageIdentifier_APPIA */ -#define word_AQ_GlobalStandardPackageIdentifier_APPIA_packageIdMSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure packageIdLSW in AQ_GlobalStandardPackageIdentifier_APPIA */ -#define AQ_GlobalStandardPackageIdentifier_APPIA_packageIdLSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure packageIdLSW in AQ_GlobalStandardPackageIdentifier_APPIA */ -#define bits_AQ_GlobalStandardPackageIdentifier_APPIA_packageIdLSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure packageIdLSW in AQ_GlobalStandardPackageIdentifier_APPIA */ -#define word_AQ_GlobalStandardPackageIdentifier_APPIA_packageIdLSW u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalFirmwareID_APPIA */ -#define AQ_GlobalFirmwareID_APPIA_baseRegisterAddress 0x0020 -/*! \brief MMD address of structure AQ_GlobalFirmwareID_APPIA */ -#define AQ_GlobalFirmwareID_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure firmwareMajorRevisionNumber in AQ_GlobalFirmwareID_APPIA */ -#define AQ_GlobalFirmwareID_APPIA_firmwareMajorRevisionNumber 0 -/*! \brief Preprocessor variable to relate field to bit position in structure firmwareMajorRevisionNumber in AQ_GlobalFirmwareID_APPIA */ -#define bits_AQ_GlobalFirmwareID_APPIA_firmwareMajorRevisionNumber u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure firmwareMajorRevisionNumber in AQ_GlobalFirmwareID_APPIA */ -#define word_AQ_GlobalFirmwareID_APPIA_firmwareMajorRevisionNumber u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure firmwareMinorRevisionNumber in AQ_GlobalFirmwareID_APPIA */ -#define AQ_GlobalFirmwareID_APPIA_firmwareMinorRevisionNumber 0 -/*! \brief Preprocessor variable to relate field to bit position in structure firmwareMinorRevisionNumber in AQ_GlobalFirmwareID_APPIA */ -#define bits_AQ_GlobalFirmwareID_APPIA_firmwareMinorRevisionNumber u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure firmwareMinorRevisionNumber in AQ_GlobalFirmwareID_APPIA */ -#define word_AQ_GlobalFirmwareID_APPIA_firmwareMinorRevisionNumber u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalChipIdentification_APPIA */ -#define AQ_GlobalChipIdentification_APPIA_baseRegisterAddress 0x0021 -/*! \brief MMD address of structure AQ_GlobalChipIdentification_APPIA */ -#define AQ_GlobalChipIdentification_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure chipIdentification in AQ_GlobalChipIdentification_APPIA */ -#define AQ_GlobalChipIdentification_APPIA_chipIdentification 0 -/*! \brief Preprocessor variable to relate field to bit position in structure chipIdentification in AQ_GlobalChipIdentification_APPIA */ -#define bits_AQ_GlobalChipIdentification_APPIA_chipIdentification u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure chipIdentification in AQ_GlobalChipIdentification_APPIA */ -#define word_AQ_GlobalChipIdentification_APPIA_chipIdentification u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalChipRevision_APPIA */ -#define AQ_GlobalChipRevision_APPIA_baseRegisterAddress 0x0022 -/*! \brief MMD address of structure AQ_GlobalChipRevision_APPIA */ -#define AQ_GlobalChipRevision_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure chipRevision in AQ_GlobalChipRevision_APPIA */ -#define AQ_GlobalChipRevision_APPIA_chipRevision 0 -/*! \brief Preprocessor variable to relate field to bit position in structure chipRevision in AQ_GlobalChipRevision_APPIA */ -#define bits_AQ_GlobalChipRevision_APPIA_chipRevision u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure chipRevision in AQ_GlobalChipRevision_APPIA */ -#define word_AQ_GlobalChipRevision_APPIA_chipRevision u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_baseRegisterAddress 0x0100 -/*! \brief MMD address of structure AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure nvrExecuteOperation in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrExecuteOperation 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrExecuteOperation in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrExecuteOperation u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrExecuteOperation in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrExecuteOperation u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrWriteMode in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrWriteMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrWriteMode in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrWriteMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrWriteMode in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrWriteMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure freezeNvrCrc in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_freezeNvrCrc 0 -/*! \brief Preprocessor variable to relate field to bit position in structure freezeNvrCrc in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_freezeNvrCrc u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure freezeNvrCrc in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_freezeNvrCrc u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure resetNvrCrc in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_resetNvrCrc 0 -/*! \brief Preprocessor variable to relate field to bit position in structure resetNvrCrc in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_resetNvrCrc u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure resetNvrCrc in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_resetNvrCrc u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrBurst in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrBurst 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrBurst in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrBurst u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrBurst in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrBurst u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrBusy in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrBusy 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrBusy in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrBusy u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrBusy in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrBusy u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrOpcode in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrOpcode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrOpcode in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrOpcode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrOpcode in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrOpcode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrMailboxCrc in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrMailboxCrc 1 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrMailboxCrc in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrMailboxCrc u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure nvrMailboxCrc in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrMailboxCrc u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrAddressMSW in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrAddressMSW 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrAddressMSW in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrAddressMSW u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrAddressMSW in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrAddressMSW u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure nvrAddressLSW in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrAddressLSW 3 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrAddressLSW in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrAddressLSW u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure nvrAddressLSW in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrAddressLSW u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDataMSW in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrDataMSW 4 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDataMSW in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrDataMSW u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDataMSW in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrDataMSW u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDataLSW in AQ_GlobalNvrInterface_APPIA */ -#define AQ_GlobalNvrInterface_APPIA_nvrDataLSW 5 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDataLSW in AQ_GlobalNvrInterface_APPIA */ -#define bits_AQ_GlobalNvrInterface_APPIA_nvrDataLSW u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDataLSW in AQ_GlobalNvrInterface_APPIA */ -#define word_AQ_GlobalNvrInterface_APPIA_nvrDataLSW u5.word_5 - -/*! \brief Base register address of structure AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_baseRegisterAddress 0x0200 -/*! \brief MMD address of structure AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxExecuteOperation in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxExecuteOperation 0 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxExecuteOperation in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxExecuteOperation u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxExecuteOperation in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxExecuteOperation u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxWriteMode in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxWriteMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxWriteMode in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxWriteMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxWriteMode in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxWriteMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure resetUpMailboxCrc in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_resetUpMailboxCrc 0 -/*! \brief Preprocessor variable to relate field to bit position in structure resetUpMailboxCrc in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_resetUpMailboxCrc u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure resetUpMailboxCrc in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_resetUpMailboxCrc u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxBusy in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxBusy 0 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxBusy in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxBusy u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxBusy in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxBusy u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxCrc in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxCrc 1 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxCrc in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxCrc u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxCrc in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxCrc u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxAddressMSW in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxAddressMSW 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxAddressMSW in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxAddressMSW u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxAddressMSW in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxAddressMSW u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxAddressLSW in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxAddressLSW 3 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxAddressLSW in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxAddressLSW u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxAddressLSW in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxAddressLSW u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxAddressLSW_Don_tCare in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxAddressLSW_Don_tCare 3 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxAddressLSW_Don_tCare in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxAddressLSW_Don_tCare u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxAddressLSW_Don_tCare in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxAddressLSW_Don_tCare u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxDataMSW in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxDataMSW 4 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxDataMSW in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxDataMSW u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxDataMSW in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxDataMSW u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxDataLSW in AQ_GlobalMailboxInterface_APPIA */ -#define AQ_GlobalMailboxInterface_APPIA_upMailboxDataLSW 5 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxDataLSW in AQ_GlobalMailboxInterface_APPIA */ -#define bits_AQ_GlobalMailboxInterface_APPIA_upMailboxDataLSW u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxDataLSW in AQ_GlobalMailboxInterface_APPIA */ -#define word_AQ_GlobalMailboxInterface_APPIA_upMailboxDataLSW u5.word_5 - -/*! \brief Base register address of structure AQ_GlobalMicroprocessorScratchPad_APPIA */ -#define AQ_GlobalMicroprocessorScratchPad_APPIA_baseRegisterAddress 0x0300 -/*! \brief MMD address of structure AQ_GlobalMicroprocessorScratchPad_APPIA */ -#define AQ_GlobalMicroprocessorScratchPad_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure scratchPad_1 in AQ_GlobalMicroprocessorScratchPad_APPIA */ -#define AQ_GlobalMicroprocessorScratchPad_APPIA_scratchPad_1 0 -/*! \brief Preprocessor variable to relate field to bit position in structure scratchPad_1 in AQ_GlobalMicroprocessorScratchPad_APPIA */ -#define bits_AQ_GlobalMicroprocessorScratchPad_APPIA_scratchPad_1 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure scratchPad_1 in AQ_GlobalMicroprocessorScratchPad_APPIA */ -#define word_AQ_GlobalMicroprocessorScratchPad_APPIA_scratchPad_1 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure scratchPad_2 in AQ_GlobalMicroprocessorScratchPad_APPIA */ -#define AQ_GlobalMicroprocessorScratchPad_APPIA_scratchPad_2 1 -/*! \brief Preprocessor variable to relate field to bit position in structure scratchPad_2 in AQ_GlobalMicroprocessorScratchPad_APPIA */ -#define bits_AQ_GlobalMicroprocessorScratchPad_APPIA_scratchPad_2 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure scratchPad_2 in AQ_GlobalMicroprocessorScratchPad_APPIA */ -#define word_AQ_GlobalMicroprocessorScratchPad_APPIA_scratchPad_2 u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalControl_APPIA */ -#define AQ_GlobalControl_APPIA_baseRegisterAddress 0xC000 -/*! \brief MMD address of structure AQ_GlobalControl_APPIA */ -#define AQ_GlobalControl_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure upReset in AQ_GlobalControl_APPIA */ -#define AQ_GlobalControl_APPIA_upReset 1 -/*! \brief Preprocessor variable to relate field to bit position in structure upReset in AQ_GlobalControl_APPIA */ -#define bits_AQ_GlobalControl_APPIA_upReset u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure upReset in AQ_GlobalControl_APPIA */ -#define word_AQ_GlobalControl_APPIA_upReset u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure upRunStallOverride in AQ_GlobalControl_APPIA */ -#define AQ_GlobalControl_APPIA_upRunStallOverride 1 -/*! \brief Preprocessor variable to relate field to bit position in structure upRunStallOverride in AQ_GlobalControl_APPIA */ -#define bits_AQ_GlobalControl_APPIA_upRunStallOverride u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure upRunStallOverride in AQ_GlobalControl_APPIA */ -#define word_AQ_GlobalControl_APPIA_upRunStallOverride u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure upRunStall in AQ_GlobalControl_APPIA */ -#define AQ_GlobalControl_APPIA_upRunStall 1 -/*! \brief Preprocessor variable to relate field to bit position in structure upRunStall in AQ_GlobalControl_APPIA */ -#define bits_AQ_GlobalControl_APPIA_upRunStall u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure upRunStall in AQ_GlobalControl_APPIA */ -#define word_AQ_GlobalControl_APPIA_upRunStall u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalResetControl_APPIA */ -#define AQ_GlobalResetControl_APPIA_baseRegisterAddress 0xC006 -/*! \brief MMD address of structure AQ_GlobalResetControl_APPIA */ -#define AQ_GlobalResetControl_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure globalMMD_ResetDisable in AQ_GlobalResetControl_APPIA */ -#define AQ_GlobalResetControl_APPIA_globalMMD_ResetDisable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalMMD_ResetDisable in AQ_GlobalResetControl_APPIA */ -#define bits_AQ_GlobalResetControl_APPIA_globalMMD_ResetDisable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalMMD_ResetDisable in AQ_GlobalResetControl_APPIA */ -#define word_AQ_GlobalResetControl_APPIA_globalMMD_ResetDisable u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalDiagnosticProvisioning_APPIA */ -#define AQ_GlobalDiagnosticProvisioning_APPIA_baseRegisterAddress 0xC400 -/*! \brief MMD address of structure AQ_GlobalDiagnosticProvisioning_APPIA */ -#define AQ_GlobalDiagnosticProvisioning_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure enableDiagnostics in AQ_GlobalDiagnosticProvisioning_APPIA */ -#define AQ_GlobalDiagnosticProvisioning_APPIA_enableDiagnostics 0 -/*! \brief Preprocessor variable to relate field to bit position in structure enableDiagnostics in AQ_GlobalDiagnosticProvisioning_APPIA */ -#define bits_AQ_GlobalDiagnosticProvisioning_APPIA_enableDiagnostics u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure enableDiagnostics in AQ_GlobalDiagnosticProvisioning_APPIA */ -#define word_AQ_GlobalDiagnosticProvisioning_APPIA_enableDiagnostics u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalThermalProvisioning_APPIA */ -#define AQ_GlobalThermalProvisioning_APPIA_baseRegisterAddress 0xC420 -/*! \brief MMD address of structure AQ_GlobalThermalProvisioning_APPIA */ -#define AQ_GlobalThermalProvisioning_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure reserved_0 in AQ_GlobalThermalProvisioning_APPIA */ -#define AQ_GlobalThermalProvisioning_APPIA_reserved_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_0 in AQ_GlobalThermalProvisioning_APPIA */ -#define bits_AQ_GlobalThermalProvisioning_APPIA_reserved_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_0 in AQ_GlobalThermalProvisioning_APPIA */ -#define word_AQ_GlobalThermalProvisioning_APPIA_reserved_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure highTempFailureThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define AQ_GlobalThermalProvisioning_APPIA_highTempFailureThreshold 1 -/*! \brief Preprocessor variable to relate field to bit position in structure highTempFailureThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define bits_AQ_GlobalThermalProvisioning_APPIA_highTempFailureThreshold u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure highTempFailureThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define word_AQ_GlobalThermalProvisioning_APPIA_highTempFailureThreshold u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure lowTempFailureThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define AQ_GlobalThermalProvisioning_APPIA_lowTempFailureThreshold 2 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTempFailureThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define bits_AQ_GlobalThermalProvisioning_APPIA_lowTempFailureThreshold u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure lowTempFailureThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define word_AQ_GlobalThermalProvisioning_APPIA_lowTempFailureThreshold u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure highTempWarningThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define AQ_GlobalThermalProvisioning_APPIA_highTempWarningThreshold 3 -/*! \brief Preprocessor variable to relate field to bit position in structure highTempWarningThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define bits_AQ_GlobalThermalProvisioning_APPIA_highTempWarningThreshold u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure highTempWarningThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define word_AQ_GlobalThermalProvisioning_APPIA_highTempWarningThreshold u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure lowTempWarningThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define AQ_GlobalThermalProvisioning_APPIA_lowTempWarningThreshold 4 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTempWarningThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define bits_AQ_GlobalThermalProvisioning_APPIA_lowTempWarningThreshold u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure lowTempWarningThreshold in AQ_GlobalThermalProvisioning_APPIA */ -#define word_AQ_GlobalThermalProvisioning_APPIA_lowTempWarningThreshold u4.word_4 - -/*! \brief Base register address of structure AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_baseRegisterAddress 0xC430 -/*! \brief MMD address of structure AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure led_0ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0ManualSet 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0ManualSet u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0ManualSet u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0_10Gb_sLinkEstablished 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0_10Gb_sLinkEstablished u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0_10Gb_sLinkEstablished u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0_1Gb_sLinkEstablished 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0_1Gb_sLinkEstablished u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0_1Gb_sLinkEstablished u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0_100Mb_sLinkEstablished 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0_100Mb_sLinkEstablished u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0_100Mb_sLinkEstablished u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0Connecting 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0Connecting u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0Connecting u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0ReceiveActivity 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0ReceiveActivity u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0ReceiveActivity u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0TransmitActivity 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0TransmitActivity u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0TransmitActivity u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0ActivityStretch 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0ActivityStretch u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0ActivityStretch u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_1ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1ManualSet 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1ManualSet u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1ManualSet u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1_10Gb_sLinkEstablished 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1_10Gb_sLinkEstablished u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1_10Gb_sLinkEstablished u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1_1Gb_sLinkEstablished 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1_1Gb_sLinkEstablished u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1_1Gb_sLinkEstablished u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1_100Mb_sLinkEstablished 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1_100Mb_sLinkEstablished u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1_100Mb_sLinkEstablished u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1Connecting 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1Connecting u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1Connecting u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1ReceiveActivity 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1ReceiveActivity u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1ReceiveActivity u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1TransmitActivity 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1TransmitActivity u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1TransmitActivity u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1ActivityStretch 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1ActivityStretch u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1ActivityStretch u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_2ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2ManualSet 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2ManualSet u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2ManualSet u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2_10Gb_sLinkEstablished 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2_10Gb_sLinkEstablished u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2_10Gb_sLinkEstablished u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2_1Gb_sLinkEstablished 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2_1Gb_sLinkEstablished u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2_1Gb_sLinkEstablished u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2_100Mb_sLinkEstablished 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2_100Mb_sLinkEstablished u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2_100Mb_sLinkEstablished u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2Connecting 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2Connecting u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2Connecting u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2ReceiveActivity 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2ReceiveActivity u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2ReceiveActivity u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2TransmitActivity 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2TransmitActivity u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2TransmitActivity u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2ActivityStretch 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2ActivityStretch u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2ActivityStretch u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_3ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3ManualSet 3 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3ManualSet u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure led_3ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3ManualSet u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure led_3_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3_10Gb_sLinkEstablished 3 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3_10Gb_sLinkEstablished u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure led_3_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3_10Gb_sLinkEstablished u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure led_3_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3_1Gb_sLinkEstablished 3 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3_1Gb_sLinkEstablished u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure led_3_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3_1Gb_sLinkEstablished u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure led_3_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3_100Mb_sLinkEstablished 3 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3_100Mb_sLinkEstablished u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure led_3_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3_100Mb_sLinkEstablished u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure led_3Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3Connecting 3 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3Connecting u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure led_3Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3Connecting u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure led_3ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3ReceiveActivity 3 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3ReceiveActivity u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure led_3ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3ReceiveActivity u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure led_3TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3TransmitActivity 3 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3TransmitActivity u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure led_3TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3TransmitActivity u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure led_3ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3ActivityStretch 3 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3ActivityStretch u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure led_3ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3ActivityStretch u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure led_4ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4ManualSet 4 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4ManualSet u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure led_4ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4ManualSet u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure led_4_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4_10Gb_sLinkEstablished 4 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4_10Gb_sLinkEstablished u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure led_4_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4_10Gb_sLinkEstablished u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure led_4_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4_1Gb_sLinkEstablished 4 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4_1Gb_sLinkEstablished u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure led_4_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4_1Gb_sLinkEstablished u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure led_4_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4_100Mb_sLinkEstablished 4 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4_100Mb_sLinkEstablished u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure led_4_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4_100Mb_sLinkEstablished u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure led_4Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4Connecting 4 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4Connecting u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure led_4Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4Connecting u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure led_4ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4ReceiveActivity 4 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4ReceiveActivity u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure led_4ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4ReceiveActivity u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure led_4TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4TransmitActivity 4 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4TransmitActivity u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure led_4TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4TransmitActivity u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure led_4ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4ActivityStretch 4 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4ActivityStretch u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure led_4ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4ActivityStretch u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure led_5ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5ManualSet 5 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5ManualSet u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure led_5ManualSet in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5ManualSet u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure led_5_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5_10Gb_sLinkEstablished 5 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5_10Gb_sLinkEstablished u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure led_5_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5_10Gb_sLinkEstablished u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure led_5_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5_1Gb_sLinkEstablished 5 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5_1Gb_sLinkEstablished u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure led_5_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5_1Gb_sLinkEstablished u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure led_5_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5_100Mb_sLinkEstablished 5 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5_100Mb_sLinkEstablished u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure led_5_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5_100Mb_sLinkEstablished u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure led_5Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5Connecting 5 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5Connecting u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure led_5Connecting in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5Connecting u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure led_5ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5ReceiveActivity 5 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5ReceiveActivity u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure led_5ReceiveActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5ReceiveActivity u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure led_5TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5TransmitActivity 5 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5TransmitActivity u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure led_5TransmitActivity in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5TransmitActivity u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure led_5ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5ActivityStretch 5 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5ActivityStretch u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure led_5ActivityStretch in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5ActivityStretch u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure ledOperationMode in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_ledOperationMode 7 -/*! \brief Preprocessor variable to relate field to bit position in structure ledOperationMode in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_ledOperationMode u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure ledOperationMode in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_ledOperationMode u7.word_7 -/*! \brief Preprocessor variable to relate field to word number in structure led_0DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0DriveThreeStateSelect 8 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0DriveThreeStateSelect u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure led_0DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0DriveThreeStateSelect u8.word_8 -/*! \brief Preprocessor variable to relate field to word number in structure led_0ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0ActiveHighSelect 8 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0ActiveHighSelect u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure led_0ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0ActiveHighSelect u8.word_8 -/*! \brief Preprocessor variable to relate field to word number in structure led_0ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_0ManualActiveSelect 8 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_0ManualActiveSelect u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure led_0ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_0ManualActiveSelect u8.word_8 -/*! \brief Preprocessor variable to relate field to word number in structure led_1DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1DriveThreeStateSelect 9 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1DriveThreeStateSelect u9.bits_9 -/*! \brief Preprocessor variable to relate field to word position in structure led_1DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1DriveThreeStateSelect u9.word_9 -/*! \brief Preprocessor variable to relate field to word number in structure led_1ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1ActiveHighSelect 9 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1ActiveHighSelect u9.bits_9 -/*! \brief Preprocessor variable to relate field to word position in structure led_1ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1ActiveHighSelect u9.word_9 -/*! \brief Preprocessor variable to relate field to word number in structure led_1ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_1ManualActiveSelect 9 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_1ManualActiveSelect u9.bits_9 -/*! \brief Preprocessor variable to relate field to word position in structure led_1ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_1ManualActiveSelect u9.word_9 -/*! \brief Preprocessor variable to relate field to word number in structure led_2DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2DriveThreeStateSelect 10 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2DriveThreeStateSelect u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure led_2DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2DriveThreeStateSelect u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure led_2ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2ActiveHighSelect 10 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2ActiveHighSelect u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure led_2ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2ActiveHighSelect u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure led_2ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_2ManualActiveSelect 10 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_2ManualActiveSelect u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure led_2ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_2ManualActiveSelect u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure led_3DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3DriveThreeStateSelect 11 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3DriveThreeStateSelect u11.bits_11 -/*! \brief Preprocessor variable to relate field to word position in structure led_3DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3DriveThreeStateSelect u11.word_11 -/*! \brief Preprocessor variable to relate field to word number in structure led_3ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3ActiveHighSelect 11 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3ActiveHighSelect u11.bits_11 -/*! \brief Preprocessor variable to relate field to word position in structure led_3ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3ActiveHighSelect u11.word_11 -/*! \brief Preprocessor variable to relate field to word number in structure led_3ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_3ManualActiveSelect 11 -/*! \brief Preprocessor variable to relate field to bit position in structure led_3ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_3ManualActiveSelect u11.bits_11 -/*! \brief Preprocessor variable to relate field to word position in structure led_3ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_3ManualActiveSelect u11.word_11 -/*! \brief Preprocessor variable to relate field to word number in structure led_4DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4DriveThreeStateSelect 12 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4DriveThreeStateSelect u12.bits_12 -/*! \brief Preprocessor variable to relate field to word position in structure led_4DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4DriveThreeStateSelect u12.word_12 -/*! \brief Preprocessor variable to relate field to word number in structure led_4ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4ActiveHighSelect 12 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4ActiveHighSelect u12.bits_12 -/*! \brief Preprocessor variable to relate field to word position in structure led_4ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4ActiveHighSelect u12.word_12 -/*! \brief Preprocessor variable to relate field to word number in structure led_4ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_4ManualActiveSelect 12 -/*! \brief Preprocessor variable to relate field to bit position in structure led_4ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_4ManualActiveSelect u12.bits_12 -/*! \brief Preprocessor variable to relate field to word position in structure led_4ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_4ManualActiveSelect u12.word_12 -/*! \brief Preprocessor variable to relate field to word number in structure led_5DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5DriveThreeStateSelect 13 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5DriveThreeStateSelect u13.bits_13 -/*! \brief Preprocessor variable to relate field to word position in structure led_5DriveThreeStateSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5DriveThreeStateSelect u13.word_13 -/*! \brief Preprocessor variable to relate field to word number in structure led_5ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5ActiveHighSelect 13 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5ActiveHighSelect u13.bits_13 -/*! \brief Preprocessor variable to relate field to word position in structure led_5ActiveHighSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5ActiveHighSelect u13.word_13 -/*! \brief Preprocessor variable to relate field to word number in structure led_5ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define AQ_GlobalLedProvisioning_APPIA_led_5ManualActiveSelect 13 -/*! \brief Preprocessor variable to relate field to bit position in structure led_5ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define bits_AQ_GlobalLedProvisioning_APPIA_led_5ManualActiveSelect u13.bits_13 -/*! \brief Preprocessor variable to relate field to word position in structure led_5ManualActiveSelect in AQ_GlobalLedProvisioning_APPIA */ -#define word_AQ_GlobalLedProvisioning_APPIA_led_5ManualActiveSelect u13.word_13 - -/*! \brief Base register address of structure AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_baseRegisterAddress 0xC440 -/*! \brief MMD address of structure AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure gangLoadMdioAddress in AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_gangLoadMdioAddress 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gangLoadMdioAddress in AQ_GlobalGeneralProvisioning_APPIA */ -#define bits_AQ_GlobalGeneralProvisioning_APPIA_gangLoadMdioAddress u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gangLoadMdioAddress in AQ_GlobalGeneralProvisioning_APPIA */ -#define word_AQ_GlobalGeneralProvisioning_APPIA_gangLoadMdioAddress u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gangLoadMdioWriteOnly in AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_gangLoadMdioWriteOnly 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gangLoadMdioWriteOnly in AQ_GlobalGeneralProvisioning_APPIA */ -#define bits_AQ_GlobalGeneralProvisioning_APPIA_gangLoadMdioWriteOnly u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gangLoadMdioWriteOnly in AQ_GlobalGeneralProvisioning_APPIA */ -#define word_AQ_GlobalGeneralProvisioning_APPIA_gangLoadMdioWriteOnly u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mdioBroadcastModeEnable in AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_mdioBroadcastModeEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioBroadcastModeEnable in AQ_GlobalGeneralProvisioning_APPIA */ -#define bits_AQ_GlobalGeneralProvisioning_APPIA_mdioBroadcastModeEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioBroadcastModeEnable in AQ_GlobalGeneralProvisioning_APPIA */ -#define word_AQ_GlobalGeneralProvisioning_APPIA_mdioBroadcastModeEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioReadMSW_FirstEnable in AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_mdioReadMSW_FirstEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioReadMSW_FirstEnable in AQ_GlobalGeneralProvisioning_APPIA */ -#define bits_AQ_GlobalGeneralProvisioning_APPIA_mdioReadMSW_FirstEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioReadMSW_FirstEnable in AQ_GlobalGeneralProvisioning_APPIA */ -#define word_AQ_GlobalGeneralProvisioning_APPIA_mdioReadMSW_FirstEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioDriveConfiguration in AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_mdioDriveConfiguration 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioDriveConfiguration in AQ_GlobalGeneralProvisioning_APPIA */ -#define bits_AQ_GlobalGeneralProvisioning_APPIA_mdioDriveConfiguration u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioDriveConfiguration in AQ_GlobalGeneralProvisioning_APPIA */ -#define word_AQ_GlobalGeneralProvisioning_APPIA_mdioDriveConfiguration u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioPreambleDetectionDisable in AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_mdioPreambleDetectionDisable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioPreambleDetectionDisable in AQ_GlobalGeneralProvisioning_APPIA */ -#define bits_AQ_GlobalGeneralProvisioning_APPIA_mdioPreambleDetectionDisable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioPreambleDetectionDisable in AQ_GlobalGeneralProvisioning_APPIA */ -#define word_AQ_GlobalGeneralProvisioning_APPIA_mdioPreambleDetectionDisable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioAddressReset in AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_mdioAddressReset 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioAddressReset in AQ_GlobalGeneralProvisioning_APPIA */ -#define bits_AQ_GlobalGeneralProvisioning_APPIA_mdioAddressReset u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioAddressReset in AQ_GlobalGeneralProvisioning_APPIA */ -#define word_AQ_GlobalGeneralProvisioning_APPIA_mdioAddressReset u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure daisyChainReset in AQ_GlobalGeneralProvisioning_APPIA */ -#define AQ_GlobalGeneralProvisioning_APPIA_daisyChainReset 2 -/*! \brief Preprocessor variable to relate field to bit position in structure daisyChainReset in AQ_GlobalGeneralProvisioning_APPIA */ -#define bits_AQ_GlobalGeneralProvisioning_APPIA_daisyChainReset u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure daisyChainReset in AQ_GlobalGeneralProvisioning_APPIA */ -#define word_AQ_GlobalGeneralProvisioning_APPIA_daisyChainReset u2.word_2 - -/*! \brief Base register address of structure AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_baseRegisterAddress 0xC450 -/*! \brief MMD address of structure AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure nvrDataLength in AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_nvrDataLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDataLength in AQ_GlobalNvrProvisioning_APPIA */ -#define bits_AQ_GlobalNvrProvisioning_APPIA_nvrDataLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDataLength in AQ_GlobalNvrProvisioning_APPIA */ -#define word_AQ_GlobalNvrProvisioning_APPIA_nvrDataLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDummyLength in AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_nvrDummyLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDummyLength in AQ_GlobalNvrProvisioning_APPIA */ -#define bits_AQ_GlobalNvrProvisioning_APPIA_nvrDummyLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDummyLength in AQ_GlobalNvrProvisioning_APPIA */ -#define word_AQ_GlobalNvrProvisioning_APPIA_nvrDummyLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrAddressLength in AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_nvrAddressLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrAddressLength in AQ_GlobalNvrProvisioning_APPIA */ -#define bits_AQ_GlobalNvrProvisioning_APPIA_nvrAddressLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrAddressLength in AQ_GlobalNvrProvisioning_APPIA */ -#define word_AQ_GlobalNvrProvisioning_APPIA_nvrAddressLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrAddressLengthOverride in AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_nvrAddressLengthOverride 1 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrAddressLengthOverride in AQ_GlobalNvrProvisioning_APPIA */ -#define bits_AQ_GlobalNvrProvisioning_APPIA_nvrAddressLengthOverride u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure nvrAddressLengthOverride in AQ_GlobalNvrProvisioning_APPIA */ -#define word_AQ_GlobalNvrProvisioning_APPIA_nvrAddressLengthOverride u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrClockDivide in AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_nvrClockDivide 1 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrClockDivide in AQ_GlobalNvrProvisioning_APPIA */ -#define bits_AQ_GlobalNvrProvisioning_APPIA_nvrClockDivide u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure nvrClockDivide in AQ_GlobalNvrProvisioning_APPIA */ -#define word_AQ_GlobalNvrProvisioning_APPIA_nvrClockDivide u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDaisyChainClockDivideOverride in AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_nvrDaisyChainClockDivideOverride 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDaisyChainClockDivideOverride in AQ_GlobalNvrProvisioning_APPIA */ -#define bits_AQ_GlobalNvrProvisioning_APPIA_nvrDaisyChainClockDivideOverride u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDaisyChainClockDivideOverride in AQ_GlobalNvrProvisioning_APPIA */ -#define word_AQ_GlobalNvrProvisioning_APPIA_nvrDaisyChainClockDivideOverride u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDaisyChainDisable in AQ_GlobalNvrProvisioning_APPIA */ -#define AQ_GlobalNvrProvisioning_APPIA_nvrDaisyChainDisable 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDaisyChainDisable in AQ_GlobalNvrProvisioning_APPIA */ -#define bits_AQ_GlobalNvrProvisioning_APPIA_nvrDaisyChainDisable u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDaisyChainDisable in AQ_GlobalNvrProvisioning_APPIA */ -#define word_AQ_GlobalNvrProvisioning_APPIA_nvrDaisyChainDisable u2.word_2 - -/*! \brief Base register address of structure AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_baseRegisterAddress 0xC470 -/*! \brief MMD address of structure AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure diagnosticsSelect in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_diagnosticsSelect 0 -/*! \brief Preprocessor variable to relate field to bit position in structure diagnosticsSelect in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_diagnosticsSelect u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure diagnosticsSelect in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_diagnosticsSelect u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure extendedMdiDiagnosticsSelect in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_extendedMdiDiagnosticsSelect 0 -/*! \brief Preprocessor variable to relate field to bit position in structure extendedMdiDiagnosticsSelect in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_extendedMdiDiagnosticsSelect u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure extendedMdiDiagnosticsSelect in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_extendedMdiDiagnosticsSelect u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure initiateComponentDiagnostics in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_initiateComponentDiagnostics 0 -/*! \brief Preprocessor variable to relate field to bit position in structure initiateComponentDiagnostics in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_initiateComponentDiagnostics u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure initiateComponentDiagnostics in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_initiateComponentDiagnostics u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure initiateCableDiagnostics in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_initiateCableDiagnostics 0 -/*! \brief Preprocessor variable to relate field to bit position in structure initiateCableDiagnostics in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_initiateCableDiagnostics u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure initiateCableDiagnostics in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_initiateCableDiagnostics u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_2 in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_reservedProvisioning_2 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_2 in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_reservedProvisioning_2 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_2 in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_reservedProvisioning_2 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure enableDaisy_chainHop_countOverride in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_enableDaisy_chainHop_countOverride 1 -/*! \brief Preprocessor variable to relate field to bit position in structure enableDaisy_chainHop_countOverride in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_enableDaisy_chainHop_countOverride u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure enableDaisy_chainHop_countOverride in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_enableDaisy_chainHop_countOverride u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure daisy_chainHop_countOverrideValue in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_daisy_chainHop_countOverrideValue 1 -/*! \brief Preprocessor variable to relate field to bit position in structure daisy_chainHop_countOverrideValue in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_daisy_chainHop_countOverrideValue u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure daisy_chainHop_countOverrideValue in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_daisy_chainHop_countOverrideValue u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure enableLvddPowerSupplyTuning in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_enableLvddPowerSupplyTuning 2 -/*! \brief Preprocessor variable to relate field to bit position in structure enableLvddPowerSupplyTuning in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_enableLvddPowerSupplyTuning u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure enableLvddPowerSupplyTuning in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_enableLvddPowerSupplyTuning u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure enableVddPowerSupplyTuning in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_enableVddPowerSupplyTuning 2 -/*! \brief Preprocessor variable to relate field to bit position in structure enableVddPowerSupplyTuning in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_enableVddPowerSupplyTuning u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure enableVddPowerSupplyTuning in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_enableVddPowerSupplyTuning u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure tunableExternalLvddPowerSupplyPresent in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_tunableExternalLvddPowerSupplyPresent 2 -/*! \brief Preprocessor variable to relate field to bit position in structure tunableExternalLvddPowerSupplyPresent in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_tunableExternalLvddPowerSupplyPresent u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure tunableExternalLvddPowerSupplyPresent in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_tunableExternalLvddPowerSupplyPresent u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure tunableExternalVddPowerSupplyPresent in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_tunableExternalVddPowerSupplyPresent 2 -/*! \brief Preprocessor variable to relate field to bit position in structure tunableExternalVddPowerSupplyPresent in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_tunableExternalVddPowerSupplyPresent u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure tunableExternalVddPowerSupplyPresent in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_tunableExternalVddPowerSupplyPresent u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure enableXenpakRegisterSpace in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_enableXenpakRegisterSpace 2 -/*! \brief Preprocessor variable to relate field to bit position in structure enableXenpakRegisterSpace in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_enableXenpakRegisterSpace u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure enableXenpakRegisterSpace in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_enableXenpakRegisterSpace u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure enable_5thChannelRfiCancellation in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_enable_5thChannelRfiCancellation 2 -/*! \brief Preprocessor variable to relate field to bit position in structure enable_5thChannelRfiCancellation in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_enable_5thChannelRfiCancellation u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure enable_5thChannelRfiCancellation in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_enable_5thChannelRfiCancellation u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure trainingSNR in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_trainingSNR 4 -/*! \brief Preprocessor variable to relate field to bit position in structure trainingSNR in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_trainingSNR u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure trainingSNR in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_trainingSNR u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure smartPower_downStatus in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_smartPower_downStatus 5 -/*! \brief Preprocessor variable to relate field to bit position in structure smartPower_downStatus in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_smartPower_downStatus u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure smartPower_downStatus in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_smartPower_downStatus u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_6 in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_reservedProvisioning_6 5 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_6 in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_reservedProvisioning_6 u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_6 in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_reservedProvisioning_6 u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrLpDisableTimer in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_cfrLpDisableTimer 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrLpDisableTimer in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_cfrLpDisableTimer u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrLpDisableTimer in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_cfrLpDisableTimer u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrLpExtendedMaxwait in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_cfrLpExtendedMaxwait 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrLpExtendedMaxwait in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_cfrLpExtendedMaxwait u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrLpExtendedMaxwait in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_cfrLpExtendedMaxwait u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrLpTHP in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_cfrLpTHP 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrLpTHP in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_cfrLpTHP u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrLpTHP in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_cfrLpTHP u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrLpSupport in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_cfrLpSupport 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrLpSupport in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_cfrLpSupport u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrLpSupport in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_cfrLpSupport u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrDisableTimer in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_cfrDisableTimer 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrDisableTimer in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_cfrDisableTimer u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrDisableTimer in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_cfrDisableTimer u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrExtendedMaxwait in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_cfrExtendedMaxwait 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrExtendedMaxwait in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_cfrExtendedMaxwait u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrExtendedMaxwait in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_cfrExtendedMaxwait u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrTHP in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_cfrTHP 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrTHP in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_cfrTHP u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrTHP in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_cfrTHP u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrSupport in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_cfrSupport 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrSupport in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_cfrSupport u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrSupport in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_cfrSupport u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure deadlockAvoidanceEnable in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_deadlockAvoidanceEnable 5 -/*! \brief Preprocessor variable to relate field to bit position in structure deadlockAvoidanceEnable in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_deadlockAvoidanceEnable u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure deadlockAvoidanceEnable in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_deadlockAvoidanceEnable u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure smartPower_downEnable in AQ_GlobalReservedProvisioning_APPIA */ -#define AQ_GlobalReservedProvisioning_APPIA_smartPower_downEnable 5 -/*! \brief Preprocessor variable to relate field to bit position in structure smartPower_downEnable in AQ_GlobalReservedProvisioning_APPIA */ -#define bits_AQ_GlobalReservedProvisioning_APPIA_smartPower_downEnable u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure smartPower_downEnable in AQ_GlobalReservedProvisioning_APPIA */ -#define word_AQ_GlobalReservedProvisioning_APPIA_smartPower_downEnable u5.word_5 - -/*! \brief Base register address of structure AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_baseRegisterAddress 0xC800 -/*! \brief MMD address of structure AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pairAStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairAStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairAStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairAStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairBStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairBStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairBStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairBStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairBStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairCStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairCStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairCStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairCStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairCStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairDStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairDStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairDStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairDStatus in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairDStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairAReflection_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairAReflection_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairAReflection_1 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairAReflection_2 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairAReflection_2 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairAReflection_2 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure impulseResponseMSW in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_impulseResponseMSW 2 -/*! \brief Preprocessor variable to relate field to bit position in structure impulseResponseMSW in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_impulseResponseMSW u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure impulseResponseMSW in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_impulseResponseMSW u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairBReflection_1 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairBReflection_1 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairBReflection_1 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairBReflection_2 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairBReflection_2 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairBReflection_2 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure impulseResponseLSW in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_impulseResponseLSW 4 -/*! \brief Preprocessor variable to relate field to bit position in structure impulseResponseLSW in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_impulseResponseLSW u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure impulseResponseLSW in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_impulseResponseLSW u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairCReflection_1 5 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairCReflection_1 u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairCReflection_1 u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairCReflection_2 5 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairCReflection_2 u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairCReflection_2 u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_reserved_1 6 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_reserved_1 u6.bits_6 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_reserved_1 u6.word_6 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairDReflection_1 7 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairDReflection_1 u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_1 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairDReflection_1 u7.word_7 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_pairDReflection_2 7 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_pairDReflection_2 u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_pairDReflection_2 u7.word_7 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define AQ_GlobalCableDiagnosticStatus_APPIA_reserved_2 8 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define bits_AQ_GlobalCableDiagnosticStatus_APPIA_reserved_2 u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_2 in AQ_GlobalCableDiagnosticStatus_APPIA */ -#define word_AQ_GlobalCableDiagnosticStatus_APPIA_reserved_2 u8.word_8 - -/*! \brief Base register address of structure AQ_GlobalThermalStatus_APPIA */ -#define AQ_GlobalThermalStatus_APPIA_baseRegisterAddress 0xC820 -/*! \brief MMD address of structure AQ_GlobalThermalStatus_APPIA */ -#define AQ_GlobalThermalStatus_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure temperature in AQ_GlobalThermalStatus_APPIA */ -#define AQ_GlobalThermalStatus_APPIA_temperature 0 -/*! \brief Preprocessor variable to relate field to bit position in structure temperature in AQ_GlobalThermalStatus_APPIA */ -#define bits_AQ_GlobalThermalStatus_APPIA_temperature u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure temperature in AQ_GlobalThermalStatus_APPIA */ -#define word_AQ_GlobalThermalStatus_APPIA_temperature u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure temperatureReady in AQ_GlobalThermalStatus_APPIA */ -#define AQ_GlobalThermalStatus_APPIA_temperatureReady 1 -/*! \brief Preprocessor variable to relate field to bit position in structure temperatureReady in AQ_GlobalThermalStatus_APPIA */ -#define bits_AQ_GlobalThermalStatus_APPIA_temperatureReady u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure temperatureReady in AQ_GlobalThermalStatus_APPIA */ -#define word_AQ_GlobalThermalStatus_APPIA_temperatureReady u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalGeneralStatus_APPIA */ -#define AQ_GlobalGeneralStatus_APPIA_baseRegisterAddress 0xC830 -/*! \brief MMD address of structure AQ_GlobalGeneralStatus_APPIA */ -#define AQ_GlobalGeneralStatus_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureFailureState in AQ_GlobalGeneralStatus_APPIA */ -#define AQ_GlobalGeneralStatus_APPIA_highTemperatureFailureState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureFailureState in AQ_GlobalGeneralStatus_APPIA */ -#define bits_AQ_GlobalGeneralStatus_APPIA_highTemperatureFailureState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureFailureState in AQ_GlobalGeneralStatus_APPIA */ -#define word_AQ_GlobalGeneralStatus_APPIA_highTemperatureFailureState u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureFailureState in AQ_GlobalGeneralStatus_APPIA */ -#define AQ_GlobalGeneralStatus_APPIA_lowTemperatureFailureState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureFailureState in AQ_GlobalGeneralStatus_APPIA */ -#define bits_AQ_GlobalGeneralStatus_APPIA_lowTemperatureFailureState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureFailureState in AQ_GlobalGeneralStatus_APPIA */ -#define word_AQ_GlobalGeneralStatus_APPIA_lowTemperatureFailureState u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureWarningState in AQ_GlobalGeneralStatus_APPIA */ -#define AQ_GlobalGeneralStatus_APPIA_highTemperatureWarningState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureWarningState in AQ_GlobalGeneralStatus_APPIA */ -#define bits_AQ_GlobalGeneralStatus_APPIA_highTemperatureWarningState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureWarningState in AQ_GlobalGeneralStatus_APPIA */ -#define word_AQ_GlobalGeneralStatus_APPIA_highTemperatureWarningState u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureWarningState in AQ_GlobalGeneralStatus_APPIA */ -#define AQ_GlobalGeneralStatus_APPIA_lowTemperatureWarningState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureWarningState in AQ_GlobalGeneralStatus_APPIA */ -#define bits_AQ_GlobalGeneralStatus_APPIA_lowTemperatureWarningState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureWarningState in AQ_GlobalGeneralStatus_APPIA */ -#define word_AQ_GlobalGeneralStatus_APPIA_lowTemperatureWarningState u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure processorIntensiveMdioOperationIn_Progress in AQ_GlobalGeneralStatus_APPIA */ -#define AQ_GlobalGeneralStatus_APPIA_processorIntensiveMdioOperationIn_Progress 1 -/*! \brief Preprocessor variable to relate field to bit position in structure processorIntensiveMdioOperationIn_Progress in AQ_GlobalGeneralStatus_APPIA */ -#define bits_AQ_GlobalGeneralStatus_APPIA_processorIntensiveMdioOperationIn_Progress u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure processorIntensiveMdioOperationIn_Progress in AQ_GlobalGeneralStatus_APPIA */ -#define word_AQ_GlobalGeneralStatus_APPIA_processorIntensiveMdioOperationIn_Progress u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalPinStatus_APPIA */ -#define AQ_GlobalPinStatus_APPIA_baseRegisterAddress 0xC840 -/*! \brief MMD address of structure AQ_GlobalPinStatus_APPIA */ -#define AQ_GlobalPinStatus_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mdioBootLoad in AQ_GlobalPinStatus_APPIA */ -#define AQ_GlobalPinStatus_APPIA_mdioBootLoad 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioBootLoad in AQ_GlobalPinStatus_APPIA */ -#define bits_AQ_GlobalPinStatus_APPIA_mdioBootLoad u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mdioBootLoad in AQ_GlobalPinStatus_APPIA */ -#define word_AQ_GlobalPinStatus_APPIA_mdioBootLoad u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure packageConnectivity in AQ_GlobalPinStatus_APPIA */ -#define AQ_GlobalPinStatus_APPIA_packageConnectivity 0 -/*! \brief Preprocessor variable to relate field to bit position in structure packageConnectivity in AQ_GlobalPinStatus_APPIA */ -#define bits_AQ_GlobalPinStatus_APPIA_packageConnectivity u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure packageConnectivity in AQ_GlobalPinStatus_APPIA */ -#define word_AQ_GlobalPinStatus_APPIA_packageConnectivity u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure txEnable in AQ_GlobalPinStatus_APPIA */ -#define AQ_GlobalPinStatus_APPIA_txEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure txEnable in AQ_GlobalPinStatus_APPIA */ -#define bits_AQ_GlobalPinStatus_APPIA_txEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure txEnable in AQ_GlobalPinStatus_APPIA */ -#define word_AQ_GlobalPinStatus_APPIA_txEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure ledPullupState in AQ_GlobalPinStatus_APPIA */ -#define AQ_GlobalPinStatus_APPIA_ledPullupState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure ledPullupState in AQ_GlobalPinStatus_APPIA */ -#define bits_AQ_GlobalPinStatus_APPIA_ledPullupState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure ledPullupState in AQ_GlobalPinStatus_APPIA */ -#define word_AQ_GlobalPinStatus_APPIA_ledPullupState u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalDaisyChainStatus_APPIA */ -#define AQ_GlobalDaisyChainStatus_APPIA_baseRegisterAddress 0xC842 -/*! \brief MMD address of structure AQ_GlobalDaisyChainStatus_APPIA */ -#define AQ_GlobalDaisyChainStatus_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure rxDaisyChainCalculatedCrc in AQ_GlobalDaisyChainStatus_APPIA */ -#define AQ_GlobalDaisyChainStatus_APPIA_rxDaisyChainCalculatedCrc 0 -/*! \brief Preprocessor variable to relate field to bit position in structure rxDaisyChainCalculatedCrc in AQ_GlobalDaisyChainStatus_APPIA */ -#define bits_AQ_GlobalDaisyChainStatus_APPIA_rxDaisyChainCalculatedCrc u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure rxDaisyChainCalculatedCrc in AQ_GlobalDaisyChainStatus_APPIA */ -#define word_AQ_GlobalDaisyChainStatus_APPIA_rxDaisyChainCalculatedCrc u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalFaultMessage_APPIA */ -#define AQ_GlobalFaultMessage_APPIA_baseRegisterAddress 0xC850 -/*! \brief MMD address of structure AQ_GlobalFaultMessage_APPIA */ -#define AQ_GlobalFaultMessage_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure message in AQ_GlobalFaultMessage_APPIA */ -#define AQ_GlobalFaultMessage_APPIA_message 0 -/*! \brief Preprocessor variable to relate field to bit position in structure message in AQ_GlobalFaultMessage_APPIA */ -#define bits_AQ_GlobalFaultMessage_APPIA_message u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure message in AQ_GlobalFaultMessage_APPIA */ -#define word_AQ_GlobalFaultMessage_APPIA_message u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalPrimaryStatus_APPIA */ -#define AQ_GlobalPrimaryStatus_APPIA_baseRegisterAddress 0xC851 -/*! \brief MMD address of structure AQ_GlobalPrimaryStatus_APPIA */ -#define AQ_GlobalPrimaryStatus_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure primaryStatus in AQ_GlobalPrimaryStatus_APPIA */ -#define AQ_GlobalPrimaryStatus_APPIA_primaryStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure primaryStatus in AQ_GlobalPrimaryStatus_APPIA */ -#define bits_AQ_GlobalPrimaryStatus_APPIA_primaryStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure primaryStatus in AQ_GlobalPrimaryStatus_APPIA */ -#define word_AQ_GlobalPrimaryStatus_APPIA_primaryStatus u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_baseRegisterAddress 0xC880 -/*! \brief MMD address of structure AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure reserved_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_1 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_1 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_1 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_1 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_1 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_1 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_2 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_2 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_2 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_2 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_2 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_2 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_3 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_3 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_3 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_3 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_3 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_3 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_4 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_4 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_4 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_4 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_4 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairAReflection_4 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_5 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_5 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_5 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_5 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_5 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_5 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_1 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_6 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_6 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_6 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_6 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_6 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_6 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_2 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_2 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_2 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_7 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_7 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_7 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_7 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_7 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_7 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_3 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_3 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_3 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_8 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_8 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_8 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_8 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_8 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_8 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_4 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_4 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairBReflection_4 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_9 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_9 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_9 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_9 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_9 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_9 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_1 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_1 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_1 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_10 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_10 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_10 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_10 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_10 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_10 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_2 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_2 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_2 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_11 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_11 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_11 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_11 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_11 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_11 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_3 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_3 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_3 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_12 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_12 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_12 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_12 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_12 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_12 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_4 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_4 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairCReflection_4 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_13 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_13 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_13 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_13 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_13 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_13 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_1 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_1 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_1 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_1 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_14 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_14 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_14 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_14 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_14 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_14 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_2 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_2 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_2 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_2 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_15 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_15 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_15 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_15 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_15 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_15 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_3 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_3 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_3 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_3 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_16 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_16 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_16 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_16 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_16 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_reserved_16 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_4 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define bits_AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_4 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_4 in AQ_GlobalCableDiagnosticImpedance_APPIA */ -#define word_AQ_GlobalCableDiagnosticImpedance_APPIA_pairDReflection_4 u3.word_3 - -/*! \brief Base register address of structure AQ_GlobalStatus_APPIA */ -#define AQ_GlobalStatus_APPIA_baseRegisterAddress 0xC884 -/*! \brief MMD address of structure AQ_GlobalStatus_APPIA */ -#define AQ_GlobalStatus_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure reservedStatus_0 in AQ_GlobalStatus_APPIA */ -#define AQ_GlobalStatus_APPIA_reservedStatus_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedStatus_0 in AQ_GlobalStatus_APPIA */ -#define bits_AQ_GlobalStatus_APPIA_reservedStatus_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedStatus_0 in AQ_GlobalStatus_APPIA */ -#define word_AQ_GlobalStatus_APPIA_reservedStatus_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure cableLength in AQ_GlobalStatus_APPIA */ -#define AQ_GlobalStatus_APPIA_cableLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure cableLength in AQ_GlobalStatus_APPIA */ -#define bits_AQ_GlobalStatus_APPIA_cableLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure cableLength in AQ_GlobalStatus_APPIA */ -#define word_AQ_GlobalStatus_APPIA_cableLength u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalReservedStatus_APPIA */ -#define AQ_GlobalReservedStatus_APPIA_baseRegisterAddress 0xC885 -/*! \brief MMD address of structure AQ_GlobalReservedStatus_APPIA */ -#define AQ_GlobalReservedStatus_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure nearlySecondsMSW in AQ_GlobalReservedStatus_APPIA */ -#define AQ_GlobalReservedStatus_APPIA_nearlySecondsMSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nearlySecondsMSW in AQ_GlobalReservedStatus_APPIA */ -#define bits_AQ_GlobalReservedStatus_APPIA_nearlySecondsMSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nearlySecondsMSW in AQ_GlobalReservedStatus_APPIA */ -#define word_AQ_GlobalReservedStatus_APPIA_nearlySecondsMSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure xenpakNvrStatus in AQ_GlobalReservedStatus_APPIA */ -#define AQ_GlobalReservedStatus_APPIA_xenpakNvrStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure xenpakNvrStatus in AQ_GlobalReservedStatus_APPIA */ -#define bits_AQ_GlobalReservedStatus_APPIA_xenpakNvrStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure xenpakNvrStatus in AQ_GlobalReservedStatus_APPIA */ -#define word_AQ_GlobalReservedStatus_APPIA_xenpakNvrStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure romRevision in AQ_GlobalReservedStatus_APPIA */ -#define AQ_GlobalReservedStatus_APPIA_romRevision 0 -/*! \brief Preprocessor variable to relate field to bit position in structure romRevision in AQ_GlobalReservedStatus_APPIA */ -#define bits_AQ_GlobalReservedStatus_APPIA_romRevision u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure romRevision in AQ_GlobalReservedStatus_APPIA */ -#define word_AQ_GlobalReservedStatus_APPIA_romRevision u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nearlySecondsLSW in AQ_GlobalReservedStatus_APPIA */ -#define AQ_GlobalReservedStatus_APPIA_nearlySecondsLSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure nearlySecondsLSW in AQ_GlobalReservedStatus_APPIA */ -#define bits_AQ_GlobalReservedStatus_APPIA_nearlySecondsLSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure nearlySecondsLSW in AQ_GlobalReservedStatus_APPIA */ -#define word_AQ_GlobalReservedStatus_APPIA_nearlySecondsLSW u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_baseRegisterAddress 0xCC00 -/*! \brief MMD address of structure AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureFailure in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_highTemperatureFailure 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureFailure in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_highTemperatureFailure u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureFailure in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_highTemperatureFailure u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureFailure in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_lowTemperatureFailure 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureFailure in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_lowTemperatureFailure u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureFailure in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_lowTemperatureFailure u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureWarning in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_highTemperatureWarning 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureWarning in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_highTemperatureWarning u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureWarning in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_highTemperatureWarning u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureWarning in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_lowTemperatureWarning 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureWarning in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_lowTemperatureWarning u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureWarning in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_lowTemperatureWarning u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure resetCompleted in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_resetCompleted 0 -/*! \brief Preprocessor variable to relate field to bit position in structure resetCompleted in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_resetCompleted u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure resetCompleted in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_resetCompleted u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure deviceFault in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_deviceFault 0 -/*! \brief Preprocessor variable to relate field to bit position in structure deviceFault in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_deviceFault u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure deviceFault in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_deviceFault u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmA in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_reservedAlarmA 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmA in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_reservedAlarmA u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmA in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_reservedAlarmA u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmB in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_reservedAlarmB 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmB in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_reservedAlarmB u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmB in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_reservedAlarmB u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmC in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_reservedAlarmC 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmC in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_reservedAlarmC u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmC in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_reservedAlarmC u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmD in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_reservedAlarmD 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmD in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_reservedAlarmD u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmD in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_reservedAlarmD u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure smartPower_downEntered in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_smartPower_downEntered 1 -/*! \brief Preprocessor variable to relate field to bit position in structure smartPower_downEntered in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_smartPower_downEntered u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure smartPower_downEntered in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_smartPower_downEntered u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure xenpakAlarm in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_xenpakAlarm 1 -/*! \brief Preprocessor variable to relate field to bit position in structure xenpakAlarm in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_xenpakAlarm u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure xenpakAlarm in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_xenpakAlarm u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarms in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_reservedAlarms 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarms in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_reservedAlarms u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarms in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_reservedAlarms u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioCommandHandlingOverflow in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_mdioCommandHandlingOverflow 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioCommandHandlingOverflow in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_mdioCommandHandlingOverflow u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioCommandHandlingOverflow in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_mdioCommandHandlingOverflow u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure diagnosticAlarm in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_diagnosticAlarm 1 -/*! \brief Preprocessor variable to relate field to bit position in structure diagnosticAlarm in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_diagnosticAlarm u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure diagnosticAlarm in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_diagnosticAlarm u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrOperationComplete in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_nvrOperationComplete 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrOperationComplete in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_nvrOperationComplete u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrOperationComplete in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_nvrOperationComplete u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mailboxOperation_Complete in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_mailboxOperation_Complete 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mailboxOperation_Complete in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_mailboxOperation_Complete u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mailboxOperation_Complete in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_mailboxOperation_Complete u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upDramParityError in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_upDramParityError 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upDramParityError in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_upDramParityError u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upDramParityError in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_upDramParityError u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upIramParityError in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_upIramParityError 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upIramParityError in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_upIramParityError u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upIramParityError in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_upIramParityError u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure txEnableStateChange in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_txEnableStateChange 2 -/*! \brief Preprocessor variable to relate field to bit position in structure txEnableStateChange in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_txEnableStateChange u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure txEnableStateChange in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_txEnableStateChange u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioMMD_Error in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_mdioMMD_Error 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioMMD_Error in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_mdioMMD_Error u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mdioMMD_Error in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_mdioMMD_Error u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioTimeoutError in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_mdioTimeoutError 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioTimeoutError in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_mdioTimeoutError u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mdioTimeoutError in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_mdioTimeoutError u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure watchdogTimerAlarm in AQ_GlobalAlarms_APPIA */ -#define AQ_GlobalAlarms_APPIA_watchdogTimerAlarm 2 -/*! \brief Preprocessor variable to relate field to bit position in structure watchdogTimerAlarm in AQ_GlobalAlarms_APPIA */ -#define bits_AQ_GlobalAlarms_APPIA_watchdogTimerAlarm u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure watchdogTimerAlarm in AQ_GlobalAlarms_APPIA */ -#define word_AQ_GlobalAlarms_APPIA_watchdogTimerAlarm u2.word_2 - -/*! \brief Base register address of structure AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_baseRegisterAddress 0xD400 -/*! \brief MMD address of structure AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureFailureMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_highTemperatureFailureMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureFailureMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_highTemperatureFailureMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureFailureMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_highTemperatureFailureMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureFailureMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_lowTemperatureFailureMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureFailureMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_lowTemperatureFailureMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureFailureMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_lowTemperatureFailureMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureWarningMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_highTemperatureWarningMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureWarningMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_highTemperatureWarningMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureWarningMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_highTemperatureWarningMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureWarningMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_lowTemperatureWarningMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureWarningMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_lowTemperatureWarningMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureWarningMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_lowTemperatureWarningMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure resetCompletedMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_resetCompletedMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure resetCompletedMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_resetCompletedMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure resetCompletedMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_resetCompletedMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure deviceFaultMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_deviceFaultMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure deviceFaultMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_deviceFaultMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure deviceFaultMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_deviceFaultMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmAMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_reservedAlarmAMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmAMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_reservedAlarmAMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmAMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_reservedAlarmAMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmBMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_reservedAlarmBMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmBMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_reservedAlarmBMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmBMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_reservedAlarmBMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmCMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_reservedAlarmCMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmCMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_reservedAlarmCMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmCMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_reservedAlarmCMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmDMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_reservedAlarmDMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmDMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_reservedAlarmDMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmDMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_reservedAlarmDMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure smartPower_downEnteredMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_smartPower_downEnteredMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure smartPower_downEnteredMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_smartPower_downEnteredMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure smartPower_downEnteredMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_smartPower_downEnteredMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure xenpakAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_xenpakAlarmMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure xenpakAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_xenpakAlarmMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure xenpakAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_xenpakAlarmMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmsMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_reservedAlarmsMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmsMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_reservedAlarmsMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmsMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_reservedAlarmsMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioCommandHandlingOverflowMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_mdioCommandHandlingOverflowMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioCommandHandlingOverflowMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_mdioCommandHandlingOverflowMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioCommandHandlingOverflowMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_mdioCommandHandlingOverflowMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure diagnosticAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_diagnosticAlarmMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure diagnosticAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_diagnosticAlarmMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure diagnosticAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_diagnosticAlarmMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrOperationCompleteMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_nvrOperationCompleteMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrOperationCompleteMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_nvrOperationCompleteMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrOperationCompleteMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_nvrOperationCompleteMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mailboxOperationCompleteMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_mailboxOperationCompleteMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mailboxOperationCompleteMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_mailboxOperationCompleteMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mailboxOperationCompleteMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_mailboxOperationCompleteMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upDramParityErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_upDramParityErrorMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upDramParityErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_upDramParityErrorMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upDramParityErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_upDramParityErrorMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upIramParityErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_upIramParityErrorMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upIramParityErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_upIramParityErrorMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upIramParityErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_upIramParityErrorMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure txEnableStateChangeMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_txEnableStateChangeMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure txEnableStateChangeMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_txEnableStateChangeMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure txEnableStateChangeMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_txEnableStateChangeMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioMMD_ErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_mdioMMD_ErrorMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioMMD_ErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_mdioMMD_ErrorMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mdioMMD_ErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_mdioMMD_ErrorMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioTimeoutErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_mdioTimeoutErrorMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioTimeoutErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_mdioTimeoutErrorMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mdioTimeoutErrorMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_mdioTimeoutErrorMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure watchdogTimerAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define AQ_GlobalInterruptMask_APPIA_watchdogTimerAlarmMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure watchdogTimerAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define bits_AQ_GlobalInterruptMask_APPIA_watchdogTimerAlarmMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure watchdogTimerAlarmMask in AQ_GlobalInterruptMask_APPIA */ -#define word_AQ_GlobalInterruptMask_APPIA_watchdogTimerAlarmMask u2.word_2 - -/*! \brief Base register address of structure AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_baseRegisterAddress 0xFC00 -/*! \brief MMD address of structure AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pmaStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pmaStandardAlarm_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pmaStandardAlarm_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pmaStandardAlarm_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pmaStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pmaStandardAlarm_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pmaStandardAlarm_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pmaStandardAlarm_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_3Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_3Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_3Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_3Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_3Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_pcsStandardAlarm_3Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_StandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_phyXS_StandardAlarms_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_StandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_phyXS_StandardAlarms_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_StandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_phyXS_StandardAlarms_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_StandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_phyXS_StandardAlarms_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_StandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_phyXS_StandardAlarms_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_StandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_phyXS_StandardAlarms_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationStandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_autonegotiationStandardAlarms_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationStandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_autonegotiationStandardAlarms_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationStandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_autonegotiationStandardAlarms_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationStandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_autonegotiationStandardAlarms_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationStandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_autonegotiationStandardAlarms_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationStandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_autonegotiationStandardAlarms_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gbeStandardAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_gbeStandardAlarmsInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gbeStandardAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_gbeStandardAlarmsInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gbeStandardAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_gbeStandardAlarmsInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure allVendorAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideStandardInterruptFlags_APPIA_allVendorAlarmsInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure allVendorAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_allVendorAlarmsInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure allVendorAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_APPIA_allVendorAlarmsInterrupt u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_baseRegisterAddress 0xFC01 -/*! \brief MMD address of structure AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pmaVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_pmaVendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_pmaVendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_pmaVendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_pcsVendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_pcsVendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_pcsVendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_VendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_phyXS_VendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_VendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_phyXS_VendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_VendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_phyXS_VendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_autonegotiationVendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_autonegotiationVendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_autonegotiationVendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gbeVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_gbeVendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gbeVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_gbeVendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gbeVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_gbeVendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_1Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_1Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_1Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_2Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_2Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_2Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_3Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_3Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_3Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_3Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_3Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_APPIA */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_APPIA_globalAlarms_3Interrupt u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_baseRegisterAddress 0xFF00 -/*! \brief MMD address of structure AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pmaStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_pmaStandardAlarm_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pmaStandardAlarm_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pmaStandardAlarm_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pmaStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_pmaStandardAlarm_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pmaStandardAlarm_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pmaStandardAlarm_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_3InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_3InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_3InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_3InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_3InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_pcsStandardAlarm_3InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_StandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_phyXS_StandardAlarms_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_StandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_phyXS_StandardAlarms_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_StandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_phyXS_StandardAlarms_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_StandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_phyXS_StandardAlarms_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_StandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_phyXS_StandardAlarms_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_StandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_phyXS_StandardAlarms_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationStandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_autonegotiationStandardAlarms_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationStandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_autonegotiationStandardAlarms_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationStandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_autonegotiationStandardAlarms_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationStandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_autonegotiationStandardAlarms_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationStandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_autonegotiationStandardAlarms_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationStandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_autonegotiationStandardAlarms_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gbeStandardAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_gbeStandardAlarmsInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gbeStandardAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_gbeStandardAlarmsInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gbeStandardAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_gbeStandardAlarmsInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure allVendorAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define AQ_GlobalInterruptChip_wideStandardMask_APPIA_allVendorAlarmsInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure allVendorAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_APPIA_allVendorAlarmsInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure allVendorAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_APPIA_allVendorAlarmsInterruptMask u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_baseRegisterAddress 0xFF01 -/*! \brief MMD address of structure AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pmaVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_pmaVendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_APPIA_pmaVendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_APPIA_pmaVendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_pcsVendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_APPIA_pcsVendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_APPIA_pcsVendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_VendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_phyXS_VendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_VendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_APPIA_phyXS_VendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_VendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_APPIA_phyXS_VendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_autonegotiationVendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_APPIA_autonegotiationVendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_APPIA_autonegotiationVendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gbeVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_gbeVendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gbeVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_APPIA_gbeVendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gbeVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_APPIA_gbeVendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_3InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_3InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_3InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_3InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_3InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_APPIA */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_APPIA_globalAlarms_3InterruptMask u0.word_0 -#endif -/*@}*/ -/*@}*/ diff --git a/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers_reversed.h b/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers_reversed.h deleted file mode 100755 index 89e02c325..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/registerMap/APPIA/AQ_APPIA_Global_registers_reversed.h +++ /dev/null @@ -1,5581 +0,0 @@ -/*! \file -* This file contains the data structures and doxygen comments -* for the Global Registers block. - */ - -/*! \addtogroup registerMap - @{ -*/ - -/*! \defgroup Global_registers Global Registers -* This module contains the data structures and doxygen comments -* for the Global Registers block. - */ -/*********************************************************************** -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* $Date: 2014/04/08 $ -* -* $Label: $ -* -* Description: -* -* This file contains the c header structures for the registers contained in the Global Registers block. -* -* The bit fields in this structure are from MSbit to LSbit -* -***********************************************************************/ - - -/*@{*/ -#ifndef AQ_APPIA_GLOBAL_REGS_HEADER -#define AQ_APPIA_GLOBAL_REGS_HEADER - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Control 1: 1E.0000 */ -/* Global Standard Control 1: 1E.0000 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Control 1 */ - union - { - struct - { - /*! \brief 1E.0000.F R/WSC Soft Reset - AQ_GlobalStandardControl_1_APPIA.u0.bits_0.softReset - - Default = 0x1 - - 1 = Global soft reset - 0 = Normal operation - - - Notes: - Setting this bit initiates a global soft reset on all of the digital logic, including the microprocessor. Upon completion of the reset sequence, this bit is set back to 0. */ - unsigned int softReset : 1; /* 1E.0000.F R/WSC Default = 0x1 */ - /* 1 = Global soft reset - 0 = Normal operation - */ - /*! \brief 1E.0000.E R/WSC Hard Reset - AQ_GlobalStandardControl_1_APPIA.u0.bits_0.hardReset - - Default = 0x0 - - 1 = Global hard reset - 0 = Normal operation - - - Notes: - Setting this bit initiates a global hard reset, equivalent to pulling the reset pin low. This is a level sensitive pin that connects into the power-on reset generation circuitry to initiate a complete power-on reset. */ - unsigned int hardReset : 1; /* 1E.0000.E R/WSC Default = 0x0 */ - /* 1 = Global hard reset - 0 = Normal operation - */ - unsigned int reserved0 : 2; - /*! \brief 1E.0000.B R/WPD Low Power - AQ_GlobalStandardControl_1_APPIA.u0.bits_0.lowPower - - Provisionable Default = 0x0 - - 1 = Low-power mode - 0 = Normal operation - - - Notes: - A one written to this register causes the chip to enter low-power mode. This bit puts the entire chip in low-power mode, with only the MDIO and microprocessor functioning, and turns off the analog front-end: i.e. places it in high-impedance mode. Setting this bit also sets all of the Low Power bits in the other MMDs. */ - unsigned int lowPower : 1; /* 1E.0000.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Low-power mode - 0 = Normal operation - */ - unsigned int reserved1 : 11; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardControl_1_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Device Identifier: 1E.0002 */ -/* Global Standard Device Identifier: 1E.0002 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Device Identifier */ - union - { - struct - { - /*! \brief 1E.0002.F:0 RO Device ID MSW [1F:10] - AQ_GlobalStandardDeviceIdentifier_APPIA.u0.bits_0.deviceIdMSW - - - - Bits 31 - 16 of Device ID - */ - unsigned int deviceIdMSW : 16; /* 1E.0002.F:0 RO */ - /* Bits 31 - 16 of Device ID */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Standard Device Identifier */ - union - { - struct - { - /*! \brief 1E.0003.F:0 RO Device ID LSW [F:0] - AQ_GlobalStandardDeviceIdentifier_APPIA.u1.bits_1.deviceIdLSW - - - - Bits 15 - 0 of Device ID - */ - unsigned int deviceIdLSW : 16; /* 1E.0003.F:0 RO */ - /* Bits 15 - 0 of Device ID */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalStandardDeviceIdentifier_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Devices in Package: 1E.0005 */ -/* Global Standard Devices in Package: 1E.0005 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Devices in Package */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.0005.7 ROS Autonegotiation Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.autonegotiationPresent - - Default = 0x1 - - 1 = Autonegotiation is present in package - 0 = Autonegotiation is not present in package - - Notes: - This is always set to 1, as there is Autonegotiation in the PHY. */ - unsigned int autonegotiationPresent : 1; /* 1E.0005.7 ROS Default = 0x1 */ - /* 1 = Autonegotiation is present in package - 0 = Autonegotiation is not present in package */ - /*! \brief 1E.0005.6 ROS TC Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.tcPresent - - Default = 0x0 - - 1 = TC is present in package - 0 = TC is not present in package - - Notes: - This is always set to 0, as there is no TC functionality in the PHY. */ - unsigned int tcPresent : 1; /* 1E.0005.6 ROS Default = 0x0 */ - /* 1 = TC is present in package - 0 = TC is not present in package */ - /*! \brief 1E.0005.5 ROS DTE XS Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.dteXsPresent - - Default = 0x0 - - 1 = DTE XS is present in package - 0 = DTE XS is not present in package - - - Notes: - This is always set to 0, as there is no DTE XAUI interface in the PHY. */ - unsigned int dteXsPresent : 1; /* 1E.0005.5 ROS Default = 0x0 */ - /* 1 = DTE XS is present in package - 0 = DTE XS is not present in package - */ - /*! \brief 1E.0005.4 ROS PHY XS Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.phyXS_Present - - Default = 0x1 - - 1 = PHY XS is present in package - 0 = PHY XS is not present in package - - Notes: - This is always set to 1 as there is a PHY XS interface in the PHY. */ - unsigned int phyXS_Present : 1; /* 1E.0005.4 ROS Default = 0x1 */ - /* 1 = PHY XS is present in package - 0 = PHY XS is not present in package */ - /*! \brief 1E.0005.3 ROS PCS Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.pcsPresent - - Default = 0x1 - - 1 = PCS is present in package - 0 = PCS is not present in package - - Notes: - This is always set to 1 as there is PCS functionality in the PHY. */ - unsigned int pcsPresent : 1; /* 1E.0005.3 ROS Default = 0x1 */ - /* 1 = PCS is present in package - 0 = PCS is not present in package */ - /*! \brief 1E.0005.2 ROS WIS Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.wisPresent - - Default = 0x0 - - 1 = WIS is present in package - 0 = WIS is not present in package - - Notes: - This is always set to 0, as there is no WIS functionality in the PHY. */ - unsigned int wisPresent : 1; /* 1E.0005.2 ROS Default = 0x0 */ - /* 1 = WIS is present in package - 0 = WIS is not present in package */ - /*! \brief 1E.0005.1 ROS PMA Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.pmaPresent - - Default = 0x1 - - 1 = PMA is present in package - 0 = PMA is not present - - Notes: - This is always set to 1 as there is PMA functionality in the PHY. */ - unsigned int pmaPresent : 1; /* 1E.0005.1 ROS Default = 0x1 */ - /* 1 = PMA is present in package - 0 = PMA is not present */ - /*! \brief 1E.0005.0 ROS Clause 22 Registers Present - AQ_GlobalStandardDevicesInPackage_APPIA.u0.bits_0.clause_22RegistersPresent - - Default = 0x0 - - 1 = Clause 22 registers are present in package - 0 = Clause 22 registers are not present in package - - Notes: - This is always set to 0 in the PHY, as there are no Clause 22 registers in the device. */ - unsigned int clause_22RegistersPresent : 1; /* 1E.0005.0 ROS Default = 0x0 */ - /* 1 = Clause 22 registers are present in package - 0 = Clause 22 registers are not present in package */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardDevicesInPackage_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Vendor Devices in Package: 1E.0006 */ -/* Global Standard Vendor Devices in Package: 1E.0006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Vendor Devices in Package */ - union - { - struct - { - /*! \brief 1E.0006.F ROS Vendor Specific Device #2 Present - AQ_GlobalStandardVendorDevicesInPackage_APPIA.u0.bits_0.vendorSpecificDevice_2Present - - Default = 0x1 - - 1 = Device #2 is present in package - 0 = Device #2 is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the DSP PMA registers. */ - unsigned int vendorSpecificDevice_2Present : 1; /* 1E.0006.F ROS Default = 0x1 */ - /* 1 = Device #2 is present in package - 0 = Device #2 is not present in package */ - /*! \brief 1E.0006.E ROS Vendor Specific Device #1 Present - AQ_GlobalStandardVendorDevicesInPackage_APPIA.u0.bits_0.vendorSpecificDevice_1Present - - Default = 0x1 - - 1 = Device #1 is present in package - 0 = Device #1 is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the global control registers. */ - unsigned int vendorSpecificDevice_1Present : 1; /* 1E.0006.E ROS Default = 0x1 */ - /* 1 = Device #1 is present in package - 0 = Device #1 is not present in package */ - /*! \brief 1E.0006.D ROS Clause 22 Extension Present - AQ_GlobalStandardVendorDevicesInPackage_APPIA.u0.bits_0.clause_22ExtensionPresent - - Default = 0x1 - - 1 = Clause 22 Extension is present in package - 0 = Clause 22 Extension is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the GbE registers. */ - unsigned int clause_22ExtensionPresent : 1; /* 1E.0006.D ROS Default = 0x1 */ - /* 1 = Clause 22 Extension is present in package - 0 = Clause 22 Extension is not present in package */ - unsigned int reserved0 : 13; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardVendorDevicesInPackage_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Status 2: 1E.0008 */ -/* Global Standard Status 2: 1E.0008 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Status 2 */ - union - { - struct - { - /*! \brief 1E.0008.F:E ROS Device Present [1:0] - AQ_GlobalStandardStatus_2_APPIA.u0.bits_0.devicePresent - - Default = 0x2 - - [F:E] - 0x3 = No device at this address - 0x2 = Device present at this address - 0x1 = No device at this address - 0x0 = No device at this address - - Notes: - This field is always set to 0x2, as the Global MMD resides here in the PHY. */ - unsigned int devicePresent : 2; /* 1E.0008.F:E ROS Default = 0x2 */ - /* [F:E] - 0x3 = No device at this address - 0x2 = Device present at this address - 0x1 = No device at this address - 0x0 = No device at this address */ - unsigned int reserved0 : 14; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardStatus_2_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Package Identifier: 1E.000E */ -/* Global Standard Package Identifier: 1E.000E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Package Identifier */ - union - { - struct - { - /*! \brief 1E.000E.F:0 RO Package ID MSW [1F:10] - AQ_GlobalStandardPackageIdentifier_APPIA.u0.bits_0.packageIdMSW - - - - Bits 31- 16 of Package ID - */ - unsigned int packageIdMSW : 16; /* 1E.000E.F:0 RO */ - /* Bits 31- 16 of Package ID */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Standard Package Identifier */ - union - { - struct - { - /*! \brief 1E.000F.F:0 RO Package ID LSW [F:0] - AQ_GlobalStandardPackageIdentifier_APPIA.u1.bits_1.packageIdLSW - - - - Bits 15 - 0 of Package ID - */ - unsigned int packageIdLSW : 16; /* 1E.000F.F:0 RO */ - /* Bits 15 - 0 of Package ID */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalStandardPackageIdentifier_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Firmware ID: 1E.0020 */ -/* Global Firmware ID: 1E.0020 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Firmware ID */ - union - { - struct - { - /*! \brief 1E.0020.F:8 RO Firmware Major Revision Number [7:0] - AQ_GlobalFirmwareID_APPIA.u0.bits_0.firmwareMajorRevisionNumber - - - - [F:8] = Major revision number - - Notes: - - - The lower six bits of major and minor firmware revision are exchanged in autonegotiation when the PHYID message is sent. */ - unsigned int firmwareMajorRevisionNumber : 8; /* 1E.0020.F:8 RO */ - /* [F:8] = Major revision number */ - /*! \brief 1E.0020.7:0 RO Firmware Minor Revision Number [7:0] - AQ_GlobalFirmwareID_APPIA.u0.bits_0.firmwareMinorRevisionNumber - - - - [7:0] = Minor revision number - - Notes: - - - The lower six bits of major and minor firmware revision are exchanged in autonegotiation when the PHYID message is sent. */ - unsigned int firmwareMinorRevisionNumber : 8; /* 1E.0020.7:0 RO */ - /* [7:0] = Minor revision number */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalFirmwareID_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip Identification: 1E.0021 */ -/* Global Chip Identification: 1E.0021 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip Identification */ - union - { - struct - { - /*! \brief 1E.0021.F:0 RO Chip Identification [F:0] - AQ_GlobalChipIdentification_APPIA.u0.bits_0.chipIdentification - - - - Hardware Chip ID - - Notes: - This value is a hard-coded chip ID */ - unsigned int chipIdentification : 16; /* 1E.0021.F:0 RO */ - /* Hardware Chip ID */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChipIdentification_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip Revision: 1E.0022 */ -/* Global Chip Revision: 1E.0022 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip Revision */ - union - { - struct - { - /*! \brief 1E.0022.F:0 RO Chip Revision [F:0] - AQ_GlobalChipRevision_APPIA.u0.bits_0.chipRevision - - - - Hardware Chip Revision - - Notes: - This value is a hard-coded chip revision */ - unsigned int chipRevision : 16; /* 1E.0022.F:0 RO */ - /* Hardware Chip Revision */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChipRevision_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global NVR Interface: 1E.0100 */ -/* Global NVR Interface: 1E.0100 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0100.F R/WSC NVR Execute Operation - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrExecuteOperation - - Default = 0x0 - - 1 = Start NVR Operation - - - Notes: - When set to 1, the NVR operation will begin. Ensure that the uP is stalled using the See MCP Run Stall bit to ensure no NVR contention. */ - unsigned int nvrExecuteOperation : 1; /* 1E.0100.F R/WSC Default = 0x0 */ - /* 1 = Start NVR Operation - */ - /*! \brief 1E.0100.E R/W NVR Write Mode - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrWriteMode - - Default = 0x0 - - 1 = Write to NVR - 0 = Read from NVR - - */ - unsigned int nvrWriteMode : 1; /* 1E.0100.E R/W Default = 0x0 */ - /* 1 = Write to NVR - 0 = Read from NVR - */ - /*! \brief 1E.0100.D R/W Freeze NVR CRC - AQ_GlobalNvrInterface_APPIA.u0.bits_0.freezeNvrCrc - - Default = 0x0 - - 1 = Freeze NVR Mailbox CRC calculation register - - - Notes: - To prevent an erroneous answer, this bit should not be set at the same time the See NVR Operation Valid bit is set. */ - unsigned int freezeNvrCrc : 1; /* 1E.0100.D R/W Default = 0x0 */ - /* 1 = Freeze NVR Mailbox CRC calculation register - */ - /*! \brief 1E.0100.C R/WSC Reset NVR CRC - AQ_GlobalNvrInterface_APPIA.u0.bits_0.resetNvrCrc - - Default = 0x0 - - 1 = Reset NVR Mailbox CRC calculation register - - - Notes: - To prevent an erroneous answer, this bit should not be set at the same time the See NVR Operation Valid bit is set. */ - unsigned int resetNvrCrc : 1; /* 1E.0100.C R/WSC Default = 0x0 */ - /* 1 = Reset NVR Mailbox CRC calculation register - */ - unsigned int reserved0 : 1; - /*! \brief 1E.0100.A R/W NVR Burst - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrBurst - - Default = 0x0 - - 0 = Single read or write operation of up to 4 bytes - 1 = Burst operation - - - Notes: - When this bit is set, the operation is a burst operation where more than 32-bits is read from the NVR or written to the NVR. This bit should be set to one until the last burst in the read or write operation, when it should be set to zero. It operates by gating the SPI clock, and not restarting it until new data is ready to be written, or the previous contents have been read. Each burst of data requires the NVR Execute Operation bit to be set to initiate the next phase. */ - unsigned int nvrBurst : 1; /* 1E.0100.A R/W Default = 0x0 */ - /* 0 = Single read or write operation of up to 4 bytes - 1 = Burst operation - */ - unsigned int reserved1 : 1; - /*! \brief 1E.0100.8 RO NVR Busy - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrBusy - - - - 1 = NVR is busy - 0 = NVR is ready - - - Notes: - When set to 1, the NVR is busy. A new NVR operation should not occur until this bit is 0. If the NVR clock is greater than 64/63 of the MDIO clock, this bit never needs to be polled when operating over the MDIO. */ - unsigned int nvrBusy : 1; /* 1E.0100.8 RO */ - /* 1 = NVR is busy - 0 = NVR is ready - */ - /*! \brief 1E.0100.7:0 R/W NVR Opcode [7:0] - AQ_GlobalNvrInterface_APPIA.u0.bits_0.nvrOpcode - - Default = 0x03 - - NVR instruction opcode - - */ - unsigned int nvrOpcode : 8; /* 1E.0100.7:0 R/W Default = 0x03 */ - /* NVR instruction opcode - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0101.F:0 RO NVR Mailbox CRC [F:0] - AQ_GlobalNvrInterface_APPIA.u1.bits_1.nvrMailboxCrc - - - - The running CRC-16 of everything passing through the NVR interface - - - Notes: - The CRC-16 over all data written or read through the NVR interface. The CRC-16 is calculated by dividing the data by: - x^16 + x^12 + x^5 + 1 */ - unsigned int nvrMailboxCrc : 16; /* 1E.0101.F:0 RO */ - /* The running CRC-16 of everything passing through the NVR interface - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global NVR Interface */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.0102.7:0 R/W NVR Address MSW [17:10] - AQ_GlobalNvrInterface_APPIA.u2.bits_2.nvrAddressMSW - - Default = 0x00 - - NVR address MSW bits [17:10] - - - Notes: - The address of where to read and write from in the NVR. This is self-incrementing and will automatically increment after each read or write operation. The increment amount is based on the data length (i.e. increments by 4 if the data length is 4 bytes) */ - unsigned int nvrAddressMSW : 8; /* 1E.0102.7:0 R/W Default = 0x00 */ - /* NVR address MSW bits [17:10] - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0103.F:0 R/W NVR Address LSW [F:0] - AQ_GlobalNvrInterface_APPIA.u3.bits_3.nvrAddressLSW - - Default = 0x0000 - - NVR address LSW bits [F:0] - - - Notes: - The address of where to read and write from in the NVR. This is self-incrementing and will automatically increment after each read or write operation. */ - unsigned int nvrAddressLSW : 16; /* 1E.0103.F:0 R/W Default = 0x0000 */ - /* NVR address LSW bits [F:0] - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0104.F:0 R/W NVR Data MSW [1F:10] - AQ_GlobalNvrInterface_APPIA.u4.bits_4.nvrDataMSW - - Default = 0x0000 - - NVR data MSW bits [1F:10] - - - Notes: - Data is stored and read-out from these registers in little-endian format for operations such as FLASH device ID, and for programming the processor. - - For instance the 64K Atmel device code reads out as two bytes 0x651F into the LSW register, whereas the datasheet indicates that 1F is the first byte read, followed by 65 as the second byte. - - To burst read and write these 4 bytes in the correct order (where DD is written to address x), they should be stored as: - - AA BB in the MSW - CC DD in the LSW. */ - unsigned int nvrDataMSW : 16; /* 1E.0104.F:0 R/W Default = 0x0000 */ - /* NVR data MSW bits [1F:10] - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0105.F:0 R/W NVR Data LSW [F:0] - AQ_GlobalNvrInterface_APPIA.u5.bits_5.nvrDataLSW - - Default = 0x0000 - - NVR data LSW bits [F:0] - - - Notes: - Data is stored and read-out from these registers in little-endian format for operations such as FLASH device ID, and for programming the processor. - - For instance the 64K Atmel device code reads out as two bytes 0x651F into the LSW register, whereas the datasheet indicates that 1F is the first byte read, followed by 65 as the second byte. - To burst read and write these 4 bytes in the correct order (where DD is written to address x), they should be stored as: - - AA BB in the MSW - CC DD in the LSW. */ - unsigned int nvrDataLSW : 16; /* 1E.0105.F:0 R/W Default = 0x0000 */ - /* NVR data LSW bits [F:0] - */ - } bits_5; - uint16_t word_5; - } u5; -} AQ_GlobalNvrInterface_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Mailbox Interface: 1E.0200 */ -/* Global Mailbox Interface: 1E.0200 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0200.F R/WSC uP Mailbox Execute Operation - AQ_GlobalMailboxInterface_APPIA.u0.bits_0.upMailboxExecuteOperation - - Default = 0x0 - - 1 = Start of mailbox Operation - - - Notes: - Indicates mailbox is loaded and ready */ - unsigned int upMailboxExecuteOperation : 1; /* 1E.0200.F R/WSC Default = 0x0 */ - /* 1 = Start of mailbox Operation - */ - /*! \brief 1E.0200.E R/W uP Mailbox Write Mode - AQ_GlobalMailboxInterface_APPIA.u0.bits_0.upMailboxWriteMode - - Default = 0x0 - - 1 = Write - 0 = Read - - - Notes: - Mailbox direction */ - unsigned int upMailboxWriteMode : 1; /* 1E.0200.E R/W Default = 0x0 */ - /* 1 = Write - 0 = Read - */ - unsigned int reserved0 : 1; - /*! \brief 1E.0200.C R/WSC Reset uP Mailbox CRC - AQ_GlobalMailboxInterface_APPIA.u0.bits_0.resetUpMailboxCrc - - Default = 0x0 - - 1 = Reset uP mailbox CRC calculation register - - */ - unsigned int resetUpMailboxCrc : 1; /* 1E.0200.C R/WSC Default = 0x0 */ - /* 1 = Reset uP mailbox CRC calculation register - */ - unsigned int reserved1 : 3; - /*! \brief 1E.0200.8 RO uP Mailbox Busy - AQ_GlobalMailboxInterface_APPIA.u0.bits_0.upMailboxBusy - - - - 1 = uP mailbox busy - 0 = uP mailbox ready - - - Notes: - In general the uP will respond within a few processor cycles to any PIF slave request, much faster than the MDIO. If the busy is asserted over multiple MDIO polling cycles, then a H/W error may have occured and a Global S/W reset or uP reset is required. */ - unsigned int upMailboxBusy : 1; /* 1E.0200.8 RO */ - /* 1 = uP mailbox busy - 0 = uP mailbox ready - */ - unsigned int reserved2 : 8; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0201.F:0 RO uP Mailbox CRC [F:0] - AQ_GlobalMailboxInterface_APPIA.u1.bits_1.upMailboxCrc - - - - The running CRC-16 of everything passing through the mailbox interface - - */ - unsigned int upMailboxCrc : 16; /* 1E.0201.F:0 RO */ - /* The running CRC-16 of everything passing through the mailbox interface - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0202.F:0 R/W uP Mailbox Address MSW [1F:10] - AQ_GlobalMailboxInterface_APPIA.u2.bits_2.upMailboxAddressMSW - - Default = 0x0000 - - uP Mailbox MSW address - - - Notes: - The address of where to read and write from in the Microcontroller Mailbox. This is self-incrementing and automatically increments after each read and write operation.PHY */ - unsigned int upMailboxAddressMSW : 16; /* 1E.0202.F:0 R/W Default = 0x0000 */ - /* uP Mailbox MSW address - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0203.F:2 R/W uP Mailbox Address LSW [F:2] - AQ_GlobalMailboxInterface_APPIA.u3.bits_3.upMailboxAddressLSW - - Default = 0x0000 - - uP LSW Mailbox address [F:2] - - - Notes: - The address of where to read and write from in the Microcontroller Mailbox. This is self-incrementing and automatically increments after each read and write operation.PHY */ - unsigned int upMailboxAddressLSW : 14; /* 1E.0203.F:2 R/W Default = 0x0000 */ - /* uP LSW Mailbox address [F:2] - */ - /*! \brief 1E.0203.1:0 RO uP Mailbox Address LSW Don't Care [1:0] - AQ_GlobalMailboxInterface_APPIA.u3.bits_3.upMailboxAddressLSW_Don_tCare - - - - Least significant uP LSW Mailbox address bits [1:0] - - - Notes: - These bits are always set to 0 since each memory access is on a 4-byte boundary. */ - unsigned int upMailboxAddressLSW_Don_tCare : 2; /* 1E.0203.1:0 RO */ - /* Least significant uP LSW Mailbox address bits [1:0] - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0204.F:0 R/W uP Mailbox Data MSW [1F:10] - AQ_GlobalMailboxInterface_APPIA.u4.bits_4.upMailboxDataMSW - - Default = 0x0000 - - uP Mailbox data MSW - - */ - unsigned int upMailboxDataMSW : 16; /* 1E.0204.F:0 R/W Default = 0x0000 */ - /* uP Mailbox data MSW - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0205.F:0 R/W uP Mailbox Data LSW [F:0] - AQ_GlobalMailboxInterface_APPIA.u5.bits_5.upMailboxDataLSW - - Default = 0x0000 - - uP Mailbox data LSW - - */ - unsigned int upMailboxDataLSW : 16; /* 1E.0205.F:0 R/W Default = 0x0000 */ - /* uP Mailbox data LSW - */ - } bits_5; - uint16_t word_5; - } u5; -} AQ_GlobalMailboxInterface_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Microprocessor Scratch Pad: 1E.0300 */ -/* Global Microprocessor Scratch Pad: 1E.0300 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Microprocessor Scratch Pad */ - union - { - struct - { - /*! \brief 1E.0300.F:0 R/W Scratch Pad 1[F:0] - AQ_GlobalMicroprocessorScratchPad_APPIA.u0.bits_0.scratchPad_1 - - Default = 0x0000 - - General Purpose Scratch Pad1 - */ - unsigned int scratchPad_1 : 16; /* 1E.0300.F:0 R/W Default = 0x0000 */ - /* General Purpose Scratch Pad1 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Microprocessor Scratch Pad */ - union - { - struct - { - /*! \brief 1E.0301.F:0 R/W Scratch Pad 2 [F:0] - AQ_GlobalMicroprocessorScratchPad_APPIA.u1.bits_1.scratchPad_2 - - Default = 0x0000 - - General Purpose Scratch P - */ - unsigned int scratchPad_2 : 16; /* 1E.0301.F:0 R/W Default = 0x0000 */ - /* General Purpose Scratch P */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalMicroprocessorScratchPad_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Control: 1E.C000 */ -/* Global Control: 1E.C000 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Control */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Control */ - union - { - struct - { - /*! \brief 1E.C001.F R/W uP Reset - AQ_GlobalControl_APPIA.u1.bits_1.upReset - - Default = 0x0 - - 1 = Reset - - - Notes: - Resets the uP and the PIF master and slave bus. Will be active for a minimum of 100 microseconds. */ - unsigned int upReset : 1; /* 1E.C001.F R/W Default = 0x0 */ - /* 1 = Reset - */ - unsigned int reserved0 : 8; - /*! \brief 1E.C001.6 R/W uP Run Stall Override - AQ_GlobalControl_APPIA.u1.bits_1.upRunStallOverride - - Default = 0x0 - - 0 = uP Run Stall from "MDIO Boot Load" pin. - 1 = uP Run Stall from See MCP Run Stall bit - - - Notes: - This bit selects the uP Run Stall from either the "MDIO Boot Load" pin or the See MCP Run Stall bit. */ - unsigned int upRunStallOverride : 1; /* 1E.C001.6 R/W Default = 0x0 */ - /* 0 = uP Run Stall from "MDIO Boot Load" pin. - 1 = uP Run Stall from See MCP Run Stall bit - */ - unsigned int reserved1 : 5; - /*! \brief 1E.C001.0 R/W uP Run Stall - AQ_GlobalControl_APPIA.u1.bits_1.upRunStall - - Default = 0x0 - - 1 = uP Run Stall - 0 = uP normal mode - - - Notes: - Deactivates the uP. The PIF slave bus for inbound requests will still be active. This bit is muliplexed with the "MDIO Boot Load" pin with the See uP Run Stall Override bit as the select. When the "MDIO Boot Load" pin is asserted, the uP will be in Run Stall mode after reset. */ - unsigned int upRunStall : 1; /* 1E.C001.0 R/W Default = 0x0 */ - /* 1 = uP Run Stall - 0 = uP normal mode - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalControl_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reset Control: 1E.C006 */ -/* Global Reset Control: 1E.C006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reset Control */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C006.E R/WPD Global MMD Reset Disable - AQ_GlobalResetControl_APPIA.u0.bits_0.globalMMD_ResetDisable - - Provisionable Default = 0x0 - - 1 = Disable the S/W reset to the Global MMD registers - 0 = Enable the S/W reset to the Global MMD registers - - - Notes: - Setting this bit prevents a Global S/W reset or Global S/W reset from resetting the Global MMD registers */ - unsigned int globalMMD_ResetDisable : 1; /* 1E.C006.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Disable the S/W reset to the Global MMD registers - 0 = Enable the S/W reset to the Global MMD registers - */ - unsigned int reserved1 : 14; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalResetControl_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Diagnostic Provisioning: 1E.C400 */ -/* Global Diagnostic Provisioning: 1E.C400 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Diagnostic Provisioning */ - union - { - struct - { - /*! \brief 1E.C400.F R/WPD Enable Diagnostics - AQ_GlobalDiagnosticProvisioning_APPIA.u0.bits_0.enableDiagnostics - - Provisionable Default = 0x1 - - 1 = Chip performs diagnostics on power-up - */ - unsigned int enableDiagnostics : 1; /* 1E.C400.F R/WPD Provisionable Default = 0x1 */ - /* 1 = Chip performs diagnostics on power-up */ - unsigned int reserved0 : 15; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalDiagnosticProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Thermal Provisioning: 1E.C420 */ -/* Global Thermal Provisioning: 1E.C420 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C420.F:0 R/WPD Reserved 0 [F:0] - AQ_GlobalThermalProvisioning_APPIA.u0.bits_0.reserved_0 - - Provisionable Default = 0x0000 - - Internal reserved - do not modify - - */ - unsigned int reserved_0 : 16; /* 1E.C420.F:0 R/WPD Provisionable Default = 0x0000 */ - /* Internal reserved - do not modify - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C421.F:0 R/WPD High Temp Failure Threshold [F:0] - AQ_GlobalThermalProvisioning_APPIA.u1.bits_1.highTempFailureThreshold - - Provisionable Default = 0x4600 - - [F:0] of high temperature failure threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 70 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A000 - 1.A001: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. - High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int highTempFailureThreshold : 16; /* 1E.C421.F:0 R/WPD Provisionable Default = 0x4600 */ - /* [F:0] of high temperature failure threshold */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C422.F:0 R/WPD Low Temp Failure Threshold [F:0] - AQ_GlobalThermalProvisioning_APPIA.u2.bits_2.lowTempFailureThreshold - - Provisionable Default = 0x0000 - - [F:0] of low temperature failure threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 0 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A002 - 1.A003: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. - High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int lowTempFailureThreshold : 16; /* 1E.C422.F:0 R/WPD Provisionable Default = 0x0000 */ - /* [F:0] of low temperature failure threshold */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C423.F:0 R/WPD High Temp Warning Threshold [F:0] - AQ_GlobalThermalProvisioning_APPIA.u3.bits_3.highTempWarningThreshold - - Provisionable Default = 0x3C00 - - [F:0] of high temperature warning threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD008. Default is 60 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A004 - 1.A005: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. - High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int highTempWarningThreshold : 16; /* 1E.C423.F:0 R/WPD Provisionable Default = 0x3C00 */ - /* [F:0] of high temperature warning threshold */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C424.F:0 R/WPD Low Temp Warning Threshold [F:0] - AQ_GlobalThermalProvisioning_APPIA.u4.bits_4.lowTempWarningThreshold - - Provisionable Default = 0x0A00 - - [F:0] of low temperature warning threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 10 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A006 - 1.A007: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. - High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int lowTempWarningThreshold : 16; /* 1E.C424.F:0 R/WPD Provisionable Default = 0x0A00 */ - /* [F:0] of low temperature warning threshold */ - } bits_4; - uint16_t word_4; - } u4; -} AQ_GlobalThermalProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global LED Provisioning: 1E.C430 */ -/* Global LED Provisioning: 1E.C430 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C430.8 R/WPD LED #0 Manual Set - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_0ManualSet : 1; /* 1E.C430.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C430.7 R/WPD LED #0 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_0_10Gb_sLinkEstablished : 1; /* 1E.C430.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C430.6 R/WPD LED #0 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_0_1Gb_sLinkEstablished : 1; /* 1E.C430.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C430.5 R/WPD LED #0 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_0_100Mb_sLinkEstablished : 1; /* 1E.C430.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C430.4 R/WPD LED #0 Connecting - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_0Connecting : 1; /* 1E.C430.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C430.3 R/WPD LED #0 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_0ReceiveActivity : 1; /* 1E.C430.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C430.2 R/WPD LED #0 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_0TransmitActivity : 1; /* 1E.C430.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C430.1:0 R/WPD LED #0 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u0.bits_0.led_0ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_0ActivityStretch : 2; /* 1E.C430.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C431.8 R/WPD LED #1 Manual Set - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_1ManualSet : 1; /* 1E.C431.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C431.7 R/WPD LED #1 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_1_10Gb_sLinkEstablished : 1; /* 1E.C431.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C431.6 R/WPD LED #1 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_1_1Gb_sLinkEstablished : 1; /* 1E.C431.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C431.5 R/WPD LED #1 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_1_100Mb_sLinkEstablished : 1; /* 1E.C431.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C431.4 R/WPD LED #1 Connecting - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_1Connecting : 1; /* 1E.C431.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C431.3 R/WPD LED #1 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_1ReceiveActivity : 1; /* 1E.C431.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C431.2 R/WPD LED #1 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_1TransmitActivity : 1; /* 1E.C431.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C431.1:0 R/WPD LED #1 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u1.bits_1.led_1ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_1ActivityStretch : 2; /* 1E.C431.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C432.8 R/WPD LED #2 Manual Set - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_2ManualSet : 1; /* 1E.C432.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C432.7 R/WPD LED #2 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_2_10Gb_sLinkEstablished : 1; /* 1E.C432.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C432.6 R/WPD LED #2 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_2_1Gb_sLinkEstablished : 1; /* 1E.C432.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C432.5 R/WPD LED #2 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_2_100Mb_sLinkEstablished : 1; /* 1E.C432.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C432.4 R/WPD LED #2 Connecting - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_2Connecting : 1; /* 1E.C432.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C432.3 R/WPD LED #2 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_2ReceiveActivity : 1; /* 1E.C432.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C432.2 R/WPD LED #2 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_2TransmitActivity : 1; /* 1E.C432.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C432.1:0 R/WPD LED #2 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u2.bits_2.led_2ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_2ActivityStretch : 2; /* 1E.C432.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C433.8 R/WPD LED #3 Manual Set - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_3ManualSet : 1; /* 1E.C433.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C433.7 R/WPD LED #3 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_3_10Gb_sLinkEstablished : 1; /* 1E.C433.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C433.6 R/WPD LED #3 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_3_1Gb_sLinkEstablished : 1; /* 1E.C433.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C433.5 R/WPD LED #3 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_3_100Mb_sLinkEstablished : 1; /* 1E.C433.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C433.4 R/WPD LED #3 Connecting - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_3Connecting : 1; /* 1E.C433.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C433.3 R/WPD LED #3 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_3ReceiveActivity : 1; /* 1E.C433.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C433.2 R/WPD LED #3 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_3TransmitActivity : 1; /* 1E.C433.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C433.1:0 R/WPD LED #3 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u3.bits_3.led_3ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_3ActivityStretch : 2; /* 1E.C433.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C434.8 R/WPD LED #4 Manual Set - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_4ManualSet : 1; /* 1E.C434.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C434.7 R/WPD LED #4 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_4_10Gb_sLinkEstablished : 1; /* 1E.C434.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C434.6 R/WPD LED #4 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_4_1Gb_sLinkEstablished : 1; /* 1E.C434.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C434.5 R/WPD LED #4 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_4_100Mb_sLinkEstablished : 1; /* 1E.C434.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C434.4 R/WPD LED #4 Connecting - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_4Connecting : 1; /* 1E.C434.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C434.3 R/WPD LED #4 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_4ReceiveActivity : 1; /* 1E.C434.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C434.2 R/WPD LED #4 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_4TransmitActivity : 1; /* 1E.C434.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C434.1:0 R/WPD LED #4 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u4.bits_4.led_4ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_4ActivityStretch : 2; /* 1E.C434.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C435.8 R/WPD LED #5 Manual Set - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_5ManualSet : 1; /* 1E.C435.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C435.7 R/WPD LED #5 10 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_5_10Gb_sLinkEstablished : 1; /* 1E.C435.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C435.6 R/WPD LED #5 1 Gb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_5_1Gb_sLinkEstablished : 1; /* 1E.C435.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C435.5 R/WPD LED #5 100 Mb/s Link Established - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s - - */ - unsigned int led_5_100Mb_sLinkEstablished : 1; /* 1E.C435.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s - */ - /*! \brief 1E.C435.4 R/WPD LED #5 Connecting - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_5Connecting : 1; /* 1E.C435.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C435.3 R/WPD LED #5 Receive Activity - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_5ReceiveActivity : 1; /* 1E.C435.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C435.2 R/WPD LED #5 Transmit Activity - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_5TransmitActivity : 1; /* 1E.C435.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C435.1:0 R/WPD LED #5 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_APPIA.u5.bits_5.led_5ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_5ActivityStretch : 2; /* 1E.C435.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C437.0 R/WPD LED Operation Mode - AQ_GlobalLedProvisioning_APPIA.u7.bits_7.ledOperationMode - - Provisionable Default = 0x0 - - 1 = LED link activity in Mode #2 - 0 = LED link activity in classic mode - - - Notes: - When set to 1, the LED blinking rate is based on Mode #2 algorithm. When set to 0, the LED blinking rate is based on the classic algorithm. */ - unsigned int ledOperationMode : 1; /* 1E.C437.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED link activity in Mode #2 - 0 = LED link activity in classic mode - */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 13; - /*! \brief 1E.C438.2 R/WPD LED #0 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u8.bits_8.led_0DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_0DriveThreeStateSelect : 1; /* 1E.C438.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - /*! \brief 1E.C438.1 R/WPD LED #0 Active High Select - AQ_GlobalLedProvisioning_APPIA.u8.bits_8.led_0ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #0 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_0ActiveHighSelect : 1; /* 1E.C438.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C438.0 R/WPD LED #0 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u8.bits_8.led_0ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_0ManualActiveSelect : 1; /* 1E.C438.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 13; - /*! \brief 1E.C439.2 R/WPD LED #1 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u9.bits_9.led_1DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_1DriveThreeStateSelect : 1; /* 1E.C439.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - /*! \brief 1E.C439.1 R/WPD LED #1 Active High Select - AQ_GlobalLedProvisioning_APPIA.u9.bits_9.led_1ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #1 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_1ActiveHighSelect : 1; /* 1E.C439.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C439.0 R/WPD LED #1 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u9.bits_9.led_1ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_1ManualActiveSelect : 1; /* 1E.C439.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Union for bit and word level access of word 10 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 13; - /*! \brief 1E.C43A.2 R/WPD LED #2 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u10.bits_10.led_2DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_2DriveThreeStateSelect : 1; /* 1E.C43A.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - /*! \brief 1E.C43A.1 R/WPD LED #2 Active High Select - AQ_GlobalLedProvisioning_APPIA.u10.bits_10.led_2ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #2 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_2ActiveHighSelect : 1; /* 1E.C43A.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C43A.0 R/WPD LED #2 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u10.bits_10.led_2ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_2ManualActiveSelect : 1; /* 1E.C43A.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Union for bit and word level access of word 11 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 13; - /*! \brief 1E.C43B.2 R/WPD LED #3 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u11.bits_11.led_3DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_3DriveThreeStateSelect : 1; /* 1E.C43B.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - /*! \brief 1E.C43B.1 R/WPD LED #3 Active High Select - AQ_GlobalLedProvisioning_APPIA.u11.bits_11.led_3ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #3 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_3ActiveHighSelect : 1; /* 1E.C43B.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C43B.0 R/WPD LED #3 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u11.bits_11.led_3ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_3ManualActiveSelect : 1; /* 1E.C43B.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - } bits_11; - uint16_t word_11; - } u11; - /*! \brief Union for bit and word level access of word 12 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 13; - /*! \brief 1E.C43C.2 R/WPD LED #4 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u12.bits_12.led_4DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_4DriveThreeStateSelect : 1; /* 1E.C43C.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - /*! \brief 1E.C43C.1 R/WPD LED #4 Active High Select - AQ_GlobalLedProvisioning_APPIA.u12.bits_12.led_4ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #4 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_4ActiveHighSelect : 1; /* 1E.C43C.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C43C.0 R/WPD LED #4 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u12.bits_12.led_4ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_4ManualActiveSelect : 1; /* 1E.C43C.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - } bits_12; - uint16_t word_12; - } u12; - /*! \brief Union for bit and word level access of word 13 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 13; - /*! \brief 1E.C43D.2 R/WPD LED #5 Drive Three State Select - AQ_GlobalLedProvisioning_APPIA.u13.bits_13.led_5DriveThreeStateSelect - - Provisionable Default = 0x0 - - 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - - */ - unsigned int led_5DriveThreeStateSelect : 1; /* 1E.C43D.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Drive LED tri-state when not active - 0 = Drive LED opposite of active level when not active - */ - /*! \brief 1E.C43D.1 R/WPD LED #5 Active High Select - AQ_GlobalLedProvisioning_APPIA.u13.bits_13.led_5ActiveHighSelect - - Provisionable Default = 0x0 - - 1 = LED active high - 0 = LED active low - - - Notes: - The See LED #5 Manual Active Select bit must be 1 for this bit to take affect. */ - unsigned int led_5ActiveHighSelect : 1; /* 1E.C43D.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED active high - 0 = LED active low - */ - /*! \brief 1E.C43D.0 R/WPD LED #5 Manual Active Select - AQ_GlobalLedProvisioning_APPIA.u13.bits_13.led_5ManualActiveSelect - - Provisionable Default = 0x0 - - 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - - */ - unsigned int led_5ManualActiveSelect : 1; /* 1E.C43D.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Manual selection of LED active high or low - 0 = Determine the active high or low based on the external pull-up or pull-down - */ - } bits_13; - uint16_t word_13; - } u13; -} AQ_GlobalLedProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global General Provisioning: 1E.C440 */ -/* Global General Provisioning: 1E.C440 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C440.8:4 R/WPD Gang Load MDIO Address [4:0] - AQ_GlobalGeneralProvisioning_APPIA.u0.bits_0.gangLoadMdioAddress - - Provisionable Default = 0x00 - - MDIO Address to be used during gang load operation - - - Notes: - Gang load operation is used to load data into multiple PHYs all connected to the same MDIO bus. The address for gang load operation is provided by these bits (8:4), and enabling is done by writing Bit 0. Disabling of gang load mode is done by writing the See MDIO Address Reset (1E.C441.2) bit. These will revert the PHY's MDIO address back to the address provided by the MDIO Address pins. During gang load operation, MDIO reads are disabled to prevent bus contention. */ - unsigned int gangLoadMdioAddress : 5; /* 1E.C440.8:4 R/WPD Provisionable Default = 0x00 */ - /* MDIO Address to be used during gang load operation - */ - unsigned int reserved1 : 3; - /*! \brief 1E.C440.0 RO Gang Load MDIO Write Only - AQ_GlobalGeneralProvisioning_APPIA.u0.bits_0.gangLoadMdioWriteOnly - - - - 1 = MDIO gang load enable - - - Notes: - This bit enables gang load operation with the address specified in Bits 8:4. */ - unsigned int gangLoadMdioWriteOnly : 1; /* 1E.C440.0 RO */ - /* 1 = MDIO gang load enable - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C441.E R/WPD MDIO Broadcast Mode Enable - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioBroadcastModeEnable - - Provisionable Default = 0x0 - - 1 = Enable broadcast on Address 0 - 0 = Disable broadcast on Address 0 - - - Notes: - When set, this bit enables gang-load operation on address zero, simultaneous with normal MDIO operation. Obviously, this requires that no PHY use address 0 as its normal operating address. As well, reads on MDIO Address 0 are disabled to prevent bus contention. */ - unsigned int mdioBroadcastModeEnable : 1; /* 1E.C441.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable broadcast on Address 0 - 0 = Disable broadcast on Address 0 - */ - /*! \brief 1E.C441.D R/WPD MDIO Read MSW First Enable - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioReadMSW_FirstEnable - - Provisionable Default = 0x0 - - 1 = MSW of counter must be read first - 0 = LSW of counter must be read first - - - Notes: - This bit configures whether the MSW or LSW must be read first for counters greater than 16 bits. */ - unsigned int mdioReadMSW_FirstEnable : 1; /* 1E.C441.D R/WPD Provisionable Default = 0x0 */ - /* 1 = MSW of counter must be read first - 0 = LSW of counter must be read first - */ - unsigned int reserved1 : 8; - /*! \brief 1E.C441.4 R/WPD MDIO Drive Configuration - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioDriveConfiguration - - Provisionable Default = 0x0 - - 0 = MDIO driver is in normal mode - 1 = MDIO driver is in open drain mode - - - Notes: - When the MDIO driver is in open drain mode during a read cycle, "0" data will be actively driven out of the MDIO, "1" data will set the MDIO driver in high impedance state and an external pullup will set the MDIO line to "1". The Turn-Around "0" will also be actively driven out of the MDIO, therefore in open drain mode, the Turn-Around is still "Z0". */ - unsigned int mdioDriveConfiguration : 1; /* 1E.C441.4 R/WPD Provisionable Default = 0x0 */ - /* 0 = MDIO driver is in normal mode - 1 = MDIO driver is in open drain mode - */ - /*! \brief 1E.C441.3 R/WPD MDIO Preamble Detection Disable - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioPreambleDetectionDisable - - Provisionable Default = 0x0 - - 1 = Suppress preamble detection on MDIO - 0 = Enable preamble detection on MDIO - - */ - unsigned int mdioPreambleDetectionDisable : 1; /* 1E.C441.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = Suppress preamble detection on MDIO - 0 = Enable preamble detection on MDIO - */ - /*! \brief 1E.C441.2 R/WSC MDIO Address Reset - AQ_GlobalGeneralProvisioning_APPIA.u1.bits_1.mdioAddressReset - - Default = 0x0 - - 1 = Load MDIO Address with the address on the MDIO address pins - - - Notes: - Used to reset the address after gang load and enable MDIO reads again. */ - unsigned int mdioAddressReset : 1; /* 1E.C441.2 R/WSC Default = 0x0 */ - /* 1 = Load MDIO Address with the address on the MDIO address pins - */ - unsigned int reserved2 : 2; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C442.0 R/W Daisy Chain Reset - AQ_GlobalGeneralProvisioning_APPIA.u2.bits_2.daisyChainReset - - Default = 0x0 - - 1 = Reset the daisy chain - - - Notes: - Toggling this bit from 0 to 1 will reload the IRAM and DRAM and reset the uP. The uP will be in uP run stall during the reload process. After the reload process, uP run stall will be de-asserted adn the uP reset will be asserted. Note that before setting this bit, the See Soft Reset bit needs to be de-asserted. */ - unsigned int daisyChainReset : 1; /* 1E.C442.0 R/W Default = 0x0 */ - /* 1 = Reset the daisy chain - */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalGeneralProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global NVR Provisioning: 1E.C450 */ -/* Global NVR Provisioning: 1E.C450 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global NVR Provisioning */ - union - { - struct - { - unsigned int reserved0 : 5; - /*! \brief 1E.C450.A:8 R/WPD NVR Data Length [2:0] - AQ_GlobalNvrProvisioning_APPIA.u0.bits_0.nvrDataLength - - Provisionable Default = 0x4 - - NVR data length ranges from 0 bytes to 4 bytes - - - Notes: - This sets the length of the data burst used in read and write operations. - */ - unsigned int nvrDataLength : 3; /* 1E.C450.A:8 R/WPD Provisionable Default = 0x4 */ - /* NVR data length ranges from 0 bytes to 4 bytes - */ - unsigned int reserved1 : 1; - /*! \brief 1E.C450.6:4 R/WPD NVR Dummy Length [2:0] - AQ_GlobalNvrProvisioning_APPIA.u0.bits_0.nvrDummyLength - - Provisionable Default = 0x0 - - NVR dummy length ranges from 0 bytes to 4 bytes. - - - Notes: - This sets the length of the dummy field used in some maunfacturer's read status and write status operations. - */ - unsigned int nvrDummyLength : 3; /* 1E.C450.6:4 R/WPD Provisionable Default = 0x0 */ - /* NVR dummy length ranges from 0 bytes to 4 bytes. - */ - unsigned int reserved2 : 2; - /*! \brief 1E.C450.1:0 R/WPD NVR Address Length [1:0] - AQ_GlobalNvrProvisioning_APPIA.u0.bits_0.nvrAddressLength - - Provisionable Default = 0x2 - - NVR address length ranges from 0 bytes up to 3 bytes. - - - Notes: - This sets the length of the address field used in read and write operations. Use of this field is enabled via Bit 8 of See Global NVR Provisioning 2: Address 1E.C451 . - */ - unsigned int nvrAddressLength : 2; /* 1E.C450.1:0 R/WPD Provisionable Default = 0x2 */ - /* NVR address length ranges from 0 bytes up to 3 bytes. - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global NVR Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C451.8 R/WPD NVR Address Length Override - AQ_GlobalNvrProvisioning_APPIA.u1.bits_1.nvrAddressLengthOverride - - Provisionable Default = 0x0 - - 0 = NVR address length is based on the "NVR_SIZE" pin. - 1 = NVR address length is based on the See NVR Address Length [1:0] register. - - - Notes: - When the this bit = 0 and NVR_SIZE pin = 0, the NVR address length is 2 bytes. When this bit = 0 and the NVR_SIZE pin = 1, the NVR address length is 3 bytes. When this bit = 1 the NVR address length is from the See NVR Address Length [1:0] */ - unsigned int nvrAddressLengthOverride : 1; /* 1E.C451.8 R/WPD Provisionable Default = 0x0 */ - /* 0 = NVR address length is based on the "NVR_SIZE" pin. - 1 = NVR address length is based on the See NVR Address Length [1:0] register. - */ - /*! \brief 1E.C451.7:0 R/WPD NVR Clock Divide [7:0] - AQ_GlobalNvrProvisioning_APPIA.u1.bits_1.nvrClockDivide - - Provisionable Default = 0xA0 - - NVR clock divide. Clock frequency is divided by the NVR clock divide + 1 - - */ - unsigned int nvrClockDivide : 8; /* 1E.C451.7:0 R/WPD Provisionable Default = 0xA0 */ - /* NVR clock divide. Clock frequency is divided by the NVR clock divide + 1 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global NVR Provisioning */ - union - { - struct - { - unsigned int reserved0 : 14; - /*! \brief 1E.C452.1 R/W NVR Daisy Chain Clock Divide Override - AQ_GlobalNvrProvisioning_APPIA.u2.bits_2.nvrDaisyChainClockDivideOverride - - Default = 0x0 - - 1 = Override NVR clock divide when in daisy chain master mode - - - - Notes: - When in daisy chain master mode, the clock divide configuration is received from the flash. This bit will override the clock divide configuration from the flash with the See NVR Clock Divide [7:0] . */ - unsigned int nvrDaisyChainClockDivideOverride : 1; /* 1E.C452.1 R/W Default = 0x0 */ - /* 1 = Override NVR clock divide when in daisy chain master mode - - */ - /*! \brief 1E.C452.0 R/W NVR Daisy Chain Disable - AQ_GlobalNvrProvisioning_APPIA.u2.bits_2.nvrDaisyChainDisable - - Default = 0x0 - - 1 = Disable the Daisy Chain - - - Notes: - When in daisy chain master mode, the daisy chain and MDIO can both access the SPI. Setting this bit to 1 will disable the dasiy chain from accessing the SPI and force it into a reset state. */ - unsigned int nvrDaisyChainDisable : 1; /* 1E.C452.0 R/W Default = 0x0 */ - /* 1 = Disable the Daisy Chain - */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalNvrProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reserved Provisioning: 1E.C470 */ -/* Global Reserved Provisioning: 1E.C470 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C470.F R/WPD Diagnostics Select - AQ_GlobalReservedProvisioning_APPIA.u0.bits_0.diagnosticsSelect - - Provisionable Default = 0x0 - - 1 = Provide Extended MDI Diagnostics Information. - 0 = Provide normal cable diagnostics - - - Notes: - These bits select what sort of cable diagnostics to perform. For regular cable diagnostics, Bit F is set to zero, and the diagnostics are triggered by setting Bit 4. For extended diagnostics, Bit F is set to 1, and the desired extended diagnostics are selected by Bits E:D. The routine is then triggered by setting Bit 4. Each of the extended diagnostic routines present data for all for MDI pairs (A, B, C, D) consecutively, and after the data for each channel is gathered Bits F:D are reset. To get the data for the next pair, Bits F:D must be set back to the desired value (which must be the same as the initial channel). This continues until the data for all channels has been gathered. The address in memory where the data is stored is given in 1E.C802 and 1E.C804. - - For the case of PSD, the structure is as follows: - Int32 info - Int16 data[Len] - Info = Len << 16 | TxEnable << 8 | Pair (0 = A, etc.) - - For TDR: - Int32 info - Int16 tdr_A[Len] - Int16 tdr_B[Len] - Int16 tdr_C[Len] - Int16 tdr_D[Len] - - Info = Len << 16 | Channel - - TDR data is from the current pair to all other pairs. - - At the end of retrieving extended MDI diag data, the part will be reset. Conversly the only way to exit this routine once it starts is to issue a PMA reset. */ - unsigned int diagnosticsSelect : 1; /* 1E.C470.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Provide Extended MDI Diagnostics Information. - 0 = Provide normal cable diagnostics - */ - /*! \brief 1E.C470.E:D R/WPD Extended MDI Diagnostics Select [1:0] - AQ_GlobalReservedProvisioning_APPIA.u0.bits_0.extendedMdiDiagnosticsSelect - - Provisionable Default = 0x0 - - 0x0 = TDR Data - 0x1 = RFI Channel PSD - 0x2 = Noise PSD while the local Tx is Off - 0x3 = Noise PSD while the local Tx is On - - - Notes: - These bits select what sort of cable diagnostics to perform. For regular cable diagnostics, Bit F is set to zero, and the diagnostics are triggered by setting Bit 4. For extended diagnostics, Bit F is set to 1, and the desired extended diagnostics are selected by Bits E:D. The routine is then triggered by setting Bit 4. Each of the extended diagnostic routines present data for all for MDI pairs (A, B, C, D) consecutively, and after the data for each channel is gathered Bits F:D are reset. To get the data for the next pair, Bits F:D must be set back to the desired value (which must be the same as the initial channel). This continues until the data for all channels has been gathered. The address in memory where the data is stored is given in 1E.C802 and 1E.C804. - - For the case of PSD, the structure is as follows: - Int32 info - Int16 data[Len] - Info = Len << 16 | TxEnable << 8 | Pair (0 = A, etc.) - - For TDR: - Int32 info - Int16 tdr_A[Len] - Int16 tdr_B[Len] - Int16 tdr_C[Len] - Int16 tdr_D[Len] - - Info = Len << 16 | Channel - - TDR data is from the current pair to all other pairs. - - At the end of retrieving extended MDI diag data, the part will be reset. Conversly the only way to exit this routine once it starts is to issue a PMA reset. */ - unsigned int extendedMdiDiagnosticsSelect : 2; /* 1E.C470.E:D R/WPD Provisionable Default = 0x0 */ - /* 0x0 = TDR Data - 0x1 = RFI Channel PSD - 0x2 = Noise PSD while the local Tx is Off - 0x3 = Noise PSD while the local Tx is On - */ - unsigned int reserved0 : 5; - unsigned int reserved1 : 2; - /*! \brief 1E.C470.5 R/WSC Initiate Component Diagnostics - AQ_GlobalReservedProvisioning_APPIA.u0.bits_0.initiateComponentDiagnostics - - Default = 0x0 - - 1 = Perform component diagnostics - - - Notes: - Perform component diagnostics regardless of link state. If link is up, setting this bit will cause the link to drop while diagnostics are performed. This bit is self-clearing upon completion of the component diagnostics. Further MDIO writes should be avoided until this bit has self-cleared, indicating completion of the diagnostic routine. */ - unsigned int initiateComponentDiagnostics : 1; /* 1E.C470.5 R/WSC Default = 0x0 */ - /* 1 = Perform component diagnostics - */ - /*! \brief 1E.C470.4 R/WSC Initiate Cable Diagnostics - AQ_GlobalReservedProvisioning_APPIA.u0.bits_0.initiateCableDiagnostics - - Default = 0x0 - - 1 = Perform cable diagnostics - - - Notes: - Perform cable diagnostics regardless of link state. If link is up, setting this bit will cause the link to drop while diagnostics are performed. This bit is self-clearing upon completion of the cable diagnostics. Further MDIO writes should be avoided until this bit has self-cleared, indicating completion of the diagnostic routine. */ - unsigned int initiateCableDiagnostics : 1; /* 1E.C470.4 R/WSC Default = 0x0 */ - /* 1 = Perform cable diagnostics - */ - unsigned int reserved2 : 4; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C471.F:7 R/WPD Reserved Provisioning 2 [8:0] - AQ_GlobalReservedProvisioning_APPIA.u1.bits_1.reservedProvisioning_2 - - Provisionable Default = 0x000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_2 : 9; /* 1E.C471.F:7 R/WPD Provisionable Default = 0x000 */ - /* Reserved for future use - */ - /*! \brief 1E.C471.6 R/WuP Enable Daisy-Chain Hop-Count Override - AQ_GlobalReservedProvisioning_APPIA.u1.bits_1.enableDaisy_chainHop_countOverride - - Default = 0x0 - - 1 = Hop-count is set by Bits 5:0 - 0 = Hop-count is determined by the daisy-chain - - - Notes: - Daisy-Chain Hop-Count Override should be used during MDIO boot-load operation, as the daisy-chain hop-count does not function when the daisy-chain is disabled (1E.C452.0). Setting this bit tells the processor where in the diasy-chain it is, so that the provisioning operation will function correctly. */ - unsigned int enableDaisy_chainHop_countOverride : 1; /* 1E.C471.6 R/WuP Default = 0x0 */ - /* 1 = Hop-count is set by Bits 5:0 - 0 = Hop-count is determined by the daisy-chain - */ - /*! \brief 1E.C471.5:0 R/WuP Daisy-Chain Hop-Count Override Value [5:0] - AQ_GlobalReservedProvisioning_APPIA.u1.bits_1.daisy_chainHop_countOverrideValue - - Default = 0x00 - - The value to use for the PHY's daisy-chain hop-count. Valid values are from 0 -> 47 - - - Notes: - Daisy-Chain Hop-Count Override should be used during MDIO boot-load operation, as the daisy-chain hop-count does not function when the daisy-chain is disabled (1E.C452.0). Setting this bit tells the processor where in the diasy-chain it is, so that the provisioning operation will function correctly. */ - unsigned int daisy_chainHop_countOverrideValue : 6; /* 1E.C471.5:0 R/WuP Default = 0x00 */ - /* The value to use for the PHY's daisy-chain hop-count. Valid values are from 0 -> 47 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C472.F R/WPD Enable LVDD Power Supply Tuning - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.enableLvddPowerSupplyTuning - - Provisionable Default = 0x0 - - 1 = Enable external LVDD power supply tuning - 0 = Disable external LVDD power supply tuning is disabled - - - Notes: - - - - These bits control whether the PHY attempts to tune the external VDD and LVDD power supplies via the PMBus. These bits are only operational if the external supplies are present (see Bits 7:6) */ - unsigned int enableLvddPowerSupplyTuning : 1; /* 1E.C472.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable external LVDD power supply tuning - 0 = Disable external LVDD power supply tuning is disabled - */ - /*! \brief 1E.C472.E R/WPD Enable VDD Power Supply Tuning - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.enableVddPowerSupplyTuning - - Provisionable Default = 0x0 - - 1 = Enable external VDD power supply tuning - 0 = Disable external VDD power supply tuning is disabled - - - Notes: - - - - These bits control whether the PHY attempts to tune the external VDD and LVDD power supplies via the PMBus. These bits are only operational if the external supplies are present (see Bits 7:6) */ - unsigned int enableVddPowerSupplyTuning : 1; /* 1E.C472.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable external VDD power supply tuning - 0 = Disable external VDD power supply tuning is disabled - */ - unsigned int reserved0 : 6; - /*! \brief 1E.C472.7 R/WPD Tunable External LVDD Power Supply Present - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.tunableExternalLvddPowerSupplyPresent - - Provisionable Default = 0x0 - - 1 = Tunable external LVDD power supply present - 0 = No tunable external LVDD power supply present - - - Notes: - - - - These bits must be set if tuning of external power supplies is desired (see Bits 7:6) */ - unsigned int tunableExternalLvddPowerSupplyPresent : 1; /* 1E.C472.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Tunable external LVDD power supply present - 0 = No tunable external LVDD power supply present - */ - /*! \brief 1E.C472.6 R/WPD Tunable External VDD Power Supply Present - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.tunableExternalVddPowerSupplyPresent - - Provisionable Default = 0x0 - - 1 = Tunable external VDD power supply present - 0 = No tunable external VDD power supply present - - - Notes: - - - - These bits must be set if tuning of external power supplies is desired (see Bits 7:6) */ - unsigned int tunableExternalVddPowerSupplyPresent : 1; /* 1E.C472.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Tunable external VDD power supply present - 0 = No tunable external VDD power supply present - */ - unsigned int reserved1 : 4; - /*! \brief 1E.C472.1 R/WPDuP Enable XENPAK Register Space - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.enableXenpakRegisterSpace - - Provisionable Default = 0x0 - - 1 = XENPAK register space enabled - 0 = XENPAK register space disabled - - */ - unsigned int enableXenpakRegisterSpace : 1; /* 1E.C472.1 R/WPDuP Provisionable Default = 0x0 */ - /* 1 = XENPAK register space enabled - 0 = XENPAK register space disabled - */ - /*! \brief 1E.C472.0 R/WPDuP Enable 5th Channel RFI Cancellation - AQ_GlobalReservedProvisioning_APPIA.u2.bits_2.enable_5thChannelRfiCancellation - - Provisionable Default = 0x0 - - 1 = 5th channel and RFI cancellers operation enabled - 0 = 5th channel AFE is powered down, 5th channel digital is clock gated, RFI cancellers are disabled - - - Notes: - Note: The value of this bit at the time of Autonegotiation sets the local PHY behavior until the next time Autonegotiation occurs. */ - unsigned int enable_5thChannelRfiCancellation : 1; /* 1E.C472.0 R/WPDuP Provisionable Default = 0x0 */ - /* 1 = 5th channel and RFI cancellers operation enabled - 0 = 5th channel AFE is powered down, 5th channel digital is clock gated, RFI cancellers are disabled - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.C474.7:0 R/WPD Training SNR [7:0] - AQ_GlobalReservedProvisioning_APPIA.u4.bits_4.trainingSNR - - Provisionable Default = 0x00 - - SNR during 10G training on the worst channel. SNR is in steps of 0.1dB - - - Notes: - The SNR margin that is enjoyed by the worst channel, over and above the minimum SNR required to operate at a BER of 10-12. It is reported with 0.1 dB of resolution to an accuracy of 0.5 dB within the range of -12.7 dB to 12.7 dB. The number is in offset binary, with 0.0 dB represented by 0x8000. - */ - unsigned int trainingSNR : 8; /* 1E.C474.7:0 R/WPD Provisionable Default = 0x00 */ - /* SNR during 10G training on the worst channel. SNR is in steps of 0.1dB - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved0 : 2; - /*! \brief 1E.C475.D R/WPD Smart Power-Down Status - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.smartPower_downStatus - - Provisionable Default = 0x0 - - 1 = Smart Power-Down Active - 0 = Smart Power-Down Inactive - - */ - unsigned int smartPower_downStatus : 1; /* 1E.C475.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Smart Power-Down Active - 0 = Smart Power-Down Inactive - */ - /*! \brief 1E.C475.C R/WPD Reserved Provisioning 6 - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.reservedProvisioning_6 - - Provisionable Default = 0x0 - - Reserved for future use - - */ - unsigned int reservedProvisioning_6 : 1; /* 1E.C475.C R/WPD Provisionable Default = 0x0 */ - /* Reserved for future use - */ - /*! \brief 1E.C475.B R/WPD CFR LP Disable Timer - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrLpDisableTimer - - Provisionable Default = 0x0 - - 1 = Link partner requires cfr_disable timer - 0 = Link partner does not require cfr_disable timer - - */ - unsigned int cfrLpDisableTimer : 1; /* 1E.C475.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires cfr_disable timer - 0 = Link partner does not require cfr_disable timer - */ - /*! \brief 1E.C475.A R/WPD CFR LP Extended Maxwait - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrLpExtendedMaxwait - - Provisionable Default = 0x0 - - 1 = Link partner requires extended maxwait - 0 = Link partner does not require extended maxwait - - */ - unsigned int cfrLpExtendedMaxwait : 1; /* 1E.C475.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires extended maxwait - 0 = Link partner does not require extended maxwait - */ - /*! \brief 1E.C475.9 R/WPD CFR LP THP - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrLpTHP - - Provisionable Default = 0x0 - - 1 = Link partner requires local PHY to enable THP - 0 = Link partner does not require local PHY to enable THP - - */ - unsigned int cfrLpTHP : 1; /* 1E.C475.9 R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires local PHY to enable THP - 0 = Link partner does not require local PHY to enable THP - */ - /*! \brief 1E.C475.8 R/WPD CFR LP Support - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrLpSupport - - Provisionable Default = 0x0 - - 1 = Link partner supports Cisco Fast Retrain - 0 = Link partner does support Cisco Fast Retrain - - */ - unsigned int cfrLpSupport : 1; /* 1E.C475.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner supports Cisco Fast Retrain - 0 = Link partner does support Cisco Fast Retrain - */ - /*! \brief 1E.C475.7 R/WPD CFR Disable Timer - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrDisableTimer - - Provisionable Default = 0x0 - - 1 = Local PHY requires cfr_disable timer - 0 = Local PHY does not require cfr_disable timer - - */ - unsigned int cfrDisableTimer : 1; /* 1E.C475.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires cfr_disable timer - 0 = Local PHY does not require cfr_disable timer - */ - /*! \brief 1E.C475.6 R/WPD CFR Extended Maxwait - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrExtendedMaxwait - - Provisionable Default = 0x0 - - 1 = Local PHY requires extended maxwait - 0 = Local PHY does not require extended maxwait - - */ - unsigned int cfrExtendedMaxwait : 1; /* 1E.C475.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires extended maxwait - 0 = Local PHY does not require extended maxwait - */ - /*! \brief 1E.C475.5 R/WPD CFR THP - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrTHP - - Provisionable Default = 0x0 - - 1 = Local PHY requires local PHY to enable THP - 0 = Local PHY does not require local PHY to enable THP - - */ - unsigned int cfrTHP : 1; /* 1E.C475.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires local PHY to enable THP - 0 = Local PHY does not require local PHY to enable THP - */ - /*! \brief 1E.C475.4 R/WPD CFR Support - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.cfrSupport - - Provisionable Default = 0x0 - - 1 = Local PHY supports Cisco Fast Retrain - 0 = Local PHY does support Cisco Fast Retrain - - */ - unsigned int cfrSupport : 1; /* 1E.C475.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY supports Cisco Fast Retrain - 0 = Local PHY does support Cisco Fast Retrain - */ - /*! \brief 1E.C475.3 R/WPD Deadlock Avoidance Enable - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.deadlockAvoidanceEnable - - Provisionable Default = 0x0 - - 1 = SPD with deadlock avoidance: PHY transmits autonegotiation pulses (FLPs) at a slower rate (~ 1 FLP/ 100ms) than specified by autonegotiation standard (~1 FLP / 8.25ms). Receiver is active and able to detect the pulses. - 0 = SPD without deadlock avoidance: PHY transmitter is shut down, no autonegotiation pulses are sent on the line but the receiver is active and able to detect the pulses - - */ - unsigned int deadlockAvoidanceEnable : 1; /* 1E.C475.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = SPD with deadlock avoidance: PHY transmits autonegotiation pulses (FLPs) at a slower rate (~ 1 FLP/ 100ms) than specified by autonegotiation standard (~1 FLP / 8.25ms). Receiver is active and able to detect the pulses. - 0 = SPD without deadlock avoidance: PHY transmitter is shut down, no autonegotiation pulses are sent on the line but the receiver is active and able to detect the pulses - */ - /*! \brief 1E.C475.2 R/WPD Smart Power-Down Enable - AQ_GlobalReservedProvisioning_APPIA.u5.bits_5.smartPower_downEnable - - Provisionable Default = 0x0 - - 1 = Enable smart power down mode - 0 = Smart power-down mode disabled - - - Notes: - Smart power down (SPD) is the lowest power mode at which PHY is able to autonegotiate. SPD can be enabled with bit 1E.C475.2 */ - unsigned int smartPower_downEnable : 1; /* 1E.C475.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable smart power down mode - 0 = Smart power-down mode disabled - */ - unsigned int reserved1 : 2; - } bits_5; - uint16_t word_5; - } u5; -} AQ_GlobalReservedProvisioning_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Cable Diagnostic Status: 1E.C800 */ -/* Global Cable Diagnostic Status: 1E.C800 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Cable Diagnostic Status */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C800.E:C RO Pair A Status [2:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u0.bits_0.pairAStatus - - - - (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair D - 010= Connected to Pair C - 001= Connected to Pair B - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK - - Notes: - This bitfield reports the result, for pair A, of running either cable diagnostics or component diagnostics. */ - unsigned int pairAStatus : 3; /* 1E.C800.E:C RO */ - /* (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair D - 010= Connected to Pair C - 001= Connected to Pair B - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK */ - unsigned int reserved1 : 1; - /*! \brief 1E.C800.A:8 RO Pair B Status [2:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u0.bits_0.pairBStatus - - - - (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair A - 010= Connected to Pair D - 001= Connected to Pair C - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK - - Notes: - This bitfield reports the result, for pair B, of running either cable diagnostics or component diagnostics. */ - unsigned int pairBStatus : 3; /* 1E.C800.A:8 RO */ - /* (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair A - 010= Connected to Pair D - 001= Connected to Pair C - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK */ - unsigned int reserved2 : 1; - /*! \brief 1E.C800.6:4 RO Pair C Status [2:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u0.bits_0.pairCStatus - - - - (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair B - 010= Connected to Pair A - 001= Connected to Pair D - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK - - Notes: - This bitfield reports the result, for pair C, of running either cable diagnostics or component diagnostics. */ - unsigned int pairCStatus : 3; /* 1E.C800.6:4 RO */ - /* (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair B - 010= Connected to Pair A - 001= Connected to Pair D - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK */ - unsigned int reserved3 : 1; - /*! \brief 1E.C800.2:0 RO Pair D Status [2:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u0.bits_0.pairDStatus - - - - (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair C - 010= Connected to Pair B - 001= Connected to Pair A - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK - - Notes: - This bitfield reports the result, for pair D, of running either cable diagnostics or component diagnostics. */ - unsigned int pairDStatus : 3; /* 1E.C800.2:0 RO */ - /* (after running cable diags) - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair C - 010= Connected to Pair B - 001= Connected to Pair A - 000= OK - - OR: - - (after running component diags) - 100 = TX pin open - 011= TX bias open - 010= Capacitor short - 001= Inductor open - 000= OK */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C801.F:8 RO Pair A Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u1.bits_1.pairAReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair A - - Notes: - The distance to this reflection is given in See Global Reserved Status 1: Address 1E.C870 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairAReflection_1 : 8; /* 1E.C801.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair A */ - /*! \brief 1E.C801.7:0 RO Pair A Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u1.bits_1.pairAReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair A - - Notes: - The distance to this reflection is given in See Global Reserved Status 1: Address 1E.C870 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairAReflection_2 : 8; /* 1E.C801.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair A */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C802.F:0 RO Impulse Response MSW [F:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u2.bits_2.impulseResponseMSW - - - - The MSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type in 1E.C470.E:D - - - Notes: - See 1E.C470 for more information */ - unsigned int impulseResponseMSW : 16; /* 1E.C802.F:0 RO */ - /* The MSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type in 1E.C470.E:D - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C803.F:8 RO Pair B Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u3.bits_3.pairBReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair B - - Notes: - The distance to this reflection is given in See Global Reserved Status 2: Address 1E.C871 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairBReflection_1 : 8; /* 1E.C803.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair B */ - /*! \brief 1E.C803.7:0 RO Pair B Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u3.bits_3.pairBReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair B - - Notes: - The distance to this reflection is given in See Global Reserved Status 2: Address 1E.C871 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairBReflection_2 : 8; /* 1E.C803.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair B */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C804.F:0 RO Impulse Response LSW [F:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u4.bits_4.impulseResponseLSW - - - - The LSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type specified in 1E.C470.E:D - - - Notes: - See 1E.C470 for more information */ - unsigned int impulseResponseLSW : 16; /* 1E.C804.F:0 RO */ - /* The LSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type specified in 1E.C470.E:D - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C805.F:8 RO Pair C Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u5.bits_5.pairCReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair C - - Notes: - The distance to this reflection is given in See Global Reserved Status 3: Address 1E.C872 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairCReflection_1 : 8; /* 1E.C805.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair C */ - /*! \brief 1E.C805.7:0 RO Pair C Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u5.bits_5.pairCReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair C - - Notes: - The distance to this reflection is given in See Global Reserved Status 3: Address 1E.C872 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairCReflection_2 : 8; /* 1E.C805.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair C */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C806.F:0 RO Reserved 1 [F:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u6.bits_6.reserved_1 - - - - Reserved for future use - - */ - unsigned int reserved_1 : 16; /* 1E.C806.F:0 RO */ - /* Reserved for future use - */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C807.F:8 RO Pair D Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u7.bits_7.pairDReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair D - - Notes: - The distance to this reflection is given in See Global Reserved Status 4: Address 1E.C873 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairDReflection_1 : 8; /* 1E.C807.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair D */ - /*! \brief 1E.C807.7:0 RO Pair D Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u7.bits_7.pairDReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair D - - Notes: - The distance to this reflection is given in See Global Reserved Status 4: Address 1E.C873 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairDReflection_2 : 8; /* 1E.C807.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair D */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C808.F:0 RO Reserved 2[F:0] - AQ_GlobalCableDiagnosticStatus_APPIA.u8.bits_8.reserved_2 - - - - Reserved for future use - - */ - unsigned int reserved_2 : 16; /* 1E.C808.F:0 RO */ - /* Reserved for future use - */ - } bits_8; - uint16_t word_8; - } u8; -} AQ_GlobalCableDiagnosticStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Thermal Status: 1E.C820 */ -/* Global Thermal Status: 1E.C820 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Thermal Status */ - union - { - struct - { - /*! \brief 1E.C820.F:0 RO Temperature [F:0] - AQ_GlobalThermalStatus_APPIA.u0.bits_0.temperature - - - - [F:0] of temperature - - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 70 degreesC. This is a mirror of the XENPAK register 1.A060 - 1.A061. The mirror is performed in H/W. */ - unsigned int temperature : 16; /* 1E.C820.F:0 RO */ - /* [F:0] of temperature - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Thermal Status */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C821.0 RO Temperature Ready - AQ_GlobalThermalStatus_APPIA.u1.bits_1.temperatureReady - - - - 1 = Temperature measurement is valid - - - Notes: - This is a mirror of the XENPAK register 1.A06E. */ - unsigned int temperatureReady : 1; /* 1E.C821.0 RO */ - /* 1 = Temperature measurement is valid - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalThermalStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global General Status: 1E.C830 */ -/* Global General Status: 1E.C830 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global General Status */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C830.E RO High Temperature Failure State - AQ_GlobalGeneralStatus_APPIA.u0.bits_0.highTemperatureFailureState - - - - 1 = High temperature failure threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A070.7 register. - - */ - unsigned int highTemperatureFailureState : 1; /* 1E.C830.E RO */ - /* 1 = High temperature failure threshold has been exceeded */ - /*! \brief 1E.C830.D RO Low Temperature Failure State - AQ_GlobalGeneralStatus_APPIA.u0.bits_0.lowTemperatureFailureState - - - - 1 = Low temperature failure threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A070.6 register. - - */ - unsigned int lowTemperatureFailureState : 1; /* 1E.C830.D RO */ - /* 1 = Low temperature failure threshold has been exceeded */ - /*! \brief 1E.C830.C RO High Temperature Warning State - AQ_GlobalGeneralStatus_APPIA.u0.bits_0.highTemperatureWarningState - - - - 1 = High temperature warning threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A074.7 register. - - */ - unsigned int highTemperatureWarningState : 1; /* 1E.C830.C RO */ - /* 1 = High temperature warning threshold has been exceeded */ - /*! \brief 1E.C830.B RO Low Temperature Warning State - AQ_GlobalGeneralStatus_APPIA.u0.bits_0.lowTemperatureWarningState - - - - 1 = Low temperature warning threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A074.6 register. - - */ - unsigned int lowTemperatureWarningState : 1; /* 1E.C830.B RO */ - /* 1 = Low temperature warning threshold has been exceeded */ - unsigned int reserved1 : 11; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global General Status */ - union - { - struct - { - /*! \brief 1E.C831.F RO Processor Intensive MDIO Operation In- Progress - AQ_GlobalGeneralStatus_APPIA.u1.bits_1.processorIntensiveMdioOperationIn_Progress - - - - 1 = PHY microprocessor is busy with a processor-intensive MDIO operation - 0 = Processor-intensive MDIO operation completed - - - Notes: - This bit should may be used with certain processor-intensive MDIO commands (such as Loopbacks, Test Modes, Low power modes, Tx-Disable, Restart autoneg, Cable Diagnostics, etc.) that take longer than an MDIO cycle to complete. Upon receiving an MDIO command that involves the PHY's microprocessor, this bit is set, and when the command is completed, this bit is cleared. - - NOTE!!! This bit should be checked only after 1 ms of issuing a processor-intensive MDIO operation. - - The list of operations that set this bit are as follows: - - 1.0.0, PMA Loopback - 1.0.B, Low power mode - 1.9.4:0, Tx Disable - 1.84, 10G Test modes - 1.8000.5, XENPAK Control - 1.9000, XENPAK Rx Fault Enable - 1.9002, XENPAK Alarm Enable - 1.E400.F, External loopback - 3.0.B, Low power mode - 3.0.E, System PCS loopback - 3.C471.5, PRBS Test - 3.C471.6, PRBS Test - 3.E471.5, PRBS Test - 3.E471.6, PRBS Test - 4.0.B, Low power mode - 4.0.E, PHY-XS network loopback - 4.C440, Output clock control, Load SERDES parameters - 4.F802.E, System loopback - 4.C444.F:B, Loopback Control - 4.C444.4:2, Packet generation - 4.C445.C, SERDES calibration - 7.0.9, Restart autonegotiation - 1D.C280, 1G/100M Network loopback - 1D.C500, 1G System loopback - 1D.C501, 1G / 100M Test modes */ - unsigned int processorIntensiveMdioOperationIn_Progress : 1; /* 1E.C831.F RO */ - /* 1 = PHY microprocessor is busy with a processor-intensive MDIO operation - 0 = Processor-intensive MDIO operation completed - */ - unsigned int reserved0 : 15; - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalGeneralStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Pin Status: 1E.C840 */ -/* Global Pin Status: 1E.C840 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Pin Status */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C840.E:D RO MDIO Boot Load [1:0] - AQ_GlobalPinStatus_APPIA.u0.bits_0.mdioBootLoad - - - - Value of MDIO Boot Load pins - - 0x3 = PHY #0 Slave Daisy Chain Boot - 0x2 = PHY #0 Master Daisy Chain Boot from Flash - 0x1 = MDIO Boot Load - 0x0 = Boot from Flash (PHY #0 only) - - - Notes: - NOTES: - - PHY #0 is the primary PHY, and PHY #1 is the secondary PHY - - PHY #1 is always in Slave Daisy Chain Boot from Flash when set to 0x2 or 0x3. */ - unsigned int mdioBootLoad : 2; /* 1E.C840.E:D RO */ - /* Value of MDIO Boot Load pins - - 0x3 = PHY #0 Slave Daisy Chain Boot - 0x2 = PHY #0 Master Daisy Chain Boot from Flash - 0x1 = MDIO Boot Load - 0x0 = Boot from Flash (PHY #0 only) - */ - unsigned int reserved1 : 3; - /*! \brief 1E.C840.9 RO Package Connectivity - AQ_GlobalPinStatus_APPIA.u0.bits_0.packageConnectivity - - - - Value of the package connection pin - - */ - unsigned int packageConnectivity : 1; /* 1E.C840.9 RO */ - /* Value of the package connection pin - */ - unsigned int reserved2 : 1; - /*! \brief 1E.C840.7 RO Tx Enable - AQ_GlobalPinStatus_APPIA.u0.bits_0.txEnable - - - - Current Value of Tx Enable pin - - - Notes: - 0 = Disable Transmitter */ - unsigned int txEnable : 1; /* 1E.C840.7 RO */ - /* Current Value of Tx Enable pin - */ - unsigned int reserved3 : 1; - /*! \brief 1E.C840.5:0 RO LED Pullup State [5:0] - AQ_GlobalPinStatus_APPIA.u0.bits_0.ledPullupState - - - - 1 = LED output pin is pulled high - 0 = LED output pin is pulled low - - */ - unsigned int ledPullupState : 6; /* 1E.C840.5:0 RO */ - /* 1 = LED output pin is pulled high - 0 = LED output pin is pulled low - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalPinStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Daisy Chain Status: 1E.C842 */ -/* Global Daisy Chain Status: 1E.C842 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Daisy Chain Status */ - union - { - struct - { - /*! \brief 1E.C842.F:0 RO Rx Daisy Chain Calculated CRC [F:0] - AQ_GlobalDaisyChainStatus_APPIA.u0.bits_0.rxDaisyChainCalculatedCrc - - - - Rx Daisy Chain Calculated CRC - - - Notes: - This is the calculated daisy chain CRC. */ - unsigned int rxDaisyChainCalculatedCrc : 16; /* 1E.C842.F:0 RO */ - /* Rx Daisy Chain Calculated CRC - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalDaisyChainStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Fault Message: 1E.C850 */ -/* Global Fault Message: 1E.C850 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Fault Message */ - union - { - struct - { - /*! \brief 1E.C850.F:0 RO Message [F:0] - AQ_GlobalFaultMessage_APPIA.u0.bits_0.message - - - - Error code describing fault - - Notes: - Code 0x8001: Firmware not compatible with chip architecture. This fault occurs when firmware compiled for a different Tensilica core is loaded. - Code 0x8002: VCO calibration failed. This occurs when the main PLLs on chip fail to lock: this is not possible to trigger. - Code 0x8003: XAUI calibration failed. This occurs when the XAUI PLLs fail to lock: this is not possible to trigger. - Code 0x8004: Failed to set operating voltages via PMBus. This only occurs when the processor has control over power supply voltage via an attached PMBus device and there is a protocol error on the I2C bus: this is not possible to trigger. - Code 0x8005: Unexpected device ID. This occurs if the device ID programmed into the internal E-Fuse registers in not valid: this is not possible to trigger. - Code 0x8006: Computed checksum does not match expected checksum. This occurs when the FLASH checksum check performed at boot time fails. This only occurs when the system boots from FLASH. - Code 0x8007: Detected a bit error in static memory. To trigger, corrupt one of the static regions. - Code 0xC001: Illegal Instruction exception. This occurs when the processor attempts to execute an illegal instruction. To trigger this, write an illegal instruction to program memory. It's possible that the bit error check will trigger before the illegal instruction is executed. - Code 0xC002 Instruction Fetch Error. Internal physical address or a data error during instruction fetch: this is not possible to trigger. - Code 0xC003 Load Store Error. Internal physical address or data error during load store operation: this is not possible to trigger.. - Code 0xC004 Privileged Instruction. Attempt to execute a privileged operation without sufficient privilege: this is not possible to trigger. - Code 0xC005 Unaligned Load or Store. Attempt to load or store data at an address which cannot be handled due to alignment: this is not possible to trigger. - Code 0xC006 Instruction fetch from prohibited space: this is not possible to trigger. - Code 0xC007 Data load from prohibited space: this is not possible to trigger. - Code 0xC008 Data store into prohibited space: this is not possible to trigger. */ - unsigned int message : 16; /* 1E.C850.F:0 RO */ - /* Error code describing fault */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalFaultMessage_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Primary Status: 1E.C851 */ -/* Global Primary Status: 1E.C851 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Primary Status */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C851.0 RO Primary Status - AQ_GlobalPrimaryStatus_APPIA.u0.bits_0.primaryStatus - - - - 1 = PHY is the primary PHY - 0 = PHY is is secondary PHY - - */ - unsigned int primaryStatus : 1; /* 1E.C851.0 RO */ - /* 1 = PHY is the primary PHY - 0 = PHY is is secondary PHY - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalPrimaryStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Cable Diagnostic Impedance: 1E.C880 */ -/* Global Cable Diagnostic Impedance: 1E.C880 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C880.F RO Reserved 1 - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.reserved_1 - - - - Reserved for future use - - */ - unsigned int reserved_1 : 1; /* 1E.C880.F RO */ - /* Reserved for future use - */ - /*! \brief 1E.C880.E:C RO Pair A Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.pairAReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_1 : 3; /* 1E.C880.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.B RO Reserved 2 - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.reserved_2 - - - - Reserved for future use - - */ - unsigned int reserved_2 : 1; /* 1E.C880.B RO */ - /* Reserved for future use - */ - /*! \brief 1E.C880.A:8 RO Pair A Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.pairAReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_2 : 3; /* 1E.C880.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.7 RO Reserved 3 - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.reserved_3 - - - - Reserved for future use - - */ - unsigned int reserved_3 : 1; /* 1E.C880.7 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C880.6:4 RO Pair A Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.pairAReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_3 : 3; /* 1E.C880.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.3 RO Reserved 4 - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.reserved_4 - - - - Reserved for future use - - */ - unsigned int reserved_4 : 1; /* 1E.C880.3 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C880.2:0 RO Pair A Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u0.bits_0.pairAReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_4 : 3; /* 1E.C880.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C881.F RO Reserved 5 - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.reserved_5 - - - - Reserved for future use - - */ - unsigned int reserved_5 : 1; /* 1E.C881.F RO */ - /* Reserved for future use - */ - /*! \brief 1E.C881.E:C RO Pair B Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.pairBReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_1 : 3; /* 1E.C881.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.B RO Reserved 6 - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.reserved_6 - - - - Reserved for future use - - */ - unsigned int reserved_6 : 1; /* 1E.C881.B RO */ - /* Reserved for future use - */ - /*! \brief 1E.C881.A:8 RO Pair B Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.pairBReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_2 : 3; /* 1E.C881.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.7 RO Reserved 7 - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.reserved_7 - - - - Reserved for future use - - */ - unsigned int reserved_7 : 1; /* 1E.C881.7 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C881.6:4 RO Pair B Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.pairBReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_3 : 3; /* 1E.C881.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.3 RO Reserved 8 - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.reserved_8 - - - - Reserved for future use - - */ - unsigned int reserved_8 : 1; /* 1E.C881.3 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C881.2:0 RO Pair B Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u1.bits_1.pairBReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_4 : 3; /* 1E.C881.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C882.F RO Reserved 9 - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.reserved_9 - - - - Reserved for future use - - */ - unsigned int reserved_9 : 1; /* 1E.C882.F RO */ - /* Reserved for future use - */ - /*! \brief 1E.C882.E:C RO Pair C Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.pairCReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_1 : 3; /* 1E.C882.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.B RO Reserved 10 - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.reserved_10 - - - - Reserved for future use - - */ - unsigned int reserved_10 : 1; /* 1E.C882.B RO */ - /* Reserved for future use - */ - /*! \brief 1E.C882.A:8 RO Pair C Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.pairCReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_2 : 3; /* 1E.C882.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.7 RO Reserved 11 - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.reserved_11 - - - - Reserved for future use - - */ - unsigned int reserved_11 : 1; /* 1E.C882.7 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C882.6:4 RO Pair C Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.pairCReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_3 : 3; /* 1E.C882.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.3 RO Reserved 12 - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.reserved_12 - - - - Reserved for future use - - */ - unsigned int reserved_12 : 1; /* 1E.C882.3 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C882.2:0 RO Pair C Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u2.bits_2.pairCReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_4 : 3; /* 1E.C882.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C883.F RO Reserved 13 - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.reserved_13 - - - - Reserved for future use - - */ - unsigned int reserved_13 : 1; /* 1E.C883.F RO */ - /* Reserved for future use - */ - /*! \brief 1E.C883.E:C RO Pair D Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.pairDReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_1 : 3; /* 1E.C883.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.B RO Reserved 14 - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.reserved_14 - - - - Reserved for future use - - */ - unsigned int reserved_14 : 1; /* 1E.C883.B RO */ - /* Reserved for future use - */ - /*! \brief 1E.C883.A:8 RO Pair D Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.pairDReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_2 : 3; /* 1E.C883.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.7 RO Reserved 15 - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.reserved_15 - - - - Reserved for future use - - */ - unsigned int reserved_15 : 1; /* 1E.C883.7 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C883.6:4 RO Pair D Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.pairDReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_3 : 3; /* 1E.C883.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.3 RO Reserved 16 - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.reserved_16 - - - - Reserved for future use - - */ - unsigned int reserved_16 : 1; /* 1E.C883.3 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C883.2:0 RO Pair D Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_APPIA.u3.bits_3.pairDReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_4 : 3; /* 1E.C883.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_GlobalCableDiagnosticImpedance_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Status: 1E.C884 */ -/* Global Status: 1E.C884 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Status */ - union - { - struct - { - /*! \brief 1E.C884.F:8 RO Reserved Status 0 [7:0] - AQ_GlobalStatus_APPIA.u0.bits_0.reservedStatus_0 - - - - Reserved for future use - - */ - unsigned int reservedStatus_0 : 8; /* 1E.C884.F:8 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C884.7:0 RO Cable Length [7:0] - AQ_GlobalStatus_APPIA.u0.bits_0.cableLength - - - - The estimated length of the cable in meters - - - Notes: - The length of the cable shown here is estimated from the cable diagnostic engine and should be accurate to +/-1m. */ - unsigned int cableLength : 8; /* 1E.C884.7:0 RO */ - /* The estimated length of the cable in meters - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reserved Status: 1E.C885 */ -/* Global Reserved Status: 1E.C885 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C885.F:A RO Nearly Seconds MSW[5:0] - AQ_GlobalReservedStatus_APPIA.u0.bits_0.nearlySecondsMSW - - - - Bits 16 to 21 of the 22 bit "Nearly Seconds" uptime counter. - - - Notes: - The "Nearly Seconds" counter is incremented every 1024 milliseconds. */ - unsigned int nearlySecondsMSW : 6; /* 1E.C885.F:A RO */ - /* Bits 16 to 21 of the 22 bit "Nearly Seconds" uptime counter. - */ - /*! \brief 1E.C885.9:8 ROSPD XENPAK NVR Status [1:0] - AQ_GlobalReservedStatus_APPIA.u0.bits_0.xenpakNvrStatus - - Provisionable Default = 0x0 - - Status of XENPAK NVR: - 0: NVR not enabled - 1: Last NVR operation succeeded - 2: Last NVR operation failed - 3: Reserved - - - Notes: - XENPAK register space is mirrored in NVR (SPI ROM). This register indicates the status of the last NVR operation. */ - unsigned int xenpakNvrStatus : 2; /* 1E.C885.9:8 ROSPD Provisionable Default = 0x0 */ - /* Status of XENPAK NVR: - 0: NVR not enabled - 1: Last NVR operation succeeded - 2: Last NVR operation failed - 3: Reserved - */ - /*! \brief 1E.C885.7:0 ROSPD ROM Revision [7:0] - AQ_GlobalReservedStatus_APPIA.u0.bits_0.romRevision - - Provisionable Default = 0x00 - - ROM Revision Number - - - Notes: - Customers may receive multiple ROM images that differ only in their provisioning. This field is used to differentiate those images. This field is used in conjunction with the firmware major and minor revision numbers to uniquely identify ROM images. */ - unsigned int romRevision : 8; /* 1E.C885.7:0 ROSPD Provisionable Default = 0x00 */ - /* ROM Revision Number - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C886.F:0 RO Nearly Seconds LSW[F:0] - AQ_GlobalReservedStatus_APPIA.u1.bits_1.nearlySecondsLSW - - - - Bits 0 to 15 of the 22 bit "Nearly Seconds" uptime counter. - - - Notes: - The "Nearly Seconds" counter is incremented every 1024 milliseconds. */ - unsigned int nearlySecondsLSW : 16; /* 1E.C886.F:0 RO */ - /* Bits 0 to 15 of the 22 bit "Nearly Seconds" uptime counter. - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalReservedStatus_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Alarms: 1E.CC00 */ -/* Global Alarms: 1E.CC00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Alarms */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.CC00.E LH High Temperature Failure - AQ_GlobalAlarms_APPIA.u0.bits_0.highTemperatureFailure - - - - 1 = High temperature failure threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int highTemperatureFailure : 1; /* 1E.CC00.E LH */ - /* 1 = High temperature failure threshold has been exceeded - */ - /*! \brief 1E.CC00.D LH Low Temperature Failure - AQ_GlobalAlarms_APPIA.u0.bits_0.lowTemperatureFailure - - - - 1 = Low temperature failure threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int lowTemperatureFailure : 1; /* 1E.CC00.D LH */ - /* 1 = Low temperature failure threshold has been exceeded - */ - /*! \brief 1E.CC00.C LH High Temperature Warning - AQ_GlobalAlarms_APPIA.u0.bits_0.highTemperatureWarning - - - - 1 = High temperature warning threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int highTemperatureWarning : 1; /* 1E.CC00.C LH */ - /* 1 = High temperature warning threshold has been exceeded - */ - /*! \brief 1E.CC00.B LH Low Temperature Warning - AQ_GlobalAlarms_APPIA.u0.bits_0.lowTemperatureWarning - - - - 1 = Low temperature warning threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int lowTemperatureWarning : 1; /* 1E.CC00.B LH */ - /* 1 = Low temperature warning threshold has been exceeded - */ - unsigned int reserved1 : 4; - /*! \brief 1E.CC00.6 LH Reset completed - AQ_GlobalAlarms_APPIA.u0.bits_0.resetCompleted - - - - 1 = Chip wide reset completed - - Notes: - This bit is set by the microprocessor when it has completed it's initialization sequence. This bit is mirrored in 1.CC02.0 */ - unsigned int resetCompleted : 1; /* 1E.CC00.6 LH */ - /* 1 = Chip wide reset completed */ - unsigned int reserved2 : 1; - /*! \brief 1E.CC00.4 LH Device Fault - AQ_GlobalAlarms_APPIA.u0.bits_0.deviceFault - - - - 1 = Fault - - Notes: - When set, a fault has been detected by the uP and the associated 16 bit error code is visible in See Global Configuration Fault Message: Address 1E.C850 */ - unsigned int deviceFault : 1; /* 1E.CC00.4 LH */ - /* 1 = Fault */ - /*! \brief 1E.CC00.3 LH Reserved Alarm A - AQ_GlobalAlarms_APPIA.u0.bits_0.reservedAlarmA - - - - Reserved for future use - - */ - unsigned int reservedAlarmA : 1; /* 1E.CC00.3 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.2 LH Reserved Alarm B - AQ_GlobalAlarms_APPIA.u0.bits_0.reservedAlarmB - - - - Reserved for future use - - */ - unsigned int reservedAlarmB : 1; /* 1E.CC00.2 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.1 LH Reserved Alarm C - AQ_GlobalAlarms_APPIA.u0.bits_0.reservedAlarmC - - - - Reserved for future use - - */ - unsigned int reservedAlarmC : 1; /* 1E.CC00.1 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.0 LH Reserved Alarm D - AQ_GlobalAlarms_APPIA.u0.bits_0.reservedAlarmD - - - - Reserved for future use - - */ - unsigned int reservedAlarmD : 1; /* 1E.CC00.0 LH */ - /* Reserved for future use - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Alarms */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.CC01.E LH Smart Power-Down Entered - AQ_GlobalAlarms_APPIA.u1.bits_1.smartPower_downEntered - - - - 1 = Smart Power-Down State Entered - - - Notes: - When this bit is set, it indicates that the Smart Power-Down state was entered */ - unsigned int smartPower_downEntered : 1; /* 1E.CC01.E LH */ - /* 1 = Smart Power-Down State Entered - */ - /*! \brief 1E.CC01.D RO XENPAK Alarm - AQ_GlobalAlarms_APPIA.u1.bits_1.xenpakAlarm - - - - 1 = XENPAK Alarm - - - Notes: - This alarm is performed by H/W. */ - unsigned int xenpakAlarm : 1; /* 1E.CC01.D RO */ - /* 1 = XENPAK Alarm - */ - /*! \brief 1E.CC01.C:8 LH Reserved Alarms [4:0] - AQ_GlobalAlarms_APPIA.u1.bits_1.reservedAlarms - - - - Reserved for future use - - */ - unsigned int reservedAlarms : 5; /* 1E.CC01.C:8 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC01.7 LH MDIO Command Handling Overflow - AQ_GlobalAlarms_APPIA.u1.bits_1.mdioCommandHandlingOverflow - - - - 1 = PHY was issued more MDIO requests than it could service in it's request buffer - - - Notes: - Assertion of this bit means that more MDIO commands were issued than FW could handle. */ - unsigned int mdioCommandHandlingOverflow : 1; /* 1E.CC01.7 LH */ - /* 1 = PHY was issued more MDIO requests than it could service in it's request buffer - */ - unsigned int reserved1 : 6; - /*! \brief 1E.CC01.0 LH Diagnostic Alarm - AQ_GlobalAlarms_APPIA.u1.bits_1.diagnosticAlarm - - - - 1 = Alarm triggered by a write to 1E.C470.7 - - - Notes: - A diagnostic alarm use to test system alarm circuitry */ - unsigned int diagnosticAlarm : 1; /* 1E.CC01.0 LH */ - /* 1 = Alarm triggered by a write to 1E.C470.7 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Alarms */ - union - { - struct - { - /*! \brief 1E.CC02.F LH NVR Operation Complete - AQ_GlobalAlarms_APPIA.u2.bits_2.nvrOperationComplete - - - - 1 = NVR operation is complete - - - Notes: - NVR interface is ready interrupt for registers See Global NVR Interface 1: Address 1E.100 - See Global NVR Provisioning Data MSW - Address 1E.17 . */ - unsigned int nvrOperationComplete : 1; /* 1E.CC02.F LH */ - /* 1 = NVR operation is complete - */ - /*! \brief 1E.CC02.E LH Mailbox Operation: Complete - AQ_GlobalAlarms_APPIA.u2.bits_2.mailboxOperation_Complete - - - - 1 = Mailbox operation is complete - - - Notes: - Mailbox interface is ready interrupt for registers See Global Vendor Specific Control - Address 1E.C000 - See Global Vendor Specific Provisioning 5 - Address 1E.C404 */ - unsigned int mailboxOperation_Complete : 1; /* 1E.CC02.E LH */ - /* 1 = Mailbox operation is complete - */ - unsigned int reserved0 : 3; - /*! \brief 1E.CC02.A LH uP DRAM Parity Error - AQ_GlobalAlarms_APPIA.u2.bits_2.upDramParityError - - - - 1 = Parity error detected in the uP DRAM - - */ - unsigned int upDramParityError : 1; /* 1E.CC02.A LH */ - /* 1 = Parity error detected in the uP DRAM - */ - /*! \brief 1E.CC02.9:8 LH uP IRAM Parity Error [1:0] - AQ_GlobalAlarms_APPIA.u2.bits_2.upIramParityError - - - - 1 = Parity error detected in the uP IRAM - - - Notes: - Bit 0 indicates a parity error was detected in the uP IRAM but was corrected. - Bit 1 indicates a multiple parity errors were detected in the uP IRAM and could not be corrected. - The uP IRAM is protected with ECC. */ - unsigned int upIramParityError : 2; /* 1E.CC02.9:8 LH */ - /* 1 = Parity error detected in the uP IRAM - */ - unsigned int reserved1 : 2; - /*! \brief 1E.CC02.5 LRF Tx Enable State Change - AQ_GlobalAlarms_APPIA.u2.bits_2.txEnableStateChange - - - - 1 = TX_EN pin has changed state - - */ - unsigned int txEnableStateChange : 1; /* 1E.CC02.5 LRF */ - /* 1 = TX_EN pin has changed state - */ - unsigned int reserved2 : 2; - /*! \brief 1E.CC02.2 LH MDIO MMD Error - AQ_GlobalAlarms_APPIA.u2.bits_2.mdioMMD_Error - - - - 1 = Invalid MMD address detected - - */ - unsigned int mdioMMD_Error : 1; /* 1E.CC02.2 LH */ - /* 1 = Invalid MMD address detected - */ - /*! \brief 1E.CC02.1 LH MDIO Timeout Error - AQ_GlobalAlarms_APPIA.u2.bits_2.mdioTimeoutError - - - - 1 = MDIO timeout detected - - */ - unsigned int mdioTimeoutError : 1; /* 1E.CC02.1 LH */ - /* 1 = MDIO timeout detected - */ - /*! \brief 1E.CC02.0 LH Watchdog Timer Alarm - AQ_GlobalAlarms_APPIA.u2.bits_2.watchdogTimerAlarm - - - - 1 = Watchdog timer alarm - - */ - unsigned int watchdogTimerAlarm : 1; /* 1E.CC02.0 LH */ - /* 1 = Watchdog timer alarm - */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalAlarms_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Mask: 1E.D400 */ -/* Global Interrupt Mask: 1E.D400 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Mask */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.D400.E R/WPD High Temperature Failure Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.highTemperatureFailureMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int highTemperatureFailureMask : 1; /* 1E.D400.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.D R/WPD Low Temperature Failure Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.lowTemperatureFailureMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int lowTemperatureFailureMask : 1; /* 1E.D400.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.C R/WPD High Temperature Warning Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.highTemperatureWarningMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int highTemperatureWarningMask : 1; /* 1E.D400.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.B R/WPD Low Temperature Warning Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.lowTemperatureWarningMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int lowTemperatureWarningMask : 1; /* 1E.D400.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved1 : 4; - /*! \brief 1E.D400.6 R/WPD Reset completed Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.resetCompletedMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int resetCompletedMask : 1; /* 1E.D400.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved2 : 1; - /*! \brief 1E.D400.4 R/WPD Device Fault Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.deviceFaultMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int deviceFaultMask : 1; /* 1E.D400.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.3 R/WPD Reserved Alarm A Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.reservedAlarmAMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmAMask : 1; /* 1E.D400.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.2 R/WPD Reserved Alarm B Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.reservedAlarmBMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmBMask : 1; /* 1E.D400.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.1 R/WPD Reserved Alarm C Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.reservedAlarmCMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmCMask : 1; /* 1E.D400.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.0 R/WPD Reserved Alarm D Mask - AQ_GlobalInterruptMask_APPIA.u0.bits_0.reservedAlarmDMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmDMask : 1; /* 1E.D400.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Interrupt Mask */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.D401.E R/WPD Smart Power-Down Entered Mask - AQ_GlobalInterruptMask_APPIA.u1.bits_1.smartPower_downEnteredMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int smartPower_downEnteredMask : 1; /* 1E.D401.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.D R/WPD XENPAK Alarm Mask - AQ_GlobalInterruptMask_APPIA.u1.bits_1.xenpakAlarmMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int xenpakAlarmMask : 1; /* 1E.D401.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D401.C:8 R/WPD Reserved Alarms Mask [4:0] - AQ_GlobalInterruptMask_APPIA.u1.bits_1.reservedAlarmsMask - - Provisionable Default = 0x00 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmsMask : 5; /* 1E.D401.C:8 R/WPD Provisionable Default = 0x00 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.7 R/WPD MDIO Command Handling Overflow Mask - AQ_GlobalInterruptMask_APPIA.u1.bits_1.mdioCommandHandlingOverflowMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int mdioCommandHandlingOverflowMask : 1; /* 1E.D401.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved1 : 6; - /*! \brief 1E.D401.0 R/WPD Diagnostic Alarm Mask - AQ_GlobalInterruptMask_APPIA.u1.bits_1.diagnosticAlarmMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int diagnosticAlarmMask : 1; /* 1E.D401.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Interrupt Mask */ - union - { - struct - { - /*! \brief 1E.D402.F R/WPD NVR Operation Complete Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.nvrOperationCompleteMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - Notes: - NVR interface is ready interrupt for registers See Global NVR Interface 1: Address 1E.100 - See Global NVR Provisioning Data MSW - Address 1E.17 */ - unsigned int nvrOperationCompleteMask : 1; /* 1E.D402.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.E R/WPD Mailbox Operation Complete Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.mailboxOperationCompleteMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - Notes: - Mailbox interface is ready interrupt for registers See Global Vendor Specific Control - Address 1E.C000 - See Global Vendor Specific Provisioning 5 - Address 1E.C404 */ - unsigned int mailboxOperationCompleteMask : 1; /* 1E.D402.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 3; - /*! \brief 1E.D402.A R/WPD uP DRAM Parity Error Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.upDramParityErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int upDramParityErrorMask : 1; /* 1E.D402.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D402.9:8 R/WPD uP IRAM Parity Error Mask [1:0] - AQ_GlobalInterruptMask_APPIA.u2.bits_2.upIramParityErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int upIramParityErrorMask : 2; /* 1E.D402.9:8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved1 : 2; - /*! \brief 1E.D402.5 R/WPD Tx Enable State Change Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.txEnableStateChangeMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int txEnableStateChangeMask : 1; /* 1E.D402.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved2 : 2; - /*! \brief 1E.D402.2 R/WPD MDIO MMD Error Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.mdioMMD_ErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int mdioMMD_ErrorMask : 1; /* 1E.D402.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.1 R/WPD MDIO Timeout Error Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.mdioTimeoutErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int mdioTimeoutErrorMask : 1; /* 1E.D402.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.0 R/WPD Watchdog Timer Alarm Mask - AQ_GlobalInterruptMask_APPIA.u2.bits_2.watchdogTimerAlarmMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int watchdogTimerAlarmMask : 1; /* 1E.D402.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalInterruptMask_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip-Wide Standard Interrupt Flags: 1E.FC00 */ -/* Global Chip-Wide Standard Interrupt Flags: 1E.FC00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip-Wide Standard Interrupt Flags */ - union - { - struct - { - /*! \brief 1E.FC00.F RO PMA Standard Alarm 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pmaStandardAlarm_1Interrupt - - - - 1 = Interrupt in PMA standard alarms 1 - - - Notes: - An interrupt was generated from bit 1.1.2. - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int pmaStandardAlarm_1Interrupt : 1; /* 1E.FC00.F RO */ - /* 1 = Interrupt in PMA standard alarms 1 - */ - /*! \brief 1E.FC00.E RO PMA Standard Alarm 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pmaStandardAlarm_2Interrupt - - - - 1 = Interrupt in PMA standard alarms 2 - - - Notes: - An interrupt was generated from either bit 1.8.B or 1.8.A. - An interrupt was generated from status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int pmaStandardAlarm_2Interrupt : 1; /* 1E.FC00.E RO */ - /* 1 = Interrupt in PMA standard alarms 2 - */ - /*! \brief 1E.FC00.D RO PCS Standard Alarm 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pcsStandardAlarm_1Interrupt - - - - 1 = Interrupt in PCS standard alarms 1 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int pcsStandardAlarm_1Interrupt : 1; /* 1E.FC00.D RO */ - /* 1 = Interrupt in PCS standard alarms 1 - */ - /*! \brief 1E.FC00.C RO PCS Standard Alarm 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pcsStandardAlarm_2Interrupt - - - - 1 = Interrupt in PCS standard alarms 2 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int pcsStandardAlarm_2Interrupt : 1; /* 1E.FC00.C RO */ - /* 1 = Interrupt in PCS standard alarms 2 - */ - /*! \brief 1E.FC00.B RO PCS Standard Alarm 3 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.pcsStandardAlarm_3Interrupt - - - - 1 = Interrupt in PCS standard alarms 3 - - - Notes: - An interrupt was generated from status register ( See PCS 10GBASE-T Status 2 - Address 3.21 ) and the corresponding mask register. ( See PCS Standard Interrupt Mask 1 - Address 3.E021 ) */ - unsigned int pcsStandardAlarm_3Interrupt : 1; /* 1E.FC00.B RO */ - /* 1 = Interrupt in PCS standard alarms 3 - */ - /*! \brief 1E.FC00.A RO PHY XS Standard Alarms 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.phyXS_StandardAlarms_1Interrupt - - - - 1 = Interrupt in PHY XS standard alarms 1 - - - Notes: - An interrupt was generated from the status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int phyXS_StandardAlarms_1Interrupt : 1; /* 1E.FC00.A RO */ - /* 1 = Interrupt in PHY XS standard alarms 1 - */ - /*! \brief 1E.FC00.9 RO PHY XS Standard Alarms 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.phyXS_StandardAlarms_2Interrupt - - - - 1 = Interrupt in PHY XS standard alarms 2 - - - Notes: - An interrupt was generated from the status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int phyXS_StandardAlarms_2Interrupt : 1; /* 1E.FC00.9 RO */ - /* 1 = Interrupt in PHY XS standard alarms 2 - */ - /*! \brief 1E.FC00.8 RO Autonegotiation Standard Alarms 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.autonegotiationStandardAlarms_1Interrupt - - - - 1 = Interrupt in Autonegotiation standard alarms 1 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See Autonegotiation Standard LASI Interrupt Mask 1: Address 7.D000 ) */ - unsigned int autonegotiationStandardAlarms_1Interrupt : 1; /* 1E.FC00.8 RO */ - /* 1 = Interrupt in Autonegotiation standard alarms 1 - */ - /*! \brief 1E.FC00.7 RO Autonegotiation Standard Alarms 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.autonegotiationStandardAlarms_2Interrupt - - - - 1 = Interrupt in Autonegotiation standard alarms 2 - - - Notes: - An interrupt was generated from status register ( See Autonegotiation 10GBASE-T Status Register - Address 7.21 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int autonegotiationStandardAlarms_2Interrupt : 1; /* 1E.FC00.7 RO */ - /* 1 = Interrupt in Autonegotiation standard alarms 2 - */ - /*! \brief 1E.FC00.6 RO GbE Standard Alarms Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.gbeStandardAlarmsInterrupt - - - - 1 = Interrupt in GbE standard alarms - - - Notes: - An interrupt was generated from the TGE core. */ - unsigned int gbeStandardAlarmsInterrupt : 1; /* 1E.FC00.6 RO */ - /* 1 = Interrupt in GbE standard alarms - */ - unsigned int reserved0 : 5; - /*! \brief 1E.FC00.0 RO All Vendor Alarms Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_APPIA.u0.bits_0.allVendorAlarmsInterrupt - - - - 1 = Interrupt in all vendor alarms - - - Notes: - An interrupt was generated from status register ( See Global Chip-Wide LASI Vendor Interrupt Flags: Address 1E.FC01 ) and the corresponding mask register. ( See Global Interrupt LASI Mask: Address 1E.FF01 ) */ - unsigned int allVendorAlarmsInterrupt : 1; /* 1E.FC00.0 RO */ - /* 1 = Interrupt in all vendor alarms - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChip_wideStandardInterruptFlags_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip-Wide Vendor Interrupt Flags: 1E.FC01 */ -/* Global Chip-Wide Vendor Interrupt Flags: 1E.FC01 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip-Wide Vendor Interrupt Flags */ - union - { - struct - { - /*! \brief 1E.FC01.F RO PMA Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.pmaVendorAlarmInterrupt - - - - 1 = Interrupt in PMA vendor specific alarm - - - Notes: - A PMA alarm was generated. ( See PHY XS Vendor Global Interrupt Flags 1- Address 4.F800 ) */ - unsigned int pmaVendorAlarmInterrupt : 1; /* 1E.FC01.F RO */ - /* 1 = Interrupt in PMA vendor specific alarm - */ - /*! \brief 1E.FC01.E RO PCS Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.pcsVendorAlarmInterrupt - - - - 1 = Interrupt in PCS vendor specific alarm - - - Notes: - A PCS alarm was generated. ( See PHY XS Vendor Global Interrupt Flags 1- Address 4.F800 ) */ - unsigned int pcsVendorAlarmInterrupt : 1; /* 1E.FC01.E RO */ - /* 1 = Interrupt in PCS vendor specific alarm - */ - /*! \brief 1E.FC01.D RO PHY XS Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.phyXS_VendorAlarmInterrupt - - - - 1 = Interrupt in PHY XS vendor specific alarm - - - Notes: - A PHY XS alarm was generated. ( See PHY XS Vendor Global LASI Interrupt Flags 1: Address 4.FC00 ) */ - unsigned int phyXS_VendorAlarmInterrupt : 1; /* 1E.FC01.D RO */ - /* 1 = Interrupt in PHY XS vendor specific alarm - */ - /*! \brief 1E.FC01.C RO Autonegotiation Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.autonegotiationVendorAlarmInterrupt - - - - 1 = Interrupt in Autonegotiation vendor specific alarm - - - Notes: - An Autonegotiation alarm was generated. ( See Autonegotiation Vendor Global LASI Interrupt Flags 1: Address 7.FC00 ) */ - unsigned int autonegotiationVendorAlarmInterrupt : 1; /* 1E.FC01.C RO */ - /* 1 = Interrupt in Autonegotiation vendor specific alarm - */ - /*! \brief 1E.FC01.B RO GbE Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.gbeVendorAlarmInterrupt - - - - 1 = Interrupt in GbE vendor specific alarm - - - Notes: - A GbE alarm was generated. ( See GbE PHY Vendor Global LASI Interrupt Flags 1: Address 1D.FC00 ) */ - unsigned int gbeVendorAlarmInterrupt : 1; /* 1E.FC01.B RO */ - /* 1 = Interrupt in GbE vendor specific alarm - */ - unsigned int reserved0 : 8; - /*! \brief 1E.FC01.2 RO Global Alarms 1 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.globalAlarms_1Interrupt - - - - 1 = Interrupt in Global alarms 1 - - - Notes: - An interrupt was generated from status register ( See Global Vendor Alarms 1 - Address 1E.CC00 ) and the corresponding mask register. ( See Global Vendor Interrupt Mask - Address 1E.D400 ) */ - unsigned int globalAlarms_1Interrupt : 1; /* 1E.FC01.2 RO */ - /* 1 = Interrupt in Global alarms 1 - */ - /*! \brief 1E.FC01.1 RO Global Alarms 2 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.globalAlarms_2Interrupt - - - - 1 = Interrupt in Global alarms 2 - - - Notes: - An interrupt was generated from status register ( See Global Alarms 2: Address 1E.CC01 ) and the corresponding mask register. ( See Global LASI Interrupt Mask 2: Address 1E.D401 ) */ - unsigned int globalAlarms_2Interrupt : 1; /* 1E.FC01.1 RO */ - /* 1 = Interrupt in Global alarms 2 - */ - /*! \brief 1E.FC01.0 RO Global Alarms 3 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_APPIA.u0.bits_0.globalAlarms_3Interrupt - - - - 1 = Interrupt in Global alarms 3 - - - Notes: - An interrupt was generated from status register ( See Global Vendor Alarms 2: Address 1E.CC01 ) and the corresponding mask register. ( See Global LASI Interrupt Mask 2: Address 1E.D401 ) */ - unsigned int globalAlarms_3Interrupt : 1; /* 1E.FC01.0 RO */ - /* 1 = Interrupt in Global alarms 3 - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChip_wideVendorInterruptFlags_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Chip-Wide Standard Mask: 1E.FF00 */ -/* Global Interrupt Chip-Wide Standard Mask: 1E.FF00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Chip-Wide Standard Mask */ - union - { - struct - { - /*! \brief 1E.FF00.F R/WPD PMA Standard Alarm 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pmaStandardAlarm_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaStandardAlarm_1InterruptMask : 1; /* 1E.FF00.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.E R/WPD PMA Standard Alarm 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pmaStandardAlarm_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaStandardAlarm_2InterruptMask : 1; /* 1E.FF00.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.D R/WPD PCS Standard Alarm 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pcsStandardAlarm_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_1InterruptMask : 1; /* 1E.FF00.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.C R/WPD PCS Standard Alarm 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pcsStandardAlarm_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_2InterruptMask : 1; /* 1E.FF00.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.B R/WPD PCS Standard Alarm 3 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.pcsStandardAlarm_3InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_3InterruptMask : 1; /* 1E.FF00.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.A R/WPD PHY XS Standard Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.phyXS_StandardAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_StandardAlarms_1InterruptMask : 1; /* 1E.FF00.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.9 R/WPD PHY XS Standard Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.phyXS_StandardAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_StandardAlarms_2InterruptMask : 1; /* 1E.FF00.9 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.8 R/WPD Autonegotiation Standard Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.autonegotiationStandardAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationStandardAlarms_1InterruptMask : 1; /* 1E.FF00.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.7 R/WPD Autonegotiation Standard Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.autonegotiationStandardAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationStandardAlarms_2InterruptMask : 1; /* 1E.FF00.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.6 R/WPD Gbe Standard Alarms Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.gbeStandardAlarmsInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int gbeStandardAlarmsInterruptMask : 1; /* 1E.FF00.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 5; - /*! \brief 1E.FF00.0 R/WPD All Vendor Alarms Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_APPIA.u0.bits_0.allVendorAlarmsInterruptMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int allVendorAlarmsInterruptMask : 1; /* 1E.FF00.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalInterruptChip_wideStandardMask_APPIA; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Chip-Wide Vendor Mask: 1E.FF01 */ -/* Global Interrupt Chip-Wide Vendor Mask: 1E.FF01 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Chip-Wide Vendor Mask */ - union - { - struct - { - /*! \brief 1E.FF01.F R/WPD PMA Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.pmaVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaVendorAlarmInterruptMask : 1; /* 1E.FF01.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.E R/WPD PCS Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.pcsVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsVendorAlarmInterruptMask : 1; /* 1E.FF01.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.D R/WPD PHY XS Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.phyXS_VendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_VendorAlarmInterruptMask : 1; /* 1E.FF01.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.C R/WPD Autonegotiation Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.autonegotiationVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationVendorAlarmInterruptMask : 1; /* 1E.FF01.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.B R/WPD GbE Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.gbeVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int gbeVendorAlarmInterruptMask : 1; /* 1E.FF01.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 8; - /*! \brief 1E.FF01.2 R/WPD Global Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.globalAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_1InterruptMask : 1; /* 1E.FF01.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.1 R/WPD Global Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.globalAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_2InterruptMask : 1; /* 1E.FF01.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.0 R/WPD Global Alarms 3 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_APPIA.u0.bits_0.globalAlarms_3InterruptMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_3InterruptMask : 1; /* 1E.FF01.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalInterruptChip_wideVendorMask_APPIA; - -#endif -/*@}*/ -/*@}*/ diff --git a/feeds/ipq807x/aq-fw-download/src/include/registerMap/AQ_RegGroupMaxSizes.h b/feeds/ipq807x/aq-fw-download/src/include/registerMap/AQ_RegGroupMaxSizes.h deleted file mode 100755 index 08e255860..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/registerMap/AQ_RegGroupMaxSizes.h +++ /dev/null @@ -1,387 +0,0 @@ -/* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -#ifndef AQ_REG_GROUP_MAX_SIZES -#define AQ_REG_GROUP_MAX_SIZES - -#define AQ_Autonegotiation10GBaseT_ControlRegister_BiggestVersion AQ_Autonegotiation10GBaseT_ControlRegister_HHD -#define AQ_Autonegotiation10GBaseT_StatusRegister_BiggestVersion AQ_Autonegotiation10GBaseT_StatusRegister_HHD -#define AQ_AutonegotiationAdvertisementRegister_BiggestVersion AQ_AutonegotiationAdvertisementRegister_HHD -#define AQ_AutonegotiationEeeAdvertisementRegister_BiggestVersion AQ_AutonegotiationEeeAdvertisementRegister_HHD -#define AQ_AutonegotiationEeeLinkPartnerAbilityRegister_BiggestVersion AQ_AutonegotiationEeeLinkPartnerAbilityRegister_HHD -#define AQ_AutonegotiationExtendedNextPageTransmitRegister_BiggestVersion AQ_AutonegotiationExtendedNextPageTransmitRegister_HHD -#define AQ_AutonegotiationExtendedNextPageUnformattedCodeRegister_BiggestVersion AQ_AutonegotiationExtendedNextPageUnformattedCodeRegister_HHD -#define AQ_AutonegotiationLinkPartnerBasePageAbilityRegister_BiggestVersion AQ_AutonegotiationLinkPartnerBasePageAbilityRegister_HHD -#define AQ_AutonegotiationLinkPartnerExtendedNextPageAbilityRegister_BiggestVersion AQ_AutonegotiationLinkPartnerExtendedNextPageAbilityRegister_HHD -#define AQ_AutonegotiationLinkPartnerExtendedNextPageUnformattedCodeRegister_BiggestVersion AQ_AutonegotiationLinkPartnerExtendedNextPageUnformattedCodeRegister_HHD -#define AQ_AutonegotiationReceiveLinkPartnerStatus_BiggestVersion AQ_AutonegotiationReceiveLinkPartnerStatus_HHD -#define AQ_AutonegotiationReceiveReservedVendorProvisioning_BiggestVersion AQ_AutonegotiationReceiveReservedVendorProvisioning_APPIA -#define AQ_AutonegotiationReceiveReservedVendorStatus_BiggestVersion AQ_AutonegotiationReceiveReservedVendorStatus_HHD -#define AQ_AutonegotiationReceiveVendorAlarms_BiggestVersion AQ_AutonegotiationReceiveVendorAlarms_HHD -#define AQ_AutonegotiationReceiveVendorInterruptMask_BiggestVersion AQ_AutonegotiationReceiveVendorInterruptMask_HHD -#define AQ_AutonegotiationReservedVendorProvisioning_BiggestVersion AQ_AutonegotiationReservedVendorProvisioning_HHD -#define AQ_AutonegotiationReservedVendorStatus_BiggestVersion AQ_AutonegotiationReservedVendorStatus_HHD -#define AQ_AutonegotiationStandardControl_1_BiggestVersion AQ_AutonegotiationStandardControl_1_HHD -#define AQ_AutonegotiationStandardDeviceIdentifier_BiggestVersion AQ_AutonegotiationStandardDeviceIdentifier_HHD -#define AQ_AutonegotiationStandardDevicesInPackage_BiggestVersion AQ_AutonegotiationStandardDevicesInPackage_HHD -#define AQ_AutonegotiationStandardInterruptMask_BiggestVersion AQ_AutonegotiationStandardInterruptMask_HHD -#define AQ_AutonegotiationStandardPackageIdentifier_BiggestVersion AQ_AutonegotiationStandardPackageIdentifier_HHD -#define AQ_AutonegotiationStandardStatus_1_BiggestVersion AQ_AutonegotiationStandardStatus_1_HHD -#define AQ_AutonegotiationStandardStatus_2_BiggestVersion AQ_AutonegotiationStandardStatus_2_HHD -#define AQ_AutonegotiationTransmitVendorAlarms_BiggestVersion AQ_AutonegotiationTransmitVendorAlarms_APPIA -#define AQ_AutonegotiationTransmitVendorInterruptMask_BiggestVersion AQ_AutonegotiationTransmitVendorInterruptMask_HHD -#define AQ_AutonegotiationVendorGlobalInterruptFlags_BiggestVersion AQ_AutonegotiationVendorGlobalInterruptFlags_HHD -#define AQ_AutonegotiationVendorProvisioning_BiggestVersion AQ_AutonegotiationVendorProvisioning_HHD -#define AQ_AutonegotiationVendorStatus_BiggestVersion AQ_AutonegotiationVendorStatus_HHD -#define AQ_GbePhyExtendedWolControl_BiggestVersion AQ_GbePhyExtendedWolControl_HHD -#define AQ_GbePhySgmii0RxStatus_BiggestVersion AQ_GbePhySgmii0RxStatus_HHD -#define AQ_GbePhySgmii0TxStatus_BiggestVersion AQ_GbePhySgmii0TxStatus_HHD -#define AQ_GbePhySgmii1RxStatus_BiggestVersion AQ_GbePhySgmii1RxStatus_HHD -#define AQ_GbePhySgmii1TxStatus_BiggestVersion AQ_GbePhySgmii1TxStatus_HHD -#define AQ_GbePhySgmii1WolStatus_BiggestVersion AQ_GbePhySgmii1WolStatus_HHD -#define AQ_GbePhySgmiiRxAlarms_BiggestVersion AQ_GbePhySgmiiRxAlarms_HHD -#define AQ_GbePhySgmiiRxInterruptMask_BiggestVersion AQ_GbePhySgmiiRxInterruptMask_HHD -#define AQ_GbePhySgmiiTestControl_BiggestVersion AQ_GbePhySgmiiTestControl_HHD -#define AQ_GbePhySgmiiTxAlarms_BiggestVersion AQ_GbePhySgmiiTxAlarms_HHD -#define AQ_GbePhySgmiiTxInterruptMask_BiggestVersion AQ_GbePhySgmiiTxInterruptMask_HHD -#define AQ_GbePhySgmiiWolStatus_BiggestVersion AQ_GbePhySgmiiWolStatus_HHD -#define AQ_GbePhyVendorGlobalInterruptFlags_BiggestVersion AQ_GbePhyVendorGlobalInterruptFlags_HHD -#define AQ_GbePhyWolControl_BiggestVersion AQ_GbePhyWolControl_HHD -#define AQ_GbePhysgmii1WolStatus_BiggestVersion AQ_GbePhysgmii1WolStatus_APPIA -#define AQ_GbeReservedProvisioning_BiggestVersion AQ_GbeReservedProvisioning_HHD -#define AQ_GbeStandardDeviceIdentifier_BiggestVersion AQ_GbeStandardDeviceIdentifier_HHD -#define AQ_GbeStandardDevicesInPackage_BiggestVersion AQ_GbeStandardDevicesInPackage_HHD -#define AQ_GbeStandardPackageIdentifier_BiggestVersion AQ_GbeStandardPackageIdentifier_HHD -#define AQ_GbeStandardStatus_2_BiggestVersion AQ_GbeStandardStatus_2_HHD -#define AQ_GbeStandardVendorDevicesInPackage_BiggestVersion AQ_GbeStandardVendorDevicesInPackage_HHD -#define AQ_GlobalAlarms_BiggestVersion AQ_GlobalAlarms_HHD -#define AQ_GlobalCableDiagnosticImpedance_BiggestVersion AQ_GlobalCableDiagnosticImpedance_HHD -#define AQ_GlobalCableDiagnosticStatus_BiggestVersion AQ_GlobalCableDiagnosticStatus_APPIA -#define AQ_GlobalChipIdentification_BiggestVersion AQ_GlobalChipIdentification_APPIA -#define AQ_GlobalChipRevision_BiggestVersion AQ_GlobalChipRevision_APPIA -#define AQ_GlobalChip_wideStandardInterruptFlags_BiggestVersion AQ_GlobalChip_wideStandardInterruptFlags_HHD -#define AQ_GlobalChip_wideVendorInterruptFlags_BiggestVersion AQ_GlobalChip_wideVendorInterruptFlags_HHD -#define AQ_GlobalControl_BiggestVersion AQ_GlobalControl_HHD -#define AQ_GlobalDaisyChainStatus_BiggestVersion AQ_GlobalDaisyChainStatus_HHD -#define AQ_GlobalDiagnosticProvisioning_BiggestVersion AQ_GlobalDiagnosticProvisioning_HHD -#define AQ_GlobalEeeProvisioning_BiggestVersion AQ_GlobalEeeProvisioning_HHD -#define AQ_GlobalFaultMessage_BiggestVersion AQ_GlobalFaultMessage_HHD -#define AQ_GlobalFirmwareID_BiggestVersion AQ_GlobalFirmwareID_HHD -#define AQ_GlobalGeneralProvisioning_BiggestVersion AQ_GlobalGeneralProvisioning_HHD -#define AQ_GlobalGeneralStatus_BiggestVersion AQ_GlobalGeneralStatus_HHD -#define AQ_GlobalInterruptChip_wideStandardMask_BiggestVersion AQ_GlobalInterruptChip_wideStandardMask_HHD -#define AQ_GlobalInterruptChip_wideVendorMask_BiggestVersion AQ_GlobalInterruptChip_wideVendorMask_HHD -#define AQ_GlobalInterruptMask_BiggestVersion AQ_GlobalInterruptMask_HHD -#define AQ_GlobalLedProvisioning_BiggestVersion AQ_GlobalLedProvisioning_HHD -#define AQ_GlobalMailboxInterface_BiggestVersion AQ_GlobalMailboxInterface_HHD -#define AQ_GlobalMicroprocessorScratchPad_BiggestVersion AQ_GlobalMicroprocessorScratchPad_HHD -#define AQ_GlobalNvrInterface_BiggestVersion AQ_GlobalNvrInterface_HHD -#define AQ_GlobalNvrProvisioning_BiggestVersion AQ_GlobalNvrProvisioning_HHD -#define AQ_GlobalPinStatus_BiggestVersion AQ_GlobalPinStatus_HHD -#define AQ_GlobalPrimaryStatus_BiggestVersion AQ_GlobalPrimaryStatus_APPIA -#define AQ_GlobalReservedProvisioning_BiggestVersion AQ_GlobalReservedProvisioning_HHD -#define AQ_GlobalReservedStatus_BiggestVersion AQ_GlobalReservedStatus_HHD -#define AQ_GlobalResetControl_BiggestVersion AQ_GlobalResetControl_HHD -#define AQ_GlobalSmbus_0Provisioning_BiggestVersion AQ_GlobalSmbus_0Provisioning_HHD -#define AQ_GlobalSmbus_1Provisioning_BiggestVersion AQ_GlobalSmbus_1Provisioning_HHD -#define AQ_GlobalStandardControl_1_BiggestVersion AQ_GlobalStandardControl_1_HHD -#define AQ_GlobalStandardDeviceIdentifier_BiggestVersion AQ_GlobalStandardDeviceIdentifier_HHD -#define AQ_GlobalStandardDevicesInPackage_BiggestVersion AQ_GlobalStandardDevicesInPackage_HHD -#define AQ_GlobalStandardPackageIdentifier_BiggestVersion AQ_GlobalStandardPackageIdentifier_HHD -#define AQ_GlobalStandardStatus_2_BiggestVersion AQ_GlobalStandardStatus_2_HHD -#define AQ_GlobalStandardVendorDevicesInPackage_BiggestVersion AQ_GlobalStandardVendorDevicesInPackage_HHD -#define AQ_GlobalStatus_BiggestVersion AQ_GlobalStatus_HHD -#define AQ_GlobalThermalProvisioning_BiggestVersion AQ_GlobalThermalProvisioning_HHD -#define AQ_GlobalThermalStatus_BiggestVersion AQ_GlobalThermalStatus_HHD -#define AQ_Kr0AutonegotiationAdvertisementWord_BiggestVersion AQ_Kr0AutonegotiationAdvertisementWord_HHD -#define AQ_Kr0AutonegotiationControl_BiggestVersion AQ_Kr0AutonegotiationControl_HHD -#define AQ_Kr0AutonegotiationExtendedNextPageAdvertisementWord_BiggestVersion AQ_Kr0AutonegotiationExtendedNextPageAdvertisementWord_HHD -#define AQ_Kr0AutonegotiationStatus_BiggestVersion AQ_Kr0AutonegotiationStatus_HHD -#define AQ_Kr0LinkPartnerAutonegotiationAdvertisementWord_BiggestVersion AQ_Kr0LinkPartnerAutonegotiationAdvertisementWord_HHD -#define AQ_Kr0LinkPartnerAutonegotiationExtendedNextPageAdvertisementWord_BiggestVersion AQ_Kr0LinkPartnerAutonegotiationExtendedNextPageAdvertisementWord_HHD -#define AQ_Kr1AutonegotiationAdvertisementWord_BiggestVersion AQ_Kr1AutonegotiationAdvertisementWord_HHD -#define AQ_Kr1AutonegotiationControl_BiggestVersion AQ_Kr1AutonegotiationControl_HHD -#define AQ_Kr1AutonegotiationExtendedNextPageAdvertisementWord_BiggestVersion AQ_Kr1AutonegotiationExtendedNextPageAdvertisementWord_HHD -#define AQ_Kr1AutonegotiationStatus_BiggestVersion AQ_Kr1AutonegotiationStatus_HHD -#define AQ_Kr1LinkPartnerAutonegotiationAdvertisementWord_BiggestVersion AQ_Kr1LinkPartnerAutonegotiationAdvertisementWord_HHD -#define AQ_Kr1LinkPartnerAutonegotiationExtendedNextPageAdvertisementWord_BiggestVersion AQ_Kr1LinkPartnerAutonegotiationExtendedNextPageAdvertisementWord_HHD -#define AQ_MsmLineFifoControlRegister_BiggestVersion AQ_MsmLineFifoControlRegister_HHD -#define AQ_MsmLineGeneralControlRegister_BiggestVersion AQ_MsmLineGeneralControlRegister_HHD -#define AQ_MsmLineGeneralStatusRegister_BiggestVersion AQ_MsmLineGeneralStatusRegister_HHD -#define AQ_MsmLineRxAlignmentErrorsCounterRegister_BiggestVersion AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD -#define AQ_MsmLineRxBroadcastFramesCounterRegister_BiggestVersion AQ_MsmLineRxBroadcastFramesCounterRegister_HHD -#define AQ_MsmLineRxErrorsCounterRegister_BiggestVersion AQ_MsmLineRxErrorsCounterRegister_HHD -#define AQ_MsmLineRxFcsErrorsCounterRegister_BiggestVersion AQ_MsmLineRxFcsErrorsCounterRegister_HHD -#define AQ_MsmLineRxGoodFramesCounterRegister_BiggestVersion AQ_MsmLineRxGoodFramesCounterRegister_HHD -#define AQ_MsmLineRxInRangeLengthErrorsCounterRegister_BiggestVersion AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD -#define AQ_MsmLineRxMulticastFramesCounterRegister_BiggestVersion AQ_MsmLineRxMulticastFramesCounterRegister_HHD -#define AQ_MsmLineRxOctetsCounterRegister_BiggestVersion AQ_MsmLineRxOctetsCounterRegister_HHD -#define AQ_MsmLineRxPauseFramesCounterRegister_BiggestVersion AQ_MsmLineRxPauseFramesCounterRegister_HHD -#define AQ_MsmLineRxTooLongErrorsCounterRegister_BiggestVersion AQ_MsmLineRxTooLongErrorsCounterRegister_HHD -#define AQ_MsmLineRxUnicastFramesCounterRegister_BiggestVersion AQ_MsmLineRxUnicastFramesCounterRegister_HHD -#define AQ_MsmLineRxVlanFramesCounterRegister_BiggestVersion AQ_MsmLineRxVlanFramesCounterRegister_HHD -#define AQ_MsmLineTxBroadcastFramesCounterRegister_BiggestVersion AQ_MsmLineTxBroadcastFramesCounterRegister_HHD -#define AQ_MsmLineTxErrorsCounterRegister_BiggestVersion AQ_MsmLineTxErrorsCounterRegister_HHD -#define AQ_MsmLineTxGoodFramesCounterRegister_BiggestVersion AQ_MsmLineTxGoodFramesCounterRegister_HHD -#define AQ_MsmLineTxIpgControlRegister_BiggestVersion AQ_MsmLineTxIpgControlRegister_HHD -#define AQ_MsmLineTxMulticastFramesCounterRegister_BiggestVersion AQ_MsmLineTxMulticastFramesCounterRegister_HHD -#define AQ_MsmLineTxOctetsCounterRegister_BiggestVersion AQ_MsmLineTxOctetsCounterRegister_HHD -#define AQ_MsmLineTxPauseFramesCounterRegister_BiggestVersion AQ_MsmLineTxPauseFramesCounterRegister_HHD -#define AQ_MsmLineTxUnicastFramesCounterRegister_BiggestVersion AQ_MsmLineTxUnicastFramesCounterRegister_HHD -#define AQ_MsmLineTxVlanFramesCounterRegister_BiggestVersion AQ_MsmLineTxVlanFramesCounterRegister_HHD -#define AQ_MsmSystemFifoControlRegister_BiggestVersion AQ_MsmSystemFifoControlRegister_HHD -#define AQ_MsmSystemGeneralControlRegister_BiggestVersion AQ_MsmSystemGeneralControlRegister_HHD -#define AQ_MsmSystemGeneralStatusRegister_BiggestVersion AQ_MsmSystemGeneralStatusRegister_HHD -#define AQ_MsmSystemRxAlignmentErrorsCounterRegister_BiggestVersion AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD -#define AQ_MsmSystemRxBroadcastFramesCounterRegister_BiggestVersion AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD -#define AQ_MsmSystemRxErrorsCounterRegister_BiggestVersion AQ_MsmSystemRxErrorsCounterRegister_HHD -#define AQ_MsmSystemRxFcsErrorsCounterRegister_BiggestVersion AQ_MsmSystemRxFcsErrorsCounterRegister_HHD -#define AQ_MsmSystemRxGoodFramesCounterRegister_BiggestVersion AQ_MsmSystemRxGoodFramesCounterRegister_HHD -#define AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_BiggestVersion AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD -#define AQ_MsmSystemRxMulticastFramesCounterRegister_BiggestVersion AQ_MsmSystemRxMulticastFramesCounterRegister_HHD -#define AQ_MsmSystemRxOctetsCounterRegister_BiggestVersion AQ_MsmSystemRxOctetsCounterRegister_HHD -#define AQ_MsmSystemRxPauseFramesCounterRegister_BiggestVersion AQ_MsmSystemRxPauseFramesCounterRegister_HHD -#define AQ_MsmSystemRxTooLongErrorsCounterRegister_BiggestVersion AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD -#define AQ_MsmSystemRxUnicastFramesCounterRegister_BiggestVersion AQ_MsmSystemRxUnicastFramesCounterRegister_HHD -#define AQ_MsmSystemRxVlanFramesCounterRegister_BiggestVersion AQ_MsmSystemRxVlanFramesCounterRegister_HHD -#define AQ_MsmSystemTxBroadcastFramesCounterRegister_BiggestVersion AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD -#define AQ_MsmSystemTxErrorsCounterRegister_BiggestVersion AQ_MsmSystemTxErrorsCounterRegister_HHD -#define AQ_MsmSystemTxGoodFramesCounterRegister_BiggestVersion AQ_MsmSystemTxGoodFramesCounterRegister_HHD -#define AQ_MsmSystemTxIpgControlRegister_BiggestVersion AQ_MsmSystemTxIpgControlRegister_HHD -#define AQ_MsmSystemTxMulticastFramesCounterRegister_BiggestVersion AQ_MsmSystemTxMulticastFramesCounterRegister_HHD -#define AQ_MsmSystemTxOctetsCounterRegister_BiggestVersion AQ_MsmSystemTxOctetsCounterRegister_HHD -#define AQ_MsmSystemTxPauseFramesCounterRegister_BiggestVersion AQ_MsmSystemTxPauseFramesCounterRegister_HHD -#define AQ_MsmSystemTxUnicastFramesCounterRegister_BiggestVersion AQ_MsmSystemTxUnicastFramesCounterRegister_HHD -#define AQ_MsmSystemTxVlanFramesCounterRegister_BiggestVersion AQ_MsmSystemTxVlanFramesCounterRegister_HHD -#define AQ_MssEgressControlRegister_BiggestVersion AQ_MssEgressControlRegister_HHD -#define AQ_MssEgressEccInterruptStatusRegister_BiggestVersion AQ_MssEgressEccInterruptStatusRegister_HHD -#define AQ_MssEgressInterruptMaskRegister_BiggestVersion AQ_MssEgressInterruptMaskRegister_HHD -#define AQ_MssEgressInterruptStatusRegister_BiggestVersion AQ_MssEgressInterruptStatusRegister_HHD -#define AQ_MssEgressLutAddressControlRegister_BiggestVersion AQ_MssEgressLutAddressControlRegister_HHD -#define AQ_MssEgressLutControlRegister_BiggestVersion AQ_MssEgressLutControlRegister_HHD -#define AQ_MssEgressLutDataControlRegister_BiggestVersion AQ_MssEgressLutDataControlRegister_HHD -#define AQ_MssEgressMtuSizeControlRegister_BiggestVersion AQ_MssEgressMtuSizeControlRegister_HHD -#define AQ_MssEgressPnControlRegister_BiggestVersion AQ_MssEgressPnControlRegister_HHD -#define AQ_MssEgressSaExpiredStatusRegister_BiggestVersion AQ_MssEgressSaExpiredStatusRegister_HHD -#define AQ_MssEgressSaThresholdExpiredStatusRegister_BiggestVersion AQ_MssEgressSaThresholdExpiredStatusRegister_HHD -#define AQ_MssEgressVlanControlRegister_BiggestVersion AQ_MssEgressVlanControlRegister_HHD -#define AQ_MssEgressVlanTpid_0Register_BiggestVersion AQ_MssEgressVlanTpid_0Register_HHD -#define AQ_MssEgressVlanTpid_1Register_BiggestVersion AQ_MssEgressVlanTpid_1Register_HHD -#define AQ_MssIngressControlRegister_BiggestVersion AQ_MssIngressControlRegister_HHD -#define AQ_MssIngressEccInterruptStatusRegister_BiggestVersion AQ_MssIngressEccInterruptStatusRegister_HHD -#define AQ_MssIngressInterruptMaskRegister_BiggestVersion AQ_MssIngressInterruptMaskRegister_HHD -#define AQ_MssIngressInterruptStatusRegister_BiggestVersion AQ_MssIngressInterruptStatusRegister_HHD -#define AQ_MssIngressLutAddressControlRegister_BiggestVersion AQ_MssIngressLutAddressControlRegister_HHD -#define AQ_MssIngressLutControlRegister_BiggestVersion AQ_MssIngressLutControlRegister_HHD -#define AQ_MssIngressLutDataControlRegister_BiggestVersion AQ_MssIngressLutDataControlRegister_HHD -#define AQ_MssIngressMtuSizeControlRegister_BiggestVersion AQ_MssIngressMtuSizeControlRegister_HHD -#define AQ_MssIngressSaControlRegister_BiggestVersion AQ_MssIngressSaControlRegister_HHD -#define AQ_MssIngressSaExpiredStatusRegister_BiggestVersion AQ_MssIngressSaExpiredStatusRegister_HHD -#define AQ_MssIngressSaIcvErrorStatusRegister_BiggestVersion AQ_MssIngressSaIcvErrorStatusRegister_HHD -#define AQ_MssIngressSaReplayErrorStatusRegister_BiggestVersion AQ_MssIngressSaReplayErrorStatusRegister_HHD -#define AQ_MssIngressSaThresholdExpiredStatusRegister_BiggestVersion AQ_MssIngressSaThresholdExpiredStatusRegister_HHD -#define AQ_MssIngressVlanControlRegister_BiggestVersion AQ_MssIngressVlanControlRegister_HHD -#define AQ_MssIngressVlanTpid_0Register_BiggestVersion AQ_MssIngressVlanTpid_0Register_HHD -#define AQ_MssIngressVlanTpid_1Register_BiggestVersion AQ_MssIngressVlanTpid_1Register_HHD -#define AQ_Pcs10GBaseT_Status_BiggestVersion AQ_Pcs10GBaseT_Status_APPIA -#define AQ_Pcs10G_Status_BiggestVersion AQ_Pcs10G_Status_HHD -#define AQ_Pcs10G_base_rPcsTest_patternControl_BiggestVersion AQ_Pcs10G_base_rPcsTest_patternControl_HHD -#define AQ_Pcs10G_base_rPcsTest_patternErrorCounter_BiggestVersion AQ_Pcs10G_base_rPcsTest_patternErrorCounter_HHD -#define AQ_Pcs10G_base_rTestPatternSeedA_BiggestVersion AQ_Pcs10G_base_rTestPatternSeedA_HHD -#define AQ_Pcs10G_base_rTestPatternSeedB_BiggestVersion AQ_Pcs10G_base_rTestPatternSeedB_HHD -#define AQ_PcsEeeCapabilityRegister_BiggestVersion AQ_PcsEeeCapabilityRegister_HHD -#define AQ_PcsEeeWakeErrorCounter_BiggestVersion AQ_PcsEeeWakeErrorCounter_HHD -#define AQ_PcsReceiveStandardInterruptMask_BiggestVersion AQ_PcsReceiveStandardInterruptMask_APPIA -#define AQ_PcsReceiveVendorAlarms_BiggestVersion AQ_PcsReceiveVendorAlarms_HHD -#define AQ_PcsReceiveVendorCorrectedFrame_1IterationCounter_BiggestVersion AQ_PcsReceiveVendorCorrectedFrame_1IterationCounter_HHD -#define AQ_PcsReceiveVendorCorrectedFrame_2IterationCounter_BiggestVersion AQ_PcsReceiveVendorCorrectedFrame_2IterationCounter_HHD -#define AQ_PcsReceiveVendorCorrectedFrame_3IterationCounter_BiggestVersion AQ_PcsReceiveVendorCorrectedFrame_3IterationCounter_HHD -#define AQ_PcsReceiveVendorCorrectedFrame_4IterationCounter_BiggestVersion AQ_PcsReceiveVendorCorrectedFrame_4IterationCounter_HHD -#define AQ_PcsReceiveVendorCorrectedFrame_5IterationCounter_BiggestVersion AQ_PcsReceiveVendorCorrectedFrame_5IterationCounter_HHD -#define AQ_PcsReceiveVendorCorrectedFrame_6IterationCounter_BiggestVersion AQ_PcsReceiveVendorCorrectedFrame_6IterationCounter_HHD -#define AQ_PcsReceiveVendorCorrectedFrame_7IterationCounter_BiggestVersion AQ_PcsReceiveVendorCorrectedFrame_7IterationCounter_HHD -#define AQ_PcsReceiveVendorCorrectedFrame_8IterationCounter_BiggestVersion AQ_PcsReceiveVendorCorrectedFrame_8IterationCounter_HHD -#define AQ_PcsReceiveVendorCrc_8ErrorCounter_BiggestVersion AQ_PcsReceiveVendorCrc_8ErrorCounter_HHD -#define AQ_PcsReceiveVendorDebug_BiggestVersion AQ_PcsReceiveVendorDebug_HHD -#define AQ_PcsReceiveVendorFcsErrorFrameCounter_BiggestVersion AQ_PcsReceiveVendorFcsErrorFrameCounter_HHD -#define AQ_PcsReceiveVendorFcsNoErrorFrameCounter_BiggestVersion AQ_PcsReceiveVendorFcsNoErrorFrameCounter_HHD -#define AQ_PcsReceiveVendorInterruptMask_BiggestVersion AQ_PcsReceiveVendorInterruptMask_HHD -#define AQ_PcsReceiveVendorProvisioning_BiggestVersion AQ_PcsReceiveVendorProvisioning_HHD -#define AQ_PcsReceiveVendorState_BiggestVersion AQ_PcsReceiveVendorState_HHD -#define AQ_PcsReceiveVendorUncorrectedFrameCounter_BiggestVersion AQ_PcsReceiveVendorUncorrectedFrameCounter_HHD -#define AQ_PcsReceiveXfi0Provisioning_BiggestVersion AQ_PcsReceiveXfi0Provisioning_HHD -#define AQ_PcsReceiveXfi0VendorState_BiggestVersion AQ_PcsReceiveXfi0VendorState_HHD -#define AQ_PcsReceiveXfi1Provisioning_BiggestVersion AQ_PcsReceiveXfi1Provisioning_HHD -#define AQ_PcsReceiveXfi1VendorState_BiggestVersion AQ_PcsReceiveXfi1VendorState_HHD -#define AQ_PcsSerdesMuxSwapTxrxRegister_BiggestVersion AQ_PcsSerdesMuxSwapTxrxRegister_HHD -#define AQ_PcsStandardControl_1_BiggestVersion AQ_PcsStandardControl_1_HHD -#define AQ_PcsStandardControl_2_BiggestVersion AQ_PcsStandardControl_2_HHD -#define AQ_PcsStandardDeviceIdentifier_BiggestVersion AQ_PcsStandardDeviceIdentifier_HHD -#define AQ_PcsStandardDevicesInPackage_BiggestVersion AQ_PcsStandardDevicesInPackage_HHD -#define AQ_PcsStandardInterruptMask_BiggestVersion AQ_PcsStandardInterruptMask_HHD -#define AQ_PcsStandardPackageIdentifier_BiggestVersion AQ_PcsStandardPackageIdentifier_HHD -#define AQ_PcsStandardSpeedAbility_BiggestVersion AQ_PcsStandardSpeedAbility_HHD -#define AQ_PcsStandardStatus_1_BiggestVersion AQ_PcsStandardStatus_1_HHD -#define AQ_PcsStandardStatus_2_BiggestVersion AQ_PcsStandardStatus_2_HHD -#define AQ_PcsTransmitReservedVendorProvisioning_BiggestVersion AQ_PcsTransmitReservedVendorProvisioning_HHD -#define AQ_PcsTransmitVendorAlarms_BiggestVersion AQ_PcsTransmitVendorAlarms_APPIA -#define AQ_PcsTransmitVendorDebug_BiggestVersion AQ_PcsTransmitVendorDebug_HHD -#define AQ_PcsTransmitVendorFcsErrorFrameCounter_BiggestVersion AQ_PcsTransmitVendorFcsErrorFrameCounter_HHD -#define AQ_PcsTransmitVendorFcsNoErrorFrameCounter_BiggestVersion AQ_PcsTransmitVendorFcsNoErrorFrameCounter_HHD -#define AQ_PcsTransmitVendorInterruptMask_BiggestVersion AQ_PcsTransmitVendorInterruptMask_APPIA -#define AQ_PcsTransmitVendorProvisioning_BiggestVersion AQ_PcsTransmitVendorProvisioning_HHD -#define AQ_PcsTransmitXfi0VendorProvisioning_BiggestVersion AQ_PcsTransmitXfi0VendorProvisioning_HHD -#define AQ_PcsTransmitXfi0VendorState_BiggestVersion AQ_PcsTransmitXfi0VendorState_HHD -#define AQ_PcsTransmitXfi1VendorProvisioning_BiggestVersion AQ_PcsTransmitXfi1VendorProvisioning_HHD -#define AQ_PcsTransmitXfi1VendorState_BiggestVersion AQ_PcsTransmitXfi1VendorState_HHD -#define AQ_PcsTransmitXfiVendorProvisioning_BiggestVersion AQ_PcsTransmitXfiVendorProvisioning_HHD -#define AQ_PcsTransmitXgsVendorState_BiggestVersion AQ_PcsTransmitXgsVendorState_HHD -#define AQ_PcsVendorGlobalInterruptFlags_BiggestVersion AQ_PcsVendorGlobalInterruptFlags_HHD -#define AQ_PhyXS_EeeCapabilityRegister_BiggestVersion AQ_PhyXS_EeeCapabilityRegister_HHD -#define AQ_PhyXS_EeeWakeErrorCounter_BiggestVersion AQ_PhyXS_EeeWakeErrorCounter_HHD -#define AQ_PhyXS_Receive_xauiTx_PcsStatus_BiggestVersion AQ_PhyXS_Receive_xauiTx_PcsStatus_HHD -#define AQ_PhyXS_Receive_xauiTx_ReservedVendorProvisioning_BiggestVersion AQ_PhyXS_Receive_xauiTx_ReservedVendorProvisioning_HHD -#define AQ_PhyXS_Receive_xauiTx_VendorAlarms_BiggestVersion AQ_PhyXS_Receive_xauiTx_VendorAlarms_HHD -#define AQ_PhyXS_Receive_xauiTx_VendorDebug_BiggestVersion AQ_PhyXS_Receive_xauiTx_VendorDebug_HHD -#define AQ_PhyXS_Receive_xauiTx_VendorInterruptMask_BiggestVersion AQ_PhyXS_Receive_xauiTx_VendorInterruptMask_HHD -#define AQ_PhyXS_SerdesConfiguration_BiggestVersion AQ_PhyXS_SerdesConfiguration_HHD -#define AQ_PhyXS_SerdesLane_0Configuration_BiggestVersion AQ_PhyXS_SerdesLane_0Configuration_HHD -#define AQ_PhyXS_SerdesLane_1Configuration_BiggestVersion AQ_PhyXS_SerdesLane_1Configuration_HHD -#define AQ_PhyXS_SerdesLane_2Configuration_BiggestVersion AQ_PhyXS_SerdesLane_2Configuration_HHD -#define AQ_PhyXS_SerdesLane_3Configuration_BiggestVersion AQ_PhyXS_SerdesLane_3Configuration_HHD -#define AQ_PhyXS_SerdesLut_BiggestVersion AQ_PhyXS_SerdesLut_HHD -#define AQ_PhyXS_StandardControl_1_BiggestVersion AQ_PhyXS_StandardControl_1_HHD -#define AQ_PhyXS_StandardDeviceIdentifier_BiggestVersion AQ_PhyXS_StandardDeviceIdentifier_HHD -#define AQ_PhyXS_StandardDevicesInPackage_BiggestVersion AQ_PhyXS_StandardDevicesInPackage_HHD -#define AQ_PhyXS_StandardPackageIdentifier_BiggestVersion AQ_PhyXS_StandardPackageIdentifier_HHD -#define AQ_PhyXS_StandardSpeedAbility_BiggestVersion AQ_PhyXS_StandardSpeedAbility_HHD -#define AQ_PhyXS_StandardStatus_1_BiggestVersion AQ_PhyXS_StandardStatus_1_HHD -#define AQ_PhyXS_StandardStatus_2_BiggestVersion AQ_PhyXS_StandardStatus_2_HHD -#define AQ_PhyXS_StandardXGXS_LaneStatus_BiggestVersion AQ_PhyXS_StandardXGXS_LaneStatus_HHD -#define AQ_PhyXS_StandardXGXS_TestControl_BiggestVersion AQ_PhyXS_StandardXGXS_TestControl_HHD -#define AQ_PhyXS_SystemInterfaceConnectionStatus_BiggestVersion AQ_PhyXS_SystemInterfaceConnectionStatus_HHD -#define AQ_PhyXS_Transmit_xauiRx_PcsStatus_BiggestVersion AQ_PhyXS_Transmit_xauiRx_PcsStatus_HHD -#define AQ_PhyXS_Transmit_xauiRx_ReservedVendorProvisioning_BiggestVersion AQ_PhyXS_Transmit_xauiRx_ReservedVendorProvisioning_HHD -#define AQ_PhyXS_Transmit_xauiRx_ReservedVendorState_BiggestVersion AQ_PhyXS_Transmit_xauiRx_ReservedVendorState_HHD -#define AQ_PhyXS_Transmit_xauiRx_StandardInterruptMask_BiggestVersion AQ_PhyXS_Transmit_xauiRx_StandardInterruptMask_HHD -#define AQ_PhyXS_Transmit_xauiRx_TestPatternErrorCounter_BiggestVersion AQ_PhyXS_Transmit_xauiRx_TestPatternErrorCounter_HHD -#define AQ_PhyXS_Transmit_xauiRx_VendorAlarms_BiggestVersion AQ_PhyXS_Transmit_xauiRx_VendorAlarms_HHD -#define AQ_PhyXS_Transmit_xauiRx_VendorDebug_BiggestVersion AQ_PhyXS_Transmit_xauiRx_VendorDebug_HHD -#define AQ_PhyXS_Transmit_xauiRx_VendorInterruptMask_BiggestVersion AQ_PhyXS_Transmit_xauiRx_VendorInterruptMask_HHD -#define AQ_PhyXS_VendorGlobalInterruptFlags_BiggestVersion AQ_PhyXS_VendorGlobalInterruptFlags_HHD -#define AQ_PifMailboxControl_BiggestVersion AQ_PifMailboxControl_HHD -#define AQ_Pma10GBaseT_FastRetrainStatusAndControl_BiggestVersion AQ_Pma10GBaseT_FastRetrainStatusAndControl_HHD -#define AQ_Pma10GBaseT_PairSwapAndPolarityStatus_BiggestVersion AQ_Pma10GBaseT_PairSwapAndPolarityStatus_HHD -#define AQ_Pma10GBaseT_ReceiveSignalPowerChannelA_BiggestVersion AQ_Pma10GBaseT_ReceiveSignalPowerChannelA_HHD -#define AQ_Pma10GBaseT_ReceiveSignalPowerChannelB_BiggestVersion AQ_Pma10GBaseT_ReceiveSignalPowerChannelB_HHD -#define AQ_Pma10GBaseT_ReceiveSignalPowerChannelC_BiggestVersion AQ_Pma10GBaseT_ReceiveSignalPowerChannelC_HHD -#define AQ_Pma10GBaseT_ReceiveSignalPowerChannelD_BiggestVersion AQ_Pma10GBaseT_ReceiveSignalPowerChannelD_HHD -#define AQ_Pma10GBaseT_SNR_MinimumOperatingMarginChannelA_BiggestVersion AQ_Pma10GBaseT_SNR_MinimumOperatingMarginChannelA_HHD -#define AQ_Pma10GBaseT_SNR_MinimumOperatingMarginChannelB_BiggestVersion AQ_Pma10GBaseT_SNR_MinimumOperatingMarginChannelB_HHD -#define AQ_Pma10GBaseT_SNR_MinimumOperatingMarginChannelC_BiggestVersion AQ_Pma10GBaseT_SNR_MinimumOperatingMarginChannelC_HHD -#define AQ_Pma10GBaseT_SNR_MinimumOperatingMarginChannelD_BiggestVersion AQ_Pma10GBaseT_SNR_MinimumOperatingMarginChannelD_HHD -#define AQ_Pma10GBaseT_SNR_OperatingMarginChannelA_BiggestVersion AQ_Pma10GBaseT_SNR_OperatingMarginChannelA_HHD -#define AQ_Pma10GBaseT_SNR_OperatingMarginChannelB_BiggestVersion AQ_Pma10GBaseT_SNR_OperatingMarginChannelB_HHD -#define AQ_Pma10GBaseT_SNR_OperatingMarginChannelC_BiggestVersion AQ_Pma10GBaseT_SNR_OperatingMarginChannelC_HHD -#define AQ_Pma10GBaseT_SNR_OperatingMarginChannelD_BiggestVersion AQ_Pma10GBaseT_SNR_OperatingMarginChannelD_HHD -#define AQ_Pma10GBaseT_SkewDelay_BiggestVersion AQ_Pma10GBaseT_SkewDelay_HHD -#define AQ_Pma10GBaseT_Status_BiggestVersion AQ_Pma10GBaseT_Status_HHD -#define AQ_Pma10GBaseT_TestModes_BiggestVersion AQ_Pma10GBaseT_TestModes_HHD -#define AQ_Pma10GBaseT_TxPowerBackoffAndShortReachSetting_BiggestVersion AQ_Pma10GBaseT_TxPowerBackoffAndShortReachSetting_HHD -#define AQ_PmaReceiveReservedVendorProvisioning_BiggestVersion AQ_PmaReceiveReservedVendorProvisioning_HHD -#define AQ_PmaReceiveReservedVendorState_BiggestVersion AQ_PmaReceiveReservedVendorState_HHD -#define AQ_PmaReceiveVendorState_BiggestVersion AQ_PmaReceiveVendorState_HHD -#define AQ_PmaStandardControl_1_BiggestVersion AQ_PmaStandardControl_1_HHD -#define AQ_PmaStandardControl_2_BiggestVersion AQ_PmaStandardControl_2_HHD -#define AQ_PmaStandardDeviceIdentifier_BiggestVersion AQ_PmaStandardDeviceIdentifier_HHD -#define AQ_PmaStandardDevicesInPackage_BiggestVersion AQ_PmaStandardDevicesInPackage_HHD -#define AQ_PmaStandardPackageIdentifier_BiggestVersion AQ_PmaStandardPackageIdentifier_HHD -#define AQ_PmaStandardSpeedAbility_BiggestVersion AQ_PmaStandardSpeedAbility_HHD -#define AQ_PmaStandardStatus_1_BiggestVersion AQ_PmaStandardStatus_1_HHD -#define AQ_PmaStandardStatus_2_BiggestVersion AQ_PmaStandardStatus_2_HHD -#define AQ_PmaTransmitReservedVendorProvisioning_BiggestVersion AQ_PmaTransmitReservedVendorProvisioning_HHD -#define AQ_PmaTransmitStandardInterruptMask_BiggestVersion AQ_PmaTransmitStandardInterruptMask_HHD -#define AQ_PmaTransmitVendorAlarms_BiggestVersion AQ_PmaTransmitVendorAlarms_HHD -#define AQ_PmaTransmitVendorDebug_BiggestVersion AQ_PmaTransmitVendorDebug_HHD -#define AQ_PmaTransmitVendorLASI_InterruptMask_BiggestVersion AQ_PmaTransmitVendorLASI_InterruptMask_HHD -#define AQ_PmaVendorGlobalInterruptFlags_BiggestVersion AQ_PmaVendorGlobalInterruptFlags_HHD -#define AQ_PmdStandard10G_ExtendedAbilityRegister_BiggestVersion AQ_PmdStandard10G_ExtendedAbilityRegister_HHD -#define AQ_PmdStandardSignalDetect_BiggestVersion AQ_PmdStandardSignalDetect_HHD -#define AQ_PmdStandardTransmitDisableControl_BiggestVersion AQ_PmdStandardTransmitDisableControl_HHD -#define AQ_Sgmii0WolStatus_BiggestVersion AQ_Sgmii0WolStatus_HHD -#define AQ_TimesyncPcsCapability_BiggestVersion AQ_TimesyncPcsCapability_HHD -#define AQ_TimesyncPcsReceivePathDataDelay_BiggestVersion AQ_TimesyncPcsReceivePathDataDelay_HHD -#define AQ_TimesyncPcsTransmitPathDataDelay_BiggestVersion AQ_TimesyncPcsTransmitPathDataDelay_HHD -#define AQ_TimesyncPhyXsCapability_BiggestVersion AQ_TimesyncPhyXsCapability_HHD -#define AQ_TimesyncPhyXsReceivePathDataDelay_BiggestVersion AQ_TimesyncPhyXsReceivePathDataDelay_HHD -#define AQ_TimesyncPhyXsTransmitPathDataDelay_BiggestVersion AQ_TimesyncPhyXsTransmitPathDataDelay_HHD -#define AQ_TimesyncPmaCapability_BiggestVersion AQ_TimesyncPmaCapability_HHD -#define AQ_TimesyncPmaReceivePathDataDelay_BiggestVersion AQ_TimesyncPmaReceivePathDataDelay_HHD -#define AQ_TimesyncPmaTransmitPathDataDelay_BiggestVersion AQ_TimesyncPmaTransmitPathDataDelay_HHD -#define AQ_XenpakBasic_ApsLoading_BiggestVersion AQ_XenpakBasic_ApsLoading_HHD -#define AQ_XenpakBasic_ApsVoltage_BiggestVersion AQ_XenpakBasic_ApsVoltage_HHD -#define AQ_XenpakBasic_BitRate_BiggestVersion AQ_XenpakBasic_BitRate_HHD -#define AQ_XenpakBasic_Checksum_BiggestVersion AQ_XenpakBasic_Checksum_HHD -#define AQ_XenpakBasic_ConnectorType_BiggestVersion AQ_XenpakBasic_ConnectorType_HHD -#define AQ_XenpakBasic_DomCapability_BiggestVersion AQ_XenpakBasic_DomCapability_HHD -#define AQ_XenpakBasic_Encoding_BiggestVersion AQ_XenpakBasic_Encoding_HHD -#define AQ_XenpakBasic_Low_powerStartupCapability_BiggestVersion AQ_XenpakBasic_Low_powerStartupCapability_HHD -#define AQ_XenpakBasic_PackageIdentifier_BiggestVersion AQ_XenpakBasic_PackageIdentifier_HHD -#define AQ_XenpakBasic_Protocol_BiggestVersion AQ_XenpakBasic_Protocol_HHD -#define AQ_XenpakBasic_Reserved_0x11_BiggestVersion AQ_XenpakBasic_Reserved_0x11_HHD -#define AQ_XenpakBasic_Reserved_0x19_BiggestVersion AQ_XenpakBasic_Reserved_0x19_HHD -#define AQ_XenpakBasic_Reserved_0x7c_BiggestVersion AQ_XenpakBasic_Reserved_0x7c_HHD -#define AQ_XenpakBasic_StandardsComplianceCodes_BiggestVersion AQ_XenpakBasic_StandardsComplianceCodes_HHD -#define AQ_XenpakBasic_TransceiverType_BiggestVersion AQ_XenpakBasic_TransceiverType_HHD -#define AQ_XenpakBasic_VendorDateCode_BiggestVersion AQ_XenpakBasic_VendorDateCode_HHD -#define AQ_XenpakBasic_VendorIdentifier_BiggestVersion AQ_XenpakBasic_VendorIdentifier_HHD -#define AQ_XenpakBasic_VendorName_BiggestVersion AQ_XenpakBasic_VendorName_HHD -#define AQ_XenpakBasic_VendorPartNumber_BiggestVersion AQ_XenpakBasic_VendorPartNumber_HHD -#define AQ_XenpakBasic_VendorPartRevisionNumber_BiggestVersion AQ_XenpakBasic_VendorPartRevisionNumber_HHD -#define AQ_XenpakBasic_VendorSerialNumber_BiggestVersion AQ_XenpakBasic_VendorSerialNumber_HHD -#define AQ_XenpakBasic__3_3vLoading_BiggestVersion AQ_XenpakBasic__3_3vLoading_HHD -#define AQ_XenpakBasic__5vLoading_BiggestVersion AQ_XenpakBasic__5vLoading_HHD -#define AQ_XenpakControl_BiggestVersion AQ_XenpakControl_HHD -#define AQ_XenpakCustomer_Reserved_0x7e_BiggestVersion AQ_XenpakCustomer_Reserved_0x7e_HHD -#define AQ_XenpakDom_Alarms_BiggestVersion AQ_XenpakDom_Alarms_HHD -#define AQ_XenpakDom_Capability_BiggestVersion AQ_XenpakDom_Capability_HHD -#define AQ_XenpakDom_ControlAndStatus_BiggestVersion AQ_XenpakDom_ControlAndStatus_HHD -#define AQ_XenpakDom_HighTemperatureAlarmThresholdLSW_BiggestVersion AQ_XenpakDom_HighTemperatureAlarmThresholdLSW_HHD -#define AQ_XenpakDom_HighTemperatureAlarmThresholdMSW_BiggestVersion AQ_XenpakDom_HighTemperatureAlarmThresholdMSW_HHD -#define AQ_XenpakDom_HighTemperatureWarningThresholdLSW_BiggestVersion AQ_XenpakDom_HighTemperatureWarningThresholdLSW_HHD -#define AQ_XenpakDom_HighTemperatureWarningThresholdMSW_BiggestVersion AQ_XenpakDom_HighTemperatureWarningThresholdMSW_HHD -#define AQ_XenpakDom_LowTemperatureAlarmThresholdLSW_BiggestVersion AQ_XenpakDom_LowTemperatureAlarmThresholdLSW_HHD -#define AQ_XenpakDom_LowTemperatureAlarmThresholdMSW_BiggestVersion AQ_XenpakDom_LowTemperatureAlarmThresholdMSW_HHD -#define AQ_XenpakDom_LowTemperatureWarningThresholdLSW_BiggestVersion AQ_XenpakDom_LowTemperatureWarningThresholdLSW_HHD -#define AQ_XenpakDom_LowTemperatureWarningThresholdMSW_BiggestVersion AQ_XenpakDom_LowTemperatureWarningThresholdMSW_HHD -#define AQ_XenpakDom_Status_BiggestVersion AQ_XenpakDom_Status_HHD -#define AQ_XenpakDom_TemperatureLSW_BiggestVersion AQ_XenpakDom_TemperatureLSW_HHD -#define AQ_XenpakDom_TemperatureMSW_BiggestVersion AQ_XenpakDom_TemperatureMSW_HHD -#define AQ_XenpakDom_TxControl_BiggestVersion AQ_XenpakDom_TxControl_HHD -#define AQ_XenpakHeader_BasicMemoryStartAddress_BiggestVersion AQ_XenpakHeader_BasicMemoryStartAddress_HHD -#define AQ_XenpakHeader_CustomerMemoryOffset_BiggestVersion AQ_XenpakHeader_CustomerMemoryOffset_HHD -#define AQ_XenpakHeader_ExtendedVendorMemoryOffset_BiggestVersion AQ_XenpakHeader_ExtendedVendorMemoryOffset_HHD -#define AQ_XenpakHeader_MemoryUsed_BiggestVersion AQ_XenpakHeader_MemoryUsed_HHD -#define AQ_XenpakHeader_NvrSize_BiggestVersion AQ_XenpakHeader_NvrSize_HHD -#define AQ_XenpakHeader_VendorMemoryStartAddress_BiggestVersion AQ_XenpakHeader_VendorMemoryStartAddress_HHD -#define AQ_XenpakHeader_XenpakMsaVersionSupported_BiggestVersion AQ_XenpakHeader_XenpakMsaVersionSupported_HHD -#define AQ_XenpakLASI__Control_BiggestVersion AQ_XenpakLASI__Control_HHD -#define AQ_XenpakLASI__Status_BiggestVersion AQ_XenpakLASI__Status_HHD -#define AQ_XenpakRxAlarm_Control_BiggestVersion AQ_XenpakRxAlarm_Control_HHD -#define AQ_XenpakRxAlarm_Status_BiggestVersion AQ_XenpakRxAlarm_Status_HHD -#define AQ_XenpakTxAlarm_Control_BiggestVersion AQ_XenpakTxAlarm_Control_HHD -#define AQ_XenpakTxAlarm_Status_BiggestVersion AQ_XenpakTxAlarm_Status_HHD -#define AQ_XenpakVendor_Reserved_0xae_BiggestVersion AQ_XenpakVendor_Reserved_0xae_HHD - -#endif diff --git a/feeds/ipq807x/aq-fw-download/src/include/registerMap/AQ_RegMaps.h b/feeds/ipq807x/aq-fw-download/src/include/registerMap/AQ_RegMaps.h deleted file mode 100755 index 52a24e385..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/registerMap/AQ_RegMaps.h +++ /dev/null @@ -1,69 +0,0 @@ -/*AQ_RegMaps.h*/ - -/************************************************************************************ -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* Description: -* -* This file contains includes all appropriate Aquantia PHY device-specific -* register map headers. -* -************************************************************************************/ - -/*! \file -* This file contains includes all appropriate Aquantia PHY device-specific -* register map headers. - */ - -#ifndef AQ_REGISTERMAPS_HEADER -#define AQ_REGISTERMAPS_HEADER - -#include "AQ_User.h" -#include "AQ_RegGroupMaxSizes.h" - - -#ifndef AQ_REVERSED_BITFIELD_ORDERING -/* - * Include non-reversed header files (bitfields ordered from LSbit to MSbit) - */ - -/* APPIA */ -#include "AQ_APPIA_Global_registers.h" - -#include "AQ_APPIA_Global_registers_Defines.h" - -/* HHD */ -#include "AQ_HHD_Global_registers.h" - -#include "AQ_HHD_Global_registers_Defines.h" - -#else -/* - * Include reversed header files (bitfields ordered from MSbit to LSbit) - */ - -/* APPIA */ -#include "AQ_APPIA_Global_registers_reversed.h" - -#include "AQ_APPIA_Global_registers_Defines.h" - -/* HHD */ -#include "AQ_HHD_Global_registers_reversed.h" - -#include "AQ_HHD_Global_registers_Defines.h" - -#endif - -#endif diff --git a/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers.h b/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers.h deleted file mode 100755 index e0a2fa27b..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers.h +++ /dev/null @@ -1,12123 +0,0 @@ -/*! \file -* This file contains the data structures and doxygen comments -* for the Global Registers block. - */ - -/*! \addtogroup registerMap - @{ -*/ - -/*! \defgroup Global_registers Global Registers -* This module contains the data structures and doxygen comments -* for the Global Registers block. - */ -/*********************************************************************** -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* $Date: 2014/04/08 $ -* -* $Label: $ -* -* Description: -* -* This file contains the c header structures for the registers contained in the Global Registers block. -* -* The bit fields in this structure are from LSbit to MSbit -* -***********************************************************************/ - - -/*@{*/ -#ifndef AQ_HHD_GLOBAL_REGS_HEADER -#define AQ_HHD_GLOBAL_REGS_HEADER - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Control 1: 1E.0000 */ -/* Global Standard Control 1: 1E.0000 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Control 1 */ - union - { - struct - { - unsigned int reserved1 : 11; - /*! \brief 1E.0000.B R/WPD Low Power - AQ_GlobalStandardControl_1_HHD.u0.bits_0.lowPower - - Provisionable Default = 0x0 - - 1 = Low-power mode - 0 = Normal operation - - - Notes: - A one written to this register causes the chip to enter low-power mode. This bit puts the entire chip in low-power mode, with only the MDIO and microprocessor functioning, and turns off the analog front-end: i.e. places it in high-impedance mode. Setting this bit also sets all of the Low Power bits in the other MMDs. */ - unsigned int lowPower : 1; /* 1E.0000.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Low-power mode - 0 = Normal operation - */ - unsigned int reserved0 : 3; - /*! \brief 1E.0000.F R/WSC Soft Reset - AQ_GlobalStandardControl_1_HHD.u0.bits_0.softReset - - Default = 0x1 - - 1 = Global soft reset - 0 = Normal operation - - - Notes: - Resets the entire PHY. - Setting this bit initiates a global soft reset on all of the digital logic not including the microprocessor (i.e. microprocessor is not reset). Upon completion of the reset sequence, this bit is set back to 0by the microprocessor. Note this bit is OR'ed with the individual MMD resets. This bit should be set to 0 before setting the individual MMD resets. */ - unsigned int softReset : 1; /* 1E.0000.F R/WSC Default = 0x1 */ - /* 1 = Global soft reset - 0 = Normal operation - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardControl_1_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Device Identifier: 1E.0002 */ -/* Global Standard Device Identifier: 1E.0002 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Device Identifier */ - union - { - struct - { - /*! \brief 1E.0002.F:0 RO Device ID MSW [1F:10] - AQ_GlobalStandardDeviceIdentifier_HHD.u0.bits_0.deviceIdMSW - - - - Bits 31 - 16 of Device ID - */ - unsigned int deviceIdMSW : 16; /* 1E.0002.F:0 RO */ - /* Bits 31 - 16 of Device ID */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Standard Device Identifier */ - union - { - struct - { - /*! \brief 1E.0003.F:0 RO Device ID LSW [F:0] - AQ_GlobalStandardDeviceIdentifier_HHD.u1.bits_1.deviceIdLSW - - - - Bits 15 - 0 of Device ID - */ - unsigned int deviceIdLSW : 16; /* 1E.0003.F:0 RO */ - /* Bits 15 - 0 of Device ID */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalStandardDeviceIdentifier_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Devices in Package: 1E.0005 */ -/* Global Standard Devices in Package: 1E.0005 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Devices in Package */ - union - { - struct - { - /*! \brief 1E.0005.0 ROS Clause 22 Registers Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.clause_22RegistersPresent - - Default = 0x0 - - 1 = Clause 22 registers are present in package - 0 = Clause 22 registers are not present in package - - Notes: - This is always set to 0 in the PHY, as there are no Clause 22 registers in the device. */ - unsigned int clause_22RegistersPresent : 1; /* 1E.0005.0 ROS Default = 0x0 */ - /* 1 = Clause 22 registers are present in package - 0 = Clause 22 registers are not present in package */ - /*! \brief 1E.0005.1 ROS PMA Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.pmaPresent - - Default = 0x1 - - 1 = PMA is present in package - 0 = PMA is not present - - Notes: - This is always set to 1 as there is PMA functionality in the PHY. */ - unsigned int pmaPresent : 1; /* 1E.0005.1 ROS Default = 0x1 */ - /* 1 = PMA is present in package - 0 = PMA is not present */ - /*! \brief 1E.0005.2 ROS WIS Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.wisPresent - - Default = 0x0 - - 1 = WIS is present in package - 0 = WIS is not present in package - - Notes: - This is always set to 0, as there is no WIS functionality in the PHY. */ - unsigned int wisPresent : 1; /* 1E.0005.2 ROS Default = 0x0 */ - /* 1 = WIS is present in package - 0 = WIS is not present in package */ - /*! \brief 1E.0005.3 ROS PCS Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.pcsPresent - - Default = 0x1 - - 1 = PCS is present in package - 0 = PCS is not present in package - - Notes: - This is always set to 1 as there is PCS functionality in the PHY. */ - unsigned int pcsPresent : 1; /* 1E.0005.3 ROS Default = 0x1 */ - /* 1 = PCS is present in package - 0 = PCS is not present in package */ - /*! \brief 1E.0005.4 ROS PHY XS Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.phyXS_Present - - Default = 0x1 - - 1 = PHY XS is present in package - 0 = PHY XS is not present in package - - Notes: - This is always set to 1 as there is a PHY XS interface in the PHY. */ - unsigned int phyXS_Present : 1; /* 1E.0005.4 ROS Default = 0x1 */ - /* 1 = PHY XS is present in package - 0 = PHY XS is not present in package */ - /*! \brief 1E.0005.5 ROS DTE XS Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.dteXsPresent - - Default = 0x0 - - 1 = DTE XS is present in package - 0 = DTE XS is not present in package - - - Notes: - This is always set to 0, as there is no DTE XAUI interface in the PHY. */ - unsigned int dteXsPresent : 1; /* 1E.0005.5 ROS Default = 0x0 */ - /* 1 = DTE XS is present in package - 0 = DTE XS is not present in package - */ - /*! \brief 1E.0005.6 ROS TC Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.tcPresent - - Default = 0x0 - - 1 = TC is present in package - 0 = TC is not present in package - - Notes: - This is always set to 0, as there is no TC functionality in the PHY. */ - unsigned int tcPresent : 1; /* 1E.0005.6 ROS Default = 0x0 */ - /* 1 = TC is present in package - 0 = TC is not present in package */ - /*! \brief 1E.0005.7 ROS Autonegotiation Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.autonegotiationPresent - - Default = 0x1 - - 1 = Autonegotiation is present in package - 0 = Autonegotiation is not present in package - - Notes: - This is always set to 1, as there is Autonegotiation in the PHY. */ - unsigned int autonegotiationPresent : 1; /* 1E.0005.7 ROS Default = 0x1 */ - /* 1 = Autonegotiation is present in package - 0 = Autonegotiation is not present in package */ - unsigned int reserved0 : 8; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardDevicesInPackage_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Vendor Devices in Package: 1E.0006 */ -/* Global Standard Vendor Devices in Package: 1E.0006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Vendor Devices in Package */ - union - { - struct - { - unsigned int reserved0 : 13; - /*! \brief 1E.0006.D ROS Clause 22 Extension Present - AQ_GlobalStandardVendorDevicesInPackage_HHD.u0.bits_0.clause_22ExtensionPresent - - Default = 0x1 - - 1 = Clause 22 Extension is present in package - 0 = Clause 22 Extension is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the GbE registers. */ - unsigned int clause_22ExtensionPresent : 1; /* 1E.0006.D ROS Default = 0x1 */ - /* 1 = Clause 22 Extension is present in package - 0 = Clause 22 Extension is not present in package */ - /*! \brief 1E.0006.E ROS Vendor Specific Device #1 Present - AQ_GlobalStandardVendorDevicesInPackage_HHD.u0.bits_0.vendorSpecificDevice_1Present - - Default = 0x1 - - 1 = Device #1 is present in package - 0 = Device #1 is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the global control registers. */ - unsigned int vendorSpecificDevice_1Present : 1; /* 1E.0006.E ROS Default = 0x1 */ - /* 1 = Device #1 is present in package - 0 = Device #1 is not present in package */ - /*! \brief 1E.0006.F ROS Vendor Specific Device #2 Present - AQ_GlobalStandardVendorDevicesInPackage_HHD.u0.bits_0.vendorSpecificDevice_2Present - - Default = 0x1 - - 1 = Device #2 is present in package - 0 = Device #2 is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the DSP PMA registers. */ - unsigned int vendorSpecificDevice_2Present : 1; /* 1E.0006.F ROS Default = 0x1 */ - /* 1 = Device #2 is present in package - 0 = Device #2 is not present in package */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardVendorDevicesInPackage_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Status 2: 1E.0008 */ -/* Global Standard Status 2: 1E.0008 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Status 2 */ - union - { - struct - { - unsigned int reserved0 : 14; - /*! \brief 1E.0008.F:E ROS Device Present [1:0] - AQ_GlobalStandardStatus_2_HHD.u0.bits_0.devicePresent - - Default = 0x2 - - [F:E] - 0x3 = No device at this address - 0x2 = Device present at this address - 0x1 = No device at this address - 0x0 = No device at this address - - Notes: - This field is always set to 0x2, as the Global MMD resides here in the PHY. */ - unsigned int devicePresent : 2; /* 1E.0008.F:E ROS Default = 0x2 */ - /* [F:E] - 0x3 = No device at this address - 0x2 = Device present at this address - 0x1 = No device at this address - 0x0 = No device at this address */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardStatus_2_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Package Identifier: 1E.000E */ -/* Global Standard Package Identifier: 1E.000E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Package Identifier */ - union - { - struct - { - /*! \brief 1E.000E.F:0 RO Package ID MSW [1F:10] - AQ_GlobalStandardPackageIdentifier_HHD.u0.bits_0.packageIdMSW - - - - Bits 31- 16 of Package ID - */ - unsigned int packageIdMSW : 16; /* 1E.000E.F:0 RO */ - /* Bits 31- 16 of Package ID */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Standard Package Identifier */ - union - { - struct - { - /*! \brief 1E.000F.F:0 RO Package ID LSW [F:0] - AQ_GlobalStandardPackageIdentifier_HHD.u1.bits_1.packageIdLSW - - - - Bits 15 - 0 of Package ID - */ - unsigned int packageIdLSW : 16; /* 1E.000F.F:0 RO */ - /* Bits 15 - 0 of Package ID */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalStandardPackageIdentifier_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Firmware ID: 1E.0020 */ -/* Global Firmware ID: 1E.0020 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Firmware ID */ - union - { - struct - { - /*! \brief 1E.0020.7:0 RO Firmware Minor Revision Number [7:0] - AQ_GlobalFirmwareID_HHD.u0.bits_0.firmwareMinorRevisionNumber - - - - [7:0] = Minor revision number - - Notes: - - - The lower six bits of major and minor firmware revision are exchanged in autonegotiation when the PHYID message is sent. */ - unsigned int firmwareMinorRevisionNumber : 8; /* 1E.0020.7:0 RO */ - /* [7:0] = Minor revision number */ - /*! \brief 1E.0020.F:8 RO Firmware Major Revision Number [7:0] - AQ_GlobalFirmwareID_HHD.u0.bits_0.firmwareMajorRevisionNumber - - - - [F:8] = Major revision number - - Notes: - - - The lower six bits of major and minor firmware revision are exchanged in autonegotiation when the PHYID message is sent. */ - unsigned int firmwareMajorRevisionNumber : 8; /* 1E.0020.F:8 RO */ - /* [F:8] = Major revision number */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalFirmwareID_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global NVR Interface: 1E.0100 */ -/* Global NVR Interface: 1E.0100 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0100.7:0 R/W NVR Opcode [7:0] - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrOpcode - - Default = 0x03 - - NVR instruction opcode - - */ - unsigned int nvrOpcode : 8; /* 1E.0100.7:0 R/W Default = 0x03 */ - /* NVR instruction opcode - */ - /*! \brief 1E.0100.8 RO NVR Busy - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrBusy - - - - 1 = NVR is busy - 0 = NVR is ready - - - Notes: - When set to 1, the NVR is busy. A new NVR operation should not occur until this bit is 0. If the NVR clock is greater than 64/63 of the MDIO clock, this bit never needs to be polled when operating over the MDIO. */ - unsigned int nvrBusy : 1; /* 1E.0100.8 RO */ - /* 1 = NVR is busy - 0 = NVR is ready - */ - unsigned int reserved1 : 1; - /*! \brief 1E.0100.A R/W NVR Burst - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrBurst - - Default = 0x0 - - 0 = Single read or write operation of up to 4 bytes - 1 = Burst operation - - - Notes: - When this bit is set, the operation is a burst operation where more than 32-bits is read from the NVR or written to the NVR. This bit should be set to one until the last burst in the read or write operation, when it should be set to zero. It operates by gating the SPI clock, and not restarting it until new data is ready to be written, or the previous contents have been read. Each burst of data requires the NVR Execute Operation bit to be set to initiate the next phase. */ - unsigned int nvrBurst : 1; /* 1E.0100.A R/W Default = 0x0 */ - /* 0 = Single read or write operation of up to 4 bytes - 1 = Burst operation - */ - unsigned int reserved0 : 1; - /*! \brief 1E.0100.C R/WSC Reset NVR CRC - AQ_GlobalNvrInterface_HHD.u0.bits_0.resetNvrCrc - - Default = 0x0 - - 1 = Reset NVR Mailbox CRC calculation register - - - - Notes: - To prevent an erroneous answer, this bit should not be set at the same time the See NVR Operation Valid bit is set. */ - unsigned int resetNvrCrc : 1; /* 1E.0100.C R/WSC Default = 0x0 */ - /* 1 = Reset NVR Mailbox CRC calculation register - - */ - /*! \brief 1E.0100.D R/W Freeze NVR CRC - AQ_GlobalNvrInterface_HHD.u0.bits_0.freezeNvrCrc - - Default = 0x0 - - 1 = Freeze NVR Mailbox CRC calculation register - - - Notes: - To prevent an erroneous answer, this bit should not be set at the same time the See NVR Operation Valid bit is set. */ - unsigned int freezeNvrCrc : 1; /* 1E.0100.D R/W Default = 0x0 */ - /* 1 = Freeze NVR Mailbox CRC calculation register - */ - /*! \brief 1E.0100.E R/W NVR Write Mode - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrWriteMode - - Default = 0x0 - - 1 = Write to NVR - 0 = Read from NVR - - */ - unsigned int nvrWriteMode : 1; /* 1E.0100.E R/W Default = 0x0 */ - /* 1 = Write to NVR - 0 = Read from NVR - */ - /*! \brief 1E.0100.F R/WSC NVR Execute Operation - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrExecuteOperation - - Default = 0x0 - - 1 = Start NVR Operation - - - - Notes: - When set to 1, the NVR operation will begin. Ensure that the uP is stalled using the See MCP Run Stall bit to ensure no NVR contention. */ - unsigned int nvrExecuteOperation : 1; /* 1E.0100.F R/WSC Default = 0x0 */ - /* 1 = Start NVR Operation - - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0101.F:0 RO NVR Mailbox CRC [F:0] - AQ_GlobalNvrInterface_HHD.u1.bits_1.nvrMailboxCrc - - - - The running CRC-16 of everything passing through the NVR interface - - - Notes: - The CRC-16 over all data written or read through the NVR interface. The CRC-16 is calculated by dividing the data by: - x^16 + x^12 + x^5 + 1 */ - unsigned int nvrMailboxCrc : 16; /* 1E.0101.F:0 RO */ - /* The running CRC-16 of everything passing through the NVR interface - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0102.7:0 R/W NVR Address MSW [17:10] - AQ_GlobalNvrInterface_HHD.u2.bits_2.nvrAddressMSW - - Default = 0x00 - - NVR address MSW bits [17:10] - - - Notes: - The address of where to read and write from in the NVR. This is self-incrementing and will automatically increment after each read or write operation. The increment amount is based on the data length (i.e. increments by 4 if the data length is 4 bytes) */ - unsigned int nvrAddressMSW : 8; /* 1E.0102.7:0 R/W Default = 0x00 */ - /* NVR address MSW bits [17:10] - */ - unsigned int reserved0 : 8; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0103.F:0 R/W NVR Address LSW [F:0] - AQ_GlobalNvrInterface_HHD.u3.bits_3.nvrAddressLSW - - Default = 0x0000 - - NVR address LSW bits [F:0] - - - Notes: - The address of where to read and write from in the NVR. This is self-incrementing and will automatically increment after each read or write operation. */ - unsigned int nvrAddressLSW : 16; /* 1E.0103.F:0 R/W Default = 0x0000 */ - /* NVR address LSW bits [F:0] - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0104.F:0 R/W NVR Data MSW [1F:10] - AQ_GlobalNvrInterface_HHD.u4.bits_4.nvrDataMSW - - Default = 0x0000 - - NVR data MSW bits [1F:10] - - - Notes: - Data is stored and read-out from these registers in little-endian format for operations such as FLASH device ID, and for programming the processor. - - For instance the 64K Atmel device code reads out as two bytes 0x651F into the LSW register, whereas the datasheet indicates that 1F is the first byte read, followed by 65 as the second byte. - - To burst read and write these 4 bytes in the correct order (where DD is written to address x), they should be stored as: - - AA BB in the MSW - CC DD in the LSW. */ - unsigned int nvrDataMSW : 16; /* 1E.0104.F:0 R/W Default = 0x0000 */ - /* NVR data MSW bits [1F:10] - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0105.F:0 R/W NVR Data LSW [F:0] - AQ_GlobalNvrInterface_HHD.u5.bits_5.nvrDataLSW - - Default = 0x0000 - - NVR data LSW bits [F:0] - - - Notes: - Data is stored and read-out from these registers in little-endian format for operations such as FLASH device ID, and for programming the processor. - - For instance the 64K Atmel device code reads out as two bytes 0x651F into the LSW register, whereas the datasheet indicates that 1F is the first byte read, followed by 65 as the second byte. - To burst read and write these 4 bytes in the correct order (where DD is written to address x), they should be stored as: - - AA BB in the MSW - CC DD in the LSW. */ - unsigned int nvrDataLSW : 16; /* 1E.0105.F:0 R/W Default = 0x0000 */ - /* NVR data LSW bits [F:0] - */ - } bits_5; - uint16_t word_5; - } u5; -} AQ_GlobalNvrInterface_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Mailbox Interface: 1E.0200 */ -/* Global Mailbox Interface: 1E.0200 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Mailbox Interface */ - union - { - struct - { - unsigned int reserved2 : 8; - /*! \brief 1E.0200.8 RO uP Mailbox Busy - AQ_GlobalMailboxInterface_HHD.u0.bits_0.upMailboxBusy - - - - 1 = uP mailbox busy - 0 = uP mailbox ready - - - Notes: - In general the uP will respond within a few processor cycles to any PIF slave request, much faster than the MDIO. If the busy is asserted over multiple MDIO polling cycles, then a H/W error may have occurred and a Global S/W reset or uP reset is required. */ - unsigned int upMailboxBusy : 1; /* 1E.0200.8 RO */ - /* 1 = uP mailbox busy - 0 = uP mailbox ready - */ - unsigned int reserved1 : 3; - /*! \brief 1E.0200.C R/WSC Reset uP Mailbox CRC - AQ_GlobalMailboxInterface_HHD.u0.bits_0.resetUpMailboxCrc - - Default = 0x0 - - 1 = Reset uP mailbox CRC calculation register - - - */ - unsigned int resetUpMailboxCrc : 1; /* 1E.0200.C R/WSC Default = 0x0 */ - /* 1 = Reset uP mailbox CRC calculation register - - */ - unsigned int reserved0 : 1; - /*! \brief 1E.0200.E R/W uP Mailbox Write Mode - AQ_GlobalMailboxInterface_HHD.u0.bits_0.upMailboxWriteMode - - Default = 0x0 - - 1 = Write - 0 = Read - - - Notes: - Mailbox direction */ - unsigned int upMailboxWriteMode : 1; /* 1E.0200.E R/W Default = 0x0 */ - /* 1 = Write - 0 = Read - */ - /*! \brief 1E.0200.F R/WSC uP Mailbox Execute Operation - AQ_GlobalMailboxInterface_HHD.u0.bits_0.upMailboxExecuteOperation - - Default = 0x0 - - 1 = Start of mailbox Operation - - - - Notes: - Indicates mailbox is loaded and ready */ - unsigned int upMailboxExecuteOperation : 1; /* 1E.0200.F R/WSC Default = 0x0 */ - /* 1 = Start of mailbox Operation - - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0201.F:0 RO uP Mailbox CRC [F:0] - AQ_GlobalMailboxInterface_HHD.u1.bits_1.upMailboxCrc - - - - The running CRC-16 of everything passing through the mailbox interface - - */ - unsigned int upMailboxCrc : 16; /* 1E.0201.F:0 RO */ - /* The running CRC-16 of everything passing through the mailbox interface - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0202.F:0 R/W uP Mailbox Address MSW [1F:10] - AQ_GlobalMailboxInterface_HHD.u2.bits_2.upMailboxAddressMSW - - Default = 0x0000 - - uP Mailbox MSW address - - - Notes: - The address of where to read and write from in the Microcontroller Mailbox. This is self-incrementing and automatically increments after each read and write operation.PHY */ - unsigned int upMailboxAddressMSW : 16; /* 1E.0202.F:0 R/W Default = 0x0000 */ - /* uP Mailbox MSW address - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0203.1:0 RO uP Mailbox Address LSW Don't Care [1:0] - AQ_GlobalMailboxInterface_HHD.u3.bits_3.upMailboxAddressLSW_Don_tCare - - - - Least significant uP LSW Mailbox address bits [1:0] - - - Notes: - These bits are always set to 0 since each memory access is on a 4-byte boundary. */ - unsigned int upMailboxAddressLSW_Don_tCare : 2; /* 1E.0203.1:0 RO */ - /* Least significant uP LSW Mailbox address bits [1:0] - */ - /*! \brief 1E.0203.F:2 R/W uP Mailbox Address LSW [F:2] - AQ_GlobalMailboxInterface_HHD.u3.bits_3.upMailboxAddressLSW - - Default = 0x0000 - - uP LSW Mailbox address [F:2] - - - Notes: - The address of where to read and write from in the Microcontroller Mailbox. This is self-incrementing and automatically increments after each read and write operation.PHY */ - unsigned int upMailboxAddressLSW : 14; /* 1E.0203.F:2 R/W Default = 0x0000 */ - /* uP LSW Mailbox address [F:2] - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0204.F:0 R/W uP Mailbox Data MSW [1F:10] - AQ_GlobalMailboxInterface_HHD.u4.bits_4.upMailboxDataMSW - - Default = 0x0000 - - uP Mailbox data MSW - - */ - unsigned int upMailboxDataMSW : 16; /* 1E.0204.F:0 R/W Default = 0x0000 */ - /* uP Mailbox data MSW - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0205.F:0 R/W uP Mailbox Data LSW [F:0] - AQ_GlobalMailboxInterface_HHD.u5.bits_5.upMailboxDataLSW - - Default = 0x0000 - - uP Mailbox data LSW - - */ - unsigned int upMailboxDataLSW : 16; /* 1E.0205.F:0 R/W Default = 0x0000 */ - /* uP Mailbox data LSW - */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global Mailbox Interface */ - union - { - struct - { - unsigned int reserved1 : 1; - /*! \brief 1E.0206.1 R/W uP Mailbox CRC Read Enable - AQ_GlobalMailboxInterface_HHD.u6.bits_6.upMailboxCrcReadEnable - - Default = 0x0 - - 1 = Update uP mailbox CRC on read - - */ - unsigned int upMailboxCrcReadEnable : 1; /* 1E.0206.1 R/W Default = 0x0 */ - /* 1 = Update uP mailbox CRC on read - */ - unsigned int reserved0 : 14; - } bits_6; - uint16_t word_6; - } u6; -} AQ_GlobalMailboxInterface_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Microprocessor Scratch Pad: 1E.0300 */ -/* Global Microprocessor Scratch Pad: 1E.0300 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Microprocessor Scratch Pad */ - union - { - struct - { - /*! \brief 1E.0300.F:0 R/W Scratch Pad 1[F:0] - AQ_GlobalMicroprocessorScratchPad_HHD.u0.bits_0.scratchPad_1 - - Default = 0x0000 - - General Purpose Scratch Pad - */ - unsigned int scratchPad_1 : 16; /* 1E.0300.F:0 R/W Default = 0x0000 */ - /* General Purpose Scratch Pad */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Microprocessor Scratch Pad */ - union - { - struct - { - /*! \brief 1E.0301.F:0 R/W Scratch Pad 2 [F:0] - AQ_GlobalMicroprocessorScratchPad_HHD.u1.bits_1.scratchPad_2 - - Default = 0x0000 - - General Purpose Scratch Pad - */ - unsigned int scratchPad_2 : 16; /* 1E.0301.F:0 R/W Default = 0x0000 */ - /* General Purpose Scratch Pad */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalMicroprocessorScratchPad_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress Control Register: 1E.5002 */ -/* MSS Egress Control Register: 1E.5002 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress Control Register */ - union - { - struct - { - /*! \brief 1E.5002.0 R/W MSS Egress Soft Reset - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressSoftReset - - Default = 0x0 - - 1 = Soft reset - - - Notes: - S/W reset */ - unsigned int mssEgressSoftReset : 1; /* 1E.5002.0 R/W Default = 0x0 */ - /* 1 = Soft reset - */ - /*! \brief 1E.5002.1 R/W MSS Egress Drop KAY Packet - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressDropKayPacket - - Default = 0x0 - - 1 = Drop KAY packet - - - Notes: - Decides whether KAY packets have to be dropped */ - unsigned int mssEgressDropKayPacket : 1; /* 1E.5002.1 R/W Default = 0x0 */ - /* 1 = Drop KAY packet - */ - /*! \brief 1E.5002.2 R/W MSS Egress Drop EGPRC LUT Miss - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressDropEgprcLutMiss - - Default = 0x0 - - 1 = Drop Egress Classification LUT miss packets - - - - Notes: - Decides whether Egress Pre-Security Classification (EGPRC) LUT miss packets are to be dropped */ - unsigned int mssEgressDropEgprcLutMiss : 1; /* 1E.5002.2 R/W Default = 0x0 */ - /* 1 = Drop Egress Classification LUT miss packets - - */ - /*! \brief 1E.5002.3 R/W MSS Egress GCM Start - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressGcmStart - - Default = 0x0 - - 1 = Start GCM - - - - Notes: - Indicates GCM to start */ - unsigned int mssEgressGcmStart : 1; /* 1E.5002.3 R/W Default = 0x0 */ - /* 1 = Start GCM - - */ - /*! \brief 1E.5002.4 R/W MSS Egresss GCM Test Mode - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgresssGcmTestMode - - Default = 0x0 - - 1 = Enable GCM test mode - - - - Notes: - Enables GCM test mode */ - unsigned int mssEgresssGcmTestMode : 1; /* 1E.5002.4 R/W Default = 0x0 */ - /* 1 = Enable GCM test mode - - */ - /*! \brief 1E.5002.5 R/W MSS Egress Unmatched Use SC 0 - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressUnmatchedUseSc_0 - - Default = 0x0 - - 1 = Use SC 0 for unmatched packets - 0 = Unmatched packets are uncontrolled packets - - - - Notes: - Use SC-Index 0 as default SC for unmatched packets. Otherwise the packets are treated as uncontrolled packets. */ - unsigned int mssEgressUnmatchedUseSc_0 : 1; /* 1E.5002.5 R/W Default = 0x0 */ - /* 1 = Use SC 0 for unmatched packets - 0 = Unmatched packets are uncontrolled packets - - */ - /*! \brief 1E.5002.6 R/W MSS Egress Drop Invalid SA/SC Packets - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressDropInvalidSa_scPackets - - Default = 0x0 - - 1 = Drop invalid SA/SC packets - - - - Notes: - Enables dropping of invalid SA/SC packets. */ - unsigned int mssEgressDropInvalidSa_scPackets : 1; /* 1E.5002.6 R/W Default = 0x0 */ - /* 1 = Drop invalid SA/SC packets - - */ - /*! \brief 1E.5002.7 R/W MSS Egress Explicit SECTag Report Short Length - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressExplicitSectagReportShortLength - - Default = 0x0 - - Reserved - - - - Notes: - Unused. */ - unsigned int mssEgressExplicitSectagReportShortLength : 1; /* 1E.5002.7 R/W Default = 0x0 */ - /* Reserved - - */ - /*! \brief 1E.5002.8 R/W MSS Egress External Classification Enable - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressExternalClassificationEnable - - Default = 0x0 - - 1 = Drop EGPRC miss packets - - - - Notes: - If set, internal classification is bypassed. Should always be set to 0. */ - unsigned int mssEgressExternalClassificationEnable : 1; /* 1E.5002.8 R/W Default = 0x0 */ - /* 1 = Drop EGPRC miss packets - - */ - /*! \brief 1E.5002.9 R/W MSS Egress ICV LSB 8 Bytes Enable - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressIcvLsb_8BytesEnable - - Default = 0x0 - - 1 = Use LSB - 0 = Use MSB - - - - Notes: - This bit selects MSB or LSB 8 bytes selection in the case where the ICV is 8 bytes. - 0 = MSB is used. */ - unsigned int mssEgressIcvLsb_8BytesEnable : 1; /* 1E.5002.9 R/W Default = 0x0 */ - /* 1 = Use LSB - 0 = Use MSB - - */ - /*! \brief 1E.5002.A R/W MSS Egress High Priority - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressHighPriority - - Default = 0x0 - - 1 = MIB counter clear on read enable - - - - Notes: - If this bit is set to 1, read is given high priority and the MIB count value becomes 0 after read. */ - unsigned int mssEgressHighPriority : 1; /* 1E.5002.A R/W Default = 0x0 */ - /* 1 = MIB counter clear on read enable - - */ - /*! \brief 1E.5002.B R/W MSS Egress Clear Counter - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressClearCounter - - Default = 0x0 - - 1 = Clear all MIB counters - - - - Notes: - If this bit is set to 1, all MIB counters will be cleared. */ - unsigned int mssEgressClearCounter : 1; /* 1E.5002.B R/W Default = 0x0 */ - /* 1 = Clear all MIB counters - - */ - /*! \brief 1E.5002.C R/W MSS Egress Clear Global Time - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressClearGlobalTime - - Default = 0x0 - - 1 = Clear global time - - - - Notes: - Clear global time. */ - unsigned int mssEgressClearGlobalTime : 1; /* 1E.5002.C R/W Default = 0x0 */ - /* 1 = Clear global time - - */ - /*! \brief 1E.5002.F:D R/W MSS Egress Ethertype Explicit SECTag LSB [2:0] - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressEthertypeExplicitSectagLsb - - Default = 0x0 - - Ethertype for explicit SECTag bits 2:0. - - - Notes: - Ethertype for explicity SECTag. */ - unsigned int mssEgressEthertypeExplicitSectagLsb : 3; /* 1E.5002.F:D R/W Default = 0x0 */ - /* Ethertype for explicit SECTag bits 2:0. - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress Control Register */ - union - { - struct - { - /*! \brief 1E.5003.C:0 R/W MSS Egress Ethertype Explicit SECTag MSB [F:3] - AQ_MssEgressControlRegister_HHD.u1.bits_1.mssEgressEthertypeExplicitSectagMsb - - Default = 0x0000 - - Ethertype for explicit SECTag bits 15:3. - - - Notes: - Ethertype for explicity SECTag. */ - unsigned int mssEgressEthertypeExplicitSectagMsb : 13; /* 1E.5003.C:0 R/W Default = 0x0000 */ - /* Ethertype for explicit SECTag bits 15:3. - */ - unsigned int reserved0 : 3; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress VLAN TPID 0 Register: 1E.5008 */ -/* MSS Egress VLAN TPID 0 Register: 1E.5008 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress VLAN TPID 0 Register */ - union - { - struct - { - /*! \brief 1E.5008.F:0 R/W MSS Egress VLAN STag TPID [F:0] - AQ_MssEgressVlanTpid_0Register_HHD.u0.bits_0.mssEgressVlanStagTpid - - Default = 0x0000 - - STag TPID - - - Notes: - Service Tag Protocol Identifier (TPID) values to identify a VLAN tag. The " See SEC Egress VLAN CP Tag Parse STag " bit must be set to 1 for the incoming packet's TPID to be parsed. */ - unsigned int mssEgressVlanStagTpid : 16; /* 1E.5008.F:0 R/W Default = 0x0000 */ - /* STag TPID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress VLAN TPID 0 Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressVlanTpid_0Register_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress VLAN TPID 1 Register: 1E.500A */ -/* MSS Egress VLAN TPID 1 Register: 1E.500A */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress VLAN TPID 1 Register */ - union - { - struct - { - /*! \brief 1E.500A.F:0 R/W MSS Egress VLAN QTag TPID [F:0] - AQ_MssEgressVlanTpid_1Register_HHD.u0.bits_0.mssEgressVlanQtagTpid - - Default = 0x0000 - - QTag TPID - - - Notes: - Customer Tag Protocol Identifier (TPID) values to identify a VLAN tag. The " See SEC Egress VLAN CP Tag Parse QTag " bit must be set to 1 for the incoming packet's TPID to be parsed. */ - unsigned int mssEgressVlanQtagTpid : 16; /* 1E.500A.F:0 R/W Default = 0x0000 */ - /* QTag TPID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress VLAN TPID 1 Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressVlanTpid_1Register_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress VLAN Control Register: 1E.500C */ -/* MSS Egress VLAN Control Register: 1E.500C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress VLAN Control Register */ - union - { - struct - { - /*! \brief 1E.500C.F:0 R/W MSS Egress VLAN UP Map Table [F:0] - AQ_MssEgressVlanControlRegister_HHD.u0.bits_0.mssEgressVlanUpMapTable - - Default = 0x0000 - - UP Map table bits 15:0 - - - Notes: - If there is a customer TPID Tag match and no service TPID Tag match or the service TPID Tag match is disabled, the outer TAG's PCP is used to index into this map table to generate the packets user priority. - 2:0 : UP value for customer Tag PCP 0x0 - 5:3: UP value for customer Tag PCP 0x0 - 8:6 : UP value for customer Tag PCP 0x0 - 11:9 : UP value for customer Tag PCP 0x0 - 14:12 : UP value for customer Tag PCP 0x0 - 17:15 : UP value for customer Tag PCP 0x0 - 20:18 : UP value for customer Tag PCP 0x0 - 23:21 : UP value for customer Tag PCP 0x0 */ - unsigned int mssEgressVlanUpMapTable : 16; /* 1E.500C.F:0 R/W Default = 0x0000 */ - /* UP Map table bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress VLAN Control Register */ - union - { - struct - { - /*! \brief 1E.500D.7:0 R/W MSS Egress VLAN UP Map Table MSW [17:10] - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanUpMapTableMSW - - Default = 0x00 - - UP Map table bits 23:16 - - - Notes: - If there is a customer TPID Tag match and no service TPID Tag match or the service TPID Tag match is disabled, the outer TAG's PCP is used to index into this map table to generate the packets user priority. - 2:0 : UP value for customer Tag PCP 0x0 - 5:3: UP value for customer Tag PCP 0x0 - 8:6 : UP value for customer Tag PCP 0x0 - 11:9 : UP value for customer Tag PCP 0x0 - 14:12 : UP value for customer Tag PCP 0x0 - 17:15 : UP value for customer Tag PCP 0x0 - 20:18 : UP value for customer Tag PCP 0x0 - 23:21 : UP value for customer Tag PCP 0x0 */ - unsigned int mssEgressVlanUpMapTableMSW : 8; /* 1E.500D.7:0 R/W Default = 0x00 */ - /* UP Map table bits 23:16 - */ - /*! \brief 1E.500D.A:8 R/W MSS Egress VLAN UP Default [2:0] - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanUpDefault - - Default = 0x0 - - UP default - - - Notes: - User priority default */ - unsigned int mssEgressVlanUpDefault : 3; /* 1E.500D.A:8 R/W Default = 0x0 */ - /* UP default - */ - /*! \brief 1E.500D.B R/W MSS Egress VLAN STag UP Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanStagUpParseEnable - - Default = 0x0 - - VLAN CP Tag STag UP enable - - - Notes: - Enable controlled port service VLAN service Tag user priority field parsing. */ - unsigned int mssEgressVlanStagUpParseEnable : 1; /* 1E.500D.B R/W Default = 0x0 */ - /* VLAN CP Tag STag UP enable - */ - /*! \brief 1E.500D.C R/W MSS Egress VLAN QTag UP Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanQtagUpParseEnable - - Default = 0x0 - - VLAN CP Tag QTag UP enable - - - Notes: - Enable controlled port customer VLAN customer Tag user priority field parsing. */ - unsigned int mssEgressVlanQtagUpParseEnable : 1; /* 1E.500D.C R/W Default = 0x0 */ - /* VLAN CP Tag QTag UP enable - */ - /*! \brief 1E.500D.D R/W MSS Egress VLAN QinQ Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanQinqParseEnable - - Default = 0x0 - - VLAN CP Tag Parse QinQ - - - Notes: - Enable controlled port VLAN QinQ Tag parsing. When this bit is set to 1 both the outer and inner VLAN Tags will be parsed. */ - unsigned int mssEgressVlanQinqParseEnable : 1; /* 1E.500D.D R/W Default = 0x0 */ - /* VLAN CP Tag Parse QinQ - */ - /*! \brief 1E.500D.E R/W MSS Egress VLAN STag Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanStagParseEnable - - Default = 0x0 - - 1 = Enable VLAN STag parsing - - - Notes: - Enable controlled port VLAN service Tag parsing. When this bit is set to 1, the incoming packets outer TPID will be compared with the configured " See SEC Egress TPID 0 [F:0] " for matching. If the " See SEC Egress VLAN CP Tag Parse QinQ " bit is set to1, this will also be used to compare the incoming packet's inner TPID. */ - unsigned int mssEgressVlanStagParseEnable : 1; /* 1E.500D.E R/W Default = 0x0 */ - /* 1 = Enable VLAN STag parsing - */ - /*! \brief 1E.500D.F R/W MSS Egress VLAN QTag Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanQtagParseEnable - - Default = 0x0 - - 1 = Enable VLAN QTag parsing - - - Notes: - Enable controlled port VLAN customer Tag parsing. When this bit is set to 1, the incoming packet's outer TPID will be compared with the configured " See SEC Egress TPID 1 [F:0] " for matching. If the " See SEC Egress VLAN CP Tag Parse QinQ " bit is set to1, this will also be used to compare the incoming packet's inner TPID. */ - unsigned int mssEgressVlanQtagParseEnable : 1; /* 1E.500D.F R/W Default = 0x0 */ - /* 1 = Enable VLAN QTag parsing - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressVlanControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress PN Control Register: 1E.500E */ -/* MSS Egress PN Control Register: 1E.500E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress PN Control Register */ - union - { - struct - { - /*! \brief 1E.500E.F:0 R/W MSS Egress SA PN Threshold LSW [F:0] - AQ_MssEgressPnControlRegister_HHD.u0.bits_0.mssEgressSaPnThresholdLSW - - Default = 0x0000 - - PN threshold bits 15:0 - - - Notes: - Egress PN threshold to generate SA threshold interrupt. */ - unsigned int mssEgressSaPnThresholdLSW : 16; /* 1E.500E.F:0 R/W Default = 0x0000 */ - /* PN threshold bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress PN Control Register */ - union - { - struct - { - /*! \brief 1E.500F.F:0 R/W MSS Egress SA PN Threshold MSW [1F:10] - AQ_MssEgressPnControlRegister_HHD.u1.bits_1.mssEgressSaPnThresholdMSW - - Default = 0x0000 - - PN threshold bits 31:16 - - - Notes: - Egress PN threshold to generate SA threshold interrupt. */ - unsigned int mssEgressSaPnThresholdMSW : 16; /* 1E.500F.F:0 R/W Default = 0x0000 */ - /* PN threshold bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressPnControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress MTU Size Control Register: 1E.5010 */ -/* MSS Egress MTU Size Control Register: 1E.5010 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress MTU Size Control Register */ - union - { - struct - { - /*! \brief 1E.5010.F:0 R/W MSS Egress Controlled Packet MTU Size [F:0] - AQ_MssEgressMtuSizeControlRegister_HHD.u0.bits_0.mssEgressControlledPacketMtuSize - - Default = 0x05DC - - Maximum transmission unit for controlled packet - - - Notes: - Maximum transmission unit of controlled packet */ - unsigned int mssEgressControlledPacketMtuSize : 16; /* 1E.5010.F:0 R/W Default = 0x05DC */ - /* Maximum transmission unit for controlled packet - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress MTU Size Control Register */ - union - { - struct - { - /*! \brief 1E.5011.F:0 R/W MSS Egress Uncontrolled Packet MTU Size [F:0] - AQ_MssEgressMtuSizeControlRegister_HHD.u1.bits_1.mssEgressUncontrolledPacketMtuSize - - Default = 0x05DC - - Maximum transmission unit for uncontrolled packet - - - Notes: - Maximum transmission unit of uncontrolled packet */ - unsigned int mssEgressUncontrolledPacketMtuSize : 16; /* 1E.5011.F:0 R/W Default = 0x05DC */ - /* Maximum transmission unit for uncontrolled packet - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressMtuSizeControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress Interrupt Status Register: 1E.505C */ -/* MSS Egress Interrupt Status Register: 1E.505C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.505C.0 COW MSS Egress Master Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressMasterInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when any one of the above interrupt and the corresponding interrupt enable are both set. The interrupt enable for this bit must also be set for this bit to be set. */ - unsigned int mssEgressMasterInterrupt : 1; /* 1E.505C.0 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.505C.1 COW MSS Egress SA Expired Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressSaExpiredInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches all ones saturation. */ - unsigned int mssEgressSaExpiredInterrupt : 1; /* 1E.505C.1 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.505C.2 COW MSS Egress SA Threshold Expired Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressSaThresholdExpiredInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches the See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssEgressSaThresholdExpiredInterrupt : 1; /* 1E.505C.2 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.505C.3 COW MSS Egress MIB Saturation Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressMibSaturationInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the MIB counters reaches all ones saturation. */ - unsigned int mssEgressMibSaturationInterrupt : 1; /* 1E.505C.3 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.505C.4 COW MSS Egress ECC Error Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressEccErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when anyone of the memories detects an ECC error. */ - unsigned int mssEgressEccErrorInterrupt : 1; /* 1E.505C.4 COW Default = 0x0 */ - /* 1 = Interrupt - */ - unsigned int reserved0 : 11; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress Interrupt Status Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressInterruptStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress Interrupt Mask Register: 1E.505E */ -/* MSS Egress Interrupt Mask Register: 1E.505E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress Interrupt Mask Register */ - union - { - struct - { - /*! \brief 1E.505E.0 COW MSS Egress Master Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressMasterInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. */ - unsigned int mssEgressMasterInterruptEnable : 1; /* 1E.505E.0 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.505E.1 COW MSS Egress SA Expired Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressSaExpiredInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches all ones saturation. */ - unsigned int mssEgressSaExpiredInterruptEnable : 1; /* 1E.505E.1 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.505E.2 COW MSS Egress SA Expired Threshold Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressSaExpiredThresholdInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssEgressSaExpiredThresholdInterruptEnable : 1; /* 1E.505E.2 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.505E.3 COW MSS Egress MIB Saturation Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressMibSaturationInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. This bit is set when the MIB counters reaches all ones saturation. */ - unsigned int mssEgressMibSaturationInterruptEnable : 1; /* 1E.505E.3 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.505E.4 COW MSS Egress ECC Error Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressEccErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. This bit is set when anyone of the memories detects an ECC error. */ - unsigned int mssEgressEccErrorInterruptEnable : 1; /* 1E.505E.4 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - unsigned int reserved0 : 11; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress Interrupt Mask Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressInterruptMaskRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress SA Expired Status Register: 1E.5060 */ -/* MSS Egress SA Expired Status Register: 1E.5060 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress SA Expired Status Register */ - union - { - struct - { - /*! \brief 1E.5060.F:0 COW MSS Egress SA Expired LSW [F:0] - AQ_MssEgressSaExpiredStatusRegister_HHD.u0.bits_0.mssEgressSaExpiredLSW - - Default = 0x0000 - - SA expired bits 15:0 - - - Notes: - Write these bits to 1 to clear. - When set, these bits identify the SA that has expired when the SA PN reaches all-ones saturation. */ - unsigned int mssEgressSaExpiredLSW : 16; /* 1E.5060.F:0 COW Default = 0x0000 */ - /* SA expired bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress SA Expired Status Register */ - union - { - struct - { - /*! \brief 1E.5061.F:0 COW MSS Egress SA Expired MSW [1F:10] - AQ_MssEgressSaExpiredStatusRegister_HHD.u1.bits_1.mssEgressSaExpiredMSW - - Default = 0x0000 - - SA expired bits 31:16 - - - Notes: - Write these bits to 1 to clear. - When set, these bits identify the SA that has expired when the SA PN reaches all-ones saturation. */ - unsigned int mssEgressSaExpiredMSW : 16; /* 1E.5061.F:0 COW Default = 0x0000 */ - /* SA expired bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressSaExpiredStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress SA Threshold Expired Status Register: 1E.5062 */ -/* MSS Egress SA Threshold Expired Status Register: 1E.5062 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress SA Threshold Expired Status Register */ - union - { - struct - { - /*! \brief 1E.5062.F:0 COW MSS Egress SA Threshold Expired LSW [F:0] - AQ_MssEgressSaThresholdExpiredStatusRegister_HHD.u0.bits_0.mssEgressSaThresholdExpiredLSW - - Default = 0x0000 - - SA threshold expired bits 15:0 - - - Notes: - Write these bits to 1 to clear. - When set, these bits identify the SA that has expired when the SA PN has reached the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssEgressSaThresholdExpiredLSW : 16; /* 1E.5062.F:0 COW Default = 0x0000 */ - /* SA threshold expired bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress SA Threshold Expired Status Register */ - union - { - struct - { - /*! \brief 1E.5063.F:0 COW MSS Egress SA Threshold Expired MSW [1F:10] - AQ_MssEgressSaThresholdExpiredStatusRegister_HHD.u1.bits_1.mssEgressSaThresholdExpiredMSW - - Default = 0x0000 - - SA threshold expired bits 31:16 - - - Notes: - Write these bits to 1 to clear. - When set, these bits identify the SA that has expired when the SA PN has reached the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssEgressSaThresholdExpiredMSW : 16; /* 1E.5063.F:0 COW Default = 0x0000 */ - /* SA threshold expired bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressSaThresholdExpiredStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress ECC Interrupt Status Register: 1E.5064 */ -/* MSS Egress ECC Interrupt Status Register: 1E.5064 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress ECC Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.5064.F:0 COW MSS Egress SA ECC Error Interrupt LSW [F:0] - AQ_MssEgressEccInterruptStatusRegister_HHD.u0.bits_0.mssEgressSaEccErrorInterruptLSW - - Default = 0x0000 - - SA ECC error interrupt bits 15:0 - - - Notes: - Write these bits to 1 to clear. - When set to 1, indicates that an ECC error occured for the SA. */ - unsigned int mssEgressSaEccErrorInterruptLSW : 16; /* 1E.5064.F:0 COW Default = 0x0000 */ - /* SA ECC error interrupt bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress ECC Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.5065.F:0 COW MSS Egress SA ECC Error Interrupt MSW [1F:10] - AQ_MssEgressEccInterruptStatusRegister_HHD.u1.bits_1.mssEgressSaEccErrorInterruptMSW - - Default = 0x0000 - - SA ECC error interrupt bits 31:16 - - - Notes: - Write these bits to 1 to clear. - When set to 1, indicates that an ECC error occured for the SA. */ - unsigned int mssEgressSaEccErrorInterruptMSW : 16; /* 1E.5065.F:0 COW Default = 0x0000 */ - /* SA ECC error interrupt bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressEccInterruptStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress LUT Address Control Register: 1E.5080 */ -/* MSS Egress LUT Address Control Register: 1E.5080 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress LUT Address Control Register */ - union - { - struct - { - /*! \brief 1E.5080.8:0 R/W MSS Egress LUT Address [8:0] - AQ_MssEgressLutAddressControlRegister_HHD.u0.bits_0.mssEgressLutAddress - - Default = 0x000 - - LUT address - - */ - unsigned int mssEgressLutAddress : 9; /* 1E.5080.8:0 R/W Default = 0x000 */ - /* LUT address - */ - unsigned int reserved0 : 3; - /*! \brief 1E.5080.F:C R/W MSS Egress LUT Select [3:0] - AQ_MssEgressLutAddressControlRegister_HHD.u0.bits_0.mssEgressLutSelect - - Default = 0x0 - - LUT select - - - Notes: - 0x0 : Egress MAC Control FIlter (CTLF) LUT - 0x1 : Egress Classification LUT - 0x2 : Egress SC/SA LUT - 0x3 : Egress SMIB */ - unsigned int mssEgressLutSelect : 4; /* 1E.5080.F:C R/W Default = 0x0 */ - /* LUT select - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_MssEgressLutAddressControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress LUT Control Register: 1E.5081 */ -/* MSS Egress LUT Control Register: 1E.5081 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress LUT Control Register */ - union - { - struct - { - unsigned int reserved0 : 14; - /*! \brief 1E.5081.E R/W MSS Egress LUT Read - AQ_MssEgressLutControlRegister_HHD.u0.bits_0.mssEgressLutRead - - Default = 0x0 - - 1 = LUT read - - - Notes: - Setting this bit to 1, will read the LUT. This bit will automatically clear to 0. */ - unsigned int mssEgressLutRead : 1; /* 1E.5081.E R/W Default = 0x0 */ - /* 1 = LUT read - */ - /*! \brief 1E.5081.F R/W MSS Egress LUT Write - AQ_MssEgressLutControlRegister_HHD.u0.bits_0.mssEgressLutWrite - - Default = 0x0 - - 1 = LUT write - - - Notes: - Setting this bit to 1, will write the LUT. This bit will automatically clear to 0. */ - unsigned int mssEgressLutWrite : 1; /* 1E.5081.F R/W Default = 0x0 */ - /* 1 = LUT write - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_MssEgressLutControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress LUT Data Control Register: 1E.50A0 */ -/* MSS Egress LUT Data Control Register: 1E.50A0 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A0.F:0 R/W MSS Egress LUT Data 0 [F:0] - AQ_MssEgressLutDataControlRegister_HHD.u0.bits_0.mssEgressLutData_0 - - Default = 0x0000 - - LUT data bits 15:0 - - */ - unsigned int mssEgressLutData_0 : 16; /* 1E.50A0.F:0 R/W Default = 0x0000 */ - /* LUT data bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A1.F:0 R/W MSS Egress LUT Data 1 [1F:10] - AQ_MssEgressLutDataControlRegister_HHD.u1.bits_1.mssEgressLutData_1 - - Default = 0x0000 - - LUT data bits 31:16 - - */ - unsigned int mssEgressLutData_1 : 16; /* 1E.50A1.F:0 R/W Default = 0x0000 */ - /* LUT data bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A2.F:0 R/W MSS Egress LUT Data 2 [2F:20] - AQ_MssEgressLutDataControlRegister_HHD.u2.bits_2.mssEgressLutData_2 - - Default = 0x0000 - - LUT data bits 47:32 - - */ - unsigned int mssEgressLutData_2 : 16; /* 1E.50A2.F:0 R/W Default = 0x0000 */ - /* LUT data bits 47:32 - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A3.F:0 R/W MSS Egress LUT Data 3 [3F:30] - AQ_MssEgressLutDataControlRegister_HHD.u3.bits_3.mssEgressLutData_3 - - Default = 0x0000 - - LUT data bits 63:48 - - */ - unsigned int mssEgressLutData_3 : 16; /* 1E.50A3.F:0 R/W Default = 0x0000 */ - /* LUT data bits 63:48 - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A4.F:0 R/W MSS Egress LUT Data 4 [4F:40] - AQ_MssEgressLutDataControlRegister_HHD.u4.bits_4.mssEgressLutData_4 - - Default = 0x0000 - - LUT data bits 79:64 - - */ - unsigned int mssEgressLutData_4 : 16; /* 1E.50A4.F:0 R/W Default = 0x0000 */ - /* LUT data bits 79:64 - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A5.F:0 R/W MSS Egress LUT Data 5 [5F:50] - AQ_MssEgressLutDataControlRegister_HHD.u5.bits_5.mssEgressLutData_5 - - Default = 0x0000 - - LUT data bits 95:80 - - */ - unsigned int mssEgressLutData_5 : 16; /* 1E.50A5.F:0 R/W Default = 0x0000 */ - /* LUT data bits 95:80 - */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A6.F:0 R/W MSS Egress LUT Data 6 [6F:60] - AQ_MssEgressLutDataControlRegister_HHD.u6.bits_6.mssEgressLutData_6 - - Default = 0x0000 - - LUT data bits 111:96 - - */ - unsigned int mssEgressLutData_6 : 16; /* 1E.50A6.F:0 R/W Default = 0x0000 */ - /* LUT data bits 111:96 - */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A7.F:0 R/W MSS Egress LUT Data 7 [7F:70] - AQ_MssEgressLutDataControlRegister_HHD.u7.bits_7.mssEgressLutData_7 - - Default = 0x0000 - - LUT data bits 127:112 - - */ - unsigned int mssEgressLutData_7 : 16; /* 1E.50A7.F:0 R/W Default = 0x0000 */ - /* LUT data bits 127:112 - */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A8.F:0 R/W MSS Egress LUT Data 8 [8F:80] - AQ_MssEgressLutDataControlRegister_HHD.u8.bits_8.mssEgressLutData_8 - - Default = 0x0000 - - LUT data bits 143:128 - - */ - unsigned int mssEgressLutData_8 : 16; /* 1E.50A8.F:0 R/W Default = 0x0000 */ - /* LUT data bits 143:128 - */ - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A9.F:0 R/W MSS Egress LUT Data 9 [9F:90] - AQ_MssEgressLutDataControlRegister_HHD.u9.bits_9.mssEgressLutData_9 - - Default = 0x0000 - - LUT data bits 159:144 - - */ - unsigned int mssEgressLutData_9 : 16; /* 1E.50A9.F:0 R/W Default = 0x0000 */ - /* LUT data bits 159:144 - */ - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Union for bit and word level access of word 10 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AA.F:0 R/W MSS Egress LUT Data 10 [AF:A0] - AQ_MssEgressLutDataControlRegister_HHD.u10.bits_10.mssEgressLutData_10 - - Default = 0x0000 - - LUT data bits 175:160 - - */ - unsigned int mssEgressLutData_10 : 16; /* 1E.50AA.F:0 R/W Default = 0x0000 */ - /* LUT data bits 175:160 - */ - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Union for bit and word level access of word 11 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AB.F:0 R/W MSS Egress LUT Data 11 [BF:B0] - AQ_MssEgressLutDataControlRegister_HHD.u11.bits_11.mssEgressLutData_11 - - Default = 0x0000 - - LUT data bits 191:176 - - */ - unsigned int mssEgressLutData_11 : 16; /* 1E.50AB.F:0 R/W Default = 0x0000 */ - /* LUT data bits 191:176 - */ - } bits_11; - uint16_t word_11; - } u11; - /*! \brief Union for bit and word level access of word 12 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AC.F:0 R/W MSS Egress LUT Data 12 [CF:C0] - AQ_MssEgressLutDataControlRegister_HHD.u12.bits_12.mssEgressLutData_12 - - Default = 0x0000 - - LUT data bits 207:192 - - */ - unsigned int mssEgressLutData_12 : 16; /* 1E.50AC.F:0 R/W Default = 0x0000 */ - /* LUT data bits 207:192 - */ - } bits_12; - uint16_t word_12; - } u12; - /*! \brief Union for bit and word level access of word 13 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AD.F:0 R/W MSS Egress LUT Data 13 [DF:D0] - AQ_MssEgressLutDataControlRegister_HHD.u13.bits_13.mssEgressLutData_13 - - Default = 0x0000 - - LUT data bits 223:208 - - */ - unsigned int mssEgressLutData_13 : 16; /* 1E.50AD.F:0 R/W Default = 0x0000 */ - /* LUT data bits 223:208 - */ - } bits_13; - uint16_t word_13; - } u13; - /*! \brief Union for bit and word level access of word 14 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AE.F:0 R/W MSS Egress LUT Data 14 [EF:E0] - AQ_MssEgressLutDataControlRegister_HHD.u14.bits_14.mssEgressLutData_14 - - Default = 0x0000 - - LUT data bits 239:224 - - */ - unsigned int mssEgressLutData_14 : 16; /* 1E.50AE.F:0 R/W Default = 0x0000 */ - /* LUT data bits 239:224 - */ - } bits_14; - uint16_t word_14; - } u14; - /*! \brief Union for bit and word level access of word 15 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AF.F:0 R/W MSS Egress LUT Data 15 [FF:F0] - AQ_MssEgressLutDataControlRegister_HHD.u15.bits_15.mssEgressLutData_15 - - Default = 0x0000 - - LUT data bits 255:240 - - */ - unsigned int mssEgressLutData_15 : 16; /* 1E.50AF.F:0 R/W Default = 0x0000 */ - /* LUT data bits 255:240 - */ - } bits_15; - uint16_t word_15; - } u15; - /*! \brief Union for bit and word level access of word 16 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B0.F:0 R/W MSS Egress LUT Data 16 [10F:100] - AQ_MssEgressLutDataControlRegister_HHD.u16.bits_16.mssEgressLutData_16 - - Default = 0x0000 - - LUT data bits 271:256 - - */ - unsigned int mssEgressLutData_16 : 16; /* 1E.50B0.F:0 R/W Default = 0x0000 */ - /* LUT data bits 271:256 - */ - } bits_16; - uint16_t word_16; - } u16; - /*! \brief Union for bit and word level access of word 17 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B1.F:0 R/W MSS Egress LUT Data 17 [11F:110] - AQ_MssEgressLutDataControlRegister_HHD.u17.bits_17.mssEgressLutData_17 - - Default = 0x0000 - - LUT data bits 287:272 - - */ - unsigned int mssEgressLutData_17 : 16; /* 1E.50B1.F:0 R/W Default = 0x0000 */ - /* LUT data bits 287:272 - */ - } bits_17; - uint16_t word_17; - } u17; - /*! \brief Union for bit and word level access of word 18 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B2.F:0 R/W MSS Egress LUT Data 18 [12F:120] - AQ_MssEgressLutDataControlRegister_HHD.u18.bits_18.mssEgressLutData_18 - - Default = 0x0000 - - LUT data bits 303:288 - - */ - unsigned int mssEgressLutData_18 : 16; /* 1E.50B2.F:0 R/W Default = 0x0000 */ - /* LUT data bits 303:288 - */ - } bits_18; - uint16_t word_18; - } u18; - /*! \brief Union for bit and word level access of word 19 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B3.F:0 R/W MSS Egress LUT Data 19 [13F:130] - AQ_MssEgressLutDataControlRegister_HHD.u19.bits_19.mssEgressLutData_19 - - Default = 0x0000 - - LUT data bits 319:304 - - */ - unsigned int mssEgressLutData_19 : 16; /* 1E.50B3.F:0 R/W Default = 0x0000 */ - /* LUT data bits 319:304 - */ - } bits_19; - uint16_t word_19; - } u19; - /*! \brief Union for bit and word level access of word 20 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B4.F:0 R/W MSS Egress LUT Data 20 [14F:140] - AQ_MssEgressLutDataControlRegister_HHD.u20.bits_20.mssEgressLutData_20 - - Default = 0x0000 - - LUT data bits 335:320 - - */ - unsigned int mssEgressLutData_20 : 16; /* 1E.50B4.F:0 R/W Default = 0x0000 */ - /* LUT data bits 335:320 - */ - } bits_20; - uint16_t word_20; - } u20; - /*! \brief Union for bit and word level access of word 21 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B5.F:0 R/W MSS Egress LUT Data 21 [15F:150] - AQ_MssEgressLutDataControlRegister_HHD.u21.bits_21.mssEgressLutData_21 - - Default = 0x0000 - - LUT data bits 351:336 - - */ - unsigned int mssEgressLutData_21 : 16; /* 1E.50B5.F:0 R/W Default = 0x0000 */ - /* LUT data bits 351:336 - */ - } bits_21; - uint16_t word_21; - } u21; - /*! \brief Union for bit and word level access of word 22 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B6.F:0 R/W MSS Egress LUT Data 22 [16F:160] - AQ_MssEgressLutDataControlRegister_HHD.u22.bits_22.mssEgressLutData_22 - - Default = 0x0000 - - LUT data bits 367:352 - - */ - unsigned int mssEgressLutData_22 : 16; /* 1E.50B6.F:0 R/W Default = 0x0000 */ - /* LUT data bits 367:352 - */ - } bits_22; - uint16_t word_22; - } u22; - /*! \brief Union for bit and word level access of word 23 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B7.F:0 R/W MSS Egress LUT Data 23 [17F:170] - AQ_MssEgressLutDataControlRegister_HHD.u23.bits_23.mssEgressLutData_23 - - Default = 0x0000 - - LUT data bits 383:368 - - */ - unsigned int mssEgressLutData_23 : 16; /* 1E.50B7.F:0 R/W Default = 0x0000 */ - /* LUT data bits 383:368 - */ - } bits_23; - uint16_t word_23; - } u23; - /*! \brief Union for bit and word level access of word 24 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B8.F:0 R/W MSS Egress LUT Data 24 [18F:180] - AQ_MssEgressLutDataControlRegister_HHD.u24.bits_24.mssEgressLutData_24 - - Default = 0x0000 - - LUT data bits 399:384 - - */ - unsigned int mssEgressLutData_24 : 16; /* 1E.50B8.F:0 R/W Default = 0x0000 */ - /* LUT data bits 399:384 - */ - } bits_24; - uint16_t word_24; - } u24; - /*! \brief Union for bit and word level access of word 25 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B9.F:0 R/W MSS Egress LUT Data 25 [19F:190] - AQ_MssEgressLutDataControlRegister_HHD.u25.bits_25.mssEgressLutData_25 - - Default = 0x0000 - - LUT data bits 415:400 - - */ - unsigned int mssEgressLutData_25 : 16; /* 1E.50B9.F:0 R/W Default = 0x0000 */ - /* LUT data bits 415:400 - */ - } bits_25; - uint16_t word_25; - } u25; - /*! \brief Union for bit and word level access of word 26 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50BA.F:0 R/W MSS Egress LUT Data 26 [1AF:1A0] - AQ_MssEgressLutDataControlRegister_HHD.u26.bits_26.mssEgressLutData_26 - - Default = 0x0000 - - LUT data bits 431:416 - - */ - unsigned int mssEgressLutData_26 : 16; /* 1E.50BA.F:0 R/W Default = 0x0000 */ - /* LUT data bits 431:416 - */ - } bits_26; - uint16_t word_26; - } u26; - /*! \brief Union for bit and word level access of word 27 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50BB.F:0 R/W MSS Egress LUT Data 27 [1BF:1B0] - AQ_MssEgressLutDataControlRegister_HHD.u27.bits_27.mssEgressLutData_27 - - Default = 0x0000 - - LUT data bits 447:432 - - */ - unsigned int mssEgressLutData_27 : 16; /* 1E.50BB.F:0 R/W Default = 0x0000 */ - /* LUT data bits 447:432 - */ - } bits_27; - uint16_t word_27; - } u27; -} AQ_MssEgressLutDataControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System General Control Register: 1E.6004 */ -/* MSM System General Control Register: 1E.6004 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System General Control Register */ - union - { - struct - { - /*! \brief 1E.6004.0 R/W MSM System Tx Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemTxEnable - - Default = 0x0 - - 1 = Tx enable - - Notes: - MAC Rx path enable. Should be set to 1 to enable the MAC Rx path. Should be set to 0 to disable the MAC Rx path. */ - unsigned int msmSystemTxEnable : 1; /* 1E.6004.0 R/W Default = 0x0 */ - /* 1 = Tx enable */ - /*! \brief 1E.6004.1 R/W MSM System Rx Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemRxEnable - - Default = 0x0 - - 1 = Rx enable - - Notes: - MAC Tx path enable. Should be set to 1 to enable the MAC Tx path. Should be set to 0 to disable the MAC Tx path. */ - unsigned int msmSystemRxEnable : 1; /* 1E.6004.1 R/W Default = 0x0 */ - /* 1 = Rx enable */ - unsigned int reserved0 : 1; - /*! \brief 1E.6004.3 R/W MSM System WAN Mode - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemWanMode - - Default = 0x0 - - 1 = WAN mode - 0 = LAN mode - - - Notes: - WAN mode enable. Sets WAN mode when set to 1 and LAN mode when set to 0. Note: When changing the mode, verifiy correct setting of the Tx IPG. */ - unsigned int msmSystemWanMode : 1; /* 1E.6004.3 R/W Default = 0x0 */ - /* 1 = WAN mode - 0 = LAN mode - */ - /*! \brief 1E.6004.4 R/W MSM System Promiscuous Mode - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPromiscuousMode - - Default = 0x0 - - 1 = Promiscuous mode - - - Notes: - When set to 1, all frames are received without any MAC address filtering. */ - unsigned int msmSystemPromiscuousMode : 1; /* 1E.6004.4 R/W Default = 0x0 */ - /* 1 = Promiscuous mode - */ - /*! \brief 1E.6004.5 R/W MSM System PAD Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPadEnable - - Default = 0x0 - - 1 = Enable frame padding removal on Rx - - - Notes: - When set to 1, enable frame padding removal on the Rx path. If enabled, padding is removed before the frame is transferred to the MAC client application. If disabled, no padding is removed on the Rx by the MAC. - Note : On Tx, the MAC always adds padding as required. */ - unsigned int msmSystemPadEnable : 1; /* 1E.6004.5 R/W Default = 0x0 */ - /* 1 = Enable frame padding removal on Rx - */ - /*! \brief 1E.6004.6 R/W MSM System CRC Forward - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemCrcForward - - Default = 0x0 - - 1 = Enable CRC forwarding - - - Notes: - When set to 1, the CRC field of the received frames is forwarded with the frame to the user application. If disabled, the CRC field is stripped from the frame. - Note : If padding is enabled ( See MAC PAD Enable set to 1), this bit is ignored. */ - unsigned int msmSystemCrcForward : 1; /* 1E.6004.6 R/W Default = 0x0 */ - /* 1 = Enable CRC forwarding - */ - /*! \brief 1E.6004.7 R/W MSM System Pause Forward - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPauseForward - - Default = 0x0 - - 1 = Enable Pause forwarding - - - Notes: - Terminate or forward pause frames. If set to 1, pause frames are forwarded to the user application. In normal mode, when set to 0, pause frames are terminated and discarded within the MAC. */ - unsigned int msmSystemPauseForward : 1; /* 1E.6004.7 R/W Default = 0x0 */ - /* 1 = Enable Pause forwarding - */ - /*! \brief 1E.6004.8 R/W MSM System Pause Ignore - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPauseIgnore - - Default = 0x0 - - 1 = Ignore pause frames - - - Notes: - Ignore pause frame quanta. If set to 1, received pause frames are ignored by the MAC. When set to 0, the Tx is stopped for the amount of time specified in the pause quanta received within the pause frame. */ - unsigned int msmSystemPauseIgnore : 1; /* 1E.6004.8 R/W Default = 0x0 */ - /* 1 = Ignore pause frames - */ - /*! \brief 1E.6004.9 R/W MSM System Tx Address Insert Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemTxAddressInsertEnable - - Default = 0x0 - - 1 = Insert Tx MAC source address - - - Notes: - Set the source MAC address on transmit. If set to 1, the MAC overwrites the source MAC address with the MAC programmed address in all transmitted frames. When set to 0, the source MAC address is transmitted unmodified from the MAC Tx client application. */ - unsigned int msmSystemTxAddressInsertEnable : 1; /* 1E.6004.9 R/W Default = 0x0 */ - /* 1 = Insert Tx MAC source address - */ - /*! \brief 1E.6004.A R/W MSM System Tx CRC Append - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemTxCrcAppend - - Default = 0x0 - - 1 = Append Tx CRC - - - Notes: - Permanently enable CRC append on transmit. If set to 1, the Tx will append a CRC to all transmitted frames. If set to 0, CRC append can be controlled on a per frame basis using the pin ff_tx_crc. - This configuration bit is OR'ed with the external ff_tx_crc pin to instruct the Tx to append a CRC to transmitted frames. The ff_tx_crc pin is tied to 0. */ - unsigned int msmSystemTxCrcAppend : 1; /* 1E.6004.A R/W Default = 0x0 */ - /* 1 = Append Tx CRC - */ - /*! \brief 1E.6004.B R/W MSM System Tx Pad Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemTxPadEnable - - Default = 0x1 - - 1 = Enable Tx padding - - - Notes: - When set to 1, enable padding of frames in the Tx direction. When set to 0, the MAC will not extend frames from the application to a minimum of 64 bytes, allowing to transmit short frames (violating the Ethernet mimimum size requirements). Must be set to 1 for normal operation. */ - unsigned int msmSystemTxPadEnable : 1; /* 1E.6004.B R/W Default = 0x1 */ - /* 1 = Enable Tx padding - */ - /*! \brief 1E.6004.C R/WSC MSM System Soft Reset - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemSoftReset - - Default = 0x0 - - 1 = Soft reset - - - Notes: - Software reset. Self clearing bit. When set to 1, resets all statistic counters as well as the Tx and Rx FIFOs. It should be issued after all traffic has been stopped as a result of clearing the Rx/Tx enable bits ( See MAC Rx Enable set to 0 and See MAC Tx Enable set to 0). - Note : Can lead to an Rx interface (ff_rx_xxx) violations to the application if the reset is issued in the middle of a receive frame transfer. Then the end of packet (assertion of ff_rx_eop) is lost and the application should be prepeared to handle this exception. */ - unsigned int msmSystemSoftReset : 1; /* 1E.6004.C R/WSC Default = 0x0 */ - /* 1 = Soft reset - */ - /*! \brief 1E.6004.D R/W MSM System Control Frame Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemControlFrameEnable - - Default = 0x0 - - 1 = Control frame enabled - - - Notes: - MAC control frame enable. When set to 1, the MAC control frames with any Opcode other than 0x0001 are accepted and forwarded to the client interface. When set to 0, MAC control frames with any opcode other than 0x0001 are silently discarded. */ - unsigned int msmSystemControlFrameEnable : 1; /* 1E.6004.D R/W Default = 0x0 */ - /* 1 = Control frame enabled - */ - /*! \brief 1E.6004.E R/W MSM System Rx Error Discard - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemRxErrorDiscard - - Default = 0x0 - - 1 = Enable discard of received errored frames - - - Notes: - Rx errored frame discard enable. When set to 1, any frame received with an error is discarded and not forwarded to the client interface. When set to 0, errored frames are forwarded to the client interface with ff_rx_err asserted. - Note : It is recommended to set this bit to 1 only when store and forward operation is enabled (RX_SECTION_FULL TBD). */ - unsigned int msmSystemRxErrorDiscard : 1; /* 1E.6004.E R/W Default = 0x0 */ - /* 1 = Enable discard of received errored frames - */ - /*! \brief 1E.6004.F R/W MSM System PHY Tx Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPhyTxEnable - - Default = 0x0 - - 1 = Enable PHY Tx - - - Notes: - Directly controls the phy_tx_ena pin. */ - unsigned int msmSystemPhyTxEnable : 1; /* 1E.6004.F R/W Default = 0x0 */ - /* 1 = Enable PHY Tx - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System General Control Register */ - union - { - struct - { - /*! \brief 1E.6005.0 R/W MSM System Force Send IDLE - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemForceSendIdle - - Default = 0x0 - - 1 = Force send idle - - Notes: - When set to 1, suppress any frame transmissions and forces IDLE n the Tx interface instead of frames. This control affects the MAC reconciliation layer (RS) which acts after all MAC datapath has processed the frame. - Note : Does not have an effect on fault handling (i.e. reception of local fault will still cause transmit of remote fault). - Must be 0 for normal operation. */ - unsigned int msmSystemForceSendIdle : 1; /* 1E.6005.0 R/W Default = 0x0 */ - /* 1 = Force send idle */ - /*! \brief 1E.6005.1 R/W MSM System Length Check Disable - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemLengthCheckDisable - - Default = 0x0 - - 1 = Disable length check - - Notes: - Payload length check disable. When set to 0, the MAC checks the frames payload length with the frame length/type field. When set to 1, the payload length check is disabled. */ - unsigned int msmSystemLengthCheckDisable : 1; /* 1E.6005.1 R/W Default = 0x0 */ - /* 1 = Disable length check */ - /*! \brief 1E.6005.2 R/W MSM System IDLE Column Count Extend - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemIdleColumnCountExtend - - Default = 0x0 - - 1 = Extend IDLE column count - - Notes: - When set to 1, extends the RS layer IDLE column counter by 2x. The IEEE 802.3ae defines the fault condition to be cleared after 128 columns of IDLE have been received. If the MAC operates together with a WAN mode PCS (WIS) it may may happen (depending on PCS) that this period is too short to bridge the IDLE stuffing occurring in this mode, leading to a toggling fault indication. In this case, extending the counter helps to aoivd toggling fault indications. */ - unsigned int msmSystemIdleColumnCountExtend : 1; /* 1E.6005.2 R/W Default = 0x0 */ - /* 1 = Extend IDLE column count */ - /*! \brief 1E.6005.3 R/W MSM System Priority Flow Control Enable - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemPriorityFlowControlEnable - - Default = 0x0 - - 1 = Enable priority flow control - 0 = Enable link flow control - - - Notes: - Enable priority flow control (PFC) mode of operation. When set to 0, the MAC uses standard link pause frames. When set to 1, the MAC will transmit and accept PFC frames. */ - unsigned int msmSystemPriorityFlowControlEnable : 1; /* 1E.6005.3 R/W Default = 0x0 */ - /* 1 = Enable priority flow control - 0 = Enable link flow control - */ - unsigned int reserved2 : 1; - /*! \brief 1E.6005.5 R/W MSM System SFD Check Disable - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemSfdCheckDisable - - Default = 0x0 - - 1 = Disable SFD check - - - Notes: - Disable check of SFD (0xD5) character at frame start. When set to 1, the frame is accepted even if the SFD byte following the preamble is not 0xD5. When set to 0, a frame is accepted only if the SFD byte is found with the value 0xD5. */ - unsigned int msmSystemSfdCheckDisable : 1; /* 1E.6005.5 R/W Default = 0x0 */ - /* 1 = Disable SFD check - */ - unsigned int reserved1 : 1; - /*! \brief 1E.6005.7 R/W MSM System Tx Low Power IDLE Enable - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemTxLowPowerIdleEnable - - Default = 0x0 - - 1 = Transmit LPI enable - - - Notes: - Transmit low power IDLE enable. When set to 1, the MAC completes the transmission of the current frame and generates low power IDLE sequences (LPI) to the XGMII/SGMII. When set to 0, the MAC operates in normal mode. This bit is OR'ed with the reg_lowp_ena pin. */ - unsigned int msmSystemTxLowPowerIdleEnable : 1; /* 1E.6005.7 R/W Default = 0x0 */ - /* 1 = Transmit LPI enable - */ - unsigned int reserved0 : 8; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemGeneralControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System FIFO Control Register: 1E.600E */ -/* MSM System FIFO Control Register: 1E.600E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.600E.7:0 R/W MSM System Rx FIFO Full Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u0.bits_0.msmSystemRxFifoFullThreshold - - Default = 0x08 - - Rx FIFO full threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmSystemRxFifoFullThreshold : 8; /* 1E.600E.7:0 R/W Default = 0x08 */ - /* Rx FIFO full threshold */ - unsigned int reserved0 : 8; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.600F.7:0 R/W MSM System Rx FIFO Empty Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u1.bits_1.msmSystemRxFifoEmptyThreshold - - Default = 0x00 - - Rx FIFO empty threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmSystemRxFifoEmptyThreshold : 8; /* 1E.600F.7:0 R/W Default = 0x00 */ - /* Rx FIFO empty threshold */ - unsigned int reserved0 : 8; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSM System FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.6010.5:0 R/W MSM System Tx FIFO Full Threshold [5:0] - AQ_MsmSystemFifoControlRegister_HHD.u2.bits_2.msmSystemTxFifoFullThreshold - - Default = 0x08 - - Tx FIFO full threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmSystemTxFifoFullThreshold : 6; /* 1E.6010.5:0 R/W Default = 0x08 */ - /* Tx FIFO full threshold */ - unsigned int reserved0 : 10; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSM System FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.6011.5:0 R/W MSM System Tx FIFO Empty Threshold [5:0] - AQ_MsmSystemFifoControlRegister_HHD.u3.bits_3.msmSystemTxFifoEmptyThreshold - - Default = 0x00 - - Tx FIFO empty threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmSystemTxFifoEmptyThreshold : 6; /* 1E.6011.5:0 R/W Default = 0x00 */ - /* Tx FIFO empty threshold */ - unsigned int reserved0 : 10; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of MSM System FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.6012.7:0 ROS MSM System Rx FIFO Almost Full Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u4.bits_4.msmSystemRxFifoAlmostFullThreshold - - Default = 0x00 - - Rx FIFO almost full threshold - - Notes: - Unused. */ - unsigned int msmSystemRxFifoAlmostFullThreshold : 8; /* 1E.6012.7:0 ROS Default = 0x00 */ - /* Rx FIFO almost full threshold */ - unsigned int reserved0 : 8; - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of MSM System FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.6013.7:0 ROS MSM System Rx FIFO Almost Empty Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u5.bits_5.msmSystemRxFifoAlmostEmptyThreshold - - Default = 0x00 - - Rx FIFO almost empty threshold - - Notes: - Unused. */ - unsigned int msmSystemRxFifoAlmostEmptyThreshold : 8; /* 1E.6013.7:0 ROS Default = 0x00 */ - /* Rx FIFO almost empty threshold */ - unsigned int reserved0 : 8; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of MSM System FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.6014.7:0 ROS MSM System Tx FIFO Almost Full Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u6.bits_6.msmSystemTxFifoAlmostFullThreshold - - Default = 0x00 - - Tx FIFO almost full threshold - - Notes: - Unused. */ - unsigned int msmSystemTxFifoAlmostFullThreshold : 8; /* 1E.6014.7:0 ROS Default = 0x00 */ - /* Tx FIFO almost full threshold */ - unsigned int reserved0 : 8; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of MSM System FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.6015.7:0 ROS MSM System Tx FIFO Almost Empty Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u7.bits_7.msmSystemTxFifoAlmostEmptyThreshold - - Default = 0x00 - - Tx FIFO almost empty threshold - - Notes: - Unused. */ - unsigned int msmSystemTxFifoAlmostEmptyThreshold : 8; /* 1E.6015.7:0 ROS Default = 0x00 */ - /* Tx FIFO almost empty threshold */ - unsigned int reserved0 : 8; - } bits_7; - uint16_t word_7; - } u7; -} AQ_MsmSystemFifoControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System General Status Register: 1E.6020 */ -/* MSM System General Status Register: 1E.6020 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System General Status Register */ - union - { - struct - { - /*! \brief 1E.6020.0 BLH MSM System Rx Local Fault - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemRxLocalFault - - - - Rx local fault detected - - Notes: - Latch high local fault status. Set to 1, whent he MAC detects Rx local fault sequences on the Rx interface. Reset to 0 after read and after reset. */ - unsigned int msmSystemRxLocalFault : 1; /* 1E.6020.0 BLH */ - /* Rx local fault detected */ - /*! \brief 1E.6020.1 BLH MSM System Rx Remote Fault - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemRxRemoteFault - - - - Rx remote fault detected - - Notes: - Latch high local fault status. Set to 1, whent he MAC detects Rx local fault sequences on the Rx interface. Reset to 0 after read and after reset. */ - unsigned int msmSystemRxRemoteFault : 1; /* 1E.6020.1 BLH */ - /* Rx remote fault detected */ - /*! \brief 1E.6020.2 RO MSM System PHY Loss of Signal - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemPhyLossOfSignal - - - - PHY loss of signal - - Notes: - PHY indicates loss of signal. This is the value of pin phy_los which is tied to 0. */ - unsigned int msmSystemPhyLossOfSignal : 1; /* 1E.6020.2 RO */ - /* PHY loss of signal */ - /*! \brief 1E.6020.3 R/W MSM System Timestamp Available - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemTimestampAvailable - - Default = 0x0 - - Timestamp available - - Notes: - Transmit timestamp available. Indicates that the timestamp of the last transmitted event frame (which had ff_tx_ts_frm=1) is available in the register See MAC Time Stamp Status 0 [F:0] and See MAC Time Stamp Status 1 [F:0] . To clear this bit, the bit must be written with a 1. - */ - unsigned int msmSystemTimestampAvailable : 1; /* 1E.6020.3 R/W Default = 0x0 */ - /* Timestamp available */ - /*! \brief 1E.6020.4 RO MSM System Rx Low Power IDLE - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemRxLowPowerIdle - - - - Rx LPI detected - - Notes: - Receive low power IDLE (LPI). Set to 1 when LPI is currently detected on the MAC Rx interface. Set to 0, when the MAC currently operates in normal mode. */ - unsigned int msmSystemRxLowPowerIdle : 1; /* 1E.6020.4 RO */ - /* Rx LPI detected */ - /*! \brief 1E.6020.5 RO MSM System Tx FIFO Empty - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemTxFifoEmpty - - - - Tx FIFO empty - - Notes: - When set to 1, indicates the Tx FIFO is empty. When set to 0, Tx FIFO is non-empty. */ - unsigned int msmSystemTxFifoEmpty : 1; /* 1E.6020.5 RO */ - /* Tx FIFO empty */ - unsigned int reserved0 : 10; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System General Status Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemGeneralStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx IPG Control Register: 1E.6022 */ -/* MSM System Tx IPG Control Register: 1E.6022 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx IPG Control Register */ - union - { - struct - { - /*! \brief 1E.6022.5:0 R/W MSM System Tx IPG Length [5:0] - AQ_MsmSystemTxIpgControlRegister_HHD.u0.bits_0.msmSystemTxIpgLength - - Default = 0x0C - - Tx IPG length - - Notes: - Tx inter-packet gap (IPG) value. Depending on LAN or WAN mode of operation. - LAN Mode : Number of octets in steps of 4. Valid values are 8, 12, 16,..., 100. DIC is supported for any setting > 8. A default of 12 must be set to conform to IEEE802.3ae. - WAN Mode : Stretch factor. Valid values are 4 ... 15. The stretch factor is calculated as (value+1)*8. A default of 12 must be set to conform to IEEE802.3ae (i.e. 13*8=104). A larger value shrinks the IPG (increasing bandwidth). - The reset value of 12 leads to IEEE802.3ae conformant behavior in both modes. - Note : WAN mode is only available in 10G mode of operation. */ - unsigned int msmSystemTxIpgLength : 6; /* 1E.6022.5:0 R/W Default = 0x0C */ - /* Tx IPG length */ - unsigned int reserved0 : 10; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx IPG Control Register */ - union - { - struct - { - /*! \brief 1E.6023.F:0 MSM System Tx IPG Reserved - AQ_MsmSystemTxIpgControlRegister_HHD.u1.bits_1.msmSystemTxIpgReserved - - - - Value always 0, writes ignored - */ - unsigned int msmSystemTxIpgReserved : 16; /* 1E.6023.F:0 */ - /* Value always 0, writes ignored */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxIpgControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Good Frames Counter Register: 1E.6040 */ -/* MSM System Tx Good Frames Counter Register: 1E.6040 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6040.F:0 ROS MSM System Tx Good Frames Counter 0 [F:0] - AQ_MsmSystemTxGoodFramesCounterRegister_HHD.u0.bits_0.msmSystemTxGoodFramesCounter_0 - - Default = 0x0000 - - Tx good frame counter bits 15:0 - - Notes: - Count of frames transmitted without error (Including pause frames). */ - unsigned int msmSystemTxGoodFramesCounter_0 : 16; /* 1E.6040.F:0 ROS Default = 0x0000 */ - /* Tx good frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6041.F:0 ROS MSM System Tx Good Frames Counter 1 [F:0] - AQ_MsmSystemTxGoodFramesCounterRegister_HHD.u1.bits_1.msmSystemTxGoodFramesCounter_1 - - Default = 0x0000 - - Tx good frame counter bits 31:16 - - - Notes: - Count of frames transmitted without error (Including pause frames). */ - unsigned int msmSystemTxGoodFramesCounter_1 : 16; /* 1E.6041.F:0 ROS Default = 0x0000 */ - /* Tx good frame counter bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxGoodFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Good Frames Counter Register: 1E.6044 */ -/* MSM System Rx Good Frames Counter Register: 1E.6044 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6044.F:0 ROS MSM System Rx Good Frames Counter 0 [F:0] - AQ_MsmSystemRxGoodFramesCounterRegister_HHD.u0.bits_0.msmSystemRxGoodFramesCounter_0 - - Default = 0x0000 - - Rx good frame counter bits 15:0 - - Notes: - Count of frames received without error (Including pause frames). */ - unsigned int msmSystemRxGoodFramesCounter_0 : 16; /* 1E.6044.F:0 ROS Default = 0x0000 */ - /* Rx good frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6045.F:0 ROS MSM System Rx Good Frames Counter 1 [F:0] - AQ_MsmSystemRxGoodFramesCounterRegister_HHD.u1.bits_1.msmSystemRxGoodFramesCounter_1 - - Default = 0x0000 - - Rx good frame counter bits 31:16 - - Notes: - Count of frames received without error (Including pause frames). */ - unsigned int msmSystemRxGoodFramesCounter_1 : 16; /* 1E.6045.F:0 ROS Default = 0x0000 */ - /* Rx good frame counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxGoodFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx FCS Errors Counter Register: 1E.6048 */ -/* MSM System Rx FCS Errors Counter Register: 1E.6048 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx FCS Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.6048.F:0 ROS MSM System FCS Error Counter 0 [F:0] - AQ_MsmSystemRxFcsErrorsCounterRegister_HHD.u0.bits_0.msmSystemFcsErrorCounter_0 - - Default = 0x0000 - - Frame check sequence error counter bits 15:0 - - Notes: - Count of frames for which a CRC-32 Error is detected but the frame is otherwise of correct length. */ - unsigned int msmSystemFcsErrorCounter_0 : 16; /* 1E.6048.F:0 ROS Default = 0x0000 */ - /* Frame check sequence error counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx FCS Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.6049.F:0 ROS MSM System FCS Error Counter 1 [F:0] - AQ_MsmSystemRxFcsErrorsCounterRegister_HHD.u1.bits_1.msmSystemFcsErrorCounter_1 - - Default = 0x0000 - - Frame check sequence error counter bits 31:16 - - Notes: - Count of frames for which a CRC-32 Error is detected but the frame is otherwise of correct length. */ - unsigned int msmSystemFcsErrorCounter_1 : 16; /* 1E.6049.F:0 ROS Default = 0x0000 */ - /* Frame check sequence error counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxFcsErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Alignment Errors Counter Register: 1E.604C */ -/* MSM System Rx Alignment Errors Counter Register: 1E.604C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Alignment Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.604C.F:0 ROS MSM System Alignment Error Counter 0 [F:0] - AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD.u0.bits_0.msmSystemAlignmentErrorCounter_0 - - Default = 0x0000 - - Alignment error counter bits 15:0 - - Notes: - Count of frames received with an alignment error. */ - unsigned int msmSystemAlignmentErrorCounter_0 : 16; /* 1E.604C.F:0 ROS Default = 0x0000 */ - /* Alignment error counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Alignment Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.604D.F:0 ROS MSM System Alignment Error Counter 1 [F:0] - AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD.u1.bits_1.msmSystemAlignmentErrorCounter_1 - - Default = 0x0000 - - Alignment error counter bits 31:16 - - Notes: - Count of frames received with an alignment error. */ - unsigned int msmSystemAlignmentErrorCounter_1 : 16; /* 1E.604D.F:0 ROS Default = 0x0000 */ - /* Alignment error counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Pause Frames Counter Register: 1E.6050 */ -/* MSM System Tx Pause Frames Counter Register: 1E.6050 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6050.F:0 ROS MSM System Tx Pause Frames Counter 0 [F:0] - AQ_MsmSystemTxPauseFramesCounterRegister_HHD.u0.bits_0.msmSystemTxPauseFramesCounter_0 - - Default = 0x0000 - - Tx pause frame counter bits 15:0 - - Notes: - Valid pause frames transmitted. */ - unsigned int msmSystemTxPauseFramesCounter_0 : 16; /* 1E.6050.F:0 ROS Default = 0x0000 */ - /* Tx pause frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6051.F:0 ROS MSM System Tx Pause Frames Counter 1 [F:0] - AQ_MsmSystemTxPauseFramesCounterRegister_HHD.u1.bits_1.msmSystemTxPauseFramesCounter_1 - - Default = 0x0000 - - Tx pause frame counter bits 31:16 - - - Notes: - Valid pause frames transmitted. */ - unsigned int msmSystemTxPauseFramesCounter_1 : 16; /* 1E.6051.F:0 ROS Default = 0x0000 */ - /* Tx pause frame counter bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxPauseFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Pause Frames Counter Register: 1E.6054 */ -/* MSM System Rx Pause Frames Counter Register: 1E.6054 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6054.F:0 ROS MSM System Rx Pause Frames Counter 0 [F:0] - AQ_MsmSystemRxPauseFramesCounterRegister_HHD.u0.bits_0.msmSystemRxPauseFramesCounter_0 - - Default = 0x0000 - - Rx pause frame counter bits 15:0 - - Notes: - Valid pause frames received. */ - unsigned int msmSystemRxPauseFramesCounter_0 : 16; /* 1E.6054.F:0 ROS Default = 0x0000 */ - /* Rx pause frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6055.F:0 ROS MSM System Rx Pause Frames Counter 1 [F:0] - AQ_MsmSystemRxPauseFramesCounterRegister_HHD.u1.bits_1.msmSystemRxPauseFramesCounter_1 - - Default = 0x0000 - - Rx pause frame counter bits 31:16 - - Notes: - Valid pause frames received. */ - unsigned int msmSystemRxPauseFramesCounter_1 : 16; /* 1E.6055.F:0 ROS Default = 0x0000 */ - /* Rx pause frame counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxPauseFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Too Long Errors Counter Register: 1E.6058 */ -/* MSM System Rx Too Long Errors Counter Register: 1E.6058 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Too Long Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.6058.F:0 ROS MSM System Rx Too Long Errors Counter 0 [F:0] - AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD.u0.bits_0.msmSystemRxTooLongErrorsCounter_0 - - Default = 0x0000 - - Too-long errors counter bits 15:0 - - Notes: - Frame received exceeded the maximum length programmed with register FRM_LGTH. */ - unsigned int msmSystemRxTooLongErrorsCounter_0 : 16; /* 1E.6058.F:0 ROS Default = 0x0000 */ - /* Too-long errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Too Long Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.6059.F:0 ROS MSM System Rx Too Long Errors Counter 1 [F:0] - AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD.u1.bits_1.msmSystemRxTooLongErrorsCounter_1 - - Default = 0x0000 - - Too-long errors counter bits 31:16 - - Notes: - Frame received exceeded the maximum length programmed with register FRM_LGTH. */ - unsigned int msmSystemRxTooLongErrorsCounter_1 : 16; /* 1E.6059.F:0 ROS Default = 0x0000 */ - /* Too-long errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx In Range Length Errors Counter Register: 1E.605C */ -/* MSM System Rx In Range Length Errors Counter Register: 1E.605C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx In Range Length Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.605C.F:0 ROS MSM System Rx In Range Length Errors Counter 0 [F:0] - AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD.u0.bits_0.msmSystemRxInRangeLengthErrorsCounter_0 - - Default = 0x0000 - - In-range-length errors counter bits 15:0 - - Notes: - A count of frames with a length/type field value between 46 (VLAN: 42) and less than 0x0600, that does not match the number of payload data octets received. Should count also if length/type field is less than 46 (VLAN: 42) and the frame is longer than 64 bytes. */ - unsigned int msmSystemRxInRangeLengthErrorsCounter_0 : 16; /* 1E.605C.F:0 ROS Default = 0x0000 */ - /* In-range-length errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx In Range Length Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.605D.F:0 ROS MSM System Rx In Range Length Errors Counter 1 [F:0] - AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD.u1.bits_1.msmSystemRxInRangeLengthErrorsCounter_1 - - Default = 0x0000 - - In-range-length errors counter bits 31:16 - - Notes: - A count of frames with a length/type field value between 46 (VLAN: 42) and less than 0x0600, that does not match the number of payload data octets received. Should count also if length/type field is less than 46 (VLAN: 42) and the frame is longer than 64 bytes. */ - unsigned int msmSystemRxInRangeLengthErrorsCounter_1 : 16; /* 1E.605D.F:0 ROS Default = 0x0000 */ - /* In-range-length errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx VLAN Frames Counter Register: 1E.6060 */ -/* MSM System Tx VLAN Frames Counter Register: 1E.6060 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6060.F:0 ROS MSM System Tx VLAN Frames Counter 0 [F:0] - AQ_MsmSystemTxVlanFramesCounterRegister_HHD.u0.bits_0.msmSystemTxVlanFramesCounter_0 - - Default = 0x0000 - - Tx VLAN frames counter bits 15:0 - - Notes: - Valid VLAN tagged frames transmitted. */ - unsigned int msmSystemTxVlanFramesCounter_0 : 16; /* 1E.6060.F:0 ROS Default = 0x0000 */ - /* Tx VLAN frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6061.F:0 ROS MSM System Tx VLAN Frames Counter 1 [F:0] - AQ_MsmSystemTxVlanFramesCounterRegister_HHD.u1.bits_1.msmSystemTxVlanFramesCounter_1 - - Default = 0x0000 - - Tx VLAN frames counter bits 31:16 - - Notes: - Valid VLAN tagged frames transmitted. */ - unsigned int msmSystemTxVlanFramesCounter_1 : 16; /* 1E.6061.F:0 ROS Default = 0x0000 */ - /* Tx VLAN frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxVlanFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx VLAN Frames Counter Register: 1E.6064 */ -/* MSM System Rx VLAN Frames Counter Register: 1E.6064 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6064.F:0 ROS MSM System Rx VLAN Frames Counter 0 [F:0] - AQ_MsmSystemRxVlanFramesCounterRegister_HHD.u0.bits_0.msmSystemRxVlanFramesCounter_0 - - Default = 0x0000 - - Rx VLAN frames counter bits 15:0 - - Notes: - Valid VLAN tagged frames received. */ - unsigned int msmSystemRxVlanFramesCounter_0 : 16; /* 1E.6064.F:0 ROS Default = 0x0000 */ - /* Rx VLAN frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6065.F:0 ROS MSM System Rx VLAN Frames Counter 1 [F:0] - AQ_MsmSystemRxVlanFramesCounterRegister_HHD.u1.bits_1.msmSystemRxVlanFramesCounter_1 - - Default = 0x0000 - - Rx VLAN frames counter bits 31:16 - - Notes: - Valid VLAN tagged frames received. */ - unsigned int msmSystemRxVlanFramesCounter_1 : 16; /* 1E.6065.F:0 ROS Default = 0x0000 */ - /* Rx VLAN frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxVlanFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Octets Counter Register: 1E.6068 */ -/* MSM System Tx Octets Counter Register: 1E.6068 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.6068.F:0 ROS MSM System Tx Octets Counter 0 [F:0] - AQ_MsmSystemTxOctetsCounterRegister_HHD.u0.bits_0.msmSystemTxOctetsCounter_0 - - Default = 0x0000 - - Tx octets counter bits 15:0 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmSystemTxOctetsCounter_0 : 16; /* 1E.6068.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.6069.F:0 ROS MSM System Tx Octets Counter 1 [F:0] - AQ_MsmSystemTxOctetsCounterRegister_HHD.u1.bits_1.msmSystemTxOctetsCounter_1 - - Default = 0x0000 - - Tx octets counter bits 31:16 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmSystemTxOctetsCounter_1 : 16; /* 1E.6069.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSM System Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.606A.F:0 ROS MSM System Tx Octets Counter 2 [F:0] - AQ_MsmSystemTxOctetsCounterRegister_HHD.u2.bits_2.msmSystemTxOctetsCounter_2 - - Default = 0x0000 - - Tx octets counter bits 47:32 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmSystemTxOctetsCounter_2 : 16; /* 1E.606A.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 47:32 */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSM System Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.606B.F:0 ROS MSM System Tx Octets Counter 3 [F:0] - AQ_MsmSystemTxOctetsCounterRegister_HHD.u3.bits_3.msmSystemTxOctetsCounter_3 - - Default = 0x0000 - - Tx octets counter bits 63:48 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmSystemTxOctetsCounter_3 : 16; /* 1E.606B.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 63:48 */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_MsmSystemTxOctetsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Octets Counter Register: 1E.606C */ -/* MSM System Rx Octets Counter Register: 1E.606C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.606C.F:0 ROS MSM System Rx Octets Counter 0 [F:0] - AQ_MsmSystemRxOctetsCounterRegister_HHD.u0.bits_0.msmSystemRxOctetsCounter_0 - - Default = 0x0000 - - Rx octets counter bits 15:0 - - Notes: - All octets received except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames received. */ - unsigned int msmSystemRxOctetsCounter_0 : 16; /* 1E.606C.F:0 ROS Default = 0x0000 */ - /* Rx octets counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.606D.F:0 ROS MSM System Rx Octets Counter 1 [F:0] - AQ_MsmSystemRxOctetsCounterRegister_HHD.u1.bits_1.msmSystemRxOctetsCounter_1 - - Default = 0x0000 - - Rx octets counter bits 31:16 - - Notes: - All octets received except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames received. */ - unsigned int msmSystemRxOctetsCounter_1 : 16; /* 1E.606D.F:0 ROS Default = 0x0000 */ - /* Rx octets counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxOctetsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Unicast Frames Counter Register: 1E.6070 */ -/* MSM System Rx Unicast Frames Counter Register: 1E.6070 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6070.F:0 ROS MSM System Rx Unicast Frames Counter 0 [F:0] - AQ_MsmSystemRxUnicastFramesCounterRegister_HHD.u0.bits_0.msmSystemRxUnicastFramesCounter_0 - - Default = 0x0000 - - Rx unicast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '0'. */ - unsigned int msmSystemRxUnicastFramesCounter_0 : 16; /* 1E.6070.F:0 ROS Default = 0x0000 */ - /* Rx unicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6071.F:0 ROS MSM System Rx Unicast Frames Counter 1 [F:0] - AQ_MsmSystemRxUnicastFramesCounterRegister_HHD.u1.bits_1.msmSystemRxUnicastFramesCounter_1 - - Default = 0x0000 - - Rx unicast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '0'. */ - unsigned int msmSystemRxUnicastFramesCounter_1 : 16; /* 1E.6071.F:0 ROS Default = 0x0000 */ - /* Rx unicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxUnicastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Multicast Frames Counter Register: 1E.6074 */ -/* MSM System Rx Multicast Frames Counter Register: 1E.6074 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6074.F:0 ROS MSM System Rx Multicast Frames Counter 0 [F:0] - AQ_MsmSystemRxMulticastFramesCounterRegister_HHD.u0.bits_0.msmSystemRxMulticastFramesCounter_0 - - Default = 0x0000 - - Rx multicast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '1' but not the broadcast address (all bits set '1' ). Pause frames are not counted. */ - unsigned int msmSystemRxMulticastFramesCounter_0 : 16; /* 1E.6074.F:0 ROS Default = 0x0000 */ - /* Rx multicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6075.F:0 ROS MSM System Rx Multicast Frames Counter 1 [F:0] - AQ_MsmSystemRxMulticastFramesCounterRegister_HHD.u1.bits_1.msmSystemRxMulticastFramesCounter_1 - - Default = 0x0000 - - Rx multicast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '1' but not the broadcast address (all bits set '1' ). Pause frames are not counted. */ - unsigned int msmSystemRxMulticastFramesCounter_1 : 16; /* 1E.6075.F:0 ROS Default = 0x0000 */ - /* Rx multicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxMulticastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Broadcast Frames Counter Register: 1E.6078 */ -/* MSM System Rx Broadcast Frames Counter Register: 1E.6078 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6078.F:0 ROS MSM System Rx Broadcast Frames Counter 0 [F:0] - AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD.u0.bits_0.msmSystemRxBroadcastFramesCounter_0 - - Default = 0x0000 - - Rx broadcast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface (FIFO) and all bits of the destination address were set '1'. */ - unsigned int msmSystemRxBroadcastFramesCounter_0 : 16; /* 1E.6078.F:0 ROS Default = 0x0000 */ - /* Rx broadcast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6079.F:0 ROS MSM System Rx Broadcast Frames Counter 1 [F:0] - AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD.u1.bits_1.msmSystemRxBroadcastFramesCounter_1 - - Default = 0x0000 - - Rx broadcast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface (FIFO) and all bits of the destination address were set '1'. */ - unsigned int msmSystemRxBroadcastFramesCounter_1 : 16; /* 1E.6079.F:0 ROS Default = 0x0000 */ - /* Rx broadcast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Errors Counter Register: 1E.607C */ -/* MSM System Tx Errors Counter Register: 1E.607C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.607C.F:0 ROS MSM System Tx Errors Counter 0 [F:0] - AQ_MsmSystemTxErrorsCounterRegister_HHD.u0.bits_0.msmSystemTxErrorsCounter_0 - - Default = 0x0000 - - Rx errors counter bits 15:0 - - Notes: - Number of frames transmitted with error: - - FIFO Overflow Errors - - FIFO Underflow Errors */ - unsigned int msmSystemTxErrorsCounter_0 : 16; /* 1E.607C.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.607D.F:0 ROS MSM System Tx Errors Counter 1 [F:0] - AQ_MsmSystemTxErrorsCounterRegister_HHD.u1.bits_1.msmSystemTxErrorsCounter_1 - - Default = 0x0000 - - Tx errors counter bits 31:16 - - Notes: - Number of frames transmitted with error: - - FIFO Overflow Errors - - FIFO Underflow Errors */ - unsigned int msmSystemTxErrorsCounter_1 : 16; /* 1E.607D.F:0 ROS Default = 0x0000 */ - /* Tx errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Unicast Frames Counter Register: 1E.6084 */ -/* MSM System Tx Unicast Frames Counter Register: 1E.6084 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6084.F:0 ROS MSM System Tx Unicast Frames Counter 0 [F:0] - AQ_MsmSystemTxUnicastFramesCounterRegister_HHD.u0.bits_0.msmSystemTxUnicastFramesCounter_0 - - Default = 0x0000 - - Tx unicast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '0'. */ - unsigned int msmSystemTxUnicastFramesCounter_0 : 16; /* 1E.6084.F:0 ROS Default = 0x0000 */ - /* Tx unicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6085.F:0 ROS MSM System Tx Unicast Frames Counter 1 [F:0] - AQ_MsmSystemTxUnicastFramesCounterRegister_HHD.u1.bits_1.msmSystemTxUnicastFramesCounter_1 - - Default = 0x0000 - - Tx unicast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '0'. */ - unsigned int msmSystemTxUnicastFramesCounter_1 : 16; /* 1E.6085.F:0 ROS Default = 0x0000 */ - /* Tx unicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxUnicastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Multicast Frames Counter Register: 1E.6088 */ -/* MSM System Tx Multicast Frames Counter Register: 1E.6088 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6088.F:0 ROS MSM System Tx Multicast Frames Counter 0 [F:0] - AQ_MsmSystemTxMulticastFramesCounterRegister_HHD.u0.bits_0.msmSystemTxMulticastFramesCounter_0 - - Default = 0x0000 - - Tx multicast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '1' but not the broadcast address (all bits '1'). */ - unsigned int msmSystemTxMulticastFramesCounter_0 : 16; /* 1E.6088.F:0 ROS Default = 0x0000 */ - /* Tx multicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6089.F:0 ROS MSM System Tx Multicast Frames Counter 1 [F:0] - AQ_MsmSystemTxMulticastFramesCounterRegister_HHD.u1.bits_1.msmSystemTxMulticastFramesCounter_1 - - Default = 0x0000 - - Tx multicast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '1' but not the broadcast address (all bits '1'). */ - unsigned int msmSystemTxMulticastFramesCounter_1 : 16; /* 1E.6089.F:0 ROS Default = 0x0000 */ - /* Tx multicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxMulticastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Broadcast Frames Counter Register: 1E.608C */ -/* MSM System Tx Broadcast Frames Counter Register: 1E.608C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.608C.F:0 ROS MSM System Tx Broadcast Frames Counter 0 [F:0] - AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD.u0.bits_0.msmSystemTxBroadcastFramesCounter_0 - - Default = 0x0000 - - Tx broadcast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and all bits of the destination address set to '1'. */ - unsigned int msmSystemTxBroadcastFramesCounter_0 : 16; /* 1E.608C.F:0 ROS Default = 0x0000 */ - /* Tx broadcast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.608D.F:0 ROS MSM System Tx Broadcast Frames Counter 1 [F:0] - AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD.u1.bits_1.msmSystemTxBroadcastFramesCounter_1 - - Default = 0x0000 - - Tx broadcast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and all bits of the destination address set to '1'. */ - unsigned int msmSystemTxBroadcastFramesCounter_1 : 16; /* 1E.608D.F:0 ROS Default = 0x0000 */ - /* Tx broadcast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Errors Counter Register: 1E.60C8 */ -/* MSM System Rx Errors Counter Register: 1E.60C8 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.60C8.F:0 ROS MSM System Rx Errors Counter 0 [F:0] - AQ_MsmSystemRxErrorsCounterRegister_HHD.u0.bits_0.msmSystemRxErrorsCounter_0 - - Default = 0x0000 - - Rx errors counter bits 15:0 - - Notes: - Number of frames received with error: - - FIFO Overflow Errors - - CRC Errors - - Payload Length Errors - - Jabber and Oversized Errors - - Alignment Errors - - The dedicated Error Code (0xfe, not a code error) was received */ - unsigned int msmSystemRxErrorsCounter_0 : 16; /* 1E.60C8.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.60C9.F:0 ROS MSM System Rx Errors Counter 1 [F:0] - AQ_MsmSystemRxErrorsCounterRegister_HHD.u1.bits_1.msmSystemRxErrorsCounter_1 - - Default = 0x0000 - - Rx errors counter bits 31:16 - - Notes: - Number of frames received with error: - - FIFO Overflow Errors - - CRC Errors - - Payload Length Errors - - Jabber and Oversized Errors - - Alignment Errors - - The dedicated Error Code (0xfe, not a code error) was received */ - unsigned int msmSystemRxErrorsCounter_1 : 16; /* 1E.60C9.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress VLAN TPID 0 Register: 1E.8006 */ -/* MSS Ingress VLAN TPID 0 Register: 1E.8006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress VLAN TPID 0 Register */ - union - { - struct - { - /*! \brief 1E.8006.F:0 R/W MSS Ingress VLAN STag [F:0] - AQ_MssIngressVlanTpid_0Register_HHD.u0.bits_0.mssIngressVlanStag - - Default = 0x0000 - - STag TPID - - - Notes: - Service Tag Protocol Identifier (TPID) values to identify a VLAN tag. The " See SEC Egress VLAN CP Tag Parse STag " bit must be set to 1 for the incoming packet's TPID to be parsed. */ - unsigned int mssIngressVlanStag : 16; /* 1E.8006.F:0 R/W Default = 0x0000 */ - /* STag TPID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress VLAN TPID 0 Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressVlanTpid_0Register_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress VLAN TPID 1 Register: 1E.8008 */ -/* MSS Ingress VLAN TPID 1 Register: 1E.8008 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress VLAN TPID 1 Register */ - union - { - struct - { - /*! \brief 1E.8008.F:0 R/W MSS Ingress VLAN QTag [F:0] - AQ_MssIngressVlanTpid_1Register_HHD.u0.bits_0.mssIngressVlanQtag - - Default = 0x0000 - - QTag TPID - - - Notes: - Customer Tag Protocol Identifier (TPID) values to identify a VLAN tag. The " See SEC Egress VLAN CP Tag Parse QTag " bit must be set to 1 for the incoming packet's TPID to be parsed. */ - unsigned int mssIngressVlanQtag : 16; /* 1E.8008.F:0 R/W Default = 0x0000 */ - /* QTag TPID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress VLAN TPID 1 Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressVlanTpid_1Register_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress VLAN Control Register: 1E.800A */ -/* MSS Ingress VLAN Control Register: 1E.800A */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress VLAN Control Register */ - union - { - struct - { - /*! \brief 1E.800A.F:0 R/W MSS Ingress VLAN UP Map Table LSW [F:0] - AQ_MssIngressVlanControlRegister_HHD.u0.bits_0.mssIngressVlanUpMapTableLSW - - Default = 0x0000 - - Map table bits 15:0 - - - Notes: - If there is a customer TPID Tag match and no service TPID Tag match or the service TPID Tag match is disabled, the outer TAG's PCP is used to index into this map table to generate the packets user priority. - 2:0 : UP value for customer Tag PCP 0x0 - 5:3: UP value for customer Tag PCP 0x0 - 8:6 : UP value for customer Tag PCP 0x0 - 11:9 : UP value for customer Tag PCP 0x0 - 14:12 : UP value for customer Tag PCP 0x0 - 17:15 : UP value for customer Tag PCP 0x0 */ - unsigned int mssIngressVlanUpMapTableLSW : 16; /* 1E.800A.F:0 R/W Default = 0x0000 */ - /* Map table bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress VLAN Control Register */ - union - { - struct - { - /*! \brief 1E.800B.7:0 R/W MSS Ingress VLAN UP Map Table MSW [17:10] - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanUpMapTableMSW - - Default = 0x00 - - UP Map table bits 23:16 - - - Notes: - If there is a customer TPID Tag match and no service TPID Tag match or the service TPID Tag match is disabled, the outer TAG's PCP is used to index into this map table to generate the packets user priority. - 2:0 : UP value for customer Tag PCP 0x0 - 5:3: UP value for customer Tag PCP 0x0 - 8:6 : UP value for customer Tag PCP 0x0 - 11:9 : UP value for customer Tag PCP 0x0 - 14:12 : UP value for customer Tag PCP 0x0 - 17:15 : UP value for customer Tag PCP 0x0 - 20:18 : UP value for customer Tag PCP 0x0 - 23:21 : UP value for customer Tag PCP 0x0 */ - unsigned int mssIngressVlanUpMapTableMSW : 8; /* 1E.800B.7:0 R/W Default = 0x00 */ - /* UP Map table bits 23:16 - */ - /*! \brief 1E.800B.A:8 R/W MSS Ingress VLAN UP Default [2:0] - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanUpDefault - - Default = 0x0 - - UP default - - - Notes: - User priority default */ - unsigned int mssIngressVlanUpDefault : 3; /* 1E.800B.A:8 R/W Default = 0x0 */ - /* UP default - */ - /*! \brief 1E.800B.B R/W MSS Ingress VLAN STag UP Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanStagUpParseEnable - - Default = 0x0 - - VLAN CP Tag STag UP enable - - - Notes: - Enable controlled port service VLAN service Tag user priority field parsing. */ - unsigned int mssIngressVlanStagUpParseEnable : 1; /* 1E.800B.B R/W Default = 0x0 */ - /* VLAN CP Tag STag UP enable - */ - /*! \brief 1E.800B.C R/W MSS Ingress VLAN QTag UP Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanQtagUpParseEnable - - Default = 0x0 - - VLAN CP Tag QTag UP enable - - - Notes: - Enable controlled port customer VLAN customer Tag user priority field parsing. */ - unsigned int mssIngressVlanQtagUpParseEnable : 1; /* 1E.800B.C R/W Default = 0x0 */ - /* VLAN CP Tag QTag UP enable - */ - /*! \brief 1E.800B.D R/W MSS Ingress VLAN QinQ Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanQinqParseEnable - - Default = 0x0 - - VLAN CP Tag Parse QinQ - - - Notes: - Enable controlled port VLAN QinQ Tag parsing. When this bit is set to 1 both the outer and inner VLAN Tags will be parsed. */ - unsigned int mssIngressVlanQinqParseEnable : 1; /* 1E.800B.D R/W Default = 0x0 */ - /* VLAN CP Tag Parse QinQ - */ - /*! \brief 1E.800B.E R/W MSS Ingress VLAN STag Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanStagParseEnable - - Default = 0x0 - - 1 = Enable VLAN STag parsing - - - Notes: - Enable controlled port VLAN service Tag parsing. When this bit is set to 1, the incoming packets outer TPID will be compared with the configured " See MSS Ingress VLAN Stag [F:0] " for matching. If the " See SEC Egress VLAN CP Tag Parse QinQ " bit is set to1, this will also be used to compare the incoming packet's inner TPID. */ - unsigned int mssIngressVlanStagParseEnable : 1; /* 1E.800B.E R/W Default = 0x0 */ - /* 1 = Enable VLAN STag parsing - */ - /*! \brief 1E.800B.F R/W MSS Ingress VLAN QTag Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanQtagParseEnable - - Default = 0x0 - - 1 = Enable VLAN QTag parsing - - - Notes: - Enable controlled port VLAN customer Tag parsing. When this bit is set to 1, the incoming packet's outer TPID will be compared with the configured " See MSS Ingress VLAN QTag [F:0] " for matching. If the " See SEC Egress VLAN CP Tag Parse QinQ " bit is set to1, this will also be used to compare the incoming packet's inner TPID. */ - unsigned int mssIngressVlanQtagParseEnable : 1; /* 1E.800B.F R/W Default = 0x0 */ - /* 1 = Enable VLAN QTag parsing - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressVlanControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress MTU Size Control Register: 1E.800C */ -/* MSS Ingress MTU Size Control Register: 1E.800C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress MTU Size Control Register */ - union - { - struct - { - /*! \brief 1E.800C.F:0 R/W MSS Ingress Controlled Packet MTU Size [F:0] - AQ_MssIngressMtuSizeControlRegister_HHD.u0.bits_0.mssIngressControlledPacketMtuSize - - Default = 0x05DC - - Maximum transmission unit for controlled packet - - - Notes: - Maximum transmission unit of controlled packet */ - unsigned int mssIngressControlledPacketMtuSize : 16; /* 1E.800C.F:0 R/W Default = 0x05DC */ - /* Maximum transmission unit for controlled packet - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress MTU Size Control Register */ - union - { - struct - { - /*! \brief 1E.800D.F:0 R/W MSS Ingress Uncontrolled Packet MTU Size [F:0] - AQ_MssIngressMtuSizeControlRegister_HHD.u1.bits_1.mssIngressUncontrolledPacketMtuSize - - Default = 0x05DC - - Maximum transmission unit for uncontrolled packet - - - Notes: - Maximum transmission unit of uncontrolled packet */ - unsigned int mssIngressUncontrolledPacketMtuSize : 16; /* 1E.800D.F:0 R/W Default = 0x05DC */ - /* Maximum transmission unit for uncontrolled packet - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressMtuSizeControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress Control Register: 1E.800E */ -/* MSS Ingress Control Register: 1E.800E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress Control Register */ - union - { - struct - { - /*! \brief 1E.800E.0 R/W MSS Ingress Soft Reset - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressSoftReset - - Default = 0x0 - - 1 = Soft reset - - - Notes: - S/W reset */ - unsigned int mssIngressSoftReset : 1; /* 1E.800E.0 R/W Default = 0x0 */ - /* 1 = Soft reset - */ - /*! \brief 1E.800E.1 R/W MSS Ingress Operation Point To Point - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressOperationPointToPoint - - Default = 0x0 - - 1 = Enable the SCI for authorization default - - - Notes: - The default SCI for authorization is configured in See MSS Ingress SCI Default [F:0] See MSS Ingress SCI Default [1F:10] , See MSS Ingress SCI Default [2F:20] , and See MSS Ingress SCI Default [3F:30] . */ - unsigned int mssIngressOperationPointToPoint : 1; /* 1E.800E.1 R/W Default = 0x0 */ - /* 1 = Enable the SCI for authorization default - */ - /*! \brief 1E.800E.2 R/W MSS Ingress Create SCI - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressCreateSci - - Default = 0x0 - - 0 = SCI from IGPRC LUT - - - Notes: - If the SCI is not in the packet and this bit is set to 0, the SCI will be taken from the IGPRC LUT. */ - unsigned int mssIngressCreateSci : 1; /* 1E.800E.2 R/W Default = 0x0 */ - /* 0 = SCI from IGPRC LUT - */ - /*! \brief 1E.800E.3 R/W MSS Ingress Mask Short Length Error - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressMaskShortLengthError - - Default = 0x0 - - Unused - - - Notes: - Unused */ - unsigned int mssIngressMaskShortLengthError : 1; /* 1E.800E.3 R/W Default = 0x0 */ - /* Unused - */ - /*! \brief 1E.800E.4 R/W MSS Ingress Drop Kay Packet - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressDropKayPacket - - Default = 0x0 - - 1 = Drop KaY packets - - - Notes: - Decides whether KaY packets have to be dropped */ - unsigned int mssIngressDropKayPacket : 1; /* 1E.800E.4 R/W Default = 0x0 */ - /* 1 = Drop KaY packets - */ - /*! \brief 1E.800E.5 R/W MSS Ingress Drop IGPRC Miss - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressDropIgprcMiss - - Default = 0x0 - - 1 = Drop IGPRC miss packets - - - Notes: - Decides whether Ingress Pre-Security Classification (IGPRC) LUT miss packets are to be dropped */ - unsigned int mssIngressDropIgprcMiss : 1; /* 1E.800E.5 R/W Default = 0x0 */ - /* 1 = Drop IGPRC miss packets - */ - /*! \brief 1E.800E.6 R/W MSS Ingress Check ICV - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressCheckIcv - - Default = 0x0 - - Unused - - - Notes: - Unused */ - unsigned int mssIngressCheckIcv : 1; /* 1E.800E.6 R/W Default = 0x0 */ - /* Unused - */ - /*! \brief 1E.800E.7 R/W MSS Ingress Clear Global Time - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressClearGlobalTime - - Default = 0x0 - - 1 = Clear global time - - - Notes: - Clear global time */ - unsigned int mssIngressClearGlobalTime : 1; /* 1E.800E.7 R/W Default = 0x0 */ - /* 1 = Clear global time - */ - /*! \brief 1E.800E.8 R/W MSS Ingress Clear Count - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressClearCount - - Default = 0x0 - - 1 = Clear all MIB counters - - - Notes: - If this bit is set to 1, all MIB counters will be cleared. */ - unsigned int mssIngressClearCount : 1; /* 1E.800E.8 R/W Default = 0x0 */ - /* 1 = Clear all MIB counters - */ - /*! \brief 1E.800E.9 R/W MSS Ingress High Priority - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressHighPriority - - Default = 0x0 - - 1 = MIB counter clear on read enable - - - Notes: - If this bit is set to 1, read is given high priority and the MIB count value becomes 0 after read. */ - unsigned int mssIngressHighPriority : 1; /* 1E.800E.9 R/W Default = 0x0 */ - /* 1 = MIB counter clear on read enable - */ - /*! \brief 1E.800E.A R/W MSS Ingress Remove SECTag - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressRemoveSectag - - Default = 0x0 - - 1 = Enable removal of SECTag - - - Notes: - If this bit is set and either of the following two conditions occurs, the SECTag will be removed. - Controlled packet and either the SA or SC is invalid. - IGPRC miss. */ - unsigned int mssIngressRemoveSectag : 1; /* 1E.800E.A R/W Default = 0x0 */ - /* 1 = Enable removal of SECTag - */ - /*! \brief 1E.800E.C:B R/W MSS Ingress Global Validate Frames [1:0] - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressGlobalValidateFrames - - Default = 0x0 - - Default validate frames configuration - - - Notes: - If the SC is invalid or if an IGPRC miss packet condition occurs, this default will be used for the validate frames configuration instead of the validate frame entry in the Ingress SC Table (IGSCT). */ - unsigned int mssIngressGlobalValidateFrames : 2; /* 1E.800E.C:B R/W Default = 0x0 */ - /* Default validate frames configuration - */ - /*! \brief 1E.800E.D R/W MSS Ingress ICV LSB 8 Bytes Enable - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressIcvLsb_8BytesEnable - - Default = 0x0 - - 1 = Use LSB - 0 = Use MSB - - - - Notes: - This bit selects MSB or LSB 8 bytes selection in the case where the ICV is 8 bytes. - 0 = MSB is used. */ - unsigned int mssIngressIcvLsb_8BytesEnable : 1; /* 1E.800E.D R/W Default = 0x0 */ - /* 1 = Use LSB - 0 = Use MSB - - */ - unsigned int reserved0 : 2; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress Control Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA Control Register: 1E.8010 */ -/* MSS Ingress SA Control Register: 1E.8010 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA Control Register */ - union - { - struct - { - /*! \brief 1E.8010.F:0 R/W MSS Ingress SA Threshold LSW [F:0] - AQ_MssIngressSaControlRegister_HHD.u0.bits_0.mssIngressSaThresholdLSW - - Default = 0x0000 - - SA threshold bits 15:0 - - - Notes: - Ingress PN threshold to generate SA threshold interrupt. */ - unsigned int mssIngressSaThresholdLSW : 16; /* 1E.8010.F:0 R/W Default = 0x0000 */ - /* SA threshold bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA Control Register */ - union - { - struct - { - /*! \brief 1E.8011.F:0 R/W MSS Ingress SA Threshold MSW [1F:10] - AQ_MssIngressSaControlRegister_HHD.u1.bits_1.mssIngressSaThresholdMSW - - Default = 0x0000 - - SA threshold bits 31:16 - - - Notes: - Ingress PN threshold to generate SA threshold interrupt. */ - unsigned int mssIngressSaThresholdMSW : 16; /* 1E.8011.F:0 R/W Default = 0x0000 */ - /* SA threshold bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress Interrupt Status Register: 1E.802E */ -/* MSS Ingress Interrupt Status Register: 1E.802E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.802E.0 COW MSS Master Ingress Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssMasterIngressInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when any one of the above interrupt and the corresponding interrupt enable are both set. The interrupt enable for this bit must also be set for this bit to be set. */ - unsigned int mssMasterIngressInterrupt : 1; /* 1E.802E.0 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.1 COW MSS Ingress SA Expired Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressSaExpiredInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches all ones saturation. */ - unsigned int mssIngressSaExpiredInterrupt : 1; /* 1E.802E.1 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.2 COW MSS Ingress SA Threshold Expired Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressSaThresholdExpiredInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches the See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssIngressSaThresholdExpiredInterrupt : 1; /* 1E.802E.2 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.3 COW MSS Ingress ICV Error Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressIcvErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. */ - unsigned int mssIngressIcvErrorInterrupt : 1; /* 1E.802E.3 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.4 COW MSS Ingress Replay Error Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressReplayErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. */ - unsigned int mssIngressReplayErrorInterrupt : 1; /* 1E.802E.4 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.5 COW MSS Ingress MIB Saturation Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressMibSaturationInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the MIB counters reaches all ones saturation. */ - unsigned int mssIngressMibSaturationInterrupt : 1; /* 1E.802E.5 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.6 COW MSS Ingress ECC Error Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressEccErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. */ - unsigned int mssIngressEccErrorInterrupt : 1; /* 1E.802E.6 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.7 COW MSS Ingress TCI E/C Error Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressTciE_cErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This error occurs when the TCI E bit is 1 and the TCI C bit is 0. The packet is not dropped, uncontrolled, or untagged. */ - unsigned int mssIngressTciE_cErrorInterrupt : 1; /* 1E.802E.7 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.8 COW MSS Ingress IGPOC Miss Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressIgpocMissInterrupt - - Default = 0x0 - - 1 = Interrupt - - */ - unsigned int mssIngressIgpocMissInterrupt : 1; /* 1E.802E.8 COW Default = 0x0 */ - /* 1 = Interrupt - */ - unsigned int reserved0 : 7; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress Interrupt Status Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressInterruptStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress Interrupt Mask Register: 1E.8030 */ -/* MSS Ingress Interrupt Mask Register: 1E.8030 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress Interrupt Mask Register */ - union - { - struct - { - /*! \brief 1E.8030.0 R/W MSS Ingress Master Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressMasterInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressMasterInterruptEnable : 1; /* 1E.8030.0 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.1 R/W MSS Ingress SA Expired Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressSaExpiredInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressSaExpiredInterruptEnable : 1; /* 1E.8030.1 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.2 R/W MSS Ingress SA Threshold Expired Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressSaThresholdExpiredInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressSaThresholdExpiredInterruptEnable : 1; /* 1E.8030.2 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.3 R/W MSS Ingress ICV Error Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressIcvErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressIcvErrorInterruptEnable : 1; /* 1E.8030.3 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.4 R/W MSS Ingress Replay Error Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressReplayErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressReplayErrorInterruptEnable : 1; /* 1E.8030.4 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.5 R/W MSS Ingress MIB Saturation Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressMibSaturationInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressMibSaturationInterruptEnable : 1; /* 1E.8030.5 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.6 R/W MSS Ingress ECC Error Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressEccErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressEccErrorInterruptEnable : 1; /* 1E.8030.6 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.7 R/W MSS Ingress TCI E/C Error Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressTciE_cErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressTciE_cErrorInterruptEnable : 1; /* 1E.8030.7 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.8 R/W MSS Ingress IGPOC Miss Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressIgpocMissInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressIgpocMissInterruptEnable : 1; /* 1E.8030.8 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - unsigned int reserved0 : 7; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress Interrupt Mask Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressInterruptMaskRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA ICV Error Status Register: 1E.8032 */ -/* MSS Ingress SA ICV Error Status Register: 1E.8032 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA ICV Error Status Register */ - union - { - struct - { - /*! \brief 1E.8032.F:0 COW MSS Ingress SA ICV Error LSW [F:0] - AQ_MssIngressSaIcvErrorStatusRegister_HHD.u0.bits_0.mssIngressSaIcvErrorLSW - - Default = 0x0000 - - SA ICV error bits 15:0 - - - Notes: - When set, these bits identify the SA that has an ICV error. Write these bits to 1 to clear. */ - unsigned int mssIngressSaIcvErrorLSW : 16; /* 1E.8032.F:0 COW Default = 0x0000 */ - /* SA ICV error bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA ICV Error Status Register */ - union - { - struct - { - /*! \brief 1E.8033.F:0 COW MSS Ingress SA ICV Error MSW [1F:10] - AQ_MssIngressSaIcvErrorStatusRegister_HHD.u1.bits_1.mssIngressSaIcvErrorMSW - - Default = 0x0000 - - SA ICV error bits 31:16 - - - Notes: - When set, these bits identify the SA that has an ICV error. Write these bits to 1 to clear. */ - unsigned int mssIngressSaIcvErrorMSW : 16; /* 1E.8033.F:0 COW Default = 0x0000 */ - /* SA ICV error bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaIcvErrorStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA Replay Error Status Register: 1E.8034 */ -/* MSS Ingress SA Replay Error Status Register: 1E.8034 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA Replay Error Status Register */ - union - { - struct - { - /*! \brief 1E.8034.F:0 COW MSS Ingress SA Replay Error LSW [F:0] - AQ_MssIngressSaReplayErrorStatusRegister_HHD.u0.bits_0.mssIngressSaReplayErrorLSW - - Default = 0x0000 - - SA replay error bits 15:0 - - - Notes: - When set, these bits identify the SA that has a replay error. Write these bits to 1 to clear. */ - unsigned int mssIngressSaReplayErrorLSW : 16; /* 1E.8034.F:0 COW Default = 0x0000 */ - /* SA replay error bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA Replay Error Status Register */ - union - { - struct - { - /*! \brief 1E.8035.F:0 COW MSS Ingress SA Replay Error MSW [1F:10] - AQ_MssIngressSaReplayErrorStatusRegister_HHD.u1.bits_1.mssIngressSaReplayErrorMSW - - Default = 0x0000 - - SA replay error bits 31:16 - - - Notes: - When set, these bits identify the SA that has a replay error. Write these bits to 1 to clear. */ - unsigned int mssIngressSaReplayErrorMSW : 16; /* 1E.8035.F:0 COW Default = 0x0000 */ - /* SA replay error bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaReplayErrorStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA Expired Status Register: 1E.8036 */ -/* MSS Ingress SA Expired Status Register: 1E.8036 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA Expired Status Register */ - union - { - struct - { - /*! \brief 1E.8036.F:0 ROS MSS Ingress SA Expired LSW [F:0] - AQ_MssIngressSaExpiredStatusRegister_HHD.u0.bits_0.mssIngressSaExpiredLSW - - Default = 0x0000 - - SA expired bits 15:0 - - - Notes: - When set, these bits identify the SA that has expired when the SA PN reaches all-ones saturation. Write these bits to 1 to clear. */ - unsigned int mssIngressSaExpiredLSW : 16; /* 1E.8036.F:0 ROS Default = 0x0000 */ - /* SA expired bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA Expired Status Register */ - union - { - struct - { - /*! \brief 1E.8037.F:0 ROS MSS Ingress SA Expired MSW [1F:10] - AQ_MssIngressSaExpiredStatusRegister_HHD.u1.bits_1.mssIngressSaExpiredMSW - - Default = 0x0000 - - SA expired bits 31:16 - - - Notes: - When set, these bits identify the SA that has expired when the SA PN reaches all-ones saturation. Write these bits to 1 to clear. */ - unsigned int mssIngressSaExpiredMSW : 16; /* 1E.8037.F:0 ROS Default = 0x0000 */ - /* SA expired bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaExpiredStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA Threshold Expired Status Register: 1E.8038 */ -/* MSS Ingress SA Threshold Expired Status Register: 1E.8038 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA Threshold Expired Status Register */ - union - { - struct - { - /*! \brief 1E.8038.F:0 ROS MSS Ingress SA Threshold Expired LSW [F:0] - AQ_MssIngressSaThresholdExpiredStatusRegister_HHD.u0.bits_0.mssIngressSaThresholdExpiredLSW - - Default = 0x0000 - - SA threshold expired bits 15:0 - - - Notes: - When set, these bits identify the SA that has expired when the SA PN has reached the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . Write these bits to 1 to clear. */ - unsigned int mssIngressSaThresholdExpiredLSW : 16; /* 1E.8038.F:0 ROS Default = 0x0000 */ - /* SA threshold expired bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA Threshold Expired Status Register */ - union - { - struct - { - /*! \brief 1E.8039.F:0 ROS MSS Ingress SA Threshold Expired MSW [1F:10] - AQ_MssIngressSaThresholdExpiredStatusRegister_HHD.u1.bits_1.mssIngressSaThresholdExpiredMSW - - Default = 0x0000 - - SA threshold expired bits 31:16 - - - Notes: - When set, these bits identify the SA that has expired when the SA PN has reached the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . Write these bits to 1 to clear. */ - unsigned int mssIngressSaThresholdExpiredMSW : 16; /* 1E.8039.F:0 ROS Default = 0x0000 */ - /* SA threshold expired bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaThresholdExpiredStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress ECC Interrupt Status Register: 1E.803A */ -/* MSS Ingress ECC Interrupt Status Register: 1E.803A */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress ECC Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.803A.F:0 R/W MSS Ingress SA ECC Error Interrupt LSW [F:0] - AQ_MssIngressEccInterruptStatusRegister_HHD.u0.bits_0.mssIngressSaEccErrorInterruptLSW - - Default = 0x0000 - - SA ECC error interrupt bits 15:0 - - - Notes: - When set to 1, indicates that an ECC error occured for the SA. */ - unsigned int mssIngressSaEccErrorInterruptLSW : 16; /* 1E.803A.F:0 R/W Default = 0x0000 */ - /* SA ECC error interrupt bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress ECC Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.803B.F:0 R/W MSS Ingress SA ECC Error Interrupt MSW [1F:10] - AQ_MssIngressEccInterruptStatusRegister_HHD.u1.bits_1.mssIngressSaEccErrorInterruptMSW - - Default = 0x0000 - - SA ECC error interrupt bits 31:16 - - - Notes: - When set to 1, indicates that an ECC error occured for the SA. */ - unsigned int mssIngressSaEccErrorInterruptMSW : 16; /* 1E.803B.F:0 R/W Default = 0x0000 */ - /* SA ECC error interrupt bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressEccInterruptStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress LUT Address Control Register: 1E.8080 */ -/* MSS Ingress LUT Address Control Register: 1E.8080 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress LUT Address Control Register */ - union - { - struct - { - /*! \brief 1E.8080.8:0 R/W MSS Ingress LUT Address [8:0] - AQ_MssIngressLutAddressControlRegister_HHD.u0.bits_0.mssIngressLutAddress - - Default = 0x000 - - LUT address - - */ - unsigned int mssIngressLutAddress : 9; /* 1E.8080.8:0 R/W Default = 0x000 */ - /* LUT address - */ - unsigned int reserved0 : 3; - /*! \brief 1E.8080.F:C R/W MSS Ingress LUT Select [3:0] - AQ_MssIngressLutAddressControlRegister_HHD.u0.bits_0.mssIngressLutSelect - - Default = 0x0 - - LUT select - - - Notes: - 0x0 : Ingress Pre-Security MAC Control FIlter (IGPRCTLF) LUT - 0x1 : Ingress Pre-Security Classification LUT (IGPRC) - 0x2 : Ingress Packet Format (IGPFMT) SAKey LUT - 0x3 : Ingress Packet Format (IGPFMT) SC/SA LUT - 0x4 : Ingress Post-Security Classification LUT (IGPOC) - 0x5 : Ingress Post-Security MAC Control Filter (IGPOCTLF) LUT - 0x6 : Ingress MIB (IGMIB) */ - unsigned int mssIngressLutSelect : 4; /* 1E.8080.F:C R/W Default = 0x0 */ - /* LUT select - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_MssIngressLutAddressControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress LUT Control Register: 1E.8081 */ -/* MSS Ingress LUT Control Register: 1E.8081 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress LUT Control Register */ - union - { - struct - { - unsigned int reserved0 : 14; - /*! \brief 1E.8081.E R/W MSS Ingress LUT Read - AQ_MssIngressLutControlRegister_HHD.u0.bits_0.mssIngressLutRead - - Default = 0x0 - - 1 = LUT read - - - Notes: - Setting this bit to 1, will read the LUT. This bit will automatically clear to 0. */ - unsigned int mssIngressLutRead : 1; /* 1E.8081.E R/W Default = 0x0 */ - /* 1 = LUT read - */ - /*! \brief 1E.8081.F R/W MSS Ingress LUT Write - AQ_MssIngressLutControlRegister_HHD.u0.bits_0.mssIngressLutWrite - - Default = 0x0 - - 1 = LUT write - - - Notes: - Setting this bit to 1, will write the LUT. This bit will automatically clear to 0. */ - unsigned int mssIngressLutWrite : 1; /* 1E.8081.F R/W Default = 0x0 */ - /* 1 = LUT write - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_MssIngressLutControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress LUT Data Control Register: 1E.80A0 */ -/* MSS Ingress LUT Data Control Register: 1E.80A0 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A0.F:0 R/W MSS Ingress LUT Data 0 [F:0] - AQ_MssIngressLutDataControlRegister_HHD.u0.bits_0.mssIngressLutData_0 - - Default = 0x0000 - - LUT data bits 15:0 - - */ - unsigned int mssIngressLutData_0 : 16; /* 1E.80A0.F:0 R/W Default = 0x0000 */ - /* LUT data bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A1.F:0 R/W MSS Ingress LUT Data 1 [1F:10] - AQ_MssIngressLutDataControlRegister_HHD.u1.bits_1.mssIngressLutData_1 - - Default = 0x0000 - - LUT data bits 31:16 - - */ - unsigned int mssIngressLutData_1 : 16; /* 1E.80A1.F:0 R/W Default = 0x0000 */ - /* LUT data bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A2.F:0 R/W MSS Ingress LUT Data 2 [2F:20] - AQ_MssIngressLutDataControlRegister_HHD.u2.bits_2.mssIngressLutData_2 - - Default = 0x0000 - - LUT data bits 47:32 - - */ - unsigned int mssIngressLutData_2 : 16; /* 1E.80A2.F:0 R/W Default = 0x0000 */ - /* LUT data bits 47:32 - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A3.F:0 R/W MSS Ingress LUT Data 3 [3F:30] - AQ_MssIngressLutDataControlRegister_HHD.u3.bits_3.mssIngressLutData_3 - - Default = 0x0000 - - LUT data bits 63:48 - - */ - unsigned int mssIngressLutData_3 : 16; /* 1E.80A3.F:0 R/W Default = 0x0000 */ - /* LUT data bits 63:48 - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A4.F:0 R/W MSS Ingress LUT Data 4 [4F:40] - AQ_MssIngressLutDataControlRegister_HHD.u4.bits_4.mssIngressLutData_4 - - Default = 0x0000 - - LUT data bits 79:64 - - */ - unsigned int mssIngressLutData_4 : 16; /* 1E.80A4.F:0 R/W Default = 0x0000 */ - /* LUT data bits 79:64 - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A5.F:0 R/W MSS Ingress LUT Data 5 [5F:50] - AQ_MssIngressLutDataControlRegister_HHD.u5.bits_5.mssIngressLutData_5 - - Default = 0x0000 - - LUT data bits 95:80 - - */ - unsigned int mssIngressLutData_5 : 16; /* 1E.80A5.F:0 R/W Default = 0x0000 */ - /* LUT data bits 95:80 - */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A6.F:0 R/W MSS Ingress LUT Data 6 [6F:60] - AQ_MssIngressLutDataControlRegister_HHD.u6.bits_6.mssIngressLutData_6 - - Default = 0x0000 - - LUT data bits 111:96 - - */ - unsigned int mssIngressLutData_6 : 16; /* 1E.80A6.F:0 R/W Default = 0x0000 */ - /* LUT data bits 111:96 - */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A7.F:0 R/W MSS Ingress LUT Data 7 [7F:70] - AQ_MssIngressLutDataControlRegister_HHD.u7.bits_7.mssIngressLutData_7 - - Default = 0x0000 - - LUT data bits 127:112 - - */ - unsigned int mssIngressLutData_7 : 16; /* 1E.80A7.F:0 R/W Default = 0x0000 */ - /* LUT data bits 127:112 - */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A8.F:0 R/W MSS Ingress LUT Data 8 [8F:80] - AQ_MssIngressLutDataControlRegister_HHD.u8.bits_8.mssIngressLutData_8 - - Default = 0x0000 - - LUT data bits 143:128 - - */ - unsigned int mssIngressLutData_8 : 16; /* 1E.80A8.F:0 R/W Default = 0x0000 */ - /* LUT data bits 143:128 - */ - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A9.F:0 R/W MSS Ingress LUT Data 9 [9F:90] - AQ_MssIngressLutDataControlRegister_HHD.u9.bits_9.mssIngressLutData_9 - - Default = 0x0000 - - LUT data bits 159:144 - - */ - unsigned int mssIngressLutData_9 : 16; /* 1E.80A9.F:0 R/W Default = 0x0000 */ - /* LUT data bits 159:144 - */ - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Union for bit and word level access of word 10 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AA.F:0 R/W MSS Ingress LUT Data 10 [AF:A0] - AQ_MssIngressLutDataControlRegister_HHD.u10.bits_10.mssIngressLutData_10 - - Default = 0x0000 - - LUT data bits 175:160 - - */ - unsigned int mssIngressLutData_10 : 16; /* 1E.80AA.F:0 R/W Default = 0x0000 */ - /* LUT data bits 175:160 - */ - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Union for bit and word level access of word 11 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AB.F:0 R/W MSS Ingress LUT Data 11 [BF:B0] - AQ_MssIngressLutDataControlRegister_HHD.u11.bits_11.mssIngressLutData_11 - - Default = 0x0000 - - LUT data bits 191:176 - - */ - unsigned int mssIngressLutData_11 : 16; /* 1E.80AB.F:0 R/W Default = 0x0000 */ - /* LUT data bits 191:176 - */ - } bits_11; - uint16_t word_11; - } u11; - /*! \brief Union for bit and word level access of word 12 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AC.F:0 R/W MSS Ingress LUT Data 12 [CF:C0] - AQ_MssIngressLutDataControlRegister_HHD.u12.bits_12.mssIngressLutData_12 - - Default = 0x0000 - - LUT data bits 207:192 - - */ - unsigned int mssIngressLutData_12 : 16; /* 1E.80AC.F:0 R/W Default = 0x0000 */ - /* LUT data bits 207:192 - */ - } bits_12; - uint16_t word_12; - } u12; - /*! \brief Union for bit and word level access of word 13 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AD.F:0 R/W MSS Ingress LUT Data 13 [DF:D0] - AQ_MssIngressLutDataControlRegister_HHD.u13.bits_13.mssIngressLutData_13 - - Default = 0x0000 - - LUT data bits 223:208 - - */ - unsigned int mssIngressLutData_13 : 16; /* 1E.80AD.F:0 R/W Default = 0x0000 */ - /* LUT data bits 223:208 - */ - } bits_13; - uint16_t word_13; - } u13; - /*! \brief Union for bit and word level access of word 14 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AE.F:0 R/W MSS Ingress LUT Data 14 [EF:E0] - AQ_MssIngressLutDataControlRegister_HHD.u14.bits_14.mssIngressLutData_14 - - Default = 0x0000 - - LUT data bits 239:224 - - */ - unsigned int mssIngressLutData_14 : 16; /* 1E.80AE.F:0 R/W Default = 0x0000 */ - /* LUT data bits 239:224 - */ - } bits_14; - uint16_t word_14; - } u14; - /*! \brief Union for bit and word level access of word 15 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AF.F:0 R/W MSS Ingress LUT Data 15 [FF:F0] - AQ_MssIngressLutDataControlRegister_HHD.u15.bits_15.mssIngressLutData_15 - - Default = 0x0000 - - LUT data bits 255:240 - - */ - unsigned int mssIngressLutData_15 : 16; /* 1E.80AF.F:0 R/W Default = 0x0000 */ - /* LUT data bits 255:240 - */ - } bits_15; - uint16_t word_15; - } u15; - /*! \brief Union for bit and word level access of word 16 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B0.F:0 R/W MSS Ingress LUT Data 16 [10F:100] - AQ_MssIngressLutDataControlRegister_HHD.u16.bits_16.mssIngressLutData_16 - - Default = 0x0000 - - LUT data bits 271:256 - - */ - unsigned int mssIngressLutData_16 : 16; /* 1E.80B0.F:0 R/W Default = 0x0000 */ - /* LUT data bits 271:256 - */ - } bits_16; - uint16_t word_16; - } u16; - /*! \brief Union for bit and word level access of word 17 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B1.F:0 R/W MSS Ingress LUT Data 17 [11F:110] - AQ_MssIngressLutDataControlRegister_HHD.u17.bits_17.mssIngressLutData_17 - - Default = 0x0000 - - LUT data bits 287:272 - - */ - unsigned int mssIngressLutData_17 : 16; /* 1E.80B1.F:0 R/W Default = 0x0000 */ - /* LUT data bits 287:272 - */ - } bits_17; - uint16_t word_17; - } u17; - /*! \brief Union for bit and word level access of word 18 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B2.F:0 R/W MSS Ingress LUT Data 18 [12F:120] - AQ_MssIngressLutDataControlRegister_HHD.u18.bits_18.mssIngressLutData_18 - - Default = 0x0000 - - LUT data bits 303:288 - - */ - unsigned int mssIngressLutData_18 : 16; /* 1E.80B2.F:0 R/W Default = 0x0000 */ - /* LUT data bits 303:288 - */ - } bits_18; - uint16_t word_18; - } u18; - /*! \brief Union for bit and word level access of word 19 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B3.F:0 R/W MSS Ingress LUT Data 19 [13F:130] - AQ_MssIngressLutDataControlRegister_HHD.u19.bits_19.mssIngressLutData_19 - - Default = 0x0000 - - LUT data bits 319:304 - - */ - unsigned int mssIngressLutData_19 : 16; /* 1E.80B3.F:0 R/W Default = 0x0000 */ - /* LUT data bits 319:304 - */ - } bits_19; - uint16_t word_19; - } u19; - /*! \brief Union for bit and word level access of word 20 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B4.F:0 R/W MSS Ingress LUT Data 20 [14F:140] - AQ_MssIngressLutDataControlRegister_HHD.u20.bits_20.mssIngressLutData_20 - - Default = 0x0000 - - LUT data bits 335:320 - - */ - unsigned int mssIngressLutData_20 : 16; /* 1E.80B4.F:0 R/W Default = 0x0000 */ - /* LUT data bits 335:320 - */ - } bits_20; - uint16_t word_20; - } u20; - /*! \brief Union for bit and word level access of word 21 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B5.F:0 R/W MSS Ingress LUT Data 21 [15F:150] - AQ_MssIngressLutDataControlRegister_HHD.u21.bits_21.mssIngressLutData_21 - - Default = 0x0000 - - LUT data bits 351:336 - - */ - unsigned int mssIngressLutData_21 : 16; /* 1E.80B5.F:0 R/W Default = 0x0000 */ - /* LUT data bits 351:336 - */ - } bits_21; - uint16_t word_21; - } u21; - /*! \brief Union for bit and word level access of word 22 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B6.F:0 R/W MSS Ingress LUT Data 22 [16F:160] - AQ_MssIngressLutDataControlRegister_HHD.u22.bits_22.mssIngressLutData_22 - - Default = 0x0000 - - LUT data bits 367:352 - - */ - unsigned int mssIngressLutData_22 : 16; /* 1E.80B6.F:0 R/W Default = 0x0000 */ - /* LUT data bits 367:352 - */ - } bits_22; - uint16_t word_22; - } u22; - /*! \brief Union for bit and word level access of word 23 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B7.F:0 R/W MSS Ingress LUT Data 23 [17F:170] - AQ_MssIngressLutDataControlRegister_HHD.u23.bits_23.mssIngressLutData_23 - - Default = 0x0000 - - LUT data bits 383:368 - - */ - unsigned int mssIngressLutData_23 : 16; /* 1E.80B7.F:0 R/W Default = 0x0000 */ - /* LUT data bits 383:368 - */ - } bits_23; - uint16_t word_23; - } u23; -} AQ_MssIngressLutDataControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line General Control Register: 1E.9004 */ -/* MSM Line General Control Register: 1E.9004 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line General Control Register */ - union - { - struct - { - /*! \brief 1E.9004.0 R/W MSM Line Tx Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineTxEnable - - Default = 0x0 - - 1 = Tx enable - - Notes: - MAC Rx path enable. Should be set to 1 to enable the MAC Rx path. Should be set to 0 to disable the MAC Rx path. */ - unsigned int msmLineTxEnable : 1; /* 1E.9004.0 R/W Default = 0x0 */ - /* 1 = Tx enable */ - /*! \brief 1E.9004.1 R/W MSM Line Rx Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineRxEnable - - Default = 0x0 - - 1 = Rx enable - - Notes: - MAC Tx path enable. Should be set to 1 to enable the MAC Tx path. Should be set to 0 to disable the MAC Tx path. */ - unsigned int msmLineRxEnable : 1; /* 1E.9004.1 R/W Default = 0x0 */ - /* 1 = Rx enable */ - unsigned int reserved0 : 1; - /*! \brief 1E.9004.3 R/W MSM Line WAN Mode - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineWanMode - - Default = 0x0 - - 1 = WAN mode - 0 = LAN mode - - - Notes: - WAN mode enable. Sets WAN mode when set to 1 and LAN mode when set to 0. Note: When changing the mode, verifiy correct setting of the Tx IPG. */ - unsigned int msmLineWanMode : 1; /* 1E.9004.3 R/W Default = 0x0 */ - /* 1 = WAN mode - 0 = LAN mode - */ - /*! \brief 1E.9004.4 R/W MSM Line Promiscuous Mode - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePromiscuousMode - - Default = 0x0 - - 1 = Promiscuous mode - - - Notes: - When set to 1, all frames are received without any MAC address filtering. */ - unsigned int msmLinePromiscuousMode : 1; /* 1E.9004.4 R/W Default = 0x0 */ - /* 1 = Promiscuous mode - */ - /*! \brief 1E.9004.5 R/W MSM Line PAD Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePadEnable - - Default = 0x0 - - 1 = Enable frame padding removal on Rx - - - Notes: - When set to 1, enable frame padding removal on the Rx path. If enabled, padding is removed before the frame is transferred to the MAC client application. If disabled, no padding is removed on the Rx by the MAC. - Note : On Tx, the MAC always adds padding as required. */ - unsigned int msmLinePadEnable : 1; /* 1E.9004.5 R/W Default = 0x0 */ - /* 1 = Enable frame padding removal on Rx - */ - /*! \brief 1E.9004.6 R/W MSM Line CRC Forward - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineCrcForward - - Default = 0x0 - - 1 = Enable CRC forwarding - - - Notes: - When set to 1, the CRC field of the received frames is forwarded with the frame to the user application. If disabled, the CRC field is stripped from the frame. - Note : If padding is enabled ( See MAC PAD Enable set to 1), this bit is ignored. */ - unsigned int msmLineCrcForward : 1; /* 1E.9004.6 R/W Default = 0x0 */ - /* 1 = Enable CRC forwarding - */ - /*! \brief 1E.9004.7 R/W MSM Line Pause Forward - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePauseForward - - Default = 0x0 - - 1 = Enable Pause forwarding - - - Notes: - Terminate or forward pause frames. If set to 1, pause frames are forwarded to the user application. In normal mode, when set to 0, pause frames are terminated and discarded within the MAC. */ - unsigned int msmLinePauseForward : 1; /* 1E.9004.7 R/W Default = 0x0 */ - /* 1 = Enable Pause forwarding - */ - /*! \brief 1E.9004.8 R/W MSM Line Pause Ignore - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePauseIgnore - - Default = 0x0 - - 1 = Ignore pause frames - - - Notes: - Ignore pause frame quanta. If set to 1, received pause frames are ignored by the MAC. When set to 0, the Tx is stopped for the amount of time specified in the pause quanta received within the pause frame. */ - unsigned int msmLinePauseIgnore : 1; /* 1E.9004.8 R/W Default = 0x0 */ - /* 1 = Ignore pause frames - */ - /*! \brief 1E.9004.9 R/W MSM Line Tx Address Insert Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineTxAddressInsertEnable - - Default = 0x0 - - 1 = Insert Tx MAC source address - - - Notes: - Set the source MAC address on transmit. If set to 1, the MAC overwrites the source MAC address with the MAC programmed address in all transmitted frames. When set to 0, the source MAC address is transmitted unmodified from the MAC Tx client application. */ - unsigned int msmLineTxAddressInsertEnable : 1; /* 1E.9004.9 R/W Default = 0x0 */ - /* 1 = Insert Tx MAC source address - */ - /*! \brief 1E.9004.A R/W MSM Line Tx CRC Append - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineTxCrcAppend - - Default = 0x0 - - 1 = Append Tx CRC - - - Notes: - Permanently enable CRC append on transmit. If set to 1, the Tx will append a CRC to all transmitted frames. If set to 0, CRC append can be controlled on a per frame basis using the pin ff_tx_crc. - This configuration bit is OR'ed with the external ff_tx_crc pin to instruct the Tx to append a CRC to transmitted frames. The ff_tx_crc pin is tied to 0. */ - unsigned int msmLineTxCrcAppend : 1; /* 1E.9004.A R/W Default = 0x0 */ - /* 1 = Append Tx CRC - */ - /*! \brief 1E.9004.B R/W MSM Line Tx Pad Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineTxPadEnable - - Default = 0x1 - - 1 = Enable Tx padding - - - Notes: - When set to 1, enable padding of frames in the Tx direction. When set to 0, the MAC will not extend frames from the application to a minimum of 64 bytes, allowing to transmit short frames (violating the Ethernet mimimum size requirements). Must be set to 1 for normal operation. */ - unsigned int msmLineTxPadEnable : 1; /* 1E.9004.B R/W Default = 0x1 */ - /* 1 = Enable Tx padding - */ - /*! \brief 1E.9004.C R/WSC MSM Line Soft Reset - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineSoftReset - - Default = 0x0 - - 1 = Soft reset - - - Notes: - Software reset. Self clearing bit. When set to 1, resets all statistic counters as well as the Tx and Rx FIFOs. It should be issued after all traffic has been stopped as a result of clearing the Rx/Tx enable bits ( See MAC Rx Enable set to 0 and See MAC Tx Enable set to 0). - Note : Can lead to an Rx interface (ff_rx_xxx) violations to the application if the reset is issued in the middle of a receive frame transfer. Then the end of packet (assertion of ff_rx_eop) is lost and the application should be prepeared to handle this exception. */ - unsigned int msmLineSoftReset : 1; /* 1E.9004.C R/WSC Default = 0x0 */ - /* 1 = Soft reset - */ - /*! \brief 1E.9004.D R/W MSM Line Control Frame Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineControlFrameEnable - - Default = 0x0 - - 1 = Control frame enabled - - - Notes: - MAC control frame enable. When set to 1, the MAC control frames with any Opcode other than 0x0001 are accepted and forwarded to the client interface. When set to 0, MAC control frames with any opcode other than 0x0001 are silently discarded. */ - unsigned int msmLineControlFrameEnable : 1; /* 1E.9004.D R/W Default = 0x0 */ - /* 1 = Control frame enabled - */ - /*! \brief 1E.9004.E R/W MSM Line Rx Error Discard - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineRxErrorDiscard - - Default = 0x0 - - 1 = Enable discard of received errored frames - - - Notes: - Rx errored frame discard enable. When set to 1, any frame received with an error is discarded and not forwarded to the client interface. When set to 0, errored frames are forwarded to the client interface with ff_rx_err asserted. - Note : It is recommended to set this bit to 1 only when store and forward operation is enabled (RX_SECTION_FULL TBD). */ - unsigned int msmLineRxErrorDiscard : 1; /* 1E.9004.E R/W Default = 0x0 */ - /* 1 = Enable discard of received errored frames - */ - /*! \brief 1E.9004.F R/W MSM Line PHY Tx Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePhyTxEnable - - Default = 0x0 - - 1 = Enable PHY Tx - - - Notes: - Directly controls the phy_tx_ena pin. */ - unsigned int msmLinePhyTxEnable : 1; /* 1E.9004.F R/W Default = 0x0 */ - /* 1 = Enable PHY Tx - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line General Control Register */ - union - { - struct - { - /*! \brief 1E.9005.0 R/W MSM Line Force Send IDLE - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineForceSendIdle - - Default = 0x0 - - 1 = Force send idle - - Notes: - When set to 1, suppress any frame transmissions and forces IDLE n the Tx interface instead of frames. This control affects the MAC reconciliation layer (RS) which acts after all MAC datapath has processed the frame. - Note : Does not have an effect on fault handling (i.e. reception of local fault will still cause transmit of remote fault). - Must be 0 for normal operation. */ - unsigned int msmLineForceSendIdle : 1; /* 1E.9005.0 R/W Default = 0x0 */ - /* 1 = Force send idle */ - /*! \brief 1E.9005.1 R/W MSM Line Length Check Disable - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineLengthCheckDisable - - Default = 0x0 - - 1 = Disable length check - - Notes: - Payload length check disable. When set to 0, the MAC checks the frames payload length with the frame length/type field. When set to 1, the payload length check is disabled. */ - unsigned int msmLineLengthCheckDisable : 1; /* 1E.9005.1 R/W Default = 0x0 */ - /* 1 = Disable length check */ - /*! \brief 1E.9005.2 R/W MSM Line IDLE Column Count Extend - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineIdleColumnCountExtend - - Default = 0x0 - - 1 = Extend IDLE column count - - Notes: - When set to 1, extends the RS layer IDLE column counter by 2x. The IEEE 802.3ae defines the fault condition to be cleared after 128 columns of IDLE have been received. If the MAC operates together with a WAN mode PCS (WIS) it may may happen (depending on PCS) that this period is too short to bridge the IDLE stuffing occurring in this mode, leading to a toggling fault indication. In this case, extending the counter helps to aoivd toggling fault indications. */ - unsigned int msmLineIdleColumnCountExtend : 1; /* 1E.9005.2 R/W Default = 0x0 */ - /* 1 = Extend IDLE column count */ - /*! \brief 1E.9005.3 R/W MSM Line Priority Flow Control Enable - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLinePriorityFlowControlEnable - - Default = 0x0 - - 1 = Enable priority flow control - 0 = Enable link flow control - - - Notes: - Enable priority flow control (PFC) mode of operation. When set to 0, the MAC uses standard link pause frames. When set to 1, the MAC will transmit and accept PFC frames. */ - unsigned int msmLinePriorityFlowControlEnable : 1; /* 1E.9005.3 R/W Default = 0x0 */ - /* 1 = Enable priority flow control - 0 = Enable link flow control - */ - unsigned int reserved2 : 1; - /*! \brief 1E.9005.5 R/W MSM Line SFD Check Disable - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineSfdCheckDisable - - Default = 0x0 - - 1 = Disable SFD check - - - Notes: - Disable check of SFD (0xD5) character at frame start. When set to 1, the frame is accepted even if the SFD byte following the preamble is not 0xD5. When set to 0, a frame is accepted only if the SFD byte is found with the value 0xD5. */ - unsigned int msmLineSfdCheckDisable : 1; /* 1E.9005.5 R/W Default = 0x0 */ - /* 1 = Disable SFD check - */ - unsigned int reserved1 : 1; - /*! \brief 1E.9005.7 R/W MSM Line Tx Low Power IDLE Enable - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineTxLowPowerIdleEnable - - Default = 0x0 - - 1 = Transmit LPI enable - - - Notes: - Transmit low power IDLE enable. When set to 1, the MAC completes the transmission of the current frame and generates low power IDLE sequences (LPI) to the XGMII/SGMII. When set to 0, the MAC operates in normal mode. This bit is OR'ed with the reg_lowp_ena pin. */ - unsigned int msmLineTxLowPowerIdleEnable : 1; /* 1E.9005.7 R/W Default = 0x0 */ - /* 1 = Transmit LPI enable - */ - unsigned int reserved0 : 8; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineGeneralControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line FIFO Control Register: 1E.900E */ -/* MSM Line FIFO Control Register: 1E.900E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.900E.7:0 R/W MSM Line Rx FIFO Full Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u0.bits_0.msmLineRxFifoFullThreshold - - Default = 0x08 - - Rx FIFO full threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmLineRxFifoFullThreshold : 8; /* 1E.900E.7:0 R/W Default = 0x08 */ - /* Rx FIFO full threshold */ - unsigned int reserved0 : 8; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.900F.7:0 R/W MSM Line Rx FIFO Empty Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u1.bits_1.msmLineRxFifoEmptyThreshold - - Default = 0x00 - - Rx FIFO empty threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmLineRxFifoEmptyThreshold : 8; /* 1E.900F.7:0 R/W Default = 0x00 */ - /* Rx FIFO empty threshold */ - unsigned int reserved0 : 8; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSM Line FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.9010.5:0 R/W MSM Line Tx FIFO Full Threshold [5:0] - AQ_MsmLineFifoControlRegister_HHD.u2.bits_2.msmLineTxFifoFullThreshold - - Default = 0x08 - - Tx FIFO full threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmLineTxFifoFullThreshold : 6; /* 1E.9010.5:0 R/W Default = 0x08 */ - /* Tx FIFO full threshold */ - unsigned int reserved0 : 10; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSM Line FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.9011.5:0 R/W MSM Line Tx FIFO Empty Threshold [5:0] - AQ_MsmLineFifoControlRegister_HHD.u3.bits_3.msmLineTxFifoEmptyThreshold - - Default = 0x00 - - Tx FIFO empty threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmLineTxFifoEmptyThreshold : 6; /* 1E.9011.5:0 R/W Default = 0x00 */ - /* Tx FIFO empty threshold */ - unsigned int reserved0 : 10; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of MSM Line FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.9012.7:0 ROS MSM Line Rx FIFO Almost Full Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u4.bits_4.msmLineRxFifoAlmostFullThreshold - - Default = 0x00 - - Rx FIFO almost full threshold - - Notes: - Unused. */ - unsigned int msmLineRxFifoAlmostFullThreshold : 8; /* 1E.9012.7:0 ROS Default = 0x00 */ - /* Rx FIFO almost full threshold */ - unsigned int reserved0 : 8; - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of MSM Line FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.9013.7:0 ROS MSM Line Rx FIFO Almost Empty Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u5.bits_5.msmLineRxFifoAlmostEmptyThreshold - - Default = 0x00 - - Rx FIFO almost empty threshold - - Notes: - Unused. */ - unsigned int msmLineRxFifoAlmostEmptyThreshold : 8; /* 1E.9013.7:0 ROS Default = 0x00 */ - /* Rx FIFO almost empty threshold */ - unsigned int reserved0 : 8; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of MSM Line FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.9014.7:0 ROS MSM Line Tx FIFO Almost Full Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u6.bits_6.msmLineTxFifoAlmostFullThreshold - - Default = 0x00 - - Tx FIFO almost full threshold - - Notes: - Unused. */ - unsigned int msmLineTxFifoAlmostFullThreshold : 8; /* 1E.9014.7:0 ROS Default = 0x00 */ - /* Tx FIFO almost full threshold */ - unsigned int reserved0 : 8; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of MSM Line FIFO Control Register */ - union - { - struct - { - /*! \brief 1E.9015.7:0 ROS MSM Line Tx FIFO Almost Empty Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u7.bits_7.msmLineTxFifoAlmostEmptyThreshold - - Default = 0x00 - - Tx FIFO almost empty threshold - - Notes: - Unused. */ - unsigned int msmLineTxFifoAlmostEmptyThreshold : 8; /* 1E.9015.7:0 ROS Default = 0x00 */ - /* Tx FIFO almost empty threshold */ - unsigned int reserved0 : 8; - } bits_7; - uint16_t word_7; - } u7; -} AQ_MsmLineFifoControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line General Status Register: 1E.9020 */ -/* MSM Line General Status Register: 1E.9020 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line General Status Register */ - union - { - struct - { - /*! \brief 1E.9020.0 BLH MSM Line Rx Local Fault - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineRxLocalFault - - - - Rx local fault detected - - Notes: - Latch high local fault status. Set to 1, whent he MAC detects Rx local fault sequences on the Rx interface. Reset to 0 after read and after reset. */ - unsigned int msmLineRxLocalFault : 1; /* 1E.9020.0 BLH */ - /* Rx local fault detected */ - /*! \brief 1E.9020.1 BLH MSM Line Rx Remote Fault - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineRxRemoteFault - - - - Rx remote fault detected - - Notes: - Latch high local fault status. Set to 1, whent he MAC detects Rx local fault sequences on the Rx interface. Reset to 0 after read and after reset. */ - unsigned int msmLineRxRemoteFault : 1; /* 1E.9020.1 BLH */ - /* Rx remote fault detected */ - /*! \brief 1E.9020.2 RO MSM Line PHY Loss of Signal - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLinePhyLossOfSignal - - - - PHY loss of signal - - Notes: - PHY indicates loss of signal. This is the value of pin phy_los which is tied to 0. */ - unsigned int msmLinePhyLossOfSignal : 1; /* 1E.9020.2 RO */ - /* PHY loss of signal */ - /*! \brief 1E.9020.3 R/W MSM Line Timestamp Available - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineTimestampAvailable - - Default = 0x0 - - Timestamp available - - Notes: - Transmit timestamp available. Indicates that the timestamp of the last transmitted event frame (which had ff_tx_ts_frm=1) is available in the register See MAC Time Stamp Status 0 [F:0] and See MAC Time Stamp Status 1 [F:0] . To clear this bit, the bit must be written with a 1. - */ - unsigned int msmLineTimestampAvailable : 1; /* 1E.9020.3 R/W Default = 0x0 */ - /* Timestamp available */ - /*! \brief 1E.9020.4 RO MSM Line Rx Low Power IDLE - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineRxLowPowerIdle - - - - Rx LPI detected - - Notes: - Receive low power IDLE (LPI). Set to 1 when LPI is currently detected on the MAC Rx interface. Set to 0, when the MAC currently operates in normal mode. */ - unsigned int msmLineRxLowPowerIdle : 1; /* 1E.9020.4 RO */ - /* Rx LPI detected */ - /*! \brief 1E.9020.5 RO MSM Line Tx FIFO Empty - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineTxFifoEmpty - - - - Tx FIFO empty - - Notes: - When set to 1, indicates the Tx FIFO is empty. When set to 0, Tx FIFO is non-empty. */ - unsigned int msmLineTxFifoEmpty : 1; /* 1E.9020.5 RO */ - /* Tx FIFO empty */ - unsigned int reserved0 : 10; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line General Status Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineGeneralStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx IPG Control Register: 1E.9022 */ -/* MSM Line Tx IPG Control Register: 1E.9022 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx IPG Control Register */ - union - { - struct - { - /*! \brief 1E.9022.5:0 R/W MSM Line Tx IPG Length [5:0] - AQ_MsmLineTxIpgControlRegister_HHD.u0.bits_0.msmLineTxIpgLength - - Default = 0x0C - - Tx IPG length - - Notes: - Tx inter-packet gap (IPG) value. Depending on LAN or WAN mode of operation. - LAN Mode : Number of octets in steps of 4. Valid values are 8, 12, 16,..., 100. DIC is supported for any setting > 8. A default of 12 must be set to conform to IEEE802.3ae. - WAN Mode : Stretch factor. Valid values are 4 ... 15. The stretch factor is calculated as (value+1)*8. A default of 12 must be set to conform to IEEE802.3ae (i.e. 13*8=104). A larger value shrinks the IPG (increasing bandwidth). - The reset value of 12 leads to IEEE802.3ae conformant behavior in both modes. - Note : WAN mode is only available in 10G mode of operation. */ - unsigned int msmLineTxIpgLength : 6; /* 1E.9022.5:0 R/W Default = 0x0C */ - /* Tx IPG length */ - unsigned int reserved0 : 10; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx IPG Control Register */ - union - { - struct - { - /*! \brief 1E.9023.F:0 MSM Line Tx IPG Reserved - AQ_MsmLineTxIpgControlRegister_HHD.u1.bits_1.msmLineTxIpgReserved - - - - Value always 0, writes ignored - */ - unsigned int msmLineTxIpgReserved : 16; /* 1E.9023.F:0 */ - /* Value always 0, writes ignored */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxIpgControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Good Frames Counter Register: 1E.9040 */ -/* MSM Line Tx Good Frames Counter Register: 1E.9040 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9040.F:0 ROS MSM Line Tx Good Frames Counter 0 [F:0] - AQ_MsmLineTxGoodFramesCounterRegister_HHD.u0.bits_0.msmLineTxGoodFramesCounter_0 - - Default = 0x0000 - - Tx good frame counter bits 15:0 - - Notes: - Count of frames transmitted without error (Including pause frames). */ - unsigned int msmLineTxGoodFramesCounter_0 : 16; /* 1E.9040.F:0 ROS Default = 0x0000 */ - /* Tx good frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9041.F:0 ROS MSM Line Tx Good Frames Counter 1 [F:0] - AQ_MsmLineTxGoodFramesCounterRegister_HHD.u1.bits_1.msmLineTxGoodFramesCounter_1 - - Default = 0x0000 - - Tx good frame counter bits 31:16 - - - Notes: - Count of frames transmitted without error (Including pause frames). */ - unsigned int msmLineTxGoodFramesCounter_1 : 16; /* 1E.9041.F:0 ROS Default = 0x0000 */ - /* Tx good frame counter bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxGoodFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Good Frames Counter Register: 1E.9044 */ -/* MSM Line Rx Good Frames Counter Register: 1E.9044 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9044.F:0 ROS MSM Line Rx Good Frames Counter 0 [F:0] - AQ_MsmLineRxGoodFramesCounterRegister_HHD.u0.bits_0.msmLineRxGoodFramesCounter_0 - - Default = 0x0000 - - Rx good frame counter bits 15:0 - - Notes: - Count of frames received without error (Including pause frames). */ - unsigned int msmLineRxGoodFramesCounter_0 : 16; /* 1E.9044.F:0 ROS Default = 0x0000 */ - /* Rx good frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9045.F:0 ROS MSM Line Rx Good Frames Counter 1 [F:0] - AQ_MsmLineRxGoodFramesCounterRegister_HHD.u1.bits_1.msmLineRxGoodFramesCounter_1 - - Default = 0x0000 - - Rx good frame counter bits 31:16 - - Notes: - Count of frames received without error (Including pause frames). */ - unsigned int msmLineRxGoodFramesCounter_1 : 16; /* 1E.9045.F:0 ROS Default = 0x0000 */ - /* Rx good frame counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxGoodFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx FCS Errors Counter Register: 1E.9048 */ -/* MSM Line Rx FCS Errors Counter Register: 1E.9048 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx FCS Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.9048.F:0 ROS MSM Line FCS Error Counter 0 [F:0] - AQ_MsmLineRxFcsErrorsCounterRegister_HHD.u0.bits_0.msmLineFcsErrorCounter_0 - - Default = 0x0000 - - Frame check sequence error counter bits 15:0 - - Notes: - Count of frames for which a CRC-32 Error is detected but the frame is otherwise of correct length. */ - unsigned int msmLineFcsErrorCounter_0 : 16; /* 1E.9048.F:0 ROS Default = 0x0000 */ - /* Frame check sequence error counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx FCS Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.9049.F:0 ROS MSM Line FCS Error Counter 1 [F:0] - AQ_MsmLineRxFcsErrorsCounterRegister_HHD.u1.bits_1.msmLineFcsErrorCounter_1 - - Default = 0x0000 - - Frame check sequence error counter bits 31:16 - - Notes: - Count of frames for which a CRC-32 Error is detected but the frame is otherwise of correct length. */ - unsigned int msmLineFcsErrorCounter_1 : 16; /* 1E.9049.F:0 ROS Default = 0x0000 */ - /* Frame check sequence error counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxFcsErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Alignment Errors Counter Register: 1E.904C */ -/* MSM Line Rx Alignment Errors Counter Register: 1E.904C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Alignment Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.904C.F:0 ROS MSM Line Alignment Error Counter 0 [F:0] - AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD.u0.bits_0.msmLineAlignmentErrorCounter_0 - - Default = 0x0000 - - Alignment error counter bits 15:0 - - Notes: - Count of frames received with an alignment error. */ - unsigned int msmLineAlignmentErrorCounter_0 : 16; /* 1E.904C.F:0 ROS Default = 0x0000 */ - /* Alignment error counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Alignment Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.904D.F:0 ROS MSM Line Alignment Error Counter 1 [F:0] - AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD.u1.bits_1.msmLineAlignmentErrorCounter_1 - - Default = 0x0000 - - Alignment error counter bits 31:16 - - Notes: - Count of frames received with an alignment error. */ - unsigned int msmLineAlignmentErrorCounter_1 : 16; /* 1E.904D.F:0 ROS Default = 0x0000 */ - /* Alignment error counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Pause Frames Counter Register: 1E.9050 */ -/* MSM Line Tx Pause Frames Counter Register: 1E.9050 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9050.F:0 ROS MSM Line Tx Pause Frames Counter 0 [F:0] - AQ_MsmLineTxPauseFramesCounterRegister_HHD.u0.bits_0.msmLineTxPauseFramesCounter_0 - - Default = 0x0000 - - Tx pause frame counter bits 15:0 - - Notes: - Valid pause frames transmitted. */ - unsigned int msmLineTxPauseFramesCounter_0 : 16; /* 1E.9050.F:0 ROS Default = 0x0000 */ - /* Tx pause frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9051.F:0 ROS MSM Line Tx Pause Frames Counter 1 [F:0] - AQ_MsmLineTxPauseFramesCounterRegister_HHD.u1.bits_1.msmLineTxPauseFramesCounter_1 - - Default = 0x0000 - - Tx pause frame counter bits 31:16 - - - Notes: - Valid pause frames transmitted. */ - unsigned int msmLineTxPauseFramesCounter_1 : 16; /* 1E.9051.F:0 ROS Default = 0x0000 */ - /* Tx pause frame counter bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxPauseFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Pause Frames Counter Register: 1E.9054 */ -/* MSM Line Rx Pause Frames Counter Register: 1E.9054 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9054.F:0 ROS MSM Line Rx Pause Frames Counter 0 [F:0] - AQ_MsmLineRxPauseFramesCounterRegister_HHD.u0.bits_0.msmLineRxPauseFramesCounter_0 - - Default = 0x0000 - - Rx pause frame counter bits 15:0 - - Notes: - Valid pause frames received. */ - unsigned int msmLineRxPauseFramesCounter_0 : 16; /* 1E.9054.F:0 ROS Default = 0x0000 */ - /* Rx pause frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9055.F:0 ROS MSM Line Rx Pause Frames Counter 1 [F:0] - AQ_MsmLineRxPauseFramesCounterRegister_HHD.u1.bits_1.msmLineRxPauseFramesCounter_1 - - Default = 0x0000 - - Rx pause frame counter bits 31:16 - - Notes: - Valid pause frames received. */ - unsigned int msmLineRxPauseFramesCounter_1 : 16; /* 1E.9055.F:0 ROS Default = 0x0000 */ - /* Rx pause frame counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxPauseFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Too Long Errors Counter Register: 1E.9058 */ -/* MSM Line Rx Too Long Errors Counter Register: 1E.9058 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Too Long Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.9058.F:0 ROS MSM Line Rx Too Long Errors Counter 0 [F:0] - AQ_MsmLineRxTooLongErrorsCounterRegister_HHD.u0.bits_0.msmLineRxTooLongErrorsCounter_0 - - Default = 0x0000 - - Too-long errors counter bits 15:0 - - Notes: - Frame received exceeded the maximum length programmed with register FRM_LGTH. */ - unsigned int msmLineRxTooLongErrorsCounter_0 : 16; /* 1E.9058.F:0 ROS Default = 0x0000 */ - /* Too-long errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Too Long Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.9059.F:0 ROS MSM Line Rx Too Long Errors Counter 1 [F:0] - AQ_MsmLineRxTooLongErrorsCounterRegister_HHD.u1.bits_1.msmLineRxTooLongErrorsCounter_1 - - Default = 0x0000 - - Too-long errors counter bits 31:16 - - Notes: - Frame received exceeded the maximum length programmed with register FRM_LGTH. */ - unsigned int msmLineRxTooLongErrorsCounter_1 : 16; /* 1E.9059.F:0 ROS Default = 0x0000 */ - /* Too-long errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxTooLongErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx In Range Length Errors Counter Register: 1E.905C */ -/* MSM Line Rx In Range Length Errors Counter Register: 1E.905C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx In Range Length Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.905C.F:0 ROS MSM Line Rx In Range Length Errors Counter 0 [F:0] - AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD.u0.bits_0.msmLineRxInRangeLengthErrorsCounter_0 - - Default = 0x0000 - - In-range-length errors counter bits 15:0 - - Notes: - A count of frames with a length/type field value between 46 (VLAN: 42) and less than 0x0600, that does not match the number of payload data octets received. Should count also if length/type field is less than 46 (VLAN: 42) and the frame is longer than 64 bytes. */ - unsigned int msmLineRxInRangeLengthErrorsCounter_0 : 16; /* 1E.905C.F:0 ROS Default = 0x0000 */ - /* In-range-length errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx In Range Length Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.905D.F:0 ROS MSM Line Rx In Range Length Errors Counter 1 [F:0] - AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD.u1.bits_1.msmLineRxInRangeLengthErrorsCounter_1 - - Default = 0x0000 - - In-range-length errors counter bits 31:16 - - Notes: - A count of frames with a length/type field value between 46 (VLAN: 42) and less than 0x0600, that does not match the number of payload data octets received. Should count also if length/type field is less than 46 (VLAN: 42) and the frame is longer than 64 bytes. */ - unsigned int msmLineRxInRangeLengthErrorsCounter_1 : 16; /* 1E.905D.F:0 ROS Default = 0x0000 */ - /* In-range-length errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx VLAN Frames Counter Register: 1E.9060 */ -/* MSM Line Tx VLAN Frames Counter Register: 1E.9060 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9060.F:0 ROS MSM Line Tx VLAN Frames Counter 0 [F:0] - AQ_MsmLineTxVlanFramesCounterRegister_HHD.u0.bits_0.msmLineTxVlanFramesCounter_0 - - Default = 0x0000 - - Tx VLAN frames counter bits 15:0 - - Notes: - Valid VLAN tagged frames transmitted. */ - unsigned int msmLineTxVlanFramesCounter_0 : 16; /* 1E.9060.F:0 ROS Default = 0x0000 */ - /* Tx VLAN frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9061.F:0 ROS MSM Line Tx VLAN Frames Counter 1 [F:0] - AQ_MsmLineTxVlanFramesCounterRegister_HHD.u1.bits_1.msmLineTxVlanFramesCounter_1 - - Default = 0x0000 - - Tx VLAN frames counter bits 31:16 - - Notes: - Valid VLAN tagged frames transmitted. */ - unsigned int msmLineTxVlanFramesCounter_1 : 16; /* 1E.9061.F:0 ROS Default = 0x0000 */ - /* Tx VLAN frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxVlanFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx VLAN Frames Counter Register: 1E.9064 */ -/* MSM Line Rx VLAN Frames Counter Register: 1E.9064 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9064.F:0 ROS MSM Line Rx VLAN Frames Counter 0 [F:0] - AQ_MsmLineRxVlanFramesCounterRegister_HHD.u0.bits_0.msmLineRxVlanFramesCounter_0 - - Default = 0x0000 - - Rx VLAN frames counter bits 15:0 - - Notes: - Valid VLAN tagged frames received. */ - unsigned int msmLineRxVlanFramesCounter_0 : 16; /* 1E.9064.F:0 ROS Default = 0x0000 */ - /* Rx VLAN frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9065.F:0 ROS MSM Line Rx VLAN Frames Counter 1 [F:0] - AQ_MsmLineRxVlanFramesCounterRegister_HHD.u1.bits_1.msmLineRxVlanFramesCounter_1 - - Default = 0x0000 - - Rx VLAN frames counter bits 31:16 - - Notes: - Valid VLAN tagged frames received. */ - unsigned int msmLineRxVlanFramesCounter_1 : 16; /* 1E.9065.F:0 ROS Default = 0x0000 */ - /* Rx VLAN frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxVlanFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Octets Counter Register: 1E.9068 */ -/* MSM Line Tx Octets Counter Register: 1E.9068 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.9068.F:0 ROS MSM Line Tx Octets Counter 0 [F:0] - AQ_MsmLineTxOctetsCounterRegister_HHD.u0.bits_0.msmLineTxOctetsCounter_0 - - Default = 0x0000 - - Tx octets counter bits 15:0 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmLineTxOctetsCounter_0 : 16; /* 1E.9068.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.9069.F:0 ROS MSM Line Tx Octets Counter 1 [F:0] - AQ_MsmLineTxOctetsCounterRegister_HHD.u1.bits_1.msmLineTxOctetsCounter_1 - - Default = 0x0000 - - Tx octets counter bits 31:16 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmLineTxOctetsCounter_1 : 16; /* 1E.9069.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSM Line Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.906A.F:0 ROS MSM Line Tx Octets Counter 2 [F:0] - AQ_MsmLineTxOctetsCounterRegister_HHD.u2.bits_2.msmLineTxOctetsCounter_2 - - Default = 0x0000 - - Tx octets counter bits 47:32 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmLineTxOctetsCounter_2 : 16; /* 1E.906A.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 47:32 */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSM Line Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.906B.F:0 ROS MSM Line Tx Octets Counter 3 [F:0] - AQ_MsmLineTxOctetsCounterRegister_HHD.u3.bits_3.msmLineTxOctetsCounter_3 - - Default = 0x0000 - - Tx octets counter bits 63:48 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmLineTxOctetsCounter_3 : 16; /* 1E.906B.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 63:48 */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_MsmLineTxOctetsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Octets Counter Register: 1E.906C */ -/* MSM Line Rx Octets Counter Register: 1E.906C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.906C.F:0 ROS MSM Line Rx Octets Counter 0 [F:0] - AQ_MsmLineRxOctetsCounterRegister_HHD.u0.bits_0.msmLineRxOctetsCounter_0 - - Default = 0x0000 - - Rx octets counter bits 15:0 - - Notes: - All octets received except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames received. */ - unsigned int msmLineRxOctetsCounter_0 : 16; /* 1E.906C.F:0 ROS Default = 0x0000 */ - /* Rx octets counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.906D.F:0 ROS MSM Line Rx Octets Counter 1 [F:0] - AQ_MsmLineRxOctetsCounterRegister_HHD.u1.bits_1.msmLineRxOctetsCounter_1 - - Default = 0x0000 - - Rx octets counter bits 31:16 - - Notes: - All octets received except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames received. */ - unsigned int msmLineRxOctetsCounter_1 : 16; /* 1E.906D.F:0 ROS Default = 0x0000 */ - /* Rx octets counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxOctetsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Unicast Frames Counter Register: 1E.9070 */ -/* MSM Line Rx Unicast Frames Counter Register: 1E.9070 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9070.F:0 ROS MSM Line Rx Unicast Frames Counter 0 [F:0] - AQ_MsmLineRxUnicastFramesCounterRegister_HHD.u0.bits_0.msmLineRxUnicastFramesCounter_0 - - Default = 0x0000 - - Rx unicast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '0'. */ - unsigned int msmLineRxUnicastFramesCounter_0 : 16; /* 1E.9070.F:0 ROS Default = 0x0000 */ - /* Rx unicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9071.F:0 ROS MSM Line Rx Unicast Frames Counter 1 [F:0] - AQ_MsmLineRxUnicastFramesCounterRegister_HHD.u1.bits_1.msmLineRxUnicastFramesCounter_1 - - Default = 0x0000 - - Rx unicast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '0'. */ - unsigned int msmLineRxUnicastFramesCounter_1 : 16; /* 1E.9071.F:0 ROS Default = 0x0000 */ - /* Rx unicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxUnicastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Multicast Frames Counter Register: 1E.9074 */ -/* MSM Line Rx Multicast Frames Counter Register: 1E.9074 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9074.F:0 ROS MSM Line Rx Multicast Frames Counter 0 [F:0] - AQ_MsmLineRxMulticastFramesCounterRegister_HHD.u0.bits_0.msmLineRxMulticastFramesCounter_0 - - Default = 0x0000 - - Rx multicast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '1' but not the broadcast address (all bits set '1' ). Pause frames are not counted. */ - unsigned int msmLineRxMulticastFramesCounter_0 : 16; /* 1E.9074.F:0 ROS Default = 0x0000 */ - /* Rx multicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9075.F:0 ROS MSM Line Rx Multicast Frames Counter 1 [F:0] - AQ_MsmLineRxMulticastFramesCounterRegister_HHD.u1.bits_1.msmLineRxMulticastFramesCounter_1 - - Default = 0x0000 - - Rx multicast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '1' but not the broadcast address (all bits set '1' ). Pause frames are not counted. */ - unsigned int msmLineRxMulticastFramesCounter_1 : 16; /* 1E.9075.F:0 ROS Default = 0x0000 */ - /* Rx multicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxMulticastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Broadcast Frames Counter Register: 1E.9078 */ -/* MSM Line Rx Broadcast Frames Counter Register: 1E.9078 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9078.F:0 ROS MSM Line Rx Broadcast Frames Counter 0 [F:0] - AQ_MsmLineRxBroadcastFramesCounterRegister_HHD.u0.bits_0.msmLineRxBroadcastFramesCounter_0 - - Default = 0x0000 - - Rx broadcast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface (FIFO) and all bits of the destination address were set '1'. */ - unsigned int msmLineRxBroadcastFramesCounter_0 : 16; /* 1E.9078.F:0 ROS Default = 0x0000 */ - /* Rx broadcast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9079.F:0 ROS MSM Line Rx Broadcast Frames Counter 1 [F:0] - AQ_MsmLineRxBroadcastFramesCounterRegister_HHD.u1.bits_1.msmLineRxBroadcastFramesCounter_1 - - Default = 0x0000 - - Rx broadcast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface (FIFO) and all bits of the destination address were set '1'. */ - unsigned int msmLineRxBroadcastFramesCounter_1 : 16; /* 1E.9079.F:0 ROS Default = 0x0000 */ - /* Rx broadcast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxBroadcastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Errors Counter Register: 1E.907C */ -/* MSM Line Tx Errors Counter Register: 1E.907C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.907C.F:0 ROS MSM Line Tx Errors Counter 0 [F:0] - AQ_MsmLineTxErrorsCounterRegister_HHD.u0.bits_0.msmLineTxErrorsCounter_0 - - Default = 0x0000 - - Rx errors counter bits 15:0 - - Notes: - Number of frames transmitted with error: - - FIFO Overflow Errors - - FIFO Underflow Errors */ - unsigned int msmLineTxErrorsCounter_0 : 16; /* 1E.907C.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.907D.F:0 ROS MSM Line Tx Errors Counter 1 [F:0] - AQ_MsmLineTxErrorsCounterRegister_HHD.u1.bits_1.msmLineTxErrorsCounter_1 - - Default = 0x0000 - - Tx errors counter bits 31:16 - - Notes: - Number of frames transmitted with error: - - FIFO Overflow Errors - - FIFO Underflow Errors */ - unsigned int msmLineTxErrorsCounter_1 : 16; /* 1E.907D.F:0 ROS Default = 0x0000 */ - /* Tx errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Unicast Frames Counter Register: 1E.9084 */ -/* MSM Line Tx Unicast Frames Counter Register: 1E.9084 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9084.F:0 ROS MSM Line Tx Unicast Frames Counter 0 [F:0] - AQ_MsmLineTxUnicastFramesCounterRegister_HHD.u0.bits_0.msmLineTxUnicastFramesCounter_0 - - Default = 0x0000 - - Tx unicast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '0'. */ - unsigned int msmLineTxUnicastFramesCounter_0 : 16; /* 1E.9084.F:0 ROS Default = 0x0000 */ - /* Tx unicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9085.F:0 ROS MSM Line Tx Unicast Frames Counter 1 [F:0] - AQ_MsmLineTxUnicastFramesCounterRegister_HHD.u1.bits_1.msmLineTxUnicastFramesCounter_1 - - Default = 0x0000 - - Tx unicast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '0'. */ - unsigned int msmLineTxUnicastFramesCounter_1 : 16; /* 1E.9085.F:0 ROS Default = 0x0000 */ - /* Tx unicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxUnicastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Multicast Frames Counter Register: 1E.9088 */ -/* MSM Line Tx Multicast Frames Counter Register: 1E.9088 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9088.F:0 ROS MSM Line Tx Multicast Frames Counter 0 [F:0] - AQ_MsmLineTxMulticastFramesCounterRegister_HHD.u0.bits_0.msmLineTxMulticastFramesCounter_0 - - Default = 0x0000 - - Tx multicast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '1' but not the broadcast address (all bits '1'). */ - unsigned int msmLineTxMulticastFramesCounter_0 : 16; /* 1E.9088.F:0 ROS Default = 0x0000 */ - /* Tx multicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9089.F:0 ROS MSM Line Tx Multicast Frames Counter 1 [F:0] - AQ_MsmLineTxMulticastFramesCounterRegister_HHD.u1.bits_1.msmLineTxMulticastFramesCounter_1 - - Default = 0x0000 - - Tx multicast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '1' but not the broadcast address (all bits '1'). */ - unsigned int msmLineTxMulticastFramesCounter_1 : 16; /* 1E.9089.F:0 ROS Default = 0x0000 */ - /* Tx multicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxMulticastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Broadcast Frames Counter Register: 1E.908C */ -/* MSM Line Tx Broadcast Frames Counter Register: 1E.908C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.908C.F:0 ROS MSM Line Tx Broadcast Frames Counter 0 [F:0] - AQ_MsmLineTxBroadcastFramesCounterRegister_HHD.u0.bits_0.msmLineTxBroadcastFramesCounter_0 - - Default = 0x0000 - - Tx broadcast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and all bits of the destination address set to '1'. */ - unsigned int msmLineTxBroadcastFramesCounter_0 : 16; /* 1E.908C.F:0 ROS Default = 0x0000 */ - /* Tx broadcast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.908D.F:0 ROS MSM Line Tx Broadcast Frames Counter 1 [F:0] - AQ_MsmLineTxBroadcastFramesCounterRegister_HHD.u1.bits_1.msmLineTxBroadcastFramesCounter_1 - - Default = 0x0000 - - Tx broadcast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and all bits of the destination address set to '1'. */ - unsigned int msmLineTxBroadcastFramesCounter_1 : 16; /* 1E.908D.F:0 ROS Default = 0x0000 */ - /* Tx broadcast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxBroadcastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Errors Counter Register: 1E.90C8 */ -/* MSM Line Rx Errors Counter Register: 1E.90C8 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.90C8.F:0 ROS MSM Line Rx Errors Counter 0 [F:0] - AQ_MsmLineRxErrorsCounterRegister_HHD.u0.bits_0.msmLineRxErrorsCounter_0 - - Default = 0x0000 - - Rx errors counter bits 15:0 - - Notes: - Number of frames received with error: - - FIFO Overflow Errors - - CRC Errors - - Payload Length Errors - - Jabber and Oversized Errors - - Alignment Errors - - The dedicated Error Code (0xfe, not a code error) was received */ - unsigned int msmLineRxErrorsCounter_0 : 16; /* 1E.90C8.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.90C9.F:0 ROS MSM Line Rx Errors Counter 1 [F:0] - AQ_MsmLineRxErrorsCounterRegister_HHD.u1.bits_1.msmLineRxErrorsCounter_1 - - Default = 0x0000 - - Rx errors counter bits 31:16 - - Notes: - Number of frames received with error: - - FIFO Overflow Errors - - CRC Errors - - Payload Length Errors - - Jabber and Oversized Errors - - Alignment Errors - - The dedicated Error Code (0xfe, not a code error) was received */ - unsigned int msmLineRxErrorsCounter_1 : 16; /* 1E.90C9.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Control: 1E.C000 */ -/* Global Control: 1E.C000 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Control */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Control */ - union - { - struct - { - /*! \brief 1E.C001.0 R/W uP Run Stall - AQ_GlobalControl_HHD.u1.bits_1.upRunStall - - Default = 0x0 - - 1 = uP Run Stall - 0 = uP normal mode - - - Notes: - Deactivates the uP. */ - unsigned int upRunStall : 1; /* 1E.C001.0 R/W Default = 0x0 */ - /* 1 = uP Run Stall - 0 = uP normal mode - */ - unsigned int reserved1 : 5; - /*! \brief 1E.C001.6 R/W uP Run Stall Override - AQ_GlobalControl_HHD.u1.bits_1.upRunStallOverride - - Default = 0x0 - - 0 = uP Run Stall from "MDIO Boot Load" pin. - 1 = uP Run Stall from See MCP Run Stall bit - - - - Notes: - This bit selects the uP Run Stall from either the "MDIO Boot Load" pin or the See MCP Run Stall bit. Pin no longer brought out as deprecated. */ - unsigned int upRunStallOverride : 1; /* 1E.C001.6 R/W Default = 0x0 */ - /* 0 = uP Run Stall from "MDIO Boot Load" pin. - 1 = uP Run Stall from See MCP Run Stall bit - - */ - unsigned int reserved0 : 8; - /*! \brief 1E.C001.F R/W uP Reset - AQ_GlobalControl_HHD.u1.bits_1.upReset - - Default = 0x0 - - 1 = Reset - - - Notes: - Resets the uP and the PIF master and slave bus. Will be active for a minimum of 100 microseconds. */ - unsigned int upReset : 1; /* 1E.C001.F R/W Default = 0x0 */ - /* 1 = Reset - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalControl_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reset Control: 1E.C006 */ -/* Global Reset Control: 1E.C006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reset Control */ - union - { - struct - { - unsigned int reserved1 : 14; - /*! \brief 1E.C006.E R/WPD Global MMD Reset Disable - AQ_GlobalResetControl_HHD.u0.bits_0.globalMMD_ResetDisable - - Provisionable Default = 0x0 - - 1 = Disable the S/W reset to the Global MMD registers - 0 = Enable the S/W reset to the Global MMD registers - - - Notes: - Setting this bit prevents a Global S/W reset or Global S/W reset from resetting the Global MMD registers */ - unsigned int globalMMD_ResetDisable : 1; /* 1E.C006.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Disable the S/W reset to the Global MMD registers - 0 = Enable the S/W reset to the Global MMD registers - */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalResetControl_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Diagnostic Provisioning: 1E.C400 */ -/* Global Diagnostic Provisioning: 1E.C400 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Diagnostic Provisioning */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C400.F R/WPD Enable Diagnostics - AQ_GlobalDiagnosticProvisioning_HHD.u0.bits_0.enableDiagnostics - - Provisionable Default = 0x1 - - 1 = Chip performs diagnostics on power-up - */ - unsigned int enableDiagnostics : 1; /* 1E.C400.F R/WPD Provisionable Default = 0x1 */ - /* 1 = Chip performs diagnostics on power-up */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalDiagnosticProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Thermal Provisioning: 1E.C420 */ -/* Global Thermal Provisioning: 1E.C420 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C420.F:0 R/WPD Reserved 0 [F:0] - AQ_GlobalThermalProvisioning_HHD.u0.bits_0.reserved_0 - - Provisionable Default = 0x0000 - - Internal reserved - do not modify - - */ - unsigned int reserved_0 : 16; /* 1E.C420.F:0 R/WPD Provisionable Default = 0x0000 */ - /* Internal reserved - do not modify - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C421.F:0 R/WPD High Temp Failure Threshold [F:0] - AQ_GlobalThermalProvisioning_HHD.u1.bits_1.highTempFailureThreshold - - Provisionable Default = 0x4600 - - [F:0] of high temperature failure threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 70 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A000 - 1.A001: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int highTempFailureThreshold : 16; /* 1E.C421.F:0 R/WPD Provisionable Default = 0x4600 */ - /* [F:0] of high temperature failure threshold */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C422.F:0 R/WPD Low Temp Failure Threshold [F:0] - AQ_GlobalThermalProvisioning_HHD.u2.bits_2.lowTempFailureThreshold - - Provisionable Default = 0x0000 - - [F:0] of low temperature failure threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 0 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A002 - 1.A003: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int lowTempFailureThreshold : 16; /* 1E.C422.F:0 R/WPD Provisionable Default = 0x0000 */ - /* [F:0] of low temperature failure threshold */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C423.F:0 R/WPD High Temp Warning Threshold [F:0] - AQ_GlobalThermalProvisioning_HHD.u3.bits_3.highTempWarningThreshold - - Provisionable Default = 0x3C00 - - [F:0] of high temperature warning threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD008. Default is 60 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A004 - 1.A005: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int highTempWarningThreshold : 16; /* 1E.C423.F:0 R/WPD Provisionable Default = 0x3C00 */ - /* [F:0] of high temperature warning threshold */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C424.F:0 R/WPD Low Temp Warning Threshold [F:0] - AQ_GlobalThermalProvisioning_HHD.u4.bits_4.lowTempWarningThreshold - - Provisionable Default = 0x0A00 - - [F:0] of low temperature warning threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 10 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A006 - 1.A007: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int lowTempWarningThreshold : 16; /* 1E.C424.F:0 R/WPD Provisionable Default = 0x0A00 */ - /* [F:0] of low temperature warning threshold */ - } bits_4; - uint16_t word_4; - } u4; -} AQ_GlobalThermalProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global LED Provisioning: 1E.C430 */ -/* Global LED Provisioning: 1E.C430 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C430.1:0 R/WPD LED #0 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_0ActivityStretch : 2; /* 1E.C430.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C430.2 R/WPD LED #0 Transmit Activity - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_0TransmitActivity : 1; /* 1E.C430.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C430.3 R/WPD LED #0 Receive Activity - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_0ReceiveActivity : 1; /* 1E.C430.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C430.4 R/WPD LED #0 Connecting - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_0Connecting : 1; /* 1E.C430.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C430.5 R/WPD LED #0 100 Mb/s Link Established - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s. - - */ - unsigned int led_0_100Mb_sLinkEstablished : 1; /* 1E.C430.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s. - */ - /*! \brief 1E.C430.6 R/WPD LED #0 1 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_0_1Gb_sLinkEstablished : 1; /* 1E.C430.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C430.7 R/WPD LED #0 10 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_0_10Gb_sLinkEstablished : 1; /* 1E.C430.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C430.8 R/WPD LED #0 Manual Set - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_0ManualSet : 1; /* 1E.C430.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C430.D:9 R/WPD Reserved Provisioning C430 [4:0] - AQ_GlobalLedProvisioning_HHD.u0.bits_0.reservedProvisioningC430 - - Provisionable Default = 0x00 - - Reserved for future use - */ - unsigned int reservedProvisioningC430 : 5; /* 1E.C430.D:9 R/WPD Provisionable Default = 0x00 */ - /* Reserved for future use */ - unsigned int reserved0 : 2; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C431.1:0 R/WPD LED #1 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_1ActivityStretch : 2; /* 1E.C431.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C431.2 R/WPD LED #1 Transmit Activity - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_1TransmitActivity : 1; /* 1E.C431.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C431.3 R/WPD LED #1 Receive Activity - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_1ReceiveActivity : 1; /* 1E.C431.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C431.4 R/WPD LED #1 Connecting - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_1Connecting : 1; /* 1E.C431.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C431.5 R/WPD LED #1 100 Mb/s Link Established - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s. - - */ - unsigned int led_1_100Mb_sLinkEstablished : 1; /* 1E.C431.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s. - */ - /*! \brief 1E.C431.6 R/WPD LED #1 1 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_1_1Gb_sLinkEstablished : 1; /* 1E.C431.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C431.7 R/WPD LED #1 10 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_1_10Gb_sLinkEstablished : 1; /* 1E.C431.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C431.8 R/WPD LED #1 Manual Set - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_1ManualSet : 1; /* 1E.C431.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C431.D:9 R/WPD Reserved Provisioning C431 [4:0] - AQ_GlobalLedProvisioning_HHD.u1.bits_1.reservedProvisioningC431 - - Provisionable Default = 0x00 - - Reserved for future use - */ - unsigned int reservedProvisioningC431 : 5; /* 1E.C431.D:9 R/WPD Provisionable Default = 0x00 */ - /* Reserved for future use */ - unsigned int reserved0 : 2; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C432.1:0 R/WPD LED #2 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_2ActivityStretch : 2; /* 1E.C432.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - /*! \brief 1E.C432.2 R/WPD LED #2 Transmit Activity - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_2TransmitActivity : 1; /* 1E.C432.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C432.3 R/WPD LED #2 Receive Activity - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_2ReceiveActivity : 1; /* 1E.C432.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C432.4 R/WPD LED #2 Connecting - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_2Connecting : 1; /* 1E.C432.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C432.5 R/WPD LED #2 100 Mb/s Link Established - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s. - */ - unsigned int led_2_100Mb_sLinkEstablished : 1; /* 1E.C432.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s. */ - /*! \brief 1E.C432.6 R/WPD LED #2 1 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_2_1Gb_sLinkEstablished : 1; /* 1E.C432.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C432.7 R/WPD LED #2 10 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_2_10Gb_sLinkEstablished : 1; /* 1E.C432.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C432.8 R/WPD LED #2 Manual Set - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_2ManualSet : 1; /* 1E.C432.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C432.D:9 R/WPD Reserved Provisioning C432 [4:0] - AQ_GlobalLedProvisioning_HHD.u2.bits_2.reservedProvisioningC432 - - Provisionable Default = 0x00 - - Reserved for future use - */ - unsigned int reservedProvisioningC432 : 5; /* 1E.C432.D:9 R/WPD Provisionable Default = 0x00 */ - /* Reserved for future use */ - unsigned int reserved0 : 2; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global LED Provisioning */ - union - { - struct - { - /*! \brief 1E.C437.0 R/WPD LED Operation Mode - AQ_GlobalLedProvisioning_HHD.u7.bits_7.ledOperationMode - - Provisionable Default = 0x0 - - 1 = LED link activity in Mode #2 - 0 = LED link activity in Aquantia classic mode - - - Notes: - When set to 1, the LED blinking rate is based on Mode #2 algorithm. When set to 0, the LED blinking rate is based on the classic Aquantia algorithm. */ - unsigned int ledOperationMode : 1; /* 1E.C437.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED link activity in Mode #2 - 0 = LED link activity in Aquantia classic mode - */ - unsigned int reserved0 : 15; - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_11; - uint16_t word_11; - } u11; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_12; - uint16_t word_12; - } u12; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_13; - uint16_t word_13; - } u13; - /*! \brief Union for bit and word level access of word 14 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_14; - uint16_t word_14; - } u14; -} AQ_GlobalLedProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global General Provisioning: 1E.C440 */ -/* Global General Provisioning: 1E.C440 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved3 : 2; - unsigned int reserved2 : 1; - /*! \brief 1E.C441.3 R/WPD MDIO Preamble Detection Disable - AQ_GlobalGeneralProvisioning_HHD.u1.bits_1.mdioPreambleDetectionDisable - - Provisionable Default = 0x0 - - 1 = Suppress preamble detection on MDIO - 0 = Enable preamble detection on MDIO - - */ - unsigned int mdioPreambleDetectionDisable : 1; /* 1E.C441.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = Suppress preamble detection on MDIO - 0 = Enable preamble detection on MDIO - */ - /*! \brief 1E.C441.4 R/WPD MDIO Drive Configuration - AQ_GlobalGeneralProvisioning_HHD.u1.bits_1.mdioDriveConfiguration - - Provisionable Default = 0x0 - - 0 = MDIO driver is in normal mode - 1 = MDIO driver is in open drain mode - - - Notes: - When the MDIO driver is in open drain mode during a read cycle, "0" data will be actively driven out of the MDIO, "1" data will set the MDIO driver in high impedance state and an external pullup will set the MDIO line to "1". The Turn-Around "0" will also be actively driven out of the MDIO, therefore in open drain mode, the Turn-Around is still "Z0". */ - unsigned int mdioDriveConfiguration : 1; /* 1E.C441.4 R/WPD Provisionable Default = 0x0 */ - /* 0 = MDIO driver is in normal mode - 1 = MDIO driver is in open drain mode - */ - unsigned int reserved1 : 8; - /*! \brief 1E.C441.D R/WPD MDIO Read MSW First Enable - AQ_GlobalGeneralProvisioning_HHD.u1.bits_1.mdioReadMSW_FirstEnable - - Provisionable Default = 0x0 - - 1 = MSW of counter must be read first - 0 = LSW of counter must be read first - - - Notes: - This bit configures whether the MSW or LSW must be read first for counters greater than 16 bits. */ - unsigned int mdioReadMSW_FirstEnable : 1; /* 1E.C441.D R/WPD Provisionable Default = 0x0 */ - /* 1 = MSW of counter must be read first - 0 = LSW of counter must be read first - */ - /*! \brief 1E.C441.E R/WPD MDIO Broadcast Mode Enable - AQ_GlobalGeneralProvisioning_HHD.u1.bits_1.mdioBroadcastModeEnable - - Provisionable Default = 0x0 - - 1 = Enable broadcast on address set in 1E.C446 - 0 = Disable broadcast on n address set in 1E.C446 - - - Notes: - When enabled, writes and load MMD address opcodes are supported. Read opcodes are ignored. */ - unsigned int mdioBroadcastModeEnable : 1; /* 1E.C441.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable broadcast on address set in 1E.C446 - 0 = Disable broadcast on n address set in 1E.C446 - */ - unsigned int reserved0 : 1; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global General Provisioning */ - union - { - struct - { - /*! \brief 1E.C442.0 R/W Daisy Chain Reset - AQ_GlobalGeneralProvisioning_HHD.u2.bits_2.daisyChainReset - - Default = 0x0 - - 1 = Reset the daisy chain - - - Notes: - Toggling this bit from 0 to 1 will reload the IRAM and DRAM and reset the uP. The uP will be in uP run stall during the reload process. After the reload process, uP run stall will be de-asserted and the uP reset will be asserted. Note that before setting this bit, the See Soft Reset bit needs to be de-asserted. */ - unsigned int daisyChainReset : 1; /* 1E.C442.0 R/W Default = 0x0 */ - /* 1 = Reset the daisy chain - */ - unsigned int reserved0 : 15; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global General Provisioning */ - union - { - struct - { - /*! \brief 1E.C447.4:0 R/WPD MDIO Broadcast Address Configuration [4:0] - AQ_GlobalGeneralProvisioning_HHD.u7.bits_7.mdioBroadcastAddressConfiguration - - Provisionable Default = 0x1F - - Broadcast address - - - Notes: - Allows setting the broadcast address. By default this is set to 0x1F */ - unsigned int mdioBroadcastAddressConfiguration : 5; /* 1E.C447.4:0 R/WPD Provisionable Default = 0x1F */ - /* Broadcast address - */ - unsigned int reserved0 : 11; - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of Global General Provisioning */ - union - { - struct - { - /*! \brief 1E.C449.6:0 R/W MDIO Preamble Length [6:0] - AQ_GlobalGeneralProvisioning_HHD.u9.bits_9.mdioPreambleLength - - Default = 0x02 - - MDIO Preamble Length - - */ - unsigned int mdioPreambleLength : 7; /* 1E.C449.6:0 R/W Default = 0x02 */ - /* MDIO Preamble Length - */ - unsigned int reserved0 : 9; - } bits_9; - uint16_t word_9; - } u9; -} AQ_GlobalGeneralProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global NVR Provisioning: 1E.C450 */ -/* Global NVR Provisioning: 1E.C450 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global NVR Provisioning */ - union - { - struct - { - /*! \brief 1E.C450.1:0 R/WPD NVR Address Length [1:0] - AQ_GlobalNvrProvisioning_HHD.u0.bits_0.nvrAddressLength - - Provisionable Default = 0x2 - - NVR address length ranges from 0 bytes up to 3 bytes - - - Notes: - This sets the length of the address field used in read and write operations. Use of this field is enabled via Bit 8 of See Global NVR Provisioning 2: Address 1E.C451 . - */ - unsigned int nvrAddressLength : 2; /* 1E.C450.1:0 R/WPD Provisionable Default = 0x2 */ - /* NVR address length ranges from 0 bytes up to 3 bytes - */ - unsigned int reserved2 : 2; - /*! \brief 1E.C450.6:4 R/WPD NVR Dummy Length [2:0] - AQ_GlobalNvrProvisioning_HHD.u0.bits_0.nvrDummyLength - - Provisionable Default = 0x0 - - NVR dummy length ranges from 0 bytes to 4 bytes - - - Notes: - This sets the length of the dummy field used in some manufacturer's read status and write status operations. - */ - unsigned int nvrDummyLength : 3; /* 1E.C450.6:4 R/WPD Provisionable Default = 0x0 */ - /* NVR dummy length ranges from 0 bytes to 4 bytes - */ - unsigned int reserved1 : 1; - /*! \brief 1E.C450.A:8 R/WPD NVR Data Length [2:0] - AQ_GlobalNvrProvisioning_HHD.u0.bits_0.nvrDataLength - - Provisionable Default = 0x4 - - NVR data length ranges from 0 bytes to 4 bytes - - - Notes: - This sets the length of the data burst used in read and write operations. - */ - unsigned int nvrDataLength : 3; /* 1E.C450.A:8 R/WPD Provisionable Default = 0x4 */ - /* NVR data length ranges from 0 bytes to 4 bytes - */ - unsigned int reserved0 : 5; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global NVR Provisioning */ - union - { - struct - { - /*! \brief 1E.C451.7:0 R/WPD NVR Clock Divide [7:0] - AQ_GlobalNvrProvisioning_HHD.u1.bits_1.nvrClockDivide - - Provisionable Default = 0xA0 - - NVR clock divide. Clock frequency is divided by the NVR clock divide + 1 - - */ - unsigned int nvrClockDivide : 8; /* 1E.C451.7:0 R/WPD Provisionable Default = 0xA0 */ - /* NVR clock divide. Clock frequency is divided by the NVR clock divide + 1 - */ - /*! \brief 1E.C451.8 R/WPD NVR Address Length Override - AQ_GlobalNvrProvisioning_HHD.u1.bits_1.nvrAddressLengthOverride - - Provisionable Default = 0x0 - - 0 = NVR address length is based on the "NVR_SIZE" pin. - 1 = NVR address length is based on the See NVR Address Length [1:0] register - - - Notes: - When this bit = 0 and NVR_SIZE pin = 0, the NVR address length is 2 bytes. When this bit = 0 and the NVR_SIZE pin = 1, the NVR address length is 3 bytes. When this bit = 1 the NVR address length is from the See NVR Address Length [1:0] */ - unsigned int nvrAddressLengthOverride : 1; /* 1E.C451.8 R/WPD Provisionable Default = 0x0 */ - /* 0 = NVR address length is based on the "NVR_SIZE" pin. - 1 = NVR address length is based on the See NVR Address Length [1:0] register - */ - unsigned int reserved0 : 7; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global NVR Provisioning */ - union - { - struct - { - /*! \brief 1E.C452.0 R/W NVR Daisy Chain Disable - AQ_GlobalNvrProvisioning_HHD.u2.bits_2.nvrDaisyChainDisable - - Default = 0x0 - - 1 = Disable the Daisy Chain - - - Notes: - When in daisy chain master mode, the daisy chain and MDIO can both access the SPI. Setting this bit to 1 will disable the daisy chain from accessing the SPI and force it into a reset state. */ - unsigned int nvrDaisyChainDisable : 1; /* 1E.C452.0 R/W Default = 0x0 */ - /* 1 = Disable the Daisy Chain - */ - /*! \brief 1E.C452.1 R/W NVR Daisy Chain Clock Divide Override - AQ_GlobalNvrProvisioning_HHD.u2.bits_2.nvrDaisyChainClockDivideOverride - - Default = 0x0 - - 1 = Override NVR clock divide when in daisy chain master mode - - - Notes: - When in daisy chain master mode, the clock divide configuration is received from the FLASH. This bit will override the clock divide configuration from the FLASH with the See NVR Clock Divide [7:0] . */ - unsigned int nvrDaisyChainClockDivideOverride : 1; /* 1E.C452.1 R/W Default = 0x0 */ - /* 1 = Override NVR clock divide when in daisy chain master mode - */ - unsigned int reserved0 : 14; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global NVR Provisioning */ - union - { - struct - { - unsigned int reserved1 : 4; - /*! \brief 1E.C453.4 R/W NVR Reset - AQ_GlobalNvrProvisioning_HHD.u3.bits_3.nvrReset - - Default = 0x0 - - 1 = Reset SPI - - */ - unsigned int nvrReset : 1; /* 1E.C453.4 R/W Default = 0x0 */ - /* 1 = Reset SPI - */ - unsigned int reserved0 : 11; - } bits_3; - uint16_t word_3; - } u3; -} AQ_GlobalNvrProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reserved Provisioning: 1E.C470 */ -/* Global Reserved Provisioning: 1E.C470 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved2 : 4; - /*! \brief 1E.C470.4 R/WSC Initiate Cable Diagnostics - AQ_GlobalReservedProvisioning_HHD.u0.bits_0.initiateCableDiagnostics - - Default = 0x0 - - 1 = Perform cable diagnostics - - - Notes: - Perform cable diagnostics regardless of link state. If link is up, setting this bit will cause the link to drop while diagnostics are performed. This bit is self-clearing upon completion of the cable diagnostics. - - NOTE!! This is a processor intensive operation. Completion of this operation can also be monitored via 1E.C831.F */ - unsigned int initiateCableDiagnostics : 1; /* 1E.C470.4 R/WSC Default = 0x0 */ - /* 1 = Perform cable diagnostics - */ - unsigned int reserved1 : 3; - unsigned int reserved0 : 5; - /*! \brief 1E.C470.E:D R/WPD Extended MDI Diagnostics Select [1:0] - AQ_GlobalReservedProvisioning_HHD.u0.bits_0.extendedMdiDiagnosticsSelect - - Provisionable Default = 0x0 - - 0x0 = TDR Data - 0x1 = RFI Channel PSD - 0x2 = Noise PSD while the local Tx is Off - 0x3 = Noise PSD while the local Tx is On - - - Notes: - These bits select what sort of cable diagnostics to perform. For regular cable diagnostics, Bit F is set to zero, and the diagnostics are triggered by setting Bit 4. For extended diagnostics, Bit F is set to 1, and the desired extended diagnostics are selected by Bits E:D. The routine is then triggered by setting Bit 4. Each of the extended diagnostic routines present data for all for MDI pairs (A, B, C, D) consecutively, and after the data for each channel is gathered Bits F:D are reset. To get the data for the next pair, Bits F:D must be set back to the desired value (which must be the same as the initial channel). This continues until the data for all channels has been gathered. The address in memory where the data is stored is given in 1E.C802 and 1E.C804. - - For the case of PSD, the structure is as follows: - Int32 info - Int16 data[Len] - Info = Len << 16 | TxEnable << 8 | Pair (0 = A, etc.) - - For TDR: - Int32 info - Int16 tdr_A[Len] - Int16 tdr_B[Len] - Int16 tdr_C[Len] - Int16 tdr_D[Len] - - Info = Len << 16 | Channel - - TDR data is from the current pair to all other pairs. - - At the end of retrieving extended MDI diag data, the part will be reset. Conversely the only way to exit this routine once it starts is to issue a PMA reset. */ - unsigned int extendedMdiDiagnosticsSelect : 2; /* 1E.C470.E:D R/WPD Provisionable Default = 0x0 */ - /* 0x0 = TDR Data - 0x1 = RFI Channel PSD - 0x2 = Noise PSD while the local Tx is Off - 0x3 = Noise PSD while the local Tx is On - */ - /*! \brief 1E.C470.F R/WPD Diagnostics Select - AQ_GlobalReservedProvisioning_HHD.u0.bits_0.diagnosticsSelect - - Provisionable Default = 0x0 - - 1 = Provide Extended MDI Diagnostics Information. - 0 = Provide normal cable diagnostics - - - Notes: - These bits select what sort of cable diagnostics to perform. For regular cable diagnostics, Bit F is set to zero, and the diagnostics are triggered by setting Bit 4. For extended diagnostics, Bit F is set to 1, and the desired extended diagnostics are selected by Bits E:D. The routine is then triggered by setting Bit 4. Each of the extended diagnostic routines present data for all for MDI pairs (A, B, C, D) consecutively, and after the data for each channel is gathered Bits F:D are reset. To get the data for the next pair, Bits F:D must be set back to the desired value (which must be the same as the initial channel). This continues until the data for all channels has been gathered. The address in memory where the data is stored is given in 1E.C802 and 1E.C804. - - For the case of PSD, the structure is as follows: - Int32 info - Int16 data[Len] - Info = Len << 16 | TxEnable << 8 | Pair (0 = A, etc.) - - For TDR: - Int32 info - Int16 tdr_A[Len] - Int16 tdr_B[Len] - Int16 tdr_C[Len] - Int16 tdr_D[Len] - - Info = Len << 16 | Channel - - TDR data is from the current pair to all other pairs. - - At the end of retrieving extended MDI diag data, the part will be reset. Conversely the only way to exit this routine once it starts is to issue a PMA reset. */ - unsigned int diagnosticsSelect : 1; /* 1E.C470.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Provide Extended MDI Diagnostics Information. - 0 = Provide normal cable diagnostics - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C471.5:0 R/WuP Daisy-Chain Hop-Count Override Value [5:0] - AQ_GlobalReservedProvisioning_HHD.u1.bits_1.daisy_chainHop_countOverrideValue - - Default = 0x00 - - The value to use for the PHY's daisy-chain hop-count. Valid values are from 0 -> 47 - - - Notes: - Daisy-Chain Hop-Count Override should be used during MDIO boot-load operation, as the daisy-chain hop-count does not function when the daisy-chain is disabled (1E.C452.0). Setting this bit tells the processor where in the daisy-chain it is, so that the provisioning operation will function correctly. */ - unsigned int daisy_chainHop_countOverrideValue : 6; /* 1E.C471.5:0 R/WuP Default = 0x00 */ - /* The value to use for the PHY's daisy-chain hop-count. Valid values are from 0 -> 47 - */ - /*! \brief 1E.C471.6 R/WuP Enable Daisy-Chain Hop-Count Override - AQ_GlobalReservedProvisioning_HHD.u1.bits_1.enableDaisy_chainHop_countOverride - - Default = 0x0 - - 1 = Hop-count is set by Bits 5:0 - 0 = Hop-count is determined by the daisy-chain - - - Notes: - Daisy-Chain Hop-Count Override should be used during MDIO boot-load operation, as the daisy-chain hop-count does not function when the daisy-chain is disabled (1E.C452.0). Setting this bit tells the processor where in the daisy-chain it is, so that the provisioning operation will function correctly. */ - unsigned int enableDaisy_chainHop_countOverride : 1; /* 1E.C471.6 R/WuP Default = 0x0 */ - /* 1 = Hop-count is set by Bits 5:0 - 0 = Hop-count is determined by the daisy-chain - */ - unsigned int reserved0 : 9; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C472.0 R/WPDuP Enable 5th Channel RFI Cancellation - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.enable_5thChannelRfiCancellation - - Provisionable Default = 0x0 - - 1 = 5th channel and RFI cancellers operation enabled - 0 = 5th channel AFE is powered down, 5th channel digital is clock gated, RFI cancellers are disabled - - - Notes: - Note: The value of this bit at the time of Autonegotiation sets the local PHY behavior until the next time Autonegotiation occurs. */ - unsigned int enable_5thChannelRfiCancellation : 1; /* 1E.C472.0 R/WPDuP Provisionable Default = 0x0 */ - /* 1 = 5th channel and RFI cancellers operation enabled - 0 = 5th channel AFE is powered down, 5th channel digital is clock gated, RFI cancellers are disabled - */ - /*! \brief 1E.C472.1 R/WPDuP Enable XENPAK Register Space - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.enableXenpakRegisterSpace - - Provisionable Default = 0x0 - - 1 = XENPAK register space enabled - 0 = XENPAK register space disabled - - */ - unsigned int enableXenpakRegisterSpace : 1; /* 1E.C472.1 R/WPDuP Provisionable Default = 0x0 */ - /* 1 = XENPAK register space enabled - 0 = XENPAK register space disabled - */ - /*! \brief 1E.C472.5:2 R/WPD External VDD Change Request [3:0] - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.externalVddChangeRequest - - Provisionable Default = 0x0 - - The amount of VDD change requested by firmware, in mV (2's complement value). - - */ - unsigned int externalVddChangeRequest : 4; /* 1E.C472.5:2 R/WPD Provisionable Default = 0x0 */ - /* The amount of VDD change requested by firmware, in mV (2's complement value). - */ - /*! \brief 1E.C472.6 R/WPD Tunable External VDD Power Supply Present - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.tunableExternalVddPowerSupplyPresent - - Provisionable Default = 0x0 - - 1 = Tunable external VDD power supply present - 0 = No tunable external VDD power supply present - - - Notes: - This bit must be set if tuning of external power supply is desired. */ - unsigned int tunableExternalVddPowerSupplyPresent : 1; /* 1E.C472.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Tunable external VDD power supply present - 0 = No tunable external VDD power supply present - */ - unsigned int reserved1 : 7; - /*! \brief 1E.C472.E R/WPD Enable VDD Power Supply Tuning - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.enableVddPowerSupplyTuning - - Provisionable Default = 0x0 - - 1 = Enable external VDD power supply tuning - 0 = Disable external VDD power supply tuning is disabled - - - Notes: - This bit controls whether the PHY attempts to tune the external VDD power supply via the SMBus. This bit is only operational if the external supply is present. (See 1E.C472.6) */ - unsigned int enableVddPowerSupplyTuning : 1; /* 1E.C472.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable external VDD power supply tuning - 0 = Disable external VDD power supply tuning is disabled - */ - unsigned int reserved0 : 1; - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C473.7:0 R/WPD Training SNR [7:0] - AQ_GlobalReservedProvisioning_HHD.u3.bits_3.trainingSNR - - Provisionable Default = 0x00 - - SNR during 10G training on the worst channel. SNR is in steps of 0.1dB - - - Notes: - The SNR margin that is enjoyed by the worst channel, over and above the minimum SNR required to operate at a BER of 10-12. It is reported with 0.1 dB of resolution to an accuracy of 0.5 dB within the range of -12.7 dB to 12.7 dB. The number is in offset binary, with 0.0 dB represented by 0x8000. */ - unsigned int trainingSNR : 8; /* 1E.C473.7:0 R/WPD Provisionable Default = 0x00 */ - /* SNR during 10G training on the worst channel. SNR is in steps of 0.1dB - */ - /*! \brief 1E.C473.A:8 R/WPD Rate Transition Request [2:0] - AQ_GlobalReservedProvisioning_HHD.u3.bits_3.rateTransitionRequest - - Provisionable Default = 0x0 - - 0 = No Transition - 1 = Reserved - 2 = Reserved - 3 = Retrain at 10G - 4 = Retrain at 5G - 5 = Retrain at 2.5G - 6 = Retrain at 1G - 7 = Reserved - - */ - unsigned int rateTransitionRequest : 3; /* 1E.C473.A:8 R/WPD Provisionable Default = 0x0 */ - /* 0 = No Transition - 1 = Reserved - 2 = Reserved - 3 = Retrain at 10G - 4 = Retrain at 5G - 5 = Retrain at 2.5G - 6 = Retrain at 1G - 7 = Reserved - */ - unsigned int reserved0 : 5; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C474.0 R/W NVR Daisy Chain Kickstart - AQ_GlobalReservedProvisioning_HHD.u4.bits_4.nvrDaisyChainKickstart - - Default = 0x0 - - 1 = Kickstart the Daisy Chain - - - Notes: - When in daisy chain master mode, the PHY0 can kickstart the daisy chain. The kickstart will not reload the IRAM/DRAM or reset the uP for PHY0. It will just read the FLASH and transfer the FLASH data to the daisy chain. */ - unsigned int nvrDaisyChainKickstart : 1; /* 1E.C474.0 R/W Default = 0x0 */ - /* 1 = Kickstart the Daisy Chain - */ - /*! \brief 1E.C474.F:1 R/WPD Reserved Provisioning 5 [F:1] - AQ_GlobalReservedProvisioning_HHD.u4.bits_4.reservedProvisioning_5 - - Provisionable Default = 0x0000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_5 : 15; /* 1E.C474.F:1 R/WPD Provisionable Default = 0x0000 */ - /* Reserved for future use - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved1 : 2; - /*! \brief 1E.C475.2 R/WPD Smart Power-Down Enable - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.smartPower_downEnable - - Provisionable Default = 0x0 - - 1 = Enable smart power down mode - 0 = Smart power-down mode disabled - - - Notes: - Smart power down (SPD) is the lowest power mode at which PHY is able to autonegotiate. SPD can be enabled with bit 1E.C475.2 */ - unsigned int smartPower_downEnable : 1; /* 1E.C475.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable smart power down mode - 0 = Smart power-down mode disabled - */ - /*! \brief 1E.C475.3 R/WPD Deadlock Avoidance Enable - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.deadlockAvoidanceEnable - - Provisionable Default = 0x0 - - 1 = SPD with deadlock avoidance: PHY transmits autonegotiation pulses (FLPs) at a slower rate (~ 1 FLP/ 100ms) than specified by autonegotiation standard (~1 FLP / 8.25ms). Receiver is active and able to detect the pulses. - 0 = SPD without deadlock avoidance: PHY transmitter is shut down, no autonegotiation pulses are sent on the line but the receiver is active and able to detect the pulses - - */ - unsigned int deadlockAvoidanceEnable : 1; /* 1E.C475.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = SPD with deadlock avoidance: PHY transmits autonegotiation pulses (FLPs) at a slower rate (~ 1 FLP/ 100ms) than specified by autonegotiation standard (~1 FLP / 8.25ms). Receiver is active and able to detect the pulses. - 0 = SPD without deadlock avoidance: PHY transmitter is shut down, no autonegotiation pulses are sent on the line but the receiver is active and able to detect the pulses - */ - /*! \brief 1E.C475.4 R/WPD CFR Support - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrSupport - - Provisionable Default = 0x0 - - 1 = Local PHY supports Cisco Fast Retrain - 0 = Local PHY does support Cisco Fast Retrain - - */ - unsigned int cfrSupport : 1; /* 1E.C475.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY supports Cisco Fast Retrain - 0 = Local PHY does support Cisco Fast Retrain - */ - /*! \brief 1E.C475.5 R/WPD CFR THP - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrTHP - - Provisionable Default = 0x0 - - 1 = Local PHY requires local PHY to enable THP - 0 = Local PHY does not require local PHY to enable THP - - */ - unsigned int cfrTHP : 1; /* 1E.C475.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires local PHY to enable THP - 0 = Local PHY does not require local PHY to enable THP - */ - /*! \brief 1E.C475.6 R/WPD CFR Extended Maxwait - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrExtendedMaxwait - - Provisionable Default = 0x0 - - 1 = Local PHY requires extended maxwait - 0 = Local PHY does not require extended maxwait - - */ - unsigned int cfrExtendedMaxwait : 1; /* 1E.C475.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires extended maxwait - 0 = Local PHY does not require extended maxwait - */ - /*! \brief 1E.C475.7 R/WPD CFR Disable Timer - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrDisableTimer - - Provisionable Default = 0x0 - - 1 = Local PHY requires cfr_disable timer - 0 = Local PHY does not require cfr_disable timer - - */ - unsigned int cfrDisableTimer : 1; /* 1E.C475.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires cfr_disable timer - 0 = Local PHY does not require cfr_disable timer - */ - /*! \brief 1E.C475.8 R/WPD CFR LP Support - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrLpSupport - - Provisionable Default = 0x0 - - 1 = Link partner supports Cisco Fast Retrain - 0 = Link partner does support Cisco Fast Retrain - - */ - unsigned int cfrLpSupport : 1; /* 1E.C475.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner supports Cisco Fast Retrain - 0 = Link partner does support Cisco Fast Retrain - */ - /*! \brief 1E.C475.9 R/WPD CFR LP THP - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrLpTHP - - Provisionable Default = 0x0 - - 1 = Link partner requires local PHY to enable THP - 0 = Link partner does not require local PHY to enable THP - - */ - unsigned int cfrLpTHP : 1; /* 1E.C475.9 R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires local PHY to enable THP - 0 = Link partner does not require local PHY to enable THP - */ - /*! \brief 1E.C475.A R/WPD CFR LP Extended Maxwait - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrLpExtendedMaxwait - - Provisionable Default = 0x0 - - 1 = Link partner requires extended maxwait - 0 = Link partner does not require extended maxwait - - */ - unsigned int cfrLpExtendedMaxwait : 1; /* 1E.C475.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires extended maxwait - 0 = Link partner does not require extended maxwait - */ - /*! \brief 1E.C475.B R/WPD CFR LP Disable Timer - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrLpDisableTimer - - Provisionable Default = 0x0 - - 1 = Link partner requires cfr_disable timer - 0 = Link partner does not require cfr_disable timer - - */ - unsigned int cfrLpDisableTimer : 1; /* 1E.C475.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires cfr_disable timer - 0 = Link partner does not require cfr_disable timer - */ - /*! \brief 1E.C475.C R/WPD Reserved Provisioning 6 - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.reservedProvisioning_6 - - Provisionable Default = 0x0 - - Internal reserved - do not modify - - */ - unsigned int reservedProvisioning_6 : 1; /* 1E.C475.C R/WPD Provisionable Default = 0x0 */ - /* Internal reserved - do not modify - */ - /*! \brief 1E.C475.D R/WPD Smart Power-Down Status - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.smartPower_downStatus - - Provisionable Default = 0x0 - - 1 = Smart Power-Down Active - 0 = Smart Power-Down Inactive - - */ - unsigned int smartPower_downStatus : 1; /* 1E.C475.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Smart Power-Down Active - 0 = Smart Power-Down Inactive - */ - unsigned int reserved0 : 2; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Dummy union to fill space in the structure Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Dummy union to fill space in the structure Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C478.A:0 R/WPD Reserved Provisioning 9 [A:0] - AQ_GlobalReservedProvisioning_HHD.u8.bits_8.reservedProvisioning_9 - - Provisionable Default = 0x000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_9 : 11; /* 1E.C478.A:0 R/WPD Provisionable Default = 0x000 */ - /* Reserved for future use - */ - /*! \brief 1E.C478.E:B R/WPD DTE Drop Reporting Timer [3:0] - AQ_GlobalReservedProvisioning_HHD.u8.bits_8.dteDropReportingTimer - - Provisionable Default = 0x0 - - Number of seconds between loss of link partner filter and assertion of no-power-needed state, in 5 second increments (e.g. 0x4 = 20 seconds). - - - Notes: - These bits are used to set how long the PHY waits after it no longer detects the link partner filter before declaring that power is not needed. */ - unsigned int dteDropReportingTimer : 4; /* 1E.C478.E:B R/WPD Provisionable Default = 0x0 */ - /* Number of seconds between loss of link partner filter and assertion of no-power-needed state, in 5 second increments (e.g. 0x4 = 20 seconds). - */ - /*! \brief 1E.C478.F R/WPD DTE Enable - AQ_GlobalReservedProvisioning_HHD.u8.bits_8.dteEnable - - Provisionable Default = 0x0 - - 1 = Enable DTE - 0 = Disable DTE - - */ - unsigned int dteEnable : 1; /* 1E.C478.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable DTE - 0 = Disable DTE - */ - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C479.E:0 R/WPD Reserved Provisioning 10 [E:0] - AQ_GlobalReservedProvisioning_HHD.u9.bits_9.reservedProvisioning_10 - - Provisionable Default = 0x0000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_10 : 15; /* 1E.C479.E:0 R/WPD Provisionable Default = 0x0000 */ - /* Reserved for future use - */ - /*! \brief 1E.C479.F R/WPD Power Up Stall - AQ_GlobalReservedProvisioning_HHD.u9.bits_9.powerUpStall - - Provisionable Default = 0x0 - - 1 = Stall FW at Power Up - 0 = Unstall the FW - - - Notes: - This bit needs to be provisioned in Power Up Init for firmware to stall. */ - unsigned int powerUpStall : 1; /* 1E.C479.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Stall FW at Power Up - 0 = Unstall the FW - */ - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Union for bit and word level access of word 10 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C47A.1:0 R/WPD Rate [1:0] - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.rate - - Provisionable Default = 0x0 - - 0x3 = 10G - 0x2 = 1G - 0x1 = 100M - 0x0 = reserved - - - Notes: - These bits select the rate for the loopback and packet generation. SERDES configuration, as well autonegotiation is controlled accordingly when a loopback is selected. For instance, if 100M system loopback on the network interface is selected, SGMII on the system interface is enabled to connect at 100M, and if passthrough is enabled 100BASE-TX will be the only advertised rate and will force a re-autonegotiation if not already connected at 100M. - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. */ - unsigned int rate : 2; /* 1E.C47A.1:0 R/WPD Provisionable Default = 0x0 */ - /* 0x3 = 10G - 0x2 = 1G - 0x1 = 100M - 0x0 = reserved - */ - /*! \brief 1E.C47A.2 R/WPD Reserved Provisioning 11a - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.reservedProvisioning_11a - - Provisionable Default = 0x0 - - Reserved for future use - - */ - unsigned int reservedProvisioning_11a : 1; /* 1E.C47A.2 R/WPD Provisionable Default = 0x0 */ - /* Reserved for future use - */ - /*! \brief 1E.C47A.3 R/WPD System I/F Packet Generation - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.systemI_fPacketGeneration - - Provisionable Default = 0x0 - - 1 = CRPAT packet generation out 10G system interface - 0 = No CRPAT packet generation out 10G system interface - - - Notes: - Selecting this mode of operation causes the CRPAT packet generator in the PHY to output CRPAT packets on the selected 10G system interface (4.C441.F:E) - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. */ - unsigned int systemI_fPacketGeneration : 1; /* 1E.C47A.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = CRPAT packet generation out 10G system interface - 0 = No CRPAT packet generation out 10G system interface - */ - /*! \brief 1E.C47A.4 R/WPD Look-Aside Port Packet Generation - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.look_asidePortPacketGeneration - - Provisionable Default = 0x0 - - 1 = CRPAT packet generation out 10G look-aside interface (KR0) - 0 = No CRPAT packet generation out 10G look-aside interface (KR0) - - - Notes: - Selecting this mode of operation causes the CRPAT packet generator in the PHY to output on KR0. - - NOTE!! This only functions if KR1 (SERDES2) is selected as the system interface in (4.C441.F:E). - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. */ - unsigned int look_asidePortPacketGeneration : 1; /* 1E.C47A.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = CRPAT packet generation out 10G look-aside interface (KR0) - 0 = No CRPAT packet generation out 10G look-aside interface (KR0) - */ - /*! \brief 1E.C47A.5 R/WPD MDI Packet Generation - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.mdiPacketGeneration - - Provisionable Default = 0x0 - - 1 = CRPAT packet generation out MDI interface - 0 = No CRPAT packet generation out MDI interface - - - Notes: - Selecting this mode of operation causes the CRPAT packet generator in the PHY to output on the MDI interface at the selected rate. - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. */ - unsigned int mdiPacketGeneration : 1; /* 1E.C47A.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = CRPAT packet generation out MDI interface - 0 = No CRPAT packet generation out MDI interface - */ - /*! \brief 1E.C47A.A:6 R/WPD Reserved Provisioning 11 [4:0] - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.reservedProvisioning_11 - - Provisionable Default = 0x00 - - Reserved for future use - - */ - unsigned int reservedProvisioning_11 : 5; /* 1E.C47A.A:6 R/WPD Provisionable Default = 0x00 */ - /* Reserved for future use - */ - /*! \brief 1E.C47A.F:B R/WPD Loopback Control [4:0] - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.loopbackControl - - Provisionable Default = 0x00 - - 0x00 = No loopback - 0x01 = System Interface - System Loopback - 0x02 = System Interface - System Loopback with Passthrough - 0x03 = System Interface - Network Loopback - 0x04 = System Interface - Network Loopback with Passthrough - 0x05 = System Interface - Network Loopback with Passthrough and Merge - 0x06 = System Interface - Peer-to-peer loopback - 0x07 - 0x08 = Reserved - 0x09 = Network Interface - System Loopback - 0x0A = Network Interface - System Loopback with Passthrough - 0x0B = Network Interface - Network Loopback - 0x0C = Network Interface - Network Loopback with Passthrough - 0x0D = Network Interface - Peer-to-peer loopback - 0x0E - 0x0F = Reserved - 0x10 = Cross-connect System Loopback - 0x11 = Cross-connect Network Loopback - 0x12 - 0x13 = Reserved - 0x14 = Network Interface - System Loopback via Loopback Plug - 0x15 - 0x1F = Reserved - - - Notes: - These bits, in conjunction with the chip configuration and the rate (Bits 1:0), select the loopback to configure for the chip. Setting one of these loopbacks provisions the chip for the specified loopback. Upon clearing the loopback, the chip returns to it's configuration prior to entering loopback (irregardless of whether other loopbacks were selected after the initial loopback). - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F. - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. - */ - unsigned int loopbackControl : 5; /* 1E.C47A.F:B R/WPD Provisionable Default = 0x00 */ - /* 0x00 = No loopback - 0x01 = System Interface - System Loopback - 0x02 = System Interface - System Loopback with Passthrough - 0x03 = System Interface - Network Loopback - 0x04 = System Interface - Network Loopback with Passthrough - 0x05 = System Interface - Network Loopback with Passthrough and Merge - 0x06 = System Interface - Peer-to-peer loopback - 0x07 - 0x08 = Reserved - 0x09 = Network Interface - System Loopback - 0x0A = Network Interface - System Loopback with Passthrough - 0x0B = Network Interface - Network Loopback - 0x0C = Network Interface - Network Loopback with Passthrough - 0x0D = Network Interface - Peer-to-peer loopback - 0x0E - 0x0F = Reserved - 0x10 = Cross-connect System Loopback - 0x11 = Cross-connect Network Loopback - 0x12 - 0x13 = Reserved - 0x14 = Network Interface - System Loopback via Loopback Plug - 0x15 - 0x1F = Reserved - */ - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Union for bit and word level access of word 11 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C47B.0 R/WPD Enable PTP - AQ_GlobalReservedProvisioning_HHD.u11.bits_11.enablePtp - - Provisionable Default = 0x0 - - 1 = PTP functionality is enabled - 0 = PTP functionality is disabled - - - Notes: - If this bit is 1, the PTP/SEC block will be included in the data path, regardless of operating mode. */ - unsigned int enablePtp : 1; /* 1E.C47B.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = PTP functionality is enabled - 0 = PTP functionality is disabled - */ - /*! \brief 1E.C47B.1 R/WPD Enable MACSec - AQ_GlobalReservedProvisioning_HHD.u11.bits_11.enableMacsec - - Provisionable Default = 0x0 - - 1 = MACSec functionality is enabled - 0 = MACSec functionality is disabled - - - Notes: - If this bit is 1, the PTP/SEC block will be included in the data path, regardless of operating mode. */ - unsigned int enableMacsec : 1; /* 1E.C47B.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = MACSec functionality is enabled - 0 = MACSec functionality is disabled - */ - /*! \brief 1E.C47B.F:2 R/WPD Reserved Provisioning 12 [D:0] - AQ_GlobalReservedProvisioning_HHD.u11.bits_11.reservedProvisioning_12 - - Provisionable Default = 0x0000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_12 : 14; /* 1E.C47B.F:2 R/WPD Provisionable Default = 0x0000 */ - /* Reserved for future use - */ - } bits_11; - uint16_t word_11; - } u11; -} AQ_GlobalReservedProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief PIF Mailbox Control: 1E.C47C */ -/* PIF Mailbox Control: 1E.C47C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of PIF Mailbox Control */ - union - { - struct - { - /*! \brief 1E.C47C.F:0 R/WPDuP PIF Mailbox Address [F:0] - AQ_PifMailboxControl_HHD.u0.bits_0.pifMailboxAddress - - Provisionable Default = 0x0000 - - The least 16 bits of the PIF address to read or write. - - */ - unsigned int pifMailboxAddress : 16; /* 1E.C47C.F:0 R/WPDuP Provisionable Default = 0x0000 */ - /* The least 16 bits of the PIF address to read or write. - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of PIF Mailbox Control */ - union - { - struct - { - /*! \brief 1E.C47D.F:0 R/WPDuP PIF Mailbox Data [F:0] - AQ_PifMailboxControl_HHD.u1.bits_1.pifMailboxData - - Provisionable Default = 0x0000 - - The data to be written, or that had been read. - - */ - unsigned int pifMailboxData : 16; /* 1E.C47D.F:0 R/WPDuP Provisionable Default = 0x0000 */ - /* The data to be written, or that had been read. - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of PIF Mailbox Control */ - union - { - struct - { - /*! \brief 1E.C47E.7:0 R/WPDuP PIF Mailbox MMD [7:0] - AQ_PifMailboxControl_HHD.u2.bits_2.pifMailboxMMD - - Provisionable Default = 0x00 - - MMD (upper 8 bits) of the PID address to read or write. - - */ - unsigned int pifMailboxMMD : 8; /* 1E.C47E.7:0 R/WPDuP Provisionable Default = 0x00 */ - /* MMD (upper 8 bits) of the PID address to read or write. - */ - /*! \brief 1E.C47E.B:8 R/WPDuP PIF Mailbox Command Type [3:0] - AQ_PifMailboxControl_HHD.u2.bits_2.pifMailboxCommandType - - Provisionable Default = 0x0 - - 0 = No Action - 1 = Read - 2 = Write - - - Notes: - System SW writes non-zero value to start a PIF command. */ - unsigned int pifMailboxCommandType : 4; /* 1E.C47E.B:8 R/WPDuP Provisionable Default = 0x0 */ - /* 0 = No Action - 1 = Read - 2 = Write - */ - /*! \brief 1E.C47E.F:C R/WPD Reserved PIF Mailbox Control 3 [3:0] - AQ_PifMailboxControl_HHD.u2.bits_2.reservedPifMailboxControl_3 - - Provisionable Default = 0x0 - - Reserved for future use - - */ - unsigned int reservedPifMailboxControl_3 : 4; /* 1E.C47E.F:C R/WPD Provisionable Default = 0x0 */ - /* Reserved for future use - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of PIF Mailbox Control */ - union - { - struct - { - /*! \brief 1E.C47F.3:0 R/WPDuP PIF Mailbox Command Status [3:0] - AQ_PifMailboxControl_HHD.u3.bits_3.pifMailboxCommandStatus - - Provisionable Default = 0x0 - - 0 = Idle - 1 = Command completed - 2 = Command did not complete - - - Notes: - System SW should write 0 before writing Command Type to clear completion status */ - unsigned int pifMailboxCommandStatus : 4; /* 1E.C47F.3:0 R/WPDuP Provisionable Default = 0x0 */ - /* 0 = Idle - 1 = Command completed - 2 = Command did not complete - */ - /*! \brief 1E.C47F.F:4 R/WPD Reserved PIF Mailbox Control 4 [B:0] - AQ_PifMailboxControl_HHD.u3.bits_3.reservedPifMailboxControl_4 - - Provisionable Default = 0x000 - - Reserved for future use - - */ - unsigned int reservedPifMailboxControl_4 : 12; /* 1E.C47F.F:4 R/WPD Provisionable Default = 0x000 */ - /* Reserved for future use - */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_PifMailboxControl_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global SMBus 0 Provisioning: 1E.C485 */ -/* Global SMBus 0 Provisioning: 1E.C485 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global SMBus 0 Provisioning */ - union - { - struct - { - unsigned int reserved1 : 1; - /*! \brief 1E.C485.7:1 R/W SMB 0 Slave Address [7:1] - AQ_GlobalSmbus_0Provisioning_HHD.u0.bits_0.smb_0SlaveAddress - - Default = 0x00 - - SMB slave address configuration - - */ - unsigned int smb_0SlaveAddress : 7; /* 1E.C485.7:1 R/W Default = 0x00 */ - /* SMB slave address configuration - */ - unsigned int reserved0 : 8; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalSmbus_0Provisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global SMBus 1 Provisioning: 1E.C495 */ -/* Global SMBus 1 Provisioning: 1E.C495 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global SMBus 1 Provisioning */ - union - { - struct - { - unsigned int reserved1 : 1; - /*! \brief 1E.C495.7:1 R/W SMB 1 Slave Address [7:1] - AQ_GlobalSmbus_1Provisioning_HHD.u0.bits_0.smb_1SlaveAddress - - Default = 0x00 - - SMB slave address configuration - - */ - unsigned int smb_1SlaveAddress : 7; /* 1E.C495.7:1 R/W Default = 0x00 */ - /* SMB slave address configuration - */ - unsigned int reserved0 : 8; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalSmbus_1Provisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global EEE Provisioning: 1E.C4A0 */ -/* Global EEE Provisioning: 1E.C4A0 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global EEE Provisioning */ - union - { - struct - { - /*! \brief 1E.C4A0.0 R/WPD EEE Mode - AQ_GlobalEeeProvisioning_HHD.u0.bits_0.eeeMode - - Provisionable Default = 0x0 - - 1 = EEE mode of operation - - - Notes: - EEE mode of operation (0=disable, 1=enable, default:0) */ - unsigned int eeeMode : 1; /* 1E.C4A0.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = EEE mode of operation - */ - unsigned int reserved0 : 15; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalEeeProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Cable Diagnostic Status: 1E.C800 */ -/* Global Cable Diagnostic Status: 1E.C800 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C800.2:0 RO Pair D Status [2:0] - AQ_GlobalCableDiagnosticStatus_HHD.u0.bits_0.pairDStatus - - - - [6:4] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair C - 010= Connected to Pair B - 001= Connected to Pair A - 000= OK - - Notes: - This register summarizes the worst impairment on Pair D. */ - unsigned int pairDStatus : 3; /* 1E.C800.2:0 RO */ - /* [6:4] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair C - 010= Connected to Pair B - 001= Connected to Pair A - 000= OK */ - unsigned int reserved3 : 1; - /*! \brief 1E.C800.6:4 RO Pair C Status [2:0] - AQ_GlobalCableDiagnosticStatus_HHD.u0.bits_0.pairCStatus - - - - [9:7] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair B - 010= Connected to Pair A - 001= Connected to Pair D - 000= OK - - Notes: - This register summarizes the worst impairment on Pair C. */ - unsigned int pairCStatus : 3; /* 1E.C800.6:4 RO */ - /* [9:7] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair B - 010= Connected to Pair A - 001= Connected to Pair D - 000= OK */ - unsigned int reserved2 : 1; - /*! \brief 1E.C800.A:8 RO Pair B Status [2:0] - AQ_GlobalCableDiagnosticStatus_HHD.u0.bits_0.pairBStatus - - - - [C:A] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair A - 010= Connected to Pair D - 001= Connected to Pair C - 000= OK - - Notes: - This register summarizes the worst impairment on Pair B. */ - unsigned int pairBStatus : 3; /* 1E.C800.A:8 RO */ - /* [C:A] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair A - 010= Connected to Pair D - 001= Connected to Pair C - 000= OK */ - unsigned int reserved1 : 1; - /*! \brief 1E.C800.E:C RO Pair A Status [2:0] - AQ_GlobalCableDiagnosticStatus_HHD.u0.bits_0.pairAStatus - - - - [F:D] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair D - 010= Connected to Pair C - 001= Connected to Pair B - 000= OK - - Notes: - This register summarizes the worst impairment on Pair A. */ - unsigned int pairAStatus : 3; /* 1E.C800.E:C RO */ - /* [F:D] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair D - 010= Connected to Pair C - 001= Connected to Pair B - 000= OK */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C801.7:0 RO Pair A Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u1.bits_1.pairAReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair A - - Notes: - The distance to this reflection is given in See Global Reserved Status 1: Address 1E.C870 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairAReflection_2 : 8; /* 1E.C801.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair A */ - /*! \brief 1E.C801.F:8 RO Pair A Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u1.bits_1.pairAReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair A - - Notes: - The distance to this reflection is given in See Global Reserved Status 1: Address 1E.C870 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairAReflection_1 : 8; /* 1E.C801.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair A */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C802.F:0 RO Impulse Response MSW [F:0] - AQ_GlobalCableDiagnosticStatus_HHD.u2.bits_2.impulseResponseMSW - - - - The MSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type in 1E.C470.E:D - - Notes: - See 1E.C470 for more information */ - unsigned int impulseResponseMSW : 16; /* 1E.C802.F:0 RO */ - /* The MSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type in 1E.C470.E:D */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C803.7:0 RO Pair B Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u3.bits_3.pairBReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair B - - Notes: - The distance to this reflection is given in See Global Reserved Status 2: Address 1E.C871 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairBReflection_2 : 8; /* 1E.C803.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair B */ - /*! \brief 1E.C803.F:8 RO Pair B Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u3.bits_3.pairBReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair B - - Notes: - The distance to this reflection is given in See Global Reserved Status 2: Address 1E.C871 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairBReflection_1 : 8; /* 1E.C803.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair B */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C804.F:0 RO Impulse Response LSW [F:0] - AQ_GlobalCableDiagnosticStatus_HHD.u4.bits_4.impulseResponseLSW - - - - The LSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type specified in 1E.C470.E:D - - Notes: - See 1E.C470 for more information */ - unsigned int impulseResponseLSW : 16; /* 1E.C804.F:0 RO */ - /* The LSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type specified in 1E.C470.E:D */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C805.7:0 RO Pair C Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u5.bits_5.pairCReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair C - - Notes: - The distance to this reflection is given in See Global Reserved Status 3: Address 1E.C872 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairCReflection_2 : 8; /* 1E.C805.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair C */ - /*! \brief 1E.C805.F:8 RO Pair C Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u5.bits_5.pairCReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair C - - Notes: - The distance to this reflection is given in See Global Reserved Status 3: Address 1E.C872 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairCReflection_1 : 8; /* 1E.C805.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair C */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C806.F:0 RO Reserved 1 [F:0] - AQ_GlobalCableDiagnosticStatus_HHD.u6.bits_6.reserved_1 - - - - Reserved for future use - */ - unsigned int reserved_1 : 16; /* 1E.C806.F:0 RO */ - /* Reserved for future use */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C807.7:0 RO Pair D Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u7.bits_7.pairDReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair D - - Notes: - The distance to this reflection is given in See Global Reserved Status 4: Address 1E.C873 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairDReflection_2 : 8; /* 1E.C807.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair D */ - /*! \brief 1E.C807.F:8 RO Pair D Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u7.bits_7.pairDReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair D - - Notes: - The distance to this reflection is given in See Global Reserved Status 4: Address 1E.C873 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairDReflection_1 : 8; /* 1E.C807.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair D */ - } bits_7; - uint16_t word_7; - } u7; -} AQ_GlobalCableDiagnosticStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Thermal Status: 1E.C820 */ -/* Global Thermal Status: 1E.C820 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Thermal Status */ - union - { - struct - { - /*! \brief 1E.C820.F:0 RO Temperature [F:0] - AQ_GlobalThermalStatus_HHD.u0.bits_0.temperature - - - - [F:0] of temperature - - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 70 degreesC. This is a mirror of the XENPAK register 1.A060 - 1.A061. The mirror is performed in H/W. */ - unsigned int temperature : 16; /* 1E.C820.F:0 RO */ - /* [F:0] of temperature - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Thermal Status */ - union - { - struct - { - /*! \brief 1E.C821.0 RO Temperature Ready - AQ_GlobalThermalStatus_HHD.u1.bits_1.temperatureReady - - - - 1 = Temperature measurement is valid - - - Notes: - This is a mirror of the XENPAK register 1.A06E. */ - unsigned int temperatureReady : 1; /* 1E.C821.0 RO */ - /* 1 = Temperature measurement is valid - */ - unsigned int reserved0 : 15; - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalThermalStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global General Status: 1E.C830 */ -/* Global General Status: 1E.C830 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global General Status */ - union - { - struct - { - unsigned int reserved1 : 11; - /*! \brief 1E.C830.B RO Low Temperature Warning State - AQ_GlobalGeneralStatus_HHD.u0.bits_0.lowTemperatureWarningState - - - - 1 = Low temperature warning threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A074.6 register. - - */ - unsigned int lowTemperatureWarningState : 1; /* 1E.C830.B RO */ - /* 1 = Low temperature warning threshold has been exceeded */ - /*! \brief 1E.C830.C RO High Temperature Warning State - AQ_GlobalGeneralStatus_HHD.u0.bits_0.highTemperatureWarningState - - - - 1 = High temperature warning threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A074.7 register. - - */ - unsigned int highTemperatureWarningState : 1; /* 1E.C830.C RO */ - /* 1 = High temperature warning threshold has been exceeded */ - /*! \brief 1E.C830.D RO Low Temperature Failure State - AQ_GlobalGeneralStatus_HHD.u0.bits_0.lowTemperatureFailureState - - - - 1 = Low temperature failure threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A070.6 register. - - */ - unsigned int lowTemperatureFailureState : 1; /* 1E.C830.D RO */ - /* 1 = Low temperature failure threshold has been exceeded */ - /*! \brief 1E.C830.E RO High Temperature Failure State - AQ_GlobalGeneralStatus_HHD.u0.bits_0.highTemperatureFailureState - - - - 1 = High temperature failure threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A070.7 register. - - */ - unsigned int highTemperatureFailureState : 1; /* 1E.C830.E RO */ - /* 1 = High temperature failure threshold has been exceeded */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global General Status */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C831.F RO Processor Intensive MDIO Operation In- Progress - AQ_GlobalGeneralStatus_HHD.u1.bits_1.processorIntensiveMdioOperationIn_Progress - - - - 1 = PHY microprocessor is busy with a processor-intensive MDIO operation - 0 = Processor-intensive MDIO operation completed - - - Notes: - This bit should may be used with certain processor-intensive MDIO commands (such as Loopbacks, Test Modes, Low power modes, Tx-Disable, Restart autonegotiation, Cable Diagnostics, etc.) that take longer than an MDIO cycle to complete. Upon receiving an MDIO command that involves the PHY's microprocessor, this bit is set, and when the command is completed, this bit is cleared. - - NOTE!!! This bit should be checked only after 1 ms of issuing a processor-intensive MDIO operation. - - The list of operations that set this bit are as follows: - - 1.0.0, PMA Loopback - 1.0.B, Low power mode - 1.9.4:0, Tx Disable - 1.84, 10G Test modes - 1.8000.5, XENPAK Control - 1.9000, XENPAK Rx Fault Enable - 1.9002, XENPAK Alarm Enable - 1.E400.F, External loopback - 3.0.B, Low power mode - 3.0.E, System PCS loopback - 3.C471.5, PRBS Test - 3.C471.6, PRBS Test - 3.E471.5, PRBS Test - 3.E471.6, PRBS Test - 4.0.B, Low power mode - 4.0.E, PHY-XS network loopback - 4.C440, Output clock control, Load SERDES parameters - 4.F802.E, System loopback - 4.C444.F:B, Loopback Control - 4.C444.4:2, Packet generation - 4.C445.C, SERDES calibration - 7.0.9, Restart autonegotiation - 1D.C280, 1G/100M Network loopback - 1D.C500, 1G System loopback - 1D.C501, 1G / 100M Test modes - 1E.C470.4, Cable diagnostics - 1E.C47A.F:B, Loopback Control - 1E.C47A.4:2, Packet generation */ - unsigned int processorIntensiveMdioOperationIn_Progress : 1; /* 1E.C831.F RO */ - /* 1 = PHY microprocessor is busy with a processor-intensive MDIO operation - 0 = Processor-intensive MDIO operation completed - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalGeneralStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Pin Status: 1E.C840 */ -/* Global Pin Status: 1E.C840 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Pin Status */ - union - { - struct - { - /*! \brief 1E.C840.5:0 RO LED Pullup State [5:0] - AQ_GlobalPinStatus_HHD.u0.bits_0.ledPullupState - - - - 1 = LED output pin is pulled high - 0 = LED output pin is pulled low - - */ - unsigned int ledPullupState : 6; /* 1E.C840.5:0 RO */ - /* 1 = LED output pin is pulled high - 0 = LED output pin is pulled low - */ - unsigned int reserved4 : 1; - /*! \brief 1E.C840.7 RO Tx Enable - AQ_GlobalPinStatus_HHD.u0.bits_0.txEnable - - - - Current Value of Tx Enable pin - - - Notes: - 0 = Disable Transmitter */ - unsigned int txEnable : 1; /* 1E.C840.7 RO */ - /* Current Value of Tx Enable pin - */ - unsigned int reserved3 : 1; - /*! \brief 1E.C840.9 RO Package Connectivity - AQ_GlobalPinStatus_HHD.u0.bits_0.packageConnectivity - - - - Value of the package connection pin - - */ - unsigned int packageConnectivity : 1; /* 1E.C840.9 RO */ - /* Value of the package connection pin - */ - unsigned int reserved2 : 3; - /*! \brief 1E.C840.D RO DC_MASTER_N - AQ_GlobalPinStatus_HHD.u0.bits_0.dcMasterN - - - - Value of DC_MASTER_N pin: - - 0x1 = PHY Slave Daisy Chain Boot - 0x0 = PHY Master Daisy Chain Boot from FLASH - */ - unsigned int dcMasterN : 1; /* 1E.C840.D RO */ - /* Value of DC_MASTER_N pin: - - 0x1 = PHY Slave Daisy Chain Boot - 0x0 = PHY Master Daisy Chain Boot from FLASH */ - unsigned int reserved1 : 1; - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalPinStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Daisy Chain Status: 1E.C842 */ -/* Global Daisy Chain Status: 1E.C842 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Daisy Chain Status */ - union - { - struct - { - /*! \brief 1E.C842.F:0 RO Rx Daisy Chain Calculated CRC [F:0] - AQ_GlobalDaisyChainStatus_HHD.u0.bits_0.rxDaisyChainCalculatedCrc - - - - Rx Daisy Chain Calculated CRC - - - Notes: - This is the calculated daisy chain CRC. */ - unsigned int rxDaisyChainCalculatedCrc : 16; /* 1E.C842.F:0 RO */ - /* Rx Daisy Chain Calculated CRC - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalDaisyChainStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Fault Message: 1E.C850 */ -/* Global Fault Message: 1E.C850 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Fault Message */ - union - { - struct - { - /*! \brief 1E.C850.F:0 RO Message [F:0] - AQ_GlobalFaultMessage_HHD.u0.bits_0.message - - - - Error code describing fault - - Notes: - Code 0x8001: Firmware not compatible with chip architecture. This fault occurs when firmware compiled for a different microprocessor core is loaded. - Code 0x8002: VCO calibration failed. This occurs when the main PLLs on chip fail to lock: this is not possible to trigger. - Code 0x8003: XAUI calibration failed. This occurs when the XAUI PLLs fail to lock: this is not possible to trigger. - Code 0x8005: Unexpected device ID. This occurs if the device ID programmed into the internal E-Fuse registers in not valid: this is not possible to trigger. - Code 0x8006: Computed checksum does not match expected checksum. This occurs when the FLASH checksum check performed at boot time fails. This only occurs when the system boots from FLASH. - Code 0x8007: Detected a bit error in static memory. To trigger, corrupt one of the static regions. - Code 0xC001: Illegal Instruction exception. This occurs when the processor attempts to execute an illegal instruction. To trigger this, write an illegal instruction to program memory. It's possible that the bit error check will trigger before the illegal instruction is executed. - Code 0xC002 Instruction Fetch Error. Internal physical address or a data error during instruction fetch: this is not possible to trigger. - Code 0xC003 Load Store Error. Internal physical address or data error during load store operation: this is not possible to trigger.. - Code 0xC004 Privileged Instruction. Attempt to execute a privileged operation without sufficient privilege: this is not possible to trigger. - Code 0xC005 Unaligned Load or Store. Attempt to load or store data at an address which cannot be handled due to alignment: this is not possible to trigger. - Code 0xC006 Instruction fetch from prohibited space: this is not possible to trigger. - Code 0xC007 Data load from prohibited space: this is not possible to trigger. - Code 0xC008 Data store into prohibited space: this is not possible to trigger. */ - unsigned int message : 16; /* 1E.C850.F:0 RO */ - /* Error code describing fault */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalFaultMessage_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Cable Diagnostic Impedance: 1E.C880 */ -/* Global Cable Diagnostic Impedance: 1E.C880 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C880.2:0 RO Pair A Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.pairAReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_4 : 3; /* 1E.C880.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.3 RO Reserved 4 - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.reserved_4 - - - - Reserved - - */ - unsigned int reserved_4 : 1; /* 1E.C880.3 RO */ - /* Reserved - */ - /*! \brief 1E.C880.6:4 RO Pair A Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.pairAReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_3 : 3; /* 1E.C880.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.7 RO Reserved 3 - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.reserved_3 - - - - Reserved - - */ - unsigned int reserved_3 : 1; /* 1E.C880.7 RO */ - /* Reserved - */ - /*! \brief 1E.C880.A:8 RO Pair A Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.pairAReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_2 : 3; /* 1E.C880.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.B RO Reserved 2 - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.reserved_2 - - - - Reserved - - */ - unsigned int reserved_2 : 1; /* 1E.C880.B RO */ - /* Reserved - */ - /*! \brief 1E.C880.E:C RO Pair A Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.pairAReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_1 : 3; /* 1E.C880.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.F RO Reserved 1 - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.reserved_1 - - - - Reserved - - */ - unsigned int reserved_1 : 1; /* 1E.C880.F RO */ - /* Reserved - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C881.2:0 RO Pair B Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.pairBReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_4 : 3; /* 1E.C881.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.3 RO Reserved 8 - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.reserved_8 - - - - Reserved - - */ - unsigned int reserved_8 : 1; /* 1E.C881.3 RO */ - /* Reserved - */ - /*! \brief 1E.C881.6:4 RO Pair B Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.pairBReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_3 : 3; /* 1E.C881.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.7 RO Reserved 7 - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.reserved_7 - - - - Reserved - - */ - unsigned int reserved_7 : 1; /* 1E.C881.7 RO */ - /* Reserved - */ - /*! \brief 1E.C881.A:8 RO Pair B Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.pairBReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_2 : 3; /* 1E.C881.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.B RO Reserved 6 - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.reserved_6 - - - - Reserved - - */ - unsigned int reserved_6 : 1; /* 1E.C881.B RO */ - /* Reserved - */ - /*! \brief 1E.C881.E:C RO Pair B Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.pairBReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_1 : 3; /* 1E.C881.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.F RO Reserved 5 - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.reserved_5 - - - - Reserved - - */ - unsigned int reserved_5 : 1; /* 1E.C881.F RO */ - /* Reserved - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C882.2:0 RO Pair C Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.pairCReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_4 : 3; /* 1E.C882.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.3 RO Reserved 12 - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.reserved_12 - - - - Reserved - - */ - unsigned int reserved_12 : 1; /* 1E.C882.3 RO */ - /* Reserved - */ - /*! \brief 1E.C882.6:4 RO Pair C Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.pairCReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_3 : 3; /* 1E.C882.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.7 RO Reserved 11 - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.reserved_11 - - - - Reserved - - */ - unsigned int reserved_11 : 1; /* 1E.C882.7 RO */ - /* Reserved - */ - /*! \brief 1E.C882.A:8 RO Pair C Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.pairCReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_2 : 3; /* 1E.C882.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.B RO Reserved 10 - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.reserved_10 - - - - Reserved - - */ - unsigned int reserved_10 : 1; /* 1E.C882.B RO */ - /* Reserved - */ - /*! \brief 1E.C882.E:C RO Pair C Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.pairCReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_1 : 3; /* 1E.C882.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.F RO Reserved 9 - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.reserved_9 - - - - Reserved - - */ - unsigned int reserved_9 : 1; /* 1E.C882.F RO */ - /* Reserved - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C883.2:0 RO Pair D Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.pairDReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_4 : 3; /* 1E.C883.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.3 RO Reserved 16 - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.reserved_16 - - - - Reserved - - */ - unsigned int reserved_16 : 1; /* 1E.C883.3 RO */ - /* Reserved - */ - /*! \brief 1E.C883.6:4 RO Pair D Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.pairDReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_3 : 3; /* 1E.C883.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.7 RO Reserved 15 - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.reserved_15 - - - - Reserved - - */ - unsigned int reserved_15 : 1; /* 1E.C883.7 RO */ - /* Reserved - */ - /*! \brief 1E.C883.A:8 RO Pair D Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.pairDReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_2 : 3; /* 1E.C883.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.B RO Reserved 14 - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.reserved_14 - - - - Reserved - - */ - unsigned int reserved_14 : 1; /* 1E.C883.B RO */ - /* Reserved - */ - /*! \brief 1E.C883.E:C RO Pair D Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.pairDReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_1 : 3; /* 1E.C883.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.F RO Reserved 13 - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.reserved_13 - - - - Reserved - - */ - unsigned int reserved_13 : 1; /* 1E.C883.F RO */ - /* Reserved - */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_GlobalCableDiagnosticImpedance_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Status: 1E.C884 */ -/* Global Status: 1E.C884 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Status */ - union - { - struct - { - /*! \brief 1E.C884.7:0 RO Cable Length [7:0] - AQ_GlobalStatus_HHD.u0.bits_0.cableLength - - - - The estimated length of the cable in meters - - - Notes: - The length of the cable shown here is estimated from the cable diagnostic engine and should be accurate to +/-1m. */ - unsigned int cableLength : 8; /* 1E.C884.7:0 RO */ - /* The estimated length of the cable in meters - */ - /*! \brief 1E.C884.F:8 RO Reserved Status 0 [7:0] - AQ_GlobalStatus_HHD.u0.bits_0.reservedStatus_0 - - - - Reserved - - */ - unsigned int reservedStatus_0 : 8; /* 1E.C884.F:8 RO */ - /* Reserved - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reserved Status: 1E.C885 */ -/* Global Reserved Status: 1E.C885 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C885.3:0 ROSPD Provisioning ID [3:0] - AQ_GlobalReservedStatus_HHD.u0.bits_0.provisioningID - - Provisionable Default = 0x0 - - Provisioning ID - - - Notes: - Customers may receive multiple ROM images that differ only in their provisioning. This field is used to differentiate those images. This field is used in conjunction with the firmware major and minor revision numbers to uniquely identify ROM images. */ - unsigned int provisioningID : 4; /* 1E.C885.3:0 ROSPD Provisionable Default = 0x0 */ - /* Provisioning ID - */ - /*! \brief 1E.C885.7:4 ROSPD Firmware Build ID [3:0] - AQ_GlobalReservedStatus_HHD.u0.bits_0.firmwareBuildID - - Provisionable Default = 0x0 - - Firmware Build ID - - - Notes: - Customers may receive multiple ROM images that differ only in their provisioning. This field is used to differentiate those images. This field is used in conjunction with the firmware major and minor revision numbers to uniquely identify ROM images. */ - unsigned int firmwareBuildID : 4; /* 1E.C885.7:4 ROSPD Provisionable Default = 0x0 */ - /* Firmware Build ID - */ - /*! \brief 1E.C885.9:8 ROSPD XENPAK NVR Status [1:0] - AQ_GlobalReservedStatus_HHD.u0.bits_0.xenpakNvrStatus - - Provisionable Default = 0x0 - - Status of XENPAK NVR: - 0: NVR not enabled - 1: Last NVR operation succeeded - 2: Last NVR operation failed - 3: Reserved - - - Notes: - XENPAK register space is mirrored in NVR (SPI ROM). This register indicates the status of the last NVR operation. */ - unsigned int xenpakNvrStatus : 2; /* 1E.C885.9:8 ROSPD Provisionable Default = 0x0 */ - /* Status of XENPAK NVR: - 0: NVR not enabled - 1: Last NVR operation succeeded - 2: Last NVR operation failed - 3: Reserved - */ - /*! \brief 1E.C885.F:A RO Nearly Seconds MSW[5:0] - AQ_GlobalReservedStatus_HHD.u0.bits_0.nearlySecondsMSW - - - - Bits 16 to 21 of the 22 bit "Nearly Seconds" uptime counter. - - - Notes: - The "Nearly Seconds" counter is incremented every 1024 milliseconds. */ - unsigned int nearlySecondsMSW : 6; /* 1E.C885.F:A RO */ - /* Bits 16 to 21 of the 22 bit "Nearly Seconds" uptime counter. - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C886.F:0 RO Nearly Seconds LSW [F:0] - AQ_GlobalReservedStatus_HHD.u1.bits_1.nearlySecondsLSW - - - - Bits 0 to 15 of the 22 bit "Nearly Seconds" uptime counter - - - Notes: - The "Nearly Seconds" counter is incremented every 1024 milliseconds. */ - unsigned int nearlySecondsLSW : 16; /* 1E.C886.F:0 RO */ - /* Bits 0 to 15 of the 22 bit "Nearly Seconds" uptime counter - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C887.D:0 RO Reserved Status 3 [D:0] - AQ_GlobalReservedStatus_HHD.u2.bits_2.reservedStatus_3 - - - - Reserved for future use - - */ - unsigned int reservedStatus_3 : 14; /* 1E.C887.D:0 RO */ - /* Reserved for future use - */ - /*! \brief 1E.C887.E ROS Power Up Stall Status - AQ_GlobalReservedStatus_HHD.u2.bits_2.powerUpStallStatus - - Default = 0x0 - - 1 = FW is stalled at power up - 0 = Firmware is unstalled - - */ - unsigned int powerUpStallStatus : 1; /* 1E.C887.E ROS Default = 0x0 */ - /* 1 = FW is stalled at power up - 0 = Firmware is unstalled - */ - /*! \brief 1E.C887.F ROS DTE Status - AQ_GlobalReservedStatus_HHD.u2.bits_2.dteStatus - - Default = 0x0 - - 1 = Need power - 0 = Don't need power - - */ - unsigned int dteStatus : 1; /* 1E.C887.F ROS Default = 0x0 */ - /* 1 = Need power - 0 = Don't need power - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C888.1:0 RO Rate [1:0] - AQ_GlobalReservedStatus_HHD.u3.bits_3.rate - - Default = 0x0 - - 0x3 = 10G - 0x2 = 1G - 0x1 = 100M - 0x0 = invalid - - - Notes: - These bits report the selected rate for the loopback and packet generation. */ - unsigned int rate : 2; /* 1E.C888.1:0 RO Default = 0x0 */ - /* 0x3 = 10G - 0x2 = 1G - 0x1 = 100M - 0x0 = invalid - */ - /*! \brief 1E.C888.2 RO Reserved Status 4a - AQ_GlobalReservedStatus_HHD.u3.bits_3.reservedStatus_4a - - Default = 0x0 - - Reserved for future use - - */ - unsigned int reservedStatus_4a : 1; /* 1E.C888.2 RO Default = 0x0 */ - /* Reserved for future use - */ - /*! \brief 1E.C888.3 RO System I/F Packet Generation Status - AQ_GlobalReservedStatus_HHD.u3.bits_3.systemI_fPacketGenerationStatus - - Default = 0x0 - - 1 = CRPAT packet generation out 10G system interface - 0 = No CRPAT packet generation out 10G system interface - - - Notes: - Reports whether the CRPAT packet generator in the PHY outputs on the selected system interface at the selected rate. */ - unsigned int systemI_fPacketGenerationStatus : 1; /* 1E.C888.3 RO Default = 0x0 */ - /* 1 = CRPAT packet generation out 10G system interface - 0 = No CRPAT packet generation out 10G system interface - */ - /*! \brief 1E.C888.4 RO Look-Aside Port Packet Generation Status - AQ_GlobalReservedStatus_HHD.u3.bits_3.look_asidePortPacketGenerationStatus - - Default = 0x0 - - 1 = CRPAT packet generation out 10G look-aside interface (KR0) - 0 = No CRPAT packet generation out 10G look-aside interface (KR0) - - - Notes: - Reports whether the CRPAT packet generator in the PHY outputs on the KR0 interface at the selected rate. */ - unsigned int look_asidePortPacketGenerationStatus : 1; /* 1E.C888.4 RO Default = 0x0 */ - /* 1 = CRPAT packet generation out 10G look-aside interface (KR0) - 0 = No CRPAT packet generation out 10G look-aside interface (KR0) - */ - /*! \brief 1E.C888.5 RO MDI Packet Generation Status - AQ_GlobalReservedStatus_HHD.u3.bits_3.mdiPacketGenerationStatus - - Default = 0x0 - - 1 = CRPAT packet generation out MDI interface - 0 = No CRPAT packet generation out MDI interface - - - Notes: - Reports whether the CRPAT packet generator in the PHY outputs on the MDI interface at the selected rate. */ - unsigned int mdiPacketGenerationStatus : 1; /* 1E.C888.5 RO Default = 0x0 */ - /* 1 = CRPAT packet generation out MDI interface - 0 = No CRPAT packet generation out MDI interface - */ - /*! \brief 1E.C888.A:6 RO Reserved Status 4 [4:0] - AQ_GlobalReservedStatus_HHD.u3.bits_3.reservedStatus_4 - - Default = 0x00 - - Reserved for future use - - */ - unsigned int reservedStatus_4 : 5; /* 1E.C888.A:6 RO Default = 0x00 */ - /* Reserved for future use - */ - /*! \brief 1E.C888.F:B RO Loopback Status [4:0] - AQ_GlobalReservedStatus_HHD.u3.bits_3.loopbackStatus - - Default = 0x00 - - 0x00 = No loopback - 0x01 = System Interface - System Loopback - 0x02 = System Interface - System Loopback with Passthrough - 0x03 = System Interface - Network Loopback - 0x04 = System Interface - Network Loopback with Passthrough - 0x05 = System Interface - Network Loopback with Passthrough and Merge - 0x06 = System Interface - Peer-to-peer loopback - 0x07 - 0x08 = Reserved - 0x09 = Network Interface - System Loopback - 0x0A = Network Interface - System Loopback with Passthrough - 0x0B = Network Interface - Network Loopback - 0x0C = Network Interface - Network Loopback with Passthrough - 0x0D = Network Interface - Peer-to-peer loopback - 0x0E - 0x0F = Reserved - 0x10 = Cross-connect System Loopback - 0x11 = Cross-connect Network Loopback - 0x12 - 0x13 = Reserved - 0x14 = Network Interface - System Loopback via Loopback Plug - 0x15 - 0x1F = Reserved - - - Notes: - These bits, in conjunction with the chip configuration and the rate (Bits 1:0), report the selected loopback. - - */ - unsigned int loopbackStatus : 5; /* 1E.C888.F:B RO Default = 0x00 */ - /* 0x00 = No loopback - 0x01 = System Interface - System Loopback - 0x02 = System Interface - System Loopback with Passthrough - 0x03 = System Interface - Network Loopback - 0x04 = System Interface - Network Loopback with Passthrough - 0x05 = System Interface - Network Loopback with Passthrough and Merge - 0x06 = System Interface - Peer-to-peer loopback - 0x07 - 0x08 = Reserved - 0x09 = Network Interface - System Loopback - 0x0A = Network Interface - System Loopback with Passthrough - 0x0B = Network Interface - Network Loopback - 0x0C = Network Interface - Network Loopback with Passthrough - 0x0D = Network Interface - Peer-to-peer loopback - 0x0E - 0x0F = Reserved - 0x10 = Cross-connect System Loopback - 0x11 = Cross-connect Network Loopback - 0x12 - 0x13 = Reserved - 0x14 = Network Interface - System Loopback via Loopback Plug - 0x15 - 0x1F = Reserved - */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_GlobalReservedStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Alarms: 1E.CC00 */ -/* Global Alarms: 1E.CC00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Alarms */ - union - { - struct - { - /*! \brief 1E.CC00.0 LH Reserved Alarm D - AQ_GlobalAlarms_HHD.u0.bits_0.reservedAlarmD - - - - Reserved for future use - - */ - unsigned int reservedAlarmD : 1; /* 1E.CC00.0 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.1 LH Reserved Alarm C - AQ_GlobalAlarms_HHD.u0.bits_0.reservedAlarmC - - - - Reserved for future use - - */ - unsigned int reservedAlarmC : 1; /* 1E.CC00.1 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.2 LH Reserved Alarm B - AQ_GlobalAlarms_HHD.u0.bits_0.reservedAlarmB - - - - Reserved for future use - - */ - unsigned int reservedAlarmB : 1; /* 1E.CC00.2 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.3 LH Reserved Alarm A - AQ_GlobalAlarms_HHD.u0.bits_0.reservedAlarmA - - - - Reserved for future use - - */ - unsigned int reservedAlarmA : 1; /* 1E.CC00.3 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.4 LH Device Fault - AQ_GlobalAlarms_HHD.u0.bits_0.deviceFault - - - - 1 = Fault - - Notes: - When set, a fault has been detected by the uP and the associated 16 bit error code is visible in See Global Configuration Fault Message: Address 1E.C850 */ - unsigned int deviceFault : 1; /* 1E.CC00.4 LH */ - /* 1 = Fault */ - unsigned int reserved2 : 1; - /*! \brief 1E.CC00.6 LH Reset completed - AQ_GlobalAlarms_HHD.u0.bits_0.resetCompleted - - - - 1 = Chip wide reset completed - - Notes: - This bit is set by the microprocessor when it has completed it's initialization sequence. This bit is mirrored in 1.CC02.0 */ - unsigned int resetCompleted : 1; /* 1E.CC00.6 LH */ - /* 1 = Chip wide reset completed */ - unsigned int reserved1 : 4; - /*! \brief 1E.CC00.B LH Low Temperature Warning - AQ_GlobalAlarms_HHD.u0.bits_0.lowTemperatureWarning - - - - 1 = Low temperature warning threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int lowTemperatureWarning : 1; /* 1E.CC00.B LH */ - /* 1 = Low temperature warning threshold has been exceeded - */ - /*! \brief 1E.CC00.C LH High Temperature Warning - AQ_GlobalAlarms_HHD.u0.bits_0.highTemperatureWarning - - - - 1 = High temperature warning threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int highTemperatureWarning : 1; /* 1E.CC00.C LH */ - /* 1 = High temperature warning threshold has been exceeded - */ - /*! \brief 1E.CC00.D LH Low Temperature Failure - AQ_GlobalAlarms_HHD.u0.bits_0.lowTemperatureFailure - - - - 1 = Low temperature failure threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int lowTemperatureFailure : 1; /* 1E.CC00.D LH */ - /* 1 = Low temperature failure threshold has been exceeded - */ - /*! \brief 1E.CC00.E LH High Temperature Failure - AQ_GlobalAlarms_HHD.u0.bits_0.highTemperatureFailure - - - - 1 = High temperature failure threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int highTemperatureFailure : 1; /* 1E.CC00.E LH */ - /* 1 = High temperature failure threshold has been exceeded - */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Alarms */ - union - { - struct - { - unsigned int reserved2 : 1; - unsigned int reserved1 : 6; - /*! \brief 1E.CC01.7 LH MDIO Command Handling Overflow - AQ_GlobalAlarms_HHD.u1.bits_1.mdioCommandHandlingOverflow - - - - 1 = PHY was issued more MDIO requests than it could service in it's request buffer - - - Notes: - Assertion of this bit means that more MDIO commands were issued than FW could handle. */ - unsigned int mdioCommandHandlingOverflow : 1; /* 1E.CC01.7 LH */ - /* 1 = PHY was issued more MDIO requests than it could service in it's request buffer - */ - /*! \brief 1E.CC01.A:8 LH Reserved Alarms [2:0] - AQ_GlobalAlarms_HHD.u1.bits_1.reservedAlarms - - - - Reserved - - - */ - unsigned int reservedAlarms : 3; /* 1E.CC01.A:8 LH */ - /* Reserved - - */ - /*! \brief 1E.CC01.B LH DTE Status Change - AQ_GlobalAlarms_HHD.u1.bits_1.dteStatusChange - - - - 1 = DTE status change - - - Notes: - Change in 1E.C887[F]. */ - unsigned int dteStatusChange : 1; /* 1E.CC01.B LH */ - /* 1 = DTE status change - */ - /*! \brief 1E.CC01.C LH IP Phone Detect - AQ_GlobalAlarms_HHD.u1.bits_1.ipPhoneDetect - - - - 1 = IP Phone Detect - - - Notes: - Assertion of this bit means that the presence of an IP Phone has been detected. */ - unsigned int ipPhoneDetect : 1; /* 1E.CC01.C LH */ - /* 1 = IP Phone Detect - */ - /*! \brief 1E.CC01.D RO XENPAK Alarm - AQ_GlobalAlarms_HHD.u1.bits_1.xenpakAlarm - - - - 1 = XENPAK Alarm - - */ - unsigned int xenpakAlarm : 1; /* 1E.CC01.D RO */ - /* 1 = XENPAK Alarm - */ - /*! \brief 1E.CC01.E LH Smart Power-Down Entered - AQ_GlobalAlarms_HHD.u1.bits_1.smartPower_downEntered - - - - 1 = Smart Power-Down State Entered - - - Notes: - When this bit is set, it indicates that the Smart Power-Down state was entered */ - unsigned int smartPower_downEntered : 1; /* 1E.CC01.E LH */ - /* 1 = Smart Power-Down State Entered - */ - unsigned int reserved0 : 1; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Alarms */ - union - { - struct - { - /*! \brief 1E.CC02.0 LH Watchdog Timer Alarm - AQ_GlobalAlarms_HHD.u2.bits_2.watchdogTimerAlarm - - - - 1 = Watchdog timer alarm - - */ - unsigned int watchdogTimerAlarm : 1; /* 1E.CC02.0 LH */ - /* 1 = Watchdog timer alarm - */ - /*! \brief 1E.CC02.1 LH MDIO Timeout Error - AQ_GlobalAlarms_HHD.u2.bits_2.mdioTimeoutError - - - - 1 = MDIO timeout detected - - */ - unsigned int mdioTimeoutError : 1; /* 1E.CC02.1 LH */ - /* 1 = MDIO timeout detected - */ - /*! \brief 1E.CC02.2 LH MDIO MMD Error - AQ_GlobalAlarms_HHD.u2.bits_2.mdioMMD_Error - - - - 1 = Invalid MMD address detected - - */ - unsigned int mdioMMD_Error : 1; /* 1E.CC02.2 LH */ - /* 1 = Invalid MMD address detected - */ - unsigned int reserved2 : 2; - /*! \brief 1E.CC02.5 LRF Tx Enable State Change - AQ_GlobalAlarms_HHD.u2.bits_2.txEnableStateChange - - - - 1 = TX_EN pin has changed state - - */ - unsigned int txEnableStateChange : 1; /* 1E.CC02.5 LRF */ - /* 1 = TX_EN pin has changed state - */ - unsigned int reserved1 : 2; - /*! \brief 1E.CC02.9:8 LH uP IRAM Parity Error [1:0] - AQ_GlobalAlarms_HHD.u2.bits_2.upIramParityError - - - - 1 = Parity error detected in the uP IRAM - - - Notes: - Bit 0 indicates a parity error was detected in the uP IRAM but was corrected. - Bit 1 indicates a multiple parity errors were detected in the uP IRAM and could not be corrected. - The uP IRAM is protected with ECC. */ - unsigned int upIramParityError : 2; /* 1E.CC02.9:8 LH */ - /* 1 = Parity error detected in the uP IRAM - */ - /*! \brief 1E.CC02.A LH uP DRAM Parity Error - AQ_GlobalAlarms_HHD.u2.bits_2.upDramParityError - - - - 1 = Parity error detected in the uP DRAM - - */ - unsigned int upDramParityError : 1; /* 1E.CC02.A LH */ - /* 1 = Parity error detected in the uP DRAM - */ - unsigned int reserved0 : 3; - /*! \brief 1E.CC02.E LH Mailbox Operation: Complete - AQ_GlobalAlarms_HHD.u2.bits_2.mailboxOperation_Complete - - - - 1 = Mailbox operation is complete - - - Notes: - Mailbox interface is ready interrupt for registers See Global Vendor Specific Control - Address 1E.C000 - See Global Vendor Specific Provisioning 5 - Address 1E.C404 */ - unsigned int mailboxOperation_Complete : 1; /* 1E.CC02.E LH */ - /* 1 = Mailbox operation is complete - */ - /*! \brief 1E.CC02.F LH NVR Operation Complete - AQ_GlobalAlarms_HHD.u2.bits_2.nvrOperationComplete - - - - 1 = NVR operation is complete - - - Notes: - NVR interface is ready interrupt for registers See Global NVR Interface 1: Address 1E.100 - See Global NVR Provisioning Data MSW - Address 1E.17 . */ - unsigned int nvrOperationComplete : 1; /* 1E.CC02.F LH */ - /* 1 = NVR operation is complete - */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalAlarms_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Mask: 1E.D400 */ -/* Global Interrupt Mask: 1E.D400 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Mask */ - union - { - struct - { - /*! \brief 1E.D400.0 R/WPD Reserved Alarm D Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.reservedAlarmDMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmDMask : 1; /* 1E.D400.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.1 R/WPD Reserved Alarm C Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.reservedAlarmCMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmCMask : 1; /* 1E.D400.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.2 R/WPD Reserved Alarm B Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.reservedAlarmBMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmBMask : 1; /* 1E.D400.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.3 R/WPD Reserved Alarm A Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.reservedAlarmAMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmAMask : 1; /* 1E.D400.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.4 R/WPD Device Fault Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.deviceFaultMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int deviceFaultMask : 1; /* 1E.D400.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved2 : 1; - /*! \brief 1E.D400.6 R/WPD Reset completed Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.resetCompletedMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int resetCompletedMask : 1; /* 1E.D400.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved1 : 4; - /*! \brief 1E.D400.B R/WPD Low Temperature Warning Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.lowTemperatureWarningMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int lowTemperatureWarningMask : 1; /* 1E.D400.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.C R/WPD High Temperature Warning Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.highTemperatureWarningMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int highTemperatureWarningMask : 1; /* 1E.D400.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.D R/WPD Low Temperature Failure Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.lowTemperatureFailureMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int lowTemperatureFailureMask : 1; /* 1E.D400.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.E R/WPD High Temperature Failure Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.highTemperatureFailureMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int highTemperatureFailureMask : 1; /* 1E.D400.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 1; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Interrupt Mask */ - union - { - struct - { - /*! \brief 1E.D401.0 R/WPD Diagnostic Alarm Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.diagnosticAlarmMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int diagnosticAlarmMask : 1; /* 1E.D401.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved1 : 6; - /*! \brief 1E.D401.7 R/WPD MDIO Command Handling Overflow Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.mdioCommandHandlingOverflowMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int mdioCommandHandlingOverflowMask : 1; /* 1E.D401.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.A:8 R/WPD Reserved Alarms Mask [2:0] - AQ_GlobalInterruptMask_HHD.u1.bits_1.reservedAlarmsMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmsMask : 3; /* 1E.D401.A:8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.B R/WPD DTE Status Change Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.dteStatusChangeMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int dteStatusChangeMask : 1; /* 1E.D401.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.C R/WPD IP Phone Detect Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.ipPhoneDetectMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int ipPhoneDetectMask : 1; /* 1E.D401.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.D R/WPD XENPAK Alarm Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.xenpakAlarmMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int xenpakAlarmMask : 1; /* 1E.D401.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D401.E R/WPD Smart Power-Down Entered Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.smartPower_downEnteredMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int smartPower_downEnteredMask : 1; /* 1E.D401.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved0 : 1; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Interrupt Mask */ - union - { - struct - { - /*! \brief 1E.D402.0 R/WPD Watchdog Timer Alarm Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.watchdogTimerAlarmMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int watchdogTimerAlarmMask : 1; /* 1E.D402.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.1 R/WPD MDIO Timeout Error Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.mdioTimeoutErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int mdioTimeoutErrorMask : 1; /* 1E.D402.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.2 R/WPD MDIO MMD Error Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.mdioMMD_ErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int mdioMMD_ErrorMask : 1; /* 1E.D402.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved2 : 2; - /*! \brief 1E.D402.5 R/WPD Tx Enable State Change Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.txEnableStateChangeMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int txEnableStateChangeMask : 1; /* 1E.D402.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved1 : 2; - /*! \brief 1E.D402.9:8 R/WPD uP IRAM Parity Error Mask [1:0] - AQ_GlobalInterruptMask_HHD.u2.bits_2.upIramParityErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int upIramParityErrorMask : 2; /* 1E.D402.9:8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D402.A R/WPD uP DRAM Parity Error Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.upDramParityErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int upDramParityErrorMask : 1; /* 1E.D402.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved0 : 3; - /*! \brief 1E.D402.E R/WPD Mailbox Operation Complete Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.mailboxOperationCompleteMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - Notes: - Mailbox interface is ready interrupt for registers See Global Vendor Specific Control - Address 1E.C000 - See Global Vendor Specific Provisioning 5 - Address 1E.C404 */ - unsigned int mailboxOperationCompleteMask : 1; /* 1E.D402.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.F R/WPD NVR Operation Complete Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.nvrOperationCompleteMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - Notes: - NVR interface is ready interrupt for registers See Global NVR Interface 1: Address 1E.100 - See Global NVR Provisioning Data MSW - Address 1E.17 */ - unsigned int nvrOperationCompleteMask : 1; /* 1E.D402.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalInterruptMask_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip-Wide Standard Interrupt Flags: 1E.FC00 */ -/* Global Chip-Wide Standard Interrupt Flags: 1E.FC00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip-Wide Standard Interrupt Flags */ - union - { - struct - { - /*! \brief 1E.FC00.0 RO All Vendor Alarms Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.allVendorAlarmsInterrupt - - - - 1 = Interrupt in all vendor alarms - - - Notes: - An interrupt was generated from status register ( See Global Chip-Wide LASI Vendor Interrupt Flags: Address 1E.FC01 ) and the corresponding mask register. ( See Global Interrupt LASI Mask: Address 1E.FF01 ) */ - unsigned int allVendorAlarmsInterrupt : 1; /* 1E.FC00.0 RO */ - /* 1 = Interrupt in all vendor alarms - */ - unsigned int reserved0 : 5; - /*! \brief 1E.FC00.6 RO GbE Standard Alarms Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.gbeStandardAlarmsInterrupt - - - - 1 = Interrupt in GbE standard alarms - - - Notes: - An interrupt was generated from the TGE core. */ - unsigned int gbeStandardAlarmsInterrupt : 1; /* 1E.FC00.6 RO */ - /* 1 = Interrupt in GbE standard alarms - */ - /*! \brief 1E.FC00.7 RO Autonegotiation Standard Alarms 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.autonegotiationStandardAlarms_2Interrupt - - - - 1 = Interrupt in Autonegotiation standard alarms 2 - - - Notes: - An interrupt was generated from status register ( See Autonegotiation 10GBASE-T Status Register - Address 7.21 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int autonegotiationStandardAlarms_2Interrupt : 1; /* 1E.FC00.7 RO */ - /* 1 = Interrupt in Autonegotiation standard alarms 2 - */ - /*! \brief 1E.FC00.8 RO Autonegotiation Standard Alarms 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.autonegotiationStandardAlarms_1Interrupt - - - - 1 = Interrupt in Autonegotiation standard alarms 1 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See Autonegotiation Standard LASI Interrupt Mask 1: Address 7.D000 ) */ - unsigned int autonegotiationStandardAlarms_1Interrupt : 1; /* 1E.FC00.8 RO */ - /* 1 = Interrupt in Autonegotiation standard alarms 1 - */ - /*! \brief 1E.FC00.9 RO PHY XS Standard Alarms 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.phyXS_StandardAlarms_2Interrupt - - - - 1 = Interrupt in PHY XS standard alarms 2 - - - Notes: - An interrupt was generated from the status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int phyXS_StandardAlarms_2Interrupt : 1; /* 1E.FC00.9 RO */ - /* 1 = Interrupt in PHY XS standard alarms 2 - */ - /*! \brief 1E.FC00.A RO PHY XS Standard Alarms 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.phyXS_StandardAlarms_1Interrupt - - - - 1 = Interrupt in PHY XS standard alarms 1 - - - Notes: - An interrupt was generated from the status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int phyXS_StandardAlarms_1Interrupt : 1; /* 1E.FC00.A RO */ - /* 1 = Interrupt in PHY XS standard alarms 1 - */ - /*! \brief 1E.FC00.B RO PCS Standard Alarm 3 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pcsStandardAlarm_3Interrupt - - - - 1 = Interrupt in PCS standard alarms 3 - - - Notes: - An interrupt was generated from status register ( See PCS 10GBASE-T Status 2 - Address 3.21 ) and the corresponding mask register. ( See PCS Standard Interrupt Mask 1 - Address 3.E021 ) */ - unsigned int pcsStandardAlarm_3Interrupt : 1; /* 1E.FC00.B RO */ - /* 1 = Interrupt in PCS standard alarms 3 - */ - /*! \brief 1E.FC00.C RO PCS Standard Alarm 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pcsStandardAlarm_2Interrupt - - - - 1 = Interrupt in PCS standard alarms 2 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int pcsStandardAlarm_2Interrupt : 1; /* 1E.FC00.C RO */ - /* 1 = Interrupt in PCS standard alarms 2 - */ - /*! \brief 1E.FC00.D RO PCS Standard Alarm 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pcsStandardAlarm_1Interrupt - - - - 1 = Interrupt in PCS standard alarms 1 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int pcsStandardAlarm_1Interrupt : 1; /* 1E.FC00.D RO */ - /* 1 = Interrupt in PCS standard alarms 1 - */ - /*! \brief 1E.FC00.E RO PMA Standard Alarm 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pmaStandardAlarm_2Interrupt - - - - 1 = Interrupt in PMA standard alarms 2 - - - Notes: - An interrupt was generated from either bit 1.8.B or 1.8.A. - An interrupt was generated from status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int pmaStandardAlarm_2Interrupt : 1; /* 1E.FC00.E RO */ - /* 1 = Interrupt in PMA standard alarms 2 - */ - /*! \brief 1E.FC00.F RO PMA Standard Alarm 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pmaStandardAlarm_1Interrupt - - - - 1 = Interrupt in PMA standard alarms 1 - - - Notes: - An interrupt was generated from bit 1.1.2. - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int pmaStandardAlarm_1Interrupt : 1; /* 1E.FC00.F RO */ - /* 1 = Interrupt in PMA standard alarms 1 - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChip_wideStandardInterruptFlags_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip-Wide Vendor Interrupt Flags: 1E.FC01 */ -/* Global Chip-Wide Vendor Interrupt Flags: 1E.FC01 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip-Wide Vendor Interrupt Flags */ - union - { - struct - { - /*! \brief 1E.FC01.0 RO Global Alarms 3 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.globalAlarms_3Interrupt - - - - 1 = Interrupt in Global alarms 3 - - - Notes: - An interrupt was generated from status register ( See Global Vendor Alarms 2: Address 1E.CC01 ) and the corresponding mask register. ( See Global LASI Interrupt Mask 2: Address 1E.D401 ) */ - unsigned int globalAlarms_3Interrupt : 1; /* 1E.FC01.0 RO */ - /* 1 = Interrupt in Global alarms 3 - */ - /*! \brief 1E.FC01.1 RO Global Alarms 2 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.globalAlarms_2Interrupt - - - - 1 = Interrupt in Global alarms 2 - - - Notes: - An interrupt was generated from status register ( See Global Alarms 2: Address 1E.CC01 ) and the corresponding mask register. ( See Global LASI Interrupt Mask 2: Address 1E.D401 ) */ - unsigned int globalAlarms_2Interrupt : 1; /* 1E.FC01.1 RO */ - /* 1 = Interrupt in Global alarms 2 - */ - /*! \brief 1E.FC01.2 RO Global Alarms 1 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.globalAlarms_1Interrupt - - - - 1 = Interrupt in Global alarms 1 - - - Notes: - An interrupt was generated from status register ( See Global Vendor Alarms 1 - Address 1E.CC00 ) and the corresponding mask register. ( See Global Vendor Interrupt Mask - Address 1E.D400 ) */ - unsigned int globalAlarms_1Interrupt : 1; /* 1E.FC01.2 RO */ - /* 1 = Interrupt in Global alarms 1 - */ - unsigned int reserved0 : 8; - /*! \brief 1E.FC01.B RO GbE Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.gbeVendorAlarmInterrupt - - - - 1 = Interrupt in GbE vendor specific alarm - - - Notes: - A GbE alarm was generated. ( See GbE PHY Vendor Global LASI Interrupt Flags 1: Address 1D.FC00 ) */ - unsigned int gbeVendorAlarmInterrupt : 1; /* 1E.FC01.B RO */ - /* 1 = Interrupt in GbE vendor specific alarm - */ - /*! \brief 1E.FC01.C RO Autonegotiation Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.autonegotiationVendorAlarmInterrupt - - - - 1 = Interrupt in Autonegotiation vendor specific alarm - - - Notes: - An Autonegotiation alarm was generated. ( See Autonegotiation Vendor Global LASI Interrupt Flags 1: Address 7.FC00 ) */ - unsigned int autonegotiationVendorAlarmInterrupt : 1; /* 1E.FC01.C RO */ - /* 1 = Interrupt in Autonegotiation vendor specific alarm - */ - /*! \brief 1E.FC01.D RO PHY XS Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.phyXS_VendorAlarmInterrupt - - - - 1 = Interrupt in PHY XS vendor specific alarm - - - Notes: - A PHY XS alarm was generated. ( See PHY XS Vendor Global LASI Interrupt Flags 1: Address 4.FC00 ) */ - unsigned int phyXS_VendorAlarmInterrupt : 1; /* 1E.FC01.D RO */ - /* 1 = Interrupt in PHY XS vendor specific alarm - */ - /*! \brief 1E.FC01.E RO PCS Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.pcsVendorAlarmInterrupt - - - - 1 = Interrupt in PCS vendor specific alarm - - - Notes: - A PCS alarm was generated. ( See PHY XS Vendor Global Interrupt Flags 1- Address 4.F800 ) */ - unsigned int pcsVendorAlarmInterrupt : 1; /* 1E.FC01.E RO */ - /* 1 = Interrupt in PCS vendor specific alarm - */ - /*! \brief 1E.FC01.F RO PMA Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.pmaVendorAlarmInterrupt - - - - 1 = Interrupt in PMA vendor specific alarm - - - Notes: - A PMA alarm was generated. ( See PHY XS Vendor Global Interrupt Flags 1- Address 4.F800 ) */ - unsigned int pmaVendorAlarmInterrupt : 1; /* 1E.FC01.F RO */ - /* 1 = Interrupt in PMA vendor specific alarm - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChip_wideVendorInterruptFlags_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Chip-Wide Standard Mask: 1E.FF00 */ -/* Global Interrupt Chip-Wide Standard Mask: 1E.FF00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Chip-Wide Standard Mask */ - union - { - struct - { - /*! \brief 1E.FF00.0 R/WPD All Vendor Alarms Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.allVendorAlarmsInterruptMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int allVendorAlarmsInterruptMask : 1; /* 1E.FF00.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 5; - /*! \brief 1E.FF00.6 R/WPD Gbe Standard Alarms Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.gbeStandardAlarmsInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int gbeStandardAlarmsInterruptMask : 1; /* 1E.FF00.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.7 R/WPD Autonegotiation Standard Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.autonegotiationStandardAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationStandardAlarms_2InterruptMask : 1; /* 1E.FF00.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.8 R/WPD Autonegotiation Standard Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.autonegotiationStandardAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationStandardAlarms_1InterruptMask : 1; /* 1E.FF00.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.9 R/WPD PHY XS Standard Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.phyXS_StandardAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_StandardAlarms_2InterruptMask : 1; /* 1E.FF00.9 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.A R/WPD PHY XS Standard Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.phyXS_StandardAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_StandardAlarms_1InterruptMask : 1; /* 1E.FF00.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.B R/WPD PCS Standard Alarm 3 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pcsStandardAlarm_3InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_3InterruptMask : 1; /* 1E.FF00.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.C R/WPD PCS Standard Alarm 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pcsStandardAlarm_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_2InterruptMask : 1; /* 1E.FF00.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.D R/WPD PCS Standard Alarm 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pcsStandardAlarm_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_1InterruptMask : 1; /* 1E.FF00.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.E R/WPD PMA Standard Alarm 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pmaStandardAlarm_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaStandardAlarm_2InterruptMask : 1; /* 1E.FF00.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.F R/WPD PMA Standard Alarm 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pmaStandardAlarm_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaStandardAlarm_1InterruptMask : 1; /* 1E.FF00.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalInterruptChip_wideStandardMask_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Chip-Wide Vendor Mask: 1E.FF01 */ -/* Global Interrupt Chip-Wide Vendor Mask: 1E.FF01 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Chip-Wide Vendor Mask */ - union - { - struct - { - /*! \brief 1E.FF01.0 R/WPD Global Alarms 3 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.globalAlarms_3InterruptMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_3InterruptMask : 1; /* 1E.FF01.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.1 R/WPD Global Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.globalAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_2InterruptMask : 1; /* 1E.FF01.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.2 R/WPD Global Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.globalAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_1InterruptMask : 1; /* 1E.FF01.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 8; - /*! \brief 1E.FF01.B R/WPD GbE Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.gbeVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int gbeVendorAlarmInterruptMask : 1; /* 1E.FF01.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.C R/WPD Autonegotiation Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.autonegotiationVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationVendorAlarmInterruptMask : 1; /* 1E.FF01.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.D R/WPD PHY XS Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.phyXS_VendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_VendorAlarmInterruptMask : 1; /* 1E.FF01.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.E R/WPD PCS Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.pcsVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsVendorAlarmInterruptMask : 1; /* 1E.FF01.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.F R/WPD PMA Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.pmaVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaVendorAlarmInterruptMask : 1; /* 1E.FF01.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalInterruptChip_wideVendorMask_HHD; - -#endif -/*@}*/ -/*@}*/ diff --git a/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers_Defines.h b/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers_Defines.h deleted file mode 100755 index d9a4429d5..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers_Defines.h +++ /dev/null @@ -1,4413 +0,0 @@ -/*! \file -* This file contains the compiler assist macros and doxygen comments -* for the Global Registers block. -*/ - -/*! \defgroup Global_registers_Defines Global Registers Defines -* This module contains the compiler assist macros and doxygen comments -* for the Global Registers block. -*/ -/*********************************************************************** -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* $File: //depot/icm/proj/Dena/rev1.0/c/Systems/tools/windows/regMapParser/src/gencheaders.py $ -* -* $Revision: #10 $ -* -* $DateTime: 2014/04/08 16:55:58 $ -* -* $Author: joshd $ -* -* $Label: $ -* -* Description: -* -* This file contains the compiler assist macros for the registers contained in the Global Registers block. -* -* -***********************************************************************/ - - -/*@{*/ -#ifndef AQ_HHD_GLOBAL_REGS_DEFINES_HEADER -#define AQ_HHD_GLOBAL_REGS_DEFINES_HEADER - - -/*-----------------------------------------------------------------------------*/ -/*Access macro definitions */ -/*-----------------------------------------------------------------------------*/ -/*! \brief Base register address of structure AQ_GlobalStandardControl_1_HHD */ -#define AQ_GlobalStandardControl_1_HHD_baseRegisterAddress 0x0000 -/*! \brief MMD address of structure AQ_GlobalStandardControl_1_HHD */ -#define AQ_GlobalStandardControl_1_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure softReset in AQ_GlobalStandardControl_1_HHD */ -#define AQ_GlobalStandardControl_1_HHD_softReset 0 -/*! \brief Preprocessor variable to relate field to bit position in structure softReset in AQ_GlobalStandardControl_1_HHD */ -#define bits_AQ_GlobalStandardControl_1_HHD_softReset u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure softReset in AQ_GlobalStandardControl_1_HHD */ -#define word_AQ_GlobalStandardControl_1_HHD_softReset u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowPower in AQ_GlobalStandardControl_1_HHD */ -#define AQ_GlobalStandardControl_1_HHD_lowPower 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowPower in AQ_GlobalStandardControl_1_HHD */ -#define bits_AQ_GlobalStandardControl_1_HHD_lowPower u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowPower in AQ_GlobalStandardControl_1_HHD */ -#define word_AQ_GlobalStandardControl_1_HHD_lowPower u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalStandardDeviceIdentifier_HHD */ -#define AQ_GlobalStandardDeviceIdentifier_HHD_baseRegisterAddress 0x0002 -/*! \brief MMD address of structure AQ_GlobalStandardDeviceIdentifier_HHD */ -#define AQ_GlobalStandardDeviceIdentifier_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure deviceIdMSW in AQ_GlobalStandardDeviceIdentifier_HHD */ -#define AQ_GlobalStandardDeviceIdentifier_HHD_deviceIdMSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure deviceIdMSW in AQ_GlobalStandardDeviceIdentifier_HHD */ -#define bits_AQ_GlobalStandardDeviceIdentifier_HHD_deviceIdMSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure deviceIdMSW in AQ_GlobalStandardDeviceIdentifier_HHD */ -#define word_AQ_GlobalStandardDeviceIdentifier_HHD_deviceIdMSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure deviceIdLSW in AQ_GlobalStandardDeviceIdentifier_HHD */ -#define AQ_GlobalStandardDeviceIdentifier_HHD_deviceIdLSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure deviceIdLSW in AQ_GlobalStandardDeviceIdentifier_HHD */ -#define bits_AQ_GlobalStandardDeviceIdentifier_HHD_deviceIdLSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure deviceIdLSW in AQ_GlobalStandardDeviceIdentifier_HHD */ -#define word_AQ_GlobalStandardDeviceIdentifier_HHD_deviceIdLSW u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_baseRegisterAddress 0x0005 -/*! \brief MMD address of structure AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_autonegotiationPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardDevicesInPackage_HHD_autonegotiationPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardDevicesInPackage_HHD_autonegotiationPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure tcPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_tcPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure tcPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardDevicesInPackage_HHD_tcPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure tcPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardDevicesInPackage_HHD_tcPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure dteXsPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_dteXsPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure dteXsPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardDevicesInPackage_HHD_dteXsPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure dteXsPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardDevicesInPackage_HHD_dteXsPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_Present in AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_phyXS_Present 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_Present in AQ_GlobalStandardDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardDevicesInPackage_HHD_phyXS_Present u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_Present in AQ_GlobalStandardDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardDevicesInPackage_HHD_phyXS_Present u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_pcsPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardDevicesInPackage_HHD_pcsPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardDevicesInPackage_HHD_pcsPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure wisPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_wisPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure wisPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardDevicesInPackage_HHD_wisPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure wisPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardDevicesInPackage_HHD_wisPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pmaPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_pmaPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardDevicesInPackage_HHD_pmaPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardDevicesInPackage_HHD_pmaPresent u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure clause_22RegistersPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define AQ_GlobalStandardDevicesInPackage_HHD_clause_22RegistersPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure clause_22RegistersPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardDevicesInPackage_HHD_clause_22RegistersPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure clause_22RegistersPresent in AQ_GlobalStandardDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardDevicesInPackage_HHD_clause_22RegistersPresent u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define AQ_GlobalStandardVendorDevicesInPackage_HHD_baseRegisterAddress 0x0006 -/*! \brief MMD address of structure AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define AQ_GlobalStandardVendorDevicesInPackage_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure vendorSpecificDevice_2Present in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define AQ_GlobalStandardVendorDevicesInPackage_HHD_vendorSpecificDevice_2Present 0 -/*! \brief Preprocessor variable to relate field to bit position in structure vendorSpecificDevice_2Present in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardVendorDevicesInPackage_HHD_vendorSpecificDevice_2Present u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure vendorSpecificDevice_2Present in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardVendorDevicesInPackage_HHD_vendorSpecificDevice_2Present u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure vendorSpecificDevice_1Present in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define AQ_GlobalStandardVendorDevicesInPackage_HHD_vendorSpecificDevice_1Present 0 -/*! \brief Preprocessor variable to relate field to bit position in structure vendorSpecificDevice_1Present in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardVendorDevicesInPackage_HHD_vendorSpecificDevice_1Present u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure vendorSpecificDevice_1Present in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardVendorDevicesInPackage_HHD_vendorSpecificDevice_1Present u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure clause_22ExtensionPresent in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define AQ_GlobalStandardVendorDevicesInPackage_HHD_clause_22ExtensionPresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure clause_22ExtensionPresent in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define bits_AQ_GlobalStandardVendorDevicesInPackage_HHD_clause_22ExtensionPresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure clause_22ExtensionPresent in AQ_GlobalStandardVendorDevicesInPackage_HHD */ -#define word_AQ_GlobalStandardVendorDevicesInPackage_HHD_clause_22ExtensionPresent u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalStandardStatus_2_HHD */ -#define AQ_GlobalStandardStatus_2_HHD_baseRegisterAddress 0x0008 -/*! \brief MMD address of structure AQ_GlobalStandardStatus_2_HHD */ -#define AQ_GlobalStandardStatus_2_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure devicePresent in AQ_GlobalStandardStatus_2_HHD */ -#define AQ_GlobalStandardStatus_2_HHD_devicePresent 0 -/*! \brief Preprocessor variable to relate field to bit position in structure devicePresent in AQ_GlobalStandardStatus_2_HHD */ -#define bits_AQ_GlobalStandardStatus_2_HHD_devicePresent u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure devicePresent in AQ_GlobalStandardStatus_2_HHD */ -#define word_AQ_GlobalStandardStatus_2_HHD_devicePresent u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalStandardPackageIdentifier_HHD */ -#define AQ_GlobalStandardPackageIdentifier_HHD_baseRegisterAddress 0x000E -/*! \brief MMD address of structure AQ_GlobalStandardPackageIdentifier_HHD */ -#define AQ_GlobalStandardPackageIdentifier_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure packageIdMSW in AQ_GlobalStandardPackageIdentifier_HHD */ -#define AQ_GlobalStandardPackageIdentifier_HHD_packageIdMSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure packageIdMSW in AQ_GlobalStandardPackageIdentifier_HHD */ -#define bits_AQ_GlobalStandardPackageIdentifier_HHD_packageIdMSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure packageIdMSW in AQ_GlobalStandardPackageIdentifier_HHD */ -#define word_AQ_GlobalStandardPackageIdentifier_HHD_packageIdMSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure packageIdLSW in AQ_GlobalStandardPackageIdentifier_HHD */ -#define AQ_GlobalStandardPackageIdentifier_HHD_packageIdLSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure packageIdLSW in AQ_GlobalStandardPackageIdentifier_HHD */ -#define bits_AQ_GlobalStandardPackageIdentifier_HHD_packageIdLSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure packageIdLSW in AQ_GlobalStandardPackageIdentifier_HHD */ -#define word_AQ_GlobalStandardPackageIdentifier_HHD_packageIdLSW u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalFirmwareID_HHD */ -#define AQ_GlobalFirmwareID_HHD_baseRegisterAddress 0x0020 -/*! \brief MMD address of structure AQ_GlobalFirmwareID_HHD */ -#define AQ_GlobalFirmwareID_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure firmwareMajorRevisionNumber in AQ_GlobalFirmwareID_HHD */ -#define AQ_GlobalFirmwareID_HHD_firmwareMajorRevisionNumber 0 -/*! \brief Preprocessor variable to relate field to bit position in structure firmwareMajorRevisionNumber in AQ_GlobalFirmwareID_HHD */ -#define bits_AQ_GlobalFirmwareID_HHD_firmwareMajorRevisionNumber u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure firmwareMajorRevisionNumber in AQ_GlobalFirmwareID_HHD */ -#define word_AQ_GlobalFirmwareID_HHD_firmwareMajorRevisionNumber u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure firmwareMinorRevisionNumber in AQ_GlobalFirmwareID_HHD */ -#define AQ_GlobalFirmwareID_HHD_firmwareMinorRevisionNumber 0 -/*! \brief Preprocessor variable to relate field to bit position in structure firmwareMinorRevisionNumber in AQ_GlobalFirmwareID_HHD */ -#define bits_AQ_GlobalFirmwareID_HHD_firmwareMinorRevisionNumber u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure firmwareMinorRevisionNumber in AQ_GlobalFirmwareID_HHD */ -#define word_AQ_GlobalFirmwareID_HHD_firmwareMinorRevisionNumber u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_baseRegisterAddress 0x0100 -/*! \brief MMD address of structure AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure nvrExecuteOperation in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrExecuteOperation 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrExecuteOperation in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrExecuteOperation u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrExecuteOperation in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrExecuteOperation u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrWriteMode in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrWriteMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrWriteMode in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrWriteMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrWriteMode in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrWriteMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure freezeNvrCrc in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_freezeNvrCrc 0 -/*! \brief Preprocessor variable to relate field to bit position in structure freezeNvrCrc in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_freezeNvrCrc u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure freezeNvrCrc in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_freezeNvrCrc u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure resetNvrCrc in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_resetNvrCrc 0 -/*! \brief Preprocessor variable to relate field to bit position in structure resetNvrCrc in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_resetNvrCrc u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure resetNvrCrc in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_resetNvrCrc u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrBurst in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrBurst 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrBurst in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrBurst u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrBurst in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrBurst u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrBusy in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrBusy 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrBusy in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrBusy u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrBusy in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrBusy u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrOpcode in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrOpcode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrOpcode in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrOpcode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrOpcode in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrOpcode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrMailboxCrc in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrMailboxCrc 1 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrMailboxCrc in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrMailboxCrc u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure nvrMailboxCrc in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrMailboxCrc u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrAddressMSW in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrAddressMSW 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrAddressMSW in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrAddressMSW u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrAddressMSW in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrAddressMSW u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure nvrAddressLSW in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrAddressLSW 3 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrAddressLSW in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrAddressLSW u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure nvrAddressLSW in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrAddressLSW u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDataMSW in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrDataMSW 4 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDataMSW in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrDataMSW u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDataMSW in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrDataMSW u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDataLSW in AQ_GlobalNvrInterface_HHD */ -#define AQ_GlobalNvrInterface_HHD_nvrDataLSW 5 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDataLSW in AQ_GlobalNvrInterface_HHD */ -#define bits_AQ_GlobalNvrInterface_HHD_nvrDataLSW u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDataLSW in AQ_GlobalNvrInterface_HHD */ -#define word_AQ_GlobalNvrInterface_HHD_nvrDataLSW u5.word_5 - -/*! \brief Base register address of structure AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_baseRegisterAddress 0x0200 -/*! \brief MMD address of structure AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxExecuteOperation in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxExecuteOperation 0 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxExecuteOperation in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxExecuteOperation u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxExecuteOperation in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxExecuteOperation u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxWriteMode in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxWriteMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxWriteMode in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxWriteMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxWriteMode in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxWriteMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure resetUpMailboxCrc in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_resetUpMailboxCrc 0 -/*! \brief Preprocessor variable to relate field to bit position in structure resetUpMailboxCrc in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_resetUpMailboxCrc u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure resetUpMailboxCrc in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_resetUpMailboxCrc u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxBusy in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxBusy 0 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxBusy in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxBusy u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxBusy in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxBusy u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxCrc in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxCrc 1 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxCrc in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxCrc u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxCrc in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxCrc u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxAddressMSW in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxAddressMSW 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxAddressMSW in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxAddressMSW u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxAddressMSW in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxAddressMSW u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxAddressLSW in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxAddressLSW 3 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxAddressLSW in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxAddressLSW u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxAddressLSW in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxAddressLSW u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxAddressLSW_Don_tCare in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxAddressLSW_Don_tCare 3 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxAddressLSW_Don_tCare in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxAddressLSW_Don_tCare u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxAddressLSW_Don_tCare in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxAddressLSW_Don_tCare u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxDataMSW in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxDataMSW 4 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxDataMSW in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxDataMSW u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxDataMSW in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxDataMSW u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxDataLSW in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxDataLSW 5 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxDataLSW in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxDataLSW u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxDataLSW in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxDataLSW u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure upMailboxCrcReadEnable in AQ_GlobalMailboxInterface_HHD */ -#define AQ_GlobalMailboxInterface_HHD_upMailboxCrcReadEnable 6 -/*! \brief Preprocessor variable to relate field to bit position in structure upMailboxCrcReadEnable in AQ_GlobalMailboxInterface_HHD */ -#define bits_AQ_GlobalMailboxInterface_HHD_upMailboxCrcReadEnable u6.bits_6 -/*! \brief Preprocessor variable to relate field to word position in structure upMailboxCrcReadEnable in AQ_GlobalMailboxInterface_HHD */ -#define word_AQ_GlobalMailboxInterface_HHD_upMailboxCrcReadEnable u6.word_6 - -/*! \brief Base register address of structure AQ_GlobalMicroprocessorScratchPad_HHD */ -#define AQ_GlobalMicroprocessorScratchPad_HHD_baseRegisterAddress 0x0300 -/*! \brief MMD address of structure AQ_GlobalMicroprocessorScratchPad_HHD */ -#define AQ_GlobalMicroprocessorScratchPad_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure scratchPad_1 in AQ_GlobalMicroprocessorScratchPad_HHD */ -#define AQ_GlobalMicroprocessorScratchPad_HHD_scratchPad_1 0 -/*! \brief Preprocessor variable to relate field to bit position in structure scratchPad_1 in AQ_GlobalMicroprocessorScratchPad_HHD */ -#define bits_AQ_GlobalMicroprocessorScratchPad_HHD_scratchPad_1 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure scratchPad_1 in AQ_GlobalMicroprocessorScratchPad_HHD */ -#define word_AQ_GlobalMicroprocessorScratchPad_HHD_scratchPad_1 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure scratchPad_2 in AQ_GlobalMicroprocessorScratchPad_HHD */ -#define AQ_GlobalMicroprocessorScratchPad_HHD_scratchPad_2 1 -/*! \brief Preprocessor variable to relate field to bit position in structure scratchPad_2 in AQ_GlobalMicroprocessorScratchPad_HHD */ -#define bits_AQ_GlobalMicroprocessorScratchPad_HHD_scratchPad_2 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure scratchPad_2 in AQ_GlobalMicroprocessorScratchPad_HHD */ -#define word_AQ_GlobalMicroprocessorScratchPad_HHD_scratchPad_2 u1.word_1 - -/*! \brief Base register address of structure AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_baseRegisterAddress 0x5002 -/*! \brief MMD address of structure AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressEthertypeExplicitSectagLsb in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressEthertypeExplicitSectagLsb 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressEthertypeExplicitSectagLsb in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressEthertypeExplicitSectagLsb u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressEthertypeExplicitSectagLsb in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressEthertypeExplicitSectagLsb u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressClearGlobalTime in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressClearGlobalTime 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressClearGlobalTime in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressClearGlobalTime u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressClearGlobalTime in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressClearGlobalTime u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressClearCounter in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressClearCounter 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressClearCounter in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressClearCounter u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressClearCounter in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressClearCounter u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressHighPriority in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressHighPriority 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressHighPriority in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressHighPriority u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressHighPriority in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressHighPriority u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressIcvLsb_8BytesEnable in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressIcvLsb_8BytesEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressIcvLsb_8BytesEnable in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressIcvLsb_8BytesEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressIcvLsb_8BytesEnable in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressIcvLsb_8BytesEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressExternalClassificationEnable in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressExternalClassificationEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressExternalClassificationEnable in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressExternalClassificationEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressExternalClassificationEnable in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressExternalClassificationEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressExplicitSectagReportShortLength in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressExplicitSectagReportShortLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressExplicitSectagReportShortLength in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressExplicitSectagReportShortLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressExplicitSectagReportShortLength in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressExplicitSectagReportShortLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressDropInvalidSa_scPackets in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressDropInvalidSa_scPackets 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressDropInvalidSa_scPackets in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressDropInvalidSa_scPackets u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressDropInvalidSa_scPackets in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressDropInvalidSa_scPackets u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressUnmatchedUseSc_0 in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressUnmatchedUseSc_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressUnmatchedUseSc_0 in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressUnmatchedUseSc_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressUnmatchedUseSc_0 in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressUnmatchedUseSc_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgresssGcmTestMode in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgresssGcmTestMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgresssGcmTestMode in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgresssGcmTestMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgresssGcmTestMode in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgresssGcmTestMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressGcmStart in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressGcmStart 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressGcmStart in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressGcmStart u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressGcmStart in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressGcmStart u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressDropEgprcLutMiss in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressDropEgprcLutMiss 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressDropEgprcLutMiss in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressDropEgprcLutMiss u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressDropEgprcLutMiss in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressDropEgprcLutMiss u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressDropKayPacket in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressDropKayPacket 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressDropKayPacket in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressDropKayPacket u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressDropKayPacket in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressDropKayPacket u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSoftReset in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressSoftReset 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSoftReset in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressSoftReset u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSoftReset in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressSoftReset u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressEthertypeExplicitSectagMsb in AQ_MssEgressControlRegister_HHD */ -#define AQ_MssEgressControlRegister_HHD_mssEgressEthertypeExplicitSectagMsb 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressEthertypeExplicitSectagMsb in AQ_MssEgressControlRegister_HHD */ -#define bits_AQ_MssEgressControlRegister_HHD_mssEgressEthertypeExplicitSectagMsb u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressEthertypeExplicitSectagMsb in AQ_MssEgressControlRegister_HHD */ -#define word_AQ_MssEgressControlRegister_HHD_mssEgressEthertypeExplicitSectagMsb u1.word_1 - -/*! \brief Base register address of structure AQ_MssEgressVlanTpid_0Register_HHD */ -#define AQ_MssEgressVlanTpid_0Register_HHD_baseRegisterAddress 0x5008 -/*! \brief MMD address of structure AQ_MssEgressVlanTpid_0Register_HHD */ -#define AQ_MssEgressVlanTpid_0Register_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanStagTpid in AQ_MssEgressVlanTpid_0Register_HHD */ -#define AQ_MssEgressVlanTpid_0Register_HHD_mssEgressVlanStagTpid 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanStagTpid in AQ_MssEgressVlanTpid_0Register_HHD */ -#define bits_AQ_MssEgressVlanTpid_0Register_HHD_mssEgressVlanStagTpid u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanStagTpid in AQ_MssEgressVlanTpid_0Register_HHD */ -#define word_AQ_MssEgressVlanTpid_0Register_HHD_mssEgressVlanStagTpid u0.word_0 - -/*! \brief Base register address of structure AQ_MssEgressVlanTpid_1Register_HHD */ -#define AQ_MssEgressVlanTpid_1Register_HHD_baseRegisterAddress 0x500A -/*! \brief MMD address of structure AQ_MssEgressVlanTpid_1Register_HHD */ -#define AQ_MssEgressVlanTpid_1Register_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanQtagTpid in AQ_MssEgressVlanTpid_1Register_HHD */ -#define AQ_MssEgressVlanTpid_1Register_HHD_mssEgressVlanQtagTpid 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanQtagTpid in AQ_MssEgressVlanTpid_1Register_HHD */ -#define bits_AQ_MssEgressVlanTpid_1Register_HHD_mssEgressVlanQtagTpid u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanQtagTpid in AQ_MssEgressVlanTpid_1Register_HHD */ -#define word_AQ_MssEgressVlanTpid_1Register_HHD_mssEgressVlanQtagTpid u0.word_0 - -/*! \brief Base register address of structure AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_baseRegisterAddress 0x500C -/*! \brief MMD address of structure AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanUpMapTable in AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpMapTable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanUpMapTable in AQ_MssEgressVlanControlRegister_HHD */ -#define bits_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpMapTable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanUpMapTable in AQ_MssEgressVlanControlRegister_HHD */ -#define word_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpMapTable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanQtagParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQtagParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanQtagParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define bits_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQtagParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanQtagParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define word_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQtagParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanStagParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanStagParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanStagParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define bits_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanStagParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanStagParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define word_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanStagParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanQinqParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQinqParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanQinqParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define bits_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQinqParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanQinqParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define word_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQinqParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanQtagUpParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQtagUpParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanQtagUpParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define bits_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQtagUpParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanQtagUpParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define word_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanQtagUpParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanStagUpParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanStagUpParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanStagUpParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define bits_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanStagUpParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanStagUpParseEnable in AQ_MssEgressVlanControlRegister_HHD */ -#define word_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanStagUpParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanUpDefault in AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpDefault 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanUpDefault in AQ_MssEgressVlanControlRegister_HHD */ -#define bits_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpDefault u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanUpDefault in AQ_MssEgressVlanControlRegister_HHD */ -#define word_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpDefault u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressVlanUpMapTableMSW in AQ_MssEgressVlanControlRegister_HHD */ -#define AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpMapTableMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressVlanUpMapTableMSW in AQ_MssEgressVlanControlRegister_HHD */ -#define bits_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpMapTableMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressVlanUpMapTableMSW in AQ_MssEgressVlanControlRegister_HHD */ -#define word_AQ_MssEgressVlanControlRegister_HHD_mssEgressVlanUpMapTableMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssEgressPnControlRegister_HHD */ -#define AQ_MssEgressPnControlRegister_HHD_baseRegisterAddress 0x500E -/*! \brief MMD address of structure AQ_MssEgressPnControlRegister_HHD */ -#define AQ_MssEgressPnControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaPnThresholdLSW in AQ_MssEgressPnControlRegister_HHD */ -#define AQ_MssEgressPnControlRegister_HHD_mssEgressSaPnThresholdLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaPnThresholdLSW in AQ_MssEgressPnControlRegister_HHD */ -#define bits_AQ_MssEgressPnControlRegister_HHD_mssEgressSaPnThresholdLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaPnThresholdLSW in AQ_MssEgressPnControlRegister_HHD */ -#define word_AQ_MssEgressPnControlRegister_HHD_mssEgressSaPnThresholdLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaPnThresholdMSW in AQ_MssEgressPnControlRegister_HHD */ -#define AQ_MssEgressPnControlRegister_HHD_mssEgressSaPnThresholdMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaPnThresholdMSW in AQ_MssEgressPnControlRegister_HHD */ -#define bits_AQ_MssEgressPnControlRegister_HHD_mssEgressSaPnThresholdMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaPnThresholdMSW in AQ_MssEgressPnControlRegister_HHD */ -#define word_AQ_MssEgressPnControlRegister_HHD_mssEgressSaPnThresholdMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssEgressMtuSizeControlRegister_HHD */ -#define AQ_MssEgressMtuSizeControlRegister_HHD_baseRegisterAddress 0x5010 -/*! \brief MMD address of structure AQ_MssEgressMtuSizeControlRegister_HHD */ -#define AQ_MssEgressMtuSizeControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressControlledPacketMtuSize in AQ_MssEgressMtuSizeControlRegister_HHD */ -#define AQ_MssEgressMtuSizeControlRegister_HHD_mssEgressControlledPacketMtuSize 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressControlledPacketMtuSize in AQ_MssEgressMtuSizeControlRegister_HHD */ -#define bits_AQ_MssEgressMtuSizeControlRegister_HHD_mssEgressControlledPacketMtuSize u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressControlledPacketMtuSize in AQ_MssEgressMtuSizeControlRegister_HHD */ -#define word_AQ_MssEgressMtuSizeControlRegister_HHD_mssEgressControlledPacketMtuSize u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressUncontrolledPacketMtuSize in AQ_MssEgressMtuSizeControlRegister_HHD */ -#define AQ_MssEgressMtuSizeControlRegister_HHD_mssEgressUncontrolledPacketMtuSize 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressUncontrolledPacketMtuSize in AQ_MssEgressMtuSizeControlRegister_HHD */ -#define bits_AQ_MssEgressMtuSizeControlRegister_HHD_mssEgressUncontrolledPacketMtuSize u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressUncontrolledPacketMtuSize in AQ_MssEgressMtuSizeControlRegister_HHD */ -#define word_AQ_MssEgressMtuSizeControlRegister_HHD_mssEgressUncontrolledPacketMtuSize u1.word_1 - -/*! \brief Base register address of structure AQ_MssEgressInterruptStatusRegister_HHD */ -#define AQ_MssEgressInterruptStatusRegister_HHD_baseRegisterAddress 0x505C -/*! \brief MMD address of structure AQ_MssEgressInterruptStatusRegister_HHD */ -#define AQ_MssEgressInterruptStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressEccErrorInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define AQ_MssEgressInterruptStatusRegister_HHD_mssEgressEccErrorInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressEccErrorInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define bits_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressEccErrorInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressEccErrorInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define word_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressEccErrorInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressMibSaturationInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define AQ_MssEgressInterruptStatusRegister_HHD_mssEgressMibSaturationInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressMibSaturationInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define bits_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressMibSaturationInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressMibSaturationInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define word_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressMibSaturationInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaThresholdExpiredInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define AQ_MssEgressInterruptStatusRegister_HHD_mssEgressSaThresholdExpiredInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaThresholdExpiredInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define bits_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressSaThresholdExpiredInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaThresholdExpiredInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define word_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressSaThresholdExpiredInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaExpiredInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define AQ_MssEgressInterruptStatusRegister_HHD_mssEgressSaExpiredInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaExpiredInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define bits_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressSaExpiredInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaExpiredInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define word_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressSaExpiredInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressMasterInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define AQ_MssEgressInterruptStatusRegister_HHD_mssEgressMasterInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressMasterInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define bits_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressMasterInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressMasterInterrupt in AQ_MssEgressInterruptStatusRegister_HHD */ -#define word_AQ_MssEgressInterruptStatusRegister_HHD_mssEgressMasterInterrupt u0.word_0 - -/*! \brief Base register address of structure AQ_MssEgressInterruptMaskRegister_HHD */ -#define AQ_MssEgressInterruptMaskRegister_HHD_baseRegisterAddress 0x505E -/*! \brief MMD address of structure AQ_MssEgressInterruptMaskRegister_HHD */ -#define AQ_MssEgressInterruptMaskRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressEccErrorInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define AQ_MssEgressInterruptMaskRegister_HHD_mssEgressEccErrorInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressEccErrorInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define bits_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressEccErrorInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressEccErrorInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define word_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressEccErrorInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressMibSaturationInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define AQ_MssEgressInterruptMaskRegister_HHD_mssEgressMibSaturationInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressMibSaturationInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define bits_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressMibSaturationInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressMibSaturationInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define word_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressMibSaturationInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaExpiredThresholdInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define AQ_MssEgressInterruptMaskRegister_HHD_mssEgressSaExpiredThresholdInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaExpiredThresholdInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define bits_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressSaExpiredThresholdInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaExpiredThresholdInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define word_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressSaExpiredThresholdInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaExpiredInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define AQ_MssEgressInterruptMaskRegister_HHD_mssEgressSaExpiredInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaExpiredInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define bits_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressSaExpiredInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaExpiredInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define word_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressSaExpiredInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressMasterInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define AQ_MssEgressInterruptMaskRegister_HHD_mssEgressMasterInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressMasterInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define bits_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressMasterInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressMasterInterruptEnable in AQ_MssEgressInterruptMaskRegister_HHD */ -#define word_AQ_MssEgressInterruptMaskRegister_HHD_mssEgressMasterInterruptEnable u0.word_0 - -/*! \brief Base register address of structure AQ_MssEgressSaExpiredStatusRegister_HHD */ -#define AQ_MssEgressSaExpiredStatusRegister_HHD_baseRegisterAddress 0x5060 -/*! \brief MMD address of structure AQ_MssEgressSaExpiredStatusRegister_HHD */ -#define AQ_MssEgressSaExpiredStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaExpiredLSW in AQ_MssEgressSaExpiredStatusRegister_HHD */ -#define AQ_MssEgressSaExpiredStatusRegister_HHD_mssEgressSaExpiredLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaExpiredLSW in AQ_MssEgressSaExpiredStatusRegister_HHD */ -#define bits_AQ_MssEgressSaExpiredStatusRegister_HHD_mssEgressSaExpiredLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaExpiredLSW in AQ_MssEgressSaExpiredStatusRegister_HHD */ -#define word_AQ_MssEgressSaExpiredStatusRegister_HHD_mssEgressSaExpiredLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaExpiredMSW in AQ_MssEgressSaExpiredStatusRegister_HHD */ -#define AQ_MssEgressSaExpiredStatusRegister_HHD_mssEgressSaExpiredMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaExpiredMSW in AQ_MssEgressSaExpiredStatusRegister_HHD */ -#define bits_AQ_MssEgressSaExpiredStatusRegister_HHD_mssEgressSaExpiredMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaExpiredMSW in AQ_MssEgressSaExpiredStatusRegister_HHD */ -#define word_AQ_MssEgressSaExpiredStatusRegister_HHD_mssEgressSaExpiredMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssEgressSaThresholdExpiredStatusRegister_HHD */ -#define AQ_MssEgressSaThresholdExpiredStatusRegister_HHD_baseRegisterAddress 0x5062 -/*! \brief MMD address of structure AQ_MssEgressSaThresholdExpiredStatusRegister_HHD */ -#define AQ_MssEgressSaThresholdExpiredStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaThresholdExpiredLSW in AQ_MssEgressSaThresholdExpiredStatusRegister_HHD */ -#define AQ_MssEgressSaThresholdExpiredStatusRegister_HHD_mssEgressSaThresholdExpiredLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaThresholdExpiredLSW in AQ_MssEgressSaThresholdExpiredStatusRegister_HHD */ -#define bits_AQ_MssEgressSaThresholdExpiredStatusRegister_HHD_mssEgressSaThresholdExpiredLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaThresholdExpiredLSW in AQ_MssEgressSaThresholdExpiredStatusRegister_HHD */ -#define word_AQ_MssEgressSaThresholdExpiredStatusRegister_HHD_mssEgressSaThresholdExpiredLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaThresholdExpiredMSW in AQ_MssEgressSaThresholdExpiredStatusRegister_HHD */ -#define AQ_MssEgressSaThresholdExpiredStatusRegister_HHD_mssEgressSaThresholdExpiredMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaThresholdExpiredMSW in AQ_MssEgressSaThresholdExpiredStatusRegister_HHD */ -#define bits_AQ_MssEgressSaThresholdExpiredStatusRegister_HHD_mssEgressSaThresholdExpiredMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaThresholdExpiredMSW in AQ_MssEgressSaThresholdExpiredStatusRegister_HHD */ -#define word_AQ_MssEgressSaThresholdExpiredStatusRegister_HHD_mssEgressSaThresholdExpiredMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssEgressEccInterruptStatusRegister_HHD */ -#define AQ_MssEgressEccInterruptStatusRegister_HHD_baseRegisterAddress 0x5064 -/*! \brief MMD address of structure AQ_MssEgressEccInterruptStatusRegister_HHD */ -#define AQ_MssEgressEccInterruptStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaEccErrorInterruptLSW in AQ_MssEgressEccInterruptStatusRegister_HHD */ -#define AQ_MssEgressEccInterruptStatusRegister_HHD_mssEgressSaEccErrorInterruptLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaEccErrorInterruptLSW in AQ_MssEgressEccInterruptStatusRegister_HHD */ -#define bits_AQ_MssEgressEccInterruptStatusRegister_HHD_mssEgressSaEccErrorInterruptLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaEccErrorInterruptLSW in AQ_MssEgressEccInterruptStatusRegister_HHD */ -#define word_AQ_MssEgressEccInterruptStatusRegister_HHD_mssEgressSaEccErrorInterruptLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressSaEccErrorInterruptMSW in AQ_MssEgressEccInterruptStatusRegister_HHD */ -#define AQ_MssEgressEccInterruptStatusRegister_HHD_mssEgressSaEccErrorInterruptMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressSaEccErrorInterruptMSW in AQ_MssEgressEccInterruptStatusRegister_HHD */ -#define bits_AQ_MssEgressEccInterruptStatusRegister_HHD_mssEgressSaEccErrorInterruptMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressSaEccErrorInterruptMSW in AQ_MssEgressEccInterruptStatusRegister_HHD */ -#define word_AQ_MssEgressEccInterruptStatusRegister_HHD_mssEgressSaEccErrorInterruptMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssEgressLutAddressControlRegister_HHD */ -#define AQ_MssEgressLutAddressControlRegister_HHD_baseRegisterAddress 0x5080 -/*! \brief MMD address of structure AQ_MssEgressLutAddressControlRegister_HHD */ -#define AQ_MssEgressLutAddressControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutSelect in AQ_MssEgressLutAddressControlRegister_HHD */ -#define AQ_MssEgressLutAddressControlRegister_HHD_mssEgressLutSelect 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutSelect in AQ_MssEgressLutAddressControlRegister_HHD */ -#define bits_AQ_MssEgressLutAddressControlRegister_HHD_mssEgressLutSelect u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutSelect in AQ_MssEgressLutAddressControlRegister_HHD */ -#define word_AQ_MssEgressLutAddressControlRegister_HHD_mssEgressLutSelect u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutAddress in AQ_MssEgressLutAddressControlRegister_HHD */ -#define AQ_MssEgressLutAddressControlRegister_HHD_mssEgressLutAddress 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutAddress in AQ_MssEgressLutAddressControlRegister_HHD */ -#define bits_AQ_MssEgressLutAddressControlRegister_HHD_mssEgressLutAddress u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutAddress in AQ_MssEgressLutAddressControlRegister_HHD */ -#define word_AQ_MssEgressLutAddressControlRegister_HHD_mssEgressLutAddress u0.word_0 - -/*! \brief Base register address of structure AQ_MssEgressLutControlRegister_HHD */ -#define AQ_MssEgressLutControlRegister_HHD_baseRegisterAddress 0x5081 -/*! \brief MMD address of structure AQ_MssEgressLutControlRegister_HHD */ -#define AQ_MssEgressLutControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutWrite in AQ_MssEgressLutControlRegister_HHD */ -#define AQ_MssEgressLutControlRegister_HHD_mssEgressLutWrite 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutWrite in AQ_MssEgressLutControlRegister_HHD */ -#define bits_AQ_MssEgressLutControlRegister_HHD_mssEgressLutWrite u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutWrite in AQ_MssEgressLutControlRegister_HHD */ -#define word_AQ_MssEgressLutControlRegister_HHD_mssEgressLutWrite u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutRead in AQ_MssEgressLutControlRegister_HHD */ -#define AQ_MssEgressLutControlRegister_HHD_mssEgressLutRead 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutRead in AQ_MssEgressLutControlRegister_HHD */ -#define bits_AQ_MssEgressLutControlRegister_HHD_mssEgressLutRead u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutRead in AQ_MssEgressLutControlRegister_HHD */ -#define word_AQ_MssEgressLutControlRegister_HHD_mssEgressLutRead u0.word_0 - -/*! \brief Base register address of structure AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_baseRegisterAddress 0x50A0 -/*! \brief MMD address of structure AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_0 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_0 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_0 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_1 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_1 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_1 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_1 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_2 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_2 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_2 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_2 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_2 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_2 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_3 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_3 3 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_3 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_3 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_3 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_3 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_4 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_4 4 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_4 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_4 u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_4 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_4 u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_5 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_5 5 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_5 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_5 u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_5 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_5 u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_6 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_6 6 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_6 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_6 u6.bits_6 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_6 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_6 u6.word_6 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_7 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_7 7 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_7 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_7 u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_7 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_7 u7.word_7 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_8 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_8 8 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_8 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_8 u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_8 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_8 u8.word_8 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_9 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_9 9 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_9 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_9 u9.bits_9 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_9 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_9 u9.word_9 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_10 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_10 10 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_10 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_10 u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_10 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_10 u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_11 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_11 11 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_11 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_11 u11.bits_11 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_11 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_11 u11.word_11 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_12 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_12 12 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_12 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_12 u12.bits_12 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_12 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_12 u12.word_12 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_13 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_13 13 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_13 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_13 u13.bits_13 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_13 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_13 u13.word_13 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_14 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_14 14 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_14 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_14 u14.bits_14 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_14 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_14 u14.word_14 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_15 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_15 15 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_15 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_15 u15.bits_15 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_15 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_15 u15.word_15 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_16 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_16 16 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_16 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_16 u16.bits_16 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_16 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_16 u16.word_16 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_17 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_17 17 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_17 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_17 u17.bits_17 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_17 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_17 u17.word_17 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_18 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_18 18 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_18 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_18 u18.bits_18 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_18 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_18 u18.word_18 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_19 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_19 19 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_19 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_19 u19.bits_19 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_19 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_19 u19.word_19 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_20 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_20 20 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_20 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_20 u20.bits_20 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_20 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_20 u20.word_20 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_21 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_21 21 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_21 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_21 u21.bits_21 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_21 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_21 u21.word_21 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_22 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_22 22 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_22 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_22 u22.bits_22 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_22 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_22 u22.word_22 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_23 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_23 23 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_23 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_23 u23.bits_23 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_23 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_23 u23.word_23 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_24 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_24 24 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_24 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_24 u24.bits_24 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_24 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_24 u24.word_24 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_25 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_25 25 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_25 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_25 u25.bits_25 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_25 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_25 u25.word_25 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_26 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_26 26 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_26 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_26 u26.bits_26 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_26 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_26 u26.word_26 -/*! \brief Preprocessor variable to relate field to word number in structure mssEgressLutData_27 in AQ_MssEgressLutDataControlRegister_HHD */ -#define AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_27 27 -/*! \brief Preprocessor variable to relate field to bit position in structure mssEgressLutData_27 in AQ_MssEgressLutDataControlRegister_HHD */ -#define bits_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_27 u27.bits_27 -/*! \brief Preprocessor variable to relate field to word position in structure mssEgressLutData_27 in AQ_MssEgressLutDataControlRegister_HHD */ -#define word_AQ_MssEgressLutDataControlRegister_HHD_mssEgressLutData_27 u27.word_27 - -/*! \brief Base register address of structure AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_baseRegisterAddress 0x6004 -/*! \brief MMD address of structure AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemPhyTxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPhyTxEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemPhyTxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPhyTxEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemPhyTxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPhyTxEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxErrorDiscard in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemRxErrorDiscard 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxErrorDiscard in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemRxErrorDiscard u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxErrorDiscard in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemRxErrorDiscard u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemControlFrameEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemControlFrameEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemControlFrameEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemControlFrameEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemControlFrameEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemControlFrameEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemSoftReset in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemSoftReset 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemSoftReset in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemSoftReset u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemSoftReset in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemSoftReset u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxPadEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxPadEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxPadEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxPadEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxPadEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxPadEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxCrcAppend in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxCrcAppend 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxCrcAppend in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxCrcAppend u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxCrcAppend in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxCrcAppend u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxAddressInsertEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxAddressInsertEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxAddressInsertEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxAddressInsertEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxAddressInsertEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxAddressInsertEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemPauseIgnore in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPauseIgnore 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemPauseIgnore in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPauseIgnore u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemPauseIgnore in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPauseIgnore u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemPauseForward in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPauseForward 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemPauseForward in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPauseForward u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemPauseForward in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPauseForward u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemCrcForward in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemCrcForward 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemCrcForward in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemCrcForward u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemCrcForward in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemCrcForward u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemPadEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPadEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemPadEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPadEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemPadEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPadEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemPromiscuousMode in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPromiscuousMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemPromiscuousMode in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPromiscuousMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemPromiscuousMode in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPromiscuousMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemWanMode in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemWanMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemWanMode in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemWanMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemWanMode in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemWanMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemRxEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemRxEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemRxEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxLowPowerIdleEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxLowPowerIdleEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxLowPowerIdleEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxLowPowerIdleEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxLowPowerIdleEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemTxLowPowerIdleEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemSfdCheckDisable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemSfdCheckDisable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemSfdCheckDisable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemSfdCheckDisable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemSfdCheckDisable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemSfdCheckDisable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemPriorityFlowControlEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPriorityFlowControlEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemPriorityFlowControlEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPriorityFlowControlEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemPriorityFlowControlEnable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemPriorityFlowControlEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemIdleColumnCountExtend in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemIdleColumnCountExtend 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemIdleColumnCountExtend in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemIdleColumnCountExtend u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemIdleColumnCountExtend in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemIdleColumnCountExtend u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemLengthCheckDisable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemLengthCheckDisable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemLengthCheckDisable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemLengthCheckDisable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemLengthCheckDisable in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemLengthCheckDisable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemForceSendIdle in AQ_MsmSystemGeneralControlRegister_HHD */ -#define AQ_MsmSystemGeneralControlRegister_HHD_msmSystemForceSendIdle 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemForceSendIdle in AQ_MsmSystemGeneralControlRegister_HHD */ -#define bits_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemForceSendIdle u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemForceSendIdle in AQ_MsmSystemGeneralControlRegister_HHD */ -#define word_AQ_MsmSystemGeneralControlRegister_HHD_msmSystemForceSendIdle u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_baseRegisterAddress 0x600E -/*! \brief MMD address of structure AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxFifoFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoFullThreshold 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxFifoFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define bits_AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoFullThreshold u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxFifoFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define word_AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoFullThreshold u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxFifoEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoEmptyThreshold 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxFifoEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define bits_AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoEmptyThreshold u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxFifoEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define word_AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoEmptyThreshold u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxFifoFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoFullThreshold 2 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxFifoFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define bits_AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoFullThreshold u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxFifoFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define word_AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoFullThreshold u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxFifoEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoEmptyThreshold 3 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxFifoEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define bits_AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoEmptyThreshold u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxFifoEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define word_AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoEmptyThreshold u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxFifoAlmostFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoAlmostFullThreshold 4 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxFifoAlmostFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define bits_AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoAlmostFullThreshold u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxFifoAlmostFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define word_AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoAlmostFullThreshold u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxFifoAlmostEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoAlmostEmptyThreshold 5 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxFifoAlmostEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define bits_AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoAlmostEmptyThreshold u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxFifoAlmostEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define word_AQ_MsmSystemFifoControlRegister_HHD_msmSystemRxFifoAlmostEmptyThreshold u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxFifoAlmostFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoAlmostFullThreshold 6 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxFifoAlmostFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define bits_AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoAlmostFullThreshold u6.bits_6 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxFifoAlmostFullThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define word_AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoAlmostFullThreshold u6.word_6 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxFifoAlmostEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoAlmostEmptyThreshold 7 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxFifoAlmostEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define bits_AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoAlmostEmptyThreshold u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxFifoAlmostEmptyThreshold in AQ_MsmSystemFifoControlRegister_HHD */ -#define word_AQ_MsmSystemFifoControlRegister_HHD_msmSystemTxFifoAlmostEmptyThreshold u7.word_7 - -/*! \brief Base register address of structure AQ_MsmSystemGeneralStatusRegister_HHD */ -#define AQ_MsmSystemGeneralStatusRegister_HHD_baseRegisterAddress 0x6020 -/*! \brief MMD address of structure AQ_MsmSystemGeneralStatusRegister_HHD */ -#define AQ_MsmSystemGeneralStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxFifoEmpty in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemTxFifoEmpty 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxFifoEmpty in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define bits_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemTxFifoEmpty u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxFifoEmpty in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define word_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemTxFifoEmpty u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxLowPowerIdle in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxLowPowerIdle 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxLowPowerIdle in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define bits_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxLowPowerIdle u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxLowPowerIdle in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define word_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxLowPowerIdle u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTimestampAvailable in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemTimestampAvailable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTimestampAvailable in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define bits_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemTimestampAvailable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTimestampAvailable in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define word_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemTimestampAvailable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemPhyLossOfSignal in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemPhyLossOfSignal 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemPhyLossOfSignal in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define bits_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemPhyLossOfSignal u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemPhyLossOfSignal in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define word_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemPhyLossOfSignal u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxRemoteFault in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxRemoteFault 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxRemoteFault in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define bits_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxRemoteFault u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxRemoteFault in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define word_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxRemoteFault u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxLocalFault in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxLocalFault 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxLocalFault in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define bits_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxLocalFault u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxLocalFault in AQ_MsmSystemGeneralStatusRegister_HHD */ -#define word_AQ_MsmSystemGeneralStatusRegister_HHD_msmSystemRxLocalFault u0.word_0 - -/*! \brief Base register address of structure AQ_MsmSystemTxIpgControlRegister_HHD */ -#define AQ_MsmSystemTxIpgControlRegister_HHD_baseRegisterAddress 0x6022 -/*! \brief MMD address of structure AQ_MsmSystemTxIpgControlRegister_HHD */ -#define AQ_MsmSystemTxIpgControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxIpgLength in AQ_MsmSystemTxIpgControlRegister_HHD */ -#define AQ_MsmSystemTxIpgControlRegister_HHD_msmSystemTxIpgLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxIpgLength in AQ_MsmSystemTxIpgControlRegister_HHD */ -#define bits_AQ_MsmSystemTxIpgControlRegister_HHD_msmSystemTxIpgLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxIpgLength in AQ_MsmSystemTxIpgControlRegister_HHD */ -#define word_AQ_MsmSystemTxIpgControlRegister_HHD_msmSystemTxIpgLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxIpgReserved in AQ_MsmSystemTxIpgControlRegister_HHD */ -#define AQ_MsmSystemTxIpgControlRegister_HHD_msmSystemTxIpgReserved 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxIpgReserved in AQ_MsmSystemTxIpgControlRegister_HHD */ -#define bits_AQ_MsmSystemTxIpgControlRegister_HHD_msmSystemTxIpgReserved u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxIpgReserved in AQ_MsmSystemTxIpgControlRegister_HHD */ -#define word_AQ_MsmSystemTxIpgControlRegister_HHD_msmSystemTxIpgReserved u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemTxGoodFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxGoodFramesCounterRegister_HHD_baseRegisterAddress 0x6040 -/*! \brief MMD address of structure AQ_MsmSystemTxGoodFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxGoodFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxGoodFramesCounter_0 in AQ_MsmSystemTxGoodFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxGoodFramesCounterRegister_HHD_msmSystemTxGoodFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxGoodFramesCounter_0 in AQ_MsmSystemTxGoodFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxGoodFramesCounterRegister_HHD_msmSystemTxGoodFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxGoodFramesCounter_0 in AQ_MsmSystemTxGoodFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxGoodFramesCounterRegister_HHD_msmSystemTxGoodFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxGoodFramesCounter_1 in AQ_MsmSystemTxGoodFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxGoodFramesCounterRegister_HHD_msmSystemTxGoodFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxGoodFramesCounter_1 in AQ_MsmSystemTxGoodFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxGoodFramesCounterRegister_HHD_msmSystemTxGoodFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxGoodFramesCounter_1 in AQ_MsmSystemTxGoodFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxGoodFramesCounterRegister_HHD_msmSystemTxGoodFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxGoodFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxGoodFramesCounterRegister_HHD_baseRegisterAddress 0x6044 -/*! \brief MMD address of structure AQ_MsmSystemRxGoodFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxGoodFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxGoodFramesCounter_0 in AQ_MsmSystemRxGoodFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxGoodFramesCounterRegister_HHD_msmSystemRxGoodFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxGoodFramesCounter_0 in AQ_MsmSystemRxGoodFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxGoodFramesCounterRegister_HHD_msmSystemRxGoodFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxGoodFramesCounter_0 in AQ_MsmSystemRxGoodFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxGoodFramesCounterRegister_HHD_msmSystemRxGoodFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxGoodFramesCounter_1 in AQ_MsmSystemRxGoodFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxGoodFramesCounterRegister_HHD_msmSystemRxGoodFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxGoodFramesCounter_1 in AQ_MsmSystemRxGoodFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxGoodFramesCounterRegister_HHD_msmSystemRxGoodFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxGoodFramesCounter_1 in AQ_MsmSystemRxGoodFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxGoodFramesCounterRegister_HHD_msmSystemRxGoodFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxFcsErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxFcsErrorsCounterRegister_HHD_baseRegisterAddress 0x6048 -/*! \brief MMD address of structure AQ_MsmSystemRxFcsErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxFcsErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemFcsErrorCounter_0 in AQ_MsmSystemRxFcsErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxFcsErrorsCounterRegister_HHD_msmSystemFcsErrorCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemFcsErrorCounter_0 in AQ_MsmSystemRxFcsErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxFcsErrorsCounterRegister_HHD_msmSystemFcsErrorCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemFcsErrorCounter_0 in AQ_MsmSystemRxFcsErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxFcsErrorsCounterRegister_HHD_msmSystemFcsErrorCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemFcsErrorCounter_1 in AQ_MsmSystemRxFcsErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxFcsErrorsCounterRegister_HHD_msmSystemFcsErrorCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemFcsErrorCounter_1 in AQ_MsmSystemRxFcsErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxFcsErrorsCounterRegister_HHD_msmSystemFcsErrorCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemFcsErrorCounter_1 in AQ_MsmSystemRxFcsErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxFcsErrorsCounterRegister_HHD_msmSystemFcsErrorCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD_baseRegisterAddress 0x604C -/*! \brief MMD address of structure AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemAlignmentErrorCounter_0 in AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD_msmSystemAlignmentErrorCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemAlignmentErrorCounter_0 in AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD_msmSystemAlignmentErrorCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemAlignmentErrorCounter_0 in AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD_msmSystemAlignmentErrorCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemAlignmentErrorCounter_1 in AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD_msmSystemAlignmentErrorCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemAlignmentErrorCounter_1 in AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD_msmSystemAlignmentErrorCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemAlignmentErrorCounter_1 in AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD_msmSystemAlignmentErrorCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemTxPauseFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxPauseFramesCounterRegister_HHD_baseRegisterAddress 0x6050 -/*! \brief MMD address of structure AQ_MsmSystemTxPauseFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxPauseFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxPauseFramesCounter_0 in AQ_MsmSystemTxPauseFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxPauseFramesCounterRegister_HHD_msmSystemTxPauseFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxPauseFramesCounter_0 in AQ_MsmSystemTxPauseFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxPauseFramesCounterRegister_HHD_msmSystemTxPauseFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxPauseFramesCounter_0 in AQ_MsmSystemTxPauseFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxPauseFramesCounterRegister_HHD_msmSystemTxPauseFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxPauseFramesCounter_1 in AQ_MsmSystemTxPauseFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxPauseFramesCounterRegister_HHD_msmSystemTxPauseFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxPauseFramesCounter_1 in AQ_MsmSystemTxPauseFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxPauseFramesCounterRegister_HHD_msmSystemTxPauseFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxPauseFramesCounter_1 in AQ_MsmSystemTxPauseFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxPauseFramesCounterRegister_HHD_msmSystemTxPauseFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxPauseFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxPauseFramesCounterRegister_HHD_baseRegisterAddress 0x6054 -/*! \brief MMD address of structure AQ_MsmSystemRxPauseFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxPauseFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxPauseFramesCounter_0 in AQ_MsmSystemRxPauseFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxPauseFramesCounterRegister_HHD_msmSystemRxPauseFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxPauseFramesCounter_0 in AQ_MsmSystemRxPauseFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxPauseFramesCounterRegister_HHD_msmSystemRxPauseFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxPauseFramesCounter_0 in AQ_MsmSystemRxPauseFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxPauseFramesCounterRegister_HHD_msmSystemRxPauseFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxPauseFramesCounter_1 in AQ_MsmSystemRxPauseFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxPauseFramesCounterRegister_HHD_msmSystemRxPauseFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxPauseFramesCounter_1 in AQ_MsmSystemRxPauseFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxPauseFramesCounterRegister_HHD_msmSystemRxPauseFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxPauseFramesCounter_1 in AQ_MsmSystemRxPauseFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxPauseFramesCounterRegister_HHD_msmSystemRxPauseFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD_baseRegisterAddress 0x6058 -/*! \brief MMD address of structure AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxTooLongErrorsCounter_0 in AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD_msmSystemRxTooLongErrorsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxTooLongErrorsCounter_0 in AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD_msmSystemRxTooLongErrorsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxTooLongErrorsCounter_0 in AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD_msmSystemRxTooLongErrorsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxTooLongErrorsCounter_1 in AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD_msmSystemRxTooLongErrorsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxTooLongErrorsCounter_1 in AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD_msmSystemRxTooLongErrorsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxTooLongErrorsCounter_1 in AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD_msmSystemRxTooLongErrorsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD_baseRegisterAddress 0x605C -/*! \brief MMD address of structure AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxInRangeLengthErrorsCounter_0 in AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD_msmSystemRxInRangeLengthErrorsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxInRangeLengthErrorsCounter_0 in AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD_msmSystemRxInRangeLengthErrorsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxInRangeLengthErrorsCounter_0 in AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD_msmSystemRxInRangeLengthErrorsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxInRangeLengthErrorsCounter_1 in AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD_msmSystemRxInRangeLengthErrorsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxInRangeLengthErrorsCounter_1 in AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD_msmSystemRxInRangeLengthErrorsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxInRangeLengthErrorsCounter_1 in AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD_msmSystemRxInRangeLengthErrorsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemTxVlanFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxVlanFramesCounterRegister_HHD_baseRegisterAddress 0x6060 -/*! \brief MMD address of structure AQ_MsmSystemTxVlanFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxVlanFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxVlanFramesCounter_0 in AQ_MsmSystemTxVlanFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxVlanFramesCounterRegister_HHD_msmSystemTxVlanFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxVlanFramesCounter_0 in AQ_MsmSystemTxVlanFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxVlanFramesCounterRegister_HHD_msmSystemTxVlanFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxVlanFramesCounter_0 in AQ_MsmSystemTxVlanFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxVlanFramesCounterRegister_HHD_msmSystemTxVlanFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxVlanFramesCounter_1 in AQ_MsmSystemTxVlanFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxVlanFramesCounterRegister_HHD_msmSystemTxVlanFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxVlanFramesCounter_1 in AQ_MsmSystemTxVlanFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxVlanFramesCounterRegister_HHD_msmSystemTxVlanFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxVlanFramesCounter_1 in AQ_MsmSystemTxVlanFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxVlanFramesCounterRegister_HHD_msmSystemTxVlanFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxVlanFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxVlanFramesCounterRegister_HHD_baseRegisterAddress 0x6064 -/*! \brief MMD address of structure AQ_MsmSystemRxVlanFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxVlanFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxVlanFramesCounter_0 in AQ_MsmSystemRxVlanFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxVlanFramesCounterRegister_HHD_msmSystemRxVlanFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxVlanFramesCounter_0 in AQ_MsmSystemRxVlanFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxVlanFramesCounterRegister_HHD_msmSystemRxVlanFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxVlanFramesCounter_0 in AQ_MsmSystemRxVlanFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxVlanFramesCounterRegister_HHD_msmSystemRxVlanFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxVlanFramesCounter_1 in AQ_MsmSystemRxVlanFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxVlanFramesCounterRegister_HHD_msmSystemRxVlanFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxVlanFramesCounter_1 in AQ_MsmSystemRxVlanFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxVlanFramesCounterRegister_HHD_msmSystemRxVlanFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxVlanFramesCounter_1 in AQ_MsmSystemRxVlanFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxVlanFramesCounterRegister_HHD_msmSystemRxVlanFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemTxOctetsCounterRegister_HHD_baseRegisterAddress 0x6068 -/*! \brief MMD address of structure AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemTxOctetsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxOctetsCounter_0 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxOctetsCounter_0 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxOctetsCounter_0 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define word_AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxOctetsCounter_1 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxOctetsCounter_1 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxOctetsCounter_1 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define word_AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_1 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxOctetsCounter_2 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_2 2 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxOctetsCounter_2 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_2 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxOctetsCounter_2 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define word_AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_2 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxOctetsCounter_3 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_3 3 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxOctetsCounter_3 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_3 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxOctetsCounter_3 in AQ_MsmSystemTxOctetsCounterRegister_HHD */ -#define word_AQ_MsmSystemTxOctetsCounterRegister_HHD_msmSystemTxOctetsCounter_3 u3.word_3 - -/*! \brief Base register address of structure AQ_MsmSystemRxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemRxOctetsCounterRegister_HHD_baseRegisterAddress 0x606C -/*! \brief MMD address of structure AQ_MsmSystemRxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemRxOctetsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxOctetsCounter_0 in AQ_MsmSystemRxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemRxOctetsCounterRegister_HHD_msmSystemRxOctetsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxOctetsCounter_0 in AQ_MsmSystemRxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxOctetsCounterRegister_HHD_msmSystemRxOctetsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxOctetsCounter_0 in AQ_MsmSystemRxOctetsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxOctetsCounterRegister_HHD_msmSystemRxOctetsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxOctetsCounter_1 in AQ_MsmSystemRxOctetsCounterRegister_HHD */ -#define AQ_MsmSystemRxOctetsCounterRegister_HHD_msmSystemRxOctetsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxOctetsCounter_1 in AQ_MsmSystemRxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxOctetsCounterRegister_HHD_msmSystemRxOctetsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxOctetsCounter_1 in AQ_MsmSystemRxOctetsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxOctetsCounterRegister_HHD_msmSystemRxOctetsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxUnicastFramesCounterRegister_HHD_baseRegisterAddress 0x6070 -/*! \brief MMD address of structure AQ_MsmSystemRxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxUnicastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxUnicastFramesCounter_0 in AQ_MsmSystemRxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxUnicastFramesCounterRegister_HHD_msmSystemRxUnicastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxUnicastFramesCounter_0 in AQ_MsmSystemRxUnicastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxUnicastFramesCounterRegister_HHD_msmSystemRxUnicastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxUnicastFramesCounter_0 in AQ_MsmSystemRxUnicastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxUnicastFramesCounterRegister_HHD_msmSystemRxUnicastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxUnicastFramesCounter_1 in AQ_MsmSystemRxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxUnicastFramesCounterRegister_HHD_msmSystemRxUnicastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxUnicastFramesCounter_1 in AQ_MsmSystemRxUnicastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxUnicastFramesCounterRegister_HHD_msmSystemRxUnicastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxUnicastFramesCounter_1 in AQ_MsmSystemRxUnicastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxUnicastFramesCounterRegister_HHD_msmSystemRxUnicastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxMulticastFramesCounterRegister_HHD_baseRegisterAddress 0x6074 -/*! \brief MMD address of structure AQ_MsmSystemRxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxMulticastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxMulticastFramesCounter_0 in AQ_MsmSystemRxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxMulticastFramesCounterRegister_HHD_msmSystemRxMulticastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxMulticastFramesCounter_0 in AQ_MsmSystemRxMulticastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxMulticastFramesCounterRegister_HHD_msmSystemRxMulticastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxMulticastFramesCounter_0 in AQ_MsmSystemRxMulticastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxMulticastFramesCounterRegister_HHD_msmSystemRxMulticastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxMulticastFramesCounter_1 in AQ_MsmSystemRxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxMulticastFramesCounterRegister_HHD_msmSystemRxMulticastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxMulticastFramesCounter_1 in AQ_MsmSystemRxMulticastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxMulticastFramesCounterRegister_HHD_msmSystemRxMulticastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxMulticastFramesCounter_1 in AQ_MsmSystemRxMulticastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxMulticastFramesCounterRegister_HHD_msmSystemRxMulticastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD_baseRegisterAddress 0x6078 -/*! \brief MMD address of structure AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxBroadcastFramesCounter_0 in AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD_msmSystemRxBroadcastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxBroadcastFramesCounter_0 in AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD_msmSystemRxBroadcastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxBroadcastFramesCounter_0 in AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD_msmSystemRxBroadcastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxBroadcastFramesCounter_1 in AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD_msmSystemRxBroadcastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxBroadcastFramesCounter_1 in AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD_msmSystemRxBroadcastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxBroadcastFramesCounter_1 in AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD_msmSystemRxBroadcastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemTxErrorsCounterRegister_HHD */ -#define AQ_MsmSystemTxErrorsCounterRegister_HHD_baseRegisterAddress 0x607C -/*! \brief MMD address of structure AQ_MsmSystemTxErrorsCounterRegister_HHD */ -#define AQ_MsmSystemTxErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxErrorsCounter_0 in AQ_MsmSystemTxErrorsCounterRegister_HHD */ -#define AQ_MsmSystemTxErrorsCounterRegister_HHD_msmSystemTxErrorsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxErrorsCounter_0 in AQ_MsmSystemTxErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxErrorsCounterRegister_HHD_msmSystemTxErrorsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxErrorsCounter_0 in AQ_MsmSystemTxErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemTxErrorsCounterRegister_HHD_msmSystemTxErrorsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxErrorsCounter_1 in AQ_MsmSystemTxErrorsCounterRegister_HHD */ -#define AQ_MsmSystemTxErrorsCounterRegister_HHD_msmSystemTxErrorsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxErrorsCounter_1 in AQ_MsmSystemTxErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxErrorsCounterRegister_HHD_msmSystemTxErrorsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxErrorsCounter_1 in AQ_MsmSystemTxErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemTxErrorsCounterRegister_HHD_msmSystemTxErrorsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemTxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxUnicastFramesCounterRegister_HHD_baseRegisterAddress 0x6084 -/*! \brief MMD address of structure AQ_MsmSystemTxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxUnicastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxUnicastFramesCounter_0 in AQ_MsmSystemTxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxUnicastFramesCounterRegister_HHD_msmSystemTxUnicastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxUnicastFramesCounter_0 in AQ_MsmSystemTxUnicastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxUnicastFramesCounterRegister_HHD_msmSystemTxUnicastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxUnicastFramesCounter_0 in AQ_MsmSystemTxUnicastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxUnicastFramesCounterRegister_HHD_msmSystemTxUnicastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxUnicastFramesCounter_1 in AQ_MsmSystemTxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxUnicastFramesCounterRegister_HHD_msmSystemTxUnicastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxUnicastFramesCounter_1 in AQ_MsmSystemTxUnicastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxUnicastFramesCounterRegister_HHD_msmSystemTxUnicastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxUnicastFramesCounter_1 in AQ_MsmSystemTxUnicastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxUnicastFramesCounterRegister_HHD_msmSystemTxUnicastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemTxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxMulticastFramesCounterRegister_HHD_baseRegisterAddress 0x6088 -/*! \brief MMD address of structure AQ_MsmSystemTxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxMulticastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxMulticastFramesCounter_0 in AQ_MsmSystemTxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxMulticastFramesCounterRegister_HHD_msmSystemTxMulticastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxMulticastFramesCounter_0 in AQ_MsmSystemTxMulticastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxMulticastFramesCounterRegister_HHD_msmSystemTxMulticastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxMulticastFramesCounter_0 in AQ_MsmSystemTxMulticastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxMulticastFramesCounterRegister_HHD_msmSystemTxMulticastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxMulticastFramesCounter_1 in AQ_MsmSystemTxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxMulticastFramesCounterRegister_HHD_msmSystemTxMulticastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxMulticastFramesCounter_1 in AQ_MsmSystemTxMulticastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxMulticastFramesCounterRegister_HHD_msmSystemTxMulticastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxMulticastFramesCounter_1 in AQ_MsmSystemTxMulticastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxMulticastFramesCounterRegister_HHD_msmSystemTxMulticastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD_baseRegisterAddress 0x608C -/*! \brief MMD address of structure AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxBroadcastFramesCounter_0 in AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD_msmSystemTxBroadcastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxBroadcastFramesCounter_0 in AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD_msmSystemTxBroadcastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxBroadcastFramesCounter_0 in AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD_msmSystemTxBroadcastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemTxBroadcastFramesCounter_1 in AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD_msmSystemTxBroadcastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemTxBroadcastFramesCounter_1 in AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD */ -#define bits_AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD_msmSystemTxBroadcastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemTxBroadcastFramesCounter_1 in AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD */ -#define word_AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD_msmSystemTxBroadcastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmSystemRxErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxErrorsCounterRegister_HHD_baseRegisterAddress 0x60C8 -/*! \brief MMD address of structure AQ_MsmSystemRxErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxErrorsCounter_0 in AQ_MsmSystemRxErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxErrorsCounterRegister_HHD_msmSystemRxErrorsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxErrorsCounter_0 in AQ_MsmSystemRxErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxErrorsCounterRegister_HHD_msmSystemRxErrorsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxErrorsCounter_0 in AQ_MsmSystemRxErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxErrorsCounterRegister_HHD_msmSystemRxErrorsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmSystemRxErrorsCounter_1 in AQ_MsmSystemRxErrorsCounterRegister_HHD */ -#define AQ_MsmSystemRxErrorsCounterRegister_HHD_msmSystemRxErrorsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmSystemRxErrorsCounter_1 in AQ_MsmSystemRxErrorsCounterRegister_HHD */ -#define bits_AQ_MsmSystemRxErrorsCounterRegister_HHD_msmSystemRxErrorsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmSystemRxErrorsCounter_1 in AQ_MsmSystemRxErrorsCounterRegister_HHD */ -#define word_AQ_MsmSystemRxErrorsCounterRegister_HHD_msmSystemRxErrorsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressVlanTpid_0Register_HHD */ -#define AQ_MssIngressVlanTpid_0Register_HHD_baseRegisterAddress 0x8006 -/*! \brief MMD address of structure AQ_MssIngressVlanTpid_0Register_HHD */ -#define AQ_MssIngressVlanTpid_0Register_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanStag in AQ_MssIngressVlanTpid_0Register_HHD */ -#define AQ_MssIngressVlanTpid_0Register_HHD_mssIngressVlanStag 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanStag in AQ_MssIngressVlanTpid_0Register_HHD */ -#define bits_AQ_MssIngressVlanTpid_0Register_HHD_mssIngressVlanStag u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanStag in AQ_MssIngressVlanTpid_0Register_HHD */ -#define word_AQ_MssIngressVlanTpid_0Register_HHD_mssIngressVlanStag u0.word_0 - -/*! \brief Base register address of structure AQ_MssIngressVlanTpid_1Register_HHD */ -#define AQ_MssIngressVlanTpid_1Register_HHD_baseRegisterAddress 0x8008 -/*! \brief MMD address of structure AQ_MssIngressVlanTpid_1Register_HHD */ -#define AQ_MssIngressVlanTpid_1Register_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanQtag in AQ_MssIngressVlanTpid_1Register_HHD */ -#define AQ_MssIngressVlanTpid_1Register_HHD_mssIngressVlanQtag 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanQtag in AQ_MssIngressVlanTpid_1Register_HHD */ -#define bits_AQ_MssIngressVlanTpid_1Register_HHD_mssIngressVlanQtag u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanQtag in AQ_MssIngressVlanTpid_1Register_HHD */ -#define word_AQ_MssIngressVlanTpid_1Register_HHD_mssIngressVlanQtag u0.word_0 - -/*! \brief Base register address of structure AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_baseRegisterAddress 0x800A -/*! \brief MMD address of structure AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanUpMapTableLSW in AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpMapTableLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanUpMapTableLSW in AQ_MssIngressVlanControlRegister_HHD */ -#define bits_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpMapTableLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanUpMapTableLSW in AQ_MssIngressVlanControlRegister_HHD */ -#define word_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpMapTableLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanQtagParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQtagParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanQtagParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define bits_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQtagParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanQtagParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define word_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQtagParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanStagParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanStagParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanStagParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define bits_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanStagParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanStagParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define word_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanStagParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanQinqParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQinqParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanQinqParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define bits_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQinqParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanQinqParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define word_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQinqParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanQtagUpParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQtagUpParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanQtagUpParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define bits_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQtagUpParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanQtagUpParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define word_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanQtagUpParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanStagUpParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanStagUpParseEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanStagUpParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define bits_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanStagUpParseEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanStagUpParseEnable in AQ_MssIngressVlanControlRegister_HHD */ -#define word_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanStagUpParseEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanUpDefault in AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpDefault 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanUpDefault in AQ_MssIngressVlanControlRegister_HHD */ -#define bits_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpDefault u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanUpDefault in AQ_MssIngressVlanControlRegister_HHD */ -#define word_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpDefault u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressVlanUpMapTableMSW in AQ_MssIngressVlanControlRegister_HHD */ -#define AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpMapTableMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressVlanUpMapTableMSW in AQ_MssIngressVlanControlRegister_HHD */ -#define bits_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpMapTableMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressVlanUpMapTableMSW in AQ_MssIngressVlanControlRegister_HHD */ -#define word_AQ_MssIngressVlanControlRegister_HHD_mssIngressVlanUpMapTableMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressMtuSizeControlRegister_HHD */ -#define AQ_MssIngressMtuSizeControlRegister_HHD_baseRegisterAddress 0x800C -/*! \brief MMD address of structure AQ_MssIngressMtuSizeControlRegister_HHD */ -#define AQ_MssIngressMtuSizeControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressControlledPacketMtuSize in AQ_MssIngressMtuSizeControlRegister_HHD */ -#define AQ_MssIngressMtuSizeControlRegister_HHD_mssIngressControlledPacketMtuSize 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressControlledPacketMtuSize in AQ_MssIngressMtuSizeControlRegister_HHD */ -#define bits_AQ_MssIngressMtuSizeControlRegister_HHD_mssIngressControlledPacketMtuSize u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressControlledPacketMtuSize in AQ_MssIngressMtuSizeControlRegister_HHD */ -#define word_AQ_MssIngressMtuSizeControlRegister_HHD_mssIngressControlledPacketMtuSize u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressUncontrolledPacketMtuSize in AQ_MssIngressMtuSizeControlRegister_HHD */ -#define AQ_MssIngressMtuSizeControlRegister_HHD_mssIngressUncontrolledPacketMtuSize 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressUncontrolledPacketMtuSize in AQ_MssIngressMtuSizeControlRegister_HHD */ -#define bits_AQ_MssIngressMtuSizeControlRegister_HHD_mssIngressUncontrolledPacketMtuSize u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressUncontrolledPacketMtuSize in AQ_MssIngressMtuSizeControlRegister_HHD */ -#define word_AQ_MssIngressMtuSizeControlRegister_HHD_mssIngressUncontrolledPacketMtuSize u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_baseRegisterAddress 0x800E -/*! \brief MMD address of structure AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressIcvLsb_8BytesEnable in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressIcvLsb_8BytesEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressIcvLsb_8BytesEnable in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressIcvLsb_8BytesEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressIcvLsb_8BytesEnable in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressIcvLsb_8BytesEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressGlobalValidateFrames in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressGlobalValidateFrames 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressGlobalValidateFrames in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressGlobalValidateFrames u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressGlobalValidateFrames in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressGlobalValidateFrames u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressRemoveSectag in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressRemoveSectag 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressRemoveSectag in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressRemoveSectag u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressRemoveSectag in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressRemoveSectag u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressHighPriority in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressHighPriority 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressHighPriority in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressHighPriority u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressHighPriority in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressHighPriority u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressClearCount in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressClearCount 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressClearCount in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressClearCount u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressClearCount in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressClearCount u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressClearGlobalTime in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressClearGlobalTime 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressClearGlobalTime in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressClearGlobalTime u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressClearGlobalTime in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressClearGlobalTime u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressCheckIcv in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressCheckIcv 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressCheckIcv in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressCheckIcv u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressCheckIcv in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressCheckIcv u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressDropIgprcMiss in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressDropIgprcMiss 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressDropIgprcMiss in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressDropIgprcMiss u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressDropIgprcMiss in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressDropIgprcMiss u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressDropKayPacket in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressDropKayPacket 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressDropKayPacket in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressDropKayPacket u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressDropKayPacket in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressDropKayPacket u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressMaskShortLengthError in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressMaskShortLengthError 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressMaskShortLengthError in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressMaskShortLengthError u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressMaskShortLengthError in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressMaskShortLengthError u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressCreateSci in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressCreateSci 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressCreateSci in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressCreateSci u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressCreateSci in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressCreateSci u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressOperationPointToPoint in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressOperationPointToPoint 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressOperationPointToPoint in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressOperationPointToPoint u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressOperationPointToPoint in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressOperationPointToPoint u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSoftReset in AQ_MssIngressControlRegister_HHD */ -#define AQ_MssIngressControlRegister_HHD_mssIngressSoftReset 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSoftReset in AQ_MssIngressControlRegister_HHD */ -#define bits_AQ_MssIngressControlRegister_HHD_mssIngressSoftReset u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSoftReset in AQ_MssIngressControlRegister_HHD */ -#define word_AQ_MssIngressControlRegister_HHD_mssIngressSoftReset u0.word_0 - -/*! \brief Base register address of structure AQ_MssIngressSaControlRegister_HHD */ -#define AQ_MssIngressSaControlRegister_HHD_baseRegisterAddress 0x8010 -/*! \brief MMD address of structure AQ_MssIngressSaControlRegister_HHD */ -#define AQ_MssIngressSaControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaThresholdLSW in AQ_MssIngressSaControlRegister_HHD */ -#define AQ_MssIngressSaControlRegister_HHD_mssIngressSaThresholdLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaThresholdLSW in AQ_MssIngressSaControlRegister_HHD */ -#define bits_AQ_MssIngressSaControlRegister_HHD_mssIngressSaThresholdLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaThresholdLSW in AQ_MssIngressSaControlRegister_HHD */ -#define word_AQ_MssIngressSaControlRegister_HHD_mssIngressSaThresholdLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaThresholdMSW in AQ_MssIngressSaControlRegister_HHD */ -#define AQ_MssIngressSaControlRegister_HHD_mssIngressSaThresholdMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaThresholdMSW in AQ_MssIngressSaControlRegister_HHD */ -#define bits_AQ_MssIngressSaControlRegister_HHD_mssIngressSaThresholdMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaThresholdMSW in AQ_MssIngressSaControlRegister_HHD */ -#define word_AQ_MssIngressSaControlRegister_HHD_mssIngressSaThresholdMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_baseRegisterAddress 0x802E -/*! \brief MMD address of structure AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressIgpocMissInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssIngressIgpocMissInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressIgpocMissInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressIgpocMissInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressIgpocMissInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressIgpocMissInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressTciE_cErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssIngressTciE_cErrorInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressTciE_cErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressTciE_cErrorInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressTciE_cErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressTciE_cErrorInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressEccErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssIngressEccErrorInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressEccErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressEccErrorInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressEccErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressEccErrorInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressMibSaturationInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssIngressMibSaturationInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressMibSaturationInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressMibSaturationInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressMibSaturationInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressMibSaturationInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressReplayErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssIngressReplayErrorInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressReplayErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressReplayErrorInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressReplayErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressReplayErrorInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressIcvErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssIngressIcvErrorInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressIcvErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressIcvErrorInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressIcvErrorInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressIcvErrorInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaThresholdExpiredInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssIngressSaThresholdExpiredInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaThresholdExpiredInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressSaThresholdExpiredInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaThresholdExpiredInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressSaThresholdExpiredInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaExpiredInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssIngressSaExpiredInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaExpiredInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressSaExpiredInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaExpiredInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssIngressSaExpiredInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssMasterIngressInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define AQ_MssIngressInterruptStatusRegister_HHD_mssMasterIngressInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssMasterIngressInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressInterruptStatusRegister_HHD_mssMasterIngressInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssMasterIngressInterrupt in AQ_MssIngressInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressInterruptStatusRegister_HHD_mssMasterIngressInterrupt u0.word_0 - -/*! \brief Base register address of structure AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_baseRegisterAddress 0x8030 -/*! \brief MMD address of structure AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressIgpocMissInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressIgpocMissInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressIgpocMissInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressIgpocMissInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressIgpocMissInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressIgpocMissInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressTciE_cErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressTciE_cErrorInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressTciE_cErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressTciE_cErrorInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressTciE_cErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressTciE_cErrorInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressEccErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressEccErrorInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressEccErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressEccErrorInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressEccErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressEccErrorInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressMibSaturationInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressMibSaturationInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressMibSaturationInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressMibSaturationInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressMibSaturationInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressMibSaturationInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressReplayErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressReplayErrorInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressReplayErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressReplayErrorInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressReplayErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressReplayErrorInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressIcvErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressIcvErrorInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressIcvErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressIcvErrorInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressIcvErrorInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressIcvErrorInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaThresholdExpiredInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressSaThresholdExpiredInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaThresholdExpiredInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressSaThresholdExpiredInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaThresholdExpiredInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressSaThresholdExpiredInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaExpiredInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressSaExpiredInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaExpiredInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressSaExpiredInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaExpiredInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressSaExpiredInterruptEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressMasterInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define AQ_MssIngressInterruptMaskRegister_HHD_mssIngressMasterInterruptEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressMasterInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define bits_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressMasterInterruptEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressMasterInterruptEnable in AQ_MssIngressInterruptMaskRegister_HHD */ -#define word_AQ_MssIngressInterruptMaskRegister_HHD_mssIngressMasterInterruptEnable u0.word_0 - -/*! \brief Base register address of structure AQ_MssIngressSaIcvErrorStatusRegister_HHD */ -#define AQ_MssIngressSaIcvErrorStatusRegister_HHD_baseRegisterAddress 0x8032 -/*! \brief MMD address of structure AQ_MssIngressSaIcvErrorStatusRegister_HHD */ -#define AQ_MssIngressSaIcvErrorStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaIcvErrorLSW in AQ_MssIngressSaIcvErrorStatusRegister_HHD */ -#define AQ_MssIngressSaIcvErrorStatusRegister_HHD_mssIngressSaIcvErrorLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaIcvErrorLSW in AQ_MssIngressSaIcvErrorStatusRegister_HHD */ -#define bits_AQ_MssIngressSaIcvErrorStatusRegister_HHD_mssIngressSaIcvErrorLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaIcvErrorLSW in AQ_MssIngressSaIcvErrorStatusRegister_HHD */ -#define word_AQ_MssIngressSaIcvErrorStatusRegister_HHD_mssIngressSaIcvErrorLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaIcvErrorMSW in AQ_MssIngressSaIcvErrorStatusRegister_HHD */ -#define AQ_MssIngressSaIcvErrorStatusRegister_HHD_mssIngressSaIcvErrorMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaIcvErrorMSW in AQ_MssIngressSaIcvErrorStatusRegister_HHD */ -#define bits_AQ_MssIngressSaIcvErrorStatusRegister_HHD_mssIngressSaIcvErrorMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaIcvErrorMSW in AQ_MssIngressSaIcvErrorStatusRegister_HHD */ -#define word_AQ_MssIngressSaIcvErrorStatusRegister_HHD_mssIngressSaIcvErrorMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressSaReplayErrorStatusRegister_HHD */ -#define AQ_MssIngressSaReplayErrorStatusRegister_HHD_baseRegisterAddress 0x8034 -/*! \brief MMD address of structure AQ_MssIngressSaReplayErrorStatusRegister_HHD */ -#define AQ_MssIngressSaReplayErrorStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaReplayErrorLSW in AQ_MssIngressSaReplayErrorStatusRegister_HHD */ -#define AQ_MssIngressSaReplayErrorStatusRegister_HHD_mssIngressSaReplayErrorLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaReplayErrorLSW in AQ_MssIngressSaReplayErrorStatusRegister_HHD */ -#define bits_AQ_MssIngressSaReplayErrorStatusRegister_HHD_mssIngressSaReplayErrorLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaReplayErrorLSW in AQ_MssIngressSaReplayErrorStatusRegister_HHD */ -#define word_AQ_MssIngressSaReplayErrorStatusRegister_HHD_mssIngressSaReplayErrorLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaReplayErrorMSW in AQ_MssIngressSaReplayErrorStatusRegister_HHD */ -#define AQ_MssIngressSaReplayErrorStatusRegister_HHD_mssIngressSaReplayErrorMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaReplayErrorMSW in AQ_MssIngressSaReplayErrorStatusRegister_HHD */ -#define bits_AQ_MssIngressSaReplayErrorStatusRegister_HHD_mssIngressSaReplayErrorMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaReplayErrorMSW in AQ_MssIngressSaReplayErrorStatusRegister_HHD */ -#define word_AQ_MssIngressSaReplayErrorStatusRegister_HHD_mssIngressSaReplayErrorMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressSaExpiredStatusRegister_HHD */ -#define AQ_MssIngressSaExpiredStatusRegister_HHD_baseRegisterAddress 0x8036 -/*! \brief MMD address of structure AQ_MssIngressSaExpiredStatusRegister_HHD */ -#define AQ_MssIngressSaExpiredStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaExpiredLSW in AQ_MssIngressSaExpiredStatusRegister_HHD */ -#define AQ_MssIngressSaExpiredStatusRegister_HHD_mssIngressSaExpiredLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaExpiredLSW in AQ_MssIngressSaExpiredStatusRegister_HHD */ -#define bits_AQ_MssIngressSaExpiredStatusRegister_HHD_mssIngressSaExpiredLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaExpiredLSW in AQ_MssIngressSaExpiredStatusRegister_HHD */ -#define word_AQ_MssIngressSaExpiredStatusRegister_HHD_mssIngressSaExpiredLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaExpiredMSW in AQ_MssIngressSaExpiredStatusRegister_HHD */ -#define AQ_MssIngressSaExpiredStatusRegister_HHD_mssIngressSaExpiredMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaExpiredMSW in AQ_MssIngressSaExpiredStatusRegister_HHD */ -#define bits_AQ_MssIngressSaExpiredStatusRegister_HHD_mssIngressSaExpiredMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaExpiredMSW in AQ_MssIngressSaExpiredStatusRegister_HHD */ -#define word_AQ_MssIngressSaExpiredStatusRegister_HHD_mssIngressSaExpiredMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressSaThresholdExpiredStatusRegister_HHD */ -#define AQ_MssIngressSaThresholdExpiredStatusRegister_HHD_baseRegisterAddress 0x8038 -/*! \brief MMD address of structure AQ_MssIngressSaThresholdExpiredStatusRegister_HHD */ -#define AQ_MssIngressSaThresholdExpiredStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaThresholdExpiredLSW in AQ_MssIngressSaThresholdExpiredStatusRegister_HHD */ -#define AQ_MssIngressSaThresholdExpiredStatusRegister_HHD_mssIngressSaThresholdExpiredLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaThresholdExpiredLSW in AQ_MssIngressSaThresholdExpiredStatusRegister_HHD */ -#define bits_AQ_MssIngressSaThresholdExpiredStatusRegister_HHD_mssIngressSaThresholdExpiredLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaThresholdExpiredLSW in AQ_MssIngressSaThresholdExpiredStatusRegister_HHD */ -#define word_AQ_MssIngressSaThresholdExpiredStatusRegister_HHD_mssIngressSaThresholdExpiredLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaThresholdExpiredMSW in AQ_MssIngressSaThresholdExpiredStatusRegister_HHD */ -#define AQ_MssIngressSaThresholdExpiredStatusRegister_HHD_mssIngressSaThresholdExpiredMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaThresholdExpiredMSW in AQ_MssIngressSaThresholdExpiredStatusRegister_HHD */ -#define bits_AQ_MssIngressSaThresholdExpiredStatusRegister_HHD_mssIngressSaThresholdExpiredMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaThresholdExpiredMSW in AQ_MssIngressSaThresholdExpiredStatusRegister_HHD */ -#define word_AQ_MssIngressSaThresholdExpiredStatusRegister_HHD_mssIngressSaThresholdExpiredMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressEccInterruptStatusRegister_HHD */ -#define AQ_MssIngressEccInterruptStatusRegister_HHD_baseRegisterAddress 0x803A -/*! \brief MMD address of structure AQ_MssIngressEccInterruptStatusRegister_HHD */ -#define AQ_MssIngressEccInterruptStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaEccErrorInterruptLSW in AQ_MssIngressEccInterruptStatusRegister_HHD */ -#define AQ_MssIngressEccInterruptStatusRegister_HHD_mssIngressSaEccErrorInterruptLSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaEccErrorInterruptLSW in AQ_MssIngressEccInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressEccInterruptStatusRegister_HHD_mssIngressSaEccErrorInterruptLSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaEccErrorInterruptLSW in AQ_MssIngressEccInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressEccInterruptStatusRegister_HHD_mssIngressSaEccErrorInterruptLSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressSaEccErrorInterruptMSW in AQ_MssIngressEccInterruptStatusRegister_HHD */ -#define AQ_MssIngressEccInterruptStatusRegister_HHD_mssIngressSaEccErrorInterruptMSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressSaEccErrorInterruptMSW in AQ_MssIngressEccInterruptStatusRegister_HHD */ -#define bits_AQ_MssIngressEccInterruptStatusRegister_HHD_mssIngressSaEccErrorInterruptMSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressSaEccErrorInterruptMSW in AQ_MssIngressEccInterruptStatusRegister_HHD */ -#define word_AQ_MssIngressEccInterruptStatusRegister_HHD_mssIngressSaEccErrorInterruptMSW u1.word_1 - -/*! \brief Base register address of structure AQ_MssIngressLutAddressControlRegister_HHD */ -#define AQ_MssIngressLutAddressControlRegister_HHD_baseRegisterAddress 0x8080 -/*! \brief MMD address of structure AQ_MssIngressLutAddressControlRegister_HHD */ -#define AQ_MssIngressLutAddressControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutSelect in AQ_MssIngressLutAddressControlRegister_HHD */ -#define AQ_MssIngressLutAddressControlRegister_HHD_mssIngressLutSelect 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutSelect in AQ_MssIngressLutAddressControlRegister_HHD */ -#define bits_AQ_MssIngressLutAddressControlRegister_HHD_mssIngressLutSelect u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutSelect in AQ_MssIngressLutAddressControlRegister_HHD */ -#define word_AQ_MssIngressLutAddressControlRegister_HHD_mssIngressLutSelect u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutAddress in AQ_MssIngressLutAddressControlRegister_HHD */ -#define AQ_MssIngressLutAddressControlRegister_HHD_mssIngressLutAddress 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutAddress in AQ_MssIngressLutAddressControlRegister_HHD */ -#define bits_AQ_MssIngressLutAddressControlRegister_HHD_mssIngressLutAddress u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutAddress in AQ_MssIngressLutAddressControlRegister_HHD */ -#define word_AQ_MssIngressLutAddressControlRegister_HHD_mssIngressLutAddress u0.word_0 - -/*! \brief Base register address of structure AQ_MssIngressLutControlRegister_HHD */ -#define AQ_MssIngressLutControlRegister_HHD_baseRegisterAddress 0x8081 -/*! \brief MMD address of structure AQ_MssIngressLutControlRegister_HHD */ -#define AQ_MssIngressLutControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutWrite in AQ_MssIngressLutControlRegister_HHD */ -#define AQ_MssIngressLutControlRegister_HHD_mssIngressLutWrite 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutWrite in AQ_MssIngressLutControlRegister_HHD */ -#define bits_AQ_MssIngressLutControlRegister_HHD_mssIngressLutWrite u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutWrite in AQ_MssIngressLutControlRegister_HHD */ -#define word_AQ_MssIngressLutControlRegister_HHD_mssIngressLutWrite u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutRead in AQ_MssIngressLutControlRegister_HHD */ -#define AQ_MssIngressLutControlRegister_HHD_mssIngressLutRead 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutRead in AQ_MssIngressLutControlRegister_HHD */ -#define bits_AQ_MssIngressLutControlRegister_HHD_mssIngressLutRead u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutRead in AQ_MssIngressLutControlRegister_HHD */ -#define word_AQ_MssIngressLutControlRegister_HHD_mssIngressLutRead u0.word_0 - -/*! \brief Base register address of structure AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_baseRegisterAddress 0x80A0 -/*! \brief MMD address of structure AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_0 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_0 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_0 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_1 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_1 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_1 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_1 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_2 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_2 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_2 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_2 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_2 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_2 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_3 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_3 3 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_3 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_3 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_3 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_3 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_4 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_4 4 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_4 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_4 u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_4 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_4 u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_5 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_5 5 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_5 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_5 u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_5 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_5 u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_6 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_6 6 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_6 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_6 u6.bits_6 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_6 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_6 u6.word_6 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_7 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_7 7 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_7 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_7 u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_7 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_7 u7.word_7 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_8 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_8 8 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_8 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_8 u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_8 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_8 u8.word_8 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_9 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_9 9 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_9 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_9 u9.bits_9 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_9 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_9 u9.word_9 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_10 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_10 10 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_10 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_10 u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_10 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_10 u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_11 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_11 11 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_11 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_11 u11.bits_11 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_11 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_11 u11.word_11 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_12 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_12 12 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_12 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_12 u12.bits_12 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_12 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_12 u12.word_12 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_13 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_13 13 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_13 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_13 u13.bits_13 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_13 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_13 u13.word_13 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_14 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_14 14 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_14 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_14 u14.bits_14 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_14 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_14 u14.word_14 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_15 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_15 15 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_15 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_15 u15.bits_15 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_15 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_15 u15.word_15 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_16 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_16 16 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_16 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_16 u16.bits_16 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_16 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_16 u16.word_16 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_17 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_17 17 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_17 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_17 u17.bits_17 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_17 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_17 u17.word_17 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_18 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_18 18 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_18 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_18 u18.bits_18 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_18 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_18 u18.word_18 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_19 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_19 19 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_19 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_19 u19.bits_19 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_19 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_19 u19.word_19 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_20 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_20 20 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_20 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_20 u20.bits_20 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_20 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_20 u20.word_20 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_21 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_21 21 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_21 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_21 u21.bits_21 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_21 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_21 u21.word_21 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_22 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_22 22 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_22 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_22 u22.bits_22 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_22 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_22 u22.word_22 -/*! \brief Preprocessor variable to relate field to word number in structure mssIngressLutData_23 in AQ_MssIngressLutDataControlRegister_HHD */ -#define AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_23 23 -/*! \brief Preprocessor variable to relate field to bit position in structure mssIngressLutData_23 in AQ_MssIngressLutDataControlRegister_HHD */ -#define bits_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_23 u23.bits_23 -/*! \brief Preprocessor variable to relate field to word position in structure mssIngressLutData_23 in AQ_MssIngressLutDataControlRegister_HHD */ -#define word_AQ_MssIngressLutDataControlRegister_HHD_mssIngressLutData_23 u23.word_23 - -/*! \brief Base register address of structure AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_baseRegisterAddress 0x9004 -/*! \brief MMD address of structure AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLinePhyTxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLinePhyTxEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLinePhyTxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLinePhyTxEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLinePhyTxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLinePhyTxEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxErrorDiscard in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineRxErrorDiscard 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxErrorDiscard in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineRxErrorDiscard u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxErrorDiscard in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineRxErrorDiscard u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineControlFrameEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineControlFrameEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineControlFrameEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineControlFrameEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineControlFrameEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineControlFrameEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineSoftReset in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineSoftReset 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineSoftReset in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineSoftReset u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineSoftReset in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineSoftReset u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxPadEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineTxPadEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxPadEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxPadEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxPadEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxPadEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxCrcAppend in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineTxCrcAppend 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxCrcAppend in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxCrcAppend u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxCrcAppend in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxCrcAppend u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxAddressInsertEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineTxAddressInsertEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxAddressInsertEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxAddressInsertEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxAddressInsertEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxAddressInsertEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLinePauseIgnore in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLinePauseIgnore 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLinePauseIgnore in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLinePauseIgnore u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLinePauseIgnore in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLinePauseIgnore u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLinePauseForward in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLinePauseForward 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLinePauseForward in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLinePauseForward u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLinePauseForward in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLinePauseForward u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineCrcForward in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineCrcForward 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineCrcForward in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineCrcForward u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineCrcForward in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineCrcForward u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLinePadEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLinePadEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLinePadEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLinePadEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLinePadEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLinePadEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLinePromiscuousMode in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLinePromiscuousMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLinePromiscuousMode in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLinePromiscuousMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLinePromiscuousMode in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLinePromiscuousMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineWanMode in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineWanMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineWanMode in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineWanMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineWanMode in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineWanMode u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineRxEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineRxEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineRxEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineTxEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxLowPowerIdleEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineTxLowPowerIdleEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxLowPowerIdleEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxLowPowerIdleEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxLowPowerIdleEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineTxLowPowerIdleEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineSfdCheckDisable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineSfdCheckDisable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineSfdCheckDisable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineSfdCheckDisable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineSfdCheckDisable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineSfdCheckDisable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmLinePriorityFlowControlEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLinePriorityFlowControlEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLinePriorityFlowControlEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLinePriorityFlowControlEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLinePriorityFlowControlEnable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLinePriorityFlowControlEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineIdleColumnCountExtend in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineIdleColumnCountExtend 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineIdleColumnCountExtend in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineIdleColumnCountExtend u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineIdleColumnCountExtend in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineIdleColumnCountExtend u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineLengthCheckDisable in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineLengthCheckDisable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineLengthCheckDisable in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineLengthCheckDisable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineLengthCheckDisable in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineLengthCheckDisable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineForceSendIdle in AQ_MsmLineGeneralControlRegister_HHD */ -#define AQ_MsmLineGeneralControlRegister_HHD_msmLineForceSendIdle 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineForceSendIdle in AQ_MsmLineGeneralControlRegister_HHD */ -#define bits_AQ_MsmLineGeneralControlRegister_HHD_msmLineForceSendIdle u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineForceSendIdle in AQ_MsmLineGeneralControlRegister_HHD */ -#define word_AQ_MsmLineGeneralControlRegister_HHD_msmLineForceSendIdle u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_baseRegisterAddress 0x900E -/*! \brief MMD address of structure AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxFifoFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoFullThreshold 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxFifoFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define bits_AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoFullThreshold u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxFifoFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define word_AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoFullThreshold u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxFifoEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoEmptyThreshold 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxFifoEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define bits_AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoEmptyThreshold u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxFifoEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define word_AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoEmptyThreshold u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxFifoFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoFullThreshold 2 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxFifoFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define bits_AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoFullThreshold u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxFifoFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define word_AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoFullThreshold u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxFifoEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoEmptyThreshold 3 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxFifoEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define bits_AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoEmptyThreshold u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxFifoEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define word_AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoEmptyThreshold u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxFifoAlmostFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoAlmostFullThreshold 4 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxFifoAlmostFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define bits_AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoAlmostFullThreshold u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxFifoAlmostFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define word_AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoAlmostFullThreshold u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxFifoAlmostEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoAlmostEmptyThreshold 5 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxFifoAlmostEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define bits_AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoAlmostEmptyThreshold u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxFifoAlmostEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define word_AQ_MsmLineFifoControlRegister_HHD_msmLineRxFifoAlmostEmptyThreshold u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxFifoAlmostFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoAlmostFullThreshold 6 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxFifoAlmostFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define bits_AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoAlmostFullThreshold u6.bits_6 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxFifoAlmostFullThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define word_AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoAlmostFullThreshold u6.word_6 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxFifoAlmostEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoAlmostEmptyThreshold 7 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxFifoAlmostEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define bits_AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoAlmostEmptyThreshold u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxFifoAlmostEmptyThreshold in AQ_MsmLineFifoControlRegister_HHD */ -#define word_AQ_MsmLineFifoControlRegister_HHD_msmLineTxFifoAlmostEmptyThreshold u7.word_7 - -/*! \brief Base register address of structure AQ_MsmLineGeneralStatusRegister_HHD */ -#define AQ_MsmLineGeneralStatusRegister_HHD_baseRegisterAddress 0x9020 -/*! \brief MMD address of structure AQ_MsmLineGeneralStatusRegister_HHD */ -#define AQ_MsmLineGeneralStatusRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxFifoEmpty in AQ_MsmLineGeneralStatusRegister_HHD */ -#define AQ_MsmLineGeneralStatusRegister_HHD_msmLineTxFifoEmpty 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxFifoEmpty in AQ_MsmLineGeneralStatusRegister_HHD */ -#define bits_AQ_MsmLineGeneralStatusRegister_HHD_msmLineTxFifoEmpty u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxFifoEmpty in AQ_MsmLineGeneralStatusRegister_HHD */ -#define word_AQ_MsmLineGeneralStatusRegister_HHD_msmLineTxFifoEmpty u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxLowPowerIdle in AQ_MsmLineGeneralStatusRegister_HHD */ -#define AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxLowPowerIdle 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxLowPowerIdle in AQ_MsmLineGeneralStatusRegister_HHD */ -#define bits_AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxLowPowerIdle u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxLowPowerIdle in AQ_MsmLineGeneralStatusRegister_HHD */ -#define word_AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxLowPowerIdle u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTimestampAvailable in AQ_MsmLineGeneralStatusRegister_HHD */ -#define AQ_MsmLineGeneralStatusRegister_HHD_msmLineTimestampAvailable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTimestampAvailable in AQ_MsmLineGeneralStatusRegister_HHD */ -#define bits_AQ_MsmLineGeneralStatusRegister_HHD_msmLineTimestampAvailable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTimestampAvailable in AQ_MsmLineGeneralStatusRegister_HHD */ -#define word_AQ_MsmLineGeneralStatusRegister_HHD_msmLineTimestampAvailable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLinePhyLossOfSignal in AQ_MsmLineGeneralStatusRegister_HHD */ -#define AQ_MsmLineGeneralStatusRegister_HHD_msmLinePhyLossOfSignal 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLinePhyLossOfSignal in AQ_MsmLineGeneralStatusRegister_HHD */ -#define bits_AQ_MsmLineGeneralStatusRegister_HHD_msmLinePhyLossOfSignal u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLinePhyLossOfSignal in AQ_MsmLineGeneralStatusRegister_HHD */ -#define word_AQ_MsmLineGeneralStatusRegister_HHD_msmLinePhyLossOfSignal u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxRemoteFault in AQ_MsmLineGeneralStatusRegister_HHD */ -#define AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxRemoteFault 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxRemoteFault in AQ_MsmLineGeneralStatusRegister_HHD */ -#define bits_AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxRemoteFault u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxRemoteFault in AQ_MsmLineGeneralStatusRegister_HHD */ -#define word_AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxRemoteFault u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxLocalFault in AQ_MsmLineGeneralStatusRegister_HHD */ -#define AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxLocalFault 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxLocalFault in AQ_MsmLineGeneralStatusRegister_HHD */ -#define bits_AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxLocalFault u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxLocalFault in AQ_MsmLineGeneralStatusRegister_HHD */ -#define word_AQ_MsmLineGeneralStatusRegister_HHD_msmLineRxLocalFault u0.word_0 - -/*! \brief Base register address of structure AQ_MsmLineTxIpgControlRegister_HHD */ -#define AQ_MsmLineTxIpgControlRegister_HHD_baseRegisterAddress 0x9022 -/*! \brief MMD address of structure AQ_MsmLineTxIpgControlRegister_HHD */ -#define AQ_MsmLineTxIpgControlRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxIpgLength in AQ_MsmLineTxIpgControlRegister_HHD */ -#define AQ_MsmLineTxIpgControlRegister_HHD_msmLineTxIpgLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxIpgLength in AQ_MsmLineTxIpgControlRegister_HHD */ -#define bits_AQ_MsmLineTxIpgControlRegister_HHD_msmLineTxIpgLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxIpgLength in AQ_MsmLineTxIpgControlRegister_HHD */ -#define word_AQ_MsmLineTxIpgControlRegister_HHD_msmLineTxIpgLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxIpgReserved in AQ_MsmLineTxIpgControlRegister_HHD */ -#define AQ_MsmLineTxIpgControlRegister_HHD_msmLineTxIpgReserved 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxIpgReserved in AQ_MsmLineTxIpgControlRegister_HHD */ -#define bits_AQ_MsmLineTxIpgControlRegister_HHD_msmLineTxIpgReserved u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxIpgReserved in AQ_MsmLineTxIpgControlRegister_HHD */ -#define word_AQ_MsmLineTxIpgControlRegister_HHD_msmLineTxIpgReserved u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineTxGoodFramesCounterRegister_HHD */ -#define AQ_MsmLineTxGoodFramesCounterRegister_HHD_baseRegisterAddress 0x9040 -/*! \brief MMD address of structure AQ_MsmLineTxGoodFramesCounterRegister_HHD */ -#define AQ_MsmLineTxGoodFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxGoodFramesCounter_0 in AQ_MsmLineTxGoodFramesCounterRegister_HHD */ -#define AQ_MsmLineTxGoodFramesCounterRegister_HHD_msmLineTxGoodFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxGoodFramesCounter_0 in AQ_MsmLineTxGoodFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxGoodFramesCounterRegister_HHD_msmLineTxGoodFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxGoodFramesCounter_0 in AQ_MsmLineTxGoodFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxGoodFramesCounterRegister_HHD_msmLineTxGoodFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxGoodFramesCounter_1 in AQ_MsmLineTxGoodFramesCounterRegister_HHD */ -#define AQ_MsmLineTxGoodFramesCounterRegister_HHD_msmLineTxGoodFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxGoodFramesCounter_1 in AQ_MsmLineTxGoodFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxGoodFramesCounterRegister_HHD_msmLineTxGoodFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxGoodFramesCounter_1 in AQ_MsmLineTxGoodFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxGoodFramesCounterRegister_HHD_msmLineTxGoodFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxGoodFramesCounterRegister_HHD */ -#define AQ_MsmLineRxGoodFramesCounterRegister_HHD_baseRegisterAddress 0x9044 -/*! \brief MMD address of structure AQ_MsmLineRxGoodFramesCounterRegister_HHD */ -#define AQ_MsmLineRxGoodFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxGoodFramesCounter_0 in AQ_MsmLineRxGoodFramesCounterRegister_HHD */ -#define AQ_MsmLineRxGoodFramesCounterRegister_HHD_msmLineRxGoodFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxGoodFramesCounter_0 in AQ_MsmLineRxGoodFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxGoodFramesCounterRegister_HHD_msmLineRxGoodFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxGoodFramesCounter_0 in AQ_MsmLineRxGoodFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxGoodFramesCounterRegister_HHD_msmLineRxGoodFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxGoodFramesCounter_1 in AQ_MsmLineRxGoodFramesCounterRegister_HHD */ -#define AQ_MsmLineRxGoodFramesCounterRegister_HHD_msmLineRxGoodFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxGoodFramesCounter_1 in AQ_MsmLineRxGoodFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxGoodFramesCounterRegister_HHD_msmLineRxGoodFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxGoodFramesCounter_1 in AQ_MsmLineRxGoodFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxGoodFramesCounterRegister_HHD_msmLineRxGoodFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxFcsErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxFcsErrorsCounterRegister_HHD_baseRegisterAddress 0x9048 -/*! \brief MMD address of structure AQ_MsmLineRxFcsErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxFcsErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineFcsErrorCounter_0 in AQ_MsmLineRxFcsErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxFcsErrorsCounterRegister_HHD_msmLineFcsErrorCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineFcsErrorCounter_0 in AQ_MsmLineRxFcsErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxFcsErrorsCounterRegister_HHD_msmLineFcsErrorCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineFcsErrorCounter_0 in AQ_MsmLineRxFcsErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxFcsErrorsCounterRegister_HHD_msmLineFcsErrorCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineFcsErrorCounter_1 in AQ_MsmLineRxFcsErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxFcsErrorsCounterRegister_HHD_msmLineFcsErrorCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineFcsErrorCounter_1 in AQ_MsmLineRxFcsErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxFcsErrorsCounterRegister_HHD_msmLineFcsErrorCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineFcsErrorCounter_1 in AQ_MsmLineRxFcsErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxFcsErrorsCounterRegister_HHD_msmLineFcsErrorCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD_baseRegisterAddress 0x904C -/*! \brief MMD address of structure AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineAlignmentErrorCounter_0 in AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD_msmLineAlignmentErrorCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineAlignmentErrorCounter_0 in AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD_msmLineAlignmentErrorCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineAlignmentErrorCounter_0 in AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD_msmLineAlignmentErrorCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineAlignmentErrorCounter_1 in AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD_msmLineAlignmentErrorCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineAlignmentErrorCounter_1 in AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD_msmLineAlignmentErrorCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineAlignmentErrorCounter_1 in AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD_msmLineAlignmentErrorCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineTxPauseFramesCounterRegister_HHD */ -#define AQ_MsmLineTxPauseFramesCounterRegister_HHD_baseRegisterAddress 0x9050 -/*! \brief MMD address of structure AQ_MsmLineTxPauseFramesCounterRegister_HHD */ -#define AQ_MsmLineTxPauseFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxPauseFramesCounter_0 in AQ_MsmLineTxPauseFramesCounterRegister_HHD */ -#define AQ_MsmLineTxPauseFramesCounterRegister_HHD_msmLineTxPauseFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxPauseFramesCounter_0 in AQ_MsmLineTxPauseFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxPauseFramesCounterRegister_HHD_msmLineTxPauseFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxPauseFramesCounter_0 in AQ_MsmLineTxPauseFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxPauseFramesCounterRegister_HHD_msmLineTxPauseFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxPauseFramesCounter_1 in AQ_MsmLineTxPauseFramesCounterRegister_HHD */ -#define AQ_MsmLineTxPauseFramesCounterRegister_HHD_msmLineTxPauseFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxPauseFramesCounter_1 in AQ_MsmLineTxPauseFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxPauseFramesCounterRegister_HHD_msmLineTxPauseFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxPauseFramesCounter_1 in AQ_MsmLineTxPauseFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxPauseFramesCounterRegister_HHD_msmLineTxPauseFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxPauseFramesCounterRegister_HHD */ -#define AQ_MsmLineRxPauseFramesCounterRegister_HHD_baseRegisterAddress 0x9054 -/*! \brief MMD address of structure AQ_MsmLineRxPauseFramesCounterRegister_HHD */ -#define AQ_MsmLineRxPauseFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxPauseFramesCounter_0 in AQ_MsmLineRxPauseFramesCounterRegister_HHD */ -#define AQ_MsmLineRxPauseFramesCounterRegister_HHD_msmLineRxPauseFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxPauseFramesCounter_0 in AQ_MsmLineRxPauseFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxPauseFramesCounterRegister_HHD_msmLineRxPauseFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxPauseFramesCounter_0 in AQ_MsmLineRxPauseFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxPauseFramesCounterRegister_HHD_msmLineRxPauseFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxPauseFramesCounter_1 in AQ_MsmLineRxPauseFramesCounterRegister_HHD */ -#define AQ_MsmLineRxPauseFramesCounterRegister_HHD_msmLineRxPauseFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxPauseFramesCounter_1 in AQ_MsmLineRxPauseFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxPauseFramesCounterRegister_HHD_msmLineRxPauseFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxPauseFramesCounter_1 in AQ_MsmLineRxPauseFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxPauseFramesCounterRegister_HHD_msmLineRxPauseFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxTooLongErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxTooLongErrorsCounterRegister_HHD_baseRegisterAddress 0x9058 -/*! \brief MMD address of structure AQ_MsmLineRxTooLongErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxTooLongErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxTooLongErrorsCounter_0 in AQ_MsmLineRxTooLongErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxTooLongErrorsCounterRegister_HHD_msmLineRxTooLongErrorsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxTooLongErrorsCounter_0 in AQ_MsmLineRxTooLongErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxTooLongErrorsCounterRegister_HHD_msmLineRxTooLongErrorsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxTooLongErrorsCounter_0 in AQ_MsmLineRxTooLongErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxTooLongErrorsCounterRegister_HHD_msmLineRxTooLongErrorsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxTooLongErrorsCounter_1 in AQ_MsmLineRxTooLongErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxTooLongErrorsCounterRegister_HHD_msmLineRxTooLongErrorsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxTooLongErrorsCounter_1 in AQ_MsmLineRxTooLongErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxTooLongErrorsCounterRegister_HHD_msmLineRxTooLongErrorsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxTooLongErrorsCounter_1 in AQ_MsmLineRxTooLongErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxTooLongErrorsCounterRegister_HHD_msmLineRxTooLongErrorsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD_baseRegisterAddress 0x905C -/*! \brief MMD address of structure AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxInRangeLengthErrorsCounter_0 in AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD_msmLineRxInRangeLengthErrorsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxInRangeLengthErrorsCounter_0 in AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD_msmLineRxInRangeLengthErrorsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxInRangeLengthErrorsCounter_0 in AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD_msmLineRxInRangeLengthErrorsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxInRangeLengthErrorsCounter_1 in AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD_msmLineRxInRangeLengthErrorsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxInRangeLengthErrorsCounter_1 in AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD_msmLineRxInRangeLengthErrorsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxInRangeLengthErrorsCounter_1 in AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD_msmLineRxInRangeLengthErrorsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineTxVlanFramesCounterRegister_HHD */ -#define AQ_MsmLineTxVlanFramesCounterRegister_HHD_baseRegisterAddress 0x9060 -/*! \brief MMD address of structure AQ_MsmLineTxVlanFramesCounterRegister_HHD */ -#define AQ_MsmLineTxVlanFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxVlanFramesCounter_0 in AQ_MsmLineTxVlanFramesCounterRegister_HHD */ -#define AQ_MsmLineTxVlanFramesCounterRegister_HHD_msmLineTxVlanFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxVlanFramesCounter_0 in AQ_MsmLineTxVlanFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxVlanFramesCounterRegister_HHD_msmLineTxVlanFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxVlanFramesCounter_0 in AQ_MsmLineTxVlanFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxVlanFramesCounterRegister_HHD_msmLineTxVlanFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxVlanFramesCounter_1 in AQ_MsmLineTxVlanFramesCounterRegister_HHD */ -#define AQ_MsmLineTxVlanFramesCounterRegister_HHD_msmLineTxVlanFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxVlanFramesCounter_1 in AQ_MsmLineTxVlanFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxVlanFramesCounterRegister_HHD_msmLineTxVlanFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxVlanFramesCounter_1 in AQ_MsmLineTxVlanFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxVlanFramesCounterRegister_HHD_msmLineTxVlanFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxVlanFramesCounterRegister_HHD */ -#define AQ_MsmLineRxVlanFramesCounterRegister_HHD_baseRegisterAddress 0x9064 -/*! \brief MMD address of structure AQ_MsmLineRxVlanFramesCounterRegister_HHD */ -#define AQ_MsmLineRxVlanFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxVlanFramesCounter_0 in AQ_MsmLineRxVlanFramesCounterRegister_HHD */ -#define AQ_MsmLineRxVlanFramesCounterRegister_HHD_msmLineRxVlanFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxVlanFramesCounter_0 in AQ_MsmLineRxVlanFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxVlanFramesCounterRegister_HHD_msmLineRxVlanFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxVlanFramesCounter_0 in AQ_MsmLineRxVlanFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxVlanFramesCounterRegister_HHD_msmLineRxVlanFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxVlanFramesCounter_1 in AQ_MsmLineRxVlanFramesCounterRegister_HHD */ -#define AQ_MsmLineRxVlanFramesCounterRegister_HHD_msmLineRxVlanFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxVlanFramesCounter_1 in AQ_MsmLineRxVlanFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxVlanFramesCounterRegister_HHD_msmLineRxVlanFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxVlanFramesCounter_1 in AQ_MsmLineRxVlanFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxVlanFramesCounterRegister_HHD_msmLineRxVlanFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define AQ_MsmLineTxOctetsCounterRegister_HHD_baseRegisterAddress 0x9068 -/*! \brief MMD address of structure AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define AQ_MsmLineTxOctetsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxOctetsCounter_0 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxOctetsCounter_0 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxOctetsCounter_0 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define word_AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxOctetsCounter_1 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxOctetsCounter_1 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxOctetsCounter_1 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define word_AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_1 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxOctetsCounter_2 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_2 2 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxOctetsCounter_2 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_2 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxOctetsCounter_2 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define word_AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_2 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxOctetsCounter_3 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_3 3 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxOctetsCounter_3 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_3 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxOctetsCounter_3 in AQ_MsmLineTxOctetsCounterRegister_HHD */ -#define word_AQ_MsmLineTxOctetsCounterRegister_HHD_msmLineTxOctetsCounter_3 u3.word_3 - -/*! \brief Base register address of structure AQ_MsmLineRxOctetsCounterRegister_HHD */ -#define AQ_MsmLineRxOctetsCounterRegister_HHD_baseRegisterAddress 0x906C -/*! \brief MMD address of structure AQ_MsmLineRxOctetsCounterRegister_HHD */ -#define AQ_MsmLineRxOctetsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxOctetsCounter_0 in AQ_MsmLineRxOctetsCounterRegister_HHD */ -#define AQ_MsmLineRxOctetsCounterRegister_HHD_msmLineRxOctetsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxOctetsCounter_0 in AQ_MsmLineRxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxOctetsCounterRegister_HHD_msmLineRxOctetsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxOctetsCounter_0 in AQ_MsmLineRxOctetsCounterRegister_HHD */ -#define word_AQ_MsmLineRxOctetsCounterRegister_HHD_msmLineRxOctetsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxOctetsCounter_1 in AQ_MsmLineRxOctetsCounterRegister_HHD */ -#define AQ_MsmLineRxOctetsCounterRegister_HHD_msmLineRxOctetsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxOctetsCounter_1 in AQ_MsmLineRxOctetsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxOctetsCounterRegister_HHD_msmLineRxOctetsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxOctetsCounter_1 in AQ_MsmLineRxOctetsCounterRegister_HHD */ -#define word_AQ_MsmLineRxOctetsCounterRegister_HHD_msmLineRxOctetsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxUnicastFramesCounterRegister_HHD_baseRegisterAddress 0x9070 -/*! \brief MMD address of structure AQ_MsmLineRxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxUnicastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxUnicastFramesCounter_0 in AQ_MsmLineRxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxUnicastFramesCounterRegister_HHD_msmLineRxUnicastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxUnicastFramesCounter_0 in AQ_MsmLineRxUnicastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxUnicastFramesCounterRegister_HHD_msmLineRxUnicastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxUnicastFramesCounter_0 in AQ_MsmLineRxUnicastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxUnicastFramesCounterRegister_HHD_msmLineRxUnicastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxUnicastFramesCounter_1 in AQ_MsmLineRxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxUnicastFramesCounterRegister_HHD_msmLineRxUnicastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxUnicastFramesCounter_1 in AQ_MsmLineRxUnicastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxUnicastFramesCounterRegister_HHD_msmLineRxUnicastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxUnicastFramesCounter_1 in AQ_MsmLineRxUnicastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxUnicastFramesCounterRegister_HHD_msmLineRxUnicastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxMulticastFramesCounterRegister_HHD_baseRegisterAddress 0x9074 -/*! \brief MMD address of structure AQ_MsmLineRxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxMulticastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxMulticastFramesCounter_0 in AQ_MsmLineRxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxMulticastFramesCounterRegister_HHD_msmLineRxMulticastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxMulticastFramesCounter_0 in AQ_MsmLineRxMulticastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxMulticastFramesCounterRegister_HHD_msmLineRxMulticastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxMulticastFramesCounter_0 in AQ_MsmLineRxMulticastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxMulticastFramesCounterRegister_HHD_msmLineRxMulticastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxMulticastFramesCounter_1 in AQ_MsmLineRxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxMulticastFramesCounterRegister_HHD_msmLineRxMulticastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxMulticastFramesCounter_1 in AQ_MsmLineRxMulticastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxMulticastFramesCounterRegister_HHD_msmLineRxMulticastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxMulticastFramesCounter_1 in AQ_MsmLineRxMulticastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxMulticastFramesCounterRegister_HHD_msmLineRxMulticastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxBroadcastFramesCounterRegister_HHD_baseRegisterAddress 0x9078 -/*! \brief MMD address of structure AQ_MsmLineRxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxBroadcastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxBroadcastFramesCounter_0 in AQ_MsmLineRxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxBroadcastFramesCounterRegister_HHD_msmLineRxBroadcastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxBroadcastFramesCounter_0 in AQ_MsmLineRxBroadcastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxBroadcastFramesCounterRegister_HHD_msmLineRxBroadcastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxBroadcastFramesCounter_0 in AQ_MsmLineRxBroadcastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxBroadcastFramesCounterRegister_HHD_msmLineRxBroadcastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxBroadcastFramesCounter_1 in AQ_MsmLineRxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmLineRxBroadcastFramesCounterRegister_HHD_msmLineRxBroadcastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxBroadcastFramesCounter_1 in AQ_MsmLineRxBroadcastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineRxBroadcastFramesCounterRegister_HHD_msmLineRxBroadcastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxBroadcastFramesCounter_1 in AQ_MsmLineRxBroadcastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineRxBroadcastFramesCounterRegister_HHD_msmLineRxBroadcastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineTxErrorsCounterRegister_HHD */ -#define AQ_MsmLineTxErrorsCounterRegister_HHD_baseRegisterAddress 0x907C -/*! \brief MMD address of structure AQ_MsmLineTxErrorsCounterRegister_HHD */ -#define AQ_MsmLineTxErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxErrorsCounter_0 in AQ_MsmLineTxErrorsCounterRegister_HHD */ -#define AQ_MsmLineTxErrorsCounterRegister_HHD_msmLineTxErrorsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxErrorsCounter_0 in AQ_MsmLineTxErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineTxErrorsCounterRegister_HHD_msmLineTxErrorsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxErrorsCounter_0 in AQ_MsmLineTxErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineTxErrorsCounterRegister_HHD_msmLineTxErrorsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxErrorsCounter_1 in AQ_MsmLineTxErrorsCounterRegister_HHD */ -#define AQ_MsmLineTxErrorsCounterRegister_HHD_msmLineTxErrorsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxErrorsCounter_1 in AQ_MsmLineTxErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineTxErrorsCounterRegister_HHD_msmLineTxErrorsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxErrorsCounter_1 in AQ_MsmLineTxErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineTxErrorsCounterRegister_HHD_msmLineTxErrorsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineTxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxUnicastFramesCounterRegister_HHD_baseRegisterAddress 0x9084 -/*! \brief MMD address of structure AQ_MsmLineTxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxUnicastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxUnicastFramesCounter_0 in AQ_MsmLineTxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxUnicastFramesCounterRegister_HHD_msmLineTxUnicastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxUnicastFramesCounter_0 in AQ_MsmLineTxUnicastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxUnicastFramesCounterRegister_HHD_msmLineTxUnicastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxUnicastFramesCounter_0 in AQ_MsmLineTxUnicastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxUnicastFramesCounterRegister_HHD_msmLineTxUnicastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxUnicastFramesCounter_1 in AQ_MsmLineTxUnicastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxUnicastFramesCounterRegister_HHD_msmLineTxUnicastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxUnicastFramesCounter_1 in AQ_MsmLineTxUnicastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxUnicastFramesCounterRegister_HHD_msmLineTxUnicastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxUnicastFramesCounter_1 in AQ_MsmLineTxUnicastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxUnicastFramesCounterRegister_HHD_msmLineTxUnicastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineTxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxMulticastFramesCounterRegister_HHD_baseRegisterAddress 0x9088 -/*! \brief MMD address of structure AQ_MsmLineTxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxMulticastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxMulticastFramesCounter_0 in AQ_MsmLineTxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxMulticastFramesCounterRegister_HHD_msmLineTxMulticastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxMulticastFramesCounter_0 in AQ_MsmLineTxMulticastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxMulticastFramesCounterRegister_HHD_msmLineTxMulticastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxMulticastFramesCounter_0 in AQ_MsmLineTxMulticastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxMulticastFramesCounterRegister_HHD_msmLineTxMulticastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxMulticastFramesCounter_1 in AQ_MsmLineTxMulticastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxMulticastFramesCounterRegister_HHD_msmLineTxMulticastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxMulticastFramesCounter_1 in AQ_MsmLineTxMulticastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxMulticastFramesCounterRegister_HHD_msmLineTxMulticastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxMulticastFramesCounter_1 in AQ_MsmLineTxMulticastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxMulticastFramesCounterRegister_HHD_msmLineTxMulticastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineTxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxBroadcastFramesCounterRegister_HHD_baseRegisterAddress 0x908C -/*! \brief MMD address of structure AQ_MsmLineTxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxBroadcastFramesCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxBroadcastFramesCounter_0 in AQ_MsmLineTxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxBroadcastFramesCounterRegister_HHD_msmLineTxBroadcastFramesCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxBroadcastFramesCounter_0 in AQ_MsmLineTxBroadcastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxBroadcastFramesCounterRegister_HHD_msmLineTxBroadcastFramesCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxBroadcastFramesCounter_0 in AQ_MsmLineTxBroadcastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxBroadcastFramesCounterRegister_HHD_msmLineTxBroadcastFramesCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineTxBroadcastFramesCounter_1 in AQ_MsmLineTxBroadcastFramesCounterRegister_HHD */ -#define AQ_MsmLineTxBroadcastFramesCounterRegister_HHD_msmLineTxBroadcastFramesCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineTxBroadcastFramesCounter_1 in AQ_MsmLineTxBroadcastFramesCounterRegister_HHD */ -#define bits_AQ_MsmLineTxBroadcastFramesCounterRegister_HHD_msmLineTxBroadcastFramesCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineTxBroadcastFramesCounter_1 in AQ_MsmLineTxBroadcastFramesCounterRegister_HHD */ -#define word_AQ_MsmLineTxBroadcastFramesCounterRegister_HHD_msmLineTxBroadcastFramesCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_MsmLineRxErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxErrorsCounterRegister_HHD_baseRegisterAddress 0x90C8 -/*! \brief MMD address of structure AQ_MsmLineRxErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxErrorsCounterRegister_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxErrorsCounter_0 in AQ_MsmLineRxErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxErrorsCounterRegister_HHD_msmLineRxErrorsCounter_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxErrorsCounter_0 in AQ_MsmLineRxErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxErrorsCounterRegister_HHD_msmLineRxErrorsCounter_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxErrorsCounter_0 in AQ_MsmLineRxErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxErrorsCounterRegister_HHD_msmLineRxErrorsCounter_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure msmLineRxErrorsCounter_1 in AQ_MsmLineRxErrorsCounterRegister_HHD */ -#define AQ_MsmLineRxErrorsCounterRegister_HHD_msmLineRxErrorsCounter_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure msmLineRxErrorsCounter_1 in AQ_MsmLineRxErrorsCounterRegister_HHD */ -#define bits_AQ_MsmLineRxErrorsCounterRegister_HHD_msmLineRxErrorsCounter_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure msmLineRxErrorsCounter_1 in AQ_MsmLineRxErrorsCounterRegister_HHD */ -#define word_AQ_MsmLineRxErrorsCounterRegister_HHD_msmLineRxErrorsCounter_1 u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalControl_HHD */ -#define AQ_GlobalControl_HHD_baseRegisterAddress 0xC000 -/*! \brief MMD address of structure AQ_GlobalControl_HHD */ -#define AQ_GlobalControl_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure upReset in AQ_GlobalControl_HHD */ -#define AQ_GlobalControl_HHD_upReset 1 -/*! \brief Preprocessor variable to relate field to bit position in structure upReset in AQ_GlobalControl_HHD */ -#define bits_AQ_GlobalControl_HHD_upReset u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure upReset in AQ_GlobalControl_HHD */ -#define word_AQ_GlobalControl_HHD_upReset u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure upRunStallOverride in AQ_GlobalControl_HHD */ -#define AQ_GlobalControl_HHD_upRunStallOverride 1 -/*! \brief Preprocessor variable to relate field to bit position in structure upRunStallOverride in AQ_GlobalControl_HHD */ -#define bits_AQ_GlobalControl_HHD_upRunStallOverride u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure upRunStallOverride in AQ_GlobalControl_HHD */ -#define word_AQ_GlobalControl_HHD_upRunStallOverride u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure upRunStall in AQ_GlobalControl_HHD */ -#define AQ_GlobalControl_HHD_upRunStall 1 -/*! \brief Preprocessor variable to relate field to bit position in structure upRunStall in AQ_GlobalControl_HHD */ -#define bits_AQ_GlobalControl_HHD_upRunStall u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure upRunStall in AQ_GlobalControl_HHD */ -#define word_AQ_GlobalControl_HHD_upRunStall u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalResetControl_HHD */ -#define AQ_GlobalResetControl_HHD_baseRegisterAddress 0xC006 -/*! \brief MMD address of structure AQ_GlobalResetControl_HHD */ -#define AQ_GlobalResetControl_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure globalMMD_ResetDisable in AQ_GlobalResetControl_HHD */ -#define AQ_GlobalResetControl_HHD_globalMMD_ResetDisable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalMMD_ResetDisable in AQ_GlobalResetControl_HHD */ -#define bits_AQ_GlobalResetControl_HHD_globalMMD_ResetDisable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalMMD_ResetDisable in AQ_GlobalResetControl_HHD */ -#define word_AQ_GlobalResetControl_HHD_globalMMD_ResetDisable u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalDiagnosticProvisioning_HHD */ -#define AQ_GlobalDiagnosticProvisioning_HHD_baseRegisterAddress 0xC400 -/*! \brief MMD address of structure AQ_GlobalDiagnosticProvisioning_HHD */ -#define AQ_GlobalDiagnosticProvisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure enableDiagnostics in AQ_GlobalDiagnosticProvisioning_HHD */ -#define AQ_GlobalDiagnosticProvisioning_HHD_enableDiagnostics 0 -/*! \brief Preprocessor variable to relate field to bit position in structure enableDiagnostics in AQ_GlobalDiagnosticProvisioning_HHD */ -#define bits_AQ_GlobalDiagnosticProvisioning_HHD_enableDiagnostics u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure enableDiagnostics in AQ_GlobalDiagnosticProvisioning_HHD */ -#define word_AQ_GlobalDiagnosticProvisioning_HHD_enableDiagnostics u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalThermalProvisioning_HHD */ -#define AQ_GlobalThermalProvisioning_HHD_baseRegisterAddress 0xC420 -/*! \brief MMD address of structure AQ_GlobalThermalProvisioning_HHD */ -#define AQ_GlobalThermalProvisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure reserved_0 in AQ_GlobalThermalProvisioning_HHD */ -#define AQ_GlobalThermalProvisioning_HHD_reserved_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_0 in AQ_GlobalThermalProvisioning_HHD */ -#define bits_AQ_GlobalThermalProvisioning_HHD_reserved_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_0 in AQ_GlobalThermalProvisioning_HHD */ -#define word_AQ_GlobalThermalProvisioning_HHD_reserved_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure highTempFailureThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define AQ_GlobalThermalProvisioning_HHD_highTempFailureThreshold 1 -/*! \brief Preprocessor variable to relate field to bit position in structure highTempFailureThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define bits_AQ_GlobalThermalProvisioning_HHD_highTempFailureThreshold u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure highTempFailureThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define word_AQ_GlobalThermalProvisioning_HHD_highTempFailureThreshold u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure lowTempFailureThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define AQ_GlobalThermalProvisioning_HHD_lowTempFailureThreshold 2 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTempFailureThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define bits_AQ_GlobalThermalProvisioning_HHD_lowTempFailureThreshold u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure lowTempFailureThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define word_AQ_GlobalThermalProvisioning_HHD_lowTempFailureThreshold u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure highTempWarningThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define AQ_GlobalThermalProvisioning_HHD_highTempWarningThreshold 3 -/*! \brief Preprocessor variable to relate field to bit position in structure highTempWarningThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define bits_AQ_GlobalThermalProvisioning_HHD_highTempWarningThreshold u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure highTempWarningThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define word_AQ_GlobalThermalProvisioning_HHD_highTempWarningThreshold u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure lowTempWarningThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define AQ_GlobalThermalProvisioning_HHD_lowTempWarningThreshold 4 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTempWarningThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define bits_AQ_GlobalThermalProvisioning_HHD_lowTempWarningThreshold u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure lowTempWarningThreshold in AQ_GlobalThermalProvisioning_HHD */ -#define word_AQ_GlobalThermalProvisioning_HHD_lowTempWarningThreshold u4.word_4 - -/*! \brief Base register address of structure AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_baseRegisterAddress 0xC430 -/*! \brief MMD address of structure AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioningC430 in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_reservedProvisioningC430 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioningC430 in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_reservedProvisioningC430 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioningC430 in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_reservedProvisioningC430 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_0ManualSet 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_0ManualSet u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_0ManualSet u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_0_10Gb_sLinkEstablished 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_0_10Gb_sLinkEstablished u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_0_10Gb_sLinkEstablished u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_0_1Gb_sLinkEstablished 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_0_1Gb_sLinkEstablished u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_0_1Gb_sLinkEstablished u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_0_100Mb_sLinkEstablished 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_0_100Mb_sLinkEstablished u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_0_100Mb_sLinkEstablished u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0Connecting in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_0Connecting 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0Connecting in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_0Connecting u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0Connecting in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_0Connecting u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_0ReceiveActivity 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_0ReceiveActivity u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_0ReceiveActivity u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_0TransmitActivity 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_0TransmitActivity u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_0TransmitActivity u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure led_0ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_0ActivityStretch 0 -/*! \brief Preprocessor variable to relate field to bit position in structure led_0ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_0ActivityStretch u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure led_0ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_0ActivityStretch u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioningC431 in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_reservedProvisioningC431 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioningC431 in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_reservedProvisioningC431 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioningC431 in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_reservedProvisioningC431 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_1ManualSet 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_1ManualSet u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_1ManualSet u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_1_10Gb_sLinkEstablished 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_1_10Gb_sLinkEstablished u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_1_10Gb_sLinkEstablished u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_1_1Gb_sLinkEstablished 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_1_1Gb_sLinkEstablished u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_1_1Gb_sLinkEstablished u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_1_100Mb_sLinkEstablished 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_1_100Mb_sLinkEstablished u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_1_100Mb_sLinkEstablished u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1Connecting in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_1Connecting 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1Connecting in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_1Connecting u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1Connecting in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_1Connecting u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_1ReceiveActivity 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_1ReceiveActivity u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_1ReceiveActivity u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_1TransmitActivity 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_1TransmitActivity u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_1TransmitActivity u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure led_1ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_1ActivityStretch 1 -/*! \brief Preprocessor variable to relate field to bit position in structure led_1ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_1ActivityStretch u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure led_1ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_1ActivityStretch u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioningC432 in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_reservedProvisioningC432 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioningC432 in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_reservedProvisioningC432 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioningC432 in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_reservedProvisioningC432 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_2ManualSet 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_2ManualSet u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2ManualSet in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_2ManualSet u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_2_10Gb_sLinkEstablished 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_2_10Gb_sLinkEstablished u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2_10Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_2_10Gb_sLinkEstablished u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_2_1Gb_sLinkEstablished 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_2_1Gb_sLinkEstablished u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2_1Gb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_2_1Gb_sLinkEstablished u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_2_100Mb_sLinkEstablished 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_2_100Mb_sLinkEstablished u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2_100Mb_sLinkEstablished in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_2_100Mb_sLinkEstablished u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2Connecting in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_2Connecting 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2Connecting in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_2Connecting u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2Connecting in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_2Connecting u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_2ReceiveActivity 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_2ReceiveActivity u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2ReceiveActivity in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_2ReceiveActivity u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_2TransmitActivity 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_2TransmitActivity u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2TransmitActivity in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_2TransmitActivity u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure led_2ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_led_2ActivityStretch 2 -/*! \brief Preprocessor variable to relate field to bit position in structure led_2ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_led_2ActivityStretch u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure led_2ActivityStretch in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_led_2ActivityStretch u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure ledOperationMode in AQ_GlobalLedProvisioning_HHD */ -#define AQ_GlobalLedProvisioning_HHD_ledOperationMode 7 -/*! \brief Preprocessor variable to relate field to bit position in structure ledOperationMode in AQ_GlobalLedProvisioning_HHD */ -#define bits_AQ_GlobalLedProvisioning_HHD_ledOperationMode u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure ledOperationMode in AQ_GlobalLedProvisioning_HHD */ -#define word_AQ_GlobalLedProvisioning_HHD_ledOperationMode u7.word_7 - -/*! \brief Base register address of structure AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_baseRegisterAddress 0xC440 -/*! \brief MMD address of structure AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure mdioBroadcastModeEnable in AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_mdioBroadcastModeEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioBroadcastModeEnable in AQ_GlobalGeneralProvisioning_HHD */ -#define bits_AQ_GlobalGeneralProvisioning_HHD_mdioBroadcastModeEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioBroadcastModeEnable in AQ_GlobalGeneralProvisioning_HHD */ -#define word_AQ_GlobalGeneralProvisioning_HHD_mdioBroadcastModeEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioReadMSW_FirstEnable in AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_mdioReadMSW_FirstEnable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioReadMSW_FirstEnable in AQ_GlobalGeneralProvisioning_HHD */ -#define bits_AQ_GlobalGeneralProvisioning_HHD_mdioReadMSW_FirstEnable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioReadMSW_FirstEnable in AQ_GlobalGeneralProvisioning_HHD */ -#define word_AQ_GlobalGeneralProvisioning_HHD_mdioReadMSW_FirstEnable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioDriveConfiguration in AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_mdioDriveConfiguration 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioDriveConfiguration in AQ_GlobalGeneralProvisioning_HHD */ -#define bits_AQ_GlobalGeneralProvisioning_HHD_mdioDriveConfiguration u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioDriveConfiguration in AQ_GlobalGeneralProvisioning_HHD */ -#define word_AQ_GlobalGeneralProvisioning_HHD_mdioDriveConfiguration u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioPreambleDetectionDisable in AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_mdioPreambleDetectionDisable 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioPreambleDetectionDisable in AQ_GlobalGeneralProvisioning_HHD */ -#define bits_AQ_GlobalGeneralProvisioning_HHD_mdioPreambleDetectionDisable u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioPreambleDetectionDisable in AQ_GlobalGeneralProvisioning_HHD */ -#define word_AQ_GlobalGeneralProvisioning_HHD_mdioPreambleDetectionDisable u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure daisyChainReset in AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_daisyChainReset 2 -/*! \brief Preprocessor variable to relate field to bit position in structure daisyChainReset in AQ_GlobalGeneralProvisioning_HHD */ -#define bits_AQ_GlobalGeneralProvisioning_HHD_daisyChainReset u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure daisyChainReset in AQ_GlobalGeneralProvisioning_HHD */ -#define word_AQ_GlobalGeneralProvisioning_HHD_daisyChainReset u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioBroadcastAddressConfiguration in AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_mdioBroadcastAddressConfiguration 7 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioBroadcastAddressConfiguration in AQ_GlobalGeneralProvisioning_HHD */ -#define bits_AQ_GlobalGeneralProvisioning_HHD_mdioBroadcastAddressConfiguration u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure mdioBroadcastAddressConfiguration in AQ_GlobalGeneralProvisioning_HHD */ -#define word_AQ_GlobalGeneralProvisioning_HHD_mdioBroadcastAddressConfiguration u7.word_7 -/*! \brief Preprocessor variable to relate field to word number in structure mdioPreambleLength in AQ_GlobalGeneralProvisioning_HHD */ -#define AQ_GlobalGeneralProvisioning_HHD_mdioPreambleLength 9 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioPreambleLength in AQ_GlobalGeneralProvisioning_HHD */ -#define bits_AQ_GlobalGeneralProvisioning_HHD_mdioPreambleLength u9.bits_9 -/*! \brief Preprocessor variable to relate field to word position in structure mdioPreambleLength in AQ_GlobalGeneralProvisioning_HHD */ -#define word_AQ_GlobalGeneralProvisioning_HHD_mdioPreambleLength u9.word_9 - -/*! \brief Base register address of structure AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_baseRegisterAddress 0xC450 -/*! \brief MMD address of structure AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure nvrDataLength in AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_nvrDataLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDataLength in AQ_GlobalNvrProvisioning_HHD */ -#define bits_AQ_GlobalNvrProvisioning_HHD_nvrDataLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDataLength in AQ_GlobalNvrProvisioning_HHD */ -#define word_AQ_GlobalNvrProvisioning_HHD_nvrDataLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDummyLength in AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_nvrDummyLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDummyLength in AQ_GlobalNvrProvisioning_HHD */ -#define bits_AQ_GlobalNvrProvisioning_HHD_nvrDummyLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDummyLength in AQ_GlobalNvrProvisioning_HHD */ -#define word_AQ_GlobalNvrProvisioning_HHD_nvrDummyLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrAddressLength in AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_nvrAddressLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrAddressLength in AQ_GlobalNvrProvisioning_HHD */ -#define bits_AQ_GlobalNvrProvisioning_HHD_nvrAddressLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nvrAddressLength in AQ_GlobalNvrProvisioning_HHD */ -#define word_AQ_GlobalNvrProvisioning_HHD_nvrAddressLength u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nvrAddressLengthOverride in AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_nvrAddressLengthOverride 1 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrAddressLengthOverride in AQ_GlobalNvrProvisioning_HHD */ -#define bits_AQ_GlobalNvrProvisioning_HHD_nvrAddressLengthOverride u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure nvrAddressLengthOverride in AQ_GlobalNvrProvisioning_HHD */ -#define word_AQ_GlobalNvrProvisioning_HHD_nvrAddressLengthOverride u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrClockDivide in AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_nvrClockDivide 1 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrClockDivide in AQ_GlobalNvrProvisioning_HHD */ -#define bits_AQ_GlobalNvrProvisioning_HHD_nvrClockDivide u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure nvrClockDivide in AQ_GlobalNvrProvisioning_HHD */ -#define word_AQ_GlobalNvrProvisioning_HHD_nvrClockDivide u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDaisyChainClockDivideOverride in AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_nvrDaisyChainClockDivideOverride 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDaisyChainClockDivideOverride in AQ_GlobalNvrProvisioning_HHD */ -#define bits_AQ_GlobalNvrProvisioning_HHD_nvrDaisyChainClockDivideOverride u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDaisyChainClockDivideOverride in AQ_GlobalNvrProvisioning_HHD */ -#define word_AQ_GlobalNvrProvisioning_HHD_nvrDaisyChainClockDivideOverride u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDaisyChainDisable in AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_nvrDaisyChainDisable 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDaisyChainDisable in AQ_GlobalNvrProvisioning_HHD */ -#define bits_AQ_GlobalNvrProvisioning_HHD_nvrDaisyChainDisable u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDaisyChainDisable in AQ_GlobalNvrProvisioning_HHD */ -#define word_AQ_GlobalNvrProvisioning_HHD_nvrDaisyChainDisable u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure nvrReset in AQ_GlobalNvrProvisioning_HHD */ -#define AQ_GlobalNvrProvisioning_HHD_nvrReset 3 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrReset in AQ_GlobalNvrProvisioning_HHD */ -#define bits_AQ_GlobalNvrProvisioning_HHD_nvrReset u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure nvrReset in AQ_GlobalNvrProvisioning_HHD */ -#define word_AQ_GlobalNvrProvisioning_HHD_nvrReset u3.word_3 - -/*! \brief Base register address of structure AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_baseRegisterAddress 0xC470 -/*! \brief MMD address of structure AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure diagnosticsSelect in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_diagnosticsSelect 0 -/*! \brief Preprocessor variable to relate field to bit position in structure diagnosticsSelect in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_diagnosticsSelect u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure diagnosticsSelect in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_diagnosticsSelect u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure extendedMdiDiagnosticsSelect in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_extendedMdiDiagnosticsSelect 0 -/*! \brief Preprocessor variable to relate field to bit position in structure extendedMdiDiagnosticsSelect in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_extendedMdiDiagnosticsSelect u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure extendedMdiDiagnosticsSelect in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_extendedMdiDiagnosticsSelect u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure initiateCableDiagnostics in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_initiateCableDiagnostics 0 -/*! \brief Preprocessor variable to relate field to bit position in structure initiateCableDiagnostics in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_initiateCableDiagnostics u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure initiateCableDiagnostics in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_initiateCableDiagnostics u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure enableDaisy_chainHop_countOverride in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_enableDaisy_chainHop_countOverride 1 -/*! \brief Preprocessor variable to relate field to bit position in structure enableDaisy_chainHop_countOverride in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_enableDaisy_chainHop_countOverride u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure enableDaisy_chainHop_countOverride in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_enableDaisy_chainHop_countOverride u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure daisy_chainHop_countOverrideValue in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_daisy_chainHop_countOverrideValue 1 -/*! \brief Preprocessor variable to relate field to bit position in structure daisy_chainHop_countOverrideValue in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_daisy_chainHop_countOverrideValue u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure daisy_chainHop_countOverrideValue in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_daisy_chainHop_countOverrideValue u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure enableVddPowerSupplyTuning in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_enableVddPowerSupplyTuning 2 -/*! \brief Preprocessor variable to relate field to bit position in structure enableVddPowerSupplyTuning in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_enableVddPowerSupplyTuning u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure enableVddPowerSupplyTuning in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_enableVddPowerSupplyTuning u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure tunableExternalVddPowerSupplyPresent in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_tunableExternalVddPowerSupplyPresent 2 -/*! \brief Preprocessor variable to relate field to bit position in structure tunableExternalVddPowerSupplyPresent in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_tunableExternalVddPowerSupplyPresent u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure tunableExternalVddPowerSupplyPresent in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_tunableExternalVddPowerSupplyPresent u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure externalVddChangeRequest in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_externalVddChangeRequest 2 -/*! \brief Preprocessor variable to relate field to bit position in structure externalVddChangeRequest in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_externalVddChangeRequest u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure externalVddChangeRequest in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_externalVddChangeRequest u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure enableXenpakRegisterSpace in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_enableXenpakRegisterSpace 2 -/*! \brief Preprocessor variable to relate field to bit position in structure enableXenpakRegisterSpace in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_enableXenpakRegisterSpace u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure enableXenpakRegisterSpace in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_enableXenpakRegisterSpace u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure enable_5thChannelRfiCancellation in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_enable_5thChannelRfiCancellation 2 -/*! \brief Preprocessor variable to relate field to bit position in structure enable_5thChannelRfiCancellation in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_enable_5thChannelRfiCancellation u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure enable_5thChannelRfiCancellation in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_enable_5thChannelRfiCancellation u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure rateTransitionRequest in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_rateTransitionRequest 3 -/*! \brief Preprocessor variable to relate field to bit position in structure rateTransitionRequest in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_rateTransitionRequest u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure rateTransitionRequest in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_rateTransitionRequest u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure trainingSNR in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_trainingSNR 3 -/*! \brief Preprocessor variable to relate field to bit position in structure trainingSNR in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_trainingSNR u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure trainingSNR in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_trainingSNR u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_5 in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_5 4 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_5 in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_5 u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_5 in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_5 u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure nvrDaisyChainKickstart in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_nvrDaisyChainKickstart 4 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrDaisyChainKickstart in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_nvrDaisyChainKickstart u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure nvrDaisyChainKickstart in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_nvrDaisyChainKickstart u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure smartPower_downStatus in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_smartPower_downStatus 5 -/*! \brief Preprocessor variable to relate field to bit position in structure smartPower_downStatus in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_smartPower_downStatus u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure smartPower_downStatus in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_smartPower_downStatus u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_6 in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_6 5 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_6 in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_6 u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_6 in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_6 u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrLpDisableTimer in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_cfrLpDisableTimer 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrLpDisableTimer in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_cfrLpDisableTimer u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrLpDisableTimer in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_cfrLpDisableTimer u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrLpExtendedMaxwait in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_cfrLpExtendedMaxwait 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrLpExtendedMaxwait in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_cfrLpExtendedMaxwait u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrLpExtendedMaxwait in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_cfrLpExtendedMaxwait u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrLpTHP in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_cfrLpTHP 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrLpTHP in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_cfrLpTHP u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrLpTHP in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_cfrLpTHP u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrLpSupport in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_cfrLpSupport 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrLpSupport in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_cfrLpSupport u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrLpSupport in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_cfrLpSupport u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrDisableTimer in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_cfrDisableTimer 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrDisableTimer in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_cfrDisableTimer u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrDisableTimer in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_cfrDisableTimer u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrExtendedMaxwait in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_cfrExtendedMaxwait 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrExtendedMaxwait in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_cfrExtendedMaxwait u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrExtendedMaxwait in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_cfrExtendedMaxwait u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrTHP in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_cfrTHP 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrTHP in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_cfrTHP u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrTHP in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_cfrTHP u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure cfrSupport in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_cfrSupport 5 -/*! \brief Preprocessor variable to relate field to bit position in structure cfrSupport in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_cfrSupport u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure cfrSupport in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_cfrSupport u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure deadlockAvoidanceEnable in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_deadlockAvoidanceEnable 5 -/*! \brief Preprocessor variable to relate field to bit position in structure deadlockAvoidanceEnable in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_deadlockAvoidanceEnable u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure deadlockAvoidanceEnable in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_deadlockAvoidanceEnable u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure smartPower_downEnable in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_smartPower_downEnable 5 -/*! \brief Preprocessor variable to relate field to bit position in structure smartPower_downEnable in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_smartPower_downEnable u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure smartPower_downEnable in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_smartPower_downEnable u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure dteEnable in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_dteEnable 8 -/*! \brief Preprocessor variable to relate field to bit position in structure dteEnable in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_dteEnable u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure dteEnable in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_dteEnable u8.word_8 -/*! \brief Preprocessor variable to relate field to word number in structure dteDropReportingTimer in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_dteDropReportingTimer 8 -/*! \brief Preprocessor variable to relate field to bit position in structure dteDropReportingTimer in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_dteDropReportingTimer u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure dteDropReportingTimer in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_dteDropReportingTimer u8.word_8 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_9 in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_9 8 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_9 in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_9 u8.bits_8 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_9 in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_9 u8.word_8 -/*! \brief Preprocessor variable to relate field to word number in structure powerUpStall in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_powerUpStall 9 -/*! \brief Preprocessor variable to relate field to bit position in structure powerUpStall in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_powerUpStall u9.bits_9 -/*! \brief Preprocessor variable to relate field to word position in structure powerUpStall in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_powerUpStall u9.word_9 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_10 in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_10 9 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_10 in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_10 u9.bits_9 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_10 in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_10 u9.word_9 -/*! \brief Preprocessor variable to relate field to word number in structure loopbackControl in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_loopbackControl 10 -/*! \brief Preprocessor variable to relate field to bit position in structure loopbackControl in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_loopbackControl u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure loopbackControl in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_loopbackControl u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_11 in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_11 10 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_11 in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_11 u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_11 in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_11 u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure mdiPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_mdiPacketGeneration 10 -/*! \brief Preprocessor variable to relate field to bit position in structure mdiPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_mdiPacketGeneration u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure mdiPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_mdiPacketGeneration u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure look_asidePortPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_look_asidePortPacketGeneration 10 -/*! \brief Preprocessor variable to relate field to bit position in structure look_asidePortPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_look_asidePortPacketGeneration u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure look_asidePortPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_look_asidePortPacketGeneration u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure systemI_fPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_systemI_fPacketGeneration 10 -/*! \brief Preprocessor variable to relate field to bit position in structure systemI_fPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_systemI_fPacketGeneration u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure systemI_fPacketGeneration in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_systemI_fPacketGeneration u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_11a in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_11a 10 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_11a in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_11a u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_11a in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_11a u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure rate in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_rate 10 -/*! \brief Preprocessor variable to relate field to bit position in structure rate in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_rate u10.bits_10 -/*! \brief Preprocessor variable to relate field to word position in structure rate in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_rate u10.word_10 -/*! \brief Preprocessor variable to relate field to word number in structure reservedProvisioning_12 in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_12 11 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedProvisioning_12 in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_12 u11.bits_11 -/*! \brief Preprocessor variable to relate field to word position in structure reservedProvisioning_12 in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_reservedProvisioning_12 u11.word_11 -/*! \brief Preprocessor variable to relate field to word number in structure enableMacsec in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_enableMacsec 11 -/*! \brief Preprocessor variable to relate field to bit position in structure enableMacsec in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_enableMacsec u11.bits_11 -/*! \brief Preprocessor variable to relate field to word position in structure enableMacsec in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_enableMacsec u11.word_11 -/*! \brief Preprocessor variable to relate field to word number in structure enablePtp in AQ_GlobalReservedProvisioning_HHD */ -#define AQ_GlobalReservedProvisioning_HHD_enablePtp 11 -/*! \brief Preprocessor variable to relate field to bit position in structure enablePtp in AQ_GlobalReservedProvisioning_HHD */ -#define bits_AQ_GlobalReservedProvisioning_HHD_enablePtp u11.bits_11 -/*! \brief Preprocessor variable to relate field to word position in structure enablePtp in AQ_GlobalReservedProvisioning_HHD */ -#define word_AQ_GlobalReservedProvisioning_HHD_enablePtp u11.word_11 - -/*! \brief Base register address of structure AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_baseRegisterAddress 0xC47C -/*! \brief MMD address of structure AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pifMailboxAddress in AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_pifMailboxAddress 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pifMailboxAddress in AQ_PifMailboxControl_HHD */ -#define bits_AQ_PifMailboxControl_HHD_pifMailboxAddress u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pifMailboxAddress in AQ_PifMailboxControl_HHD */ -#define word_AQ_PifMailboxControl_HHD_pifMailboxAddress u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pifMailboxData in AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_pifMailboxData 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pifMailboxData in AQ_PifMailboxControl_HHD */ -#define bits_AQ_PifMailboxControl_HHD_pifMailboxData u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pifMailboxData in AQ_PifMailboxControl_HHD */ -#define word_AQ_PifMailboxControl_HHD_pifMailboxData u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reservedPifMailboxControl_3 in AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_reservedPifMailboxControl_3 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedPifMailboxControl_3 in AQ_PifMailboxControl_HHD */ -#define bits_AQ_PifMailboxControl_HHD_reservedPifMailboxControl_3 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reservedPifMailboxControl_3 in AQ_PifMailboxControl_HHD */ -#define word_AQ_PifMailboxControl_HHD_reservedPifMailboxControl_3 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pifMailboxCommandType in AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_pifMailboxCommandType 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pifMailboxCommandType in AQ_PifMailboxControl_HHD */ -#define bits_AQ_PifMailboxControl_HHD_pifMailboxCommandType u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pifMailboxCommandType in AQ_PifMailboxControl_HHD */ -#define word_AQ_PifMailboxControl_HHD_pifMailboxCommandType u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pifMailboxMMD in AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_pifMailboxMMD 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pifMailboxMMD in AQ_PifMailboxControl_HHD */ -#define bits_AQ_PifMailboxControl_HHD_pifMailboxMMD u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pifMailboxMMD in AQ_PifMailboxControl_HHD */ -#define word_AQ_PifMailboxControl_HHD_pifMailboxMMD u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reservedPifMailboxControl_4 in AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_reservedPifMailboxControl_4 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedPifMailboxControl_4 in AQ_PifMailboxControl_HHD */ -#define bits_AQ_PifMailboxControl_HHD_reservedPifMailboxControl_4 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reservedPifMailboxControl_4 in AQ_PifMailboxControl_HHD */ -#define word_AQ_PifMailboxControl_HHD_reservedPifMailboxControl_4 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pifMailboxCommandStatus in AQ_PifMailboxControl_HHD */ -#define AQ_PifMailboxControl_HHD_pifMailboxCommandStatus 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pifMailboxCommandStatus in AQ_PifMailboxControl_HHD */ -#define bits_AQ_PifMailboxControl_HHD_pifMailboxCommandStatus u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pifMailboxCommandStatus in AQ_PifMailboxControl_HHD */ -#define word_AQ_PifMailboxControl_HHD_pifMailboxCommandStatus u3.word_3 - -/*! \brief Base register address of structure AQ_GlobalSmbus_0Provisioning_HHD */ -#define AQ_GlobalSmbus_0Provisioning_HHD_baseRegisterAddress 0xC485 -/*! \brief MMD address of structure AQ_GlobalSmbus_0Provisioning_HHD */ -#define AQ_GlobalSmbus_0Provisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure smb_0SlaveAddress in AQ_GlobalSmbus_0Provisioning_HHD */ -#define AQ_GlobalSmbus_0Provisioning_HHD_smb_0SlaveAddress 0 -/*! \brief Preprocessor variable to relate field to bit position in structure smb_0SlaveAddress in AQ_GlobalSmbus_0Provisioning_HHD */ -#define bits_AQ_GlobalSmbus_0Provisioning_HHD_smb_0SlaveAddress u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure smb_0SlaveAddress in AQ_GlobalSmbus_0Provisioning_HHD */ -#define word_AQ_GlobalSmbus_0Provisioning_HHD_smb_0SlaveAddress u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalSmbus_1Provisioning_HHD */ -#define AQ_GlobalSmbus_1Provisioning_HHD_baseRegisterAddress 0xC495 -/*! \brief MMD address of structure AQ_GlobalSmbus_1Provisioning_HHD */ -#define AQ_GlobalSmbus_1Provisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure smb_1SlaveAddress in AQ_GlobalSmbus_1Provisioning_HHD */ -#define AQ_GlobalSmbus_1Provisioning_HHD_smb_1SlaveAddress 0 -/*! \brief Preprocessor variable to relate field to bit position in structure smb_1SlaveAddress in AQ_GlobalSmbus_1Provisioning_HHD */ -#define bits_AQ_GlobalSmbus_1Provisioning_HHD_smb_1SlaveAddress u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure smb_1SlaveAddress in AQ_GlobalSmbus_1Provisioning_HHD */ -#define word_AQ_GlobalSmbus_1Provisioning_HHD_smb_1SlaveAddress u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalEeeProvisioning_HHD */ -#define AQ_GlobalEeeProvisioning_HHD_baseRegisterAddress 0xC4A0 -/*! \brief MMD address of structure AQ_GlobalEeeProvisioning_HHD */ -#define AQ_GlobalEeeProvisioning_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure eeeMode in AQ_GlobalEeeProvisioning_HHD */ -#define AQ_GlobalEeeProvisioning_HHD_eeeMode 0 -/*! \brief Preprocessor variable to relate field to bit position in structure eeeMode in AQ_GlobalEeeProvisioning_HHD */ -#define bits_AQ_GlobalEeeProvisioning_HHD_eeeMode u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure eeeMode in AQ_GlobalEeeProvisioning_HHD */ -#define word_AQ_GlobalEeeProvisioning_HHD_eeeMode u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_baseRegisterAddress 0xC800 -/*! \brief MMD address of structure AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pairAStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairAStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairAStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairAStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairBStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairBStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairBStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairBStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairBStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairCStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairCStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairCStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairCStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairCStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairDStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairDStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairDStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairDStatus in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairDStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairAReflection_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairAReflection_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairAReflection_1 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairAReflection_2 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairAReflection_2 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairAReflection_2 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure impulseResponseMSW in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_impulseResponseMSW 2 -/*! \brief Preprocessor variable to relate field to bit position in structure impulseResponseMSW in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_impulseResponseMSW u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure impulseResponseMSW in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_impulseResponseMSW u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairBReflection_1 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairBReflection_1 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairBReflection_1 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairBReflection_2 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairBReflection_2 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairBReflection_2 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure impulseResponseLSW in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_impulseResponseLSW 4 -/*! \brief Preprocessor variable to relate field to bit position in structure impulseResponseLSW in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_impulseResponseLSW u4.bits_4 -/*! \brief Preprocessor variable to relate field to word position in structure impulseResponseLSW in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_impulseResponseLSW u4.word_4 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairCReflection_1 5 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairCReflection_1 u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairCReflection_1 u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairCReflection_2 5 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairCReflection_2 u5.bits_5 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairCReflection_2 u5.word_5 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_reserved_1 6 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_reserved_1 u6.bits_6 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_reserved_1 u6.word_6 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairDReflection_1 7 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairDReflection_1 u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_1 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairDReflection_1 u7.word_7 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define AQ_GlobalCableDiagnosticStatus_HHD_pairDReflection_2 7 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define bits_AQ_GlobalCableDiagnosticStatus_HHD_pairDReflection_2 u7.bits_7 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_2 in AQ_GlobalCableDiagnosticStatus_HHD */ -#define word_AQ_GlobalCableDiagnosticStatus_HHD_pairDReflection_2 u7.word_7 - -/*! \brief Base register address of structure AQ_GlobalThermalStatus_HHD */ -#define AQ_GlobalThermalStatus_HHD_baseRegisterAddress 0xC820 -/*! \brief MMD address of structure AQ_GlobalThermalStatus_HHD */ -#define AQ_GlobalThermalStatus_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure temperature in AQ_GlobalThermalStatus_HHD */ -#define AQ_GlobalThermalStatus_HHD_temperature 0 -/*! \brief Preprocessor variable to relate field to bit position in structure temperature in AQ_GlobalThermalStatus_HHD */ -#define bits_AQ_GlobalThermalStatus_HHD_temperature u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure temperature in AQ_GlobalThermalStatus_HHD */ -#define word_AQ_GlobalThermalStatus_HHD_temperature u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure temperatureReady in AQ_GlobalThermalStatus_HHD */ -#define AQ_GlobalThermalStatus_HHD_temperatureReady 1 -/*! \brief Preprocessor variable to relate field to bit position in structure temperatureReady in AQ_GlobalThermalStatus_HHD */ -#define bits_AQ_GlobalThermalStatus_HHD_temperatureReady u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure temperatureReady in AQ_GlobalThermalStatus_HHD */ -#define word_AQ_GlobalThermalStatus_HHD_temperatureReady u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalGeneralStatus_HHD */ -#define AQ_GlobalGeneralStatus_HHD_baseRegisterAddress 0xC830 -/*! \brief MMD address of structure AQ_GlobalGeneralStatus_HHD */ -#define AQ_GlobalGeneralStatus_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureFailureState in AQ_GlobalGeneralStatus_HHD */ -#define AQ_GlobalGeneralStatus_HHD_highTemperatureFailureState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureFailureState in AQ_GlobalGeneralStatus_HHD */ -#define bits_AQ_GlobalGeneralStatus_HHD_highTemperatureFailureState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureFailureState in AQ_GlobalGeneralStatus_HHD */ -#define word_AQ_GlobalGeneralStatus_HHD_highTemperatureFailureState u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureFailureState in AQ_GlobalGeneralStatus_HHD */ -#define AQ_GlobalGeneralStatus_HHD_lowTemperatureFailureState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureFailureState in AQ_GlobalGeneralStatus_HHD */ -#define bits_AQ_GlobalGeneralStatus_HHD_lowTemperatureFailureState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureFailureState in AQ_GlobalGeneralStatus_HHD */ -#define word_AQ_GlobalGeneralStatus_HHD_lowTemperatureFailureState u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureWarningState in AQ_GlobalGeneralStatus_HHD */ -#define AQ_GlobalGeneralStatus_HHD_highTemperatureWarningState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureWarningState in AQ_GlobalGeneralStatus_HHD */ -#define bits_AQ_GlobalGeneralStatus_HHD_highTemperatureWarningState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureWarningState in AQ_GlobalGeneralStatus_HHD */ -#define word_AQ_GlobalGeneralStatus_HHD_highTemperatureWarningState u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureWarningState in AQ_GlobalGeneralStatus_HHD */ -#define AQ_GlobalGeneralStatus_HHD_lowTemperatureWarningState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureWarningState in AQ_GlobalGeneralStatus_HHD */ -#define bits_AQ_GlobalGeneralStatus_HHD_lowTemperatureWarningState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureWarningState in AQ_GlobalGeneralStatus_HHD */ -#define word_AQ_GlobalGeneralStatus_HHD_lowTemperatureWarningState u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure processorIntensiveMdioOperationIn_Progress in AQ_GlobalGeneralStatus_HHD */ -#define AQ_GlobalGeneralStatus_HHD_processorIntensiveMdioOperationIn_Progress 1 -/*! \brief Preprocessor variable to relate field to bit position in structure processorIntensiveMdioOperationIn_Progress in AQ_GlobalGeneralStatus_HHD */ -#define bits_AQ_GlobalGeneralStatus_HHD_processorIntensiveMdioOperationIn_Progress u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure processorIntensiveMdioOperationIn_Progress in AQ_GlobalGeneralStatus_HHD */ -#define word_AQ_GlobalGeneralStatus_HHD_processorIntensiveMdioOperationIn_Progress u1.word_1 - -/*! \brief Base register address of structure AQ_GlobalPinStatus_HHD */ -#define AQ_GlobalPinStatus_HHD_baseRegisterAddress 0xC840 -/*! \brief MMD address of structure AQ_GlobalPinStatus_HHD */ -#define AQ_GlobalPinStatus_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure dcMasterN in AQ_GlobalPinStatus_HHD */ -#define AQ_GlobalPinStatus_HHD_dcMasterN 0 -/*! \brief Preprocessor variable to relate field to bit position in structure dcMasterN in AQ_GlobalPinStatus_HHD */ -#define bits_AQ_GlobalPinStatus_HHD_dcMasterN u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure dcMasterN in AQ_GlobalPinStatus_HHD */ -#define word_AQ_GlobalPinStatus_HHD_dcMasterN u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure packageConnectivity in AQ_GlobalPinStatus_HHD */ -#define AQ_GlobalPinStatus_HHD_packageConnectivity 0 -/*! \brief Preprocessor variable to relate field to bit position in structure packageConnectivity in AQ_GlobalPinStatus_HHD */ -#define bits_AQ_GlobalPinStatus_HHD_packageConnectivity u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure packageConnectivity in AQ_GlobalPinStatus_HHD */ -#define word_AQ_GlobalPinStatus_HHD_packageConnectivity u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure txEnable in AQ_GlobalPinStatus_HHD */ -#define AQ_GlobalPinStatus_HHD_txEnable 0 -/*! \brief Preprocessor variable to relate field to bit position in structure txEnable in AQ_GlobalPinStatus_HHD */ -#define bits_AQ_GlobalPinStatus_HHD_txEnable u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure txEnable in AQ_GlobalPinStatus_HHD */ -#define word_AQ_GlobalPinStatus_HHD_txEnable u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure ledPullupState in AQ_GlobalPinStatus_HHD */ -#define AQ_GlobalPinStatus_HHD_ledPullupState 0 -/*! \brief Preprocessor variable to relate field to bit position in structure ledPullupState in AQ_GlobalPinStatus_HHD */ -#define bits_AQ_GlobalPinStatus_HHD_ledPullupState u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure ledPullupState in AQ_GlobalPinStatus_HHD */ -#define word_AQ_GlobalPinStatus_HHD_ledPullupState u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalDaisyChainStatus_HHD */ -#define AQ_GlobalDaisyChainStatus_HHD_baseRegisterAddress 0xC842 -/*! \brief MMD address of structure AQ_GlobalDaisyChainStatus_HHD */ -#define AQ_GlobalDaisyChainStatus_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure rxDaisyChainCalculatedCrc in AQ_GlobalDaisyChainStatus_HHD */ -#define AQ_GlobalDaisyChainStatus_HHD_rxDaisyChainCalculatedCrc 0 -/*! \brief Preprocessor variable to relate field to bit position in structure rxDaisyChainCalculatedCrc in AQ_GlobalDaisyChainStatus_HHD */ -#define bits_AQ_GlobalDaisyChainStatus_HHD_rxDaisyChainCalculatedCrc u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure rxDaisyChainCalculatedCrc in AQ_GlobalDaisyChainStatus_HHD */ -#define word_AQ_GlobalDaisyChainStatus_HHD_rxDaisyChainCalculatedCrc u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalFaultMessage_HHD */ -#define AQ_GlobalFaultMessage_HHD_baseRegisterAddress 0xC850 -/*! \brief MMD address of structure AQ_GlobalFaultMessage_HHD */ -#define AQ_GlobalFaultMessage_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure message in AQ_GlobalFaultMessage_HHD */ -#define AQ_GlobalFaultMessage_HHD_message 0 -/*! \brief Preprocessor variable to relate field to bit position in structure message in AQ_GlobalFaultMessage_HHD */ -#define bits_AQ_GlobalFaultMessage_HHD_message u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure message in AQ_GlobalFaultMessage_HHD */ -#define word_AQ_GlobalFaultMessage_HHD_message u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_baseRegisterAddress 0xC880 -/*! \brief MMD address of structure AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure reserved_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_1 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_1 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_1 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_1 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_1 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_1 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_2 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_2 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_2 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_2 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_2 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_2 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_3 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_3 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_3 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_3 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_3 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_3 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_4 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_4 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_4 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pairAReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_4 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pairAReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_4 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pairAReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairAReflection_4 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_5 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_5 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_5 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_5 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_5 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_5 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_1 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_1 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_1 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_6 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_6 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_6 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_6 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_6 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_6 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_2 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_2 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_2 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_7 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_7 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_7 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_7 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_7 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_7 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_3 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_3 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_3 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_8 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_8 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_8 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_8 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_8 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_8 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure pairBReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_4 1 -/*! \brief Preprocessor variable to relate field to bit position in structure pairBReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_4 u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure pairBReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairBReflection_4 u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_9 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_9 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_9 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_9 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_9 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_9 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_1 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_1 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_1 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_10 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_10 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_10 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_10 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_10 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_10 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_2 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_2 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_2 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_11 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_11 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_11 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_11 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_11 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_11 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_3 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_3 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_3 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_12 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_12 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_12 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_12 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_12 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_12 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure pairCReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_4 2 -/*! \brief Preprocessor variable to relate field to bit position in structure pairCReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_4 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure pairCReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairCReflection_4 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_13 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_13 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_13 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_13 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_13 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_13 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_1 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_1 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_1 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_1 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_14 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_14 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_14 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_14 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_14 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_14 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_2 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_2 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_2 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_2 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_15 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_15 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_15 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_15 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_15 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_15 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_3 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_3 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_3 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_3 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reserved_16 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_reserved_16 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reserved_16 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_16 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reserved_16 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_reserved_16 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure pairDReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_4 3 -/*! \brief Preprocessor variable to relate field to bit position in structure pairDReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define bits_AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_4 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure pairDReflection_4 in AQ_GlobalCableDiagnosticImpedance_HHD */ -#define word_AQ_GlobalCableDiagnosticImpedance_HHD_pairDReflection_4 u3.word_3 - -/*! \brief Base register address of structure AQ_GlobalStatus_HHD */ -#define AQ_GlobalStatus_HHD_baseRegisterAddress 0xC884 -/*! \brief MMD address of structure AQ_GlobalStatus_HHD */ -#define AQ_GlobalStatus_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure reservedStatus_0 in AQ_GlobalStatus_HHD */ -#define AQ_GlobalStatus_HHD_reservedStatus_0 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedStatus_0 in AQ_GlobalStatus_HHD */ -#define bits_AQ_GlobalStatus_HHD_reservedStatus_0 u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedStatus_0 in AQ_GlobalStatus_HHD */ -#define word_AQ_GlobalStatus_HHD_reservedStatus_0 u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure cableLength in AQ_GlobalStatus_HHD */ -#define AQ_GlobalStatus_HHD_cableLength 0 -/*! \brief Preprocessor variable to relate field to bit position in structure cableLength in AQ_GlobalStatus_HHD */ -#define bits_AQ_GlobalStatus_HHD_cableLength u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure cableLength in AQ_GlobalStatus_HHD */ -#define word_AQ_GlobalStatus_HHD_cableLength u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_baseRegisterAddress 0xC885 -/*! \brief MMD address of structure AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure nearlySecondsMSW in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_nearlySecondsMSW 0 -/*! \brief Preprocessor variable to relate field to bit position in structure nearlySecondsMSW in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_nearlySecondsMSW u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure nearlySecondsMSW in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_nearlySecondsMSW u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure xenpakNvrStatus in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_xenpakNvrStatus 0 -/*! \brief Preprocessor variable to relate field to bit position in structure xenpakNvrStatus in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_xenpakNvrStatus u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure xenpakNvrStatus in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_xenpakNvrStatus u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure firmwareBuildID in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_firmwareBuildID 0 -/*! \brief Preprocessor variable to relate field to bit position in structure firmwareBuildID in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_firmwareBuildID u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure firmwareBuildID in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_firmwareBuildID u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure provisioningID in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_provisioningID 0 -/*! \brief Preprocessor variable to relate field to bit position in structure provisioningID in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_provisioningID u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure provisioningID in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_provisioningID u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure nearlySecondsLSW in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_nearlySecondsLSW 1 -/*! \brief Preprocessor variable to relate field to bit position in structure nearlySecondsLSW in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_nearlySecondsLSW u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure nearlySecondsLSW in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_nearlySecondsLSW u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure dteStatus in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_dteStatus 2 -/*! \brief Preprocessor variable to relate field to bit position in structure dteStatus in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_dteStatus u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure dteStatus in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_dteStatus u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure powerUpStallStatus in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_powerUpStallStatus 2 -/*! \brief Preprocessor variable to relate field to bit position in structure powerUpStallStatus in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_powerUpStallStatus u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure powerUpStallStatus in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_powerUpStallStatus u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure reservedStatus_3 in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_reservedStatus_3 2 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedStatus_3 in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_reservedStatus_3 u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure reservedStatus_3 in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_reservedStatus_3 u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure loopbackStatus in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_loopbackStatus 3 -/*! \brief Preprocessor variable to relate field to bit position in structure loopbackStatus in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_loopbackStatus u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure loopbackStatus in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_loopbackStatus u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reservedStatus_4 in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_reservedStatus_4 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedStatus_4 in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_reservedStatus_4 u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reservedStatus_4 in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_reservedStatus_4 u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure mdiPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_mdiPacketGenerationStatus 3 -/*! \brief Preprocessor variable to relate field to bit position in structure mdiPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_mdiPacketGenerationStatus u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure mdiPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_mdiPacketGenerationStatus u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure look_asidePortPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_look_asidePortPacketGenerationStatus 3 -/*! \brief Preprocessor variable to relate field to bit position in structure look_asidePortPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_look_asidePortPacketGenerationStatus u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure look_asidePortPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_look_asidePortPacketGenerationStatus u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure systemI_fPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_systemI_fPacketGenerationStatus 3 -/*! \brief Preprocessor variable to relate field to bit position in structure systemI_fPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_systemI_fPacketGenerationStatus u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure systemI_fPacketGenerationStatus in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_systemI_fPacketGenerationStatus u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure reservedStatus_4a in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_reservedStatus_4a 3 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedStatus_4a in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_reservedStatus_4a u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure reservedStatus_4a in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_reservedStatus_4a u3.word_3 -/*! \brief Preprocessor variable to relate field to word number in structure rate in AQ_GlobalReservedStatus_HHD */ -#define AQ_GlobalReservedStatus_HHD_rate 3 -/*! \brief Preprocessor variable to relate field to bit position in structure rate in AQ_GlobalReservedStatus_HHD */ -#define bits_AQ_GlobalReservedStatus_HHD_rate u3.bits_3 -/*! \brief Preprocessor variable to relate field to word position in structure rate in AQ_GlobalReservedStatus_HHD */ -#define word_AQ_GlobalReservedStatus_HHD_rate u3.word_3 - -/*! \brief Base register address of structure AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_baseRegisterAddress 0xCC00 -/*! \brief MMD address of structure AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureFailure in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_highTemperatureFailure 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureFailure in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_highTemperatureFailure u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureFailure in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_highTemperatureFailure u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureFailure in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_lowTemperatureFailure 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureFailure in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_lowTemperatureFailure u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureFailure in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_lowTemperatureFailure u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureWarning in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_highTemperatureWarning 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureWarning in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_highTemperatureWarning u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureWarning in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_highTemperatureWarning u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureWarning in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_lowTemperatureWarning 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureWarning in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_lowTemperatureWarning u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureWarning in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_lowTemperatureWarning u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure resetCompleted in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_resetCompleted 0 -/*! \brief Preprocessor variable to relate field to bit position in structure resetCompleted in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_resetCompleted u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure resetCompleted in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_resetCompleted u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure deviceFault in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_deviceFault 0 -/*! \brief Preprocessor variable to relate field to bit position in structure deviceFault in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_deviceFault u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure deviceFault in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_deviceFault u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmA in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_reservedAlarmA 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmA in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_reservedAlarmA u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmA in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_reservedAlarmA u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmB in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_reservedAlarmB 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmB in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_reservedAlarmB u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmB in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_reservedAlarmB u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmC in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_reservedAlarmC 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmC in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_reservedAlarmC u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmC in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_reservedAlarmC u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmD in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_reservedAlarmD 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmD in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_reservedAlarmD u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmD in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_reservedAlarmD u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure smartPower_downEntered in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_smartPower_downEntered 1 -/*! \brief Preprocessor variable to relate field to bit position in structure smartPower_downEntered in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_smartPower_downEntered u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure smartPower_downEntered in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_smartPower_downEntered u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure xenpakAlarm in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_xenpakAlarm 1 -/*! \brief Preprocessor variable to relate field to bit position in structure xenpakAlarm in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_xenpakAlarm u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure xenpakAlarm in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_xenpakAlarm u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure ipPhoneDetect in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_ipPhoneDetect 1 -/*! \brief Preprocessor variable to relate field to bit position in structure ipPhoneDetect in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_ipPhoneDetect u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure ipPhoneDetect in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_ipPhoneDetect u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure dteStatusChange in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_dteStatusChange 1 -/*! \brief Preprocessor variable to relate field to bit position in structure dteStatusChange in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_dteStatusChange u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure dteStatusChange in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_dteStatusChange u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarms in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_reservedAlarms 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarms in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_reservedAlarms u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarms in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_reservedAlarms u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioCommandHandlingOverflow in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_mdioCommandHandlingOverflow 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioCommandHandlingOverflow in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_mdioCommandHandlingOverflow u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioCommandHandlingOverflow in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_mdioCommandHandlingOverflow u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrOperationComplete in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_nvrOperationComplete 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrOperationComplete in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_nvrOperationComplete u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrOperationComplete in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_nvrOperationComplete u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mailboxOperation_Complete in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_mailboxOperation_Complete 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mailboxOperation_Complete in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_mailboxOperation_Complete u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mailboxOperation_Complete in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_mailboxOperation_Complete u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upDramParityError in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_upDramParityError 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upDramParityError in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_upDramParityError u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upDramParityError in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_upDramParityError u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upIramParityError in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_upIramParityError 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upIramParityError in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_upIramParityError u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upIramParityError in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_upIramParityError u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure txEnableStateChange in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_txEnableStateChange 2 -/*! \brief Preprocessor variable to relate field to bit position in structure txEnableStateChange in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_txEnableStateChange u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure txEnableStateChange in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_txEnableStateChange u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioMMD_Error in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_mdioMMD_Error 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioMMD_Error in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_mdioMMD_Error u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mdioMMD_Error in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_mdioMMD_Error u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioTimeoutError in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_mdioTimeoutError 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioTimeoutError in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_mdioTimeoutError u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mdioTimeoutError in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_mdioTimeoutError u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure watchdogTimerAlarm in AQ_GlobalAlarms_HHD */ -#define AQ_GlobalAlarms_HHD_watchdogTimerAlarm 2 -/*! \brief Preprocessor variable to relate field to bit position in structure watchdogTimerAlarm in AQ_GlobalAlarms_HHD */ -#define bits_AQ_GlobalAlarms_HHD_watchdogTimerAlarm u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure watchdogTimerAlarm in AQ_GlobalAlarms_HHD */ -#define word_AQ_GlobalAlarms_HHD_watchdogTimerAlarm u2.word_2 - -/*! \brief Base register address of structure AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_baseRegisterAddress 0xD400 -/*! \brief MMD address of structure AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureFailureMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_highTemperatureFailureMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureFailureMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_highTemperatureFailureMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureFailureMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_highTemperatureFailureMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureFailureMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_lowTemperatureFailureMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureFailureMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_lowTemperatureFailureMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureFailureMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_lowTemperatureFailureMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure highTemperatureWarningMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_highTemperatureWarningMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure highTemperatureWarningMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_highTemperatureWarningMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure highTemperatureWarningMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_highTemperatureWarningMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure lowTemperatureWarningMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_lowTemperatureWarningMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure lowTemperatureWarningMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_lowTemperatureWarningMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure lowTemperatureWarningMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_lowTemperatureWarningMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure resetCompletedMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_resetCompletedMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure resetCompletedMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_resetCompletedMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure resetCompletedMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_resetCompletedMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure deviceFaultMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_deviceFaultMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure deviceFaultMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_deviceFaultMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure deviceFaultMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_deviceFaultMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmAMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_reservedAlarmAMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmAMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_reservedAlarmAMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmAMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_reservedAlarmAMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmBMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_reservedAlarmBMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmBMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_reservedAlarmBMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmBMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_reservedAlarmBMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmCMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_reservedAlarmCMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmCMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_reservedAlarmCMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmCMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_reservedAlarmCMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmDMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_reservedAlarmDMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmDMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_reservedAlarmDMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmDMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_reservedAlarmDMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure smartPower_downEnteredMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_smartPower_downEnteredMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure smartPower_downEnteredMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_smartPower_downEnteredMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure smartPower_downEnteredMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_smartPower_downEnteredMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure xenpakAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_xenpakAlarmMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure xenpakAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_xenpakAlarmMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure xenpakAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_xenpakAlarmMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure ipPhoneDetectMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_ipPhoneDetectMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure ipPhoneDetectMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_ipPhoneDetectMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure ipPhoneDetectMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_ipPhoneDetectMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure dteStatusChangeMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_dteStatusChangeMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure dteStatusChangeMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_dteStatusChangeMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure dteStatusChangeMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_dteStatusChangeMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure reservedAlarmsMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_reservedAlarmsMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure reservedAlarmsMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_reservedAlarmsMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure reservedAlarmsMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_reservedAlarmsMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure mdioCommandHandlingOverflowMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_mdioCommandHandlingOverflowMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioCommandHandlingOverflowMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_mdioCommandHandlingOverflowMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure mdioCommandHandlingOverflowMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_mdioCommandHandlingOverflowMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure diagnosticAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_diagnosticAlarmMask 1 -/*! \brief Preprocessor variable to relate field to bit position in structure diagnosticAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_diagnosticAlarmMask u1.bits_1 -/*! \brief Preprocessor variable to relate field to word position in structure diagnosticAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_diagnosticAlarmMask u1.word_1 -/*! \brief Preprocessor variable to relate field to word number in structure nvrOperationCompleteMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_nvrOperationCompleteMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure nvrOperationCompleteMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_nvrOperationCompleteMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure nvrOperationCompleteMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_nvrOperationCompleteMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mailboxOperationCompleteMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_mailboxOperationCompleteMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mailboxOperationCompleteMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_mailboxOperationCompleteMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mailboxOperationCompleteMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_mailboxOperationCompleteMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upDramParityErrorMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_upDramParityErrorMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upDramParityErrorMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_upDramParityErrorMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upDramParityErrorMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_upDramParityErrorMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure upIramParityErrorMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_upIramParityErrorMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure upIramParityErrorMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_upIramParityErrorMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure upIramParityErrorMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_upIramParityErrorMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure txEnableStateChangeMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_txEnableStateChangeMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure txEnableStateChangeMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_txEnableStateChangeMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure txEnableStateChangeMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_txEnableStateChangeMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioMMD_ErrorMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_mdioMMD_ErrorMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioMMD_ErrorMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_mdioMMD_ErrorMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mdioMMD_ErrorMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_mdioMMD_ErrorMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure mdioTimeoutErrorMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_mdioTimeoutErrorMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure mdioTimeoutErrorMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_mdioTimeoutErrorMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure mdioTimeoutErrorMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_mdioTimeoutErrorMask u2.word_2 -/*! \brief Preprocessor variable to relate field to word number in structure watchdogTimerAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define AQ_GlobalInterruptMask_HHD_watchdogTimerAlarmMask 2 -/*! \brief Preprocessor variable to relate field to bit position in structure watchdogTimerAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define bits_AQ_GlobalInterruptMask_HHD_watchdogTimerAlarmMask u2.bits_2 -/*! \brief Preprocessor variable to relate field to word position in structure watchdogTimerAlarmMask in AQ_GlobalInterruptMask_HHD */ -#define word_AQ_GlobalInterruptMask_HHD_watchdogTimerAlarmMask u2.word_2 - -/*! \brief Base register address of structure AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_baseRegisterAddress 0xFC00 -/*! \brief MMD address of structure AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pmaStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_pmaStandardAlarm_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pmaStandardAlarm_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pmaStandardAlarm_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pmaStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_pmaStandardAlarm_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pmaStandardAlarm_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pmaStandardAlarm_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_3Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_3Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_3Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_3Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_3Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_pcsStandardAlarm_3Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_StandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_phyXS_StandardAlarms_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_StandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_phyXS_StandardAlarms_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_StandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_phyXS_StandardAlarms_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_StandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_phyXS_StandardAlarms_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_StandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_phyXS_StandardAlarms_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_StandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_phyXS_StandardAlarms_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationStandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_autonegotiationStandardAlarms_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationStandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_autonegotiationStandardAlarms_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationStandardAlarms_1Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_autonegotiationStandardAlarms_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationStandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_autonegotiationStandardAlarms_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationStandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_autonegotiationStandardAlarms_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationStandardAlarms_2Interrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_autonegotiationStandardAlarms_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gbeStandardAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_gbeStandardAlarmsInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gbeStandardAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_gbeStandardAlarmsInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gbeStandardAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_gbeStandardAlarmsInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure allVendorAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define AQ_GlobalChip_wideStandardInterruptFlags_HHD_allVendorAlarmsInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure allVendorAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideStandardInterruptFlags_HHD_allVendorAlarmsInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure allVendorAlarmsInterrupt in AQ_GlobalChip_wideStandardInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideStandardInterruptFlags_HHD_allVendorAlarmsInterrupt u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_baseRegisterAddress 0xFC01 -/*! \brief MMD address of structure AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pmaVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_pmaVendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_HHD_pmaVendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_HHD_pmaVendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_pcsVendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_HHD_pcsVendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_HHD_pcsVendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_VendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_phyXS_VendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_VendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_HHD_phyXS_VendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_VendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_HHD_phyXS_VendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_autonegotiationVendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_HHD_autonegotiationVendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_HHD_autonegotiationVendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gbeVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_gbeVendorAlarmInterrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gbeVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_HHD_gbeVendorAlarmInterrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gbeVendorAlarmInterrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_HHD_gbeVendorAlarmInterrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_1Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_1Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_1Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_1Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_1Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_1Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_2Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_2Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_2Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_2Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_2Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_2Interrupt u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_3Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_3Interrupt 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_3Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define bits_AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_3Interrupt u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_3Interrupt in AQ_GlobalChip_wideVendorInterruptFlags_HHD */ -#define word_AQ_GlobalChip_wideVendorInterruptFlags_HHD_globalAlarms_3Interrupt u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_baseRegisterAddress 0xFF00 -/*! \brief MMD address of structure AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pmaStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_pmaStandardAlarm_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_pmaStandardAlarm_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_pmaStandardAlarm_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pmaStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_pmaStandardAlarm_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_pmaStandardAlarm_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_pmaStandardAlarm_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsStandardAlarm_3InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_3InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsStandardAlarm_3InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_3InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsStandardAlarm_3InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_pcsStandardAlarm_3InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_StandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_phyXS_StandardAlarms_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_StandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_phyXS_StandardAlarms_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_StandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_phyXS_StandardAlarms_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_StandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_phyXS_StandardAlarms_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_StandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_phyXS_StandardAlarms_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_StandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_phyXS_StandardAlarms_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationStandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_autonegotiationStandardAlarms_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationStandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_autonegotiationStandardAlarms_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationStandardAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_autonegotiationStandardAlarms_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationStandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_autonegotiationStandardAlarms_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationStandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_autonegotiationStandardAlarms_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationStandardAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_autonegotiationStandardAlarms_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gbeStandardAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_gbeStandardAlarmsInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gbeStandardAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_gbeStandardAlarmsInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gbeStandardAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_gbeStandardAlarmsInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure allVendorAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define AQ_GlobalInterruptChip_wideStandardMask_HHD_allVendorAlarmsInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure allVendorAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideStandardMask_HHD_allVendorAlarmsInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure allVendorAlarmsInterruptMask in AQ_GlobalInterruptChip_wideStandardMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideStandardMask_HHD_allVendorAlarmsInterruptMask u0.word_0 - -/*! \brief Base register address of structure AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_baseRegisterAddress 0xFF01 -/*! \brief MMD address of structure AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_mmdAddress 0x1E -/*! \brief Preprocessor variable to relate field to word number in structure pmaVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_pmaVendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pmaVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_HHD_pmaVendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pmaVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_HHD_pmaVendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure pcsVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_pcsVendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure pcsVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_HHD_pcsVendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure pcsVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_HHD_pcsVendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure phyXS_VendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_phyXS_VendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure phyXS_VendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_HHD_phyXS_VendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure phyXS_VendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_HHD_phyXS_VendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure autonegotiationVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_autonegotiationVendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure autonegotiationVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_HHD_autonegotiationVendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure autonegotiationVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_HHD_autonegotiationVendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure gbeVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_gbeVendorAlarmInterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure gbeVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_HHD_gbeVendorAlarmInterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure gbeVendorAlarmInterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_HHD_gbeVendorAlarmInterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_1InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_1InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_1InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_1InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_2InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_2InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_2InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_2InterruptMask u0.word_0 -/*! \brief Preprocessor variable to relate field to word number in structure globalAlarms_3InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_3InterruptMask 0 -/*! \brief Preprocessor variable to relate field to bit position in structure globalAlarms_3InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define bits_AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_3InterruptMask u0.bits_0 -/*! \brief Preprocessor variable to relate field to word position in structure globalAlarms_3InterruptMask in AQ_GlobalInterruptChip_wideVendorMask_HHD */ -#define word_AQ_GlobalInterruptChip_wideVendorMask_HHD_globalAlarms_3InterruptMask u0.word_0 -#endif -/*@}*/ -/*@}*/ diff --git a/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers_reversed.h b/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers_reversed.h deleted file mode 100755 index f6fe99831..000000000 --- a/feeds/ipq807x/aq-fw-download/src/include/registerMap/HHD/AQ_HHD_Global_registers_reversed.h +++ /dev/null @@ -1,12123 +0,0 @@ -/*! \file -* This file contains the data structures and doxygen comments -* for the Global Registers block. - */ - -/*! \addtogroup registerMap - @{ -*/ - -/*! \defgroup Global_registers Global Registers -* This module contains the data structures and doxygen comments -* for the Global Registers block. - */ -/*********************************************************************** -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* $Date: 2014/04/08 $ -* -* $Label: $ -* -* Description: -* -* This file contains the c header structures for the registers contained in the Global Registers block. -* -* The bit fields in this structure are from MSbit to LSbit -* -***********************************************************************/ - - -/*@{*/ -#ifndef AQ_HHD_GLOBAL_REGS_HEADER -#define AQ_HHD_GLOBAL_REGS_HEADER - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Control 1: 1E.0000 */ -/* Global Standard Control 1: 1E.0000 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Control 1 */ - union - { - struct - { - /*! \brief 1E.0000.F R/WSC Soft Reset - AQ_GlobalStandardControl_1_HHD.u0.bits_0.softReset - - Default = 0x1 - - 1 = Global soft reset - 0 = Normal operation - - - Notes: - Resets the entire PHY. - Setting this bit initiates a global soft reset on all of the digital logic not including the microprocessor (i.e. microprocessor is not reset). Upon completion of the reset sequence, this bit is set back to 0by the microprocessor. Note this bit is OR'ed with the individual MMD resets. This bit should be set to 0 before setting the individual MMD resets. */ - unsigned int softReset : 1; /* 1E.0000.F R/WSC Default = 0x1 */ - /* 1 = Global soft reset - 0 = Normal operation - */ - unsigned int reserved0 : 3; - /*! \brief 1E.0000.B R/WPD Low Power - AQ_GlobalStandardControl_1_HHD.u0.bits_0.lowPower - - Provisionable Default = 0x0 - - 1 = Low-power mode - 0 = Normal operation - - - Notes: - A one written to this register causes the chip to enter low-power mode. This bit puts the entire chip in low-power mode, with only the MDIO and microprocessor functioning, and turns off the analog front-end: i.e. places it in high-impedance mode. Setting this bit also sets all of the Low Power bits in the other MMDs. */ - unsigned int lowPower : 1; /* 1E.0000.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Low-power mode - 0 = Normal operation - */ - unsigned int reserved1 : 11; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardControl_1_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Device Identifier: 1E.0002 */ -/* Global Standard Device Identifier: 1E.0002 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Device Identifier */ - union - { - struct - { - /*! \brief 1E.0002.F:0 RO Device ID MSW [1F:10] - AQ_GlobalStandardDeviceIdentifier_HHD.u0.bits_0.deviceIdMSW - - - - Bits 31 - 16 of Device ID - */ - unsigned int deviceIdMSW : 16; /* 1E.0002.F:0 RO */ - /* Bits 31 - 16 of Device ID */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Standard Device Identifier */ - union - { - struct - { - /*! \brief 1E.0003.F:0 RO Device ID LSW [F:0] - AQ_GlobalStandardDeviceIdentifier_HHD.u1.bits_1.deviceIdLSW - - - - Bits 15 - 0 of Device ID - */ - unsigned int deviceIdLSW : 16; /* 1E.0003.F:0 RO */ - /* Bits 15 - 0 of Device ID */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalStandardDeviceIdentifier_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Devices in Package: 1E.0005 */ -/* Global Standard Devices in Package: 1E.0005 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Devices in Package */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.0005.7 ROS Autonegotiation Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.autonegotiationPresent - - Default = 0x1 - - 1 = Autonegotiation is present in package - 0 = Autonegotiation is not present in package - - Notes: - This is always set to 1, as there is Autonegotiation in the PHY. */ - unsigned int autonegotiationPresent : 1; /* 1E.0005.7 ROS Default = 0x1 */ - /* 1 = Autonegotiation is present in package - 0 = Autonegotiation is not present in package */ - /*! \brief 1E.0005.6 ROS TC Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.tcPresent - - Default = 0x0 - - 1 = TC is present in package - 0 = TC is not present in package - - Notes: - This is always set to 0, as there is no TC functionality in the PHY. */ - unsigned int tcPresent : 1; /* 1E.0005.6 ROS Default = 0x0 */ - /* 1 = TC is present in package - 0 = TC is not present in package */ - /*! \brief 1E.0005.5 ROS DTE XS Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.dteXsPresent - - Default = 0x0 - - 1 = DTE XS is present in package - 0 = DTE XS is not present in package - - - Notes: - This is always set to 0, as there is no DTE XAUI interface in the PHY. */ - unsigned int dteXsPresent : 1; /* 1E.0005.5 ROS Default = 0x0 */ - /* 1 = DTE XS is present in package - 0 = DTE XS is not present in package - */ - /*! \brief 1E.0005.4 ROS PHY XS Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.phyXS_Present - - Default = 0x1 - - 1 = PHY XS is present in package - 0 = PHY XS is not present in package - - Notes: - This is always set to 1 as there is a PHY XS interface in the PHY. */ - unsigned int phyXS_Present : 1; /* 1E.0005.4 ROS Default = 0x1 */ - /* 1 = PHY XS is present in package - 0 = PHY XS is not present in package */ - /*! \brief 1E.0005.3 ROS PCS Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.pcsPresent - - Default = 0x1 - - 1 = PCS is present in package - 0 = PCS is not present in package - - Notes: - This is always set to 1 as there is PCS functionality in the PHY. */ - unsigned int pcsPresent : 1; /* 1E.0005.3 ROS Default = 0x1 */ - /* 1 = PCS is present in package - 0 = PCS is not present in package */ - /*! \brief 1E.0005.2 ROS WIS Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.wisPresent - - Default = 0x0 - - 1 = WIS is present in package - 0 = WIS is not present in package - - Notes: - This is always set to 0, as there is no WIS functionality in the PHY. */ - unsigned int wisPresent : 1; /* 1E.0005.2 ROS Default = 0x0 */ - /* 1 = WIS is present in package - 0 = WIS is not present in package */ - /*! \brief 1E.0005.1 ROS PMA Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.pmaPresent - - Default = 0x1 - - 1 = PMA is present in package - 0 = PMA is not present - - Notes: - This is always set to 1 as there is PMA functionality in the PHY. */ - unsigned int pmaPresent : 1; /* 1E.0005.1 ROS Default = 0x1 */ - /* 1 = PMA is present in package - 0 = PMA is not present */ - /*! \brief 1E.0005.0 ROS Clause 22 Registers Present - AQ_GlobalStandardDevicesInPackage_HHD.u0.bits_0.clause_22RegistersPresent - - Default = 0x0 - - 1 = Clause 22 registers are present in package - 0 = Clause 22 registers are not present in package - - Notes: - This is always set to 0 in the PHY, as there are no Clause 22 registers in the device. */ - unsigned int clause_22RegistersPresent : 1; /* 1E.0005.0 ROS Default = 0x0 */ - /* 1 = Clause 22 registers are present in package - 0 = Clause 22 registers are not present in package */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardDevicesInPackage_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Vendor Devices in Package: 1E.0006 */ -/* Global Standard Vendor Devices in Package: 1E.0006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Vendor Devices in Package */ - union - { - struct - { - /*! \brief 1E.0006.F ROS Vendor Specific Device #2 Present - AQ_GlobalStandardVendorDevicesInPackage_HHD.u0.bits_0.vendorSpecificDevice_2Present - - Default = 0x1 - - 1 = Device #2 is present in package - 0 = Device #2 is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the DSP PMA registers. */ - unsigned int vendorSpecificDevice_2Present : 1; /* 1E.0006.F ROS Default = 0x1 */ - /* 1 = Device #2 is present in package - 0 = Device #2 is not present in package */ - /*! \brief 1E.0006.E ROS Vendor Specific Device #1 Present - AQ_GlobalStandardVendorDevicesInPackage_HHD.u0.bits_0.vendorSpecificDevice_1Present - - Default = 0x1 - - 1 = Device #1 is present in package - 0 = Device #1 is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the global control registers. */ - unsigned int vendorSpecificDevice_1Present : 1; /* 1E.0006.E ROS Default = 0x1 */ - /* 1 = Device #1 is present in package - 0 = Device #1 is not present in package */ - /*! \brief 1E.0006.D ROS Clause 22 Extension Present - AQ_GlobalStandardVendorDevicesInPackage_HHD.u0.bits_0.clause_22ExtensionPresent - - Default = 0x1 - - 1 = Clause 22 Extension is present in package - 0 = Clause 22 Extension is not present in package - - Notes: - This is always set to 1 as the PHY utilizes this device for the GbE registers. */ - unsigned int clause_22ExtensionPresent : 1; /* 1E.0006.D ROS Default = 0x1 */ - /* 1 = Clause 22 Extension is present in package - 0 = Clause 22 Extension is not present in package */ - unsigned int reserved0 : 13; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardVendorDevicesInPackage_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Status 2: 1E.0008 */ -/* Global Standard Status 2: 1E.0008 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Status 2 */ - union - { - struct - { - /*! \brief 1E.0008.F:E ROS Device Present [1:0] - AQ_GlobalStandardStatus_2_HHD.u0.bits_0.devicePresent - - Default = 0x2 - - [F:E] - 0x3 = No device at this address - 0x2 = Device present at this address - 0x1 = No device at this address - 0x0 = No device at this address - - Notes: - This field is always set to 0x2, as the Global MMD resides here in the PHY. */ - unsigned int devicePresent : 2; /* 1E.0008.F:E ROS Default = 0x2 */ - /* [F:E] - 0x3 = No device at this address - 0x2 = Device present at this address - 0x1 = No device at this address - 0x0 = No device at this address */ - unsigned int reserved0 : 14; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStandardStatus_2_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Standard Package Identifier: 1E.000E */ -/* Global Standard Package Identifier: 1E.000E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Standard Package Identifier */ - union - { - struct - { - /*! \brief 1E.000E.F:0 RO Package ID MSW [1F:10] - AQ_GlobalStandardPackageIdentifier_HHD.u0.bits_0.packageIdMSW - - - - Bits 31- 16 of Package ID - */ - unsigned int packageIdMSW : 16; /* 1E.000E.F:0 RO */ - /* Bits 31- 16 of Package ID */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Standard Package Identifier */ - union - { - struct - { - /*! \brief 1E.000F.F:0 RO Package ID LSW [F:0] - AQ_GlobalStandardPackageIdentifier_HHD.u1.bits_1.packageIdLSW - - - - Bits 15 - 0 of Package ID - */ - unsigned int packageIdLSW : 16; /* 1E.000F.F:0 RO */ - /* Bits 15 - 0 of Package ID */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalStandardPackageIdentifier_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Firmware ID: 1E.0020 */ -/* Global Firmware ID: 1E.0020 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Firmware ID */ - union - { - struct - { - /*! \brief 1E.0020.F:8 RO Firmware Major Revision Number [7:0] - AQ_GlobalFirmwareID_HHD.u0.bits_0.firmwareMajorRevisionNumber - - - - [F:8] = Major revision number - - Notes: - - - The lower six bits of major and minor firmware revision are exchanged in autonegotiation when the PHYID message is sent. */ - unsigned int firmwareMajorRevisionNumber : 8; /* 1E.0020.F:8 RO */ - /* [F:8] = Major revision number */ - /*! \brief 1E.0020.7:0 RO Firmware Minor Revision Number [7:0] - AQ_GlobalFirmwareID_HHD.u0.bits_0.firmwareMinorRevisionNumber - - - - [7:0] = Minor revision number - - Notes: - - - The lower six bits of major and minor firmware revision are exchanged in autonegotiation when the PHYID message is sent. */ - unsigned int firmwareMinorRevisionNumber : 8; /* 1E.0020.7:0 RO */ - /* [7:0] = Minor revision number */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalFirmwareID_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global NVR Interface: 1E.0100 */ -/* Global NVR Interface: 1E.0100 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0100.F R/WSC NVR Execute Operation - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrExecuteOperation - - Default = 0x0 - - 1 = Start NVR Operation - - - - Notes: - When set to 1, the NVR operation will begin. Ensure that the uP is stalled using the See MCP Run Stall bit to ensure no NVR contention. */ - unsigned int nvrExecuteOperation : 1; /* 1E.0100.F R/WSC Default = 0x0 */ - /* 1 = Start NVR Operation - - */ - /*! \brief 1E.0100.E R/W NVR Write Mode - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrWriteMode - - Default = 0x0 - - 1 = Write to NVR - 0 = Read from NVR - - */ - unsigned int nvrWriteMode : 1; /* 1E.0100.E R/W Default = 0x0 */ - /* 1 = Write to NVR - 0 = Read from NVR - */ - /*! \brief 1E.0100.D R/W Freeze NVR CRC - AQ_GlobalNvrInterface_HHD.u0.bits_0.freezeNvrCrc - - Default = 0x0 - - 1 = Freeze NVR Mailbox CRC calculation register - - - Notes: - To prevent an erroneous answer, this bit should not be set at the same time the See NVR Operation Valid bit is set. */ - unsigned int freezeNvrCrc : 1; /* 1E.0100.D R/W Default = 0x0 */ - /* 1 = Freeze NVR Mailbox CRC calculation register - */ - /*! \brief 1E.0100.C R/WSC Reset NVR CRC - AQ_GlobalNvrInterface_HHD.u0.bits_0.resetNvrCrc - - Default = 0x0 - - 1 = Reset NVR Mailbox CRC calculation register - - - - Notes: - To prevent an erroneous answer, this bit should not be set at the same time the See NVR Operation Valid bit is set. */ - unsigned int resetNvrCrc : 1; /* 1E.0100.C R/WSC Default = 0x0 */ - /* 1 = Reset NVR Mailbox CRC calculation register - - */ - unsigned int reserved0 : 1; - /*! \brief 1E.0100.A R/W NVR Burst - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrBurst - - Default = 0x0 - - 0 = Single read or write operation of up to 4 bytes - 1 = Burst operation - - - Notes: - When this bit is set, the operation is a burst operation where more than 32-bits is read from the NVR or written to the NVR. This bit should be set to one until the last burst in the read or write operation, when it should be set to zero. It operates by gating the SPI clock, and not restarting it until new data is ready to be written, or the previous contents have been read. Each burst of data requires the NVR Execute Operation bit to be set to initiate the next phase. */ - unsigned int nvrBurst : 1; /* 1E.0100.A R/W Default = 0x0 */ - /* 0 = Single read or write operation of up to 4 bytes - 1 = Burst operation - */ - unsigned int reserved1 : 1; - /*! \brief 1E.0100.8 RO NVR Busy - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrBusy - - - - 1 = NVR is busy - 0 = NVR is ready - - - Notes: - When set to 1, the NVR is busy. A new NVR operation should not occur until this bit is 0. If the NVR clock is greater than 64/63 of the MDIO clock, this bit never needs to be polled when operating over the MDIO. */ - unsigned int nvrBusy : 1; /* 1E.0100.8 RO */ - /* 1 = NVR is busy - 0 = NVR is ready - */ - /*! \brief 1E.0100.7:0 R/W NVR Opcode [7:0] - AQ_GlobalNvrInterface_HHD.u0.bits_0.nvrOpcode - - Default = 0x03 - - NVR instruction opcode - - */ - unsigned int nvrOpcode : 8; /* 1E.0100.7:0 R/W Default = 0x03 */ - /* NVR instruction opcode - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0101.F:0 RO NVR Mailbox CRC [F:0] - AQ_GlobalNvrInterface_HHD.u1.bits_1.nvrMailboxCrc - - - - The running CRC-16 of everything passing through the NVR interface - - - Notes: - The CRC-16 over all data written or read through the NVR interface. The CRC-16 is calculated by dividing the data by: - x^16 + x^12 + x^5 + 1 */ - unsigned int nvrMailboxCrc : 16; /* 1E.0101.F:0 RO */ - /* The running CRC-16 of everything passing through the NVR interface - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global NVR Interface */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.0102.7:0 R/W NVR Address MSW [17:10] - AQ_GlobalNvrInterface_HHD.u2.bits_2.nvrAddressMSW - - Default = 0x00 - - NVR address MSW bits [17:10] - - - Notes: - The address of where to read and write from in the NVR. This is self-incrementing and will automatically increment after each read or write operation. The increment amount is based on the data length (i.e. increments by 4 if the data length is 4 bytes) */ - unsigned int nvrAddressMSW : 8; /* 1E.0102.7:0 R/W Default = 0x00 */ - /* NVR address MSW bits [17:10] - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0103.F:0 R/W NVR Address LSW [F:0] - AQ_GlobalNvrInterface_HHD.u3.bits_3.nvrAddressLSW - - Default = 0x0000 - - NVR address LSW bits [F:0] - - - Notes: - The address of where to read and write from in the NVR. This is self-incrementing and will automatically increment after each read or write operation. */ - unsigned int nvrAddressLSW : 16; /* 1E.0103.F:0 R/W Default = 0x0000 */ - /* NVR address LSW bits [F:0] - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0104.F:0 R/W NVR Data MSW [1F:10] - AQ_GlobalNvrInterface_HHD.u4.bits_4.nvrDataMSW - - Default = 0x0000 - - NVR data MSW bits [1F:10] - - - Notes: - Data is stored and read-out from these registers in little-endian format for operations such as FLASH device ID, and for programming the processor. - - For instance the 64K Atmel device code reads out as two bytes 0x651F into the LSW register, whereas the datasheet indicates that 1F is the first byte read, followed by 65 as the second byte. - - To burst read and write these 4 bytes in the correct order (where DD is written to address x), they should be stored as: - - AA BB in the MSW - CC DD in the LSW. */ - unsigned int nvrDataMSW : 16; /* 1E.0104.F:0 R/W Default = 0x0000 */ - /* NVR data MSW bits [1F:10] - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global NVR Interface */ - union - { - struct - { - /*! \brief 1E.0105.F:0 R/W NVR Data LSW [F:0] - AQ_GlobalNvrInterface_HHD.u5.bits_5.nvrDataLSW - - Default = 0x0000 - - NVR data LSW bits [F:0] - - - Notes: - Data is stored and read-out from these registers in little-endian format for operations such as FLASH device ID, and for programming the processor. - - For instance the 64K Atmel device code reads out as two bytes 0x651F into the LSW register, whereas the datasheet indicates that 1F is the first byte read, followed by 65 as the second byte. - To burst read and write these 4 bytes in the correct order (where DD is written to address x), they should be stored as: - - AA BB in the MSW - CC DD in the LSW. */ - unsigned int nvrDataLSW : 16; /* 1E.0105.F:0 R/W Default = 0x0000 */ - /* NVR data LSW bits [F:0] - */ - } bits_5; - uint16_t word_5; - } u5; -} AQ_GlobalNvrInterface_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Mailbox Interface: 1E.0200 */ -/* Global Mailbox Interface: 1E.0200 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0200.F R/WSC uP Mailbox Execute Operation - AQ_GlobalMailboxInterface_HHD.u0.bits_0.upMailboxExecuteOperation - - Default = 0x0 - - 1 = Start of mailbox Operation - - - - Notes: - Indicates mailbox is loaded and ready */ - unsigned int upMailboxExecuteOperation : 1; /* 1E.0200.F R/WSC Default = 0x0 */ - /* 1 = Start of mailbox Operation - - */ - /*! \brief 1E.0200.E R/W uP Mailbox Write Mode - AQ_GlobalMailboxInterface_HHD.u0.bits_0.upMailboxWriteMode - - Default = 0x0 - - 1 = Write - 0 = Read - - - Notes: - Mailbox direction */ - unsigned int upMailboxWriteMode : 1; /* 1E.0200.E R/W Default = 0x0 */ - /* 1 = Write - 0 = Read - */ - unsigned int reserved0 : 1; - /*! \brief 1E.0200.C R/WSC Reset uP Mailbox CRC - AQ_GlobalMailboxInterface_HHD.u0.bits_0.resetUpMailboxCrc - - Default = 0x0 - - 1 = Reset uP mailbox CRC calculation register - - - */ - unsigned int resetUpMailboxCrc : 1; /* 1E.0200.C R/WSC Default = 0x0 */ - /* 1 = Reset uP mailbox CRC calculation register - - */ - unsigned int reserved1 : 3; - /*! \brief 1E.0200.8 RO uP Mailbox Busy - AQ_GlobalMailboxInterface_HHD.u0.bits_0.upMailboxBusy - - - - 1 = uP mailbox busy - 0 = uP mailbox ready - - - Notes: - In general the uP will respond within a few processor cycles to any PIF slave request, much faster than the MDIO. If the busy is asserted over multiple MDIO polling cycles, then a H/W error may have occurred and a Global S/W reset or uP reset is required. */ - unsigned int upMailboxBusy : 1; /* 1E.0200.8 RO */ - /* 1 = uP mailbox busy - 0 = uP mailbox ready - */ - unsigned int reserved2 : 8; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0201.F:0 RO uP Mailbox CRC [F:0] - AQ_GlobalMailboxInterface_HHD.u1.bits_1.upMailboxCrc - - - - The running CRC-16 of everything passing through the mailbox interface - - */ - unsigned int upMailboxCrc : 16; /* 1E.0201.F:0 RO */ - /* The running CRC-16 of everything passing through the mailbox interface - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0202.F:0 R/W uP Mailbox Address MSW [1F:10] - AQ_GlobalMailboxInterface_HHD.u2.bits_2.upMailboxAddressMSW - - Default = 0x0000 - - uP Mailbox MSW address - - - Notes: - The address of where to read and write from in the Microcontroller Mailbox. This is self-incrementing and automatically increments after each read and write operation.PHY */ - unsigned int upMailboxAddressMSW : 16; /* 1E.0202.F:0 R/W Default = 0x0000 */ - /* uP Mailbox MSW address - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0203.F:2 R/W uP Mailbox Address LSW [F:2] - AQ_GlobalMailboxInterface_HHD.u3.bits_3.upMailboxAddressLSW - - Default = 0x0000 - - uP LSW Mailbox address [F:2] - - - Notes: - The address of where to read and write from in the Microcontroller Mailbox. This is self-incrementing and automatically increments after each read and write operation.PHY */ - unsigned int upMailboxAddressLSW : 14; /* 1E.0203.F:2 R/W Default = 0x0000 */ - /* uP LSW Mailbox address [F:2] - */ - /*! \brief 1E.0203.1:0 RO uP Mailbox Address LSW Don't Care [1:0] - AQ_GlobalMailboxInterface_HHD.u3.bits_3.upMailboxAddressLSW_Don_tCare - - - - Least significant uP LSW Mailbox address bits [1:0] - - - Notes: - These bits are always set to 0 since each memory access is on a 4-byte boundary. */ - unsigned int upMailboxAddressLSW_Don_tCare : 2; /* 1E.0203.1:0 RO */ - /* Least significant uP LSW Mailbox address bits [1:0] - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0204.F:0 R/W uP Mailbox Data MSW [1F:10] - AQ_GlobalMailboxInterface_HHD.u4.bits_4.upMailboxDataMSW - - Default = 0x0000 - - uP Mailbox data MSW - - */ - unsigned int upMailboxDataMSW : 16; /* 1E.0204.F:0 R/W Default = 0x0000 */ - /* uP Mailbox data MSW - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Mailbox Interface */ - union - { - struct - { - /*! \brief 1E.0205.F:0 R/W uP Mailbox Data LSW [F:0] - AQ_GlobalMailboxInterface_HHD.u5.bits_5.upMailboxDataLSW - - Default = 0x0000 - - uP Mailbox data LSW - - */ - unsigned int upMailboxDataLSW : 16; /* 1E.0205.F:0 R/W Default = 0x0000 */ - /* uP Mailbox data LSW - */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global Mailbox Interface */ - union - { - struct - { - unsigned int reserved0 : 14; - /*! \brief 1E.0206.1 R/W uP Mailbox CRC Read Enable - AQ_GlobalMailboxInterface_HHD.u6.bits_6.upMailboxCrcReadEnable - - Default = 0x0 - - 1 = Update uP mailbox CRC on read - - */ - unsigned int upMailboxCrcReadEnable : 1; /* 1E.0206.1 R/W Default = 0x0 */ - /* 1 = Update uP mailbox CRC on read - */ - unsigned int reserved1 : 1; - } bits_6; - uint16_t word_6; - } u6; -} AQ_GlobalMailboxInterface_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Microprocessor Scratch Pad: 1E.0300 */ -/* Global Microprocessor Scratch Pad: 1E.0300 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Microprocessor Scratch Pad */ - union - { - struct - { - /*! \brief 1E.0300.F:0 R/W Scratch Pad 1[F:0] - AQ_GlobalMicroprocessorScratchPad_HHD.u0.bits_0.scratchPad_1 - - Default = 0x0000 - - General Purpose Scratch Pad - */ - unsigned int scratchPad_1 : 16; /* 1E.0300.F:0 R/W Default = 0x0000 */ - /* General Purpose Scratch Pad */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Microprocessor Scratch Pad */ - union - { - struct - { - /*! \brief 1E.0301.F:0 R/W Scratch Pad 2 [F:0] - AQ_GlobalMicroprocessorScratchPad_HHD.u1.bits_1.scratchPad_2 - - Default = 0x0000 - - General Purpose Scratch Pad - */ - unsigned int scratchPad_2 : 16; /* 1E.0301.F:0 R/W Default = 0x0000 */ - /* General Purpose Scratch Pad */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalMicroprocessorScratchPad_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress Control Register: 1E.5002 */ -/* MSS Egress Control Register: 1E.5002 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress Control Register */ - union - { - struct - { - /*! \brief 1E.5002.F:D R/W MSS Egress Ethertype Explicit SECTag LSB [2:0] - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressEthertypeExplicitSectagLsb - - Default = 0x0 - - Ethertype for explicit SECTag bits 2:0. - - - Notes: - Ethertype for explicity SECTag. */ - unsigned int mssEgressEthertypeExplicitSectagLsb : 3; /* 1E.5002.F:D R/W Default = 0x0 */ - /* Ethertype for explicit SECTag bits 2:0. - */ - /*! \brief 1E.5002.C R/W MSS Egress Clear Global Time - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressClearGlobalTime - - Default = 0x0 - - 1 = Clear global time - - - - Notes: - Clear global time. */ - unsigned int mssEgressClearGlobalTime : 1; /* 1E.5002.C R/W Default = 0x0 */ - /* 1 = Clear global time - - */ - /*! \brief 1E.5002.B R/W MSS Egress Clear Counter - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressClearCounter - - Default = 0x0 - - 1 = Clear all MIB counters - - - - Notes: - If this bit is set to 1, all MIB counters will be cleared. */ - unsigned int mssEgressClearCounter : 1; /* 1E.5002.B R/W Default = 0x0 */ - /* 1 = Clear all MIB counters - - */ - /*! \brief 1E.5002.A R/W MSS Egress High Priority - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressHighPriority - - Default = 0x0 - - 1 = MIB counter clear on read enable - - - - Notes: - If this bit is set to 1, read is given high priority and the MIB count value becomes 0 after read. */ - unsigned int mssEgressHighPriority : 1; /* 1E.5002.A R/W Default = 0x0 */ - /* 1 = MIB counter clear on read enable - - */ - /*! \brief 1E.5002.9 R/W MSS Egress ICV LSB 8 Bytes Enable - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressIcvLsb_8BytesEnable - - Default = 0x0 - - 1 = Use LSB - 0 = Use MSB - - - - Notes: - This bit selects MSB or LSB 8 bytes selection in the case where the ICV is 8 bytes. - 0 = MSB is used. */ - unsigned int mssEgressIcvLsb_8BytesEnable : 1; /* 1E.5002.9 R/W Default = 0x0 */ - /* 1 = Use LSB - 0 = Use MSB - - */ - /*! \brief 1E.5002.8 R/W MSS Egress External Classification Enable - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressExternalClassificationEnable - - Default = 0x0 - - 1 = Drop EGPRC miss packets - - - - Notes: - If set, internal classification is bypassed. Should always be set to 0. */ - unsigned int mssEgressExternalClassificationEnable : 1; /* 1E.5002.8 R/W Default = 0x0 */ - /* 1 = Drop EGPRC miss packets - - */ - /*! \brief 1E.5002.7 R/W MSS Egress Explicit SECTag Report Short Length - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressExplicitSectagReportShortLength - - Default = 0x0 - - Reserved - - - - Notes: - Unused. */ - unsigned int mssEgressExplicitSectagReportShortLength : 1; /* 1E.5002.7 R/W Default = 0x0 */ - /* Reserved - - */ - /*! \brief 1E.5002.6 R/W MSS Egress Drop Invalid SA/SC Packets - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressDropInvalidSa_scPackets - - Default = 0x0 - - 1 = Drop invalid SA/SC packets - - - - Notes: - Enables dropping of invalid SA/SC packets. */ - unsigned int mssEgressDropInvalidSa_scPackets : 1; /* 1E.5002.6 R/W Default = 0x0 */ - /* 1 = Drop invalid SA/SC packets - - */ - /*! \brief 1E.5002.5 R/W MSS Egress Unmatched Use SC 0 - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressUnmatchedUseSc_0 - - Default = 0x0 - - 1 = Use SC 0 for unmatched packets - 0 = Unmatched packets are uncontrolled packets - - - - Notes: - Use SC-Index 0 as default SC for unmatched packets. Otherwise the packets are treated as uncontrolled packets. */ - unsigned int mssEgressUnmatchedUseSc_0 : 1; /* 1E.5002.5 R/W Default = 0x0 */ - /* 1 = Use SC 0 for unmatched packets - 0 = Unmatched packets are uncontrolled packets - - */ - /*! \brief 1E.5002.4 R/W MSS Egresss GCM Test Mode - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgresssGcmTestMode - - Default = 0x0 - - 1 = Enable GCM test mode - - - - Notes: - Enables GCM test mode */ - unsigned int mssEgresssGcmTestMode : 1; /* 1E.5002.4 R/W Default = 0x0 */ - /* 1 = Enable GCM test mode - - */ - /*! \brief 1E.5002.3 R/W MSS Egress GCM Start - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressGcmStart - - Default = 0x0 - - 1 = Start GCM - - - - Notes: - Indicates GCM to start */ - unsigned int mssEgressGcmStart : 1; /* 1E.5002.3 R/W Default = 0x0 */ - /* 1 = Start GCM - - */ - /*! \brief 1E.5002.2 R/W MSS Egress Drop EGPRC LUT Miss - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressDropEgprcLutMiss - - Default = 0x0 - - 1 = Drop Egress Classification LUT miss packets - - - - Notes: - Decides whether Egress Pre-Security Classification (EGPRC) LUT miss packets are to be dropped */ - unsigned int mssEgressDropEgprcLutMiss : 1; /* 1E.5002.2 R/W Default = 0x0 */ - /* 1 = Drop Egress Classification LUT miss packets - - */ - /*! \brief 1E.5002.1 R/W MSS Egress Drop KAY Packet - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressDropKayPacket - - Default = 0x0 - - 1 = Drop KAY packet - - - Notes: - Decides whether KAY packets have to be dropped */ - unsigned int mssEgressDropKayPacket : 1; /* 1E.5002.1 R/W Default = 0x0 */ - /* 1 = Drop KAY packet - */ - /*! \brief 1E.5002.0 R/W MSS Egress Soft Reset - AQ_MssEgressControlRegister_HHD.u0.bits_0.mssEgressSoftReset - - Default = 0x0 - - 1 = Soft reset - - - Notes: - S/W reset */ - unsigned int mssEgressSoftReset : 1; /* 1E.5002.0 R/W Default = 0x0 */ - /* 1 = Soft reset - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress Control Register */ - union - { - struct - { - unsigned int reserved0 : 3; - /*! \brief 1E.5003.C:0 R/W MSS Egress Ethertype Explicit SECTag MSB [F:3] - AQ_MssEgressControlRegister_HHD.u1.bits_1.mssEgressEthertypeExplicitSectagMsb - - Default = 0x0000 - - Ethertype for explicit SECTag bits 15:3. - - - Notes: - Ethertype for explicity SECTag. */ - unsigned int mssEgressEthertypeExplicitSectagMsb : 13; /* 1E.5003.C:0 R/W Default = 0x0000 */ - /* Ethertype for explicit SECTag bits 15:3. - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress VLAN TPID 0 Register: 1E.5008 */ -/* MSS Egress VLAN TPID 0 Register: 1E.5008 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress VLAN TPID 0 Register */ - union - { - struct - { - /*! \brief 1E.5008.F:0 R/W MSS Egress VLAN STag TPID [F:0] - AQ_MssEgressVlanTpid_0Register_HHD.u0.bits_0.mssEgressVlanStagTpid - - Default = 0x0000 - - STag TPID - - - Notes: - Service Tag Protocol Identifier (TPID) values to identify a VLAN tag. The " See SEC Egress VLAN CP Tag Parse STag " bit must be set to 1 for the incoming packet's TPID to be parsed. */ - unsigned int mssEgressVlanStagTpid : 16; /* 1E.5008.F:0 R/W Default = 0x0000 */ - /* STag TPID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress VLAN TPID 0 Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressVlanTpid_0Register_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress VLAN TPID 1 Register: 1E.500A */ -/* MSS Egress VLAN TPID 1 Register: 1E.500A */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress VLAN TPID 1 Register */ - union - { - struct - { - /*! \brief 1E.500A.F:0 R/W MSS Egress VLAN QTag TPID [F:0] - AQ_MssEgressVlanTpid_1Register_HHD.u0.bits_0.mssEgressVlanQtagTpid - - Default = 0x0000 - - QTag TPID - - - Notes: - Customer Tag Protocol Identifier (TPID) values to identify a VLAN tag. The " See SEC Egress VLAN CP Tag Parse QTag " bit must be set to 1 for the incoming packet's TPID to be parsed. */ - unsigned int mssEgressVlanQtagTpid : 16; /* 1E.500A.F:0 R/W Default = 0x0000 */ - /* QTag TPID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress VLAN TPID 1 Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressVlanTpid_1Register_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress VLAN Control Register: 1E.500C */ -/* MSS Egress VLAN Control Register: 1E.500C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress VLAN Control Register */ - union - { - struct - { - /*! \brief 1E.500C.F:0 R/W MSS Egress VLAN UP Map Table [F:0] - AQ_MssEgressVlanControlRegister_HHD.u0.bits_0.mssEgressVlanUpMapTable - - Default = 0x0000 - - UP Map table bits 15:0 - - - Notes: - If there is a customer TPID Tag match and no service TPID Tag match or the service TPID Tag match is disabled, the outer TAG's PCP is used to index into this map table to generate the packets user priority. - 2:0 : UP value for customer Tag PCP 0x0 - 5:3: UP value for customer Tag PCP 0x0 - 8:6 : UP value for customer Tag PCP 0x0 - 11:9 : UP value for customer Tag PCP 0x0 - 14:12 : UP value for customer Tag PCP 0x0 - 17:15 : UP value for customer Tag PCP 0x0 - 20:18 : UP value for customer Tag PCP 0x0 - 23:21 : UP value for customer Tag PCP 0x0 */ - unsigned int mssEgressVlanUpMapTable : 16; /* 1E.500C.F:0 R/W Default = 0x0000 */ - /* UP Map table bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress VLAN Control Register */ - union - { - struct - { - /*! \brief 1E.500D.F R/W MSS Egress VLAN QTag Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanQtagParseEnable - - Default = 0x0 - - 1 = Enable VLAN QTag parsing - - - Notes: - Enable controlled port VLAN customer Tag parsing. When this bit is set to 1, the incoming packet's outer TPID will be compared with the configured " See SEC Egress TPID 1 [F:0] " for matching. If the " See SEC Egress VLAN CP Tag Parse QinQ " bit is set to1, this will also be used to compare the incoming packet's inner TPID. */ - unsigned int mssEgressVlanQtagParseEnable : 1; /* 1E.500D.F R/W Default = 0x0 */ - /* 1 = Enable VLAN QTag parsing - */ - /*! \brief 1E.500D.E R/W MSS Egress VLAN STag Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanStagParseEnable - - Default = 0x0 - - 1 = Enable VLAN STag parsing - - - Notes: - Enable controlled port VLAN service Tag parsing. When this bit is set to 1, the incoming packets outer TPID will be compared with the configured " See SEC Egress TPID 0 [F:0] " for matching. If the " See SEC Egress VLAN CP Tag Parse QinQ " bit is set to1, this will also be used to compare the incoming packet's inner TPID. */ - unsigned int mssEgressVlanStagParseEnable : 1; /* 1E.500D.E R/W Default = 0x0 */ - /* 1 = Enable VLAN STag parsing - */ - /*! \brief 1E.500D.D R/W MSS Egress VLAN QinQ Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanQinqParseEnable - - Default = 0x0 - - VLAN CP Tag Parse QinQ - - - Notes: - Enable controlled port VLAN QinQ Tag parsing. When this bit is set to 1 both the outer and inner VLAN Tags will be parsed. */ - unsigned int mssEgressVlanQinqParseEnable : 1; /* 1E.500D.D R/W Default = 0x0 */ - /* VLAN CP Tag Parse QinQ - */ - /*! \brief 1E.500D.C R/W MSS Egress VLAN QTag UP Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanQtagUpParseEnable - - Default = 0x0 - - VLAN CP Tag QTag UP enable - - - Notes: - Enable controlled port customer VLAN customer Tag user priority field parsing. */ - unsigned int mssEgressVlanQtagUpParseEnable : 1; /* 1E.500D.C R/W Default = 0x0 */ - /* VLAN CP Tag QTag UP enable - */ - /*! \brief 1E.500D.B R/W MSS Egress VLAN STag UP Parse Enable - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanStagUpParseEnable - - Default = 0x0 - - VLAN CP Tag STag UP enable - - - Notes: - Enable controlled port service VLAN service Tag user priority field parsing. */ - unsigned int mssEgressVlanStagUpParseEnable : 1; /* 1E.500D.B R/W Default = 0x0 */ - /* VLAN CP Tag STag UP enable - */ - /*! \brief 1E.500D.A:8 R/W MSS Egress VLAN UP Default [2:0] - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanUpDefault - - Default = 0x0 - - UP default - - - Notes: - User priority default */ - unsigned int mssEgressVlanUpDefault : 3; /* 1E.500D.A:8 R/W Default = 0x0 */ - /* UP default - */ - /*! \brief 1E.500D.7:0 R/W MSS Egress VLAN UP Map Table MSW [17:10] - AQ_MssEgressVlanControlRegister_HHD.u1.bits_1.mssEgressVlanUpMapTableMSW - - Default = 0x00 - - UP Map table bits 23:16 - - - Notes: - If there is a customer TPID Tag match and no service TPID Tag match or the service TPID Tag match is disabled, the outer TAG's PCP is used to index into this map table to generate the packets user priority. - 2:0 : UP value for customer Tag PCP 0x0 - 5:3: UP value for customer Tag PCP 0x0 - 8:6 : UP value for customer Tag PCP 0x0 - 11:9 : UP value for customer Tag PCP 0x0 - 14:12 : UP value for customer Tag PCP 0x0 - 17:15 : UP value for customer Tag PCP 0x0 - 20:18 : UP value for customer Tag PCP 0x0 - 23:21 : UP value for customer Tag PCP 0x0 */ - unsigned int mssEgressVlanUpMapTableMSW : 8; /* 1E.500D.7:0 R/W Default = 0x00 */ - /* UP Map table bits 23:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressVlanControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress PN Control Register: 1E.500E */ -/* MSS Egress PN Control Register: 1E.500E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress PN Control Register */ - union - { - struct - { - /*! \brief 1E.500E.F:0 R/W MSS Egress SA PN Threshold LSW [F:0] - AQ_MssEgressPnControlRegister_HHD.u0.bits_0.mssEgressSaPnThresholdLSW - - Default = 0x0000 - - PN threshold bits 15:0 - - - Notes: - Egress PN threshold to generate SA threshold interrupt. */ - unsigned int mssEgressSaPnThresholdLSW : 16; /* 1E.500E.F:0 R/W Default = 0x0000 */ - /* PN threshold bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress PN Control Register */ - union - { - struct - { - /*! \brief 1E.500F.F:0 R/W MSS Egress SA PN Threshold MSW [1F:10] - AQ_MssEgressPnControlRegister_HHD.u1.bits_1.mssEgressSaPnThresholdMSW - - Default = 0x0000 - - PN threshold bits 31:16 - - - Notes: - Egress PN threshold to generate SA threshold interrupt. */ - unsigned int mssEgressSaPnThresholdMSW : 16; /* 1E.500F.F:0 R/W Default = 0x0000 */ - /* PN threshold bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressPnControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress MTU Size Control Register: 1E.5010 */ -/* MSS Egress MTU Size Control Register: 1E.5010 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress MTU Size Control Register */ - union - { - struct - { - /*! \brief 1E.5010.F:0 R/W MSS Egress Controlled Packet MTU Size [F:0] - AQ_MssEgressMtuSizeControlRegister_HHD.u0.bits_0.mssEgressControlledPacketMtuSize - - Default = 0x05DC - - Maximum transmission unit for controlled packet - - - Notes: - Maximum transmission unit of controlled packet */ - unsigned int mssEgressControlledPacketMtuSize : 16; /* 1E.5010.F:0 R/W Default = 0x05DC */ - /* Maximum transmission unit for controlled packet - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress MTU Size Control Register */ - union - { - struct - { - /*! \brief 1E.5011.F:0 R/W MSS Egress Uncontrolled Packet MTU Size [F:0] - AQ_MssEgressMtuSizeControlRegister_HHD.u1.bits_1.mssEgressUncontrolledPacketMtuSize - - Default = 0x05DC - - Maximum transmission unit for uncontrolled packet - - - Notes: - Maximum transmission unit of uncontrolled packet */ - unsigned int mssEgressUncontrolledPacketMtuSize : 16; /* 1E.5011.F:0 R/W Default = 0x05DC */ - /* Maximum transmission unit for uncontrolled packet - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressMtuSizeControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress Interrupt Status Register: 1E.505C */ -/* MSS Egress Interrupt Status Register: 1E.505C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress Interrupt Status Register */ - union - { - struct - { - unsigned int reserved0 : 11; - /*! \brief 1E.505C.4 COW MSS Egress ECC Error Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressEccErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when anyone of the memories detects an ECC error. */ - unsigned int mssEgressEccErrorInterrupt : 1; /* 1E.505C.4 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.505C.3 COW MSS Egress MIB Saturation Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressMibSaturationInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the MIB counters reaches all ones saturation. */ - unsigned int mssEgressMibSaturationInterrupt : 1; /* 1E.505C.3 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.505C.2 COW MSS Egress SA Threshold Expired Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressSaThresholdExpiredInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches the See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssEgressSaThresholdExpiredInterrupt : 1; /* 1E.505C.2 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.505C.1 COW MSS Egress SA Expired Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressSaExpiredInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches all ones saturation. */ - unsigned int mssEgressSaExpiredInterrupt : 1; /* 1E.505C.1 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.505C.0 COW MSS Egress Master Interrupt - AQ_MssEgressInterruptStatusRegister_HHD.u0.bits_0.mssEgressMasterInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when any one of the above interrupt and the corresponding interrupt enable are both set. The interrupt enable for this bit must also be set for this bit to be set. */ - unsigned int mssEgressMasterInterrupt : 1; /* 1E.505C.0 COW Default = 0x0 */ - /* 1 = Interrupt - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress Interrupt Status Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressInterruptStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress Interrupt Mask Register: 1E.505E */ -/* MSS Egress Interrupt Mask Register: 1E.505E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress Interrupt Mask Register */ - union - { - struct - { - unsigned int reserved0 : 11; - /*! \brief 1E.505E.4 COW MSS Egress ECC Error Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressEccErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. This bit is set when anyone of the memories detects an ECC error. */ - unsigned int mssEgressEccErrorInterruptEnable : 1; /* 1E.505E.4 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.505E.3 COW MSS Egress MIB Saturation Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressMibSaturationInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. This bit is set when the MIB counters reaches all ones saturation. */ - unsigned int mssEgressMibSaturationInterruptEnable : 1; /* 1E.505E.3 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.505E.2 COW MSS Egress SA Expired Threshold Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressSaExpiredThresholdInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssEgressSaExpiredThresholdInterruptEnable : 1; /* 1E.505E.2 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.505E.1 COW MSS Egress SA Expired Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressSaExpiredInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches all ones saturation. */ - unsigned int mssEgressSaExpiredInterruptEnable : 1; /* 1E.505E.1 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.505E.0 COW MSS Egress Master Interrupt Enable - AQ_MssEgressInterruptMaskRegister_HHD.u0.bits_0.mssEgressMasterInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - - Notes: - Write to 1 to clear. */ - unsigned int mssEgressMasterInterruptEnable : 1; /* 1E.505E.0 COW Default = 0x0 */ - /* 1 = Interrupt enabled - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress Interrupt Mask Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressInterruptMaskRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress SA Expired Status Register: 1E.5060 */ -/* MSS Egress SA Expired Status Register: 1E.5060 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress SA Expired Status Register */ - union - { - struct - { - /*! \brief 1E.5060.F:0 COW MSS Egress SA Expired LSW [F:0] - AQ_MssEgressSaExpiredStatusRegister_HHD.u0.bits_0.mssEgressSaExpiredLSW - - Default = 0x0000 - - SA expired bits 15:0 - - - Notes: - Write these bits to 1 to clear. - When set, these bits identify the SA that has expired when the SA PN reaches all-ones saturation. */ - unsigned int mssEgressSaExpiredLSW : 16; /* 1E.5060.F:0 COW Default = 0x0000 */ - /* SA expired bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress SA Expired Status Register */ - union - { - struct - { - /*! \brief 1E.5061.F:0 COW MSS Egress SA Expired MSW [1F:10] - AQ_MssEgressSaExpiredStatusRegister_HHD.u1.bits_1.mssEgressSaExpiredMSW - - Default = 0x0000 - - SA expired bits 31:16 - - - Notes: - Write these bits to 1 to clear. - When set, these bits identify the SA that has expired when the SA PN reaches all-ones saturation. */ - unsigned int mssEgressSaExpiredMSW : 16; /* 1E.5061.F:0 COW Default = 0x0000 */ - /* SA expired bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressSaExpiredStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress SA Threshold Expired Status Register: 1E.5062 */ -/* MSS Egress SA Threshold Expired Status Register: 1E.5062 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress SA Threshold Expired Status Register */ - union - { - struct - { - /*! \brief 1E.5062.F:0 COW MSS Egress SA Threshold Expired LSW [F:0] - AQ_MssEgressSaThresholdExpiredStatusRegister_HHD.u0.bits_0.mssEgressSaThresholdExpiredLSW - - Default = 0x0000 - - SA threshold expired bits 15:0 - - - Notes: - Write these bits to 1 to clear. - When set, these bits identify the SA that has expired when the SA PN has reached the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssEgressSaThresholdExpiredLSW : 16; /* 1E.5062.F:0 COW Default = 0x0000 */ - /* SA threshold expired bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress SA Threshold Expired Status Register */ - union - { - struct - { - /*! \brief 1E.5063.F:0 COW MSS Egress SA Threshold Expired MSW [1F:10] - AQ_MssEgressSaThresholdExpiredStatusRegister_HHD.u1.bits_1.mssEgressSaThresholdExpiredMSW - - Default = 0x0000 - - SA threshold expired bits 31:16 - - - Notes: - Write these bits to 1 to clear. - When set, these bits identify the SA that has expired when the SA PN has reached the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssEgressSaThresholdExpiredMSW : 16; /* 1E.5063.F:0 COW Default = 0x0000 */ - /* SA threshold expired bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressSaThresholdExpiredStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress ECC Interrupt Status Register: 1E.5064 */ -/* MSS Egress ECC Interrupt Status Register: 1E.5064 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress ECC Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.5064.F:0 COW MSS Egress SA ECC Error Interrupt LSW [F:0] - AQ_MssEgressEccInterruptStatusRegister_HHD.u0.bits_0.mssEgressSaEccErrorInterruptLSW - - Default = 0x0000 - - SA ECC error interrupt bits 15:0 - - - Notes: - Write these bits to 1 to clear. - When set to 1, indicates that an ECC error occured for the SA. */ - unsigned int mssEgressSaEccErrorInterruptLSW : 16; /* 1E.5064.F:0 COW Default = 0x0000 */ - /* SA ECC error interrupt bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress ECC Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.5065.F:0 COW MSS Egress SA ECC Error Interrupt MSW [1F:10] - AQ_MssEgressEccInterruptStatusRegister_HHD.u1.bits_1.mssEgressSaEccErrorInterruptMSW - - Default = 0x0000 - - SA ECC error interrupt bits 31:16 - - - Notes: - Write these bits to 1 to clear. - When set to 1, indicates that an ECC error occured for the SA. */ - unsigned int mssEgressSaEccErrorInterruptMSW : 16; /* 1E.5065.F:0 COW Default = 0x0000 */ - /* SA ECC error interrupt bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssEgressEccInterruptStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress LUT Address Control Register: 1E.5080 */ -/* MSS Egress LUT Address Control Register: 1E.5080 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress LUT Address Control Register */ - union - { - struct - { - /*! \brief 1E.5080.F:C R/W MSS Egress LUT Select [3:0] - AQ_MssEgressLutAddressControlRegister_HHD.u0.bits_0.mssEgressLutSelect - - Default = 0x0 - - LUT select - - - Notes: - 0x0 : Egress MAC Control FIlter (CTLF) LUT - 0x1 : Egress Classification LUT - 0x2 : Egress SC/SA LUT - 0x3 : Egress SMIB */ - unsigned int mssEgressLutSelect : 4; /* 1E.5080.F:C R/W Default = 0x0 */ - /* LUT select - */ - unsigned int reserved0 : 3; - /*! \brief 1E.5080.8:0 R/W MSS Egress LUT Address [8:0] - AQ_MssEgressLutAddressControlRegister_HHD.u0.bits_0.mssEgressLutAddress - - Default = 0x000 - - LUT address - - */ - unsigned int mssEgressLutAddress : 9; /* 1E.5080.8:0 R/W Default = 0x000 */ - /* LUT address - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_MssEgressLutAddressControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress LUT Control Register: 1E.5081 */ -/* MSS Egress LUT Control Register: 1E.5081 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress LUT Control Register */ - union - { - struct - { - /*! \brief 1E.5081.F R/W MSS Egress LUT Write - AQ_MssEgressLutControlRegister_HHD.u0.bits_0.mssEgressLutWrite - - Default = 0x0 - - 1 = LUT write - - - Notes: - Setting this bit to 1, will write the LUT. This bit will automatically clear to 0. */ - unsigned int mssEgressLutWrite : 1; /* 1E.5081.F R/W Default = 0x0 */ - /* 1 = LUT write - */ - /*! \brief 1E.5081.E R/W MSS Egress LUT Read - AQ_MssEgressLutControlRegister_HHD.u0.bits_0.mssEgressLutRead - - Default = 0x0 - - 1 = LUT read - - - Notes: - Setting this bit to 1, will read the LUT. This bit will automatically clear to 0. */ - unsigned int mssEgressLutRead : 1; /* 1E.5081.E R/W Default = 0x0 */ - /* 1 = LUT read - */ - unsigned int reserved0 : 14; - } bits_0; - uint16_t word_0; - } u0; -} AQ_MssEgressLutControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Egress LUT Data Control Register: 1E.50A0 */ -/* MSS Egress LUT Data Control Register: 1E.50A0 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A0.F:0 R/W MSS Egress LUT Data 0 [F:0] - AQ_MssEgressLutDataControlRegister_HHD.u0.bits_0.mssEgressLutData_0 - - Default = 0x0000 - - LUT data bits 15:0 - - */ - unsigned int mssEgressLutData_0 : 16; /* 1E.50A0.F:0 R/W Default = 0x0000 */ - /* LUT data bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A1.F:0 R/W MSS Egress LUT Data 1 [1F:10] - AQ_MssEgressLutDataControlRegister_HHD.u1.bits_1.mssEgressLutData_1 - - Default = 0x0000 - - LUT data bits 31:16 - - */ - unsigned int mssEgressLutData_1 : 16; /* 1E.50A1.F:0 R/W Default = 0x0000 */ - /* LUT data bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A2.F:0 R/W MSS Egress LUT Data 2 [2F:20] - AQ_MssEgressLutDataControlRegister_HHD.u2.bits_2.mssEgressLutData_2 - - Default = 0x0000 - - LUT data bits 47:32 - - */ - unsigned int mssEgressLutData_2 : 16; /* 1E.50A2.F:0 R/W Default = 0x0000 */ - /* LUT data bits 47:32 - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A3.F:0 R/W MSS Egress LUT Data 3 [3F:30] - AQ_MssEgressLutDataControlRegister_HHD.u3.bits_3.mssEgressLutData_3 - - Default = 0x0000 - - LUT data bits 63:48 - - */ - unsigned int mssEgressLutData_3 : 16; /* 1E.50A3.F:0 R/W Default = 0x0000 */ - /* LUT data bits 63:48 - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A4.F:0 R/W MSS Egress LUT Data 4 [4F:40] - AQ_MssEgressLutDataControlRegister_HHD.u4.bits_4.mssEgressLutData_4 - - Default = 0x0000 - - LUT data bits 79:64 - - */ - unsigned int mssEgressLutData_4 : 16; /* 1E.50A4.F:0 R/W Default = 0x0000 */ - /* LUT data bits 79:64 - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A5.F:0 R/W MSS Egress LUT Data 5 [5F:50] - AQ_MssEgressLutDataControlRegister_HHD.u5.bits_5.mssEgressLutData_5 - - Default = 0x0000 - - LUT data bits 95:80 - - */ - unsigned int mssEgressLutData_5 : 16; /* 1E.50A5.F:0 R/W Default = 0x0000 */ - /* LUT data bits 95:80 - */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A6.F:0 R/W MSS Egress LUT Data 6 [6F:60] - AQ_MssEgressLutDataControlRegister_HHD.u6.bits_6.mssEgressLutData_6 - - Default = 0x0000 - - LUT data bits 111:96 - - */ - unsigned int mssEgressLutData_6 : 16; /* 1E.50A6.F:0 R/W Default = 0x0000 */ - /* LUT data bits 111:96 - */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A7.F:0 R/W MSS Egress LUT Data 7 [7F:70] - AQ_MssEgressLutDataControlRegister_HHD.u7.bits_7.mssEgressLutData_7 - - Default = 0x0000 - - LUT data bits 127:112 - - */ - unsigned int mssEgressLutData_7 : 16; /* 1E.50A7.F:0 R/W Default = 0x0000 */ - /* LUT data bits 127:112 - */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A8.F:0 R/W MSS Egress LUT Data 8 [8F:80] - AQ_MssEgressLutDataControlRegister_HHD.u8.bits_8.mssEgressLutData_8 - - Default = 0x0000 - - LUT data bits 143:128 - - */ - unsigned int mssEgressLutData_8 : 16; /* 1E.50A8.F:0 R/W Default = 0x0000 */ - /* LUT data bits 143:128 - */ - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50A9.F:0 R/W MSS Egress LUT Data 9 [9F:90] - AQ_MssEgressLutDataControlRegister_HHD.u9.bits_9.mssEgressLutData_9 - - Default = 0x0000 - - LUT data bits 159:144 - - */ - unsigned int mssEgressLutData_9 : 16; /* 1E.50A9.F:0 R/W Default = 0x0000 */ - /* LUT data bits 159:144 - */ - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Union for bit and word level access of word 10 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AA.F:0 R/W MSS Egress LUT Data 10 [AF:A0] - AQ_MssEgressLutDataControlRegister_HHD.u10.bits_10.mssEgressLutData_10 - - Default = 0x0000 - - LUT data bits 175:160 - - */ - unsigned int mssEgressLutData_10 : 16; /* 1E.50AA.F:0 R/W Default = 0x0000 */ - /* LUT data bits 175:160 - */ - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Union for bit and word level access of word 11 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AB.F:0 R/W MSS Egress LUT Data 11 [BF:B0] - AQ_MssEgressLutDataControlRegister_HHD.u11.bits_11.mssEgressLutData_11 - - Default = 0x0000 - - LUT data bits 191:176 - - */ - unsigned int mssEgressLutData_11 : 16; /* 1E.50AB.F:0 R/W Default = 0x0000 */ - /* LUT data bits 191:176 - */ - } bits_11; - uint16_t word_11; - } u11; - /*! \brief Union for bit and word level access of word 12 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AC.F:0 R/W MSS Egress LUT Data 12 [CF:C0] - AQ_MssEgressLutDataControlRegister_HHD.u12.bits_12.mssEgressLutData_12 - - Default = 0x0000 - - LUT data bits 207:192 - - */ - unsigned int mssEgressLutData_12 : 16; /* 1E.50AC.F:0 R/W Default = 0x0000 */ - /* LUT data bits 207:192 - */ - } bits_12; - uint16_t word_12; - } u12; - /*! \brief Union for bit and word level access of word 13 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AD.F:0 R/W MSS Egress LUT Data 13 [DF:D0] - AQ_MssEgressLutDataControlRegister_HHD.u13.bits_13.mssEgressLutData_13 - - Default = 0x0000 - - LUT data bits 223:208 - - */ - unsigned int mssEgressLutData_13 : 16; /* 1E.50AD.F:0 R/W Default = 0x0000 */ - /* LUT data bits 223:208 - */ - } bits_13; - uint16_t word_13; - } u13; - /*! \brief Union for bit and word level access of word 14 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AE.F:0 R/W MSS Egress LUT Data 14 [EF:E0] - AQ_MssEgressLutDataControlRegister_HHD.u14.bits_14.mssEgressLutData_14 - - Default = 0x0000 - - LUT data bits 239:224 - - */ - unsigned int mssEgressLutData_14 : 16; /* 1E.50AE.F:0 R/W Default = 0x0000 */ - /* LUT data bits 239:224 - */ - } bits_14; - uint16_t word_14; - } u14; - /*! \brief Union for bit and word level access of word 15 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50AF.F:0 R/W MSS Egress LUT Data 15 [FF:F0] - AQ_MssEgressLutDataControlRegister_HHD.u15.bits_15.mssEgressLutData_15 - - Default = 0x0000 - - LUT data bits 255:240 - - */ - unsigned int mssEgressLutData_15 : 16; /* 1E.50AF.F:0 R/W Default = 0x0000 */ - /* LUT data bits 255:240 - */ - } bits_15; - uint16_t word_15; - } u15; - /*! \brief Union for bit and word level access of word 16 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B0.F:0 R/W MSS Egress LUT Data 16 [10F:100] - AQ_MssEgressLutDataControlRegister_HHD.u16.bits_16.mssEgressLutData_16 - - Default = 0x0000 - - LUT data bits 271:256 - - */ - unsigned int mssEgressLutData_16 : 16; /* 1E.50B0.F:0 R/W Default = 0x0000 */ - /* LUT data bits 271:256 - */ - } bits_16; - uint16_t word_16; - } u16; - /*! \brief Union for bit and word level access of word 17 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B1.F:0 R/W MSS Egress LUT Data 17 [11F:110] - AQ_MssEgressLutDataControlRegister_HHD.u17.bits_17.mssEgressLutData_17 - - Default = 0x0000 - - LUT data bits 287:272 - - */ - unsigned int mssEgressLutData_17 : 16; /* 1E.50B1.F:0 R/W Default = 0x0000 */ - /* LUT data bits 287:272 - */ - } bits_17; - uint16_t word_17; - } u17; - /*! \brief Union for bit and word level access of word 18 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B2.F:0 R/W MSS Egress LUT Data 18 [12F:120] - AQ_MssEgressLutDataControlRegister_HHD.u18.bits_18.mssEgressLutData_18 - - Default = 0x0000 - - LUT data bits 303:288 - - */ - unsigned int mssEgressLutData_18 : 16; /* 1E.50B2.F:0 R/W Default = 0x0000 */ - /* LUT data bits 303:288 - */ - } bits_18; - uint16_t word_18; - } u18; - /*! \brief Union for bit and word level access of word 19 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B3.F:0 R/W MSS Egress LUT Data 19 [13F:130] - AQ_MssEgressLutDataControlRegister_HHD.u19.bits_19.mssEgressLutData_19 - - Default = 0x0000 - - LUT data bits 319:304 - - */ - unsigned int mssEgressLutData_19 : 16; /* 1E.50B3.F:0 R/W Default = 0x0000 */ - /* LUT data bits 319:304 - */ - } bits_19; - uint16_t word_19; - } u19; - /*! \brief Union for bit and word level access of word 20 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B4.F:0 R/W MSS Egress LUT Data 20 [14F:140] - AQ_MssEgressLutDataControlRegister_HHD.u20.bits_20.mssEgressLutData_20 - - Default = 0x0000 - - LUT data bits 335:320 - - */ - unsigned int mssEgressLutData_20 : 16; /* 1E.50B4.F:0 R/W Default = 0x0000 */ - /* LUT data bits 335:320 - */ - } bits_20; - uint16_t word_20; - } u20; - /*! \brief Union for bit and word level access of word 21 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B5.F:0 R/W MSS Egress LUT Data 21 [15F:150] - AQ_MssEgressLutDataControlRegister_HHD.u21.bits_21.mssEgressLutData_21 - - Default = 0x0000 - - LUT data bits 351:336 - - */ - unsigned int mssEgressLutData_21 : 16; /* 1E.50B5.F:0 R/W Default = 0x0000 */ - /* LUT data bits 351:336 - */ - } bits_21; - uint16_t word_21; - } u21; - /*! \brief Union for bit and word level access of word 22 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B6.F:0 R/W MSS Egress LUT Data 22 [16F:160] - AQ_MssEgressLutDataControlRegister_HHD.u22.bits_22.mssEgressLutData_22 - - Default = 0x0000 - - LUT data bits 367:352 - - */ - unsigned int mssEgressLutData_22 : 16; /* 1E.50B6.F:0 R/W Default = 0x0000 */ - /* LUT data bits 367:352 - */ - } bits_22; - uint16_t word_22; - } u22; - /*! \brief Union for bit and word level access of word 23 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B7.F:0 R/W MSS Egress LUT Data 23 [17F:170] - AQ_MssEgressLutDataControlRegister_HHD.u23.bits_23.mssEgressLutData_23 - - Default = 0x0000 - - LUT data bits 383:368 - - */ - unsigned int mssEgressLutData_23 : 16; /* 1E.50B7.F:0 R/W Default = 0x0000 */ - /* LUT data bits 383:368 - */ - } bits_23; - uint16_t word_23; - } u23; - /*! \brief Union for bit and word level access of word 24 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B8.F:0 R/W MSS Egress LUT Data 24 [18F:180] - AQ_MssEgressLutDataControlRegister_HHD.u24.bits_24.mssEgressLutData_24 - - Default = 0x0000 - - LUT data bits 399:384 - - */ - unsigned int mssEgressLutData_24 : 16; /* 1E.50B8.F:0 R/W Default = 0x0000 */ - /* LUT data bits 399:384 - */ - } bits_24; - uint16_t word_24; - } u24; - /*! \brief Union for bit and word level access of word 25 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50B9.F:0 R/W MSS Egress LUT Data 25 [19F:190] - AQ_MssEgressLutDataControlRegister_HHD.u25.bits_25.mssEgressLutData_25 - - Default = 0x0000 - - LUT data bits 415:400 - - */ - unsigned int mssEgressLutData_25 : 16; /* 1E.50B9.F:0 R/W Default = 0x0000 */ - /* LUT data bits 415:400 - */ - } bits_25; - uint16_t word_25; - } u25; - /*! \brief Union for bit and word level access of word 26 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50BA.F:0 R/W MSS Egress LUT Data 26 [1AF:1A0] - AQ_MssEgressLutDataControlRegister_HHD.u26.bits_26.mssEgressLutData_26 - - Default = 0x0000 - - LUT data bits 431:416 - - */ - unsigned int mssEgressLutData_26 : 16; /* 1E.50BA.F:0 R/W Default = 0x0000 */ - /* LUT data bits 431:416 - */ - } bits_26; - uint16_t word_26; - } u26; - /*! \brief Union for bit and word level access of word 27 of MSS Egress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.50BB.F:0 R/W MSS Egress LUT Data 27 [1BF:1B0] - AQ_MssEgressLutDataControlRegister_HHD.u27.bits_27.mssEgressLutData_27 - - Default = 0x0000 - - LUT data bits 447:432 - - */ - unsigned int mssEgressLutData_27 : 16; /* 1E.50BB.F:0 R/W Default = 0x0000 */ - /* LUT data bits 447:432 - */ - } bits_27; - uint16_t word_27; - } u27; -} AQ_MssEgressLutDataControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System General Control Register: 1E.6004 */ -/* MSM System General Control Register: 1E.6004 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System General Control Register */ - union - { - struct - { - /*! \brief 1E.6004.F R/W MSM System PHY Tx Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPhyTxEnable - - Default = 0x0 - - 1 = Enable PHY Tx - - - Notes: - Directly controls the phy_tx_ena pin. */ - unsigned int msmSystemPhyTxEnable : 1; /* 1E.6004.F R/W Default = 0x0 */ - /* 1 = Enable PHY Tx - */ - /*! \brief 1E.6004.E R/W MSM System Rx Error Discard - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemRxErrorDiscard - - Default = 0x0 - - 1 = Enable discard of received errored frames - - - Notes: - Rx errored frame discard enable. When set to 1, any frame received with an error is discarded and not forwarded to the client interface. When set to 0, errored frames are forwarded to the client interface with ff_rx_err asserted. - Note : It is recommended to set this bit to 1 only when store and forward operation is enabled (RX_SECTION_FULL TBD). */ - unsigned int msmSystemRxErrorDiscard : 1; /* 1E.6004.E R/W Default = 0x0 */ - /* 1 = Enable discard of received errored frames - */ - /*! \brief 1E.6004.D R/W MSM System Control Frame Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemControlFrameEnable - - Default = 0x0 - - 1 = Control frame enabled - - - Notes: - MAC control frame enable. When set to 1, the MAC control frames with any Opcode other than 0x0001 are accepted and forwarded to the client interface. When set to 0, MAC control frames with any opcode other than 0x0001 are silently discarded. */ - unsigned int msmSystemControlFrameEnable : 1; /* 1E.6004.D R/W Default = 0x0 */ - /* 1 = Control frame enabled - */ - /*! \brief 1E.6004.C R/WSC MSM System Soft Reset - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemSoftReset - - Default = 0x0 - - 1 = Soft reset - - - Notes: - Software reset. Self clearing bit. When set to 1, resets all statistic counters as well as the Tx and Rx FIFOs. It should be issued after all traffic has been stopped as a result of clearing the Rx/Tx enable bits ( See MAC Rx Enable set to 0 and See MAC Tx Enable set to 0). - Note : Can lead to an Rx interface (ff_rx_xxx) violations to the application if the reset is issued in the middle of a receive frame transfer. Then the end of packet (assertion of ff_rx_eop) is lost and the application should be prepeared to handle this exception. */ - unsigned int msmSystemSoftReset : 1; /* 1E.6004.C R/WSC Default = 0x0 */ - /* 1 = Soft reset - */ - /*! \brief 1E.6004.B R/W MSM System Tx Pad Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemTxPadEnable - - Default = 0x1 - - 1 = Enable Tx padding - - - Notes: - When set to 1, enable padding of frames in the Tx direction. When set to 0, the MAC will not extend frames from the application to a minimum of 64 bytes, allowing to transmit short frames (violating the Ethernet mimimum size requirements). Must be set to 1 for normal operation. */ - unsigned int msmSystemTxPadEnable : 1; /* 1E.6004.B R/W Default = 0x1 */ - /* 1 = Enable Tx padding - */ - /*! \brief 1E.6004.A R/W MSM System Tx CRC Append - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemTxCrcAppend - - Default = 0x0 - - 1 = Append Tx CRC - - - Notes: - Permanently enable CRC append on transmit. If set to 1, the Tx will append a CRC to all transmitted frames. If set to 0, CRC append can be controlled on a per frame basis using the pin ff_tx_crc. - This configuration bit is OR'ed with the external ff_tx_crc pin to instruct the Tx to append a CRC to transmitted frames. The ff_tx_crc pin is tied to 0. */ - unsigned int msmSystemTxCrcAppend : 1; /* 1E.6004.A R/W Default = 0x0 */ - /* 1 = Append Tx CRC - */ - /*! \brief 1E.6004.9 R/W MSM System Tx Address Insert Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemTxAddressInsertEnable - - Default = 0x0 - - 1 = Insert Tx MAC source address - - - Notes: - Set the source MAC address on transmit. If set to 1, the MAC overwrites the source MAC address with the MAC programmed address in all transmitted frames. When set to 0, the source MAC address is transmitted unmodified from the MAC Tx client application. */ - unsigned int msmSystemTxAddressInsertEnable : 1; /* 1E.6004.9 R/W Default = 0x0 */ - /* 1 = Insert Tx MAC source address - */ - /*! \brief 1E.6004.8 R/W MSM System Pause Ignore - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPauseIgnore - - Default = 0x0 - - 1 = Ignore pause frames - - - Notes: - Ignore pause frame quanta. If set to 1, received pause frames are ignored by the MAC. When set to 0, the Tx is stopped for the amount of time specified in the pause quanta received within the pause frame. */ - unsigned int msmSystemPauseIgnore : 1; /* 1E.6004.8 R/W Default = 0x0 */ - /* 1 = Ignore pause frames - */ - /*! \brief 1E.6004.7 R/W MSM System Pause Forward - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPauseForward - - Default = 0x0 - - 1 = Enable Pause forwarding - - - Notes: - Terminate or forward pause frames. If set to 1, pause frames are forwarded to the user application. In normal mode, when set to 0, pause frames are terminated and discarded within the MAC. */ - unsigned int msmSystemPauseForward : 1; /* 1E.6004.7 R/W Default = 0x0 */ - /* 1 = Enable Pause forwarding - */ - /*! \brief 1E.6004.6 R/W MSM System CRC Forward - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemCrcForward - - Default = 0x0 - - 1 = Enable CRC forwarding - - - Notes: - When set to 1, the CRC field of the received frames is forwarded with the frame to the user application. If disabled, the CRC field is stripped from the frame. - Note : If padding is enabled ( See MAC PAD Enable set to 1), this bit is ignored. */ - unsigned int msmSystemCrcForward : 1; /* 1E.6004.6 R/W Default = 0x0 */ - /* 1 = Enable CRC forwarding - */ - /*! \brief 1E.6004.5 R/W MSM System PAD Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPadEnable - - Default = 0x0 - - 1 = Enable frame padding removal on Rx - - - Notes: - When set to 1, enable frame padding removal on the Rx path. If enabled, padding is removed before the frame is transferred to the MAC client application. If disabled, no padding is removed on the Rx by the MAC. - Note : On Tx, the MAC always adds padding as required. */ - unsigned int msmSystemPadEnable : 1; /* 1E.6004.5 R/W Default = 0x0 */ - /* 1 = Enable frame padding removal on Rx - */ - /*! \brief 1E.6004.4 R/W MSM System Promiscuous Mode - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemPromiscuousMode - - Default = 0x0 - - 1 = Promiscuous mode - - - Notes: - When set to 1, all frames are received without any MAC address filtering. */ - unsigned int msmSystemPromiscuousMode : 1; /* 1E.6004.4 R/W Default = 0x0 */ - /* 1 = Promiscuous mode - */ - /*! \brief 1E.6004.3 R/W MSM System WAN Mode - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemWanMode - - Default = 0x0 - - 1 = WAN mode - 0 = LAN mode - - - Notes: - WAN mode enable. Sets WAN mode when set to 1 and LAN mode when set to 0. Note: When changing the mode, verifiy correct setting of the Tx IPG. */ - unsigned int msmSystemWanMode : 1; /* 1E.6004.3 R/W Default = 0x0 */ - /* 1 = WAN mode - 0 = LAN mode - */ - unsigned int reserved0 : 1; - /*! \brief 1E.6004.1 R/W MSM System Rx Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemRxEnable - - Default = 0x0 - - 1 = Rx enable - - Notes: - MAC Tx path enable. Should be set to 1 to enable the MAC Tx path. Should be set to 0 to disable the MAC Tx path. */ - unsigned int msmSystemRxEnable : 1; /* 1E.6004.1 R/W Default = 0x0 */ - /* 1 = Rx enable */ - /*! \brief 1E.6004.0 R/W MSM System Tx Enable - AQ_MsmSystemGeneralControlRegister_HHD.u0.bits_0.msmSystemTxEnable - - Default = 0x0 - - 1 = Tx enable - - Notes: - MAC Rx path enable. Should be set to 1 to enable the MAC Rx path. Should be set to 0 to disable the MAC Rx path. */ - unsigned int msmSystemTxEnable : 1; /* 1E.6004.0 R/W Default = 0x0 */ - /* 1 = Tx enable */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System General Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.6005.7 R/W MSM System Tx Low Power IDLE Enable - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemTxLowPowerIdleEnable - - Default = 0x0 - - 1 = Transmit LPI enable - - - Notes: - Transmit low power IDLE enable. When set to 1, the MAC completes the transmission of the current frame and generates low power IDLE sequences (LPI) to the XGMII/SGMII. When set to 0, the MAC operates in normal mode. This bit is OR'ed with the reg_lowp_ena pin. */ - unsigned int msmSystemTxLowPowerIdleEnable : 1; /* 1E.6005.7 R/W Default = 0x0 */ - /* 1 = Transmit LPI enable - */ - unsigned int reserved1 : 1; - /*! \brief 1E.6005.5 R/W MSM System SFD Check Disable - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemSfdCheckDisable - - Default = 0x0 - - 1 = Disable SFD check - - - Notes: - Disable check of SFD (0xD5) character at frame start. When set to 1, the frame is accepted even if the SFD byte following the preamble is not 0xD5. When set to 0, a frame is accepted only if the SFD byte is found with the value 0xD5. */ - unsigned int msmSystemSfdCheckDisable : 1; /* 1E.6005.5 R/W Default = 0x0 */ - /* 1 = Disable SFD check - */ - unsigned int reserved2 : 1; - /*! \brief 1E.6005.3 R/W MSM System Priority Flow Control Enable - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemPriorityFlowControlEnable - - Default = 0x0 - - 1 = Enable priority flow control - 0 = Enable link flow control - - - Notes: - Enable priority flow control (PFC) mode of operation. When set to 0, the MAC uses standard link pause frames. When set to 1, the MAC will transmit and accept PFC frames. */ - unsigned int msmSystemPriorityFlowControlEnable : 1; /* 1E.6005.3 R/W Default = 0x0 */ - /* 1 = Enable priority flow control - 0 = Enable link flow control - */ - /*! \brief 1E.6005.2 R/W MSM System IDLE Column Count Extend - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemIdleColumnCountExtend - - Default = 0x0 - - 1 = Extend IDLE column count - - Notes: - When set to 1, extends the RS layer IDLE column counter by 2x. The IEEE 802.3ae defines the fault condition to be cleared after 128 columns of IDLE have been received. If the MAC operates together with a WAN mode PCS (WIS) it may may happen (depending on PCS) that this period is too short to bridge the IDLE stuffing occurring in this mode, leading to a toggling fault indication. In this case, extending the counter helps to aoivd toggling fault indications. */ - unsigned int msmSystemIdleColumnCountExtend : 1; /* 1E.6005.2 R/W Default = 0x0 */ - /* 1 = Extend IDLE column count */ - /*! \brief 1E.6005.1 R/W MSM System Length Check Disable - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemLengthCheckDisable - - Default = 0x0 - - 1 = Disable length check - - Notes: - Payload length check disable. When set to 0, the MAC checks the frames payload length with the frame length/type field. When set to 1, the payload length check is disabled. */ - unsigned int msmSystemLengthCheckDisable : 1; /* 1E.6005.1 R/W Default = 0x0 */ - /* 1 = Disable length check */ - /*! \brief 1E.6005.0 R/W MSM System Force Send IDLE - AQ_MsmSystemGeneralControlRegister_HHD.u1.bits_1.msmSystemForceSendIdle - - Default = 0x0 - - 1 = Force send idle - - Notes: - When set to 1, suppress any frame transmissions and forces IDLE n the Tx interface instead of frames. This control affects the MAC reconciliation layer (RS) which acts after all MAC datapath has processed the frame. - Note : Does not have an effect on fault handling (i.e. reception of local fault will still cause transmit of remote fault). - Must be 0 for normal operation. */ - unsigned int msmSystemForceSendIdle : 1; /* 1E.6005.0 R/W Default = 0x0 */ - /* 1 = Force send idle */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemGeneralControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System FIFO Control Register: 1E.600E */ -/* MSM System FIFO Control Register: 1E.600E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.600E.7:0 R/W MSM System Rx FIFO Full Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u0.bits_0.msmSystemRxFifoFullThreshold - - Default = 0x08 - - Rx FIFO full threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmSystemRxFifoFullThreshold : 8; /* 1E.600E.7:0 R/W Default = 0x08 */ - /* Rx FIFO full threshold */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.600F.7:0 R/W MSM System Rx FIFO Empty Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u1.bits_1.msmSystemRxFifoEmptyThreshold - - Default = 0x00 - - Rx FIFO empty threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmSystemRxFifoEmptyThreshold : 8; /* 1E.600F.7:0 R/W Default = 0x00 */ - /* Rx FIFO empty threshold */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSM System FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 10; - /*! \brief 1E.6010.5:0 R/W MSM System Tx FIFO Full Threshold [5:0] - AQ_MsmSystemFifoControlRegister_HHD.u2.bits_2.msmSystemTxFifoFullThreshold - - Default = 0x08 - - Tx FIFO full threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmSystemTxFifoFullThreshold : 6; /* 1E.6010.5:0 R/W Default = 0x08 */ - /* Tx FIFO full threshold */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSM System FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 10; - /*! \brief 1E.6011.5:0 R/W MSM System Tx FIFO Empty Threshold [5:0] - AQ_MsmSystemFifoControlRegister_HHD.u3.bits_3.msmSystemTxFifoEmptyThreshold - - Default = 0x00 - - Tx FIFO empty threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmSystemTxFifoEmptyThreshold : 6; /* 1E.6011.5:0 R/W Default = 0x00 */ - /* Tx FIFO empty threshold */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of MSM System FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.6012.7:0 ROS MSM System Rx FIFO Almost Full Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u4.bits_4.msmSystemRxFifoAlmostFullThreshold - - Default = 0x00 - - Rx FIFO almost full threshold - - Notes: - Unused. */ - unsigned int msmSystemRxFifoAlmostFullThreshold : 8; /* 1E.6012.7:0 ROS Default = 0x00 */ - /* Rx FIFO almost full threshold */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of MSM System FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.6013.7:0 ROS MSM System Rx FIFO Almost Empty Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u5.bits_5.msmSystemRxFifoAlmostEmptyThreshold - - Default = 0x00 - - Rx FIFO almost empty threshold - - Notes: - Unused. */ - unsigned int msmSystemRxFifoAlmostEmptyThreshold : 8; /* 1E.6013.7:0 ROS Default = 0x00 */ - /* Rx FIFO almost empty threshold */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of MSM System FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.6014.7:0 ROS MSM System Tx FIFO Almost Full Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u6.bits_6.msmSystemTxFifoAlmostFullThreshold - - Default = 0x00 - - Tx FIFO almost full threshold - - Notes: - Unused. */ - unsigned int msmSystemTxFifoAlmostFullThreshold : 8; /* 1E.6014.7:0 ROS Default = 0x00 */ - /* Tx FIFO almost full threshold */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of MSM System FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.6015.7:0 ROS MSM System Tx FIFO Almost Empty Threshold [7:0] - AQ_MsmSystemFifoControlRegister_HHD.u7.bits_7.msmSystemTxFifoAlmostEmptyThreshold - - Default = 0x00 - - Tx FIFO almost empty threshold - - Notes: - Unused. */ - unsigned int msmSystemTxFifoAlmostEmptyThreshold : 8; /* 1E.6015.7:0 ROS Default = 0x00 */ - /* Tx FIFO almost empty threshold */ - } bits_7; - uint16_t word_7; - } u7; -} AQ_MsmSystemFifoControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System General Status Register: 1E.6020 */ -/* MSM System General Status Register: 1E.6020 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System General Status Register */ - union - { - struct - { - unsigned int reserved0 : 10; - /*! \brief 1E.6020.5 RO MSM System Tx FIFO Empty - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemTxFifoEmpty - - - - Tx FIFO empty - - Notes: - When set to 1, indicates the Tx FIFO is empty. When set to 0, Tx FIFO is non-empty. */ - unsigned int msmSystemTxFifoEmpty : 1; /* 1E.6020.5 RO */ - /* Tx FIFO empty */ - /*! \brief 1E.6020.4 RO MSM System Rx Low Power IDLE - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemRxLowPowerIdle - - - - Rx LPI detected - - Notes: - Receive low power IDLE (LPI). Set to 1 when LPI is currently detected on the MAC Rx interface. Set to 0, when the MAC currently operates in normal mode. */ - unsigned int msmSystemRxLowPowerIdle : 1; /* 1E.6020.4 RO */ - /* Rx LPI detected */ - /*! \brief 1E.6020.3 R/W MSM System Timestamp Available - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemTimestampAvailable - - Default = 0x0 - - Timestamp available - - Notes: - Transmit timestamp available. Indicates that the timestamp of the last transmitted event frame (which had ff_tx_ts_frm=1) is available in the register See MAC Time Stamp Status 0 [F:0] and See MAC Time Stamp Status 1 [F:0] . To clear this bit, the bit must be written with a 1. - */ - unsigned int msmSystemTimestampAvailable : 1; /* 1E.6020.3 R/W Default = 0x0 */ - /* Timestamp available */ - /*! \brief 1E.6020.2 RO MSM System PHY Loss of Signal - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemPhyLossOfSignal - - - - PHY loss of signal - - Notes: - PHY indicates loss of signal. This is the value of pin phy_los which is tied to 0. */ - unsigned int msmSystemPhyLossOfSignal : 1; /* 1E.6020.2 RO */ - /* PHY loss of signal */ - /*! \brief 1E.6020.1 BLH MSM System Rx Remote Fault - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemRxRemoteFault - - - - Rx remote fault detected - - Notes: - Latch high local fault status. Set to 1, whent he MAC detects Rx local fault sequences on the Rx interface. Reset to 0 after read and after reset. */ - unsigned int msmSystemRxRemoteFault : 1; /* 1E.6020.1 BLH */ - /* Rx remote fault detected */ - /*! \brief 1E.6020.0 BLH MSM System Rx Local Fault - AQ_MsmSystemGeneralStatusRegister_HHD.u0.bits_0.msmSystemRxLocalFault - - - - Rx local fault detected - - Notes: - Latch high local fault status. Set to 1, whent he MAC detects Rx local fault sequences on the Rx interface. Reset to 0 after read and after reset. */ - unsigned int msmSystemRxLocalFault : 1; /* 1E.6020.0 BLH */ - /* Rx local fault detected */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System General Status Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemGeneralStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx IPG Control Register: 1E.6022 */ -/* MSM System Tx IPG Control Register: 1E.6022 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx IPG Control Register */ - union - { - struct - { - unsigned int reserved0 : 10; - /*! \brief 1E.6022.5:0 R/W MSM System Tx IPG Length [5:0] - AQ_MsmSystemTxIpgControlRegister_HHD.u0.bits_0.msmSystemTxIpgLength - - Default = 0x0C - - Tx IPG length - - Notes: - Tx inter-packet gap (IPG) value. Depending on LAN or WAN mode of operation. - LAN Mode : Number of octets in steps of 4. Valid values are 8, 12, 16,..., 100. DIC is supported for any setting > 8. A default of 12 must be set to conform to IEEE802.3ae. - WAN Mode : Stretch factor. Valid values are 4 ... 15. The stretch factor is calculated as (value+1)*8. A default of 12 must be set to conform to IEEE802.3ae (i.e. 13*8=104). A larger value shrinks the IPG (increasing bandwidth). - The reset value of 12 leads to IEEE802.3ae conformant behavior in both modes. - Note : WAN mode is only available in 10G mode of operation. */ - unsigned int msmSystemTxIpgLength : 6; /* 1E.6022.5:0 R/W Default = 0x0C */ - /* Tx IPG length */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx IPG Control Register */ - union - { - struct - { - /*! \brief 1E.6023.F:0 MSM System Tx IPG Reserved - AQ_MsmSystemTxIpgControlRegister_HHD.u1.bits_1.msmSystemTxIpgReserved - - - - Value always 0, writes ignored - */ - unsigned int msmSystemTxIpgReserved : 16; /* 1E.6023.F:0 */ - /* Value always 0, writes ignored */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxIpgControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Good Frames Counter Register: 1E.6040 */ -/* MSM System Tx Good Frames Counter Register: 1E.6040 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6040.F:0 ROS MSM System Tx Good Frames Counter 0 [F:0] - AQ_MsmSystemTxGoodFramesCounterRegister_HHD.u0.bits_0.msmSystemTxGoodFramesCounter_0 - - Default = 0x0000 - - Tx good frame counter bits 15:0 - - Notes: - Count of frames transmitted without error (Including pause frames). */ - unsigned int msmSystemTxGoodFramesCounter_0 : 16; /* 1E.6040.F:0 ROS Default = 0x0000 */ - /* Tx good frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6041.F:0 ROS MSM System Tx Good Frames Counter 1 [F:0] - AQ_MsmSystemTxGoodFramesCounterRegister_HHD.u1.bits_1.msmSystemTxGoodFramesCounter_1 - - Default = 0x0000 - - Tx good frame counter bits 31:16 - - - Notes: - Count of frames transmitted without error (Including pause frames). */ - unsigned int msmSystemTxGoodFramesCounter_1 : 16; /* 1E.6041.F:0 ROS Default = 0x0000 */ - /* Tx good frame counter bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxGoodFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Good Frames Counter Register: 1E.6044 */ -/* MSM System Rx Good Frames Counter Register: 1E.6044 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6044.F:0 ROS MSM System Rx Good Frames Counter 0 [F:0] - AQ_MsmSystemRxGoodFramesCounterRegister_HHD.u0.bits_0.msmSystemRxGoodFramesCounter_0 - - Default = 0x0000 - - Rx good frame counter bits 15:0 - - Notes: - Count of frames received without error (Including pause frames). */ - unsigned int msmSystemRxGoodFramesCounter_0 : 16; /* 1E.6044.F:0 ROS Default = 0x0000 */ - /* Rx good frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6045.F:0 ROS MSM System Rx Good Frames Counter 1 [F:0] - AQ_MsmSystemRxGoodFramesCounterRegister_HHD.u1.bits_1.msmSystemRxGoodFramesCounter_1 - - Default = 0x0000 - - Rx good frame counter bits 31:16 - - Notes: - Count of frames received without error (Including pause frames). */ - unsigned int msmSystemRxGoodFramesCounter_1 : 16; /* 1E.6045.F:0 ROS Default = 0x0000 */ - /* Rx good frame counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxGoodFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx FCS Errors Counter Register: 1E.6048 */ -/* MSM System Rx FCS Errors Counter Register: 1E.6048 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx FCS Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.6048.F:0 ROS MSM System FCS Error Counter 0 [F:0] - AQ_MsmSystemRxFcsErrorsCounterRegister_HHD.u0.bits_0.msmSystemFcsErrorCounter_0 - - Default = 0x0000 - - Frame check sequence error counter bits 15:0 - - Notes: - Count of frames for which a CRC-32 Error is detected but the frame is otherwise of correct length. */ - unsigned int msmSystemFcsErrorCounter_0 : 16; /* 1E.6048.F:0 ROS Default = 0x0000 */ - /* Frame check sequence error counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx FCS Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.6049.F:0 ROS MSM System FCS Error Counter 1 [F:0] - AQ_MsmSystemRxFcsErrorsCounterRegister_HHD.u1.bits_1.msmSystemFcsErrorCounter_1 - - Default = 0x0000 - - Frame check sequence error counter bits 31:16 - - Notes: - Count of frames for which a CRC-32 Error is detected but the frame is otherwise of correct length. */ - unsigned int msmSystemFcsErrorCounter_1 : 16; /* 1E.6049.F:0 ROS Default = 0x0000 */ - /* Frame check sequence error counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxFcsErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Alignment Errors Counter Register: 1E.604C */ -/* MSM System Rx Alignment Errors Counter Register: 1E.604C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Alignment Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.604C.F:0 ROS MSM System Alignment Error Counter 0 [F:0] - AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD.u0.bits_0.msmSystemAlignmentErrorCounter_0 - - Default = 0x0000 - - Alignment error counter bits 15:0 - - Notes: - Count of frames received with an alignment error. */ - unsigned int msmSystemAlignmentErrorCounter_0 : 16; /* 1E.604C.F:0 ROS Default = 0x0000 */ - /* Alignment error counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Alignment Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.604D.F:0 ROS MSM System Alignment Error Counter 1 [F:0] - AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD.u1.bits_1.msmSystemAlignmentErrorCounter_1 - - Default = 0x0000 - - Alignment error counter bits 31:16 - - Notes: - Count of frames received with an alignment error. */ - unsigned int msmSystemAlignmentErrorCounter_1 : 16; /* 1E.604D.F:0 ROS Default = 0x0000 */ - /* Alignment error counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxAlignmentErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Pause Frames Counter Register: 1E.6050 */ -/* MSM System Tx Pause Frames Counter Register: 1E.6050 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6050.F:0 ROS MSM System Tx Pause Frames Counter 0 [F:0] - AQ_MsmSystemTxPauseFramesCounterRegister_HHD.u0.bits_0.msmSystemTxPauseFramesCounter_0 - - Default = 0x0000 - - Tx pause frame counter bits 15:0 - - Notes: - Valid pause frames transmitted. */ - unsigned int msmSystemTxPauseFramesCounter_0 : 16; /* 1E.6050.F:0 ROS Default = 0x0000 */ - /* Tx pause frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6051.F:0 ROS MSM System Tx Pause Frames Counter 1 [F:0] - AQ_MsmSystemTxPauseFramesCounterRegister_HHD.u1.bits_1.msmSystemTxPauseFramesCounter_1 - - Default = 0x0000 - - Tx pause frame counter bits 31:16 - - - Notes: - Valid pause frames transmitted. */ - unsigned int msmSystemTxPauseFramesCounter_1 : 16; /* 1E.6051.F:0 ROS Default = 0x0000 */ - /* Tx pause frame counter bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxPauseFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Pause Frames Counter Register: 1E.6054 */ -/* MSM System Rx Pause Frames Counter Register: 1E.6054 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6054.F:0 ROS MSM System Rx Pause Frames Counter 0 [F:0] - AQ_MsmSystemRxPauseFramesCounterRegister_HHD.u0.bits_0.msmSystemRxPauseFramesCounter_0 - - Default = 0x0000 - - Rx pause frame counter bits 15:0 - - Notes: - Valid pause frames received. */ - unsigned int msmSystemRxPauseFramesCounter_0 : 16; /* 1E.6054.F:0 ROS Default = 0x0000 */ - /* Rx pause frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6055.F:0 ROS MSM System Rx Pause Frames Counter 1 [F:0] - AQ_MsmSystemRxPauseFramesCounterRegister_HHD.u1.bits_1.msmSystemRxPauseFramesCounter_1 - - Default = 0x0000 - - Rx pause frame counter bits 31:16 - - Notes: - Valid pause frames received. */ - unsigned int msmSystemRxPauseFramesCounter_1 : 16; /* 1E.6055.F:0 ROS Default = 0x0000 */ - /* Rx pause frame counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxPauseFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Too Long Errors Counter Register: 1E.6058 */ -/* MSM System Rx Too Long Errors Counter Register: 1E.6058 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Too Long Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.6058.F:0 ROS MSM System Rx Too Long Errors Counter 0 [F:0] - AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD.u0.bits_0.msmSystemRxTooLongErrorsCounter_0 - - Default = 0x0000 - - Too-long errors counter bits 15:0 - - Notes: - Frame received exceeded the maximum length programmed with register FRM_LGTH. */ - unsigned int msmSystemRxTooLongErrorsCounter_0 : 16; /* 1E.6058.F:0 ROS Default = 0x0000 */ - /* Too-long errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Too Long Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.6059.F:0 ROS MSM System Rx Too Long Errors Counter 1 [F:0] - AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD.u1.bits_1.msmSystemRxTooLongErrorsCounter_1 - - Default = 0x0000 - - Too-long errors counter bits 31:16 - - Notes: - Frame received exceeded the maximum length programmed with register FRM_LGTH. */ - unsigned int msmSystemRxTooLongErrorsCounter_1 : 16; /* 1E.6059.F:0 ROS Default = 0x0000 */ - /* Too-long errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxTooLongErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx In Range Length Errors Counter Register: 1E.605C */ -/* MSM System Rx In Range Length Errors Counter Register: 1E.605C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx In Range Length Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.605C.F:0 ROS MSM System Rx In Range Length Errors Counter 0 [F:0] - AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD.u0.bits_0.msmSystemRxInRangeLengthErrorsCounter_0 - - Default = 0x0000 - - In-range-length errors counter bits 15:0 - - Notes: - A count of frames with a length/type field value between 46 (VLAN: 42) and less than 0x0600, that does not match the number of payload data octets received. Should count also if length/type field is less than 46 (VLAN: 42) and the frame is longer than 64 bytes. */ - unsigned int msmSystemRxInRangeLengthErrorsCounter_0 : 16; /* 1E.605C.F:0 ROS Default = 0x0000 */ - /* In-range-length errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx In Range Length Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.605D.F:0 ROS MSM System Rx In Range Length Errors Counter 1 [F:0] - AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD.u1.bits_1.msmSystemRxInRangeLengthErrorsCounter_1 - - Default = 0x0000 - - In-range-length errors counter bits 31:16 - - Notes: - A count of frames with a length/type field value between 46 (VLAN: 42) and less than 0x0600, that does not match the number of payload data octets received. Should count also if length/type field is less than 46 (VLAN: 42) and the frame is longer than 64 bytes. */ - unsigned int msmSystemRxInRangeLengthErrorsCounter_1 : 16; /* 1E.605D.F:0 ROS Default = 0x0000 */ - /* In-range-length errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxInRangeLengthErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx VLAN Frames Counter Register: 1E.6060 */ -/* MSM System Tx VLAN Frames Counter Register: 1E.6060 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6060.F:0 ROS MSM System Tx VLAN Frames Counter 0 [F:0] - AQ_MsmSystemTxVlanFramesCounterRegister_HHD.u0.bits_0.msmSystemTxVlanFramesCounter_0 - - Default = 0x0000 - - Tx VLAN frames counter bits 15:0 - - Notes: - Valid VLAN tagged frames transmitted. */ - unsigned int msmSystemTxVlanFramesCounter_0 : 16; /* 1E.6060.F:0 ROS Default = 0x0000 */ - /* Tx VLAN frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6061.F:0 ROS MSM System Tx VLAN Frames Counter 1 [F:0] - AQ_MsmSystemTxVlanFramesCounterRegister_HHD.u1.bits_1.msmSystemTxVlanFramesCounter_1 - - Default = 0x0000 - - Tx VLAN frames counter bits 31:16 - - Notes: - Valid VLAN tagged frames transmitted. */ - unsigned int msmSystemTxVlanFramesCounter_1 : 16; /* 1E.6061.F:0 ROS Default = 0x0000 */ - /* Tx VLAN frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxVlanFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx VLAN Frames Counter Register: 1E.6064 */ -/* MSM System Rx VLAN Frames Counter Register: 1E.6064 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6064.F:0 ROS MSM System Rx VLAN Frames Counter 0 [F:0] - AQ_MsmSystemRxVlanFramesCounterRegister_HHD.u0.bits_0.msmSystemRxVlanFramesCounter_0 - - Default = 0x0000 - - Rx VLAN frames counter bits 15:0 - - Notes: - Valid VLAN tagged frames received. */ - unsigned int msmSystemRxVlanFramesCounter_0 : 16; /* 1E.6064.F:0 ROS Default = 0x0000 */ - /* Rx VLAN frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6065.F:0 ROS MSM System Rx VLAN Frames Counter 1 [F:0] - AQ_MsmSystemRxVlanFramesCounterRegister_HHD.u1.bits_1.msmSystemRxVlanFramesCounter_1 - - Default = 0x0000 - - Rx VLAN frames counter bits 31:16 - - Notes: - Valid VLAN tagged frames received. */ - unsigned int msmSystemRxVlanFramesCounter_1 : 16; /* 1E.6065.F:0 ROS Default = 0x0000 */ - /* Rx VLAN frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxVlanFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Octets Counter Register: 1E.6068 */ -/* MSM System Tx Octets Counter Register: 1E.6068 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.6068.F:0 ROS MSM System Tx Octets Counter 0 [F:0] - AQ_MsmSystemTxOctetsCounterRegister_HHD.u0.bits_0.msmSystemTxOctetsCounter_0 - - Default = 0x0000 - - Tx octets counter bits 15:0 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmSystemTxOctetsCounter_0 : 16; /* 1E.6068.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.6069.F:0 ROS MSM System Tx Octets Counter 1 [F:0] - AQ_MsmSystemTxOctetsCounterRegister_HHD.u1.bits_1.msmSystemTxOctetsCounter_1 - - Default = 0x0000 - - Tx octets counter bits 31:16 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmSystemTxOctetsCounter_1 : 16; /* 1E.6069.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSM System Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.606A.F:0 ROS MSM System Tx Octets Counter 2 [F:0] - AQ_MsmSystemTxOctetsCounterRegister_HHD.u2.bits_2.msmSystemTxOctetsCounter_2 - - Default = 0x0000 - - Tx octets counter bits 47:32 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmSystemTxOctetsCounter_2 : 16; /* 1E.606A.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 47:32 */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSM System Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.606B.F:0 ROS MSM System Tx Octets Counter 3 [F:0] - AQ_MsmSystemTxOctetsCounterRegister_HHD.u3.bits_3.msmSystemTxOctetsCounter_3 - - Default = 0x0000 - - Tx octets counter bits 63:48 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmSystemTxOctetsCounter_3 : 16; /* 1E.606B.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 63:48 */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_MsmSystemTxOctetsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Octets Counter Register: 1E.606C */ -/* MSM System Rx Octets Counter Register: 1E.606C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.606C.F:0 ROS MSM System Rx Octets Counter 0 [F:0] - AQ_MsmSystemRxOctetsCounterRegister_HHD.u0.bits_0.msmSystemRxOctetsCounter_0 - - Default = 0x0000 - - Rx octets counter bits 15:0 - - Notes: - All octets received except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames received. */ - unsigned int msmSystemRxOctetsCounter_0 : 16; /* 1E.606C.F:0 ROS Default = 0x0000 */ - /* Rx octets counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.606D.F:0 ROS MSM System Rx Octets Counter 1 [F:0] - AQ_MsmSystemRxOctetsCounterRegister_HHD.u1.bits_1.msmSystemRxOctetsCounter_1 - - Default = 0x0000 - - Rx octets counter bits 31:16 - - Notes: - All octets received except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames received. */ - unsigned int msmSystemRxOctetsCounter_1 : 16; /* 1E.606D.F:0 ROS Default = 0x0000 */ - /* Rx octets counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxOctetsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Unicast Frames Counter Register: 1E.6070 */ -/* MSM System Rx Unicast Frames Counter Register: 1E.6070 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6070.F:0 ROS MSM System Rx Unicast Frames Counter 0 [F:0] - AQ_MsmSystemRxUnicastFramesCounterRegister_HHD.u0.bits_0.msmSystemRxUnicastFramesCounter_0 - - Default = 0x0000 - - Rx unicast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '0'. */ - unsigned int msmSystemRxUnicastFramesCounter_0 : 16; /* 1E.6070.F:0 ROS Default = 0x0000 */ - /* Rx unicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6071.F:0 ROS MSM System Rx Unicast Frames Counter 1 [F:0] - AQ_MsmSystemRxUnicastFramesCounterRegister_HHD.u1.bits_1.msmSystemRxUnicastFramesCounter_1 - - Default = 0x0000 - - Rx unicast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '0'. */ - unsigned int msmSystemRxUnicastFramesCounter_1 : 16; /* 1E.6071.F:0 ROS Default = 0x0000 */ - /* Rx unicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxUnicastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Multicast Frames Counter Register: 1E.6074 */ -/* MSM System Rx Multicast Frames Counter Register: 1E.6074 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6074.F:0 ROS MSM System Rx Multicast Frames Counter 0 [F:0] - AQ_MsmSystemRxMulticastFramesCounterRegister_HHD.u0.bits_0.msmSystemRxMulticastFramesCounter_0 - - Default = 0x0000 - - Rx multicast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '1' but not the broadcast address (all bits set '1' ). Pause frames are not counted. */ - unsigned int msmSystemRxMulticastFramesCounter_0 : 16; /* 1E.6074.F:0 ROS Default = 0x0000 */ - /* Rx multicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6075.F:0 ROS MSM System Rx Multicast Frames Counter 1 [F:0] - AQ_MsmSystemRxMulticastFramesCounterRegister_HHD.u1.bits_1.msmSystemRxMulticastFramesCounter_1 - - Default = 0x0000 - - Rx multicast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '1' but not the broadcast address (all bits set '1' ). Pause frames are not counted. */ - unsigned int msmSystemRxMulticastFramesCounter_1 : 16; /* 1E.6075.F:0 ROS Default = 0x0000 */ - /* Rx multicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxMulticastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Broadcast Frames Counter Register: 1E.6078 */ -/* MSM System Rx Broadcast Frames Counter Register: 1E.6078 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6078.F:0 ROS MSM System Rx Broadcast Frames Counter 0 [F:0] - AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD.u0.bits_0.msmSystemRxBroadcastFramesCounter_0 - - Default = 0x0000 - - Rx broadcast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface (FIFO) and all bits of the destination address were set '1'. */ - unsigned int msmSystemRxBroadcastFramesCounter_0 : 16; /* 1E.6078.F:0 ROS Default = 0x0000 */ - /* Rx broadcast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6079.F:0 ROS MSM System Rx Broadcast Frames Counter 1 [F:0] - AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD.u1.bits_1.msmSystemRxBroadcastFramesCounter_1 - - Default = 0x0000 - - Rx broadcast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface (FIFO) and all bits of the destination address were set '1'. */ - unsigned int msmSystemRxBroadcastFramesCounter_1 : 16; /* 1E.6079.F:0 ROS Default = 0x0000 */ - /* Rx broadcast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxBroadcastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Errors Counter Register: 1E.607C */ -/* MSM System Tx Errors Counter Register: 1E.607C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.607C.F:0 ROS MSM System Tx Errors Counter 0 [F:0] - AQ_MsmSystemTxErrorsCounterRegister_HHD.u0.bits_0.msmSystemTxErrorsCounter_0 - - Default = 0x0000 - - Rx errors counter bits 15:0 - - Notes: - Number of frames transmitted with error: - - FIFO Overflow Errors - - FIFO Underflow Errors */ - unsigned int msmSystemTxErrorsCounter_0 : 16; /* 1E.607C.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.607D.F:0 ROS MSM System Tx Errors Counter 1 [F:0] - AQ_MsmSystemTxErrorsCounterRegister_HHD.u1.bits_1.msmSystemTxErrorsCounter_1 - - Default = 0x0000 - - Tx errors counter bits 31:16 - - Notes: - Number of frames transmitted with error: - - FIFO Overflow Errors - - FIFO Underflow Errors */ - unsigned int msmSystemTxErrorsCounter_1 : 16; /* 1E.607D.F:0 ROS Default = 0x0000 */ - /* Tx errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Unicast Frames Counter Register: 1E.6084 */ -/* MSM System Tx Unicast Frames Counter Register: 1E.6084 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6084.F:0 ROS MSM System Tx Unicast Frames Counter 0 [F:0] - AQ_MsmSystemTxUnicastFramesCounterRegister_HHD.u0.bits_0.msmSystemTxUnicastFramesCounter_0 - - Default = 0x0000 - - Tx unicast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '0'. */ - unsigned int msmSystemTxUnicastFramesCounter_0 : 16; /* 1E.6084.F:0 ROS Default = 0x0000 */ - /* Tx unicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6085.F:0 ROS MSM System Tx Unicast Frames Counter 1 [F:0] - AQ_MsmSystemTxUnicastFramesCounterRegister_HHD.u1.bits_1.msmSystemTxUnicastFramesCounter_1 - - Default = 0x0000 - - Tx unicast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '0'. */ - unsigned int msmSystemTxUnicastFramesCounter_1 : 16; /* 1E.6085.F:0 ROS Default = 0x0000 */ - /* Tx unicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxUnicastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Multicast Frames Counter Register: 1E.6088 */ -/* MSM System Tx Multicast Frames Counter Register: 1E.6088 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6088.F:0 ROS MSM System Tx Multicast Frames Counter 0 [F:0] - AQ_MsmSystemTxMulticastFramesCounterRegister_HHD.u0.bits_0.msmSystemTxMulticastFramesCounter_0 - - Default = 0x0000 - - Tx multicast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '1' but not the broadcast address (all bits '1'). */ - unsigned int msmSystemTxMulticastFramesCounter_0 : 16; /* 1E.6088.F:0 ROS Default = 0x0000 */ - /* Tx multicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.6089.F:0 ROS MSM System Tx Multicast Frames Counter 1 [F:0] - AQ_MsmSystemTxMulticastFramesCounterRegister_HHD.u1.bits_1.msmSystemTxMulticastFramesCounter_1 - - Default = 0x0000 - - Tx multicast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '1' but not the broadcast address (all bits '1'). */ - unsigned int msmSystemTxMulticastFramesCounter_1 : 16; /* 1E.6089.F:0 ROS Default = 0x0000 */ - /* Tx multicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxMulticastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Tx Broadcast Frames Counter Register: 1E.608C */ -/* MSM System Tx Broadcast Frames Counter Register: 1E.608C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Tx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.608C.F:0 ROS MSM System Tx Broadcast Frames Counter 0 [F:0] - AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD.u0.bits_0.msmSystemTxBroadcastFramesCounter_0 - - Default = 0x0000 - - Tx broadcast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and all bits of the destination address set to '1'. */ - unsigned int msmSystemTxBroadcastFramesCounter_0 : 16; /* 1E.608C.F:0 ROS Default = 0x0000 */ - /* Tx broadcast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Tx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.608D.F:0 ROS MSM System Tx Broadcast Frames Counter 1 [F:0] - AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD.u1.bits_1.msmSystemTxBroadcastFramesCounter_1 - - Default = 0x0000 - - Tx broadcast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and all bits of the destination address set to '1'. */ - unsigned int msmSystemTxBroadcastFramesCounter_1 : 16; /* 1E.608D.F:0 ROS Default = 0x0000 */ - /* Tx broadcast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemTxBroadcastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM System Rx Errors Counter Register: 1E.60C8 */ -/* MSM System Rx Errors Counter Register: 1E.60C8 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM System Rx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.60C8.F:0 ROS MSM System Rx Errors Counter 0 [F:0] - AQ_MsmSystemRxErrorsCounterRegister_HHD.u0.bits_0.msmSystemRxErrorsCounter_0 - - Default = 0x0000 - - Rx errors counter bits 15:0 - - Notes: - Number of frames received with error: - - FIFO Overflow Errors - - CRC Errors - - Payload Length Errors - - Jabber and Oversized Errors - - Alignment Errors - - The dedicated Error Code (0xfe, not a code error) was received */ - unsigned int msmSystemRxErrorsCounter_0 : 16; /* 1E.60C8.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM System Rx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.60C9.F:0 ROS MSM System Rx Errors Counter 1 [F:0] - AQ_MsmSystemRxErrorsCounterRegister_HHD.u1.bits_1.msmSystemRxErrorsCounter_1 - - Default = 0x0000 - - Rx errors counter bits 31:16 - - Notes: - Number of frames received with error: - - FIFO Overflow Errors - - CRC Errors - - Payload Length Errors - - Jabber and Oversized Errors - - Alignment Errors - - The dedicated Error Code (0xfe, not a code error) was received */ - unsigned int msmSystemRxErrorsCounter_1 : 16; /* 1E.60C9.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmSystemRxErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress VLAN TPID 0 Register: 1E.8006 */ -/* MSS Ingress VLAN TPID 0 Register: 1E.8006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress VLAN TPID 0 Register */ - union - { - struct - { - /*! \brief 1E.8006.F:0 R/W MSS Ingress VLAN STag [F:0] - AQ_MssIngressVlanTpid_0Register_HHD.u0.bits_0.mssIngressVlanStag - - Default = 0x0000 - - STag TPID - - - Notes: - Service Tag Protocol Identifier (TPID) values to identify a VLAN tag. The " See SEC Egress VLAN CP Tag Parse STag " bit must be set to 1 for the incoming packet's TPID to be parsed. */ - unsigned int mssIngressVlanStag : 16; /* 1E.8006.F:0 R/W Default = 0x0000 */ - /* STag TPID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress VLAN TPID 0 Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressVlanTpid_0Register_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress VLAN TPID 1 Register: 1E.8008 */ -/* MSS Ingress VLAN TPID 1 Register: 1E.8008 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress VLAN TPID 1 Register */ - union - { - struct - { - /*! \brief 1E.8008.F:0 R/W MSS Ingress VLAN QTag [F:0] - AQ_MssIngressVlanTpid_1Register_HHD.u0.bits_0.mssIngressVlanQtag - - Default = 0x0000 - - QTag TPID - - - Notes: - Customer Tag Protocol Identifier (TPID) values to identify a VLAN tag. The " See SEC Egress VLAN CP Tag Parse QTag " bit must be set to 1 for the incoming packet's TPID to be parsed. */ - unsigned int mssIngressVlanQtag : 16; /* 1E.8008.F:0 R/W Default = 0x0000 */ - /* QTag TPID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress VLAN TPID 1 Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressVlanTpid_1Register_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress VLAN Control Register: 1E.800A */ -/* MSS Ingress VLAN Control Register: 1E.800A */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress VLAN Control Register */ - union - { - struct - { - /*! \brief 1E.800A.F:0 R/W MSS Ingress VLAN UP Map Table LSW [F:0] - AQ_MssIngressVlanControlRegister_HHD.u0.bits_0.mssIngressVlanUpMapTableLSW - - Default = 0x0000 - - Map table bits 15:0 - - - Notes: - If there is a customer TPID Tag match and no service TPID Tag match or the service TPID Tag match is disabled, the outer TAG's PCP is used to index into this map table to generate the packets user priority. - 2:0 : UP value for customer Tag PCP 0x0 - 5:3: UP value for customer Tag PCP 0x0 - 8:6 : UP value for customer Tag PCP 0x0 - 11:9 : UP value for customer Tag PCP 0x0 - 14:12 : UP value for customer Tag PCP 0x0 - 17:15 : UP value for customer Tag PCP 0x0 */ - unsigned int mssIngressVlanUpMapTableLSW : 16; /* 1E.800A.F:0 R/W Default = 0x0000 */ - /* Map table bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress VLAN Control Register */ - union - { - struct - { - /*! \brief 1E.800B.F R/W MSS Ingress VLAN QTag Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanQtagParseEnable - - Default = 0x0 - - 1 = Enable VLAN QTag parsing - - - Notes: - Enable controlled port VLAN customer Tag parsing. When this bit is set to 1, the incoming packet's outer TPID will be compared with the configured " See MSS Ingress VLAN QTag [F:0] " for matching. If the " See SEC Egress VLAN CP Tag Parse QinQ " bit is set to1, this will also be used to compare the incoming packet's inner TPID. */ - unsigned int mssIngressVlanQtagParseEnable : 1; /* 1E.800B.F R/W Default = 0x0 */ - /* 1 = Enable VLAN QTag parsing - */ - /*! \brief 1E.800B.E R/W MSS Ingress VLAN STag Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanStagParseEnable - - Default = 0x0 - - 1 = Enable VLAN STag parsing - - - Notes: - Enable controlled port VLAN service Tag parsing. When this bit is set to 1, the incoming packets outer TPID will be compared with the configured " See MSS Ingress VLAN Stag [F:0] " for matching. If the " See SEC Egress VLAN CP Tag Parse QinQ " bit is set to1, this will also be used to compare the incoming packet's inner TPID. */ - unsigned int mssIngressVlanStagParseEnable : 1; /* 1E.800B.E R/W Default = 0x0 */ - /* 1 = Enable VLAN STag parsing - */ - /*! \brief 1E.800B.D R/W MSS Ingress VLAN QinQ Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanQinqParseEnable - - Default = 0x0 - - VLAN CP Tag Parse QinQ - - - Notes: - Enable controlled port VLAN QinQ Tag parsing. When this bit is set to 1 both the outer and inner VLAN Tags will be parsed. */ - unsigned int mssIngressVlanQinqParseEnable : 1; /* 1E.800B.D R/W Default = 0x0 */ - /* VLAN CP Tag Parse QinQ - */ - /*! \brief 1E.800B.C R/W MSS Ingress VLAN QTag UP Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanQtagUpParseEnable - - Default = 0x0 - - VLAN CP Tag QTag UP enable - - - Notes: - Enable controlled port customer VLAN customer Tag user priority field parsing. */ - unsigned int mssIngressVlanQtagUpParseEnable : 1; /* 1E.800B.C R/W Default = 0x0 */ - /* VLAN CP Tag QTag UP enable - */ - /*! \brief 1E.800B.B R/W MSS Ingress VLAN STag UP Parse Enable - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanStagUpParseEnable - - Default = 0x0 - - VLAN CP Tag STag UP enable - - - Notes: - Enable controlled port service VLAN service Tag user priority field parsing. */ - unsigned int mssIngressVlanStagUpParseEnable : 1; /* 1E.800B.B R/W Default = 0x0 */ - /* VLAN CP Tag STag UP enable - */ - /*! \brief 1E.800B.A:8 R/W MSS Ingress VLAN UP Default [2:0] - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanUpDefault - - Default = 0x0 - - UP default - - - Notes: - User priority default */ - unsigned int mssIngressVlanUpDefault : 3; /* 1E.800B.A:8 R/W Default = 0x0 */ - /* UP default - */ - /*! \brief 1E.800B.7:0 R/W MSS Ingress VLAN UP Map Table MSW [17:10] - AQ_MssIngressVlanControlRegister_HHD.u1.bits_1.mssIngressVlanUpMapTableMSW - - Default = 0x00 - - UP Map table bits 23:16 - - - Notes: - If there is a customer TPID Tag match and no service TPID Tag match or the service TPID Tag match is disabled, the outer TAG's PCP is used to index into this map table to generate the packets user priority. - 2:0 : UP value for customer Tag PCP 0x0 - 5:3: UP value for customer Tag PCP 0x0 - 8:6 : UP value for customer Tag PCP 0x0 - 11:9 : UP value for customer Tag PCP 0x0 - 14:12 : UP value for customer Tag PCP 0x0 - 17:15 : UP value for customer Tag PCP 0x0 - 20:18 : UP value for customer Tag PCP 0x0 - 23:21 : UP value for customer Tag PCP 0x0 */ - unsigned int mssIngressVlanUpMapTableMSW : 8; /* 1E.800B.7:0 R/W Default = 0x00 */ - /* UP Map table bits 23:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressVlanControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress MTU Size Control Register: 1E.800C */ -/* MSS Ingress MTU Size Control Register: 1E.800C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress MTU Size Control Register */ - union - { - struct - { - /*! \brief 1E.800C.F:0 R/W MSS Ingress Controlled Packet MTU Size [F:0] - AQ_MssIngressMtuSizeControlRegister_HHD.u0.bits_0.mssIngressControlledPacketMtuSize - - Default = 0x05DC - - Maximum transmission unit for controlled packet - - - Notes: - Maximum transmission unit of controlled packet */ - unsigned int mssIngressControlledPacketMtuSize : 16; /* 1E.800C.F:0 R/W Default = 0x05DC */ - /* Maximum transmission unit for controlled packet - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress MTU Size Control Register */ - union - { - struct - { - /*! \brief 1E.800D.F:0 R/W MSS Ingress Uncontrolled Packet MTU Size [F:0] - AQ_MssIngressMtuSizeControlRegister_HHD.u1.bits_1.mssIngressUncontrolledPacketMtuSize - - Default = 0x05DC - - Maximum transmission unit for uncontrolled packet - - - Notes: - Maximum transmission unit of uncontrolled packet */ - unsigned int mssIngressUncontrolledPacketMtuSize : 16; /* 1E.800D.F:0 R/W Default = 0x05DC */ - /* Maximum transmission unit for uncontrolled packet - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressMtuSizeControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress Control Register: 1E.800E */ -/* MSS Ingress Control Register: 1E.800E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress Control Register */ - union - { - struct - { - unsigned int reserved0 : 2; - /*! \brief 1E.800E.D R/W MSS Ingress ICV LSB 8 Bytes Enable - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressIcvLsb_8BytesEnable - - Default = 0x0 - - 1 = Use LSB - 0 = Use MSB - - - - Notes: - This bit selects MSB or LSB 8 bytes selection in the case where the ICV is 8 bytes. - 0 = MSB is used. */ - unsigned int mssIngressIcvLsb_8BytesEnable : 1; /* 1E.800E.D R/W Default = 0x0 */ - /* 1 = Use LSB - 0 = Use MSB - - */ - /*! \brief 1E.800E.C:B R/W MSS Ingress Global Validate Frames [1:0] - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressGlobalValidateFrames - - Default = 0x0 - - Default validate frames configuration - - - Notes: - If the SC is invalid or if an IGPRC miss packet condition occurs, this default will be used for the validate frames configuration instead of the validate frame entry in the Ingress SC Table (IGSCT). */ - unsigned int mssIngressGlobalValidateFrames : 2; /* 1E.800E.C:B R/W Default = 0x0 */ - /* Default validate frames configuration - */ - /*! \brief 1E.800E.A R/W MSS Ingress Remove SECTag - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressRemoveSectag - - Default = 0x0 - - 1 = Enable removal of SECTag - - - Notes: - If this bit is set and either of the following two conditions occurs, the SECTag will be removed. - Controlled packet and either the SA or SC is invalid. - IGPRC miss. */ - unsigned int mssIngressRemoveSectag : 1; /* 1E.800E.A R/W Default = 0x0 */ - /* 1 = Enable removal of SECTag - */ - /*! \brief 1E.800E.9 R/W MSS Ingress High Priority - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressHighPriority - - Default = 0x0 - - 1 = MIB counter clear on read enable - - - Notes: - If this bit is set to 1, read is given high priority and the MIB count value becomes 0 after read. */ - unsigned int mssIngressHighPriority : 1; /* 1E.800E.9 R/W Default = 0x0 */ - /* 1 = MIB counter clear on read enable - */ - /*! \brief 1E.800E.8 R/W MSS Ingress Clear Count - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressClearCount - - Default = 0x0 - - 1 = Clear all MIB counters - - - Notes: - If this bit is set to 1, all MIB counters will be cleared. */ - unsigned int mssIngressClearCount : 1; /* 1E.800E.8 R/W Default = 0x0 */ - /* 1 = Clear all MIB counters - */ - /*! \brief 1E.800E.7 R/W MSS Ingress Clear Global Time - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressClearGlobalTime - - Default = 0x0 - - 1 = Clear global time - - - Notes: - Clear global time */ - unsigned int mssIngressClearGlobalTime : 1; /* 1E.800E.7 R/W Default = 0x0 */ - /* 1 = Clear global time - */ - /*! \brief 1E.800E.6 R/W MSS Ingress Check ICV - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressCheckIcv - - Default = 0x0 - - Unused - - - Notes: - Unused */ - unsigned int mssIngressCheckIcv : 1; /* 1E.800E.6 R/W Default = 0x0 */ - /* Unused - */ - /*! \brief 1E.800E.5 R/W MSS Ingress Drop IGPRC Miss - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressDropIgprcMiss - - Default = 0x0 - - 1 = Drop IGPRC miss packets - - - Notes: - Decides whether Ingress Pre-Security Classification (IGPRC) LUT miss packets are to be dropped */ - unsigned int mssIngressDropIgprcMiss : 1; /* 1E.800E.5 R/W Default = 0x0 */ - /* 1 = Drop IGPRC miss packets - */ - /*! \brief 1E.800E.4 R/W MSS Ingress Drop Kay Packet - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressDropKayPacket - - Default = 0x0 - - 1 = Drop KaY packets - - - Notes: - Decides whether KaY packets have to be dropped */ - unsigned int mssIngressDropKayPacket : 1; /* 1E.800E.4 R/W Default = 0x0 */ - /* 1 = Drop KaY packets - */ - /*! \brief 1E.800E.3 R/W MSS Ingress Mask Short Length Error - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressMaskShortLengthError - - Default = 0x0 - - Unused - - - Notes: - Unused */ - unsigned int mssIngressMaskShortLengthError : 1; /* 1E.800E.3 R/W Default = 0x0 */ - /* Unused - */ - /*! \brief 1E.800E.2 R/W MSS Ingress Create SCI - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressCreateSci - - Default = 0x0 - - 0 = SCI from IGPRC LUT - - - Notes: - If the SCI is not in the packet and this bit is set to 0, the SCI will be taken from the IGPRC LUT. */ - unsigned int mssIngressCreateSci : 1; /* 1E.800E.2 R/W Default = 0x0 */ - /* 0 = SCI from IGPRC LUT - */ - /*! \brief 1E.800E.1 R/W MSS Ingress Operation Point To Point - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressOperationPointToPoint - - Default = 0x0 - - 1 = Enable the SCI for authorization default - - - Notes: - The default SCI for authorization is configured in See MSS Ingress SCI Default [F:0] See MSS Ingress SCI Default [1F:10] , See MSS Ingress SCI Default [2F:20] , and See MSS Ingress SCI Default [3F:30] . */ - unsigned int mssIngressOperationPointToPoint : 1; /* 1E.800E.1 R/W Default = 0x0 */ - /* 1 = Enable the SCI for authorization default - */ - /*! \brief 1E.800E.0 R/W MSS Ingress Soft Reset - AQ_MssIngressControlRegister_HHD.u0.bits_0.mssIngressSoftReset - - Default = 0x0 - - 1 = Soft reset - - - Notes: - S/W reset */ - unsigned int mssIngressSoftReset : 1; /* 1E.800E.0 R/W Default = 0x0 */ - /* 1 = Soft reset - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress Control Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA Control Register: 1E.8010 */ -/* MSS Ingress SA Control Register: 1E.8010 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA Control Register */ - union - { - struct - { - /*! \brief 1E.8010.F:0 R/W MSS Ingress SA Threshold LSW [F:0] - AQ_MssIngressSaControlRegister_HHD.u0.bits_0.mssIngressSaThresholdLSW - - Default = 0x0000 - - SA threshold bits 15:0 - - - Notes: - Ingress PN threshold to generate SA threshold interrupt. */ - unsigned int mssIngressSaThresholdLSW : 16; /* 1E.8010.F:0 R/W Default = 0x0000 */ - /* SA threshold bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA Control Register */ - union - { - struct - { - /*! \brief 1E.8011.F:0 R/W MSS Ingress SA Threshold MSW [1F:10] - AQ_MssIngressSaControlRegister_HHD.u1.bits_1.mssIngressSaThresholdMSW - - Default = 0x0000 - - SA threshold bits 31:16 - - - Notes: - Ingress PN threshold to generate SA threshold interrupt. */ - unsigned int mssIngressSaThresholdMSW : 16; /* 1E.8011.F:0 R/W Default = 0x0000 */ - /* SA threshold bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress Interrupt Status Register: 1E.802E */ -/* MSS Ingress Interrupt Status Register: 1E.802E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress Interrupt Status Register */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.802E.8 COW MSS Ingress IGPOC Miss Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressIgpocMissInterrupt - - Default = 0x0 - - 1 = Interrupt - - */ - unsigned int mssIngressIgpocMissInterrupt : 1; /* 1E.802E.8 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.7 COW MSS Ingress TCI E/C Error Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressTciE_cErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This error occurs when the TCI E bit is 1 and the TCI C bit is 0. The packet is not dropped, uncontrolled, or untagged. */ - unsigned int mssIngressTciE_cErrorInterrupt : 1; /* 1E.802E.7 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.6 COW MSS Ingress ECC Error Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressEccErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. */ - unsigned int mssIngressEccErrorInterrupt : 1; /* 1E.802E.6 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.5 COW MSS Ingress MIB Saturation Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressMibSaturationInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the MIB counters reaches all ones saturation. */ - unsigned int mssIngressMibSaturationInterrupt : 1; /* 1E.802E.5 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.4 COW MSS Ingress Replay Error Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressReplayErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. */ - unsigned int mssIngressReplayErrorInterrupt : 1; /* 1E.802E.4 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.3 COW MSS Ingress ICV Error Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressIcvErrorInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. */ - unsigned int mssIngressIcvErrorInterrupt : 1; /* 1E.802E.3 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.2 COW MSS Ingress SA Threshold Expired Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressSaThresholdExpiredInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches the See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . */ - unsigned int mssIngressSaThresholdExpiredInterrupt : 1; /* 1E.802E.2 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.1 COW MSS Ingress SA Expired Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssIngressSaExpiredInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when the SA PN reaches all ones saturation. */ - unsigned int mssIngressSaExpiredInterrupt : 1; /* 1E.802E.1 COW Default = 0x0 */ - /* 1 = Interrupt - */ - /*! \brief 1E.802E.0 COW MSS Master Ingress Interrupt - AQ_MssIngressInterruptStatusRegister_HHD.u0.bits_0.mssMasterIngressInterrupt - - Default = 0x0 - - 1 = Interrupt - - - Notes: - Write to 1 to clear. This bit is set when any one of the above interrupt and the corresponding interrupt enable are both set. The interrupt enable for this bit must also be set for this bit to be set. */ - unsigned int mssMasterIngressInterrupt : 1; /* 1E.802E.0 COW Default = 0x0 */ - /* 1 = Interrupt - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress Interrupt Status Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressInterruptStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress Interrupt Mask Register: 1E.8030 */ -/* MSS Ingress Interrupt Mask Register: 1E.8030 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress Interrupt Mask Register */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.8030.8 R/W MSS Ingress IGPOC Miss Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressIgpocMissInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressIgpocMissInterruptEnable : 1; /* 1E.8030.8 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.7 R/W MSS Ingress TCI E/C Error Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressTciE_cErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressTciE_cErrorInterruptEnable : 1; /* 1E.8030.7 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.6 R/W MSS Ingress ECC Error Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressEccErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressEccErrorInterruptEnable : 1; /* 1E.8030.6 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.5 R/W MSS Ingress MIB Saturation Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressMibSaturationInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressMibSaturationInterruptEnable : 1; /* 1E.8030.5 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.4 R/W MSS Ingress Replay Error Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressReplayErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressReplayErrorInterruptEnable : 1; /* 1E.8030.4 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.3 R/W MSS Ingress ICV Error Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressIcvErrorInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressIcvErrorInterruptEnable : 1; /* 1E.8030.3 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.2 R/W MSS Ingress SA Threshold Expired Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressSaThresholdExpiredInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressSaThresholdExpiredInterruptEnable : 1; /* 1E.8030.2 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.1 R/W MSS Ingress SA Expired Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressSaExpiredInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressSaExpiredInterruptEnable : 1; /* 1E.8030.1 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - /*! \brief 1E.8030.0 R/W MSS Ingress Master Interrupt Enable - AQ_MssIngressInterruptMaskRegister_HHD.u0.bits_0.mssIngressMasterInterruptEnable - - Default = 0x0 - - 1 = Interrupt enabled - - */ - unsigned int mssIngressMasterInterruptEnable : 1; /* 1E.8030.0 R/W Default = 0x0 */ - /* 1 = Interrupt enabled - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress Interrupt Mask Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressInterruptMaskRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA ICV Error Status Register: 1E.8032 */ -/* MSS Ingress SA ICV Error Status Register: 1E.8032 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA ICV Error Status Register */ - union - { - struct - { - /*! \brief 1E.8032.F:0 COW MSS Ingress SA ICV Error LSW [F:0] - AQ_MssIngressSaIcvErrorStatusRegister_HHD.u0.bits_0.mssIngressSaIcvErrorLSW - - Default = 0x0000 - - SA ICV error bits 15:0 - - - Notes: - When set, these bits identify the SA that has an ICV error. Write these bits to 1 to clear. */ - unsigned int mssIngressSaIcvErrorLSW : 16; /* 1E.8032.F:0 COW Default = 0x0000 */ - /* SA ICV error bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA ICV Error Status Register */ - union - { - struct - { - /*! \brief 1E.8033.F:0 COW MSS Ingress SA ICV Error MSW [1F:10] - AQ_MssIngressSaIcvErrorStatusRegister_HHD.u1.bits_1.mssIngressSaIcvErrorMSW - - Default = 0x0000 - - SA ICV error bits 31:16 - - - Notes: - When set, these bits identify the SA that has an ICV error. Write these bits to 1 to clear. */ - unsigned int mssIngressSaIcvErrorMSW : 16; /* 1E.8033.F:0 COW Default = 0x0000 */ - /* SA ICV error bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaIcvErrorStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA Replay Error Status Register: 1E.8034 */ -/* MSS Ingress SA Replay Error Status Register: 1E.8034 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA Replay Error Status Register */ - union - { - struct - { - /*! \brief 1E.8034.F:0 COW MSS Ingress SA Replay Error LSW [F:0] - AQ_MssIngressSaReplayErrorStatusRegister_HHD.u0.bits_0.mssIngressSaReplayErrorLSW - - Default = 0x0000 - - SA replay error bits 15:0 - - - Notes: - When set, these bits identify the SA that has a replay error. Write these bits to 1 to clear. */ - unsigned int mssIngressSaReplayErrorLSW : 16; /* 1E.8034.F:0 COW Default = 0x0000 */ - /* SA replay error bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA Replay Error Status Register */ - union - { - struct - { - /*! \brief 1E.8035.F:0 COW MSS Ingress SA Replay Error MSW [1F:10] - AQ_MssIngressSaReplayErrorStatusRegister_HHD.u1.bits_1.mssIngressSaReplayErrorMSW - - Default = 0x0000 - - SA replay error bits 31:16 - - - Notes: - When set, these bits identify the SA that has a replay error. Write these bits to 1 to clear. */ - unsigned int mssIngressSaReplayErrorMSW : 16; /* 1E.8035.F:0 COW Default = 0x0000 */ - /* SA replay error bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaReplayErrorStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA Expired Status Register: 1E.8036 */ -/* MSS Ingress SA Expired Status Register: 1E.8036 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA Expired Status Register */ - union - { - struct - { - /*! \brief 1E.8036.F:0 ROS MSS Ingress SA Expired LSW [F:0] - AQ_MssIngressSaExpiredStatusRegister_HHD.u0.bits_0.mssIngressSaExpiredLSW - - Default = 0x0000 - - SA expired bits 15:0 - - - Notes: - When set, these bits identify the SA that has expired when the SA PN reaches all-ones saturation. Write these bits to 1 to clear. */ - unsigned int mssIngressSaExpiredLSW : 16; /* 1E.8036.F:0 ROS Default = 0x0000 */ - /* SA expired bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA Expired Status Register */ - union - { - struct - { - /*! \brief 1E.8037.F:0 ROS MSS Ingress SA Expired MSW [1F:10] - AQ_MssIngressSaExpiredStatusRegister_HHD.u1.bits_1.mssIngressSaExpiredMSW - - Default = 0x0000 - - SA expired bits 31:16 - - - Notes: - When set, these bits identify the SA that has expired when the SA PN reaches all-ones saturation. Write these bits to 1 to clear. */ - unsigned int mssIngressSaExpiredMSW : 16; /* 1E.8037.F:0 ROS Default = 0x0000 */ - /* SA expired bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaExpiredStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress SA Threshold Expired Status Register: 1E.8038 */ -/* MSS Ingress SA Threshold Expired Status Register: 1E.8038 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress SA Threshold Expired Status Register */ - union - { - struct - { - /*! \brief 1E.8038.F:0 ROS MSS Ingress SA Threshold Expired LSW [F:0] - AQ_MssIngressSaThresholdExpiredStatusRegister_HHD.u0.bits_0.mssIngressSaThresholdExpiredLSW - - Default = 0x0000 - - SA threshold expired bits 15:0 - - - Notes: - When set, these bits identify the SA that has expired when the SA PN has reached the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . Write these bits to 1 to clear. */ - unsigned int mssIngressSaThresholdExpiredLSW : 16; /* 1E.8038.F:0 ROS Default = 0x0000 */ - /* SA threshold expired bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress SA Threshold Expired Status Register */ - union - { - struct - { - /*! \brief 1E.8039.F:0 ROS MSS Ingress SA Threshold Expired MSW [1F:10] - AQ_MssIngressSaThresholdExpiredStatusRegister_HHD.u1.bits_1.mssIngressSaThresholdExpiredMSW - - Default = 0x0000 - - SA threshold expired bits 31:16 - - - Notes: - When set, these bits identify the SA that has expired when the SA PN has reached the configured threshold See SEC Egress PN Threshold [F:0] and See SEC Egress PN Threshold [1F:10] . Write these bits to 1 to clear. */ - unsigned int mssIngressSaThresholdExpiredMSW : 16; /* 1E.8039.F:0 ROS Default = 0x0000 */ - /* SA threshold expired bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressSaThresholdExpiredStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress ECC Interrupt Status Register: 1E.803A */ -/* MSS Ingress ECC Interrupt Status Register: 1E.803A */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress ECC Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.803A.F:0 R/W MSS Ingress SA ECC Error Interrupt LSW [F:0] - AQ_MssIngressEccInterruptStatusRegister_HHD.u0.bits_0.mssIngressSaEccErrorInterruptLSW - - Default = 0x0000 - - SA ECC error interrupt bits 15:0 - - - Notes: - When set to 1, indicates that an ECC error occured for the SA. */ - unsigned int mssIngressSaEccErrorInterruptLSW : 16; /* 1E.803A.F:0 R/W Default = 0x0000 */ - /* SA ECC error interrupt bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress ECC Interrupt Status Register */ - union - { - struct - { - /*! \brief 1E.803B.F:0 R/W MSS Ingress SA ECC Error Interrupt MSW [1F:10] - AQ_MssIngressEccInterruptStatusRegister_HHD.u1.bits_1.mssIngressSaEccErrorInterruptMSW - - Default = 0x0000 - - SA ECC error interrupt bits 31:16 - - - Notes: - When set to 1, indicates that an ECC error occured for the SA. */ - unsigned int mssIngressSaEccErrorInterruptMSW : 16; /* 1E.803B.F:0 R/W Default = 0x0000 */ - /* SA ECC error interrupt bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MssIngressEccInterruptStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress LUT Address Control Register: 1E.8080 */ -/* MSS Ingress LUT Address Control Register: 1E.8080 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress LUT Address Control Register */ - union - { - struct - { - /*! \brief 1E.8080.F:C R/W MSS Ingress LUT Select [3:0] - AQ_MssIngressLutAddressControlRegister_HHD.u0.bits_0.mssIngressLutSelect - - Default = 0x0 - - LUT select - - - Notes: - 0x0 : Ingress Pre-Security MAC Control FIlter (IGPRCTLF) LUT - 0x1 : Ingress Pre-Security Classification LUT (IGPRC) - 0x2 : Ingress Packet Format (IGPFMT) SAKey LUT - 0x3 : Ingress Packet Format (IGPFMT) SC/SA LUT - 0x4 : Ingress Post-Security Classification LUT (IGPOC) - 0x5 : Ingress Post-Security MAC Control Filter (IGPOCTLF) LUT - 0x6 : Ingress MIB (IGMIB) */ - unsigned int mssIngressLutSelect : 4; /* 1E.8080.F:C R/W Default = 0x0 */ - /* LUT select - */ - unsigned int reserved0 : 3; - /*! \brief 1E.8080.8:0 R/W MSS Ingress LUT Address [8:0] - AQ_MssIngressLutAddressControlRegister_HHD.u0.bits_0.mssIngressLutAddress - - Default = 0x000 - - LUT address - - */ - unsigned int mssIngressLutAddress : 9; /* 1E.8080.8:0 R/W Default = 0x000 */ - /* LUT address - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_MssIngressLutAddressControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress LUT Control Register: 1E.8081 */ -/* MSS Ingress LUT Control Register: 1E.8081 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress LUT Control Register */ - union - { - struct - { - /*! \brief 1E.8081.F R/W MSS Ingress LUT Write - AQ_MssIngressLutControlRegister_HHD.u0.bits_0.mssIngressLutWrite - - Default = 0x0 - - 1 = LUT write - - - Notes: - Setting this bit to 1, will write the LUT. This bit will automatically clear to 0. */ - unsigned int mssIngressLutWrite : 1; /* 1E.8081.F R/W Default = 0x0 */ - /* 1 = LUT write - */ - /*! \brief 1E.8081.E R/W MSS Ingress LUT Read - AQ_MssIngressLutControlRegister_HHD.u0.bits_0.mssIngressLutRead - - Default = 0x0 - - 1 = LUT read - - - Notes: - Setting this bit to 1, will read the LUT. This bit will automatically clear to 0. */ - unsigned int mssIngressLutRead : 1; /* 1E.8081.E R/W Default = 0x0 */ - /* 1 = LUT read - */ - unsigned int reserved0 : 14; - } bits_0; - uint16_t word_0; - } u0; -} AQ_MssIngressLutControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSS Ingress LUT Data Control Register: 1E.80A0 */ -/* MSS Ingress LUT Data Control Register: 1E.80A0 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A0.F:0 R/W MSS Ingress LUT Data 0 [F:0] - AQ_MssIngressLutDataControlRegister_HHD.u0.bits_0.mssIngressLutData_0 - - Default = 0x0000 - - LUT data bits 15:0 - - */ - unsigned int mssIngressLutData_0 : 16; /* 1E.80A0.F:0 R/W Default = 0x0000 */ - /* LUT data bits 15:0 - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A1.F:0 R/W MSS Ingress LUT Data 1 [1F:10] - AQ_MssIngressLutDataControlRegister_HHD.u1.bits_1.mssIngressLutData_1 - - Default = 0x0000 - - LUT data bits 31:16 - - */ - unsigned int mssIngressLutData_1 : 16; /* 1E.80A1.F:0 R/W Default = 0x0000 */ - /* LUT data bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A2.F:0 R/W MSS Ingress LUT Data 2 [2F:20] - AQ_MssIngressLutDataControlRegister_HHD.u2.bits_2.mssIngressLutData_2 - - Default = 0x0000 - - LUT data bits 47:32 - - */ - unsigned int mssIngressLutData_2 : 16; /* 1E.80A2.F:0 R/W Default = 0x0000 */ - /* LUT data bits 47:32 - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A3.F:0 R/W MSS Ingress LUT Data 3 [3F:30] - AQ_MssIngressLutDataControlRegister_HHD.u3.bits_3.mssIngressLutData_3 - - Default = 0x0000 - - LUT data bits 63:48 - - */ - unsigned int mssIngressLutData_3 : 16; /* 1E.80A3.F:0 R/W Default = 0x0000 */ - /* LUT data bits 63:48 - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A4.F:0 R/W MSS Ingress LUT Data 4 [4F:40] - AQ_MssIngressLutDataControlRegister_HHD.u4.bits_4.mssIngressLutData_4 - - Default = 0x0000 - - LUT data bits 79:64 - - */ - unsigned int mssIngressLutData_4 : 16; /* 1E.80A4.F:0 R/W Default = 0x0000 */ - /* LUT data bits 79:64 - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A5.F:0 R/W MSS Ingress LUT Data 5 [5F:50] - AQ_MssIngressLutDataControlRegister_HHD.u5.bits_5.mssIngressLutData_5 - - Default = 0x0000 - - LUT data bits 95:80 - - */ - unsigned int mssIngressLutData_5 : 16; /* 1E.80A5.F:0 R/W Default = 0x0000 */ - /* LUT data bits 95:80 - */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A6.F:0 R/W MSS Ingress LUT Data 6 [6F:60] - AQ_MssIngressLutDataControlRegister_HHD.u6.bits_6.mssIngressLutData_6 - - Default = 0x0000 - - LUT data bits 111:96 - - */ - unsigned int mssIngressLutData_6 : 16; /* 1E.80A6.F:0 R/W Default = 0x0000 */ - /* LUT data bits 111:96 - */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A7.F:0 R/W MSS Ingress LUT Data 7 [7F:70] - AQ_MssIngressLutDataControlRegister_HHD.u7.bits_7.mssIngressLutData_7 - - Default = 0x0000 - - LUT data bits 127:112 - - */ - unsigned int mssIngressLutData_7 : 16; /* 1E.80A7.F:0 R/W Default = 0x0000 */ - /* LUT data bits 127:112 - */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A8.F:0 R/W MSS Ingress LUT Data 8 [8F:80] - AQ_MssIngressLutDataControlRegister_HHD.u8.bits_8.mssIngressLutData_8 - - Default = 0x0000 - - LUT data bits 143:128 - - */ - unsigned int mssIngressLutData_8 : 16; /* 1E.80A8.F:0 R/W Default = 0x0000 */ - /* LUT data bits 143:128 - */ - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80A9.F:0 R/W MSS Ingress LUT Data 9 [9F:90] - AQ_MssIngressLutDataControlRegister_HHD.u9.bits_9.mssIngressLutData_9 - - Default = 0x0000 - - LUT data bits 159:144 - - */ - unsigned int mssIngressLutData_9 : 16; /* 1E.80A9.F:0 R/W Default = 0x0000 */ - /* LUT data bits 159:144 - */ - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Union for bit and word level access of word 10 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AA.F:0 R/W MSS Ingress LUT Data 10 [AF:A0] - AQ_MssIngressLutDataControlRegister_HHD.u10.bits_10.mssIngressLutData_10 - - Default = 0x0000 - - LUT data bits 175:160 - - */ - unsigned int mssIngressLutData_10 : 16; /* 1E.80AA.F:0 R/W Default = 0x0000 */ - /* LUT data bits 175:160 - */ - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Union for bit and word level access of word 11 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AB.F:0 R/W MSS Ingress LUT Data 11 [BF:B0] - AQ_MssIngressLutDataControlRegister_HHD.u11.bits_11.mssIngressLutData_11 - - Default = 0x0000 - - LUT data bits 191:176 - - */ - unsigned int mssIngressLutData_11 : 16; /* 1E.80AB.F:0 R/W Default = 0x0000 */ - /* LUT data bits 191:176 - */ - } bits_11; - uint16_t word_11; - } u11; - /*! \brief Union for bit and word level access of word 12 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AC.F:0 R/W MSS Ingress LUT Data 12 [CF:C0] - AQ_MssIngressLutDataControlRegister_HHD.u12.bits_12.mssIngressLutData_12 - - Default = 0x0000 - - LUT data bits 207:192 - - */ - unsigned int mssIngressLutData_12 : 16; /* 1E.80AC.F:0 R/W Default = 0x0000 */ - /* LUT data bits 207:192 - */ - } bits_12; - uint16_t word_12; - } u12; - /*! \brief Union for bit and word level access of word 13 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AD.F:0 R/W MSS Ingress LUT Data 13 [DF:D0] - AQ_MssIngressLutDataControlRegister_HHD.u13.bits_13.mssIngressLutData_13 - - Default = 0x0000 - - LUT data bits 223:208 - - */ - unsigned int mssIngressLutData_13 : 16; /* 1E.80AD.F:0 R/W Default = 0x0000 */ - /* LUT data bits 223:208 - */ - } bits_13; - uint16_t word_13; - } u13; - /*! \brief Union for bit and word level access of word 14 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AE.F:0 R/W MSS Ingress LUT Data 14 [EF:E0] - AQ_MssIngressLutDataControlRegister_HHD.u14.bits_14.mssIngressLutData_14 - - Default = 0x0000 - - LUT data bits 239:224 - - */ - unsigned int mssIngressLutData_14 : 16; /* 1E.80AE.F:0 R/W Default = 0x0000 */ - /* LUT data bits 239:224 - */ - } bits_14; - uint16_t word_14; - } u14; - /*! \brief Union for bit and word level access of word 15 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80AF.F:0 R/W MSS Ingress LUT Data 15 [FF:F0] - AQ_MssIngressLutDataControlRegister_HHD.u15.bits_15.mssIngressLutData_15 - - Default = 0x0000 - - LUT data bits 255:240 - - */ - unsigned int mssIngressLutData_15 : 16; /* 1E.80AF.F:0 R/W Default = 0x0000 */ - /* LUT data bits 255:240 - */ - } bits_15; - uint16_t word_15; - } u15; - /*! \brief Union for bit and word level access of word 16 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B0.F:0 R/W MSS Ingress LUT Data 16 [10F:100] - AQ_MssIngressLutDataControlRegister_HHD.u16.bits_16.mssIngressLutData_16 - - Default = 0x0000 - - LUT data bits 271:256 - - */ - unsigned int mssIngressLutData_16 : 16; /* 1E.80B0.F:0 R/W Default = 0x0000 */ - /* LUT data bits 271:256 - */ - } bits_16; - uint16_t word_16; - } u16; - /*! \brief Union for bit and word level access of word 17 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B1.F:0 R/W MSS Ingress LUT Data 17 [11F:110] - AQ_MssIngressLutDataControlRegister_HHD.u17.bits_17.mssIngressLutData_17 - - Default = 0x0000 - - LUT data bits 287:272 - - */ - unsigned int mssIngressLutData_17 : 16; /* 1E.80B1.F:0 R/W Default = 0x0000 */ - /* LUT data bits 287:272 - */ - } bits_17; - uint16_t word_17; - } u17; - /*! \brief Union for bit and word level access of word 18 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B2.F:0 R/W MSS Ingress LUT Data 18 [12F:120] - AQ_MssIngressLutDataControlRegister_HHD.u18.bits_18.mssIngressLutData_18 - - Default = 0x0000 - - LUT data bits 303:288 - - */ - unsigned int mssIngressLutData_18 : 16; /* 1E.80B2.F:0 R/W Default = 0x0000 */ - /* LUT data bits 303:288 - */ - } bits_18; - uint16_t word_18; - } u18; - /*! \brief Union for bit and word level access of word 19 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B3.F:0 R/W MSS Ingress LUT Data 19 [13F:130] - AQ_MssIngressLutDataControlRegister_HHD.u19.bits_19.mssIngressLutData_19 - - Default = 0x0000 - - LUT data bits 319:304 - - */ - unsigned int mssIngressLutData_19 : 16; /* 1E.80B3.F:0 R/W Default = 0x0000 */ - /* LUT data bits 319:304 - */ - } bits_19; - uint16_t word_19; - } u19; - /*! \brief Union for bit and word level access of word 20 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B4.F:0 R/W MSS Ingress LUT Data 20 [14F:140] - AQ_MssIngressLutDataControlRegister_HHD.u20.bits_20.mssIngressLutData_20 - - Default = 0x0000 - - LUT data bits 335:320 - - */ - unsigned int mssIngressLutData_20 : 16; /* 1E.80B4.F:0 R/W Default = 0x0000 */ - /* LUT data bits 335:320 - */ - } bits_20; - uint16_t word_20; - } u20; - /*! \brief Union for bit and word level access of word 21 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B5.F:0 R/W MSS Ingress LUT Data 21 [15F:150] - AQ_MssIngressLutDataControlRegister_HHD.u21.bits_21.mssIngressLutData_21 - - Default = 0x0000 - - LUT data bits 351:336 - - */ - unsigned int mssIngressLutData_21 : 16; /* 1E.80B5.F:0 R/W Default = 0x0000 */ - /* LUT data bits 351:336 - */ - } bits_21; - uint16_t word_21; - } u21; - /*! \brief Union for bit and word level access of word 22 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B6.F:0 R/W MSS Ingress LUT Data 22 [16F:160] - AQ_MssIngressLutDataControlRegister_HHD.u22.bits_22.mssIngressLutData_22 - - Default = 0x0000 - - LUT data bits 367:352 - - */ - unsigned int mssIngressLutData_22 : 16; /* 1E.80B6.F:0 R/W Default = 0x0000 */ - /* LUT data bits 367:352 - */ - } bits_22; - uint16_t word_22; - } u22; - /*! \brief Union for bit and word level access of word 23 of MSS Ingress LUT Data Control Register */ - union - { - struct - { - /*! \brief 1E.80B7.F:0 R/W MSS Ingress LUT Data 23 [17F:170] - AQ_MssIngressLutDataControlRegister_HHD.u23.bits_23.mssIngressLutData_23 - - Default = 0x0000 - - LUT data bits 383:368 - - */ - unsigned int mssIngressLutData_23 : 16; /* 1E.80B7.F:0 R/W Default = 0x0000 */ - /* LUT data bits 383:368 - */ - } bits_23; - uint16_t word_23; - } u23; -} AQ_MssIngressLutDataControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line General Control Register: 1E.9004 */ -/* MSM Line General Control Register: 1E.9004 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line General Control Register */ - union - { - struct - { - /*! \brief 1E.9004.F R/W MSM Line PHY Tx Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePhyTxEnable - - Default = 0x0 - - 1 = Enable PHY Tx - - - Notes: - Directly controls the phy_tx_ena pin. */ - unsigned int msmLinePhyTxEnable : 1; /* 1E.9004.F R/W Default = 0x0 */ - /* 1 = Enable PHY Tx - */ - /*! \brief 1E.9004.E R/W MSM Line Rx Error Discard - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineRxErrorDiscard - - Default = 0x0 - - 1 = Enable discard of received errored frames - - - Notes: - Rx errored frame discard enable. When set to 1, any frame received with an error is discarded and not forwarded to the client interface. When set to 0, errored frames are forwarded to the client interface with ff_rx_err asserted. - Note : It is recommended to set this bit to 1 only when store and forward operation is enabled (RX_SECTION_FULL TBD). */ - unsigned int msmLineRxErrorDiscard : 1; /* 1E.9004.E R/W Default = 0x0 */ - /* 1 = Enable discard of received errored frames - */ - /*! \brief 1E.9004.D R/W MSM Line Control Frame Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineControlFrameEnable - - Default = 0x0 - - 1 = Control frame enabled - - - Notes: - MAC control frame enable. When set to 1, the MAC control frames with any Opcode other than 0x0001 are accepted and forwarded to the client interface. When set to 0, MAC control frames with any opcode other than 0x0001 are silently discarded. */ - unsigned int msmLineControlFrameEnable : 1; /* 1E.9004.D R/W Default = 0x0 */ - /* 1 = Control frame enabled - */ - /*! \brief 1E.9004.C R/WSC MSM Line Soft Reset - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineSoftReset - - Default = 0x0 - - 1 = Soft reset - - - Notes: - Software reset. Self clearing bit. When set to 1, resets all statistic counters as well as the Tx and Rx FIFOs. It should be issued after all traffic has been stopped as a result of clearing the Rx/Tx enable bits ( See MAC Rx Enable set to 0 and See MAC Tx Enable set to 0). - Note : Can lead to an Rx interface (ff_rx_xxx) violations to the application if the reset is issued in the middle of a receive frame transfer. Then the end of packet (assertion of ff_rx_eop) is lost and the application should be prepeared to handle this exception. */ - unsigned int msmLineSoftReset : 1; /* 1E.9004.C R/WSC Default = 0x0 */ - /* 1 = Soft reset - */ - /*! \brief 1E.9004.B R/W MSM Line Tx Pad Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineTxPadEnable - - Default = 0x1 - - 1 = Enable Tx padding - - - Notes: - When set to 1, enable padding of frames in the Tx direction. When set to 0, the MAC will not extend frames from the application to a minimum of 64 bytes, allowing to transmit short frames (violating the Ethernet mimimum size requirements). Must be set to 1 for normal operation. */ - unsigned int msmLineTxPadEnable : 1; /* 1E.9004.B R/W Default = 0x1 */ - /* 1 = Enable Tx padding - */ - /*! \brief 1E.9004.A R/W MSM Line Tx CRC Append - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineTxCrcAppend - - Default = 0x0 - - 1 = Append Tx CRC - - - Notes: - Permanently enable CRC append on transmit. If set to 1, the Tx will append a CRC to all transmitted frames. If set to 0, CRC append can be controlled on a per frame basis using the pin ff_tx_crc. - This configuration bit is OR'ed with the external ff_tx_crc pin to instruct the Tx to append a CRC to transmitted frames. The ff_tx_crc pin is tied to 0. */ - unsigned int msmLineTxCrcAppend : 1; /* 1E.9004.A R/W Default = 0x0 */ - /* 1 = Append Tx CRC - */ - /*! \brief 1E.9004.9 R/W MSM Line Tx Address Insert Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineTxAddressInsertEnable - - Default = 0x0 - - 1 = Insert Tx MAC source address - - - Notes: - Set the source MAC address on transmit. If set to 1, the MAC overwrites the source MAC address with the MAC programmed address in all transmitted frames. When set to 0, the source MAC address is transmitted unmodified from the MAC Tx client application. */ - unsigned int msmLineTxAddressInsertEnable : 1; /* 1E.9004.9 R/W Default = 0x0 */ - /* 1 = Insert Tx MAC source address - */ - /*! \brief 1E.9004.8 R/W MSM Line Pause Ignore - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePauseIgnore - - Default = 0x0 - - 1 = Ignore pause frames - - - Notes: - Ignore pause frame quanta. If set to 1, received pause frames are ignored by the MAC. When set to 0, the Tx is stopped for the amount of time specified in the pause quanta received within the pause frame. */ - unsigned int msmLinePauseIgnore : 1; /* 1E.9004.8 R/W Default = 0x0 */ - /* 1 = Ignore pause frames - */ - /*! \brief 1E.9004.7 R/W MSM Line Pause Forward - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePauseForward - - Default = 0x0 - - 1 = Enable Pause forwarding - - - Notes: - Terminate or forward pause frames. If set to 1, pause frames are forwarded to the user application. In normal mode, when set to 0, pause frames are terminated and discarded within the MAC. */ - unsigned int msmLinePauseForward : 1; /* 1E.9004.7 R/W Default = 0x0 */ - /* 1 = Enable Pause forwarding - */ - /*! \brief 1E.9004.6 R/W MSM Line CRC Forward - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineCrcForward - - Default = 0x0 - - 1 = Enable CRC forwarding - - - Notes: - When set to 1, the CRC field of the received frames is forwarded with the frame to the user application. If disabled, the CRC field is stripped from the frame. - Note : If padding is enabled ( See MAC PAD Enable set to 1), this bit is ignored. */ - unsigned int msmLineCrcForward : 1; /* 1E.9004.6 R/W Default = 0x0 */ - /* 1 = Enable CRC forwarding - */ - /*! \brief 1E.9004.5 R/W MSM Line PAD Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePadEnable - - Default = 0x0 - - 1 = Enable frame padding removal on Rx - - - Notes: - When set to 1, enable frame padding removal on the Rx path. If enabled, padding is removed before the frame is transferred to the MAC client application. If disabled, no padding is removed on the Rx by the MAC. - Note : On Tx, the MAC always adds padding as required. */ - unsigned int msmLinePadEnable : 1; /* 1E.9004.5 R/W Default = 0x0 */ - /* 1 = Enable frame padding removal on Rx - */ - /*! \brief 1E.9004.4 R/W MSM Line Promiscuous Mode - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLinePromiscuousMode - - Default = 0x0 - - 1 = Promiscuous mode - - - Notes: - When set to 1, all frames are received without any MAC address filtering. */ - unsigned int msmLinePromiscuousMode : 1; /* 1E.9004.4 R/W Default = 0x0 */ - /* 1 = Promiscuous mode - */ - /*! \brief 1E.9004.3 R/W MSM Line WAN Mode - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineWanMode - - Default = 0x0 - - 1 = WAN mode - 0 = LAN mode - - - Notes: - WAN mode enable. Sets WAN mode when set to 1 and LAN mode when set to 0. Note: When changing the mode, verifiy correct setting of the Tx IPG. */ - unsigned int msmLineWanMode : 1; /* 1E.9004.3 R/W Default = 0x0 */ - /* 1 = WAN mode - 0 = LAN mode - */ - unsigned int reserved0 : 1; - /*! \brief 1E.9004.1 R/W MSM Line Rx Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineRxEnable - - Default = 0x0 - - 1 = Rx enable - - Notes: - MAC Tx path enable. Should be set to 1 to enable the MAC Tx path. Should be set to 0 to disable the MAC Tx path. */ - unsigned int msmLineRxEnable : 1; /* 1E.9004.1 R/W Default = 0x0 */ - /* 1 = Rx enable */ - /*! \brief 1E.9004.0 R/W MSM Line Tx Enable - AQ_MsmLineGeneralControlRegister_HHD.u0.bits_0.msmLineTxEnable - - Default = 0x0 - - 1 = Tx enable - - Notes: - MAC Rx path enable. Should be set to 1 to enable the MAC Rx path. Should be set to 0 to disable the MAC Rx path. */ - unsigned int msmLineTxEnable : 1; /* 1E.9004.0 R/W Default = 0x0 */ - /* 1 = Tx enable */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line General Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.9005.7 R/W MSM Line Tx Low Power IDLE Enable - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineTxLowPowerIdleEnable - - Default = 0x0 - - 1 = Transmit LPI enable - - - Notes: - Transmit low power IDLE enable. When set to 1, the MAC completes the transmission of the current frame and generates low power IDLE sequences (LPI) to the XGMII/SGMII. When set to 0, the MAC operates in normal mode. This bit is OR'ed with the reg_lowp_ena pin. */ - unsigned int msmLineTxLowPowerIdleEnable : 1; /* 1E.9005.7 R/W Default = 0x0 */ - /* 1 = Transmit LPI enable - */ - unsigned int reserved1 : 1; - /*! \brief 1E.9005.5 R/W MSM Line SFD Check Disable - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineSfdCheckDisable - - Default = 0x0 - - 1 = Disable SFD check - - - Notes: - Disable check of SFD (0xD5) character at frame start. When set to 1, the frame is accepted even if the SFD byte following the preamble is not 0xD5. When set to 0, a frame is accepted only if the SFD byte is found with the value 0xD5. */ - unsigned int msmLineSfdCheckDisable : 1; /* 1E.9005.5 R/W Default = 0x0 */ - /* 1 = Disable SFD check - */ - unsigned int reserved2 : 1; - /*! \brief 1E.9005.3 R/W MSM Line Priority Flow Control Enable - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLinePriorityFlowControlEnable - - Default = 0x0 - - 1 = Enable priority flow control - 0 = Enable link flow control - - - Notes: - Enable priority flow control (PFC) mode of operation. When set to 0, the MAC uses standard link pause frames. When set to 1, the MAC will transmit and accept PFC frames. */ - unsigned int msmLinePriorityFlowControlEnable : 1; /* 1E.9005.3 R/W Default = 0x0 */ - /* 1 = Enable priority flow control - 0 = Enable link flow control - */ - /*! \brief 1E.9005.2 R/W MSM Line IDLE Column Count Extend - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineIdleColumnCountExtend - - Default = 0x0 - - 1 = Extend IDLE column count - - Notes: - When set to 1, extends the RS layer IDLE column counter by 2x. The IEEE 802.3ae defines the fault condition to be cleared after 128 columns of IDLE have been received. If the MAC operates together with a WAN mode PCS (WIS) it may may happen (depending on PCS) that this period is too short to bridge the IDLE stuffing occurring in this mode, leading to a toggling fault indication. In this case, extending the counter helps to aoivd toggling fault indications. */ - unsigned int msmLineIdleColumnCountExtend : 1; /* 1E.9005.2 R/W Default = 0x0 */ - /* 1 = Extend IDLE column count */ - /*! \brief 1E.9005.1 R/W MSM Line Length Check Disable - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineLengthCheckDisable - - Default = 0x0 - - 1 = Disable length check - - Notes: - Payload length check disable. When set to 0, the MAC checks the frames payload length with the frame length/type field. When set to 1, the payload length check is disabled. */ - unsigned int msmLineLengthCheckDisable : 1; /* 1E.9005.1 R/W Default = 0x0 */ - /* 1 = Disable length check */ - /*! \brief 1E.9005.0 R/W MSM Line Force Send IDLE - AQ_MsmLineGeneralControlRegister_HHD.u1.bits_1.msmLineForceSendIdle - - Default = 0x0 - - 1 = Force send idle - - Notes: - When set to 1, suppress any frame transmissions and forces IDLE n the Tx interface instead of frames. This control affects the MAC reconciliation layer (RS) which acts after all MAC datapath has processed the frame. - Note : Does not have an effect on fault handling (i.e. reception of local fault will still cause transmit of remote fault). - Must be 0 for normal operation. */ - unsigned int msmLineForceSendIdle : 1; /* 1E.9005.0 R/W Default = 0x0 */ - /* 1 = Force send idle */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineGeneralControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line FIFO Control Register: 1E.900E */ -/* MSM Line FIFO Control Register: 1E.900E */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.900E.7:0 R/W MSM Line Rx FIFO Full Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u0.bits_0.msmLineRxFifoFullThreshold - - Default = 0x08 - - Rx FIFO full threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmLineRxFifoFullThreshold : 8; /* 1E.900E.7:0 R/W Default = 0x08 */ - /* Rx FIFO full threshold */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.900F.7:0 R/W MSM Line Rx FIFO Empty Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u1.bits_1.msmLineRxFifoEmptyThreshold - - Default = 0x00 - - Rx FIFO empty threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmLineRxFifoEmptyThreshold : 8; /* 1E.900F.7:0 R/W Default = 0x00 */ - /* Rx FIFO empty threshold */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSM Line FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 10; - /*! \brief 1E.9010.5:0 R/W MSM Line Tx FIFO Full Threshold [5:0] - AQ_MsmLineFifoControlRegister_HHD.u2.bits_2.msmLineTxFifoFullThreshold - - Default = 0x08 - - Tx FIFO full threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmLineTxFifoFullThreshold : 6; /* 1E.9010.5:0 R/W Default = 0x08 */ - /* Tx FIFO full threshold */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSM Line FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 10; - /*! \brief 1E.9011.5:0 R/W MSM Line Tx FIFO Empty Threshold [5:0] - AQ_MsmLineFifoControlRegister_HHD.u3.bits_3.msmLineTxFifoEmptyThreshold - - Default = 0x00 - - Tx FIFO empty threshold - - Notes: - All threshold values are in steps of FIFO words. */ - unsigned int msmLineTxFifoEmptyThreshold : 6; /* 1E.9011.5:0 R/W Default = 0x00 */ - /* Tx FIFO empty threshold */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of MSM Line FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.9012.7:0 ROS MSM Line Rx FIFO Almost Full Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u4.bits_4.msmLineRxFifoAlmostFullThreshold - - Default = 0x00 - - Rx FIFO almost full threshold - - Notes: - Unused. */ - unsigned int msmLineRxFifoAlmostFullThreshold : 8; /* 1E.9012.7:0 ROS Default = 0x00 */ - /* Rx FIFO almost full threshold */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of MSM Line FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.9013.7:0 ROS MSM Line Rx FIFO Almost Empty Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u5.bits_5.msmLineRxFifoAlmostEmptyThreshold - - Default = 0x00 - - Rx FIFO almost empty threshold - - Notes: - Unused. */ - unsigned int msmLineRxFifoAlmostEmptyThreshold : 8; /* 1E.9013.7:0 ROS Default = 0x00 */ - /* Rx FIFO almost empty threshold */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of MSM Line FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.9014.7:0 ROS MSM Line Tx FIFO Almost Full Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u6.bits_6.msmLineTxFifoAlmostFullThreshold - - Default = 0x00 - - Tx FIFO almost full threshold - - Notes: - Unused. */ - unsigned int msmLineTxFifoAlmostFullThreshold : 8; /* 1E.9014.7:0 ROS Default = 0x00 */ - /* Tx FIFO almost full threshold */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of MSM Line FIFO Control Register */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.9015.7:0 ROS MSM Line Tx FIFO Almost Empty Threshold [7:0] - AQ_MsmLineFifoControlRegister_HHD.u7.bits_7.msmLineTxFifoAlmostEmptyThreshold - - Default = 0x00 - - Tx FIFO almost empty threshold - - Notes: - Unused. */ - unsigned int msmLineTxFifoAlmostEmptyThreshold : 8; /* 1E.9015.7:0 ROS Default = 0x00 */ - /* Tx FIFO almost empty threshold */ - } bits_7; - uint16_t word_7; - } u7; -} AQ_MsmLineFifoControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line General Status Register: 1E.9020 */ -/* MSM Line General Status Register: 1E.9020 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line General Status Register */ - union - { - struct - { - unsigned int reserved0 : 10; - /*! \brief 1E.9020.5 RO MSM Line Tx FIFO Empty - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineTxFifoEmpty - - - - Tx FIFO empty - - Notes: - When set to 1, indicates the Tx FIFO is empty. When set to 0, Tx FIFO is non-empty. */ - unsigned int msmLineTxFifoEmpty : 1; /* 1E.9020.5 RO */ - /* Tx FIFO empty */ - /*! \brief 1E.9020.4 RO MSM Line Rx Low Power IDLE - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineRxLowPowerIdle - - - - Rx LPI detected - - Notes: - Receive low power IDLE (LPI). Set to 1 when LPI is currently detected on the MAC Rx interface. Set to 0, when the MAC currently operates in normal mode. */ - unsigned int msmLineRxLowPowerIdle : 1; /* 1E.9020.4 RO */ - /* Rx LPI detected */ - /*! \brief 1E.9020.3 R/W MSM Line Timestamp Available - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineTimestampAvailable - - Default = 0x0 - - Timestamp available - - Notes: - Transmit timestamp available. Indicates that the timestamp of the last transmitted event frame (which had ff_tx_ts_frm=1) is available in the register See MAC Time Stamp Status 0 [F:0] and See MAC Time Stamp Status 1 [F:0] . To clear this bit, the bit must be written with a 1. - */ - unsigned int msmLineTimestampAvailable : 1; /* 1E.9020.3 R/W Default = 0x0 */ - /* Timestamp available */ - /*! \brief 1E.9020.2 RO MSM Line PHY Loss of Signal - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLinePhyLossOfSignal - - - - PHY loss of signal - - Notes: - PHY indicates loss of signal. This is the value of pin phy_los which is tied to 0. */ - unsigned int msmLinePhyLossOfSignal : 1; /* 1E.9020.2 RO */ - /* PHY loss of signal */ - /*! \brief 1E.9020.1 BLH MSM Line Rx Remote Fault - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineRxRemoteFault - - - - Rx remote fault detected - - Notes: - Latch high local fault status. Set to 1, whent he MAC detects Rx local fault sequences on the Rx interface. Reset to 0 after read and after reset. */ - unsigned int msmLineRxRemoteFault : 1; /* 1E.9020.1 BLH */ - /* Rx remote fault detected */ - /*! \brief 1E.9020.0 BLH MSM Line Rx Local Fault - AQ_MsmLineGeneralStatusRegister_HHD.u0.bits_0.msmLineRxLocalFault - - - - Rx local fault detected - - Notes: - Latch high local fault status. Set to 1, whent he MAC detects Rx local fault sequences on the Rx interface. Reset to 0 after read and after reset. */ - unsigned int msmLineRxLocalFault : 1; /* 1E.9020.0 BLH */ - /* Rx local fault detected */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line General Status Register */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineGeneralStatusRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx IPG Control Register: 1E.9022 */ -/* MSM Line Tx IPG Control Register: 1E.9022 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx IPG Control Register */ - union - { - struct - { - unsigned int reserved0 : 10; - /*! \brief 1E.9022.5:0 R/W MSM Line Tx IPG Length [5:0] - AQ_MsmLineTxIpgControlRegister_HHD.u0.bits_0.msmLineTxIpgLength - - Default = 0x0C - - Tx IPG length - - Notes: - Tx inter-packet gap (IPG) value. Depending on LAN or WAN mode of operation. - LAN Mode : Number of octets in steps of 4. Valid values are 8, 12, 16,..., 100. DIC is supported for any setting > 8. A default of 12 must be set to conform to IEEE802.3ae. - WAN Mode : Stretch factor. Valid values are 4 ... 15. The stretch factor is calculated as (value+1)*8. A default of 12 must be set to conform to IEEE802.3ae (i.e. 13*8=104). A larger value shrinks the IPG (increasing bandwidth). - The reset value of 12 leads to IEEE802.3ae conformant behavior in both modes. - Note : WAN mode is only available in 10G mode of operation. */ - unsigned int msmLineTxIpgLength : 6; /* 1E.9022.5:0 R/W Default = 0x0C */ - /* Tx IPG length */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx IPG Control Register */ - union - { - struct - { - /*! \brief 1E.9023.F:0 MSM Line Tx IPG Reserved - AQ_MsmLineTxIpgControlRegister_HHD.u1.bits_1.msmLineTxIpgReserved - - - - Value always 0, writes ignored - */ - unsigned int msmLineTxIpgReserved : 16; /* 1E.9023.F:0 */ - /* Value always 0, writes ignored */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxIpgControlRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Good Frames Counter Register: 1E.9040 */ -/* MSM Line Tx Good Frames Counter Register: 1E.9040 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9040.F:0 ROS MSM Line Tx Good Frames Counter 0 [F:0] - AQ_MsmLineTxGoodFramesCounterRegister_HHD.u0.bits_0.msmLineTxGoodFramesCounter_0 - - Default = 0x0000 - - Tx good frame counter bits 15:0 - - Notes: - Count of frames transmitted without error (Including pause frames). */ - unsigned int msmLineTxGoodFramesCounter_0 : 16; /* 1E.9040.F:0 ROS Default = 0x0000 */ - /* Tx good frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9041.F:0 ROS MSM Line Tx Good Frames Counter 1 [F:0] - AQ_MsmLineTxGoodFramesCounterRegister_HHD.u1.bits_1.msmLineTxGoodFramesCounter_1 - - Default = 0x0000 - - Tx good frame counter bits 31:16 - - - Notes: - Count of frames transmitted without error (Including pause frames). */ - unsigned int msmLineTxGoodFramesCounter_1 : 16; /* 1E.9041.F:0 ROS Default = 0x0000 */ - /* Tx good frame counter bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxGoodFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Good Frames Counter Register: 1E.9044 */ -/* MSM Line Rx Good Frames Counter Register: 1E.9044 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9044.F:0 ROS MSM Line Rx Good Frames Counter 0 [F:0] - AQ_MsmLineRxGoodFramesCounterRegister_HHD.u0.bits_0.msmLineRxGoodFramesCounter_0 - - Default = 0x0000 - - Rx good frame counter bits 15:0 - - Notes: - Count of frames received without error (Including pause frames). */ - unsigned int msmLineRxGoodFramesCounter_0 : 16; /* 1E.9044.F:0 ROS Default = 0x0000 */ - /* Rx good frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Good Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9045.F:0 ROS MSM Line Rx Good Frames Counter 1 [F:0] - AQ_MsmLineRxGoodFramesCounterRegister_HHD.u1.bits_1.msmLineRxGoodFramesCounter_1 - - Default = 0x0000 - - Rx good frame counter bits 31:16 - - Notes: - Count of frames received without error (Including pause frames). */ - unsigned int msmLineRxGoodFramesCounter_1 : 16; /* 1E.9045.F:0 ROS Default = 0x0000 */ - /* Rx good frame counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxGoodFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx FCS Errors Counter Register: 1E.9048 */ -/* MSM Line Rx FCS Errors Counter Register: 1E.9048 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx FCS Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.9048.F:0 ROS MSM Line FCS Error Counter 0 [F:0] - AQ_MsmLineRxFcsErrorsCounterRegister_HHD.u0.bits_0.msmLineFcsErrorCounter_0 - - Default = 0x0000 - - Frame check sequence error counter bits 15:0 - - Notes: - Count of frames for which a CRC-32 Error is detected but the frame is otherwise of correct length. */ - unsigned int msmLineFcsErrorCounter_0 : 16; /* 1E.9048.F:0 ROS Default = 0x0000 */ - /* Frame check sequence error counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx FCS Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.9049.F:0 ROS MSM Line FCS Error Counter 1 [F:0] - AQ_MsmLineRxFcsErrorsCounterRegister_HHD.u1.bits_1.msmLineFcsErrorCounter_1 - - Default = 0x0000 - - Frame check sequence error counter bits 31:16 - - Notes: - Count of frames for which a CRC-32 Error is detected but the frame is otherwise of correct length. */ - unsigned int msmLineFcsErrorCounter_1 : 16; /* 1E.9049.F:0 ROS Default = 0x0000 */ - /* Frame check sequence error counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxFcsErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Alignment Errors Counter Register: 1E.904C */ -/* MSM Line Rx Alignment Errors Counter Register: 1E.904C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Alignment Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.904C.F:0 ROS MSM Line Alignment Error Counter 0 [F:0] - AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD.u0.bits_0.msmLineAlignmentErrorCounter_0 - - Default = 0x0000 - - Alignment error counter bits 15:0 - - Notes: - Count of frames received with an alignment error. */ - unsigned int msmLineAlignmentErrorCounter_0 : 16; /* 1E.904C.F:0 ROS Default = 0x0000 */ - /* Alignment error counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Alignment Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.904D.F:0 ROS MSM Line Alignment Error Counter 1 [F:0] - AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD.u1.bits_1.msmLineAlignmentErrorCounter_1 - - Default = 0x0000 - - Alignment error counter bits 31:16 - - Notes: - Count of frames received with an alignment error. */ - unsigned int msmLineAlignmentErrorCounter_1 : 16; /* 1E.904D.F:0 ROS Default = 0x0000 */ - /* Alignment error counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxAlignmentErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Pause Frames Counter Register: 1E.9050 */ -/* MSM Line Tx Pause Frames Counter Register: 1E.9050 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9050.F:0 ROS MSM Line Tx Pause Frames Counter 0 [F:0] - AQ_MsmLineTxPauseFramesCounterRegister_HHD.u0.bits_0.msmLineTxPauseFramesCounter_0 - - Default = 0x0000 - - Tx pause frame counter bits 15:0 - - Notes: - Valid pause frames transmitted. */ - unsigned int msmLineTxPauseFramesCounter_0 : 16; /* 1E.9050.F:0 ROS Default = 0x0000 */ - /* Tx pause frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9051.F:0 ROS MSM Line Tx Pause Frames Counter 1 [F:0] - AQ_MsmLineTxPauseFramesCounterRegister_HHD.u1.bits_1.msmLineTxPauseFramesCounter_1 - - Default = 0x0000 - - Tx pause frame counter bits 31:16 - - - Notes: - Valid pause frames transmitted. */ - unsigned int msmLineTxPauseFramesCounter_1 : 16; /* 1E.9051.F:0 ROS Default = 0x0000 */ - /* Tx pause frame counter bits 31:16 - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxPauseFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Pause Frames Counter Register: 1E.9054 */ -/* MSM Line Rx Pause Frames Counter Register: 1E.9054 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9054.F:0 ROS MSM Line Rx Pause Frames Counter 0 [F:0] - AQ_MsmLineRxPauseFramesCounterRegister_HHD.u0.bits_0.msmLineRxPauseFramesCounter_0 - - Default = 0x0000 - - Rx pause frame counter bits 15:0 - - Notes: - Valid pause frames received. */ - unsigned int msmLineRxPauseFramesCounter_0 : 16; /* 1E.9054.F:0 ROS Default = 0x0000 */ - /* Rx pause frame counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Pause Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9055.F:0 ROS MSM Line Rx Pause Frames Counter 1 [F:0] - AQ_MsmLineRxPauseFramesCounterRegister_HHD.u1.bits_1.msmLineRxPauseFramesCounter_1 - - Default = 0x0000 - - Rx pause frame counter bits 31:16 - - Notes: - Valid pause frames received. */ - unsigned int msmLineRxPauseFramesCounter_1 : 16; /* 1E.9055.F:0 ROS Default = 0x0000 */ - /* Rx pause frame counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxPauseFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Too Long Errors Counter Register: 1E.9058 */ -/* MSM Line Rx Too Long Errors Counter Register: 1E.9058 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Too Long Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.9058.F:0 ROS MSM Line Rx Too Long Errors Counter 0 [F:0] - AQ_MsmLineRxTooLongErrorsCounterRegister_HHD.u0.bits_0.msmLineRxTooLongErrorsCounter_0 - - Default = 0x0000 - - Too-long errors counter bits 15:0 - - Notes: - Frame received exceeded the maximum length programmed with register FRM_LGTH. */ - unsigned int msmLineRxTooLongErrorsCounter_0 : 16; /* 1E.9058.F:0 ROS Default = 0x0000 */ - /* Too-long errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Too Long Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.9059.F:0 ROS MSM Line Rx Too Long Errors Counter 1 [F:0] - AQ_MsmLineRxTooLongErrorsCounterRegister_HHD.u1.bits_1.msmLineRxTooLongErrorsCounter_1 - - Default = 0x0000 - - Too-long errors counter bits 31:16 - - Notes: - Frame received exceeded the maximum length programmed with register FRM_LGTH. */ - unsigned int msmLineRxTooLongErrorsCounter_1 : 16; /* 1E.9059.F:0 ROS Default = 0x0000 */ - /* Too-long errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxTooLongErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx In Range Length Errors Counter Register: 1E.905C */ -/* MSM Line Rx In Range Length Errors Counter Register: 1E.905C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx In Range Length Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.905C.F:0 ROS MSM Line Rx In Range Length Errors Counter 0 [F:0] - AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD.u0.bits_0.msmLineRxInRangeLengthErrorsCounter_0 - - Default = 0x0000 - - In-range-length errors counter bits 15:0 - - Notes: - A count of frames with a length/type field value between 46 (VLAN: 42) and less than 0x0600, that does not match the number of payload data octets received. Should count also if length/type field is less than 46 (VLAN: 42) and the frame is longer than 64 bytes. */ - unsigned int msmLineRxInRangeLengthErrorsCounter_0 : 16; /* 1E.905C.F:0 ROS Default = 0x0000 */ - /* In-range-length errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx In Range Length Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.905D.F:0 ROS MSM Line Rx In Range Length Errors Counter 1 [F:0] - AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD.u1.bits_1.msmLineRxInRangeLengthErrorsCounter_1 - - Default = 0x0000 - - In-range-length errors counter bits 31:16 - - Notes: - A count of frames with a length/type field value between 46 (VLAN: 42) and less than 0x0600, that does not match the number of payload data octets received. Should count also if length/type field is less than 46 (VLAN: 42) and the frame is longer than 64 bytes. */ - unsigned int msmLineRxInRangeLengthErrorsCounter_1 : 16; /* 1E.905D.F:0 ROS Default = 0x0000 */ - /* In-range-length errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxInRangeLengthErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx VLAN Frames Counter Register: 1E.9060 */ -/* MSM Line Tx VLAN Frames Counter Register: 1E.9060 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9060.F:0 ROS MSM Line Tx VLAN Frames Counter 0 [F:0] - AQ_MsmLineTxVlanFramesCounterRegister_HHD.u0.bits_0.msmLineTxVlanFramesCounter_0 - - Default = 0x0000 - - Tx VLAN frames counter bits 15:0 - - Notes: - Valid VLAN tagged frames transmitted. */ - unsigned int msmLineTxVlanFramesCounter_0 : 16; /* 1E.9060.F:0 ROS Default = 0x0000 */ - /* Tx VLAN frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9061.F:0 ROS MSM Line Tx VLAN Frames Counter 1 [F:0] - AQ_MsmLineTxVlanFramesCounterRegister_HHD.u1.bits_1.msmLineTxVlanFramesCounter_1 - - Default = 0x0000 - - Tx VLAN frames counter bits 31:16 - - Notes: - Valid VLAN tagged frames transmitted. */ - unsigned int msmLineTxVlanFramesCounter_1 : 16; /* 1E.9061.F:0 ROS Default = 0x0000 */ - /* Tx VLAN frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxVlanFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx VLAN Frames Counter Register: 1E.9064 */ -/* MSM Line Rx VLAN Frames Counter Register: 1E.9064 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9064.F:0 ROS MSM Line Rx VLAN Frames Counter 0 [F:0] - AQ_MsmLineRxVlanFramesCounterRegister_HHD.u0.bits_0.msmLineRxVlanFramesCounter_0 - - Default = 0x0000 - - Rx VLAN frames counter bits 15:0 - - Notes: - Valid VLAN tagged frames received. */ - unsigned int msmLineRxVlanFramesCounter_0 : 16; /* 1E.9064.F:0 ROS Default = 0x0000 */ - /* Rx VLAN frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx VLAN Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9065.F:0 ROS MSM Line Rx VLAN Frames Counter 1 [F:0] - AQ_MsmLineRxVlanFramesCounterRegister_HHD.u1.bits_1.msmLineRxVlanFramesCounter_1 - - Default = 0x0000 - - Rx VLAN frames counter bits 31:16 - - Notes: - Valid VLAN tagged frames received. */ - unsigned int msmLineRxVlanFramesCounter_1 : 16; /* 1E.9065.F:0 ROS Default = 0x0000 */ - /* Rx VLAN frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxVlanFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Octets Counter Register: 1E.9068 */ -/* MSM Line Tx Octets Counter Register: 1E.9068 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.9068.F:0 ROS MSM Line Tx Octets Counter 0 [F:0] - AQ_MsmLineTxOctetsCounterRegister_HHD.u0.bits_0.msmLineTxOctetsCounter_0 - - Default = 0x0000 - - Tx octets counter bits 15:0 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmLineTxOctetsCounter_0 : 16; /* 1E.9068.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.9069.F:0 ROS MSM Line Tx Octets Counter 1 [F:0] - AQ_MsmLineTxOctetsCounterRegister_HHD.u1.bits_1.msmLineTxOctetsCounter_1 - - Default = 0x0000 - - Tx octets counter bits 31:16 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmLineTxOctetsCounter_1 : 16; /* 1E.9069.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of MSM Line Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.906A.F:0 ROS MSM Line Tx Octets Counter 2 [F:0] - AQ_MsmLineTxOctetsCounterRegister_HHD.u2.bits_2.msmLineTxOctetsCounter_2 - - Default = 0x0000 - - Tx octets counter bits 47:32 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmLineTxOctetsCounter_2 : 16; /* 1E.906A.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 47:32 */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of MSM Line Tx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.906B.F:0 ROS MSM Line Tx Octets Counter 3 [F:0] - AQ_MsmLineTxOctetsCounterRegister_HHD.u3.bits_3.msmLineTxOctetsCounter_3 - - Default = 0x0000 - - Tx octets counter bits 63:48 - - Notes: - All octets transmitted except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames transmitted. */ - unsigned int msmLineTxOctetsCounter_3 : 16; /* 1E.906B.F:0 ROS Default = 0x0000 */ - /* Tx octets counter bits 63:48 */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_MsmLineTxOctetsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Octets Counter Register: 1E.906C */ -/* MSM Line Rx Octets Counter Register: 1E.906C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.906C.F:0 ROS MSM Line Rx Octets Counter 0 [F:0] - AQ_MsmLineRxOctetsCounterRegister_HHD.u0.bits_0.msmLineRxOctetsCounter_0 - - Default = 0x0000 - - Rx octets counter bits 15:0 - - Notes: - All octets received except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames received. */ - unsigned int msmLineRxOctetsCounter_0 : 16; /* 1E.906C.F:0 ROS Default = 0x0000 */ - /* Rx octets counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Octets Counter Register */ - union - { - struct - { - /*! \brief 1E.906D.F:0 ROS MSM Line Rx Octets Counter 1 [F:0] - AQ_MsmLineRxOctetsCounterRegister_HHD.u1.bits_1.msmLineRxOctetsCounter_1 - - Default = 0x0000 - - Rx octets counter bits 31:16 - - Notes: - All octets received except preamble (i.e. Header, Payload, Pad and FCS) for all valid frames and valid pause frames received. */ - unsigned int msmLineRxOctetsCounter_1 : 16; /* 1E.906D.F:0 ROS Default = 0x0000 */ - /* Rx octets counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxOctetsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Unicast Frames Counter Register: 1E.9070 */ -/* MSM Line Rx Unicast Frames Counter Register: 1E.9070 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9070.F:0 ROS MSM Line Rx Unicast Frames Counter 0 [F:0] - AQ_MsmLineRxUnicastFramesCounterRegister_HHD.u0.bits_0.msmLineRxUnicastFramesCounter_0 - - Default = 0x0000 - - Rx unicast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '0'. */ - unsigned int msmLineRxUnicastFramesCounter_0 : 16; /* 1E.9070.F:0 ROS Default = 0x0000 */ - /* Rx unicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9071.F:0 ROS MSM Line Rx Unicast Frames Counter 1 [F:0] - AQ_MsmLineRxUnicastFramesCounterRegister_HHD.u1.bits_1.msmLineRxUnicastFramesCounter_1 - - Default = 0x0000 - - Rx unicast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '0'. */ - unsigned int msmLineRxUnicastFramesCounter_1 : 16; /* 1E.9071.F:0 ROS Default = 0x0000 */ - /* Rx unicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxUnicastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Multicast Frames Counter Register: 1E.9074 */ -/* MSM Line Rx Multicast Frames Counter Register: 1E.9074 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9074.F:0 ROS MSM Line Rx Multicast Frames Counter 0 [F:0] - AQ_MsmLineRxMulticastFramesCounterRegister_HHD.u0.bits_0.msmLineRxMulticastFramesCounter_0 - - Default = 0x0000 - - Rx multicast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '1' but not the broadcast address (all bits set '1' ). Pause frames are not counted. */ - unsigned int msmLineRxMulticastFramesCounter_0 : 16; /* 1E.9074.F:0 ROS Default = 0x0000 */ - /* Rx multicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9075.F:0 ROS MSM Line Rx Multicast Frames Counter 1 [F:0] - AQ_MsmLineRxMulticastFramesCounterRegister_HHD.u1.bits_1.msmLineRxMulticastFramesCounter_1 - - Default = 0x0000 - - Rx multicast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface and bit 0 of the destination address was '1' but not the broadcast address (all bits set '1' ). Pause frames are not counted. */ - unsigned int msmLineRxMulticastFramesCounter_1 : 16; /* 1E.9075.F:0 ROS Default = 0x0000 */ - /* Rx multicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxMulticastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Broadcast Frames Counter Register: 1E.9078 */ -/* MSM Line Rx Broadcast Frames Counter Register: 1E.9078 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9078.F:0 ROS MSM Line Rx Broadcast Frames Counter 0 [F:0] - AQ_MsmLineRxBroadcastFramesCounterRegister_HHD.u0.bits_0.msmLineRxBroadcastFramesCounter_0 - - Default = 0x0000 - - Rx broadcast frames counter bits 15:0 - - Notes: - Incremented with each valid frame received on the receive FIFO interface (FIFO) and all bits of the destination address were set '1'. */ - unsigned int msmLineRxBroadcastFramesCounter_0 : 16; /* 1E.9078.F:0 ROS Default = 0x0000 */ - /* Rx broadcast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9079.F:0 ROS MSM Line Rx Broadcast Frames Counter 1 [F:0] - AQ_MsmLineRxBroadcastFramesCounterRegister_HHD.u1.bits_1.msmLineRxBroadcastFramesCounter_1 - - Default = 0x0000 - - Rx broadcast frames counter bits 31:16 - - Notes: - Incremented with each valid frame received on the receive FIFO interface (FIFO) and all bits of the destination address were set '1'. */ - unsigned int msmLineRxBroadcastFramesCounter_1 : 16; /* 1E.9079.F:0 ROS Default = 0x0000 */ - /* Rx broadcast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxBroadcastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Errors Counter Register: 1E.907C */ -/* MSM Line Tx Errors Counter Register: 1E.907C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.907C.F:0 ROS MSM Line Tx Errors Counter 0 [F:0] - AQ_MsmLineTxErrorsCounterRegister_HHD.u0.bits_0.msmLineTxErrorsCounter_0 - - Default = 0x0000 - - Rx errors counter bits 15:0 - - Notes: - Number of frames transmitted with error: - - FIFO Overflow Errors - - FIFO Underflow Errors */ - unsigned int msmLineTxErrorsCounter_0 : 16; /* 1E.907C.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.907D.F:0 ROS MSM Line Tx Errors Counter 1 [F:0] - AQ_MsmLineTxErrorsCounterRegister_HHD.u1.bits_1.msmLineTxErrorsCounter_1 - - Default = 0x0000 - - Tx errors counter bits 31:16 - - Notes: - Number of frames transmitted with error: - - FIFO Overflow Errors - - FIFO Underflow Errors */ - unsigned int msmLineTxErrorsCounter_1 : 16; /* 1E.907D.F:0 ROS Default = 0x0000 */ - /* Tx errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Unicast Frames Counter Register: 1E.9084 */ -/* MSM Line Tx Unicast Frames Counter Register: 1E.9084 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9084.F:0 ROS MSM Line Tx Unicast Frames Counter 0 [F:0] - AQ_MsmLineTxUnicastFramesCounterRegister_HHD.u0.bits_0.msmLineTxUnicastFramesCounter_0 - - Default = 0x0000 - - Tx unicast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '0'. */ - unsigned int msmLineTxUnicastFramesCounter_0 : 16; /* 1E.9084.F:0 ROS Default = 0x0000 */ - /* Tx unicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Unicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9085.F:0 ROS MSM Line Tx Unicast Frames Counter 1 [F:0] - AQ_MsmLineTxUnicastFramesCounterRegister_HHD.u1.bits_1.msmLineTxUnicastFramesCounter_1 - - Default = 0x0000 - - Tx unicast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '0'. */ - unsigned int msmLineTxUnicastFramesCounter_1 : 16; /* 1E.9085.F:0 ROS Default = 0x0000 */ - /* Tx unicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxUnicastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Multicast Frames Counter Register: 1E.9088 */ -/* MSM Line Tx Multicast Frames Counter Register: 1E.9088 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9088.F:0 ROS MSM Line Tx Multicast Frames Counter 0 [F:0] - AQ_MsmLineTxMulticastFramesCounterRegister_HHD.u0.bits_0.msmLineTxMulticastFramesCounter_0 - - Default = 0x0000 - - Tx multicast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '1' but not the broadcast address (all bits '1'). */ - unsigned int msmLineTxMulticastFramesCounter_0 : 16; /* 1E.9088.F:0 ROS Default = 0x0000 */ - /* Tx multicast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Multicast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.9089.F:0 ROS MSM Line Tx Multicast Frames Counter 1 [F:0] - AQ_MsmLineTxMulticastFramesCounterRegister_HHD.u1.bits_1.msmLineTxMulticastFramesCounter_1 - - Default = 0x0000 - - Tx multicast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and bit 0 of the destination address set to '1' but not the broadcast address (all bits '1'). */ - unsigned int msmLineTxMulticastFramesCounter_1 : 16; /* 1E.9089.F:0 ROS Default = 0x0000 */ - /* Tx multicast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxMulticastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Tx Broadcast Frames Counter Register: 1E.908C */ -/* MSM Line Tx Broadcast Frames Counter Register: 1E.908C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Tx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.908C.F:0 ROS MSM Line Tx Broadcast Frames Counter 0 [F:0] - AQ_MsmLineTxBroadcastFramesCounterRegister_HHD.u0.bits_0.msmLineTxBroadcastFramesCounter_0 - - Default = 0x0000 - - Tx broadcast frames counter bits 15:0 - - Notes: - Incremented with each frame written to the FIFO interface and all bits of the destination address set to '1'. */ - unsigned int msmLineTxBroadcastFramesCounter_0 : 16; /* 1E.908C.F:0 ROS Default = 0x0000 */ - /* Tx broadcast frames counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Tx Broadcast Frames Counter Register */ - union - { - struct - { - /*! \brief 1E.908D.F:0 ROS MSM Line Tx Broadcast Frames Counter 1 [F:0] - AQ_MsmLineTxBroadcastFramesCounterRegister_HHD.u1.bits_1.msmLineTxBroadcastFramesCounter_1 - - Default = 0x0000 - - Tx broadcast frames counter bits 31:16 - - Notes: - Incremented with each frame written to the FIFO interface and all bits of the destination address set to '1'. */ - unsigned int msmLineTxBroadcastFramesCounter_1 : 16; /* 1E.908D.F:0 ROS Default = 0x0000 */ - /* Tx broadcast frames counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineTxBroadcastFramesCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief MSM Line Rx Errors Counter Register: 1E.90C8 */ -/* MSM Line Rx Errors Counter Register: 1E.90C8 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of MSM Line Rx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.90C8.F:0 ROS MSM Line Rx Errors Counter 0 [F:0] - AQ_MsmLineRxErrorsCounterRegister_HHD.u0.bits_0.msmLineRxErrorsCounter_0 - - Default = 0x0000 - - Rx errors counter bits 15:0 - - Notes: - Number of frames received with error: - - FIFO Overflow Errors - - CRC Errors - - Payload Length Errors - - Jabber and Oversized Errors - - Alignment Errors - - The dedicated Error Code (0xfe, not a code error) was received */ - unsigned int msmLineRxErrorsCounter_0 : 16; /* 1E.90C8.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 15:0 */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of MSM Line Rx Errors Counter Register */ - union - { - struct - { - /*! \brief 1E.90C9.F:0 ROS MSM Line Rx Errors Counter 1 [F:0] - AQ_MsmLineRxErrorsCounterRegister_HHD.u1.bits_1.msmLineRxErrorsCounter_1 - - Default = 0x0000 - - Rx errors counter bits 31:16 - - Notes: - Number of frames received with error: - - FIFO Overflow Errors - - CRC Errors - - Payload Length Errors - - Jabber and Oversized Errors - - Alignment Errors - - The dedicated Error Code (0xfe, not a code error) was received */ - unsigned int msmLineRxErrorsCounter_1 : 16; /* 1E.90C9.F:0 ROS Default = 0x0000 */ - /* Rx errors counter bits 31:16 */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_MsmLineRxErrorsCounterRegister_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Control: 1E.C000 */ -/* Global Control: 1E.C000 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Control */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Control */ - union - { - struct - { - /*! \brief 1E.C001.F R/W uP Reset - AQ_GlobalControl_HHD.u1.bits_1.upReset - - Default = 0x0 - - 1 = Reset - - - Notes: - Resets the uP and the PIF master and slave bus. Will be active for a minimum of 100 microseconds. */ - unsigned int upReset : 1; /* 1E.C001.F R/W Default = 0x0 */ - /* 1 = Reset - */ - unsigned int reserved0 : 8; - /*! \brief 1E.C001.6 R/W uP Run Stall Override - AQ_GlobalControl_HHD.u1.bits_1.upRunStallOverride - - Default = 0x0 - - 0 = uP Run Stall from "MDIO Boot Load" pin. - 1 = uP Run Stall from See MCP Run Stall bit - - - - Notes: - This bit selects the uP Run Stall from either the "MDIO Boot Load" pin or the See MCP Run Stall bit. Pin no longer brought out as deprecated. */ - unsigned int upRunStallOverride : 1; /* 1E.C001.6 R/W Default = 0x0 */ - /* 0 = uP Run Stall from "MDIO Boot Load" pin. - 1 = uP Run Stall from See MCP Run Stall bit - - */ - unsigned int reserved1 : 5; - /*! \brief 1E.C001.0 R/W uP Run Stall - AQ_GlobalControl_HHD.u1.bits_1.upRunStall - - Default = 0x0 - - 1 = uP Run Stall - 0 = uP normal mode - - - Notes: - Deactivates the uP. */ - unsigned int upRunStall : 1; /* 1E.C001.0 R/W Default = 0x0 */ - /* 1 = uP Run Stall - 0 = uP normal mode - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalControl_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reset Control: 1E.C006 */ -/* Global Reset Control: 1E.C006 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reset Control */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C006.E R/WPD Global MMD Reset Disable - AQ_GlobalResetControl_HHD.u0.bits_0.globalMMD_ResetDisable - - Provisionable Default = 0x0 - - 1 = Disable the S/W reset to the Global MMD registers - 0 = Enable the S/W reset to the Global MMD registers - - - Notes: - Setting this bit prevents a Global S/W reset or Global S/W reset from resetting the Global MMD registers */ - unsigned int globalMMD_ResetDisable : 1; /* 1E.C006.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Disable the S/W reset to the Global MMD registers - 0 = Enable the S/W reset to the Global MMD registers - */ - unsigned int reserved1 : 14; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalResetControl_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Diagnostic Provisioning: 1E.C400 */ -/* Global Diagnostic Provisioning: 1E.C400 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Diagnostic Provisioning */ - union - { - struct - { - /*! \brief 1E.C400.F R/WPD Enable Diagnostics - AQ_GlobalDiagnosticProvisioning_HHD.u0.bits_0.enableDiagnostics - - Provisionable Default = 0x1 - - 1 = Chip performs diagnostics on power-up - */ - unsigned int enableDiagnostics : 1; /* 1E.C400.F R/WPD Provisionable Default = 0x1 */ - /* 1 = Chip performs diagnostics on power-up */ - unsigned int reserved0 : 15; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalDiagnosticProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Thermal Provisioning: 1E.C420 */ -/* Global Thermal Provisioning: 1E.C420 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C420.F:0 R/WPD Reserved 0 [F:0] - AQ_GlobalThermalProvisioning_HHD.u0.bits_0.reserved_0 - - Provisionable Default = 0x0000 - - Internal reserved - do not modify - - */ - unsigned int reserved_0 : 16; /* 1E.C420.F:0 R/WPD Provisionable Default = 0x0000 */ - /* Internal reserved - do not modify - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C421.F:0 R/WPD High Temp Failure Threshold [F:0] - AQ_GlobalThermalProvisioning_HHD.u1.bits_1.highTempFailureThreshold - - Provisionable Default = 0x4600 - - [F:0] of high temperature failure threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 70 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A000 - 1.A001: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int highTempFailureThreshold : 16; /* 1E.C421.F:0 R/WPD Provisionable Default = 0x4600 */ - /* [F:0] of high temperature failure threshold */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C422.F:0 R/WPD Low Temp Failure Threshold [F:0] - AQ_GlobalThermalProvisioning_HHD.u2.bits_2.lowTempFailureThreshold - - Provisionable Default = 0x0000 - - [F:0] of low temperature failure threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 0 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A002 - 1.A003: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int lowTempFailureThreshold : 16; /* 1E.C422.F:0 R/WPD Provisionable Default = 0x0000 */ - /* [F:0] of low temperature failure threshold */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C423.F:0 R/WPD High Temp Warning Threshold [F:0] - AQ_GlobalThermalProvisioning_HHD.u3.bits_3.highTempWarningThreshold - - Provisionable Default = 0x3C00 - - [F:0] of high temperature warning threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD008. Default is 60 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A004 - 1.A005: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int highTempWarningThreshold : 16; /* 1E.C423.F:0 R/WPD Provisionable Default = 0x3C00 */ - /* [F:0] of high temperature warning threshold */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Thermal Provisioning */ - union - { - struct - { - /*! \brief 1E.C424.F:0 R/WPD Low Temp Warning Threshold [F:0] - AQ_GlobalThermalProvisioning_HHD.u4.bits_4.lowTempWarningThreshold - - Provisionable Default = 0x0A00 - - [F:0] of low temperature warning threshold - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 10 degreesC. - - In XENPAK mode, F/W will use the XENPAK register 1.A006 - 1.A007: instead of this register. - - NOTE! All Thresholds are orthogonal and can be set to any value regardless the value of the other thresholds. i.e. High-Temperature-Warning (1E.C423) could be higher than High-Temperature-Failure (1E.C421). */ - unsigned int lowTempWarningThreshold : 16; /* 1E.C424.F:0 R/WPD Provisionable Default = 0x0A00 */ - /* [F:0] of low temperature warning threshold */ - } bits_4; - uint16_t word_4; - } u4; -} AQ_GlobalThermalProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global LED Provisioning: 1E.C430 */ -/* Global LED Provisioning: 1E.C430 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 2; - /*! \brief 1E.C430.D:9 R/WPD Reserved Provisioning C430 [4:0] - AQ_GlobalLedProvisioning_HHD.u0.bits_0.reservedProvisioningC430 - - Provisionable Default = 0x00 - - Reserved for future use - */ - unsigned int reservedProvisioningC430 : 5; /* 1E.C430.D:9 R/WPD Provisionable Default = 0x00 */ - /* Reserved for future use */ - /*! \brief 1E.C430.8 R/WPD LED #0 Manual Set - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_0ManualSet : 1; /* 1E.C430.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C430.7 R/WPD LED #0 10 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_0_10Gb_sLinkEstablished : 1; /* 1E.C430.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C430.6 R/WPD LED #0 1 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_0_1Gb_sLinkEstablished : 1; /* 1E.C430.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C430.5 R/WPD LED #0 100 Mb/s Link Established - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s. - - */ - unsigned int led_0_100Mb_sLinkEstablished : 1; /* 1E.C430.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s. - */ - /*! \brief 1E.C430.4 R/WPD LED #0 Connecting - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_0Connecting : 1; /* 1E.C430.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C430.3 R/WPD LED #0 Receive Activity - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_0ReceiveActivity : 1; /* 1E.C430.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C430.2 R/WPD LED #0 Transmit Activity - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_0TransmitActivity : 1; /* 1E.C430.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C430.1:0 R/WPD LED #0 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_HHD.u0.bits_0.led_0ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_0ActivityStretch : 2; /* 1E.C430.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 2; - /*! \brief 1E.C431.D:9 R/WPD Reserved Provisioning C431 [4:0] - AQ_GlobalLedProvisioning_HHD.u1.bits_1.reservedProvisioningC431 - - Provisionable Default = 0x00 - - Reserved for future use - */ - unsigned int reservedProvisioningC431 : 5; /* 1E.C431.D:9 R/WPD Provisionable Default = 0x00 */ - /* Reserved for future use */ - /*! \brief 1E.C431.8 R/WPD LED #1 Manual Set - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_1ManualSet : 1; /* 1E.C431.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C431.7 R/WPD LED #1 10 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_1_10Gb_sLinkEstablished : 1; /* 1E.C431.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C431.6 R/WPD LED #1 1 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_1_1Gb_sLinkEstablished : 1; /* 1E.C431.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C431.5 R/WPD LED #1 100 Mb/s Link Established - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s. - - */ - unsigned int led_1_100Mb_sLinkEstablished : 1; /* 1E.C431.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s. - */ - /*! \brief 1E.C431.4 R/WPD LED #1 Connecting - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_1Connecting : 1; /* 1E.C431.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C431.3 R/WPD LED #1 Receive Activity - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_1ReceiveActivity : 1; /* 1E.C431.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C431.2 R/WPD LED #1 Transmit Activity - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_1TransmitActivity : 1; /* 1E.C431.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C431.1:0 R/WPD LED #1 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_HHD.u1.bits_1.led_1ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_1ActivityStretch : 2; /* 1E.C431.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 2; - /*! \brief 1E.C432.D:9 R/WPD Reserved Provisioning C432 [4:0] - AQ_GlobalLedProvisioning_HHD.u2.bits_2.reservedProvisioningC432 - - Provisionable Default = 0x00 - - Reserved for future use - */ - unsigned int reservedProvisioningC432 : 5; /* 1E.C432.D:9 R/WPD Provisionable Default = 0x00 */ - /* Reserved for future use */ - /*! \brief 1E.C432.8 R/WPD LED #2 Manual Set - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2ManualSet - - Provisionable Default = 0x0 - - 1 = LED On - - */ - unsigned int led_2ManualSet : 1; /* 1E.C432.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED On - */ - /*! \brief 1E.C432.7 R/WPD LED #2 10 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2_10Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 10 Gb/s - - */ - unsigned int led_2_10Gb_sLinkEstablished : 1; /* 1E.C432.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 10 Gb/s - */ - /*! \brief 1E.C432.6 R/WPD LED #2 1 Gb/s Link Established - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2_1Gb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 1 Gb/s - - */ - unsigned int led_2_1Gb_sLinkEstablished : 1; /* 1E.C432.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 1 Gb/s - */ - /*! \brief 1E.C432.5 R/WPD LED #2 100 Mb/s Link Established - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2_100Mb_sLinkEstablished - - Provisionable Default = 0x0 - - 1 = LED is on when link connects at 100 Mb/s. - */ - unsigned int led_2_100Mb_sLinkEstablished : 1; /* 1E.C432.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when link connects at 100 Mb/s. */ - /*! \brief 1E.C432.4 R/WPD LED #2 Connecting - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2Connecting - - Provisionable Default = 0x0 - - 1 = LED is on when attempting to connect. - - */ - unsigned int led_2Connecting : 1; /* 1E.C432.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED is on when attempting to connect. - */ - /*! \brief 1E.C432.3 R/WPD LED #2 Receive Activity - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2ReceiveActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on receive activity - - */ - unsigned int led_2ReceiveActivity : 1; /* 1E.C432.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on receive activity - */ - /*! \brief 1E.C432.2 R/WPD LED #2 Transmit Activity - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2TransmitActivity - - Provisionable Default = 0x0 - - 1 = LED toggles on transmit activity - - */ - unsigned int led_2TransmitActivity : 1; /* 1E.C432.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED toggles on transmit activity - */ - /*! \brief 1E.C432.1:0 R/WPD LED #2 Activity Stretch [1:0] - AQ_GlobalLedProvisioning_HHD.u2.bits_2.led_2ActivityStretch - - Provisionable Default = 0x3 - - [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - - */ - unsigned int led_2ActivityStretch : 2; /* 1E.C432.1:0 R/WPD Provisionable Default = 0x3 */ - /* [1:0] - 0x3 = stretch activity by 100 ms - 0x2 = stretch activity by 60 ms - 0x1 = stretch activity by 28 ms - 0x0 = no stretching - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C437.0 R/WPD LED Operation Mode - AQ_GlobalLedProvisioning_HHD.u7.bits_7.ledOperationMode - - Provisionable Default = 0x0 - - 1 = LED link activity in Mode #2 - 0 = LED link activity in Aquantia classic mode - - - Notes: - When set to 1, the LED blinking rate is based on Mode #2 algorithm. When set to 0, the LED blinking rate is based on the classic Aquantia algorithm. */ - unsigned int ledOperationMode : 1; /* 1E.C437.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = LED link activity in Mode #2 - 0 = LED link activity in Aquantia classic mode - */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_11; - uint16_t word_11; - } u11; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_12; - uint16_t word_12; - } u12; - /*! \brief Dummy union to fill space in the structure Global LED Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_13; - uint16_t word_13; - } u13; - /*! \brief Union for bit and word level access of word 14 of Global LED Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_14; - uint16_t word_14; - } u14; -} AQ_GlobalLedProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global General Provisioning: 1E.C440 */ -/* Global General Provisioning: 1E.C440 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C441.E R/WPD MDIO Broadcast Mode Enable - AQ_GlobalGeneralProvisioning_HHD.u1.bits_1.mdioBroadcastModeEnable - - Provisionable Default = 0x0 - - 1 = Enable broadcast on address set in 1E.C446 - 0 = Disable broadcast on n address set in 1E.C446 - - - Notes: - When enabled, writes and load MMD address opcodes are supported. Read opcodes are ignored. */ - unsigned int mdioBroadcastModeEnable : 1; /* 1E.C441.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable broadcast on address set in 1E.C446 - 0 = Disable broadcast on n address set in 1E.C446 - */ - /*! \brief 1E.C441.D R/WPD MDIO Read MSW First Enable - AQ_GlobalGeneralProvisioning_HHD.u1.bits_1.mdioReadMSW_FirstEnable - - Provisionable Default = 0x0 - - 1 = MSW of counter must be read first - 0 = LSW of counter must be read first - - - Notes: - This bit configures whether the MSW or LSW must be read first for counters greater than 16 bits. */ - unsigned int mdioReadMSW_FirstEnable : 1; /* 1E.C441.D R/WPD Provisionable Default = 0x0 */ - /* 1 = MSW of counter must be read first - 0 = LSW of counter must be read first - */ - unsigned int reserved1 : 8; - /*! \brief 1E.C441.4 R/WPD MDIO Drive Configuration - AQ_GlobalGeneralProvisioning_HHD.u1.bits_1.mdioDriveConfiguration - - Provisionable Default = 0x0 - - 0 = MDIO driver is in normal mode - 1 = MDIO driver is in open drain mode - - - Notes: - When the MDIO driver is in open drain mode during a read cycle, "0" data will be actively driven out of the MDIO, "1" data will set the MDIO driver in high impedance state and an external pullup will set the MDIO line to "1". The Turn-Around "0" will also be actively driven out of the MDIO, therefore in open drain mode, the Turn-Around is still "Z0". */ - unsigned int mdioDriveConfiguration : 1; /* 1E.C441.4 R/WPD Provisionable Default = 0x0 */ - /* 0 = MDIO driver is in normal mode - 1 = MDIO driver is in open drain mode - */ - /*! \brief 1E.C441.3 R/WPD MDIO Preamble Detection Disable - AQ_GlobalGeneralProvisioning_HHD.u1.bits_1.mdioPreambleDetectionDisable - - Provisionable Default = 0x0 - - 1 = Suppress preamble detection on MDIO - 0 = Enable preamble detection on MDIO - - */ - unsigned int mdioPreambleDetectionDisable : 1; /* 1E.C441.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = Suppress preamble detection on MDIO - 0 = Enable preamble detection on MDIO - */ - unsigned int reserved2 : 1; - unsigned int reserved3 : 2; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C442.0 R/W Daisy Chain Reset - AQ_GlobalGeneralProvisioning_HHD.u2.bits_2.daisyChainReset - - Default = 0x0 - - 1 = Reset the daisy chain - - - Notes: - Toggling this bit from 0 to 1 will reload the IRAM and DRAM and reset the uP. The uP will be in uP run stall during the reload process. After the reload process, uP run stall will be de-asserted and the uP reset will be asserted. Note that before setting this bit, the See Soft Reset bit needs to be de-asserted. */ - unsigned int daisyChainReset : 1; /* 1E.C442.0 R/W Default = 0x0 */ - /* 1 = Reset the daisy chain - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 11; - /*! \brief 1E.C447.4:0 R/WPD MDIO Broadcast Address Configuration [4:0] - AQ_GlobalGeneralProvisioning_HHD.u7.bits_7.mdioBroadcastAddressConfiguration - - Provisionable Default = 0x1F - - Broadcast address - - - Notes: - Allows setting the broadcast address. By default this is set to 0x1F */ - unsigned int mdioBroadcastAddressConfiguration : 5; /* 1E.C447.4:0 R/WPD Provisionable Default = 0x1F */ - /* Broadcast address - */ - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 16; - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of Global General Provisioning */ - union - { - struct - { - unsigned int reserved0 : 9; - /*! \brief 1E.C449.6:0 R/W MDIO Preamble Length [6:0] - AQ_GlobalGeneralProvisioning_HHD.u9.bits_9.mdioPreambleLength - - Default = 0x02 - - MDIO Preamble Length - - */ - unsigned int mdioPreambleLength : 7; /* 1E.C449.6:0 R/W Default = 0x02 */ - /* MDIO Preamble Length - */ - } bits_9; - uint16_t word_9; - } u9; -} AQ_GlobalGeneralProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global NVR Provisioning: 1E.C450 */ -/* Global NVR Provisioning: 1E.C450 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global NVR Provisioning */ - union - { - struct - { - unsigned int reserved0 : 5; - /*! \brief 1E.C450.A:8 R/WPD NVR Data Length [2:0] - AQ_GlobalNvrProvisioning_HHD.u0.bits_0.nvrDataLength - - Provisionable Default = 0x4 - - NVR data length ranges from 0 bytes to 4 bytes - - - Notes: - This sets the length of the data burst used in read and write operations. - */ - unsigned int nvrDataLength : 3; /* 1E.C450.A:8 R/WPD Provisionable Default = 0x4 */ - /* NVR data length ranges from 0 bytes to 4 bytes - */ - unsigned int reserved1 : 1; - /*! \brief 1E.C450.6:4 R/WPD NVR Dummy Length [2:0] - AQ_GlobalNvrProvisioning_HHD.u0.bits_0.nvrDummyLength - - Provisionable Default = 0x0 - - NVR dummy length ranges from 0 bytes to 4 bytes - - - Notes: - This sets the length of the dummy field used in some manufacturer's read status and write status operations. - */ - unsigned int nvrDummyLength : 3; /* 1E.C450.6:4 R/WPD Provisionable Default = 0x0 */ - /* NVR dummy length ranges from 0 bytes to 4 bytes - */ - unsigned int reserved2 : 2; - /*! \brief 1E.C450.1:0 R/WPD NVR Address Length [1:0] - AQ_GlobalNvrProvisioning_HHD.u0.bits_0.nvrAddressLength - - Provisionable Default = 0x2 - - NVR address length ranges from 0 bytes up to 3 bytes - - - Notes: - This sets the length of the address field used in read and write operations. Use of this field is enabled via Bit 8 of See Global NVR Provisioning 2: Address 1E.C451 . - */ - unsigned int nvrAddressLength : 2; /* 1E.C450.1:0 R/WPD Provisionable Default = 0x2 */ - /* NVR address length ranges from 0 bytes up to 3 bytes - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global NVR Provisioning */ - union - { - struct - { - unsigned int reserved0 : 7; - /*! \brief 1E.C451.8 R/WPD NVR Address Length Override - AQ_GlobalNvrProvisioning_HHD.u1.bits_1.nvrAddressLengthOverride - - Provisionable Default = 0x0 - - 0 = NVR address length is based on the "NVR_SIZE" pin. - 1 = NVR address length is based on the See NVR Address Length [1:0] register - - - Notes: - When this bit = 0 and NVR_SIZE pin = 0, the NVR address length is 2 bytes. When this bit = 0 and the NVR_SIZE pin = 1, the NVR address length is 3 bytes. When this bit = 1 the NVR address length is from the See NVR Address Length [1:0] */ - unsigned int nvrAddressLengthOverride : 1; /* 1E.C451.8 R/WPD Provisionable Default = 0x0 */ - /* 0 = NVR address length is based on the "NVR_SIZE" pin. - 1 = NVR address length is based on the See NVR Address Length [1:0] register - */ - /*! \brief 1E.C451.7:0 R/WPD NVR Clock Divide [7:0] - AQ_GlobalNvrProvisioning_HHD.u1.bits_1.nvrClockDivide - - Provisionable Default = 0xA0 - - NVR clock divide. Clock frequency is divided by the NVR clock divide + 1 - - */ - unsigned int nvrClockDivide : 8; /* 1E.C451.7:0 R/WPD Provisionable Default = 0xA0 */ - /* NVR clock divide. Clock frequency is divided by the NVR clock divide + 1 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global NVR Provisioning */ - union - { - struct - { - unsigned int reserved0 : 14; - /*! \brief 1E.C452.1 R/W NVR Daisy Chain Clock Divide Override - AQ_GlobalNvrProvisioning_HHD.u2.bits_2.nvrDaisyChainClockDivideOverride - - Default = 0x0 - - 1 = Override NVR clock divide when in daisy chain master mode - - - Notes: - When in daisy chain master mode, the clock divide configuration is received from the FLASH. This bit will override the clock divide configuration from the FLASH with the See NVR Clock Divide [7:0] . */ - unsigned int nvrDaisyChainClockDivideOverride : 1; /* 1E.C452.1 R/W Default = 0x0 */ - /* 1 = Override NVR clock divide when in daisy chain master mode - */ - /*! \brief 1E.C452.0 R/W NVR Daisy Chain Disable - AQ_GlobalNvrProvisioning_HHD.u2.bits_2.nvrDaisyChainDisable - - Default = 0x0 - - 1 = Disable the Daisy Chain - - - Notes: - When in daisy chain master mode, the daisy chain and MDIO can both access the SPI. Setting this bit to 1 will disable the daisy chain from accessing the SPI and force it into a reset state. */ - unsigned int nvrDaisyChainDisable : 1; /* 1E.C452.0 R/W Default = 0x0 */ - /* 1 = Disable the Daisy Chain - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global NVR Provisioning */ - union - { - struct - { - unsigned int reserved0 : 11; - /*! \brief 1E.C453.4 R/W NVR Reset - AQ_GlobalNvrProvisioning_HHD.u3.bits_3.nvrReset - - Default = 0x0 - - 1 = Reset SPI - - */ - unsigned int nvrReset : 1; /* 1E.C453.4 R/W Default = 0x0 */ - /* 1 = Reset SPI - */ - unsigned int reserved1 : 4; - } bits_3; - uint16_t word_3; - } u3; -} AQ_GlobalNvrProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reserved Provisioning: 1E.C470 */ -/* Global Reserved Provisioning: 1E.C470 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C470.F R/WPD Diagnostics Select - AQ_GlobalReservedProvisioning_HHD.u0.bits_0.diagnosticsSelect - - Provisionable Default = 0x0 - - 1 = Provide Extended MDI Diagnostics Information. - 0 = Provide normal cable diagnostics - - - Notes: - These bits select what sort of cable diagnostics to perform. For regular cable diagnostics, Bit F is set to zero, and the diagnostics are triggered by setting Bit 4. For extended diagnostics, Bit F is set to 1, and the desired extended diagnostics are selected by Bits E:D. The routine is then triggered by setting Bit 4. Each of the extended diagnostic routines present data for all for MDI pairs (A, B, C, D) consecutively, and after the data for each channel is gathered Bits F:D are reset. To get the data for the next pair, Bits F:D must be set back to the desired value (which must be the same as the initial channel). This continues until the data for all channels has been gathered. The address in memory where the data is stored is given in 1E.C802 and 1E.C804. - - For the case of PSD, the structure is as follows: - Int32 info - Int16 data[Len] - Info = Len << 16 | TxEnable << 8 | Pair (0 = A, etc.) - - For TDR: - Int32 info - Int16 tdr_A[Len] - Int16 tdr_B[Len] - Int16 tdr_C[Len] - Int16 tdr_D[Len] - - Info = Len << 16 | Channel - - TDR data is from the current pair to all other pairs. - - At the end of retrieving extended MDI diag data, the part will be reset. Conversely the only way to exit this routine once it starts is to issue a PMA reset. */ - unsigned int diagnosticsSelect : 1; /* 1E.C470.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Provide Extended MDI Diagnostics Information. - 0 = Provide normal cable diagnostics - */ - /*! \brief 1E.C470.E:D R/WPD Extended MDI Diagnostics Select [1:0] - AQ_GlobalReservedProvisioning_HHD.u0.bits_0.extendedMdiDiagnosticsSelect - - Provisionable Default = 0x0 - - 0x0 = TDR Data - 0x1 = RFI Channel PSD - 0x2 = Noise PSD while the local Tx is Off - 0x3 = Noise PSD while the local Tx is On - - - Notes: - These bits select what sort of cable diagnostics to perform. For regular cable diagnostics, Bit F is set to zero, and the diagnostics are triggered by setting Bit 4. For extended diagnostics, Bit F is set to 1, and the desired extended diagnostics are selected by Bits E:D. The routine is then triggered by setting Bit 4. Each of the extended diagnostic routines present data for all for MDI pairs (A, B, C, D) consecutively, and after the data for each channel is gathered Bits F:D are reset. To get the data for the next pair, Bits F:D must be set back to the desired value (which must be the same as the initial channel). This continues until the data for all channels has been gathered. The address in memory where the data is stored is given in 1E.C802 and 1E.C804. - - For the case of PSD, the structure is as follows: - Int32 info - Int16 data[Len] - Info = Len << 16 | TxEnable << 8 | Pair (0 = A, etc.) - - For TDR: - Int32 info - Int16 tdr_A[Len] - Int16 tdr_B[Len] - Int16 tdr_C[Len] - Int16 tdr_D[Len] - - Info = Len << 16 | Channel - - TDR data is from the current pair to all other pairs. - - At the end of retrieving extended MDI diag data, the part will be reset. Conversely the only way to exit this routine once it starts is to issue a PMA reset. */ - unsigned int extendedMdiDiagnosticsSelect : 2; /* 1E.C470.E:D R/WPD Provisionable Default = 0x0 */ - /* 0x0 = TDR Data - 0x1 = RFI Channel PSD - 0x2 = Noise PSD while the local Tx is Off - 0x3 = Noise PSD while the local Tx is On - */ - unsigned int reserved0 : 5; - unsigned int reserved1 : 3; - /*! \brief 1E.C470.4 R/WSC Initiate Cable Diagnostics - AQ_GlobalReservedProvisioning_HHD.u0.bits_0.initiateCableDiagnostics - - Default = 0x0 - - 1 = Perform cable diagnostics - - - Notes: - Perform cable diagnostics regardless of link state. If link is up, setting this bit will cause the link to drop while diagnostics are performed. This bit is self-clearing upon completion of the cable diagnostics. - - NOTE!! This is a processor intensive operation. Completion of this operation can also be monitored via 1E.C831.F */ - unsigned int initiateCableDiagnostics : 1; /* 1E.C470.4 R/WSC Default = 0x0 */ - /* 1 = Perform cable diagnostics - */ - unsigned int reserved2 : 4; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved0 : 9; - /*! \brief 1E.C471.6 R/WuP Enable Daisy-Chain Hop-Count Override - AQ_GlobalReservedProvisioning_HHD.u1.bits_1.enableDaisy_chainHop_countOverride - - Default = 0x0 - - 1 = Hop-count is set by Bits 5:0 - 0 = Hop-count is determined by the daisy-chain - - - Notes: - Daisy-Chain Hop-Count Override should be used during MDIO boot-load operation, as the daisy-chain hop-count does not function when the daisy-chain is disabled (1E.C452.0). Setting this bit tells the processor where in the daisy-chain it is, so that the provisioning operation will function correctly. */ - unsigned int enableDaisy_chainHop_countOverride : 1; /* 1E.C471.6 R/WuP Default = 0x0 */ - /* 1 = Hop-count is set by Bits 5:0 - 0 = Hop-count is determined by the daisy-chain - */ - /*! \brief 1E.C471.5:0 R/WuP Daisy-Chain Hop-Count Override Value [5:0] - AQ_GlobalReservedProvisioning_HHD.u1.bits_1.daisy_chainHop_countOverrideValue - - Default = 0x00 - - The value to use for the PHY's daisy-chain hop-count. Valid values are from 0 -> 47 - - - Notes: - Daisy-Chain Hop-Count Override should be used during MDIO boot-load operation, as the daisy-chain hop-count does not function when the daisy-chain is disabled (1E.C452.0). Setting this bit tells the processor where in the daisy-chain it is, so that the provisioning operation will function correctly. */ - unsigned int daisy_chainHop_countOverrideValue : 6; /* 1E.C471.5:0 R/WuP Default = 0x00 */ - /* The value to use for the PHY's daisy-chain hop-count. Valid values are from 0 -> 47 - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C472.E R/WPD Enable VDD Power Supply Tuning - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.enableVddPowerSupplyTuning - - Provisionable Default = 0x0 - - 1 = Enable external VDD power supply tuning - 0 = Disable external VDD power supply tuning is disabled - - - Notes: - This bit controls whether the PHY attempts to tune the external VDD power supply via the SMBus. This bit is only operational if the external supply is present. (See 1E.C472.6) */ - unsigned int enableVddPowerSupplyTuning : 1; /* 1E.C472.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable external VDD power supply tuning - 0 = Disable external VDD power supply tuning is disabled - */ - unsigned int reserved1 : 7; - /*! \brief 1E.C472.6 R/WPD Tunable External VDD Power Supply Present - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.tunableExternalVddPowerSupplyPresent - - Provisionable Default = 0x0 - - 1 = Tunable external VDD power supply present - 0 = No tunable external VDD power supply present - - - Notes: - This bit must be set if tuning of external power supply is desired. */ - unsigned int tunableExternalVddPowerSupplyPresent : 1; /* 1E.C472.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Tunable external VDD power supply present - 0 = No tunable external VDD power supply present - */ - /*! \brief 1E.C472.5:2 R/WPD External VDD Change Request [3:0] - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.externalVddChangeRequest - - Provisionable Default = 0x0 - - The amount of VDD change requested by firmware, in mV (2's complement value). - - */ - unsigned int externalVddChangeRequest : 4; /* 1E.C472.5:2 R/WPD Provisionable Default = 0x0 */ - /* The amount of VDD change requested by firmware, in mV (2's complement value). - */ - /*! \brief 1E.C472.1 R/WPDuP Enable XENPAK Register Space - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.enableXenpakRegisterSpace - - Provisionable Default = 0x0 - - 1 = XENPAK register space enabled - 0 = XENPAK register space disabled - - */ - unsigned int enableXenpakRegisterSpace : 1; /* 1E.C472.1 R/WPDuP Provisionable Default = 0x0 */ - /* 1 = XENPAK register space enabled - 0 = XENPAK register space disabled - */ - /*! \brief 1E.C472.0 R/WPDuP Enable 5th Channel RFI Cancellation - AQ_GlobalReservedProvisioning_HHD.u2.bits_2.enable_5thChannelRfiCancellation - - Provisionable Default = 0x0 - - 1 = 5th channel and RFI cancellers operation enabled - 0 = 5th channel AFE is powered down, 5th channel digital is clock gated, RFI cancellers are disabled - - - Notes: - Note: The value of this bit at the time of Autonegotiation sets the local PHY behavior until the next time Autonegotiation occurs. */ - unsigned int enable_5thChannelRfiCancellation : 1; /* 1E.C472.0 R/WPDuP Provisionable Default = 0x0 */ - /* 1 = 5th channel and RFI cancellers operation enabled - 0 = 5th channel AFE is powered down, 5th channel digital is clock gated, RFI cancellers are disabled - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved0 : 5; - /*! \brief 1E.C473.A:8 R/WPD Rate Transition Request [2:0] - AQ_GlobalReservedProvisioning_HHD.u3.bits_3.rateTransitionRequest - - Provisionable Default = 0x0 - - 0 = No Transition - 1 = Reserved - 2 = Reserved - 3 = Retrain at 10G - 4 = Retrain at 5G - 5 = Retrain at 2.5G - 6 = Retrain at 1G - 7 = Reserved - - */ - unsigned int rateTransitionRequest : 3; /* 1E.C473.A:8 R/WPD Provisionable Default = 0x0 */ - /* 0 = No Transition - 1 = Reserved - 2 = Reserved - 3 = Retrain at 10G - 4 = Retrain at 5G - 5 = Retrain at 2.5G - 6 = Retrain at 1G - 7 = Reserved - */ - /*! \brief 1E.C473.7:0 R/WPD Training SNR [7:0] - AQ_GlobalReservedProvisioning_HHD.u3.bits_3.trainingSNR - - Provisionable Default = 0x00 - - SNR during 10G training on the worst channel. SNR is in steps of 0.1dB - - - Notes: - The SNR margin that is enjoyed by the worst channel, over and above the minimum SNR required to operate at a BER of 10-12. It is reported with 0.1 dB of resolution to an accuracy of 0.5 dB within the range of -12.7 dB to 12.7 dB. The number is in offset binary, with 0.0 dB represented by 0x8000. */ - unsigned int trainingSNR : 8; /* 1E.C473.7:0 R/WPD Provisionable Default = 0x00 */ - /* SNR during 10G training on the worst channel. SNR is in steps of 0.1dB - */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C474.F:1 R/WPD Reserved Provisioning 5 [F:1] - AQ_GlobalReservedProvisioning_HHD.u4.bits_4.reservedProvisioning_5 - - Provisionable Default = 0x0000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_5 : 15; /* 1E.C474.F:1 R/WPD Provisionable Default = 0x0000 */ - /* Reserved for future use - */ - /*! \brief 1E.C474.0 R/W NVR Daisy Chain Kickstart - AQ_GlobalReservedProvisioning_HHD.u4.bits_4.nvrDaisyChainKickstart - - Default = 0x0 - - 1 = Kickstart the Daisy Chain - - - Notes: - When in daisy chain master mode, the PHY0 can kickstart the daisy chain. The kickstart will not reload the IRAM/DRAM or reset the uP for PHY0. It will just read the FLASH and transfer the FLASH data to the daisy chain. */ - unsigned int nvrDaisyChainKickstart : 1; /* 1E.C474.0 R/W Default = 0x0 */ - /* 1 = Kickstart the Daisy Chain - */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved0 : 2; - /*! \brief 1E.C475.D R/WPD Smart Power-Down Status - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.smartPower_downStatus - - Provisionable Default = 0x0 - - 1 = Smart Power-Down Active - 0 = Smart Power-Down Inactive - - */ - unsigned int smartPower_downStatus : 1; /* 1E.C475.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Smart Power-Down Active - 0 = Smart Power-Down Inactive - */ - /*! \brief 1E.C475.C R/WPD Reserved Provisioning 6 - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.reservedProvisioning_6 - - Provisionable Default = 0x0 - - Internal reserved - do not modify - - */ - unsigned int reservedProvisioning_6 : 1; /* 1E.C475.C R/WPD Provisionable Default = 0x0 */ - /* Internal reserved - do not modify - */ - /*! \brief 1E.C475.B R/WPD CFR LP Disable Timer - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrLpDisableTimer - - Provisionable Default = 0x0 - - 1 = Link partner requires cfr_disable timer - 0 = Link partner does not require cfr_disable timer - - */ - unsigned int cfrLpDisableTimer : 1; /* 1E.C475.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires cfr_disable timer - 0 = Link partner does not require cfr_disable timer - */ - /*! \brief 1E.C475.A R/WPD CFR LP Extended Maxwait - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrLpExtendedMaxwait - - Provisionable Default = 0x0 - - 1 = Link partner requires extended maxwait - 0 = Link partner does not require extended maxwait - - */ - unsigned int cfrLpExtendedMaxwait : 1; /* 1E.C475.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires extended maxwait - 0 = Link partner does not require extended maxwait - */ - /*! \brief 1E.C475.9 R/WPD CFR LP THP - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrLpTHP - - Provisionable Default = 0x0 - - 1 = Link partner requires local PHY to enable THP - 0 = Link partner does not require local PHY to enable THP - - */ - unsigned int cfrLpTHP : 1; /* 1E.C475.9 R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner requires local PHY to enable THP - 0 = Link partner does not require local PHY to enable THP - */ - /*! \brief 1E.C475.8 R/WPD CFR LP Support - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrLpSupport - - Provisionable Default = 0x0 - - 1 = Link partner supports Cisco Fast Retrain - 0 = Link partner does support Cisco Fast Retrain - - */ - unsigned int cfrLpSupport : 1; /* 1E.C475.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Link partner supports Cisco Fast Retrain - 0 = Link partner does support Cisco Fast Retrain - */ - /*! \brief 1E.C475.7 R/WPD CFR Disable Timer - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrDisableTimer - - Provisionable Default = 0x0 - - 1 = Local PHY requires cfr_disable timer - 0 = Local PHY does not require cfr_disable timer - - */ - unsigned int cfrDisableTimer : 1; /* 1E.C475.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires cfr_disable timer - 0 = Local PHY does not require cfr_disable timer - */ - /*! \brief 1E.C475.6 R/WPD CFR Extended Maxwait - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrExtendedMaxwait - - Provisionable Default = 0x0 - - 1 = Local PHY requires extended maxwait - 0 = Local PHY does not require extended maxwait - - */ - unsigned int cfrExtendedMaxwait : 1; /* 1E.C475.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires extended maxwait - 0 = Local PHY does not require extended maxwait - */ - /*! \brief 1E.C475.5 R/WPD CFR THP - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrTHP - - Provisionable Default = 0x0 - - 1 = Local PHY requires local PHY to enable THP - 0 = Local PHY does not require local PHY to enable THP - - */ - unsigned int cfrTHP : 1; /* 1E.C475.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY requires local PHY to enable THP - 0 = Local PHY does not require local PHY to enable THP - */ - /*! \brief 1E.C475.4 R/WPD CFR Support - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.cfrSupport - - Provisionable Default = 0x0 - - 1 = Local PHY supports Cisco Fast Retrain - 0 = Local PHY does support Cisco Fast Retrain - - */ - unsigned int cfrSupport : 1; /* 1E.C475.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = Local PHY supports Cisco Fast Retrain - 0 = Local PHY does support Cisco Fast Retrain - */ - /*! \brief 1E.C475.3 R/WPD Deadlock Avoidance Enable - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.deadlockAvoidanceEnable - - Provisionable Default = 0x0 - - 1 = SPD with deadlock avoidance: PHY transmits autonegotiation pulses (FLPs) at a slower rate (~ 1 FLP/ 100ms) than specified by autonegotiation standard (~1 FLP / 8.25ms). Receiver is active and able to detect the pulses. - 0 = SPD without deadlock avoidance: PHY transmitter is shut down, no autonegotiation pulses are sent on the line but the receiver is active and able to detect the pulses - - */ - unsigned int deadlockAvoidanceEnable : 1; /* 1E.C475.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = SPD with deadlock avoidance: PHY transmits autonegotiation pulses (FLPs) at a slower rate (~ 1 FLP/ 100ms) than specified by autonegotiation standard (~1 FLP / 8.25ms). Receiver is active and able to detect the pulses. - 0 = SPD without deadlock avoidance: PHY transmitter is shut down, no autonegotiation pulses are sent on the line but the receiver is active and able to detect the pulses - */ - /*! \brief 1E.C475.2 R/WPD Smart Power-Down Enable - AQ_GlobalReservedProvisioning_HHD.u5.bits_5.smartPower_downEnable - - Provisionable Default = 0x0 - - 1 = Enable smart power down mode - 0 = Smart power-down mode disabled - - - Notes: - Smart power down (SPD) is the lowest power mode at which PHY is able to autonegotiate. SPD can be enabled with bit 1E.C475.2 */ - unsigned int smartPower_downEnable : 1; /* 1E.C475.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable smart power down mode - 0 = Smart power-down mode disabled - */ - unsigned int reserved1 : 2; - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Dummy union to fill space in the structure Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Dummy union to fill space in the structure Global Reserved Provisioning */ - union - { - struct - { - unsigned int reserved : 16; - } bits_7; - uint16_t word_7; - } u7; - /*! \brief Union for bit and word level access of word 8 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C478.F R/WPD DTE Enable - AQ_GlobalReservedProvisioning_HHD.u8.bits_8.dteEnable - - Provisionable Default = 0x0 - - 1 = Enable DTE - 0 = Disable DTE - - */ - unsigned int dteEnable : 1; /* 1E.C478.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable DTE - 0 = Disable DTE - */ - /*! \brief 1E.C478.E:B R/WPD DTE Drop Reporting Timer [3:0] - AQ_GlobalReservedProvisioning_HHD.u8.bits_8.dteDropReportingTimer - - Provisionable Default = 0x0 - - Number of seconds between loss of link partner filter and assertion of no-power-needed state, in 5 second increments (e.g. 0x4 = 20 seconds). - - - Notes: - These bits are used to set how long the PHY waits after it no longer detects the link partner filter before declaring that power is not needed. */ - unsigned int dteDropReportingTimer : 4; /* 1E.C478.E:B R/WPD Provisionable Default = 0x0 */ - /* Number of seconds between loss of link partner filter and assertion of no-power-needed state, in 5 second increments (e.g. 0x4 = 20 seconds). - */ - /*! \brief 1E.C478.A:0 R/WPD Reserved Provisioning 9 [A:0] - AQ_GlobalReservedProvisioning_HHD.u8.bits_8.reservedProvisioning_9 - - Provisionable Default = 0x000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_9 : 11; /* 1E.C478.A:0 R/WPD Provisionable Default = 0x000 */ - /* Reserved for future use - */ - } bits_8; - uint16_t word_8; - } u8; - /*! \brief Union for bit and word level access of word 9 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C479.F R/WPD Power Up Stall - AQ_GlobalReservedProvisioning_HHD.u9.bits_9.powerUpStall - - Provisionable Default = 0x0 - - 1 = Stall FW at Power Up - 0 = Unstall the FW - - - Notes: - This bit needs to be provisioned in Power Up Init for firmware to stall. */ - unsigned int powerUpStall : 1; /* 1E.C479.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Stall FW at Power Up - 0 = Unstall the FW - */ - /*! \brief 1E.C479.E:0 R/WPD Reserved Provisioning 10 [E:0] - AQ_GlobalReservedProvisioning_HHD.u9.bits_9.reservedProvisioning_10 - - Provisionable Default = 0x0000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_10 : 15; /* 1E.C479.E:0 R/WPD Provisionable Default = 0x0000 */ - /* Reserved for future use - */ - } bits_9; - uint16_t word_9; - } u9; - /*! \brief Union for bit and word level access of word 10 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C47A.F:B R/WPD Loopback Control [4:0] - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.loopbackControl - - Provisionable Default = 0x00 - - 0x00 = No loopback - 0x01 = System Interface - System Loopback - 0x02 = System Interface - System Loopback with Passthrough - 0x03 = System Interface - Network Loopback - 0x04 = System Interface - Network Loopback with Passthrough - 0x05 = System Interface - Network Loopback with Passthrough and Merge - 0x06 = System Interface - Peer-to-peer loopback - 0x07 - 0x08 = Reserved - 0x09 = Network Interface - System Loopback - 0x0A = Network Interface - System Loopback with Passthrough - 0x0B = Network Interface - Network Loopback - 0x0C = Network Interface - Network Loopback with Passthrough - 0x0D = Network Interface - Peer-to-peer loopback - 0x0E - 0x0F = Reserved - 0x10 = Cross-connect System Loopback - 0x11 = Cross-connect Network Loopback - 0x12 - 0x13 = Reserved - 0x14 = Network Interface - System Loopback via Loopback Plug - 0x15 - 0x1F = Reserved - - - Notes: - These bits, in conjunction with the chip configuration and the rate (Bits 1:0), select the loopback to configure for the chip. Setting one of these loopbacks provisions the chip for the specified loopback. Upon clearing the loopback, the chip returns to it's configuration prior to entering loopback (irregardless of whether other loopbacks were selected after the initial loopback). - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F. - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. - */ - unsigned int loopbackControl : 5; /* 1E.C47A.F:B R/WPD Provisionable Default = 0x00 */ - /* 0x00 = No loopback - 0x01 = System Interface - System Loopback - 0x02 = System Interface - System Loopback with Passthrough - 0x03 = System Interface - Network Loopback - 0x04 = System Interface - Network Loopback with Passthrough - 0x05 = System Interface - Network Loopback with Passthrough and Merge - 0x06 = System Interface - Peer-to-peer loopback - 0x07 - 0x08 = Reserved - 0x09 = Network Interface - System Loopback - 0x0A = Network Interface - System Loopback with Passthrough - 0x0B = Network Interface - Network Loopback - 0x0C = Network Interface - Network Loopback with Passthrough - 0x0D = Network Interface - Peer-to-peer loopback - 0x0E - 0x0F = Reserved - 0x10 = Cross-connect System Loopback - 0x11 = Cross-connect Network Loopback - 0x12 - 0x13 = Reserved - 0x14 = Network Interface - System Loopback via Loopback Plug - 0x15 - 0x1F = Reserved - */ - /*! \brief 1E.C47A.A:6 R/WPD Reserved Provisioning 11 [4:0] - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.reservedProvisioning_11 - - Provisionable Default = 0x00 - - Reserved for future use - - */ - unsigned int reservedProvisioning_11 : 5; /* 1E.C47A.A:6 R/WPD Provisionable Default = 0x00 */ - /* Reserved for future use - */ - /*! \brief 1E.C47A.5 R/WPD MDI Packet Generation - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.mdiPacketGeneration - - Provisionable Default = 0x0 - - 1 = CRPAT packet generation out MDI interface - 0 = No CRPAT packet generation out MDI interface - - - Notes: - Selecting this mode of operation causes the CRPAT packet generator in the PHY to output on the MDI interface at the selected rate. - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. */ - unsigned int mdiPacketGeneration : 1; /* 1E.C47A.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = CRPAT packet generation out MDI interface - 0 = No CRPAT packet generation out MDI interface - */ - /*! \brief 1E.C47A.4 R/WPD Look-Aside Port Packet Generation - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.look_asidePortPacketGeneration - - Provisionable Default = 0x0 - - 1 = CRPAT packet generation out 10G look-aside interface (KR0) - 0 = No CRPAT packet generation out 10G look-aside interface (KR0) - - - Notes: - Selecting this mode of operation causes the CRPAT packet generator in the PHY to output on KR0. - - NOTE!! This only functions if KR1 (SERDES2) is selected as the system interface in (4.C441.F:E). - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. */ - unsigned int look_asidePortPacketGeneration : 1; /* 1E.C47A.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = CRPAT packet generation out 10G look-aside interface (KR0) - 0 = No CRPAT packet generation out 10G look-aside interface (KR0) - */ - /*! \brief 1E.C47A.3 R/WPD System I/F Packet Generation - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.systemI_fPacketGeneration - - Provisionable Default = 0x0 - - 1 = CRPAT packet generation out 10G system interface - 0 = No CRPAT packet generation out 10G system interface - - - Notes: - Selecting this mode of operation causes the CRPAT packet generator in the PHY to output CRPAT packets on the selected 10G system interface (4.C441.F:E) - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. */ - unsigned int systemI_fPacketGeneration : 1; /* 1E.C47A.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = CRPAT packet generation out 10G system interface - 0 = No CRPAT packet generation out 10G system interface - */ - /*! \brief 1E.C47A.2 R/WPD Reserved Provisioning 11a - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.reservedProvisioning_11a - - Provisionable Default = 0x0 - - Reserved for future use - - */ - unsigned int reservedProvisioning_11a : 1; /* 1E.C47A.2 R/WPD Provisionable Default = 0x0 */ - /* Reserved for future use - */ - /*! \brief 1E.C47A.1:0 R/WPD Rate [1:0] - AQ_GlobalReservedProvisioning_HHD.u10.bits_10.rate - - Provisionable Default = 0x0 - - 0x3 = 10G - 0x2 = 1G - 0x1 = 100M - 0x0 = reserved - - - Notes: - These bits select the rate for the loopback and packet generation. SERDES configuration, as well autonegotiation is controlled accordingly when a loopback is selected. For instance, if 100M system loopback on the network interface is selected, SGMII on the system interface is enabled to connect at 100M, and if passthrough is enabled 100BASE-TX will be the only advertised rate and will force a re-autonegotiation if not already connected at 100M. - - NOTE!! This is a processor intensive operation. Completion of this operation can be monitored via 1E.C831.F - - The controls in this register are identical to, and mirrored with, the controls in 4.C444. */ - unsigned int rate : 2; /* 1E.C47A.1:0 R/WPD Provisionable Default = 0x0 */ - /* 0x3 = 10G - 0x2 = 1G - 0x1 = 100M - 0x0 = reserved - */ - } bits_10; - uint16_t word_10; - } u10; - /*! \brief Union for bit and word level access of word 11 of Global Reserved Provisioning */ - union - { - struct - { - /*! \brief 1E.C47B.F:2 R/WPD Reserved Provisioning 12 [D:0] - AQ_GlobalReservedProvisioning_HHD.u11.bits_11.reservedProvisioning_12 - - Provisionable Default = 0x0000 - - Reserved for future use - - */ - unsigned int reservedProvisioning_12 : 14; /* 1E.C47B.F:2 R/WPD Provisionable Default = 0x0000 */ - /* Reserved for future use - */ - /*! \brief 1E.C47B.1 R/WPD Enable MACSec - AQ_GlobalReservedProvisioning_HHD.u11.bits_11.enableMacsec - - Provisionable Default = 0x0 - - 1 = MACSec functionality is enabled - 0 = MACSec functionality is disabled - - - Notes: - If this bit is 1, the PTP/SEC block will be included in the data path, regardless of operating mode. */ - unsigned int enableMacsec : 1; /* 1E.C47B.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = MACSec functionality is enabled - 0 = MACSec functionality is disabled - */ - /*! \brief 1E.C47B.0 R/WPD Enable PTP - AQ_GlobalReservedProvisioning_HHD.u11.bits_11.enablePtp - - Provisionable Default = 0x0 - - 1 = PTP functionality is enabled - 0 = PTP functionality is disabled - - - Notes: - If this bit is 1, the PTP/SEC block will be included in the data path, regardless of operating mode. */ - unsigned int enablePtp : 1; /* 1E.C47B.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = PTP functionality is enabled - 0 = PTP functionality is disabled - */ - } bits_11; - uint16_t word_11; - } u11; -} AQ_GlobalReservedProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief PIF Mailbox Control: 1E.C47C */ -/* PIF Mailbox Control: 1E.C47C */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of PIF Mailbox Control */ - union - { - struct - { - /*! \brief 1E.C47C.F:0 R/WPDuP PIF Mailbox Address [F:0] - AQ_PifMailboxControl_HHD.u0.bits_0.pifMailboxAddress - - Provisionable Default = 0x0000 - - The least 16 bits of the PIF address to read or write. - - */ - unsigned int pifMailboxAddress : 16; /* 1E.C47C.F:0 R/WPDuP Provisionable Default = 0x0000 */ - /* The least 16 bits of the PIF address to read or write. - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of PIF Mailbox Control */ - union - { - struct - { - /*! \brief 1E.C47D.F:0 R/WPDuP PIF Mailbox Data [F:0] - AQ_PifMailboxControl_HHD.u1.bits_1.pifMailboxData - - Provisionable Default = 0x0000 - - The data to be written, or that had been read. - - */ - unsigned int pifMailboxData : 16; /* 1E.C47D.F:0 R/WPDuP Provisionable Default = 0x0000 */ - /* The data to be written, or that had been read. - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of PIF Mailbox Control */ - union - { - struct - { - /*! \brief 1E.C47E.F:C R/WPD Reserved PIF Mailbox Control 3 [3:0] - AQ_PifMailboxControl_HHD.u2.bits_2.reservedPifMailboxControl_3 - - Provisionable Default = 0x0 - - Reserved for future use - - */ - unsigned int reservedPifMailboxControl_3 : 4; /* 1E.C47E.F:C R/WPD Provisionable Default = 0x0 */ - /* Reserved for future use - */ - /*! \brief 1E.C47E.B:8 R/WPDuP PIF Mailbox Command Type [3:0] - AQ_PifMailboxControl_HHD.u2.bits_2.pifMailboxCommandType - - Provisionable Default = 0x0 - - 0 = No Action - 1 = Read - 2 = Write - - - Notes: - System SW writes non-zero value to start a PIF command. */ - unsigned int pifMailboxCommandType : 4; /* 1E.C47E.B:8 R/WPDuP Provisionable Default = 0x0 */ - /* 0 = No Action - 1 = Read - 2 = Write - */ - /*! \brief 1E.C47E.7:0 R/WPDuP PIF Mailbox MMD [7:0] - AQ_PifMailboxControl_HHD.u2.bits_2.pifMailboxMMD - - Provisionable Default = 0x00 - - MMD (upper 8 bits) of the PID address to read or write. - - */ - unsigned int pifMailboxMMD : 8; /* 1E.C47E.7:0 R/WPDuP Provisionable Default = 0x00 */ - /* MMD (upper 8 bits) of the PID address to read or write. - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of PIF Mailbox Control */ - union - { - struct - { - /*! \brief 1E.C47F.F:4 R/WPD Reserved PIF Mailbox Control 4 [B:0] - AQ_PifMailboxControl_HHD.u3.bits_3.reservedPifMailboxControl_4 - - Provisionable Default = 0x000 - - Reserved for future use - - */ - unsigned int reservedPifMailboxControl_4 : 12; /* 1E.C47F.F:4 R/WPD Provisionable Default = 0x000 */ - /* Reserved for future use - */ - /*! \brief 1E.C47F.3:0 R/WPDuP PIF Mailbox Command Status [3:0] - AQ_PifMailboxControl_HHD.u3.bits_3.pifMailboxCommandStatus - - Provisionable Default = 0x0 - - 0 = Idle - 1 = Command completed - 2 = Command did not complete - - - Notes: - System SW should write 0 before writing Command Type to clear completion status */ - unsigned int pifMailboxCommandStatus : 4; /* 1E.C47F.3:0 R/WPDuP Provisionable Default = 0x0 */ - /* 0 = Idle - 1 = Command completed - 2 = Command did not complete - */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_PifMailboxControl_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global SMBus 0 Provisioning: 1E.C485 */ -/* Global SMBus 0 Provisioning: 1E.C485 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global SMBus 0 Provisioning */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.C485.7:1 R/W SMB 0 Slave Address [7:1] - AQ_GlobalSmbus_0Provisioning_HHD.u0.bits_0.smb_0SlaveAddress - - Default = 0x00 - - SMB slave address configuration - - */ - unsigned int smb_0SlaveAddress : 7; /* 1E.C485.7:1 R/W Default = 0x00 */ - /* SMB slave address configuration - */ - unsigned int reserved1 : 1; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalSmbus_0Provisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global SMBus 1 Provisioning: 1E.C495 */ -/* Global SMBus 1 Provisioning: 1E.C495 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global SMBus 1 Provisioning */ - union - { - struct - { - unsigned int reserved0 : 8; - /*! \brief 1E.C495.7:1 R/W SMB 1 Slave Address [7:1] - AQ_GlobalSmbus_1Provisioning_HHD.u0.bits_0.smb_1SlaveAddress - - Default = 0x00 - - SMB slave address configuration - - */ - unsigned int smb_1SlaveAddress : 7; /* 1E.C495.7:1 R/W Default = 0x00 */ - /* SMB slave address configuration - */ - unsigned int reserved1 : 1; - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalSmbus_1Provisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global EEE Provisioning: 1E.C4A0 */ -/* Global EEE Provisioning: 1E.C4A0 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global EEE Provisioning */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C4A0.0 R/WPD EEE Mode - AQ_GlobalEeeProvisioning_HHD.u0.bits_0.eeeMode - - Provisionable Default = 0x0 - - 1 = EEE mode of operation - - - Notes: - EEE mode of operation (0=disable, 1=enable, default:0) */ - unsigned int eeeMode : 1; /* 1E.C4A0.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = EEE mode of operation - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalEeeProvisioning_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Cable Diagnostic Status: 1E.C800 */ -/* Global Cable Diagnostic Status: 1E.C800 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Cable Diagnostic Status */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C800.E:C RO Pair A Status [2:0] - AQ_GlobalCableDiagnosticStatus_HHD.u0.bits_0.pairAStatus - - - - [F:D] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair D - 010= Connected to Pair C - 001= Connected to Pair B - 000= OK - - Notes: - This register summarizes the worst impairment on Pair A. */ - unsigned int pairAStatus : 3; /* 1E.C800.E:C RO */ - /* [F:D] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair D - 010= Connected to Pair C - 001= Connected to Pair B - 000= OK */ - unsigned int reserved1 : 1; - /*! \brief 1E.C800.A:8 RO Pair B Status [2:0] - AQ_GlobalCableDiagnosticStatus_HHD.u0.bits_0.pairBStatus - - - - [C:A] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair A - 010= Connected to Pair D - 001= Connected to Pair C - 000= OK - - Notes: - This register summarizes the worst impairment on Pair B. */ - unsigned int pairBStatus : 3; /* 1E.C800.A:8 RO */ - /* [C:A] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair A - 010= Connected to Pair D - 001= Connected to Pair C - 000= OK */ - unsigned int reserved2 : 1; - /*! \brief 1E.C800.6:4 RO Pair C Status [2:0] - AQ_GlobalCableDiagnosticStatus_HHD.u0.bits_0.pairCStatus - - - - [9:7] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair B - 010= Connected to Pair A - 001= Connected to Pair D - 000= OK - - Notes: - This register summarizes the worst impairment on Pair C. */ - unsigned int pairCStatus : 3; /* 1E.C800.6:4 RO */ - /* [9:7] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair B - 010= Connected to Pair A - 001= Connected to Pair D - 000= OK */ - unsigned int reserved3 : 1; - /*! \brief 1E.C800.2:0 RO Pair D Status [2:0] - AQ_GlobalCableDiagnosticStatus_HHD.u0.bits_0.pairDStatus - - - - [6:4] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair C - 010= Connected to Pair B - 001= Connected to Pair A - 000= OK - - Notes: - This register summarizes the worst impairment on Pair D. */ - unsigned int pairDStatus : 3; /* 1E.C800.2:0 RO */ - /* [6:4] - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 011= Connected to Pair C - 010= Connected to Pair B - 001= Connected to Pair A - 000= OK */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C801.F:8 RO Pair A Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u1.bits_1.pairAReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair A - - Notes: - The distance to this reflection is given in See Global Reserved Status 1: Address 1E.C870 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairAReflection_1 : 8; /* 1E.C801.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair A */ - /*! \brief 1E.C801.7:0 RO Pair A Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u1.bits_1.pairAReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair A - - Notes: - The distance to this reflection is given in See Global Reserved Status 1: Address 1E.C870 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairAReflection_2 : 8; /* 1E.C801.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair A */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C802.F:0 RO Impulse Response MSW [F:0] - AQ_GlobalCableDiagnosticStatus_HHD.u2.bits_2.impulseResponseMSW - - - - The MSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type in 1E.C470.E:D - - Notes: - See 1E.C470 for more information */ - unsigned int impulseResponseMSW : 16; /* 1E.C802.F:0 RO */ - /* The MSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type in 1E.C470.E:D */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C803.F:8 RO Pair B Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u3.bits_3.pairBReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair B - - Notes: - The distance to this reflection is given in See Global Reserved Status 2: Address 1E.C871 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairBReflection_1 : 8; /* 1E.C803.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair B */ - /*! \brief 1E.C803.7:0 RO Pair B Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u3.bits_3.pairBReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair B - - Notes: - The distance to this reflection is given in See Global Reserved Status 2: Address 1E.C871 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairBReflection_2 : 8; /* 1E.C803.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair B */ - } bits_3; - uint16_t word_3; - } u3; - /*! \brief Union for bit and word level access of word 4 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C804.F:0 RO Impulse Response LSW [F:0] - AQ_GlobalCableDiagnosticStatus_HHD.u4.bits_4.impulseResponseLSW - - - - The LSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type specified in 1E.C470.E:D - - Notes: - See 1E.C470 for more information */ - unsigned int impulseResponseLSW : 16; /* 1E.C804.F:0 RO */ - /* The LSW of the memory location that contains the start of the impulse response data for the Extended Diagnostic type specified in 1E.C470.E:D */ - } bits_4; - uint16_t word_4; - } u4; - /*! \brief Union for bit and word level access of word 5 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C805.F:8 RO Pair C Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u5.bits_5.pairCReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair C - - Notes: - The distance to this reflection is given in See Global Reserved Status 3: Address 1E.C872 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairCReflection_1 : 8; /* 1E.C805.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair C */ - /*! \brief 1E.C805.7:0 RO Pair C Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u5.bits_5.pairCReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair C - - Notes: - The distance to this reflection is given in See Global Reserved Status 3: Address 1E.C872 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairCReflection_2 : 8; /* 1E.C805.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair C */ - } bits_5; - uint16_t word_5; - } u5; - /*! \brief Union for bit and word level access of word 6 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C806.F:0 RO Reserved 1 [F:0] - AQ_GlobalCableDiagnosticStatus_HHD.u6.bits_6.reserved_1 - - - - Reserved for future use - */ - unsigned int reserved_1 : 16; /* 1E.C806.F:0 RO */ - /* Reserved for future use */ - } bits_6; - uint16_t word_6; - } u6; - /*! \brief Union for bit and word level access of word 7 of Global Cable Diagnostic Status */ - union - { - struct - { - /*! \brief 1E.C807.F:8 RO Pair D Reflection #1 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u7.bits_7.pairDReflection_1 - - - - The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair D - - Notes: - The distance to this reflection is given in See Global Reserved Status 4: Address 1E.C873 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairDReflection_1 : 8; /* 1E.C807.F:8 RO */ - /* The distance in meters, accurate to 1m, of the first of the four worst reflections seen by the PHY on Pair D */ - /*! \brief 1E.C807.7:0 RO Pair D Reflection #2 [7:0] - AQ_GlobalCableDiagnosticStatus_HHD.u7.bits_7.pairDReflection_2 - - - - The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair D - - Notes: - The distance to this reflection is given in See Global Reserved Status 4: Address 1E.C873 . A value of zero indicates that this reflection does not exist or was not computed. */ - unsigned int pairDReflection_2 : 8; /* 1E.C807.7:0 RO */ - /* The distance in meters, accurate to 1m, of the second of the four worst reflections seen by the PHY on Pair D */ - } bits_7; - uint16_t word_7; - } u7; -} AQ_GlobalCableDiagnosticStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Thermal Status: 1E.C820 */ -/* Global Thermal Status: 1E.C820 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Thermal Status */ - union - { - struct - { - /*! \brief 1E.C820.F:0 RO Temperature [F:0] - AQ_GlobalThermalStatus_HHD.u0.bits_0.temperature - - - - [F:0] of temperature - - - Notes: - 2's complement value with the LSB representing 1/256 of a degree Celsius. This corresponds to -40 degreesC = 0xD800. Default is 70 degreesC. This is a mirror of the XENPAK register 1.A060 - 1.A061. The mirror is performed in H/W. */ - unsigned int temperature : 16; /* 1E.C820.F:0 RO */ - /* [F:0] of temperature - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Thermal Status */ - union - { - struct - { - unsigned int reserved0 : 15; - /*! \brief 1E.C821.0 RO Temperature Ready - AQ_GlobalThermalStatus_HHD.u1.bits_1.temperatureReady - - - - 1 = Temperature measurement is valid - - - Notes: - This is a mirror of the XENPAK register 1.A06E. */ - unsigned int temperatureReady : 1; /* 1E.C821.0 RO */ - /* 1 = Temperature measurement is valid - */ - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalThermalStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global General Status: 1E.C830 */ -/* Global General Status: 1E.C830 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global General Status */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.C830.E RO High Temperature Failure State - AQ_GlobalGeneralStatus_HHD.u0.bits_0.highTemperatureFailureState - - - - 1 = High temperature failure threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A070.7 register. - - */ - unsigned int highTemperatureFailureState : 1; /* 1E.C830.E RO */ - /* 1 = High temperature failure threshold has been exceeded */ - /*! \brief 1E.C830.D RO Low Temperature Failure State - AQ_GlobalGeneralStatus_HHD.u0.bits_0.lowTemperatureFailureState - - - - 1 = Low temperature failure threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A070.6 register. - - */ - unsigned int lowTemperatureFailureState : 1; /* 1E.C830.D RO */ - /* 1 = Low temperature failure threshold has been exceeded */ - /*! \brief 1E.C830.C RO High Temperature Warning State - AQ_GlobalGeneralStatus_HHD.u0.bits_0.highTemperatureWarningState - - - - 1 = High temperature warning threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A074.7 register. - - */ - unsigned int highTemperatureWarningState : 1; /* 1E.C830.C RO */ - /* 1 = High temperature warning threshold has been exceeded */ - /*! \brief 1E.C830.B RO Low Temperature Warning State - AQ_GlobalGeneralStatus_HHD.u0.bits_0.lowTemperatureWarningState - - - - 1 = Low temperature warning threshold has been exceeded - - Notes: - In XENPAK mode, F/W will copy this register to the 1.A074.6 register. - - */ - unsigned int lowTemperatureWarningState : 1; /* 1E.C830.B RO */ - /* 1 = Low temperature warning threshold has been exceeded */ - unsigned int reserved1 : 11; - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global General Status */ - union - { - struct - { - /*! \brief 1E.C831.F RO Processor Intensive MDIO Operation In- Progress - AQ_GlobalGeneralStatus_HHD.u1.bits_1.processorIntensiveMdioOperationIn_Progress - - - - 1 = PHY microprocessor is busy with a processor-intensive MDIO operation - 0 = Processor-intensive MDIO operation completed - - - Notes: - This bit should may be used with certain processor-intensive MDIO commands (such as Loopbacks, Test Modes, Low power modes, Tx-Disable, Restart autonegotiation, Cable Diagnostics, etc.) that take longer than an MDIO cycle to complete. Upon receiving an MDIO command that involves the PHY's microprocessor, this bit is set, and when the command is completed, this bit is cleared. - - NOTE!!! This bit should be checked only after 1 ms of issuing a processor-intensive MDIO operation. - - The list of operations that set this bit are as follows: - - 1.0.0, PMA Loopback - 1.0.B, Low power mode - 1.9.4:0, Tx Disable - 1.84, 10G Test modes - 1.8000.5, XENPAK Control - 1.9000, XENPAK Rx Fault Enable - 1.9002, XENPAK Alarm Enable - 1.E400.F, External loopback - 3.0.B, Low power mode - 3.0.E, System PCS loopback - 3.C471.5, PRBS Test - 3.C471.6, PRBS Test - 3.E471.5, PRBS Test - 3.E471.6, PRBS Test - 4.0.B, Low power mode - 4.0.E, PHY-XS network loopback - 4.C440, Output clock control, Load SERDES parameters - 4.F802.E, System loopback - 4.C444.F:B, Loopback Control - 4.C444.4:2, Packet generation - 4.C445.C, SERDES calibration - 7.0.9, Restart autonegotiation - 1D.C280, 1G/100M Network loopback - 1D.C500, 1G System loopback - 1D.C501, 1G / 100M Test modes - 1E.C470.4, Cable diagnostics - 1E.C47A.F:B, Loopback Control - 1E.C47A.4:2, Packet generation */ - unsigned int processorIntensiveMdioOperationIn_Progress : 1; /* 1E.C831.F RO */ - /* 1 = PHY microprocessor is busy with a processor-intensive MDIO operation - 0 = Processor-intensive MDIO operation completed - */ - unsigned int reserved0 : 15; - } bits_1; - uint16_t word_1; - } u1; -} AQ_GlobalGeneralStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Pin Status: 1E.C840 */ -/* Global Pin Status: 1E.C840 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Pin Status */ - union - { - struct - { - unsigned int reserved0 : 1; - unsigned int reserved1 : 1; - /*! \brief 1E.C840.D RO DC_MASTER_N - AQ_GlobalPinStatus_HHD.u0.bits_0.dcMasterN - - - - Value of DC_MASTER_N pin: - - 0x1 = PHY Slave Daisy Chain Boot - 0x0 = PHY Master Daisy Chain Boot from FLASH - */ - unsigned int dcMasterN : 1; /* 1E.C840.D RO */ - /* Value of DC_MASTER_N pin: - - 0x1 = PHY Slave Daisy Chain Boot - 0x0 = PHY Master Daisy Chain Boot from FLASH */ - unsigned int reserved2 : 3; - /*! \brief 1E.C840.9 RO Package Connectivity - AQ_GlobalPinStatus_HHD.u0.bits_0.packageConnectivity - - - - Value of the package connection pin - - */ - unsigned int packageConnectivity : 1; /* 1E.C840.9 RO */ - /* Value of the package connection pin - */ - unsigned int reserved3 : 1; - /*! \brief 1E.C840.7 RO Tx Enable - AQ_GlobalPinStatus_HHD.u0.bits_0.txEnable - - - - Current Value of Tx Enable pin - - - Notes: - 0 = Disable Transmitter */ - unsigned int txEnable : 1; /* 1E.C840.7 RO */ - /* Current Value of Tx Enable pin - */ - unsigned int reserved4 : 1; - /*! \brief 1E.C840.5:0 RO LED Pullup State [5:0] - AQ_GlobalPinStatus_HHD.u0.bits_0.ledPullupState - - - - 1 = LED output pin is pulled high - 0 = LED output pin is pulled low - - */ - unsigned int ledPullupState : 6; /* 1E.C840.5:0 RO */ - /* 1 = LED output pin is pulled high - 0 = LED output pin is pulled low - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalPinStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Daisy Chain Status: 1E.C842 */ -/* Global Daisy Chain Status: 1E.C842 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Daisy Chain Status */ - union - { - struct - { - /*! \brief 1E.C842.F:0 RO Rx Daisy Chain Calculated CRC [F:0] - AQ_GlobalDaisyChainStatus_HHD.u0.bits_0.rxDaisyChainCalculatedCrc - - - - Rx Daisy Chain Calculated CRC - - - Notes: - This is the calculated daisy chain CRC. */ - unsigned int rxDaisyChainCalculatedCrc : 16; /* 1E.C842.F:0 RO */ - /* Rx Daisy Chain Calculated CRC - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalDaisyChainStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Fault Message: 1E.C850 */ -/* Global Fault Message: 1E.C850 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Fault Message */ - union - { - struct - { - /*! \brief 1E.C850.F:0 RO Message [F:0] - AQ_GlobalFaultMessage_HHD.u0.bits_0.message - - - - Error code describing fault - - Notes: - Code 0x8001: Firmware not compatible with chip architecture. This fault occurs when firmware compiled for a different microprocessor core is loaded. - Code 0x8002: VCO calibration failed. This occurs when the main PLLs on chip fail to lock: this is not possible to trigger. - Code 0x8003: XAUI calibration failed. This occurs when the XAUI PLLs fail to lock: this is not possible to trigger. - Code 0x8005: Unexpected device ID. This occurs if the device ID programmed into the internal E-Fuse registers in not valid: this is not possible to trigger. - Code 0x8006: Computed checksum does not match expected checksum. This occurs when the FLASH checksum check performed at boot time fails. This only occurs when the system boots from FLASH. - Code 0x8007: Detected a bit error in static memory. To trigger, corrupt one of the static regions. - Code 0xC001: Illegal Instruction exception. This occurs when the processor attempts to execute an illegal instruction. To trigger this, write an illegal instruction to program memory. It's possible that the bit error check will trigger before the illegal instruction is executed. - Code 0xC002 Instruction Fetch Error. Internal physical address or a data error during instruction fetch: this is not possible to trigger. - Code 0xC003 Load Store Error. Internal physical address or data error during load store operation: this is not possible to trigger.. - Code 0xC004 Privileged Instruction. Attempt to execute a privileged operation without sufficient privilege: this is not possible to trigger. - Code 0xC005 Unaligned Load or Store. Attempt to load or store data at an address which cannot be handled due to alignment: this is not possible to trigger. - Code 0xC006 Instruction fetch from prohibited space: this is not possible to trigger. - Code 0xC007 Data load from prohibited space: this is not possible to trigger. - Code 0xC008 Data store into prohibited space: this is not possible to trigger. */ - unsigned int message : 16; /* 1E.C850.F:0 RO */ - /* Error code describing fault */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalFaultMessage_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Cable Diagnostic Impedance: 1E.C880 */ -/* Global Cable Diagnostic Impedance: 1E.C880 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C880.F RO Reserved 1 - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.reserved_1 - - - - Reserved - - */ - unsigned int reserved_1 : 1; /* 1E.C880.F RO */ - /* Reserved - */ - /*! \brief 1E.C880.E:C RO Pair A Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.pairAReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_1 : 3; /* 1E.C880.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.B RO Reserved 2 - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.reserved_2 - - - - Reserved - - */ - unsigned int reserved_2 : 1; /* 1E.C880.B RO */ - /* Reserved - */ - /*! \brief 1E.C880.A:8 RO Pair A Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.pairAReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_2 : 3; /* 1E.C880.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.7 RO Reserved 3 - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.reserved_3 - - - - Reserved - - */ - unsigned int reserved_3 : 1; /* 1E.C880.7 RO */ - /* Reserved - */ - /*! \brief 1E.C880.6:4 RO Pair A Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.pairAReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_3 : 3; /* 1E.C880.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C880.3 RO Reserved 4 - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.reserved_4 - - - - Reserved - - */ - unsigned int reserved_4 : 1; /* 1E.C880.3 RO */ - /* Reserved - */ - /*! \brief 1E.C880.2:0 RO Pair A Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u0.bits_0.pairAReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair A. The corresponding length of this reflection from the PHY is given in See Global Power Control - Address 1E.21 */ - unsigned int pairAReflection_4 : 3; /* 1E.C880.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C881.F RO Reserved 5 - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.reserved_5 - - - - Reserved - - */ - unsigned int reserved_5 : 1; /* 1E.C881.F RO */ - /* Reserved - */ - /*! \brief 1E.C881.E:C RO Pair B Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.pairBReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_1 : 3; /* 1E.C881.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.B RO Reserved 6 - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.reserved_6 - - - - Reserved - - */ - unsigned int reserved_6 : 1; /* 1E.C881.B RO */ - /* Reserved - */ - /*! \brief 1E.C881.A:8 RO Pair B Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.pairBReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_2 : 3; /* 1E.C881.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.7 RO Reserved 7 - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.reserved_7 - - - - Reserved - - */ - unsigned int reserved_7 : 1; /* 1E.C881.7 RO */ - /* Reserved - */ - /*! \brief 1E.C881.6:4 RO Pair B Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.pairBReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_3 : 3; /* 1E.C881.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C881.3 RO Reserved 8 - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.reserved_8 - - - - Reserved - - */ - unsigned int reserved_8 : 1; /* 1E.C881.3 RO */ - /* Reserved - */ - /*! \brief 1E.C881.2:0 RO Pair B Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u1.bits_1.pairBReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair B. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 2 - Address 1E.32 - 1E.33 */ - unsigned int pairBReflection_4 : 3; /* 1E.C881.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C882.F RO Reserved 9 - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.reserved_9 - - - - Reserved - - */ - unsigned int reserved_9 : 1; /* 1E.C882.F RO */ - /* Reserved - */ - /*! \brief 1E.C882.E:C RO Pair C Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.pairCReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_1 : 3; /* 1E.C882.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.B RO Reserved 10 - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.reserved_10 - - - - Reserved - - */ - unsigned int reserved_10 : 1; /* 1E.C882.B RO */ - /* Reserved - */ - /*! \brief 1E.C882.A:8 RO Pair C Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.pairCReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_2 : 3; /* 1E.C882.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.7 RO Reserved 11 - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.reserved_11 - - - - Reserved - - */ - unsigned int reserved_11 : 1; /* 1E.C882.7 RO */ - /* Reserved - */ - /*! \brief 1E.C882.6:4 RO Pair C Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.pairCReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_3 : 3; /* 1E.C882.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C882.3 RO Reserved 12 - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.reserved_12 - - - - Reserved - - */ - unsigned int reserved_12 : 1; /* 1E.C882.3 RO */ - /* Reserved - */ - /*! \brief 1E.C882.2:0 RO Pair C Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u2.bits_2.pairCReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair C. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.33 */ - unsigned int pairCReflection_4 : 3; /* 1E.C882.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Cable Diagnostic Impedance */ - union - { - struct - { - /*! \brief 1E.C883.F RO Reserved 13 - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.reserved_13 - - - - Reserved - - */ - unsigned int reserved_13 : 1; /* 1E.C883.F RO */ - /* Reserved - */ - /*! \brief 1E.C883.E:C RO Pair D Reflection #1 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.pairDReflection_1 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the first worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_1 : 3; /* 1E.C883.E:C RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.B RO Reserved 14 - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.reserved_14 - - - - Reserved - - */ - unsigned int reserved_14 : 1; /* 1E.C883.B RO */ - /* Reserved - */ - /*! \brief 1E.C883.A:8 RO Pair D Reflection #2 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.pairDReflection_2 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the second worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_2 : 3; /* 1E.C883.A:8 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.7 RO Reserved 15 - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.reserved_15 - - - - Reserved - - */ - unsigned int reserved_15 : 1; /* 1E.C883.7 RO */ - /* Reserved - */ - /*! \brief 1E.C883.6:4 RO Pair D Reflection #3 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.pairDReflection_3 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the third worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_3 : 3; /* 1E.C883.6:4 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - /*! \brief 1E.C883.3 RO Reserved 16 - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.reserved_16 - - - - Reserved - - */ - unsigned int reserved_16 : 1; /* 1E.C883.3 RO */ - /* Reserved - */ - /*! \brief 1E.C883.2:0 RO Pair D Reflection #4 [2:0] - AQ_GlobalCableDiagnosticImpedance_HHD.u3.bits_3.pairDReflection_4 - - - - 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - - - Notes: - The impedance of the fourth worst reflection on Pair D. The corresponding length of this reflection from the PHY is given in See Global Cable Diagnostic Status 3 - Address 1E.34 - 1E.35 */ - unsigned int pairDReflection_4 : 3; /* 1E.C883.2:0 RO */ - /* 111 = Open Circuit (> 300W) - 110 = High Mismatch (> 115W) - 101 = Low Mismatch (< 85W) - 100 = Short Circuit (< 30W) - 0xx= No information available - */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_GlobalCableDiagnosticImpedance_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Status: 1E.C884 */ -/* Global Status: 1E.C884 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Status */ - union - { - struct - { - /*! \brief 1E.C884.F:8 RO Reserved Status 0 [7:0] - AQ_GlobalStatus_HHD.u0.bits_0.reservedStatus_0 - - - - Reserved - - */ - unsigned int reservedStatus_0 : 8; /* 1E.C884.F:8 RO */ - /* Reserved - */ - /*! \brief 1E.C884.7:0 RO Cable Length [7:0] - AQ_GlobalStatus_HHD.u0.bits_0.cableLength - - - - The estimated length of the cable in meters - - - Notes: - The length of the cable shown here is estimated from the cable diagnostic engine and should be accurate to +/-1m. */ - unsigned int cableLength : 8; /* 1E.C884.7:0 RO */ - /* The estimated length of the cable in meters - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Reserved Status: 1E.C885 */ -/* Global Reserved Status: 1E.C885 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C885.F:A RO Nearly Seconds MSW[5:0] - AQ_GlobalReservedStatus_HHD.u0.bits_0.nearlySecondsMSW - - - - Bits 16 to 21 of the 22 bit "Nearly Seconds" uptime counter. - - - Notes: - The "Nearly Seconds" counter is incremented every 1024 milliseconds. */ - unsigned int nearlySecondsMSW : 6; /* 1E.C885.F:A RO */ - /* Bits 16 to 21 of the 22 bit "Nearly Seconds" uptime counter. - */ - /*! \brief 1E.C885.9:8 ROSPD XENPAK NVR Status [1:0] - AQ_GlobalReservedStatus_HHD.u0.bits_0.xenpakNvrStatus - - Provisionable Default = 0x0 - - Status of XENPAK NVR: - 0: NVR not enabled - 1: Last NVR operation succeeded - 2: Last NVR operation failed - 3: Reserved - - - Notes: - XENPAK register space is mirrored in NVR (SPI ROM). This register indicates the status of the last NVR operation. */ - unsigned int xenpakNvrStatus : 2; /* 1E.C885.9:8 ROSPD Provisionable Default = 0x0 */ - /* Status of XENPAK NVR: - 0: NVR not enabled - 1: Last NVR operation succeeded - 2: Last NVR operation failed - 3: Reserved - */ - /*! \brief 1E.C885.7:4 ROSPD Firmware Build ID [3:0] - AQ_GlobalReservedStatus_HHD.u0.bits_0.firmwareBuildID - - Provisionable Default = 0x0 - - Firmware Build ID - - - Notes: - Customers may receive multiple ROM images that differ only in their provisioning. This field is used to differentiate those images. This field is used in conjunction with the firmware major and minor revision numbers to uniquely identify ROM images. */ - unsigned int firmwareBuildID : 4; /* 1E.C885.7:4 ROSPD Provisionable Default = 0x0 */ - /* Firmware Build ID - */ - /*! \brief 1E.C885.3:0 ROSPD Provisioning ID [3:0] - AQ_GlobalReservedStatus_HHD.u0.bits_0.provisioningID - - Provisionable Default = 0x0 - - Provisioning ID - - - Notes: - Customers may receive multiple ROM images that differ only in their provisioning. This field is used to differentiate those images. This field is used in conjunction with the firmware major and minor revision numbers to uniquely identify ROM images. */ - unsigned int provisioningID : 4; /* 1E.C885.3:0 ROSPD Provisionable Default = 0x0 */ - /* Provisioning ID - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C886.F:0 RO Nearly Seconds LSW [F:0] - AQ_GlobalReservedStatus_HHD.u1.bits_1.nearlySecondsLSW - - - - Bits 0 to 15 of the 22 bit "Nearly Seconds" uptime counter - - - Notes: - The "Nearly Seconds" counter is incremented every 1024 milliseconds. */ - unsigned int nearlySecondsLSW : 16; /* 1E.C886.F:0 RO */ - /* Bits 0 to 15 of the 22 bit "Nearly Seconds" uptime counter - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C887.F ROS DTE Status - AQ_GlobalReservedStatus_HHD.u2.bits_2.dteStatus - - Default = 0x0 - - 1 = Need power - 0 = Don't need power - - */ - unsigned int dteStatus : 1; /* 1E.C887.F ROS Default = 0x0 */ - /* 1 = Need power - 0 = Don't need power - */ - /*! \brief 1E.C887.E ROS Power Up Stall Status - AQ_GlobalReservedStatus_HHD.u2.bits_2.powerUpStallStatus - - Default = 0x0 - - 1 = FW is stalled at power up - 0 = Firmware is unstalled - - */ - unsigned int powerUpStallStatus : 1; /* 1E.C887.E ROS Default = 0x0 */ - /* 1 = FW is stalled at power up - 0 = Firmware is unstalled - */ - /*! \brief 1E.C887.D:0 RO Reserved Status 3 [D:0] - AQ_GlobalReservedStatus_HHD.u2.bits_2.reservedStatus_3 - - - - Reserved for future use - - */ - unsigned int reservedStatus_3 : 14; /* 1E.C887.D:0 RO */ - /* Reserved for future use - */ - } bits_2; - uint16_t word_2; - } u2; - /*! \brief Union for bit and word level access of word 3 of Global Reserved Status */ - union - { - struct - { - /*! \brief 1E.C888.F:B RO Loopback Status [4:0] - AQ_GlobalReservedStatus_HHD.u3.bits_3.loopbackStatus - - Default = 0x00 - - 0x00 = No loopback - 0x01 = System Interface - System Loopback - 0x02 = System Interface - System Loopback with Passthrough - 0x03 = System Interface - Network Loopback - 0x04 = System Interface - Network Loopback with Passthrough - 0x05 = System Interface - Network Loopback with Passthrough and Merge - 0x06 = System Interface - Peer-to-peer loopback - 0x07 - 0x08 = Reserved - 0x09 = Network Interface - System Loopback - 0x0A = Network Interface - System Loopback with Passthrough - 0x0B = Network Interface - Network Loopback - 0x0C = Network Interface - Network Loopback with Passthrough - 0x0D = Network Interface - Peer-to-peer loopback - 0x0E - 0x0F = Reserved - 0x10 = Cross-connect System Loopback - 0x11 = Cross-connect Network Loopback - 0x12 - 0x13 = Reserved - 0x14 = Network Interface - System Loopback via Loopback Plug - 0x15 - 0x1F = Reserved - - - Notes: - These bits, in conjunction with the chip configuration and the rate (Bits 1:0), report the selected loopback. - - */ - unsigned int loopbackStatus : 5; /* 1E.C888.F:B RO Default = 0x00 */ - /* 0x00 = No loopback - 0x01 = System Interface - System Loopback - 0x02 = System Interface - System Loopback with Passthrough - 0x03 = System Interface - Network Loopback - 0x04 = System Interface - Network Loopback with Passthrough - 0x05 = System Interface - Network Loopback with Passthrough and Merge - 0x06 = System Interface - Peer-to-peer loopback - 0x07 - 0x08 = Reserved - 0x09 = Network Interface - System Loopback - 0x0A = Network Interface - System Loopback with Passthrough - 0x0B = Network Interface - Network Loopback - 0x0C = Network Interface - Network Loopback with Passthrough - 0x0D = Network Interface - Peer-to-peer loopback - 0x0E - 0x0F = Reserved - 0x10 = Cross-connect System Loopback - 0x11 = Cross-connect Network Loopback - 0x12 - 0x13 = Reserved - 0x14 = Network Interface - System Loopback via Loopback Plug - 0x15 - 0x1F = Reserved - */ - /*! \brief 1E.C888.A:6 RO Reserved Status 4 [4:0] - AQ_GlobalReservedStatus_HHD.u3.bits_3.reservedStatus_4 - - Default = 0x00 - - Reserved for future use - - */ - unsigned int reservedStatus_4 : 5; /* 1E.C888.A:6 RO Default = 0x00 */ - /* Reserved for future use - */ - /*! \brief 1E.C888.5 RO MDI Packet Generation Status - AQ_GlobalReservedStatus_HHD.u3.bits_3.mdiPacketGenerationStatus - - Default = 0x0 - - 1 = CRPAT packet generation out MDI interface - 0 = No CRPAT packet generation out MDI interface - - - Notes: - Reports whether the CRPAT packet generator in the PHY outputs on the MDI interface at the selected rate. */ - unsigned int mdiPacketGenerationStatus : 1; /* 1E.C888.5 RO Default = 0x0 */ - /* 1 = CRPAT packet generation out MDI interface - 0 = No CRPAT packet generation out MDI interface - */ - /*! \brief 1E.C888.4 RO Look-Aside Port Packet Generation Status - AQ_GlobalReservedStatus_HHD.u3.bits_3.look_asidePortPacketGenerationStatus - - Default = 0x0 - - 1 = CRPAT packet generation out 10G look-aside interface (KR0) - 0 = No CRPAT packet generation out 10G look-aside interface (KR0) - - - Notes: - Reports whether the CRPAT packet generator in the PHY outputs on the KR0 interface at the selected rate. */ - unsigned int look_asidePortPacketGenerationStatus : 1; /* 1E.C888.4 RO Default = 0x0 */ - /* 1 = CRPAT packet generation out 10G look-aside interface (KR0) - 0 = No CRPAT packet generation out 10G look-aside interface (KR0) - */ - /*! \brief 1E.C888.3 RO System I/F Packet Generation Status - AQ_GlobalReservedStatus_HHD.u3.bits_3.systemI_fPacketGenerationStatus - - Default = 0x0 - - 1 = CRPAT packet generation out 10G system interface - 0 = No CRPAT packet generation out 10G system interface - - - Notes: - Reports whether the CRPAT packet generator in the PHY outputs on the selected system interface at the selected rate. */ - unsigned int systemI_fPacketGenerationStatus : 1; /* 1E.C888.3 RO Default = 0x0 */ - /* 1 = CRPAT packet generation out 10G system interface - 0 = No CRPAT packet generation out 10G system interface - */ - /*! \brief 1E.C888.2 RO Reserved Status 4a - AQ_GlobalReservedStatus_HHD.u3.bits_3.reservedStatus_4a - - Default = 0x0 - - Reserved for future use - - */ - unsigned int reservedStatus_4a : 1; /* 1E.C888.2 RO Default = 0x0 */ - /* Reserved for future use - */ - /*! \brief 1E.C888.1:0 RO Rate [1:0] - AQ_GlobalReservedStatus_HHD.u3.bits_3.rate - - Default = 0x0 - - 0x3 = 10G - 0x2 = 1G - 0x1 = 100M - 0x0 = invalid - - - Notes: - These bits report the selected rate for the loopback and packet generation. */ - unsigned int rate : 2; /* 1E.C888.1:0 RO Default = 0x0 */ - /* 0x3 = 10G - 0x2 = 1G - 0x1 = 100M - 0x0 = invalid - */ - } bits_3; - uint16_t word_3; - } u3; -} AQ_GlobalReservedStatus_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Alarms: 1E.CC00 */ -/* Global Alarms: 1E.CC00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Alarms */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.CC00.E LH High Temperature Failure - AQ_GlobalAlarms_HHD.u0.bits_0.highTemperatureFailure - - - - 1 = High temperature failure threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int highTemperatureFailure : 1; /* 1E.CC00.E LH */ - /* 1 = High temperature failure threshold has been exceeded - */ - /*! \brief 1E.CC00.D LH Low Temperature Failure - AQ_GlobalAlarms_HHD.u0.bits_0.lowTemperatureFailure - - - - 1 = Low temperature failure threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int lowTemperatureFailure : 1; /* 1E.CC00.D LH */ - /* 1 = Low temperature failure threshold has been exceeded - */ - /*! \brief 1E.CC00.C LH High Temperature Warning - AQ_GlobalAlarms_HHD.u0.bits_0.highTemperatureWarning - - - - 1 = High temperature warning threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int highTemperatureWarning : 1; /* 1E.CC00.C LH */ - /* 1 = High temperature warning threshold has been exceeded - */ - /*! \brief 1E.CC00.B LH Low Temperature Warning - AQ_GlobalAlarms_HHD.u0.bits_0.lowTemperatureWarning - - - - 1 = Low temperature warning threshold has been exceeded - - - Notes: - - - - - These bits mirror the matching bit in 1.A070 and 1.A074. These bits are driven by Bits E:B in See Global General Status 1: Address 1E.C830 . */ - unsigned int lowTemperatureWarning : 1; /* 1E.CC00.B LH */ - /* 1 = Low temperature warning threshold has been exceeded - */ - unsigned int reserved1 : 4; - /*! \brief 1E.CC00.6 LH Reset completed - AQ_GlobalAlarms_HHD.u0.bits_0.resetCompleted - - - - 1 = Chip wide reset completed - - Notes: - This bit is set by the microprocessor when it has completed it's initialization sequence. This bit is mirrored in 1.CC02.0 */ - unsigned int resetCompleted : 1; /* 1E.CC00.6 LH */ - /* 1 = Chip wide reset completed */ - unsigned int reserved2 : 1; - /*! \brief 1E.CC00.4 LH Device Fault - AQ_GlobalAlarms_HHD.u0.bits_0.deviceFault - - - - 1 = Fault - - Notes: - When set, a fault has been detected by the uP and the associated 16 bit error code is visible in See Global Configuration Fault Message: Address 1E.C850 */ - unsigned int deviceFault : 1; /* 1E.CC00.4 LH */ - /* 1 = Fault */ - /*! \brief 1E.CC00.3 LH Reserved Alarm A - AQ_GlobalAlarms_HHD.u0.bits_0.reservedAlarmA - - - - Reserved for future use - - */ - unsigned int reservedAlarmA : 1; /* 1E.CC00.3 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.2 LH Reserved Alarm B - AQ_GlobalAlarms_HHD.u0.bits_0.reservedAlarmB - - - - Reserved for future use - - */ - unsigned int reservedAlarmB : 1; /* 1E.CC00.2 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.1 LH Reserved Alarm C - AQ_GlobalAlarms_HHD.u0.bits_0.reservedAlarmC - - - - Reserved for future use - - */ - unsigned int reservedAlarmC : 1; /* 1E.CC00.1 LH */ - /* Reserved for future use - */ - /*! \brief 1E.CC00.0 LH Reserved Alarm D - AQ_GlobalAlarms_HHD.u0.bits_0.reservedAlarmD - - - - Reserved for future use - - */ - unsigned int reservedAlarmD : 1; /* 1E.CC00.0 LH */ - /* Reserved for future use - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Alarms */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.CC01.E LH Smart Power-Down Entered - AQ_GlobalAlarms_HHD.u1.bits_1.smartPower_downEntered - - - - 1 = Smart Power-Down State Entered - - - Notes: - When this bit is set, it indicates that the Smart Power-Down state was entered */ - unsigned int smartPower_downEntered : 1; /* 1E.CC01.E LH */ - /* 1 = Smart Power-Down State Entered - */ - /*! \brief 1E.CC01.D RO XENPAK Alarm - AQ_GlobalAlarms_HHD.u1.bits_1.xenpakAlarm - - - - 1 = XENPAK Alarm - - */ - unsigned int xenpakAlarm : 1; /* 1E.CC01.D RO */ - /* 1 = XENPAK Alarm - */ - /*! \brief 1E.CC01.C LH IP Phone Detect - AQ_GlobalAlarms_HHD.u1.bits_1.ipPhoneDetect - - - - 1 = IP Phone Detect - - - Notes: - Assertion of this bit means that the presence of an IP Phone has been detected. */ - unsigned int ipPhoneDetect : 1; /* 1E.CC01.C LH */ - /* 1 = IP Phone Detect - */ - /*! \brief 1E.CC01.B LH DTE Status Change - AQ_GlobalAlarms_HHD.u1.bits_1.dteStatusChange - - - - 1 = DTE status change - - - Notes: - Change in 1E.C887[F]. */ - unsigned int dteStatusChange : 1; /* 1E.CC01.B LH */ - /* 1 = DTE status change - */ - /*! \brief 1E.CC01.A:8 LH Reserved Alarms [2:0] - AQ_GlobalAlarms_HHD.u1.bits_1.reservedAlarms - - - - Reserved - - - */ - unsigned int reservedAlarms : 3; /* 1E.CC01.A:8 LH */ - /* Reserved - - */ - /*! \brief 1E.CC01.7 LH MDIO Command Handling Overflow - AQ_GlobalAlarms_HHD.u1.bits_1.mdioCommandHandlingOverflow - - - - 1 = PHY was issued more MDIO requests than it could service in it's request buffer - - - Notes: - Assertion of this bit means that more MDIO commands were issued than FW could handle. */ - unsigned int mdioCommandHandlingOverflow : 1; /* 1E.CC01.7 LH */ - /* 1 = PHY was issued more MDIO requests than it could service in it's request buffer - */ - unsigned int reserved1 : 6; - unsigned int reserved2 : 1; - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Alarms */ - union - { - struct - { - /*! \brief 1E.CC02.F LH NVR Operation Complete - AQ_GlobalAlarms_HHD.u2.bits_2.nvrOperationComplete - - - - 1 = NVR operation is complete - - - Notes: - NVR interface is ready interrupt for registers See Global NVR Interface 1: Address 1E.100 - See Global NVR Provisioning Data MSW - Address 1E.17 . */ - unsigned int nvrOperationComplete : 1; /* 1E.CC02.F LH */ - /* 1 = NVR operation is complete - */ - /*! \brief 1E.CC02.E LH Mailbox Operation: Complete - AQ_GlobalAlarms_HHD.u2.bits_2.mailboxOperation_Complete - - - - 1 = Mailbox operation is complete - - - Notes: - Mailbox interface is ready interrupt for registers See Global Vendor Specific Control - Address 1E.C000 - See Global Vendor Specific Provisioning 5 - Address 1E.C404 */ - unsigned int mailboxOperation_Complete : 1; /* 1E.CC02.E LH */ - /* 1 = Mailbox operation is complete - */ - unsigned int reserved0 : 3; - /*! \brief 1E.CC02.A LH uP DRAM Parity Error - AQ_GlobalAlarms_HHD.u2.bits_2.upDramParityError - - - - 1 = Parity error detected in the uP DRAM - - */ - unsigned int upDramParityError : 1; /* 1E.CC02.A LH */ - /* 1 = Parity error detected in the uP DRAM - */ - /*! \brief 1E.CC02.9:8 LH uP IRAM Parity Error [1:0] - AQ_GlobalAlarms_HHD.u2.bits_2.upIramParityError - - - - 1 = Parity error detected in the uP IRAM - - - Notes: - Bit 0 indicates a parity error was detected in the uP IRAM but was corrected. - Bit 1 indicates a multiple parity errors were detected in the uP IRAM and could not be corrected. - The uP IRAM is protected with ECC. */ - unsigned int upIramParityError : 2; /* 1E.CC02.9:8 LH */ - /* 1 = Parity error detected in the uP IRAM - */ - unsigned int reserved1 : 2; - /*! \brief 1E.CC02.5 LRF Tx Enable State Change - AQ_GlobalAlarms_HHD.u2.bits_2.txEnableStateChange - - - - 1 = TX_EN pin has changed state - - */ - unsigned int txEnableStateChange : 1; /* 1E.CC02.5 LRF */ - /* 1 = TX_EN pin has changed state - */ - unsigned int reserved2 : 2; - /*! \brief 1E.CC02.2 LH MDIO MMD Error - AQ_GlobalAlarms_HHD.u2.bits_2.mdioMMD_Error - - - - 1 = Invalid MMD address detected - - */ - unsigned int mdioMMD_Error : 1; /* 1E.CC02.2 LH */ - /* 1 = Invalid MMD address detected - */ - /*! \brief 1E.CC02.1 LH MDIO Timeout Error - AQ_GlobalAlarms_HHD.u2.bits_2.mdioTimeoutError - - - - 1 = MDIO timeout detected - - */ - unsigned int mdioTimeoutError : 1; /* 1E.CC02.1 LH */ - /* 1 = MDIO timeout detected - */ - /*! \brief 1E.CC02.0 LH Watchdog Timer Alarm - AQ_GlobalAlarms_HHD.u2.bits_2.watchdogTimerAlarm - - - - 1 = Watchdog timer alarm - - */ - unsigned int watchdogTimerAlarm : 1; /* 1E.CC02.0 LH */ - /* 1 = Watchdog timer alarm - */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalAlarms_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Mask: 1E.D400 */ -/* Global Interrupt Mask: 1E.D400 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Mask */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.D400.E R/WPD High Temperature Failure Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.highTemperatureFailureMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int highTemperatureFailureMask : 1; /* 1E.D400.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.D R/WPD Low Temperature Failure Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.lowTemperatureFailureMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int lowTemperatureFailureMask : 1; /* 1E.D400.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.C R/WPD High Temperature Warning Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.highTemperatureWarningMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int highTemperatureWarningMask : 1; /* 1E.D400.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.B R/WPD Low Temperature Warning Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.lowTemperatureWarningMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int lowTemperatureWarningMask : 1; /* 1E.D400.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved1 : 4; - /*! \brief 1E.D400.6 R/WPD Reset completed Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.resetCompletedMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int resetCompletedMask : 1; /* 1E.D400.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved2 : 1; - /*! \brief 1E.D400.4 R/WPD Device Fault Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.deviceFaultMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int deviceFaultMask : 1; /* 1E.D400.4 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D400.3 R/WPD Reserved Alarm A Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.reservedAlarmAMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmAMask : 1; /* 1E.D400.3 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.2 R/WPD Reserved Alarm B Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.reservedAlarmBMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmBMask : 1; /* 1E.D400.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.1 R/WPD Reserved Alarm C Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.reservedAlarmCMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmCMask : 1; /* 1E.D400.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D400.0 R/WPD Reserved Alarm D Mask - AQ_GlobalInterruptMask_HHD.u0.bits_0.reservedAlarmDMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmDMask : 1; /* 1E.D400.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - } bits_0; - uint16_t word_0; - } u0; - /*! \brief Union for bit and word level access of word 1 of Global Interrupt Mask */ - union - { - struct - { - unsigned int reserved0 : 1; - /*! \brief 1E.D401.E R/WPD Smart Power-Down Entered Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.smartPower_downEnteredMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int smartPower_downEnteredMask : 1; /* 1E.D401.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.D R/WPD XENPAK Alarm Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.xenpakAlarmMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int xenpakAlarmMask : 1; /* 1E.D401.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D401.C R/WPD IP Phone Detect Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.ipPhoneDetectMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int ipPhoneDetectMask : 1; /* 1E.D401.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.B R/WPD DTE Status Change Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.dteStatusChangeMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int dteStatusChangeMask : 1; /* 1E.D401.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.A:8 R/WPD Reserved Alarms Mask [2:0] - AQ_GlobalInterruptMask_HHD.u1.bits_1.reservedAlarmsMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int reservedAlarmsMask : 3; /* 1E.D401.A:8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D401.7 R/WPD MDIO Command Handling Overflow Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.mdioCommandHandlingOverflowMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int mdioCommandHandlingOverflowMask : 1; /* 1E.D401.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved1 : 6; - /*! \brief 1E.D401.0 R/WPD Diagnostic Alarm Mask - AQ_GlobalInterruptMask_HHD.u1.bits_1.diagnosticAlarmMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int diagnosticAlarmMask : 1; /* 1E.D401.0 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - } bits_1; - uint16_t word_1; - } u1; - /*! \brief Union for bit and word level access of word 2 of Global Interrupt Mask */ - union - { - struct - { - /*! \brief 1E.D402.F R/WPD NVR Operation Complete Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.nvrOperationCompleteMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - Notes: - NVR interface is ready interrupt for registers See Global NVR Interface 1: Address 1E.100 - See Global NVR Provisioning Data MSW - Address 1E.17 */ - unsigned int nvrOperationCompleteMask : 1; /* 1E.D402.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.E R/WPD Mailbox Operation Complete Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.mailboxOperationCompleteMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - Notes: - Mailbox interface is ready interrupt for registers See Global Vendor Specific Control - Address 1E.C000 - See Global Vendor Specific Provisioning 5 - Address 1E.C404 */ - unsigned int mailboxOperationCompleteMask : 1; /* 1E.D402.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 3; - /*! \brief 1E.D402.A R/WPD uP DRAM Parity Error Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.upDramParityErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int upDramParityErrorMask : 1; /* 1E.D402.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - /*! \brief 1E.D402.9:8 R/WPD uP IRAM Parity Error Mask [1:0] - AQ_GlobalInterruptMask_HHD.u2.bits_2.upIramParityErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - - */ - unsigned int upIramParityErrorMask : 2; /* 1E.D402.9:8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int reserved1 : 2; - /*! \brief 1E.D402.5 R/WPD Tx Enable State Change Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.txEnableStateChangeMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int txEnableStateChangeMask : 1; /* 1E.D402.5 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved2 : 2; - /*! \brief 1E.D402.2 R/WPD MDIO MMD Error Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.mdioMMD_ErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int mdioMMD_ErrorMask : 1; /* 1E.D402.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.1 R/WPD MDIO Timeout Error Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.mdioTimeoutErrorMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int mdioTimeoutErrorMask : 1; /* 1E.D402.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.D402.0 R/WPD Watchdog Timer Alarm Mask - AQ_GlobalInterruptMask_HHD.u2.bits_2.watchdogTimerAlarmMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int watchdogTimerAlarmMask : 1; /* 1E.D402.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_2; - uint16_t word_2; - } u2; -} AQ_GlobalInterruptMask_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip-Wide Standard Interrupt Flags: 1E.FC00 */ -/* Global Chip-Wide Standard Interrupt Flags: 1E.FC00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip-Wide Standard Interrupt Flags */ - union - { - struct - { - /*! \brief 1E.FC00.F RO PMA Standard Alarm 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pmaStandardAlarm_1Interrupt - - - - 1 = Interrupt in PMA standard alarms 1 - - - Notes: - An interrupt was generated from bit 1.1.2. - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int pmaStandardAlarm_1Interrupt : 1; /* 1E.FC00.F RO */ - /* 1 = Interrupt in PMA standard alarms 1 - */ - /*! \brief 1E.FC00.E RO PMA Standard Alarm 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pmaStandardAlarm_2Interrupt - - - - 1 = Interrupt in PMA standard alarms 2 - - - Notes: - An interrupt was generated from either bit 1.8.B or 1.8.A. - An interrupt was generated from status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int pmaStandardAlarm_2Interrupt : 1; /* 1E.FC00.E RO */ - /* 1 = Interrupt in PMA standard alarms 2 - */ - /*! \brief 1E.FC00.D RO PCS Standard Alarm 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pcsStandardAlarm_1Interrupt - - - - 1 = Interrupt in PCS standard alarms 1 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int pcsStandardAlarm_1Interrupt : 1; /* 1E.FC00.D RO */ - /* 1 = Interrupt in PCS standard alarms 1 - */ - /*! \brief 1E.FC00.C RO PCS Standard Alarm 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pcsStandardAlarm_2Interrupt - - - - 1 = Interrupt in PCS standard alarms 2 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int pcsStandardAlarm_2Interrupt : 1; /* 1E.FC00.C RO */ - /* 1 = Interrupt in PCS standard alarms 2 - */ - /*! \brief 1E.FC00.B RO PCS Standard Alarm 3 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.pcsStandardAlarm_3Interrupt - - - - 1 = Interrupt in PCS standard alarms 3 - - - Notes: - An interrupt was generated from status register ( See PCS 10GBASE-T Status 2 - Address 3.21 ) and the corresponding mask register. ( See PCS Standard Interrupt Mask 1 - Address 3.E021 ) */ - unsigned int pcsStandardAlarm_3Interrupt : 1; /* 1E.FC00.B RO */ - /* 1 = Interrupt in PCS standard alarms 3 - */ - /*! \brief 1E.FC00.A RO PHY XS Standard Alarms 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.phyXS_StandardAlarms_1Interrupt - - - - 1 = Interrupt in PHY XS standard alarms 1 - - - Notes: - An interrupt was generated from the status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 2 - Address 4.A001 ) */ - unsigned int phyXS_StandardAlarms_1Interrupt : 1; /* 1E.FC00.A RO */ - /* 1 = Interrupt in PHY XS standard alarms 1 - */ - /*! \brief 1E.FC00.9 RO PHY XS Standard Alarms 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.phyXS_StandardAlarms_2Interrupt - - - - 1 = Interrupt in PHY XS standard alarms 2 - - - Notes: - An interrupt was generated from the status register ( See PHY XS Standard Vendor Devices in Package - Address 4.8 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int phyXS_StandardAlarms_2Interrupt : 1; /* 1E.FC00.9 RO */ - /* 1 = Interrupt in PHY XS standard alarms 2 - */ - /*! \brief 1E.FC00.8 RO Autonegotiation Standard Alarms 1 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.autonegotiationStandardAlarms_1Interrupt - - - - 1 = Interrupt in Autonegotiation standard alarms 1 - - - Notes: - An interrupt was generated from status register ( See PHY XS Standard Status 1 - Address 4.1 ) and the corresponding mask register. ( See Autonegotiation Standard LASI Interrupt Mask 1: Address 7.D000 ) */ - unsigned int autonegotiationStandardAlarms_1Interrupt : 1; /* 1E.FC00.8 RO */ - /* 1 = Interrupt in Autonegotiation standard alarms 1 - */ - /*! \brief 1E.FC00.7 RO Autonegotiation Standard Alarms 2 Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.autonegotiationStandardAlarms_2Interrupt - - - - 1 = Interrupt in Autonegotiation standard alarms 2 - - - Notes: - An interrupt was generated from status register ( See Autonegotiation 10GBASE-T Status Register - Address 7.21 ) and the corresponding mask register. ( See PHY XS Standard Transmit XAUI Rx Interrupt Mask 8 - Address 4.A008 ) */ - unsigned int autonegotiationStandardAlarms_2Interrupt : 1; /* 1E.FC00.7 RO */ - /* 1 = Interrupt in Autonegotiation standard alarms 2 - */ - /*! \brief 1E.FC00.6 RO GbE Standard Alarms Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.gbeStandardAlarmsInterrupt - - - - 1 = Interrupt in GbE standard alarms - - - Notes: - An interrupt was generated from the TGE core. */ - unsigned int gbeStandardAlarmsInterrupt : 1; /* 1E.FC00.6 RO */ - /* 1 = Interrupt in GbE standard alarms - */ - unsigned int reserved0 : 5; - /*! \brief 1E.FC00.0 RO All Vendor Alarms Interrupt - AQ_GlobalChip_wideStandardInterruptFlags_HHD.u0.bits_0.allVendorAlarmsInterrupt - - - - 1 = Interrupt in all vendor alarms - - - Notes: - An interrupt was generated from status register ( See Global Chip-Wide LASI Vendor Interrupt Flags: Address 1E.FC01 ) and the corresponding mask register. ( See Global Interrupt LASI Mask: Address 1E.FF01 ) */ - unsigned int allVendorAlarmsInterrupt : 1; /* 1E.FC00.0 RO */ - /* 1 = Interrupt in all vendor alarms - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChip_wideStandardInterruptFlags_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Chip-Wide Vendor Interrupt Flags: 1E.FC01 */ -/* Global Chip-Wide Vendor Interrupt Flags: 1E.FC01 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Chip-Wide Vendor Interrupt Flags */ - union - { - struct - { - /*! \brief 1E.FC01.F RO PMA Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.pmaVendorAlarmInterrupt - - - - 1 = Interrupt in PMA vendor specific alarm - - - Notes: - A PMA alarm was generated. ( See PHY XS Vendor Global Interrupt Flags 1- Address 4.F800 ) */ - unsigned int pmaVendorAlarmInterrupt : 1; /* 1E.FC01.F RO */ - /* 1 = Interrupt in PMA vendor specific alarm - */ - /*! \brief 1E.FC01.E RO PCS Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.pcsVendorAlarmInterrupt - - - - 1 = Interrupt in PCS vendor specific alarm - - - Notes: - A PCS alarm was generated. ( See PHY XS Vendor Global Interrupt Flags 1- Address 4.F800 ) */ - unsigned int pcsVendorAlarmInterrupt : 1; /* 1E.FC01.E RO */ - /* 1 = Interrupt in PCS vendor specific alarm - */ - /*! \brief 1E.FC01.D RO PHY XS Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.phyXS_VendorAlarmInterrupt - - - - 1 = Interrupt in PHY XS vendor specific alarm - - - Notes: - A PHY XS alarm was generated. ( See PHY XS Vendor Global LASI Interrupt Flags 1: Address 4.FC00 ) */ - unsigned int phyXS_VendorAlarmInterrupt : 1; /* 1E.FC01.D RO */ - /* 1 = Interrupt in PHY XS vendor specific alarm - */ - /*! \brief 1E.FC01.C RO Autonegotiation Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.autonegotiationVendorAlarmInterrupt - - - - 1 = Interrupt in Autonegotiation vendor specific alarm - - - Notes: - An Autonegotiation alarm was generated. ( See Autonegotiation Vendor Global LASI Interrupt Flags 1: Address 7.FC00 ) */ - unsigned int autonegotiationVendorAlarmInterrupt : 1; /* 1E.FC01.C RO */ - /* 1 = Interrupt in Autonegotiation vendor specific alarm - */ - /*! \brief 1E.FC01.B RO GbE Vendor Alarm Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.gbeVendorAlarmInterrupt - - - - 1 = Interrupt in GbE vendor specific alarm - - - Notes: - A GbE alarm was generated. ( See GbE PHY Vendor Global LASI Interrupt Flags 1: Address 1D.FC00 ) */ - unsigned int gbeVendorAlarmInterrupt : 1; /* 1E.FC01.B RO */ - /* 1 = Interrupt in GbE vendor specific alarm - */ - unsigned int reserved0 : 8; - /*! \brief 1E.FC01.2 RO Global Alarms 1 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.globalAlarms_1Interrupt - - - - 1 = Interrupt in Global alarms 1 - - - Notes: - An interrupt was generated from status register ( See Global Vendor Alarms 1 - Address 1E.CC00 ) and the corresponding mask register. ( See Global Vendor Interrupt Mask - Address 1E.D400 ) */ - unsigned int globalAlarms_1Interrupt : 1; /* 1E.FC01.2 RO */ - /* 1 = Interrupt in Global alarms 1 - */ - /*! \brief 1E.FC01.1 RO Global Alarms 2 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.globalAlarms_2Interrupt - - - - 1 = Interrupt in Global alarms 2 - - - Notes: - An interrupt was generated from status register ( See Global Alarms 2: Address 1E.CC01 ) and the corresponding mask register. ( See Global LASI Interrupt Mask 2: Address 1E.D401 ) */ - unsigned int globalAlarms_2Interrupt : 1; /* 1E.FC01.1 RO */ - /* 1 = Interrupt in Global alarms 2 - */ - /*! \brief 1E.FC01.0 RO Global Alarms 3 Interrupt - AQ_GlobalChip_wideVendorInterruptFlags_HHD.u0.bits_0.globalAlarms_3Interrupt - - - - 1 = Interrupt in Global alarms 3 - - - Notes: - An interrupt was generated from status register ( See Global Vendor Alarms 2: Address 1E.CC01 ) and the corresponding mask register. ( See Global LASI Interrupt Mask 2: Address 1E.D401 ) */ - unsigned int globalAlarms_3Interrupt : 1; /* 1E.FC01.0 RO */ - /* 1 = Interrupt in Global alarms 3 - */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalChip_wideVendorInterruptFlags_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Chip-Wide Standard Mask: 1E.FF00 */ -/* Global Interrupt Chip-Wide Standard Mask: 1E.FF00 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Chip-Wide Standard Mask */ - union - { - struct - { - /*! \brief 1E.FF00.F R/WPD PMA Standard Alarm 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pmaStandardAlarm_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaStandardAlarm_1InterruptMask : 1; /* 1E.FF00.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.E R/WPD PMA Standard Alarm 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pmaStandardAlarm_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaStandardAlarm_2InterruptMask : 1; /* 1E.FF00.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.D R/WPD PCS Standard Alarm 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pcsStandardAlarm_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_1InterruptMask : 1; /* 1E.FF00.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.C R/WPD PCS Standard Alarm 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pcsStandardAlarm_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_2InterruptMask : 1; /* 1E.FF00.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.B R/WPD PCS Standard Alarm 3 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.pcsStandardAlarm_3InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsStandardAlarm_3InterruptMask : 1; /* 1E.FF00.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.A R/WPD PHY XS Standard Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.phyXS_StandardAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_StandardAlarms_1InterruptMask : 1; /* 1E.FF00.A R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.9 R/WPD PHY XS Standard Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.phyXS_StandardAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_StandardAlarms_2InterruptMask : 1; /* 1E.FF00.9 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.8 R/WPD Autonegotiation Standard Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.autonegotiationStandardAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationStandardAlarms_1InterruptMask : 1; /* 1E.FF00.8 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.7 R/WPD Autonegotiation Standard Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.autonegotiationStandardAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationStandardAlarms_2InterruptMask : 1; /* 1E.FF00.7 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF00.6 R/WPD Gbe Standard Alarms Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.gbeStandardAlarmsInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int gbeStandardAlarmsInterruptMask : 1; /* 1E.FF00.6 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 5; - /*! \brief 1E.FF00.0 R/WPD All Vendor Alarms Interrupt Mask - AQ_GlobalInterruptChip_wideStandardMask_HHD.u0.bits_0.allVendorAlarmsInterruptMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int allVendorAlarmsInterruptMask : 1; /* 1E.FF00.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalInterruptChip_wideStandardMask_HHD; - - -/*---------------------------------------------------------------------------------*/ -/*! \brief Global Interrupt Chip-Wide Vendor Mask: 1E.FF01 */ -/* Global Interrupt Chip-Wide Vendor Mask: 1E.FF01 */ -/*---------------------------------------------------------------------------------*/ -typedef struct -{ - /*! \brief Union for bit and word level access of word 0 of Global Interrupt Chip-Wide Vendor Mask */ - union - { - struct - { - /*! \brief 1E.FF01.F R/WPD PMA Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.pmaVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pmaVendorAlarmInterruptMask : 1; /* 1E.FF01.F R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.E R/WPD PCS Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.pcsVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int pcsVendorAlarmInterruptMask : 1; /* 1E.FF01.E R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.D R/WPD PHY XS Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.phyXS_VendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int phyXS_VendorAlarmInterruptMask : 1; /* 1E.FF01.D R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.C R/WPD Autonegotiation Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.autonegotiationVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int autonegotiationVendorAlarmInterruptMask : 1; /* 1E.FF01.C R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.B R/WPD GbE Vendor Alarm Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.gbeVendorAlarmInterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int gbeVendorAlarmInterruptMask : 1; /* 1E.FF01.B R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - unsigned int reserved0 : 8; - /*! \brief 1E.FF01.2 R/WPD Global Alarms 1 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.globalAlarms_1InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_1InterruptMask : 1; /* 1E.FF01.2 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.1 R/WPD Global Alarms 2 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.globalAlarms_2InterruptMask - - Provisionable Default = 0x0 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_2InterruptMask : 1; /* 1E.FF01.1 R/WPD Provisionable Default = 0x0 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - /*! \brief 1E.FF01.0 R/WPD Global Alarms 3 Interrupt Mask - AQ_GlobalInterruptChip_wideVendorMask_HHD.u0.bits_0.globalAlarms_3InterruptMask - - Provisionable Default = 0x1 - - 1 = Enable interrupt generation - 0 = Disable interrupt generation - */ - unsigned int globalAlarms_3InterruptMask : 1; /* 1E.FF01.0 R/WPD Provisionable Default = 0x1 */ - /* 1 = Enable interrupt generation - 0 = Disable interrupt generation */ - } bits_0; - uint16_t word_0; - } u0; -} AQ_GlobalInterruptChip_wideVendorMask_HHD; - -#endif -/*@}*/ -/*@}*/ diff --git a/feeds/ipq807x/aq-fw-download/src/mdioBootLoadCLD.c b/feeds/ipq807x/aq-fw-download/src/mdioBootLoadCLD.c deleted file mode 100755 index a8e09d8c9..000000000 --- a/feeds/ipq807x/aq-fw-download/src/mdioBootLoadCLD.c +++ /dev/null @@ -1,193 +0,0 @@ -/* mdioBootLoadCLD.c */ - -/************************************************************************************ -* Copyright (c) 2015 Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* $File: //depot/icm/proj/Dena/rev1.0/c/Systems/tools/windows/flashUtilities/src/mdioBootLoadCLD.c $ -* -* $Revision: #12 $ -* -* $DateTime: 2014/05/19 15:34:49 $ -* -* $Author: joshd $ -* -* $Label: $ -* -************************************************************************************/ - -/*! \file -This file contains the main (int, char**) file for the mdioBootLoadCLD program, which burns a flash image into a target -Aquantia PHY using the AQ_API. This program calls the API function:

- - uint8_t AQ_API_WriteBootLoadImage (uint8_t PHY_ID, uint8_t *image, uint16_t *crc16)

- -to boot load a cld flash image into an Aquantia PHY */ - -/*! \addtogroup mdioBootLoad -@{ -*/ - - - -/*! \def DEBUG -Uncomment this to compile in debug mode. This sets the source to an arbitrary file, defined by DEBUG_FILENAME, -and an arbitrary PHY_ID, defined by DEBUG_PHY_ID. */ -/* #define DEBUG */ - -/*! The debug source file name */ -#define DEBUG_FILENAME "HelloWorld.cld" - -/*! The debug PHY ID */ -#define DEBUG_PHY_ID 0 - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "AQ_API.h" -#include "AQ_PhyInterface.h" - -int sock; -char devname[7]; - -int sock_init() -{ - if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - fprintf(stderr, "Error creating socket: %s\n", strerror(errno)); - return -1; - } - - return 0; -} - -int main ( int argc, char **argp) -{ - /* declare local variables */ - FILE *pFile; - uint8_t* image; - uint8_t byte; - unsigned int PHY_ID; - AQ_Retcode resultCode; - AQ_Retcode resultCodes[4]; - uint32_t i; - uint32_t imageSize; - char sourceFileName[1000]; - AQ_API_Port targetPort0; - AQ_API_Port* targetPorts[1]; - AQ_API_Port broadcastPort; - unsigned int provisioningAddresses[1] = {0}; - uint32_t reg1, reg2; - - targetPorts[0] = &targetPort0; - - if(argc < 4) { - fprintf (stderr, "enter file name/netdev name/phy address\n"); - return (101); - } - - /*Copy the file name from command line arg*/ - if (strlcpy (sourceFileName, argp[1], sizeof(sourceFileName)) >= sizeof(sourceFileName)) { - fprintf (stderr, "Filename: %s too long \n", argp[1]); - return (101); - } - /*Copy the interface name from command line arg*/ - strlcpy (devname, argp[2], sizeof(devname)); - /*Get PHY Address from command line arg*/ - PHY_ID = (unsigned int)strtoul(argp[3], NULL, 0); - - /* FIXME: set port and device type */ - targetPort0.device = AQ_DEVICE_HHD; - targetPort0.PHY_ID = PHY_ID; - - broadcastPort.device = AQ_DEVICE_HHD; - broadcastPort.PHY_ID = PHY_ID; - - /* open the source in binary read mode */ - pFile = fopen(sourceFileName, "rb"); - if (pFile == NULL) - { - fprintf (stderr, "Unable to open source file %s\n", sourceFileName); - return (101); - } - fseek (pFile, 0, SEEK_END); - imageSize = ftell (pFile); - - image = (uint8_t*) malloc (imageSize * sizeof(uint8_t)); - fseek (pFile, 0, SEEK_SET); - - /* load the file */ - for (i = 0; i < imageSize; i++) - { - byte = (uint8_t) fgetc (pFile); - image[i] = byte; - } - fclose(pFile); - - - if (sock_init() < 0) - { - fprintf (stderr, "Unable to initialize interface\n"); - return (200); - } - - /* Write in the Auantia phy scratch pad register, - * read back the same reg and match the values written. - */ - AQ_API_MDIO_Write(PHY_ID, 0x1e, 0x300, 0xdead); - AQ_API_MDIO_Write(PHY_ID, 0x1e, 0x301, 0xbeaf); - reg1 = AQ_API_MDIO_Read(PHY_ID, 0x1e, 0x300); - reg2 = AQ_API_MDIO_Read(PHY_ID, 0x1e, 0x301); - if(reg1 != 0xdead && reg2 != 0xbeaf) { - fprintf (stderr, "Scratchpad Read/Write test fail\n"); - return (101); - } - - /* call the boot-load function */ - resultCode = AQ_API_WriteBootLoadImage(targetPorts, 1, provisioningAddresses, resultCodes, &imageSize, image, PHY_ID, &broadcastPort); - - switch (resultCode) - { - case 0: - printf("Image load good - mailbox CRC-16 matches\n"); - free (image); - close(sock); - return 0; - - case 1: - fprintf (stderr, "CRC-16 on file is bad\n"); - free (image); - close(sock); - return 1; - - case 2: - fprintf (stderr, "CRC-16 check on image load failed (mailbox CRC-16 check)\n"); - free (image); - close(sock); - return 2; - - default: - fprintf (stderr, "Invalid return code\n"); - free (image); - close(sock); - } - return 12; -} -/*@}*/ diff --git a/feeds/ipq807x/aq-fw-download/src/src/AQ_API.c b/feeds/ipq807x/aq-fw-download/src/src/AQ_API.c deleted file mode 100755 index 89e73344f..000000000 --- a/feeds/ipq807x/aq-fw-download/src/src/AQ_API.c +++ /dev/null @@ -1,1021 +0,0 @@ -/*AQ_API.c*/ - -/************************************************************************************ -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* Description: -* -* This file contains the code for all of the API functions defined in AQ_API.h -* -************************************************************************************/ - - -/*! \file -* This file contains the code for all of the API functions defined in AQ_API.h - */ - -#include -#include - -#include "AQ_API.h" -#include "AQ_User.h" -#include "AQ_RegMacro.h" -#include "AQ_PlatformRoutines.h" -#include "AQ_RegMaps.h" -#include "AQ_ReturnCodes.h" - -#ifdef AQ_VERBOSE - #include - #include -#endif - - -#ifndef AQ_TIME_T_EXISTS - #ifndef AQ_MDIO_READS_PER_SECOND - #error AQ_MDIO_READS_PER_SECOND in AQ_User.h must be defined, as AQ_TIME_T_EXISTS is currently undefined! - #endif -#endif - -#ifdef AQ_TIME_T_EXISTS - #include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef AQ_ENABLE_UP_BUSY_CHECKS - #ifdef AQ_VERBOSE - #define AQ_API_UP_BUSY_PRINT_STATEMENT printf("uP-busy check timed out.\n"); - #else - #define AQ_API_UP_BUSY_PRINT_STATEMENT /* nothing */ - #endif - - #ifdef AQ_TIME_T_EXISTS - #define AQ_API_UP_BUSY_TIMEOUT (CLOCKS_PER_SEC / 10) - - #define AQ_API_DECLARE_UP_BUSY_VARS AQ_API_Variable(AQ_GlobalGeneralStatus) \ - uint16_t uPbusy; \ - clock_t startTime; \ - AQ_boolean uPBusyTimeoutOccurred = False; - - #define AQ_API_CHECK_UP_NOT_BUSY AQ_API_Wait(1, port); \ - startTime = clock(); \ - do \ - { \ - AQ_API_Get(port->PHY_ID, AQ_GlobalGeneralStatus, processorIntensiveMdioOperationIn_Progress, uPbusy); \ - if ((clock() - startTime) > AQ_API_UP_BUSY_TIMEOUT) \ - { \ - AQ_API_UP_BUSY_PRINT_STATEMENT \ - uPBusyTimeoutOccurred = True; \ - break; \ - } \ - } while (uPbusy != 0); - #else - #define AQ_API_UP_BUSY_MAX_CHECKS (AQ_MDIO_READS_PER_SECOND * 5) - - #define AQ_API_DECLARE_UP_BUSY_VARS AQ_API_Variable(AQ_GlobalGeneralStatus) \ - uint16_t uPbusy; \ - uint32_t numChecks; \ - AQ_boolean uPBusyTimeoutOccurred = False; - - #define AQ_API_CHECK_UP_NOT_BUSY AQ_API_Wait(1, port); \ - numChecks = 0; \ - do \ - { \ - AQ_API_Get(port->PHY_ID, AQ_GlobalGeneralStatus, processorIntensiveMdioOperationIn_Progress, uPbusy); \ - if (numChecks++ > AQ_API_UP_BUSY_MAX_CHECKS) \ - { \ - AQ_API_UP_BUSY_PRINT_STATEMENT \ - uPBusyTimeoutOccurred = True; \ - break; \ - } \ - } while (uPbusy != 0); - #endif - - /* If a uP busy timeout occurred, return the corresponding return code; otherwise, return - * retval. retval should be a return code defined in AQ_ReturnCodes. */ - #define AQ_API_RETURN_UP_BUSY(retval) return (uPBusyTimeoutOccurred ? AQ_RET_UP_BUSY_TIMEOUT : retval); - -#else - #define AQ_API_DECLARE_UP_BUSY_VARS /* nothing */ - #define AQ_API_CHECK_UP_NOT_BUSY /* nothing */ - #define AQ_API_RETURN_UP_BUSY(retval) return retval; -#endif - - -/*! FW image version string maximum length. */ -#define AQ_VERSION_STRING_SIZE 0x40 - -/*! The byte offset from top of DRAM to the FW image version string. */ -#define AQ_VERSION_STRING_BLOCK_OFFSET 0x0200 - -/*! The byte address, in processor memory, of the start of the IRAM segment. */ -#define AQ_IRAM_BASE_ADDRESS 0x40000000 - -/*! The byte address, in processor memory, of the start of the DRAM segment. */ -#define AQ_DRAM_BASE_ADDRESS 0x3FFE0000 - -/*! The byte offset from the top of the PHY image to the header content (HHD devices). */ -#define AQ_PHY_IMAGE_HEADER_CONTENT_OFFSET_HHD 0x300 - -/*! The byte offset from the top of the PHY image to the header content (APPIA devices). */ -#define AQ_PHY_IMAGE_HEADER_CONTENT_OFFSET_APPIA 0 - -/*! The offset, from the start of DRAM, where the provisioning block begins. */ -#define AQ_PHY_IMAGE_PROVTABLE_OFFSET 0x680 - -/*! The offset, from the start of DRAM, where the provisioning block's ending address is recorded. */ -#define AQ_PHY_IMAGE_PROVTABLE_TERM_OFFSET 0x028C - -/*! The size of the space alloted within the PHY image for the provisioning table. */ -#define AQ_PHY_IMAGE_PROVTABLE_MAXSIZE 0x800 - -/*! The maximum number of polling cycles ever required before the FLASH interface is ready. */ -#define AQ_FLASH_INTERFACE_MAX_POLL_COUNT 20 - -/*! The maximum number of ports that can be MDIO bootloaded at once. */ -#define AQ_MAX_NUM_PHY_IDS 48 - -/*! The maximum allowed number of times to poll for debug-trace-freeze acknowledgement. */ -#define AQ_MAX_FREEZE_CHECKS 2000 - -/*! The maximum size of the debug trace buffer. */ -#define AQ_MAX_TRACE_BUFFER_LENGTH 8192 - -/*! The maximum allowed number of times to poll for SERDES Rx eye measurement done. */ -#define AQ_SERDESEYE_MAX_DONE_CHECKS 50 - -/*! The maximum allowed number of times to poll for PIF mailbox status. */ -#define MAX_NUM_COMMAND_STATUS_POLLS 700 - -/* REGDOC_START */ - - -/********************************************************************************************************************** -* MDIO Boot Load -**********************************************************************************************************************/ - -const uint16_t AQ_CRC16Table[256] = {0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, - 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, - 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, - 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, - 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, - 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, - 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, - 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, - 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, - 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, - 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, - 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, - 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, - 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, - 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, - 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, - 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, - 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, - 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, - 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, - 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, - 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, - 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0}; - -/*! \addtogroup writingImages - @{ -*/ - -/*! Prepare the specified port for MDIO bootloading. Disables the daisy-chain, - * and explicitly sets the port's provisioningAddress. */ -void AQ_API_EnableMDIO_BootLoadMode -( - /*! The target PHY port.*/ - AQ_API_Port* port, - /*! The provisioning address to use when the FW starts and applies the - * bootloaded image's provisioned values. */ - unsigned int provisioningAddress -) -{ - AQ_API_Variable(AQ_GlobalNvrProvisioning) - - AQ_API_DeclareLocalStruct(AQ_GlobalReservedProvisioning, globalReservedProvisioning) - - - /* disable the daisy-chain */ - /* REGDOC: Read-Modify-Write bitfield (HHD/APPIA: 1E.C452.0) */ - AQ_API_Set(port->PHY_ID, AQ_GlobalNvrProvisioning, nvrDaisyChainDisable, 1); - - /* override the hop-count */ - AQ_API_AssignWordOfLocalStruct(globalReservedProvisioning, 1, - /* REGDOC: Read register (HHD/APPIA: 1E.C470 + 1) */ - AQ_API_ReadRegister(port->PHY_ID, AQ_GlobalReservedProvisioning, 1)); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C471.5:0) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalReservedProvisioning, globalReservedProvisioning, - daisy_chainHop_countOverrideValue, provisioningAddress); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C471.6) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalReservedProvisioning, globalReservedProvisioning, - enableDaisy_chainHop_countOverride, 1); - /* REGDOC: Write register (HHD/APPIA: 1E.C470 + 1) */ - AQ_API_WriteRegister(port->PHY_ID, AQ_GlobalReservedProvisioning, 1, - AQ_API_WordOfLocalStruct(globalReservedProvisioning, 1)); - - return; -} - - -/*! Prepare the specified port for MDIO bootloading, and set the temporary MDIO - * address to be used during the bootload process. Disables the daisy-chain, - * and explicitly sets the port's provisioningAddress. */ -void AQ_API_EnableGangLoadMode -( - /*! The target PHY port.*/ - AQ_API_Port* port, - /*! The provisioning address to use when the FW starts and applies the - * bootloaded image's provisioned values. */ - unsigned int provisioningAddress, - /*! The PHY's MDIO address will be changed to this value during the - * bootload process. */ - unsigned int gangLoadAddress -) -{ - /*AQ_API_Variable_DeviceRestricted(APPIA, AQ_GlobalGeneralProvisioning)*/ - AQ_API_Variable(AQ_GlobalGeneralProvisioning) - - - /* Get ready for MDIO bootloading. */ - AQ_API_EnableMDIO_BootLoadMode(port, provisioningAddress); - - /* Enable gangload mode. After doing this, the PHY will be - * addressable at the MDIO address indicated by gangLoadAddress. - * Now that the PHY is in gangload mode, MDIO reads are prohibited - * until AQ_API_DisableGangLoadMode is called. */ - if (AQ_DEVICE_APPIA == port->device) - { - /* REGDOC: Read-Modify-Write bitfield (APPIA: 1E.C440.8:4) */ - AQ_API_Set_DeviceRestricted(APPIA, port->PHY_ID, AQ_GlobalGeneralProvisioning, - gangLoadMdioAddress, gangLoadAddress); - } - else if (AQ_DEVICE_HHD == port->device) - { - /* REGDOC: Read-Modify-Write bitfield (HHD: 1E.C447.4:0) */ - AQ_API_Set_DeviceRestricted(HHD, port->PHY_ID, AQ_GlobalGeneralProvisioning, - mdioBroadcastAddressConfiguration, gangLoadAddress); - /* REGDOC: Read-Modify-Write bitfield (HHD: 1E.C441.E) */ - AQ_API_Set_DeviceRestricted(HHD, port->PHY_ID, AQ_GlobalGeneralProvisioning, - mdioBroadcastModeEnable, 1); - } - - return; -} - - -/*! Restore the PHY's MDIO address to the pin-specified value. Should be - * called when MDIO bootloading is complete, to return to normal MDIO - * addressing. - * This is a gang-load function, hence write-only! */ -void AQ_API_DisableGangLoadMode -( - /*! The target PHY port.*/ - AQ_API_Port* port, - /*! The value to write to of AQ_GlobalGeneralProvisioning.u1.word_1. */ - uint16_t origVal_GGP1 -) -{ - AQ_API_DeclareLocalStruct(AQ_GlobalGeneralProvisioning, globalGeneralProvisioning) - - - /* Restore the original value of globalGeneralProvisioning.u1, and set - * the MDIO address reset bit. This will cause the MDIO address to be - * reset to the value indicated by the pins. */ - AQ_API_AssignWordOfLocalStruct(globalGeneralProvisioning, 1, origVal_GGP1); - if (AQ_DEVICE_APPIA == port->device) - { - /* REGDOC: Assign to local representation of bitfield (APPIA: 1E.C441.2) */ - AQ_API_AssignBitfieldOfLocalStruct_DeviceRestricted(APPIA, AQ_GlobalGeneralProvisioning, - globalGeneralProvisioning, mdioAddressReset, 1); - } - else if (AQ_DEVICE_HHD == port->device) - { - /* REGDOC: Assign to local representation of bitfield (HHD: 1E.C441.E) */ - AQ_API_AssignBitfieldOfLocalStruct_DeviceRestricted(HHD, AQ_GlobalGeneralProvisioning, - globalGeneralProvisioning, mdioBroadcastModeEnable, 0); - } - /* REGDOC: Write register (HHD/APPIA: 1E.C440 + 1) */ - AQ_API_WriteRegister(port->PHY_ID, AQ_GlobalGeneralProvisioning, 1, - AQ_API_WordOfLocalStruct(globalGeneralProvisioning, 1)); - - /* The PHY has now exited gang-load mode. */ - return; -} - - -AQ_Retcode AQ_API_WriteBootLoadImageWithProvTable -( - AQ_API_Port** ports, - unsigned int numPorts, - unsigned int* provisioningAddresses, - AQ_Retcode* resultCodes, - uint32_t* imageSizePointer, - uint8_t* image, - uint8_t gangload_MDIO_address, - AQ_API_Port* gangloadPort, - uint32_t* provTableSizePointer, - uint8_t* provTableImage -) -{ - /*------------------------------------- NOTE!!!!!!!!!! ----------------------------------------------------------*/ - /* This function uses word level writes here as in gang-load mode we cannot do a read in a read-modify-write */ - /* operation */ - /*---------------------------------------------------------------------------------------------------------------*/ - - AQ_API_Variable_DeviceRestricted(APPIA, AQ_GlobalPinStatus) - - AQ_API_DeclareLocalStruct(AQ_GlobalControl, globalControl) - AQ_API_DeclareLocalStruct(AQ_GlobalMailboxInterface, globalMailboxInterface) - - AQ_API_Port* port; - uint32_t primaryHeaderPtr = 0x00000000; - uint32_t primaryIramPtr = 0x00000000; - uint32_t primaryDramPtr = 0x00000000; - uint32_t primaryIramSize = 0x00000000; - uint32_t primaryDramSize = 0x00000000; - uint32_t terminatorPtr = 0x00000000; - uint32_t phyImageHeaderContentOffset; - uint32_t i; - uint32_t j; - uint32_t imageSize; - uint32_t provTableImageSize = 0; - uint32_t bytePointer; - uint32_t byteSize; - uint32_t dWordSize; -#ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - uint32_t countPendingOps; /* A count of block MDIO operation pending... necessary to keep a count - in order to ensure we don't exceed the maximum pending operations. */ -#endif - uint16_t msw; - uint16_t lsw; - uint16_t crc16Calculated; - uint16_t provTableCrc16Calculated; - uint16_t fileCRC; - uint16_t provTableFileCRC; - uint16_t mailboxCRC; - uint16_t mailboxWrite; - uint16_t bootLoadMode; - uint16_t recordedGGP1Values[AQ_MAX_NUM_PHY_IDS]; /* When entering/exiting gangload mode, we record and restore - the AQ_GlobalGeneralProvisioning.u1 register values. */ - - - /* store the CRC-16 for the image, which is the last two bytes */ - imageSize = *imageSizePointer; - fileCRC = image[imageSize-2] << 8 | image[imageSize-1]; - - /*------------------------------------- Check the image integrity ------------------------------------------------*/ - crc16Calculated = 0x0000; - for (i = 0; i < imageSize-2; i++) - { - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ image[i]]; - } - - if (crc16Calculated != fileCRC) - { - #ifdef AQ_VERBOSE - printf ("CRC check failed on image file (expected 0x%X, found 0x%X)\n", - fileCRC, crc16Calculated); - #endif - for (j = 0; j < numPorts; j++) - { - /* Before returning, set ALL result codes to indicate "bad image". */ - resultCodes[j] = AQ_RET_FLASH_IMAGE_CORRUPT; - } - return AQ_RET_ERROR; - } -#ifdef AQ_VERBOSE - else - { - printf ("CRC check good on image file (0x%04X)\n", crc16Calculated); - } -#endif - - /*-------------------------------- Check the provisioning table image integrity ----------------------------------*/ - if (provTableSizePointer != NULL && provTableImage != NULL) - { - provTableImageSize = (*provTableSizePointer) - 2; - provTableFileCRC = provTableImage[provTableImageSize + 1] << 8 | - provTableImage[provTableImageSize]; - - provTableCrc16Calculated = 0x0000; - for (i = 0; i < provTableImageSize; i++) - { - provTableCrc16Calculated = ((provTableCrc16Calculated & 0xFF) << 8) ^ - AQ_CRC16Table[(provTableCrc16Calculated >> 8) ^ provTableImage[i]]; - } - - if (provTableCrc16Calculated != provTableFileCRC) - { - #ifdef AQ_VERBOSE - printf ("CRC check failed on provisioning table file (expected 0x%X, found 0x%X)\n", - provTableFileCRC, provTableCrc16Calculated); - #endif - for (j = 0; j < numPorts; j++) - { - /* Before returning, set ALL result codes to indicate "bad image". */ - resultCodes[j] = AQ_RET_FLASH_IMAGE_CORRUPT; - } - return AQ_RET_ERROR; - } - #ifdef AQ_VERBOSE - else - { - printf ("CRC check good on provisioning table file (0x%04X)\n", - provTableCrc16Calculated); - } - #endif - } - - /*------------------------ Check that all provisioning addresses are in the proper range. ------------------------*/ - for (j = 0; j < numPorts; j++) - { - if (provisioningAddresses[j] > 47) - { - #ifdef AQ_VERBOSE - printf ("Provisioning address out of range 0-47 (index %u: %d)\n", j, provisioningAddresses[j]); - #endif - for (j = 0; j < numPorts; j++) - { - /* Before returning, set ALL result codes to indicate "provisioning address out-of-range". */ - resultCodes[j] = AQ_RET_BOOTLOAD_PROVADDR_OOR; - } - return AQ_RET_ERROR; - } - } - - /*--------------------------- Store 1E.C441 values for later use. Enforce uniformity. ---------------------------*/ - for (j = 0; j < numPorts; j++) - { - /* Record the original value of AQ_GlobalGeneralProvisioning.u1.word_1, - * so that we can restore it later after exiting gangload mode. */ - port = ports[j]; - /* REGDOC: Read register (HHD/APPIA: 1E.C440 + 1) */ - recordedGGP1Values[j] = AQ_API_ReadRegister(port->PHY_ID, AQ_GlobalGeneralProvisioning, 1); - - /* If any of the PHYs' GGP1 values don't match the others, set the appropriate - * error code and return. */ - if (j > 0 && recordedGGP1Values[j] != recordedGGP1Values[0]) - { - #ifdef AQ_VERBOSE - printf ("Non-uniform value of 1E.C441 found (expected 0x%X, found 0x%X)\n", - recordedGGP1Values[0], recordedGGP1Values[j]); - #endif - for (j = 0; j < numPorts; j++) - { - /* Before returning, set ALL result codes to indicate "non-uniform GGP1 values". */ - resultCodes[j] = AQ_RET_BOOTLOAD_NONUNIFORM_REGVALS; - } - return AQ_RET_ERROR; - } - } - - /*--------------------------- Put each PHY into gangload mode at the specified address ---------------------------*/ - for (j = 0; j < numPorts; j++) - { - AQ_API_EnableGangLoadMode(ports[j], provisioningAddresses[j], gangload_MDIO_address); - } - /* Set up the port context for using device-restricted macros while in - * gangload mode. */ - port = gangloadPort; - - /*------------------------------------- Stall the uP ------------------------------------------------------------*/ - AQ_API_AssignWordOfLocalStruct(globalControl, 1, 0x0000); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.6) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upRunStallOverride, 1); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.0) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upRunStall, 1); - /* REGDOC: Write register (HHD/APPIA: 1E.C000 + 1) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalControl, 1, - AQ_API_WordOfLocalStruct(globalControl, 1)); - - /*------------------------------------- Initialize the mailbox write command -------------------------------------*/ - AQ_API_AssignWordOfLocalStruct(globalMailboxInterface, 0, 0x0000); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.0200.E) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalMailboxInterface, globalMailboxInterface, upMailboxWriteMode, 1); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.0200.F) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalMailboxInterface, globalMailboxInterface, upMailboxExecuteOperation, 1); - mailboxWrite = AQ_API_WordOfLocalStruct(globalMailboxInterface, 0); - - /*------------------------------------- Read the segment addresses and sizes -------------------------------------*/ - primaryHeaderPtr = (((image[0x9] & 0x0F) << 8) | image[0x8]) << 12; - - if (AQ_DEVICE_APPIA == port->device) - phyImageHeaderContentOffset = AQ_PHY_IMAGE_HEADER_CONTENT_OFFSET_APPIA; - else /* HHD */ - phyImageHeaderContentOffset = AQ_PHY_IMAGE_HEADER_CONTENT_OFFSET_HHD; - - primaryIramPtr = (image[primaryHeaderPtr + phyImageHeaderContentOffset + 0x4 + 2] << 16) | - (image[primaryHeaderPtr + phyImageHeaderContentOffset + 0x4 + 1] << 8) | - image[primaryHeaderPtr + phyImageHeaderContentOffset + 0x4]; - primaryIramSize = (image[primaryHeaderPtr + phyImageHeaderContentOffset + 0x7 + 2] << 16) | - (image[primaryHeaderPtr + phyImageHeaderContentOffset + 0x7 + 1] << 8) | - image[primaryHeaderPtr + phyImageHeaderContentOffset + 0x7]; - primaryDramPtr = (image[primaryHeaderPtr + phyImageHeaderContentOffset + 0xA + 2] << 16) | - (image[primaryHeaderPtr + phyImageHeaderContentOffset + 0xA + 1] << 8) | - image[primaryHeaderPtr + phyImageHeaderContentOffset + 0xA]; - primaryDramSize = (image[primaryHeaderPtr + phyImageHeaderContentOffset + 0xD + 2] << 16) | - (image[primaryHeaderPtr + phyImageHeaderContentOffset + 0xD + 1] << 8) | - image[primaryHeaderPtr + phyImageHeaderContentOffset + 0xD]; - - if (AQ_DEVICE_HHD == port->device) - { - primaryIramPtr += primaryHeaderPtr; - primaryDramPtr += primaryHeaderPtr; - } - -#ifdef AQ_VERBOSE - printf ("\nSegment Addresses and Sizes as read from the PHY ROM image header:\n\n"); - printf ("Primary Iram Address: 0x%x\n", primaryIramPtr); - printf ("Primary Iram Size: 0x%x\n", primaryIramSize); - printf ("Primary Dram Address: 0x%x\n", primaryDramPtr); - printf ("Primary Dram Size: 0x%x\n\n", primaryDramSize); -#endif - - /*----------------------------- Merge the provisioning table into the main image ---------------------------------*/ - if (provTableSizePointer != NULL && provTableImage != NULL) - { - /* Locate the terminator of the built-in provisioning table */ - terminatorPtr = primaryDramPtr + - ((image[primaryDramPtr + AQ_PHY_IMAGE_PROVTABLE_TERM_OFFSET + 1] << 8) | - image[primaryDramPtr + AQ_PHY_IMAGE_PROVTABLE_TERM_OFFSET]); - - #ifdef AQ_VERBOSE - printf("Supplied Provisioning Table At Address: 0x%x\n\n", terminatorPtr); - #endif - - /* Check that the supplied provisioning table will fit within the alloted - * space. */ - if (terminatorPtr - (primaryDramPtr + AQ_PHY_IMAGE_PROVTABLE_OFFSET) + - provTableImageSize > AQ_PHY_IMAGE_PROVTABLE_MAXSIZE) - { - for (j = 0; j < numPorts; j++) - { - /* Before returning, set ALL result codes to indicate "provisioning - * table too large". */ - resultCodes[j] = AQ_RET_BOOTLOAD_PROVTABLE_TOO_LARGE; - } - return AQ_RET_ERROR; - } - - /* Write the supplied provisioning table into the image, starting at the - * terminator address. */ - for (i = 0; i < provTableImageSize; i++) - { - image[terminatorPtr + i] = provTableImage[i]; - } - } - - /*------------------------------------- Load IRAM and DRAM -------------------------------------------------------*/ - /* clear the mailbox CRC */ - AQ_API_AssignWordOfLocalStruct(globalMailboxInterface, 0, 0x0000); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.0200.C) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalMailboxInterface, globalMailboxInterface, resetUpMailboxCrc, 1); - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, - AQ_API_WordOfLocalStruct(globalMailboxInterface, 0)); - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, 0x0000); - - crc16Calculated = 0; /* This is to calculate what was written through the mailbox */ - - /* load the IRAM */ -#ifdef AQ_VERBOSE - printf ("\nLoading IRAM:\n\n"); -#endif - - /* dWord align the address: note the image addressing is byte based, but is properly aligned on dWord - boundaries, so the 2 LSbits of the block start are always zero. */ - msw = (uint16_t) (AQ_IRAM_BASE_ADDRESS >> 16); - AQ_API_AssignWordOfLocalStruct(globalMailboxInterface, 3, 0x0000); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.0203.1:0) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalMailboxInterface, globalMailboxInterface, - upMailboxAddressLSW , (AQ_IRAM_BASE_ADDRESS & 0xFFFF) >> 2); - lsw = AQ_API_WordOfLocalStruct(globalMailboxInterface, 3); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 2) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 2, msw); /* MSW */ - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 3) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 3, lsw); /* LSW */ - - - /* set block size so that there are from 0-3 bytes remaining */ - byteSize = primaryIramSize; - dWordSize = byteSize >> 2; - - bytePointer = primaryIramPtr; -#ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - countPendingOps = 0; -#endif - for (i = 0; i < dWordSize; i++) - { - /* write 4 bytes of data */ - lsw = (image[bytePointer+1] << 8) | image[bytePointer]; - bytePointer += 2; - msw = (image[bytePointer+1] << 8) | image[bytePointer]; - bytePointer += 2; - - #ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - AQ_API_BlockWriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - AQ_API_BlockWriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - AQ_API_BlockWriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - - countPendingOps += 3; - /* Check if we've filled our output buffer, and if so, flush. */ - if (countPendingOps >= AQ_API_MDIO_MaxBlockOperations() - 3 ) - { - AQ_API_MDIO_BlockOperationExecute (gangloadPort->PHY_ID); - countPendingOps = 0; - } - #else - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 4) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 5) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - #endif - - /* update the calculated CRC */ - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (msw >> 8)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (msw & 0xFF)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (lsw >> 8)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (lsw & 0xFF)]; - - #ifdef AQ_VERBOSE - if (i && ((i % 512) == 0)) printf(" Byte: %X:\n", i << 2); - #endif - } - -#ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - /* flush the output buffer one last time. */ - AQ_API_MDIO_BlockOperationExecute(gangloadPort->PHY_ID); - countPendingOps = 0; -#endif - - /* Note: this final write right-justifies non-dWord data in the final dWord */ - switch (byteSize & 0x3) - { - case 0x1: - /* write 1 byte of data */ - lsw = image[bytePointer++]; - msw = 0x0000; - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 4) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 5) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - - /* no polling */ - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - break; - - case 0x2: - /* write 2 bytes of data */ - lsw = (image[bytePointer+1] << 8) | image[bytePointer]; - bytePointer += 2; - msw = 0x0000; - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 4) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 5) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - - /* no polling */ - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - break; - - case 0x3: - /* write 3 bytes of data */ - lsw = (image[bytePointer+1] << 8) | image[bytePointer]; - bytePointer += 2; - msw = image[bytePointer++]; - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 4) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 5) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - - /* no polling */ - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - break; - } - - if (byteSize & 0x3) - { - /* update the calculated CRC */ - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (msw >> 8)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (msw & 0xFF)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (lsw >> 8)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (lsw & 0xFF)]; - } - - /* load the DRAM */ -#ifdef AQ_VERBOSE - printf ("\nCRC-16 after loading IRAM: 0x%X\n", crc16Calculated); - printf ("\nLoading DRAM:\n\n"); -#endif - - /* dWord align the address: note the image addressing is byte based, but is properly aligned on dWord - boundaries, so the 2 LSbits of the block start are always zero. */ - msw = (uint16_t) (AQ_DRAM_BASE_ADDRESS >> 16); - AQ_API_AssignWordOfLocalStruct(globalMailboxInterface, 3, 0x0000); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.0203.1:0) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalMailboxInterface, globalMailboxInterface, - upMailboxAddressLSW, (AQ_DRAM_BASE_ADDRESS & 0xFFFF) >> 2); - lsw = AQ_API_WordOfLocalStruct(globalMailboxInterface, 3); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 2) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 2, msw); /* MSW */ - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 3) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 3, lsw); /* LSW */ - - - /* set block size so that there are from 0-3 bytes remaining */ - byteSize = primaryDramSize; - dWordSize = byteSize >> 2; - - bytePointer = primaryDramPtr; - for (i = 0; i < dWordSize; i++) - { - /* write 4 bytes of data */ - lsw = (image[bytePointer+1] << 8) | image[bytePointer]; - bytePointer += 2; - msw = (image[bytePointer+1] << 8) | image[bytePointer]; - bytePointer += 2; - - #ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - AQ_API_BlockWriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - AQ_API_BlockWriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - AQ_API_BlockWriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - - countPendingOps += 3; - /* Check if we've filled our output buffer, and if so, flush. */ - if (countPendingOps >= AQ_API_MDIO_MaxBlockOperations() - 3 ) - { - AQ_API_MDIO_BlockOperationExecute (gangloadPort->PHY_ID); - countPendingOps = 0; - } - #else - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 4) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 5) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - #endif - - /* update the calculated CRC */ - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (msw >> 8)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (msw & 0xFF)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (lsw >> 8)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (lsw & 0xFF)]; - - #ifdef AQ_VERBOSE - if (i && ((i % 512) == 0)) printf(" Byte: %X:\n", i << 2); - #endif - } - -#ifdef AQ_PHY_SUPPORTS_BLOCK_READ_WRITE - /* flush the output buffer one last time. */ - AQ_API_MDIO_BlockOperationExecute(gangloadPort->PHY_ID); - countPendingOps = 0; -#endif - - /* Note: this final write right-justifies non-dWord data in the final dWord */ - switch (byteSize & 0x3) - { - case 0x1: - /* write 1 byte of data */ - lsw = image[bytePointer++]; - msw = 0x0000; - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 4) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 5) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - - /* no polling */ - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - break; - - case 0x2: - /* write 2 bytes of data */ - lsw = (image[bytePointer+1] << 8) | image[bytePointer]; - bytePointer += 2; - msw = 0x0000; - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 4) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 5) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - - /* no polling */ - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - break; - - case 0x3: - /* write 3 bytes of data */ - lsw = (image[bytePointer+1] << 8) | image[bytePointer]; - bytePointer += 2; - msw = image[bytePointer++]; - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 4) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 4, msw); - /* REGDOC: Write register (HHD/APPIA: 1E.0200 + 5) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 5, lsw); - - /* no polling */ - /* REGDOC: Write register (HHD/APPIA: 1E.0200) */ - AQ_API_WriteRegister(gangloadPort->PHY_ID, AQ_GlobalMailboxInterface, 0, mailboxWrite); - break; - } - - if (byteSize & 0x3) - { - /* update the calculated CRC */ - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (msw >> 8)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (msw & 0xFF)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (lsw >> 8)]; - crc16Calculated = ((crc16Calculated & 0xFF) << 8) ^ AQ_CRC16Table[(crc16Calculated >> 8) ^ (lsw & 0xFF)]; - } - - /*------------------------------------- Exit gangload mode -------------------------------------------------------*/ - AQ_API_DisableGangLoadMode(gangloadPort, recordedGGP1Values[0]); - - /*------------------------------------- Check mailbox CRCs -------------------------------------------------------*/ - /* check to make sure the mailbox CRC matches the calculated CRC */ - /*foundMailboxCRCMismatch = False;*/ - for (j = 0; j < numPorts; j++) - { - /* REGDOC: Read register (HHD/APPIA: 1E.0200 + 1) */ - mailboxCRC = AQ_API_ReadRegister(ports[j]->PHY_ID,AQ_GlobalMailboxInterface, 1); - if (mailboxCRC != crc16Calculated) - { - #ifdef AQ_VERBOSE - printf("\n%uth port: Mailbox CRC-16 (0x%X) does not match calculated CRC-16 (0x%X)\n", - j, mailboxCRC, crc16Calculated); - #endif - /* Note that we can't just return here, because we still need to - * release the uPs for the other PHYs that might have been - * bootloaded successfully. */ - resultCodes[j] = AQ_RET_BOOTLOAD_CRC_MISMATCH; - } - #ifdef AQ_VERBOSE - else - { - printf("\n%uth port: Image load good - mailbox CRC-16 matches (0x%X)\n", - j, mailboxCRC); - resultCodes[j] = AQ_RET_OK; - } - #endif - } - - /*------------------------------------- Clear any resets ---------------------------------------------------------*/ - for (j = 0; j < numPorts; j++) - { - /* REGDOC: Write register (HHD/APPIA: 1E.0000) */ - AQ_API_WriteRegister(ports[j]->PHY_ID,AQ_GlobalStandardControl_1, 0, 0x0000); - } - - /*------------------------------------- Release the uP -----------------------------------------------------------*/ - AQ_API_AssignWordOfLocalStruct(globalControl, 1, 0x0000); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.6) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upRunStallOverride, 1); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.0) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upRunStall, 1); - for (j = 0; j < numPorts; j++) - { - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.F) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upReset, 0); - /* REGDOC: Write register (HHD/APPIA: 1E.C000 + 1) */ - AQ_API_WriteRegister(ports[j]->PHY_ID,AQ_GlobalControl, 1, - AQ_API_WordOfLocalStruct(globalControl, 1)); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.F) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upReset, 1); - /* REGDOC: Write register (HHD/APPIA: 1E.C000 + 1) */ - AQ_API_WriteRegister(ports[j]->PHY_ID,AQ_GlobalControl, 1, - AQ_API_WordOfLocalStruct(globalControl, 1)); - } - - /* Need to wait at least 100us. */ - AQ_API_Wait(1, ports[0]); - - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.F) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upReset, 0); - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.0) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upRunStall, 0); - for (j = 0; j < numPorts; j++) - { - if (AQ_DEVICE_APPIA == port->device) - { - /* If the BOOT_LD pins are set to MDIO boot load mode, we can't clear the - * uP run stall override bit. If we did, the uP would stall. */ - /* REGDOC: Read bitfield (APPIA: 1E.C840.E:D) */ - AQ_API_Get_DeviceRestricted(APPIA, j, AQ_GlobalPinStatus, mdioBootLoad, bootLoadMode); - if (bootLoadMode == 0x1) - { - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.6) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upRunStallOverride, 1); - } - else - { - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.6) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upRunStallOverride, 0); - } - } - else - { - /* For post-APPIA devices, always set the uP stall override bit to - * smooth over any packaging differences WRT the boot load pin. */ - /* REGDOC: Assign to local representation of bitfield (HHD/APPIA: 1E.C001.6) */ - AQ_API_AssignBitfieldOfLocalStruct(AQ_GlobalControl, globalControl, upRunStallOverride, 1); - } - - /* REGDOC: Write register (HHD/APPIA: 1E.C000 + 1) */ - AQ_API_WriteRegister(ports[j]->PHY_ID,AQ_GlobalControl, 1, - AQ_API_WordOfLocalStruct(globalControl, 1)); - } - - /* NOTE!!! We can't re-enable the daisy-chain here, as this will overwrite the IRAM and DRAM with the FLASH contents*/ - - /* If any of the ports was not bootloaded successfully, return AQ_RET_ERROR */ - for (j = 0; j < numPorts; j++) - { - if (resultCodes[j] != AQ_RET_OK) - return AQ_RET_ERROR; - } - - /* All ports were bootloaded successfully. */ - return AQ_RET_OK; -} - - -AQ_Retcode AQ_API_WriteBootLoadImage -( - AQ_API_Port** ports, - unsigned int numPorts, - unsigned int* provisioningAddresses, - AQ_Retcode* resultCodes, - uint32_t* imageSizePointer, - uint8_t* image, - uint8_t gangload_MDIO_address, - AQ_API_Port* gangloadPort -) -{ - return AQ_API_WriteBootLoadImageWithProvTable(ports, numPorts, - provisioningAddresses, resultCodes, imageSizePointer, image, - gangload_MDIO_address, gangloadPort, NULL, NULL); -} - - -AQ_Retcode AQ_API_EnableDaisyChain -( - /*! The target PHY port.*/ - AQ_API_Port* port -) -{ - - /* declare local variables */ - AQ_API_Variable(AQ_GlobalNvrProvisioning) - AQ_API_Variable(AQ_GlobalReservedProvisioning) - - /* disable the hop-count override */ - /* REGDOC: Read-Modify-Write bitfield (HHD/APPIA: 1E.C471.6) */ - AQ_API_Set(port->PHY_ID, AQ_GlobalReservedProvisioning, enableDaisy_chainHop_countOverride, 0); - - /* enable the daisy-chain */ - /* REGDOC: Read-Modify-Write bitfield (HHD/APPIA: 1E.C452.0) */ - AQ_API_Set(port->PHY_ID, AQ_GlobalNvrProvisioning, nvrDaisyChainDisable, 0); - - return AQ_RET_OK; -} - -/*@}*/ - - -#ifdef __cplusplus -} -#endif diff --git a/feeds/ipq807x/aq-fw-download/src/src/AQ_PhyInterface.c b/feeds/ipq807x/aq-fw-download/src/src/AQ_PhyInterface.c deleted file mode 100755 index a82c87e99..000000000 --- a/feeds/ipq807x/aq-fw-download/src/src/AQ_PhyInterface.c +++ /dev/null @@ -1,141 +0,0 @@ -/* AQ_PhyInterface.c */ - -/************************************************************************************ -* Copyright (c) 2015, Aquantia -* -* Permission to use, copy, modify, and/or distribute this software for any -* purpose with or without fee is hereby granted, provided that the above -* copyright notice and this permission notice appear in all copies. -* -* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -* -* $Revision: #12 $ -* -* $DateTime: 2015/02/25 15:34:49 $ -* -* $Label: $ -* -************************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include "AQ_PhyInterface.h" -#include "AQ_PlatformRoutines.h" - -#define MII_ADDR_C45 (0x8000) - -extern int sock; -extern char devname[7]; - -static struct ifreq ifr; - -/*! Provides generic synchronous PHY register write functionality. It is the - * responsibility of the system designer to provide the specific MDIO address - * pointer updates, etc. in order to accomplish this write operation. - * It will be assumed that the write has been completed by the time this - * function returns.*/ -void AQ_API_MDIO_Write( - /*! Uniquely identifies the port within the system. AQ_Port must be - * defined to a whatever data type is suitable for the platform.*/ - AQ_Port PHY_ID, - /*! The address of the MMD within the target PHY. */ - unsigned int MMD, - /*! The 16-bit address of the PHY register being written. */ - unsigned int address, - /*! The 16-bits of data to write to the specified PHY register. */ - unsigned int data) -{ - struct mii_ioctl_data mii; - - /* - * Frame the control structures - * and send the ioctl to kernel. - */ - memset(&ifr, 0, sizeof(ifr)); - strlcpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)); - memset(&mii, 0, sizeof(mii)); - memcpy(&mii, &ifr.ifr_data, sizeof(mii)); - mii.phy_id = MII_ADDR_C45 | PHY_ID << 5 | MMD; - mii.reg_num = address; - mii.val_in = data; - memcpy(&ifr.ifr_data, &mii, sizeof(mii)); - - if (ioctl(sock, SIOCSMIIREG, &ifr) < 0) { - fprintf(stderr, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name, - strerror(errno)); - } - - return; -} - -/*! Provides generic synchronous PHY register read functionality. It is the - * responsibility of the system designer to provide the specific MDIO address - * pointer updates, etc. in order to accomplish this read operation.*/ -unsigned int AQ_API_MDIO_Read -( - /*! Uniquely identifies the port within the system. AQ_Port must be - * defined to a whatever data type is suitable for the platform.*/ - AQ_Port PHY_ID, - /*! The address of the MMD within the target PHY. */ - unsigned int MMD, - /*! The 16-bit address of the PHY register being read. */ - unsigned int address) -{ - struct mii_ioctl_data mii; - - /* - * Frame the control structures - * and send the ioctl to kernel. - */ - memset(&ifr, 0, sizeof(ifr)); - strlcpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name)); - memset(&mii, 0, sizeof(mii)); - memcpy(&mii, &ifr.ifr_data, sizeof(mii)); - mii.phy_id = MII_ADDR_C45 | PHY_ID << 5 | MMD; - mii.reg_num = address; - memcpy(&ifr.ifr_data, &mii, sizeof(mii)); - - if (ioctl(sock, SIOCGMIIREG, &ifr) < 0) { - fprintf(stderr, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name, - strerror(errno)); - return -1; - } else { - memcpy(&mii, &ifr.ifr_data, sizeof(mii)); - } - - - return mii.val_out; -} - -/*! Returns after at least milliseconds have elapsed. This must be implemented - * * in a platform-approriate way. AQ_API functions will call this function to - * * block for the specified period of time. If necessary, PHY register reads - * * may be performed on port to busy-wait. */ -void AQ_API_Wait( - uint32_t milliseconds, /*!< The delay in milliseconds */ - AQ_API_Port* port /*!< The PHY to use if delay reads are necessary*/ ) -{ - unsigned long long mirco = milliseconds *1000; - usleep(mirco); -} diff --git a/feeds/ipq807x/ipq807x/Makefile b/feeds/ipq807x/ipq807x/Makefile deleted file mode 100644 index 140cb965b..000000000 --- a/feeds/ipq807x/ipq807x/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -include $(TOPDIR)/rules.mk - -ARCH:=arm -BOARD:=ipq807x -BOARDNAME:=Qualcomm Atheros AX -SUBTARGETS:=ipq807x ipq60xx ipq50xx -FEATURES:=squashfs ramdisk nand pcie usb -KERNELNAME:=Image dtbs -CPU_TYPE:=cortex-a7 -DEVICE_TYPE:=qsdk - -KERNEL_PATCHVER:=4.4 -KERNEL_NAME_SUFFIX=-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016 -KERNEL_QSDK_4_4:=y - -GENERIC_BACKPORT_DIR := -GENERIC_PATCH_DIR := -GENERIC_HACK_DIR := -GENERIC_FILES_DIR := -GENERIC_LINUX_CONFIG:=${CURDIR}/config-$(KERNEL_PATCHVER)-qsdk - -include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-ssdk swconfig \ - kmod-qca-nss-drv \ - kmod-usb-phy-ipq807x kmod-usb-dwc3-of-simple \ - kmod-ath11k-ahb kmod-qrtr_mproc wpad \ - kmod-gpio-button-hotplug kmod-bootconfig \ - qca-thermald-10.4 qca-ssdk-shell \ - uboot-envtools - -$(eval $(call BuildTarget)) diff --git a/feeds/ipq807x/ipq807x/base-files/etc/board.d/01_leds b/feeds/ipq807x/ipq807x/base-files/etc/board.d/01_leds deleted file mode 100755 index 8988536b4..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/board.d/01_leds +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -. /lib/functions/uci-defaults.sh - -board_config_update - -board=$(board_name) - -case "$board" in -sercomm,wallaby|\ -wallys,dr6018|\ -wallys,dr6018-v4|\ -cig,wf188n|\ -cig,wf194c|\ -cig,wf194c4) - ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" "tx rx link" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt" - ;; -edgecore,eap101) - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt" - ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "eth1" - ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "eth2" - ucidef_set_led_netdev "poe" "poe" "green:wan" "eth0" - ;; -edgecore,eap102|\ -edgecore,oap102) - ucidef_set_led_netdev "poe" "poe" "green:wan" "eth0" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt" - ;; -edgecore,eap104) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy1tpt" - ucidef_set_led_netdev "wan" "wan" "yellow:uplink" "eth0" - ;; -liteon,wpx8324) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "orange:wifi2" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy1tpt" - ucidef_set_led_netdev "wan" "wan" "blue:uplink" "eth0" - ;; -hfcl,ion4xi|\ -hfcl,ion4xi_wp|\ -hfcl,ion4x|\ -hfcl,ion4x_2|\ -hfcl,ion4xi_w|\ -hfcl,ion4x_w|\ -hfcl,ion4xi_HMR|\ -hfcl,ion4xe) - ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wifi5" "phy0tpt" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wifi2" "phy1tpt" - ;; -glinet,ax1800|\ -glinet,axt1800) - ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" "tx rx link" - ;; -yuncore,fap650|\ -yuncore,fap655|\ -muxi,ap3220l) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy1tpt" - ;; -esac - -board_config_flush - -exit 0 diff --git a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network deleted file mode 100755 index 67ac6eb32..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network +++ /dev/null @@ -1,283 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh -. /lib/functions/uci-defaults.sh -. /lib/functions/system.sh - -qcom_setup_interfaces() -{ - local board="$1" - ucidef_add_switch "switch0" - ucidef_add_switch_attr "switch0" "enable" "false" - ucidef_add_switch_attr "switch0" "reset" "false" - - case $board in - hfcl,ion4xi|\ - hfcl,ion4x|\ - hfcl,ion4x_2|\ - hfcl,ion4xe) - ucidef_set_interface_wan "eth0 eth1" - ucidef_set_interface_lan "" - ;; - cig,wf188|\ - tplink,ex227|\ - tplink,ex447) - ucidef_set_interface_wan "eth0" - ucidef_set_interface_lan "" - ;; - qcom,ipq6018-cp01|\ - qcom,ipq807x-hk01) - ucidef_set_interface_lan "eth0 eth1 eth2 eth3 eth4" - ucidef_set_interface_wan "eth5" - ;; - cig,wf194c|\ - cig,wf194c4|\ - edgecore,eap106|\ - indio,um-310ax-v1|\ - indio,um-510axp-v1|\ - indio,um-510axm-v1|\ - qcom,ipq5018-mp03.1|\ - qcom,ipq5018-mp03.3|\ - yuncore,ax840|\ - motorola,q14|\ - sercomm,wallaby|\ - plasmacloud,pax1800-v1|\ - plasmacloud,pax1800-v2) - ucidef_set_interface_lan "eth0" - ucidef_set_interface_wan "eth1" - ;; - edgecore,eap101|\ - glinet,axt1800) - ucidef_set_interface_lan "eth1 eth2" - ucidef_set_interface_wan "eth0" - ;; - edgecore,eap102|\ - edgecore,oap102|\ - liteon,wpx8324|\ - wallys,dr6018|\ - cig,wf188n|\ - cig,wf196|\ - muxi,ap3220l) - ucidef_set_interface_lan "eth1" - ucidef_set_interface_wan "eth0" - ;; - cig,wf660a) - ucidef_set_interface_wan "eth0" - ;; - cig,wf186w) - ucidef_add_switch "switch0" "4:wan" "0:lan" "1:lan" "2:lan" "3:lan" "6@eth0" - ;; - cig,wf186h) - ucidef_add_switch "switch0" "4:wan" "1:lan" "2:lan" "6@eth0" - ;; - yuncore,fap650) - ucidef_set_interface_lan "eth3 eth2 eth1 eth0" - ucidef_set_interface_wan "eth4" - ;; - hfcl,ion4xi_wp) - ucidef_set_interface_lan "eth0 eth1 eth2 eth3" - ucidef_set_interface_wan "eth4" - ;; - hfcl,ion4xi_w|\ - hfcl,ion4x_w) - ucidef_set_interface_wan "eth0" - ;; - hfcl,ion4xi_HMR) - ucidef_set_interface_lan "eth1" - ucidef_set_interface_wan "eth0" - ;; - qcom,ipq807x-hk14) - ucidef_set_interface_lan "eth0 eth1 eth2 eth3" - ucidef_set_interface_wan "eth4" - ;; - wallys,dr6018-v4|\ - glinet,ax1800|\ - meshpp,s618-cp03|\ - meshpp,s618-cp01) - ucidef_set_interface_lan "eth1 eth2 eth3 eth4" - ucidef_set_interface_wan "eth0" - ;; - cybertan,eww622-a1) - ucidef_set_interface_wan "eth0" - ucidef_add_switch "switch1" \ - "6@eth1" "1:lan" "2:lan" "3:lan" "4:lan" - ;; - optimcloud,d60|\ - optimcloud,d60-5g|\ - optimcloud,d50|\ - optimcloud,d50-5g) - ucidef_set_interface_wan "eth0" - ucidef_set_interface_lan "eth1" - ;; - qcom,ipq5018-mp03.1) - ucidef_set_interface_lan "eth1" - ucidef_set_interface_wan "eth0" - ucidef_add_switch "switch1" - ucidef_add_switch_attr "switch1" "enable" "false" - ucidef_add_switch_attr "switch1" "reset" "true" - ;; - qcom,ipq5018-mp03.3) - ucidef_set_interface_lan "eth1" - ucidef_set_interface_wan "eth0" - ucidef_add_switch "switch1" - ucidef_add_switch_attr "switch1" "enable" "false" - ucidef_add_switch_attr "switch1" "reset" "true" - ;; - edgecore,eap104) - ucidef_set_interface_wan "eth0" - ucidef_add_switch "switch1" \ - "6@eth1" "1:lan" "2:lan" "3:lan" "4:lan" - ;; - cybertan,eww631-a1) - ucidef_set_interface_wan "eth0" - ucidef_set_interface_lan "" - ;; - cybertan,eww631-b1) - ucidef_add_switch "switch1" "5:wan" "4:lan" "3:lan" "2:lan" "6@eth0" - ;; - wallys,dr5018) - ucidef_set_interface_lan "eth0 eth1" - ucidef_add_switch "switch1" - ucidef_add_switch_attr "switch1" "enable" "false" - ucidef_add_switch_attr "switch1" "reset" "true" - ;; - yuncore,fap655) - ucidef_add_switch "switch1" \ - "6@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" - ;; - esac -} - -qcom_setup_macs() -{ - local board="$1" - - case $board in - cig,wf194c|\ - cig,wf194c4) - mtd=$(find_mtd_chardev "0:APPSBLENV") - [ -z "$mtd" ] && return; - mac=$(grep BaseMacAddress= $mtd | cut -dx -f2) - [ -z "$mac" ] && return; - wan_mac=$(macaddr_canonicalize $mac) - lan_mac=$(macaddr_add "$wan_mac" 1) - ucidef_set_network_device_mac eth0 $lan_mac - ucidef_set_network_device_mac eth1 $wan_mac - ip link set eth0 address $lan_mac - ip link set eth1 address $wan_mac - ucidef_set_label_macaddr $wan_mac - ;; - cig,wf186w) - mtd=$(find_mtd_chardev "0:APPSBLENV") - [ -z "$mtd" ] && return; - mac=$(grep BaseMacAddress= $mtd | cut -dx -f2) - [ -z "$mac" ] && return; - wan_mac=$(macaddr_canonicalize $mac) - #lan_mac=$(macaddr_add "$wan_mac" 1) - ucidef_set_network_device_mac eth0 $wan_mac - # ucidef_set_network_device_mac eth1 $wan_mac - ip link set eth0 address $wan_mac - # ip link set eth1 address $wan_mac - # ucidef_set_label_macaddr $wan_mac - ;; - cig,wf186h) - mtd=$(find_mtd_chardev "0:APPSBLENV") - [ -z "$mtd" ] && return; - mac=$(grep BaseMacAddress= $mtd | cut -dx -f2) - [ -z "$mac" ] && return; - wan_mac=$(macaddr_canonicalize $mac) - ucidef_set_network_device_mac eth0 $wan_mac - ip link set eth0 address $wan_mac - ;; - cybertan,eww631-a1|\ - cybertan,eww631-b1) - mtd=$(find_mtd_chardev "0:APPSBLENV") - [ -z "$mtd" ] && return; - mac=$(grep BaseMacAddress= $mtd | cut -d '=' -f2) - [ -z "$mac" ] && return; - wan_mac=$(macaddr_canonicalize $mac) - lan_mac=$(macaddr_add "$wan_mac" 1) - ucidef_set_network_device_mac eth0 $wan_mac - ip link set eth0 address $wan_mac - ucidef_set_label_macaddr $wan_mac - ;; - cig,wf188n|\ - cig,wf196) - mtd=$(find_mtd_chardev "0:APPSBLENV") - [ -z "$mtd" ] && return; - mac=$(grep BaseMacAddress= $mtd | cut -dx -f2) - [ -z "$mac" ] && return; - wan_mac=$(macaddr_canonicalize $mac) - lan_mac=$(macaddr_add "$wan_mac" 1) - ucidef_set_network_device_mac eth1 $lan_mac - ucidef_set_network_device_mac eth0 $wan_mac - ip link set eth0 address $wan_mac - ip link set eth1 address $lan_mac - ucidef_set_label_macaddr $wan_mac - ;; - cig,wf660a) - mmc_dev=$(find_mtd_chardev "0:APPSBLENV") - [ -z "$mmc_dev" ] && mmc_dev=$(find_mmc_part "0:APPSBLENV") - [ -z "$mmc_dev" ] && return - mac=$(grep BaseMacAddress= $mmc_dev | cut -dx -f2) - [ -z "$mac" ] && return; - wan_mac=$(macaddr_canonicalize $mac) - ucidef_set_network_device_mac eth0 $wan_mac - ip link set eth0 address $wan_mac - ;; - cybertan,eww622-a1) - mac=$(grep -i -m 1 mac_addr_base= /dev/`cat /proc/mtd | grep devinfo | cut -d: -f1` | cut -d= -f2) - [ -z "$mac" ] && mac="00:11:22:33:44:55" - wan_mac=$(macaddr_canonicalize $mac) - lan_mac=$(macaddr_add "$wan_mac" 1) - ucidef_set_network_device_mac eth0 $wan_mac - ucidef_set_network_device_mac eth1 $lan_mac - ucidef_set_label_macaddr $wan_mac - ;; - indio,um-310ax-v1|\ - indio,um-510axp-v1|\ - indio,um-510axm-v1|\ - yuncore,ax840) - wan_mac=$(cat /sys/class/net/eth1/address) - lan_mac=$(macaddr_add "$wan_mac" 1) - ;; - yuncore,fap650) - wan_mac=$(cat /sys/class/net/eth4/address) - lan_mac=$(macaddr_add "$wan_mac" 1) - ;; - yuncore,fap655) - wan_mac=$(cat /sys/class/net/eth0/address) - lan_mac=$(macaddr_add "$wan_mac" 1) - ;; - muxi,ap3220l) - wan_mac=$(mtd_get_mac_binary 0:Product_Info 0x5b) - lan_mac=$(macaddr_add "$wan_mac" 1) - ucidef_set_network_device_mac eth0 $wan_mac - ucidef_set_network_device_mac eth1 $lan_mac - ip link set eth0 address $wan_mac - ip link set eth1 address $lan_mac - ;; - *) - wan_mac=$(cat /sys/class/net/eth0/address) - lan_mac=$(macaddr_add "$wan_mac" 1) - ;; - wallys,dr5018) - mac=$(grep -i -m 1 BaseMacAddress= /dev/`cat /proc/mtd | grep APPSBLENV | cut -d: -f1` | cut -d= -f2) - [ -z "$mac"] && mac="00:11:22:33:44:00" - wan_mac=$(macaddr_canonicalize $mac) - ucidef_set_network_device_mac eth0 $wan_mac - ucidef_set_label_macaddr $wan_mac - ;; - esac - [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac - [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac - [ -n "$wan_mac" ] && ucidef_set_label_macaddr "$wan_mac" -} - -board_config_update -board=$(board_name) -qcom_setup_interfaces $board -qcom_setup_macs $board -board_config_flush - -exit 0 diff --git a/feeds/ipq807x/ipq807x/base-files/etc/board.d/03_wifi b/feeds/ipq807x/ipq807x/base-files/etc/board.d/03_wifi deleted file mode 100755 index 200e43d15..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/board.d/03_wifi +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -. /lib/functions/uci-defaults.sh - -board_config_update - -board=$(board_name) - -case "$board" in -edgecore,eap106) - ucidef_set_wifi_scanning 'soc/10000000.pci/pci0001:00/0001:00:00.0/0001:01:00.0' - ;; -esac - -board_config_flush - -exit 0 diff --git a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata deleted file mode 100755 index 91e30c426..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata +++ /dev/null @@ -1,334 +0,0 @@ -#!/bin/sh - -[ -e /lib/firmware/$FIRMWARE ] && exit 0 - -. /lib/functions.sh -. /lib/functions/system.sh - -ath11k_generate_macs() { - touch /lib/firmware/ath11k-macs - eth=$(cat /sys/class/net/eth0/address) - mac1=$(macaddr_add $eth 2) - mac2=$(macaddr_add $eth 3) - mac3=$(macaddr_add $eth 4) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_eap101() { - touch /lib/firmware/ath11k-macs - eth=$(cat /sys/class/net/eth0/address) - mac1=$(macaddr_add $eth 4) - mac2=$(macaddr_add $eth 3) - mac3=$(macaddr_add $eth 5) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_wf194() { - touch /lib/firmware/ath11k-macs - mac=$(grep BaseMacAddress= /dev/mtd14 | cut -dx -f2) - eth=$(macaddr_canonicalize $mac) - mac1=$(macaddr_add $eth 2) - mac2=$(macaddr_add $eth 3) - mac3=$(macaddr_add $eth 4) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_ion4x() { - local dev=$(find_mtd_chardev "0:ART") - touch /lib/firmware/ath11k-macs - wifimac0=$(grep WLAN0_BASEMAC= $dev |cut -d '=' -f2) - wifimac1=$(grep WLAN1_BASEMAC= $dev |cut -d '=' -f2) - wifimac2=00:00:00:00:00:00 - echo -ne \\x${wifimac0//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${wifimac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${wifimac2//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_pax1800() { - touch /lib/firmware/ath11k-macs - eth=$(cat /sys/class/net/eth0/address) - mac1=$(macaddr_add $eth 10) - mac2=$(macaddr_add $eth 2) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_wf660a() { - touch /lib/firmware/ath11k-macs - mmc_dev=$(find_mtd_chardev "0:APPSBLENV") - [ -z "$mmc_dev" ] && mmc_dev=$(find_mmc_part "0:APPSBLENV") - [ -n "$mmc_dev" ] && mac=$(grep BaseMacAddress= $mmc_dev | cut -dx -f2) - eth=$(macaddr_canonicalize $mac) - mac1=$(macaddr_add $eth 1) - mac2=$(macaddr_add $eth 2) - mac3=$(macaddr_add $eth 3) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_wf186w() { - touch /lib/firmware/ath11k-macs - local dev=$(find_mtd_chardev "0:APPSBLENV") - mac=$(grep BaseMacAddress= $dev | cut -dx -f2) - eth=$(macaddr_canonicalize $mac) - mac1=$(macaddr_add $eth 2) - mac2=$(macaddr_add $eth 3) - mac3=$(macaddr_add $eth 4) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_wf186h() { - touch /lib/firmware/ath11k-macs - local dev=$(find_mtd_chardev "0:APPSBLENV") - mac=$(grep BaseMacAddress= $dev | cut -dx -f2) - eth=$(macaddr_canonicalize $mac) - mac1=$(macaddr_add $eth 2) - mac2=$(macaddr_add $eth 3) - mac3=$(macaddr_add $eth 4) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_eww631_a1() { - touch /lib/firmware/ath11k-macs - local dev=$(find_mtd_chardev "0:APPSBLENV") - mac=$(grep BaseMacAddress= $dev | cut -d '=' -f2) - eth=$(macaddr_canonicalize $mac) - mac1=$(macaddr_add $eth 1) - mac2=$(macaddr_add $eth 2) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs -} - -ath11k_generate_macs_eww631_b1() { - touch /lib/firmware/ath11k-macs - local dev=$(find_mtd_chardev "0:APPSBLENV") - mac=$(grep BaseMacAddress= $dev | cut -d '=' -f2) - eth=$(macaddr_canonicalize $mac) - mac1=$(macaddr_add $eth 2) - mac2=$(macaddr_add $eth 3) - echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs - echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs -} - -caldata_die() { - echo "caldata: " "$*" - exit 1 -} - -caldata_extract() { - local part=$1 - local offset=$(($2)) - local count=$(($3)) - local mtd - - mtd=$(find_mtd_chardev $part) - if [ -z "$mtd" ]; then - mtd=/dev/$(echo $(find_mmc_part $part) | sed 's/^.\{5\}//') - fi - [ -n "$mtd" ] || caldata_die "no mtd device found for partition $part" - - dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ - caldata_die "failed to extract calibration data from $mtd" -} - -board=$(board_name) - -case "$FIRMWARE" in -"ath11k/IPQ8074/hw2.0/caldata.bin") - case "$board" in - cig,wf194c|\ - cig,wf194c4|\ - cig,wf196|\ - edgecore,eap102 |\ - edgecore,oap102 |\ - edgecore,eap106 |\ - indio,um-310ax-v1|\ - indio,um-510axp-v1|\ - indio,um-510axm-v1|\ - qcom,ipq807x-hk01|\ - qcom,ipq807x-hk14|\ - tplink,ex227|\ - tplink,ex447|\ - sercomm,wallaby) - caldata_extract "0:ART" 0x1000 0x20000 - ;; - esac - ;; -"ath11k/IPQ6018/hw1.0/caldata.bin") - case "$board" in - cig,wf188|\ - cig,wf188n|\ - cig,wf660a|\ - edgecore,eap101|\ - hfcl,ion4xi|\ - hfcl,ion4x_2|\ - hfcl,ion4x|\ - hfcl,ion4xe|\ - hfcl,ion4xi_wp|\ - wallys,dr6018|\ - wallys,dr6018-v4|\ - meshpp,ipq6018-cp01|\ - meshpp,ipq6018-cp03|\ - qcom,ipq6018-cp03|\ - qcom,ipq6018-cp01|\ - xiaomi,ax1800|\ - glinet,ax1800|\ - yuncore,ax840|\ - yuncore,fap650|\ - plasmacloud,pax1800-v1|\ - plasmacloud,pax1800-v2) - caldata_extract "0:ART" 0x1000 0x20000 - ;; - esac - ;; -ath11k/IPQ5018/hw1.0/caldata.bin) - case "$board" in - cig,wf186w|\ - cig,wf186h|\ - cybertan,eww622-a1|\ - cybertan,eww631-a1|\ - cybertan,eww631-b1|\ - wallys,dr5018|\ - edgecore,eap104|\ - yuncore,fap655|\ - hfcl,ion4xi_w|\ - hfcl,ion4x_w|\ - hfcl,ion4xi_HMR|\ - liteon,wpx8324|\ - motorola,q14|\ - muxi,ap3220l|\ - optimcloud,d60|\ - optimcloud,d60-5g|\ - optimcloud,d50|\ - optimcloud,d50-5g|\ - qcom,ipq5018-mp03.1) - caldata_extract "0:ART" 0x1000 0x20000 - ;; - esac - ;; -ath11k/qcn6122/hw1.0/caldata_1.bin) - case "$board" in - cig,wf186w|\ - cig,wf186h|\ - wallys,dr5018|\ - hfcl,ion4xi_w|\ - hfcl,ion4x_w|\ - hfcl,ion4xi_HMR|\ - cybertan,eww631-a1|\ - cybertan,eww631-b1|\ - yuncore,fap655|\ - motorola,q14) - caldata_extract "0:ART" 0x26800 0x20000 - ;; - esac - ;; -ath11k/qcn6122/hw1.0/caldata_2.bin) - case "$board" in - motorola,q14|\ - wallys,dr5018|\ - edgecore,eap104|\ - liteon,wpx8324) - caldata_extract "0:ART" 0x4c000 0x20000 - ;; - cybertan,eww631-a1|\ - cybertan,eww631-b1|\ - muxi,ap3220l) - caldata_extract "0:ART" 0x26800 0x20000 - ;; - esac - ;; -ath11k/QCN9074/hw1.0/caldata_1.bin) - case "$board" in - cig,wf196|\ - wallys,dr6018-v4|\ - cybertan,eww622-a1|\ - optimcloud,d60|\ - optimcloud,d60-5g|\ - optimcloud,d50|\ - optimcloud,d50-5g|\ - qcom,ipq5018-mp03.1|\ - qcom,ipq807x-hk14) - caldata_extract "0:ART" 0x26800 0x20000 - ;; - esac - ;; -ath11k/QCN9074/hw1.0/caldata_2.bin) - case "$board" in - qcom,ipq807x-hk14|\ - qcom,ipq5018-mp03.3) - caldata_extract "0:ART" 0x4C000 0x20000 - ;; - esac - ;; -ath11k-macs) - case "$board" in - hfcl,ion4xi|\ - hfcl,ion4xi_w|\ - hfcl,ion4x_w|\ - hfcl,ion4xi_HMR|\ - hfcl,ion4xi_wp|\ - hfcl,ion4x|\ - hfcl,ion4x_2|\ - hfcl,ion4xe) - ath11k_generate_macs_ion4x - ;; - edgecore,eap101) - ath11k_generate_macs_eap101 - ;; - yuncore,ax840|\ - yuncore,fap655|\ - edgecore,eap102|\ - edgecore,oap102|\ - edgecore,eap104|\ - edgecore,eap106|\ - indio,um-310ax-v1|\ - indio,um-510axp-v1|\ - indio,um-510axm-v1|\ - optimcloud,d60|\ - optimcloud,d60-5g|\ - optimcloud,d50|\ - optimcloud,d50-5g|\ - cig,wf188n) - ath11k_generate_macs - ;; - cig,wf194c|\ - cig,wf194c4|\ - cig,wf196) - ath11k_generate_macs_wf194 - ;; - plasmacloud,pax1800-v1|\ - plasmacloud,pax1800-v2) - ath11k_generate_macs_pax1800 - ;; - cig,wf660a) - ath11k_generate_macs_wf660a - ;; - cig,wf186w) - ath11k_generate_macs_wf186w - ;; - cig,wf186h) - ath11k_generate_macs_wf186h - ;; - cybertan,eww631-a1) - ath11k_generate_macs_eww631_a1 - ;; - cybertan,eww631-b1) - ath11k_generate_macs_eww631_b1 - ;; - esac - ;; -*) - exit 1 - ;; -esac diff --git a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata deleted file mode 100644 index eb23e8cd7..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -[ -e /lib/firmware/$FIRMWARE ] && exit 0 - -. /lib/functions/caldata.sh - -board=$(board_name) - -case "$FIRMWARE" in -"ath10k/pre-cal-pci-0001:01:00.0.bin") - case $board in - edgecore,eap106) - caldata_extract "0:ART" 0x33000 0x2f20 - ;; - esac -esac diff --git a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/50-dvlan b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/50-dvlan deleted file mode 100644 index aa137fac8..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/50-dvlan +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh - -debug() { - logger -t HOTPLUG-DVLAN "$*" -} - -if [ "${INTERFACE:0:4}" != "wlan" ]; then - exit 0 -fi - -case "$(board_name)" in - "cig,wf186w") - wan_iface="eth0" - switch_dev="switch0" - switch_wan_port=4 - switch_cpu_port=6 - ;; - - *) - exit 0 -esac - -VSTR="$(echo $INTERFACE | egrep -o 'v([0-9]+)$')" -[ -z "$VSTR" ] && exit 0 -VID="${VSTR:1}" -[ $VID -lt 1 -o $VID -gt 4096 ] && exit 0 - -if [ "$ACTION" = "add" ]; then - debug "[$INTERFACE] Dynamic VLAN $VID added, configuring switch" - swconfig dev ${switch_dev} vlan $VID set ports "${switch_wan_port}t ${switch_cpu_port}t" -elif [ "$ACTION" = "remove" ]; then - let cnt="$(bridge vlan show vid $VID | egrep "^wlan" | wc -l)" - debug "[$INTERFACE] Dynamic VLAN interface removed, references left = $cnt" - if [ $cnt -eq 0 ]; then - debug "[$INTERFACE] No more references, removing $VID from switch" - swconfig dev ${switch_dev} vlan $VID set ports "" - fi -fi diff --git a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/macs b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/macs deleted file mode 100644 index 9e2e6ef65..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/net/macs +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -mac=$(cat /etc/board.json | jsonfilter -e '@["network_device"]["'$DEVICENAME'"]'.macaddr) -[ -n "$mac" ] && ip link set $DEVICENAME address $mac diff --git a/feeds/ipq807x/ipq807x/base-files/etc/init.d/aq_phy b/feeds/ipq807x/ipq807x/base-files/etc/init.d/aq_phy deleted file mode 100755 index 909d02019..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/init.d/aq_phy +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=30 - -boot() { - . /lib/functions.sh - - case "$(board_name)" in - cig,wf194c|\ - cig,wf194c4|\ - cig,wf196) - aq-fw-download /lib/firmware/AQR-G4_v5.5.6-AQR_CIG_WIFI_ID44858_VER1745.cld miireg 0 > /dev/null - sleep 1 - ssdk_sh debug phy set 0 0x4004c441 0x8 - ;; - edgecore,eap106) - aq-fw-download /lib/firmware/AQR-G4_v5.5.6-AQR_CIG_WIFI_ID44858_VER1745.cld miireg 8 > /dev/null - sleep 1 - ssdk_sh debug phy set 8 0x4004c441 0x8 - ;; - esac - - case "$(board_name)" in - cig,wf196) - # setup the leds - ssdk_sh debug phy set 0 0x401ec431 0xc00f - ssdk_sh debug phy set 0 0x401ec430 0x806f - ;; - esac -} diff --git a/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount b/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount deleted file mode 100755 index 3867ad463..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 - -boot() { - case "$(board_name)" in - hfcl,ion4xe|\ - hfcl,ion4x|\ - hfcl,ion4x_2|\ - hfcl,ion4xi_w|\ - hfcl,ion4x_w|\ - hfcl,ion4xi_HMR|\ - hfcl,ion4xi_wp|\ - hfcl,ion4xi) - fw_setenv boot_count 0 - ;; - edgecore,eap101|\ - edgecore,eap102|\ - edgecore,oap102|\ - edgecore.eap104) - avail=$(fw_printenv -n upgrade_available) - [ "${avail}" -eq 1 ] || fw_setenv upgrade_available 1 - fw_setenv bootcount 0 - ;; - esac -} diff --git a/feeds/ipq807x/ipq807x/base-files/etc/init.d/wdt b/feeds/ipq807x/ipq807x/base-files/etc/init.d/wdt deleted file mode 100755 index 75de36a34..000000000 --- a/feeds/ipq807x/ipq807x/base-files/etc/init.d/wdt +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=10 - -boot() { - . /lib/functions.sh - - case "$(board_name)" in - cig,wf188|\ - cig,wf188n) - watchdog -t 5 /dev/watchdog1 - ;; - esac -} diff --git a/feeds/ipq807x/ipq807x/base-files/lib/firmware/AQR-G4_v5.4.B-AQR_CIG_WIFI_ID44715_VER1673.cld b/feeds/ipq807x/ipq807x/base-files/lib/firmware/AQR-G4_v5.4.B-AQR_CIG_WIFI_ID44715_VER1673.cld deleted file mode 100644 index 4a5a76cd3..000000000 Binary files a/feeds/ipq807x/ipq807x/base-files/lib/firmware/AQR-G4_v5.4.B-AQR_CIG_WIFI_ID44715_VER1673.cld and /dev/null differ diff --git a/feeds/ipq807x/ipq807x/base-files/lib/firmware/AQR-G4_v5.5.6-AQR_CIG_WIFI_ID44858_VER1745.cld b/feeds/ipq807x/ipq807x/base-files/lib/firmware/AQR-G4_v5.5.6-AQR_CIG_WIFI_ID44858_VER1745.cld deleted file mode 100644 index 3ee6ed003..000000000 Binary files a/feeds/ipq807x/ipq807x/base-files/lib/firmware/AQR-G4_v5.5.6-AQR_CIG_WIFI_ID44858_VER1745.cld and /dev/null differ diff --git a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/dualboot_datachk.sh b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/dualboot_datachk.sh deleted file mode 100644 index c7c473a38..000000000 --- a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/dualboot_datachk.sh +++ /dev/null @@ -1,126 +0,0 @@ -# The U-Boot loader with the datachk patchset for dualbooting requires image -# sizes and checksums to be provided in the U-Boot environment. -# The devices come with 2 main partitions - while one is active -# sysupgrade will flash the other. The boot order is changed to boot the -# newly flashed partition. If the new partition can't be booted due to -# upgrade failures the previously used partition is loaded. - -platform_post_upgrade_sanity_check() -{ - local part_name=$1 - local inactive_mtd=$2 - local cfg_md5=$3 - local part_offset=$4 - local part_size=$5 - - md5_part_disk=$(dd if=/dev/${inactive_mtd} bs=$((64*1024)) skip=$((part_offset / (64*1024))) count=$((part_size / (64*1024))) 2>&- | md5sum | awk '{print $1}') - - if [ "${cfg_md5}" != "${md5_part_disk}" ]; then - echo "post-flashing checksum mismatch: ${part_name}" >&2 - echo "${cfg_md5} != ${md5_part_disk}" - return 1 - fi - - return 0 -} - -platform_do_upgrade_dualboot_datachk() { - local tar_file="$1" - local restore_backup - local primary_kernel_mtd - - local setenv_script="/tmp/fw_env_upgrade" - - local kernel_mtd="$(find_mtd_index $PART_NAME)" - local kernel_offset="$(cat /sys/class/mtd/mtd${kernel_mtd}/offset)" - local total_size="$(cat /sys/class/mtd/mtd${kernel_mtd}/size)" - - # detect to which flash region the new image is written to. - # - # 1. check what is the mtd index for the first flash region on this - # device - # 2. check if the target partition ("inactive") has the mtd index of - # the first flash region - # - # - when it is: the new bootseq will be 1,2 and the first region is - # modified - # - when it isnt: bootseq will be 2,1 and the second region is - # modified - # - # The detection has to be done via the hardcoded mtd partition because - # the current boot might be done with the fallback region. Let us - # assume that the current bootseq is 1,2. The bootloader detected that - # the image in flash region 1 is corrupt and thus switches to flash - # region 2. The bootseq in the u-boot-env is now still the same and - # the sysupgrade code can now only rely on the actual mtd indexes and - # not the bootseq variable to detect the currently booted flash - # region/image. - # - # In the above example, an implementation which uses bootseq ("1,2") to - # detect the currently booted image would assume that region 1 is booted - # and then overwrite the variables for the wrong flash region (aka the - # one which isn't modified). This could result in a device which doesn't - # boot anymore to Linux until it was reflashed with ap51-flash. - local next_boot_part="1" - case "$(board_name)" in - plasmacloud,pax1800-v1|\ - plasmacloud,pax1800-v2) - primary_kernel_mtd=9 - ;; - *) - echo "failed to detect primary kernel mtd partition for board" - return 1 - ;; - esac - [ "$kernel_mtd" = "$primary_kernel_mtd" ] || next_boot_part="2" - - local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} - - local kernel_length=$(tar xf $tar_file ${board_dir}/kernel -O | wc -c) - local rootfs_length=$(tar xf $tar_file ${board_dir}/root -O | wc -c) - # rootfs without EOF marker - rootfs_length=$((rootfs_length-4)) - - local kernel_md5=$(tar xf $tar_file ${board_dir}/kernel -O | md5sum); kernel_md5="${kernel_md5%% *}" - # md5 checksum of rootfs with EOF marker - local rootfs_md5=$(tar xf $tar_file ${board_dir}/root -O | dd bs=1 count=$rootfs_length | md5sum); rootfs_md5="${rootfs_md5%% *}" - - # - # add tar support to get_image() to use default_do_upgrade() instead? - # - - # take care of restoring a saved config - [ -n "$UPGRADE_BACKUP" ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}" - - mtd -q erase inactive - tar xf $tar_file ${board_dir}/root -O | mtd -n -p $kernel_length $restore_backup write - $PART_NAME - tar xf $tar_file ${board_dir}/kernel -O | mtd -n write - $PART_NAME - - platform_post_upgrade_sanity_check "kernel" "mtd${kernel_mtd}" $kernel_md5 0 $kernel_length || return 1 - platform_post_upgrade_sanity_check "rootfs" "mtd${kernel_mtd}" $rootfs_md5 $kernel_length $rootfs_length || return 1 - - # prepare new u-boot env - if [ "$next_boot_part" = "1" ]; then - echo "bootseq 1,2" > $setenv_script - else - echo "bootseq 2,1" > $setenv_script - fi - - printf "kernel_size_%i 0x%08x\n" $next_boot_part $kernel_length >> $setenv_script - printf "vmlinux_start_addr 0x%08x\n" ${kernel_offset} >> $setenv_script - printf "vmlinux_size 0x%08x\n" ${kernel_length} >> $setenv_script - printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script - - printf "rootfs_size_%i 0x%08x\n" $next_boot_part $((total_size-kernel_length)) >> $setenv_script - printf "rootfs_start_addr 0x%08x\n" $((kernel_offset+kernel_length)) >> $setenv_script - printf "rootfs_size 0x%08x\n" ${rootfs_length} >> $setenv_script - printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script - - # store u-boot env changes - mkdir -p /var/lock - fw_setenv -s $setenv_script || { - echo "failed to update U-Boot environment" - return 1 - } -} diff --git a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/nand.sh b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/nand.sh deleted file mode 100644 index e8f10668d..000000000 --- a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/nand.sh +++ /dev/null @@ -1,391 +0,0 @@ -# Copyright (C) 2014 OpenWrt.org -# - -. /lib/functions.sh - -# 'kernel' partition or UBI volume on NAND contains the kernel -CI_KERNPART="${CI_KERNPART:-kernel}" - -# 'ubi' partition on NAND contains UBI -CI_UBIPART="${CI_UBIPART:-ubi}" - -# 'rootfs' UBI volume on NAND contains the rootfs -CI_ROOTPART="${CI_ROOTPART:-rootfs}" - -# ipq807x qsdk kernel misbehaves -CI_IPQ807X=0 - -# update BOOTCONFIG partitions (rotate rootfs/rootfs_1) -CI_BOOTCFG=0 - -# update uboot-env if upgrade suceeded -CI_FWSETENV= - -ubi_mknod() { - local dir="$1" - local dev="/dev/$(basename $dir)" - - [ -e "$dev" ] && return 0 - - local devid="$(cat $dir/dev)" - local major="${devid%%:*}" - local minor="${devid##*:}" - mknod "$dev" c $major $minor -} - -nand_find_volume() { - local ubidevdir ubivoldir - ubidevdir="/sys/devices/virtual/ubi/$1" - [ ! -d "$ubidevdir" ] && return 1 - for ubivoldir in $ubidevdir/${1}_*; do - [ ! -d "$ubivoldir" ] && continue - if [ "$( cat $ubivoldir/name )" = "$2" ]; then - basename $ubivoldir - ubi_mknod "$ubivoldir" - return 0 - fi - done -} - -nand_find_ubi() { - local ubidevdir ubidev mtdnum - mtdnum="$( find_mtd_index $1 )" - [ ! "$mtdnum" ] && return 1 - for ubidevdir in /sys/devices/virtual/ubi/ubi*; do - [ ! -d "$ubidevdir" ] && continue - cmtdnum="$( cat $ubidevdir/mtd_num )" - [ ! "$mtdnum" ] && continue - if [ "$mtdnum" = "$cmtdnum" ]; then - ubidev=$( basename $ubidevdir ) - ubi_mknod "$ubidevdir" - echo $ubidev - return 0 - fi - done -} - -nand_get_magic_long() { - dd if="$1" skip=$2 bs=4 count=1 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' -} - -get_magic_long_tar() { - ( tar xf $1 $2 -O | dd bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2> /dev/null -} - -identify_magic() { - local magic=$1 - case "$magic" in - "55424923") - echo "ubi" - ;; - "31181006") - echo "ubifs" - ;; - "68737173") - echo "squashfs" - ;; - "d00dfeed") - echo "fit" - ;; - "4349"*) - echo "combined" - ;; - *) - echo "unknown $magic" - ;; - esac -} - - -identify() { - identify_magic $(nand_get_magic_long "$1" "${2:-0}") -} - -identify_tar() { - identify_magic $(get_magic_long_tar "$1" "$2") -} - -nand_restore_config() { - sync - local ubidev=$( nand_find_ubi $CI_UBIPART ) - local ubivol="$( nand_find_volume $ubidev rootfs_data )" - [ ! "$ubivol" ] && - ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" - mkdir /tmp/new_root - if ! mount -t ubifs /dev/$ubivol /tmp/new_root; then - echo "mounting ubifs $ubivol failed" - rmdir /tmp/new_root - return 1 - fi - mv "$1" "/tmp/new_root/$BACKUP_FILE" - umount /tmp/new_root - sync - rmdir /tmp/new_root -} - -nand_upgrade_prepare_ubi() { - local rootfs_length="$1" - local rootfs_type="$2" - local rootfs_data_max="$(fw_printenv -n rootfs_data_max 2>/dev/null)" - [ -n "$rootfs_data_max" ] && rootfs_data_max=$(printf %d "$rootfs_data_max") - - local kernel_length="$3" - local has_env="${4:-0}" - - [ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1 - - local mtdnum="$( find_mtd_index "$CI_UBIPART" )" - if [ ! "$mtdnum" ]; then - echo "cannot find ubi mtd partition $CI_UBIPART" - return 1 - fi - - [ "$CI_IPQ807X" = 1 ] && ubidetach -f -m $mtdnum - - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - if [ ! "$ubidev" ]; then - ubiattach -m "$mtdnum" - sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" - fi - - if [ ! "$ubidev" ]; then - ubiformat /dev/mtd$mtdnum -y - ubiattach -m "$mtdnum" - sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" - [ "$has_env" -gt 0 ] && { - ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB - ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB - } - fi - - local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" - local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" - local data_ubivol="$( nand_find_volume $ubidev rootfs_data )" - - local ubiblk ubiblkvol - for ubiblk in /dev/ubiblock*_? ; do - [ -e "$ubiblk" ] || continue - echo "removing ubiblock${ubiblk:13}" - ubiblkvol=ubi${ubiblk:13} - if ! ubiblock -r /dev/$ubiblkvol; then - echo "cannot remove $ubiblk" - return 1 - fi - done - - # kill volumes - [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true - [ "$root_ubivol" -a "$root_ubivol" != "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true - [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true - - # update kernel - if [ -n "$kernel_length" ]; then - if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then - echo "cannot create kernel volume" - return 1; - fi - fi - - # update rootfs - if [ -n "$rootfs_length" ]; then - local rootfs_size_param - if [ "$rootfs_type" = "ubifs" ]; then - rootfs_size_param="-m" - else - rootfs_size_param="-s $rootfs_length" - fi - if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $rootfs_size_param; then - echo "cannot create rootfs volume" - return 1; - fi - fi - - # create rootfs_data for non-ubifs rootfs - if [ "$rootfs_type" != "ubifs" ]; then - local availeb=$(cat /sys/devices/virtual/ubi/$ubidev/avail_eraseblocks) - local ebsize=$(cat /sys/devices/virtual/ubi/$ubidev/eraseblock_size) - local avail_size=$(( $availeb * $ebsize )) - local rootfs_data_size_param="-m" - if [ -n "$rootfs_data_max" ] && - [ "$rootfs_data_max" != "0" ] && - [ "$rootfs_data_max" -le "$avail_size" ]; then - rootfs_data_size_param="-s $rootfs_data_max" - fi - if ! ubimkvol /dev/$ubidev -N rootfs_data $rootfs_data_size_param; then - echo "cannot initialize rootfs_data volume" - return 1 - fi - fi - sync - return 0 -} - -nand_qca_update_bootconfig() { - local primary="0" - local mtdnum - local part - - [ -f /proc/boot_info/rootfs/primaryboot ] || return - [ -f /proc/boot_info/getbinary_bootconfig ] || return - - [ "$(cat /proc/boot_info/rootfs/primaryboot)" = "0" ] && primary="1" - echo "$primary" > /proc/boot_info/rootfs/primaryboot 2>/dev/null - - for part in "0:BOOTCONFIG" "0:BOOTCONFIG1"; do - mtdnum="$(find_mtd_index "$part")" - [ -c "/dev/mtd${mtdnum}" ] && { - mtd -qq write /proc/boot_info/getbinary_bootconfig \ - "/dev/mtd${mtdnum}" 2>/dev/null &&\ - echo "partition '$part' updated" - } - done -} - -nand_do_upgrade_success() { - local conf_tar="/tmp/sysupgrade.tgz" - sync - [ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig - [ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync - [ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV - echo "sysupgrade successful" - umount -a - reboot -f -} - -# Flash the UBI image to MTD partition -nand_upgrade_ubinized() { - local ubi_file="$1" - local mtdnum="$(find_mtd_index "$CI_UBIPART")" - - [ ! "$mtdnum" ] && { - CI_UBIPART="rootfs" - mtdnum="$(find_mtd_index "$CI_UBIPART")" - } - - if [ ! "$mtdnum" ]; then - echo "cannot find mtd device $CI_UBIPART" - umount -a - reboot -f - fi - - local mtddev="/dev/mtd${mtdnum}" - ubidetach -p "${mtddev}" || true - sync - ubiformat "${mtddev}" -y -f "${ubi_file}" - ubiattach -p "${mtddev}" - nand_do_upgrade_success -} - -# Write the UBIFS image to UBI volume -nand_upgrade_ubifs() { - local rootfs_length=$( (cat $1 | wc -c) 2> /dev/null) - - nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "" "" - - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)" - ubiupdatevol /dev/$root_ubivol -s $rootfs_length $1 - - nand_do_upgrade_success -} - -nand_upgrade_fit() { - local fit_file="$1" - local fit_length="$(wc -c < "$fit_file")" - - nand_upgrade_prepare_ubi "" "" "$fit_length" "1" - - local fit_ubidev="$(nand_find_ubi "$CI_UBIPART")" - local fit_ubivol="$(nand_find_volume $fit_ubidev "$CI_KERNPART")" - ubiupdatevol /dev/$fit_ubivol -s $fit_length $fit_file - - nand_do_upgrade_success -} - -nand_upgrade_tar() { - local tar_file="$1" - local kernel_mtd="$(find_mtd_index $CI_KERNPART)" - - local board_dir=$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} - - kernel_length=$( (tar xf "$tar_file" ${board_dir}/kernel -O | wc -c) 2> /dev/null) - local has_rootfs=0 - local rootfs_length - local rootfs_type - - tar tf "$tar_file" ${board_dir}/root 1>/dev/null 2>/dev/null && has_rootfs=1 - [ "$has_rootfs" = "1" ] && { - rootfs_length=$( (tar xf "$tar_file" ${board_dir}/root -O | wc -c) 2> /dev/null) - rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" - } - - local has_kernel=1 - local has_env=0 - - [ "$CI_IPQ807X" = 0 -a "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART - } - [ "$CI_IPQ807X" = 0 ] && { - [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel= - } - - nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "${has_kernel:+$kernel_length}" "$has_env" - - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - [ "$has_kernel" = "1" ] && { - local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" - tar xf "$tar_file" ${board_dir}/kernel -O | \ - ubiupdatevol /dev/$kern_ubivol -s $kernel_length - - } - - [ "$has_rootfs" = "1" ] && { - local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" - tar xf "$tar_file" ${board_dir}/root -O | \ - ubiupdatevol /dev/$root_ubivol -s $rootfs_length - - } - nand_do_upgrade_success -} - -# Recognize type of passed file and start the upgrade process -nand_do_upgrade() { - local file_type=$(identify $1) - - [ ! "$( find_mtd_index "$CI_UBIPART" )" ] && CI_UBIPART="rootfs" - - case "$file_type" in - "fit") nand_upgrade_fit $1;; - "ubi") nand_upgrade_ubinized $1;; - "ubifs") nand_upgrade_ubifs $1;; - *) nand_upgrade_tar $1;; - esac -} - -# Check if passed file is a valid one for NAND sysupgrade. Currently it accepts -# 3 types of files: -# 1) UBI - should contain an ubinized image, header is checked for the proper -# MAGIC -# 2) UBIFS - should contain UBIFS partition that will replace "rootfs" volume, -# header is checked for the proper MAGIC -# 3) TAR - archive has to include "sysupgrade-BOARD" directory with a non-empty -# "CONTROL" file (at this point its content isn't verified) -# -# You usually want to call this function in platform_check_image. -# -# $(1): board name, used in case of passing TAR file -# $(2): file to be checked -nand_do_platform_check() { - local board_name="$1" - local tar_file="$2" - local control_length=$( (tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null) - local file_type="$(identify $2)" - - [ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" -a "$file_type" != "fit" ] && { - echo "Invalid sysupgrade file." - return 1 - } - - return 0 -} diff --git a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh deleted file mode 100755 index 499c39622..000000000 --- a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh +++ /dev/null @@ -1,304 +0,0 @@ -. /lib/functions/system.sh - - -RAMFS_COPY_BIN='fw_setenv' -RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock /tmp/downgrade' - -qca_do_upgrade() { - local tar_file="$1" - - local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} - local dev=$(find_mtd_chardev "0:HLOS") - - tar Oxf $tar_file ${board_dir}/kernel | mtd write - ${dev} - - if [ -n "$UPGRADE_BACKUP" ]; then - tar Oxf $tar_file ${board_dir}/root | mtd -j "$UPGRADE_BACKUP" write - rootfs - else - tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs - fi -} - -find_mmc_part() { - local DEVNAME PARTNAME - - if grep -q "$1" /proc/mtd; then - echo "" && return 0 - fi - - for DEVNAME in /sys/block/mmcblk*/mmcblk*p*; do - PARTNAME=$(grep PARTNAME ${DEVNAME}/uevent | cut -f2 -d'=') - [ "$PARTNAME" = "$1" ] && echo "/dev/$(basename $DEVNAME)" && return 0 - done -} - -do_flash_emmc() { - local tar_file=$1 - local emmcblock=$(find_mmc_part $2) - local board_dir=$3 - local part=$4 - - [ -b "$emmcblock" ] || emmcblock=$(find_mmc_part $2) - - [ -z "$emmcblock" ] && { - echo failed to find $2 - return - } - - echo erase $4 / $emmcblock - dd if=/dev/zero of=${emmcblock} 2> /dev/null - echo flash $4 - tar Oxf $tar_file ${board_dir}/$part | dd of=${emmcblock} -} - -spi_nor_emmc_do_upgrade_bootconfig() { - local tar_file="$1" - - local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} - [ -f /proc/boot_info/getbinary_bootconfig ] || { - echo "bootconfig does not exist" - exit - } - CI_ROOTPART="$(cat /proc/boot_info/rootfs/upgradepartition)" - CI_KERNPART="$(cat /proc/boot_info/0:HLOS/upgradepartition)" - - [ -n "$CI_KERNPART" -a -n "$CI_ROOTPART" ] || { - echo "kernel or rootfs partition is unknown" - exit - } - - local primary="0" - [ "$(cat /proc/boot_info/rootfs/primaryboot)" = "0" ] && primary="1" - echo "$primary" > /proc/boot_info/rootfs/primaryboot 2>/dev/null - echo "$primary" > /proc/boot_info/0:HLOS/primaryboot 2>/dev/null - cp /proc/boot_info/getbinary_bootconfig /tmp/bootconfig - - do_flash_emmc $tar_file $CI_KERNPART $board_dir kernel - do_flash_emmc $tar_file $CI_ROOTPART $board_dir root - - local emmcblock="$(find_mmc_part "rootfs_data")" - if [ -e "$emmcblock" ]; then - mkfs.ext4 -F "$emmcblock" - fi - - for part in "0:BOOTCONFIG" "0:BOOTCONFIG1"; do - local mtdchar=$(echo $(find_mtd_chardev $part) | sed 's/^.\{5\}//') - if [ -n "$mtdchar" ]; then - echo start to update $mtdchar - mtd -qq write /proc/boot_info/getbinary_bootconfig "/dev/${mtdchar}" 2>/dev/null && echo update mtd $mtdchar - else - emmcblock=$(find_mmc_part $part) - echo erase ${emmcblock} - dd if=/dev/zero of=${emmcblock} 2> /dev/null - echo update $emmcblock - dd if=/tmp/bootconfig of=${emmcblock} 2> /dev/null - fi - done -} - -emmc_do_upgrade() { - local tar_file="$1" - - local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} - do_flash_emmc $tar_file '0:HLOS' $board_dir kernel - do_flash_emmc $tar_file 'rootfs' $board_dir root - - local emmcblock="$(find_mmc_part "rootfs_data")" - if [ -e "$emmcblock" ]; then - mkfs.ext4 -F "$emmcblock" - fi -} - -platform_check_image() { - local magic_long="$(get_magic_long "$1")" - board=$(board_name) - case $board in - cig,wf186w|\ - cig,wf186h|\ - cig,wf188|\ - cig,wf660a|\ - cig,wf188n|\ - cig,wf194c|\ - cig,wf194c4|\ - cig,wf196|\ - cybertan,eww622-a1|\ - cybertan,eww631-a1|\ - cybertan,eww631-b1|\ - glinet,ax1800|\ - glinet,axt1800|\ - indio,um-310ax-v1|\ - indio,um-510axp-v1|\ - indio,um-510axm-v1|\ - wallys,dr5018|\ - wallys,dr6018|\ - wallys,dr6018-v4|\ - edgecore,eap101|\ - edgecore,eap102|\ - edgecore,oap102|\ - edgecore,eap104|\ - liteon,wpx8324|\ - edgecore,eap106|\ - hfcl,ion4xi|\ - hfcl,ion4xi_w|\ - hfcl,ion4x_w|\ - hfcl,ion4xi_HMR|\ - hfcl,ion4xi_wp|\ - hfcl,ion4x|\ - hfcl,ion4x_2|\ - hfcl,ion4xe|\ - muxi,ap3220l|\ - plasmacloud,pax1800-v1|\ - plasmacloud,pax1800-v2|\ - tplink,ex227|\ - tplink,ex447|\ - yuncore,ax840|\ - yuncore,fap650|\ - yuncore,fap655|\ - motorola,q14|\ - muxi,ap3220l|\ - qcom,ipq6018-cp01|\ - qcom,ipq807x-hk01|\ - qcom,ipq807x-hk14|\ - optimcloud,d60|\ - optimcloud,d60-5g|\ - optimcloud,d50|\ - optimcloud,d50-5g|\ - qcom,ipq5018-mp03.3) - [ "$magic_long" = "73797375" ] && return 0 - ;; - esac - return 1 -} - -platform_do_upgrade() { - CI_UBIPART="rootfs" - CI_ROOTPART="ubi_rootfs" - CI_IPQ807X=1 - - board=$(board_name) - case $board in - cig,wf188) - qca_do_upgrade $1 - ;; - cig,wf660a) - spi_nor_emmc_do_upgrade_bootconfig $1 - ;; - motorola,q14) - emmc_do_upgrade $1 - ;; - cig,wf188n|\ - cig,wf194c|\ - cig,wf194c4|\ - cig,wf196|\ - cybertan,eww622-a1|\ - glinet,ax1800|\ - glinet,axt1800|\ - indio,um-310ax-v1|\ - indio,um-510axp-v1|\ - indio,um-510axm-v1|\ - qcom,ipq6018-cp01|\ - qcom,ipq807x-hk01|\ - qcom,ipq807x-hk14|\ - optimcloud,d60|\ - optimcloud,d60-5g|\ - optimcloud,d50|\ - optimcloud,d50-5g|\ - qcom,ipq5018-mp03.3|\ - wallys,dr5018|\ - wallys,dr6018|\ - wallys,dr6018-v4|\ - yuncore,fap650|\ - tplink,ex447|\ - tplink,ex227|\ - meshpp,s618-cp03|\ - meshpp,s618-cp01) - nand_upgrade_tar "$1" - ;; - hfcl,ion4xi|\ - hfcl,ion4x|\ - hfcl,ion4x_2|\ - hfcl,ion4xe) - if grep -q rootfs_1 /proc/cmdline; then - CI_UBIPART="rootfs" - fw_setenv primary 0 || exit 1 - else - CI_UBIPART="rootfs_1" - fw_setenv primary 1 || exit 1 - fi - nand_upgrade_tar "$1" - ;; - hfcl,ion4xi_w|\ - hfcl,ion4x_w|\ - hfcl,ion4xi_HMR|\ - hfcl,ion4xi_wp) - wp_part=$(fw_printenv primary | cut -d = -f2) - echo "Current Primary is $wp_part" - if [[ $wp_part == 1 ]]; then - CI_UBIPART="rootfs" - CI_FWSETENV="primary 0" - else - CI_UBIPART="rootfs_1" - CI_FWSETENV="primary 1" - fi - nand_upgrade_tar "$1" - ;; - edgecore,eap104|\ - liteon,wpx8324|\ - edgecore,eap106) - CI_UBIPART="rootfs1" - [ "$(find_mtd_chardev rootfs)" ] && CI_UBIPART="rootfs" - nand_upgrade_tar "$1" - ;; - edgecore,eap101|\ - edgecore,eap102|\ - edgecore,oap102) - if [ "$(find_mtd_chardev rootfs)" ]; then - CI_UBIPART="rootfs" - else - if [ -e /tmp/downgrade ]; then - CI_UBIPART="rootfs1" - { echo 'active 1'; echo 'upgrade_available 0'; } > /tmp/fw_setenv.txt || exit 1 - CI_FWSETENV="-s /tmp/fw_setenv.txt" - elif grep -q rootfs1 /proc/cmdline; then - CI_UBIPART="rootfs2" - CI_FWSETENV="active 2" - else - CI_UBIPART="rootfs1" - CI_FWSETENV="active 1" - fi - fi - nand_upgrade_tar "$1" - ;; - plasmacloud,pax1800-v1|\ - plasmacloud,pax1800-v2) - PART_NAME="inactive" - platform_do_upgrade_dualboot_datachk "$1" - ;; - cig,wf186w|\ - cig,wf186h|\ - yuncore,ax840|\ - yuncore,fap655) - [ -f /proc/boot_info/rootfs/upgradepartition ] && { - CI_UBIPART="$(cat /proc/boot_info/rootfs/upgradepartition)" - CI_BOOTCFG=1 - } - nand_upgrade_tar "$1" - ;; - cybertan,eww631-a1|\ - cybertan,eww631-b1) - boot_part=$(fw_printenv bootfrom | cut -d = -f2) - echo "Current bootfrom is $boot_part" - if [[ $boot_part == 1 ]]; then - CI_UBIPART="rootfs" - CI_FWSETENV="bootfrom 0" - else - CI_UBIPART="rootfs_1" - CI_FWSETENV="bootfrom 1" - fi - nand_upgrade_tar "$1" - ;; - esac -} diff --git a/feeds/ipq807x/ipq807x/config-4.4 b/feeds/ipq807x/ipq807x/config-4.4 deleted file mode 100644 index ade52a54b..000000000 --- a/feeds/ipq807x/ipq807x/config-4.4 +++ /dev/null @@ -1,832 +0,0 @@ -# CONFIG_AHCI_IPQ is not set -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_ALLOW_DEV_COREDUMP is not set -# CONFIG_AMBA_PL08X is not set -# CONFIG_APM_EMULATION is not set -# CONFIG_APQ_GCC_8084 is not set -# CONFIG_APQ_MMCC_8084 is not set -# CONFIG_AR8216_PHY is not set -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_SG_CHAIN=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -# CONFIG_ARCH_IPQ40XX is not set -# CONFIG_ARCH_IPQ806x is not set -# CONFIG_ARCH_IPQ807x is not set -# CONFIG_ARCH_IPQ6018 is not set -# CONFIG_ARCH_IPQ5018 is not set -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -# CONFIG_ARCH_MSM8960 is not set -# CONFIG_ARCH_MSM8974 is not set -CONFIG_ARCH_MSM8X60=y -CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_MULTI_CPU_AUTO is not set -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_NR_GPIO=0 -CONFIG_ARCH_QCOM=y -CONFIG_QSEECOM=m -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y -CONFIG_ARM=y -CONFIG_ARM_AMBA=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -# CONFIG_ARM_ATAG_DTB_COMPAT is not set -CONFIG_ARM_CCI=y -CONFIG_ARM_CCI400_COMMON=y -CONFIG_ARM_CCI400_PMU=y -CONFIG_ARM_CCI_PMU=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_GIC=y -CONFIG_ARM_HAS_SG_CHAIN=y -# CONFIG_ARM_HIGHBANK_CPUIDLE is not set -CONFIG_ARM_CPUIDLE=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_L1_CACHE_SHIFT_6=y -# CONFIG_ARM_LPAE is not set -CONFIG_ARM_MODULE_PLTS=y -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_ARM_PMU=y -CONFIG_ARM_PSCI=y -CONFIG_ARM_PSCI_FW=y -CONFIG_ARM_QCOM_CPUFREQ=y -# CONFIG_ARM_SMMU is not set -# CONFIG_ARM_SP805_WATCHDOG is not set -CONFIG_ARM_THUMB=y -# CONFIG_ARM_THUMBEE is not set -CONFIG_ARM_UNWIND=y -CONFIG_ARM_VIRT_EXT=y -CONFIG_AT803X_PHY=y -# CONFIG_ATA is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NVME=y -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 -# CONFIG_BOOTCONFIG_PARTITION is not set -# CONFIG_VIRTIO_BLK is not set -# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set -CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 -CONFIG_BOUNCE=y -CONFIG_BUILD_BIN2C=y -# CONFIG_CNSS_QCN9000 is not set -# CONFIG_CNSS2 is not set -# CONFIG_CNSS2_GENL is not set -# CONFIG_CNSS2_DEBUG is not set -# CONFIG_CNSS2_PM is not set -# CONFIG_CNSS2_PCI_DRIVER is not set -# CONFIG_CNSS2_CALIBRATION_SUPPORT is not set -# CONFIG_CNSS2_SMMU is not set -# CONFIG_CNSS2_RAMDUMP is not set -# CONFIG_CACHE_L2X0 is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_CC_STACKPROTECTOR=y -# CONFIG_CC_STACKPROTECTOR_NONE is not set -CONFIG_CC_STACKPROTECTOR_REGULAR=y -# CONFIG_CHARGER_QCOM_SMBB is not set -CONFIG_CLEANCACHE=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLKSRC_OF=y -CONFIG_CLKSRC_PROBE=y -CONFIG_CLKSRC_QCOM=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -CONFIG_COMMON_CLK_QCOM=y -CONFIG_CONFIGFS_FS=y -CONFIG_COREDUMP=y -# CONFIG_CORESIGHT is not set -# CONFIG_CORESIGHT_CSR is not set -# CONFIG_CORESIGHT_CTI is not set -# NFIG_CORESIGHT_EVENT is not set -# CONFIG_CORESIGHT_HWEVENT is not set -# CONFIG_CORESIGHT_LINKS_AND_SINKS is not set -# CONFIG_CORESIGHT_LINK_AND_SINK_TMC is not set -# CONFIG_CORESIGHT_QCOM_REPLICATOR is not set -# CONFIG_CORESIGHT_QPDI is not set -# CONFIG_CORESIGHT_SINK_ETBV10 is not set -# CONFIG_CORESIGHT_SINK_TPIU is not set -# CONFIG_CORESIGHT_SOURCE_DUMMY is not set -# CONFIG_CORESIGHT_SOURCE_ETM3X is not set -# CONFIG_CORESIGHT_SOURCE_ETM4X is not set -# CONFIG_CORESIGHT_REMOTE_ETM is not set -# CONFIG_CORESIGHT_STM is not set -# CONFIG_CORESIGHT_TPDA is not set -# CONFIG_CORESIGHT_TPDM is not set -# CONFIG_CORESIGHT_TPDM_DEFAULT_ENABLE is not set -# CONFIG_CORESIGHT_STREAM is not set -CONFIG_CPUFREQ_DT=y -CONFIG_CPUFREQ_DT_PLATDEV=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -# CONFIG_CPU_BIG_ENDIAN is not set -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -# CONFIG_CPU_SW_DOMAIN_PAN is not set -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_USERSPACE=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_HAS_ASID=y -# CONFIG_CPU_ICACHE_DISABLE is not set -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_PM=y -CONFIG_CPU_RMAP=y -# CONFIG_CPU_THERMAL is not set -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_V7=y -CONFIG_CRC16=y -# CONFIG_CRC32_SARWATE is not set -CONFIG_CRC32_SLICEBY8=y -CONFIG_CROSS_MEMORY_ATTACH=y -# CONFIG_CRYPTO_DEV_QCOM_MSM_QCE is not set -# CONFIG_CRYPTO_DEV_OTA_CRYPTO is not set -# CONFIG_FIPS_ENABLE is not set -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CCM=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CTR=y -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_CMAC=y -# CONFIG_CRYPTO_DEV_QCOM_ICE is not set -CONFIG_CRYPTO_ECHAINIV=y -CONFIG_CRYPTO_ECB=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_HASH_INFO=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_LZO=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_WORKQUEUE=y -CONFIG_CRYPTO_XZ=y -CONFIG_CRYPTO_ARC4=y -CONFIG_CRYPTO_GCM=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_GPIO=y -# CONFIG_DEBUG_INFO_REDUCED is not set -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -# CONFIG_DEBUG_MEM_USAGE is not set -# CONFIG_DEBUG_UART_8250 is not set -# CONFIG_DEBUG_USER is not set -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DEVMEM=y -# CONFIG_DIAG_OVER_USB is not set -CONFIG_DMADEVICES=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DMA_VIRTUAL_CHANNELS=y -CONFIG_DTC=y -# CONFIG_DWMAC_GENERIC is not set -# CONFIG_DWMAC_IPQ806X is not set -# CONFIG_DWMAC_SUNXI is not set -# CONFIG_DW_DMAC_PCI is not set -# CONFIG_VHOST_NET is not set -# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set -CONFIG_DYNAMIC_DEBUG=y -CONFIG_ETHERNET_PACKET_MANGLE=y -CONFIG_EXT4_FS=y -# CONFIG_EXT4_USE_FOR_EXT2 is not set -CONFIG_FB=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_CMDLINE=y -CONFIG_FB_QCOM_QPIC=y -CONFIG_FB_QCOM_QPIC_ER_SSD1963_PANEL=y -CONFIG_FB_SYS_FOPS=y -CONFIG_FIXED_PHY=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_FS_MBCACHE=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -# CONFIG_GENERIC_CPUFREQ_KRAIT is not set -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PHY=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GPIOLIB=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_DEVRES=y -# CONFIG_GPIO_LATCH is not set -# CONFIG_GPIO_NXP_74HC153 is not set -CONFIG_GPIO_SYSFS=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARM_ARCH_TIMER=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -# CONFIG_SRD_TRACE is not set -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_IDE=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_XZ=y -# CONFIG_HAVE_KPROBES is not set -# CONFIG_HAVE_KRETPROBES is not set -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -# CONFIG_HAVE_OPTPROBES is not set -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_SMP=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_UID16=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HIGHMEM=y -CONFIG_HIGHPTE=y -CONFIG_HOTPLUG_CPU=y -CONFIG_HWMON=y -CONFIG_HWSPINLOCK=y -CONFIG_HWSPINLOCK_QCOM=y -CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_MSM=y -CONFIG_HZ_FIXED=0 -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_QUP=y -# CONFIG_IIO is not set -# CONFIG_IIO_BUFFER is not set -# CONFIG_IIO_TRIGGER is not set -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_INPUT_PM8941_PWRKEY is not set -CONFIG_IOMMU_HELPER=y -# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set -# CONFIG_IPQ_DWC3_QTI_EXTCON is not set -# CONFIG_IPQ_GCC_4019 is not set -# CONFIG_IPQ_GCC_5018 is not set -# CONFIG_IPQ_APSS_5018 is not set -# CONFIG_IPQ_GCC_6018 is not set -# CONFIG_IPQ_APSS_6018 is not set -# CONFIG_IPQ_GCC_806X is not set -# CONFIG_IPQ_ADSS_807x is not set -# CONFIG_IPQ_APSS_807x is not set -# CONFIG_IPQ_GCC_807x is not set -# CONFIG_IPQ_ADCC_4019 is not set -# CONFIG_IPQ_LCC_806X is not set -# CONFIG_IPQ_REMOTEPROC_ADSP is not set -# CONFIG_IPQ_SUBSYSTEM_RESTART is not set -# CONFIG_IPQ_SUBSYSTEM_RESTART_TEST is not set -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -# CONFIG_IPC_ROUTER is not set -# CONFIG_IPC_ROUTER_SECURITY is not set -# CONFIG_IPC_LOGGING is not set -CONFIG_KPSS_XCC=y -# CONFIG_KRAITCC is not set -# CONFIG_KRAIT_CLOCKS is not set -# CONFIG_KRAIT_L2_ACCESSORS is not set -CONFIG_LEDS_IPQ=y -CONFIG_LEDS_PWM=y -CONFIG_LEDS_TLC591XX=y -# CONFIG_LEDS_PCA9956B is not set -CONFIG_LIBFDT=y -CONFIG_LOCKUP_DETECTOR=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_MDIO=y -CONFIG_MDIO_BITBANG=y -CONFIG_MDIO_BOARDINFO=y -CONFIG_MDIO_GPIO=y -# CONFIG_MDIO_QCA is not set -CONFIG_MFD_QCOM_RPM=y -CONFIG_MFD_SPMI_PMIC=y -# CONFIG_SLIMBUS is not set -# CONFIG_SLIMBUS_MSM_CTRL is not set -# CONFIG_SLIMBUS_MSM_NGD is not set -# CONFIG_OF_SLIMBUS is not set -CONFIG_MFD_SYSCON=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_MMC=y -CONFIG_MMC_ARMMMCI=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_MINORS=32 -CONFIG_MMC_QCOM_DML=y -CONFIG_MMC_QCOM_TUNING=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_MSM=y -# CONFIG_MMC_SDHCI_OF_ARASAN is not set -# CONFIG_MMC_SDHCI_PCI is not set -CONFIG_MMC_SDHCI_PLTFM=y -# CONFIG_MMC_TIFM_SD is not set -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_MODULES_USE_ELF_REL=y -# CONFIG_MPLS_ROUTING is not set -# CONFIG_MSM_GCC_8660 is not set -# CONFIG_MSM_GCC_8916 is not set -# CONFIG_MSM_GCC_8960 is not set -# CONFIG_MSM_GCC_8974 is not set -# CONFIG_MSM_LCC_8960 is not set -# CONFIG_MSM_MMCC_8960 is not set -# CONFIG_MSM_MMCC_8974 is not set -# CONFIG_MSM_MHI is not set -# CONFIG_MSM_IPC_ROUTER_MHI_XPRT is not set -# CONFIG_MSM_MHI_DEBUG is not set -# CONFIG_MSM_MHI_DEV is not set -# CONFIG_MSM_MHI_UCI is not set -# CONFIG_DIAGFWD_BRIDGE_CODE is not set -# CONFIG_MSM_BUS_SCALING is not set -# CONFIG_BUS_TOPOLOGY_ADHOC is not set -# CONFIG_QPNP_REVID is not set -# CONFIG_SPS is not set -# CONFIG_SPS_SUPPORT_NDP_BAM is not set -# CONFIG_USB_BAM is not set -# CONFIG_SPS_SUPPORT_BAMDMA is not set -# CONFIG_IPA is not set -# CONFIG_IPA3 is not set -# CONFIG_EP_PCIE is not set -# CONFIG_GSI is not set -# CONFIG_PFT is not set -# CONFIG_SEEMP_CORE is not set -# CONFIG_GPIO_USB_DETECT is not set -# CONFIG_MSM_GLINK is not set -# CONFIG_MSM_GLINK_LOOPBACK_SERVER is not set -# CONFIG_MSM_GLINK_SMEM_NATIVE_XPRT is not set -# CONFIG_MSM_GLINK_PKT is not set -# CONFIG_MSM_IPC_ROUTER_GLINK_XPRT is not set -# CONFIG_MSM_QMI_INTERFACE is not set -# CONFIG_MSM_TEST_QMI_CLIENT is not set -# CONFIG_GLINK_DEBUG_FS is not set -# CONFIG_MSM_RPM_SMD is not set -# CONFIG_MSM_RPM_GLINK is not set -CONFIG_MSM_RPM_LOG=y -# CONFIG_MSM_SMEM is not set -CONFIG_MTD_CMDLINE_PARTS=y -CONFIG_MTD_M25P80=y -CONFIG_MTD_NAND=y -CONFIG_MTD_NAND_ECC=y -CONFIG_MTD_NAND_QCOM=y -CONFIG_MTD_QCOM_SMEM_PARTS=y -CONFIG_MTD_SPINAND_GIGADEVICE=y -CONFIG_MTD_SPINAND_MT29F=y -CONFIG_MTD_SPINAND_ONDIEECC=y -CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_SPLIT_FIRMWARE=y -CONFIG_MTD_SPLIT_FIT_FW=y -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_BEB_LIMIT=20 -CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -CONFIG_MTD_UBI_GLUEBI=y -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MULTI_IRQ_HANDLER=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEON=y -CONFIG_NET=y -# CONFIG_NET_DSA_MV88E6063 is not set -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NO_BOOTMEM=y -CONFIG_NO_HZ=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NR_CPUS=4 -CONFIG_NUM_ALT_PARTITION=8 -CONFIG_NVMEM=y -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_ADDRESS_PCI=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=y -CONFIG_OF_MTD=y -CONFIG_OF_NET=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_OF_RESERVED_MEM=y -CONFIG_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_PAGE_OFFSET=0xC0000000 -CONFIG_PANIC_ON_OOPS=y -CONFIG_PANIC_ON_OOPS_VALUE=1 -CONFIG_PANIC_TIMEOUT=5 -CONFIG_PCI=y -# CONFIG_PCIEAER is not set -CONFIG_PCIE_DW=y -# CONFIG_PCIE_DW_PLAT is not set -CONFIG_PCIE_PME=y -CONFIG_PCIE_QCOM=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_MSI=y -CONFIG_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -# CONFIG_PHY_IPQ_BALDUR_USB is not set -# CONFIG_PHY_IPQ_UNIPHY_USB is not set -# CONFIG_PHY_QCOM_APQ8064_SATA is not set -# CONFIG_PHY_QCOM_IPQ806X_SATA is not set -CONFIG_PHY_QCA_PCIE_QMP=y -# CONFIG_PHY_QCOM_UFS is not set -# CONFIG_PHY_IPQ_UNIPHY_PCIE is not set -CONFIG_PINCTRL=y -# CONFIG_PINCTRL_APQ8064 is not set -# CONFIG_PINCTRL_APQ8084 is not set -# CONFIG_PINCTRL_IPQ4019 is not set -# CONFIG_PINCTRL_IPQ6018 is not set -# CONFIG_PINCTRL_IPQ8064 is not set -# CONFIG_PINCTRL_IPQ807x is not set -# CONFIG_PINCTRL_IPQ5018 is not set -CONFIG_PINCTRL_MSM=y -# CONFIG_PINCTRL_MSM8660 is not set -# CONFIG_PINCTRL_MSM8916 is not set -# CONFIG_PINCTRL_MSM8960 is not set -CONFIG_PINCTRL_QCOM_SPMI_PMIC=y -# CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set -# CONFIG_PL330_DMA is not set -CONFIG_PM=y -CONFIG_PM_CLK=y -# CONFIG_PM_DEBUG is not set -CONFIG_PM_GENERIC_DOMAINS=y -CONFIG_PM_GENERIC_DOMAINS_OF=y -CONFIG_PM_GENERIC_DOMAINS_SLEEP=y -CONFIG_PM_OPP=y -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_SMP=y -CONFIG_POWER_RESET=y -CONFIG_POWER_RESET_MSM=y -CONFIG_POWER_SUPPLY=y -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y -# CONFIG_PROC_STRIPPED is not set -CONFIG_PSTORE=y -CONFIG_PSTORE_RAM=y -CONFIG_PSTORE_CONSOLE=y -CONFIG_PSTORE_PMSG=y -CONFIG_PWM=y -CONFIG_PWM_IPQ4019=y -# CONFIG_PWM_PCA9685 is not set -CONFIG_PWM_SYSFS=y -CONFIG_QCOM_ADM=y -# CONFIG_QCOM_APM is not set -CONFIG_QCOM_BAM_DMA=y -# CONFIG_QTI_BT_TTY is not set -# CONFIG_QCOM_COINCELL is not set -# CONFIG_QCOM_DCC is not set -CONFIG_QCOM_GDSC=y -CONFIG_QCOM_GSBI=y -# CONFIG_QCOM_HFPLL is not set -# CONFIG_QCOM_MEMORY_DUMP_V2 is not set -# CONFIG_QCOM_MDT_LOADER is not set -CONFIG_QCOM_QFPROM=y -# CONFIG_QCOM_SPMI_TEMP_ALARM is not set -CONFIG_QCOM_RPM_CLK=y -# CONFIG_QCOM_RTB is not set -# CONFIG_QCOM_PM is not set -CONFIG_QCOM_SCM=y -CONFIG_QCOM_SCM_32=y -# CONFIG_HAVE_ARM_SMCCC is not set -CONFIG_QCA_SCM_RESTART_REASON=y -CONFIG_IPQ_TCSR=y -CONFIG_QCOM_QFPROM=y -# CONFIG_QCOM_SMD is not set -CONFIG_QCOM_SMEM=y -CONFIG_QCOM_SMEM_STATE=y -# CONFIG_QCOM_SMD is not set -CONFIG_QCOM_SMP2P=y -# CONFIG_QCOM_SPMI_VADC is not set -CONFIG_QCOM_TSENS=y -CONFIG_QCOM_TZ_LOG=y -CONFIG_QCOM_WDT=y -CONFIG_QMI_ENCDEC=y -CONFIG_RATIONAL=y -# CONFIG_RCU_BOOST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=21 -# CONFIG_RCU_EXPERT is not set -CONFIG_RCU_STALL_COMMON=y -CONFIG_RD_GZIP=y -CONFIG_REGMAP=y -# CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS is not set -CONFIG_REGMAP_MMIO=y -CONFIG_REGULATOR=y -# CONFIG_REGULATOR_CPR3 is not set -CONFIG_REGULATOR_GPIO=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_QCOM_RPM=y -CONFIG_REGULATOR_QCOM_SPMI=y -# CONFIG_REGULATOR_IPQ40XX is not set -# CONFIG_REGULATOR_RPM_SMD is not set -# CONFIG_REGULATOR_RPM_GLINK is not set -CONFIG_RELAY=y -CONFIG_REMOTEPROC=y -# CONFIG_IPQ807X_REMOTEPROC is not set -CONFIG_RESET_CONTROLLER=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -CONFIG_RTC_CLASS=y -CONFIG_NET_L3_MASTER_DEV=y -# CONFIG_RTC_DRV_CMOS is not set -# CONFIG_RTC_DRV_PM8XXX is not set -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -# CONFIG_SATA_AHCI is not set -CONFIG_SCHED_HRTICK=y -# CONFIG_SCSI is not set -# CONFIG_SCHED_INFO is not set -# CONFIG_SCSI_DMA is not set -# CONFIG_SERIAL_8250 is not set -# CONFIG_SERIAL_8250_CONSOLE is not set -# CONFIG_SERIAL_8250_DMA is not set -# CONFIG_SERIAL_AMBA_PL010 is not set -# CONFIG_SERIAL_AMBA_PL011 is not set -CONFIG_SERIAL_MSM=y -CONFIG_SERIAL_MSM_CONSOLE=y -# CONFIG_VIRTIO_CONSOLE is not set -CONFIG_SMP=y -CONFIG_SMP_ON_UP=y -# CONFIG_SND is not set -CONFIG_SND_DYNAMIC_MINORS=y -CONFIG_SND_MAX_CARDS=32 -CONFIG_SND_PROC_FS=y -# CONFIG_SND_COMPRESS_OFFLOAD is not set -CONFIG_SND_PCM=y -CONFIG_SND_SOC=y -# CONFIG_SND_SOC_APQ8016_SBC is not set -CONFIG_SND_SOC_I2C_AND_SPI=y -# CONFIG_SND_SOC_IPQ is not set -# CONFIG_SND_SOC_IPQ806X_LPAIF is not set -# CONFIG_SND_SOC_IPQ806X_PCM_RAW is not set -CONFIG_SND_SOC_IPQ_ADSS=y -CONFIG_SND_SOC_IPQ_CODEC=y -CONFIG_SND_SOC_IPQ_CPU_DAI=y -CONFIG_SND_SOC_IPQ_MBOX=y -CONFIG_SND_SOC_IPQ_PCM_I2S=y -CONFIG_SND_SOC_IPQ_PCM_RAW=y -CONFIG_SND_SOC_IPQ_PCM_SPDIF=y -CONFIG_SND_SOC_IPQ_PCM_TDM=y -CONFIG_SND_SOC_IPQ_STEREO=y -CONFIG_SND_SOC_QCOM=y -# CONFIG_SND_SOC_STORM is not set -CONFIG_SOUND=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_QUP=y -CONFIG_SPI_SPIDEV=y -# CONFIG_SPI_VSC7385 is not set -CONFIG_SPMI=y -CONFIG_SPMI_MSM_PMIC_ARB=y -CONFIG_SRCU=y -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_STOPWATCH is not set -CONFIG_SUSPEND=y -CONFIG_SWCONFIG=y -CONFIG_SWIOTLB=y -# CONFIG_SWAP is not set -CONFIG_SWP_EMULATE=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_GOV_USER_SPACE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -CONFIG_THERMAL_WRITABLE_TRIPS=y -# CONFIG_THUMB2_KERNEL is not set -# CONFIG_TICK_CPU_ACCOUNTING is not set -CONFIG_IRQ_TIME_ACCOUNTING=y -CONFIG_TRACING_EVENTS_GPIO=y -CONFIG_UBIFS_FS=y -CONFIG_UBIFS_FS_ADVANCED_COMPR=y -CONFIG_UBIFS_FS_LZO=y -CONFIG_UBIFS_FS_XZ=y -CONFIG_UBIFS_FS_ZLIB=y -CONFIG_UEVENT_HELPER_PATH="" -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB_GADGET=n -CONFIG_USB_SUPPORT=y -# CONFIG_USB_DWC3_OF_SIMPLE is not set -# CONFIG_USB_QCOM_8X16_PHY is not set -# CONFIG_USB_QCOM_KS_BRIDGE is not set -# CONFIG_USB_QCOM_QUSB_PHY is not set -# CONFIG_USB_QCOM_QMP_PHY is not set -# CONFIG_USB_QCA_M31_PHY is not set -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -# CONFIG_USB_EHCI_TT_NEWSCHED is not set -# CONFIG_USB_OHCI_LITTLE_ENDIAN is not set -CONFIG_USE_OF=y -CONFIG_VDSO=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WL_TI is not set -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_XPS=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZLIB_DEFLATE=y -CONFIG_ZLIB_INFLATE=y -CONFIG_ZONE_DMA_FLAG=0 -CONFIG_QCOM_CACHE_DUMP=y -CONFIG_QCOM_CACHE_DUMP_ON_PANIC=y -# CONFIG_QCOM_RESTART_REASON is not set -# CONFIG_QCOM_DLOAD_MODE is not set -CONFIG_FW_AUTH=y -CONFIG_FW_AUTH_TEST=m -CONFIG_ASYMMETRIC_KEY_TYPE=y -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y -CONFIG_PUBLIC_KEY_ALGO_RSA=y -CONFIG_X509_CERTIFICATE_PARSER=y -CONFIG_PKCS7_MESSAGE_PARSER=n -CONFIG_KEYS=y -# CONFIG_SKB_RECYCLER is not set -CONFIG_SKB_RECYCLER_MULTI_CPU=y -# CONFIG_SKB_RECYCLER_PREALLOC is not set -# CONFIG_U_SERIAL_CONSOLE is not set -CONFIG_SCSI_SCAN_ASYNC=y -# CONFIG_NF_IPV6_DUMMY_HEADER is not set -# CONFIG_RMNET is not set -# CONFIG_RMNET_DATA is not set -# CONFIG_RMNET_CTL is not set -# CONFIG_MSM_SECURE_BUFFER is not set -# CONFIG_STAGING is not set -# CONFIG_ANDROID is not set -# CONFIG_ION is not set -# CONFIG_ION_DUMMY is not set -# CONFIG_ION_MSM is not set -# CONFIG_ION_TEST is not set -# CONFIG_CMA is not set -# CONFIG_CMA_DEBUG is not set -# CONFIG_CMA_DEBUGFS is not set -# CONFIG_DMA_CMA is not set -# CONFIG_CMA_AREAS is not set -# CONFIG_CMA_SIZE_MBYTES is not set -# CONFIG_CMA_SIZE_SEL_MBYTES is not set -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_MAX is not set -# CONFIG_CMA_ALIGNMENT is not set -# CONFIG_ASHMEM is not set -# CONFIG_ANDROID_TIMED_OUTPUT is not set -# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set -# CONFIG_SYNC is not set -# CONFIG_SW_SYNC is not set -# CONFIG_FSL_MC_BUS is not set -# CONFIG_ALLOC_BUFFERS_IN_4K_CHUNKS is not set -CONFIG_ALLOC_SKB_PAGE_FRAG_DISABLE=y -# CONFIG_MMAP_ALLOW_UNINITIALIZED is not set -# CONFIG_MAILBOX is not set -# CONFIG_MAILBOX_TEST is not set -# CONFIG_QCOM_APCS_IPC is not set -# CONFIG_QCOM_GLINK_SSR is not set -# CONFIG_QCOM_Q6V5_WCSS is not set -# CONFIG_QCOM_SYSMON is not set -# CONFIG_QRTR is not set -# CONFIG_QRTR_SMD is not set -# CONFIG_QRTR_TUN is not set -# CONFIG_RPMSG is not set -# CONFIG_RPMSG_QCOM_GLINK_RPM is not set -# CONFIG_RPMSG_VIRTIO is not set -# CONFIG_RPMSG_CHAR is not set -# CONFIG_RPMSG_QCOM_GLINK_SMEM is not set -# CONFIG_RPMSG_QCOM_SMD is not set -CONFIG_QCA_MINIDUMP=y -# CONFIG_QCA_MINIDUMP_DEBUG is not set -# CONFIG_QRTR_USB is not set -# CONFIG_QRTR_FIFO is not set -CONFIG_QRTR_MHI=y -CONFIG_MHI_BUS=y -# CONFIG_MHI_QTI is not set -# CONFIG_MHI_NETDEV is not set -# CONFIG_MHI_DEBUG is not set -# CONFIG_MHI_UCI is not set -# CONFIG_MHI_SATELLITE is not set -# CONFIG_DIAG_OVER_QRTR is not set -# CONFIG_MSM_ADSPRPC is not set -CONFIG_CRYPTO_MICHAEL_MIC=y -# CONFIG_ARCH_HAS_KCOV is not set -# CONFIG_KCOV is not set -# CONFIG_GCC_PLUGINS is not set -# CONFIG_QTI_Q6V5_ADSP is not set -# CONFIG_MSM_RPM_RPMSG is not set -# CONFIG_RPMSG_QCOM_GLINK_RPM is not set -# CONFIG_REGULATOR_RPM_GLINK is not set -# CONFIG_MTD_NAND_SERIAL is not set -# CONFIG_ARM_QTI_IPQ60XX_CPUFREQ is not set -# CONFIG_PAGE_SCOPE_MULTI_PAGE_READ is not set -# CONFIG_CRYPTO_NO_ZERO_LEN_HASH is not set -# CONFIG_CRYPTO_DISABLE_AES192_TEST is not set -# CONFIG_QTI_EUD is not set -# CONFIG_EUD_EXTCON_SUPPORT is not set -# CONFIG_CLK_TEST_5018 is not set -CONFIG_MAP_E_SUPPORT=y -# CONFIG_IPQ_FLASH_16M_PROFILE is not set -# CONFIG_QGIC2_MSI is not set -CONFIG_BRIDGE_VLAN_FILTERING=y -CONFIG_LEDS_GPIO=y -# CONFIG_ARCH_IPQ256M is not set -CONFIG_SKB_FIXED_SIZE_2K=y -# CONFIG_IPQ_MEM_PROFILE is not set -# CONFIG_VIRTIO_NET is not set -# CONFIG_QCA_85XX_SWITCH is not set -CONFIG_AQ_PHY=y -CONFIG_DIAG_CHAR=y -# CONFIG_HW_RANDOM_VIRTIO is not set -# CONFIG_CRYPTO_DEV_QCEDEV is not set -# CONFIG_CRYPTO_DEV_QCRYPTO is not set -# CONFIG_MHI_BUS_TEST is not set -# CONFIG_NF_CONNTRACK_RTCACHE is not set -# CONFIG_NF_LOG_IPV6 is not set -CONFIG_LEDS_TRIGGER_HEARTBEAT=y diff --git a/feeds/ipq807x/ipq807x/config-4.4-qsdk b/feeds/ipq807x/ipq807x/config-4.4-qsdk deleted file mode 100644 index 4e7602f23..000000000 --- a/feeds/ipq807x/ipq807x/config-4.4-qsdk +++ /dev/null @@ -1,4794 +0,0 @@ -CONFIG_32BIT=y -# CONFIG_6LOWPAN is not set -# CONFIG_6PACK is not set -# CONFIG_8139CP is not set -# CONFIG_8139TOO is not set -# CONFIG_9P_FS is not set -# CONFIG_AB3100_CORE is not set -# CONFIG_AB8500_CORE is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_ACCESSIBILITY is not set -# CONFIG_ACENIC is not set -# CONFIG_ACERHDF is not set -# CONFIG_ACORN_PARTITION is not set -# CONFIG_ACPI_ALS is not set -# CONFIG_ACPI_APEI is not set -# CONFIG_ACPI_BUTTON is not set -# CONFIG_ACPI_CUSTOM_METHOD is not set -# CONFIG_ACPI_EXTLOG is not set -# CONFIG_ACPI_HED is not set -# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set -# CONFIG_AD2S1200 is not set -# CONFIG_AD2S1210 is not set -# CONFIG_AD2S90 is not set -# CONFIG_AD5064 is not set -# CONFIG_AD525X_DPOT is not set -# CONFIG_AD5360 is not set -# CONFIG_AD5380 is not set -# CONFIG_AD5421 is not set -# CONFIG_AD5446 is not set -# CONFIG_AD5449 is not set -# CONFIG_AD5504 is not set -# CONFIG_AD5624R_SPI is not set -# CONFIG_AD5686 is not set -# CONFIG_AD5755 is not set -# CONFIG_AD5764 is not set -# CONFIG_AD5791 is not set -# CONFIG_AD5933 is not set -# CONFIG_AD7150 is not set -# CONFIG_AD7152 is not set -# CONFIG_AD7192 is not set -# CONFIG_AD7266 is not set -# CONFIG_AD7280 is not set -# CONFIG_AD7291 is not set -# CONFIG_AD7298 is not set -# CONFIG_AD7303 is not set -# CONFIG_AD7476 is not set -# CONFIG_AD7606 is not set -# CONFIG_AD7746 is not set -# CONFIG_AD7780 is not set -# CONFIG_AD7791 is not set -# CONFIG_AD7793 is not set -# CONFIG_AD7816 is not set -# CONFIG_AD7887 is not set -# CONFIG_AD7923 is not set -# CONFIG_AD799X is not set -# CONFIG_AD8366 is not set -# CONFIG_AD9523 is not set -# CONFIG_AD9832 is not set -# CONFIG_AD9834 is not set -# CONFIG_ADAPTEC_STARFIRE is not set -# CONFIG_ADE7753 is not set -# CONFIG_ADE7754 is not set -# CONFIG_ADE7758 is not set -# CONFIG_ADE7759 is not set -# CONFIG_ADE7854 is not set -# CONFIG_ADF4350 is not set -# CONFIG_ADFS_FS is not set -# CONFIG_ADIS16060 is not set -# CONFIG_ADIS16080 is not set -# CONFIG_ADIS16130 is not set -# CONFIG_ADIS16136 is not set -# CONFIG_ADIS16201 is not set -# CONFIG_ADIS16203 is not set -# CONFIG_ADIS16204 is not set -# CONFIG_ADIS16209 is not set -# CONFIG_ADIS16220 is not set -# CONFIG_ADIS16240 is not set -# CONFIG_ADIS16260 is not set -# CONFIG_ADIS16400 is not set -# CONFIG_ADIS16480 is not set -# CONFIG_ADJD_S311 is not set -# CONFIG_ADM6996_PHY is not set -# CONFIG_ADM8211 is not set -# CONFIG_ADT7316 is not set -# CONFIG_ADVISE_SYSCALLS is not set -# CONFIG_ADXRS450 is not set -CONFIG_AEABI=y -# CONFIG_AFFS_FS is not set -# CONFIG_AFS_FS is not set -# CONFIG_AF_RXRPC is not set -# CONFIG_AGP is not set -# CONFIG_AHCI_CEVA is not set -# CONFIG_AHCI_MVEBU is not set -# CONFIG_AHCI_QORIQ is not set -CONFIG_AIO=y -# CONFIG_AIRO is not set -# CONFIG_AIRO_CS is not set -# CONFIG_AIX_PARTITION is not set -# CONFIG_AK09911 is not set -# CONFIG_AK8975 is not set -# CONFIG_AL3320A is not set -# CONFIG_ALIM7101_WDT is not set -CONFIG_ALLOW_DEV_COREDUMP=y -# CONFIG_ALTERA_MBOX is not set -# CONFIG_ALTERA_STAPL is not set -# CONFIG_ALTERA_TSE is not set -# CONFIG_ALX is not set -# CONFIG_AM335X_PHY_USB is not set -# CONFIG_AMD8111_ETH is not set -# CONFIG_AMD_PHY is not set -# CONFIG_AMD_XGBE is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_AMILO_RFKILL is not set -# CONFIG_ANDROID is not set -CONFIG_ANON_INODES=y -# CONFIG_APDS9300 is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_APDS9960 is not set -# CONFIG_APM8018X is not set -# CONFIG_APPLE_GMUX is not set -# CONFIG_APPLICOM is not set -# CONFIG_AQUANTIA_PHY is not set -# CONFIG_AR5523 is not set -# CONFIG_AR7 is not set -# CONFIG_AR8216_PHY is not set -# CONFIG_AR8216_PHY_LEDS is not set -# CONFIG_ARCH_ALPINE is not set -# CONFIG_ARCH_AT91 is not set -# CONFIG_ARCH_BCM is not set -# CONFIG_ARCH_BCM2835 is not set -# CONFIG_ARCH_BERLIN is not set -# CONFIG_ARCH_CLPS711X is not set -# CONFIG_ARCH_CNS3XXX is not set -# CONFIG_ARCH_DAVINCI is not set -# CONFIG_ARCH_DIGICOLOR is not set -# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set -# CONFIG_ARCH_DOVE is not set -# CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_EP93XX is not set -# CONFIG_ARCH_EXYNOS is not set -CONFIG_ARCH_FLATMEM_ENABLE=y -# CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_GEMINI is not set -# CONFIG_ARCH_HAS_ILOG2_U32 is not set -# CONFIG_ARCH_HAS_ILOG2_U64 is not set -# CONFIG_ARCH_HI3xxx is not set -# CONFIG_ARCH_HIGHBANK is not set -# CONFIG_ARCH_HISI is not set -# CONFIG_ARCH_INTEGRATOR is not set -# CONFIG_ARCH_IOP13XX is not set -# CONFIG_ARCH_IOP32X is not set -# CONFIG_ARCH_IOP33X is not set -# CONFIG_ARCH_IXP4XX is not set -# CONFIG_ARCH_KEYSTONE is not set -# CONFIG_ARCH_KS8695 is not set -# CONFIG_ARCH_LPC32XX is not set -# CONFIG_ARCH_MEDIATEK is not set -# CONFIG_ARCH_MESON is not set -# CONFIG_ARCH_MMP is not set -# CONFIG_ARCH_MULTIPLATFORM is not set -# CONFIG_ARCH_MULTI_V6 is not set -# CONFIG_ARCH_MULTI_V7 is not set -# CONFIG_ARCH_MV78XX0 is not set -# CONFIG_ARCH_MVEBU is not set -# CONFIG_ARCH_MXC is not set -# CONFIG_ARCH_MXS is not set -# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set -# CONFIG_ARCH_NETX is not set -# CONFIG_ARCH_NOMADIK is not set -# CONFIG_ARCH_NSPIRE is not set -# CONFIG_ARCH_OMAP is not set -# CONFIG_ARCH_OMAP1 is not set -# CONFIG_ARCH_OMAP2PLUS is not set -# CONFIG_ARCH_OMAP3 is not set -# CONFIG_ARCH_OMAP4 is not set -# CONFIG_ARCH_ORION5X is not set -# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set -# CONFIG_ARCH_PICOXCELL is not set -# CONFIG_ARCH_PRIMA2 is not set -# CONFIG_ARCH_PXA is not set -# CONFIG_ARCH_QCOM is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_ROCKCHIP is not set -# CONFIG_ARCH_RPC is not set -# CONFIG_ARCH_S3C24XX is not set -# CONFIG_ARCH_S3C64XX is not set -# CONFIG_ARCH_S5PV210 is not set -# CONFIG_ARCH_SA1100 is not set -# CONFIG_ARCH_SHMOBILE is not set -# CONFIG_ARCH_SHMOBILE_MULTI is not set -# CONFIG_ARCH_SIRF is not set -# CONFIG_ARCH_SOCFPGA is not set -# CONFIG_ARCH_STI is not set -# CONFIG_ARCH_SUNXI is not set -# CONFIG_ARCH_TEGRA is not set -# CONFIG_ARCH_U300 is not set -# CONFIG_ARCH_U8500 is not set -# CONFIG_ARCH_UNIPHIER is not set -# CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_VEXPRESS is not set -# CONFIG_ARCH_VIRT is not set -# CONFIG_ARCH_VT8500 is not set -# CONFIG_ARCH_W90X900 is not set -# CONFIG_ARCH_WM8505 is not set -# CONFIG_ARCH_WM8850 is not set -# CONFIG_ARCH_ZX is not set -# CONFIG_ARCH_ZYNQ is not set -# CONFIG_ARCNET is not set -# CONFIG_ARC_EMAC is not set -# CONFIG_ARM_APPENDED_DTB is not set -# CONFIG_ARM_ARCH_TIMER is not set -# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set -# CONFIG_ARM_CCI is not set -# CONFIG_ARM_CCI400_PMU is not set -# CONFIG_ARM_CCI500_PMU is not set -# CONFIG_ARM_CCN is not set -CONFIG_ARM_CPU_TOPOLOGY=y -# CONFIG_ARM_CPUIDLE is not set -# CONFIG_ARM_CRYPTO is not set -CONFIG_ARM_DMA_MEM_BUFFERABLE=y -# CONFIG_ARM_ERRATA_326103 is not set -# CONFIG_ARM_ERRATA_364296 is not set -# CONFIG_ARM_ERRATA_411920 is not set -# CONFIG_ARM_ERRATA_430973 is not set -# CONFIG_ARM_ERRATA_458693 is not set -# CONFIG_ARM_ERRATA_460075 is not set -# CONFIG_ARM_ERRATA_643719 is not set -# CONFIG_ARM_ERRATA_720789 is not set -# CONFIG_ARM_ERRATA_742230 is not set -# CONFIG_ARM_ERRATA_742231 is not set -# CONFIG_ARM_ERRATA_743622 is not set -# CONFIG_ARM_ERRATA_751472 is not set -# CONFIG_ARM_ERRATA_754322 is not set -# CONFIG_ARM_ERRATA_754327 is not set -# CONFIG_ARM_ERRATA_764369 is not set -# CONFIG_ARM_ERRATA_773022 is not set -# CONFIG_ARM_ERRATA_775420 is not set -# CONFIG_ARM_ERRATA_798181 is not set -# CONFIG_ARM_KERNMEM_PERMS is not set -# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set -# CONFIG_ARM_KPROBES_TEST is not set -# CONFIG_ARM_MHU is not set -# CONFIG_ARM_MODULE_PLTS is not set -# CONFIG_ARM_PATCH_PHYS_VIRT is not set -# CONFIG_ARM_PSCI is not set -# CONFIG_ARM_PTDUMP is not set -# CONFIG_ARM_TIMER_SP804 is not set -# CONFIG_ARM_UNWIND is not set -# CONFIG_ARM_VIRT_EXT is not set -# CONFIG_AS3935 is not set -# CONFIG_ASM9260_TIMER is not set -# CONFIG_ASUS_LAPTOP is not set -# CONFIG_ASYMMETRIC_KEY_TYPE is not set -# CONFIG_ASYNC_RAID6_TEST is not set -# CONFIG_ASYNC_TX_DMA is not set -# CONFIG_AT76C50X_USB is not set -# CONFIG_AT803X_PHY is not set -# CONFIG_ATA is not set -# CONFIG_ATAGS is not set -CONFIG_ATAGS_PROC=y -# CONFIG_ATALK is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_ATA_ACPI is not set -CONFIG_ATA_BMDMA=y -# CONFIG_ATA_GENERIC is not set -# CONFIG_ATA_NONSTANDARD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_ATA_PIIX is not set -CONFIG_ATA_SFF=y -# CONFIG_ATA_VERBOSE_ERROR is not set -# CONFIG_ATH10K is not set -# CONFIG_ATH25 is not set -# CONFIG_ATH5K is not set -# CONFIG_ATH6KL is not set -# CONFIG_ATH79 is not set -# CONFIG_ATH9K is not set -# CONFIG_ATH9K_HTC is not set -# CONFIG_ATH_DEBUG is not set -# CONFIG_ATL1 is not set -# CONFIG_ATL1C is not set -# CONFIG_ATL1E is not set -# CONFIG_ATL2 is not set -# CONFIG_ATM is not set -# CONFIG_ATMEL is not set -# CONFIG_ATMEL_PIT is not set -# CONFIG_ATMEL_SSC is not set -# CONFIG_ATM_AMBASSADOR is not set -# CONFIG_ATM_BR2684 is not set -CONFIG_ATM_BR2684_IPFILTER=y -# CONFIG_ATM_CLIP is not set -CONFIG_ATM_CLIP_NO_ICMP=y -# CONFIG_ATM_DRIVERS is not set -# CONFIG_ATM_DUMMY is not set -# CONFIG_ATM_ENI is not set -# CONFIG_ATM_FIRESTREAM is not set -# CONFIG_ATM_FORE200E is not set -# CONFIG_ATM_HE is not set -# CONFIG_ATM_HORIZON is not set -# CONFIG_ATM_IA is not set -# CONFIG_ATM_IDT77252 is not set -# CONFIG_ATM_LANAI is not set -# CONFIG_ATM_LANE is not set -# CONFIG_ATM_MPOA is not set -# CONFIG_ATM_NICSTAR is not set -# CONFIG_ATM_SOLOS is not set -# CONFIG_ATM_TCP is not set -# CONFIG_ATM_ZATM is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_ATP is not set -# CONFIG_AUDIT is not set -# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set -# CONFIG_AURORA_NB8800 is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_AUTO_ZRELADDR is not set -# CONFIG_AUXDISPLAY is not set -# CONFIG_AX25 is not set -# CONFIG_AX25_DAMA_SLAVE is not set -# CONFIG_AX88796 is not set -# CONFIG_AXP288_ADC is not set -# CONFIG_AXP288_FUEL_GAUGE is not set -# CONFIG_B43 is not set -# CONFIG_B43LEGACY is not set -# CONFIG_B44 is not set -# CONFIG_B53 is not set -# CONFIG_B53_SPI_DRIVER is not set -# CONFIG_BACKLIGHT_ADP8860 is not set -# CONFIG_BACKLIGHT_ADP8870 is not set -# CONFIG_BACKLIGHT_BD6107 is not set -# CONFIG_BACKLIGHT_GENERIC is not set -# CONFIG_BACKLIGHT_GPIO is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -# CONFIG_BACKLIGHT_LM3630A is not set -# CONFIG_BACKLIGHT_LM3639 is not set -# CONFIG_BACKLIGHT_LP855X is not set -# CONFIG_BACKLIGHT_LV5207LP is not set -# CONFIG_BACKLIGHT_PANDORA is not set -# CONFIG_BACKLIGHT_PM8941_WLED is not set -# CONFIG_BACKLIGHT_RPI is not set -# CONFIG_BACKLIGHT_SAHARA is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -CONFIG_BASE_FULL=y -CONFIG_BASE_SMALL=0 -# CONFIG_BATMAN_ADV is not set -# CONFIG_BATTERY_BQ27XXX is not set -# CONFIG_BATTERY_DS2760 is not set -# CONFIG_BATTERY_DS2780 is not set -# CONFIG_BATTERY_DS2781 is not set -# CONFIG_BATTERY_DS2782 is not set -# CONFIG_BATTERY_GAUGE_LTC2941 is not set -# CONFIG_BATTERY_GOLDFISH is not set -# CONFIG_BATTERY_MAX17040 is not set -# CONFIG_BATTERY_MAX17042 is not set -# CONFIG_BATTERY_SBS is not set -# CONFIG_BAYCOM_EPP is not set -# CONFIG_BAYCOM_PAR is not set -# CONFIG_BAYCOM_SER_FDX is not set -# CONFIG_BAYCOM_SER_HDX is not set -# CONFIG_BCACHE is not set -# CONFIG_BCM47XX is not set -# CONFIG_BCM63XX is not set -# CONFIG_BCM63XX_PHY is not set -# CONFIG_BCM7038_WDT is not set -# CONFIG_BCM7XXX_PHY is not set -# CONFIG_BCM87XX_PHY is not set -# CONFIG_BCMA is not set -# CONFIG_BCMA_DRIVER_GPIO is not set -CONFIG_BCMA_POSSIBLE=y -# CONFIG_BCMGENET is not set -# CONFIG_BCM_KONA_USB2_PHY is not set -# CONFIG_BDI_SWITCH is not set -# CONFIG_BE2ISCSI is not set -# CONFIG_BE2NET is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_BGMAC is not set -# CONFIG_BH1750 is not set -# CONFIG_BIG_KEYS is not set -# CONFIG_BIG_LITTLE is not set -# CONFIG_BINARY_PRINTF is not set -# CONFIG_BINFMT_AOUT is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -CONFIG_BINFMT_SCRIPT=y -CONFIG_BITREVERSE=y -# CONFIG_BLK_CMDLINE_PARSER is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_CPQ_DA is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_BLK_DEV_4DRIVES is not set -# CONFIG_BLK_DEV_AEC62XX is not set -# CONFIG_BLK_DEV_ALI14XX is not set -# CONFIG_BLK_DEV_ALI15X3 is not set -# CONFIG_BLK_DEV_AMD74XX is not set -# CONFIG_BLK_DEV_ATIIXP is not set -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_CMD640 is not set -# CONFIG_BLK_DEV_CMD64X is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_CS5520 is not set -# CONFIG_BLK_DEV_CS5530 is not set -# CONFIG_BLK_DEV_CS5535 is not set -# CONFIG_BLK_DEV_CS5536 is not set -# CONFIG_BLK_DEV_CY82C693 is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_DELKIN is not set -# CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_DTC2278 is not set -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_GENERIC is not set -# CONFIG_BLK_DEV_HD is not set -# CONFIG_BLK_DEV_HPT366 is not set -# CONFIG_BLK_DEV_HT6560B is not set -# CONFIG_BLK_DEV_IDEACPI is not set -# CONFIG_BLK_DEV_IDECD is not set -# CONFIG_BLK_DEV_IDECS is not set -# CONFIG_BLK_DEV_IDEPCI is not set -# CONFIG_BLK_DEV_IDEPNP is not set -# CONFIG_BLK_DEV_IDETAPE is not set -# CONFIG_BLK_DEV_IDE_AU1XXX is not set -# CONFIG_BLK_DEV_IDE_SATA is not set -CONFIG_BLK_DEV_INITRD=y -# CONFIG_BLK_DEV_INTEGRITY is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_BLK_DEV_IT8172 is not set -# CONFIG_BLK_DEV_IT8213 is not set -# CONFIG_BLK_DEV_IT821X is not set -# CONFIG_BLK_DEV_JMICRON is not set -# CONFIG_BLK_DEV_LOOP is not set -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_NS87415 is not set -# CONFIG_BLK_DEV_NULL_BLK is not set -# CONFIG_BLK_DEV_NVME is not set -# CONFIG_BLK_DEV_OFFBOARD is not set -# CONFIG_BLK_DEV_OPTI621 is not set -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_BLK_DEV_PDC202XX_NEW is not set -# CONFIG_BLK_DEV_PDC202XX_OLD is not set -# CONFIG_BLK_DEV_PIIX is not set -# CONFIG_BLK_DEV_PLATFORM is not set -# CONFIG_BLK_DEV_PMEM is not set -# CONFIG_BLK_DEV_QD65XX is not set -# CONFIG_BLK_DEV_RAM is not set -# CONFIG_BLK_DEV_RBD is not set -# CONFIG_BLK_DEV_RSXX is not set -# CONFIG_BLK_DEV_RZ1000 is not set -# CONFIG_BLK_DEV_SC1200 is not set -# CONFIG_BLK_DEV_SD is not set -# CONFIG_BLK_DEV_SIIMAGE is not set -# CONFIG_BLK_DEV_SIS5513 is not set -# CONFIG_BLK_DEV_SKD is not set -# CONFIG_BLK_DEV_SL82C105 is not set -# CONFIG_BLK_DEV_SLC90E66 is not set -# CONFIG_BLK_DEV_SR is not set -# CONFIG_BLK_DEV_SVWKS is not set -# CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_TC86C001 is not set -# CONFIG_BLK_DEV_THROTTLING is not set -# CONFIG_BLK_DEV_TRIFLEX is not set -# CONFIG_BLK_DEV_TRM290 is not set -# CONFIG_BLK_DEV_UMC8672 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_VIA82CXXX is not set -CONFIG_BLOCK=y -# CONFIG_BMA180 is not set -# CONFIG_BMC150_ACCEL is not set -# CONFIG_BMC150_MAGN is not set -# CONFIG_BMG160 is not set -# CONFIG_BMIPS_GENERIC is not set -# CONFIG_BMP085 is not set -# CONFIG_BMP085_I2C is not set -# CONFIG_BMP085_SPI is not set -# CONFIG_BMP280 is not set -# CONFIG_BNA is not set -# CONFIG_BNX2 is not set -# CONFIG_BNX2X is not set -# CONFIG_BNXT is not set -# CONFIG_BONDING is not set -# CONFIG_BOOKE_WDT is not set -CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 -# CONFIG_BOOT_PRINTK_DELAY is not set -CONFIG_BOOT_RAW=y -CONFIG_BPF=y -# CONFIG_BPF_JIT is not set -CONFIG_BPF_SYSCALL=y -# CONFIG_BPQETHER is not set -CONFIG_BQL=y -CONFIG_BRANCH_PROFILE_NONE=y -# CONFIG_BRCMFMAC is not set -# CONFIG_BRCMSMAC is not set -# CONFIG_BRCMSTB_GISB_ARB is not set -CONFIG_BRIDGE=y -# CONFIG_BRIDGE_EBT_802_3 is not set -# CONFIG_BRIDGE_EBT_AMONG is not set -# CONFIG_BRIDGE_EBT_ARP is not set -# CONFIG_BRIDGE_EBT_ARPREPLY is not set -# CONFIG_BRIDGE_EBT_BROUTE is not set -# CONFIG_BRIDGE_EBT_DNAT is not set -# CONFIG_BRIDGE_EBT_IP is not set -# CONFIG_BRIDGE_EBT_IP6 is not set -# CONFIG_BRIDGE_EBT_LIMIT is not set -# CONFIG_BRIDGE_EBT_LOG is not set -# CONFIG_BRIDGE_EBT_MARK is not set -# CONFIG_BRIDGE_EBT_MARK_T is not set -# CONFIG_BRIDGE_EBT_NFLOG is not set -# CONFIG_BRIDGE_EBT_PKTTYPE is not set -# CONFIG_BRIDGE_EBT_REDIRECT is not set -# CONFIG_BRIDGE_EBT_SNAT is not set -# CONFIG_BRIDGE_EBT_STP is not set -# CONFIG_BRIDGE_EBT_T_FILTER is not set -# CONFIG_BRIDGE_EBT_T_NAT is not set -# CONFIG_BRIDGE_EBT_VLAN is not set -CONFIG_BRIDGE_IGMP_SNOOPING=y -# CONFIG_BRIDGE_NETFILTER is not set -# CONFIG_BRIDGE_NF_EBTABLES is not set -# CONFIG_BRIDGE_VLAN_FILTERING is not set -# CONFIG_BROADCOM_PHY is not set -CONFIG_BROKEN_ON_SMP=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_BSD_PROCESS_ACCT_V3 is not set -# CONFIG_BT is not set -# CONFIG_BTRFS_ASSERT is not set -# CONFIG_BTRFS_DEBUG is not set -# CONFIG_BTRFS_FS is not set -# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set -# CONFIG_BT_ATH3K is not set -# CONFIG_BT_BNEP is not set -CONFIG_BT_BNEP_MC_FILTER=y -CONFIG_BT_BNEP_PROTO_FILTER=y -# CONFIG_BT_BREDR is not set -# CONFIG_BT_CMTP is not set -# CONFIG_BT_HCIBCM203X is not set -# CONFIG_BT_HCIBFUSB is not set -# CONFIG_BT_HCIBLUECARD is not set -# CONFIG_BT_HCIBPA10X is not set -# CONFIG_BT_HCIBT3C is not set -# CONFIG_BT_HCIBTSDIO is not set -# CONFIG_BT_HCIBTUART is not set -# CONFIG_BT_HCIBTUSB is not set -# CONFIG_BT_HCIBTUSB_RTL is not set -# CONFIG_BT_HCIDTL1 is not set -# CONFIG_BT_HCIUART is not set -# CONFIG_BT_HCIUART_3WIRE is not set -# CONFIG_BT_HCIUART_ATH3K is not set -CONFIG_BT_HCIUART_BCSP=y -CONFIG_BT_HCIUART_H4=y -# CONFIG_BT_HCIUART_LL is not set -# CONFIG_BT_HCIUART_QCA is not set -# CONFIG_BT_HCIVHCI is not set -# CONFIG_BT_HIDP is not set -# CONFIG_BT_HS is not set -# CONFIG_BT_LE is not set -# CONFIG_BT_MRVL is not set -# CONFIG_BT_RFCOMM is not set -CONFIG_BT_RFCOMM_TTY=y -# CONFIG_BT_SELFTEST is not set -CONFIG_BUG=y -CONFIG_BUILDTIME_EXTABLE_SORT=y -# CONFIG_BUILD_BIN2C is not set -# CONFIG_C2PORT is not set -# CONFIG_CADENCE_WATCHDOG is not set -# CONFIG_CAIF is not set -# CONFIG_CAN is not set -# CONFIG_CAN_BCM is not set -# CONFIG_CAN_DEBUG_DEVICES is not set -# CONFIG_CAN_DEV is not set -# CONFIG_CAN_GS_USB is not set -# CONFIG_CAN_GW is not set -# CONFIG_CAN_M_CAN is not set -# CONFIG_CAN_RAW is not set -# CONFIG_CAN_RCAR is not set -# CONFIG_CAN_SLCAN is not set -# CONFIG_CAN_SUN4I is not set -# CONFIG_CAN_VCAN is not set -# CONFIG_CAPI_AVM is not set -# CONFIG_CAPI_EICON is not set -# CONFIG_CAPI_TRACE is not set -CONFIG_CARDBUS=y -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set -# CONFIG_CARL9170 is not set -# CONFIG_CASSINI is not set -# CONFIG_CAVIUM_OCTEON_SOC is not set -# CONFIG_CB710_CORE is not set -# CONFIG_CC10001_ADC is not set -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -# CONFIG_CC_STACKPROTECTOR is not set -CONFIG_CC_STACKPROTECTOR_NONE=y -# CONFIG_CC_STACKPROTECTOR_REGULAR is not set -# CONFIG_CC_STACKPROTECTOR_STRONG is not set -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_CEPH_FS is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_CFG80211 is not set -# CONFIG_CFG80211_CERTIFICATION_ONUS is not set -# CONFIG_CGROUPS is not set -# CONFIG_CGROUP_DEBUG is not set -# CONFIG_CGROUP_NET_PRIO is not set -# CONFIG_CHARGER_BQ2415X is not set -# CONFIG_CHARGER_BQ24190 is not set -# CONFIG_CHARGER_BQ24257 is not set -# CONFIG_CHARGER_BQ24735 is not set -# CONFIG_CHARGER_BQ25890 is not set -# CONFIG_CHARGER_GPIO is not set -# CONFIG_CHARGER_ISP1704 is not set -# CONFIG_CHARGER_LP8727 is not set -# CONFIG_CHARGER_MANAGER is not set -# CONFIG_CHARGER_MAX8903 is not set -# CONFIG_CHARGER_RT9455 is not set -# CONFIG_CHARGER_SMB347 is not set -# CONFIG_CHARGER_TWL4030 is not set -# CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_CHELSIO_T1 is not set -# CONFIG_CHELSIO_T3 is not set -# CONFIG_CHELSIO_T4 is not set -# CONFIG_CHELSIO_T4VF is not set -# CONFIG_CHROME_PLATFORMS is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_CHR_DEV_SCH is not set -# CONFIG_CHR_DEV_SG is not set -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CICADA_PHY is not set -# CONFIG_CIFS is not set -# CONFIG_CIFS_ACL is not set -# CONFIG_CIFS_DEBUG is not set -# CONFIG_CIFS_DEBUG2 is not set -# CONFIG_CIFS_FSCACHE is not set -# CONFIG_CIFS_NFSD_EXPORT is not set -CONFIG_CIFS_POSIX=y -# CONFIG_CIFS_SMB2 is not set -CONFIG_CIFS_STATS=y -# CONFIG_CIFS_STATS2 is not set -# CONFIG_CIFS_WEAK_PW_HASH is not set -# CONFIG_CIFS_XATTR is not set -# CONFIG_CLEANCACHE is not set -# CONFIG_CLKSRC_VERSATILE is not set -# CONFIG_CLK_QORIQ is not set -# CONFIG_CLOCK_THERMAL is not set -CONFIG_CLS_U32_MARK=y -# CONFIG_CLS_U32_PERF is not set -# CONFIG_CM32181 is not set -# CONFIG_CM3232 is not set -# CONFIG_CM3323 is not set -# CONFIG_CM36651 is not set -# CONFIG_CMA is not set -CONFIG_CMDLINE="" -# CONFIG_CMDLINE_BOOL is not set -# CONFIG_CMDLINE_EXTEND is not set -# CONFIG_CMDLINE_FORCE is not set -# CONFIG_CMDLINE_FROM_BOOTLOADER is not set -# CONFIG_CMDLINE_PARTITION is not set -# CONFIG_CNIC is not set -# CONFIG_CODA_FS is not set -# CONFIG_CODE_PATCHING_SELFTEST is not set -# CONFIG_COMEDI is not set -# CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_CDCE925 is not set -# CONFIG_COMMON_CLK_IPROC is not set -# CONFIG_COMMON_CLK_PWM is not set -# CONFIG_COMMON_CLK_PXA is not set -# CONFIG_COMMON_CLK_QCOM is not set -# CONFIG_COMMON_CLK_SI514 is not set -# CONFIG_COMMON_CLK_SI5351 is not set -# CONFIG_COMMON_CLK_SI570 is not set -# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -# CONFIG_COMPACTION is not set -# CONFIG_COMPAL_LAPTOP is not set -# CONFIG_COMPAT_BRK is not set -# CONFIG_COMPILE_TEST is not set -# CONFIG_CONFIGFS_FS is not set -# CONFIG_CONNECTOR is not set -CONFIG_CONSTRUCTORS=y -# CONFIG_CONTEXT_SWITCH_TRACER is not set -# CONFIG_COPS is not set -# CONFIG_CORDIC is not set -# CONFIG_COREDUMP is not set -# CONFIG_CORESIGHT is not set -# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set -# CONFIG_CPA_DEBUG is not set -# CONFIG_CPU_DCACHE_DISABLE is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -# CONFIG_CPU_FREQ_STAT_DETAILS is not set -# CONFIG_CPU_IDLE is not set -# CONFIG_CPU_IDLE_GOV_MENU is not set -# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set -CONFIG_CPU_SW_DOMAIN_PAN=y -# CONFIG_CRAMFS is not set -# CONFIG_CRASHLOG is not set -# CONFIG_CRASH_DUMP is not set -# CONFIG_CRC16 is not set -CONFIG_CRC32=y -# CONFIG_CRC32_BIT is not set -CONFIG_CRC32_SARWATE=y -# CONFIG_CRC32_SELFTEST is not set -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SLICEBY8 is not set -# CONFIG_CRC7 is not set -# CONFIG_CRC8 is not set -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC_ITU_T is not set -# CONFIG_CRC_T10DIF is not set -CONFIG_CROSS_COMPILE="" -# CONFIG_CROSS_MEMORY_ATTACH is not set -CONFIG_CRYPTO=y -# CONFIG_CRYPTO_842 is not set -# CONFIG_CRYPTO_AEAD is not set -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_AES_586 is not set -# CONFIG_CRYPTO_AES_ARM is not set -# CONFIG_CRYPTO_AES_ARM_BS is not set -# CONFIG_CRYPTO_AES_NI_INTEL is not set -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -# CONFIG_CRYPTO_ANSI_CPRNG is not set -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_ARC4=y -# CONFIG_CRYPTO_AUTHENC is not set -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -# CONFIG_CRYPTO_CBC is not set -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_CHACHA20 is not set -# CONFIG_CRYPTO_CHACHA20POLY1305 is not set -# CONFIG_CRYPTO_CMAC is not set -# CONFIG_CRYPTO_CRC32 is not set -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_CRC32C_INTEL is not set -# CONFIG_CRYPTO_CRCT10DIF is not set -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_DES is not set -# CONFIG_CRYPTO_DEV_ATMEL_AES is not set -# CONFIG_CRYPTO_DEV_ATMEL_SHA is not set -# CONFIG_CRYPTO_DEV_ATMEL_TDES is not set -# CONFIG_CRYPTO_DEV_CCP is not set -# CONFIG_CRYPTO_DEV_FSL_CAAM is not set -# CONFIG_CRYPTO_DEV_HIFN_795X is not set -# CONFIG_CRYPTO_DEV_IMGTEC_HASH is not set -# CONFIG_CRYPTO_DEV_MARVELL_CESA is not set -# CONFIG_CRYPTO_DEV_MV_CESA is not set -# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set -# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set -# CONFIG_CRYPTO_DEV_QCE is not set -# CONFIG_CRYPTO_DEV_SAHARA is not set -# CONFIG_CRYPTO_DEV_TALITOS is not set -# CONFIG_CRYPTO_DRBG_CTR is not set -# CONFIG_CRYPTO_DRBG_HASH is not set -# CONFIG_CRYPTO_DRBG_MENU is not set -# CONFIG_CRYPTO_ECB is not set -# CONFIG_CRYPTO_ECHAINIV is not set -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_FIPS is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_GHASH is not set -# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set -# CONFIG_CRYPTO_HASH is not set -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_HW is not set -# CONFIG_CRYPTO_JITTERENTROPY is not set -# CONFIG_CRYPTO_KEYWRAP is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set -# CONFIG_CRYPTO_LZO is not set -# CONFIG_CRYPTO_MANAGER is not set -# CONFIG_CRYPTO_MANAGER2 is not set -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -# CONFIG_CRYPTO_MCRYPTD is not set -# CONFIG_CRYPTO_MD4 is not set -# CONFIG_CRYPTO_MD5 is not set -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_PCOMP is not set -# CONFIG_CRYPTO_PCOMP2 is not set -# CONFIG_CRYPTO_PCRYPT is not set -# CONFIG_CRYPTO_POLY1305 is not set -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set -# CONFIG_CRYPTO_RNG is not set -# CONFIG_CRYPTO_RSA is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SALSA20_586 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SEQIV is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA1_ARM is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TEST is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_TWOFISH is not set -# CONFIG_CRYPTO_TWOFISH_586 is not set -# CONFIG_CRYPTO_TWOFISH_COMMON is not set -# CONFIG_CRYPTO_USER is not set -# CONFIG_CRYPTO_USER_API_AEAD is not set -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_RNG is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -# CONFIG_CRYPTO_VMAC is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_XCBC is not set -# CONFIG_CRYPTO_XTS is not set -# CONFIG_CRYPTO_XZ is not set -# CONFIG_CRYPTO_ZLIB is not set -# CONFIG_CS5535_MFGPT is not set -# CONFIG_CS89x0 is not set -# CONFIG_CUSE is not set -# CONFIG_CW1200 is not set -# CONFIG_CXL_BASE is not set -# CONFIG_CXL_EEH is not set -# CONFIG_CXL_KERNEL_API is not set -# CONFIG_CYPRESS_FIRMWARE is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_DCB is not set -# CONFIG_DDR is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_DEBUG_CREDENTIALS is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -CONFIG_DEBUG_FS=y -# CONFIG_DEBUG_GPIO is not set -# CONFIG_DEBUG_HIGHMEM is not set -# CONFIG_DEBUG_ICEDCC is not set -# CONFIG_DEBUG_INFO is not set -# CONFIG_DEBUG_INFO_DWARF4 is not set -CONFIG_DEBUG_INFO_REDUCED=y -# CONFIG_DEBUG_INFO_SPLIT is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_KOBJECT_RELEASE is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_LL is not set -# CONFIG_DEBUG_LL_UART_8250 is not set -# CONFIG_DEBUG_LL_UART_PL01X is not set -# CONFIG_DEBUG_LOCKDEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_NX_TEST is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -# CONFIG_DEBUG_PER_CPU_MAPS is not set -# CONFIG_DEBUG_PINCTRL is not set -# CONFIG_DEBUG_PI_LIST is not set -# CONFIG_DEBUG_PREEMPT is not set -# CONFIG_DEBUG_RODATA is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -# CONFIG_DEBUG_SEMIHOSTING is not set -# CONFIG_DEBUG_SET_MODULE_RONX is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_SHIRQ is not set -# CONFIG_DEBUG_SLAB is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_STACKOVERFLOW is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set -# CONFIG_DEBUG_TIMEKEEPING is not set -# CONFIG_DEBUG_UART_BCM63XX is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_ZBOOT is not set -# CONFIG_DECNET is not set -CONFIG_DEFAULT_CUBIC=y -CONFIG_DEFAULT_DEADLINE=y -CONFIG_DEFAULT_HOSTNAME="(none)" -CONFIG_DEFAULT_IOSCHED="deadline" -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -# CONFIG_DEFAULT_NOOP is not set -# CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_SECURITY="" -CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -# CONFIG_DELL_SMO8800 is not set -# CONFIG_DEPRECATED_PARAM_STRUCT is not set -# CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_DEVKMEM is not set -# CONFIG_DEVMEM is not set -CONFIG_DEVPORT=y -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set -# CONFIG_DEVTMPFS is not set -# CONFIG_DEVTMPFS_MOUNT is not set -# CONFIG_DGAP is not set -# CONFIG_DGNC is not set -# CONFIG_DHT11 is not set -# CONFIG_DIRECT_IO is not set -# CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_DISPLAY_CONNECTOR_ANALOG_TV is not set -# CONFIG_DISPLAY_CONNECTOR_DVI is not set -# CONFIG_DISPLAY_CONNECTOR_HDMI is not set -# CONFIG_DISPLAY_ENCODER_TFP410 is not set -# CONFIG_DISPLAY_ENCODER_TPD12S015 is not set -# CONFIG_DISPLAY_PANEL_DPI is not set -# CONFIG_DISPLAY_PANEL_LGPHILIPS_LB035Q02 is not set -# CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1 is not set -# CONFIG_DISPLAY_PANEL_TPO_TD043MTEA1 is not set -# CONFIG_DL2K is not set -# CONFIG_DLM is not set -# CONFIG_DM9000 is not set -# CONFIG_DMADEVICES is not set -# CONFIG_DMADEVICES_DEBUG is not set -# CONFIG_DMASCC is not set -# CONFIG_DMATEST is not set -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_DMA_ENGINE is not set -# CONFIG_DMA_SHARED_BUFFER is not set -# CONFIG_DM_CACHE is not set -# CONFIG_DM_DEBUG is not set -# CONFIG_DM_DELAY is not set -# CONFIG_DM_ERA is not set -# CONFIG_DM_FLAKEY is not set -# CONFIG_DM_LOG_USERSPACE is not set -# CONFIG_DM_MULTIPATH is not set -# CONFIG_DM_RAID is not set -# CONFIG_DM_SWITCH is not set -# CONFIG_DM_THIN_PROVISIONING is not set -# CONFIG_DM_UEVENT is not set -# CONFIG_DM_VERITY is not set -# CONFIG_DM_ZERO is not set -# CONFIG_DNET is not set -# CONFIG_DNOTIFY is not set -# CONFIG_DNS_RESOLVER is not set -CONFIG_DOUBLEFAULT=y -# CONFIG_DP83848_PHY is not set -# CONFIG_DP83867_PHY is not set -CONFIG_DQL=y -# CONFIG_DRAGONRISE_FF is not set -# CONFIG_DRM is not set -# CONFIG_DS1682 is not set -# CONFIG_DTLK is not set -# CONFIG_DUMMY is not set -CONFIG_DUMMY_CONSOLE_COLUMNS=80 -CONFIG_DUMMY_CONSOLE_ROWS=25 -# CONFIG_DUMMY_IRQ is not set -# CONFIG_DVB_AU8522_V4L is not set -# CONFIG_DVB_CORE is not set -# CONFIG_DVB_DUMMY_FE is not set -# CONFIG_DVB_TUNER_DIB0070 is not set -# CONFIG_DVB_TUNER_DIB0090 is not set -# CONFIG_DWMAC_IPQ806X is not set -# CONFIG_DWMAC_LPC18XX is not set -# CONFIG_DWMAC_MESON is not set -# CONFIG_DWMAC_ROCKCHIP is not set -# CONFIG_DWMAC_SOCFPGA is not set -# CONFIG_DWMAC_STI is not set -# CONFIG_DW_DMAC is not set -# CONFIG_DW_WATCHDOG is not set -# CONFIG_DYNAMIC_DEBUG is not set -# CONFIG_E100 is not set -# CONFIG_E1000 is not set -# CONFIG_E1000E is not set -# CONFIG_EARLY_PRINTK_8250 is not set -# CONFIG_ECHO is not set -# CONFIG_ECRYPT_FS is not set -# CONFIG_EDAC is not set -# CONFIG_EEEPC_LAPTOP is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_EEPROM_93XX46 is not set -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_AT25 is not set -# CONFIG_EEPROM_DIGSY_MTC_CFG is not set -# CONFIG_EEPROM_LEGACY is not set -# CONFIG_EEPROM_MAX6875 is not set -CONFIG_EFI_PARTITION=y -# CONFIG_EFS_FS is not set -# CONFIG_ELF_CORE is not set -# CONFIG_EMAC_ROCKCHIP is not set -CONFIG_EMBEDDED=y -# CONFIG_EM_TIMER_STI is not set -# CONFIG_ENABLE_MUST_CHECK is not set -CONFIG_ENABLE_WARN_DEPRECATED=y -# CONFIG_ENC28J60 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_ENCRYPTED_KEYS is not set -# CONFIG_ENCX24J600 is not set -# CONFIG_ENIC is not set -# CONFIG_EPAPR_PARAVIRT is not set -# CONFIG_EPIC100 is not set -CONFIG_EPOLL=y -# CONFIG_EQUALIZER is not set -# CONFIG_ET131X is not set -CONFIG_ETHERNET=y -# CONFIG_ETHOC is not set -CONFIG_EVENTFD=y -CONFIG_EXPERT=y -# CONFIG_EXPORTFS is not set -# CONFIG_EXT2_FS is not set -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT3_FS is not set -# CONFIG_EXT4_DEBUG is not set -# CONFIG_EXT4_ENCRYPTION is not set -# CONFIG_EXT4_FS is not set -# CONFIG_EXT4_FS_POSIX_ACL is not set -# CONFIG_EXT4_FS_SECURITY is not set -CONFIG_EXT4_USE_FOR_EXT2=y -# CONFIG_EXTCON is not set -# CONFIG_EXTCON_ADC_JACK is not set -# CONFIG_EXTCON_GPIO is not set -# CONFIG_EXTCON_RT8973A is not set -# CONFIG_EXTCON_SM5502 is not set -# CONFIG_EXTCON_USB_GPIO is not set -CONFIG_EXTRA_FIRMWARE="" -CONFIG_EXTRA_TARGETS="" -# CONFIG_EXYNOS_ADC is not set -# CONFIG_EXYNOS_VIDEO is not set -# CONFIG_EZCHIP_NPS_MANAGEMENT_ENET is not set -# CONFIG_EZX_PCAP is not set -# CONFIG_F2FS_FS is not set -# CONFIG_F2FS_FS_ENCRYPTION is not set -# CONFIG_F2FS_IO_TRACE is not set -# CONFIG_FAIR_GROUP_SCHED is not set -# CONFIG_FANOTIFY is not set -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_FAT_FS is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_FB is not set -# CONFIG_FB_3DFX is not set -# CONFIG_FB_ARC is not set -# CONFIG_FB_ARK is not set -# CONFIG_FB_ARMCLCD is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_ATY is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_AUO_K190X is not set -# CONFIG_FB_BACKLIGHT is not set -# CONFIG_FB_BIG_ENDIAN is not set -# CONFIG_FB_BOOT_VESA_SUPPORT is not set -# CONFIG_FB_BOTH_ENDIAN is not set -# CONFIG_FB_BROADSHEET is not set -# CONFIG_FB_CARMINE is not set -# CONFIG_FB_CFB_COPYAREA is not set -# CONFIG_FB_CFB_FILLRECT is not set -# CONFIG_FB_CFB_IMAGEBLIT is not set -# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set -# CONFIG_FB_CIRRUS is not set -# CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_DA8XX is not set -# CONFIG_FB_DDC is not set -# CONFIG_FB_FOREIGN_ENDIAN is not set -# CONFIG_FB_GEODE is not set -# CONFIG_FB_GOLDFISH is not set -# CONFIG_FB_HGA is not set -# CONFIG_FB_I740 is not set -# CONFIG_FB_IBM_GXT4500 is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_IMX is not set -# CONFIG_FB_KYRO is not set -# CONFIG_FB_LE80578 is not set -# CONFIG_FB_LITTLE_ENDIAN is not set -# CONFIG_FB_MACMODES is not set -# CONFIG_FB_MATROX is not set -# CONFIG_FB_MB862XX is not set -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_MXS is not set -# CONFIG_FB_N411 is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_NVIDIA is not set -# CONFIG_FB_OF is not set -# CONFIG_FB_OPENCORES is not set -# CONFIG_FB_PM2 is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_PS3 is not set -# CONFIG_FB_PXA is not set -# CONFIG_FB_RADEON is not set -# CONFIG_FB_RIVA is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_S3 is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIMPLE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_SM712 is not set -# CONFIG_FB_SM750 is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_SSD1307 is not set -# CONFIG_FB_SVGALIB is not set -# CONFIG_FB_SYS_COPYAREA is not set -# CONFIG_FB_SYS_FILLRECT is not set -# CONFIG_FB_SYS_FOPS is not set -# CONFIG_FB_SYS_IMAGEBLIT is not set -# CONFIG_FB_TFT is not set -# CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_TMIO is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_UVESA is not set -# CONFIG_FB_VGA16 is not set -# CONFIG_FB_VIA is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_VT8623 is not set -# CONFIG_FB_XGI is not set -# CONFIG_FCOE is not set -# CONFIG_FCOE_FNIC is not set -# CONFIG_FDDI is not set -# CONFIG_FEALNX is not set -# CONFIG_FENCE_TRACE is not set -# CONFIG_FHANDLE is not set -CONFIG_FIB_RULES=y -CONFIG_FILE_LOCKING=y -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# CONFIG_FIREWIRE_SERIAL is not set -# CONFIG_FIRMWARE_EDID is not set -# CONFIG_FIRMWARE_IN_KERNEL is not set -# CONFIG_FIRMWARE_MEMMAP is not set -# CONFIG_FIXED_PHY is not set -CONFIG_FLATMEM=y -CONFIG_FLATMEM_MANUAL=y -CONFIG_FLAT_NODE_MEM_MAP=y -# CONFIG_FM10K is not set -# CONFIG_FMC is not set -# CONFIG_FORCEDETH is not set -CONFIG_FORCE_MAX_ZONEORDER=11 -# CONFIG_FPGA is not set -# CONFIG_FRAMEBUFFER_CONSOLE is not set -# CONFIG_FRAME_POINTER is not set -CONFIG_FRAME_WARN=1024 -# CONFIG_FREEZER is not set -# CONFIG_FRONTSWAP is not set -# CONFIG_FSCACHE is not set -# CONFIG_FSL_EDMA is not set -# CONFIG_FSL_PQ_MDIO is not set -# CONFIG_FSL_XGMAC_MDIO is not set -CONFIG_FSNOTIFY=y -# CONFIG_FS_DAX is not set -# CONFIG_FS_POSIX_ACL is not set -# CONFIG_FTGMAC100 is not set -# CONFIG_FTL is not set -# CONFIG_FTMAC100 is not set -# CONFIG_FTRACE is not set -# CONFIG_FTRACE_STARTUP_TEST is not set -# CONFIG_FTR_FIXUP_SELFTEST is not set -# CONFIG_FUJITSU_ES is not set -# CONFIG_FUJITSU_LAPTOP is not set -# CONFIG_FUJITSU_TABLET is not set -# CONFIG_FUNCTION_TRACER is not set -# CONFIG_FUSE_FS is not set -# CONFIG_FUSION is not set -# CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set -# CONFIG_FUSION_SPI is not set -CONFIG_FUTEX=y -CONFIG_FW_LOADER=y -CONFIG_FW_LOADER_USER_HELPER=y -CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y -CONFIG_GACT_PROB=y -# CONFIG_GADGET_UAC1 is not set -# CONFIG_GAMEPORT is not set -# CONFIG_GATEWORKS_GW16083 is not set -# CONFIG_GCOV is not set -# CONFIG_GCOV_KERNEL is not set -# CONFIG_GDB_SCRIPTS is not set -# CONFIG_GENERIC_ADC_BATTERY is not set -CONFIG_GENERIC_CALIBRATE_DELAY=y -# CONFIG_GENERIC_CPU_DEVICES is not set -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_NET_UTILS=y -# CONFIG_GENERIC_PHY is not set -# CONFIG_GENEVE is not set -# CONFIG_GENWQE is not set -# CONFIG_GFS2_FS is not set -# CONFIG_GIGASET_CAPI is not set -# CONFIG_GIGASET_DEBUG is not set -# CONFIG_GLOB_SELFTEST is not set -# CONFIG_GP2AP020A00F is not set -# CONFIG_GPIOLIB is not set -# CONFIG_GPIO_74X164 is not set -# CONFIG_GPIO_74XX_MMIO is not set -# CONFIG_GPIO_ADNP is not set -# CONFIG_GPIO_ADP5588 is not set -# CONFIG_GPIO_ALTERA is not set -# CONFIG_GPIO_AMD8111 is not set -# CONFIG_GPIO_BCM_KONA is not set -# CONFIG_GPIO_BT8XX is not set -# CONFIG_GPIO_CS5535 is not set -# CONFIG_GPIO_DWAPB is not set -# CONFIG_GPIO_EM is not set -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_GRGPIO is not set -# CONFIG_GPIO_ICH is not set -# CONFIG_GPIO_MAX7300 is not set -# CONFIG_GPIO_MAX7301 is not set -# CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_MC33880 is not set -# CONFIG_GPIO_MCP23S08 is not set -# CONFIG_GPIO_ML_IOH is not set -# CONFIG_GPIO_PCA953X is not set -# CONFIG_GPIO_PCF857X is not set -# CONFIG_GPIO_PCH is not set -# CONFIG_GPIO_PL061 is not set -# CONFIG_GPIO_RCAR is not set -# CONFIG_GPIO_RDC321X is not set -# CONFIG_GPIO_SCH is not set -# CONFIG_GPIO_SCH311X is not set -# CONFIG_GPIO_SX150X is not set -# CONFIG_GPIO_SYSCON is not set -# CONFIG_GPIO_SYSFS is not set -# CONFIG_GPIO_TS5500 is not set -# CONFIG_GPIO_VX855 is not set -# CONFIG_GPIO_WATCHDOG is not set -# CONFIG_GPIO_WDT is not set -# CONFIG_GPIO_XILINX is not set -# CONFIG_GPIO_ZEVIO is not set -# CONFIG_GPIO_ZX is not set -# CONFIG_GREENASIA_FF is not set -# CONFIG_GS_FPGABOOT is not set -# CONFIG_HAMACHI is not set -# CONFIG_HAMRADIO is not set -# CONFIG_HAPPYMEAL is not set -# CONFIG_HARDLOCKUP_DETECTOR is not set -# CONFIG_HAVE_AOUT is not set -# CONFIG_HAVE_ARM_ARCH_TIMER is not set -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -# CONFIG_HCALL_STATS is not set -# CONFIG_HDC100X is not set -# CONFIG_HDLC is not set -# CONFIG_HDLC_CISCO is not set -# CONFIG_HDLC_FR is not set -# CONFIG_HDLC_PPP is not set -# CONFIG_HDLC_RAW is not set -# CONFIG_HDLC_RAW_ETH is not set -# CONFIG_HDQ_MASTER_OMAP is not set -# CONFIG_HEADERS_CHECK is not set -# CONFIG_HERMES is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_HFSPLUS_FS_POSIX_ACL is not set -# CONFIG_HFS_FS is not set -# CONFIG_HI8435 is not set -# CONFIG_HIBERNATION is not set -# CONFIG_HID is not set -# CONFIG_HIDRAW is not set -# CONFIG_HID_A4TECH is not set -# CONFIG_HID_ACRUX is not set -# CONFIG_HID_ACRUX_FF is not set -# CONFIG_HID_APPLE is not set -# CONFIG_HID_APPLEIR is not set -# CONFIG_HID_AUREAL is not set -# CONFIG_HID_BATTERY_STRENGTH is not set -# CONFIG_HID_BELKIN is not set -# CONFIG_HID_BETOP_FF is not set -# CONFIG_HID_CHERRY is not set -# CONFIG_HID_CHICONY is not set -# CONFIG_HID_CORSAIR is not set -# CONFIG_HID_CP2112 is not set -# CONFIG_HID_CYPRESS is not set -# CONFIG_HID_DRAGONRISE is not set -# CONFIG_HID_ELECOM is not set -# CONFIG_HID_ELO is not set -# CONFIG_HID_EMS_FF is not set -# CONFIG_HID_EZKEY is not set -# CONFIG_HID_GEMBIRD is not set -# CONFIG_HID_GENERIC is not set -# CONFIG_HID_GFRM is not set -# CONFIG_HID_GREENASIA is not set -# CONFIG_HID_GT683R is not set -# CONFIG_HID_GYRATION is not set -# CONFIG_HID_HOLTEK is not set -# CONFIG_HID_ICADE is not set -# CONFIG_HID_KENSINGTON is not set -# CONFIG_HID_KEYTOUCH is not set -# CONFIG_HID_KYE is not set -# CONFIG_HID_LCPOWER is not set -# CONFIG_HID_LENOVO is not set -# CONFIG_HID_LOGITECH is not set -# CONFIG_HID_LOGITECH_DJ is not set -# CONFIG_HID_LOGITECH_HIDPP is not set -# CONFIG_HID_MAGICMOUSE is not set -# CONFIG_HID_MICROSOFT is not set -# CONFIG_HID_MONTEREY is not set -# CONFIG_HID_MULTITOUCH is not set -# CONFIG_HID_NTRIG is not set -# CONFIG_HID_ORTEK is not set -# CONFIG_HID_PANTHERLORD is not set -# CONFIG_HID_PENMOUNT is not set -# CONFIG_HID_PETALYNX is not set -# CONFIG_HID_PICOLCD is not set -# CONFIG_HID_PID is not set -# CONFIG_HID_PLANTRONICS is not set -# CONFIG_HID_PRIMAX is not set -# CONFIG_HID_PRODIKEYS is not set -# CONFIG_HID_RMI is not set -# CONFIG_HID_ROCCAT is not set -# CONFIG_HID_SAITEK is not set -# CONFIG_HID_SAMSUNG is not set -# CONFIG_HID_SENSOR_HUB is not set -# CONFIG_HID_SMARTJOYPLUS is not set -# CONFIG_HID_SONY is not set -# CONFIG_HID_SPEEDLINK is not set -# CONFIG_HID_STEELSERIES is not set -# CONFIG_HID_SUNPLUS is not set -# CONFIG_HID_THINGM is not set -# CONFIG_HID_THRUSTMASTER is not set -# CONFIG_HID_TIVO is not set -# CONFIG_HID_TOPSEED is not set -# CONFIG_HID_TWINHAN is not set -# CONFIG_HID_UCLOGIC is not set -# CONFIG_HID_WACOM is not set -# CONFIG_HID_WALTOP is not set -# CONFIG_HID_WIIMOTE is not set -# CONFIG_HID_XINMO is not set -# CONFIG_HID_ZEROPLUS is not set -# CONFIG_HID_ZYDACRON is not set -# CONFIG_HIGHMEM is not set -CONFIG_HIGH_RES_TIMERS=y -# CONFIG_HIP04_ETH is not set -# CONFIG_HIPPI is not set -# CONFIG_HIX5HD2_GMAC is not set -# CONFIG_HMC6352 is not set -# CONFIG_HNS is not set -# CONFIG_HNS_DSAF is not set -# CONFIG_HNS_ENET is not set -# CONFIG_HOSTAP is not set -# CONFIG_HOSTAP_CS is not set -# CONFIG_HOSTAP_PCI is not set -# CONFIG_HOSTAP_PLX is not set -# CONFIG_HOTPLUG_CPU is not set -# CONFIG_HOTPLUG_PCI is not set -# CONFIG_HP100 is not set -CONFIG_HPET_MMAP_DEFAULT=y -# CONFIG_HPFS_FS is not set -# CONFIG_HP_ILO is not set -# CONFIG_HP_WIRELESS is not set -# CONFIG_HSI is not set -# CONFIG_HSR is not set -# CONFIG_HTC_EGPIO is not set -# CONFIG_HTC_I2CPLD is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_HTU21 is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_HVC_DCC is not set -# CONFIG_HVC_UDBG is not set -# CONFIG_HWMON is not set -# CONFIG_HWMON_DEBUG_CHIP is not set -# CONFIG_HWMON_VID is not set -# CONFIG_HWSPINLOCK_OMAP is not set -CONFIG_HW_PERF_EVENTS=y -# CONFIG_HW_RANDOM is not set -# CONFIG_HW_RANDOM_AMD is not set -# CONFIG_HW_RANDOM_ATMEL is not set -# CONFIG_HW_RANDOM_EXYNOS is not set -# CONFIG_HW_RANDOM_GEODE is not set -# CONFIG_HW_RANDOM_INTEL is not set -# CONFIG_HW_RANDOM_IPROC_RNG200 is not set -# CONFIG_HW_RANDOM_OMAP3_ROM is not set -# CONFIG_HW_RANDOM_PPC4XX is not set -# CONFIG_HW_RANDOM_TIMERIOMEM is not set -# CONFIG_HW_RANDOM_VIA is not set -# CONFIG_HYPERV is not set -# CONFIG_HYSDN is not set -CONFIG_HZ=100 -CONFIG_HZ_100=y -# CONFIG_HZ_1000 is not set -# CONFIG_HZ_1024 is not set -# CONFIG_HZ_128 is not set -# CONFIG_HZ_200 is not set -# CONFIG_HZ_24 is not set -# CONFIG_HZ_250 is not set -# CONFIG_HZ_256 is not set -# CONFIG_HZ_300 is not set -# CONFIG_HZ_48 is not set -# CONFIG_HZ_500 is not set -# CONFIG_HZ_PERIODIC is not set -# CONFIG_I2C is not set -# CONFIG_I2C_ALGOBIT is not set -# CONFIG_I2C_ALGOPCA is not set -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set -# CONFIG_I2C_AU1550 is not set -# CONFIG_I2C_BCM2835 is not set -# CONFIG_I2C_BCM_IPROC is not set -# CONFIG_I2C_CBUS_GPIO is not set -# CONFIG_I2C_CHARDEV is not set -# CONFIG_I2C_COMPAT is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DESIGNWARE_PCI is not set -# CONFIG_I2C_DESIGNWARE_PLATFORM is not set -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_EG20T is not set -# CONFIG_I2C_ELEKTOR is not set -# CONFIG_I2C_EMEV2 is not set -# CONFIG_I2C_GPIO is not set -# CONFIG_I2C_HELPER_AUTO is not set -# CONFIG_I2C_HID is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_IBM_IIC is not set -# CONFIG_I2C_IMG is not set -# CONFIG_I2C_ISCH is not set -# CONFIG_I2C_ISMT is not set -# CONFIG_I2C_MPC is not set -# CONFIG_I2C_MUX is not set -# CONFIG_I2C_MUX_GPIO is not set -# CONFIG_I2C_MUX_PINCTRL is not set -# CONFIG_I2C_MUX_PCA9541 is not set -# CONFIG_I2C_MUX_PCA954x is not set -# CONFIG_I2C_MUX_REG is not set -# CONFIG_I2C_MV64XXX is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_NOMADIK is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_OCTEON is not set -# CONFIG_I2C_PARPORT is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_PCA_ISA is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_PXA_PCI is not set -# CONFIG_I2C_RCAR is not set -# CONFIG_I2C_RK3X is not set -# CONFIG_I2C_ROBOTFUZZ_OSIF is not set -# CONFIG_I2C_SCMI is not set -# CONFIG_I2C_SH_MOBILE is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_SLAVE is not set -# CONFIG_I2C_SMBUS is not set -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set -# CONFIG_I2C_VERSATILE is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_XILINX is not set -# CONFIG_I40E is not set -# CONFIG_I40EVF is not set -# CONFIG_I6300ESB_WDT is not set -# CONFIG_I82092 is not set -# CONFIG_I82365 is not set -# CONFIG_IBM_ASM is not set -# CONFIG_IBM_EMAC_DEBUG is not set -# CONFIG_IBM_EMAC_EMAC4 is not set -# CONFIG_IBM_EMAC_MAL_CLR_ICINTSTAT is not set -# CONFIG_IBM_EMAC_MAL_COMMON_ERR is not set -# CONFIG_IBM_EMAC_NO_FLOW_CTRL is not set -# CONFIG_IBM_EMAC_RGMII is not set -# CONFIG_IBM_EMAC_TAH is not set -# CONFIG_IBM_EMAC_ZMII is not set -# CONFIG_ICPLUS_PHY is not set -# CONFIG_ICS932S401 is not set -# CONFIG_IDE is not set -# CONFIG_IDEAPAD_LAPTOP is not set -# CONFIG_IDE_GD is not set -# CONFIG_IDE_PROC_FS is not set -# CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDLE_PAGE_TRACKING is not set -# CONFIG_IEEE802154 is not set -# CONFIG_IEEE802154_ATUSB is not set -# CONFIG_IFB is not set -# CONFIG_IGB is not set -# CONFIG_IGBVF is not set -# CONFIG_IIO is not set -# CONFIG_IIO_BUFFER_CB is not set -CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 -# CONFIG_IIO_INTERRUPT_TRIGGER is not set -# CONFIG_IIO_PERIODIC_RTC_TRIGGER is not set -# CONFIG_IIO_SIMPLE_DUMMY is not set -# CONFIG_IIO_SSP_SENSORHUB is not set -# CONFIG_IIO_ST_ACCEL_3AXIS is not set -# CONFIG_IIO_ST_GYRO_3AXIS is not set -# CONFIG_IIO_ST_MAGN_3AXIS is not set -# CONFIG_IIO_ST_PRESS is not set -# CONFIG_IIO_SYSFS_TRIGGER is not set -# CONFIG_IKCONFIG is not set -# CONFIG_IKCONFIG_PROC is not set -# CONFIG_IMAGE_CMDLINE_HACK is not set -# CONFIG_IMGPDC_WDT is not set -# CONFIG_IMX_IPUV3_CORE is not set -# CONFIG_IMX_THERMAL is not set -CONFIG_INET=y -# CONFIG_INET6_AH is not set -# CONFIG_INET6_ESP is not set -# CONFIG_INET6_IPCOMP is not set -# CONFIG_INET6_TUNNEL is not set -# CONFIG_INET6_XFRM_MODE_BEET is not set -# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set -# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET6_XFRM_MODE_TUNNEL is not set -# CONFIG_INET6_XFRM_TUNNEL is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_DIAG is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_LRO is not set -# CONFIG_INET_TCP_DIAG is not set -# CONFIG_INET_TUNNEL is not set -# CONFIG_INET_UDP_DIAG is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INFINIBAND is not set -# CONFIG_INFTL is not set -CONFIG_INIT_ENV_ARG_LIMIT=32 -# CONFIG_INLINE_READ_LOCK is not set -# CONFIG_INLINE_READ_LOCK_BH is not set -# CONFIG_INLINE_READ_LOCK_IRQ is not set -# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set -# CONFIG_INLINE_READ_TRYLOCK is not set -CONFIG_INLINE_READ_UNLOCK=y -# CONFIG_INLINE_READ_UNLOCK_BH is not set -CONFIG_INLINE_READ_UNLOCK_IRQ=y -# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_SPIN_LOCK is not set -# CONFIG_INLINE_SPIN_LOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK_IRQ is not set -# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set -# CONFIG_INLINE_SPIN_TRYLOCK is not set -# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set -# CONFIG_INLINE_SPIN_UNLOCK_BH is not set -CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_WRITE_LOCK is not set -# CONFIG_INLINE_WRITE_LOCK_BH is not set -# CONFIG_INLINE_WRITE_LOCK_IRQ is not set -# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set -# CONFIG_INLINE_WRITE_TRYLOCK is not set -CONFIG_INLINE_WRITE_UNLOCK=y -# CONFIG_INLINE_WRITE_UNLOCK_BH is not set -CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set -CONFIG_INOTIFY_USER=y -# CONFIG_INPUT is not set -# CONFIG_INPUT_AD714X is not set -# CONFIG_INPUT_ADXL34X is not set -# CONFIG_INPUT_APANEL is not set -# CONFIG_INPUT_ATI_REMOTE2 is not set -# CONFIG_INPUT_ATLAS_BTNS is not set -# CONFIG_INPUT_BMA150 is not set -# CONFIG_INPUT_CM109 is not set -# CONFIG_INPUT_CMA3000 is not set -# CONFIG_INPUT_DRV260X_HAPTICS is not set -# CONFIG_INPUT_DRV2665_HAPTICS is not set -# CONFIG_INPUT_DRV2667_HAPTICS is not set -# CONFIG_INPUT_E3X0_BUTTON is not set -# CONFIG_INPUT_EVBUG is not set -# CONFIG_INPUT_EVDEV is not set -# CONFIG_INPUT_FF_MEMLESS is not set -# CONFIG_INPUT_GP2A is not set -# CONFIG_INPUT_GPIO_BEEPER is not set -# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set -# CONFIG_INPUT_GPIO_TILT_POLLED is not set -# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set -# CONFIG_INPUT_IMS_PCU is not set -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_KEYSPAN_REMOTE is not set -# CONFIG_INPUT_KXTJ9 is not set -# CONFIG_INPUT_LEDS is not set -# CONFIG_INPUT_MATRIXKMAP is not set -CONFIG_INPUT_MISC=y -# CONFIG_INPUT_MMA8450 is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_MPU3050 is not set -# CONFIG_INPUT_PCF8574 is not set -# CONFIG_INPUT_PCSPKR is not set -# CONFIG_INPUT_POLLDEV is not set -# CONFIG_INPUT_POWERMATE is not set -# CONFIG_INPUT_PWM_BEEPER is not set -# CONFIG_INPUT_REGULATOR_HAPTIC is not set -# CONFIG_INPUT_SOC_BUTTON_ARRAY is not set -# CONFIG_INPUT_SPARSEKMAP is not set -# CONFIG_INPUT_TABLET is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_UINPUT is not set -# CONFIG_INPUT_WISTRON_BTNS is not set -# CONFIG_INPUT_YEALINK is not set -# CONFIG_INT340X_THERMAL is not set -# CONFIG_INTEL_IDLE is not set -# CONFIG_INTEL_IDMA64 is not set -# CONFIG_INTEL_MEI is not set -# CONFIG_INTEL_MEI_ME is not set -# CONFIG_INTEL_MEI_TXE is not set -# CONFIG_INTEL_MIC_CARD is not set -# CONFIG_INTEL_MIC_HOST is not set -# CONFIG_INTEL_MID_PTI is not set -# CONFIG_INTEL_OAKTRAIL is not set -# CONFIG_INTEL_RST is not set -# CONFIG_INTEL_SMARTCONNECT is not set -# CONFIG_INTEL_SOC_PMIC is not set -# CONFIG_INTEL_TH is not set -# CONFIG_INTERVAL_TREE_TEST is not set -# CONFIG_INV_MPU6050_IIO is not set -# CONFIG_IOMMU_SUPPORT is not set -# CONFIG_IOSCHED_CFQ is not set -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_NOOP=y -# CONFIG_IP17XX_PHY is not set -# CONFIG_IP6_NF_FILTER is not set -# CONFIG_IP6_NF_IPTABLES is not set -# CONFIG_IP6_NF_MANGLE is not set -# CONFIG_IP6_NF_MATCH_AH is not set -# CONFIG_IP6_NF_MATCH_EUI64 is not set -# CONFIG_IP6_NF_MATCH_FRAG is not set -# CONFIG_IP6_NF_MATCH_HL is not set -# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set -# CONFIG_IP6_NF_MATCH_MH is not set -# CONFIG_IP6_NF_MATCH_OPTS is not set -# CONFIG_IP6_NF_MATCH_RPFILTER is not set -# CONFIG_IP6_NF_MATCH_RT is not set -# CONFIG_IP6_NF_NAT is not set -# CONFIG_IP6_NF_RAW is not set -# CONFIG_IP6_NF_TARGET_HL is not set -# CONFIG_IP6_NF_TARGET_REJECT is not set -# CONFIG_IP6_NF_TARGET_SYNPROXY is not set -# CONFIG_IPACK_BUS is not set -# CONFIG_IPC_NS is not set -# CONFIG_IPMI_HANDLER is not set -# CONFIG_IPV6 is not set -# CONFIG_IPV6_ILA is not set -# CONFIG_IPV6_MIP6 is not set -# CONFIG_IPV6_MROUTE is not set -# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set -# CONFIG_IPV6_MULTIPLE_TABLES is not set -CONFIG_IPV6_NDISC_NODETYPE=y -# CONFIG_IPV6_OPTIMISTIC_DAD is not set -# CONFIG_IPV6_ROUTER_PREF is not set -# CONFIG_IPV6_ROUTE_INFO is not set -# CONFIG_IPV6_SIT is not set -# CONFIG_IPV6_SIT_6RD is not set -# CONFIG_IPV6_TUNNEL is not set -# CONFIG_IPV6_VTI is not set -# CONFIG_IPVLAN is not set -# CONFIG_IPW2100 is not set -# CONFIG_IPW2100_DEBUG is not set -CONFIG_IPW2100_MONITOR=y -# CONFIG_IPW2200 is not set -# CONFIG_IPW2200_DEBUG is not set -CONFIG_IPW2200_MONITOR=y -# CONFIG_IPW2200_PROMISCUOUS is not set -# CONFIG_IPW2200_QOS is not set -# CONFIG_IPW2200_RADIOTAP is not set -# CONFIG_IPWIRELESS is not set -# CONFIG_IPX is not set -CONFIG_IP_ADVANCED_ROUTER=y -# CONFIG_IP_DCCP is not set -# CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MROUTE=y -CONFIG_IP_MROUTE_MULTIPLE_TABLES=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_MULTIPLE_TABLES=y -# CONFIG_IP_NF_ARPFILTER is not set -# CONFIG_IP_NF_ARPTABLES is not set -# CONFIG_IP_NF_ARP_MANGLE is not set -# CONFIG_IP_NF_FILTER is not set -# CONFIG_IP_NF_IPTABLES is not set -# CONFIG_IP_NF_MANGLE is not set -# CONFIG_IP_NF_MATCH_AH is not set -# CONFIG_IP_NF_MATCH_ECN is not set -# CONFIG_IP_NF_MATCH_RPFILTER is not set -# CONFIG_IP_NF_MATCH_TTL is not set -# CONFIG_IP_NF_RAW is not set -# CONFIG_IP_NF_SECURITY is not set -# CONFIG_IP_NF_TARGET_CLUSTERIP is not set -# CONFIG_IP_NF_TARGET_ECN is not set -# CONFIG_IP_NF_TARGET_MASQUERADE is not set -# CONFIG_IP_NF_TARGET_NETMAP is not set -# CONFIG_IP_NF_TARGET_REDIRECT is not set -# CONFIG_IP_NF_TARGET_REJECT is not set -# CONFIG_IP_NF_TARGET_SYNPROXY is not set -# CONFIG_IP_NF_TARGET_TTL is not set -# CONFIG_IP_PIMSM_V1 is not set -# CONFIG_IP_PIMSM_V2 is not set -# CONFIG_IP_PNP is not set -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_ROUTE_VERBOSE=y -# CONFIG_IP_SCTP is not set -# CONFIG_IP_SET is not set -# CONFIG_IP_VS is not set -# CONFIG_IRDA is not set -# CONFIG_IRQSOFF_TRACER is not set -# CONFIG_IRQ_ALL_CPUS is not set -# CONFIG_IRQ_DOMAIN_DEBUG is not set -# CONFIG_IRQ_TIME_ACCOUNTING is not set -# CONFIG_IR_GPIO_CIR is not set -# CONFIG_IR_HIX5HD2 is not set -# CONFIG_IR_IGORPLUGUSB is not set -# CONFIG_IR_IGUANA is not set -# CONFIG_IR_IMG is not set -# CONFIG_IR_IMON is not set -# CONFIG_IR_JVC_DECODER is not set -# CONFIG_IR_LIRC_CODEC is not set -# CONFIG_IR_MCEUSB is not set -# CONFIG_IR_NEC_DECODER is not set -# CONFIG_IR_RC5_DECODER is not set -# CONFIG_IR_RC6_DECODER is not set -# CONFIG_IR_REDRAT3 is not set -# CONFIG_IR_SONY_DECODER is not set -# CONFIG_IR_STREAMZAP is not set -# CONFIG_IR_TTUSBIR is not set -# CONFIG_ISCSI_BOOT_SYSFS is not set -# CONFIG_ISCSI_TCP is not set -CONFIG_ISDN=y -# CONFIG_ISDN_AUDIO is not set -# CONFIG_ISDN_CAPI is not set -# CONFIG_ISDN_CAPI_CAPIDRV is not set -# CONFIG_ISDN_DIVERSION is not set -# CONFIG_ISDN_DRV_ACT2000 is not set -# CONFIG_ISDN_DRV_GIGASET is not set -# CONFIG_ISDN_DRV_HISAX is not set -# CONFIG_ISDN_DRV_ICN is not set -# CONFIG_ISDN_DRV_LOOP is not set -# CONFIG_ISDN_DRV_PCBIT is not set -# CONFIG_ISDN_DRV_SC is not set -# CONFIG_ISDN_I4L is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_ISL29125 is not set -# CONFIG_ISO9660_FS is not set -# CONFIG_ISS4xx is not set -# CONFIG_ITG3200 is not set -# CONFIG_IWL3945 is not set -# CONFIG_IWLWIFI is not set -# CONFIG_IXGB is not set -# CONFIG_IXGBE is not set -# CONFIG_IXGBEVF is not set -# CONFIG_JBD2_DEBUG is not set -# CONFIG_JFFS2_CMODE_FAVOURLZO is not set -# CONFIG_JFFS2_CMODE_NONE is not set -CONFIG_JFFS2_CMODE_PRIORITY=y -# CONFIG_JFFS2_CMODE_SIZE is not set -CONFIG_JFFS2_COMPRESSION_OPTIONS=y -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -# CONFIG_JFFS2_FS_POSIX_ACL is not set -# CONFIG_JFFS2_FS_SECURITY is not set -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -CONFIG_JFFS2_FS_WRITEBUFFER=y -CONFIG_JFFS2_FS_XATTR=y -CONFIG_JFFS2_LZMA=y -# CONFIG_JFFS2_LZO is not set -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -CONFIG_JFFS2_SUMMARY=y -# CONFIG_JFFS2_ZLIB is not set -# CONFIG_JFS_DEBUG is not set -# CONFIG_JFS_FS is not set -# CONFIG_JFS_POSIX_ACL is not set -# CONFIG_JFS_SECURITY is not set -# CONFIG_JFS_STATISTICS is not set -# CONFIG_JME is not set -CONFIG_JOLIET=y -# CONFIG_JSA1212 is not set -# CONFIG_JUMP_LABEL is not set -# CONFIG_KALLSYMS is not set -# CONFIG_KALLSYMS_ALL is not set -# CONFIG_KALLSYMS_UNCOMPRESSED is not set -# CONFIG_KARMA_PARTITION is not set -# CONFIG_KERNEL_BZIP2 is not set -# CONFIG_KERNEL_GZIP is not set -# CONFIG_KERNEL_LZ4 is not set -# CONFIG_KERNEL_LZMA is not set -# CONFIG_KERNEL_LZO is not set -CONFIG_KERNEL_MODE_NEON=y -CONFIG_KERNEL_XZ=y -CONFIG_KERNFS=y -# CONFIG_KEXEC is not set -# CONFIG_KEYBOARD_ADP5588 is not set -# CONFIG_KEYBOARD_ADP5589 is not set -# CONFIG_KEYBOARD_ATKBD is not set -# CONFIG_KEYBOARD_BCM is not set -# CONFIG_KEYBOARD_CAP11XX is not set -# CONFIG_KEYBOARD_GPIO is not set -# CONFIG_KEYBOARD_GPIO_POLLED is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_LM8323 is not set -# CONFIG_KEYBOARD_LM8333 is not set -# CONFIG_KEYBOARD_MATRIX is not set -# CONFIG_KEYBOARD_MAX7359 is not set -# CONFIG_KEYBOARD_MCS is not set -# CONFIG_KEYBOARD_MPR121 is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_OMAP4 is not set -# CONFIG_KEYBOARD_OPENCORES is not set -# CONFIG_KEYBOARD_PXA27x is not set -# CONFIG_KEYBOARD_QT1070 is not set -# CONFIG_KEYBOARD_QT2160 is not set -# CONFIG_KEYBOARD_SAMSUNG is not set -# CONFIG_KEYBOARD_SH_KEYSC is not set -# CONFIG_KEYBOARD_SNVS_PWRKEY is not set -# CONFIG_KEYBOARD_STOWAWAY is not set -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_TCA6416 is not set -# CONFIG_KEYBOARD_TCA8418 is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYS is not set -# CONFIG_KGDB is not set -# CONFIG_KMEMCHECK is not set -# CONFIG_KMX61 is not set -# CONFIG_KPROBES is not set -# CONFIG_KPROBES_SANITY_TEST is not set -# CONFIG_KS8842 is not set -# CONFIG_KS8851 is not set -# CONFIG_KS8851_MLL is not set -# CONFIG_KSM is not set -# CONFIG_KSZ884X_PCI is not set -CONFIG_KUSER_HELPERS=y -# CONFIG_KVM_GUEST is not set -# CONFIG_KXCJK1013 is not set -# CONFIG_KXSD9 is not set -# CONFIG_L2TP is not set -# CONFIG_L2TP_ETH is not set -# CONFIG_L2TP_IP is not set -# CONFIG_L2TP_V3 is not set -# CONFIG_LANMEDIA is not set -# CONFIG_LANTIQ is not set -# CONFIG_LAPB is not set -# CONFIG_LASAT is not set -# CONFIG_LATENCYTOP is not set -# CONFIG_LATTICE_ECP3_CONFIG is not set -CONFIG_LBDAF=y -# CONFIG_LCD_AMS369FG06 is not set -# CONFIG_LCD_HX8357 is not set -# CONFIG_LCD_ILI922X is not set -# CONFIG_LCD_ILI9320 is not set -# CONFIG_LCD_L4F00242T03 is not set -# CONFIG_LCD_LD9040 is not set -# CONFIG_LCD_LMS283GF05 is not set -# CONFIG_LCD_LMS501KF03 is not set -# CONFIG_LCD_LTV350QV is not set -# CONFIG_LCD_S6E63M0 is not set -# CONFIG_LCD_TDO24M is not set -# CONFIG_LCD_VGG2432A4 is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_LEDS_BCM6328 is not set -# CONFIG_LEDS_BCM6358 is not set -# CONFIG_LEDS_BD2802 is not set -# CONFIG_LEDS_BLINKM is not set -CONFIG_LEDS_CLASS=y -# CONFIG_LEDS_CLASS_FLASH is not set -# CONFIG_LEDS_DAC124S085 is not set -# CONFIG_LEDS_GPIO is not set -# CONFIG_LEDS_INTEL_SS4200 is not set -# CONFIG_LEDS_LM3530 is not set -# CONFIG_LEDS_LM355x is not set -# CONFIG_LEDS_LM3642 is not set -# CONFIG_LEDS_LP3944 is not set -# CONFIG_LEDS_LP5521 is not set -# CONFIG_LEDS_LP5523 is not set -# CONFIG_LEDS_LP5562 is not set -# CONFIG_LEDS_LP8501 is not set -# CONFIG_LEDS_LP8860 is not set -# CONFIG_LEDS_LT3593 is not set -# CONFIG_LEDS_NS2 is not set -# CONFIG_LEDS_OT200 is not set -# CONFIG_LEDS_PCA9532 is not set -# CONFIG_LEDS_PCA955X is not set -# CONFIG_LEDS_PCA963X is not set -# CONFIG_LEDS_PWM is not set -# CONFIG_LEDS_REGULATOR is not set -# CONFIG_LEDS_SYSCON is not set -# CONFIG_LEDS_TCA6507 is not set -# CONFIG_LEDS_TLC591XX is not set -CONFIG_LEDS_TRIGGERS=y -# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set -# CONFIG_LEDS_TRIGGER_CAMERA is not set -# CONFIG_LEDS_TRIGGER_CPU is not set -CONFIG_LEDS_TRIGGER_DEFAULT_ON=y -# CONFIG_LEDS_TRIGGER_GPIO is not set -# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set -# CONFIG_LEDS_TRIGGER_IDE_DISK is not set -# CONFIG_LEDS_TRIGGER_MORSE is not set -CONFIG_LEDS_TRIGGER_NETDEV=y -# CONFIG_LEDS_TRIGGER_ONESHOT is not set -CONFIG_LEDS_TRIGGER_TIMER=y -# CONFIG_LEDS_TRIGGER_TRANSIENT is not set -# CONFIG_LEDS_TRIGGER_USBDEV is not set -# CONFIG_LEGACY_PTYS is not set -# CONFIG_LIB80211 is not set -# CONFIG_LIB80211_CRYPT_CCMP is not set -# CONFIG_LIB80211_CRYPT_TKIP is not set -# CONFIG_LIB80211_CRYPT_WEP is not set -# CONFIG_LIB80211_DEBUG is not set -# CONFIG_LIBCRC32C is not set -# CONFIG_LIBERTAS is not set -# CONFIG_LIBERTAS_THINFIRM is not set -# CONFIG_LIBERTAS_USB is not set -# CONFIG_LIBFC is not set -# CONFIG_LIBFCOE is not set -# CONFIG_LIBIPW_DEBUG is not set -# CONFIG_LIBNVDIMM is not set -# CONFIG_LIDAR_LITE_V2 is not set -# CONFIG_LIRC_STAGING is not set -# CONFIG_LIS3L02DQ is not set -# CONFIG_LKDTM is not set -CONFIG_LLC=y -# CONFIG_LLC2 is not set -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -# CONFIG_LOCKD is not set -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_LOCKD_V4=y -# CONFIG_LOCKUP_DETECTOR is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_LOCK_TORTURE_TEST is not set -# CONFIG_LOGFS is not set -# CONFIG_LOGIG940_FF is not set -# CONFIG_LOGIRUMBLEPAD2_FF is not set -# CONFIG_LOGITECH_FF is not set -# CONFIG_LOGIWHEELS_FF is not set -# CONFIG_LOGO is not set -CONFIG_LOG_BUF_SHIFT=17 -CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 -# CONFIG_LOONGSON_MC146818 is not set -# CONFIG_LPC_ICH is not set -# CONFIG_LPC_SCH is not set -# CONFIG_LP_CONSOLE is not set -# CONFIG_LSI_ET1011C_PHY is not set -# CONFIG_LTE_GDM724X is not set -# CONFIG_LTPC is not set -# CONFIG_LTR501 is not set -# CONFIG_LUSTRE_FS is not set -# CONFIG_LWTUNNEL is not set -# CONFIG_LXT_PHY is not set -# CONFIG_LZ4HC_COMPRESS is not set -# CONFIG_LZ4_COMPRESS is not set -# CONFIG_LZ4_DECOMPRESS is not set -CONFIG_LZMA_COMPRESS=y -CONFIG_LZMA_DECOMPRESS=y -# CONFIG_LZO_COMPRESS is not set -# CONFIG_LZO_DECOMPRESS is not set -# CONFIG_M62332 is not set -# CONFIG_MAC80211 is not set -# CONFIG_MAC80211_MESSAGE_TRACING is not set -CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 -# CONFIG_MACB is not set -# CONFIG_MACH_ASM9260 is not set -# CONFIG_MACH_DECSTATION is not set -# CONFIG_MACH_INGENIC is not set -# CONFIG_MACH_JAZZ is not set -# CONFIG_MACH_JZ4740 is not set -# CONFIG_MACH_LOONGSON32 is not set -# CONFIG_MACH_LOONGSON64 is not set -# CONFIG_MACH_PISTACHIO is not set -# CONFIG_MACH_TX39XX is not set -# CONFIG_MACH_TX49XX is not set -# CONFIG_MACH_VR41XX is not set -# CONFIG_MACH_XILFPGA is not set -# CONFIG_MACINTOSH_DRIVERS is not set -# CONFIG_MACVLAN is not set -# CONFIG_MACVTAP is not set -# CONFIG_MAC_EMUMOUSEBTN is not set -# CONFIG_MAC_PARTITION is not set -# CONFIG_MAG3110 is not set -# CONFIG_MAGIC_SYSRQ is not set -CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 -# CONFIG_MAILBOX is not set -# CONFIG_MANGLE_BOOTARGS is not set -# CONFIG_MARVELL_PHY is not set -# CONFIG_MAX1027 is not set -# CONFIG_MAX1363 is not set -# CONFIG_MAX517 is not set -# CONFIG_MAX5821 is not set -# CONFIG_MAX63XX_WATCHDOG is not set -# CONFIG_MCB is not set -# CONFIG_MCP320X is not set -# CONFIG_MCP3422 is not set -# CONFIG_MCP4531 is not set -# CONFIG_MCP4725 is not set -# CONFIG_MCP4922 is not set -# CONFIG_MCPM is not set -# CONFIG_MD is not set -# CONFIG_MDIO_BCM_UNIMAC is not set -# CONFIG_MDIO_BITBANG is not set -# CONFIG_MDIO_BUS_MUX_GPIO is not set -# CONFIG_MDIO_BUS_MUX_MMIOREG is not set -# CONFIG_MDIO_OCTEON is not set -# CONFIG_MD_FAULTY is not set -# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set -# CONFIG_MEDIA_ATTACH is not set -# CONFIG_MEDIA_CAMERA_SUPPORT is not set -# CONFIG_MEDIA_CONTROLLER is not set -# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set -# CONFIG_MEDIA_PCI_SUPPORT is not set -# CONFIG_MEDIA_RADIO_SUPPORT is not set -# CONFIG_MEDIA_RC_SUPPORT is not set -# CONFIG_MEDIA_SDR_SUPPORT is not set -# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set -# CONFIG_MEDIA_SUPPORT is not set -# CONFIG_MEDIA_USB_SUPPORT is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_SAS is not set -CONFIG_MEMBARRIER=y -# CONFIG_MEMORY is not set -# CONFIG_MEMORY_FAILURE is not set -# CONFIG_MEMSTICK is not set -# CONFIG_MEMTEST is not set -# CONFIG_MEN_A21_WDT is not set -CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_ARIZONA_SPI is not set -# CONFIG_MFD_AS3711 is not set -# CONFIG_MFD_AS3722 is not set -# CONFIG_MFD_ASIC3 is not set -# CONFIG_MFD_ATMEL_FLEXCOM is not set -# CONFIG_MFD_ATMEL_HLCDC is not set -# CONFIG_MFD_AXP20X is not set -# CONFIG_MFD_BCM590XX is not set -# CONFIG_MFD_CORE is not set -# CONFIG_MFD_CROS_EC is not set -# CONFIG_MFD_CS5535 is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9052_SPI is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_DA9062 is not set -# CONFIG_MFD_DA9063 is not set -# CONFIG_MFD_DA9150 is not set -# CONFIG_MFD_DLN2 is not set -# CONFIG_MFD_HI6421_PMIC is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_LP3943 is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_MAX14577 is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX77843 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_MFD_MC13XXX is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_MFD_MC13XXX_SPI is not set -# CONFIG_MFD_MENF21BMC is not set -# CONFIG_MFD_MT6397 is not set -# CONFIG_MFD_OMAP_USB_HOST is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_PM8921_CORE is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_RK808 is not set -# CONFIG_MFD_RN5T618 is not set -# CONFIG_MFD_RT5033 is not set -# CONFIG_MFD_RTSX_PCI is not set -# CONFIG_MFD_RTSX_USB is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SKY81452 is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SMSC is not set -# CONFIG_MFD_STMPE is not set -# CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_T7L66XB is not set -# CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TC6387XB is not set -# CONFIG_MFD_TC6393XB is not set -# CONFIG_MFD_TIMBERDALE is not set -# CONFIG_MFD_TI_AM335X_TSCADC is not set -# CONFIG_MFD_TMIO is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TPS65218 is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS65910 is not set -# CONFIG_MFD_TPS65912 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS65912_SPI is not set -# CONFIG_MFD_TPS80031 is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_VX855 is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_WM831X is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM831X_SPI is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_MG_DISK is not set -# CONFIG_MICREL_KS8995MA is not set -# CONFIG_MICREL_PHY is not set -# CONFIG_MICROCHIP_PHY is not set -# CONFIG_MIGRATION is not set -CONFIG_MII=y -# CONFIG_MIKROTIK_RB532 is not set -# CONFIG_MINIX_FS is not set -# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_MIPS_ALCHEMY is not set -# CONFIG_MIPS_CDMM is not set -# CONFIG_MIPS_COBALT is not set -# CONFIG_MIPS_FPU_EMULATOR is not set -# CONFIG_MIPS_MALTA is not set -# CONFIG_MIPS_O32_FP64_SUPPORT is not set -# CONFIG_MIPS_PARAVIRT is not set -# CONFIG_MIPS_PLATFORM_DEVICES is not set -# CONFIG_MIPS_SEAD3 is not set -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_MISDN is not set -# CONFIG_MISDN_AVMFRITZ is not set -# CONFIG_MISDN_HFCPCI is not set -# CONFIG_MISDN_HFCUSB is not set -# CONFIG_MISDN_INFINEON is not set -# CONFIG_MISDN_NETJET is not set -# CONFIG_MISDN_SPEEDFAX is not set -# CONFIG_MISDN_W6692 is not set -# CONFIG_MKISS is not set -# CONFIG_MLX4_CORE is not set -# CONFIG_MLX4_EN is not set -# CONFIG_MLX5_CORE is not set -# CONFIG_MLX90614 is not set -# CONFIG_MLXSW_CORE is not set -# CONFIG_MMA8452 is not set -# CONFIG_MMA9551 is not set -# CONFIG_MMA9553 is not set -# CONFIG_MMC is not set -# CONFIG_MMC35240 is not set -# CONFIG_MMC_ARMMMCI is not set -# CONFIG_MMC_AU1X is not set -# CONFIG_MMC_BLOCK is not set -CONFIG_MMC_BLOCK_BOUNCE=y -CONFIG_MMC_BLOCK_MINORS=8 -# CONFIG_MMC_CB710 is not set -# CONFIG_MMC_DEBUG is not set -# CONFIG_MMC_DW is not set -# CONFIG_MMC_MTK is not set -# CONFIG_MMC_MVSDIO is not set -# CONFIG_MMC_S3C is not set -# CONFIG_MMC_SDHCI is not set -# CONFIG_MMC_SDHCI_ACPI is not set -# CONFIG_MMC_SDHCI_BCM_KONA is not set -# CONFIG_MMC_SDHCI_F_SDH30 is not set -# CONFIG_MMC_SDHCI_IPROC is not set -# CONFIG_MMC_SDHCI_MSM is not set -# CONFIG_MMC_SDHCI_OF_ARASAN is not set -# CONFIG_MMC_SDHCI_OF_AT91 is not set -# CONFIG_MMC_SDHCI_OF_ESDHC is not set -# CONFIG_MMC_SDHCI_OF_HLWD is not set -# CONFIG_MMC_SDHCI_PXAV2 is not set -# CONFIG_MMC_SDHCI_PXAV3 is not set -# CONFIG_MMC_SDRICOH_CS is not set -# CONFIG_MMC_SPI is not set -# CONFIG_MMC_TEST is not set -# CONFIG_MMC_TOSHIBA_PCI is not set -# CONFIG_MMC_USDHI6ROL0 is not set -# CONFIG_MMC_USHC is not set -# CONFIG_MMC_VIA_SDMMC is not set -# CONFIG_MMC_VUB300 is not set -# CONFIG_MMIOTRACE is not set -CONFIG_MMU=y -CONFIG_MODULES=y -# CONFIG_MODULE_COMPRESS is not set -# CONFIG_MODULE_FORCE_LOAD is not set -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODULE_SIG is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_MODULE_STRIPPED=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODVERSIONS is not set -# CONFIG_MOST is not set -# CONFIG_MOUSE_APPLETOUCH is not set -# CONFIG_MOUSE_ELAN_I2C is not set -# CONFIG_MOUSE_GPIO is not set -# CONFIG_MOUSE_INPORT is not set -# CONFIG_MOUSE_LOGIBM is not set -# CONFIG_MOUSE_PC110PAD is not set -# CONFIG_MOUSE_PS2_FOCALTECH is not set -# CONFIG_MOUSE_PS2_SENTELIC is not set -# CONFIG_MOUSE_SYNAPTICS_I2C is not set -# CONFIG_MOUSE_SYNAPTICS_USB is not set -# CONFIG_MPL115 is not set -# CONFIG_MPL3115 is not set -# CONFIG_MPLS is not set -# CONFIG_MS5611 is not set -# CONFIG_MS5637 is not set -# CONFIG_MSDOS_FS is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_MSI_BITMAP_SELFTEST is not set -# CONFIG_MSI_LAPTOP is not set -CONFIG_MTD=y -# CONFIG_MTD_ABSENT is not set -# CONFIG_MTD_AFS_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_MTD_BLOCK2MTD is not set -CONFIG_MTD_CFI=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_CFI_AMDSTD=y -# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -CONFIG_MTD_CFI_INTELEXT=y -# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set -CONFIG_MTD_CFI_NOSWAP=y -# CONFIG_MTD_CFI_STAA is not set -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_CMDLINE_PARTS is not set -CONFIG_MTD_COMPLEX_MAPPINGS=y -# CONFIG_MTD_DATAFLASH is not set -# CONFIG_MTD_DOCG3 is not set -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_GPIO_ADDR is not set -# CONFIG_MTD_INTEL_VR_NOR is not set -# CONFIG_MTD_JEDECPROBE is not set -# CONFIG_MTD_LATCH_ADDR is not set -# CONFIG_MTD_LPDDR is not set -# CONFIG_MTD_LPDDR2_NVM is not set -# CONFIG_MTD_M25P80 is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -CONFIG_MTD_MAP_BANK_WIDTH_2=y -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_MYLOADER_PARTS is not set -# CONFIG_MTD_NAND is not set -# CONFIG_MTD_NAND_AMS_DELTA is not set -# CONFIG_MTD_NAND_AR934X is not set -# CONFIG_MTD_NAND_AR934X_HW_ECC is not set -# CONFIG_MTD_NAND_ATMEL is not set -# CONFIG_MTD_NAND_AU1550 is not set -# CONFIG_MTD_NAND_BCH is not set -# CONFIG_MTD_NAND_BF5XX is not set -# CONFIG_MTD_NAND_BRCMNAND is not set -# CONFIG_MTD_NAND_CAFE is not set -# CONFIG_MTD_NAND_CM_X270 is not set -# CONFIG_MTD_NAND_CS553X is not set -# CONFIG_MTD_NAND_DAVINCI is not set -# CONFIG_MTD_NAND_DENALI is not set -# CONFIG_MTD_NAND_DENALI_DT is not set -# CONFIG_MTD_NAND_DENALI_PCI is not set -CONFIG_MTD_NAND_DENALI_SCRATCH_REG_ADDR=0xff108018 -# CONFIG_MTD_NAND_DISKONCHIP is not set -# CONFIG_MTD_NAND_DOCG4 is not set -# CONFIG_MTD_NAND_ECC is not set -# CONFIG_MTD_NAND_ECC_BCH is not set -# CONFIG_MTD_NAND_ECC_SMC is not set -# CONFIG_MTD_NAND_FSL_ELBC is not set -# CONFIG_MTD_NAND_FSL_IFC is not set -# CONFIG_MTD_NAND_FSL_UPM is not set -# CONFIG_MTD_NAND_FSMC is not set -# CONFIG_MTD_NAND_GPIO is not set -# CONFIG_MTD_NAND_GPMI_NAND is not set -# CONFIG_MTD_NAND_HISI504 is not set -CONFIG_MTD_NAND_IDS=y -# CONFIG_MTD_NAND_JZ4740 is not set -# CONFIG_MTD_NAND_MPC5121_NFC is not set -# CONFIG_MTD_NAND_MXC is not set -# CONFIG_MTD_NAND_NANDSIM is not set -# CONFIG_MTD_NAND_NDFC is not set -# CONFIG_MTD_NAND_NUC900 is not set -# CONFIG_MTD_NAND_OMAP2 is not set -# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set -# CONFIG_MTD_NAND_ORION is not set -# CONFIG_MTD_NAND_PASEMI is not set -# CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_NAND_PXA3xx is not set -# CONFIG_MTD_NAND_RB4XX is not set -# CONFIG_MTD_NAND_RB750 is not set -# CONFIG_MTD_NAND_RICOH is not set -# CONFIG_MTD_NAND_S3C2410 is not set -# CONFIG_MTD_NAND_SHARPSL is not set -# CONFIG_MTD_NAND_SH_FLCTL is not set -# CONFIG_MTD_NAND_SOCRATES is not set -# CONFIG_MTD_NAND_TMIO is not set -# CONFIG_MTD_NAND_TXX9NDFMC is not set -CONFIG_MTD_OF_PARTS=y -# CONFIG_MTD_ONENAND is not set -# CONFIG_MTD_OOPS is not set -# CONFIG_MTD_OTP is not set -# CONFIG_MTD_PARTITIONED_MASTER is not set -# CONFIG_MTD_PCI is not set -# CONFIG_MTD_PCMCIA is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_PHYSMAP_COMPAT is not set -CONFIG_MTD_PHYSMAP_OF=y -# CONFIG_MTD_PLATRAM is not set -# CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_RAM is not set -CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 -# CONFIG_MTD_REDBOOT_PARTS is not set -# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set -# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set -# CONFIG_MTD_ROM is not set -CONFIG_MTD_ROOTFS_ROOT_DEV=y -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_SM_COMMON is not set -# CONFIG_MTD_SPINAND_MT29F is not set -# CONFIG_MTD_SPI_NOR is not set -# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set -CONFIG_MTD_SPLIT=y -# CONFIG_MTD_SPLIT_BRNIMAGE_FW is not set -# CONFIG_MTD_SPLIT_EVA_FW is not set -# CONFIG_MTD_SPLIT_FIRMWARE is not set -CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" -# CONFIG_MTD_SPLIT_FIT_FW is not set -# CONFIG_MTD_SPLIT_LZMA_FW is not set -# CONFIG_MTD_SPLIT_SEAMA_FW is not set -CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y -CONFIG_MTD_SPLIT_SUPPORT=y -# CONFIG_MTD_SPLIT_TPLINK_FW is not set -# CONFIG_MTD_SPLIT_TRX_FW is not set -# CONFIG_MTD_SPLIT_UIMAGE_FW is not set -# CONFIG_MTD_SST25L is not set -# CONFIG_MTD_SWAP is not set -# CONFIG_MTD_TESTS is not set -# CONFIG_MTD_UBI is not set -# CONFIG_MTD_UIMAGE_SPLIT is not set -CONFIG_MULTIUSER=y -# CONFIG_MUTEX_SPIN_ON_OWNER is not set -# CONFIG_MV643XX_ETH is not set -# CONFIG_MVMDIO is not set -# CONFIG_MVSW61XX_PHY is not set -# CONFIG_MVSWITCH_PHY is not set -# CONFIG_MWAVE is not set -# CONFIG_MWL8K is not set -# CONFIG_MXC4005 is not set -# CONFIG_MYRI10GE is not set -# CONFIG_NAMESPACES is not set -# CONFIG_NATIONAL_PHY is not set -# CONFIG_NATSEMI is not set -# CONFIG_NAU7802 is not set -# CONFIG_NBPFAXI_DMA is not set -# CONFIG_NCP_FS is not set -# CONFIG_NE2000 is not set -# CONFIG_NE2K_PCI is not set -# CONFIG_NEC_MARKEINS is not set -CONFIG_NET=y -# CONFIG_NETCONSOLE is not set -CONFIG_NETDEVICES=y -# CONFIG_NETFILTER is not set -# CONFIG_NETFILTER_ADVANCED is not set -# CONFIG_NETFILTER_DEBUG is not set -# CONFIG_NETFILTER_INGRESS is not set -# CONFIG_NETFILTER_NETLINK is not set -# CONFIG_NETFILTER_NETLINK_ACCT is not set -# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set -# CONFIG_NETFILTER_NETLINK_LOG is not set -# CONFIG_NETFILTER_NETLINK_QUEUE is not set -# CONFIG_NETFILTER_XTABLES is not set -# CONFIG_NETFILTER_XT_CONNMARK is not set -# CONFIG_NETFILTER_XT_MARK is not set -# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set -# CONFIG_NETFILTER_XT_MATCH_BPF is not set -# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set -# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set -# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set -# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set -# CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set -# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set -# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set -# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set -# CONFIG_NETFILTER_XT_MATCH_CPU is not set -# CONFIG_NETFILTER_XT_MATCH_DCCP is not set -# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set -# CONFIG_NETFILTER_XT_MATCH_DSCP is not set -# CONFIG_NETFILTER_XT_MATCH_ECN is not set -# CONFIG_NETFILTER_XT_MATCH_ESP is not set -# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set -# CONFIG_NETFILTER_XT_MATCH_HELPER is not set -# CONFIG_NETFILTER_XT_MATCH_HL is not set -# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set -# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set -# CONFIG_NETFILTER_XT_MATCH_L2TP is not set -# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set -# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set -# CONFIG_NETFILTER_XT_MATCH_MAC is not set -# CONFIG_NETFILTER_XT_MATCH_MARK is not set -# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set -# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set -# CONFIG_NETFILTER_XT_MATCH_OSF is not set -# CONFIG_NETFILTER_XT_MATCH_OWNER is not set -# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set -# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set -# CONFIG_NETFILTER_XT_MATCH_POLICY is not set -# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set -# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set -# CONFIG_NETFILTER_XT_MATCH_REALM is not set -# CONFIG_NETFILTER_XT_MATCH_RECENT is not set -# CONFIG_NETFILTER_XT_MATCH_SCTP is not set -# CONFIG_NETFILTER_XT_MATCH_SOCKET is not set -# CONFIG_NETFILTER_XT_MATCH_STATE is not set -# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set -# CONFIG_NETFILTER_XT_MATCH_STRING is not set -# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set -# CONFIG_NETFILTER_XT_MATCH_TIME is not set -# CONFIG_NETFILTER_XT_MATCH_U32 is not set -# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set -# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set -# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set -# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set -# CONFIG_NETFILTER_XT_TARGET_CT is not set -# CONFIG_NETFILTER_XT_TARGET_DSCP is not set -# CONFIG_NETFILTER_XT_TARGET_HL is not set -# CONFIG_NETFILTER_XT_TARGET_HMARK is not set -# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set -# CONFIG_NETFILTER_XT_TARGET_LED is not set -# CONFIG_NETFILTER_XT_TARGET_LOG is not set -# CONFIG_NETFILTER_XT_TARGET_MARK is not set -# CONFIG_NETFILTER_XT_TARGET_NETMAP is not set -# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set -# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set -# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set -# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set -# CONFIG_NETFILTER_XT_TARGET_REDIRECT is not set -# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set -# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set -# CONFIG_NETFILTER_XT_TARGET_TEE is not set -# CONFIG_NETFILTER_XT_TARGET_TPROXY is not set -# CONFIG_NETFILTER_XT_TARGET_TRACE is not set -# CONFIG_NETLINK_DIAG is not set -# CONFIG_NETLINK_MMAP is not set -# CONFIG_NETPOLL is not set -# CONFIG_NETROM is not set -CONFIG_NETWORK_FILESYSTEMS=y -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETXEN_NIC is not set -# CONFIG_NET_9P is not set -# CONFIG_NET_ACT_BPF is not set -# CONFIG_NET_ACT_CSUM is not set -# CONFIG_NET_ACT_GACT is not set -# CONFIG_NET_ACT_IPT is not set -# CONFIG_NET_ACT_MIRRED is not set -# CONFIG_NET_ACT_NAT is not set -# CONFIG_NET_ACT_PEDIT is not set -# CONFIG_NET_ACT_POLICE is not set -# CONFIG_NET_ACT_SIMP is not set -# CONFIG_NET_ACT_SKBEDIT is not set -# CONFIG_NET_ACT_VLAN is not set -CONFIG_NET_CADENCE=y -# CONFIG_NET_CALXEDA_XGMAC is not set -CONFIG_NET_CLS=y -# CONFIG_NET_CLS_ACT is not set -# CONFIG_NET_CLS_BASIC is not set -# CONFIG_NET_CLS_BPF is not set -# CONFIG_NET_CLS_FLOW is not set -# CONFIG_NET_CLS_FLOWER is not set -# CONFIG_NET_CLS_FW is not set -CONFIG_NET_CLS_IND=y -# CONFIG_NET_CLS_ROUTE4 is not set -# CONFIG_NET_CLS_RSVP is not set -# CONFIG_NET_CLS_RSVP6 is not set -# CONFIG_NET_CLS_TCINDEX is not set -# CONFIG_NET_CLS_U32 is not set -CONFIG_NET_CORE=y -# CONFIG_NET_DROP_MONITOR is not set -# CONFIG_NET_DSA is not set -# CONFIG_NET_DSA_BCM_SF2 is not set -# CONFIG_NET_DSA_MV88E6060 is not set -# CONFIG_NET_DSA_MV88E6123_61_65 is not set -# CONFIG_NET_DSA_MV88E6131 is not set -# CONFIG_NET_DSA_MV88E6171 is not set -# CONFIG_NET_DSA_MV88E6352 is not set -# CONFIG_NET_DSA_MV88E6XXX is not set -# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set -# CONFIG_NET_DSA_TAG_DSA is not set -# CONFIG_NET_DSA_TAG_EDSA is not set -# CONFIG_NET_EMATCH is not set -# CONFIG_NET_EMATCH_CANID is not set -# CONFIG_NET_EMATCH_CMP is not set -# CONFIG_NET_EMATCH_META is not set -# CONFIG_NET_EMATCH_NBYTE is not set -CONFIG_NET_EMATCH_STACK=32 -# CONFIG_NET_EMATCH_TEXT is not set -# CONFIG_NET_EMATCH_U32 is not set -# CONFIG_NET_FC is not set -# CONFIG_NET_FOU is not set -# CONFIG_NET_FOU_IP_TUNNELS is not set -# CONFIG_NET_IPGRE is not set -CONFIG_NET_IPGRE_BROADCAST=y -# CONFIG_NET_IPGRE_DEMUX is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPVTI is not set -# CONFIG_NET_IP_TUNNEL is not set -# CONFIG_NET_KEY is not set -# CONFIG_NET_KEY_MIGRATE is not set -# CONFIG_NET_L3_MASTER_DEV is not set -# CONFIG_NET_MPLS_GSO is not set -# CONFIG_NET_PACKET_ENGINE is not set -# CONFIG_NET_PKTGEN is not set -# CONFIG_NET_POLL_CONTROLLER is not set -# CONFIG_NET_PTP_CLASSIFY is not set -CONFIG_NET_RX_BUSY_POLL=y -# CONFIG_NET_SB1000 is not set -CONFIG_NET_SCHED=y -# CONFIG_NET_SCH_ATM is not set -# CONFIG_NET_SCH_CBQ is not set -# CONFIG_NET_SCH_CHOKE is not set -# CONFIG_NET_SCH_CODEL is not set -# CONFIG_NET_SCH_DRR is not set -# CONFIG_NET_SCH_DSMARK is not set -# CONFIG_NET_SCH_ESFQ is not set -CONFIG_NET_SCH_ESFQ_NFCT=y -CONFIG_NET_SCH_FIFO=y -# CONFIG_NET_SCH_FQ is not set -CONFIG_NET_SCH_FQ_CODEL=y -# CONFIG_NET_SCH_GRED is not set -# CONFIG_NET_SCH_HFSC is not set -# CONFIG_NET_SCH_HHF is not set -# CONFIG_NET_SCH_HTB is not set -# CONFIG_NET_SCH_INGRESS is not set -# CONFIG_NET_SCH_MQPRIO is not set -# CONFIG_NET_SCH_MULTIQ is not set -# CONFIG_NET_SCH_NETEM is not set -# CONFIG_NET_SCH_PIE is not set -# CONFIG_NET_SCH_PLUG is not set -# CONFIG_NET_SCH_PRIO is not set -# CONFIG_NET_SCH_QFQ is not set -# CONFIG_NET_SCH_RED is not set -# CONFIG_NET_SCH_SFB is not set -# CONFIG_NET_SCH_SFQ is not set -# CONFIG_NET_SCH_TBF is not set -# CONFIG_NET_SCH_TEQL is not set -# CONFIG_NET_SCTPPROBE is not set -# CONFIG_NET_SWITCHDEV is not set -# CONFIG_NET_TCPPROBE is not set -# CONFIG_NET_TEAM is not set -# CONFIG_NET_TULIP is not set -# CONFIG_NET_UDP_TUNNEL is not set -CONFIG_NET_VENDOR_3COM=y -CONFIG_NET_VENDOR_8390=y -CONFIG_NET_VENDOR_ADAPTEC=y -CONFIG_NET_VENDOR_AGERE=y -CONFIG_NET_VENDOR_ALTEON=y -CONFIG_NET_VENDOR_AMD=y -CONFIG_NET_VENDOR_ARC=y -CONFIG_NET_VENDOR_AURORA=y -CONFIG_NET_VENDOR_ATHEROS=y -CONFIG_NET_VENDOR_BROADCOM=y -CONFIG_NET_VENDOR_BROCADE=y -CONFIG_NET_VENDOR_CAVIUM=y -CONFIG_NET_VENDOR_CHELSIO=y -CONFIG_NET_VENDOR_CIRRUS=y -CONFIG_NET_VENDOR_CISCO=y -CONFIG_NET_VENDOR_DEC=y -CONFIG_NET_VENDOR_DLINK=y -CONFIG_NET_VENDOR_EMULEX=y -CONFIG_NET_VENDOR_EXAR=y -CONFIG_NET_VENDOR_EZCHIP=y -CONFIG_NET_VENDOR_FARADAY=y -CONFIG_NET_VENDOR_FREESCALE=y -CONFIG_NET_VENDOR_FUJITSU=y -CONFIG_NET_VENDOR_HISILICON=y -CONFIG_NET_VENDOR_HP=y -CONFIG_NET_VENDOR_I825XX=y -CONFIG_NET_VENDOR_IBM=y -CONFIG_NET_VENDOR_INTEL=y -CONFIG_NET_VENDOR_MARVELL=y -CONFIG_NET_VENDOR_MELLANOX=y -CONFIG_NET_VENDOR_MICREL=y -CONFIG_NET_VENDOR_MICROCHIP=y -CONFIG_NET_VENDOR_MYRI=y -CONFIG_NET_VENDOR_NATSEMI=y -CONFIG_NET_VENDOR_NVIDIA=y -CONFIG_NET_VENDOR_OKI=y -CONFIG_NET_VENDOR_QLOGIC=y -CONFIG_NET_VENDOR_QUALCOMM=y -CONFIG_NET_VENDOR_RDC=y -CONFIG_NET_VENDOR_REALTEK=y -CONFIG_NET_VENDOR_RENESAS=y -CONFIG_NET_VENDOR_ROCKER=y -CONFIG_NET_VENDOR_SAMSUNG=y -CONFIG_NET_VENDOR_SEEQ=y -CONFIG_NET_VENDOR_SILAN=y -CONFIG_NET_VENDOR_SIS=y -CONFIG_NET_VENDOR_SMSC=y -CONFIG_NET_VENDOR_STMICRO=y -CONFIG_NET_VENDOR_SUN=y -CONFIG_NET_VENDOR_SYNOPSYS=y -CONFIG_NET_VENDOR_TEHUTI=y -CONFIG_NET_VENDOR_TI=y -CONFIG_NET_VENDOR_TOSHIBA=y -CONFIG_NET_VENDOR_VIA=y -CONFIG_NET_VENDOR_WIZNET=y -CONFIG_NET_VENDOR_XILINX=y -CONFIG_NET_VENDOR_XIRCOM=y -# CONFIG_NET_VRF is not set -# CONFIG_NET_XGENE is not set -CONFIG_NEW_LEDS=y -# CONFIG_NFC is not set -# CONFIG_NFSD is not set -# CONFIG_NFSD_V2_ACL is not set -CONFIG_NFSD_V3=y -# CONFIG_NFSD_V3_ACL is not set -# CONFIG_NFSD_V4 is not set -# CONFIG_NFS_ACL_SUPPORT is not set -CONFIG_NFS_COMMON=y -# CONFIG_NFS_FS is not set -# CONFIG_NFS_FSCACHE is not set -# CONFIG_NFS_SWAP is not set -# CONFIG_NFS_V2 is not set -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -# CONFIG_NFS_V4 is not set -# CONFIG_NFS_V4_1 is not set -# CONFIG_NFTL is not set -# CONFIG_NFT_DUP_IPV4 is not set -# CONFIG_NFT_DUP_IPV6 is not set -# CONFIG_NF_CONNTRACK is not set -# CONFIG_NF_CONNTRACK_AMANDA is not set -CONFIG_NF_CONNTRACK_DSCPREMARK_EXT=y -# CONFIG_NF_CONNTRACK_EVENTS is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set -# CONFIG_NF_CONNTRACK_FTP is not set -# CONFIG_NF_CONNTRACK_H323 is not set -# CONFIG_NF_CONNTRACK_IPV4 is not set -# CONFIG_NF_CONNTRACK_IPV6 is not set -# CONFIG_NF_CONNTRACK_IRC is not set -# CONFIG_NF_CONNTRACK_MARK is not set -# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set -# CONFIG_NF_CONNTRACK_PPTP is not set -CONFIG_NF_CONNTRACK_PROCFS=y -# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set -# CONFIG_NF_CONNTRACK_SANE is not set -# CONFIG_NF_CONNTRACK_SIP is not set -# CONFIG_NF_CONNTRACK_SNMP is not set -# CONFIG_NF_CONNTRACK_TFTP is not set -# CONFIG_NF_CONNTRACK_TIMEOUT is not set -# CONFIG_NF_CONNTRACK_TIMESTAMP is not set -# CONFIG_NF_CONNTRACK_ZONES is not set -# CONFIG_NF_CT_NETLINK is not set -# CONFIG_NF_CT_NETLINK_TIMEOUT is not set -# CONFIG_NF_CT_PROTO_DCCP is not set -# CONFIG_NF_CT_PROTO_GRE is not set -# CONFIG_NF_CT_PROTO_SCTP is not set -# CONFIG_NF_CT_PROTO_UDPLITE is not set -# CONFIG_NF_DEFRAG_IPV4 is not set -# CONFIG_NF_DUP_IPV4 is not set -# CONFIG_NF_DUP_IPV6 is not set -# CONFIG_NF_LOG_ARP is not set -# CONFIG_NF_LOG_IPV4 is not set -# CONFIG_NF_NAT is not set -# CONFIG_NF_NAT_AMANDA is not set -# CONFIG_NF_NAT_FTP is not set -# CONFIG_NF_NAT_H323 is not set -# CONFIG_NF_NAT_IPV6 is not set -# CONFIG_NF_NAT_IRC is not set -# CONFIG_NF_NAT_MASQUERADE_IPV4 is not set -# CONFIG_NF_NAT_MASQUERADE_IPV6 is not set -# CONFIG_NF_NAT_NEEDED is not set -# CONFIG_NF_NAT_PPTP is not set -# CONFIG_NF_NAT_PROTO_GRE is not set -# CONFIG_NF_NAT_SIP is not set -# CONFIG_NF_NAT_SNMP_BASIC is not set -# CONFIG_NF_NAT_TFTP is not set -# CONFIG_NF_REJECT_IPV4 is not set -# CONFIG_NF_TABLES is not set -# CONFIG_NF_TABLES_NETDEV is not set -# CONFIG_NI65 is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_NIU is not set -CONFIG_NLATTR=y -# CONFIG_NLMON is not set -# CONFIG_NLM_XLP_BOARD is not set -# CONFIG_NLM_XLR_BOARD is not set -# CONFIG_NLS is not set -# CONFIG_NLS_ASCII is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -CONFIG_NLS_DEFAULT="iso8859-1" -# CONFIG_NLS_ISO8859_1 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_MAC_CELTIC is not set -# CONFIG_NLS_MAC_CENTEURO is not set -# CONFIG_NLS_MAC_CROATIAN is not set -# CONFIG_NLS_MAC_CYRILLIC is not set -# CONFIG_NLS_MAC_GAELIC is not set -# CONFIG_NLS_MAC_GREEK is not set -# CONFIG_NLS_MAC_ICELAND is not set -# CONFIG_NLS_MAC_INUIT is not set -# CONFIG_NLS_MAC_ROMAN is not set -# CONFIG_NLS_MAC_ROMANIAN is not set -# CONFIG_NLS_MAC_TURKISH is not set -# CONFIG_NLS_UTF8 is not set -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_NORTEL_HERMES is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_NOZOMI is not set -# CONFIG_NO_BOOTMEM is not set -# CONFIG_NO_HZ is not set -# CONFIG_NO_HZ_FULL is not set -# CONFIG_NO_HZ_IDLE is not set -# CONFIG_NS83820 is not set -# CONFIG_NTB is not set -# CONFIG_NTFS_DEBUG is not set -# CONFIG_NTFS_FS is not set -# CONFIG_NTFS_RW is not set -# CONFIG_NTP_PPS is not set -# CONFIG_NVM is not set -# CONFIG_NVMEM is not set -# CONFIG_NVRAM is not set -# CONFIG_NV_TCO is not set -# CONFIG_NXP_STB220 is not set -# CONFIG_NXP_STB225 is not set -# CONFIG_N_GSM is not set -# CONFIG_OABI_COMPAT is not set -# CONFIG_OBS600 is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_OCF_BENCH is not set -# CONFIG_OCF_C7108 is not set -# CONFIG_OCF_CRYPTOCTEON is not set -# CONFIG_OCF_EP80579 is not set -# CONFIG_OCF_HIFN is not set -# CONFIG_OCF_HIFNHIPP is not set -# CONFIG_OCF_IXP4XX is not set -# CONFIG_OCF_KIRKWOOD is not set -# CONFIG_OCF_OCF is not set -# CONFIG_OCF_OCFNULL is not set -# CONFIG_OCF_SAFE is not set -# CONFIG_OCF_TALITOS is not set -# CONFIG_OCF_UBSEC_SSB is not set -# CONFIG_OF_OVERLAY is not set -# CONFIG_OF_UNITTEST is not set -# CONFIG_OMAP2_DSS_DEBUG is not set -# CONFIG_OMAP2_DSS_DEBUGFS is not set -# CONFIG_OMAP2_DSS_SDI is not set -# CONFIG_OMAP_OCP2SCP is not set -# CONFIG_OMAP_USB2 is not set -# CONFIG_OMFS_FS is not set -# CONFIG_OPENVSWITCH is not set -# CONFIG_OPROFILE is not set -# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set -# CONFIG_OPT3001 is not set -# CONFIG_ORION_WATCHDOG is not set -# CONFIG_OSF_PARTITION is not set -CONFIG_OVERLAY_FS=y -# CONFIG_P54_COMMON is not set -# CONFIG_PA12203001 is not set -CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set -# CONFIG_PAGE_EXTENSION is not set -# CONFIG_PAGE_OWNER is not set -# CONFIG_PAGE_POISONING is not set -# CONFIG_PAGE_SIZE_16KB is not set -# CONFIG_PAGE_SIZE_32KB is not set -CONFIG_PAGE_SIZE_4KB=y -# CONFIG_PAGE_SIZE_64KB is not set -# CONFIG_PAGE_SIZE_8KB is not set -# CONFIG_PANASONIC_LAPTOP is not set -# CONFIG_PANEL is not set -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -# CONFIG_PANTHERLORD_FF is not set -# CONFIG_PARPORT is not set -# CONFIG_PARPORT_1284 is not set -# CONFIG_PARPORT_AX88796 is not set -# CONFIG_PARPORT_PC is not set -CONFIG_PARTITION_ADVANCED=y -# CONFIG_PATA_ALI is not set -# CONFIG_PATA_AMD is not set -# CONFIG_PATA_ARASAN_CF is not set -# CONFIG_PATA_ARTOP is not set -# CONFIG_PATA_ATIIXP is not set -# CONFIG_PATA_ATP867X is not set -# CONFIG_PATA_CMD640_PCI is not set -# CONFIG_PATA_CMD64X is not set -# CONFIG_PATA_CS5520 is not set -# CONFIG_PATA_CS5530 is not set -# CONFIG_PATA_CS5535 is not set -# CONFIG_PATA_CS5536 is not set -# CONFIG_PATA_CYPRESS is not set -# CONFIG_PATA_EFAR is not set -# CONFIG_PATA_HPT366 is not set -# CONFIG_PATA_HPT37X is not set -# CONFIG_PATA_HPT3X2N is not set -# CONFIG_PATA_HPT3X3 is not set -# CONFIG_PATA_ISAPNP is not set -# CONFIG_PATA_IT8213 is not set -# CONFIG_PATA_IT821X is not set -# CONFIG_PATA_JMICRON is not set -# CONFIG_PATA_LEGACY is not set -# CONFIG_PATA_MARVELL is not set -# CONFIG_PATA_MPIIX is not set -# CONFIG_PATA_NETCELL is not set -# CONFIG_PATA_NINJA32 is not set -# CONFIG_PATA_NS87410 is not set -# CONFIG_PATA_NS87415 is not set -# CONFIG_PATA_OCTEON_CF is not set -# CONFIG_PATA_OF_PLATFORM is not set -# CONFIG_PATA_OLDPIIX is not set -# CONFIG_PATA_OPTI is not set -# CONFIG_PATA_OPTIDMA is not set -# CONFIG_PATA_PCMCIA is not set -# CONFIG_PATA_PDC2027X is not set -# CONFIG_PATA_PDC_OLD is not set -# CONFIG_PATA_PLATFORM is not set -# CONFIG_PATA_QDI is not set -# CONFIG_PATA_RADISYS is not set -# CONFIG_PATA_RDC is not set -# CONFIG_PATA_RZ1000 is not set -# CONFIG_PATA_SC1200 is not set -# CONFIG_PATA_SCH is not set -# CONFIG_PATA_SERVERWORKS is not set -# CONFIG_PATA_SIL680 is not set -# CONFIG_PATA_SIS is not set -# CONFIG_PATA_TOSHIBA is not set -# CONFIG_PATA_TRIFLEX is not set -# CONFIG_PATA_VIA is not set -# CONFIG_PATA_WINBOND is not set -# CONFIG_PATA_WINBOND_VLB is not set -# CONFIG_PC300TOO is not set -# CONFIG_PCCARD is not set -# CONFIG_PCH_GBE is not set -# CONFIG_PCH_PHUB is not set -# CONFIG_PCI200SYN is not set -# CONFIG_PCIEAER_INJECT is not set -# CONFIG_PCIEASPM is not set -# CONFIG_PCIEPORTBUS is not set -# CONFIG_PCIE_ALTERA is not set -# CONFIG_PCIE_ECRC is not set -# CONFIG_PCIE_IPROC is not set -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_PCI_ATMEL is not set -# CONFIG_PCI_CNB20LE_QUIRK is not set -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set -# CONFIG_PCI_HERMES is not set -# CONFIG_PCI_HOST_GENERIC is not set -# CONFIG_PCI_IOV is not set -# CONFIG_PCI_LAYERSCAPE is not set -# CONFIG_PCI_MSI is not set -# CONFIG_PCI_PASID is not set -# CONFIG_PCI_PRI is not set -CONFIG_PCI_QUIRKS=y -# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set -# CONFIG_PCI_STUB is not set -CONFIG_PCI_SYSCALL=y -# CONFIG_PCMCIA is not set -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_3C589 is not set -# CONFIG_PCMCIA_AHA152X is not set -# CONFIG_PCMCIA_ATMEL is not set -# CONFIG_PCMCIA_AXNET is not set -# CONFIG_PCMCIA_DEBUG is not set -# CONFIG_PCMCIA_FDOMAIN is not set -# CONFIG_PCMCIA_FMVJ18X is not set -# CONFIG_PCMCIA_HERMES is not set -# CONFIG_PCMCIA_LOAD_CIS is not set -# CONFIG_PCMCIA_NINJA_SCSI is not set -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_PCNET is not set -# CONFIG_PCMCIA_QLOGIC is not set -# CONFIG_PCMCIA_RAYCS is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_SPECTRUM is not set -# CONFIG_PCMCIA_SYM53C500 is not set -# CONFIG_PCMCIA_WL3501 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_PCMCIA_XIRCOM is not set -# CONFIG_PCNET32 is not set -# CONFIG_PCSPKR_PLATFORM is not set -# CONFIG_PD6729 is not set -# CONFIG_PDA_POWER is not set -# CONFIG_PDC_ADMA is not set -# CONFIG_PERCPU_TEST is not set -# CONFIG_PERF_EVENTS is not set -# CONFIG_PERSISTENT_KEYRINGS is not set -# CONFIG_PHANTOM is not set -# CONFIG_PHONET is not set -# CONFIG_PHYLIB is not set -# CONFIG_PHYS_ADDR_T_64BIT is not set -# CONFIG_PHY_EXYNOS_DP_VIDEO is not set -# CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set -# CONFIG_PHY_PXA_28NM_HSIC is not set -# CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_PHY_QCOM_DWC3 is not set -# CONFIG_PHY_SAMSUNG_USB2 is not set -# CONFIG_PID_IN_CONTEXTIDR is not set -# CONFIG_PID_NS is not set -CONFIG_PINCONF=y -# CONFIG_PINCTRL is not set -# CONFIG_PINCTRL_AMD is not set -# CONFIG_PINCTRL_EXYNOS is not set -# CONFIG_PINCTRL_EXYNOS5440 is not set -# CONFIG_PINCTRL_MSM8X74 is not set -CONFIG_PINCTRL_SINGLE=y -CONFIG_PINMUX=y -# CONFIG_PL320_MBOX is not set -# CONFIG_PLAT_SPEAR is not set -# CONFIG_PLIP is not set -# CONFIG_PLX_HERMES is not set -# CONFIG_PM is not set -# CONFIG_PMBUS is not set -# CONFIG_PMC_MSP is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_PM_AUTOSLEEP is not set -# CONFIG_PM_DEVFREQ is not set -# CONFIG_PM_WAKELOCKS is not set -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_POWERCAP is not set -# CONFIG_POWER_AVS is not set -# CONFIG_POWER_RESET is not set -# CONFIG_POWER_RESET_BRCMSTB is not set -# CONFIG_POWER_RESET_GPIO is not set -# CONFIG_POWER_RESET_GPIO_RESTART is not set -# CONFIG_POWER_RESET_LTC2952 is not set -# CONFIG_POWER_RESET_RESTART is not set -# CONFIG_POWER_RESET_SYSCON is not set -# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set -# CONFIG_POWER_RESET_VERSATILE is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_POWER_SUPPLY_DEBUG is not set -# CONFIG_PPC4xx_GPIO is not set -# CONFIG_PPC_16K_PAGES is not set -# CONFIG_PPC_256K_PAGES is not set -CONFIG_PPC_4K_PAGES=y -# CONFIG_PPC_64K_PAGES is not set -# CONFIG_PPC_DISABLE_WERROR is not set -# CONFIG_PPC_EMULATED_STATS is not set -# CONFIG_PPC_EPAPR_HV_BYTECHAN is not set -# CONFIG_PPP is not set -# CONFIG_PPPOATM is not set -# CONFIG_PPPOE is not set -# CONFIG_PPPOL2TP is not set -# CONFIG_PPP_ASYNC is not set -# CONFIG_PPP_BSDCOMP is not set -# CONFIG_PPP_DEFLATE is not set -CONFIG_PPP_FILTER=y -# CONFIG_PPP_MPPE is not set -CONFIG_PPP_MULTILINK=y -# CONFIG_PPP_SYNC_TTY is not set -# CONFIG_PPS is not set -# CONFIG_PPS_CLIENT_GPIO is not set -# CONFIG_PPS_CLIENT_KTIMER is not set -# CONFIG_PPS_CLIENT_LDISC is not set -# CONFIG_PPS_CLIENT_PARPORT is not set -# CONFIG_PPS_DEBUG is not set -# CONFIG_PPTP is not set -# CONFIG_PREEMPT is not set -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_TRACER is not set -# CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_PRINTK=y -# CONFIG_PRINTK_TIME is not set -CONFIG_PRINT_STACK_DEPTH=64 -# CONFIG_PRISM2_USB is not set -# CONFIG_PRISM54 is not set -# CONFIG_PROC_CHILDREN is not set -CONFIG_PROC_FS=y -# CONFIG_PROC_KCORE is not set -# CONFIG_PROC_PAGE_MONITOR is not set -CONFIG_PROC_STRIPPED=y -CONFIG_PROC_SYSCTL=y -# CONFIG_PROFILE_ALL_BRANCHES is not set -# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set -# CONFIG_PROFILING is not set -# CONFIG_PROVE_LOCKING is not set -# CONFIG_PROVE_RCU is not set -# CONFIG_PROVE_RCU_REPEATEDLY is not set -# CONFIG_PSB6970_PHY is not set -# CONFIG_PSTORE is not set -# CONFIG_PTP_1588_CLOCK is not set -# CONFIG_PTP_1588_CLOCK_IXP46X is not set -# CONFIG_PTP_1588_CLOCK_PCH is not set -# CONFIG_PWM is not set -# CONFIG_PWM_FSL_FTM is not set -# CONFIG_PWM_PCA9685 is not set -# CONFIG_QCA7000 is not set -# CONFIG_QCOM_SPMI_IADC is not set -# CONFIG_QCOM_SPMI_VADC is not set -# CONFIG_QED is not set -# CONFIG_QLA3XXX is not set -# CONFIG_QLCNIC is not set -# CONFIG_QLGE is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_QORIQ_CPUFREQ is not set -# CONFIG_QSEMI_PHY is not set -# CONFIG_QUOTA is not set -# CONFIG_QUOTACTL is not set -# CONFIG_QUOTA_DEBUG is not set -# CONFIG_R3964 is not set -# CONFIG_R6040 is not set -# CONFIG_R8169 is not set -# CONFIG_R8188EU is not set -# CONFIG_R8712U is not set -# CONFIG_R8723AU is not set -# CONFIG_RADIO_ADAPTERS is not set -# CONFIG_RADIO_AZTECH is not set -# CONFIG_RADIO_CADET is not set -# CONFIG_RADIO_GEMTEK is not set -# CONFIG_RADIO_MAXIRADIO is not set -# CONFIG_RADIO_RTRACK is not set -# CONFIG_RADIO_RTRACK2 is not set -# CONFIG_RADIO_SF16FMI is not set -# CONFIG_RADIO_SF16FMR2 is not set -# CONFIG_RADIO_TERRATEC is not set -# CONFIG_RADIO_TRUST is not set -# CONFIG_RADIO_TYPHOON is not set -# CONFIG_RADIO_ZOLTRIX is not set -# CONFIG_RAID_ATTRS is not set -# CONFIG_RALINK is not set -# CONFIG_RANDOM32_SELFTEST is not set -# CONFIG_RAPIDIO is not set -# CONFIG_RAS is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_RBTREE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=60 -# CONFIG_RCU_EQS_DEBUG is not set -# CONFIG_RCU_EXPEDITE_BOOT is not set -CONFIG_RCU_EXPERT=y -CONFIG_RCU_FANOUT=32 -CONFIG_RCU_FANOUT_LEAF=16 -# CONFIG_RCU_FAST_NO_HZ is not set -CONFIG_RCU_KTHREAD_PRIO=0 -# CONFIG_RCU_NOCB_CPU is not set -# CONFIG_RCU_TORTURE_TEST is not set -CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 -# CONFIG_RCU_TRACE is not set -# CONFIG_RC_ATI_REMOTE is not set -# CONFIG_RC_CORE is not set -# CONFIG_RC_DECODERS is not set -# CONFIG_RC_LOOPBACK is not set -# CONFIG_RC_MAP is not set -# CONFIG_RDS is not set -# CONFIG_RD_BZIP2 is not set -# CONFIG_RD_GZIP is not set -# CONFIG_RD_LZ4 is not set -# CONFIG_RD_LZMA is not set -# CONFIG_RD_LZO is not set -# CONFIG_RD_XZ is not set -# CONFIG_READABLE_ASM is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_REDWOOD is not set -# CONFIG_REGMAP is not set -# CONFIG_REGMAP_I2C is not set -# CONFIG_REGMAP_MMIO is not set -# CONFIG_REGMAP_SPI is not set -# CONFIG_REGULATOR is not set -# CONFIG_REGULATOR_ACT8865 is not set -# CONFIG_REGULATOR_AD5398 is not set -# CONFIG_REGULATOR_ANATOP is not set -# CONFIG_REGULATOR_DA9210 is not set -# CONFIG_REGULATOR_DA9211 is not set -# CONFIG_REGULATOR_DEBUG is not set -# CONFIG_REGULATOR_FAN53555 is not set -# CONFIG_REGULATOR_FIXED_VOLTAGE is not set -# CONFIG_REGULATOR_GPIO is not set -# CONFIG_REGULATOR_ISL6271A is not set -# CONFIG_REGULATOR_ISL9305 is not set -# CONFIG_REGULATOR_LP3971 is not set -# CONFIG_REGULATOR_LP3972 is not set -# CONFIG_REGULATOR_LP872X is not set -# CONFIG_REGULATOR_LP8755 is not set -# CONFIG_REGULATOR_LTC3589 is not set -# CONFIG_REGULATOR_MAX1586 is not set -# CONFIG_REGULATOR_MAX8649 is not set -# CONFIG_REGULATOR_MAX8660 is not set -# CONFIG_REGULATOR_MAX8952 is not set -# CONFIG_REGULATOR_MAX8973 is not set -# CONFIG_REGULATOR_MT6311 is not set -# CONFIG_REGULATOR_PFUZE100 is not set -# CONFIG_REGULATOR_PWM is not set -# CONFIG_REGULATOR_TI_ABB is not set -# CONFIG_REGULATOR_TPS51632 is not set -# CONFIG_REGULATOR_TPS62360 is not set -# CONFIG_REGULATOR_TPS65023 is not set -# CONFIG_REGULATOR_TPS6507X is not set -# CONFIG_REGULATOR_TPS6524X is not set -# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set -# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set -# CONFIG_REISERFS_CHECK is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_REISERFS_FS_POSIX_ACL is not set -# CONFIG_REISERFS_FS_SECURITY is not set -# CONFIG_REISERFS_FS_XATTR is not set -# CONFIG_REISERFS_PROC_INFO is not set -# CONFIG_RELAY is not set -# CONFIG_RESET_CONTROLLER is not set -# CONFIG_RFD_FTL is not set -# CONFIG_RFKILL is not set -# CONFIG_RFKILL_INPUT is not set -# CONFIG_RFKILL_REGULATOR is not set -# CONFIG_RING_BUFFER_BENCHMARK is not set -# CONFIG_RING_BUFFER_STARTUP_TEST is not set -# CONFIG_ROCKER is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_ROSE is not set -# CONFIG_RPCSEC_GSS_KRB5 is not set -# CONFIG_RPR0521 is not set -# CONFIG_RT2X00 is not set -# CONFIG_RTC_CLASS is not set -# CONFIG_RTC_DEBUG is not set -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_ARMADA38X is not set -# CONFIG_RTC_DRV_AU1XXX is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_BQ4802 is not set -CONFIG_RTC_DRV_CMOS=y -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1305 is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1343 is not set -# CONFIG_RTC_DRV_DS1347 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1390 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -# CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_DS3234 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_EP93XX is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_GENERIC is not set -# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set -# CONFIG_RTC_DRV_HYM8563 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_ISL12057 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_M41T93 is not set -# CONFIG_RTC_DRV_M41T94 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_MCP795 is not set -# CONFIG_RTC_DRV_MOXART is not set -# CONFIG_RTC_DRV_MPC5121 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_OMAP is not set -# CONFIG_RTC_DRV_PCF2123 is not set -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_PL030 is not set -# CONFIG_RTC_DRV_PL031 is not set -# CONFIG_RTC_DRV_PS3 is not set -# CONFIG_RTC_DRV_PT7C4338 is not set -# CONFIG_RTC_DRV_R9701 is not set -# CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_RTC7301 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set -# CONFIG_RTC_DRV_RV8803 is not set -# CONFIG_RTC_DRV_RX4581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_SNVS is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_SUN6I is not set -# CONFIG_RTC_DRV_TEST is not set -# CONFIG_RTC_DRV_V3020 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_XGENE is not set -# CONFIG_RTC_DRV_ZYNQMP is not set -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_LIB=y -CONFIG_RTC_SYSTOHC=y -CONFIG_RTC_SYSTOHC_DEVICE="rtc0" -# CONFIG_RTL8180 is not set -# CONFIG_RTL8187 is not set -# CONFIG_RTL8192E is not set -# CONFIG_RTL8192U is not set -# CONFIG_RTL8306_PHY is not set -# CONFIG_RTL8366RB_PHY is not set -# CONFIG_RTL8366S_PHY is not set -# CONFIG_RTL8366_SMI is not set -# CONFIG_RTL8366_SMI_DEBUG_FS is not set -# CONFIG_RTL8367B_PHY is not set -# CONFIG_RTL8367_PHY is not set -# CONFIG_RTLLIB is not set -# CONFIG_RTL_CARDS is not set -# CONFIG_RTS5208 is not set -CONFIG_RT_MUTEXES=y -# CONFIG_RUNTIME_DEBUG is not set -CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_S2IO is not set -# CONFIG_SAMPLES is not set -# CONFIG_SAMSUNG_LAPTOP is not set -# CONFIG_SATA_ACARD_AHCI is not set -# CONFIG_SATA_AHCI is not set -# CONFIG_SATA_AHCI_PLATFORM is not set -# CONFIG_SATA_DWC is not set -# CONFIG_SATA_FSL is not set -# CONFIG_SATA_HIGHBANK is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_SATA_MV is not set -# CONFIG_SATA_NV is not set -# CONFIG_SATA_PMP is not set -# CONFIG_SATA_PROMISE is not set -# CONFIG_SATA_QSTOR is not set -# CONFIG_SATA_RCAR is not set -# CONFIG_SATA_SIL is not set -# CONFIG_SATA_SIL24 is not set -# CONFIG_SATA_SIS is not set -# CONFIG_SATA_SVW is not set -# CONFIG_SATA_SX4 is not set -# CONFIG_SATA_ULI is not set -# CONFIG_SATA_VIA is not set -# CONFIG_SATA_VITESSE is not set -# CONFIG_SBC_FITPC2_WATCHDOG is not set -# CONFIG_SC92031 is not set -# CONFIG_SCA3000 is not set -# CONFIG_SCACHE_DEBUGFS is not set -# CONFIG_SCC is not set -# CONFIG_SCHEDSTATS is not set -# CONFIG_SCHED_AUTOGROUP is not set -# CONFIG_SCHED_DEBUG is not set -# CONFIG_SCHED_MC is not set -CONFIG_SCHED_OMIT_FRAME_POINTER=y -# CONFIG_SCHED_SMT is not set -# CONFIG_SCHED_STACK_END_CHECK is not set -# CONFIG_SCHED_TRACER is not set -# CONFIG_SCSI is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_3W_SAS is not set -# CONFIG_SCSI_7000FASST is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_ADVANSYS is not set -# CONFIG_SCSI_AHA152X is not set -# CONFIG_SCSI_AHA1542 is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC94XX is not set -# CONFIG_SCSI_AM53C974 is not set -# CONFIG_SCSI_ARCMSR is not set -# CONFIG_SCSI_BFA_FC is not set -# CONFIG_SCSI_BNX2X_FCOE is not set -# CONFIG_SCSI_BNX2_ISCSI is not set -# CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_CHELSIO_FCOE is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_CXGB3_ISCSI is not set -# CONFIG_SCSI_CXGB4_ISCSI is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_DH is not set -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_DTC3280 is not set -# CONFIG_SCSI_EATA is not set -# CONFIG_SCSI_ESAS2R is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_GDTH is not set -# CONFIG_SCSI_GENERIC_NCR5380 is not set -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set -# CONFIG_SCSI_HPSA is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_SCSI_IN2000 is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_ISCI is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_LOGGING is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set -# CONFIG_SCSI_LPFC is not set -CONFIG_SCSI_MOD=y -# CONFIG_SCSI_MPT2SAS is not set -# CONFIG_SCSI_MPT3SAS is not set -# CONFIG_SCSI_MQ_DEFAULT is not set -# CONFIG_SCSI_MVSAS is not set -# CONFIG_SCSI_MVSAS_DEBUG is not set -# CONFIG_SCSI_MVUMI is not set -# CONFIG_SCSI_NCR53C406A is not set -# CONFIG_SCSI_NETLINK is not set -# CONFIG_SCSI_NSP32 is not set -# CONFIG_SCSI_OSD_INITIATOR is not set -# CONFIG_SCSI_PAS16 is not set -# CONFIG_SCSI_PM8001 is not set -# CONFIG_SCSI_PMCRAID is not set -CONFIG_SCSI_PROC_FS=y -# CONFIG_SCSI_QLA_FC is not set -# CONFIG_SCSI_QLA_ISCSI is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLOGIC_FAS is not set -# CONFIG_SCSI_SAS_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SCAN_ASYNC is not set -# CONFIG_SCSI_SNIC is not set -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -# CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C416 is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_T128 is not set -# CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_UFSHCD is not set -# CONFIG_SCSI_ULTRASTOR is not set -# CONFIG_SCSI_VIRTIO is not set -# CONFIG_SCSI_WD719X is not set -# CONFIG_SCx200_ACB is not set -# CONFIG_SDIO_UART is not set -# CONFIG_SECCOMP is not set -CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_SECURITY is not set -# CONFIG_SECURITYFS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -CONFIG_SELECT_MEMORY_MODEL=y -# CONFIG_SENSORS_ABITUGURU is not set -# CONFIG_SENSORS_ABITUGURU3 is not set -# CONFIG_SENSORS_ACPI_POWER is not set -# CONFIG_SENSORS_AD7314 is not set -# CONFIG_SENSORS_AD7414 is not set -# CONFIG_SENSORS_AD7418 is not set -# CONFIG_SENSORS_ADC128D818 is not set -# CONFIG_SENSORS_ADCXX is not set -# CONFIG_SENSORS_ADM1021 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADS1015 is not set -# CONFIG_SENSORS_ADS7828 is not set -# CONFIG_SENSORS_ADS7871 is not set -# CONFIG_SENSORS_ADT7310 is not set -# CONFIG_SENSORS_ADT7410 is not set -# CONFIG_SENSORS_ADT7411 is not set -# CONFIG_SENSORS_ADT7462 is not set -# CONFIG_SENSORS_ADT7470 is not set -# CONFIG_SENSORS_ADT7475 is not set -# CONFIG_SENSORS_AMC6821 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_SENSORS_APPLESMC is not set -# CONFIG_SENSORS_ASB100 is not set -# CONFIG_SENSORS_ASC7621 is not set -# CONFIG_SENSORS_ATK0110 is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_BH1780 is not set -# CONFIG_SENSORS_CORETEMP is not set -# CONFIG_SENSORS_DELL_SMM is not set -# CONFIG_SENSORS_DME1737 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_DS620 is not set -# CONFIG_SENSORS_EMC1403 is not set -# CONFIG_SENSORS_EMC2103 is not set -# CONFIG_SENSORS_EMC6W201 is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_F75375S is not set -# CONFIG_SENSORS_FAM15H_POWER is not set -# CONFIG_SENSORS_FSCHMD is not set -# CONFIG_SENSORS_G760A is not set -# CONFIG_SENSORS_G762 is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_GPIO_FAN is not set -# CONFIG_SENSORS_GSC is not set -# CONFIG_SENSORS_HDAPS is not set -# CONFIG_SENSORS_HIH6130 is not set -# CONFIG_SENSORS_HMC5843 is not set -# CONFIG_SENSORS_HMC5843_I2C is not set -# CONFIG_SENSORS_HMC5843_SPI is not set -# CONFIG_SENSORS_HTU21 is not set -# CONFIG_SENSORS_I5500 is not set -# CONFIG_SENSORS_I5K_AMB is not set -# CONFIG_SENSORS_IIO_HWMON is not set -# CONFIG_SENSORS_INA209 is not set -# CONFIG_SENSORS_INA2XX is not set -# CONFIG_SENSORS_ISL29018 is not set -# CONFIG_SENSORS_ISL29028 is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_JC42 is not set -# CONFIG_SENSORS_K10TEMP is not set -# CONFIG_SENSORS_K8TEMP is not set -# CONFIG_SENSORS_LINEAGE is not set -# CONFIG_SENSORS_LIS3LV02D is not set -# CONFIG_SENSORS_LIS3_I2C is not set -# CONFIG_SENSORS_LIS3_SPI is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM70 is not set -# CONFIG_SENSORS_LM73 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_LM93 is not set -# CONFIG_SENSORS_LM95234 is not set -# CONFIG_SENSORS_LM95241 is not set -# CONFIG_SENSORS_LM95245 is not set -# CONFIG_SENSORS_LTC2945 is not set -# CONFIG_SENSORS_LTC4151 is not set -# CONFIG_SENSORS_LTC4215 is not set -# CONFIG_SENSORS_LTC4222 is not set -# CONFIG_SENSORS_LTC4245 is not set -# CONFIG_SENSORS_LTC4260 is not set -# CONFIG_SENSORS_LTC4261 is not set -# CONFIG_SENSORS_MAX1111 is not set -# CONFIG_SENSORS_MAX16065 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_MAX1668 is not set -# CONFIG_SENSORS_MAX197 is not set -# CONFIG_SENSORS_MAX31790 is not set -# CONFIG_SENSORS_MAX6639 is not set -# CONFIG_SENSORS_MAX6642 is not set -# CONFIG_SENSORS_MAX6650 is not set -# CONFIG_SENSORS_MAX6697 is not set -# CONFIG_SENSORS_MCP3021 is not set -# CONFIG_SENSORS_NCT6683 is not set -# CONFIG_SENSORS_NCT6775 is not set -# CONFIG_SENSORS_NCT7802 is not set -# CONFIG_SENSORS_NCT7904 is not set -# CONFIG_SENSORS_NTC_THERMISTOR is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_POWR1220 is not set -# CONFIG_SENSORS_PWM_FAN is not set -# CONFIG_SENSORS_SCH5627 is not set -# CONFIG_SENSORS_SCH5636 is not set -# CONFIG_SENSORS_SCH56XX_COMMON is not set -# CONFIG_SENSORS_SHT15 is not set -# CONFIG_SENSORS_SHT21 is not set -# CONFIG_SENSORS_SHTC1 is not set -# CONFIG_SENSORS_SIS5595 is not set -# CONFIG_SENSORS_SMM665 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_TC74 is not set -# CONFIG_SENSORS_THMC50 is not set -# CONFIG_SENSORS_TMP102 is not set -# CONFIG_SENSORS_TMP103 is not set -# CONFIG_SENSORS_TMP401 is not set -# CONFIG_SENSORS_TMP421 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_TSL2563 is not set -# CONFIG_SENSORS_VEXPRESS is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_VIA_CPUTEMP is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_VT8231 is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set -# CONFIG_SENSORS_W83795 is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83L786NG is not set -CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_ACCENT is not set -# CONFIG_SERIAL_8250_BOCA is not set -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set -# CONFIG_SERIAL_8250_DETECT_IRQ is not set -CONFIG_SERIAL_8250_DMA=y -# CONFIG_SERIAL_8250_DW is not set -# CONFIG_SERIAL_8250_EM is not set -# CONFIG_SERIAL_8250_EXAR_ST16C554 is not set -# CONFIG_SERIAL_8250_EXTENDED is not set -# CONFIG_SERIAL_8250_FINTEK is not set -# CONFIG_SERIAL_8250_FOURPORT is not set -# CONFIG_SERIAL_8250_HUB6 is not set -# CONFIG_SERIAL_8250_INGENIC is not set -# CONFIG_SERIAL_8250_MANY_PORTS is not set -# CONFIG_SERIAL_8250_MID is not set -CONFIG_SERIAL_8250_NR_UARTS=2 -# CONFIG_SERIAL_8250_PCI is not set -# CONFIG_SERIAL_8250_RSA is not set -# CONFIG_SERIAL_8250_RT288X is not set -CONFIG_SERIAL_8250_RUNTIME_UARTS=2 -# CONFIG_SERIAL_8250_SYSRQ is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_BCM63XX is not set -# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_SERIAL_EARLYCON=y -# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set -# CONFIG_SERIAL_IFX6X60 is not set -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_MAX3100 is not set -# CONFIG_SERIAL_MAX310X is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_SERIAL_OF_PLATFORM is not set -# CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL is not set -# CONFIG_SERIAL_PCH_UART is not set -# CONFIG_SERIAL_RP2 is not set -# CONFIG_SERIAL_SC16IS7XX is not set -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_SH_SCI is not set -# CONFIG_SERIAL_STM32 is not set -# CONFIG_SERIAL_ST_ASC is not set -# CONFIG_SERIAL_TIMBERDALE is not set -# CONFIG_SERIAL_UARTLITE is not set -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_SERIO is not set -# CONFIG_SERIO_ALTERA_PS2 is not set -# CONFIG_SERIO_AMBAKMI is not set -# CONFIG_SERIO_APBPS2 is not set -# CONFIG_SERIO_ARC_PS2 is not set -# CONFIG_SERIO_I8042 is not set -# CONFIG_SERIO_LIBPS2 is not set -# CONFIG_SERIO_PARKBD is not set -# CONFIG_SERIO_PCIPS2 is not set -# CONFIG_SERIO_PS2MULT is not set -# CONFIG_SERIO_RAW is not set -# CONFIG_SERIO_SERPORT is not set -# CONFIG_SERIO_SUN4I_PS2 is not set -# CONFIG_SFC is not set -# CONFIG_SFI is not set -# CONFIG_SGETMASK_SYSCALL is not set -# CONFIG_SG_SPLIT is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP27 is not set -# CONFIG_SGI_IP28 is not set -# CONFIG_SGI_IP32 is not set -# CONFIG_SGI_PARTITION is not set -CONFIG_SHMEM=y -# CONFIG_SH_ETH is not set -# CONFIG_SH_TIMER_CMT is not set -# CONFIG_SH_TIMER_MTU2 is not set -# CONFIG_SH_TIMER_TMU is not set -# CONFIG_SI7005 is not set -# CONFIG_SI7020 is not set -# CONFIG_SIBYTE_BIGSUR is not set -# CONFIG_SIBYTE_CARMEL is not set -# CONFIG_SIBYTE_CRHINE is not set -# CONFIG_SIBYTE_CRHONE is not set -# CONFIG_SIBYTE_LITTLESUR is not set -# CONFIG_SIBYTE_RHONE is not set -# CONFIG_SIBYTE_SENTOSA is not set -# CONFIG_SIBYTE_SWARM is not set -CONFIG_SIGNALFD=y -# CONFIG_SIMPLE_GPIO is not set -# CONFIG_SIS190 is not set -# CONFIG_SIS900 is not set -# CONFIG_SKGE is not set -# CONFIG_SKY2 is not set -# CONFIG_SKY2_DEBUG is not set -# CONFIG_SLAB is not set -CONFIG_SLABINFO=y -# CONFIG_SLHC is not set -# CONFIG_SLICOSS is not set -# CONFIG_SLIP is not set -# CONFIG_SLOB is not set -CONFIG_SLUB=y -CONFIG_SLUB_CPU_PARTIAL=y -# CONFIG_SLUB_DEBUG is not set -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_SLUB_STATS is not set -# CONFIG_SMARTJOYPLUS_FF is not set -# CONFIG_SMC911X is not set -# CONFIG_SMC9194 is not set -# CONFIG_SMC91X is not set -# CONFIG_SMP is not set -# CONFIG_SMSC911X is not set -# CONFIG_SMSC9420 is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_SM_FTL is not set -# CONFIG_SND is not set -# CONFIG_SND_AC97_POWER_SAVE is not set -# CONFIG_SND_AD1816A is not set -# CONFIG_SND_AD1848 is not set -# CONFIG_SND_AD1889 is not set -# CONFIG_SND_ADLIB is not set -# CONFIG_SND_ALI5451 is not set -# CONFIG_SND_ALOOP is not set -# CONFIG_SND_ALS100 is not set -# CONFIG_SND_ALS300 is not set -# CONFIG_SND_ALS4000 is not set -# CONFIG_SND_ARM is not set -# CONFIG_SND_ASIHPI is not set -# CONFIG_SND_ATIIXP is not set -# CONFIG_SND_ATIIXP_MODEM is not set -# CONFIG_SND_ATMEL_AC97C is not set -# CONFIG_SND_ATMEL_SOC is not set -# CONFIG_SND_AU8810 is not set -# CONFIG_SND_AU8820 is not set -# CONFIG_SND_AU8830 is not set -# CONFIG_SND_AW2 is not set -# CONFIG_SND_AZT2320 is not set -# CONFIG_SND_AZT3328 is not set -# CONFIG_SND_BCD2000 is not set -# CONFIG_SND_BT87X is not set -# CONFIG_SND_CA0106 is not set -# CONFIG_SND_CMI8330 is not set -# CONFIG_SND_CMIPCI is not set -# CONFIG_SND_CS4231 is not set -# CONFIG_SND_CS4236 is not set -# CONFIG_SND_CS4281 is not set -# CONFIG_SND_CS46XX is not set -# CONFIG_SND_CS5530 is not set -# CONFIG_SND_CS5535AUDIO is not set -# CONFIG_SND_CTXFI is not set -# CONFIG_SND_DARLA20 is not set -# CONFIG_SND_DARLA24 is not set -# CONFIG_SND_DEBUG is not set -# CONFIG_SND_DESIGNWARE_I2S is not set -CONFIG_SND_DRIVERS=y -# CONFIG_SND_DUMMY is not set -# CONFIG_SND_DYNAMIC_MINORS is not set -# CONFIG_SND_ECHO3G is not set -# CONFIG_SND_EMU10K1 is not set -# CONFIG_SND_EMU10K1_SEQ is not set -# CONFIG_SND_EMU10K1X is not set -# CONFIG_SND_ENS1370 is not set -# CONFIG_SND_ENS1371 is not set -# CONFIG_SND_ES1688 is not set -# CONFIG_SND_ES18XX is not set -# CONFIG_SND_ES1938 is not set -# CONFIG_SND_ES1968 is not set -# CONFIG_SND_FIREWIRE is not set -# CONFIG_SND_FM801 is not set -# CONFIG_SND_GINA20 is not set -# CONFIG_SND_GINA24 is not set -# CONFIG_SND_GUSCLASSIC is not set -# CONFIG_SND_GUSEXTREME is not set -# CONFIG_SND_GUSMAX is not set -# CONFIG_SND_HDA_INTEL is not set -CONFIG_SND_HDA_PREALLOC_SIZE=64 -# CONFIG_SND_HDSP is not set -# CONFIG_SND_HDSPM is not set -# CONFIG_SND_HRTIMER is not set -# CONFIG_SND_HWDEP is not set -# CONFIG_SND_ICE1712 is not set -# CONFIG_SND_ICE1724 is not set -# CONFIG_SND_INDIGO is not set -# CONFIG_SND_INDIGODJ is not set -# CONFIG_SND_INDIGODJX is not set -# CONFIG_SND_INDIGOIO is not set -# CONFIG_SND_INDIGOIOX is not set -# CONFIG_SND_INTEL8X0 is not set -# CONFIG_SND_INTEL8X0M is not set -# CONFIG_SND_INTERWAVE is not set -# CONFIG_SND_INTERWAVE_STB is not set -# CONFIG_SND_ISA is not set -# CONFIG_SND_KIRKWOOD_SOC is not set -# CONFIG_SND_KORG1212 is not set -# CONFIG_SND_LAYLA20 is not set -# CONFIG_SND_LAYLA24 is not set -# CONFIG_SND_LOLA is not set -# CONFIG_SND_LX6464ES is not set -# CONFIG_SND_MAESTRO3 is not set -# CONFIG_SND_MIA is not set -# CONFIG_SND_MIPS is not set -# CONFIG_SND_MIRO is not set -# CONFIG_SND_MIXART is not set -# CONFIG_SND_MIXER_OSS is not set -# CONFIG_SND_MONA is not set -# CONFIG_SND_MPC52xx_SOC_EFIKA is not set -# CONFIG_SND_MPU401 is not set -# CONFIG_SND_MTPAV is not set -# CONFIG_SND_MTS64 is not set -# CONFIG_SND_MXS_SOC is not set -# CONFIG_SND_NM256 is not set -# CONFIG_SND_OPL3SA2 is not set -# CONFIG_SND_OPL3_LIB_SEQ is not set -# CONFIG_SND_OPL4_LIB_SEQ is not set -# CONFIG_SND_OPTI92X_AD1848 is not set -# CONFIG_SND_OPTI92X_CS4231 is not set -# CONFIG_SND_OPTI93X is not set -CONFIG_SND_OSSEMUL=y -# CONFIG_SND_OXYGEN is not set -CONFIG_SND_PCI=y -# CONFIG_SND_PCM is not set -# CONFIG_SND_PCMCIA is not set -# CONFIG_SND_PCM_OSS is not set -CONFIG_SND_PCM_OSS_PLUGINS=y -# CONFIG_SND_PCM_TIMER is not set -# CONFIG_SND_PCXHR is not set -# CONFIG_SND_PDAUDIOCF is not set -# CONFIG_SND_PORTMAN2X4 is not set -# CONFIG_SND_POWERPC_SOC is not set -# CONFIG_SND_PPC is not set -# CONFIG_SND_PROC_FS is not set -# CONFIG_SND_RAWMIDI is not set -# CONFIG_SND_RAWMIDI_SEQ is not set -# CONFIG_SND_RIPTIDE is not set -# CONFIG_SND_RME32 is not set -# CONFIG_SND_RME96 is not set -# CONFIG_SND_RME9652 is not set -# CONFIG_SND_RTCTIMER is not set -# CONFIG_SND_SB16 is not set -# CONFIG_SND_SB8 is not set -# CONFIG_SND_SBAWE is not set -# CONFIG_SND_SBAWE_SEQ is not set -# CONFIG_SND_SE6X is not set -# CONFIG_SND_SEQUENCER is not set -# CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_SIMPLE_CARD is not set -# CONFIG_SND_SIS7019 is not set -# CONFIG_SND_SOC is not set -# CONFIG_SND_SOC_AC97_CODEC is not set -# CONFIG_SND_SOC_ADAU1701 is not set -# CONFIG_SND_SOC_AK4104 is not set -# CONFIG_SND_SOC_AK4554 is not set -# CONFIG_SND_SOC_AK4613 is not set -# CONFIG_SND_SOC_AK4642 is not set -# CONFIG_SND_SOC_AK5386 is not set -# CONFIG_SND_SOC_ALC5623 is not set -# CONFIG_SND_SOC_AU1XAUDIO is not set -# CONFIG_SND_SOC_AU1XPSC is not set -# CONFIG_SND_SOC_CS35L32 is not set -# CONFIG_SND_SOC_CS4265 is not set -# CONFIG_SND_SOC_CS4270 is not set -# CONFIG_SND_SOC_CS4271 is not set -# CONFIG_SND_SOC_CS4271_I2C is not set -# CONFIG_SND_SOC_CS4271_SPI is not set -# CONFIG_SND_SOC_CS42L51_I2C is not set -# CONFIG_SND_SOC_CS42L52 is not set -# CONFIG_SND_SOC_CS42L56 is not set -# CONFIG_SND_SOC_CS42L73 is not set -# CONFIG_SND_SOC_CS42XX8_I2C is not set -# CONFIG_SND_SOC_CS4349 is not set -# CONFIG_SND_SOC_ES8328 is not set -# CONFIG_SND_SOC_EUKREA_TLV320 is not set -# CONFIG_SND_SOC_FSL_ASOC_CARD is not set -# CONFIG_SND_SOC_FSL_ASRC is not set -# CONFIG_SND_SOC_FSL_ESAI is not set -# CONFIG_SND_SOC_FSL_SAI is not set -# CONFIG_SND_SOC_FSL_SPDIF is not set -# CONFIG_SND_SOC_FSL_SSI is not set -# CONFIG_SND_SOC_GTM601 is not set -# CONFIG_SND_SOC_IMX_AUDMUX is not set -# CONFIG_SND_SOC_IMX_ES8328 is not set -# CONFIG_SND_SOC_IMX_SPDIF is not set -# CONFIG_SND_SOC_IMX_WM8962 is not set -# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set -# CONFIG_SND_SOC_INTEL_SKL_RT286_MACH is not set -# CONFIG_SND_SOC_INTEL_SST is not set -# CONFIG_SND_SOC_MEDIATEK is not set -# CONFIG_SND_SOC_MPC5200_AC97 is not set -# CONFIG_SND_SOC_MPC5200_I2S is not set -# CONFIG_SND_SOC_PCM1681 is not set -# CONFIG_SND_SOC_PCM1792A is not set -# CONFIG_SND_SOC_PCM512x_I2C is not set -# CONFIG_SND_SOC_PCM512x_SPI is not set -# CONFIG_SND_SOC_QCOM is not set -# CONFIG_SND_SOC_RT5631 is not set -# CONFIG_SND_SOC_RT5677_SPI is not set -# CONFIG_SND_SOC_SGTL5000 is not set -# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set -# CONFIG_SND_SOC_SPDIF is not set -# CONFIG_SND_SOC_SSM2602_I2C is not set -# CONFIG_SND_SOC_SSM2602_SPI is not set -# CONFIG_SND_SOC_SSM4567 is not set -# CONFIG_SND_SOC_STA32X is not set -# CONFIG_SND_SOC_STA350 is not set -# CONFIG_SND_SOC_STI_SAS is not set -# CONFIG_SND_SOC_TAS2552 is not set -# CONFIG_SND_SOC_TAS5086 is not set -# CONFIG_SND_SOC_TAS571X is not set -# CONFIG_SND_SOC_TFA9879 is not set -# CONFIG_SND_SOC_TLV320AIC23_I2C is not set -# CONFIG_SND_SOC_TLV320AIC23_SPI is not set -# CONFIG_SND_SOC_TLV320AIC31XX is not set -# CONFIG_SND_SOC_TLV320AIC3X is not set -# CONFIG_SND_SOC_TPA6130A2 is not set -# CONFIG_SND_SOC_TS3A227E is not set -# CONFIG_SND_SOC_WM8510 is not set -# CONFIG_SND_SOC_WM8523 is not set -# CONFIG_SND_SOC_WM8580 is not set -# CONFIG_SND_SOC_WM8711 is not set -# CONFIG_SND_SOC_WM8728 is not set -# CONFIG_SND_SOC_WM8731 is not set -# CONFIG_SND_SOC_WM8737 is not set -# CONFIG_SND_SOC_WM8741 is not set -# CONFIG_SND_SOC_WM8750 is not set -# CONFIG_SND_SOC_WM8753 is not set -# CONFIG_SND_SOC_WM8770 is not set -# CONFIG_SND_SOC_WM8776 is not set -# CONFIG_SND_SOC_WM8804_I2C is not set -# CONFIG_SND_SOC_WM8804_SPI is not set -# CONFIG_SND_SOC_WM8903 is not set -# CONFIG_SND_SOC_WM8962 is not set -# CONFIG_SND_SOC_WM8978 is not set -# CONFIG_SND_SOC_XTFPGA_I2S is not set -# CONFIG_SND_SONICVIBES is not set -# CONFIG_SND_SPI is not set -# CONFIG_SND_SSCAPE is not set -# CONFIG_SND_SUN4I_CODEC is not set -# CONFIG_SND_SUPPORT_OLD_API is not set -# CONFIG_SND_TIMER is not set -# CONFIG_SND_TRIDENT is not set -CONFIG_SND_USB=y -# CONFIG_SND_USB_6FIRE is not set -# CONFIG_SND_USB_AUDIO is not set -# CONFIG_SND_USB_CAIAQ is not set -# CONFIG_SND_USB_HIFACE is not set -# CONFIG_SND_USB_POD is not set -# CONFIG_SND_USB_PODHD is not set -# CONFIG_SND_USB_TONEPORT is not set -# CONFIG_SND_USB_UA101 is not set -# CONFIG_SND_USB_US122L is not set -# CONFIG_SND_USB_USX2Y is not set -# CONFIG_SND_USB_VARIAX is not set -# CONFIG_SND_VERBOSE_PRINTK is not set -CONFIG_SND_VERBOSE_PROCFS=y -# CONFIG_SND_VIA82XX is not set -# CONFIG_SND_VIA82XX_MODEM is not set -# CONFIG_SND_VIRTUOSO is not set -# CONFIG_SND_VX222 is not set -# CONFIG_SND_VXPOCKET is not set -# CONFIG_SND_WAVEFRONT is not set -# CONFIG_SND_YMFPCI is not set -# CONFIG_SNI_RM is not set -# CONFIG_SOC_AM33XX is not set -# CONFIG_SOC_AM43XX is not set -# CONFIG_SOC_BRCMSTB is not set -# CONFIG_SOC_CAMERA is not set -# CONFIG_SOC_DRA7XX is not set -# CONFIG_SOC_HAS_OMAP2_SDRC is not set -# CONFIG_SOC_OMAP5 is not set -# CONFIG_SOC_TI is not set -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_SONYPI is not set -# CONFIG_SONY_LAPTOP is not set -# CONFIG_SOUND is not set -# CONFIG_SOUND_OSS_CORE is not set -# CONFIG_SOUND_PRIME is not set -# CONFIG_SP5100_TCO is not set -# CONFIG_SPARSEMEM_MANUAL is not set -# CONFIG_SPARSEMEM_STATIC is not set -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set -# CONFIG_SPARSE_IRQ is not set -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_SPEAKUP is not set -# CONFIG_SPI is not set -# CONFIG_SPINLOCK_TEST is not set -# CONFIG_SPI_ALTERA is not set -# CONFIG_SPI_AU1550 is not set -# CONFIG_SPI_BCM2835 is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_BUTTERFLY is not set -# CONFIG_SPI_CADENCE is not set -# CONFIG_SPI_DEBUG is not set -# CONFIG_SPI_DESIGNWARE is not set -# CONFIG_SPI_FSL_DSPI is not set -# CONFIG_SPI_FSL_ESPI is not set -# CONFIG_SPI_FSL_SPI is not set -# CONFIG_SPI_GPIO is not set -# CONFIG_SPI_GPIO_OLD is not set -# CONFIG_SPI_IMG_SPFI is not set -# CONFIG_SPI_LM70_LLP is not set -# CONFIG_SPI_MASTER is not set -# CONFIG_SPI_MPC52xx is not set -# CONFIG_SPI_MPC52xx_PSC is not set -# CONFIG_SPI_OCTEON is not set -# CONFIG_SPI_OC_TINY is not set -# CONFIG_SPI_ORION is not set -# CONFIG_SPI_PL022 is not set -# CONFIG_SPI_PPC4xx is not set -# CONFIG_SPI_PXA2XX is not set -# CONFIG_SPI_PXA2XX_PCI is not set -# CONFIG_SPI_ROCKCHIP is not set -# CONFIG_SPI_SC18IS602 is not set -# CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_TI_QSPI is not set -# CONFIG_SPI_TLE62X0 is not set -# CONFIG_SPI_TOPCLIFF_PCH is not set -# CONFIG_SPI_XCOMM is not set -# CONFIG_SPI_XILINX is not set -# CONFIG_SPI_XWAY is not set -# CONFIG_SPI_ZYNQMP_GQSPI is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_SPMI is not set -CONFIG_SQUASHFS=y -# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set -# CONFIG_SQUASHFS_DECOMP_MULTI is not set -CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y -# CONFIG_SQUASHFS_DECOMP_SINGLE is not set -# CONFIG_SQUASHFS_EMBEDDED is not set -# CONFIG_SQUASHFS_FILE_CACHE is not set -CONFIG_SQUASHFS_FILE_DIRECT=y -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_SQUASHFS_LZ4 is not set -# CONFIG_SQUASHFS_LZO is not set -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_XZ=y -# CONFIG_SQUASHFS_ZLIB is not set -# CONFIG_SRAM is not set -# CONFIG_SSB is not set -# CONFIG_SSB_DEBUG is not set -# CONFIG_SSB_DRIVER_GPIO is not set -# CONFIG_SSB_HOST_SOC is not set -# CONFIG_SSB_PCMCIAHOST is not set -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB_SDIOHOST is not set -# CONFIG_SSB_SILENT is not set -# CONFIG_SSFDC is not set -# CONFIG_STACKTRACE is not set -CONFIG_STACKTRACE_SUPPORT=y -# CONFIG_STACK_TRACER is not set -CONFIG_STAGING=y -# CONFIG_STAGING_BOARD is not set -# CONFIG_STAGING_MEDIA is not set -CONFIG_STANDALONE=y -# CONFIG_STATIC_KEYS_SELFTEST is not set -CONFIG_STDBINUTILS=y -# CONFIG_STE10XP is not set -# CONFIG_STE_MODEM_RPROC is not set -# CONFIG_STK3310 is not set -# CONFIG_STK8312 is not set -# CONFIG_STK8BA50 is not set -# CONFIG_STM is not set -# CONFIG_STMMAC_ETH is not set -# CONFIG_STMMAC_PCI is not set -# CONFIG_STMMAC_PLATFORM is not set -# CONFIG_STM_DUMMY is not set -# CONFIG_STM_SOURCE_CONSOLE is not set -CONFIG_STP=y -# CONFIG_STRICT_DEVMEM is not set -CONFIG_STRIP_ASM_SYMS=y -# CONFIG_SUNDANCE is not set -# CONFIG_SUNGEM is not set -# CONFIG_SUNRPC is not set -# CONFIG_SUNRPC_DEBUG is not set -# CONFIG_SUNRPC_GSS is not set -# CONFIG_SUNXI_SRAM is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_SUSPEND is not set -# CONFIG_SUSPEND_SKIP_SYNC is not set -CONFIG_SWAP=y -# CONFIG_SWCONFIG is not set -# CONFIG_SWCONFIG_LEDS is not set -# CONFIG_SX9500 is not set -# CONFIG_SXGBE_ETH is not set -# CONFIG_SYNCLINK_CS is not set -# CONFIG_SYNOPSYS_DWC_ETH_QOS is not set -CONFIG_SYN_COOKIES=y -CONFIG_SYSCTL=y -# CONFIG_SYSCTL_SYSCALL is not set -CONFIG_SYSFS=y -# CONFIG_SYSFS_DEPRECATED is not set -# CONFIG_SYSFS_DEPRECATED_V2 is not set -# CONFIG_SYSFS_SYSCALL is not set -# CONFIG_SYSTEMPORT is not set -# CONFIG_SYSTEM_DATA_VERIFICATION is not set -# CONFIG_SYSTEM_TRUSTED_KEYRING is not set -# CONFIG_SYSV68_PARTITION is not set -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_SYSV_FS is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_T5403 is not set -# CONFIG_TARGET_CORE is not set -# CONFIG_TASKSTATS is not set -# CONFIG_TASKS_RCU is not set -# CONFIG_TC35815 is not set -# CONFIG_TCG_TPM is not set -# CONFIG_TCIC is not set -CONFIG_TCP_CONG_ADVANCED=y -# CONFIG_TCP_CONG_BIC is not set -# CONFIG_TCP_CONG_CDG is not set -CONFIG_TCP_CONG_CUBIC=y -# CONFIG_TCP_CONG_DCTCP is not set -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_ILLINOIS is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_VENO is not set -# CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_YEAH is not set -# CONFIG_TCP_MD5SIG is not set -# CONFIG_TCS3414 is not set -# CONFIG_TCS3472 is not set -# CONFIG_TEGRA_AHB is not set -# CONFIG_TEGRA_HOST1X is not set -# CONFIG_TEHUTI is not set -# CONFIG_TERANETICS_PHY is not set -# CONFIG_TEST_BPF is not set -# CONFIG_TEST_FIRMWARE is not set -# CONFIG_TEST_HEXDUMP is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_TEST_LIST_SORT is not set -# CONFIG_TEST_LKM is not set -# CONFIG_TEST_POWER is not set -# CONFIG_TEST_PRINTF is not set -# CONFIG_TEST_RHASHTABLE is not set -# CONFIG_TEST_STATIC_KEYS is not set -# CONFIG_TEST_STRING_HELPERS is not set -# CONFIG_TEST_UDELAY is not set -# CONFIG_TEST_USER_COPY is not set -CONFIG_TEXTSEARCH=y -# CONFIG_TEXTSEARCH_BM is not set -# CONFIG_TEXTSEARCH_FSM is not set -# CONFIG_TEXTSEARCH_KMP is not set -# CONFIG_THERMAL is not set -# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set -# CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set -# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set -# CONFIG_THERMAL_EMULATION is not set -# CONFIG_THERMAL_GOV_BANG_BANG is not set -# CONFIG_THERMAL_GOV_FAIR_SHARE is not set -# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set -# CONFIG_THERMAL_GOV_USER_SPACE is not set -# CONFIG_THERMAL_HWMON is not set -# CONFIG_THERMAL_WRITABLE_TRIPS is not set -# CONFIG_THINKPAD_ACPI is not set -# CONFIG_THRUSTMASTER_FF is not set -# CONFIG_THUNDERBOLT is not set -# CONFIG_TICK_CPU_ACCOUNTING is not set -CONFIG_TICK_ONESHOT=y -# CONFIG_TIFM_CORE is not set -# CONFIG_TIGON3 is not set -# CONFIG_TIMB_DMA is not set -CONFIG_TIMERFD=y -# CONFIG_TIMER_STATS is not set -CONFIG_TINY_RCU=y -# CONFIG_TIPC is not set -# CONFIG_TI_ADC081C is not set -# CONFIG_TI_ADC128S052 is not set -# CONFIG_TI_AM335X_ADC is not set -# CONFIG_TI_CPSW is not set -# CONFIG_TI_CPSW_ALE is not set -# CONFIG_TI_CPTS is not set -# CONFIG_TI_DAC7512 is not set -# CONFIG_TI_DAVINCI_CPDMA is not set -# CONFIG_TI_DAVINCI_MDIO is not set -# CONFIG_TI_ST is not set -# CONFIG_TLAN is not set -# CONFIG_TMD_HERMES is not set -# CONFIG_TMP006 is not set -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -CONFIG_TMPFS_XATTR=y -# CONFIG_TOPSTAR_LAPTOP is not set -# CONFIG_TORTURE_TEST is not set -# CONFIG_TOSHIBA_HAPS is not set -# CONFIG_TOUCHSCREEN_AD7877 is not set -# CONFIG_TOUCHSCREEN_AD7879 is not set -# CONFIG_TOUCHSCREEN_AD7879_I2C is not set -# CONFIG_TOUCHSCREEN_AD7879_SPI is not set -# CONFIG_TOUCHSCREEN_ADS7846 is not set -# CONFIG_TOUCHSCREEN_AR1021_I2C is not set -# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set -# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set -# CONFIG_TOUCHSCREEN_BU21013 is not set -# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set -# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set -# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set -# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set -# CONFIG_TOUCHSCREEN_DYNAPRO is not set -# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set -# CONFIG_TOUCHSCREEN_EETI is not set -# CONFIG_TOUCHSCREEN_EGALAX is not set -# CONFIG_TOUCHSCREEN_ELAN is not set -# CONFIG_TOUCHSCREEN_ELO is not set -# CONFIG_TOUCHSCREEN_FT6236 is not set -# CONFIG_TOUCHSCREEN_FUJITSU is not set -# CONFIG_TOUCHSCREEN_GOODIX is not set -# CONFIG_TOUCHSCREEN_GUNZE is not set -# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set -# CONFIG_TOUCHSCREEN_ILI210X is not set -# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set -# CONFIG_TOUCHSCREEN_INEXIO is not set -# CONFIG_TOUCHSCREEN_MAX11801 is not set -# CONFIG_TOUCHSCREEN_MCS5000 is not set -# CONFIG_TOUCHSCREEN_MK712 is not set -# CONFIG_TOUCHSCREEN_MMS114 is not set -# CONFIG_TOUCHSCREEN_MTOUCH is not set -# CONFIG_TOUCHSCREEN_PENMOUNT is not set -# CONFIG_TOUCHSCREEN_PIXCIR is not set -# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set -# CONFIG_TOUCHSCREEN_S3C2410 is not set -# CONFIG_TOUCHSCREEN_ST1232 is not set -# CONFIG_TOUCHSCREEN_SUR40 is not set -# CONFIG_TOUCHSCREEN_SX8654 is not set -# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set -# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set -# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set -# CONFIG_TOUCHSCREEN_TOUCHWIN is not set -# CONFIG_TOUCHSCREEN_TPS6507X is not set -# CONFIG_TOUCHSCREEN_TSC2004 is not set -# CONFIG_TOUCHSCREEN_TSC2005 is not set -# CONFIG_TOUCHSCREEN_TSC2007 is not set -# CONFIG_TOUCHSCREEN_TSC_SERIO is not set -# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set -# CONFIG_TOUCHSCREEN_W90X900 is not set -# CONFIG_TOUCHSCREEN_WACOM_I2C is not set -# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set -# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set -# CONFIG_TOUCHSCREEN_WM97XX is not set -# CONFIG_TOUCHSCREEN_ZFORCE is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS65010 is not set -# CONFIG_TPS6507X is not set -# CONFIG_TRACEPOINT_BENCHMARK is not set -# CONFIG_TRACER_SNAPSHOT is not set -# CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP is not set -# CONFIG_TRACE_BRANCH_PROFILING is not set -# CONFIG_TRACE_ENUM_MAP_FILE is not set -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -# CONFIG_TRACE_SINK is not set -CONFIG_TRACING_SUPPORT=y -CONFIG_TRAD_SIGNALS=y -# CONFIG_TRANSPARENT_HUGEPAGE is not set -# CONFIG_TREE_RCU is not set -# CONFIG_TREE_RCU_TRACE is not set -# CONFIG_TSL2583 is not set -# CONFIG_TSL2x7x is not set -# CONFIG_TSL4531 is not set -# CONFIG_TSYS01 is not set -# CONFIG_TSYS02D is not set -# CONFIG_TTPCI_EEPROM is not set -CONFIG_TTY=y -# CONFIG_TTY_PRINTK is not set -# CONFIG_TUN is not set -# CONFIG_TUN_VNET_CROSS_LE is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6030_GPADC is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_TYPHOON is not set -# CONFIG_UACCESS_WITH_MEMCPY is not set -# CONFIG_UBIFS_ATIME_SUPPORT is not set -# CONFIG_UCB1400_CORE is not set -# CONFIG_UDF_FS is not set -CONFIG_UDF_NLS=y -CONFIG_UEVENT_HELPER=y -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -# CONFIG_UFS_FS is not set -# CONFIG_UHID is not set -CONFIG_UID16=y -# CONFIG_UIO is not set -# CONFIG_ULTRA is not set -# CONFIG_ULTRIX_PARTITION is not set -CONFIG_UNIX=y -CONFIG_UNIX98_PTYS=y -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_UNIX_DIAG is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_UPROBES is not set -# CONFIG_UPROBE_EVENT is not set -# CONFIG_US5182D is not set -# CONFIG_USB is not set -# CONFIG_USBIP_CORE is not set -# CONFIG_USBPCWATCHDOG is not set -# CONFIG_USB_ACM is not set -# CONFIG_USB_ADUTUX is not set -CONFIG_USB_ALI_M5632=y -# CONFIG_USB_AMD5536UDC is not set -CONFIG_USB_AN2720=y -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set -# CONFIG_USB_APPLEDISPLAY is not set -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARMLINUX=y -# CONFIG_USB_ATM is not set -# CONFIG_USB_BDC_UDC is not set -CONFIG_USB_BELKIN=y -# CONFIG_USB_C67X00_HCD is not set -# CONFIG_USB_CATC is not set -# CONFIG_USB_CDC_COMPOSITE is not set -# CONFIG_USB_CHAOSKEY is not set -# CONFIG_USB_CHIPIDEA is not set -# CONFIG_USB_CONFIGFS is not set -# CONFIG_USB_CXACRU is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_DSBR is not set -# CONFIG_USB_DUMMY_HCD is not set -# CONFIG_USB_DWC2 is not set -# CONFIG_USB_DWC2_DEBUG is not set -# CONFIG_USB_DWC2_DUAL_ROLE is not set -# CONFIG_USB_DWC2_HOST is not set -# CONFIG_USB_DWC2_PERIPHERAL is not set -# CONFIG_USB_DWC3 is not set -# CONFIG_USB_DWC3_EXYNOS is not set -# CONFIG_USB_DWC3_KEYSTONE is not set -# CONFIG_USB_DWC3_PCI is not set -# CONFIG_USB_DWC3_QCOM is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_EG20T is not set -# CONFIG_USB_EHCI_HCD_AT91 is not set -# CONFIG_USB_EHCI_HCD_PPC_OF is not set -# CONFIG_USB_EHCI_MSM is not set -# CONFIG_USB_EHCI_MV is not set -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_TT_NEWSCHED=y -# CONFIG_USB_EHSET_TEST_FIXTURE is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EPSON2888 is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_FOTG210_HCD is not set -# CONFIG_USB_FOTG210_UDC is not set -# CONFIG_USB_FSL_USB2 is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_FUNCTIONFS is not set -# CONFIG_USB_FUSB300 is not set -# CONFIG_USB_GADGET is not set -# CONFIG_USB_GADGETFS is not set -# CONFIG_USB_GADGET_DEBUG is not set -# CONFIG_USB_GADGET_DEBUG_FILES is not set -# CONFIG_USB_GADGET_DEBUG_FS is not set -CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 -CONFIG_USB_GADGET_VBUS_DRAW=2 -# CONFIG_USB_GADGET_XILINX is not set -# CONFIG_USB_GL860 is not set -# CONFIG_USB_GOKU is not set -# CONFIG_USB_GPIO_VBUS is not set -# CONFIG_USB_GR_UDC is not set -# CONFIG_USB_GSPCA is not set -# CONFIG_USB_GSPCA_BENQ is not set -# CONFIG_USB_GSPCA_CONEX is not set -# CONFIG_USB_GSPCA_CPIA1 is not set -# CONFIG_USB_GSPCA_DTCS033 is not set -# CONFIG_USB_GSPCA_ETOMS is not set -# CONFIG_USB_GSPCA_FINEPIX is not set -# CONFIG_USB_GSPCA_JEILINJ is not set -# CONFIG_USB_GSPCA_JL2005BCD is not set -# CONFIG_USB_GSPCA_KINECT is not set -# CONFIG_USB_GSPCA_KONICA is not set -# CONFIG_USB_GSPCA_MARS is not set -# CONFIG_USB_GSPCA_MR97310A is not set -# CONFIG_USB_GSPCA_NW80X is not set -# CONFIG_USB_GSPCA_OV519 is not set -# CONFIG_USB_GSPCA_OV534 is not set -# CONFIG_USB_GSPCA_OV534_9 is not set -# CONFIG_USB_GSPCA_PAC207 is not set -# CONFIG_USB_GSPCA_PAC7302 is not set -# CONFIG_USB_GSPCA_PAC7311 is not set -# CONFIG_USB_GSPCA_SE401 is not set -# CONFIG_USB_GSPCA_SN9C2028 is not set -# CONFIG_USB_GSPCA_SN9C20X is not set -# CONFIG_USB_GSPCA_SONIXB is not set -# CONFIG_USB_GSPCA_SONIXJ is not set -# CONFIG_USB_GSPCA_SPCA1528 is not set -# CONFIG_USB_GSPCA_SPCA500 is not set -# CONFIG_USB_GSPCA_SPCA501 is not set -# CONFIG_USB_GSPCA_SPCA505 is not set -# CONFIG_USB_GSPCA_SPCA506 is not set -# CONFIG_USB_GSPCA_SPCA508 is not set -# CONFIG_USB_GSPCA_SPCA561 is not set -# CONFIG_USB_GSPCA_SQ905 is not set -# CONFIG_USB_GSPCA_SQ905C is not set -# CONFIG_USB_GSPCA_SQ930X is not set -# CONFIG_USB_GSPCA_STK014 is not set -# CONFIG_USB_GSPCA_STK1135 is not set -# CONFIG_USB_GSPCA_STV0680 is not set -# CONFIG_USB_GSPCA_SUNPLUS is not set -# CONFIG_USB_GSPCA_T613 is not set -# CONFIG_USB_GSPCA_TOPRO is not set -# CONFIG_USB_GSPCA_TOUPTEK is not set -# CONFIG_USB_GSPCA_TV8532 is not set -# CONFIG_USB_GSPCA_VC032X is not set -# CONFIG_USB_GSPCA_VICAM is not set -# CONFIG_USB_GSPCA_XIRLINK_CIT is not set -# CONFIG_USB_GSPCA_ZC3XX is not set -# CONFIG_USB_G_ACM_MS is not set -# CONFIG_USB_G_DBGP is not set -# CONFIG_USB_G_HID is not set -# CONFIG_USB_G_MULTI is not set -# CONFIG_USB_G_NCM is not set -# CONFIG_USB_G_NOKIA is not set -# CONFIG_USB_G_PRINTER is not set -# CONFIG_USB_G_SERIAL is not set -# CONFIG_USB_G_WEBCAM is not set -# CONFIG_USB_HCD_TEST_MODE is not set -# CONFIG_USB_HID is not set -# CONFIG_USB_HIDDEV is not set -# CONFIG_USB_HSIC_USB3503 is not set -# CONFIG_USB_HSO is not set -# CONFIG_USB_HWA_HCD is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_IPHETH is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1301 is not set -# CONFIG_USB_ISP1362_HCD is not set -# CONFIG_USB_ISP1760 is not set -# CONFIG_USB_ISP1760_HCD is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_KBD is not set -# CONFIG_USB_KC2190 is not set -# CONFIG_USB_LAN78XX is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_LED_TRIG is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LINK_LAYER_TEST is not set -# CONFIG_USB_M5602 is not set -# CONFIG_USB_M66592 is not set -# CONFIG_USB_MASS_STORAGE is not set -# CONFIG_USB_MAX3421_HCD is not set -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USB_MIDI_GADGET is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_MOUSE is not set -# CONFIG_USB_MSM_OTG is not set -# CONFIG_USB_MUSB_HDRC is not set -# CONFIG_USB_MV_U3D is not set -# CONFIG_USB_MV_UDC is not set -# CONFIG_USB_NET2272 is not set -# CONFIG_USB_NET2280 is not set -# CONFIG_USB_NET_AX88179_178A is not set -# CONFIG_USB_NET_AX8817X is not set -# CONFIG_USB_NET_CDCETHER is not set -# CONFIG_USB_NET_CDC_EEM is not set -# CONFIG_USB_NET_CDC_MBIM is not set -# CONFIG_USB_NET_CDC_NCM is not set -# CONFIG_USB_NET_CDC_SUBSET is not set -# CONFIG_USB_NET_CH9200 is not set -# CONFIG_USB_NET_CX82310_ETH is not set -# CONFIG_USB_NET_DM9601 is not set -# CONFIG_USB_NET_DRIVERS is not set -# CONFIG_USB_NET_GL620A is not set -# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set -# CONFIG_USB_NET_INT51X1 is not set -# CONFIG_USB_NET_KALMIA is not set -# CONFIG_USB_NET_MCS7830 is not set -# CONFIG_USB_NET_NET1080 is not set -# CONFIG_USB_NET_PLUSB is not set -# CONFIG_USB_NET_QMI_WWAN is not set -# CONFIG_USB_NET_RNDIS_HOST is not set -# CONFIG_USB_NET_RNDIS_WLAN is not set -# CONFIG_USB_NET_SMSC75XX is not set -# CONFIG_USB_NET_SMSC95XX is not set -# CONFIG_USB_NET_SR9700 is not set -# CONFIG_USB_NET_SR9800 is not set -# CONFIG_USB_NET_ZAURUS is not set -# CONFIG_USB_OHCI_HCD is not set -# CONFIG_USB_OHCI_HCD_PCI is not set -# CONFIG_USB_OHCI_HCD_PPC_OF is not set -# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set -# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set -# CONFIG_USB_OHCI_HCD_SSB is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -# CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_USB_OTG_FSM is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_PHY is not set -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_PWC_INPUT_EVDEV is not set -# CONFIG_USB_PXA27X is not set -# CONFIG_USB_R8A66597 is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_RCAR_PHY is not set -# CONFIG_USB_RENESAS_USBHS is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_RTL8152 is not set -# CONFIG_USB_S2255 is not set -# CONFIG_USB_SERIAL is not set -# CONFIG_USB_SERIAL_AIRCABLE is not set -# CONFIG_USB_SERIAL_ARK3116 is not set -# CONFIG_USB_SERIAL_BELKIN is not set -# CONFIG_USB_SERIAL_CH341 is not set -# CONFIG_USB_SERIAL_CP210X is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_CYPRESS_M8 is not set -# CONFIG_USB_SERIAL_DEBUG is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_EDGEPORT_TI is not set -# CONFIG_USB_SERIAL_EMPEG is not set -# CONFIG_USB_SERIAL_F81232 is not set -# CONFIG_USB_SERIAL_FTDI_SIO is not set -# CONFIG_USB_SERIAL_GARMIN is not set -CONFIG_USB_SERIAL_GENERIC=y -# CONFIG_USB_SERIAL_IPAQ is not set -# CONFIG_USB_SERIAL_IPW is not set -# CONFIG_USB_SERIAL_IR is not set -# CONFIG_USB_SERIAL_IUU is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -CONFIG_USB_SERIAL_KEYSPAN_MPR=y -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -CONFIG_USB_SERIAL_KEYSPAN_USA18X=y -CONFIG_USB_SERIAL_KEYSPAN_USA19=y -CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y -CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y -CONFIG_USB_SERIAL_KEYSPAN_USA19W=y -CONFIG_USB_SERIAL_KEYSPAN_USA28=y -CONFIG_USB_SERIAL_KEYSPAN_USA28X=y -CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y -CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y -CONFIG_USB_SERIAL_KEYSPAN_USA49W=y -CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y -# CONFIG_USB_SERIAL_KLSI is not set -# CONFIG_USB_SERIAL_KOBIL_SCT is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_METRO is not set -# CONFIG_USB_SERIAL_MOS7715_PARPORT is not set -# CONFIG_USB_SERIAL_MOS7720 is not set -# CONFIG_USB_SERIAL_MOS7840 is not set -# CONFIG_USB_SERIAL_MXUPORT is not set -# CONFIG_USB_SERIAL_NAVMAN is not set -# CONFIG_USB_SERIAL_OMNINET is not set -# CONFIG_USB_SERIAL_OPTICON is not set -# CONFIG_USB_SERIAL_OPTION is not set -# CONFIG_USB_SERIAL_OTI6858 is not set -# CONFIG_USB_SERIAL_PL2303 is not set -# CONFIG_USB_SERIAL_QCAUX is not set -# CONFIG_USB_SERIAL_QT2 is not set -# CONFIG_USB_SERIAL_QUALCOMM is not set -# CONFIG_USB_SERIAL_SAFE is not set -CONFIG_USB_SERIAL_SAFE_PADDED=y -# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set -# CONFIG_USB_SERIAL_SIMPLE is not set -# CONFIG_USB_SERIAL_SPCP8X5 is not set -# CONFIG_USB_SERIAL_SSU100 is not set -# CONFIG_USB_SERIAL_SYMBOL is not set -# CONFIG_USB_SERIAL_TI is not set -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_WISHBONE is not set -# CONFIG_USB_SERIAL_XIRCOM is not set -# CONFIG_USB_SERIAL_XSENS_MT is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_SIERRA_NET is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_SPEEDTOUCH is not set -# CONFIG_USB_STKWEBCAM is not set -# CONFIG_USB_STORAGE is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STV06XX is not set -# CONFIG_USB_SUPPORT is not set -# CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_TMC is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_UAS is not set -# CONFIG_USB_UEAGLEATM is not set -# CONFIG_USB_ULPI is not set -# CONFIG_USB_ULPI_BUS is not set -# CONFIG_USB_USBNET is not set -# CONFIG_USB_USS720 is not set -# CONFIG_USB_VIDEO_CLASS is not set -CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y -# CONFIG_USB_VL600 is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_WHCI_HCD is not set -# CONFIG_USB_WUSB is not set -# CONFIG_USB_WUSB_CBAF is not set -# CONFIG_USB_XHCI_HCD is not set -# CONFIG_USB_XUSBATM is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_ZD1201 is not set -# CONFIG_USB_ZERO is not set -# CONFIG_USB_ZR364XX is not set -# CONFIG_USELIB is not set -# CONFIG_USERFAULTFD is not set -# CONFIG_USE_OF is not set -# CONFIG_UTS_NS is not set -# CONFIG_UWB is not set -# CONFIG_V4L_MEM2MEM_DRIVERS is not set -# CONFIG_V4L_TEST_DRIVERS is not set -# CONFIG_VCNL4000 is not set -# CONFIG_VDSO is not set -# CONFIG_VETH is not set -# CONFIG_VEXPRESS_CONFIG is not set -# CONFIG_VF610_ADC is not set -# CONFIG_VFAT_FS is not set -# CONFIG_VGASTATE is not set -# CONFIG_VGA_ARB is not set -# CONFIG_VGA_SWITCHEROO is not set -# CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set -# CONFIG_VIDEO_ADV7170 is not set -# CONFIG_VIDEO_ADV7175 is not set -# CONFIG_VIDEO_ADV7180 is not set -# CONFIG_VIDEO_ADV7183 is not set -# CONFIG_VIDEO_ADV7343 is not set -# CONFIG_VIDEO_ADV7393 is not set -# CONFIG_VIDEO_ADV_DEBUG is not set -# CONFIG_VIDEO_AK881X is not set -# CONFIG_VIDEO_BT819 is not set -# CONFIG_VIDEO_BT848 is not set -# CONFIG_VIDEO_BT856 is not set -# CONFIG_VIDEO_BT866 is not set -# CONFIG_VIDEO_CAFE_CCIC is not set -# CONFIG_VIDEO_CS5345 is not set -# CONFIG_VIDEO_CS53L32A is not set -# CONFIG_VIDEO_CX231XX is not set -# CONFIG_VIDEO_CX2341X is not set -# CONFIG_VIDEO_CX25840 is not set -# CONFIG_VIDEO_CX88 is not set -# CONFIG_VIDEO_DEV is not set -# CONFIG_VIDEO_DM6446_CCDC is not set -# CONFIG_VIDEO_DT3155 is not set -# CONFIG_VIDEO_EM28XX is not set -# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set -# CONFIG_VIDEO_GO7007 is not set -# CONFIG_VIDEO_HDPVR is not set -# CONFIG_VIDEO_HEXIUM_GEMINI is not set -# CONFIG_VIDEO_HEXIUM_ORION is not set -# CONFIG_VIDEO_IR_I2C is not set -# CONFIG_VIDEO_IVTV is not set -# CONFIG_VIDEO_KS0127 is not set -# CONFIG_VIDEO_M52790 is not set -# CONFIG_VIDEO_ML86V7667 is not set -# CONFIG_VIDEO_MSP3400 is not set -# CONFIG_VIDEO_MT9V011 is not set -# CONFIG_VIDEO_MXB is not set -# CONFIG_VIDEO_NOON010PC30 is not set -# CONFIG_VIDEO_OMAP2_VOUT is not set -# CONFIG_VIDEO_OV2659 is not set -# CONFIG_VIDEO_OV7640 is not set -# CONFIG_VIDEO_OV7670 is not set -# CONFIG_VIDEO_PVRUSB2 is not set -# CONFIG_VIDEO_SAA6588 is not set -# CONFIG_VIDEO_SAA6752HS is not set -# CONFIG_VIDEO_SAA7110 is not set -# CONFIG_VIDEO_SAA711X is not set -# CONFIG_VIDEO_SAA7127 is not set -# CONFIG_VIDEO_SAA7134 is not set -# CONFIG_VIDEO_SAA717X is not set -# CONFIG_VIDEO_SAA7185 is not set -# CONFIG_VIDEO_SH_MOBILE_CEU is not set -# CONFIG_VIDEO_SONY_BTF_MPX is not set -# CONFIG_VIDEO_SR030PC30 is not set -# CONFIG_VIDEO_TDA7432 is not set -# CONFIG_VIDEO_TDA9840 is not set -# CONFIG_VIDEO_TEA6415C is not set -# CONFIG_VIDEO_TEA6420 is not set -# CONFIG_VIDEO_THS7303 is not set -# CONFIG_VIDEO_THS8200 is not set -# CONFIG_VIDEO_TIMBERDALE is not set -# CONFIG_VIDEO_TLV320AIC23B is not set -# CONFIG_VIDEO_TM6000 is not set -# CONFIG_VIDEO_TVAUDIO is not set -# CONFIG_VIDEO_TVP514X is not set -# CONFIG_VIDEO_TVP5150 is not set -# CONFIG_VIDEO_TVP7002 is not set -# CONFIG_VIDEO_TW2804 is not set -# CONFIG_VIDEO_TW9903 is not set -# CONFIG_VIDEO_TW9906 is not set -# CONFIG_VIDEO_UDA1342 is not set -# CONFIG_VIDEO_UPD64031A is not set -# CONFIG_VIDEO_UPD64083 is not set -# CONFIG_VIDEO_USBTV is not set -# CONFIG_VIDEO_USBVISION is not set -# CONFIG_VIDEO_V4L2 is not set -# CONFIG_VIDEO_VP27SMPX is not set -# CONFIG_VIDEO_VPX3220 is not set -# CONFIG_VIDEO_VS6624 is not set -# CONFIG_VIDEO_WM8739 is not set -# CONFIG_VIDEO_WM8775 is not set -# CONFIG_VIDEO_ZORAN is not set -# CONFIG_VIRTIO_BALLOON is not set -# CONFIG_VIRTIO_INPUT is not set -# CONFIG_VIRTIO_MMIO is not set -# CONFIG_VIRTIO_PCI is not set -# CONFIG_VIRTUALIZATION is not set -# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set -# CONFIG_VIRT_DRIVERS is not set -CONFIG_VIRT_TO_BUS=y -# CONFIG_VITESSE_PHY is not set -CONFIG_VLAN_8021Q=y -# CONFIG_VLAN_8021Q_GVRP is not set -# CONFIG_VLAN_8021Q_MVRP is not set -# CONFIG_VME_BUS is not set -# CONFIG_VMSPLIT_1G is not set -# CONFIG_VMSPLIT_2G is not set -# CONFIG_VMSPLIT_2G_OPT is not set -CONFIG_VMSPLIT_3G=y -# CONFIG_VMSPLIT_3G_OPT is not set -# CONFIG_VMWARE_PVSCSI is not set -# CONFIG_VMXNET3 is not set -# CONFIG_VM_EVENT_COUNTERS is not set -# CONFIG_VORTEX is not set -# CONFIG_VSOCKETS is not set -# CONFIG_VT is not set -# CONFIG_VT6655 is not set -# CONFIG_VT6656 is not set -# CONFIG_VXFS_FS is not set -# CONFIG_VXGE is not set -# CONFIG_VXLAN is not set -# CONFIG_VZ89X is not set -# CONFIG_W1 is not set -# CONFIG_W1_CON is not set -# CONFIG_W1_MASTER_DS1WM is not set -# CONFIG_W1_MASTER_DS2482 is not set -# CONFIG_W1_MASTER_DS2490 is not set -# CONFIG_W1_MASTER_GPIO is not set -# CONFIG_W1_MASTER_MATROX is not set -# CONFIG_W1_SLAVE_BQ27000 is not set -# CONFIG_W1_SLAVE_DS2406 is not set -# CONFIG_W1_SLAVE_DS2408 is not set -# CONFIG_W1_SLAVE_DS2413 is not set -# CONFIG_W1_SLAVE_DS2423 is not set -# CONFIG_W1_SLAVE_DS2431 is not set -# CONFIG_W1_SLAVE_DS2433 is not set -# CONFIG_W1_SLAVE_DS2760 is not set -# CONFIG_W1_SLAVE_DS2780 is not set -# CONFIG_W1_SLAVE_DS2781 is not set -# CONFIG_W1_SLAVE_DS28E04 is not set -# CONFIG_W1_SLAVE_SMEM is not set -# CONFIG_W1_SLAVE_THERM is not set -# CONFIG_W83627HF_WDT is not set -# CONFIG_W83877F_WDT is not set -# CONFIG_W83977F_WDT is not set -# CONFIG_WAN is not set -# CONFIG_WANXL is not set -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_CORE is not set -# CONFIG_WATCHDOG_NOWAYOUT is not set -# CONFIG_WD80x3 is not set -# CONFIG_WDTPCI is not set -CONFIG_WEXT_CORE=y -CONFIG_WEXT_PRIV=y -CONFIG_WEXT_PROC=y -CONFIG_WEXT_SPY=y -CONFIG_WILINK_PLATFORM_DATA=y -# CONFIG_WIMAX is not set -# CONFIG_WIMAX_GDM72XX is not set -CONFIG_WIRELESS=y -CONFIG_WIRELESS_EXT=y -# CONFIG_WIZNET_W5100 is not set -# CONFIG_WIZNET_W5300 is not set -# CONFIG_WL1251 is not set -# CONFIG_WL12XX is not set -# CONFIG_WL18XX is not set -CONFIG_WLAN=y -# CONFIG_WLCORE is not set -# CONFIG_WL_MEDIATEK is not set -CONFIG_WL_TI=y -CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y -# CONFIG_X25 is not set -# CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set -# CONFIG_X86_PKG_TEMP_THERMAL is not set -CONFIG_X86_SYSFB=y -# CONFIG_XEN is not set -CONFIG_XFRM=y -# CONFIG_XFRM_IPCOMP is not set -# CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set -# CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_USER is not set -# CONFIG_XFS_DEBUG is not set -# CONFIG_XFS_FS is not set -# CONFIG_XFS_POSIX_ACL is not set -# CONFIG_XFS_QUOTA is not set -# CONFIG_XFS_RT is not set -# CONFIG_XFS_WARN is not set -# CONFIG_XILINX_AXI_EMAC is not set -# CONFIG_XILINX_EMACLITE is not set -# CONFIG_XILINX_LL_TEMAC is not set -# CONFIG_XILINX_WATCHDOG is not set -# CONFIG_XILLYBUS is not set -# CONFIG_XIP_KERNEL is not set -# CONFIG_XMON is not set -CONFIG_XZ_DEC=y -# CONFIG_XZ_DEC_ARM is not set -# CONFIG_XZ_DEC_ARMTHUMB is not set -# CONFIG_XZ_DEC_BCJ is not set -# CONFIG_XZ_DEC_IA64 is not set -# CONFIG_XZ_DEC_POWERPC is not set -# CONFIG_XZ_DEC_SPARC is not set -# CONFIG_XZ_DEC_TEST is not set -# CONFIG_XZ_DEC_X86 is not set -# CONFIG_YAFFS_DISABLE_BAD_BLOCK_MARKING is not set -# CONFIG_YAFFS_FS is not set -# CONFIG_YAM is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_YENTA is not set -# CONFIG_YENTA_O2 is not set -# CONFIG_YENTA_RICOH is not set -# CONFIG_YENTA_TI is not set -# CONFIG_YENTA_TOSHIBA is not set -# CONFIG_ZBUD is not set -# CONFIG_ZD1211RW is not set -# CONFIG_ZD1211RW_DEBUG is not set -# CONFIG_ZEROPLUS_FF is not set -# CONFIG_ZISOFS is not set -# CONFIG_ZLIB_DEFLATE is not set -# CONFIG_ZLIB_INFLATE is not set -CONFIG_ZONE_DMA=y -CONFIG_ZONE_DMA_FLAG=1 -# CONFIG_ZPOOL is not set -# CONFIG_ZRAM is not set -# CONFIG_ZSMALLOC is not set diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-cig-wf186h.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-cig-wf186h.dts deleted file mode 100644 index 61b159fd1..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-cig-wf186h.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-cig-wf186w.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-cig-wf186w.dts deleted file mode 100644 index da9009766..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-cig-wf186w.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eap104.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eap104.dts deleted file mode 100644 index af8b70256..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eap104.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-eap104.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww622-a1.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww622-a1.dts deleted file mode 100644 index 449a7ef5c..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww622-a1.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-eww622-a1.dts" - -/ { - model = "CyberTan EWW622-A1"; - compatible = "cybertan,eww622-a1", "qcom,ipq5018"; - - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww631-a1.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww631-a1.dts deleted file mode 100644 index f74741ff0..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww631-a1.dts +++ /dev/null @@ -1,10 +0,0 @@ -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-eww631-a1.dts" - -/ { - model = "CyberTan EWW631-A1"; - compatible = "cybertan,eww631-a1", "qcom,ipq5018"; - - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww631-b1.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww631-b1.dts deleted file mode 100755 index fae6d6a2c..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-eww631-b1.dts +++ /dev/null @@ -1,10 +0,0 @@ -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-eww631-b1.dts" - -/ { - model = "CyberTan EWW631-B1"; - compatible = "cybertan,eww631-b1", "qcom,ipq5018"; - - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4x_w.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4x_w.dts deleted file mode 100644 index 8bf83f74f..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4x_w.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4x_w.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4xi_HMR.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4xi_HMR.dts deleted file mode 100644 index 573e6cd75..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4xi_HMR.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_HMR.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4xi_w.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4xi_w.dts deleted file mode 100644 index f80780f2c..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-hfcl-ion4xi_w.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-liteon-wpx8324.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-liteon-wpx8324.dts deleted file mode 100644 index 7fbff974a..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-liteon-wpx8324.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-liteon-wpx8324.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-muxi-ap3220l.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-muxi-ap3220l.dts deleted file mode 100644 index 9d963770a..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-muxi-ap3220l.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-muxi-ap3220l.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d50-5g.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d50-5g.dts deleted file mode 100644 index b37be8d21..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d50-5g.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50-5g.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d50.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d50.dts deleted file mode 100644 index ccf478592..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d50.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d60-5g.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d60-5g.dts deleted file mode 100644 index b37be8d21..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d60-5g.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50-5g.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d60.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d60.dts deleted file mode 100644 index ccf478592..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-optimcloud-d60.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-q14.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-q14.dts deleted file mode 100644 index 23cff9101..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-q14.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-q14.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-wallys-dr5018.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-wallys-dr5018.dts deleted file mode 100755 index 4f87b6303..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-wallys-dr5018.dts +++ /dev/null @@ -1,10 +0,0 @@ -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-wallys-dr5018.dts" - -/ { - model = "Wallys DR5018"; - compatible = "wallys,dr5018", "qcom,ipq5018"; - - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-yuncore-fap655.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-yuncore-fap655.dts deleted file mode 100644 index 8942e99aa..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq5018-yuncore-fap655.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq5018-yuncore-fap655.dts" - -/ { - pmuv8: pmu { - compatible = "arm,cortex-a7-pmu"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf188.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf188.dts deleted file mode 100644 index 5f2d4fb03..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf188.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-cig-wf188.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf188n.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf188n.dts deleted file mode 100644 index ffd789922..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf188n.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-cig-wf188n.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf660a.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf660a.dts deleted file mode 100644 index 3ffe26489..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf660a.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-edgecore-eap101.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-edgecore-eap101.dts deleted file mode 100644 index 531510a76..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-edgecore-eap101.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-edgecore-eap101.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-gl-ax1800.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-gl-ax1800.dts deleted file mode 100644 index 29aa5d5e0..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-gl-ax1800.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-gl-ax1800.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-gl-axt1800.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-gl-axt1800.dts deleted file mode 100644 index f09f8b43d..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-gl-axt1800.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-gl-axt1800.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4x.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4x.dts deleted file mode 100644 index 099234c46..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4x.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4x_2.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4x_2.dts deleted file mode 100644 index a0744e0c0..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4x_2.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x_2.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xe.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xe.dts deleted file mode 100644 index 5a44b9a3e..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xe.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xe.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xi.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xi.dts deleted file mode 100644 index 8edd1d817..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xi.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xi_wp.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xi_wp.dts deleted file mode 100644 index 9929b300a..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-hfcl-ion4xi_wp.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi_wp.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-310ax-v1.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-310ax-v1.dts deleted file mode 100644 index 991f45c0f..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-310ax-v1.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-indio-um-310ax-v1.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-510axm-v1.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-510axm-v1.dts deleted file mode 100644 index 1305e0442..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-510axm-v1.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axm-v1.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-510axp-v1.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-510axp-v1.dts deleted file mode 100644 index 6e6a1397e..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-indio-um-510axp-v1.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axp-v1.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-meshpp-s618-cp01.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-meshpp-s618-cp01.dts deleted file mode 100644 index 161690b32..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-meshpp-s618-cp01.dts +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp01.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-meshpp-s618-cp03.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-meshpp-s618-cp03.dts deleted file mode 100644 index 643d2aec7..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-meshpp-s618-cp03.dts +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp03.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-pax1800-v1.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-pax1800-v1.dts deleted file mode 100644 index 9fff320cc..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-pax1800-v1.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v1.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-pax1800-v2.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-pax1800-v2.dts deleted file mode 100644 index 6a69d10bc..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-pax1800-v2.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v2.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-wallys-dr6018-v4.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-wallys-dr6018-v4.dts deleted file mode 100644 index 470e437e4..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-wallys-dr6018-v4.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-wallys-dr6018-v4.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-wallys-dr6018.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-wallys-dr6018.dts deleted file mode 100644 index 1250eb19f..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-wallys-dr6018.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-wallys-dr6018.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-yuncore-ax840.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-yuncore-ax840.dts deleted file mode 100644 index a84bcf361..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-yuncore-ax840.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-yuncore-ax840.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-yuncore-fap650.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-yuncore-fap650.dts deleted file mode 100644 index 491fc1298..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-yuncore-fap650.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../../arm64/boot/dts/qcom/qcom-ipq6018-yuncore-fap650.dts" -#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-eap102.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-eap102.dts deleted file mode 100644 index d1d3f3755..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-eap102.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "../../../arm64/boot/dts/qcom/qcom-ipq807x-eap102.dts" - -/ { - soc { - pmu { - compatible = "arm,cortex-a7-pmu"; - interrupts = ; - }; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-eap106.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-eap106.dts deleted file mode 100644 index 1527f81a4..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-eap106.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "../../../arm64/boot/dts/qcom/qcom-ipq807x-eap106.dts" - -/ { - soc { - pmu { - compatible = "arm,cortex-a7-pmu"; - interrupts = ; - }; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-ex227.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-ex227.dts deleted file mode 100644 index f3b25e263..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-ex227.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "../../../arm64/boot/dts/qcom/qcom-ipq807x-ex227.dts" - -/ { - soc { - pmu { - compatible = "arm,cortex-a7-pmu"; - interrupts = ; - }; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-ex447.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-ex447.dts deleted file mode 100644 index 7cfd66ba0..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-ex447.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "../../../arm64/boot/dts/qcom/qcom-ipq807x-ex447.dts" - -/ { - soc { - pmu { - compatible = "arm,cortex-a7-pmu"; - interrupts = ; - }; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-oap102.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-oap102.dts deleted file mode 100644 index 3aa18087c..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-oap102.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "../../../arm64/boot/dts/qcom/qcom-ipq807x-oap102.dts" - -/ { - soc { - pmu { - compatible = "arm,cortex-a7-pmu"; - interrupts = ; - }; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf194c.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf194c.dts deleted file mode 100644 index 4274b6c70..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf194c.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "../../../arm64/boot/dts/qcom/qcom-ipq807x-wf194c.dts" - -/ { - soc { - pmu { - compatible = "arm,cortex-a7-pmu"; - interrupts = ; - }; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf194c4.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf194c4.dts deleted file mode 100644 index 372f29df3..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf194c4.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "../../../arm64/boot/dts/qcom/qcom-ipq807x-wf194c4.dts" - -/ { - soc { - pmu { - compatible = "arm,cortex-a7-pmu"; - interrupts = ; - }; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf196.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf196.dts deleted file mode 100644 index f8d31a052..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq807x-wf196.dts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "../../../arm64/boot/dts/qcom/qcom-ipq807x-wf196.dts" - -/ { - soc { - pmu { - compatible = "arm,cortex-a7-pmu"; - interrupts = ; - }; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-hfcl-ion4xi_HMR.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-hfcl-ion4xi_HMR.dtsi deleted file mode 100755 index 614547e0a..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-hfcl-ion4xi_HMR.dtsi +++ /dev/null @@ -1,1441 +0,0 @@ -/* - * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include "qcom-ipq5018-memory.dtsi" -#include "qcom-ipq5018-mhi.dtsi" -#include "ipq5018_clocks.dtsi" - -/ { - model = "Qualcomm Technologies, Inc. IPQ5018"; - compatible = "qcom,ipq5018"; - - psci { - compatible = "arm,psci-1.0"; - method = "smc"; - status = "ok"; - }; - -#ifdef ENABLE_QSEECOM - qseecom { - compatible = "ipq5018-qseecom"; - mem-start = <0x4a400000>; - mem-size = <0x200000>; - }; -#endif - - soc: soc { - #address-cells = <0x1>; - #size-cells = <0x1>; - ranges = <0 0 0 0xffffffff>; - compatible = "simple-bus"; - - intc: interrupt-controller@b000000 { - compatible = "qcom,msm-qgic2"; - interrupt-controller; - #interrupt-cells = <0x3>; - reg = <0xb000000 0x1000>, <0xb002000 0x1000>; - ranges = <0x0 0xb00a000 0x1ffa>; - - v2m0: v2m@0 { - compatible = "arm,gic-v2m-frame"; - msi-controller; - reg = <0x0 0xffd>; - }; - - v2m1: v2m@1000 { - compatible = "arm,gic-v2m-frame"; - msi-controller; - reg = <0x1000 0xffd>; - }; - }; - - timer { - compatible = "arm,armv8-timer"; - interrupts = , - , - , - ; - clock-frequency = <24000000>; - }; - - gcc: gcc@1800000 { - compatible = "qcom,gcc-ipq5018"; - reg = <0x1800000 0x80000>; - #clock-cells = <0x1>; - #reset-cells = <0x1>; - }; - - apss_clk: qcom,apss_clk@b111000 { - compatible = "qcom,apss-ipq5018"; - reg = <0xb111000 0x6000>; - #clock-cells = <0x1>; - #reset-cells = <1>; - }; - - blsp1_uart2: serial@78b0000 { - compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; - reg = <0x78b0000 0x200>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>, - <&gcc GCC_BLSP1_AHB_CLK>; - clock-names = "core", "iface"; - status = "disabled"; - }; - - blsp1_uart1: serial@78af000 { - compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; - reg = <0x78af000 0x200>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>, - <&gcc GCC_BLSP1_AHB_CLK>; - clock-names = "core", "iface"; - status = "disabled"; - }; - - blsp_dma: dma@7884000 { - compatible = "qcom,bam-v1.7.0"; - reg = <0x07884000 0x1d000>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_AHB_CLK>; - clock-names = "bam_clk"; - #dma-cells = <1>; - qcom,ee = <0>; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - compatible = "qcom,spi-qup-v2.2.1"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x78b5000 0x600>; - interrupts = ; - spi-max-frequency = <50000000>; - clocks = <&gcc GCC_BLSP1_QUP1_SPI_APPS_CLK>, - <&gcc GCC_BLSP1_AHB_CLK>; - clock-names = "core", "iface"; - dmas = <&blsp_dma 4>, <&blsp_dma 5>; - dma-names = "tx", "rx"; - status = "disabled"; - }; - pwm { - compatible = "qca,ipq6018-pwm"; - reg = <0x1941010 0x20>; - clocks = <&gcc GCC_ADSS_PWM_CLK>; - clock-names = "core"; - src-freq = <100000000>; - pwm-base-index = <0>; - used-pwm-indices = <1>, <1>, <1>, <1>; - status = "disabled"; - }; - - mdio0: mdio@88000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "qcom,qca-mdio", "qcom,ipq40xx-mdio"; - reg = <0x88000 0x64>; - status = "disabled"; - resets = <&gcc GCC_GEPHY_MDC_SW_ARES>; - reset-names = "gephy_mdc_rst"; - }; - - mdio1: mdio@90000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "qcom,qca-mdio"; - reg = <0x90000 0x64>; - status = "disabled"; - }; - ess-instance { - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - reg = <0x39c00000 0x200000>; - switch_access_mode = "local bus"; - clocks = <&gcc GCC_CMN_BLK_AHB_CLK>, - <&gcc GCC_CMN_BLK_SYS_CLK>, - <&gcc GCC_UNIPHY_AHB_CLK>, - <&gcc GCC_UNIPHY_SYS_CLK>, - <&gcc GCC_MDIO0_AHB_CLK>, - <&gcc GCC_MDIO1_AHB_CLK>, - <&gcc GCC_GMAC0_CFG_CLK>, - <&gcc GCC_GMAC0_SYS_CLK>, - <&gcc GCC_GMAC1_CFG_CLK>, - <&gcc GCC_GMAC1_SYS_CLK>, - <&gcc GCC_GEPHY_RX_CLK>, - <&gcc GCC_GEPHY_TX_CLK>, - <&gcc GCC_UNIPHY_RX_CLK>, - <&gcc GCC_UNIPHY_TX_CLK>, - <&gcc GCC_GMAC0_RX_CLK>, - <&gcc GCC_GMAC0_TX_CLK>, - <&gcc GCC_GMAC1_RX_CLK>, - <&gcc GCC_GMAC1_TX_CLK>, - <&gcc GCC_SNOC_GMAC0_AHB_CLK>, - <&gcc GCC_SNOC_GMAC1_AHB_CLK>, - <&gcc GCC_GMAC0_PTP_CLK>, - <&gcc GCC_GMAC1_PTP_CLK>; - clock-names = "cmn_ahb_clk", "cmn_sys_clk", - "uniphy_ahb_clk", "uniphy_sys_clk", - "gcc_mdio0_ahb_clk", - "gcc_mdio1_ahb_clk", - "gcc_gmac0_cfg_clk", - "gcc_gmac0_sys_clk", - "gcc_gmac1_cfg_clk", - "gcc_gmac1_sys_clk", - "uniphy0_port1_rx_clk", - "uniphy0_port1_tx_clk", - "uniphy1_port5_rx_clk", - "uniphy1_port5_tx_clk", - "nss_port1_rx_clk", "nss_port1_tx_clk", - "nss_port2_rx_clk", "nss_port2_tx_clk", - "gcc_snoc_gmac0_ahb_clk", - "gcc_snoc_gmac1_ahb_clk", - "gcc_gmac0_ptp_clk", - "gcc_gmac1_ptp_clk"; - resets = <&gcc GCC_GEPHY_BCR>, <&gcc GCC_UNIPHY_BCR>, - <&gcc GCC_GMAC0_BCR>, <&gcc GCC_GMAC1_BCR>, - <&gcc GCC_UNIPHY_SOFT_RESET>, - <&gcc GCC_GEPHY_MISC_ARES>; - reset-names = "gephy_bcr_rst", "uniphy_bcr_rst", - "gmac0_bcr_rst", "gmac1_bcr_rst", - "uniphy1_soft_rst", - "gephy_misc_rst"; - }; - }; - - ess-uniphy@98000 { - compatible = "qcom,ess-uniphy"; - reg = <0x98000 0x800>; - uniphy_access_mode = "local bus"; - }; - - msm_imem: qcom,msm-imem@8600000 { - compatible = "qcom,msm-imem"; - reg = <0x08600000 0x1000>; - ranges = <0x0 0x08600000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - - mem_dump_table@10 { - compatible = "qcom,msm-imem-mem_dump_table"; - reg = <0x10 8>; - }; - }; - - cryptobam: dma@704000 { - compatible = "qcom,bam-v1.7.0"; - reg = <0x00704000 0x20000>; - interrupts = ; - clocks = <&gcc GCC_CRYPTO_AHB_CLK>; - clock-names = "bam_clk"; - #dma-cells = <1>; - qcom,ee = <1>; - qcom,controlled-remotely = <1>; - }; - - crypto: crypto@73a000 { - compatible = "qcom,crypto-v5.1"; - reg = <0x0073a000 0x6000>; - clocks = <&gcc GCC_CRYPTO_AHB_CLK>, - <&gcc GCC_CRYPTO_AXI_CLK>, - <&gcc GCC_CRYPTO_CLK>; - clock-names = "iface", "bus", "core"; - dmas = <&cryptobam 2>, <&cryptobam 3>; - dma-names = "rx", "tx"; - qce,cmd_desc_support; - }; - - qpic_bam: dma@7984000{ - compatible = "qcom,bam-v1.7.0"; - reg = <0x7984000 0x1c000>; - interrupts = ; - clocks = <&gcc GCC_QPIC_AHB_CLK>; - clock-names = "bam_clk"; - #dma-cells = <1>; - qcom,ee = <0>; - status = "disabled"; - }; - - qcom,sps { - compatible = "qcom,msm_sps_4k"; - qcom,pipe-attr-ee; - }; - - nand: qpic-nand@79b0000 { - compatible = "qcom,ebi2-nandc-bam-v2.1.1"; - reg = <0x79b0000 0x10000>; - #address-cells = <1>; - #size-cells = <0>; - clocks = <&gcc GCC_QPIC_CLK>, - <&gcc GCC_QPIC_AHB_CLK>, - <&gcc GCC_QPIC_IO_MACRO_CLK>; - clock-names = "core", "aon", "io_macro"; - - dmas = <&qpic_bam 0>, - <&qpic_bam 1>, - <&qpic_bam 2>, - <&qpic_bam 3>; - dma-names = "tx", "rx", "cmd", "status"; - - qpic,io_macro_clk_rates = <24000000 100000000 200000000 320000000>; - status = "disabled"; - - nandcs@0 { - compatible = "qcom,nandcs"; - reg = <0>; - #address-cells = <1>; - #size-cells = <1>; - - nand-ecc-strength = <4>; - nand-ecc-step-size = <512>; - nand-bus-width = <8>; - }; - }; - - sdhc_1: sdhci@7804000 { - compatible = "qcom,sdhci-msm-v5"; - reg = <0x7804000 0x1000>; - reg-names = "hc_mem"; - - interrupts = , - ; - interrupt-names = "hc_irq", "pwr_irq"; - - qcom,bus-width = <4>; - qcom,max_clk = <192000000>; - - qcom,dedicated-io = <1>; - - /* device core power supply */ - qcom,vdd-voltage-level = <2900000 2900000>; - qcom,vdd-current-level = <200 570000>; - - /* device communication power supply */ - qcom,vdd-io-lpm-sup; - qcom,vdd-io-voltage-level = <1800000 1800000>; - qcom,vdd-io-current-level = <200 325000>; - qcom,vdd-io-always-on; - - qcom,cpu-dma-latency-us = <701>; - qcom,msm-bus,name = "sdhc1"; - qcom,msm-bus,num-cases = <9>; - qcom,msm-bus,num-paths = <1>; - qcom,msm-bus,vectors-KBps = <78 512 0 0>, /* No vote */ - <78 512 1046 3200>, /* 400 KB/s*/ - <78 512 52286 160000>, /* 20 MB/s */ - <78 512 65360 200000>, /* 25 MB/s */ - <78 512 130718 400000>, /* 50 MB/s */ - <78 512 261438 800000>, /* 100 MB/s */ - <78 512 261438 800000>, /* 200 MB/s */ - <78 512 261438 800000>, /* 400 MB/s */ - <78 512 1338562 4096000>; /* Max. bandwidth */ - qcom,bus-bw-vectors-bps = <0 400000 20000000 25000000 \ - 50000000 100000000 200000000 \ - 400000000 4294967295>; - - clocks = <&gcc GCC_SDCC1_AHB_CLK>, - <&gcc GCC_SDCC1_APPS_CLK>; - clock-names = "iface_clk", "core_clk"; - qcom,large-address-bus; - qcom,disable-aggressive-pm; - status = "disabled"; - }; - - nss-common { - compatible = "qcom,nss-common"; - reg = <0x01868010 0x01>; - reg-names = "nss-misc-reset"; - }; - - nss0: nss@40000000 { - compatible = "qcom,nss"; - interrupts = <0 402 0x1>, <0 401 0x1>, <0 400 0x1>, - <0 399 0x1>, <0 398 0x1>, <0 397 0x1>, - <0 396 0x1>, <0 395 0x1>; - reg = <0x07a00000 0x100>, <0x0b111000 0x1000>; - reg-names = "nphys", "qgic-phys"; - clocks = <&gcc GCC_UBI0_CFG_CLK>, - <&gcc GCC_UBI0_DBG_CLK>, - <&gcc GCC_UBI0_CORE_CLK>, - <&gcc GCC_UBI0_UTCM_CLK>, - <&gcc GCC_UBI0_AXI_CLK>, - <&gcc GCC_SNOC_UBI0_AXI_CLK>, - <&gcc GCC_UBI0_NC_AXI_CLK>; - clock-names = "nss-cfg-clk", "nss-dbg-clk", - "nss-core-clk", "nss-utcm-clk", - "nss-axi-clk", - "nss-snoc-axi-clk", - "nss-nc-axi-clk"; - qcom,id = <0>; - qcom,num-queue = <4>; - qcom,num-irq = <8>; - qcom,num-pri = <4>; - qcom,load-addr = <0x40000000>; - qcom,low-frequency = <850000000>; - qcom,mid-frequency = <850000000>; - qcom,max-frequency = <1000000000>; - qcom,ipv4-enabled; - qcom,ipv4-reasm-enabled; - qcom,ipv6-enabled; - qcom,ipv6-reasm-enabled; - qcom,wlanredirect-enabled; - qcom,tun6rd-enabled; - qcom,l2tpv2-enabled; - qcom,gre-enabled; - qcom,gre-redir-enabled; - qcom,gre-redir-mark-enabled; - qcom,map-t-enabled; - qcom,portid-enabled; - qcom,pppoe-enabled; - qcom,pptp-enabled; - qcom,tunipip6-enabled; - qcom,shaping-enabled; - qcom,wlan-dataplane-offload-enabled; - qcom,pvxlan-enabled; - qcom,clmap-enabled; - qcom,vxlan-enabled; - qcom,match-enabled; - qcom,mirror-enabled; - qcom,crypto-enabled; - qcom,ipsec-enabled; - qcom,rmnet_rx-enabled; - qcom,udp-st-enabled; - }; - - nss-dp-common { - compatible = "qcom,nss-dp-common"; - qcom,tcsr-base = <0x01937000>; - }; - - nss_crypto: qcom,nss_crypto { - compatible = "qcom,nss-crypto"; - #address-cells = <1>; - #size-cells = <1>; - qcom,max-contexts = <64>; - qcom,max-context-size = <144>; - ranges; - ce5_node { - compatible = "qcom,ce5"; - reg-names = "crypto_pbase", "bam_base"; - reg = <0x0073a000 0x6000>, - <0x00704000 0x20000>; - qcom,dma-mask = <0x0c>; - qcom,transform-enabled; - qcom,aes128-cbc; - qcom,aes256-cbc; - qcom,aes128-ctr; - qcom,aes256-ctr; - qcom,aes128-ecb; - qcom,aes256-ecb; - qcom,3des-cbc; - qcom,sha160-hash; - qcom,sha256-hash; - qcom,sha160-hmac; - qcom,sha256-hmac; - qcom,aes128-cbc-sha160-hmac; - qcom,aes256-cbc-sha160-hmac; - qcom,aes128-ctr-sha160-hmac; - qcom,aes256-ctr-sha160-hmac; - qcom,3des-cbc-sha160-hmac; - qcom,3des-cbc-sha256-hmac; - qcom,aes128-cbc-sha256-hmac; - qcom,aes256-cbc-sha256-hmac; - qcom,aes128-ctr-sha256-hmac; - qcom,aes256-ctr-sha256-hmac; - engine0 { - qcom,ee = <2 3>; - }; - }; - }; - - acc0:clock-controller@b188000 { - compatible = "qcom,arm-cortex-acc"; - reg = <0x0b188000 0x1000>; - }; - - acc1:clock-controller@b198000 { - compatible = "qcom,arm-cortex-acc"; - reg = <0x0b198000 0x1000>; - }; - - qcom_rng: qrng@e1000 { - compatible = "qcom,prng-ipq807x"; - reg = <0xe3000 0x1000>; - clocks = <&gcc GCC_PRNG_AHB_CLK>; - clock-names = "core"; - status = "ok"; - }; - - qca,scm_restart_reason { - compatible = "qca,scm_restart_reason"; - dload_status = <0>; - dload_warm_reset = <0>; - }; - - watchdog: watchdog@b017000 { - compatible = "qcom,kpss-wdt-ipq5018"; - reg = <0xb017000 0x1000>; - reg-names = "kpss_wdt"; - interrupt-names = "bark_irq"; - interrupts = ; - clocks = <&sleep_clk>; - timeout-sec = <10>; - wdt-max-timeout = <32>; - }; - - apcs: syscon@b111000 { - compatible = "syscon"; - reg = <0x0B111000 0x1000>; - }; - - wcss: smp2p-wcss { - compatible = "qcom,smp2p"; - qcom,smem = <435>, <428>; - - interrupt-parent = <&intc>; - interrupts = <0 177 1>; - - qcom,ipc = <&apcs 8 9>; - - qcom,local-pid = <0>; - qcom,remote-pid = <1>; - - wcss_smp2p_out: master-kernel { - qcom,entry-name = "master-kernel"; - qcom,smp2p-feature-ssr-ack; - #qcom,smem-state-cells = <1>; - }; - - wcss_smp2p_in: slave-kernel { - qcom,entry-name = "slave-kernel"; - interrupt-controller; - #interrupt-cells = <2>; - }; - }; - - q6v5_wcss: q6v5_wcss@CD00000 { - compatible = "qca,q6v5-wcss-rproc-ipq50xx"; - firmware = "IPQ5018/q6_fw.mdt"; - reg = <0xCD00000 0x10000>, - <0x194f000 0x10>, - <0x1952000 0x10>, - <0x4ab000 0x20>, - <0x1818000 0x10>, - <0x1859000 0x10>, - <0x1945000 0x10>, - <0x193D204 0x4>; - reg-names = "wcss-base", - "tcsr-q6-base", - "tcsr-base", - "mpm-base", - "gcc-wcss-bcr-base", - "gcc-wcss-misc-base", - "tcsr-global", - "tcsr-q6-boot-trig"; - qca,auto-restart; - qca,extended-intc; - qca,dump-q6-reg; - qca,emulation; - interrupts-extended = <&intc 0 291 1>, - <&wcss_smp2p_in 0 0>, - <&wcss_smp2p_in 1 0>, - <&wcss_smp2p_in 3 0>; - interrupt-names = "wdog", - "qcom,gpio-err-fatal", - "qcom,gpio-err-ready", - "qcom,gpio-stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 0>, - <&wcss_smp2p_out 1>; - qcom,smem-state-names = "shutdown", - "stop"; - }; - - q6v5_m3: q6v5_m3 { - compatible = "qca,q6v5-m3-rproc"; - firmware = "IPQ5018/m3_fw.mdt"; - qca,auto-restart; - qcom,restart-group = <&q6v5_m3 &q6v5_wcss>; - }; - - tcsr_mutex_block: syscon@1905000 { - compatible = "syscon"; - reg = <0x1905000 0x8000>; - }; - - tcsr_mutex: hwlock@1905000 { - compatible = "qcom,tcsr-mutex"; - syscon = <&tcsr_mutex_block 0 0x80>; - #hwlock-cells = <1>; - }; - - smem: qcom,smem@4AB00000 { - compatible = "qcom,smem"; - memory-region = <&smem_region>; - hwlocks = <&tcsr_mutex 0>; - }; - - apcs_glb: mailbox@b111000 { - compatible = "qcom,msm8996-apcs-hmss-global"; - qcom,ipc = <&apcs 8 8>; - - #mbox-cells = <1>; - }; - - tcsr_q6_block: syscon@1945000 { - compatible = "syscon"; - reg = <0x1945000 0xE000>; - }; - - qcom_q6v5_wcss: qcom_q6v5_wcss@CD00000 { - compatible = "qcom,ipq5018-wcss-pil"; - firmware = "IPQ5018/q6_fw.mdt"; - m3_firmware = "IPQ5018/m3_fw.mdt"; - reg = <0xCD00000 0x4040>, - <0x4ab000 0x20>, - <0x4a1000 0x10>, - <0x1938000 0x8>, - <0x193D204 0x4>; - reg-names = "qdsp6", - "rmb", - "mpm", - "tcsr-msip", - "tcsr-q6-boot-trig"; - clocks = <&gcc GCC_Q6_AXIS_CLK>, - <&gcc GCC_WCSS_AHB_S_CLK>, - <&gcc GCC_WCSS_ECAHB_CLK>, - <&gcc GCC_WCSS_ACMT_CLK>, - <&gcc GCC_WCSS_AXI_M_CLK>, - <&gcc GCC_Q6_AXIM_CLK>, - <&gcc GCC_Q6_AXIM2_CLK>, - <&gcc GCC_Q6_AHB_CLK>, - <&gcc GCC_Q6_AHB_S_CLK>, - <&gcc GCC_WCSS_AXI_S_CLK>; - clock-names = "gcc_q6_axis_clk", - "gcc_wcss_ahb_s_clk", - "gcc_wcss_ecahb_clk", - "gcc_wcss_acmt_clk", - "gcc_wcss_axi_m_clk", - "gcc_q6_axim_clk", - "gcc_q6_axim2_clk", - "gcc_q6_ahb_clk", - "gcc_q6_ahb_s_clk", - "gcc_wcss_axi_s_clk"; - qca,auto-restart; - qca,extended-intc; - qca,wcss-aon-reset-seq; - interrupts-extended = <&intc 0 291 1>, - <&wcss_smp2p_in 0 0>, - <&wcss_smp2p_in 1 0>, - <&wcss_smp2p_in 2 0>, - <&wcss_smp2p_in 3 0>; - interrupt-names = "wdog", - "fatal", - "ready", - "handover", - "stop-ack"; - - resets = <&gcc GCC_WCSSAON_RESET>, - <&gcc GCC_WCSS_BCR>, - <&gcc GCC_WCSS_Q6_BCR>, - <&gcc GCC_CE_BCR>; - - reset-names = "wcss_aon_reset", - "wcss_reset", - "wcss_q6_reset", - "ce_reset"; - - qcom,halt-regs = <&tcsr_q6_block 0xA000 0xD000 0x0>; - - qcom,smem-states = <&wcss_smp2p_out 0>, - <&wcss_smp2p_out 1>; - qcom,smem-state-names = "shutdown", - "stop"; - - qcom,q6v6; - - glink-edge { - interrupts = ; - qcom,remote-pid = <1>; - mboxes = <&apcs_glb 8>; - - rpm_requests { - qcom,glink-channels = "IPCRTR"; - }; - }; - }; - - wifi0: wifi@c000000 { - compatible = "qcom,cnss-qca5018", "qcom,ipq5018-wifi"; - reg = <0xc000000 0x1000000>; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; - #else - qcom,tgt-mem-mode = <1>; - #endif - qcom,rproc = <&qcom_q6v5_wcss>; - interrupts = <0 288 1>, /* o_wcss_apps_intr[0] = */ - <0 289 1>, - <0 290 1>, - <0 292 1>, - <0 293 1>, - <0 294 1>, - <0 295 1>, - <0 296 1>, - <0 297 1>, - <0 298 1>, - <0 299 1>, - <0 300 1>, - <0 301 1>, - <0 302 1>, - <0 303 1>, - <0 304 1>, - <0 305 1>, - <0 306 1>, - <0 307 1>, - <0 308 1>, - <0 309 1>, - <0 310 1>, - <0 311 1>, - <0 312 1>, - <0 313 1>, /* o_wcss_apps_intr[25] */ - - <0 314 1>, - <0 315 1>, - <0 316 1>, - <0 317 1>, - <0 318 1>, - <0 319 1>, - <0 320 1>, - <0 321 1>, - <0 322 1>, - <0 323 1>, - <0 324 1>, - <0 325 1>, - - <0 326 1>, - - <0 327 1>, - <0 328 1>, - <0 329 1>, - <0 330 1>, - <0 331 1>, - <0 332 1>, - - <0 333 1>, - <0 334 1>, - <0 335 1>, - <0 336 1>, - <0 337 1>, - <0 338 1>, - <0 339 1>; /* o_wcss_apps_intr[51] */ - - interrupt-names = "misc-pulse1", - "misc-latch", - "sw-exception", - "ce0", - "ce1", - "ce2", - "ce3", - "ce4", - "ce5", - "ce6", - "ce7", - "ce8", - "ce9", - "ce10", - "ce11", - "host2wbm-desc-feed", - "host2reo-re-injection", - "host2reo-command", - "host2rxdma-monitor-ring3", - "host2rxdma-monitor-ring2", - "host2rxdma-monitor-ring1", - "reo2ost-exception", - "wbm2host-rx-release", - "reo2host-status", - "reo2host-destination-ring4", - "reo2host-destination-ring3", - "reo2host-destination-ring2", - "reo2host-destination-ring1", - "rxdma2host-monitor-destination-mac3", - "rxdma2host-monitor-destination-mac2", - "rxdma2host-monitor-destination-mac1", - "ppdu-end-interrupts-mac3", - "ppdu-end-interrupts-mac2", - "ppdu-end-interrupts-mac1", - "rxdma2host-monitor-status-ring-mac3", - "rxdma2host-monitor-status-ring-mac2", - "rxdma2host-monitor-status-ring-mac1", - "host2rxdma-host-buf-ring-mac3", - "host2rxdma-host-buf-ring-mac2", - "host2rxdma-host-buf-ring-mac1", - "rxdma2host-destination-ring-mac3", - "rxdma2host-destination-ring-mac2", - "rxdma2host-destination-ring-mac1", - "host2tcl-input-ring4", - "host2tcl-input-ring3", - "host2tcl-input-ring2", - "host2tcl-input-ring1", - "wbm2host-tx-completions-ring3", - "wbm2host-tx-completions-ring2", - "wbm2host-tx-completions-ring1", - "tcl2host-status-ring"; - status = "disabled"; - qcom,pta-num = <0>; - qcom,coex-mode = <0x3>; - qcom,bt-active-time = <0>; - qcom,bt-priority-time = <0>; - qcom,coex-algo = <0x2>; - qcom,pta-priority = <0>; - }; - - wifi1: wifi1@c000000 { - compatible = "qcom,cnss-qcn6122", "qcom,qcn6122-wifi"; - qcom,rproc = <&qcom_q6v5_wcss>; - status = "disabled"; - }; - - wifi2: wifi2@c000000 { - compatible = "qcom,cnss-qcn6122", "qcom,qcn6122-wifi"; - qcom,rproc = <&qcom_q6v5_wcss>; - status = "disabled"; - }; - - i2c_0: i2c@78b7000 { - compatible = "qcom,i2c-qup-v2.2.1"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x78b7000 0x600>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_AHB_CLK>, - <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>; - clock-names = "iface", "core"; - clock-frequency = <400000>; - dmas = <&blsp_dma 9>, <&blsp_dma 8>; - dma-names = "rx", "tx"; - status = "disabled"; - }; - - tlmm: pinctrl@1000000 { - compatible = "qcom,ipq5018-pinctrl"; - reg = <0x1000000 0x300000>; - interrupts = <0x0 0xd0 0x0>; - gpio-controller; - #gpio-cells = <0x2>; - interrupt-controller; - #interrupt-cells = <0x2>; - }; - - dbm_1p5: dbm@0x8AF8000 { - compatible = "qcom,usb-dbm-1p5"; - reg = <0x8AF8000 0x300>; - qcom,reset-ep-after-lpm-resume; - }; - - hs_m31phy_0: hs_m31phy@5b000 { - compatible = "qca,m31-usb-hsphy"; - reg = <0x05b000 0x120>, - <0x08af8800 0x400>; - reg-names = "m31usb_phy_base", - "qscratch_base"; - phy_type= "utmi"; - - resets = <&gcc GCC_QUSB2_0_PHY_BCR>; - reset-names = "usb2_phy_reset"; - - status = "disabled"; - }; - - ssuniphy_0: ssuniphy@5d000 { - compatible = "qca,ipq5018-uni-ssphy"; - reg = <0x5d000 0x800>; - clocks = <&gcc GCC_USB0_PIPE_CLK>, - <&gcc GCC_USB0_PHY_CFG_AHB_CLK>; - - clock-names = "pipe_clk", "phy_cfg_ahb_clk"; - - resets = <&gcc GCC_USB0_PHY_BCR>; - reset-names = "por_rst"; - #phy-cells = <0>; - status = "disabled"; - }; - - usb3: usb3@8A00000 { - compatible = "qcom,ipq5018-dwc3"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - reg = <0x8AF8800 0x100>, - <0x8A00000 0xe000>; - reg-names = "qscratch_base", "dwc3_base"; - clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>, - <&gcc GCC_USB0_MASTER_CLK>, - <&gcc GCC_USB0_SLEEP_CLK>, - <&gcc GCC_USB0_MOCK_UTMI_CLK>, - <&gcc GCC_USB0_PHY_CFG_AHB_CLK>, - <&gcc GCC_USB0_AUX_CLK>, - <&gcc GCC_USB0_LFPS_CLK>, - <&gcc GCC_USB0_PIPE_CLK>; - clock-names = "sys_noc_axi", - "master", - "sleep", - "mock_utmi", - "cfg_ahb_clk", - "aux_clk", - "lfps_clk", - "pipe_clk"; - assigned-clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>, - <&gcc GCC_USB0_MASTER_CLK>, - <&gcc GCC_USB0_MOCK_UTMI_CLK>; - assigned-clock-rates = <133330000>, - <133330000>, - <60000000>; - resets = <&gcc GCC_USB0_BCR>; - reset-names = "usb30_mstr_rst"; - qca,host = <1>; - qcom,usb-dbm = <&dbm_1p5>; - status = "disabled"; - - dwc_0: dwc3@8A00000 { - compatible = "snps,dwc3"; - reg = <0x8A00000 0xe000>; - interrupts = ; - usb-phy = <&hs_m31phy_0>; - #phy-cells = <0>; - phys = <&ssuniphy_0>; - phy-names = "usb3-phy"; - snps,dis_ep_cache_eviction; - tx-fifo-resize; - snps,usb3-u1u2-disable; - snps,nominal-elastic-buffer; - snps,is-utmi-l1-suspend; - snps,hird-threshold = /bits/ 8 <0x0>; - snps,dis_u2_susphy_quirk; - snps,dis_u3_susphy_quirk; - snps,quirk-ref-clock-adjustment = <0x49459>; - snps,quirk-ref-clock-period = <0x10>; - snps,quirk-30m-sb-sel = <0x0>; - dr_mode = "host"; - }; - }; - - qcom,usbbam@8B04000 { - compatible = "qcom,usb-bam-msm"; - reg = <0x8B04000 0x17000>; - interrupt-parent = <&intc>; - interrupts = <0 135 0>; - - qcom,bam-type = <0>; - qcom,usb-bam-fifo-baseaddr = <0x4A600000>; - qcom,usb-bam-num-pipes = <4>; - qcom,ignore-core-reset-ack; - qcom,disable-clk-gating; - qcom,usb-bam-override-threshold = <0x4001>; - qcom,usb-bam-max-mbps-highspeed = <400>; - qcom,usb-bam-max-mbps-superspeed = <3600>; - qcom,reset-bam-on-connect; - - qcom,pipe0 { - label = "ssusb-qdss-in-0"; - qcom,usb-bam-mem-type = <2>; - qcom,dir = <1>; - qcom,pipe-num = <0>; - qcom,peer-bam = <0>; - qcom,peer-bam-physical-address = <0x6064000>; - qcom,src-bam-pipe-index = <0>; - qcom,dst-bam-pipe-index = <0>; - qcom,data-fifo-offset = <0x0>; - qcom,data-fifo-size = <0xe00>; - qcom,descriptor-fifo-offset = <0xe00>; - qcom,descriptor-fifo-size = <0x200>; - }; - }; - - qcom,diag@0 { - compatible = "qcom,diag"; - status = "ok"; - }; - - pcie_x1phy: phy@7e000{ - compatible = "qca,uni-pcie-phy-gen2"; - reg = <0x7e000 0x800>; - phy-type = "gen2"; - #phy-cells = <0>; - clocks = <&gcc GCC_PCIE1_PIPE_CLK>; - clock-names = "pipe_clk"; - - resets = <&gcc GCC_PCIE1_PHY_BCR>, - <&gcc GCC_PCIE1PHY_PHY_BCR>; - reset-names = "phy", - "phy_phy"; - mode_fixed = <2>; - status = "disabled"; - }; - - pcie_x1: pci@80000000 { - compatible = "qcom,pcie-ipq5018"; - reg = <0x80000000 0xf1d - 0x80000F20 0xa8 - 0x80001000 0x1000 - 0x78000 0x3000 - 0x80100000 0x1000>; - reg-names = "dbi", "elbi", "dm_iatu", "parf", "config"; - device_type = "pci"; - linux,pci-domain = <0>; - bus-range = <0x00 0xff>; - num-lanes = <1>; - #address-cells = <3>; - #size-cells = <2>; - - phys = <&pcie_x1phy>; - phy-names ="pciephy"; - force_gen2 = <1>; - - ranges = <0x81000000 0 0x80200000 0x80200000 - 0 0x00100000 /* downstream I/O */ - 0x82000000 0 0x80300000 0x80300000 - 0 0x10000000>; /* non-prefetchable memory */ - - interrupts = , - <0 416 IRQ_TYPE_NONE>, <0 417 IRQ_TYPE_NONE>, - <0 418 IRQ_TYPE_NONE>, <0 419 IRQ_TYPE_NONE>, - <0 420 IRQ_TYPE_NONE>, <0 421 IRQ_TYPE_NONE>, - <0 422 IRQ_TYPE_NONE>, <0 423 IRQ_TYPE_NONE>, - <0 424 IRQ_TYPE_NONE>, <0 425 IRQ_TYPE_NONE>, - <0 426 IRQ_TYPE_NONE>, <0 427 IRQ_TYPE_NONE>, - <0 428 IRQ_TYPE_NONE>, <0 429 IRQ_TYPE_NONE>, - <0 430 IRQ_TYPE_NONE>, <0 431 IRQ_TYPE_NONE>, - <0 432 IRQ_TYPE_NONE>, <0 433 IRQ_TYPE_NONE>, - <0 434 IRQ_TYPE_NONE>, <0 435 IRQ_TYPE_NONE>, - <0 436 IRQ_TYPE_NONE>, <0 437 IRQ_TYPE_NONE>, - <0 438 IRQ_TYPE_NONE>, <0 439 IRQ_TYPE_NONE>, - <0 440 IRQ_TYPE_NONE>, <0 441 IRQ_TYPE_NONE>, - <0 442 IRQ_TYPE_NONE>, <0 443 IRQ_TYPE_NONE>, - <0 444 IRQ_TYPE_NONE>, <0 445 IRQ_TYPE_NONE>, - <0 446 IRQ_TYPE_NONE>, <0 447 IRQ_TYPE_NONE>; - interrupt-names = "msi", "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15", "msi_16", - "msi_17", "msi_18", "msi_19", - "msi_20", "msi_21", "msi_22", - "msi_23", "msi_24", "msi_25", - "msi_26", "msi_27", "msi_28", - "msi_29", "msi_30", "msi_31"; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0x7>; - interrupt-map = <0 0 0 1 &intc 0 142 - IRQ_TYPE_LEVEL_HIGH>, /* int_a */ - <0 0 0 2 &intc 0 143 - IRQ_TYPE_LEVEL_HIGH>, /* int_b */ - <0 0 0 3 &intc 0 144 - IRQ_TYPE_LEVEL_HIGH>, /* int_c */ - <0 0 0 4 &intc 0 145 - IRQ_TYPE_LEVEL_HIGH>; /* int_d */ - - clocks = <&gcc GCC_SYS_NOC_PCIE1_AXI_CLK>, - <&gcc GCC_PCIE1_AXI_M_CLK>, - <&gcc GCC_PCIE1_AXI_S_CLK>, - <&gcc GCC_PCIE1_AHB_CLK>, - <&gcc GCC_PCIE1_AUX_CLK>, - <&gcc GCC_PCIE1_AXI_S_BRIDGE_CLK>; - - clock-names = "sys_noc", - "axi_m", - "axi_s", - "ahb", - "aux", - "axi_bridge"; - - resets = <&gcc GCC_PCIE1_PIPE_ARES>, - <&gcc GCC_PCIE1_SLEEP_ARES>, - <&gcc GCC_PCIE1_CORE_STICKY_ARES>, - <&gcc GCC_PCIE1_AXI_MASTER_ARES>, - <&gcc GCC_PCIE1_AXI_SLAVE_ARES>, - <&gcc GCC_PCIE1_AHB_ARES>, - <&gcc GCC_PCIE1_AXI_MASTER_STICKY_ARES>, - <&gcc GCC_PCIE1_AXI_SLAVE_STICKY_ARES>; - - reset-names = "pipe", - "sleep", - "sticky", - "axi_m", - "axi_s", - "ahb", - "axi_m_sticky", - "axi_s_sticky"; - - qcom,msi-gicm-addr = <0x0B00A040>; - qcom,msi-gicm-base = <0x1c0>; - - status = "disabled"; - - pcie_x1_rp: pcie_x1_rp { - reg = <0 0 0 0 0>; - }; - }; - - pcie_x2phy: phy@86000{ - compatible = "qca,uni-pcie-phy-gen2"; - reg = <0x86000 0x800 0x86800 0x800>; - phy-type = "gen2"; - #phy-cells = <0>; - clocks = <&gcc GCC_PCIE0_PIPE_CLK>; - clock-names = "pipe_clk"; - - resets = <&gcc GCC_PCIE0_PHY_BCR>, - <&gcc GCC_PCIE0PHY_PHY_BCR>; - reset-names = "phy", - "phy_phy"; - mode_fixed = <2>; - x2 = <1>; - status = "disabled"; - }; - - pcie_x2: pci@a0000000 { - compatible = "qcom,pcie-ipq5018"; - reg = <0xa0000000 0xf1d - 0xa0000F20 0xa8 - 0xa0001000 0x1000 - 0x80000 0x3000 - 0xa0100000 0x1000>; - reg-names = "dbi", "elbi", "dm_iatu", "parf", "config"; - device_type = "pci"; - linux,pci-domain = <1>; - bus-range = <0x00 0xff>; - num-lanes = <2>; - #address-cells = <3>; - #size-cells = <2>; - - phys = <&pcie_x2phy>; - phy-names ="pciephy"; - force_gen2 = <1>; - - ranges = <0x81000000 0 0xa0200000 0xa0200000 - 0 0x00100000 /* downstream I/O */ - 0x82000000 0 0xa0300000 0xa0300000 - 0 0x10000000>; /* non-prefetchable memory */ - - interrupts = , - <0 448 IRQ_TYPE_NONE>, <0 449 IRQ_TYPE_NONE>, - <0 450 IRQ_TYPE_NONE>, <0 451 IRQ_TYPE_NONE>, - <0 452 IRQ_TYPE_NONE>, <0 453 IRQ_TYPE_NONE>, - <0 454 IRQ_TYPE_NONE>, <0 455 IRQ_TYPE_NONE>, - <0 456 IRQ_TYPE_NONE>, <0 457 IRQ_TYPE_NONE>, - <0 458 IRQ_TYPE_NONE>, <0 459 IRQ_TYPE_NONE>, - <0 460 IRQ_TYPE_NONE>, <0 461 IRQ_TYPE_NONE>, - <0 462 IRQ_TYPE_NONE>, <0 463 IRQ_TYPE_NONE>, - <0 464 IRQ_TYPE_NONE>, <0 465 IRQ_TYPE_NONE>, - <0 466 IRQ_TYPE_NONE>, <0 467 IRQ_TYPE_NONE>, - <0 468 IRQ_TYPE_NONE>, <0 469 IRQ_TYPE_NONE>, - <0 470 IRQ_TYPE_NONE>, <0 471 IRQ_TYPE_NONE>, - <0 472 IRQ_TYPE_NONE>, <0 473 IRQ_TYPE_NONE>, - <0 474 IRQ_TYPE_NONE>, <0 475 IRQ_TYPE_NONE>, - <0 476 IRQ_TYPE_NONE>, <0 477 IRQ_TYPE_NONE>, - <0 478 IRQ_TYPE_NONE>, <0 479 IRQ_TYPE_NONE>; - interrupt-names = "msi", "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15", "msi_16", - "msi_17", "msi_18", "msi_19", - "msi_20", "msi_21", "msi_22", - "msi_23", "msi_24", "msi_25", - "msi_26", "msi_27", "msi_28", - "msi_29", "msi_30", "msi_31"; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0x7>; - interrupt-map = <0 0 0 1 &intc 0 75 - IRQ_TYPE_LEVEL_HIGH>, /* int_a */ - <0 0 0 2 &intc 0 78 - IRQ_TYPE_LEVEL_HIGH>, /* int_b */ - <0 0 0 3 &intc 0 79 - IRQ_TYPE_LEVEL_HIGH>, /* int_c */ - <0 0 0 4 &intc 0 83 - IRQ_TYPE_LEVEL_HIGH>; /* int_d */ - - clocks = <&gcc GCC_SYS_NOC_PCIE0_AXI_CLK>, - <&gcc GCC_PCIE0_AXI_M_CLK>, - <&gcc GCC_PCIE0_AXI_S_CLK>, - <&gcc GCC_PCIE0_AHB_CLK>, - <&gcc GCC_PCIE0_AUX_CLK>, - <&gcc GCC_PCIE0_AXI_S_BRIDGE_CLK>; - - clock-names = "sys_noc", - "axi_m", - "axi_s", - "ahb", - "aux", - "axi_bridge"; - - resets = <&gcc GCC_PCIE0_PIPE_ARES>, - <&gcc GCC_PCIE0_SLEEP_ARES>, - <&gcc GCC_PCIE0_CORE_STICKY_ARES>, - <&gcc GCC_PCIE0_AXI_MASTER_ARES>, - <&gcc GCC_PCIE0_AXI_SLAVE_ARES>, - <&gcc GCC_PCIE0_AHB_ARES>, - <&gcc GCC_PCIE0_AXI_MASTER_STICKY_ARES>, - <&gcc GCC_PCIE0_AXI_SLAVE_STICKY_ARES>; - - reset-names = "pipe", - "sleep", - "sticky", - "axi_m", - "axi_s", - "ahb", - "axi_m_sticky", - "axi_s_sticky"; - - qcom,msi-gicm-addr = <0x0B00B040>; - qcom,msi-gicm-base = <0x1e0>; - - status = "disabled"; - - pcie_x2_rp: pcie_x2_rp { - reg = <0 0 0 0 0>; - }; - }; - - qgic_msi_0: qti,qgic2m-msi_0 { - compatible = "qti,qgic2m-msi"; - - interrupts = <0 416 IRQ_TYPE_NONE>, <0 417 IRQ_TYPE_NONE>, - <0 418 IRQ_TYPE_NONE>, <0 419 IRQ_TYPE_NONE>, - <0 420 IRQ_TYPE_NONE>, <0 421 IRQ_TYPE_NONE>, - <0 422 IRQ_TYPE_NONE>, <0 423 IRQ_TYPE_NONE>, - <0 424 IRQ_TYPE_NONE>, <0 425 IRQ_TYPE_NONE>, - <0 426 IRQ_TYPE_NONE>, <0 427 IRQ_TYPE_NONE>, - <0 428 IRQ_TYPE_NONE>, <0 429 IRQ_TYPE_NONE>, - <0 430 IRQ_TYPE_NONE>, <0 431 IRQ_TYPE_NONE>, - <0 432 IRQ_TYPE_NONE>, <0 433 IRQ_TYPE_NONE>, - <0 434 IRQ_TYPE_NONE>, <0 435 IRQ_TYPE_NONE>, - <0 436 IRQ_TYPE_NONE>, <0 437 IRQ_TYPE_NONE>, - <0 438 IRQ_TYPE_NONE>, <0 439 IRQ_TYPE_NONE>, - <0 440 IRQ_TYPE_NONE>, <0 441 IRQ_TYPE_NONE>, - <0 442 IRQ_TYPE_NONE>, <0 443 IRQ_TYPE_NONE>, - <0 444 IRQ_TYPE_NONE>, <0 445 IRQ_TYPE_NONE>, - <0 446 IRQ_TYPE_NONE>, <0 447 IRQ_TYPE_NONE>; - interrupt-names = "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15", "msi_16", - "msi_17", "msi_18", "msi_19", - "msi_20", "msi_21", "msi_22", - "msi_23", "msi_24", "msi_25", - "msi_26", "msi_27", "msi_28", - "msi_29", "msi_30", "msi_31"; - - qti,msi-gicm-addr = <0x0B00A040>; - qti,msi-gicm-base = <0x1c0>; - - status = "disabled"; - }; - - qgic_msi_1: qti,qgic2m-msi_1 { - compatible = "qti,qgic2m-msi"; - - interrupts = <0 448 IRQ_TYPE_NONE>, <0 449 IRQ_TYPE_NONE>, - <0 450 IRQ_TYPE_NONE>, <0 451 IRQ_TYPE_NONE>, - <0 452 IRQ_TYPE_NONE>, <0 453 IRQ_TYPE_NONE>, - <0 454 IRQ_TYPE_NONE>, <0 455 IRQ_TYPE_NONE>, - <0 456 IRQ_TYPE_NONE>, <0 457 IRQ_TYPE_NONE>, - <0 458 IRQ_TYPE_NONE>, <0 459 IRQ_TYPE_NONE>, - <0 460 IRQ_TYPE_NONE>, <0 461 IRQ_TYPE_NONE>, - <0 462 IRQ_TYPE_NONE>, <0 463 IRQ_TYPE_NONE>, - <0 464 IRQ_TYPE_NONE>, <0 465 IRQ_TYPE_NONE>, - <0 466 IRQ_TYPE_NONE>, <0 467 IRQ_TYPE_NONE>, - <0 468 IRQ_TYPE_NONE>, <0 469 IRQ_TYPE_NONE>, - <0 470 IRQ_TYPE_NONE>, <0 471 IRQ_TYPE_NONE>, - <0 472 IRQ_TYPE_NONE>, <0 473 IRQ_TYPE_NONE>, - <0 474 IRQ_TYPE_NONE>, <0 475 IRQ_TYPE_NONE>, - <0 476 IRQ_TYPE_NONE>, <0 477 IRQ_TYPE_NONE>, - <0 478 IRQ_TYPE_NONE>, <0 479 IRQ_TYPE_NONE>; - interrupt-names = "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15", "msi_16", - "msi_17", "msi_18", "msi_19", - "msi_20", "msi_21", "msi_22", - "msi_23", "msi_24", "msi_25", - "msi_26", "msi_27", "msi_28", - "msi_29", "msi_30", "msi_31"; - - qti,msi-gicm-addr = <0x0B00B040>; - qti,msi-gicm-base = <0x1e0>; - - status = "disabled"; - }; - - qcom,test@0 { - compatible = "qcom,testmhi"; - status = "ok"; - }; - - tzlog: qca,tzlog { - compatible = "qca,tzlog_ipq50xx"; - interrupts = ; - qca,tzbsp-diag-buf-size = <0x2000>; - }; - - eud: qcom,msm-eud{ - compatible = "qcom,msm-eud"; - reg = <0x58000 0x1000>, - <0x59000 0x2000>, - <0x5a000 0x1000>; - reg-names = "eud_base", - "eud_mode_mgr", - "eud_mode_mgr2"; - interrupts = ; - interrupt-names = "eud_irq"; - status = "disabled"; - }; - - bt: bt@7000000 { - compatible = "qcom,bt"; - firmware = "IPQ5018/bt_fw_patch.mdt"; - - reg = <0x01943008 0x8>; - reg-names = "bt_warm_rst"; - memory-region = <&bt_region>; - - qcom,ipc = <&apcs 8 23>; - interrupts = ; - - resets = <&gcc GCC_BTSS_BCR>; - reset-names = "btss_reset"; - - clocks = <&gcc GCC_BTSS_LPO_CLK>; - clock-names = "lpo_clk"; - }; - lpass: lpass@0xA000000{ - compatible = "qca,lpass-ipq5018"; - reg = <0xA000000 0x3BFFFF>; - clocks = <&gcc GCC_SNOC_LPASS_AXIM_CLK>, - <&gcc GCC_SNOC_LPASS_SWAY_CLK>, - <&gcc GCC_LPASS_CORE_AXIM_CLK>, - <&gcc GCC_LPASS_SWAY_CLK>; - clock-names = "snoc_axim", "snoc_sway", "axim", "sway"; - resets = <&gcc GCC_LPASS_BCR>; - reset-names = "lpass"; - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - compatible = "qca,ipq5018-lpass-pcm"; - reg = <0xA3C0000 0x23014>; - interrupts = <0 27 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "out0"; - capture_memory = "lpm"; - playback_memory = "lpm"; - voice_loopback = <0>; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - compatible = "qca,ipq5018-pcm-lb"; - status = "disabled"; - }; - }; - - cpus { - #address-cells = <0x1>; - #size-cells = <0x0>; - - CPU0: cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a53"; - reg = <0x0>; - enable-method = "psci"; - qcom,acc = <&acc0>; - next-level-cache = <&L2_0>; - clocks = <&apss_clk APCS_ALIAS0_CORE_CLK>; - clock-names = "cpu"; - operating-points = < - /* kHz uV (fixed) */ - 800000 1100000 - 1008000 1100000 - >; - clock-latency = <200000>; - }; - - CPU1: cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a53"; - reg = <0x1>; - enable-method = "psci"; - qcom,acc = <&acc1>; - next-level-cache = <&L2_0>; - clocks = <&apss_clk APCS_ALIAS0_CORE_CLK>; - clock-names = "cpu"; - operating-points = < - /* kHz uV (fixed) */ - 800000 1100000 - 1008000 1100000 - >; - clock-latency = <200000>; - }; - - L2_0: l2-cache { - compatible = "cache"; - cache-level = <0x2>; - }; - }; - - clocks { - sleep_clk: sleep_clk { - compatible = "fixed-clock"; - clock-frequency = <32000>; - #clock-cells = <0>; - }; - - xo: xo { - compatible = "fixed-clock"; - clock-frequency = <24000000>; - #clock-cells = <0>; - }; - }; - - pmuv8: pmu { - compatible = "arm,cortex-a53-pmu"; - interrupts = ; - }; - - firmware { - scm { - compatible = "qcom,scm-ipq5018"; - }; - qfprom_sec { - compatible = "qcom,qfprom-sec"; - img-addr = <0x4A800000>; - img-size = <0x00400000>; - }; - }; - -}; - -#include "qcom-ipq5018-coresight.dtsi" -#include "qcom-ipq5018-thermal.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts deleted file mode 100644 index a5751eb40..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186h.dts +++ /dev/null @@ -1,1007 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "CIG wf186h"; - compatible = "cig,wf186h","qcom,ipq5018-mp03.3", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 13MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CD00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4CF00000 | 15MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4DE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4DF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E000000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F100000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3000000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4c000000 { - no-map; - reg = <0x0 0x4c000000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4CD00000 { - no-map; - reg = <0x0 0x4CD00000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4DE00000 { - no-map; - reg = <0x0 0x4DE00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4DF00000 { - no-map; - reg = <0x0 0x4DF00000 0x0 0x100000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E000000 { - no-map; - reg = <0x0 0x4E000000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4F100000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F100000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x50700000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@50700000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x50700000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x51600000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@51600000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x51600000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 35 0>; - cig_clk_div = <0xff>; - ethernet-phy@0 { - reg = <0x1d>; - }; - }; - - realtek@29{ - compatible = "realtek,rtl8367s"; - mii-bus = <&mdio1>; - realtek,extif0 = <0 0 10 1 1 1 1 1 2>; - switch = <&tlmm 35 0>; - phy-addr = <29>; - status = "ok"; - }; - ess-instance { - num_devices = <0x1>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - }; - - wifi0: wifi@c000000 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - - qcom,test@0 { - status = "ok"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "rst"; - linux,code = ; - gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&phy_led_pins>; - pinctrl-names = "default"; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio31", "gpio33"; - function = "blsp1_uart1"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - leds_pins: leds_pins { - led_pwr_g { - pins = "gpio0"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_pwr_b { - pins = "gpio1"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_pwr_r { - pins = "gpio45"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - rst_button { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - }; - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - }; - - pwm_pins: pwm_pinmux { - mux_1 { - pins = "gpio0"; - function = "pwm10"; - drive-strength = <8>; - }; - mux_2 { - pins = "gpio1"; - function = "pwm20"; - drive-strength = <8>; - }; - mux_3 { - pins = "gpio45"; - function = "pwm3"; - drive-strength = <8>; - }; - }; - -}; - -&soc { - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led3 { - label = "blue:status"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "blue-on"; - default-state = "off"; - }; - led2 { - label = "red:status"; - gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "red-on"; - default-state = "off"; - }; - led_power: led1 { - label = "green:status"; - gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "default-on"; - default-state = "on"; - }; - }; - -}; - -&usb3 { - status = "disabled"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "ok"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "disabled"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "disabled"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x21>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - qcom,caldb-addr = <0x4FF00000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; - qcom,board_id = <0xa4>; -#endif - }; -}; - -&wifi3 { - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x2 0x4 0x2 0x12 0x0 0x0>; - - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4D000000 0 0 0>; -#else - qcom,caldb-addr = <0x4D000000>; - m3-dump-addr = <0x4CE00000>; -#endif - qcom,caldb-size = <0x200000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4E400000 0 0 0>; -#else - qcom,caldb-addr = <0x4E400000>; - m3-dump-addr = <0x4E200000>; -#endif - qcom,caldb-size = <0x500000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts deleted file mode 100755 index 96b7b80de..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts +++ /dev/null @@ -1,1007 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "CIG wf186w"; - compatible = "cig,wf186w","qcom,ipq5018-mp03.3", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 13MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CD00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4CF00000 | 15MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4DE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4DF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E000000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F100000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3000000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4c000000 { - no-map; - reg = <0x0 0x4c000000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4CD00000 { - no-map; - reg = <0x0 0x4CD00000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4DE00000 { - no-map; - reg = <0x0 0x4DE00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4DF00000 { - no-map; - reg = <0x0 0x4DF00000 0x0 0x100000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E000000 { - no-map; - reg = <0x0 0x4E000000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4F100000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F100000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x50700000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@50700000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x50700000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x51600000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@51600000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x51600000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 35 0>; - cig_clk_div = <0xff>; - ethernet-phy@0 { - reg = <0x1d>; - }; - }; - - realtek@29{ - compatible = "realtek,rtl8367s"; - mii-bus = <&mdio1>; - realtek,extif0 = <0 0 10 1 1 1 1 1 2>; - switch = <&tlmm 35 0>; - phy-addr = <29>; - status = "ok"; - }; - ess-instance { - num_devices = <0x1>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - }; - - wifi0: wifi@c000000 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - - qcom,test@0 { - status = "ok"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "rst"; - linux,code = ; - gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&phy_led_pins>; - pinctrl-names = "default"; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio31", "gpio33"; - function = "blsp1_uart1"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - leds_pins: leds_pins { - led_pwr_g { - pins = "gpio0"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_pwr_b { - pins = "gpio1"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_pwr_r { - pins = "gpio45"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - rst_button { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - }; - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - }; - - pwm_pins: pwm_pinmux { - mux_1 { - pins = "gpio0"; - function = "pwm10"; - drive-strength = <8>; - }; - mux_2 { - pins = "gpio1"; - function = "pwm20"; - drive-strength = <8>; - }; - mux_3 { - pins = "gpio45"; - function = "pwm3"; - drive-strength = <8>; - }; - }; - -}; - -&soc { - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led3 { - label = "blue:status"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "blue-on"; - default-state = "off"; - }; - led2 { - label = "red:status"; - gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "red-on"; - default-state = "off"; - }; - led_power: led1 { - label = "green:status"; - gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "default-on"; - default-state = "on"; - }; - }; - -}; - -&usb3 { - status = "disabled"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "ok"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "disabled"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "disabled"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x21>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - qcom,caldb-addr = <0x4FF00000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; - qcom,board_id = <0xa4>; -#endif - }; -}; - -&wifi3 { - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x2 0x4 0x2 0x12 0x0 0x0>; - - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4D000000 0 0 0>; -#else - qcom,caldb-addr = <0x4D000000>; - m3-dump-addr = <0x4CE00000>; -#endif - qcom,caldb-size = <0x200000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4E400000 0 0 0>; -#else - qcom,caldb-addr = <0x4E400000>; - m3-dump-addr = <0x4E200000>; -#endif - qcom,caldb-size = <0x500000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eap104.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eap104.dts deleted file mode 100755 index d4db6f2ec..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eap104.dts +++ /dev/null @@ -1,1030 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Edgecore EAP104"; - compatible = "edgecore,eap104", "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 8MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x40800000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 13MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D100000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D300000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4E400000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4F300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4F400000 | 1MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x4500000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x1400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4D100000 { - no-map; - reg = <0x0 0x4D100000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 { - no-map; - reg = <0x0 0x4F300000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 { - no-map; - reg = <0x0 0x4F400000 0x0 0x100000>; - }; - #else - /* 512MB/1GB Profiles - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 14MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D300000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | Caldb | 0x4D400000 | 2MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D600000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E600000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E700000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | Caldb | 0x4E800000 | 5MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4ED00000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4FD00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4FE00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | Caldb | 0x4FF00000 | 5MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x5400000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D400000 { - no-map; - reg = <0x0 0x4D400000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D600000 { - no-map; - reg = <0x0 0x4D600000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 { - no-map; - reg = <0x0 0x4E600000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 { - no-map; - reg = <0x0 0x4E700000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 { - no-map; - reg = <0x0 0x4E800000 0x0 0x500000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { - no-map; - reg = <0x0 0x4ED00000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 { - no-map; - reg = <0x0 0x4FD00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 { - no-map; - reg = <0x0 0x4FE00000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 { - no-map; - reg = <0x0 0x4FF00000 0x0 0x500000>; - }; - - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - - ethernet-phy@0 { - reg = <0>; - }; - - ethernet-phy@1 { - reg = <1>; - }; - - ethernet-phy@2 { - reg = <2>; - }; - - ethernet-phy@3 { - reg = <3>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - - /* - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - */ - - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - }; - - wifi0: wifi@c000000 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; - - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - mcu-bootloader { - gpio-export,name = "mcu-bootloader"; - gpio-export,output = <0>; - gpios = <&tlmm 35 GPIO_ACTIVE_LOW>; - }; - - mcu-enable { - gpio-export,name = "mcu-enable"; - gpio-export,output = <0>; - gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - wps { - label = "reset"; - linux,code = ; - gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@2 { - label = "green:wifi5"; - gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - led@3 { - label = "green:wifi2"; - gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - led_power: led@30 { - label = "green:power"; - gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - led@42 { - label = "orange:uplink"; - gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - led@43 { - label = "yellow:uplink"; - gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - led@46 { - label = "green:cloud"; - gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &mcu_pins>; - pinctrl-names = "default"; - - mcu_pins: mcu_pins { - mcu_rst { - pins = "gpio31"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-low; - }; - - mcu_sbl { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-low; - }; - }; - - leds_pins: leds_pins { - led_5g { - pins = "gpio2"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio3"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_power { - pins = "gpio30"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_orange { - pins = "gpio42"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_yellow { - pins = "gpio43"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_cloud { - pins = "gpio46"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - blsp0_uart_pins: uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio33"; - function = "blsp2_i2c0"; - drive-strength = <8>; - /* bias-disable; */ - bias-pull-up; - }; - - i2c_sda { - pins = "gpio34"; - function = "blsp2_i2c0"; - drive-strength = <8>; - /* bias-disable; */ - bias-pull-up; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -/* Disable gpio 38 and 24 -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -&usb3 { - status = "ok"; - device-power-gpio = <&tlmm 24 1>; -}; - -*/ - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "disabled"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "disabled"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - - }; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>, - <0x2 0x4 0x2 0x12 0x0 0x0>; - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 6G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd3 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 24 0>, - <&wcss_smp2p_in 25 0>, - <&wcss_smp2p_in 28 0>, - <&wcss_smp2p_in 27 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 24>, - <&wcss_smp2p_out 25>, - <&wcss_smp2p_out 26>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <3>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>; - #else - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - /* status = "disabled"; */ - status = "ok"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&qgic_msi_1 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x23>; - qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>; -#else - qcom,caldb-addr = <0x4D400000>; - m3-dump-addr = <0x4D200000>; -#endif - qcom,caldb-size = <0x200000>; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x50>; - qcom,bdf-addr = <0x4D600000 0x4D600000 0x4D300000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4E800000 0x4E800000 0 0 0>; -#else - qcom,caldb-addr = <0x4E800000>; - m3-dump-addr = <0x4E600000>; -#endif - qcom,caldb-size = <0x500000>; - status = "disabled"; -}; - -&wifi2 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0xb0>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww622-a1.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww622-a1.dts deleted file mode 100755 index c029130da..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww622-a1.dts +++ /dev/null @@ -1,901 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP03.1"; - compatible = "qcom,ipq5018-mp03.1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - AUTO_MOUNT; - #endif - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - led-boot = &led_sys; - led-failsafe = &led_sys; - led-running = &led_sys; - led-upgrade = &led_sys; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 23MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C700000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4C900000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4DA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01700000>; - }; - - m3_dump@4c700000 { - no-map; - reg = <0x0 0x4C700000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - qcn9000_pcie0@4c900000 { - no-map; - reg = <0x0 0x4C900000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4da00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4da00000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4EA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@4ea00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4ea00000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F900000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@4F900000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F900000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - ethernet-phy@0 { - reg = <0>; - }; - - ethernet-phy@1 { - reg = <1>; - }; - - ethernet-phy@2 { - reg = <2>; - }; - - ethernet-phy@3 { - reg = <3>; - }; - - ethernet-phy@4 { - reg = <4>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <2>; - mode = "normal"; - speed = "1000M"; - blink_en = "enable"; - active = "high"; - }; - led_source@1 { - source = <0>; - mode = "normal"; - speed = "100M"; - blink_en = "enable"; - active = "high"; - }; - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap */ - switch_lan_bmp = <0x3c>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <4>; - }; - }; - }; - }; - - wifi0: wifi@c000000 { - qcom,bdf-addr = <0x4BA00000 0x4BA00000 0x4BA00000 - 0x0 0x0>; - qcom,caldb-addr = <0x4CA00000 0x4CA00000 0x4CA00000 - 0x0 0x0>; - qcom,caldb-size = <0x200000>; - status = "ok"; - }; - - ess-uniphy@98000 { - status = "disabled"; - }; - - qcom,sps { - status = "ok"; - }; - - qcom,usbbam@8B04000 { - status = "ok"; - }; - - qcom,diag@0 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - rpm_etm0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: blsp0_uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin_1g { - pins = "gpio30"; - function = "led2"; - drive-strength = <8>; - bias-pull-down; - }; - gephy_led_pin_100 { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - reset_button { - pins = "gpio28"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - leds_pins: leds_pinmux { - sys_blue { - pins = "gpio1"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - sys_green { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - sys_red { - pins = "gpio31"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - }; - -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - - button@2 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 28 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - gpio_leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_sys: led@1 { - label = "sys:blue"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; /* GPIO_1 */ - default-state="on"; - }; - led@35 { - label = "sys:green"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; /* GPIO_35 */ - default-state="off"; - }; - led@31 { - label = "sys:red"; - gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; /* GPIO_31 */ - default-state="off"; - }; - }; -}; - -&usb3 { - qcom,multiplexed-phy; - qcom,phy-mux-regs = <&tcsr_q6_block 0x2540>; - device-power-gpio = <&tlmm 24 1>; - status = "ok"; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&bt { - status = "ok"; -}; - -&wcss { - status = "ok"; -}; - -&q6v5_wcss { - status = "disabled"; -}; - -&q6v5_m3 { - status = "disabled"; -}; - -&tcsr_mutex_block { - status = "ok"; -}; - -&tcsr_mutex { - status = "ok"; -}; - -&smem { - status = "ok"; -}; - -&apcs_glb { - status = "ok"; -}; - -&tcsr_q6_block { - status = "ok"; -}; - -&qcom_q6v5_wcss { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_region>, <&q6_etr_region>; - #else - memory-region = <&q6_region>, <&q6_etr_region>, - <&q6_caldb_region>; - #endif - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&dbm_1p5 { - status = "ok"; -}; - -&msm_imem { - status = "ok"; -}; - -&blsp1_uart1 { - status = "ok"; -}; - -&ssuniphy_0 { - status = "ok"; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x20>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4CC00000>; - m3-dump-addr = <0x4E000000>; - etr-addr = <0x4E100000>; - qcom,caldb-addr = <0x4E200000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; -#endif - }; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,board_id = <0x24>; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 5G */ - board_id = <0xa0>; - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-a1.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-a1.dts deleted file mode 100644 index 406ca05fe..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-a1.dts +++ /dev/null @@ -1,908 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP03.5-C1"; - compatible = "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 8MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x40800000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 13MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D100000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D300000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4E400000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4F300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4F400000 | 1MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x4500000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x1400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4D100000 { - no-map; - reg = <0x0 0x4D100000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 { - no-map; - reg = <0x0 0x4F300000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 { - no-map; - reg = <0x0 0x4F400000 0x0 0x100000>; - }; - #else - /* 512MB/1GB Profiles - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 14MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D300000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | Caldb | 0x4D400000 | 2MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D600000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E600000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E700000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | Caldb | 0x4E800000 | 5MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4ED00000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4FD00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4FE00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | Caldb | 0x4FF00000 | 5MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x5400000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D400000 { - no-map; - reg = <0x0 0x4D400000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D600000 { - no-map; - reg = <0x0 0x4D600000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 { - no-map; - reg = <0x0 0x4E600000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 { - no-map; - reg = <0x0 0x4E700000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 { - no-map; - reg = <0x0 0x4E800000 0x0 0x500000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { - no-map; - reg = <0x0 0x4ED00000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 { - no-map; - reg = <0x0 0x4FD00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 { - no-map; - reg = <0x0 0x4FE00000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 { - no-map; - reg = <0x0 0x4FF00000 0x0 0x500000>; - }; - - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "disabled"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - - ethernet-phy@0 { - reg = <28>; - }; - }; - - ess-instance { - num_devices = <0x1>; - ess-switch@0x39c00000 { - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - mdiobus = <&mdio0>; - }; - /* - port@1 { - port_id = <2>; - phy_address = <0x1c>; - mdiobus = <&mdio1>; - port_mac_sel = "QGMAC_PORT"; - }; - */ - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - /* - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - mdio-bus = <&mdio1>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - */ - - qcom,test@0 { - status = "ok"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: blsp0_uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio28"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - leds_pins: leds_pinmux { - sys_blue { - pins = "gpio30"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - sys_red { - pins = "gpio36"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - sys_green { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - }; -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 28 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - gpio_leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@30 { - label = "sys:blue"; - gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; /* GPIO_30 */ - default-state="on"; - /* linux,default-trigger = "timer"; - active-delay = <700>; - inactive-delay = <700>; - default-state="on"; */ - }; - led@36 { - label = "sys:red"; - gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; /* GPIO_36 */ - default-state="off"; - /* linux,default-trigger = "timer"; - active-delay = <700>; - inactive-delay = <700>; - default-state="on"; */ - }; - led@37 { - label = "sys:green"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; /* GPIO_37 */ - default-state="off"; - /* linux,default-trigger = "timer"; - active-delay = <700>; - inactive-delay = <700>; - default-state="on"; */ - }; - }; - -}; - -&usb3 { - status = "disabled"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "disabled"; - perst-gpio = <&tlmm 15 1>; -}; - -&bt { - status = "ok"; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "disabled"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - - }; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>, - <0x2 0x4 0x2 0x12 0x0 0x0>; - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 6G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd3 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 24 0>, - <&wcss_smp2p_in 25 0>, - <&wcss_smp2p_in 28 0>, - <&wcss_smp2p_in 27 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 24>, - <&wcss_smp2p_out 25>, - <&wcss_smp2p_out 26>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <3>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>; - #else - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&qgic_msi_1 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>; -#else - qcom,caldb-addr = <0x4D400000>; - m3-dump-addr = <0x4D200000>; -#endif - qcom,caldb-size = <0x200000>; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "ok"; -}; - -&wifi2 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0xb0>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "disabled"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-b1.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-b1.dts deleted file mode 100755 index 032d0e705..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-b1.dts +++ /dev/null @@ -1,971 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP03.5-C1"; - compatible = "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 8MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x40800000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 13MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D100000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D300000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4E400000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4F300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4F400000 | 1MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x4500000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x1400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4D100000 { - no-map; - reg = <0x0 0x4D100000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 { - no-map; - reg = <0x0 0x4F300000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 { - no-map; - reg = <0x0 0x4F400000 0x0 0x100000>; - }; - #else - /* 512MB/1GB Profiles - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 14MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D300000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | Caldb | 0x4D400000 | 2MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D600000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E600000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E700000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | Caldb | 0x4E800000 | 5MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4ED00000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4FD00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4FE00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | Caldb | 0x4FF00000 | 5MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x5400000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D400000 { - no-map; - reg = <0x0 0x4D400000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D600000 { - no-map; - reg = <0x0 0x4D600000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 { - no-map; - reg = <0x0 0x4E600000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 { - no-map; - reg = <0x0 0x4E700000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 { - no-map; - reg = <0x0 0x4E800000 0x0 0x500000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { - no-map; - reg = <0x0 0x4ED00000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 { - no-map; - reg = <0x0 0x4FD00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 { - no-map; - reg = <0x0 0x4FE00000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 { - no-map; - reg = <0x0 0x4FF00000 0x0 0x500000>; - }; - - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; -/* - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; -*/ - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 38 0>; - - ethernet-phy@0 { - reg = <0>; - }; - - ethernet-phy@1 { - reg = <1>; - }; - - ethernet-phy@2 { - reg = <2>; - }; - - ethernet-phy@3 { - reg = <3>; - }; - - ethernet-phy@4 { - reg = <4>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x26>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap (Port 6 GMAC) */ - switch_lan_bmp = <0x3c>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <4>; - }; - }; - }; - }; - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - -/* - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; -*/ - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins>; //<&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: blsp0_uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; -/* - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; -*/ - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; -/* - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; -*/ - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio28"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; -/* - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; -*/ - poe_pins: poe_pinmux { - /* - LAN port PoE output enable - H --> enable; L --> disable (Default setting to H) - */ - mux_0 { /* PoE_OUT_EN */ - pins = "gpio24"; - function = "gpio"; - drive-strength = <2>; - bias-pull-up; - output-high; - }; - - mux_1 { /* PSE_INT_N */ - pins = "gpio27"; - function = "gpio"; - bias-pull-up; - input; - }; - }; - - leds_pins: leds_pinmux { - sys_green { - pins = "gpio1"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - sys_blue { - pins = "gpio30"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - sys_red { - pins = "gpio46"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - }; -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 28 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - gpio_leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@1 { - label = "sys:green"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; /* GPIO_1/ATST_QP0 */ - default-state="off"; - }; - led@30 { - label = "sys:blue"; - gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; /* GPIO_30 */ - default-state="on"; - }; - led@46 { - label = "sys:red"; - gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; /* GPIO_46 */ - default-state="off"; - }; - }; -}; - -&usb3 { - status = "disabled"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "disabled"; - perst-gpio = <&tlmm 15 1>; -}; - -&bt { - status = "disabled"; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "disabled"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - - }; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>, - <0x2 0x4 0x2 0x12 0x0 0x0>; - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 6G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd3 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 24 0>, - <&wcss_smp2p_in 25 0>, - <&wcss_smp2p_in 28 0>, - <&wcss_smp2p_in 27 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 24>, - <&wcss_smp2p_out 25>, - <&wcss_smp2p_out 26>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <3>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>; - #else - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&qgic_msi_1 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>; -#else - qcom,caldb-addr = <0x4D400000>; - m3-dump-addr = <0x4D200000>; -#endif - qcom,caldb-size = <0x200000>; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "ok"; -}; - -&wifi2 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0xb0>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "disabled"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4x_w.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4x_w.dts deleted file mode 100755 index 6165d26d8..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4x_w.dts +++ /dev/null @@ -1,1063 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018-hfcl-ion4xi_w.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "HFCL ION4x_w"; - compatible = "hfcl,ion4x_w", "qcom,ipq5018-mp03.3", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; -// ethernet1 = "/soc/dp2"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 13MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CD00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4CF00000 | 15MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4DE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4DF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E000000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F100000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3000000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4c000000 { - no-map; - reg = <0x0 0x4c000000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4CD00000 { - no-map; - reg = <0x0 0x4CD00000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4DE00000 { - no-map; - reg = <0x0 0x4DE00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4DF00000 { - no-map; - reg = <0x0 0x4DF00000 0x0 0x100000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E000000 { - no-map; - reg = <0x0 0x4E000000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4F100000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F100000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x50700000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@50700000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x50700000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x51600000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@51600000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x51600000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - - ethernet-phy@0 { - reg = <28>; - }; - }; - - ess-instance { - num_devices = <0x1>; - ess-switch@0x39c00000 { - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - mdiobus = <&mdio0>; - }; - port@1 { - port_id = <2>; - phy_address = <0x1c>; - mdiobus = <&mdio1>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - }; - - wifi0: wifi@c000000 { - status = "ok"; - }; - -/* dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; -*/ - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - mdio-bus = <&mdio1>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - mdiobus = <&mdio1>; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - led_pins: led_pinmux { - mux_1 { - pins = "gpio38"; - function = "gpio"; - bias-pull-down; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio14"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_power: led@38 { - label = "blue:status"; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - }; - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 14 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -&usb3 { - status = "ok"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x21>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - qcom,caldb-addr = <0x4FF00000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; - qcom,board_id = <0xa4>; -#endif - }; -}; - -&wifi3 { - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x2 0x4 0x2 0x12 0x0 0x0>; - - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x23>; - qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4D000000 0 0 0>; -#else - qcom,caldb-addr = <0x4D000000>; - m3-dump-addr = <0x4CE00000>; -#endif - qcom,caldb-size = <0x200000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4E400000 0 0 0>; -#else - qcom,caldb-addr = <0x4E400000>; - m3-dump-addr = <0x4E200000>; -#endif - qcom,caldb-size = <0x500000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 6G */ - compatible = "qcom,cnss-qcn9000"; - board_id = <0xa4>; - status = "ok"; - qrtr_node_id = <0x21>; -#ifdef __IPQ_MEM_PROFILE_256_MB__ || __IPQ_FLASH_16M_PROFILE__ - /* QCN9000 tgt-mem-mode=2 layout - 17MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E000000 | 15MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4EF00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4F000000 | 1MB | - * +==================================+ - */ - base-addr = <0x4E000000>; - m3-dump-addr = <0x4EF00000>; - etr-addr = <0x4F000000>; - caldb-addr = <0>; - caldb-size = <0>; - hremote-size = <0xF00000>; - tgt-mem-mode = <0x2>; -#elif __IPQ_MEM_PROFILE_512_MB__ - /* QCN9000 tgt-mem-mode=1 layout - 30MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 20MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4FD00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4FE00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x4FF00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - caldb-addr = <0x4FF00000>; - caldb-size = <0x800000>; - hremote-size = <0x1400000>; - tgt-mem-mode = <0x1>; -#else - /* QCN9000 tgt-mem-mode=0 layout - 45MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 35MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x50C00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x50D00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x50E00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x50C00000>; - etr-addr = <0x50D00000>; - caldb-addr = <0x50E00000>; - hremote-size = <0x2300000>; - caldb-size = <0x800000>; - tgt-mem-mode = <0x0>; -#endif -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_HMR.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_HMR.dts deleted file mode 100755 index b6d09cf04..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_HMR.dts +++ /dev/null @@ -1,1059 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-hfcl-ion4xi_HMR.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "HFCL ION4xi_HMR"; - compatible = "hfcl,ion4xi_HMR", "qcom,ipq5018-mp03.3", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 13MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CD00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4CF00000 | 15MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4DE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4DF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E000000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F100000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3000000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4c000000 { - no-map; - reg = <0x0 0x4c000000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4CD00000 { - no-map; - reg = <0x0 0x4CD00000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4DE00000 { - no-map; - reg = <0x0 0x4DE00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4DF00000 { - no-map; - reg = <0x0 0x4DF00000 0x0 0x100000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E000000 { - no-map; - reg = <0x0 0x4E000000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4F100000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F100000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x50700000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@50700000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x50700000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x51600000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@51600000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x51600000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - - ethernet-phy@0 { - reg = <28>; - }; - }; - - ess-instance { - num_devices = <0x1>; - ess-switch@0x39c00000 { - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - mdiobus = <&mdio0>; - }; - port@1 { - port_id = <2>; - phy_address = <0x1c>; - mdiobus = <&mdio1>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - }; - - wifi0: wifi@c000000 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - mdio-bus = <&mdio1>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - mdiobus = <&mdio1>; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - button_pins: button_pins { - reset_button { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -//&usb3 { -// status = "ok"; -// device-power-gpio = <&tlmm 24 1>; -//}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x21>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - qcom,caldb-addr = <0x4FF00000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; - qcom,board_id = <0xa4>; -#endif - }; -}; - -&wifi3 { - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x2 0x4 0x2 0x12 0x0 0x0>; - - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4D000000 0 0 0>; -#else - qcom,caldb-addr = <0x4D000000>; - m3-dump-addr = <0x4CE00000>; -#endif - qcom,caldb-size = <0x200000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4E400000 0 0 0>; -#else - qcom,caldb-addr = <0x4E400000>; - m3-dump-addr = <0x4E200000>; -#endif - qcom,caldb-size = <0x500000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 6G */ - compatible = "qcom,cnss-qcn9000"; - board_id = <0xa4>; - status = "ok"; - qrtr_node_id = <0x21>; -#ifdef __IPQ_MEM_PROFILE_256_MB__ || __IPQ_FLASH_16M_PROFILE__ - /* QCN9000 tgt-mem-mode=2 layout - 17MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E000000 | 15MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4EF00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4F000000 | 1MB | - * +==================================+ - */ - base-addr = <0x4E000000>; - m3-dump-addr = <0x4EF00000>; - etr-addr = <0x4F000000>; - caldb-addr = <0>; - caldb-size = <0>; - hremote-size = <0xF00000>; - tgt-mem-mode = <0x2>; -#elif __IPQ_MEM_PROFILE_512_MB__ - /* QCN9000 tgt-mem-mode=1 layout - 30MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 20MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4FD00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4FE00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x4FF00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - caldb-addr = <0x4FF00000>; - caldb-size = <0x800000>; - hremote-size = <0x1400000>; - tgt-mem-mode = <0x1>; -#else - /* QCN9000 tgt-mem-mode=0 layout - 45MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 35MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x50C00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x50D00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x50E00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x50C00000>; - etr-addr = <0x50D00000>; - caldb-addr = <0x50E00000>; - hremote-size = <0x2300000>; - caldb-size = <0x800000>; - tgt-mem-mode = <0x0>; -#endif -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dts deleted file mode 100755 index 9e90782c1..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dts +++ /dev/null @@ -1,1063 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018-hfcl-ion4xi_w.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "HFCL ION4xi_w"; - compatible = "hfcl,ion4xi_w", "qcom,ipq5018-mp03.3", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; -// ethernet1 = "/soc/dp2"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 13MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CD00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4CF00000 | 15MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4DE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4DF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E000000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F100000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3000000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4c000000 { - no-map; - reg = <0x0 0x4c000000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4CD00000 { - no-map; - reg = <0x0 0x4CD00000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4DE00000 { - no-map; - reg = <0x0 0x4DE00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4DF00000 { - no-map; - reg = <0x0 0x4DF00000 0x0 0x100000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E000000 { - no-map; - reg = <0x0 0x4E000000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4F100000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F100000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x50700000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@50700000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x50700000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x51600000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@51600000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x51600000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - - ethernet-phy@0 { - reg = <28>; - }; - }; - - ess-instance { - num_devices = <0x1>; - ess-switch@0x39c00000 { - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - mdiobus = <&mdio0>; - }; - port@1 { - port_id = <2>; - phy_address = <0x1c>; - mdiobus = <&mdio1>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - }; - - wifi0: wifi@c000000 { - status = "ok"; - }; - -/* dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; -*/ - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - mdio-bus = <&mdio1>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - mdiobus = <&mdio1>; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - led_pins: led_pinmux { - mux_1 { - pins = "gpio38"; - function = "gpio"; - bias-pull-down; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio14"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_power: led@38 { - label = "blue:status"; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - }; - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 14 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -&usb3 { - status = "ok"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x21>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - qcom,caldb-addr = <0x4FF00000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; - qcom,board_id = <0xa4>; -#endif - }; -}; - -&wifi3 { - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x2 0x4 0x2 0x12 0x0 0x0>; - - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x23>; - qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4D000000 0 0 0>; -#else - qcom,caldb-addr = <0x4D000000>; - m3-dump-addr = <0x4CE00000>; -#endif - qcom,caldb-size = <0x200000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4E400000 0 0 0>; -#else - qcom,caldb-addr = <0x4E400000>; - m3-dump-addr = <0x4E200000>; -#endif - qcom,caldb-size = <0x500000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 6G */ - compatible = "qcom,cnss-qcn9000"; - board_id = <0xa4>; - status = "ok"; - qrtr_node_id = <0x21>; -#ifdef __IPQ_MEM_PROFILE_256_MB__ || __IPQ_FLASH_16M_PROFILE__ - /* QCN9000 tgt-mem-mode=2 layout - 17MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E000000 | 15MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4EF00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4F000000 | 1MB | - * +==================================+ - */ - base-addr = <0x4E000000>; - m3-dump-addr = <0x4EF00000>; - etr-addr = <0x4F000000>; - caldb-addr = <0>; - caldb-size = <0>; - hremote-size = <0xF00000>; - tgt-mem-mode = <0x2>; -#elif __IPQ_MEM_PROFILE_512_MB__ - /* QCN9000 tgt-mem-mode=1 layout - 30MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 20MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4FD00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4FE00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x4FF00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - caldb-addr = <0x4FF00000>; - caldb-size = <0x800000>; - hremote-size = <0x1400000>; - tgt-mem-mode = <0x1>; -#else - /* QCN9000 tgt-mem-mode=0 layout - 45MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 35MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x50C00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x50D00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x50E00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x50C00000>; - etr-addr = <0x50D00000>; - caldb-addr = <0x50E00000>; - hremote-size = <0x2300000>; - caldb-size = <0x800000>; - tgt-mem-mode = <0x0>; -#endif -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dtsi deleted file mode 100755 index 614547e0a..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-hfcl-ion4xi_w.dtsi +++ /dev/null @@ -1,1441 +0,0 @@ -/* - * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include "qcom-ipq5018-memory.dtsi" -#include "qcom-ipq5018-mhi.dtsi" -#include "ipq5018_clocks.dtsi" - -/ { - model = "Qualcomm Technologies, Inc. IPQ5018"; - compatible = "qcom,ipq5018"; - - psci { - compatible = "arm,psci-1.0"; - method = "smc"; - status = "ok"; - }; - -#ifdef ENABLE_QSEECOM - qseecom { - compatible = "ipq5018-qseecom"; - mem-start = <0x4a400000>; - mem-size = <0x200000>; - }; -#endif - - soc: soc { - #address-cells = <0x1>; - #size-cells = <0x1>; - ranges = <0 0 0 0xffffffff>; - compatible = "simple-bus"; - - intc: interrupt-controller@b000000 { - compatible = "qcom,msm-qgic2"; - interrupt-controller; - #interrupt-cells = <0x3>; - reg = <0xb000000 0x1000>, <0xb002000 0x1000>; - ranges = <0x0 0xb00a000 0x1ffa>; - - v2m0: v2m@0 { - compatible = "arm,gic-v2m-frame"; - msi-controller; - reg = <0x0 0xffd>; - }; - - v2m1: v2m@1000 { - compatible = "arm,gic-v2m-frame"; - msi-controller; - reg = <0x1000 0xffd>; - }; - }; - - timer { - compatible = "arm,armv8-timer"; - interrupts = , - , - , - ; - clock-frequency = <24000000>; - }; - - gcc: gcc@1800000 { - compatible = "qcom,gcc-ipq5018"; - reg = <0x1800000 0x80000>; - #clock-cells = <0x1>; - #reset-cells = <0x1>; - }; - - apss_clk: qcom,apss_clk@b111000 { - compatible = "qcom,apss-ipq5018"; - reg = <0xb111000 0x6000>; - #clock-cells = <0x1>; - #reset-cells = <1>; - }; - - blsp1_uart2: serial@78b0000 { - compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; - reg = <0x78b0000 0x200>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>, - <&gcc GCC_BLSP1_AHB_CLK>; - clock-names = "core", "iface"; - status = "disabled"; - }; - - blsp1_uart1: serial@78af000 { - compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; - reg = <0x78af000 0x200>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>, - <&gcc GCC_BLSP1_AHB_CLK>; - clock-names = "core", "iface"; - status = "disabled"; - }; - - blsp_dma: dma@7884000 { - compatible = "qcom,bam-v1.7.0"; - reg = <0x07884000 0x1d000>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_AHB_CLK>; - clock-names = "bam_clk"; - #dma-cells = <1>; - qcom,ee = <0>; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - compatible = "qcom,spi-qup-v2.2.1"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x78b5000 0x600>; - interrupts = ; - spi-max-frequency = <50000000>; - clocks = <&gcc GCC_BLSP1_QUP1_SPI_APPS_CLK>, - <&gcc GCC_BLSP1_AHB_CLK>; - clock-names = "core", "iface"; - dmas = <&blsp_dma 4>, <&blsp_dma 5>; - dma-names = "tx", "rx"; - status = "disabled"; - }; - pwm { - compatible = "qca,ipq6018-pwm"; - reg = <0x1941010 0x20>; - clocks = <&gcc GCC_ADSS_PWM_CLK>; - clock-names = "core"; - src-freq = <100000000>; - pwm-base-index = <0>; - used-pwm-indices = <1>, <1>, <1>, <1>; - status = "disabled"; - }; - - mdio0: mdio@88000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "qcom,qca-mdio", "qcom,ipq40xx-mdio"; - reg = <0x88000 0x64>; - status = "disabled"; - resets = <&gcc GCC_GEPHY_MDC_SW_ARES>; - reset-names = "gephy_mdc_rst"; - }; - - mdio1: mdio@90000 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "qcom,qca-mdio"; - reg = <0x90000 0x64>; - status = "disabled"; - }; - ess-instance { - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - reg = <0x39c00000 0x200000>; - switch_access_mode = "local bus"; - clocks = <&gcc GCC_CMN_BLK_AHB_CLK>, - <&gcc GCC_CMN_BLK_SYS_CLK>, - <&gcc GCC_UNIPHY_AHB_CLK>, - <&gcc GCC_UNIPHY_SYS_CLK>, - <&gcc GCC_MDIO0_AHB_CLK>, - <&gcc GCC_MDIO1_AHB_CLK>, - <&gcc GCC_GMAC0_CFG_CLK>, - <&gcc GCC_GMAC0_SYS_CLK>, - <&gcc GCC_GMAC1_CFG_CLK>, - <&gcc GCC_GMAC1_SYS_CLK>, - <&gcc GCC_GEPHY_RX_CLK>, - <&gcc GCC_GEPHY_TX_CLK>, - <&gcc GCC_UNIPHY_RX_CLK>, - <&gcc GCC_UNIPHY_TX_CLK>, - <&gcc GCC_GMAC0_RX_CLK>, - <&gcc GCC_GMAC0_TX_CLK>, - <&gcc GCC_GMAC1_RX_CLK>, - <&gcc GCC_GMAC1_TX_CLK>, - <&gcc GCC_SNOC_GMAC0_AHB_CLK>, - <&gcc GCC_SNOC_GMAC1_AHB_CLK>, - <&gcc GCC_GMAC0_PTP_CLK>, - <&gcc GCC_GMAC1_PTP_CLK>; - clock-names = "cmn_ahb_clk", "cmn_sys_clk", - "uniphy_ahb_clk", "uniphy_sys_clk", - "gcc_mdio0_ahb_clk", - "gcc_mdio1_ahb_clk", - "gcc_gmac0_cfg_clk", - "gcc_gmac0_sys_clk", - "gcc_gmac1_cfg_clk", - "gcc_gmac1_sys_clk", - "uniphy0_port1_rx_clk", - "uniphy0_port1_tx_clk", - "uniphy1_port5_rx_clk", - "uniphy1_port5_tx_clk", - "nss_port1_rx_clk", "nss_port1_tx_clk", - "nss_port2_rx_clk", "nss_port2_tx_clk", - "gcc_snoc_gmac0_ahb_clk", - "gcc_snoc_gmac1_ahb_clk", - "gcc_gmac0_ptp_clk", - "gcc_gmac1_ptp_clk"; - resets = <&gcc GCC_GEPHY_BCR>, <&gcc GCC_UNIPHY_BCR>, - <&gcc GCC_GMAC0_BCR>, <&gcc GCC_GMAC1_BCR>, - <&gcc GCC_UNIPHY_SOFT_RESET>, - <&gcc GCC_GEPHY_MISC_ARES>; - reset-names = "gephy_bcr_rst", "uniphy_bcr_rst", - "gmac0_bcr_rst", "gmac1_bcr_rst", - "uniphy1_soft_rst", - "gephy_misc_rst"; - }; - }; - - ess-uniphy@98000 { - compatible = "qcom,ess-uniphy"; - reg = <0x98000 0x800>; - uniphy_access_mode = "local bus"; - }; - - msm_imem: qcom,msm-imem@8600000 { - compatible = "qcom,msm-imem"; - reg = <0x08600000 0x1000>; - ranges = <0x0 0x08600000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - - mem_dump_table@10 { - compatible = "qcom,msm-imem-mem_dump_table"; - reg = <0x10 8>; - }; - }; - - cryptobam: dma@704000 { - compatible = "qcom,bam-v1.7.0"; - reg = <0x00704000 0x20000>; - interrupts = ; - clocks = <&gcc GCC_CRYPTO_AHB_CLK>; - clock-names = "bam_clk"; - #dma-cells = <1>; - qcom,ee = <1>; - qcom,controlled-remotely = <1>; - }; - - crypto: crypto@73a000 { - compatible = "qcom,crypto-v5.1"; - reg = <0x0073a000 0x6000>; - clocks = <&gcc GCC_CRYPTO_AHB_CLK>, - <&gcc GCC_CRYPTO_AXI_CLK>, - <&gcc GCC_CRYPTO_CLK>; - clock-names = "iface", "bus", "core"; - dmas = <&cryptobam 2>, <&cryptobam 3>; - dma-names = "rx", "tx"; - qce,cmd_desc_support; - }; - - qpic_bam: dma@7984000{ - compatible = "qcom,bam-v1.7.0"; - reg = <0x7984000 0x1c000>; - interrupts = ; - clocks = <&gcc GCC_QPIC_AHB_CLK>; - clock-names = "bam_clk"; - #dma-cells = <1>; - qcom,ee = <0>; - status = "disabled"; - }; - - qcom,sps { - compatible = "qcom,msm_sps_4k"; - qcom,pipe-attr-ee; - }; - - nand: qpic-nand@79b0000 { - compatible = "qcom,ebi2-nandc-bam-v2.1.1"; - reg = <0x79b0000 0x10000>; - #address-cells = <1>; - #size-cells = <0>; - clocks = <&gcc GCC_QPIC_CLK>, - <&gcc GCC_QPIC_AHB_CLK>, - <&gcc GCC_QPIC_IO_MACRO_CLK>; - clock-names = "core", "aon", "io_macro"; - - dmas = <&qpic_bam 0>, - <&qpic_bam 1>, - <&qpic_bam 2>, - <&qpic_bam 3>; - dma-names = "tx", "rx", "cmd", "status"; - - qpic,io_macro_clk_rates = <24000000 100000000 200000000 320000000>; - status = "disabled"; - - nandcs@0 { - compatible = "qcom,nandcs"; - reg = <0>; - #address-cells = <1>; - #size-cells = <1>; - - nand-ecc-strength = <4>; - nand-ecc-step-size = <512>; - nand-bus-width = <8>; - }; - }; - - sdhc_1: sdhci@7804000 { - compatible = "qcom,sdhci-msm-v5"; - reg = <0x7804000 0x1000>; - reg-names = "hc_mem"; - - interrupts = , - ; - interrupt-names = "hc_irq", "pwr_irq"; - - qcom,bus-width = <4>; - qcom,max_clk = <192000000>; - - qcom,dedicated-io = <1>; - - /* device core power supply */ - qcom,vdd-voltage-level = <2900000 2900000>; - qcom,vdd-current-level = <200 570000>; - - /* device communication power supply */ - qcom,vdd-io-lpm-sup; - qcom,vdd-io-voltage-level = <1800000 1800000>; - qcom,vdd-io-current-level = <200 325000>; - qcom,vdd-io-always-on; - - qcom,cpu-dma-latency-us = <701>; - qcom,msm-bus,name = "sdhc1"; - qcom,msm-bus,num-cases = <9>; - qcom,msm-bus,num-paths = <1>; - qcom,msm-bus,vectors-KBps = <78 512 0 0>, /* No vote */ - <78 512 1046 3200>, /* 400 KB/s*/ - <78 512 52286 160000>, /* 20 MB/s */ - <78 512 65360 200000>, /* 25 MB/s */ - <78 512 130718 400000>, /* 50 MB/s */ - <78 512 261438 800000>, /* 100 MB/s */ - <78 512 261438 800000>, /* 200 MB/s */ - <78 512 261438 800000>, /* 400 MB/s */ - <78 512 1338562 4096000>; /* Max. bandwidth */ - qcom,bus-bw-vectors-bps = <0 400000 20000000 25000000 \ - 50000000 100000000 200000000 \ - 400000000 4294967295>; - - clocks = <&gcc GCC_SDCC1_AHB_CLK>, - <&gcc GCC_SDCC1_APPS_CLK>; - clock-names = "iface_clk", "core_clk"; - qcom,large-address-bus; - qcom,disable-aggressive-pm; - status = "disabled"; - }; - - nss-common { - compatible = "qcom,nss-common"; - reg = <0x01868010 0x01>; - reg-names = "nss-misc-reset"; - }; - - nss0: nss@40000000 { - compatible = "qcom,nss"; - interrupts = <0 402 0x1>, <0 401 0x1>, <0 400 0x1>, - <0 399 0x1>, <0 398 0x1>, <0 397 0x1>, - <0 396 0x1>, <0 395 0x1>; - reg = <0x07a00000 0x100>, <0x0b111000 0x1000>; - reg-names = "nphys", "qgic-phys"; - clocks = <&gcc GCC_UBI0_CFG_CLK>, - <&gcc GCC_UBI0_DBG_CLK>, - <&gcc GCC_UBI0_CORE_CLK>, - <&gcc GCC_UBI0_UTCM_CLK>, - <&gcc GCC_UBI0_AXI_CLK>, - <&gcc GCC_SNOC_UBI0_AXI_CLK>, - <&gcc GCC_UBI0_NC_AXI_CLK>; - clock-names = "nss-cfg-clk", "nss-dbg-clk", - "nss-core-clk", "nss-utcm-clk", - "nss-axi-clk", - "nss-snoc-axi-clk", - "nss-nc-axi-clk"; - qcom,id = <0>; - qcom,num-queue = <4>; - qcom,num-irq = <8>; - qcom,num-pri = <4>; - qcom,load-addr = <0x40000000>; - qcom,low-frequency = <850000000>; - qcom,mid-frequency = <850000000>; - qcom,max-frequency = <1000000000>; - qcom,ipv4-enabled; - qcom,ipv4-reasm-enabled; - qcom,ipv6-enabled; - qcom,ipv6-reasm-enabled; - qcom,wlanredirect-enabled; - qcom,tun6rd-enabled; - qcom,l2tpv2-enabled; - qcom,gre-enabled; - qcom,gre-redir-enabled; - qcom,gre-redir-mark-enabled; - qcom,map-t-enabled; - qcom,portid-enabled; - qcom,pppoe-enabled; - qcom,pptp-enabled; - qcom,tunipip6-enabled; - qcom,shaping-enabled; - qcom,wlan-dataplane-offload-enabled; - qcom,pvxlan-enabled; - qcom,clmap-enabled; - qcom,vxlan-enabled; - qcom,match-enabled; - qcom,mirror-enabled; - qcom,crypto-enabled; - qcom,ipsec-enabled; - qcom,rmnet_rx-enabled; - qcom,udp-st-enabled; - }; - - nss-dp-common { - compatible = "qcom,nss-dp-common"; - qcom,tcsr-base = <0x01937000>; - }; - - nss_crypto: qcom,nss_crypto { - compatible = "qcom,nss-crypto"; - #address-cells = <1>; - #size-cells = <1>; - qcom,max-contexts = <64>; - qcom,max-context-size = <144>; - ranges; - ce5_node { - compatible = "qcom,ce5"; - reg-names = "crypto_pbase", "bam_base"; - reg = <0x0073a000 0x6000>, - <0x00704000 0x20000>; - qcom,dma-mask = <0x0c>; - qcom,transform-enabled; - qcom,aes128-cbc; - qcom,aes256-cbc; - qcom,aes128-ctr; - qcom,aes256-ctr; - qcom,aes128-ecb; - qcom,aes256-ecb; - qcom,3des-cbc; - qcom,sha160-hash; - qcom,sha256-hash; - qcom,sha160-hmac; - qcom,sha256-hmac; - qcom,aes128-cbc-sha160-hmac; - qcom,aes256-cbc-sha160-hmac; - qcom,aes128-ctr-sha160-hmac; - qcom,aes256-ctr-sha160-hmac; - qcom,3des-cbc-sha160-hmac; - qcom,3des-cbc-sha256-hmac; - qcom,aes128-cbc-sha256-hmac; - qcom,aes256-cbc-sha256-hmac; - qcom,aes128-ctr-sha256-hmac; - qcom,aes256-ctr-sha256-hmac; - engine0 { - qcom,ee = <2 3>; - }; - }; - }; - - acc0:clock-controller@b188000 { - compatible = "qcom,arm-cortex-acc"; - reg = <0x0b188000 0x1000>; - }; - - acc1:clock-controller@b198000 { - compatible = "qcom,arm-cortex-acc"; - reg = <0x0b198000 0x1000>; - }; - - qcom_rng: qrng@e1000 { - compatible = "qcom,prng-ipq807x"; - reg = <0xe3000 0x1000>; - clocks = <&gcc GCC_PRNG_AHB_CLK>; - clock-names = "core"; - status = "ok"; - }; - - qca,scm_restart_reason { - compatible = "qca,scm_restart_reason"; - dload_status = <0>; - dload_warm_reset = <0>; - }; - - watchdog: watchdog@b017000 { - compatible = "qcom,kpss-wdt-ipq5018"; - reg = <0xb017000 0x1000>; - reg-names = "kpss_wdt"; - interrupt-names = "bark_irq"; - interrupts = ; - clocks = <&sleep_clk>; - timeout-sec = <10>; - wdt-max-timeout = <32>; - }; - - apcs: syscon@b111000 { - compatible = "syscon"; - reg = <0x0B111000 0x1000>; - }; - - wcss: smp2p-wcss { - compatible = "qcom,smp2p"; - qcom,smem = <435>, <428>; - - interrupt-parent = <&intc>; - interrupts = <0 177 1>; - - qcom,ipc = <&apcs 8 9>; - - qcom,local-pid = <0>; - qcom,remote-pid = <1>; - - wcss_smp2p_out: master-kernel { - qcom,entry-name = "master-kernel"; - qcom,smp2p-feature-ssr-ack; - #qcom,smem-state-cells = <1>; - }; - - wcss_smp2p_in: slave-kernel { - qcom,entry-name = "slave-kernel"; - interrupt-controller; - #interrupt-cells = <2>; - }; - }; - - q6v5_wcss: q6v5_wcss@CD00000 { - compatible = "qca,q6v5-wcss-rproc-ipq50xx"; - firmware = "IPQ5018/q6_fw.mdt"; - reg = <0xCD00000 0x10000>, - <0x194f000 0x10>, - <0x1952000 0x10>, - <0x4ab000 0x20>, - <0x1818000 0x10>, - <0x1859000 0x10>, - <0x1945000 0x10>, - <0x193D204 0x4>; - reg-names = "wcss-base", - "tcsr-q6-base", - "tcsr-base", - "mpm-base", - "gcc-wcss-bcr-base", - "gcc-wcss-misc-base", - "tcsr-global", - "tcsr-q6-boot-trig"; - qca,auto-restart; - qca,extended-intc; - qca,dump-q6-reg; - qca,emulation; - interrupts-extended = <&intc 0 291 1>, - <&wcss_smp2p_in 0 0>, - <&wcss_smp2p_in 1 0>, - <&wcss_smp2p_in 3 0>; - interrupt-names = "wdog", - "qcom,gpio-err-fatal", - "qcom,gpio-err-ready", - "qcom,gpio-stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 0>, - <&wcss_smp2p_out 1>; - qcom,smem-state-names = "shutdown", - "stop"; - }; - - q6v5_m3: q6v5_m3 { - compatible = "qca,q6v5-m3-rproc"; - firmware = "IPQ5018/m3_fw.mdt"; - qca,auto-restart; - qcom,restart-group = <&q6v5_m3 &q6v5_wcss>; - }; - - tcsr_mutex_block: syscon@1905000 { - compatible = "syscon"; - reg = <0x1905000 0x8000>; - }; - - tcsr_mutex: hwlock@1905000 { - compatible = "qcom,tcsr-mutex"; - syscon = <&tcsr_mutex_block 0 0x80>; - #hwlock-cells = <1>; - }; - - smem: qcom,smem@4AB00000 { - compatible = "qcom,smem"; - memory-region = <&smem_region>; - hwlocks = <&tcsr_mutex 0>; - }; - - apcs_glb: mailbox@b111000 { - compatible = "qcom,msm8996-apcs-hmss-global"; - qcom,ipc = <&apcs 8 8>; - - #mbox-cells = <1>; - }; - - tcsr_q6_block: syscon@1945000 { - compatible = "syscon"; - reg = <0x1945000 0xE000>; - }; - - qcom_q6v5_wcss: qcom_q6v5_wcss@CD00000 { - compatible = "qcom,ipq5018-wcss-pil"; - firmware = "IPQ5018/q6_fw.mdt"; - m3_firmware = "IPQ5018/m3_fw.mdt"; - reg = <0xCD00000 0x4040>, - <0x4ab000 0x20>, - <0x4a1000 0x10>, - <0x1938000 0x8>, - <0x193D204 0x4>; - reg-names = "qdsp6", - "rmb", - "mpm", - "tcsr-msip", - "tcsr-q6-boot-trig"; - clocks = <&gcc GCC_Q6_AXIS_CLK>, - <&gcc GCC_WCSS_AHB_S_CLK>, - <&gcc GCC_WCSS_ECAHB_CLK>, - <&gcc GCC_WCSS_ACMT_CLK>, - <&gcc GCC_WCSS_AXI_M_CLK>, - <&gcc GCC_Q6_AXIM_CLK>, - <&gcc GCC_Q6_AXIM2_CLK>, - <&gcc GCC_Q6_AHB_CLK>, - <&gcc GCC_Q6_AHB_S_CLK>, - <&gcc GCC_WCSS_AXI_S_CLK>; - clock-names = "gcc_q6_axis_clk", - "gcc_wcss_ahb_s_clk", - "gcc_wcss_ecahb_clk", - "gcc_wcss_acmt_clk", - "gcc_wcss_axi_m_clk", - "gcc_q6_axim_clk", - "gcc_q6_axim2_clk", - "gcc_q6_ahb_clk", - "gcc_q6_ahb_s_clk", - "gcc_wcss_axi_s_clk"; - qca,auto-restart; - qca,extended-intc; - qca,wcss-aon-reset-seq; - interrupts-extended = <&intc 0 291 1>, - <&wcss_smp2p_in 0 0>, - <&wcss_smp2p_in 1 0>, - <&wcss_smp2p_in 2 0>, - <&wcss_smp2p_in 3 0>; - interrupt-names = "wdog", - "fatal", - "ready", - "handover", - "stop-ack"; - - resets = <&gcc GCC_WCSSAON_RESET>, - <&gcc GCC_WCSS_BCR>, - <&gcc GCC_WCSS_Q6_BCR>, - <&gcc GCC_CE_BCR>; - - reset-names = "wcss_aon_reset", - "wcss_reset", - "wcss_q6_reset", - "ce_reset"; - - qcom,halt-regs = <&tcsr_q6_block 0xA000 0xD000 0x0>; - - qcom,smem-states = <&wcss_smp2p_out 0>, - <&wcss_smp2p_out 1>; - qcom,smem-state-names = "shutdown", - "stop"; - - qcom,q6v6; - - glink-edge { - interrupts = ; - qcom,remote-pid = <1>; - mboxes = <&apcs_glb 8>; - - rpm_requests { - qcom,glink-channels = "IPCRTR"; - }; - }; - }; - - wifi0: wifi@c000000 { - compatible = "qcom,cnss-qca5018", "qcom,ipq5018-wifi"; - reg = <0xc000000 0x1000000>; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; - #else - qcom,tgt-mem-mode = <1>; - #endif - qcom,rproc = <&qcom_q6v5_wcss>; - interrupts = <0 288 1>, /* o_wcss_apps_intr[0] = */ - <0 289 1>, - <0 290 1>, - <0 292 1>, - <0 293 1>, - <0 294 1>, - <0 295 1>, - <0 296 1>, - <0 297 1>, - <0 298 1>, - <0 299 1>, - <0 300 1>, - <0 301 1>, - <0 302 1>, - <0 303 1>, - <0 304 1>, - <0 305 1>, - <0 306 1>, - <0 307 1>, - <0 308 1>, - <0 309 1>, - <0 310 1>, - <0 311 1>, - <0 312 1>, - <0 313 1>, /* o_wcss_apps_intr[25] */ - - <0 314 1>, - <0 315 1>, - <0 316 1>, - <0 317 1>, - <0 318 1>, - <0 319 1>, - <0 320 1>, - <0 321 1>, - <0 322 1>, - <0 323 1>, - <0 324 1>, - <0 325 1>, - - <0 326 1>, - - <0 327 1>, - <0 328 1>, - <0 329 1>, - <0 330 1>, - <0 331 1>, - <0 332 1>, - - <0 333 1>, - <0 334 1>, - <0 335 1>, - <0 336 1>, - <0 337 1>, - <0 338 1>, - <0 339 1>; /* o_wcss_apps_intr[51] */ - - interrupt-names = "misc-pulse1", - "misc-latch", - "sw-exception", - "ce0", - "ce1", - "ce2", - "ce3", - "ce4", - "ce5", - "ce6", - "ce7", - "ce8", - "ce9", - "ce10", - "ce11", - "host2wbm-desc-feed", - "host2reo-re-injection", - "host2reo-command", - "host2rxdma-monitor-ring3", - "host2rxdma-monitor-ring2", - "host2rxdma-monitor-ring1", - "reo2ost-exception", - "wbm2host-rx-release", - "reo2host-status", - "reo2host-destination-ring4", - "reo2host-destination-ring3", - "reo2host-destination-ring2", - "reo2host-destination-ring1", - "rxdma2host-monitor-destination-mac3", - "rxdma2host-monitor-destination-mac2", - "rxdma2host-monitor-destination-mac1", - "ppdu-end-interrupts-mac3", - "ppdu-end-interrupts-mac2", - "ppdu-end-interrupts-mac1", - "rxdma2host-monitor-status-ring-mac3", - "rxdma2host-monitor-status-ring-mac2", - "rxdma2host-monitor-status-ring-mac1", - "host2rxdma-host-buf-ring-mac3", - "host2rxdma-host-buf-ring-mac2", - "host2rxdma-host-buf-ring-mac1", - "rxdma2host-destination-ring-mac3", - "rxdma2host-destination-ring-mac2", - "rxdma2host-destination-ring-mac1", - "host2tcl-input-ring4", - "host2tcl-input-ring3", - "host2tcl-input-ring2", - "host2tcl-input-ring1", - "wbm2host-tx-completions-ring3", - "wbm2host-tx-completions-ring2", - "wbm2host-tx-completions-ring1", - "tcl2host-status-ring"; - status = "disabled"; - qcom,pta-num = <0>; - qcom,coex-mode = <0x3>; - qcom,bt-active-time = <0>; - qcom,bt-priority-time = <0>; - qcom,coex-algo = <0x2>; - qcom,pta-priority = <0>; - }; - - wifi1: wifi1@c000000 { - compatible = "qcom,cnss-qcn6122", "qcom,qcn6122-wifi"; - qcom,rproc = <&qcom_q6v5_wcss>; - status = "disabled"; - }; - - wifi2: wifi2@c000000 { - compatible = "qcom,cnss-qcn6122", "qcom,qcn6122-wifi"; - qcom,rproc = <&qcom_q6v5_wcss>; - status = "disabled"; - }; - - i2c_0: i2c@78b7000 { - compatible = "qcom,i2c-qup-v2.2.1"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x78b7000 0x600>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_AHB_CLK>, - <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>; - clock-names = "iface", "core"; - clock-frequency = <400000>; - dmas = <&blsp_dma 9>, <&blsp_dma 8>; - dma-names = "rx", "tx"; - status = "disabled"; - }; - - tlmm: pinctrl@1000000 { - compatible = "qcom,ipq5018-pinctrl"; - reg = <0x1000000 0x300000>; - interrupts = <0x0 0xd0 0x0>; - gpio-controller; - #gpio-cells = <0x2>; - interrupt-controller; - #interrupt-cells = <0x2>; - }; - - dbm_1p5: dbm@0x8AF8000 { - compatible = "qcom,usb-dbm-1p5"; - reg = <0x8AF8000 0x300>; - qcom,reset-ep-after-lpm-resume; - }; - - hs_m31phy_0: hs_m31phy@5b000 { - compatible = "qca,m31-usb-hsphy"; - reg = <0x05b000 0x120>, - <0x08af8800 0x400>; - reg-names = "m31usb_phy_base", - "qscratch_base"; - phy_type= "utmi"; - - resets = <&gcc GCC_QUSB2_0_PHY_BCR>; - reset-names = "usb2_phy_reset"; - - status = "disabled"; - }; - - ssuniphy_0: ssuniphy@5d000 { - compatible = "qca,ipq5018-uni-ssphy"; - reg = <0x5d000 0x800>; - clocks = <&gcc GCC_USB0_PIPE_CLK>, - <&gcc GCC_USB0_PHY_CFG_AHB_CLK>; - - clock-names = "pipe_clk", "phy_cfg_ahb_clk"; - - resets = <&gcc GCC_USB0_PHY_BCR>; - reset-names = "por_rst"; - #phy-cells = <0>; - status = "disabled"; - }; - - usb3: usb3@8A00000 { - compatible = "qcom,ipq5018-dwc3"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - reg = <0x8AF8800 0x100>, - <0x8A00000 0xe000>; - reg-names = "qscratch_base", "dwc3_base"; - clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>, - <&gcc GCC_USB0_MASTER_CLK>, - <&gcc GCC_USB0_SLEEP_CLK>, - <&gcc GCC_USB0_MOCK_UTMI_CLK>, - <&gcc GCC_USB0_PHY_CFG_AHB_CLK>, - <&gcc GCC_USB0_AUX_CLK>, - <&gcc GCC_USB0_LFPS_CLK>, - <&gcc GCC_USB0_PIPE_CLK>; - clock-names = "sys_noc_axi", - "master", - "sleep", - "mock_utmi", - "cfg_ahb_clk", - "aux_clk", - "lfps_clk", - "pipe_clk"; - assigned-clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>, - <&gcc GCC_USB0_MASTER_CLK>, - <&gcc GCC_USB0_MOCK_UTMI_CLK>; - assigned-clock-rates = <133330000>, - <133330000>, - <60000000>; - resets = <&gcc GCC_USB0_BCR>; - reset-names = "usb30_mstr_rst"; - qca,host = <1>; - qcom,usb-dbm = <&dbm_1p5>; - status = "disabled"; - - dwc_0: dwc3@8A00000 { - compatible = "snps,dwc3"; - reg = <0x8A00000 0xe000>; - interrupts = ; - usb-phy = <&hs_m31phy_0>; - #phy-cells = <0>; - phys = <&ssuniphy_0>; - phy-names = "usb3-phy"; - snps,dis_ep_cache_eviction; - tx-fifo-resize; - snps,usb3-u1u2-disable; - snps,nominal-elastic-buffer; - snps,is-utmi-l1-suspend; - snps,hird-threshold = /bits/ 8 <0x0>; - snps,dis_u2_susphy_quirk; - snps,dis_u3_susphy_quirk; - snps,quirk-ref-clock-adjustment = <0x49459>; - snps,quirk-ref-clock-period = <0x10>; - snps,quirk-30m-sb-sel = <0x0>; - dr_mode = "host"; - }; - }; - - qcom,usbbam@8B04000 { - compatible = "qcom,usb-bam-msm"; - reg = <0x8B04000 0x17000>; - interrupt-parent = <&intc>; - interrupts = <0 135 0>; - - qcom,bam-type = <0>; - qcom,usb-bam-fifo-baseaddr = <0x4A600000>; - qcom,usb-bam-num-pipes = <4>; - qcom,ignore-core-reset-ack; - qcom,disable-clk-gating; - qcom,usb-bam-override-threshold = <0x4001>; - qcom,usb-bam-max-mbps-highspeed = <400>; - qcom,usb-bam-max-mbps-superspeed = <3600>; - qcom,reset-bam-on-connect; - - qcom,pipe0 { - label = "ssusb-qdss-in-0"; - qcom,usb-bam-mem-type = <2>; - qcom,dir = <1>; - qcom,pipe-num = <0>; - qcom,peer-bam = <0>; - qcom,peer-bam-physical-address = <0x6064000>; - qcom,src-bam-pipe-index = <0>; - qcom,dst-bam-pipe-index = <0>; - qcom,data-fifo-offset = <0x0>; - qcom,data-fifo-size = <0xe00>; - qcom,descriptor-fifo-offset = <0xe00>; - qcom,descriptor-fifo-size = <0x200>; - }; - }; - - qcom,diag@0 { - compatible = "qcom,diag"; - status = "ok"; - }; - - pcie_x1phy: phy@7e000{ - compatible = "qca,uni-pcie-phy-gen2"; - reg = <0x7e000 0x800>; - phy-type = "gen2"; - #phy-cells = <0>; - clocks = <&gcc GCC_PCIE1_PIPE_CLK>; - clock-names = "pipe_clk"; - - resets = <&gcc GCC_PCIE1_PHY_BCR>, - <&gcc GCC_PCIE1PHY_PHY_BCR>; - reset-names = "phy", - "phy_phy"; - mode_fixed = <2>; - status = "disabled"; - }; - - pcie_x1: pci@80000000 { - compatible = "qcom,pcie-ipq5018"; - reg = <0x80000000 0xf1d - 0x80000F20 0xa8 - 0x80001000 0x1000 - 0x78000 0x3000 - 0x80100000 0x1000>; - reg-names = "dbi", "elbi", "dm_iatu", "parf", "config"; - device_type = "pci"; - linux,pci-domain = <0>; - bus-range = <0x00 0xff>; - num-lanes = <1>; - #address-cells = <3>; - #size-cells = <2>; - - phys = <&pcie_x1phy>; - phy-names ="pciephy"; - force_gen2 = <1>; - - ranges = <0x81000000 0 0x80200000 0x80200000 - 0 0x00100000 /* downstream I/O */ - 0x82000000 0 0x80300000 0x80300000 - 0 0x10000000>; /* non-prefetchable memory */ - - interrupts = , - <0 416 IRQ_TYPE_NONE>, <0 417 IRQ_TYPE_NONE>, - <0 418 IRQ_TYPE_NONE>, <0 419 IRQ_TYPE_NONE>, - <0 420 IRQ_TYPE_NONE>, <0 421 IRQ_TYPE_NONE>, - <0 422 IRQ_TYPE_NONE>, <0 423 IRQ_TYPE_NONE>, - <0 424 IRQ_TYPE_NONE>, <0 425 IRQ_TYPE_NONE>, - <0 426 IRQ_TYPE_NONE>, <0 427 IRQ_TYPE_NONE>, - <0 428 IRQ_TYPE_NONE>, <0 429 IRQ_TYPE_NONE>, - <0 430 IRQ_TYPE_NONE>, <0 431 IRQ_TYPE_NONE>, - <0 432 IRQ_TYPE_NONE>, <0 433 IRQ_TYPE_NONE>, - <0 434 IRQ_TYPE_NONE>, <0 435 IRQ_TYPE_NONE>, - <0 436 IRQ_TYPE_NONE>, <0 437 IRQ_TYPE_NONE>, - <0 438 IRQ_TYPE_NONE>, <0 439 IRQ_TYPE_NONE>, - <0 440 IRQ_TYPE_NONE>, <0 441 IRQ_TYPE_NONE>, - <0 442 IRQ_TYPE_NONE>, <0 443 IRQ_TYPE_NONE>, - <0 444 IRQ_TYPE_NONE>, <0 445 IRQ_TYPE_NONE>, - <0 446 IRQ_TYPE_NONE>, <0 447 IRQ_TYPE_NONE>; - interrupt-names = "msi", "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15", "msi_16", - "msi_17", "msi_18", "msi_19", - "msi_20", "msi_21", "msi_22", - "msi_23", "msi_24", "msi_25", - "msi_26", "msi_27", "msi_28", - "msi_29", "msi_30", "msi_31"; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0x7>; - interrupt-map = <0 0 0 1 &intc 0 142 - IRQ_TYPE_LEVEL_HIGH>, /* int_a */ - <0 0 0 2 &intc 0 143 - IRQ_TYPE_LEVEL_HIGH>, /* int_b */ - <0 0 0 3 &intc 0 144 - IRQ_TYPE_LEVEL_HIGH>, /* int_c */ - <0 0 0 4 &intc 0 145 - IRQ_TYPE_LEVEL_HIGH>; /* int_d */ - - clocks = <&gcc GCC_SYS_NOC_PCIE1_AXI_CLK>, - <&gcc GCC_PCIE1_AXI_M_CLK>, - <&gcc GCC_PCIE1_AXI_S_CLK>, - <&gcc GCC_PCIE1_AHB_CLK>, - <&gcc GCC_PCIE1_AUX_CLK>, - <&gcc GCC_PCIE1_AXI_S_BRIDGE_CLK>; - - clock-names = "sys_noc", - "axi_m", - "axi_s", - "ahb", - "aux", - "axi_bridge"; - - resets = <&gcc GCC_PCIE1_PIPE_ARES>, - <&gcc GCC_PCIE1_SLEEP_ARES>, - <&gcc GCC_PCIE1_CORE_STICKY_ARES>, - <&gcc GCC_PCIE1_AXI_MASTER_ARES>, - <&gcc GCC_PCIE1_AXI_SLAVE_ARES>, - <&gcc GCC_PCIE1_AHB_ARES>, - <&gcc GCC_PCIE1_AXI_MASTER_STICKY_ARES>, - <&gcc GCC_PCIE1_AXI_SLAVE_STICKY_ARES>; - - reset-names = "pipe", - "sleep", - "sticky", - "axi_m", - "axi_s", - "ahb", - "axi_m_sticky", - "axi_s_sticky"; - - qcom,msi-gicm-addr = <0x0B00A040>; - qcom,msi-gicm-base = <0x1c0>; - - status = "disabled"; - - pcie_x1_rp: pcie_x1_rp { - reg = <0 0 0 0 0>; - }; - }; - - pcie_x2phy: phy@86000{ - compatible = "qca,uni-pcie-phy-gen2"; - reg = <0x86000 0x800 0x86800 0x800>; - phy-type = "gen2"; - #phy-cells = <0>; - clocks = <&gcc GCC_PCIE0_PIPE_CLK>; - clock-names = "pipe_clk"; - - resets = <&gcc GCC_PCIE0_PHY_BCR>, - <&gcc GCC_PCIE0PHY_PHY_BCR>; - reset-names = "phy", - "phy_phy"; - mode_fixed = <2>; - x2 = <1>; - status = "disabled"; - }; - - pcie_x2: pci@a0000000 { - compatible = "qcom,pcie-ipq5018"; - reg = <0xa0000000 0xf1d - 0xa0000F20 0xa8 - 0xa0001000 0x1000 - 0x80000 0x3000 - 0xa0100000 0x1000>; - reg-names = "dbi", "elbi", "dm_iatu", "parf", "config"; - device_type = "pci"; - linux,pci-domain = <1>; - bus-range = <0x00 0xff>; - num-lanes = <2>; - #address-cells = <3>; - #size-cells = <2>; - - phys = <&pcie_x2phy>; - phy-names ="pciephy"; - force_gen2 = <1>; - - ranges = <0x81000000 0 0xa0200000 0xa0200000 - 0 0x00100000 /* downstream I/O */ - 0x82000000 0 0xa0300000 0xa0300000 - 0 0x10000000>; /* non-prefetchable memory */ - - interrupts = , - <0 448 IRQ_TYPE_NONE>, <0 449 IRQ_TYPE_NONE>, - <0 450 IRQ_TYPE_NONE>, <0 451 IRQ_TYPE_NONE>, - <0 452 IRQ_TYPE_NONE>, <0 453 IRQ_TYPE_NONE>, - <0 454 IRQ_TYPE_NONE>, <0 455 IRQ_TYPE_NONE>, - <0 456 IRQ_TYPE_NONE>, <0 457 IRQ_TYPE_NONE>, - <0 458 IRQ_TYPE_NONE>, <0 459 IRQ_TYPE_NONE>, - <0 460 IRQ_TYPE_NONE>, <0 461 IRQ_TYPE_NONE>, - <0 462 IRQ_TYPE_NONE>, <0 463 IRQ_TYPE_NONE>, - <0 464 IRQ_TYPE_NONE>, <0 465 IRQ_TYPE_NONE>, - <0 466 IRQ_TYPE_NONE>, <0 467 IRQ_TYPE_NONE>, - <0 468 IRQ_TYPE_NONE>, <0 469 IRQ_TYPE_NONE>, - <0 470 IRQ_TYPE_NONE>, <0 471 IRQ_TYPE_NONE>, - <0 472 IRQ_TYPE_NONE>, <0 473 IRQ_TYPE_NONE>, - <0 474 IRQ_TYPE_NONE>, <0 475 IRQ_TYPE_NONE>, - <0 476 IRQ_TYPE_NONE>, <0 477 IRQ_TYPE_NONE>, - <0 478 IRQ_TYPE_NONE>, <0 479 IRQ_TYPE_NONE>; - interrupt-names = "msi", "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15", "msi_16", - "msi_17", "msi_18", "msi_19", - "msi_20", "msi_21", "msi_22", - "msi_23", "msi_24", "msi_25", - "msi_26", "msi_27", "msi_28", - "msi_29", "msi_30", "msi_31"; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0x7>; - interrupt-map = <0 0 0 1 &intc 0 75 - IRQ_TYPE_LEVEL_HIGH>, /* int_a */ - <0 0 0 2 &intc 0 78 - IRQ_TYPE_LEVEL_HIGH>, /* int_b */ - <0 0 0 3 &intc 0 79 - IRQ_TYPE_LEVEL_HIGH>, /* int_c */ - <0 0 0 4 &intc 0 83 - IRQ_TYPE_LEVEL_HIGH>; /* int_d */ - - clocks = <&gcc GCC_SYS_NOC_PCIE0_AXI_CLK>, - <&gcc GCC_PCIE0_AXI_M_CLK>, - <&gcc GCC_PCIE0_AXI_S_CLK>, - <&gcc GCC_PCIE0_AHB_CLK>, - <&gcc GCC_PCIE0_AUX_CLK>, - <&gcc GCC_PCIE0_AXI_S_BRIDGE_CLK>; - - clock-names = "sys_noc", - "axi_m", - "axi_s", - "ahb", - "aux", - "axi_bridge"; - - resets = <&gcc GCC_PCIE0_PIPE_ARES>, - <&gcc GCC_PCIE0_SLEEP_ARES>, - <&gcc GCC_PCIE0_CORE_STICKY_ARES>, - <&gcc GCC_PCIE0_AXI_MASTER_ARES>, - <&gcc GCC_PCIE0_AXI_SLAVE_ARES>, - <&gcc GCC_PCIE0_AHB_ARES>, - <&gcc GCC_PCIE0_AXI_MASTER_STICKY_ARES>, - <&gcc GCC_PCIE0_AXI_SLAVE_STICKY_ARES>; - - reset-names = "pipe", - "sleep", - "sticky", - "axi_m", - "axi_s", - "ahb", - "axi_m_sticky", - "axi_s_sticky"; - - qcom,msi-gicm-addr = <0x0B00B040>; - qcom,msi-gicm-base = <0x1e0>; - - status = "disabled"; - - pcie_x2_rp: pcie_x2_rp { - reg = <0 0 0 0 0>; - }; - }; - - qgic_msi_0: qti,qgic2m-msi_0 { - compatible = "qti,qgic2m-msi"; - - interrupts = <0 416 IRQ_TYPE_NONE>, <0 417 IRQ_TYPE_NONE>, - <0 418 IRQ_TYPE_NONE>, <0 419 IRQ_TYPE_NONE>, - <0 420 IRQ_TYPE_NONE>, <0 421 IRQ_TYPE_NONE>, - <0 422 IRQ_TYPE_NONE>, <0 423 IRQ_TYPE_NONE>, - <0 424 IRQ_TYPE_NONE>, <0 425 IRQ_TYPE_NONE>, - <0 426 IRQ_TYPE_NONE>, <0 427 IRQ_TYPE_NONE>, - <0 428 IRQ_TYPE_NONE>, <0 429 IRQ_TYPE_NONE>, - <0 430 IRQ_TYPE_NONE>, <0 431 IRQ_TYPE_NONE>, - <0 432 IRQ_TYPE_NONE>, <0 433 IRQ_TYPE_NONE>, - <0 434 IRQ_TYPE_NONE>, <0 435 IRQ_TYPE_NONE>, - <0 436 IRQ_TYPE_NONE>, <0 437 IRQ_TYPE_NONE>, - <0 438 IRQ_TYPE_NONE>, <0 439 IRQ_TYPE_NONE>, - <0 440 IRQ_TYPE_NONE>, <0 441 IRQ_TYPE_NONE>, - <0 442 IRQ_TYPE_NONE>, <0 443 IRQ_TYPE_NONE>, - <0 444 IRQ_TYPE_NONE>, <0 445 IRQ_TYPE_NONE>, - <0 446 IRQ_TYPE_NONE>, <0 447 IRQ_TYPE_NONE>; - interrupt-names = "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15", "msi_16", - "msi_17", "msi_18", "msi_19", - "msi_20", "msi_21", "msi_22", - "msi_23", "msi_24", "msi_25", - "msi_26", "msi_27", "msi_28", - "msi_29", "msi_30", "msi_31"; - - qti,msi-gicm-addr = <0x0B00A040>; - qti,msi-gicm-base = <0x1c0>; - - status = "disabled"; - }; - - qgic_msi_1: qti,qgic2m-msi_1 { - compatible = "qti,qgic2m-msi"; - - interrupts = <0 448 IRQ_TYPE_NONE>, <0 449 IRQ_TYPE_NONE>, - <0 450 IRQ_TYPE_NONE>, <0 451 IRQ_TYPE_NONE>, - <0 452 IRQ_TYPE_NONE>, <0 453 IRQ_TYPE_NONE>, - <0 454 IRQ_TYPE_NONE>, <0 455 IRQ_TYPE_NONE>, - <0 456 IRQ_TYPE_NONE>, <0 457 IRQ_TYPE_NONE>, - <0 458 IRQ_TYPE_NONE>, <0 459 IRQ_TYPE_NONE>, - <0 460 IRQ_TYPE_NONE>, <0 461 IRQ_TYPE_NONE>, - <0 462 IRQ_TYPE_NONE>, <0 463 IRQ_TYPE_NONE>, - <0 464 IRQ_TYPE_NONE>, <0 465 IRQ_TYPE_NONE>, - <0 466 IRQ_TYPE_NONE>, <0 467 IRQ_TYPE_NONE>, - <0 468 IRQ_TYPE_NONE>, <0 469 IRQ_TYPE_NONE>, - <0 470 IRQ_TYPE_NONE>, <0 471 IRQ_TYPE_NONE>, - <0 472 IRQ_TYPE_NONE>, <0 473 IRQ_TYPE_NONE>, - <0 474 IRQ_TYPE_NONE>, <0 475 IRQ_TYPE_NONE>, - <0 476 IRQ_TYPE_NONE>, <0 477 IRQ_TYPE_NONE>, - <0 478 IRQ_TYPE_NONE>, <0 479 IRQ_TYPE_NONE>; - interrupt-names = "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15", "msi_16", - "msi_17", "msi_18", "msi_19", - "msi_20", "msi_21", "msi_22", - "msi_23", "msi_24", "msi_25", - "msi_26", "msi_27", "msi_28", - "msi_29", "msi_30", "msi_31"; - - qti,msi-gicm-addr = <0x0B00B040>; - qti,msi-gicm-base = <0x1e0>; - - status = "disabled"; - }; - - qcom,test@0 { - compatible = "qcom,testmhi"; - status = "ok"; - }; - - tzlog: qca,tzlog { - compatible = "qca,tzlog_ipq50xx"; - interrupts = ; - qca,tzbsp-diag-buf-size = <0x2000>; - }; - - eud: qcom,msm-eud{ - compatible = "qcom,msm-eud"; - reg = <0x58000 0x1000>, - <0x59000 0x2000>, - <0x5a000 0x1000>; - reg-names = "eud_base", - "eud_mode_mgr", - "eud_mode_mgr2"; - interrupts = ; - interrupt-names = "eud_irq"; - status = "disabled"; - }; - - bt: bt@7000000 { - compatible = "qcom,bt"; - firmware = "IPQ5018/bt_fw_patch.mdt"; - - reg = <0x01943008 0x8>; - reg-names = "bt_warm_rst"; - memory-region = <&bt_region>; - - qcom,ipc = <&apcs 8 23>; - interrupts = ; - - resets = <&gcc GCC_BTSS_BCR>; - reset-names = "btss_reset"; - - clocks = <&gcc GCC_BTSS_LPO_CLK>; - clock-names = "lpo_clk"; - }; - lpass: lpass@0xA000000{ - compatible = "qca,lpass-ipq5018"; - reg = <0xA000000 0x3BFFFF>; - clocks = <&gcc GCC_SNOC_LPASS_AXIM_CLK>, - <&gcc GCC_SNOC_LPASS_SWAY_CLK>, - <&gcc GCC_LPASS_CORE_AXIM_CLK>, - <&gcc GCC_LPASS_SWAY_CLK>; - clock-names = "snoc_axim", "snoc_sway", "axim", "sway"; - resets = <&gcc GCC_LPASS_BCR>; - reset-names = "lpass"; - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - compatible = "qca,ipq5018-lpass-pcm"; - reg = <0xA3C0000 0x23014>; - interrupts = <0 27 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "out0"; - capture_memory = "lpm"; - playback_memory = "lpm"; - voice_loopback = <0>; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - compatible = "qca,ipq5018-pcm-lb"; - status = "disabled"; - }; - }; - - cpus { - #address-cells = <0x1>; - #size-cells = <0x0>; - - CPU0: cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a53"; - reg = <0x0>; - enable-method = "psci"; - qcom,acc = <&acc0>; - next-level-cache = <&L2_0>; - clocks = <&apss_clk APCS_ALIAS0_CORE_CLK>; - clock-names = "cpu"; - operating-points = < - /* kHz uV (fixed) */ - 800000 1100000 - 1008000 1100000 - >; - clock-latency = <200000>; - }; - - CPU1: cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a53"; - reg = <0x1>; - enable-method = "psci"; - qcom,acc = <&acc1>; - next-level-cache = <&L2_0>; - clocks = <&apss_clk APCS_ALIAS0_CORE_CLK>; - clock-names = "cpu"; - operating-points = < - /* kHz uV (fixed) */ - 800000 1100000 - 1008000 1100000 - >; - clock-latency = <200000>; - }; - - L2_0: l2-cache { - compatible = "cache"; - cache-level = <0x2>; - }; - }; - - clocks { - sleep_clk: sleep_clk { - compatible = "fixed-clock"; - clock-frequency = <32000>; - #clock-cells = <0>; - }; - - xo: xo { - compatible = "fixed-clock"; - clock-frequency = <24000000>; - #clock-cells = <0>; - }; - }; - - pmuv8: pmu { - compatible = "arm,cortex-a53-pmu"; - interrupts = ; - }; - - firmware { - scm { - compatible = "qcom,scm-ipq5018"; - }; - qfprom_sec { - compatible = "qcom,qfprom-sec"; - img-addr = <0x4A800000>; - img-size = <0x00400000>; - }; - }; - -}; - -#include "qcom-ipq5018-coresight.dtsi" -#include "qcom-ipq5018-thermal.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-liteon-wpx8324.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-liteon-wpx8324.dts deleted file mode 100755 index dc73934cd..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-liteon-wpx8324.dts +++ /dev/null @@ -1,812 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Liteon WPX8324"; - compatible = "liteon,wpx8324", "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - /*serial1 = &blsp1_uart2;*/ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 8MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x40800000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 13MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D100000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D300000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4E400000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4F300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4F400000 | 1MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x4500000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x1400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4D100000 { - no-map; - reg = <0x0 0x4D100000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 { - no-map; - reg = <0x0 0x4F300000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 { - no-map; - reg = <0x0 0x4F400000 0x0 0x100000>; - }; - #else - /* 512MB/1GB Profiles - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 14MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D300000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | Caldb | 0x4D400000 | 2MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D600000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E600000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E700000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | Caldb | 0x4E800000 | 5MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4ED00000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4FD00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4FE00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | Caldb | 0x4FF00000 | 5MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x5400000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D400000 { - no-map; - reg = <0x0 0x4D400000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D600000 { - no-map; - reg = <0x0 0x4D600000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 { - no-map; - reg = <0x0 0x4E600000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 { - no-map; - reg = <0x0 0x4E700000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 { - no-map; - reg = <0x0 0x4E800000 0x0 0x500000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { - no-map; - reg = <0x0 0x4ED00000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 { - no-map; - reg = <0x0 0x4FD00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 { - no-map; - reg = <0x0 0x4FE00000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 { - no-map; - reg = <0x0 0x4FF00000 0x0 0x500000>; - }; - - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - spi_2: spi@78b7000 { /* BLSP1 QUP2 */ - pinctrl-0 = <&blsp2_spi0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - tpm0: slb9670@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <1>; /* CE1 */ - compatible = "infineon,slb9670"; - linux,modalias = "slb9670", "slb9670a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 26 0>; - - ethernet-phy@0 { - reg = <28>; - }; - }; - - ess-instance { - num_devices = <0x1>; - ess-switch@0x39c00000 { - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - mdiobus = <&mdio0>; - }; - port@1 { - port_id = <2>; - phy_address = <0x1c>; - mdiobus = <&mdio1>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - }; - wifi0: wifi@c000000 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - mdio-bus = <&mdio1>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - }; - - thermal-zones { - status = "ok"; - }; - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_blue: led@19 { - label = "blue:uplink"; - gpios = <&tlmm 19 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - led_orange: led@18 { - label = "orange:wifi2"; - gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - led_green: led@39 { - label = "green:wifi5"; - gpios = <&tlmm 39 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - leds_pins: leds_pins { - led_blue { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_orange { - pins = "gpio18"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_green { - pins = "gpio39"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - blsp0_uart_pins: uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - blsp2_spi0_pins: blsp2_spi0_pins { - mux { - pins = "gpio31", "gpio32", "gpio33", "gpio34"; - function = "blsp2_spi0"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio18", "gpio19", "gpio39"; - /* function = "led0"; */ - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio29"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 29 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -&usb3 { - status = "ok"; - device-power-gpio = <&tlmm 28 0>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "disabled"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "disabled"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - - }; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>, - <0x2 0x4 0x2 0x12 0x0 0x0>; - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 6G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd3 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 24 0>, - <&wcss_smp2p_in 25 0>, - <&wcss_smp2p_in 28 0>, - <&wcss_smp2p_in 27 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 24>, - <&wcss_smp2p_out 25>, - <&wcss_smp2p_out 26>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <3>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>; - #else - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; - #endif - }; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&qgic_msi_1 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>; -#else - qcom,caldb-addr = <0x4D400000>; - m3-dump-addr = <0x4D200000>; -#endif - qcom,caldb-size = <0x200000>; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-muxi-ap3220l.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-muxi-ap3220l.dts deleted file mode 100755 index 611221719..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-muxi-ap3220l.dts +++ /dev/null @@ -1,891 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "MUXI AP3220L"; - compatible = "muxi,ap3220l", "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 8MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x40800000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 13MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D100000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D300000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4E400000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4F300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4F400000 | 1MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x4500000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x1400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4D100000 { - no-map; - reg = <0x0 0x4D100000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 { - no-map; - reg = <0x0 0x4F300000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 { - no-map; - reg = <0x0 0x4F400000 0x0 0x100000>; - }; - #else - /* 512MB/1GB Profiles - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 14MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D300000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | Caldb | 0x4D400000 | 2MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D600000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E600000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E700000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | Caldb | 0x4E800000 | 5MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4ED00000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4FD00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4FE00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | Caldb | 0x4FF00000 | 5MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x5400000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D400000 { - no-map; - reg = <0x0 0x4D400000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D600000 { - no-map; - reg = <0x0 0x4D600000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 { - no-map; - reg = <0x0 0x4E600000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 { - no-map; - reg = <0x0 0x4E700000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 { - no-map; - reg = <0x0 0x4E800000 0x0 0x500000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { - no-map; - reg = <0x0 0x4ED00000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 { - no-map; - reg = <0x0 0x4FD00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 { - no-map; - reg = <0x0 0x4FE00000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 { - no-map; - reg = <0x0 0x4FF00000 0x0 0x500000>; - }; - - #endif - }; - - soc { - - blsp1_uart1: serial@78af000 { - pinctrl-0 = <&blsp0_uart_pins>; - pinctrl-names = "default"; - status = "okay"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins &phy_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - - ethernet-phy@0 { - reg = <0>; - }; - - ethernet-phy@1 { - reg = <1>; - }; - - ethernet-phy@2 { - reg = <2>; - }; - - ethernet-phy@3 { - reg = <3>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - /* - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - */ - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - }; - - ess-uniphy@98000 { - status = "disabled"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - mdio-bus = <&mdio1>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - //pinctrl-0 = <&phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - phy_pins: phy_pins { - phy_intr { - pins = "gpio29"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - bias-disable; - }; - phy_reset { - pins = "gpio39"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - output-low; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - //pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio32"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - led_pins: led_pins { - led_pwr { - pins = "gpio26"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_2g { - pins = "gpio31"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_5g { - pins = "gpio33"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset_button"; - linux,code = ; - gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_power: led_pwr { - label = "green:led_pwr"; - gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>; - default-state = "on"; - linux,default-trigger = "led_pwr"; - }; - - led_2g { - label = "green:wifi2"; - gpio = <&tlmm 33 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_5g { - label = "green:wifi5"; - gpio = <&tlmm 31 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - }; -}; - -&usb3 { - status = "ok"; - device-power-gpio = <&tlmm 30 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "disabled"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "disabled"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - - }; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x2 0x4 0x2 0xF 0x0 0x0>; - - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 6G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd3 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 24 0>, - <&wcss_smp2p_in 25 0>, - <&wcss_smp2p_in 28 0>, - <&wcss_smp2p_in 27 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 24>, - <&wcss_smp2p_out 25>, - <&wcss_smp2p_out 26>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <3>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>; - #else - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; - #endif - }; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&qgic_msi_1 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>; -#else - qcom,caldb-addr = <0x4D400000>; - m3-dump-addr = <0x4D200000>; -#endif - qcom,caldb-size = <0x200000>; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x4D600000 0x4D600000 0x4D300000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4E800000 0x4E800000 0 0 0>; -#else - qcom,caldb-addr = <0x4E800000>; - m3-dump-addr = <0x4E600000>; -#endif - qcom,caldb-size = <0x500000>; - status = "disabled"; -}; - -&wifi2 { - /* QCN6122 5G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50-5g.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50-5g.dts deleted file mode 100755 index ff5b260b4..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50-5g.dts +++ /dev/null @@ -1,995 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "OptimCloud D50-5G"; - compatible = "optimcloud,d50-5g", "qcom,ipq5018-mp03.1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - AUTO_MOUNT; - #endif - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp2"; - ethernet1 = "/soc/dp1"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 23MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C700000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4C900000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4DA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01700000>; - }; - - m3_dump@4c700000 { - no-map; - reg = <0x0 0x4C700000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - qcn9000_pcie0@4c900000 { - no-map; - reg = <0x0 0x4C900000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4da00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4da00000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4EA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@4ea00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4ea00000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F900000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@4F900000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F900000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - ethernet-phy@0 { - reg = <0>; - }; - - ethernet-phy@1 { - reg = <1>; - }; - - ethernet-phy@2 { - reg = <2>; - }; - - ethernet-phy@3 { - reg = <3>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - }; - - wifi0: wifi@c000000 { - qcom,bdf-addr = <0x4BA00000 0x4BA00000 0x4BA00000 - 0x0 0x0>; - qcom,caldb-addr = <0x4CA00000 0x4CA00000 0x4CA00000 - 0x0 0x0>; - qcom,caldb-size = <0x200000>; - status = "ok"; - }; - - ess-uniphy@98000 { - status = "disabled"; - }; - - qcom,sps { - status = "ok"; - }; - - qcom,usbbam@8B04000 { - status = "ok"; - }; - - qcom,diag@0 { - status = "ok"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - rpm_etm0 { - status = "disabled"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; - - gpio_keys { - compatible = "gpio-keys-polled"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - poll-interval = <100>; - - button@0 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@35 { - label = "green:4g"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_5g_wifi"; - default-state = "off"; - }; - led@30 { - label = "green:wifi"; - gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_2g_wifi"; - default-state = "off"; - }; - led@1 { - label = "green:internet"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_voice"; - default-state = "off"; - }; - led@33 { - label = "green:lte"; - gpios = <&tlmm 33 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_lte_g"; - default-state = "off"; - }; - led@34 { - label = "red:lte"; - gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_lte_r"; - default-state = "off"; - }; - led@27 { - label = "green:mesh"; - gpios = <&tlmm 27 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_nr_g"; - default-state = "off"; - }; - led@28 { - label = "red:mesh"; - gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_nr_r"; - default-state = "off"; - }; - }; - - -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: blsp0_uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - reset_button{ - pins = "gpio22"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - }; - - leds_pins: leds_pins { - led_5g_wifi { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g_wifi { - pins = "gpio30"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_lte_g { - pins = "gpio33"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_lte_r { - pins = "gpio34"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_nr_g { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_nr_r { - pins = "gpio28"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_voice { - pins = "gpio1"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&usb3 { - qcom,multiplexed-phy; - qcom,phy-mux-regs = <&tcsr_q6_block 0x2540>; - device-power-gpio = <&tlmm 24 1>; - status = "ok"; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&bt { - status = "ok"; -}; - -&wcss { - status = "ok"; -}; - -&q6v5_wcss { - status = "disabled"; -}; - -&q6v5_m3 { - status = "disabled"; -}; - -&tcsr_mutex_block { - status = "ok"; -}; - -&tcsr_mutex { - status = "ok"; -}; - -&smem { - status = "ok"; -}; - -&apcs_glb { - status = "ok"; -}; - -&tcsr_q6_block { - status = "ok"; -}; - -&qcom_q6v5_wcss { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_region>, <&q6_etr_region>; - #else - memory-region = <&q6_region>, <&q6_etr_region>, - <&q6_caldb_region>; - #endif - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&dbm_1p5 { - status = "ok"; -}; - -&msm_imem { - status = "ok"; -}; - -&blsp1_uart1 { - status = "ok"; -}; - -&ssuniphy_0 { - status = "ok"; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x20>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4CC00000>; - m3-dump-addr = <0x4E000000>; - etr-addr = <0x4E100000>; - qcom,caldb-addr = <0x4E200000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; -#endif - }; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,board_id = <0x24>; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 5G */ - board_id = <0xa0>; - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50.dts deleted file mode 100644 index 5f5b99a67..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d50.dts +++ /dev/null @@ -1,884 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "OptimCloud D50"; - compatible = "optimcloud,d50", "qcom,ipq5018-mp03.1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - AUTO_MOUNT; - #endif - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 23MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C700000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4C900000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4DA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01700000>; - }; - - m3_dump@4c700000 { - no-map; - reg = <0x0 0x4C700000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - qcn9000_pcie0@4c900000 { - no-map; - reg = <0x0 0x4C900000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4da00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4da00000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4EA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@4ea00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4ea00000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F900000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@4F900000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F900000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - ethernet-phy@0 { - reg = <0>; - }; - - ethernet-phy@1 { - reg = <1>; - }; - - ethernet-phy@2 { - reg = <2>; - }; - - ethernet-phy@3 { - reg = <3>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - }; - - wifi0: wifi@c000000 { - qcom,bdf-addr = <0x4BA00000 0x4BA00000 0x4BA00000 - 0x0 0x0>; - qcom,caldb-addr = <0x4CA00000 0x4CA00000 0x4CA00000 - 0x0 0x0>; - qcom,caldb-size = <0x200000>; - status = "ok"; - }; - - ess-uniphy@98000 { - status = "disabled"; - }; - - qcom,sps { - status = "ok"; - }; - - qcom,usbbam@8B04000 { - status = "ok"; - }; - - qcom,diag@0 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - rpm_etm0 { - status = "disabled"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: blsp0_uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -&usb3 { - qcom,multiplexed-phy; - qcom,phy-mux-regs = <&tcsr_q6_block 0x2540>; - device-power-gpio = <&tlmm 24 1>; - status = "ok"; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&bt { - status = "ok"; -}; - -&wcss { - status = "ok"; -}; - -&q6v5_wcss { - status = "disabled"; -}; - -&q6v5_m3 { - status = "disabled"; -}; - -&tcsr_mutex_block { - status = "ok"; -}; - -&tcsr_mutex { - status = "ok"; -}; - -&smem { - status = "ok"; -}; - -&apcs_glb { - status = "ok"; -}; - -&tcsr_q6_block { - status = "ok"; -}; - -&qcom_q6v5_wcss { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_region>, <&q6_etr_region>; - #else - memory-region = <&q6_region>, <&q6_etr_region>, - <&q6_caldb_region>; - #endif - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&dbm_1p5 { - status = "ok"; -}; - -&msm_imem { - status = "ok"; -}; - -&blsp1_uart1 { - status = "ok"; -}; - -&ssuniphy_0 { - status = "ok"; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x20>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4CC00000>; - m3-dump-addr = <0x4E000000>; - etr-addr = <0x4E100000>; - qcom,caldb-addr = <0x4E200000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; -#endif - }; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,board_id = <0x24>; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 5G */ - board_id = <0xa0>; - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d60-5g.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d60-5g.dts deleted file mode 100755 index 02910e378..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d60-5g.dts +++ /dev/null @@ -1,995 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "OptimCloud D60-5G"; - compatible = "optimcloud,d60-5g", "qcom,ipq5018-mp03.1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - AUTO_MOUNT; - #endif - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp2"; - ethernet1 = "/soc/dp1"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 23MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C700000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4C900000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4DA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01700000>; - }; - - m3_dump@4c700000 { - no-map; - reg = <0x0 0x4C700000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - qcn9000_pcie0@4c900000 { - no-map; - reg = <0x0 0x4C900000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4da00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4da00000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4EA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@4ea00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4ea00000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F900000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@4F900000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F900000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - ethernet-phy@0 { - reg = <0>; - }; - - ethernet-phy@1 { - reg = <1>; - }; - - ethernet-phy@2 { - reg = <2>; - }; - - ethernet-phy@3 { - reg = <3>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - }; - - wifi0: wifi@c000000 { - qcom,bdf-addr = <0x4BA00000 0x4BA00000 0x4BA00000 - 0x0 0x0>; - qcom,caldb-addr = <0x4CA00000 0x4CA00000 0x4CA00000 - 0x0 0x0>; - qcom,caldb-size = <0x200000>; - status = "ok"; - }; - - ess-uniphy@98000 { - status = "disabled"; - }; - - qcom,sps { - status = "ok"; - }; - - qcom,usbbam@8B04000 { - status = "ok"; - }; - - qcom,diag@0 { - status = "ok"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - rpm_etm0 { - status = "disabled"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; - - gpio_keys { - compatible = "gpio-keys-polled"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - poll-interval = <100>; - - button@0 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@35 { - label = "green:4g"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_5g_wifi"; - default-state = "off"; - }; - led@30 { - label = "green:wifi"; - gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_2g_wifi"; - default-state = "off"; - }; - led@1 { - label = "green:internet"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_voice"; - default-state = "off"; - }; - led@33 { - label = "green:lte"; - gpios = <&tlmm 33 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_lte_g"; - default-state = "off"; - }; - led@34 { - label = "red:lte"; - gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_lte_r"; - default-state = "off"; - }; - led@27 { - label = "green:mesh"; - gpios = <&tlmm 27 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_nr_g"; - default-state = "off"; - }; - led@28 { - label = "red:mesh"; - gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_nr_r"; - default-state = "off"; - }; - }; - - -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: blsp0_uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - reset_button{ - pins = "gpio22"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - }; - - leds_pins: leds_pins { - led_5g_wifi { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g_wifi { - pins = "gpio30"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_lte_g { - pins = "gpio33"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_lte_r { - pins = "gpio34"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_nr_g { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_nr_r { - pins = "gpio28"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_voice { - pins = "gpio1"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&usb3 { - qcom,multiplexed-phy; - qcom,phy-mux-regs = <&tcsr_q6_block 0x2540>; - device-power-gpio = <&tlmm 24 1>; - status = "ok"; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&bt { - status = "ok"; -}; - -&wcss { - status = "ok"; -}; - -&q6v5_wcss { - status = "disabled"; -}; - -&q6v5_m3 { - status = "disabled"; -}; - -&tcsr_mutex_block { - status = "ok"; -}; - -&tcsr_mutex { - status = "ok"; -}; - -&smem { - status = "ok"; -}; - -&apcs_glb { - status = "ok"; -}; - -&tcsr_q6_block { - status = "ok"; -}; - -&qcom_q6v5_wcss { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_region>, <&q6_etr_region>; - #else - memory-region = <&q6_region>, <&q6_etr_region>, - <&q6_caldb_region>; - #endif - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&dbm_1p5 { - status = "ok"; -}; - -&msm_imem { - status = "ok"; -}; - -&blsp1_uart1 { - status = "ok"; -}; - -&ssuniphy_0 { - status = "ok"; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x20>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4CC00000>; - m3-dump-addr = <0x4E000000>; - etr-addr = <0x4E100000>; - qcom,caldb-addr = <0x4E200000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; -#endif - }; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,board_id = <0x24>; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 5G */ - board_id = <0xa0>; - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d60.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d60.dts deleted file mode 100644 index 770fbd157..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-optimcloud-d60.dts +++ /dev/null @@ -1,884 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "OptimCloud D60"; - compatible = "optimcloud,d60", "qcom,ipq5018-mp03.1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - AUTO_MOUNT; - #endif - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 23MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C700000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4C900000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4DA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01700000>; - }; - - m3_dump@4c700000 { - no-map; - reg = <0x0 0x4C700000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - qcn9000_pcie0@4c900000 { - no-map; - reg = <0x0 0x4C900000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4da00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4da00000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4EA00000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@4ea00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4ea00000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 24MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4C800000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4C900000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4CA00000 | 2MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4CC00000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F900000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - q6_region: wcnss@4b000000 { - no-map; - reg = <0x0 0x4b000000 0x0 0x01800000>; - }; - - m3_dump@4c800000 { - no-map; - reg = <0x0 0x4c800000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4c900000 { - no-map; - reg = <0x0 0x4c900000 0x0 0x100000>; - }; - - q6_caldb_region:q6_caldb_region@4ca00000 { - no-map; - reg = <0x0 0x4ca00000 0x0 0x200000>; - }; - - qcn9000_pcie0@4cc00000 { - no-map; - reg = <0x0 0x4CC00000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@4F900000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F900000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - ethernet-phy@0 { - reg = <0>; - }; - - ethernet-phy@1 { - reg = <1>; - }; - - ethernet-phy@2 { - reg = <2>; - }; - - ethernet-phy@3 { - reg = <3>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - }; - - wifi0: wifi@c000000 { - qcom,bdf-addr = <0x4BA00000 0x4BA00000 0x4BA00000 - 0x0 0x0>; - qcom,caldb-addr = <0x4CA00000 0x4CA00000 0x4CA00000 - 0x0 0x0>; - qcom,caldb-size = <0x200000>; - status = "ok"; - }; - - ess-uniphy@98000 { - status = "disabled"; - }; - - qcom,sps { - status = "ok"; - }; - - qcom,usbbam@8B04000 { - status = "ok"; - }; - - qcom,diag@0 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - rpm_etm0 { - status = "disabled"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: blsp0_uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -&usb3 { - qcom,multiplexed-phy; - qcom,phy-mux-regs = <&tcsr_q6_block 0x2540>; - device-power-gpio = <&tlmm 24 1>; - status = "ok"; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&bt { - status = "ok"; -}; - -&wcss { - status = "ok"; -}; - -&q6v5_wcss { - status = "disabled"; -}; - -&q6v5_m3 { - status = "disabled"; -}; - -&tcsr_mutex_block { - status = "ok"; -}; - -&tcsr_mutex { - status = "ok"; -}; - -&smem { - status = "ok"; -}; - -&apcs_glb { - status = "ok"; -}; - -&tcsr_q6_block { - status = "ok"; -}; - -&qcom_q6v5_wcss { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_region>, <&q6_etr_region>; - #else - memory-region = <&q6_region>, <&q6_etr_region>, - <&q6_caldb_region>; - #endif - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&dbm_1p5 { - status = "ok"; -}; - -&msm_imem { - status = "ok"; -}; - -&blsp1_uart1 { - status = "ok"; -}; - -&ssuniphy_0 { - status = "ok"; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x20>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4CC00000>; - m3-dump-addr = <0x4E000000>; - etr-addr = <0x4E100000>; - qcom,caldb-addr = <0x4E200000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; -#endif - }; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,board_id = <0x24>; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 5G */ - board_id = <0xa0>; - status = "ok"; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-q14.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-q14.dts deleted file mode 100755 index 97fe96388..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-q14.dts +++ /dev/null @@ -1,886 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Motorola Q14"; - compatible = "motorola,q14", "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 8MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x40800000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 13MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D100000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D300000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4E400000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4F300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4F400000 | 1MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x4500000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x1400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4D100000 { - no-map; - reg = <0x0 0x4D100000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 { - no-map; - reg = <0x0 0x4F300000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 { - no-map; - reg = <0x0 0x4F400000 0x0 0x100000>; - }; - #else - /* 512MB/1GB Profiles - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 14MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D300000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | Caldb | 0x4D400000 | 2MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D600000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E600000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E700000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | Caldb | 0x4E800000 | 5MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4ED00000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4FD00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4FE00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | Caldb | 0x4FF00000 | 5MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x5400000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D400000 { - no-map; - reg = <0x0 0x4D400000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D600000 { - no-map; - reg = <0x0 0x4D600000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 { - no-map; - reg = <0x0 0x4E600000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 { - no-map; - reg = <0x0 0x4E700000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 { - no-map; - reg = <0x0 0x4E800000 0x0 0x500000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { - no-map; - reg = <0x0 0x4ED00000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 { - no-map; - reg = <0x0 0x4FD00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 { - no-map; - reg = <0x0 0x4FE00000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 { - no-map; - reg = <0x0 0x4FF00000 0x0 0x500000>; - }; - - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - status = "disabled"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - - ethernet-phy@0 { - reg = <28>; - }; - }; - - ess-instance { - num_devices = <0x1>; - ess-switch@0x39c00000 { - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - mdiobus = <&mdio0>; - }; - port@1 { - port_id = <2>; - phy_address = <0x1c>; - mdiobus = <&mdio1>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - mdio-bus = <&mdio1>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - mdiobus = <&mdio1>; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&sdhc_1 { - pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; - qcom,clk-rates = <400000 25000000 50000000 100000000 \ - 192000000 384000000>; - qcom,bus-speed-mode = "HS200_1p8v", "DDR_1p8v"; - qcom,nonremovable; - status = "ok"; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - emmc_pins: emmc_pins { - emmc_clk { - pins = "gpio9"; - function = "sdc1_clk"; - drive-strength = <8>; - bias-disable; - }; - emmc_cmd { - pins = "gpio8"; - function = "sdc1_cmd"; - drive-strength = <8>; - bias-pull-up; - }; - emmc_data_0 { - pins = "gpio7"; - function = "sdc10"; - drive-strength = <8>; - bias-disable; - }; - emmc_data_1 { - pins = "gpio6"; - function = "sdc11"; - drive-strength = <8>; - bias-disable; - }; - emmc_data_2 { - pins = "gpio5"; - function = "sdc12"; - drive-strength = <8>; - bias-disable; - }; - emmc_data_3 { - pins = "gpio4"; - function = "sdc13"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - reset_button { - pins = "gpio31"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - - button@2 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 31 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - - }; -}; - -&usb3 { - status = "ok"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "ok"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "ok"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "ok"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - - }; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; -boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>, - <0x2 0x4 0x2 0x12 0x0 0x0>; - - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 6G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd3 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 24 0>, - <&wcss_smp2p_in 25 0>, - <&wcss_smp2p_in 28 0>, - <&wcss_smp2p_in 27 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 24>, - <&wcss_smp2p_out 25>, - <&wcss_smp2p_out 26>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <3>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>; - #else - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&qgic_msi_1 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>; -#else - qcom,caldb-addr = <0x4D400000>; - m3-dump-addr = <0x4D200000>; - nss-radio-priority = <0>; -#endif - mem-region = <&q6_ipq5018_data>; - qcom,caldb-size = <0x200000>; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x4D600000 0x4D600000 0x4D300000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4E800000 0x4E800000 0 0 0>; -#else - qcom,caldb-addr = <0x4E800000>; - m3-dump-addr = <0x4E600000>; - nss-radio-priority = <1>; -#endif - mem-region = <&q6_qcn6122_data1>; - qcom,caldb-size = <0x500000>; - status = "ok"; -}; - -&wifi2 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0xb0>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; - nss-radio-priority = <1>; -#endif - mem-region = <&q6_qcn6122_data2>; - qcom,caldb-size = <0x500000>; - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-wallys-dr5018.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-wallys-dr5018.dts deleted file mode 100755 index 49f4a8c87..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-wallys-dr5018.dts +++ /dev/null @@ -1,984 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Qualcomm Technologies, Inc. IPQ5018/AP-MP03.5-C1"; - compatible = "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018"; - interrupt-parent = <&intc>; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - AUTO_MOUNT; - #endif - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 8MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x40800000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 13MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D100000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D300000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E200000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4E400000 | 15MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4F300000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4F400000 | 1MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x4500000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x1400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4D100000 { - no-map; - reg = <0x0 0x4D100000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 { - no-map; - reg = <0x0 0x4F300000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 { - no-map; - reg = <0x0 0x4F400000 0x0 0x100000>; - }; - #else - /* 512MB/1GB Profiles - * +==========+==============+=========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +----------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +----------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +----------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +----------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +----------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +----------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +----------+--------------+-------------------------+ - * | Q6 | | | - * | code/ | 0x4B000000 | 20MB | - * | data | | | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | data | 0x4C400000 | 14MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | M3 Dump | 0x4D200000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | QDSS | 0x4D300000 | 1MB | - * +----------+--------------+-------------------------+ - * | IPQ5018 | | | - * | Caldb | 0x4D400000 | 2MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | data | 0x4D600000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | M3 Dump | 0x4E600000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | QDSS | 0x4E700000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_1| | | - * | Caldb | 0x4E800000 | 5MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | data | 0x4ED00000 | 16MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | M3 Dump | 0x4FD00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | QDSS | 0x4FE00000 | 1MB | - * +----------+--------------+-------------------------+ - * | QCN6122_2| | | - * | Caldb | 0x4FF00000 | 5MB | - * +----------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +===================================================+ - */ - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x5400000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01400000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C400000 { - no-map; - reg = <0x0 0x4C400000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4D300000 { - no-map; - reg = <0x0 0x4D300000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D400000 { - no-map; - reg = <0x0 0x4D400000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D600000 { - no-map; - reg = <0x0 0x4D600000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 { - no-map; - reg = <0x0 0x4E600000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 { - no-map; - reg = <0x0 0x4E700000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 { - no-map; - reg = <0x0 0x4E800000 0x0 0x500000>; - }; - - q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { - no-map; - reg = <0x0 0x4ED00000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 { - no-map; - reg = <0x0 0x4FD00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 { - no-map; - reg = <0x0 0x4FE00000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 { - no-map; - reg = <0x0 0x4FF00000 0x0 0x500000>; - }; - - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 39 0>; - - ethernet-phy@0 { - reg = <0>; - }; - ethernet-phy@1 { - reg = <1>; - }; - ethernet-phy@2 { - reg = <2>; - }; - ethernet-phy@3 { - reg = <3>; - }; - - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <7>; - }; - - port@1 { - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; - switch_lan_bmp = <0x1e>; - switch_wan_bmp = <0x0>; - qca,ar8327-initvals = < - 0x00004 0x7600000 - 0x00008 0x1000000 - 0x0000c 0x80 - 0x00010 0x2613a0 - 0x000e4 0xaa545 - 0x000e0 0xc74164de - 0x0007c 0x4e - 0x00094 0x4e - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - - }; - - wifi0: wifi@c000000 { - qcom,bdf-addr = <0x4BA00000 0x4BA00000 0x4BA00000 - 0x0 0x0>; - qcom,caldb-addr = <0x4CA00000 0x4CA00000 0x4CA00000 - 0x0 0x0>; - qcom,caldb-size = <0x200000>; - status = "ok"; - }; - - ess-uniphy@98000 { - status = "ok"; - }; - - qcom,sps { - status = "ok"; - }; - - qcom,usbbam@8B04000 { - status = "ok"; - }; - - qcom,diag@0 { - status = "ok"; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - /* qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0 1 2 3>; - mdio-bus = <&mdio1>; */ - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: blsp0_uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio28"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - leds_pins: leds_pinmux { - sys_blue { - pins = "gpio30"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - sys_red { - pins = "gpio36"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - sys_green { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - }; -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 28 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - gpio_leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@30 { - label = "sys:blue"; - gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; /* GPIO_30 */ - default-state="on"; - /* linux,default-trigger = "timer"; - active-delay = <700>; - inactive-delay = <700>; - default-state="on"; */ - }; - led@36 { - label = "sys:red"; - gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; /* GPIO_36 */ - default-state="off"; - /* linux,default-trigger = "timer"; - active-delay = <700>; - inactive-delay = <700>; - default-state="on"; */ - }; - led@37 { - label = "sys:green"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; /* GPIO_37 */ - default-state="off"; - /* linux,default-trigger = "timer"; - active-delay = <700>; - inactive-delay = <700>; - default-state="on"; */ - }; - }; - -}; - -&usb3 { - status = "disabled"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "disabled"; - perst-gpio = <&tlmm 15 1>; -}; - -&bt { - status = "ok"; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "disabled"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - - }; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>, - <0x2 0x4 0x2 0x12 0x0 0x0>; - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 6G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd3 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 24 0>, - <&wcss_smp2p_in 25 0>, - <&wcss_smp2p_in 28 0>, - <&wcss_smp2p_in 27 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 24>, - <&wcss_smp2p_out 25>, - <&wcss_smp2p_out 26>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <3>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>; - #else - memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, - <&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&qgic_msi_1 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x24>; - qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>; -#else - qcom,caldb-addr = <0x4D400000>; - m3-dump-addr = <0x4D200000>; -#endif - qcom,caldb-size = <0x200000>; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "ok"; -}; - -&wifi2 { - /* QCN6122 6G */ - qcom,multipd_arch; - qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0xb0>; - qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; -#else - qcom,caldb-addr = <0x4FF00000>; - m3-dump-addr = <0x4FD00000>; -#endif - qcom,caldb-size = <0x500000>; - status = "disabled"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-yuncore-fap655.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-yuncore-fap655.dts deleted file mode 100755 index 7cd884463..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-yuncore-fap655.dts +++ /dev/null @@ -1,1147 +0,0 @@ -/dts-v1/; -/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq5018.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Yuncore FAP655"; - compatible = "yuncore,fap655", "qcom,ipq5018-mp03.3", "qcom,ipq5018"; - interrupt-parent = <&intc>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - serial0 = &blsp1_uart1; - serial1 = &blsp1_uart2; - ethernet1 = "/soc/dp1"; - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - stdout-path = "serial0"; - }; - - reserved-memory { - #ifdef __IPQ_MEM_PROFILE_256_MB__ - /* 256 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 8MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x40800000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * + | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 13MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CD00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4CF00000 | 15MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4DE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4DF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E000000 | 17MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x4F100000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3000000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4c000000 { - no-map; - reg = <0x0 0x4c000000 0x0 0xD00000>; - }; - - m3_dump: m3_dump@4CD00000 { - no-map; - reg = <0x0 0x4CD00000 0x0 0x100000>; - }; - - q6_etr_region:q6_etr_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0xF00000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4DE00000 { - no-map; - reg = <0x0 0x4DE00000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4DF00000 { - no-map; - reg = <0x0 0x4DF00000 0x0 0x100000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E000000 { - no-map; - reg = <0x0 0x4E000000 0x0 0x01100000>; - }; - - mhi_region1: dma_pool1@4F100000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x4F100000 0x0 0x01000000>; - }; - #elif __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 30MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x50700000 | 16MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x01E00000>; - }; - - mhi_region1: dma_pool1@50700000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x50700000 0x0 0x01000000>; - }; - #else - /* 1G Profile - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | NSS | 0x40000000 | 16MB | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | Depends on total memory | - * | | | | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | uboot | 0x4A600000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | | | | - * | TZ | 0x4AC00000 | 4MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | Q6 | 0x4B000000 | 16MB | - * | code/ | | | - * | data | | | - * +--------+--------------+-------------------------+ - * | | | | - * |IPQ5018 | 0x4C000000 | 14MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4CE00000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4CF00000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4D000000 | 2MB | - * +--------+--------------+-------------------------+ - * |QCN6122 | 0x4D200000 | 16MB | - * | data | | | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E200000 | 1MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E300000 | 1MB | - * +--------+--------------+-------------------------+ - * | caldb | 0x4E400000 | 5MB | - * +--------+--------------+-------------------------+ - * | | | | - * |QCN9000 | 0x4E900000 | 45MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | MHI1 | 0x51600000 | 24MB | - * | | | | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - - q6_mem_regions: q6_mem_regions@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 0x3900000>; - }; - - q6_code_data: q6_code_data@4B000000 { - no-map; - reg = <0x0 0x4B000000 0x0 01000000>; - }; - - q6_ipq5018_data: q6_ipq5018_data@4C000000 { - no-map; - reg = <0x0 0x4C000000 0x0 0xE00000>; - }; - - m3_dump: m3_dump@4CE00000 { - no-map; - reg = <0x0 0x4CE00000 0x0 0x100000>; - }; - - q6_etr_region: q6_etr_dump@4CF00000 { - no-map; - reg = <0x0 0x4CF00000 0x0 0x100000>; - }; - - q6_caldb_region: q6_caldb_region@4D000000 { - no-map; - reg = <0x0 0x4D000000 0x0 0x200000>; - }; - - q6_qcn6122_data1: q6_qcn6122_data1@4D200000 { - no-map; - reg = <0x0 0x4D200000 0x0 0x1000000>; - }; - - m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { - no-map; - reg = <0x0 0x4E200000 0x0 0x100000>; - }; - - q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { - no-map; - reg = <0x0 0x4E300000 0x0 0x100000>; - }; - - q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { - no-map; - reg = <0x0 0x4E400000 0x0 0x500000>; - }; - - q6_qcn9000_region: qcn9000_pcie0@4E900000 { - no-map; - reg = <0x0 0x4E900000 0x0 0x02D00000>; - }; - - mhi_region1: dma_pool1@51600000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x51600000 0x0 0x01800000>; - }; - #endif - }; - - soc { - serial@78af000 { - status = "ok"; - }; - - blsp1_uart2: serial@78b0000 { - pinctrl-0 = <&blsp1_uart_pins>; - pinctrl-names = "default"; - }; - - qpic_bam: dma@7984000{ - status = "ok"; - }; - - nand: qpic-nand@79b0000 { - pinctrl-0 = <&qspi_nand_pins>; - pinctrl-names = "default"; - status = "ok"; - }; - - spi_0: spi@78b5000 { /* BLSP1 QUP0 */ - pinctrl-0 = <&blsp0_spi_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; - }; - - mdio0: mdio@88000 { - status = "ok"; - - ethernet-phy@0 { - reg = <7>; - }; - }; - - mdio1: mdio@90000 { - status = "ok"; - pinctrl-0 = <&mdio1_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 16 0>; - - ethernet-phy@0 { - reg = <0x00>; - }; - - ethernet-phy@1 { - reg = <0x01>; - }; - - ethernet-phy@2 { - reg = <0x02>; - }; - - ethernet-phy@3 { - reg = <0x03>; - }; - - ethernet-phy@4 { - reg = <0x04>; - }; - }; - - ess-instance { - num_devices = <0x2>; - ess-switch@0x39c00000 { - compatible = "qcom,ess-switch-ipq50xx"; - device_id = <0>; - switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ - cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ - qcom,port_phyinfo { - port@0 { - mdio-bus = <&mdio0>; - port_id = <1>; - phy_dac = <0x10 0x10>; - phy_address = <7>; - }; - port@1 { - mdio-bus = <&mdio0>; - port_id = <2>; - forced-speed = <1000>; - forced-duplex = <1>; - }; - }; - - led_source@0 { - source = <0>; - mode = "normal"; - speed = "all"; - blink_en = "enable"; - active = "high"; - }; - }; - ess-switch1@1 { - compatible = "qcom,ess-switch-qca83xx"; - device_id = <1>; - switch_access_mode = "mdio"; - mdio-bus = <&mdio1>; - reset_gpio = <0x27>; - switch_cpu_bmp = <0x40>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x0>; /* wan port bitmap */ - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x00010 0x2613a0 /* PORT6 FORCE MODE*/ - 0x000e4 0xaa545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <4>; - }; - }; - }; - }; - - wifi0: wifi@c000000 { - status = "ok"; - }; - - /*dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - };*/ - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - mdio-bus = <&mdio1>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; - - qcom,test@0 { - status = "ok"; - }; - - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - mdiobus = <&mdio1>; - }; - - lpass: lpass@0xA000000{ - status = "disabled"; - }; - - pcm: pcm@0xA3C0000{ - pinctrl-0 = <&audio_pins>; - pinctrl-names = "default"; - status = "disabled"; - }; - - pcm_lb: pcm_lb@0 { - status = "disabled"; - }; - }; - - thermal-zones { - status = "ok"; - }; -}; - -&tlmm { - pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; - pinctrl-names = "default"; - - blsp0_uart_pins: uart_pins { - blsp0_uart_rx_tx { - pins = "gpio20", "gpio21"; - function = "blsp0_uart0"; - bias-disable; - }; - }; - - blsp1_uart_pins: blsp1_uart_pins { - blsp1_uart_rx_tx { - pins = "gpio23", "gpio25", "gpio24", "gpio26"; - function = "blsp1_uart2"; - bias-disable; - }; - }; - - blsp0_spi_pins: blsp0_spi_pins { - mux { - pins = "gpio10", "gpio11", "gpio12", "gpio13"; - function = "blsp0_spi"; - drive-strength = <2>; - bias-disable; - }; - }; - - qspi_nand_pins: qspi_nand_pins { - qspi_clock { - pins = "gpio9"; - function = "qspi_clk"; - drive-strength = <8>; - bias-disable; - }; - qspi_cs { - pins = "gpio8"; - function = "qspi_cs"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_0 { - pins = "gpio7"; - function = "qspi0"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_1 { - pins = "gpio6"; - function = "qspi1"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_2 { - pins = "gpio5"; - function = "qspi2"; - drive-strength = <8>; - bias-disable; - }; - qspi_data_3 { - pins = "gpio4"; - function = "qspi3"; - drive-strength = <8>; - bias-disable; - }; - }; - - mdio1_pins: mdio_pinmux { - mux_0 { - pins = "gpio36"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio37"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - phy_led_pins: phy_led_pins { - gephy_led_pin { - pins = "gpio46"; - function = "led0"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_pins: i2c_pins { - i2c_scl { - pins = "gpio25"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - - i2c_sda { - pins = "gpio26"; - function = "blsp2_i2c1"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio38"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - leds_pins: leds_pins { - linux,phandle = <0x4d>; - phandle = <0x4d>; - - led_sys { - pins = "gpio24"; - function = "gpio"; - bias-pull-down; - drive-strength = <0x08>; - }; - - led_5g { - pins = "gpio22"; - function = "gpio"; - bias-pull-down; - drive-strength = <0x08>; - }; - - led_2g { - pins = "gpio23"; - function = "gpio"; - bias-pull-down; - drive-strength = <0x08>; - }; - }; audio_pins: audio_pinmux { - mux_1 { - pins = "gpio24"; - function = "audio_rxbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_2 { - pins = "gpio25"; - function = "audio_rxfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_3 { - pins = "gpio26"; - function = "audio_rxd"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_4 { - pins = "gpio27"; - function = "audio_txmclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_5 { - pins = "gpio28"; - function = "audio_txbclk"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_6 { - pins = "gpio29"; - function = "audio_txfsync"; - drive-strength = <8>; - bias-pull-down; - }; - - mux_7 { - pins = "gpio30"; - function = "audio_txd"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "restart"; - linux,code = ; - gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_power: led@32 { - label = "green:power"; - gpios = <&tlmm 24 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - led@35 { - label = "green:wifi5"; - gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led@37 { - label = "green:wifi2"; - gpios = <&tlmm 23 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - }; - - - -}; - -&usb3 { - status = "ok"; - device-power-gpio = <&tlmm 24 1>; -}; - -&eud { - status = "ok"; -}; - -&pcie_x1 { - status = "disabled"; - perst-gpio = <&tlmm 18 1>; -}; - -&pcie_x2 { - status = "ok"; - perst-gpio = <&tlmm 15 1>; -}; - -&dwc_0 { - /delete-property/ #phy-cells; - /delete-property/ phys; - /delete-property/ phy-names; -}; - -&hs_m31phy_0 { - status = "ok"; -}; - -&pcie_x1phy { - status = "disabled"; -}; - -&pcie_x2phy { - status = "ok"; -}; - -&pcie_x1_rp { - status = "disabled"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - }; -}; - -&pcie_x2_rp { - status = "ok"; - - mhi_1: qcom,mhi@1 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x21>; - #address-cells = <0x2>; - #size-cells = <0x2>; - memory-region = <&mhi_region1>; -#if !defined(__CNSS2__) - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - qcom,caldb-addr = <0x4FF00000>; - qcom,tgt-mem-mode = <0x1>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; - qcom,board_id = <0xa4>; -#endif - }; -}; - -&qfprom { - status = "ok"; -}; - -&tsens { - status = "ok"; -}; - -&qcom_q6v5_wcss { - qcom,multipd_arch; - memory-region = <&q6_mem_regions>; - qcom,share_bootargs; - qcom,bootargs_smem = <507>; - boot-args = <0x2 0x4 0x2 0x12 0x0 0x0>; - - /* IPQ5018 */ - q6v5_wcss_userpd1 { - m3_firmware = "IPQ5018/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 8 0>, - <&wcss_smp2p_in 9 0>, - <&wcss_smp2p_in 12 0>, - <&wcss_smp2p_in 11 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 8>, - <&wcss_smp2p_out 9>, - <&wcss_smp2p_out 10>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <1>; - qca,auto-restart; - qca,int_radio; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>; - #else - memory-region = <&q6_ipq5018_data>, <&m3_dump>, - <&q6_etr_region>, <&q6_caldb_region>; - #endif - }; - - /* QCN6122 5G */ - q6v5_wcss_userpd2 { - m3_firmware = "qcn6122/m3_fw.mdt"; - interrupts-extended = <&wcss_smp2p_in 16 0>, - <&wcss_smp2p_in 17 0>, - <&wcss_smp2p_in 20 0>, - <&wcss_smp2p_in 19 0>; - interrupt-names ="fatal", - "ready", - "spawn_ack", - "stop-ack"; - qcom,smem-states = <&wcss_smp2p_out 16>, - <&wcss_smp2p_out 17>, - <&wcss_smp2p_out 18>; - qcom,smem-state-names = "shutdown", - "stop", - "spawn"; - qca,asid = <2>; - qca,auto-restart; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>; - #else - memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, - <&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; - #endif - }; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&qgic_msi_0 { - status = "ok"; -}; - -&wifi0 { - /* IPQ5018 */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x23>; - qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4D000000 0 0 0>; -#else - qcom,caldb-addr = <0x4D000000>; - m3-dump-addr = <0x4CE00000>; -#endif - qcom,caldb-size = <0x200000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; - status = "ok"; -}; - -&wifi1 { - /* QCN6122 5G */ - qcom,multipd_arch; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - qcom,tgt-mem-mode = <2>; -#else - qcom,tgt-mem-mode = <1>; -#endif - qcom,board_id = <0x60>; - qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>; -#ifdef __CNSS2__ - qcom,caldb-addr = <0x0 0x4E400000 0 0 0>; -#else - qcom,caldb-addr = <0x4E400000>; - m3-dump-addr = <0x4E200000>; -#endif - qcom,caldb-size = <0x500000>; - qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; - status = "ok"; -}; - -&wifi3 { - /* QCN9000 6G */ - compatible = "qcom,cnss-qcn9000"; - board_id = <0xa4>; - status = "disabled"; - qrtr_node_id = <0x21>; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - /* QCN9000 tgt-mem-mode=2 layout - 17MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E000000 | 15MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4EF00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4F000000 | 1MB | - * +==================================+ - */ - base-addr = <0x4E000000>; - m3-dump-addr = <0x4EF00000>; - etr-addr = <0x4F000000>; - caldb-addr = <0>; - caldb-size = <0>; - hremote-size = <0xF00000>; - tgt-mem-mode = <0x2>; -#elif __IPQ_MEM_PROFILE_512_MB__ - /* QCN9000 tgt-mem-mode=1 layout - 30MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 20MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4FD00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4FE00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x4FF00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - caldb-addr = <0x4FF00000>; - caldb-size = <0x800000>; - hremote-size = <0x1400000>; - tgt-mem-mode = <0x1>; -#else - /* QCN9000 tgt-mem-mode=0 layout - 45MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 35MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x50C00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x50D00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x50E00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x50C00000>; - etr-addr = <0x50D00000>; - caldb-addr = <0x50E00000>; - hremote-size = <0x2300000>; - caldb-size = <0x800000>; - tgt-mem-mode = <0x0>; -#endif -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf188.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf188.dts deleted file mode 100644 index 4c4d6f1b8..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf188.dts +++ /dev/null @@ -1,423 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Cigtech WF-188"; - compatible = "cig,wf188", "qcom,ipq6018-cp03", "qcom,ipq6018"; - interrupt-parent = <&intc>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " swiotlb=1 coherent_pool=2M"; - }; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio22"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_5g { - pins = "gpio25"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio24"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_eth { - pins = "gpio18"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_pwr { - pins = "gpio16"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - uart2_pins: uart2_pins { - mux { - pins = "gpio57", "gpio58"; - function = "blsp4_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <3>; - }; - phy1: ethernet-phy@1 { - reg = <4>; - }; - }; - - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x08>; /* lan port bitmap */ - switch_wan_bmp = <0x10>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@3 { - port_id = <3>; - phy_address = <4>; - }; - port@4 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - wps { - label = "reset"; - linux,code = ; - gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@25 { - label = "green:wifi5"; - gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:5g"; - default-state = "off"; - }; - led@24 { - label = "green:wifi2"; - gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:2g"; - default-state = "off"; - }; - led@18 { - label = "green:wan"; - gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:eth"; - default-state = "off"; - }; - led_power: led@16 { - label = "green:power"; - gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:power"; - default-state = "off"; - }; - }; - - gpio-watchdog { - compatible = "linux,wdt-gpio"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - hw_algo = "toggle"; - hw_margin_ms = <5000>; - always-running; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&uart2_pins>; - pinctrl-names = "default"; - dmas = <&blsp_dma 2>, - <&blsp_dma 3>; - dma-names = "tx", "rx"; - status = "ok"; -}; -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "disabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&cpu0_opp_table { - compatible = "operating-points-v2"; - opp-shared; - opp03 { - opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <3>; - clock-latency-ns = <200000>; - }; - /delete-node/ opp04; - /delete-node/ opp05; - /delete-node/ opp06; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf188n.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf188n.dts deleted file mode 100644 index 4956502ce..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf188n.dts +++ /dev/null @@ -1,423 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Cigtech WF-188n"; - compatible = "cig,wf188n", "qcom,ipq6018-cp03", "qcom,ipq6018"; - interrupt-parent = <&intc>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " swiotlb=1 coherent_pool=2M"; - }; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio22"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_5g { - pins = "gpio25"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio24"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_eth { - pins = "gpio18"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_pwr { - pins = "gpio16"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - uart2_pins: uart2_pins { - mux { - pins = "gpio57", "gpio58"; - function = "blsp4_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <3>; - }; - phy1: ethernet-phy@1 { - reg = <4>; - }; - }; - - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x08>; /* lan port bitmap */ - switch_wan_bmp = <0x10>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@3 { - port_id = <3>; - phy_address = <4>; - }; - port@4 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - wps { - label = "reset"; - linux,code = ; - gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@25 { - label = "green:wifi5"; - gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:5g"; - default-state = "off"; - }; - led@24 { - label = "green:wifi2"; - gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:2g"; - default-state = "off"; - }; - led@18 { - label = "green:wan"; - gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:eth"; - default-state = "off"; - }; - led_power: led@16 { - label = "green:power"; - gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:power"; - default-state = "on"; - }; - }; - - gpio-watchdog { - compatible = "linux,wdt-gpio"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - hw_algo = "toggle"; - hw_margin_ms = <5000>; - always-running; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&uart2_pins>; - pinctrl-names = "default"; - dmas = <&blsp_dma 2>, - <&blsp_dma 3>; - dma-names = "tx", "rx"; - status = "ok"; -}; -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&cpu0_opp_table { - compatible = "operating-points-v2"; - opp-shared; - opp03 { - opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <3>; - clock-latency-ns = <200000>; - }; - /delete-node/ opp04; - /delete-node/ opp05; - /delete-node/ opp06; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a-cp01.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a-cp01.dtsi deleted file mode 100755 index 6a8b13baa..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a-cp01.dtsi +++ /dev/null @@ -1,566 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - compatible = "cig,wf660a", "qcom,ipq6018-cp01", "qcom,ipq6018"; - interrupt-parent = <&intc>; - qcom,msm-id = <0x192 0x0>, <0x193 0x0>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - sdhc1 = &sdhc_1; - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - ethernet2 = "/soc/dp3"; - ethernet3 = "/soc/dp4"; - ethernet4 = "/soc/dp5"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; -#else - bootargs-append = " swiotlb=1 coherent_pool=2M"; -#endif - }; - -}; - -&tlmm { - pinctrl-0 = <&sd_ldo_pins>; - pinctrl-names = "default"; - - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_ldo_pins: sd_ldo_pins { - mux { - pins = "gpio66"; - function = "gpio"; - drive-strength = <2>; - bias-disable; - output-low; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_1_pins: spi_1_pins { - mux { - pins = "gpio69", "gpio71", "gpio72"; - function = "blsp1_spi"; - drive-strength = <8>; - bias-pull-down; - }; - spi_cs { - pins = "gpio70"; - function = "blsp1_spi"; - drive-strength = <8>; - bias-disable; - }; - quartz_interrupt { - pins = "gpio78"; - function = "gpio"; - input; - bias-disable; - }; - quartz_reset { - pins = "gpio79"; - function = "gpio"; - output-low; - bias-disable; - }; - - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_pins: sd_pins { - mux { - pins = "gpio62"; - function = "sd_card"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - extcon_usb_pins: extcon_usb_pins { - mux { - pins = "gpio26"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio9"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - reset_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio77"; - function = "gpio"; - bias-pull-up; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio71", "gpio72"; - function = "blsp1_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - - btcoex_pins: btcoex_pins { - mux_0 { - pins = "gpio51"; - function = "pta1_1"; - drive-strength = <6>; - bias-pull-down; - }; - mux_1 { - pins = "gpio53"; - function = "pta1_0"; - drive-strength = <6>; - bias-pull-down; - }; - mux_2 { - pins = "gpio52"; - function = "pta1_2"; - drive-strength = <6>; - bias-pull-down; - }; - }; - pwm_pins: pwm_pinmux { - mux_1 { - pins = "gpio22"; - function = "pwm02"; - drive-strength = <8>; - }; - mux_2 { - pins = "gpio23"; - function = "pwm12"; - drive-strength = <8>; - }; - mux_3 { - pins = "gpio24"; - function = "pwm22"; - drive-strength = <8>; - }; - - }; -}; - -&soc { - pwm0: pwm { - pinctrl-0 = <&pwm_pins>; - pinctrl-names = "default"; - used-pwm-indices = <1>, <1>, <1>, <0>; - status = "ok"; - #pwm-cells = <2>; - }; - extcon_usb: extcon_usb { - pinctrl-0 = <&extcon_usb_pins>; - pinctrl-names = "default"; - id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; - status = "ok"; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0 &tlmm 77 1>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <0x1c>; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - phy-mode = "sgmii"; - }; - - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <0x1c>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - pwmleds { - compatible = "pwm-leds"; - - led_power: led1 { - label = "blue:status"; - pwms = <&pwm0 0 5000>; - max-brightness = <255>; - }; - - led2 { - label = "green:status"; - pwms = <&pwm0 1 5000>; - max-brightness = <255>; - }; - - led3 { - label = "red:status"; - pwms = <&pwm0 2 5000>; - max-brightness = <255>; - }; - }; - -i2c_4: i2c@78b9000 { - compatible = "qcom,i2c-qup-v2.2.1"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x78b9000 0x600>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_AHB_CLK>,<&gcc GCC_BLSP1_QUP5_I2C_APPS_CLK>; - clock-names = "iface", "core"; - clock-frequency = <100000>; - dmas = <&blsp_dma 21>, <&blsp_dma 20>; - dma-names = "rx", "tx"; - status = "disabled"; -}; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&hsuart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_1 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_1_pins>; - pinctrl-names = "default"; - cs-select = <0>; - quartz-reset-gpio = <&tlmm 79 1>; - status = "disabled"; - spidev1: spi@1 { - compatible = "qca,spidev"; - reg = <0>; - spi-max-frequency = <24000000>; - }; -}; - - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "disable"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&pcie_phy { - status = "ok"; -}; - -&pcie0 { -#if defined(__CNSS2__) - status = "ok"; -#endif -}; - -&qpic_lcd { - status = "ok"; -}; - -&qpic_lcd_panel { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts deleted file mode 100755 index 470b891e7..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts +++ /dev/null @@ -1,120 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-cig-wf660a-cp01.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" - -/ { - model = "Cigtech WF-660a"; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - i2c_0_pins: i2c_0_pins { - mux { - pins = "gpio69", "gpio70"; - function = "blsp1_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; - i2c_1_pins: i2c_1_pins { - mux { - pins = "gpio42", "gpio43"; - function = "blsp2_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; - i2c_4_pins: i2c_4_pins { - mux { - pins = "gpio55", "gpio56"; - function = "blsp4_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&i2c_0 { - pinctrl-0 = <&i2c_0_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - - -&i2c_1 { - pinctrl-0 = <&i2c_1_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&i2c_4 { - pinctrl-0 = <&i2c_4_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&sdhc_1 { - status = "ok"; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cp01-edgecore.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cp01-edgecore.dtsi deleted file mode 100644 index 04e65d608..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cp01-edgecore.dtsi +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - compatible = "qcom,ipq6018-cp01", "qcom,ipq6018"; - interrupt-parent = <&intc>; - qcom,msm-id = <0x192 0x0>, <0x193 0x0>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - sdhc2 = &sdhc_2; - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - ethernet2 = "/soc/dp3"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; -#else - bootargs-append = " swiotlb=1 coherent_pool=2M"; -#endif - }; - -}; - -&tlmm { - pinctrl-0 = <&sd_ldo_pins>; - pinctrl-names = "default"; - - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_ldo_pins: sd_ldo_pins { - mux { - pins = "gpio66"; - function = "gpio"; - drive-strength = <2>; - bias-disable; - output-low; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_1_pins: spi_1_pins { - mux { - pins = "gpio69", "gpio71", "gpio72"; - function = "blsp1_spi"; - drive-strength = <8>; - bias-pull-down; - }; - spi_cs { - pins = "gpio70"; - function = "blsp1_spi"; - drive-strength = <8>; - bias-disable; - }; - quartz_interrupt { - pins = "gpio78"; - function = "gpio"; - input; - bias-disable; - }; - quartz_reset { - pins = "gpio79"; - function = "gpio"; - output-low; - bias-disable; - }; - - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_pins: sd_pins { - mux { - pins = "gpio62"; - function = "sd_card"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - extcon_usb_pins: extcon_usb_pins { - mux { - pins = "gpio26"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio9"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - reset_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio77"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_pwr { - pins = "gpio74"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_5g { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_wan { - pins = "gpio62"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_lan1 { - pins = "gpio61"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_lan2 { - pins = "gpio63"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_bt { - pins = "gpio73"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio71", "gpio72", "gpio69", "gpio70"; - function = "blsp1_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - - btcoex_pins: btcoex_pins { - mux_0 { - pins = "gpio51"; - function = "pta1_1"; - drive-strength = <6>; - bias-pull-down; - }; - mux_1 { - pins = "gpio53"; - function = "pta1_0"; - drive-strength = <6>; - bias-pull-down; - }; - mux_2 { - pins = "gpio52"; - function = "pta1_2"; - drive-strength = <6>; - bias-pull-down; - }; - }; -}; - -&soc { - extcon_usb: extcon_usb { - pinctrl-0 = <&extcon_usb_pins>; - pinctrl-names = "default"; - id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; - status = "ok"; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0 &tlmm 77 1>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <0x1c>; - }; - phy1: ethernet-phy@1 { - reg = <3>; - }; - phy2: ethernet-phy@2 { - reg = <4>; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@2 { - port_id = <3>; - phy_address = <4>; - }; - port@1 { - port_id = <4>; - phy_address = <3>; - }; - port@0 { - port_id = <5>; - phy_address = <0x1c>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - /*wps { - label = "wps"; - linux,code = ; - gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - };*/ - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_power: led@74 { - label = "green:power"; - gpios = <&tlmm 74 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_pwr"; - default-state = "on"; - }; - led@35 { - label = "green:wifi5"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_5g"; - default-state = "off"; - }; - led@37 { - label = "green:wifi2"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_2g"; - default-state = "off"; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&hsuart_pins &btcoex_pins>; - pinctrl-names = "default"; - dmas = <&blsp_dma 2>, - <&blsp_dma 3>; - dma-names = "tx", "rx"; - status = "ok"; -}; - -&spi_1 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_1_pins>; - pinctrl-names = "default"; - cs-select = <0>; - quartz-reset-gpio = <&tlmm 79 1>; - status = "disabled"; - spidev1: spi@1 { - compatible = "qca,spidev"; - reg = <0>; - spi-max-frequency = <24000000>; - }; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&pcie_phy { - status = "ok"; -}; - -&pcie0 { - status = "ok"; -}; - -&qpic_lcd { - status = "ok"; -}; - -&qpic_lcd_panel { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cp01-hfcl.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cp01-hfcl.dtsi deleted file mode 100644 index 7c67cf7ad..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cp01-hfcl.dtsi +++ /dev/null @@ -1,478 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - compatible = "qcom,ipq6018-cp01", "qcom,ipq6018"; - interrupt-parent = <&intc>; - qcom,msm-id = <0x192 0x0>, <0x193 0x0>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - sdhc2 = &sdhc_2; - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; -#else - bootargs-append = " swiotlb=1 coherent_pool=2M"; -#endif - }; - -}; - -&tlmm { - pinctrl-0 = <&sd_ldo_pins &hfcl_gpio>; - pinctrl-names = "default"; - - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_ldo_pins: sd_ldo_pins { - mux { - pins = "gpio66"; - function = "gpio"; - drive-strength = <2>; - bias-disable; - output-low; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_pins: sd_pins { - mux { - pins = "gpio62"; - function = "sd_card"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - extcon_usb_pins: extcon_usb_pins { - mux { - pins = "gpio26"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio53"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio77"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_5g { - pins = "gpio60"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio61"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - hfcl_gpio: hfcl_gpio { - mux_0 { - pins = "gpio25"; - function = "gpio"; - drive-strength = <8>; - output-low; - }; - mux_1 { - pins = "gpio29"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - mux_2 { - pins = "gpio33"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - mux_3 { - pins = "gpio34"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - mux_4 { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - mux_5 { - pins = "gpio59"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - mux_6 { - pins = "gpio67"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - mux_7 { - pins = "gpio70"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - mux_8 { - pins = "gpio79"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - uniphy_pins: uniphy_pinmux { - mux { - pins = "gpio63"; - function = "rx0"; - bias-disable; - }; - sfp_tx { - pins = "gpio48"; - function = "gpio"; - driver-strength = <8>; - bias-pull-down; - output-low; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio71", "gpio72"; - function = "blsp1_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - -}; - -&soc { - extcon_usb: extcon_usb { - pinctrl-0 = <&extcon_usb_pins>; - pinctrl-names = "default"; - id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; - status = "disabled"; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 77 0>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <4>; - }; - phy1: ethernet-phy@1 { - reg = <30>; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a003000 0x3fff>; - qcom,mactype = <1>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <30>; - phy-mode = "sgmii"; - }; - - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <30>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - - ess-switch@3a000000 { - pinctrl-0 = <&uniphy_pins>; - pinctrl-names = "default"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x10>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0xf>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0x14>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@0 { - port_id = <4>; - phy_address = <4>; - }; - port@2 { - port_id = <5>; - phy_address = <30>; - phy_i2c_address = <30>; - phy-i2c-mode; - port_mac_sel = "GMAC_PORT"; - }; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 53 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - i2c_2: i2c@78b9000 { - compatible = "qcom,i2c-qup-v2.2.1"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x78b9000 0x600>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_AHB_CLK>, - <&gcc GCC_BLSP1_QUP5_I2C_APPS_CLK>; - clock-names = "iface", "core"; - clock-frequency = <400000>; - dmas = <&blsp_dma 21>, <&blsp_dma 20>; - dma-names = "rx", "tx"; - status = "disabled"; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&hsuart_pins>; - pinctrl-names = "default"; - dmas = <&blsp_dma 2>, - <&blsp_dma 3>; - dma-names = "tx", "rx"; - status = "ok"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&pcie_phy { - status = "disabled"; -}; - -&pcie0 { - status = "disabled"; -}; - -&qpic_lcd { - status = "disabled"; -}; - -&qpic_lcd_panel { - status = "disabled"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-edgecore-eap101.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-edgecore-eap101.dts deleted file mode 100644 index 265398e78..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-edgecore-eap101.dts +++ /dev/null @@ -1,442 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "EdgeCore EAP101"; - compatible = "edgecore,eap101", "qcom,ipq6018-cp01", "qcom,ipq6018"; - interrupt-parent = <&intc>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - ethernet2 = "/soc/dp3"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " console=ttyMSM0,115200,n8 swiotlb=1 coherent_pool=2M"; - }; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - extcon_usb_pins: extcon_usb_pins { - mux { - pins = "gpio26"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_pwr { - pins = "gpio74"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_5g { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - uart2_pins: uart2_pins { - mux { - pins = "gpio57", "gpio58"; - function = "blsp4_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - extcon_usb: extcon_usb { - pinctrl-0 = <&extcon_usb_pins>; - pinctrl-names = "default"; - id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; - status = "ok"; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0 &tlmm 77 1>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <0x1c>; - }; - phy1: ethernet-phy@1 { - reg = <3>; - }; - phy2: ethernet-phy@2 { - reg = <4>; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@2 { - port_id = <3>; - phy_address = <4>; - }; - port@1 { - port_id = <4>; - phy_address = <3>; - }; - port@0 { - port_id = <5>; - phy_address = <0x1c>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - wps { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@25 { - label = "green:wifi5"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:5g"; - default-state = "off"; - }; - led@24 { - label = "green:wifi2"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "wf188:green:2g"; - default-state = "off"; - }; - led_power: led@16 { - label = "green:led_pwr"; - gpios = <&tlmm 74 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:power"; - default-state = "off"; - }; - led@61 { - label = "green:lan1"; - gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:power"; - default-state = "off"; - }; - led@62 { - label = "green:wan"; - gpios = <&tlmm 62 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:power"; - default-state = "off"; - }; - led@63 { - label = "green:lan2"; - gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:power"; - default-state = "off"; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&uart2_pins>; - pinctrl-names = "default"; - dmas = <&blsp_dma 2>, - <&blsp_dma 3>; - dma-names = "tx", "rx"; - status = "ok"; -}; -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-ax1800.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-ax1800.dts deleted file mode 100644 index 77682246c..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-ax1800.dts +++ /dev/null @@ -1,78 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-gl-ax1800.dtsi" - -/ { - model = "GL Technologies, Inc. AX1800"; - compatible = "glinet,ax1800", "qcom,ipq6018-cp03", "qcom,ipq6018"; - - aliases { - ethernet3 = "/soc/dp4"; - ethernet4 = "/soc/dp5"; - }; -}; - -&mdio0 { - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <4>; - }; -}; - -&ess0 { - switch_lan_bmp = <0x3c>; /* lan port bitmap */ - - qcom,port_phyinfo { - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <4>; - }; - }; -}; - -&soc { - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-ax1800.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-ax1800.dtsi deleted file mode 100644 index 25f8717a7..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-ax1800.dtsi +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - interrupt-parent = <&intc>; - qcom,msm-id = <0x1A5 0x0>; - - aliases { - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - ethernet2 = "/soc/dp3"; - - led-boot = &led_run; - led-failsafe = &led_run; - led-running = &led_run; - led-upgrade = &led_run; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " swiotlb=1 coherent_pool=2M"; - }; -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - switch_button { - pins = "gpio9"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - reset_button { - pins = "gpio18"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio74"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - white { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - blue { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - usb_pins: usb_pins { - usb_pwr { - pins = "gpio0"; - function = "gpio"; - bias-pull-up; - output-high; - }; - }; -}; - -&soc { - mdio0: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 74 GPIO_ACTIVE_HIGH>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - }; - - ess0: ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x0c>; /* lan port bitmap */ - switch_wan_bmp = <0x02>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_run: led@35 { - label = "white:sys"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - - led@37 { - label = "blue:wan"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - switch { - label = "switch"; - linux,code = ; - gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&usb3 { - pinctrl-0 = <&usb_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&q6_region { - reg = <0x0 0x4ab00000 0x0 0x05500000>; -}; - -&CPU0 { - operating-points = < - /* kHz uV (fixed) */ - 864000 1100000 - 1056000 1100000 - 1200000 1100000 - >; - clock-latency = <200000>; -}; - -&CPU1 { - operating-points = < - /* kHz uV (fixed) */ - 864000 1100000 - 1056000 1100000 - 1200000 1100000 - >; - clock-latency = <200000>; -}; - -&CPU2 { - operating-points = < - /* kHz uV (fixed) */ - 864000 1100000 - 1056000 1100000 - 1200000 1100000 - >; - clock-latency = <200000>; -}; - -&CPU3 { - operating-points = < - /* kHz uV (fixed) */ - 864000 1100000 - 1056000 1100000 - 1200000 1100000 - >; - clock-latency = <200000>; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-axt1800.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-axt1800.dts deleted file mode 100644 index 0e5de3f11..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-gl-axt1800.dts +++ /dev/null @@ -1,94 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-gl-ax1800.dtsi" - -/ { - model = "GL Technologies, Inc. AXT1800"; - compatible = "glinet,axt1800", "qcom,ipq6018-cp03", "qcom,ipq6018"; - - aliases { - sdhc0 = &sdhc_2; - }; -}; - -&tlmm { - sd_pins: sd_pins { - sd { - pins = "gpio62"; - function = "sd_card"; - bias-pull-up; - }; - ldo { - pins = "gpio66"; - function = "gpio"; - bias-pull-up; - }; - }; - - pwm_pins: pwm_pinmux { - pwm { - pins = "gpio30"; - function = "pwm13"; - drive-strength = <8>; - }; - }; - - fan_pins: fan_pins { - pwr { - pins = "gpio29"; - function = "gpio"; - bias-pull-up; - output-high; - }; - speed { - pins = "gpio31"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - pwm:pwm { - #pwm-cells = <2>; - pinctrl-0 = <&pwm_pins>; - pinctrl-names = "default"; - used-pwm-indices = <0>, <1>, <0>, <0>; - status = "ok"; - }; - - pwm-fan { - compatible = "pwm-fan"; - pinctrl-0 = <&fan_pins>; - pinctrl-names = "default"; - cooling-min-state = <0>; - cooling-max-state = <3>; - #cooling-cells = <2>; - pwms = <&pwm 1 255>; - cooling-levels = <0 150 200 255>; - }; -}; - -&sdhc_2 { - pinctrl-0 = <&sd_pins>; - pinctrl-names = "default"; - cd-gpios = <&tlmm 62 1>; - sd-ldo-gpios = <&tlmm 66 1>; - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x.dts deleted file mode 100644 index 685dfccf1..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x.dts +++ /dev/null @@ -1,155 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-cp01-hfcl.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" - -/ { - model = "HFCL ION4X"; - compatible = "hfcl,ion4x", "qcom,ipq6018-cp01", "qcom,ipq6018"; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - i2c_1_pins: i2c_1_pins { - mux { - pins = "gpio42", "gpio43"; - function = "blsp2_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_2_pins: i2c_2_pins { - mux { - pins = "gpio55", "gpio56"; - function = "blsp4_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&i2c_1 { - pinctrl-0 = <&i2c_1_pins>; - pinctrl-names = "default"; - status = "ok"; - - lm75@48 { - compatible = "lm75"; - reg = <0x48>; - status = "okay"; - }; -}; - -&i2c_2 { - pinctrl-0 = <&i2c_2_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&sdhc_2 { - pinctrl-0 = <&sd_pins>; - pinctrl-names = "default"; - cd-gpios = <&tlmm 62 1>; - sd-ldo-gpios = <&tlmm 66 0>; - vqmmc-supply = <&ipq6018_l2_corner>; - status = "ok"; -}; - -&soc { - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@60 { - label = "blue:wifi5"; - gpios = <&tlmm 60 GPIO_ACTIVE_LOW>; - linux,default-trigger = "led_5g"; - default-state = "off"; - }; - led@61 { - label = "blue:wifi2"; - gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; - linux,default-trigger = "led_2g"; - default-state = "off"; - }; - }; -}; - -&tlmm { - leds_pins: leds_pins { - led_5g { - pins = "gpio60"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio61"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x_2.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x_2.dts deleted file mode 100644 index 72bf7d0e2..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4x_2.dts +++ /dev/null @@ -1,155 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-cp01-hfcl.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" - -/ { - model = "HFCL ION4X_2"; - compatible = "hfcl,ion4x_2", "qcom,ipq6018-cp01", "qcom,ipq6018"; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - i2c_1_pins: i2c_1_pins { - mux { - pins = "gpio42", "gpio43"; - function = "blsp2_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_2_pins: i2c_2_pins { - mux { - pins = "gpio55", "gpio56"; - function = "blsp4_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&i2c_1 { - pinctrl-0 = <&i2c_1_pins>; - pinctrl-names = "default"; - status = "ok"; - - lm75@48 { - compatible = "lm75"; - reg = <0x48>; - status = "okay"; - }; -}; - -&i2c_2 { - pinctrl-0 = <&i2c_2_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&sdhc_2 { - pinctrl-0 = <&sd_pins>; - pinctrl-names = "default"; - cd-gpios = <&tlmm 62 1>; - sd-ldo-gpios = <&tlmm 66 0>; - vqmmc-supply = <&ipq6018_l2_corner>; - status = "ok"; -}; - -&soc { - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@60 { - label = "blue:wifi5"; - gpios = <&tlmm 60 GPIO_ACTIVE_LOW>; - linux,default-trigger = "led_5g"; - default-state = "off"; - }; - led@61 { - label = "blue:wifi2"; - gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; - linux,default-trigger = "led_2g"; - default-state = "off"; - }; - }; -}; - -&tlmm { - leds_pins: leds_pins { - led_5g { - pins = "gpio60"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio61"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xe.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xe.dts deleted file mode 100644 index a64ec25a8..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xe.dts +++ /dev/null @@ -1,155 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-cp01-hfcl.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" - -/ { - model = "HFCL ION4Xe"; - compatible = "hfcl,ion4xe", "qcom,ipq6018-cp01", "qcom,ipq6018"; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - i2c_1_pins: i2c_1_pins { - mux { - pins = "gpio42", "gpio43"; - function = "blsp2_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_2_pins: i2c_2_pins { - mux { - pins = "gpio55", "gpio56"; - function = "blsp4_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&i2c_1 { - pinctrl-0 = <&i2c_1_pins>; - pinctrl-names = "default"; - status = "ok"; - - lm75@48 { - compatible = "lm75"; - reg = <0x48>; - status = "okay"; - }; -}; - -&i2c_2 { - pinctrl-0 = <&i2c_2_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&sdhc_2 { - pinctrl-0 = <&sd_pins>; - pinctrl-names = "default"; - cd-gpios = <&tlmm 62 1>; - sd-ldo-gpios = <&tlmm 66 0>; - vqmmc-supply = <&ipq6018_l2_corner>; - status = "ok"; -}; - -&soc { - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@60 { - label = "blue:wifi5"; - gpios = <&tlmm 60 GPIO_ACTIVE_LOW>; - linux,default-trigger = "led_5g"; - default-state = "off"; - }; - led@61 { - label = "blue:wifi2"; - gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; - linux,default-trigger = "led_2g"; - default-state = "off"; - }; - }; -}; - -&tlmm { - leds_pins: leds_pins { - led_5g { - pins = "gpio60"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio61"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi.dts deleted file mode 100644 index 88b609f37..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi.dts +++ /dev/null @@ -1,156 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-cp01-hfcl.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" - -/ { - model = "HFCL ION4Xi"; - compatible = "hfcl,ion4xi", "qcom,ipq6018-cp01", "qcom,ipq6018"; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - i2c_1_pins: i2c_1_pins { - mux { - pins = "gpio42", "gpio43"; - function = "blsp2_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - i2c_2_pins: i2c_2_pins { - mux { - pins = "gpio55", "gpio56"; - function = "blsp4_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&i2c_1 { - pinctrl-0 = <&i2c_1_pins>; - pinctrl-names = "default"; - status = "ok"; - - lm75@48 { - compatible = "lm75"; - reg = <0x48>; - status = "okay"; - }; -}; - -&i2c_2 { - pinctrl-0 = <&i2c_2_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&sdhc_2 { - pinctrl-0 = <&sd_pins>; - pinctrl-names = "default"; - cd-gpios = <&tlmm 62 1>; - sd-ldo-gpios = <&tlmm 66 0>; - vqmmc-supply = <&ipq6018_l2_corner>; - status = "ok"; -}; - -&soc { - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@60 { - label = "blue:wifi5"; - gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; - linux,default-trigger = "led_5g"; - default-state = "off"; - }; - led@61 { - label = "blue:wifi2"; - gpios = <&tlmm 31 GPIO_ACTIVE_LOW>; - linux,default-trigger = "led_2g"; - default-state = "off"; - }; - }; -}; - -&tlmm { - leds_pins: leds_pins { - led_5g { - pins = "gpio32"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio31"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi_wp.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi_wp.dts deleted file mode 100755 index bb7d51798..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi_wp.dts +++ /dev/null @@ -1,102 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-hfcl-ion4xi_wp.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" - -/ { - model = "HFCL ION4Xi_WP"; - compatible = "hfcl,ion4xi_wp", "qcom,ipq6018-cp01", "qcom,ipq6018"; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - i2c_1_pins: i2c_1_pins { - mux { - pins = "gpio42", "gpio43"; - function = "blsp2_i2c"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&i2c_1 { - pinctrl-0 = <&i2c_1_pins>; - pinctrl-names = "default"; - status = "ok"; - - lm75@48 { - compatible = "lm75"; - reg = <0x48>; - status = "okay"; - }; -}; - -&sdhc_2 { - pinctrl-0 = <&sd_pins>; - pinctrl-names = "default"; - cd-gpios = <&tlmm 62 1>; - sd-ldo-gpios = <&tlmm 66 0>; - vqmmc-supply = <&ipq6018_l2_corner>; - status = "ok"; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi_wp.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi_wp.dtsi deleted file mode 100755 index 5f371bb90..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-hfcl-ion4xi_wp.dtsi +++ /dev/null @@ -1,535 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - compatible = "qcom,ipq6018-cp01", "qcom,ipq6018"; - interrupt-parent = <&intc>; - qcom,msm-id = <0x192 0x0>, <0x193 0x0>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - sdhc2 = &sdhc_2; - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - ethernet2 = "/soc/dp3"; - ethernet3 = "/soc/dp4"; - ethernet4 = "/soc/dp5"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; -#else - bootargs-append = " swiotlb=1 coherent_pool=2M"; -#endif - }; - -}; - -&tlmm { - pinctrl-0 = <&sd_ldo_pins>; - pinctrl-names = "default"; - - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_ldo_pins: sd_ldo_pins { - mux { - pins = "gpio66"; - function = "gpio"; - drive-strength = <2>; - bias-disable; - output-low; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_1_pins: spi_1_pins { - mux { - pins = "gpio69", "gpio71", "gpio72"; - function = "blsp1_spi"; - drive-strength = <8>; - bias-pull-down; - }; - spi_cs { - pins = "gpio70"; - function = "blsp1_spi"; - drive-strength = <8>; - bias-disable; - }; - quartz_interrupt { - pins = "gpio78"; - function = "gpio"; - input; - bias-disable; - }; - quartz_reset { - pins = "gpio79"; - function = "gpio"; - output-low; - bias-disable; - }; - - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_pins: sd_pins { - mux { - pins = "gpio62"; - function = "sd_card"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - extcon_usb_pins: extcon_usb_pins { - mux { - pins = "gpio26"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio53"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio77"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_5g { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_usb0 { - pins = "gpio50"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio71", "gpio72", "gpio69", "gpio70"; - function = "blsp1_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - - btcoex_pins: btcoex_pins { - mux_0 { - pins = "gpio51"; - function = "pta1_1"; - drive-strength = <6>; - bias-pull-down; - }; - mux_2 { - pins = "gpio52"; - function = "pta1_2"; - drive-strength = <6>; - bias-pull-down; - }; - }; -}; - -&soc { - extcon_usb: extcon_usb { - pinctrl-0 = <&extcon_usb_pins>; - pinctrl-names = "default"; - id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; - status = "ok"; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0 &tlmm 77 1>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <0x18>; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <24>; - phy-mode = "sgmii"; - }; - - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x18>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <0x18>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 53 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@35 { - label = "led_5g"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_5g"; - default-state = "off"; - }; - led@37 { - label = "led_2g"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led_2g"; - default-state = "off"; - }; - led@50 { - label = "led_usb0"; - gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "usb-host"; - default-state = "off"; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&hsuart_pins &btcoex_pins>; - pinctrl-names = "default"; - dmas = <&blsp_dma 2>, - <&blsp_dma 3>; - dma-names = "tx", "rx"; - status = "ok"; -}; - -&spi_1 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_1_pins>; - pinctrl-names = "default"; - cs-select = <0>; - quartz-reset-gpio = <&tlmm 79 1>; - status = "disabled"; - spidev1: spi@1 { - compatible = "qca,spidev"; - reg = <0>; - spi-max-frequency = <24000000>; - }; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&pcie_phy { - status = "disabled"; -}; - -&pcie0 { -#if defined(__CNSS2__) - status = "disabled"; -#endif -}; - -&qpic_lcd { - status = "ok"; -}; - -&qpic_lcd_panel { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-310ax-v1.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-310ax-v1.dts deleted file mode 100644 index 6fbd596b4..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-310ax-v1.dts +++ /dev/null @@ -1,379 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - model = "Indio UM-310AX V1"; - compatible = "indio,um-310ax-v1", "qcom,ipq6018-cp03", "qcom,ipq6018"; - - #address-cells = <0x2>; - #size-cells = <0x2>; - interrupt-parent = <&intc>; - - aliases { - /* Aliases as required by u-boot to patch MAC addresses */ - ethernet0 = "/soc/dp2"; - ethernet1 = "/soc/dp1"; - - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - led-boot = &led_system; - led-failsafe = &led_system; - led-running = &led_system; - led-upgrade = &led_system; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " swiotlb=1 coherent_pool=2M"; - }; - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - rst_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - modem_power_pins { - mux { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - output-high; - }; - }; - - leds_pins: leds_pins { - led_blue { - pins = "gpio35"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - - led_green { - pins = "gpio37"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - - led_red { - pins = "gpio32"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; -}; - -&soc { - mdio: mdio@90000 { - status = "ok"; - - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0>; - - ethernet-phy@0 { - reg = <0x03>; - }; - - ethernet-phy@1 { - reg = <0x04>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x01>; /* cpu port bitmap */ - switch_lan_bmp = <0x10>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0x80>; /*inner port bitmap*/ - switch_mac_mode = <0x00>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - - qcom,port_phyinfo { - port@3 { - port_id = <0x04>; - phy_address = <0x03>; - }; - - port@4 { - port_id = <0x05>; - phy_address = <0x04>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <0x04>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0x00>; - local-mac-address = [00 00 00 00 00 00]; - qcom,link-poll = <0x01>; - qcom,phy-mdio-addr = <0x03>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <0x05>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0x00>; - local-mac-address = [00 00 00 00 00 00]; - qcom,link-poll = <0x01>; - qcom,phy-mdio-addr = <0x04>; - phy-mode = "sgmii"; - }; - - gpio_keys { - compatible = "gpio-keys"; - - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_system: system { - label = "green:system"; - gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>; - }; - - wlan5g { - label = "red:wlan5g"; - gpio = <&tlmm 32 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&cpu0_opp_table { - compatible = "operating-points-v2"; - opp-shared; - - opp03 { - opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <3>; - clock-latency-ns = <200000>; - }; - - /delete-node/ opp04; - /delete-node/ opp05; - /delete-node/ opp06; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axm-v1.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axm-v1.dts deleted file mode 100644 index ef6764f67..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axm-v1.dts +++ /dev/null @@ -1,379 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - model = "Indio UM-510AXM V1"; - compatible = "indio,um-510axm-v1", "qcom,ipq6018-cp03", "qcom,ipq6018"; - - #address-cells = <0x2>; - #size-cells = <0x2>; - interrupt-parent = <&intc>; - - aliases { - /* Aliases as required by u-boot to patch MAC addresses */ - ethernet0 = "/soc/dp2"; - ethernet1 = "/soc/dp1"; - - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - led-boot = &led_system; - led-failsafe = &led_system; - led-running = &led_system; - led-upgrade = &led_system; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " swiotlb=1 coherent_pool=2M"; - }; - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - rst_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - modem_power_pins { - mux { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - output-high; - }; - }; - - leds_pins: leds_pins { - led_blue { - pins = "gpio35"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - - led_green { - pins = "gpio37"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - - led_red { - pins = "gpio32"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; -}; - -&soc { - mdio: mdio@90000 { - status = "ok"; - - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0>; - - ethernet-phy@0 { - reg = <0x03>; - }; - - ethernet-phy@1 { - reg = <0x04>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x01>; /* cpu port bitmap */ - switch_lan_bmp = <0x10>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0x80>; /*inner port bitmap*/ - switch_mac_mode = <0x00>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - - qcom,port_phyinfo { - port@3 { - port_id = <0x04>; - phy_address = <0x03>; - }; - - port@4 { - port_id = <0x05>; - phy_address = <0x04>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <0x04>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0x00>; - local-mac-address = [00 00 00 00 00 00]; - qcom,link-poll = <0x01>; - qcom,phy-mdio-addr = <0x03>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <0x05>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0x00>; - local-mac-address = [00 00 00 00 00 00]; - qcom,link-poll = <0x01>; - qcom,phy-mdio-addr = <0x04>; - phy-mode = "sgmii"; - }; - - gpio_keys { - compatible = "gpio-keys"; - - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_system: system { - label = "green:system"; - gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>; - }; - - wlan5g { - label = "red:wlan5g"; - gpio = <&tlmm 32 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&cpu0_opp_table { - compatible = "operating-points-v2"; - opp-shared; - - opp03 { - opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <3>; - clock-latency-ns = <200000>; - }; - - /delete-node/ opp04; - /delete-node/ opp05; - /delete-node/ opp06; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axp-v1.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axp-v1.dts deleted file mode 100644 index 03c688e6a..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-indio-um-510axp-v1.dts +++ /dev/null @@ -1,379 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - model = "Indio UM-510AXP V1"; - compatible = "indio,um-510axp-v1", "qcom,ipq6018-cp03", "qcom,ipq6018"; - - #address-cells = <0x2>; - #size-cells = <0x2>; - interrupt-parent = <&intc>; - - aliases { - /* Aliases as required by u-boot to patch MAC addresses */ - ethernet0 = "/soc/dp2"; - ethernet1 = "/soc/dp1"; - - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - led-boot = &led_system; - led-failsafe = &led_system; - led-running = &led_system; - led-upgrade = &led_system; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " swiotlb=1 coherent_pool=2M"; - }; - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - rst_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - modem_power_pins { - mux { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - output-high; - }; - }; - - leds_pins: leds_pins { - led_blue { - pins = "gpio35"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - - led_green { - pins = "gpio37"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - - led_red { - pins = "gpio32"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; -}; - -&soc { - mdio: mdio@90000 { - status = "ok"; - - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0>; - - ethernet-phy@0 { - reg = <0x03>; - }; - - ethernet-phy@1 { - reg = <0x04>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x01>; /* cpu port bitmap */ - switch_lan_bmp = <0x10>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0x80>; /*inner port bitmap*/ - switch_mac_mode = <0x00>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - - qcom,port_phyinfo { - port@3 { - port_id = <0x04>; - phy_address = <0x03>; - }; - - port@4 { - port_id = <0x05>; - phy_address = <0x04>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <0x04>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0x00>; - local-mac-address = [00 00 00 00 00 00]; - qcom,link-poll = <0x01>; - qcom,phy-mdio-addr = <0x03>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <0x05>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0x00>; - local-mac-address = [00 00 00 00 00 00]; - qcom,link-poll = <0x01>; - qcom,phy-mdio-addr = <0x04>; - phy-mode = "sgmii"; - }; - - gpio_keys { - compatible = "gpio-keys"; - - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_system: system { - label = "green:system"; - gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>; - }; - - wlan5g { - label = "red:wlan5g"; - gpio = <&tlmm 32 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&cpu0_opp_table { - compatible = "operating-points-v2"; - opp-shared; - - opp03 { - opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <3>; - clock-latency-ns = <200000>; - }; - - /delete-node/ opp04; - /delete-node/ opp05; - /delete-node/ opp06; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-ion.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-ion.dtsi deleted file mode 100644 index 0f637134e..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-ion.dtsi +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -/ { - reserved-memory { - #address-cells = <2>; - #size-cells = <2>; - ranges; - - adsp_mem: adsp_region { - compatible = "shared-dma-pool"; - alloc-ranges = <0 0x00000000 0 0xffffffff>; - reusable; - alignment = <0 0x400000>; - size = <0 0x800000>; - }; - }; -}; - -&soc { - ion: qcom,ion { - compatible = "qcom,msm-ion"; - #address-cells = <1>; - #size-cells = <0>; - - system_heap: qcom,ion-heap@25 { - reg = <25>; - qcom,ion-heap-type = "SYSTEM"; - }; - - qcom,ion-heap@22 { /* ADSP HEAP */ - reg = <22>; - memory-region = <&adsp_mem>; - qcom,ion-heap-type = "DMA"; - }; - }; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp01.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp01.dts deleted file mode 100644 index 09ce2a18c..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp01.dts +++ /dev/null @@ -1,23 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2022, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-meshpp-s618.dtsi" - -/ { - model = "MeshPlusPlus, Inc. S618 CP01"; - compatible = "meshpp,s618-cp01", "qcom,ipq6018-cp01", "qcom,ipq6018"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp03.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp03.dts deleted file mode 100644 index cee0b8ee1..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618-cp03.dts +++ /dev/null @@ -1,23 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2022, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-meshpp-s618.dtsi" - -/ { - model = "MeshPlusPlus, Inc. S618 CP01"; - compatible = "meshpp,s618-cp03", "qcom,ipq6018-cp03", "qcom,ipq6018"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618.dtsi deleted file mode 100644 index f8e01ba83..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-meshpp-s618.dtsi +++ /dev/null @@ -1,789 +0,0 @@ -/* - * Copyright (c) 2022, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - interrupt-parent = <&intc>; - qcom,msm-id = <0x1A5 0x0>; - - aliases { - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - ethernet2 = "/soc/dp3"; - ethernet3 = "/soc/dp4"; - ethernet4 = "/soc/dp5"; - - led-boot = &led_green; - led-running = &led_blue; - led-upgrade = &led_red; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - -#ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " console=ttyMSM0,115200n8 panic=10 ubi.mtd=nand root=mtd:ubi_rootfs rootfstype=squashfs swiotlb=1 rootwait"; -#else - bootargs-append = " console=ttyMSM0,115200n8 panic=10 ubi.mtd=nand root=mtd:ubi_rootfs rootfstype=squashfs swiotlb=1 coherent_pool=2M rootwait"; -#endif - }; - - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled only in default memory profile */ - reserved-memory { -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; -#endif - qcn9000_pcie0@50200000 { - no-map; - reg = <0x0 0x50200000 0x0 0x03700000>; - }; - - mhi_region0: dma_pool0@53900000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x53900000 0x0 0x01800000>; - }; - }; -}; - -&tlmm { - pinctrl-0 = <&sd_ldo_pins &generic_gpios &pcie_pins>; - pinctrl-names = "default"; - - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_ldo_pins: sd_ldo_pins { - mux { - pins = "gpio66"; - function = "gpio"; - drive-strength = <2>; - bias-disable; - output-low; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_1_pins: spi_1_pins { - mux { - pins = "gpio69", "gpio71", "gpio72"; - function = "blsp1_spi"; - drive-strength = <8>; - bias-pull-down; - }; - spi_cs { - pins = "gpio70"; - function = "blsp1_spi"; - drive-strength = <8>; - bias-disable; - }; - quartz_interrupt { - pins = "gpio78"; - function = "gpio"; - input; - bias-disable; - }; - quartz_reset { - pins = "gpio79"; - function = "gpio"; - output-low; - bias-disable; - }; - }; - - button_pins: button_pins { - switch_button { - pins = "gpio9"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - reset_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio77"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_5g { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - m2_1_regulator { - pins = "gpio29"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - m2_1_pwr_en { - pins = "gpio49"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - m2_1_reset_n { - pins = "gpio32"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_red: red { - pins = "gpio50"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_green: green { - pins = "gpio54"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_blue: blue { - pins = "gpio57"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_pins: sd_pins { - mux_1 { - pins = "gpio62"; - function = "sd_card"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_2 { - pins = "gpio23"; - function = "gpio"; - drive_strength = <8>; - bias-disable; - output-high; - }; - }; - - extcon_usb_pins: extcon_usb_pins { - mux { - pins = "gpio26"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - - generic_gpios: generic_gpios { - gpio42 { - pins = "gpio42"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - }; - - pcie_pins: pcie_pins { - pcie0_enable { - pins = "gpio34"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - }; - - i2c_2_pins: i2c_2_pins { - mux { - pins = "gpio55", "gpio56"; - function = "gpio"; - drive-strength = <16>; - bias-pull-up; - input-enable; - }; - - mux_2 { - pins = "gpio48"; - function = "gpio"; - drive_strength = <16>; - output-high; - }; - - mux_3 { - pins = "gpio73"; - function = "gpio"; - drive-stength = <16>; - output-low; - }; - }; -}; - -&soc { - extcon_usb: extcon_usb { - pinctrl-0 = <&extcon_usb_pins>; - pinctrl-names = "default"; - id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; - status = "ok"; - }; - - mdio0: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0 &tlmm 77 1>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <4>; - }; - }; - - ess0: ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <4>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@29 { - label = "m2_1_regulator"; - gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "none"; - default-state = "on"; - }; - - led@49 { - label = "m2_1_pwr_en"; - gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "none"; - default-state = "on"; - }; - - led@32 { - label = "m2_1_reset_n"; - gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; - linux,default-trigger = "none"; - default-state = "off"; - }; - - led@50 { - label = "red"; - gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "none"; - default-state = "on"; - }; - - led@54 { - label = "green"; - gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "none"; - default-state = "on"; - }; - - led@57 { - label = "blue"; - gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "none"; - default-state = "off"; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - switch { - label = "switch"; - linux,code = ; - gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - i2c_2: i2c@0 { /* i2c gpio */ - pinctrl-0 = <&i2c_2_pins>; - pinctrl-names = "default"; - compatible = "i2c-gpio"; - gpios = <&tlmm 56 0>, <&tlmm 55 0>; - i2c-gpio,scl-open-drain; - i2c-gpio,delay-us = <7>; - #address-cells = <1>; - #size-cells = <0>; - status = "ok"; - }; - - wifi3: wifi3@f00000 { - qcom,wlan-ramdump-dynamic = <0x400000>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; - #address-cells = <1>; - #size-cells = <0>; - qrtr_node_id = <0x20>; - qca,auto-restart; -#ifdef __IPQ_MEM_PROFILE_512_MB__ - - /* QCN9000 tgt-mem-mode=1 layout - 30MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | BASE | 0x4E400000 | 20MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4F800000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x4FA00000 | 8MB | - * +==================================+ - */ - - base-addr = <0x4E400000>; - m3-dump-addr = <0x4F800000>; - qcom,caldb-addr = <0x4FA00000>; -#else - - /* QCN9000 tgt-mem-mode=0 layout - 55MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | BASE | 0x50200000 | 45MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x52F00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x53100000 | 8MB | - * +==================================+ - */ - - base-addr = <0x50200000>; - m3-dump-addr = <0x52F00000>; - qcom,caldb-addr = <0x53100000>; -#endif - status = "ok"; - - mhi_channels { - mhi_chan@0 { - reg = <0>; - label = "LOOPBACK"; - mhi,num-elements = <32>; - mhi,event-ring = <1>; - mhi,chan-dir = <1>; - mhi,data-type = <0>; - mhi,doorbell-mode = <2>; - mhi,ee = <0x14>; - }; - - mhi_chan@1 { - reg = <1>; - label = "LOOPBACK"; - mhi,num-elements = <32>; - mhi,event-ring = <1>; - mhi,chan-dir = <2>; - mhi,data-type = <0>; - mhi,doorbell-mode = <2>; - mhi,ee = <0x14>; - }; - - mhi_chan@4 { - reg = <4>; - label = "DIAG"; - mhi,num-elements = <32>; - mhi,event-ring = <1>; - mhi,chan-dir = <1>; - mhi,data-type = <0>; - mhi,doorbell-mode = <2>; - mhi,ee = <0x14>; - }; - - mhi_chan@5 { - reg = <5>; - label = "DIAG"; - mhi,num-elements = <32>; - mhi,event-ring = <1>; - mhi,chan-dir = <2>; - mhi,data-type = <0>; - mhi,doorbell-mode = <2>; - mhi,ee = <0x14>; - }; - - mhi_chan@20 { - reg = <20>; - label = "IPCR"; - mhi,num-elements = <32>; - mhi,event-ring = <1>; - mhi,chan-dir = <1>; - mhi,data-type = <1>; - mhi,doorbell-mode = <2>; - mhi,ee = <0x14>; - mhi,auto-start; - }; - - mhi_chan@21 { - reg = <21>; - label = "IPCR"; - mhi,num-elements = <32>; - mhi,event-ring = <1>; - mhi,chan-dir = <2>; - mhi,data-type = <0>; - mhi,doorbell-mode = <2>; - mhi,ee = <0x14>; - mhi,auto-queue; - mhi,auto-start; - }; - }; - - mhi_events { - mhi_event@0 { - mhi,num-elements = <32>; - mhi,intmod = <1>; - mhi,msi = <1>; - mhi,priority = <1>; - mhi,brstmode = <2>; - mhi,data-type = <1>; - }; - - mhi_event@1 { - mhi,num-elements = <256>; - mhi,intmod = <1>; - mhi,msi = <2>; - mhi,priority = <1>; - mhi,brstmode = <2>; - }; - }; - - mhi_devices { - mhi_qrtr { - mhi,chan = "IPCR"; - qcom,net-id = <0>; - }; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_bam { - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&CPU0 { - operating-points = < - /* kHz uV (fixed) */ - 864000 1100000 - 1056000 1100000 - 1200000 1100000 - 1608000 1100000 - >; - clock-latency = <200000>; -}; - -&CPU1 { - operating-points = < - /* kHz uV (fixed) */ - 864000 1100000 - 1056000 1100000 - 1200000 1100000 - 1608000 1100000 - >; - clock-latency = <200000>; -}; - -&CPU2 { - operating-points = < - /* kHz uV (fixed) */ - 864000 1100000 - 1056000 1100000 - 1200000 1100000 - 1608000 1100000 - >; - clock-latency = <200000>; -}; - -&CPU3 { - operating-points = < - /* kHz uV (fixed) */ - 864000 1100000 - 1056000 1100000 - 1200000 1100000 - 1608000 1100000 - >; - clock-latency = <200000>; -}; - -&wifi0 { - qcom,board_id = <0x10>; - status = "ok"; -}; - -&pcie0 { - status = "ok"; - - pcie0_rp { - reg = <0 0 0 0 0>; - status = "ok"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x20>; - qcom,board_id = <0xa4>; -#if !defined(__IPQ_MEM_PROFILE_256_MB__) - memory-region = <&mhi_region0>; -#endif - }; - }; -}; - -&pcie_phy { - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v1.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v1.dts deleted file mode 100644 index eb3e45b99..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v1.dts +++ /dev/null @@ -1,23 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-pax1800.dtsi" - -/ { - model = "Plasma Cloud PAX1800 v1"; - compatible = "plasmacloud,pax1800-v1", "qcom,ipq6018-cp03", "qcom,ipq6018"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v2.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v2.dts deleted file mode 100644 index 53e6b3999..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800-v2.dts +++ /dev/null @@ -1,23 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018-pax1800.dtsi" - -/ { - model = "Plasma Cloud PAX1800 v2"; - compatible = "plasmacloud,pax1800-v2", "qcom,ipq6018-cp03", "qcom,ipq6018"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800.dtsi deleted file mode 100644 index e540e0f2c..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-pax1800.dtsi +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - - interrupt-parent = <&intc>; - qcom,msm-id = <0x1A5 0x0>; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " swiotlb=1 coherent_pool=2M"; - }; - - aliases { - serial0 = &blsp1_uart3; - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - - led-boot = &led_status_green; - led-failsafe = &led_status_green; - led-running = &led_status_green; - led-upgrade = &led_status_green; - led-uplink = &led_status_blue; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 24 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - status_red { - label = "red:status"; - gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "default-off"; - }; - - led_status_green: status_green { - label = "green:status"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - }; - - led_status_blue: status_blue { - label = "blue:status"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "default-off"; - }; - }; - - watchdog { - compatible = "linux,wdt-gpio"; - pinctrl-0 = <&watchdog_pins>; - pinctrl-names = "default"; - gpios = <&tlmm 67 GPIO_ACTIVE_LOW>; - hw_algo = "toggle"; - hw_margin_ms = <2000>; - always-running; - }; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio24"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: led_pinmux { - led_power_green { - pins = "gpio25"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_power_blue { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_power_red { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - watchdog_pins: watchdog_pinmux { - mux { - pins = "gpio67"; - function = "gpio"; - bias-none; - output-low; - }; - }; -}; - -&soc { - mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <3>; - }; - phy1: ethernet-phy@1 { - reg = <4>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x08>; /* lan port bitmap */ - switch_wan_bmp = <0x10>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@3 { - port_id = <3>; - phy_address = <4>; - }; - port@4 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&qpic_bam { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif - -&wifi0 { - status = "okay"; - qcom,ath11k-calibration-variant = "PlasmaCloud-PAX1800"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-wallys-dr6018-v4.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-wallys-dr6018-v4.dts deleted file mode 100644 index c37afeeeb..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-wallys-dr6018-v4.dts +++ /dev/null @@ -1,548 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Wallys DR6018 V4"; - compatible = "wallys,dr6018-v4", "qcom,ipq6018-cp01", "qcom,ipq6018"; - interrupt-parent = <&intc>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - ethernet2 = "/soc/dp3"; - ethernet3 = "/soc/dp4"; - ethernet4 = "/soc/dp5"; - - sdhc2 = "/soc/sdhci_sd@7804000"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " console=ttyMSM0,115200,n8 swiotlb=1 coherent_pool=2M"; - }; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled only in default memory profile */ - reserved-memory { -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; -#endif - qcn9000_pcie0@50200000 { - no-map; - reg = <0x0 0x50200000 0x0 0x02D00000>; - }; - - mhi_region0: dma_pool0@52f00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x52F00000 0x0 0x01800000>; - }; - }; -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - sd_pins: sd_pins { - mux { - pins = "gpio62"; - function = "sd_card"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - extcon_usb_pins: extcon_usb_pins { - mux { - pins = "gpio26"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_pwr { - pins = "gpio74"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_5g { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - uart2_pins: uart2_pins { - mux { - pins = "gpio57", "gpio58"; - function = "blsp4_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - extcon_usb: extcon_usb { - pinctrl-0 = <&extcon_usb_pins>; - pinctrl-names = "default"; - id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; - status = "ok"; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0 &tlmm 77 1>; - status = "ok"; - ethernet-phy@3 { - reg = <0x03>; - }; - - ethernet-phy@4 { - reg = <0x18>; - }; - - ethernet-phy@1 { - reg = <0x01>; - }; - - ethernet-phy@2 { - reg = <0x02>; - }; - - ethernet-phy@0 { - reg = <0x00>; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0x18>; - phy-mode = "sgmii"; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3c>; /* lan port bitmap */ - switch_wan_bmp = <0x2>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@1 { - phy_address = <0x01>; - port_id = <0x02>; - }; - - port@0 { - phy_address = <0x00>; - port_id = <0x01>; - }; - - port@2 { - phy_address = <0x02>; - port_id = <0x03>; - }; - - port@3 { - phy_address = <0x03>; - port_id = <0x04>; - }; - - port@4 { - phy_address = <0x18>; - port_id = <0x05>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@25 { - label = "green:wifi5"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:5g"; - default-state = "off"; - }; - led@24 { - label = "green:wifi2"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:2g"; - default-state = "off"; - }; - led_power: led@16 { - label = "green:led_pwr"; - gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:power"; - default-state = "off"; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&uart2_pins>; - pinctrl-names = "default"; - dmas = <&blsp_dma 2>, - <&blsp_dma 3>; - dma-names = "tx", "rx"; - status = "ok"; -}; -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&sdhc_2 { - pinctrl-0 = <&sd_pins>; - pinctrl-names = "default"; - cd-gpios = <&tlmm 62 1>; - sd-ldo-gpios = <&tlmm 66 0>; - //vqmmc-supply = <&ipq6018_l2_corner>; - status = "ok"; -}; - -&wifi1 { - base-addr = <0x50200000>; - m3-dump-addr = <0x52500000>; - etr-addr = <0x52600000>; - caldb-addr = <0x52700000>; - hremote-size = <0x2300000>; - tgt-mem-mode = <0x0>; - board_id = <0xa4>; - caldb-size = <0x800000>; - status = "ok"; -}; - -&pcie0 { - status = "ok"; - interrupts = <0 52 0>, <0 416 0>, <0 417 0>, - <0 418 0>, <0 419 0>, <0 420 0>, - <0 421 0>, <0 422 0>, <0 423 0>, - <0 424 0>, <0 425 0>, <0 426 0>, - <0 427 0>, <0 428 0>, <0 429 0>, - <0 430 0>, <0 431 0>; - - interrupt-names = "msi", "msi_0", "msi_1", - "msi_2", "msi_3", "msi_4", - "msi_5", "msi_6", "msi_7", - "msi_8", "msi_9", "msi_10", - "msi_11", "msi_12", "msi_13", - "msi_14", "msi_15"; - - qcom,msi-gicm-addr = <0x0B00A040>; - qcom,msi-gicm-base = <0x1c0>; -}; - -&pcie0_rp { - status = "ok"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x20>; - memory-region = <&mhi_region0>; - }; -}; - -&pcie_phy { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-wallys-dr6018.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-wallys-dr6018.dts deleted file mode 100644 index 12065b62f..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-wallys-dr6018.dts +++ /dev/null @@ -1,441 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Wallys DR6018"; - compatible = "wallys,dr6018", "qcom,ipq6018-cp01", "qcom,ipq6018"; - interrupt-parent = <&intc>; - - aliases { - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " console=ttyMSM0,115200,n8 swiotlb=1 coherent_pool=2M"; - }; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - extcon_usb_pins: extcon_usb_pins { - mux { - pins = "gpio26"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_pwr { - pins = "gpio74"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_5g { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led_2g { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - uart2_pins: uart2_pins { - mux { - pins = "gpio57", "gpio58"; - function = "blsp4_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - extcon_usb: extcon_usb { - pinctrl-0 = <&extcon_usb_pins>; - pinctrl-names = "default"; - id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; - status = "ok"; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0 &tlmm 77 1>; - status = "ok"; - ethernet-phy@3 { - reg = <0x03>; - }; - - ethernet-phy@4 { - reg = <0x18>; - }; - - ethernet-phy@1 { - reg = <0x01>; - }; - - ethernet-phy@2 { - reg = <0x02>; - }; - - ethernet-phy@0 { - reg = <0x00>; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x4>; /* lan port bitmap */ - switch_wan_bmp = <0x2>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@1 { - phy_address = <0x01>; - port_id = <0x02>; - }; - - port@0 { - phy_address = <0x00>; - port_id = <0x01>; - }; - - port@2 { - phy_address = <0x02>; - port_id = <0x03>; - }; - - port@3 { - phy_address = <0x03>; - port_id = <0x04>; - }; - - port@4 { - phy_address = <0x18>; - port_id = <0x05>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - - /* wps { - label = "wps"; - linux,code = <>; - gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - };*/ - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@25 { - label = "green:wifi5"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:5g"; - default-state = "off"; - }; - led@24 { - label = "green:wifi2"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:2g"; - default-state = "off"; - }; - led_power: led@16 { - label = "green:led_pwr"; - gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "green:power"; - default-state = "off"; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&blsp1_uart2 { - pinctrl-0 = <&uart2_pins>; - pinctrl-names = "default"; - dmas = <&blsp_dma 2>, - <&blsp_dma 3>; - dma-names = "tx", "rx"; - status = "ok"; -}; -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-yuncore-ax840.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-yuncore-ax840.dts deleted file mode 100644 index 1e851708c..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-yuncore-ax840.dts +++ /dev/null @@ -1,379 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - model = "YunCore AX840"; - compatible = "yuncore,ax840", "qcom,ipq6018-cp03", "qcom,ipq6018"; - - #address-cells = <0x2>; - #size-cells = <0x2>; - interrupt-parent = <&intc>; - - aliases { - /* Aliases as required by u-boot to patch MAC addresses */ - ethernet0 = "/soc/dp2"; - ethernet1 = "/soc/dp1"; - - serial0 = &blsp1_uart3; - serial1 = &blsp1_uart2; - - led-boot = &led_system; - led-failsafe = &led_system; - led-running = &led_system; - led-upgrade = &led_system; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; - bootargs-append = " swiotlb=1 coherent_pool=2M"; - }; - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - rst_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - modem_power_pins { - mux { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - output-high; - }; - }; - - leds_pins: leds_pins { - led_blue { - pins = "gpio35"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - - led_green { - pins = "gpio37"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - - led_red { - pins = "gpio32"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; -}; - -&soc { - mdio: mdio@90000 { - status = "ok"; - - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0>; - - ethernet-phy@0 { - reg = <0x03>; - }; - - ethernet-phy@1 { - reg = <0x04>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x01>; /* cpu port bitmap */ - switch_lan_bmp = <0x10>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0x80>; /*inner port bitmap*/ - switch_mac_mode = <0x00>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - - qcom,port_phyinfo { - port@3 { - port_id = <0x04>; - phy_address = <0x03>; - }; - - port@4 { - port_id = <0x05>; - phy_address = <0x04>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <0x04>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0x00>; - local-mac-address = [00 00 00 00 00 00]; - qcom,link-poll = <0x01>; - qcom,phy-mdio-addr = <0x03>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <0x05>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0x00>; - local-mac-address = [00 00 00 00 00 00]; - qcom,link-poll = <0x01>; - qcom,phy-mdio-addr = <0x04>; - phy-mode = "sgmii"; - }; - - gpio_keys { - compatible = "gpio-keys"; - - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_system: system { - label = "green:system"; - gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>; - }; - - wlan5g { - label = "red:wlan5g"; - gpio = <&tlmm 32 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -&cpu0_opp_table { - compatible = "operating-points-v2"; - opp-shared; - - opp03 { - opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <3>; - clock-latency-ns = <200000>; - }; - - /delete-node/ opp04; - /delete-node/ opp05; - /delete-node/ opp06; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb2 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-yuncore-fap650.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-yuncore-fap650.dts deleted file mode 100755 index ad53ca472..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-yuncore-fap650.dts +++ /dev/null @@ -1,423 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "qcom-ipq6018.dtsi" -#include "qcom-ipq6018-rpm-regulator.dtsi" -#include "qcom-ipq6018-cpr-regulator.dtsi" -#include "qcom-ipq6018-cp-cpu.dtsi" -#include -#include - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Yuncore FAP650"; - compatible = "yuncore,fap650", "qcom,ipq6018-cp03", "qcom,ipq6018"; - interrupt-parent = <&intc>; - qcom,msm-id = <0x1A5 0x0>; - - aliases { - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp5"; - ethernet1 = "/soc/dp4"; - ethernet2 = "/soc/dp3"; - ethernet3 = "/soc/dp2"; - ethernet4 = "/soc/dp1"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; -#ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; -#else - bootargs-append = " swiotlb=1 coherent_pool=2M"; -#endif - }; - - /* - * +=========+==============+========================+ - * | | | | - * | Region | Start Offset | Size | - * | | | | - * +--------+--------------+-------------------------+ - * | | | | - * | | | | - * | | | | - * | | | | - * | Linux | 0x41000000 | 139MB | - * | | | | - * | | | | - * | | | | - * +--------+--------------+-------------------------+ - * | TZ App | 0x49B00000 | 6MB | - * +--------+--------------+-------------------------+ - * - * From the available 145 MB for Linux in the first 256 MB, - * we are reserving 6 MB for TZAPP. - * - * Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi - * for memory layout. - */ - -/* TZAPP is enabled only in default memory profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) - reserved-memory { - tzapp:tzapp@49B00000 { /* TZAPPS */ - no-map; - reg = <0x0 0x49B00000 0x0 0x00600000>; - }; - }; -#endif -}; - -&tlmm { - uart_pins: uart_pins { - mux { - pins = "gpio44", "gpio45"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-pull-down; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-pull-down; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-pull-down; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-pull-down; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-pull-down; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-pull-down; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-pull-down; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-pull-down; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio19"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio64"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio65"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio75"; - function = "gpio"; - bias-pull-up; - }; - }; - - leds_pins: leds_pins { - led_sys { - pins = "gpio32"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_5g { - pins = "gpio35"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_2g { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 75 0>; - status = "ok"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <4>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* wan port bitmap */ - switch_inner_bmp = <0xc0>; /*inner port bitmap*/ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - qcom,port_phyinfo { - port@3 { - port_id = <3>; - phy_address = <4>; - }; - port@4 { - port_id = <4>; - phy_address = <3>; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led_power: led@32 { - label = "green:power"; - gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - - led@35 { - label = "green:wifi5"; - gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led@37 { - label = "green:wifi2"; - gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - wps { - label = "reset"; - linux,code = ; - gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; -}; - -&blsp1_uart3 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&usb3 { - status = "ok"; -}; - -&nss_crypto { - status = "ok"; -}; - -/* TZAPP is enabled in default memory profile only */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) -&qseecom { - mem-start = <0x49B00000>; - mem-size = <0x600000>; - status = "ok"; -}; -#endif diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-audio.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-audio.dtsi deleted file mode 100644 index 7601e169b..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-audio.dtsi +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include -#include - - -&soc { - adss_clk: qcom,adss_clk@7700000 { - compatible = "qcom,adss-ipq807x"; - reg = <0x7700100 0x200>; - #clock-cells = <0x1>; - }; - - audio: audio@7700000 { - compatible = "qca,ipq8074-audio-adss"; - reg = <0x7700000 0x34>; - resets = <&gcc GCC_ADSS_BCR>; - reset-names = "blk_rst"; - }; -}; - -&clocks { - audio_rxbpad_clk { - compatible = "fixed-clock"; - clock-frequency = <254>; - #clock-cells = <0>; - }; - - audio_txbpad_clk { - compatible = "fixed-clock"; - clock-frequency = <254>; - #clock-cells = <0>; - }; - - audio_rxmpad_clk { - compatible = "fixed-clock"; - clock-frequency = <252>; - #clock-cells = <0>; - }; - - audio_txmpad_clk { - compatible = "fixed-clock"; - clock-frequency = <252>; - #clock-cells = <0>; - }; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap102.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap102.dts deleted file mode 100644 index d83316b0f..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap102.dts +++ /dev/null @@ -1,930 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "qcom-ipq807x-soc.dtsi" -#include "qcom-ipq807x-ac-cpu.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Edgecore EAP102"; - compatible = "edgecore,eap102", "qcom,ipq807x-ac02", "qcom,ipq807x"; - qcom,msm-id = <0x178 0x0>; - interrupt-parent = <&intc>; - qcom,board-id = <0x8 0x0>; - qcom,pmic-id = <0x0 0x0 0x0 0x0>; - - aliases { - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet1 = "/soc/dp5"; - ethernet0 = "/soc/dp6"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 root=/dev/ram0 rw \ - init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - }; - - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - mcu-enable { - gpio-export,name = "mcu-enable"; - gpio-export,output = <0>; - gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; - }; - - usb-hub-enable { - gpio-export,name = "usb-hub-enable"; - gpio-export,output = <1>; - gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; - }; - - usb-rear-power { - gpio-export,name = "usb-rear-power"; - gpio-export,output = <1>; - gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; - }; - - usb-side-power { - gpio-export,name = "usb-side-power"; - gpio-export,output = <1>; - gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&tlmm { - pinctrl-0 = <&mcu_rst &mcu_rsv &usb_rear_pwr &usb_side_pwr &usb_hub_rst>; - pinctrl-names = "default"; - - mcu_rst: mcu_rst_pins { - pins = "gpio54"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-low; - }; - - mcu_rsv: mcu_rsv_pins { - pins = "gpio56"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - - usb_rear_pwr: usb_rear_pwr_pins { - pins = "gpio29"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - - usb_side_pwr: usb_side_pwr_pins { - pins = "gpio30"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - - usb_hub_rst: usb_hub_rst_pins { - pins = "gpio55"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio68"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio69"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio33"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio44"; - function = "gpio"; - bias-pull-up; - }; - }; - - uart_pins: uart_pins { - mux { - pins = "gpio23", "gpio24"; - function = "blsp4_uart1"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-disable; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-disable; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-disable; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-disable; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-disable; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-disable; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-disable; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-disable; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-disable; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio66"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - led_pins: led_pins { - led_pwr { - pins = "gpio46"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_2g { - pins = "gpio47"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_5g { - pins = "gpio48"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_bt { - pins = "gpio50"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset_button"; - linux,code = ; - gpios = <&tlmm 66 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 37 0 &tlmm 25 1 &tlmm 44 1>; - compatible = "qcom,ipq40xx-mdio", "qcom,qca-mdio"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <24>; - }; - phy5: ethernet-phy@5 { - reg = <28>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <24>; - port_mac_sel = "QGMAC_PORT"; - }; - port@5 { - port_id = <6>; - phy_address = <28>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - port_scheduler_resource { - port@0 { - port_id = <0>; - ucast_queue = <0 143>; - mcast_queue = <256 271>; - l0sp = <0 35>; - l0cdrr = <0 47>; - l0edrr = <0 47>; - l1cdrr = <0 7>; - l1edrr = <0 7>; - }; - port@1 { - port_id = <1>; - ucast_queue = <144 159>; - mcast_queue = <272 275>; - l0sp = <36 39>; - l0cdrr = <48 63>; - l0edrr = <48 63>; - l1cdrr = <8 11>; - l1edrr = <8 11>; - }; - port@2 { - port_id = <2>; - ucast_queue = <160 175>; - mcast_queue = <276 279>; - l0sp = <40 43>; - l0cdrr = <64 79>; - l0edrr = <64 79>; - l1cdrr = <12 15>; - l1edrr = <12 15>; - }; - port@3 { - port_id = <3>; - ucast_queue = <176 191>; - mcast_queue = <280 283>; - l0sp = <44 47>; - l0cdrr = <80 95>; - l0edrr = <80 95>; - l1cdrr = <16 19>; - l1edrr = <16 19>; - }; - port@4 { - port_id = <4>; - ucast_queue = <192 207>; - mcast_queue = <284 287>; - l0sp = <48 51>; - l0cdrr = <96 111>; - l0edrr = <96 111>; - l1cdrr = <20 23>; - l1edrr = <20 23>; - }; - port@5 { - port_id = <5>; - ucast_queue = <208 223>; - mcast_queue = <288 291>; - l0sp = <52 55>; - l0cdrr = <112 127>; - l0edrr = <112 127>; - l1cdrr = <24 27>; - l1edrr = <24 27>; - }; - port@6 { - port_id = <6>; - ucast_queue = <224 239>; - mcast_queue = <292 295>; - l0sp = <56 59>; - l0cdrr = <128 143>; - l0edrr = <128 143>; - l1cdrr = <28 31>; - l1edrr = <28 31>; - }; - port@7 { - port_id = <7>; - ucast_queue = <240 255>; - mcast_queue = <296 299>; - l0sp = <60 63>; - l0cdrr = <144 159>; - l0edrr = <144 159>; - l1cdrr = <32 35>; - l1edrr = <32 35>; - }; - }; - port_scheduler_config { - port@0 { - port_id = <0>; - l1scheduler { - group@0 { - sp = <0 1>; /*L0 SPs*/ - /*cpri cdrr epri edrr*/ - cfg = <0 0 0 0>; - }; - }; - l0scheduler { - group@0 { - /*unicast queues*/ - ucast_queue = <0 4 8>; - /*multicast queues*/ - mcast_queue = <256 260>; - /*sp cpri cdrr epri edrr*/ - cfg = <0 0 0 0 0>; - }; - group@1 { - ucast_queue = <1 5 9>; - mcast_queue = <257 261>; - cfg = <0 1 1 1 1>; - }; - group@2 { - ucast_queue = <2 6 10>; - mcast_queue = <258 262>; - cfg = <0 2 2 2 2>; - }; - group@3 { - ucast_queue = <3 7 11>; - mcast_queue = <259 263>; - cfg = <0 3 3 3 3>; - }; - }; - }; - port@1 { - port_id = <1>; - l1scheduler { - group@0 { - sp = <36>; - cfg = <0 8 0 8>; - }; - group@1 { - sp = <37>; - cfg = <1 9 1 9>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <144>; - ucast_loop_pri = <16>; - mcast_queue = <272>; - mcast_loop_pri = <4>; - cfg = <36 0 48 0 48>; - }; - }; - }; - port@2 { - port_id = <2>; - l1scheduler { - group@0 { - sp = <40>; - cfg = <0 12 0 12>; - }; - group@1 { - sp = <41>; - cfg = <1 13 1 13>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <160>; - ucast_loop_pri = <16>; - mcast_queue = <276>; - mcast_loop_pri = <4>; - cfg = <40 0 64 0 64>; - }; - }; - }; - port@3 { - port_id = <3>; - l1scheduler { - group@0 { - sp = <44>; - cfg = <0 16 0 16>; - }; - group@1 { - sp = <45>; - cfg = <1 17 1 17>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <176>; - ucast_loop_pri = <16>; - mcast_queue = <280>; - mcast_loop_pri = <4>; - cfg = <44 0 80 0 80>; - }; - }; - }; - port@4 { - port_id = <4>; - l1scheduler { - group@0 { - sp = <48>; - cfg = <0 20 0 20>; - }; - group@1 { - sp = <49>; - cfg = <1 21 1 21>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <192>; - ucast_loop_pri = <16>; - mcast_queue = <284>; - mcast_loop_pri = <4>; - cfg = <48 0 96 0 96>; - }; - }; - }; - port@5 { - port_id = <5>; - l1scheduler { - group@0 { - sp = <52>; - cfg = <0 24 0 24>; - }; - group@1 { - sp = <53>; - cfg = <1 25 1 25>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <208>; - ucast_loop_pri = <16>; - mcast_queue = <288>; - mcast_loop_pri = <4>; - cfg = <52 0 112 0 112>; - }; - }; - }; - port@6 { - port_id = <6>; - l1scheduler { - group@0 { - sp = <56>; - cfg = <0 28 0 28>; - }; - group@1 { - sp = <57>; - cfg = <1 29 1 29>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <224>; - ucast_loop_pri = <16>; - mcast_queue = <292>; - mcast_loop_pri = <4>; - cfg = <56 0 128 0 128>; - }; - }; - }; - port@7 { - port_id = <7>; - l1scheduler { - group@0 { - sp = <60>; - cfg = <0 32 0 32>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <240>; - mcast_queue = <296>; - cfg = <60 0 144 0 144>; - }; - }; - }; - }; - }; -/* - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; -*/ - dp6 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <6>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001a00 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <24>; - phy-mode = "sgmii"; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_pwr { - label = "green:wan"; - gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; - default-state = "off"; - linux,default-trigger = "led_pwr"; - }; - - led_2g { - label = "green:wifi2"; - gpio = <&tlmm 47 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_5g { - label = "green:wifi5"; - gpio = <&tlmm 48 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_power: led_bt { - gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; - label = "green:power"; - default-state = "on"; - linux,default-trigger = "led_bt"; - }; - }; - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x18>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; -}; - -&serial_blsp4 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&nss0 { - qcom,low-frequency = <187200000>; - qcom,mid-frequency = <748800000>; - qcom,max-frequency = <1497600000>; -}; - -&msm_imem { - status = "disabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&ssphy_1 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb3_0 { - status = "ok"; -}; - -&usb3_1 { - status = "ok"; -}; - -&cryptobam { - status = "ok"; -}; - -&crypto { - status = "ok"; -}; - -&i2c_0 { - status = "disabled"; -}; - -&i2c_1 { - status = "disabled"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_lcd { - status = "disabled"; -}; - -&qpic_lcd_panel { - status = "disabled"; -}; - -&ledc { - status = "disabled"; -}; - -&pcie0 { - status = "disabled"; -}; - -&pcie1 { - status = "disabled"; -}; - -&glink_rpm { - status = "disabled"; -}; - -&apc_cpr { - /* Same CPR configuration as OAK */ - compatible = "qcom,cpr4-ipq817x-apss-regulator"; - - thread@0 { - apc_vreg: regulator { - regulator-min-microvolt = <1>; - regulator-max-microvolt = <2>; - qcom,cpr-fuse-corners = <2>; - qcom,cpr-corners = <3>; - qcom,cpr-speed-bin-corners = <3>; - qcom,cpr-corner-fmax-map = <1 3>; - - qcom,cpr-voltage-ceiling = - <840000 904000 944000>; - qcom,cpr-voltage-floor = - <592000 648000 712000>; - qcom,corner-frequencies = - <1017600000 1382400000 1382400000>; - - qcom,cpr-open-loop-voltage-fuse-adjustment-0 = - /* Speed bin 0; CPR rev 0..7 */ - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>; - - qcom,cpr-open-loop-voltage-fuse-adjustment-1 = - /* Speed bin 0; CPR rev 0..7 */ - < 0 0>, - < 0 0>, - < 0 0>, - < 20000 26000>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>; - - qcom,cpr-open-loop-voltage-fuse-adjustment-v2-0 = - /* Speed bin 0; CPR rev 0..7 */ - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>; - - qcom,cpr-open-loop-voltage-fuse-adjustment-v2-1 = - /* Speed bin 0; CPR rev 0..7 */ - < 0 0>, - < 0 7000>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>; - - qcom,cpr-floor-to-ceiling-max-range = - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>; - }; - }; -}; - -&npu_cpr { - status = "disabled"; -}; - -&nss0 { - npu-supply = <&dummy_reg>; - mx-supply = <&dummy_reg>; -}; - -&wifi0 { - qcom,board_id = <0x92>; -}; - -&wifi1 { - qcom,board_id = <0x292>; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap106.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap106.dts deleted file mode 100644 index d733513c3..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-eap106.dts +++ /dev/null @@ -1,716 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "qcom-ipq807x-soc.dtsi" -#include "qcom-ipq807x-hk-cpu.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Edgecore EAP106"; - compatible = "edgecore,eap106", "qcom,ipq807x-hk02", "qcom,ipq807x"; - qcom,msm-id = <0x143 0x0>; - interrupt-parent = <&intc>; - qcom,board-id = <0x8 0x0>; - qcom,pmic-id = <0x0 0x0 0x0 0x0>; - - aliases { - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - chosen { - bootargs = "console=ttyMSM0,115200,n8 root=/dev/ram0 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - }; -}; - -&tlmm { - leds_pins: leds_pinmux { - - led1_yellow { - pins = "gpio25"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led1_green { - pins = "gpio28"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led2_amber { - pins = "gpio29"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led2_blue { - pins = "gpio32"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio68"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio69"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - uart_pins: uart_pins { - mux { - pins = "gpio23", "gpio24"; - function = "blsp4_uart1"; - drive-strength = <8>; - bias-disable; - }; - }; - - i2c_0_pins: i2c_0_pinmux { - mux { - pins = "gpio42", "gpio43"; - function = "blsp1_i2c"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-disable; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-disable; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-disable; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-disable; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-disable; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-disable; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-disable; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-disable; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-disable; - }; - data_8 { - pins = "gpio16"; - function = "qpic_pad8"; - drive-strength = <8>; - bias-disable; - }; - qpic_pad { - pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", - "gpio9", "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-disable; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio46", "gpio47", "gpio48", "gpio49"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-disable; - output-low; - }; - mux_1 { - pins = "gpio51"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio57"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - uniphy_pins: uniphy_pinmux { - mux { - pins = "gpio60"; - function = "rx2"; - bias-disable; - }; - }; - cnss_wlan_en_active: cnss_wlan_en_active { - mux { - pins = "gpio57"; - function = "gpio"; - drive-strength = <16>; - output-high; - bias-pull-up; - }; - }; - - cnss_wlan_en_sleep: cnss_wlan_en_sleep { - mux { - pins = "gpio57"; - function = "gpio"; - drive-strength = <2>; - output-low; - bias-pull-down; - }; - }; -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "wps"; - linux,code = ; - gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - - led@25 { - label = "led1_yellow"; - gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led1_yellow"; - default-state = "off"; - }; - - led@28 { - label = "led1_green"; - gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led1_green"; - default-state = "off"; - }; - - led@29 { - label = "led2_amber"; - gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led2_amber"; - default-state = "off"; - }; - - led@32 { - label = "led2_blue"; - gpio = <&tlmm 32 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led2_blue"; - default-state = "off"; - }; - }; - - mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 37 0>; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <4>; - }; - phy5: ethernet-phy@5 { - compatible ="ethernet-phy-ieee802.3-c45"; - reg = <8>; - }; - }; - - ess-switch@3a000000 { - pinctrl-0 = <&uniphy_pins>; - pinctrl-names = "default"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x30>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ - port_scheduler_resource { - port@0 { - port_id = <0>; - ucast_queue = <0 143>; - mcast_queue = <256 271>; - l0sp = <0 35>; - l0cdrr = <0 47>; - l0edrr = <0 47>; - l1cdrr = <0 7>; - l1edrr = <0 7>; - }; - port@1 { - port_id = <1>; - ucast_queue = <144 159>; - mcast_queue = <272 275>; - l0sp = <36 39>; - l0cdrr = <48 63>; - l0edrr = <48 63>; - l1cdrr = <8 11>; - l1edrr = <8 11>; - }; - port@2 { - port_id = <2>; - ucast_queue = <160 175>; - mcast_queue = <276 279>; - l0sp = <40 43>; - l0cdrr = <64 79>; - l0edrr = <64 79>; - l1cdrr = <12 15>; - l1edrr = <12 15>; - }; - port@3 { - port_id = <3>; - ucast_queue = <176 191>; - mcast_queue = <280 283>; - l0sp = <44 47>; - l0cdrr = <80 95>; - l0edrr = <80 95>; - l1cdrr = <16 19>; - l1edrr = <16 19>; - }; - port@4 { - port_id = <4>; - ucast_queue = <192 207>; - mcast_queue = <284 287>; - l0sp = <48 51>; - l0cdrr = <96 111>; - l0edrr = <96 111>; - l1cdrr = <20 23>; - l1edrr = <20 23>; - }; - port@5 { - port_id = <5>; - ucast_queue = <208 223>; - mcast_queue = <288 291>; - l0sp = <52 55>; - l0cdrr = <112 127>; - l0edrr = <112 127>; - l1cdrr = <24 27>; - l1edrr = <24 27>; - }; - port@6 { - port_id = <6>; - ucast_queue = <224 239>; - mcast_queue = <292 295>; - l0sp = <56 59>; - l0cdrr = <128 143>; - l0edrr = <128 143>; - l1cdrr = <28 31>; - l1edrr = <28 31>; - }; - port@7 { - port_id = <7>; - ucast_queue = <240 255>; - mcast_queue = <296 299>; - l0sp = <60 63>; - l0cdrr = <144 159>; - l0edrr = <144 159>; - l1cdrr = <32 35>; - l1edrr = <32 35>; - }; - }; - port_scheduler_config { - port@0 { - port_id = <0>; - l1scheduler { - group@0 { - sp = <0 1>; /*L0 SPs*/ - /*cpri cdrr epri edrr*/ - cfg = <0 0 0 0>; - }; - }; - l0scheduler { - group@0 { - /*unicast queues*/ - ucast_queue = <0 4 8>; - /*multicast queues*/ - mcast_queue = <256 260>; - /*sp cpri cdrr epri edrr*/ - cfg = <0 0 0 0 0>; - }; - group@1 { - ucast_queue = <1 5 9>; - mcast_queue = <257 261>; - cfg = <0 1 1 1 1>; - }; - group@2 { - ucast_queue = <2 6 10>; - mcast_queue = <258 262>; - cfg = <0 2 2 2 2>; - }; - group@3 { - ucast_queue = <3 7 11>; - mcast_queue = <259 263>; - cfg = <0 3 3 3 3>; - }; - }; - }; - port@1 { - port_id = <1>; - l1scheduler { - group@0 { - sp = <36>; - cfg = <0 8 0 8>; - }; - group@1 { - sp = <37>; - cfg = <1 9 1 9>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <144>; - ucast_loop_pri = <16>; - mcast_queue = <272>; - mcast_loop_pri = <4>; - cfg = <36 0 48 0 48>; - }; - }; - }; - port@2 { - port_id = <2>; - l1scheduler { - group@0 { - sp = <40>; - cfg = <0 12 0 12>; - }; - group@1 { - sp = <41>; - cfg = <1 13 1 13>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <160>; - ucast_loop_pri = <16>; - mcast_queue = <276>; - mcast_loop_pri = <4>; - cfg = <40 0 64 0 64>; - }; - }; - }; - port@3 { - port_id = <3>; - l1scheduler { - group@0 { - sp = <44>; - cfg = <0 16 0 16>; - }; - group@1 { - sp = <45>; - cfg = <1 17 1 17>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <176>; - ucast_loop_pri = <16>; - mcast_queue = <280>; - mcast_loop_pri = <4>; - cfg = <44 0 80 0 80>; - }; - }; - }; - port@4 { - port_id = <4>; - l1scheduler { - group@0 { - sp = <48>; - cfg = <0 20 0 20>; - }; - group@1 { - sp = <49>; - cfg = <1 21 1 21>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <192>; - ucast_loop_pri = <16>; - mcast_queue = <284>; - mcast_loop_pri = <4>; - cfg = <48 0 96 0 96>; - }; - }; - }; - port@5 { - port_id = <5>; - l1scheduler { - group@0 { - sp = <52>; - cfg = <0 24 0 24>; - }; - group@1 { - sp = <53>; - cfg = <1 25 1 25>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <208>; - ucast_loop_pri = <16>; - mcast_queue = <288>; - mcast_loop_pri = <4>; - cfg = <52 0 112 0 112>; - }; - }; - }; - port@6 { - port_id = <6>; - l1scheduler { - group@0 { - sp = <56>; - cfg = <0 28 0 28>; - }; - group@1 { - sp = <57>; - cfg = <1 29 1 29>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <224>; - ucast_loop_pri = <16>; - mcast_queue = <292>; - mcast_loop_pri = <4>; - cfg = <56 0 128 0 128>; - }; - }; - }; - port@7 { - port_id = <7>; - l1scheduler { - group@0 { - sp = <60>; - cfg = <0 32 0 32>; - }; - group@1 { - sp = <61>; - cfg = <1 33 1 33>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <240>; - ucast_loop_pri = <16>; - mcast_queue = <296>; - cfg = <60 0 144 0 144>; - }; - }; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <6>; - reg = <0x3a007000 0x3fff>; - qcom,mactype = <1>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <8>; - phy-mode = "sgmii"; - }; - wifi3: wifi3@f00000 { - compatible = "qcom,cnss-qcn9000"; - wlan-en-gpio = <&tlmm 57 0>; - pinctrl-names = "wlan_en_active", "wlan_en_sleep"; - pinctrl-0 = <&cnss_wlan_en_active>; - pinctrl-1 = <&cnss_wlan_en_sleep>; - status = "disabled"; - }; -}; - -&serial_blsp4 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&serial_blsp2 { - pinctrl-0 = <&hsuart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&msm_imem { - status = "disabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&ssphy_1 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb3_0 { - status = "ok"; -}; - -&usb3_1 { - status = "ok"; -}; - -&cryptobam { - status = "ok"; -}; - -&crypto { - status = "ok"; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_0_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&i2c_1 { - status = "disabled"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&pcie0 { - status = "disabled"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-ex227.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-ex227.dts deleted file mode 100644 index 0f34156f2..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-ex227.dts +++ /dev/null @@ -1,754 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "qcom-ipq807x-soc.dtsi" -#include "qcom-ipq807x-hk-cpu.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "TP-Link EX227"; - compatible = "tplink,ex227", "qcom,ipq807x"; - qcom,msm-id = <0x143 0x0>; - interrupt-parent = <&intc>; - qcom,board-id = <0x8 0x0>; - qcom,pmic-id = <0x0 0x0 0x0 0x0>; - - aliases { - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 root=/dev/ram0 rw \ - init=/init"; - bootargs-append = " swiotlb=1"; - }; -}; - -&tlmm { - pinctrl-0 = <&btcoex_pins>; - pinctrl-names = "default"; - - btcoex_pins: btcoex_pins { - mux_0 { - pins = "gpio64"; - function = "pta1_1"; - drive-strength = <6>; - bias-pull-down; - }; - mux_1 { - pins = "gpio65"; - function = "pta1_2"; - drive-strength = <6>; - bias-pull-down; - }; - mux_2 { - pins = "gpio66"; - function = "pta1_0"; - drive-strength = <6>; - bias-pull-down; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio68"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio69"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio25"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio37"; - function = "gpio"; - bias-pull-up; - }; - }; - - uart_pins: uart_pins { - mux { - pins = "gpio23", "gpio24"; - function = "blsp4_uart1"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_3_pins: spi_3_pins { - mux { - pins = "gpio52", "gpio53"; - function = "blsp3_spi"; - drive-strength = <8>; - bias-disable; - }; - spi_cs { - pins = "gpio22"; - function = "blsp3_spi2"; - drive-strength = <8>; - bias-disable; - }; - quartz_interrupt { - pins = "gpio47"; - function = "gpio"; - input; - bias-disable; - }; - quartz_reset { - pins = "gpio21"; - function = "gpio"; - output-low; - bias-disable; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-disable; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-disable; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-disable; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-disable; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-disable; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-disable; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-disable; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-disable; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-disable; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio46", "gpio47", "gpio48", "gpio49"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - - /* POWER_LED, TP-Link */ - led_pins: led_pins { - led_power { - pins = "gpio42"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - /* BUTTON, TP-Link */ - button_pins: button_pins { - reset_button { - pins = "gpio50"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - usb_mux_sel_pins: usb_mux_pins { - mux { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - pcie0_pins: pcie_pins { - pcie0_rst { - pins = "gpio58"; - function = "pcie0_rst"; - drive-strength = <8>; - bias-pull-down; - }; - pcie0_wake { - pins = "gpio59"; - function = "pcie0_wake"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 37 0 &tlmm 25 1>; - compatible = "qcom,ipq40xx-mdio", "qcom,qca-mdio"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <28>; - }; - phy5: ethernet-phy@5 { - reg = <4>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <28>; - port_mac_sel = "QGMAC_PORT"; - }; - port@5 { - port_id = <6>; - phy_address = <4>; - }; - }; - port_scheduler_resource { - port@0 { - port_id = <0>; - ucast_queue = <0 143>; - mcast_queue = <256 271>; - l0sp = <0 35>; - l0cdrr = <0 47>; - l0edrr = <0 47>; - l1cdrr = <0 7>; - l1edrr = <0 7>; - }; - port@1 { - port_id = <1>; - ucast_queue = <144 159>; - mcast_queue = <272 275>; - l0sp = <36 39>; - l0cdrr = <48 63>; - l0edrr = <48 63>; - l1cdrr = <8 11>; - l1edrr = <8 11>; - }; - port@2 { - port_id = <2>; - ucast_queue = <160 175>; - mcast_queue = <276 279>; - l0sp = <40 43>; - l0cdrr = <64 79>; - l0edrr = <64 79>; - l1cdrr = <12 15>; - l1edrr = <12 15>; - }; - port@3 { - port_id = <3>; - ucast_queue = <176 191>; - mcast_queue = <280 283>; - l0sp = <44 47>; - l0cdrr = <80 95>; - l0edrr = <80 95>; - l1cdrr = <16 19>; - l1edrr = <16 19>; - }; - port@4 { - port_id = <4>; - ucast_queue = <192 207>; - mcast_queue = <284 287>; - l0sp = <48 51>; - l0cdrr = <96 111>; - l0edrr = <96 111>; - l1cdrr = <20 23>; - l1edrr = <20 23>; - }; - port@5 { - port_id = <5>; - ucast_queue = <208 223>; - mcast_queue = <288 291>; - l0sp = <52 55>; - l0cdrr = <112 127>; - l0edrr = <112 127>; - l1cdrr = <24 27>; - l1edrr = <24 27>; - }; - port@6 { - port_id = <6>; - ucast_queue = <224 239>; - mcast_queue = <292 295>; - l0sp = <56 59>; - l0cdrr = <128 143>; - l0edrr = <128 143>; - l1cdrr = <28 31>; - l1edrr = <28 31>; - }; - port@7 { - port_id = <7>; - ucast_queue = <240 255>; - mcast_queue = <296 299>; - l0sp = <60 63>; - l0cdrr = <144 159>; - l0edrr = <144 159>; - l1cdrr = <32 35>; - l1edrr = <32 35>; - }; - }; - port_scheduler_config { - port@0 { - port_id = <0>; - l1scheduler { - group@0 { - sp = <0 1>; /*L0 SPs*/ - /*cpri cdrr epri edrr*/ - cfg = <0 0 0 0>; - }; - }; - l0scheduler { - group@0 { - /*unicast queues*/ - ucast_queue = <0 4 8>; - /*multicast queues*/ - mcast_queue = <256 260>; - /*sp cpri cdrr epri edrr*/ - cfg = <0 0 0 0 0>; - }; - group@1 { - ucast_queue = <1 5 9>; - mcast_queue = <257 261>; - cfg = <0 1 1 1 1>; - }; - group@2 { - ucast_queue = <2 6 10>; - mcast_queue = <258 262>; - cfg = <0 2 2 2 2>; - }; - group@3 { - ucast_queue = <3 7 11>; - mcast_queue = <259 263>; - cfg = <0 3 3 3 3>; - }; - }; - }; - port@1 { - port_id = <1>; - l1scheduler { - group@0 { - sp = <36>; - cfg = <0 8 0 8>; - }; - group@1 { - sp = <37>; - cfg = <1 9 1 9>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <144>; - ucast_loop_pri = <16>; - mcast_queue = <272>; - mcast_loop_pri = <4>; - cfg = <36 0 48 0 48>; - }; - }; - }; - port@2 { - port_id = <2>; - l1scheduler { - group@0 { - sp = <40>; - cfg = <0 12 0 12>; - }; - group@1 { - sp = <41>; - cfg = <1 13 1 13>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <160>; - ucast_loop_pri = <16>; - mcast_queue = <276>; - mcast_loop_pri = <4>; - cfg = <40 0 64 0 64>; - }; - }; - }; - port@3 { - port_id = <3>; - l1scheduler { - group@0 { - sp = <44>; - cfg = <0 16 0 16>; - }; - group@1 { - sp = <45>; - cfg = <1 17 1 17>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <176>; - ucast_loop_pri = <16>; - mcast_queue = <280>; - mcast_loop_pri = <4>; - cfg = <44 0 80 0 80>; - }; - }; - }; - port@4 { - port_id = <4>; - l1scheduler { - group@0 { - sp = <48>; - cfg = <0 20 0 20>; - }; - group@1 { - sp = <49>; - cfg = <1 21 1 21>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <192>; - ucast_loop_pri = <16>; - mcast_queue = <284>; - mcast_loop_pri = <4>; - cfg = <48 0 96 0 96>; - }; - }; - }; - port@5 { - port_id = <5>; - l1scheduler { - group@0 { - sp = <52>; - cfg = <0 24 0 24>; - }; - group@1 { - sp = <53>; - cfg = <1 25 1 25>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <208>; - ucast_loop_pri = <16>; - mcast_queue = <288>; - mcast_loop_pri = <4>; - cfg = <52 0 112 0 112>; - }; - }; - }; - port@6 { - port_id = <6>; - l1scheduler { - group@0 { - sp = <56>; - cfg = <0 28 0 28>; - }; - group@1 { - sp = <57>; - cfg = <1 29 1 29>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <224>; - ucast_loop_pri = <16>; - mcast_queue = <292>; - mcast_loop_pri = <4>; - cfg = <56 0 128 0 128>; - }; - }; - }; - port@7 { - port_id = <7>; - l1scheduler { - group@0 { - sp = <60>; - cfg = <0 32 0 32>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <240>; - mcast_queue = <296>; - cfg = <60 0 144 0 144>; - }; - }; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <6>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <4>; - phy-mode = "sgmii"; - }; - - /* POWER LED, TP-Link */ - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_power: led_power { - label = "blue:power"; - gpio = <&tlmm 42 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - }; - - /* BUTTON, TP-Link */ - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - }; - }; - - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x18>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; -}; - -&serial_blsp4 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&spi_4 { /* BLSP1 QUP3 */ - pinctrl-0 = <&spi_3_pins>; - pinctrl-names = "default"; - cs-select = <2>; - quartz-reset-gpio = <&tlmm 21 1>; - status = "disabled"; - spidev3: spi@3 { - compatible = "qca,spidev"; - reg = <0>; - spi-max-frequency = <24000000>; - }; -}; - -&serial_blsp2 { - status = "disabled"; -}; - -&msm_imem { - status = "disabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&ssphy_1 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb3_0 { - status = "ok"; -}; - -&usb3_1 { - status = "ok"; -}; - -&cryptobam { - status = "ok"; -}; - -&crypto { - status = "ok"; -}; - -&i2c_0 { - status = "disabled"; -}; - -&i2c_1 { - status = "disabled"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_lcd { - status = "disabled"; -}; - -&qpic_lcd_panel { - status = "disabled"; -}; - -&ledc { - status = "disabled"; -}; - -&pcie0 { - status = "ok"; -}; - -&pcie1 { - status = "disabled"; -}; - diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-ex447.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-ex447.dts deleted file mode 100644 index f8addc97f..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-ex447.dts +++ /dev/null @@ -1,754 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "qcom-ipq807x-soc.dtsi" -#include "qcom-ipq807x-hk-cpu.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "TP-Link EX447"; - compatible = "tplink,ex447", "qcom,ipq807x"; - qcom,msm-id = <0x143 0x0>; - interrupt-parent = <&intc>; - qcom,board-id = <0x8 0x0>; - qcom,pmic-id = <0x0 0x0 0x0 0x0>; - - aliases { - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 root=/dev/ram0 rw \ - init=/init"; - bootargs-append = " swiotlb=1"; - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; -}; - -&tlmm { - pinctrl-0 = <&btcoex_pins>; - pinctrl-names = "default"; - - btcoex_pins: btcoex_pins { - mux_0 { - pins = "gpio64"; - function = "pta1_1"; - drive-strength = <6>; - bias-pull-down; - }; - mux_1 { - pins = "gpio65"; - function = "pta1_2"; - drive-strength = <6>; - bias-pull-down; - }; - mux_2 { - pins = "gpio66"; - function = "pta1_0"; - drive-strength = <6>; - bias-pull-down; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio68"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio69"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio25"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio37"; - function = "gpio"; - bias-pull-up; - }; - }; - - uart_pins: uart_pins { - mux { - pins = "gpio23", "gpio24"; - function = "blsp4_uart1"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_3_pins: spi_3_pins { - mux { - pins = "gpio52", "gpio53"; - function = "blsp3_spi"; - drive-strength = <8>; - bias-disable; - }; - spi_cs { - pins = "gpio22"; - function = "blsp3_spi2"; - drive-strength = <8>; - bias-disable; - }; - quartz_interrupt { - pins = "gpio47"; - function = "gpio"; - input; - bias-disable; - }; - quartz_reset { - pins = "gpio21"; - function = "gpio"; - output-low; - bias-disable; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-disable; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-disable; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-disable; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-disable; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-disable; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-disable; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-disable; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-disable; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-disable; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio46", "gpio47", "gpio48", "gpio49"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - - /* POWER_LED, TP-Link */ - led_pins: led_pins { - led_power { - pins = "gpio42"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - /* BUTTON, TP-Link */ - button_pins: button_pins { - reset_button { - pins = "gpio50"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - usb_mux_sel_pins: usb_mux_pins { - mux { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - pcie0_pins: pcie_pins { - pcie0_rst { - pins = "gpio58"; - function = "pcie0_rst"; - drive-strength = <8>; - bias-pull-down; - }; - pcie0_wake { - pins = "gpio59"; - function = "pcie0_wake"; - drive-strength = <8>; - bias-pull-down; - }; - }; - -}; - -&soc { - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 37 0 &tlmm 25 1>; - compatible = "qcom,ipq40xx-mdio", "qcom,qca-mdio"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <28>; - }; - phy5: ethernet-phy@5 { - reg = <4>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <28>; - port_mac_sel = "QGMAC_PORT"; - }; - port@5 { - port_id = <6>; - phy_address = <4>; - }; - }; - port_scheduler_resource { - port@0 { - port_id = <0>; - ucast_queue = <0 143>; - mcast_queue = <256 271>; - l0sp = <0 35>; - l0cdrr = <0 47>; - l0edrr = <0 47>; - l1cdrr = <0 7>; - l1edrr = <0 7>; - }; - port@1 { - port_id = <1>; - ucast_queue = <144 159>; - mcast_queue = <272 275>; - l0sp = <36 39>; - l0cdrr = <48 63>; - l0edrr = <48 63>; - l1cdrr = <8 11>; - l1edrr = <8 11>; - }; - port@2 { - port_id = <2>; - ucast_queue = <160 175>; - mcast_queue = <276 279>; - l0sp = <40 43>; - l0cdrr = <64 79>; - l0edrr = <64 79>; - l1cdrr = <12 15>; - l1edrr = <12 15>; - }; - port@3 { - port_id = <3>; - ucast_queue = <176 191>; - mcast_queue = <280 283>; - l0sp = <44 47>; - l0cdrr = <80 95>; - l0edrr = <80 95>; - l1cdrr = <16 19>; - l1edrr = <16 19>; - }; - port@4 { - port_id = <4>; - ucast_queue = <192 207>; - mcast_queue = <284 287>; - l0sp = <48 51>; - l0cdrr = <96 111>; - l0edrr = <96 111>; - l1cdrr = <20 23>; - l1edrr = <20 23>; - }; - port@5 { - port_id = <5>; - ucast_queue = <208 223>; - mcast_queue = <288 291>; - l0sp = <52 55>; - l0cdrr = <112 127>; - l0edrr = <112 127>; - l1cdrr = <24 27>; - l1edrr = <24 27>; - }; - port@6 { - port_id = <6>; - ucast_queue = <224 239>; - mcast_queue = <292 295>; - l0sp = <56 59>; - l0cdrr = <128 143>; - l0edrr = <128 143>; - l1cdrr = <28 31>; - l1edrr = <28 31>; - }; - port@7 { - port_id = <7>; - ucast_queue = <240 255>; - mcast_queue = <296 299>; - l0sp = <60 63>; - l0cdrr = <144 159>; - l0edrr = <144 159>; - l1cdrr = <32 35>; - l1edrr = <32 35>; - }; - }; - port_scheduler_config { - port@0 { - port_id = <0>; - l1scheduler { - group@0 { - sp = <0 1>; /*L0 SPs*/ - /*cpri cdrr epri edrr*/ - cfg = <0 0 0 0>; - }; - }; - l0scheduler { - group@0 { - /*unicast queues*/ - ucast_queue = <0 4 8>; - /*multicast queues*/ - mcast_queue = <256 260>; - /*sp cpri cdrr epri edrr*/ - cfg = <0 0 0 0 0>; - }; - group@1 { - ucast_queue = <1 5 9>; - mcast_queue = <257 261>; - cfg = <0 1 1 1 1>; - }; - group@2 { - ucast_queue = <2 6 10>; - mcast_queue = <258 262>; - cfg = <0 2 2 2 2>; - }; - group@3 { - ucast_queue = <3 7 11>; - mcast_queue = <259 263>; - cfg = <0 3 3 3 3>; - }; - }; - }; - port@1 { - port_id = <1>; - l1scheduler { - group@0 { - sp = <36>; - cfg = <0 8 0 8>; - }; - group@1 { - sp = <37>; - cfg = <1 9 1 9>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <144>; - ucast_loop_pri = <16>; - mcast_queue = <272>; - mcast_loop_pri = <4>; - cfg = <36 0 48 0 48>; - }; - }; - }; - port@2 { - port_id = <2>; - l1scheduler { - group@0 { - sp = <40>; - cfg = <0 12 0 12>; - }; - group@1 { - sp = <41>; - cfg = <1 13 1 13>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <160>; - ucast_loop_pri = <16>; - mcast_queue = <276>; - mcast_loop_pri = <4>; - cfg = <40 0 64 0 64>; - }; - }; - }; - port@3 { - port_id = <3>; - l1scheduler { - group@0 { - sp = <44>; - cfg = <0 16 0 16>; - }; - group@1 { - sp = <45>; - cfg = <1 17 1 17>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <176>; - ucast_loop_pri = <16>; - mcast_queue = <280>; - mcast_loop_pri = <4>; - cfg = <44 0 80 0 80>; - }; - }; - }; - port@4 { - port_id = <4>; - l1scheduler { - group@0 { - sp = <48>; - cfg = <0 20 0 20>; - }; - group@1 { - sp = <49>; - cfg = <1 21 1 21>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <192>; - ucast_loop_pri = <16>; - mcast_queue = <284>; - mcast_loop_pri = <4>; - cfg = <48 0 96 0 96>; - }; - }; - }; - port@5 { - port_id = <5>; - l1scheduler { - group@0 { - sp = <52>; - cfg = <0 24 0 24>; - }; - group@1 { - sp = <53>; - cfg = <1 25 1 25>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <208>; - ucast_loop_pri = <16>; - mcast_queue = <288>; - mcast_loop_pri = <4>; - cfg = <52 0 112 0 112>; - }; - }; - }; - port@6 { - port_id = <6>; - l1scheduler { - group@0 { - sp = <56>; - cfg = <0 28 0 28>; - }; - group@1 { - sp = <57>; - cfg = <1 29 1 29>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <224>; - ucast_loop_pri = <16>; - mcast_queue = <292>; - mcast_loop_pri = <4>; - cfg = <56 0 128 0 128>; - }; - }; - }; - port@7 { - port_id = <7>; - l1scheduler { - group@0 { - sp = <60>; - cfg = <0 32 0 32>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <240>; - mcast_queue = <296>; - cfg = <60 0 144 0 144>; - }; - }; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - phy-mode = "sgmii"; - }; - - /* POWER LED, TP-Link */ - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_power: led_power { - label = "power:blue"; - gpio = <&tlmm 42 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - }; - - /* BUTTON, TP-Link */ - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - }; - }; - - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x18>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; -}; - -&serial_blsp4 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&spi_4 { /* BLSP1 QUP3 */ - pinctrl-0 = <&spi_3_pins>; - pinctrl-names = "default"; - cs-select = <2>; - quartz-reset-gpio = <&tlmm 21 1>; - status = "disabled"; - spidev3: spi@3 { - compatible = "qca,spidev"; - reg = <0>; - spi-max-frequency = <24000000>; - }; -}; - -&serial_blsp2 { - status = "disabled"; -}; - -&msm_imem { - status = "disabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&ssphy_1 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb3_0 { - status = "ok"; -}; - -&usb3_1 { - status = "ok"; -}; - -&cryptobam { - status = "ok"; -}; - -&crypto { - status = "ok"; -}; - -&i2c_0 { - status = "disabled"; -}; - -&i2c_1 { - status = "disabled"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_lcd { - status = "disabled"; -}; - -&qpic_lcd_panel { - status = "disabled"; -}; - -&ledc { - status = "disabled"; -}; - -&pcie0 { - status = "ok"; -}; - -&pcie1 { - status = "disabled"; -}; - diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-oap102.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-oap102.dts deleted file mode 100644 index a08f7121e..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-oap102.dts +++ /dev/null @@ -1,930 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "qcom-ipq807x-soc.dtsi" -#include "qcom-ipq807x-ac-cpu.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "Edgecore OAP102"; - compatible = "edgecore,oap102", "qcom,ipq807x-ac02", "qcom,ipq807x"; - qcom,msm-id = <0x178 0x0>; - interrupt-parent = <&intc>; - qcom,board-id = <0x8 0x0>; - qcom,pmic-id = <0x0 0x0 0x0 0x0>; - - aliases { - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet1 = "/soc/dp5"; - ethernet0 = "/soc/dp6"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 root=/dev/ram0 rw \ - init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - }; - - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - mcu-enable { - gpio-export,name = "mcu-enable"; - gpio-export,output = <0>; - gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; - }; - - usb-hub-enable { - gpio-export,name = "usb-hub-enable"; - gpio-export,output = <1>; - gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; - }; - - usb-rear-power { - gpio-export,name = "usb-rear-power"; - gpio-export,output = <1>; - gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; - }; - - usb-side-power { - gpio-export,name = "usb-side-power"; - gpio-export,output = <1>; - gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&tlmm { - pinctrl-0 = <&mcu_rst &mcu_rsv &usb_rear_pwr &usb_side_pwr &usb_hub_rst>; - pinctrl-names = "default"; - - mcu_rst: mcu_rst_pins { - pins = "gpio54"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-low; - }; - - mcu_rsv: mcu_rsv_pins { - pins = "gpio56"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - - usb_rear_pwr: usb_rear_pwr_pins { - pins = "gpio29"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - - usb_side_pwr: usb_side_pwr_pins { - pins = "gpio30"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - - usb_hub_rst: usb_hub_rst_pins { - pins = "gpio55"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio68"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio69"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_2 { - pins = "gpio33"; - function = "gpio"; - bias-pull-up; - }; - mux_3 { - pins = "gpio44"; - function = "gpio"; - bias-pull-up; - }; - }; - - uart_pins: uart_pins { - mux { - pins = "gpio23", "gpio24"; - function = "blsp4_uart1"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-disable; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-disable; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-disable; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-disable; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-disable; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-disable; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-disable; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-disable; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-disable; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - reset_button { - pins = "gpio66"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - led_pins: led_pins { - led_pwr { - pins = "gpio46"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_2g { - pins = "gpio47"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_5g { - pins = "gpio48"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_bt { - pins = "gpio50"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset_button"; - linux,code = ; - gpios = <&tlmm 66 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 37 0 &tlmm 25 1 &tlmm 44 1>; - compatible = "qcom,ipq40xx-mdio", "qcom,qca-mdio"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - phy1: ethernet-phy@1 { - reg = <1>; - }; - phy2: ethernet-phy@2 { - reg = <2>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <24>; - }; - phy5: ethernet-phy@5 { - reg = <28>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <24>; - port_mac_sel = "QGMAC_PORT"; - }; - port@5 { - port_id = <6>; - phy_address = <28>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - port_scheduler_resource { - port@0 { - port_id = <0>; - ucast_queue = <0 143>; - mcast_queue = <256 271>; - l0sp = <0 35>; - l0cdrr = <0 47>; - l0edrr = <0 47>; - l1cdrr = <0 7>; - l1edrr = <0 7>; - }; - port@1 { - port_id = <1>; - ucast_queue = <144 159>; - mcast_queue = <272 275>; - l0sp = <36 39>; - l0cdrr = <48 63>; - l0edrr = <48 63>; - l1cdrr = <8 11>; - l1edrr = <8 11>; - }; - port@2 { - port_id = <2>; - ucast_queue = <160 175>; - mcast_queue = <276 279>; - l0sp = <40 43>; - l0cdrr = <64 79>; - l0edrr = <64 79>; - l1cdrr = <12 15>; - l1edrr = <12 15>; - }; - port@3 { - port_id = <3>; - ucast_queue = <176 191>; - mcast_queue = <280 283>; - l0sp = <44 47>; - l0cdrr = <80 95>; - l0edrr = <80 95>; - l1cdrr = <16 19>; - l1edrr = <16 19>; - }; - port@4 { - port_id = <4>; - ucast_queue = <192 207>; - mcast_queue = <284 287>; - l0sp = <48 51>; - l0cdrr = <96 111>; - l0edrr = <96 111>; - l1cdrr = <20 23>; - l1edrr = <20 23>; - }; - port@5 { - port_id = <5>; - ucast_queue = <208 223>; - mcast_queue = <288 291>; - l0sp = <52 55>; - l0cdrr = <112 127>; - l0edrr = <112 127>; - l1cdrr = <24 27>; - l1edrr = <24 27>; - }; - port@6 { - port_id = <6>; - ucast_queue = <224 239>; - mcast_queue = <292 295>; - l0sp = <56 59>; - l0cdrr = <128 143>; - l0edrr = <128 143>; - l1cdrr = <28 31>; - l1edrr = <28 31>; - }; - port@7 { - port_id = <7>; - ucast_queue = <240 255>; - mcast_queue = <296 299>; - l0sp = <60 63>; - l0cdrr = <144 159>; - l0edrr = <144 159>; - l1cdrr = <32 35>; - l1edrr = <32 35>; - }; - }; - port_scheduler_config { - port@0 { - port_id = <0>; - l1scheduler { - group@0 { - sp = <0 1>; /*L0 SPs*/ - /*cpri cdrr epri edrr*/ - cfg = <0 0 0 0>; - }; - }; - l0scheduler { - group@0 { - /*unicast queues*/ - ucast_queue = <0 4 8>; - /*multicast queues*/ - mcast_queue = <256 260>; - /*sp cpri cdrr epri edrr*/ - cfg = <0 0 0 0 0>; - }; - group@1 { - ucast_queue = <1 5 9>; - mcast_queue = <257 261>; - cfg = <0 1 1 1 1>; - }; - group@2 { - ucast_queue = <2 6 10>; - mcast_queue = <258 262>; - cfg = <0 2 2 2 2>; - }; - group@3 { - ucast_queue = <3 7 11>; - mcast_queue = <259 263>; - cfg = <0 3 3 3 3>; - }; - }; - }; - port@1 { - port_id = <1>; - l1scheduler { - group@0 { - sp = <36>; - cfg = <0 8 0 8>; - }; - group@1 { - sp = <37>; - cfg = <1 9 1 9>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <144>; - ucast_loop_pri = <16>; - mcast_queue = <272>; - mcast_loop_pri = <4>; - cfg = <36 0 48 0 48>; - }; - }; - }; - port@2 { - port_id = <2>; - l1scheduler { - group@0 { - sp = <40>; - cfg = <0 12 0 12>; - }; - group@1 { - sp = <41>; - cfg = <1 13 1 13>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <160>; - ucast_loop_pri = <16>; - mcast_queue = <276>; - mcast_loop_pri = <4>; - cfg = <40 0 64 0 64>; - }; - }; - }; - port@3 { - port_id = <3>; - l1scheduler { - group@0 { - sp = <44>; - cfg = <0 16 0 16>; - }; - group@1 { - sp = <45>; - cfg = <1 17 1 17>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <176>; - ucast_loop_pri = <16>; - mcast_queue = <280>; - mcast_loop_pri = <4>; - cfg = <44 0 80 0 80>; - }; - }; - }; - port@4 { - port_id = <4>; - l1scheduler { - group@0 { - sp = <48>; - cfg = <0 20 0 20>; - }; - group@1 { - sp = <49>; - cfg = <1 21 1 21>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <192>; - ucast_loop_pri = <16>; - mcast_queue = <284>; - mcast_loop_pri = <4>; - cfg = <48 0 96 0 96>; - }; - }; - }; - port@5 { - port_id = <5>; - l1scheduler { - group@0 { - sp = <52>; - cfg = <0 24 0 24>; - }; - group@1 { - sp = <53>; - cfg = <1 25 1 25>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <208>; - ucast_loop_pri = <16>; - mcast_queue = <288>; - mcast_loop_pri = <4>; - cfg = <52 0 112 0 112>; - }; - }; - }; - port@6 { - port_id = <6>; - l1scheduler { - group@0 { - sp = <56>; - cfg = <0 28 0 28>; - }; - group@1 { - sp = <57>; - cfg = <1 29 1 29>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <224>; - ucast_loop_pri = <16>; - mcast_queue = <292>; - mcast_loop_pri = <4>; - cfg = <56 0 128 0 128>; - }; - }; - }; - port@7 { - port_id = <7>; - l1scheduler { - group@0 { - sp = <60>; - cfg = <0 32 0 32>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <240>; - mcast_queue = <296>; - cfg = <60 0 144 0 144>; - }; - }; - }; - }; - }; -/* - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; -*/ - dp6 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <6>; - reg = <0x3a001800 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001a00 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <24>; - phy-mode = "sgmii"; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_pwr { - label = "green:wan"; - gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>; - default-state = "off"; - linux,default-trigger = "led_pwr"; - }; - - led_2g { - label = "green:wifi2"; - gpio = <&tlmm 47 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_5g { - label = "green:wifi5"; - gpio = <&tlmm 48 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_power: led_bt { - gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; - label = "green:power"; - default-state = "on"; - linux,default-trigger = "led_bt"; - }; - }; - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x18>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; -}; - -&serial_blsp4 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&nss0 { - qcom,low-frequency = <187200000>; - qcom,mid-frequency = <748800000>; - qcom,max-frequency = <1497600000>; -}; - -&msm_imem { - status = "disabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&ssphy_1 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb3_0 { - status = "ok"; -}; - -&usb3_1 { - status = "ok"; -}; - -&cryptobam { - status = "ok"; -}; - -&crypto { - status = "ok"; -}; - -&i2c_0 { - status = "disabled"; -}; - -&i2c_1 { - status = "disabled"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_lcd { - status = "disabled"; -}; - -&qpic_lcd_panel { - status = "disabled"; -}; - -&ledc { - status = "disabled"; -}; - -&pcie0 { - status = "disabled"; -}; - -&pcie1 { - status = "disabled"; -}; - -&glink_rpm { - status = "disabled"; -}; - -&apc_cpr { - /* Same CPR configuration as OAK */ - compatible = "qcom,cpr4-ipq817x-apss-regulator"; - - thread@0 { - apc_vreg: regulator { - regulator-min-microvolt = <1>; - regulator-max-microvolt = <2>; - qcom,cpr-fuse-corners = <2>; - qcom,cpr-corners = <3>; - qcom,cpr-speed-bin-corners = <3>; - qcom,cpr-corner-fmax-map = <1 3>; - - qcom,cpr-voltage-ceiling = - <840000 904000 944000>; - qcom,cpr-voltage-floor = - <592000 648000 712000>; - qcom,corner-frequencies = - <1017600000 1382400000 1382400000>; - - qcom,cpr-open-loop-voltage-fuse-adjustment-0 = - /* Speed bin 0; CPR rev 0..7 */ - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>; - - qcom,cpr-open-loop-voltage-fuse-adjustment-1 = - /* Speed bin 0; CPR rev 0..7 */ - < 0 0>, - < 0 0>, - < 0 0>, - < 20000 26000>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>; - - qcom,cpr-open-loop-voltage-fuse-adjustment-v2-0 = - /* Speed bin 0; CPR rev 0..7 */ - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>; - - qcom,cpr-open-loop-voltage-fuse-adjustment-v2-1 = - /* Speed bin 0; CPR rev 0..7 */ - < 0 0>, - < 0 7000>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>, - < 0 0>; - - qcom,cpr-floor-to-ceiling-max-range = - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>, - < 40000 40000 40000>; - }; - }; -}; - -&npu_cpr { - status = "disabled"; -}; - -&nss0 { - npu-supply = <&dummy_reg>; - mx-supply = <&dummy_reg>; -}; - -&wifi0 { - qcom,board_id = <0x92>; -}; - -&wifi1 { - qcom,board_id = <0x292>; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf194c.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf194c.dts deleted file mode 100644 index 0db1a5c91..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf194c.dts +++ /dev/null @@ -1,751 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "qcom-ipq807x-soc.dtsi" -#include "qcom-ipq807x-audio.dtsi" -#include "qcom-ipq807x-hk-cpu.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "CIG WF194C"; - compatible = "cig,wf194c", "qcom,ipq807x"; - qcom,msm-id = <0x143 0x0>, <0x158 0x0>, <0x186 0x0>, <0x188 0x0>; - interrupt-parent = <&intc>; - qcom,board-id = <0x8 0x0>; - qcom,pmic-id = <0x0 0x0 0x0 0x0>; - - aliases { - sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ - sdhc2 = &sdhc_2; /* SDC2 SD slot */ - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 root=/dev/ram0 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - }; -}; - -&tlmm { - pinctrl-0 = <&btcoex_pins>; - pinctrl-names = "default"; - - btcoex_pins: btcoex_pins { - mux_0 { - pins = "gpio34"; - function = "gpio"; - drive-strength = <6>; - bias-pull-up; - output-high; - }; - mux_1 { - pins = "gpio62"; - function = "gpio"; - drive-strength = <6>; - bias-pull-up; - output-high; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio68"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio69"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - uart_pins: uart_pins { - mux { - pins = "gpio23", "gpio24"; - function = "blsp4_uart1"; - drive-strength = <8>; - bias-disable; - }; - }; - - i2c_0_pins: i2c_0_pinmux { - mux { - pins = "gpio42", "gpio43"; - function = "blsp1_i2c"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-disable; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-disable; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-disable; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-disable; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-disable; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-disable; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-disable; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-disable; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-disable; - }; - data_8 { - pins = "gpio16"; - function = "qpic_pad8"; - drive-strength = <8>; - bias-disable; - }; - qpic_pad { - pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", - "gpio9", "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-disable; - }; - }; - - sd_pins: sd_pins { - mux { - pins = "gpio63"; - function = "sd_card"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio48", "gpio49"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - - leds_pins: leds_pinmux { - led1_r { - pins = "gpio54"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led1_g { - pins = "gpio55"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led2_r { - pins = "gpio56"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led2_g { - pins = "gpio64"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - }; - - button_pins: button_pins { - wps_button { - pins = "gpio67"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - uniphy_pins: uniphy_pinmux { - mux_2 { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_3 { - pins = "gpio44"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - pwm_pins: pwm_pinmux { - mux_1 { - pins = "gpio25"; - function = "pwm02"; - drive-strength = <8>; - }; - }; -}; - -&soc { - pwm { - pinctrl-0 = <&pwm_pins>; - pinctrl-names = "default"; - used-pwm-indices = <1>, <0>, <0>, <0>; - status = "disabled"; - }; - - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 67 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - status = "ok"; - - led@54 { - label = "wf194c:red:lan"; - gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - led@55 { - label = "wf194c:green:lan"; - gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - led@56 { - label = "wf194c:red:wan"; - gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - led@64 { - label = "wf194c:green:wan"; - gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - }; - mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 37 0 &tlmm 44 0>; - phy0: ethernet-phy@0 { - reg = <0xf>; /*<0>*/ - }; - phy1: ethernet-phy@1 { - reg = <0xf>; - }; - phy2: ethernet-phy@2 { - reg = <0xf>; - }; - phy3: ethernet-phy@3 { - reg = <3>; - }; - phy4: ethernet-phy@4 { - reg = <4>; - }; - phy5: ethernet-phy@5 { - compatible ="ethernet-phy-ieee802.3-c45"; - reg = <0>; - }; - }; - - ess-switch@3a000000 { - pinctrl-0 = <&uniphy_pins>; - pinctrl-names = "default"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x30>; /*..0x3e lan port bitmap */ - switch_wan_bmp = <0x40>; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ - port_scheduler_resource { - port@0 { - port_id = <0>; - ucast_queue = <0 143>; - mcast_queue = <256 271>; - l0sp = <0 35>; - l0cdrr = <0 47>; - l0edrr = <0 47>; - l1cdrr = <0 7>; - l1edrr = <0 7>; - }; - port@1 { - port_id = <1>; - ucast_queue = <144 159>; - mcast_queue = <272 275>; - l0sp = <36 39>; - l0cdrr = <48 63>; - l0edrr = <48 63>; - l1cdrr = <8 11>; - l1edrr = <8 11>; - }; - port@2 { - port_id = <2>; - ucast_queue = <160 175>; - mcast_queue = <276 279>; - l0sp = <40 43>; - l0cdrr = <64 79>; - l0edrr = <64 79>; - l1cdrr = <12 15>; - l1edrr = <12 15>; - }; - port@3 { - port_id = <3>; - ucast_queue = <176 191>; - mcast_queue = <280 283>; - l0sp = <44 47>; - l0cdrr = <80 95>; - l0edrr = <80 95>; - l1cdrr = <16 19>; - l1edrr = <16 19>; - }; - port@4 { - port_id = <4>; - ucast_queue = <192 207>; - mcast_queue = <284 287>; - l0sp = <48 51>; - l0cdrr = <96 111>; - l0edrr = <96 111>; - l1cdrr = <20 23>; - l1edrr = <20 23>; - }; - port@5 { - port_id = <5>; - ucast_queue = <208 223>; - mcast_queue = <288 291>; - l0sp = <52 55>; - l0cdrr = <112 127>; - l0edrr = <112 127>; - l1cdrr = <24 27>; - l1edrr = <24 27>; - }; - port@6 { - port_id = <6>; - ucast_queue = <224 239>; - mcast_queue = <292 295>; - l0sp = <56 59>; - l0cdrr = <128 143>; - l0edrr = <128 143>; - l1cdrr = <28 31>; - l1edrr = <28 31>; - }; - port@7 { - port_id = <7>; - ucast_queue = <240 255>; - mcast_queue = <296 299>; - l0sp = <60 63>; - l0cdrr = <144 159>; - l0edrr = <144 159>; - l1cdrr = <32 35>; - l1edrr = <32 35>; - }; - }; - port_scheduler_config { - port@0 { - port_id = <0>; - l1scheduler { - group@0 { - sp = <0 1>; /*L0 SPs*/ - /*cpri cdrr epri edrr*/ - cfg = <0 0 0 0>; - }; - }; - l0scheduler { - group@0 { - /*unicast queues*/ - ucast_queue = <0 4 8>; - /*multicast queues*/ - mcast_queue = <256 260>; - /*sp cpri cdrr epri edrr*/ - cfg = <0 0 0 0 0>; - }; - group@1 { - ucast_queue = <1 5 9>; - mcast_queue = <257 261>; - cfg = <0 1 1 1 1>; - }; - group@2 { - ucast_queue = <2 6 10>; - mcast_queue = <258 262>; - cfg = <0 2 2 2 2>; - }; - group@3 { - ucast_queue = <3 7 11>; - mcast_queue = <259 263>; - cfg = <0 3 3 3 3>; - }; - }; - }; - port@1 { - port_id = <1>; - l1scheduler { - group@0 { - sp = <36>; - cfg = <0 8 0 8>; - }; - group@1 { - sp = <37>; - cfg = <1 9 1 9>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <144>; - ucast_loop_pri = <16>; - mcast_queue = <272>; - mcast_loop_pri = <4>; - cfg = <36 0 48 0 48>; - }; - }; - }; - port@2 { - port_id = <2>; - l1scheduler { - group@0 { - sp = <40>; - cfg = <0 12 0 12>; - }; - group@1 { - sp = <41>; - cfg = <1 13 1 13>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <160>; - ucast_loop_pri = <16>; - mcast_queue = <276>; - mcast_loop_pri = <4>; - cfg = <40 0 64 0 64>; - }; - }; - }; - port@3 { - port_id = <3>; - l1scheduler { - group@0 { - sp = <44>; - cfg = <0 16 0 16>; - }; - group@1 { - sp = <45>; - cfg = <1 17 1 17>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <176>; - ucast_loop_pri = <16>; - mcast_queue = <280>; - mcast_loop_pri = <4>; - cfg = <44 0 80 0 80>; - }; - }; - }; - port@4 { - port_id = <4>; - l1scheduler { - group@0 { - sp = <48>; - cfg = <0 20 0 20>; - }; - group@1 { - sp = <49>; - cfg = <1 21 1 21>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <192>; - ucast_loop_pri = <16>; - mcast_queue = <284>; - mcast_loop_pri = <4>; - cfg = <48 0 96 0 96>; - }; - }; - }; - port@5 { - port_id = <5>; - l1scheduler { - group@0 { - sp = <52>; - cfg = <0 24 0 24>; - }; - group@1 { - sp = <53>; - cfg = <1 25 1 25>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <208>; - ucast_loop_pri = <16>; - mcast_queue = <288>; - mcast_loop_pri = <4>; - cfg = <52 0 112 0 112>; - }; - }; - }; - port@6 { - port_id = <6>; - l1scheduler { - group@0 { - sp = <56>; - cfg = <0 28 0 28>; - }; - group@1 { - sp = <57>; - cfg = <1 29 1 29>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <224>; - ucast_loop_pri = <16>; - mcast_queue = <292>; - mcast_loop_pri = <4>; - cfg = <56 0 128 0 128>; - }; - }; - }; - port@7 { - port_id = <7>; - l1scheduler { - group@0 { - sp = <60>; - cfg = <0 32 0 32>; - }; - group@1 { - sp = <61>; - cfg = <1 33 1 33>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <240>; - ucast_loop_pri = <16>; - mcast_queue = <296>; - cfg = <60 0 144 0 144>; - }; - }; - }; - }; - }; - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <6>; - reg = <0x3a007000 0x3fff>; - qcom,mactype = <1>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; -}; - -&serial_blsp4 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&serial_blsp2 { - pinctrl-0 = <&hsuart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&msm_imem { - status = "enabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&ssphy_1 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb3_0 { - status = "ok"; -}; - -&usb3_1 { - status = "ok"; -}; - -&cryptobam { - status = "ok"; -}; - -&crypto { - status = "ok"; -}; - -&i2c_0 { - pinctrl-0 = <&i2c_0_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&i2c_1 { - status = "disabled"; -}; - -&sdhc_1 { - qcom,clk-rates = <400000 25000000 50000000 100000000 \ - 192000000 384000000>; - qcom,bus-speed-mode = "HS400_1p8v", "HS200_1p8v", "DDR_1p8v"; - qcom,nonremovable; - status = "ok"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&sdhc_2 { - qcom,clk-rates = <400000 25000000 50000000 100000000 \ - 192000000>; - qcom,bus-speed-mode = "HS200_1p8v", "DDR_1p8v"; - pinctrl-0 = <&sd_pins>; - pinctrl-names = "default"; - cd-gpios = <&tlmm 63 1>; - sd-ldo-gpios = <&tlmm 21 0>; - vqmmc-supply = <&ldo11>; - status = "ok"; -}; - -&qpic_lcd { - status = "ok"; -}; - -&qpic_lcd_panel { - status = "ok"; -}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf194c4.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf194c4.dts deleted file mode 100644 index 4c633fea5..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf194c4.dts +++ /dev/null @@ -1,942 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "qcom-ipq807x-soc.dtsi" -#include "qcom-ipq807x-hk-cpu.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "CIG WF194c4"; - compatible = "cig,wf194c4", "qcom,ipq807x"; - qcom,msm-id = <0x156 0x0>; - interrupt-parent = <&intc>; - qcom,board-id = <0x8 0x0>; - qcom,pmic-id = <0x0 0x0 0x0 0x0>; - - aliases { - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - /* ethernet2 = "/soc/dp3"; - ethernet3 = "/soc/dp4"; - ethernet4 = "/soc/dp5"; - ethernet5 = "/soc/dp6"; - */ - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 root=/dev/ram0 rw \ - init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M"; - #endif - }; -}; - -&tlmm { - pinctrl-0 = <&btcoex_pins>; - pinctrl-names = "default"; - - btcoex_pins: btcoex_pins { -/* - mux_0 { - pins = "gpio64"; - function = "pta1_1"; - drive-strength = <6>; - bias-pull-down; - }; - mux_1 { - pins = "gpio65"; - function = "pta1_2"; - drive-strength = <6>; - bias-pull-down; - }; - mux_2 { - pins = "gpio66"; - function = "pta1_0"; - drive-strength = <6>; - bias-pull-down; - }; - mux_3 { - pins = "gpio54"; - function = "pta2_0"; - drive-strength = <6>; - bias-pull-down; - }; - mux_4 { - pins = "gpio55"; - function = "pta2_1"; - drive-strength = <6>; - bias-pull-down; - }; - mux_5 { - pins = "gpio56"; - function = "pta2_2"; - drive-strength = <6>; - bias-pull-down; - }; -*/ - mux_0 { - pins = "gpio34"; - function = "gpio"; - drive-strength = <6>; - bias-pull-up; - output-high; - }; - mux_1 { - pins = "gpio62"; - function = "gpio"; - drive-strength = <6>; - bias-pull-up; - output-high; - }; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio68"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio69"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - uart_pins: uart_pins { - mux { - pins = "gpio23", "gpio24"; - function = "blsp4_uart1"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-disable; - }; - }; - - /*spi_3_pins: spi_3_pins { - mux { - pins = "gpio50", "gpio52", "gpio53"; - function = "blsp3_spi"; - drive-strength = <8>; - bias-disable; - }; - spi_cs { - pins = "gpio22"; - function = "blsp3_spi2"; - drive-strength = <8>; - bias-disable; - }; - quartz_interrupt { - pins = "gpio47"; - function = "gpio"; - input; - bias-disable; - }; - quartz_reset { - pins = "gpio21"; - function = "gpio"; - output-low; - bias-disable; - }; - };*/ - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-disable; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-disable; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-disable; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-disable; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-disable; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-disable; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-disable; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-disable; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-disable; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio48", "gpio49"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio67"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - leds_pins: leds_pinmux { - led1_r { - pins = "gpio54"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led1_g { - pins = "gpio55"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led2_r { - pins = "gpio56"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - led2_g { - pins = "gpio64"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - }; - - /*usb_mux_sel_pins: usb_mux_pins { - mux { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - pcie0_pins: pcie_pins { - pcie0_rst { - pins = "gpio58"; - function = "pcie0_rst"; - drive-strength = <8>; - bias-pull-down; - }; - pcie0_wake { - pins = "gpio59"; - function = "pcie0_wake"; - drive-strength = <8>; - bias-pull-down; - }; - };*/ - uniphy_pins: uniphy_pinmux { - mux_2 { - pins = "gpio37"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_3 { - pins = "gpio44"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - -}; - -&soc { - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 67 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&leds_pins>; - pinctrl-names = "default"; - status = "ok"; - - led@54 { - label = "red:lan"; - gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led1_r"; - default-state = "off"; - }; - led@55 { - label = "green:lan"; - gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led1_g"; - default-state = "off"; - }; - led@56 { - label = "red:wan"; - gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led2_r"; - default-state = "off"; - }; - led@64 { - label = "green:wan"; - gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "led2_g"; - default-state = "off"; - }; - }; - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 37 0 &tlmm 44 0>; - phy0: ethernet-phy@0 { - reg = <0x10>; /*<0>*/ - }; - phy1: ethernet-phy@1 { - reg = <0x11>; - }; - phy2: ethernet-phy@2 { - reg = <0x12>; - }; - phy3: ethernet-phy@3 { - reg = <0x13>; - }; - phy4: ethernet-phy@4 { - reg = <0x14>; - }; - phy5: ethernet-phy@5 { - compatible ="ethernet-phy-ieee802.3-c45"; - reg = <0>; - }; - }; - - ess-switch@3a000000 { - pinctrl-0 = <&uniphy_pins>; - pinctrl-names = "default"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x32>; /*..0x3e lan port bitmap */ - switch_wan_bmp = <0x40>; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ - /*qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { - port_id = <5>; - phy_address = <24>; - port_mac_sel = "QGMAC_PORT"; - }; - port@5 { - port_id = <6>; - phy_address = <28>; - port_mac_sel = "QGMAC_PORT"; - }; - };*/ - port_scheduler_resource { - port@0 { - port_id = <0>; - ucast_queue = <0 143>; - mcast_queue = <256 271>; - l0sp = <0 35>; - l0cdrr = <0 47>; - l0edrr = <0 47>; - l1cdrr = <0 7>; - l1edrr = <0 7>; - }; - port@1 { - port_id = <1>; - ucast_queue = <144 159>; - mcast_queue = <272 275>; - l0sp = <36 39>; - l0cdrr = <48 63>; - l0edrr = <48 63>; - l1cdrr = <8 11>; - l1edrr = <8 11>; - }; - port@2 { - port_id = <2>; - ucast_queue = <160 175>; - mcast_queue = <276 279>; - l0sp = <40 43>; - l0cdrr = <64 79>; - l0edrr = <64 79>; - l1cdrr = <12 15>; - l1edrr = <12 15>; - }; - port@3 { - port_id = <3>; - ucast_queue = <176 191>; - mcast_queue = <280 283>; - l0sp = <44 47>; - l0cdrr = <80 95>; - l0edrr = <80 95>; - l1cdrr = <16 19>; - l1edrr = <16 19>; - }; - port@4 { - port_id = <4>; - ucast_queue = <192 207>; - mcast_queue = <284 287>; - l0sp = <48 51>; - l0cdrr = <96 111>; - l0edrr = <96 111>; - l1cdrr = <20 23>; - l1edrr = <20 23>; - }; - port@5 { - port_id = <5>; - ucast_queue = <208 223>; - mcast_queue = <288 291>; - l0sp = <52 55>; - l0cdrr = <112 127>; - l0edrr = <112 127>; - l1cdrr = <24 27>; - l1edrr = <24 27>; - }; - port@6 { - port_id = <6>; - ucast_queue = <224 239>; - mcast_queue = <292 295>; - l0sp = <56 59>; - l0cdrr = <128 143>; - l0edrr = <128 143>; - l1cdrr = <28 31>; - l1edrr = <28 31>; - }; - port@7 { - port_id = <7>; - ucast_queue = <240 255>; - mcast_queue = <296 299>; - l0sp = <60 63>; - l0cdrr = <144 159>; - l0edrr = <144 159>; - l1cdrr = <32 35>; - l1edrr = <32 35>; - }; - }; - port_scheduler_config { - port@0 { - port_id = <0>; - l1scheduler { - group@0 { - sp = <0 1>; /*L0 SPs*/ - /*cpri cdrr epri edrr*/ - cfg = <0 0 0 0>; - }; - }; - l0scheduler { - group@0 { - /*unicast queues*/ - ucast_queue = <0 4 8>; - /*multicast queues*/ - mcast_queue = <256 260>; - /*sp cpri cdrr epri edrr*/ - cfg = <0 0 0 0 0>; - }; - group@1 { - ucast_queue = <1 5 9>; - mcast_queue = <257 261>; - cfg = <0 1 1 1 1>; - }; - group@2 { - ucast_queue = <2 6 10>; - mcast_queue = <258 262>; - cfg = <0 2 2 2 2>; - }; - group@3 { - ucast_queue = <3 7 11>; - mcast_queue = <259 263>; - cfg = <0 3 3 3 3>; - }; - }; - }; - port@1 { - port_id = <1>; - l1scheduler { - group@0 { - sp = <36>; - cfg = <0 8 0 8>; - }; - group@1 { - sp = <37>; - cfg = <1 9 1 9>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <144>; - ucast_loop_pri = <16>; - mcast_queue = <272>; - mcast_loop_pri = <4>; - cfg = <36 0 48 0 48>; - }; - }; - }; - port@2 { - port_id = <2>; - l1scheduler { - group@0 { - sp = <40>; - cfg = <0 12 0 12>; - }; - group@1 { - sp = <41>; - cfg = <1 13 1 13>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <160>; - ucast_loop_pri = <16>; - mcast_queue = <276>; - mcast_loop_pri = <4>; - cfg = <40 0 64 0 64>; - }; - }; - }; - port@3 { - port_id = <3>; - l1scheduler { - group@0 { - sp = <44>; - cfg = <0 16 0 16>; - }; - group@1 { - sp = <45>; - cfg = <1 17 1 17>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <176>; - ucast_loop_pri = <16>; - mcast_queue = <280>; - mcast_loop_pri = <4>; - cfg = <44 0 80 0 80>; - }; - }; - }; - port@4 { - port_id = <4>; - l1scheduler { - group@0 { - sp = <48>; - cfg = <0 20 0 20>; - }; - group@1 { - sp = <49>; - cfg = <1 21 1 21>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <192>; - ucast_loop_pri = <16>; - mcast_queue = <284>; - mcast_loop_pri = <4>; - cfg = <48 0 96 0 96>; - }; - }; - }; - port@5 { - port_id = <5>; - l1scheduler { - group@0 { - sp = <52>; - cfg = <0 24 0 24>; - }; - group@1 { - sp = <53>; - cfg = <1 25 1 25>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <208>; - ucast_loop_pri = <16>; - mcast_queue = <288>; - mcast_loop_pri = <4>; - cfg = <52 0 112 0 112>; - }; - }; - }; - port@6 { - port_id = <6>; - l1scheduler { - group@0 { - sp = <56>; - cfg = <0 28 0 28>; - }; - group@1 { - sp = <57>; - cfg = <1 29 1 29>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <224>; - ucast_loop_pri = <16>; - mcast_queue = <292>; - mcast_loop_pri = <4>; - cfg = <56 0 128 0 128>; - }; - }; - }; - port@7 { - port_id = <7>; - l1scheduler { - group@0 { - sp = <60>; - cfg = <0 32 0 32>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <240>; - mcast_queue = <296>; - cfg = <60 0 144 0 144>; - }; - }; - }; - }; - }; -/* - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <1>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <2>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <3>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a003000 0x3fff>; - qcom,mactype = <1>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <24>; - phy-mode = "sgmii"; - }; - - dp6 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <6>; - reg = <0x3a007000 0x3fff>; - qcom,mactype = <1>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - phy-mode = "sgmii"; - }; -*/ - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - // qcom,id = <1>; - // reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0x13>; - phy-mode = "sgmii"; - }; - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <6>; - reg = <0x3a007000 0x3fff>; - qcom,mactype = <1>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; -/* - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_2g { - label = "led_2g"; - gpio = <&tlmm 42 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_5g { - label = "led_5g"; - gpio = <&tlmm 43 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - }; - - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x18>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; -*/ -}; - -&serial_blsp4 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; -/* -&spi_4 { - pinctrl-0 = <&spi_3_pins>; - pinctrl-names = "default"; - cs-select = <2>; - quartz-reset-gpio = <&tlmm 21 1>; - status = "ok"; - spidev3: spi@3 { - compatible = "qca,spidev"; - reg = <0>; - spi-max-frequency = <24000000>; - }; -};*/ - -&serial_blsp2 { - pinctrl-0 = <&hsuart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&msm_imem { - status = "disabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&ssphy_1 { - status = "ok"; -}; - -&qusb_phy_1 { - status = "ok"; -}; - -&usb3_0 { - status = "ok"; -}; - -&usb3_1 { - status = "ok"; -}; - -&cryptobam { - status = "ok"; -}; - -&crypto { - status = "ok"; -}; - -&i2c_0 { - status = "disabled"; -}; - -&i2c_1 { - status = "disabled"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_lcd { - status = "disabled"; -}; - -&qpic_lcd_panel { - status = "disabled"; -}; - -&ledc { - status = "disabled"; -}; - -&pcie0 { - status = "disabled"; -}; - -&pcie1 { - status = "disabled"; -}; - diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf196.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf196.dts deleted file mode 100644 index 3bbee76c9..000000000 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq807x-wf196.dts +++ /dev/null @@ -1,1048 +0,0 @@ -/dts-v1/; -/* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "qcom-ipq807x-soc.dtsi" -#include "qcom-ipq807x-audio.dtsi" -#include "qcom-ipq807x-hk-cpu.dtsi" - -/ { - #address-cells = <0x2>; - #size-cells = <0x2>; - model = "CIG WF196"; - compatible = "cig,wf196", "qcom,ipq807x"; - qcom,msm-id = <0x187 0x0>; - interrupt-parent = <&intc>; - qcom,board-id = <0x8 0x0>; - qcom,pmic-id = <0x0 0x0 0x0 0x0>; - - aliases { - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = "/soc/dp1"; - ethernet1 = "/soc/dp2"; - ethernet2 = "/soc/dp3"; - ethernet3 = "/soc/dp4"; - ethernet4 = "/soc/dp5"; - ethernet5 = "/soc/dp6"; - - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyMSM0,115200,n8 root=/dev/ram0 rw init=/init"; - #ifdef __IPQ_MEM_PROFILE_256_MB__ - bootargs-append = " swiotlb=1"; - #else - bootargs-append = " swiotlb=1 coherent_pool=2M vmalloc=600M"; - #endif - }; - - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - mcu-enable { - gpio-export,name = "mcu-enable"; - gpio-export,output = <0>; - gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; - }; - }; - - reserved-memory { -/* No Pine attach in 256M profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) -#ifdef __IPQ_MEM_PROFILE_512_MB__ - /* 512 MB Profile - * +========+==============+=========================+ - * | Region | Start Offset | Size | - * +--------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +--------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +--------+--------------+-------------------------+ - * | TZ APP | 0x4A400000 | 1MB | - * +--------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +--------+--------------+-------------------------+ - * | Q6 | 0x4B000000 | 55MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x4E700000 | 1MB | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x4E800000 | 1MB | - * +--------+--------------+-------------------------+ - * | Pine0 | 0x4E900000 | 30MB | - * +--------+--------------+-------------------------+ - * | MHI0 | 0x50700000 | 16MB | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - /delete-node/ wifi_dump@4e900000; - qcn9000_pcie0@4e900000 { - no-map; - reg = <0x0 0x4e900000 0x0 0x01e00000>; - }; - - mhi_region0: dma_pool0@50700000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x50700000 0x0 0x01000000>; - }; -#else - /* Default Profile - * +========+==============+=========================+ - * | Region | Start Offset | Size | - * +--------+--------------+-------------------------+ - * | NSS | 0x40000000 | 16MB | - * +--------+--------------+-------------------------+ - * | Linux | 0x41000000 | Depends on total memory | - * +--------+--------------+-------------------------+ - * | TZ APP | 0x4A400000 | 2MB | - * +--------+--------------+-------------------------+ - * | uboot | 0x4A600000 | 4MB | - * +--------+--------------+-------------------------+ - * | SBL | 0x4AA00000 | 1MB | - * +--------+--------------+-------------------------+ - * | smem | 0x4AB00000 | 1MB | - * +--------+--------------+-------------------------+ - * | TZ | 0x4AC00000 | 4MB | - * +--------+--------------+-------------------------+ - * | Q6 | 0x4B000000 | 95MB | - * +--------+--------------+-------------------------+ - * | QDSS | 0x50F00000 | 1MB | - * +--------+--------------+-------------------------+ - * | M3 Dump| 0x51000000 | 1MB | - * +--------+--------------+-------------------------+ - * | Pine0 | 0x51100000 | 45MB | - * +--------+--------------+-------------------------+ - * | MHI0 | 0x53E00000 | 24MB | - * +--------+--------------+-------------------------+ - * | | - * | Rest of the memory for Linux | - * | | - * +=================================================+ - */ - qcn9000_pcie0@51100000 { - no-map; - reg = <0x0 0x51100000 0x0 0x02D00000>; - }; - /delete-node/ wifi_dump@51100000; - /delete-node/ wigig_dump@51300000; - - mhi_region0: dma_pool0@53e00000 { - compatible = "shared-dma-pool"; - no-map; - reg = <0x0 0x53E00000 0x0 0x01800000>; - }; -#endif -#endif - }; -}; - -&tlmm { - pinctrl-0 = <&mcu_rst>; - pinctrl-names = "default"; - - mcu_rst: mcu_rst_pins { - pins = "gpio34"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-low; - }; - - mdio_pins: mdio_pinmux { - mux_0 { - pins = "gpio68"; - function = "mdc"; - drive-strength = <8>; - bias-pull-up; - }; - mux_1 { - pins = "gpio69"; - function = "mdio"; - drive-strength = <8>; - bias-pull-up; - }; - mux_3 { - pins = "gpio44"; - function = "gpio"; - bias-pull-up; - }; - }; - - uart_pins: uart_pins { - mux { - pins = "gpio23", "gpio24"; - function = "blsp4_uart1"; - drive-strength = <8>; - bias-disable; - }; - }; - - i2c_5_pins: i2c_5_pinmux { - mux { - pins = "gpio0", "gpio2"; - function = "blsp5_i2c"; - drive-strength = <8>; - bias-disable; - }; - }; - - spi_0_pins: spi_0_pins { - mux { - pins = "gpio38", "gpio39", "gpio40", "gpio41"; - function = "blsp0_spi"; - drive-strength = <8>; - bias-disable; - }; - }; - - qpic_pins: qpic_pins { - data_0 { - pins = "gpio15"; - function = "qpic_pad0"; - drive-strength = <8>; - bias-disable; - }; - data_1 { - pins = "gpio12"; - function = "qpic_pad1"; - drive-strength = <8>; - bias-disable; - }; - data_2 { - pins = "gpio13"; - function = "qpic_pad2"; - drive-strength = <8>; - bias-disable; - }; - data_3 { - pins = "gpio14"; - function = "qpic_pad3"; - drive-strength = <8>; - bias-disable; - }; - data_4 { - pins = "gpio5"; - function = "qpic_pad4"; - drive-strength = <8>; - bias-disable; - }; - data_5 { - pins = "gpio6"; - function = "qpic_pad5"; - drive-strength = <8>; - bias-disable; - }; - data_6 { - pins = "gpio7"; - function = "qpic_pad6"; - drive-strength = <8>; - bias-disable; - }; - data_7 { - pins = "gpio8"; - function = "qpic_pad7"; - drive-strength = <8>; - bias-disable; - }; - qpic_pad { - pins = "gpio1", "gpio3", "gpio4", - "gpio10", "gpio11", "gpio17"; - function = "qpic_pad"; - drive-strength = <8>; - bias-disable; - }; - }; - - hsuart_pins: hsuart_pins { - mux { - pins = "gpio48", "gpio49"; - function = "blsp2_uart"; - drive-strength = <8>; - bias-disable; - }; - }; - - button_pins: button_pins { - wps_button { - pins = "gpio67"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; - }; - - led_pins: led_pins { - led_red { - pins = "gpio25"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_green { - pins = "gpio26"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - - led_blue { - pins = "gpio27"; - function = "gpio"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - pcie0_pins: pcie_pins { - pcie0_rst { - pins = "gpio58"; - function = "pcie0_rst"; - drive-strength = <8>; - bias-pull-down; - }; - pcie0_wake { - pins = "gpio59"; - function = "pcie0_wake"; - drive-strength = <8>; - bias-pull-down; - }; - }; - - pwm_pins: pwm_pinmux { - mux_1 { - pins = "gpio25"; - function = "pwm02"; - drive-strength = <8>; - }; - mux_2 { - pins = "gpio26"; - function = "pwm12"; - drive-strength = <8>; - }; - mux_3 { - pins = "gpio27"; - function = "pwm22"; - drive-strength = <8>; - }; - }; -}; - -&soc { - pwm { - pinctrl-0 = <&pwm_pins>; - pinctrl-names = "default"; - used-pwm-indices = <1>, <1>, <1>, <0>; - // status = "ok"; - }; - gpio_keys { - compatible = "gpio-keys"; - pinctrl-0 = <&button_pins>; - pinctrl-names = "default"; - - button@1 { - label = "reset"; - linux,code = ; - gpios = <&tlmm 67 GPIO_ACTIVE_LOW>; - linux,input-type = <1>; - debounce-interval = <60>; - }; - }; - - mdio: mdio@90000 { - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - phy-reset-gpio = <&tlmm 64 0 &tlmm 66 0>; - compatible = "qcom,ipq40xx-mdio", "qcom,qca-mdio"; - phy0: ethernet-phy@0 { - reg = <16>; - }; - phy1: ethernet-phy@1 { - reg = <17>; - }; - phy2: ethernet-phy@2 { - reg = <18>; - }; - phy3: ethernet-phy@3 { - reg = <19>; - }; - phy4: ethernet-phy@4 { - compatible ="ethernet-phy-ieee802.3-c45"; - reg = <0>; - }; - phy5: ethernet-phy@5 { - reg = <28>; - }; - }; - - ess-switch@3a000000 { - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0xc0>; /* wan port bitmap */ - switch_mac_mode = <0xff>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xd>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ - qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <16>; - }; - port@1 { - port_id = <2>; - phy_address = <17>; - }; - port@2 { - port_id = <3>; - phy_address = <18>; - }; - port@3 { - port_id = <4>; - phy_address = <19>; - }; - port@4 { - port_id = <5>; - phy_address = <0>; - port_mac_sel = "QGMAC_PORT"; - ethernet-phy-ieee802.3-c45; - }; - port@5 { - port_id = <6>; - phy_address = <28>; - port_mac_sel = "QGMAC_PORT"; - }; - }; - port_scheduler_resource { - port@0 { - port_id = <0>; - ucast_queue = <0 143>; - mcast_queue = <256 271>; - l0sp = <0 35>; - l0cdrr = <0 47>; - l0edrr = <0 47>; - l1cdrr = <0 7>; - l1edrr = <0 7>; - }; - port@1 { - port_id = <1>; - ucast_queue = <144 159>; - mcast_queue = <272 275>; - l0sp = <36 39>; - l0cdrr = <48 63>; - l0edrr = <48 63>; - l1cdrr = <8 11>; - l1edrr = <8 11>; - }; - port@2 { - port_id = <2>; - ucast_queue = <160 175>; - mcast_queue = <276 279>; - l0sp = <40 43>; - l0cdrr = <64 79>; - l0edrr = <64 79>; - l1cdrr = <12 15>; - l1edrr = <12 15>; - }; - port@3 { - port_id = <3>; - ucast_queue = <176 191>; - mcast_queue = <280 283>; - l0sp = <44 47>; - l0cdrr = <80 95>; - l0edrr = <80 95>; - l1cdrr = <16 19>; - l1edrr = <16 19>; - }; - port@4 { - port_id = <4>; - ucast_queue = <192 207>; - mcast_queue = <284 287>; - l0sp = <48 51>; - l0cdrr = <96 111>; - l0edrr = <96 111>; - l1cdrr = <20 23>; - l1edrr = <20 23>; - }; - port@5 { - port_id = <5>; - ucast_queue = <208 223>; - mcast_queue = <288 291>; - l0sp = <52 55>; - l0cdrr = <112 127>; - l0edrr = <112 127>; - l1cdrr = <24 27>; - l1edrr = <24 27>; - }; - port@6 { - port_id = <6>; - ucast_queue = <224 239>; - mcast_queue = <292 295>; - l0sp = <56 59>; - l0cdrr = <128 143>; - l0edrr = <128 143>; - l1cdrr = <28 31>; - l1edrr = <28 31>; - }; - port@7 { - port_id = <7>; - ucast_queue = <240 255>; - mcast_queue = <296 299>; - l0sp = <60 63>; - l0cdrr = <144 159>; - l0edrr = <144 159>; - l1cdrr = <32 35>; - l1edrr = <32 35>; - }; - }; - port_scheduler_config { - port@0 { - port_id = <0>; - l1scheduler { - group@0 { - sp = <0 1>; /*L0 SPs*/ - /*cpri cdrr epri edrr*/ - cfg = <0 0 0 0>; - }; - }; - l0scheduler { - group@0 { - /*unicast queues*/ - ucast_queue = <0 4 8>; - /*multicast queues*/ - mcast_queue = <256 260>; - /*sp cpri cdrr epri edrr*/ - cfg = <0 0 0 0 0>; - }; - group@1 { - ucast_queue = <1 5 9>; - mcast_queue = <257 261>; - cfg = <0 1 1 1 1>; - }; - group@2 { - ucast_queue = <2 6 10>; - mcast_queue = <258 262>; - cfg = <0 2 2 2 2>; - }; - group@3 { - ucast_queue = <3 7 11>; - mcast_queue = <259 263>; - cfg = <0 3 3 3 3>; - }; - }; - }; - port@1 { - port_id = <1>; - l1scheduler { - group@0 { - sp = <36>; - cfg = <0 8 0 8>; - }; - group@1 { - sp = <37>; - cfg = <1 9 1 9>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <144>; - ucast_loop_pri = <16>; - mcast_queue = <272>; - mcast_loop_pri = <4>; - cfg = <36 0 48 0 48>; - }; - }; - }; - port@2 { - port_id = <2>; - l1scheduler { - group@0 { - sp = <40>; - cfg = <0 12 0 12>; - }; - group@1 { - sp = <41>; - cfg = <1 13 1 13>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <160>; - ucast_loop_pri = <16>; - mcast_queue = <276>; - mcast_loop_pri = <4>; - cfg = <40 0 64 0 64>; - }; - }; - }; - port@3 { - port_id = <3>; - l1scheduler { - group@0 { - sp = <44>; - cfg = <0 16 0 16>; - }; - group@1 { - sp = <45>; - cfg = <1 17 1 17>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <176>; - ucast_loop_pri = <16>; - mcast_queue = <280>; - mcast_loop_pri = <4>; - cfg = <44 0 80 0 80>; - }; - }; - }; - port@4 { - port_id = <4>; - l1scheduler { - group@0 { - sp = <48>; - cfg = <0 20 0 20>; - }; - group@1 { - sp = <49>; - cfg = <1 21 1 21>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <192>; - ucast_loop_pri = <16>; - mcast_queue = <284>; - mcast_loop_pri = <4>; - cfg = <48 0 96 0 96>; - }; - }; - }; - port@5 { - port_id = <5>; - l1scheduler { - group@0 { - sp = <52>; - cfg = <0 24 0 24>; - }; - group@1 { - sp = <53>; - cfg = <1 25 1 25>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <208>; - ucast_loop_pri = <16>; - mcast_queue = <288>; - mcast_loop_pri = <4>; - cfg = <52 0 112 0 112>; - }; - }; - }; - port@6 { - port_id = <6>; - l1scheduler { - group@0 { - sp = <56>; - cfg = <0 28 0 28>; - }; - group@1 { - sp = <57>; - cfg = <1 29 1 29>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <224>; - ucast_loop_pri = <16>; - mcast_queue = <292>; - mcast_loop_pri = <4>; - cfg = <56 0 128 0 128>; - }; - }; - }; - port@7 { - port_id = <7>; - l1scheduler { - group@0 { - sp = <60>; - cfg = <0 32 0 32>; - }; - group@1 { - sp = <61>; - cfg = <1 33 1 33>; - }; - }; - l0scheduler { - group@0 { - ucast_queue = <240>; - ucast_loop_pri = <16>; - mcast_queue = <296>; - cfg = <60 0 144 0 144>; - }; - }; - }; - }; - }; - - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <1>; - reg = <0x3a001000 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <16>; - phy-mode = "sgmii"; - }; - - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <2>; - reg = <0x3a001200 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <17>; - phy-mode = "sgmii"; - }; - - dp3 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <3>; - reg = <0x3a001400 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <18>; - phy-mode = "sgmii"; - }; - - dp4 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <4>; - reg = <0x3a001600 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <19>; - phy-mode = "sgmii"; - }; - - dp5 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <5>; - reg = <0x3a001800 0x200>; - qcom,mactype = <1>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <0>; - phy-mode = "sgmii"; - }; - - dp6 { - device_type = "network"; - compatible = "qcom,nss-dp"; - qcom,id = <6>; - reg = <0x3a001a00 0x200>; - qcom,mactype = <0>; - local-mac-address = [000000000000]; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <28>; - phy-mode = "sgmii"; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_red { - label = "red:status"; - gpio = <&tlmm 25 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_power: led_green { - label = "green:status"; - gpio = <&tlmm 26 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - - led_blue { - label = "blue:status"; - gpio = <&tlmm 27 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - }; - nss-macsec0 { - compatible = "qcom,nss-macsec"; - phy_addr = <0>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - nss-macsec1 { - compatible = "qcom,nss-macsec"; - phy_addr = <0x1c>; - phy_access_mode = <0>; - mdiobus = <&mdio>; - }; - i2c_5: i2c@78ba000 { - compatible = "qcom,i2c-qup-v2.2.1"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x78ba000 0x600>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_AHB_CLK>, - <&gcc GCC_BLSP1_QUP6_I2C_APPS_CLK>; - clock-names = "iface", "core"; - clock-frequency = <100000>; - dmas = <&blsp_dma 23>, <&blsp_dma 22>; - dma-names = "rx", "tx"; - }; -}; - -&serial_blsp4 { - pinctrl-0 = <&uart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&spi_0 { /* BLSP1 QUP1 */ - pinctrl-0 = <&spi_0_pins>; - pinctrl-names = "default"; - cs-select = <0>; - status = "ok"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - compatible = "n25q128a11"; - linux,modalias = "m25p80", "n25q128a11"; - spi-max-frequency = <50000000>; - use-default-sizes; - }; -}; - -&serial_blsp2 { - pinctrl-0 = <&hsuart_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&msm_imem { - status = "disabled"; -}; - -&ssphy_0 { - status = "ok"; -}; - -&qusb_phy_0 { - status = "ok"; -}; - -&usb3_0 { - status = "ok"; -}; - -&cryptobam { - status = "ok"; -}; - -&crypto { - status = "ok"; -}; - -&i2c_0 { - status = "disabled"; -}; - -&i2c_1 { - status = "disabled"; -}; - -&i2c_5 { - pinctrl-0 = <&i2c_5_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_bam { - status = "ok"; -}; - -&nand { - pinctrl-0 = <&qpic_pins>; - pinctrl-names = "default"; - status = "ok"; -}; - -&qpic_lcd { - status = "disabled"; -}; - -&qpic_lcd_panel { - status = "disabled"; -}; - -&pcie0 { - status = "ok"; -}; - - -&pcie0_rp { - status = "ok"; - - mhi_0: qcom,mhi@0 { - reg = <0 0 0 0 0 >; - qrtr_instance_id = <0x20>; - #address-cells = <0x2>; - #size-cells = <0x2>; -#if !defined(__IPQ_MEM_PROFILE_256_MB__) - memory-region = <&mhi_region0>; -#endif - -#if !defined(__CNSS2__) - base-addr = <0x51100000>; - m3-dump-addr = <0x53400000>; - etr-addr = <0x53500000>; - qcom,caldb-addr = <0x53600000>; - mhi,max-channels = <30>; - mhi,timeout = <10000>; - qcom,board_id= <0xa4>; - - pcie0_mhi: pcie0_mhi { - status = "ok"; - }; -#endif - }; -}; - -&pcie1_rp { - status = "disabled"; - - mhi_1: qcom,mhi@1 { - pcie1_mhi: pcie1_mhi { - status = "disabled"; - }; - }; -}; - -&npu_cpr { - status = "disabled"; -}; - -&nss0 { - npu-supply = <&dummy_reg>; - mx-supply = <&dummy_reg>; -}; - -#ifndef __IPQ_MEM_PROFILE_256_MB__ -&nss1 { - npu-supply = <&dummy_reg>; - mx-supply = <&dummy_reg>; -}; -#endif - -&wifi1 { - qcom,board_id = <0x294>; - status = "ok"; -}; - -/* No support for QCN9000 in 256M profile */ -#if !defined(__IPQ_MEM_PROFILE_256_MB__) -&wifi2 { -#ifdef __IPQ_MEM_PROFILE_512_MB__ - /* QCN9000 tgt-mem-mode=1 layout - 30MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x4E900000 | 20MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x4FD00000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x4FE00000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x4FF00000 | 8MB | - * +==================================+ - */ - base-addr = <0x4E900000>; - m3-dump-addr = <0x4FD00000>; - etr-addr = <0x4FE00000>; - caldb-addr = <0x4FF00000>; - hremote-size = <0x1400000>; - tgt-mem-mode = <0x1>; -#else - /* QCN9000 tgt-mem-mode=0 layout - 45MB - * +=========+==============+=========+ - * | Region | Start Offset | Size | - * +---------+--------------+---------+ - * | HREMOTE | 0x51100000 | 35MB | - * +---------+--------------+---------+ - * | M3 Dump | 0x53400000 | 1MB | - * +---------+--------------+---------+ - * | ETR | 0x53500000 | 1MB | - * +---------+--------------+---------+ - * | Caldb | 0x53600000 | 8MB | - * +==================================+ - */ - base-addr = <0x51100000>; - m3-dump-addr = <0x53400000>; - etr-addr = <0x53500000>; - caldb-addr = <0x53600000>; - hremote-size = <0x2300000>; - tgt-mem-mode = <0x0>; -#endif - caldb-size = <0x800000>; - board_id = <0xa4>; - status = "ok"; -#if defined(__CNSS2__) - pcie0_mhi: pcie0_mhi { - status = "ok"; - }; -#endif -}; -&wifi3 { - status = "disabled"; -}; - -#include "qcom-ipq807x-mhi.dtsi" -#endif diff --git a/feeds/ipq807x/ipq807x/image/Makefile b/feeds/ipq807x/ipq807x/image/Makefile deleted file mode 100644 index 3a219e6d6..000000000 --- a/feeds/ipq807x/ipq807x/image/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk - -IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD) - -# default all platform image(fit) build -define Device/Default - PROFILES = Default $$(DEVICE_NAME) - KERNEL_NAME := zImage - FILESYSTEMS := squashfs - DEVICE_DTS_DIR := $(DTS_DIR) - KERNEL_IN_UBI := 1 - ROOTFSNAME_IN_UBI := ubi_rootfs - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGES := sysupgrade.tar nand-factory.bin - IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - KERNEL_NAME := Image - KERNEL = kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb - KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb -endef - -include $(SUBTARGET).mk - -$(eval $(call BuildImage)) diff --git a/feeds/ipq807x/ipq807x/image/ipq50xx.mk b/feeds/ipq807x/ipq807x/image/ipq50xx.mk deleted file mode 100644 index 572c035b2..000000000 --- a/feeds/ipq807x/ipq807x/image/ipq50xx.mk +++ /dev/null @@ -1,220 +0,0 @@ -KERNEL_LOADADDR := 0x41208000 - -define Device/FitImage - KERNEL_SUFFIX := -uImage.itb - KERNEL = kernel-bin | libdeflate-gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/FitImageLzma - KERNEL_SUFFIX := -uImage.itb - KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/UbiFit - KERNEL_IN_UBI := 1 - IMAGES := factory.ubi sysupgrade.bin - IMAGE/factory.ubi := append-ubi - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata -endef - -define Device/cig_wf186w - DEVICE_TITLE := Cigtech WF-186w - DEVICE_DTS := qcom-ipq5018-cig-wf186w - SUPPORTED_DEVICES := cig,wf186w - DEVICE_PACKAGES := ath11k-wifi-cig-wf186w ath11k-firmware-ipq50xx-map-spruce - DEVICE_DTS_CONFIG := config@mp03.3 -endef -TARGET_DEVICES += cig_wf186w - -define Device/cig_wf186h - DEVICE_TITLE := Cigtech WF-186h - DEVICE_DTS := qcom-ipq5018-cig-wf186h - SUPPORTED_DEVICES := cig,wf186h - DEVICE_PACKAGES := ath11k-wifi-cig-wf186h ath11k-firmware-ipq50xx-map-spruce - DEVICE_DTS_CONFIG := config@mp03.3 -endef -TARGET_DEVICES += cig_wf186h - -define Device/cybertan_eww622_a1 - DEVICE_TITLE := CyberTan EWW622-A1 - DEVICE_DTS := qcom-ipq5018-eww622-a1 - SUPPORTED_DEVICES := cybertan,eww622-a1 - DEVICE_PACKAGES := ath11k-wifi-cybertan-eww622-a1 ath11k-firmware-ipq50xx ath11k-firmware-qcn9000 - DEVICE_DTS_CONFIG := config@mp03.1 -endef -TARGET_DEVICES += cybertan_eww622_a1 - -define Device/cybertan_eww631_a1 - DEVICE_TITLE := CyberTan EWW631-A1 - DEVICE_DTS := qcom-ipq5018-eww631-a1 - SUPPORTED_DEVICES := cybertan,eww631-a1 - DEVICE_PACKAGES := ath11k-wifi-cybertan-eww631-a1 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.5-c1 -endef -TARGET_DEVICES += cybertan_eww631_a1 - -define Device/wallys_dr5018 - DEVICE_TITLE := Wallys DR5018 - DEVICE_DTS := qcom-ipq5018-wallys-dr5018 - SUPPORTED_DEVICES := wallys,dr5018 - DEVICE_PACKAGES := ath11k-wifi-wallys-dr5018 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.5-c1 -endef -TARGET_DEVICES += wallys_dr5018 - -define Device/cybertan_eww631_b1 - DEVICE_TITLE := CyberTan EWW631-B1 - DEVICE_DTS := qcom-ipq5018-eww631-b1 - SUPPORTED_DEVICES := cybertan,eww631-b1 - DEVICE_PACKAGES := ath11k-wifi-cybertan-eww631-b1 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.5-c1 -endef -TARGET_DEVICES += cybertan_eww631_b1 - -define Device/edgecore_eap104 - DEVICE_TITLE := EdgeCore EAP104 - DEVICE_DTS := qcom-ipq5018-eap104 - SUPPORTED_DEVICES := edgecore,eap104 - DEVICE_PACKAGES := ath11k-wifi-edgecore-eap104 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.5-c1 -endef -TARGET_DEVICES += edgecore_eap104 - -define Device/liteon_wpx8324 - DEVICE_TITLE := Liteon WPX8324 - DEVICE_DTS := qcom-ipq5018-liteon-wpx8324 - SUPPORTED_DEVICES := liteon,wpx8324 - DEVICE_PACKAGES := ath11k-wifi-liteon-wpx8324 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.5-c1 -endef -TARGET_DEVICES += liteon_wpx8324 - -define Device/muxi_ap3220l - DEVICE_TITLE := MUXI AP3220L - DEVICE_DTS := qcom-ipq5018-muxi-ap3220l - SUPPORTED_DEVICES := muxi,ap3220l - DEVICE_PACKAGES := ath11k-wifi-muxi-ap3220l ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.5-c1 -endef -TARGET_DEVICES += muxi_ap3220l - -define Device/motorola_q14 - DEVICE_TITLE := Motorola Q14 - DEVICE_DTS := qcom-ipq5018-q14 - SUPPORTED_DEVICES := motorola,q14 - DEVICE_PACKAGES := ath11k-wifi-motorola-q14 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.5-c1 - IMAGES := sysupgrade.tar mmc-factory.bin - IMAGE/mmc-factory.bin := append-ubi | qsdk-ipq-factory-mmc -endef -TARGET_DEVICES += motorola_q14 - -define Device/qcom_mp03_1 - DEVICE_TITLE := Qualcomm Maple 03.1 - DEVICE_DTS := qcom-ipq5018-mp03.1 - SUPPORTED_DEVICES := qcom,ipq5018-mp03.1 - DEVICE_PACKAGES := ath11k-wifi-qcom-ipq5018 - DEVICE_DTS_CONFIG := config@mp03.1 -endef -TARGET_DEVICES += qcom_mp03_1 - -define Device/qcom_mp03_3 - DEVICE_TITLE := Qualcomm Maple 03.3 - DEVICE_DTS := qcom-ipq5018-mp03.3 - SUPPORTED_DEVICES := qcom,ipq5018-mp03.3 - DEVICE_PACKAGES := ath11k-wifi-qcom-ipq5018 - DEVICE_DTS_CONFIG := config@mp03.3 -endef -TARGET_DEVICES += qcom_mp03_3 - -define Device/hfcl_ion4xi_w - DEVICE_TITLE := HFCL ION4xi_w - DEVICE_DTS := qcom-ipq5018-hfcl-ion4xi_w - SUPPORTED_DEVICES := hfcl,ion4xi_w - DEVICE_PACKAGES := ath11k-wifi-hfcl-ion4xi_w ath11k-firmware-ipq50xx-map-spruce - DEVICE_DTS_CONFIG := config@mp03.3 -endef -TARGET_DEVICES += hfcl_ion4xi_w - -define Device/hfcl_ion4x_w - DEVICE_TITLE := HFCL ION4x_w - DEVICE_DTS := qcom-ipq5018-hfcl-ion4x_w - SUPPORTED_DEVICES := hfcl,ion4x_w - DEVICE_PACKAGES := ath11k-wifi-hfcl-ion4x_w ath11k-firmware-ipq50xx-map-spruce - DEVICE_DTS_CONFIG := config@mp03.3 -endef -TARGET_DEVICES += hfcl_ion4x_w - -define Device/hfcl_ion4xi_HMR - DEVICE_TITLE := HFCL ION4xi_HMR - DEVICE_DTS := qcom-ipq5018-hfcl-ion4xi_HMR - SUPPORTED_DEVICES := hfcl,ion4xi_HMR - DEVICE_PACKAGES := ath11k-wifi-hfcl-ion4xi_HMR ath11k-firmware-ipq50xx-map-spruce - DEVICE_DTS_CONFIG := config@mp03.3 -endef -TARGET_DEVICES += hfcl_ion4xi_HMR - -define Device/yuncore_fap655 - DEVICE_TITLE := Yuncore FAP650 - DEVICE_DTS := qcom-ipq5018-yuncore-fap655 - SUPPORTED_DEVICES := yuncore,fap655 - DEVICE_PACKAGES := ath11k-wifi-yuncore-fap655 ath11k-firmware-ipq50xx-map-spruce -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 - DEVICE_DTS_CONFIG := config@mp03.3 -endef -TARGET_DEVICES += yuncore_fap655 - -define Device/optimcloud_d50-5g - DEVICE_TITLE := OptimCloud D50-5G - DEVICE_DTS := qcom-ipq5018-optimcloud-d50-5g - SUPPORTED_DEVICES := optimcloud,d50-5g - DEVICE_PACKAGES := ath11k-wifi-optimcloud-d50 ath11k-firmware-ipq50xx ath11k-firmware-qcn9000 - DEVICE_DTS_CONFIG := config@mp03.1 - IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi - IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - IMAGE/nand-factory.ubi := append-ubi -endef -TARGET_DEVICES += optimcloud_d50-5g - -define Device/optimcloud_d50 - DEVICE_TITLE := OptimCloud D50 - DEVICE_DTS := qcom-ipq5018-optimcloud-d50 - SUPPORTED_DEVICES := optimcloud,d50 - DEVICE_PACKAGES := ath11k-wifi-optimcloud-d50 ath11k-firmware-ipq50xx ath11k-firmware-qcn9000 ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.1 - IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi - IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - IMAGE/factory.ubi := append-ubi | qsdk-ipq-factory-nand - IMAGE/nand-factory.ubi := append-ubi | qsdk-ipq-factory-nand -endef -TARGET_DEVICES += optimcloud_d50 - -define Device/optimcloud_d60-5g - DEVICE_TITLE := OptimCloud D60-5G - DEVICE_DTS := qcom-ipq5018-optimcloud-d60-5g - SUPPORTED_DEVICES := optimcloud,d60-5g - DEVICE_PACKAGES := ath11k-wifi-optimcloud-d60 ath11k-firmware-ipq50xx ath11k-firmware-qcn9000 - DEVICE_DTS_CONFIG := config@mp03.1 - IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi - IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - IMAGE/nand-factory.ubi := append-ubi -endef -TARGET_DEVICES += optimcloud_d60-5g - -define Device/optimcloud_d60 - DEVICE_TITLE := OptimCloud D60 - DEVICE_DTS := qcom-ipq5018-optimcloud-d60 - SUPPORTED_DEVICES := optimcloud,d60 - DEVICE_PACKAGES := ath11k-wifi-optimcloud-d60 ath11k-firmware-ipq50xx ath11k-firmware-qcn9000 ath11k-firmware-qcn6122 - DEVICE_DTS_CONFIG := config@mp03.1 - IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi - IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - IMAGE/factory.ubi := append-ubi | qsdk-ipq-factory-nand - IMAGE/nand-factory.ubi := append-ubi | qsdk-ipq-factory-nand - endef - TARGET_DEVICES += optimcloud_d60 diff --git a/feeds/ipq807x/ipq807x/image/ipq60xx.mk b/feeds/ipq807x/ipq807x/image/ipq60xx.mk deleted file mode 100644 index e59320b5b..000000000 --- a/feeds/ipq807x/ipq807x/image/ipq60xx.mk +++ /dev/null @@ -1,226 +0,0 @@ -KERNEL_LOADADDR := 0x41008000 - -DEVICE_VARS += CE_TYPE - -define Device/cig_wf660a - DEVICE_TITLE := Cigtech WF-660a - DEVICE_DTS := qcom-ipq6018-cig-wf660a - SUPPORTED_DEVICES := cig,wf660a - DEVICE_DTS_CONFIG := config@cp01-c1 - DEVICE_PACKAGES := ath11k-wifi-cig-wf660a uboot-env uboot-envtools - IMAGES := sysupgrade.tar mmc-factory.bin - IMAGE/mmc-factory.bin := append-ubi | qsdk-ipq-factory-mmc -endef -TARGET_DEVICES += cig_wf660a - -define Device/cig_wf188n-ca - DEVICE_TITLE := Cigtech WF-188n - DEVICE_DTS := qcom-ipq6018-cig-wf188n - DEVICE_DTS_CONFIG := config@cp03-c1 - SUPPORTED_DEVICES := cig,wf188n - DEVICE_PACKAGES := ath11k-wifi-cig-wf188n-ca uboot-env -endef -TARGET_DEVICES += cig_wf188n-ca - -define Device/cig_wf188n-us - DEVICE_TITLE := Cigtech WF-188n - DEVICE_DTS := qcom-ipq6018-cig-wf188n - DEVICE_DTS_CONFIG := config@cp03-c1 - SUPPORTED_DEVICES := cig,wf188n - DEVICE_PACKAGES := ath11k-wifi-cig-wf188n-us uboot-env -endef -TARGET_DEVICES += cig_wf188n-us - -define Device/hfcl_ion4xe - DEVICE_TITLE := HFCL ION4Xe - DEVICE_DTS := qcom-ipq6018-hfcl-ion4xe - DEVICE_DTS_CONFIG := config@cp01-c1 - SUPPORTED_DEVICES := hfcl,ion4xe - DEVICE_PACKAGES := ath11k-wifi-qcom-ipq6018 uboot-envtools -endef -TARGET_DEVICES += hfcl_ion4xe - -define Device/hfcl_ion4x - DEVICE_TITLE := HFCL ION4X - DEVICE_DTS := qcom-ipq6018-hfcl-ion4x - DEVICE_DTS_CONFIG := config@cp01-c1 - SUPPORTED_DEVICES := hfcl,ion4x - DEVICE_PACKAGES := ath11k-wifi-qcom-ipq6018 uboot-envtools -endef -TARGET_DEVICES += hfcl_ion4x - -define Device/hfcl_ion4x_2 - DEVICE_TITLE := HFCL ION4X_2 - DEVICE_DTS := qcom-ipq6018-hfcl-ion4x_2 - DEVICE_DTS_CONFIG := config@cp01-c1 - SUPPORTED_DEVICES := hfcl,ion4x_2 - DEVICE_PACKAGES := ath11k-wifi-qcom-ipq6018 uboot-envtools -endef -TARGET_DEVICES += hfcl_ion4x_2 - -define Device/hfcl_ion4xi - DEVICE_TITLE := HFCL ION4Xi - DEVICE_DTS := qcom-ipq6018-hfcl-ion4xi - DEVICE_DTS_CONFIG := config@cp01-c1 - SUPPORTED_DEVICES := hfcl,ion4xi - DEVICE_PACKAGES := ath11k-wifi-hfcl-ion4xi uboot-envtools -endef -TARGET_DEVICES += hfcl_ion4xi - -define Device/hfcl_ion4xi_wp - DEVICE_TITLE := HFCL ION4Xi_WP - DEVICE_DTS := qcom-ipq6018-hfcl-ion4xi_wp - DEVICE_DTS_CONFIG := config@cp01-c1 - SUPPORTED_DEVICES := hfcl,ion4xi_wp - DEVICE_PACKAGES := ath11k-wifi-hfcl-ion4xi_wp uboot-envtools -endef -TARGET_DEVICES += hfcl_ion4xi_wp - -define Device/edgecore_eap101 - DEVICE_TITLE := EdgeCore EAP101 - DEVICE_DTS := qcom-ipq6018-edgecore-eap101 - DEVICE_DTS_CONFIG := config@cp01-c1 - SUPPORTED_DEVICES := edgecore,eap101 - DEVICE_PACKAGES := ath11k-wifi-edgecore-eap101 uboot-envtools -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 kmod-usb2 -endef -TARGET_DEVICES += edgecore_eap101 - -define Device/indio_um-310ax-v1 - DEVICE_TITLE := Indio UM-310AX V1 - DEVICE_DTS := qcom-ipq6018-indio-um-310ax-v1 - DEVICE_DTS_CONFIG := config@cp03-c1 - SUPPORTED_DEVICES := indio,um-310ax-v1 - DEVICE_PACKAGES := ath11k-wifi-indio-um-310ax-v1 uboot-env -endef -TARGET_DEVICES += indio_um-310ax-v1 - -define Device/indio_um-510axp-v1 - DEVICE_TITLE := Indio UM-510AXP V1 - DEVICE_DTS := qcom-ipq6018-indio-um-510axp-v1 - DEVICE_DTS_CONFIG := config@cp03-c1 - SUPPORTED_DEVICES := indio,um-510axp-v1 - DEVICE_PACKAGES := ath11k-wifi-indio-um-510axp-v1 uboot-env -endef -TARGET_DEVICES += indio_um-510axp-v1 - -define Device/indio_um-510axm-v1 - DEVICE_TITLE := Indio UM-510AXM V1 - DEVICE_DTS := qcom-ipq6018-indio-um-510axm-v1 - DEVICE_DTS_CONFIG := config@cp03-c1 - SUPPORTED_DEVICES := indio,um-510axm-v1 - DEVICE_PACKAGES := ath11k-wifi-indio-um-510axm-v1 uboot-env -endef -TARGET_DEVICES += indio_um-510axm-v1 - -define Device/wallys_dr6018 - DEVICE_TITLE := Wallys DR6018 - DEVICE_DTS := qcom-ipq6018-wallys-dr6018 - DEVICE_DTS_CONFIG := config@cp01-c4 - SUPPORTED_DEVICES := wallys,dr6018 - DEVICE_PACKAGES := ath11k-wifi-wallys-dr6018 uboot-envtools -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 kmod-usb2 -endef -TARGET_DEVICES += wallys_dr6018 - -define Device/wallys_dr6018_v4 - DEVICE_TITLE := Wallys DR6018 V4 - DEVICE_DTS := qcom-ipq6018-wallys-dr6018-v4 - DEVICE_DTS_CONFIG := config@cp01-c4 - SUPPORTED_DEVICES := wallys,dr6018-v4 - DEVICE_PACKAGES := ath11k-wifi-wallys-dr6018-v4 uboot-envtools ath11k-firmware-qcn9000 -endef -TARGET_DEVICES += wallys_dr6018_v4 - -define Device/qcom_cp01_c1 - DEVICE_TITLE := Qualcomm Cypress C1 - DEVICE_DTS := qcom-ipq6018-cp01-c1 - SUPPORTED_DEVICES := qcom,ipq6018-cp01 - DEVICE_PACKAGES := ath11k-wifi-qcom-ipq6018 -endef -TARGET_DEVICES += qcom_cp01_c1 - -define Device/glinet_ax1800 - DEVICE_TITLE := GL-iNet AX1800 - DEVICE_DTS := qcom-ipq6018-gl-ax1800 - SUPPORTED_DEVICES := glinet,ax1800 - DEVICE_DTS_CONFIG := config@cp03-c1 - DEVICE_PACKAGES := ath11k-wifi-gl-ax1800 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 -endef -TARGET_DEVICES += glinet_ax1800 - -define Device/glinet_axt1800 - DEVICE_TITLE := GL-iNet AXT1800 - DEVICE_DTS := qcom-ipq6018-gl-axt1800 - SUPPORTED_DEVICES := glinet,axt1800 - DEVICE_DTS_CONFIG := config@cp03-c1 - DEVICE_PACKAGES := ath11k-wifi-gl-axt1800 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 -endef -TARGET_DEVICES += glinet_axt1800 - -define Device/yuncore_ax840 - DEVICE_TITLE := YunCore AX840 - DEVICE_DTS := qcom-ipq6018-yuncore-ax840 - DEVICE_DTS_CONFIG := config@cp03-c1 - SUPPORTED_DEVICES := yuncore,ax840 - DEVICE_PACKAGES := ath11k-wifi-yuncore-ax840 uboot-env -endef -TARGET_DEVICES += yuncore_ax840 - -define Device/plasmacloud_common_64k - DEVICE_PACKAGES := uboot-envtools - CE_TYPE := - BLOCKSIZE := 64k - IMAGES := sysupgrade.tar factory.bin - IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=$$$$(CE_TYPE) - IMAGE/sysupgrade.tar := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - KERNEL += | pad-to $$(BLOCKSIZE) -endef - -define Device/plasmacloud_pax1800-v1 - $(Device/plasmacloud_common_64k) - DEVICE_TITLE := Plasma Cloud PAX1800 v1 - DEVICE_DTS := qcom-ipq6018-pax1800-v1 - SUPPORTED_DEVICES := plasmacloud,pax1800-v1 - DEVICE_DTS_CONFIG := config@cp03-c1 - CE_TYPE := PAX1800 - DEVICE_PACKAGES += ath11k-wifi-plasmacloud-pax1800 -endef -TARGET_DEVICES += plasmacloud_pax1800-v1 - -define Device/plasmacloud_pax1800-v2 - $(Device/plasmacloud_common_64k) - DEVICE_TITLE := Plasma Cloud PAX1800 v2 - DEVICE_DTS := qcom-ipq6018-pax1800-v2 - SUPPORTED_DEVICES := plasmacloud,pax1800-v2 - DEVICE_DTS_CONFIG := config@plasmacloud.pax1800v2 - CE_TYPE := PAX1800v2 - DEVICE_PACKAGES += ath11k-wifi-plasmacloud-pax1800 -endef -TARGET_DEVICES += plasmacloud_pax1800-v2 - -define Device/meshpp_s618_cp03 - DEVICE_TITLE := S618 cp03 - DEVICE_DTS := qcom-ipq6018-meshpp-s618-cp03 - SUPPORTED_DEVICES := meshpp,s618-cp03 - DEVICE_DTS_CONFIG := config@cp03-c1 - DEVICE_PACKAGES := ath11k-wifi-meshpp-s618 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 -endef -TARGET_DEVICES += meshpp_s618_cp03 - -define Device/meshpp_s618_cp01 - DEVICE_TITLE := S618 cp01 - DEVICE_DTS := qcom-ipq6018-meshpp-s618-cp01 - SUPPORTED_DEVICES := meshpp,s618-cp01 - DEVICE_DTS_CONFIG := config@cp01-c1 - DEVICE_PACKAGES := ath11k-wifi-meshpp-s618 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 -endef -TARGET_DEVICES += meshpp_s618_cp01 - -define Device/yuncore_fap650 - DEVICE_TITLE := YunCore FAP 650 - DEVICE_DTS := qcom-ipq6018-yuncore-fap650 - SUPPORTED_DEVICES := yuncore,fap650 - DEVICE_DTS_CONFIG := config@cp03-c1 - DEVICE_PACKAGES := ath11k-wifi-yuncore-fap650 -endef -TARGET_DEVICES += yuncore_fap650 - diff --git a/feeds/ipq807x/ipq807x/image/ipq807x.mk b/feeds/ipq807x/ipq807x/image/ipq807x.mk deleted file mode 100644 index 8b91dc51d..000000000 --- a/feeds/ipq807x/ipq807x/image/ipq807x.mk +++ /dev/null @@ -1,118 +0,0 @@ -KERNEL_LOADADDR := 0x41208000 - -define Device/qcom_hk01 - DEVICE_TITLE := Qualcomm Hawkeye HK01 - DEVICE_DTS := qcom-ipq807x-hk01 - DEVICE_DTS_CONFIG=config@hk01 - SUPPORTED_DEVICES := qcom,ipq807x-hk01 - DEVICE_PACKAGES := ath11k-wifi-qcom-ipq8074 -endef -TARGET_DEVICES += qcom_hk01 - -define Device/qcom_hk14 - DEVICE_TITLE := Qualcomm Hawkeye HK14 - DEVICE_DTS := qcom-ipq807x-hk14 - DEVICE_DTS_CONFIG=config@hk14 - SUPPORTED_DEVICES := qcom,ipq807x-hk14 - DEVICE_PACKAGES := ath11k-wifi-qcom-ipq8074 kmod-ath11k-pci ath11k-firmware-qcn9000 -endef -TARGET_DEVICES += qcom_hk14 - -define Device/cig_wf194 - DEVICE_TITLE := CIG WF194C - DEVICE_DTS := qcom-ipq807x-wf194c - DEVICE_DTS_CONFIG=config@hk01 - SUPPORTED_DEVICES := cig,wf194c - DEVICE_PACKAGES := ath11k-wifi-cig-wf194c aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 -endef -TARGET_DEVICES += cig_wf194 - -define Device/cig_wf194c4 - DEVICE_TITLE := CIG WF194C4 - DEVICE_DTS := qcom-ipq807x-wf194c4 - DEVICE_DTS_CONFIG=config@hk09 - SUPPORTED_DEVICES := cig,wf194c4 - DEVICE_PACKAGES := ath11k-wifi-cig-wf194c4 aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 -endef -TARGET_DEVICES += cig_wf194c4 - -define Device/cig_wf196_us - DEVICE_TITLE := CIG WF196 (US) - DEVICE_DTS := qcom-ipq807x-wf196 - DEVICE_DTS_CONFIG=config@hk14 - SUPPORTED_DEVICES := cig,wf196 - BLOCKSIZE := 256k - PAGESIZE := 4096 - DEVICE_PACKAGES := ath11k-wifi-cig-wf196-us aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 \ - ath11k-firmware-qcn9000 ath11k-wifi-cig-wf196_6g-us \ - zephyr-v3.3.x-hci_uart-cig_wf196_nrf52833 -endef -TARGET_DEVICES += cig_wf196_us - -define Device/cig_wf196_ca - DEVICE_TITLE := CIG WF196 (CA) - DEVICE_DTS := qcom-ipq807x-wf196 - DEVICE_DTS_CONFIG=config@hk14 - SUPPORTED_DEVICES := cig,wf196 - BLOCKSIZE := 256k - PAGESIZE := 4096 - DEVICE_PACKAGES := ath11k-wifi-cig-wf196-ca aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 \ - ath11k-firmware-qcn9000 ath11k-wifi-cig-wf196_6g-ca \ - zephyr-v3.3.x-hci_uart-cig_wf196_nrf52833 -endef -TARGET_DEVICES += cig_wf196_ca - -define Device/edgecore_eap102 - DEVICE_TITLE := Edgecore EAP102 - DEVICE_DTS := qcom-ipq807x-eap102 - DEVICE_DTS_CONFIG=config@ac02 - SUPPORTED_DEVICES := edgecore,eap102 - DEVICE_PACKAGES := ath11k-wifi-edgecore-eap102 kmod-usb2 kmod-usb3 uboot-envtools \ - zephyr-v3.3.x-hci_usb-edgecore_eap102_nrf52840 -endef -TARGET_DEVICES += edgecore_eap102 - -define Device/edgecore_oap102 - DEVICE_TITLE := Edgecore OAP102 - DEVICE_DTS := qcom-ipq807x-oap102 - DEVICE_DTS_CONFIG=config@ac02 - SUPPORTED_DEVICES := edgecore,oap102 - DEVICE_PACKAGES := ath11k-wifi-edgecore-eap102 kmod-usb2 kmod-usb3 uboot-envtools \ - zephyr-v3.3.x-hci_usb-edgecore_eap102_nrf52840 -endef -TARGET_DEVICES += edgecore_oap102 - -define Device/edgecore_eap106 - DEVICE_TITLE := Edgecore EAP106 - DEVICE_DTS := qcom-ipq807x-eap106 - DEVICE_DTS_CONFIG=config@hk02 - SUPPORTED_DEVICES := edgecore,eap106 - DEVICE_PACKAGES := ath11k-wifi-edgecore-eap106 aq-fw-download kmod-usb2 kmod-usb3 uboot-envtools -endef -TARGET_DEVICES += edgecore_eap106 - -define Device/tplink_ex227 - DEVICE_TITLE := TP-Link EX227 - DEVICE_DTS := qcom-ipq807x-ex227 - DEVICE_DTS_CONFIG=config@hk07 - SUPPORTED_DEVICES := tplink,ex227 - DEVICE_PACKAGES := ath11k-wifi-tplink-ex227 - IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi - IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - IMAGE/nand-factory.ubi := append-ubi -endef -TARGET_DEVICES += tplink_ex227 - -define Device/tplink_ex447 - DEVICE_TITLE := TP-Link EX447 - DEVICE_DTS := qcom-ipq807x-ex447 - DEVICE_DTS_CONFIG=config@hk09 - SUPPORTED_DEVICES := tplink,ex447 - DEVICE_PACKAGES := ath11k-wifi-tplink-ex447 - IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi - IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - IMAGE/nand-factory.ubi := append-ubi -endef -TARGET_DEVICES += tplink_ex447 diff --git a/feeds/ipq807x/ipq807x/ipq50xx/config-default b/feeds/ipq807x/ipq807x/ipq50xx/config-default deleted file mode 100644 index ebf414081..000000000 --- a/feeds/ipq807x/ipq807x/ipq50xx/config-default +++ /dev/null @@ -1,85 +0,0 @@ -# CONFIG_AHCI_IPQ is not set -CONFIG_ARCH_IPQ5018=y -# CONFIG_DIAGFWD_BRIDGE_CODE is not set -CONFIG_IPQ_ADSS_5018=y -CONFIG_IPQ_APSS_5018=y -CONFIG_IPQ_GCC_5018=y -# CONFIG_NET_SWITCHDEV is not set -CONFIG_NUM_ALT_PARTITION=16 -CONFIG_PINCTRL_IPQ5018=y -# CONFIG_IPC_LOGGING is not set -CONFIG_IPQ_SUBSYSTEM_DUMP=y -CONFIG_SPS=y -CONFIG_SPS_SUPPORT_NDP_BAM=y -CONFIG_CORESIGHT=y -CONFIG_CORESIGHT_CSR=y -CONFIG_CORESIGHT_CTI=y -CONFIG_CORESIGHT_EVENT=y -CONFIG_CORESIGHT_HWEVENT=y -CONFIG_CORESIGHT_LINKS_AND_SINKS=y -CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y -CONFIG_CORESIGHT_QCOM_REPLICATOR=y -# CONFIG_INPUT_PM8941_PWRKEY is not set -CONFIG_MDIO_QCA=y -# CONFIG_CRYPTO_ALL_CASES is not set -CONFIG_CRYPTO_DEV_QCOM_ICE=y -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set -CONFIG_CRYPTO_SHA512=y -# CONFIG_CORESIGHT_QPDI is not set -# CONFIG_CORESIGHT_SINK_ETBV10 is not set -CONFIG_CORESIGHT_SINK_TPIU=y -# CONFIG_CORESIGHT_SOURCE_DUMMY is not set -CONFIG_CORESIGHT_SOURCE_ETM3X=y -CONFIG_CORESIGHT_SOURCE_ETM4X=y -# CONFIG_CORESIGHT_REMOTE_ETM is not set -CONFIG_CORESIGHT_STM=y -CONFIG_CORESIGHT_TPDA=y -CONFIG_CORESIGHT_TPDM=y -# CONFIG_CORESIGHT_TPDM_DEFAULT_ENABLE is not set -CONFIG_IIO=y -# CONFIG_IIO_BUFFER is not set -# CONFIG_IIO_TRIGGER is not set -CONFIG_PCIE_DW_PLAT=y -CONFIG_PHY_IPQ_UNIPHY_PCIE=y -CONFIG_VMSPLIT_2G=y -# CONFIG_VMSPLIT_3G is not set -CONFIG_PPS=y -CONFIG_PTP_1588_CLOCK=y -# CONFIG_DP83640_PHY is not set -CONFIG_PWM_IPQ5018=y -CONFIG_QCOM_APM=y -CONFIG_QCOM_DCC=y -# CONFIG_QCOM_SPMI_TEMP_ALARM is not set -CONFIG_MMC_SDHCI_MSM_ICE=y -CONFIG_USB_BAM=y -CONFIG_MAILBOX=y -# CONFIG_USB_QCOM_DIAG_BRIDGE is not set -# CONFIG_USB_CONFIGFS_F_DIAG is not set -# CONFIG_NF_IPV6_DUMMY_HEADER is not set -CONFIG_RMNET_DATA=y -CONFIG_RMNET_DATA_DEBUG_PKT=y -CONFIG_MTD_NAND_SERIAL=y -CONFIG_PAGE_SCOPE_MULTI_PAGE_READ=y -# CONFIG_RMNET_DATA_FC is not set -CONFIG_CRYPTO_NO_ZERO_LEN_HASH=y -CONFIG_CRYPTO_DISABLE_AES192_TEST=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set -# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set -CONFIG_QTI_EUD=y -CONFIG_USB_QCA_M31_PHY=y -CONFIG_QGIC2_MSI=y -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y -CONFIG_PWM_IPQ4019=y -CONFIG_RMNET=y -CONFIG_QCOM_QMI_RMNET=y -CONFIG_QCOM_QMI_DFC=y -CONFIG_QCOM_QMI_POWER_COLLAPSE=y -CONFIG_RMNET_CTL=y -CONFIG_RMNET_CTL_DEBUG=y -CONFIG_SND_SOC_IPQ_LPASS=y -CONFIG_SND_SOC_IPQ_LPASS_PCM_RAW=y -# CONFIG_SND_SOC_IPQ_PCM_RAW is not set -CONFIG_QCOM_RESTART_REASON=y diff --git a/feeds/ipq807x/ipq807x/ipq50xx/config-lowmem b/feeds/ipq807x/ipq807x/ipq50xx/config-lowmem deleted file mode 100644 index b1b817ef6..000000000 --- a/feeds/ipq807x/ipq807x/ipq50xx/config-lowmem +++ /dev/null @@ -1,73 +0,0 @@ -# CONFIG_AHCI_IPQ is not set -CONFIG_ARCH_IPQ5018=y -# CONFIG_DIAGFWD_BRIDGE_CODE is not set -CONFIG_IPQ_ADSS_5018=y -CONFIG_IPQ_APSS_5018=y -CONFIG_IPQ_GCC_5018=y -# CONFIG_NET_SWITCHDEV is not set -CONFIG_NUM_ALT_PARTITION=16 -CONFIG_PINCTRL_IPQ5018=y -# CONFIG_IPC_LOGGING is not set -CONFIG_IPQ_SUBSYSTEM_DUMP=y -# CONFIG_SPS is not set -# CONFIG_SPS_SUPPORT_NDP_BAM is not set -# CONFIG_CORESIGHT is not set -# CONFIG_INPUT_PM8941_PWRKEY is not set -CONFIG_MDIO_QCA=y -# CONFIG_CRYPTO_ALL_CASES is not set -# CONFIG_CRYPTO_DEV_QCOM_ICE is not set -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_IIO is not set -# CONFIG_IIO_BUFFER is not set -# CONFIG_IIO_TRIGGER is not set -CONFIG_PCIE_DW_PLAT=y -CONFIG_PHY_IPQ_UNIPHY_PCIE=y -CONFIG_VMSPLIT_2G=y -# CONFIG_VMSPLIT_3G is not set -# CONFIG_PPS is not set -# CONFIG_PTP_1588_CLOCK is not set -# CONFIG_DP83640_PHY is not set -CONFIG_PWM_IPQ5018=y -CONFIG_QCOM_APM=y -# CONFIG_QCOM_DCC is not set -# CONFIG_QCOM_SPMI_TEMP_ALARM is not set -CONFIG_MMC_SDHCI_MSM_ICE=y -CONFIG_USB_BAM=y -CONFIG_MAILBOX=y -# CONFIG_USB_QCOM_DIAG_BRIDGE is not set -# CONFIG_USB_CONFIGFS_F_DIAG is not set -# CONFIG_NF_IPV6_DUMMY_HEADER is not set -# CONFIG_RMNET_DATA is not set -# CONFIG_RMNET_DATA_DEBUG_PKT is not set -CONFIG_MTD_NAND_SERIAL=y -CONFIG_PAGE_SCOPE_MULTI_PAGE_READ=y -# CONFIG_RMNET_DATA_FC is not set -# CONFIG_CRYPTO_NO_ZERO_LEN_HASH is not set -# CONFIG_CRYPTO_DISABLE_AES192_TEST is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set -# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set -CONFIG_QTI_EUD=y -CONFIG_USB_QCA_M31_PHY=y -CONFIG_SQUASHFS_XZ=y -# CONFIG_SQUASHFS_ZLIB is not set -# CONFIG_JFFS2_LZMA is not set -CONFIG_JFFS2_ZLIB=y -# CONFIG_LZO_COMPRESS is not set -# CONFIG_LZO_DECOMPRESS is not set -CONFIG_XZ_DEC=y -# CONFIG_XZ_DEC_X86 is not set -# CONFIG_XZ_DEC_POWERPC is not set -# CONFIG_XZ_DEC_IA64 is not set -CONFIG_XZ_DEC_ARM=y -# CONFIG_XZ_DEC_ARMTHUMB is not set -# CONFIG_XZ_DEC_SPARC is not set -CONFIG_XZ_DEC_BCJ=y -# CONFIG_LZO_COMPRESS is not set -# CONFIG_LZO_DECOMPRESS is not set -# CONFIG_CRYPTO is not set -CONFIG_QGIC2_MSI=y -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y diff --git a/feeds/ipq807x/ipq807x/ipq50xx/target.mk b/feeds/ipq807x/ipq807x/ipq50xx/target.mk deleted file mode 100644 index 6c6111afa..000000000 --- a/feeds/ipq807x/ipq807x/ipq50xx/target.mk +++ /dev/null @@ -1,10 +0,0 @@ - -SUBTARGET:=ipq50xx -BOARDNAME:=IPQ50XX -CPU_TYPE:=cortex-a7 - -DEFAULT_PACKAGES += qca-nss-fw-ipq50xx - -define Target/Description - Build firmware image for IPQ50xx SoC devices. -endef diff --git a/feeds/ipq807x/ipq807x/ipq60xx/config-default b/feeds/ipq807x/ipq807x/ipq60xx/config-default deleted file mode 100644 index a0ecdbdb8..000000000 --- a/feeds/ipq807x/ipq807x/ipq60xx/config-default +++ /dev/null @@ -1,122 +0,0 @@ -CONFIG_ALLOC_BUFFERS_IN_4K_CHUNKS=y -CONFIG_ANDROID=y -# CONFIG_ANDROID_BINDER_IPC is not set -# CONFIG_AQ_PHY is not set -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_IPQ6018=y -# CONFIG_ARCH_MSM8X60 is not set -CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8 -CONFIG_ARM_DMA_USE_IOMMU=y -CONFIG_ARM_HEAVY_MB=y -CONFIG_ARM_QTI_IPQ60XX_CPUFREQ=y -CONFIG_ARM_SMMU=y -CONFIG_ASN1=y -CONFIG_ASSOCIATIVE_ARRAY=y -CONFIG_CACHE_L2X0=y -CONFIG_CLZ_TAB=y -CONFIG_CMA=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 -CONFIG_CMA_DEBUG=y -CONFIG_CMA_DEBUGFS=y -CONFIG_CMA_SIZE_MBYTES=0 -CONFIG_CMA_SIZE_SEL_MBYTES=y -CONFIG_CORESIGHT=y -CONFIG_CORESIGHT_CSR=y -CONFIG_CORESIGHT_CTI=y -CONFIG_CORESIGHT_HWEVENT=y -CONFIG_CORESIGHT_LINKS_AND_SINKS=y -CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y -CONFIG_CORESIGHT_QCOM_REPLICATOR=y -CONFIG_CORESIGHT_SINK_TPIU=y -CONFIG_CORESIGHT_SOURCE_ETM3X=y -CONFIG_CORESIGHT_SOURCE_ETM4X=y -CONFIG_CORESIGHT_STM=y -CONFIG_CORESIGHT_TPDA=y -CONFIG_CORESIGHT_TPDM=y -CONFIG_CRC_CCITT=m -CONFIG_CRYPTO_AKCIPHER=y -CONFIG_CRYPTO_AKCIPHER2=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_GF128MUL=y -CONFIG_CRYPTO_GHASH=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_JITTERENTROPY=y -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_PCOMP2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_SHA512=y -CONFIG_DMA_CMA=y -CONFIG_DMA_SHARED_BUFFER=y -CONFIG_DT_IDLE_STATES=y -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EXTCON=y -CONFIG_EXTCON_USB_GPIO=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FREEZER=y -CONFIG_GPIO_WATCHDOG=y -CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y -CONFIG_IOMMU_API=y -CONFIG_IOMMU_DMA=y -CONFIG_IOMMU_IOVA=y -CONFIG_IOMMU_IO_PGTABLE=y -# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set -CONFIG_IOMMU_IO_PGTABLE_LPAE=y -# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set -CONFIG_IOMMU_SUPPORT=y -CONFIG_ION=y -CONFIG_ION_MSM=y -CONFIG_IPQ_APSS_6018=y -CONFIG_IPQ_GCC_6018=y -CONFIG_IPQ_MEM_PROFILE=256 -CONFIG_KASAN_SHADOW_OFFSET=0x5f000000 -CONFIG_LEDS_PCA9956B=y -CONFIG_MDIO_QCA=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_MIGRATION=y -CONFIG_MPILIB=y -CONFIG_MSM_SECURE_BUFFER=y -CONFIG_NEED_SG_DMA_LENGTH=y -# CONFIG_NET_SWITCHDEV is not set -CONFIG_NUM_ALT_PARTITION=16 -CONFIG_OF_IOMMU=y -CONFIG_OID_REGISTRY=y -CONFIG_OUTER_CACHE=y -CONFIG_OUTER_CACHE_SYNC=y -CONFIG_PAGE_OFFSET=0x80000000 -CONFIG_PINCTRL_IPQ6018=y -# CONFIG_PKCS7_MESSAGE_PARSER is not set -# CONFIG_PL310_ERRATA_588369 is not set -# CONFIG_PL310_ERRATA_727915 is not set -# CONFIG_PL310_ERRATA_753970 is not set -# CONFIG_PL310_ERRATA_769419 is not set -CONFIG_PPS=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PWM_IPQ4019=y -CONFIG_QCOM_APM=y -CONFIG_QCOM_DCC=y -CONFIG_QCOM_QMI_HELPERS=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_SPMI=y -CONFIG_REGULATOR_CPR3=y -CONFIG_REGULATOR_CPR3_NPU=y -CONFIG_REGULATOR_CPR4_APSS=y -# CONFIG_SKB_FIXED_SIZE_2K is not set -CONFIG_SOC_BUS=y -CONFIG_SPS=y -CONFIG_SPS_SUPPORT_NDP_BAM=y -CONFIG_STAGING=y -CONFIG_SUSPEND_FREEZER=y -# CONFIG_USB_GADGET is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -# CONFIG_VFIO is not set -CONFIG_VIRTIO=y -CONFIG_VIRTUALIZATION=y -CONFIG_VMSPLIT_2G=y -# CONFIG_VMSPLIT_3G is not set -CONFIG_WANT_DEV_COREDUMP=y diff --git a/feeds/ipq807x/ipq807x/ipq60xx/profiles/default.mk b/feeds/ipq807x/ipq807x/ipq60xx/profiles/default.mk deleted file mode 100644 index f47e73acf..000000000 --- a/feeds/ipq807x/ipq807x/ipq60xx/profiles/default.mk +++ /dev/null @@ -1,9 +0,0 @@ -define Profile/Default - NAME:=Default Profile (minimum package set) -endef - -define Profile/Default/Description -Default package set compatible with most boards. -endef -$(eval $(call Profile,Default)) - diff --git a/feeds/ipq807x/ipq807x/ipq60xx/target.mk b/feeds/ipq807x/ipq807x/ipq60xx/target.mk deleted file mode 100644 index cf2bf7b9c..000000000 --- a/feeds/ipq807x/ipq807x/ipq60xx/target.mk +++ /dev/null @@ -1,8 +0,0 @@ -SUBTARGET:=ipq60xx -BOARDNAME:=IPQ60xx based boards - -DEFAULT_PACKAGES += ath11k-firmware-ipq60xx qca-nss-fw-ipq60xx - -define Target/Description - Build images for IPQ60xx systems. -endef diff --git a/feeds/ipq807x/ipq807x/ipq807x/config-default b/feeds/ipq807x/ipq807x/ipq807x/config-default deleted file mode 100644 index 5d5d8ba52..000000000 --- a/feeds/ipq807x/ipq807x/ipq807x/config-default +++ /dev/null @@ -1,78 +0,0 @@ -# CONFIG_AHCI_IPQ is not set -CONFIG_ARCH_IPQ807x=y -# CONFIG_DIAGFWD_BRIDGE_CODE is not set -CONFIG_IPQ_ADSS_807x=y -CONFIG_IPQ_APSS_807x=y -CONFIG_IPQ_GCC_807x=y -# CONFIG_NET_SWITCHDEV is not set -CONFIG_NUM_ALT_PARTITION=16 -CONFIG_PINCTRL_IPQ807x=y -# CONFIG_IPC_LOGGING is not set -CONFIG_IPQ_SUBSYSTEM_DUMP=y -CONFIG_SPS=y -CONFIG_SPS_SUPPORT_NDP_BAM=y -CONFIG_CORESIGHT=y -CONFIG_CORESIGHT_CSR=y -CONFIG_CORESIGHT_CTI=y -CONFIG_CORESIGHT_EVENT=y -CONFIG_CORESIGHT_HWEVENT=y -CONFIG_CORESIGHT_LINKS_AND_SINKS=y -CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y -CONFIG_CORESIGHT_QCOM_REPLICATOR=y -CONFIG_CORESIGHT_STREAM=m -# CONFIG_INPUT_PM8941_PWRKEY is not set -CONFIG_MDIO_QCA=y -# CONFIG_CRYPTO_ALL_CASES is not set -CONFIG_CRYPTO_DEV_QCOM_ICE=y -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set -CONFIG_CRYPTO_SHA512=y -# CONFIG_CORESIGHT_QPDI is not set -# CONFIG_CORESIGHT_SINK_ETBV10 is not set -CONFIG_CORESIGHT_SINK_TPIU=y -# CONFIG_CORESIGHT_SOURCE_DUMMY is not set -CONFIG_CORESIGHT_SOURCE_ETM3X=y -CONFIG_CORESIGHT_SOURCE_ETM4X=y -# CONFIG_CORESIGHT_REMOTE_ETM is not set -CONFIG_CORESIGHT_STM=y -CONFIG_CORESIGHT_TPDA=y -CONFIG_CORESIGHT_TPDM=y -CONFIG_AQUANTIA_PHY=y -# CONFIG_CORESIGHT_TPDM_DEFAULT_ENABLE is not set -CONFIG_IIO=y -# CONFIG_IIO_BUFFER is not set -# CONFIG_IIO_TRIGGER is not set -CONFIG_PCIE_DW_PLAT=y -CONFIG_VMSPLIT_2G=y -# CONFIG_VMSPLIT_3G is not set -CONFIG_PPS=y -CONFIG_PTP_1588_CLOCK=y -# CONFIG_DP83640_PHY is not set -CONFIG_PWM_IPQ4019=y -CONFIG_QCOM_APM=y -CONFIG_QCOM_DCC=y -# CONFIG_QCOM_SPMI_TEMP_ALARM is not set -CONFIG_QCOM_SPMI_VADC=y -CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS=y -CONFIG_REGULATOR_CPR3=y -CONFIG_REGULATOR_CPR3_NPU=y -CONFIG_REGULATOR_CPR4_APSS=y -CONFIG_MMC_SDHCI_MSM_ICE=y -CONFIG_USB_BAM=y -CONFIG_USB_QCOM_KS_BRIDGE=m -CONFIG_MAILBOX=y -# CONFIG_USB_QCOM_DIAG_BRIDGE is not set -# CONFIG_USB_CONFIGFS_F_DIAG is not set -# CONFIG_NF_IPV6_DUMMY_HEADER is not set -CONFIG_RMNET=y -CONFIG_RMNET_DATA=y -CONFIG_RMNET_DATA_DEBUG_PKT=y -# CONFIG_RMNET_DATA_FC is not set -CONFIG_QCOM_QMI_RMNET=y -CONFIG_QCOM_QMI_DFC=y -CONFIG_QCOM_QMI_POWER_COLLAPSE=y -CONFIG_RMNET_CTL=y -CONFIG_RMNET_CTL_DEBUG=y -CONFIG_MHI_BUS_TEST=y -CONFIG_MHI_DEBUG=y -CONFIG_MHI_NETDEV=y -CONFIG_MHI_UCI=y diff --git a/feeds/ipq807x/ipq807x/ipq807x/target.mk b/feeds/ipq807x/ipq807x/ipq807x/target.mk deleted file mode 100644 index 7c24b66e6..000000000 --- a/feeds/ipq807x/ipq807x/ipq807x/target.mk +++ /dev/null @@ -1,7 +0,0 @@ -SUBTARGET:=ipq807x -BOARDNAME:=IPQ807x based boards - -DEFAULT_PACKAGES += ath11k-firmware-ipq807x qca-nss-fw-ipq807x -define Target/Description - Build images for IPQ807x systems. -endef diff --git a/feeds/ipq807x/ipq807x/modules.mk b/feeds/ipq807x/ipq807x/modules.mk deleted file mode 100644 index 84a314828..000000000 --- a/feeds/ipq807x/ipq807x/modules.mk +++ /dev/null @@ -1,146 +0,0 @@ -define KernelPackage/usb-phy-ipq807x - TITLE:=DWC3 USB QCOM PHY driver for IPQ807x - DEPENDS:=@TARGET_ipq807x - KCONFIG:= \ - CONFIG_USB_QCOM_QUSB_PHY \ - CONFIG_USB_QCOM_QMP_PHY - FILES:= \ - $(LINUX_DIR)/drivers/usb/phy/phy-msm-qusb.ko \ - $(LINUX_DIR)/drivers/usb/phy/phy-msm-ssusb-qmp.ko - AUTOLOAD:=$(call AutoLoad,45,phy-msm-qusb phy-msm-ssusb-qmp,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-phy-ipq807x/description - This driver provides support for the USB PHY drivers - within the IPQ807x SoCs. -endef - -$(eval $(call KernelPackage,usb-phy-ipq807x)) - - -define KernelPackage/qrtr_mproc - TITLE:= Ath11k Specific kernel configs for IPQ807x and IPQ60xx - DEPENDS+= @TARGET_ipq807x - KCONFIG:= \ - CONFIG_QRTR=y \ - CONFIG_QRTR_MHI=y \ - CONFIG_MHI_BUS=y \ - CONFIG_MHI_QTI=y \ - CONFIG_QCOM_APCS_IPC=y \ - CONFIG_QCOM_GLINK_SSR=y \ - CONFIG_QCOM_Q6V5_WCSS=y \ - CONFIG_MSM_RPM_RPMSG=y \ - CONFIG_RPMSG_QCOM_GLINK_RPM=y \ - CONFIG_REGULATOR_RPM_GLINK=y \ - CONFIG_QCOM_SYSMON=y \ - CONFIG_RPMSG=y \ - CONFIG_RPMSG_CHAR=y \ - CONFIG_RPMSG_QCOM_GLINK_SMEM=y \ - CONFIG_RPMSG_QCOM_SMD=y \ - CONFIG_QRTR_SMD=y \ - CONFIG_QCOM_QMI_HELPERS=y \ - CONFIG_SAMPLES=y \ - CONFIG_SAMPLE_QMI_CLIENT=m \ - CONFIG_SAMPLE_TRACE_EVENTS=n \ - CONFIG_SAMPLE_KOBJECT=n \ - CONFIG_SAMPLE_KPROBES=n \ - CONFIG_SAMPLE_KRETPROBES=n \ - CONFIG_SAMPLE_HW_BREAKPOINT=n \ - CONFIG_SAMPLE_KFIFO=n \ - CONFIG_SAMPLE_CONFIGFS=n \ - CONFIG_SAMPLE_RPMSG_CLIENT=n \ - CONFIG_MAILBOX=y \ - CONFIG_DIAG_OVER_QRTR=y -endef - -define KernelPackage/qrtr_mproc/description -Kernel configs for ath11k support specific to ipq807x and IPQ60xx -endef - -$(eval $(call KernelPackage,qrtr_mproc)) - -define KernelPackage/bt_tty - TITLE:= BT Inter-processor Communication - DEPENDS+= @TARGET_ipq807x - KCONFIG:= \ - CONFIG_QTI_BT_TTY=y \ - CONFIG_QCOM_MDT_LOADER=y - FILES:= $(LINUX_DIR)/drivers/soc/qcom/bt/bt_rproc.ko - AUTOLOAD:=$(call AutoLoad,53,bt_rproc,1) -endef - -define KernelPackage/bt_tty/description -BT Interprocessor Communication support specific to IPQ50xx -endef - -$(eval $(call KernelPackage,bt_tty)) - -define KernelPackage/usb-phy-ipq5018 - TITLE:=DWC3 USB PHY driver for IPQ5018 - DEPENDS:=@TARGET_ipq807x_ipq50xx - KCONFIG:= \ - CONFIG_USB_QCA_M31_PHY \ - CONFIG_PHY_IPQ_UNIPHY_USB - FILES:= \ - $(LINUX_DIR)/drivers/usb/phy/phy-qca-m31.ko \ - $(LINUX_DIR)/drivers/phy/phy-qca-uniphy.ko - AUTOLOAD:=$(call AutoLoad,45,phy-qca-m31 phy-qca-uniphy,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-phy-ipq5018/description - This driver provides support for the USB PHY drivers - within the IPQ5018 SoCs. -endef - -$(eval $(call KernelPackage,usb-phy-ipq5018)) - -define KernelPackage/diag-char - TITLE:=CHAR DIAG - KCONFIG:= CONFIG_DIAG_MHI=y@ge5.4 \ - CONFIG_DIAG_OVER_PCIE=n@ge5.4 \ - CONFIG_DIAGFWD_BRIDGE_CODE=y \ - CONFIG_DIAG_CHAR=m - DEPENDS:=+kmod-lib-crc-ccitt - FILES:=$(LINUX_DIR)/drivers/char/diag/diagchar.ko -endef - -define KernelPackage/diag-char/description - CHAR DIAG -endef - -$(eval $(call KernelPackage,diag-char)) - -define KernelPackage/usb-dwc3-qcom - TITLE:=DWC3 Qualcomm USB driver - DEPENDS:=@(!LINUX_4_14) @TARGET_ipq807x +kmod-usb-dwc3 - KCONFIG:= CONFIG_USB_DWC3_QCOM - FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-qcom.ko \ - $(LINUX_DIR)/drivers/usb/dwc3/dbm.ko - AUTOLOAD:=$(call AutoLoad,53,dwc3-qcom dbm,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-dwc3-qcom/description - Some Qualcomm SoCs use DesignWare Core IP for USB2/3 functionality. - This driver also handles Qscratch wrapper which is needed for - peripheral mode support. -endef - - -$(eval $(call KernelPackage,usb-dwc3-qcom)) - -define KernelPackage/bootconfig - SUBMENU:=Other modules - TITLE:=Bootconfig partition for failsafe - KCONFIG:=CONFIG_BOOTCONFIG_PARTITION - FILES:=$(LINUX_DIR)/drivers/platform/ipq/bootconfig.ko@ge4.4 - AUTOLOAD:=$(call AutoLoad,56,bootconfig,1) -endef - -define KernelPackage/bootconfig/description - Bootconfig partition for failsafe -endef - -$(eval $(call KernelPackage,bootconfig)) diff --git a/feeds/ipq807x/ipq807x/patches/001-backport_kbuild_fix.patch b/feeds/ipq807x/ipq807x/patches/001-backport_kbuild_fix.patch deleted file mode 100644 index 48fe7ec25..000000000 --- a/feeds/ipq807x/ipq807x/patches/001-backport_kbuild_fix.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/scripts/Makefile.lib -+++ b/scripts/Makefile.lib -@@ -96,10 +96,10 @@ obj-dirs := $(addprefix $(obj)/,$(obj-di - # Note: Files that end up in two or more modules are compiled without the - # KBUILD_MODNAME definition. The reason is that any made-up name would - # differ in different configs. --name-fix = $(subst $(comma),_,$(subst -,_,$1)) --basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" -+name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst -,_,$1))$(quote)$(squote) -+basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget)) - modname_flags = $(if $(filter 1,$(words $(modname))),\ -- -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") -+ -DKBUILD_MODNAME=$(call name-fix,$(modname))) - - orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \ - $(ccflags-y) $(CFLAGS_$(basetarget).o) -@@ -155,7 +155,7 @@ endif - - c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ - $(__c_flags) $(modkern_cflags) \ -- -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) -+ $(basename_flags) $(modname_flags) - - a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ - $(__a_flags) $(modkern_aflags) diff --git a/feeds/ipq807x/ipq807x/patches/100-qrtr-ns.patch b/feeds/ipq807x/ipq807x/patches/100-qrtr-ns.patch deleted file mode 100644 index 850e64477..000000000 --- a/feeds/ipq807x/ipq807x/patches/100-qrtr-ns.patch +++ /dev/null @@ -1,976 +0,0 @@ -Index: linux-4.4.60/net/qrtr/ns.c -=================================================================== ---- /dev/null -+++ linux-4.4.60/net/qrtr/ns.c -@@ -0,0 +1,760 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* -+ * Copyright (c) 2015, Sony Mobile Communications Inc. -+ * Copyright (c) 2013, The Linux Foundation. All rights reserved. -+ * Copyright (c) 2020, Linaro Ltd. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include "qrtr.h" -+ -+#define CREATE_TRACE_POINTS -+#include -+ -+static RADIX_TREE(nodes, GFP_KERNEL); -+ -+static struct { -+ struct socket *sock; -+ struct sockaddr_qrtr bcast_sq; -+ struct list_head lookups; -+ struct workqueue_struct *workqueue; -+ struct work_struct work; -+ int local_node; -+} qrtr_ns; -+ -+static const char * const qrtr_ctrl_pkt_strings[] = { -+ [QRTR_TYPE_HELLO] = "hello", -+ [QRTR_TYPE_BYE] = "bye", -+ [QRTR_TYPE_NEW_SERVER] = "new-server", -+ [QRTR_TYPE_DEL_SERVER] = "del-server", -+ [QRTR_TYPE_DEL_CLIENT] = "del-client", -+ [QRTR_TYPE_RESUME_TX] = "resume-tx", -+ [QRTR_TYPE_EXIT] = "exit", -+ [QRTR_TYPE_PING] = "ping", -+ [QRTR_TYPE_NEW_LOOKUP] = "new-lookup", -+ [QRTR_TYPE_DEL_LOOKUP] = "del-lookup", -+}; -+ -+struct qrtr_server_filter { -+ unsigned int service; -+ unsigned int instance; -+ unsigned int ifilter; -+}; -+ -+struct qrtr_lookup { -+ unsigned int service; -+ unsigned int instance; -+ -+ struct sockaddr_qrtr sq; -+ struct list_head li; -+}; -+ -+struct qrtr_server { -+ unsigned int service; -+ unsigned int instance; -+ -+ unsigned int node; -+ unsigned int port; -+ -+ struct list_head qli; -+}; -+ -+struct qrtr_node { -+ unsigned int id; -+ struct radix_tree_root servers; -+}; -+ -+static struct qrtr_node *node_get(unsigned int node_id) -+{ -+ struct qrtr_node *node; -+ -+ node = radix_tree_lookup(&nodes, node_id); -+ if (node) -+ return node; -+ -+ /* If node didn't exist, allocate and insert it to the tree */ -+ node = kzalloc(sizeof(*node), GFP_KERNEL); -+ if (!node) -+ return NULL; -+ -+ node->id = node_id; -+ -+ radix_tree_insert(&nodes, node_id, node); -+ -+ return node; -+} -+ -+static int server_match(const struct qrtr_server *srv, -+ const struct qrtr_server_filter *f) -+{ -+ unsigned int ifilter = f->ifilter; -+ -+ if (f->service != 0 && srv->service != f->service) -+ return 0; -+ if (!ifilter && f->instance) -+ ifilter = ~0; -+ -+ return (srv->instance & ifilter) == f->instance; -+} -+ -+static int service_announce_new(struct sockaddr_qrtr *dest, -+ struct qrtr_server *srv) -+{ -+ struct qrtr_ctrl_pkt pkt; -+ struct msghdr msg = { }; -+ struct kvec iv; -+ -+ trace_qrtr_ns_service_announce_new(srv->service, srv->instance, -+ srv->node, srv->port); -+ -+ iv.iov_base = &pkt; -+ iv.iov_len = sizeof(pkt); -+ -+ memset(&pkt, 0, sizeof(pkt)); -+ pkt.cmd = cpu_to_le32(QRTR_TYPE_NEW_SERVER); -+ pkt.server.service = cpu_to_le32(srv->service); -+ pkt.server.instance = cpu_to_le32(srv->instance); -+ pkt.server.node = cpu_to_le32(srv->node); -+ pkt.server.port = cpu_to_le32(srv->port); -+ -+ msg.msg_name = (struct sockaddr *)dest; -+ msg.msg_namelen = sizeof(*dest); -+ -+ return kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); -+} -+ -+static int service_announce_del(struct sockaddr_qrtr *dest, -+ struct qrtr_server *srv) -+{ -+ struct qrtr_ctrl_pkt pkt; -+ struct msghdr msg = { }; -+ struct kvec iv; -+ int ret; -+ -+ trace_qrtr_ns_service_announce_del(srv->service, srv->instance, -+ srv->node, srv->port); -+ -+ iv.iov_base = &pkt; -+ iv.iov_len = sizeof(pkt); -+ -+ memset(&pkt, 0, sizeof(pkt)); -+ pkt.cmd = cpu_to_le32(QRTR_TYPE_DEL_SERVER); -+ pkt.server.service = cpu_to_le32(srv->service); -+ pkt.server.instance = cpu_to_le32(srv->instance); -+ pkt.server.node = cpu_to_le32(srv->node); -+ pkt.server.port = cpu_to_le32(srv->port); -+ -+ msg.msg_name = (struct sockaddr *)dest; -+ msg.msg_namelen = sizeof(*dest); -+ -+ ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); -+ if (ret < 0) -+ pr_err("failed to announce del service\n"); -+ -+ return ret; -+} -+ -+static void lookup_notify(struct sockaddr_qrtr *to, struct qrtr_server *srv, -+ bool new) -+{ -+ struct qrtr_ctrl_pkt pkt; -+ struct msghdr msg = { }; -+ struct kvec iv; -+ int ret; -+ -+ iv.iov_base = &pkt; -+ iv.iov_len = sizeof(pkt); -+ -+ memset(&pkt, 0, sizeof(pkt)); -+ pkt.cmd = new ? cpu_to_le32(QRTR_TYPE_NEW_SERVER) : -+ cpu_to_le32(QRTR_TYPE_DEL_SERVER); -+ if (srv) { -+ pkt.server.service = cpu_to_le32(srv->service); -+ pkt.server.instance = cpu_to_le32(srv->instance); -+ pkt.server.node = cpu_to_le32(srv->node); -+ pkt.server.port = cpu_to_le32(srv->port); -+ } -+ -+ msg.msg_name = (struct sockaddr *)to; -+ msg.msg_namelen = sizeof(*to); -+ -+ ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); -+ if (ret < 0) -+ pr_err("failed to send lookup notification\n"); -+} -+ -+static int announce_servers(struct sockaddr_qrtr *sq) -+{ -+ struct radix_tree_iter iter; -+ struct qrtr_server *srv; -+ struct qrtr_node *node; -+ void __rcu **slot; -+ int ret; -+ -+ node = node_get(qrtr_ns.local_node); -+ if (!node) -+ return 0; -+ -+ /* Announce the list of servers registered in this node */ -+ radix_tree_for_each_slot(slot, &node->servers, &iter, 0) { -+ srv = radix_tree_deref_slot(slot); -+ -+ ret = service_announce_new(sq, srv); -+ if (ret < 0) { -+ pr_err("failed to announce new service\n"); -+ return ret; -+ } -+ } -+ -+ return 0; -+} -+ -+static struct qrtr_server *server_add(unsigned int service, -+ unsigned int instance, -+ unsigned int node_id, -+ unsigned int port) -+{ -+ struct qrtr_server *srv; -+ struct qrtr_server *old; -+ struct qrtr_node *node; -+ -+ if (!service || !port) -+ return NULL; -+ -+ srv = kzalloc(sizeof(*srv), GFP_KERNEL); -+ if (!srv) -+ return NULL; -+ -+ srv->service = service; -+ srv->instance = instance; -+ srv->node = node_id; -+ srv->port = port; -+ -+ node = node_get(node_id); -+ if (!node) -+ goto err; -+ -+ /* Delete the old server on the same port */ -+ old = radix_tree_lookup(&node->servers, port); -+ if (old) { -+ radix_tree_delete(&node->servers, port); -+ kfree(old); -+ } -+ -+ radix_tree_insert(&node->servers, port, srv); -+ -+ trace_qrtr_ns_server_add(srv->service, srv->instance, -+ srv->node, srv->port); -+ -+ return srv; -+ -+err: -+ kfree(srv); -+ return NULL; -+} -+ -+static int server_del(struct qrtr_node *node, unsigned int port) -+{ -+ struct qrtr_lookup *lookup; -+ struct qrtr_server *srv; -+ struct list_head *li; -+ -+ srv = radix_tree_lookup(&node->servers, port); -+ if (!srv) -+ return -ENOENT; -+ -+ radix_tree_delete(&node->servers, port); -+ -+ /* Broadcast the removal of local servers */ -+ if (srv->node == qrtr_ns.local_node) -+ service_announce_del(&qrtr_ns.bcast_sq, srv); -+ -+ /* Announce the service's disappearance to observers */ -+ list_for_each(li, &qrtr_ns.lookups) { -+ lookup = container_of(li, struct qrtr_lookup, li); -+ if (lookup->service && lookup->service != srv->service) -+ continue; -+ if (lookup->instance && lookup->instance != srv->instance) -+ continue; -+ -+ lookup_notify(&lookup->sq, srv, false); -+ } -+ -+ kfree(srv); -+ -+ return 0; -+} -+ -+static int say_hello(struct sockaddr_qrtr *dest) -+{ -+ struct qrtr_ctrl_pkt pkt; -+ struct msghdr msg = { }; -+ struct kvec iv; -+ int ret; -+ -+ iv.iov_base = &pkt; -+ iv.iov_len = sizeof(pkt); -+ -+ memset(&pkt, 0, sizeof(pkt)); -+ pkt.cmd = cpu_to_le32(QRTR_TYPE_HELLO); -+ -+ msg.msg_name = (struct sockaddr *)dest; -+ msg.msg_namelen = sizeof(*dest); -+ -+ ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); -+ if (ret < 0) -+ pr_err("failed to send hello msg\n"); -+ -+ return ret; -+} -+ -+/* Announce the list of servers registered on the local node */ -+static int ctrl_cmd_hello(struct sockaddr_qrtr *sq) -+{ -+ int ret; -+ -+ ret = say_hello(sq); -+ if (ret < 0) -+ return ret; -+ -+ return announce_servers(sq); -+} -+ -+static int ctrl_cmd_bye(struct sockaddr_qrtr *from) -+{ -+ struct qrtr_node *local_node; -+ struct radix_tree_iter iter; -+ struct qrtr_ctrl_pkt pkt; -+ struct qrtr_server *srv; -+ struct sockaddr_qrtr sq; -+ struct msghdr msg = { }; -+ struct qrtr_node *node; -+ void __rcu **slot; -+ struct kvec iv; -+ int ret; -+ -+ iv.iov_base = &pkt; -+ iv.iov_len = sizeof(pkt); -+ -+ node = node_get(from->sq_node); -+ if (!node) -+ return 0; -+ -+ /* Advertise removal of this client to all servers of remote node */ -+ radix_tree_for_each_slot(slot, &node->servers, &iter, 0) { -+ srv = radix_tree_deref_slot(slot); -+ server_del(node, srv->port); -+ } -+ -+ /* Advertise the removal of this client to all local servers */ -+ local_node = node_get(qrtr_ns.local_node); -+ if (!local_node) -+ return 0; -+ -+ memset(&pkt, 0, sizeof(pkt)); -+ pkt.cmd = cpu_to_le32(QRTR_TYPE_BYE); -+ pkt.client.node = cpu_to_le32(from->sq_node); -+ -+ radix_tree_for_each_slot(slot, &local_node->servers, &iter, 0) { -+ srv = radix_tree_deref_slot(slot); -+ -+ sq.sq_family = AF_QIPCRTR; -+ sq.sq_node = srv->node; -+ sq.sq_port = srv->port; -+ -+ msg.msg_name = (struct sockaddr *)&sq; -+ msg.msg_namelen = sizeof(sq); -+ -+ ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); -+ if (ret < 0) { -+ pr_err("failed to send bye cmd\n"); -+ return ret; -+ } -+ } -+ -+ return 0; -+} -+ -+static int ctrl_cmd_del_client(struct sockaddr_qrtr *from, -+ unsigned int node_id, unsigned int port) -+{ -+ struct qrtr_node *local_node; -+ struct radix_tree_iter iter; -+ struct qrtr_lookup *lookup; -+ struct qrtr_ctrl_pkt pkt; -+ struct msghdr msg = { }; -+ struct qrtr_server *srv; -+ struct sockaddr_qrtr sq; -+ struct qrtr_node *node; -+ struct list_head *tmp; -+ struct list_head *li; -+ void __rcu **slot; -+ struct kvec iv; -+ int ret; -+ -+ iv.iov_base = &pkt; -+ iv.iov_len = sizeof(pkt); -+ -+ /* Don't accept spoofed messages */ -+ if (from->sq_node != node_id) -+ return -EINVAL; -+ -+ /* Local DEL_CLIENT messages comes from the port being closed */ -+ if (from->sq_node == qrtr_ns.local_node && from->sq_port != port) -+ return -EINVAL; -+ -+ /* Remove any lookups by this client */ -+ list_for_each_safe(li, tmp, &qrtr_ns.lookups) { -+ lookup = container_of(li, struct qrtr_lookup, li); -+ if (lookup->sq.sq_node != node_id) -+ continue; -+ if (lookup->sq.sq_port != port) -+ continue; -+ -+ list_del(&lookup->li); -+ kfree(lookup); -+ } -+ -+ /* Remove the server belonging to this port */ -+ node = node_get(node_id); -+ if (node) -+ server_del(node, port); -+ -+ /* Advertise the removal of this client to all local servers */ -+ local_node = node_get(qrtr_ns.local_node); -+ if (!local_node) -+ return 0; -+ -+ memset(&pkt, 0, sizeof(pkt)); -+ pkt.cmd = cpu_to_le32(QRTR_TYPE_DEL_CLIENT); -+ pkt.client.node = cpu_to_le32(node_id); -+ pkt.client.port = cpu_to_le32(port); -+ -+ radix_tree_for_each_slot(slot, &local_node->servers, &iter, 0) { -+ srv = radix_tree_deref_slot(slot); -+ -+ sq.sq_family = AF_QIPCRTR; -+ sq.sq_node = srv->node; -+ sq.sq_port = srv->port; -+ -+ msg.msg_name = (struct sockaddr *)&sq; -+ msg.msg_namelen = sizeof(sq); -+ -+ ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); -+ if (ret < 0) { -+ pr_err("failed to send del client cmd\n"); -+ return ret; -+ } -+ } -+ -+ return 0; -+} -+ -+static int ctrl_cmd_new_server(struct sockaddr_qrtr *from, -+ unsigned int service, unsigned int instance, -+ unsigned int node_id, unsigned int port) -+{ -+ struct qrtr_lookup *lookup; -+ struct qrtr_server *srv; -+ struct list_head *li; -+ int ret = 0; -+ -+ /* Ignore specified node and port for local servers */ -+ if (from->sq_node == qrtr_ns.local_node) { -+ node_id = from->sq_node; -+ port = from->sq_port; -+ } -+ -+ /* Don't accept spoofed messages */ -+ if (from->sq_node != node_id) -+ return -EINVAL; -+ -+ srv = server_add(service, instance, node_id, port); -+ if (!srv) -+ return -EINVAL; -+ -+ if (srv->node == qrtr_ns.local_node) { -+ ret = service_announce_new(&qrtr_ns.bcast_sq, srv); -+ if (ret < 0) { -+ pr_err("failed to announce new service\n"); -+ return ret; -+ } -+ } -+ -+ /* Notify any potential lookups about the new server */ -+ list_for_each(li, &qrtr_ns.lookups) { -+ lookup = container_of(li, struct qrtr_lookup, li); -+ if (lookup->service && lookup->service != service) -+ continue; -+ if (lookup->instance && lookup->instance != instance) -+ continue; -+ -+ lookup_notify(&lookup->sq, srv, true); -+ } -+ -+ return ret; -+} -+ -+static int ctrl_cmd_del_server(struct sockaddr_qrtr *from, -+ unsigned int service, unsigned int instance, -+ unsigned int node_id, unsigned int port) -+{ -+ struct qrtr_node *node; -+ -+ /* Ignore specified node and port for local servers*/ -+ if (from->sq_node == qrtr_ns.local_node) { -+ node_id = from->sq_node; -+ port = from->sq_port; -+ } -+ -+ /* Don't accept spoofed messages */ -+ if (from->sq_node != node_id) -+ return -EINVAL; -+ -+ /* Local servers may only unregister themselves */ -+ if (from->sq_node == qrtr_ns.local_node && from->sq_port != port) -+ return -EINVAL; -+ -+ node = node_get(node_id); -+ if (!node) -+ return -ENOENT; -+ -+ return server_del(node, port); -+} -+ -+static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from, -+ unsigned int service, unsigned int instance) -+{ -+ struct radix_tree_iter node_iter; -+ struct qrtr_server_filter filter; -+ struct radix_tree_iter srv_iter; -+ struct qrtr_lookup *lookup; -+ struct qrtr_node *node; -+ void __rcu **node_slot; -+ void __rcu **srv_slot; -+ -+ /* Accept only local observers */ -+ if (from->sq_node != qrtr_ns.local_node) -+ return -EINVAL; -+ -+ lookup = kzalloc(sizeof(*lookup), GFP_KERNEL); -+ if (!lookup) -+ return -ENOMEM; -+ -+ lookup->sq = *from; -+ lookup->service = service; -+ lookup->instance = instance; -+ list_add_tail(&lookup->li, &qrtr_ns.lookups); -+ -+ memset(&filter, 0, sizeof(filter)); -+ filter.service = service; -+ filter.instance = instance; -+ -+ radix_tree_for_each_slot(node_slot, &nodes, &node_iter, 0) { -+ node = radix_tree_deref_slot(node_slot); -+ -+ radix_tree_for_each_slot(srv_slot, &node->servers, -+ &srv_iter, 0) { -+ struct qrtr_server *srv; -+ -+ srv = radix_tree_deref_slot(srv_slot); -+ if (!server_match(srv, &filter)) -+ continue; -+ -+ lookup_notify(from, srv, true); -+ } -+ } -+ -+ /* Empty notification, to indicate end of listing */ -+ lookup_notify(from, NULL, true); -+ -+ return 0; -+} -+ -+static void ctrl_cmd_del_lookup(struct sockaddr_qrtr *from, -+ unsigned int service, unsigned int instance) -+{ -+ struct qrtr_lookup *lookup; -+ struct list_head *tmp; -+ struct list_head *li; -+ -+ list_for_each_safe(li, tmp, &qrtr_ns.lookups) { -+ lookup = container_of(li, struct qrtr_lookup, li); -+ if (lookup->sq.sq_node != from->sq_node) -+ continue; -+ if (lookup->sq.sq_port != from->sq_port) -+ continue; -+ if (lookup->service != service) -+ continue; -+ if (lookup->instance && lookup->instance != instance) -+ continue; -+ -+ list_del(&lookup->li); -+ kfree(lookup); -+ } -+} -+ -+static void qrtr_ns_worker(struct work_struct *work) -+{ -+ const struct qrtr_ctrl_pkt *pkt; -+ size_t recv_buf_size = 4096; -+ struct sockaddr_qrtr sq; -+ struct msghdr msg = { }; -+ unsigned int cmd; -+ ssize_t msglen; -+ void *recv_buf; -+ struct kvec iv; -+ int ret; -+ -+ msg.msg_name = (struct sockaddr *)&sq; -+ msg.msg_namelen = sizeof(sq); -+ -+ recv_buf = kzalloc(recv_buf_size, GFP_KERNEL); -+ if (!recv_buf) -+ return; -+ -+ for (;;) { -+ iv.iov_base = recv_buf; -+ iv.iov_len = recv_buf_size; -+ -+ msglen = kernel_recvmsg(qrtr_ns.sock, &msg, &iv, 1, -+ iv.iov_len, MSG_DONTWAIT); -+ -+ if (msglen == -EAGAIN) -+ break; -+ -+ if (msglen < 0) { -+ pr_err("error receiving packet: %zd\n", msglen); -+ break; -+ } -+ -+ pkt = recv_buf; -+ cmd = le32_to_cpu(pkt->cmd); -+ if (cmd < ARRAY_SIZE(qrtr_ctrl_pkt_strings) && -+ qrtr_ctrl_pkt_strings[cmd]) -+ trace_qrtr_ns_message(qrtr_ctrl_pkt_strings[cmd], -+ sq.sq_node, sq.sq_port); -+ -+ ret = 0; -+ switch (cmd) { -+ case QRTR_TYPE_HELLO: -+ ret = ctrl_cmd_hello(&sq); -+ break; -+ case QRTR_TYPE_BYE: -+ ret = ctrl_cmd_bye(&sq); -+ break; -+ case QRTR_TYPE_DEL_CLIENT: -+ ret = ctrl_cmd_del_client(&sq, -+ le32_to_cpu(pkt->client.node), -+ le32_to_cpu(pkt->client.port)); -+ break; -+ case QRTR_TYPE_NEW_SERVER: -+ ret = ctrl_cmd_new_server(&sq, -+ le32_to_cpu(pkt->server.service), -+ le32_to_cpu(pkt->server.instance), -+ le32_to_cpu(pkt->server.node), -+ le32_to_cpu(pkt->server.port)); -+ break; -+ case QRTR_TYPE_DEL_SERVER: -+ ret = ctrl_cmd_del_server(&sq, -+ le32_to_cpu(pkt->server.service), -+ le32_to_cpu(pkt->server.instance), -+ le32_to_cpu(pkt->server.node), -+ le32_to_cpu(pkt->server.port)); -+ break; -+ case QRTR_TYPE_EXIT: -+ case QRTR_TYPE_PING: -+ case QRTR_TYPE_RESUME_TX: -+ break; -+ case QRTR_TYPE_NEW_LOOKUP: -+ ret = ctrl_cmd_new_lookup(&sq, -+ le32_to_cpu(pkt->server.service), -+ le32_to_cpu(pkt->server.instance)); -+ break; -+ case QRTR_TYPE_DEL_LOOKUP: -+ ctrl_cmd_del_lookup(&sq, -+ le32_to_cpu(pkt->server.service), -+ le32_to_cpu(pkt->server.instance)); -+ break; -+ } -+ -+ if (ret < 0) -+ pr_err("failed while handling packet from %d:%d", -+ sq.sq_node, sq.sq_port); -+ } -+ -+ kfree(recv_buf); -+} -+ -+static void qrtr_ns_data_ready(struct sock *sk) -+{ -+ queue_work(qrtr_ns.workqueue, &qrtr_ns.work); -+} -+ -+void qrtr_ns_init(void) -+{ -+ struct sockaddr_qrtr sq; -+ int sl = sizeof(sq); -+ int ret; -+ -+ INIT_LIST_HEAD(&qrtr_ns.lookups); -+ INIT_WORK(&qrtr_ns.work, qrtr_ns_worker); -+ -+ ret = sock_create_kern(&init_net, AF_QIPCRTR, SOCK_DGRAM, -+ PF_QIPCRTR, &qrtr_ns.sock); -+ if (ret < 0) -+ return; -+ -+ ret = kernel_getsockname(qrtr_ns.sock, (struct sockaddr *)&sq, &sl); -+ if (ret < 0) { -+ pr_err("failed to get socket name\n"); -+ goto err_sock; -+ } -+ -+ qrtr_ns.workqueue = alloc_workqueue("qrtr_ns_handler", WQ_UNBOUND, 1); -+ if (!qrtr_ns.workqueue) -+ goto err_sock; -+ -+ qrtr_ns.sock->sk->sk_data_ready = qrtr_ns_data_ready; -+ -+ sq.sq_port = QRTR_PORT_CTRL; -+ qrtr_ns.local_node = sq.sq_node; -+ -+ ret = kernel_bind(qrtr_ns.sock, (struct sockaddr *)&sq, sizeof(sq)); -+ if (ret < 0) { -+ pr_err("failed to bind to socket\n"); -+ goto err_wq; -+ } -+ -+ qrtr_ns.bcast_sq.sq_family = AF_QIPCRTR; -+ qrtr_ns.bcast_sq.sq_node = QRTR_NODE_BCAST; -+ qrtr_ns.bcast_sq.sq_port = QRTR_PORT_CTRL; -+ -+ ret = say_hello(&qrtr_ns.bcast_sq); -+ if (ret < 0) -+ goto err_wq; -+ -+ return; -+ -+err_wq: -+ destroy_workqueue(qrtr_ns.workqueue); -+err_sock: -+ sock_release(qrtr_ns.sock); -+} -+EXPORT_SYMBOL_GPL(qrtr_ns_init); -+ -+void qrtr_ns_remove(void) -+{ -+ cancel_work_sync(&qrtr_ns.work); -+ destroy_workqueue(qrtr_ns.workqueue); -+ sock_release(qrtr_ns.sock); -+} -+EXPORT_SYMBOL_GPL(qrtr_ns_remove); -+ -+MODULE_AUTHOR("Manivannan Sadhasivam "); -+MODULE_DESCRIPTION("Qualcomm IPC Router Nameservice"); -+MODULE_LICENSE("Dual BSD/GPL"); -Index: linux-4.4.60/net/qrtr/qrtr.c -=================================================================== ---- linux-4.4.60.orig/net/qrtr/qrtr.c -+++ linux-4.4.60/net/qrtr/qrtr.c -@@ -135,6 +135,8 @@ static DEFINE_IDR(qrtr_ports); - static DEFINE_MUTEX(qrtr_port_lock); - static DEFINE_MUTEX(qrtr_node_locking); - -+static struct delayed_work qrtr_ns_work; -+ - /** - * struct qrtr_node - endpoint node - * @ep_lock: lock for endpoint management and callbacks -@@ -1765,33 +1767,6 @@ static int qrtr_create(struct net *net, - return 0; - } - --static const struct nla_policy qrtr_policy[IFA_MAX + 1] = { -- [IFA_LOCAL] = { .type = NLA_U32 }, --}; -- --static int qrtr_addr_doit(struct sk_buff *skb, struct nlmsghdr *nlh) --{ -- struct nlattr *tb[IFA_MAX + 1]; -- struct ifaddrmsg *ifm; -- int rc; -- -- if (!netlink_capable(skb, CAP_NET_ADMIN)) -- return -EPERM; -- -- ASSERT_RTNL(); -- -- rc = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, qrtr_policy); -- if (rc < 0) -- return rc; -- -- ifm = nlmsg_data(nlh); -- if (!tb[IFA_LOCAL]) -- return -EINVAL; -- -- qrtr_local_nid = nla_get_u32(tb[IFA_LOCAL]); -- return 0; --} -- - static const struct net_proto_family qrtr_family = { - .owner = THIS_MODULE, - .family = AF_QIPCRTR, -@@ -1811,7 +1786,8 @@ static int __init qrtr_proto_init(void) - proto_unregister(&qrtr_proto); - return rc; - } -- rtnl_register(PF_QIPCRTR, RTM_NEWADDR, qrtr_addr_doit, NULL, NULL); -+ -+ qrtr_ns_init(); - - return 0; - } -@@ -1819,7 +1795,8 @@ postcore_initcall(qrtr_proto_init); - - static void __exit qrtr_proto_fini(void) - { -- rtnl_unregister(PF_QIPCRTR, RTM_NEWADDR); -+ cancel_delayed_work_sync(&qrtr_ns_work); -+ qrtr_ns_remove(); - sock_unregister(qrtr_family.family); - proto_unregister(&qrtr_proto); - } -Index: linux-4.4.60/net/qrtr/qrtr.h -=================================================================== ---- linux-4.4.60.orig/net/qrtr/qrtr.h -+++ linux-4.4.60/net/qrtr/qrtr.h -@@ -33,4 +33,9 @@ void qrtr_endpoint_unregister(struct qrt - int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len); - - int qrtr_peek_pkt_size(const void *data); -+ -+void qrtr_ns_init(void); -+ -+void qrtr_ns_remove(void); -+ - #endif -Index: linux-4.4.60/net/qrtr/Makefile -=================================================================== ---- linux-4.4.60.orig/net/qrtr/Makefile -+++ linux-4.4.60/net/qrtr/Makefile -@@ -1,4 +1,4 @@ --obj-$(CONFIG_QRTR) := qrtr.o -+obj-$(CONFIG_QRTR) := qrtr.o ns.o - - obj-$(CONFIG_QRTR_SMD) += qrtr-smd.o - qrtr-smd-y := smd.o -Index: linux-4.4.60/include/trace/events/qrtr.h -=================================================================== ---- /dev/null -+++ linux-4.4.60/include/trace/events/qrtr.h -@@ -0,0 +1,115 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+#undef TRACE_SYSTEM -+#define TRACE_SYSTEM qrtr -+ -+#if !defined(_TRACE_QRTR_H) || defined(TRACE_HEADER_MULTI_READ) -+#define _TRACE_QRTR_H -+ -+#include -+#include -+ -+TRACE_EVENT(qrtr_ns_service_announce_new, -+ -+ TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port), -+ -+ TP_ARGS(service, instance, node, port), -+ -+ TP_STRUCT__entry( -+ __field(__le32, service) -+ __field(__le32, instance) -+ __field(__le32, node) -+ __field(__le32, port) -+ ), -+ -+ TP_fast_assign( -+ __entry->service = service; -+ __entry->instance = instance; -+ __entry->node = node; -+ __entry->port = port; -+ ), -+ -+ TP_printk("advertising new server [%d:%x]@[%d:%d]", -+ __entry->service, __entry->instance, __entry->node, -+ __entry->port -+ ) -+); -+ -+TRACE_EVENT(qrtr_ns_service_announce_del, -+ -+ TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port), -+ -+ TP_ARGS(service, instance, node, port), -+ -+ TP_STRUCT__entry( -+ __field(__le32, service) -+ __field(__le32, instance) -+ __field(__le32, node) -+ __field(__le32, port) -+ ), -+ -+ TP_fast_assign( -+ __entry->service = service; -+ __entry->instance = instance; -+ __entry->node = node; -+ __entry->port = port; -+ ), -+ -+ TP_printk("advertising removal of server [%d:%x]@[%d:%d]", -+ __entry->service, __entry->instance, __entry->node, -+ __entry->port -+ ) -+); -+ -+TRACE_EVENT(qrtr_ns_server_add, -+ -+ TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port), -+ -+ TP_ARGS(service, instance, node, port), -+ -+ TP_STRUCT__entry( -+ __field(__le32, service) -+ __field(__le32, instance) -+ __field(__le32, node) -+ __field(__le32, port) -+ ), -+ -+ TP_fast_assign( -+ __entry->service = service; -+ __entry->instance = instance; -+ __entry->node = node; -+ __entry->port = port; -+ ), -+ -+ TP_printk("add server [%d:%x]@[%d:%d]", -+ __entry->service, __entry->instance, __entry->node, -+ __entry->port -+ ) -+); -+ -+TRACE_EVENT(qrtr_ns_message, -+ -+ TP_PROTO(const char * const ctrl_pkt_str, __u32 sq_node, __u32 sq_port), -+ -+ TP_ARGS(ctrl_pkt_str, sq_node, sq_port), -+ -+ TP_STRUCT__entry( -+ __string(ctrl_pkt_str, ctrl_pkt_str) -+ __field(__u32, sq_node) -+ __field(__u32, sq_port) -+ ), -+ -+ TP_fast_assign( -+ __assign_str(ctrl_pkt_str, ctrl_pkt_str); -+ __entry->sq_node = sq_node; -+ __entry->sq_port = sq_port; -+ ), -+ -+ TP_printk("%s from %d:%d", -+ __get_str(ctrl_pkt_str), __entry->sq_node, __entry->sq_port -+ ) -+); -+ -+#endif /* _TRACE_QRTR_H */ -+ -+/* This part must be outside protection */ -+#include diff --git a/feeds/ipq807x/ipq807x/patches/101-squashfs.patch b/feeds/ipq807x/ipq807x/patches/101-squashfs.patch deleted file mode 100644 index 5744a2a5b..000000000 --- a/feeds/ipq807x/ipq807x/patches/101-squashfs.patch +++ /dev/null @@ -1,16 +0,0 @@ -Index: linux-4.4.60/fs/squashfs/xz_wrapper.c -=================================================================== ---- linux-4.4.60.orig/fs/squashfs/xz_wrapper.c -+++ linux-4.4.60/fs/squashfs/xz_wrapper.c -@@ -40,10 +40,8 @@ struct squashfs_xz { - }; - - struct disk_comp_opts { -- __le32 flags; -- __le16 bit_opts; -- __le16 fb; - __le32 dictionary_size; -+ __le32 flags; - }; - - struct comp_opts { diff --git a/feeds/ipq807x/ipq807x/patches/102-aq-phy.patch b/feeds/ipq807x/ipq807x/patches/102-aq-phy.patch deleted file mode 100644 index 6c6d9b88e..000000000 --- a/feeds/ipq807x/ipq807x/patches/102-aq-phy.patch +++ /dev/null @@ -1,90 +0,0 @@ -Index: linux-4.4.60-qsdk-ad8f8efb2edcd35cdb130466cfc1923c37ef7ec1/drivers/net/phy/aquantia.c -=================================================================== ---- linux-4.4.60-qsdk-ad8f8efb2edcd35cdb130466cfc1923c37ef7ec1.orig/drivers/net/phy/aquantia.c -+++ linux-4.4.60-qsdk-ad8f8efb2edcd35cdb130466cfc1923c37ef7ec1/drivers/net/phy/aquantia.c -@@ -32,6 +32,7 @@ - #define PHY_ID_AQR112 0x03a1b660 - #define PHY_ID_AQR113C 0x31c31C10 - #define PHY_ID_AQR112C 0x03a1b792 -+#define PHY_ID_AQR114C 0x31c31C22 - - #define AQ_PHY_MAX_VALID_MMD_REG 0xff01 - #define AQ_PHY_MAX_INVALID_MMD_REG 0xffff -@@ -756,6 +757,25 @@ static struct phy_driver aquantia_driver - .update_link = aquantia_update_link, - .driver = { .owner = THIS_MODULE,}, - }, -+{ -+ .phy_id = PHY_ID_AQR114C, -+ .phy_id_mask = 0xfffffff0, -+ .name = "Aquantia AQR114C", -+ .features = PHY_AQUANTIA_FEATURES, -+ .flags = PHY_HAS_INTERRUPT, -+ .probe = aquantia_phy_probe, -+ .soft_reset = aquantia_soft_reset, -+ .config_init = aquantia_config_init, -+ .aneg_done = aquantia_aneg_done, -+ .config_aneg = aquantia_config_aneg, -+ .config_intr = aquantia_config_intr, -+ .ack_interrupt = aquantia_ack_interrupt, -+ .read_status = aquantia_read_status, -+ .suspend = aquantia_suspend, -+ .resume = aquantia_resume, -+ .update_link = aquantia_update_link, -+ .driver = { .owner = THIS_MODULE,}, -+}, - }; - - module_phy_driver(aquantia_driver); -@@ -773,6 +793,7 @@ static struct mdio_device_id __maybe_unu - { PHY_ID_AQR112, 0xfffffff0 }, - { PHY_ID_AQR113C, 0xfffffff0 }, - { PHY_ID_AQR112C, 0xfffffff0 }, -+ { PHY_ID_AQR114C, 0xfffffff0 }, - { } - }; - -Index: linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/drivers/net/phy/aquantia.c -=================================================================== ---- linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce.orig/drivers/net/phy/aquantia.c -+++ linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/drivers/net/phy/aquantia.c -@@ -29,6 +29,7 @@ - #define PHY_ID_AQR109 0x03a1b502 - #define PHY_ID_AQR111 0x03a1b610 - #define PHY_ID_AQR111B0 0x03a1b612 -+#define PHY_ID_AQR111C 0x03a1b7e2 - #define PHY_ID_AQR112 0x03a1b660 - #define PHY_ID_AQR113C 0x31c31C10 - #define PHY_ID_AQR112C 0x03a1b792 -@@ -701,6 +702,23 @@ static struct phy_driver aquantia_driver - .driver = { .owner = THIS_MODULE,}, - }, - { -+ .phy_id = PHY_ID_AQR111C, -+ .phy_id_mask = 0xfffffff0, -+ .name = "Aquantia AQR111C", -+ .features = PHY_AQUANTIA_FEATURES, -+ .flags = PHY_HAS_INTERRUPT, -+ .probe = aquantia_phy_probe, -+ .soft_reset = aquantia_soft_reset, -+ .config_init = aquantia_config_init, -+ .aneg_done = aquantia_aneg_done, -+ .config_aneg = aquantia_config_aneg, -+ .config_intr = aquantia_config_intr, -+ .ack_interrupt = aquantia_ack_interrupt, -+ .read_status = aquantia_read_status, -+ .update_link = aquantia_update_link, -+ .driver = { .owner = THIS_MODULE,}, -+}, -+{ - .phy_id = PHY_ID_AQR112, - .phy_id_mask = 0xfffffff0, - .name = "Aquantia AQR112", -@@ -790,6 +808,7 @@ static struct mdio_device_id __maybe_unu - { PHY_ID_AQR109, 0xfffffff0 }, - { PHY_ID_AQR111, 0xfffffff0 }, - { PHY_ID_AQR111B0, 0xfffffff0 }, -+ { PHY_ID_AQR111C, 0xfffffff0 }, - { PHY_ID_AQR112, 0xfffffff0 }, - { PHY_ID_AQR113C, 0xfffffff0 }, - { PHY_ID_AQR112C, 0xfffffff0 }, diff --git a/feeds/ipq807x/ipq807x/patches/103-fix-dtc-gcc10-build.patch b/feeds/ipq807x/ipq807x/patches/103-fix-dtc-gcc10-build.patch deleted file mode 100644 index f91601ec5..000000000 --- a/feeds/ipq807x/ipq807x/patches/103-fix-dtc-gcc10-build.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/scripts/dtc/dtc-lexer.lex.c_shipped -+++ b/scripts/dtc/dtc-lexer.lex.c_shipped -@@ -637,7 +637,7 @@ char *yytext; - #include "srcpos.h" - #include "dtc-parser.tab.h" - --YYLTYPE yylloc; -+extern YYLTYPE yylloc; - extern bool treesource_error; - - /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ diff --git a/feeds/ipq807x/ipq807x/patches/104-log-spam.patch b/feeds/ipq807x/ipq807x/patches/104-log-spam.patch deleted file mode 100644 index 94b2a3ffd..000000000 --- a/feeds/ipq807x/ipq807x/patches/104-log-spam.patch +++ /dev/null @@ -1,37 +0,0 @@ -Index: linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/drivers/clk/qcom/clk-branch.c -=================================================================== ---- linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce.orig/drivers/clk/qcom/clk-branch.c -+++ linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/drivers/clk/qcom/clk-branch.c -@@ -75,7 +75,7 @@ static int clk_branch_wait(const struct - bool (check_halt)(const struct clk_branch *, bool)) - { - bool voted = br->halt_check & BRANCH_VOTED; -- const char *name = clk_hw_get_name(&br->clkr.hw); -+ //const char *name = clk_hw_get_name(&br->clkr.hw); - - /* Skip checking halt bit if the clock is in hardware gated mode */ - if (clk_branch_in_hwcg_mode(br)) -@@ -93,8 +93,8 @@ static int clk_branch_wait(const struct - return 0; - udelay(1); - } -- WARN(1, "%s status stuck at 'o%s'", name, -- enabling ? "ff" : "n"); -+/* WARN(1, "%s status stuck at 'o%s'", name, -+ enabling ? "ff" : "n");*/ - return -EBUSY; - } - return 0; -Index: linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/drivers/usb/phy/phy-msm-qusb.c -=================================================================== ---- linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce.orig/drivers/usb/phy/phy-msm-qusb.c -+++ linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/drivers/usb/phy/phy-msm-qusb.c -@@ -491,7 +491,7 @@ static int qusb_phy_init(struct usb_phy - dev_err(phy->dev, "QUSB PHY PLL LOCK fails:%x\n", - readb_relaxed(qphy->base - + QUSB2PHY_PLL_STATUS)); -- WARN_ON(1); -+ //WARN_ON(1); - } - - /* Set OTG VBUS Valid from HSPHY to controller */ diff --git a/feeds/ipq807x/ipq807x/patches/105-add-esmt-nand.patch b/feeds/ipq807x/ipq807x/patches/105-add-esmt-nand.patch deleted file mode 100644 index d47a4d0d1..000000000 --- a/feeds/ipq807x/ipq807x/patches/105-add-esmt-nand.patch +++ /dev/null @@ -1,37 +0,0 @@ -Index: linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/drivers/mtd/nand/nand_ids.c -=================================================================== ---- linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce.orig/drivers/mtd/nand/nand_ids.c -+++ linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/drivers/mtd/nand/nand_ids.c -@@ -62,6 +62,12 @@ struct nand_flash_dev nand_flash_ids[] = - {"TH58NYG3S0H 8G 1.8V 8-bit", - { .id = {0x98, 0xa3, 0x91, 0x26} }, - SZ_4K, SZ_1K, SZ_256K, 0, 4, 256, NAND_ECC_INFO(8, SZ_512) }, -+ -+ {"F59D2G81KA 2G 1.8V 8-bit", -+ { .id = {0xc8, 0x5a, 0x90, 0x04} }, -+ SZ_2K, SZ_256, SZ_128K, 0, 4, 128, NAND_ECC_INFO(8, SZ_512) }, -+ -+ - LEGACY_ID_NAND("NAND 4MiB 5V 8-bit", 0x6B, 4, SZ_8K, SP_OPTIONS), - LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 4, SZ_8K, SP_OPTIONS), - LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE5, 4, SZ_8K, SP_OPTIONS), -@@ -190,6 +196,7 @@ struct nand_manufacturers nand_manuf_ids - {NAND_MFR_SANDISK, "SanDisk"}, - {NAND_MFR_INTEL, "Intel"}, - {NAND_MFR_ATO, "ATO"}, -+ {NAND_MFR_ESMT, "ESMT"}, - {NAND_MFR_GIGA, "GigaDevice"}, - {NAND_MFR_ATO, "ATO"}, - {NAND_MFR_WINBOND, "Winbond"}, -Index: linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/include/linux/mtd/nand.h -=================================================================== ---- linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce.orig/include/linux/mtd/nand.h -+++ linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/include/linux/mtd/nand.h -@@ -778,6 +778,7 @@ static inline struct mtd_info *nand_to_m - #define NAND_MFR_ATO 0x9b - #define NAND_MFR_WINBOND 0xef - #define NAND_MFR_FIDELIX 0xe5 -+#define NAND_MFR_ESMT 0xc8 - - /* The maximum expected count of bytes in the NAND ID sequence */ - #define NAND_MAX_ID_LEN 8 diff --git a/feeds/ipq807x/ipq807x/patches/106-pstore.patch b/feeds/ipq807x/ipq807x/patches/106-pstore.patch deleted file mode 100644 index 4124eed7c..000000000 --- a/feeds/ipq807x/ipq807x/patches/106-pstore.patch +++ /dev/null @@ -1,149 +0,0 @@ -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi -@@ -92,6 +92,12 @@ - reg = <0x0 0x40000000 0x0 0x00800000>; - }; - -+ ramoops@4A0f0000 { -+ compatible = "ramoops"; -+ reg = <0 0x4A0f0000 0 0x10000>; -+ record-size = <0x1000>; -+ }; -+ - uboot@4A100000 { - no-map; - reg = <0x0 0x4A100000 0x0 0x00400000>; -@@ -211,6 +217,12 @@ - reg = <0x0 0x40000000 0x0 0x01000000>; - }; - -+ ramoops@4A0f0000 { -+ compatible = "ramoops"; -+ reg = <0 0x4A0f0000 0 0x10000>; -+ record-size = <0x1000>; -+ }; -+ - uboot@4A100000 { - no-map; - reg = <0x0 0x4A100000 0x0 0x00400000>; -@@ -330,6 +342,12 @@ - reg = <0x0 0x40000000 0x0 0x01000000>; - }; - -+ ramoops@4A0f0000 { -+ compatible = "ramoops"; -+ reg = <0 0x4A0f0000 0 0x10000>; -+ record-size = <0x1000>; -+ }; -+ - uboot@4A100000 { - no-map; - reg = <0x0 0x4A100000 0x0 0x00400000>; -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/fs/pstore/ram.c -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/fs/pstore/ram.c -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/fs/pstore/ram.c -@@ -466,15 +466,48 @@ static int ramoops_init_prz(struct devic - return 0; - } - -+static int ramoops_parse_dt(struct platform_device *pdev, -+ struct ramoops_platform_data *pdata) -+{ -+ struct resource *res; -+ -+ dev_dbg(&pdev->dev, "using Device Tree\n"); -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (!res) { -+ dev_err(&pdev->dev, -+ "failed to locate DT /reserved-memory resource\n"); -+ return -EINVAL; -+ } -+ -+ pdata->mem_size = resource_size(res); -+ pdata->mem_address = res->start; -+ pdata->dump_oops = true; -+ pdata->record_size = 0x1000; -+ pdata->pmsg_size = 0x1000; -+ pdata->console_size = 0x1000; -+ return 0; -+} -+ - static int ramoops_probe(struct platform_device *pdev) - { - struct device *dev = &pdev->dev; - struct ramoops_platform_data *pdata = pdev->dev.platform_data; -+ struct ramoops_platform_data pdata_local; - struct ramoops_context *cxt = &oops_cxt; - size_t dump_mem_sz; - phys_addr_t paddr; - int err = -EINVAL; - -+ if (dev_of_node(dev) && !pdata) { -+ pdata = &pdata_local; -+ memset(pdata, 0, sizeof(*pdata)); -+ -+ err = ramoops_parse_dt(pdev, pdata); -+ if (err < 0) -+ goto fail_out; -+ } -+ - /* Only a single ramoops area allowed at a time, so fail extra - * probes. - */ -@@ -603,11 +635,17 @@ static int ramoops_remove(struct platfor - return 0; - } - -+static const struct of_device_id dt_match[] = { -+ { .compatible = "ramoops" }, -+ {} -+}; -+ - static struct platform_driver ramoops_driver = { - .probe = ramoops_probe, - .remove = ramoops_remove, - .driver = { - .name = "ramoops", -+ .of_match_table = dt_match, - }, - }; - -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/of/platform.c -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/of/platform.c -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/of/platform.c -@@ -53,6 +53,30 @@ struct platform_device *of_find_device_b - } - EXPORT_SYMBOL(of_find_device_by_node); - -+static const struct of_device_id reserved_mem_matches[] = { -+ { .compatible = "ramoops" }, -+ {} -+}; -+ -+static int __init of_platform_default_populate_init(void) -+{ -+ struct device_node *node; -+ -+ if (!of_have_populated_dt()) -+ return -ENODEV; -+ -+ /* -+ * Handle certain compatibles explicitly, since we don't want to create -+ * platform_devices for every node in /reserved-memory with a -+ * "compatible", -+ */ -+ for_each_matching_node(node, reserved_mem_matches) -+ of_platform_device_create(node, NULL, NULL); -+ -+ return 0; -+} -+arch_initcall_sync(of_platform_default_populate_init); -+ - #ifdef CONFIG_OF_ADDRESS - /* - * The following routines scan a subtree and registers a device for diff --git a/feeds/ipq807x/ipq807x/patches/107-bridge-allow-bcast-mcast-same-port-hairpinmode.patch b/feeds/ipq807x/ipq807x/patches/107-bridge-allow-bcast-mcast-same-port-hairpinmode.patch deleted file mode 100644 index 99989b306..000000000 --- a/feeds/ipq807x/ipq807x/patches/107-bridge-allow-bcast-mcast-same-port-hairpinmode.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/net/bridge/br_forward.c -=================================================================== ---- linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce.orig/net/bridge/br_forward.c -+++ linux-4.4.60-qsdk-10fd7d14853b7020b804acae690c8acec5d954ce/net/bridge/br_forward.c -@@ -33,8 +33,7 @@ static inline int should_deliver(const s - struct net_bridge_vlan_group *vg; - - vg = nbp_vlan_group_rcu(p); -- return ((skb->dev != p->dev) || ((p->flags & BR_HAIRPIN_MODE) && -- (!is_multicast_ether_addr(eth_hdr(skb)->h_dest)))) && -+ return ((skb->dev != p->dev) || (p->flags & BR_HAIRPIN_MODE)) && - br_allowed_egress(vg, skb) && p->state == BR_STATE_FORWARDING; - } - diff --git a/feeds/ipq807x/ipq807x/patches/108-add-W25N01GW.patch b/feeds/ipq807x/ipq807x/patches/108-add-W25N01GW.patch deleted file mode 100644 index f00cec911..000000000 --- a/feeds/ipq807x/ipq807x/patches/108-add-W25N01GW.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/mtd/nand/qcom_nandc.c -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/mtd/nand/qcom_nandc.c -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/mtd/nand/qcom_nandc.c -@@ -405,6 +405,9 @@ struct nand_flash_dev qspinand_flash_ids - {"MX35UF1GE4AC SPI NAND 1G 1.8V", - { .id = {0xc2, 0x92} }, - SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(4, SZ_512), 0}, -+ {"W25N01GW SPI NAND 1.8V 1G-BIT", -+ { .id = {0xef, 0xba} }, -+ SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(4, SZ_512), 0}, - {NULL} - }; - diff --git a/feeds/ipq807x/ipq807x/patches/109-net-bridge-clear-bridge-s-private-skb-space-on-xmit.patch b/feeds/ipq807x/ipq807x/patches/109-net-bridge-clear-bridge-s-private-skb-space-on-xmit.patch deleted file mode 100644 index 20f71569d..000000000 --- a/feeds/ipq807x/ipq807x/patches/109-net-bridge-clear-bridge-s-private-skb-space-on-xmit.patch +++ /dev/null @@ -1,36 +0,0 @@ -From fd65e5a95d08389444e8591a20538b3edece0e15 Mon Sep 17 00:00:00 2001 -From: Nikolay Aleksandrov -Date: Fri, 31 Jul 2020 19:26:16 +0300 -Subject: [PATCH] net: bridge: clear bridge's private skb space on xmit - -We need to clear all of the bridge private skb variables as they can be -stale due to the packet being recirculated through the stack and then -transmitted through the bridge device. Similar memset is already done on -bridge's input. We've seen cases where proxyarp_replied was 1 on routed -multicast packets transmitted through the bridge to ports with neigh -suppress which were getting dropped. Same thing can in theory happen with -the port isolation bit as well. - -Fixes: 821f1b21cabb ("bridge: add new BR_NEIGH_SUPPRESS port flag to suppress arp and nd flood") -Signed-off-by: Nikolay Aleksandrov -Signed-off-by: David S. Miller ---- - net/bridge/br_device.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c -index 8c7b78f8bc23..9a2fb4aa1a10 100644 ---- a/net/bridge/br_device.c -+++ b/net/bridge/br_device.c -@@ -36,6 +36,8 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) - const unsigned char *dest; - u16 vid = 0; - -+ memset(skb->cb, 0, sizeof(struct br_input_skb_cb)); -+ - rcu_read_lock(); - nf_ops = rcu_dereference(nf_br_ops); - if (nf_ops && nf_ops->br_dev_xmit_hook(skb)) { --- -2.25.1 - diff --git a/feeds/ipq807x/ipq807x/patches/110-add-dosilicon-nand.patch b/feeds/ipq807x/ipq807x/patches/110-add-dosilicon-nand.patch deleted file mode 100644 index d3a4feebb..000000000 --- a/feeds/ipq807x/ipq807x/patches/110-add-dosilicon-nand.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/mtd/nand/nand_ids.c -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/mtd/nand/nand_ids.c -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/mtd/nand/nand_ids.c -@@ -67,6 +67,9 @@ struct nand_flash_dev nand_flash_ids[] = - { .id = {0xc8, 0x5a, 0x90, 0x04} }, - SZ_2K, SZ_256, SZ_128K, 0, 4, 128, NAND_ECC_INFO(8, SZ_512) }, - -+ {"DS35M1GA SPI NAND 1G 1.8V", -+ { .id = {0xe5, 0x21} }, -+ SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(4, SZ_512) }, - - LEGACY_ID_NAND("NAND 4MiB 5V 8-bit", 0x6B, 4, SZ_8K, SP_OPTIONS), - LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 4, SZ_8K, SP_OPTIONS), diff --git a/feeds/ipq807x/ipq807x/patches/110-add-nand-MX35UF1GE4AD-MX35UF2GE4AD.patch b/feeds/ipq807x/ipq807x/patches/110-add-nand-MX35UF1GE4AD-MX35UF2GE4AD.patch deleted file mode 100644 index 682117e6c..000000000 --- a/feeds/ipq807x/ipq807x/patches/110-add-nand-MX35UF1GE4AD-MX35UF2GE4AD.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -Naur linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/mtd/nand/qcom_nandc.c linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/mtd/nand/qcom_nandc.c ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/mtd/nand/qcom_nandc.c 2022-07-26 10:43:12.428432000 +0800 -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/mtd/nand/qcom_nandc.c 2022-07-26 13:46:35.283160000 +0800 -@@ -405,6 +405,12 @@ - {"MX35UF1GE4AC SPI NAND 1G 1.8V", - { .id = {0xc2, 0x92} }, - SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(4, SZ_512), 0}, -+ {"MX35UF1GE4AD SPI NAND 1G 1.8V", -+ { .id = {0xc2, 0x96} }, -+ SZ_2K, SZ_128, SZ_128K, 0, 2, 128, NAND_ECC_INFO(8, SZ_512), 0}, -+ {"MX35UF2GE4AD SPI NAND 2G 1.8V", -+ { .id = {0xc2, 0xa6} }, -+ SZ_2K, SZ_256, SZ_128K, 0, 2, 128, NAND_ECC_INFO(8, SZ_512), 0}, - {"W25N01GW SPI NAND 1.8V 1G-BIT", - { .id = {0xef, 0xba} }, - SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(4, SZ_512), 0}, diff --git a/feeds/ipq807x/ipq807x/patches/120-dwc3-gpio-opps.patch b/feeds/ipq807x/ipq807x/patches/120-dwc3-gpio-opps.patch deleted file mode 100644 index 5df4bf7d1..000000000 --- a/feeds/ipq807x/ipq807x/patches/120-dwc3-gpio-opps.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/usb/dwc3/dwc3-qcom.c -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/usb/dwc3/dwc3-qcom.c -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/usb/dwc3/dwc3-qcom.c -@@ -669,7 +669,7 @@ static int dwc3_qcom_probe(struct platfo - /* enable vbus override for device mode */ - if (qcom->mode == USB_DR_MODE_PERIPHERAL) - dwc3_qcom_vbus_overrride_enable(qcom, true); -- else if (qcom->device_power_gpio) -+ else if (!IS_ERR(qcom->device_power_gpio)) - gpiod_set_value(qcom->device_power_gpio, 0); - - #if defined(CONFIG_IPQ_DWC3_QTI_EXTCON) diff --git a/feeds/ipq807x/ipq807x/patches/130-proxy-arp.patch b/feeds/ipq807x/ipq807x/patches/130-proxy-arp.patch deleted file mode 100644 index f60ea1d04..000000000 --- a/feeds/ipq807x/ipq807x/patches/130-proxy-arp.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/net/bridge/br_input.c -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/net/bridge/br_input.c -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/net/bridge/br_input.c -@@ -125,7 +125,8 @@ static void br_do_proxy_arp(struct sk_bu - - f = __br_fdb_get(br, n->ha, vid); - if (f && ((p->flags & BR_PROXYARP) || -- (f->dst && (f->dst->flags & BR_PROXYARP_WIFI)))) { -+ (f->dst && (f->dst->flags & BR_PROXYARP_WIFI))) -+ && memcmp(sha, n->ha, 6)) { - arp_send(ARPOP_REPLY, ETH_P_ARP, sip, skb->dev, tip, - sha, n->ha, sha); - BR_INPUT_SKB_CB(skb)->proxyarp_replied = true; diff --git a/feeds/ipq807x/ipq807x/patches/200-bpf_backport.patch b/feeds/ipq807x/ipq807x/patches/200-bpf_backport.patch deleted file mode 100644 index dd68a5553..000000000 --- a/feeds/ipq807x/ipq807x/patches/200-bpf_backport.patch +++ /dev/null @@ -1,44780 +0,0 @@ ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -38,7 +38,7 @@ config ARM - select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 - select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) - select HAVE_ARCH_TRACEHOOK -- select HAVE_BPF_JIT -+ select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 - select HAVE_CC_STACKPROTECTOR - select HAVE_CONTEXT_TRACKING - select HAVE_C_RECORDMCOUNT ---- a/arch/arm/net/bpf_jit_32.c -+++ b/arch/arm/net/bpf_jit_32.c -@@ -1,13 +1,12 @@ -+// SPDX-License-Identifier: GPL-2.0-only - /* -- * Just-In-Time compiler for BPF filters on 32bit ARM -+ * Just-In-Time compiler for eBPF filters on 32bit ARM - * -+ * Copyright (c) 2017 Shubham Bansal - * Copyright (c) 2011 Mircea Gherzan -- * -- * This program is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation; version 2 of the License. - */ - -+#include - #include - #include - #include -@@ -20,51 +19,182 @@ - #include - #include - #include -+#include - - #include "bpf_jit_32.h" - - /* -- * ABI: -+ * eBPF prog stack layout: -+ * -+ * high -+ * original ARM_SP => +-----+ -+ * | | callee saved registers -+ * +-----+ <= (BPF_FP + SCRATCH_SIZE) -+ * | ... | eBPF JIT scratch space -+ * eBPF fp register => +-----+ -+ * (BPF_FP) | ... | eBPF prog stack -+ * +-----+ -+ * |RSVD | JIT scratchpad -+ * current ARM_SP => +-----+ <= (BPF_FP - STACK_SIZE + SCRATCH_SIZE) -+ * | | -+ * | ... | Function call stack -+ * | | -+ * +-----+ -+ * low -+ * -+ * The callee saved registers depends on whether frame pointers are enabled. -+ * With frame pointers (to be compliant with the ABI): -+ * -+ * high -+ * original ARM_SP => +--------------+ \ -+ * | pc | | -+ * current ARM_FP => +--------------+ } callee saved registers -+ * |r4-r9,fp,ip,lr| | -+ * +--------------+ / -+ * low - * -- * r0 scratch register -- * r4 BPF register A -- * r5 BPF register X -- * r6 pointer to the skb -- * r7 skb->data -- * r8 skb_headlen(skb) -+ * Without frame pointers: -+ * -+ * high -+ * original ARM_SP => +--------------+ -+ * | r4-r9,fp,lr | callee saved registers -+ * current ARM_FP => +--------------+ -+ * low -+ * -+ * When popping registers off the stack at the end of a BPF function, we -+ * reference them via the current ARM_FP register. - */ -+#define CALLEE_MASK (1 << ARM_R4 | 1 << ARM_R5 | 1 << ARM_R6 | \ -+ 1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R9 | \ -+ 1 << ARM_FP) -+#define CALLEE_PUSH_MASK (CALLEE_MASK | 1 << ARM_LR) -+#define CALLEE_POP_MASK (CALLEE_MASK | 1 << ARM_PC) -+ -+enum { -+ /* Stack layout - these are offsets from (top of stack - 4) */ -+ BPF_R2_HI, -+ BPF_R2_LO, -+ BPF_R3_HI, -+ BPF_R3_LO, -+ BPF_R4_HI, -+ BPF_R4_LO, -+ BPF_R5_HI, -+ BPF_R5_LO, -+ BPF_R7_HI, -+ BPF_R7_LO, -+ BPF_R8_HI, -+ BPF_R8_LO, -+ BPF_R9_HI, -+ BPF_R9_LO, -+ BPF_FP_HI, -+ BPF_FP_LO, -+ BPF_TC_HI, -+ BPF_TC_LO, -+ BPF_AX_HI, -+ BPF_AX_LO, -+ /* Stack space for BPF_REG_2, BPF_REG_3, BPF_REG_4, -+ * BPF_REG_5, BPF_REG_7, BPF_REG_8, BPF_REG_9, -+ * BPF_REG_FP and Tail call counts. -+ */ -+ BPF_JIT_SCRATCH_REGS, -+}; -+ -+/* -+ * Negative "register" values indicate the register is stored on the stack -+ * and are the offset from the top of the eBPF JIT scratch space. -+ */ -+#define STACK_OFFSET(k) (-4 - (k) * 4) -+#define SCRATCH_SIZE (BPF_JIT_SCRATCH_REGS * 4) -+ -+#ifdef CONFIG_FRAME_POINTER -+#define EBPF_SCRATCH_TO_ARM_FP(x) ((x) - 4 * hweight16(CALLEE_PUSH_MASK) - 4) -+#else -+#define EBPF_SCRATCH_TO_ARM_FP(x) (x) -+#endif - --#define r_scratch ARM_R0 --/* r1-r3 are (also) used for the unaligned loads on the non-ARMv7 slowpath */ --#define r_off ARM_R1 --#define r_A ARM_R4 --#define r_X ARM_R5 --#define r_skb ARM_R6 --#define r_skb_data ARM_R7 --#define r_skb_hl ARM_R8 -- --#define SCRATCH_SP_OFFSET 0 --#define SCRATCH_OFF(k) (SCRATCH_SP_OFFSET + 4 * (k)) -- --#define SEEN_MEM ((1 << BPF_MEMWORDS) - 1) --#define SEEN_MEM_WORD(k) (1 << (k)) --#define SEEN_X (1 << BPF_MEMWORDS) --#define SEEN_CALL (1 << (BPF_MEMWORDS + 1)) --#define SEEN_SKB (1 << (BPF_MEMWORDS + 2)) --#define SEEN_DATA (1 << (BPF_MEMWORDS + 3)) -+#define TMP_REG_1 (MAX_BPF_JIT_REG + 0) /* TEMP Register 1 */ -+#define TMP_REG_2 (MAX_BPF_JIT_REG + 1) /* TEMP Register 2 */ -+#define TCALL_CNT (MAX_BPF_JIT_REG + 2) /* Tail Call Count */ - --#define FLAG_NEED_X_RESET (1 << 0) --#define FLAG_IMM_OVERFLOW (1 << 1) -+#define FLAG_IMM_OVERFLOW (1 << 0) -+ -+/* -+ * Map eBPF registers to ARM 32bit registers or stack scratch space. -+ * -+ * 1. First argument is passed using the arm 32bit registers and rest of the -+ * arguments are passed on stack scratch space. -+ * 2. First callee-saved argument is mapped to arm 32 bit registers and rest -+ * arguments are mapped to scratch space on stack. -+ * 3. We need two 64 bit temp registers to do complex operations on eBPF -+ * registers. -+ * -+ * As the eBPF registers are all 64 bit registers and arm has only 32 bit -+ * registers, we have to map each eBPF registers with two arm 32 bit regs or -+ * scratch memory space and we have to build eBPF 64 bit register from those. -+ * -+ */ -+static const s8 bpf2a32[][2] = { -+ /* return value from in-kernel function, and exit value from eBPF */ -+ [BPF_REG_0] = {ARM_R1, ARM_R0}, -+ /* arguments from eBPF program to in-kernel function */ -+ [BPF_REG_1] = {ARM_R3, ARM_R2}, -+ /* Stored on stack scratch space */ -+ [BPF_REG_2] = {STACK_OFFSET(BPF_R2_HI), STACK_OFFSET(BPF_R2_LO)}, -+ [BPF_REG_3] = {STACK_OFFSET(BPF_R3_HI), STACK_OFFSET(BPF_R3_LO)}, -+ [BPF_REG_4] = {STACK_OFFSET(BPF_R4_HI), STACK_OFFSET(BPF_R4_LO)}, -+ [BPF_REG_5] = {STACK_OFFSET(BPF_R5_HI), STACK_OFFSET(BPF_R5_LO)}, -+ /* callee saved registers that in-kernel function will preserve */ -+ [BPF_REG_6] = {ARM_R5, ARM_R4}, -+ /* Stored on stack scratch space */ -+ [BPF_REG_7] = {STACK_OFFSET(BPF_R7_HI), STACK_OFFSET(BPF_R7_LO)}, -+ [BPF_REG_8] = {STACK_OFFSET(BPF_R8_HI), STACK_OFFSET(BPF_R8_LO)}, -+ [BPF_REG_9] = {STACK_OFFSET(BPF_R9_HI), STACK_OFFSET(BPF_R9_LO)}, -+ /* Read only Frame Pointer to access Stack */ -+ [BPF_REG_FP] = {STACK_OFFSET(BPF_FP_HI), STACK_OFFSET(BPF_FP_LO)}, -+ /* Temporary Register for internal BPF JIT, can be used -+ * for constant blindings and others. -+ */ -+ [TMP_REG_1] = {ARM_R7, ARM_R6}, -+ [TMP_REG_2] = {ARM_R9, ARM_R8}, -+ /* Tail call count. Stored on stack scratch space. */ -+ [TCALL_CNT] = {STACK_OFFSET(BPF_TC_HI), STACK_OFFSET(BPF_TC_LO)}, -+ /* temporary register for blinding constants. -+ * Stored on stack scratch space. -+ */ -+ [BPF_REG_AX] = {STACK_OFFSET(BPF_AX_HI), STACK_OFFSET(BPF_AX_LO)}, -+}; -+ -+#define dst_lo dst[1] -+#define dst_hi dst[0] -+#define src_lo src[1] -+#define src_hi src[0] -+ -+/* -+ * JIT Context: -+ * -+ * prog : bpf_prog -+ * idx : index of current last JITed instruction. -+ * prologue_bytes : bytes used in prologue. -+ * epilogue_offset : offset of epilogue starting. -+ * offsets : array of eBPF instruction offsets in -+ * JITed code. -+ * target : final JITed code. -+ * epilogue_bytes : no of bytes used in epilogue. -+ * imm_count : no of immediate counts used for global -+ * variables. -+ * imms : array of global variable addresses. -+ */ - - struct jit_ctx { -- const struct bpf_prog *skf; -- unsigned idx; -- unsigned prologue_bytes; -- int ret0_fp_idx; -- u32 seen; -+ const struct bpf_prog *prog; -+ unsigned int idx; -+ unsigned int prologue_bytes; -+ unsigned int epilogue_offset; -+ unsigned int cpu_architecture; - u32 flags; - u32 *offsets; - u32 *target; -+ u32 stack_size; - #if __LINUX_ARM_ARCH__ < 7 - u16 epilogue_bytes; - u16 imm_count; -@@ -72,68 +202,16 @@ struct jit_ctx { - #endif - }; - --int bpf_jit_enable __read_mostly; -- --static inline int call_neg_helper(struct sk_buff *skb, int offset, void *ret, -- unsigned int size) --{ -- void *ptr = bpf_internal_load_pointer_neg_helper(skb, offset, size); -- -- if (!ptr) -- return -EFAULT; -- memcpy(ret, ptr, size); -- return 0; --} -- --static u64 jit_get_skb_b(struct sk_buff *skb, int offset) --{ -- u8 ret; -- int err; -- -- if (offset < 0) -- err = call_neg_helper(skb, offset, &ret, 1); -- else -- err = skb_copy_bits(skb, offset, &ret, 1); -- -- return (u64)err << 32 | ret; --} -- --static u64 jit_get_skb_h(struct sk_buff *skb, int offset) --{ -- u16 ret; -- int err; -- -- if (offset < 0) -- err = call_neg_helper(skb, offset, &ret, 2); -- else -- err = skb_copy_bits(skb, offset, &ret, 2); -- -- return (u64)err << 32 | ntohs(ret); --} -- --static u64 jit_get_skb_w(struct sk_buff *skb, int offset) --{ -- u32 ret; -- int err; -- -- if (offset < 0) -- err = call_neg_helper(skb, offset, &ret, 4); -- else -- err = skb_copy_bits(skb, offset, &ret, 4); -- -- return (u64)err << 32 | ntohl(ret); --} -- - /* - * Wrappers which handle both OABI and EABI and assures Thumb2 interworking - * (where the assembly routines like __aeabi_uidiv could cause problems). - */ --static u32 jit_udiv(u32 dividend, u32 divisor) -+static u32 jit_udiv32(u32 dividend, u32 divisor) - { - return dividend / divisor; - } - --static u32 jit_mod(u32 dividend, u32 divisor) -+static u32 jit_mod32(u32 dividend, u32 divisor) - { - return dividend % divisor; - } -@@ -157,36 +235,100 @@ static inline void emit(u32 inst, struct - _emit(ARM_COND_AL, inst, ctx); - } - --static u16 saved_regs(struct jit_ctx *ctx) -+/* -+ * This is rather horrid, but necessary to convert an integer constant -+ * to an immediate operand for the opcodes, and be able to detect at -+ * build time whether the constant can't be converted (iow, usable in -+ * BUILD_BUG_ON()). -+ */ -+#define imm12val(v, s) (rol32(v, (s)) | (s) << 7) -+#define const_imm8m(x) \ -+ ({ int r; \ -+ u32 v = (x); \ -+ if (!(v & ~0x000000ff)) \ -+ r = imm12val(v, 0); \ -+ else if (!(v & ~0xc000003f)) \ -+ r = imm12val(v, 2); \ -+ else if (!(v & ~0xf000000f)) \ -+ r = imm12val(v, 4); \ -+ else if (!(v & ~0xfc000003)) \ -+ r = imm12val(v, 6); \ -+ else if (!(v & ~0xff000000)) \ -+ r = imm12val(v, 8); \ -+ else if (!(v & ~0x3fc00000)) \ -+ r = imm12val(v, 10); \ -+ else if (!(v & ~0x0ff00000)) \ -+ r = imm12val(v, 12); \ -+ else if (!(v & ~0x03fc0000)) \ -+ r = imm12val(v, 14); \ -+ else if (!(v & ~0x00ff0000)) \ -+ r = imm12val(v, 16); \ -+ else if (!(v & ~0x003fc000)) \ -+ r = imm12val(v, 18); \ -+ else if (!(v & ~0x000ff000)) \ -+ r = imm12val(v, 20); \ -+ else if (!(v & ~0x0003fc00)) \ -+ r = imm12val(v, 22); \ -+ else if (!(v & ~0x0000ff00)) \ -+ r = imm12val(v, 24); \ -+ else if (!(v & ~0x00003fc0)) \ -+ r = imm12val(v, 26); \ -+ else if (!(v & ~0x00000ff0)) \ -+ r = imm12val(v, 28); \ -+ else if (!(v & ~0x000003fc)) \ -+ r = imm12val(v, 30); \ -+ else \ -+ r = -1; \ -+ r; }) -+ -+/* -+ * Checks if immediate value can be converted to imm12(12 bits) value. -+ */ -+static int imm8m(u32 x) - { -- u16 ret = 0; -+ u32 rot; - -- if ((ctx->skf->len > 1) || -- (ctx->skf->insns[0].code == (BPF_RET | BPF_A))) -- ret |= 1 << r_A; -+ for (rot = 0; rot < 16; rot++) -+ if ((x & ~ror32(0xff, 2 * rot)) == 0) -+ return rol32(x, 2 * rot) | (rot << 8); -+ return -1; -+} - --#ifdef CONFIG_FRAME_POINTER -- ret |= (1 << ARM_FP) | (1 << ARM_IP) | (1 << ARM_LR) | (1 << ARM_PC); --#else -- if (ctx->seen & SEEN_CALL) -- ret |= 1 << ARM_LR; --#endif -- if (ctx->seen & (SEEN_DATA | SEEN_SKB)) -- ret |= 1 << r_skb; -- if (ctx->seen & SEEN_DATA) -- ret |= (1 << r_skb_data) | (1 << r_skb_hl); -- if (ctx->seen & SEEN_X) -- ret |= 1 << r_X; -+#define imm8m(x) (__builtin_constant_p(x) ? const_imm8m(x) : imm8m(x)) - -- return ret; -+static u32 arm_bpf_ldst_imm12(u32 op, u8 rt, u8 rn, s16 imm12) -+{ -+ op |= rt << 12 | rn << 16; -+ if (imm12 >= 0) -+ op |= ARM_INST_LDST__U; -+ else -+ imm12 = -imm12; -+ return op | (imm12 & ARM_INST_LDST__IMM12); - } - --static inline int mem_words_used(struct jit_ctx *ctx) -+static u32 arm_bpf_ldst_imm8(u32 op, u8 rt, u8 rn, s16 imm8) - { -- /* yes, we do waste some stack space IF there are "holes" in the set" */ -- return fls(ctx->seen & SEEN_MEM); -+ op |= rt << 12 | rn << 16; -+ if (imm8 >= 0) -+ op |= ARM_INST_LDST__U; -+ else -+ imm8 = -imm8; -+ return op | (imm8 & 0xf0) << 4 | (imm8 & 0x0f); - } - -+#define ARM_LDR_I(rt, rn, off) arm_bpf_ldst_imm12(ARM_INST_LDR_I, rt, rn, off) -+#define ARM_LDRB_I(rt, rn, off) arm_bpf_ldst_imm12(ARM_INST_LDRB_I, rt, rn, off) -+#define ARM_LDRD_I(rt, rn, off) arm_bpf_ldst_imm8(ARM_INST_LDRD_I, rt, rn, off) -+#define ARM_LDRH_I(rt, rn, off) arm_bpf_ldst_imm8(ARM_INST_LDRH_I, rt, rn, off) -+ -+#define ARM_STR_I(rt, rn, off) arm_bpf_ldst_imm12(ARM_INST_STR_I, rt, rn, off) -+#define ARM_STRB_I(rt, rn, off) arm_bpf_ldst_imm12(ARM_INST_STRB_I, rt, rn, off) -+#define ARM_STRD_I(rt, rn, off) arm_bpf_ldst_imm8(ARM_INST_STRD_I, rt, rn, off) -+#define ARM_STRH_I(rt, rn, off) arm_bpf_ldst_imm8(ARM_INST_STRH_I, rt, rn, off) -+ -+/* -+ * Initializes the JIT space with undefined instructions. -+ */ - static void jit_fill_hole(void *area, unsigned int size) - { - u32 *ptr; -@@ -195,88 +337,23 @@ static void jit_fill_hole(void *area, un - *ptr++ = __opcode_to_mem_arm(ARM_INST_UDF); - } - --static void build_prologue(struct jit_ctx *ctx) --{ -- u16 reg_set = saved_regs(ctx); -- u16 off; -- --#ifdef CONFIG_FRAME_POINTER -- emit(ARM_MOV_R(ARM_IP, ARM_SP), ctx); -- emit(ARM_PUSH(reg_set), ctx); -- emit(ARM_SUB_I(ARM_FP, ARM_IP, 4), ctx); -+#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) -+/* EABI requires the stack to be aligned to 64-bit boundaries */ -+#define STACK_ALIGNMENT 8 - #else -- if (reg_set) -- emit(ARM_PUSH(reg_set), ctx); -+/* Stack must be aligned to 32-bit boundaries */ -+#define STACK_ALIGNMENT 4 - #endif - -- if (ctx->seen & (SEEN_DATA | SEEN_SKB)) -- emit(ARM_MOV_R(r_skb, ARM_R0), ctx); -- -- if (ctx->seen & SEEN_DATA) { -- off = offsetof(struct sk_buff, data); -- emit(ARM_LDR_I(r_skb_data, r_skb, off), ctx); -- /* headlen = len - data_len */ -- off = offsetof(struct sk_buff, len); -- emit(ARM_LDR_I(r_skb_hl, r_skb, off), ctx); -- off = offsetof(struct sk_buff, data_len); -- emit(ARM_LDR_I(r_scratch, r_skb, off), ctx); -- emit(ARM_SUB_R(r_skb_hl, r_skb_hl, r_scratch), ctx); -- } -- -- if (ctx->flags & FLAG_NEED_X_RESET) -- emit(ARM_MOV_I(r_X, 0), ctx); -- -- /* do not leak kernel data to userspace */ -- if (bpf_needs_clear_a(&ctx->skf->insns[0])) -- emit(ARM_MOV_I(r_A, 0), ctx); -- -- /* stack space for the BPF_MEM words */ -- if (ctx->seen & SEEN_MEM) -- emit(ARM_SUB_I(ARM_SP, ARM_SP, mem_words_used(ctx) * 4), ctx); --} -- --static void build_epilogue(struct jit_ctx *ctx) --{ -- u16 reg_set = saved_regs(ctx); -- -- if (ctx->seen & SEEN_MEM) -- emit(ARM_ADD_I(ARM_SP, ARM_SP, mem_words_used(ctx) * 4), ctx); -- -- reg_set &= ~(1 << ARM_LR); -- --#ifdef CONFIG_FRAME_POINTER -- /* the first instruction of the prologue was: mov ip, sp */ -- reg_set &= ~(1 << ARM_IP); -- reg_set |= (1 << ARM_SP); -- emit(ARM_LDM(ARM_SP, reg_set), ctx); --#else -- if (reg_set) { -- if (ctx->seen & SEEN_CALL) -- reg_set |= 1 << ARM_PC; -- emit(ARM_POP(reg_set), ctx); -- } -- -- if (!(ctx->seen & SEEN_CALL)) -- emit(ARM_BX(ARM_LR), ctx); --#endif --} -- --static int16_t imm8m(u32 x) --{ -- u32 rot; -- -- for (rot = 0; rot < 16; rot++) -- if ((x & ~ror32(0xff, 2 * rot)) == 0) -- return rol32(x, 2 * rot) | (rot << 8); -- -- return -1; --} -+/* total stack size used in JITed code */ -+#define _STACK_SIZE (ctx->prog->aux->stack_depth + SCRATCH_SIZE) -+#define STACK_SIZE ALIGN(_STACK_SIZE, STACK_ALIGNMENT) - - #if __LINUX_ARM_ARCH__ < 7 - - static u16 imm_offset(u32 k, struct jit_ctx *ctx) - { -- unsigned i = 0, offset; -+ unsigned int i = 0, offset; - u16 imm; - - /* on the "fake" run we just count them (duplicates included) */ -@@ -295,7 +372,7 @@ static u16 imm_offset(u32 k, struct jit_ - ctx->imms[i] = k; - - /* constants go just after the epilogue */ -- offset = ctx->offsets[ctx->skf->len]; -+ offset = ctx->offsets[ctx->prog->len - 1] * 4; - offset += ctx->prologue_bytes; - offset += ctx->epilogue_bytes; - offset += i * 4; -@@ -319,10 +396,22 @@ static u16 imm_offset(u32 k, struct jit_ - - #endif /* __LINUX_ARM_ARCH__ */ - -+static inline int bpf2a32_offset(int bpf_to, int bpf_from, -+ const struct jit_ctx *ctx) { -+ int to, from; -+ -+ if (ctx->target == NULL) -+ return 0; -+ to = ctx->offsets[bpf_to]; -+ from = ctx->offsets[bpf_from]; -+ -+ return to - from - 1; -+} -+ - /* - * Move an immediate that's not an imm8m to a core register. - */ --static inline void emit_mov_i_no8m(int rd, u32 val, struct jit_ctx *ctx) -+static inline void emit_mov_i_no8m(const u8 rd, u32 val, struct jit_ctx *ctx) - { - #if __LINUX_ARM_ARCH__ < 7 - emit(ARM_LDR_I(rd, ARM_PC, imm_offset(val, ctx)), ctx); -@@ -333,7 +422,7 @@ static inline void emit_mov_i_no8m(int r - #endif - } - --static inline void emit_mov_i(int rd, u32 val, struct jit_ctx *ctx) -+static inline void emit_mov_i(const u8 rd, u32 val, struct jit_ctx *ctx) - { - int imm12 = imm8m(val); - -@@ -343,676 +432,1508 @@ static inline void emit_mov_i(int rd, u3 - emit_mov_i_no8m(rd, val, ctx); - } - --#if __LINUX_ARM_ARCH__ < 6 -+static void emit_bx_r(u8 tgt_reg, struct jit_ctx *ctx) -+{ -+ if (elf_hwcap & HWCAP_THUMB) -+ emit(ARM_BX(tgt_reg), ctx); -+ else -+ emit(ARM_MOV_R(ARM_PC, tgt_reg), ctx); -+} - --static void emit_load_be32(u8 cond, u8 r_res, u8 r_addr, struct jit_ctx *ctx) -+static inline void emit_blx_r(u8 tgt_reg, struct jit_ctx *ctx) - { -- _emit(cond, ARM_LDRB_I(ARM_R3, r_addr, 1), ctx); -- _emit(cond, ARM_LDRB_I(ARM_R1, r_addr, 0), ctx); -- _emit(cond, ARM_LDRB_I(ARM_R2, r_addr, 3), ctx); -- _emit(cond, ARM_LSL_I(ARM_R3, ARM_R3, 16), ctx); -- _emit(cond, ARM_LDRB_I(ARM_R0, r_addr, 2), ctx); -- _emit(cond, ARM_ORR_S(ARM_R3, ARM_R3, ARM_R1, SRTYPE_LSL, 24), ctx); -- _emit(cond, ARM_ORR_R(ARM_R3, ARM_R3, ARM_R2), ctx); -- _emit(cond, ARM_ORR_S(r_res, ARM_R3, ARM_R0, SRTYPE_LSL, 8), ctx); -+#if __LINUX_ARM_ARCH__ < 5 -+ emit(ARM_MOV_R(ARM_LR, ARM_PC), ctx); -+ emit_bx_r(tgt_reg, ctx); -+#else -+ emit(ARM_BLX_R(tgt_reg), ctx); -+#endif - } - --static void emit_load_be16(u8 cond, u8 r_res, u8 r_addr, struct jit_ctx *ctx) -+static inline int epilogue_offset(const struct jit_ctx *ctx) - { -- _emit(cond, ARM_LDRB_I(ARM_R1, r_addr, 0), ctx); -- _emit(cond, ARM_LDRB_I(ARM_R2, r_addr, 1), ctx); -- _emit(cond, ARM_ORR_S(r_res, ARM_R2, ARM_R1, SRTYPE_LSL, 8), ctx); -+ int to, from; -+ /* No need for 1st dummy run */ -+ if (ctx->target == NULL) -+ return 0; -+ to = ctx->epilogue_offset; -+ from = ctx->idx; -+ -+ return to - from - 2; - } - --static inline void emit_swap16(u8 r_dst, u8 r_src, struct jit_ctx *ctx) -+static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op) - { -- /* r_dst = (r_src << 8) | (r_src >> 8) */ -- emit(ARM_LSL_I(ARM_R1, r_src, 8), ctx); -- emit(ARM_ORR_S(r_dst, ARM_R1, r_src, SRTYPE_LSR, 8), ctx); -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ -+#if __LINUX_ARM_ARCH__ == 7 -+ if (elf_hwcap & HWCAP_IDIVA) { -+ if (op == BPF_DIV) -+ emit(ARM_UDIV(rd, rm, rn), ctx); -+ else { -+ emit(ARM_UDIV(ARM_IP, rm, rn), ctx); -+ emit(ARM_MLS(rd, rn, ARM_IP, rm), ctx); -+ } -+ return; -+ } -+#endif - - /* -- * we need to mask out the bits set in r_dst[23:16] due to -- * the first shift instruction. -- * -- * note that 0x8ff is the encoded immediate 0x00ff0000. -+ * For BPF_ALU | BPF_DIV | BPF_K instructions -+ * As ARM_R1 and ARM_R0 contains 1st argument of bpf -+ * function, we need to save it on caller side to save -+ * it from getting destroyed within callee. -+ * After the return from the callee, we restore ARM_R0 -+ * ARM_R1. - */ -- emit(ARM_BIC_I(r_dst, r_dst, 0x8ff), ctx); -+ if (rn != ARM_R1) { -+ emit(ARM_MOV_R(tmp[0], ARM_R1), ctx); -+ emit(ARM_MOV_R(ARM_R1, rn), ctx); -+ } -+ if (rm != ARM_R0) { -+ emit(ARM_MOV_R(tmp[1], ARM_R0), ctx); -+ emit(ARM_MOV_R(ARM_R0, rm), ctx); -+ } -+ -+ /* Call appropriate function */ -+ emit_mov_i(ARM_IP, op == BPF_DIV ? -+ (u32)jit_udiv32 : (u32)jit_mod32, ctx); -+ emit_blx_r(ARM_IP, ctx); -+ -+ /* Save return value */ -+ if (rd != ARM_R0) -+ emit(ARM_MOV_R(rd, ARM_R0), ctx); -+ -+ /* Restore ARM_R0 and ARM_R1 */ -+ if (rn != ARM_R1) -+ emit(ARM_MOV_R(ARM_R1, tmp[0]), ctx); -+ if (rm != ARM_R0) -+ emit(ARM_MOV_R(ARM_R0, tmp[1]), ctx); - } - --#else /* ARMv6+ */ -+/* Is the translated BPF register on stack? */ -+static bool is_stacked(s8 reg) -+{ -+ return reg < 0; -+} - --static void emit_load_be32(u8 cond, u8 r_res, u8 r_addr, struct jit_ctx *ctx) -+/* If a BPF register is on the stack (stk is true), load it to the -+ * supplied temporary register and return the temporary register -+ * for subsequent operations, otherwise just use the CPU register. -+ */ -+static s8 arm_bpf_get_reg32(s8 reg, s8 tmp, struct jit_ctx *ctx) - { -- _emit(cond, ARM_LDR_I(r_res, r_addr, 0), ctx); --#ifdef __LITTLE_ENDIAN -- _emit(cond, ARM_REV(r_res, r_res), ctx); --#endif -+ if (is_stacked(reg)) { -+ emit(ARM_LDR_I(tmp, ARM_FP, EBPF_SCRATCH_TO_ARM_FP(reg)), ctx); -+ reg = tmp; -+ } -+ return reg; - } - --static void emit_load_be16(u8 cond, u8 r_res, u8 r_addr, struct jit_ctx *ctx) -+static const s8 *arm_bpf_get_reg64(const s8 *reg, const s8 *tmp, -+ struct jit_ctx *ctx) - { -- _emit(cond, ARM_LDRH_I(r_res, r_addr, 0), ctx); --#ifdef __LITTLE_ENDIAN -- _emit(cond, ARM_REV16(r_res, r_res), ctx); --#endif -+ if (is_stacked(reg[1])) { -+ if (__LINUX_ARM_ARCH__ >= 6 || -+ ctx->cpu_architecture >= CPU_ARCH_ARMv5TE) { -+ emit(ARM_LDRD_I(tmp[1], ARM_FP, -+ EBPF_SCRATCH_TO_ARM_FP(reg[1])), ctx); -+ } else { -+ emit(ARM_LDR_I(tmp[1], ARM_FP, -+ EBPF_SCRATCH_TO_ARM_FP(reg[1])), ctx); -+ emit(ARM_LDR_I(tmp[0], ARM_FP, -+ EBPF_SCRATCH_TO_ARM_FP(reg[0])), ctx); -+ } -+ reg = tmp; -+ } -+ return reg; - } - --static inline void emit_swap16(u8 r_dst __maybe_unused, -- u8 r_src __maybe_unused, -- struct jit_ctx *ctx __maybe_unused) -+/* If a BPF register is on the stack (stk is true), save the register -+ * back to the stack. If the source register is not the same, then -+ * move it into the correct register. -+ */ -+static void arm_bpf_put_reg32(s8 reg, s8 src, struct jit_ctx *ctx) - { --#ifdef __LITTLE_ENDIAN -- emit(ARM_REV16(r_dst, r_src), ctx); --#endif -+ if (is_stacked(reg)) -+ emit(ARM_STR_I(src, ARM_FP, EBPF_SCRATCH_TO_ARM_FP(reg)), ctx); -+ else if (reg != src) -+ emit(ARM_MOV_R(reg, src), ctx); -+} -+ -+static void arm_bpf_put_reg64(const s8 *reg, const s8 *src, -+ struct jit_ctx *ctx) -+{ -+ if (is_stacked(reg[1])) { -+ if (__LINUX_ARM_ARCH__ >= 6 || -+ ctx->cpu_architecture >= CPU_ARCH_ARMv5TE) { -+ emit(ARM_STRD_I(src[1], ARM_FP, -+ EBPF_SCRATCH_TO_ARM_FP(reg[1])), ctx); -+ } else { -+ emit(ARM_STR_I(src[1], ARM_FP, -+ EBPF_SCRATCH_TO_ARM_FP(reg[1])), ctx); -+ emit(ARM_STR_I(src[0], ARM_FP, -+ EBPF_SCRATCH_TO_ARM_FP(reg[0])), ctx); -+ } -+ } else { -+ if (reg[1] != src[1]) -+ emit(ARM_MOV_R(reg[1], src[1]), ctx); -+ if (reg[0] != src[0]) -+ emit(ARM_MOV_R(reg[0], src[0]), ctx); -+ } - } - --#endif /* __LINUX_ARM_ARCH__ < 6 */ -+static inline void emit_a32_mov_i(const s8 dst, const u32 val, -+ struct jit_ctx *ctx) -+{ -+ const s8 *tmp = bpf2a32[TMP_REG_1]; - -+ if (is_stacked(dst)) { -+ emit_mov_i(tmp[1], val, ctx); -+ arm_bpf_put_reg32(dst, tmp[1], ctx); -+ } else { -+ emit_mov_i(dst, val, ctx); -+ } -+} - --/* Compute the immediate value for a PC-relative branch. */ --static inline u32 b_imm(unsigned tgt, struct jit_ctx *ctx) -+static void emit_a32_mov_i64(const s8 dst[], u64 val, struct jit_ctx *ctx) - { -- u32 imm; -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *rd = is_stacked(dst_lo) ? tmp : dst; - -- if (ctx->target == NULL) -- return 0; -- /* -- * BPF allows only forward jumps and the offset of the target is -- * still the one computed during the first pass. -+ emit_mov_i(rd[1], (u32)val, ctx); -+ emit_mov_i(rd[0], val >> 32, ctx); -+ -+ arm_bpf_put_reg64(dst, rd, ctx); -+} -+ -+/* Sign extended move */ -+static inline void emit_a32_mov_se_i64(const bool is64, const s8 dst[], -+ const u32 val, struct jit_ctx *ctx) { -+ u64 val64 = val; -+ -+ if (is64 && (val & (1<<31))) -+ val64 |= 0xffffffff00000000ULL; -+ emit_a32_mov_i64(dst, val64, ctx); -+} -+ -+static inline void emit_a32_add_r(const u8 dst, const u8 src, -+ const bool is64, const bool hi, -+ struct jit_ctx *ctx) { -+ /* 64 bit : -+ * adds dst_lo, dst_lo, src_lo -+ * adc dst_hi, dst_hi, src_hi -+ * 32 bit : -+ * add dst_lo, dst_lo, src_lo - */ -- imm = ctx->offsets[tgt] + ctx->prologue_bytes - (ctx->idx * 4 + 8); -+ if (!hi && is64) -+ emit(ARM_ADDS_R(dst, dst, src), ctx); -+ else if (hi && is64) -+ emit(ARM_ADC_R(dst, dst, src), ctx); -+ else -+ emit(ARM_ADD_R(dst, dst, src), ctx); -+} - -- return imm >> 2; -+static inline void emit_a32_sub_r(const u8 dst, const u8 src, -+ const bool is64, const bool hi, -+ struct jit_ctx *ctx) { -+ /* 64 bit : -+ * subs dst_lo, dst_lo, src_lo -+ * sbc dst_hi, dst_hi, src_hi -+ * 32 bit : -+ * sub dst_lo, dst_lo, src_lo -+ */ -+ if (!hi && is64) -+ emit(ARM_SUBS_R(dst, dst, src), ctx); -+ else if (hi && is64) -+ emit(ARM_SBC_R(dst, dst, src), ctx); -+ else -+ emit(ARM_SUB_R(dst, dst, src), ctx); -+} -+ -+static inline void emit_alu_r(const u8 dst, const u8 src, const bool is64, -+ const bool hi, const u8 op, struct jit_ctx *ctx){ -+ switch (BPF_OP(op)) { -+ /* dst = dst + src */ -+ case BPF_ADD: -+ emit_a32_add_r(dst, src, is64, hi, ctx); -+ break; -+ /* dst = dst - src */ -+ case BPF_SUB: -+ emit_a32_sub_r(dst, src, is64, hi, ctx); -+ break; -+ /* dst = dst | src */ -+ case BPF_OR: -+ emit(ARM_ORR_R(dst, dst, src), ctx); -+ break; -+ /* dst = dst & src */ -+ case BPF_AND: -+ emit(ARM_AND_R(dst, dst, src), ctx); -+ break; -+ /* dst = dst ^ src */ -+ case BPF_XOR: -+ emit(ARM_EOR_R(dst, dst, src), ctx); -+ break; -+ /* dst = dst * src */ -+ case BPF_MUL: -+ emit(ARM_MUL(dst, dst, src), ctx); -+ break; -+ /* dst = dst << src */ -+ case BPF_LSH: -+ emit(ARM_LSL_R(dst, dst, src), ctx); -+ break; -+ /* dst = dst >> src */ -+ case BPF_RSH: -+ emit(ARM_LSR_R(dst, dst, src), ctx); -+ break; -+ /* dst = dst >> src (signed)*/ -+ case BPF_ARSH: -+ emit(ARM_MOV_SR(dst, dst, SRTYPE_ASR, src), ctx); -+ break; -+ } - } - --#define OP_IMM3(op, r1, r2, imm_val, ctx) \ -- do { \ -- imm12 = imm8m(imm_val); \ -- if (imm12 < 0) { \ -- emit_mov_i_no8m(r_scratch, imm_val, ctx); \ -- emit(op ## _R((r1), (r2), r_scratch), ctx); \ -- } else { \ -- emit(op ## _I((r1), (r2), imm12), ctx); \ -- } \ -- } while (0) -- --static inline void emit_err_ret(u8 cond, struct jit_ctx *ctx) --{ -- if (ctx->ret0_fp_idx >= 0) { -- _emit(cond, ARM_B(b_imm(ctx->ret0_fp_idx, ctx)), ctx); -- /* NOP to keep the size constant between passes */ -- emit(ARM_MOV_R(ARM_R0, ARM_R0), ctx); -+/* ALU operation (32 bit) -+ * dst = dst (op) src -+ */ -+static inline void emit_a32_alu_r(const s8 dst, const s8 src, -+ struct jit_ctx *ctx, const bool is64, -+ const bool hi, const u8 op) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ s8 rn, rd; -+ -+ rn = arm_bpf_get_reg32(src, tmp[1], ctx); -+ rd = arm_bpf_get_reg32(dst, tmp[0], ctx); -+ /* ALU operation */ -+ emit_alu_r(rd, rn, is64, hi, op, ctx); -+ arm_bpf_put_reg32(dst, rd, ctx); -+} -+ -+/* ALU operation (64 bit) */ -+static inline void emit_a32_alu_r64(const bool is64, const s8 dst[], -+ const s8 src[], struct jit_ctx *ctx, -+ const u8 op) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rd; -+ -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ if (is64) { -+ const s8 *rs; -+ -+ rs = arm_bpf_get_reg64(src, tmp2, ctx); -+ -+ /* ALU operation */ -+ emit_alu_r(rd[1], rs[1], true, false, op, ctx); -+ emit_alu_r(rd[0], rs[0], true, true, op, ctx); - } else { -- _emit(cond, ARM_MOV_I(ARM_R0, 0), ctx); -- _emit(cond, ARM_B(b_imm(ctx->skf->len, ctx)), ctx); -+ s8 rs; -+ -+ rs = arm_bpf_get_reg32(src_lo, tmp2[1], ctx); -+ -+ /* ALU operation */ -+ emit_alu_r(rd[1], rs, true, false, op, ctx); -+ if (!ctx->prog->aux->verifier_zext) -+ emit_a32_mov_i(rd[0], 0, ctx); - } -+ -+ arm_bpf_put_reg64(dst, rd, ctx); - } - --static inline void emit_blx_r(u8 tgt_reg, struct jit_ctx *ctx) --{ --#if __LINUX_ARM_ARCH__ < 5 -- emit(ARM_MOV_R(ARM_LR, ARM_PC), ctx); -+/* dst = src (4 bytes)*/ -+static inline void emit_a32_mov_r(const s8 dst, const s8 src, -+ struct jit_ctx *ctx) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ s8 rt; -+ -+ rt = arm_bpf_get_reg32(src, tmp[0], ctx); -+ arm_bpf_put_reg32(dst, rt, ctx); -+} -+ -+/* dst = src */ -+static inline void emit_a32_mov_r64(const bool is64, const s8 dst[], -+ const s8 src[], -+ struct jit_ctx *ctx) { -+ if (!is64) { -+ emit_a32_mov_r(dst_lo, src_lo, ctx); -+ if (!ctx->prog->aux->verifier_zext) -+ /* Zero out high 4 bytes */ -+ emit_a32_mov_i(dst_hi, 0, ctx); -+ } else if (__LINUX_ARM_ARCH__ < 6 && -+ ctx->cpu_architecture < CPU_ARCH_ARMv5TE) { -+ /* complete 8 byte move */ -+ emit_a32_mov_r(dst_lo, src_lo, ctx); -+ emit_a32_mov_r(dst_hi, src_hi, ctx); -+ } else if (is_stacked(src_lo) && is_stacked(dst_lo)) { -+ const u8 *tmp = bpf2a32[TMP_REG_1]; -+ -+ emit(ARM_LDRD_I(tmp[1], ARM_FP, EBPF_SCRATCH_TO_ARM_FP(src_lo)), ctx); -+ emit(ARM_STRD_I(tmp[1], ARM_FP, EBPF_SCRATCH_TO_ARM_FP(dst_lo)), ctx); -+ } else if (is_stacked(src_lo)) { -+ emit(ARM_LDRD_I(dst[1], ARM_FP, EBPF_SCRATCH_TO_ARM_FP(src_lo)), ctx); -+ } else if (is_stacked(dst_lo)) { -+ emit(ARM_STRD_I(src[1], ARM_FP, EBPF_SCRATCH_TO_ARM_FP(dst_lo)), ctx); -+ } else { -+ emit(ARM_MOV_R(dst[0], src[0]), ctx); -+ emit(ARM_MOV_R(dst[1], src[1]), ctx); -+ } -+} - -- if (elf_hwcap & HWCAP_THUMB) -- emit(ARM_BX(tgt_reg), ctx); -- else -- emit(ARM_MOV_R(ARM_PC, tgt_reg), ctx); --#else -- emit(ARM_BLX_R(tgt_reg), ctx); --#endif -+/* Shift operations */ -+static inline void emit_a32_alu_i(const s8 dst, const u32 val, -+ struct jit_ctx *ctx, const u8 op) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ s8 rd; -+ -+ rd = arm_bpf_get_reg32(dst, tmp[0], ctx); -+ -+ /* Do shift operation */ -+ switch (op) { -+ case BPF_LSH: -+ emit(ARM_LSL_I(rd, rd, val), ctx); -+ break; -+ case BPF_RSH: -+ emit(ARM_LSR_I(rd, rd, val), ctx); -+ break; -+ case BPF_NEG: -+ emit(ARM_RSB_I(rd, rd, val), ctx); -+ break; -+ } -+ -+ arm_bpf_put_reg32(dst, rd, ctx); - } - --static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, -- int bpf_op) --{ --#if __LINUX_ARM_ARCH__ == 7 -- if (elf_hwcap & HWCAP_IDIVA) { -- if (bpf_op == BPF_DIV) -- emit(ARM_UDIV(rd, rm, rn), ctx); -- else { -- emit(ARM_UDIV(ARM_R3, rm, rn), ctx); -- emit(ARM_MLS(rd, rn, ARM_R3, rm), ctx); -+/* dst = ~dst (64 bit) */ -+static inline void emit_a32_neg64(const s8 dst[], -+ struct jit_ctx *ctx){ -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *rd; -+ -+ /* Setup Operand */ -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ -+ /* Do Negate Operation */ -+ emit(ARM_RSBS_I(rd[1], rd[1], 0), ctx); -+ emit(ARM_RSC_I(rd[0], rd[0], 0), ctx); -+ -+ arm_bpf_put_reg64(dst, rd, ctx); -+} -+ -+/* dst = dst << src */ -+static inline void emit_a32_lsh_r64(const s8 dst[], const s8 src[], -+ struct jit_ctx *ctx) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rd; -+ s8 rt; -+ -+ /* Setup Operands */ -+ rt = arm_bpf_get_reg32(src_lo, tmp2[1], ctx); -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ -+ /* Do LSH operation */ -+ emit(ARM_SUB_I(ARM_IP, rt, 32), ctx); -+ emit(ARM_RSB_I(tmp2[0], rt, 32), ctx); -+ emit(ARM_MOV_SR(ARM_LR, rd[0], SRTYPE_ASL, rt), ctx); -+ emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[1], SRTYPE_ASL, ARM_IP), ctx); -+ emit(ARM_ORR_SR(ARM_IP, ARM_LR, rd[1], SRTYPE_LSR, tmp2[0]), ctx); -+ emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_ASL, rt), ctx); -+ -+ arm_bpf_put_reg32(dst_lo, ARM_LR, ctx); -+ arm_bpf_put_reg32(dst_hi, ARM_IP, ctx); -+} -+ -+/* dst = dst >> src (signed)*/ -+static inline void emit_a32_arsh_r64(const s8 dst[], const s8 src[], -+ struct jit_ctx *ctx) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rd; -+ s8 rt; -+ -+ /* Setup Operands */ -+ rt = arm_bpf_get_reg32(src_lo, tmp2[1], ctx); -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ -+ /* Do the ARSH operation */ -+ emit(ARM_RSB_I(ARM_IP, rt, 32), ctx); -+ emit(ARM_SUBS_I(tmp2[0], rt, 32), ctx); -+ emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx); -+ emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx); -+ _emit(ARM_COND_MI, ARM_B(0), ctx); -+ emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASR, tmp2[0]), ctx); -+ emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_ASR, rt), ctx); -+ -+ arm_bpf_put_reg32(dst_lo, ARM_LR, ctx); -+ arm_bpf_put_reg32(dst_hi, ARM_IP, ctx); -+} -+ -+/* dst = dst >> src */ -+static inline void emit_a32_rsh_r64(const s8 dst[], const s8 src[], -+ struct jit_ctx *ctx) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rd; -+ s8 rt; -+ -+ /* Setup Operands */ -+ rt = arm_bpf_get_reg32(src_lo, tmp2[1], ctx); -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ -+ /* Do RSH operation */ -+ emit(ARM_RSB_I(ARM_IP, rt, 32), ctx); -+ emit(ARM_SUBS_I(tmp2[0], rt, 32), ctx); -+ emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx); -+ emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx); -+ emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_LSR, tmp2[0]), ctx); -+ emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_LSR, rt), ctx); -+ -+ arm_bpf_put_reg32(dst_lo, ARM_LR, ctx); -+ arm_bpf_put_reg32(dst_hi, ARM_IP, ctx); -+} -+ -+/* dst = dst << val */ -+static inline void emit_a32_lsh_i64(const s8 dst[], -+ const u32 val, struct jit_ctx *ctx){ -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rd; -+ -+ /* Setup operands */ -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ -+ /* Do LSH operation */ -+ if (val < 32) { -+ emit(ARM_MOV_SI(tmp2[0], rd[0], SRTYPE_ASL, val), ctx); -+ emit(ARM_ORR_SI(rd[0], tmp2[0], rd[1], SRTYPE_LSR, 32 - val), ctx); -+ emit(ARM_MOV_SI(rd[1], rd[1], SRTYPE_ASL, val), ctx); -+ } else { -+ if (val == 32) -+ emit(ARM_MOV_R(rd[0], rd[1]), ctx); -+ else -+ emit(ARM_MOV_SI(rd[0], rd[1], SRTYPE_ASL, val - 32), ctx); -+ emit(ARM_EOR_R(rd[1], rd[1], rd[1]), ctx); -+ } -+ -+ arm_bpf_put_reg64(dst, rd, ctx); -+} -+ -+/* dst = dst >> val */ -+static inline void emit_a32_rsh_i64(const s8 dst[], -+ const u32 val, struct jit_ctx *ctx) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rd; -+ -+ /* Setup operands */ -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ -+ /* Do LSR operation */ -+ if (val == 0) { -+ /* An immediate value of 0 encodes a shift amount of 32 -+ * for LSR. To shift by 0, don't do anything. -+ */ -+ } else if (val < 32) { -+ emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); -+ emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); -+ emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_LSR, val), ctx); -+ } else if (val == 32) { -+ emit(ARM_MOV_R(rd[1], rd[0]), ctx); -+ emit(ARM_MOV_I(rd[0], 0), ctx); -+ } else { -+ emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_LSR, val - 32), ctx); -+ emit(ARM_MOV_I(rd[0], 0), ctx); -+ } -+ -+ arm_bpf_put_reg64(dst, rd, ctx); -+} -+ -+/* dst = dst >> val (signed) */ -+static inline void emit_a32_arsh_i64(const s8 dst[], -+ const u32 val, struct jit_ctx *ctx){ -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rd; -+ -+ /* Setup operands */ -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ -+ /* Do ARSH operation */ -+ if (val == 0) { -+ /* An immediate value of 0 encodes a shift amount of 32 -+ * for ASR. To shift by 0, don't do anything. -+ */ -+ } else if (val < 32) { -+ emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); -+ emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); -+ emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, val), ctx); -+ } else if (val == 32) { -+ emit(ARM_MOV_R(rd[1], rd[0]), ctx); -+ emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx); -+ } else { -+ emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_ASR, val - 32), ctx); -+ emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx); -+ } -+ -+ arm_bpf_put_reg64(dst, rd, ctx); -+} -+ -+static inline void emit_a32_mul_r64(const s8 dst[], const s8 src[], -+ struct jit_ctx *ctx) { -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rd, *rt; -+ -+ /* Setup operands for multiplication */ -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ rt = arm_bpf_get_reg64(src, tmp2, ctx); -+ -+ /* Do Multiplication */ -+ emit(ARM_MUL(ARM_IP, rd[1], rt[0]), ctx); -+ emit(ARM_MUL(ARM_LR, rd[0], rt[1]), ctx); -+ emit(ARM_ADD_R(ARM_LR, ARM_IP, ARM_LR), ctx); -+ -+ emit(ARM_UMULL(ARM_IP, rd[0], rd[1], rt[1]), ctx); -+ emit(ARM_ADD_R(rd[0], ARM_LR, rd[0]), ctx); -+ -+ arm_bpf_put_reg32(dst_lo, ARM_IP, ctx); -+ arm_bpf_put_reg32(dst_hi, rd[0], ctx); -+} -+ -+static bool is_ldst_imm(s16 off, const u8 size) -+{ -+ s16 off_max = 0; -+ -+ switch (size) { -+ case BPF_B: -+ case BPF_W: -+ off_max = 0xfff; -+ break; -+ case BPF_H: -+ off_max = 0xff; -+ break; -+ case BPF_DW: -+ /* Need to make sure off+4 does not overflow. */ -+ off_max = 0xfff - 4; -+ break; -+ } -+ return -off_max <= off && off <= off_max; -+} -+ -+/* *(size *)(dst + off) = src */ -+static inline void emit_str_r(const s8 dst, const s8 src[], -+ s16 off, struct jit_ctx *ctx, const u8 sz){ -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ s8 rd; -+ -+ rd = arm_bpf_get_reg32(dst, tmp[1], ctx); -+ -+ if (!is_ldst_imm(off, sz)) { -+ emit_a32_mov_i(tmp[0], off, ctx); -+ emit(ARM_ADD_R(tmp[0], tmp[0], rd), ctx); -+ rd = tmp[0]; -+ off = 0; -+ } -+ switch (sz) { -+ case BPF_B: -+ /* Store a Byte */ -+ emit(ARM_STRB_I(src_lo, rd, off), ctx); -+ break; -+ case BPF_H: -+ /* Store a HalfWord */ -+ emit(ARM_STRH_I(src_lo, rd, off), ctx); -+ break; -+ case BPF_W: -+ /* Store a Word */ -+ emit(ARM_STR_I(src_lo, rd, off), ctx); -+ break; -+ case BPF_DW: -+ /* Store a Double Word */ -+ emit(ARM_STR_I(src_lo, rd, off), ctx); -+ emit(ARM_STR_I(src_hi, rd, off + 4), ctx); -+ break; -+ } -+} -+ -+/* dst = *(size*)(src + off) */ -+static inline void emit_ldx_r(const s8 dst[], const s8 src, -+ s16 off, struct jit_ctx *ctx, const u8 sz){ -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *rd = is_stacked(dst_lo) ? tmp : dst; -+ s8 rm = src; -+ -+ if (!is_ldst_imm(off, sz)) { -+ emit_a32_mov_i(tmp[0], off, ctx); -+ emit(ARM_ADD_R(tmp[0], tmp[0], src), ctx); -+ rm = tmp[0]; -+ off = 0; -+ } else if (rd[1] == rm) { -+ emit(ARM_MOV_R(tmp[0], rm), ctx); -+ rm = tmp[0]; -+ } -+ switch (sz) { -+ case BPF_B: -+ /* Load a Byte */ -+ emit(ARM_LDRB_I(rd[1], rm, off), ctx); -+ if (!ctx->prog->aux->verifier_zext) -+ emit_a32_mov_i(rd[0], 0, ctx); -+ break; -+ case BPF_H: -+ /* Load a HalfWord */ -+ emit(ARM_LDRH_I(rd[1], rm, off), ctx); -+ if (!ctx->prog->aux->verifier_zext) -+ emit_a32_mov_i(rd[0], 0, ctx); -+ break; -+ case BPF_W: -+ /* Load a Word */ -+ emit(ARM_LDR_I(rd[1], rm, off), ctx); -+ if (!ctx->prog->aux->verifier_zext) -+ emit_a32_mov_i(rd[0], 0, ctx); -+ break; -+ case BPF_DW: -+ /* Load a Double Word */ -+ emit(ARM_LDR_I(rd[1], rm, off), ctx); -+ emit(ARM_LDR_I(rd[0], rm, off + 4), ctx); -+ break; -+ } -+ arm_bpf_put_reg64(dst, rd, ctx); -+} -+ -+/* Arithmatic Operation */ -+static inline void emit_ar_r(const u8 rd, const u8 rt, const u8 rm, -+ const u8 rn, struct jit_ctx *ctx, u8 op, -+ bool is_jmp64) { -+ switch (op) { -+ case BPF_JSET: -+ if (is_jmp64) { -+ emit(ARM_AND_R(ARM_IP, rt, rn), ctx); -+ emit(ARM_AND_R(ARM_LR, rd, rm), ctx); -+ emit(ARM_ORRS_R(ARM_IP, ARM_LR, ARM_IP), ctx); -+ } else { -+ emit(ARM_ANDS_R(ARM_IP, rt, rn), ctx); - } -- return; -+ break; -+ case BPF_JEQ: -+ case BPF_JNE: -+ case BPF_JGT: -+ case BPF_JGE: -+ case BPF_JLE: -+ case BPF_JLT: -+ if (is_jmp64) { -+ emit(ARM_CMP_R(rd, rm), ctx); -+ /* Only compare low halve if high halve are equal. */ -+ _emit(ARM_COND_EQ, ARM_CMP_R(rt, rn), ctx); -+ } else { -+ emit(ARM_CMP_R(rt, rn), ctx); -+ } -+ break; -+ case BPF_JSLE: -+ case BPF_JSGT: -+ emit(ARM_CMP_R(rn, rt), ctx); -+ if (is_jmp64) -+ emit(ARM_SBCS_R(ARM_IP, rm, rd), ctx); -+ break; -+ case BPF_JSLT: -+ case BPF_JSGE: -+ emit(ARM_CMP_R(rt, rn), ctx); -+ if (is_jmp64) -+ emit(ARM_SBCS_R(ARM_IP, rd, rm), ctx); -+ break; - } --#endif -+} - -- /* -- * For BPF_ALU | BPF_DIV | BPF_K instructions, rm is ARM_R4 -- * (r_A) and rn is ARM_R0 (r_scratch) so load rn first into -- * ARM_R1 to avoid accidentally overwriting ARM_R0 with rm -- * before using it as a source for ARM_R1. -- * -- * For BPF_ALU | BPF_DIV | BPF_X rm is ARM_R4 (r_A) and rn is -- * ARM_R5 (r_X) so there is no particular register overlap -- * issues. -+static int out_offset = -1; /* initialized on the first pass of build_body() */ -+static int emit_bpf_tail_call(struct jit_ctx *ctx) -+{ -+ -+ /* bpf_tail_call(void *prog_ctx, struct bpf_array *array, u64 index) */ -+ const s8 *r2 = bpf2a32[BPF_REG_2]; -+ const s8 *r3 = bpf2a32[BPF_REG_3]; -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *tcc = bpf2a32[TCALL_CNT]; -+ const s8 *tc; -+ const int idx0 = ctx->idx; -+#define cur_offset (ctx->idx - idx0) -+#define jmp_offset (out_offset - (cur_offset) - 2) -+ u32 lo, hi; -+ s8 r_array, r_index; -+ int off; -+ -+ /* if (index >= array->map.max_entries) -+ * goto out; - */ -- if (rn != ARM_R1) -- emit(ARM_MOV_R(ARM_R1, rn), ctx); -- if (rm != ARM_R0) -- emit(ARM_MOV_R(ARM_R0, rm), ctx); -+ BUILD_BUG_ON(offsetof(struct bpf_array, map.max_entries) > -+ ARM_INST_LDST__IMM12); -+ off = offsetof(struct bpf_array, map.max_entries); -+ r_array = arm_bpf_get_reg32(r2[1], tmp2[0], ctx); -+ /* index is 32-bit for arrays */ -+ r_index = arm_bpf_get_reg32(r3[1], tmp2[1], ctx); -+ /* array->map.max_entries */ -+ emit(ARM_LDR_I(tmp[1], r_array, off), ctx); -+ /* index >= array->map.max_entries */ -+ emit(ARM_CMP_R(r_index, tmp[1]), ctx); -+ _emit(ARM_COND_CS, ARM_B(jmp_offset), ctx); -+ -+ /* tmp2[0] = array, tmp2[1] = index */ -+ -+ /* if (tail_call_cnt > MAX_TAIL_CALL_CNT) -+ * goto out; -+ * tail_call_cnt++; -+ */ -+ lo = (u32)MAX_TAIL_CALL_CNT; -+ hi = (u32)((u64)MAX_TAIL_CALL_CNT >> 32); -+ tc = arm_bpf_get_reg64(tcc, tmp, ctx); -+ emit(ARM_CMP_I(tc[0], hi), ctx); -+ _emit(ARM_COND_EQ, ARM_CMP_I(tc[1], lo), ctx); -+ _emit(ARM_COND_HI, ARM_B(jmp_offset), ctx); -+ emit(ARM_ADDS_I(tc[1], tc[1], 1), ctx); -+ emit(ARM_ADC_I(tc[0], tc[0], 0), ctx); -+ arm_bpf_put_reg64(tcc, tmp, ctx); -+ -+ /* prog = array->ptrs[index] -+ * if (prog == NULL) -+ * goto out; -+ */ -+ BUILD_BUG_ON(imm8m(offsetof(struct bpf_array, ptrs)) < 0); -+ off = imm8m(offsetof(struct bpf_array, ptrs)); -+ emit(ARM_ADD_I(tmp[1], r_array, off), ctx); -+ emit(ARM_LDR_R_SI(tmp[1], tmp[1], r_index, SRTYPE_ASL, 2), ctx); -+ emit(ARM_CMP_I(tmp[1], 0), ctx); -+ _emit(ARM_COND_EQ, ARM_B(jmp_offset), ctx); -+ -+ /* goto *(prog->bpf_func + prologue_size); */ -+ BUILD_BUG_ON(offsetof(struct bpf_prog, bpf_func) > -+ ARM_INST_LDST__IMM12); -+ off = offsetof(struct bpf_prog, bpf_func); -+ emit(ARM_LDR_I(tmp[1], tmp[1], off), ctx); -+ emit(ARM_ADD_I(tmp[1], tmp[1], ctx->prologue_bytes), ctx); -+ emit_bx_r(tmp[1], ctx); -+ -+ /* out: */ -+ if (out_offset == -1) -+ out_offset = cur_offset; -+ if (cur_offset != out_offset) { -+ pr_err_once("tail_call out_offset = %d, expected %d!\n", -+ cur_offset, out_offset); -+ return -1; -+ } -+ return 0; -+#undef cur_offset -+#undef jmp_offset -+} -+ -+/* 0xabcd => 0xcdab */ -+static inline void emit_rev16(const u8 rd, const u8 rn, struct jit_ctx *ctx) -+{ -+#if __LINUX_ARM_ARCH__ < 6 -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; - -- ctx->seen |= SEEN_CALL; -- emit_mov_i(ARM_R3, bpf_op == BPF_DIV ? (u32)jit_udiv : (u32)jit_mod, -- ctx); -- emit_blx_r(ARM_R3, ctx); -+ emit(ARM_AND_I(tmp2[1], rn, 0xff), ctx); -+ emit(ARM_MOV_SI(tmp2[0], rn, SRTYPE_LSR, 8), ctx); -+ emit(ARM_AND_I(tmp2[0], tmp2[0], 0xff), ctx); -+ emit(ARM_ORR_SI(rd, tmp2[0], tmp2[1], SRTYPE_LSL, 8), ctx); -+#else /* ARMv6+ */ -+ emit(ARM_REV16(rd, rn), ctx); -+#endif -+} - -- if (rd != ARM_R0) -- emit(ARM_MOV_R(rd, ARM_R0), ctx); -+/* 0xabcdefgh => 0xghefcdab */ -+static inline void emit_rev32(const u8 rd, const u8 rn, struct jit_ctx *ctx) -+{ -+#if __LINUX_ARM_ARCH__ < 6 -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ -+ emit(ARM_AND_I(tmp2[1], rn, 0xff), ctx); -+ emit(ARM_MOV_SI(tmp2[0], rn, SRTYPE_LSR, 24), ctx); -+ emit(ARM_ORR_SI(ARM_IP, tmp2[0], tmp2[1], SRTYPE_LSL, 24), ctx); -+ -+ emit(ARM_MOV_SI(tmp2[1], rn, SRTYPE_LSR, 8), ctx); -+ emit(ARM_AND_I(tmp2[1], tmp2[1], 0xff), ctx); -+ emit(ARM_MOV_SI(tmp2[0], rn, SRTYPE_LSR, 16), ctx); -+ emit(ARM_AND_I(tmp2[0], tmp2[0], 0xff), ctx); -+ emit(ARM_MOV_SI(tmp2[0], tmp2[0], SRTYPE_LSL, 8), ctx); -+ emit(ARM_ORR_SI(tmp2[0], tmp2[0], tmp2[1], SRTYPE_LSL, 16), ctx); -+ emit(ARM_ORR_R(rd, ARM_IP, tmp2[0]), ctx); -+ -+#else /* ARMv6+ */ -+ emit(ARM_REV(rd, rn), ctx); -+#endif - } - --static inline void update_on_xread(struct jit_ctx *ctx) -+// push the scratch stack register on top of the stack -+static inline void emit_push_r64(const s8 src[], struct jit_ctx *ctx) - { -- if (!(ctx->seen & SEEN_X)) -- ctx->flags |= FLAG_NEED_X_RESET; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s8 *rt; -+ u16 reg_set = 0; -+ -+ rt = arm_bpf_get_reg64(src, tmp2, ctx); - -- ctx->seen |= SEEN_X; -+ reg_set = (1 << rt[1]) | (1 << rt[0]); -+ emit(ARM_PUSH(reg_set), ctx); - } - --static int build_body(struct jit_ctx *ctx) -+static void build_prologue(struct jit_ctx *ctx) - { -- void *load_func[] = {jit_get_skb_b, jit_get_skb_h, jit_get_skb_w}; -- const struct bpf_prog *prog = ctx->skf; -- const struct sock_filter *inst; -- unsigned i, load_order, off, condt; -- int imm12; -- u32 k; -+ const s8 r0 = bpf2a32[BPF_REG_0][1]; -+ const s8 r2 = bpf2a32[BPF_REG_1][1]; -+ const s8 r3 = bpf2a32[BPF_REG_1][0]; -+ const s8 r4 = bpf2a32[BPF_REG_6][1]; -+ const s8 fplo = bpf2a32[BPF_REG_FP][1]; -+ const s8 fphi = bpf2a32[BPF_REG_FP][0]; -+ const s8 *tcc = bpf2a32[TCALL_CNT]; - -- for (i = 0; i < prog->len; i++) { -- u16 code; -+ /* Save callee saved registers. */ -+#ifdef CONFIG_FRAME_POINTER -+ u16 reg_set = CALLEE_PUSH_MASK | 1 << ARM_IP | 1 << ARM_PC; -+ emit(ARM_MOV_R(ARM_IP, ARM_SP), ctx); -+ emit(ARM_PUSH(reg_set), ctx); -+ emit(ARM_SUB_I(ARM_FP, ARM_IP, 4), ctx); -+#else -+ emit(ARM_PUSH(CALLEE_PUSH_MASK), ctx); -+ emit(ARM_MOV_R(ARM_FP, ARM_SP), ctx); -+#endif -+ /* Save frame pointer for later */ -+ emit(ARM_SUB_I(ARM_IP, ARM_SP, SCRATCH_SIZE), ctx); - -- inst = &(prog->insns[i]); -- /* K as an immediate value operand */ -- k = inst->k; -- code = bpf_anc_helper(inst); -+ ctx->stack_size = imm8m(STACK_SIZE); - -- /* compute offsets only in the fake pass */ -- if (ctx->target == NULL) -- ctx->offsets[i] = ctx->idx * 4; -+ /* Set up function call stack */ -+ emit(ARM_SUB_I(ARM_SP, ARM_SP, ctx->stack_size), ctx); - -- switch (code) { -- case BPF_LD | BPF_IMM: -- emit_mov_i(r_A, k, ctx); -- break; -- case BPF_LD | BPF_W | BPF_LEN: -- ctx->seen |= SEEN_SKB; -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4); -- emit(ARM_LDR_I(r_A, r_skb, -- offsetof(struct sk_buff, len)), ctx); -- break; -- case BPF_LD | BPF_MEM: -- /* A = scratch[k] */ -- ctx->seen |= SEEN_MEM_WORD(k); -- emit(ARM_LDR_I(r_A, ARM_SP, SCRATCH_OFF(k)), ctx); -- break; -- case BPF_LD | BPF_W | BPF_ABS: -- load_order = 2; -- goto load; -- case BPF_LD | BPF_H | BPF_ABS: -- load_order = 1; -- goto load; -- case BPF_LD | BPF_B | BPF_ABS: -- load_order = 0; --load: -- emit_mov_i(r_off, k, ctx); --load_common: -- ctx->seen |= SEEN_DATA | SEEN_CALL; -- -- if (load_order > 0) { -- emit(ARM_SUB_I(r_scratch, r_skb_hl, -- 1 << load_order), ctx); -- emit(ARM_CMP_R(r_scratch, r_off), ctx); -- condt = ARM_COND_GE; -- } else { -- emit(ARM_CMP_R(r_skb_hl, r_off), ctx); -- condt = ARM_COND_HI; -- } -+ /* Set up BPF prog stack base register */ -+ emit_a32_mov_r(fplo, ARM_IP, ctx); -+ emit_a32_mov_i(fphi, 0, ctx); - -- /* -- * test for negative offset, only if we are -- * currently scheduled to take the fast -- * path. this will update the flags so that -- * the slowpath instruction are ignored if the -- * offset is negative. -- * -- * for loard_order == 0 the HI condition will -- * make loads at offset 0 take the slow path too. -- */ -- _emit(condt, ARM_CMP_I(r_off, 0), ctx); -+ /* mov r4, 0 */ -+ emit(ARM_MOV_I(r4, 0), ctx); - -- _emit(condt, ARM_ADD_R(r_scratch, r_off, r_skb_data), -- ctx); -+ /* Move BPF_CTX to BPF_R1 */ -+ emit(ARM_MOV_R(r3, r4), ctx); -+ emit(ARM_MOV_R(r2, r0), ctx); -+ /* Initialize Tail Count */ -+ emit(ARM_STR_I(r4, ARM_FP, EBPF_SCRATCH_TO_ARM_FP(tcc[0])), ctx); -+ emit(ARM_STR_I(r4, ARM_FP, EBPF_SCRATCH_TO_ARM_FP(tcc[1])), ctx); -+ /* end of prologue */ -+} - -- if (load_order == 0) -- _emit(condt, ARM_LDRB_I(r_A, r_scratch, 0), -- ctx); -- else if (load_order == 1) -- emit_load_be16(condt, r_A, r_scratch, ctx); -- else if (load_order == 2) -- emit_load_be32(condt, r_A, r_scratch, ctx); -- -- _emit(condt, ARM_B(b_imm(i + 1, ctx)), ctx); -- -- /* the slowpath */ -- emit_mov_i(ARM_R3, (u32)load_func[load_order], ctx); -- emit(ARM_MOV_R(ARM_R0, r_skb), ctx); -- /* the offset is already in R1 */ -- emit_blx_r(ARM_R3, ctx); -- /* check the result of skb_copy_bits */ -- emit(ARM_CMP_I(ARM_R1, 0), ctx); -- emit_err_ret(ARM_COND_NE, ctx); -- emit(ARM_MOV_R(r_A, ARM_R0), ctx); -- break; -- case BPF_LD | BPF_W | BPF_IND: -- load_order = 2; -- goto load_ind; -- case BPF_LD | BPF_H | BPF_IND: -- load_order = 1; -- goto load_ind; -- case BPF_LD | BPF_B | BPF_IND: -- load_order = 0; --load_ind: -- update_on_xread(ctx); -- OP_IMM3(ARM_ADD, r_off, r_X, k, ctx); -- goto load_common; -- case BPF_LDX | BPF_IMM: -- ctx->seen |= SEEN_X; -- emit_mov_i(r_X, k, ctx); -- break; -- case BPF_LDX | BPF_W | BPF_LEN: -- ctx->seen |= SEEN_X | SEEN_SKB; -- emit(ARM_LDR_I(r_X, r_skb, -- offsetof(struct sk_buff, len)), ctx); -- break; -- case BPF_LDX | BPF_MEM: -- ctx->seen |= SEEN_X | SEEN_MEM_WORD(k); -- emit(ARM_LDR_I(r_X, ARM_SP, SCRATCH_OFF(k)), ctx); -- break; -- case BPF_LDX | BPF_B | BPF_MSH: -- /* x = ((*(frame + k)) & 0xf) << 2; */ -- ctx->seen |= SEEN_X | SEEN_DATA | SEEN_CALL; -- /* the interpreter should deal with the negative K */ -- if ((int)k < 0) -- return -1; -- /* offset in r1: we might have to take the slow path */ -- emit_mov_i(r_off, k, ctx); -- emit(ARM_CMP_R(r_skb_hl, r_off), ctx); -- -- /* load in r0: common with the slowpath */ -- _emit(ARM_COND_HI, ARM_LDRB_R(ARM_R0, r_skb_data, -- ARM_R1), ctx); -- /* -- * emit_mov_i() might generate one or two instructions, -- * the same holds for emit_blx_r() -- */ -- _emit(ARM_COND_HI, ARM_B(b_imm(i + 1, ctx) - 2), ctx); -+/* restore callee saved registers. */ -+static void build_epilogue(struct jit_ctx *ctx) -+{ -+#ifdef CONFIG_FRAME_POINTER -+ /* When using frame pointers, some additional registers need to -+ * be loaded. */ -+ u16 reg_set = CALLEE_POP_MASK | 1 << ARM_SP; -+ emit(ARM_SUB_I(ARM_SP, ARM_FP, hweight16(reg_set) * 4), ctx); -+ emit(ARM_LDM(ARM_SP, reg_set), ctx); -+#else -+ /* Restore callee saved registers. */ -+ emit(ARM_MOV_R(ARM_SP, ARM_FP), ctx); -+ emit(ARM_POP(CALLEE_POP_MASK), ctx); -+#endif -+} - -- emit(ARM_MOV_R(ARM_R0, r_skb), ctx); -- /* r_off is r1 */ -- emit_mov_i(ARM_R3, (u32)jit_get_skb_b, ctx); -- emit_blx_r(ARM_R3, ctx); -- /* check the return value of skb_copy_bits */ -- emit(ARM_CMP_I(ARM_R1, 0), ctx); -- emit_err_ret(ARM_COND_NE, ctx); -- -- emit(ARM_AND_I(r_X, ARM_R0, 0x00f), ctx); -- emit(ARM_LSL_I(r_X, r_X, 2), ctx); -- break; -- case BPF_ST: -- ctx->seen |= SEEN_MEM_WORD(k); -- emit(ARM_STR_I(r_A, ARM_SP, SCRATCH_OFF(k)), ctx); -- break; -- case BPF_STX: -- update_on_xread(ctx); -- ctx->seen |= SEEN_MEM_WORD(k); -- emit(ARM_STR_I(r_X, ARM_SP, SCRATCH_OFF(k)), ctx); -- break; -- case BPF_ALU | BPF_ADD | BPF_K: -- /* A += K */ -- OP_IMM3(ARM_ADD, r_A, r_A, k, ctx); -- break; -- case BPF_ALU | BPF_ADD | BPF_X: -- update_on_xread(ctx); -- emit(ARM_ADD_R(r_A, r_A, r_X), ctx); -- break; -- case BPF_ALU | BPF_SUB | BPF_K: -- /* A -= K */ -- OP_IMM3(ARM_SUB, r_A, r_A, k, ctx); -- break; -- case BPF_ALU | BPF_SUB | BPF_X: -- update_on_xread(ctx); -- emit(ARM_SUB_R(r_A, r_A, r_X), ctx); -- break; -- case BPF_ALU | BPF_MUL | BPF_K: -- /* A *= K */ -- emit_mov_i(r_scratch, k, ctx); -- emit(ARM_MUL(r_A, r_A, r_scratch), ctx); -- break; -- case BPF_ALU | BPF_MUL | BPF_X: -- update_on_xread(ctx); -- emit(ARM_MUL(r_A, r_A, r_X), ctx); -- break; -- case BPF_ALU | BPF_DIV | BPF_K: -- if (k == 1) -- break; -- emit_mov_i(r_scratch, k, ctx); -- emit_udivmod(r_A, r_A, r_scratch, ctx, BPF_DIV); -- break; -- case BPF_ALU | BPF_DIV | BPF_X: -- update_on_xread(ctx); -- emit(ARM_CMP_I(r_X, 0), ctx); -- emit_err_ret(ARM_COND_EQ, ctx); -- emit_udivmod(r_A, r_A, r_X, ctx, BPF_DIV); -- break; -- case BPF_ALU | BPF_MOD | BPF_K: -- if (k == 1) { -- emit_mov_i(r_A, 0, ctx); -+/* -+ * Convert an eBPF instruction to native instruction, i.e -+ * JITs an eBPF instruction. -+ * Returns : -+ * 0 - Successfully JITed an 8-byte eBPF instruction -+ * >0 - Successfully JITed a 16-byte eBPF instruction -+ * <0 - Failed to JIT. -+ */ -+static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) -+{ -+ const u8 code = insn->code; -+ const s8 *dst = bpf2a32[insn->dst_reg]; -+ const s8 *src = bpf2a32[insn->src_reg]; -+ const s8 *tmp = bpf2a32[TMP_REG_1]; -+ const s8 *tmp2 = bpf2a32[TMP_REG_2]; -+ const s16 off = insn->off; -+ const s32 imm = insn->imm; -+ const int i = insn - ctx->prog->insnsi; -+ const bool is64 = BPF_CLASS(code) == BPF_ALU64; -+ const s8 *rd, *rs; -+ s8 rd_lo, rt, rm, rn; -+ s32 jmp_offset; -+ -+#define check_imm(bits, imm) do { \ -+ if ((imm) >= (1 << ((bits) - 1)) || \ -+ (imm) < -(1 << ((bits) - 1))) { \ -+ pr_info("[%2d] imm=%d(0x%x) out of range\n", \ -+ i, imm, imm); \ -+ return -EINVAL; \ -+ } \ -+} while (0) -+#define check_imm24(imm) check_imm(24, imm) -+ -+ switch (code) { -+ /* ALU operations */ -+ -+ /* dst = src */ -+ case BPF_ALU | BPF_MOV | BPF_K: -+ case BPF_ALU | BPF_MOV | BPF_X: -+ case BPF_ALU64 | BPF_MOV | BPF_K: -+ case BPF_ALU64 | BPF_MOV | BPF_X: -+ switch (BPF_SRC(code)) { -+ case BPF_X: -+ if (imm == 1) { -+ /* Special mov32 for zext */ -+ emit_a32_mov_i(dst_hi, 0, ctx); - break; - } -- emit_mov_i(r_scratch, k, ctx); -- emit_udivmod(r_A, r_A, r_scratch, ctx, BPF_MOD); -+ emit_a32_mov_r64(is64, dst, src, ctx); - break; -- case BPF_ALU | BPF_MOD | BPF_X: -- update_on_xread(ctx); -- emit(ARM_CMP_I(r_X, 0), ctx); -- emit_err_ret(ARM_COND_EQ, ctx); -- emit_udivmod(r_A, r_A, r_X, ctx, BPF_MOD); -- break; -- case BPF_ALU | BPF_OR | BPF_K: -- /* A |= K */ -- OP_IMM3(ARM_ORR, r_A, r_A, k, ctx); -- break; -- case BPF_ALU | BPF_OR | BPF_X: -- update_on_xread(ctx); -- emit(ARM_ORR_R(r_A, r_A, r_X), ctx); -- break; -- case BPF_ALU | BPF_XOR | BPF_K: -- /* A ^= K; */ -- OP_IMM3(ARM_EOR, r_A, r_A, k, ctx); -- break; -- case BPF_ANC | SKF_AD_ALU_XOR_X: -- case BPF_ALU | BPF_XOR | BPF_X: -- /* A ^= X */ -- update_on_xread(ctx); -- emit(ARM_EOR_R(r_A, r_A, r_X), ctx); -- break; -- case BPF_ALU | BPF_AND | BPF_K: -- /* A &= K */ -- OP_IMM3(ARM_AND, r_A, r_A, k, ctx); -- break; -- case BPF_ALU | BPF_AND | BPF_X: -- update_on_xread(ctx); -- emit(ARM_AND_R(r_A, r_A, r_X), ctx); -- break; -- case BPF_ALU | BPF_LSH | BPF_K: -- if (unlikely(k > 31)) -- return -1; -- emit(ARM_LSL_I(r_A, r_A, k), ctx); -- break; -- case BPF_ALU | BPF_LSH | BPF_X: -- update_on_xread(ctx); -- emit(ARM_LSL_R(r_A, r_A, r_X), ctx); -- break; -- case BPF_ALU | BPF_RSH | BPF_K: -- if (unlikely(k > 31)) -- return -1; -- if (k) -- emit(ARM_LSR_I(r_A, r_A, k), ctx); -- break; -- case BPF_ALU | BPF_RSH | BPF_X: -- update_on_xread(ctx); -- emit(ARM_LSR_R(r_A, r_A, r_X), ctx); -- break; -- case BPF_ALU | BPF_NEG: -- /* A = -A */ -- emit(ARM_RSB_I(r_A, r_A, 0), ctx); -- break; -- case BPF_JMP | BPF_JA: -- /* pc += K */ -- emit(ARM_B(b_imm(i + k + 1, ctx)), ctx); -- break; -- case BPF_JMP | BPF_JEQ | BPF_K: -- /* pc += (A == K) ? pc->jt : pc->jf */ -- condt = ARM_COND_EQ; -- goto cmp_imm; -- case BPF_JMP | BPF_JGT | BPF_K: -- /* pc += (A > K) ? pc->jt : pc->jf */ -- condt = ARM_COND_HI; -- goto cmp_imm; -- case BPF_JMP | BPF_JGE | BPF_K: -- /* pc += (A >= K) ? pc->jt : pc->jf */ -- condt = ARM_COND_HS; --cmp_imm: -- imm12 = imm8m(k); -- if (imm12 < 0) { -- emit_mov_i_no8m(r_scratch, k, ctx); -- emit(ARM_CMP_R(r_A, r_scratch), ctx); -- } else { -- emit(ARM_CMP_I(r_A, imm12), ctx); -- } --cond_jump: -- if (inst->jt) -- _emit(condt, ARM_B(b_imm(i + inst->jt + 1, -- ctx)), ctx); -- if (inst->jf) -- _emit(condt ^ 1, ARM_B(b_imm(i + inst->jf + 1, -- ctx)), ctx); -- break; -- case BPF_JMP | BPF_JEQ | BPF_X: -- /* pc += (A == X) ? pc->jt : pc->jf */ -- condt = ARM_COND_EQ; -- goto cmp_x; -- case BPF_JMP | BPF_JGT | BPF_X: -- /* pc += (A > X) ? pc->jt : pc->jf */ -- condt = ARM_COND_HI; -- goto cmp_x; -- case BPF_JMP | BPF_JGE | BPF_X: -- /* pc += (A >= X) ? pc->jt : pc->jf */ -- condt = ARM_COND_CS; --cmp_x: -- update_on_xread(ctx); -- emit(ARM_CMP_R(r_A, r_X), ctx); -- goto cond_jump; -- case BPF_JMP | BPF_JSET | BPF_K: -- /* pc += (A & K) ? pc->jt : pc->jf */ -- condt = ARM_COND_NE; -- /* not set iff all zeroes iff Z==1 iff EQ */ -- -- imm12 = imm8m(k); -- if (imm12 < 0) { -- emit_mov_i_no8m(r_scratch, k, ctx); -- emit(ARM_TST_R(r_A, r_scratch), ctx); -- } else { -- emit(ARM_TST_I(r_A, imm12), ctx); -- } -- goto cond_jump; -- case BPF_JMP | BPF_JSET | BPF_X: -- /* pc += (A & X) ? pc->jt : pc->jf */ -- update_on_xread(ctx); -- condt = ARM_COND_NE; -- emit(ARM_TST_R(r_A, r_X), ctx); -- goto cond_jump; -- case BPF_RET | BPF_A: -- emit(ARM_MOV_R(ARM_R0, r_A), ctx); -- goto b_epilogue; -- case BPF_RET | BPF_K: -- if ((k == 0) && (ctx->ret0_fp_idx < 0)) -- ctx->ret0_fp_idx = i; -- emit_mov_i(ARM_R0, k, ctx); --b_epilogue: -- if (i != ctx->skf->len - 1) -- emit(ARM_B(b_imm(prog->len, ctx)), ctx); -- break; -- case BPF_MISC | BPF_TAX: -- /* X = A */ -- ctx->seen |= SEEN_X; -- emit(ARM_MOV_R(r_X, r_A), ctx); -- break; -- case BPF_MISC | BPF_TXA: -- /* A = X */ -- update_on_xread(ctx); -- emit(ARM_MOV_R(r_A, r_X), ctx); -- break; -- case BPF_ANC | SKF_AD_PROTOCOL: -- /* A = ntohs(skb->protocol) */ -- ctx->seen |= SEEN_SKB; -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, -- protocol) != 2); -- off = offsetof(struct sk_buff, protocol); -- emit(ARM_LDRH_I(r_scratch, r_skb, off), ctx); -- emit_swap16(r_A, r_scratch, ctx); -- break; -- case BPF_ANC | SKF_AD_CPU: -- /* r_scratch = current_thread_info() */ -- OP_IMM3(ARM_BIC, r_scratch, ARM_SP, THREAD_SIZE - 1, ctx); -- /* A = current_thread_info()->cpu */ -- BUILD_BUG_ON(FIELD_SIZEOF(struct thread_info, cpu) != 4); -- off = offsetof(struct thread_info, cpu); -- emit(ARM_LDR_I(r_A, r_scratch, off), ctx); -- break; -- case BPF_ANC | SKF_AD_IFINDEX: -- case BPF_ANC | SKF_AD_HATYPE: -- /* A = skb->dev->ifindex */ -- /* A = skb->dev->type */ -- ctx->seen |= SEEN_SKB; -- off = offsetof(struct sk_buff, dev); -- emit(ARM_LDR_I(r_scratch, r_skb, off), ctx); -- -- emit(ARM_CMP_I(r_scratch, 0), ctx); -- emit_err_ret(ARM_COND_EQ, ctx); -- -- BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, -- ifindex) != 4); -- BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, -- type) != 2); -- -- if (code == (BPF_ANC | SKF_AD_IFINDEX)) { -- off = offsetof(struct net_device, ifindex); -- emit(ARM_LDR_I(r_A, r_scratch, off), ctx); -- } else { -- /* -- * offset of field "type" in "struct -- * net_device" is above what can be -- * used in the ldrh rd, [rn, #imm] -- * instruction, so load the offset in -- * a register and use ldrh rd, [rn, rm] -- */ -- off = offsetof(struct net_device, type); -- emit_mov_i(ARM_R3, off, ctx); -- emit(ARM_LDRH_R(r_A, r_scratch, ARM_R3), ctx); -- } -+ case BPF_K: -+ /* Sign-extend immediate value to destination reg */ -+ emit_a32_mov_se_i64(is64, dst, imm, ctx); - break; -- case BPF_ANC | SKF_AD_MARK: -- ctx->seen |= SEEN_SKB; -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, mark) != 4); -- off = offsetof(struct sk_buff, mark); -- emit(ARM_LDR_I(r_A, r_skb, off), ctx); -- break; -- case BPF_ANC | SKF_AD_RXHASH: -- ctx->seen |= SEEN_SKB; -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4); -- off = offsetof(struct sk_buff, hash); -- emit(ARM_LDR_I(r_A, r_skb, off), ctx); -- break; -- case BPF_ANC | SKF_AD_VLAN_TAG: -- case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT: -- ctx->seen |= SEEN_SKB; -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2); -- off = offsetof(struct sk_buff, vlan_tci); -- emit(ARM_LDRH_I(r_A, r_skb, off), ctx); -- if (code == (BPF_ANC | SKF_AD_VLAN_TAG)) -- OP_IMM3(ARM_AND, r_A, r_A, ~VLAN_TAG_PRESENT, ctx); -- else { -- OP_IMM3(ARM_LSR, r_A, r_A, 12, ctx); -- OP_IMM3(ARM_AND, r_A, r_A, 0x1, ctx); -- } -+ } -+ break; -+ /* dst = dst + src/imm */ -+ /* dst = dst - src/imm */ -+ /* dst = dst | src/imm */ -+ /* dst = dst & src/imm */ -+ /* dst = dst ^ src/imm */ -+ /* dst = dst * src/imm */ -+ /* dst = dst << src */ -+ /* dst = dst >> src */ -+ case BPF_ALU | BPF_ADD | BPF_K: -+ case BPF_ALU | BPF_ADD | BPF_X: -+ case BPF_ALU | BPF_SUB | BPF_K: -+ case BPF_ALU | BPF_SUB | BPF_X: -+ case BPF_ALU | BPF_OR | BPF_K: -+ case BPF_ALU | BPF_OR | BPF_X: -+ case BPF_ALU | BPF_AND | BPF_K: -+ case BPF_ALU | BPF_AND | BPF_X: -+ case BPF_ALU | BPF_XOR | BPF_K: -+ case BPF_ALU | BPF_XOR | BPF_X: -+ case BPF_ALU | BPF_MUL | BPF_K: -+ case BPF_ALU | BPF_MUL | BPF_X: -+ case BPF_ALU | BPF_LSH | BPF_X: -+ case BPF_ALU | BPF_RSH | BPF_X: -+ case BPF_ALU | BPF_ARSH | BPF_K: -+ case BPF_ALU | BPF_ARSH | BPF_X: -+ case BPF_ALU64 | BPF_ADD | BPF_K: -+ case BPF_ALU64 | BPF_ADD | BPF_X: -+ case BPF_ALU64 | BPF_SUB | BPF_K: -+ case BPF_ALU64 | BPF_SUB | BPF_X: -+ case BPF_ALU64 | BPF_OR | BPF_K: -+ case BPF_ALU64 | BPF_OR | BPF_X: -+ case BPF_ALU64 | BPF_AND | BPF_K: -+ case BPF_ALU64 | BPF_AND | BPF_X: -+ case BPF_ALU64 | BPF_XOR | BPF_K: -+ case BPF_ALU64 | BPF_XOR | BPF_X: -+ switch (BPF_SRC(code)) { -+ case BPF_X: -+ emit_a32_alu_r64(is64, dst, src, ctx, BPF_OP(code)); -+ break; -+ case BPF_K: -+ /* Move immediate value to the temporary register -+ * and then do the ALU operation on the temporary -+ * register as this will sign-extend the immediate -+ * value into temporary reg and then it would be -+ * safe to do the operation on it. -+ */ -+ emit_a32_mov_se_i64(is64, tmp2, imm, ctx); -+ emit_a32_alu_r64(is64, dst, tmp2, ctx, BPF_OP(code)); - break; -- case BPF_ANC | SKF_AD_PKTTYPE: -- ctx->seen |= SEEN_SKB; -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, -- __pkt_type_offset[0]) != 1); -- off = PKT_TYPE_OFFSET(); -- emit(ARM_LDRB_I(r_A, r_skb, off), ctx); -- emit(ARM_AND_I(r_A, r_A, PKT_TYPE_MAX), ctx); --#ifdef __BIG_ENDIAN_BITFIELD -- emit(ARM_LSR_I(r_A, r_A, 5), ctx); --#endif -+ } -+ break; -+ /* dst = dst / src(imm) */ -+ /* dst = dst % src(imm) */ -+ case BPF_ALU | BPF_DIV | BPF_K: -+ case BPF_ALU | BPF_DIV | BPF_X: -+ case BPF_ALU | BPF_MOD | BPF_K: -+ case BPF_ALU | BPF_MOD | BPF_X: -+ rd_lo = arm_bpf_get_reg32(dst_lo, tmp2[1], ctx); -+ switch (BPF_SRC(code)) { -+ case BPF_X: -+ rt = arm_bpf_get_reg32(src_lo, tmp2[0], ctx); -+ break; -+ case BPF_K: -+ rt = tmp2[0]; -+ emit_a32_mov_i(rt, imm, ctx); - break; -- case BPF_ANC | SKF_AD_QUEUE: -- ctx->seen |= SEEN_SKB; -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, -- queue_mapping) != 2); -- BUILD_BUG_ON(offsetof(struct sk_buff, -- queue_mapping) > 0xff); -- off = offsetof(struct sk_buff, queue_mapping); -- emit(ARM_LDRH_I(r_A, r_skb, off), ctx); -- break; -- case BPF_ANC | SKF_AD_PAY_OFFSET: -- ctx->seen |= SEEN_SKB | SEEN_CALL; -- -- emit(ARM_MOV_R(ARM_R0, r_skb), ctx); -- emit_mov_i(ARM_R3, (unsigned int)skb_get_poff, ctx); -- emit_blx_r(ARM_R3, ctx); -- emit(ARM_MOV_R(r_A, ARM_R0), ctx); -- break; -- case BPF_LDX | BPF_W | BPF_ABS: -- /* -- * load a 32bit word from struct seccomp_data. -- * seccomp_check_filter() will already have checked -- * that k is 32bit aligned and lies within the -- * struct seccomp_data. -+ default: -+ rt = src_lo; -+ break; -+ } -+ emit_udivmod(rd_lo, rd_lo, rt, ctx, BPF_OP(code)); -+ arm_bpf_put_reg32(dst_lo, rd_lo, ctx); -+ if (!ctx->prog->aux->verifier_zext) -+ emit_a32_mov_i(dst_hi, 0, ctx); -+ break; -+ case BPF_ALU64 | BPF_DIV | BPF_K: -+ case BPF_ALU64 | BPF_DIV | BPF_X: -+ case BPF_ALU64 | BPF_MOD | BPF_K: -+ case BPF_ALU64 | BPF_MOD | BPF_X: -+ goto notyet; -+ /* dst = dst >> imm */ -+ /* dst = dst << imm */ -+ case BPF_ALU | BPF_RSH | BPF_K: -+ case BPF_ALU | BPF_LSH | BPF_K: -+ if (unlikely(imm > 31)) -+ return -EINVAL; -+ if (imm) -+ emit_a32_alu_i(dst_lo, imm, ctx, BPF_OP(code)); -+ if (!ctx->prog->aux->verifier_zext) -+ emit_a32_mov_i(dst_hi, 0, ctx); -+ break; -+ /* dst = dst << imm */ -+ case BPF_ALU64 | BPF_LSH | BPF_K: -+ if (unlikely(imm > 63)) -+ return -EINVAL; -+ emit_a32_lsh_i64(dst, imm, ctx); -+ break; -+ /* dst = dst >> imm */ -+ case BPF_ALU64 | BPF_RSH | BPF_K: -+ if (unlikely(imm > 63)) -+ return -EINVAL; -+ emit_a32_rsh_i64(dst, imm, ctx); -+ break; -+ /* dst = dst << src */ -+ case BPF_ALU64 | BPF_LSH | BPF_X: -+ emit_a32_lsh_r64(dst, src, ctx); -+ break; -+ /* dst = dst >> src */ -+ case BPF_ALU64 | BPF_RSH | BPF_X: -+ emit_a32_rsh_r64(dst, src, ctx); -+ break; -+ /* dst = dst >> src (signed) */ -+ case BPF_ALU64 | BPF_ARSH | BPF_X: -+ emit_a32_arsh_r64(dst, src, ctx); -+ break; -+ /* dst = dst >> imm (signed) */ -+ case BPF_ALU64 | BPF_ARSH | BPF_K: -+ if (unlikely(imm > 63)) -+ return -EINVAL; -+ emit_a32_arsh_i64(dst, imm, ctx); -+ break; -+ /* dst = ~dst */ -+ case BPF_ALU | BPF_NEG: -+ emit_a32_alu_i(dst_lo, 0, ctx, BPF_OP(code)); -+ if (!ctx->prog->aux->verifier_zext) -+ emit_a32_mov_i(dst_hi, 0, ctx); -+ break; -+ /* dst = ~dst (64 bit) */ -+ case BPF_ALU64 | BPF_NEG: -+ emit_a32_neg64(dst, ctx); -+ break; -+ /* dst = dst * src/imm */ -+ case BPF_ALU64 | BPF_MUL | BPF_X: -+ case BPF_ALU64 | BPF_MUL | BPF_K: -+ switch (BPF_SRC(code)) { -+ case BPF_X: -+ emit_a32_mul_r64(dst, src, ctx); -+ break; -+ case BPF_K: -+ /* Move immediate value to the temporary register -+ * and then do the multiplication on it as this -+ * will sign-extend the immediate value into temp -+ * reg then it would be safe to do the operation -+ * on it. - */ -- ctx->seen |= SEEN_SKB; -- emit(ARM_LDR_I(r_A, r_skb, k), ctx); -+ emit_a32_mov_se_i64(is64, tmp2, imm, ctx); -+ emit_a32_mul_r64(dst, tmp2, ctx); -+ break; -+ } -+ break; -+ /* dst = htole(dst) */ -+ /* dst = htobe(dst) */ -+ case BPF_ALU | BPF_END | BPF_FROM_LE: -+ case BPF_ALU | BPF_END | BPF_FROM_BE: -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ if (BPF_SRC(code) == BPF_FROM_LE) -+ goto emit_bswap_uxt; -+ switch (imm) { -+ case 16: -+ emit_rev16(rd[1], rd[1], ctx); -+ goto emit_bswap_uxt; -+ case 32: -+ emit_rev32(rd[1], rd[1], ctx); -+ goto emit_bswap_uxt; -+ case 64: -+ emit_rev32(ARM_LR, rd[1], ctx); -+ emit_rev32(rd[1], rd[0], ctx); -+ emit(ARM_MOV_R(rd[0], ARM_LR), ctx); - break; -- default: -- return -1; - } -+ goto exit; -+emit_bswap_uxt: -+ switch (imm) { -+ case 16: -+ /* zero-extend 16 bits into 64 bits */ -+#if __LINUX_ARM_ARCH__ < 6 -+ emit_a32_mov_i(tmp2[1], 0xffff, ctx); -+ emit(ARM_AND_R(rd[1], rd[1], tmp2[1]), ctx); -+#else /* ARMv6+ */ -+ emit(ARM_UXTH(rd[1], rd[1]), ctx); -+#endif -+ if (!ctx->prog->aux->verifier_zext) -+ emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx); -+ break; -+ case 32: -+ /* zero-extend 32 bits into 64 bits */ -+ if (!ctx->prog->aux->verifier_zext) -+ emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx); -+ break; -+ case 64: -+ /* nop */ -+ break; -+ } -+exit: -+ arm_bpf_put_reg64(dst, rd, ctx); -+ break; -+ /* dst = imm64 */ -+ case BPF_LD | BPF_IMM | BPF_DW: -+ { -+ u64 val = (u32)imm | (u64)insn[1].imm << 32; - -- if (ctx->flags & FLAG_IMM_OVERFLOW) -- /* -- * this instruction generated an overflow when -- * trying to access the literal pool, so -- * delegate this filter to the kernel interpreter. -- */ -- return -1; -+ emit_a32_mov_i64(dst, val, ctx); -+ -+ return 1; - } -+ /* LDX: dst = *(size *)(src + off) */ -+ case BPF_LDX | BPF_MEM | BPF_W: -+ case BPF_LDX | BPF_MEM | BPF_H: -+ case BPF_LDX | BPF_MEM | BPF_B: -+ case BPF_LDX | BPF_MEM | BPF_DW: -+ rn = arm_bpf_get_reg32(src_lo, tmp2[1], ctx); -+ emit_ldx_r(dst, rn, off, ctx, BPF_SIZE(code)); -+ break; -+ /* ST: *(size *)(dst + off) = imm */ -+ case BPF_ST | BPF_MEM | BPF_W: -+ case BPF_ST | BPF_MEM | BPF_H: -+ case BPF_ST | BPF_MEM | BPF_B: -+ case BPF_ST | BPF_MEM | BPF_DW: -+ switch (BPF_SIZE(code)) { -+ case BPF_DW: -+ /* Sign-extend immediate value into temp reg */ -+ emit_a32_mov_se_i64(true, tmp2, imm, ctx); -+ break; -+ case BPF_W: -+ case BPF_H: -+ case BPF_B: -+ emit_a32_mov_i(tmp2[1], imm, ctx); -+ break; -+ } -+ emit_str_r(dst_lo, tmp2, off, ctx, BPF_SIZE(code)); -+ break; -+ /* STX XADD: lock *(u32 *)(dst + off) += src */ -+ case BPF_STX | BPF_XADD | BPF_W: -+ /* STX XADD: lock *(u64 *)(dst + off) += src */ -+ case BPF_STX | BPF_XADD | BPF_DW: -+ goto notyet; -+ /* STX: *(size *)(dst + off) = src */ -+ case BPF_STX | BPF_MEM | BPF_W: -+ case BPF_STX | BPF_MEM | BPF_H: -+ case BPF_STX | BPF_MEM | BPF_B: -+ case BPF_STX | BPF_MEM | BPF_DW: -+ rs = arm_bpf_get_reg64(src, tmp2, ctx); -+ emit_str_r(dst_lo, rs, off, ctx, BPF_SIZE(code)); -+ break; -+ /* PC += off if dst == src */ -+ /* PC += off if dst > src */ -+ /* PC += off if dst >= src */ -+ /* PC += off if dst < src */ -+ /* PC += off if dst <= src */ -+ /* PC += off if dst != src */ -+ /* PC += off if dst > src (signed) */ -+ /* PC += off if dst >= src (signed) */ -+ /* PC += off if dst < src (signed) */ -+ /* PC += off if dst <= src (signed) */ -+ /* PC += off if dst & src */ -+ case BPF_JMP | BPF_JEQ | BPF_X: -+ case BPF_JMP | BPF_JGT | BPF_X: -+ case BPF_JMP | BPF_JGE | BPF_X: -+ case BPF_JMP | BPF_JNE | BPF_X: -+ case BPF_JMP | BPF_JSGT | BPF_X: -+ case BPF_JMP | BPF_JSGE | BPF_X: -+ case BPF_JMP | BPF_JSET | BPF_X: -+ case BPF_JMP | BPF_JLE | BPF_X: -+ case BPF_JMP | BPF_JLT | BPF_X: -+ case BPF_JMP | BPF_JSLT | BPF_X: -+ case BPF_JMP | BPF_JSLE | BPF_X: -+ case BPF_JMP32 | BPF_JEQ | BPF_X: -+ case BPF_JMP32 | BPF_JGT | BPF_X: -+ case BPF_JMP32 | BPF_JGE | BPF_X: -+ case BPF_JMP32 | BPF_JNE | BPF_X: -+ case BPF_JMP32 | BPF_JSGT | BPF_X: -+ case BPF_JMP32 | BPF_JSGE | BPF_X: -+ case BPF_JMP32 | BPF_JSET | BPF_X: -+ case BPF_JMP32 | BPF_JLE | BPF_X: -+ case BPF_JMP32 | BPF_JLT | BPF_X: -+ case BPF_JMP32 | BPF_JSLT | BPF_X: -+ case BPF_JMP32 | BPF_JSLE | BPF_X: -+ /* Setup source registers */ -+ rm = arm_bpf_get_reg32(src_hi, tmp2[0], ctx); -+ rn = arm_bpf_get_reg32(src_lo, tmp2[1], ctx); -+ goto go_jmp; -+ /* PC += off if dst == imm */ -+ /* PC += off if dst > imm */ -+ /* PC += off if dst >= imm */ -+ /* PC += off if dst < imm */ -+ /* PC += off if dst <= imm */ -+ /* PC += off if dst != imm */ -+ /* PC += off if dst > imm (signed) */ -+ /* PC += off if dst >= imm (signed) */ -+ /* PC += off if dst < imm (signed) */ -+ /* PC += off if dst <= imm (signed) */ -+ /* PC += off if dst & imm */ -+ case BPF_JMP | BPF_JEQ | BPF_K: -+ case BPF_JMP | BPF_JGT | BPF_K: -+ case BPF_JMP | BPF_JGE | BPF_K: -+ case BPF_JMP | BPF_JNE | BPF_K: -+ case BPF_JMP | BPF_JSGT | BPF_K: -+ case BPF_JMP | BPF_JSGE | BPF_K: -+ case BPF_JMP | BPF_JSET | BPF_K: -+ case BPF_JMP | BPF_JLT | BPF_K: -+ case BPF_JMP | BPF_JLE | BPF_K: -+ case BPF_JMP | BPF_JSLT | BPF_K: -+ case BPF_JMP | BPF_JSLE | BPF_K: -+ case BPF_JMP32 | BPF_JEQ | BPF_K: -+ case BPF_JMP32 | BPF_JGT | BPF_K: -+ case BPF_JMP32 | BPF_JGE | BPF_K: -+ case BPF_JMP32 | BPF_JNE | BPF_K: -+ case BPF_JMP32 | BPF_JSGT | BPF_K: -+ case BPF_JMP32 | BPF_JSGE | BPF_K: -+ case BPF_JMP32 | BPF_JSET | BPF_K: -+ case BPF_JMP32 | BPF_JLT | BPF_K: -+ case BPF_JMP32 | BPF_JLE | BPF_K: -+ case BPF_JMP32 | BPF_JSLT | BPF_K: -+ case BPF_JMP32 | BPF_JSLE | BPF_K: -+ if (off == 0) -+ break; -+ rm = tmp2[0]; -+ rn = tmp2[1]; -+ /* Sign-extend immediate value */ -+ emit_a32_mov_se_i64(true, tmp2, imm, ctx); -+go_jmp: -+ /* Setup destination register */ -+ rd = arm_bpf_get_reg64(dst, tmp, ctx); -+ -+ /* Check for the condition */ -+ emit_ar_r(rd[0], rd[1], rm, rn, ctx, BPF_OP(code), -+ BPF_CLASS(code) == BPF_JMP); -+ -+ /* Setup JUMP instruction */ -+ jmp_offset = bpf2a32_offset(i+off, i, ctx); -+ switch (BPF_OP(code)) { -+ case BPF_JNE: -+ case BPF_JSET: -+ _emit(ARM_COND_NE, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JEQ: -+ _emit(ARM_COND_EQ, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JGT: -+ _emit(ARM_COND_HI, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JGE: -+ _emit(ARM_COND_CS, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JSGT: -+ _emit(ARM_COND_LT, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JSGE: -+ _emit(ARM_COND_GE, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JLE: -+ _emit(ARM_COND_LS, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JLT: -+ _emit(ARM_COND_CC, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JSLT: -+ _emit(ARM_COND_LT, ARM_B(jmp_offset), ctx); -+ break; -+ case BPF_JSLE: -+ _emit(ARM_COND_GE, ARM_B(jmp_offset), ctx); -+ break; -+ } -+ break; -+ /* JMP OFF */ -+ case BPF_JMP | BPF_JA: -+ { -+ if (off == 0) -+ break; -+ jmp_offset = bpf2a32_offset(i+off, i, ctx); -+ check_imm24(jmp_offset); -+ emit(ARM_B(jmp_offset), ctx); -+ break; -+ } -+ /* tail call */ -+ case BPF_JMP | BPF_TAIL_CALL: -+ if (emit_bpf_tail_call(ctx)) -+ return -EFAULT; -+ break; -+ /* function call */ -+ case BPF_JMP | BPF_CALL: -+ { -+ const s8 *r0 = bpf2a32[BPF_REG_0]; -+ const s8 *r1 = bpf2a32[BPF_REG_1]; -+ const s8 *r2 = bpf2a32[BPF_REG_2]; -+ const s8 *r3 = bpf2a32[BPF_REG_3]; -+ const s8 *r4 = bpf2a32[BPF_REG_4]; -+ const s8 *r5 = bpf2a32[BPF_REG_5]; -+ const u32 func = (u32)__bpf_call_base + (u32)imm; -+ -+ emit_a32_mov_r64(true, r0, r1, ctx); -+ emit_a32_mov_r64(true, r1, r2, ctx); -+ emit_push_r64(r5, ctx); -+ emit_push_r64(r4, ctx); -+ emit_push_r64(r3, ctx); - -- /* compute offsets only during the first pass */ -- if (ctx->target == NULL) -- ctx->offsets[i] = ctx->idx * 4; -+ emit_a32_mov_i(tmp[1], func, ctx); -+ emit_blx_r(tmp[1], ctx); - -+ emit(ARM_ADD_I(ARM_SP, ARM_SP, imm8m(24)), ctx); // callee clean -+ break; -+ } -+ /* function return */ -+ case BPF_JMP | BPF_EXIT: -+ /* Optimization: when last instruction is EXIT -+ * simply fallthrough to epilogue. -+ */ -+ if (i == ctx->prog->len - 1) -+ break; -+ jmp_offset = epilogue_offset(ctx); -+ check_imm24(jmp_offset); -+ emit(ARM_B(jmp_offset), ctx); -+ break; -+notyet: -+ pr_info_once("*** NOT YET: opcode %02x ***\n", code); -+ return -EFAULT; -+ default: -+ pr_err_once("unknown opcode %02x\n", code); -+ return -EINVAL; -+ } -+ -+ if (ctx->flags & FLAG_IMM_OVERFLOW) -+ /* -+ * this instruction generated an overflow when -+ * trying to access the literal pool, so -+ * delegate this filter to the kernel interpreter. -+ */ -+ return -1; - return 0; - } - -+static int build_body(struct jit_ctx *ctx) -+{ -+ const struct bpf_prog *prog = ctx->prog; -+ unsigned int i; -+ -+ for (i = 0; i < prog->len; i++) { -+ const struct bpf_insn *insn = &(prog->insnsi[i]); -+ int ret; -+ -+ ret = build_insn(insn, ctx); -+ -+ /* It's used with loading the 64 bit immediate value. */ -+ if (ret > 0) { -+ i++; -+ if (ctx->target == NULL) -+ ctx->offsets[i] = ctx->idx; -+ continue; -+ } -+ -+ if (ctx->target == NULL) -+ ctx->offsets[i] = ctx->idx; -+ -+ /* If unsuccesfull, return with error code */ -+ if (ret) -+ return ret; -+ } -+ return 0; -+} -+ -+static int validate_code(struct jit_ctx *ctx) -+{ -+ int i; -+ -+ for (i = 0; i < ctx->idx; i++) { -+ if (ctx->target[i] == __opcode_to_mem_arm(ARM_INST_UDF)) -+ return -1; -+ } -+ -+ return 0; -+} - --void bpf_jit_compile(struct bpf_prog *fp) -+void bpf_jit_compile(struct bpf_prog *prog) - { -+ /* Nothing to do here. We support Internal BPF. */ -+} -+ -+bool bpf_jit_needs_zext(void) -+{ -+ return true; -+} -+ -+struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) -+{ -+ struct bpf_prog *tmp, *orig_prog = prog; - struct bpf_binary_header *header; -+ bool tmp_blinded = false; - struct jit_ctx ctx; -- unsigned tmp_idx; -- unsigned alloc_size; -- u8 *target_ptr; -+ unsigned int tmp_idx; -+ unsigned int image_size; -+ u8 *image_ptr; - -- if (!bpf_jit_enable) -- return; -+ /* If BPF JIT was not enabled then we must fall back to -+ * the interpreter. -+ */ -+ if (!prog->jit_requested) -+ return orig_prog; - -- memset(&ctx, 0, sizeof(ctx)); -- ctx.skf = fp; -- ctx.ret0_fp_idx = -1; -+ /* If constant blinding was enabled and we failed during blinding -+ * then we must fall back to the interpreter. Otherwise, we save -+ * the new JITed code. -+ */ -+ tmp = bpf_jit_blind_constants(prog); - -- ctx.offsets = kzalloc(4 * (ctx.skf->len + 1), GFP_KERNEL); -- if (ctx.offsets == NULL) -- return; -+ if (IS_ERR(tmp)) -+ return orig_prog; -+ if (tmp != prog) { -+ tmp_blinded = true; -+ prog = tmp; -+ } - -- /* fake pass to fill in the ctx->seen */ -- if (unlikely(build_body(&ctx))) -+ memset(&ctx, 0, sizeof(ctx)); -+ ctx.prog = prog; -+ ctx.cpu_architecture = cpu_architecture(); -+ -+ /* Not able to allocate memory for offsets[] , then -+ * we must fall back to the interpreter -+ */ -+ ctx.offsets = kcalloc(prog->len, sizeof(int), GFP_KERNEL); -+ if (ctx.offsets == NULL) { -+ prog = orig_prog; - goto out; -+ } -+ -+ /* 1) fake pass to find in the length of the JITed code, -+ * to compute ctx->offsets and other context variables -+ * needed to compute final JITed code. -+ * Also, calculate random starting pointer/start of JITed code -+ * which is prefixed by random number of fault instructions. -+ * -+ * If the first pass fails then there is no chance of it -+ * being successful in the second pass, so just fall back -+ * to the interpreter. -+ */ -+ if (build_body(&ctx)) { -+ prog = orig_prog; -+ goto out_off; -+ } - - tmp_idx = ctx.idx; - build_prologue(&ctx); - ctx.prologue_bytes = (ctx.idx - tmp_idx) * 4; - -+ ctx.epilogue_offset = ctx.idx; -+ - #if __LINUX_ARM_ARCH__ < 7 - tmp_idx = ctx.idx; - build_epilogue(&ctx); -@@ -1020,64 +1941,83 @@ void bpf_jit_compile(struct bpf_prog *fp - - ctx.idx += ctx.imm_count; - if (ctx.imm_count) { -- ctx.imms = kzalloc(4 * ctx.imm_count, GFP_KERNEL); -- if (ctx.imms == NULL) -- goto out; -+ ctx.imms = kcalloc(ctx.imm_count, sizeof(u32), GFP_KERNEL); -+ if (ctx.imms == NULL) { -+ prog = orig_prog; -+ goto out_off; -+ } - } - #else -- /* there's nothing after the epilogue on ARMv7 */ -+ /* there's nothing about the epilogue on ARMv7 */ - build_epilogue(&ctx); - #endif -- alloc_size = 4 * ctx.idx; -- header = bpf_jit_binary_alloc(alloc_size, &target_ptr, -- 4, jit_fill_hole); -- if (header == NULL) -- goto out; -+ /* Now we can get the actual image size of the JITed arm code. -+ * Currently, we are not considering the THUMB-2 instructions -+ * for jit, although it can decrease the size of the image. -+ * -+ * As each arm instruction is of length 32bit, we are translating -+ * number of JITed intructions into the size required to store these -+ * JITed code. -+ */ -+ image_size = sizeof(u32) * ctx.idx; - -- ctx.target = (u32 *) target_ptr; -+ /* Now we know the size of the structure to make */ -+ header = bpf_jit_binary_alloc(image_size, &image_ptr, -+ sizeof(u32), jit_fill_hole); -+ /* Not able to allocate memory for the structure then -+ * we must fall back to the interpretation -+ */ -+ if (header == NULL) { -+ prog = orig_prog; -+ goto out_imms; -+ } -+ -+ /* 2.) Actual pass to generate final JIT code */ -+ ctx.target = (u32 *) image_ptr; - ctx.idx = 0; - - build_prologue(&ctx); -+ -+ /* If building the body of the JITed code fails somehow, -+ * we fall back to the interpretation. -+ */ - if (build_body(&ctx) < 0) { --#if __LINUX_ARM_ARCH__ < 7 -- if (ctx.imm_count) -- kfree(ctx.imms); --#endif -+ image_ptr = NULL; - bpf_jit_binary_free(header); -- goto out; -+ prog = orig_prog; -+ goto out_imms; - } - build_epilogue(&ctx); - -+ /* 3.) Extra pass to validate JITed Code */ -+ if (validate_code(&ctx)) { -+ image_ptr = NULL; -+ bpf_jit_binary_free(header); -+ prog = orig_prog; -+ goto out_imms; -+ } - flush_icache_range((u32)header, (u32)(ctx.target + ctx.idx)); - -+ if (bpf_jit_enable > 1) -+ /* there are 2 passes here */ -+ bpf_jit_dump(prog->len, image_size, 2, ctx.target); -+ -+ bpf_jit_binary_lock_ro(header); -+ prog->bpf_func = (void *)ctx.target; -+ prog->jited = 1; -+ prog->jited_len = image_size; -+ -+out_imms: - #if __LINUX_ARM_ARCH__ < 7 - if (ctx.imm_count) - kfree(ctx.imms); - #endif -- -- if (bpf_jit_enable > 1) -- /* there are 2 passes here */ -- bpf_jit_dump(fp->len, alloc_size, 2, ctx.target); -- -- set_memory_ro((unsigned long)header, header->pages); -- fp->bpf_func = (void *)ctx.target; -- fp->jited = 1; --out: -+out_off: - kfree(ctx.offsets); -- return; -+out: -+ if (tmp_blinded) -+ bpf_jit_prog_release_other(prog, prog == orig_prog ? -+ tmp : orig_prog); -+ return prog; - } - --void bpf_jit_free(struct bpf_prog *fp) --{ -- unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK; -- struct bpf_binary_header *header = (void *)addr; -- -- if (!fp->jited) -- goto free_filter; -- -- set_memory_rw(addr, header->pages); -- bpf_jit_binary_free(header); -- --free_filter: -- bpf_prog_unlock_free(fp); --} ---- a/arch/arm/net/bpf_jit_32.h -+++ b/arch/arm/net/bpf_jit_32.h -@@ -1,16 +1,14 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ - /* - * Just-In-Time compiler for BPF filters on 32bit ARM - * - * Copyright (c) 2011 Mircea Gherzan -- * -- * This program is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation; version 2 of the License. - */ - - #ifndef PFILTER_OPCODES_ARM_H - #define PFILTER_OPCODES_ARM_H - -+/* ARM 32bit Registers */ - #define ARM_R0 0 - #define ARM_R1 1 - #define ARM_R2 2 -@@ -22,40 +20,46 @@ - #define ARM_R8 8 - #define ARM_R9 9 - #define ARM_R10 10 --#define ARM_FP 11 --#define ARM_IP 12 --#define ARM_SP 13 --#define ARM_LR 14 --#define ARM_PC 15 -- --#define ARM_COND_EQ 0x0 --#define ARM_COND_NE 0x1 --#define ARM_COND_CS 0x2 -+#define ARM_FP 11 /* Frame Pointer */ -+#define ARM_IP 12 /* Intra-procedure scratch register */ -+#define ARM_SP 13 /* Stack pointer: as load/store base reg */ -+#define ARM_LR 14 /* Link Register */ -+#define ARM_PC 15 /* Program counter */ -+ -+#define ARM_COND_EQ 0x0 /* == */ -+#define ARM_COND_NE 0x1 /* != */ -+#define ARM_COND_CS 0x2 /* unsigned >= */ - #define ARM_COND_HS ARM_COND_CS --#define ARM_COND_CC 0x3 -+#define ARM_COND_CC 0x3 /* unsigned < */ - #define ARM_COND_LO ARM_COND_CC --#define ARM_COND_MI 0x4 --#define ARM_COND_PL 0x5 --#define ARM_COND_VS 0x6 --#define ARM_COND_VC 0x7 --#define ARM_COND_HI 0x8 --#define ARM_COND_LS 0x9 --#define ARM_COND_GE 0xa --#define ARM_COND_LT 0xb --#define ARM_COND_GT 0xc --#define ARM_COND_LE 0xd --#define ARM_COND_AL 0xe -+#define ARM_COND_MI 0x4 /* < 0 */ -+#define ARM_COND_PL 0x5 /* >= 0 */ -+#define ARM_COND_VS 0x6 /* Signed Overflow */ -+#define ARM_COND_VC 0x7 /* No Signed Overflow */ -+#define ARM_COND_HI 0x8 /* unsigned > */ -+#define ARM_COND_LS 0x9 /* unsigned <= */ -+#define ARM_COND_GE 0xa /* Signed >= */ -+#define ARM_COND_LT 0xb /* Signed < */ -+#define ARM_COND_GT 0xc /* Signed > */ -+#define ARM_COND_LE 0xd /* Signed <= */ -+#define ARM_COND_AL 0xe /* None */ - - /* register shift types */ - #define SRTYPE_LSL 0 - #define SRTYPE_LSR 1 - #define SRTYPE_ASR 2 - #define SRTYPE_ROR 3 -+#define SRTYPE_ASL (SRTYPE_LSL) - - #define ARM_INST_ADD_R 0x00800000 -+#define ARM_INST_ADDS_R 0x00900000 -+#define ARM_INST_ADC_R 0x00a00000 -+#define ARM_INST_ADC_I 0x02a00000 - #define ARM_INST_ADD_I 0x02800000 -+#define ARM_INST_ADDS_I 0x02900000 - - #define ARM_INST_AND_R 0x00000000 -+#define ARM_INST_ANDS_R 0x00100000 - #define ARM_INST_AND_I 0x02000000 - - #define ARM_INST_BIC_R 0x01c00000 -@@ -71,13 +75,18 @@ - #define ARM_INST_EOR_R 0x00200000 - #define ARM_INST_EOR_I 0x02200000 - --#define ARM_INST_LDRB_I 0x05d00000 -+#define ARM_INST_LDST__U 0x00800000 -+#define ARM_INST_LDST__IMM12 0x00000fff -+#define ARM_INST_LDRB_I 0x05500000 - #define ARM_INST_LDRB_R 0x07d00000 --#define ARM_INST_LDRH_I 0x01d000b0 -+#define ARM_INST_LDRD_I 0x014000d0 -+#define ARM_INST_LDRH_I 0x015000b0 - #define ARM_INST_LDRH_R 0x019000b0 --#define ARM_INST_LDR_I 0x05900000 -+#define ARM_INST_LDR_I 0x05100000 -+#define ARM_INST_LDR_R 0x07900000 - - #define ARM_INST_LDM 0x08900000 -+#define ARM_INST_LDM_IA 0x08b00000 - - #define ARM_INST_LSL_I 0x01a00000 - #define ARM_INST_LSL_R 0x01a00010 -@@ -86,6 +95,7 @@ - #define ARM_INST_LSR_R 0x01a00030 - - #define ARM_INST_MOV_R 0x01a00000 -+#define ARM_INST_MOVS_R 0x01b00000 - #define ARM_INST_MOV_I 0x03a00000 - #define ARM_INST_MOVW 0x03000000 - #define ARM_INST_MOVT 0x03400000 -@@ -96,17 +106,29 @@ - #define ARM_INST_PUSH 0x092d0000 - - #define ARM_INST_ORR_R 0x01800000 -+#define ARM_INST_ORRS_R 0x01900000 - #define ARM_INST_ORR_I 0x03800000 - - #define ARM_INST_REV 0x06bf0f30 - #define ARM_INST_REV16 0x06bf0fb0 - - #define ARM_INST_RSB_I 0x02600000 -+#define ARM_INST_RSBS_I 0x02700000 -+#define ARM_INST_RSC_I 0x02e00000 - - #define ARM_INST_SUB_R 0x00400000 -+#define ARM_INST_SUBS_R 0x00500000 -+#define ARM_INST_RSB_R 0x00600000 - #define ARM_INST_SUB_I 0x02400000 -- --#define ARM_INST_STR_I 0x05800000 -+#define ARM_INST_SUBS_I 0x02500000 -+#define ARM_INST_SBC_I 0x02c00000 -+#define ARM_INST_SBC_R 0x00c00000 -+#define ARM_INST_SBCS_R 0x00d00000 -+ -+#define ARM_INST_STR_I 0x05000000 -+#define ARM_INST_STRB_I 0x05400000 -+#define ARM_INST_STRD_I 0x014000f0 -+#define ARM_INST_STRH_I 0x014000b0 - - #define ARM_INST_TST_R 0x01100000 - #define ARM_INST_TST_I 0x03100000 -@@ -117,6 +139,8 @@ - - #define ARM_INST_MLS 0x00600090 - -+#define ARM_INST_UXTH 0x06ff0070 -+ - /* - * Use a suitable undefined instruction to use for ARM/Thumb2 faulting. - * We need to be careful not to conflict with those used by other modules -@@ -135,11 +159,18 @@ - #define _AL3_R(op, rd, rn, rm) ((op ## _R) | (rd) << 12 | (rn) << 16 | (rm)) - /* immediate */ - #define _AL3_I(op, rd, rn, imm) ((op ## _I) | (rd) << 12 | (rn) << 16 | (imm)) -+/* register with register-shift */ -+#define _AL3_SR(inst) (inst | (1 << 4)) - - #define ARM_ADD_R(rd, rn, rm) _AL3_R(ARM_INST_ADD, rd, rn, rm) -+#define ARM_ADDS_R(rd, rn, rm) _AL3_R(ARM_INST_ADDS, rd, rn, rm) - #define ARM_ADD_I(rd, rn, imm) _AL3_I(ARM_INST_ADD, rd, rn, imm) -+#define ARM_ADDS_I(rd, rn, imm) _AL3_I(ARM_INST_ADDS, rd, rn, imm) -+#define ARM_ADC_R(rd, rn, rm) _AL3_R(ARM_INST_ADC, rd, rn, rm) -+#define ARM_ADC_I(rd, rn, imm) _AL3_I(ARM_INST_ADC, rd, rn, imm) - - #define ARM_AND_R(rd, rn, rm) _AL3_R(ARM_INST_AND, rd, rn, rm) -+#define ARM_ANDS_R(rd, rn, rm) _AL3_R(ARM_INST_ANDS, rd, rn, rm) - #define ARM_AND_I(rd, rn, imm) _AL3_I(ARM_INST_AND, rd, rn, imm) - - #define ARM_BIC_R(rd, rn, rm) _AL3_R(ARM_INST_BIC, rd, rn, rm) -@@ -155,27 +186,38 @@ - #define ARM_EOR_R(rd, rn, rm) _AL3_R(ARM_INST_EOR, rd, rn, rm) - #define ARM_EOR_I(rd, rn, imm) _AL3_I(ARM_INST_EOR, rd, rn, imm) - --#define ARM_LDR_I(rt, rn, off) (ARM_INST_LDR_I | (rt) << 12 | (rn) << 16 \ -- | (off)) --#define ARM_LDRB_I(rt, rn, off) (ARM_INST_LDRB_I | (rt) << 12 | (rn) << 16 \ -- | (off)) --#define ARM_LDRB_R(rt, rn, rm) (ARM_INST_LDRB_R | (rt) << 12 | (rn) << 16 \ -+#define ARM_LDR_R(rt, rn, rm) (ARM_INST_LDR_R | ARM_INST_LDST__U \ -+ | (rt) << 12 | (rn) << 16 \ - | (rm)) --#define ARM_LDRH_I(rt, rn, off) (ARM_INST_LDRH_I | (rt) << 12 | (rn) << 16 \ -- | (((off) & 0xf0) << 4) | ((off) & 0xf)) --#define ARM_LDRH_R(rt, rn, rm) (ARM_INST_LDRH_R | (rt) << 12 | (rn) << 16 \ -+#define ARM_LDR_R_SI(rt, rn, rm, type, imm) \ -+ (ARM_INST_LDR_R | ARM_INST_LDST__U \ -+ | (rt) << 12 | (rn) << 16 \ -+ | (imm) << 7 | (type) << 5 | (rm)) -+#define ARM_LDRB_R(rt, rn, rm) (ARM_INST_LDRB_R | ARM_INST_LDST__U \ -+ | (rt) << 12 | (rn) << 16 \ -+ | (rm)) -+#define ARM_LDRH_R(rt, rn, rm) (ARM_INST_LDRH_R | ARM_INST_LDST__U \ -+ | (rt) << 12 | (rn) << 16 \ - | (rm)) - - #define ARM_LDM(rn, regs) (ARM_INST_LDM | (rn) << 16 | (regs)) -+#define ARM_LDM_IA(rn, regs) (ARM_INST_LDM_IA | (rn) << 16 | (regs)) - - #define ARM_LSL_R(rd, rn, rm) (_AL3_R(ARM_INST_LSL, rd, 0, rn) | (rm) << 8) - #define ARM_LSL_I(rd, rn, imm) (_AL3_I(ARM_INST_LSL, rd, 0, rn) | (imm) << 7) - - #define ARM_LSR_R(rd, rn, rm) (_AL3_R(ARM_INST_LSR, rd, 0, rn) | (rm) << 8) - #define ARM_LSR_I(rd, rn, imm) (_AL3_I(ARM_INST_LSR, rd, 0, rn) | (imm) << 7) -+#define ARM_ASR_R(rd, rn, rm) (_AL3_R(ARM_INST_ASR, rd, 0, rn) | (rm) << 8) -+#define ARM_ASR_I(rd, rn, imm) (_AL3_I(ARM_INST_ASR, rd, 0, rn) | (imm) << 7) - - #define ARM_MOV_R(rd, rm) _AL3_R(ARM_INST_MOV, rd, 0, rm) -+#define ARM_MOVS_R(rd, rm) _AL3_R(ARM_INST_MOVS, rd, 0, rm) - #define ARM_MOV_I(rd, imm) _AL3_I(ARM_INST_MOV, rd, 0, imm) -+#define ARM_MOV_SR(rd, rm, type, rs) \ -+ (_AL3_SR(ARM_MOV_R(rd, rm)) | (type) << 5 | (rs) << 8) -+#define ARM_MOV_SI(rd, rm, type, imm6) \ -+ (ARM_MOV_R(rd, rm) | (type) << 5 | (imm6) << 7) - - #define ARM_MOVW(rd, imm) \ - (ARM_INST_MOVW | ((imm) >> 12) << 16 | (rd) << 12 | ((imm) & 0x0fff)) -@@ -190,19 +232,31 @@ - - #define ARM_ORR_R(rd, rn, rm) _AL3_R(ARM_INST_ORR, rd, rn, rm) - #define ARM_ORR_I(rd, rn, imm) _AL3_I(ARM_INST_ORR, rd, rn, imm) --#define ARM_ORR_S(rd, rn, rm, type, rs) \ -- (ARM_ORR_R(rd, rn, rm) | (type) << 5 | (rs) << 7) -+#define ARM_ORR_SR(rd, rn, rm, type, rs) \ -+ (_AL3_SR(ARM_ORR_R(rd, rn, rm)) | (type) << 5 | (rs) << 8) -+#define ARM_ORRS_R(rd, rn, rm) _AL3_R(ARM_INST_ORRS, rd, rn, rm) -+#define ARM_ORRS_SR(rd, rn, rm, type, rs) \ -+ (_AL3_SR(ARM_ORRS_R(rd, rn, rm)) | (type) << 5 | (rs) << 8) -+#define ARM_ORR_SI(rd, rn, rm, type, imm6) \ -+ (ARM_ORR_R(rd, rn, rm) | (type) << 5 | (imm6) << 7) -+#define ARM_ORRS_SI(rd, rn, rm, type, imm6) \ -+ (ARM_ORRS_R(rd, rn, rm) | (type) << 5 | (imm6) << 7) - - #define ARM_REV(rd, rm) (ARM_INST_REV | (rd) << 12 | (rm)) - #define ARM_REV16(rd, rm) (ARM_INST_REV16 | (rd) << 12 | (rm)) - - #define ARM_RSB_I(rd, rn, imm) _AL3_I(ARM_INST_RSB, rd, rn, imm) -+#define ARM_RSBS_I(rd, rn, imm) _AL3_I(ARM_INST_RSBS, rd, rn, imm) -+#define ARM_RSC_I(rd, rn, imm) _AL3_I(ARM_INST_RSC, rd, rn, imm) - - #define ARM_SUB_R(rd, rn, rm) _AL3_R(ARM_INST_SUB, rd, rn, rm) -+#define ARM_SUBS_R(rd, rn, rm) _AL3_R(ARM_INST_SUBS, rd, rn, rm) -+#define ARM_RSB_R(rd, rn, rm) _AL3_R(ARM_INST_RSB, rd, rn, rm) -+#define ARM_SBC_R(rd, rn, rm) _AL3_R(ARM_INST_SBC, rd, rn, rm) -+#define ARM_SBCS_R(rd, rn, rm) _AL3_R(ARM_INST_SBCS, rd, rn, rm) - #define ARM_SUB_I(rd, rn, imm) _AL3_I(ARM_INST_SUB, rd, rn, imm) -- --#define ARM_STR_I(rt, rn, off) (ARM_INST_STR_I | (rt) << 12 | (rn) << 16 \ -- | (off)) -+#define ARM_SUBS_I(rd, rn, imm) _AL3_I(ARM_INST_SUBS, rd, rn, imm) -+#define ARM_SBC_I(rd, rn, imm) _AL3_I(ARM_INST_SBC, rd, rn, imm) - - #define ARM_TST_R(rn, rm) _AL3_R(ARM_INST_TST, 0, rn, rm) - #define ARM_TST_I(rn, imm) _AL3_I(ARM_INST_TST, 0, rn, imm) -@@ -214,5 +268,6 @@ - - #define ARM_MLS(rd, rn, rm, ra) (ARM_INST_MLS | (rd) << 16 | (rn) | (rm) << 8 \ - | (ra) << 12) -+#define ARM_UXTH(rd, rm) (ARM_INST_UXTH | (rd) << 12 | (rm)) - - #endif /* PFILTER_OPCODES_ARM_H */ ---- a/arch/arm/net/Makefile -+++ b/arch/arm/net/Makefile -@@ -1,3 +1,4 @@ -+# SPDX-License-Identifier: GPL-2.0-only - # ARM-specific networking code - - obj-$(CONFIG_BPF_JIT) += bpf_jit_32.o ---- /dev/null -+++ b/include/linux/bpf-cgroup.h -@@ -0,0 +1,410 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+#ifndef _BPF_CGROUP_H -+#define _BPF_CGROUP_H -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+struct sock; -+struct sockaddr; -+struct cgroup; -+struct sk_buff; -+struct bpf_map; -+struct bpf_prog; -+struct bpf_sock_ops_kern; -+struct bpf_cgroup_storage; -+struct ctl_table; -+struct ctl_table_header; -+ -+#ifdef CONFIG_CGROUP_BPF -+ -+extern struct static_key_false cgroup_bpf_enabled_key; -+#define cgroup_bpf_enabled static_branch_unlikely(&cgroup_bpf_enabled_key) -+ -+DECLARE_PER_CPU(struct bpf_cgroup_storage*, -+ bpf_cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE]); -+ -+#define for_each_cgroup_storage_type(stype) \ -+ for (stype = 0; stype < MAX_BPF_CGROUP_STORAGE_TYPE; stype++) -+ -+struct bpf_cgroup_storage_map; -+ -+struct bpf_storage_buffer { -+ struct rcu_head rcu; -+ char data[0]; -+}; -+ -+struct bpf_cgroup_storage { -+ union { -+ struct bpf_storage_buffer *buf; -+ void __percpu *percpu_buf; -+ }; -+ struct bpf_cgroup_storage_map *map; -+ struct bpf_cgroup_storage_key key; -+ struct list_head list; -+ struct rb_node node; -+ struct rcu_head rcu; -+}; -+ -+struct bpf_prog_list { -+ struct list_head node; -+ struct bpf_prog *prog; -+ struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE]; -+}; -+ -+struct bpf_prog_array; -+ -+struct cgroup_bpf { -+ /* array of effective progs in this cgroup */ -+ struct bpf_prog_array __rcu *effective[MAX_BPF_ATTACH_TYPE]; -+ -+ /* attached progs to this cgroup and attach flags -+ * when flags == 0 or BPF_F_ALLOW_OVERRIDE the progs list will -+ * have either zero or one element -+ * when BPF_F_ALLOW_MULTI the list can have up to BPF_CGROUP_MAX_PROGS -+ */ -+ struct list_head progs[MAX_BPF_ATTACH_TYPE]; -+ u32 flags[MAX_BPF_ATTACH_TYPE]; -+ -+ /* temp storage for effective prog array used by prog_attach/detach */ -+ struct bpf_prog_array *inactive; -+ -+ /* reference counter used to detach bpf programs after cgroup removal */ -+ struct percpu_ref refcnt; -+ -+ /* cgroup_bpf is released using a work queue */ -+ struct work_struct release_work; -+}; -+ -+int cgroup_bpf_inherit(struct cgroup *cgrp); -+void cgroup_bpf_offline(struct cgroup *cgrp); -+ -+int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog, -+ enum bpf_attach_type type, u32 flags); -+int __cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog, -+ enum bpf_attach_type type); -+int __cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr, -+ union bpf_attr __user *uattr); -+ -+/* Wrapper for __cgroup_bpf_*() protected by cgroup_mutex */ -+int cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog, -+ enum bpf_attach_type type, u32 flags); -+int cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog, -+ enum bpf_attach_type type, u32 flags); -+int cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr, -+ union bpf_attr __user *uattr); -+ -+int __cgroup_bpf_run_filter_skb(struct sock *sk, -+ struct sk_buff *skb, -+ enum bpf_attach_type type); -+ -+int __cgroup_bpf_run_filter_sk(struct sock *sk, -+ enum bpf_attach_type type); -+ -+int __cgroup_bpf_run_filter_sock_addr(struct sock *sk, -+ struct sockaddr *uaddr, -+ enum bpf_attach_type type, -+ void *t_ctx); -+ -+int __cgroup_bpf_run_filter_sock_ops(struct sock *sk, -+ struct bpf_sock_ops_kern *sock_ops, -+ enum bpf_attach_type type); -+ -+int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor, -+ short access, enum bpf_attach_type type); -+ -+int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head, -+ struct ctl_table *table, int write, -+ void __user *buf, size_t *pcount, -+ loff_t *ppos, void **new_buf, -+ enum bpf_attach_type type); -+ -+int __cgroup_bpf_run_filter_setsockopt(struct sock *sock, int *level, -+ int *optname, char __user *optval, -+ int *optlen, char **kernel_optval); -+int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level, -+ int optname, char __user *optval, -+ int __user *optlen, int max_optlen, -+ int retval); -+ -+static inline enum bpf_cgroup_storage_type cgroup_storage_type( -+ struct bpf_map *map) -+{ -+ if (map->map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) -+ return BPF_CGROUP_STORAGE_PERCPU; -+ -+ return BPF_CGROUP_STORAGE_SHARED; -+} -+ -+static inline void bpf_cgroup_storage_set(struct bpf_cgroup_storage -+ *storage[MAX_BPF_CGROUP_STORAGE_TYPE]) -+{ -+ enum bpf_cgroup_storage_type stype; -+ -+ for_each_cgroup_storage_type(stype) -+ this_cpu_write(bpf_cgroup_storage[stype], storage[stype]); -+} -+ -+struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(struct bpf_prog *prog, -+ enum bpf_cgroup_storage_type stype); -+void bpf_cgroup_storage_free(struct bpf_cgroup_storage *storage); -+void bpf_cgroup_storage_link(struct bpf_cgroup_storage *storage, -+ struct cgroup *cgroup, -+ enum bpf_attach_type type); -+void bpf_cgroup_storage_unlink(struct bpf_cgroup_storage *storage); -+int bpf_cgroup_storage_assign(struct bpf_prog *prog, struct bpf_map *map); -+void bpf_cgroup_storage_release(struct bpf_prog *prog, struct bpf_map *map); -+ -+int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, void *value); -+int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key, -+ void *value, u64 flags); -+ -+/* Wrappers for __cgroup_bpf_run_filter_skb() guarded by cgroup_bpf_enabled. */ -+#define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk, skb) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled) \ -+ __ret = __cgroup_bpf_run_filter_skb(sk, skb, \ -+ BPF_CGROUP_INET_INGRESS); \ -+ \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled && sk && sk == skb->sk) { \ -+ typeof(sk) __sk = sk_to_full_sk(sk); \ -+ if (sk_fullsock(__sk)) \ -+ __ret = __cgroup_bpf_run_filter_skb(__sk, skb, \ -+ BPF_CGROUP_INET_EGRESS); \ -+ } \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_RUN_SK_PROG(sk, type) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled) { \ -+ __ret = __cgroup_bpf_run_filter_sk(sk, type); \ -+ } \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_RUN_PROG_INET_SOCK(sk) \ -+ BPF_CGROUP_RUN_SK_PROG(sk, BPF_CGROUP_INET_SOCK_CREATE) -+ -+#define BPF_CGROUP_RUN_PROG_INET4_POST_BIND(sk) \ -+ BPF_CGROUP_RUN_SK_PROG(sk, BPF_CGROUP_INET4_POST_BIND) -+ -+#define BPF_CGROUP_RUN_PROG_INET6_POST_BIND(sk) \ -+ BPF_CGROUP_RUN_SK_PROG(sk, BPF_CGROUP_INET6_POST_BIND) -+ -+#define BPF_CGROUP_RUN_SA_PROG(sk, uaddr, type) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled) \ -+ __ret = __cgroup_bpf_run_filter_sock_addr(sk, uaddr, type, \ -+ NULL); \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, type, t_ctx) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled) { \ -+ lock_sock(sk); \ -+ __ret = __cgroup_bpf_run_filter_sock_addr(sk, uaddr, type, \ -+ t_ctx); \ -+ release_sock(sk); \ -+ } \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_RUN_PROG_INET4_BIND(sk, uaddr) \ -+ BPF_CGROUP_RUN_SA_PROG(sk, uaddr, BPF_CGROUP_INET4_BIND) -+ -+#define BPF_CGROUP_RUN_PROG_INET6_BIND(sk, uaddr) \ -+ BPF_CGROUP_RUN_SA_PROG(sk, uaddr, BPF_CGROUP_INET6_BIND) -+ -+#define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (cgroup_bpf_enabled && \ -+ sk->sk_prot->pre_connect) -+ -+#define BPF_CGROUP_RUN_PROG_INET4_CONNECT(sk, uaddr) \ -+ BPF_CGROUP_RUN_SA_PROG(sk, uaddr, BPF_CGROUP_INET4_CONNECT) -+ -+#define BPF_CGROUP_RUN_PROG_INET6_CONNECT(sk, uaddr) \ -+ BPF_CGROUP_RUN_SA_PROG(sk, uaddr, BPF_CGROUP_INET6_CONNECT) -+ -+#define BPF_CGROUP_RUN_PROG_INET4_CONNECT_LOCK(sk, uaddr) \ -+ BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, BPF_CGROUP_INET4_CONNECT, NULL) -+ -+#define BPF_CGROUP_RUN_PROG_INET6_CONNECT_LOCK(sk, uaddr) \ -+ BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, BPF_CGROUP_INET6_CONNECT, NULL) -+ -+#define BPF_CGROUP_RUN_PROG_UDP4_SENDMSG_LOCK(sk, uaddr, t_ctx) \ -+ BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, BPF_CGROUP_UDP4_SENDMSG, t_ctx) -+ -+#define BPF_CGROUP_RUN_PROG_UDP6_SENDMSG_LOCK(sk, uaddr, t_ctx) \ -+ BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, BPF_CGROUP_UDP6_SENDMSG, t_ctx) -+ -+#define BPF_CGROUP_RUN_PROG_UDP4_RECVMSG_LOCK(sk, uaddr) \ -+ BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, BPF_CGROUP_UDP4_RECVMSG, NULL) -+ -+#define BPF_CGROUP_RUN_PROG_UDP6_RECVMSG_LOCK(sk, uaddr) \ -+ BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, BPF_CGROUP_UDP6_RECVMSG, NULL) -+ -+#define BPF_CGROUP_RUN_PROG_SOCK_OPS(sock_ops) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled && (sock_ops)->sk) { \ -+ typeof(sk) __sk = sk_to_full_sk((sock_ops)->sk); \ -+ if (__sk && sk_fullsock(__sk)) \ -+ __ret = __cgroup_bpf_run_filter_sock_ops(__sk, \ -+ sock_ops, \ -+ BPF_CGROUP_SOCK_OPS); \ -+ } \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_RUN_PROG_DEVICE_CGROUP(type, major, minor, access) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled) \ -+ __ret = __cgroup_bpf_check_dev_permission(type, major, minor, \ -+ access, \ -+ BPF_CGROUP_DEVICE); \ -+ \ -+ __ret; \ -+}) -+ -+ -+#define BPF_CGROUP_RUN_PROG_SYSCTL(head, table, write, buf, count, pos, nbuf) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled) \ -+ __ret = __cgroup_bpf_run_filter_sysctl(head, table, write, \ -+ buf, count, pos, nbuf, \ -+ BPF_CGROUP_SYSCTL); \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_RUN_PROG_SETSOCKOPT(sock, level, optname, optval, optlen, \ -+ kernel_optval) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled) \ -+ __ret = __cgroup_bpf_run_filter_setsockopt(sock, level, \ -+ optname, optval, \ -+ optlen, \ -+ kernel_optval); \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_GETSOCKOPT_MAX_OPTLEN(optlen) \ -+({ \ -+ int __ret = 0; \ -+ if (cgroup_bpf_enabled) \ -+ get_user(__ret, optlen); \ -+ __ret; \ -+}) -+ -+#define BPF_CGROUP_RUN_PROG_GETSOCKOPT(sock, level, optname, optval, optlen, \ -+ max_optlen, retval) \ -+({ \ -+ int __ret = retval; \ -+ if (cgroup_bpf_enabled) \ -+ __ret = __cgroup_bpf_run_filter_getsockopt(sock, level, \ -+ optname, optval, \ -+ optlen, max_optlen, \ -+ retval); \ -+ __ret; \ -+}) -+ -+int cgroup_bpf_prog_attach(const union bpf_attr *attr, -+ enum bpf_prog_type ptype, struct bpf_prog *prog); -+int cgroup_bpf_prog_detach(const union bpf_attr *attr, -+ enum bpf_prog_type ptype); -+int cgroup_bpf_prog_query(const union bpf_attr *attr, -+ union bpf_attr __user *uattr); -+#else -+ -+struct bpf_prog; -+struct cgroup_bpf {}; -+static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; } -+static inline void cgroup_bpf_offline(struct cgroup *cgrp) {} -+ -+static inline int cgroup_bpf_prog_attach(const union bpf_attr *attr, -+ enum bpf_prog_type ptype, -+ struct bpf_prog *prog) -+{ -+ return -EINVAL; -+} -+ -+static inline int cgroup_bpf_prog_detach(const union bpf_attr *attr, -+ enum bpf_prog_type ptype) -+{ -+ return -EINVAL; -+} -+ -+static inline int cgroup_bpf_prog_query(const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ return -EINVAL; -+} -+ -+static inline void bpf_cgroup_storage_set( -+ struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE]) {} -+static inline int bpf_cgroup_storage_assign(struct bpf_prog *prog, -+ struct bpf_map *map) { return 0; } -+static inline void bpf_cgroup_storage_release(struct bpf_prog *prog, -+ struct bpf_map *map) {} -+static inline struct bpf_cgroup_storage *bpf_cgroup_storage_alloc( -+ struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return NULL; } -+static inline void bpf_cgroup_storage_free( -+ struct bpf_cgroup_storage *storage) {} -+static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, -+ void *value) { -+ return 0; -+} -+static inline int bpf_percpu_cgroup_storage_update(struct bpf_map *map, -+ void *key, void *value, u64 flags) { -+ return 0; -+} -+ -+#define cgroup_bpf_enabled (0) -+#define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0) -+#define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET_EGRESS(sk,skb) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET_SOCK(sk) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET4_BIND(sk, uaddr) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET6_BIND(sk, uaddr) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET4_POST_BIND(sk) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET6_POST_BIND(sk) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET4_CONNECT(sk, uaddr) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET4_CONNECT_LOCK(sk, uaddr) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET6_CONNECT(sk, uaddr) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_INET6_CONNECT_LOCK(sk, uaddr) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_UDP4_SENDMSG_LOCK(sk, uaddr, t_ctx) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_UDP6_SENDMSG_LOCK(sk, uaddr, t_ctx) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_UDP4_RECVMSG_LOCK(sk, uaddr) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_UDP6_RECVMSG_LOCK(sk, uaddr) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_SOCK_OPS(sock_ops) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_DEVICE_CGROUP(type,major,minor,access) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_SYSCTL(head,table,write,buf,count,pos,nbuf) ({ 0; }) -+#define BPF_CGROUP_GETSOCKOPT_MAX_OPTLEN(optlen) ({ 0; }) -+#define BPF_CGROUP_RUN_PROG_GETSOCKOPT(sock, level, optname, optval, \ -+ optlen, max_optlen, retval) ({ retval; }) -+#define BPF_CGROUP_RUN_PROG_SETSOCKOPT(sock, level, optname, optval, optlen, \ -+ kernel_optval) ({ 0; }) -+ -+#define for_each_cgroup_storage_type(stype) for (; false; ) -+ -+#endif /* CONFIG_CGROUP_BPF */ -+ -+#endif /* _BPF_CGROUP_H */ ---- a/include/linux/bpf.h -+++ b/include/linux/bpf.h -@@ -1,55 +1,183 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ - /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of version 2 of the GNU General Public -- * License as published by the Free Software Foundation. - */ - #ifndef _LINUX_BPF_H - #define _LINUX_BPF_H 1 - - #include -+ - #include - #include -+#include -+#include -+#include -+#include -+#include -+#include - -+struct bpf_verifier_env; -+struct perf_event; -+struct bpf_prog; - struct bpf_map; -+struct sock; -+struct seq_file; -+struct btf; -+struct btf_type; -+ -+extern struct idr btf_idr; -+extern spinlock_t btf_idr_lock; - - /* map is generic key/value storage optionally accesible by eBPF programs */ - struct bpf_map_ops { - /* funcs callable from userspace (via syscall) */ -+ int (*map_alloc_check)(union bpf_attr *attr); - struct bpf_map *(*map_alloc)(union bpf_attr *attr); -- void (*map_free)(struct bpf_map *); -+ void (*map_release)(struct bpf_map *map, struct file *map_file); -+ void (*map_free)(struct bpf_map *map); - int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key); -+ void (*map_release_uref)(struct bpf_map *map); -+ void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key); - - /* funcs callable from userspace and from eBPF programs */ - void *(*map_lookup_elem)(struct bpf_map *map, void *key); - int (*map_update_elem)(struct bpf_map *map, void *key, void *value, u64 flags); - int (*map_delete_elem)(struct bpf_map *map, void *key); -+ int (*map_push_elem)(struct bpf_map *map, void *value, u64 flags); -+ int (*map_pop_elem)(struct bpf_map *map, void *value); -+ int (*map_peek_elem)(struct bpf_map *map, void *value); - - /* funcs called by prog_array and perf_event_array map */ -- void *(*map_fd_get_ptr) (struct bpf_map *map, int fd); -- void (*map_fd_put_ptr) (void *ptr); -+ void *(*map_fd_get_ptr)(struct bpf_map *map, struct file *map_file, -+ int fd); -+ void (*map_fd_put_ptr)(void *ptr); -+ u32 (*map_gen_lookup)(struct bpf_map *map, struct bpf_insn *insn_buf); -+ u32 (*map_fd_sys_lookup_elem)(void *ptr); -+ void (*map_seq_show_elem)(struct bpf_map *map, void *key, -+ struct seq_file *m); -+ int (*map_check_btf)(const struct bpf_map *map, -+ const struct btf *btf, -+ const struct btf_type *key_type, -+ const struct btf_type *value_type); -+ -+ /* Direct value access helpers. */ -+ int (*map_direct_value_addr)(const struct bpf_map *map, -+ u64 *imm, u32 off); -+ int (*map_direct_value_meta)(const struct bpf_map *map, -+ u64 imm, u32 *off); -+}; -+ -+struct bpf_map_memory { -+ u32 pages; -+ struct user_struct *user; - }; - - struct bpf_map { -- atomic_t refcnt; -+ /* The first two cachelines with read-mostly members of which some -+ * are also accessed in fast-path (e.g. ops, max_entries). -+ */ -+ const struct bpf_map_ops *ops ____cacheline_aligned; -+ struct bpf_map *inner_map_meta; -+#ifdef CONFIG_SECURITY -+ void *security; -+#endif - enum bpf_map_type map_type; - u32 key_size; - u32 value_size; - u32 max_entries; -- u32 pages; -+ u32 map_flags; -+ int spin_lock_off; /* >=0 valid offset, <0 error */ -+ u32 id; -+ int numa_node; -+ u32 btf_key_type_id; -+ u32 btf_value_type_id; -+ struct btf *btf; -+ struct bpf_map_memory memory; - bool unpriv_array; -- struct user_struct *user; -- const struct bpf_map_ops *ops; -- struct work_struct work; -+ bool frozen; /* write-once */ -+ /* 48 bytes hole */ -+ -+ /* The 3rd and 4th cacheline with misc members to avoid false sharing -+ * particularly with refcounting. -+ */ -+ atomic_t refcnt ____cacheline_aligned; - atomic_t usercnt; -+ struct work_struct work; -+ char name[BPF_OBJ_NAME_LEN]; - }; - --struct bpf_map_type_list { -- struct list_head list_node; -- const struct bpf_map_ops *ops; -- enum bpf_map_type type; -+static inline bool map_value_has_spin_lock(const struct bpf_map *map) -+{ -+ return map->spin_lock_off >= 0; -+} -+ -+static inline void check_and_init_map_lock(struct bpf_map *map, void *dst) -+{ -+ if (likely(!map_value_has_spin_lock(map))) -+ return; -+ *(struct bpf_spin_lock *)(dst + map->spin_lock_off) = -+ (struct bpf_spin_lock){}; -+} -+ -+/* copy everything but bpf_spin_lock */ -+static inline void copy_map_value(struct bpf_map *map, void *dst, void *src) -+{ -+ if (unlikely(map_value_has_spin_lock(map))) { -+ u32 off = map->spin_lock_off; -+ -+ memcpy(dst, src, off); -+ memcpy(dst + off + sizeof(struct bpf_spin_lock), -+ src + off + sizeof(struct bpf_spin_lock), -+ map->value_size - off - sizeof(struct bpf_spin_lock)); -+ } else { -+ memcpy(dst, src, map->value_size); -+ } -+} -+void copy_map_value_locked(struct bpf_map *map, void *dst, void *src, -+ bool lock_src); -+ -+struct bpf_offload_dev; -+struct bpf_offloaded_map; -+ -+struct bpf_map_dev_ops { -+ int (*map_get_next_key)(struct bpf_offloaded_map *map, -+ void *key, void *next_key); -+ int (*map_lookup_elem)(struct bpf_offloaded_map *map, -+ void *key, void *value); -+ int (*map_update_elem)(struct bpf_offloaded_map *map, -+ void *key, void *value, u64 flags); -+ int (*map_delete_elem)(struct bpf_offloaded_map *map, void *key); - }; - -+struct bpf_offloaded_map { -+ struct bpf_map map; -+ struct net_device *netdev; -+ const struct bpf_map_dev_ops *dev_ops; -+ void *dev_priv; -+ struct list_head offloads; -+}; -+ -+static inline struct bpf_offloaded_map *map_to_offmap(struct bpf_map *map) -+{ -+ return container_of(map, struct bpf_offloaded_map, map); -+} -+ -+static inline bool bpf_map_offload_neutral(const struct bpf_map *map) -+{ -+ return map->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY; -+} -+ -+static inline bool bpf_map_support_seq_show(const struct bpf_map *map) -+{ -+ return map->btf && map->ops->map_seq_show_elem; -+} -+ -+int map_check_no_btf(const struct bpf_map *map, -+ const struct btf *btf, -+ const struct btf_type *key_type, -+ const struct btf_type *value_type); -+ -+extern const struct bpf_map_ops bpf_map_offload_ops; -+ - /* function argument constraints */ - enum bpf_arg_type { - ARG_DONTCARE = 0, /* unused argument in helper function */ -@@ -60,22 +188,40 @@ enum bpf_arg_type { - ARG_CONST_MAP_PTR, /* const argument used as pointer to bpf_map */ - ARG_PTR_TO_MAP_KEY, /* pointer to stack used as map key */ - ARG_PTR_TO_MAP_VALUE, /* pointer to stack used as map value */ -+ ARG_PTR_TO_UNINIT_MAP_VALUE, /* pointer to valid memory used to store a map value */ -+ ARG_PTR_TO_MAP_VALUE_OR_NULL, /* pointer to stack used as map value or NULL */ - - /* the following constraints used to prototype bpf_memcmp() and other - * functions that access data on eBPF program stack - */ -- ARG_PTR_TO_STACK, /* any pointer to eBPF program stack */ -- ARG_CONST_STACK_SIZE, /* number of bytes accessed from stack */ -+ ARG_PTR_TO_MEM, /* pointer to valid memory (stack, packet, map value) */ -+ ARG_PTR_TO_MEM_OR_NULL, /* pointer to valid memory or NULL */ -+ ARG_PTR_TO_UNINIT_MEM, /* pointer to memory does not need to be initialized, -+ * helper function must fill all bytes or clear -+ * them in error case. -+ */ -+ -+ ARG_CONST_SIZE, /* number of bytes accessed from memory */ -+ ARG_CONST_SIZE_OR_ZERO, /* number of bytes accessed from memory or 0 */ - - ARG_PTR_TO_CTX, /* pointer to context */ - ARG_ANYTHING, /* any (initialized) argument is ok */ -+ ARG_PTR_TO_SPIN_LOCK, /* pointer to bpf_spin_lock */ -+ ARG_PTR_TO_SOCK_COMMON, /* pointer to sock_common */ -+ ARG_PTR_TO_INT, /* pointer to int */ -+ ARG_PTR_TO_LONG, /* pointer to long */ -+ ARG_PTR_TO_SOCKET, /* pointer to bpf_sock (fullsock) */ - }; - - /* type of values returned from helper functions */ - enum bpf_return_type { - RET_INTEGER, /* function returns integer */ - RET_VOID, /* function doesn't return anything */ -+ RET_PTR_TO_MAP_VALUE, /* returns a pointer to map elem value */ - RET_PTR_TO_MAP_VALUE_OR_NULL, /* returns a pointer to map elem value or NULL */ -+ RET_PTR_TO_SOCKET_OR_NULL, /* returns a pointer to a socket or NULL */ -+ RET_PTR_TO_TCP_SOCK_OR_NULL, /* returns a pointer to a tcp_sock or NULL */ -+ RET_PTR_TO_SOCK_COMMON_OR_NULL, /* returns a pointer to a sock_common or NULL */ - }; - - /* eBPF function prototype used by verifier to allow BPF_CALLs from eBPF programs -@@ -85,6 +231,7 @@ enum bpf_return_type { - struct bpf_func_proto { - u64 (*func)(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5); - bool gpl_only; -+ bool pkt_access; - enum bpf_return_type ret_type; - enum bpf_arg_type arg1_type; - enum bpf_arg_type arg2_type; -@@ -104,35 +251,172 @@ enum bpf_access_type { - BPF_WRITE = 2 - }; - --struct bpf_prog; -+/* types of values stored in eBPF registers */ -+/* Pointer types represent: -+ * pointer -+ * pointer + imm -+ * pointer + (u16) var -+ * pointer + (u16) var + imm -+ * if (range > 0) then [ptr, ptr + range - off) is safe to access -+ * if (id > 0) means that some 'var' was added -+ * if (off > 0) means that 'imm' was added -+ */ -+enum bpf_reg_type { -+ NOT_INIT = 0, /* nothing was written into register */ -+ SCALAR_VALUE, /* reg doesn't contain a valid pointer */ -+ PTR_TO_CTX, /* reg points to bpf_context */ -+ CONST_PTR_TO_MAP, /* reg points to struct bpf_map */ -+ PTR_TO_MAP_VALUE, /* reg points to map element value */ -+ PTR_TO_MAP_VALUE_OR_NULL,/* points to map elem value or NULL */ -+ PTR_TO_STACK, /* reg == frame_pointer + offset */ -+ PTR_TO_PACKET_META, /* skb->data - meta_len */ -+ PTR_TO_PACKET, /* reg points to skb->data */ -+ PTR_TO_PACKET_END, /* skb->data + headlen */ -+ PTR_TO_FLOW_KEYS, /* reg points to bpf_flow_keys */ -+ PTR_TO_SOCKET, /* reg points to struct bpf_sock */ -+ PTR_TO_SOCKET_OR_NULL, /* reg points to struct bpf_sock or NULL */ -+ PTR_TO_SOCK_COMMON, /* reg points to sock_common */ -+ PTR_TO_SOCK_COMMON_OR_NULL, /* reg points to sock_common or NULL */ -+ PTR_TO_TCP_SOCK, /* reg points to struct tcp_sock */ -+ PTR_TO_TCP_SOCK_OR_NULL, /* reg points to struct tcp_sock or NULL */ -+ PTR_TO_TP_BUFFER, /* reg points to a writable raw tp's buffer */ -+ PTR_TO_XDP_SOCK, /* reg points to struct xdp_sock */ -+}; -+ -+/* The information passed from prog-specific *_is_valid_access -+ * back to the verifier. -+ */ -+struct bpf_insn_access_aux { -+ enum bpf_reg_type reg_type; -+ int ctx_field_size; -+}; -+ -+static inline void -+bpf_ctx_record_field_size(struct bpf_insn_access_aux *aux, u32 size) -+{ -+ aux->ctx_field_size = size; -+} -+ -+struct bpf_prog_ops { -+ int (*test_run)(struct bpf_prog *prog, const union bpf_attr *kattr, -+ union bpf_attr __user *uattr); -+}; - - struct bpf_verifier_ops { - /* return eBPF function prototype for verification */ -- const struct bpf_func_proto *(*get_func_proto)(enum bpf_func_id func_id); -+ const struct bpf_func_proto * -+ (*get_func_proto)(enum bpf_func_id func_id, -+ const struct bpf_prog *prog); - - /* return true if 'size' wide access at offset 'off' within bpf_context - * with 'type' (read or write) is allowed - */ -- bool (*is_valid_access)(int off, int size, enum bpf_access_type type); -+ bool (*is_valid_access)(int off, int size, enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info); -+ int (*gen_prologue)(struct bpf_insn *insn, bool direct_write, -+ const struct bpf_prog *prog); -+ int (*gen_ld_abs)(const struct bpf_insn *orig, -+ struct bpf_insn *insn_buf); -+ u32 (*convert_ctx_access)(enum bpf_access_type type, -+ const struct bpf_insn *src, -+ struct bpf_insn *dst, -+ struct bpf_prog *prog, u32 *target_size); -+}; - -- u32 (*convert_ctx_access)(enum bpf_access_type type, int dst_reg, -- int src_reg, int ctx_off, -- struct bpf_insn *insn, struct bpf_prog *prog); -+struct bpf_prog_offload_ops { -+ /* verifier basic callbacks */ -+ int (*insn_hook)(struct bpf_verifier_env *env, -+ int insn_idx, int prev_insn_idx); -+ int (*finalize)(struct bpf_verifier_env *env); -+ /* verifier optimization callbacks (called after .finalize) */ -+ int (*replace_insn)(struct bpf_verifier_env *env, u32 off, -+ struct bpf_insn *insn); -+ int (*remove_insns)(struct bpf_verifier_env *env, u32 off, u32 cnt); -+ /* program management callbacks */ -+ int (*prepare)(struct bpf_prog *prog); -+ int (*translate)(struct bpf_prog *prog); -+ void (*destroy)(struct bpf_prog *prog); - }; - --struct bpf_prog_type_list { -- struct list_head list_node; -- const struct bpf_verifier_ops *ops; -- enum bpf_prog_type type; -+struct bpf_prog_offload { -+ struct bpf_prog *prog; -+ struct net_device *netdev; -+ struct bpf_offload_dev *offdev; -+ void *dev_priv; -+ struct list_head offloads; -+ bool dev_state; -+ bool opt_failed; -+ void *jited_image; -+ u32 jited_len; -+}; -+ -+enum bpf_cgroup_storage_type { -+ BPF_CGROUP_STORAGE_SHARED, -+ BPF_CGROUP_STORAGE_PERCPU, -+ __BPF_CGROUP_STORAGE_MAX -+}; -+ -+#define MAX_BPF_CGROUP_STORAGE_TYPE __BPF_CGROUP_STORAGE_MAX -+ -+struct bpf_prog_stats { -+ u64 cnt; -+ u64 nsecs; -+ struct u64_stats_sync syncp; - }; - - struct bpf_prog_aux { - atomic_t refcnt; - u32 used_map_cnt; -- const struct bpf_verifier_ops *ops; -+ u32 max_ctx_offset; -+ u32 max_pkt_offset; -+ u32 max_tp_access; -+ u32 stack_depth; -+ u32 id; -+ u32 func_cnt; /* used by non-func prog as the number of func progs */ -+ u32 func_idx; /* 0 for non-func prog, the index in func array for func prog */ -+ bool verifier_zext; /* Zero extensions has been inserted by verifier. */ -+ bool offload_requested; -+ struct bpf_prog **func; -+ void *jit_data; /* JIT specific data. arch dependent */ -+ struct latch_tree_node ksym_tnode; -+ struct list_head ksym_lnode; -+ const struct bpf_prog_ops *ops; - struct bpf_map **used_maps; - struct bpf_prog *prog; - struct user_struct *user; -+ u64 load_time; /* ns since boottime */ -+ struct bpf_map *cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE]; -+ char name[BPF_OBJ_NAME_LEN]; -+#ifdef CONFIG_SECURITY -+ void *security; -+#endif -+ struct bpf_prog_offload *offload; -+ struct btf *btf; -+ struct bpf_func_info *func_info; -+ /* bpf_line_info loaded from userspace. linfo->insn_off -+ * has the xlated insn offset. -+ * Both the main and sub prog share the same linfo. -+ * The subprog can access its first linfo by -+ * using the linfo_idx. -+ */ -+ struct bpf_line_info *linfo; -+ /* jited_linfo is the jited addr of the linfo. It has a -+ * one to one mapping to linfo: -+ * jited_linfo[i] is the jited addr for the linfo[i]->insn_off. -+ * Both the main and sub prog share the same jited_linfo. -+ * The subprog can access its first jited_linfo by -+ * using the linfo_idx. -+ */ -+ void **jited_linfo; -+ u32 func_info_cnt; -+ u32 nr_linfo; -+ /* subprog can use linfo_idx to access its first linfo and -+ * jited_linfo. -+ * main prog always has linfo_idx == 0 -+ */ -+ u32 linfo_idx; -+ struct bpf_prog_stats __percpu *stats; - union { - struct work_struct work; - struct rcu_head rcu; -@@ -153,76 +437,688 @@ struct bpf_array { - union { - char value[0] __aligned(8); - void *ptrs[0] __aligned(8); -+ void __percpu *pptrs[0] __aligned(8); - }; - }; -+ -+#define BPF_COMPLEXITY_LIMIT_INSNS 1000000 /* yes. 1M insns */ - #define MAX_TAIL_CALL_CNT 32 - --u64 bpf_tail_call(u64 ctx, u64 r2, u64 index, u64 r4, u64 r5); --void bpf_fd_array_map_clear(struct bpf_map *map); -+#define BPF_F_ACCESS_MASK (BPF_F_RDONLY | \ -+ BPF_F_RDONLY_PROG | \ -+ BPF_F_WRONLY | \ -+ BPF_F_WRONLY_PROG) -+ -+#define BPF_MAP_CAN_READ BIT(0) -+#define BPF_MAP_CAN_WRITE BIT(1) -+ -+static inline u32 bpf_map_flags_to_cap(struct bpf_map *map) -+{ -+ u32 access_flags = map->map_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG); -+ -+ /* Combination of BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG is -+ * not possible. -+ */ -+ if (access_flags & BPF_F_RDONLY_PROG) -+ return BPF_MAP_CAN_READ; -+ else if (access_flags & BPF_F_WRONLY_PROG) -+ return BPF_MAP_CAN_WRITE; -+ else -+ return BPF_MAP_CAN_READ | BPF_MAP_CAN_WRITE; -+} -+ -+static inline bool bpf_map_flags_access_ok(u32 access_flags) -+{ -+ return (access_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG)) != -+ (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG); -+} -+ -+struct bpf_event_entry { -+ struct perf_event *event; -+ struct file *perf_file; -+ struct file *map_file; -+ struct rcu_head rcu; -+}; -+ - bool bpf_prog_array_compatible(struct bpf_array *array, const struct bpf_prog *fp); -+int bpf_prog_calc_tag(struct bpf_prog *fp); -+ - const struct bpf_func_proto *bpf_get_trace_printk_proto(void); - -+typedef unsigned long (*bpf_ctx_copy_t)(void *dst, const void *src, -+ unsigned long off, unsigned long len); -+typedef u32 (*bpf_convert_ctx_access_t)(enum bpf_access_type type, -+ const struct bpf_insn *src, -+ struct bpf_insn *dst, -+ struct bpf_prog *prog, -+ u32 *target_size); -+ -+u64 bpf_event_output(struct bpf_map *map, u64 flags, void *meta, u64 meta_size, -+ void *ctx, u64 ctx_size, bpf_ctx_copy_t ctx_copy); -+ -+/* an array of programs to be executed under rcu_lock. -+ * -+ * Typical usage: -+ * ret = BPF_PROG_RUN_ARRAY(&bpf_prog_array, ctx, BPF_PROG_RUN); -+ * -+ * the structure returned by bpf_prog_array_alloc() should be populated -+ * with program pointers and the last pointer must be NULL. -+ * The user has to keep refcnt on the program and make sure the program -+ * is removed from the array before bpf_prog_put(). -+ * The 'struct bpf_prog_array *' should only be replaced with xchg() -+ * since other cpus are walking the array of pointers in parallel. -+ */ -+struct bpf_prog_array_item { -+ struct bpf_prog *prog; -+ struct bpf_cgroup_storage *cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE]; -+}; -+ -+struct bpf_prog_array { -+ struct rcu_head rcu; -+ struct bpf_prog_array_item items[0]; -+}; -+ -+struct bpf_prog_array *bpf_prog_array_alloc(u32 prog_cnt, gfp_t flags); -+void bpf_prog_array_free(struct bpf_prog_array *progs); -+int bpf_prog_array_length(struct bpf_prog_array *progs); -+bool bpf_prog_array_is_empty(struct bpf_prog_array *array); -+int bpf_prog_array_copy_to_user(struct bpf_prog_array *progs, -+ __u32 __user *prog_ids, u32 cnt); -+ -+void bpf_prog_array_delete_safe(struct bpf_prog_array *progs, -+ struct bpf_prog *old_prog); -+int bpf_prog_array_copy_info(struct bpf_prog_array *array, -+ u32 *prog_ids, u32 request_cnt, -+ u32 *prog_cnt); -+int bpf_prog_array_copy(struct bpf_prog_array *old_array, -+ struct bpf_prog *exclude_prog, -+ struct bpf_prog *include_prog, -+ struct bpf_prog_array **new_array); -+ -+#define __BPF_PROG_RUN_ARRAY(array, ctx, func, check_non_null, set_cg_storage) \ -+ ({ \ -+ struct bpf_prog_array_item *_item; \ -+ struct bpf_prog *_prog; \ -+ struct bpf_prog_array *_array; \ -+ u32 _ret = 1; \ -+ preempt_disable(); \ -+ rcu_read_lock(); \ -+ _array = rcu_dereference(array); \ -+ if (unlikely(check_non_null && !_array))\ -+ goto _out; \ -+ _item = &_array->items[0]; \ -+ while ((_prog = READ_ONCE(_item->prog))) { \ -+ if (set_cg_storage) \ -+ bpf_cgroup_storage_set(_item->cgroup_storage); \ -+ _ret &= func(_prog, ctx); \ -+ _item++; \ -+ } \ -+_out: \ -+ rcu_read_unlock(); \ -+ preempt_enable(); \ -+ _ret; \ -+ }) -+ -+/* To be used by __cgroup_bpf_run_filter_skb for EGRESS BPF progs -+ * so BPF programs can request cwr for TCP packets. -+ * -+ * Current cgroup skb programs can only return 0 or 1 (0 to drop the -+ * packet. This macro changes the behavior so the low order bit -+ * indicates whether the packet should be dropped (0) or not (1) -+ * and the next bit is a congestion notification bit. This could be -+ * used by TCP to call tcp_enter_cwr() -+ * -+ * Hence, new allowed return values of CGROUP EGRESS BPF programs are: -+ * 0: drop packet -+ * 1: keep packet -+ * 2: drop packet and cn -+ * 3: keep packet and cn -+ * -+ * This macro then converts it to one of the NET_XMIT or an error -+ * code that is then interpreted as drop packet (and no cn): -+ * 0: NET_XMIT_SUCCESS skb should be transmitted -+ * 1: NET_XMIT_DROP skb should be dropped and cn -+ * 2: NET_XMIT_CN skb should be transmitted and cn -+ * 3: -EPERM skb should be dropped -+ */ -+#define BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY(array, ctx, func) \ -+ ({ \ -+ struct bpf_prog_array_item *_item; \ -+ struct bpf_prog *_prog; \ -+ struct bpf_prog_array *_array; \ -+ u32 ret; \ -+ u32 _ret = 1; \ -+ u32 _cn = 0; \ -+ preempt_disable(); \ -+ rcu_read_lock(); \ -+ _array = rcu_dereference(array); \ -+ _item = &_array->items[0]; \ -+ while ((_prog = READ_ONCE(_item->prog))) { \ -+ bpf_cgroup_storage_set(_item->cgroup_storage); \ -+ ret = func(_prog, ctx); \ -+ _ret &= (ret & 1); \ -+ _cn |= (ret & 2); \ -+ _item++; \ -+ } \ -+ rcu_read_unlock(); \ -+ preempt_enable(); \ -+ if (_ret) \ -+ _ret = (_cn ? NET_XMIT_CN : NET_XMIT_SUCCESS); \ -+ else \ -+ _ret = (_cn ? NET_XMIT_DROP : -EPERM); \ -+ _ret; \ -+ }) -+ -+#define BPF_PROG_RUN_ARRAY(array, ctx, func) \ -+ __BPF_PROG_RUN_ARRAY(array, ctx, func, false, true) -+ -+#define BPF_PROG_RUN_ARRAY_CHECK(array, ctx, func) \ -+ __BPF_PROG_RUN_ARRAY(array, ctx, func, true, false) -+ - #ifdef CONFIG_BPF_SYSCALL --void bpf_register_prog_type(struct bpf_prog_type_list *tl); --void bpf_register_map_type(struct bpf_map_type_list *tl); -+DECLARE_PER_CPU(int, bpf_prog_active); -+ -+extern const struct file_operations bpf_map_fops; -+extern const struct file_operations bpf_prog_fops; -+ -+#define BPF_PROG_TYPE(_id, _name) \ -+ extern const struct bpf_prog_ops _name ## _prog_ops; \ -+ extern const struct bpf_verifier_ops _name ## _verifier_ops; -+#define BPF_MAP_TYPE(_id, _ops) \ -+ extern const struct bpf_map_ops _ops; -+#include -+#undef BPF_PROG_TYPE -+#undef BPF_MAP_TYPE -+ -+extern const struct bpf_prog_ops bpf_offload_prog_ops; -+extern const struct bpf_verifier_ops tc_cls_act_analyzer_ops; -+extern const struct bpf_verifier_ops xdp_analyzer_ops; - - struct bpf_prog *bpf_prog_get(u32 ufd); --struct bpf_prog *bpf_prog_inc(struct bpf_prog *prog); -+struct bpf_prog *bpf_prog_get_type_dev(u32 ufd, enum bpf_prog_type type, -+ bool attach_drv); -+struct bpf_prog * __must_check bpf_prog_add(struct bpf_prog *prog, int i); -+void bpf_prog_sub(struct bpf_prog *prog, int i); -+struct bpf_prog * __must_check bpf_prog_inc(struct bpf_prog *prog); -+struct bpf_prog * __must_check bpf_prog_inc_not_zero(struct bpf_prog *prog); - void bpf_prog_put(struct bpf_prog *prog); --void bpf_prog_put_rcu(struct bpf_prog *prog); -+int __bpf_prog_charge(struct user_struct *user, u32 pages); -+void __bpf_prog_uncharge(struct user_struct *user, u32 pages); -+ -+void bpf_prog_free_id(struct bpf_prog *prog, bool do_idr_lock); -+void bpf_map_free_id(struct bpf_map *map, bool do_idr_lock); - - struct bpf_map *bpf_map_get_with_uref(u32 ufd); - struct bpf_map *__bpf_map_get(struct fd f); --struct bpf_map *bpf_map_inc(struct bpf_map *map, bool uref); -+struct bpf_map * __must_check bpf_map_inc(struct bpf_map *map, bool uref); -+struct bpf_map * __must_check bpf_map_inc_not_zero(struct bpf_map *map, -+ bool uref); - void bpf_map_put_with_uref(struct bpf_map *map); - void bpf_map_put(struct bpf_map *map); -+int bpf_map_charge_memlock(struct bpf_map *map, u32 pages); -+void bpf_map_uncharge_memlock(struct bpf_map *map, u32 pages); -+int bpf_map_charge_init(struct bpf_map_memory *mem, u64 size); -+void bpf_map_charge_finish(struct bpf_map_memory *mem); -+void bpf_map_charge_move(struct bpf_map_memory *dst, -+ struct bpf_map_memory *src); -+void *bpf_map_area_alloc(u64 size, int numa_node); -+void bpf_map_area_free(void *base); -+void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr); - - extern int sysctl_unprivileged_bpf_disabled; - --int bpf_map_new_fd(struct bpf_map *map); -+int bpf_map_new_fd(struct bpf_map *map, int flags); - int bpf_prog_new_fd(struct bpf_prog *prog); - - int bpf_obj_pin_user(u32 ufd, const char __user *pathname); --int bpf_obj_get_user(const char __user *pathname); -+int bpf_obj_get_user(const char __user *pathname, int flags); -+ -+int bpf_percpu_hash_copy(struct bpf_map *map, void *key, void *value); -+int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value); -+int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value, -+ u64 flags); -+int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value, -+ u64 flags); -+ -+int bpf_stackmap_copy(struct bpf_map *map, void *key, void *value); -+ -+int bpf_fd_array_map_update_elem(struct bpf_map *map, struct file *map_file, -+ void *key, void *value, u64 map_flags); -+int bpf_fd_array_map_lookup_elem(struct bpf_map *map, void *key, u32 *value); -+int bpf_fd_htab_map_update_elem(struct bpf_map *map, struct file *map_file, -+ void *key, void *value, u64 map_flags); -+int bpf_fd_htab_map_lookup_elem(struct bpf_map *map, void *key, u32 *value); -+ -+int bpf_get_file_flag(int flags); -+int bpf_check_uarg_tail_zero(void __user *uaddr, size_t expected_size, -+ size_t actual_size); -+ -+/* memcpy that is used with 8-byte aligned pointers, power-of-8 size and -+ * forced to use 'long' read/writes to try to atomically copy long counters. -+ * Best-effort only. No barriers here, since it _will_ race with concurrent -+ * updates from BPF programs. Called from bpf syscall and mostly used with -+ * size 8 or 16 bytes, so ask compiler to inline it. -+ */ -+static inline void bpf_long_memcpy(void *dst, const void *src, u32 size) -+{ -+ const long *lsrc = src; -+ long *ldst = dst; -+ -+ size /= sizeof(long); -+ while (size--) -+ *ldst++ = *lsrc++; -+} - - /* verify correctness of eBPF program */ --int bpf_check(struct bpf_prog **fp, union bpf_attr *attr); --#else --static inline void bpf_register_prog_type(struct bpf_prog_type_list *tl) -+int bpf_check(struct bpf_prog **fp, union bpf_attr *attr, -+ union bpf_attr __user *uattr); -+ -+#ifndef CONFIG_BPF_JIT_ALWAYS_ON -+void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth); -+#endif -+ -+/* Map specifics */ -+struct xdp_buff; -+struct sk_buff; -+ -+struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key); -+struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key); -+void __dev_map_flush(struct bpf_map *map); -+int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, -+ struct net_device *dev_rx); -+int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, -+ struct bpf_prog *xdp_prog); -+ -+struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key); -+void __cpu_map_flush(struct bpf_map *map); -+int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp, -+ struct net_device *dev_rx); -+ -+/* Return map's numa specified by userspace */ -+static inline int bpf_map_attr_numa_node(const union bpf_attr *attr) - { -+ return (attr->map_flags & BPF_F_NUMA_NODE) ? -+ attr->numa_node : NUMA_NO_NODE; - } - -+struct bpf_prog *bpf_prog_get_type_path(const char *name, enum bpf_prog_type type); -+int array_map_alloc_check(union bpf_attr *attr); -+ -+int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, -+ union bpf_attr __user *uattr); -+int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr, -+ union bpf_attr __user *uattr); -+int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog, -+ const union bpf_attr *kattr, -+ union bpf_attr __user *uattr); -+#else /* !CONFIG_BPF_SYSCALL */ - static inline struct bpf_prog *bpf_prog_get(u32 ufd) - { - return ERR_PTR(-EOPNOTSUPP); - } - -+static inline struct bpf_prog *bpf_prog_get_type_dev(u32 ufd, -+ enum bpf_prog_type type, -+ bool attach_drv) -+{ -+ return ERR_PTR(-EOPNOTSUPP); -+} -+ -+static inline struct bpf_prog * __must_check bpf_prog_add(struct bpf_prog *prog, -+ int i) -+{ -+ return ERR_PTR(-EOPNOTSUPP); -+} -+ -+static inline void bpf_prog_sub(struct bpf_prog *prog, int i) -+{ -+} -+ - static inline void bpf_prog_put(struct bpf_prog *prog) - { - } - --static inline void bpf_prog_put_rcu(struct bpf_prog *prog) -+static inline struct bpf_prog * __must_check bpf_prog_inc(struct bpf_prog *prog) -+{ -+ return ERR_PTR(-EOPNOTSUPP); -+} -+ -+static inline struct bpf_prog *__must_check -+bpf_prog_inc_not_zero(struct bpf_prog *prog) -+{ -+ return ERR_PTR(-EOPNOTSUPP); -+} -+ -+static inline int __bpf_prog_charge(struct user_struct *user, u32 pages) -+{ -+ return 0; -+} -+ -+static inline void __bpf_prog_uncharge(struct user_struct *user, u32 pages) -+{ -+} -+ -+static inline int bpf_obj_get_user(const char __user *pathname, int flags) -+{ -+ return -EOPNOTSUPP; -+} -+ -+static inline struct net_device *__dev_map_lookup_elem(struct bpf_map *map, -+ u32 key) -+{ -+ return NULL; -+} -+ -+static inline struct net_device *__dev_map_hash_lookup_elem(struct bpf_map *map, -+ u32 key) -+{ -+ return NULL; -+} -+ -+static inline void __dev_map_flush(struct bpf_map *map) -+{ -+} -+ -+struct xdp_buff; -+struct bpf_dtab_netdev; -+ -+static inline -+int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, -+ struct net_device *dev_rx) -+{ -+ return 0; -+} -+ -+struct sk_buff; -+ -+static inline int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, -+ struct sk_buff *skb, -+ struct bpf_prog *xdp_prog) -+{ -+ return 0; -+} -+ -+static inline -+struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key) -+{ -+ return NULL; -+} -+ -+static inline void __cpu_map_flush(struct bpf_map *map) -+{ -+} -+ -+static inline int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, -+ struct xdp_buff *xdp, -+ struct net_device *dev_rx) -+{ -+ return 0; -+} -+ -+static inline struct bpf_prog *bpf_prog_get_type_path(const char *name, -+ enum bpf_prog_type type) -+{ -+ return ERR_PTR(-EOPNOTSUPP); -+} -+ -+static inline int bpf_prog_test_run_xdp(struct bpf_prog *prog, -+ const union bpf_attr *kattr, -+ union bpf_attr __user *uattr) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int bpf_prog_test_run_skb(struct bpf_prog *prog, -+ const union bpf_attr *kattr, -+ union bpf_attr __user *uattr) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog, -+ const union bpf_attr *kattr, -+ union bpf_attr __user *uattr) -+{ -+ return -ENOTSUPP; -+} -+#endif /* CONFIG_BPF_SYSCALL */ -+ -+static inline struct bpf_prog *bpf_prog_get_type(u32 ufd, -+ enum bpf_prog_type type) -+{ -+ return bpf_prog_get_type_dev(ufd, type, false); -+} -+ -+bool bpf_prog_get_ok(struct bpf_prog *, enum bpf_prog_type *, bool); -+ -+#if defined(CONFIG_NET) && defined(CONFIG_BPF_SYSCALL) -+ -+static inline bool bpf_prog_is_dev_bound(const struct bpf_prog_aux *aux) -+{ -+ return aux->offload_requested; -+} -+ -+static inline bool bpf_map_is_dev_bound(struct bpf_map *map) -+{ -+ return false; -+} -+ -+#else -+static inline int bpf_prog_offload_init(struct bpf_prog *prog, -+ union bpf_attr *attr) -+{ -+ return -EOPNOTSUPP; -+} -+ -+static inline bool bpf_prog_is_dev_bound(struct bpf_prog_aux *aux) -+{ -+ return false; -+} -+ -+static inline bool bpf_map_is_dev_bound(struct bpf_map *map) -+{ -+ return false; -+} -+ -+#endif /* CONFIG_NET && CONFIG_BPF_SYSCALL */ -+ -+#if defined(CONFIG_BPF_STREAM_PARSER) -+int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog, -+ struct bpf_prog *old, u32 which); -+int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog); -+int sock_map_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype); -+#else -+static inline int sock_map_prog_update(struct bpf_map *map, -+ struct bpf_prog *prog, -+ struct bpf_prog *old, u32 which) - { -+ return -EOPNOTSUPP; -+} -+ -+static inline int sock_map_get_from_fd(const union bpf_attr *attr, -+ struct bpf_prog *prog) -+{ -+ return -EINVAL; -+} -+ -+static inline int sock_map_prog_detach(const union bpf_attr *attr, -+ enum bpf_prog_type ptype) -+{ -+ return -EOPNOTSUPP; -+} -+#endif -+ -+#if defined(CONFIG_XDP_SOCKETS) -+struct xdp_sock; -+struct xdp_sock *__xsk_map_lookup_elem(struct bpf_map *map, u32 key); -+int __xsk_map_redirect(struct bpf_map *map, struct xdp_buff *xdp, -+ struct xdp_sock *xs); -+void __xsk_map_flush(struct bpf_map *map); -+#else -+struct xdp_sock; -+static inline struct xdp_sock *__xsk_map_lookup_elem(struct bpf_map *map, -+ u32 key) -+{ -+ return NULL; -+} -+ -+static inline int __xsk_map_redirect(struct bpf_map *map, struct xdp_buff *xdp, -+ struct xdp_sock *xs) -+{ -+ return -EOPNOTSUPP; -+} -+ -+static inline void __xsk_map_flush(struct bpf_map *map) -+{ -+} -+#endif -+ -+#if defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL) -+void bpf_sk_reuseport_detach(struct sock *sk); -+int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key, -+ void *value); -+int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, void *key, -+ void *value, u64 map_flags); -+#else -+static inline void bpf_sk_reuseport_detach(struct sock *sk) -+{ -+} -+ -+#ifdef CONFIG_BPF_SYSCALL -+static inline int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, -+ void *key, void *value) -+{ -+ return -EOPNOTSUPP; -+} -+ -+static inline int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, -+ void *key, void *value, -+ u64 map_flags) -+{ -+ return -EOPNOTSUPP; - } - #endif /* CONFIG_BPF_SYSCALL */ -+#endif /* defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL) */ - - /* verifier prototypes for helper functions called from eBPF programs */ - extern const struct bpf_func_proto bpf_map_lookup_elem_proto; - extern const struct bpf_func_proto bpf_map_update_elem_proto; - extern const struct bpf_func_proto bpf_map_delete_elem_proto; -+extern const struct bpf_func_proto bpf_map_push_elem_proto; -+extern const struct bpf_func_proto bpf_map_pop_elem_proto; -+extern const struct bpf_func_proto bpf_map_peek_elem_proto; - - extern const struct bpf_func_proto bpf_get_prandom_u32_proto; - extern const struct bpf_func_proto bpf_get_smp_processor_id_proto; -+extern const struct bpf_func_proto bpf_get_numa_node_id_proto; - extern const struct bpf_func_proto bpf_tail_call_proto; - extern const struct bpf_func_proto bpf_ktime_get_ns_proto; - extern const struct bpf_func_proto bpf_get_current_pid_tgid_proto; - extern const struct bpf_func_proto bpf_get_current_uid_gid_proto; - extern const struct bpf_func_proto bpf_get_current_comm_proto; --extern const struct bpf_func_proto bpf_skb_vlan_push_proto; --extern const struct bpf_func_proto bpf_skb_vlan_pop_proto; -+extern const struct bpf_func_proto bpf_get_stackid_proto; -+extern const struct bpf_func_proto bpf_get_stack_proto; -+extern const struct bpf_func_proto bpf_sock_map_update_proto; -+extern const struct bpf_func_proto bpf_sock_hash_update_proto; -+extern const struct bpf_func_proto bpf_get_current_cgroup_id_proto; -+extern const struct bpf_func_proto bpf_msg_redirect_hash_proto; -+extern const struct bpf_func_proto bpf_msg_redirect_map_proto; -+extern const struct bpf_func_proto bpf_sk_redirect_hash_proto; -+extern const struct bpf_func_proto bpf_sk_redirect_map_proto; -+extern const struct bpf_func_proto bpf_spin_lock_proto; -+extern const struct bpf_func_proto bpf_spin_unlock_proto; -+extern const struct bpf_func_proto bpf_get_local_storage_proto; -+extern const struct bpf_func_proto bpf_strtol_proto; -+extern const struct bpf_func_proto bpf_strtoul_proto; -+extern const struct bpf_func_proto bpf_tcp_sock_proto; - - /* Shared helpers among cBPF and eBPF. */ - void bpf_user_rnd_init_once(void); - u64 bpf_user_rnd_u32(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5); - -+#if defined(CONFIG_NET) -+bool bpf_sock_common_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ struct bpf_insn_access_aux *info); -+bool bpf_sock_is_valid_access(int off, int size, enum bpf_access_type type, -+ struct bpf_insn_access_aux *info); -+u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size); -+#else -+static inline bool bpf_sock_common_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+static inline bool bpf_sock_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+static inline u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size) -+{ -+ return 0; -+} -+#endif -+ -+#ifdef CONFIG_INET -+bool bpf_tcp_sock_is_valid_access(int off, int size, enum bpf_access_type type, -+ struct bpf_insn_access_aux *info); -+ -+u32 bpf_tcp_sock_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size); -+ -+bool bpf_xdp_sock_is_valid_access(int off, int size, enum bpf_access_type type, -+ struct bpf_insn_access_aux *info); -+ -+u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size); -+#else -+static inline bool bpf_tcp_sock_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+static inline u32 bpf_tcp_sock_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size) -+{ -+ return 0; -+} -+static inline bool bpf_xdp_sock_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+static inline u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size) -+{ -+ return 0; -+} -+#endif /* CONFIG_INET */ -+ - #endif /* _LINUX_BPF_H */ ---- /dev/null -+++ b/include/linux/bpf_trace.h -@@ -0,0 +1,7 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+#ifndef __LINUX_BPF_TRACE_H__ -+#define __LINUX_BPF_TRACE_H__ -+ -+#include -+ -+#endif /* __LINUX_BPF_TRACE_H__ */ ---- /dev/null -+++ b/include/linux/bpf_types.h -@@ -0,0 +1,44 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* internal file - do not include directly */ -+ -+#ifdef CONFIG_NET -+BPF_PROG_TYPE(BPF_PROG_TYPE_SOCKET_FILTER, sk_filter) -+BPF_PROG_TYPE(BPF_PROG_TYPE_SCHED_CLS, tc_cls_act) -+BPF_PROG_TYPE(BPF_PROG_TYPE_SCHED_ACT, tc_cls_act) -+BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_IN, lwt_in) -+BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_OUT, lwt_out) -+BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_XMIT, lwt_xmit) -+BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_SEG6LOCAL, lwt_seg6local) -+BPF_PROG_TYPE(BPF_PROG_TYPE_SOCK_OPS, sock_ops) -+BPF_PROG_TYPE(BPF_PROG_TYPE_SK_SKB, sk_skb) -+BPF_PROG_TYPE(BPF_PROG_TYPE_SK_MSG, sk_msg) -+BPF_PROG_TYPE(BPF_PROG_TYPE_FLOW_DISSECTOR, flow_dissector) -+#endif -+#ifdef CONFIG_BPF_EVENTS -+BPF_PROG_TYPE(BPF_PROG_TYPE_KPROBE, kprobe) -+BPF_PROG_TYPE(BPF_PROG_TYPE_TRACEPOINT, tracepoint) -+BPF_PROG_TYPE(BPF_PROG_TYPE_PERF_EVENT, perf_event) -+BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT, raw_tracepoint) -+BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, raw_tracepoint_writable) -+#endif -+ -+BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_PROG_ARRAY, prog_array_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_PERF_EVENT_ARRAY, perf_event_array_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_HASH, htab_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_HASH, htab_percpu_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_HASH, htab_lru_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_LRU_PERCPU_HASH, htab_lru_percpu_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_LPM_TRIE, trie_map_ops) -+#ifdef CONFIG_PERF_EVENTS -+BPF_MAP_TYPE(BPF_MAP_TYPE_STACK_TRACE, stack_trace_map_ops) -+#endif -+BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops) -+#ifdef CONFIG_NET -+BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops) -+#endif -+BPF_MAP_TYPE(BPF_MAP_TYPE_QUEUE, queue_map_ops) -+BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops) ---- /dev/null -+++ b/include/linux/bpf_verifier.h -@@ -0,0 +1,425 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -+ */ -+#ifndef _LINUX_BPF_VERIFIER_H -+#define _LINUX_BPF_VERIFIER_H 1 -+ -+#include /* for enum bpf_reg_type */ -+#include /* for MAX_BPF_STACK */ -+#include -+ -+/* Maximum variable offset umax_value permitted when resolving memory accesses. -+ * In practice this is far bigger than any realistic pointer offset; this limit -+ * ensures that umax_value + (int)off + (int)size cannot overflow a u64. -+ */ -+#define BPF_MAX_VAR_OFF (1 << 29) -+/* Maximum variable size permitted for ARG_CONST_SIZE[_OR_ZERO]. This ensures -+ * that converting umax_value to int cannot overflow. -+ */ -+#define BPF_MAX_VAR_SIZ (1 << 29) -+ -+/* Liveness marks, used for registers and spilled-regs (in stack slots). -+ * Read marks propagate upwards until they find a write mark; they record that -+ * "one of this state's descendants read this reg" (and therefore the reg is -+ * relevant for states_equal() checks). -+ * Write marks collect downwards and do not propagate; they record that "the -+ * straight-line code that reached this state (from its parent) wrote this reg" -+ * (and therefore that reads propagated from this state or its descendants -+ * should not propagate to its parent). -+ * A state with a write mark can receive read marks; it just won't propagate -+ * them to its parent, since the write mark is a property, not of the state, -+ * but of the link between it and its parent. See mark_reg_read() and -+ * mark_stack_slot_read() in kernel/bpf/verifier.c. -+ */ -+enum bpf_reg_liveness { -+ REG_LIVE_NONE = 0, /* reg hasn't been read or written this branch */ -+ REG_LIVE_READ32 = 0x1, /* reg was read, so we're sensitive to initial value */ -+ REG_LIVE_READ64 = 0x2, /* likewise, but full 64-bit content matters */ -+ REG_LIVE_READ = REG_LIVE_READ32 | REG_LIVE_READ64, -+ REG_LIVE_WRITTEN = 0x4, /* reg was written first, screening off later reads */ -+ REG_LIVE_DONE = 0x8, /* liveness won't be updating this register anymore */ -+}; -+ -+struct bpf_reg_state { -+ /* Ordering of fields matters. See states_equal() */ -+ enum bpf_reg_type type; -+ union { -+ /* valid when type == PTR_TO_PACKET */ -+ u16 range; -+ -+ /* valid when type == CONST_PTR_TO_MAP | PTR_TO_MAP_VALUE | -+ * PTR_TO_MAP_VALUE_OR_NULL -+ */ -+ struct bpf_map *map_ptr; -+ -+ /* Max size from any of the above. */ -+ unsigned long raw; -+ }; -+ /* Fixed part of pointer offset, pointer types only */ -+ s32 off; -+ /* For PTR_TO_PACKET, used to find other pointers with the same variable -+ * offset, so they can share range knowledge. -+ * For PTR_TO_MAP_VALUE_OR_NULL this is used to share which map value we -+ * came from, when one is tested for != NULL. -+ * For PTR_TO_SOCKET this is used to share which pointers retain the -+ * same reference to the socket, to determine proper reference freeing. -+ */ -+ u32 id; -+ /* PTR_TO_SOCKET and PTR_TO_TCP_SOCK could be a ptr returned -+ * from a pointer-cast helper, bpf_sk_fullsock() and -+ * bpf_tcp_sock(). -+ * -+ * Consider the following where "sk" is a reference counted -+ * pointer returned from "sk = bpf_sk_lookup_tcp();": -+ * -+ * 1: sk = bpf_sk_lookup_tcp(); -+ * 2: if (!sk) { return 0; } -+ * 3: fullsock = bpf_sk_fullsock(sk); -+ * 4: if (!fullsock) { bpf_sk_release(sk); return 0; } -+ * 5: tp = bpf_tcp_sock(fullsock); -+ * 6: if (!tp) { bpf_sk_release(sk); return 0; } -+ * 7: bpf_sk_release(sk); -+ * 8: snd_cwnd = tp->snd_cwnd; // verifier will complain -+ * -+ * After bpf_sk_release(sk) at line 7, both "fullsock" ptr and -+ * "tp" ptr should be invalidated also. In order to do that, -+ * the reg holding "fullsock" and "sk" need to remember -+ * the original refcounted ptr id (i.e. sk_reg->id) in ref_obj_id -+ * such that the verifier can reset all regs which have -+ * ref_obj_id matching the sk_reg->id. -+ * -+ * sk_reg->ref_obj_id is set to sk_reg->id at line 1. -+ * sk_reg->id will stay as NULL-marking purpose only. -+ * After NULL-marking is done, sk_reg->id can be reset to 0. -+ * -+ * After "fullsock = bpf_sk_fullsock(sk);" at line 3, -+ * fullsock_reg->ref_obj_id is set to sk_reg->ref_obj_id. -+ * -+ * After "tp = bpf_tcp_sock(fullsock);" at line 5, -+ * tp_reg->ref_obj_id is set to fullsock_reg->ref_obj_id -+ * which is the same as sk_reg->ref_obj_id. -+ * -+ * From the verifier perspective, if sk, fullsock and tp -+ * are not NULL, they are the same ptr with different -+ * reg->type. In particular, bpf_sk_release(tp) is also -+ * allowed and has the same effect as bpf_sk_release(sk). -+ */ -+ u32 ref_obj_id; -+ /* For scalar types (SCALAR_VALUE), this represents our knowledge of -+ * the actual value. -+ * For pointer types, this represents the variable part of the offset -+ * from the pointed-to object, and is shared with all bpf_reg_states -+ * with the same id as us. -+ */ -+ struct tnum var_off; -+ /* Used to determine if any memory access using this register will -+ * result in a bad access. -+ * These refer to the same value as var_off, not necessarily the actual -+ * contents of the register. -+ */ -+ s64 smin_value; /* minimum possible (s64)value */ -+ s64 smax_value; /* maximum possible (s64)value */ -+ u64 umin_value; /* minimum possible (u64)value */ -+ u64 umax_value; /* maximum possible (u64)value */ -+ /* parentage chain for liveness checking */ -+ struct bpf_reg_state *parent; -+ /* Inside the callee two registers can be both PTR_TO_STACK like -+ * R1=fp-8 and R2=fp-8, but one of them points to this function stack -+ * while another to the caller's stack. To differentiate them 'frameno' -+ * is used which is an index in bpf_verifier_state->frame[] array -+ * pointing to bpf_func_state. -+ */ -+ u32 frameno; -+ /* Tracks subreg definition. The stored value is the insn_idx of the -+ * writing insn. This is safe because subreg_def is used before any insn -+ * patching which only happens after main verification finished. -+ */ -+ s32 subreg_def; -+ enum bpf_reg_liveness live; -+ /* if (!precise && SCALAR_VALUE) min/max/tnum don't affect safety */ -+ bool precise; -+}; -+ -+enum bpf_stack_slot_type { -+ STACK_INVALID, /* nothing was stored in this stack slot */ -+ STACK_SPILL, /* register spilled into stack */ -+ STACK_MISC, /* BPF program wrote some data into this slot */ -+ STACK_ZERO, /* BPF program wrote constant zero */ -+}; -+ -+#define BPF_REG_SIZE 8 /* size of eBPF register in bytes */ -+ -+struct bpf_stack_state { -+ struct bpf_reg_state spilled_ptr; -+ u8 slot_type[BPF_REG_SIZE]; -+}; -+ -+struct bpf_reference_state { -+ /* Track each reference created with a unique id, even if the same -+ * instruction creates the reference multiple times (eg, via CALL). -+ */ -+ int id; -+ /* Instruction where the allocation of this reference occurred. This -+ * is used purely to inform the user of a reference leak. -+ */ -+ int insn_idx; -+}; -+ -+/* state of the program: -+ * type of all registers and stack info -+ */ -+struct bpf_func_state { -+ struct bpf_reg_state regs[MAX_BPF_REG]; -+ /* index of call instruction that called into this func */ -+ int callsite; -+ /* stack frame number of this function state from pov of -+ * enclosing bpf_verifier_state. -+ * 0 = main function, 1 = first callee. -+ */ -+ u32 frameno; -+ /* subprog number == index within subprog_stack_depth -+ * zero == main subprog -+ */ -+ u32 subprogno; -+ -+ /* The following fields should be last. See copy_func_state() */ -+ int acquired_refs; -+ struct bpf_reference_state *refs; -+ int allocated_stack; -+ struct bpf_stack_state *stack; -+}; -+ -+struct bpf_idx_pair { -+ u32 prev_idx; -+ u32 idx; -+}; -+ -+#define MAX_CALL_FRAMES 8 -+struct bpf_verifier_state { -+ /* call stack tracking */ -+ struct bpf_func_state *frame[MAX_CALL_FRAMES]; -+ struct bpf_verifier_state *parent; -+ /* -+ * 'branches' field is the number of branches left to explore: -+ * 0 - all possible paths from this state reached bpf_exit or -+ * were safely pruned -+ * 1 - at least one path is being explored. -+ * This state hasn't reached bpf_exit -+ * 2 - at least two paths are being explored. -+ * This state is an immediate parent of two children. -+ * One is fallthrough branch with branches==1 and another -+ * state is pushed into stack (to be explored later) also with -+ * branches==1. The parent of this state has branches==1. -+ * The verifier state tree connected via 'parent' pointer looks like: -+ * 1 -+ * 1 -+ * 2 -> 1 (first 'if' pushed into stack) -+ * 1 -+ * 2 -> 1 (second 'if' pushed into stack) -+ * 1 -+ * 1 -+ * 1 bpf_exit. -+ * -+ * Once do_check() reaches bpf_exit, it calls update_branch_counts() -+ * and the verifier state tree will look: -+ * 1 -+ * 1 -+ * 2 -> 1 (first 'if' pushed into stack) -+ * 1 -+ * 1 -> 1 (second 'if' pushed into stack) -+ * 0 -+ * 0 -+ * 0 bpf_exit. -+ * After pop_stack() the do_check() will resume at second 'if'. -+ * -+ * If is_state_visited() sees a state with branches > 0 it means -+ * there is a loop. If such state is exactly equal to the current state -+ * it's an infinite loop. Note states_equal() checks for states -+ * equvalency, so two states being 'states_equal' does not mean -+ * infinite loop. The exact comparison is provided by -+ * states_maybe_looping() function. It's a stronger pre-check and -+ * much faster than states_equal(). -+ * -+ * This algorithm may not find all possible infinite loops or -+ * loop iteration count may be too high. -+ * In such cases BPF_COMPLEXITY_LIMIT_INSNS limit kicks in. -+ */ -+ u32 branches; -+ u32 insn_idx; -+ u32 curframe; -+ u32 active_spin_lock; -+ bool speculative; -+ -+ /* first and last insn idx of this verifier state */ -+ u32 first_insn_idx; -+ u32 last_insn_idx; -+ /* jmp history recorded from first to last. -+ * backtracking is using it to go from last to first. -+ * For most states jmp_history_cnt is [0-3]. -+ * For loops can go up to ~40. -+ */ -+ struct bpf_idx_pair *jmp_history; -+ u32 jmp_history_cnt; -+}; -+ -+#define bpf_get_spilled_reg(slot, frame) \ -+ (((slot < frame->allocated_stack / BPF_REG_SIZE) && \ -+ (frame->stack[slot].slot_type[0] == STACK_SPILL)) \ -+ ? &frame->stack[slot].spilled_ptr : NULL) -+ -+/* Iterate over 'frame', setting 'reg' to either NULL or a spilled register. */ -+#define bpf_for_each_spilled_reg(iter, frame, reg) \ -+ for (iter = 0, reg = bpf_get_spilled_reg(iter, frame); \ -+ iter < frame->allocated_stack / BPF_REG_SIZE; \ -+ iter++, reg = bpf_get_spilled_reg(iter, frame)) -+ -+/* linked list of verifier states used to prune search */ -+struct bpf_verifier_state_list { -+ struct bpf_verifier_state state; -+ struct bpf_verifier_state_list *next; -+ int miss_cnt, hit_cnt; -+}; -+ -+/* Possible states for alu_state member. */ -+#define BPF_ALU_SANITIZE_SRC (1U << 0) -+#define BPF_ALU_SANITIZE_DST (1U << 1) -+#define BPF_ALU_NEG_VALUE (1U << 2) -+#define BPF_ALU_NON_POINTER (1U << 3) -+#define BPF_ALU_IMMEDIATE (1U << 4) -+#define BPF_ALU_SANITIZE (BPF_ALU_SANITIZE_SRC | \ -+ BPF_ALU_SANITIZE_DST) -+ -+struct bpf_insn_aux_data { -+ union { -+ enum bpf_reg_type ptr_type; /* pointer type for load/store insns */ -+ unsigned long map_state; /* pointer/poison value for maps */ -+ s32 call_imm; /* saved imm field of call insn */ -+ u32 alu_limit; /* limit for add/sub register with pointer */ -+ struct { -+ u32 map_index; /* index into used_maps[] */ -+ u32 map_off; /* offset from value base address */ -+ }; -+ }; -+ int ctx_field_size; /* the ctx field size for load insn, maybe 0 */ -+ int sanitize_stack_off; /* stack slot to be cleared */ -+ bool seen; /* this insn was processed by the verifier */ -+ bool zext_dst; /* this insn zero extends dst reg */ -+ u8 alu_state; /* used in combination with alu_limit */ -+ bool prune_point; -+ unsigned int orig_idx; /* original instruction index */ -+}; -+ -+#define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */ -+ -+#define BPF_VERIFIER_TMP_LOG_SIZE 1024 -+ -+struct bpf_verifier_log { -+ u32 level; -+ char kbuf[BPF_VERIFIER_TMP_LOG_SIZE]; -+ char __user *ubuf; -+ u32 len_used; -+ u32 len_total; -+}; -+ -+static inline bool bpf_verifier_log_full(const struct bpf_verifier_log *log) -+{ -+ return log->len_used >= log->len_total - 1; -+} -+ -+#define BPF_LOG_LEVEL1 1 -+#define BPF_LOG_LEVEL2 2 -+#define BPF_LOG_STATS 4 -+#define BPF_LOG_LEVEL (BPF_LOG_LEVEL1 | BPF_LOG_LEVEL2) -+#define BPF_LOG_MASK (BPF_LOG_LEVEL | BPF_LOG_STATS) -+ -+static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log) -+{ -+ return log->level && log->ubuf && !bpf_verifier_log_full(log); -+} -+ -+#define BPF_MAX_SUBPROGS 256 -+ -+struct bpf_subprog_info { -+ u32 start; /* insn idx of function entry point */ -+ u32 linfo_idx; /* The idx to the main_prog->aux->linfo */ -+ u16 stack_depth; /* max. stack depth used by this function */ -+ bool has_tail_call; -+}; -+ -+/* single container for all structs -+ * one verifier_env per bpf_check() call -+ */ -+struct bpf_verifier_env { -+ u32 insn_idx; -+ u32 prev_insn_idx; -+ struct bpf_prog *prog; /* eBPF program being verified */ -+ const struct bpf_verifier_ops *ops; -+ struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */ -+ int stack_size; /* number of states to be processed */ -+ bool strict_alignment; /* perform strict pointer alignment checks */ -+ bool test_state_freq; /* test verifier with different pruning frequency */ -+ struct bpf_verifier_state *cur_state; /* current verifier state */ -+ struct bpf_verifier_state_list **explored_states; /* search pruning optimization */ -+ struct bpf_verifier_state_list *free_list; -+ struct bpf_map *used_maps[MAX_USED_MAPS]; /* array of map's used by eBPF program */ -+ u32 used_map_cnt; /* number of used maps */ -+ u32 id_gen; /* used to generate unique reg IDs */ -+ bool allow_ptr_leaks; -+ bool seen_direct_write; -+ struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */ -+ const struct bpf_line_info *prev_linfo; -+ struct bpf_verifier_log log; -+ struct bpf_subprog_info subprog_info[BPF_MAX_SUBPROGS + 1]; -+ struct { -+ int *insn_state; -+ int *insn_stack; -+ int cur_stack; -+ } cfg; -+ u32 subprog_cnt; -+ /* number of instructions analyzed by the verifier */ -+ u32 prev_insn_processed, insn_processed; -+ /* number of jmps, calls, exits analyzed so far */ -+ u32 prev_jmps_processed, jmps_processed; -+ /* total verification time */ -+ u64 verification_time; -+ /* maximum number of verifier states kept in 'branching' instructions */ -+ u32 max_states_per_insn; -+ /* total number of allocated verifier states */ -+ u32 total_states; -+ /* some states are freed during program analysis. -+ * this is peak number of states. this number dominates kernel -+ * memory consumption during verification -+ */ -+ u32 peak_states; -+ /* longest register parentage chain walked for liveness marking */ -+ u32 longest_mark_read_walk; -+}; -+ -+__printf(2, 0) void bpf_verifier_vlog(struct bpf_verifier_log *log, -+ const char *fmt, va_list args); -+__printf(2, 3) void bpf_verifier_log_write(struct bpf_verifier_env *env, -+ const char *fmt, ...); -+ -+static inline struct bpf_func_state *cur_func(struct bpf_verifier_env *env) -+{ -+ struct bpf_verifier_state *cur = env->cur_state; -+ -+ return cur->frame[cur->curframe]; -+} -+ -+static inline struct bpf_reg_state *cur_regs(struct bpf_verifier_env *env) -+{ -+ return cur_func(env)->regs; -+} -+ -+int bpf_prog_offload_verifier_prep(struct bpf_prog *prog); -+int bpf_prog_offload_verify_insn(struct bpf_verifier_env *env, -+ int insn_idx, int prev_insn_idx); -+int bpf_prog_offload_finalize(struct bpf_verifier_env *env); -+void -+bpf_prog_offload_replace_insn(struct bpf_verifier_env *env, u32 off, -+ struct bpf_insn *insn); -+void -+bpf_prog_offload_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt); -+ -+#endif /* _LINUX_BPF_VERIFIER_H */ ---- /dev/null -+++ b/include/linux/btf.h -@@ -0,0 +1,72 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* Copyright (c) 2018 Facebook */ -+ -+#ifndef _LINUX_BTF_H -+#define _LINUX_BTF_H 1 -+ -+#include -+ -+struct btf; -+struct btf_member; -+struct btf_type; -+union bpf_attr; -+ -+extern const struct file_operations btf_fops; -+ -+void btf_put(struct btf *btf); -+int btf_new_fd(const union bpf_attr *attr); -+struct btf *btf_get_by_fd(int fd); -+int btf_get_info_by_fd(const struct btf *btf, -+ const union bpf_attr *attr, -+ union bpf_attr __user *uattr); -+/* Figure out the size of a type_id. If type_id is a modifier -+ * (e.g. const), it will be resolved to find out the type with size. -+ * -+ * For example: -+ * In describing "const void *", type_id is "const" and "const" -+ * refers to "void *". The return type will be "void *". -+ * -+ * If type_id is a simple "int", then return type will be "int". -+ * -+ * @btf: struct btf object -+ * @type_id: Find out the size of type_id. The type_id of the return -+ * type is set to *type_id. -+ * @ret_size: It can be NULL. If not NULL, the size of the return -+ * type is set to *ret_size. -+ * Return: The btf_type (resolved to another type with size info if needed). -+ * NULL is returned if type_id itself does not have size info -+ * (e.g. void) or it cannot be resolved to another type that -+ * has size info. -+ * *type_id and *ret_size will not be changed in the -+ * NULL return case. -+ */ -+const struct btf_type *btf_type_id_size(const struct btf *btf, -+ u32 *type_id, -+ u32 *ret_size); -+void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj, -+ struct seq_file *m); -+int btf_get_fd_by_id(u32 id); -+u32 btf_id(const struct btf *btf); -+bool btf_member_is_reg_int(const struct btf *btf, const struct btf_type *s, -+ const struct btf_member *m, -+ u32 expected_offset, u32 expected_size); -+int btf_find_spin_lock(const struct btf *btf, const struct btf_type *t); -+bool btf_type_is_void(const struct btf_type *t); -+ -+#ifdef CONFIG_BPF_SYSCALL -+const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id); -+const char *btf_name_by_offset(const struct btf *btf, u32 offset); -+#else -+static inline const struct btf_type *btf_type_by_id(const struct btf *btf, -+ u32 type_id) -+{ -+ return NULL; -+} -+static inline const char *btf_name_by_offset(const struct btf *btf, -+ u32 offset) -+{ -+ return NULL; -+} -+#endif -+ -+#endif ---- a/include/uapi/linux/bpf_common.h -+++ b/include/uapi/linux/bpf_common.h -@@ -1,3 +1,4 @@ -+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ - #ifndef _UAPI__LINUX_BPF_COMMON_H__ - #define _UAPI__LINUX_BPF_COMMON_H__ - -@@ -14,9 +15,10 @@ - - /* ld/ldx fields */ - #define BPF_SIZE(code) ((code) & 0x18) --#define BPF_W 0x00 --#define BPF_H 0x08 --#define BPF_B 0x10 -+#define BPF_W 0x00 /* 32-bit */ -+#define BPF_H 0x08 /* 16-bit */ -+#define BPF_B 0x10 /* 8-bit */ -+/* eBPF BPF_DW 0x18 64-bit */ - #define BPF_MODE(code) ((code) & 0xe0) - #define BPF_IMM 0x00 - #define BPF_ABS 0x20 ---- a/include/uapi/linux/bpf.h -+++ b/include/uapi/linux/bpf.h -@@ -1,3 +1,4 @@ -+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ - /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com - * - * This program is free software; you can redistribute it and/or -@@ -13,10 +14,11 @@ - /* Extended instruction set based on top of classic BPF */ - - /* instruction classes */ -+#define BPF_JMP32 0x06 /* jmp mode in word width */ - #define BPF_ALU64 0x07 /* alu mode in double word width */ - - /* ld/ldx fields */ --#define BPF_DW 0x18 /* double word */ -+#define BPF_DW 0x18 /* double word (64-bit) */ - #define BPF_XADD 0xc0 /* exclusive add */ - - /* alu/jmp fields */ -@@ -30,9 +32,14 @@ - #define BPF_FROM_LE BPF_TO_LE - #define BPF_FROM_BE BPF_TO_BE - -+/* jmp encodings */ - #define BPF_JNE 0x50 /* jump != */ -+#define BPF_JLT 0xa0 /* LT is unsigned, '<' */ -+#define BPF_JLE 0xb0 /* LE is unsigned, '<=' */ - #define BPF_JSGT 0x60 /* SGT is signed '>', GT in x86 */ - #define BPF_JSGE 0x70 /* SGE is signed '>=', GE in x86 */ -+#define BPF_JSLT 0xc0 /* SLT is signed, '<' */ -+#define BPF_JSLE 0xd0 /* SLE is signed, '<=' */ - #define BPF_CALL 0x80 /* function call */ - #define BPF_EXIT 0x90 /* function return */ - -@@ -63,6 +70,17 @@ struct bpf_insn { - __s32 imm; /* signed immediate constant */ - }; - -+/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */ -+struct bpf_lpm_trie_key { -+ __u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */ -+ __u8 data[0]; /* Arbitrary size */ -+}; -+ -+struct bpf_cgroup_storage_key { -+ __u64 cgroup_inode_id; /* cgroup inode id */ -+ __u32 attach_type; /* program attach type */ -+}; -+ - /* BPF syscall commands, see bpf(2) man-page for details. */ - enum bpf_cmd { - BPF_MAP_CREATE, -@@ -73,6 +91,22 @@ enum bpf_cmd { - BPF_PROG_LOAD, - BPF_OBJ_PIN, - BPF_OBJ_GET, -+ BPF_PROG_ATTACH, -+ BPF_PROG_DETACH, -+ BPF_PROG_TEST_RUN, -+ BPF_PROG_GET_NEXT_ID, -+ BPF_MAP_GET_NEXT_ID, -+ BPF_PROG_GET_FD_BY_ID, -+ BPF_MAP_GET_FD_BY_ID, -+ BPF_OBJ_GET_INFO_BY_FD, -+ BPF_PROG_QUERY, -+ BPF_RAW_TRACEPOINT_OPEN, -+ BPF_BTF_LOAD, -+ BPF_BTF_GET_FD_BY_ID, -+ BPF_TASK_FD_QUERY, -+ BPF_MAP_LOOKUP_AND_DELETE_ELEM, -+ BPF_MAP_FREEZE, -+ BPF_BTF_GET_NEXT_ID, - }; - - enum bpf_map_type { -@@ -81,22 +115,256 @@ enum bpf_map_type { - BPF_MAP_TYPE_ARRAY, - BPF_MAP_TYPE_PROG_ARRAY, - BPF_MAP_TYPE_PERF_EVENT_ARRAY, -+ BPF_MAP_TYPE_PERCPU_HASH, -+ BPF_MAP_TYPE_PERCPU_ARRAY, -+ BPF_MAP_TYPE_STACK_TRACE, -+ BPF_MAP_TYPE_CGROUP_ARRAY, -+ BPF_MAP_TYPE_LRU_HASH, -+ BPF_MAP_TYPE_LRU_PERCPU_HASH, -+ BPF_MAP_TYPE_LPM_TRIE, -+ BPF_MAP_TYPE_ARRAY_OF_MAPS, -+ BPF_MAP_TYPE_HASH_OF_MAPS, -+ BPF_MAP_TYPE_DEVMAP, -+ BPF_MAP_TYPE_SOCKMAP, -+ BPF_MAP_TYPE_CPUMAP, -+ BPF_MAP_TYPE_XSKMAP, -+ BPF_MAP_TYPE_SOCKHASH, -+ BPF_MAP_TYPE_CGROUP_STORAGE, -+ BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, -+ BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, -+ BPF_MAP_TYPE_QUEUE, -+ BPF_MAP_TYPE_STACK, -+ BPF_MAP_TYPE_SK_STORAGE, -+ BPF_MAP_TYPE_DEVMAP_HASH, - }; - -+/* Note that tracing related programs such as -+ * BPF_PROG_TYPE_{KPROBE,TRACEPOINT,PERF_EVENT,RAW_TRACEPOINT} -+ * are not subject to a stable API since kernel internal data -+ * structures can change from release to release and may -+ * therefore break existing tracing BPF programs. Tracing BPF -+ * programs correspond to /a/ specific kernel which is to be -+ * analyzed, and not /a/ specific kernel /and/ all future ones. -+ */ - enum bpf_prog_type { - BPF_PROG_TYPE_UNSPEC, - BPF_PROG_TYPE_SOCKET_FILTER, - BPF_PROG_TYPE_KPROBE, - BPF_PROG_TYPE_SCHED_CLS, - BPF_PROG_TYPE_SCHED_ACT, -+ BPF_PROG_TYPE_TRACEPOINT, -+ BPF_PROG_TYPE_XDP, -+ BPF_PROG_TYPE_PERF_EVENT, -+ BPF_PROG_TYPE_CGROUP_SKB, -+ BPF_PROG_TYPE_CGROUP_SOCK, -+ BPF_PROG_TYPE_LWT_IN, -+ BPF_PROG_TYPE_LWT_OUT, -+ BPF_PROG_TYPE_LWT_XMIT, -+ BPF_PROG_TYPE_SOCK_OPS, -+ BPF_PROG_TYPE_SK_SKB, -+ BPF_PROG_TYPE_CGROUP_DEVICE, -+ BPF_PROG_TYPE_SK_MSG, -+ BPF_PROG_TYPE_RAW_TRACEPOINT, -+ BPF_PROG_TYPE_CGROUP_SOCK_ADDR, -+ BPF_PROG_TYPE_LWT_SEG6LOCAL, -+ BPF_PROG_TYPE_LIRC_MODE2, -+ BPF_PROG_TYPE_SK_REUSEPORT, -+ BPF_PROG_TYPE_FLOW_DISSECTOR, -+ BPF_PROG_TYPE_CGROUP_SYSCTL, -+ BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, -+ BPF_PROG_TYPE_CGROUP_SOCKOPT, - }; - -+enum bpf_attach_type { -+ BPF_CGROUP_INET_INGRESS, -+ BPF_CGROUP_INET_EGRESS, -+ BPF_CGROUP_INET_SOCK_CREATE, -+ BPF_CGROUP_SOCK_OPS, -+ BPF_SK_SKB_STREAM_PARSER, -+ BPF_SK_SKB_STREAM_VERDICT, -+ BPF_CGROUP_DEVICE, -+ BPF_SK_MSG_VERDICT, -+ BPF_CGROUP_INET4_BIND, -+ BPF_CGROUP_INET6_BIND, -+ BPF_CGROUP_INET4_CONNECT, -+ BPF_CGROUP_INET6_CONNECT, -+ BPF_CGROUP_INET4_POST_BIND, -+ BPF_CGROUP_INET6_POST_BIND, -+ BPF_CGROUP_UDP4_SENDMSG, -+ BPF_CGROUP_UDP6_SENDMSG, -+ BPF_LIRC_MODE2, -+ BPF_FLOW_DISSECTOR, -+ BPF_CGROUP_SYSCTL, -+ BPF_CGROUP_UDP4_RECVMSG, -+ BPF_CGROUP_UDP6_RECVMSG, -+ BPF_CGROUP_GETSOCKOPT, -+ BPF_CGROUP_SETSOCKOPT, -+ __MAX_BPF_ATTACH_TYPE -+}; -+ -+#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE -+ -+/* cgroup-bpf attach flags used in BPF_PROG_ATTACH command -+ * -+ * NONE(default): No further bpf programs allowed in the subtree. -+ * -+ * BPF_F_ALLOW_OVERRIDE: If a sub-cgroup installs some bpf program, -+ * the program in this cgroup yields to sub-cgroup program. -+ * -+ * BPF_F_ALLOW_MULTI: If a sub-cgroup installs some bpf program, -+ * that cgroup program gets run in addition to the program in this cgroup. -+ * -+ * Only one program is allowed to be attached to a cgroup with -+ * NONE or BPF_F_ALLOW_OVERRIDE flag. -+ * Attaching another program on top of NONE or BPF_F_ALLOW_OVERRIDE will -+ * release old program and attach the new one. Attach flags has to match. -+ * -+ * Multiple programs are allowed to be attached to a cgroup with -+ * BPF_F_ALLOW_MULTI flag. They are executed in FIFO order -+ * (those that were attached first, run first) -+ * The programs of sub-cgroup are executed first, then programs of -+ * this cgroup and then programs of parent cgroup. -+ * When children program makes decision (like picking TCP CA or sock bind) -+ * parent program has a chance to override it. -+ * -+ * A cgroup with MULTI or OVERRIDE flag allows any attach flags in sub-cgroups. -+ * A cgroup with NONE doesn't allow any programs in sub-cgroups. -+ * Ex1: -+ * cgrp1 (MULTI progs A, B) -> -+ * cgrp2 (OVERRIDE prog C) -> -+ * cgrp3 (MULTI prog D) -> -+ * cgrp4 (OVERRIDE prog E) -> -+ * cgrp5 (NONE prog F) -+ * the event in cgrp5 triggers execution of F,D,A,B in that order. -+ * if prog F is detached, the execution is E,D,A,B -+ * if prog F and D are detached, the execution is E,A,B -+ * if prog F, E and D are detached, the execution is C,A,B -+ * -+ * All eligible programs are executed regardless of return code from -+ * earlier programs. -+ */ -+#define BPF_F_ALLOW_OVERRIDE (1U << 0) -+#define BPF_F_ALLOW_MULTI (1U << 1) -+ -+/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the -+ * verifier will perform strict alignment checking as if the kernel -+ * has been built with CONFIG_EFFICIENT_UNALIGNED_ACCESS not set, -+ * and NET_IP_ALIGN defined to 2. -+ */ -+#define BPF_F_STRICT_ALIGNMENT (1U << 0) -+ -+/* If BPF_F_ANY_ALIGNMENT is used in BPF_PROF_LOAD command, the -+ * verifier will allow any alignment whatsoever. On platforms -+ * with strict alignment requirements for loads ands stores (such -+ * as sparc and mips) the verifier validates that all loads and -+ * stores provably follow this requirement. This flag turns that -+ * checking and enforcement off. -+ * -+ * It is mostly used for testing when we want to validate the -+ * context and memory access aspects of the verifier, but because -+ * of an unaligned access the alignment check would trigger before -+ * the one we are interested in. -+ */ -+#define BPF_F_ANY_ALIGNMENT (1U << 1) -+ -+/* BPF_F_TEST_RND_HI32 is used in BPF_PROG_LOAD command for testing purpose. -+ * Verifier does sub-register def/use analysis and identifies instructions whose -+ * def only matters for low 32-bit, high 32-bit is never referenced later -+ * through implicit zero extension. Therefore verifier notifies JIT back-ends -+ * that it is safe to ignore clearing high 32-bit for these instructions. This -+ * saves some back-ends a lot of code-gen. However such optimization is not -+ * necessary on some arches, for example x86_64, arm64 etc, whose JIT back-ends -+ * hence hasn't used verifier's analysis result. But, we really want to have a -+ * way to be able to verify the correctness of the described optimization on -+ * x86_64 on which testsuites are frequently exercised. -+ * -+ * So, this flag is introduced. Once it is set, verifier will randomize high -+ * 32-bit for those instructions who has been identified as safe to ignore them. -+ * Then, if verifier is not doing correct analysis, such randomization will -+ * regress tests to expose bugs. -+ */ -+#define BPF_F_TEST_RND_HI32 (1U << 2) -+ -+/* The verifier internal test flag. Behavior is undefined */ -+#define BPF_F_TEST_STATE_FREQ (1U << 3) -+ -+/* When BPF ldimm64's insn[0].src_reg != 0 then this can have -+ * two extensions: -+ * -+ * insn[0].src_reg: BPF_PSEUDO_MAP_FD BPF_PSEUDO_MAP_VALUE -+ * insn[0].imm: map fd map fd -+ * insn[1].imm: 0 offset into value -+ * insn[0].off: 0 0 -+ * insn[1].off: 0 0 -+ * ldimm64 rewrite: address of map address of map[0]+offset -+ * verifier type: CONST_PTR_TO_MAP PTR_TO_MAP_VALUE -+ */ - #define BPF_PSEUDO_MAP_FD 1 -+#define BPF_PSEUDO_MAP_VALUE 2 -+ -+/* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative -+ * offset to another bpf function -+ */ -+#define BPF_PSEUDO_CALL 1 - - /* flags for BPF_MAP_UPDATE_ELEM command */ - #define BPF_ANY 0 /* create new element or update existing */ - #define BPF_NOEXIST 1 /* create new element if it didn't exist */ - #define BPF_EXIST 2 /* update existing element */ -+#define BPF_F_LOCK 4 /* spin_lock-ed map_lookup/map_update */ -+ -+/* flags for BPF_MAP_CREATE command */ -+#define BPF_F_NO_PREALLOC (1U << 0) -+/* Instead of having one common LRU list in the -+ * BPF_MAP_TYPE_LRU_[PERCPU_]HASH map, use a percpu LRU list -+ * which can scale and perform better. -+ * Note, the LRU nodes (including free nodes) cannot be moved -+ * across different LRU lists. -+ */ -+#define BPF_F_NO_COMMON_LRU (1U << 1) -+/* Specify numa node during map creation */ -+#define BPF_F_NUMA_NODE (1U << 2) -+ -+#define BPF_OBJ_NAME_LEN 16U -+ -+/* Flags for accessing BPF object from syscall side. */ -+#define BPF_F_RDONLY (1U << 3) -+#define BPF_F_WRONLY (1U << 4) -+ -+/* Flag for stack_map, store build_id+offset instead of pointer */ -+#define BPF_F_STACK_BUILD_ID (1U << 5) -+ -+/* Zero-initialize hash function seed. This should only be used for testing. */ -+#define BPF_F_ZERO_SEED (1U << 6) -+ -+/* Flags for accessing BPF object from program side. */ -+#define BPF_F_RDONLY_PROG (1U << 7) -+#define BPF_F_WRONLY_PROG (1U << 8) -+ -+/* Clone map from listener for newly accepted socket */ -+#define BPF_F_CLONE (1U << 9) -+ -+/* flags for BPF_PROG_QUERY */ -+#define BPF_F_QUERY_EFFECTIVE (1U << 0) -+ -+enum bpf_stack_build_id_status { -+ /* user space need an empty entry to identify end of a trace */ -+ BPF_STACK_BUILD_ID_EMPTY = 0, -+ /* with valid build_id and offset */ -+ BPF_STACK_BUILD_ID_VALID = 1, -+ /* couldn't get build_id, fallback to ip */ -+ BPF_STACK_BUILD_ID_IP = 2, -+}; -+ -+#define BPF_BUILD_ID_SIZE 20 -+struct bpf_stack_build_id { -+ __s32 status; -+ unsigned char build_id[BPF_BUILD_ID_SIZE]; -+ union { -+ __u64 offset; -+ __u64 ip; -+ }; -+}; - - union bpf_attr { - struct { /* anonymous struct used by BPF_MAP_CREATE command */ -@@ -104,6 +372,18 @@ union bpf_attr { - __u32 key_size; /* size of key in bytes */ - __u32 value_size; /* size of value in bytes */ - __u32 max_entries; /* max number of entries in a map */ -+ __u32 map_flags; /* BPF_MAP_CREATE related -+ * flags defined above. -+ */ -+ __u32 inner_map_fd; /* fd pointing to the inner map */ -+ __u32 numa_node; /* numa node (effective only if -+ * BPF_F_NUMA_NODE is set). -+ */ -+ char map_name[BPF_OBJ_NAME_LEN]; -+ __u32 map_ifindex; /* ifindex of netdev to create on */ -+ __u32 btf_fd; /* fd pointing to a BTF type data */ -+ __u32 btf_key_type_id; /* BTF type_id of the key */ -+ __u32 btf_value_type_id; /* BTF type_id of the value */ - }; - - struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */ -@@ -124,154 +404,2568 @@ union bpf_attr { - __u32 log_level; /* verbosity level of verifier */ - __u32 log_size; /* size of user buffer */ - __aligned_u64 log_buf; /* user supplied buffer */ -- __u32 kern_version; /* checked when prog_type=kprobe */ -+ __u32 kern_version; /* not used */ -+ __u32 prog_flags; -+ char prog_name[BPF_OBJ_NAME_LEN]; -+ __u32 prog_ifindex; /* ifindex of netdev to prep for */ -+ /* For some prog types expected attach type must be known at -+ * load time to verify attach type specific parts of prog -+ * (context accesses, allowed helpers, etc). -+ */ -+ __u32 expected_attach_type; -+ __u32 prog_btf_fd; /* fd pointing to BTF type data */ -+ __u32 func_info_rec_size; /* userspace bpf_func_info size */ -+ __aligned_u64 func_info; /* func info */ -+ __u32 func_info_cnt; /* number of bpf_func_info records */ -+ __u32 line_info_rec_size; /* userspace bpf_line_info size */ -+ __aligned_u64 line_info; /* line info */ -+ __u32 line_info_cnt; /* number of bpf_line_info records */ - }; - - struct { /* anonymous struct used by BPF_OBJ_* commands */ - __aligned_u64 pathname; - __u32 bpf_fd; -+ __u32 file_flags; -+ }; -+ -+ struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */ -+ __u32 target_fd; /* container object to attach to */ -+ __u32 attach_bpf_fd; /* eBPF program to attach */ -+ __u32 attach_type; -+ __u32 attach_flags; -+ }; -+ -+ struct { /* anonymous struct used by BPF_PROG_TEST_RUN command */ -+ __u32 prog_fd; -+ __u32 retval; -+ __u32 data_size_in; /* input: len of data_in */ -+ __u32 data_size_out; /* input/output: len of data_out -+ * returns ENOSPC if data_out -+ * is too small. -+ */ -+ __aligned_u64 data_in; -+ __aligned_u64 data_out; -+ __u32 repeat; -+ __u32 duration; -+ __u32 ctx_size_in; /* input: len of ctx_in */ -+ __u32 ctx_size_out; /* input/output: len of ctx_out -+ * returns ENOSPC if ctx_out -+ * is too small. -+ */ -+ __aligned_u64 ctx_in; -+ __aligned_u64 ctx_out; -+ } test; -+ -+ struct { /* anonymous struct used by BPF_*_GET_*_ID */ -+ union { -+ __u32 start_id; -+ __u32 prog_id; -+ __u32 map_id; -+ __u32 btf_id; -+ }; -+ __u32 next_id; -+ __u32 open_flags; - }; -+ -+ struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */ -+ __u32 bpf_fd; -+ __u32 info_len; -+ __aligned_u64 info; -+ } info; -+ -+ struct { /* anonymous struct used by BPF_PROG_QUERY command */ -+ __u32 target_fd; /* container object to query */ -+ __u32 attach_type; -+ __u32 query_flags; -+ __u32 attach_flags; -+ __aligned_u64 prog_ids; -+ __u32 prog_cnt; -+ } query; -+ -+ struct { -+ __u64 name; -+ __u32 prog_fd; -+ } raw_tracepoint; -+ -+ struct { /* anonymous struct for BPF_BTF_LOAD */ -+ __aligned_u64 btf; -+ __aligned_u64 btf_log_buf; -+ __u32 btf_size; -+ __u32 btf_log_size; -+ __u32 btf_log_level; -+ }; -+ -+ struct { -+ __u32 pid; /* input: pid */ -+ __u32 fd; /* input: fd */ -+ __u32 flags; /* input: flags */ -+ __u32 buf_len; /* input/output: buf len */ -+ __aligned_u64 buf; /* input/output: -+ * tp_name for tracepoint -+ * symbol for kprobe -+ * filename for uprobe -+ */ -+ __u32 prog_id; /* output: prod_id */ -+ __u32 fd_type; /* output: BPF_FD_TYPE_* */ -+ __u64 probe_offset; /* output: probe_offset */ -+ __u64 probe_addr; /* output: probe_addr */ -+ } task_fd_query; - } __attribute__((aligned(8))); - -+/* The description below is an attempt at providing documentation to eBPF -+ * developers about the multiple available eBPF helper functions. It can be -+ * parsed and used to produce a manual page. The workflow is the following, -+ * and requires the rst2man utility: -+ * -+ * $ ./scripts/bpf_helpers_doc.py \ -+ * --filename include/uapi/linux/bpf.h > /tmp/bpf-helpers.rst -+ * $ rst2man /tmp/bpf-helpers.rst > /tmp/bpf-helpers.7 -+ * $ man /tmp/bpf-helpers.7 -+ * -+ * Note that in order to produce this external documentation, some RST -+ * formatting is used in the descriptions to get "bold" and "italics" in -+ * manual pages. Also note that the few trailing white spaces are -+ * intentional, removing them would break paragraphs for rst2man. -+ * -+ * Start of BPF helper function descriptions: -+ * -+ * void *bpf_map_lookup_elem(struct bpf_map *map, const void *key) -+ * Description -+ * Perform a lookup in *map* for an entry associated to *key*. -+ * Return -+ * Map value associated to *key*, or **NULL** if no entry was -+ * found. -+ * -+ * int bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags) -+ * Description -+ * Add or update the value of the entry associated to *key* in -+ * *map* with *value*. *flags* is one of: -+ * -+ * **BPF_NOEXIST** -+ * The entry for *key* must not exist in the map. -+ * **BPF_EXIST** -+ * The entry for *key* must already exist in the map. -+ * **BPF_ANY** -+ * No condition on the existence of the entry for *key*. -+ * -+ * Flag value **BPF_NOEXIST** cannot be used for maps of types -+ * **BPF_MAP_TYPE_ARRAY** or **BPF_MAP_TYPE_PERCPU_ARRAY** (all -+ * elements always exist), the helper would return an error. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_map_delete_elem(struct bpf_map *map, const void *key) -+ * Description -+ * Delete entry with *key* from *map*. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_probe_read(void *dst, u32 size, const void *src) -+ * Description -+ * For tracing programs, safely attempt to read *size* bytes from -+ * address *src* and store the data in *dst*. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * u64 bpf_ktime_get_ns(void) -+ * Description -+ * Return the time elapsed since system boot, in nanoseconds. -+ * Return -+ * Current *ktime*. -+ * -+ * int bpf_trace_printk(const char *fmt, u32 fmt_size, ...) -+ * Description -+ * This helper is a "printk()-like" facility for debugging. It -+ * prints a message defined by format *fmt* (of size *fmt_size*) -+ * to file *\/sys/kernel/debug/tracing/trace* from DebugFS, if -+ * available. It can take up to three additional **u64** -+ * arguments (as an eBPF helpers, the total number of arguments is -+ * limited to five). -+ * -+ * Each time the helper is called, it appends a line to the trace. -+ * Lines are discarded while *\/sys/kernel/debug/tracing/trace* is -+ * open, use *\/sys/kernel/debug/tracing/trace_pipe* to avoid this. -+ * The format of the trace is customizable, and the exact output -+ * one will get depends on the options set in -+ * *\/sys/kernel/debug/tracing/trace_options* (see also the -+ * *README* file under the same directory). However, it usually -+ * defaults to something like: -+ * -+ * :: -+ * -+ * telnet-470 [001] .N.. 419421.045894: 0x00000001: -+ * -+ * In the above: -+ * -+ * * ``telnet`` is the name of the current task. -+ * * ``470`` is the PID of the current task. -+ * * ``001`` is the CPU number on which the task is -+ * running. -+ * * In ``.N..``, each character refers to a set of -+ * options (whether irqs are enabled, scheduling -+ * options, whether hard/softirqs are running, level of -+ * preempt_disabled respectively). **N** means that -+ * **TIF_NEED_RESCHED** and **PREEMPT_NEED_RESCHED** -+ * are set. -+ * * ``419421.045894`` is a timestamp. -+ * * ``0x00000001`` is a fake value used by BPF for the -+ * instruction pointer register. -+ * * ```` is the message formatted with -+ * *fmt*. -+ * -+ * The conversion specifiers supported by *fmt* are similar, but -+ * more limited than for printk(). They are **%d**, **%i**, -+ * **%u**, **%x**, **%ld**, **%li**, **%lu**, **%lx**, **%lld**, -+ * **%lli**, **%llu**, **%llx**, **%p**, **%s**. No modifier (size -+ * of field, padding with zeroes, etc.) is available, and the -+ * helper will return **-EINVAL** (but print nothing) if it -+ * encounters an unknown specifier. -+ * -+ * Also, note that **bpf_trace_printk**\ () is slow, and should -+ * only be used for debugging purposes. For this reason, a notice -+ * bloc (spanning several lines) is printed to kernel logs and -+ * states that the helper should not be used "for production use" -+ * the first time this helper is used (or more precisely, when -+ * **trace_printk**\ () buffers are allocated). For passing values -+ * to user space, perf events should be preferred. -+ * Return -+ * The number of bytes written to the buffer, or a negative error -+ * in case of failure. -+ * -+ * u32 bpf_get_prandom_u32(void) -+ * Description -+ * Get a pseudo-random number. -+ * -+ * From a security point of view, this helper uses its own -+ * pseudo-random internal state, and cannot be used to infer the -+ * seed of other random functions in the kernel. However, it is -+ * essential to note that the generator used by the helper is not -+ * cryptographically secure. -+ * Return -+ * A random 32-bit unsigned value. -+ * -+ * u32 bpf_get_smp_processor_id(void) -+ * Description -+ * Get the SMP (symmetric multiprocessing) processor id. Note that -+ * all programs run with preemption disabled, which means that the -+ * SMP processor id is stable during all the execution of the -+ * program. -+ * Return -+ * The SMP id of the processor running the program. -+ * -+ * int bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags) -+ * Description -+ * Store *len* bytes from address *from* into the packet -+ * associated to *skb*, at *offset*. *flags* are a combination of -+ * **BPF_F_RECOMPUTE_CSUM** (automatically recompute the -+ * checksum for the packet after storing the bytes) and -+ * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\ -+ * **->swhash** and *skb*\ **->l4hash** to 0). -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_l3_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 size) -+ * Description -+ * Recompute the layer 3 (e.g. IP) checksum for the packet -+ * associated to *skb*. Computation is incremental, so the helper -+ * must know the former value of the header field that was -+ * modified (*from*), the new value of this field (*to*), and the -+ * number of bytes (2 or 4) for this field, stored in *size*. -+ * Alternatively, it is possible to store the difference between -+ * the previous and the new values of the header field in *to*, by -+ * setting *from* and *size* to 0. For both methods, *offset* -+ * indicates the location of the IP checksum within the packet. -+ * -+ * This helper works in combination with **bpf_csum_diff**\ (), -+ * which does not update the checksum in-place, but offers more -+ * flexibility and can handle sizes larger than 2 or 4 for the -+ * checksum to update. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_l4_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 flags) -+ * Description -+ * Recompute the layer 4 (e.g. TCP, UDP or ICMP) checksum for the -+ * packet associated to *skb*. Computation is incremental, so the -+ * helper must know the former value of the header field that was -+ * modified (*from*), the new value of this field (*to*), and the -+ * number of bytes (2 or 4) for this field, stored on the lowest -+ * four bits of *flags*. Alternatively, it is possible to store -+ * the difference between the previous and the new values of the -+ * header field in *to*, by setting *from* and the four lowest -+ * bits of *flags* to 0. For both methods, *offset* indicates the -+ * location of the IP checksum within the packet. In addition to -+ * the size of the field, *flags* can be added (bitwise OR) actual -+ * flags. With **BPF_F_MARK_MANGLED_0**, a null checksum is left -+ * untouched (unless **BPF_F_MARK_ENFORCE** is added as well), and -+ * for updates resulting in a null checksum the value is set to -+ * **CSUM_MANGLED_0** instead. Flag **BPF_F_PSEUDO_HDR** indicates -+ * the checksum is to be computed against a pseudo-header. -+ * -+ * This helper works in combination with **bpf_csum_diff**\ (), -+ * which does not update the checksum in-place, but offers more -+ * flexibility and can handle sizes larger than 2 or 4 for the -+ * checksum to update. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_tail_call(void *ctx, struct bpf_map *prog_array_map, u32 index) -+ * Description -+ * This special helper is used to trigger a "tail call", or in -+ * other words, to jump into another eBPF program. The same stack -+ * frame is used (but values on stack and in registers for the -+ * caller are not accessible to the callee). This mechanism allows -+ * for program chaining, either for raising the maximum number of -+ * available eBPF instructions, or to execute given programs in -+ * conditional blocks. For security reasons, there is an upper -+ * limit to the number of successive tail calls that can be -+ * performed. -+ * -+ * Upon call of this helper, the program attempts to jump into a -+ * program referenced at index *index* in *prog_array_map*, a -+ * special map of type **BPF_MAP_TYPE_PROG_ARRAY**, and passes -+ * *ctx*, a pointer to the context. -+ * -+ * If the call succeeds, the kernel immediately runs the first -+ * instruction of the new program. This is not a function call, -+ * and it never returns to the previous program. If the call -+ * fails, then the helper has no effect, and the caller continues -+ * to run its subsequent instructions. A call can fail if the -+ * destination program for the jump does not exist (i.e. *index* -+ * is superior to the number of entries in *prog_array_map*), or -+ * if the maximum number of tail calls has been reached for this -+ * chain of programs. This limit is defined in the kernel by the -+ * macro **MAX_TAIL_CALL_CNT** (not accessible to user space), -+ * which is currently set to 32. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_clone_redirect(struct sk_buff *skb, u32 ifindex, u64 flags) -+ * Description -+ * Clone and redirect the packet associated to *skb* to another -+ * net device of index *ifindex*. Both ingress and egress -+ * interfaces can be used for redirection. The **BPF_F_INGRESS** -+ * value in *flags* is used to make the distinction (ingress path -+ * is selected if the flag is present, egress path otherwise). -+ * This is the only flag supported for now. -+ * -+ * In comparison with **bpf_redirect**\ () helper, -+ * **bpf_clone_redirect**\ () has the associated cost of -+ * duplicating the packet buffer, but this can be executed out of -+ * the eBPF program. Conversely, **bpf_redirect**\ () is more -+ * efficient, but it is handled through an action code where the -+ * redirection happens only after the eBPF program has returned. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * u64 bpf_get_current_pid_tgid(void) -+ * Return -+ * A 64-bit integer containing the current tgid and pid, and -+ * created as such: -+ * *current_task*\ **->tgid << 32 \|** -+ * *current_task*\ **->pid**. -+ * -+ * u64 bpf_get_current_uid_gid(void) -+ * Return -+ * A 64-bit integer containing the current GID and UID, and -+ * created as such: *current_gid* **<< 32 \|** *current_uid*. -+ * -+ * int bpf_get_current_comm(char *buf, u32 size_of_buf) -+ * Description -+ * Copy the **comm** attribute of the current task into *buf* of -+ * *size_of_buf*. The **comm** attribute contains the name of -+ * the executable (excluding the path) for the current task. The -+ * *size_of_buf* must be strictly positive. On success, the -+ * helper makes sure that the *buf* is NUL-terminated. On failure, -+ * it is filled with zeroes. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * u32 bpf_get_cgroup_classid(struct sk_buff *skb) -+ * Description -+ * Retrieve the classid for the current task, i.e. for the net_cls -+ * cgroup to which *skb* belongs. -+ * -+ * This helper can be used on TC egress path, but not on ingress. -+ * -+ * The net_cls cgroup provides an interface to tag network packets -+ * based on a user-provided identifier for all traffic coming from -+ * the tasks belonging to the related cgroup. See also the related -+ * kernel documentation, available from the Linux sources in file -+ * *Documentation/admin-guide/cgroup-v1/net_cls.rst*. -+ * -+ * The Linux kernel has two versions for cgroups: there are -+ * cgroups v1 and cgroups v2. Both are available to users, who can -+ * use a mixture of them, but note that the net_cls cgroup is for -+ * cgroup v1 only. This makes it incompatible with BPF programs -+ * run on cgroups, which is a cgroup-v2-only feature (a socket can -+ * only hold data for one version of cgroups at a time). -+ * -+ * This helper is only available is the kernel was compiled with -+ * the **CONFIG_CGROUP_NET_CLASSID** configuration option set to -+ * "**y**" or to "**m**". -+ * Return -+ * The classid, or 0 for the default unconfigured classid. -+ * -+ * int bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci) -+ * Description -+ * Push a *vlan_tci* (VLAN tag control information) of protocol -+ * *vlan_proto* to the packet associated to *skb*, then update -+ * the checksum. Note that if *vlan_proto* is different from -+ * **ETH_P_8021Q** and **ETH_P_8021AD**, it is considered to -+ * be **ETH_P_8021Q**. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_vlan_pop(struct sk_buff *skb) -+ * Description -+ * Pop a VLAN header from the packet associated to *skb*. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_get_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags) -+ * Description -+ * Get tunnel metadata. This helper takes a pointer *key* to an -+ * empty **struct bpf_tunnel_key** of **size**, that will be -+ * filled with tunnel metadata for the packet associated to *skb*. -+ * The *flags* can be set to **BPF_F_TUNINFO_IPV6**, which -+ * indicates that the tunnel is based on IPv6 protocol instead of -+ * IPv4. -+ * -+ * The **struct bpf_tunnel_key** is an object that generalizes the -+ * principal parameters used by various tunneling protocols into a -+ * single struct. This way, it can be used to easily make a -+ * decision based on the contents of the encapsulation header, -+ * "summarized" in this struct. In particular, it holds the IP -+ * address of the remote end (IPv4 or IPv6, depending on the case) -+ * in *key*\ **->remote_ipv4** or *key*\ **->remote_ipv6**. Also, -+ * this struct exposes the *key*\ **->tunnel_id**, which is -+ * generally mapped to a VNI (Virtual Network Identifier), making -+ * it programmable together with the **bpf_skb_set_tunnel_key**\ -+ * () helper. -+ * -+ * Let's imagine that the following code is part of a program -+ * attached to the TC ingress interface, on one end of a GRE -+ * tunnel, and is supposed to filter out all messages coming from -+ * remote ends with IPv4 address other than 10.0.0.1: -+ * -+ * :: -+ * -+ * int ret; -+ * struct bpf_tunnel_key key = {}; -+ * -+ * ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); -+ * if (ret < 0) -+ * return TC_ACT_SHOT; // drop packet -+ * -+ * if (key.remote_ipv4 != 0x0a000001) -+ * return TC_ACT_SHOT; // drop packet -+ * -+ * return TC_ACT_OK; // accept packet -+ * -+ * This interface can also be used with all encapsulation devices -+ * that can operate in "collect metadata" mode: instead of having -+ * one network device per specific configuration, the "collect -+ * metadata" mode only requires a single device where the -+ * configuration can be extracted from this helper. -+ * -+ * This can be used together with various tunnels such as VXLan, -+ * Geneve, GRE or IP in IP (IPIP). -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_set_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags) -+ * Description -+ * Populate tunnel metadata for packet associated to *skb.* The -+ * tunnel metadata is set to the contents of *key*, of *size*. The -+ * *flags* can be set to a combination of the following values: -+ * -+ * **BPF_F_TUNINFO_IPV6** -+ * Indicate that the tunnel is based on IPv6 protocol -+ * instead of IPv4. -+ * **BPF_F_ZERO_CSUM_TX** -+ * For IPv4 packets, add a flag to tunnel metadata -+ * indicating that checksum computation should be skipped -+ * and checksum set to zeroes. -+ * **BPF_F_DONT_FRAGMENT** -+ * Add a flag to tunnel metadata indicating that the -+ * packet should not be fragmented. -+ * **BPF_F_SEQ_NUMBER** -+ * Add a flag to tunnel metadata indicating that a -+ * sequence number should be added to tunnel header before -+ * sending the packet. This flag was added for GRE -+ * encapsulation, but might be used with other protocols -+ * as well in the future. -+ * -+ * Here is a typical usage on the transmit path: -+ * -+ * :: -+ * -+ * struct bpf_tunnel_key key; -+ * populate key ... -+ * bpf_skb_set_tunnel_key(skb, &key, sizeof(key), 0); -+ * bpf_clone_redirect(skb, vxlan_dev_ifindex, 0); -+ * -+ * See also the description of the **bpf_skb_get_tunnel_key**\ () -+ * helper for additional information. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * u64 bpf_perf_event_read(struct bpf_map *map, u64 flags) -+ * Description -+ * Read the value of a perf event counter. This helper relies on a -+ * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. The nature of -+ * the perf event counter is selected when *map* is updated with -+ * perf event file descriptors. The *map* is an array whose size -+ * is the number of available CPUs, and each cell contains a value -+ * relative to one CPU. The value to retrieve is indicated by -+ * *flags*, that contains the index of the CPU to look up, masked -+ * with **BPF_F_INDEX_MASK**. Alternatively, *flags* can be set to -+ * **BPF_F_CURRENT_CPU** to indicate that the value for the -+ * current CPU should be retrieved. -+ * -+ * Note that before Linux 4.13, only hardware perf event can be -+ * retrieved. -+ * -+ * Also, be aware that the newer helper -+ * **bpf_perf_event_read_value**\ () is recommended over -+ * **bpf_perf_event_read**\ () in general. The latter has some ABI -+ * quirks where error and counter value are used as a return code -+ * (which is wrong to do since ranges may overlap). This issue is -+ * fixed with **bpf_perf_event_read_value**\ (), which at the same -+ * time provides more features over the **bpf_perf_event_read**\ -+ * () interface. Please refer to the description of -+ * **bpf_perf_event_read_value**\ () for details. -+ * Return -+ * The value of the perf event counter read from the map, or a -+ * negative error code in case of failure. -+ * -+ * int bpf_redirect(u32 ifindex, u64 flags) -+ * Description -+ * Redirect the packet to another net device of index *ifindex*. -+ * This helper is somewhat similar to **bpf_clone_redirect**\ -+ * (), except that the packet is not cloned, which provides -+ * increased performance. -+ * -+ * Except for XDP, both ingress and egress interfaces can be used -+ * for redirection. The **BPF_F_INGRESS** value in *flags* is used -+ * to make the distinction (ingress path is selected if the flag -+ * is present, egress path otherwise). Currently, XDP only -+ * supports redirection to the egress interface, and accepts no -+ * flag at all. -+ * -+ * The same effect can be attained with the more generic -+ * **bpf_redirect_map**\ (), which requires specific maps to be -+ * used but offers better performance. -+ * Return -+ * For XDP, the helper returns **XDP_REDIRECT** on success or -+ * **XDP_ABORTED** on error. For other program types, the values -+ * are **TC_ACT_REDIRECT** on success or **TC_ACT_SHOT** on -+ * error. -+ * -+ * u32 bpf_get_route_realm(struct sk_buff *skb) -+ * Description -+ * Retrieve the realm or the route, that is to say the -+ * **tclassid** field of the destination for the *skb*. The -+ * indentifier retrieved is a user-provided tag, similar to the -+ * one used with the net_cls cgroup (see description for -+ * **bpf_get_cgroup_classid**\ () helper), but here this tag is -+ * held by a route (a destination entry), not by a task. -+ * -+ * Retrieving this identifier works with the clsact TC egress hook -+ * (see also **tc-bpf(8)**), or alternatively on conventional -+ * classful egress qdiscs, but not on TC ingress path. In case of -+ * clsact TC egress hook, this has the advantage that, internally, -+ * the destination entry has not been dropped yet in the transmit -+ * path. Therefore, the destination entry does not need to be -+ * artificially held via **netif_keep_dst**\ () for a classful -+ * qdisc until the *skb* is freed. -+ * -+ * This helper is available only if the kernel was compiled with -+ * **CONFIG_IP_ROUTE_CLASSID** configuration option. -+ * Return -+ * The realm of the route for the packet associated to *skb*, or 0 -+ * if none was found. -+ * -+ * int bpf_perf_event_output(struct pt_regs *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) -+ * Description -+ * Write raw *data* blob into a special BPF perf event held by -+ * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf -+ * event must have the following attributes: **PERF_SAMPLE_RAW** -+ * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and -+ * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. -+ * -+ * The *flags* are used to indicate the index in *map* for which -+ * the value must be put, masked with **BPF_F_INDEX_MASK**. -+ * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** -+ * to indicate that the index of the current CPU core should be -+ * used. -+ * -+ * The value to write, of *size*, is passed through eBPF stack and -+ * pointed by *data*. -+ * -+ * The context of the program *ctx* needs also be passed to the -+ * helper. -+ * -+ * On user space, a program willing to read the values needs to -+ * call **perf_event_open**\ () on the perf event (either for -+ * one or for all CPUs) and to store the file descriptor into the -+ * *map*. This must be done before the eBPF program can send data -+ * into it. An example is available in file -+ * *samples/bpf/trace_output_user.c* in the Linux kernel source -+ * tree (the eBPF program counterpart is in -+ * *samples/bpf/trace_output_kern.c*). -+ * -+ * **bpf_perf_event_output**\ () achieves better performance -+ * than **bpf_trace_printk**\ () for sharing data with user -+ * space, and is much better suitable for streaming data from eBPF -+ * programs. -+ * -+ * Note that this helper is not restricted to tracing use cases -+ * and can be used with programs attached to TC or XDP as well, -+ * where it allows for passing data to user space listeners. Data -+ * can be: -+ * -+ * * Only custom structs, -+ * * Only the packet payload, or -+ * * A combination of both. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_load_bytes(const struct sk_buff *skb, u32 offset, void *to, u32 len) -+ * Description -+ * This helper was provided as an easy way to load data from a -+ * packet. It can be used to load *len* bytes from *offset* from -+ * the packet associated to *skb*, into the buffer pointed by -+ * *to*. -+ * -+ * Since Linux 4.7, usage of this helper has mostly been replaced -+ * by "direct packet access", enabling packet data to be -+ * manipulated with *skb*\ **->data** and *skb*\ **->data_end** -+ * pointing respectively to the first byte of packet data and to -+ * the byte after the last byte of packet data. However, it -+ * remains useful if one wishes to read large quantities of data -+ * at once from a packet into the eBPF stack. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_get_stackid(struct pt_regs *ctx, struct bpf_map *map, u64 flags) -+ * Description -+ * Walk a user or a kernel stack and return its id. To achieve -+ * this, the helper needs *ctx*, which is a pointer to the context -+ * on which the tracing program is executed, and a pointer to a -+ * *map* of type **BPF_MAP_TYPE_STACK_TRACE**. -+ * -+ * The last argument, *flags*, holds the number of stack frames to -+ * skip (from 0 to 255), masked with -+ * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set -+ * a combination of the following flags: -+ * -+ * **BPF_F_USER_STACK** -+ * Collect a user space stack instead of a kernel stack. -+ * **BPF_F_FAST_STACK_CMP** -+ * Compare stacks by hash only. -+ * **BPF_F_REUSE_STACKID** -+ * If two different stacks hash into the same *stackid*, -+ * discard the old one. -+ * -+ * The stack id retrieved is a 32 bit long integer handle which -+ * can be further combined with other data (including other stack -+ * ids) and used as a key into maps. This can be useful for -+ * generating a variety of graphs (such as flame graphs or off-cpu -+ * graphs). -+ * -+ * For walking a stack, this helper is an improvement over -+ * **bpf_probe_read**\ (), which can be used with unrolled loops -+ * but is not efficient and consumes a lot of eBPF instructions. -+ * Instead, **bpf_get_stackid**\ () can collect up to -+ * **PERF_MAX_STACK_DEPTH** both kernel and user frames. Note that -+ * this limit can be controlled with the **sysctl** program, and -+ * that it should be manually increased in order to profile long -+ * user stacks (such as stacks for Java programs). To do so, use: -+ * -+ * :: -+ * -+ * # sysctl kernel.perf_event_max_stack= -+ * Return -+ * The positive or null stack id on success, or a negative error -+ * in case of failure. -+ * -+ * s64 bpf_csum_diff(__be32 *from, u32 from_size, __be32 *to, u32 to_size, __wsum seed) -+ * Description -+ * Compute a checksum difference, from the raw buffer pointed by -+ * *from*, of length *from_size* (that must be a multiple of 4), -+ * towards the raw buffer pointed by *to*, of size *to_size* -+ * (same remark). An optional *seed* can be added to the value -+ * (this can be cascaded, the seed may come from a previous call -+ * to the helper). -+ * -+ * This is flexible enough to be used in several ways: -+ * -+ * * With *from_size* == 0, *to_size* > 0 and *seed* set to -+ * checksum, it can be used when pushing new data. -+ * * With *from_size* > 0, *to_size* == 0 and *seed* set to -+ * checksum, it can be used when removing data from a packet. -+ * * With *from_size* > 0, *to_size* > 0 and *seed* set to 0, it -+ * can be used to compute a diff. Note that *from_size* and -+ * *to_size* do not need to be equal. -+ * -+ * This helper can be used in combination with -+ * **bpf_l3_csum_replace**\ () and **bpf_l4_csum_replace**\ (), to -+ * which one can feed in the difference computed with -+ * **bpf_csum_diff**\ (). -+ * Return -+ * The checksum result, or a negative error code in case of -+ * failure. -+ * -+ * int bpf_skb_get_tunnel_opt(struct sk_buff *skb, u8 *opt, u32 size) -+ * Description -+ * Retrieve tunnel options metadata for the packet associated to -+ * *skb*, and store the raw tunnel option data to the buffer *opt* -+ * of *size*. -+ * -+ * This helper can be used with encapsulation devices that can -+ * operate in "collect metadata" mode (please refer to the related -+ * note in the description of **bpf_skb_get_tunnel_key**\ () for -+ * more details). A particular example where this can be used is -+ * in combination with the Geneve encapsulation protocol, where it -+ * allows for pushing (with **bpf_skb_get_tunnel_opt**\ () helper) -+ * and retrieving arbitrary TLVs (Type-Length-Value headers) from -+ * the eBPF program. This allows for full customization of these -+ * headers. -+ * Return -+ * The size of the option data retrieved. -+ * -+ * int bpf_skb_set_tunnel_opt(struct sk_buff *skb, u8 *opt, u32 size) -+ * Description -+ * Set tunnel options metadata for the packet associated to *skb* -+ * to the option data contained in the raw buffer *opt* of *size*. -+ * -+ * See also the description of the **bpf_skb_get_tunnel_opt**\ () -+ * helper for additional information. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_change_proto(struct sk_buff *skb, __be16 proto, u64 flags) -+ * Description -+ * Change the protocol of the *skb* to *proto*. Currently -+ * supported are transition from IPv4 to IPv6, and from IPv6 to -+ * IPv4. The helper takes care of the groundwork for the -+ * transition, including resizing the socket buffer. The eBPF -+ * program is expected to fill the new headers, if any, via -+ * **skb_store_bytes**\ () and to recompute the checksums with -+ * **bpf_l3_csum_replace**\ () and **bpf_l4_csum_replace**\ -+ * (). The main case for this helper is to perform NAT64 -+ * operations out of an eBPF program. -+ * -+ * Internally, the GSO type is marked as dodgy so that headers are -+ * checked and segments are recalculated by the GSO/GRO engine. -+ * The size for GSO target is adapted as well. -+ * -+ * All values for *flags* are reserved for future usage, and must -+ * be left at zero. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_change_type(struct sk_buff *skb, u32 type) -+ * Description -+ * Change the packet type for the packet associated to *skb*. This -+ * comes down to setting *skb*\ **->pkt_type** to *type*, except -+ * the eBPF program does not have a write access to *skb*\ -+ * **->pkt_type** beside this helper. Using a helper here allows -+ * for graceful handling of errors. -+ * -+ * The major use case is to change incoming *skb*s to -+ * **PACKET_HOST** in a programmatic way instead of having to -+ * recirculate via **redirect**\ (..., **BPF_F_INGRESS**), for -+ * example. -+ * -+ * Note that *type* only allows certain values. At this time, they -+ * are: -+ * -+ * **PACKET_HOST** -+ * Packet is for us. -+ * **PACKET_BROADCAST** -+ * Send packet to all. -+ * **PACKET_MULTICAST** -+ * Send packet to group. -+ * **PACKET_OTHERHOST** -+ * Send packet to someone else. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_under_cgroup(struct sk_buff *skb, struct bpf_map *map, u32 index) -+ * Description -+ * Check whether *skb* is a descendant of the cgroup2 held by -+ * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*. -+ * Return -+ * The return value depends on the result of the test, and can be: -+ * -+ * * 0, if the *skb* failed the cgroup2 descendant test. -+ * * 1, if the *skb* succeeded the cgroup2 descendant test. -+ * * A negative error code, if an error occurred. -+ * -+ * u32 bpf_get_hash_recalc(struct sk_buff *skb) -+ * Description -+ * Retrieve the hash of the packet, *skb*\ **->hash**. If it is -+ * not set, in particular if the hash was cleared due to mangling, -+ * recompute this hash. Later accesses to the hash can be done -+ * directly with *skb*\ **->hash**. -+ * -+ * Calling **bpf_set_hash_invalid**\ (), changing a packet -+ * prototype with **bpf_skb_change_proto**\ (), or calling -+ * **bpf_skb_store_bytes**\ () with the -+ * **BPF_F_INVALIDATE_HASH** are actions susceptible to clear -+ * the hash and to trigger a new computation for the next call to -+ * **bpf_get_hash_recalc**\ (). -+ * Return -+ * The 32-bit hash. -+ * -+ * u64 bpf_get_current_task(void) -+ * Return -+ * A pointer to the current task struct. -+ * -+ * int bpf_probe_write_user(void *dst, const void *src, u32 len) -+ * Description -+ * Attempt in a safe way to write *len* bytes from the buffer -+ * *src* to *dst* in memory. It only works for threads that are in -+ * user context, and *dst* must be a valid user space address. -+ * -+ * This helper should not be used to implement any kind of -+ * security mechanism because of TOC-TOU attacks, but rather to -+ * debug, divert, and manipulate execution of semi-cooperative -+ * processes. -+ * -+ * Keep in mind that this feature is meant for experiments, and it -+ * has a risk of crashing the system and running programs. -+ * Therefore, when an eBPF program using this helper is attached, -+ * a warning including PID and process name is printed to kernel -+ * logs. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_current_task_under_cgroup(struct bpf_map *map, u32 index) -+ * Description -+ * Check whether the probe is being run is the context of a given -+ * subset of the cgroup2 hierarchy. The cgroup2 to test is held by -+ * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*. -+ * Return -+ * The return value depends on the result of the test, and can be: -+ * -+ * * 0, if current task belongs to the cgroup2. -+ * * 1, if current task does not belong to the cgroup2. -+ * * A negative error code, if an error occurred. -+ * -+ * int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags) -+ * Description -+ * Resize (trim or grow) the packet associated to *skb* to the -+ * new *len*. The *flags* are reserved for future usage, and must -+ * be left at zero. -+ * -+ * The basic idea is that the helper performs the needed work to -+ * change the size of the packet, then the eBPF program rewrites -+ * the rest via helpers like **bpf_skb_store_bytes**\ (), -+ * **bpf_l3_csum_replace**\ (), **bpf_l3_csum_replace**\ () -+ * and others. This helper is a slow path utility intended for -+ * replies with control messages. And because it is targeted for -+ * slow path, the helper itself can afford to be slow: it -+ * implicitly linearizes, unclones and drops offloads from the -+ * *skb*. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_pull_data(struct sk_buff *skb, u32 len) -+ * Description -+ * Pull in non-linear data in case the *skb* is non-linear and not -+ * all of *len* are part of the linear section. Make *len* bytes -+ * from *skb* readable and writable. If a zero value is passed for -+ * *len*, then the whole length of the *skb* is pulled. -+ * -+ * This helper is only needed for reading and writing with direct -+ * packet access. -+ * -+ * For direct packet access, testing that offsets to access -+ * are within packet boundaries (test on *skb*\ **->data_end**) is -+ * susceptible to fail if offsets are invalid, or if the requested -+ * data is in non-linear parts of the *skb*. On failure the -+ * program can just bail out, or in the case of a non-linear -+ * buffer, use a helper to make the data available. The -+ * **bpf_skb_load_bytes**\ () helper is a first solution to access -+ * the data. Another one consists in using **bpf_skb_pull_data** -+ * to pull in once the non-linear parts, then retesting and -+ * eventually access the data. -+ * -+ * At the same time, this also makes sure the *skb* is uncloned, -+ * which is a necessary condition for direct write. As this needs -+ * to be an invariant for the write part only, the verifier -+ * detects writes and adds a prologue that is calling -+ * **bpf_skb_pull_data()** to effectively unclone the *skb* from -+ * the very beginning in case it is indeed cloned. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * s64 bpf_csum_update(struct sk_buff *skb, __wsum csum) -+ * Description -+ * Add the checksum *csum* into *skb*\ **->csum** in case the -+ * driver has supplied a checksum for the entire packet into that -+ * field. Return an error otherwise. This helper is intended to be -+ * used in combination with **bpf_csum_diff**\ (), in particular -+ * when the checksum needs to be updated after data has been -+ * written into the packet through direct packet access. -+ * Return -+ * The checksum on success, or a negative error code in case of -+ * failure. -+ * -+ * void bpf_set_hash_invalid(struct sk_buff *skb) -+ * Description -+ * Invalidate the current *skb*\ **->hash**. It can be used after -+ * mangling on headers through direct packet access, in order to -+ * indicate that the hash is outdated and to trigger a -+ * recalculation the next time the kernel tries to access this -+ * hash or when the **bpf_get_hash_recalc**\ () helper is called. -+ * -+ * int bpf_get_numa_node_id(void) -+ * Description -+ * Return the id of the current NUMA node. The primary use case -+ * for this helper is the selection of sockets for the local NUMA -+ * node, when the program is attached to sockets using the -+ * **SO_ATTACH_REUSEPORT_EBPF** option (see also **socket(7)**), -+ * but the helper is also available to other eBPF program types, -+ * similarly to **bpf_get_smp_processor_id**\ (). -+ * Return -+ * The id of current NUMA node. -+ * -+ * int bpf_skb_change_head(struct sk_buff *skb, u32 len, u64 flags) -+ * Description -+ * Grows headroom of packet associated to *skb* and adjusts the -+ * offset of the MAC header accordingly, adding *len* bytes of -+ * space. It automatically extends and reallocates memory as -+ * required. -+ * -+ * This helper can be used on a layer 3 *skb* to push a MAC header -+ * for redirection into a layer 2 device. -+ * -+ * All values for *flags* are reserved for future usage, and must -+ * be left at zero. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_xdp_adjust_head(struct xdp_buff *xdp_md, int delta) -+ * Description -+ * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that -+ * it is possible to use a negative value for *delta*. This helper -+ * can be used to prepare the packet for pushing or popping -+ * headers. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr) -+ * Description -+ * Copy a NUL terminated string from an unsafe address -+ * *unsafe_ptr* to *dst*. The *size* should include the -+ * terminating NUL byte. In case the string length is smaller than -+ * *size*, the target is not padded with further NUL bytes. If the -+ * string length is larger than *size*, just *size*-1 bytes are -+ * copied and the last byte is set to NUL. -+ * -+ * On success, the length of the copied string is returned. This -+ * makes this helper useful in tracing programs for reading -+ * strings, and more importantly to get its length at runtime. See -+ * the following snippet: -+ * -+ * :: -+ * -+ * SEC("kprobe/sys_open") -+ * void bpf_sys_open(struct pt_regs *ctx) -+ * { -+ * char buf[PATHLEN]; // PATHLEN is defined to 256 -+ * int res = bpf_probe_read_str(buf, sizeof(buf), -+ * ctx->di); -+ * -+ * // Consume buf, for example push it to -+ * // userspace via bpf_perf_event_output(); we -+ * // can use res (the string length) as event -+ * // size, after checking its boundaries. -+ * } -+ * -+ * In comparison, using **bpf_probe_read()** helper here instead -+ * to read the string would require to estimate the length at -+ * compile time, and would often result in copying more memory -+ * than necessary. -+ * -+ * Another useful use case is when parsing individual process -+ * arguments or individual environment variables navigating -+ * *current*\ **->mm->arg_start** and *current*\ -+ * **->mm->env_start**: using this helper and the return value, -+ * one can quickly iterate at the right offset of the memory area. -+ * Return -+ * On success, the strictly positive length of the string, -+ * including the trailing NUL character. On error, a negative -+ * value. -+ * -+ * u64 bpf_get_socket_cookie(struct sk_buff *skb) -+ * Description -+ * If the **struct sk_buff** pointed by *skb* has a known socket, -+ * retrieve the cookie (generated by the kernel) of this socket. -+ * If no cookie has been set yet, generate a new cookie. Once -+ * generated, the socket cookie remains stable for the life of the -+ * socket. This helper can be useful for monitoring per socket -+ * networking traffic statistics as it provides a global socket -+ * identifier that can be assumed unique. -+ * Return -+ * A 8-byte long non-decreasing number on success, or 0 if the -+ * socket field is missing inside *skb*. -+ * -+ * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx) -+ * Description -+ * Equivalent to bpf_get_socket_cookie() helper that accepts -+ * *skb*, but gets socket from **struct bpf_sock_addr** context. -+ * Return -+ * A 8-byte long non-decreasing number. -+ * -+ * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx) -+ * Description -+ * Equivalent to bpf_get_socket_cookie() helper that accepts -+ * *skb*, but gets socket from **struct bpf_sock_ops** context. -+ * Return -+ * A 8-byte long non-decreasing number. -+ * -+ * u32 bpf_get_socket_uid(struct sk_buff *skb) -+ * Return -+ * The owner UID of the socket associated to *skb*. If the socket -+ * is **NULL**, or if it is not a full socket (i.e. if it is a -+ * time-wait or a request socket instead), **overflowuid** value -+ * is returned (note that **overflowuid** might also be the actual -+ * UID value for the socket). -+ * -+ * u32 bpf_set_hash(struct sk_buff *skb, u32 hash) -+ * Description -+ * Set the full hash for *skb* (set the field *skb*\ **->hash**) -+ * to value *hash*. -+ * Return -+ * 0 -+ * -+ * int bpf_setsockopt(struct bpf_sock_ops *bpf_socket, int level, int optname, char *optval, int optlen) -+ * Description -+ * Emulate a call to **setsockopt()** on the socket associated to -+ * *bpf_socket*, which must be a full socket. The *level* at -+ * which the option resides and the name *optname* of the option -+ * must be specified, see **setsockopt(2)** for more information. -+ * The option value of length *optlen* is pointed by *optval*. -+ * -+ * This helper actually implements a subset of **setsockopt()**. -+ * It supports the following *level*\ s: -+ * -+ * * **SOL_SOCKET**, which supports the following *optname*\ s: -+ * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**, -+ * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**. -+ * * **IPPROTO_TCP**, which supports the following *optname*\ s: -+ * **TCP_CONGESTION**, **TCP_BPF_IW**, -+ * **TCP_BPF_SNDCWND_CLAMP**. -+ * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. -+ * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_adjust_room(struct sk_buff *skb, s32 len_diff, u32 mode, u64 flags) -+ * Description -+ * Grow or shrink the room for data in the packet associated to -+ * *skb* by *len_diff*, and according to the selected *mode*. -+ * -+ * There are two supported modes at this time: -+ * -+ * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer -+ * (room space is added or removed below the layer 2 header). -+ * -+ * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer -+ * (room space is added or removed below the layer 3 header). -+ * -+ * The following flags are supported at this time: -+ * -+ * * **BPF_F_ADJ_ROOM_FIXED_GSO**: Do not adjust gso_size. -+ * Adjusting mss in this way is not allowed for datagrams. -+ * -+ * * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV4**, -+ * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV6**: -+ * Any new space is reserved to hold a tunnel header. -+ * Configure skb offsets and other fields accordingly. -+ * -+ * * **BPF_F_ADJ_ROOM_ENCAP_L4_GRE**, -+ * **BPF_F_ADJ_ROOM_ENCAP_L4_UDP**: -+ * Use with ENCAP_L3 flags to further specify the tunnel type. -+ * -+ * * **BPF_F_ADJ_ROOM_ENCAP_L2**\ (*len*): -+ * Use with ENCAP_L3/L4 flags to further specify the tunnel -+ * type; *len* is the length of the inner MAC header. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags) -+ * Description -+ * Redirect the packet to the endpoint referenced by *map* at -+ * index *key*. Depending on its type, this *map* can contain -+ * references to net devices (for forwarding packets through other -+ * ports), or to CPUs (for redirecting XDP frames to another CPU; -+ * but this is only implemented for native XDP (with driver -+ * support) as of this writing). -+ * -+ * The lower two bits of *flags* are used as the return code if -+ * the map lookup fails. This is so that the return value can be -+ * one of the XDP program return codes up to XDP_TX, as chosen by -+ * the caller. Any higher bits in the *flags* argument must be -+ * unset. -+ * -+ * When used to redirect packets to net devices, this helper -+ * provides a high performance increase over **bpf_redirect**\ (). -+ * This is due to various implementation details of the underlying -+ * mechanisms, one of which is the fact that **bpf_redirect_map**\ -+ * () tries to send packet as a "bulk" to the device. -+ * Return -+ * **XDP_REDIRECT** on success, or **XDP_ABORTED** on error. -+ * -+ * int bpf_sk_redirect_map(struct bpf_map *map, u32 key, u64 flags) -+ * Description -+ * Redirect the packet to the socket referenced by *map* (of type -+ * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and -+ * egress interfaces can be used for redirection. The -+ * **BPF_F_INGRESS** value in *flags* is used to make the -+ * distinction (ingress path is selected if the flag is present, -+ * egress path otherwise). This is the only flag supported for now. -+ * Return -+ * **SK_PASS** on success, or **SK_DROP** on error. -+ * -+ * int bpf_sock_map_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags) -+ * Description -+ * Add an entry to, or update a *map* referencing sockets. The -+ * *skops* is used as a new value for the entry associated to -+ * *key*. *flags* is one of: -+ * -+ * **BPF_NOEXIST** -+ * The entry for *key* must not exist in the map. -+ * **BPF_EXIST** -+ * The entry for *key* must already exist in the map. -+ * **BPF_ANY** -+ * No condition on the existence of the entry for *key*. -+ * -+ * If the *map* has eBPF programs (parser and verdict), those will -+ * be inherited by the socket being added. If the socket is -+ * already attached to eBPF programs, this results in an error. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_xdp_adjust_meta(struct xdp_buff *xdp_md, int delta) -+ * Description -+ * Adjust the address pointed by *xdp_md*\ **->data_meta** by -+ * *delta* (which can be positive or negative). Note that this -+ * operation modifies the address stored in *xdp_md*\ **->data**, -+ * so the latter must be loaded only after the helper has been -+ * called. -+ * -+ * The use of *xdp_md*\ **->data_meta** is optional and programs -+ * are not required to use it. The rationale is that when the -+ * packet is processed with XDP (e.g. as DoS filter), it is -+ * possible to push further meta data along with it before passing -+ * to the stack, and to give the guarantee that an ingress eBPF -+ * program attached as a TC classifier on the same device can pick -+ * this up for further post-processing. Since TC works with socket -+ * buffers, it remains possible to set from XDP the **mark** or -+ * **priority** pointers, or other pointers for the socket buffer. -+ * Having this scratch space generic and programmable allows for -+ * more flexibility as the user is free to store whatever meta -+ * data they need. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_perf_event_read_value(struct bpf_map *map, u64 flags, struct bpf_perf_event_value *buf, u32 buf_size) -+ * Description -+ * Read the value of a perf event counter, and store it into *buf* -+ * of size *buf_size*. This helper relies on a *map* of type -+ * **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. The nature of the perf event -+ * counter is selected when *map* is updated with perf event file -+ * descriptors. The *map* is an array whose size is the number of -+ * available CPUs, and each cell contains a value relative to one -+ * CPU. The value to retrieve is indicated by *flags*, that -+ * contains the index of the CPU to look up, masked with -+ * **BPF_F_INDEX_MASK**. Alternatively, *flags* can be set to -+ * **BPF_F_CURRENT_CPU** to indicate that the value for the -+ * current CPU should be retrieved. -+ * -+ * This helper behaves in a way close to -+ * **bpf_perf_event_read**\ () helper, save that instead of -+ * just returning the value observed, it fills the *buf* -+ * structure. This allows for additional data to be retrieved: in -+ * particular, the enabled and running times (in *buf*\ -+ * **->enabled** and *buf*\ **->running**, respectively) are -+ * copied. In general, **bpf_perf_event_read_value**\ () is -+ * recommended over **bpf_perf_event_read**\ (), which has some -+ * ABI issues and provides fewer functionalities. -+ * -+ * These values are interesting, because hardware PMU (Performance -+ * Monitoring Unit) counters are limited resources. When there are -+ * more PMU based perf events opened than available counters, -+ * kernel will multiplex these events so each event gets certain -+ * percentage (but not all) of the PMU time. In case that -+ * multiplexing happens, the number of samples or counter value -+ * will not reflect the case compared to when no multiplexing -+ * occurs. This makes comparison between different runs difficult. -+ * Typically, the counter value should be normalized before -+ * comparing to other experiments. The usual normalization is done -+ * as follows. -+ * -+ * :: -+ * -+ * normalized_counter = counter * t_enabled / t_running -+ * -+ * Where t_enabled is the time enabled for event and t_running is -+ * the time running for event since last normalization. The -+ * enabled and running times are accumulated since the perf event -+ * open. To achieve scaling factor between two invocations of an -+ * eBPF program, users can can use CPU id as the key (which is -+ * typical for perf array usage model) to remember the previous -+ * value and do the calculation inside the eBPF program. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size) -+ * Description -+ * For en eBPF program attached to a perf event, retrieve the -+ * value of the event counter associated to *ctx* and store it in -+ * the structure pointed by *buf* and of size *buf_size*. Enabled -+ * and running times are also stored in the structure (see -+ * description of helper **bpf_perf_event_read_value**\ () for -+ * more details). -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_getsockopt(struct bpf_sock_ops *bpf_socket, int level, int optname, char *optval, int optlen) -+ * Description -+ * Emulate a call to **getsockopt()** on the socket associated to -+ * *bpf_socket*, which must be a full socket. The *level* at -+ * which the option resides and the name *optname* of the option -+ * must be specified, see **getsockopt(2)** for more information. -+ * The retrieved value is stored in the structure pointed by -+ * *opval* and of length *optlen*. -+ * -+ * This helper actually implements a subset of **getsockopt()**. -+ * It supports the following *level*\ s: -+ * -+ * * **IPPROTO_TCP**, which supports *optname* -+ * **TCP_CONGESTION**. -+ * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. -+ * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_override_return(struct pt_regs *regs, u64 rc) -+ * Description -+ * Used for error injection, this helper uses kprobes to override -+ * the return value of the probed function, and to set it to *rc*. -+ * The first argument is the context *regs* on which the kprobe -+ * works. -+ * -+ * This helper works by setting setting the PC (program counter) -+ * to an override function which is run in place of the original -+ * probed function. This means the probed function is not run at -+ * all. The replacement function just returns with the required -+ * value. -+ * -+ * This helper has security implications, and thus is subject to -+ * restrictions. It is only available if the kernel was compiled -+ * with the **CONFIG_BPF_KPROBE_OVERRIDE** configuration -+ * option, and in this case it only works on functions tagged with -+ * **ALLOW_ERROR_INJECTION** in the kernel code. -+ * -+ * Also, the helper is only available for the architectures having -+ * the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing, -+ * x86 architecture is the only one to support this feature. -+ * Return -+ * 0 -+ * -+ * int bpf_sock_ops_cb_flags_set(struct bpf_sock_ops *bpf_sock, int argval) -+ * Description -+ * Attempt to set the value of the **bpf_sock_ops_cb_flags** field -+ * for the full TCP socket associated to *bpf_sock_ops* to -+ * *argval*. -+ * -+ * The primary use of this field is to determine if there should -+ * be calls to eBPF programs of type -+ * **BPF_PROG_TYPE_SOCK_OPS** at various points in the TCP -+ * code. A program of the same type can change its value, per -+ * connection and as necessary, when the connection is -+ * established. This field is directly accessible for reading, but -+ * this helper must be used for updates in order to return an -+ * error if an eBPF program tries to set a callback that is not -+ * supported in the current kernel. -+ * -+ * *argval* is a flag array which can combine these flags: -+ * -+ * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out) -+ * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission) -+ * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change) -+ * * **BPF_SOCK_OPS_RTT_CB_FLAG** (every RTT) -+ * -+ * Therefore, this function can be used to clear a callback flag by -+ * setting the appropriate bit to zero. e.g. to disable the RTO -+ * callback: -+ * -+ * **bpf_sock_ops_cb_flags_set(bpf_sock,** -+ * **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)** -+ * -+ * Here are some examples of where one could call such eBPF -+ * program: -+ * -+ * * When RTO fires. -+ * * When a packet is retransmitted. -+ * * When the connection terminates. -+ * * When a packet is sent. -+ * * When a packet is received. -+ * Return -+ * Code **-EINVAL** if the socket is not a full TCP socket; -+ * otherwise, a positive number containing the bits that could not -+ * be set is returned (which comes down to 0 if all bits were set -+ * as required). -+ * -+ * int bpf_msg_redirect_map(struct sk_msg_buff *msg, struct bpf_map *map, u32 key, u64 flags) -+ * Description -+ * This helper is used in programs implementing policies at the -+ * socket level. If the message *msg* is allowed to pass (i.e. if -+ * the verdict eBPF program returns **SK_PASS**), redirect it to -+ * the socket referenced by *map* (of type -+ * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and -+ * egress interfaces can be used for redirection. The -+ * **BPF_F_INGRESS** value in *flags* is used to make the -+ * distinction (ingress path is selected if the flag is present, -+ * egress path otherwise). This is the only flag supported for now. -+ * Return -+ * **SK_PASS** on success, or **SK_DROP** on error. -+ * -+ * int bpf_msg_apply_bytes(struct sk_msg_buff *msg, u32 bytes) -+ * Description -+ * For socket policies, apply the verdict of the eBPF program to -+ * the next *bytes* (number of bytes) of message *msg*. -+ * -+ * For example, this helper can be used in the following cases: -+ * -+ * * A single **sendmsg**\ () or **sendfile**\ () system call -+ * contains multiple logical messages that the eBPF program is -+ * supposed to read and for which it should apply a verdict. -+ * * An eBPF program only cares to read the first *bytes* of a -+ * *msg*. If the message has a large payload, then setting up -+ * and calling the eBPF program repeatedly for all bytes, even -+ * though the verdict is already known, would create unnecessary -+ * overhead. -+ * -+ * When called from within an eBPF program, the helper sets a -+ * counter internal to the BPF infrastructure, that is used to -+ * apply the last verdict to the next *bytes*. If *bytes* is -+ * smaller than the current data being processed from a -+ * **sendmsg**\ () or **sendfile**\ () system call, the first -+ * *bytes* will be sent and the eBPF program will be re-run with -+ * the pointer for start of data pointing to byte number *bytes* -+ * **+ 1**. If *bytes* is larger than the current data being -+ * processed, then the eBPF verdict will be applied to multiple -+ * **sendmsg**\ () or **sendfile**\ () calls until *bytes* are -+ * consumed. -+ * -+ * Note that if a socket closes with the internal counter holding -+ * a non-zero value, this is not a problem because data is not -+ * being buffered for *bytes* and is sent as it is received. -+ * Return -+ * 0 -+ * -+ * int bpf_msg_cork_bytes(struct sk_msg_buff *msg, u32 bytes) -+ * Description -+ * For socket policies, prevent the execution of the verdict eBPF -+ * program for message *msg* until *bytes* (byte number) have been -+ * accumulated. -+ * -+ * This can be used when one needs a specific number of bytes -+ * before a verdict can be assigned, even if the data spans -+ * multiple **sendmsg**\ () or **sendfile**\ () calls. The extreme -+ * case would be a user calling **sendmsg**\ () repeatedly with -+ * 1-byte long message segments. Obviously, this is bad for -+ * performance, but it is still valid. If the eBPF program needs -+ * *bytes* bytes to validate a header, this helper can be used to -+ * prevent the eBPF program to be called again until *bytes* have -+ * been accumulated. -+ * Return -+ * 0 -+ * -+ * int bpf_msg_pull_data(struct sk_msg_buff *msg, u32 start, u32 end, u64 flags) -+ * Description -+ * For socket policies, pull in non-linear data from user space -+ * for *msg* and set pointers *msg*\ **->data** and *msg*\ -+ * **->data_end** to *start* and *end* bytes offsets into *msg*, -+ * respectively. -+ * -+ * If a program of type **BPF_PROG_TYPE_SK_MSG** is run on a -+ * *msg* it can only parse data that the (**data**, **data_end**) -+ * pointers have already consumed. For **sendmsg**\ () hooks this -+ * is likely the first scatterlist element. But for calls relying -+ * on the **sendpage** handler (e.g. **sendfile**\ ()) this will -+ * be the range (**0**, **0**) because the data is shared with -+ * user space and by default the objective is to avoid allowing -+ * user space to modify data while (or after) eBPF verdict is -+ * being decided. This helper can be used to pull in data and to -+ * set the start and end pointer to given values. Data will be -+ * copied if necessary (i.e. if data was not linear and if start -+ * and end pointers do not point to the same chunk). -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * -+ * All values for *flags* are reserved for future usage, and must -+ * be left at zero. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_bind(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len) -+ * Description -+ * Bind the socket associated to *ctx* to the address pointed by -+ * *addr*, of length *addr_len*. This allows for making outgoing -+ * connection from the desired IP address, which can be useful for -+ * example when all processes inside a cgroup should use one -+ * single IP address on a host that has multiple IP configured. -+ * -+ * This helper works for IPv4 and IPv6, TCP and UDP sockets. The -+ * domain (*addr*\ **->sa_family**) must be **AF_INET** (or -+ * **AF_INET6**). Looking for a free port to bind to can be -+ * expensive, therefore binding to port is not permitted by the -+ * helper: *addr*\ **->sin_port** (or **sin6_port**, respectively) -+ * must be set to zero. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_xdp_adjust_tail(struct xdp_buff *xdp_md, int delta) -+ * Description -+ * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is -+ * only possible to shrink the packet as of this writing, -+ * therefore *delta* must be a negative integer. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_skb_get_xfrm_state(struct sk_buff *skb, u32 index, struct bpf_xfrm_state *xfrm_state, u32 size, u64 flags) -+ * Description -+ * Retrieve the XFRM state (IP transform framework, see also -+ * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*. -+ * -+ * The retrieved value is stored in the **struct bpf_xfrm_state** -+ * pointed by *xfrm_state* and of length *size*. -+ * -+ * All values for *flags* are reserved for future usage, and must -+ * be left at zero. -+ * -+ * This helper is available only if the kernel was compiled with -+ * **CONFIG_XFRM** configuration option. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_get_stack(struct pt_regs *regs, void *buf, u32 size, u64 flags) -+ * Description -+ * Return a user or a kernel stack in bpf program provided buffer. -+ * To achieve this, the helper needs *ctx*, which is a pointer -+ * to the context on which the tracing program is executed. -+ * To store the stacktrace, the bpf program provides *buf* with -+ * a nonnegative *size*. -+ * -+ * The last argument, *flags*, holds the number of stack frames to -+ * skip (from 0 to 255), masked with -+ * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set -+ * the following flags: -+ * -+ * **BPF_F_USER_STACK** -+ * Collect a user space stack instead of a kernel stack. -+ * **BPF_F_USER_BUILD_ID** -+ * Collect buildid+offset instead of ips for user stack, -+ * only valid if **BPF_F_USER_STACK** is also specified. -+ * -+ * **bpf_get_stack**\ () can collect up to -+ * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject -+ * to sufficient large buffer size. Note that -+ * this limit can be controlled with the **sysctl** program, and -+ * that it should be manually increased in order to profile long -+ * user stacks (such as stacks for Java programs). To do so, use: -+ * -+ * :: -+ * -+ * # sysctl kernel.perf_event_max_stack= -+ * Return -+ * A non-negative value equal to or less than *size* on success, -+ * or a negative error in case of failure. -+ * -+ * int bpf_skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header) -+ * Description -+ * This helper is similar to **bpf_skb_load_bytes**\ () in that -+ * it provides an easy way to load *len* bytes from *offset* -+ * from the packet associated to *skb*, into the buffer pointed -+ * by *to*. The difference to **bpf_skb_load_bytes**\ () is that -+ * a fifth argument *start_header* exists in order to select a -+ * base offset to start from. *start_header* can be one of: -+ * -+ * **BPF_HDR_START_MAC** -+ * Base offset to load data from is *skb*'s mac header. -+ * **BPF_HDR_START_NET** -+ * Base offset to load data from is *skb*'s network header. -+ * -+ * In general, "direct packet access" is the preferred method to -+ * access packet data, however, this helper is in particular useful -+ * in socket filters where *skb*\ **->data** does not always point -+ * to the start of the mac header and where "direct packet access" -+ * is not available. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_fib_lookup(void *ctx, struct bpf_fib_lookup *params, int plen, u32 flags) -+ * Description -+ * Do FIB lookup in kernel tables using parameters in *params*. -+ * If lookup is successful and result shows packet is to be -+ * forwarded, the neighbor tables are searched for the nexthop. -+ * If successful (ie., FIB lookup shows forwarding and nexthop -+ * is resolved), the nexthop address is returned in ipv4_dst -+ * or ipv6_dst based on family, smac is set to mac address of -+ * egress device, dmac is set to nexthop mac address, rt_metric -+ * is set to metric from route (IPv4/IPv6 only), and ifindex -+ * is set to the device index of the nexthop from the FIB lookup. -+ * -+ * *plen* argument is the size of the passed in struct. -+ * *flags* argument can be a combination of one or more of the -+ * following values: -+ * -+ * **BPF_FIB_LOOKUP_DIRECT** -+ * Do a direct table lookup vs full lookup using FIB -+ * rules. -+ * **BPF_FIB_LOOKUP_OUTPUT** -+ * Perform lookup from an egress perspective (default is -+ * ingress). -+ * -+ * *ctx* is either **struct xdp_md** for XDP programs or -+ * **struct sk_buff** tc cls_act programs. -+ * Return -+ * * < 0 if any input argument is invalid -+ * * 0 on success (packet is forwarded, nexthop neighbor exists) -+ * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the -+ * packet is not forwarded or needs assist from full stack -+ * -+ * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags) -+ * Description -+ * Add an entry to, or update a sockhash *map* referencing sockets. -+ * The *skops* is used as a new value for the entry associated to -+ * *key*. *flags* is one of: -+ * -+ * **BPF_NOEXIST** -+ * The entry for *key* must not exist in the map. -+ * **BPF_EXIST** -+ * The entry for *key* must already exist in the map. -+ * **BPF_ANY** -+ * No condition on the existence of the entry for *key*. -+ * -+ * If the *map* has eBPF programs (parser and verdict), those will -+ * be inherited by the socket being added. If the socket is -+ * already attached to eBPF programs, this results in an error. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_msg_redirect_hash(struct sk_msg_buff *msg, struct bpf_map *map, void *key, u64 flags) -+ * Description -+ * This helper is used in programs implementing policies at the -+ * socket level. If the message *msg* is allowed to pass (i.e. if -+ * the verdict eBPF program returns **SK_PASS**), redirect it to -+ * the socket referenced by *map* (of type -+ * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and -+ * egress interfaces can be used for redirection. The -+ * **BPF_F_INGRESS** value in *flags* is used to make the -+ * distinction (ingress path is selected if the flag is present, -+ * egress path otherwise). This is the only flag supported for now. -+ * Return -+ * **SK_PASS** on success, or **SK_DROP** on error. -+ * -+ * int bpf_sk_redirect_hash(struct sk_buff *skb, struct bpf_map *map, void *key, u64 flags) -+ * Description -+ * This helper is used in programs implementing policies at the -+ * skb socket level. If the sk_buff *skb* is allowed to pass (i.e. -+ * if the verdeict eBPF program returns **SK_PASS**), redirect it -+ * to the socket referenced by *map* (of type -+ * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and -+ * egress interfaces can be used for redirection. The -+ * **BPF_F_INGRESS** value in *flags* is used to make the -+ * distinction (ingress path is selected if the flag is present, -+ * egress otherwise). This is the only flag supported for now. -+ * Return -+ * **SK_PASS** on success, or **SK_DROP** on error. -+ * -+ * int bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len) -+ * Description -+ * Encapsulate the packet associated to *skb* within a Layer 3 -+ * protocol header. This header is provided in the buffer at -+ * address *hdr*, with *len* its size in bytes. *type* indicates -+ * the protocol of the header and can be one of: -+ * -+ * **BPF_LWT_ENCAP_SEG6** -+ * IPv6 encapsulation with Segment Routing Header -+ * (**struct ipv6_sr_hdr**). *hdr* only contains the SRH, -+ * the IPv6 header is computed by the kernel. -+ * **BPF_LWT_ENCAP_SEG6_INLINE** -+ * Only works if *skb* contains an IPv6 packet. Insert a -+ * Segment Routing Header (**struct ipv6_sr_hdr**) inside -+ * the IPv6 header. -+ * **BPF_LWT_ENCAP_IP** -+ * IP encapsulation (GRE/GUE/IPIP/etc). The outer header -+ * must be IPv4 or IPv6, followed by zero or more -+ * additional headers, up to **LWT_BPF_MAX_HEADROOM** -+ * total bytes in all prepended headers. Please note that -+ * if **skb_is_gso**\ (*skb*) is true, no more than two -+ * headers can be prepended, and the inner header, if -+ * present, should be either GRE or UDP/GUE. -+ * -+ * **BPF_LWT_ENCAP_SEG6**\ \* types can be called by BPF programs -+ * of type **BPF_PROG_TYPE_LWT_IN**; **BPF_LWT_ENCAP_IP** type can -+ * be called by bpf programs of types **BPF_PROG_TYPE_LWT_IN** and -+ * **BPF_PROG_TYPE_LWT_XMIT**. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len) -+ * Description -+ * Store *len* bytes from address *from* into the packet -+ * associated to *skb*, at *offset*. Only the flags, tag and TLVs -+ * inside the outermost IPv6 Segment Routing Header can be -+ * modified through this helper. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta) -+ * Description -+ * Adjust the size allocated to TLVs in the outermost IPv6 -+ * Segment Routing Header contained in the packet associated to -+ * *skb*, at position *offset* by *delta* bytes. Only offsets -+ * after the segments are accepted. *delta* can be as well -+ * positive (growing) as negative (shrinking). -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len) -+ * Description -+ * Apply an IPv6 Segment Routing action of type *action* to the -+ * packet associated to *skb*. Each action takes a parameter -+ * contained at address *param*, and of length *param_len* bytes. -+ * *action* can be one of: -+ * -+ * **SEG6_LOCAL_ACTION_END_X** -+ * End.X action: Endpoint with Layer-3 cross-connect. -+ * Type of *param*: **struct in6_addr**. -+ * **SEG6_LOCAL_ACTION_END_T** -+ * End.T action: Endpoint with specific IPv6 table lookup. -+ * Type of *param*: **int**. -+ * **SEG6_LOCAL_ACTION_END_B6** -+ * End.B6 action: Endpoint bound to an SRv6 policy. -+ * Type of *param*: **struct ipv6_sr_hdr**. -+ * **SEG6_LOCAL_ACTION_END_B6_ENCAP** -+ * End.B6.Encap action: Endpoint bound to an SRv6 -+ * encapsulation policy. -+ * Type of *param*: **struct ipv6_sr_hdr**. -+ * -+ * A call to this helper is susceptible to change the underlying -+ * packet buffer. Therefore, at load time, all checks on pointers -+ * previously done by the verifier are invalidated and must be -+ * performed again, if the helper is used in combination with -+ * direct packet access. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_rc_repeat(void *ctx) -+ * Description -+ * This helper is used in programs implementing IR decoding, to -+ * report a successfully decoded repeat key message. This delays -+ * the generation of a key up event for previously generated -+ * key down event. -+ * -+ * Some IR protocols like NEC have a special IR message for -+ * repeating last button, for when a button is held down. -+ * -+ * The *ctx* should point to the lirc sample as passed into -+ * the program. -+ * -+ * This helper is only available is the kernel was compiled with -+ * the **CONFIG_BPF_LIRC_MODE2** configuration option set to -+ * "**y**". -+ * Return -+ * 0 -+ * -+ * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle) -+ * Description -+ * This helper is used in programs implementing IR decoding, to -+ * report a successfully decoded key press with *scancode*, -+ * *toggle* value in the given *protocol*. The scancode will be -+ * translated to a keycode using the rc keymap, and reported as -+ * an input key down event. After a period a key up event is -+ * generated. This period can be extended by calling either -+ * **bpf_rc_keydown**\ () again with the same values, or calling -+ * **bpf_rc_repeat**\ (). -+ * -+ * Some protocols include a toggle bit, in case the button was -+ * released and pressed again between consecutive scancodes. -+ * -+ * The *ctx* should point to the lirc sample as passed into -+ * the program. -+ * -+ * The *protocol* is the decoded protocol number (see -+ * **enum rc_proto** for some predefined values). -+ * -+ * This helper is only available is the kernel was compiled with -+ * the **CONFIG_BPF_LIRC_MODE2** configuration option set to -+ * "**y**". -+ * Return -+ * 0 -+ * -+ * u64 bpf_skb_cgroup_id(struct sk_buff *skb) -+ * Description -+ * Return the cgroup v2 id of the socket associated with the *skb*. -+ * This is roughly similar to the **bpf_get_cgroup_classid**\ () -+ * helper for cgroup v1 by providing a tag resp. identifier that -+ * can be matched on or used for map lookups e.g. to implement -+ * policy. The cgroup v2 id of a given path in the hierarchy is -+ * exposed in user space through the f_handle API in order to get -+ * to the same 64-bit id. -+ * -+ * This helper can be used on TC egress path, but not on ingress, -+ * and is available only if the kernel was compiled with the -+ * **CONFIG_SOCK_CGROUP_DATA** configuration option. -+ * Return -+ * The id is returned or 0 in case the id could not be retrieved. -+ * -+ * u64 bpf_get_current_cgroup_id(void) -+ * Return -+ * A 64-bit integer containing the current cgroup id based -+ * on the cgroup within which the current task is running. -+ * -+ * void *bpf_get_local_storage(void *map, u64 flags) -+ * Description -+ * Get the pointer to the local storage area. -+ * The type and the size of the local storage is defined -+ * by the *map* argument. -+ * The *flags* meaning is specific for each map type, -+ * and has to be 0 for cgroup local storage. -+ * -+ * Depending on the BPF program type, a local storage area -+ * can be shared between multiple instances of the BPF program, -+ * running simultaneously. -+ * -+ * A user should care about the synchronization by himself. -+ * For example, by using the **BPF_STX_XADD** instruction to alter -+ * the shared data. -+ * Return -+ * A pointer to the local storage area. -+ * -+ * int bpf_sk_select_reuseport(struct sk_reuseport_md *reuse, struct bpf_map *map, void *key, u64 flags) -+ * Description -+ * Select a **SO_REUSEPORT** socket from a -+ * **BPF_MAP_TYPE_REUSEPORT_ARRAY** *map*. -+ * It checks the selected socket is matching the incoming -+ * request in the socket buffer. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level) -+ * Description -+ * Return id of cgroup v2 that is ancestor of cgroup associated -+ * with the *skb* at the *ancestor_level*. The root cgroup is at -+ * *ancestor_level* zero and each step down the hierarchy -+ * increments the level. If *ancestor_level* == level of cgroup -+ * associated with *skb*, then return value will be same as that -+ * of **bpf_skb_cgroup_id**\ (). -+ * -+ * The helper is useful to implement policies based on cgroups -+ * that are upper in hierarchy than immediate cgroup associated -+ * with *skb*. -+ * -+ * The format of returned id and helper limitations are same as in -+ * **bpf_skb_cgroup_id**\ (). -+ * Return -+ * The id is returned or 0 in case the id could not be retrieved. -+ * -+ * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) -+ * Description -+ * Look for TCP socket matching *tuple*, optionally in a child -+ * network namespace *netns*. The return value must be checked, -+ * and if non-**NULL**, released via **bpf_sk_release**\ (). -+ * -+ * The *ctx* should point to the context of the program, such as -+ * the skb or socket (depending on the hook in use). This is used -+ * to determine the base network namespace for the lookup. -+ * -+ * *tuple_size* must be one of: -+ * -+ * **sizeof**\ (*tuple*\ **->ipv4**) -+ * Look for an IPv4 socket. -+ * **sizeof**\ (*tuple*\ **->ipv6**) -+ * Look for an IPv6 socket. -+ * -+ * If the *netns* is a negative signed 32-bit integer, then the -+ * socket lookup table in the netns associated with the *ctx* will -+ * will be used. For the TC hooks, this is the netns of the device -+ * in the skb. For socket hooks, this is the netns of the socket. -+ * If *netns* is any other signed 32-bit value greater than or -+ * equal to zero then it specifies the ID of the netns relative to -+ * the netns associated with the *ctx*. *netns* values beyond the -+ * range of 32-bit integers are reserved for future use. -+ * -+ * All values for *flags* are reserved for future usage, and must -+ * be left at zero. -+ * -+ * This helper is available only if the kernel was compiled with -+ * **CONFIG_NET** configuration option. -+ * Return -+ * Pointer to **struct bpf_sock**, or **NULL** in case of failure. -+ * For sockets with reuseport option, the **struct bpf_sock** -+ * result is from *reuse*\ **->socks**\ [] using the hash of the -+ * tuple. -+ * -+ * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) -+ * Description -+ * Look for UDP socket matching *tuple*, optionally in a child -+ * network namespace *netns*. The return value must be checked, -+ * and if non-**NULL**, released via **bpf_sk_release**\ (). -+ * -+ * The *ctx* should point to the context of the program, such as -+ * the skb or socket (depending on the hook in use). This is used -+ * to determine the base network namespace for the lookup. -+ * -+ * *tuple_size* must be one of: -+ * -+ * **sizeof**\ (*tuple*\ **->ipv4**) -+ * Look for an IPv4 socket. -+ * **sizeof**\ (*tuple*\ **->ipv6**) -+ * Look for an IPv6 socket. -+ * -+ * If the *netns* is a negative signed 32-bit integer, then the -+ * socket lookup table in the netns associated with the *ctx* will -+ * will be used. For the TC hooks, this is the netns of the device -+ * in the skb. For socket hooks, this is the netns of the socket. -+ * If *netns* is any other signed 32-bit value greater than or -+ * equal to zero then it specifies the ID of the netns relative to -+ * the netns associated with the *ctx*. *netns* values beyond the -+ * range of 32-bit integers are reserved for future use. -+ * -+ * All values for *flags* are reserved for future usage, and must -+ * be left at zero. -+ * -+ * This helper is available only if the kernel was compiled with -+ * **CONFIG_NET** configuration option. -+ * Return -+ * Pointer to **struct bpf_sock**, or **NULL** in case of failure. -+ * For sockets with reuseport option, the **struct bpf_sock** -+ * result is from *reuse*\ **->socks**\ [] using the hash of the -+ * tuple. -+ * -+ * int bpf_sk_release(struct bpf_sock *sock) -+ * Description -+ * Release the reference held by *sock*. *sock* must be a -+ * non-**NULL** pointer that was returned from -+ * **bpf_sk_lookup_xxx**\ (). -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags) -+ * Description -+ * Push an element *value* in *map*. *flags* is one of: -+ * -+ * **BPF_EXIST** -+ * If the queue/stack is full, the oldest element is -+ * removed to make room for this. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_map_pop_elem(struct bpf_map *map, void *value) -+ * Description -+ * Pop an element from *map*. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_map_peek_elem(struct bpf_map *map, void *value) -+ * Description -+ * Get an element from *map* without removing it. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_msg_push_data(struct sk_buff *skb, u32 start, u32 len, u64 flags) -+ * Description -+ * For socket policies, insert *len* bytes into *msg* at offset -+ * *start*. -+ * -+ * If a program of type **BPF_PROG_TYPE_SK_MSG** is run on a -+ * *msg* it may want to insert metadata or options into the *msg*. -+ * This can later be read and used by any of the lower layer BPF -+ * hooks. -+ * -+ * This helper may fail if under memory pressure (a malloc -+ * fails) in these cases BPF programs will get an appropriate -+ * error and BPF programs will need to handle them. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_msg_pop_data(struct sk_msg_buff *msg, u32 start, u32 pop, u64 flags) -+ * Description -+ * Will remove *pop* bytes from a *msg* starting at byte *start*. -+ * This may result in **ENOMEM** errors under certain situations if -+ * an allocation and copy are required due to a full ring buffer. -+ * However, the helper will try to avoid doing the allocation -+ * if possible. Other errors can occur if input parameters are -+ * invalid either due to *start* byte not being valid part of *msg* -+ * payload and/or *pop* value being to large. -+ * Return -+ * 0 on success, or a negative error in case of failure. -+ * -+ * int bpf_rc_pointer_rel(void *ctx, s32 rel_x, s32 rel_y) -+ * Description -+ * This helper is used in programs implementing IR decoding, to -+ * report a successfully decoded pointer movement. -+ * -+ * The *ctx* should point to the lirc sample as passed into -+ * the program. -+ * -+ * This helper is only available is the kernel was compiled with -+ * the **CONFIG_BPF_LIRC_MODE2** configuration option set to -+ * "**y**". -+ * Return -+ * 0 -+ * -+ * int bpf_spin_lock(struct bpf_spin_lock *lock) -+ * Description -+ * Acquire a spinlock represented by the pointer *lock*, which is -+ * stored as part of a value of a map. Taking the lock allows to -+ * safely update the rest of the fields in that value. The -+ * spinlock can (and must) later be released with a call to -+ * **bpf_spin_unlock**\ (\ *lock*\ ). -+ * -+ * Spinlocks in BPF programs come with a number of restrictions -+ * and constraints: -+ * -+ * * **bpf_spin_lock** objects are only allowed inside maps of -+ * types **BPF_MAP_TYPE_HASH** and **BPF_MAP_TYPE_ARRAY** (this -+ * list could be extended in the future). -+ * * BTF description of the map is mandatory. -+ * * The BPF program can take ONE lock at a time, since taking two -+ * or more could cause dead locks. -+ * * Only one **struct bpf_spin_lock** is allowed per map element. -+ * * When the lock is taken, calls (either BPF to BPF or helpers) -+ * are not allowed. -+ * * The **BPF_LD_ABS** and **BPF_LD_IND** instructions are not -+ * allowed inside a spinlock-ed region. -+ * * The BPF program MUST call **bpf_spin_unlock**\ () to release -+ * the lock, on all execution paths, before it returns. -+ * * The BPF program can access **struct bpf_spin_lock** only via -+ * the **bpf_spin_lock**\ () and **bpf_spin_unlock**\ () -+ * helpers. Loading or storing data into the **struct -+ * bpf_spin_lock** *lock*\ **;** field of a map is not allowed. -+ * * To use the **bpf_spin_lock**\ () helper, the BTF description -+ * of the map value must be a struct and have **struct -+ * bpf_spin_lock** *anyname*\ **;** field at the top level. -+ * Nested lock inside another struct is not allowed. -+ * * The **struct bpf_spin_lock** *lock* field in a map value must -+ * be aligned on a multiple of 4 bytes in that value. -+ * * Syscall with command **BPF_MAP_LOOKUP_ELEM** does not copy -+ * the **bpf_spin_lock** field to user space. -+ * * Syscall with command **BPF_MAP_UPDATE_ELEM**, or update from -+ * a BPF program, do not update the **bpf_spin_lock** field. -+ * * **bpf_spin_lock** cannot be on the stack or inside a -+ * networking packet (it can only be inside of a map values). -+ * * **bpf_spin_lock** is available to root only. -+ * * Tracing programs and socket filter programs cannot use -+ * **bpf_spin_lock**\ () due to insufficient preemption checks -+ * (but this may change in the future). -+ * * **bpf_spin_lock** is not allowed in inner maps of map-in-map. -+ * Return -+ * 0 -+ * -+ * int bpf_spin_unlock(struct bpf_spin_lock *lock) -+ * Description -+ * Release the *lock* previously locked by a call to -+ * **bpf_spin_lock**\ (\ *lock*\ ). -+ * Return -+ * 0 -+ * -+ * struct bpf_sock *bpf_sk_fullsock(struct bpf_sock *sk) -+ * Description -+ * This helper gets a **struct bpf_sock** pointer such -+ * that all the fields in this **bpf_sock** can be accessed. -+ * Return -+ * A **struct bpf_sock** pointer on success, or **NULL** in -+ * case of failure. -+ * -+ * struct bpf_tcp_sock *bpf_tcp_sock(struct bpf_sock *sk) -+ * Description -+ * This helper gets a **struct bpf_tcp_sock** pointer from a -+ * **struct bpf_sock** pointer. -+ * Return -+ * A **struct bpf_tcp_sock** pointer on success, or **NULL** in -+ * case of failure. -+ * -+ * int bpf_skb_ecn_set_ce(struct sk_buf *skb) -+ * Description -+ * Set ECN (Explicit Congestion Notification) field of IP header -+ * to **CE** (Congestion Encountered) if current value is **ECT** -+ * (ECN Capable Transport). Otherwise, do nothing. Works with IPv6 -+ * and IPv4. -+ * Return -+ * 1 if the **CE** flag is set (either by the current helper call -+ * or because it was already present), 0 if it is not set. -+ * -+ * struct bpf_sock *bpf_get_listener_sock(struct bpf_sock *sk) -+ * Description -+ * Return a **struct bpf_sock** pointer in **TCP_LISTEN** state. -+ * **bpf_sk_release**\ () is unnecessary and not allowed. -+ * Return -+ * A **struct bpf_sock** pointer on success, or **NULL** in -+ * case of failure. -+ * -+ * struct bpf_sock *bpf_skc_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) -+ * Description -+ * Look for TCP socket matching *tuple*, optionally in a child -+ * network namespace *netns*. The return value must be checked, -+ * and if non-**NULL**, released via **bpf_sk_release**\ (). -+ * -+ * This function is identical to **bpf_sk_lookup_tcp**\ (), except -+ * that it also returns timewait or request sockets. Use -+ * **bpf_sk_fullsock**\ () or **bpf_tcp_sock**\ () to access the -+ * full structure. -+ * -+ * This helper is available only if the kernel was compiled with -+ * **CONFIG_NET** configuration option. -+ * Return -+ * Pointer to **struct bpf_sock**, or **NULL** in case of failure. -+ * For sockets with reuseport option, the **struct bpf_sock** -+ * result is from *reuse*\ **->socks**\ [] using the hash of the -+ * tuple. -+ * -+ * int bpf_tcp_check_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) -+ * Description -+ * Check whether *iph* and *th* contain a valid SYN cookie ACK for -+ * the listening socket in *sk*. -+ * -+ * *iph* points to the start of the IPv4 or IPv6 header, while -+ * *iph_len* contains **sizeof**\ (**struct iphdr**) or -+ * **sizeof**\ (**struct ip6hdr**). -+ * -+ * *th* points to the start of the TCP header, while *th_len* -+ * contains **sizeof**\ (**struct tcphdr**). -+ * -+ * Return -+ * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative -+ * error otherwise. -+ * -+ * int bpf_sysctl_get_name(struct bpf_sysctl *ctx, char *buf, size_t buf_len, u64 flags) -+ * Description -+ * Get name of sysctl in /proc/sys/ and copy it into provided by -+ * program buffer *buf* of size *buf_len*. -+ * -+ * The buffer is always NUL terminated, unless it's zero-sized. -+ * -+ * If *flags* is zero, full name (e.g. "net/ipv4/tcp_mem") is -+ * copied. Use **BPF_F_SYSCTL_BASE_NAME** flag to copy base name -+ * only (e.g. "tcp_mem"). -+ * Return -+ * Number of character copied (not including the trailing NUL). -+ * -+ * **-E2BIG** if the buffer wasn't big enough (*buf* will contain -+ * truncated name in this case). -+ * -+ * int bpf_sysctl_get_current_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len) -+ * Description -+ * Get current value of sysctl as it is presented in /proc/sys -+ * (incl. newline, etc), and copy it as a string into provided -+ * by program buffer *buf* of size *buf_len*. -+ * -+ * The whole value is copied, no matter what file position user -+ * space issued e.g. sys_read at. -+ * -+ * The buffer is always NUL terminated, unless it's zero-sized. -+ * Return -+ * Number of character copied (not including the trailing NUL). -+ * -+ * **-E2BIG** if the buffer wasn't big enough (*buf* will contain -+ * truncated name in this case). -+ * -+ * **-EINVAL** if current value was unavailable, e.g. because -+ * sysctl is uninitialized and read returns -EIO for it. -+ * -+ * int bpf_sysctl_get_new_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len) -+ * Description -+ * Get new value being written by user space to sysctl (before -+ * the actual write happens) and copy it as a string into -+ * provided by program buffer *buf* of size *buf_len*. -+ * -+ * User space may write new value at file position > 0. -+ * -+ * The buffer is always NUL terminated, unless it's zero-sized. -+ * Return -+ * Number of character copied (not including the trailing NUL). -+ * -+ * **-E2BIG** if the buffer wasn't big enough (*buf* will contain -+ * truncated name in this case). -+ * -+ * **-EINVAL** if sysctl is being read. -+ * -+ * int bpf_sysctl_set_new_value(struct bpf_sysctl *ctx, const char *buf, size_t buf_len) -+ * Description -+ * Override new value being written by user space to sysctl with -+ * value provided by program in buffer *buf* of size *buf_len*. -+ * -+ * *buf* should contain a string in same form as provided by user -+ * space on sysctl write. -+ * -+ * User space may write new value at file position > 0. To override -+ * the whole sysctl value file position should be set to zero. -+ * Return -+ * 0 on success. -+ * -+ * **-E2BIG** if the *buf_len* is too big. -+ * -+ * **-EINVAL** if sysctl is being read. -+ * -+ * int bpf_strtol(const char *buf, size_t buf_len, u64 flags, long *res) -+ * Description -+ * Convert the initial part of the string from buffer *buf* of -+ * size *buf_len* to a long integer according to the given base -+ * and save the result in *res*. -+ * -+ * The string may begin with an arbitrary amount of white space -+ * (as determined by **isspace**\ (3)) followed by a single -+ * optional '**-**' sign. -+ * -+ * Five least significant bits of *flags* encode base, other bits -+ * are currently unused. -+ * -+ * Base must be either 8, 10, 16 or 0 to detect it automatically -+ * similar to user space **strtol**\ (3). -+ * Return -+ * Number of characters consumed on success. Must be positive but -+ * no more than *buf_len*. -+ * -+ * **-EINVAL** if no valid digits were found or unsupported base -+ * was provided. -+ * -+ * **-ERANGE** if resulting value was out of range. -+ * -+ * int bpf_strtoul(const char *buf, size_t buf_len, u64 flags, unsigned long *res) -+ * Description -+ * Convert the initial part of the string from buffer *buf* of -+ * size *buf_len* to an unsigned long integer according to the -+ * given base and save the result in *res*. -+ * -+ * The string may begin with an arbitrary amount of white space -+ * (as determined by **isspace**\ (3)). -+ * -+ * Five least significant bits of *flags* encode base, other bits -+ * are currently unused. -+ * -+ * Base must be either 8, 10, 16 or 0 to detect it automatically -+ * similar to user space **strtoul**\ (3). -+ * Return -+ * Number of characters consumed on success. Must be positive but -+ * no more than *buf_len*. -+ * -+ * **-EINVAL** if no valid digits were found or unsupported base -+ * was provided. -+ * -+ * **-ERANGE** if resulting value was out of range. -+ * -+ * void *bpf_sk_storage_get(struct bpf_map *map, struct bpf_sock *sk, void *value, u64 flags) -+ * Description -+ * Get a bpf-local-storage from a *sk*. -+ * -+ * Logically, it could be thought of getting the value from -+ * a *map* with *sk* as the **key**. From this -+ * perspective, the usage is not much different from -+ * **bpf_map_lookup_elem**\ (*map*, **&**\ *sk*) except this -+ * helper enforces the key must be a full socket and the map must -+ * be a **BPF_MAP_TYPE_SK_STORAGE** also. -+ * -+ * Underneath, the value is stored locally at *sk* instead of -+ * the *map*. The *map* is used as the bpf-local-storage -+ * "type". The bpf-local-storage "type" (i.e. the *map*) is -+ * searched against all bpf-local-storages residing at *sk*. -+ * -+ * An optional *flags* (**BPF_SK_STORAGE_GET_F_CREATE**) can be -+ * used such that a new bpf-local-storage will be -+ * created if one does not exist. *value* can be used -+ * together with **BPF_SK_STORAGE_GET_F_CREATE** to specify -+ * the initial value of a bpf-local-storage. If *value* is -+ * **NULL**, the new bpf-local-storage will be zero initialized. -+ * Return -+ * A bpf-local-storage pointer is returned on success. -+ * -+ * **NULL** if not found or there was an error in adding -+ * a new bpf-local-storage. -+ * -+ * int bpf_sk_storage_delete(struct bpf_map *map, struct bpf_sock *sk) -+ * Description -+ * Delete a bpf-local-storage from a *sk*. -+ * Return -+ * 0 on success. -+ * -+ * **-ENOENT** if the bpf-local-storage cannot be found. -+ * -+ * int bpf_send_signal(u32 sig) -+ * Description -+ * Send signal *sig* to the current task. -+ * Return -+ * 0 on success or successfully queued. -+ * -+ * **-EBUSY** if work queue under nmi is full. -+ * -+ * **-EINVAL** if *sig* is invalid. -+ * -+ * **-EPERM** if no permission to send the *sig*. -+ * -+ * **-EAGAIN** if bpf program can try again. -+ * -+ * s64 bpf_tcp_gen_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) -+ * Description -+ * Try to issue a SYN cookie for the packet with corresponding -+ * IP/TCP headers, *iph* and *th*, on the listening socket in *sk*. -+ * -+ * *iph* points to the start of the IPv4 or IPv6 header, while -+ * *iph_len* contains **sizeof**\ (**struct iphdr**) or -+ * **sizeof**\ (**struct ip6hdr**). -+ * -+ * *th* points to the start of the TCP header, while *th_len* -+ * contains the length of the TCP header. -+ * -+ * Return -+ * On success, lower 32 bits hold the generated SYN cookie in -+ * followed by 16 bits which hold the MSS value for that cookie, -+ * and the top 16 bits are unused. -+ * -+ * On failure, the returned value is one of the following: -+ * -+ * **-EINVAL** SYN cookie cannot be issued due to error -+ * -+ * **-ENOENT** SYN cookie should not be issued (no SYN flood) -+ * -+ * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies -+ * -+ * **-EPROTONOSUPPORT** IP packet version is not 4 or 6 -+ */ -+#define __BPF_FUNC_MAPPER(FN) \ -+ FN(unspec), \ -+ FN(map_lookup_elem), \ -+ FN(map_update_elem), \ -+ FN(map_delete_elem), \ -+ FN(probe_read), \ -+ FN(ktime_get_ns), \ -+ FN(trace_printk), \ -+ FN(get_prandom_u32), \ -+ FN(get_smp_processor_id), \ -+ FN(skb_store_bytes), \ -+ FN(l3_csum_replace), \ -+ FN(l4_csum_replace), \ -+ FN(tail_call), \ -+ FN(clone_redirect), \ -+ FN(get_current_pid_tgid), \ -+ FN(get_current_uid_gid), \ -+ FN(get_current_comm), \ -+ FN(get_cgroup_classid), \ -+ FN(skb_vlan_push), \ -+ FN(skb_vlan_pop), \ -+ FN(skb_get_tunnel_key), \ -+ FN(skb_set_tunnel_key), \ -+ FN(perf_event_read), \ -+ FN(redirect), \ -+ FN(get_route_realm), \ -+ FN(perf_event_output), \ -+ FN(skb_load_bytes), \ -+ FN(get_stackid), \ -+ FN(csum_diff), \ -+ FN(skb_get_tunnel_opt), \ -+ FN(skb_set_tunnel_opt), \ -+ FN(skb_change_proto), \ -+ FN(skb_change_type), \ -+ FN(skb_under_cgroup), \ -+ FN(get_hash_recalc), \ -+ FN(get_current_task), \ -+ FN(probe_write_user), \ -+ FN(current_task_under_cgroup), \ -+ FN(skb_change_tail), \ -+ FN(skb_pull_data), \ -+ FN(csum_update), \ -+ FN(set_hash_invalid), \ -+ FN(get_numa_node_id), \ -+ FN(skb_change_head), \ -+ FN(xdp_adjust_head), \ -+ FN(probe_read_str), \ -+ FN(get_socket_cookie), \ -+ FN(get_socket_uid), \ -+ FN(set_hash), \ -+ FN(setsockopt), \ -+ FN(skb_adjust_room), \ -+ FN(redirect_map), \ -+ FN(sk_redirect_map), \ -+ FN(sock_map_update), \ -+ FN(xdp_adjust_meta), \ -+ FN(perf_event_read_value), \ -+ FN(perf_prog_read_value), \ -+ FN(getsockopt), \ -+ FN(override_return), \ -+ FN(sock_ops_cb_flags_set), \ -+ FN(msg_redirect_map), \ -+ FN(msg_apply_bytes), \ -+ FN(msg_cork_bytes), \ -+ FN(msg_pull_data), \ -+ FN(bind), \ -+ FN(xdp_adjust_tail), \ -+ FN(skb_get_xfrm_state), \ -+ FN(get_stack), \ -+ FN(skb_load_bytes_relative), \ -+ FN(fib_lookup), \ -+ FN(sock_hash_update), \ -+ FN(msg_redirect_hash), \ -+ FN(sk_redirect_hash), \ -+ FN(lwt_push_encap), \ -+ FN(lwt_seg6_store_bytes), \ -+ FN(lwt_seg6_adjust_srh), \ -+ FN(lwt_seg6_action), \ -+ FN(rc_repeat), \ -+ FN(rc_keydown), \ -+ FN(skb_cgroup_id), \ -+ FN(get_current_cgroup_id), \ -+ FN(get_local_storage), \ -+ FN(sk_select_reuseport), \ -+ FN(skb_ancestor_cgroup_id), \ -+ FN(sk_lookup_tcp), \ -+ FN(sk_lookup_udp), \ -+ FN(sk_release), \ -+ FN(map_push_elem), \ -+ FN(map_pop_elem), \ -+ FN(map_peek_elem), \ -+ FN(msg_push_data), \ -+ FN(msg_pop_data), \ -+ FN(rc_pointer_rel), \ -+ FN(spin_lock), \ -+ FN(spin_unlock), \ -+ FN(sk_fullsock), \ -+ FN(tcp_sock), \ -+ FN(skb_ecn_set_ce), \ -+ FN(get_listener_sock), \ -+ FN(skc_lookup_tcp), \ -+ FN(tcp_check_syncookie), \ -+ FN(sysctl_get_name), \ -+ FN(sysctl_get_current_value), \ -+ FN(sysctl_get_new_value), \ -+ FN(sysctl_set_new_value), \ -+ FN(strtol), \ -+ FN(strtoul), \ -+ FN(sk_storage_get), \ -+ FN(sk_storage_delete), \ -+ FN(send_signal), \ -+ FN(tcp_gen_syncookie), -+ - /* integer value in 'imm' field of BPF_CALL instruction selects which helper - * function eBPF program intends to call - */ -+#define __BPF_ENUM_FN(x) BPF_FUNC_ ## x - enum bpf_func_id { -- BPF_FUNC_unspec, -- BPF_FUNC_map_lookup_elem, /* void *map_lookup_elem(&map, &key) */ -- BPF_FUNC_map_update_elem, /* int map_update_elem(&map, &key, &value, flags) */ -- BPF_FUNC_map_delete_elem, /* int map_delete_elem(&map, &key) */ -- BPF_FUNC_probe_read, /* int bpf_probe_read(void *dst, int size, void *src) */ -- BPF_FUNC_ktime_get_ns, /* u64 bpf_ktime_get_ns(void) */ -- BPF_FUNC_trace_printk, /* int bpf_trace_printk(const char *fmt, int fmt_size, ...) */ -- BPF_FUNC_get_prandom_u32, /* u32 prandom_u32(void) */ -- BPF_FUNC_get_smp_processor_id, /* u32 raw_smp_processor_id(void) */ -- -- /** -- * skb_store_bytes(skb, offset, from, len, flags) - store bytes into packet -- * @skb: pointer to skb -- * @offset: offset within packet from skb->mac_header -- * @from: pointer where to copy bytes from -- * @len: number of bytes to store into packet -- * @flags: bit 0 - if true, recompute skb->csum -- * other bits - reserved -- * Return: 0 on success -- */ -- BPF_FUNC_skb_store_bytes, -- -- /** -- * l3_csum_replace(skb, offset, from, to, flags) - recompute IP checksum -- * @skb: pointer to skb -- * @offset: offset within packet where IP checksum is located -- * @from: old value of header field -- * @to: new value of header field -- * @flags: bits 0-3 - size of header field -- * other bits - reserved -- * Return: 0 on success -- */ -- BPF_FUNC_l3_csum_replace, -- -- /** -- * l4_csum_replace(skb, offset, from, to, flags) - recompute TCP/UDP checksum -- * @skb: pointer to skb -- * @offset: offset within packet where TCP/UDP checksum is located -- * @from: old value of header field -- * @to: new value of header field -- * @flags: bits 0-3 - size of header field -- * bit 4 - is pseudo header -- * other bits - reserved -- * Return: 0 on success -- */ -- BPF_FUNC_l4_csum_replace, -+ __BPF_FUNC_MAPPER(__BPF_ENUM_FN) -+ __BPF_FUNC_MAX_ID, -+}; -+#undef __BPF_ENUM_FN - -- /** -- * bpf_tail_call(ctx, prog_array_map, index) - jump into another BPF program -- * @ctx: context pointer passed to next program -- * @prog_array_map: pointer to map which type is BPF_MAP_TYPE_PROG_ARRAY -- * @index: index inside array that selects specific program to run -- * Return: 0 on success -- */ -- BPF_FUNC_tail_call, -+/* All flags used by eBPF helper functions, placed here. */ - -- /** -- * bpf_clone_redirect(skb, ifindex, flags) - redirect to another netdev -- * @skb: pointer to skb -- * @ifindex: ifindex of the net device -- * @flags: bit 0 - if set, redirect to ingress instead of egress -- * other bits - reserved -- * Return: 0 on success -- */ -- BPF_FUNC_clone_redirect, -+/* BPF_FUNC_skb_store_bytes flags. */ -+#define BPF_F_RECOMPUTE_CSUM (1ULL << 0) -+#define BPF_F_INVALIDATE_HASH (1ULL << 1) - -- /** -- * u64 bpf_get_current_pid_tgid(void) -- * Return: current->tgid << 32 | current->pid -- */ -- BPF_FUNC_get_current_pid_tgid, -+/* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags. -+ * First 4 bits are for passing the header field size. -+ */ -+#define BPF_F_HDR_FIELD_MASK 0xfULL - -- /** -- * u64 bpf_get_current_uid_gid(void) -- * Return: current_gid << 32 | current_uid -- */ -- BPF_FUNC_get_current_uid_gid, -+/* BPF_FUNC_l4_csum_replace flags. */ -+#define BPF_F_PSEUDO_HDR (1ULL << 4) -+#define BPF_F_MARK_MANGLED_0 (1ULL << 5) -+#define BPF_F_MARK_ENFORCE (1ULL << 6) -+ -+/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */ -+#define BPF_F_INGRESS (1ULL << 0) -+ -+/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */ -+#define BPF_F_TUNINFO_IPV6 (1ULL << 0) -+ -+/* flags for both BPF_FUNC_get_stackid and BPF_FUNC_get_stack. */ -+#define BPF_F_SKIP_FIELD_MASK 0xffULL -+#define BPF_F_USER_STACK (1ULL << 8) -+/* flags used by BPF_FUNC_get_stackid only. */ -+#define BPF_F_FAST_STACK_CMP (1ULL << 9) -+#define BPF_F_REUSE_STACKID (1ULL << 10) -+/* flags used by BPF_FUNC_get_stack only. */ -+#define BPF_F_USER_BUILD_ID (1ULL << 11) -+ -+/* BPF_FUNC_skb_set_tunnel_key flags. */ -+#define BPF_F_ZERO_CSUM_TX (1ULL << 1) -+#define BPF_F_DONT_FRAGMENT (1ULL << 2) -+#define BPF_F_SEQ_NUMBER (1ULL << 3) - -- /** -- * bpf_get_current_comm(char *buf, int size_of_buf) -- * stores current->comm into buf -- * Return: 0 on success -- */ -- BPF_FUNC_get_current_comm, -- -- /** -- * bpf_get_cgroup_classid(skb) - retrieve a proc's classid -- * @skb: pointer to skb -- * Return: classid if != 0 -- */ -- BPF_FUNC_get_cgroup_classid, -- BPF_FUNC_skb_vlan_push, /* bpf_skb_vlan_push(skb, vlan_proto, vlan_tci) */ -- BPF_FUNC_skb_vlan_pop, /* bpf_skb_vlan_pop(skb) */ -- -- /** -- * bpf_skb_[gs]et_tunnel_key(skb, key, size, flags) -- * retrieve or populate tunnel metadata -- * @skb: pointer to skb -- * @key: pointer to 'struct bpf_tunnel_key' -- * @size: size of 'struct bpf_tunnel_key' -- * @flags: room for future extensions -- * Retrun: 0 on success -- */ -- BPF_FUNC_skb_get_tunnel_key, -- BPF_FUNC_skb_set_tunnel_key, -- BPF_FUNC_perf_event_read, /* u64 bpf_perf_event_read(&map, index) */ -- /** -- * bpf_redirect(ifindex, flags) - redirect to another netdev -- * @ifindex: ifindex of the net device -- * @flags: bit 0 - if set, redirect to ingress instead of egress -- * other bits - reserved -- * Return: TC_ACT_REDIRECT -- */ -- BPF_FUNC_redirect, -+/* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and -+ * BPF_FUNC_perf_event_read_value flags. -+ */ -+#define BPF_F_INDEX_MASK 0xffffffffULL -+#define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK -+/* BPF_FUNC_perf_event_output for sk_buff input context. */ -+#define BPF_F_CTXLEN_MASK (0xfffffULL << 32) -+ -+/* Current network namespace */ -+#define BPF_F_CURRENT_NETNS (-1L) -+ -+/* BPF_FUNC_skb_adjust_room flags. */ -+#define BPF_F_ADJ_ROOM_FIXED_GSO (1ULL << 0) -+ -+#define BPF_ADJ_ROOM_ENCAP_L2_MASK 0xff -+#define BPF_ADJ_ROOM_ENCAP_L2_SHIFT 56 -+ -+#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 (1ULL << 1) -+#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 (1ULL << 2) -+#define BPF_F_ADJ_ROOM_ENCAP_L4_GRE (1ULL << 3) -+#define BPF_F_ADJ_ROOM_ENCAP_L4_UDP (1ULL << 4) -+#define BPF_F_ADJ_ROOM_ENCAP_L2(len) (((__u64)len & \ -+ BPF_ADJ_ROOM_ENCAP_L2_MASK) \ -+ << BPF_ADJ_ROOM_ENCAP_L2_SHIFT) -+ -+/* BPF_FUNC_sysctl_get_name flags. */ -+#define BPF_F_SYSCTL_BASE_NAME (1ULL << 0) -+ -+/* BPF_FUNC_sk_storage_get flags */ -+#define BPF_SK_STORAGE_GET_F_CREATE (1ULL << 0) -+ -+/* Mode for BPF_FUNC_skb_adjust_room helper. */ -+enum bpf_adj_room_mode { -+ BPF_ADJ_ROOM_NET, -+ BPF_ADJ_ROOM_MAC, -+}; - -- /** -- * bpf_get_route_realm(skb) - retrieve a dst's tclassid -- * @skb: pointer to skb -- * Return: realm if != 0 -- */ -- BPF_FUNC_get_route_realm, -+/* Mode for BPF_FUNC_skb_load_bytes_relative helper. */ -+enum bpf_hdr_start_off { -+ BPF_HDR_START_MAC, -+ BPF_HDR_START_NET, -+}; - -- /** -- * bpf_perf_event_output(ctx, map, index, data, size) - output perf raw sample -- * @ctx: struct pt_regs* -- * @map: pointer to perf_event_array map -- * @index: index of event in the map -- * @data: data on stack to be output as raw data -- * @size: size of data -- * Return: 0 on success -- */ -- BPF_FUNC_perf_event_output, -- __BPF_FUNC_MAX_ID, -+/* Encapsulation type for BPF_FUNC_lwt_push_encap helper. */ -+enum bpf_lwt_encap_mode { -+ BPF_LWT_ENCAP_SEG6, -+ BPF_LWT_ENCAP_SEG6_INLINE, -+ BPF_LWT_ENCAP_IP, - }; - -+#define __bpf_md_ptr(type, name) \ -+union { \ -+ type name; \ -+ __u64 :64; \ -+} __attribute__((aligned(8))) -+ - /* user accessible mirror of in-kernel sk_buff. - * new fields can only be added to the end of this structure - */ -@@ -291,11 +2985,632 @@ struct __sk_buff { - __u32 cb[5]; - __u32 hash; - __u32 tc_classid; -+ __u32 data; -+ __u32 data_end; -+ __u32 napi_id; -+ -+ /* Accessed by BPF_PROG_TYPE_sk_skb types from here to ... */ -+ __u32 family; -+ __u32 remote_ip4; /* Stored in network byte order */ -+ __u32 local_ip4; /* Stored in network byte order */ -+ __u32 remote_ip6[4]; /* Stored in network byte order */ -+ __u32 local_ip6[4]; /* Stored in network byte order */ -+ __u32 remote_port; /* Stored in network byte order */ -+ __u32 local_port; /* stored in host byte order */ -+ /* ... here. */ -+ -+ __u32 data_meta; -+ __bpf_md_ptr(struct bpf_flow_keys *, flow_keys); -+ __u64 tstamp; -+ __u32 wire_len; -+ __u32 gso_segs; -+ __bpf_md_ptr(struct bpf_sock *, sk); - }; - - struct bpf_tunnel_key { - __u32 tunnel_id; -- __u32 remote_ipv4; -+ union { -+ __u32 remote_ipv4; -+ __u32 remote_ipv6[4]; -+ }; -+ __u8 tunnel_tos; -+ __u8 tunnel_ttl; -+ __u16 tunnel_ext; /* Padding, future use. */ -+ __u32 tunnel_label; -+}; -+ -+/* user accessible mirror of in-kernel xfrm_state. -+ * new fields can only be added to the end of this structure -+ */ -+struct bpf_xfrm_state { -+ __u32 reqid; -+ __u32 spi; /* Stored in network byte order */ -+ __u16 family; -+ __u16 ext; /* Padding, future use. */ -+ union { -+ __u32 remote_ipv4; /* Stored in network byte order */ -+ __u32 remote_ipv6[4]; /* Stored in network byte order */ -+ }; -+}; -+ -+/* Generic BPF return codes which all BPF program types may support. -+ * The values are binary compatible with their TC_ACT_* counter-part to -+ * provide backwards compatibility with existing SCHED_CLS and SCHED_ACT -+ * programs. -+ * -+ * XDP is handled seprately, see XDP_*. -+ */ -+enum bpf_ret_code { -+ BPF_OK = 0, -+ /* 1 reserved */ -+ BPF_DROP = 2, -+ /* 3-6 reserved */ -+ BPF_REDIRECT = 7, -+ /* >127 are reserved for prog type specific return codes. -+ * -+ * BPF_LWT_REROUTE: used by BPF_PROG_TYPE_LWT_IN and -+ * BPF_PROG_TYPE_LWT_XMIT to indicate that skb had been -+ * changed and should be routed based on its new L3 header. -+ * (This is an L3 redirect, as opposed to L2 redirect -+ * represented by BPF_REDIRECT above). -+ */ -+ BPF_LWT_REROUTE = 128, -+}; -+ -+struct bpf_sock { -+ __u32 bound_dev_if; -+ __u32 family; -+ __u32 type; -+ __u32 protocol; -+ __u32 mark; -+ __u32 priority; -+ /* IP address also allows 1 and 2 bytes access */ -+ __u32 src_ip4; -+ __u32 src_ip6[4]; -+ __u32 src_port; /* host byte order */ -+ __u32 dst_port; /* network byte order */ -+ __u32 dst_ip4; -+ __u32 dst_ip6[4]; -+ __u32 state; -+}; -+ -+struct bpf_tcp_sock { -+ __u32 snd_cwnd; /* Sending congestion window */ -+ __u32 srtt_us; /* smoothed round trip time << 3 in usecs */ -+ __u32 rtt_min; -+ __u32 snd_ssthresh; /* Slow start size threshold */ -+ __u32 rcv_nxt; /* What we want to receive next */ -+ __u32 snd_nxt; /* Next sequence we send */ -+ __u32 snd_una; /* First byte we want an ack for */ -+ __u32 mss_cache; /* Cached effective mss, not including SACKS */ -+ __u32 ecn_flags; /* ECN status bits. */ -+ __u32 rate_delivered; /* saved rate sample: packets delivered */ -+ __u32 rate_interval_us; /* saved rate sample: time elapsed */ -+ __u32 packets_out; /* Packets which are "in flight" */ -+ __u32 retrans_out; /* Retransmitted packets out */ -+ __u32 total_retrans; /* Total retransmits for entire connection */ -+ __u32 segs_in; /* RFC4898 tcpEStatsPerfSegsIn -+ * total number of segments in. -+ */ -+ __u32 data_segs_in; /* RFC4898 tcpEStatsPerfDataSegsIn -+ * total number of data segments in. -+ */ -+ __u32 segs_out; /* RFC4898 tcpEStatsPerfSegsOut -+ * The total number of segments sent. -+ */ -+ __u32 data_segs_out; /* RFC4898 tcpEStatsPerfDataSegsOut -+ * total number of data segments sent. -+ */ -+ __u32 lost_out; /* Lost packets */ -+ __u32 sacked_out; /* SACK'd packets */ -+ __u64 bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived -+ * sum(delta(rcv_nxt)), or how many bytes -+ * were acked. -+ */ -+ __u64 bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked -+ * sum(delta(snd_una)), or how many bytes -+ * were acked. -+ */ -+ __u32 dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups -+ * total number of DSACK blocks received -+ */ -+ __u32 delivered; /* Total data packets delivered incl. rexmits */ -+ __u32 delivered_ce; /* Like the above but only ECE marked packets */ -+ __u32 icsk_retransmits; /* Number of unrecovered [RTO] timeouts */ -+}; -+ -+struct bpf_sock_tuple { -+ union { -+ struct { -+ __be32 saddr; -+ __be32 daddr; -+ __be16 sport; -+ __be16 dport; -+ } ipv4; -+ struct { -+ __be32 saddr[4]; -+ __be32 daddr[4]; -+ __be16 sport; -+ __be16 dport; -+ } ipv6; -+ }; -+}; -+ -+struct bpf_xdp_sock { -+ __u32 queue_id; -+}; -+ -+#define XDP_PACKET_HEADROOM 256 -+ -+/* User return codes for XDP prog type. -+ * A valid XDP program must return one of these defined values. All other -+ * return codes are reserved for future use. Unknown return codes will -+ * result in packet drops and a warning via bpf_warn_invalid_xdp_action(). -+ */ -+enum xdp_action { -+ XDP_ABORTED = 0, -+ XDP_DROP, -+ XDP_PASS, -+ XDP_TX, -+ XDP_REDIRECT, -+}; -+ -+/* user accessible metadata for XDP packet hook -+ * new fields must be added to the end of this structure -+ */ -+struct xdp_md { -+ __u32 data; -+ __u32 data_end; -+ __u32 data_meta; -+ /* Below access go through struct xdp_rxq_info */ -+ __u32 ingress_ifindex; /* rxq->dev->ifindex */ -+ __u32 rx_queue_index; /* rxq->queue_index */ -+}; -+ -+enum sk_action { -+ SK_DROP = 0, -+ SK_PASS, -+}; -+ -+/* user accessible metadata for SK_MSG packet hook, new fields must -+ * be added to the end of this structure -+ */ -+struct sk_msg_md { -+ __bpf_md_ptr(void *, data); -+ __bpf_md_ptr(void *, data_end); -+ -+ __u32 family; -+ __u32 remote_ip4; /* Stored in network byte order */ -+ __u32 local_ip4; /* Stored in network byte order */ -+ __u32 remote_ip6[4]; /* Stored in network byte order */ -+ __u32 local_ip6[4]; /* Stored in network byte order */ -+ __u32 remote_port; /* Stored in network byte order */ -+ __u32 local_port; /* stored in host byte order */ -+ __u32 size; /* Total size of sk_msg */ -+}; -+ -+struct sk_reuseport_md { -+ /* -+ * Start of directly accessible data. It begins from -+ * the tcp/udp header. -+ */ -+ __bpf_md_ptr(void *, data); -+ /* End of directly accessible data */ -+ __bpf_md_ptr(void *, data_end); -+ /* -+ * Total length of packet (starting from the tcp/udp header). -+ * Note that the directly accessible bytes (data_end - data) -+ * could be less than this "len". Those bytes could be -+ * indirectly read by a helper "bpf_skb_load_bytes()". -+ */ -+ __u32 len; -+ /* -+ * Eth protocol in the mac header (network byte order). e.g. -+ * ETH_P_IP(0x0800) and ETH_P_IPV6(0x86DD) -+ */ -+ __u32 eth_protocol; -+ __u32 ip_protocol; /* IP protocol. e.g. IPPROTO_TCP, IPPROTO_UDP */ -+ __u32 bind_inany; /* Is sock bound to an INANY address? */ -+ __u32 hash; /* A hash of the packet 4 tuples */ -+}; -+ -+#define BPF_TAG_SIZE 8 -+ -+struct bpf_prog_info { -+ __u32 type; -+ __u32 id; -+ __u8 tag[BPF_TAG_SIZE]; -+ __u32 jited_prog_len; -+ __u32 xlated_prog_len; -+ __aligned_u64 jited_prog_insns; -+ __aligned_u64 xlated_prog_insns; -+ __u64 load_time; /* ns since boottime */ -+ __u32 created_by_uid; -+ __u32 nr_map_ids; -+ __aligned_u64 map_ids; -+ char name[BPF_OBJ_NAME_LEN]; -+ __u32 ifindex; -+ __u32 gpl_compatible:1; -+ __u32 :31; /* alignment pad */ -+ __u64 netns_dev; -+ __u64 netns_ino; -+ __u32 nr_jited_ksyms; -+ __u32 nr_jited_func_lens; -+ __aligned_u64 jited_ksyms; -+ __aligned_u64 jited_func_lens; -+ __u32 btf_id; -+ __u32 func_info_rec_size; -+ __aligned_u64 func_info; -+ __u32 nr_func_info; -+ __u32 nr_line_info; -+ __aligned_u64 line_info; -+ __aligned_u64 jited_line_info; -+ __u32 nr_jited_line_info; -+ __u32 line_info_rec_size; -+ __u32 jited_line_info_rec_size; -+ __u32 nr_prog_tags; -+ __aligned_u64 prog_tags; -+ __u64 run_time_ns; -+ __u64 run_cnt; -+} __attribute__((aligned(8))); -+ -+struct bpf_map_info { -+ __u32 type; -+ __u32 id; -+ __u32 key_size; -+ __u32 value_size; -+ __u32 max_entries; -+ __u32 map_flags; -+ char name[BPF_OBJ_NAME_LEN]; -+ __u32 ifindex; -+ __u32 :32; -+ __u64 netns_dev; -+ __u64 netns_ino; -+ __u32 btf_id; -+ __u32 btf_key_type_id; -+ __u32 btf_value_type_id; -+} __attribute__((aligned(8))); -+ -+struct bpf_btf_info { -+ __aligned_u64 btf; -+ __u32 btf_size; -+ __u32 id; -+} __attribute__((aligned(8))); -+ -+/* User bpf_sock_addr struct to access socket fields and sockaddr struct passed -+ * by user and intended to be used by socket (e.g. to bind to, depends on -+ * attach attach type). -+ */ -+struct bpf_sock_addr { -+ __u32 user_family; /* Allows 4-byte read, but no write. */ -+ __u32 user_ip4; /* Allows 1,2,4-byte read and 4-byte write. -+ * Stored in network byte order. -+ */ -+ __u32 user_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write. -+ * Stored in network byte order. -+ */ -+ __u32 user_port; /* Allows 4-byte read and write. -+ * Stored in network byte order -+ */ -+ __u32 family; /* Allows 4-byte read, but no write */ -+ __u32 type; /* Allows 4-byte read, but no write */ -+ __u32 protocol; /* Allows 4-byte read, but no write */ -+ __u32 msg_src_ip4; /* Allows 1,2,4-byte read and 4-byte write. -+ * Stored in network byte order. -+ */ -+ __u32 msg_src_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write. -+ * Stored in network byte order. -+ */ -+ __bpf_md_ptr(struct bpf_sock *, sk); -+}; -+ -+/* User bpf_sock_ops struct to access socket values and specify request ops -+ * and their replies. -+ * Some of this fields are in network (bigendian) byte order and may need -+ * to be converted before use (bpf_ntohl() defined in samples/bpf/bpf_endian.h). -+ * New fields can only be added at the end of this structure -+ */ -+struct bpf_sock_ops { -+ __u32 op; -+ union { -+ __u32 args[4]; /* Optionally passed to bpf program */ -+ __u32 reply; /* Returned by bpf program */ -+ __u32 replylong[4]; /* Optionally returned by bpf prog */ -+ }; -+ __u32 family; -+ __u32 remote_ip4; /* Stored in network byte order */ -+ __u32 local_ip4; /* Stored in network byte order */ -+ __u32 remote_ip6[4]; /* Stored in network byte order */ -+ __u32 local_ip6[4]; /* Stored in network byte order */ -+ __u32 remote_port; /* Stored in network byte order */ -+ __u32 local_port; /* stored in host byte order */ -+ __u32 is_fullsock; /* Some TCP fields are only valid if -+ * there is a full socket. If not, the -+ * fields read as zero. -+ */ -+ __u32 snd_cwnd; -+ __u32 srtt_us; /* Averaged RTT << 3 in usecs */ -+ __u32 bpf_sock_ops_cb_flags; /* flags defined in uapi/linux/tcp.h */ -+ __u32 state; -+ __u32 rtt_min; -+ __u32 snd_ssthresh; -+ __u32 rcv_nxt; -+ __u32 snd_nxt; -+ __u32 snd_una; -+ __u32 mss_cache; -+ __u32 ecn_flags; -+ __u32 rate_delivered; -+ __u32 rate_interval_us; -+ __u32 packets_out; -+ __u32 retrans_out; -+ __u32 total_retrans; -+ __u32 segs_in; -+ __u32 data_segs_in; -+ __u32 segs_out; -+ __u32 data_segs_out; -+ __u32 lost_out; -+ __u32 sacked_out; -+ __u32 sk_txhash; -+ __u64 bytes_received; -+ __u64 bytes_acked; -+ __bpf_md_ptr(struct bpf_sock *, sk); -+}; -+ -+/* Definitions for bpf_sock_ops_cb_flags */ -+#define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0) -+#define BPF_SOCK_OPS_RETRANS_CB_FLAG (1<<1) -+#define BPF_SOCK_OPS_STATE_CB_FLAG (1<<2) -+#define BPF_SOCK_OPS_RTT_CB_FLAG (1<<3) -+#define BPF_SOCK_OPS_ALL_CB_FLAGS 0xF /* Mask of all currently -+ * supported cb flags -+ */ -+ -+/* List of known BPF sock_ops operators. -+ * New entries can only be added at the end -+ */ -+enum { -+ BPF_SOCK_OPS_VOID, -+ BPF_SOCK_OPS_TIMEOUT_INIT, /* Should return SYN-RTO value to use or -+ * -1 if default value should be used -+ */ -+ BPF_SOCK_OPS_RWND_INIT, /* Should return initial advertized -+ * window (in packets) or -1 if default -+ * value should be used -+ */ -+ BPF_SOCK_OPS_TCP_CONNECT_CB, /* Calls BPF program right before an -+ * active connection is initialized -+ */ -+ BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB, /* Calls BPF program when an -+ * active connection is -+ * established -+ */ -+ BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB, /* Calls BPF program when a -+ * passive connection is -+ * established -+ */ -+ BPF_SOCK_OPS_NEEDS_ECN, /* If connection's congestion control -+ * needs ECN -+ */ -+ BPF_SOCK_OPS_BASE_RTT, /* Get base RTT. The correct value is -+ * based on the path and may be -+ * dependent on the congestion control -+ * algorithm. In general it indicates -+ * a congestion threshold. RTTs above -+ * this indicate congestion -+ */ -+ BPF_SOCK_OPS_RTO_CB, /* Called when an RTO has triggered. -+ * Arg1: value of icsk_retransmits -+ * Arg2: value of icsk_rto -+ * Arg3: whether RTO has expired -+ */ -+ BPF_SOCK_OPS_RETRANS_CB, /* Called when skb is retransmitted. -+ * Arg1: sequence number of 1st byte -+ * Arg2: # segments -+ * Arg3: return value of -+ * tcp_transmit_skb (0 => success) -+ */ -+ BPF_SOCK_OPS_STATE_CB, /* Called when TCP changes state. -+ * Arg1: old_state -+ * Arg2: new_state -+ */ -+ BPF_SOCK_OPS_TCP_LISTEN_CB, /* Called on listen(2), right after -+ * socket transition to LISTEN state. -+ */ -+ BPF_SOCK_OPS_RTT_CB, /* Called on every RTT. -+ */ -+}; -+ -+/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect -+ * changes between the TCP and BPF versions. Ideally this should never happen. -+ * If it does, we need to add code to convert them before calling -+ * the BPF sock_ops function. -+ */ -+enum { -+ BPF_TCP_ESTABLISHED = 1, -+ BPF_TCP_SYN_SENT, -+ BPF_TCP_SYN_RECV, -+ BPF_TCP_FIN_WAIT1, -+ BPF_TCP_FIN_WAIT2, -+ BPF_TCP_TIME_WAIT, -+ BPF_TCP_CLOSE, -+ BPF_TCP_CLOSE_WAIT, -+ BPF_TCP_LAST_ACK, -+ BPF_TCP_LISTEN, -+ BPF_TCP_CLOSING, /* Now a valid state */ -+ BPF_TCP_NEW_SYN_RECV, -+ -+ BPF_TCP_MAX_STATES /* Leave at the end! */ -+}; -+ -+#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */ -+#define TCP_BPF_SNDCWND_CLAMP 1002 /* Set sndcwnd_clamp */ -+ -+struct bpf_perf_event_value { -+ __u64 counter; -+ __u64 enabled; -+ __u64 running; -+}; -+ -+#define BPF_DEVCG_ACC_MKNOD (1ULL << 0) -+#define BPF_DEVCG_ACC_READ (1ULL << 1) -+#define BPF_DEVCG_ACC_WRITE (1ULL << 2) -+ -+#define BPF_DEVCG_DEV_BLOCK (1ULL << 0) -+#define BPF_DEVCG_DEV_CHAR (1ULL << 1) -+ -+struct bpf_cgroup_dev_ctx { -+ /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */ -+ __u32 access_type; -+ __u32 major; -+ __u32 minor; -+}; -+ -+struct bpf_raw_tracepoint_args { -+ __u64 args[0]; -+}; -+ -+/* DIRECT: Skip the FIB rules and go to FIB table associated with device -+ * OUTPUT: Do lookup from egress perspective; default is ingress -+ */ -+#define BPF_FIB_LOOKUP_DIRECT (1U << 0) -+#define BPF_FIB_LOOKUP_OUTPUT (1U << 1) -+ -+enum { -+ BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */ -+ BPF_FIB_LKUP_RET_BLACKHOLE, /* dest is blackholed; can be dropped */ -+ BPF_FIB_LKUP_RET_UNREACHABLE, /* dest is unreachable; can be dropped */ -+ BPF_FIB_LKUP_RET_PROHIBIT, /* dest not allowed; can be dropped */ -+ BPF_FIB_LKUP_RET_NOT_FWDED, /* packet is not forwarded */ -+ BPF_FIB_LKUP_RET_FWD_DISABLED, /* fwding is not enabled on ingress */ -+ BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */ -+ BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */ -+ BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */ -+}; -+ -+struct bpf_fib_lookup { -+ /* input: network family for lookup (AF_INET, AF_INET6) -+ * output: network family of egress nexthop -+ */ -+ __u8 family; -+ -+ /* set if lookup is to consider L4 data - e.g., FIB rules */ -+ __u8 l4_protocol; -+ __be16 sport; -+ __be16 dport; -+ -+ /* total length of packet from network header - used for MTU check */ -+ __u16 tot_len; -+ -+ /* input: L3 device index for lookup -+ * output: device index from FIB lookup -+ */ -+ __u32 ifindex; -+ -+ union { -+ /* inputs to lookup */ -+ __u8 tos; /* AF_INET */ -+ __be32 flowinfo; /* AF_INET6, flow_label + priority */ -+ -+ /* output: metric of fib result (IPv4/IPv6 only) */ -+ __u32 rt_metric; -+ }; -+ -+ union { -+ __be32 ipv4_src; -+ __u32 ipv6_src[4]; /* in6_addr; network order */ -+ }; -+ -+ /* input to bpf_fib_lookup, ipv{4,6}_dst is destination address in -+ * network header. output: bpf_fib_lookup sets to gateway address -+ * if FIB lookup returns gateway route -+ */ -+ union { -+ __be32 ipv4_dst; -+ __u32 ipv6_dst[4]; /* in6_addr; network order */ -+ }; -+ -+ /* output */ -+ __be16 h_vlan_proto; -+ __be16 h_vlan_TCI; -+ __u8 smac[6]; /* ETH_ALEN */ -+ __u8 dmac[6]; /* ETH_ALEN */ -+}; -+ -+enum bpf_task_fd_type { -+ BPF_FD_TYPE_RAW_TRACEPOINT, /* tp name */ -+ BPF_FD_TYPE_TRACEPOINT, /* tp name */ -+ BPF_FD_TYPE_KPROBE, /* (symbol + offset) or addr */ -+ BPF_FD_TYPE_KRETPROBE, /* (symbol + offset) or addr */ -+ BPF_FD_TYPE_UPROBE, /* filename + offset */ -+ BPF_FD_TYPE_URETPROBE, /* filename + offset */ -+}; -+ -+#define BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG (1U << 0) -+#define BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL (1U << 1) -+#define BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP (1U << 2) -+ -+struct bpf_flow_keys { -+ __u16 nhoff; -+ __u16 thoff; -+ __u16 addr_proto; /* ETH_P_* of valid addrs */ -+ __u8 is_frag; -+ __u8 is_first_frag; -+ __u8 is_encap; -+ __u8 ip_proto; -+ __be16 n_proto; -+ __be16 sport; -+ __be16 dport; -+ union { -+ struct { -+ __be32 ipv4_src; -+ __be32 ipv4_dst; -+ }; -+ struct { -+ __u32 ipv6_src[4]; /* in6_addr; network order */ -+ __u32 ipv6_dst[4]; /* in6_addr; network order */ -+ }; -+ }; -+ __u32 flags; -+ __be32 flow_label; -+}; -+ -+struct bpf_func_info { -+ __u32 insn_off; -+ __u32 type_id; -+}; -+ -+#define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10) -+#define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff) -+ -+struct bpf_line_info { -+ __u32 insn_off; -+ __u32 file_name_off; -+ __u32 line_off; -+ __u32 line_col; -+}; -+ -+struct bpf_spin_lock { -+ __u32 val; -+}; -+ -+struct bpf_sysctl { -+ __u32 write; /* Sysctl is being read (= 0) or written (= 1). -+ * Allows 1,2,4-byte read, but no write. -+ */ -+ __u32 file_pos; /* Sysctl file position to read from, write to. -+ * Allows 1,2,4-byte read an 4-byte write. -+ */ -+}; -+ -+struct bpf_sockopt { -+ __bpf_md_ptr(struct bpf_sock *, sk); -+ __bpf_md_ptr(void *, optval); -+ __bpf_md_ptr(void *, optval_end); -+ -+ __s32 level; -+ __s32 optname; -+ __s32 optlen; -+ __s32 retval; - }; - - #endif /* _UAPI__LINUX_BPF_H__ */ ---- /dev/null -+++ b/include/uapi/linux/bpfilter.h -@@ -0,0 +1,21 @@ -+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -+#ifndef _UAPI_LINUX_BPFILTER_H -+#define _UAPI_LINUX_BPFILTER_H -+ -+#include -+ -+enum { -+ BPFILTER_IPT_SO_SET_REPLACE = 64, -+ BPFILTER_IPT_SO_SET_ADD_COUNTERS = 65, -+ BPFILTER_IPT_SET_MAX, -+}; -+ -+enum { -+ BPFILTER_IPT_SO_GET_INFO = 64, -+ BPFILTER_IPT_SO_GET_ENTRIES = 65, -+ BPFILTER_IPT_SO_GET_REVISION_MATCH = 66, -+ BPFILTER_IPT_SO_GET_REVISION_TARGET = 67, -+ BPFILTER_IPT_GET_MAX, -+}; -+ -+#endif /* _UAPI_LINUX_BPFILTER_H */ ---- /dev/null -+++ b/include/uapi/linux/bpf_perf_event.h -@@ -0,0 +1,19 @@ -+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -+/* Copyright (c) 2016 Facebook -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of version 2 of the GNU General Public -+ * License as published by the Free Software Foundation. -+ */ -+#ifndef _UAPI__LINUX_BPF_PERF_EVENT_H__ -+#define _UAPI__LINUX_BPF_PERF_EVENT_H__ -+ -+#include -+ -+struct bpf_perf_event_data { -+ bpf_user_pt_regs_t regs; -+ __u64 sample_period; -+ __u64 addr; -+}; -+ -+#endif /* _UAPI__LINUX_BPF_PERF_EVENT_H__ */ ---- /dev/null -+++ b/include/uapi/linux/btf.h -@@ -0,0 +1,165 @@ -+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -+/* Copyright (c) 2018 Facebook */ -+#ifndef _UAPI__LINUX_BTF_H__ -+#define _UAPI__LINUX_BTF_H__ -+ -+#include -+ -+#define BTF_MAGIC 0xeB9F -+#define BTF_VERSION 1 -+ -+struct btf_header { -+ __u16 magic; -+ __u8 version; -+ __u8 flags; -+ __u32 hdr_len; -+ -+ /* All offsets are in bytes relative to the end of this header */ -+ __u32 type_off; /* offset of type section */ -+ __u32 type_len; /* length of type section */ -+ __u32 str_off; /* offset of string section */ -+ __u32 str_len; /* length of string section */ -+}; -+ -+/* Max # of type identifier */ -+#define BTF_MAX_TYPE 0x000fffff -+/* Max offset into the string section */ -+#define BTF_MAX_NAME_OFFSET 0x00ffffff -+/* Max # of struct/union/enum members or func args */ -+#define BTF_MAX_VLEN 0xffff -+ -+struct btf_type { -+ __u32 name_off; -+ /* "info" bits arrangement -+ * bits 0-15: vlen (e.g. # of struct's members) -+ * bits 16-23: unused -+ * bits 24-27: kind (e.g. int, ptr, array...etc) -+ * bits 28-30: unused -+ * bit 31: kind_flag, currently used by -+ * struct, union and fwd -+ */ -+ __u32 info; -+ /* "size" is used by INT, ENUM, STRUCT, UNION and DATASEC. -+ * "size" tells the size of the type it is describing. -+ * -+ * "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT, -+ * FUNC, FUNC_PROTO and VAR. -+ * "type" is a type_id referring to another type. -+ */ -+ union { -+ __u32 size; -+ __u32 type; -+ }; -+}; -+ -+#define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f) -+#define BTF_INFO_VLEN(info) ((info) & 0xffff) -+#define BTF_INFO_KFLAG(info) ((info) >> 31) -+ -+#define BTF_KIND_UNKN 0 /* Unknown */ -+#define BTF_KIND_INT 1 /* Integer */ -+#define BTF_KIND_PTR 2 /* Pointer */ -+#define BTF_KIND_ARRAY 3 /* Array */ -+#define BTF_KIND_STRUCT 4 /* Struct */ -+#define BTF_KIND_UNION 5 /* Union */ -+#define BTF_KIND_ENUM 6 /* Enumeration */ -+#define BTF_KIND_FWD 7 /* Forward */ -+#define BTF_KIND_TYPEDEF 8 /* Typedef */ -+#define BTF_KIND_VOLATILE 9 /* Volatile */ -+#define BTF_KIND_CONST 10 /* Const */ -+#define BTF_KIND_RESTRICT 11 /* Restrict */ -+#define BTF_KIND_FUNC 12 /* Function */ -+#define BTF_KIND_FUNC_PROTO 13 /* Function Proto */ -+#define BTF_KIND_VAR 14 /* Variable */ -+#define BTF_KIND_DATASEC 15 /* Section */ -+#define BTF_KIND_MAX BTF_KIND_DATASEC -+#define NR_BTF_KINDS (BTF_KIND_MAX + 1) -+ -+/* For some specific BTF_KIND, "struct btf_type" is immediately -+ * followed by extra data. -+ */ -+ -+/* BTF_KIND_INT is followed by a u32 and the following -+ * is the 32 bits arrangement: -+ */ -+#define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24) -+#define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16) -+#define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff) -+ -+/* Attributes stored in the BTF_INT_ENCODING */ -+#define BTF_INT_SIGNED (1 << 0) -+#define BTF_INT_CHAR (1 << 1) -+#define BTF_INT_BOOL (1 << 2) -+ -+/* BTF_KIND_ENUM is followed by multiple "struct btf_enum". -+ * The exact number of btf_enum is stored in the vlen (of the -+ * info in "struct btf_type"). -+ */ -+struct btf_enum { -+ __u32 name_off; -+ __s32 val; -+}; -+ -+/* BTF_KIND_ARRAY is followed by one "struct btf_array" */ -+struct btf_array { -+ __u32 type; -+ __u32 index_type; -+ __u32 nelems; -+}; -+ -+/* BTF_KIND_STRUCT and BTF_KIND_UNION are followed -+ * by multiple "struct btf_member". The exact number -+ * of btf_member is stored in the vlen (of the info in -+ * "struct btf_type"). -+ */ -+struct btf_member { -+ __u32 name_off; -+ __u32 type; -+ /* If the type info kind_flag is set, the btf_member offset -+ * contains both member bitfield size and bit offset. The -+ * bitfield size is set for bitfield members. If the type -+ * info kind_flag is not set, the offset contains only bit -+ * offset. -+ */ -+ __u32 offset; -+}; -+ -+/* If the struct/union type info kind_flag is set, the -+ * following two macros are used to access bitfield_size -+ * and bit_offset from btf_member.offset. -+ */ -+#define BTF_MEMBER_BITFIELD_SIZE(val) ((val) >> 24) -+#define BTF_MEMBER_BIT_OFFSET(val) ((val) & 0xffffff) -+ -+/* BTF_KIND_FUNC_PROTO is followed by multiple "struct btf_param". -+ * The exact number of btf_param is stored in the vlen (of the -+ * info in "struct btf_type"). -+ */ -+struct btf_param { -+ __u32 name_off; -+ __u32 type; -+}; -+ -+enum { -+ BTF_VAR_STATIC = 0, -+ BTF_VAR_GLOBAL_ALLOCATED, -+}; -+ -+/* BTF_KIND_VAR is followed by a single "struct btf_var" to describe -+ * additional information related to the variable such as its linkage. -+ */ -+struct btf_var { -+ __u32 linkage; -+}; -+ -+/* BTF_KIND_DATASEC is followed by multiple "struct btf_var_secinfo" -+ * to describe all BTF_KIND_VAR types it contains along with it's -+ * in-section offset as well as size. -+ */ -+struct btf_var_secinfo { -+ __u32 type; -+ __u32 offset; -+ __u32 size; -+}; -+ -+#endif /* _UAPI__LINUX_BTF_H__ */ ---- a/kernel/bpf/arraymap.c -+++ b/kernel/bpf/arraymap.c -@@ -1,78 +1,141 @@ -+// SPDX-License-Identifier: GPL-2.0-only - /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of version 2 of the GNU General Public -- * License as published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, but -- * WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * General Public License for more details. -+ * Copyright (c) 2016,2017 Facebook - */ - #include -+#include - #include --#include - #include - #include - #include - #include -+#include -+ -+#include "map_in_map.h" -+ -+#define ARRAY_CREATE_FLAG_MASK \ -+ (BPF_F_NUMA_NODE | BPF_F_ACCESS_MASK) -+ -+static void bpf_array_free_percpu(struct bpf_array *array) -+{ -+ int i; -+ -+ for (i = 0; i < array->map.max_entries; i++) { -+ free_percpu(array->pptrs[i]); -+ cond_resched(); -+ } -+} -+ -+static int bpf_array_alloc_percpu(struct bpf_array *array) -+{ -+ void __percpu *ptr; -+ int i; -+ -+ for (i = 0; i < array->map.max_entries; i++) { -+ ptr = __alloc_percpu_gfp(array->elem_size, 8, -+ GFP_USER | __GFP_NOWARN); -+ if (!ptr) { -+ bpf_array_free_percpu(array); -+ return -ENOMEM; -+ } -+ array->pptrs[i] = ptr; -+ cond_resched(); -+ } -+ -+ return 0; -+} - - /* Called from syscall */ --static struct bpf_map *array_map_alloc(union bpf_attr *attr) -+int array_map_alloc_check(union bpf_attr *attr) - { -- struct bpf_array *array; -- u32 elem_size, array_size; -- u32 index_mask, max_entries; -- bool unpriv = !capable(CAP_SYS_ADMIN); -+ bool percpu = attr->map_type == BPF_MAP_TYPE_PERCPU_ARRAY; -+ int numa_node = bpf_map_attr_numa_node(attr); - - /* check sanity of attributes */ - if (attr->max_entries == 0 || attr->key_size != 4 || -- attr->value_size == 0) -- return ERR_PTR(-EINVAL); -+ attr->value_size == 0 || -+ attr->map_flags & ~ARRAY_CREATE_FLAG_MASK || -+ !bpf_map_flags_access_ok(attr->map_flags) || -+ (percpu && numa_node != NUMA_NO_NODE)) -+ return -EINVAL; - -- if (attr->value_size >= 1 << (KMALLOC_SHIFT_MAX - 1)) -+ if (attr->value_size > KMALLOC_MAX_SIZE) - /* if value_size is bigger, the user space won't be able to - * access the elements. - */ -- return ERR_PTR(-E2BIG); -+ return -E2BIG; -+ -+ return 0; -+} -+ -+static struct bpf_map *array_map_alloc(union bpf_attr *attr) -+{ -+ bool percpu = attr->map_type == BPF_MAP_TYPE_PERCPU_ARRAY; -+ int ret, numa_node = bpf_map_attr_numa_node(attr); -+ u32 elem_size, index_mask, max_entries; -+ bool unpriv = !capable(CAP_SYS_ADMIN); -+ u64 cost, array_size, mask64; -+ struct bpf_map_memory mem; -+ struct bpf_array *array; - - elem_size = round_up(attr->value_size, 8); - - max_entries = attr->max_entries; -- index_mask = roundup_pow_of_two(max_entries) - 1; - -- if (unpriv) -+ /* On 32 bit archs roundup_pow_of_two() with max_entries that has -+ * upper most bit set in u32 space is undefined behavior due to -+ * resulting 1U << 32, so do it manually here in u64 space. -+ */ -+ mask64 = fls_long(max_entries - 1); -+ mask64 = 1ULL << mask64; -+ mask64 -= 1; -+ -+ index_mask = mask64; -+ if (unpriv) { - /* round up array size to nearest power of 2, - * since cpu will speculate within index_mask limits - */ - max_entries = index_mask + 1; -+ /* Check for overflows. */ -+ if (max_entries < attr->max_entries) -+ return ERR_PTR(-E2BIG); -+ } - -- -- /* check round_up into zero and u32 overflow */ -- if (elem_size == 0 || -- attr->max_entries > (U32_MAX - PAGE_SIZE - sizeof(*array)) / elem_size) -- return ERR_PTR(-ENOMEM); -- -- array_size = sizeof(*array) + max_entries * elem_size; -+ array_size = sizeof(*array); -+ if (percpu) -+ array_size += (u64) max_entries * sizeof(void *); -+ else -+ array_size += (u64) max_entries * elem_size; -+ -+ /* make sure there is no u32 overflow later in round_up() */ -+ cost = array_size; -+ if (percpu) -+ cost += (u64)attr->max_entries * elem_size * num_possible_cpus(); -+ -+ ret = bpf_map_charge_init(&mem, cost); -+ if (ret < 0) -+ return ERR_PTR(ret); - - /* allocate all map elements and zero-initialize them */ -- array = kzalloc(array_size, GFP_USER | __GFP_NOWARN); -+ array = bpf_map_area_alloc(array_size, numa_node); - if (!array) { -- array = vzalloc(array_size); -- if (!array) -- return ERR_PTR(-ENOMEM); -+ bpf_map_charge_finish(&mem); -+ return ERR_PTR(-ENOMEM); - } -- - array->index_mask = index_mask; - array->map.unpriv_array = unpriv; - - /* copy mandatory map attributes */ -- array->map.key_size = attr->key_size; -- array->map.value_size = attr->value_size; -- array->map.max_entries = attr->max_entries; -- array->map.pages = round_up(array_size, PAGE_SIZE) >> PAGE_SHIFT; -+ bpf_map_init_from_attr(&array->map, attr); -+ bpf_map_charge_move(&array->map.memory, &mem); - array->elem_size = elem_size; - -+ if (percpu && bpf_array_alloc_percpu(array)) { -+ bpf_map_charge_finish(&array->map.memory); -+ bpf_map_area_free(array); -+ return ERR_PTR(-ENOMEM); -+ } -+ - return &array->map; - } - -@@ -82,17 +145,115 @@ static void *array_map_lookup_elem(struc - struct bpf_array *array = container_of(map, struct bpf_array, map); - u32 index = *(u32 *)key; - -- if (index >= array->map.max_entries) -+ if (unlikely(index >= array->map.max_entries)) - return NULL; - - return array->value + array->elem_size * (index & array->index_mask); - } - -+static int array_map_direct_value_addr(const struct bpf_map *map, u64 *imm, -+ u32 off) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ -+ if (map->max_entries != 1) -+ return -ENOTSUPP; -+ if (off >= map->value_size) -+ return -EINVAL; -+ -+ *imm = (unsigned long)array->value; -+ return 0; -+} -+ -+static int array_map_direct_value_meta(const struct bpf_map *map, u64 imm, -+ u32 *off) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ u64 base = (unsigned long)array->value; -+ u64 range = array->elem_size; -+ -+ if (map->max_entries != 1) -+ return -ENOTSUPP; -+ if (imm < base || imm >= base + range) -+ return -ENOENT; -+ -+ *off = imm - base; -+ return 0; -+} -+ -+/* emit BPF instructions equivalent to C code of array_map_lookup_elem() */ -+static u32 array_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ struct bpf_insn *insn = insn_buf; -+ u32 elem_size = round_up(map->value_size, 8); -+ const int ret = BPF_REG_0; -+ const int map_ptr = BPF_REG_1; -+ const int index = BPF_REG_2; -+ -+ *insn++ = BPF_ALU64_IMM(BPF_ADD, map_ptr, offsetof(struct bpf_array, value)); -+ *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); -+ if (map->unpriv_array) { -+ *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 4); -+ *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->index_mask); -+ } else { -+ *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 3); -+ } -+ -+ if (is_power_of_2(elem_size)) { -+ *insn++ = BPF_ALU64_IMM(BPF_LSH, ret, ilog2(elem_size)); -+ } else { -+ *insn++ = BPF_ALU64_IMM(BPF_MUL, ret, elem_size); -+ } -+ *insn++ = BPF_ALU64_REG(BPF_ADD, ret, map_ptr); -+ *insn++ = BPF_JMP_IMM(BPF_JA, 0, 0, 1); -+ *insn++ = BPF_MOV64_IMM(ret, 0); -+ return insn - insn_buf; -+} -+ -+/* Called from eBPF program */ -+static void *percpu_array_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ u32 index = *(u32 *)key; -+ -+ if (unlikely(index >= array->map.max_entries)) -+ return NULL; -+ -+ return this_cpu_ptr(array->pptrs[index & array->index_mask]); -+} -+ -+int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ u32 index = *(u32 *)key; -+ void __percpu *pptr; -+ int cpu, off = 0; -+ u32 size; -+ -+ if (unlikely(index >= array->map.max_entries)) -+ return -ENOENT; -+ -+ /* per_cpu areas are zero-filled and bpf programs can only -+ * access 'value_size' of them, so copying rounded areas -+ * will not leak any kernel data -+ */ -+ size = round_up(map->value_size, 8); -+ rcu_read_lock(); -+ pptr = array->pptrs[index & array->index_mask]; -+ for_each_possible_cpu(cpu) { -+ bpf_long_memcpy(value + off, per_cpu_ptr(pptr, cpu), size); -+ off += size; -+ } -+ rcu_read_unlock(); -+ return 0; -+} -+ - /* Called from syscall */ - static int array_map_get_next_key(struct bpf_map *map, void *key, void *next_key) - { - struct bpf_array *array = container_of(map, struct bpf_array, map); -- u32 index = *(u32 *)key; -+ u32 index = key ? *(u32 *)key : U32_MAX; - u32 *next = (u32 *)next_key; - - if (index >= array->map.max_entries) { -@@ -113,22 +274,73 @@ static int array_map_update_elem(struct - { - struct bpf_array *array = container_of(map, struct bpf_array, map); - u32 index = *(u32 *)key; -+ char *val; - -- if (map_flags > BPF_EXIST) -+ if (unlikely((map_flags & ~BPF_F_LOCK) > BPF_EXIST)) - /* unknown flags */ - return -EINVAL; - -- if (index >= array->map.max_entries) -+ if (unlikely(index >= array->map.max_entries)) -+ /* all elements were pre-allocated, cannot insert a new one */ -+ return -E2BIG; -+ -+ if (unlikely(map_flags & BPF_NOEXIST)) -+ /* all elements already exist */ -+ return -EEXIST; -+ -+ if (unlikely((map_flags & BPF_F_LOCK) && -+ !map_value_has_spin_lock(map))) -+ return -EINVAL; -+ -+ if (array->map.map_type == BPF_MAP_TYPE_PERCPU_ARRAY) { -+ memcpy(this_cpu_ptr(array->pptrs[index & array->index_mask]), -+ value, map->value_size); -+ } else { -+ val = array->value + -+ array->elem_size * (index & array->index_mask); -+ if (map_flags & BPF_F_LOCK) -+ copy_map_value_locked(map, val, value, false); -+ else -+ copy_map_value(map, val, value); -+ } -+ return 0; -+} -+ -+int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value, -+ u64 map_flags) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ u32 index = *(u32 *)key; -+ void __percpu *pptr; -+ int cpu, off = 0; -+ u32 size; -+ -+ if (unlikely(map_flags > BPF_EXIST)) -+ /* unknown flags */ -+ return -EINVAL; -+ -+ if (unlikely(index >= array->map.max_entries)) - /* all elements were pre-allocated, cannot insert a new one */ - return -E2BIG; - -- if (map_flags == BPF_NOEXIST) -+ if (unlikely(map_flags == BPF_NOEXIST)) - /* all elements already exist */ - return -EEXIST; - -- memcpy(array->value + -- array->elem_size * (index & array->index_mask), -- value, map->value_size); -+ /* the user space will provide round_up(value_size, 8) bytes that -+ * will be copied into per-cpu area. bpf programs can only access -+ * value_size of it. During lookup the same extra bytes will be -+ * returned or zeros which were zero-filled by percpu_alloc, -+ * so no kernel data leaks possible -+ */ -+ size = round_up(map->value_size, 8); -+ rcu_read_lock(); -+ pptr = array->pptrs[index & array->index_mask]; -+ for_each_possible_cpu(cpu) { -+ bpf_long_memcpy(per_cpu_ptr(pptr, cpu), value + off, size); -+ off += size; -+ } -+ rcu_read_unlock(); - return 0; - } - -@@ -150,36 +362,124 @@ static void array_map_free(struct bpf_ma - */ - synchronize_rcu(); - -- kvfree(array); -+ if (array->map.map_type == BPF_MAP_TYPE_PERCPU_ARRAY) -+ bpf_array_free_percpu(array); -+ -+ bpf_map_area_free(array); - } - --static const struct bpf_map_ops array_ops = { -+static void array_map_seq_show_elem(struct bpf_map *map, void *key, -+ struct seq_file *m) -+{ -+ void *value; -+ -+ rcu_read_lock(); -+ -+ value = array_map_lookup_elem(map, key); -+ if (!value) { -+ rcu_read_unlock(); -+ return; -+ } -+ -+ if (map->btf_key_type_id) -+ seq_printf(m, "%u: ", *(u32 *)key); -+ btf_type_seq_show(map->btf, map->btf_value_type_id, value, m); -+ seq_puts(m, "\n"); -+ -+ rcu_read_unlock(); -+} -+ -+static void percpu_array_map_seq_show_elem(struct bpf_map *map, void *key, -+ struct seq_file *m) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ u32 index = *(u32 *)key; -+ void __percpu *pptr; -+ int cpu; -+ -+ rcu_read_lock(); -+ -+ seq_printf(m, "%u: {\n", *(u32 *)key); -+ pptr = array->pptrs[index & array->index_mask]; -+ for_each_possible_cpu(cpu) { -+ seq_printf(m, "\tcpu%d: ", cpu); -+ btf_type_seq_show(map->btf, map->btf_value_type_id, -+ per_cpu_ptr(pptr, cpu), m); -+ seq_puts(m, "\n"); -+ } -+ seq_puts(m, "}\n"); -+ -+ rcu_read_unlock(); -+} -+ -+static int array_map_check_btf(const struct bpf_map *map, -+ const struct btf *btf, -+ const struct btf_type *key_type, -+ const struct btf_type *value_type) -+{ -+ u32 int_data; -+ -+ /* One exception for keyless BTF: .bss/.data/.rodata map */ -+ if (btf_type_is_void(key_type)) { -+ if (map->map_type != BPF_MAP_TYPE_ARRAY || -+ map->max_entries != 1) -+ return -EINVAL; -+ -+ if (BTF_INFO_KIND(value_type->info) != BTF_KIND_DATASEC) -+ return -EINVAL; -+ -+ return 0; -+ } -+ -+ if (BTF_INFO_KIND(key_type->info) != BTF_KIND_INT) -+ return -EINVAL; -+ -+ int_data = *(u32 *)(key_type + 1); -+ /* bpf array can only take a u32 key. This check makes sure -+ * that the btf matches the attr used during map_create. -+ */ -+ if (BTF_INT_BITS(int_data) != 32 || BTF_INT_OFFSET(int_data)) -+ return -EINVAL; -+ -+ return 0; -+} -+ -+const struct bpf_map_ops array_map_ops = { -+ .map_alloc_check = array_map_alloc_check, - .map_alloc = array_map_alloc, - .map_free = array_map_free, - .map_get_next_key = array_map_get_next_key, - .map_lookup_elem = array_map_lookup_elem, - .map_update_elem = array_map_update_elem, - .map_delete_elem = array_map_delete_elem, -+ .map_gen_lookup = array_map_gen_lookup, -+ .map_direct_value_addr = array_map_direct_value_addr, -+ .map_direct_value_meta = array_map_direct_value_meta, -+ .map_seq_show_elem = array_map_seq_show_elem, -+ .map_check_btf = array_map_check_btf, - }; - --static struct bpf_map_type_list array_type __read_mostly = { -- .ops = &array_ops, -- .type = BPF_MAP_TYPE_ARRAY, -+const struct bpf_map_ops percpu_array_map_ops = { -+ .map_alloc_check = array_map_alloc_check, -+ .map_alloc = array_map_alloc, -+ .map_free = array_map_free, -+ .map_get_next_key = array_map_get_next_key, -+ .map_lookup_elem = percpu_array_map_lookup_elem, -+ .map_update_elem = array_map_update_elem, -+ .map_delete_elem = array_map_delete_elem, -+ .map_seq_show_elem = percpu_array_map_seq_show_elem, -+ .map_check_btf = array_map_check_btf, - }; - --static int __init register_array_map(void) --{ -- bpf_register_map_type(&array_type); -- return 0; --} --late_initcall(register_array_map); -- --static struct bpf_map *fd_array_map_alloc(union bpf_attr *attr) -+static int fd_array_map_alloc_check(union bpf_attr *attr) - { - /* only file descriptors can be stored in this type of map */ - if (attr->value_size != sizeof(u32)) -- return ERR_PTR(-EINVAL); -- return array_map_alloc(attr); -+ return -EINVAL; -+ /* Program read-only/write-only not supported for special maps yet. */ -+ if (attr->map_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG)) -+ return -EINVAL; -+ return array_map_alloc_check(attr); - } - - static void fd_array_map_free(struct bpf_map *map) -@@ -192,17 +492,38 @@ static void fd_array_map_free(struct bpf - /* make sure it's empty */ - for (i = 0; i < array->map.max_entries; i++) - BUG_ON(array->ptrs[i] != NULL); -- kvfree(array); -+ -+ bpf_map_area_free(array); - } - - static void *fd_array_map_lookup_elem(struct bpf_map *map, void *key) - { -- return NULL; -+ return ERR_PTR(-EOPNOTSUPP); -+} -+ -+/* only called from syscall */ -+int bpf_fd_array_map_lookup_elem(struct bpf_map *map, void *key, u32 *value) -+{ -+ void **elem, *ptr; -+ int ret = 0; -+ -+ if (!map->ops->map_fd_sys_lookup_elem) -+ return -ENOTSUPP; -+ -+ rcu_read_lock(); -+ elem = array_map_lookup_elem(map, key); -+ if (elem && (ptr = READ_ONCE(*elem))) -+ *value = map->ops->map_fd_sys_lookup_elem(ptr); -+ else -+ ret = -ENOENT; -+ rcu_read_unlock(); -+ -+ return ret; - } - - /* only called from syscall */ --static int fd_array_map_update_elem(struct bpf_map *map, void *key, -- void *value, u64 map_flags) -+int bpf_fd_array_map_update_elem(struct bpf_map *map, struct file *map_file, -+ void *key, void *value, u64 map_flags) - { - struct bpf_array *array = container_of(map, struct bpf_array, map); - void *new_ptr, *old_ptr; -@@ -215,7 +536,7 @@ static int fd_array_map_update_elem(stru - return -E2BIG; - - ufd = *(u32 *)value; -- new_ptr = map->ops->map_fd_get_ptr(map, ufd); -+ new_ptr = map->ops->map_fd_get_ptr(map, map_file, ufd); - if (IS_ERR(new_ptr)) - return PTR_ERR(new_ptr); - -@@ -244,10 +565,12 @@ static int fd_array_map_delete_elem(stru - } - } - --static void *prog_fd_array_get_ptr(struct bpf_map *map, int fd) -+static void *prog_fd_array_get_ptr(struct bpf_map *map, -+ struct file *map_file, int fd) - { - struct bpf_array *array = container_of(map, struct bpf_array, map); - struct bpf_prog *prog = bpf_prog_get(fd); -+ - if (IS_ERR(prog)) - return prog; - -@@ -255,18 +578,22 @@ static void *prog_fd_array_get_ptr(struc - bpf_prog_put(prog); - return ERR_PTR(-EINVAL); - } -+ - return prog; - } - - static void prog_fd_array_put_ptr(void *ptr) - { -- struct bpf_prog *prog = ptr; -+ bpf_prog_put(ptr); -+} - -- bpf_prog_put_rcu(prog); -+static u32 prog_fd_array_sys_lookup_elem(void *ptr) -+{ -+ return ((struct bpf_prog *)ptr)->aux->id; - } - - /* decrement refcnt of all bpf_progs that are stored in this map */ --void bpf_fd_array_map_clear(struct bpf_map *map) -+static void bpf_fd_array_map_clear(struct bpf_map *map) - { - struct bpf_array *array = container_of(map, struct bpf_array, map); - int i; -@@ -275,91 +602,208 @@ void bpf_fd_array_map_clear(struct bpf_m - fd_array_map_delete_elem(map, &i); - } - --static const struct bpf_map_ops prog_array_ops = { -- .map_alloc = fd_array_map_alloc, -+static void prog_array_map_seq_show_elem(struct bpf_map *map, void *key, -+ struct seq_file *m) -+{ -+ void **elem, *ptr; -+ u32 prog_id; -+ -+ rcu_read_lock(); -+ -+ elem = array_map_lookup_elem(map, key); -+ if (elem) { -+ ptr = READ_ONCE(*elem); -+ if (ptr) { -+ seq_printf(m, "%u: ", *(u32 *)key); -+ prog_id = prog_fd_array_sys_lookup_elem(ptr); -+ btf_type_seq_show(map->btf, map->btf_value_type_id, -+ &prog_id, m); -+ seq_puts(m, "\n"); -+ } -+ } -+ -+ rcu_read_unlock(); -+} -+ -+const struct bpf_map_ops prog_array_map_ops = { -+ .map_alloc_check = fd_array_map_alloc_check, -+ .map_alloc = array_map_alloc, - .map_free = fd_array_map_free, - .map_get_next_key = array_map_get_next_key, - .map_lookup_elem = fd_array_map_lookup_elem, -- .map_update_elem = fd_array_map_update_elem, - .map_delete_elem = fd_array_map_delete_elem, - .map_fd_get_ptr = prog_fd_array_get_ptr, - .map_fd_put_ptr = prog_fd_array_put_ptr, -+ .map_fd_sys_lookup_elem = prog_fd_array_sys_lookup_elem, -+ .map_release_uref = bpf_fd_array_map_clear, -+ .map_seq_show_elem = prog_array_map_seq_show_elem, - }; - --static struct bpf_map_type_list prog_array_type __read_mostly = { -- .ops = &prog_array_ops, -- .type = BPF_MAP_TYPE_PROG_ARRAY, --}; -+static struct bpf_event_entry *bpf_event_entry_gen(struct file *perf_file, -+ struct file *map_file) -+{ -+ struct bpf_event_entry *ee; -+ -+ ee = kzalloc(sizeof(*ee), GFP_ATOMIC); -+ if (ee) { -+ ee->event = perf_file->private_data; -+ ee->perf_file = perf_file; -+ ee->map_file = map_file; -+ } - --static int __init register_prog_array_map(void) -+ return ee; -+} -+ -+static void __bpf_event_entry_free(struct rcu_head *rcu) - { -- bpf_register_map_type(&prog_array_type); -- return 0; -+ struct bpf_event_entry *ee; -+ -+ ee = container_of(rcu, struct bpf_event_entry, rcu); -+ fput(ee->perf_file); -+ kfree(ee); - } --late_initcall(register_prog_array_map); - --static void perf_event_array_map_free(struct bpf_map *map) -+static void bpf_event_entry_free_rcu(struct bpf_event_entry *ee) - { -- bpf_fd_array_map_clear(map); -- fd_array_map_free(map); -+ call_rcu(&ee->rcu, __bpf_event_entry_free); - } - --static void *perf_event_fd_array_get_ptr(struct bpf_map *map, int fd) -+static void *perf_event_fd_array_get_ptr(struct bpf_map *map, -+ struct file *map_file, int fd) - { -+ struct bpf_event_entry *ee; - struct perf_event *event; -- const struct perf_event_attr *attr; -+ struct file *perf_file; -+ u64 value; - - event = perf_event_get(fd); - if (IS_ERR(event)) - return event; - -- attr = perf_event_attrs(event); -- if (IS_ERR(attr)) -- goto err; -- -- if (attr->inherit) -- goto err; -+ value = perf_event_read_local(event); - -- if (attr->type == PERF_TYPE_RAW) -- return event; -- -- if (attr->type == PERF_TYPE_HARDWARE) -- return event; -+ ee = bpf_event_entry_gen(perf_file, map_file); -+ if (ee) -+ return ee; - -- if (attr->type == PERF_TYPE_SOFTWARE && -- attr->config == PERF_COUNT_SW_BPF_OUTPUT) -- return event; --err: -- perf_event_release_kernel(event); -- return ERR_PTR(-EINVAL); -+ ee = ERR_PTR(-ENOMEM); -+ return ee; - } - - static void perf_event_fd_array_put_ptr(void *ptr) - { -- struct perf_event *event = ptr; -+ bpf_event_entry_free_rcu(ptr); -+} - -- perf_event_release_kernel(event); -+static void perf_event_fd_array_release(struct bpf_map *map, -+ struct file *map_file) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ struct bpf_event_entry *ee; -+ int i; -+ -+ rcu_read_lock(); -+ for (i = 0; i < array->map.max_entries; i++) { -+ ee = READ_ONCE(array->ptrs[i]); -+ if (ee && ee->map_file == map_file) -+ fd_array_map_delete_elem(map, &i); -+ } -+ rcu_read_unlock(); - } - --static const struct bpf_map_ops perf_event_array_ops = { -- .map_alloc = fd_array_map_alloc, -- .map_free = perf_event_array_map_free, -+const struct bpf_map_ops perf_event_array_map_ops = { -+ .map_alloc_check = fd_array_map_alloc_check, -+ .map_alloc = array_map_alloc, -+ .map_free = fd_array_map_free, - .map_get_next_key = array_map_get_next_key, - .map_lookup_elem = fd_array_map_lookup_elem, -- .map_update_elem = fd_array_map_update_elem, - .map_delete_elem = fd_array_map_delete_elem, - .map_fd_get_ptr = perf_event_fd_array_get_ptr, - .map_fd_put_ptr = perf_event_fd_array_put_ptr, -+ .map_release = perf_event_fd_array_release, -+ .map_check_btf = map_check_no_btf, - }; - --static struct bpf_map_type_list perf_event_array_type __read_mostly = { -- .ops = &perf_event_array_ops, -- .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, --}; -+static struct bpf_map *array_of_map_alloc(union bpf_attr *attr) -+{ -+ struct bpf_map *map, *inner_map_meta; -+ -+ inner_map_meta = bpf_map_meta_alloc(attr->inner_map_fd); -+ if (IS_ERR(inner_map_meta)) -+ return inner_map_meta; -+ -+ map = array_map_alloc(attr); -+ if (IS_ERR(map)) { -+ bpf_map_meta_free(inner_map_meta); -+ return map; -+ } -+ -+ map->inner_map_meta = inner_map_meta; - --static int __init register_perf_event_array_map(void) -+ return map; -+} -+ -+static void array_of_map_free(struct bpf_map *map) - { -- bpf_register_map_type(&perf_event_array_type); -- return 0; -+ /* map->inner_map_meta is only accessed by syscall which -+ * is protected by fdget/fdput. -+ */ -+ bpf_map_meta_free(map->inner_map_meta); -+ bpf_fd_array_map_clear(map); -+ fd_array_map_free(map); - } --late_initcall(register_perf_event_array_map); -+ -+static void *array_of_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_map **inner_map = array_map_lookup_elem(map, key); -+ -+ if (!inner_map) -+ return NULL; -+ -+ return READ_ONCE(*inner_map); -+} -+ -+static u32 array_of_map_gen_lookup(struct bpf_map *map, -+ struct bpf_insn *insn_buf) -+{ -+ struct bpf_array *array = container_of(map, struct bpf_array, map); -+ u32 elem_size = round_up(map->value_size, 8); -+ struct bpf_insn *insn = insn_buf; -+ const int ret = BPF_REG_0; -+ const int map_ptr = BPF_REG_1; -+ const int index = BPF_REG_2; -+ -+ *insn++ = BPF_ALU64_IMM(BPF_ADD, map_ptr, offsetof(struct bpf_array, value)); -+ *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); -+ if (map->unpriv_array) { -+ *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 6); -+ *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->index_mask); -+ } else { -+ *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 5); -+ } -+ if (is_power_of_2(elem_size)) -+ *insn++ = BPF_ALU64_IMM(BPF_LSH, ret, ilog2(elem_size)); -+ else -+ *insn++ = BPF_ALU64_IMM(BPF_MUL, ret, elem_size); -+ *insn++ = BPF_ALU64_REG(BPF_ADD, ret, map_ptr); -+ *insn++ = BPF_LDX_MEM(BPF_DW, ret, ret, 0); -+ *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 1); -+ *insn++ = BPF_JMP_IMM(BPF_JA, 0, 0, 1); -+ *insn++ = BPF_MOV64_IMM(ret, 0); -+ -+ return insn - insn_buf; -+} -+ -+const struct bpf_map_ops array_of_maps_map_ops = { -+ .map_alloc_check = fd_array_map_alloc_check, -+ .map_alloc = array_of_map_alloc, -+ .map_free = array_of_map_free, -+ .map_get_next_key = array_map_get_next_key, -+ .map_lookup_elem = array_of_map_lookup_elem, -+ .map_delete_elem = fd_array_map_delete_elem, -+ .map_fd_get_ptr = bpf_map_fd_get_ptr, -+ .map_fd_put_ptr = bpf_map_fd_put_ptr, -+ .map_fd_sys_lookup_elem = bpf_map_fd_sys_lookup_elem, -+ .map_gen_lookup = array_of_map_gen_lookup, -+ .map_check_btf = map_check_no_btf, -+}; ---- /dev/null -+++ b/kernel/bpf/bpf_lru_list.c -@@ -0,0 +1,695 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* Copyright (c) 2016 Facebook -+ */ -+#include -+#include -+#include -+ -+#include "bpf_lru_list.h" -+ -+#define LOCAL_FREE_TARGET (128) -+#define LOCAL_NR_SCANS LOCAL_FREE_TARGET -+ -+#define PERCPU_FREE_TARGET (4) -+#define PERCPU_NR_SCANS PERCPU_FREE_TARGET -+ -+/* Helpers to get the local list index */ -+#define LOCAL_LIST_IDX(t) ((t) - BPF_LOCAL_LIST_T_OFFSET) -+#define LOCAL_FREE_LIST_IDX LOCAL_LIST_IDX(BPF_LRU_LOCAL_LIST_T_FREE) -+#define LOCAL_PENDING_LIST_IDX LOCAL_LIST_IDX(BPF_LRU_LOCAL_LIST_T_PENDING) -+#define IS_LOCAL_LIST_TYPE(t) ((t) >= BPF_LOCAL_LIST_T_OFFSET) -+ -+static int get_next_cpu(int cpu) -+{ -+ cpu = cpumask_next(cpu, cpu_possible_mask); -+ if (cpu >= nr_cpu_ids) -+ cpu = cpumask_first(cpu_possible_mask); -+ return cpu; -+} -+ -+/* Local list helpers */ -+static struct list_head *local_free_list(struct bpf_lru_locallist *loc_l) -+{ -+ return &loc_l->lists[LOCAL_FREE_LIST_IDX]; -+} -+ -+static struct list_head *local_pending_list(struct bpf_lru_locallist *loc_l) -+{ -+ return &loc_l->lists[LOCAL_PENDING_LIST_IDX]; -+} -+ -+/* bpf_lru_node helpers */ -+static bool bpf_lru_node_is_ref(const struct bpf_lru_node *node) -+{ -+ return node->ref; -+} -+ -+static void bpf_lru_list_count_inc(struct bpf_lru_list *l, -+ enum bpf_lru_list_type type) -+{ -+ if (type < NR_BPF_LRU_LIST_COUNT) -+ l->counts[type]++; -+} -+ -+static void bpf_lru_list_count_dec(struct bpf_lru_list *l, -+ enum bpf_lru_list_type type) -+{ -+ if (type < NR_BPF_LRU_LIST_COUNT) -+ l->counts[type]--; -+} -+ -+static void __bpf_lru_node_move_to_free(struct bpf_lru_list *l, -+ struct bpf_lru_node *node, -+ struct list_head *free_list, -+ enum bpf_lru_list_type tgt_free_type) -+{ -+ if (WARN_ON_ONCE(IS_LOCAL_LIST_TYPE(node->type))) -+ return; -+ -+ /* If the removing node is the next_inactive_rotation candidate, -+ * move the next_inactive_rotation pointer also. -+ */ -+ if (&node->list == l->next_inactive_rotation) -+ l->next_inactive_rotation = l->next_inactive_rotation->prev; -+ -+ bpf_lru_list_count_dec(l, node->type); -+ -+ node->type = tgt_free_type; -+ list_move(&node->list, free_list); -+} -+ -+/* Move nodes from local list to the LRU list */ -+static void __bpf_lru_node_move_in(struct bpf_lru_list *l, -+ struct bpf_lru_node *node, -+ enum bpf_lru_list_type tgt_type) -+{ -+ if (WARN_ON_ONCE(!IS_LOCAL_LIST_TYPE(node->type)) || -+ WARN_ON_ONCE(IS_LOCAL_LIST_TYPE(tgt_type))) -+ return; -+ -+ bpf_lru_list_count_inc(l, tgt_type); -+ node->type = tgt_type; -+ node->ref = 0; -+ list_move(&node->list, &l->lists[tgt_type]); -+} -+ -+/* Move nodes between or within active and inactive list (like -+ * active to inactive, inactive to active or tail of active back to -+ * the head of active). -+ */ -+static void __bpf_lru_node_move(struct bpf_lru_list *l, -+ struct bpf_lru_node *node, -+ enum bpf_lru_list_type tgt_type) -+{ -+ if (WARN_ON_ONCE(IS_LOCAL_LIST_TYPE(node->type)) || -+ WARN_ON_ONCE(IS_LOCAL_LIST_TYPE(tgt_type))) -+ return; -+ -+ if (node->type != tgt_type) { -+ bpf_lru_list_count_dec(l, node->type); -+ bpf_lru_list_count_inc(l, tgt_type); -+ node->type = tgt_type; -+ } -+ node->ref = 0; -+ -+ /* If the moving node is the next_inactive_rotation candidate, -+ * move the next_inactive_rotation pointer also. -+ */ -+ if (&node->list == l->next_inactive_rotation) -+ l->next_inactive_rotation = l->next_inactive_rotation->prev; -+ -+ list_move(&node->list, &l->lists[tgt_type]); -+} -+ -+static bool bpf_lru_list_inactive_low(const struct bpf_lru_list *l) -+{ -+ return l->counts[BPF_LRU_LIST_T_INACTIVE] < -+ l->counts[BPF_LRU_LIST_T_ACTIVE]; -+} -+ -+/* Rotate the active list: -+ * 1. Start from tail -+ * 2. If the node has the ref bit set, it will be rotated -+ * back to the head of active list with the ref bit cleared. -+ * Give this node one more chance to survive in the active list. -+ * 3. If the ref bit is not set, move it to the head of the -+ * inactive list. -+ * 4. It will at most scan nr_scans nodes -+ */ -+static void __bpf_lru_list_rotate_active(struct bpf_lru *lru, -+ struct bpf_lru_list *l) -+{ -+ struct list_head *active = &l->lists[BPF_LRU_LIST_T_ACTIVE]; -+ struct bpf_lru_node *node, *tmp_node, *first_node; -+ unsigned int i = 0; -+ -+ first_node = list_first_entry(active, struct bpf_lru_node, list); -+ list_for_each_entry_safe_reverse(node, tmp_node, active, list) { -+ if (bpf_lru_node_is_ref(node)) -+ __bpf_lru_node_move(l, node, BPF_LRU_LIST_T_ACTIVE); -+ else -+ __bpf_lru_node_move(l, node, BPF_LRU_LIST_T_INACTIVE); -+ -+ if (++i == lru->nr_scans || node == first_node) -+ break; -+ } -+} -+ -+/* Rotate the inactive list. It starts from the next_inactive_rotation -+ * 1. If the node has ref bit set, it will be moved to the head -+ * of active list with the ref bit cleared. -+ * 2. If the node does not have ref bit set, it will leave it -+ * at its current location (i.e. do nothing) so that it can -+ * be considered during the next inactive_shrink. -+ * 3. It will at most scan nr_scans nodes -+ */ -+static void __bpf_lru_list_rotate_inactive(struct bpf_lru *lru, -+ struct bpf_lru_list *l) -+{ -+ struct list_head *inactive = &l->lists[BPF_LRU_LIST_T_INACTIVE]; -+ struct list_head *cur, *last, *next = inactive; -+ struct bpf_lru_node *node; -+ unsigned int i = 0; -+ -+ if (list_empty(inactive)) -+ return; -+ -+ last = l->next_inactive_rotation->next; -+ if (last == inactive) -+ last = last->next; -+ -+ cur = l->next_inactive_rotation; -+ while (i < lru->nr_scans) { -+ if (cur == inactive) { -+ cur = cur->prev; -+ continue; -+ } -+ -+ node = list_entry(cur, struct bpf_lru_node, list); -+ next = cur->prev; -+ if (bpf_lru_node_is_ref(node)) -+ __bpf_lru_node_move(l, node, BPF_LRU_LIST_T_ACTIVE); -+ if (cur == last) -+ break; -+ cur = next; -+ i++; -+ } -+ -+ l->next_inactive_rotation = next; -+} -+ -+/* Shrink the inactive list. It starts from the tail of the -+ * inactive list and only move the nodes without the ref bit -+ * set to the designated free list. -+ */ -+static unsigned int -+__bpf_lru_list_shrink_inactive(struct bpf_lru *lru, -+ struct bpf_lru_list *l, -+ unsigned int tgt_nshrink, -+ struct list_head *free_list, -+ enum bpf_lru_list_type tgt_free_type) -+{ -+ struct list_head *inactive = &l->lists[BPF_LRU_LIST_T_INACTIVE]; -+ struct bpf_lru_node *node, *tmp_node; -+ unsigned int nshrinked = 0; -+ unsigned int i = 0; -+ -+ list_for_each_entry_safe_reverse(node, tmp_node, inactive, list) { -+ if (bpf_lru_node_is_ref(node)) { -+ __bpf_lru_node_move(l, node, BPF_LRU_LIST_T_ACTIVE); -+ } else if (lru->del_from_htab(lru->del_arg, node)) { -+ __bpf_lru_node_move_to_free(l, node, free_list, -+ tgt_free_type); -+ if (++nshrinked == tgt_nshrink) -+ break; -+ } -+ -+ if (++i == lru->nr_scans) -+ break; -+ } -+ -+ return nshrinked; -+} -+ -+/* 1. Rotate the active list (if needed) -+ * 2. Always rotate the inactive list -+ */ -+static void __bpf_lru_list_rotate(struct bpf_lru *lru, struct bpf_lru_list *l) -+{ -+ if (bpf_lru_list_inactive_low(l)) -+ __bpf_lru_list_rotate_active(lru, l); -+ -+ __bpf_lru_list_rotate_inactive(lru, l); -+} -+ -+/* Calls __bpf_lru_list_shrink_inactive() to shrink some -+ * ref-bit-cleared nodes and move them to the designated -+ * free list. -+ * -+ * If it cannot get a free node after calling -+ * __bpf_lru_list_shrink_inactive(). It will just remove -+ * one node from either inactive or active list without -+ * honoring the ref-bit. It prefers inactive list to active -+ * list in this situation. -+ */ -+static unsigned int __bpf_lru_list_shrink(struct bpf_lru *lru, -+ struct bpf_lru_list *l, -+ unsigned int tgt_nshrink, -+ struct list_head *free_list, -+ enum bpf_lru_list_type tgt_free_type) -+ -+{ -+ struct bpf_lru_node *node, *tmp_node; -+ struct list_head *force_shrink_list; -+ unsigned int nshrinked; -+ -+ nshrinked = __bpf_lru_list_shrink_inactive(lru, l, tgt_nshrink, -+ free_list, tgt_free_type); -+ if (nshrinked) -+ return nshrinked; -+ -+ /* Do a force shrink by ignoring the reference bit */ -+ if (!list_empty(&l->lists[BPF_LRU_LIST_T_INACTIVE])) -+ force_shrink_list = &l->lists[BPF_LRU_LIST_T_INACTIVE]; -+ else -+ force_shrink_list = &l->lists[BPF_LRU_LIST_T_ACTIVE]; -+ -+ list_for_each_entry_safe_reverse(node, tmp_node, force_shrink_list, -+ list) { -+ if (lru->del_from_htab(lru->del_arg, node)) { -+ __bpf_lru_node_move_to_free(l, node, free_list, -+ tgt_free_type); -+ return 1; -+ } -+ } -+ -+ return 0; -+} -+ -+/* Flush the nodes from the local pending list to the LRU list */ -+static void __local_list_flush(struct bpf_lru_list *l, -+ struct bpf_lru_locallist *loc_l) -+{ -+ struct bpf_lru_node *node, *tmp_node; -+ -+ list_for_each_entry_safe_reverse(node, tmp_node, -+ local_pending_list(loc_l), list) { -+ if (bpf_lru_node_is_ref(node)) -+ __bpf_lru_node_move_in(l, node, BPF_LRU_LIST_T_ACTIVE); -+ else -+ __bpf_lru_node_move_in(l, node, -+ BPF_LRU_LIST_T_INACTIVE); -+ } -+} -+ -+static void bpf_lru_list_push_free(struct bpf_lru_list *l, -+ struct bpf_lru_node *node) -+{ -+ unsigned long flags; -+ -+ if (WARN_ON_ONCE(IS_LOCAL_LIST_TYPE(node->type))) -+ return; -+ -+ raw_spin_lock_irqsave(&l->lock, flags); -+ __bpf_lru_node_move(l, node, BPF_LRU_LIST_T_FREE); -+ raw_spin_unlock_irqrestore(&l->lock, flags); -+} -+ -+static void bpf_lru_list_pop_free_to_local(struct bpf_lru *lru, -+ struct bpf_lru_locallist *loc_l) -+{ -+ struct bpf_lru_list *l = &lru->common_lru.lru_list; -+ struct bpf_lru_node *node, *tmp_node; -+ unsigned int nfree = 0; -+ -+ raw_spin_lock(&l->lock); -+ -+ __local_list_flush(l, loc_l); -+ -+ __bpf_lru_list_rotate(lru, l); -+ -+ list_for_each_entry_safe(node, tmp_node, &l->lists[BPF_LRU_LIST_T_FREE], -+ list) { -+ __bpf_lru_node_move_to_free(l, node, local_free_list(loc_l), -+ BPF_LRU_LOCAL_LIST_T_FREE); -+ if (++nfree == LOCAL_FREE_TARGET) -+ break; -+ } -+ -+ if (nfree < LOCAL_FREE_TARGET) -+ __bpf_lru_list_shrink(lru, l, LOCAL_FREE_TARGET - nfree, -+ local_free_list(loc_l), -+ BPF_LRU_LOCAL_LIST_T_FREE); -+ -+ raw_spin_unlock(&l->lock); -+} -+ -+static void __local_list_add_pending(struct bpf_lru *lru, -+ struct bpf_lru_locallist *loc_l, -+ int cpu, -+ struct bpf_lru_node *node, -+ u32 hash) -+{ -+ *(u32 *)((void *)node + lru->hash_offset) = hash; -+ node->cpu = cpu; -+ node->type = BPF_LRU_LOCAL_LIST_T_PENDING; -+ node->ref = 0; -+ list_add(&node->list, local_pending_list(loc_l)); -+} -+ -+static struct bpf_lru_node * -+__local_list_pop_free(struct bpf_lru_locallist *loc_l) -+{ -+ struct bpf_lru_node *node; -+ -+ node = list_first_entry_or_null(local_free_list(loc_l), -+ struct bpf_lru_node, -+ list); -+ if (node) -+ list_del(&node->list); -+ -+ return node; -+} -+ -+static struct bpf_lru_node * -+__local_list_pop_pending(struct bpf_lru *lru, struct bpf_lru_locallist *loc_l) -+{ -+ struct bpf_lru_node *node; -+ bool force = false; -+ -+ignore_ref: -+ /* Get from the tail (i.e. older element) of the pending list. */ -+ list_for_each_entry_reverse(node, local_pending_list(loc_l), -+ list) { -+ if ((!bpf_lru_node_is_ref(node) || force) && -+ lru->del_from_htab(lru->del_arg, node)) { -+ list_del(&node->list); -+ return node; -+ } -+ } -+ -+ if (!force) { -+ force = true; -+ goto ignore_ref; -+ } -+ -+ return NULL; -+} -+ -+static struct bpf_lru_node *bpf_percpu_lru_pop_free(struct bpf_lru *lru, -+ u32 hash) -+{ -+ struct list_head *free_list; -+ struct bpf_lru_node *node = NULL; -+ struct bpf_lru_list *l; -+ unsigned long flags; -+ int cpu = raw_smp_processor_id(); -+ -+ l = per_cpu_ptr(lru->percpu_lru, cpu); -+ -+ raw_spin_lock_irqsave(&l->lock, flags); -+ -+ __bpf_lru_list_rotate(lru, l); -+ -+ free_list = &l->lists[BPF_LRU_LIST_T_FREE]; -+ if (list_empty(free_list)) -+ __bpf_lru_list_shrink(lru, l, PERCPU_FREE_TARGET, free_list, -+ BPF_LRU_LIST_T_FREE); -+ -+ if (!list_empty(free_list)) { -+ node = list_first_entry(free_list, struct bpf_lru_node, list); -+ *(u32 *)((void *)node + lru->hash_offset) = hash; -+ node->ref = 0; -+ __bpf_lru_node_move(l, node, BPF_LRU_LIST_T_INACTIVE); -+ } -+ -+ raw_spin_unlock_irqrestore(&l->lock, flags); -+ -+ return node; -+} -+ -+static struct bpf_lru_node *bpf_common_lru_pop_free(struct bpf_lru *lru, -+ u32 hash) -+{ -+ struct bpf_lru_locallist *loc_l, *steal_loc_l; -+ struct bpf_common_lru *clru = &lru->common_lru; -+ struct bpf_lru_node *node; -+ int steal, first_steal; -+ unsigned long flags; -+ int cpu = raw_smp_processor_id(); -+ -+ loc_l = per_cpu_ptr(clru->local_list, cpu); -+ -+ raw_spin_lock_irqsave(&loc_l->lock, flags); -+ -+ node = __local_list_pop_free(loc_l); -+ if (!node) { -+ bpf_lru_list_pop_free_to_local(lru, loc_l); -+ node = __local_list_pop_free(loc_l); -+ } -+ -+ if (node) -+ __local_list_add_pending(lru, loc_l, cpu, node, hash); -+ -+ raw_spin_unlock_irqrestore(&loc_l->lock, flags); -+ -+ if (node) -+ return node; -+ -+ /* No free nodes found from the local free list and -+ * the global LRU list. -+ * -+ * Steal from the local free/pending list of the -+ * current CPU and remote CPU in RR. It starts -+ * with the loc_l->next_steal CPU. -+ */ -+ -+ first_steal = loc_l->next_steal; -+ steal = first_steal; -+ do { -+ steal_loc_l = per_cpu_ptr(clru->local_list, steal); -+ -+ raw_spin_lock_irqsave(&steal_loc_l->lock, flags); -+ -+ node = __local_list_pop_free(steal_loc_l); -+ if (!node) -+ node = __local_list_pop_pending(lru, steal_loc_l); -+ -+ raw_spin_unlock_irqrestore(&steal_loc_l->lock, flags); -+ -+ steal = get_next_cpu(steal); -+ } while (!node && steal != first_steal); -+ -+ loc_l->next_steal = steal; -+ -+ if (node) { -+ raw_spin_lock_irqsave(&loc_l->lock, flags); -+ __local_list_add_pending(lru, loc_l, cpu, node, hash); -+ raw_spin_unlock_irqrestore(&loc_l->lock, flags); -+ } -+ -+ return node; -+} -+ -+struct bpf_lru_node *bpf_lru_pop_free(struct bpf_lru *lru, u32 hash) -+{ -+ if (lru->percpu) -+ return bpf_percpu_lru_pop_free(lru, hash); -+ else -+ return bpf_common_lru_pop_free(lru, hash); -+} -+ -+static void bpf_common_lru_push_free(struct bpf_lru *lru, -+ struct bpf_lru_node *node) -+{ -+ u8 node_type = READ_ONCE(node->type); -+ unsigned long flags; -+ -+ if (WARN_ON_ONCE(node_type == BPF_LRU_LIST_T_FREE) || -+ WARN_ON_ONCE(node_type == BPF_LRU_LOCAL_LIST_T_FREE)) -+ return; -+ -+ if (node_type == BPF_LRU_LOCAL_LIST_T_PENDING) { -+ struct bpf_lru_locallist *loc_l; -+ -+ loc_l = per_cpu_ptr(lru->common_lru.local_list, node->cpu); -+ -+ raw_spin_lock_irqsave(&loc_l->lock, flags); -+ -+ if (unlikely(node->type != BPF_LRU_LOCAL_LIST_T_PENDING)) { -+ raw_spin_unlock_irqrestore(&loc_l->lock, flags); -+ goto check_lru_list; -+ } -+ -+ node->type = BPF_LRU_LOCAL_LIST_T_FREE; -+ node->ref = 0; -+ list_move(&node->list, local_free_list(loc_l)); -+ -+ raw_spin_unlock_irqrestore(&loc_l->lock, flags); -+ return; -+ } -+ -+check_lru_list: -+ bpf_lru_list_push_free(&lru->common_lru.lru_list, node); -+} -+ -+static void bpf_percpu_lru_push_free(struct bpf_lru *lru, -+ struct bpf_lru_node *node) -+{ -+ struct bpf_lru_list *l; -+ unsigned long flags; -+ -+ l = per_cpu_ptr(lru->percpu_lru, node->cpu); -+ -+ raw_spin_lock_irqsave(&l->lock, flags); -+ -+ __bpf_lru_node_move(l, node, BPF_LRU_LIST_T_FREE); -+ -+ raw_spin_unlock_irqrestore(&l->lock, flags); -+} -+ -+void bpf_lru_push_free(struct bpf_lru *lru, struct bpf_lru_node *node) -+{ -+ if (lru->percpu) -+ bpf_percpu_lru_push_free(lru, node); -+ else -+ bpf_common_lru_push_free(lru, node); -+} -+ -+static void bpf_common_lru_populate(struct bpf_lru *lru, void *buf, -+ u32 node_offset, u32 elem_size, -+ u32 nr_elems) -+{ -+ struct bpf_lru_list *l = &lru->common_lru.lru_list; -+ u32 i; -+ -+ for (i = 0; i < nr_elems; i++) { -+ struct bpf_lru_node *node; -+ -+ node = (struct bpf_lru_node *)(buf + node_offset); -+ node->type = BPF_LRU_LIST_T_FREE; -+ node->ref = 0; -+ list_add(&node->list, &l->lists[BPF_LRU_LIST_T_FREE]); -+ buf += elem_size; -+ } -+} -+ -+static void bpf_percpu_lru_populate(struct bpf_lru *lru, void *buf, -+ u32 node_offset, u32 elem_size, -+ u32 nr_elems) -+{ -+ u32 i, pcpu_entries; -+ int cpu; -+ struct bpf_lru_list *l; -+ -+ pcpu_entries = nr_elems / num_possible_cpus(); -+ -+ i = 0; -+ -+ for_each_possible_cpu(cpu) { -+ struct bpf_lru_node *node; -+ -+ l = per_cpu_ptr(lru->percpu_lru, cpu); -+again: -+ node = (struct bpf_lru_node *)(buf + node_offset); -+ node->cpu = cpu; -+ node->type = BPF_LRU_LIST_T_FREE; -+ node->ref = 0; -+ list_add(&node->list, &l->lists[BPF_LRU_LIST_T_FREE]); -+ i++; -+ buf += elem_size; -+ if (i == nr_elems) -+ break; -+ if (i % pcpu_entries) -+ goto again; -+ } -+} -+ -+void bpf_lru_populate(struct bpf_lru *lru, void *buf, u32 node_offset, -+ u32 elem_size, u32 nr_elems) -+{ -+ if (lru->percpu) -+ bpf_percpu_lru_populate(lru, buf, node_offset, elem_size, -+ nr_elems); -+ else -+ bpf_common_lru_populate(lru, buf, node_offset, elem_size, -+ nr_elems); -+} -+ -+static void bpf_lru_locallist_init(struct bpf_lru_locallist *loc_l, int cpu) -+{ -+ int i; -+ -+ for (i = 0; i < NR_BPF_LRU_LOCAL_LIST_T; i++) -+ INIT_LIST_HEAD(&loc_l->lists[i]); -+ -+ loc_l->next_steal = cpu; -+ -+ raw_spin_lock_init(&loc_l->lock); -+} -+ -+static void bpf_lru_list_init(struct bpf_lru_list *l) -+{ -+ int i; -+ -+ for (i = 0; i < NR_BPF_LRU_LIST_T; i++) -+ INIT_LIST_HEAD(&l->lists[i]); -+ -+ for (i = 0; i < NR_BPF_LRU_LIST_COUNT; i++) -+ l->counts[i] = 0; -+ -+ l->next_inactive_rotation = &l->lists[BPF_LRU_LIST_T_INACTIVE]; -+ -+ raw_spin_lock_init(&l->lock); -+} -+ -+int bpf_lru_init(struct bpf_lru *lru, bool percpu, u32 hash_offset, -+ del_from_htab_func del_from_htab, void *del_arg) -+{ -+ int cpu; -+ -+ if (percpu) { -+ lru->percpu_lru = alloc_percpu(struct bpf_lru_list); -+ if (!lru->percpu_lru) -+ return -ENOMEM; -+ -+ for_each_possible_cpu(cpu) { -+ struct bpf_lru_list *l; -+ -+ l = per_cpu_ptr(lru->percpu_lru, cpu); -+ bpf_lru_list_init(l); -+ } -+ lru->nr_scans = PERCPU_NR_SCANS; -+ } else { -+ struct bpf_common_lru *clru = &lru->common_lru; -+ -+ clru->local_list = alloc_percpu(struct bpf_lru_locallist); -+ if (!clru->local_list) -+ return -ENOMEM; -+ -+ for_each_possible_cpu(cpu) { -+ struct bpf_lru_locallist *loc_l; -+ -+ loc_l = per_cpu_ptr(clru->local_list, cpu); -+ bpf_lru_locallist_init(loc_l, cpu); -+ } -+ -+ bpf_lru_list_init(&clru->lru_list); -+ lru->nr_scans = LOCAL_NR_SCANS; -+ } -+ -+ lru->percpu = percpu; -+ lru->del_from_htab = del_from_htab; -+ lru->del_arg = del_arg; -+ lru->hash_offset = hash_offset; -+ -+ return 0; -+} -+ -+void bpf_lru_destroy(struct bpf_lru *lru) -+{ -+ if (lru->percpu) -+ free_percpu(lru->percpu_lru); -+ else -+ free_percpu(lru->common_lru.local_list); -+} ---- /dev/null -+++ b/kernel/bpf/bpf_lru_list.h -@@ -0,0 +1,82 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+/* Copyright (c) 2016 Facebook -+ */ -+#ifndef __BPF_LRU_LIST_H_ -+#define __BPF_LRU_LIST_H_ -+ -+#include -+#include -+ -+#define NR_BPF_LRU_LIST_T (3) -+#define NR_BPF_LRU_LIST_COUNT (2) -+#define NR_BPF_LRU_LOCAL_LIST_T (2) -+#define BPF_LOCAL_LIST_T_OFFSET NR_BPF_LRU_LIST_T -+ -+enum bpf_lru_list_type { -+ BPF_LRU_LIST_T_ACTIVE, -+ BPF_LRU_LIST_T_INACTIVE, -+ BPF_LRU_LIST_T_FREE, -+ BPF_LRU_LOCAL_LIST_T_FREE, -+ BPF_LRU_LOCAL_LIST_T_PENDING, -+}; -+ -+struct bpf_lru_node { -+ struct list_head list; -+ u16 cpu; -+ u8 type; -+ u8 ref; -+}; -+ -+struct bpf_lru_list { -+ struct list_head lists[NR_BPF_LRU_LIST_T]; -+ unsigned int counts[NR_BPF_LRU_LIST_COUNT]; -+ /* The next inacitve list rotation starts from here */ -+ struct list_head *next_inactive_rotation; -+ -+ raw_spinlock_t lock ____cacheline_aligned_in_smp; -+}; -+ -+struct bpf_lru_locallist { -+ struct list_head lists[NR_BPF_LRU_LOCAL_LIST_T]; -+ u16 next_steal; -+ raw_spinlock_t lock; -+}; -+ -+struct bpf_common_lru { -+ struct bpf_lru_list lru_list; -+ struct bpf_lru_locallist __percpu *local_list; -+}; -+ -+typedef bool (*del_from_htab_func)(void *arg, struct bpf_lru_node *node); -+ -+struct bpf_lru { -+ union { -+ struct bpf_common_lru common_lru; -+ struct bpf_lru_list __percpu *percpu_lru; -+ }; -+ del_from_htab_func del_from_htab; -+ void *del_arg; -+ unsigned int hash_offset; -+ unsigned int nr_scans; -+ bool percpu; -+}; -+ -+static inline void bpf_lru_node_set_ref(struct bpf_lru_node *node) -+{ -+ /* ref is an approximation on access frequency. It does not -+ * have to be very accurate. Hence, no protection is used. -+ */ -+ if (!node->ref) -+ node->ref = 1; -+} -+ -+int bpf_lru_init(struct bpf_lru *lru, bool percpu, u32 hash_offset, -+ del_from_htab_func del_from_htab, void *delete_arg); -+void bpf_lru_populate(struct bpf_lru *lru, void *buf, u32 node_offset, -+ u32 elem_size, u32 nr_elems); -+void bpf_lru_destroy(struct bpf_lru *lru); -+struct bpf_lru_node *bpf_lru_pop_free(struct bpf_lru *lru, u32 hash); -+void bpf_lru_push_free(struct bpf_lru *lru, struct bpf_lru_node *node); -+void bpf_lru_promote(struct bpf_lru *lru, struct bpf_lru_node *node); -+ -+#endif ---- /dev/null -+++ b/kernel/bpf/btf.c -@@ -0,0 +1,3514 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* Copyright (c) 2018 Facebook */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* BTF (BPF Type Format) is the meta data format which describes -+ * the data types of BPF program/map. Hence, it basically focus -+ * on the C programming language which the modern BPF is primary -+ * using. -+ * -+ * ELF Section: -+ * ~~~~~~~~~~~ -+ * The BTF data is stored under the ".BTF" ELF section -+ * -+ * struct btf_type: -+ * ~~~~~~~~~~~~~~~ -+ * Each 'struct btf_type' object describes a C data type. -+ * Depending on the type it is describing, a 'struct btf_type' -+ * object may be followed by more data. F.e. -+ * To describe an array, 'struct btf_type' is followed by -+ * 'struct btf_array'. -+ * -+ * 'struct btf_type' and any extra data following it are -+ * 4 bytes aligned. -+ * -+ * Type section: -+ * ~~~~~~~~~~~~~ -+ * The BTF type section contains a list of 'struct btf_type' objects. -+ * Each one describes a C type. Recall from the above section -+ * that a 'struct btf_type' object could be immediately followed by extra -+ * data in order to desribe some particular C types. -+ * -+ * type_id: -+ * ~~~~~~~ -+ * Each btf_type object is identified by a type_id. The type_id -+ * is implicitly implied by the location of the btf_type object in -+ * the BTF type section. The first one has type_id 1. The second -+ * one has type_id 2...etc. Hence, an earlier btf_type has -+ * a smaller type_id. -+ * -+ * A btf_type object may refer to another btf_type object by using -+ * type_id (i.e. the "type" in the "struct btf_type"). -+ * -+ * NOTE that we cannot assume any reference-order. -+ * A btf_type object can refer to an earlier btf_type object -+ * but it can also refer to a later btf_type object. -+ * -+ * For example, to describe "const void *". A btf_type -+ * object describing "const" may refer to another btf_type -+ * object describing "void *". This type-reference is done -+ * by specifying type_id: -+ * -+ * [1] CONST (anon) type_id=2 -+ * [2] PTR (anon) type_id=0 -+ * -+ * The above is the btf_verifier debug log: -+ * - Each line started with "[?]" is a btf_type object -+ * - [?] is the type_id of the btf_type object. -+ * - CONST/PTR is the BTF_KIND_XXX -+ * - "(anon)" is the name of the type. It just -+ * happens that CONST and PTR has no name. -+ * - type_id=XXX is the 'u32 type' in btf_type -+ * -+ * NOTE: "void" has type_id 0 -+ * -+ * String section: -+ * ~~~~~~~~~~~~~~ -+ * The BTF string section contains the names used by the type section. -+ * Each string is referred by an "offset" from the beginning of the -+ * string section. -+ * -+ * Each string is '\0' terminated. -+ * -+ * The first character in the string section must be '\0' -+ * which is used to mean 'anonymous'. Some btf_type may not -+ * have a name. -+ */ -+ -+/* BTF verification: -+ * -+ * To verify BTF data, two passes are needed. -+ * -+ * Pass #1 -+ * ~~~~~~~ -+ * The first pass is to collect all btf_type objects to -+ * an array: "btf->types". -+ * -+ * Depending on the C type that a btf_type is describing, -+ * a btf_type may be followed by extra data. We don't know -+ * how many btf_type is there, and more importantly we don't -+ * know where each btf_type is located in the type section. -+ * -+ * Without knowing the location of each type_id, most verifications -+ * cannot be done. e.g. an earlier btf_type may refer to a later -+ * btf_type (recall the "const void *" above), so we cannot -+ * check this type-reference in the first pass. -+ * -+ * In the first pass, it still does some verifications (e.g. -+ * checking the name is a valid offset to the string section). -+ * -+ * Pass #2 -+ * ~~~~~~~ -+ * The main focus is to resolve a btf_type that is referring -+ * to another type. -+ * -+ * We have to ensure the referring type: -+ * 1) does exist in the BTF (i.e. in btf->types[]) -+ * 2) does not cause a loop: -+ * struct A { -+ * struct B b; -+ * }; -+ * -+ * struct B { -+ * struct A a; -+ * }; -+ * -+ * btf_type_needs_resolve() decides if a btf_type needs -+ * to be resolved. -+ * -+ * The needs_resolve type implements the "resolve()" ops which -+ * essentially does a DFS and detects backedge. -+ * -+ * During resolve (or DFS), different C types have different -+ * "RESOLVED" conditions. -+ * -+ * When resolving a BTF_KIND_STRUCT, we need to resolve all its -+ * members because a member is always referring to another -+ * type. A struct's member can be treated as "RESOLVED" if -+ * it is referring to a BTF_KIND_PTR. Otherwise, the -+ * following valid C struct would be rejected: -+ * -+ * struct A { -+ * int m; -+ * struct A *a; -+ * }; -+ * -+ * When resolving a BTF_KIND_PTR, it needs to keep resolving if -+ * it is referring to another BTF_KIND_PTR. Otherwise, we cannot -+ * detect a pointer loop, e.g.: -+ * BTF_KIND_CONST -> BTF_KIND_PTR -> BTF_KIND_CONST -> BTF_KIND_PTR + -+ * ^ | -+ * +-----------------------------------------+ -+ * -+ */ -+ -+#define BITS_PER_U128 (sizeof(u64) * BITS_PER_BYTE * 2) -+#define BITS_PER_BYTE_MASK (BITS_PER_BYTE - 1) -+#define BITS_PER_BYTE_MASKED(bits) ((bits) & BITS_PER_BYTE_MASK) -+#define BITS_ROUNDDOWN_BYTES(bits) ((bits) >> 3) -+#define BITS_ROUNDUP_BYTES(bits) \ -+ (BITS_ROUNDDOWN_BYTES(bits) + !!BITS_PER_BYTE_MASKED(bits)) -+ -+#define BTF_INFO_MASK 0x8f00ffff -+#define BTF_INT_MASK 0x0fffffff -+#define BTF_TYPE_ID_VALID(type_id) ((type_id) <= BTF_MAX_TYPE) -+#define BTF_STR_OFFSET_VALID(name_off) ((name_off) <= BTF_MAX_NAME_OFFSET) -+ -+/* 16MB for 64k structs and each has 16 members and -+ * a few MB spaces for the string section. -+ * The hard limit is S32_MAX. -+ */ -+#define BTF_MAX_SIZE (16 * 1024 * 1024) -+ -+#define for_each_member(i, struct_type, member) \ -+ for (i = 0, member = btf_type_member(struct_type); \ -+ i < btf_type_vlen(struct_type); \ -+ i++, member++) -+ -+#define for_each_member_from(i, from, struct_type, member) \ -+ for (i = from, member = btf_type_member(struct_type) + from; \ -+ i < btf_type_vlen(struct_type); \ -+ i++, member++) -+ -+#define for_each_vsi(i, struct_type, member) \ -+ for (i = 0, member = btf_type_var_secinfo(struct_type); \ -+ i < btf_type_vlen(struct_type); \ -+ i++, member++) -+ -+#define for_each_vsi_from(i, from, struct_type, member) \ -+ for (i = from, member = btf_type_var_secinfo(struct_type) + from; \ -+ i < btf_type_vlen(struct_type); \ -+ i++, member++) -+ -+DEFINE_IDR(btf_idr); -+DEFINE_SPINLOCK(btf_idr_lock); -+ -+struct btf { -+ void *data; -+ struct btf_type **types; -+ u32 *resolved_ids; -+ u32 *resolved_sizes; -+ const char *strings; -+ void *nohdr_data; -+ struct btf_header hdr; -+ u32 nr_types; -+ u32 types_size; -+ u32 data_size; -+ refcount_t refcnt; -+ u32 id; -+ struct rcu_head rcu; -+}; -+ -+enum verifier_phase { -+ CHECK_META, -+ CHECK_TYPE, -+}; -+ -+struct resolve_vertex { -+ const struct btf_type *t; -+ u32 type_id; -+ u16 next_member; -+}; -+ -+enum visit_state { -+ NOT_VISITED, -+ VISITED, -+ RESOLVED, -+}; -+ -+enum resolve_mode { -+ RESOLVE_TBD, /* To Be Determined */ -+ RESOLVE_PTR, /* Resolving for Pointer */ -+ RESOLVE_STRUCT_OR_ARRAY, /* Resolving for struct/union -+ * or array -+ */ -+}; -+ -+#define MAX_RESOLVE_DEPTH 32 -+ -+struct btf_sec_info { -+ u32 off; -+ u32 len; -+}; -+ -+struct btf_verifier_env { -+ struct btf *btf; -+ u8 *visit_states; -+ struct resolve_vertex stack[MAX_RESOLVE_DEPTH]; -+ struct bpf_verifier_log log; -+ u32 log_type_id; -+ u32 top_stack; -+ enum verifier_phase phase; -+ enum resolve_mode resolve_mode; -+}; -+ -+static const char * const btf_kind_str[NR_BTF_KINDS] = { -+ [BTF_KIND_UNKN] = "UNKNOWN", -+ [BTF_KIND_INT] = "INT", -+ [BTF_KIND_PTR] = "PTR", -+ [BTF_KIND_ARRAY] = "ARRAY", -+ [BTF_KIND_STRUCT] = "STRUCT", -+ [BTF_KIND_UNION] = "UNION", -+ [BTF_KIND_ENUM] = "ENUM", -+ [BTF_KIND_FWD] = "FWD", -+ [BTF_KIND_TYPEDEF] = "TYPEDEF", -+ [BTF_KIND_VOLATILE] = "VOLATILE", -+ [BTF_KIND_CONST] = "CONST", -+ [BTF_KIND_RESTRICT] = "RESTRICT", -+ [BTF_KIND_FUNC] = "FUNC", -+ [BTF_KIND_FUNC_PROTO] = "FUNC_PROTO", -+ [BTF_KIND_VAR] = "VAR", -+ [BTF_KIND_DATASEC] = "DATASEC", -+}; -+ -+struct btf_kind_operations { -+ s32 (*check_meta)(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left); -+ int (*resolve)(struct btf_verifier_env *env, -+ const struct resolve_vertex *v); -+ int (*check_member)(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type); -+ int (*check_kflag_member)(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type); -+ void (*log_details)(struct btf_verifier_env *env, -+ const struct btf_type *t); -+ void (*seq_show)(const struct btf *btf, const struct btf_type *t, -+ u32 type_id, void *data, u8 bits_offsets, -+ struct seq_file *m); -+}; -+ -+static const struct btf_kind_operations * const kind_ops[NR_BTF_KINDS]; -+static struct btf_type btf_void; -+ -+static int btf_resolve(struct btf_verifier_env *env, -+ const struct btf_type *t, u32 type_id); -+ -+static bool btf_type_is_modifier(const struct btf_type *t) -+{ -+ /* Some of them is not strictly a C modifier -+ * but they are grouped into the same bucket -+ * for BTF concern: -+ * A type (t) that refers to another -+ * type through t->type AND its size cannot -+ * be determined without following the t->type. -+ * -+ * ptr does not fall into this bucket -+ * because its size is always sizeof(void *). -+ */ -+ switch (BTF_INFO_KIND(t->info)) { -+ case BTF_KIND_TYPEDEF: -+ case BTF_KIND_VOLATILE: -+ case BTF_KIND_CONST: -+ case BTF_KIND_RESTRICT: -+ return true; -+ } -+ -+ return false; -+} -+ -+bool btf_type_is_void(const struct btf_type *t) -+{ -+ return t == &btf_void; -+} -+ -+static bool btf_type_is_fwd(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_FWD; -+} -+ -+static bool btf_type_is_func(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC; -+} -+ -+static bool btf_type_is_func_proto(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC_PROTO; -+} -+ -+static bool btf_type_nosize(const struct btf_type *t) -+{ -+ return btf_type_is_void(t) || btf_type_is_fwd(t) || -+ btf_type_is_func(t) || btf_type_is_func_proto(t); -+} -+ -+static bool btf_type_nosize_or_null(const struct btf_type *t) -+{ -+ return !t || btf_type_nosize(t); -+} -+ -+/* union is only a special case of struct: -+ * all its offsetof(member) == 0 -+ */ -+static bool btf_type_is_struct(const struct btf_type *t) -+{ -+ u8 kind = BTF_INFO_KIND(t->info); -+ -+ return kind == BTF_KIND_STRUCT || kind == BTF_KIND_UNION; -+} -+ -+static bool __btf_type_is_struct(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_STRUCT; -+} -+ -+static bool btf_type_is_array(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_ARRAY; -+} -+ -+static bool btf_type_is_ptr(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_PTR; -+} -+ -+static bool btf_type_is_int(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_INT; -+} -+ -+static bool btf_type_is_var(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_VAR; -+} -+ -+static bool btf_type_is_datasec(const struct btf_type *t) -+{ -+ return BTF_INFO_KIND(t->info) == BTF_KIND_DATASEC; -+} -+ -+/* Types that act only as a source, not sink or intermediate -+ * type when resolving. -+ */ -+static bool btf_type_is_resolve_source_only(const struct btf_type *t) -+{ -+ return btf_type_is_var(t) || -+ btf_type_is_datasec(t); -+} -+ -+/* What types need to be resolved? -+ * -+ * btf_type_is_modifier() is an obvious one. -+ * -+ * btf_type_is_struct() because its member refers to -+ * another type (through member->type). -+ * -+ * btf_type_is_var() because the variable refers to -+ * another type. btf_type_is_datasec() holds multiple -+ * btf_type_is_var() types that need resolving. -+ * -+ * btf_type_is_array() because its element (array->type) -+ * refers to another type. Array can be thought of a -+ * special case of struct while array just has the same -+ * member-type repeated by array->nelems of times. -+ */ -+static bool btf_type_needs_resolve(const struct btf_type *t) -+{ -+ return btf_type_is_modifier(t) || -+ btf_type_is_ptr(t) || -+ btf_type_is_struct(t) || -+ btf_type_is_array(t) || -+ btf_type_is_var(t) || -+ btf_type_is_datasec(t); -+} -+ -+/* t->size can be used */ -+static bool btf_type_has_size(const struct btf_type *t) -+{ -+ switch (BTF_INFO_KIND(t->info)) { -+ case BTF_KIND_INT: -+ case BTF_KIND_STRUCT: -+ case BTF_KIND_UNION: -+ case BTF_KIND_ENUM: -+ case BTF_KIND_DATASEC: -+ return true; -+ } -+ -+ return false; -+} -+ -+static const char *btf_int_encoding_str(u8 encoding) -+{ -+ if (encoding == 0) -+ return "(none)"; -+ else if (encoding == BTF_INT_SIGNED) -+ return "SIGNED"; -+ else if (encoding == BTF_INT_CHAR) -+ return "CHAR"; -+ else if (encoding == BTF_INT_BOOL) -+ return "BOOL"; -+ else -+ return "UNKN"; -+} -+ -+static u16 btf_type_vlen(const struct btf_type *t) -+{ -+ return BTF_INFO_VLEN(t->info); -+} -+ -+static bool btf_type_kflag(const struct btf_type *t) -+{ -+ return BTF_INFO_KFLAG(t->info); -+} -+ -+static u32 btf_member_bit_offset(const struct btf_type *struct_type, -+ const struct btf_member *member) -+{ -+ return btf_type_kflag(struct_type) ? BTF_MEMBER_BIT_OFFSET(member->offset) -+ : member->offset; -+} -+ -+static u32 btf_member_bitfield_size(const struct btf_type *struct_type, -+ const struct btf_member *member) -+{ -+ return btf_type_kflag(struct_type) ? BTF_MEMBER_BITFIELD_SIZE(member->offset) -+ : 0; -+} -+ -+static u32 btf_type_int(const struct btf_type *t) -+{ -+ return *(u32 *)(t + 1); -+} -+ -+static const struct btf_array *btf_type_array(const struct btf_type *t) -+{ -+ return (const struct btf_array *)(t + 1); -+} -+ -+static const struct btf_member *btf_type_member(const struct btf_type *t) -+{ -+ return (const struct btf_member *)(t + 1); -+} -+ -+static const struct btf_enum *btf_type_enum(const struct btf_type *t) -+{ -+ return (const struct btf_enum *)(t + 1); -+} -+ -+static const struct btf_var *btf_type_var(const struct btf_type *t) -+{ -+ return (const struct btf_var *)(t + 1); -+} -+ -+static const struct btf_var_secinfo *btf_type_var_secinfo(const struct btf_type *t) -+{ -+ return (const struct btf_var_secinfo *)(t + 1); -+} -+ -+static const struct btf_kind_operations *btf_type_ops(const struct btf_type *t) -+{ -+ return kind_ops[BTF_INFO_KIND(t->info)]; -+} -+ -+static bool btf_name_offset_valid(const struct btf *btf, u32 offset) -+{ -+ return BTF_STR_OFFSET_VALID(offset) && -+ offset < btf->hdr.str_len; -+} -+ -+static bool __btf_name_char_ok(char c, bool first, bool dot_ok) -+{ -+ if ((first ? !isalpha(c) : -+ !isalnum(c)) && -+ c != '_' && -+ ((c == '.' && !dot_ok) || -+ c != '.')) -+ return false; -+ return true; -+} -+ -+static bool __btf_name_valid(const struct btf *btf, u32 offset, bool dot_ok) -+{ -+ /* offset must be valid */ -+ const char *src = &btf->strings[offset]; -+ const char *src_limit; -+ -+ if (!__btf_name_char_ok(*src, true, dot_ok)) -+ return false; -+ -+ /* set a limit on identifier length */ -+ src_limit = src + KSYM_NAME_LEN; -+ src++; -+ while (*src && src < src_limit) { -+ if (!__btf_name_char_ok(*src, false, dot_ok)) -+ return false; -+ src++; -+ } -+ -+ return !*src; -+} -+ -+/* Only C-style identifier is permitted. This can be relaxed if -+ * necessary. -+ */ -+static bool btf_name_valid_identifier(const struct btf *btf, u32 offset) -+{ -+ return __btf_name_valid(btf, offset, false); -+} -+ -+static bool btf_name_valid_section(const struct btf *btf, u32 offset) -+{ -+ return __btf_name_valid(btf, offset, true); -+} -+ -+static const char *__btf_name_by_offset(const struct btf *btf, u32 offset) -+{ -+ if (!offset) -+ return "(anon)"; -+ else if (offset < btf->hdr.str_len) -+ return &btf->strings[offset]; -+ else -+ return "(invalid-name-offset)"; -+} -+ -+const char *btf_name_by_offset(const struct btf *btf, u32 offset) -+{ -+ if (offset < btf->hdr.str_len) -+ return &btf->strings[offset]; -+ -+ return NULL; -+} -+ -+const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id) -+{ -+ if (type_id > btf->nr_types) -+ return NULL; -+ -+ return btf->types[type_id]; -+} -+ -+/* -+ * Regular int is not a bit field and it must be either -+ * u8/u16/u32/u64 or __int128. -+ */ -+static bool btf_type_int_is_regular(const struct btf_type *t) -+{ -+ u8 nr_bits, nr_bytes; -+ u32 int_data; -+ -+ int_data = btf_type_int(t); -+ nr_bits = BTF_INT_BITS(int_data); -+ nr_bytes = BITS_ROUNDUP_BYTES(nr_bits); -+ if (BITS_PER_BYTE_MASKED(nr_bits) || -+ BTF_INT_OFFSET(int_data) || -+ (nr_bytes != sizeof(u8) && nr_bytes != sizeof(u16) && -+ nr_bytes != sizeof(u32) && nr_bytes != sizeof(u64) && -+ nr_bytes != (2 * sizeof(u64)))) { -+ return false; -+ } -+ -+ return true; -+} -+ -+/* -+ * Check that given struct member is a regular int with expected -+ * offset and size. -+ */ -+bool btf_member_is_reg_int(const struct btf *btf, const struct btf_type *s, -+ const struct btf_member *m, -+ u32 expected_offset, u32 expected_size) -+{ -+ const struct btf_type *t; -+ u32 id, int_data; -+ u8 nr_bits; -+ -+ id = m->type; -+ t = btf_type_id_size(btf, &id, NULL); -+ if (!t || !btf_type_is_int(t)) -+ return false; -+ -+ int_data = btf_type_int(t); -+ nr_bits = BTF_INT_BITS(int_data); -+ if (btf_type_kflag(s)) { -+ u32 bitfield_size = BTF_MEMBER_BITFIELD_SIZE(m->offset); -+ u32 bit_offset = BTF_MEMBER_BIT_OFFSET(m->offset); -+ -+ /* if kflag set, int should be a regular int and -+ * bit offset should be at byte boundary. -+ */ -+ return !bitfield_size && -+ BITS_ROUNDUP_BYTES(bit_offset) == expected_offset && -+ BITS_ROUNDUP_BYTES(nr_bits) == expected_size; -+ } -+ -+ if (BTF_INT_OFFSET(int_data) || -+ BITS_PER_BYTE_MASKED(m->offset) || -+ BITS_ROUNDUP_BYTES(m->offset) != expected_offset || -+ BITS_PER_BYTE_MASKED(nr_bits) || -+ BITS_ROUNDUP_BYTES(nr_bits) != expected_size) -+ return false; -+ -+ return true; -+} -+ -+__printf(2, 3) static void __btf_verifier_log(struct bpf_verifier_log *log, -+ const char *fmt, ...) -+{ -+ va_list args; -+ -+ va_start(args, fmt); -+ bpf_verifier_vlog(log, fmt, args); -+ va_end(args); -+} -+ -+__printf(2, 3) static void btf_verifier_log(struct btf_verifier_env *env, -+ const char *fmt, ...) -+{ -+ struct bpf_verifier_log *log = &env->log; -+ va_list args; -+ -+ if (!bpf_verifier_log_needed(log)) -+ return; -+ -+ va_start(args, fmt); -+ bpf_verifier_vlog(log, fmt, args); -+ va_end(args); -+} -+ -+__printf(4, 5) static void __btf_verifier_log_type(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ bool log_details, -+ const char *fmt, ...) -+{ -+ struct bpf_verifier_log *log = &env->log; -+ u8 kind = BTF_INFO_KIND(t->info); -+ struct btf *btf = env->btf; -+ va_list args; -+ -+ if (!bpf_verifier_log_needed(log)) -+ return; -+ -+ __btf_verifier_log(log, "[%u] %s %s%s", -+ env->log_type_id, -+ btf_kind_str[kind], -+ __btf_name_by_offset(btf, t->name_off), -+ log_details ? " " : ""); -+ -+ if (log_details) -+ btf_type_ops(t)->log_details(env, t); -+ -+ if (fmt && *fmt) { -+ __btf_verifier_log(log, " "); -+ va_start(args, fmt); -+ bpf_verifier_vlog(log, fmt, args); -+ va_end(args); -+ } -+ -+ __btf_verifier_log(log, "\n"); -+} -+ -+#define btf_verifier_log_type(env, t, ...) \ -+ __btf_verifier_log_type((env), (t), true, __VA_ARGS__) -+#define btf_verifier_log_basic(env, t, ...) \ -+ __btf_verifier_log_type((env), (t), false, __VA_ARGS__) -+ -+__printf(4, 5) -+static void btf_verifier_log_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const char *fmt, ...) -+{ -+ struct bpf_verifier_log *log = &env->log; -+ struct btf *btf = env->btf; -+ va_list args; -+ -+ if (!bpf_verifier_log_needed(log)) -+ return; -+ -+ /* The CHECK_META phase already did a btf dump. -+ * -+ * If member is logged again, it must hit an error in -+ * parsing this member. It is useful to print out which -+ * struct this member belongs to. -+ */ -+ if (env->phase != CHECK_META) -+ btf_verifier_log_type(env, struct_type, NULL); -+ -+ if (btf_type_kflag(struct_type)) -+ __btf_verifier_log(log, -+ "\t%s type_id=%u bitfield_size=%u bits_offset=%u", -+ __btf_name_by_offset(btf, member->name_off), -+ member->type, -+ BTF_MEMBER_BITFIELD_SIZE(member->offset), -+ BTF_MEMBER_BIT_OFFSET(member->offset)); -+ else -+ __btf_verifier_log(log, "\t%s type_id=%u bits_offset=%u", -+ __btf_name_by_offset(btf, member->name_off), -+ member->type, member->offset); -+ -+ if (fmt && *fmt) { -+ __btf_verifier_log(log, " "); -+ va_start(args, fmt); -+ bpf_verifier_vlog(log, fmt, args); -+ va_end(args); -+ } -+ -+ __btf_verifier_log(log, "\n"); -+} -+ -+__printf(4, 5) -+static void btf_verifier_log_vsi(struct btf_verifier_env *env, -+ const struct btf_type *datasec_type, -+ const struct btf_var_secinfo *vsi, -+ const char *fmt, ...) -+{ -+ struct bpf_verifier_log *log = &env->log; -+ va_list args; -+ -+ if (!bpf_verifier_log_needed(log)) -+ return; -+ if (env->phase != CHECK_META) -+ btf_verifier_log_type(env, datasec_type, NULL); -+ -+ __btf_verifier_log(log, "\t type_id=%u offset=%u size=%u", -+ vsi->type, vsi->offset, vsi->size); -+ if (fmt && *fmt) { -+ __btf_verifier_log(log, " "); -+ va_start(args, fmt); -+ bpf_verifier_vlog(log, fmt, args); -+ va_end(args); -+ } -+ -+ __btf_verifier_log(log, "\n"); -+} -+ -+static void btf_verifier_log_hdr(struct btf_verifier_env *env, -+ u32 btf_data_size) -+{ -+ struct bpf_verifier_log *log = &env->log; -+ const struct btf *btf = env->btf; -+ const struct btf_header *hdr; -+ -+ if (!bpf_verifier_log_needed(log)) -+ return; -+ -+ hdr = &btf->hdr; -+ __btf_verifier_log(log, "magic: 0x%x\n", hdr->magic); -+ __btf_verifier_log(log, "version: %u\n", hdr->version); -+ __btf_verifier_log(log, "flags: 0x%x\n", hdr->flags); -+ __btf_verifier_log(log, "hdr_len: %u\n", hdr->hdr_len); -+ __btf_verifier_log(log, "type_off: %u\n", hdr->type_off); -+ __btf_verifier_log(log, "type_len: %u\n", hdr->type_len); -+ __btf_verifier_log(log, "str_off: %u\n", hdr->str_off); -+ __btf_verifier_log(log, "str_len: %u\n", hdr->str_len); -+ __btf_verifier_log(log, "btf_total_size: %u\n", btf_data_size); -+} -+ -+static int btf_add_type(struct btf_verifier_env *env, struct btf_type *t) -+{ -+ struct btf *btf = env->btf; -+ -+ /* < 2 because +1 for btf_void which is always in btf->types[0]. -+ * btf_void is not accounted in btf->nr_types because btf_void -+ * does not come from the BTF file. -+ */ -+ if (btf->types_size - btf->nr_types < 2) { -+ /* Expand 'types' array */ -+ -+ struct btf_type **new_types; -+ u32 expand_by, new_size; -+ -+ if (btf->types_size == BTF_MAX_TYPE) { -+ btf_verifier_log(env, "Exceeded max num of types"); -+ return -E2BIG; -+ } -+ -+ expand_by = max_t(u32, btf->types_size >> 2, 16); -+ new_size = min_t(u32, BTF_MAX_TYPE, -+ btf->types_size + expand_by); -+ -+ new_types = kcalloc(new_size, sizeof(*new_types), -+ GFP_KERNEL | __GFP_NOWARN); -+ if (!new_types) -+ return -ENOMEM; -+ -+ if (btf->nr_types == 0) -+ new_types[0] = &btf_void; -+ else -+ memcpy(new_types, btf->types, -+ sizeof(*btf->types) * (btf->nr_types + 1)); -+ -+ kvfree(btf->types); -+ btf->types = new_types; -+ btf->types_size = new_size; -+ } -+ -+ btf->types[++(btf->nr_types)] = t; -+ -+ return 0; -+} -+ -+static int btf_alloc_id(struct btf *btf) -+{ -+ int id; -+ -+ idr_preload(GFP_KERNEL); -+ spin_lock_bh(&btf_idr_lock); -+ id = idr_alloc_cyclic(&btf_idr, btf, 1, INT_MAX, GFP_ATOMIC); -+ if (id > 0) -+ btf->id = id; -+ spin_unlock_bh(&btf_idr_lock); -+ idr_preload_end(); -+ -+ if (WARN_ON_ONCE(!id)) -+ return -ENOSPC; -+ -+ return id > 0 ? 0 : id; -+} -+ -+static void btf_free_id(struct btf *btf) -+{ -+ unsigned long flags; -+ -+ /* -+ * In map-in-map, calling map_delete_elem() on outer -+ * map will call bpf_map_put on the inner map. -+ * It will then eventually call btf_free_id() -+ * on the inner map. Some of the map_delete_elem() -+ * implementation may have irq disabled, so -+ * we need to use the _irqsave() version instead -+ * of the _bh() version. -+ */ -+ spin_lock_irqsave(&btf_idr_lock, flags); -+ idr_remove(&btf_idr, btf->id); -+ spin_unlock_irqrestore(&btf_idr_lock, flags); -+} -+ -+static void btf_free(struct btf *btf) -+{ -+ kvfree(btf->types); -+ kvfree(btf->resolved_sizes); -+ kvfree(btf->resolved_ids); -+ kvfree(btf->data); -+ kfree(btf); -+} -+ -+static void btf_free_rcu(struct rcu_head *rcu) -+{ -+ struct btf *btf = container_of(rcu, struct btf, rcu); -+ -+ btf_free(btf); -+} -+ -+void btf_put(struct btf *btf) -+{ -+ if (btf && refcount_dec_and_test(&btf->refcnt)) { -+ btf_free_id(btf); -+ call_rcu(&btf->rcu, btf_free_rcu); -+ } -+} -+ -+static int env_resolve_init(struct btf_verifier_env *env) -+{ -+ struct btf *btf = env->btf; -+ u32 nr_types = btf->nr_types; -+ u32 *resolved_sizes = NULL; -+ u32 *resolved_ids = NULL; -+ u8 *visit_states = NULL; -+ -+ /* +1 for btf_void */ -+ resolved_sizes = kcalloc(nr_types + 1, sizeof(*resolved_sizes), -+ GFP_KERNEL | __GFP_NOWARN); -+ if (!resolved_sizes) -+ goto nomem; -+ -+ resolved_ids = kcalloc(nr_types + 1, sizeof(*resolved_ids), -+ GFP_KERNEL | __GFP_NOWARN); -+ if (!resolved_ids) -+ goto nomem; -+ -+ visit_states = kcalloc(nr_types + 1, sizeof(*visit_states), -+ GFP_KERNEL | __GFP_NOWARN); -+ if (!visit_states) -+ goto nomem; -+ -+ btf->resolved_sizes = resolved_sizes; -+ btf->resolved_ids = resolved_ids; -+ env->visit_states = visit_states; -+ -+ return 0; -+ -+nomem: -+ kvfree(resolved_sizes); -+ kvfree(resolved_ids); -+ kvfree(visit_states); -+ return -ENOMEM; -+} -+ -+static void btf_verifier_env_free(struct btf_verifier_env *env) -+{ -+ kvfree(env->visit_states); -+ kfree(env); -+} -+ -+static bool env_type_is_resolve_sink(const struct btf_verifier_env *env, -+ const struct btf_type *next_type) -+{ -+ switch (env->resolve_mode) { -+ case RESOLVE_TBD: -+ /* int, enum or void is a sink */ -+ return !btf_type_needs_resolve(next_type); -+ case RESOLVE_PTR: -+ /* int, enum, void, struct, array, func or func_proto is a sink -+ * for ptr -+ */ -+ return !btf_type_is_modifier(next_type) && -+ !btf_type_is_ptr(next_type); -+ case RESOLVE_STRUCT_OR_ARRAY: -+ /* int, enum, void, ptr, func or func_proto is a sink -+ * for struct and array -+ */ -+ return !btf_type_is_modifier(next_type) && -+ !btf_type_is_array(next_type) && -+ !btf_type_is_struct(next_type); -+ default: -+ BUG(); -+ } -+} -+ -+static bool env_type_is_resolved(const struct btf_verifier_env *env, -+ u32 type_id) -+{ -+ return env->visit_states[type_id] == RESOLVED; -+} -+ -+static int env_stack_push(struct btf_verifier_env *env, -+ const struct btf_type *t, u32 type_id) -+{ -+ struct resolve_vertex *v; -+ -+ if (env->top_stack == MAX_RESOLVE_DEPTH) -+ return -E2BIG; -+ -+ if (env->visit_states[type_id] != NOT_VISITED) -+ return -EEXIST; -+ -+ env->visit_states[type_id] = VISITED; -+ -+ v = &env->stack[env->top_stack++]; -+ v->t = t; -+ v->type_id = type_id; -+ v->next_member = 0; -+ -+ if (env->resolve_mode == RESOLVE_TBD) { -+ if (btf_type_is_ptr(t)) -+ env->resolve_mode = RESOLVE_PTR; -+ else if (btf_type_is_struct(t) || btf_type_is_array(t)) -+ env->resolve_mode = RESOLVE_STRUCT_OR_ARRAY; -+ } -+ -+ return 0; -+} -+ -+static void env_stack_set_next_member(struct btf_verifier_env *env, -+ u16 next_member) -+{ -+ env->stack[env->top_stack - 1].next_member = next_member; -+} -+ -+static void env_stack_pop_resolved(struct btf_verifier_env *env, -+ u32 resolved_type_id, -+ u32 resolved_size) -+{ -+ u32 type_id = env->stack[--(env->top_stack)].type_id; -+ struct btf *btf = env->btf; -+ -+ btf->resolved_sizes[type_id] = resolved_size; -+ btf->resolved_ids[type_id] = resolved_type_id; -+ env->visit_states[type_id] = RESOLVED; -+} -+ -+static const struct resolve_vertex *env_stack_peak(struct btf_verifier_env *env) -+{ -+ return env->top_stack ? &env->stack[env->top_stack - 1] : NULL; -+} -+ -+/* The input param "type_id" must point to a needs_resolve type */ -+static const struct btf_type *btf_type_id_resolve(const struct btf *btf, -+ u32 *type_id) -+{ -+ *type_id = btf->resolved_ids[*type_id]; -+ return btf_type_by_id(btf, *type_id); -+} -+ -+const struct btf_type *btf_type_id_size(const struct btf *btf, -+ u32 *type_id, u32 *ret_size) -+{ -+ const struct btf_type *size_type; -+ u32 size_type_id = *type_id; -+ u32 size = 0; -+ -+ size_type = btf_type_by_id(btf, size_type_id); -+ if (btf_type_nosize_or_null(size_type)) -+ return NULL; -+ -+ if (btf_type_has_size(size_type)) { -+ size = size_type->size; -+ } else if (btf_type_is_array(size_type)) { -+ size = btf->resolved_sizes[size_type_id]; -+ } else if (btf_type_is_ptr(size_type)) { -+ size = sizeof(void *); -+ } else { -+ if (WARN_ON_ONCE(!btf_type_is_modifier(size_type) && -+ !btf_type_is_var(size_type))) -+ return NULL; -+ -+ size_type_id = btf->resolved_ids[size_type_id]; -+ size_type = btf_type_by_id(btf, size_type_id); -+ if (btf_type_nosize_or_null(size_type)) -+ return NULL; -+ else if (btf_type_has_size(size_type)) -+ size = size_type->size; -+ else if (btf_type_is_array(size_type)) -+ size = btf->resolved_sizes[size_type_id]; -+ else if (btf_type_is_ptr(size_type)) -+ size = sizeof(void *); -+ else -+ return NULL; -+ } -+ -+ *type_id = size_type_id; -+ if (ret_size) -+ *ret_size = size; -+ -+ return size_type; -+} -+ -+static int btf_df_check_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ btf_verifier_log_basic(env, struct_type, -+ "Unsupported check_member"); -+ return -EINVAL; -+} -+ -+static int btf_df_check_kflag_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ btf_verifier_log_basic(env, struct_type, -+ "Unsupported check_kflag_member"); -+ return -EINVAL; -+} -+ -+/* Used for ptr, array and struct/union type members. -+ * int, enum and modifier types have their specific callback functions. -+ */ -+static int btf_generic_check_kflag_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ if (BTF_MEMBER_BITFIELD_SIZE(member->offset)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Invalid member bitfield_size"); -+ return -EINVAL; -+ } -+ -+ /* bitfield size is 0, so member->offset represents bit offset only. -+ * It is safe to call non kflag check_member variants. -+ */ -+ return btf_type_ops(member_type)->check_member(env, struct_type, -+ member, -+ member_type); -+} -+ -+static int btf_df_resolve(struct btf_verifier_env *env, -+ const struct resolve_vertex *v) -+{ -+ btf_verifier_log_basic(env, v->t, "Unsupported resolve"); -+ return -EINVAL; -+} -+ -+static void btf_df_seq_show(const struct btf *btf, const struct btf_type *t, -+ u32 type_id, void *data, u8 bits_offsets, -+ struct seq_file *m) -+{ -+ seq_printf(m, "", BTF_INFO_KIND(t->info)); -+} -+ -+static int btf_int_check_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ u32 int_data = btf_type_int(member_type); -+ u32 struct_bits_off = member->offset; -+ u32 struct_size = struct_type->size; -+ u32 nr_copy_bits; -+ u32 bytes_offset; -+ -+ if (U32_MAX - struct_bits_off < BTF_INT_OFFSET(int_data)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "bits_offset exceeds U32_MAX"); -+ return -EINVAL; -+ } -+ -+ struct_bits_off += BTF_INT_OFFSET(int_data); -+ bytes_offset = BITS_ROUNDDOWN_BYTES(struct_bits_off); -+ nr_copy_bits = BTF_INT_BITS(int_data) + -+ BITS_PER_BYTE_MASKED(struct_bits_off); -+ -+ if (nr_copy_bits > BITS_PER_U128) { -+ btf_verifier_log_member(env, struct_type, member, -+ "nr_copy_bits exceeds 128"); -+ return -EINVAL; -+ } -+ -+ if (struct_size < bytes_offset || -+ struct_size - bytes_offset < BITS_ROUNDUP_BYTES(nr_copy_bits)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member exceeds struct_size"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int btf_int_check_kflag_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ u32 struct_bits_off, nr_bits, nr_int_data_bits, bytes_offset; -+ u32 int_data = btf_type_int(member_type); -+ u32 struct_size = struct_type->size; -+ u32 nr_copy_bits; -+ -+ /* a regular int type is required for the kflag int member */ -+ if (!btf_type_int_is_regular(member_type)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Invalid member base type"); -+ return -EINVAL; -+ } -+ -+ /* check sanity of bitfield size */ -+ nr_bits = BTF_MEMBER_BITFIELD_SIZE(member->offset); -+ struct_bits_off = BTF_MEMBER_BIT_OFFSET(member->offset); -+ nr_int_data_bits = BTF_INT_BITS(int_data); -+ if (!nr_bits) { -+ /* Not a bitfield member, member offset must be at byte -+ * boundary. -+ */ -+ if (BITS_PER_BYTE_MASKED(struct_bits_off)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Invalid member offset"); -+ return -EINVAL; -+ } -+ -+ nr_bits = nr_int_data_bits; -+ } else if (nr_bits > nr_int_data_bits) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Invalid member bitfield_size"); -+ return -EINVAL; -+ } -+ -+ bytes_offset = BITS_ROUNDDOWN_BYTES(struct_bits_off); -+ nr_copy_bits = nr_bits + BITS_PER_BYTE_MASKED(struct_bits_off); -+ if (nr_copy_bits > BITS_PER_U128) { -+ btf_verifier_log_member(env, struct_type, member, -+ "nr_copy_bits exceeds 128"); -+ return -EINVAL; -+ } -+ -+ if (struct_size < bytes_offset || -+ struct_size - bytes_offset < BITS_ROUNDUP_BYTES(nr_copy_bits)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member exceeds struct_size"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static s32 btf_int_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ u32 int_data, nr_bits, meta_needed = sizeof(int_data); -+ u16 encoding; -+ -+ if (meta_left < meta_needed) { -+ btf_verifier_log_basic(env, t, -+ "meta_left:%u meta_needed:%u", -+ meta_left, meta_needed); -+ return -EINVAL; -+ } -+ -+ if (btf_type_vlen(t)) { -+ btf_verifier_log_type(env, t, "vlen != 0"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_kflag(t)) { -+ btf_verifier_log_type(env, t, "Invalid btf_info kind_flag"); -+ return -EINVAL; -+ } -+ -+ int_data = btf_type_int(t); -+ if (int_data & ~BTF_INT_MASK) { -+ btf_verifier_log_basic(env, t, "Invalid int_data:%x", -+ int_data); -+ return -EINVAL; -+ } -+ -+ nr_bits = BTF_INT_BITS(int_data) + BTF_INT_OFFSET(int_data); -+ -+ if (nr_bits > BITS_PER_U128) { -+ btf_verifier_log_type(env, t, "nr_bits exceeds %zu", -+ BITS_PER_U128); -+ return -EINVAL; -+ } -+ -+ if (BITS_ROUNDUP_BYTES(nr_bits) > t->size) { -+ btf_verifier_log_type(env, t, "nr_bits exceeds type_size"); -+ return -EINVAL; -+ } -+ -+ /* -+ * Only one of the encoding bits is allowed and it -+ * should be sufficient for the pretty print purpose (i.e. decoding). -+ * Multiple bits can be allowed later if it is found -+ * to be insufficient. -+ */ -+ encoding = BTF_INT_ENCODING(int_data); -+ if (encoding && -+ encoding != BTF_INT_SIGNED && -+ encoding != BTF_INT_CHAR && -+ encoding != BTF_INT_BOOL) { -+ btf_verifier_log_type(env, t, "Unsupported encoding"); -+ return -ENOTSUPP; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ return meta_needed; -+} -+ -+static void btf_int_log(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ int int_data = btf_type_int(t); -+ -+ btf_verifier_log(env, -+ "size=%u bits_offset=%u nr_bits=%u encoding=%s", -+ t->size, BTF_INT_OFFSET(int_data), -+ BTF_INT_BITS(int_data), -+ btf_int_encoding_str(BTF_INT_ENCODING(int_data))); -+} -+ -+static void btf_int128_print(struct seq_file *m, void *data) -+{ -+ /* data points to a __int128 number. -+ * Suppose -+ * int128_num = *(__int128 *)data; -+ * The below formulas shows what upper_num and lower_num represents: -+ * upper_num = int128_num >> 64; -+ * lower_num = int128_num & 0xffffffffFFFFFFFFULL; -+ */ -+ u64 upper_num, lower_num; -+ -+#ifdef __BIG_ENDIAN_BITFIELD -+ upper_num = *(u64 *)data; -+ lower_num = *(u64 *)(data + 8); -+#else -+ upper_num = *(u64 *)(data + 8); -+ lower_num = *(u64 *)data; -+#endif -+ if (upper_num == 0) -+ seq_printf(m, "0x%llx", lower_num); -+ else -+ seq_printf(m, "0x%llx%016llx", upper_num, lower_num); -+} -+ -+static void btf_int128_shift(u64 *print_num, u16 left_shift_bits, -+ u16 right_shift_bits) -+{ -+ u64 upper_num, lower_num; -+ -+#ifdef __BIG_ENDIAN_BITFIELD -+ upper_num = print_num[0]; -+ lower_num = print_num[1]; -+#else -+ upper_num = print_num[1]; -+ lower_num = print_num[0]; -+#endif -+ -+ /* shake out un-needed bits by shift/or operations */ -+ if (left_shift_bits >= 64) { -+ upper_num = lower_num << (left_shift_bits - 64); -+ lower_num = 0; -+ } else { -+ upper_num = (upper_num << left_shift_bits) | -+ (lower_num >> (64 - left_shift_bits)); -+ lower_num = lower_num << left_shift_bits; -+ } -+ -+ if (right_shift_bits >= 64) { -+ lower_num = upper_num >> (right_shift_bits - 64); -+ upper_num = 0; -+ } else { -+ lower_num = (lower_num >> right_shift_bits) | -+ (upper_num << (64 - right_shift_bits)); -+ upper_num = upper_num >> right_shift_bits; -+ } -+ -+#ifdef __BIG_ENDIAN_BITFIELD -+ print_num[0] = upper_num; -+ print_num[1] = lower_num; -+#else -+ print_num[0] = lower_num; -+ print_num[1] = upper_num; -+#endif -+} -+ -+static void btf_bitfield_seq_show(void *data, u8 bits_offset, -+ u8 nr_bits, struct seq_file *m) -+{ -+ u16 left_shift_bits, right_shift_bits; -+ u8 nr_copy_bytes; -+ u8 nr_copy_bits; -+ u64 print_num[2] = {}; -+ -+ nr_copy_bits = nr_bits + bits_offset; -+ nr_copy_bytes = BITS_ROUNDUP_BYTES(nr_copy_bits); -+ -+ memcpy(print_num, data, nr_copy_bytes); -+ -+#ifdef __BIG_ENDIAN_BITFIELD -+ left_shift_bits = bits_offset; -+#else -+ left_shift_bits = BITS_PER_U128 - nr_copy_bits; -+#endif -+ right_shift_bits = BITS_PER_U128 - nr_bits; -+ -+ btf_int128_shift(print_num, left_shift_bits, right_shift_bits); -+ btf_int128_print(m, print_num); -+} -+ -+ -+static void btf_int_bits_seq_show(const struct btf *btf, -+ const struct btf_type *t, -+ void *data, u8 bits_offset, -+ struct seq_file *m) -+{ -+ u32 int_data = btf_type_int(t); -+ u8 nr_bits = BTF_INT_BITS(int_data); -+ u8 total_bits_offset; -+ -+ /* -+ * bits_offset is at most 7. -+ * BTF_INT_OFFSET() cannot exceed 128 bits. -+ */ -+ total_bits_offset = bits_offset + BTF_INT_OFFSET(int_data); -+ data += BITS_ROUNDDOWN_BYTES(total_bits_offset); -+ bits_offset = BITS_PER_BYTE_MASKED(total_bits_offset); -+ btf_bitfield_seq_show(data, bits_offset, nr_bits, m); -+} -+ -+static void btf_int_seq_show(const struct btf *btf, const struct btf_type *t, -+ u32 type_id, void *data, u8 bits_offset, -+ struct seq_file *m) -+{ -+ u32 int_data = btf_type_int(t); -+ u8 encoding = BTF_INT_ENCODING(int_data); -+ bool sign = encoding & BTF_INT_SIGNED; -+ u8 nr_bits = BTF_INT_BITS(int_data); -+ -+ if (bits_offset || BTF_INT_OFFSET(int_data) || -+ BITS_PER_BYTE_MASKED(nr_bits)) { -+ btf_int_bits_seq_show(btf, t, data, bits_offset, m); -+ return; -+ } -+ -+ switch (nr_bits) { -+ case 128: -+ btf_int128_print(m, data); -+ break; -+ case 64: -+ if (sign) -+ seq_printf(m, "%lld", *(s64 *)data); -+ else -+ seq_printf(m, "%llu", *(u64 *)data); -+ break; -+ case 32: -+ if (sign) -+ seq_printf(m, "%d", *(s32 *)data); -+ else -+ seq_printf(m, "%u", *(u32 *)data); -+ break; -+ case 16: -+ if (sign) -+ seq_printf(m, "%d", *(s16 *)data); -+ else -+ seq_printf(m, "%u", *(u16 *)data); -+ break; -+ case 8: -+ if (sign) -+ seq_printf(m, "%d", *(s8 *)data); -+ else -+ seq_printf(m, "%u", *(u8 *)data); -+ break; -+ default: -+ btf_int_bits_seq_show(btf, t, data, bits_offset, m); -+ } -+} -+ -+static const struct btf_kind_operations int_ops = { -+ .check_meta = btf_int_check_meta, -+ .resolve = btf_df_resolve, -+ .check_member = btf_int_check_member, -+ .check_kflag_member = btf_int_check_kflag_member, -+ .log_details = btf_int_log, -+ .seq_show = btf_int_seq_show, -+}; -+ -+static int btf_modifier_check_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ const struct btf_type *resolved_type; -+ u32 resolved_type_id = member->type; -+ struct btf_member resolved_member; -+ struct btf *btf = env->btf; -+ -+ resolved_type = btf_type_id_size(btf, &resolved_type_id, NULL); -+ if (!resolved_type) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Invalid member"); -+ return -EINVAL; -+ } -+ -+ resolved_member = *member; -+ resolved_member.type = resolved_type_id; -+ -+ return btf_type_ops(resolved_type)->check_member(env, struct_type, -+ &resolved_member, -+ resolved_type); -+} -+ -+static int btf_modifier_check_kflag_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ const struct btf_type *resolved_type; -+ u32 resolved_type_id = member->type; -+ struct btf_member resolved_member; -+ struct btf *btf = env->btf; -+ -+ resolved_type = btf_type_id_size(btf, &resolved_type_id, NULL); -+ if (!resolved_type) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Invalid member"); -+ return -EINVAL; -+ } -+ -+ resolved_member = *member; -+ resolved_member.type = resolved_type_id; -+ -+ return btf_type_ops(resolved_type)->check_kflag_member(env, struct_type, -+ &resolved_member, -+ resolved_type); -+} -+ -+static int btf_ptr_check_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ u32 struct_size, struct_bits_off, bytes_offset; -+ -+ struct_size = struct_type->size; -+ struct_bits_off = member->offset; -+ bytes_offset = BITS_ROUNDDOWN_BYTES(struct_bits_off); -+ -+ if (BITS_PER_BYTE_MASKED(struct_bits_off)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member is not byte aligned"); -+ return -EINVAL; -+ } -+ -+ if (struct_size - bytes_offset < sizeof(void *)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member exceeds struct_size"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int btf_ref_type_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ if (btf_type_vlen(t)) { -+ btf_verifier_log_type(env, t, "vlen != 0"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_kflag(t)) { -+ btf_verifier_log_type(env, t, "Invalid btf_info kind_flag"); -+ return -EINVAL; -+ } -+ -+ if (!BTF_TYPE_ID_VALID(t->type)) { -+ btf_verifier_log_type(env, t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ /* typedef type must have a valid name, and other ref types, -+ * volatile, const, restrict, should have a null name. -+ */ -+ if (BTF_INFO_KIND(t->info) == BTF_KIND_TYPEDEF) { -+ if (!t->name_off || -+ !btf_name_valid_identifier(env->btf, t->name_off)) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ } else { -+ if (t->name_off) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ return 0; -+} -+ -+static int btf_modifier_resolve(struct btf_verifier_env *env, -+ const struct resolve_vertex *v) -+{ -+ const struct btf_type *t = v->t; -+ const struct btf_type *next_type; -+ u32 next_type_id = t->type; -+ struct btf *btf = env->btf; -+ -+ next_type = btf_type_by_id(btf, next_type_id); -+ if (!next_type || btf_type_is_resolve_source_only(next_type)) { -+ btf_verifier_log_type(env, v->t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ if (!env_type_is_resolve_sink(env, next_type) && -+ !env_type_is_resolved(env, next_type_id)) -+ return env_stack_push(env, next_type, next_type_id); -+ -+ /* Figure out the resolved next_type_id with size. -+ * They will be stored in the current modifier's -+ * resolved_ids and resolved_sizes such that it can -+ * save us a few type-following when we use it later (e.g. in -+ * pretty print). -+ */ -+ if (!btf_type_id_size(btf, &next_type_id, NULL)) { -+ if (env_type_is_resolved(env, next_type_id)) -+ next_type = btf_type_id_resolve(btf, &next_type_id); -+ -+ /* "typedef void new_void", "const void"...etc */ -+ if (!btf_type_is_void(next_type) && -+ !btf_type_is_fwd(next_type) && -+ !btf_type_is_func_proto(next_type)) { -+ btf_verifier_log_type(env, v->t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ } -+ -+ env_stack_pop_resolved(env, next_type_id, 0); -+ -+ return 0; -+} -+ -+static int btf_var_resolve(struct btf_verifier_env *env, -+ const struct resolve_vertex *v) -+{ -+ const struct btf_type *next_type; -+ const struct btf_type *t = v->t; -+ u32 next_type_id = t->type; -+ struct btf *btf = env->btf; -+ -+ next_type = btf_type_by_id(btf, next_type_id); -+ if (!next_type || btf_type_is_resolve_source_only(next_type)) { -+ btf_verifier_log_type(env, v->t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ if (!env_type_is_resolve_sink(env, next_type) && -+ !env_type_is_resolved(env, next_type_id)) -+ return env_stack_push(env, next_type, next_type_id); -+ -+ if (btf_type_is_modifier(next_type)) { -+ const struct btf_type *resolved_type; -+ u32 resolved_type_id; -+ -+ resolved_type_id = next_type_id; -+ resolved_type = btf_type_id_resolve(btf, &resolved_type_id); -+ -+ if (btf_type_is_ptr(resolved_type) && -+ !env_type_is_resolve_sink(env, resolved_type) && -+ !env_type_is_resolved(env, resolved_type_id)) -+ return env_stack_push(env, resolved_type, -+ resolved_type_id); -+ } -+ -+ /* We must resolve to something concrete at this point, no -+ * forward types or similar that would resolve to size of -+ * zero is allowed. -+ */ -+ if (!btf_type_id_size(btf, &next_type_id, NULL)) { -+ btf_verifier_log_type(env, v->t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ env_stack_pop_resolved(env, next_type_id, 0); -+ -+ return 0; -+} -+ -+static int btf_ptr_resolve(struct btf_verifier_env *env, -+ const struct resolve_vertex *v) -+{ -+ const struct btf_type *next_type; -+ const struct btf_type *t = v->t; -+ u32 next_type_id = t->type; -+ struct btf *btf = env->btf; -+ -+ next_type = btf_type_by_id(btf, next_type_id); -+ if (!next_type || btf_type_is_resolve_source_only(next_type)) { -+ btf_verifier_log_type(env, v->t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ if (!env_type_is_resolve_sink(env, next_type) && -+ !env_type_is_resolved(env, next_type_id)) -+ return env_stack_push(env, next_type, next_type_id); -+ -+ /* If the modifier was RESOLVED during RESOLVE_STRUCT_OR_ARRAY, -+ * the modifier may have stopped resolving when it was resolved -+ * to a ptr (last-resolved-ptr). -+ * -+ * We now need to continue from the last-resolved-ptr to -+ * ensure the last-resolved-ptr will not referring back to -+ * the currenct ptr (t). -+ */ -+ if (btf_type_is_modifier(next_type)) { -+ const struct btf_type *resolved_type; -+ u32 resolved_type_id; -+ -+ resolved_type_id = next_type_id; -+ resolved_type = btf_type_id_resolve(btf, &resolved_type_id); -+ -+ if (btf_type_is_ptr(resolved_type) && -+ !env_type_is_resolve_sink(env, resolved_type) && -+ !env_type_is_resolved(env, resolved_type_id)) -+ return env_stack_push(env, resolved_type, -+ resolved_type_id); -+ } -+ -+ if (!btf_type_id_size(btf, &next_type_id, NULL)) { -+ if (env_type_is_resolved(env, next_type_id)) -+ next_type = btf_type_id_resolve(btf, &next_type_id); -+ -+ if (!btf_type_is_void(next_type) && -+ !btf_type_is_fwd(next_type) && -+ !btf_type_is_func_proto(next_type)) { -+ btf_verifier_log_type(env, v->t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ } -+ -+ env_stack_pop_resolved(env, next_type_id, 0); -+ -+ return 0; -+} -+ -+static void btf_modifier_seq_show(const struct btf *btf, -+ const struct btf_type *t, -+ u32 type_id, void *data, -+ u8 bits_offset, struct seq_file *m) -+{ -+ t = btf_type_id_resolve(btf, &type_id); -+ -+ btf_type_ops(t)->seq_show(btf, t, type_id, data, bits_offset, m); -+} -+ -+static void btf_var_seq_show(const struct btf *btf, const struct btf_type *t, -+ u32 type_id, void *data, u8 bits_offset, -+ struct seq_file *m) -+{ -+ t = btf_type_id_resolve(btf, &type_id); -+ -+ btf_type_ops(t)->seq_show(btf, t, type_id, data, bits_offset, m); -+} -+ -+static void btf_ptr_seq_show(const struct btf *btf, const struct btf_type *t, -+ u32 type_id, void *data, u8 bits_offset, -+ struct seq_file *m) -+{ -+ /* It is a hashed value */ -+ seq_printf(m, "%p", *(void **)data); -+} -+ -+static void btf_ref_type_log(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ btf_verifier_log(env, "type_id=%u", t->type); -+} -+ -+static struct btf_kind_operations modifier_ops = { -+ .check_meta = btf_ref_type_check_meta, -+ .resolve = btf_modifier_resolve, -+ .check_member = btf_modifier_check_member, -+ .check_kflag_member = btf_modifier_check_kflag_member, -+ .log_details = btf_ref_type_log, -+ .seq_show = btf_modifier_seq_show, -+}; -+ -+static struct btf_kind_operations ptr_ops = { -+ .check_meta = btf_ref_type_check_meta, -+ .resolve = btf_ptr_resolve, -+ .check_member = btf_ptr_check_member, -+ .check_kflag_member = btf_generic_check_kflag_member, -+ .log_details = btf_ref_type_log, -+ .seq_show = btf_ptr_seq_show, -+}; -+ -+static s32 btf_fwd_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ if (btf_type_vlen(t)) { -+ btf_verifier_log_type(env, t, "vlen != 0"); -+ return -EINVAL; -+ } -+ -+ if (t->type) { -+ btf_verifier_log_type(env, t, "type != 0"); -+ return -EINVAL; -+ } -+ -+ /* fwd type must have a valid name */ -+ if (!t->name_off || -+ !btf_name_valid_identifier(env->btf, t->name_off)) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ return 0; -+} -+ -+static void btf_fwd_type_log(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ btf_verifier_log(env, "%s", btf_type_kflag(t) ? "union" : "struct"); -+} -+ -+static struct btf_kind_operations fwd_ops = { -+ .check_meta = btf_fwd_check_meta, -+ .resolve = btf_df_resolve, -+ .check_member = btf_df_check_member, -+ .check_kflag_member = btf_df_check_kflag_member, -+ .log_details = btf_fwd_type_log, -+ .seq_show = btf_df_seq_show, -+}; -+ -+static int btf_array_check_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ u32 struct_bits_off = member->offset; -+ u32 struct_size, bytes_offset; -+ u32 array_type_id, array_size; -+ struct btf *btf = env->btf; -+ -+ if (BITS_PER_BYTE_MASKED(struct_bits_off)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member is not byte aligned"); -+ return -EINVAL; -+ } -+ -+ array_type_id = member->type; -+ btf_type_id_size(btf, &array_type_id, &array_size); -+ struct_size = struct_type->size; -+ bytes_offset = BITS_ROUNDDOWN_BYTES(struct_bits_off); -+ if (struct_size - bytes_offset < array_size) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member exceeds struct_size"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static s32 btf_array_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ const struct btf_array *array = btf_type_array(t); -+ u32 meta_needed = sizeof(*array); -+ -+ if (meta_left < meta_needed) { -+ btf_verifier_log_basic(env, t, -+ "meta_left:%u meta_needed:%u", -+ meta_left, meta_needed); -+ return -EINVAL; -+ } -+ -+ /* array type should not have a name */ -+ if (t->name_off) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_vlen(t)) { -+ btf_verifier_log_type(env, t, "vlen != 0"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_kflag(t)) { -+ btf_verifier_log_type(env, t, "Invalid btf_info kind_flag"); -+ return -EINVAL; -+ } -+ -+ if (t->size) { -+ btf_verifier_log_type(env, t, "size != 0"); -+ return -EINVAL; -+ } -+ -+ /* Array elem type and index type cannot be in type void, -+ * so !array->type and !array->index_type are not allowed. -+ */ -+ if (!array->type || !BTF_TYPE_ID_VALID(array->type)) { -+ btf_verifier_log_type(env, t, "Invalid elem"); -+ return -EINVAL; -+ } -+ -+ if (!array->index_type || !BTF_TYPE_ID_VALID(array->index_type)) { -+ btf_verifier_log_type(env, t, "Invalid index"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ return meta_needed; -+} -+ -+static int btf_array_resolve(struct btf_verifier_env *env, -+ const struct resolve_vertex *v) -+{ -+ const struct btf_array *array = btf_type_array(v->t); -+ const struct btf_type *elem_type, *index_type; -+ u32 elem_type_id, index_type_id; -+ struct btf *btf = env->btf; -+ u32 elem_size; -+ -+ /* Check array->index_type */ -+ index_type_id = array->index_type; -+ index_type = btf_type_by_id(btf, index_type_id); -+ if (btf_type_nosize_or_null(index_type) || -+ btf_type_is_resolve_source_only(index_type)) { -+ btf_verifier_log_type(env, v->t, "Invalid index"); -+ return -EINVAL; -+ } -+ -+ if (!env_type_is_resolve_sink(env, index_type) && -+ !env_type_is_resolved(env, index_type_id)) -+ return env_stack_push(env, index_type, index_type_id); -+ -+ index_type = btf_type_id_size(btf, &index_type_id, NULL); -+ if (!index_type || !btf_type_is_int(index_type) || -+ !btf_type_int_is_regular(index_type)) { -+ btf_verifier_log_type(env, v->t, "Invalid index"); -+ return -EINVAL; -+ } -+ -+ /* Check array->type */ -+ elem_type_id = array->type; -+ elem_type = btf_type_by_id(btf, elem_type_id); -+ if (btf_type_nosize_or_null(elem_type) || -+ btf_type_is_resolve_source_only(elem_type)) { -+ btf_verifier_log_type(env, v->t, -+ "Invalid elem"); -+ return -EINVAL; -+ } -+ -+ if (!env_type_is_resolve_sink(env, elem_type) && -+ !env_type_is_resolved(env, elem_type_id)) -+ return env_stack_push(env, elem_type, elem_type_id); -+ -+ elem_type = btf_type_id_size(btf, &elem_type_id, &elem_size); -+ if (!elem_type) { -+ btf_verifier_log_type(env, v->t, "Invalid elem"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_is_int(elem_type) && !btf_type_int_is_regular(elem_type)) { -+ btf_verifier_log_type(env, v->t, "Invalid array of int"); -+ return -EINVAL; -+ } -+ -+ if (array->nelems && elem_size > U32_MAX / array->nelems) { -+ btf_verifier_log_type(env, v->t, -+ "Array size overflows U32_MAX"); -+ return -EINVAL; -+ } -+ -+ env_stack_pop_resolved(env, elem_type_id, elem_size * array->nelems); -+ -+ return 0; -+} -+ -+static void btf_array_log(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ const struct btf_array *array = btf_type_array(t); -+ -+ btf_verifier_log(env, "type_id=%u index_type_id=%u nr_elems=%u", -+ array->type, array->index_type, array->nelems); -+} -+ -+static void btf_array_seq_show(const struct btf *btf, const struct btf_type *t, -+ u32 type_id, void *data, u8 bits_offset, -+ struct seq_file *m) -+{ -+ const struct btf_array *array = btf_type_array(t); -+ const struct btf_kind_operations *elem_ops; -+ const struct btf_type *elem_type; -+ u32 i, elem_size, elem_type_id; -+ -+ elem_type_id = array->type; -+ elem_type = btf_type_id_size(btf, &elem_type_id, &elem_size); -+ elem_ops = btf_type_ops(elem_type); -+ seq_puts(m, "["); -+ for (i = 0; i < array->nelems; i++) { -+ if (i) -+ seq_puts(m, ","); -+ -+ elem_ops->seq_show(btf, elem_type, elem_type_id, data, -+ bits_offset, m); -+ data += elem_size; -+ } -+ seq_puts(m, "]"); -+} -+ -+static struct btf_kind_operations array_ops = { -+ .check_meta = btf_array_check_meta, -+ .resolve = btf_array_resolve, -+ .check_member = btf_array_check_member, -+ .check_kflag_member = btf_generic_check_kflag_member, -+ .log_details = btf_array_log, -+ .seq_show = btf_array_seq_show, -+}; -+ -+static int btf_struct_check_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ u32 struct_bits_off = member->offset; -+ u32 struct_size, bytes_offset; -+ -+ if (BITS_PER_BYTE_MASKED(struct_bits_off)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member is not byte aligned"); -+ return -EINVAL; -+ } -+ -+ struct_size = struct_type->size; -+ bytes_offset = BITS_ROUNDDOWN_BYTES(struct_bits_off); -+ if (struct_size - bytes_offset < member_type->size) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member exceeds struct_size"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static s32 btf_struct_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ bool is_union = BTF_INFO_KIND(t->info) == BTF_KIND_UNION; -+ const struct btf_member *member; -+ u32 meta_needed, last_offset; -+ struct btf *btf = env->btf; -+ u32 struct_size = t->size; -+ u32 offset; -+ u16 i; -+ -+ meta_needed = btf_type_vlen(t) * sizeof(*member); -+ if (meta_left < meta_needed) { -+ btf_verifier_log_basic(env, t, -+ "meta_left:%u meta_needed:%u", -+ meta_left, meta_needed); -+ return -EINVAL; -+ } -+ -+ /* struct type either no name or a valid one */ -+ if (t->name_off && -+ !btf_name_valid_identifier(env->btf, t->name_off)) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ last_offset = 0; -+ for_each_member(i, t, member) { -+ if (!btf_name_offset_valid(btf, member->name_off)) { -+ btf_verifier_log_member(env, t, member, -+ "Invalid member name_offset:%u", -+ member->name_off); -+ return -EINVAL; -+ } -+ -+ /* struct member either no name or a valid one */ -+ if (member->name_off && -+ !btf_name_valid_identifier(btf, member->name_off)) { -+ btf_verifier_log_member(env, t, member, "Invalid name"); -+ return -EINVAL; -+ } -+ /* A member cannot be in type void */ -+ if (!member->type || !BTF_TYPE_ID_VALID(member->type)) { -+ btf_verifier_log_member(env, t, member, -+ "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ offset = btf_member_bit_offset(t, member); -+ if (is_union && offset) { -+ btf_verifier_log_member(env, t, member, -+ "Invalid member bits_offset"); -+ return -EINVAL; -+ } -+ -+ /* -+ * ">" instead of ">=" because the last member could be -+ * "char a[0];" -+ */ -+ if (last_offset > offset) { -+ btf_verifier_log_member(env, t, member, -+ "Invalid member bits_offset"); -+ return -EINVAL; -+ } -+ -+ if (BITS_ROUNDUP_BYTES(offset) > struct_size) { -+ btf_verifier_log_member(env, t, member, -+ "Member bits_offset exceeds its struct size"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_member(env, t, member, NULL); -+ last_offset = offset; -+ } -+ -+ return meta_needed; -+} -+ -+static int btf_struct_resolve(struct btf_verifier_env *env, -+ const struct resolve_vertex *v) -+{ -+ const struct btf_member *member; -+ int err; -+ u16 i; -+ -+ /* Before continue resolving the next_member, -+ * ensure the last member is indeed resolved to a -+ * type with size info. -+ */ -+ if (v->next_member) { -+ const struct btf_type *last_member_type; -+ const struct btf_member *last_member; -+ u16 last_member_type_id; -+ -+ last_member = btf_type_member(v->t) + v->next_member - 1; -+ last_member_type_id = last_member->type; -+ if (WARN_ON_ONCE(!env_type_is_resolved(env, -+ last_member_type_id))) -+ return -EINVAL; -+ -+ last_member_type = btf_type_by_id(env->btf, -+ last_member_type_id); -+ if (btf_type_kflag(v->t)) -+ err = btf_type_ops(last_member_type)->check_kflag_member(env, v->t, -+ last_member, -+ last_member_type); -+ else -+ err = btf_type_ops(last_member_type)->check_member(env, v->t, -+ last_member, -+ last_member_type); -+ if (err) -+ return err; -+ } -+ -+ for_each_member_from(i, v->next_member, v->t, member) { -+ u32 member_type_id = member->type; -+ const struct btf_type *member_type = btf_type_by_id(env->btf, -+ member_type_id); -+ -+ if (btf_type_nosize_or_null(member_type) || -+ btf_type_is_resolve_source_only(member_type)) { -+ btf_verifier_log_member(env, v->t, member, -+ "Invalid member"); -+ return -EINVAL; -+ } -+ -+ if (!env_type_is_resolve_sink(env, member_type) && -+ !env_type_is_resolved(env, member_type_id)) { -+ env_stack_set_next_member(env, i + 1); -+ return env_stack_push(env, member_type, member_type_id); -+ } -+ -+ if (btf_type_kflag(v->t)) -+ err = btf_type_ops(member_type)->check_kflag_member(env, v->t, -+ member, -+ member_type); -+ else -+ err = btf_type_ops(member_type)->check_member(env, v->t, -+ member, -+ member_type); -+ if (err) -+ return err; -+ } -+ -+ env_stack_pop_resolved(env, 0, 0); -+ -+ return 0; -+} -+ -+static void btf_struct_log(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ btf_verifier_log(env, "size=%u vlen=%u", t->size, btf_type_vlen(t)); -+} -+ -+/* find 'struct bpf_spin_lock' in map value. -+ * return >= 0 offset if found -+ * and < 0 in case of error -+ */ -+int btf_find_spin_lock(const struct btf *btf, const struct btf_type *t) -+{ -+ const struct btf_member *member; -+ u32 i, off = -ENOENT; -+ -+ if (!__btf_type_is_struct(t)) -+ return -EINVAL; -+ -+ for_each_member(i, t, member) { -+ const struct btf_type *member_type = btf_type_by_id(btf, -+ member->type); -+ if (!__btf_type_is_struct(member_type)) -+ continue; -+ if (member_type->size != sizeof(struct bpf_spin_lock)) -+ continue; -+ if (strcmp(__btf_name_by_offset(btf, member_type->name_off), -+ "bpf_spin_lock")) -+ continue; -+ if (off != -ENOENT) -+ /* only one 'struct bpf_spin_lock' is allowed */ -+ return -E2BIG; -+ off = btf_member_bit_offset(t, member); -+ if (off % 8) -+ /* valid C code cannot generate such BTF */ -+ return -EINVAL; -+ off /= 8; -+ if (off % __alignof__(struct bpf_spin_lock)) -+ /* valid struct bpf_spin_lock will be 4 byte aligned */ -+ return -EINVAL; -+ } -+ return off; -+} -+ -+static void btf_struct_seq_show(const struct btf *btf, const struct btf_type *t, -+ u32 type_id, void *data, u8 bits_offset, -+ struct seq_file *m) -+{ -+ const char *seq = BTF_INFO_KIND(t->info) == BTF_KIND_UNION ? "|" : ","; -+ const struct btf_member *member; -+ u32 i; -+ -+ seq_puts(m, "{"); -+ for_each_member(i, t, member) { -+ const struct btf_type *member_type = btf_type_by_id(btf, -+ member->type); -+ const struct btf_kind_operations *ops; -+ u32 member_offset, bitfield_size; -+ u32 bytes_offset; -+ u8 bits8_offset; -+ -+ if (i) -+ seq_puts(m, seq); -+ -+ member_offset = btf_member_bit_offset(t, member); -+ bitfield_size = btf_member_bitfield_size(t, member); -+ bytes_offset = BITS_ROUNDDOWN_BYTES(member_offset); -+ bits8_offset = BITS_PER_BYTE_MASKED(member_offset); -+ if (bitfield_size) { -+ btf_bitfield_seq_show(data + bytes_offset, bits8_offset, -+ bitfield_size, m); -+ } else { -+ ops = btf_type_ops(member_type); -+ ops->seq_show(btf, member_type, member->type, -+ data + bytes_offset, bits8_offset, m); -+ } -+ } -+ seq_puts(m, "}"); -+} -+ -+static struct btf_kind_operations struct_ops = { -+ .check_meta = btf_struct_check_meta, -+ .resolve = btf_struct_resolve, -+ .check_member = btf_struct_check_member, -+ .check_kflag_member = btf_generic_check_kflag_member, -+ .log_details = btf_struct_log, -+ .seq_show = btf_struct_seq_show, -+}; -+ -+static int btf_enum_check_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ u32 struct_bits_off = member->offset; -+ u32 struct_size, bytes_offset; -+ -+ if (BITS_PER_BYTE_MASKED(struct_bits_off)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member is not byte aligned"); -+ return -EINVAL; -+ } -+ -+ struct_size = struct_type->size; -+ bytes_offset = BITS_ROUNDDOWN_BYTES(struct_bits_off); -+ if (struct_size - bytes_offset < member_type->size) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member exceeds struct_size"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int btf_enum_check_kflag_member(struct btf_verifier_env *env, -+ const struct btf_type *struct_type, -+ const struct btf_member *member, -+ const struct btf_type *member_type) -+{ -+ u32 struct_bits_off, nr_bits, bytes_end, struct_size; -+ u32 int_bitsize = sizeof(int) * BITS_PER_BYTE; -+ -+ struct_bits_off = BTF_MEMBER_BIT_OFFSET(member->offset); -+ nr_bits = BTF_MEMBER_BITFIELD_SIZE(member->offset); -+ if (!nr_bits) { -+ if (BITS_PER_BYTE_MASKED(struct_bits_off)) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member is not byte aligned"); -+ return -EINVAL; -+ } -+ -+ nr_bits = int_bitsize; -+ } else if (nr_bits > int_bitsize) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Invalid member bitfield_size"); -+ return -EINVAL; -+ } -+ -+ struct_size = struct_type->size; -+ bytes_end = BITS_ROUNDUP_BYTES(struct_bits_off + nr_bits); -+ if (struct_size < bytes_end) { -+ btf_verifier_log_member(env, struct_type, member, -+ "Member exceeds struct_size"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static s32 btf_enum_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ const struct btf_enum *enums = btf_type_enum(t); -+ struct btf *btf = env->btf; -+ u16 i, nr_enums; -+ u32 meta_needed; -+ -+ nr_enums = btf_type_vlen(t); -+ meta_needed = nr_enums * sizeof(*enums); -+ -+ if (meta_left < meta_needed) { -+ btf_verifier_log_basic(env, t, -+ "meta_left:%u meta_needed:%u", -+ meta_left, meta_needed); -+ return -EINVAL; -+ } -+ -+ if (btf_type_kflag(t)) { -+ btf_verifier_log_type(env, t, "Invalid btf_info kind_flag"); -+ return -EINVAL; -+ } -+ -+ if (t->size > 8 || !is_power_of_2(t->size)) { -+ btf_verifier_log_type(env, t, "Unexpected size"); -+ return -EINVAL; -+ } -+ -+ /* enum type either no name or a valid one */ -+ if (t->name_off && -+ !btf_name_valid_identifier(env->btf, t->name_off)) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ for (i = 0; i < nr_enums; i++) { -+ if (!btf_name_offset_valid(btf, enums[i].name_off)) { -+ btf_verifier_log(env, "\tInvalid name_offset:%u", -+ enums[i].name_off); -+ return -EINVAL; -+ } -+ -+ /* enum member must have a valid name */ -+ if (!enums[i].name_off || -+ !btf_name_valid_identifier(btf, enums[i].name_off)) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ -+ btf_verifier_log(env, "\t%s val=%d\n", -+ __btf_name_by_offset(btf, enums[i].name_off), -+ enums[i].val); -+ } -+ -+ return meta_needed; -+} -+ -+static void btf_enum_log(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ btf_verifier_log(env, "size=%u vlen=%u", t->size, btf_type_vlen(t)); -+} -+ -+static void btf_enum_seq_show(const struct btf *btf, const struct btf_type *t, -+ u32 type_id, void *data, u8 bits_offset, -+ struct seq_file *m) -+{ -+ const struct btf_enum *enums = btf_type_enum(t); -+ u32 i, nr_enums = btf_type_vlen(t); -+ int v = *(int *)data; -+ -+ for (i = 0; i < nr_enums; i++) { -+ if (v == enums[i].val) { -+ seq_printf(m, "%s", -+ __btf_name_by_offset(btf, -+ enums[i].name_off)); -+ return; -+ } -+ } -+ -+ seq_printf(m, "%d", v); -+} -+ -+static struct btf_kind_operations enum_ops = { -+ .check_meta = btf_enum_check_meta, -+ .resolve = btf_df_resolve, -+ .check_member = btf_enum_check_member, -+ .check_kflag_member = btf_enum_check_kflag_member, -+ .log_details = btf_enum_log, -+ .seq_show = btf_enum_seq_show, -+}; -+ -+static s32 btf_func_proto_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ u32 meta_needed = btf_type_vlen(t) * sizeof(struct btf_param); -+ -+ if (meta_left < meta_needed) { -+ btf_verifier_log_basic(env, t, -+ "meta_left:%u meta_needed:%u", -+ meta_left, meta_needed); -+ return -EINVAL; -+ } -+ -+ if (t->name_off) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_kflag(t)) { -+ btf_verifier_log_type(env, t, "Invalid btf_info kind_flag"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ return meta_needed; -+} -+ -+static void btf_func_proto_log(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ const struct btf_param *args = (const struct btf_param *)(t + 1); -+ u16 nr_args = btf_type_vlen(t), i; -+ -+ btf_verifier_log(env, "return=%u args=(", t->type); -+ if (!nr_args) { -+ btf_verifier_log(env, "void"); -+ goto done; -+ } -+ -+ if (nr_args == 1 && !args[0].type) { -+ /* Only one vararg */ -+ btf_verifier_log(env, "vararg"); -+ goto done; -+ } -+ -+ btf_verifier_log(env, "%u %s", args[0].type, -+ __btf_name_by_offset(env->btf, -+ args[0].name_off)); -+ for (i = 1; i < nr_args - 1; i++) -+ btf_verifier_log(env, ", %u %s", args[i].type, -+ __btf_name_by_offset(env->btf, -+ args[i].name_off)); -+ -+ if (nr_args > 1) { -+ const struct btf_param *last_arg = &args[nr_args - 1]; -+ -+ if (last_arg->type) -+ btf_verifier_log(env, ", %u %s", last_arg->type, -+ __btf_name_by_offset(env->btf, -+ last_arg->name_off)); -+ else -+ btf_verifier_log(env, ", vararg"); -+ } -+ -+done: -+ btf_verifier_log(env, ")"); -+} -+ -+static struct btf_kind_operations func_proto_ops = { -+ .check_meta = btf_func_proto_check_meta, -+ .resolve = btf_df_resolve, -+ /* -+ * BTF_KIND_FUNC_PROTO cannot be directly referred by -+ * a struct's member. -+ * -+ * It should be a funciton pointer instead. -+ * (i.e. struct's member -> BTF_KIND_PTR -> BTF_KIND_FUNC_PROTO) -+ * -+ * Hence, there is no btf_func_check_member(). -+ */ -+ .check_member = btf_df_check_member, -+ .check_kflag_member = btf_df_check_kflag_member, -+ .log_details = btf_func_proto_log, -+ .seq_show = btf_df_seq_show, -+}; -+ -+static s32 btf_func_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ if (!t->name_off || -+ !btf_name_valid_identifier(env->btf, t->name_off)) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_vlen(t)) { -+ btf_verifier_log_type(env, t, "vlen != 0"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_kflag(t)) { -+ btf_verifier_log_type(env, t, "Invalid btf_info kind_flag"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ return 0; -+} -+ -+static struct btf_kind_operations func_ops = { -+ .check_meta = btf_func_check_meta, -+ .resolve = btf_df_resolve, -+ .check_member = btf_df_check_member, -+ .check_kflag_member = btf_df_check_kflag_member, -+ .log_details = btf_ref_type_log, -+ .seq_show = btf_df_seq_show, -+}; -+ -+static s32 btf_var_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ const struct btf_var *var; -+ u32 meta_needed = sizeof(*var); -+ -+ if (meta_left < meta_needed) { -+ btf_verifier_log_basic(env, t, -+ "meta_left:%u meta_needed:%u", -+ meta_left, meta_needed); -+ return -EINVAL; -+ } -+ -+ if (btf_type_vlen(t)) { -+ btf_verifier_log_type(env, t, "vlen != 0"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_kflag(t)) { -+ btf_verifier_log_type(env, t, "Invalid btf_info kind_flag"); -+ return -EINVAL; -+ } -+ -+ if (!t->name_off || -+ !__btf_name_valid(env->btf, t->name_off, true)) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ /* A var cannot be in type void */ -+ if (!t->type || !BTF_TYPE_ID_VALID(t->type)) { -+ btf_verifier_log_type(env, t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ var = btf_type_var(t); -+ if (var->linkage != BTF_VAR_STATIC && -+ var->linkage != BTF_VAR_GLOBAL_ALLOCATED) { -+ btf_verifier_log_type(env, t, "Linkage not supported"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ return meta_needed; -+} -+ -+static void btf_var_log(struct btf_verifier_env *env, const struct btf_type *t) -+{ -+ const struct btf_var *var = btf_type_var(t); -+ -+ btf_verifier_log(env, "type_id=%u linkage=%u", t->type, var->linkage); -+} -+ -+static const struct btf_kind_operations var_ops = { -+ .check_meta = btf_var_check_meta, -+ .resolve = btf_var_resolve, -+ .check_member = btf_df_check_member, -+ .check_kflag_member = btf_df_check_kflag_member, -+ .log_details = btf_var_log, -+ .seq_show = btf_var_seq_show, -+}; -+ -+static s32 btf_datasec_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ const struct btf_var_secinfo *vsi; -+ u64 last_vsi_end_off = 0, sum = 0; -+ u32 i, meta_needed; -+ -+ meta_needed = btf_type_vlen(t) * sizeof(*vsi); -+ if (meta_left < meta_needed) { -+ btf_verifier_log_basic(env, t, -+ "meta_left:%u meta_needed:%u", -+ meta_left, meta_needed); -+ return -EINVAL; -+ } -+ -+ if (!btf_type_vlen(t)) { -+ btf_verifier_log_type(env, t, "vlen == 0"); -+ return -EINVAL; -+ } -+ -+ if (!t->size) { -+ btf_verifier_log_type(env, t, "size == 0"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_kflag(t)) { -+ btf_verifier_log_type(env, t, "Invalid btf_info kind_flag"); -+ return -EINVAL; -+ } -+ -+ if (!t->name_off || -+ !btf_name_valid_section(env->btf, t->name_off)) { -+ btf_verifier_log_type(env, t, "Invalid name"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_type(env, t, NULL); -+ -+ for_each_vsi(i, t, vsi) { -+ /* A var cannot be in type void */ -+ if (!vsi->type || !BTF_TYPE_ID_VALID(vsi->type)) { -+ btf_verifier_log_vsi(env, t, vsi, -+ "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ if (vsi->offset < last_vsi_end_off || vsi->offset >= t->size) { -+ btf_verifier_log_vsi(env, t, vsi, -+ "Invalid offset"); -+ return -EINVAL; -+ } -+ -+ if (!vsi->size || vsi->size > t->size) { -+ btf_verifier_log_vsi(env, t, vsi, -+ "Invalid size"); -+ return -EINVAL; -+ } -+ -+ last_vsi_end_off = vsi->offset + vsi->size; -+ if (last_vsi_end_off > t->size) { -+ btf_verifier_log_vsi(env, t, vsi, -+ "Invalid offset+size"); -+ return -EINVAL; -+ } -+ -+ btf_verifier_log_vsi(env, t, vsi, NULL); -+ sum += vsi->size; -+ } -+ -+ if (t->size < sum) { -+ btf_verifier_log_type(env, t, "Invalid btf_info size"); -+ return -EINVAL; -+ } -+ -+ return meta_needed; -+} -+ -+static int btf_datasec_resolve(struct btf_verifier_env *env, -+ const struct resolve_vertex *v) -+{ -+ const struct btf_var_secinfo *vsi; -+ struct btf *btf = env->btf; -+ u16 i; -+ -+ for_each_vsi_from(i, v->next_member, v->t, vsi) { -+ u32 var_type_id = vsi->type, type_id, type_size = 0; -+ const struct btf_type *var_type = btf_type_by_id(env->btf, -+ var_type_id); -+ if (!var_type || !btf_type_is_var(var_type)) { -+ btf_verifier_log_vsi(env, v->t, vsi, -+ "Not a VAR kind member"); -+ return -EINVAL; -+ } -+ -+ if (!env_type_is_resolve_sink(env, var_type) && -+ !env_type_is_resolved(env, var_type_id)) { -+ env_stack_set_next_member(env, i + 1); -+ return env_stack_push(env, var_type, var_type_id); -+ } -+ -+ type_id = var_type->type; -+ if (!btf_type_id_size(btf, &type_id, &type_size)) { -+ btf_verifier_log_vsi(env, v->t, vsi, "Invalid type"); -+ return -EINVAL; -+ } -+ -+ if (vsi->size < type_size) { -+ btf_verifier_log_vsi(env, v->t, vsi, "Invalid size"); -+ return -EINVAL; -+ } -+ } -+ -+ env_stack_pop_resolved(env, 0, 0); -+ return 0; -+} -+ -+static void btf_datasec_log(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ btf_verifier_log(env, "size=%u vlen=%u", t->size, btf_type_vlen(t)); -+} -+ -+static void btf_datasec_seq_show(const struct btf *btf, -+ const struct btf_type *t, u32 type_id, -+ void *data, u8 bits_offset, -+ struct seq_file *m) -+{ -+ const struct btf_var_secinfo *vsi; -+ const struct btf_type *var; -+ u32 i; -+ -+ seq_printf(m, "section (\"%s\") = {", __btf_name_by_offset(btf, t->name_off)); -+ for_each_vsi(i, t, vsi) { -+ var = btf_type_by_id(btf, vsi->type); -+ if (i) -+ seq_puts(m, ","); -+ btf_type_ops(var)->seq_show(btf, var, vsi->type, -+ data + vsi->offset, bits_offset, m); -+ } -+ seq_puts(m, "}"); -+} -+ -+static const struct btf_kind_operations datasec_ops = { -+ .check_meta = btf_datasec_check_meta, -+ .resolve = btf_datasec_resolve, -+ .check_member = btf_df_check_member, -+ .check_kflag_member = btf_df_check_kflag_member, -+ .log_details = btf_datasec_log, -+ .seq_show = btf_datasec_seq_show, -+}; -+ -+static int btf_func_proto_check(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ const struct btf_type *ret_type; -+ const struct btf_param *args; -+ const struct btf *btf; -+ u16 nr_args, i; -+ int err; -+ -+ btf = env->btf; -+ args = (const struct btf_param *)(t + 1); -+ nr_args = btf_type_vlen(t); -+ -+ /* Check func return type which could be "void" (t->type == 0) */ -+ if (t->type) { -+ u32 ret_type_id = t->type; -+ -+ ret_type = btf_type_by_id(btf, ret_type_id); -+ if (!ret_type) { -+ btf_verifier_log_type(env, t, "Invalid return type"); -+ return -EINVAL; -+ } -+ -+ if (btf_type_needs_resolve(ret_type) && -+ !env_type_is_resolved(env, ret_type_id)) { -+ err = btf_resolve(env, ret_type, ret_type_id); -+ if (err) -+ return err; -+ } -+ -+ /* Ensure the return type is a type that has a size */ -+ if (!btf_type_id_size(btf, &ret_type_id, NULL)) { -+ btf_verifier_log_type(env, t, "Invalid return type"); -+ return -EINVAL; -+ } -+ } -+ -+ if (!nr_args) -+ return 0; -+ -+ /* Last func arg type_id could be 0 if it is a vararg */ -+ if (!args[nr_args - 1].type) { -+ if (args[nr_args - 1].name_off) { -+ btf_verifier_log_type(env, t, "Invalid arg#%u", -+ nr_args); -+ return -EINVAL; -+ } -+ nr_args--; -+ } -+ -+ err = 0; -+ for (i = 0; i < nr_args; i++) { -+ const struct btf_type *arg_type; -+ u32 arg_type_id; -+ -+ arg_type_id = args[i].type; -+ arg_type = btf_type_by_id(btf, arg_type_id); -+ if (!arg_type) { -+ btf_verifier_log_type(env, t, "Invalid arg#%u", i + 1); -+ err = -EINVAL; -+ break; -+ } -+ -+ if (args[i].name_off && -+ (!btf_name_offset_valid(btf, args[i].name_off) || -+ !btf_name_valid_identifier(btf, args[i].name_off))) { -+ btf_verifier_log_type(env, t, -+ "Invalid arg#%u", i + 1); -+ err = -EINVAL; -+ break; -+ } -+ -+ if (btf_type_needs_resolve(arg_type) && -+ !env_type_is_resolved(env, arg_type_id)) { -+ err = btf_resolve(env, arg_type, arg_type_id); -+ if (err) -+ break; -+ } -+ -+ if (!btf_type_id_size(btf, &arg_type_id, NULL)) { -+ btf_verifier_log_type(env, t, "Invalid arg#%u", i + 1); -+ err = -EINVAL; -+ break; -+ } -+ } -+ -+ return err; -+} -+ -+static int btf_func_check(struct btf_verifier_env *env, -+ const struct btf_type *t) -+{ -+ const struct btf_type *proto_type; -+ const struct btf_param *args; -+ const struct btf *btf; -+ u16 nr_args, i; -+ -+ btf = env->btf; -+ proto_type = btf_type_by_id(btf, t->type); -+ -+ if (!proto_type || !btf_type_is_func_proto(proto_type)) { -+ btf_verifier_log_type(env, t, "Invalid type_id"); -+ return -EINVAL; -+ } -+ -+ args = (const struct btf_param *)(proto_type + 1); -+ nr_args = btf_type_vlen(proto_type); -+ for (i = 0; i < nr_args; i++) { -+ if (!args[i].name_off && args[i].type) { -+ btf_verifier_log_type(env, t, "Invalid arg#%u", i + 1); -+ return -EINVAL; -+ } -+ } -+ -+ return 0; -+} -+ -+static const struct btf_kind_operations * const kind_ops[NR_BTF_KINDS] = { -+ [BTF_KIND_INT] = &int_ops, -+ [BTF_KIND_PTR] = &ptr_ops, -+ [BTF_KIND_ARRAY] = &array_ops, -+ [BTF_KIND_STRUCT] = &struct_ops, -+ [BTF_KIND_UNION] = &struct_ops, -+ [BTF_KIND_ENUM] = &enum_ops, -+ [BTF_KIND_FWD] = &fwd_ops, -+ [BTF_KIND_TYPEDEF] = &modifier_ops, -+ [BTF_KIND_VOLATILE] = &modifier_ops, -+ [BTF_KIND_CONST] = &modifier_ops, -+ [BTF_KIND_RESTRICT] = &modifier_ops, -+ [BTF_KIND_FUNC] = &func_ops, -+ [BTF_KIND_FUNC_PROTO] = &func_proto_ops, -+ [BTF_KIND_VAR] = &var_ops, -+ [BTF_KIND_DATASEC] = &datasec_ops, -+}; -+ -+static s32 btf_check_meta(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 meta_left) -+{ -+ u32 saved_meta_left = meta_left; -+ s32 var_meta_size; -+ -+ if (meta_left < sizeof(*t)) { -+ btf_verifier_log(env, "[%u] meta_left:%u meta_needed:%zu", -+ env->log_type_id, meta_left, sizeof(*t)); -+ return -EINVAL; -+ } -+ meta_left -= sizeof(*t); -+ -+ if (t->info & ~BTF_INFO_MASK) { -+ btf_verifier_log(env, "[%u] Invalid btf_info:%x", -+ env->log_type_id, t->info); -+ return -EINVAL; -+ } -+ -+ if (BTF_INFO_KIND(t->info) > BTF_KIND_MAX || -+ BTF_INFO_KIND(t->info) == BTF_KIND_UNKN) { -+ btf_verifier_log(env, "[%u] Invalid kind:%u", -+ env->log_type_id, BTF_INFO_KIND(t->info)); -+ return -EINVAL; -+ } -+ -+ if (!btf_name_offset_valid(env->btf, t->name_off)) { -+ btf_verifier_log(env, "[%u] Invalid name_offset:%u", -+ env->log_type_id, t->name_off); -+ return -EINVAL; -+ } -+ -+ var_meta_size = btf_type_ops(t)->check_meta(env, t, meta_left); -+ if (var_meta_size < 0) -+ return var_meta_size; -+ -+ meta_left -= var_meta_size; -+ -+ return saved_meta_left - meta_left; -+} -+ -+static int btf_check_all_metas(struct btf_verifier_env *env) -+{ -+ struct btf *btf = env->btf; -+ struct btf_header *hdr; -+ void *cur, *end; -+ -+ hdr = &btf->hdr; -+ cur = btf->nohdr_data + hdr->type_off; -+ end = cur + hdr->type_len; -+ -+ env->log_type_id = 1; -+ while (cur < end) { -+ struct btf_type *t = cur; -+ s32 meta_size; -+ -+ meta_size = btf_check_meta(env, t, end - cur); -+ if (meta_size < 0) -+ return meta_size; -+ -+ btf_add_type(env, t); -+ cur += meta_size; -+ env->log_type_id++; -+ } -+ -+ return 0; -+} -+ -+static bool btf_resolve_valid(struct btf_verifier_env *env, -+ const struct btf_type *t, -+ u32 type_id) -+{ -+ struct btf *btf = env->btf; -+ -+ if (!env_type_is_resolved(env, type_id)) -+ return false; -+ -+ if (btf_type_is_struct(t) || btf_type_is_datasec(t)) -+ return !btf->resolved_ids[type_id] && -+ !btf->resolved_sizes[type_id]; -+ -+ if (btf_type_is_modifier(t) || btf_type_is_ptr(t) || -+ btf_type_is_var(t)) { -+ t = btf_type_id_resolve(btf, &type_id); -+ return t && -+ !btf_type_is_modifier(t) && -+ !btf_type_is_var(t) && -+ !btf_type_is_datasec(t); -+ } -+ -+ if (btf_type_is_array(t)) { -+ const struct btf_array *array = btf_type_array(t); -+ const struct btf_type *elem_type; -+ u32 elem_type_id = array->type; -+ u32 elem_size; -+ -+ elem_type = btf_type_id_size(btf, &elem_type_id, &elem_size); -+ return elem_type && !btf_type_is_modifier(elem_type) && -+ (array->nelems * elem_size == -+ btf->resolved_sizes[type_id]); -+ } -+ -+ return false; -+} -+ -+static int btf_resolve(struct btf_verifier_env *env, -+ const struct btf_type *t, u32 type_id) -+{ -+ u32 save_log_type_id = env->log_type_id; -+ const struct resolve_vertex *v; -+ int err = 0; -+ -+ env->resolve_mode = RESOLVE_TBD; -+ env_stack_push(env, t, type_id); -+ while (!err && (v = env_stack_peak(env))) { -+ env->log_type_id = v->type_id; -+ err = btf_type_ops(v->t)->resolve(env, v); -+ } -+ -+ env->log_type_id = type_id; -+ if (err == -E2BIG) { -+ btf_verifier_log_type(env, t, -+ "Exceeded max resolving depth:%u", -+ MAX_RESOLVE_DEPTH); -+ } else if (err == -EEXIST) { -+ btf_verifier_log_type(env, t, "Loop detected"); -+ } -+ -+ /* Final sanity check */ -+ if (!err && !btf_resolve_valid(env, t, type_id)) { -+ btf_verifier_log_type(env, t, "Invalid resolve state"); -+ err = -EINVAL; -+ } -+ -+ env->log_type_id = save_log_type_id; -+ return err; -+} -+ -+static int btf_check_all_types(struct btf_verifier_env *env) -+{ -+ struct btf *btf = env->btf; -+ u32 type_id; -+ int err; -+ -+ err = env_resolve_init(env); -+ if (err) -+ return err; -+ -+ env->phase++; -+ for (type_id = 1; type_id <= btf->nr_types; type_id++) { -+ const struct btf_type *t = btf_type_by_id(btf, type_id); -+ -+ env->log_type_id = type_id; -+ if (btf_type_needs_resolve(t) && -+ !env_type_is_resolved(env, type_id)) { -+ err = btf_resolve(env, t, type_id); -+ if (err) -+ return err; -+ } -+ -+ if (btf_type_is_func_proto(t)) { -+ err = btf_func_proto_check(env, t); -+ if (err) -+ return err; -+ } -+ -+ if (btf_type_is_func(t)) { -+ err = btf_func_check(env, t); -+ if (err) -+ return err; -+ } -+ } -+ -+ return 0; -+} -+ -+static int btf_parse_type_sec(struct btf_verifier_env *env) -+{ -+ const struct btf_header *hdr = &env->btf->hdr; -+ int err; -+ -+ /* Type section must align to 4 bytes */ -+ if (hdr->type_off & (sizeof(u32) - 1)) { -+ btf_verifier_log(env, "Unaligned type_off"); -+ return -EINVAL; -+ } -+ -+ if (!hdr->type_len) { -+ btf_verifier_log(env, "No type found"); -+ return -EINVAL; -+ } -+ -+ err = btf_check_all_metas(env); -+ if (err) -+ return err; -+ -+ return btf_check_all_types(env); -+} -+ -+static int btf_parse_str_sec(struct btf_verifier_env *env) -+{ -+ const struct btf_header *hdr; -+ struct btf *btf = env->btf; -+ const char *start, *end; -+ -+ hdr = &btf->hdr; -+ start = btf->nohdr_data + hdr->str_off; -+ end = start + hdr->str_len; -+ -+ if (end != btf->data + btf->data_size) { -+ btf_verifier_log(env, "String section is not at the end"); -+ return -EINVAL; -+ } -+ -+ if (!hdr->str_len || hdr->str_len - 1 > BTF_MAX_NAME_OFFSET || -+ start[0] || end[-1]) { -+ btf_verifier_log(env, "Invalid string section"); -+ return -EINVAL; -+ } -+ -+ btf->strings = start; -+ -+ return 0; -+} -+ -+static const size_t btf_sec_info_offset[] = { -+ offsetof(struct btf_header, type_off), -+ offsetof(struct btf_header, str_off), -+}; -+ -+static int btf_sec_info_cmp(const void *a, const void *b) -+{ -+ const struct btf_sec_info *x = a; -+ const struct btf_sec_info *y = b; -+ -+ return (int)(x->off - y->off) ? : (int)(x->len - y->len); -+} -+ -+static int btf_check_sec_info(struct btf_verifier_env *env, -+ u32 btf_data_size) -+{ -+ struct btf_sec_info secs[ARRAY_SIZE(btf_sec_info_offset)]; -+ u32 total, expected_total, i; -+ const struct btf_header *hdr; -+ const struct btf *btf; -+ -+ btf = env->btf; -+ hdr = &btf->hdr; -+ -+ /* Populate the secs from hdr */ -+ for (i = 0; i < ARRAY_SIZE(btf_sec_info_offset); i++) -+ secs[i] = *(struct btf_sec_info *)((void *)hdr + -+ btf_sec_info_offset[i]); -+ -+ sort(secs, ARRAY_SIZE(btf_sec_info_offset), -+ sizeof(struct btf_sec_info), btf_sec_info_cmp, NULL); -+ -+ /* Check for gaps and overlap among sections */ -+ total = 0; -+ expected_total = btf_data_size - hdr->hdr_len; -+ for (i = 0; i < ARRAY_SIZE(btf_sec_info_offset); i++) { -+ if (expected_total < secs[i].off) { -+ btf_verifier_log(env, "Invalid section offset"); -+ return -EINVAL; -+ } -+ if (total < secs[i].off) { -+ /* gap */ -+ btf_verifier_log(env, "Unsupported section found"); -+ return -EINVAL; -+ } -+ if (total > secs[i].off) { -+ btf_verifier_log(env, "Section overlap found"); -+ return -EINVAL; -+ } -+ if (expected_total - total < secs[i].len) { -+ btf_verifier_log(env, -+ "Total section length too long"); -+ return -EINVAL; -+ } -+ total += secs[i].len; -+ } -+ -+ /* There is data other than hdr and known sections */ -+ if (expected_total != total) { -+ btf_verifier_log(env, "Unsupported section found"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int btf_parse_hdr(struct btf_verifier_env *env) -+{ -+ u32 hdr_len, hdr_copy, btf_data_size; -+ const struct btf_header *hdr; -+ struct btf *btf; -+ int err; -+ -+ btf = env->btf; -+ btf_data_size = btf->data_size; -+ -+ if (btf_data_size < -+ offsetof(struct btf_header, hdr_len) + sizeof(hdr->hdr_len)) { -+ btf_verifier_log(env, "hdr_len not found"); -+ return -EINVAL; -+ } -+ -+ hdr = btf->data; -+ hdr_len = hdr->hdr_len; -+ if (btf_data_size < hdr_len) { -+ btf_verifier_log(env, "btf_header not found"); -+ return -EINVAL; -+ } -+ -+ /* Ensure the unsupported header fields are zero */ -+ if (hdr_len > sizeof(btf->hdr)) { -+ u8 *expected_zero = btf->data + sizeof(btf->hdr); -+ u8 *end = btf->data + hdr_len; -+ -+ for (; expected_zero < end; expected_zero++) { -+ if (*expected_zero) { -+ btf_verifier_log(env, "Unsupported btf_header"); -+ return -E2BIG; -+ } -+ } -+ } -+ -+ hdr_copy = min_t(u32, hdr_len, sizeof(btf->hdr)); -+ memcpy(&btf->hdr, btf->data, hdr_copy); -+ -+ hdr = &btf->hdr; -+ -+ btf_verifier_log_hdr(env, btf_data_size); -+ -+ if (hdr->magic != BTF_MAGIC) { -+ btf_verifier_log(env, "Invalid magic"); -+ return -EINVAL; -+ } -+ -+ if (hdr->version != BTF_VERSION) { -+ btf_verifier_log(env, "Unsupported version"); -+ return -ENOTSUPP; -+ } -+ -+ if (hdr->flags) { -+ btf_verifier_log(env, "Unsupported flags"); -+ return -ENOTSUPP; -+ } -+ -+ if (btf_data_size == hdr->hdr_len) { -+ btf_verifier_log(env, "No data"); -+ return -EINVAL; -+ } -+ -+ err = btf_check_sec_info(env, btf_data_size); -+ if (err) -+ return err; -+ -+ return 0; -+} -+ -+static struct btf *btf_parse(void __user *btf_data, u32 btf_data_size, -+ u32 log_level, char __user *log_ubuf, u32 log_size) -+{ -+ struct btf_verifier_env *env = NULL; -+ struct bpf_verifier_log *log; -+ struct btf *btf = NULL; -+ u8 *data; -+ int err; -+ -+ if (btf_data_size > BTF_MAX_SIZE) -+ return ERR_PTR(-E2BIG); -+ -+ env = kzalloc(sizeof(*env), GFP_KERNEL | __GFP_NOWARN); -+ if (!env) -+ return ERR_PTR(-ENOMEM); -+ -+ log = &env->log; -+ if (log_level || log_ubuf || log_size) { -+ /* user requested verbose verifier output -+ * and supplied buffer to store the verification trace -+ */ -+ log->level = log_level; -+ log->ubuf = log_ubuf; -+ log->len_total = log_size; -+ -+ /* log attributes have to be sane */ -+ if (log->len_total < 128 || log->len_total > UINT_MAX >> 8 || -+ !log->level || !log->ubuf) { -+ err = -EINVAL; -+ goto errout; -+ } -+ } -+ -+ btf = kzalloc(sizeof(*btf), GFP_KERNEL | __GFP_NOWARN); -+ if (!btf) { -+ err = -ENOMEM; -+ goto errout; -+ } -+ env->btf = btf; -+ -+ data = kmalloc(btf_data_size, GFP_KERNEL | __GFP_NOWARN); -+ if (!data) { -+ err = -ENOMEM; -+ goto errout; -+ } -+ -+ btf->data = data; -+ btf->data_size = btf_data_size; -+ -+ if (copy_from_user(data, btf_data, btf_data_size)) { -+ err = -EFAULT; -+ goto errout; -+ } -+ -+ err = btf_parse_hdr(env); -+ if (err) -+ goto errout; -+ -+ btf->nohdr_data = btf->data + btf->hdr.hdr_len; -+ -+ err = btf_parse_str_sec(env); -+ if (err) -+ goto errout; -+ -+ err = btf_parse_type_sec(env); -+ if (err) -+ goto errout; -+ -+ if (log->level && bpf_verifier_log_full(log)) { -+ err = -ENOSPC; -+ goto errout; -+ } -+ -+ btf_verifier_env_free(env); -+ refcount_set(&btf->refcnt, 1); -+ return btf; -+ -+errout: -+ btf_verifier_env_free(env); -+ if (btf) -+ btf_free(btf); -+ return ERR_PTR(err); -+} -+ -+void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj, -+ struct seq_file *m) -+{ -+ const struct btf_type *t = btf_type_by_id(btf, type_id); -+ -+ btf_type_ops(t)->seq_show(btf, t, type_id, obj, 0, m); -+} -+ -+#ifdef CONFIG_PROC_FS -+static void bpf_btf_show_fdinfo(struct seq_file *m, struct file *filp) -+{ -+ const struct btf *btf = filp->private_data; -+ -+ seq_printf(m, "btf_id:\t%u\n", btf->id); -+} -+#endif -+ -+static int btf_release(struct inode *inode, struct file *filp) -+{ -+ btf_put(filp->private_data); -+ return 0; -+} -+ -+const struct file_operations btf_fops = { -+#ifdef CONFIG_PROC_FS -+ .show_fdinfo = bpf_btf_show_fdinfo, -+#endif -+ .release = btf_release, -+}; -+ -+static int __btf_new_fd(struct btf *btf) -+{ -+ return anon_inode_getfd("btf", &btf_fops, btf, O_RDONLY | O_CLOEXEC); -+} -+ -+int btf_new_fd(const union bpf_attr *attr) -+{ -+ struct btf *btf; -+ int ret; -+ -+ btf = btf_parse(u64_to_user_ptr(attr->btf), -+ attr->btf_size, attr->btf_log_level, -+ u64_to_user_ptr(attr->btf_log_buf), -+ attr->btf_log_size); -+ if (IS_ERR(btf)) -+ return PTR_ERR(btf); -+ -+ ret = btf_alloc_id(btf); -+ if (ret) { -+ btf_free(btf); -+ return ret; -+ } -+ -+ /* -+ * The BTF ID is published to the userspace. -+ * All BTF free must go through call_rcu() from -+ * now on (i.e. free by calling btf_put()). -+ */ -+ -+ ret = __btf_new_fd(btf); -+ if (ret < 0) -+ btf_put(btf); -+ -+ return ret; -+} -+ -+struct btf *btf_get_by_fd(int fd) -+{ -+ struct btf *btf; -+ struct fd f; -+ -+ f = fdget(fd); -+ -+ if (!f.file) -+ return ERR_PTR(-EBADF); -+ -+ if (f.file->f_op != &btf_fops) { -+ fdput(f); -+ return ERR_PTR(-EINVAL); -+ } -+ -+ btf = f.file->private_data; -+ refcount_inc(&btf->refcnt); -+ fdput(f); -+ -+ return btf; -+} -+ -+int btf_get_info_by_fd(const struct btf *btf, -+ const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ struct bpf_btf_info __user *uinfo; -+ struct bpf_btf_info info; -+ u32 info_copy, btf_copy; -+ void __user *ubtf; -+ u32 uinfo_len; -+ -+ uinfo = u64_to_user_ptr(attr->info.info); -+ uinfo_len = attr->info.info_len; -+ -+ info_copy = min_t(u32, uinfo_len, sizeof(info)); -+ memset(&info, 0, sizeof(info)); -+ if (copy_from_user(&info, uinfo, info_copy)) -+ return -EFAULT; -+ -+ info.id = btf->id; -+ ubtf = u64_to_user_ptr(info.btf); -+ btf_copy = min_t(u32, btf->data_size, info.btf_size); -+ if (copy_to_user(ubtf, btf->data, btf_copy)) -+ return -EFAULT; -+ info.btf_size = btf->data_size; -+ -+ if (copy_to_user(uinfo, &info, info_copy) || -+ put_user(info_copy, &uattr->info.info_len)) -+ return -EFAULT; -+ -+ return 0; -+} -+ -+int btf_get_fd_by_id(u32 id) -+{ -+ struct btf *btf; -+ int fd; -+ -+ rcu_read_lock(); -+ btf = idr_find(&btf_idr, id); -+ if (!btf || !refcount_inc_not_zero(&btf->refcnt)) -+ btf = ERR_PTR(-ENOENT); -+ rcu_read_unlock(); -+ -+ if (IS_ERR(btf)) -+ return PTR_ERR(btf); -+ -+ fd = __btf_new_fd(btf); -+ if (fd < 0) -+ btf_put(btf); -+ -+ return fd; -+} -+ -+u32 btf_id(const struct btf *btf) -+{ -+ return btf->id; -+} ---- /dev/null -+++ b/kernel/bpf/cgroup.c -@@ -0,0 +1,1581 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * Functions to manage eBPF programs attached to cgroups -+ * -+ * Copyright (c) 2016 Daniel Mack -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "../cgroup/cgroup-internal.h" -+ -+DEFINE_STATIC_KEY_FALSE(cgroup_bpf_enabled_key); -+EXPORT_SYMBOL(cgroup_bpf_enabled_key); -+ -+void cgroup_bpf_offline(struct cgroup *cgrp) -+{ -+ cgroup_get(cgrp); -+ percpu_ref_kill(&cgrp->bpf.refcnt); -+} -+ -+/** -+ * cgroup_bpf_release() - put references of all bpf programs and -+ * release all cgroup bpf data -+ * @work: work structure embedded into the cgroup to modify -+ */ -+static void cgroup_bpf_release(struct work_struct *work) -+{ -+ struct cgroup *p, *cgrp = container_of(work, struct cgroup, -+ bpf.release_work); -+ enum bpf_cgroup_storage_type stype; -+ struct bpf_prog_array *old_array; -+ unsigned int type; -+ -+ mutex_lock(&cgroup_mutex); -+ -+ for (type = 0; type < ARRAY_SIZE(cgrp->bpf.progs); type++) { -+ struct list_head *progs = &cgrp->bpf.progs[type]; -+ struct bpf_prog_list *pl, *tmp; -+ -+ list_for_each_entry_safe(pl, tmp, progs, node) { -+ list_del(&pl->node); -+ bpf_prog_put(pl->prog); -+ for_each_cgroup_storage_type(stype) { -+ bpf_cgroup_storage_unlink(pl->storage[stype]); -+ bpf_cgroup_storage_free(pl->storage[stype]); -+ } -+ kfree(pl); -+ static_branch_dec(&cgroup_bpf_enabled_key); -+ } -+ old_array = rcu_dereference_protected( -+ cgrp->bpf.effective[type], -+ lockdep_is_held(&cgroup_mutex)); -+ bpf_prog_array_free(old_array); -+ } -+ -+ mutex_unlock(&cgroup_mutex); -+ -+ for (p = cgroup_parent(cgrp); p; p = cgroup_parent(p)) -+ cgroup_bpf_put(p); -+ -+ percpu_ref_exit(&cgrp->bpf.refcnt); -+ cgroup_put(cgrp); -+} -+ -+/** -+ * cgroup_bpf_release_fn() - callback used to schedule releasing -+ * of bpf cgroup data -+ * @ref: percpu ref counter structure -+ */ -+static void cgroup_bpf_release_fn(struct percpu_ref *ref) -+{ -+ struct cgroup *cgrp = container_of(ref, struct cgroup, bpf.refcnt); -+ -+ INIT_WORK(&cgrp->bpf.release_work, cgroup_bpf_release); -+ queue_work(system_wq, &cgrp->bpf.release_work); -+} -+ -+/* count number of elements in the list. -+ * it's slow but the list cannot be long -+ */ -+static u32 prog_list_length(struct list_head *head) -+{ -+ struct bpf_prog_list *pl; -+ u32 cnt = 0; -+ -+ list_for_each_entry(pl, head, node) { -+ if (!pl->prog) -+ continue; -+ cnt++; -+ } -+ return cnt; -+} -+ -+/* if parent has non-overridable prog attached, -+ * disallow attaching new programs to the descendent cgroup. -+ * if parent has overridable or multi-prog, allow attaching -+ */ -+static bool hierarchy_allows_attach(struct cgroup *cgrp, -+ enum bpf_attach_type type, -+ u32 new_flags) -+{ -+ struct cgroup *p; -+ -+ p = cgroup_parent(cgrp); -+ if (!p) -+ return true; -+ do { -+ u32 flags = p->bpf.flags[type]; -+ u32 cnt; -+ -+ if (flags & BPF_F_ALLOW_MULTI) -+ return true; -+ cnt = prog_list_length(&p->bpf.progs[type]); -+ WARN_ON_ONCE(cnt > 1); -+ if (cnt == 1) -+ return !!(flags & BPF_F_ALLOW_OVERRIDE); -+ p = cgroup_parent(p); -+ } while (p); -+ return true; -+} -+ -+/* compute a chain of effective programs for a given cgroup: -+ * start from the list of programs in this cgroup and add -+ * all parent programs. -+ * Note that parent's F_ALLOW_OVERRIDE-type program is yielding -+ * to programs in this cgroup -+ */ -+static int compute_effective_progs(struct cgroup *cgrp, -+ enum bpf_attach_type type, -+ struct bpf_prog_array **array) -+{ -+ enum bpf_cgroup_storage_type stype; -+ struct bpf_prog_array *progs; -+ struct bpf_prog_list *pl; -+ struct cgroup *p = cgrp; -+ int cnt = 0; -+ -+ /* count number of effective programs by walking parents */ -+ do { -+ if (cnt == 0 || (p->bpf.flags[type] & BPF_F_ALLOW_MULTI)) -+ cnt += prog_list_length(&p->bpf.progs[type]); -+ p = cgroup_parent(p); -+ } while (p); -+ -+ progs = bpf_prog_array_alloc(cnt, GFP_KERNEL); -+ if (!progs) -+ return -ENOMEM; -+ -+ /* populate the array with effective progs */ -+ cnt = 0; -+ p = cgrp; -+ do { -+ if (cnt > 0 && !(p->bpf.flags[type] & BPF_F_ALLOW_MULTI)) -+ continue; -+ -+ list_for_each_entry(pl, &p->bpf.progs[type], node) { -+ if (!pl->prog) -+ continue; -+ -+ progs->items[cnt].prog = pl->prog; -+ for_each_cgroup_storage_type(stype) -+ progs->items[cnt].cgroup_storage[stype] = -+ pl->storage[stype]; -+ cnt++; -+ } -+ } while ((p = cgroup_parent(p))); -+ -+ *array = progs; -+ return 0; -+} -+ -+static void activate_effective_progs(struct cgroup *cgrp, -+ enum bpf_attach_type type, -+ struct bpf_prog_array *old_array) -+{ -+ rcu_swap_protected(cgrp->bpf.effective[type], old_array, -+ lockdep_is_held(&cgroup_mutex)); -+ /* free prog array after grace period, since __cgroup_bpf_run_*() -+ * might be still walking the array -+ */ -+ bpf_prog_array_free(old_array); -+} -+ -+/** -+ * cgroup_bpf_inherit() - inherit effective programs from parent -+ * @cgrp: the cgroup to modify -+ */ -+int cgroup_bpf_inherit(struct cgroup *cgrp) -+{ -+/* has to use marco instead of const int, since compiler thinks -+ * that array below is variable length -+ */ -+#define NR ARRAY_SIZE(cgrp->bpf.effective) -+ struct bpf_prog_array *arrays[NR] = {}; -+ struct cgroup *p; -+ int ret, i; -+ -+ ret = percpu_ref_init(&cgrp->bpf.refcnt, cgroup_bpf_release_fn, 0, -+ GFP_KERNEL); -+ if (ret) -+ return ret; -+ -+ for (p = cgroup_parent(cgrp); p; p = cgroup_parent(p)) -+ cgroup_bpf_get(p); -+ -+ for (i = 0; i < NR; i++) -+ INIT_LIST_HEAD(&cgrp->bpf.progs[i]); -+ -+ for (i = 0; i < NR; i++) -+ if (compute_effective_progs(cgrp, i, &arrays[i])) -+ goto cleanup; -+ -+ for (i = 0; i < NR; i++) -+ activate_effective_progs(cgrp, i, arrays[i]); -+ -+ return 0; -+cleanup: -+ for (i = 0; i < NR; i++) -+ bpf_prog_array_free(arrays[i]); -+ -+ for (p = cgroup_parent(cgrp); p; p = cgroup_parent(p)) -+ cgroup_bpf_put(p); -+ -+ percpu_ref_exit(&cgrp->bpf.refcnt); -+ -+ return -ENOMEM; -+} -+ -+static int update_effective_progs(struct cgroup *cgrp, -+ enum bpf_attach_type type) -+{ -+ struct cgroup_subsys_state *css; -+ int err; -+ -+ /* allocate and recompute effective prog arrays */ -+ css_for_each_descendant_pre(css, &cgrp->self) { -+ struct cgroup *desc = container_of(css, struct cgroup, self); -+ -+ if (percpu_ref_is_zero(&desc->bpf.refcnt)) -+ continue; -+ -+ err = compute_effective_progs(desc, type, &desc->bpf.inactive); -+ if (err) -+ goto cleanup; -+ } -+ -+ /* all allocations were successful. Activate all prog arrays */ -+ css_for_each_descendant_pre(css, &cgrp->self) { -+ struct cgroup *desc = container_of(css, struct cgroup, self); -+ -+ if (percpu_ref_is_zero(&desc->bpf.refcnt)) { -+ if (unlikely(desc->bpf.inactive)) { -+ bpf_prog_array_free(desc->bpf.inactive); -+ desc->bpf.inactive = NULL; -+ } -+ continue; -+ } -+ -+ activate_effective_progs(desc, type, desc->bpf.inactive); -+ desc->bpf.inactive = NULL; -+ } -+ -+ return 0; -+ -+cleanup: -+ /* oom while computing effective. Free all computed effective arrays -+ * since they were not activated -+ */ -+ css_for_each_descendant_pre(css, &cgrp->self) { -+ struct cgroup *desc = container_of(css, struct cgroup, self); -+ -+ bpf_prog_array_free(desc->bpf.inactive); -+ desc->bpf.inactive = NULL; -+ } -+ -+ return err; -+} -+ -+#define BPF_CGROUP_MAX_PROGS 64 -+ -+/** -+ * __cgroup_bpf_attach() - Attach the program to a cgroup, and -+ * propagate the change to descendants -+ * @cgrp: The cgroup which descendants to traverse -+ * @prog: A program to attach -+ * @type: Type of attach operation -+ * @flags: Option flags -+ * -+ * Must be called with cgroup_mutex held. -+ */ -+int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog, -+ enum bpf_attach_type type, u32 flags) -+{ -+ struct list_head *progs = &cgrp->bpf.progs[type]; -+ struct bpf_prog *old_prog = NULL; -+ struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = {}; -+ struct bpf_cgroup_storage *old_storage[MAX_BPF_CGROUP_STORAGE_TYPE] = {}; -+ enum bpf_cgroup_storage_type stype; -+ struct bpf_prog_list *pl; -+ bool pl_was_allocated; -+ int err; -+ -+ if ((flags & BPF_F_ALLOW_OVERRIDE) && (flags & BPF_F_ALLOW_MULTI)) -+ /* invalid combination */ -+ return -EINVAL; -+ -+ if (!hierarchy_allows_attach(cgrp, type, flags)) -+ return -EPERM; -+ -+ if (!list_empty(progs) && cgrp->bpf.flags[type] != flags) -+ /* Disallow attaching non-overridable on top -+ * of existing overridable in this cgroup. -+ * Disallow attaching multi-prog if overridable or none -+ */ -+ return -EPERM; -+ -+ if (prog_list_length(progs) >= BPF_CGROUP_MAX_PROGS) -+ return -E2BIG; -+ -+ for_each_cgroup_storage_type(stype) { -+ storage[stype] = bpf_cgroup_storage_alloc(prog, stype); -+ if (IS_ERR(storage[stype])) { -+ storage[stype] = NULL; -+ for_each_cgroup_storage_type(stype) -+ bpf_cgroup_storage_free(storage[stype]); -+ return -ENOMEM; -+ } -+ } -+ -+ if (flags & BPF_F_ALLOW_MULTI) { -+ list_for_each_entry(pl, progs, node) { -+ if (pl->prog == prog) { -+ /* disallow attaching the same prog twice */ -+ for_each_cgroup_storage_type(stype) -+ bpf_cgroup_storage_free(storage[stype]); -+ return -EINVAL; -+ } -+ } -+ -+ pl = kmalloc(sizeof(*pl), GFP_KERNEL); -+ if (!pl) { -+ for_each_cgroup_storage_type(stype) -+ bpf_cgroup_storage_free(storage[stype]); -+ return -ENOMEM; -+ } -+ -+ pl_was_allocated = true; -+ pl->prog = prog; -+ for_each_cgroup_storage_type(stype) -+ pl->storage[stype] = storage[stype]; -+ list_add_tail(&pl->node, progs); -+ } else { -+ if (list_empty(progs)) { -+ pl = kmalloc(sizeof(*pl), GFP_KERNEL); -+ if (!pl) { -+ for_each_cgroup_storage_type(stype) -+ bpf_cgroup_storage_free(storage[stype]); -+ return -ENOMEM; -+ } -+ pl_was_allocated = true; -+ list_add_tail(&pl->node, progs); -+ } else { -+ pl = list_first_entry(progs, typeof(*pl), node); -+ old_prog = pl->prog; -+ for_each_cgroup_storage_type(stype) { -+ old_storage[stype] = pl->storage[stype]; -+ bpf_cgroup_storage_unlink(old_storage[stype]); -+ } -+ pl_was_allocated = false; -+ } -+ pl->prog = prog; -+ for_each_cgroup_storage_type(stype) -+ pl->storage[stype] = storage[stype]; -+ } -+ -+ cgrp->bpf.flags[type] = flags; -+ -+ err = update_effective_progs(cgrp, type); -+ if (err) -+ goto cleanup; -+ -+ static_branch_inc(&cgroup_bpf_enabled_key); -+ for_each_cgroup_storage_type(stype) { -+ if (!old_storage[stype]) -+ continue; -+ bpf_cgroup_storage_free(old_storage[stype]); -+ } -+ if (old_prog) { -+ bpf_prog_put(old_prog); -+ static_branch_dec(&cgroup_bpf_enabled_key); -+ } -+ for_each_cgroup_storage_type(stype) -+ bpf_cgroup_storage_link(storage[stype], cgrp, type); -+ return 0; -+ -+cleanup: -+ /* and cleanup the prog list */ -+ pl->prog = old_prog; -+ for_each_cgroup_storage_type(stype) { -+ bpf_cgroup_storage_free(pl->storage[stype]); -+ pl->storage[stype] = old_storage[stype]; -+ bpf_cgroup_storage_link(old_storage[stype], cgrp, type); -+ } -+ if (pl_was_allocated) { -+ list_del(&pl->node); -+ kfree(pl); -+ } -+ return err; -+} -+ -+/** -+ * __cgroup_bpf_detach() - Detach the program from a cgroup, and -+ * propagate the change to descendants -+ * @cgrp: The cgroup which descendants to traverse -+ * @prog: A program to detach or NULL -+ * @type: Type of detach operation -+ * -+ * Must be called with cgroup_mutex held. -+ */ -+int __cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog, -+ enum bpf_attach_type type) -+{ -+ struct list_head *progs = &cgrp->bpf.progs[type]; -+ enum bpf_cgroup_storage_type stype; -+ u32 flags = cgrp->bpf.flags[type]; -+ struct bpf_prog *old_prog = NULL; -+ struct bpf_prog_list *pl; -+ int err; -+ -+ if (flags & BPF_F_ALLOW_MULTI) { -+ if (!prog) -+ /* to detach MULTI prog the user has to specify valid FD -+ * of the program to be detached -+ */ -+ return -EINVAL; -+ } else { -+ if (list_empty(progs)) -+ /* report error when trying to detach and nothing is attached */ -+ return -ENOENT; -+ } -+ -+ if (flags & BPF_F_ALLOW_MULTI) { -+ /* find the prog and detach it */ -+ list_for_each_entry(pl, progs, node) { -+ if (pl->prog != prog) -+ continue; -+ old_prog = prog; -+ /* mark it deleted, so it's ignored while -+ * recomputing effective -+ */ -+ pl->prog = NULL; -+ break; -+ } -+ if (!old_prog) -+ return -ENOENT; -+ } else { -+ /* to maintain backward compatibility NONE and OVERRIDE cgroups -+ * allow detaching with invalid FD (prog==NULL) -+ */ -+ pl = list_first_entry(progs, typeof(*pl), node); -+ old_prog = pl->prog; -+ pl->prog = NULL; -+ } -+ -+ err = update_effective_progs(cgrp, type); -+ if (err) -+ goto cleanup; -+ -+ /* now can actually delete it from this cgroup list */ -+ list_del(&pl->node); -+ for_each_cgroup_storage_type(stype) { -+ bpf_cgroup_storage_unlink(pl->storage[stype]); -+ bpf_cgroup_storage_free(pl->storage[stype]); -+ } -+ kfree(pl); -+ if (list_empty(progs)) -+ /* last program was detached, reset flags to zero */ -+ cgrp->bpf.flags[type] = 0; -+ -+ bpf_prog_put(old_prog); -+ static_branch_dec(&cgroup_bpf_enabled_key); -+ return 0; -+ -+cleanup: -+ /* and restore back old_prog */ -+ pl->prog = old_prog; -+ return err; -+} -+ -+/* Must be called with cgroup_mutex held to avoid races. */ -+int __cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ __u32 __user *prog_ids = u64_to_user_ptr(attr->query.prog_ids); -+ enum bpf_attach_type type = attr->query.attach_type; -+ struct list_head *progs = &cgrp->bpf.progs[type]; -+ u32 flags = cgrp->bpf.flags[type]; -+ struct bpf_prog_array *effective; -+ int cnt, ret = 0, i; -+ -+ effective = rcu_dereference_protected(cgrp->bpf.effective[type], -+ lockdep_is_held(&cgroup_mutex)); -+ -+ if (attr->query.query_flags & BPF_F_QUERY_EFFECTIVE) -+ cnt = bpf_prog_array_length(effective); -+ else -+ cnt = prog_list_length(progs); -+ -+ if (copy_to_user(&uattr->query.attach_flags, &flags, sizeof(flags))) -+ return -EFAULT; -+ if (copy_to_user(&uattr->query.prog_cnt, &cnt, sizeof(cnt))) -+ return -EFAULT; -+ if (attr->query.prog_cnt == 0 || !prog_ids || !cnt) -+ /* return early if user requested only program count + flags */ -+ return 0; -+ if (attr->query.prog_cnt < cnt) { -+ cnt = attr->query.prog_cnt; -+ ret = -ENOSPC; -+ } -+ -+ if (attr->query.query_flags & BPF_F_QUERY_EFFECTIVE) { -+ return bpf_prog_array_copy_to_user(effective, prog_ids, cnt); -+ } else { -+ struct bpf_prog_list *pl; -+ u32 id; -+ -+ i = 0; -+ list_for_each_entry(pl, progs, node) { -+ id = pl->prog->aux->id; -+ if (copy_to_user(prog_ids + i, &id, sizeof(id))) -+ return -EFAULT; -+ if (++i == cnt) -+ break; -+ } -+ } -+ return ret; -+} -+ -+int cgroup_bpf_prog_attach(const union bpf_attr *attr, -+ enum bpf_prog_type ptype, struct bpf_prog *prog) -+{ -+ struct cgroup *cgrp; -+ int ret; -+ -+ cgrp = cgroup_get_from_fd(attr->target_fd); -+ if (IS_ERR(cgrp)) -+ return PTR_ERR(cgrp); -+ -+ ret = cgroup_bpf_attach(cgrp, prog, attr->attach_type, -+ attr->attach_flags); -+ cgroup_put(cgrp); -+ return ret; -+} -+ -+int cgroup_bpf_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype) -+{ -+ struct bpf_prog *prog; -+ struct cgroup *cgrp; -+ int ret; -+ -+ cgrp = cgroup_get_from_fd(attr->target_fd); -+ if (IS_ERR(cgrp)) -+ return PTR_ERR(cgrp); -+ -+ prog = bpf_prog_get_type(attr->attach_bpf_fd, ptype); -+ if (IS_ERR(prog)) -+ prog = NULL; -+ -+ ret = cgroup_bpf_detach(cgrp, prog, attr->attach_type, 0); -+ if (prog) -+ bpf_prog_put(prog); -+ -+ cgroup_put(cgrp); -+ return ret; -+} -+ -+int cgroup_bpf_prog_query(const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ struct cgroup *cgrp; -+ int ret; -+ -+ cgrp = cgroup_get_from_fd(attr->query.target_fd); -+ if (IS_ERR(cgrp)) -+ return PTR_ERR(cgrp); -+ -+ ret = cgroup_bpf_query(cgrp, attr, uattr); -+ -+ cgroup_put(cgrp); -+ return ret; -+} -+ -+/** -+ * __cgroup_bpf_run_filter_skb() - Run a program for packet filtering -+ * @sk: The socket sending or receiving traffic -+ * @skb: The skb that is being sent or received -+ * @type: The type of program to be exectuted -+ * -+ * If no socket is passed, or the socket is not of type INET or INET6, -+ * this function does nothing and returns 0. -+ * -+ * The program type passed in via @type must be suitable for network -+ * filtering. No further check is performed to assert that. -+ * -+ * For egress packets, this function can return: -+ * NET_XMIT_SUCCESS (0) - continue with packet output -+ * NET_XMIT_DROP (1) - drop packet and notify TCP to call cwr -+ * NET_XMIT_CN (2) - continue with packet output and notify TCP -+ * to call cwr -+ * -EPERM - drop packet -+ * -+ * For ingress packets, this function will return -EPERM if any -+ * attached program was found and if it returned != 1 during execution. -+ * Otherwise 0 is returned. -+ */ -+int __cgroup_bpf_run_filter_skb(struct sock *sk, -+ struct sk_buff *skb, -+ enum bpf_attach_type type) -+{ -+ unsigned int offset = skb->data - skb_network_header(skb); -+ struct sock *save_sk; -+ void *saved_data_end; -+ struct cgroup *cgrp; -+ int ret; -+ -+ if (!sk || !sk_fullsock(sk)) -+ return 0; -+ -+ if (sk->sk_family != AF_INET && sk->sk_family != AF_INET6) -+ return 0; -+ -+ cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data); -+ save_sk = skb->sk; -+ skb->sk = sk; -+ __skb_push(skb, offset); -+ -+ /* compute pointers for the bpf prog */ -+ bpf_compute_and_save_data_end(skb, &saved_data_end); -+ -+ if (type == BPF_CGROUP_INET_EGRESS) { -+ ret = BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY( -+ cgrp->bpf.effective[type], skb, __bpf_prog_run_save_cb); -+ } else { -+ ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], skb, -+ __bpf_prog_run_save_cb); -+ ret = (ret == 1 ? 0 : -EPERM); -+ } -+ bpf_restore_data_end(skb, saved_data_end); -+ __skb_pull(skb, offset); -+ skb->sk = save_sk; -+ -+ return ret; -+} -+EXPORT_SYMBOL(__cgroup_bpf_run_filter_skb); -+ -+/** -+ * __cgroup_bpf_run_filter_sk() - Run a program on a sock -+ * @sk: sock structure to manipulate -+ * @type: The type of program to be exectuted -+ * -+ * socket is passed is expected to be of type INET or INET6. -+ * -+ * The program type passed in via @type must be suitable for sock -+ * filtering. No further check is performed to assert that. -+ * -+ * This function will return %-EPERM if any if an attached program was found -+ * and if it returned != 1 during execution. In all other cases, 0 is returned. -+ */ -+int __cgroup_bpf_run_filter_sk(struct sock *sk, -+ enum bpf_attach_type type) -+{ -+ struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data); -+ int ret; -+ -+ ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], sk, BPF_PROG_RUN); -+ return ret == 1 ? 0 : -EPERM; -+} -+EXPORT_SYMBOL(__cgroup_bpf_run_filter_sk); -+ -+/** -+ * __cgroup_bpf_run_filter_sock_addr() - Run a program on a sock and -+ * provided by user sockaddr -+ * @sk: sock struct that will use sockaddr -+ * @uaddr: sockaddr struct provided by user -+ * @type: The type of program to be exectuted -+ * @t_ctx: Pointer to attach type specific context -+ * -+ * socket is expected to be of type INET or INET6. -+ * -+ * This function will return %-EPERM if an attached program is found and -+ * returned value != 1 during execution. In all other cases, 0 is returned. -+ */ -+int __cgroup_bpf_run_filter_sock_addr(struct sock *sk, -+ struct sockaddr *uaddr, -+ enum bpf_attach_type type, -+ void *t_ctx) -+{ -+ struct bpf_sock_addr_kern ctx = { -+ .sk = sk, -+ .uaddr = uaddr, -+ .t_ctx = t_ctx, -+ }; -+ struct sockaddr_storage unspec; -+ struct cgroup *cgrp; -+ int ret; -+ -+ /* Check socket family since not all sockets represent network -+ * endpoint (e.g. AF_UNIX). -+ */ -+ if (sk->sk_family != AF_INET && sk->sk_family != AF_INET6) -+ return 0; -+ -+ if (!ctx.uaddr) { -+ memset(&unspec, 0, sizeof(unspec)); -+ ctx.uaddr = (struct sockaddr *)&unspec; -+ } -+ -+ cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data); -+ ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], &ctx, BPF_PROG_RUN); -+ -+ return ret == 1 ? 0 : -EPERM; -+} -+EXPORT_SYMBOL(__cgroup_bpf_run_filter_sock_addr); -+ -+/** -+ * __cgroup_bpf_run_filter_sock_ops() - Run a program on a sock -+ * @sk: socket to get cgroup from -+ * @sock_ops: bpf_sock_ops_kern struct to pass to program. Contains -+ * sk with connection information (IP addresses, etc.) May not contain -+ * cgroup info if it is a req sock. -+ * @type: The type of program to be exectuted -+ * -+ * socket passed is expected to be of type INET or INET6. -+ * -+ * The program type passed in via @type must be suitable for sock_ops -+ * filtering. No further check is performed to assert that. -+ * -+ * This function will return %-EPERM if any if an attached program was found -+ * and if it returned != 1 during execution. In all other cases, 0 is returned. -+ */ -+int __cgroup_bpf_run_filter_sock_ops(struct sock *sk, -+ struct bpf_sock_ops_kern *sock_ops, -+ enum bpf_attach_type type) -+{ -+ struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data); -+ int ret; -+ -+ ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], sock_ops, -+ BPF_PROG_RUN); -+ return ret == 1 ? 0 : -EPERM; -+} -+EXPORT_SYMBOL(__cgroup_bpf_run_filter_sock_ops); -+ -+int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor, -+ short access, enum bpf_attach_type type) -+{ -+ struct cgroup *cgrp; -+ struct bpf_cgroup_dev_ctx ctx = { -+ .access_type = (access << 16) | dev_type, -+ .major = major, -+ .minor = minor, -+ }; -+ int allow = 1; -+ -+ rcu_read_lock(); -+ cgrp = task_dfl_cgroup(current); -+ allow = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], &ctx, -+ BPF_PROG_RUN); -+ rcu_read_unlock(); -+ -+ return !allow; -+} -+EXPORT_SYMBOL(__cgroup_bpf_check_dev_permission); -+ -+static const struct bpf_func_proto * -+cgroup_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+ case BPF_FUNC_map_lookup_elem: -+ return &bpf_map_lookup_elem_proto; -+ case BPF_FUNC_map_update_elem: -+ return &bpf_map_update_elem_proto; -+ case BPF_FUNC_map_delete_elem: -+ return &bpf_map_delete_elem_proto; -+ case BPF_FUNC_map_push_elem: -+ return &bpf_map_push_elem_proto; -+ case BPF_FUNC_map_pop_elem: -+ return &bpf_map_pop_elem_proto; -+ case BPF_FUNC_map_peek_elem: -+ return &bpf_map_peek_elem_proto; -+ case BPF_FUNC_get_current_uid_gid: -+ return &bpf_get_current_uid_gid_proto; -+ case BPF_FUNC_get_local_storage: -+ return &bpf_get_local_storage_proto; -+ case BPF_FUNC_get_current_cgroup_id: -+ return &bpf_get_current_cgroup_id_proto; -+ case BPF_FUNC_trace_printk: -+ if (capable(CAP_SYS_ADMIN)) -+ return bpf_get_trace_printk_proto(); -+ /* fall through */ -+ default: -+ return NULL; -+ } -+} -+ -+static const struct bpf_func_proto * -+cgroup_dev_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ return cgroup_base_func_proto(func_id, prog); -+} -+ -+static bool cgroup_dev_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ const int size_default = sizeof(__u32); -+ -+ if (type == BPF_WRITE) -+ return false; -+ -+ if (off < 0 || off + size > sizeof(struct bpf_cgroup_dev_ctx)) -+ return false; -+ /* The verifier guarantees that size > 0. */ -+ if (off % size != 0) -+ return false; -+ -+ switch (off) { -+ case bpf_ctx_range(struct bpf_cgroup_dev_ctx, access_type): -+ bpf_ctx_record_field_size(info, size_default); -+ if (!bpf_ctx_narrow_access_ok(off, size, size_default)) -+ return false; -+ break; -+ default: -+ if (size != size_default) -+ return false; -+ } -+ -+ return true; -+} -+ -+const struct bpf_prog_ops cg_dev_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops cg_dev_verifier_ops = { -+ .get_func_proto = cgroup_dev_func_proto, -+ .is_valid_access = cgroup_dev_is_valid_access, -+}; -+ -+/** -+ * __cgroup_bpf_run_filter_sysctl - Run a program on sysctl -+ * -+ * @head: sysctl table header -+ * @table: sysctl table -+ * @write: sysctl is being read (= 0) or written (= 1) -+ * @buf: pointer to buffer passed by user space -+ * @pcount: value-result argument: value is size of buffer pointed to by @buf, -+ * result is size of @new_buf if program set new value, initial value -+ * otherwise -+ * @ppos: value-result argument: value is position at which read from or write -+ * to sysctl is happening, result is new position if program overrode it, -+ * initial value otherwise -+ * @new_buf: pointer to pointer to new buffer that will be allocated if program -+ * overrides new value provided by user space on sysctl write -+ * NOTE: it's caller responsibility to free *new_buf if it was set -+ * @type: type of program to be executed -+ * -+ * Program is run when sysctl is being accessed, either read or written, and -+ * can allow or deny such access. -+ * -+ * This function will return %-EPERM if an attached program is found and -+ * returned value != 1 during execution. In all other cases 0 is returned. -+ */ -+int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head, -+ struct ctl_table *table, int write, -+ void __user *buf, size_t *pcount, -+ loff_t *ppos, void **new_buf, -+ enum bpf_attach_type type) -+{ -+ struct bpf_sysctl_kern ctx = { -+ .head = head, -+ .table = table, -+ .write = write, -+ .ppos = ppos, -+ .cur_val = NULL, -+ .cur_len = PAGE_SIZE, -+ .new_val = NULL, -+ .new_len = 0, -+ .new_updated = 0, -+ }; -+ struct cgroup *cgrp; -+ int ret; -+ -+ ctx.cur_val = kmalloc_track_caller(ctx.cur_len, GFP_KERNEL); -+ if (ctx.cur_val) { -+ mm_segment_t old_fs; -+ loff_t pos = 0; -+ -+ old_fs = get_fs(); -+ set_fs(KERNEL_DS); -+ if (table->proc_handler(table, 0, (void __user *)ctx.cur_val, -+ &ctx.cur_len, &pos)) { -+ /* Let BPF program decide how to proceed. */ -+ ctx.cur_len = 0; -+ } -+ set_fs(old_fs); -+ } else { -+ /* Let BPF program decide how to proceed. */ -+ ctx.cur_len = 0; -+ } -+ -+ if (write && buf && *pcount) { -+ /* BPF program should be able to override new value with a -+ * buffer bigger than provided by user. -+ */ -+ ctx.new_val = kmalloc_track_caller(PAGE_SIZE, GFP_KERNEL); -+ ctx.new_len = min_t(size_t, PAGE_SIZE, *pcount); -+ if (!ctx.new_val || -+ copy_from_user(ctx.new_val, buf, ctx.new_len)) -+ /* Let BPF program decide how to proceed. */ -+ ctx.new_len = 0; -+ } -+ -+ rcu_read_lock(); -+ cgrp = task_dfl_cgroup(current); -+ ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], &ctx, BPF_PROG_RUN); -+ rcu_read_unlock(); -+ -+ kfree(ctx.cur_val); -+ -+ if (ret == 1 && ctx.new_updated) { -+ *new_buf = ctx.new_val; -+ *pcount = ctx.new_len; -+ } else { -+ kfree(ctx.new_val); -+ } -+ -+ return ret == 1 ? 0 : -EPERM; -+} -+EXPORT_SYMBOL(__cgroup_bpf_run_filter_sysctl); -+ -+#ifdef CONFIG_NET -+static bool __cgroup_bpf_prog_array_is_empty(struct cgroup *cgrp, -+ enum bpf_attach_type attach_type) -+{ -+ struct bpf_prog_array *prog_array; -+ bool empty; -+ -+ rcu_read_lock(); -+ prog_array = rcu_dereference(cgrp->bpf.effective[attach_type]); -+ empty = bpf_prog_array_is_empty(prog_array); -+ rcu_read_unlock(); -+ -+ return empty; -+} -+ -+static int sockopt_alloc_buf(struct bpf_sockopt_kern *ctx, int max_optlen) -+{ -+ if (unlikely(max_optlen < 0)) -+ return -EINVAL; -+ -+ if (unlikely(max_optlen > PAGE_SIZE)) { -+ /* We don't expose optvals that are greater than PAGE_SIZE -+ * to the BPF program. -+ */ -+ max_optlen = PAGE_SIZE; -+ } -+ -+ ctx->optval = kzalloc(max_optlen, GFP_USER); -+ if (!ctx->optval) -+ return -ENOMEM; -+ -+ ctx->optval_end = ctx->optval + max_optlen; -+ -+ return max_optlen; -+} -+ -+static void sockopt_free_buf(struct bpf_sockopt_kern *ctx) -+{ -+ kfree(ctx->optval); -+} -+ -+int __cgroup_bpf_run_filter_setsockopt(struct sock *sk, int *level, -+ int *optname, char __user *optval, -+ int *optlen, char **kernel_optval) -+{ -+ struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data); -+ struct bpf_sockopt_kern ctx = { -+ .sk = sk, -+ .level = *level, -+ .optname = *optname, -+ }; -+ int ret, max_optlen; -+ -+ /* Opportunistic check to see whether we have any BPF program -+ * attached to the hook so we don't waste time allocating -+ * memory and locking the socket. -+ */ -+ if (!cgroup_bpf_enabled || -+ __cgroup_bpf_prog_array_is_empty(cgrp, BPF_CGROUP_SETSOCKOPT)) -+ return 0; -+ -+ /* Allocate a bit more than the initial user buffer for -+ * BPF program. The canonical use case is overriding -+ * TCP_CONGESTION(nv) to TCP_CONGESTION(cubic). -+ */ -+ max_optlen = max_t(int, 16, *optlen); -+ -+ max_optlen = sockopt_alloc_buf(&ctx, max_optlen); -+ if (max_optlen < 0) -+ return max_optlen; -+ -+ ctx.optlen = *optlen; -+ -+ if (copy_from_user(ctx.optval, optval, min(*optlen, max_optlen)) != 0) { -+ ret = -EFAULT; -+ goto out; -+ } -+ -+ lock_sock(sk); -+ ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[BPF_CGROUP_SETSOCKOPT], -+ &ctx, BPF_PROG_RUN); -+ release_sock(sk); -+ -+ if (!ret) { -+ ret = -EPERM; -+ goto out; -+ } -+ -+ if (ctx.optlen == -1) { -+ /* optlen set to -1, bypass kernel */ -+ ret = 1; -+ } else if (ctx.optlen > max_optlen || ctx.optlen < -1) { -+ /* optlen is out of bounds */ -+ ret = -EFAULT; -+ } else { -+ /* optlen within bounds, run kernel handler */ -+ ret = 0; -+ -+ /* export any potential modifications */ -+ *level = ctx.level; -+ *optname = ctx.optname; -+ -+ /* optlen == 0 from BPF indicates that we should -+ * use original userspace data. -+ */ -+ if (ctx.optlen != 0) { -+ *optlen = ctx.optlen; -+ *kernel_optval = ctx.optval; -+ /* export and don't free sockopt buf */ -+ return 0; -+ } -+ } -+ -+out: -+ sockopt_free_buf(&ctx); -+ return ret; -+} -+EXPORT_SYMBOL(__cgroup_bpf_run_filter_setsockopt); -+ -+int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level, -+ int optname, char __user *optval, -+ int __user *optlen, int max_optlen, -+ int retval) -+{ -+ struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data); -+ struct bpf_sockopt_kern ctx = { -+ .sk = sk, -+ .level = level, -+ .optname = optname, -+ .retval = retval, -+ }; -+ int ret; -+ -+ /* Opportunistic check to see whether we have any BPF program -+ * attached to the hook so we don't waste time allocating -+ * memory and locking the socket. -+ */ -+ if (!cgroup_bpf_enabled || -+ __cgroup_bpf_prog_array_is_empty(cgrp, BPF_CGROUP_GETSOCKOPT)) -+ return retval; -+ -+ ctx.optlen = max_optlen; -+ -+ max_optlen = sockopt_alloc_buf(&ctx, max_optlen); -+ if (max_optlen < 0) -+ return max_optlen; -+ -+ if (!retval) { -+ /* If kernel getsockopt finished successfully, -+ * copy whatever was returned to the user back -+ * into our temporary buffer. Set optlen to the -+ * one that kernel returned as well to let -+ * BPF programs inspect the value. -+ */ -+ -+ if (get_user(ctx.optlen, optlen)) { -+ ret = -EFAULT; -+ goto out; -+ } -+ -+ if (ctx.optlen < 0) { -+ ret = -EFAULT; -+ goto out; -+ } -+ -+ if (copy_from_user(ctx.optval, optval, -+ min(ctx.optlen, max_optlen)) != 0) { -+ ret = -EFAULT; -+ goto out; -+ } -+ } -+ -+ lock_sock(sk); -+ ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[BPF_CGROUP_GETSOCKOPT], -+ &ctx, BPF_PROG_RUN); -+ release_sock(sk); -+ -+ if (!ret) { -+ ret = -EPERM; -+ goto out; -+ } -+ -+ if (ctx.optlen > max_optlen || ctx.optlen < 0) { -+ ret = -EFAULT; -+ goto out; -+ } -+ -+ /* BPF programs only allowed to set retval to 0, not some -+ * arbitrary value. -+ */ -+ if (ctx.retval != 0 && ctx.retval != retval) { -+ ret = -EFAULT; -+ goto out; -+ } -+ -+ if (ctx.optlen != 0) { -+ if (copy_to_user(optval, ctx.optval, ctx.optlen) || -+ put_user(ctx.optlen, optlen)) { -+ ret = -EFAULT; -+ goto out; -+ } -+ } -+ -+ ret = ctx.retval; -+ -+out: -+ sockopt_free_buf(&ctx); -+ return ret; -+} -+EXPORT_SYMBOL(__cgroup_bpf_run_filter_getsockopt); -+#endif -+ -+static ssize_t sysctl_cpy_dir(const struct ctl_dir *dir, char **bufp, -+ size_t *lenp) -+{ -+ ssize_t tmp_ret = 0, ret; -+ -+ if (dir->header.parent) { -+ tmp_ret = sysctl_cpy_dir(dir->header.parent, bufp, lenp); -+ if (tmp_ret < 0) -+ return tmp_ret; -+ } -+ -+ ret = strscpy(*bufp, dir->header.ctl_table[0].procname, *lenp); -+ if (ret < 0) -+ return ret; -+ *bufp += ret; -+ *lenp -= ret; -+ ret += tmp_ret; -+ -+ /* Avoid leading slash. */ -+ if (!ret) -+ return ret; -+ -+ tmp_ret = strscpy(*bufp, "/", *lenp); -+ if (tmp_ret < 0) -+ return tmp_ret; -+ *bufp += tmp_ret; -+ *lenp -= tmp_ret; -+ -+ return ret + tmp_ret; -+} -+ -+BPF_CALL_4(bpf_sysctl_get_name, struct bpf_sysctl_kern *, ctx, char *, buf, -+ size_t, buf_len, u64, flags) -+{ -+ ssize_t tmp_ret = 0, ret; -+ -+ if (!buf) -+ return -EINVAL; -+ -+ if (!(flags & BPF_F_SYSCTL_BASE_NAME)) { -+ if (!ctx->head) -+ return -EINVAL; -+ tmp_ret = sysctl_cpy_dir(ctx->head->parent, &buf, &buf_len); -+ if (tmp_ret < 0) -+ return tmp_ret; -+ } -+ -+ ret = strscpy(buf, ctx->table->procname, buf_len); -+ -+ return ret < 0 ? ret : tmp_ret + ret; -+} -+ -+static const struct bpf_func_proto bpf_sysctl_get_name_proto = { -+ .func = bpf_sysctl_get_name, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_PTR_TO_MEM, -+ .arg3_type = ARG_CONST_SIZE, -+ .arg4_type = ARG_ANYTHING, -+}; -+ -+static int copy_sysctl_value(char *dst, size_t dst_len, char *src, -+ size_t src_len) -+{ -+ if (!dst) -+ return -EINVAL; -+ -+ if (!dst_len) -+ return -E2BIG; -+ -+ if (!src || !src_len) { -+ memset(dst, 0, dst_len); -+ return -EINVAL; -+ } -+ -+ memcpy(dst, src, min(dst_len, src_len)); -+ -+ if (dst_len > src_len) { -+ memset(dst + src_len, '\0', dst_len - src_len); -+ return src_len; -+ } -+ -+ dst[dst_len - 1] = '\0'; -+ -+ return -E2BIG; -+} -+ -+BPF_CALL_3(bpf_sysctl_get_current_value, struct bpf_sysctl_kern *, ctx, -+ char *, buf, size_t, buf_len) -+{ -+ return copy_sysctl_value(buf, buf_len, ctx->cur_val, ctx->cur_len); -+} -+ -+static const struct bpf_func_proto bpf_sysctl_get_current_value_proto = { -+ .func = bpf_sysctl_get_current_value, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_PTR_TO_UNINIT_MEM, -+ .arg3_type = ARG_CONST_SIZE, -+}; -+ -+BPF_CALL_3(bpf_sysctl_get_new_value, struct bpf_sysctl_kern *, ctx, char *, buf, -+ size_t, buf_len) -+{ -+ if (!ctx->write) { -+ if (buf && buf_len) -+ memset(buf, '\0', buf_len); -+ return -EINVAL; -+ } -+ return copy_sysctl_value(buf, buf_len, ctx->new_val, ctx->new_len); -+} -+ -+static const struct bpf_func_proto bpf_sysctl_get_new_value_proto = { -+ .func = bpf_sysctl_get_new_value, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_PTR_TO_UNINIT_MEM, -+ .arg3_type = ARG_CONST_SIZE, -+}; -+ -+BPF_CALL_3(bpf_sysctl_set_new_value, struct bpf_sysctl_kern *, ctx, -+ const char *, buf, size_t, buf_len) -+{ -+ if (!ctx->write || !ctx->new_val || !ctx->new_len || !buf || !buf_len) -+ return -EINVAL; -+ -+ if (buf_len > PAGE_SIZE - 1) -+ return -E2BIG; -+ -+ memcpy(ctx->new_val, buf, buf_len); -+ ctx->new_len = buf_len; -+ ctx->new_updated = 1; -+ -+ return 0; -+} -+ -+static const struct bpf_func_proto bpf_sysctl_set_new_value_proto = { -+ .func = bpf_sysctl_set_new_value, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_PTR_TO_MEM, -+ .arg3_type = ARG_CONST_SIZE, -+}; -+ -+static const struct bpf_func_proto * -+sysctl_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+ case BPF_FUNC_strtol: -+ return &bpf_strtol_proto; -+ case BPF_FUNC_strtoul: -+ return &bpf_strtoul_proto; -+ case BPF_FUNC_sysctl_get_name: -+ return &bpf_sysctl_get_name_proto; -+ case BPF_FUNC_sysctl_get_current_value: -+ return &bpf_sysctl_get_current_value_proto; -+ case BPF_FUNC_sysctl_get_new_value: -+ return &bpf_sysctl_get_new_value_proto; -+ case BPF_FUNC_sysctl_set_new_value: -+ return &bpf_sysctl_set_new_value_proto; -+ default: -+ return cgroup_base_func_proto(func_id, prog); -+ } -+} -+ -+static bool sysctl_is_valid_access(int off, int size, enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ const int size_default = sizeof(__u32); -+ -+ if (off < 0 || off + size > sizeof(struct bpf_sysctl) || off % size) -+ return false; -+ -+ switch (off) { -+ case bpf_ctx_range(struct bpf_sysctl, write): -+ if (type != BPF_READ) -+ return false; -+ bpf_ctx_record_field_size(info, size_default); -+ return bpf_ctx_narrow_access_ok(off, size, size_default); -+ case bpf_ctx_range(struct bpf_sysctl, file_pos): -+ if (type == BPF_READ) { -+ bpf_ctx_record_field_size(info, size_default); -+ return bpf_ctx_narrow_access_ok(off, size, size_default); -+ } else { -+ return size == size_default; -+ } -+ default: -+ return false; -+ } -+} -+ -+static u32 sysctl_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) -+{ -+ struct bpf_insn *insn = insn_buf; -+ u32 read_size; -+ -+ switch (si->off) { -+ case offsetof(struct bpf_sysctl, write): -+ *insn++ = BPF_LDX_MEM( -+ BPF_SIZE(si->code), si->dst_reg, si->src_reg, -+ bpf_target_off(struct bpf_sysctl_kern, write, -+ FIELD_SIZEOF(struct bpf_sysctl_kern, -+ write), -+ target_size)); -+ break; -+ case offsetof(struct bpf_sysctl, file_pos): -+ /* ppos is a pointer so it should be accessed via indirect -+ * loads and stores. Also for stores additional temporary -+ * register is used since neither src_reg nor dst_reg can be -+ * overridden. -+ */ -+ if (type == BPF_WRITE) { -+ int treg = BPF_REG_9; -+ -+ if (si->src_reg == treg || si->dst_reg == treg) -+ --treg; -+ if (si->src_reg == treg || si->dst_reg == treg) -+ --treg; -+ *insn++ = BPF_STX_MEM( -+ BPF_DW, si->dst_reg, treg, -+ offsetof(struct bpf_sysctl_kern, tmp_reg)); -+ *insn++ = BPF_LDX_MEM( -+ BPF_FIELD_SIZEOF(struct bpf_sysctl_kern, ppos), -+ treg, si->dst_reg, -+ offsetof(struct bpf_sysctl_kern, ppos)); -+ *insn++ = BPF_STX_MEM( -+ BPF_SIZEOF(u32), treg, si->src_reg, -+ bpf_ctx_narrow_access_offset( -+ 0, sizeof(u32), sizeof(loff_t))); -+ *insn++ = BPF_LDX_MEM( -+ BPF_DW, treg, si->dst_reg, -+ offsetof(struct bpf_sysctl_kern, tmp_reg)); -+ } else { -+ *insn++ = BPF_LDX_MEM( -+ BPF_FIELD_SIZEOF(struct bpf_sysctl_kern, ppos), -+ si->dst_reg, si->src_reg, -+ offsetof(struct bpf_sysctl_kern, ppos)); -+ read_size = bpf_size_to_bytes(BPF_SIZE(si->code)); -+ *insn++ = BPF_LDX_MEM( -+ BPF_SIZE(si->code), si->dst_reg, si->dst_reg, -+ bpf_ctx_narrow_access_offset( -+ 0, read_size, sizeof(loff_t))); -+ } -+ *target_size = sizeof(u32); -+ break; -+ } -+ -+ return insn - insn_buf; -+} -+ -+const struct bpf_verifier_ops cg_sysctl_verifier_ops = { -+ .get_func_proto = sysctl_func_proto, -+ .is_valid_access = sysctl_is_valid_access, -+ .convert_ctx_access = sysctl_convert_ctx_access, -+}; -+ -+const struct bpf_prog_ops cg_sysctl_prog_ops = { -+}; -+ -+static const struct bpf_func_proto * -+cg_sockopt_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+#ifdef CONFIG_NET -+ case BPF_FUNC_sk_storage_get: -+ return &bpf_sk_storage_get_proto; -+ case BPF_FUNC_sk_storage_delete: -+ return &bpf_sk_storage_delete_proto; -+#endif -+#ifdef CONFIG_INET -+ case BPF_FUNC_tcp_sock: -+ return &bpf_tcp_sock_proto; -+#endif -+ default: -+ return cgroup_base_func_proto(func_id, prog); -+ } -+} -+ -+static bool cg_sockopt_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ const int size_default = sizeof(__u32); -+ -+ if (off < 0 || off >= sizeof(struct bpf_sockopt)) -+ return false; -+ -+ if (off % size != 0) -+ return false; -+ -+ if (type == BPF_WRITE) { -+ switch (off) { -+ case offsetof(struct bpf_sockopt, retval): -+ if (size != size_default) -+ return false; -+ return prog->expected_attach_type == -+ BPF_CGROUP_GETSOCKOPT; -+ case offsetof(struct bpf_sockopt, optname): -+ /* fallthrough */ -+ case offsetof(struct bpf_sockopt, level): -+ if (size != size_default) -+ return false; -+ return prog->expected_attach_type == -+ BPF_CGROUP_SETSOCKOPT; -+ case offsetof(struct bpf_sockopt, optlen): -+ return size == size_default; -+ default: -+ return false; -+ } -+ } -+ -+ switch (off) { -+ case offsetof(struct bpf_sockopt, sk): -+ if (size != sizeof(__u64)) -+ return false; -+ info->reg_type = PTR_TO_SOCKET; -+ break; -+ case offsetof(struct bpf_sockopt, optval): -+ if (size != sizeof(__u64)) -+ return false; -+ info->reg_type = PTR_TO_PACKET; -+ break; -+ case offsetof(struct bpf_sockopt, optval_end): -+ if (size != sizeof(__u64)) -+ return false; -+ info->reg_type = PTR_TO_PACKET_END; -+ break; -+ case offsetof(struct bpf_sockopt, retval): -+ if (size != size_default) -+ return false; -+ return prog->expected_attach_type == BPF_CGROUP_GETSOCKOPT; -+ default: -+ if (size != size_default) -+ return false; -+ break; -+ } -+ return true; -+} -+ -+#define CG_SOCKOPT_ACCESS_FIELD(T, F) \ -+ T(BPF_FIELD_SIZEOF(struct bpf_sockopt_kern, F), \ -+ si->dst_reg, si->src_reg, \ -+ offsetof(struct bpf_sockopt_kern, F)) -+ -+static u32 cg_sockopt_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size) -+{ -+ struct bpf_insn *insn = insn_buf; -+ -+ switch (si->off) { -+ case offsetof(struct bpf_sockopt, sk): -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_LDX_MEM, sk); -+ break; -+ case offsetof(struct bpf_sockopt, level): -+ if (type == BPF_WRITE) -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_STX_MEM, level); -+ else -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_LDX_MEM, level); -+ break; -+ case offsetof(struct bpf_sockopt, optname): -+ if (type == BPF_WRITE) -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_STX_MEM, optname); -+ else -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_LDX_MEM, optname); -+ break; -+ case offsetof(struct bpf_sockopt, optlen): -+ if (type == BPF_WRITE) -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_STX_MEM, optlen); -+ else -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_LDX_MEM, optlen); -+ break; -+ case offsetof(struct bpf_sockopt, retval): -+ if (type == BPF_WRITE) -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_STX_MEM, retval); -+ else -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_LDX_MEM, retval); -+ break; -+ case offsetof(struct bpf_sockopt, optval): -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_LDX_MEM, optval); -+ break; -+ case offsetof(struct bpf_sockopt, optval_end): -+ *insn++ = CG_SOCKOPT_ACCESS_FIELD(BPF_LDX_MEM, optval_end); -+ break; -+ } -+ -+ return insn - insn_buf; -+} -+ -+static int cg_sockopt_get_prologue(struct bpf_insn *insn_buf, -+ bool direct_write, -+ const struct bpf_prog *prog) -+{ -+ /* Nothing to do for sockopt argument. The data is kzalloc'ated. -+ */ -+ return 0; -+} -+ -+const struct bpf_verifier_ops cg_sockopt_verifier_ops = { -+ .get_func_proto = cg_sockopt_func_proto, -+ .is_valid_access = cg_sockopt_is_valid_access, -+ .convert_ctx_access = cg_sockopt_convert_ctx_access, -+ .gen_prologue = cg_sockopt_get_prologue, -+}; -+ -+const struct bpf_prog_ops cg_sockopt_prog_ops = { -+}; ---- a/kernel/bpf/core.c -+++ b/kernel/bpf/core.c -@@ -1,3 +1,4 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later - /* - * Linux Socket Filter - Kernel level socket filtering - * -@@ -12,21 +13,22 @@ - * Alexei Starovoitov - * Daniel Borkmann - * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * as published by the Free Software Foundation; either version -- * 2 of the License, or (at your option) any later version. -- * - * Andi Kleen - Fix a few bad bugs and races. - * Kris Katterjohn - Added many additional checks in bpf_check_classic() - */ - -+#include - #include - #include - #include - #include - #include - #include -+#include -+#include -+#include -+#include -+#include - - #include - -@@ -47,6 +49,7 @@ - #define DST regs[insn->dst_reg] - #define SRC regs[insn->src_reg] - #define FP regs[BPF_REG_FP] -+#define AX regs[BPF_REG_AX] - #define ARG1 regs[BPF_REG_ARG1] - #define CTX regs[BPF_REG_CTX] - #define IMM insn->imm -@@ -70,10 +73,9 @@ void *bpf_internal_load_pointer_neg_help - return NULL; - } - --struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags) -+struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flags) - { -- gfp_t gfp_flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO | -- gfp_extra_flags; -+ gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO | gfp_extra_flags; - struct bpf_prog_aux *aux; - struct bpf_prog *fp; - -@@ -82,8 +84,6 @@ struct bpf_prog *bpf_prog_alloc(unsigned - if (fp == NULL) - return NULL; - -- kmemcheck_annotate_bitfield(fp, meta); -- - aux = kzalloc(sizeof(*aux), GFP_KERNEL | gfp_extra_flags); - if (aux == NULL) { - vfree(fp); -@@ -93,30 +93,151 @@ struct bpf_prog *bpf_prog_alloc(unsigned - fp->pages = size / PAGE_SIZE; - fp->aux = aux; - fp->aux->prog = fp; -+ fp->jit_requested = ebpf_jit_enabled(); -+ -+ INIT_LIST_HEAD_RCU(&fp->aux->ksym_lnode); - - return fp; - } -+ -+struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags) -+{ -+ gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO | gfp_extra_flags; -+ struct bpf_prog *prog; -+ int cpu; -+ -+ prog = bpf_prog_alloc_no_stats(size, gfp_extra_flags); -+ if (!prog) -+ return NULL; -+ -+ prog->aux->stats = alloc_percpu_gfp(struct bpf_prog_stats, gfp_flags); -+ if (!prog->aux->stats) { -+ kfree(prog->aux); -+ vfree(prog); -+ return NULL; -+ } -+ -+ for_each_possible_cpu(cpu) { -+ struct bpf_prog_stats *pstats; -+ -+ pstats = per_cpu_ptr(prog->aux->stats, cpu); -+ u64_stats_init(&pstats->syncp); -+ } -+ return prog; -+} - EXPORT_SYMBOL_GPL(bpf_prog_alloc); - -+int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog) -+{ -+ if (!prog->aux->nr_linfo || !prog->jit_requested) -+ return 0; -+ -+ prog->aux->jited_linfo = kcalloc(prog->aux->nr_linfo, -+ sizeof(*prog->aux->jited_linfo), -+ GFP_KERNEL | __GFP_NOWARN); -+ if (!prog->aux->jited_linfo) -+ return -ENOMEM; -+ -+ return 0; -+} -+ -+void bpf_prog_free_jited_linfo(struct bpf_prog *prog) -+{ -+ kfree(prog->aux->jited_linfo); -+ prog->aux->jited_linfo = NULL; -+} -+ -+void bpf_prog_free_unused_jited_linfo(struct bpf_prog *prog) -+{ -+ if (prog->aux->jited_linfo && !prog->aux->jited_linfo[0]) -+ bpf_prog_free_jited_linfo(prog); -+} -+ -+/* The jit engine is responsible to provide an array -+ * for insn_off to the jited_off mapping (insn_to_jit_off). -+ * -+ * The idx to this array is the insn_off. Hence, the insn_off -+ * here is relative to the prog itself instead of the main prog. -+ * This array has one entry for each xlated bpf insn. -+ * -+ * jited_off is the byte off to the last byte of the jited insn. -+ * -+ * Hence, with -+ * insn_start: -+ * The first bpf insn off of the prog. The insn off -+ * here is relative to the main prog. -+ * e.g. if prog is a subprog, insn_start > 0 -+ * linfo_idx: -+ * The prog's idx to prog->aux->linfo and jited_linfo -+ * -+ * jited_linfo[linfo_idx] = prog->bpf_func -+ * -+ * For i > linfo_idx, -+ * -+ * jited_linfo[i] = prog->bpf_func + -+ * insn_to_jit_off[linfo[i].insn_off - insn_start - 1] -+ */ -+void bpf_prog_fill_jited_linfo(struct bpf_prog *prog, -+ const u32 *insn_to_jit_off) -+{ -+ u32 linfo_idx, insn_start, insn_end, nr_linfo, i; -+ const struct bpf_line_info *linfo; -+ void **jited_linfo; -+ -+ if (!prog->aux->jited_linfo) -+ /* Userspace did not provide linfo */ -+ return; -+ -+ linfo_idx = prog->aux->linfo_idx; -+ linfo = &prog->aux->linfo[linfo_idx]; -+ insn_start = linfo[0].insn_off; -+ insn_end = insn_start + prog->len; -+ -+ jited_linfo = &prog->aux->jited_linfo[linfo_idx]; -+ jited_linfo[0] = prog->bpf_func; -+ -+ nr_linfo = prog->aux->nr_linfo - linfo_idx; -+ -+ for (i = 1; i < nr_linfo && linfo[i].insn_off < insn_end; i++) -+ /* The verifier ensures that linfo[i].insn_off is -+ * strictly increasing -+ */ -+ jited_linfo[i] = prog->bpf_func + -+ insn_to_jit_off[linfo[i].insn_off - insn_start - 1]; -+} -+ -+void bpf_prog_free_linfo(struct bpf_prog *prog) -+{ -+ bpf_prog_free_jited_linfo(prog); -+ kvfree(prog->aux->linfo); -+} -+ - struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size, - gfp_t gfp_extra_flags) - { -- gfp_t gfp_flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO | -- gfp_extra_flags; -+ gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO | gfp_extra_flags; - struct bpf_prog *fp; -+ u32 pages, delta; -+ int ret; - - BUG_ON(fp_old == NULL); - - size = round_up(size, PAGE_SIZE); -- if (size <= fp_old->pages * PAGE_SIZE) -+ pages = size / PAGE_SIZE; -+ if (pages <= fp_old->pages) - return fp_old; - -- fp = __vmalloc(size, gfp_flags, PAGE_KERNEL); -- if (fp != NULL) { -- kmemcheck_annotate_bitfield(fp, meta); -+ delta = pages - fp_old->pages; -+ ret = __bpf_prog_charge(fp_old->aux->user, delta); -+ if (ret) -+ return NULL; - -+ fp = __vmalloc(size, gfp_flags, PAGE_KERNEL); -+ if (fp == NULL) { -+ __bpf_prog_uncharge(fp_old->aux->user, delta); -+ } else { - memcpy(fp, fp_old, fp_old->pages * PAGE_SIZE); -- fp->pages = size / PAGE_SIZE; -+ fp->pages = pages; - fp->aux->prog = fp; - - /* We keep fp->aux from fp_old around in the new -@@ -128,40 +249,578 @@ struct bpf_prog *bpf_prog_realloc(struct - - return fp; - } --EXPORT_SYMBOL_GPL(bpf_prog_realloc); - - void __bpf_prog_free(struct bpf_prog *fp) - { -- kfree(fp->aux); -+ if (fp->aux) { -+ free_percpu(fp->aux->stats); -+ kfree(fp->aux); -+ } - vfree(fp); - } --EXPORT_SYMBOL_GPL(__bpf_prog_free); -+ -+int bpf_prog_calc_tag(struct bpf_prog *fp) -+{ -+ const u32 bits_offset = SHA_MESSAGE_BYTES - sizeof(__be64); -+ u32 raw_size = bpf_prog_tag_scratch_size(fp); -+ u32 digest[SHA_DIGEST_WORDS]; -+ u32 ws[SHA_WORKSPACE_WORDS]; -+ u32 i, bsize, psize, blocks; -+ struct bpf_insn *dst; -+ bool was_ld_map; -+ u8 *raw, *todo; -+ __be32 *result; -+ __be64 *bits; -+ -+ raw = vmalloc(raw_size); -+ if (!raw) -+ return -ENOMEM; -+ -+ sha_init(digest); -+ memset(ws, 0, sizeof(ws)); -+ -+ /* We need to take out the map fd for the digest calculation -+ * since they are unstable from user space side. -+ */ -+ dst = (void *)raw; -+ for (i = 0, was_ld_map = false; i < fp->len; i++) { -+ dst[i] = fp->insnsi[i]; -+ if (!was_ld_map && -+ dst[i].code == (BPF_LD | BPF_IMM | BPF_DW) && -+ (dst[i].src_reg == BPF_PSEUDO_MAP_FD || -+ dst[i].src_reg == BPF_PSEUDO_MAP_VALUE)) { -+ was_ld_map = true; -+ dst[i].imm = 0; -+ } else if (was_ld_map && -+ dst[i].code == 0 && -+ dst[i].dst_reg == 0 && -+ dst[i].src_reg == 0 && -+ dst[i].off == 0) { -+ was_ld_map = false; -+ dst[i].imm = 0; -+ } else { -+ was_ld_map = false; -+ } -+ } -+ -+ psize = bpf_prog_insn_size(fp); -+ memset(&raw[psize], 0, raw_size - psize); -+ raw[psize++] = 0x80; -+ -+ bsize = round_up(psize, SHA_MESSAGE_BYTES); -+ blocks = bsize / SHA_MESSAGE_BYTES; -+ todo = raw; -+ if (bsize - psize >= sizeof(__be64)) { -+ bits = (__be64 *)(todo + bsize - sizeof(__be64)); -+ } else { -+ bits = (__be64 *)(todo + bsize + bits_offset); -+ blocks++; -+ } -+ *bits = cpu_to_be64((psize - 1) << 3); -+ -+ while (blocks--) { -+ sha_transform(digest, todo, ws); -+ todo += SHA_MESSAGE_BYTES; -+ } -+ -+ result = (__force __be32 *)digest; -+ for (i = 0; i < SHA_DIGEST_WORDS; i++) -+ result[i] = cpu_to_be32(digest[i]); -+ memcpy(fp->tag, result, sizeof(fp->tag)); -+ -+ vfree(raw); -+ return 0; -+} -+ -+static int bpf_adj_delta_to_imm(struct bpf_insn *insn, u32 pos, s32 end_old, -+ s32 end_new, s32 curr, const bool probe_pass) -+{ -+ const s64 imm_min = S32_MIN, imm_max = S32_MAX; -+ s32 delta = end_new - end_old; -+ s64 imm = insn->imm; -+ -+ if (curr < pos && curr + imm + 1 >= end_old) -+ imm += delta; -+ else if (curr >= end_new && curr + imm + 1 < end_new) -+ imm -= delta; -+ if (imm < imm_min || imm > imm_max) -+ return -ERANGE; -+ if (!probe_pass) -+ insn->imm = imm; -+ return 0; -+} -+ -+static int bpf_adj_delta_to_off(struct bpf_insn *insn, u32 pos, s32 end_old, -+ s32 end_new, s32 curr, const bool probe_pass) -+{ -+ const s32 off_min = S16_MIN, off_max = S16_MAX; -+ s32 delta = end_new - end_old; -+ s32 off = insn->off; -+ -+ if (curr < pos && curr + off + 1 >= end_old) -+ off += delta; -+ else if (curr >= end_new && curr + off + 1 < end_new) -+ off -= delta; -+ if (off < off_min || off > off_max) -+ return -ERANGE; -+ if (!probe_pass) -+ insn->off = off; -+ return 0; -+} -+ -+static int bpf_adj_branches(struct bpf_prog *prog, u32 pos, s32 end_old, -+ s32 end_new, const bool probe_pass) -+{ -+ u32 i, insn_cnt = prog->len + (probe_pass ? end_new - end_old : 0); -+ struct bpf_insn *insn = prog->insnsi; -+ int ret = 0; -+ -+ for (i = 0; i < insn_cnt; i++, insn++) { -+ u8 code; -+ -+ /* In the probing pass we still operate on the original, -+ * unpatched image in order to check overflows before we -+ * do any other adjustments. Therefore skip the patchlet. -+ */ -+ if (probe_pass && i == pos) { -+ i = end_new; -+ insn = prog->insnsi + end_old; -+ } -+ code = insn->code; -+ if ((BPF_CLASS(code) != BPF_JMP && -+ BPF_CLASS(code) != BPF_JMP32) || -+ BPF_OP(code) == BPF_EXIT) -+ continue; -+ /* Adjust offset of jmps if we cross patch boundaries. */ -+ if (BPF_OP(code) == BPF_CALL) { -+ if (insn->src_reg != BPF_PSEUDO_CALL) -+ continue; -+ ret = bpf_adj_delta_to_imm(insn, pos, end_old, -+ end_new, i, probe_pass); -+ } else { -+ ret = bpf_adj_delta_to_off(insn, pos, end_old, -+ end_new, i, probe_pass); -+ } -+ if (ret) -+ break; -+ } -+ -+ return ret; -+} -+ -+static void bpf_adj_linfo(struct bpf_prog *prog, u32 off, u32 delta) -+{ -+ struct bpf_line_info *linfo; -+ u32 i, nr_linfo; -+ -+ nr_linfo = prog->aux->nr_linfo; -+ if (!nr_linfo || !delta) -+ return; -+ -+ linfo = prog->aux->linfo; -+ -+ for (i = 0; i < nr_linfo; i++) -+ if (off < linfo[i].insn_off) -+ break; -+ -+ /* Push all off < linfo[i].insn_off by delta */ -+ for (; i < nr_linfo; i++) -+ linfo[i].insn_off += delta; -+} -+ -+struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, -+ const struct bpf_insn *patch, u32 len) -+{ -+ u32 insn_adj_cnt, insn_rest, insn_delta = len - 1; -+ const u32 cnt_max = S16_MAX; -+ struct bpf_prog *prog_adj; -+ int err; -+ -+ /* Since our patchlet doesn't expand the image, we're done. */ -+ if (insn_delta == 0) { -+ memcpy(prog->insnsi + off, patch, sizeof(*patch)); -+ return prog; -+ } -+ -+ insn_adj_cnt = prog->len + insn_delta; -+ -+ /* Reject anything that would potentially let the insn->off -+ * target overflow when we have excessive program expansions. -+ * We need to probe here before we do any reallocation where -+ * we afterwards may not fail anymore. -+ */ -+ if (insn_adj_cnt > cnt_max && -+ (err = bpf_adj_branches(prog, off, off + 1, off + len, true))) -+ return ERR_PTR(err); -+ -+ /* Several new instructions need to be inserted. Make room -+ * for them. Likely, there's no need for a new allocation as -+ * last page could have large enough tailroom. -+ */ -+ prog_adj = bpf_prog_realloc(prog, bpf_prog_size(insn_adj_cnt), -+ GFP_USER); -+ if (!prog_adj) -+ return ERR_PTR(-ENOMEM); -+ -+ prog_adj->len = insn_adj_cnt; -+ -+ /* Patching happens in 3 steps: -+ * -+ * 1) Move over tail of insnsi from next instruction onwards, -+ * so we can patch the single target insn with one or more -+ * new ones (patching is always from 1 to n insns, n > 0). -+ * 2) Inject new instructions at the target location. -+ * 3) Adjust branch offsets if necessary. -+ */ -+ insn_rest = insn_adj_cnt - off - len; -+ -+ memmove(prog_adj->insnsi + off + len, prog_adj->insnsi + off + 1, -+ sizeof(*patch) * insn_rest); -+ memcpy(prog_adj->insnsi + off, patch, sizeof(*patch) * len); -+ -+ /* We are guaranteed to not fail at this point, otherwise -+ * the ship has sailed to reverse to the original state. An -+ * overflow cannot happen at this point. -+ */ -+ BUG_ON(bpf_adj_branches(prog_adj, off, off + 1, off + len, false)); -+ -+ bpf_adj_linfo(prog_adj, off, insn_delta); -+ -+ return prog_adj; -+} -+ -+int bpf_remove_insns(struct bpf_prog *prog, u32 off, u32 cnt) -+{ -+ /* Branch offsets can't overflow when program is shrinking, no need -+ * to call bpf_adj_branches(..., true) here -+ */ -+ memmove(prog->insnsi + off, prog->insnsi + off + cnt, -+ sizeof(struct bpf_insn) * (prog->len - off - cnt)); -+ prog->len -= cnt; -+ -+ return WARN_ON_ONCE(bpf_adj_branches(prog, off, off + cnt, off, false)); -+} -+ -+static void bpf_prog_kallsyms_del_subprogs(struct bpf_prog *fp) -+{ -+ int i; -+ -+ for (i = 0; i < fp->aux->func_cnt; i++) -+ bpf_prog_kallsyms_del(fp->aux->func[i]); -+} -+ -+void bpf_prog_kallsyms_del_all(struct bpf_prog *fp) -+{ -+ bpf_prog_kallsyms_del_subprogs(fp); -+ bpf_prog_kallsyms_del(fp); -+} - - #ifdef CONFIG_BPF_JIT -+/* All BPF JIT sysctl knobs here. */ -+int bpf_jit_enable __read_mostly = IS_BUILTIN(CONFIG_BPF_JIT_ALWAYS_ON); -+int bpf_jit_harden __read_mostly; -+int bpf_jit_kallsyms __read_mostly; -+long bpf_jit_limit __read_mostly; -+ -+static __always_inline void -+bpf_get_prog_addr_region(const struct bpf_prog *prog, -+ unsigned long *symbol_start, -+ unsigned long *symbol_end) -+{ -+ const struct bpf_binary_header *hdr = bpf_jit_binary_hdr(prog); -+ unsigned long addr = (unsigned long)hdr; -+ -+ WARN_ON_ONCE(!bpf_prog_ebpf_jited(prog)); -+ -+ *symbol_start = addr; -+ *symbol_end = addr + hdr->pages * PAGE_SIZE; -+} -+ -+void bpf_get_prog_name(const struct bpf_prog *prog, char *sym) -+{ -+ const char *end = sym + KSYM_NAME_LEN; -+ const struct btf_type *type; -+ const char *func_name; -+ -+ BUILD_BUG_ON(sizeof("bpf_prog_") + -+ sizeof(prog->tag) * 2 + -+ /* name has been null terminated. -+ * We should need +1 for the '_' preceding -+ * the name. However, the null character -+ * is double counted between the name and the -+ * sizeof("bpf_prog_") above, so we omit -+ * the +1 here. -+ */ -+ sizeof(prog->aux->name) > KSYM_NAME_LEN); -+ -+ sym += snprintf(sym, KSYM_NAME_LEN, "bpf_prog_"); -+ sym = bin2hex(sym, prog->tag, sizeof(prog->tag)); -+ -+ /* prog->aux->name will be ignored if full btf name is available */ -+ if (prog->aux->func_info_cnt) { -+ type = btf_type_by_id(prog->aux->btf, -+ prog->aux->func_info[prog->aux->func_idx].type_id); -+ func_name = btf_name_by_offset(prog->aux->btf, type->name_off); -+ snprintf(sym, (size_t)(end - sym), "_%s", func_name); -+ return; -+ } -+ -+ if (prog->aux->name[0]) -+ snprintf(sym, (size_t)(end - sym), "_%s", prog->aux->name); -+ else -+ *sym = 0; -+} -+ -+static __always_inline unsigned long -+bpf_get_prog_addr_start(struct latch_tree_node *n) -+{ -+ unsigned long symbol_start, symbol_end; -+ const struct bpf_prog_aux *aux; -+ -+ aux = container_of(n, struct bpf_prog_aux, ksym_tnode); -+ bpf_get_prog_addr_region(aux->prog, &symbol_start, &symbol_end); -+ -+ return symbol_start; -+} -+ -+static __always_inline bool bpf_tree_less(struct latch_tree_node *a, -+ struct latch_tree_node *b) -+{ -+ return bpf_get_prog_addr_start(a) < bpf_get_prog_addr_start(b); -+} -+ -+static __always_inline int bpf_tree_comp(void *key, struct latch_tree_node *n) -+{ -+ unsigned long val = (unsigned long)key; -+ unsigned long symbol_start, symbol_end; -+ const struct bpf_prog_aux *aux; -+ -+ aux = container_of(n, struct bpf_prog_aux, ksym_tnode); -+ bpf_get_prog_addr_region(aux->prog, &symbol_start, &symbol_end); -+ -+ if (val < symbol_start) -+ return -1; -+ if (val >= symbol_end) -+ return 1; -+ -+ return 0; -+} -+ -+static const struct latch_tree_ops bpf_tree_ops = { -+ .less = bpf_tree_less, -+ .comp = bpf_tree_comp, -+}; -+ -+static DEFINE_SPINLOCK(bpf_lock); -+static LIST_HEAD(bpf_kallsyms); -+static struct latch_tree_root bpf_tree __cacheline_aligned; -+ -+static void bpf_prog_ksym_node_add(struct bpf_prog_aux *aux) -+{ -+ WARN_ON_ONCE(!list_empty(&aux->ksym_lnode)); -+ list_add_tail_rcu(&aux->ksym_lnode, &bpf_kallsyms); -+ latch_tree_insert(&aux->ksym_tnode, &bpf_tree, &bpf_tree_ops); -+} -+ -+static void bpf_prog_ksym_node_del(struct bpf_prog_aux *aux) -+{ -+ if (list_empty(&aux->ksym_lnode)) -+ return; -+ -+ latch_tree_erase(&aux->ksym_tnode, &bpf_tree, &bpf_tree_ops); -+ list_del_rcu(&aux->ksym_lnode); -+} -+ -+static bool bpf_prog_kallsyms_candidate(const struct bpf_prog *fp) -+{ -+ return fp->jited && !bpf_prog_was_classic(fp); -+} -+ -+static bool bpf_prog_kallsyms_verify_off(const struct bpf_prog *fp) -+{ -+ return list_empty(&fp->aux->ksym_lnode) || -+ fp->aux->ksym_lnode.prev == LIST_POISON2; -+} -+ -+void bpf_prog_kallsyms_add(struct bpf_prog *fp) -+{ -+ if (!bpf_prog_kallsyms_candidate(fp) || -+ !capable(CAP_SYS_ADMIN)) -+ return; -+ -+ spin_lock_bh(&bpf_lock); -+ bpf_prog_ksym_node_add(fp->aux); -+ spin_unlock_bh(&bpf_lock); -+} -+ -+void bpf_prog_kallsyms_del(struct bpf_prog *fp) -+{ -+ if (!bpf_prog_kallsyms_candidate(fp)) -+ return; -+ -+ spin_lock_bh(&bpf_lock); -+ bpf_prog_ksym_node_del(fp->aux); -+ spin_unlock_bh(&bpf_lock); -+} -+ -+static struct bpf_prog *bpf_prog_kallsyms_find(unsigned long addr) -+{ -+ struct latch_tree_node *n; -+ -+ if (!bpf_jit_kallsyms_enabled()) -+ return NULL; -+ -+ n = latch_tree_find((void *)addr, &bpf_tree, &bpf_tree_ops); -+ return n ? -+ container_of(n, struct bpf_prog_aux, ksym_tnode)->prog : -+ NULL; -+} -+ -+const char *__bpf_address_lookup(unsigned long addr, unsigned long *size, -+ unsigned long *off, char *sym) -+{ -+ unsigned long symbol_start, symbol_end; -+ struct bpf_prog *prog; -+ char *ret = NULL; -+ -+ rcu_read_lock(); -+ prog = bpf_prog_kallsyms_find(addr); -+ if (prog) { -+ bpf_get_prog_addr_region(prog, &symbol_start, &symbol_end); -+ bpf_get_prog_name(prog, sym); -+ -+ ret = sym; -+ if (size) -+ *size = symbol_end - symbol_start; -+ if (off) -+ *off = addr - symbol_start; -+ } -+ rcu_read_unlock(); -+ -+ return ret; -+} -+ -+bool is_bpf_text_address(unsigned long addr) -+{ -+ bool ret; -+ -+ rcu_read_lock(); -+ ret = bpf_prog_kallsyms_find(addr) != NULL; -+ rcu_read_unlock(); -+ -+ return ret; -+} -+ -+int bpf_get_kallsym(unsigned int symnum, unsigned long *value, char *type, -+ char *sym) -+{ -+ struct bpf_prog_aux *aux; -+ unsigned int it = 0; -+ int ret = -ERANGE; -+ -+ if (!bpf_jit_kallsyms_enabled()) -+ return ret; -+ -+ rcu_read_lock(); -+ list_for_each_entry_rcu(aux, &bpf_kallsyms, ksym_lnode) { -+ if (it++ != symnum) -+ continue; -+ -+ bpf_get_prog_name(aux->prog, sym); -+ -+ *value = (unsigned long)aux->prog->bpf_func; -+ *type = BPF_SYM_ELF_TYPE; -+ -+ ret = 0; -+ break; -+ } -+ rcu_read_unlock(); -+ -+ return ret; -+} -+ -+static atomic_long_t bpf_jit_current; -+ -+/* Can be overridden by an arch's JIT compiler if it has a custom, -+ * dedicated BPF backend memory area, or if neither of the two -+ * below apply. -+ */ -+u64 __weak bpf_jit_alloc_exec_limit(void) -+{ -+#if defined(MODULES_VADDR) -+ return MODULES_END - MODULES_VADDR; -+#else -+ return VMALLOC_END - VMALLOC_START; -+#endif -+} -+ -+static int __init bpf_jit_charge_init(void) -+{ -+ /* Only used as heuristic here to derive limit. */ -+ bpf_jit_limit = min_t(u64, round_up(bpf_jit_alloc_exec_limit() >> 2, -+ PAGE_SIZE), LONG_MAX); -+ return 0; -+} -+pure_initcall(bpf_jit_charge_init); -+ -+static int bpf_jit_charge_modmem(u32 pages) -+{ -+ if (atomic_long_add_return(pages, &bpf_jit_current) > -+ (bpf_jit_limit >> PAGE_SHIFT)) { -+ if (!capable(CAP_SYS_ADMIN)) { -+ atomic_long_sub(pages, &bpf_jit_current); -+ return -EPERM; -+ } -+ } -+ -+ return 0; -+} -+ -+static void bpf_jit_uncharge_modmem(u32 pages) -+{ -+ atomic_long_sub(pages, &bpf_jit_current); -+} -+ -+void *__weak bpf_jit_alloc_exec(unsigned long size) -+{ -+ return module_alloc(size); -+} -+ -+void __weak bpf_jit_free_exec(void *addr) -+{ -+ module_memfree(addr); -+} -+ - struct bpf_binary_header * - bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, - unsigned int alignment, - bpf_jit_fill_hole_t bpf_fill_ill_insns) - { - struct bpf_binary_header *hdr; -- unsigned int size, hole, start; -+ u32 size, hole, start, pages; - - /* Most of BPF filters are really small, but if some of them - * fill a page, allow at least 128 extra bytes to insert a - * random section of illegal instructions. - */ - size = round_up(proglen + sizeof(*hdr) + 128, PAGE_SIZE); -- hdr = module_alloc(size); -- if (hdr == NULL) -+ pages = size / PAGE_SIZE; -+ -+ if (bpf_jit_charge_modmem(pages)) -+ return NULL; -+ hdr = bpf_jit_alloc_exec(size); -+ if (!hdr) { -+ bpf_jit_uncharge_modmem(pages); - return NULL; -+ } - - /* Fill space with illegal/arch-dep instructions. */ - bpf_fill_ill_insns(hdr, size); - -- hdr->pages = size / PAGE_SIZE; -+ hdr->pages = pages; - hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)), - PAGE_SIZE - sizeof(*hdr)); -- start = (prandom_u32() % hole) & ~(alignment - 1); -+ start = (get_random_int() % hole) & ~(alignment - 1); - - /* Leave a random number of instructions before BPF code. */ - *image_ptr = &hdr->image[start]; -@@ -171,13 +830,301 @@ bpf_jit_binary_alloc(unsigned int progle - - void bpf_jit_binary_free(struct bpf_binary_header *hdr) - { -- module_memfree(hdr); -+ u32 pages = hdr->pages; -+ -+ bpf_jit_free_exec(hdr); -+ bpf_jit_uncharge_modmem(pages); -+} -+ -+/* This symbol is only overridden by archs that have different -+ * requirements than the usual eBPF JITs, f.e. when they only -+ * implement cBPF JIT, do not set images read-only, etc. -+ */ -+void __weak bpf_jit_free(struct bpf_prog *fp) -+{ -+ if (fp->jited) { -+ struct bpf_binary_header *hdr = bpf_jit_binary_hdr(fp); -+ -+ bpf_jit_binary_unlock_ro(hdr); -+ bpf_jit_binary_free(hdr); -+ -+ WARN_ON_ONCE(!bpf_prog_kallsyms_verify_off(fp)); -+ } -+ -+ bpf_prog_unlock_free(fp); -+} -+ -+int bpf_jit_get_func_addr(const struct bpf_prog *prog, -+ const struct bpf_insn *insn, bool extra_pass, -+ u64 *func_addr, bool *func_addr_fixed) -+{ -+ s16 off = insn->off; -+ s32 imm = insn->imm; -+ u8 *addr; -+ -+ *func_addr_fixed = insn->src_reg != BPF_PSEUDO_CALL; -+ if (!*func_addr_fixed) { -+ /* Place-holder address till the last pass has collected -+ * all addresses for JITed subprograms in which case we -+ * can pick them up from prog->aux. -+ */ -+ if (!extra_pass) -+ addr = NULL; -+ else if (prog->aux->func && -+ off >= 0 && off < prog->aux->func_cnt) -+ addr = (u8 *)prog->aux->func[off]->bpf_func; -+ else -+ return -EINVAL; -+ } else { -+ /* Address of a BPF helper call. Since part of the core -+ * kernel, it's always at a fixed location. __bpf_call_base -+ * and the helper with imm relative to it are both in core -+ * kernel. -+ */ -+ addr = (u8 *)__bpf_call_base + imm; -+ } -+ -+ *func_addr = (unsigned long)addr; -+ return 0; -+} -+ -+static int bpf_jit_blind_insn(const struct bpf_insn *from, -+ const struct bpf_insn *aux, -+ struct bpf_insn *to_buff, -+ bool emit_zext) -+{ -+ struct bpf_insn *to = to_buff; -+ u32 imm_rnd = get_random_int(); -+ s16 off; -+ -+ BUILD_BUG_ON(BPF_REG_AX + 1 != MAX_BPF_JIT_REG); -+ BUILD_BUG_ON(MAX_BPF_REG + 1 != MAX_BPF_JIT_REG); -+ -+ /* Constraints on AX register: -+ * -+ * AX register is inaccessible from user space. It is mapped in -+ * all JITs, and used here for constant blinding rewrites. It is -+ * typically "stateless" meaning its contents are only valid within -+ * the executed instruction, but not across several instructions. -+ * There are a few exceptions however which are further detailed -+ * below. -+ * -+ * Constant blinding is only used by JITs, not in the interpreter. -+ * The interpreter uses AX in some occasions as a local temporary -+ * register e.g. in DIV or MOD instructions. -+ * -+ * In restricted circumstances, the verifier can also use the AX -+ * register for rewrites as long as they do not interfere with -+ * the above cases! -+ */ -+ if (from->dst_reg == BPF_REG_AX || from->src_reg == BPF_REG_AX) -+ goto out; -+ -+ if (from->imm == 0 && -+ (from->code == (BPF_ALU | BPF_MOV | BPF_K) || -+ from->code == (BPF_ALU64 | BPF_MOV | BPF_K))) { -+ *to++ = BPF_ALU64_REG(BPF_XOR, from->dst_reg, from->dst_reg); -+ goto out; -+ } -+ -+ switch (from->code) { -+ case BPF_ALU | BPF_ADD | BPF_K: -+ case BPF_ALU | BPF_SUB | BPF_K: -+ case BPF_ALU | BPF_AND | BPF_K: -+ case BPF_ALU | BPF_OR | BPF_K: -+ case BPF_ALU | BPF_XOR | BPF_K: -+ case BPF_ALU | BPF_MUL | BPF_K: -+ case BPF_ALU | BPF_MOV | BPF_K: -+ case BPF_ALU | BPF_DIV | BPF_K: -+ case BPF_ALU | BPF_MOD | BPF_K: -+ *to++ = BPF_ALU32_IMM(BPF_MOV, BPF_REG_AX, imm_rnd ^ from->imm); -+ *to++ = BPF_ALU32_IMM(BPF_XOR, BPF_REG_AX, imm_rnd); -+ *to++ = BPF_ALU32_REG(from->code, from->dst_reg, BPF_REG_AX); -+ break; -+ -+ case BPF_ALU64 | BPF_ADD | BPF_K: -+ case BPF_ALU64 | BPF_SUB | BPF_K: -+ case BPF_ALU64 | BPF_AND | BPF_K: -+ case BPF_ALU64 | BPF_OR | BPF_K: -+ case BPF_ALU64 | BPF_XOR | BPF_K: -+ case BPF_ALU64 | BPF_MUL | BPF_K: -+ case BPF_ALU64 | BPF_MOV | BPF_K: -+ case BPF_ALU64 | BPF_DIV | BPF_K: -+ case BPF_ALU64 | BPF_MOD | BPF_K: -+ *to++ = BPF_ALU64_IMM(BPF_MOV, BPF_REG_AX, imm_rnd ^ from->imm); -+ *to++ = BPF_ALU64_IMM(BPF_XOR, BPF_REG_AX, imm_rnd); -+ *to++ = BPF_ALU64_REG(from->code, from->dst_reg, BPF_REG_AX); -+ break; -+ -+ case BPF_JMP | BPF_JEQ | BPF_K: -+ case BPF_JMP | BPF_JNE | BPF_K: -+ case BPF_JMP | BPF_JGT | BPF_K: -+ case BPF_JMP | BPF_JLT | BPF_K: -+ case BPF_JMP | BPF_JGE | BPF_K: -+ case BPF_JMP | BPF_JLE | BPF_K: -+ case BPF_JMP | BPF_JSGT | BPF_K: -+ case BPF_JMP | BPF_JSLT | BPF_K: -+ case BPF_JMP | BPF_JSGE | BPF_K: -+ case BPF_JMP | BPF_JSLE | BPF_K: -+ case BPF_JMP | BPF_JSET | BPF_K: -+ /* Accommodate for extra offset in case of a backjump. */ -+ off = from->off; -+ if (off < 0) -+ off -= 2; -+ *to++ = BPF_ALU64_IMM(BPF_MOV, BPF_REG_AX, imm_rnd ^ from->imm); -+ *to++ = BPF_ALU64_IMM(BPF_XOR, BPF_REG_AX, imm_rnd); -+ *to++ = BPF_JMP_REG(from->code, from->dst_reg, BPF_REG_AX, off); -+ break; -+ -+ case BPF_JMP32 | BPF_JEQ | BPF_K: -+ case BPF_JMP32 | BPF_JNE | BPF_K: -+ case BPF_JMP32 | BPF_JGT | BPF_K: -+ case BPF_JMP32 | BPF_JLT | BPF_K: -+ case BPF_JMP32 | BPF_JGE | BPF_K: -+ case BPF_JMP32 | BPF_JLE | BPF_K: -+ case BPF_JMP32 | BPF_JSGT | BPF_K: -+ case BPF_JMP32 | BPF_JSLT | BPF_K: -+ case BPF_JMP32 | BPF_JSGE | BPF_K: -+ case BPF_JMP32 | BPF_JSLE | BPF_K: -+ case BPF_JMP32 | BPF_JSET | BPF_K: -+ /* Accommodate for extra offset in case of a backjump. */ -+ off = from->off; -+ if (off < 0) -+ off -= 2; -+ *to++ = BPF_ALU32_IMM(BPF_MOV, BPF_REG_AX, imm_rnd ^ from->imm); -+ *to++ = BPF_ALU32_IMM(BPF_XOR, BPF_REG_AX, imm_rnd); -+ *to++ = BPF_JMP32_REG(from->code, from->dst_reg, BPF_REG_AX, -+ off); -+ break; -+ -+ case BPF_LD | BPF_IMM | BPF_DW: -+ *to++ = BPF_ALU64_IMM(BPF_MOV, BPF_REG_AX, imm_rnd ^ aux[1].imm); -+ *to++ = BPF_ALU64_IMM(BPF_XOR, BPF_REG_AX, imm_rnd); -+ *to++ = BPF_ALU64_IMM(BPF_LSH, BPF_REG_AX, 32); -+ *to++ = BPF_ALU64_REG(BPF_MOV, aux[0].dst_reg, BPF_REG_AX); -+ break; -+ case 0: /* Part 2 of BPF_LD | BPF_IMM | BPF_DW. */ -+ *to++ = BPF_ALU32_IMM(BPF_MOV, BPF_REG_AX, imm_rnd ^ aux[0].imm); -+ *to++ = BPF_ALU32_IMM(BPF_XOR, BPF_REG_AX, imm_rnd); -+ if (emit_zext) -+ *to++ = BPF_ZEXT_REG(BPF_REG_AX); -+ *to++ = BPF_ALU64_REG(BPF_OR, aux[0].dst_reg, BPF_REG_AX); -+ break; -+ -+ case BPF_ST | BPF_MEM | BPF_DW: -+ case BPF_ST | BPF_MEM | BPF_W: -+ case BPF_ST | BPF_MEM | BPF_H: -+ case BPF_ST | BPF_MEM | BPF_B: -+ *to++ = BPF_ALU64_IMM(BPF_MOV, BPF_REG_AX, imm_rnd ^ from->imm); -+ *to++ = BPF_ALU64_IMM(BPF_XOR, BPF_REG_AX, imm_rnd); -+ *to++ = BPF_STX_MEM(from->code, from->dst_reg, BPF_REG_AX, from->off); -+ break; -+ } -+out: -+ return to - to_buff; -+} -+ -+static struct bpf_prog *bpf_prog_clone_create(struct bpf_prog *fp_other, -+ gfp_t gfp_extra_flags) -+{ -+ gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO | gfp_extra_flags; -+ struct bpf_prog *fp; -+ -+ fp = __vmalloc(fp_other->pages * PAGE_SIZE, gfp_flags, PAGE_KERNEL); -+ if (fp != NULL) { -+ /* aux->prog still points to the fp_other one, so -+ * when promoting the clone to the real program, -+ * this still needs to be adapted. -+ */ -+ memcpy(fp, fp_other, fp_other->pages * PAGE_SIZE); -+ } -+ -+ return fp; -+} -+ -+static void bpf_prog_clone_free(struct bpf_prog *fp) -+{ -+ /* aux was stolen by the other clone, so we cannot free -+ * it from this path! It will be freed eventually by the -+ * other program on release. -+ * -+ * At this point, we don't need a deferred release since -+ * clone is guaranteed to not be locked. -+ */ -+ fp->aux = NULL; -+ __bpf_prog_free(fp); -+} -+ -+void bpf_jit_prog_release_other(struct bpf_prog *fp, struct bpf_prog *fp_other) -+{ -+ /* We have to repoint aux->prog to self, as we don't -+ * know whether fp here is the clone or the original. -+ */ -+ fp->aux->prog = fp; -+ bpf_prog_clone_free(fp_other); -+} -+ -+struct bpf_prog *bpf_jit_blind_constants(struct bpf_prog *prog) -+{ -+ struct bpf_insn insn_buff[16], aux[2]; -+ struct bpf_prog *clone, *tmp; -+ int insn_delta, insn_cnt; -+ struct bpf_insn *insn; -+ int i, rewritten; -+ -+ if (!bpf_jit_blinding_enabled(prog) || prog->blinded) -+ return prog; -+ -+ clone = bpf_prog_clone_create(prog, GFP_USER); -+ if (!clone) -+ return ERR_PTR(-ENOMEM); -+ -+ insn_cnt = clone->len; -+ insn = clone->insnsi; -+ -+ for (i = 0; i < insn_cnt; i++, insn++) { -+ /* We temporarily need to hold the original ld64 insn -+ * so that we can still access the first part in the -+ * second blinding run. -+ */ -+ if (insn[0].code == (BPF_LD | BPF_IMM | BPF_DW) && -+ insn[1].code == 0) -+ memcpy(aux, insn, sizeof(aux)); -+ -+ rewritten = bpf_jit_blind_insn(insn, aux, insn_buff, -+ clone->aux->verifier_zext); -+ if (!rewritten) -+ continue; -+ -+ tmp = bpf_patch_insn_single(clone, i, insn_buff, rewritten); -+ if (IS_ERR(tmp)) { -+ /* Patching may have repointed aux->prog during -+ * realloc from the original one, so we need to -+ * fix it up here on error. -+ */ -+ bpf_jit_prog_release_other(prog, clone); -+ return tmp; -+ } -+ -+ clone = tmp; -+ insn_delta = rewritten - 1; -+ -+ /* Walk new program and skip insns we just inserted. */ -+ insn = clone->insnsi + i + insn_delta; -+ insn_cnt += insn_delta; -+ i += insn_delta; -+ } -+ -+ clone->blinded = 1; -+ return clone; - } - #endif /* CONFIG_BPF_JIT */ - - /* Base function for offset calculation. Needs to go into .text section, - * therefore keeping it non-static as well; will also be used by JITs -- * anyway later on, so do not let the compiler omit it. -+ * anyway later on, so do not let the compiler omit it. This also needs -+ * to go into kallsyms for correlation from e.g. bpftool, so naming -+ * must not change. - */ - noinline u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) - { -@@ -185,157 +1132,243 @@ noinline u64 __bpf_call_base(u64 r1, u64 - } - EXPORT_SYMBOL_GPL(__bpf_call_base); - -+/* All UAPI available opcodes. */ -+#define BPF_INSN_MAP(INSN_2, INSN_3) \ -+ /* 32 bit ALU operations. */ \ -+ /* Register based. */ \ -+ INSN_3(ALU, ADD, X), \ -+ INSN_3(ALU, SUB, X), \ -+ INSN_3(ALU, AND, X), \ -+ INSN_3(ALU, OR, X), \ -+ INSN_3(ALU, LSH, X), \ -+ INSN_3(ALU, RSH, X), \ -+ INSN_3(ALU, XOR, X), \ -+ INSN_3(ALU, MUL, X), \ -+ INSN_3(ALU, MOV, X), \ -+ INSN_3(ALU, ARSH, X), \ -+ INSN_3(ALU, DIV, X), \ -+ INSN_3(ALU, MOD, X), \ -+ INSN_2(ALU, NEG), \ -+ INSN_3(ALU, END, TO_BE), \ -+ INSN_3(ALU, END, TO_LE), \ -+ /* Immediate based. */ \ -+ INSN_3(ALU, ADD, K), \ -+ INSN_3(ALU, SUB, K), \ -+ INSN_3(ALU, AND, K), \ -+ INSN_3(ALU, OR, K), \ -+ INSN_3(ALU, LSH, K), \ -+ INSN_3(ALU, RSH, K), \ -+ INSN_3(ALU, XOR, K), \ -+ INSN_3(ALU, MUL, K), \ -+ INSN_3(ALU, MOV, K), \ -+ INSN_3(ALU, ARSH, K), \ -+ INSN_3(ALU, DIV, K), \ -+ INSN_3(ALU, MOD, K), \ -+ /* 64 bit ALU operations. */ \ -+ /* Register based. */ \ -+ INSN_3(ALU64, ADD, X), \ -+ INSN_3(ALU64, SUB, X), \ -+ INSN_3(ALU64, AND, X), \ -+ INSN_3(ALU64, OR, X), \ -+ INSN_3(ALU64, LSH, X), \ -+ INSN_3(ALU64, RSH, X), \ -+ INSN_3(ALU64, XOR, X), \ -+ INSN_3(ALU64, MUL, X), \ -+ INSN_3(ALU64, MOV, X), \ -+ INSN_3(ALU64, ARSH, X), \ -+ INSN_3(ALU64, DIV, X), \ -+ INSN_3(ALU64, MOD, X), \ -+ INSN_2(ALU64, NEG), \ -+ /* Immediate based. */ \ -+ INSN_3(ALU64, ADD, K), \ -+ INSN_3(ALU64, SUB, K), \ -+ INSN_3(ALU64, AND, K), \ -+ INSN_3(ALU64, OR, K), \ -+ INSN_3(ALU64, LSH, K), \ -+ INSN_3(ALU64, RSH, K), \ -+ INSN_3(ALU64, XOR, K), \ -+ INSN_3(ALU64, MUL, K), \ -+ INSN_3(ALU64, MOV, K), \ -+ INSN_3(ALU64, ARSH, K), \ -+ INSN_3(ALU64, DIV, K), \ -+ INSN_3(ALU64, MOD, K), \ -+ /* Call instruction. */ \ -+ INSN_2(JMP, CALL), \ -+ /* Exit instruction. */ \ -+ INSN_2(JMP, EXIT), \ -+ /* 32-bit Jump instructions. */ \ -+ /* Register based. */ \ -+ INSN_3(JMP32, JEQ, X), \ -+ INSN_3(JMP32, JNE, X), \ -+ INSN_3(JMP32, JGT, X), \ -+ INSN_3(JMP32, JLT, X), \ -+ INSN_3(JMP32, JGE, X), \ -+ INSN_3(JMP32, JLE, X), \ -+ INSN_3(JMP32, JSGT, X), \ -+ INSN_3(JMP32, JSLT, X), \ -+ INSN_3(JMP32, JSGE, X), \ -+ INSN_3(JMP32, JSLE, X), \ -+ INSN_3(JMP32, JSET, X), \ -+ /* Immediate based. */ \ -+ INSN_3(JMP32, JEQ, K), \ -+ INSN_3(JMP32, JNE, K), \ -+ INSN_3(JMP32, JGT, K), \ -+ INSN_3(JMP32, JLT, K), \ -+ INSN_3(JMP32, JGE, K), \ -+ INSN_3(JMP32, JLE, K), \ -+ INSN_3(JMP32, JSGT, K), \ -+ INSN_3(JMP32, JSLT, K), \ -+ INSN_3(JMP32, JSGE, K), \ -+ INSN_3(JMP32, JSLE, K), \ -+ INSN_3(JMP32, JSET, K), \ -+ /* Jump instructions. */ \ -+ /* Register based. */ \ -+ INSN_3(JMP, JEQ, X), \ -+ INSN_3(JMP, JNE, X), \ -+ INSN_3(JMP, JGT, X), \ -+ INSN_3(JMP, JLT, X), \ -+ INSN_3(JMP, JGE, X), \ -+ INSN_3(JMP, JLE, X), \ -+ INSN_3(JMP, JSGT, X), \ -+ INSN_3(JMP, JSLT, X), \ -+ INSN_3(JMP, JSGE, X), \ -+ INSN_3(JMP, JSLE, X), \ -+ INSN_3(JMP, JSET, X), \ -+ /* Immediate based. */ \ -+ INSN_3(JMP, JEQ, K), \ -+ INSN_3(JMP, JNE, K), \ -+ INSN_3(JMP, JGT, K), \ -+ INSN_3(JMP, JLT, K), \ -+ INSN_3(JMP, JGE, K), \ -+ INSN_3(JMP, JLE, K), \ -+ INSN_3(JMP, JSGT, K), \ -+ INSN_3(JMP, JSLT, K), \ -+ INSN_3(JMP, JSGE, K), \ -+ INSN_3(JMP, JSLE, K), \ -+ INSN_3(JMP, JSET, K), \ -+ INSN_2(JMP, JA), \ -+ /* Store instructions. */ \ -+ /* Register based. */ \ -+ INSN_3(STX, MEM, B), \ -+ INSN_3(STX, MEM, H), \ -+ INSN_3(STX, MEM, W), \ -+ INSN_3(STX, MEM, DW), \ -+ INSN_3(STX, XADD, W), \ -+ INSN_3(STX, XADD, DW), \ -+ /* Immediate based. */ \ -+ INSN_3(ST, MEM, B), \ -+ INSN_3(ST, MEM, H), \ -+ INSN_3(ST, MEM, W), \ -+ INSN_3(ST, MEM, DW), \ -+ /* Load instructions. */ \ -+ /* Register based. */ \ -+ INSN_3(LDX, MEM, B), \ -+ INSN_3(LDX, MEM, H), \ -+ INSN_3(LDX, MEM, W), \ -+ INSN_3(LDX, MEM, DW), \ -+ /* Immediate based. */ \ -+ INSN_3(LD, IMM, DW) -+ -+bool bpf_opcode_in_insntable(u8 code) -+{ -+#define BPF_INSN_2_TBL(x, y) [BPF_##x | BPF_##y] = true -+#define BPF_INSN_3_TBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = true -+ static const bool public_insntable[256] = { -+ [0 ... 255] = false, -+ /* Now overwrite non-defaults ... */ -+ BPF_INSN_MAP(BPF_INSN_2_TBL, BPF_INSN_3_TBL), -+ /* UAPI exposed, but rewritten opcodes. cBPF carry-over. */ -+ [BPF_LD | BPF_ABS | BPF_B] = true, -+ [BPF_LD | BPF_ABS | BPF_H] = true, -+ [BPF_LD | BPF_ABS | BPF_W] = true, -+ [BPF_LD | BPF_IND | BPF_B] = true, -+ [BPF_LD | BPF_IND | BPF_H] = true, -+ [BPF_LD | BPF_IND | BPF_W] = true, -+ }; -+#undef BPF_INSN_3_TBL -+#undef BPF_INSN_2_TBL -+ return public_insntable[code]; -+} -+ -+#ifndef CONFIG_BPF_JIT_ALWAYS_ON - /** - * __bpf_prog_run - run eBPF program on a given context -- * @ctx: is the data we are operating on -+ * @regs: is the array of MAX_BPF_EXT_REG eBPF pseudo-registers - * @insn: is the array of eBPF instructions -+ * @stack: is the eBPF storage stack - * - * Decode and execute eBPF instructions. - */ --static unsigned int __bpf_prog_run(void *ctx, const struct bpf_insn *insn) -+static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn, u64 *stack) - { -- u64 stack[MAX_BPF_STACK / sizeof(u64)]; -- u64 regs[MAX_BPF_REG], tmp; -- static const void *jumptable[256] = { -+#define BPF_INSN_2_LBL(x, y) [BPF_##x | BPF_##y] = &&x##_##y -+#define BPF_INSN_3_LBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = &&x##_##y##_##z -+ static const void * const jumptable[256] = { - [0 ... 255] = &&default_label, - /* Now overwrite non-defaults ... */ -- /* 32 bit ALU operations */ -- [BPF_ALU | BPF_ADD | BPF_X] = &&ALU_ADD_X, -- [BPF_ALU | BPF_ADD | BPF_K] = &&ALU_ADD_K, -- [BPF_ALU | BPF_SUB | BPF_X] = &&ALU_SUB_X, -- [BPF_ALU | BPF_SUB | BPF_K] = &&ALU_SUB_K, -- [BPF_ALU | BPF_AND | BPF_X] = &&ALU_AND_X, -- [BPF_ALU | BPF_AND | BPF_K] = &&ALU_AND_K, -- [BPF_ALU | BPF_OR | BPF_X] = &&ALU_OR_X, -- [BPF_ALU | BPF_OR | BPF_K] = &&ALU_OR_K, -- [BPF_ALU | BPF_LSH | BPF_X] = &&ALU_LSH_X, -- [BPF_ALU | BPF_LSH | BPF_K] = &&ALU_LSH_K, -- [BPF_ALU | BPF_RSH | BPF_X] = &&ALU_RSH_X, -- [BPF_ALU | BPF_RSH | BPF_K] = &&ALU_RSH_K, -- [BPF_ALU | BPF_XOR | BPF_X] = &&ALU_XOR_X, -- [BPF_ALU | BPF_XOR | BPF_K] = &&ALU_XOR_K, -- [BPF_ALU | BPF_MUL | BPF_X] = &&ALU_MUL_X, -- [BPF_ALU | BPF_MUL | BPF_K] = &&ALU_MUL_K, -- [BPF_ALU | BPF_MOV | BPF_X] = &&ALU_MOV_X, -- [BPF_ALU | BPF_MOV | BPF_K] = &&ALU_MOV_K, -- [BPF_ALU | BPF_DIV | BPF_X] = &&ALU_DIV_X, -- [BPF_ALU | BPF_DIV | BPF_K] = &&ALU_DIV_K, -- [BPF_ALU | BPF_MOD | BPF_X] = &&ALU_MOD_X, -- [BPF_ALU | BPF_MOD | BPF_K] = &&ALU_MOD_K, -- [BPF_ALU | BPF_NEG] = &&ALU_NEG, -- [BPF_ALU | BPF_END | BPF_TO_BE] = &&ALU_END_TO_BE, -- [BPF_ALU | BPF_END | BPF_TO_LE] = &&ALU_END_TO_LE, -- /* 64 bit ALU operations */ -- [BPF_ALU64 | BPF_ADD | BPF_X] = &&ALU64_ADD_X, -- [BPF_ALU64 | BPF_ADD | BPF_K] = &&ALU64_ADD_K, -- [BPF_ALU64 | BPF_SUB | BPF_X] = &&ALU64_SUB_X, -- [BPF_ALU64 | BPF_SUB | BPF_K] = &&ALU64_SUB_K, -- [BPF_ALU64 | BPF_AND | BPF_X] = &&ALU64_AND_X, -- [BPF_ALU64 | BPF_AND | BPF_K] = &&ALU64_AND_K, -- [BPF_ALU64 | BPF_OR | BPF_X] = &&ALU64_OR_X, -- [BPF_ALU64 | BPF_OR | BPF_K] = &&ALU64_OR_K, -- [BPF_ALU64 | BPF_LSH | BPF_X] = &&ALU64_LSH_X, -- [BPF_ALU64 | BPF_LSH | BPF_K] = &&ALU64_LSH_K, -- [BPF_ALU64 | BPF_RSH | BPF_X] = &&ALU64_RSH_X, -- [BPF_ALU64 | BPF_RSH | BPF_K] = &&ALU64_RSH_K, -- [BPF_ALU64 | BPF_XOR | BPF_X] = &&ALU64_XOR_X, -- [BPF_ALU64 | BPF_XOR | BPF_K] = &&ALU64_XOR_K, -- [BPF_ALU64 | BPF_MUL | BPF_X] = &&ALU64_MUL_X, -- [BPF_ALU64 | BPF_MUL | BPF_K] = &&ALU64_MUL_K, -- [BPF_ALU64 | BPF_MOV | BPF_X] = &&ALU64_MOV_X, -- [BPF_ALU64 | BPF_MOV | BPF_K] = &&ALU64_MOV_K, -- [BPF_ALU64 | BPF_ARSH | BPF_X] = &&ALU64_ARSH_X, -- [BPF_ALU64 | BPF_ARSH | BPF_K] = &&ALU64_ARSH_K, -- [BPF_ALU64 | BPF_DIV | BPF_X] = &&ALU64_DIV_X, -- [BPF_ALU64 | BPF_DIV | BPF_K] = &&ALU64_DIV_K, -- [BPF_ALU64 | BPF_MOD | BPF_X] = &&ALU64_MOD_X, -- [BPF_ALU64 | BPF_MOD | BPF_K] = &&ALU64_MOD_K, -- [BPF_ALU64 | BPF_NEG] = &&ALU64_NEG, -- /* Call instruction */ -- [BPF_JMP | BPF_CALL] = &&JMP_CALL, -- [BPF_JMP | BPF_CALL | BPF_X] = &&JMP_TAIL_CALL, -- /* Jumps */ -- [BPF_JMP | BPF_JA] = &&JMP_JA, -- [BPF_JMP | BPF_JEQ | BPF_X] = &&JMP_JEQ_X, -- [BPF_JMP | BPF_JEQ | BPF_K] = &&JMP_JEQ_K, -- [BPF_JMP | BPF_JNE | BPF_X] = &&JMP_JNE_X, -- [BPF_JMP | BPF_JNE | BPF_K] = &&JMP_JNE_K, -- [BPF_JMP | BPF_JGT | BPF_X] = &&JMP_JGT_X, -- [BPF_JMP | BPF_JGT | BPF_K] = &&JMP_JGT_K, -- [BPF_JMP | BPF_JGE | BPF_X] = &&JMP_JGE_X, -- [BPF_JMP | BPF_JGE | BPF_K] = &&JMP_JGE_K, -- [BPF_JMP | BPF_JSGT | BPF_X] = &&JMP_JSGT_X, -- [BPF_JMP | BPF_JSGT | BPF_K] = &&JMP_JSGT_K, -- [BPF_JMP | BPF_JSGE | BPF_X] = &&JMP_JSGE_X, -- [BPF_JMP | BPF_JSGE | BPF_K] = &&JMP_JSGE_K, -- [BPF_JMP | BPF_JSET | BPF_X] = &&JMP_JSET_X, -- [BPF_JMP | BPF_JSET | BPF_K] = &&JMP_JSET_K, -- /* Program return */ -- [BPF_JMP | BPF_EXIT] = &&JMP_EXIT, -- /* Store instructions */ -- [BPF_STX | BPF_MEM | BPF_B] = &&STX_MEM_B, -- [BPF_STX | BPF_MEM | BPF_H] = &&STX_MEM_H, -- [BPF_STX | BPF_MEM | BPF_W] = &&STX_MEM_W, -- [BPF_STX | BPF_MEM | BPF_DW] = &&STX_MEM_DW, -- [BPF_STX | BPF_XADD | BPF_W] = &&STX_XADD_W, -- [BPF_STX | BPF_XADD | BPF_DW] = &&STX_XADD_DW, -- [BPF_ST | BPF_MEM | BPF_B] = &&ST_MEM_B, -- [BPF_ST | BPF_MEM | BPF_H] = &&ST_MEM_H, -- [BPF_ST | BPF_MEM | BPF_W] = &&ST_MEM_W, -- [BPF_ST | BPF_MEM | BPF_DW] = &&ST_MEM_DW, -- /* Load instructions */ -- [BPF_LDX | BPF_MEM | BPF_B] = &&LDX_MEM_B, -- [BPF_LDX | BPF_MEM | BPF_H] = &&LDX_MEM_H, -- [BPF_LDX | BPF_MEM | BPF_W] = &&LDX_MEM_W, -- [BPF_LDX | BPF_MEM | BPF_DW] = &&LDX_MEM_DW, -- [BPF_LD | BPF_ABS | BPF_W] = &&LD_ABS_W, -- [BPF_LD | BPF_ABS | BPF_H] = &&LD_ABS_H, -- [BPF_LD | BPF_ABS | BPF_B] = &&LD_ABS_B, -- [BPF_LD | BPF_IND | BPF_W] = &&LD_IND_W, -- [BPF_LD | BPF_IND | BPF_H] = &&LD_IND_H, -- [BPF_LD | BPF_IND | BPF_B] = &&LD_IND_B, -- [BPF_LD | BPF_IMM | BPF_DW] = &&LD_IMM_DW, -+ BPF_INSN_MAP(BPF_INSN_2_LBL, BPF_INSN_3_LBL), -+ /* Non-UAPI available opcodes. */ -+ [BPF_JMP | BPF_CALL_ARGS] = &&JMP_CALL_ARGS, -+ [BPF_JMP | BPF_TAIL_CALL] = &&JMP_TAIL_CALL, - }; -+#undef BPF_INSN_3_LBL -+#undef BPF_INSN_2_LBL - u32 tail_call_cnt = 0; -- void *ptr; -- int off; - - #define CONT ({ insn++; goto select_insn; }) - #define CONT_JMP ({ insn++; goto select_insn; }) - -- FP = (u64) (unsigned long) &stack[ARRAY_SIZE(stack)]; -- ARG1 = (u64) (unsigned long) ctx; -- -- /* Registers used in classic BPF programs need to be reset first. */ -- regs[BPF_REG_A] = 0; -- regs[BPF_REG_X] = 0; -- - select_insn: - goto *jumptable[insn->code]; - -- /* ALU */ --#define ALU(OPCODE, OP) \ -- ALU64_##OPCODE##_X: \ -- DST = DST OP SRC; \ -- CONT; \ -- ALU_##OPCODE##_X: \ -- DST = (u32) DST OP (u32) SRC; \ -- CONT; \ -- ALU64_##OPCODE##_K: \ -- DST = DST OP IMM; \ -- CONT; \ -- ALU_##OPCODE##_K: \ -- DST = (u32) DST OP (u32) IMM; \ -+ /* Explicitly mask the register-based shift amounts with 63 or 31 -+ * to avoid undefined behavior. Normally this won't affect the -+ * generated code, for example, in case of native 64 bit archs such -+ * as x86-64 or arm64, the compiler is optimizing the AND away for -+ * the interpreter. In case of JITs, each of the JIT backends compiles -+ * the BPF shift operations to machine instructions which produce -+ * implementation-defined results in such a case; the resulting -+ * contents of the register may be arbitrary, but program behaviour -+ * as a whole remains defined. In other words, in case of JIT backends, -+ * the AND must /not/ be added to the emitted LSH/RSH/ARSH translation. -+ */ -+ /* ALU (shifts) */ -+#define SHT(OPCODE, OP) \ -+ ALU64_##OPCODE##_X: \ -+ DST = DST OP (SRC & 63); \ -+ CONT; \ -+ ALU_##OPCODE##_X: \ -+ DST = (u32) DST OP ((u32) SRC & 31); \ -+ CONT; \ -+ ALU64_##OPCODE##_K: \ -+ DST = DST OP IMM; \ -+ CONT; \ -+ ALU_##OPCODE##_K: \ -+ DST = (u32) DST OP (u32) IMM; \ -+ CONT; -+ /* ALU (rest) */ -+#define ALU(OPCODE, OP) \ -+ ALU64_##OPCODE##_X: \ -+ DST = DST OP SRC; \ -+ CONT; \ -+ ALU_##OPCODE##_X: \ -+ DST = (u32) DST OP (u32) SRC; \ -+ CONT; \ -+ ALU64_##OPCODE##_K: \ -+ DST = DST OP IMM; \ -+ CONT; \ -+ ALU_##OPCODE##_K: \ -+ DST = (u32) DST OP (u32) IMM; \ - CONT; -- - ALU(ADD, +) - ALU(SUB, -) - ALU(AND, &) - ALU(OR, |) -- ALU(LSH, <<) -- ALU(RSH, >>) - ALU(XOR, ^) - ALU(MUL, *) -+ SHT(LSH, <<) -+ SHT(RSH, >>) -+#undef SHT - #undef ALU - ALU_NEG: - DST = (u32) -DST; -@@ -359,51 +1392,49 @@ select_insn: - DST = (u64) (u32) insn[0].imm | ((u64) (u32) insn[1].imm) << 32; - insn++; - CONT; -+ ALU_ARSH_X: -+ DST = (u64) (u32) (((s32) DST) >> (SRC & 31)); -+ CONT; -+ ALU_ARSH_K: -+ DST = (u64) (u32) (((s32) DST) >> IMM); -+ CONT; - ALU64_ARSH_X: -- (*(s64 *) &DST) >>= SRC; -+ (*(s64 *) &DST) >>= (SRC & 63); - CONT; - ALU64_ARSH_K: - (*(s64 *) &DST) >>= IMM; - CONT; - ALU64_MOD_X: -- if (unlikely(SRC == 0)) -- return 0; -- div64_u64_rem(DST, SRC, &tmp); -- DST = tmp; -+ div64_u64_rem(DST, SRC, &AX); -+ DST = AX; - CONT; - ALU_MOD_X: -- if (unlikely(SRC == 0)) -- return 0; -- tmp = (u32) DST; -- DST = do_div(tmp, (u32) SRC); -+ AX = (u32) DST; -+ DST = do_div(AX, (u32) SRC); - CONT; - ALU64_MOD_K: -- div64_u64_rem(DST, IMM, &tmp); -- DST = tmp; -+ div64_u64_rem(DST, IMM, &AX); -+ DST = AX; - CONT; - ALU_MOD_K: -- tmp = (u32) DST; -- DST = do_div(tmp, (u32) IMM); -+ AX = (u32) DST; -+ DST = do_div(AX, (u32) IMM); - CONT; - ALU64_DIV_X: -- if (unlikely(SRC == 0)) -- return 0; - DST = div64_u64(DST, SRC); - CONT; - ALU_DIV_X: -- if (unlikely(SRC == 0)) -- return 0; -- tmp = (u32) DST; -- do_div(tmp, (u32) SRC); -- DST = (u32) tmp; -+ AX = (u32) DST; -+ do_div(AX, (u32) SRC); -+ DST = (u32) AX; - CONT; - ALU64_DIV_K: - DST = div64_u64(DST, IMM); - CONT; - ALU_DIV_K: -- tmp = (u32) DST; -- do_div(tmp, (u32) IMM); -- DST = (u32) tmp; -+ AX = (u32) DST; -+ do_div(AX, (u32) IMM); -+ DST = (u32) AX; - CONT; - ALU_END_TO_BE: - switch (IMM) { -@@ -442,22 +1473,28 @@ select_insn: - BPF_R4, BPF_R5); - CONT; - -+ JMP_CALL_ARGS: -+ BPF_R0 = (__bpf_call_base_args + insn->imm)(BPF_R1, BPF_R2, -+ BPF_R3, BPF_R4, -+ BPF_R5, -+ insn + insn->off + 1); -+ CONT; -+ - JMP_TAIL_CALL: { - struct bpf_map *map = (struct bpf_map *) (unsigned long) BPF_R2; - struct bpf_array *array = container_of(map, struct bpf_array, map); - struct bpf_prog *prog; -- u64 index = BPF_R3; -+ u32 index = BPF_R3; - - if (unlikely(index >= array->map.max_entries)) - goto out; -- - if (unlikely(tail_call_cnt > MAX_TAIL_CALL_CNT)) - goto out; - - tail_call_cnt++; - - prog = READ_ONCE(array->ptrs[index]); -- if (unlikely(!prog)) -+ if (!prog) - goto out; - - /* ARG1 at this point is guaranteed to point to CTX from -@@ -470,97 +1507,49 @@ select_insn: - out: - CONT; - } -- /* JMP */ - JMP_JA: - insn += insn->off; - CONT; -- JMP_JEQ_X: -- if (DST == SRC) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JEQ_K: -- if (DST == IMM) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JNE_X: -- if (DST != SRC) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JNE_K: -- if (DST != IMM) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JGT_X: -- if (DST > SRC) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JGT_K: -- if (DST > IMM) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JGE_X: -- if (DST >= SRC) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JGE_K: -- if (DST >= IMM) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JSGT_X: -- if (((s64) DST) > ((s64) SRC)) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JSGT_K: -- if (((s64) DST) > ((s64) IMM)) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JSGE_X: -- if (((s64) DST) >= ((s64) SRC)) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JSGE_K: -- if (((s64) DST) >= ((s64) IMM)) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JSET_X: -- if (DST & SRC) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; -- JMP_JSET_K: -- if (DST & IMM) { -- insn += insn->off; -- CONT_JMP; -- } -- CONT; - JMP_EXIT: - return BPF_R0; -- -+ /* JMP */ -+#define COND_JMP(SIGN, OPCODE, CMP_OP) \ -+ JMP_##OPCODE##_X: \ -+ if ((SIGN##64) DST CMP_OP (SIGN##64) SRC) { \ -+ insn += insn->off; \ -+ CONT_JMP; \ -+ } \ -+ CONT; \ -+ JMP32_##OPCODE##_X: \ -+ if ((SIGN##32) DST CMP_OP (SIGN##32) SRC) { \ -+ insn += insn->off; \ -+ CONT_JMP; \ -+ } \ -+ CONT; \ -+ JMP_##OPCODE##_K: \ -+ if ((SIGN##64) DST CMP_OP (SIGN##64) IMM) { \ -+ insn += insn->off; \ -+ CONT_JMP; \ -+ } \ -+ CONT; \ -+ JMP32_##OPCODE##_K: \ -+ if ((SIGN##32) DST CMP_OP (SIGN##32) IMM) { \ -+ insn += insn->off; \ -+ CONT_JMP; \ -+ } \ -+ CONT; -+ COND_JMP(u, JEQ, ==) -+ COND_JMP(u, JNE, !=) -+ COND_JMP(u, JGT, >) -+ COND_JMP(u, JLT, <) -+ COND_JMP(u, JGE, >=) -+ COND_JMP(u, JLE, <=) -+ COND_JMP(u, JSET, &) -+ COND_JMP(s, JSGT, >) -+ COND_JMP(s, JSLT, <) -+ COND_JMP(s, JSGE, >=) -+ COND_JMP(s, JSLE, <=) -+#undef COND_JMP - /* STX and ST and LDX*/ - #define LDST(SIZEOP, SIZE) \ - STX_MEM_##SIZEOP: \ -@@ -586,77 +1575,108 @@ out: - atomic64_add((u64) SRC, (atomic64_t *)(unsigned long) - (DST + insn->off)); - CONT; -- LD_ABS_W: /* BPF_R0 = ntohl(*(u32 *) (skb->data + imm32)) */ -- off = IMM; --load_word: -- /* BPF_LD + BPD_ABS and BPF_LD + BPF_IND insns are -- * only appearing in the programs where ctx == -- * skb. All programs keep 'ctx' in regs[BPF_REG_CTX] -- * == BPF_R6, bpf_convert_filter() saves it in BPF_R6, -- * internal BPF verifier will check that BPF_R6 == -- * ctx. -- * -- * BPF_ABS and BPF_IND are wrappers of function calls, -- * so they scratch BPF_R1-BPF_R5 registers, preserve -- * BPF_R6-BPF_R9, and store return value into BPF_R0. -- * -- * Implicit input: -- * ctx == skb == BPF_R6 == CTX -- * -- * Explicit input: -- * SRC == any register -- * IMM == 32-bit immediate -+ -+ default_label: -+ /* If we ever reach this, we have a bug somewhere. Die hard here -+ * instead of just returning 0; we could be somewhere in a subprog, -+ * so execution could continue otherwise which we do /not/ want. - * -- * Output: -- * BPF_R0 - 8/16/32-bit skb data converted to cpu endianness -+ * Note, verifier whitelists all opcodes in bpf_opcode_in_insntable(). - */ -+ pr_warn("BPF interpreter: unknown opcode %02x\n", insn->code); -+ BUG_ON(1); -+ return 0; -+} - -- ptr = bpf_load_pointer((struct sk_buff *) (unsigned long) CTX, off, 4, &tmp); -- if (likely(ptr != NULL)) { -- BPF_R0 = get_unaligned_be32(ptr); -- CONT; -- } -+#define PROG_NAME(stack_size) __bpf_prog_run##stack_size -+#define DEFINE_BPF_PROG_RUN(stack_size) \ -+static unsigned int PROG_NAME(stack_size)(const void *ctx, const struct bpf_insn *insn) \ -+{ \ -+ u64 stack[stack_size / sizeof(u64)]; \ -+ u64 regs[MAX_BPF_EXT_REG]; \ -+\ -+ FP = (u64) (unsigned long) &stack[ARRAY_SIZE(stack)]; \ -+ ARG1 = (u64) (unsigned long) ctx; \ -+ return ___bpf_prog_run(regs, insn, stack); \ -+} - -- return 0; -- LD_ABS_H: /* BPF_R0 = ntohs(*(u16 *) (skb->data + imm32)) */ -- off = IMM; --load_half: -- ptr = bpf_load_pointer((struct sk_buff *) (unsigned long) CTX, off, 2, &tmp); -- if (likely(ptr != NULL)) { -- BPF_R0 = get_unaligned_be16(ptr); -- CONT; -- } -+#define PROG_NAME_ARGS(stack_size) __bpf_prog_run_args##stack_size -+#define DEFINE_BPF_PROG_RUN_ARGS(stack_size) \ -+static u64 PROG_NAME_ARGS(stack_size)(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5, \ -+ const struct bpf_insn *insn) \ -+{ \ -+ u64 stack[stack_size / sizeof(u64)]; \ -+ u64 regs[MAX_BPF_EXT_REG]; \ -+\ -+ FP = (u64) (unsigned long) &stack[ARRAY_SIZE(stack)]; \ -+ BPF_R1 = r1; \ -+ BPF_R2 = r2; \ -+ BPF_R3 = r3; \ -+ BPF_R4 = r4; \ -+ BPF_R5 = r5; \ -+ return ___bpf_prog_run(regs, insn, stack); \ -+} - -- return 0; -- LD_ABS_B: /* BPF_R0 = *(u8 *) (skb->data + imm32) */ -- off = IMM; --load_byte: -- ptr = bpf_load_pointer((struct sk_buff *) (unsigned long) CTX, off, 1, &tmp); -- if (likely(ptr != NULL)) { -- BPF_R0 = *(u8 *)ptr; -- CONT; -- } -+#define EVAL1(FN, X) FN(X) -+#define EVAL2(FN, X, Y...) FN(X) EVAL1(FN, Y) -+#define EVAL3(FN, X, Y...) FN(X) EVAL2(FN, Y) -+#define EVAL4(FN, X, Y...) FN(X) EVAL3(FN, Y) -+#define EVAL5(FN, X, Y...) FN(X) EVAL4(FN, Y) -+#define EVAL6(FN, X, Y...) FN(X) EVAL5(FN, Y) -+ -+EVAL6(DEFINE_BPF_PROG_RUN, 32, 64, 96, 128, 160, 192); -+EVAL6(DEFINE_BPF_PROG_RUN, 224, 256, 288, 320, 352, 384); -+EVAL4(DEFINE_BPF_PROG_RUN, 416, 448, 480, 512); -+ -+EVAL6(DEFINE_BPF_PROG_RUN_ARGS, 32, 64, 96, 128, 160, 192); -+EVAL6(DEFINE_BPF_PROG_RUN_ARGS, 224, 256, 288, 320, 352, 384); -+EVAL4(DEFINE_BPF_PROG_RUN_ARGS, 416, 448, 480, 512); -+ -+#define PROG_NAME_LIST(stack_size) PROG_NAME(stack_size), -+ -+static unsigned int (*interpreters[])(const void *ctx, -+ const struct bpf_insn *insn) = { -+EVAL6(PROG_NAME_LIST, 32, 64, 96, 128, 160, 192) -+EVAL6(PROG_NAME_LIST, 224, 256, 288, 320, 352, 384) -+EVAL4(PROG_NAME_LIST, 416, 448, 480, 512) -+}; -+#undef PROG_NAME_LIST -+#define PROG_NAME_LIST(stack_size) PROG_NAME_ARGS(stack_size), -+static u64 (*interpreters_args[])(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5, -+ const struct bpf_insn *insn) = { -+EVAL6(PROG_NAME_LIST, 32, 64, 96, 128, 160, 192) -+EVAL6(PROG_NAME_LIST, 224, 256, 288, 320, 352, 384) -+EVAL4(PROG_NAME_LIST, 416, 448, 480, 512) -+}; -+#undef PROG_NAME_LIST - -- return 0; -- LD_IND_W: /* BPF_R0 = ntohl(*(u32 *) (skb->data + src_reg + imm32)) */ -- off = IMM + SRC; -- goto load_word; -- LD_IND_H: /* BPF_R0 = ntohs(*(u16 *) (skb->data + src_reg + imm32)) */ -- off = IMM + SRC; -- goto load_half; -- LD_IND_B: /* BPF_R0 = *(u8 *) (skb->data + src_reg + imm32) */ -- off = IMM + SRC; -- goto load_byte; -+void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth) -+{ -+ stack_depth = max_t(u32, stack_depth, 1); -+ insn->off = (s16) insn->imm; -+ insn->imm = interpreters_args[(round_up(stack_depth, 32) / 32) - 1] - -+ __bpf_call_base_args; -+ insn->code = BPF_JMP | BPF_CALL_ARGS; -+} - -- default_label: -- /* If we ever reach this, we have a bug somewhere. */ -- WARN_RATELIMIT(1, "unknown opcode %02x\n", insn->code); -- return 0; -+#else -+static unsigned int __bpf_prog_ret0_warn(const void *ctx, -+ const struct bpf_insn *insn) -+{ -+ /* If this handler ever gets executed, then BPF_JIT_ALWAYS_ON -+ * is not working properly, so warn about it! -+ */ -+ WARN_ON_ONCE(1); -+ return 0; - } -+#endif - - bool bpf_prog_array_compatible(struct bpf_array *array, - const struct bpf_prog *fp) - { -+ if (fp->kprobe_override) -+ return false; -+ - if (!array->owner_prog_type) { - /* There's no owner yet where we could check for - * compatibility. -@@ -691,18 +1711,62 @@ static int bpf_check_tail_call(const str - return 0; - } - -+static void bpf_prog_select_func(struct bpf_prog *fp) -+{ -+#ifndef CONFIG_BPF_JIT_ALWAYS_ON -+ u32 stack_depth = max_t(u32, fp->aux->stack_depth, 1); -+ -+ fp->bpf_func = interpreters[(round_up(stack_depth, 32) / 32) - 1]; -+#else -+ fp->bpf_func = __bpf_prog_ret0_warn; -+#endif -+} -+ - /** - * bpf_prog_select_runtime - select exec runtime for BPF program - * @fp: bpf_prog populated with internal BPF program -+ * @err: pointer to error variable - * - * Try to JIT eBPF program, if JIT is not available, use interpreter. - * The BPF program will be executed via BPF_PROG_RUN() macro. - */ --int bpf_prog_select_runtime(struct bpf_prog *fp) -+struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err) - { -- fp->bpf_func = (void *) __bpf_prog_run; -+ /* In case of BPF to BPF calls, verifier did all the prep -+ * work with regards to JITing, etc. -+ */ -+ if (fp->bpf_func) -+ goto finalize; -+ -+ bpf_prog_select_func(fp); -+ -+ /* eBPF JITs can rewrite the program in case constant -+ * blinding is active. However, in case of error during -+ * blinding, bpf_int_jit_compile() must always return a -+ * valid program, which in this case would simply not -+ * be JITed, but falls back to the interpreter. -+ */ -+ if (!bpf_prog_is_dev_bound(fp->aux)) { -+ *err = bpf_prog_alloc_jited_linfo(fp); -+ if (*err) -+ return fp; -+ -+ fp = bpf_int_jit_compile(fp); -+ if (!fp->jited) { -+ bpf_prog_free_jited_linfo(fp); -+#ifdef CONFIG_BPF_JIT_ALWAYS_ON -+ *err = -ENOTSUPP; -+ return fp; -+#endif -+ } else { -+ bpf_prog_free_unused_jited_linfo(fp); -+ } -+ } else { -+ *err = -EINVAL; -+ return fp; -+ } - -- bpf_int_jit_compile(fp); -+finalize: - bpf_prog_lock_ro(fp); - - /* The tail call compatibility check can only be done at -@@ -710,16 +1774,238 @@ int bpf_prog_select_runtime(struct bpf_p - * with JITed or non JITed program concatenations and not - * all eBPF JITs might immediately support all features. - */ -- return bpf_check_tail_call(fp); -+ *err = bpf_check_tail_call(fp); -+ -+ return fp; - } - EXPORT_SYMBOL_GPL(bpf_prog_select_runtime); - -+static unsigned int __bpf_prog_ret1(const void *ctx, -+ const struct bpf_insn *insn) -+{ -+ return 1; -+} -+ -+static struct bpf_prog_dummy { -+ struct bpf_prog prog; -+} dummy_bpf_prog = { -+ .prog = { -+ .bpf_func = __bpf_prog_ret1, -+ }, -+}; -+ -+/* to avoid allocating empty bpf_prog_array for cgroups that -+ * don't have bpf program attached use one global 'empty_prog_array' -+ * It will not be modified the caller of bpf_prog_array_alloc() -+ * (since caller requested prog_cnt == 0) -+ * that pointer should be 'freed' by bpf_prog_array_free() -+ */ -+static struct { -+ struct bpf_prog_array hdr; -+ struct bpf_prog *null_prog; -+} empty_prog_array = { -+ .null_prog = NULL, -+}; -+ -+struct bpf_prog_array *bpf_prog_array_alloc(u32 prog_cnt, gfp_t flags) -+{ -+ if (prog_cnt) -+ return kzalloc(sizeof(struct bpf_prog_array) + -+ sizeof(struct bpf_prog_array_item) * -+ (prog_cnt + 1), -+ flags); -+ -+ return &empty_prog_array.hdr; -+} -+ -+void bpf_prog_array_free(struct bpf_prog_array *progs) -+{ -+ if (!progs || progs == &empty_prog_array.hdr) -+ return; -+ kfree_rcu(progs, rcu); -+} -+ -+int bpf_prog_array_length(struct bpf_prog_array *array) -+{ -+ struct bpf_prog_array_item *item; -+ u32 cnt = 0; -+ -+ for (item = array->items; item->prog; item++) -+ if (item->prog != &dummy_bpf_prog.prog) -+ cnt++; -+ return cnt; -+} -+ -+bool bpf_prog_array_is_empty(struct bpf_prog_array *array) -+{ -+ struct bpf_prog_array_item *item; -+ -+ for (item = array->items; item->prog; item++) -+ if (item->prog != &dummy_bpf_prog.prog) -+ return false; -+ return true; -+} -+ -+static bool bpf_prog_array_copy_core(struct bpf_prog_array *array, -+ u32 *prog_ids, -+ u32 request_cnt) -+{ -+ struct bpf_prog_array_item *item; -+ int i = 0; -+ -+ for (item = array->items; item->prog; item++) { -+ if (item->prog == &dummy_bpf_prog.prog) -+ continue; -+ prog_ids[i] = item->prog->aux->id; -+ if (++i == request_cnt) { -+ item++; -+ break; -+ } -+ } -+ -+ return !!(item->prog); -+} -+ -+int bpf_prog_array_copy_to_user(struct bpf_prog_array *array, -+ __u32 __user *prog_ids, u32 cnt) -+{ -+ unsigned long err = 0; -+ bool nospc; -+ u32 *ids; -+ -+ /* users of this function are doing: -+ * cnt = bpf_prog_array_length(); -+ * if (cnt > 0) -+ * bpf_prog_array_copy_to_user(..., cnt); -+ * so below kcalloc doesn't need extra cnt > 0 check. -+ */ -+ ids = kcalloc(cnt, sizeof(u32), GFP_USER | __GFP_NOWARN); -+ if (!ids) -+ return -ENOMEM; -+ nospc = bpf_prog_array_copy_core(array, ids, cnt); -+ err = copy_to_user(prog_ids, ids, cnt * sizeof(u32)); -+ kfree(ids); -+ if (err) -+ return -EFAULT; -+ if (nospc) -+ return -ENOSPC; -+ return 0; -+} -+ -+void bpf_prog_array_delete_safe(struct bpf_prog_array *array, -+ struct bpf_prog *old_prog) -+{ -+ struct bpf_prog_array_item *item; -+ -+ for (item = array->items; item->prog; item++) -+ if (item->prog == old_prog) { -+ WRITE_ONCE(item->prog, &dummy_bpf_prog.prog); -+ break; -+ } -+} -+ -+int bpf_prog_array_copy(struct bpf_prog_array *old_array, -+ struct bpf_prog *exclude_prog, -+ struct bpf_prog *include_prog, -+ struct bpf_prog_array **new_array) -+{ -+ int new_prog_cnt, carry_prog_cnt = 0; -+ struct bpf_prog_array_item *existing; -+ struct bpf_prog_array *array; -+ bool found_exclude = false; -+ int new_prog_idx = 0; -+ -+ /* Figure out how many existing progs we need to carry over to -+ * the new array. -+ */ -+ if (old_array) { -+ existing = old_array->items; -+ for (; existing->prog; existing++) { -+ if (existing->prog == exclude_prog) { -+ found_exclude = true; -+ continue; -+ } -+ if (existing->prog != &dummy_bpf_prog.prog) -+ carry_prog_cnt++; -+ if (existing->prog == include_prog) -+ return -EEXIST; -+ } -+ } -+ -+ if (exclude_prog && !found_exclude) -+ return -ENOENT; -+ -+ /* How many progs (not NULL) will be in the new array? */ -+ new_prog_cnt = carry_prog_cnt; -+ if (include_prog) -+ new_prog_cnt += 1; -+ -+ /* Do we have any prog (not NULL) in the new array? */ -+ if (!new_prog_cnt) { -+ *new_array = NULL; -+ return 0; -+ } -+ -+ /* +1 as the end of prog_array is marked with NULL */ -+ array = bpf_prog_array_alloc(new_prog_cnt + 1, GFP_KERNEL); -+ if (!array) -+ return -ENOMEM; -+ -+ /* Fill in the new prog array */ -+ if (carry_prog_cnt) { -+ existing = old_array->items; -+ for (; existing->prog; existing++) -+ if (existing->prog != exclude_prog && -+ existing->prog != &dummy_bpf_prog.prog) { -+ array->items[new_prog_idx++].prog = -+ existing->prog; -+ } -+ } -+ if (include_prog) -+ array->items[new_prog_idx++].prog = include_prog; -+ array->items[new_prog_idx].prog = NULL; -+ *new_array = array; -+ return 0; -+} -+ -+int bpf_prog_array_copy_info(struct bpf_prog_array *array, -+ u32 *prog_ids, u32 request_cnt, -+ u32 *prog_cnt) -+{ -+ u32 cnt = 0; -+ -+ if (array) -+ cnt = bpf_prog_array_length(array); -+ -+ *prog_cnt = cnt; -+ -+ /* return early if user requested only program count or nothing to copy */ -+ if (!request_cnt || !cnt) -+ return 0; -+ -+ /* this function is called under trace/bpf_trace.c: bpf_event_mutex */ -+ return bpf_prog_array_copy_core(array, prog_ids, request_cnt) ? -ENOSPC -+ : 0; -+} -+ - static void bpf_prog_free_deferred(struct work_struct *work) - { - struct bpf_prog_aux *aux; -+ int i; - - aux = container_of(work, struct bpf_prog_aux, work); -- bpf_jit_free(aux->prog); -+#ifdef CONFIG_PERF_EVENTS -+ if (aux->prog->has_callchain_buf) -+ put_callchain_buffers(); -+#endif -+ for (i = 0; i < aux->func_cnt; i++) -+ bpf_jit_free(aux->func[i]); -+ if (aux->func_cnt) { -+ kfree(aux->func); -+ bpf_prog_unlock_free(aux->prog); -+ } else { -+ bpf_jit_free(aux->prog); -+ } - } - - /* Free internal BPF program */ -@@ -740,7 +2026,7 @@ void bpf_user_rnd_init_once(void) - prandom_init_once(&bpf_user_rnd_state); - } - --u64 bpf_user_rnd_u32(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_0(bpf_user_rnd_u32) - { - /* Should someone ever have the rather unwise idea to use some - * of the registers passed into this function, then note that -@@ -753,7 +2039,7 @@ u64 bpf_user_rnd_u32(u64 r1, u64 r2, u64 - - state = &get_cpu_var(bpf_user_rnd_state); - res = prandom_u32_state(state); -- put_cpu_var(state); -+ put_cpu_var(bpf_user_rnd_state); - - return res; - } -@@ -762,18 +2048,36 @@ u64 bpf_user_rnd_u32(u64 r1, u64 r2, u64 - const struct bpf_func_proto bpf_map_lookup_elem_proto __weak; - const struct bpf_func_proto bpf_map_update_elem_proto __weak; - const struct bpf_func_proto bpf_map_delete_elem_proto __weak; -+const struct bpf_func_proto bpf_map_push_elem_proto __weak; -+const struct bpf_func_proto bpf_map_pop_elem_proto __weak; -+const struct bpf_func_proto bpf_map_peek_elem_proto __weak; -+const struct bpf_func_proto bpf_spin_lock_proto __weak; -+const struct bpf_func_proto bpf_spin_unlock_proto __weak; - - const struct bpf_func_proto bpf_get_prandom_u32_proto __weak; - const struct bpf_func_proto bpf_get_smp_processor_id_proto __weak; -+const struct bpf_func_proto bpf_get_numa_node_id_proto __weak; - const struct bpf_func_proto bpf_ktime_get_ns_proto __weak; -+ - const struct bpf_func_proto bpf_get_current_pid_tgid_proto __weak; - const struct bpf_func_proto bpf_get_current_uid_gid_proto __weak; - const struct bpf_func_proto bpf_get_current_comm_proto __weak; -+const struct bpf_func_proto bpf_get_current_cgroup_id_proto __weak; -+const struct bpf_func_proto bpf_get_local_storage_proto __weak; -+ - const struct bpf_func_proto * __weak bpf_get_trace_printk_proto(void) - { - return NULL; - } - -+u64 __weak -+bpf_event_output(struct bpf_map *map, u64 flags, void *meta, u64 meta_size, -+ void *ctx, u64 ctx_size, bpf_ctx_copy_t ctx_copy) -+{ -+ return -ENOTSUPP; -+} -+EXPORT_SYMBOL_GPL(bpf_event_output); -+ - /* Always built-in helper functions. */ - const struct bpf_func_proto bpf_tail_call_proto = { - .func = NULL, -@@ -784,9 +2088,34 @@ const struct bpf_func_proto bpf_tail_cal - .arg3_type = ARG_ANYTHING, - }; - --/* For classic BPF JITs that don't implement bpf_int_jit_compile(). */ --void __weak bpf_int_jit_compile(struct bpf_prog *prog) -+/* Stub for JITs that only support cBPF. eBPF programs are interpreted. -+ * It is encouraged to implement bpf_int_jit_compile() instead, so that -+ * eBPF and implicitly also cBPF can get JITed! -+ */ -+struct bpf_prog * __weak bpf_int_jit_compile(struct bpf_prog *prog) - { -+ return prog; -+} -+ -+/* Stub for JITs that support eBPF. All cBPF code gets transformed into -+ * eBPF by the kernel and is later compiled by bpf_int_jit_compile(). -+ */ -+void __weak bpf_jit_compile(struct bpf_prog *prog) -+{ -+} -+ -+bool __weak bpf_helper_changes_pkt_data(void *func) -+{ -+ return false; -+} -+ -+/* Return TRUE if the JIT backend wants verifier to enable sub-register usage -+ * analysis code and wants explicit zero extension inserted by verifier. -+ * Otherwise, return FALSE. -+ */ -+bool __weak bpf_jit_needs_zext(void) -+{ -+ return false; - } - - /* To execute LD_ABS/LD_IND instructions __bpf_prog_run() may call -@@ -797,3 +2126,13 @@ int __weak skb_copy_bits(const struct sk - { - return -EFAULT; - } -+ -+DEFINE_STATIC_KEY_FALSE(bpf_stats_enabled_key); -+EXPORT_SYMBOL(bpf_stats_enabled_key); -+ -+/* All definitions of tracepoints related to BPF. */ -+#define CREATE_TRACE_POINTS -+#include -+ -+EXPORT_TRACEPOINT_SYMBOL_GPL(xdp_exception); -+EXPORT_TRACEPOINT_SYMBOL_GPL(xdp_bulk_tx); ---- /dev/null -+++ b/kernel/bpf/devmap.c -@@ -0,0 +1,698 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* Copyright (c) 2017 Covalent IO, Inc. http://covalent.io -+ */ -+ -+/* Devmaps primary use is as a backend map for XDP BPF helper call -+ * bpf_redirect_map(). Because XDP is mostly concerned with performance we -+ * spent some effort to ensure the datapath with redirect maps does not use -+ * any locking. This is a quick note on the details. -+ * -+ * We have three possible paths to get into the devmap control plane bpf -+ * syscalls, bpf programs, and driver side xmit/flush operations. A bpf syscall -+ * will invoke an update, delete, or lookup operation. To ensure updates and -+ * deletes appear atomic from the datapath side xchg() is used to modify the -+ * netdev_map array. Then because the datapath does a lookup into the netdev_map -+ * array (read-only) from an RCU critical section we use call_rcu() to wait for -+ * an rcu grace period before free'ing the old data structures. This ensures the -+ * datapath always has a valid copy. However, the datapath does a "flush" -+ * operation that pushes any pending packets in the driver outside the RCU -+ * critical section. Each bpf_dtab_netdev tracks these pending operations using -+ * a per-cpu flush list. The bpf_dtab_netdev object will not be destroyed until -+ * this list is empty, indicating outstanding flush operations have completed. -+ * -+ * BPF syscalls may race with BPF program calls on any of the update, delete -+ * or lookup operations. As noted above the xchg() operation also keep the -+ * netdev_map consistent in this case. From the devmap side BPF programs -+ * calling into these operations are the same as multiple user space threads -+ * making system calls. -+ * -+ * Finally, any of the above may race with a netdev_unregister notifier. The -+ * unregister notifier must search for net devices in the map structure that -+ * contain a reference to the net device and remove them. This is a two step -+ * process (a) dereference the bpf_dtab_netdev object in netdev_map and (b) -+ * check to see if the ifindex is the same as the net_device being removed. -+ * When removing the dev a cmpxchg() is used to ensure the correct dev is -+ * removed, in the case of a concurrent update or delete operation it is -+ * possible that the initially referenced dev is no longer in the map. As the -+ * notifier hook walks the map we know that new dev references can not be -+ * added by the user because core infrastructure ensures dev_get_by_index() -+ * calls will fail at this point. -+ * -+ * The devmap_hash type is a map type which interprets keys as ifindexes and -+ * indexes these using a hashmap. This allows maps that use ifindex as key to be -+ * densely packed instead of having holes in the lookup array for unused -+ * ifindexes. The setup and packet enqueue/send code is shared between the two -+ * types of devmap; only the lookup and insertion is different. -+ */ -+#include -+#include -+#include -+#include -+ -+#define DEV_CREATE_FLAG_MASK \ -+ (BPF_F_NUMA_NODE | BPF_F_RDONLY | BPF_F_WRONLY) -+ -+#define DEV_MAP_BULK_SIZE 16 -+struct bpf_dtab_netdev; -+ -+struct xdp_bulk_queue { -+ struct xdp_frame *q[DEV_MAP_BULK_SIZE]; -+ struct list_head flush_node; -+ struct net_device *dev_rx; -+ struct bpf_dtab_netdev *obj; -+ unsigned int count; -+}; -+ -+struct bpf_dtab_netdev { -+ struct net_device *dev; /* must be first member, due to tracepoint */ -+ struct hlist_node index_hlist; -+ struct bpf_dtab *dtab; -+ struct xdp_bulk_queue __percpu *bulkq; -+ struct rcu_head rcu; -+ unsigned int idx; /* keep track of map index for tracepoint */ -+}; -+ -+struct bpf_dtab { -+ struct bpf_map map; -+ struct bpf_dtab_netdev **netdev_map; /* DEVMAP type only */ -+ struct list_head __percpu *flush_list; -+ struct list_head list; -+ -+ /* these are only used for DEVMAP_HASH type maps */ -+ struct hlist_head *dev_index_head; -+ spinlock_t index_lock; -+ unsigned int items; -+ u32 n_buckets; -+}; -+ -+static DEFINE_SPINLOCK(dev_map_lock); -+static LIST_HEAD(dev_map_list); -+ -+static struct hlist_head *dev_map_create_hash(unsigned int entries, -+ int numa_node) -+{ -+ int i; -+ struct hlist_head *hash; -+ -+ hash = bpf_map_area_alloc(entries * sizeof(*hash), numa_node); -+ if (hash != NULL) -+ for (i = 0; i < entries; i++) -+ INIT_HLIST_HEAD(&hash[i]); -+ -+ return hash; -+} -+ -+static inline struct hlist_head *dev_map_index_hash(struct bpf_dtab *dtab, -+ int idx) -+{ -+ return &dtab->dev_index_head[idx & (dtab->n_buckets - 1)]; -+} -+ -+static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr) -+{ -+ int err, cpu; -+ u64 cost; -+ -+ /* check sanity of attributes */ -+ if (attr->max_entries == 0 || attr->key_size != 4 || -+ attr->value_size != 4 || attr->map_flags & ~DEV_CREATE_FLAG_MASK) -+ return -EINVAL; -+ -+ /* Lookup returns a pointer straight to dev->ifindex, so make sure the -+ * verifier prevents writes from the BPF side -+ */ -+ attr->map_flags |= BPF_F_RDONLY_PROG; -+ -+ -+ bpf_map_init_from_attr(&dtab->map, attr); -+ -+ /* make sure page count doesn't overflow */ -+ cost = (u64) sizeof(struct list_head) * num_possible_cpus(); -+ -+ if (attr->map_type == BPF_MAP_TYPE_DEVMAP_HASH) { -+ dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries); -+ -+ if (!dtab->n_buckets) /* Overflow check */ -+ return -EINVAL; -+ cost += (u64) sizeof(struct hlist_head) * dtab->n_buckets; -+ } else { -+ cost += (u64) dtab->map.max_entries * sizeof(struct bpf_dtab_netdev *); -+ } -+ -+ /* if map size is larger than memlock limit, reject it */ -+ err = bpf_map_charge_init(&dtab->map.memory, cost); -+ if (err) -+ return -EINVAL; -+ -+ dtab->flush_list = alloc_percpu(struct list_head); -+ if (!dtab->flush_list) -+ goto free_charge; -+ -+ for_each_possible_cpu(cpu) -+ INIT_LIST_HEAD(per_cpu_ptr(dtab->flush_list, cpu)); -+ -+ if (attr->map_type == BPF_MAP_TYPE_DEVMAP_HASH) { -+ dtab->dev_index_head = dev_map_create_hash(dtab->n_buckets, -+ dtab->map.numa_node); -+ if (!dtab->dev_index_head) -+ goto free_percpu; -+ -+ spin_lock_init(&dtab->index_lock); -+ } else { -+ dtab->netdev_map = bpf_map_area_alloc(dtab->map.max_entries * -+ sizeof(struct bpf_dtab_netdev *), -+ dtab->map.numa_node); -+ if (!dtab->netdev_map) -+ goto free_percpu; -+ } -+ -+ return 0; -+ -+free_percpu: -+ free_percpu(dtab->flush_list); -+free_charge: -+ bpf_map_charge_finish(&dtab->map.memory); -+ return -ENOMEM; -+} -+ -+static struct bpf_map *dev_map_alloc(union bpf_attr *attr) -+{ -+ struct bpf_dtab *dtab; -+ int err; -+ -+ if (!capable(CAP_NET_ADMIN)) -+ return ERR_PTR(-EPERM); -+ -+ dtab = kzalloc(sizeof(*dtab), GFP_USER); -+ if (!dtab) -+ return ERR_PTR(-ENOMEM); -+ -+ err = dev_map_init_map(dtab, attr); -+ if (err) { -+ kfree(dtab); -+ return ERR_PTR(err); -+ } -+ -+ spin_lock(&dev_map_lock); -+ list_add_tail_rcu(&dtab->list, &dev_map_list); -+ spin_unlock(&dev_map_lock); -+ -+ return &dtab->map; -+} -+ -+static void dev_map_free(struct bpf_map *map) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ int i, cpu; -+ -+ /* At this point bpf_prog->aux->refcnt == 0 and this map->refcnt == 0, -+ * so the programs (can be more than one that used this map) were -+ * disconnected from events. Wait for outstanding critical sections in -+ * these programs to complete. The rcu critical section only guarantees -+ * no further reads against netdev_map. It does __not__ ensure pending -+ * flush operations (if any) are complete. -+ */ -+ -+ spin_lock(&dev_map_lock); -+ list_del_rcu(&dtab->list); -+ spin_unlock(&dev_map_lock); -+ -+ bpf_clear_redirect_map(map); -+ synchronize_rcu(); -+ -+ /* Make sure prior __dev_map_entry_free() have completed. */ -+ rcu_barrier(); -+ -+ /* To ensure all pending flush operations have completed wait for flush -+ * list to empty on _all_ cpus. -+ * Because the above synchronize_rcu() ensures the map is disconnected -+ * from the program we can assume no new items will be added. -+ */ -+ for_each_online_cpu(cpu) { -+ struct list_head *flush_list = per_cpu_ptr(dtab->flush_list, cpu); -+ -+ while (!list_empty(flush_list)) -+ cond_resched(); -+ } -+ -+ if (dtab->map.map_type == BPF_MAP_TYPE_DEVMAP_HASH) { -+ for (i = 0; i < dtab->n_buckets; i++) { -+ struct bpf_dtab_netdev *dev; -+ struct hlist_head *head; -+ struct hlist_node *next; -+ -+ head = dev_map_index_hash(dtab, i); -+ -+ hlist_for_each_entry_safe(dev, next, head, index_hlist) { -+ hlist_del_rcu(&dev->index_hlist); -+ free_percpu(dev->bulkq); -+ dev_put(dev->dev); -+ kfree(dev); -+ } -+ } -+ -+ bpf_map_area_free(dtab->dev_index_head); -+ } else { -+ for (i = 0; i < dtab->map.max_entries; i++) { -+ struct bpf_dtab_netdev *dev; -+ -+ dev = dtab->netdev_map[i]; -+ if (!dev) -+ continue; -+ -+ free_percpu(dev->bulkq); -+ dev_put(dev->dev); -+ kfree(dev); -+ } -+ -+ bpf_map_area_free(dtab->netdev_map); -+ } -+ -+ free_percpu(dtab->flush_list); -+ kfree(dtab); -+} -+ -+static int dev_map_get_next_key(struct bpf_map *map, void *key, void *next_key) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ u32 index = key ? *(u32 *)key : U32_MAX; -+ u32 *next = next_key; -+ -+ if (index >= dtab->map.max_entries) { -+ *next = 0; -+ return 0; -+ } -+ -+ if (index == dtab->map.max_entries - 1) -+ return -ENOENT; -+ *next = index + 1; -+ return 0; -+} -+ -+struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ struct hlist_head *head = dev_map_index_hash(dtab, key); -+ struct bpf_dtab_netdev *dev; -+ -+ hlist_for_each_entry_rcu(dev, head, index_hlist) -+ if (dev->idx == key) -+ return dev; -+ -+ return NULL; -+} -+ -+static int dev_map_hash_get_next_key(struct bpf_map *map, void *key, -+ void *next_key) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ u32 idx, *next = next_key; -+ struct bpf_dtab_netdev *dev, *next_dev; -+ struct hlist_head *head; -+ int i = 0; -+ -+ if (!key) -+ goto find_first; -+ -+ idx = *(u32 *)key; -+ -+ dev = __dev_map_hash_lookup_elem(map, idx); -+ if (!dev) -+ goto find_first; -+ -+ next_dev = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(&dev->index_hlist)), -+ struct bpf_dtab_netdev, index_hlist); -+ -+ if (next_dev) { -+ *next = next_dev->idx; -+ return 0; -+ } -+ -+ i = idx & (dtab->n_buckets - 1); -+ i++; -+ -+ find_first: -+ for (; i < dtab->n_buckets; i++) { -+ head = dev_map_index_hash(dtab, i); -+ -+ next_dev = hlist_entry_safe(rcu_dereference_raw(hlist_first_rcu(head)), -+ struct bpf_dtab_netdev, -+ index_hlist); -+ if (next_dev) { -+ *next = next_dev->idx; -+ return 0; -+ } -+ } -+ -+ return -ENOENT; -+} -+ -+/* __dev_map_flush is called from xdp_do_flush_map() which _must_ be signaled -+ * from the driver before returning from its napi->poll() routine. The poll() -+ * routine is called either from busy_poll context or net_rx_action signaled -+ * from NET_RX_SOFTIRQ. Either way the poll routine must complete before the -+ * net device can be torn down. On devmap tear down we ensure the flush list -+ * is empty before completing to ensure all flush operations have completed. -+ */ -+void __dev_map_flush(struct bpf_map *map) -+{ -+} -+ -+/* rcu_read_lock (from syscall and BPF contexts) ensures that if a delete and/or -+ * update happens in parallel here a dev_put wont happen until after reading the -+ * ifindex. -+ */ -+struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ struct bpf_dtab_netdev *obj; -+ -+ if (key >= map->max_entries) -+ return NULL; -+ -+ obj = READ_ONCE(dtab->netdev_map[key]); -+ return obj; -+} -+ -+int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, -+ struct net_device *dev_rx) -+{ -+ return -EOPNOTSUPP; -+} -+ -+int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, -+ struct bpf_prog *xdp_prog) -+{ -+ return -EOPNOTSUPP; -+} -+ -+static void *dev_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_dtab_netdev *obj = __dev_map_lookup_elem(map, *(u32 *)key); -+ struct net_device *dev = obj ? obj->dev : NULL; -+ -+ return dev ? &dev->ifindex : NULL; -+} -+ -+static void *dev_map_hash_lookup_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_dtab_netdev *obj = __dev_map_hash_lookup_elem(map, -+ *(u32 *)key); -+ struct net_device *dev = obj ? obj->dev : NULL; -+ -+ return dev ? &dev->ifindex : NULL; -+} -+ -+static void __dev_map_entry_free(struct rcu_head *rcu) -+{ -+ struct bpf_dtab_netdev *dev; -+ -+ dev = container_of(rcu, struct bpf_dtab_netdev, rcu); -+ free_percpu(dev->bulkq); -+ dev_put(dev->dev); -+ kfree(dev); -+} -+ -+static int dev_map_delete_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ struct bpf_dtab_netdev *old_dev; -+ int k = *(u32 *)key; -+ -+ if (k >= map->max_entries) -+ return -EINVAL; -+ -+ /* Use call_rcu() here to ensure any rcu critical sections have -+ * completed, but this does not guarantee a flush has happened -+ * yet. Because driver side rcu_read_lock/unlock only protects the -+ * running XDP program. However, for pending flush operations the -+ * dev and ctx are stored in another per cpu map. And additionally, -+ * the driver tear down ensures all soft irqs are complete before -+ * removing the net device in the case of dev_put equals zero. -+ */ -+ old_dev = xchg(&dtab->netdev_map[k], NULL); -+ if (old_dev) -+ call_rcu(&old_dev->rcu, __dev_map_entry_free); -+ return 0; -+} -+ -+static int dev_map_hash_delete_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ struct bpf_dtab_netdev *old_dev; -+ int k = *(u32 *)key; -+ unsigned long flags; -+ int ret = -ENOENT; -+ -+ spin_lock_irqsave(&dtab->index_lock, flags); -+ -+ old_dev = __dev_map_hash_lookup_elem(map, k); -+ if (old_dev) { -+ dtab->items--; -+ hlist_del_init_rcu(&old_dev->index_hlist); -+ call_rcu(&old_dev->rcu, __dev_map_entry_free); -+ ret = 0; -+ } -+ spin_unlock_irqrestore(&dtab->index_lock, flags); -+ -+ return ret; -+} -+ -+static struct bpf_dtab_netdev *__dev_map_alloc_node(struct net *net, -+ struct bpf_dtab *dtab, -+ u32 ifindex, -+ unsigned int idx) -+{ -+ gfp_t gfp = GFP_ATOMIC | __GFP_NOWARN; -+ struct bpf_dtab_netdev *dev; -+ struct xdp_bulk_queue *bq; -+ int cpu; -+ -+ dev = kmalloc_node(sizeof(*dev), gfp, dtab->map.numa_node); -+ if (!dev) -+ return ERR_PTR(-ENOMEM); -+ -+ dev->bulkq = __alloc_percpu_gfp(sizeof(*dev->bulkq), -+ sizeof(void *), gfp); -+ if (!dev->bulkq) { -+ kfree(dev); -+ return ERR_PTR(-ENOMEM); -+ } -+ -+ for_each_possible_cpu(cpu) { -+ bq = per_cpu_ptr(dev->bulkq, cpu); -+ bq->obj = dev; -+ } -+ -+ dev->dev = dev_get_by_index(net, ifindex); -+ if (!dev->dev) { -+ free_percpu(dev->bulkq); -+ kfree(dev); -+ return ERR_PTR(-EINVAL); -+ } -+ -+ dev->idx = idx; -+ dev->dtab = dtab; -+ -+ return dev; -+} -+ -+static int __dev_map_update_elem(struct net *net, struct bpf_map *map, -+ void *key, void *value, u64 map_flags) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ struct bpf_dtab_netdev *dev, *old_dev; -+ u32 ifindex = *(u32 *)value; -+ u32 i = *(u32 *)key; -+ -+ if (unlikely(map_flags > BPF_EXIST)) -+ return -EINVAL; -+ if (unlikely(i >= dtab->map.max_entries)) -+ return -E2BIG; -+ if (unlikely(map_flags == BPF_NOEXIST)) -+ return -EEXIST; -+ -+ if (!ifindex) { -+ dev = NULL; -+ } else { -+ dev = __dev_map_alloc_node(net, dtab, ifindex, i); -+ if (IS_ERR(dev)) -+ return PTR_ERR(dev); -+ } -+ -+ /* Use call_rcu() here to ensure rcu critical sections have completed -+ * Remembering the driver side flush operation will happen before the -+ * net device is removed. -+ */ -+ old_dev = xchg(&dtab->netdev_map[i], dev); -+ if (old_dev) -+ call_rcu(&old_dev->rcu, __dev_map_entry_free); -+ -+ return 0; -+} -+ -+static int dev_map_update_elem(struct bpf_map *map, void *key, void *value, -+ u64 map_flags) -+{ -+ return __dev_map_update_elem(current->nsproxy->net_ns, -+ map, key, value, map_flags); -+} -+ -+static int __dev_map_hash_update_elem(struct net *net, struct bpf_map *map, -+ void *key, void *value, u64 map_flags) -+{ -+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); -+ struct bpf_dtab_netdev *dev, *old_dev; -+ u32 ifindex = *(u32 *)value; -+ u32 idx = *(u32 *)key; -+ unsigned long flags; -+ int err = -EEXIST; -+ -+ if (unlikely(map_flags > BPF_EXIST || !ifindex)) -+ return -EINVAL; -+ -+ spin_lock_irqsave(&dtab->index_lock, flags); -+ -+ old_dev = __dev_map_hash_lookup_elem(map, idx); -+ if (old_dev && (map_flags & BPF_NOEXIST)) -+ goto out_err; -+ -+ dev = __dev_map_alloc_node(net, dtab, ifindex, idx); -+ if (IS_ERR(dev)) { -+ err = PTR_ERR(dev); -+ goto out_err; -+ } -+ -+ if (old_dev) { -+ hlist_del_rcu(&old_dev->index_hlist); -+ } else { -+ if (dtab->items >= dtab->map.max_entries) { -+ spin_unlock_irqrestore(&dtab->index_lock, flags); -+ call_rcu(&dev->rcu, __dev_map_entry_free); -+ return -E2BIG; -+ } -+ dtab->items++; -+ } -+ -+ hlist_add_head_rcu(&dev->index_hlist, -+ dev_map_index_hash(dtab, idx)); -+ spin_unlock_irqrestore(&dtab->index_lock, flags); -+ -+ if (old_dev) -+ call_rcu(&old_dev->rcu, __dev_map_entry_free); -+ -+ return 0; -+ -+out_err: -+ spin_unlock_irqrestore(&dtab->index_lock, flags); -+ return err; -+} -+ -+static int dev_map_hash_update_elem(struct bpf_map *map, void *key, void *value, -+ u64 map_flags) -+{ -+ return __dev_map_hash_update_elem(current->nsproxy->net_ns, -+ map, key, value, map_flags); -+} -+ -+const struct bpf_map_ops dev_map_ops = { -+ .map_alloc = dev_map_alloc, -+ .map_free = dev_map_free, -+ .map_get_next_key = dev_map_get_next_key, -+ .map_lookup_elem = dev_map_lookup_elem, -+ .map_update_elem = dev_map_update_elem, -+ .map_delete_elem = dev_map_delete_elem, -+ .map_check_btf = map_check_no_btf, -+}; -+ -+const struct bpf_map_ops dev_map_hash_ops = { -+ .map_alloc = dev_map_alloc, -+ .map_free = dev_map_free, -+ .map_get_next_key = dev_map_hash_get_next_key, -+ .map_lookup_elem = dev_map_hash_lookup_elem, -+ .map_update_elem = dev_map_hash_update_elem, -+ .map_delete_elem = dev_map_hash_delete_elem, -+ .map_check_btf = map_check_no_btf, -+}; -+ -+static void dev_map_hash_remove_netdev(struct bpf_dtab *dtab, -+ struct net_device *netdev) -+{ -+ unsigned long flags; -+ u32 i; -+ -+ spin_lock_irqsave(&dtab->index_lock, flags); -+ for (i = 0; i < dtab->n_buckets; i++) { -+ struct bpf_dtab_netdev *dev; -+ struct hlist_head *head; -+ struct hlist_node *next; -+ -+ head = dev_map_index_hash(dtab, i); -+ -+ hlist_for_each_entry_safe(dev, next, head, index_hlist) { -+ if (netdev != dev->dev) -+ continue; -+ -+ dtab->items--; -+ hlist_del_rcu(&dev->index_hlist); -+ call_rcu(&dev->rcu, __dev_map_entry_free); -+ } -+ } -+ spin_unlock_irqrestore(&dtab->index_lock, flags); -+} -+ -+static int dev_map_notification(struct notifier_block *notifier, -+ ulong event, void *ptr) -+{ -+ struct net_device *netdev = netdev_notifier_info_to_dev(ptr); -+ struct bpf_dtab *dtab; -+ int i; -+ -+ switch (event) { -+ case NETDEV_UNREGISTER: -+ /* This rcu_read_lock/unlock pair is needed because -+ * dev_map_list is an RCU list AND to ensure a delete -+ * operation does not free a netdev_map entry while we -+ * are comparing it against the netdev being unregistered. -+ */ -+ rcu_read_lock(); -+ list_for_each_entry_rcu(dtab, &dev_map_list, list) { -+ if (dtab->map.map_type == BPF_MAP_TYPE_DEVMAP_HASH) { -+ dev_map_hash_remove_netdev(dtab, netdev); -+ continue; -+ } -+ -+ for (i = 0; i < dtab->map.max_entries; i++) { -+ struct bpf_dtab_netdev *dev, *odev; -+ -+ dev = READ_ONCE(dtab->netdev_map[i]); -+ if (!dev || netdev != dev->dev) -+ continue; -+ odev = cmpxchg(&dtab->netdev_map[i], dev, NULL); -+ if (dev == odev) -+ call_rcu(&dev->rcu, -+ __dev_map_entry_free); -+ } -+ } -+ rcu_read_unlock(); -+ break; -+ default: -+ break; -+ } -+ return NOTIFY_OK; -+} -+ -+static struct notifier_block dev_map_notifier = { -+ .notifier_call = dev_map_notification, -+}; -+ -+static int __init dev_map_init(void) -+{ -+ /* Assure tracepoint shadow struct _bpf_dtab_netdev is in sync */ -+ BUILD_BUG_ON(offsetof(struct bpf_dtab_netdev, dev) != -+ offsetof(struct _bpf_dtab_netdev, dev)); -+ register_netdevice_notifier(&dev_map_notifier); -+ return 0; -+} -+ -+subsys_initcall(dev_map_init); ---- /dev/null -+++ b/kernel/bpf/disasm.c -@@ -0,0 +1,258 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -+ * Copyright (c) 2016 Facebook -+ */ -+ -+#include -+ -+#include "disasm.h" -+ -+#define __BPF_FUNC_STR_FN(x) [BPF_FUNC_ ## x] = __stringify(bpf_ ## x) -+static const char * const func_id_str[] = { -+ __BPF_FUNC_MAPPER(__BPF_FUNC_STR_FN) -+}; -+#undef __BPF_FUNC_STR_FN -+ -+static const char *__func_get_name(const struct bpf_insn_cbs *cbs, -+ const struct bpf_insn *insn, -+ char *buff, size_t len) -+{ -+ BUILD_BUG_ON(ARRAY_SIZE(func_id_str) != __BPF_FUNC_MAX_ID); -+ -+ if (insn->src_reg != BPF_PSEUDO_CALL && -+ insn->imm >= 0 && insn->imm < __BPF_FUNC_MAX_ID && -+ func_id_str[insn->imm]) -+ return func_id_str[insn->imm]; -+ -+ if (cbs && cbs->cb_call) -+ return cbs->cb_call(cbs->private_data, insn); -+ -+ if (insn->src_reg == BPF_PSEUDO_CALL) -+ snprintf(buff, len, "%+d", insn->imm); -+ -+ return buff; -+} -+ -+static const char *__func_imm_name(const struct bpf_insn_cbs *cbs, -+ const struct bpf_insn *insn, -+ u64 full_imm, char *buff, size_t len) -+{ -+ if (cbs && cbs->cb_imm) -+ return cbs->cb_imm(cbs->private_data, insn, full_imm); -+ -+ snprintf(buff, len, "0x%llx", (unsigned long long)full_imm); -+ return buff; -+} -+ -+const char *func_id_name(int id) -+{ -+ if (id >= 0 && id < __BPF_FUNC_MAX_ID && func_id_str[id]) -+ return func_id_str[id]; -+ else -+ return "unknown"; -+} -+ -+const char *const bpf_class_string[8] = { -+ [BPF_LD] = "ld", -+ [BPF_LDX] = "ldx", -+ [BPF_ST] = "st", -+ [BPF_STX] = "stx", -+ [BPF_ALU] = "alu", -+ [BPF_JMP] = "jmp", -+ [BPF_JMP32] = "jmp32", -+ [BPF_ALU64] = "alu64", -+}; -+ -+const char *const bpf_alu_string[16] = { -+ [BPF_ADD >> 4] = "+=", -+ [BPF_SUB >> 4] = "-=", -+ [BPF_MUL >> 4] = "*=", -+ [BPF_DIV >> 4] = "/=", -+ [BPF_OR >> 4] = "|=", -+ [BPF_AND >> 4] = "&=", -+ [BPF_LSH >> 4] = "<<=", -+ [BPF_RSH >> 4] = ">>=", -+ [BPF_NEG >> 4] = "neg", -+ [BPF_MOD >> 4] = "%=", -+ [BPF_XOR >> 4] = "^=", -+ [BPF_MOV >> 4] = "=", -+ [BPF_ARSH >> 4] = "s>>=", -+ [BPF_END >> 4] = "endian", -+}; -+ -+static const char *const bpf_ldst_string[] = { -+ [BPF_W >> 3] = "u32", -+ [BPF_H >> 3] = "u16", -+ [BPF_B >> 3] = "u8", -+ [BPF_DW >> 3] = "u64", -+}; -+ -+static const char *const bpf_jmp_string[16] = { -+ [BPF_JA >> 4] = "jmp", -+ [BPF_JEQ >> 4] = "==", -+ [BPF_JGT >> 4] = ">", -+ [BPF_JLT >> 4] = "<", -+ [BPF_JGE >> 4] = ">=", -+ [BPF_JLE >> 4] = "<=", -+ [BPF_JSET >> 4] = "&", -+ [BPF_JNE >> 4] = "!=", -+ [BPF_JSGT >> 4] = "s>", -+ [BPF_JSLT >> 4] = "s<", -+ [BPF_JSGE >> 4] = "s>=", -+ [BPF_JSLE >> 4] = "s<=", -+ [BPF_CALL >> 4] = "call", -+ [BPF_EXIT >> 4] = "exit", -+}; -+ -+static void print_bpf_end_insn(bpf_insn_print_t verbose, -+ void *private_data, -+ const struct bpf_insn *insn) -+{ -+ verbose(private_data, "(%02x) r%d = %s%d r%d\n", -+ insn->code, insn->dst_reg, -+ BPF_SRC(insn->code) == BPF_TO_BE ? "be" : "le", -+ insn->imm, insn->dst_reg); -+} -+ -+void print_bpf_insn(const struct bpf_insn_cbs *cbs, -+ const struct bpf_insn *insn, -+ bool allow_ptr_leaks) -+{ -+ const bpf_insn_print_t verbose = cbs->cb_print; -+ u8 class = BPF_CLASS(insn->code); -+ -+ if (class == BPF_ALU || class == BPF_ALU64) { -+ if (BPF_OP(insn->code) == BPF_END) { -+ if (class == BPF_ALU64) -+ verbose(cbs->private_data, "BUG_alu64_%02x\n", insn->code); -+ else -+ print_bpf_end_insn(verbose, cbs->private_data, insn); -+ } else if (BPF_OP(insn->code) == BPF_NEG) { -+ verbose(cbs->private_data, "(%02x) %c%d = -%c%d\n", -+ insn->code, class == BPF_ALU ? 'w' : 'r', -+ insn->dst_reg, class == BPF_ALU ? 'w' : 'r', -+ insn->dst_reg); -+ } else if (BPF_SRC(insn->code) == BPF_X) { -+ verbose(cbs->private_data, "(%02x) %c%d %s %c%d\n", -+ insn->code, class == BPF_ALU ? 'w' : 'r', -+ insn->dst_reg, -+ bpf_alu_string[BPF_OP(insn->code) >> 4], -+ class == BPF_ALU ? 'w' : 'r', -+ insn->src_reg); -+ } else { -+ verbose(cbs->private_data, "(%02x) %c%d %s %d\n", -+ insn->code, class == BPF_ALU ? 'w' : 'r', -+ insn->dst_reg, -+ bpf_alu_string[BPF_OP(insn->code) >> 4], -+ insn->imm); -+ } -+ } else if (class == BPF_STX) { -+ if (BPF_MODE(insn->code) == BPF_MEM) -+ verbose(cbs->private_data, "(%02x) *(%s *)(r%d %+d) = r%d\n", -+ insn->code, -+ bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -+ insn->dst_reg, -+ insn->off, insn->src_reg); -+ else if (BPF_MODE(insn->code) == BPF_XADD) -+ verbose(cbs->private_data, "(%02x) lock *(%s *)(r%d %+d) += r%d\n", -+ insn->code, -+ bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -+ insn->dst_reg, insn->off, -+ insn->src_reg); -+ else -+ verbose(cbs->private_data, "BUG_%02x\n", insn->code); -+ } else if (class == BPF_ST) { -+ if (BPF_MODE(insn->code) != BPF_MEM) { -+ verbose(cbs->private_data, "BUG_st_%02x\n", insn->code); -+ return; -+ } -+ verbose(cbs->private_data, "(%02x) *(%s *)(r%d %+d) = %d\n", -+ insn->code, -+ bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -+ insn->dst_reg, -+ insn->off, insn->imm); -+ } else if (class == BPF_LDX) { -+ if (BPF_MODE(insn->code) != BPF_MEM) { -+ verbose(cbs->private_data, "BUG_ldx_%02x\n", insn->code); -+ return; -+ } -+ verbose(cbs->private_data, "(%02x) r%d = *(%s *)(r%d %+d)\n", -+ insn->code, insn->dst_reg, -+ bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -+ insn->src_reg, insn->off); -+ } else if (class == BPF_LD) { -+ if (BPF_MODE(insn->code) == BPF_ABS) { -+ verbose(cbs->private_data, "(%02x) r0 = *(%s *)skb[%d]\n", -+ insn->code, -+ bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -+ insn->imm); -+ } else if (BPF_MODE(insn->code) == BPF_IND) { -+ verbose(cbs->private_data, "(%02x) r0 = *(%s *)skb[r%d + %d]\n", -+ insn->code, -+ bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -+ insn->src_reg, insn->imm); -+ } else if (BPF_MODE(insn->code) == BPF_IMM && -+ BPF_SIZE(insn->code) == BPF_DW) { -+ /* At this point, we already made sure that the second -+ * part of the ldimm64 insn is accessible. -+ */ -+ u64 imm = ((u64)(insn + 1)->imm << 32) | (u32)insn->imm; -+ bool is_ptr = insn->src_reg == BPF_PSEUDO_MAP_FD || -+ insn->src_reg == BPF_PSEUDO_MAP_VALUE; -+ char tmp[64]; -+ -+ if (is_ptr && !allow_ptr_leaks) -+ imm = 0; -+ -+ verbose(cbs->private_data, "(%02x) r%d = %s\n", -+ insn->code, insn->dst_reg, -+ __func_imm_name(cbs, insn, imm, -+ tmp, sizeof(tmp))); -+ } else { -+ verbose(cbs->private_data, "BUG_ld_%02x\n", insn->code); -+ return; -+ } -+ } else if (class == BPF_JMP32 || class == BPF_JMP) { -+ u8 opcode = BPF_OP(insn->code); -+ -+ if (opcode == BPF_CALL) { -+ char tmp[64]; -+ -+ if (insn->src_reg == BPF_PSEUDO_CALL) { -+ verbose(cbs->private_data, "(%02x) call pc%s\n", -+ insn->code, -+ __func_get_name(cbs, insn, -+ tmp, sizeof(tmp))); -+ } else { -+ strcpy(tmp, "unknown"); -+ verbose(cbs->private_data, "(%02x) call %s#%d\n", insn->code, -+ __func_get_name(cbs, insn, -+ tmp, sizeof(tmp)), -+ insn->imm); -+ } -+ } else if (insn->code == (BPF_JMP | BPF_JA)) { -+ verbose(cbs->private_data, "(%02x) goto pc%+d\n", -+ insn->code, insn->off); -+ } else if (insn->code == (BPF_JMP | BPF_EXIT)) { -+ verbose(cbs->private_data, "(%02x) exit\n", insn->code); -+ } else if (BPF_SRC(insn->code) == BPF_X) { -+ verbose(cbs->private_data, -+ "(%02x) if %c%d %s %c%d goto pc%+d\n", -+ insn->code, class == BPF_JMP32 ? 'w' : 'r', -+ insn->dst_reg, -+ bpf_jmp_string[BPF_OP(insn->code) >> 4], -+ class == BPF_JMP32 ? 'w' : 'r', -+ insn->src_reg, insn->off); -+ } else { -+ verbose(cbs->private_data, -+ "(%02x) if %c%d %s 0x%x goto pc%+d\n", -+ insn->code, class == BPF_JMP32 ? 'w' : 'r', -+ insn->dst_reg, -+ bpf_jmp_string[BPF_OP(insn->code) >> 4], -+ insn->imm, insn->off); -+ } -+ } else { -+ verbose(cbs->private_data, "(%02x) %s\n", -+ insn->code, bpf_class_string[class]); -+ } -+} ---- /dev/null -+++ b/kernel/bpf/disasm.h -@@ -0,0 +1,40 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -+ * Copyright (c) 2016 Facebook -+ */ -+ -+#ifndef __BPF_DISASM_H__ -+#define __BPF_DISASM_H__ -+ -+#include -+#include -+#include -+#ifndef __KERNEL__ -+#include -+#include -+#endif -+ -+extern const char *const bpf_alu_string[16]; -+extern const char *const bpf_class_string[8]; -+ -+const char *func_id_name(int id); -+ -+typedef __printf(2, 3) void (*bpf_insn_print_t)(void *private_data, -+ const char *, ...); -+typedef const char *(*bpf_insn_revmap_call_t)(void *private_data, -+ const struct bpf_insn *insn); -+typedef const char *(*bpf_insn_print_imm_t)(void *private_data, -+ const struct bpf_insn *insn, -+ __u64 full_imm); -+ -+struct bpf_insn_cbs { -+ bpf_insn_print_t cb_print; -+ bpf_insn_revmap_call_t cb_call; -+ bpf_insn_print_imm_t cb_imm; -+ void *private_data; -+}; -+ -+void print_bpf_insn(const struct bpf_insn_cbs *cbs, -+ const struct bpf_insn *insn, -+ bool allow_ptr_leaks); -+#endif ---- a/kernel/bpf/hashtab.c -+++ b/kernel/bpf/hashtab.c -@@ -1,147 +1,467 @@ -+// SPDX-License-Identifier: GPL-2.0-only - /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of version 2 of the GNU General Public -- * License as published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, but -- * WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * General Public License for more details. -+ * Copyright (c) 2016 Facebook - */ - #include -+#include - #include - #include --#include -+#include -+#include -+#include -+#include "percpu_freelist.h" -+#include "bpf_lru_list.h" -+#include "map_in_map.h" -+ -+#define HTAB_CREATE_FLAG_MASK \ -+ (BPF_F_NO_PREALLOC | BPF_F_NO_COMMON_LRU | BPF_F_NUMA_NODE | \ -+ BPF_F_ACCESS_MASK | BPF_F_ZERO_SEED) -+ -+struct bucket { -+ struct hlist_nulls_head head; -+ raw_spinlock_t lock; -+}; - - struct bpf_htab { - struct bpf_map map; -- struct hlist_head *buckets; -- raw_spinlock_t lock; -- u32 count; /* number of elements in this hashtable */ -+ struct bucket *buckets; -+ void *elems; -+ union { -+ struct pcpu_freelist freelist; -+ struct bpf_lru lru; -+ }; -+ struct htab_elem *__percpu *extra_elems; -+ atomic_t count; /* number of elements in this hashtable */ - u32 n_buckets; /* number of hash buckets */ - u32 elem_size; /* size of each element in bytes */ -+ u32 hashrnd; - }; - - /* each htab element is struct htab_elem + key + value */ - struct htab_elem { -- struct hlist_node hash_node; -- struct rcu_head rcu; -+ union { -+ struct hlist_nulls_node hash_node; -+ struct { -+ void *padding; -+ union { -+ struct bpf_htab *htab; -+ struct pcpu_freelist_node fnode; -+ }; -+ }; -+ }; -+ union { -+ struct rcu_head rcu; -+ struct bpf_lru_node lru_node; -+ }; - u32 hash; - char key[0] __aligned(8); - }; - -+static bool htab_lru_map_delete_node(void *arg, struct bpf_lru_node *node); -+ -+static bool htab_is_lru(const struct bpf_htab *htab) -+{ -+ return htab->map.map_type == BPF_MAP_TYPE_LRU_HASH || -+ htab->map.map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH; -+} -+ -+static bool htab_is_percpu(const struct bpf_htab *htab) -+{ -+ return htab->map.map_type == BPF_MAP_TYPE_PERCPU_HASH || -+ htab->map.map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH; -+} -+ -+static bool htab_is_prealloc(const struct bpf_htab *htab) -+{ -+ return !(htab->map.map_flags & BPF_F_NO_PREALLOC); -+} -+ -+static inline void htab_elem_set_ptr(struct htab_elem *l, u32 key_size, -+ void __percpu *pptr) -+{ -+ *(void __percpu **)(l->key + key_size) = pptr; -+} -+ -+static inline void __percpu *htab_elem_get_ptr(struct htab_elem *l, u32 key_size) -+{ -+ return *(void __percpu **)(l->key + key_size); -+} -+ -+static void *fd_htab_map_get_ptr(const struct bpf_map *map, struct htab_elem *l) -+{ -+ return *(void **)(l->key + roundup(map->key_size, 8)); -+} -+ -+static struct htab_elem *get_htab_elem(struct bpf_htab *htab, int i) -+{ -+ return (struct htab_elem *) (htab->elems + i * htab->elem_size); -+} -+ -+static void htab_free_elems(struct bpf_htab *htab) -+{ -+ int i; -+ -+ if (!htab_is_percpu(htab)) -+ goto free_elems; -+ -+ for (i = 0; i < htab->map.max_entries; i++) { -+ void __percpu *pptr; -+ -+ pptr = htab_elem_get_ptr(get_htab_elem(htab, i), -+ htab->map.key_size); -+ free_percpu(pptr); -+ cond_resched(); -+ } -+free_elems: -+ bpf_map_area_free(htab->elems); -+} -+ -+static struct htab_elem *prealloc_lru_pop(struct bpf_htab *htab, void *key, -+ u32 hash) -+{ -+ struct bpf_lru_node *node = bpf_lru_pop_free(&htab->lru, hash); -+ struct htab_elem *l; -+ -+ if (node) { -+ l = container_of(node, struct htab_elem, lru_node); -+ memcpy(l->key, key, htab->map.key_size); -+ return l; -+ } -+ -+ return NULL; -+} -+ -+static int prealloc_init(struct bpf_htab *htab) -+{ -+ u32 num_entries = htab->map.max_entries; -+ int err = -ENOMEM, i; -+ -+ if (!htab_is_percpu(htab) && !htab_is_lru(htab)) -+ num_entries += num_possible_cpus(); -+ -+ htab->elems = bpf_map_area_alloc(htab->elem_size * num_entries, -+ htab->map.numa_node); -+ if (!htab->elems) -+ return -ENOMEM; -+ -+ if (!htab_is_percpu(htab)) -+ goto skip_percpu_elems; -+ -+ for (i = 0; i < num_entries; i++) { -+ u32 size = round_up(htab->map.value_size, 8); -+ void __percpu *pptr; -+ -+ pptr = __alloc_percpu_gfp(size, 8, GFP_USER | __GFP_NOWARN); -+ if (!pptr) -+ goto free_elems; -+ htab_elem_set_ptr(get_htab_elem(htab, i), htab->map.key_size, -+ pptr); -+ cond_resched(); -+ } -+ -+skip_percpu_elems: -+ if (htab_is_lru(htab)) -+ err = bpf_lru_init(&htab->lru, -+ htab->map.map_flags & BPF_F_NO_COMMON_LRU, -+ offsetof(struct htab_elem, hash) - -+ offsetof(struct htab_elem, lru_node), -+ htab_lru_map_delete_node, -+ htab); -+ else -+ err = pcpu_freelist_init(&htab->freelist); -+ -+ if (err) -+ goto free_elems; -+ -+ if (htab_is_lru(htab)) -+ bpf_lru_populate(&htab->lru, htab->elems, -+ offsetof(struct htab_elem, lru_node), -+ htab->elem_size, num_entries); -+ else -+ pcpu_freelist_populate(&htab->freelist, -+ htab->elems + offsetof(struct htab_elem, fnode), -+ htab->elem_size, num_entries); -+ -+ return 0; -+ -+free_elems: -+ htab_free_elems(htab); -+ return err; -+} -+ -+static void prealloc_destroy(struct bpf_htab *htab) -+{ -+ htab_free_elems(htab); -+ -+ if (htab_is_lru(htab)) -+ bpf_lru_destroy(&htab->lru); -+ else -+ pcpu_freelist_destroy(&htab->freelist); -+} -+ -+static int alloc_extra_elems(struct bpf_htab *htab) -+{ -+ struct htab_elem *__percpu *pptr, *l_new; -+ struct pcpu_freelist_node *l; -+ int cpu; -+ -+ pptr = __alloc_percpu_gfp(sizeof(struct htab_elem *), 8, -+ GFP_USER | __GFP_NOWARN); -+ if (!pptr) -+ return -ENOMEM; -+ -+ for_each_possible_cpu(cpu) { -+ l = pcpu_freelist_pop(&htab->freelist); -+ /* pop will succeed, since prealloc_init() -+ * preallocated extra num_possible_cpus elements -+ */ -+ l_new = container_of(l, struct htab_elem, fnode); -+ *per_cpu_ptr(pptr, cpu) = l_new; -+ } -+ htab->extra_elems = pptr; -+ return 0; -+} -+ - /* Called from syscall */ --static struct bpf_map *htab_map_alloc(union bpf_attr *attr) -+static int htab_map_alloc_check(union bpf_attr *attr) - { -- struct bpf_htab *htab; -- int err, i; -+ bool percpu = (attr->map_type == BPF_MAP_TYPE_PERCPU_HASH || -+ attr->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH); -+ bool lru = (attr->map_type == BPF_MAP_TYPE_LRU_HASH || -+ attr->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH); -+ /* percpu_lru means each cpu has its own LRU list. -+ * it is different from BPF_MAP_TYPE_PERCPU_HASH where -+ * the map's value itself is percpu. percpu_lru has -+ * nothing to do with the map's value. -+ */ -+ bool percpu_lru = (attr->map_flags & BPF_F_NO_COMMON_LRU); -+ bool prealloc = !(attr->map_flags & BPF_F_NO_PREALLOC); -+ bool zero_seed = (attr->map_flags & BPF_F_ZERO_SEED); -+ int numa_node = bpf_map_attr_numa_node(attr); -+ -+ BUILD_BUG_ON(offsetof(struct htab_elem, htab) != -+ offsetof(struct htab_elem, hash_node.pprev)); -+ BUILD_BUG_ON(offsetof(struct htab_elem, fnode.next) != -+ offsetof(struct htab_elem, hash_node.pprev)); -+ -+ if (lru && !capable(CAP_SYS_ADMIN)) -+ /* LRU implementation is much complicated than other -+ * maps. Hence, limit to CAP_SYS_ADMIN for now. -+ */ -+ return -EPERM; - -- htab = kzalloc(sizeof(*htab), GFP_USER); -- if (!htab) -- return ERR_PTR(-ENOMEM); -+ if (zero_seed && !capable(CAP_SYS_ADMIN)) -+ /* Guard against local DoS, and discourage production use. */ -+ return -EPERM; - -- /* mandatory map attributes */ -- htab->map.key_size = attr->key_size; -- htab->map.value_size = attr->value_size; -- htab->map.max_entries = attr->max_entries; -+ if (attr->map_flags & ~HTAB_CREATE_FLAG_MASK || -+ !bpf_map_flags_access_ok(attr->map_flags)) -+ return -EINVAL; -+ -+ if (!lru && percpu_lru) -+ return -EINVAL; -+ -+ if (lru && !prealloc) -+ return -ENOTSUPP; -+ -+ if (numa_node != NUMA_NO_NODE && (percpu || percpu_lru)) -+ return -EINVAL; - - /* check sanity of attributes. - * value_size == 0 may be allowed in the future to use map as a set - */ -- err = -EINVAL; -- if (htab->map.max_entries == 0 || htab->map.key_size == 0 || -- htab->map.value_size == 0) -- goto free_htab; -- -- /* hash table size must be power of 2 */ -- htab->n_buckets = roundup_pow_of_two(htab->map.max_entries); -+ if (attr->max_entries == 0 || attr->key_size == 0 || -+ attr->value_size == 0) -+ return -EINVAL; - -- err = -E2BIG; -- if (htab->map.key_size > MAX_BPF_STACK) -+ if (attr->key_size > MAX_BPF_STACK) - /* eBPF programs initialize keys on stack, so they cannot be - * larger than max stack size - */ -- goto free_htab; -+ return -E2BIG; - -- if (htab->map.value_size >= (1 << (KMALLOC_SHIFT_MAX - 1)) - -+ if (attr->value_size >= KMALLOC_MAX_SIZE - - MAX_BPF_STACK - sizeof(struct htab_elem)) - /* if value_size is bigger, the user space won't be able to - * access the elements via bpf syscall. This check also makes - * sure that the elem_size doesn't overflow and it's - * kmalloc-able later in htab_map_update_elem() - */ -- goto free_htab; -+ return -E2BIG; -+ -+ return 0; -+} -+ -+static struct bpf_map *htab_map_alloc(union bpf_attr *attr) -+{ -+ bool percpu = (attr->map_type == BPF_MAP_TYPE_PERCPU_HASH || -+ attr->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH); -+ bool lru = (attr->map_type == BPF_MAP_TYPE_LRU_HASH || -+ attr->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH); -+ /* percpu_lru means each cpu has its own LRU list. -+ * it is different from BPF_MAP_TYPE_PERCPU_HASH where -+ * the map's value itself is percpu. percpu_lru has -+ * nothing to do with the map's value. -+ */ -+ bool percpu_lru = (attr->map_flags & BPF_F_NO_COMMON_LRU); -+ bool prealloc = !(attr->map_flags & BPF_F_NO_PREALLOC); -+ struct bpf_htab *htab; -+ int err, i; -+ u64 cost; -+ -+ htab = kzalloc(sizeof(*htab), GFP_USER); -+ if (!htab) -+ return ERR_PTR(-ENOMEM); -+ -+ bpf_map_init_from_attr(&htab->map, attr); -+ -+ if (percpu_lru) { -+ /* ensure each CPU's lru list has >=1 elements. -+ * since we are at it, make each lru list has the same -+ * number of elements. -+ */ -+ htab->map.max_entries = roundup(attr->max_entries, -+ num_possible_cpus()); -+ if (htab->map.max_entries < attr->max_entries) -+ htab->map.max_entries = rounddown(attr->max_entries, -+ num_possible_cpus()); -+ } -+ -+ /* hash table size must be power of 2 */ -+ htab->n_buckets = roundup_pow_of_two(htab->map.max_entries); - - htab->elem_size = sizeof(struct htab_elem) + -- round_up(htab->map.key_size, 8) + -- htab->map.value_size; -+ round_up(htab->map.key_size, 8); -+ if (percpu) -+ htab->elem_size += sizeof(void *); -+ else -+ htab->elem_size += round_up(htab->map.value_size, 8); - -+ err = -E2BIG; - /* prevent zero size kmalloc and check for u32 overflow */ - if (htab->n_buckets == 0 || -- htab->n_buckets > U32_MAX / sizeof(struct hlist_head)) -+ htab->n_buckets > U32_MAX / sizeof(struct bucket)) - goto free_htab; - -- if ((u64) htab->n_buckets * sizeof(struct hlist_head) + -- (u64) htab->elem_size * htab->map.max_entries >= -- U32_MAX - PAGE_SIZE) -- /* make sure page count doesn't overflow */ -- goto free_htab; -+ cost = (u64) htab->n_buckets * sizeof(struct bucket) + -+ (u64) htab->elem_size * htab->map.max_entries; - -- htab->map.pages = round_up(htab->n_buckets * sizeof(struct hlist_head) + -- htab->elem_size * htab->map.max_entries, -- PAGE_SIZE) >> PAGE_SHIFT; -+ if (percpu) -+ cost += (u64) round_up(htab->map.value_size, 8) * -+ num_possible_cpus() * htab->map.max_entries; -+ else -+ cost += (u64) htab->elem_size * num_possible_cpus(); -+ -+ /* if map size is larger than memlock limit, reject it */ -+ err = bpf_map_charge_init(&htab->map.memory, cost); -+ if (err) -+ goto free_htab; - - err = -ENOMEM; -- htab->buckets = kmalloc_array(htab->n_buckets, sizeof(struct hlist_head), -- GFP_USER | __GFP_NOWARN); -+ htab->buckets = bpf_map_area_alloc(htab->n_buckets * -+ sizeof(struct bucket), -+ htab->map.numa_node); -+ if (!htab->buckets) -+ goto free_charge; -+ -+ if (htab->map.map_flags & BPF_F_ZERO_SEED) -+ htab->hashrnd = 0; -+ else -+ htab->hashrnd = get_random_int(); - -- if (!htab->buckets) { -- htab->buckets = vmalloc(htab->n_buckets * sizeof(struct hlist_head)); -- if (!htab->buckets) -- goto free_htab; -+ for (i = 0; i < htab->n_buckets; i++) { -+ INIT_HLIST_NULLS_HEAD(&htab->buckets[i].head, i); -+ raw_spin_lock_init(&htab->buckets[i].lock); - } - -- for (i = 0; i < htab->n_buckets; i++) -- INIT_HLIST_HEAD(&htab->buckets[i]); -- -- raw_spin_lock_init(&htab->lock); -- htab->count = 0; -+ if (prealloc) { -+ err = prealloc_init(htab); -+ if (err) -+ goto free_buckets; -+ -+ if (!percpu && !lru) { -+ /* lru itself can remove the least used element, so -+ * there is no need for an extra elem during map_update. -+ */ -+ err = alloc_extra_elems(htab); -+ if (err) -+ goto free_prealloc; -+ } -+ } - - return &htab->map; - -+free_prealloc: -+ prealloc_destroy(htab); -+free_buckets: -+ bpf_map_area_free(htab->buckets); -+free_charge: -+ bpf_map_charge_finish(&htab->map.memory); - free_htab: - kfree(htab); - return ERR_PTR(err); - } - --static inline u32 htab_map_hash(const void *key, u32 key_len) -+static inline u32 htab_map_hash(const void *key, u32 key_len, u32 hashrnd) - { -- return jhash(key, key_len, 0); -+ return jhash(key, key_len, hashrnd); - } - --static inline struct hlist_head *select_bucket(struct bpf_htab *htab, u32 hash) -+static inline struct bucket *__select_bucket(struct bpf_htab *htab, u32 hash) - { - return &htab->buckets[hash & (htab->n_buckets - 1)]; - } - --static struct htab_elem *lookup_elem_raw(struct hlist_head *head, u32 hash, -+static inline struct hlist_nulls_head *select_bucket(struct bpf_htab *htab, u32 hash) -+{ -+ return &__select_bucket(htab, hash)->head; -+} -+ -+/* this lookup function can only be called with bucket lock taken */ -+static struct htab_elem *lookup_elem_raw(struct hlist_nulls_head *head, u32 hash, - void *key, u32 key_size) - { -+ struct hlist_nulls_node *n; - struct htab_elem *l; - -- hlist_for_each_entry_rcu(l, head, hash_node) -+ hlist_nulls_for_each_entry_rcu(l, n, head, hash_node) - if (l->hash == hash && !memcmp(&l->key, key, key_size)) - return l; - - return NULL; - } - --/* Called from syscall or from eBPF program */ --static void *htab_map_lookup_elem(struct bpf_map *map, void *key) -+/* can be called without bucket lock. it will repeat the loop in -+ * the unlikely event when elements moved from one bucket into another -+ * while link list is being walked -+ */ -+static struct htab_elem *lookup_nulls_elem_raw(struct hlist_nulls_head *head, -+ u32 hash, void *key, -+ u32 key_size, u32 n_buckets) -+{ -+ struct hlist_nulls_node *n; -+ struct htab_elem *l; -+ -+again: -+ hlist_nulls_for_each_entry_rcu(l, n, head, hash_node) -+ if (l->hash == hash && !memcmp(&l->key, key, key_size)) -+ return l; -+ -+ if (unlikely(get_nulls_value(n) != (hash & (n_buckets - 1)))) -+ goto again; -+ -+ return NULL; -+} -+ -+/* Called from syscall or from eBPF program directly, so -+ * arguments have to match bpf_map_lookup_elem() exactly. -+ * The return value is adjusted by BPF instructions -+ * in htab_map_gen_lookup(). -+ */ -+static void *__htab_map_lookup_elem(struct bpf_map *map, void *key) - { - struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -- struct hlist_head *head; -+ struct hlist_nulls_head *head; - struct htab_elem *l; - u32 hash, key_size; - -@@ -150,11 +470,18 @@ static void *htab_map_lookup_elem(struct - - key_size = map->key_size; - -- hash = htab_map_hash(key, key_size); -+ hash = htab_map_hash(key, key_size, htab->hashrnd); - - head = select_bucket(htab, hash); - -- l = lookup_elem_raw(head, hash, key, key_size); -+ l = lookup_nulls_elem_raw(head, hash, key, key_size, htab->n_buckets); -+ -+ return l; -+} -+ -+static void *htab_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ struct htab_elem *l = __htab_map_lookup_elem(map, key); - - if (l) - return l->key + round_up(map->key_size, 8); -@@ -162,33 +489,138 @@ static void *htab_map_lookup_elem(struct - return NULL; - } - -+/* inline bpf_map_lookup_elem() call. -+ * Instead of: -+ * bpf_prog -+ * bpf_map_lookup_elem -+ * map->ops->map_lookup_elem -+ * htab_map_lookup_elem -+ * __htab_map_lookup_elem -+ * do: -+ * bpf_prog -+ * __htab_map_lookup_elem -+ */ -+static u32 htab_map_gen_lookup(struct bpf_map *map, struct bpf_insn *insn_buf) -+{ -+ struct bpf_insn *insn = insn_buf; -+ const int ret = BPF_REG_0; -+ -+ BUILD_BUG_ON(!__same_type(&__htab_map_lookup_elem, -+ (void *(*)(struct bpf_map *map, void *key))NULL)); -+ *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem)); -+ *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 1); -+ *insn++ = BPF_ALU64_IMM(BPF_ADD, ret, -+ offsetof(struct htab_elem, key) + -+ round_up(map->key_size, 8)); -+ return insn - insn_buf; -+} -+ -+static __always_inline void *__htab_lru_map_lookup_elem(struct bpf_map *map, -+ void *key, const bool mark) -+{ -+ struct htab_elem *l = __htab_map_lookup_elem(map, key); -+ -+ if (l) { -+ if (mark) -+ bpf_lru_node_set_ref(&l->lru_node); -+ return l->key + round_up(map->key_size, 8); -+ } -+ -+ return NULL; -+} -+ -+static void *htab_lru_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ return __htab_lru_map_lookup_elem(map, key, true); -+} -+ -+static void *htab_lru_map_lookup_elem_sys(struct bpf_map *map, void *key) -+{ -+ return __htab_lru_map_lookup_elem(map, key, false); -+} -+ -+static u32 htab_lru_map_gen_lookup(struct bpf_map *map, -+ struct bpf_insn *insn_buf) -+{ -+ struct bpf_insn *insn = insn_buf; -+ const int ret = BPF_REG_0; -+ const int ref_reg = BPF_REG_1; -+ -+ BUILD_BUG_ON(!__same_type(&__htab_map_lookup_elem, -+ (void *(*)(struct bpf_map *map, void *key))NULL)); -+ *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem)); -+ *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 4); -+ *insn++ = BPF_LDX_MEM(BPF_B, ref_reg, ret, -+ offsetof(struct htab_elem, lru_node) + -+ offsetof(struct bpf_lru_node, ref)); -+ *insn++ = BPF_JMP_IMM(BPF_JNE, ref_reg, 0, 1); -+ *insn++ = BPF_ST_MEM(BPF_B, ret, -+ offsetof(struct htab_elem, lru_node) + -+ offsetof(struct bpf_lru_node, ref), -+ 1); -+ *insn++ = BPF_ALU64_IMM(BPF_ADD, ret, -+ offsetof(struct htab_elem, key) + -+ round_up(map->key_size, 8)); -+ return insn - insn_buf; -+} -+ -+/* It is called from the bpf_lru_list when the LRU needs to delete -+ * older elements from the htab. -+ */ -+static bool htab_lru_map_delete_node(void *arg, struct bpf_lru_node *node) -+{ -+ struct bpf_htab *htab = (struct bpf_htab *)arg; -+ struct htab_elem *l = NULL, *tgt_l; -+ struct hlist_nulls_head *head; -+ struct hlist_nulls_node *n; -+ unsigned long flags; -+ struct bucket *b; -+ -+ tgt_l = container_of(node, struct htab_elem, lru_node); -+ b = __select_bucket(htab, tgt_l->hash); -+ head = &b->head; -+ -+ raw_spin_lock_irqsave(&b->lock, flags); -+ -+ hlist_nulls_for_each_entry_rcu(l, n, head, hash_node) -+ if (l == tgt_l) { -+ hlist_nulls_del_rcu(&l->hash_node); -+ break; -+ } -+ -+ raw_spin_unlock_irqrestore(&b->lock, flags); -+ -+ return l == tgt_l; -+} -+ - /* Called from syscall */ - static int htab_map_get_next_key(struct bpf_map *map, void *key, void *next_key) - { - struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -- struct hlist_head *head; -+ struct hlist_nulls_head *head; - struct htab_elem *l, *next_l; - u32 hash, key_size; -- int i; -+ int i = 0; - - WARN_ON_ONCE(!rcu_read_lock_held()); - - key_size = map->key_size; - -- hash = htab_map_hash(key, key_size); -+ if (!key) -+ goto find_first_elem; -+ -+ hash = htab_map_hash(key, key_size, htab->hashrnd); - - head = select_bucket(htab, hash); - - /* lookup the key */ -- l = lookup_elem_raw(head, hash, key, key_size); -+ l = lookup_nulls_elem_raw(head, hash, key, key_size, htab->n_buckets); - -- if (!l) { -- i = 0; -+ if (!l) - goto find_first_elem; -- } - - /* key was found, get next key in the same bucket */ -- next_l = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(&l->hash_node)), -+ next_l = hlist_nulls_entry_safe(rcu_dereference_raw(hlist_nulls_next_rcu(&l->hash_node)), - struct htab_elem, hash_node); - - if (next_l) { -@@ -207,7 +639,7 @@ find_first_elem: - head = select_bucket(htab, i); - - /* pick first element in the bucket */ -- next_l = hlist_entry_safe(rcu_dereference_raw(hlist_first_rcu(head)), -+ next_l = hlist_nulls_entry_safe(rcu_dereference_raw(hlist_nulls_first_rcu(head)), - struct htab_elem, hash_node); - if (next_l) { - /* if it's not empty, just return it */ -@@ -216,90 +648,491 @@ find_first_elem: - } - } - -- /* itereated over all buckets and all elements */ -+ /* iterated over all buckets and all elements */ - return -ENOENT; - } - -+static void htab_elem_free(struct bpf_htab *htab, struct htab_elem *l) -+{ -+ if (htab->map.map_type == BPF_MAP_TYPE_PERCPU_HASH) -+ free_percpu(htab_elem_get_ptr(l, htab->map.key_size)); -+ kfree(l); -+} -+ -+static void htab_elem_free_rcu(struct rcu_head *head) -+{ -+ struct htab_elem *l = container_of(head, struct htab_elem, rcu); -+ struct bpf_htab *htab = l->htab; -+ -+ htab_elem_free(htab, l); -+} -+ -+static void htab_put_fd_value(struct bpf_htab *htab, struct htab_elem *l) -+{ -+ struct bpf_map *map = &htab->map; -+ void *ptr; -+ -+ if (map->ops->map_fd_put_ptr) { -+ ptr = fd_htab_map_get_ptr(map, l); -+ map->ops->map_fd_put_ptr(ptr); -+ } -+} -+ -+static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l) -+{ -+ htab_put_fd_value(htab, l); -+ -+ if (htab_is_prealloc(htab)) { -+ __pcpu_freelist_push(&htab->freelist, &l->fnode); -+ } else { -+ atomic_dec(&htab->count); -+ l->htab = htab; -+ call_rcu(&l->rcu, htab_elem_free_rcu); -+ } -+} -+ -+static void pcpu_copy_value(struct bpf_htab *htab, void __percpu *pptr, -+ void *value, bool onallcpus) -+{ -+ if (!onallcpus) { -+ /* copy true value_size bytes */ -+ memcpy(this_cpu_ptr(pptr), value, htab->map.value_size); -+ } else { -+ u32 size = round_up(htab->map.value_size, 8); -+ int off = 0, cpu; -+ -+ for_each_possible_cpu(cpu) { -+ bpf_long_memcpy(per_cpu_ptr(pptr, cpu), -+ value + off, size); -+ off += size; -+ } -+ } -+} -+ -+static void pcpu_init_value(struct bpf_htab *htab, void __percpu *pptr, -+ void *value, bool onallcpus) -+{ -+ /* When using prealloc and not setting the initial value on all cpus, -+ * zero-fill element values for other cpus (just as what happens when -+ * not using prealloc). Otherwise, bpf program has no way to ensure -+ * known initial values for cpus other than current one -+ * (onallcpus=false always when coming from bpf prog). -+ */ -+ if (htab_is_prealloc(htab) && !onallcpus) { -+ u32 size = round_up(htab->map.value_size, 8); -+ int current_cpu = raw_smp_processor_id(); -+ int cpu; -+ -+ for_each_possible_cpu(cpu) { -+ if (cpu == current_cpu) -+ bpf_long_memcpy(per_cpu_ptr(pptr, cpu), value, -+ size); -+ else -+ memset(per_cpu_ptr(pptr, cpu), 0, size); -+ } -+ } else { -+ pcpu_copy_value(htab, pptr, value, onallcpus); -+ } -+} -+ -+static bool fd_htab_map_needs_adjust(const struct bpf_htab *htab) -+{ -+ return htab->map.map_type == BPF_MAP_TYPE_HASH_OF_MAPS && -+ BITS_PER_LONG == 64; -+} -+ -+static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key, -+ void *value, u32 key_size, u32 hash, -+ bool percpu, bool onallcpus, -+ struct htab_elem *old_elem) -+{ -+ u32 size = htab->map.value_size; -+ bool prealloc = htab_is_prealloc(htab); -+ struct htab_elem *l_new, **pl_new; -+ void __percpu *pptr; -+ -+ if (prealloc) { -+ if (old_elem) { -+ /* if we're updating the existing element, -+ * use per-cpu extra elems to avoid freelist_pop/push -+ */ -+ pl_new = this_cpu_ptr(htab->extra_elems); -+ l_new = *pl_new; -+ htab_put_fd_value(htab, old_elem); -+ *pl_new = old_elem; -+ } else { -+ struct pcpu_freelist_node *l; -+ -+ l = __pcpu_freelist_pop(&htab->freelist); -+ if (!l) -+ return ERR_PTR(-E2BIG); -+ l_new = container_of(l, struct htab_elem, fnode); -+ } -+ } else { -+ if (atomic_inc_return(&htab->count) > htab->map.max_entries) -+ if (!old_elem) { -+ /* when map is full and update() is replacing -+ * old element, it's ok to allocate, since -+ * old element will be freed immediately. -+ * Otherwise return an error -+ */ -+ l_new = ERR_PTR(-E2BIG); -+ goto dec_count; -+ } -+ l_new = kmalloc_node(htab->elem_size, GFP_ATOMIC | __GFP_NOWARN, -+ htab->map.numa_node); -+ if (!l_new) { -+ l_new = ERR_PTR(-ENOMEM); -+ goto dec_count; -+ } -+ check_and_init_map_lock(&htab->map, -+ l_new->key + round_up(key_size, 8)); -+ } -+ -+ memcpy(l_new->key, key, key_size); -+ if (percpu) { -+ size = round_up(size, 8); -+ if (prealloc) { -+ pptr = htab_elem_get_ptr(l_new, key_size); -+ } else { -+ /* alloc_percpu zero-fills */ -+ pptr = __alloc_percpu_gfp(size, 8, -+ GFP_ATOMIC | __GFP_NOWARN); -+ if (!pptr) { -+ kfree(l_new); -+ l_new = ERR_PTR(-ENOMEM); -+ goto dec_count; -+ } -+ } -+ -+ pcpu_init_value(htab, pptr, value, onallcpus); -+ -+ if (!prealloc) -+ htab_elem_set_ptr(l_new, key_size, pptr); -+ } else if (fd_htab_map_needs_adjust(htab)) { -+ size = round_up(size, 8); -+ memcpy(l_new->key + round_up(key_size, 8), value, size); -+ } else { -+ copy_map_value(&htab->map, -+ l_new->key + round_up(key_size, 8), -+ value); -+ } -+ -+ l_new->hash = hash; -+ return l_new; -+dec_count: -+ atomic_dec(&htab->count); -+ return l_new; -+} -+ -+static int check_flags(struct bpf_htab *htab, struct htab_elem *l_old, -+ u64 map_flags) -+{ -+ if (l_old && (map_flags & ~BPF_F_LOCK) == BPF_NOEXIST) -+ /* elem already exists */ -+ return -EEXIST; -+ -+ if (!l_old && (map_flags & ~BPF_F_LOCK) == BPF_EXIST) -+ /* elem doesn't exist, cannot update it */ -+ return -ENOENT; -+ -+ return 0; -+} -+ - /* Called from syscall or from eBPF program */ - static int htab_map_update_elem(struct bpf_map *map, void *key, void *value, - u64 map_flags) - { - struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -- struct htab_elem *l_new, *l_old; -- struct hlist_head *head; -+ struct htab_elem *l_new = NULL, *l_old; -+ struct hlist_nulls_head *head; - unsigned long flags; -- u32 key_size; -+ struct bucket *b; -+ u32 key_size, hash; - int ret; - -- if (map_flags > BPF_EXIST) -+ if (unlikely((map_flags & ~BPF_F_LOCK) > BPF_EXIST)) - /* unknown flags */ - return -EINVAL; - - WARN_ON_ONCE(!rcu_read_lock_held()); - -- /* allocate new element outside of lock */ -- l_new = kmalloc(htab->elem_size, GFP_ATOMIC | __GFP_NOWARN); -- if (!l_new) -- return -ENOMEM; -- - key_size = map->key_size; - -- memcpy(l_new->key, key, key_size); -- memcpy(l_new->key + round_up(key_size, 8), value, map->value_size); -+ hash = htab_map_hash(key, key_size, htab->hashrnd); -+ -+ b = __select_bucket(htab, hash); -+ head = &b->head; - -- l_new->hash = htab_map_hash(l_new->key, key_size); -+ if (unlikely(map_flags & BPF_F_LOCK)) { -+ if (unlikely(!map_value_has_spin_lock(map))) -+ return -EINVAL; -+ /* find an element without taking the bucket lock */ -+ l_old = lookup_nulls_elem_raw(head, hash, key, key_size, -+ htab->n_buckets); -+ ret = check_flags(htab, l_old, map_flags); -+ if (ret) -+ return ret; -+ if (l_old) { -+ /* grab the element lock and update value in place */ -+ copy_map_value_locked(map, -+ l_old->key + round_up(key_size, 8), -+ value, false); -+ return 0; -+ } -+ /* fall through, grab the bucket lock and lookup again. -+ * 99.9% chance that the element won't be found, -+ * but second lookup under lock has to be done. -+ */ -+ } - - /* bpf_map_update_elem() can be called in_irq() */ -- raw_spin_lock_irqsave(&htab->lock, flags); -+ raw_spin_lock_irqsave(&b->lock, flags); - -- head = select_bucket(htab, l_new->hash); -+ l_old = lookup_elem_raw(head, hash, key, key_size); - -- l_old = lookup_elem_raw(head, l_new->hash, key, key_size); -+ ret = check_flags(htab, l_old, map_flags); -+ if (ret) -+ goto err; - -- if (!l_old && unlikely(htab->count >= map->max_entries)) { -- /* if elem with this 'key' doesn't exist and we've reached -- * max_entries limit, fail insertion of new elem -+ if (unlikely(l_old && (map_flags & BPF_F_LOCK))) { -+ /* first lookup without the bucket lock didn't find the element, -+ * but second lookup with the bucket lock found it. -+ * This case is highly unlikely, but has to be dealt with: -+ * grab the element lock in addition to the bucket lock -+ * and update element in place - */ -- ret = -E2BIG; -+ copy_map_value_locked(map, -+ l_old->key + round_up(key_size, 8), -+ value, false); -+ ret = 0; - goto err; - } - -- if (l_old && map_flags == BPF_NOEXIST) { -- /* elem already exists */ -- ret = -EEXIST; -+ l_new = alloc_htab_elem(htab, key, value, key_size, hash, false, false, -+ l_old); -+ if (IS_ERR(l_new)) { -+ /* all pre-allocated elements are in use or memory exhausted */ -+ ret = PTR_ERR(l_new); - goto err; - } - -- if (!l_old && map_flags == BPF_EXIST) { -- /* elem doesn't exist, cannot update it */ -- ret = -ENOENT; -- goto err; -+ /* add new element to the head of the list, so that -+ * concurrent search will find it before old elem -+ */ -+ hlist_nulls_add_head_rcu(&l_new->hash_node, head); -+ if (l_old) { -+ hlist_nulls_del_rcu(&l_old->hash_node); -+ if (!htab_is_prealloc(htab)) -+ free_htab_elem(htab, l_old); - } -+ ret = 0; -+err: -+ raw_spin_unlock_irqrestore(&b->lock, flags); -+ return ret; -+} - -- /* add new element to the head of the list, so that concurrent -- * search will find it before old elem -+static int htab_lru_map_update_elem(struct bpf_map *map, void *key, void *value, -+ u64 map_flags) -+{ -+ struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -+ struct htab_elem *l_new, *l_old = NULL; -+ struct hlist_nulls_head *head; -+ unsigned long flags; -+ struct bucket *b; -+ u32 key_size, hash; -+ int ret; -+ -+ if (unlikely(map_flags > BPF_EXIST)) -+ /* unknown flags */ -+ return -EINVAL; -+ -+ WARN_ON_ONCE(!rcu_read_lock_held()); -+ -+ key_size = map->key_size; -+ -+ hash = htab_map_hash(key, key_size, htab->hashrnd); -+ -+ b = __select_bucket(htab, hash); -+ head = &b->head; -+ -+ /* For LRU, we need to alloc before taking bucket's -+ * spinlock because getting free nodes from LRU may need -+ * to remove older elements from htab and this removal -+ * operation will need a bucket lock. - */ -- hlist_add_head_rcu(&l_new->hash_node, head); -+ l_new = prealloc_lru_pop(htab, key, hash); -+ if (!l_new) -+ return -ENOMEM; -+ memcpy(l_new->key + round_up(map->key_size, 8), value, map->value_size); -+ -+ /* bpf_map_update_elem() can be called in_irq() */ -+ raw_spin_lock_irqsave(&b->lock, flags); -+ -+ l_old = lookup_elem_raw(head, hash, key, key_size); -+ -+ ret = check_flags(htab, l_old, map_flags); -+ if (ret) -+ goto err; -+ -+ /* add new element to the head of the list, so that -+ * concurrent search will find it before old elem -+ */ -+ hlist_nulls_add_head_rcu(&l_new->hash_node, head); -+ if (l_old) { -+ bpf_lru_node_set_ref(&l_new->lru_node); -+ hlist_nulls_del_rcu(&l_old->hash_node); -+ } -+ ret = 0; -+ -+err: -+ raw_spin_unlock_irqrestore(&b->lock, flags); -+ -+ if (ret) -+ bpf_lru_push_free(&htab->lru, &l_new->lru_node); -+ else if (l_old) -+ bpf_lru_push_free(&htab->lru, &l_old->lru_node); -+ -+ return ret; -+} -+ -+static int __htab_percpu_map_update_elem(struct bpf_map *map, void *key, -+ void *value, u64 map_flags, -+ bool onallcpus) -+{ -+ struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -+ struct htab_elem *l_new = NULL, *l_old; -+ struct hlist_nulls_head *head; -+ unsigned long flags; -+ struct bucket *b; -+ u32 key_size, hash; -+ int ret; -+ -+ if (unlikely(map_flags > BPF_EXIST)) -+ /* unknown flags */ -+ return -EINVAL; -+ -+ WARN_ON_ONCE(!rcu_read_lock_held()); -+ -+ key_size = map->key_size; -+ -+ hash = htab_map_hash(key, key_size, htab->hashrnd); -+ -+ b = __select_bucket(htab, hash); -+ head = &b->head; -+ -+ /* bpf_map_update_elem() can be called in_irq() */ -+ raw_spin_lock_irqsave(&b->lock, flags); -+ -+ l_old = lookup_elem_raw(head, hash, key, key_size); -+ -+ ret = check_flags(htab, l_old, map_flags); -+ if (ret) -+ goto err; -+ - if (l_old) { -- hlist_del_rcu(&l_old->hash_node); -- kfree_rcu(l_old, rcu); -+ /* per-cpu hash map can update value in-place */ -+ pcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size), -+ value, onallcpus); - } else { -- htab->count++; -+ l_new = alloc_htab_elem(htab, key, value, key_size, -+ hash, true, onallcpus, NULL); -+ if (IS_ERR(l_new)) { -+ ret = PTR_ERR(l_new); -+ goto err; -+ } -+ hlist_nulls_add_head_rcu(&l_new->hash_node, head); - } -- raw_spin_unlock_irqrestore(&htab->lock, flags); -+ ret = 0; -+err: -+ raw_spin_unlock_irqrestore(&b->lock, flags); -+ return ret; -+} - -- return 0; -+static int __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key, -+ void *value, u64 map_flags, -+ bool onallcpus) -+{ -+ struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -+ struct htab_elem *l_new = NULL, *l_old; -+ struct hlist_nulls_head *head; -+ unsigned long flags; -+ struct bucket *b; -+ u32 key_size, hash; -+ int ret; -+ -+ if (unlikely(map_flags > BPF_EXIST)) -+ /* unknown flags */ -+ return -EINVAL; -+ -+ WARN_ON_ONCE(!rcu_read_lock_held()); -+ -+ key_size = map->key_size; -+ -+ hash = htab_map_hash(key, key_size, htab->hashrnd); -+ -+ b = __select_bucket(htab, hash); -+ head = &b->head; -+ -+ /* For LRU, we need to alloc before taking bucket's -+ * spinlock because LRU's elem alloc may need -+ * to remove older elem from htab and this removal -+ * operation will need a bucket lock. -+ */ -+ if (map_flags != BPF_EXIST) { -+ l_new = prealloc_lru_pop(htab, key, hash); -+ if (!l_new) -+ return -ENOMEM; -+ } -+ -+ /* bpf_map_update_elem() can be called in_irq() */ -+ raw_spin_lock_irqsave(&b->lock, flags); -+ -+ l_old = lookup_elem_raw(head, hash, key, key_size); -+ -+ ret = check_flags(htab, l_old, map_flags); -+ if (ret) -+ goto err; -+ -+ if (l_old) { -+ bpf_lru_node_set_ref(&l_old->lru_node); -+ -+ /* per-cpu hash map can update value in-place */ -+ pcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size), -+ value, onallcpus); -+ } else { -+ pcpu_init_value(htab, htab_elem_get_ptr(l_new, key_size), -+ value, onallcpus); -+ hlist_nulls_add_head_rcu(&l_new->hash_node, head); -+ l_new = NULL; -+ } -+ ret = 0; - err: -- raw_spin_unlock_irqrestore(&htab->lock, flags); -- kfree(l_new); -+ raw_spin_unlock_irqrestore(&b->lock, flags); -+ if (l_new) -+ bpf_lru_push_free(&htab->lru, &l_new->lru_node); - return ret; - } - -+static int htab_percpu_map_update_elem(struct bpf_map *map, void *key, -+ void *value, u64 map_flags) -+{ -+ return __htab_percpu_map_update_elem(map, key, value, map_flags, false); -+} -+ -+static int htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key, -+ void *value, u64 map_flags) -+{ -+ return __htab_lru_percpu_map_update_elem(map, key, value, map_flags, -+ false); -+} -+ - /* Called from syscall or from eBPF program */ - static int htab_map_delete_elem(struct bpf_map *map, void *key) - { - struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -- struct hlist_head *head; -+ struct hlist_nulls_head *head; -+ struct bucket *b; - struct htab_elem *l; - unsigned long flags; - u32 hash, key_size; -@@ -309,22 +1142,54 @@ static int htab_map_delete_elem(struct b - - key_size = map->key_size; - -- hash = htab_map_hash(key, key_size); -+ hash = htab_map_hash(key, key_size, htab->hashrnd); -+ b = __select_bucket(htab, hash); -+ head = &b->head; - -- raw_spin_lock_irqsave(&htab->lock, flags); -+ raw_spin_lock_irqsave(&b->lock, flags); - -- head = select_bucket(htab, hash); -+ l = lookup_elem_raw(head, hash, key, key_size); -+ -+ if (l) { -+ hlist_nulls_del_rcu(&l->hash_node); -+ free_htab_elem(htab, l); -+ ret = 0; -+ } -+ -+ raw_spin_unlock_irqrestore(&b->lock, flags); -+ return ret; -+} -+ -+static int htab_lru_map_delete_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -+ struct hlist_nulls_head *head; -+ struct bucket *b; -+ struct htab_elem *l; -+ unsigned long flags; -+ u32 hash, key_size; -+ int ret = -ENOENT; -+ -+ WARN_ON_ONCE(!rcu_read_lock_held()); -+ -+ key_size = map->key_size; -+ -+ hash = htab_map_hash(key, key_size, htab->hashrnd); -+ b = __select_bucket(htab, hash); -+ head = &b->head; -+ -+ raw_spin_lock_irqsave(&b->lock, flags); - - l = lookup_elem_raw(head, hash, key, key_size); - - if (l) { -- hlist_del_rcu(&l->hash_node); -- htab->count--; -- kfree_rcu(l, rcu); -+ hlist_nulls_del_rcu(&l->hash_node); - ret = 0; - } - -- raw_spin_unlock_irqrestore(&htab->lock, flags); -+ raw_spin_unlock_irqrestore(&b->lock, flags); -+ if (l) -+ bpf_lru_push_free(&htab->lru, &l->lru_node); - return ret; - } - -@@ -333,14 +1198,13 @@ static void delete_all_elements(struct b - int i; - - for (i = 0; i < htab->n_buckets; i++) { -- struct hlist_head *head = select_bucket(htab, i); -- struct hlist_node *n; -+ struct hlist_nulls_head *head = select_bucket(htab, i); -+ struct hlist_nulls_node *n; - struct htab_elem *l; - -- hlist_for_each_entry_safe(l, n, head, hash_node) { -- hlist_del_rcu(&l->hash_node); -- htab->count--; -- kfree(l); -+ hlist_nulls_for_each_entry_safe(l, n, head, hash_node) { -+ hlist_nulls_del_rcu(&l->hash_node); -+ htab_elem_free(htab, l); - } - } - } -@@ -357,31 +1221,320 @@ static void htab_map_free(struct bpf_map - */ - synchronize_rcu(); - -- /* some of kfree_rcu() callbacks for elements of this map may not have -- * executed. It's ok. Proceed to free residual elements and map itself -+ /* some of free_htab_elem() callbacks for elements of this map may -+ * not have executed. Wait for them. - */ -- delete_all_elements(htab); -- kvfree(htab->buckets); -+ rcu_barrier(); -+ if (!htab_is_prealloc(htab)) -+ delete_all_elements(htab); -+ else -+ prealloc_destroy(htab); -+ -+ free_percpu(htab->extra_elems); -+ bpf_map_area_free(htab->buckets); - kfree(htab); - } - --static const struct bpf_map_ops htab_ops = { -+static void htab_map_seq_show_elem(struct bpf_map *map, void *key, -+ struct seq_file *m) -+{ -+ void *value; -+ -+ rcu_read_lock(); -+ -+ value = htab_map_lookup_elem(map, key); -+ if (!value) { -+ rcu_read_unlock(); -+ return; -+ } -+ -+ btf_type_seq_show(map->btf, map->btf_key_type_id, key, m); -+ seq_puts(m, ": "); -+ btf_type_seq_show(map->btf, map->btf_value_type_id, value, m); -+ seq_puts(m, "\n"); -+ -+ rcu_read_unlock(); -+} -+ -+const struct bpf_map_ops htab_map_ops = { -+ .map_alloc_check = htab_map_alloc_check, - .map_alloc = htab_map_alloc, - .map_free = htab_map_free, - .map_get_next_key = htab_map_get_next_key, - .map_lookup_elem = htab_map_lookup_elem, - .map_update_elem = htab_map_update_elem, - .map_delete_elem = htab_map_delete_elem, -+ .map_gen_lookup = htab_map_gen_lookup, -+ .map_seq_show_elem = htab_map_seq_show_elem, - }; - --static struct bpf_map_type_list htab_type __read_mostly = { -- .ops = &htab_ops, -- .type = BPF_MAP_TYPE_HASH, -+const struct bpf_map_ops htab_lru_map_ops = { -+ .map_alloc_check = htab_map_alloc_check, -+ .map_alloc = htab_map_alloc, -+ .map_free = htab_map_free, -+ .map_get_next_key = htab_map_get_next_key, -+ .map_lookup_elem = htab_lru_map_lookup_elem, -+ .map_lookup_elem_sys_only = htab_lru_map_lookup_elem_sys, -+ .map_update_elem = htab_lru_map_update_elem, -+ .map_delete_elem = htab_lru_map_delete_elem, -+ .map_gen_lookup = htab_lru_map_gen_lookup, -+ .map_seq_show_elem = htab_map_seq_show_elem, - }; - --static int __init register_htab_map(void) -+/* Called from eBPF program */ -+static void *htab_percpu_map_lookup_elem(struct bpf_map *map, void *key) - { -- bpf_register_map_type(&htab_type); -- return 0; -+ struct htab_elem *l = __htab_map_lookup_elem(map, key); -+ -+ if (l) -+ return this_cpu_ptr(htab_elem_get_ptr(l, map->key_size)); -+ else -+ return NULL; - } --late_initcall(register_htab_map); -+ -+static void *htab_lru_percpu_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ struct htab_elem *l = __htab_map_lookup_elem(map, key); -+ -+ if (l) { -+ bpf_lru_node_set_ref(&l->lru_node); -+ return this_cpu_ptr(htab_elem_get_ptr(l, map->key_size)); -+ } -+ -+ return NULL; -+} -+ -+int bpf_percpu_hash_copy(struct bpf_map *map, void *key, void *value) -+{ -+ struct htab_elem *l; -+ void __percpu *pptr; -+ int ret = -ENOENT; -+ int cpu, off = 0; -+ u32 size; -+ -+ /* per_cpu areas are zero-filled and bpf programs can only -+ * access 'value_size' of them, so copying rounded areas -+ * will not leak any kernel data -+ */ -+ size = round_up(map->value_size, 8); -+ rcu_read_lock(); -+ l = __htab_map_lookup_elem(map, key); -+ if (!l) -+ goto out; -+ /* We do not mark LRU map element here in order to not mess up -+ * eviction heuristics when user space does a map walk. -+ */ -+ pptr = htab_elem_get_ptr(l, map->key_size); -+ for_each_possible_cpu(cpu) { -+ bpf_long_memcpy(value + off, -+ per_cpu_ptr(pptr, cpu), size); -+ off += size; -+ } -+ ret = 0; -+out: -+ rcu_read_unlock(); -+ return ret; -+} -+ -+int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value, -+ u64 map_flags) -+{ -+ struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -+ int ret; -+ -+ rcu_read_lock(); -+ if (htab_is_lru(htab)) -+ ret = __htab_lru_percpu_map_update_elem(map, key, value, -+ map_flags, true); -+ else -+ ret = __htab_percpu_map_update_elem(map, key, value, map_flags, -+ true); -+ rcu_read_unlock(); -+ -+ return ret; -+} -+ -+static void htab_percpu_map_seq_show_elem(struct bpf_map *map, void *key, -+ struct seq_file *m) -+{ -+ struct htab_elem *l; -+ void __percpu *pptr; -+ int cpu; -+ -+ rcu_read_lock(); -+ -+ l = __htab_map_lookup_elem(map, key); -+ if (!l) { -+ rcu_read_unlock(); -+ return; -+ } -+ -+ btf_type_seq_show(map->btf, map->btf_key_type_id, key, m); -+ seq_puts(m, ": {\n"); -+ pptr = htab_elem_get_ptr(l, map->key_size); -+ for_each_possible_cpu(cpu) { -+ seq_printf(m, "\tcpu%d: ", cpu); -+ btf_type_seq_show(map->btf, map->btf_value_type_id, -+ per_cpu_ptr(pptr, cpu), m); -+ seq_puts(m, "\n"); -+ } -+ seq_puts(m, "}\n"); -+ -+ rcu_read_unlock(); -+} -+ -+const struct bpf_map_ops htab_percpu_map_ops = { -+ .map_alloc_check = htab_map_alloc_check, -+ .map_alloc = htab_map_alloc, -+ .map_free = htab_map_free, -+ .map_get_next_key = htab_map_get_next_key, -+ .map_lookup_elem = htab_percpu_map_lookup_elem, -+ .map_update_elem = htab_percpu_map_update_elem, -+ .map_delete_elem = htab_map_delete_elem, -+ .map_seq_show_elem = htab_percpu_map_seq_show_elem, -+}; -+ -+const struct bpf_map_ops htab_lru_percpu_map_ops = { -+ .map_alloc_check = htab_map_alloc_check, -+ .map_alloc = htab_map_alloc, -+ .map_free = htab_map_free, -+ .map_get_next_key = htab_map_get_next_key, -+ .map_lookup_elem = htab_lru_percpu_map_lookup_elem, -+ .map_update_elem = htab_lru_percpu_map_update_elem, -+ .map_delete_elem = htab_lru_map_delete_elem, -+ .map_seq_show_elem = htab_percpu_map_seq_show_elem, -+}; -+ -+static int fd_htab_map_alloc_check(union bpf_attr *attr) -+{ -+ if (attr->value_size != sizeof(u32)) -+ return -EINVAL; -+ return htab_map_alloc_check(attr); -+} -+ -+static void fd_htab_map_free(struct bpf_map *map) -+{ -+ struct bpf_htab *htab = container_of(map, struct bpf_htab, map); -+ struct hlist_nulls_node *n; -+ struct hlist_nulls_head *head; -+ struct htab_elem *l; -+ int i; -+ -+ for (i = 0; i < htab->n_buckets; i++) { -+ head = select_bucket(htab, i); -+ -+ hlist_nulls_for_each_entry_safe(l, n, head, hash_node) { -+ void *ptr = fd_htab_map_get_ptr(map, l); -+ -+ map->ops->map_fd_put_ptr(ptr); -+ } -+ } -+ -+ htab_map_free(map); -+} -+ -+/* only called from syscall */ -+int bpf_fd_htab_map_lookup_elem(struct bpf_map *map, void *key, u32 *value) -+{ -+ void **ptr; -+ int ret = 0; -+ -+ if (!map->ops->map_fd_sys_lookup_elem) -+ return -ENOTSUPP; -+ -+ rcu_read_lock(); -+ ptr = htab_map_lookup_elem(map, key); -+ if (ptr) -+ *value = map->ops->map_fd_sys_lookup_elem(READ_ONCE(*ptr)); -+ else -+ ret = -ENOENT; -+ rcu_read_unlock(); -+ -+ return ret; -+} -+ -+/* only called from syscall */ -+int bpf_fd_htab_map_update_elem(struct bpf_map *map, struct file *map_file, -+ void *key, void *value, u64 map_flags) -+{ -+ void *ptr; -+ int ret; -+ u32 ufd = *(u32 *)value; -+ -+ ptr = map->ops->map_fd_get_ptr(map, map_file, ufd); -+ if (IS_ERR(ptr)) -+ return PTR_ERR(ptr); -+ -+ ret = htab_map_update_elem(map, key, &ptr, map_flags); -+ if (ret) -+ map->ops->map_fd_put_ptr(ptr); -+ -+ return ret; -+} -+ -+static struct bpf_map *htab_of_map_alloc(union bpf_attr *attr) -+{ -+ struct bpf_map *map, *inner_map_meta; -+ -+ inner_map_meta = bpf_map_meta_alloc(attr->inner_map_fd); -+ if (IS_ERR(inner_map_meta)) -+ return inner_map_meta; -+ -+ map = htab_map_alloc(attr); -+ if (IS_ERR(map)) { -+ bpf_map_meta_free(inner_map_meta); -+ return map; -+ } -+ -+ map->inner_map_meta = inner_map_meta; -+ -+ return map; -+} -+ -+static void *htab_of_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_map **inner_map = htab_map_lookup_elem(map, key); -+ -+ if (!inner_map) -+ return NULL; -+ -+ return READ_ONCE(*inner_map); -+} -+ -+static u32 htab_of_map_gen_lookup(struct bpf_map *map, -+ struct bpf_insn *insn_buf) -+{ -+ struct bpf_insn *insn = insn_buf; -+ const int ret = BPF_REG_0; -+ -+ BUILD_BUG_ON(!__same_type(&__htab_map_lookup_elem, -+ (void *(*)(struct bpf_map *map, void *key))NULL)); -+ *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem)); -+ *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 2); -+ *insn++ = BPF_ALU64_IMM(BPF_ADD, ret, -+ offsetof(struct htab_elem, key) + -+ round_up(map->key_size, 8)); -+ *insn++ = BPF_LDX_MEM(BPF_DW, ret, ret, 0); -+ -+ return insn - insn_buf; -+} -+ -+static void htab_of_map_free(struct bpf_map *map) -+{ -+ bpf_map_meta_free(map->inner_map_meta); -+ fd_htab_map_free(map); -+} -+ -+const struct bpf_map_ops htab_of_maps_map_ops = { -+ .map_alloc_check = fd_htab_map_alloc_check, -+ .map_alloc = htab_of_map_alloc, -+ .map_free = htab_of_map_free, -+ .map_get_next_key = htab_map_get_next_key, -+ .map_lookup_elem = htab_of_map_lookup_elem, -+ .map_delete_elem = htab_map_delete_elem, -+ .map_fd_get_ptr = bpf_map_fd_get_ptr, -+ .map_fd_put_ptr = bpf_map_fd_put_ptr, -+ .map_fd_sys_lookup_elem = bpf_map_fd_sys_lookup_elem, -+ .map_gen_lookup = htab_of_map_gen_lookup, -+ .map_check_btf = map_check_no_btf, -+}; ---- a/kernel/bpf/helpers.c -+++ b/kernel/bpf/helpers.c -@@ -1,21 +1,18 @@ -+// SPDX-License-Identifier: GPL-2.0-only - /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of version 2 of the GNU General Public -- * License as published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, but -- * WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * General Public License for more details. - */ - #include - #include - #include - #include -+#include - #include - #include - #include -+#include -+#include -+ -+#include "../../lib/kstrtox.h" - - /* If kernel subsystem is allowing eBPF programs to call this function, - * inside its own verifier_ops->get_func_proto() callback it should return -@@ -26,48 +23,32 @@ - * if program is allowed to access maps, so check rcu_read_lock_held in - * all three functions. - */ --static u64 bpf_map_lookup_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_2(bpf_map_lookup_elem, struct bpf_map *, map, void *, key) - { -- /* verifier checked that R1 contains a valid pointer to bpf_map -- * and R2 points to a program stack and map->key_size bytes were -- * initialized -- */ -- struct bpf_map *map = (struct bpf_map *) (unsigned long) r1; -- void *key = (void *) (unsigned long) r2; -- void *value; -- - WARN_ON_ONCE(!rcu_read_lock_held()); -- -- value = map->ops->map_lookup_elem(map, key); -- -- /* lookup() returns either pointer to element value or NULL -- * which is the meaning of PTR_TO_MAP_VALUE_OR_NULL type -- */ -- return (unsigned long) value; -+ return (unsigned long) map->ops->map_lookup_elem(map, key); - } - - const struct bpf_func_proto bpf_map_lookup_elem_proto = { - .func = bpf_map_lookup_elem, - .gpl_only = false, -+ .pkt_access = true, - .ret_type = RET_PTR_TO_MAP_VALUE_OR_NULL, - .arg1_type = ARG_CONST_MAP_PTR, - .arg2_type = ARG_PTR_TO_MAP_KEY, - }; - --static u64 bpf_map_update_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_4(bpf_map_update_elem, struct bpf_map *, map, void *, key, -+ void *, value, u64, flags) - { -- struct bpf_map *map = (struct bpf_map *) (unsigned long) r1; -- void *key = (void *) (unsigned long) r2; -- void *value = (void *) (unsigned long) r3; -- - WARN_ON_ONCE(!rcu_read_lock_held()); -- -- return map->ops->map_update_elem(map, key, value, r4); -+ return map->ops->map_update_elem(map, key, value, flags); - } - - const struct bpf_func_proto bpf_map_update_elem_proto = { - .func = bpf_map_update_elem, - .gpl_only = false, -+ .pkt_access = true, - .ret_type = RET_INTEGER, - .arg1_type = ARG_CONST_MAP_PTR, - .arg2_type = ARG_PTR_TO_MAP_KEY, -@@ -75,33 +56,71 @@ const struct bpf_func_proto bpf_map_upda - .arg4_type = ARG_ANYTHING, - }; - --static u64 bpf_map_delete_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_2(bpf_map_delete_elem, struct bpf_map *, map, void *, key) - { -- struct bpf_map *map = (struct bpf_map *) (unsigned long) r1; -- void *key = (void *) (unsigned long) r2; -- - WARN_ON_ONCE(!rcu_read_lock_held()); -- - return map->ops->map_delete_elem(map, key); - } - - const struct bpf_func_proto bpf_map_delete_elem_proto = { - .func = bpf_map_delete_elem, - .gpl_only = false, -+ .pkt_access = true, - .ret_type = RET_INTEGER, - .arg1_type = ARG_CONST_MAP_PTR, - .arg2_type = ARG_PTR_TO_MAP_KEY, - }; - -+BPF_CALL_3(bpf_map_push_elem, struct bpf_map *, map, void *, value, u64, flags) -+{ -+ return map->ops->map_push_elem(map, value, flags); -+} -+ -+const struct bpf_func_proto bpf_map_push_elem_proto = { -+ .func = bpf_map_push_elem, -+ .gpl_only = false, -+ .pkt_access = true, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_CONST_MAP_PTR, -+ .arg2_type = ARG_PTR_TO_MAP_VALUE, -+ .arg3_type = ARG_ANYTHING, -+}; -+ -+BPF_CALL_2(bpf_map_pop_elem, struct bpf_map *, map, void *, value) -+{ -+ return map->ops->map_pop_elem(map, value); -+} -+ -+const struct bpf_func_proto bpf_map_pop_elem_proto = { -+ .func = bpf_map_pop_elem, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_CONST_MAP_PTR, -+ .arg2_type = ARG_PTR_TO_UNINIT_MAP_VALUE, -+}; -+ -+BPF_CALL_2(bpf_map_peek_elem, struct bpf_map *, map, void *, value) -+{ -+ return map->ops->map_peek_elem(map, value); -+} -+ -+const struct bpf_func_proto bpf_map_peek_elem_proto = { -+ .func = bpf_map_peek_elem, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_CONST_MAP_PTR, -+ .arg2_type = ARG_PTR_TO_UNINIT_MAP_VALUE, -+}; -+ - const struct bpf_func_proto bpf_get_prandom_u32_proto = { - .func = bpf_user_rnd_u32, - .gpl_only = false, - .ret_type = RET_INTEGER, - }; - --static u64 bpf_get_smp_processor_id(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_0(bpf_get_smp_processor_id) - { -- return raw_smp_processor_id(); -+ return smp_processor_id(); - } - - const struct bpf_func_proto bpf_get_smp_processor_id_proto = { -@@ -110,7 +129,18 @@ const struct bpf_func_proto bpf_get_smp_ - .ret_type = RET_INTEGER, - }; - --static u64 bpf_ktime_get_ns(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_0(bpf_get_numa_node_id) -+{ -+ return numa_node_id(); -+} -+ -+const struct bpf_func_proto bpf_get_numa_node_id_proto = { -+ .func = bpf_get_numa_node_id, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+}; -+ -+BPF_CALL_0(bpf_ktime_get_ns) - { - /* NMI safe access to clock monotonic */ - return ktime_get_mono_fast_ns(); -@@ -122,11 +152,11 @@ const struct bpf_func_proto bpf_ktime_ge - .ret_type = RET_INTEGER, - }; - --static u64 bpf_get_current_pid_tgid(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_0(bpf_get_current_pid_tgid) - { - struct task_struct *task = current; - -- if (!task) -+ if (unlikely(!task)) - return -EINVAL; - - return (u64) task->tgid << 32 | task->pid; -@@ -138,18 +168,18 @@ const struct bpf_func_proto bpf_get_curr - .ret_type = RET_INTEGER, - }; - --static u64 bpf_get_current_uid_gid(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_0(bpf_get_current_uid_gid) - { - struct task_struct *task = current; - kuid_t uid; - kgid_t gid; - -- if (!task) -+ if (unlikely(!task)) - return -EINVAL; - - current_uid_gid(&uid, &gid); - return (u64) from_kgid(&init_user_ns, gid) << 32 | -- from_kuid(&init_user_ns, uid); -+ from_kuid(&init_user_ns, uid); - } - - const struct bpf_func_proto bpf_get_current_uid_gid_proto = { -@@ -158,22 +188,254 @@ const struct bpf_func_proto bpf_get_curr - .ret_type = RET_INTEGER, - }; - --static u64 bpf_get_current_comm(u64 r1, u64 size, u64 r3, u64 r4, u64 r5) -+BPF_CALL_2(bpf_get_current_comm, char *, buf, u32, size) - { - struct task_struct *task = current; -- char *buf = (char *) (long) r1; - -- if (!task) -- return -EINVAL; -+ if (unlikely(!task)) -+ goto err_clear; -+ -+ strncpy(buf, task->comm, size); - -- strlcpy(buf, task->comm, min_t(size_t, size, sizeof(task->comm))); -+ /* Verifier guarantees that size > 0. For task->comm exceeding -+ * size, guarantee that buf is %NUL-terminated. Unconditionally -+ * done here to save the size test. -+ */ -+ buf[size - 1] = 0; - return 0; -+err_clear: -+ memset(buf, 0, size); -+ return -EINVAL; - } - - const struct bpf_func_proto bpf_get_current_comm_proto = { - .func = bpf_get_current_comm, - .gpl_only = false, - .ret_type = RET_INTEGER, -- .arg1_type = ARG_PTR_TO_STACK, -- .arg2_type = ARG_CONST_STACK_SIZE, -+ .arg1_type = ARG_PTR_TO_UNINIT_MEM, -+ .arg2_type = ARG_CONST_SIZE, -+}; -+ -+#if defined(CONFIG_QUEUED_SPINLOCKS) || defined(CONFIG_BPF_ARCH_SPINLOCK) -+ -+static inline void __bpf_spin_lock(struct bpf_spin_lock *lock) -+{ -+ arch_spinlock_t *l = (void *)lock; -+ union { -+ __u32 val; -+ arch_spinlock_t lock; -+ } u = { .lock = __ARCH_SPIN_LOCK_UNLOCKED }; -+ -+ compiletime_assert(u.val == 0, "__ARCH_SPIN_LOCK_UNLOCKED not 0"); -+ BUILD_BUG_ON(sizeof(*l) != sizeof(__u32)); -+ BUILD_BUG_ON(sizeof(*lock) != sizeof(__u32)); -+ arch_spin_lock(l); -+} -+ -+static inline void __bpf_spin_unlock(struct bpf_spin_lock *lock) -+{ -+ arch_spinlock_t *l = (void *)lock; -+ -+ arch_spin_unlock(l); -+} -+ -+#else -+ -+static inline void __bpf_spin_lock(struct bpf_spin_lock *lock) -+{ -+ atomic_t *l = (void *)lock; -+ -+ BUILD_BUG_ON(sizeof(*l) != sizeof(*lock)); -+ do { -+ smp_cond_load_relaxed(&l->counter, !VAL); -+ } while (atomic_xchg(l, 1)); -+} -+ -+static inline void __bpf_spin_unlock(struct bpf_spin_lock *lock) -+{ -+ atomic_t *l = (void *)lock; -+ -+ atomic_set_release(l, 0); -+} -+ -+#endif -+ -+static DEFINE_PER_CPU(unsigned long, irqsave_flags); -+ -+notrace BPF_CALL_1(bpf_spin_lock, struct bpf_spin_lock *, lock) -+{ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ __bpf_spin_lock(lock); -+ __this_cpu_write(irqsave_flags, flags); -+ return 0; -+} -+ -+const struct bpf_func_proto bpf_spin_lock_proto = { -+ .func = bpf_spin_lock, -+ .gpl_only = false, -+ .ret_type = RET_VOID, -+ .arg1_type = ARG_PTR_TO_SPIN_LOCK, -+}; -+ -+notrace BPF_CALL_1(bpf_spin_unlock, struct bpf_spin_lock *, lock) -+{ -+ unsigned long flags; -+ -+ flags = __this_cpu_read(irqsave_flags); -+ __bpf_spin_unlock(lock); -+ local_irq_restore(flags); -+ return 0; -+} -+ -+const struct bpf_func_proto bpf_spin_unlock_proto = { -+ .func = bpf_spin_unlock, -+ .gpl_only = false, -+ .ret_type = RET_VOID, -+ .arg1_type = ARG_PTR_TO_SPIN_LOCK, -+}; -+ -+void copy_map_value_locked(struct bpf_map *map, void *dst, void *src, -+ bool lock_src) -+{ -+ struct bpf_spin_lock *lock; -+ -+ if (lock_src) -+ lock = src + map->spin_lock_off; -+ else -+ lock = dst + map->spin_lock_off; -+ preempt_disable(); -+ ____bpf_spin_lock(lock); -+ copy_map_value(map, dst, src); -+ ____bpf_spin_unlock(lock); -+ preempt_enable(); -+} -+ -+#define BPF_STRTOX_BASE_MASK 0x1F -+ -+static int __bpf_strtoull(const char *buf, size_t buf_len, u64 flags, -+ unsigned long long *res, bool *is_negative) -+{ -+ unsigned int base = flags & BPF_STRTOX_BASE_MASK; -+ const char *cur_buf = buf; -+ size_t cur_len = buf_len; -+ unsigned int consumed; -+ size_t val_len; -+ char str[64]; -+ -+ if (!buf || !buf_len || !res || !is_negative) -+ return -EINVAL; -+ -+ if (base != 0 && base != 8 && base != 10 && base != 16) -+ return -EINVAL; -+ -+ if (flags & ~BPF_STRTOX_BASE_MASK) -+ return -EINVAL; -+ -+ while (cur_buf < buf + buf_len && isspace(*cur_buf)) -+ ++cur_buf; -+ -+ *is_negative = (cur_buf < buf + buf_len && *cur_buf == '-'); -+ if (*is_negative) -+ ++cur_buf; -+ -+ consumed = cur_buf - buf; -+ cur_len -= consumed; -+ if (!cur_len) -+ return -EINVAL; -+ -+ cur_len = min(cur_len, sizeof(str) - 1); -+ memcpy(str, cur_buf, cur_len); -+ str[cur_len] = '\0'; -+ cur_buf = str; -+ -+ cur_buf = _parse_integer_fixup_radix(cur_buf, &base); -+ val_len = _parse_integer(cur_buf, base, res); -+ -+ if (val_len & KSTRTOX_OVERFLOW) -+ return -ERANGE; -+ -+ if (val_len == 0) -+ return -EINVAL; -+ -+ cur_buf += val_len; -+ consumed += cur_buf - str; -+ -+ return consumed; -+} -+ -+static int __bpf_strtoll(const char *buf, size_t buf_len, u64 flags, -+ long long *res) -+{ -+ unsigned long long _res; -+ bool is_negative; -+ int err; -+ -+ err = __bpf_strtoull(buf, buf_len, flags, &_res, &is_negative); -+ if (err < 0) -+ return err; -+ if (is_negative) { -+ if ((long long)-_res > 0) -+ return -ERANGE; -+ *res = -_res; -+ } else { -+ if ((long long)_res < 0) -+ return -ERANGE; -+ *res = _res; -+ } -+ return err; -+} -+ -+BPF_CALL_4(bpf_strtol, const char *, buf, size_t, buf_len, u64, flags, -+ long *, res) -+{ -+ long long _res; -+ int err; -+ -+ err = __bpf_strtoll(buf, buf_len, flags, &_res); -+ if (err < 0) -+ return err; -+ if (_res != (long)_res) -+ return -ERANGE; -+ *res = _res; -+ return err; -+} -+ -+const struct bpf_func_proto bpf_strtol_proto = { -+ .func = bpf_strtol, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_MEM, -+ .arg2_type = ARG_CONST_SIZE, -+ .arg3_type = ARG_ANYTHING, -+ .arg4_type = ARG_PTR_TO_LONG, -+}; -+ -+BPF_CALL_4(bpf_strtoul, const char *, buf, size_t, buf_len, u64, flags, -+ unsigned long *, res) -+{ -+ unsigned long long _res; -+ bool is_negative; -+ int err; -+ -+ err = __bpf_strtoull(buf, buf_len, flags, &_res, &is_negative); -+ if (err < 0) -+ return err; -+ if (is_negative) -+ return -EINVAL; -+ if (_res != (unsigned long)_res) -+ return -ERANGE; -+ *res = _res; -+ return err; -+} -+ -+const struct bpf_func_proto bpf_strtoul_proto = { -+ .func = bpf_strtoul, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_MEM, -+ .arg2_type = ARG_CONST_SIZE, -+ .arg3_type = ARG_ANYTHING, -+ .arg4_type = ARG_PTR_TO_LONG, - }; ---- a/kernel/bpf/inode.c -+++ b/kernel/bpf/inode.c -@@ -1,3 +1,4 @@ -+// SPDX-License-Identifier: GPL-2.0-only - /* - * Minimal file system backend for holding eBPF maps and programs, - * used by bpf(2) object pinning. -@@ -5,21 +6,19 @@ - * Authors: - * - * Daniel Borkmann -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * version 2 as published by the Free Software Foundation. - */ - --#include -+#include - #include - #include - #include - #include - #include - #include -+#include - #include - #include -+#include - - enum bpf_type { - BPF_TYPE_UNSPEC = 0, -@@ -87,6 +86,7 @@ static struct inode *bpf_get_inode(struc - switch (mode & S_IFMT) { - case S_IFDIR: - case S_IFREG: -+ case S_IFLNK: - break; - default: - return ERR_PTR(-EINVAL); -@@ -119,18 +119,20 @@ static int bpf_inode_type(const struct i - return 0; - } - --static bool bpf_dname_reserved(const struct dentry *dentry) -+static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode, -+ struct inode *dir) - { -- return strchr(dentry->d_name.name, '.'); -+ d_instantiate(dentry, inode); -+ dget(dentry); -+ -+ dir->i_mtime = CURRENT_TIME; -+ dir->i_ctime = dir->i_mtime; - } - - static int bpf_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) - { - struct inode *inode; - -- if (bpf_dname_reserved(dentry)) -- return -EPERM; -- - inode = bpf_get_inode(dir->i_sb, dir, mode | S_IFDIR); - if (IS_ERR(inode)) - return PTR_ERR(inode); -@@ -141,30 +143,30 @@ static int bpf_mkdir(struct inode *dir, - inc_nlink(inode); - inc_nlink(dir); - -- d_instantiate(dentry, inode); -- dget(dentry); -- -+ bpf_dentry_finalize(dentry, inode, dir); - return 0; - } - --static int bpf_mkobj_ops(struct inode *dir, struct dentry *dentry, -- umode_t mode, const struct inode_operations *iops) -+static int bpffs_obj_open(struct inode *inode, struct file *file) - { -- struct inode *inode; -+ return -EIO; -+} - -- if (bpf_dname_reserved(dentry)) -- return -EPERM; -+static const struct file_operations bpffs_obj_fops = { -+ .open = bpffs_obj_open, -+}; - -- inode = bpf_get_inode(dir->i_sb, dir, mode | S_IFREG); -+static int bpf_mkobj_ops(struct inode *dir, struct dentry *dentry, -+ umode_t mode, const struct inode_operations *iops) -+{ -+ struct inode *inode = bpf_get_inode(dir->i_sb, dir, mode | S_IFREG); - if (IS_ERR(inode)) - return PTR_ERR(inode); - - inode->i_op = iops; - inode->i_private = dentry->d_fsdata; - -- d_instantiate(dentry, inode); -- dget(dentry); -- -+ bpf_dentry_finalize(dentry, inode, dir); - return 0; - } - -@@ -187,11 +189,48 @@ static int bpf_mkobj(struct inode *dir, - } - } - -+static struct dentry * -+bpf_lookup(struct inode *dir, struct dentry *dentry, unsigned flags) -+{ -+ /* Dots in names (e.g. "/sys/fs/bpf/foo.bar") are reserved for future -+ * extensions. -+ */ -+ if (strchr(dentry->d_name.name, '.')) -+ return ERR_PTR(-EPERM); -+ -+ return simple_lookup(dir, dentry, flags); -+} -+ -+static int bpf_symlink(struct inode *dir, struct dentry *dentry, -+ const char *target) -+{ -+ char *link = kstrdup(target, GFP_USER | __GFP_NOWARN); -+ struct inode *inode; -+ -+ if (!link) -+ return -ENOMEM; -+ -+ inode = bpf_get_inode(dir->i_sb, dir, S_IRWXUGO | S_IFLNK); -+ if (IS_ERR(inode)) { -+ kfree(link); -+ return PTR_ERR(inode); -+ } -+ -+ inode->i_op = &simple_symlink_inode_operations; -+ inode->i_link = link; -+ -+ bpf_dentry_finalize(dentry, inode, dir); -+ return 0; -+} -+ - static const struct inode_operations bpf_dir_iops = { -- .lookup = simple_lookup, -+ .lookup = bpf_lookup, - .mknod = bpf_mkobj, - .mkdir = bpf_mkdir, -+ .symlink = bpf_symlink, - .rmdir = simple_rmdir, -+ .rename = simple_rename, -+ .link = simple_link, - .unlink = simple_unlink, - }; - -@@ -256,7 +295,7 @@ out: - } - - static void *bpf_obj_do_get(const struct filename *pathname, -- enum bpf_type *type) -+ enum bpf_type *type, int flags) - { - struct inode *inode; - struct path path; -@@ -268,7 +307,7 @@ static void *bpf_obj_do_get(const struct - return ERR_PTR(ret); - - inode = d_backing_inode(path.dentry); -- ret = inode_permission(inode, MAY_WRITE); -+ ret = inode_permission(inode, ACC_MODE(flags)); - if (ret) - goto out; - -@@ -287,18 +326,23 @@ out: - return ERR_PTR(ret); - } - --int bpf_obj_get_user(const char __user *pathname) -+int bpf_obj_get_user(const char __user *pathname, int flags) - { - enum bpf_type type = BPF_TYPE_UNSPEC; - struct filename *pname; - int ret = -ENOENT; -+ int f_flags; - void *raw; - -+ f_flags = bpf_get_file_flag(flags); -+ if (f_flags < 0) -+ return f_flags; -+ - pname = getname(pathname); - if (IS_ERR(pname)) - return PTR_ERR(pname); - -- raw = bpf_obj_do_get(pname, &type); -+ raw = bpf_obj_do_get(pname, &type, f_flags); - if (IS_ERR(raw)) { - ret = PTR_ERR(raw); - goto out; -@@ -307,7 +351,7 @@ int bpf_obj_get_user(const char __user * - if (type == BPF_TYPE_PROG) - ret = bpf_prog_new_fd(raw); - else if (type == BPF_TYPE_MAP) -- ret = bpf_map_new_fd(raw); -+ ret = bpf_map_new_fd(raw, f_flags); - else - goto out; - -@@ -318,29 +362,131 @@ out: - return ret; - } - --static void bpf_evict_inode(struct inode *inode) -+static struct bpf_prog *__get_prog_inode(struct inode *inode, enum bpf_prog_type type) - { -- enum bpf_type type; -+ struct bpf_prog *prog; -+ int ret = inode_permission(inode, MAY_READ); -+ if (ret) -+ return ERR_PTR(ret); -+ -+ if (inode->i_op == &bpf_map_iops) -+ return ERR_PTR(-EINVAL); -+ if (inode->i_op != &bpf_prog_iops) -+ return ERR_PTR(-EACCES); - -- truncate_inode_pages_final(&inode->i_data); -- clear_inode(inode); -+ prog = inode->i_private; - -+ if (!bpf_prog_get_ok(prog, &type, false)) -+ return ERR_PTR(-EINVAL); -+ -+ return bpf_prog_inc(prog); -+} -+ -+struct bpf_prog *bpf_prog_get_type_path(const char *name, enum bpf_prog_type type) -+{ -+ struct bpf_prog *prog; -+ struct path path; -+ int ret = kern_path(name, LOOKUP_FOLLOW, &path); -+ if (ret) -+ return ERR_PTR(ret); -+ prog = __get_prog_inode(d_backing_inode(path.dentry), type); -+ if (!IS_ERR(prog)) -+ touch_atime(&path); -+ path_put(&path); -+ return prog; -+} -+EXPORT_SYMBOL(bpf_prog_get_type_path); -+ -+/* -+ * Display the mount options in /proc/mounts. -+ */ -+static int bpf_show_options(struct seq_file *m, struct dentry *root) -+{ -+ umode_t mode = d_inode(root)->i_mode & S_IALLUGO & ~S_ISVTX; -+ -+ if (mode != S_IRWXUGO) -+ seq_printf(m, ",mode=%o", mode); -+ return 0; -+} -+ -+static void bpf_destroy_inode_deferred(struct rcu_head *head) -+{ -+ struct inode *inode = container_of(head, struct inode, i_rcu); -+ enum bpf_type type; -+ -+ if (S_ISLNK(inode->i_mode)) -+ kfree(inode->i_link); - if (!bpf_inode_type(inode, &type)) - bpf_any_put(inode->i_private, type); -+ free_inode_nonrcu(inode); -+} -+ -+static void bpf_destroy_inode(struct inode *inode) -+{ -+ call_rcu(&inode->i_rcu, bpf_destroy_inode_deferred); - } - - static const struct super_operations bpf_super_ops = { - .statfs = simple_statfs, - .drop_inode = generic_delete_inode, -- .evict_inode = bpf_evict_inode, -+ .show_options = bpf_show_options, -+ .destroy_inode = bpf_destroy_inode, -+}; -+ -+enum { -+ OPT_MODE, -+ OPT_ERR, -+}; -+ -+static const match_table_t bpf_mount_tokens = { -+ { OPT_MODE, "mode=%o" }, -+ { OPT_ERR, NULL }, -+}; -+ -+struct bpf_mount_opts { -+ umode_t mode; - }; - -+static int bpf_parse_options(char *data, struct bpf_mount_opts *opts) -+{ -+ substring_t args[MAX_OPT_ARGS]; -+ int option, token; -+ char *ptr; -+ -+ opts->mode = S_IRWXUGO; -+ -+ while ((ptr = strsep(&data, ",")) != NULL) { -+ if (!*ptr) -+ continue; -+ -+ token = match_token(ptr, bpf_mount_tokens, args); -+ switch (token) { -+ case OPT_MODE: -+ if (match_octal(&args[0], &option)) -+ return -EINVAL; -+ opts->mode = option & S_IALLUGO; -+ break; -+ /* We might like to report bad mount options here, but -+ * traditionally we've ignored all mount options, so we'd -+ * better continue to ignore non-existing options for bpf. -+ */ -+ } -+ } -+ -+ return 0; -+} -+ - static int bpf_fill_super(struct super_block *sb, void *data, int silent) - { - static struct tree_descr bpf_rfiles[] = { { "" } }; -+ struct bpf_mount_opts opts; - struct inode *inode; - int ret; - -+ ret = bpf_parse_options(data, &opts); -+ if (ret) -+ return ret; -+ - ret = simple_fill_super(sb, BPF_FS_MAGIC, bpf_rfiles); - if (ret) - return ret; -@@ -350,7 +496,7 @@ static int bpf_fill_super(struct super_b - inode = sb->s_root->d_inode; - inode->i_op = &bpf_dir_iops; - inode->i_mode &= ~S_IALLUGO; -- inode->i_mode |= S_ISVTX | S_IRWXUGO; -+ inode->i_mode |= S_ISVTX | opts.mode; - - return 0; - } -@@ -368,8 +514,6 @@ static struct file_system_type bpf_fs_ty - .kill_sb = kill_litter_super, - }; - --MODULE_ALIAS_FS("bpf"); -- - static int __init bpf_init(void) - { - int ret; ---- /dev/null -+++ b/kernel/bpf/local_storage.c -@@ -0,0 +1,600 @@ -+//SPDX-License-Identifier: GPL-2.0 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+DEFINE_PER_CPU(struct bpf_cgroup_storage*, bpf_cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE]); -+ -+#ifdef CONFIG_CGROUP_BPF -+ -+#define LOCAL_STORAGE_CREATE_FLAG_MASK \ -+ (BPF_F_NUMA_NODE | BPF_F_ACCESS_MASK) -+ -+struct bpf_cgroup_storage_map { -+ struct bpf_map map; -+ -+ spinlock_t lock; -+ struct bpf_prog *prog; -+ struct rb_root root; -+ struct list_head list; -+}; -+ -+static struct bpf_cgroup_storage_map *map_to_storage(struct bpf_map *map) -+{ -+ return container_of(map, struct bpf_cgroup_storage_map, map); -+} -+ -+static int bpf_cgroup_storage_key_cmp( -+ const struct bpf_cgroup_storage_key *key1, -+ const struct bpf_cgroup_storage_key *key2) -+{ -+ if (key1->cgroup_inode_id < key2->cgroup_inode_id) -+ return -1; -+ else if (key1->cgroup_inode_id > key2->cgroup_inode_id) -+ return 1; -+ else if (key1->attach_type < key2->attach_type) -+ return -1; -+ else if (key1->attach_type > key2->attach_type) -+ return 1; -+ return 0; -+} -+ -+static struct bpf_cgroup_storage *cgroup_storage_lookup( -+ struct bpf_cgroup_storage_map *map, struct bpf_cgroup_storage_key *key, -+ bool locked) -+{ -+ struct rb_root *root = &map->root; -+ struct rb_node *node; -+ -+ if (!locked) -+ spin_lock_bh(&map->lock); -+ -+ node = root->rb_node; -+ while (node) { -+ struct bpf_cgroup_storage *storage; -+ -+ storage = container_of(node, struct bpf_cgroup_storage, node); -+ -+ switch (bpf_cgroup_storage_key_cmp(key, &storage->key)) { -+ case -1: -+ node = node->rb_left; -+ break; -+ case 1: -+ node = node->rb_right; -+ break; -+ default: -+ if (!locked) -+ spin_unlock_bh(&map->lock); -+ return storage; -+ } -+ } -+ -+ if (!locked) -+ spin_unlock_bh(&map->lock); -+ -+ return NULL; -+} -+ -+static int cgroup_storage_insert(struct bpf_cgroup_storage_map *map, -+ struct bpf_cgroup_storage *storage) -+{ -+ struct rb_root *root = &map->root; -+ struct rb_node **new = &(root->rb_node), *parent = NULL; -+ -+ while (*new) { -+ struct bpf_cgroup_storage *this; -+ -+ this = container_of(*new, struct bpf_cgroup_storage, node); -+ -+ parent = *new; -+ switch (bpf_cgroup_storage_key_cmp(&storage->key, &this->key)) { -+ case -1: -+ new = &((*new)->rb_left); -+ break; -+ case 1: -+ new = &((*new)->rb_right); -+ break; -+ default: -+ return -EEXIST; -+ } -+ } -+ -+ rb_link_node(&storage->node, parent, new); -+ rb_insert_color(&storage->node, root); -+ -+ return 0; -+} -+ -+static void *cgroup_storage_lookup_elem(struct bpf_map *_map, void *_key) -+{ -+ struct bpf_cgroup_storage_map *map = map_to_storage(_map); -+ struct bpf_cgroup_storage_key *key = _key; -+ struct bpf_cgroup_storage *storage; -+ -+ storage = cgroup_storage_lookup(map, key, false); -+ if (!storage) -+ return NULL; -+ -+ return &READ_ONCE(storage->buf)->data[0]; -+} -+ -+static int cgroup_storage_update_elem(struct bpf_map *map, void *_key, -+ void *value, u64 flags) -+{ -+ struct bpf_cgroup_storage_key *key = _key; -+ struct bpf_cgroup_storage *storage; -+ struct bpf_storage_buffer *new; -+ -+ if (unlikely(flags & ~(BPF_F_LOCK | BPF_EXIST | BPF_NOEXIST))) -+ return -EINVAL; -+ -+ if (unlikely(flags & BPF_NOEXIST)) -+ return -EINVAL; -+ -+ if (unlikely((flags & BPF_F_LOCK) && -+ !map_value_has_spin_lock(map))) -+ return -EINVAL; -+ -+ storage = cgroup_storage_lookup((struct bpf_cgroup_storage_map *)map, -+ key, false); -+ if (!storage) -+ return -ENOENT; -+ -+ if (flags & BPF_F_LOCK) { -+ copy_map_value_locked(map, storage->buf->data, value, false); -+ return 0; -+ } -+ -+ new = kmalloc_node(sizeof(struct bpf_storage_buffer) + -+ map->value_size, -+ __GFP_ZERO | GFP_ATOMIC | __GFP_NOWARN, -+ map->numa_node); -+ if (!new) -+ return -ENOMEM; -+ -+ memcpy(&new->data[0], value, map->value_size); -+ check_and_init_map_lock(map, new->data); -+ -+ new = xchg(&storage->buf, new); -+ kfree_rcu(new, rcu); -+ -+ return 0; -+} -+ -+int bpf_percpu_cgroup_storage_copy(struct bpf_map *_map, void *_key, -+ void *value) -+{ -+ struct bpf_cgroup_storage_map *map = map_to_storage(_map); -+ struct bpf_cgroup_storage_key *key = _key; -+ struct bpf_cgroup_storage *storage; -+ int cpu, off = 0; -+ u32 size; -+ -+ rcu_read_lock(); -+ storage = cgroup_storage_lookup(map, key, false); -+ if (!storage) { -+ rcu_read_unlock(); -+ return -ENOENT; -+ } -+ -+ /* per_cpu areas are zero-filled and bpf programs can only -+ * access 'value_size' of them, so copying rounded areas -+ * will not leak any kernel data -+ */ -+ size = round_up(_map->value_size, 8); -+ for_each_possible_cpu(cpu) { -+ bpf_long_memcpy(value + off, -+ per_cpu_ptr(storage->percpu_buf, cpu), size); -+ off += size; -+ } -+ rcu_read_unlock(); -+ return 0; -+} -+ -+int bpf_percpu_cgroup_storage_update(struct bpf_map *_map, void *_key, -+ void *value, u64 map_flags) -+{ -+ struct bpf_cgroup_storage_map *map = map_to_storage(_map); -+ struct bpf_cgroup_storage_key *key = _key; -+ struct bpf_cgroup_storage *storage; -+ int cpu, off = 0; -+ u32 size; -+ -+ if (map_flags != BPF_ANY && map_flags != BPF_EXIST) -+ return -EINVAL; -+ -+ rcu_read_lock(); -+ storage = cgroup_storage_lookup(map, key, false); -+ if (!storage) { -+ rcu_read_unlock(); -+ return -ENOENT; -+ } -+ -+ /* the user space will provide round_up(value_size, 8) bytes that -+ * will be copied into per-cpu area. bpf programs can only access -+ * value_size of it. During lookup the same extra bytes will be -+ * returned or zeros which were zero-filled by percpu_alloc, -+ * so no kernel data leaks possible -+ */ -+ size = round_up(_map->value_size, 8); -+ for_each_possible_cpu(cpu) { -+ bpf_long_memcpy(per_cpu_ptr(storage->percpu_buf, cpu), -+ value + off, size); -+ off += size; -+ } -+ rcu_read_unlock(); -+ return 0; -+} -+ -+static int cgroup_storage_get_next_key(struct bpf_map *_map, void *_key, -+ void *_next_key) -+{ -+ struct bpf_cgroup_storage_map *map = map_to_storage(_map); -+ struct bpf_cgroup_storage_key *key = _key; -+ struct bpf_cgroup_storage_key *next = _next_key; -+ struct bpf_cgroup_storage *storage; -+ -+ spin_lock_bh(&map->lock); -+ -+ if (list_empty(&map->list)) -+ goto enoent; -+ -+ if (key) { -+ storage = cgroup_storage_lookup(map, key, true); -+ if (!storage) -+ goto enoent; -+ -+ storage = list_next_entry(storage, list); -+ if (!storage) -+ goto enoent; -+ } else { -+ storage = list_first_entry(&map->list, -+ struct bpf_cgroup_storage, list); -+ } -+ -+ spin_unlock_bh(&map->lock); -+ next->attach_type = storage->key.attach_type; -+ next->cgroup_inode_id = storage->key.cgroup_inode_id; -+ return 0; -+ -+enoent: -+ spin_unlock_bh(&map->lock); -+ return -ENOENT; -+} -+ -+static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr) -+{ -+ int numa_node = bpf_map_attr_numa_node(attr); -+ struct bpf_cgroup_storage_map *map; -+ struct bpf_map_memory mem; -+ int ret; -+ -+ if (attr->key_size != sizeof(struct bpf_cgroup_storage_key)) -+ return ERR_PTR(-EINVAL); -+ -+ if (attr->value_size == 0) -+ return ERR_PTR(-EINVAL); -+ -+ if (attr->value_size > PAGE_SIZE) -+ return ERR_PTR(-E2BIG); -+ -+ if (attr->map_flags & ~LOCAL_STORAGE_CREATE_FLAG_MASK || -+ !bpf_map_flags_access_ok(attr->map_flags)) -+ return ERR_PTR(-EINVAL); -+ -+ if (attr->max_entries) -+ /* max_entries is not used and enforced to be 0 */ -+ return ERR_PTR(-EINVAL); -+ -+ ret = bpf_map_charge_init(&mem, sizeof(struct bpf_cgroup_storage_map)); -+ if (ret < 0) -+ return ERR_PTR(ret); -+ -+ map = kmalloc_node(sizeof(struct bpf_cgroup_storage_map), -+ __GFP_ZERO | GFP_USER, numa_node); -+ if (!map) { -+ bpf_map_charge_finish(&mem); -+ return ERR_PTR(-ENOMEM); -+ } -+ -+ bpf_map_charge_move(&map->map.memory, &mem); -+ -+ /* copy mandatory map attributes */ -+ bpf_map_init_from_attr(&map->map, attr); -+ -+ spin_lock_init(&map->lock); -+ map->root = RB_ROOT; -+ INIT_LIST_HEAD(&map->list); -+ -+ return &map->map; -+} -+ -+static void cgroup_storage_map_free(struct bpf_map *_map) -+{ -+ struct bpf_cgroup_storage_map *map = map_to_storage(_map); -+ -+ WARN_ON(!RB_EMPTY_ROOT(&map->root)); -+ WARN_ON(!list_empty(&map->list)); -+ -+ kfree(map); -+} -+ -+static int cgroup_storage_delete_elem(struct bpf_map *map, void *key) -+{ -+ return -EINVAL; -+} -+ -+static int cgroup_storage_check_btf(const struct bpf_map *map, -+ const struct btf *btf, -+ const struct btf_type *key_type, -+ const struct btf_type *value_type) -+{ -+ struct btf_member *m; -+ u32 offset, size; -+ -+ /* Key is expected to be of struct bpf_cgroup_storage_key type, -+ * which is: -+ * struct bpf_cgroup_storage_key { -+ * __u64 cgroup_inode_id; -+ * __u32 attach_type; -+ * }; -+ */ -+ -+ /* -+ * Key_type must be a structure with two fields. -+ */ -+ if (BTF_INFO_KIND(key_type->info) != BTF_KIND_STRUCT || -+ BTF_INFO_VLEN(key_type->info) != 2) -+ return -EINVAL; -+ -+ /* -+ * The first field must be a 64 bit integer at 0 offset. -+ */ -+ m = (struct btf_member *)(key_type + 1); -+ size = FIELD_SIZEOF(struct bpf_cgroup_storage_key, cgroup_inode_id); -+ if (!btf_member_is_reg_int(btf, key_type, m, 0, size)) -+ return -EINVAL; -+ -+ /* -+ * The second field must be a 32 bit integer at 64 bit offset. -+ */ -+ m++; -+ offset = offsetof(struct bpf_cgroup_storage_key, attach_type); -+ size = FIELD_SIZEOF(struct bpf_cgroup_storage_key, attach_type); -+ if (!btf_member_is_reg_int(btf, key_type, m, offset, size)) -+ return -EINVAL; -+ -+ return 0; -+} -+ -+static void cgroup_storage_seq_show_elem(struct bpf_map *map, void *_key, -+ struct seq_file *m) -+{ -+ enum bpf_cgroup_storage_type stype = cgroup_storage_type(map); -+ struct bpf_cgroup_storage_key *key = _key; -+ struct bpf_cgroup_storage *storage; -+ int cpu; -+ -+ rcu_read_lock(); -+ storage = cgroup_storage_lookup(map_to_storage(map), key, false); -+ if (!storage) { -+ rcu_read_unlock(); -+ return; -+ } -+ -+ btf_type_seq_show(map->btf, map->btf_key_type_id, key, m); -+ stype = cgroup_storage_type(map); -+ if (stype == BPF_CGROUP_STORAGE_SHARED) { -+ seq_puts(m, ": "); -+ btf_type_seq_show(map->btf, map->btf_value_type_id, -+ &READ_ONCE(storage->buf)->data[0], m); -+ seq_puts(m, "\n"); -+ } else { -+ seq_puts(m, ": {\n"); -+ for_each_possible_cpu(cpu) { -+ seq_printf(m, "\tcpu%d: ", cpu); -+ btf_type_seq_show(map->btf, map->btf_value_type_id, -+ per_cpu_ptr(storage->percpu_buf, cpu), -+ m); -+ seq_puts(m, "\n"); -+ } -+ seq_puts(m, "}\n"); -+ } -+ rcu_read_unlock(); -+} -+ -+const struct bpf_map_ops cgroup_storage_map_ops = { -+ .map_alloc = cgroup_storage_map_alloc, -+ .map_free = cgroup_storage_map_free, -+ .map_get_next_key = cgroup_storage_get_next_key, -+ .map_lookup_elem = cgroup_storage_lookup_elem, -+ .map_update_elem = cgroup_storage_update_elem, -+ .map_delete_elem = cgroup_storage_delete_elem, -+ .map_check_btf = cgroup_storage_check_btf, -+ .map_seq_show_elem = cgroup_storage_seq_show_elem, -+}; -+ -+int bpf_cgroup_storage_assign(struct bpf_prog *prog, struct bpf_map *_map) -+{ -+ enum bpf_cgroup_storage_type stype = cgroup_storage_type(_map); -+ struct bpf_cgroup_storage_map *map = map_to_storage(_map); -+ int ret = -EBUSY; -+ -+ spin_lock_bh(&map->lock); -+ -+ if (map->prog && map->prog != prog) -+ goto unlock; -+ if (prog->aux->cgroup_storage[stype] && -+ prog->aux->cgroup_storage[stype] != _map) -+ goto unlock; -+ -+ map->prog = prog; -+ prog->aux->cgroup_storage[stype] = _map; -+ ret = 0; -+unlock: -+ spin_unlock_bh(&map->lock); -+ -+ return ret; -+} -+ -+void bpf_cgroup_storage_release(struct bpf_prog *prog, struct bpf_map *_map) -+{ -+ enum bpf_cgroup_storage_type stype = cgroup_storage_type(_map); -+ struct bpf_cgroup_storage_map *map = map_to_storage(_map); -+ -+ spin_lock_bh(&map->lock); -+ if (map->prog == prog) { -+ WARN_ON(prog->aux->cgroup_storage[stype] != _map); -+ map->prog = NULL; -+ prog->aux->cgroup_storage[stype] = NULL; -+ } -+ spin_unlock_bh(&map->lock); -+} -+ -+static size_t bpf_cgroup_storage_calculate_size(struct bpf_map *map, u32 *pages) -+{ -+ size_t size; -+ -+ if (cgroup_storage_type(map) == BPF_CGROUP_STORAGE_SHARED) { -+ size = sizeof(struct bpf_storage_buffer) + map->value_size; -+ *pages = round_up(sizeof(struct bpf_cgroup_storage) + size, -+ PAGE_SIZE) >> PAGE_SHIFT; -+ } else { -+ size = map->value_size; -+ *pages = round_up(round_up(size, 8) * num_possible_cpus(), -+ PAGE_SIZE) >> PAGE_SHIFT; -+ } -+ -+ return size; -+} -+ -+struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(struct bpf_prog *prog, -+ enum bpf_cgroup_storage_type stype) -+{ -+ struct bpf_cgroup_storage *storage; -+ struct bpf_map *map; -+ gfp_t flags; -+ size_t size; -+ u32 pages; -+ -+ map = prog->aux->cgroup_storage[stype]; -+ if (!map) -+ return NULL; -+ -+ size = bpf_cgroup_storage_calculate_size(map, &pages); -+ -+ if (bpf_map_charge_memlock(map, pages)) -+ return ERR_PTR(-EPERM); -+ -+ storage = kmalloc_node(sizeof(struct bpf_cgroup_storage), -+ __GFP_ZERO | GFP_USER, map->numa_node); -+ if (!storage) -+ goto enomem; -+ -+ flags = __GFP_ZERO | GFP_USER; -+ -+ if (stype == BPF_CGROUP_STORAGE_SHARED) { -+ storage->buf = kmalloc_node(size, flags, map->numa_node); -+ if (!storage->buf) -+ goto enomem; -+ check_and_init_map_lock(map, storage->buf->data); -+ } else { -+ storage->percpu_buf = __alloc_percpu_gfp(size, 8, flags); -+ if (!storage->percpu_buf) -+ goto enomem; -+ } -+ -+ storage->map = (struct bpf_cgroup_storage_map *)map; -+ -+ return storage; -+ -+enomem: -+ bpf_map_uncharge_memlock(map, pages); -+ kfree(storage); -+ return ERR_PTR(-ENOMEM); -+} -+ -+static void free_shared_cgroup_storage_rcu(struct rcu_head *rcu) -+{ -+ struct bpf_cgroup_storage *storage = -+ container_of(rcu, struct bpf_cgroup_storage, rcu); -+ -+ kfree(storage->buf); -+ kfree(storage); -+} -+ -+static void free_percpu_cgroup_storage_rcu(struct rcu_head *rcu) -+{ -+ struct bpf_cgroup_storage *storage = -+ container_of(rcu, struct bpf_cgroup_storage, rcu); -+ -+ free_percpu(storage->percpu_buf); -+ kfree(storage); -+} -+ -+void bpf_cgroup_storage_free(struct bpf_cgroup_storage *storage) -+{ -+ enum bpf_cgroup_storage_type stype; -+ struct bpf_map *map; -+ u32 pages; -+ -+ if (!storage) -+ return; -+ -+ map = &storage->map->map; -+ -+ bpf_cgroup_storage_calculate_size(map, &pages); -+ bpf_map_uncharge_memlock(map, pages); -+ -+ stype = cgroup_storage_type(map); -+ if (stype == BPF_CGROUP_STORAGE_SHARED) -+ call_rcu(&storage->rcu, free_shared_cgroup_storage_rcu); -+ else -+ call_rcu(&storage->rcu, free_percpu_cgroup_storage_rcu); -+} -+ -+void bpf_cgroup_storage_link(struct bpf_cgroup_storage *storage, -+ struct cgroup *cgroup, -+ enum bpf_attach_type type) -+{ -+ struct bpf_cgroup_storage_map *map; -+ -+ if (!storage) -+ return; -+ -+ storage->key.attach_type = type; -+ storage->key.cgroup_inode_id = cgroup->kn->id.id; -+ -+ map = storage->map; -+ -+ spin_lock_bh(&map->lock); -+ WARN_ON(cgroup_storage_insert(map, storage)); -+ list_add(&storage->list, &map->list); -+ spin_unlock_bh(&map->lock); -+} -+ -+void bpf_cgroup_storage_unlink(struct bpf_cgroup_storage *storage) -+{ -+ struct bpf_cgroup_storage_map *map; -+ struct rb_root *root; -+ -+ if (!storage) -+ return; -+ -+ map = storage->map; -+ -+ spin_lock_bh(&map->lock); -+ root = &map->root; -+ rb_erase(&storage->node, root); -+ -+ list_del(&storage->list); -+ spin_unlock_bh(&map->lock); -+} -+ -+#endif ---- /dev/null -+++ b/kernel/bpf/lpm_trie.c -@@ -0,0 +1,746 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * Longest prefix match list implementation -+ * -+ * Copyright (c) 2016,2017 Daniel Mack -+ * Copyright (c) 2016 David Herrmann -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Intermediate node */ -+#define LPM_TREE_NODE_FLAG_IM BIT(0) -+ -+struct lpm_trie_node; -+ -+struct lpm_trie_node { -+ struct rcu_head rcu; -+ struct lpm_trie_node __rcu *child[2]; -+ u32 prefixlen; -+ u32 flags; -+ u8 data[0]; -+}; -+ -+struct lpm_trie { -+ struct bpf_map map; -+ struct lpm_trie_node __rcu *root; -+ size_t n_entries; -+ size_t max_prefixlen; -+ size_t data_size; -+ raw_spinlock_t lock; -+}; -+ -+/* This trie implements a longest prefix match algorithm that can be used to -+ * match IP addresses to a stored set of ranges. -+ * -+ * Data stored in @data of struct bpf_lpm_key and struct lpm_trie_node is -+ * interpreted as big endian, so data[0] stores the most significant byte. -+ * -+ * Match ranges are internally stored in instances of struct lpm_trie_node -+ * which each contain their prefix length as well as two pointers that may -+ * lead to more nodes containing more specific matches. Each node also stores -+ * a value that is defined by and returned to userspace via the update_elem -+ * and lookup functions. -+ * -+ * For instance, let's start with a trie that was created with a prefix length -+ * of 32, so it can be used for IPv4 addresses, and one single element that -+ * matches 192.168.0.0/16. The data array would hence contain -+ * [0xc0, 0xa8, 0x00, 0x00] in big-endian notation. This documentation will -+ * stick to IP-address notation for readability though. -+ * -+ * As the trie is empty initially, the new node (1) will be places as root -+ * node, denoted as (R) in the example below. As there are no other node, both -+ * child pointers are %NULL. -+ * -+ * +----------------+ -+ * | (1) (R) | -+ * | 192.168.0.0/16 | -+ * | value: 1 | -+ * | [0] [1] | -+ * +----------------+ -+ * -+ * Next, let's add a new node (2) matching 192.168.0.0/24. As there is already -+ * a node with the same data and a smaller prefix (ie, a less specific one), -+ * node (2) will become a child of (1). In child index depends on the next bit -+ * that is outside of what (1) matches, and that bit is 0, so (2) will be -+ * child[0] of (1): -+ * -+ * +----------------+ -+ * | (1) (R) | -+ * | 192.168.0.0/16 | -+ * | value: 1 | -+ * | [0] [1] | -+ * +----------------+ -+ * | -+ * +----------------+ -+ * | (2) | -+ * | 192.168.0.0/24 | -+ * | value: 2 | -+ * | [0] [1] | -+ * +----------------+ -+ * -+ * The child[1] slot of (1) could be filled with another node which has bit #17 -+ * (the next bit after the ones that (1) matches on) set to 1. For instance, -+ * 192.168.128.0/24: -+ * -+ * +----------------+ -+ * | (1) (R) | -+ * | 192.168.0.0/16 | -+ * | value: 1 | -+ * | [0] [1] | -+ * +----------------+ -+ * | | -+ * +----------------+ +------------------+ -+ * | (2) | | (3) | -+ * | 192.168.0.0/24 | | 192.168.128.0/24 | -+ * | value: 2 | | value: 3 | -+ * | [0] [1] | | [0] [1] | -+ * +----------------+ +------------------+ -+ * -+ * Let's add another node (4) to the game for 192.168.1.0/24. In order to place -+ * it, node (1) is looked at first, and because (4) of the semantics laid out -+ * above (bit #17 is 0), it would normally be attached to (1) as child[0]. -+ * However, that slot is already allocated, so a new node is needed in between. -+ * That node does not have a value attached to it and it will never be -+ * returned to users as result of a lookup. It is only there to differentiate -+ * the traversal further. It will get a prefix as wide as necessary to -+ * distinguish its two children: -+ * -+ * +----------------+ -+ * | (1) (R) | -+ * | 192.168.0.0/16 | -+ * | value: 1 | -+ * | [0] [1] | -+ * +----------------+ -+ * | | -+ * +----------------+ +------------------+ -+ * | (4) (I) | | (3) | -+ * | 192.168.0.0/23 | | 192.168.128.0/24 | -+ * | value: --- | | value: 3 | -+ * | [0] [1] | | [0] [1] | -+ * +----------------+ +------------------+ -+ * | | -+ * +----------------+ +----------------+ -+ * | (2) | | (5) | -+ * | 192.168.0.0/24 | | 192.168.1.0/24 | -+ * | value: 2 | | value: 5 | -+ * | [0] [1] | | [0] [1] | -+ * +----------------+ +----------------+ -+ * -+ * 192.168.1.1/32 would be a child of (5) etc. -+ * -+ * An intermediate node will be turned into a 'real' node on demand. In the -+ * example above, (4) would be re-used if 192.168.0.0/23 is added to the trie. -+ * -+ * A fully populated trie would have a height of 32 nodes, as the trie was -+ * created with a prefix length of 32. -+ * -+ * The lookup starts at the root node. If the current node matches and if there -+ * is a child that can be used to become more specific, the trie is traversed -+ * downwards. The last node in the traversal that is a non-intermediate one is -+ * returned. -+ */ -+ -+static inline int extract_bit(const u8 *data, size_t index) -+{ -+ return !!(data[index / 8] & (1 << (7 - (index % 8)))); -+} -+ -+/** -+ * longest_prefix_match() - determine the longest prefix -+ * @trie: The trie to get internal sizes from -+ * @node: The node to operate on -+ * @key: The key to compare to @node -+ * -+ * Determine the longest prefix of @node that matches the bits in @key. -+ */ -+static size_t longest_prefix_match(const struct lpm_trie *trie, -+ const struct lpm_trie_node *node, -+ const struct bpf_lpm_trie_key *key) -+{ -+ u32 limit = min(node->prefixlen, key->prefixlen); -+ u32 prefixlen = 0, i = 0; -+ -+ BUILD_BUG_ON(offsetof(struct lpm_trie_node, data) % sizeof(u32)); -+ BUILD_BUG_ON(offsetof(struct bpf_lpm_trie_key, data) % sizeof(u32)); -+ -+#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && defined(CONFIG_64BIT) -+ -+ /* data_size >= 16 has very small probability. -+ * We do not use a loop for optimal code generation. -+ */ -+ if (trie->data_size >= 8) { -+ u64 diff = be64_to_cpu(*(__be64 *)node->data ^ -+ *(__be64 *)key->data); -+ -+ prefixlen = 64 - fls64(diff); -+ if (prefixlen >= limit) -+ return limit; -+ if (diff) -+ return prefixlen; -+ i = 8; -+ } -+#endif -+ -+ while (trie->data_size >= i + 4) { -+ u32 diff = be32_to_cpu(*(__be32 *)&node->data[i] ^ -+ *(__be32 *)&key->data[i]); -+ -+ prefixlen += 32 - fls(diff); -+ if (prefixlen >= limit) -+ return limit; -+ if (diff) -+ return prefixlen; -+ i += 4; -+ } -+ -+ if (trie->data_size >= i + 2) { -+ u16 diff = be16_to_cpu(*(__be16 *)&node->data[i] ^ -+ *(__be16 *)&key->data[i]); -+ -+ prefixlen += 16 - fls(diff); -+ if (prefixlen >= limit) -+ return limit; -+ if (diff) -+ return prefixlen; -+ i += 2; -+ } -+ -+ if (trie->data_size >= i + 1) { -+ prefixlen += 8 - fls(node->data[i] ^ key->data[i]); -+ -+ if (prefixlen >= limit) -+ return limit; -+ } -+ -+ return prefixlen; -+} -+ -+/* Called from syscall or from eBPF program */ -+static void *trie_lookup_elem(struct bpf_map *map, void *_key) -+{ -+ struct lpm_trie *trie = container_of(map, struct lpm_trie, map); -+ struct lpm_trie_node *node, *found = NULL; -+ struct bpf_lpm_trie_key *key = _key; -+ -+ /* Start walking the trie from the root node ... */ -+ -+ for (node = rcu_dereference(trie->root); node;) { -+ unsigned int next_bit; -+ size_t matchlen; -+ -+ /* Determine the longest prefix of @node that matches @key. -+ * If it's the maximum possible prefix for this trie, we have -+ * an exact match and can return it directly. -+ */ -+ matchlen = longest_prefix_match(trie, node, key); -+ if (matchlen == trie->max_prefixlen) { -+ found = node; -+ break; -+ } -+ -+ /* If the number of bits that match is smaller than the prefix -+ * length of @node, bail out and return the node we have seen -+ * last in the traversal (ie, the parent). -+ */ -+ if (matchlen < node->prefixlen) -+ break; -+ -+ /* Consider this node as return candidate unless it is an -+ * artificially added intermediate one. -+ */ -+ if (!(node->flags & LPM_TREE_NODE_FLAG_IM)) -+ found = node; -+ -+ /* If the node match is fully satisfied, let's see if we can -+ * become more specific. Determine the next bit in the key and -+ * traverse down. -+ */ -+ next_bit = extract_bit(key->data, node->prefixlen); -+ node = rcu_dereference(node->child[next_bit]); -+ } -+ -+ if (!found) -+ return NULL; -+ -+ return found->data + trie->data_size; -+} -+ -+static struct lpm_trie_node *lpm_trie_node_alloc(const struct lpm_trie *trie, -+ const void *value) -+{ -+ struct lpm_trie_node *node; -+ size_t size = sizeof(struct lpm_trie_node) + trie->data_size; -+ -+ if (value) -+ size += trie->map.value_size; -+ -+ node = kmalloc_node(size, GFP_ATOMIC | __GFP_NOWARN, -+ trie->map.numa_node); -+ if (!node) -+ return NULL; -+ -+ node->flags = 0; -+ -+ if (value) -+ memcpy(node->data + trie->data_size, value, -+ trie->map.value_size); -+ -+ return node; -+} -+ -+/* Called from syscall or from eBPF program */ -+static int trie_update_elem(struct bpf_map *map, -+ void *_key, void *value, u64 flags) -+{ -+ struct lpm_trie *trie = container_of(map, struct lpm_trie, map); -+ struct lpm_trie_node *node, *im_node = NULL, *new_node = NULL; -+ struct lpm_trie_node __rcu **slot; -+ struct bpf_lpm_trie_key *key = _key; -+ unsigned long irq_flags; -+ unsigned int next_bit; -+ size_t matchlen = 0; -+ int ret = 0; -+ -+ if (unlikely(flags > BPF_EXIST)) -+ return -EINVAL; -+ -+ if (key->prefixlen > trie->max_prefixlen) -+ return -EINVAL; -+ -+ raw_spin_lock_irqsave(&trie->lock, irq_flags); -+ -+ /* Allocate and fill a new node */ -+ -+ if (trie->n_entries == trie->map.max_entries) { -+ ret = -ENOSPC; -+ goto out; -+ } -+ -+ new_node = lpm_trie_node_alloc(trie, value); -+ if (!new_node) { -+ ret = -ENOMEM; -+ goto out; -+ } -+ -+ trie->n_entries++; -+ -+ new_node->prefixlen = key->prefixlen; -+ RCU_INIT_POINTER(new_node->child[0], NULL); -+ RCU_INIT_POINTER(new_node->child[1], NULL); -+ memcpy(new_node->data, key->data, trie->data_size); -+ -+ /* Now find a slot to attach the new node. To do that, walk the tree -+ * from the root and match as many bits as possible for each node until -+ * we either find an empty slot or a slot that needs to be replaced by -+ * an intermediate node. -+ */ -+ slot = &trie->root; -+ -+ while ((node = rcu_dereference_protected(*slot, -+ lockdep_is_held(&trie->lock)))) { -+ matchlen = longest_prefix_match(trie, node, key); -+ -+ if (node->prefixlen != matchlen || -+ node->prefixlen == key->prefixlen || -+ node->prefixlen == trie->max_prefixlen) -+ break; -+ -+ next_bit = extract_bit(key->data, node->prefixlen); -+ slot = &node->child[next_bit]; -+ } -+ -+ /* If the slot is empty (a free child pointer or an empty root), -+ * simply assign the @new_node to that slot and be done. -+ */ -+ if (!node) { -+ rcu_assign_pointer(*slot, new_node); -+ goto out; -+ } -+ -+ /* If the slot we picked already exists, replace it with @new_node -+ * which already has the correct data array set. -+ */ -+ if (node->prefixlen == matchlen) { -+ new_node->child[0] = node->child[0]; -+ new_node->child[1] = node->child[1]; -+ -+ if (!(node->flags & LPM_TREE_NODE_FLAG_IM)) -+ trie->n_entries--; -+ -+ rcu_assign_pointer(*slot, new_node); -+ kfree_rcu(node, rcu); -+ -+ goto out; -+ } -+ -+ /* If the new node matches the prefix completely, it must be inserted -+ * as an ancestor. Simply insert it between @node and *@slot. -+ */ -+ if (matchlen == key->prefixlen) { -+ next_bit = extract_bit(node->data, matchlen); -+ rcu_assign_pointer(new_node->child[next_bit], node); -+ rcu_assign_pointer(*slot, new_node); -+ goto out; -+ } -+ -+ im_node = lpm_trie_node_alloc(trie, NULL); -+ if (!im_node) { -+ ret = -ENOMEM; -+ goto out; -+ } -+ -+ im_node->prefixlen = matchlen; -+ im_node->flags |= LPM_TREE_NODE_FLAG_IM; -+ memcpy(im_node->data, node->data, trie->data_size); -+ -+ /* Now determine which child to install in which slot */ -+ if (extract_bit(key->data, matchlen)) { -+ rcu_assign_pointer(im_node->child[0], node); -+ rcu_assign_pointer(im_node->child[1], new_node); -+ } else { -+ rcu_assign_pointer(im_node->child[0], new_node); -+ rcu_assign_pointer(im_node->child[1], node); -+ } -+ -+ /* Finally, assign the intermediate node to the determined spot */ -+ rcu_assign_pointer(*slot, im_node); -+ -+out: -+ if (ret) { -+ if (new_node) -+ trie->n_entries--; -+ -+ kfree(new_node); -+ kfree(im_node); -+ } -+ -+ raw_spin_unlock_irqrestore(&trie->lock, irq_flags); -+ -+ return ret; -+} -+ -+/* Called from syscall or from eBPF program */ -+static int trie_delete_elem(struct bpf_map *map, void *_key) -+{ -+ struct lpm_trie *trie = container_of(map, struct lpm_trie, map); -+ struct bpf_lpm_trie_key *key = _key; -+ struct lpm_trie_node __rcu **trim, **trim2; -+ struct lpm_trie_node *node, *parent; -+ unsigned long irq_flags; -+ unsigned int next_bit; -+ size_t matchlen = 0; -+ int ret = 0; -+ -+ if (key->prefixlen > trie->max_prefixlen) -+ return -EINVAL; -+ -+ raw_spin_lock_irqsave(&trie->lock, irq_flags); -+ -+ /* Walk the tree looking for an exact key/length match and keeping -+ * track of the path we traverse. We will need to know the node -+ * we wish to delete, and the slot that points to the node we want -+ * to delete. We may also need to know the nodes parent and the -+ * slot that contains it. -+ */ -+ trim = &trie->root; -+ trim2 = trim; -+ parent = NULL; -+ while ((node = rcu_dereference_protected( -+ *trim, lockdep_is_held(&trie->lock)))) { -+ matchlen = longest_prefix_match(trie, node, key); -+ -+ if (node->prefixlen != matchlen || -+ node->prefixlen == key->prefixlen) -+ break; -+ -+ parent = node; -+ trim2 = trim; -+ next_bit = extract_bit(key->data, node->prefixlen); -+ trim = &node->child[next_bit]; -+ } -+ -+ if (!node || node->prefixlen != key->prefixlen || -+ node->prefixlen != matchlen || -+ (node->flags & LPM_TREE_NODE_FLAG_IM)) { -+ ret = -ENOENT; -+ goto out; -+ } -+ -+ trie->n_entries--; -+ -+ /* If the node we are removing has two children, simply mark it -+ * as intermediate and we are done. -+ */ -+ if (rcu_access_pointer(node->child[0]) && -+ rcu_access_pointer(node->child[1])) { -+ node->flags |= LPM_TREE_NODE_FLAG_IM; -+ goto out; -+ } -+ -+ /* If the parent of the node we are about to delete is an intermediate -+ * node, and the deleted node doesn't have any children, we can delete -+ * the intermediate parent as well and promote its other child -+ * up the tree. Doing this maintains the invariant that all -+ * intermediate nodes have exactly 2 children and that there are no -+ * unnecessary intermediate nodes in the tree. -+ */ -+ if (parent && (parent->flags & LPM_TREE_NODE_FLAG_IM) && -+ !node->child[0] && !node->child[1]) { -+ if (node == rcu_access_pointer(parent->child[0])) -+ rcu_assign_pointer( -+ *trim2, rcu_access_pointer(parent->child[1])); -+ else -+ rcu_assign_pointer( -+ *trim2, rcu_access_pointer(parent->child[0])); -+ kfree_rcu(parent, rcu); -+ kfree_rcu(node, rcu); -+ goto out; -+ } -+ -+ /* The node we are removing has either zero or one child. If there -+ * is a child, move it into the removed node's slot then delete -+ * the node. Otherwise just clear the slot and delete the node. -+ */ -+ if (node->child[0]) -+ rcu_assign_pointer(*trim, rcu_access_pointer(node->child[0])); -+ else if (node->child[1]) -+ rcu_assign_pointer(*trim, rcu_access_pointer(node->child[1])); -+ else -+ RCU_INIT_POINTER(*trim, NULL); -+ kfree_rcu(node, rcu); -+ -+out: -+ raw_spin_unlock_irqrestore(&trie->lock, irq_flags); -+ -+ return ret; -+} -+ -+#define LPM_DATA_SIZE_MAX 256 -+#define LPM_DATA_SIZE_MIN 1 -+ -+#define LPM_VAL_SIZE_MAX (KMALLOC_MAX_SIZE - LPM_DATA_SIZE_MAX - \ -+ sizeof(struct lpm_trie_node)) -+#define LPM_VAL_SIZE_MIN 1 -+ -+#define LPM_KEY_SIZE(X) (sizeof(struct bpf_lpm_trie_key) + (X)) -+#define LPM_KEY_SIZE_MAX LPM_KEY_SIZE(LPM_DATA_SIZE_MAX) -+#define LPM_KEY_SIZE_MIN LPM_KEY_SIZE(LPM_DATA_SIZE_MIN) -+ -+#define LPM_CREATE_FLAG_MASK (BPF_F_NO_PREALLOC | BPF_F_NUMA_NODE | \ -+ BPF_F_ACCESS_MASK) -+ -+static struct bpf_map *trie_alloc(union bpf_attr *attr) -+{ -+ struct lpm_trie *trie; -+ u64 cost = sizeof(*trie), cost_per_node; -+ int ret; -+ -+ if (!capable(CAP_SYS_ADMIN)) -+ return ERR_PTR(-EPERM); -+ -+ /* check sanity of attributes */ -+ if (attr->max_entries == 0 || -+ !(attr->map_flags & BPF_F_NO_PREALLOC) || -+ attr->map_flags & ~LPM_CREATE_FLAG_MASK || -+ !bpf_map_flags_access_ok(attr->map_flags) || -+ attr->key_size < LPM_KEY_SIZE_MIN || -+ attr->key_size > LPM_KEY_SIZE_MAX || -+ attr->value_size < LPM_VAL_SIZE_MIN || -+ attr->value_size > LPM_VAL_SIZE_MAX) -+ return ERR_PTR(-EINVAL); -+ -+ trie = kzalloc(sizeof(*trie), GFP_USER | __GFP_NOWARN); -+ if (!trie) -+ return ERR_PTR(-ENOMEM); -+ -+ /* copy mandatory map attributes */ -+ bpf_map_init_from_attr(&trie->map, attr); -+ trie->data_size = attr->key_size - -+ offsetof(struct bpf_lpm_trie_key, data); -+ trie->max_prefixlen = trie->data_size * 8; -+ -+ cost_per_node = sizeof(struct lpm_trie_node) + -+ attr->value_size + trie->data_size; -+ cost += (u64) attr->max_entries * cost_per_node; -+ -+ ret = bpf_map_charge_init(&trie->map.memory, cost); -+ if (ret) -+ goto out_err; -+ -+ raw_spin_lock_init(&trie->lock); -+ -+ return &trie->map; -+out_err: -+ kfree(trie); -+ return ERR_PTR(ret); -+} -+ -+static void trie_free(struct bpf_map *map) -+{ -+ struct lpm_trie *trie = container_of(map, struct lpm_trie, map); -+ struct lpm_trie_node __rcu **slot; -+ struct lpm_trie_node *node; -+ -+ /* Wait for outstanding programs to complete -+ * update/lookup/delete/get_next_key and free the trie. -+ */ -+ synchronize_rcu(); -+ -+ /* Always start at the root and walk down to a node that has no -+ * children. Then free that node, nullify its reference in the parent -+ * and start over. -+ */ -+ -+ for (;;) { -+ slot = &trie->root; -+ -+ for (;;) { -+ node = rcu_dereference_protected(*slot, 1); -+ if (!node) -+ goto out; -+ -+ if (rcu_access_pointer(node->child[0])) { -+ slot = &node->child[0]; -+ continue; -+ } -+ -+ if (rcu_access_pointer(node->child[1])) { -+ slot = &node->child[1]; -+ continue; -+ } -+ -+ kfree(node); -+ RCU_INIT_POINTER(*slot, NULL); -+ break; -+ } -+ } -+ -+out: -+ kfree(trie); -+} -+ -+static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key) -+{ -+ struct lpm_trie_node *node, *next_node = NULL, *parent, *search_root; -+ struct lpm_trie *trie = container_of(map, struct lpm_trie, map); -+ struct bpf_lpm_trie_key *key = _key, *next_key = _next_key; -+ struct lpm_trie_node **node_stack = NULL; -+ int err = 0, stack_ptr = -1; -+ unsigned int next_bit; -+ size_t matchlen; -+ -+ /* The get_next_key follows postorder. For the 4 node example in -+ * the top of this file, the trie_get_next_key() returns the following -+ * one after another: -+ * 192.168.0.0/24 -+ * 192.168.1.0/24 -+ * 192.168.128.0/24 -+ * 192.168.0.0/16 -+ * -+ * The idea is to return more specific keys before less specific ones. -+ */ -+ -+ /* Empty trie */ -+ search_root = rcu_dereference(trie->root); -+ if (!search_root) -+ return -ENOENT; -+ -+ /* For invalid key, find the leftmost node in the trie */ -+ if (!key || key->prefixlen > trie->max_prefixlen) -+ goto find_leftmost; -+ -+ node_stack = kmalloc_array(trie->max_prefixlen, -+ sizeof(struct lpm_trie_node *), -+ GFP_ATOMIC | __GFP_NOWARN); -+ if (!node_stack) -+ return -ENOMEM; -+ -+ /* Try to find the exact node for the given key */ -+ for (node = search_root; node;) { -+ node_stack[++stack_ptr] = node; -+ matchlen = longest_prefix_match(trie, node, key); -+ if (node->prefixlen != matchlen || -+ node->prefixlen == key->prefixlen) -+ break; -+ -+ next_bit = extract_bit(key->data, node->prefixlen); -+ node = rcu_dereference(node->child[next_bit]); -+ } -+ if (!node || node->prefixlen != key->prefixlen || -+ (node->flags & LPM_TREE_NODE_FLAG_IM)) -+ goto find_leftmost; -+ -+ /* The node with the exactly-matching key has been found, -+ * find the first node in postorder after the matched node. -+ */ -+ node = node_stack[stack_ptr]; -+ while (stack_ptr > 0) { -+ parent = node_stack[stack_ptr - 1]; -+ if (rcu_dereference(parent->child[0]) == node) { -+ search_root = rcu_dereference(parent->child[1]); -+ if (search_root) -+ goto find_leftmost; -+ } -+ if (!(parent->flags & LPM_TREE_NODE_FLAG_IM)) { -+ next_node = parent; -+ goto do_copy; -+ } -+ -+ node = parent; -+ stack_ptr--; -+ } -+ -+ /* did not find anything */ -+ err = -ENOENT; -+ goto free_stack; -+ -+find_leftmost: -+ /* Find the leftmost non-intermediate node, all intermediate nodes -+ * have exact two children, so this function will never return NULL. -+ */ -+ for (node = search_root; node;) { -+ if (node->flags & LPM_TREE_NODE_FLAG_IM) { -+ node = rcu_dereference(node->child[0]); -+ } else { -+ next_node = node; -+ node = rcu_dereference(node->child[0]); -+ if (!node) -+ node = rcu_dereference(next_node->child[1]); -+ } -+ } -+do_copy: -+ next_key->prefixlen = next_node->prefixlen; -+ memcpy((void *)next_key + offsetof(struct bpf_lpm_trie_key, data), -+ next_node->data, trie->data_size); -+free_stack: -+ kfree(node_stack); -+ return err; -+} -+ -+static int trie_check_btf(const struct bpf_map *map, -+ const struct btf *btf, -+ const struct btf_type *key_type, -+ const struct btf_type *value_type) -+{ -+ /* Keys must have struct bpf_lpm_trie_key embedded. */ -+ return BTF_INFO_KIND(key_type->info) != BTF_KIND_STRUCT ? -+ -EINVAL : 0; -+} -+ -+const struct bpf_map_ops trie_map_ops = { -+ .map_alloc = trie_alloc, -+ .map_free = trie_free, -+ .map_get_next_key = trie_get_next_key, -+ .map_lookup_elem = trie_lookup_elem, -+ .map_update_elem = trie_update_elem, -+ .map_delete_elem = trie_delete_elem, -+ .map_check_btf = trie_check_btf, -+}; ---- a/kernel/bpf/Makefile -+++ b/kernel/bpf/Makefile -@@ -1,4 +1,23 @@ -+# SPDX-License-Identifier: GPL-2.0 - obj-y := core.o -+ifneq ($(CONFIG_BPF_JIT_ALWAYS_ON),y) -+# ___bpf_prog_run() needs GCSE disabled on x86; see 3193c0836f203 for details -+cflags-nogcse-$(CONFIG_X86)$(CONFIG_CC_IS_GCC) := -fno-gcse -+endif -+CFLAGS_core.o += $(call cc-disable-warning, override-init) $(cflags-nogcse-yy) - --obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o --obj-$(CONFIG_BPF_SYSCALL) += hashtab.o arraymap.o -+obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o tnum.o -+obj-$(CONFIG_BPF_SYSCALL) += hashtab.o arraymap.o percpu_freelist.o bpf_lru_list.o lpm_trie.o map_in_map.o -+obj-$(CONFIG_BPF_SYSCALL) += local_storage.o queue_stack_maps.o -+obj-$(CONFIG_BPF_SYSCALL) += disasm.o -+obj-$(CONFIG_BPF_SYSCALL) += btf.o -+ifeq ($(CONFIG_NET),y) -+obj-$(CONFIG_BPF_SYSCALL) += devmap.o -+endif -+ifeq ($(CONFIG_PERF_EVENTS),y) -+obj-$(CONFIG_BPF_SYSCALL) += stackmap.o -+endif -+obj-$(CONFIG_CGROUP_BPF) += cgroup.o -+ifeq ($(CONFIG_SYSFS),y) -+obj-$(CONFIG_DEBUG_INFO_BTF) += sysfs_btf.o -+endif ---- /dev/null -+++ b/kernel/bpf/map_in_map.c -@@ -0,0 +1,120 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* Copyright (c) 2017 Facebook -+ */ -+#include -+#include -+ -+#include "map_in_map.h" -+ -+struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd) -+{ -+ struct bpf_map *inner_map, *inner_map_meta; -+ u32 inner_map_meta_size; -+ struct fd f; -+ -+ f = fdget(inner_map_ufd); -+ inner_map = __bpf_map_get(f); -+ if (IS_ERR(inner_map)) -+ return inner_map; -+ -+ /* prog_array->owner_prog_type and owner_jited -+ * is a runtime binding. Doing static check alone -+ * in the verifier is not enough. -+ */ -+ if (inner_map->map_type == BPF_MAP_TYPE_PROG_ARRAY || -+ inner_map->map_type == BPF_MAP_TYPE_CGROUP_STORAGE || -+ inner_map->map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) { -+ fdput(f); -+ return ERR_PTR(-ENOTSUPP); -+ } -+ -+ /* Does not support >1 level map-in-map */ -+ if (inner_map->inner_map_meta) { -+ fdput(f); -+ return ERR_PTR(-EINVAL); -+ } -+ -+ if (map_value_has_spin_lock(inner_map)) { -+ fdput(f); -+ return ERR_PTR(-ENOTSUPP); -+ } -+ -+ inner_map_meta_size = sizeof(*inner_map_meta); -+ /* In some cases verifier needs to access beyond just base map. */ -+ if (inner_map->ops == &array_map_ops) -+ inner_map_meta_size = sizeof(struct bpf_array); -+ -+ inner_map_meta = kzalloc(inner_map_meta_size, GFP_USER); -+ if (!inner_map_meta) { -+ fdput(f); -+ return ERR_PTR(-ENOMEM); -+ } -+ -+ inner_map_meta->map_type = inner_map->map_type; -+ inner_map_meta->key_size = inner_map->key_size; -+ inner_map_meta->value_size = inner_map->value_size; -+ inner_map_meta->map_flags = inner_map->map_flags; -+ inner_map_meta->max_entries = inner_map->max_entries; -+ inner_map_meta->spin_lock_off = inner_map->spin_lock_off; -+ -+ /* Misc members not needed in bpf_map_meta_equal() check. */ -+ inner_map_meta->ops = inner_map->ops; -+ if (inner_map->ops == &array_map_ops) { -+ inner_map_meta->unpriv_array = inner_map->unpriv_array; -+ container_of(inner_map_meta, struct bpf_array, map)->index_mask = -+ container_of(inner_map, struct bpf_array, map)->index_mask; -+ } -+ -+ fdput(f); -+ return inner_map_meta; -+} -+ -+void bpf_map_meta_free(struct bpf_map *map_meta) -+{ -+ kfree(map_meta); -+} -+ -+bool bpf_map_meta_equal(const struct bpf_map *meta0, -+ const struct bpf_map *meta1) -+{ -+ /* No need to compare ops because it is covered by map_type */ -+ return meta0->map_type == meta1->map_type && -+ meta0->key_size == meta1->key_size && -+ meta0->value_size == meta1->value_size && -+ meta0->map_flags == meta1->map_flags && -+ meta0->max_entries == meta1->max_entries; -+} -+ -+void *bpf_map_fd_get_ptr(struct bpf_map *map, -+ struct file *map_file /* not used */, -+ int ufd) -+{ -+ struct bpf_map *inner_map; -+ struct fd f; -+ -+ f = fdget(ufd); -+ inner_map = __bpf_map_get(f); -+ if (IS_ERR(inner_map)) -+ return inner_map; -+ -+ if (bpf_map_meta_equal(map->inner_map_meta, inner_map)) -+ inner_map = bpf_map_inc(inner_map, false); -+ else -+ inner_map = ERR_PTR(-EINVAL); -+ -+ fdput(f); -+ return inner_map; -+} -+ -+void bpf_map_fd_put_ptr(void *ptr) -+{ -+ /* ptr->ops->map_free() has to go through one -+ * rcu grace period by itself. -+ */ -+ bpf_map_put(ptr); -+} -+ -+u32 bpf_map_fd_sys_lookup_elem(void *ptr) -+{ -+ return ((struct bpf_map *)ptr)->id; -+} ---- /dev/null -+++ b/kernel/bpf/map_in_map.h -@@ -0,0 +1,21 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+/* Copyright (c) 2017 Facebook -+ */ -+#ifndef __MAP_IN_MAP_H__ -+#define __MAP_IN_MAP_H__ -+ -+#include -+ -+struct file; -+struct bpf_map; -+ -+struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd); -+void bpf_map_meta_free(struct bpf_map *map_meta); -+bool bpf_map_meta_equal(const struct bpf_map *meta0, -+ const struct bpf_map *meta1); -+void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file, -+ int ufd); -+void bpf_map_fd_put_ptr(void *ptr); -+u32 bpf_map_fd_sys_lookup_elem(void *ptr); -+ -+#endif ---- /dev/null -+++ b/kernel/bpf/percpu_freelist.c -@@ -0,0 +1,118 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* Copyright (c) 2016 Facebook -+ */ -+#include "percpu_freelist.h" -+ -+int pcpu_freelist_init(struct pcpu_freelist *s) -+{ -+ int cpu; -+ -+ s->freelist = alloc_percpu(struct pcpu_freelist_head); -+ if (!s->freelist) -+ return -ENOMEM; -+ -+ for_each_possible_cpu(cpu) { -+ struct pcpu_freelist_head *head = per_cpu_ptr(s->freelist, cpu); -+ -+ raw_spin_lock_init(&head->lock); -+ head->first = NULL; -+ } -+ return 0; -+} -+ -+void pcpu_freelist_destroy(struct pcpu_freelist *s) -+{ -+ free_percpu(s->freelist); -+} -+ -+static inline void ___pcpu_freelist_push(struct pcpu_freelist_head *head, -+ struct pcpu_freelist_node *node) -+{ -+ raw_spin_lock(&head->lock); -+ node->next = head->first; -+ head->first = node; -+ raw_spin_unlock(&head->lock); -+} -+ -+void __pcpu_freelist_push(struct pcpu_freelist *s, -+ struct pcpu_freelist_node *node) -+{ -+ struct pcpu_freelist_head *head = this_cpu_ptr(s->freelist); -+ -+ ___pcpu_freelist_push(head, node); -+} -+ -+void pcpu_freelist_push(struct pcpu_freelist *s, -+ struct pcpu_freelist_node *node) -+{ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ __pcpu_freelist_push(s, node); -+ local_irq_restore(flags); -+} -+ -+void pcpu_freelist_populate(struct pcpu_freelist *s, void *buf, u32 elem_size, -+ u32 nr_elems) -+{ -+ struct pcpu_freelist_head *head; -+ unsigned long flags; -+ int i, cpu, pcpu_entries; -+ -+ pcpu_entries = nr_elems / num_possible_cpus() + 1; -+ i = 0; -+ -+ /* disable irq to workaround lockdep false positive -+ * in bpf usage pcpu_freelist_populate() will never race -+ * with pcpu_freelist_push() -+ */ -+ local_irq_save(flags); -+ for_each_possible_cpu(cpu) { -+again: -+ head = per_cpu_ptr(s->freelist, cpu); -+ ___pcpu_freelist_push(head, buf); -+ i++; -+ buf += elem_size; -+ if (i == nr_elems) -+ break; -+ if (i % pcpu_entries) -+ goto again; -+ } -+ local_irq_restore(flags); -+} -+ -+struct pcpu_freelist_node *__pcpu_freelist_pop(struct pcpu_freelist *s) -+{ -+ struct pcpu_freelist_head *head; -+ struct pcpu_freelist_node *node; -+ int orig_cpu, cpu; -+ -+ orig_cpu = cpu = raw_smp_processor_id(); -+ while (1) { -+ head = per_cpu_ptr(s->freelist, cpu); -+ raw_spin_lock(&head->lock); -+ node = head->first; -+ if (node) { -+ head->first = node->next; -+ raw_spin_unlock(&head->lock); -+ return node; -+ } -+ raw_spin_unlock(&head->lock); -+ cpu = cpumask_next(cpu, cpu_possible_mask); -+ if (cpu >= nr_cpu_ids) -+ cpu = 0; -+ if (cpu == orig_cpu) -+ return NULL; -+ } -+} -+ -+struct pcpu_freelist_node *pcpu_freelist_pop(struct pcpu_freelist *s) -+{ -+ struct pcpu_freelist_node *ret; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ ret = __pcpu_freelist_pop(s); -+ local_irq_restore(flags); -+ return ret; -+} ---- /dev/null -+++ b/kernel/bpf/percpu_freelist.h -@@ -0,0 +1,32 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+/* Copyright (c) 2016 Facebook -+ */ -+#ifndef __PERCPU_FREELIST_H__ -+#define __PERCPU_FREELIST_H__ -+#include -+#include -+ -+struct pcpu_freelist_head { -+ struct pcpu_freelist_node *first; -+ raw_spinlock_t lock; -+}; -+ -+struct pcpu_freelist { -+ struct pcpu_freelist_head __percpu *freelist; -+}; -+ -+struct pcpu_freelist_node { -+ struct pcpu_freelist_node *next; -+}; -+ -+/* pcpu_freelist_* do spin_lock_irqsave. */ -+void pcpu_freelist_push(struct pcpu_freelist *, struct pcpu_freelist_node *); -+struct pcpu_freelist_node *pcpu_freelist_pop(struct pcpu_freelist *); -+/* __pcpu_freelist_* do spin_lock only. caller must disable irqs. */ -+void __pcpu_freelist_push(struct pcpu_freelist *, struct pcpu_freelist_node *); -+struct pcpu_freelist_node *__pcpu_freelist_pop(struct pcpu_freelist *); -+void pcpu_freelist_populate(struct pcpu_freelist *s, void *buf, u32 elem_size, -+ u32 nr_elems); -+int pcpu_freelist_init(struct pcpu_freelist *); -+void pcpu_freelist_destroy(struct pcpu_freelist *s); -+#endif ---- /dev/null -+++ b/kernel/bpf/queue_stack_maps.c -@@ -0,0 +1,289 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * queue_stack_maps.c: BPF queue and stack maps -+ * -+ * Copyright (c) 2018 Politecnico di Torino -+ */ -+#include -+#include -+#include -+#include -+#include "percpu_freelist.h" -+ -+#define QUEUE_STACK_CREATE_FLAG_MASK \ -+ (BPF_F_NUMA_NODE | BPF_F_ACCESS_MASK) -+ -+struct bpf_queue_stack { -+ struct bpf_map map; -+ raw_spinlock_t lock; -+ u32 head, tail; -+ u32 size; /* max_entries + 1 */ -+ -+ char elements[0] __aligned(8); -+}; -+ -+static struct bpf_queue_stack *bpf_queue_stack(struct bpf_map *map) -+{ -+ return container_of(map, struct bpf_queue_stack, map); -+} -+ -+static bool queue_stack_map_is_empty(struct bpf_queue_stack *qs) -+{ -+ return qs->head == qs->tail; -+} -+ -+static bool queue_stack_map_is_full(struct bpf_queue_stack *qs) -+{ -+ u32 head = qs->head + 1; -+ -+ if (unlikely(head >= qs->size)) -+ head = 0; -+ -+ return head == qs->tail; -+} -+ -+/* Called from syscall */ -+static int queue_stack_map_alloc_check(union bpf_attr *attr) -+{ -+ if (!capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ -+ /* check sanity of attributes */ -+ if (attr->max_entries == 0 || attr->key_size != 0 || -+ attr->value_size == 0 || -+ attr->map_flags & ~QUEUE_STACK_CREATE_FLAG_MASK || -+ !bpf_map_flags_access_ok(attr->map_flags)) -+ return -EINVAL; -+ -+ if (attr->value_size > KMALLOC_MAX_SIZE) -+ /* if value_size is bigger, the user space won't be able to -+ * access the elements. -+ */ -+ return -E2BIG; -+ -+ return 0; -+} -+ -+static struct bpf_map *queue_stack_map_alloc(union bpf_attr *attr) -+{ -+ int ret, numa_node = bpf_map_attr_numa_node(attr); -+ struct bpf_map_memory mem = {0}; -+ struct bpf_queue_stack *qs; -+ u64 size, queue_size, cost; -+ -+ size = (u64) attr->max_entries + 1; -+ cost = queue_size = sizeof(*qs) + size * attr->value_size; -+ -+ ret = bpf_map_charge_init(&mem, cost); -+ if (ret < 0) -+ return ERR_PTR(ret); -+ -+ qs = bpf_map_area_alloc(queue_size, numa_node); -+ if (!qs) { -+ bpf_map_charge_finish(&mem); -+ return ERR_PTR(-ENOMEM); -+ } -+ -+ memset(qs, 0, sizeof(*qs)); -+ -+ bpf_map_init_from_attr(&qs->map, attr); -+ -+ bpf_map_charge_move(&qs->map.memory, &mem); -+ qs->size = size; -+ -+ raw_spin_lock_init(&qs->lock); -+ -+ return &qs->map; -+} -+ -+/* Called when map->refcnt goes to zero, either from workqueue or from syscall */ -+static void queue_stack_map_free(struct bpf_map *map) -+{ -+ struct bpf_queue_stack *qs = bpf_queue_stack(map); -+ -+ /* at this point bpf_prog->aux->refcnt == 0 and this map->refcnt == 0, -+ * so the programs (can be more than one that used this map) were -+ * disconnected from events. Wait for outstanding critical sections in -+ * these programs to complete -+ */ -+ synchronize_rcu(); -+ -+ bpf_map_area_free(qs); -+} -+ -+static int __queue_map_get(struct bpf_map *map, void *value, bool delete) -+{ -+ struct bpf_queue_stack *qs = bpf_queue_stack(map); -+ unsigned long flags; -+ int err = 0; -+ void *ptr; -+ -+ raw_spin_lock_irqsave(&qs->lock, flags); -+ -+ if (queue_stack_map_is_empty(qs)) { -+ memset(value, 0, qs->map.value_size); -+ err = -ENOENT; -+ goto out; -+ } -+ -+ ptr = &qs->elements[qs->tail * qs->map.value_size]; -+ memcpy(value, ptr, qs->map.value_size); -+ -+ if (delete) { -+ if (unlikely(++qs->tail >= qs->size)) -+ qs->tail = 0; -+ } -+ -+out: -+ raw_spin_unlock_irqrestore(&qs->lock, flags); -+ return err; -+} -+ -+ -+static int __stack_map_get(struct bpf_map *map, void *value, bool delete) -+{ -+ struct bpf_queue_stack *qs = bpf_queue_stack(map); -+ unsigned long flags; -+ int err = 0; -+ void *ptr; -+ u32 index; -+ -+ raw_spin_lock_irqsave(&qs->lock, flags); -+ -+ if (queue_stack_map_is_empty(qs)) { -+ memset(value, 0, qs->map.value_size); -+ err = -ENOENT; -+ goto out; -+ } -+ -+ index = qs->head - 1; -+ if (unlikely(index >= qs->size)) -+ index = qs->size - 1; -+ -+ ptr = &qs->elements[index * qs->map.value_size]; -+ memcpy(value, ptr, qs->map.value_size); -+ -+ if (delete) -+ qs->head = index; -+ -+out: -+ raw_spin_unlock_irqrestore(&qs->lock, flags); -+ return err; -+} -+ -+/* Called from syscall or from eBPF program */ -+static int queue_map_peek_elem(struct bpf_map *map, void *value) -+{ -+ return __queue_map_get(map, value, false); -+} -+ -+/* Called from syscall or from eBPF program */ -+static int stack_map_peek_elem(struct bpf_map *map, void *value) -+{ -+ return __stack_map_get(map, value, false); -+} -+ -+/* Called from syscall or from eBPF program */ -+static int queue_map_pop_elem(struct bpf_map *map, void *value) -+{ -+ return __queue_map_get(map, value, true); -+} -+ -+/* Called from syscall or from eBPF program */ -+static int stack_map_pop_elem(struct bpf_map *map, void *value) -+{ -+ return __stack_map_get(map, value, true); -+} -+ -+/* Called from syscall or from eBPF program */ -+static int queue_stack_map_push_elem(struct bpf_map *map, void *value, -+ u64 flags) -+{ -+ struct bpf_queue_stack *qs = bpf_queue_stack(map); -+ unsigned long irq_flags; -+ int err = 0; -+ void *dst; -+ -+ /* BPF_EXIST is used to force making room for a new element in case the -+ * map is full -+ */ -+ bool replace = (flags & BPF_EXIST); -+ -+ /* Check supported flags for queue and stack maps */ -+ if (flags & BPF_NOEXIST || flags > BPF_EXIST) -+ return -EINVAL; -+ -+ raw_spin_lock_irqsave(&qs->lock, irq_flags); -+ -+ if (queue_stack_map_is_full(qs)) { -+ if (!replace) { -+ err = -E2BIG; -+ goto out; -+ } -+ /* advance tail pointer to overwrite oldest element */ -+ if (unlikely(++qs->tail >= qs->size)) -+ qs->tail = 0; -+ } -+ -+ dst = &qs->elements[qs->head * qs->map.value_size]; -+ memcpy(dst, value, qs->map.value_size); -+ -+ if (unlikely(++qs->head >= qs->size)) -+ qs->head = 0; -+ -+out: -+ raw_spin_unlock_irqrestore(&qs->lock, irq_flags); -+ return err; -+} -+ -+/* Called from syscall or from eBPF program */ -+static void *queue_stack_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ return NULL; -+} -+ -+/* Called from syscall or from eBPF program */ -+static int queue_stack_map_update_elem(struct bpf_map *map, void *key, -+ void *value, u64 flags) -+{ -+ return -EINVAL; -+} -+ -+/* Called from syscall or from eBPF program */ -+static int queue_stack_map_delete_elem(struct bpf_map *map, void *key) -+{ -+ return -EINVAL; -+} -+ -+/* Called from syscall */ -+static int queue_stack_map_get_next_key(struct bpf_map *map, void *key, -+ void *next_key) -+{ -+ return -EINVAL; -+} -+ -+const struct bpf_map_ops queue_map_ops = { -+ .map_alloc_check = queue_stack_map_alloc_check, -+ .map_alloc = queue_stack_map_alloc, -+ .map_free = queue_stack_map_free, -+ .map_lookup_elem = queue_stack_map_lookup_elem, -+ .map_update_elem = queue_stack_map_update_elem, -+ .map_delete_elem = queue_stack_map_delete_elem, -+ .map_push_elem = queue_stack_map_push_elem, -+ .map_pop_elem = queue_map_pop_elem, -+ .map_peek_elem = queue_map_peek_elem, -+ .map_get_next_key = queue_stack_map_get_next_key, -+}; -+ -+const struct bpf_map_ops stack_map_ops = { -+ .map_alloc_check = queue_stack_map_alloc_check, -+ .map_alloc = queue_stack_map_alloc, -+ .map_free = queue_stack_map_free, -+ .map_lookup_elem = queue_stack_map_lookup_elem, -+ .map_update_elem = queue_stack_map_update_elem, -+ .map_delete_elem = queue_stack_map_delete_elem, -+ .map_push_elem = queue_stack_map_push_elem, -+ .map_pop_elem = stack_map_pop_elem, -+ .map_peek_elem = stack_map_peek_elem, -+ .map_get_next_key = queue_stack_map_get_next_key, -+}; ---- /dev/null -+++ b/kernel/bpf/stackmap.c -@@ -0,0 +1,634 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* Copyright (c) 2016 Facebook -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "percpu_freelist.h" -+ -+#define STACK_CREATE_FLAG_MASK \ -+ (BPF_F_NUMA_NODE | BPF_F_RDONLY | BPF_F_WRONLY | \ -+ BPF_F_STACK_BUILD_ID) -+ -+struct stack_map_bucket { -+ struct pcpu_freelist_node fnode; -+ u32 hash; -+ u32 nr; -+ u64 data[]; -+}; -+ -+struct bpf_stack_map { -+ struct bpf_map map; -+ void *elems; -+ struct pcpu_freelist freelist; -+ u32 n_buckets; -+ struct stack_map_bucket *buckets[]; -+}; -+ -+/* irq_work to run up_read() for build_id lookup in nmi context */ -+struct stack_map_irq_work { -+ struct irq_work irq_work; -+ struct rw_semaphore *sem; -+}; -+ -+static void do_up_read(struct irq_work *entry) -+{ -+ struct stack_map_irq_work *work; -+ -+ work = container_of(entry, struct stack_map_irq_work, irq_work); -+ up_read_non_owner(work->sem); -+ work->sem = NULL; -+} -+ -+static DEFINE_PER_CPU(struct stack_map_irq_work, up_read_work); -+ -+static inline bool stack_map_use_build_id(struct bpf_map *map) -+{ -+ return (map->map_flags & BPF_F_STACK_BUILD_ID); -+} -+ -+static inline int stack_map_data_size(struct bpf_map *map) -+{ -+ return stack_map_use_build_id(map) ? -+ sizeof(struct bpf_stack_build_id) : sizeof(u64); -+} -+ -+static int prealloc_elems_and_freelist(struct bpf_stack_map *smap) -+{ -+ u32 elem_size = sizeof(struct stack_map_bucket) + smap->map.value_size; -+ int err; -+ -+ smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries, -+ smap->map.numa_node); -+ if (!smap->elems) -+ return -ENOMEM; -+ -+ err = pcpu_freelist_init(&smap->freelist); -+ if (err) -+ goto free_elems; -+ -+ pcpu_freelist_populate(&smap->freelist, smap->elems, elem_size, -+ smap->map.max_entries); -+ return 0; -+ -+free_elems: -+ bpf_map_area_free(smap->elems); -+ return err; -+} -+ -+/* Called from syscall */ -+static struct bpf_map *stack_map_alloc(union bpf_attr *attr) -+{ -+ u32 value_size = attr->value_size; -+ struct bpf_stack_map *smap; -+ struct bpf_map_memory mem; -+ u64 cost, n_buckets; -+ int err; -+ -+ if (!capable(CAP_SYS_ADMIN)) -+ return ERR_PTR(-EPERM); -+ -+ if (attr->map_flags & ~STACK_CREATE_FLAG_MASK) -+ return ERR_PTR(-EINVAL); -+ -+ /* check sanity of attributes */ -+ if (attr->max_entries == 0 || attr->key_size != 4 || -+ value_size < 8 || value_size % 8) -+ return ERR_PTR(-EINVAL); -+ -+ BUILD_BUG_ON(sizeof(struct bpf_stack_build_id) % sizeof(u64)); -+ if (attr->map_flags & BPF_F_STACK_BUILD_ID) { -+ if (value_size % sizeof(struct bpf_stack_build_id) || -+ value_size / sizeof(struct bpf_stack_build_id) -+ > sysctl_perf_event_max_stack) -+ return ERR_PTR(-EINVAL); -+ } else if (value_size / 8 > sysctl_perf_event_max_stack) -+ return ERR_PTR(-EINVAL); -+ -+ /* hash table size must be power of 2 */ -+ n_buckets = roundup_pow_of_two(attr->max_entries); -+ if (!n_buckets) -+ return ERR_PTR(-E2BIG); -+ -+ cost = n_buckets * sizeof(struct stack_map_bucket *) + sizeof(*smap); -+ cost += n_buckets * (value_size + sizeof(struct stack_map_bucket)); -+ err = bpf_map_charge_init(&mem, cost); -+ if (err) -+ return ERR_PTR(err); -+ -+ smap = bpf_map_area_alloc(cost, bpf_map_attr_numa_node(attr)); -+ if (!smap) { -+ bpf_map_charge_finish(&mem); -+ return ERR_PTR(-ENOMEM); -+ } -+ -+ bpf_map_init_from_attr(&smap->map, attr); -+ smap->map.value_size = value_size; -+ smap->n_buckets = n_buckets; -+ -+ err = get_callchain_buffers(sysctl_perf_event_max_stack); -+ if (err) -+ goto free_charge; -+ -+ err = prealloc_elems_and_freelist(smap); -+ if (err) -+ goto put_buffers; -+ -+ bpf_map_charge_move(&smap->map.memory, &mem); -+ -+ return &smap->map; -+ -+put_buffers: -+ put_callchain_buffers(); -+free_charge: -+ bpf_map_charge_finish(&mem); -+ bpf_map_area_free(smap); -+ return ERR_PTR(err); -+} -+ -+#define BPF_BUILD_ID 3 -+/* -+ * Parse build id from the note segment. This logic can be shared between -+ * 32-bit and 64-bit system, because Elf32_Nhdr and Elf64_Nhdr are -+ * identical. -+ */ -+static inline int stack_map_parse_build_id(void *page_addr, -+ unsigned char *build_id, -+ void *note_start, -+ Elf32_Word note_size) -+{ -+ Elf32_Word note_offs = 0, new_offs; -+ -+ /* check for overflow */ -+ if (note_start < page_addr || note_start + note_size < note_start) -+ return -EINVAL; -+ -+ /* only supports note that fits in the first page */ -+ if (note_start + note_size > page_addr + PAGE_SIZE) -+ return -EINVAL; -+ -+ while (note_offs + sizeof(Elf32_Nhdr) < note_size) { -+ Elf32_Nhdr *nhdr = (Elf32_Nhdr *)(note_start + note_offs); -+ -+ if (nhdr->n_type == BPF_BUILD_ID && -+ nhdr->n_namesz == sizeof("GNU") && -+ nhdr->n_descsz > 0 && -+ nhdr->n_descsz <= BPF_BUILD_ID_SIZE) { -+ memcpy(build_id, -+ note_start + note_offs + -+ ALIGN(sizeof("GNU"), 4) + sizeof(Elf32_Nhdr), -+ nhdr->n_descsz); -+ memset(build_id + nhdr->n_descsz, 0, -+ BPF_BUILD_ID_SIZE - nhdr->n_descsz); -+ return 0; -+ } -+ new_offs = note_offs + sizeof(Elf32_Nhdr) + -+ ALIGN(nhdr->n_namesz, 4) + ALIGN(nhdr->n_descsz, 4); -+ if (new_offs <= note_offs) /* overflow */ -+ break; -+ note_offs = new_offs; -+ } -+ return -EINVAL; -+} -+ -+/* Parse build ID from 32-bit ELF */ -+static int stack_map_get_build_id_32(void *page_addr, -+ unsigned char *build_id) -+{ -+ Elf32_Ehdr *ehdr = (Elf32_Ehdr *)page_addr; -+ Elf32_Phdr *phdr; -+ int i; -+ -+ /* only supports phdr that fits in one page */ -+ if (ehdr->e_phnum > -+ (PAGE_SIZE - sizeof(Elf32_Ehdr)) / sizeof(Elf32_Phdr)) -+ return -EINVAL; -+ -+ phdr = (Elf32_Phdr *)(page_addr + sizeof(Elf32_Ehdr)); -+ -+ for (i = 0; i < ehdr->e_phnum; ++i) -+ if (phdr[i].p_type == PT_NOTE) -+ return stack_map_parse_build_id(page_addr, build_id, -+ page_addr + phdr[i].p_offset, -+ phdr[i].p_filesz); -+ return -EINVAL; -+} -+ -+/* Parse build ID from 64-bit ELF */ -+static int stack_map_get_build_id_64(void *page_addr, -+ unsigned char *build_id) -+{ -+ Elf64_Ehdr *ehdr = (Elf64_Ehdr *)page_addr; -+ Elf64_Phdr *phdr; -+ int i; -+ -+ /* only supports phdr that fits in one page */ -+ if (ehdr->e_phnum > -+ (PAGE_SIZE - sizeof(Elf64_Ehdr)) / sizeof(Elf64_Phdr)) -+ return -EINVAL; -+ -+ phdr = (Elf64_Phdr *)(page_addr + sizeof(Elf64_Ehdr)); -+ -+ for (i = 0; i < ehdr->e_phnum; ++i) -+ if (phdr[i].p_type == PT_NOTE) -+ return stack_map_parse_build_id(page_addr, build_id, -+ page_addr + phdr[i].p_offset, -+ phdr[i].p_filesz); -+ return -EINVAL; -+} -+ -+/* Parse build ID of ELF file mapped to vma */ -+static int stack_map_get_build_id(struct vm_area_struct *vma, -+ unsigned char *build_id) -+{ -+ Elf32_Ehdr *ehdr; -+ struct page *page; -+ void *page_addr; -+ int ret; -+ -+ /* only works for page backed storage */ -+ if (!vma->vm_file) -+ return -EINVAL; -+ -+ page = find_get_page(vma->vm_file->f_mapping, 0); -+ if (!page) -+ return -EFAULT; /* page not mapped */ -+ -+ ret = -EINVAL; -+ page_addr = kmap_atomic(page); -+ ehdr = (Elf32_Ehdr *)page_addr; -+ -+ /* compare magic x7f "ELF" */ -+ if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) != 0) -+ goto out; -+ -+ /* only support executable file and shared object file */ -+ if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN) -+ goto out; -+ -+ if (ehdr->e_ident[EI_CLASS] == ELFCLASS32) -+ ret = stack_map_get_build_id_32(page_addr, build_id); -+ else if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) -+ ret = stack_map_get_build_id_64(page_addr, build_id); -+out: -+ kunmap_atomic(page_addr); -+ put_page(page); -+ return ret; -+} -+ -+static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs, -+ u64 *ips, u32 trace_nr, bool user) -+{ -+ int i; -+ struct vm_area_struct *vma; -+ bool irq_work_busy = false; -+ struct stack_map_irq_work *work = NULL; -+ -+ if (irqs_disabled()) { -+ work = this_cpu_ptr(&up_read_work); -+ if (work->irq_work.flags & IRQ_WORK_BUSY) -+ /* cannot queue more up_read, fallback */ -+ irq_work_busy = true; -+ } -+ -+ /* -+ * We cannot do up_read() when the irq is disabled, because of -+ * risk to deadlock with rq_lock. To do build_id lookup when the -+ * irqs are disabled, we need to run up_read() in irq_work. We use -+ * a percpu variable to do the irq_work. If the irq_work is -+ * already used by another lookup, we fall back to report ips. -+ * -+ * Same fallback is used for kernel stack (!user) on a stackmap -+ * with build_id. -+ */ -+ if (!user || !current || !current->mm || irq_work_busy || -+ down_read_trylock(¤t->mm->mmap_sem) == 0) { -+ /* cannot access current->mm, fall back to ips */ -+ for (i = 0; i < trace_nr; i++) { -+ id_offs[i].status = BPF_STACK_BUILD_ID_IP; -+ id_offs[i].ip = ips[i]; -+ memset(id_offs[i].build_id, 0, BPF_BUILD_ID_SIZE); -+ } -+ return; -+ } -+ -+ for (i = 0; i < trace_nr; i++) { -+ vma = find_vma(current->mm, ips[i]); -+ if (!vma || stack_map_get_build_id(vma, id_offs[i].build_id)) { -+ /* per entry fall back to ips */ -+ id_offs[i].status = BPF_STACK_BUILD_ID_IP; -+ id_offs[i].ip = ips[i]; -+ memset(id_offs[i].build_id, 0, BPF_BUILD_ID_SIZE); -+ continue; -+ } -+ id_offs[i].offset = (vma->vm_pgoff << PAGE_SHIFT) + ips[i] -+ - vma->vm_start; -+ id_offs[i].status = BPF_STACK_BUILD_ID_VALID; -+ } -+ -+ if (!work) { -+ up_read(¤t->mm->mmap_sem); -+ } else { -+ work->sem = ¤t->mm->mmap_sem; -+ irq_work_queue(&work->irq_work); -+ /* -+ * The irq_work will release the mmap_sem with -+ * up_read_non_owner(). The rwsem_release() is called -+ * here to release the lock from lockdep's perspective. -+ */ -+ rwsem_release(¤t->mm->mmap_sem.dep_map, 1, _RET_IP_); -+ } -+} -+ -+BPF_CALL_3(bpf_get_stackid, struct pt_regs *, regs, struct bpf_map *, map, -+ u64, flags) -+{ -+ struct bpf_stack_map *smap = container_of(map, struct bpf_stack_map, map); -+ struct perf_callchain_entry *trace; -+ struct stack_map_bucket *bucket, *new_bucket, *old_bucket; -+ u32 max_depth = map->value_size / stack_map_data_size(map); -+ /* stack_map_alloc() checks that max_depth <= sysctl_perf_event_max_stack */ -+ u32 init_nr = sysctl_perf_event_max_stack - max_depth; -+ u32 skip = flags & BPF_F_SKIP_FIELD_MASK; -+ u32 hash, id, trace_nr, trace_len; -+ bool user = flags & BPF_F_USER_STACK; -+ bool kernel = !user; -+ u64 *ips; -+ bool hash_matches; -+ -+ if (unlikely(flags & ~(BPF_F_SKIP_FIELD_MASK | BPF_F_USER_STACK | -+ BPF_F_FAST_STACK_CMP | BPF_F_REUSE_STACKID))) -+ return -EINVAL; -+ -+ trace = get_perf_callchain(regs, init_nr, kernel, user, -+ sysctl_perf_event_max_stack, false, false); -+ -+ if (unlikely(!trace)) -+ /* couldn't fetch the stack trace */ -+ return -EFAULT; -+ -+ /* get_perf_callchain() guarantees that trace->nr >= init_nr -+ * and trace-nr <= sysctl_perf_event_max_stack, so trace_nr <= max_depth -+ */ -+ trace_nr = trace->nr - init_nr; -+ -+ if (trace_nr <= skip) -+ /* skipping more than usable stack trace */ -+ return -EFAULT; -+ -+ trace_nr -= skip; -+ trace_len = trace_nr * sizeof(u64); -+ ips = trace->ip + skip + init_nr; -+ hash = jhash2((u32 *)ips, trace_len / sizeof(u32), 0); -+ id = hash & (smap->n_buckets - 1); -+ bucket = READ_ONCE(smap->buckets[id]); -+ -+ hash_matches = bucket && bucket->hash == hash; -+ /* fast cmp */ -+ if (hash_matches && flags & BPF_F_FAST_STACK_CMP) -+ return id; -+ -+ if (stack_map_use_build_id(map)) { -+ /* for build_id+offset, pop a bucket before slow cmp */ -+ new_bucket = (struct stack_map_bucket *) -+ pcpu_freelist_pop(&smap->freelist); -+ if (unlikely(!new_bucket)) -+ return -ENOMEM; -+ new_bucket->nr = trace_nr; -+ stack_map_get_build_id_offset( -+ (struct bpf_stack_build_id *)new_bucket->data, -+ ips, trace_nr, user); -+ trace_len = trace_nr * sizeof(struct bpf_stack_build_id); -+ if (hash_matches && bucket->nr == trace_nr && -+ memcmp(bucket->data, new_bucket->data, trace_len) == 0) { -+ pcpu_freelist_push(&smap->freelist, &new_bucket->fnode); -+ return id; -+ } -+ if (bucket && !(flags & BPF_F_REUSE_STACKID)) { -+ pcpu_freelist_push(&smap->freelist, &new_bucket->fnode); -+ return -EEXIST; -+ } -+ } else { -+ if (hash_matches && bucket->nr == trace_nr && -+ memcmp(bucket->data, ips, trace_len) == 0) -+ return id; -+ if (bucket && !(flags & BPF_F_REUSE_STACKID)) -+ return -EEXIST; -+ -+ new_bucket = (struct stack_map_bucket *) -+ pcpu_freelist_pop(&smap->freelist); -+ if (unlikely(!new_bucket)) -+ return -ENOMEM; -+ memcpy(new_bucket->data, ips, trace_len); -+ } -+ -+ new_bucket->hash = hash; -+ new_bucket->nr = trace_nr; -+ -+ old_bucket = xchg(&smap->buckets[id], new_bucket); -+ if (old_bucket) -+ pcpu_freelist_push(&smap->freelist, &old_bucket->fnode); -+ return id; -+} -+ -+const struct bpf_func_proto bpf_get_stackid_proto = { -+ .func = bpf_get_stackid, -+ .gpl_only = true, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_CONST_MAP_PTR, -+ .arg3_type = ARG_ANYTHING, -+}; -+ -+BPF_CALL_4(bpf_get_stack, struct pt_regs *, regs, void *, buf, u32, size, -+ u64, flags) -+{ -+ u32 init_nr, trace_nr, copy_len, elem_size, num_elem; -+ bool user_build_id = flags & BPF_F_USER_BUILD_ID; -+ u32 skip = flags & BPF_F_SKIP_FIELD_MASK; -+ bool user = flags & BPF_F_USER_STACK; -+ struct perf_callchain_entry *trace; -+ bool kernel = !user; -+ int err = -EINVAL; -+ u64 *ips; -+ -+ if (unlikely(flags & ~(BPF_F_SKIP_FIELD_MASK | BPF_F_USER_STACK | -+ BPF_F_USER_BUILD_ID))) -+ goto clear; -+ if (kernel && user_build_id) -+ goto clear; -+ -+ elem_size = (user && user_build_id) ? sizeof(struct bpf_stack_build_id) -+ : sizeof(u64); -+ if (unlikely(size % elem_size)) -+ goto clear; -+ -+ num_elem = size / elem_size; -+ if (sysctl_perf_event_max_stack < num_elem) -+ init_nr = 0; -+ else -+ init_nr = sysctl_perf_event_max_stack - num_elem; -+ trace = get_perf_callchain(regs, init_nr, kernel, user, -+ sysctl_perf_event_max_stack, false, false); -+ if (unlikely(!trace)) -+ goto err_fault; -+ -+ trace_nr = trace->nr - init_nr; -+ if (trace_nr < skip) -+ goto err_fault; -+ -+ trace_nr -= skip; -+ trace_nr = (trace_nr <= num_elem) ? trace_nr : num_elem; -+ copy_len = trace_nr * elem_size; -+ ips = trace->ip + skip + init_nr; -+ if (user && user_build_id) -+ stack_map_get_build_id_offset(buf, ips, trace_nr, user); -+ else -+ memcpy(buf, ips, copy_len); -+ -+ if (size > copy_len) -+ memset(buf + copy_len, 0, size - copy_len); -+ return copy_len; -+ -+err_fault: -+ err = -EFAULT; -+clear: -+ memset(buf, 0, size); -+ return err; -+} -+ -+const struct bpf_func_proto bpf_get_stack_proto = { -+ .func = bpf_get_stack, -+ .gpl_only = true, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_PTR_TO_UNINIT_MEM, -+ .arg3_type = ARG_CONST_SIZE_OR_ZERO, -+ .arg4_type = ARG_ANYTHING, -+}; -+ -+/* Called from eBPF program */ -+static void *stack_map_lookup_elem(struct bpf_map *map, void *key) -+{ -+ return ERR_PTR(-EOPNOTSUPP); -+} -+ -+/* Called from syscall */ -+int bpf_stackmap_copy(struct bpf_map *map, void *key, void *value) -+{ -+ struct bpf_stack_map *smap = container_of(map, struct bpf_stack_map, map); -+ struct stack_map_bucket *bucket, *old_bucket; -+ u32 id = *(u32 *)key, trace_len; -+ -+ if (unlikely(id >= smap->n_buckets)) -+ return -ENOENT; -+ -+ bucket = xchg(&smap->buckets[id], NULL); -+ if (!bucket) -+ return -ENOENT; -+ -+ trace_len = bucket->nr * stack_map_data_size(map); -+ memcpy(value, bucket->data, trace_len); -+ memset(value + trace_len, 0, map->value_size - trace_len); -+ -+ old_bucket = xchg(&smap->buckets[id], bucket); -+ if (old_bucket) -+ pcpu_freelist_push(&smap->freelist, &old_bucket->fnode); -+ return 0; -+} -+ -+static int stack_map_get_next_key(struct bpf_map *map, void *key, -+ void *next_key) -+{ -+ struct bpf_stack_map *smap = container_of(map, -+ struct bpf_stack_map, map); -+ u32 id; -+ -+ WARN_ON_ONCE(!rcu_read_lock_held()); -+ -+ if (!key) { -+ id = 0; -+ } else { -+ id = *(u32 *)key; -+ if (id >= smap->n_buckets || !smap->buckets[id]) -+ id = 0; -+ else -+ id++; -+ } -+ -+ while (id < smap->n_buckets && !smap->buckets[id]) -+ id++; -+ -+ if (id >= smap->n_buckets) -+ return -ENOENT; -+ -+ *(u32 *)next_key = id; -+ return 0; -+} -+ -+static int stack_map_update_elem(struct bpf_map *map, void *key, void *value, -+ u64 map_flags) -+{ -+ return -EINVAL; -+} -+ -+/* Called from syscall or from eBPF program */ -+static int stack_map_delete_elem(struct bpf_map *map, void *key) -+{ -+ struct bpf_stack_map *smap = container_of(map, struct bpf_stack_map, map); -+ struct stack_map_bucket *old_bucket; -+ u32 id = *(u32 *)key; -+ -+ if (unlikely(id >= smap->n_buckets)) -+ return -E2BIG; -+ -+ old_bucket = xchg(&smap->buckets[id], NULL); -+ if (old_bucket) { -+ pcpu_freelist_push(&smap->freelist, &old_bucket->fnode); -+ return 0; -+ } else { -+ return -ENOENT; -+ } -+} -+ -+/* Called when map->refcnt goes to zero, either from workqueue or from syscall */ -+static void stack_map_free(struct bpf_map *map) -+{ -+ struct bpf_stack_map *smap = container_of(map, struct bpf_stack_map, map); -+ -+ /* wait for bpf programs to complete before freeing stack map */ -+ synchronize_rcu(); -+ -+ bpf_map_area_free(smap->elems); -+ pcpu_freelist_destroy(&smap->freelist); -+ bpf_map_area_free(smap); -+ put_callchain_buffers(); -+} -+ -+const struct bpf_map_ops stack_trace_map_ops = { -+ .map_alloc = stack_map_alloc, -+ .map_free = stack_map_free, -+ .map_get_next_key = stack_map_get_next_key, -+ .map_lookup_elem = stack_map_lookup_elem, -+ .map_update_elem = stack_map_update_elem, -+ .map_delete_elem = stack_map_delete_elem, -+ .map_check_btf = map_check_no_btf, -+}; -+ -+static int __init stack_map_init(void) -+{ -+ int cpu; -+ struct stack_map_irq_work *work; -+ -+ for_each_possible_cpu(cpu) { -+ work = per_cpu_ptr(&up_read_work, cpu); -+ init_irq_work(&work->irq_work, do_up_read); -+ } -+ return 0; -+} -+subsys_initcall(stack_map_init); ---- a/kernel/bpf/syscall.c -+++ b/kernel/bpf/syscall.c -@@ -1,106 +1,333 @@ -+// SPDX-License-Identifier: GPL-2.0-only - /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of version 2 of the GNU General Public -- * License as published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, but -- * WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * General Public License for more details. - */ - #include -+#include -+#include - #include - #include -+#include -+#include - #include -+#include - #include -+#include - #include - #include - #include -+#include -+#include -+#include -+#include -+#include -+ -+#define IS_FD_ARRAY(map) ((map)->map_type == BPF_MAP_TYPE_PROG_ARRAY || \ -+ (map)->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY || \ -+ (map)->map_type == BPF_MAP_TYPE_CGROUP_ARRAY || \ -+ (map)->map_type == BPF_MAP_TYPE_ARRAY_OF_MAPS) -+#define IS_FD_HASH(map) ((map)->map_type == BPF_MAP_TYPE_HASH_OF_MAPS) -+#define IS_FD_MAP(map) (IS_FD_ARRAY(map) || IS_FD_HASH(map)) -+ -+#define BPF_OBJ_FLAG_MASK (BPF_F_RDONLY | BPF_F_WRONLY) -+ -+DEFINE_PER_CPU(int, bpf_prog_active); -+static DEFINE_IDR(prog_idr); -+static DEFINE_SPINLOCK(prog_idr_lock); -+static DEFINE_IDR(map_idr); -+static DEFINE_SPINLOCK(map_idr_lock); - - int sysctl_unprivileged_bpf_disabled __read_mostly; - --static LIST_HEAD(bpf_map_types); -+static const struct bpf_map_ops * const bpf_map_types[] = { -+#define BPF_PROG_TYPE(_id, _ops) -+#define BPF_MAP_TYPE(_id, _ops) \ -+ [_id] = &_ops, -+#include -+#undef BPF_PROG_TYPE -+#undef BPF_MAP_TYPE -+}; -+ -+/* -+ * If we're handed a bigger struct than we know of, ensure all the unknown bits -+ * are 0 - i.e. new user-space does not rely on any kernel feature extensions -+ * we don't know about yet. -+ * -+ * There is a ToCToU between this function call and the following -+ * copy_from_user() call. However, this is not a concern since this function is -+ * meant to be a future-proofing of bits. -+ */ -+int bpf_check_uarg_tail_zero(void __user *uaddr, -+ size_t expected_size, -+ size_t actual_size) -+{ -+ unsigned char __user *addr; -+ unsigned char __user *end; -+ unsigned char val; -+ int err; -+ -+ if (unlikely(actual_size > PAGE_SIZE)) /* silly large */ -+ return -E2BIG; -+ -+ if (unlikely(!access_ok(VERIFY_READ, uaddr, actual_size))) -+ return -EFAULT; -+ -+ if (actual_size <= expected_size) -+ return 0; -+ -+ addr = uaddr + expected_size; -+ end = uaddr + actual_size; -+ -+ for (; addr < end; addr++) { -+ err = get_user(val, addr); -+ if (err) -+ return err; -+ if (val) -+ return -E2BIG; -+ } -+ -+ return 0; -+} - - static struct bpf_map *find_and_alloc_map(union bpf_attr *attr) - { -- struct bpf_map_type_list *tl; -+ const struct bpf_map_ops *ops; -+ u32 type = attr->map_type; - struct bpf_map *map; -+ int err; - -- list_for_each_entry(tl, &bpf_map_types, list_node) { -- if (tl->type == attr->map_type) { -- map = tl->ops->map_alloc(attr); -- if (IS_ERR(map)) -- return map; -- map->ops = tl->ops; -- map->map_type = attr->map_type; -- return map; -- } -+ if (type >= ARRAY_SIZE(bpf_map_types)) -+ return ERR_PTR(-EINVAL); -+ ops = bpf_map_types[type]; -+ if (!ops) -+ return ERR_PTR(-EINVAL); -+ -+ if (ops->map_alloc_check) { -+ err = ops->map_alloc_check(attr); -+ if (err) -+ return ERR_PTR(err); -+ } -+ map = ops->map_alloc(attr); -+ if (IS_ERR(map)) -+ return map; -+ map->ops = ops; -+ map->map_type = type; -+ return map; -+} -+ -+void *bpf_map_area_alloc(u64 size, int numa_node) -+{ -+ /* We really just want to fail instead of triggering OOM killer -+ * under memory pressure, therefore we set __GFP_NORETRY to kmalloc, -+ * which is used for lower order allocation requests. -+ * -+ * It has been observed that higher order allocation requests done by -+ * vmalloc with __GFP_NORETRY being set might fail due to not trying -+ * to reclaim memory from the page cache, thus we set -+ * __GFP_RETRY_MAYFAIL to avoid such situations. -+ */ -+ -+ const gfp_t flags = __GFP_NOWARN | __GFP_ZERO; -+ void *area; -+ -+ if (size >= SIZE_MAX) -+ return NULL; -+ -+ if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) { -+ area = kmalloc_node(size, GFP_USER | __GFP_NORETRY | flags, -+ numa_node); -+ if (area != NULL) -+ return area; - } -- return ERR_PTR(-EINVAL); -+ -+ return __vmalloc_node_range(size, 1, -+ VMALLOC_START, VMALLOC_END, -+ GFP_KERNEL | flags, -+ PAGE_KERNEL, 0, numa_node, -+ __builtin_return_address(0)); - } - --/* boot time registration of different map implementations */ --void bpf_register_map_type(struct bpf_map_type_list *tl) -+void bpf_map_area_free(void *area) - { -- list_add(&tl->list_node, &bpf_map_types); -+ kvfree(area); - } - --static int bpf_map_charge_memlock(struct bpf_map *map) -+static u32 bpf_map_flags_retain_permanent(u32 flags) - { -- struct user_struct *user = get_current_user(); -- unsigned long memlock_limit; -+ /* Some map creation flags are not tied to the map object but -+ * rather to the map fd instead, so they have no meaning upon -+ * map object inspection since multiple file descriptors with -+ * different (access) properties can exist here. Thus, given -+ * this has zero meaning for the map itself, lets clear these -+ * from here. -+ */ -+ return flags & ~(BPF_F_RDONLY | BPF_F_WRONLY); -+} -+ -+void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr) -+{ -+ map->map_type = attr->map_type; -+ map->key_size = attr->key_size; -+ map->value_size = attr->value_size; -+ map->max_entries = attr->max_entries; -+ map->map_flags = bpf_map_flags_retain_permanent(attr->map_flags); -+ map->numa_node = bpf_map_attr_numa_node(attr); -+} -+ -+static int bpf_charge_memlock(struct user_struct *user, u32 pages) -+{ -+ unsigned long memlock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; -+ -+ if (atomic_long_add_return(pages, &user->locked_vm) > memlock_limit) { -+ atomic_long_sub(pages, &user->locked_vm); -+ return -EPERM; -+ } -+ return 0; -+} -+ -+static void bpf_uncharge_memlock(struct user_struct *user, u32 pages) -+{ -+ if (user) -+ atomic_long_sub(pages, &user->locked_vm); -+} - -- memlock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; -+int bpf_map_charge_init(struct bpf_map_memory *mem, u64 size) -+{ -+ u32 pages = round_up(size, PAGE_SIZE) >> PAGE_SHIFT; -+ struct user_struct *user; -+ int ret; - -- atomic_long_add(map->pages, &user->locked_vm); -+ if (size >= U32_MAX - PAGE_SIZE) -+ return -E2BIG; - -- if (atomic_long_read(&user->locked_vm) > memlock_limit) { -- atomic_long_sub(map->pages, &user->locked_vm); -+ user = get_current_user(); -+ ret = bpf_charge_memlock(user, pages); -+ if (ret) { - free_uid(user); -- return -EPERM; -+ return ret; - } -- map->user = user; -+ -+ mem->pages = pages; -+ mem->user = user; -+ - return 0; - } - --static void bpf_map_uncharge_memlock(struct bpf_map *map) -+void bpf_map_charge_finish(struct bpf_map_memory *mem) - { -- struct user_struct *user = map->user; -+ bpf_uncharge_memlock(mem->user, mem->pages); -+ free_uid(mem->user); -+} - -- atomic_long_sub(map->pages, &user->locked_vm); -- free_uid(user); -+void bpf_map_charge_move(struct bpf_map_memory *dst, -+ struct bpf_map_memory *src) -+{ -+ *dst = *src; -+ -+ /* Make sure src will not be used for the redundant uncharging. */ -+ memset(src, 0, sizeof(struct bpf_map_memory)); -+} -+ -+int bpf_map_charge_memlock(struct bpf_map *map, u32 pages) -+{ -+ int ret; -+ -+ ret = bpf_charge_memlock(map->memory.user, pages); -+ if (ret) -+ return ret; -+ map->memory.pages += pages; -+ return ret; -+} -+ -+void bpf_map_uncharge_memlock(struct bpf_map *map, u32 pages) -+{ -+ bpf_uncharge_memlock(map->memory.user, pages); -+ map->memory.pages -= pages; -+} -+ -+static int bpf_map_alloc_id(struct bpf_map *map) -+{ -+ int id; -+ -+ idr_preload(GFP_KERNEL); -+ spin_lock_bh(&map_idr_lock); -+ id = idr_alloc_cyclic(&map_idr, map, 1, INT_MAX, GFP_ATOMIC); -+ if (id > 0) -+ map->id = id; -+ spin_unlock_bh(&map_idr_lock); -+ idr_preload_end(); -+ -+ if (WARN_ON_ONCE(!id)) -+ return -ENOSPC; -+ -+ return id > 0 ? 0 : id; -+} -+ -+void bpf_map_free_id(struct bpf_map *map, bool do_idr_lock) -+{ -+ unsigned long flags; -+ -+ /* Offloaded maps are removed from the IDR store when their device -+ * disappears - even if someone holds an fd to them they are unusable, -+ * the memory is gone, all ops will fail; they are simply waiting for -+ * refcnt to drop to be freed. -+ */ -+ if (!map->id) -+ return; -+ -+ if (do_idr_lock) -+ spin_lock_irqsave(&map_idr_lock, flags); -+ else -+ __acquire(&map_idr_lock); -+ -+ idr_remove(&map_idr, map->id); -+ map->id = 0; -+ -+ if (do_idr_lock) -+ spin_unlock_irqrestore(&map_idr_lock, flags); -+ else -+ __release(&map_idr_lock); - } - - /* called from workqueue */ - static void bpf_map_free_deferred(struct work_struct *work) - { - struct bpf_map *map = container_of(work, struct bpf_map, work); -+ struct bpf_map_memory mem; - -- bpf_map_uncharge_memlock(map); -+ bpf_map_charge_move(&mem, &map->memory); - /* implementation dependent freeing */ - map->ops->map_free(map); -+ bpf_map_charge_finish(&mem); - } - - static void bpf_map_put_uref(struct bpf_map *map) - { - if (atomic_dec_and_test(&map->usercnt)) { -- if (map->map_type == BPF_MAP_TYPE_PROG_ARRAY) -- bpf_fd_array_map_clear(map); -+ if (map->ops->map_release_uref) -+ map->ops->map_release_uref(map); - } - } - - /* decrement map refcnt and schedule it for freeing via workqueue - * (unrelying map implementation ops->map_free() might sleep) - */ --void bpf_map_put(struct bpf_map *map) -+static void __bpf_map_put(struct bpf_map *map, bool do_idr_lock) - { - if (atomic_dec_and_test(&map->refcnt)) { -+ /* bpf_map_free_id() must be called first */ -+ bpf_map_free_id(map, do_idr_lock); -+ btf_put(map->btf); - INIT_WORK(&map->work, bpf_map_free_deferred); - schedule_work(&map->work); - } - } - -+void bpf_map_put(struct bpf_map *map) -+{ -+ __bpf_map_put(map, true); -+} -+EXPORT_SYMBOL_GPL(bpf_map_put); -+ - void bpf_map_put_with_uref(struct bpf_map *map) - { - bpf_map_put_uref(map); -@@ -109,18 +336,110 @@ void bpf_map_put_with_uref(struct bpf_ma - - static int bpf_map_release(struct inode *inode, struct file *filp) - { -- bpf_map_put_with_uref(filp->private_data); -+ struct bpf_map *map = filp->private_data; -+ -+ if (map->ops->map_release) -+ map->ops->map_release(map, filp); -+ -+ bpf_map_put_with_uref(map); - return 0; - } - --static const struct file_operations bpf_map_fops = { -- .release = bpf_map_release, -+static fmode_t map_get_sys_perms(struct bpf_map *map, struct fd f) -+{ -+ fmode_t mode = f.file->f_mode; -+ -+ /* Our file permissions may have been overridden by global -+ * map permissions facing syscall side. -+ */ -+ if (READ_ONCE(map->frozen)) -+ mode &= ~FMODE_CAN_WRITE; -+ return mode; -+} -+ -+#ifdef CONFIG_PROC_FS -+static void bpf_map_show_fdinfo(struct seq_file *m, struct file *filp) -+{ -+ const struct bpf_map *map = filp->private_data; -+ const struct bpf_array *array; -+ u32 owner_prog_type = 0; -+ u32 owner_jited = 0; -+ -+ if (map->map_type == BPF_MAP_TYPE_PROG_ARRAY) { -+ array = container_of(map, struct bpf_array, map); -+ owner_prog_type = array->owner_prog_type; -+ owner_jited = array->owner_jited; -+ } -+ -+ seq_printf(m, -+ "map_type:\t%u\n" -+ "key_size:\t%u\n" -+ "value_size:\t%u\n" -+ "max_entries:\t%u\n" -+ "map_flags:\t%#x\n" -+ "memlock:\t%llu\n" -+ "map_id:\t%u\n" -+ "frozen:\t%u\n", -+ map->map_type, -+ map->key_size, -+ map->value_size, -+ map->max_entries, -+ map->map_flags, -+ map->memory.pages * 1ULL << PAGE_SHIFT, -+ map->id, -+ READ_ONCE(map->frozen)); -+ -+ if (owner_prog_type) { -+ seq_printf(m, "owner_prog_type:\t%u\n", -+ owner_prog_type); -+ seq_printf(m, "owner_jited:\t%u\n", -+ owner_jited); -+ } -+} -+#endif -+ -+static ssize_t bpf_dummy_read(struct file *filp, char __user *buf, size_t siz, -+ loff_t *ppos) -+{ -+ /* We need this handler such that alloc_file() enables -+ * f_mode with FMODE_CAN_READ. -+ */ -+ return -EINVAL; -+} -+ -+static ssize_t bpf_dummy_write(struct file *filp, const char __user *buf, -+ size_t siz, loff_t *ppos) -+{ -+ /* We need this handler such that alloc_file() enables -+ * f_mode with FMODE_CAN_WRITE. -+ */ -+ return -EINVAL; -+} -+ -+const struct file_operations bpf_map_fops = { -+#ifdef CONFIG_PROC_FS -+ .show_fdinfo = bpf_map_show_fdinfo, -+#endif -+ .release = bpf_map_release, -+ .read = bpf_dummy_read, -+ .write = bpf_dummy_write, - }; - --int bpf_map_new_fd(struct bpf_map *map) -+int bpf_map_new_fd(struct bpf_map *map, int flags) - { - return anon_inode_getfd("bpf-map", &bpf_map_fops, map, -- O_RDWR | O_CLOEXEC); -+ flags | O_CLOEXEC); -+} -+ -+int bpf_get_file_flag(int flags) -+{ -+ if ((flags & BPF_F_RDONLY) && (flags & BPF_F_WRONLY)) -+ return -EINVAL; -+ if (flags & BPF_F_RDONLY) -+ return O_RDONLY; -+ if (flags & BPF_F_WRONLY) -+ return O_WRONLY; -+ return O_RDWR; - } - - /* helper macro to check that unused fields 'union bpf_attr' are zero */ -@@ -131,38 +450,171 @@ int bpf_map_new_fd(struct bpf_map *map) - offsetof(union bpf_attr, CMD##_LAST_FIELD) - \ - sizeof(attr->CMD##_LAST_FIELD)) != NULL - --#define BPF_MAP_CREATE_LAST_FIELD max_entries -+/* dst and src must have at least BPF_OBJ_NAME_LEN number of bytes. -+ * Return 0 on success and < 0 on error. -+ */ -+static int bpf_obj_name_cpy(char *dst, const char *src) -+{ -+ const char *end = src + BPF_OBJ_NAME_LEN; -+ -+ memset(dst, 0, BPF_OBJ_NAME_LEN); -+ /* Copy all isalnum(), '_' and '.' chars. */ -+ while (src < end && *src) { -+ if (!isalnum(*src) && -+ *src != '_' && *src != '.') -+ return -EINVAL; -+ *dst++ = *src++; -+ } -+ -+ /* No '\0' found in BPF_OBJ_NAME_LEN number of bytes */ -+ if (src == end) -+ return -EINVAL; -+ -+ return 0; -+} -+ -+int map_check_no_btf(const struct bpf_map *map, -+ const struct btf *btf, -+ const struct btf_type *key_type, -+ const struct btf_type *value_type) -+{ -+ return -ENOTSUPP; -+} -+ -+static int map_check_btf(struct bpf_map *map, const struct btf *btf, -+ u32 btf_key_id, u32 btf_value_id) -+{ -+ const struct btf_type *key_type, *value_type; -+ u32 key_size, value_size; -+ int ret = 0; -+ -+ /* Some maps allow key to be unspecified. */ -+ if (btf_key_id) { -+ key_type = btf_type_id_size(btf, &btf_key_id, &key_size); -+ if (!key_type || key_size != map->key_size) -+ return -EINVAL; -+ } else { -+ key_type = btf_type_by_id(btf, 0); -+ if (!map->ops->map_check_btf) -+ return -EINVAL; -+ } -+ -+ value_type = btf_type_id_size(btf, &btf_value_id, &value_size); -+ if (!value_type || value_size != map->value_size) -+ return -EINVAL; -+ -+ map->spin_lock_off = btf_find_spin_lock(btf, value_type); -+ -+ if (map_value_has_spin_lock(map)) { -+ if (map->map_flags & BPF_F_RDONLY_PROG) -+ return -EACCES; -+ if (map->map_type != BPF_MAP_TYPE_HASH && -+ map->map_type != BPF_MAP_TYPE_ARRAY && -+ map->map_type != BPF_MAP_TYPE_CGROUP_STORAGE && -+ map->map_type != BPF_MAP_TYPE_SK_STORAGE) -+ return -ENOTSUPP; -+ if (map->spin_lock_off + sizeof(struct bpf_spin_lock) > -+ map->value_size) { -+ WARN_ONCE(1, -+ "verifier bug spin_lock_off %d value_size %d\n", -+ map->spin_lock_off, map->value_size); -+ return -EFAULT; -+ } -+ } -+ -+ if (map->ops->map_check_btf) -+ ret = map->ops->map_check_btf(map, btf, key_type, value_type); -+ -+ return ret; -+} -+ -+#define BPF_MAP_CREATE_LAST_FIELD btf_value_type_id - /* called via syscall */ - static int map_create(union bpf_attr *attr) - { -+ int numa_node = bpf_map_attr_numa_node(attr); -+ struct bpf_map_memory mem; - struct bpf_map *map; -+ int f_flags; - int err; - - err = CHECK_ATTR(BPF_MAP_CREATE); - if (err) - return -EINVAL; - -+ f_flags = bpf_get_file_flag(attr->map_flags); -+ if (f_flags < 0) -+ return f_flags; -+ -+ if (numa_node != NUMA_NO_NODE && -+ ((unsigned int)numa_node >= nr_node_ids || -+ !node_online(numa_node))) -+ return -EINVAL; -+ - /* find map type and init map: hashtable vs rbtree vs bloom vs ... */ - map = find_and_alloc_map(attr); - if (IS_ERR(map)) - return PTR_ERR(map); - -+ err = bpf_obj_name_cpy(map->name, attr->map_name); -+ if (err) -+ goto free_map; -+ - atomic_set(&map->refcnt, 1); - atomic_set(&map->usercnt, 1); - -- err = bpf_map_charge_memlock(map); -+ if (attr->btf_key_type_id || attr->btf_value_type_id) { -+ struct btf *btf; -+ -+ if (!attr->btf_value_type_id) { -+ err = -EINVAL; -+ goto free_map; -+ } -+ -+ btf = btf_get_by_fd(attr->btf_fd); -+ if (IS_ERR(btf)) { -+ err = PTR_ERR(btf); -+ goto free_map; -+ } -+ -+ err = map_check_btf(map, btf, attr->btf_key_type_id, -+ attr->btf_value_type_id); -+ if (err) { -+ btf_put(btf); -+ goto free_map; -+ } -+ -+ map->btf = btf; -+ map->btf_key_type_id = attr->btf_key_type_id; -+ map->btf_value_type_id = attr->btf_value_type_id; -+ } else { -+ map->spin_lock_off = -EINVAL; -+ } -+ -+ err = bpf_map_alloc_id(map); - if (err) -- goto free_map; -+ goto free_map_sec; - -- err = bpf_map_new_fd(map); -- if (err < 0) -- /* failed to allocate fd */ -- goto free_map; -+ err = bpf_map_new_fd(map, f_flags); -+ if (err < 0) { -+ /* failed to allocate fd. -+ * bpf_map_put_with_uref() is needed because the above -+ * bpf_map_alloc_id() has published the map -+ * to the userspace and the userspace may -+ * have refcnt-ed it through BPF_MAP_GET_FD_BY_ID. -+ */ -+ bpf_map_put_with_uref(map); -+ return err; -+ } - - return err; - -+free_map_sec: - free_map: -+ btf_put(map->btf); -+ bpf_map_charge_move(&mem, &map->memory); - map->ops->map_free(map); -+ bpf_map_charge_finish(&mem); - return err; - } - -@@ -194,6 +646,7 @@ struct bpf_map *bpf_map_inc(struct bpf_m - atomic_inc(&map->usercnt); - return map; - } -+EXPORT_SYMBOL_GPL(bpf_map_inc); - - struct bpf_map *bpf_map_get_with_uref(u32 ufd) - { -@@ -210,59 +663,155 @@ struct bpf_map *bpf_map_get_with_uref(u3 - return map; - } - --/* helper to convert user pointers passed inside __aligned_u64 fields */ --static void __user *u64_to_ptr(__u64 val) -+/* map_idr_lock should have been held */ -+static struct bpf_map *__bpf_map_inc_not_zero(struct bpf_map *map, -+ bool uref) -+{ -+ int refold; -+ -+ refold = atomic_fetch_add_unless(&map->refcnt, 1, 0); -+ -+ if (refold >= BPF_MAX_REFCNT) { -+ __bpf_map_put(map, false); -+ return ERR_PTR(-EBUSY); -+ } -+ -+ if (!refold) -+ return ERR_PTR(-ENOENT); -+ -+ if (uref) -+ atomic_inc(&map->usercnt); -+ -+ return map; -+} -+ -+struct bpf_map *bpf_map_inc_not_zero(struct bpf_map *map, bool uref) -+{ -+ spin_lock_bh(&map_idr_lock); -+ map = __bpf_map_inc_not_zero(map, uref); -+ spin_unlock_bh(&map_idr_lock); -+ -+ return map; -+} -+EXPORT_SYMBOL_GPL(bpf_map_inc_not_zero); -+ -+int __weak bpf_stackmap_copy(struct bpf_map *map, void *key, void *value) -+{ -+ return -ENOTSUPP; -+} -+ -+static void *__bpf_copy_key(void __user *ukey, u64 key_size) - { -- return (void __user *) (unsigned long) val; -+ if (key_size) -+ return memdup_user(ukey, key_size); -+ -+ if (ukey) -+ return ERR_PTR(-EINVAL); -+ -+ return NULL; - } - - /* last field in 'union bpf_attr' used by this command */ --#define BPF_MAP_LOOKUP_ELEM_LAST_FIELD value -+#define BPF_MAP_LOOKUP_ELEM_LAST_FIELD flags - - static int map_lookup_elem(union bpf_attr *attr) - { -- void __user *ukey = u64_to_ptr(attr->key); -- void __user *uvalue = u64_to_ptr(attr->value); -+ void __user *ukey = u64_to_user_ptr(attr->key); -+ void __user *uvalue = u64_to_user_ptr(attr->value); - int ufd = attr->map_fd; - struct bpf_map *map; - void *key, *value, *ptr; -+ u32 value_size; - struct fd f; - int err; - - if (CHECK_ATTR(BPF_MAP_LOOKUP_ELEM)) - return -EINVAL; - -+ if (attr->flags & ~BPF_F_LOCK) -+ return -EINVAL; -+ - f = fdget(ufd); - map = __bpf_map_get(f); - if (IS_ERR(map)) - return PTR_ERR(map); -+ if (!(map_get_sys_perms(map, f) & FMODE_CAN_READ)) { -+ err = -EPERM; -+ goto err_put; -+ } - -- err = -ENOMEM; -- key = kmalloc(map->key_size, GFP_USER); -- if (!key) -+ if ((attr->flags & BPF_F_LOCK) && -+ !map_value_has_spin_lock(map)) { -+ err = -EINVAL; - goto err_put; -+ } - -- err = -EFAULT; -- if (copy_from_user(key, ukey, map->key_size) != 0) -- goto free_key; -+ key = __bpf_copy_key(ukey, map->key_size); -+ if (IS_ERR(key)) { -+ err = PTR_ERR(key); -+ goto err_put; -+ } -+ -+ if (map->map_type == BPF_MAP_TYPE_PERCPU_HASH || -+ map->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH || -+ map->map_type == BPF_MAP_TYPE_PERCPU_ARRAY) -+ value_size = round_up(map->value_size, 8) * num_possible_cpus(); -+ else if (IS_FD_MAP(map)) -+ value_size = sizeof(u32); -+ else -+ value_size = map->value_size; - - err = -ENOMEM; -- value = kmalloc(map->value_size, GFP_USER | __GFP_NOWARN); -+ value = kmalloc(value_size, GFP_USER | __GFP_NOWARN); - if (!value) - goto free_key; - -- rcu_read_lock(); -- ptr = map->ops->map_lookup_elem(map, key); -- if (ptr) -- memcpy(value, ptr, map->value_size); -- rcu_read_unlock(); -+ preempt_disable(); -+ this_cpu_inc(bpf_prog_active); -+ if (map->map_type == BPF_MAP_TYPE_PERCPU_HASH || -+ map->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH) { -+ err = bpf_percpu_hash_copy(map, key, value); -+ } else if (map->map_type == BPF_MAP_TYPE_PERCPU_ARRAY) { -+ err = bpf_percpu_array_copy(map, key, value); -+ } else if (map->map_type == BPF_MAP_TYPE_STACK_TRACE) { -+ err = bpf_stackmap_copy(map, key, value); -+ } else if (IS_FD_ARRAY(map)) { -+ err = bpf_fd_array_map_lookup_elem(map, key, value); -+ } else if (IS_FD_HASH(map)) { -+ err = bpf_fd_htab_map_lookup_elem(map, key, value); -+ } else if (map->map_type == BPF_MAP_TYPE_QUEUE || -+ map->map_type == BPF_MAP_TYPE_STACK) { -+ err = map->ops->map_peek_elem(map, value); -+ } else { -+ rcu_read_lock(); -+ if (map->ops->map_lookup_elem_sys_only) -+ ptr = map->ops->map_lookup_elem_sys_only(map, key); -+ else -+ ptr = map->ops->map_lookup_elem(map, key); -+ if (IS_ERR(ptr)) { -+ err = PTR_ERR(ptr); -+ } else if (!ptr) { -+ err = -ENOENT; -+ } else { -+ err = 0; -+ if (attr->flags & BPF_F_LOCK) -+ /* lock 'ptr' and copy everything but lock */ -+ copy_map_value_locked(map, value, ptr, true); -+ else -+ copy_map_value(map, value, ptr); -+ /* mask lock, since value wasn't zero inited */ -+ check_and_init_map_lock(map, value); -+ } -+ rcu_read_unlock(); -+ } -+ this_cpu_dec(bpf_prog_active); -+ preempt_enable(); - -- err = -ENOENT; -- if (!ptr) -+ if (err) - goto free_value; - - err = -EFAULT; -- if (copy_to_user(uvalue, value, map->value_size) != 0) -+ if (copy_to_user(uvalue, value, value_size) != 0) - goto free_value; - - err = 0; -@@ -276,15 +825,27 @@ err_put: - return err; - } - -+static void maybe_wait_bpf_programs(struct bpf_map *map) -+{ -+ /* Wait for any running BPF programs to complete so that -+ * userspace, when we return to it, knows that all programs -+ * that could be running use the new map value. -+ */ -+ if (map->map_type == BPF_MAP_TYPE_HASH_OF_MAPS || -+ map->map_type == BPF_MAP_TYPE_ARRAY_OF_MAPS) -+ synchronize_rcu(); -+} -+ - #define BPF_MAP_UPDATE_ELEM_LAST_FIELD flags - - static int map_update_elem(union bpf_attr *attr) - { -- void __user *ukey = u64_to_ptr(attr->key); -- void __user *uvalue = u64_to_ptr(attr->value); -+ void __user *ukey = u64_to_user_ptr(attr->key); -+ void __user *uvalue = u64_to_user_ptr(attr->value); - int ufd = attr->map_fd; - struct bpf_map *map; - void *key, *value; -+ u32 value_size; - struct fd f; - int err; - -@@ -295,32 +856,79 @@ static int map_update_elem(union bpf_att - map = __bpf_map_get(f); - if (IS_ERR(map)) - return PTR_ERR(map); -+ if (!(map_get_sys_perms(map, f) & FMODE_CAN_WRITE)) { -+ err = -EPERM; -+ goto err_put; -+ } - -- err = -ENOMEM; -- key = kmalloc(map->key_size, GFP_USER); -- if (!key) -+ if ((attr->flags & BPF_F_LOCK) && -+ !map_value_has_spin_lock(map)) { -+ err = -EINVAL; -+ goto err_put; -+ } -+ -+ key = __bpf_copy_key(ukey, map->key_size); -+ if (IS_ERR(key)) { -+ err = PTR_ERR(key); - goto err_put; -+ } - -- err = -EFAULT; -- if (copy_from_user(key, ukey, map->key_size) != 0) -- goto free_key; -+ if (map->map_type == BPF_MAP_TYPE_PERCPU_HASH || -+ map->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH || -+ map->map_type == BPF_MAP_TYPE_PERCPU_ARRAY) -+ value_size = round_up(map->value_size, 8) * num_possible_cpus(); -+ else -+ value_size = map->value_size; - - err = -ENOMEM; -- value = kmalloc(map->value_size, GFP_USER | __GFP_NOWARN); -+ value = kmalloc(value_size, GFP_USER | __GFP_NOWARN); - if (!value) - goto free_key; - - err = -EFAULT; -- if (copy_from_user(value, uvalue, map->value_size) != 0) -+ if (copy_from_user(value, uvalue, value_size) != 0) - goto free_value; - -- /* eBPF program that use maps are running under rcu_read_lock(), -- * therefore all map accessors rely on this fact, so do the same here -- */ -- rcu_read_lock(); -- err = map->ops->map_update_elem(map, key, value, attr->flags); -- rcu_read_unlock(); -+ /* Need to create a kthread, thus must support schedule */ -+ if (map->map_type == BPF_MAP_TYPE_CPUMAP || -+ map->map_type == BPF_MAP_TYPE_SOCKHASH || -+ map->map_type == BPF_MAP_TYPE_SOCKMAP) { -+ err = map->ops->map_update_elem(map, key, value, attr->flags); -+ goto out; -+ } - -+ /* must increment bpf_prog_active to avoid kprobe+bpf triggering from -+ * inside bpf map update or delete otherwise deadlocks are possible -+ */ -+ preempt_disable(); -+ __this_cpu_inc(bpf_prog_active); -+ if (map->map_type == BPF_MAP_TYPE_PERCPU_HASH || -+ map->map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH) { -+ err = bpf_percpu_hash_update(map, key, value, attr->flags); -+ } else if (map->map_type == BPF_MAP_TYPE_PERCPU_ARRAY) { -+ err = bpf_percpu_array_update(map, key, value, attr->flags); -+ } else if (IS_FD_ARRAY(map)) { -+ rcu_read_lock(); -+ err = bpf_fd_array_map_update_elem(map, f.file, key, value, -+ attr->flags); -+ rcu_read_unlock(); -+ } else if (map->map_type == BPF_MAP_TYPE_HASH_OF_MAPS) { -+ rcu_read_lock(); -+ err = bpf_fd_htab_map_update_elem(map, f.file, key, value, -+ attr->flags); -+ rcu_read_unlock(); -+ } else if (map->map_type == BPF_MAP_TYPE_QUEUE || -+ map->map_type == BPF_MAP_TYPE_STACK) { -+ err = map->ops->map_push_elem(map, value, attr->flags); -+ } else { -+ rcu_read_lock(); -+ err = map->ops->map_update_elem(map, key, value, attr->flags); -+ rcu_read_unlock(); -+ } -+ __this_cpu_dec(bpf_prog_active); -+ preempt_enable(); -+ maybe_wait_bpf_programs(map); -+out: - free_value: - kfree(value); - free_key: -@@ -334,7 +942,7 @@ err_put: - - static int map_delete_elem(union bpf_attr *attr) - { -- void __user *ukey = u64_to_ptr(attr->key); -+ void __user *ukey = u64_to_user_ptr(attr->key); - int ufd = attr->map_fd; - struct bpf_map *map; - struct fd f; -@@ -348,21 +956,25 @@ static int map_delete_elem(union bpf_att - map = __bpf_map_get(f); - if (IS_ERR(map)) - return PTR_ERR(map); -- -- err = -ENOMEM; -- key = kmalloc(map->key_size, GFP_USER); -- if (!key) -+ if (!(map_get_sys_perms(map, f) & FMODE_CAN_WRITE)) { -+ err = -EPERM; - goto err_put; -+ } - -- err = -EFAULT; -- if (copy_from_user(key, ukey, map->key_size) != 0) -- goto free_key; -+ key = __bpf_copy_key(ukey, map->key_size); -+ if (IS_ERR(key)) { -+ err = PTR_ERR(key); -+ goto err_put; -+ } - -+ preempt_disable(); -+ __this_cpu_inc(bpf_prog_active); - rcu_read_lock(); - err = map->ops->map_delete_elem(map, key); - rcu_read_unlock(); -- --free_key: -+ __this_cpu_dec(bpf_prog_active); -+ preempt_enable(); -+ maybe_wait_bpf_programs(map); - kfree(key); - err_put: - fdput(f); -@@ -374,8 +986,8 @@ err_put: - - static int map_get_next_key(union bpf_attr *attr) - { -- void __user *ukey = u64_to_ptr(attr->key); -- void __user *unext_key = u64_to_ptr(attr->next_key); -+ void __user *ukey = u64_to_user_ptr(attr->key); -+ void __user *unext_key = u64_to_user_ptr(attr->next_key); - int ufd = attr->map_fd; - struct bpf_map *map; - void *key, *next_key; -@@ -389,15 +1001,20 @@ static int map_get_next_key(union bpf_at - map = __bpf_map_get(f); - if (IS_ERR(map)) - return PTR_ERR(map); -- -- err = -ENOMEM; -- key = kmalloc(map->key_size, GFP_USER); -- if (!key) -+ if (!(map_get_sys_perms(map, f) & FMODE_CAN_READ)) { -+ err = -EPERM; - goto err_put; -+ } - -- err = -EFAULT; -- if (copy_from_user(key, ukey, map->key_size) != 0) -- goto free_key; -+ if (ukey) { -+ key = __bpf_copy_key(ukey, map->key_size); -+ if (IS_ERR(key)) { -+ err = PTR_ERR(key); -+ goto err_put; -+ } -+ } else { -+ key = NULL; -+ } - - err = -ENOMEM; - next_key = kmalloc(map->key_size, GFP_USER); -@@ -425,77 +1042,126 @@ err_put: - return err; - } - --static LIST_HEAD(bpf_prog_types); -+#define BPF_MAP_LOOKUP_AND_DELETE_ELEM_LAST_FIELD value - --static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) -+static int map_lookup_and_delete_elem(union bpf_attr *attr) - { -- struct bpf_prog_type_list *tl; -+ void __user *ukey = u64_to_user_ptr(attr->key); -+ void __user *uvalue = u64_to_user_ptr(attr->value); -+ int ufd = attr->map_fd; -+ struct bpf_map *map; -+ void *key, *value; -+ u32 value_size; -+ struct fd f; -+ int err; - -- list_for_each_entry(tl, &bpf_prog_types, list_node) { -- if (tl->type == type) { -- prog->aux->ops = tl->ops; -- prog->type = type; -- return 0; -- } -+ if (CHECK_ATTR(BPF_MAP_LOOKUP_AND_DELETE_ELEM)) -+ return -EINVAL; -+ -+ f = fdget(ufd); -+ map = __bpf_map_get(f); -+ if (IS_ERR(map)) -+ return PTR_ERR(map); -+ if (!(map_get_sys_perms(map, f) & FMODE_CAN_READ) || -+ !(map_get_sys_perms(map, f) & FMODE_CAN_WRITE)) { -+ err = -EPERM; -+ goto err_put; - } - -- return -EINVAL; --} -+ key = __bpf_copy_key(ukey, map->key_size); -+ if (IS_ERR(key)) { -+ err = PTR_ERR(key); -+ goto err_put; -+ } - --void bpf_register_prog_type(struct bpf_prog_type_list *tl) --{ -- list_add(&tl->list_node, &bpf_prog_types); -+ value_size = map->value_size; -+ -+ err = -ENOMEM; -+ value = kmalloc(value_size, GFP_USER | __GFP_NOWARN); -+ if (!value) -+ goto free_key; -+ -+ if (map->map_type == BPF_MAP_TYPE_QUEUE || -+ map->map_type == BPF_MAP_TYPE_STACK) { -+ err = map->ops->map_pop_elem(map, value); -+ } else { -+ err = -ENOTSUPP; -+ } -+ -+ if (err) -+ goto free_value; -+ -+ if (copy_to_user(uvalue, value, value_size) != 0) { -+ err = -EFAULT; -+ goto free_value; -+ } -+ -+ err = 0; -+ -+free_value: -+ kfree(value); -+free_key: -+ kfree(key); -+err_put: -+ fdput(f); -+ return err; - } - --/* fixup insn->imm field of bpf_call instructions: -- * if (insn->imm == BPF_FUNC_map_lookup_elem) -- * insn->imm = bpf_map_lookup_elem - __bpf_call_base; -- * else if (insn->imm == BPF_FUNC_map_update_elem) -- * insn->imm = bpf_map_update_elem - __bpf_call_base; -- * else ... -- * -- * this function is called after eBPF program passed verification -- */ --static void fixup_bpf_calls(struct bpf_prog *prog) -+#define BPF_MAP_FREEZE_LAST_FIELD map_fd -+ -+static int map_freeze(const union bpf_attr *attr) - { -- const struct bpf_func_proto *fn; -- int i; -+ int err = 0, ufd = attr->map_fd; -+ struct bpf_map *map; -+ struct fd f; - -- for (i = 0; i < prog->len; i++) { -- struct bpf_insn *insn = &prog->insnsi[i]; -+ if (CHECK_ATTR(BPF_MAP_FREEZE)) -+ return -EINVAL; - -- if (insn->code == (BPF_JMP | BPF_CALL)) { -- /* we reach here when program has bpf_call instructions -- * and it passed bpf_check(), means that -- * ops->get_func_proto must have been supplied, check it -- */ -- BUG_ON(!prog->aux->ops->get_func_proto); -+ f = fdget(ufd); -+ map = __bpf_map_get(f); -+ if (IS_ERR(map)) -+ return PTR_ERR(map); -+ if (READ_ONCE(map->frozen)) { -+ err = -EBUSY; -+ goto err_put; -+ } -+ if (!capable(CAP_SYS_ADMIN)) { -+ err = -EPERM; -+ goto err_put; -+ } - -- if (insn->imm == BPF_FUNC_get_route_realm) -- prog->dst_needed = 1; -- if (insn->imm == BPF_FUNC_get_prandom_u32) -- bpf_user_rnd_init_once(); -- if (insn->imm == BPF_FUNC_tail_call) { -- /* mark bpf_tail_call as different opcode -- * to avoid conditional branch in -- * interpeter for every normal call -- * and to prevent accidental JITing by -- * JIT compiler that doesn't support -- * bpf_tail_call yet -- */ -- insn->imm = 0; -- insn->code |= BPF_X; -- continue; -- } -+ WRITE_ONCE(map->frozen, true); -+err_put: -+ fdput(f); -+ return err; -+} - -- fn = prog->aux->ops->get_func_proto(insn->imm); -- /* all functions that have prototype and verifier allowed -- * programs to call them, must be real in-kernel functions -- */ -- BUG_ON(!fn->func); -- insn->imm = fn->func - __bpf_call_base; -- } -- } -+static const struct bpf_prog_ops * const bpf_prog_types[] = { -+#define BPF_PROG_TYPE(_id, _name) \ -+ [_id] = & _name ## _prog_ops, -+#define BPF_MAP_TYPE(_id, _ops) -+#include -+#undef BPF_PROG_TYPE -+#undef BPF_MAP_TYPE -+}; -+ -+static int find_prog_type(enum bpf_prog_type type, struct bpf_prog *prog) -+{ -+ const struct bpf_prog_ops *ops; -+ -+ if (type >= ARRAY_SIZE(bpf_prog_types)) -+ return -EINVAL; -+ ops = bpf_prog_types[type]; -+ if (!ops) -+ return -EINVAL; -+ -+ if (!bpf_prog_is_dev_bound(prog->aux)) -+ prog->aux->ops = ops; -+ else -+ return -EINVAL; -+ prog->type = type; -+ return 0; - } - - /* drop refcnt on maps used by eBPF program and free auxilary data */ -@@ -509,19 +1175,39 @@ static void free_used_maps(struct bpf_pr - kfree(aux->used_maps); - } - -+int __bpf_prog_charge(struct user_struct *user, u32 pages) -+{ -+ unsigned long memlock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; -+ unsigned long user_bufs; -+ -+ if (user) { -+ user_bufs = atomic_long_add_return(pages, &user->locked_vm); -+ if (user_bufs > memlock_limit) { -+ atomic_long_sub(pages, &user->locked_vm); -+ return -EPERM; -+ } -+ } -+ -+ return 0; -+} -+ -+void __bpf_prog_uncharge(struct user_struct *user, u32 pages) -+{ -+ if (user) -+ atomic_long_sub(pages, &user->locked_vm); -+} -+ - static int bpf_prog_charge_memlock(struct bpf_prog *prog) - { - struct user_struct *user = get_current_user(); -- unsigned long memlock_limit; -+ int ret; - -- memlock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; -- -- atomic_long_add(prog->pages, &user->locked_vm); -- if (atomic_long_read(&user->locked_vm) > memlock_limit) { -- atomic_long_sub(prog->pages, &user->locked_vm); -+ ret = __bpf_prog_charge(user, prog->pages); -+ if (ret) { - free_uid(user); -- return -EPERM; -+ return ret; - } -+ - prog->aux->user = user; - return 0; - } -@@ -530,30 +1216,87 @@ static void bpf_prog_uncharge_memlock(st - { - struct user_struct *user = prog->aux->user; - -- atomic_long_sub(prog->pages, &user->locked_vm); -+ __bpf_prog_uncharge(user, prog->pages); - free_uid(user); - } - --static void __prog_put_common(struct rcu_head *rcu) -+static int bpf_prog_alloc_id(struct bpf_prog *prog) -+{ -+ int id; -+ -+ idr_preload(GFP_KERNEL); -+ spin_lock_bh(&prog_idr_lock); -+ id = idr_alloc_cyclic(&prog_idr, prog, 1, INT_MAX, GFP_ATOMIC); -+ if (id > 0) -+ prog->aux->id = id; -+ spin_unlock_bh(&prog_idr_lock); -+ idr_preload_end(); -+ -+ /* id is in [1, INT_MAX) */ -+ if (WARN_ON_ONCE(!id)) -+ return -ENOSPC; -+ -+ return id > 0 ? 0 : id; -+} -+ -+void bpf_prog_free_id(struct bpf_prog *prog, bool do_idr_lock) -+{ -+ /* cBPF to eBPF migrations are currently not in the idr store. -+ * Offloaded programs are removed from the store when their device -+ * disappears - even if someone grabs an fd to them they are unusable, -+ * simply waiting for refcnt to drop to be freed. -+ */ -+ if (!prog->aux->id) -+ return; -+ -+ if (do_idr_lock) -+ spin_lock_bh(&prog_idr_lock); -+ else -+ __acquire(&prog_idr_lock); -+ -+ idr_remove(&prog_idr, prog->aux->id); -+ prog->aux->id = 0; -+ -+ if (do_idr_lock) -+ spin_unlock_bh(&prog_idr_lock); -+ else -+ __release(&prog_idr_lock); -+} -+ -+static void __bpf_prog_put_rcu(struct rcu_head *rcu) - { - struct bpf_prog_aux *aux = container_of(rcu, struct bpf_prog_aux, rcu); - -+ kvfree(aux->func_info); - free_used_maps(aux); - bpf_prog_uncharge_memlock(aux->prog); - bpf_prog_free(aux->prog); - } - --/* version of bpf_prog_put() that is called after a grace period */ --void bpf_prog_put_rcu(struct bpf_prog *prog) -+static void __bpf_prog_put_noref(struct bpf_prog *prog, bool deferred) -+{ -+ bpf_prog_kallsyms_del_all(prog); -+ btf_put(prog->aux->btf); -+ bpf_prog_free_linfo(prog); -+ -+ if (deferred) -+ call_rcu(&prog->aux->rcu, __bpf_prog_put_rcu); -+ else -+ __bpf_prog_put_rcu(&prog->aux->rcu); -+} -+ -+static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock) - { -- if (atomic_dec_and_test(&prog->aux->refcnt)) -- call_rcu(&prog->aux->rcu, __prog_put_common); -+ if (atomic_dec_and_test(&prog->aux->refcnt)) { -+ /* bpf_prog_free_id() must be called first */ -+ bpf_prog_free_id(prog, do_idr_lock); -+ __bpf_prog_put_noref(prog, true); -+ } - } - - void bpf_prog_put(struct bpf_prog *prog) - { -- if (atomic_dec_and_test(&prog->aux->refcnt)) -- __prog_put_common(&prog->aux->rcu); -+ __bpf_prog_put(prog, true); - } - EXPORT_SYMBOL_GPL(bpf_prog_put); - -@@ -561,12 +1304,68 @@ static int bpf_prog_release(struct inode - { - struct bpf_prog *prog = filp->private_data; - -- bpf_prog_put_rcu(prog); -+ bpf_prog_put(prog); - return 0; - } - --static const struct file_operations bpf_prog_fops = { -- .release = bpf_prog_release, -+static void bpf_prog_get_stats(const struct bpf_prog *prog, -+ struct bpf_prog_stats *stats) -+{ -+ u64 nsecs = 0, cnt = 0; -+ int cpu; -+ -+ for_each_possible_cpu(cpu) { -+ const struct bpf_prog_stats *st; -+ unsigned int start; -+ u64 tnsecs, tcnt; -+ -+ st = per_cpu_ptr(prog->aux->stats, cpu); -+ do { -+ start = u64_stats_fetch_begin_irq(&st->syncp); -+ tnsecs = st->nsecs; -+ tcnt = st->cnt; -+ } while (u64_stats_fetch_retry_irq(&st->syncp, start)); -+ nsecs += tnsecs; -+ cnt += tcnt; -+ } -+ stats->nsecs = nsecs; -+ stats->cnt = cnt; -+} -+ -+#ifdef CONFIG_PROC_FS -+static void bpf_prog_show_fdinfo(struct seq_file *m, struct file *filp) -+{ -+ const struct bpf_prog *prog = filp->private_data; -+ char prog_tag[sizeof(prog->tag) * 2 + 1] = { }; -+ struct bpf_prog_stats stats; -+ -+ bpf_prog_get_stats(prog, &stats); -+ bin2hex(prog_tag, prog->tag, sizeof(prog->tag)); -+ seq_printf(m, -+ "prog_type:\t%u\n" -+ "prog_jited:\t%u\n" -+ "prog_tag:\t%s\n" -+ "memlock:\t%llu\n" -+ "prog_id:\t%u\n" -+ "run_time_ns:\t%llu\n" -+ "run_cnt:\t%llu\n", -+ prog->type, -+ prog->jited, -+ prog_tag, -+ prog->pages * 1ULL << PAGE_SHIFT, -+ prog->aux->id, -+ stats.nsecs, -+ stats.cnt); -+} -+#endif -+ -+const struct file_operations bpf_prog_fops = { -+#ifdef CONFIG_PROC_FS -+ .show_fdinfo = bpf_prog_show_fdinfo, -+#endif -+ .release = bpf_prog_release, -+ .read = bpf_dummy_read, -+ .write = bpf_dummy_write, - }; - - int bpf_prog_new_fd(struct bpf_prog *prog) -@@ -575,7 +1374,7 @@ int bpf_prog_new_fd(struct bpf_prog *pro - O_RDWR | O_CLOEXEC); - } - --static struct bpf_prog *__bpf_prog_get(struct fd f) -+static struct bpf_prog *____bpf_prog_get(struct fd f) - { - if (!f.file) - return ERR_PTR(-EBADF); -@@ -587,38 +1386,178 @@ static struct bpf_prog *__bpf_prog_get(s - return f.file->private_data; - } - -+struct bpf_prog *bpf_prog_add(struct bpf_prog *prog, int i) -+{ -+ if (atomic_add_return(i, &prog->aux->refcnt) > BPF_MAX_REFCNT) { -+ atomic_sub(i, &prog->aux->refcnt); -+ return ERR_PTR(-EBUSY); -+ } -+ return prog; -+} -+EXPORT_SYMBOL_GPL(bpf_prog_add); -+ -+void bpf_prog_sub(struct bpf_prog *prog, int i) -+{ -+ /* Only to be used for undoing previous bpf_prog_add() in some -+ * error path. We still know that another entity in our call -+ * path holds a reference to the program, thus atomic_sub() can -+ * be safely used in such cases! -+ */ -+ WARN_ON(atomic_sub_return(i, &prog->aux->refcnt) == 0); -+} -+EXPORT_SYMBOL_GPL(bpf_prog_sub); -+ - struct bpf_prog *bpf_prog_inc(struct bpf_prog *prog) - { -- if (atomic_inc_return(&prog->aux->refcnt) > BPF_MAX_REFCNT) { -- atomic_dec(&prog->aux->refcnt); -+ return bpf_prog_add(prog, 1); -+} -+EXPORT_SYMBOL_GPL(bpf_prog_inc); -+ -+/* prog_idr_lock should have been held */ -+struct bpf_prog *bpf_prog_inc_not_zero(struct bpf_prog *prog) -+{ -+ int refold; -+ -+ refold = atomic_fetch_add_unless(&prog->aux->refcnt, 1, 0); -+ -+ if (refold >= BPF_MAX_REFCNT) { -+ __bpf_prog_put(prog, false); - return ERR_PTR(-EBUSY); - } -+ -+ if (!refold) -+ return ERR_PTR(-ENOENT); -+ - return prog; - } -+EXPORT_SYMBOL_GPL(bpf_prog_inc_not_zero); - --/* called by sockets/tracing/seccomp before attaching program to an event -- * pairs with bpf_prog_put() -- */ --struct bpf_prog *bpf_prog_get(u32 ufd) -+bool bpf_prog_get_ok(struct bpf_prog *prog, -+ enum bpf_prog_type *attach_type, bool attach_drv) -+{ -+ /* not an attachment, just a refcount inc, always allow */ -+ if (!attach_type) -+ return true; -+ -+ if (prog->type != *attach_type) -+ return false; -+ if (bpf_prog_is_dev_bound(prog->aux) && !attach_drv) -+ return false; -+ -+ return true; -+} -+ -+static struct bpf_prog *__bpf_prog_get(u32 ufd, enum bpf_prog_type *attach_type, -+ bool attach_drv) - { - struct fd f = fdget(ufd); - struct bpf_prog *prog; - -- prog = __bpf_prog_get(f); -+ prog = ____bpf_prog_get(f); - if (IS_ERR(prog)) - return prog; -+ if (!bpf_prog_get_ok(prog, attach_type, attach_drv)) { -+ prog = ERR_PTR(-EINVAL); -+ goto out; -+ } - - prog = bpf_prog_inc(prog); -+out: - fdput(f); -- - return prog; - } --EXPORT_SYMBOL_GPL(bpf_prog_get); -+ -+struct bpf_prog *bpf_prog_get(u32 ufd) -+{ -+ return __bpf_prog_get(ufd, NULL, false); -+} -+ -+struct bpf_prog *bpf_prog_get_type_dev(u32 ufd, enum bpf_prog_type type, -+ bool attach_drv) -+{ -+ return __bpf_prog_get(ufd, &type, attach_drv); -+} -+EXPORT_SYMBOL_GPL(bpf_prog_get_type_dev); -+ -+/* Initially all BPF programs could be loaded w/o specifying -+ * expected_attach_type. Later for some of them specifying expected_attach_type -+ * at load time became required so that program could be validated properly. -+ * Programs of types that are allowed to be loaded both w/ and w/o (for -+ * backward compatibility) expected_attach_type, should have the default attach -+ * type assigned to expected_attach_type for the latter case, so that it can be -+ * validated later at attach time. -+ * -+ * bpf_prog_load_fixup_attach_type() sets expected_attach_type in @attr if -+ * prog type requires it but has some attach types that have to be backward -+ * compatible. -+ */ -+static void bpf_prog_load_fixup_attach_type(union bpf_attr *attr) -+{ -+ switch (attr->prog_type) { -+ case BPF_PROG_TYPE_CGROUP_SOCK: -+ /* Unfortunately BPF_ATTACH_TYPE_UNSPEC enumeration doesn't -+ * exist so checking for non-zero is the way to go here. -+ */ -+ if (!attr->expected_attach_type) -+ attr->expected_attach_type = -+ BPF_CGROUP_INET_SOCK_CREATE; -+ break; -+ } -+} -+ -+static int -+bpf_prog_load_check_attach_type(enum bpf_prog_type prog_type, -+ enum bpf_attach_type expected_attach_type) -+{ -+ switch (prog_type) { -+ case BPF_PROG_TYPE_CGROUP_SOCK: -+ switch (expected_attach_type) { -+ case BPF_CGROUP_INET_SOCK_CREATE: -+ case BPF_CGROUP_INET4_POST_BIND: -+ case BPF_CGROUP_INET6_POST_BIND: -+ return 0; -+ default: -+ return -EINVAL; -+ } -+ case BPF_PROG_TYPE_CGROUP_SOCK_ADDR: -+ switch (expected_attach_type) { -+ case BPF_CGROUP_INET4_BIND: -+ case BPF_CGROUP_INET6_BIND: -+ case BPF_CGROUP_INET4_CONNECT: -+ case BPF_CGROUP_INET6_CONNECT: -+ case BPF_CGROUP_UDP4_SENDMSG: -+ case BPF_CGROUP_UDP6_SENDMSG: -+ case BPF_CGROUP_UDP4_RECVMSG: -+ case BPF_CGROUP_UDP6_RECVMSG: -+ return 0; -+ default: -+ return -EINVAL; -+ } -+ case BPF_PROG_TYPE_CGROUP_SKB: -+ switch (expected_attach_type) { -+ case BPF_CGROUP_INET_INGRESS: -+ case BPF_CGROUP_INET_EGRESS: -+ return 0; -+ default: -+ return -EINVAL; -+ } -+ case BPF_PROG_TYPE_CGROUP_SOCKOPT: -+ switch (expected_attach_type) { -+ case BPF_CGROUP_SETSOCKOPT: -+ case BPF_CGROUP_GETSOCKOPT: -+ return 0; -+ default: -+ return -EINVAL; -+ } -+ default: -+ return 0; -+ } -+} - - /* last field in 'union bpf_attr' used by this command */ --#define BPF_PROG_LOAD_LAST_FIELD kern_version -+#define BPF_PROG_LOAD_LAST_FIELD line_info_cnt - --static int bpf_prog_load(union bpf_attr *attr) -+static int bpf_prog_load(union bpf_attr *attr, union bpf_attr __user *uattr) - { - enum bpf_prog_type type = attr->prog_type; - struct bpf_prog *prog; -@@ -629,8 +1568,19 @@ static int bpf_prog_load(union bpf_attr - if (CHECK_ATTR(BPF_PROG_LOAD)) - return -EINVAL; - -+ if (attr->prog_flags & ~(BPF_F_STRICT_ALIGNMENT | -+ BPF_F_ANY_ALIGNMENT | -+ BPF_F_TEST_STATE_FREQ | -+ BPF_F_TEST_RND_HI32)) -+ return -EINVAL; -+ -+ if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && -+ (attr->prog_flags & BPF_F_ANY_ALIGNMENT) && -+ !capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ - /* copy eBPF program license from user space */ -- if (strncpy_from_user(license, u64_to_ptr(attr->license), -+ if (strncpy_from_user(license, u64_to_user_ptr(attr->license), - sizeof(license) - 1) < 0) - return -EFAULT; - license[sizeof(license) - 1] = 0; -@@ -638,30 +1588,36 @@ static int bpf_prog_load(union bpf_attr - /* eBPF programs must be GPL compatible to use GPL-ed functions */ - is_gpl = license_is_gpl_compatible(license); - -- if (attr->insn_cnt >= BPF_MAXINSNS) -- return -EINVAL; -+ if (attr->insn_cnt == 0 || -+ attr->insn_cnt > (capable(CAP_SYS_ADMIN) ? BPF_COMPLEXITY_LIMIT_INSNS : BPF_MAXINSNS)) -+ return -E2BIG; -+ if (type != BPF_PROG_TYPE_SOCKET_FILTER && -+ type != BPF_PROG_TYPE_CGROUP_SKB && -+ !capable(CAP_SYS_ADMIN)) -+ return -EPERM; - -- if (type == BPF_PROG_TYPE_KPROBE && -- attr->kern_version != LINUX_VERSION_CODE) -+ bpf_prog_load_fixup_attach_type(attr); -+ if (bpf_prog_load_check_attach_type(type, attr->expected_attach_type)) - return -EINVAL; - -- if (type != BPF_PROG_TYPE_SOCKET_FILTER && !capable(CAP_SYS_ADMIN)) -- return -EPERM; -- - /* plain bpf_prog allocation */ - prog = bpf_prog_alloc(bpf_prog_size(attr->insn_cnt), GFP_USER); - if (!prog) - return -ENOMEM; - -+ prog->expected_attach_type = attr->expected_attach_type; -+ -+ prog->aux->offload_requested = !!attr->prog_ifindex; -+ - err = bpf_prog_charge_memlock(prog); - if (err) -- goto free_prog_nouncharge; -+ goto free_prog_sec; - - prog->len = attr->insn_cnt; - - err = -EFAULT; -- if (copy_from_user(prog->insns, u64_to_ptr(attr->insns), -- prog->len * sizeof(struct bpf_insn)) != 0) -+ if (copy_from_user(prog->insns, u64_to_user_ptr(attr->insns), -+ bpf_prog_insn_size(prog)) != 0) - goto free_prog; - - prog->orig_prog = NULL; -@@ -675,91 +1631,720 @@ static int bpf_prog_load(union bpf_attr - if (err < 0) - goto free_prog; - -+ prog->aux->load_time = ktime_get_boot_ns(); -+ err = bpf_obj_name_cpy(prog->aux->name, attr->prog_name); -+ if (err) -+ goto free_prog; -+ - /* run eBPF verifier */ -- err = bpf_check(&prog, attr); -+ err = bpf_check(&prog, attr, uattr); - if (err < 0) - goto free_used_maps; - -- /* fixup BPF_CALL->imm field */ -- fixup_bpf_calls(prog); -- -- /* eBPF program is ready to be JITed */ -- err = bpf_prog_select_runtime(prog); -+ prog = bpf_prog_select_runtime(prog, &err); - if (err < 0) - goto free_used_maps; - -- err = bpf_prog_new_fd(prog); -- if (err < 0) -- /* failed to allocate fd */ -+ err = bpf_prog_alloc_id(prog); -+ if (err) - goto free_used_maps; - -+ /* Upon success of bpf_prog_alloc_id(), the BPF prog is -+ * effectively publicly exposed. However, retrieving via -+ * bpf_prog_get_fd_by_id() will take another reference, -+ * therefore it cannot be gone underneath us. -+ * -+ * Only for the time /after/ successful bpf_prog_new_fd() -+ * and before returning to userspace, we might just hold -+ * one reference and any parallel close on that fd could -+ * rip everything out. Hence, below notifications must -+ * happen before bpf_prog_new_fd(). -+ * -+ * Also, any failure handling from this point onwards must -+ * be using bpf_prog_put() given the program is exposed. -+ */ -+ bpf_prog_kallsyms_add(prog); -+ -+ err = bpf_prog_new_fd(prog); -+ if (err < 0) -+ bpf_prog_put(prog); - return err; - - free_used_maps: -- free_used_maps(prog->aux); -+ /* In case we have subprogs, we need to wait for a grace -+ * period before we can tear down JIT memory since symbols -+ * are already exposed under kallsyms. -+ */ -+ __bpf_prog_put_noref(prog, prog->aux->func_cnt); -+ return err; - free_prog: - bpf_prog_uncharge_memlock(prog); --free_prog_nouncharge: -+free_prog_sec: - bpf_prog_free(prog); - return err; - } - --#define BPF_OBJ_LAST_FIELD bpf_fd -+#define BPF_OBJ_LAST_FIELD file_flags - - static int bpf_obj_pin(const union bpf_attr *attr) - { -- if (CHECK_ATTR(BPF_OBJ)) -+ if (CHECK_ATTR(BPF_OBJ) || attr->file_flags != 0) - return -EINVAL; - -- return bpf_obj_pin_user(attr->bpf_fd, u64_to_ptr(attr->pathname)); -+ return bpf_obj_pin_user(attr->bpf_fd, u64_to_user_ptr(attr->pathname)); - } - - static int bpf_obj_get(const union bpf_attr *attr) - { -- if (CHECK_ATTR(BPF_OBJ) || attr->bpf_fd != 0) -+ if (CHECK_ATTR(BPF_OBJ) || attr->bpf_fd != 0 || -+ attr->file_flags & ~BPF_OBJ_FLAG_MASK) - return -EINVAL; - -- return bpf_obj_get_user(u64_to_ptr(attr->pathname)); -+ return bpf_obj_get_user(u64_to_user_ptr(attr->pathname), -+ attr->file_flags); - } - --SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size) -+ -+#define BPF_PROG_ATTACH_LAST_FIELD attach_flags -+ -+#define BPF_F_ATTACH_MASK \ -+ (BPF_F_ALLOW_OVERRIDE | BPF_F_ALLOW_MULTI) -+ -+ -+#define BPF_PROG_DETACH_LAST_FIELD attach_type -+ -+ -+#define BPF_PROG_QUERY_LAST_FIELD query.prog_cnt -+ -+ -+#define BPF_PROG_TEST_RUN_LAST_FIELD test.ctx_out -+ -+static int bpf_prog_test_run(const union bpf_attr *attr, -+ union bpf_attr __user *uattr) - { -- union bpf_attr attr = {}; -- int err; -+ struct bpf_prog *prog; -+ int ret = -ENOTSUPP; - -- if (!capable(CAP_SYS_ADMIN) && sysctl_unprivileged_bpf_disabled) -+ if (!capable(CAP_SYS_ADMIN)) - return -EPERM; -+ if (CHECK_ATTR(BPF_PROG_TEST_RUN)) -+ return -EINVAL; -+ -+ if ((attr->test.ctx_size_in && !attr->test.ctx_in) || -+ (!attr->test.ctx_size_in && attr->test.ctx_in)) -+ return -EINVAL; -+ -+ if ((attr->test.ctx_size_out && !attr->test.ctx_out) || -+ (!attr->test.ctx_size_out && attr->test.ctx_out)) -+ return -EINVAL; -+ -+ prog = bpf_prog_get(attr->test.prog_fd); -+ if (IS_ERR(prog)) -+ return PTR_ERR(prog); -+ -+ if (prog->aux->ops->test_run) -+ ret = prog->aux->ops->test_run(prog, attr, uattr); -+ -+ bpf_prog_put(prog); -+ return ret; -+} -+ -+#define BPF_OBJ_GET_NEXT_ID_LAST_FIELD next_id -+ -+static int bpf_obj_get_next_id(const union bpf_attr *attr, -+ union bpf_attr __user *uattr, -+ struct idr *idr, -+ spinlock_t *lock) -+{ -+ u32 next_id = attr->start_id; -+ int err = 0; -+ -+ if (CHECK_ATTR(BPF_OBJ_GET_NEXT_ID) || next_id >= INT_MAX) -+ return -EINVAL; -+ -+ if (!capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ -+ next_id++; -+ spin_lock_bh(lock); -+ if (!idr_get_next(idr, &next_id)) -+ err = -ENOENT; -+ spin_unlock_bh(lock); -+ -+ if (!err) -+ err = put_user(next_id, &uattr->next_id); -+ -+ return err; -+} -+ -+#define BPF_PROG_GET_FD_BY_ID_LAST_FIELD prog_id -+ -+static int bpf_prog_get_fd_by_id(const union bpf_attr *attr) -+{ -+ struct bpf_prog *prog; -+ u32 id = attr->prog_id; -+ int fd; -+ -+ if (CHECK_ATTR(BPF_PROG_GET_FD_BY_ID)) -+ return -EINVAL; -+ -+ if (!capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ -+ spin_lock_bh(&prog_idr_lock); -+ prog = idr_find(&prog_idr, id); -+ if (prog) -+ prog = bpf_prog_inc_not_zero(prog); -+ else -+ prog = ERR_PTR(-ENOENT); -+ spin_unlock_bh(&prog_idr_lock); -+ -+ if (IS_ERR(prog)) -+ return PTR_ERR(prog); -+ -+ fd = bpf_prog_new_fd(prog); -+ if (fd < 0) -+ bpf_prog_put(prog); -+ -+ return fd; -+} -+ -+#define BPF_MAP_GET_FD_BY_ID_LAST_FIELD open_flags -+ -+static int bpf_map_get_fd_by_id(const union bpf_attr *attr) -+{ -+ struct bpf_map *map; -+ u32 id = attr->map_id; -+ int f_flags; -+ int fd; -+ -+ if (CHECK_ATTR(BPF_MAP_GET_FD_BY_ID) || -+ attr->open_flags & ~BPF_OBJ_FLAG_MASK) -+ return -EINVAL; -+ -+ if (!capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ -+ f_flags = bpf_get_file_flag(attr->open_flags); -+ if (f_flags < 0) -+ return f_flags; -+ -+ spin_lock_bh(&map_idr_lock); -+ map = idr_find(&map_idr, id); -+ if (map) -+ map = __bpf_map_inc_not_zero(map, true); -+ else -+ map = ERR_PTR(-ENOENT); -+ spin_unlock_bh(&map_idr_lock); -+ -+ if (IS_ERR(map)) -+ return PTR_ERR(map); - -- if (!access_ok(VERIFY_READ, uattr, 1)) -+ fd = bpf_map_new_fd(map, f_flags); -+ if (fd < 0) -+ bpf_map_put_with_uref(map); -+ -+ return fd; -+} -+ -+static const struct bpf_map *bpf_map_from_imm(const struct bpf_prog *prog, -+ unsigned long addr, u32 *off, -+ u32 *type) -+{ -+ const struct bpf_map *map; -+ int i; -+ -+ for (i = 0, *off = 0; i < prog->aux->used_map_cnt; i++) { -+ map = prog->aux->used_maps[i]; -+ if (map == (void *)addr) { -+ *type = BPF_PSEUDO_MAP_FD; -+ return map; -+ } -+ if (!map->ops->map_direct_value_meta) -+ continue; -+ if (!map->ops->map_direct_value_meta(map, addr, off)) { -+ *type = BPF_PSEUDO_MAP_VALUE; -+ return map; -+ } -+ } -+ -+ return NULL; -+} -+ -+static struct bpf_insn *bpf_insn_prepare_dump(const struct bpf_prog *prog, -+ const struct cred *f_cred) -+{ -+ const struct bpf_map *map; -+ struct bpf_insn *insns; -+ u32 off, type; -+ u64 imm; -+ int i; -+ -+ insns = kmemdup(prog->insnsi, bpf_prog_insn_size(prog), -+ GFP_USER); -+ if (!insns) -+ return insns; -+ -+ for (i = 0; i < prog->len; i++) { -+ if (insns[i].code == (BPF_JMP | BPF_TAIL_CALL)) { -+ insns[i].code = BPF_JMP | BPF_CALL; -+ insns[i].imm = BPF_FUNC_tail_call; -+ /* fall-through */ -+ } -+ if (insns[i].code == (BPF_JMP | BPF_CALL) || -+ insns[i].code == (BPF_JMP | BPF_CALL_ARGS)) { -+ if (insns[i].code == (BPF_JMP | BPF_CALL_ARGS)) -+ insns[i].code = BPF_JMP | BPF_CALL; -+ if (!bpf_dump_raw_ok(f_cred)) -+ insns[i].imm = 0; -+ continue; -+ } -+ -+ if (insns[i].code != (BPF_LD | BPF_IMM | BPF_DW)) -+ continue; -+ -+ imm = ((u64)insns[i + 1].imm << 32) | (u32)insns[i].imm; -+ map = bpf_map_from_imm(prog, imm, &off, &type); -+ if (map) { -+ insns[i].src_reg = type; -+ insns[i].imm = map->id; -+ insns[i + 1].imm = off; -+ continue; -+ } -+ } -+ -+ return insns; -+} -+ -+static int set_info_rec_size(struct bpf_prog_info *info) -+{ -+ /* -+ * Ensure info.*_rec_size is the same as kernel expected size -+ * -+ * or -+ * -+ * Only allow zero *_rec_size if both _rec_size and _cnt are -+ * zero. In this case, the kernel will set the expected -+ * _rec_size back to the info. -+ */ -+ -+ if ((info->nr_func_info || info->func_info_rec_size) && -+ info->func_info_rec_size != sizeof(struct bpf_func_info)) -+ return -EINVAL; -+ -+ if ((info->nr_line_info || info->line_info_rec_size) && -+ info->line_info_rec_size != sizeof(struct bpf_line_info)) -+ return -EINVAL; -+ -+ if ((info->nr_jited_line_info || info->jited_line_info_rec_size) && -+ info->jited_line_info_rec_size != sizeof(__u64)) -+ return -EINVAL; -+ -+ info->func_info_rec_size = sizeof(struct bpf_func_info); -+ info->line_info_rec_size = sizeof(struct bpf_line_info); -+ info->jited_line_info_rec_size = sizeof(__u64); -+ -+ return 0; -+} -+ -+static int bpf_prog_get_info_by_fd(struct file *file, -+ struct bpf_prog *prog, -+ const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ struct bpf_prog_info __user *uinfo = u64_to_user_ptr(attr->info.info); -+ struct bpf_prog_info info; -+ u32 info_len = attr->info.info_len; -+ struct bpf_prog_stats stats; -+ char __user *uinsns; -+ u32 ulen; -+ int err; -+ -+ err = bpf_check_uarg_tail_zero(uinfo, sizeof(info), info_len); -+ if (err) -+ return err; -+ info_len = min_t(u32, sizeof(info), info_len); -+ -+ memset(&info, 0, sizeof(info)); -+ if (copy_from_user(&info, uinfo, info_len)) - return -EFAULT; - -- if (size > PAGE_SIZE) /* silly large */ -- return -E2BIG; -+ info.type = prog->type; -+ info.id = prog->aux->id; -+ info.load_time = prog->aux->load_time; -+ info.created_by_uid = from_kuid_munged(current_user_ns(), -+ prog->aux->user->uid); -+ info.gpl_compatible = prog->gpl_compatible; -+ -+ memcpy(info.tag, prog->tag, sizeof(prog->tag)); -+ memcpy(info.name, prog->aux->name, sizeof(prog->aux->name)); -+ -+ ulen = info.nr_map_ids; -+ info.nr_map_ids = prog->aux->used_map_cnt; -+ ulen = min_t(u32, info.nr_map_ids, ulen); -+ if (ulen) { -+ u32 __user *user_map_ids = u64_to_user_ptr(info.map_ids); -+ u32 i; -+ -+ for (i = 0; i < ulen; i++) -+ if (put_user(prog->aux->used_maps[i]->id, -+ &user_map_ids[i])) -+ return -EFAULT; -+ } -+ -+ err = set_info_rec_size(&info); -+ if (err) -+ return err; -+ -+ bpf_prog_get_stats(prog, &stats); -+ info.run_time_ns = stats.nsecs; -+ info.run_cnt = stats.cnt; -+ -+ if (!capable(CAP_SYS_ADMIN)) { -+ info.jited_prog_len = 0; -+ info.xlated_prog_len = 0; -+ info.nr_jited_ksyms = 0; -+ info.nr_jited_func_lens = 0; -+ info.nr_func_info = 0; -+ info.nr_line_info = 0; -+ info.nr_jited_line_info = 0; -+ goto done; -+ } -+ -+ ulen = info.xlated_prog_len; -+ info.xlated_prog_len = bpf_prog_insn_size(prog); -+ if (info.xlated_prog_len && ulen) { -+ struct bpf_insn *insns_sanitized; -+ bool fault; -+ -+ if (prog->blinded && !bpf_dump_raw_ok(file->f_cred)) { -+ info.xlated_prog_insns = 0; -+ goto done; -+ } -+ insns_sanitized = bpf_insn_prepare_dump(prog, file->f_cred); -+ if (!insns_sanitized) -+ return -ENOMEM; -+ uinsns = u64_to_user_ptr(info.xlated_prog_insns); -+ ulen = min_t(u32, info.xlated_prog_len, ulen); -+ fault = copy_to_user(uinsns, insns_sanitized, ulen); -+ kfree(insns_sanitized); -+ if (fault) -+ return -EFAULT; -+ } -+ -+ /* NOTE: the following code is supposed to be skipped for offload. -+ * bpf_prog_offload_info_fill() is the place to fill similar fields -+ * for offload. -+ */ -+ ulen = info.jited_prog_len; -+ if (prog->aux->func_cnt) { -+ u32 i; -+ -+ info.jited_prog_len = 0; -+ for (i = 0; i < prog->aux->func_cnt; i++) -+ info.jited_prog_len += prog->aux->func[i]->jited_len; -+ } else { -+ info.jited_prog_len = prog->jited_len; -+ } -+ -+ if (info.jited_prog_len && ulen) { -+ if (bpf_dump_raw_ok(file->f_cred)) { -+ uinsns = u64_to_user_ptr(info.jited_prog_insns); -+ ulen = min_t(u32, info.jited_prog_len, ulen); -+ -+ /* for multi-function programs, copy the JITed -+ * instructions for all the functions -+ */ -+ if (prog->aux->func_cnt) { -+ u32 len, free, i; -+ u8 *img; -+ -+ free = ulen; -+ for (i = 0; i < prog->aux->func_cnt; i++) { -+ len = prog->aux->func[i]->jited_len; -+ len = min_t(u32, len, free); -+ img = (u8 *) prog->aux->func[i]->bpf_func; -+ if (copy_to_user(uinsns, img, len)) -+ return -EFAULT; -+ uinsns += len; -+ free -= len; -+ if (!free) -+ break; -+ } -+ } else { -+ if (copy_to_user(uinsns, prog->bpf_func, ulen)) -+ return -EFAULT; -+ } -+ } else { -+ info.jited_prog_insns = 0; -+ } -+ } -+ -+ ulen = info.nr_jited_ksyms; -+ info.nr_jited_ksyms = prog->aux->func_cnt ? : 1; -+ if (ulen) { -+ if (bpf_dump_raw_ok(file->f_cred)) { -+ unsigned long ksym_addr; -+ u64 __user *user_ksyms; -+ u32 i; -+ -+ /* copy the address of the kernel symbol -+ * corresponding to each function -+ */ -+ ulen = min_t(u32, info.nr_jited_ksyms, ulen); -+ user_ksyms = u64_to_user_ptr(info.jited_ksyms); -+ if (prog->aux->func_cnt) { -+ for (i = 0; i < ulen; i++) { -+ ksym_addr = (unsigned long) -+ prog->aux->func[i]->bpf_func; -+ if (put_user((u64) ksym_addr, -+ &user_ksyms[i])) -+ return -EFAULT; -+ } -+ } else { -+ ksym_addr = (unsigned long) prog->bpf_func; -+ if (put_user((u64) ksym_addr, &user_ksyms[0])) -+ return -EFAULT; -+ } -+ } else { -+ info.jited_ksyms = 0; -+ } -+ } -+ -+ ulen = info.nr_jited_func_lens; -+ info.nr_jited_func_lens = prog->aux->func_cnt ? : 1; -+ if (ulen) { -+ if (bpf_dump_raw_ok(file->f_cred)) { -+ u32 __user *user_lens; -+ u32 func_len, i; -+ -+ /* copy the JITed image lengths for each function */ -+ ulen = min_t(u32, info.nr_jited_func_lens, ulen); -+ user_lens = u64_to_user_ptr(info.jited_func_lens); -+ if (prog->aux->func_cnt) { -+ for (i = 0; i < ulen; i++) { -+ func_len = -+ prog->aux->func[i]->jited_len; -+ if (put_user(func_len, &user_lens[i])) -+ return -EFAULT; -+ } -+ } else { -+ func_len = prog->jited_len; -+ if (put_user(func_len, &user_lens[0])) -+ return -EFAULT; -+ } -+ } else { -+ info.jited_func_lens = 0; -+ } -+ } -+ -+ if (prog->aux->btf) -+ info.btf_id = btf_id(prog->aux->btf); -+ -+ ulen = info.nr_func_info; -+ info.nr_func_info = prog->aux->func_info_cnt; -+ if (info.nr_func_info && ulen) { -+ char __user *user_finfo; -+ -+ user_finfo = u64_to_user_ptr(info.func_info); -+ ulen = min_t(u32, info.nr_func_info, ulen); -+ if (copy_to_user(user_finfo, prog->aux->func_info, -+ info.func_info_rec_size * ulen)) -+ return -EFAULT; -+ } -+ -+ ulen = info.nr_line_info; -+ info.nr_line_info = prog->aux->nr_linfo; -+ if (info.nr_line_info && ulen) { -+ __u8 __user *user_linfo; -+ -+ user_linfo = u64_to_user_ptr(info.line_info); -+ ulen = min_t(u32, info.nr_line_info, ulen); -+ if (copy_to_user(user_linfo, prog->aux->linfo, -+ info.line_info_rec_size * ulen)) -+ return -EFAULT; -+ } - -- /* If we're handed a bigger struct than we know of, -- * ensure all the unknown bits are 0 - i.e. new -- * user-space does not rely on any kernel feature -- * extensions we dont know about yet. -- */ -- if (size > sizeof(attr)) { -- unsigned char __user *addr; -- unsigned char __user *end; -- unsigned char val; -- -- addr = (void __user *)uattr + sizeof(attr); -- end = (void __user *)uattr + size; -- -- for (; addr < end; addr++) { -- err = get_user(val, addr); -- if (err) -- return err; -- if (val) -- return -E2BIG; -+ ulen = info.nr_jited_line_info; -+ if (prog->aux->jited_linfo) -+ info.nr_jited_line_info = prog->aux->nr_linfo; -+ else -+ info.nr_jited_line_info = 0; -+ if (info.nr_jited_line_info && ulen) { -+ if (bpf_dump_raw_ok(file->f_cred)) { -+ __u64 __user *user_linfo; -+ u32 i; -+ -+ user_linfo = u64_to_user_ptr(info.jited_line_info); -+ ulen = min_t(u32, info.nr_jited_line_info, ulen); -+ for (i = 0; i < ulen; i++) { -+ if (put_user((__u64)(long)prog->aux->jited_linfo[i], -+ &user_linfo[i])) -+ return -EFAULT; -+ } -+ } else { -+ info.jited_line_info = 0; - } -- size = sizeof(attr); - } - -+ ulen = info.nr_prog_tags; -+ info.nr_prog_tags = prog->aux->func_cnt ? : 1; -+ if (ulen) { -+ __u8 __user (*user_prog_tags)[BPF_TAG_SIZE]; -+ u32 i; -+ -+ user_prog_tags = u64_to_user_ptr(info.prog_tags); -+ ulen = min_t(u32, info.nr_prog_tags, ulen); -+ if (prog->aux->func_cnt) { -+ for (i = 0; i < ulen; i++) { -+ if (copy_to_user(user_prog_tags[i], -+ prog->aux->func[i]->tag, -+ BPF_TAG_SIZE)) -+ return -EFAULT; -+ } -+ } else { -+ if (copy_to_user(user_prog_tags[0], -+ prog->tag, BPF_TAG_SIZE)) -+ return -EFAULT; -+ } -+ } -+ -+done: -+ if (copy_to_user(uinfo, &info, info_len) || -+ put_user(info_len, &uattr->info.info_len)) -+ return -EFAULT; -+ -+ return 0; -+} -+ -+static int bpf_map_get_info_by_fd(struct file *file, -+ struct bpf_map *map, -+ const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ struct bpf_map_info __user *uinfo = u64_to_user_ptr(attr->info.info); -+ struct bpf_map_info info; -+ u32 info_len = attr->info.info_len; -+ int err; -+ -+ err = bpf_check_uarg_tail_zero(uinfo, sizeof(info), info_len); -+ if (err) -+ return err; -+ info_len = min_t(u32, sizeof(info), info_len); -+ -+ memset(&info, 0, sizeof(info)); -+ info.type = map->map_type; -+ info.id = map->id; -+ info.key_size = map->key_size; -+ info.value_size = map->value_size; -+ info.max_entries = map->max_entries; -+ info.map_flags = map->map_flags; -+ memcpy(info.name, map->name, sizeof(map->name)); -+ -+ if (map->btf) { -+ info.btf_id = btf_id(map->btf); -+ info.btf_key_type_id = map->btf_key_type_id; -+ info.btf_value_type_id = map->btf_value_type_id; -+ } -+ -+ if (copy_to_user(uinfo, &info, info_len) || -+ put_user(info_len, &uattr->info.info_len)) -+ return -EFAULT; -+ -+ return 0; -+} -+ -+static int bpf_btf_get_info_by_fd(struct file *file, -+ struct btf *btf, -+ const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ struct bpf_btf_info __user *uinfo = u64_to_user_ptr(attr->info.info); -+ u32 info_len = attr->info.info_len; -+ int err; -+ -+ err = bpf_check_uarg_tail_zero(uinfo, sizeof(*uinfo), info_len); -+ if (err) -+ return err; -+ -+ return btf_get_info_by_fd(btf, attr, uattr); -+} -+ -+#define BPF_OBJ_GET_INFO_BY_FD_LAST_FIELD info.info -+ -+static int bpf_obj_get_info_by_fd(const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ int ufd = attr->info.bpf_fd; -+ struct fd f; -+ int err; -+ -+ if (CHECK_ATTR(BPF_OBJ_GET_INFO_BY_FD)) -+ return -EINVAL; -+ -+ f = fdget(ufd); -+ if (!f.file) -+ return -EBADFD; -+ -+ if (f.file->f_op == &bpf_prog_fops) -+ err = bpf_prog_get_info_by_fd(f.file, f.file->private_data, attr, -+ uattr); -+ else if (f.file->f_op == &bpf_map_fops) -+ err = bpf_map_get_info_by_fd(f.file, f.file->private_data, attr, -+ uattr); -+ else if (f.file->f_op == &btf_fops) -+ err = bpf_btf_get_info_by_fd(f.file, f.file->private_data, attr, uattr); -+ else -+ err = -EINVAL; -+ -+ fdput(f); -+ return err; -+} -+ -+#define BPF_BTF_LOAD_LAST_FIELD btf_log_level -+ -+static int bpf_btf_load(const union bpf_attr *attr) -+{ -+ if (CHECK_ATTR(BPF_BTF_LOAD)) -+ return -EINVAL; -+ -+ if (!capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ -+ return btf_new_fd(attr); -+} -+ -+#define BPF_BTF_GET_FD_BY_ID_LAST_FIELD btf_id -+ -+static int bpf_btf_get_fd_by_id(const union bpf_attr *attr) -+{ -+ if (CHECK_ATTR(BPF_BTF_GET_FD_BY_ID)) -+ return -EINVAL; -+ -+ if (!capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ -+ return btf_get_fd_by_id(attr->btf_id); -+} -+ -+ -+#define BPF_TASK_FD_QUERY_LAST_FIELD task_fd_query.probe_addr -+ -+SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size) -+{ -+ union bpf_attr attr; -+ int err; -+ -+ if (sysctl_unprivileged_bpf_disabled && !capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ -+ err = bpf_check_uarg_tail_zero(uattr, sizeof(attr), size); -+ if (err) -+ return err; -+ size = min_t(u32, size, sizeof(attr)); -+ - /* copy attributes from user space, may be less than sizeof(bpf_attr) */ -+ memset(&attr, 0, sizeof(attr)); - if (copy_from_user(&attr, uattr, size) != 0) - return -EFAULT; - -@@ -779,8 +2364,11 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf - case BPF_MAP_GET_NEXT_KEY: - err = map_get_next_key(&attr); - break; -+ case BPF_MAP_FREEZE: -+ err = map_freeze(&attr); -+ break; - case BPF_PROG_LOAD: -- err = bpf_prog_load(&attr); -+ err = bpf_prog_load(&attr, uattr); - break; - case BPF_OBJ_PIN: - err = bpf_obj_pin(&attr); -@@ -788,6 +2376,39 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf - case BPF_OBJ_GET: - err = bpf_obj_get(&attr); - break; -+ case BPF_PROG_TEST_RUN: -+ err = bpf_prog_test_run(&attr, uattr); -+ break; -+ case BPF_PROG_GET_NEXT_ID: -+ err = bpf_obj_get_next_id(&attr, uattr, -+ &prog_idr, &prog_idr_lock); -+ break; -+ case BPF_MAP_GET_NEXT_ID: -+ err = bpf_obj_get_next_id(&attr, uattr, -+ &map_idr, &map_idr_lock); -+ break; -+ case BPF_BTF_GET_NEXT_ID: -+ err = bpf_obj_get_next_id(&attr, uattr, -+ &btf_idr, &btf_idr_lock); -+ break; -+ case BPF_PROG_GET_FD_BY_ID: -+ err = bpf_prog_get_fd_by_id(&attr); -+ break; -+ case BPF_MAP_GET_FD_BY_ID: -+ err = bpf_map_get_fd_by_id(&attr); -+ break; -+ case BPF_OBJ_GET_INFO_BY_FD: -+ err = bpf_obj_get_info_by_fd(&attr, uattr); -+ break; -+ case BPF_BTF_LOAD: -+ err = bpf_btf_load(&attr); -+ break; -+ case BPF_BTF_GET_FD_BY_ID: -+ err = bpf_btf_get_fd_by_id(&attr); -+ break; -+ case BPF_MAP_LOOKUP_AND_DELETE_ELEM: -+ err = map_lookup_and_delete_elem(&attr); -+ break; - default: - err = -EINVAL; - break; ---- /dev/null -+++ b/kernel/bpf/sysfs_btf.c -@@ -0,0 +1,45 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Provide kernel BTF information for introspection and use by eBPF tools. -+ */ -+#include -+#include -+#include -+#include -+#include -+ -+/* See scripts/link-vmlinux.sh, gen_btf() func for details */ -+extern char __weak __start_BTF[]; -+extern char __weak __stop_BTF[]; -+ -+static ssize_t -+btf_vmlinux_read(struct file *file, struct kobject *kobj, -+ struct bin_attribute *bin_attr, -+ char *buf, loff_t off, size_t len) -+{ -+ memcpy(buf, __start_BTF + off, len); -+ return len; -+} -+ -+static struct bin_attribute bin_attr_btf_vmlinux __ro_after_init = { -+ .attr = { .name = "vmlinux", .mode = 0444, }, -+ .read = btf_vmlinux_read, -+}; -+ -+static struct kobject *btf_kobj; -+ -+static int __init btf_vmlinux_init(void) -+{ -+ bin_attr_btf_vmlinux.size = __stop_BTF - __start_BTF; -+ -+ if (!__start_BTF || bin_attr_btf_vmlinux.size == 0) -+ return 0; -+ -+ btf_kobj = kobject_create_and_add("btf", kernel_kobj); -+ if (!btf_kobj) -+ return -ENOMEM; -+ -+ return sysfs_create_bin_file(btf_kobj, &bin_attr_btf_vmlinux); -+} -+ -+subsys_initcall(btf_vmlinux_init); ---- /dev/null -+++ b/kernel/bpf/tnum.c -@@ -0,0 +1,196 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* tnum: tracked (or tristate) numbers -+ * -+ * A tnum tracks knowledge about the bits of a value. Each bit can be either -+ * known (0 or 1), or unknown (x). Arithmetic operations on tnums will -+ * propagate the unknown bits such that the tnum result represents all the -+ * possible results for possible values of the operands. -+ */ -+#include -+#include -+ -+#define TNUM(_v, _m) (struct tnum){.value = _v, .mask = _m} -+/* A completely unknown value */ -+const struct tnum tnum_unknown = { .value = 0, .mask = -1 }; -+ -+struct tnum tnum_const(u64 value) -+{ -+ return TNUM(value, 0); -+} -+ -+struct tnum tnum_range(u64 min, u64 max) -+{ -+ u64 chi = min ^ max, delta; -+ u8 bits = fls64(chi); -+ -+ /* special case, needed because 1ULL << 64 is undefined */ -+ if (bits > 63) -+ return tnum_unknown; -+ /* e.g. if chi = 4, bits = 3, delta = (1<<3) - 1 = 7. -+ * if chi = 0, bits = 0, delta = (1<<0) - 1 = 0, so we return -+ * constant min (since min == max). -+ */ -+ delta = (1ULL << bits) - 1; -+ return TNUM(min & ~delta, delta); -+} -+ -+struct tnum tnum_lshift(struct tnum a, u8 shift) -+{ -+ return TNUM(a.value << shift, a.mask << shift); -+} -+ -+struct tnum tnum_rshift(struct tnum a, u8 shift) -+{ -+ return TNUM(a.value >> shift, a.mask >> shift); -+} -+ -+struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness) -+{ -+ /* if a.value is negative, arithmetic shifting by minimum shift -+ * will have larger negative offset compared to more shifting. -+ * If a.value is nonnegative, arithmetic shifting by minimum shift -+ * will have larger positive offset compare to more shifting. -+ */ -+ if (insn_bitness == 32) -+ return TNUM((u32)(((s32)a.value) >> min_shift), -+ (u32)(((s32)a.mask) >> min_shift)); -+ else -+ return TNUM((s64)a.value >> min_shift, -+ (s64)a.mask >> min_shift); -+} -+ -+struct tnum tnum_add(struct tnum a, struct tnum b) -+{ -+ u64 sm, sv, sigma, chi, mu; -+ -+ sm = a.mask + b.mask; -+ sv = a.value + b.value; -+ sigma = sm + sv; -+ chi = sigma ^ sv; -+ mu = chi | a.mask | b.mask; -+ return TNUM(sv & ~mu, mu); -+} -+ -+struct tnum tnum_sub(struct tnum a, struct tnum b) -+{ -+ u64 dv, alpha, beta, chi, mu; -+ -+ dv = a.value - b.value; -+ alpha = dv + a.mask; -+ beta = dv - b.mask; -+ chi = alpha ^ beta; -+ mu = chi | a.mask | b.mask; -+ return TNUM(dv & ~mu, mu); -+} -+ -+struct tnum tnum_and(struct tnum a, struct tnum b) -+{ -+ u64 alpha, beta, v; -+ -+ alpha = a.value | a.mask; -+ beta = b.value | b.mask; -+ v = a.value & b.value; -+ return TNUM(v, alpha & beta & ~v); -+} -+ -+struct tnum tnum_or(struct tnum a, struct tnum b) -+{ -+ u64 v, mu; -+ -+ v = a.value | b.value; -+ mu = a.mask | b.mask; -+ return TNUM(v, mu & ~v); -+} -+ -+struct tnum tnum_xor(struct tnum a, struct tnum b) -+{ -+ u64 v, mu; -+ -+ v = a.value ^ b.value; -+ mu = a.mask | b.mask; -+ return TNUM(v & ~mu, mu); -+} -+ -+/* half-multiply add: acc += (unknown * mask * value). -+ * An intermediate step in the multiply algorithm. -+ */ -+static struct tnum hma(struct tnum acc, u64 value, u64 mask) -+{ -+ while (mask) { -+ if (mask & 1) -+ acc = tnum_add(acc, TNUM(0, value)); -+ mask >>= 1; -+ value <<= 1; -+ } -+ return acc; -+} -+ -+struct tnum tnum_mul(struct tnum a, struct tnum b) -+{ -+ struct tnum acc; -+ u64 pi; -+ -+ pi = a.value * b.value; -+ acc = hma(TNUM(pi, 0), a.mask, b.mask | b.value); -+ return hma(acc, b.mask, a.value); -+} -+ -+/* Note that if a and b disagree - i.e. one has a 'known 1' where the other has -+ * a 'known 0' - this will return a 'known 1' for that bit. -+ */ -+struct tnum tnum_intersect(struct tnum a, struct tnum b) -+{ -+ u64 v, mu; -+ -+ v = a.value | b.value; -+ mu = a.mask & b.mask; -+ return TNUM(v & ~mu, mu); -+} -+ -+struct tnum tnum_cast(struct tnum a, u8 size) -+{ -+ a.value &= (1ULL << (size * 8)) - 1; -+ a.mask &= (1ULL << (size * 8)) - 1; -+ return a; -+} -+ -+bool tnum_is_aligned(struct tnum a, u64 size) -+{ -+ if (!size) -+ return true; -+ return !((a.value | a.mask) & (size - 1)); -+} -+ -+bool tnum_in(struct tnum a, struct tnum b) -+{ -+ if (b.mask & ~a.mask) -+ return false; -+ b.value &= ~a.mask; -+ return a.value == b.value; -+} -+ -+int tnum_strn(char *str, size_t size, struct tnum a) -+{ -+ return snprintf(str, size, "(%#llx; %#llx)", a.value, a.mask); -+} -+EXPORT_SYMBOL_GPL(tnum_strn); -+ -+int tnum_sbin(char *str, size_t size, struct tnum a) -+{ -+ size_t n; -+ -+ for (n = 64; n; n--) { -+ if (n < size) { -+ if (a.mask & 1) -+ str[n - 1] = 'x'; -+ else if (a.value & 1) -+ str[n - 1] = '1'; -+ else -+ str[n - 1] = '0'; -+ } -+ a.mask >>= 1; -+ a.value >>= 1; -+ } -+ str[min(size - 1, (size_t)64)] = 0; -+ return 64; -+} ---- a/kernel/bpf/verifier.c -+++ b/kernel/bpf/verifier.c -@@ -1,22 +1,36 @@ -+// SPDX-License-Identifier: GPL-2.0-only - /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of version 2 of the GNU General Public -- * License as published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, but -- * WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * General Public License for more details. -+ * Copyright (c) 2016 Facebook -+ * Copyright (c) 2018 Covalent IO, Inc. http://covalent.io - */ -+#include - #include - #include - #include - #include -+#include -+#include - #include - #include - #include - #include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "disasm.h" -+ -+static const struct bpf_verifier_ops * const bpf_verifier_ops[] = { -+#define BPF_PROG_TYPE(_id, _name) \ -+ [_id] = & _name ## _verifier_ops, -+#define BPF_MAP_TYPE(_id, _ops) -+#include -+#undef BPF_PROG_TYPE -+#undef BPF_MAP_TYPE -+}; - - /* bpf_check() is a static code analyzer that walks eBPF program - * instruction by instruction and updates register/stack state. -@@ -30,7 +44,7 @@ - * - out of bounds or malformed jumps - * The second pass is all possible path descent from the 1st insn. - * Since it's analyzing all pathes through the program, the length of the -- * analysis is limited to 32k insn, which may be hit even if total number of -+ * analysis is limited to 64k insn, which may be hit even if total number of - * insn is less then 4K, but there are too many branches that change stack/regs. - * Number of 'branches to be analyzed' is limited to 1k - * -@@ -58,13 +72,13 @@ - * (and -20 constant is saved for further stack bounds checking). - * Meaning that this reg is a pointer to stack plus known immediate constant. - * -- * Most of the time the registers have UNKNOWN_VALUE type, which -+ * Most of the time the registers have SCALAR_VALUE type, which - * means the register has some value, but it's not a valid pointer. -- * (like pointer plus pointer becomes UNKNOWN_VALUE type) -+ * (like pointer plus pointer becomes SCALAR_VALUE type) - * - * When verifier sees load or store instructions the type of base register -- * can be: PTR_TO_MAP_VALUE, PTR_TO_CTX, FRAME_PTR. These are three pointer -- * types recognized by check_mem_access() function. -+ * can be: PTR_TO_MAP_VALUE, PTR_TO_CTX, PTR_TO_STACK, PTR_TO_SOCKET. These are -+ * four pointer types recognized by check_mem_access() function. - * - * PTR_TO_MAP_VALUE means that this register is pointing to 'map element value' - * and the range of [ptr, ptr + map's value_size) is accessible. -@@ -123,346 +137,713 @@ - * - * After the call R0 is set to return type of the function and registers R1-R5 - * are set to NOT_INIT to indicate that they are no longer readable. -+ * -+ * The following reference types represent a potential reference to a kernel -+ * resource which, after first being allocated, must be checked and freed by -+ * the BPF program: -+ * - PTR_TO_SOCKET_OR_NULL, PTR_TO_SOCKET -+ * -+ * When the verifier sees a helper call return a reference type, it allocates a -+ * pointer id for the reference and stores it in the current function state. -+ * Similar to the way that PTR_TO_MAP_VALUE_OR_NULL is converted into -+ * PTR_TO_MAP_VALUE, PTR_TO_SOCKET_OR_NULL becomes PTR_TO_SOCKET when the type -+ * passes through a NULL-check conditional. For the branch wherein the state is -+ * changed to CONST_IMM, the verifier releases the reference. -+ * -+ * For each helper function that allocates a reference, such as -+ * bpf_sk_lookup_tcp(), there is a corresponding release function, such as -+ * bpf_sk_release(). When a reference type passes into the release function, -+ * the verifier also releases the reference. If any unchecked or unreleased -+ * reference remains at the end of the program, the verifier rejects it. - */ - --/* types of values stored in eBPF registers */ --enum bpf_reg_type { -- NOT_INIT = 0, /* nothing was written into register */ -- UNKNOWN_VALUE, /* reg doesn't contain a valid pointer */ -- PTR_TO_CTX, /* reg points to bpf_context */ -- CONST_PTR_TO_MAP, /* reg points to struct bpf_map */ -- PTR_TO_MAP_VALUE, /* reg points to map element value */ -- PTR_TO_MAP_VALUE_OR_NULL,/* points to map elem value or NULL */ -- FRAME_PTR, /* reg == frame_pointer */ -- PTR_TO_STACK, /* reg == frame_pointer + imm */ -- CONST_IMM, /* constant integer value */ --}; -- --struct reg_state { -- enum bpf_reg_type type; -- union { -- /* valid when type == CONST_IMM | PTR_TO_STACK */ -- int imm; -- -- /* valid when type == CONST_PTR_TO_MAP | PTR_TO_MAP_VALUE | -- * PTR_TO_MAP_VALUE_OR_NULL -- */ -- struct bpf_map *map_ptr; -- }; --}; -- --enum bpf_stack_slot_type { -- STACK_INVALID, /* nothing was stored in this stack slot */ -- STACK_SPILL, /* register spilled into stack */ -- STACK_MISC /* BPF program wrote some data into this slot */ --}; -- --#define BPF_REG_SIZE 8 /* size of eBPF register in bytes */ -- --/* state of the program: -- * type of all registers and stack info -- */ --struct verifier_state { -- struct reg_state regs[MAX_BPF_REG]; -- u8 stack_slot_type[MAX_BPF_STACK]; -- struct reg_state spilled_regs[MAX_BPF_STACK / BPF_REG_SIZE]; --}; -- --/* linked list of verifier states used to prune search */ --struct verifier_state_list { -- struct verifier_state state; -- struct verifier_state_list *next; --}; -- - /* verifier_state + insn_idx are pushed to stack when branch is encountered */ --struct verifier_stack_elem { -+struct bpf_verifier_stack_elem { - /* verifer state is 'st' - * before processing instruction 'insn_idx' - * and after processing instruction 'prev_insn_idx' - */ -- struct verifier_state st; -+ struct bpf_verifier_state st; - int insn_idx; - int prev_insn_idx; -- struct verifier_stack_elem *next; -+ struct bpf_verifier_stack_elem *next; - }; - --#define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */ -+#define BPF_COMPLEXITY_LIMIT_JMP_SEQ 8192 -+#define BPF_COMPLEXITY_LIMIT_STATES 64 - --/* single container for all structs -- * one verifier_env per bpf_check() call -- */ --struct verifier_env { -- struct bpf_prog *prog; /* eBPF program being verified */ -- struct verifier_stack_elem *head; /* stack of verifier states to be processed */ -- int stack_size; /* number of states to be processed */ -- struct verifier_state cur_state; /* current verifier state */ -- struct verifier_state_list **explored_states; /* search pruning optimization */ -- struct bpf_map *used_maps[MAX_USED_MAPS]; /* array of map's used by eBPF program */ -- u32 used_map_cnt; /* number of used maps */ -- bool allow_ptr_leaks; --}; -+#define BPF_MAP_PTR_UNPRIV 1UL -+#define BPF_MAP_PTR_POISON ((void *)((0xeB9FUL << 1) + \ -+ POISON_POINTER_DELTA)) -+#define BPF_MAP_PTR(X) ((struct bpf_map *)((X) & ~BPF_MAP_PTR_UNPRIV)) - --/* verbose verifier prints what it's seeing -- * bpf_check() is called under lock, so no race to access these global vars -- */ --static u32 log_level, log_size, log_len; --static char *log_buf; -+static bool bpf_map_ptr_poisoned(const struct bpf_insn_aux_data *aux) -+{ -+ return BPF_MAP_PTR(aux->map_state) == BPF_MAP_PTR_POISON; -+} -+ -+static bool bpf_map_ptr_unpriv(const struct bpf_insn_aux_data *aux) -+{ -+ return aux->map_state & BPF_MAP_PTR_UNPRIV; -+} -+ -+static void bpf_map_ptr_store(struct bpf_insn_aux_data *aux, -+ const struct bpf_map *map, bool unpriv) -+{ -+ BUILD_BUG_ON((unsigned long)BPF_MAP_PTR_POISON & BPF_MAP_PTR_UNPRIV); -+ unpriv |= bpf_map_ptr_unpriv(aux); -+ aux->map_state = (unsigned long)map | -+ (unpriv ? BPF_MAP_PTR_UNPRIV : 0UL); -+} -+ -+struct bpf_call_arg_meta { -+ struct bpf_map *map_ptr; -+ bool raw_mode; -+ bool pkt_access; -+ int regno; -+ int access_size; -+ u64 msize_max_value; -+ int ref_obj_id; -+ int func_id; -+}; - - static DEFINE_MUTEX(bpf_verifier_lock); - -+static const struct bpf_line_info * -+find_linfo(const struct bpf_verifier_env *env, u32 insn_off) -+{ -+ const struct bpf_line_info *linfo; -+ const struct bpf_prog *prog; -+ u32 i, nr_linfo; -+ -+ prog = env->prog; -+ nr_linfo = prog->aux->nr_linfo; -+ -+ if (!nr_linfo || insn_off >= prog->len) -+ return NULL; -+ -+ linfo = prog->aux->linfo; -+ for (i = 1; i < nr_linfo; i++) -+ if (insn_off < linfo[i].insn_off) -+ break; -+ -+ return &linfo[i - 1]; -+} -+ -+void bpf_verifier_vlog(struct bpf_verifier_log *log, const char *fmt, -+ va_list args) -+{ -+ unsigned int n; -+ -+ n = vscnprintf(log->kbuf, BPF_VERIFIER_TMP_LOG_SIZE, fmt, args); -+ -+ WARN_ONCE(n >= BPF_VERIFIER_TMP_LOG_SIZE - 1, -+ "verifier log line truncated - local buffer too short\n"); -+ -+ n = min(log->len_total - log->len_used - 1, n); -+ log->kbuf[n] = '\0'; -+ -+ if (!copy_to_user(log->ubuf + log->len_used, log->kbuf, n + 1)) -+ log->len_used += n; -+ else -+ log->ubuf = NULL; -+} -+ - /* log_level controls verbosity level of eBPF verifier. -- * verbose() is used to dump the verification trace to the log, so the user -- * can figure out what's wrong with the program -+ * bpf_verifier_log_write() is used to dump the verification trace to the log, -+ * so the user can figure out what's wrong with the program - */ --static __printf(1, 2) void verbose(const char *fmt, ...) -+__printf(2, 3) void bpf_verifier_log_write(struct bpf_verifier_env *env, -+ const char *fmt, ...) - { - va_list args; - -- if (log_level == 0 || log_len >= log_size - 1) -+ if (!bpf_verifier_log_needed(&env->log)) - return; - - va_start(args, fmt); -- log_len += vscnprintf(log_buf + log_len, log_size - log_len, fmt, args); -+ bpf_verifier_vlog(&env->log, fmt, args); - va_end(args); - } -+EXPORT_SYMBOL_GPL(bpf_verifier_log_write); -+ -+__printf(2, 3) static void verbose(void *private_data, const char *fmt, ...) -+{ -+ struct bpf_verifier_env *env = private_data; -+ va_list args; -+ -+ if (!bpf_verifier_log_needed(&env->log)) -+ return; -+ -+ va_start(args, fmt); -+ bpf_verifier_vlog(&env->log, fmt, args); -+ va_end(args); -+} -+ -+static const char *ltrim(const char *s) -+{ -+ while (isspace(*s)) -+ s++; -+ -+ return s; -+} -+ -+__printf(3, 4) static void verbose_linfo(struct bpf_verifier_env *env, -+ u32 insn_off, -+ const char *prefix_fmt, ...) -+{ -+ const struct bpf_line_info *linfo; -+ -+ if (!bpf_verifier_log_needed(&env->log)) -+ return; -+ -+ linfo = find_linfo(env, insn_off); -+ if (!linfo || linfo == env->prev_linfo) -+ return; -+ -+ if (prefix_fmt) { -+ va_list args; -+ -+ va_start(args, prefix_fmt); -+ bpf_verifier_vlog(&env->log, prefix_fmt, args); -+ va_end(args); -+ } -+ -+ verbose(env, "%s\n", -+ ltrim(btf_name_by_offset(env->prog->aux->btf, -+ linfo->line_off))); -+ -+ env->prev_linfo = linfo; -+} -+ -+static bool type_is_pkt_pointer(enum bpf_reg_type type) -+{ -+ return type == PTR_TO_PACKET || -+ type == PTR_TO_PACKET_META; -+} -+ -+static bool type_is_sk_pointer(enum bpf_reg_type type) -+{ -+ return type == PTR_TO_SOCKET || -+ type == PTR_TO_SOCK_COMMON || -+ type == PTR_TO_TCP_SOCK || -+ type == PTR_TO_XDP_SOCK; -+} -+ -+static bool reg_type_may_be_null(enum bpf_reg_type type) -+{ -+ return type == PTR_TO_MAP_VALUE_OR_NULL || -+ type == PTR_TO_SOCKET_OR_NULL || -+ type == PTR_TO_SOCK_COMMON_OR_NULL || -+ type == PTR_TO_TCP_SOCK_OR_NULL; -+} -+ -+static bool reg_may_point_to_spin_lock(const struct bpf_reg_state *reg) -+{ -+ return reg->type == PTR_TO_MAP_VALUE && -+ map_value_has_spin_lock(reg->map_ptr); -+} -+ -+static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) -+{ -+ return type == PTR_TO_SOCKET || -+ type == PTR_TO_SOCKET_OR_NULL || -+ type == PTR_TO_TCP_SOCK || -+ type == PTR_TO_TCP_SOCK_OR_NULL; -+} -+ -+static bool arg_type_may_be_refcounted(enum bpf_arg_type type) -+{ -+ return type == ARG_PTR_TO_SOCK_COMMON; -+} -+ -+/* Determine whether the function releases some resources allocated by another -+ * function call. The first reference type argument will be assumed to be -+ * released by release_reference(). -+ */ -+static bool is_release_function(enum bpf_func_id func_id) -+{ -+ return func_id == BPF_FUNC_sk_release; -+} -+ -+static bool is_acquire_function(enum bpf_func_id func_id) -+{ -+ return func_id == BPF_FUNC_sk_lookup_tcp || -+ func_id == BPF_FUNC_sk_lookup_udp || -+ func_id == BPF_FUNC_skc_lookup_tcp; -+} -+ -+static bool is_ptr_cast_function(enum bpf_func_id func_id) -+{ -+ return func_id == BPF_FUNC_tcp_sock || -+ func_id == BPF_FUNC_sk_fullsock; -+} - - /* string representation of 'enum bpf_reg_type' */ - static const char * const reg_type_str[] = { - [NOT_INIT] = "?", -- [UNKNOWN_VALUE] = "inv", -+ [SCALAR_VALUE] = "inv", - [PTR_TO_CTX] = "ctx", - [CONST_PTR_TO_MAP] = "map_ptr", - [PTR_TO_MAP_VALUE] = "map_value", - [PTR_TO_MAP_VALUE_OR_NULL] = "map_value_or_null", -- [FRAME_PTR] = "fp", - [PTR_TO_STACK] = "fp", -- [CONST_IMM] = "imm", -+ [PTR_TO_PACKET] = "pkt", -+ [PTR_TO_PACKET_META] = "pkt_meta", -+ [PTR_TO_PACKET_END] = "pkt_end", -+ [PTR_TO_FLOW_KEYS] = "flow_keys", -+ [PTR_TO_SOCKET] = "sock", -+ [PTR_TO_SOCKET_OR_NULL] = "sock_or_null", -+ [PTR_TO_SOCK_COMMON] = "sock_common", -+ [PTR_TO_SOCK_COMMON_OR_NULL] = "sock_common_or_null", -+ [PTR_TO_TCP_SOCK] = "tcp_sock", -+ [PTR_TO_TCP_SOCK_OR_NULL] = "tcp_sock_or_null", -+ [PTR_TO_TP_BUFFER] = "tp_buffer", -+ [PTR_TO_XDP_SOCK] = "xdp_sock", - }; - --static void print_verifier_state(struct verifier_env *env) -+static char slot_type_char[] = { -+ [STACK_INVALID] = '?', -+ [STACK_SPILL] = 'r', -+ [STACK_MISC] = 'm', -+ [STACK_ZERO] = '0', -+}; -+ -+static void print_liveness(struct bpf_verifier_env *env, -+ enum bpf_reg_liveness live) -+{ -+ if (live & (REG_LIVE_READ | REG_LIVE_WRITTEN | REG_LIVE_DONE)) -+ verbose(env, "_"); -+ if (live & REG_LIVE_READ) -+ verbose(env, "r"); -+ if (live & REG_LIVE_WRITTEN) -+ verbose(env, "w"); -+ if (live & REG_LIVE_DONE) -+ verbose(env, "D"); -+} -+ -+static struct bpf_func_state *func(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg) - { -+ struct bpf_verifier_state *cur = env->cur_state; -+ -+ return cur->frame[reg->frameno]; -+} -+ -+static void print_verifier_state(struct bpf_verifier_env *env, -+ const struct bpf_func_state *state) -+{ -+ const struct bpf_reg_state *reg; - enum bpf_reg_type t; - int i; - -+ if (state->frameno) -+ verbose(env, " frame%d:", state->frameno); - for (i = 0; i < MAX_BPF_REG; i++) { -- t = env->cur_state.regs[i].type; -+ reg = &state->regs[i]; -+ t = reg->type; - if (t == NOT_INIT) - continue; -- verbose(" R%d=%s", i, reg_type_str[t]); -- if (t == CONST_IMM || t == PTR_TO_STACK) -- verbose("%d", env->cur_state.regs[i].imm); -- else if (t == CONST_PTR_TO_MAP || t == PTR_TO_MAP_VALUE || -- t == PTR_TO_MAP_VALUE_OR_NULL) -- verbose("(ks=%d,vs=%d)", -- env->cur_state.regs[i].map_ptr->key_size, -- env->cur_state.regs[i].map_ptr->value_size); -- } -- for (i = 0; i < MAX_BPF_STACK; i += BPF_REG_SIZE) { -- if (env->cur_state.stack_slot_type[i] == STACK_SPILL) -- verbose(" fp%d=%s", -MAX_BPF_STACK + i, -- reg_type_str[env->cur_state.spilled_regs[i / BPF_REG_SIZE].type]); -- } -- verbose("\n"); --} -- --static const char *const bpf_class_string[] = { -- [BPF_LD] = "ld", -- [BPF_LDX] = "ldx", -- [BPF_ST] = "st", -- [BPF_STX] = "stx", -- [BPF_ALU] = "alu", -- [BPF_JMP] = "jmp", -- [BPF_RET] = "BUG", -- [BPF_ALU64] = "alu64", --}; -+ verbose(env, " R%d", i); -+ print_liveness(env, reg->live); -+ verbose(env, "=%s", reg_type_str[t]); -+ if (t == SCALAR_VALUE && reg->precise) -+ verbose(env, "P"); -+ if ((t == SCALAR_VALUE || t == PTR_TO_STACK) && -+ tnum_is_const(reg->var_off)) { -+ /* reg->off should be 0 for SCALAR_VALUE */ -+ verbose(env, "%lld", reg->var_off.value + reg->off); -+ } else { -+ verbose(env, "(id=%d", reg->id); -+ if (reg_type_may_be_refcounted_or_null(t)) -+ verbose(env, ",ref_obj_id=%d", reg->ref_obj_id); -+ if (t != SCALAR_VALUE) -+ verbose(env, ",off=%d", reg->off); -+ if (type_is_pkt_pointer(t)) -+ verbose(env, ",r=%d", reg->range); -+ else if (t == CONST_PTR_TO_MAP || -+ t == PTR_TO_MAP_VALUE || -+ t == PTR_TO_MAP_VALUE_OR_NULL) -+ verbose(env, ",ks=%d,vs=%d", -+ reg->map_ptr->key_size, -+ reg->map_ptr->value_size); -+ if (tnum_is_const(reg->var_off)) { -+ /* Typically an immediate SCALAR_VALUE, but -+ * could be a pointer whose offset is too big -+ * for reg->off -+ */ -+ verbose(env, ",imm=%llx", reg->var_off.value); -+ } else { -+ if (reg->smin_value != reg->umin_value && -+ reg->smin_value != S64_MIN) -+ verbose(env, ",smin_value=%lld", -+ (long long)reg->smin_value); -+ if (reg->smax_value != reg->umax_value && -+ reg->smax_value != S64_MAX) -+ verbose(env, ",smax_value=%lld", -+ (long long)reg->smax_value); -+ if (reg->umin_value != 0) -+ verbose(env, ",umin_value=%llu", -+ (unsigned long long)reg->umin_value); -+ if (reg->umax_value != U64_MAX) -+ verbose(env, ",umax_value=%llu", -+ (unsigned long long)reg->umax_value); -+ if (!tnum_is_unknown(reg->var_off)) { -+ char tn_buf[48]; - --static const char *const bpf_alu_string[16] = { -- [BPF_ADD >> 4] = "+=", -- [BPF_SUB >> 4] = "-=", -- [BPF_MUL >> 4] = "*=", -- [BPF_DIV >> 4] = "/=", -- [BPF_OR >> 4] = "|=", -- [BPF_AND >> 4] = "&=", -- [BPF_LSH >> 4] = "<<=", -- [BPF_RSH >> 4] = ">>=", -- [BPF_NEG >> 4] = "neg", -- [BPF_MOD >> 4] = "%=", -- [BPF_XOR >> 4] = "^=", -- [BPF_MOV >> 4] = "=", -- [BPF_ARSH >> 4] = "s>>=", -- [BPF_END >> 4] = "endian", --}; -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, ",var_off=%s", tn_buf); -+ } -+ } -+ verbose(env, ")"); -+ } -+ } -+ for (i = 0; i < state->allocated_stack / BPF_REG_SIZE; i++) { -+ char types_buf[BPF_REG_SIZE + 1]; -+ bool valid = false; -+ int j; -+ -+ for (j = 0; j < BPF_REG_SIZE; j++) { -+ if (state->stack[i].slot_type[j] != STACK_INVALID) -+ valid = true; -+ types_buf[j] = slot_type_char[ -+ state->stack[i].slot_type[j]]; -+ } -+ types_buf[BPF_REG_SIZE] = 0; -+ if (!valid) -+ continue; -+ verbose(env, " fp%d", (-i - 1) * BPF_REG_SIZE); -+ print_liveness(env, state->stack[i].spilled_ptr.live); -+ if (state->stack[i].slot_type[0] == STACK_SPILL) { -+ reg = &state->stack[i].spilled_ptr; -+ t = reg->type; -+ verbose(env, "=%s", reg_type_str[t]); -+ if (t == SCALAR_VALUE && reg->precise) -+ verbose(env, "P"); -+ if (t == SCALAR_VALUE && tnum_is_const(reg->var_off)) -+ verbose(env, "%lld", reg->var_off.value + reg->off); -+ } else { -+ verbose(env, "=%s", types_buf); -+ } -+ } -+ if (state->acquired_refs && state->refs[0].id) { -+ verbose(env, " refs=%d", state->refs[0].id); -+ for (i = 1; i < state->acquired_refs; i++) -+ if (state->refs[i].id) -+ verbose(env, ",%d", state->refs[i].id); -+ } -+ verbose(env, "\n"); -+} - --static const char *const bpf_ldst_string[] = { -- [BPF_W >> 3] = "u32", -- [BPF_H >> 3] = "u16", -- [BPF_B >> 3] = "u8", -- [BPF_DW >> 3] = "u64", --}; -+#define COPY_STATE_FN(NAME, COUNT, FIELD, SIZE) \ -+static int copy_##NAME##_state(struct bpf_func_state *dst, \ -+ const struct bpf_func_state *src) \ -+{ \ -+ if (!src->FIELD) \ -+ return 0; \ -+ if (WARN_ON_ONCE(dst->COUNT < src->COUNT)) { \ -+ /* internal bug, make state invalid to reject the program */ \ -+ memset(dst, 0, sizeof(*dst)); \ -+ return -EFAULT; \ -+ } \ -+ memcpy(dst->FIELD, src->FIELD, \ -+ sizeof(*src->FIELD) * (src->COUNT / SIZE)); \ -+ return 0; \ -+} -+/* copy_reference_state() */ -+COPY_STATE_FN(reference, acquired_refs, refs, 1) -+/* copy_stack_state() */ -+COPY_STATE_FN(stack, allocated_stack, stack, BPF_REG_SIZE) -+#undef COPY_STATE_FN -+ -+#define REALLOC_STATE_FN(NAME, COUNT, FIELD, SIZE) \ -+static int realloc_##NAME##_state(struct bpf_func_state *state, int size, \ -+ bool copy_old) \ -+{ \ -+ u32 old_size = state->COUNT; \ -+ struct bpf_##NAME##_state *new_##FIELD; \ -+ int slot = size / SIZE; \ -+ \ -+ if (size <= old_size || !size) { \ -+ if (copy_old) \ -+ return 0; \ -+ state->COUNT = slot * SIZE; \ -+ if (!size && old_size) { \ -+ kfree(state->FIELD); \ -+ state->FIELD = NULL; \ -+ } \ -+ return 0; \ -+ } \ -+ new_##FIELD = kmalloc_array(slot, sizeof(struct bpf_##NAME##_state), \ -+ GFP_KERNEL); \ -+ if (!new_##FIELD) \ -+ return -ENOMEM; \ -+ if (copy_old) { \ -+ if (state->FIELD) \ -+ memcpy(new_##FIELD, state->FIELD, \ -+ sizeof(*new_##FIELD) * (old_size / SIZE)); \ -+ memset(new_##FIELD + old_size / SIZE, 0, \ -+ sizeof(*new_##FIELD) * (size - old_size) / SIZE); \ -+ } \ -+ state->COUNT = slot * SIZE; \ -+ kfree(state->FIELD); \ -+ state->FIELD = new_##FIELD; \ -+ return 0; \ -+} -+/* realloc_reference_state() */ -+REALLOC_STATE_FN(reference, acquired_refs, refs, 1) -+/* realloc_stack_state() */ -+REALLOC_STATE_FN(stack, allocated_stack, stack, BPF_REG_SIZE) -+#undef REALLOC_STATE_FN -+ -+/* do_check() starts with zero-sized stack in struct bpf_verifier_state to -+ * make it consume minimal amount of memory. check_stack_write() access from -+ * the program calls into realloc_func_state() to grow the stack size. -+ * Note there is a non-zero 'parent' pointer inside bpf_verifier_state -+ * which realloc_stack_state() copies over. It points to previous -+ * bpf_verifier_state which is never reallocated. -+ */ -+static int realloc_func_state(struct bpf_func_state *state, int stack_size, -+ int refs_size, bool copy_old) -+{ -+ int err = realloc_reference_state(state, refs_size, copy_old); -+ if (err) -+ return err; -+ return realloc_stack_state(state, stack_size, copy_old); -+} - --static const char *const bpf_jmp_string[16] = { -- [BPF_JA >> 4] = "jmp", -- [BPF_JEQ >> 4] = "==", -- [BPF_JGT >> 4] = ">", -- [BPF_JGE >> 4] = ">=", -- [BPF_JSET >> 4] = "&", -- [BPF_JNE >> 4] = "!=", -- [BPF_JSGT >> 4] = "s>", -- [BPF_JSGE >> 4] = "s>=", -- [BPF_CALL >> 4] = "call", -- [BPF_EXIT >> 4] = "exit", --}; -+/* Acquire a pointer id from the env and update the state->refs to include -+ * this new pointer reference. -+ * On success, returns a valid pointer id to associate with the register -+ * On failure, returns a negative errno. -+ */ -+static int acquire_reference_state(struct bpf_verifier_env *env, int insn_idx) -+{ -+ struct bpf_func_state *state = cur_func(env); -+ int new_ofs = state->acquired_refs; -+ int id, err; - --static void print_bpf_insn(const struct verifier_env *env, -- const struct bpf_insn *insn) -+ err = realloc_reference_state(state, state->acquired_refs + 1, true); -+ if (err) -+ return err; -+ id = ++env->id_gen; -+ state->refs[new_ofs].id = id; -+ state->refs[new_ofs].insn_idx = insn_idx; -+ -+ return id; -+} -+ -+/* release function corresponding to acquire_reference_state(). Idempotent. */ -+static int release_reference_state(struct bpf_func_state *state, int ptr_id) - { -- u8 class = BPF_CLASS(insn->code); -+ int i, last_idx; - -- if (class == BPF_ALU || class == BPF_ALU64) { -- if (BPF_SRC(insn->code) == BPF_X) -- verbose("(%02x) %sr%d %s %sr%d\n", -- insn->code, class == BPF_ALU ? "(u32) " : "", -- insn->dst_reg, -- bpf_alu_string[BPF_OP(insn->code) >> 4], -- class == BPF_ALU ? "(u32) " : "", -- insn->src_reg); -- else -- verbose("(%02x) %sr%d %s %s%d\n", -- insn->code, class == BPF_ALU ? "(u32) " : "", -- insn->dst_reg, -- bpf_alu_string[BPF_OP(insn->code) >> 4], -- class == BPF_ALU ? "(u32) " : "", -- insn->imm); -- } else if (class == BPF_STX) { -- if (BPF_MODE(insn->code) == BPF_MEM) -- verbose("(%02x) *(%s *)(r%d %+d) = r%d\n", -- insn->code, -- bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -- insn->dst_reg, -- insn->off, insn->src_reg); -- else if (BPF_MODE(insn->code) == BPF_XADD) -- verbose("(%02x) lock *(%s *)(r%d %+d) += r%d\n", -- insn->code, -- bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -- insn->dst_reg, insn->off, -- insn->src_reg); -- else -- verbose("BUG_%02x\n", insn->code); -- } else if (class == BPF_ST) { -- if (BPF_MODE(insn->code) != BPF_MEM) { -- verbose("BUG_st_%02x\n", insn->code); -- return; -- } -- verbose("(%02x) *(%s *)(r%d %+d) = %d\n", -- insn->code, -- bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -- insn->dst_reg, -- insn->off, insn->imm); -- } else if (class == BPF_LDX) { -- if (BPF_MODE(insn->code) != BPF_MEM) { -- verbose("BUG_ldx_%02x\n", insn->code); -- return; -+ last_idx = state->acquired_refs - 1; -+ for (i = 0; i < state->acquired_refs; i++) { -+ if (state->refs[i].id == ptr_id) { -+ if (last_idx && i != last_idx) -+ memcpy(&state->refs[i], &state->refs[last_idx], -+ sizeof(*state->refs)); -+ memset(&state->refs[last_idx], 0, sizeof(*state->refs)); -+ state->acquired_refs--; -+ return 0; - } -- verbose("(%02x) r%d = *(%s *)(r%d %+d)\n", -- insn->code, insn->dst_reg, -- bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -- insn->src_reg, insn->off); -- } else if (class == BPF_LD) { -- if (BPF_MODE(insn->code) == BPF_ABS) { -- verbose("(%02x) r0 = *(%s *)skb[%d]\n", -- insn->code, -- bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -- insn->imm); -- } else if (BPF_MODE(insn->code) == BPF_IND) { -- verbose("(%02x) r0 = *(%s *)skb[r%d + %d]\n", -- insn->code, -- bpf_ldst_string[BPF_SIZE(insn->code) >> 3], -- insn->src_reg, insn->imm); -- } else if (BPF_MODE(insn->code) == BPF_IMM && -- BPF_SIZE(insn->code) == BPF_DW) { -- /* At this point, we already made sure that the second -- * part of the ldimm64 insn is accessible. -- */ -- u64 imm = ((u64)(insn + 1)->imm << 32) | (u32)insn->imm; -- bool map_ptr = insn->src_reg == BPF_PSEUDO_MAP_FD; -+ } -+ return -EINVAL; -+} - -- if (map_ptr && !env->allow_ptr_leaks) -- imm = 0; -+static int transfer_reference_state(struct bpf_func_state *dst, -+ struct bpf_func_state *src) -+{ -+ int err = realloc_reference_state(dst, src->acquired_refs, false); -+ if (err) -+ return err; -+ err = copy_reference_state(dst, src); -+ if (err) -+ return err; -+ return 0; -+} - -- verbose("(%02x) r%d = 0x%llx\n", insn->code, -- insn->dst_reg, (unsigned long long)imm); -- } else { -- verbose("BUG_ld_%02x\n", insn->code); -- return; -- } -- } else if (class == BPF_JMP) { -- u8 opcode = BPF_OP(insn->code); -+static void free_func_state(struct bpf_func_state *state) -+{ -+ if (!state) -+ return; -+ kfree(state->refs); -+ kfree(state->stack); -+ kfree(state); -+} - -- if (opcode == BPF_CALL) { -- verbose("(%02x) call %d\n", insn->code, insn->imm); -- } else if (insn->code == (BPF_JMP | BPF_JA)) { -- verbose("(%02x) goto pc%+d\n", -- insn->code, insn->off); -- } else if (insn->code == (BPF_JMP | BPF_EXIT)) { -- verbose("(%02x) exit\n", insn->code); -- } else if (BPF_SRC(insn->code) == BPF_X) { -- verbose("(%02x) if r%d %s r%d goto pc%+d\n", -- insn->code, insn->dst_reg, -- bpf_jmp_string[BPF_OP(insn->code) >> 4], -- insn->src_reg, insn->off); -- } else { -- verbose("(%02x) if r%d %s 0x%x goto pc%+d\n", -- insn->code, insn->dst_reg, -- bpf_jmp_string[BPF_OP(insn->code) >> 4], -- insn->imm, insn->off); -+static void clear_jmp_history(struct bpf_verifier_state *state) -+{ -+ kfree(state->jmp_history); -+ state->jmp_history = NULL; -+ state->jmp_history_cnt = 0; -+} -+ -+static void free_verifier_state(struct bpf_verifier_state *state, -+ bool free_self) -+{ -+ int i; -+ -+ for (i = 0; i <= state->curframe; i++) { -+ free_func_state(state->frame[i]); -+ state->frame[i] = NULL; -+ } -+ clear_jmp_history(state); -+ if (free_self) -+ kfree(state); -+} -+ -+/* copy verifier state from src to dst growing dst stack space -+ * when necessary to accommodate larger src stack -+ */ -+static int copy_func_state(struct bpf_func_state *dst, -+ const struct bpf_func_state *src) -+{ -+ int err; -+ -+ err = realloc_func_state(dst, src->allocated_stack, src->acquired_refs, -+ false); -+ if (err) -+ return err; -+ memcpy(dst, src, offsetof(struct bpf_func_state, acquired_refs)); -+ err = copy_reference_state(dst, src); -+ if (err) -+ return err; -+ return copy_stack_state(dst, src); -+} -+ -+static int copy_verifier_state(struct bpf_verifier_state *dst_state, -+ const struct bpf_verifier_state *src) -+{ -+ struct bpf_func_state *dst; -+ u32 jmp_sz = sizeof(struct bpf_idx_pair) * src->jmp_history_cnt; -+ int i, err; -+ -+ if (dst_state->jmp_history_cnt < src->jmp_history_cnt) { -+ kfree(dst_state->jmp_history); -+ dst_state->jmp_history = kmalloc(jmp_sz, GFP_USER); -+ if (!dst_state->jmp_history) -+ return -ENOMEM; -+ } -+ memcpy(dst_state->jmp_history, src->jmp_history, jmp_sz); -+ dst_state->jmp_history_cnt = src->jmp_history_cnt; -+ -+ /* if dst has more stack frames then src frame, free them */ -+ for (i = src->curframe + 1; i <= dst_state->curframe; i++) { -+ free_func_state(dst_state->frame[i]); -+ dst_state->frame[i] = NULL; -+ } -+ dst_state->speculative = src->speculative; -+ dst_state->curframe = src->curframe; -+ dst_state->active_spin_lock = src->active_spin_lock; -+ dst_state->branches = src->branches; -+ dst_state->parent = src->parent; -+ dst_state->first_insn_idx = src->first_insn_idx; -+ dst_state->last_insn_idx = src->last_insn_idx; -+ for (i = 0; i <= src->curframe; i++) { -+ dst = dst_state->frame[i]; -+ if (!dst) { -+ dst = kzalloc(sizeof(*dst), GFP_KERNEL); -+ if (!dst) -+ return -ENOMEM; -+ dst_state->frame[i] = dst; - } -- } else { -- verbose("(%02x) %s\n", insn->code, bpf_class_string[class]); -+ err = copy_func_state(dst, src->frame[i]); -+ if (err) -+ return err; - } -+ return 0; - } - --static int pop_stack(struct verifier_env *env, int *prev_insn_idx) -+static void update_branch_counts(struct bpf_verifier_env *env, struct bpf_verifier_state *st) - { -- struct verifier_stack_elem *elem; -- int insn_idx; -+ while (st) { -+ u32 br = --st->branches; -+ -+ /* WARN_ON(br > 1) technically makes sense here, -+ * but see comment in push_stack(), hence: -+ */ -+ WARN_ONCE((int)br < 0, -+ "BUG update_branch_counts:branches_to_explore=%d\n", -+ br); -+ if (br) -+ break; -+ st = st->parent; -+ } -+} -+ -+static int pop_stack(struct bpf_verifier_env *env, int *prev_insn_idx, -+ int *insn_idx) -+{ -+ struct bpf_verifier_state *cur = env->cur_state; -+ struct bpf_verifier_stack_elem *elem, *head = env->head; -+ int err; - - if (env->head == NULL) -- return -1; -+ return -ENOENT; - -- memcpy(&env->cur_state, &env->head->st, sizeof(env->cur_state)); -- insn_idx = env->head->insn_idx; -+ if (cur) { -+ err = copy_verifier_state(cur, &head->st); -+ if (err) -+ return err; -+ } -+ if (insn_idx) -+ *insn_idx = head->insn_idx; - if (prev_insn_idx) -- *prev_insn_idx = env->head->prev_insn_idx; -- elem = env->head->next; -- kfree(env->head); -+ *prev_insn_idx = head->prev_insn_idx; -+ elem = head->next; -+ free_verifier_state(&head->st, false); -+ kfree(head); - env->head = elem; - env->stack_size--; -- return insn_idx; -+ return 0; - } - --static struct verifier_state *push_stack(struct verifier_env *env, int insn_idx, -- int prev_insn_idx) -+static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env, -+ int insn_idx, int prev_insn_idx, -+ bool speculative) - { -- struct verifier_stack_elem *elem; -+ struct bpf_verifier_state *cur = env->cur_state; -+ struct bpf_verifier_stack_elem *elem; -+ int err; - -- elem = kmalloc(sizeof(struct verifier_stack_elem), GFP_KERNEL); -+ elem = kzalloc(sizeof(struct bpf_verifier_stack_elem), GFP_KERNEL); - if (!elem) - goto err; - -- memcpy(&elem->st, &env->cur_state, sizeof(env->cur_state)); - elem->insn_idx = insn_idx; - elem->prev_insn_idx = prev_insn_idx; - elem->next = env->head; - env->head = elem; - env->stack_size++; -- if (env->stack_size > 1024) { -- verbose("BPF program is too complex\n"); -+ err = copy_verifier_state(&elem->st, cur); -+ if (err) -+ goto err; -+ elem->st.speculative |= speculative; -+ if (env->stack_size > BPF_COMPLEXITY_LIMIT_JMP_SEQ) { -+ verbose(env, "The sequence of %d jumps is too complex.\n", -+ env->stack_size); - goto err; - } -+ if (elem->st.parent) { -+ ++elem->st.parent->branches; -+ /* WARN_ON(branches > 2) technically makes sense here, -+ * but -+ * 1. speculative states will bump 'branches' for non-branch -+ * instructions -+ * 2. is_state_visited() heuristics may decide not to create -+ * a new state for a sequence of branches and all such current -+ * and cloned states will be pointing to a single parent state -+ * which might have large 'branches' count. -+ */ -+ } - return &elem->st; - err: -+ free_verifier_state(env->cur_state, true); -+ env->cur_state = NULL; - /* pop all elements and return */ -- while (pop_stack(env, NULL) >= 0); -+ while (!pop_stack(env, NULL, NULL)); - return NULL; - } - -@@ -471,29 +852,225 @@ static const int caller_saved[CALLER_SAV - BPF_REG_0, BPF_REG_1, BPF_REG_2, BPF_REG_3, BPF_REG_4, BPF_REG_5 - }; - --static void init_reg_state(struct reg_state *regs) -+static void __mark_reg_not_init(const struct bpf_verifier_env *env, -+ struct bpf_reg_state *reg); -+ -+/* Mark the unknown part of a register (variable offset or scalar value) as -+ * known to have the value @imm. -+ */ -+static void __mark_reg_known(struct bpf_reg_state *reg, u64 imm) -+{ -+ /* Clear id, off, and union(map_ptr, range) */ -+ memset(((u8 *)reg) + sizeof(reg->type), 0, -+ offsetof(struct bpf_reg_state, var_off) - sizeof(reg->type)); -+ reg->var_off = tnum_const(imm); -+ reg->smin_value = (s64)imm; -+ reg->smax_value = (s64)imm; -+ reg->umin_value = imm; -+ reg->umax_value = imm; -+} -+ -+/* Mark the 'variable offset' part of a register as zero. This should be -+ * used only on registers holding a pointer type. -+ */ -+static void __mark_reg_known_zero(struct bpf_reg_state *reg) -+{ -+ __mark_reg_known(reg, 0); -+} -+ -+static void __mark_reg_const_zero(struct bpf_reg_state *reg) -+{ -+ __mark_reg_known(reg, 0); -+ reg->type = SCALAR_VALUE; -+} -+ -+static void mark_reg_known_zero(struct bpf_verifier_env *env, -+ struct bpf_reg_state *regs, u32 regno) -+{ -+ if (WARN_ON(regno >= MAX_BPF_REG)) { -+ verbose(env, "mark_reg_known_zero(regs, %u)\n", regno); -+ /* Something bad happened, let's kill all regs */ -+ for (regno = 0; regno < MAX_BPF_REG; regno++) -+ __mark_reg_not_init(env, regs + regno); -+ return; -+ } -+ __mark_reg_known_zero(regs + regno); -+} -+ -+static bool reg_is_pkt_pointer(const struct bpf_reg_state *reg) -+{ -+ return type_is_pkt_pointer(reg->type); -+} -+ -+static bool reg_is_pkt_pointer_any(const struct bpf_reg_state *reg) -+{ -+ return reg_is_pkt_pointer(reg) || -+ reg->type == PTR_TO_PACKET_END; -+} -+ -+/* Unmodified PTR_TO_PACKET[_META,_END] register from ctx access. */ -+static bool reg_is_init_pkt_pointer(const struct bpf_reg_state *reg, -+ enum bpf_reg_type which) -+{ -+ /* The register can already have a range from prior markings. -+ * This is fine as long as it hasn't been advanced from its -+ * origin. -+ */ -+ return reg->type == which && -+ reg->id == 0 && -+ reg->off == 0 && -+ tnum_equals_const(reg->var_off, 0); -+} -+ -+/* Attempts to improve min/max values based on var_off information */ -+static void __update_reg_bounds(struct bpf_reg_state *reg) -+{ -+ /* min signed is max(sign bit) | min(other bits) */ -+ reg->smin_value = max_t(s64, reg->smin_value, -+ reg->var_off.value | (reg->var_off.mask & S64_MIN)); -+ /* max signed is min(sign bit) | max(other bits) */ -+ reg->smax_value = min_t(s64, reg->smax_value, -+ reg->var_off.value | (reg->var_off.mask & S64_MAX)); -+ reg->umin_value = max(reg->umin_value, reg->var_off.value); -+ reg->umax_value = min(reg->umax_value, -+ reg->var_off.value | reg->var_off.mask); -+} -+ -+/* Uses signed min/max values to inform unsigned, and vice-versa */ -+static void __reg_deduce_bounds(struct bpf_reg_state *reg) - { -+ /* Learn sign from signed bounds. -+ * If we cannot cross the sign boundary, then signed and unsigned bounds -+ * are the same, so combine. This works even in the negative case, e.g. -+ * -3 s<= x s<= -1 implies 0xf...fd u<= x u<= 0xf...ff. -+ */ -+ if (reg->smin_value >= 0 || reg->smax_value < 0) { -+ reg->smin_value = reg->umin_value = max_t(u64, reg->smin_value, -+ reg->umin_value); -+ reg->smax_value = reg->umax_value = min_t(u64, reg->smax_value, -+ reg->umax_value); -+ return; -+ } -+ /* Learn sign from unsigned bounds. Signed bounds cross the sign -+ * boundary, so we must be careful. -+ */ -+ if ((s64)reg->umax_value >= 0) { -+ /* Positive. We can't learn anything from the smin, but smax -+ * is positive, hence safe. -+ */ -+ reg->smin_value = reg->umin_value; -+ reg->smax_value = reg->umax_value = min_t(u64, reg->smax_value, -+ reg->umax_value); -+ } else if ((s64)reg->umin_value < 0) { -+ /* Negative. We can't learn anything from the smax, but smin -+ * is negative, hence safe. -+ */ -+ reg->smin_value = reg->umin_value = max_t(u64, reg->smin_value, -+ reg->umin_value); -+ reg->smax_value = reg->umax_value; -+ } -+} -+ -+/* Attempts to improve var_off based on unsigned min/max information */ -+static void __reg_bound_offset(struct bpf_reg_state *reg) -+{ -+ reg->var_off = tnum_intersect(reg->var_off, -+ tnum_range(reg->umin_value, -+ reg->umax_value)); -+} -+ -+/* Reset the min/max bounds of a register */ -+static void __mark_reg_unbounded(struct bpf_reg_state *reg) -+{ -+ reg->smin_value = S64_MIN; -+ reg->smax_value = S64_MAX; -+ reg->umin_value = 0; -+ reg->umax_value = U64_MAX; -+} -+ -+/* Mark a register as having a completely unknown (scalar) value. */ -+static void __mark_reg_unknown(const struct bpf_verifier_env *env, -+ struct bpf_reg_state *reg) -+{ -+ /* -+ * Clear type, id, off, and union(map_ptr, range) and -+ * padding between 'type' and union -+ */ -+ memset(reg, 0, offsetof(struct bpf_reg_state, var_off)); -+ reg->type = SCALAR_VALUE; -+ reg->var_off = tnum_unknown; -+ reg->frameno = 0; -+ reg->precise = env->subprog_cnt > 1 || !env->allow_ptr_leaks ? -+ true : false; -+ __mark_reg_unbounded(reg); -+} -+ -+static void mark_reg_unknown(struct bpf_verifier_env *env, -+ struct bpf_reg_state *regs, u32 regno) -+{ -+ if (WARN_ON(regno >= MAX_BPF_REG)) { -+ verbose(env, "mark_reg_unknown(regs, %u)\n", regno); -+ /* Something bad happened, let's kill all regs except FP */ -+ for (regno = 0; regno < BPF_REG_FP; regno++) -+ __mark_reg_not_init(env, regs + regno); -+ return; -+ } -+ __mark_reg_unknown(env, regs + regno); -+} -+ -+static void __mark_reg_not_init(const struct bpf_verifier_env *env, -+ struct bpf_reg_state *reg) -+{ -+ __mark_reg_unknown(env, reg); -+ reg->type = NOT_INIT; -+} -+ -+static void mark_reg_not_init(struct bpf_verifier_env *env, -+ struct bpf_reg_state *regs, u32 regno) -+{ -+ if (WARN_ON(regno >= MAX_BPF_REG)) { -+ verbose(env, "mark_reg_not_init(regs, %u)\n", regno); -+ /* Something bad happened, let's kill all regs except FP */ -+ for (regno = 0; regno < BPF_REG_FP; regno++) -+ __mark_reg_not_init(env, regs + regno); -+ return; -+ } -+ __mark_reg_not_init(env, regs + regno); -+} -+ -+#define DEF_NOT_SUBREG (0) -+static void init_reg_state(struct bpf_verifier_env *env, -+ struct bpf_func_state *state) -+{ -+ struct bpf_reg_state *regs = state->regs; - int i; - - for (i = 0; i < MAX_BPF_REG; i++) { -- regs[i].type = NOT_INIT; -- regs[i].imm = 0; -- regs[i].map_ptr = NULL; -+ mark_reg_not_init(env, regs, i); -+ regs[i].live = REG_LIVE_NONE; -+ regs[i].parent = NULL; -+ regs[i].subreg_def = DEF_NOT_SUBREG; - } - - /* frame pointer */ -- regs[BPF_REG_FP].type = FRAME_PTR; -+ regs[BPF_REG_FP].type = PTR_TO_STACK; -+ mark_reg_known_zero(env, regs, BPF_REG_FP); -+ regs[BPF_REG_FP].frameno = state->frameno; - - /* 1st arg to a function */ - regs[BPF_REG_1].type = PTR_TO_CTX; -+ mark_reg_known_zero(env, regs, BPF_REG_1); - } - --static void mark_reg_unknown_value(struct reg_state *regs, u32 regno) -+#define BPF_MAIN_FUNC (-1) -+static void init_func_state(struct bpf_verifier_env *env, -+ struct bpf_func_state *state, -+ int callsite, int frameno, int subprogno) - { -- BUG_ON(regno >= MAX_BPF_REG); -- regs[regno].type = UNKNOWN_VALUE; -- regs[regno].imm = 0; -- regs[regno].map_ptr = NULL; -+ state->callsite = callsite; -+ state->frameno = frameno; -+ state->subprogno = subprogno; -+ init_reg_state(env, state); - } - - enum reg_arg_type { -@@ -502,44 +1079,760 @@ enum reg_arg_type { - DST_OP_NO_MARK /* same as above, check only, don't mark */ - }; - --static int check_reg_arg(struct reg_state *regs, u32 regno, -+static int cmp_subprogs(const void *a, const void *b) -+{ -+ return ((struct bpf_subprog_info *)a)->start - -+ ((struct bpf_subprog_info *)b)->start; -+} -+ -+static int find_subprog(struct bpf_verifier_env *env, int off) -+{ -+ struct bpf_subprog_info *p; -+ -+ p = bsearch(&off, env->subprog_info, env->subprog_cnt, -+ sizeof(env->subprog_info[0]), cmp_subprogs); -+ if (!p) -+ return -ENOENT; -+ return p - env->subprog_info; -+ -+} -+ -+static int add_subprog(struct bpf_verifier_env *env, int off) -+{ -+ int insn_cnt = env->prog->len; -+ int ret; -+ -+ if (off >= insn_cnt || off < 0) { -+ verbose(env, "call to invalid destination\n"); -+ return -EINVAL; -+ } -+ ret = find_subprog(env, off); -+ if (ret >= 0) -+ return 0; -+ if (env->subprog_cnt >= BPF_MAX_SUBPROGS) { -+ verbose(env, "too many subprograms\n"); -+ return -E2BIG; -+ } -+ env->subprog_info[env->subprog_cnt++].start = off; -+ sort(env->subprog_info, env->subprog_cnt, -+ sizeof(env->subprog_info[0]), cmp_subprogs, NULL); -+ return 0; -+} -+ -+static int check_subprogs(struct bpf_verifier_env *env) -+{ -+ int i, ret, subprog_start, subprog_end, off, cur_subprog = 0; -+ struct bpf_subprog_info *subprog = env->subprog_info; -+ struct bpf_insn *insn = env->prog->insnsi; -+ int insn_cnt = env->prog->len; -+ -+ /* Add entry function. */ -+ ret = add_subprog(env, 0); -+ if (ret < 0) -+ return ret; -+ -+ /* determine subprog starts. The end is one before the next starts */ -+ for (i = 0; i < insn_cnt; i++) { -+ if (insn[i].code != (BPF_JMP | BPF_CALL)) -+ continue; -+ if (insn[i].src_reg != BPF_PSEUDO_CALL) -+ continue; -+ if (!env->allow_ptr_leaks) { -+ verbose(env, "function calls to other bpf functions are allowed for root only\n"); -+ return -EPERM; -+ } -+ ret = add_subprog(env, i + insn[i].imm + 1); -+ if (ret < 0) -+ return ret; -+ } -+ -+ /* Add a fake 'exit' subprog which could simplify subprog iteration -+ * logic. 'subprog_cnt' should not be increased. -+ */ -+ subprog[env->subprog_cnt].start = insn_cnt; -+ -+ if (env->log.level & BPF_LOG_LEVEL2) -+ for (i = 0; i < env->subprog_cnt; i++) -+ verbose(env, "func#%d @%d\n", i, subprog[i].start); -+ -+ /* now check that all jumps are within the same subprog */ -+ subprog_start = subprog[cur_subprog].start; -+ subprog_end = subprog[cur_subprog + 1].start; -+ for (i = 0; i < insn_cnt; i++) { -+ u8 code = insn[i].code; -+ -+ if (code == (BPF_JMP | BPF_CALL) && -+ insn[i].imm == BPF_FUNC_tail_call && -+ insn[i].src_reg != BPF_PSEUDO_CALL) -+ subprog[cur_subprog].has_tail_call = true; -+ if (BPF_CLASS(code) != BPF_JMP && BPF_CLASS(code) != BPF_JMP32) -+ goto next; -+ if (BPF_OP(code) == BPF_EXIT || BPF_OP(code) == BPF_CALL) -+ goto next; -+ off = i + insn[i].off + 1; -+ if (off < subprog_start || off >= subprog_end) { -+ verbose(env, "jump out of range from insn %d to %d\n", i, off); -+ return -EINVAL; -+ } -+next: -+ if (i == subprog_end - 1) { -+ /* to avoid fall-through from one subprog into another -+ * the last insn of the subprog should be either exit -+ * or unconditional jump back -+ */ -+ if (code != (BPF_JMP | BPF_EXIT) && -+ code != (BPF_JMP | BPF_JA)) { -+ verbose(env, "last insn is not an exit or jmp\n"); -+ return -EINVAL; -+ } -+ subprog_start = subprog_end; -+ cur_subprog++; -+ if (cur_subprog < env->subprog_cnt) -+ subprog_end = subprog[cur_subprog + 1].start; -+ } -+ } -+ return 0; -+} -+ -+/* Parentage chain of this register (or stack slot) should take care of all -+ * issues like callee-saved registers, stack slot allocation time, etc. -+ */ -+static int mark_reg_read(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *state, -+ struct bpf_reg_state *parent, u8 flag) -+{ -+ bool writes = parent == state->parent; /* Observe write marks */ -+ int cnt = 0; -+ -+ while (parent) { -+ /* if read wasn't screened by an earlier write ... */ -+ if (writes && state->live & REG_LIVE_WRITTEN) -+ break; -+ if (parent->live & REG_LIVE_DONE) { -+ verbose(env, "verifier BUG type %s var_off %lld off %d\n", -+ reg_type_str[parent->type], -+ parent->var_off.value, parent->off); -+ return -EFAULT; -+ } -+ /* The first condition is more likely to be true than the -+ * second, checked it first. -+ */ -+ if ((parent->live & REG_LIVE_READ) == flag || -+ parent->live & REG_LIVE_READ64) -+ /* The parentage chain never changes and -+ * this parent was already marked as LIVE_READ. -+ * There is no need to keep walking the chain again and -+ * keep re-marking all parents as LIVE_READ. -+ * This case happens when the same register is read -+ * multiple times without writes into it in-between. -+ * Also, if parent has the stronger REG_LIVE_READ64 set, -+ * then no need to set the weak REG_LIVE_READ32. -+ */ -+ break; -+ /* ... then we depend on parent's value */ -+ parent->live |= flag; -+ /* REG_LIVE_READ64 overrides REG_LIVE_READ32. */ -+ if (flag == REG_LIVE_READ64) -+ parent->live &= ~REG_LIVE_READ32; -+ state = parent; -+ parent = state->parent; -+ writes = true; -+ cnt++; -+ } -+ -+ if (env->longest_mark_read_walk < cnt) -+ env->longest_mark_read_walk = cnt; -+ return 0; -+} -+ -+/* This function is supposed to be used by the following 32-bit optimization -+ * code only. It returns TRUE if the source or destination register operates -+ * on 64-bit, otherwise return FALSE. -+ */ -+static bool is_reg64(struct bpf_verifier_env *env, struct bpf_insn *insn, -+ u32 regno, struct bpf_reg_state *reg, enum reg_arg_type t) -+{ -+ u8 code, class, op; -+ -+ code = insn->code; -+ class = BPF_CLASS(code); -+ op = BPF_OP(code); -+ if (class == BPF_JMP) { -+ /* BPF_EXIT for "main" will reach here. Return TRUE -+ * conservatively. -+ */ -+ if (op == BPF_EXIT) -+ return true; -+ if (op == BPF_CALL) { -+ /* BPF to BPF call will reach here because of marking -+ * caller saved clobber with DST_OP_NO_MARK for which we -+ * don't care the register def because they are anyway -+ * marked as NOT_INIT already. -+ */ -+ if (insn->src_reg == BPF_PSEUDO_CALL) -+ return false; -+ /* Helper call will reach here because of arg type -+ * check, conservatively return TRUE. -+ */ -+ if (t == SRC_OP) -+ return true; -+ -+ return false; -+ } -+ } -+ -+ if (class == BPF_ALU64 || class == BPF_JMP || -+ /* BPF_END always use BPF_ALU class. */ -+ (class == BPF_ALU && op == BPF_END && insn->imm == 64)) -+ return true; -+ -+ if (class == BPF_ALU || class == BPF_JMP32) -+ return false; -+ -+ if (class == BPF_LDX) { -+ if (t != SRC_OP) -+ return BPF_SIZE(code) == BPF_DW; -+ /* LDX source must be ptr. */ -+ return true; -+ } -+ -+ if (class == BPF_STX) { -+ if (reg->type != SCALAR_VALUE) -+ return true; -+ return BPF_SIZE(code) == BPF_DW; -+ } -+ -+ if (class == BPF_LD) { -+ u8 mode = BPF_MODE(code); -+ -+ /* LD_IMM64 */ -+ if (mode == BPF_IMM) -+ return true; -+ -+ /* Both LD_IND and LD_ABS return 32-bit data. */ -+ if (t != SRC_OP) -+ return false; -+ -+ /* Implicit ctx ptr. */ -+ if (regno == BPF_REG_6) -+ return true; -+ -+ /* Explicit source could be any width. */ -+ return true; -+ } -+ -+ if (class == BPF_ST) -+ /* The only source register for BPF_ST is a ptr. */ -+ return true; -+ -+ /* Conservatively return true at default. */ -+ return true; -+} -+ -+/* Return TRUE if INSN doesn't have explicit value define. */ -+static bool insn_no_def(struct bpf_insn *insn) -+{ -+ u8 class = BPF_CLASS(insn->code); -+ -+ return (class == BPF_JMP || class == BPF_JMP32 || -+ class == BPF_STX || class == BPF_ST); -+} -+ -+/* Return TRUE if INSN has defined any 32-bit value explicitly. */ -+static bool insn_has_def32(struct bpf_verifier_env *env, struct bpf_insn *insn) -+{ -+ if (insn_no_def(insn)) -+ return false; -+ -+ return !is_reg64(env, insn, insn->dst_reg, NULL, DST_OP); -+} -+ -+static void mark_insn_zext(struct bpf_verifier_env *env, -+ struct bpf_reg_state *reg) -+{ -+ s32 def_idx = reg->subreg_def; -+ -+ if (def_idx == DEF_NOT_SUBREG) -+ return; -+ -+ env->insn_aux_data[def_idx - 1].zext_dst = true; -+ /* The dst will be zero extended, so won't be sub-register anymore. */ -+ reg->subreg_def = DEF_NOT_SUBREG; -+} -+ -+static int check_reg_arg(struct bpf_verifier_env *env, u32 regno, - enum reg_arg_type t) - { -+ struct bpf_verifier_state *vstate = env->cur_state; -+ struct bpf_func_state *state = vstate->frame[vstate->curframe]; -+ struct bpf_insn *insn = env->prog->insnsi + env->insn_idx; -+ struct bpf_reg_state *reg, *regs = state->regs; -+ bool rw64; -+ - if (regno >= MAX_BPF_REG) { -- verbose("R%d is invalid\n", regno); -+ verbose(env, "R%d is invalid\n", regno); - return -EINVAL; - } - -+ reg = ®s[regno]; -+ rw64 = is_reg64(env, insn, regno, reg, t); - if (t == SRC_OP) { - /* check whether register used as source operand can be read */ -- if (regs[regno].type == NOT_INIT) { -- verbose("R%d !read_ok\n", regno); -+ if (reg->type == NOT_INIT) { -+ verbose(env, "R%d !read_ok\n", regno); - return -EACCES; - } -+ /* We don't need to worry about FP liveness because it's read-only */ -+ if (regno == BPF_REG_FP) -+ return 0; -+ -+ if (rw64) -+ mark_insn_zext(env, reg); -+ -+ return mark_reg_read(env, reg, reg->parent, -+ rw64 ? REG_LIVE_READ64 : REG_LIVE_READ32); - } else { - /* check whether register used as dest operand can be written to */ - if (regno == BPF_REG_FP) { -- verbose("frame pointer is read only\n"); -+ verbose(env, "frame pointer is read only\n"); - return -EACCES; - } -+ reg->live |= REG_LIVE_WRITTEN; -+ reg->subreg_def = rw64 ? DEF_NOT_SUBREG : env->insn_idx + 1; - if (t == DST_OP) -- mark_reg_unknown_value(regs, regno); -+ mark_reg_unknown(env, regs, regno); - } - return 0; - } - --static int bpf_size_to_bytes(int bpf_size) -+/* for any branch, call, exit record the history of jmps in the given state */ -+static int push_jmp_history(struct bpf_verifier_env *env, -+ struct bpf_verifier_state *cur) - { -- if (bpf_size == BPF_W) -- return 4; -- else if (bpf_size == BPF_H) -- return 2; -- else if (bpf_size == BPF_B) -- return 1; -- else if (bpf_size == BPF_DW) -- return 8; -- else -- return -EINVAL; -+ u32 cnt = cur->jmp_history_cnt; -+ struct bpf_idx_pair *p; -+ -+ cnt++; -+ p = krealloc(cur->jmp_history, cnt * sizeof(*p), GFP_USER); -+ if (!p) -+ return -ENOMEM; -+ p[cnt - 1].idx = env->insn_idx; -+ p[cnt - 1].prev_idx = env->prev_insn_idx; -+ cur->jmp_history = p; -+ cur->jmp_history_cnt = cnt; -+ return 0; -+} -+ -+/* Backtrack one insn at a time. If idx is not at the top of recorded -+ * history then previous instruction came from straight line execution. -+ */ -+static int get_prev_insn_idx(struct bpf_verifier_state *st, int i, -+ u32 *history) -+{ -+ u32 cnt = *history; -+ -+ if (cnt && st->jmp_history[cnt - 1].idx == i) { -+ i = st->jmp_history[cnt - 1].prev_idx; -+ (*history)--; -+ } else { -+ i--; -+ } -+ return i; -+} -+ -+/* For given verifier state backtrack_insn() is called from the last insn to -+ * the first insn. Its purpose is to compute a bitmask of registers and -+ * stack slots that needs precision in the parent verifier state. -+ */ -+static int backtrack_insn(struct bpf_verifier_env *env, int idx, -+ u32 *reg_mask, u64 *stack_mask) -+{ -+ const struct bpf_insn_cbs cbs = { -+ .cb_print = verbose, -+ .private_data = env, -+ }; -+ struct bpf_insn *insn = env->prog->insnsi + idx; -+ u8 class = BPF_CLASS(insn->code); -+ u8 opcode = BPF_OP(insn->code); -+ u8 mode = BPF_MODE(insn->code); -+ u32 dreg = 1u << insn->dst_reg; -+ u32 sreg = 1u << insn->src_reg; -+ u32 spi; -+ -+ if (insn->code == 0) -+ return 0; -+ if (env->log.level & BPF_LOG_LEVEL) { -+ verbose(env, "regs=%x stack=%llx before ", *reg_mask, *stack_mask); -+ verbose(env, "%d: ", idx); -+ print_bpf_insn(&cbs, insn, env->allow_ptr_leaks); -+ } -+ -+ if (class == BPF_ALU || class == BPF_ALU64) { -+ if (!(*reg_mask & dreg)) -+ return 0; -+ if (opcode == BPF_MOV) { -+ if (BPF_SRC(insn->code) == BPF_X) { -+ /* dreg = sreg -+ * dreg needs precision after this insn -+ * sreg needs precision before this insn -+ */ -+ *reg_mask &= ~dreg; -+ *reg_mask |= sreg; -+ } else { -+ /* dreg = K -+ * dreg needs precision after this insn. -+ * Corresponding register is already marked -+ * as precise=true in this verifier state. -+ * No further markings in parent are necessary -+ */ -+ *reg_mask &= ~dreg; -+ } -+ } else { -+ if (BPF_SRC(insn->code) == BPF_X) { -+ /* dreg += sreg -+ * both dreg and sreg need precision -+ * before this insn -+ */ -+ *reg_mask |= sreg; -+ } /* else dreg += K -+ * dreg still needs precision before this insn -+ */ -+ } -+ } else if (class == BPF_LDX) { -+ if (!(*reg_mask & dreg)) -+ return 0; -+ *reg_mask &= ~dreg; -+ -+ /* scalars can only be spilled into stack w/o losing precision. -+ * Load from any other memory can be zero extended. -+ * The desire to keep that precision is already indicated -+ * by 'precise' mark in corresponding register of this state. -+ * No further tracking necessary. -+ */ -+ if (insn->src_reg != BPF_REG_FP) -+ return 0; -+ if (BPF_SIZE(insn->code) != BPF_DW) -+ return 0; -+ -+ /* dreg = *(u64 *)[fp - off] was a fill from the stack. -+ * that [fp - off] slot contains scalar that needs to be -+ * tracked with precision -+ */ -+ spi = (-insn->off - 1) / BPF_REG_SIZE; -+ if (spi >= 64) { -+ verbose(env, "BUG spi %d\n", spi); -+ WARN_ONCE(1, "verifier backtracking bug"); -+ return -EFAULT; -+ } -+ *stack_mask |= 1ull << spi; -+ } else if (class == BPF_STX || class == BPF_ST) { -+ if (*reg_mask & dreg) -+ /* stx & st shouldn't be using _scalar_ dst_reg -+ * to access memory. It means backtracking -+ * encountered a case of pointer subtraction. -+ */ -+ return -ENOTSUPP; -+ /* scalars can only be spilled into stack */ -+ if (insn->dst_reg != BPF_REG_FP) -+ return 0; -+ if (BPF_SIZE(insn->code) != BPF_DW) -+ return 0; -+ spi = (-insn->off - 1) / BPF_REG_SIZE; -+ if (spi >= 64) { -+ verbose(env, "BUG spi %d\n", spi); -+ WARN_ONCE(1, "verifier backtracking bug"); -+ return -EFAULT; -+ } -+ if (!(*stack_mask & (1ull << spi))) -+ return 0; -+ *stack_mask &= ~(1ull << spi); -+ if (class == BPF_STX) -+ *reg_mask |= sreg; -+ } else if (class == BPF_JMP || class == BPF_JMP32) { -+ if (opcode == BPF_CALL) { -+ if (insn->src_reg == BPF_PSEUDO_CALL) -+ return -ENOTSUPP; -+ /* regular helper call sets R0 */ -+ *reg_mask &= ~1; -+ if (*reg_mask & 0x3f) { -+ /* if backtracing was looking for registers R1-R5 -+ * they should have been found already. -+ */ -+ verbose(env, "BUG regs %x\n", *reg_mask); -+ WARN_ONCE(1, "verifier backtracking bug"); -+ return -EFAULT; -+ } -+ } else if (opcode == BPF_EXIT) { -+ return -ENOTSUPP; -+ } -+ } else if (class == BPF_LD) { -+ if (!(*reg_mask & dreg)) -+ return 0; -+ *reg_mask &= ~dreg; -+ /* It's ld_imm64 or ld_abs or ld_ind. -+ * For ld_imm64 no further tracking of precision -+ * into parent is necessary -+ */ -+ if (mode == BPF_IND || mode == BPF_ABS) -+ /* to be analyzed */ -+ return -ENOTSUPP; -+ } -+ return 0; -+} -+ -+/* the scalar precision tracking algorithm: -+ * . at the start all registers have precise=false. -+ * . scalar ranges are tracked as normal through alu and jmp insns. -+ * . once precise value of the scalar register is used in: -+ * . ptr + scalar alu -+ * . if (scalar cond K|scalar) -+ * . helper_call(.., scalar, ...) where ARG_CONST is expected -+ * backtrack through the verifier states and mark all registers and -+ * stack slots with spilled constants that these scalar regisers -+ * should be precise. -+ * . during state pruning two registers (or spilled stack slots) -+ * are equivalent if both are not precise. -+ * -+ * Note the verifier cannot simply walk register parentage chain, -+ * since many different registers and stack slots could have been -+ * used to compute single precise scalar. -+ * -+ * The approach of starting with precise=true for all registers and then -+ * backtrack to mark a register as not precise when the verifier detects -+ * that program doesn't care about specific value (e.g., when helper -+ * takes register as ARG_ANYTHING parameter) is not safe. -+ * -+ * It's ok to walk single parentage chain of the verifier states. -+ * It's possible that this backtracking will go all the way till 1st insn. -+ * All other branches will be explored for needing precision later. -+ * -+ * The backtracking needs to deal with cases like: -+ * R8=map_value(id=0,off=0,ks=4,vs=1952,imm=0) R9_w=map_value(id=0,off=40,ks=4,vs=1952,imm=0) -+ * r9 -= r8 -+ * r5 = r9 -+ * if r5 > 0x79f goto pc+7 -+ * R5_w=inv(id=0,umax_value=1951,var_off=(0x0; 0x7ff)) -+ * r5 += 1 -+ * ... -+ * call bpf_perf_event_output#25 -+ * where .arg5_type = ARG_CONST_SIZE_OR_ZERO -+ * -+ * and this case: -+ * r6 = 1 -+ * call foo // uses callee's r6 inside to compute r0 -+ * r0 += r6 -+ * if r0 == 0 goto -+ * -+ * to track above reg_mask/stack_mask needs to be independent for each frame. -+ * -+ * Also if parent's curframe > frame where backtracking started, -+ * the verifier need to mark registers in both frames, otherwise callees -+ * may incorrectly prune callers. This is similar to -+ * commit 7640ead93924 ("bpf: verifier: make sure callees don't prune with caller differences") -+ * -+ * For now backtracking falls back into conservative marking. -+ */ -+static void mark_all_scalars_precise(struct bpf_verifier_env *env, -+ struct bpf_verifier_state *st) -+{ -+ struct bpf_func_state *func; -+ struct bpf_reg_state *reg; -+ int i, j; -+ -+ /* big hammer: mark all scalars precise in this path. -+ * pop_stack may still get !precise scalars. -+ */ -+ for (; st; st = st->parent) -+ for (i = 0; i <= st->curframe; i++) { -+ func = st->frame[i]; -+ for (j = 0; j < BPF_REG_FP; j++) { -+ reg = &func->regs[j]; -+ if (reg->type != SCALAR_VALUE) -+ continue; -+ reg->precise = true; -+ } -+ for (j = 0; j < func->allocated_stack / BPF_REG_SIZE; j++) { -+ if (func->stack[j].slot_type[0] != STACK_SPILL) -+ continue; -+ reg = &func->stack[j].spilled_ptr; -+ if (reg->type != SCALAR_VALUE) -+ continue; -+ reg->precise = true; -+ } -+ } -+} -+ -+static int __mark_chain_precision(struct bpf_verifier_env *env, int regno, -+ int spi) -+{ -+ struct bpf_verifier_state *st = env->cur_state; -+ int first_idx = st->first_insn_idx; -+ int last_idx = env->insn_idx; -+ struct bpf_func_state *func; -+ struct bpf_reg_state *reg; -+ u32 reg_mask = regno >= 0 ? 1u << regno : 0; -+ u64 stack_mask = spi >= 0 ? 1ull << spi : 0; -+ bool skip_first = true; -+ bool new_marks = false; -+ int i, err; -+ -+ if (!env->allow_ptr_leaks) -+ /* backtracking is root only for now */ -+ return 0; -+ -+ func = st->frame[st->curframe]; -+ if (regno >= 0) { -+ reg = &func->regs[regno]; -+ if (reg->type != SCALAR_VALUE) { -+ WARN_ONCE(1, "backtracing misuse"); -+ return -EFAULT; -+ } -+ if (!reg->precise) -+ new_marks = true; -+ else -+ reg_mask = 0; -+ reg->precise = true; -+ } -+ -+ while (spi >= 0) { -+ if (func->stack[spi].slot_type[0] != STACK_SPILL) { -+ stack_mask = 0; -+ break; -+ } -+ reg = &func->stack[spi].spilled_ptr; -+ if (reg->type != SCALAR_VALUE) { -+ stack_mask = 0; -+ break; -+ } -+ if (!reg->precise) -+ new_marks = true; -+ else -+ stack_mask = 0; -+ reg->precise = true; -+ break; -+ } -+ -+ if (!new_marks) -+ return 0; -+ if (!reg_mask && !stack_mask) -+ return 0; -+ for (;;) { -+ DECLARE_BITMAP(mask, 64); -+ u32 history = st->jmp_history_cnt; -+ -+ if (env->log.level & BPF_LOG_LEVEL) -+ verbose(env, "last_idx %d first_idx %d\n", last_idx, first_idx); -+ for (i = last_idx;;) { -+ if (skip_first) { -+ err = 0; -+ skip_first = false; -+ } else { -+ err = backtrack_insn(env, i, ®_mask, &stack_mask); -+ } -+ if (err == -ENOTSUPP) { -+ mark_all_scalars_precise(env, st); -+ return 0; -+ } else if (err) { -+ return err; -+ } -+ if (!reg_mask && !stack_mask) -+ /* Found assignment(s) into tracked register in this state. -+ * Since this state is already marked, just return. -+ * Nothing to be tracked further in the parent state. -+ */ -+ return 0; -+ if (i == first_idx) -+ break; -+ i = get_prev_insn_idx(st, i, &history); -+ if (i >= env->prog->len) { -+ /* This can happen if backtracking reached insn 0 -+ * and there are still reg_mask or stack_mask -+ * to backtrack. -+ * It means the backtracking missed the spot where -+ * particular register was initialized with a constant. -+ */ -+ verbose(env, "BUG backtracking idx %d\n", i); -+ WARN_ONCE(1, "verifier backtracking bug"); -+ return -EFAULT; -+ } -+ } -+ st = st->parent; -+ if (!st) -+ break; -+ -+ new_marks = false; -+ func = st->frame[st->curframe]; -+ bitmap_from_u64(mask, reg_mask); -+ for_each_set_bit(i, mask, 32) { -+ reg = &func->regs[i]; -+ if (reg->type != SCALAR_VALUE) { -+ reg_mask &= ~(1u << i); -+ continue; -+ } -+ if (!reg->precise) -+ new_marks = true; -+ reg->precise = true; -+ } -+ -+ bitmap_from_u64(mask, stack_mask); -+ for_each_set_bit(i, mask, 64) { -+ if (i >= func->allocated_stack / BPF_REG_SIZE) { -+ /* the sequence of instructions: -+ * 2: (bf) r3 = r10 -+ * 3: (7b) *(u64 *)(r3 -8) = r0 -+ * 4: (79) r4 = *(u64 *)(r10 -8) -+ * doesn't contain jmps. It's backtracked -+ * as a single block. -+ * During backtracking insn 3 is not recognized as -+ * stack access, so at the end of backtracking -+ * stack slot fp-8 is still marked in stack_mask. -+ * However the parent state may not have accessed -+ * fp-8 and it's "unallocated" stack space. -+ * In such case fallback to conservative. -+ */ -+ mark_all_scalars_precise(env, st); -+ return 0; -+ } -+ -+ if (func->stack[i].slot_type[0] != STACK_SPILL) { -+ stack_mask &= ~(1ull << i); -+ continue; -+ } -+ reg = &func->stack[i].spilled_ptr; -+ if (reg->type != SCALAR_VALUE) { -+ stack_mask &= ~(1ull << i); -+ continue; -+ } -+ if (!reg->precise) -+ new_marks = true; -+ reg->precise = true; -+ } -+ if (env->log.level & BPF_LOG_LEVEL) { -+ print_verifier_state(env, func); -+ verbose(env, "parent %s regs=%x stack=%llx marks\n", -+ new_marks ? "didn't have" : "already had", -+ reg_mask, stack_mask); -+ } -+ -+ if (!reg_mask && !stack_mask) -+ break; -+ if (!new_marks) -+ break; -+ -+ last_idx = st->last_insn_idx; -+ first_idx = st->first_insn_idx; -+ } -+ return 0; -+} -+ -+static int mark_chain_precision(struct bpf_verifier_env *env, int regno) -+{ -+ return __mark_chain_precision(env, regno, -1); -+} -+ -+static int mark_chain_precision_stack(struct bpf_verifier_env *env, int spi) -+{ -+ return __mark_chain_precision(env, -1, spi); - } - - static bool is_spillable_regtype(enum bpf_reg_type type) -@@ -549,129 +1842,932 @@ static bool is_spillable_regtype(enum bp - case PTR_TO_MAP_VALUE_OR_NULL: - case PTR_TO_STACK: - case PTR_TO_CTX: -- case FRAME_PTR: -+ case PTR_TO_PACKET: -+ case PTR_TO_PACKET_META: -+ case PTR_TO_PACKET_END: -+ case PTR_TO_FLOW_KEYS: - case CONST_PTR_TO_MAP: -+ case PTR_TO_SOCKET: -+ case PTR_TO_SOCKET_OR_NULL: -+ case PTR_TO_SOCK_COMMON: -+ case PTR_TO_SOCK_COMMON_OR_NULL: -+ case PTR_TO_TCP_SOCK: -+ case PTR_TO_TCP_SOCK_OR_NULL: -+ case PTR_TO_XDP_SOCK: - return true; - default: - return false; - } - } - -+/* Does this register contain a constant zero? */ -+static bool register_is_null(struct bpf_reg_state *reg) -+{ -+ return reg->type == SCALAR_VALUE && tnum_equals_const(reg->var_off, 0); -+} -+ -+static bool register_is_const(struct bpf_reg_state *reg) -+{ -+ return reg->type == SCALAR_VALUE && tnum_is_const(reg->var_off); -+} -+ -+static bool __is_pointer_value(bool allow_ptr_leaks, -+ const struct bpf_reg_state *reg) -+{ -+ if (allow_ptr_leaks) -+ return false; -+ -+ return reg->type != SCALAR_VALUE; -+} -+ -+static void save_register_state(struct bpf_func_state *state, -+ int spi, struct bpf_reg_state *reg) -+{ -+ int i; -+ -+ state->stack[spi].spilled_ptr = *reg; -+ state->stack[spi].spilled_ptr.live |= REG_LIVE_WRITTEN; -+ -+ for (i = 0; i < BPF_REG_SIZE; i++) -+ state->stack[spi].slot_type[i] = STACK_SPILL; -+} -+ - /* check_stack_read/write functions track spill/fill of registers, - * stack boundary and alignment are checked in check_mem_access() - */ --static int check_stack_write(struct verifier_state *state, int off, int size, -- int value_regno) -+static int check_stack_write(struct bpf_verifier_env *env, -+ struct bpf_func_state *state, /* func where register points to */ -+ int off, int size, int value_regno, int insn_idx) - { -- int i; -+ struct bpf_func_state *cur; /* state of the current function */ -+ int i, slot = -off - 1, spi = slot / BPF_REG_SIZE, err; -+ u32 dst_reg = env->prog->insnsi[insn_idx].dst_reg; -+ struct bpf_reg_state *reg = NULL; -+ -+ err = realloc_func_state(state, round_up(slot + 1, BPF_REG_SIZE), -+ state->acquired_refs, true); -+ if (err) -+ return err; - /* caller checked that off % size == 0 and -MAX_BPF_STACK <= off < 0, - * so it's aligned access and [off, off + size) are within stack limits - */ -+ if (!env->allow_ptr_leaks && -+ state->stack[spi].slot_type[0] == STACK_SPILL && -+ size != BPF_REG_SIZE) { -+ verbose(env, "attempt to corrupt spilled pointer on stack\n"); -+ return -EACCES; -+ } - -- if (value_regno >= 0 && -- is_spillable_regtype(state->regs[value_regno].type)) { -- -+ cur = env->cur_state->frame[env->cur_state->curframe]; -+ if (value_regno >= 0) -+ reg = &cur->regs[value_regno]; -+ -+ if (reg && size == BPF_REG_SIZE && register_is_const(reg) && -+ !register_is_null(reg) && env->allow_ptr_leaks) { -+ if (dst_reg != BPF_REG_FP) { -+ /* The backtracking logic can only recognize explicit -+ * stack slot address like [fp - 8]. Other spill of -+ * scalar via different register has to be conervative. -+ * Backtrack from here and mark all registers as precise -+ * that contributed into 'reg' being a constant. -+ */ -+ err = mark_chain_precision(env, value_regno); -+ if (err) -+ return err; -+ } -+ save_register_state(state, spi, reg); -+ } else if (reg && is_spillable_regtype(reg->type)) { - /* register containing pointer is being spilled into stack */ - if (size != BPF_REG_SIZE) { -- verbose("invalid size of register spill\n"); -+ verbose_linfo(env, insn_idx, "; "); -+ verbose(env, "invalid size of register spill\n"); - return -EACCES; - } - -- /* save register state */ -- state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE] = -- state->regs[value_regno]; -+ if (state != cur && reg->type == PTR_TO_STACK) { -+ verbose(env, "cannot spill pointers to stack into stack frame of the caller\n"); -+ return -EINVAL; -+ } - -- for (i = 0; i < BPF_REG_SIZE; i++) -- state->stack_slot_type[MAX_BPF_STACK + off + i] = STACK_SPILL; -+ if (!env->allow_ptr_leaks) { -+ bool sanitize = false; -+ -+ if (state->stack[spi].slot_type[0] == STACK_SPILL && -+ register_is_const(&state->stack[spi].spilled_ptr)) -+ sanitize = true; -+ for (i = 0; i < BPF_REG_SIZE; i++) -+ if (state->stack[spi].slot_type[i] == STACK_MISC) { -+ sanitize = true; -+ break; -+ } -+ if (sanitize) { -+ int *poff = &env->insn_aux_data[insn_idx].sanitize_stack_off; -+ int soff = (-spi - 1) * BPF_REG_SIZE; -+ -+ /* detected reuse of integer stack slot with a pointer -+ * which means either llvm is reusing stack slot or -+ * an attacker is trying to exploit CVE-2018-3639 -+ * (speculative store bypass) -+ * Have to sanitize that slot with preemptive -+ * store of zero. -+ */ -+ if (*poff && *poff != soff) { -+ /* disallow programs where single insn stores -+ * into two different stack slots, since verifier -+ * cannot sanitize them -+ */ -+ verbose(env, -+ "insn %d cannot access two stack slots fp%d and fp%d", -+ insn_idx, *poff, soff); -+ return -EINVAL; -+ } -+ *poff = soff; -+ } -+ } -+ save_register_state(state, spi, reg); - } else { -- /* regular write of data into stack */ -- state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE] = -- (struct reg_state) {}; -+ u8 type = STACK_MISC; -+ -+ /* regular write of data into stack destroys any spilled ptr */ -+ state->stack[spi].spilled_ptr.type = NOT_INIT; -+ /* Mark slots as STACK_MISC if they belonged to spilled ptr. */ -+ if (state->stack[spi].slot_type[0] == STACK_SPILL) -+ for (i = 0; i < BPF_REG_SIZE; i++) -+ state->stack[spi].slot_type[i] = STACK_MISC; -+ -+ /* only mark the slot as written if all 8 bytes were written -+ * otherwise read propagation may incorrectly stop too soon -+ * when stack slots are partially written. -+ * This heuristic means that read propagation will be -+ * conservative, since it will add reg_live_read marks -+ * to stack slots all the way to first state when programs -+ * writes+reads less than 8 bytes -+ */ -+ if (size == BPF_REG_SIZE) -+ state->stack[spi].spilled_ptr.live |= REG_LIVE_WRITTEN; -+ -+ /* when we zero initialize stack slots mark them as such */ -+ if (reg && register_is_null(reg)) { -+ /* backtracking doesn't work for STACK_ZERO yet. */ -+ err = mark_chain_precision(env, value_regno); -+ if (err) -+ return err; -+ type = STACK_ZERO; -+ } - -+ /* Mark slots affected by this stack write. */ - for (i = 0; i < size; i++) -- state->stack_slot_type[MAX_BPF_STACK + off + i] = STACK_MISC; -+ state->stack[spi].slot_type[(slot - i) % BPF_REG_SIZE] = -+ type; - } - return 0; - } - --static int check_stack_read(struct verifier_state *state, int off, int size, -- int value_regno) -+static int check_stack_read(struct bpf_verifier_env *env, -+ struct bpf_func_state *reg_state /* func where register points to */, -+ int off, int size, int value_regno) - { -- u8 *slot_type; -- int i; -- -- slot_type = &state->stack_slot_type[MAX_BPF_STACK + off]; -+ struct bpf_verifier_state *vstate = env->cur_state; -+ struct bpf_func_state *state = vstate->frame[vstate->curframe]; -+ int i, slot = -off - 1, spi = slot / BPF_REG_SIZE; -+ struct bpf_reg_state *reg; -+ u8 *stype; -+ -+ if (reg_state->allocated_stack <= slot) { -+ verbose(env, "invalid read from stack off %d+0 size %d\n", -+ off, size); -+ return -EACCES; -+ } -+ stype = reg_state->stack[spi].slot_type; -+ reg = ®_state->stack[spi].spilled_ptr; - -- if (slot_type[0] == STACK_SPILL) { -+ if (stype[0] == STACK_SPILL) { - if (size != BPF_REG_SIZE) { -- verbose("invalid size of register spill\n"); -- return -EACCES; -+ if (reg->type != SCALAR_VALUE) { -+ verbose_linfo(env, env->insn_idx, "; "); -+ verbose(env, "invalid size of register fill\n"); -+ return -EACCES; -+ } -+ if (value_regno >= 0) { -+ mark_reg_unknown(env, state->regs, value_regno); -+ state->regs[value_regno].live |= REG_LIVE_WRITTEN; -+ } -+ mark_reg_read(env, reg, reg->parent, REG_LIVE_READ64); -+ return 0; - } - for (i = 1; i < BPF_REG_SIZE; i++) { -- if (slot_type[i] != STACK_SPILL) { -- verbose("corrupted spill memory\n"); -+ if (stype[(slot - i) % BPF_REG_SIZE] != STACK_SPILL) { -+ verbose(env, "corrupted spill memory\n"); - return -EACCES; - } - } - -- if (value_regno >= 0) -+ if (value_regno >= 0) { - /* restore register state from stack */ -- state->regs[value_regno] = -- state->spilled_regs[(MAX_BPF_STACK + off) / BPF_REG_SIZE]; -- return 0; -+ state->regs[value_regno] = *reg; -+ /* mark reg as written since spilled pointer state likely -+ * has its liveness marks cleared by is_state_visited() -+ * which resets stack/reg liveness for state transitions -+ */ -+ state->regs[value_regno].live |= REG_LIVE_WRITTEN; -+ } else if (__is_pointer_value(env->allow_ptr_leaks, reg)) { -+ /* If value_regno==-1, the caller is asking us whether -+ * it is acceptable to use this value as a SCALAR_VALUE -+ * (e.g. for XADD). -+ * We must not allow unprivileged callers to do that -+ * with spilled pointers. -+ */ -+ verbose(env, "leaking pointer from stack off %d\n", -+ off); -+ return -EACCES; -+ } -+ mark_reg_read(env, reg, reg->parent, REG_LIVE_READ64); - } else { -+ int zeros = 0; -+ - for (i = 0; i < size; i++) { -- if (slot_type[i] != STACK_MISC) { -- verbose("invalid read from stack off %d+%d size %d\n", -- off, i, size); -- return -EACCES; -+ if (stype[(slot - i) % BPF_REG_SIZE] == STACK_MISC) -+ continue; -+ if (stype[(slot - i) % BPF_REG_SIZE] == STACK_ZERO) { -+ zeros++; -+ continue; - } -+ verbose(env, "invalid read from stack off %d+%d size %d\n", -+ off, i, size); -+ return -EACCES; -+ } -+ mark_reg_read(env, reg, reg->parent, REG_LIVE_READ64); -+ if (value_regno >= 0) { -+ if (zeros == size) { -+ /* any size read into register is zero extended, -+ * so the whole register == const_zero -+ */ -+ __mark_reg_const_zero(&state->regs[value_regno]); -+ /* backtracking doesn't support STACK_ZERO yet, -+ * so mark it precise here, so that later -+ * backtracking can stop here. -+ * Backtracking may not need this if this register -+ * doesn't participate in pointer adjustment. -+ * Forward propagation of precise flag is not -+ * necessary either. This mark is only to stop -+ * backtracking. Any register that contributed -+ * to const 0 was marked precise before spill. -+ */ -+ state->regs[value_regno].precise = true; -+ } else { -+ /* have read misc data from the stack */ -+ mark_reg_unknown(env, state->regs, value_regno); -+ } -+ state->regs[value_regno].live |= REG_LIVE_WRITTEN; - } -- if (value_regno >= 0) -- /* have read misc data from the stack */ -- mark_reg_unknown_value(state->regs, value_regno); -- return 0; - } -+ return 0; -+} -+ -+static int check_stack_access(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, -+ int off, int size) -+{ -+ /* Stack accesses must be at a fixed offset, so that we -+ * can determine what type of data were returned. See -+ * check_stack_read(). -+ */ -+ if (!tnum_is_const(reg->var_off)) { -+ char tn_buf[48]; -+ -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, "variable stack access var_off=%s off=%d size=%d\n", -+ tn_buf, off, size); -+ return -EACCES; -+ } -+ -+ if (off >= 0 || off < -MAX_BPF_STACK) { -+ verbose(env, "invalid stack off=%d size=%d\n", off, size); -+ return -EACCES; -+ } -+ -+ return 0; -+} -+ -+static int check_map_access_type(struct bpf_verifier_env *env, u32 regno, -+ int off, int size, enum bpf_access_type type) -+{ -+ struct bpf_reg_state *regs = cur_regs(env); -+ struct bpf_map *map = regs[regno].map_ptr; -+ u32 cap = bpf_map_flags_to_cap(map); -+ -+ if (type == BPF_WRITE && !(cap & BPF_MAP_CAN_WRITE)) { -+ verbose(env, "write into map forbidden, value_size=%d off=%d size=%d\n", -+ map->value_size, off, size); -+ return -EACCES; -+ } -+ -+ if (type == BPF_READ && !(cap & BPF_MAP_CAN_READ)) { -+ verbose(env, "read from map forbidden, value_size=%d off=%d size=%d\n", -+ map->value_size, off, size); -+ return -EACCES; -+ } -+ -+ return 0; - } - - /* check read/write into map element returned by bpf_map_lookup_elem() */ --static int check_map_access(struct verifier_env *env, u32 regno, int off, -- int size) -+static int __check_map_access(struct bpf_verifier_env *env, u32 regno, int off, -+ int size, bool zero_size_allowed) - { -- struct bpf_map *map = env->cur_state.regs[regno].map_ptr; -+ struct bpf_reg_state *regs = cur_regs(env); -+ struct bpf_map *map = regs[regno].map_ptr; - -- if (off < 0 || off + size > map->value_size) { -- verbose("invalid access to map value, value_size=%d off=%d size=%d\n", -+ if (off < 0 || size < 0 || (size == 0 && !zero_size_allowed) || -+ off + size > map->value_size) { -+ verbose(env, "invalid access to map value, value_size=%d off=%d size=%d\n", - map->value_size, off, size); - return -EACCES; - } - return 0; - } - --/* check access to 'struct bpf_context' fields */ --static int check_ctx_access(struct verifier_env *env, int off, int size, -- enum bpf_access_type t) -+/* check read/write into a map element with possible variable offset */ -+static int check_map_access(struct bpf_verifier_env *env, u32 regno, -+ int off, int size, bool zero_size_allowed) -+{ -+ struct bpf_verifier_state *vstate = env->cur_state; -+ struct bpf_func_state *state = vstate->frame[vstate->curframe]; -+ struct bpf_reg_state *reg = &state->regs[regno]; -+ int err; -+ -+ /* We may have adjusted the register to this map value, so we -+ * need to try adding each of min_value and max_value to off -+ * to make sure our theoretical access will be safe. -+ */ -+ if (env->log.level & BPF_LOG_LEVEL) -+ print_verifier_state(env, state); -+ -+ /* The minimum value is only important with signed -+ * comparisons where we can't assume the floor of a -+ * value is 0. If we are using signed variables for our -+ * index'es we need to make sure that whatever we use -+ * will have a set floor within our range. -+ */ -+ if (reg->smin_value < 0 && -+ (reg->smin_value == S64_MIN || -+ (off + reg->smin_value != (s64)(s32)(off + reg->smin_value)) || -+ reg->smin_value + off < 0)) { -+ verbose(env, "R%d min value is negative, either use unsigned index or do a if (index >=0) check.\n", -+ regno); -+ return -EACCES; -+ } -+ err = __check_map_access(env, regno, reg->smin_value + off, size, -+ zero_size_allowed); -+ if (err) { -+ verbose(env, "R%d min value is outside of the array range\n", -+ regno); -+ return err; -+ } -+ -+ /* If we haven't set a max value then we need to bail since we can't be -+ * sure we won't do bad things. -+ * If reg->umax_value + off could overflow, treat that as unbounded too. -+ */ -+ if (reg->umax_value >= BPF_MAX_VAR_OFF) { -+ verbose(env, "R%d unbounded memory access, make sure to bounds check any array access into a map\n", -+ regno); -+ return -EACCES; -+ } -+ err = __check_map_access(env, regno, reg->umax_value + off, size, -+ zero_size_allowed); -+ if (err) -+ verbose(env, "R%d max value is outside of the array range\n", -+ regno); -+ -+ if (map_value_has_spin_lock(reg->map_ptr)) { -+ u32 lock = reg->map_ptr->spin_lock_off; -+ -+ /* if any part of struct bpf_spin_lock can be touched by -+ * load/store reject this program. -+ * To check that [x1, x2) overlaps with [y1, y2) -+ * it is sufficient to check x1 < y2 && y1 < x2. -+ */ -+ if (reg->smin_value + off < lock + sizeof(struct bpf_spin_lock) && -+ lock < reg->umax_value + off + size) { -+ verbose(env, "bpf_spin_lock cannot be accessed directly by load/store\n"); -+ return -EACCES; -+ } -+ } -+ return err; -+} -+ -+#define MAX_PACKET_OFF 0xffff -+ -+static bool may_access_direct_pkt_data(struct bpf_verifier_env *env, -+ const struct bpf_call_arg_meta *meta, -+ enum bpf_access_type t) -+{ -+ switch (env->prog->type) { -+ /* Program types only with direct read access go here! */ -+ case BPF_PROG_TYPE_LWT_IN: -+ case BPF_PROG_TYPE_LWT_OUT: -+ case BPF_PROG_TYPE_LWT_SEG6LOCAL: -+ case BPF_PROG_TYPE_SK_REUSEPORT: -+ case BPF_PROG_TYPE_FLOW_DISSECTOR: -+ case BPF_PROG_TYPE_CGROUP_SKB: -+ if (t == BPF_WRITE) -+ return false; -+ /* fallthrough */ -+ -+ /* Program types with direct read + write access go here! */ -+ case BPF_PROG_TYPE_SCHED_CLS: -+ case BPF_PROG_TYPE_SCHED_ACT: -+ case BPF_PROG_TYPE_XDP: -+ case BPF_PROG_TYPE_LWT_XMIT: -+ case BPF_PROG_TYPE_SK_SKB: -+ case BPF_PROG_TYPE_SK_MSG: -+ if (meta) -+ return meta->pkt_access; -+ -+ env->seen_direct_write = true; -+ return true; -+ -+ case BPF_PROG_TYPE_CGROUP_SOCKOPT: -+ if (t == BPF_WRITE) -+ env->seen_direct_write = true; -+ -+ return true; -+ -+ default: -+ return false; -+ } -+} -+ -+static int __check_packet_access(struct bpf_verifier_env *env, u32 regno, -+ int off, int size, bool zero_size_allowed) -+{ -+ struct bpf_reg_state *regs = cur_regs(env); -+ struct bpf_reg_state *reg = ®s[regno]; -+ -+ if (off < 0 || size < 0 || (size == 0 && !zero_size_allowed) || -+ (u64)off + size > reg->range) { -+ verbose(env, "invalid access to packet, off=%d size=%d, R%d(id=%d,off=%d,r=%d)\n", -+ off, size, regno, reg->id, reg->off, reg->range); -+ return -EACCES; -+ } -+ return 0; -+} -+ -+static int check_packet_access(struct bpf_verifier_env *env, u32 regno, int off, -+ int size, bool zero_size_allowed) -+{ -+ struct bpf_reg_state *regs = cur_regs(env); -+ struct bpf_reg_state *reg = ®s[regno]; -+ int err; -+ -+ /* We may have added a variable offset to the packet pointer; but any -+ * reg->range we have comes after that. We are only checking the fixed -+ * offset. -+ */ -+ -+ /* We don't allow negative numbers, because we aren't tracking enough -+ * detail to prove they're safe. -+ */ -+ if (reg->smin_value < 0) { -+ verbose(env, "R%d min value is negative, either use unsigned index or do a if (index >=0) check.\n", -+ regno); -+ return -EACCES; -+ } -+ err = __check_packet_access(env, regno, off, size, zero_size_allowed); -+ if (err) { -+ verbose(env, "R%d offset is outside of the packet\n", regno); -+ return err; -+ } -+ -+ /* __check_packet_access has made sure "off + size - 1" is within u16. -+ * reg->umax_value can't be bigger than MAX_PACKET_OFF which is 0xffff, -+ * otherwise find_good_pkt_pointers would have refused to set range info -+ * that __check_packet_access would have rejected this pkt access. -+ * Therefore, "off + reg->umax_value + size - 1" won't overflow u32. -+ */ -+ env->prog->aux->max_pkt_offset = -+ max_t(u32, env->prog->aux->max_pkt_offset, -+ off + reg->umax_value + size - 1); -+ -+ return err; -+} -+ -+/* check access to 'struct bpf_context' fields. Supports fixed offsets only */ -+static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, -+ enum bpf_access_type t, enum bpf_reg_type *reg_type) - { -- if (env->prog->aux->ops->is_valid_access && -- env->prog->aux->ops->is_valid_access(off, size, t)) -+ struct bpf_insn_access_aux info = { -+ .reg_type = *reg_type, -+ }; -+ -+ if (env->ops->is_valid_access && -+ env->ops->is_valid_access(off, size, t, env->prog, &info)) { -+ /* A non zero info.ctx_field_size indicates that this field is a -+ * candidate for later verifier transformation to load the whole -+ * field and then apply a mask when accessed with a narrower -+ * access than actual ctx access size. A zero info.ctx_field_size -+ * will only allow for whole field access and rejects any other -+ * type of narrower access. -+ */ -+ *reg_type = info.reg_type; -+ -+ env->insn_aux_data[insn_idx].ctx_field_size = info.ctx_field_size; -+ /* remember the offset of last byte accessed in ctx */ -+ if (env->prog->aux->max_ctx_offset < off + size) -+ env->prog->aux->max_ctx_offset = off + size; - return 0; -+ } - -- verbose("invalid bpf_context access off=%d size=%d\n", off, size); -+ verbose(env, "invalid bpf_context access off=%d size=%d\n", off, size); - return -EACCES; - } - --static bool is_pointer_value(struct verifier_env *env, int regno) -+static int check_flow_keys_access(struct bpf_verifier_env *env, int off, -+ int size) - { -- if (env->allow_ptr_leaks) -- return false; -+ if (size < 0 || off < 0 || -+ (u64)off + size > sizeof(struct bpf_flow_keys)) { -+ verbose(env, "invalid access to flow keys off=%d size=%d\n", -+ off, size); -+ return -EACCES; -+ } -+ return 0; -+} - -- switch (env->cur_state.regs[regno].type) { -- case UNKNOWN_VALUE: -- case CONST_IMM: -- return false; -+static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, -+ u32 regno, int off, int size, -+ enum bpf_access_type t) -+{ -+ struct bpf_reg_state *regs = cur_regs(env); -+ struct bpf_reg_state *reg = ®s[regno]; -+ struct bpf_insn_access_aux info = {}; -+ bool valid; -+ -+ if (reg->smin_value < 0) { -+ verbose(env, "R%d min value is negative, either use unsigned index or do a if (index >=0) check.\n", -+ regno); -+ return -EACCES; -+ } -+ -+ switch (reg->type) { -+ case PTR_TO_SOCK_COMMON: -+ valid = bpf_sock_common_is_valid_access(off, size, t, &info); -+ break; - default: -- return true; -+ valid = false; -+ } -+ -+ -+ if (valid) { -+ env->insn_aux_data[insn_idx].ctx_field_size = -+ info.ctx_field_size; -+ return 0; -+ } -+ -+ verbose(env, "R%d invalid %s access off=%d size=%d\n", -+ regno, reg_type_str[reg->type], off, size); -+ -+ return -EACCES; -+} -+ -+static struct bpf_reg_state *reg_state(struct bpf_verifier_env *env, int regno) -+{ -+ return cur_regs(env) + regno; -+} -+ -+static bool is_pointer_value(struct bpf_verifier_env *env, int regno) -+{ -+ return __is_pointer_value(env->allow_ptr_leaks, reg_state(env, regno)); -+} -+ -+static bool is_ctx_reg(struct bpf_verifier_env *env, int regno) -+{ -+ const struct bpf_reg_state *reg = reg_state(env, regno); -+ -+ return reg->type == PTR_TO_CTX; -+} -+ -+static bool is_sk_reg(struct bpf_verifier_env *env, int regno) -+{ -+ const struct bpf_reg_state *reg = reg_state(env, regno); -+ -+ return type_is_sk_pointer(reg->type); -+} -+ -+static bool is_pkt_reg(struct bpf_verifier_env *env, int regno) -+{ -+ const struct bpf_reg_state *reg = reg_state(env, regno); -+ -+ return type_is_pkt_pointer(reg->type); -+} -+ -+static bool is_flow_key_reg(struct bpf_verifier_env *env, int regno) -+{ -+ const struct bpf_reg_state *reg = reg_state(env, regno); -+ -+ /* Separate to is_ctx_reg() since we still want to allow BPF_ST here. */ -+ return reg->type == PTR_TO_FLOW_KEYS; -+} -+ -+static int check_pkt_ptr_alignment(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, -+ int off, int size, bool strict) -+{ -+ struct tnum reg_off; -+ int ip_align; -+ -+ /* Byte size accesses are always allowed. */ -+ if (!strict || size == 1) -+ return 0; -+ -+ /* For platforms that do not have a Kconfig enabling -+ * CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS the value of -+ * NET_IP_ALIGN is universally set to '2'. And on platforms -+ * that do set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS, we get -+ * to this code only in strict mode where we want to emulate -+ * the NET_IP_ALIGN==2 checking. Therefore use an -+ * unconditional IP align value of '2'. -+ */ -+ ip_align = 2; -+ -+ reg_off = tnum_add(reg->var_off, tnum_const(ip_align + reg->off + off)); -+ if (!tnum_is_aligned(reg_off, size)) { -+ char tn_buf[48]; -+ -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, -+ "misaligned packet access off %d+%s+%d+%d size %d\n", -+ ip_align, tn_buf, reg->off, off, size); -+ return -EACCES; -+ } -+ -+ return 0; -+} -+ -+static int check_generic_ptr_alignment(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, -+ const char *pointer_desc, -+ int off, int size, bool strict) -+{ -+ struct tnum reg_off; -+ -+ /* Byte size accesses are always allowed. */ -+ if (!strict || size == 1) -+ return 0; -+ -+ reg_off = tnum_add(reg->var_off, tnum_const(reg->off + off)); -+ if (!tnum_is_aligned(reg_off, size)) { -+ char tn_buf[48]; -+ -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, "misaligned %saccess off %s+%d+%d size %d\n", -+ pointer_desc, tn_buf, reg->off, off, size); -+ return -EACCES; -+ } -+ -+ return 0; -+} -+ -+static int check_ptr_alignment(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, int off, -+ int size, bool strict_alignment_once) -+{ -+ bool strict = env->strict_alignment || strict_alignment_once; -+ const char *pointer_desc = ""; -+ -+ switch (reg->type) { -+ case PTR_TO_PACKET: -+ case PTR_TO_PACKET_META: -+ /* Special case, because of NET_IP_ALIGN. Given metadata sits -+ * right in front, treat it the very same way. -+ */ -+ return check_pkt_ptr_alignment(env, reg, off, size, strict); -+ case PTR_TO_FLOW_KEYS: -+ pointer_desc = "flow keys "; -+ break; -+ case PTR_TO_MAP_VALUE: -+ pointer_desc = "value "; -+ break; -+ case PTR_TO_CTX: -+ pointer_desc = "context "; -+ break; -+ case PTR_TO_STACK: -+ pointer_desc = "stack "; -+ /* The stack spill tracking logic in check_stack_write() -+ * and check_stack_read() relies on stack accesses being -+ * aligned. -+ */ -+ strict = true; -+ break; -+ case PTR_TO_SOCKET: -+ pointer_desc = "sock "; -+ break; -+ case PTR_TO_SOCK_COMMON: -+ pointer_desc = "sock_common "; -+ break; -+ case PTR_TO_TCP_SOCK: -+ pointer_desc = "tcp_sock "; -+ break; -+ case PTR_TO_XDP_SOCK: -+ pointer_desc = "xdp_sock "; -+ break; -+ default: -+ break; -+ } -+ return check_generic_ptr_alignment(env, reg, pointer_desc, off, size, -+ strict); -+} -+ -+static int update_stack_depth(struct bpf_verifier_env *env, -+ const struct bpf_func_state *func, -+ int off) -+{ -+ u16 stack = env->subprog_info[func->subprogno].stack_depth; -+ -+ if (stack >= -off) -+ return 0; -+ -+ /* update known max for given subprogram */ -+ env->subprog_info[func->subprogno].stack_depth = -off; -+ return 0; -+} -+ -+/* starting from main bpf function walk all instructions of the function -+ * and recursively walk all callees that given function can call. -+ * Ignore jump and exit insns. -+ * Since recursion is prevented by check_cfg() this algorithm -+ * only needs a local stack of MAX_CALL_FRAMES to remember callsites -+ */ -+static int check_max_stack_depth(struct bpf_verifier_env *env) -+{ -+ int depth = 0, frame = 0, idx = 0, i = 0, subprog_end; -+ struct bpf_subprog_info *subprog = env->subprog_info; -+ struct bpf_insn *insn = env->prog->insnsi; -+ int ret_insn[MAX_CALL_FRAMES]; -+ int ret_prog[MAX_CALL_FRAMES]; -+ -+process_func: -+ /* protect against potential stack overflow that might happen when -+ * bpf2bpf calls get combined with tailcalls. Limit the caller's stack -+ * depth for such case down to 256 so that the worst case scenario -+ * would result in 8k stack size (32 which is tailcall limit * 256 = -+ * 8k). -+ * -+ * To get the idea what might happen, see an example: -+ * func1 -> sub rsp, 128 -+ * subfunc1 -> sub rsp, 256 -+ * tailcall1 -> add rsp, 256 -+ * func2 -> sub rsp, 192 (total stack size = 128 + 192 = 320) -+ * subfunc2 -> sub rsp, 64 -+ * subfunc22 -> sub rsp, 128 -+ * tailcall2 -> add rsp, 128 -+ * func3 -> sub rsp, 32 (total stack size 128 + 192 + 64 + 32 = 416) -+ * -+ * tailcall will unwind the current stack frame but it will not get rid -+ * of caller's stack as shown on the example above. -+ */ -+ if (idx && subprog[idx].has_tail_call && depth >= 256) { -+ verbose(env, -+ "tail_calls are not allowed when call stack of previous frames is %d bytes. Too large\n", -+ depth); -+ return -EACCES; -+ } -+ /* round up to 32-bytes, since this is granularity -+ * of interpreter stack size -+ */ -+ depth += round_up(max_t(u32, subprog[idx].stack_depth, 1), 32); -+ if (depth > MAX_BPF_STACK) { -+ verbose(env, "combined stack size of %d calls is %d. Too large\n", -+ frame + 1, depth); -+ return -EACCES; -+ } -+continue_func: -+ subprog_end = subprog[idx + 1].start; -+ for (; i < subprog_end; i++) { -+ if (insn[i].code != (BPF_JMP | BPF_CALL)) -+ continue; -+ if (insn[i].src_reg != BPF_PSEUDO_CALL) -+ continue; -+ /* remember insn and function to return to */ -+ ret_insn[frame] = i + 1; -+ ret_prog[frame] = idx; -+ -+ /* find the callee */ -+ i = i + insn[i].imm + 1; -+ idx = find_subprog(env, i); -+ if (idx < 0) { -+ WARN_ONCE(1, "verifier bug. No program starts at insn %d\n", -+ i); -+ return -EFAULT; -+ } -+ frame++; -+ if (frame >= MAX_CALL_FRAMES) { -+ verbose(env, "the call stack of %d frames is too deep !\n", -+ frame); -+ return -E2BIG; -+ } -+ goto process_func; -+ } -+ /* end of for() loop means the last insn of the 'subprog' -+ * was reached. Doesn't matter whether it was JA or EXIT -+ */ -+ if (frame == 0) -+ return 0; -+ depth -= round_up(max_t(u32, subprog[idx].stack_depth, 1), 32); -+ frame--; -+ i = ret_insn[frame]; -+ idx = ret_prog[frame]; -+ goto continue_func; -+} -+ -+#ifndef CONFIG_BPF_JIT_ALWAYS_ON -+static int get_callee_stack_depth(struct bpf_verifier_env *env, -+ const struct bpf_insn *insn, int idx) -+{ -+ int start = idx + insn->imm + 1, subprog; -+ -+ subprog = find_subprog(env, start); -+ if (subprog < 0) { -+ WARN_ONCE(1, "verifier bug. No program starts at insn %d\n", -+ start); -+ return -EFAULT; - } -+ return env->subprog_info[subprog].stack_depth; -+} -+#endif -+ -+static int check_ctx_reg(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, int regno) -+{ -+ /* Access to ctx or passing it to a helper is only allowed in -+ * its original, unmodified form. -+ */ -+ -+ if (reg->off) { -+ verbose(env, "dereference of modified ctx ptr R%d off=%d disallowed\n", -+ regno, reg->off); -+ return -EACCES; -+ } -+ -+ if (!tnum_is_const(reg->var_off) || reg->var_off.value) { -+ char tn_buf[48]; -+ -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, "variable ctx access var_off=%s disallowed\n", tn_buf); -+ return -EACCES; -+ } -+ -+ return 0; -+} -+ -+static int check_tp_buffer_access(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, -+ int regno, int off, int size) -+{ -+ if (off < 0) { -+ verbose(env, -+ "R%d invalid tracepoint buffer access: off=%d, size=%d", -+ regno, off, size); -+ return -EACCES; -+ } -+ if (!tnum_is_const(reg->var_off) || reg->var_off.value) { -+ char tn_buf[48]; -+ -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, -+ "R%d invalid variable buffer offset: off=%d, var_off=%s", -+ regno, off, tn_buf); -+ return -EACCES; -+ } -+ if (off + size > env->prog->aux->max_tp_access) -+ env->prog->aux->max_tp_access = off + size; -+ -+ return 0; -+} -+ -+ -+/* truncate register to smaller size (in bytes) -+ * must be called with size < BPF_REG_SIZE -+ */ -+static void coerce_reg_to_size(struct bpf_reg_state *reg, int size) -+{ -+ u64 mask; -+ -+ /* clear high bits in bit representation */ -+ reg->var_off = tnum_cast(reg->var_off, size); -+ -+ /* fix arithmetic bounds */ -+ mask = ((u64)1 << (size * 8)) - 1; -+ if ((reg->umin_value & ~mask) == (reg->umax_value & ~mask)) { -+ reg->umin_value &= mask; -+ reg->umax_value &= mask; -+ } else { -+ reg->umin_value = 0; -+ reg->umax_value = mask; -+ } -+ reg->smin_value = reg->umin_value; -+ reg->smax_value = reg->umax_value; - } - - /* check whether memory at (regno + off) is accessible for t = (read | write) -@@ -680,225 +2776,692 @@ static bool is_pointer_value(struct veri - * if t==write && value_regno==-1, some unknown value is stored into memory - * if t==read && value_regno==-1, don't care what we read from memory - */ --static int check_mem_access(struct verifier_env *env, u32 regno, int off, -- int bpf_size, enum bpf_access_type t, -- int value_regno) -+static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, -+ int off, int bpf_size, enum bpf_access_type t, -+ int value_regno, bool strict_alignment_once) - { -- struct verifier_state *state = &env->cur_state; -+ struct bpf_reg_state *regs = cur_regs(env); -+ struct bpf_reg_state *reg = regs + regno; -+ struct bpf_func_state *state; - int size, err = 0; - -- if (state->regs[regno].type == PTR_TO_STACK) -- off += state->regs[regno].imm; -- - size = bpf_size_to_bytes(bpf_size); - if (size < 0) - return size; - -- if (off % size != 0) { -- verbose("misaligned access off %d size %d\n", off, size); -- return -EACCES; -- } -+ /* alignment checks will add in reg->off themselves */ -+ err = check_ptr_alignment(env, reg, off, size, strict_alignment_once); -+ if (err) -+ return err; -+ -+ /* for access checks, reg->off is just part of off */ -+ off += reg->off; - -- if (state->regs[regno].type == PTR_TO_MAP_VALUE) { -+ if (reg->type == PTR_TO_MAP_VALUE) { - if (t == BPF_WRITE && value_regno >= 0 && - is_pointer_value(env, value_regno)) { -- verbose("R%d leaks addr into map\n", value_regno); -+ verbose(env, "R%d leaks addr into map\n", value_regno); - return -EACCES; - } -- err = check_map_access(env, regno, off, size); -+ err = check_map_access_type(env, regno, off, size, t); -+ if (err) -+ return err; -+ err = check_map_access(env, regno, off, size, false); - if (!err && t == BPF_READ && value_regno >= 0) -- mark_reg_unknown_value(state->regs, value_regno); -+ mark_reg_unknown(env, regs, value_regno); -+ -+ } else if (reg->type == PTR_TO_CTX) { -+ enum bpf_reg_type reg_type = SCALAR_VALUE; - -- } else if (state->regs[regno].type == PTR_TO_CTX) { - if (t == BPF_WRITE && value_regno >= 0 && - is_pointer_value(env, value_regno)) { -- verbose("R%d leaks addr into ctx\n", value_regno); -+ verbose(env, "R%d leaks addr into ctx\n", value_regno); - return -EACCES; - } -- err = check_ctx_access(env, off, size, t); -- if (!err && t == BPF_READ && value_regno >= 0) -- mark_reg_unknown_value(state->regs, value_regno); - -- } else if (state->regs[regno].type == FRAME_PTR || -- state->regs[regno].type == PTR_TO_STACK) { -- if (off >= 0 || off < -MAX_BPF_STACK) { -- verbose("invalid stack off=%d size=%d\n", off, size); -+ err = check_ctx_reg(env, reg, regno); -+ if (err < 0) -+ return err; -+ -+ err = check_ctx_access(env, insn_idx, off, size, t, ®_type); -+ if (!err && t == BPF_READ && value_regno >= 0) { -+ /* ctx access returns either a scalar, or a -+ * PTR_TO_PACKET[_META,_END]. In the latter -+ * case, we know the offset is zero. -+ */ -+ if (reg_type == SCALAR_VALUE) { -+ mark_reg_unknown(env, regs, value_regno); -+ } else { -+ mark_reg_known_zero(env, regs, -+ value_regno); -+ if (reg_type_may_be_null(reg_type)) -+ regs[value_regno].id = ++env->id_gen; -+ /* A load of ctx field could have different -+ * actual load size with the one encoded in the -+ * insn. When the dst is PTR, it is for sure not -+ * a sub-register. -+ */ -+ regs[value_regno].subreg_def = DEF_NOT_SUBREG; -+ } -+ regs[value_regno].type = reg_type; -+ } -+ -+ } else if (reg->type == PTR_TO_STACK) { -+ off += reg->var_off.value; -+ err = check_stack_access(env, reg, off, size); -+ if (err) -+ return err; -+ -+ state = func(env, reg); -+ err = update_stack_depth(env, state, off); -+ if (err) -+ return err; -+ -+ if (t == BPF_WRITE) -+ err = check_stack_write(env, state, off, size, -+ value_regno, insn_idx); -+ else -+ err = check_stack_read(env, state, off, size, -+ value_regno); -+ } else if (reg_is_pkt_pointer(reg)) { -+ if (t == BPF_WRITE && !may_access_direct_pkt_data(env, NULL, t)) { -+ verbose(env, "cannot write into packet\n"); -+ return -EACCES; -+ } -+ if (t == BPF_WRITE && value_regno >= 0 && -+ is_pointer_value(env, value_regno)) { -+ verbose(env, "R%d leaks addr into packet\n", -+ value_regno); -+ return -EACCES; -+ } -+ err = check_packet_access(env, regno, off, size, false); -+ if (!err && t == BPF_READ && value_regno >= 0) -+ mark_reg_unknown(env, regs, value_regno); -+ } else if (reg->type == PTR_TO_FLOW_KEYS) { -+ if (t == BPF_WRITE && value_regno >= 0 && -+ is_pointer_value(env, value_regno)) { -+ verbose(env, "R%d leaks addr into flow keys\n", -+ value_regno); - return -EACCES; - } -+ -+ err = check_flow_keys_access(env, off, size); -+ if (!err && t == BPF_READ && value_regno >= 0) -+ mark_reg_unknown(env, regs, value_regno); -+ } else if (type_is_sk_pointer(reg->type)) { - if (t == BPF_WRITE) { -- if (!env->allow_ptr_leaks && -- state->stack_slot_type[MAX_BPF_STACK + off] == STACK_SPILL && -- size != BPF_REG_SIZE) { -- verbose("attempt to corrupt spilled pointer on stack\n"); -- return -EACCES; -- } -- err = check_stack_write(state, off, size, value_regno); -- } else { -- err = check_stack_read(state, off, size, value_regno); -+ verbose(env, "R%d cannot write into %s\n", -+ regno, reg_type_str[reg->type]); -+ return -EACCES; - } -+ err = check_sock_access(env, insn_idx, regno, off, size, t); -+ if (!err && value_regno >= 0) -+ mark_reg_unknown(env, regs, value_regno); -+ } else if (reg->type == PTR_TO_TP_BUFFER) { -+ err = check_tp_buffer_access(env, reg, regno, off, size); -+ if (!err && t == BPF_READ && value_regno >= 0) -+ mark_reg_unknown(env, regs, value_regno); - } else { -- verbose("R%d invalid mem access '%s'\n", -- regno, reg_type_str[state->regs[regno].type]); -+ verbose(env, "R%d invalid mem access '%s'\n", regno, -+ reg_type_str[reg->type]); - return -EACCES; - } -+ -+ if (!err && size < BPF_REG_SIZE && value_regno >= 0 && t == BPF_READ && -+ regs[value_regno].type == SCALAR_VALUE) { -+ /* b/h/w load zero-extends, mark upper bits as known 0 */ -+ coerce_reg_to_size(®s[value_regno], size); -+ } - return err; - } - --static int check_xadd(struct verifier_env *env, struct bpf_insn *insn) -+static int check_xadd(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) - { -- struct reg_state *regs = env->cur_state.regs; - int err; - - if ((BPF_SIZE(insn->code) != BPF_W && BPF_SIZE(insn->code) != BPF_DW) || - insn->imm != 0) { -- verbose("BPF_XADD uses reserved fields\n"); -+ verbose(env, "BPF_XADD uses reserved fields\n"); - return -EINVAL; - } - - /* check src1 operand */ -- err = check_reg_arg(regs, insn->src_reg, SRC_OP); -+ err = check_reg_arg(env, insn->src_reg, SRC_OP); - if (err) - return err; - - /* check src2 operand */ -- err = check_reg_arg(regs, insn->dst_reg, SRC_OP); -+ err = check_reg_arg(env, insn->dst_reg, SRC_OP); - if (err) - return err; - -+ if (is_pointer_value(env, insn->src_reg)) { -+ verbose(env, "R%d leaks addr into mem\n", insn->src_reg); -+ return -EACCES; -+ } -+ -+ if (is_ctx_reg(env, insn->dst_reg) || -+ is_pkt_reg(env, insn->dst_reg) || -+ is_flow_key_reg(env, insn->dst_reg) || -+ is_sk_reg(env, insn->dst_reg)) { -+ verbose(env, "BPF_XADD stores into R%d %s is not allowed\n", -+ insn->dst_reg, -+ reg_type_str[reg_state(env, insn->dst_reg)->type]); -+ return -EACCES; -+ } -+ - /* check whether atomic_add can read the memory */ -- err = check_mem_access(env, insn->dst_reg, insn->off, -- BPF_SIZE(insn->code), BPF_READ, -1); -+ err = check_mem_access(env, insn_idx, insn->dst_reg, insn->off, -+ BPF_SIZE(insn->code), BPF_READ, -1, true); - if (err) - return err; - - /* check whether atomic_add can write into the same memory */ -- return check_mem_access(env, insn->dst_reg, insn->off, -- BPF_SIZE(insn->code), BPF_WRITE, -1); -+ return check_mem_access(env, insn_idx, insn->dst_reg, insn->off, -+ BPF_SIZE(insn->code), BPF_WRITE, -1, true); -+} -+ -+static int __check_stack_boundary(struct bpf_verifier_env *env, u32 regno, -+ int off, int access_size, -+ bool zero_size_allowed) -+{ -+ struct bpf_reg_state *reg = reg_state(env, regno); -+ -+ if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 || -+ access_size < 0 || (access_size == 0 && !zero_size_allowed)) { -+ if (tnum_is_const(reg->var_off)) { -+ verbose(env, "invalid stack type R%d off=%d access_size=%d\n", -+ regno, off, access_size); -+ } else { -+ char tn_buf[48]; -+ -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, "invalid stack type R%d var_off=%s access_size=%d\n", -+ regno, tn_buf, access_size); -+ } -+ return -EACCES; -+ } -+ return 0; - } - - /* when register 'regno' is passed into function that will read 'access_size' - * bytes from that pointer, make sure that it's within stack boundary -- * and all elements of stack are initialized -+ * and all elements of stack are initialized. -+ * Unlike most pointer bounds-checking functions, this one doesn't take an -+ * 'off' argument, so it has to add in reg->off itself. - */ --static int check_stack_boundary(struct verifier_env *env, -- int regno, int access_size) -+static int check_stack_boundary(struct bpf_verifier_env *env, int regno, -+ int access_size, bool zero_size_allowed, -+ struct bpf_call_arg_meta *meta) - { -- struct verifier_state *state = &env->cur_state; -- struct reg_state *regs = state->regs; -- int off, i; -+ struct bpf_reg_state *reg = reg_state(env, regno); -+ struct bpf_func_state *state = func(env, reg); -+ int err, min_off, max_off, i, j, slot, spi; -+ -+ if (reg->type != PTR_TO_STACK) { -+ /* Allow zero-byte read from NULL, regardless of pointer type */ -+ if (zero_size_allowed && access_size == 0 && -+ register_is_null(reg)) -+ return 0; - -- if (regs[regno].type != PTR_TO_STACK) -+ verbose(env, "R%d type=%s expected=%s\n", regno, -+ reg_type_str[reg->type], -+ reg_type_str[PTR_TO_STACK]); - return -EACCES; -+ } - -- off = regs[regno].imm; -- if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 || -- access_size <= 0) { -- verbose("invalid stack type R%d off=%d access_size=%d\n", -- regno, off, access_size); -+ if (tnum_is_const(reg->var_off)) { -+ min_off = max_off = reg->var_off.value + reg->off; -+ err = __check_stack_boundary(env, regno, min_off, access_size, -+ zero_size_allowed); -+ if (err) -+ return err; -+ } else { -+ /* Variable offset is prohibited for unprivileged mode for -+ * simplicity since it requires corresponding support in -+ * Spectre masking for stack ALU. -+ * See also retrieve_ptr_limit(). -+ */ -+ if (!env->allow_ptr_leaks) { -+ char tn_buf[48]; -+ -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, "R%d indirect variable offset stack access prohibited for !root, var_off=%s\n", -+ regno, tn_buf); -+ return -EACCES; -+ } -+ /* Only initialized buffer on stack is allowed to be accessed -+ * with variable offset. With uninitialized buffer it's hard to -+ * guarantee that whole memory is marked as initialized on -+ * helper return since specific bounds are unknown what may -+ * cause uninitialized stack leaking. -+ */ -+ if (meta && meta->raw_mode) -+ meta = NULL; -+ -+ if (reg->smax_value >= BPF_MAX_VAR_OFF || -+ reg->smax_value <= -BPF_MAX_VAR_OFF) { -+ verbose(env, "R%d unbounded indirect variable offset stack access\n", -+ regno); -+ return -EACCES; -+ } -+ min_off = reg->smin_value + reg->off; -+ max_off = reg->smax_value + reg->off; -+ err = __check_stack_boundary(env, regno, min_off, access_size, -+ zero_size_allowed); -+ if (err) { -+ verbose(env, "R%d min value is outside of stack bound\n", -+ regno); -+ return err; -+ } -+ err = __check_stack_boundary(env, regno, max_off, access_size, -+ zero_size_allowed); -+ if (err) { -+ verbose(env, "R%d max value is outside of stack bound\n", -+ regno); -+ return err; -+ } -+ } -+ -+ if (meta && meta->raw_mode) { -+ meta->access_size = access_size; -+ meta->regno = regno; -+ return 0; -+ } -+ -+ for (i = min_off; i < max_off + access_size; i++) { -+ u8 *stype; -+ -+ slot = -i - 1; -+ spi = slot / BPF_REG_SIZE; -+ if (state->allocated_stack <= slot) -+ goto err; -+ stype = &state->stack[spi].slot_type[slot % BPF_REG_SIZE]; -+ if (*stype == STACK_MISC) -+ goto mark; -+ if (*stype == STACK_ZERO) { -+ /* helper can write anything into the stack */ -+ *stype = STACK_MISC; -+ goto mark; -+ } -+ if (state->stack[spi].slot_type[0] == STACK_SPILL && -+ state->stack[spi].spilled_ptr.type == SCALAR_VALUE) { -+ __mark_reg_unknown(env, &state->stack[spi].spilled_ptr); -+ for (j = 0; j < BPF_REG_SIZE; j++) -+ state->stack[spi].slot_type[j] = STACK_MISC; -+ goto mark; -+ } -+ -+err: -+ if (tnum_is_const(reg->var_off)) { -+ verbose(env, "invalid indirect read from stack off %d+%d size %d\n", -+ min_off, i - min_off, access_size); -+ } else { -+ char tn_buf[48]; -+ -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, "invalid indirect read from stack var_off %s+%d size %d\n", -+ tn_buf, i - min_off, access_size); -+ } - return -EACCES; -+mark: -+ /* reading any byte out of 8-byte 'spill_slot' will cause -+ * the whole slot to be marked as 'read' -+ */ -+ mark_reg_read(env, &state->stack[spi].spilled_ptr, -+ state->stack[spi].spilled_ptr.parent, -+ REG_LIVE_READ64); - } -+ return update_stack_depth(env, state, min_off); -+} -+ -+static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, -+ int access_size, bool zero_size_allowed, -+ struct bpf_call_arg_meta *meta) -+{ -+ struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno]; - -- for (i = 0; i < access_size; i++) { -- if (state->stack_slot_type[MAX_BPF_STACK + off + i] != STACK_MISC) { -- verbose("invalid indirect read from stack off %d+%d size %d\n", -- off, i, access_size); -+ switch (reg->type) { -+ case PTR_TO_PACKET: -+ case PTR_TO_PACKET_META: -+ return check_packet_access(env, regno, reg->off, access_size, -+ zero_size_allowed); -+ case PTR_TO_MAP_VALUE: -+ if (check_map_access_type(env, regno, reg->off, access_size, -+ meta && meta->raw_mode ? BPF_WRITE : -+ BPF_READ)) - return -EACCES; -+ return check_map_access(env, regno, reg->off, access_size, -+ zero_size_allowed); -+ default: /* scalar_value|ptr_to_stack or invalid ptr */ -+ return check_stack_boundary(env, regno, access_size, -+ zero_size_allowed, meta); -+ } -+} -+ -+/* Implementation details: -+ * bpf_map_lookup returns PTR_TO_MAP_VALUE_OR_NULL -+ * Two bpf_map_lookups (even with the same key) will have different reg->id. -+ * For traditional PTR_TO_MAP_VALUE the verifier clears reg->id after -+ * value_or_null->value transition, since the verifier only cares about -+ * the range of access to valid map value pointer and doesn't care about actual -+ * address of the map element. -+ * For maps with 'struct bpf_spin_lock' inside map value the verifier keeps -+ * reg->id > 0 after value_or_null->value transition. By doing so -+ * two bpf_map_lookups will be considered two different pointers that -+ * point to different bpf_spin_locks. -+ * The verifier allows taking only one bpf_spin_lock at a time to avoid -+ * dead-locks. -+ * Since only one bpf_spin_lock is allowed the checks are simpler than -+ * reg_is_refcounted() logic. The verifier needs to remember only -+ * one spin_lock instead of array of acquired_refs. -+ * cur_state->active_spin_lock remembers which map value element got locked -+ * and clears it after bpf_spin_unlock. -+ */ -+static int process_spin_lock(struct bpf_verifier_env *env, int regno, -+ bool is_lock) -+{ -+ struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno]; -+ struct bpf_verifier_state *cur = env->cur_state; -+ bool is_const = tnum_is_const(reg->var_off); -+ struct bpf_map *map = reg->map_ptr; -+ u64 val = reg->var_off.value; -+ -+ if (reg->type != PTR_TO_MAP_VALUE) { -+ verbose(env, "R%d is not a pointer to map_value\n", regno); -+ return -EINVAL; -+ } -+ if (!is_const) { -+ verbose(env, -+ "R%d doesn't have constant offset. bpf_spin_lock has to be at the constant offset\n", -+ regno); -+ return -EINVAL; -+ } -+ if (!map->btf) { -+ verbose(env, -+ "map '%s' has to have BTF in order to use bpf_spin_lock\n", -+ map->name); -+ return -EINVAL; -+ } -+ if (!map_value_has_spin_lock(map)) { -+ if (map->spin_lock_off == -E2BIG) -+ verbose(env, -+ "map '%s' has more than one 'struct bpf_spin_lock'\n", -+ map->name); -+ else if (map->spin_lock_off == -ENOENT) -+ verbose(env, -+ "map '%s' doesn't have 'struct bpf_spin_lock'\n", -+ map->name); -+ else -+ verbose(env, -+ "map '%s' is not a struct type or bpf_spin_lock is mangled\n", -+ map->name); -+ return -EINVAL; -+ } -+ if (map->spin_lock_off != val + reg->off) { -+ verbose(env, "off %lld doesn't point to 'struct bpf_spin_lock'\n", -+ val + reg->off); -+ return -EINVAL; -+ } -+ if (is_lock) { -+ if (cur->active_spin_lock) { -+ verbose(env, -+ "Locking two bpf_spin_locks are not allowed\n"); -+ return -EINVAL; -+ } -+ cur->active_spin_lock = reg->id; -+ } else { -+ if (!cur->active_spin_lock) { -+ verbose(env, "bpf_spin_unlock without taking a lock\n"); -+ return -EINVAL; - } -+ if (cur->active_spin_lock != reg->id) { -+ verbose(env, "bpf_spin_unlock of different lock\n"); -+ return -EINVAL; -+ } -+ cur->active_spin_lock = 0; - } - return 0; - } - --static int check_func_arg(struct verifier_env *env, u32 regno, -- enum bpf_arg_type arg_type, struct bpf_map **mapp) -+static bool arg_type_is_mem_ptr(enum bpf_arg_type type) -+{ -+ return type == ARG_PTR_TO_MEM || -+ type == ARG_PTR_TO_MEM_OR_NULL || -+ type == ARG_PTR_TO_UNINIT_MEM; -+} -+ -+static bool arg_type_is_mem_size(enum bpf_arg_type type) -+{ -+ return type == ARG_CONST_SIZE || -+ type == ARG_CONST_SIZE_OR_ZERO; -+} -+ -+static bool arg_type_is_int_ptr(enum bpf_arg_type type) -+{ -+ return type == ARG_PTR_TO_INT || -+ type == ARG_PTR_TO_LONG; -+} -+ -+static int int_ptr_type_to_size(enum bpf_arg_type type) -+{ -+ if (type == ARG_PTR_TO_INT) -+ return sizeof(u32); -+ else if (type == ARG_PTR_TO_LONG) -+ return sizeof(u64); -+ -+ return -EINVAL; -+} -+ -+static int check_func_arg(struct bpf_verifier_env *env, u32 regno, -+ enum bpf_arg_type arg_type, -+ struct bpf_call_arg_meta *meta) - { -- struct reg_state *reg = env->cur_state.regs + regno; -- enum bpf_reg_type expected_type; -+ struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno]; -+ enum bpf_reg_type expected_type, type = reg->type; - int err = 0; - - if (arg_type == ARG_DONTCARE) - return 0; - -- if (reg->type == NOT_INIT) { -- verbose("R%d !read_ok\n", regno); -- return -EACCES; -- } -+ err = check_reg_arg(env, regno, SRC_OP); -+ if (err) -+ return err; - - if (arg_type == ARG_ANYTHING) { - if (is_pointer_value(env, regno)) { -- verbose("R%d leaks addr into helper function\n", regno); -+ verbose(env, "R%d leaks addr into helper function\n", -+ regno); - return -EACCES; - } - return 0; - } - -- if (arg_type == ARG_PTR_TO_STACK || arg_type == ARG_PTR_TO_MAP_KEY || -- arg_type == ARG_PTR_TO_MAP_VALUE) { -+ if (type_is_pkt_pointer(type) && -+ !may_access_direct_pkt_data(env, meta, BPF_READ)) { -+ verbose(env, "helper access to the packet is not allowed\n"); -+ return -EACCES; -+ } -+ -+ if (arg_type == ARG_PTR_TO_MAP_KEY || -+ arg_type == ARG_PTR_TO_MAP_VALUE || -+ arg_type == ARG_PTR_TO_UNINIT_MAP_VALUE || -+ arg_type == ARG_PTR_TO_MAP_VALUE_OR_NULL) { - expected_type = PTR_TO_STACK; -- } else if (arg_type == ARG_CONST_STACK_SIZE) { -- expected_type = CONST_IMM; -+ if (register_is_null(reg) && -+ arg_type == ARG_PTR_TO_MAP_VALUE_OR_NULL) -+ /* final test in check_stack_boundary() */; -+ else if (!type_is_pkt_pointer(type) && -+ type != PTR_TO_MAP_VALUE && -+ type != expected_type) -+ goto err_type; -+ } else if (arg_type == ARG_CONST_SIZE || -+ arg_type == ARG_CONST_SIZE_OR_ZERO) { -+ expected_type = SCALAR_VALUE; -+ if (type != expected_type) -+ goto err_type; - } else if (arg_type == ARG_CONST_MAP_PTR) { - expected_type = CONST_PTR_TO_MAP; -+ if (type != expected_type) -+ goto err_type; - } else if (arg_type == ARG_PTR_TO_CTX) { - expected_type = PTR_TO_CTX; -+ if (type != expected_type) -+ goto err_type; -+ err = check_ctx_reg(env, reg, regno); -+ if (err < 0) -+ return err; -+ } else if (arg_type == ARG_PTR_TO_SOCK_COMMON) { -+ expected_type = PTR_TO_SOCK_COMMON; -+ /* Any sk pointer can be ARG_PTR_TO_SOCK_COMMON */ -+ if (!type_is_sk_pointer(type)) -+ goto err_type; -+ if (reg->ref_obj_id) { -+ if (meta->ref_obj_id) { -+ verbose(env, "verifier internal error: more than one arg with ref_obj_id R%d %u %u\n", -+ regno, reg->ref_obj_id, -+ meta->ref_obj_id); -+ return -EFAULT; -+ } -+ meta->ref_obj_id = reg->ref_obj_id; -+ } -+ } else if (arg_type == ARG_PTR_TO_SOCKET) { -+ expected_type = PTR_TO_SOCKET; -+ if (type != expected_type) -+ goto err_type; -+ } else if (arg_type == ARG_PTR_TO_SPIN_LOCK) { -+ if (meta->func_id == BPF_FUNC_spin_lock) { -+ if (process_spin_lock(env, regno, true)) -+ return -EACCES; -+ } else if (meta->func_id == BPF_FUNC_spin_unlock) { -+ if (process_spin_lock(env, regno, false)) -+ return -EACCES; -+ } else { -+ verbose(env, "verifier internal error\n"); -+ return -EFAULT; -+ } -+ } else if (arg_type_is_mem_ptr(arg_type)) { -+ expected_type = PTR_TO_STACK; -+ /* One exception here. In case function allows for NULL to be -+ * passed in as argument, it's a SCALAR_VALUE type. Final test -+ * happens during stack boundary checking. -+ */ -+ if (register_is_null(reg) && -+ arg_type == ARG_PTR_TO_MEM_OR_NULL) -+ /* final test in check_stack_boundary() */; -+ else if (!type_is_pkt_pointer(type) && -+ type != PTR_TO_MAP_VALUE && -+ type != expected_type) -+ goto err_type; -+ meta->raw_mode = arg_type == ARG_PTR_TO_UNINIT_MEM; -+ } else if (arg_type_is_int_ptr(arg_type)) { -+ expected_type = PTR_TO_STACK; -+ if (!type_is_pkt_pointer(type) && -+ type != PTR_TO_MAP_VALUE && -+ type != expected_type) -+ goto err_type; - } else { -- verbose("unsupported arg_type %d\n", arg_type); -+ verbose(env, "unsupported arg_type %d\n", arg_type); - return -EFAULT; - } - -- if (reg->type != expected_type) { -- verbose("R%d type=%s expected=%s\n", regno, -- reg_type_str[reg->type], reg_type_str[expected_type]); -- return -EACCES; -- } -- - if (arg_type == ARG_CONST_MAP_PTR) { - /* bpf_map_xxx(map_ptr) call: remember that map_ptr */ -- *mapp = reg->map_ptr; -- -+ meta->map_ptr = reg->map_ptr; - } else if (arg_type == ARG_PTR_TO_MAP_KEY) { - /* bpf_map_xxx(..., map_ptr, ..., key) call: - * check that [key, key + map->key_size) are within - * stack limits and initialized - */ -- if (!*mapp) { -+ if (!meta->map_ptr) { - /* in function declaration map_ptr must come before - * map_key, so that it's verified and known before - * we have to check map_key here. Otherwise it means - * that kernel subsystem misconfigured verifier - */ -- verbose("invalid map_ptr to access map->key\n"); -+ verbose(env, "invalid map_ptr to access map->key\n"); - return -EACCES; - } -- err = check_stack_boundary(env, regno, (*mapp)->key_size); -- -- } else if (arg_type == ARG_PTR_TO_MAP_VALUE) { -+ err = check_helper_mem_access(env, regno, -+ meta->map_ptr->key_size, false, -+ NULL); -+ } else if (arg_type == ARG_PTR_TO_MAP_VALUE || -+ (arg_type == ARG_PTR_TO_MAP_VALUE_OR_NULL && -+ !register_is_null(reg)) || -+ arg_type == ARG_PTR_TO_UNINIT_MAP_VALUE) { - /* bpf_map_xxx(..., map_ptr, ..., value) call: - * check [value, value + map->value_size) validity - */ -- if (!*mapp) { -+ if (!meta->map_ptr) { - /* kernel subsystem misconfigured verifier */ -- verbose("invalid map_ptr to access map->value\n"); -+ verbose(env, "invalid map_ptr to access map->value\n"); - return -EACCES; - } -- err = check_stack_boundary(env, regno, (*mapp)->value_size); -+ meta->raw_mode = (arg_type == ARG_PTR_TO_UNINIT_MAP_VALUE); -+ err = check_helper_mem_access(env, regno, -+ meta->map_ptr->value_size, false, -+ meta); -+ } else if (arg_type_is_mem_size(arg_type)) { -+ bool zero_size_allowed = (arg_type == ARG_CONST_SIZE_OR_ZERO); - -- } else if (arg_type == ARG_CONST_STACK_SIZE) { -- /* bpf_xxx(..., buf, len) call will access 'len' bytes -- * from stack pointer 'buf'. Check it -- * note: regno == len, regno - 1 == buf -+ /* remember the mem_size which may be used later -+ * to refine return values. - */ -- if (regno == 0) { -- /* kernel subsystem misconfigured verifier */ -- verbose("ARG_CONST_STACK_SIZE cannot be first argument\n"); -+ meta->msize_max_value = reg->umax_value; -+ -+ /* The register is SCALAR_VALUE; the access check -+ * happens using its boundaries. -+ */ -+ if (!tnum_is_const(reg->var_off)) -+ /* For unprivileged variable accesses, disable raw -+ * mode so that the program is required to -+ * initialize all the memory that the helper could -+ * just partially fill up. -+ */ -+ meta = NULL; -+ -+ if (reg->smin_value < 0) { -+ verbose(env, "R%d min value is negative, either use unsigned or 'var &= const'\n", -+ regno); -+ return -EACCES; -+ } -+ -+ if (reg->umin_value == 0) { -+ err = check_helper_mem_access(env, regno - 1, 0, -+ zero_size_allowed, -+ meta); -+ if (err) -+ return err; -+ } -+ -+ if (reg->umax_value >= BPF_MAX_VAR_SIZ) { -+ verbose(env, "R%d unbounded memory access, use 'var &= const' or 'if (var < const)'\n", -+ regno); - return -EACCES; - } -- err = check_stack_boundary(env, regno - 1, reg->imm); -+ err = check_helper_mem_access(env, regno - 1, -+ reg->umax_value, -+ zero_size_allowed, meta); -+ if (!err) -+ err = mark_chain_precision(env, regno); -+ } else if (arg_type_is_int_ptr(arg_type)) { -+ int size = int_ptr_type_to_size(arg_type); -+ -+ err = check_helper_mem_access(env, regno, size, false, meta); -+ if (err) -+ return err; -+ err = check_ptr_alignment(env, reg, 0, size, true); - } - - return err; -+err_type: -+ verbose(env, "R%d type=%s expected=%s\n", regno, -+ reg_type_str[type], reg_type_str[expected_type]); -+ return -EACCES; - } - --static int check_map_func_compatibility(struct bpf_map *map, int func_id) -+static int check_map_func_compatibility(struct bpf_verifier_env *env, -+ struct bpf_map *map, int func_id) - { - if (!map) - return 0; -@@ -911,7 +3474,74 @@ static int check_map_func_compatibility( - break; - case BPF_MAP_TYPE_PERF_EVENT_ARRAY: - if (func_id != BPF_FUNC_perf_event_read && -- func_id != BPF_FUNC_perf_event_output) -+ func_id != BPF_FUNC_perf_event_output && -+ func_id != BPF_FUNC_perf_event_read_value) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_STACK_TRACE: -+ if (func_id != BPF_FUNC_get_stackid) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_CGROUP_ARRAY: -+ if (func_id != BPF_FUNC_skb_under_cgroup && -+ func_id != BPF_FUNC_current_task_under_cgroup) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_CGROUP_STORAGE: -+ if (func_id != BPF_FUNC_get_local_storage) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_DEVMAP: -+ case BPF_MAP_TYPE_DEVMAP_HASH: -+ if (func_id != BPF_FUNC_redirect_map && -+ func_id != BPF_FUNC_map_lookup_elem) -+ goto error; -+ break; -+ /* Restrict bpf side of cpumap and xskmap, open when use-cases -+ * appear. -+ */ -+ case BPF_MAP_TYPE_CPUMAP: -+ if (func_id != BPF_FUNC_redirect_map) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_XSKMAP: -+ if (func_id != BPF_FUNC_redirect_map && -+ func_id != BPF_FUNC_map_lookup_elem) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_ARRAY_OF_MAPS: -+ case BPF_MAP_TYPE_HASH_OF_MAPS: -+ if (func_id != BPF_FUNC_map_lookup_elem) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_SOCKMAP: -+ if (func_id != BPF_FUNC_sk_redirect_map && -+ func_id != BPF_FUNC_sock_map_update && -+ func_id != BPF_FUNC_map_delete_elem && -+ func_id != BPF_FUNC_msg_redirect_map) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_SOCKHASH: -+ if (func_id != BPF_FUNC_sk_redirect_hash && -+ func_id != BPF_FUNC_sock_hash_update && -+ func_id != BPF_FUNC_map_delete_elem && -+ func_id != BPF_FUNC_msg_redirect_hash) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_REUSEPORT_SOCKARRAY: -+ if (func_id != BPF_FUNC_sk_select_reuseport) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_QUEUE: -+ case BPF_MAP_TYPE_STACK: -+ if (func_id != BPF_FUNC_map_peek_elem && -+ func_id != BPF_FUNC_map_pop_elem && -+ func_id != BPF_FUNC_map_push_elem) -+ goto error; -+ break; -+ case BPF_MAP_TYPE_SK_STORAGE: -+ if (func_id != BPF_FUNC_sk_storage_get && -+ func_id != BPF_FUNC_sk_storage_delete) - goto error; - break; - default: -@@ -923,109 +3553,1579 @@ static int check_map_func_compatibility( - case BPF_FUNC_tail_call: - if (map->map_type != BPF_MAP_TYPE_PROG_ARRAY) - goto error; -+ if (env->subprog_cnt > 1) { -+ verbose(env, "tail_calls are not allowed in programs with bpf-to-bpf calls\n"); -+ return -EINVAL; -+ } - break; - case BPF_FUNC_perf_event_read: - case BPF_FUNC_perf_event_output: -+ case BPF_FUNC_perf_event_read_value: - if (map->map_type != BPF_MAP_TYPE_PERF_EVENT_ARRAY) - goto error; - break; -+ case BPF_FUNC_get_stackid: -+ if (map->map_type != BPF_MAP_TYPE_STACK_TRACE) -+ goto error; -+ break; -+ case BPF_FUNC_current_task_under_cgroup: -+ case BPF_FUNC_skb_under_cgroup: -+ if (map->map_type != BPF_MAP_TYPE_CGROUP_ARRAY) -+ goto error; -+ break; -+ case BPF_FUNC_redirect_map: -+ if (map->map_type != BPF_MAP_TYPE_DEVMAP && -+ map->map_type != BPF_MAP_TYPE_DEVMAP_HASH && -+ map->map_type != BPF_MAP_TYPE_CPUMAP && -+ map->map_type != BPF_MAP_TYPE_XSKMAP) -+ goto error; -+ break; -+ case BPF_FUNC_sk_redirect_map: -+ case BPF_FUNC_msg_redirect_map: -+ case BPF_FUNC_sock_map_update: -+ if (map->map_type != BPF_MAP_TYPE_SOCKMAP) -+ goto error; -+ break; -+ case BPF_FUNC_sk_redirect_hash: -+ case BPF_FUNC_msg_redirect_hash: -+ case BPF_FUNC_sock_hash_update: -+ if (map->map_type != BPF_MAP_TYPE_SOCKHASH) -+ goto error; -+ break; -+ case BPF_FUNC_get_local_storage: -+ if (map->map_type != BPF_MAP_TYPE_CGROUP_STORAGE && -+ map->map_type != BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) -+ goto error; -+ break; -+ case BPF_FUNC_sk_select_reuseport: -+ if (map->map_type != BPF_MAP_TYPE_REUSEPORT_SOCKARRAY) -+ goto error; -+ break; -+ case BPF_FUNC_map_peek_elem: -+ case BPF_FUNC_map_pop_elem: -+ case BPF_FUNC_map_push_elem: -+ if (map->map_type != BPF_MAP_TYPE_QUEUE && -+ map->map_type != BPF_MAP_TYPE_STACK) -+ goto error; -+ break; -+ case BPF_FUNC_sk_storage_get: -+ case BPF_FUNC_sk_storage_delete: -+ if (map->map_type != BPF_MAP_TYPE_SK_STORAGE) -+ goto error; -+ break; - default: - break; - } - - return 0; - error: -- verbose("cannot pass map_type %d into func %d\n", -- map->map_type, func_id); -+ verbose(env, "cannot pass map_type %d into func %s#%d\n", -+ map->map_type, func_id_name(func_id), func_id); - return -EINVAL; - } - --static int check_call(struct verifier_env *env, int func_id) -+static bool check_raw_mode_ok(const struct bpf_func_proto *fn) -+{ -+ int count = 0; -+ -+ if (fn->arg1_type == ARG_PTR_TO_UNINIT_MEM) -+ count++; -+ if (fn->arg2_type == ARG_PTR_TO_UNINIT_MEM) -+ count++; -+ if (fn->arg3_type == ARG_PTR_TO_UNINIT_MEM) -+ count++; -+ if (fn->arg4_type == ARG_PTR_TO_UNINIT_MEM) -+ count++; -+ if (fn->arg5_type == ARG_PTR_TO_UNINIT_MEM) -+ count++; -+ -+ /* We only support one arg being in raw mode at the moment, -+ * which is sufficient for the helper functions we have -+ * right now. -+ */ -+ return count <= 1; -+} -+ -+static bool check_args_pair_invalid(enum bpf_arg_type arg_curr, -+ enum bpf_arg_type arg_next) -+{ -+ return (arg_type_is_mem_ptr(arg_curr) && -+ !arg_type_is_mem_size(arg_next)) || -+ (!arg_type_is_mem_ptr(arg_curr) && -+ arg_type_is_mem_size(arg_next)); -+} -+ -+static bool check_arg_pair_ok(const struct bpf_func_proto *fn) -+{ -+ /* bpf_xxx(..., buf, len) call will access 'len' -+ * bytes from memory 'buf'. Both arg types need -+ * to be paired, so make sure there's no buggy -+ * helper function specification. -+ */ -+ if (arg_type_is_mem_size(fn->arg1_type) || -+ arg_type_is_mem_ptr(fn->arg5_type) || -+ check_args_pair_invalid(fn->arg1_type, fn->arg2_type) || -+ check_args_pair_invalid(fn->arg2_type, fn->arg3_type) || -+ check_args_pair_invalid(fn->arg3_type, fn->arg4_type) || -+ check_args_pair_invalid(fn->arg4_type, fn->arg5_type)) -+ return false; -+ -+ return true; -+} -+ -+static bool check_refcount_ok(const struct bpf_func_proto *fn, int func_id) -+{ -+ int count = 0; -+ -+ if (arg_type_may_be_refcounted(fn->arg1_type)) -+ count++; -+ if (arg_type_may_be_refcounted(fn->arg2_type)) -+ count++; -+ if (arg_type_may_be_refcounted(fn->arg3_type)) -+ count++; -+ if (arg_type_may_be_refcounted(fn->arg4_type)) -+ count++; -+ if (arg_type_may_be_refcounted(fn->arg5_type)) -+ count++; -+ -+ /* A reference acquiring function cannot acquire -+ * another refcounted ptr. -+ */ -+ if (is_acquire_function(func_id) && count) -+ return false; -+ -+ /* We only support one arg being unreferenced at the moment, -+ * which is sufficient for the helper functions we have right now. -+ */ -+ return count <= 1; -+} -+ -+static int check_func_proto(const struct bpf_func_proto *fn, int func_id) -+{ -+ return check_raw_mode_ok(fn) && -+ check_arg_pair_ok(fn) && -+ check_refcount_ok(fn, func_id) ? 0 : -EINVAL; -+} -+ -+/* Packet data might have moved, any old PTR_TO_PACKET[_META,_END] -+ * are now invalid, so turn them into unknown SCALAR_VALUE. -+ */ -+static void __clear_all_pkt_pointers(struct bpf_verifier_env *env, -+ struct bpf_func_state *state) -+{ -+ struct bpf_reg_state *regs = state->regs, *reg; -+ int i; -+ -+ for (i = 0; i < MAX_BPF_REG; i++) -+ if (reg_is_pkt_pointer_any(®s[i])) -+ mark_reg_unknown(env, regs, i); -+ -+ bpf_for_each_spilled_reg(i, state, reg) { -+ if (!reg) -+ continue; -+ if (reg_is_pkt_pointer_any(reg)) -+ __mark_reg_unknown(env, reg); -+ } -+} -+ -+static void clear_all_pkt_pointers(struct bpf_verifier_env *env) -+{ -+ struct bpf_verifier_state *vstate = env->cur_state; -+ int i; -+ -+ for (i = 0; i <= vstate->curframe; i++) -+ __clear_all_pkt_pointers(env, vstate->frame[i]); -+} -+ -+static void release_reg_references(struct bpf_verifier_env *env, -+ struct bpf_func_state *state, -+ int ref_obj_id) -+{ -+ struct bpf_reg_state *regs = state->regs, *reg; -+ int i; -+ -+ for (i = 0; i < MAX_BPF_REG; i++) -+ if (regs[i].ref_obj_id == ref_obj_id) -+ mark_reg_unknown(env, regs, i); -+ -+ bpf_for_each_spilled_reg(i, state, reg) { -+ if (!reg) -+ continue; -+ if (reg->ref_obj_id == ref_obj_id) -+ __mark_reg_unknown(env, reg); -+ } -+} -+ -+/* The pointer with the specified id has released its reference to kernel -+ * resources. Identify all copies of the same pointer and clear the reference. -+ */ -+static int release_reference(struct bpf_verifier_env *env, -+ int ref_obj_id) -+{ -+ struct bpf_verifier_state *vstate = env->cur_state; -+ int err; -+ int i; -+ -+ err = release_reference_state(cur_func(env), ref_obj_id); -+ if (err) -+ return err; -+ -+ for (i = 0; i <= vstate->curframe; i++) -+ release_reg_references(env, vstate->frame[i], ref_obj_id); -+ -+ return 0; -+} -+ -+static int check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn, -+ int *insn_idx) -+{ -+ struct bpf_verifier_state *state = env->cur_state; -+ struct bpf_func_state *caller, *callee; -+ int i, err, subprog, target_insn; -+ -+ if (state->curframe + 1 >= MAX_CALL_FRAMES) { -+ verbose(env, "the call stack of %d frames is too deep\n", -+ state->curframe + 2); -+ return -E2BIG; -+ } -+ -+ target_insn = *insn_idx + insn->imm; -+ subprog = find_subprog(env, target_insn + 1); -+ if (subprog < 0) { -+ verbose(env, "verifier bug. No program starts at insn %d\n", -+ target_insn + 1); -+ return -EFAULT; -+ } -+ -+ caller = state->frame[state->curframe]; -+ if (state->frame[state->curframe + 1]) { -+ verbose(env, "verifier bug. Frame %d already allocated\n", -+ state->curframe + 1); -+ return -EFAULT; -+ } -+ -+ callee = kzalloc(sizeof(*callee), GFP_KERNEL); -+ if (!callee) -+ return -ENOMEM; -+ state->frame[state->curframe + 1] = callee; -+ -+ /* callee cannot access r0, r6 - r9 for reading and has to write -+ * into its own stack before reading from it. -+ * callee can read/write into caller's stack -+ */ -+ init_func_state(env, callee, -+ /* remember the callsite, it will be used by bpf_exit */ -+ *insn_idx /* callsite */, -+ state->curframe + 1 /* frameno within this callchain */, -+ subprog /* subprog number within this prog */); -+ -+ /* Transfer references to the callee */ -+ err = transfer_reference_state(callee, caller); -+ if (err) -+ return err; -+ -+ /* copy r1 - r5 args that callee can access. The copy includes parent -+ * pointers, which connects us up to the liveness chain -+ */ -+ for (i = BPF_REG_1; i <= BPF_REG_5; i++) -+ callee->regs[i] = caller->regs[i]; -+ -+ /* after the call registers r0 - r5 were scratched */ -+ for (i = 0; i < CALLER_SAVED_REGS; i++) { -+ mark_reg_not_init(env, caller->regs, caller_saved[i]); -+ check_reg_arg(env, caller_saved[i], DST_OP_NO_MARK); -+ } -+ -+ /* only increment it after check_reg_arg() finished */ -+ state->curframe++; -+ -+ /* and go analyze first insn of the callee */ -+ *insn_idx = target_insn; -+ -+ if (env->log.level & BPF_LOG_LEVEL) { -+ verbose(env, "caller:\n"); -+ print_verifier_state(env, caller); -+ verbose(env, "callee:\n"); -+ print_verifier_state(env, callee); -+ } -+ return 0; -+} -+ -+static int prepare_func_exit(struct bpf_verifier_env *env, int *insn_idx) -+{ -+ struct bpf_verifier_state *state = env->cur_state; -+ struct bpf_func_state *caller, *callee; -+ struct bpf_reg_state *r0; -+ int err; -+ -+ callee = state->frame[state->curframe]; -+ r0 = &callee->regs[BPF_REG_0]; -+ if (r0->type == PTR_TO_STACK) { -+ /* technically it's ok to return caller's stack pointer -+ * (or caller's caller's pointer) back to the caller, -+ * since these pointers are valid. Only current stack -+ * pointer will be invalid as soon as function exits, -+ * but let's be conservative -+ */ -+ verbose(env, "cannot return stack pointer to the caller\n"); -+ return -EINVAL; -+ } -+ -+ state->curframe--; -+ caller = state->frame[state->curframe]; -+ /* return to the caller whatever r0 had in the callee */ -+ caller->regs[BPF_REG_0] = *r0; -+ -+ /* Transfer references to the caller */ -+ err = transfer_reference_state(caller, callee); -+ if (err) -+ return err; -+ -+ *insn_idx = callee->callsite + 1; -+ if (env->log.level & BPF_LOG_LEVEL) { -+ verbose(env, "returning from callee:\n"); -+ print_verifier_state(env, callee); -+ verbose(env, "to caller at %d:\n", *insn_idx); -+ print_verifier_state(env, caller); -+ } -+ /* clear everything in the callee */ -+ free_func_state(callee); -+ state->frame[state->curframe + 1] = NULL; -+ return 0; -+} -+ -+static int do_refine_retval_range(struct bpf_verifier_env *env, -+ struct bpf_reg_state *regs, int ret_type, -+ int func_id, struct bpf_call_arg_meta *meta) -+{ -+ struct bpf_reg_state *ret_reg = ®s[BPF_REG_0]; -+ struct bpf_reg_state tmp_reg = *ret_reg; -+ bool ret; -+ -+ if (ret_type != RET_INTEGER || -+ (func_id != BPF_FUNC_get_stack && -+ func_id != BPF_FUNC_probe_read_str)) -+ return 0; -+ -+ /* Error case where ret is in interval [S32MIN, -1]. */ -+ ret_reg->smin_value = S32_MIN; -+ ret_reg->smax_value = -1; -+ -+ __reg_deduce_bounds(ret_reg); -+ __reg_bound_offset(ret_reg); -+ __update_reg_bounds(ret_reg); -+ -+ ret = push_stack(env, env->insn_idx + 1, env->insn_idx, false); -+ if (!ret) -+ return -EFAULT; -+ -+ *ret_reg = tmp_reg; -+ -+ /* Success case where ret is in range [0, msize_max_value]. */ -+ ret_reg->smin_value = 0; -+ ret_reg->smax_value = meta->msize_max_value; -+ ret_reg->umin_value = ret_reg->smin_value; -+ ret_reg->umax_value = ret_reg->smax_value; -+ -+ __reg_deduce_bounds(ret_reg); -+ __reg_bound_offset(ret_reg); -+ __update_reg_bounds(ret_reg); -+ -+ return 0; -+} -+ -+static int -+record_func_map(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, -+ int func_id, int insn_idx) -+{ -+ struct bpf_insn_aux_data *aux = &env->insn_aux_data[insn_idx]; -+ struct bpf_map *map = meta->map_ptr; -+ -+ if (func_id != BPF_FUNC_tail_call && -+ func_id != BPF_FUNC_map_lookup_elem && -+ func_id != BPF_FUNC_map_update_elem && -+ func_id != BPF_FUNC_map_delete_elem && -+ func_id != BPF_FUNC_map_push_elem && -+ func_id != BPF_FUNC_map_pop_elem && -+ func_id != BPF_FUNC_map_peek_elem) -+ return 0; -+ -+ if (map == NULL) { -+ verbose(env, "kernel subsystem misconfigured verifier\n"); -+ return -EINVAL; -+ } -+ -+ /* In case of read-only, some additional restrictions -+ * need to be applied in order to prevent altering the -+ * state of the map from program side. -+ */ -+ if ((map->map_flags & BPF_F_RDONLY_PROG) && -+ (func_id == BPF_FUNC_map_delete_elem || -+ func_id == BPF_FUNC_map_update_elem || -+ func_id == BPF_FUNC_map_push_elem || -+ func_id == BPF_FUNC_map_pop_elem)) { -+ verbose(env, "write into map forbidden\n"); -+ return -EACCES; -+ } -+ -+ if (!BPF_MAP_PTR(aux->map_state)) -+ bpf_map_ptr_store(aux, meta->map_ptr, -+ meta->map_ptr->unpriv_array); -+ else if (BPF_MAP_PTR(aux->map_state) != meta->map_ptr) -+ bpf_map_ptr_store(aux, BPF_MAP_PTR_POISON, -+ meta->map_ptr->unpriv_array); -+ return 0; -+} -+ -+static int check_reference_leak(struct bpf_verifier_env *env) -+{ -+ struct bpf_func_state *state = cur_func(env); -+ int i; -+ -+ for (i = 0; i < state->acquired_refs; i++) { -+ verbose(env, "Unreleased reference id=%d alloc_insn=%d\n", -+ state->refs[i].id, state->refs[i].insn_idx); -+ } -+ return state->acquired_refs ? -EINVAL : 0; -+} -+ -+static int check_helper_call(struct bpf_verifier_env *env, int func_id, int insn_idx) - { -- struct verifier_state *state = &env->cur_state; - const struct bpf_func_proto *fn = NULL; -- struct reg_state *regs = state->regs; -- struct bpf_map *map = NULL; -- struct reg_state *reg; -+ struct bpf_reg_state *regs; -+ struct bpf_call_arg_meta meta; -+ bool changes_data; - int i, err; - - /* find function prototype */ - if (func_id < 0 || func_id >= __BPF_FUNC_MAX_ID) { -- verbose("invalid func %d\n", func_id); -+ verbose(env, "invalid func %s#%d\n", func_id_name(func_id), -+ func_id); - return -EINVAL; - } - -- if (env->prog->aux->ops->get_func_proto) -- fn = env->prog->aux->ops->get_func_proto(func_id); -- -+ if (env->ops->get_func_proto) -+ fn = env->ops->get_func_proto(func_id, env->prog); - if (!fn) { -- verbose("unknown func %d\n", func_id); -+ verbose(env, "unknown func %s#%d\n", func_id_name(func_id), -+ func_id); - return -EINVAL; - } - - /* eBPF programs must be GPL compatible to use GPL-ed functions */ - if (!env->prog->gpl_compatible && fn->gpl_only) { -- verbose("cannot call GPL only function from proprietary program\n"); -+ verbose(env, "cannot call GPL-restricted function from non-GPL compatible program\n"); -+ return -EINVAL; -+ } -+ -+ /* With LD_ABS/IND some JITs save/restore skb from r1. */ -+ changes_data = bpf_helper_changes_pkt_data(fn->func); -+ if (changes_data && fn->arg1_type != ARG_PTR_TO_CTX) { -+ verbose(env, "kernel subsystem misconfigured func %s#%d: r1 != ctx\n", -+ func_id_name(func_id), func_id); - return -EINVAL; - } - -+ memset(&meta, 0, sizeof(meta)); -+ meta.pkt_access = fn->pkt_access; -+ -+ err = check_func_proto(fn, func_id); -+ if (err) { -+ verbose(env, "kernel subsystem misconfigured func %s#%d\n", -+ func_id_name(func_id), func_id); -+ return err; -+ } -+ -+ meta.func_id = func_id; - /* check args */ -- err = check_func_arg(env, BPF_REG_1, fn->arg1_type, &map); -+ err = check_func_arg(env, BPF_REG_1, fn->arg1_type, &meta); - if (err) - return err; -- err = check_func_arg(env, BPF_REG_2, fn->arg2_type, &map); -+ err = check_func_arg(env, BPF_REG_2, fn->arg2_type, &meta); - if (err) - return err; -- err = check_func_arg(env, BPF_REG_3, fn->arg3_type, &map); -+ err = check_func_arg(env, BPF_REG_3, fn->arg3_type, &meta); - if (err) - return err; -- err = check_func_arg(env, BPF_REG_4, fn->arg4_type, &map); -+ err = check_func_arg(env, BPF_REG_4, fn->arg4_type, &meta); - if (err) - return err; -- err = check_func_arg(env, BPF_REG_5, fn->arg5_type, &map); -+ err = check_func_arg(env, BPF_REG_5, fn->arg5_type, &meta); - if (err) - return err; - -+ err = record_func_map(env, &meta, func_id, insn_idx); -+ if (err) -+ return err; -+ -+ /* Mark slots with STACK_MISC in case of raw mode, stack offset -+ * is inferred from register state. -+ */ -+ for (i = 0; i < meta.access_size; i++) { -+ err = check_mem_access(env, insn_idx, meta.regno, i, BPF_B, -+ BPF_WRITE, -1, false); -+ if (err) -+ return err; -+ } -+ -+ if (func_id == BPF_FUNC_tail_call) { -+ err = check_reference_leak(env); -+ if (err) { -+ verbose(env, "tail_call would lead to reference leak\n"); -+ return err; -+ } -+ } else if (is_release_function(func_id)) { -+ err = release_reference(env, meta.ref_obj_id); -+ if (err) { -+ verbose(env, "func %s#%d reference has not been acquired before\n", -+ func_id_name(func_id), func_id); -+ return err; -+ } -+ } -+ -+ regs = cur_regs(env); -+ -+ /* check that flags argument in get_local_storage(map, flags) is 0, -+ * this is required because get_local_storage() can't return an error. -+ */ -+ if (func_id == BPF_FUNC_get_local_storage && -+ !register_is_null(®s[BPF_REG_2])) { -+ verbose(env, "get_local_storage() doesn't support non-zero flags\n"); -+ return -EINVAL; -+ } -+ - /* reset caller saved regs */ - for (i = 0; i < CALLER_SAVED_REGS; i++) { -- reg = regs + caller_saved[i]; -- reg->type = NOT_INIT; -- reg->imm = 0; -+ mark_reg_not_init(env, regs, caller_saved[i]); -+ check_reg_arg(env, caller_saved[i], DST_OP_NO_MARK); - } - -- /* update return register */ -+ /* helper call returns 64-bit value. */ -+ regs[BPF_REG_0].subreg_def = DEF_NOT_SUBREG; -+ -+ /* update return register (already marked as written above) */ - if (fn->ret_type == RET_INTEGER) { -- regs[BPF_REG_0].type = UNKNOWN_VALUE; -+ /* sets type to SCALAR_VALUE */ -+ mark_reg_unknown(env, regs, BPF_REG_0); - } else if (fn->ret_type == RET_VOID) { - regs[BPF_REG_0].type = NOT_INIT; -- } else if (fn->ret_type == RET_PTR_TO_MAP_VALUE_OR_NULL) { -- regs[BPF_REG_0].type = PTR_TO_MAP_VALUE_OR_NULL; -+ } else if (fn->ret_type == RET_PTR_TO_MAP_VALUE_OR_NULL || -+ fn->ret_type == RET_PTR_TO_MAP_VALUE) { -+ /* There is no offset yet applied, variable or fixed */ -+ mark_reg_known_zero(env, regs, BPF_REG_0); - /* remember map_ptr, so that check_map_access() - * can check 'value_size' boundary of memory access - * to map element returned from bpf_map_lookup_elem() - */ -- if (map == NULL) { -- verbose("kernel subsystem misconfigured verifier\n"); -+ if (meta.map_ptr == NULL) { -+ verbose(env, -+ "kernel subsystem misconfigured verifier\n"); - return -EINVAL; - } -- regs[BPF_REG_0].map_ptr = map; -+ regs[BPF_REG_0].map_ptr = meta.map_ptr; -+ if (fn->ret_type == RET_PTR_TO_MAP_VALUE) { -+ regs[BPF_REG_0].type = PTR_TO_MAP_VALUE; -+ if (map_value_has_spin_lock(meta.map_ptr)) -+ regs[BPF_REG_0].id = ++env->id_gen; -+ } else { -+ regs[BPF_REG_0].type = PTR_TO_MAP_VALUE_OR_NULL; -+ regs[BPF_REG_0].id = ++env->id_gen; -+ } -+ } else if (fn->ret_type == RET_PTR_TO_SOCKET_OR_NULL) { -+ mark_reg_known_zero(env, regs, BPF_REG_0); -+ regs[BPF_REG_0].type = PTR_TO_SOCKET_OR_NULL; -+ regs[BPF_REG_0].id = ++env->id_gen; -+ } else if (fn->ret_type == RET_PTR_TO_SOCK_COMMON_OR_NULL) { -+ mark_reg_known_zero(env, regs, BPF_REG_0); -+ regs[BPF_REG_0].type = PTR_TO_SOCK_COMMON_OR_NULL; -+ regs[BPF_REG_0].id = ++env->id_gen; -+ } else if (fn->ret_type == RET_PTR_TO_TCP_SOCK_OR_NULL) { -+ mark_reg_known_zero(env, regs, BPF_REG_0); -+ regs[BPF_REG_0].type = PTR_TO_TCP_SOCK_OR_NULL; -+ regs[BPF_REG_0].id = ++env->id_gen; - } else { -- verbose("unknown return type %d of func %d\n", -- fn->ret_type, func_id); -+ verbose(env, "unknown return type %d of func %s#%d\n", -+ fn->ret_type, func_id_name(func_id), func_id); - return -EINVAL; - } - -- err = check_map_func_compatibility(map, func_id); -+ if (is_ptr_cast_function(func_id)) { -+ /* For release_reference() */ -+ regs[BPF_REG_0].ref_obj_id = meta.ref_obj_id; -+ } else if (is_acquire_function(func_id)) { -+ int id = acquire_reference_state(env, insn_idx); -+ -+ if (id < 0) -+ return id; -+ /* For mark_ptr_or_null_reg() */ -+ regs[BPF_REG_0].id = id; -+ /* For release_reference() */ -+ regs[BPF_REG_0].ref_obj_id = id; -+ } -+ -+ err = do_refine_retval_range(env, regs, fn->ret_type, func_id, &meta); -+ if (err) -+ return err; -+ -+ err = check_map_func_compatibility(env, meta.map_ptr, func_id); - if (err) - return err; - -+ if (func_id == BPF_FUNC_get_stack && !env->prog->has_callchain_buf) { -+ const char *err_str; -+ -+#ifdef CONFIG_PERF_EVENTS -+ err = get_callchain_buffers(sysctl_perf_event_max_stack); -+ err_str = "cannot get callchain buffer for func %s#%d\n"; -+#else -+ err = -ENOTSUPP; -+ err_str = "func %s#%d not supported without CONFIG_PERF_EVENTS\n"; -+#endif -+ if (err) { -+ verbose(env, err_str, func_id_name(func_id), func_id); -+ return err; -+ } -+ -+ env->prog->has_callchain_buf = true; -+ } -+ -+ if (changes_data) -+ clear_all_pkt_pointers(env); - return 0; - } - -+static bool signed_add_overflows(s64 a, s64 b) -+{ -+ /* Do the add in u64, where overflow is well-defined */ -+ s64 res = (s64)((u64)a + (u64)b); -+ -+ if (b < 0) -+ return res > a; -+ return res < a; -+} -+ -+static bool signed_sub_overflows(s64 a, s64 b) -+{ -+ /* Do the sub in u64, where overflow is well-defined */ -+ s64 res = (s64)((u64)a - (u64)b); -+ -+ if (b < 0) -+ return res < a; -+ return res > a; -+} -+ -+static bool check_reg_sane_offset(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, -+ enum bpf_reg_type type) -+{ -+ bool known = tnum_is_const(reg->var_off); -+ s64 val = reg->var_off.value; -+ s64 smin = reg->smin_value; -+ -+ if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) { -+ verbose(env, "math between %s pointer and %lld is not allowed\n", -+ reg_type_str[type], val); -+ return false; -+ } -+ -+ if (reg->off >= BPF_MAX_VAR_OFF || reg->off <= -BPF_MAX_VAR_OFF) { -+ verbose(env, "%s pointer offset %d is not allowed\n", -+ reg_type_str[type], reg->off); -+ return false; -+ } -+ -+ if (smin == S64_MIN) { -+ verbose(env, "math between %s pointer and register with unbounded min value is not allowed\n", -+ reg_type_str[type]); -+ return false; -+ } -+ -+ if (smin >= BPF_MAX_VAR_OFF || smin <= -BPF_MAX_VAR_OFF) { -+ verbose(env, "value %lld makes %s pointer be out of bounds\n", -+ smin, reg_type_str[type]); -+ return false; -+ } -+ -+ return true; -+} -+ -+static struct bpf_insn_aux_data *cur_aux(struct bpf_verifier_env *env) -+{ -+ return &env->insn_aux_data[env->insn_idx]; -+} -+ -+enum { -+ REASON_BOUNDS = -1, -+ REASON_TYPE = -2, -+ REASON_PATHS = -3, -+ REASON_LIMIT = -4, -+ REASON_STACK = -5, -+}; -+ -+static int retrieve_ptr_limit(const struct bpf_reg_state *ptr_reg, -+ u32 *alu_limit, bool mask_to_left) -+{ -+ u32 max = 0, ptr_limit = 0; -+ -+ switch (ptr_reg->type) { -+ case PTR_TO_STACK: -+ /* Offset 0 is out-of-bounds, but acceptable start for the -+ * left direction, see BPF_REG_FP. Also, unknown scalar -+ * offset where we would need to deal with min/max bounds is -+ * currently prohibited for unprivileged. -+ */ -+ max = MAX_BPF_STACK + mask_to_left; -+ ptr_limit = -(ptr_reg->var_off.value + ptr_reg->off); -+ break; -+ case PTR_TO_MAP_VALUE: -+ max = ptr_reg->map_ptr->value_size; -+ ptr_limit = (mask_to_left ? -+ ptr_reg->smin_value : -+ ptr_reg->umax_value) + ptr_reg->off; -+ break; -+ default: -+ return REASON_TYPE; -+ } -+ -+ if (ptr_limit >= max) -+ return REASON_LIMIT; -+ *alu_limit = ptr_limit; -+ return 0; -+} -+ -+static bool can_skip_alu_sanitation(const struct bpf_verifier_env *env, -+ const struct bpf_insn *insn) -+{ -+ return env->allow_ptr_leaks || BPF_SRC(insn->code) == BPF_K; -+} -+ -+static int update_alu_sanitation_state(struct bpf_insn_aux_data *aux, -+ u32 alu_state, u32 alu_limit) -+{ -+ /* If we arrived here from different branches with different -+ * state or limits to sanitize, then this won't work. -+ */ -+ if (aux->alu_state && -+ (aux->alu_state != alu_state || -+ aux->alu_limit != alu_limit)) -+ return REASON_PATHS; -+ -+ /* Corresponding fixup done in fixup_bpf_calls(). */ -+ aux->alu_state = alu_state; -+ aux->alu_limit = alu_limit; -+ return 0; -+} -+ -+static int sanitize_val_alu(struct bpf_verifier_env *env, -+ struct bpf_insn *insn) -+{ -+ struct bpf_insn_aux_data *aux = cur_aux(env); -+ -+ if (can_skip_alu_sanitation(env, insn)) -+ return 0; -+ -+ return update_alu_sanitation_state(aux, BPF_ALU_NON_POINTER, 0); -+} -+ -+static bool sanitize_needed(u8 opcode) -+{ -+ return opcode == BPF_ADD || opcode == BPF_SUB; -+} -+ -+struct bpf_sanitize_info { -+ struct bpf_insn_aux_data aux; -+ bool mask_to_left; -+}; -+ -+static struct bpf_verifier_state * -+sanitize_speculative_path(struct bpf_verifier_env *env, -+ const struct bpf_insn *insn, -+ u32 next_idx, u32 curr_idx) -+{ -+ struct bpf_verifier_state *branch; -+ struct bpf_reg_state *regs; -+ -+ branch = push_stack(env, next_idx, curr_idx, true); -+ if (branch && insn) { -+ regs = branch->frame[branch->curframe]->regs; -+ if (BPF_SRC(insn->code) == BPF_K) { -+ mark_reg_unknown(env, regs, insn->dst_reg); -+ } else if (BPF_SRC(insn->code) == BPF_X) { -+ mark_reg_unknown(env, regs, insn->dst_reg); -+ mark_reg_unknown(env, regs, insn->src_reg); -+ } -+ } -+ return branch; -+} -+ -+static int sanitize_ptr_alu(struct bpf_verifier_env *env, -+ struct bpf_insn *insn, -+ const struct bpf_reg_state *ptr_reg, -+ const struct bpf_reg_state *off_reg, -+ struct bpf_reg_state *dst_reg, -+ struct bpf_sanitize_info *info, -+ const bool commit_window) -+{ -+ struct bpf_insn_aux_data *aux = commit_window ? cur_aux(env) : &info->aux; -+ struct bpf_verifier_state *vstate = env->cur_state; -+ bool off_is_imm = tnum_is_const(off_reg->var_off); -+ bool off_is_neg = off_reg->smin_value < 0; -+ bool ptr_is_dst_reg = ptr_reg == dst_reg; -+ u8 opcode = BPF_OP(insn->code); -+ u32 alu_state, alu_limit; -+ struct bpf_reg_state tmp; -+ bool ret; -+ int err; -+ -+ if (can_skip_alu_sanitation(env, insn)) -+ return 0; -+ -+ /* We already marked aux for masking from non-speculative -+ * paths, thus we got here in the first place. We only care -+ * to explore bad access from here. -+ */ -+ if (vstate->speculative) -+ goto do_sim; -+ -+ if (!commit_window) { -+ if (!tnum_is_const(off_reg->var_off) && -+ (off_reg->smin_value < 0) != (off_reg->smax_value < 0)) -+ return REASON_BOUNDS; -+ -+ info->mask_to_left = (opcode == BPF_ADD && off_is_neg) || -+ (opcode == BPF_SUB && !off_is_neg); -+ } -+ -+ err = retrieve_ptr_limit(ptr_reg, &alu_limit, info->mask_to_left); -+ if (err < 0) -+ return err; -+ -+ if (commit_window) { -+ /* In commit phase we narrow the masking window based on -+ * the observed pointer move after the simulated operation. -+ */ -+ alu_state = info->aux.alu_state; -+ alu_limit = abs(info->aux.alu_limit - alu_limit); -+ } else { -+ alu_state = off_is_neg ? BPF_ALU_NEG_VALUE : 0; -+ alu_state |= off_is_imm ? BPF_ALU_IMMEDIATE : 0; -+ alu_state |= ptr_is_dst_reg ? -+ BPF_ALU_SANITIZE_SRC : BPF_ALU_SANITIZE_DST; -+ } -+ -+ err = update_alu_sanitation_state(aux, alu_state, alu_limit); -+ if (err < 0) -+ return err; -+do_sim: -+ /* If we're in commit phase, we're done here given we already -+ * pushed the truncated dst_reg into the speculative verification -+ * stack. -+ * -+ * Also, when register is a known constant, we rewrite register-based -+ * operation to immediate-based, and thus do not need masking (and as -+ * a consequence, do not need to simulate the zero-truncation either). -+ */ -+ if (commit_window || off_is_imm) -+ return 0; -+ -+ /* Simulate and find potential out-of-bounds access under -+ * speculative execution from truncation as a result of -+ * masking when off was not within expected range. If off -+ * sits in dst, then we temporarily need to move ptr there -+ * to simulate dst (== 0) +/-= ptr. Needed, for example, -+ * for cases where we use K-based arithmetic in one direction -+ * and truncated reg-based in the other in order to explore -+ * bad access. -+ */ -+ if (!ptr_is_dst_reg) { -+ tmp = *dst_reg; -+ *dst_reg = *ptr_reg; -+ } -+ ret = sanitize_speculative_path(env, NULL, env->insn_idx + 1, -+ env->insn_idx); -+ if (!ptr_is_dst_reg && ret) -+ *dst_reg = tmp; -+ return !ret ? REASON_STACK : 0; -+} -+ -+static void sanitize_mark_insn_seen(struct bpf_verifier_env *env) -+{ -+ struct bpf_verifier_state *vstate = env->cur_state; -+ -+ /* If we simulate paths under speculation, we don't update the -+ * insn as 'seen' such that when we verify unreachable paths in -+ * the non-speculative domain, sanitize_dead_code() can still -+ * rewrite/sanitize them. -+ */ -+ if (!vstate->speculative) -+ env->insn_aux_data[env->insn_idx].seen = true; -+} -+ -+static int sanitize_err(struct bpf_verifier_env *env, -+ const struct bpf_insn *insn, int reason, -+ const struct bpf_reg_state *off_reg, -+ const struct bpf_reg_state *dst_reg) -+{ -+ static const char *err = "pointer arithmetic with it prohibited for !root"; -+ const char *op = BPF_OP(insn->code) == BPF_ADD ? "add" : "sub"; -+ u32 dst = insn->dst_reg, src = insn->src_reg; -+ -+ switch (reason) { -+ case REASON_BOUNDS: -+ verbose(env, "R%d has unknown scalar with mixed signed bounds, %s\n", -+ off_reg == dst_reg ? dst : src, err); -+ break; -+ case REASON_TYPE: -+ verbose(env, "R%d has pointer with unsupported alu operation, %s\n", -+ off_reg == dst_reg ? src : dst, err); -+ break; -+ case REASON_PATHS: -+ verbose(env, "R%d tried to %s from different maps, paths or scalars, %s\n", -+ dst, op, err); -+ break; -+ case REASON_LIMIT: -+ verbose(env, "R%d tried to %s beyond pointer bounds, %s\n", -+ dst, op, err); -+ break; -+ case REASON_STACK: -+ verbose(env, "R%d could not be pushed for speculative verification, %s\n", -+ dst, err); -+ break; -+ default: -+ verbose(env, "verifier internal error: unknown reason (%d)\n", -+ reason); -+ break; -+ } -+ -+ return -EACCES; -+} -+ -+static int sanitize_check_bounds(struct bpf_verifier_env *env, -+ const struct bpf_insn *insn, -+ const struct bpf_reg_state *dst_reg) -+{ -+ u32 dst = insn->dst_reg; -+ -+ /* For unprivileged we require that resulting offset must be in bounds -+ * in order to be able to sanitize access later on. -+ */ -+ if (env->allow_ptr_leaks) -+ return 0; -+ -+ switch (dst_reg->type) { -+ case PTR_TO_STACK: -+ if (check_stack_access(env, dst_reg, dst_reg->off + -+ dst_reg->var_off.value, 1)) { -+ verbose(env, "R%d stack pointer arithmetic goes out of range, " -+ "prohibited for !root\n", dst); -+ return -EACCES; -+ } -+ break; -+ case PTR_TO_MAP_VALUE: -+ if (check_map_access(env, dst, dst_reg->off, 1, false)) { -+ verbose(env, "R%d pointer arithmetic of map value goes out of range, " -+ "prohibited for !root\n", dst); -+ return -EACCES; -+ } -+ break; -+ default: -+ break; -+ } -+ -+ return 0; -+} -+ -+/* Handles arithmetic on a pointer and a scalar: computes new min/max and var_off. -+ * Caller should also handle BPF_MOV case separately. -+ * If we return -EACCES, caller may want to try again treating pointer as a -+ * scalar. So we only emit a diagnostic if !env->allow_ptr_leaks. -+ */ -+static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, -+ struct bpf_insn *insn, -+ const struct bpf_reg_state *ptr_reg, -+ const struct bpf_reg_state *off_reg) -+{ -+ struct bpf_verifier_state *vstate = env->cur_state; -+ struct bpf_func_state *state = vstate->frame[vstate->curframe]; -+ struct bpf_reg_state *regs = state->regs, *dst_reg; -+ bool known = tnum_is_const(off_reg->var_off); -+ s64 smin_val = off_reg->smin_value, smax_val = off_reg->smax_value, -+ smin_ptr = ptr_reg->smin_value, smax_ptr = ptr_reg->smax_value; -+ u64 umin_val = off_reg->umin_value, umax_val = off_reg->umax_value, -+ umin_ptr = ptr_reg->umin_value, umax_ptr = ptr_reg->umax_value; -+ struct bpf_sanitize_info info = {}; -+ u8 opcode = BPF_OP(insn->code); -+ u32 dst = insn->dst_reg; -+ int ret; -+ -+ dst_reg = ®s[dst]; -+ -+ if ((known && (smin_val != smax_val || umin_val != umax_val)) || -+ smin_val > smax_val || umin_val > umax_val) { -+ /* Taint dst register if offset had invalid bounds derived from -+ * e.g. dead branches. -+ */ -+ __mark_reg_unknown(env, dst_reg); -+ return 0; -+ } -+ -+ if (BPF_CLASS(insn->code) != BPF_ALU64) { -+ /* 32-bit ALU ops on pointers produce (meaningless) scalars */ -+ verbose(env, -+ "R%d 32-bit pointer arithmetic prohibited\n", -+ dst); -+ return -EACCES; -+ } -+ -+ switch (ptr_reg->type) { -+ case PTR_TO_MAP_VALUE_OR_NULL: -+ verbose(env, "R%d pointer arithmetic on %s prohibited, null-check it first\n", -+ dst, reg_type_str[ptr_reg->type]); -+ return -EACCES; -+ case CONST_PTR_TO_MAP: -+ /* smin_val represents the known value */ -+ if (known && smin_val == 0 && opcode == BPF_ADD) -+ break; -+ /* fall-through */ -+ case PTR_TO_PACKET_END: -+ case PTR_TO_SOCKET: -+ case PTR_TO_SOCKET_OR_NULL: -+ case PTR_TO_SOCK_COMMON: -+ case PTR_TO_SOCK_COMMON_OR_NULL: -+ case PTR_TO_TCP_SOCK: -+ case PTR_TO_TCP_SOCK_OR_NULL: -+ case PTR_TO_XDP_SOCK: -+ verbose(env, "R%d pointer arithmetic on %s prohibited\n", -+ dst, reg_type_str[ptr_reg->type]); -+ return -EACCES; -+ default: -+ break; -+ } -+ -+ /* In case of 'scalar += pointer', dst_reg inherits pointer type and id. -+ * The id may be overwritten later if we create a new variable offset. -+ */ -+ dst_reg->type = ptr_reg->type; -+ dst_reg->id = ptr_reg->id; -+ -+ if (!check_reg_sane_offset(env, off_reg, ptr_reg->type) || -+ !check_reg_sane_offset(env, ptr_reg, ptr_reg->type)) -+ return -EINVAL; -+ -+ if (sanitize_needed(opcode)) { -+ ret = sanitize_ptr_alu(env, insn, ptr_reg, off_reg, dst_reg, -+ &info, false); -+ if (ret < 0) -+ return sanitize_err(env, insn, ret, off_reg, dst_reg); -+ } -+ -+ switch (opcode) { -+ case BPF_ADD: -+ /* We can take a fixed offset as long as it doesn't overflow -+ * the s32 'off' field -+ */ -+ if (known && (ptr_reg->off + smin_val == -+ (s64)(s32)(ptr_reg->off + smin_val))) { -+ /* pointer += K. Accumulate it into fixed offset */ -+ dst_reg->smin_value = smin_ptr; -+ dst_reg->smax_value = smax_ptr; -+ dst_reg->umin_value = umin_ptr; -+ dst_reg->umax_value = umax_ptr; -+ dst_reg->var_off = ptr_reg->var_off; -+ dst_reg->off = ptr_reg->off + smin_val; -+ dst_reg->raw = ptr_reg->raw; -+ break; -+ } -+ /* A new variable offset is created. Note that off_reg->off -+ * == 0, since it's a scalar. -+ * dst_reg gets the pointer type and since some positive -+ * integer value was added to the pointer, give it a new 'id' -+ * if it's a PTR_TO_PACKET. -+ * this creates a new 'base' pointer, off_reg (variable) gets -+ * added into the variable offset, and we copy the fixed offset -+ * from ptr_reg. -+ */ -+ if (signed_add_overflows(smin_ptr, smin_val) || -+ signed_add_overflows(smax_ptr, smax_val)) { -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ } else { -+ dst_reg->smin_value = smin_ptr + smin_val; -+ dst_reg->smax_value = smax_ptr + smax_val; -+ } -+ if (umin_ptr + umin_val < umin_ptr || -+ umax_ptr + umax_val < umax_ptr) { -+ dst_reg->umin_value = 0; -+ dst_reg->umax_value = U64_MAX; -+ } else { -+ dst_reg->umin_value = umin_ptr + umin_val; -+ dst_reg->umax_value = umax_ptr + umax_val; -+ } -+ dst_reg->var_off = tnum_add(ptr_reg->var_off, off_reg->var_off); -+ dst_reg->off = ptr_reg->off; -+ dst_reg->raw = ptr_reg->raw; -+ if (reg_is_pkt_pointer(ptr_reg)) { -+ dst_reg->id = ++env->id_gen; -+ /* something was added to pkt_ptr, set range to zero */ -+ dst_reg->raw = 0; -+ } -+ break; -+ case BPF_SUB: -+ if (dst_reg == off_reg) { -+ /* scalar -= pointer. Creates an unknown scalar */ -+ verbose(env, "R%d tried to subtract pointer from scalar\n", -+ dst); -+ return -EACCES; -+ } -+ /* We don't allow subtraction from FP, because (according to -+ * test_verifier.c test "invalid fp arithmetic", JITs might not -+ * be able to deal with it. -+ */ -+ if (ptr_reg->type == PTR_TO_STACK) { -+ verbose(env, "R%d subtraction from stack pointer prohibited\n", -+ dst); -+ return -EACCES; -+ } -+ if (known && (ptr_reg->off - smin_val == -+ (s64)(s32)(ptr_reg->off - smin_val))) { -+ /* pointer -= K. Subtract it from fixed offset */ -+ dst_reg->smin_value = smin_ptr; -+ dst_reg->smax_value = smax_ptr; -+ dst_reg->umin_value = umin_ptr; -+ dst_reg->umax_value = umax_ptr; -+ dst_reg->var_off = ptr_reg->var_off; -+ dst_reg->id = ptr_reg->id; -+ dst_reg->off = ptr_reg->off - smin_val; -+ dst_reg->raw = ptr_reg->raw; -+ break; -+ } -+ /* A new variable offset is created. If the subtrahend is known -+ * nonnegative, then any reg->range we had before is still good. -+ */ -+ if (signed_sub_overflows(smin_ptr, smax_val) || -+ signed_sub_overflows(smax_ptr, smin_val)) { -+ /* Overflow possible, we know nothing */ -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ } else { -+ dst_reg->smin_value = smin_ptr - smax_val; -+ dst_reg->smax_value = smax_ptr - smin_val; -+ } -+ if (umin_ptr < umax_val) { -+ /* Overflow possible, we know nothing */ -+ dst_reg->umin_value = 0; -+ dst_reg->umax_value = U64_MAX; -+ } else { -+ /* Cannot overflow (as long as bounds are consistent) */ -+ dst_reg->umin_value = umin_ptr - umax_val; -+ dst_reg->umax_value = umax_ptr - umin_val; -+ } -+ dst_reg->var_off = tnum_sub(ptr_reg->var_off, off_reg->var_off); -+ dst_reg->off = ptr_reg->off; -+ dst_reg->raw = ptr_reg->raw; -+ if (reg_is_pkt_pointer(ptr_reg)) { -+ dst_reg->id = ++env->id_gen; -+ /* something was added to pkt_ptr, set range to zero */ -+ if (smin_val < 0) -+ dst_reg->raw = 0; -+ } -+ break; -+ case BPF_AND: -+ case BPF_OR: -+ case BPF_XOR: -+ /* bitwise ops on pointers are troublesome, prohibit. */ -+ verbose(env, "R%d bitwise operator %s on pointer prohibited\n", -+ dst, bpf_alu_string[opcode >> 4]); -+ return -EACCES; -+ default: -+ /* other operators (e.g. MUL,LSH) produce non-pointer results */ -+ verbose(env, "R%d pointer arithmetic with %s operator prohibited\n", -+ dst, bpf_alu_string[opcode >> 4]); -+ return -EACCES; -+ } -+ -+ if (!check_reg_sane_offset(env, dst_reg, ptr_reg->type)) -+ return -EINVAL; -+ -+ __update_reg_bounds(dst_reg); -+ __reg_deduce_bounds(dst_reg); -+ __reg_bound_offset(dst_reg); -+ -+ if (sanitize_check_bounds(env, insn, dst_reg) < 0) -+ return -EACCES; -+ if (sanitize_needed(opcode)) { -+ ret = sanitize_ptr_alu(env, insn, dst_reg, off_reg, dst_reg, -+ &info, true); -+ if (ret < 0) -+ return sanitize_err(env, insn, ret, off_reg, dst_reg); -+ } -+ -+ return 0; -+} -+ -+/* WARNING: This function does calculations on 64-bit values, but the actual -+ * execution may occur on 32-bit values. Therefore, things like bitshifts -+ * need extra checks in the 32-bit case. -+ */ -+static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, -+ struct bpf_insn *insn, -+ struct bpf_reg_state *dst_reg, -+ struct bpf_reg_state src_reg) -+{ -+ struct bpf_reg_state *regs = cur_regs(env); -+ u8 opcode = BPF_OP(insn->code); -+ bool src_known, dst_known; -+ s64 smin_val, smax_val; -+ u64 umin_val, umax_val; -+ u64 insn_bitness = (BPF_CLASS(insn->code) == BPF_ALU64) ? 64 : 32; -+ int ret; -+ -+ if (insn_bitness == 32) { -+ /* Relevant for 32-bit RSH: Information can propagate towards -+ * LSB, so it isn't sufficient to only truncate the output to -+ * 32 bits. -+ */ -+ coerce_reg_to_size(dst_reg, 4); -+ coerce_reg_to_size(&src_reg, 4); -+ } -+ -+ smin_val = src_reg.smin_value; -+ smax_val = src_reg.smax_value; -+ umin_val = src_reg.umin_value; -+ umax_val = src_reg.umax_value; -+ src_known = tnum_is_const(src_reg.var_off); -+ dst_known = tnum_is_const(dst_reg->var_off); -+ -+ if ((src_known && (smin_val != smax_val || umin_val != umax_val)) || -+ smin_val > smax_val || umin_val > umax_val) { -+ /* Taint dst register if offset had invalid bounds derived from -+ * e.g. dead branches. -+ */ -+ __mark_reg_unknown(env, dst_reg); -+ return 0; -+ } -+ -+ if (!src_known && -+ opcode != BPF_ADD && opcode != BPF_SUB && opcode != BPF_AND) { -+ __mark_reg_unknown(env, dst_reg); -+ return 0; -+ } -+ -+ if (sanitize_needed(opcode)) { -+ ret = sanitize_val_alu(env, insn); -+ if (ret < 0) -+ return sanitize_err(env, insn, ret, NULL, NULL); -+ } -+ -+ switch (opcode) { -+ case BPF_ADD: -+ if (signed_add_overflows(dst_reg->smin_value, smin_val) || -+ signed_add_overflows(dst_reg->smax_value, smax_val)) { -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ } else { -+ dst_reg->smin_value += smin_val; -+ dst_reg->smax_value += smax_val; -+ } -+ if (dst_reg->umin_value + umin_val < umin_val || -+ dst_reg->umax_value + umax_val < umax_val) { -+ dst_reg->umin_value = 0; -+ dst_reg->umax_value = U64_MAX; -+ } else { -+ dst_reg->umin_value += umin_val; -+ dst_reg->umax_value += umax_val; -+ } -+ dst_reg->var_off = tnum_add(dst_reg->var_off, src_reg.var_off); -+ break; -+ case BPF_SUB: -+ if (signed_sub_overflows(dst_reg->smin_value, smax_val) || -+ signed_sub_overflows(dst_reg->smax_value, smin_val)) { -+ /* Overflow possible, we know nothing */ -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ } else { -+ dst_reg->smin_value -= smax_val; -+ dst_reg->smax_value -= smin_val; -+ } -+ if (dst_reg->umin_value < umax_val) { -+ /* Overflow possible, we know nothing */ -+ dst_reg->umin_value = 0; -+ dst_reg->umax_value = U64_MAX; -+ } else { -+ /* Cannot overflow (as long as bounds are consistent) */ -+ dst_reg->umin_value -= umax_val; -+ dst_reg->umax_value -= umin_val; -+ } -+ dst_reg->var_off = tnum_sub(dst_reg->var_off, src_reg.var_off); -+ break; -+ case BPF_MUL: -+ dst_reg->var_off = tnum_mul(dst_reg->var_off, src_reg.var_off); -+ if (smin_val < 0 || dst_reg->smin_value < 0) { -+ /* Ain't nobody got time to multiply that sign */ -+ __mark_reg_unbounded(dst_reg); -+ __update_reg_bounds(dst_reg); -+ break; -+ } -+ /* Both values are positive, so we can work with unsigned and -+ * copy the result to signed (unless it exceeds S64_MAX). -+ */ -+ if (umax_val > U32_MAX || dst_reg->umax_value > U32_MAX) { -+ /* Potential overflow, we know nothing */ -+ __mark_reg_unbounded(dst_reg); -+ /* (except what we can learn from the var_off) */ -+ __update_reg_bounds(dst_reg); -+ break; -+ } -+ dst_reg->umin_value *= umin_val; -+ dst_reg->umax_value *= umax_val; -+ if (dst_reg->umax_value > S64_MAX) { -+ /* Overflow possible, we know nothing */ -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ } else { -+ dst_reg->smin_value = dst_reg->umin_value; -+ dst_reg->smax_value = dst_reg->umax_value; -+ } -+ break; -+ case BPF_AND: -+ if (src_known && dst_known) { -+ __mark_reg_known(dst_reg, dst_reg->var_off.value & -+ src_reg.var_off.value); -+ break; -+ } -+ /* We get our minimum from the var_off, since that's inherently -+ * bitwise. Our maximum is the minimum of the operands' maxima. -+ */ -+ dst_reg->var_off = tnum_and(dst_reg->var_off, src_reg.var_off); -+ dst_reg->umin_value = dst_reg->var_off.value; -+ dst_reg->umax_value = min(dst_reg->umax_value, umax_val); -+ if (dst_reg->smin_value < 0 || smin_val < 0) { -+ /* Lose signed bounds when ANDing negative numbers, -+ * ain't nobody got time for that. -+ */ -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ } else { -+ /* ANDing two positives gives a positive, so safe to -+ * cast result into s64. -+ */ -+ dst_reg->smin_value = dst_reg->umin_value; -+ dst_reg->smax_value = dst_reg->umax_value; -+ } -+ /* We may learn something more from the var_off */ -+ __update_reg_bounds(dst_reg); -+ break; -+ case BPF_OR: -+ if (src_known && dst_known) { -+ __mark_reg_known(dst_reg, dst_reg->var_off.value | -+ src_reg.var_off.value); -+ break; -+ } -+ /* We get our maximum from the var_off, and our minimum is the -+ * maximum of the operands' minima -+ */ -+ dst_reg->var_off = tnum_or(dst_reg->var_off, src_reg.var_off); -+ dst_reg->umin_value = max(dst_reg->umin_value, umin_val); -+ dst_reg->umax_value = dst_reg->var_off.value | -+ dst_reg->var_off.mask; -+ if (dst_reg->smin_value < 0 || smin_val < 0) { -+ /* Lose signed bounds when ORing negative numbers, -+ * ain't nobody got time for that. -+ */ -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ } else { -+ /* ORing two positives gives a positive, so safe to -+ * cast result into s64. -+ */ -+ dst_reg->smin_value = dst_reg->umin_value; -+ dst_reg->smax_value = dst_reg->umax_value; -+ } -+ /* We may learn something more from the var_off */ -+ __update_reg_bounds(dst_reg); -+ break; -+ case BPF_LSH: -+ if (umax_val >= insn_bitness) { -+ /* Shifts greater than 31 or 63 are undefined. -+ * This includes shifts by a negative number. -+ */ -+ mark_reg_unknown(env, regs, insn->dst_reg); -+ break; -+ } -+ /* We lose all sign bit information (except what we can pick -+ * up from var_off) -+ */ -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ /* If we might shift our top bit out, then we know nothing */ -+ if (dst_reg->umax_value > 1ULL << (63 - umax_val)) { -+ dst_reg->umin_value = 0; -+ dst_reg->umax_value = U64_MAX; -+ } else { -+ dst_reg->umin_value <<= umin_val; -+ dst_reg->umax_value <<= umax_val; -+ } -+ dst_reg->var_off = tnum_lshift(dst_reg->var_off, umin_val); -+ /* We may learn something more from the var_off */ -+ __update_reg_bounds(dst_reg); -+ break; -+ case BPF_RSH: -+ if (umax_val >= insn_bitness) { -+ /* Shifts greater than 31 or 63 are undefined. -+ * This includes shifts by a negative number. -+ */ -+ mark_reg_unknown(env, regs, insn->dst_reg); -+ break; -+ } -+ /* BPF_RSH is an unsigned shift. If the value in dst_reg might -+ * be negative, then either: -+ * 1) src_reg might be zero, so the sign bit of the result is -+ * unknown, so we lose our signed bounds -+ * 2) it's known negative, thus the unsigned bounds capture the -+ * signed bounds -+ * 3) the signed bounds cross zero, so they tell us nothing -+ * about the result -+ * If the value in dst_reg is known nonnegative, then again the -+ * unsigned bounts capture the signed bounds. -+ * Thus, in all cases it suffices to blow away our signed bounds -+ * and rely on inferring new ones from the unsigned bounds and -+ * var_off of the result. -+ */ -+ dst_reg->smin_value = S64_MIN; -+ dst_reg->smax_value = S64_MAX; -+ dst_reg->var_off = tnum_rshift(dst_reg->var_off, umin_val); -+ dst_reg->umin_value >>= umax_val; -+ dst_reg->umax_value >>= umin_val; -+ /* We may learn something more from the var_off */ -+ __update_reg_bounds(dst_reg); -+ break; -+ case BPF_ARSH: -+ if (umax_val >= insn_bitness) { -+ /* Shifts greater than 31 or 63 are undefined. -+ * This includes shifts by a negative number. -+ */ -+ mark_reg_unknown(env, regs, insn->dst_reg); -+ break; -+ } -+ -+ /* Upon reaching here, src_known is true and -+ * umax_val is equal to umin_val. -+ */ -+ if (insn_bitness == 32) { -+ dst_reg->smin_value = (u32)(((s32)dst_reg->smin_value) >> umin_val); -+ dst_reg->smax_value = (u32)(((s32)dst_reg->smax_value) >> umin_val); -+ } else { -+ dst_reg->smin_value >>= umin_val; -+ dst_reg->smax_value >>= umin_val; -+ } -+ -+ dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val, -+ insn_bitness); -+ -+ /* blow away the dst_reg umin_value/umax_value and rely on -+ * dst_reg var_off to refine the result. -+ */ -+ dst_reg->umin_value = 0; -+ dst_reg->umax_value = U64_MAX; -+ __update_reg_bounds(dst_reg); -+ break; -+ default: -+ mark_reg_unknown(env, regs, insn->dst_reg); -+ break; -+ } -+ -+ if (BPF_CLASS(insn->code) != BPF_ALU64) { -+ /* 32-bit ALU ops are (32,32)->32 */ -+ coerce_reg_to_size(dst_reg, 4); -+ } -+ -+ __reg_deduce_bounds(dst_reg); -+ __reg_bound_offset(dst_reg); -+ return 0; -+} -+ -+/* Handles ALU ops other than BPF_END, BPF_NEG and BPF_MOV: computes new min/max -+ * and var_off. -+ */ -+static int adjust_reg_min_max_vals(struct bpf_verifier_env *env, -+ struct bpf_insn *insn) -+{ -+ struct bpf_verifier_state *vstate = env->cur_state; -+ struct bpf_func_state *state = vstate->frame[vstate->curframe]; -+ struct bpf_reg_state *regs = state->regs, *dst_reg, *src_reg; -+ struct bpf_reg_state *ptr_reg = NULL, off_reg = {0}; -+ u8 opcode = BPF_OP(insn->code); -+ int err; -+ -+ dst_reg = ®s[insn->dst_reg]; -+ src_reg = NULL; -+ if (dst_reg->type != SCALAR_VALUE) -+ ptr_reg = dst_reg; -+ if (BPF_SRC(insn->code) == BPF_X) { -+ src_reg = ®s[insn->src_reg]; -+ if (src_reg->type != SCALAR_VALUE) { -+ if (dst_reg->type != SCALAR_VALUE) { -+ /* Combining two pointers by any ALU op yields -+ * an arbitrary scalar. Disallow all math except -+ * pointer subtraction -+ */ -+ if (opcode == BPF_SUB && env->allow_ptr_leaks) { -+ mark_reg_unknown(env, regs, insn->dst_reg); -+ return 0; -+ } -+ verbose(env, "R%d pointer %s pointer prohibited\n", -+ insn->dst_reg, -+ bpf_alu_string[opcode >> 4]); -+ return -EACCES; -+ } else { -+ /* scalar += pointer -+ * This is legal, but we have to reverse our -+ * src/dest handling in computing the range -+ */ -+ err = mark_chain_precision(env, insn->dst_reg); -+ if (err) -+ return err; -+ return adjust_ptr_min_max_vals(env, insn, -+ src_reg, dst_reg); -+ } -+ } else if (ptr_reg) { -+ /* pointer += scalar */ -+ err = mark_chain_precision(env, insn->src_reg); -+ if (err) -+ return err; -+ return adjust_ptr_min_max_vals(env, insn, -+ dst_reg, src_reg); -+ } -+ } else { -+ /* Pretend the src is a reg with a known value, since we only -+ * need to be able to read from this state. -+ */ -+ off_reg.type = SCALAR_VALUE; -+ __mark_reg_known(&off_reg, insn->imm); -+ src_reg = &off_reg; -+ if (ptr_reg) /* pointer += K */ -+ return adjust_ptr_min_max_vals(env, insn, -+ ptr_reg, src_reg); -+ } -+ -+ /* Got here implies adding two SCALAR_VALUEs */ -+ if (WARN_ON_ONCE(ptr_reg)) { -+ print_verifier_state(env, state); -+ verbose(env, "verifier internal error: unexpected ptr_reg\n"); -+ return -EINVAL; -+ } -+ if (WARN_ON(!src_reg)) { -+ print_verifier_state(env, state); -+ verbose(env, "verifier internal error: no src_reg\n"); -+ return -EINVAL; -+ } -+ return adjust_scalar_min_max_vals(env, insn, dst_reg, *src_reg); -+} -+ - /* check validity of 32-bit and 64-bit arithmetic operations */ --static int check_alu_op(struct verifier_env *env, struct bpf_insn *insn) -+static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) - { -- struct reg_state *regs = env->cur_state.regs; -+ struct bpf_reg_state *regs = cur_regs(env); - u8 opcode = BPF_OP(insn->code); - int err; - -@@ -1034,30 +5134,31 @@ static int check_alu_op(struct verifier_ - if (BPF_SRC(insn->code) != 0 || - insn->src_reg != BPF_REG_0 || - insn->off != 0 || insn->imm != 0) { -- verbose("BPF_NEG uses reserved fields\n"); -+ verbose(env, "BPF_NEG uses reserved fields\n"); - return -EINVAL; - } - } else { - if (insn->src_reg != BPF_REG_0 || insn->off != 0 || -- (insn->imm != 16 && insn->imm != 32 && insn->imm != 64)) { -- verbose("BPF_END uses reserved fields\n"); -+ (insn->imm != 16 && insn->imm != 32 && insn->imm != 64) || -+ BPF_CLASS(insn->code) == BPF_ALU64) { -+ verbose(env, "BPF_END uses reserved fields\n"); - return -EINVAL; - } - } - - /* check src operand */ -- err = check_reg_arg(regs, insn->dst_reg, SRC_OP); -+ err = check_reg_arg(env, insn->dst_reg, SRC_OP); - if (err) - return err; - - if (is_pointer_value(env, insn->dst_reg)) { -- verbose("R%d pointer arithmetic prohibited\n", -+ verbose(env, "R%d pointer arithmetic prohibited\n", - insn->dst_reg); - return -EACCES; - } - - /* check dest operand */ -- err = check_reg_arg(regs, insn->dst_reg, DST_OP); -+ err = check_reg_arg(env, insn->dst_reg, DST_OP); - if (err) - return err; - -@@ -1065,81 +5166,100 @@ static int check_alu_op(struct verifier_ - - if (BPF_SRC(insn->code) == BPF_X) { - if (insn->imm != 0 || insn->off != 0) { -- verbose("BPF_MOV uses reserved fields\n"); -+ verbose(env, "BPF_MOV uses reserved fields\n"); - return -EINVAL; - } - - /* check src operand */ -- err = check_reg_arg(regs, insn->src_reg, SRC_OP); -+ err = check_reg_arg(env, insn->src_reg, SRC_OP); - if (err) - return err; - } else { - if (insn->src_reg != BPF_REG_0 || insn->off != 0) { -- verbose("BPF_MOV uses reserved fields\n"); -+ verbose(env, "BPF_MOV uses reserved fields\n"); - return -EINVAL; - } - } - -- /* check dest operand */ -- err = check_reg_arg(regs, insn->dst_reg, DST_OP); -+ /* check dest operand, mark as required later */ -+ err = check_reg_arg(env, insn->dst_reg, DST_OP_NO_MARK); - if (err) - return err; - - if (BPF_SRC(insn->code) == BPF_X) { -+ struct bpf_reg_state *src_reg = regs + insn->src_reg; -+ struct bpf_reg_state *dst_reg = regs + insn->dst_reg; -+ - if (BPF_CLASS(insn->code) == BPF_ALU64) { - /* case: R1 = R2 - * copy register state to dest reg - */ -- regs[insn->dst_reg] = regs[insn->src_reg]; -+ *dst_reg = *src_reg; -+ dst_reg->live |= REG_LIVE_WRITTEN; -+ dst_reg->subreg_def = DEF_NOT_SUBREG; - } else { -+ /* R1 = (u32) R2 */ - if (is_pointer_value(env, insn->src_reg)) { -- verbose("R%d partial copy of pointer\n", -+ verbose(env, -+ "R%d partial copy of pointer\n", - insn->src_reg); - return -EACCES; -+ } else if (src_reg->type == SCALAR_VALUE) { -+ *dst_reg = *src_reg; -+ dst_reg->live |= REG_LIVE_WRITTEN; -+ dst_reg->subreg_def = env->insn_idx + 1; -+ } else { -+ mark_reg_unknown(env, regs, -+ insn->dst_reg); - } -- regs[insn->dst_reg].type = UNKNOWN_VALUE; -- regs[insn->dst_reg].map_ptr = NULL; -+ coerce_reg_to_size(dst_reg, 4); - } - } else { - /* case: R = imm - * remember the value we stored into this reg - */ -- regs[insn->dst_reg].type = CONST_IMM; -- regs[insn->dst_reg].imm = insn->imm; -+ /* clear any state __mark_reg_known doesn't set */ -+ mark_reg_unknown(env, regs, insn->dst_reg); -+ regs[insn->dst_reg].type = SCALAR_VALUE; -+ if (BPF_CLASS(insn->code) == BPF_ALU64) { -+ __mark_reg_known(regs + insn->dst_reg, -+ insn->imm); -+ } else { -+ __mark_reg_known(regs + insn->dst_reg, -+ (u32)insn->imm); -+ } - } - - } else if (opcode > BPF_END) { -- verbose("invalid BPF_ALU opcode %x\n", opcode); -+ verbose(env, "invalid BPF_ALU opcode %x\n", opcode); - return -EINVAL; - - } else { /* all other ALU ops: and, sub, xor, add, ... */ - -- bool stack_relative = false; -- - if (BPF_SRC(insn->code) == BPF_X) { - if (insn->imm != 0 || insn->off != 0) { -- verbose("BPF_ALU uses reserved fields\n"); -+ verbose(env, "BPF_ALU uses reserved fields\n"); - return -EINVAL; - } - /* check src1 operand */ -- err = check_reg_arg(regs, insn->src_reg, SRC_OP); -+ err = check_reg_arg(env, insn->src_reg, SRC_OP); - if (err) - return err; - } else { - if (insn->src_reg != BPF_REG_0 || insn->off != 0) { -- verbose("BPF_ALU uses reserved fields\n"); -+ verbose(env, "BPF_ALU uses reserved fields\n"); - return -EINVAL; - } - } - - /* check src2 operand */ -- err = check_reg_arg(regs, insn->dst_reg, SRC_OP); -+ err = check_reg_arg(env, insn->dst_reg, SRC_OP); - if (err) - return err; - - if ((opcode == BPF_MOD || opcode == BPF_DIV) && - BPF_SRC(insn->code) == BPF_K && insn->imm == 0) { -- verbose("div by zero\n"); -+ verbose(env, "div by zero\n"); - return -EINVAL; - } - -@@ -1148,185 +5268,980 @@ static int check_alu_op(struct verifier_ - int size = BPF_CLASS(insn->code) == BPF_ALU64 ? 64 : 32; - - if (insn->imm < 0 || insn->imm >= size) { -- verbose("invalid shift %d\n", insn->imm); -+ verbose(env, "invalid shift %d\n", insn->imm); - return -EINVAL; - } - } - -- /* pattern match 'bpf_add Rx, imm' instruction */ -- if (opcode == BPF_ADD && BPF_CLASS(insn->code) == BPF_ALU64 && -- regs[insn->dst_reg].type == FRAME_PTR && -- BPF_SRC(insn->code) == BPF_K) { -- stack_relative = true; -- } else if (is_pointer_value(env, insn->dst_reg)) { -- verbose("R%d pointer arithmetic prohibited\n", -- insn->dst_reg); -- return -EACCES; -- } else if (BPF_SRC(insn->code) == BPF_X && -- is_pointer_value(env, insn->src_reg)) { -- verbose("R%d pointer arithmetic prohibited\n", -- insn->src_reg); -- return -EACCES; -- } -- - /* check dest operand */ -- err = check_reg_arg(regs, insn->dst_reg, DST_OP); -+ err = check_reg_arg(env, insn->dst_reg, DST_OP_NO_MARK); - if (err) - return err; - -- if (stack_relative) { -- regs[insn->dst_reg].type = PTR_TO_STACK; -- regs[insn->dst_reg].imm = insn->imm; -- } -+ return adjust_reg_min_max_vals(env, insn); - } - - return 0; - } - --static int check_cond_jmp_op(struct verifier_env *env, -+static void __find_good_pkt_pointers(struct bpf_func_state *state, -+ struct bpf_reg_state *dst_reg, -+ enum bpf_reg_type type, u16 new_range) -+{ -+ struct bpf_reg_state *reg; -+ int i; -+ -+ for (i = 0; i < MAX_BPF_REG; i++) { -+ reg = &state->regs[i]; -+ if (reg->type == type && reg->id == dst_reg->id) -+ /* keep the maximum range already checked */ -+ reg->range = max(reg->range, new_range); -+ } -+ -+ bpf_for_each_spilled_reg(i, state, reg) { -+ if (!reg) -+ continue; -+ if (reg->type == type && reg->id == dst_reg->id) -+ reg->range = max(reg->range, new_range); -+ } -+} -+ -+static void find_good_pkt_pointers(struct bpf_verifier_state *vstate, -+ struct bpf_reg_state *dst_reg, -+ enum bpf_reg_type type, -+ bool range_right_open) -+{ -+ u16 new_range; -+ int i; -+ -+ if (dst_reg->off < 0 || -+ (dst_reg->off == 0 && range_right_open)) -+ /* This doesn't give us any range */ -+ return; -+ -+ if (dst_reg->umax_value > MAX_PACKET_OFF || -+ dst_reg->umax_value + dst_reg->off > MAX_PACKET_OFF) -+ /* Risk of overflow. For instance, ptr + (1<<63) may be less -+ * than pkt_end, but that's because it's also less than pkt. -+ */ -+ return; -+ -+ new_range = dst_reg->off; -+ if (range_right_open) -+ new_range++; -+ -+ /* Examples for register markings: -+ * -+ * pkt_data in dst register: -+ * -+ * r2 = r3; -+ * r2 += 8; -+ * if (r2 > pkt_end) goto -+ * -+ * -+ * r2 = r3; -+ * r2 += 8; -+ * if (r2 < pkt_end) goto -+ * -+ * -+ * Where: -+ * r2 == dst_reg, pkt_end == src_reg -+ * r2=pkt(id=n,off=8,r=0) -+ * r3=pkt(id=n,off=0,r=0) -+ * -+ * pkt_data in src register: -+ * -+ * r2 = r3; -+ * r2 += 8; -+ * if (pkt_end >= r2) goto -+ * -+ * -+ * r2 = r3; -+ * r2 += 8; -+ * if (pkt_end <= r2) goto -+ * -+ * -+ * Where: -+ * pkt_end == dst_reg, r2 == src_reg -+ * r2=pkt(id=n,off=8,r=0) -+ * r3=pkt(id=n,off=0,r=0) -+ * -+ * Find register r3 and mark its range as r3=pkt(id=n,off=0,r=8) -+ * or r3=pkt(id=n,off=0,r=8-1), so that range of bytes [r3, r3 + 8) -+ * and [r3, r3 + 8-1) respectively is safe to access depending on -+ * the check. -+ */ -+ -+ /* If our ids match, then we must have the same max_value. And we -+ * don't care about the other reg's fixed offset, since if it's too big -+ * the range won't allow anything. -+ * dst_reg->off is known < MAX_PACKET_OFF, therefore it fits in a u16. -+ */ -+ for (i = 0; i <= vstate->curframe; i++) -+ __find_good_pkt_pointers(vstate->frame[i], dst_reg, type, -+ new_range); -+} -+ -+/* compute branch direction of the expression "if (reg opcode val) goto target;" -+ * and return: -+ * 1 - branch will be taken and "goto target" will be executed -+ * 0 - branch will not be taken and fall-through to next insn -+ * -1 - unknown. Example: "if (reg < 5)" is unknown when register value range [0,10] -+ */ -+static int is_branch_taken(struct bpf_reg_state *reg, u64 val, u8 opcode, -+ bool is_jmp32) -+{ -+ struct bpf_reg_state reg_lo; -+ s64 sval; -+ -+ if (__is_pointer_value(false, reg)) -+ return -1; -+ -+ if (is_jmp32) { -+ reg_lo = *reg; -+ reg = ®_lo; -+ /* For JMP32, only low 32 bits are compared, coerce_reg_to_size -+ * could truncate high bits and update umin/umax according to -+ * information of low bits. -+ */ -+ coerce_reg_to_size(reg, 4); -+ /* smin/smax need special handling. For example, after coerce, -+ * if smin_value is 0x00000000ffffffffLL, the value is -1 when -+ * used as operand to JMP32. It is a negative number from s32's -+ * point of view, while it is a positive number when seen as -+ * s64. The smin/smax are kept as s64, therefore, when used with -+ * JMP32, they need to be transformed into s32, then sign -+ * extended back to s64. -+ * -+ * Also, smin/smax were copied from umin/umax. If umin/umax has -+ * different sign bit, then min/max relationship doesn't -+ * maintain after casting into s32, for this case, set smin/smax -+ * to safest range. -+ */ -+ if ((reg->umax_value ^ reg->umin_value) & -+ (1ULL << 31)) { -+ reg->smin_value = S32_MIN; -+ reg->smax_value = S32_MAX; -+ } -+ reg->smin_value = (s64)(s32)reg->smin_value; -+ reg->smax_value = (s64)(s32)reg->smax_value; -+ -+ val = (u32)val; -+ sval = (s64)(s32)val; -+ } else { -+ sval = (s64)val; -+ } -+ -+ switch (opcode) { -+ case BPF_JEQ: -+ if (tnum_is_const(reg->var_off)) -+ return !!tnum_equals_const(reg->var_off, val); -+ break; -+ case BPF_JNE: -+ if (tnum_is_const(reg->var_off)) -+ return !tnum_equals_const(reg->var_off, val); -+ break; -+ case BPF_JSET: -+ if ((~reg->var_off.mask & reg->var_off.value) & val) -+ return 1; -+ if (!((reg->var_off.mask | reg->var_off.value) & val)) -+ return 0; -+ break; -+ case BPF_JGT: -+ if (reg->umin_value > val) -+ return 1; -+ else if (reg->umax_value <= val) -+ return 0; -+ break; -+ case BPF_JSGT: -+ if (reg->smin_value > sval) -+ return 1; -+ else if (reg->smax_value < sval) -+ return 0; -+ break; -+ case BPF_JLT: -+ if (reg->umax_value < val) -+ return 1; -+ else if (reg->umin_value >= val) -+ return 0; -+ break; -+ case BPF_JSLT: -+ if (reg->smax_value < sval) -+ return 1; -+ else if (reg->smin_value >= sval) -+ return 0; -+ break; -+ case BPF_JGE: -+ if (reg->umin_value >= val) -+ return 1; -+ else if (reg->umax_value < val) -+ return 0; -+ break; -+ case BPF_JSGE: -+ if (reg->smin_value >= sval) -+ return 1; -+ else if (reg->smax_value < sval) -+ return 0; -+ break; -+ case BPF_JLE: -+ if (reg->umax_value <= val) -+ return 1; -+ else if (reg->umin_value > val) -+ return 0; -+ break; -+ case BPF_JSLE: -+ if (reg->smax_value <= sval) -+ return 1; -+ else if (reg->smin_value > sval) -+ return 0; -+ break; -+ } -+ -+ return -1; -+} -+ -+/* Generate min value of the high 32-bit from TNUM info. */ -+static u64 gen_hi_min(struct tnum var) -+{ -+ return var.value & ~0xffffffffULL; -+} -+ -+/* Generate max value of the high 32-bit from TNUM info. */ -+static u64 gen_hi_max(struct tnum var) -+{ -+ return (var.value | var.mask) & ~0xffffffffULL; -+} -+ -+/* Return true if VAL is compared with a s64 sign extended from s32, and they -+ * are with the same signedness. -+ */ -+static bool cmp_val_with_extended_s64(s64 sval, struct bpf_reg_state *reg) -+{ -+ return ((s32)sval >= 0 && -+ reg->smin_value >= 0 && reg->smax_value <= S32_MAX) || -+ ((s32)sval < 0 && -+ reg->smax_value <= 0 && reg->smin_value >= S32_MIN); -+} -+ -+/* Constrain the possible values of @reg with unsigned upper bound @bound. -+ * If @is_exclusive, @bound is an exclusive limit, otherwise it is inclusive. -+ * If @is_jmp32, @bound is a 32-bit value that only constrains the low 32 bits -+ * of @reg. -+ */ -+static void set_upper_bound(struct bpf_reg_state *reg, u64 bound, bool is_jmp32, -+ bool is_exclusive) -+{ -+ if (is_exclusive) { -+ /* There are no values for `reg` that make `reg<0` true. */ -+ if (bound == 0) -+ return; -+ bound--; -+ } -+ if (is_jmp32) { -+ /* Constrain the register's value in the tnum representation. -+ * For 64-bit comparisons this happens later in -+ * __reg_bound_offset(), but for 32-bit comparisons, we can be -+ * more precise than what can be derived from the updated -+ * numeric bounds. -+ */ -+ struct tnum t = tnum_range(0, bound); -+ -+ t.mask |= ~0xffffffffULL; /* upper half is unknown */ -+ reg->var_off = tnum_intersect(reg->var_off, t); -+ -+ /* Compute the 64-bit bound from the 32-bit bound. */ -+ bound += gen_hi_max(reg->var_off); -+ } -+ reg->umax_value = min(reg->umax_value, bound); -+} -+ -+/* Constrain the possible values of @reg with unsigned lower bound @bound. -+ * If @is_exclusive, @bound is an exclusive limit, otherwise it is inclusive. -+ * If @is_jmp32, @bound is a 32-bit value that only constrains the low 32 bits -+ * of @reg. -+ */ -+static void set_lower_bound(struct bpf_reg_state *reg, u64 bound, bool is_jmp32, -+ bool is_exclusive) -+{ -+ if (is_exclusive) { -+ /* There are no values for `reg` that make `reg>MAX` true. */ -+ if (bound == (is_jmp32 ? U32_MAX : U64_MAX)) -+ return; -+ bound++; -+ } -+ if (is_jmp32) { -+ /* Constrain the register's value in the tnum representation. -+ * For 64-bit comparisons this happens later in -+ * __reg_bound_offset(), but for 32-bit comparisons, we can be -+ * more precise than what can be derived from the updated -+ * numeric bounds. -+ */ -+ struct tnum t = tnum_range(bound, U32_MAX); -+ -+ t.mask |= ~0xffffffffULL; /* upper half is unknown */ -+ reg->var_off = tnum_intersect(reg->var_off, t); -+ -+ /* Compute the 64-bit bound from the 32-bit bound. */ -+ bound += gen_hi_min(reg->var_off); -+ } -+ reg->umin_value = max(reg->umin_value, bound); -+} -+ -+/* Adjusts the register min/max values in the case that the dst_reg is the -+ * variable register that we are working on, and src_reg is a constant or we're -+ * simply doing a BPF_K check. -+ * In JEQ/JNE cases we also adjust the var_off values. -+ */ -+static void reg_set_min_max(struct bpf_reg_state *true_reg, -+ struct bpf_reg_state *false_reg, u64 val, -+ u8 opcode, bool is_jmp32) -+{ -+ s64 sval; -+ -+ /* If the dst_reg is a pointer, we can't learn anything about its -+ * variable offset from the compare (unless src_reg were a pointer into -+ * the same object, but we don't bother with that. -+ * Since false_reg and true_reg have the same type by construction, we -+ * only need to check one of them for pointerness. -+ */ -+ if (__is_pointer_value(false, false_reg)) -+ return; -+ -+ val = is_jmp32 ? (u32)val : val; -+ sval = is_jmp32 ? (s64)(s32)val : (s64)val; -+ -+ switch (opcode) { -+ case BPF_JEQ: -+ case BPF_JNE: -+ { -+ struct bpf_reg_state *reg = -+ opcode == BPF_JEQ ? true_reg : false_reg; -+ -+ /* For BPF_JEQ, if this is false we know nothing Jon Snow, but -+ * if it is true we know the value for sure. Likewise for -+ * BPF_JNE. -+ */ -+ if (is_jmp32) { -+ u64 old_v = reg->var_off.value; -+ u64 hi_mask = ~0xffffffffULL; -+ -+ reg->var_off.value = (old_v & hi_mask) | val; -+ reg->var_off.mask &= hi_mask; -+ } else { -+ __mark_reg_known(reg, val); -+ } -+ break; -+ } -+ case BPF_JSET: -+ false_reg->var_off = tnum_and(false_reg->var_off, -+ tnum_const(~val)); -+ if (is_power_of_2(val)) -+ true_reg->var_off = tnum_or(true_reg->var_off, -+ tnum_const(val)); -+ break; -+ case BPF_JGE: -+ case BPF_JGT: -+ { -+ set_upper_bound(false_reg, val, is_jmp32, opcode == BPF_JGE); -+ set_lower_bound(true_reg, val, is_jmp32, opcode == BPF_JGT); -+ break; -+ } -+ case BPF_JSGE: -+ case BPF_JSGT: -+ { -+ s64 false_smax = opcode == BPF_JSGT ? sval : sval - 1; -+ s64 true_smin = opcode == BPF_JSGT ? sval + 1 : sval; -+ -+ /* If the full s64 was not sign-extended from s32 then don't -+ * deduct further info. -+ */ -+ if (is_jmp32 && !cmp_val_with_extended_s64(sval, false_reg)) -+ break; -+ false_reg->smax_value = min(false_reg->smax_value, false_smax); -+ true_reg->smin_value = max(true_reg->smin_value, true_smin); -+ break; -+ } -+ case BPF_JLE: -+ case BPF_JLT: -+ { -+ set_lower_bound(false_reg, val, is_jmp32, opcode == BPF_JLE); -+ set_upper_bound(true_reg, val, is_jmp32, opcode == BPF_JLT); -+ break; -+ } -+ case BPF_JSLE: -+ case BPF_JSLT: -+ { -+ s64 false_smin = opcode == BPF_JSLT ? sval : sval + 1; -+ s64 true_smax = opcode == BPF_JSLT ? sval - 1 : sval; -+ -+ if (is_jmp32 && !cmp_val_with_extended_s64(sval, false_reg)) -+ break; -+ false_reg->smin_value = max(false_reg->smin_value, false_smin); -+ true_reg->smax_value = min(true_reg->smax_value, true_smax); -+ break; -+ } -+ default: -+ break; -+ } -+ -+ __reg_deduce_bounds(false_reg); -+ __reg_deduce_bounds(true_reg); -+ /* We might have learned some bits from the bounds. */ -+ __reg_bound_offset(false_reg); -+ __reg_bound_offset(true_reg); -+ /* Intersecting with the old var_off might have improved our bounds -+ * slightly. e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc), -+ * then new var_off is (0; 0x7f...fc) which improves our umax. -+ */ -+ __update_reg_bounds(false_reg); -+ __update_reg_bounds(true_reg); -+} -+ -+/* Same as above, but for the case that dst_reg holds a constant and src_reg is -+ * the variable reg. -+ */ -+static void reg_set_min_max_inv(struct bpf_reg_state *true_reg, -+ struct bpf_reg_state *false_reg, u64 val, -+ u8 opcode, bool is_jmp32) -+{ -+ s64 sval; -+ -+ if (__is_pointer_value(false, false_reg)) -+ return; -+ -+ val = is_jmp32 ? (u32)val : val; -+ sval = is_jmp32 ? (s64)(s32)val : (s64)val; -+ -+ switch (opcode) { -+ case BPF_JEQ: -+ case BPF_JNE: -+ { -+ struct bpf_reg_state *reg = -+ opcode == BPF_JEQ ? true_reg : false_reg; -+ -+ if (is_jmp32) { -+ u64 old_v = reg->var_off.value; -+ u64 hi_mask = ~0xffffffffULL; -+ -+ reg->var_off.value = (old_v & hi_mask) | val; -+ reg->var_off.mask &= hi_mask; -+ } else { -+ __mark_reg_known(reg, val); -+ } -+ break; -+ } -+ case BPF_JSET: -+ false_reg->var_off = tnum_and(false_reg->var_off, -+ tnum_const(~val)); -+ if (is_power_of_2(val)) -+ true_reg->var_off = tnum_or(true_reg->var_off, -+ tnum_const(val)); -+ break; -+ case BPF_JGE: -+ case BPF_JGT: -+ { -+ set_lower_bound(false_reg, val, is_jmp32, opcode == BPF_JGE); -+ set_upper_bound(true_reg, val, is_jmp32, opcode == BPF_JGT); -+ break; -+ } -+ case BPF_JSGE: -+ case BPF_JSGT: -+ { -+ s64 false_smin = opcode == BPF_JSGT ? sval : sval + 1; -+ s64 true_smax = opcode == BPF_JSGT ? sval - 1 : sval; -+ -+ if (is_jmp32 && !cmp_val_with_extended_s64(sval, false_reg)) -+ break; -+ false_reg->smin_value = max(false_reg->smin_value, false_smin); -+ true_reg->smax_value = min(true_reg->smax_value, true_smax); -+ break; -+ } -+ case BPF_JLE: -+ case BPF_JLT: -+ { -+ set_upper_bound(false_reg, val, is_jmp32, opcode == BPF_JLE); -+ set_lower_bound(true_reg, val, is_jmp32, opcode == BPF_JLT); -+ break; -+ } -+ case BPF_JSLE: -+ case BPF_JSLT: -+ { -+ s64 false_smax = opcode == BPF_JSLT ? sval : sval - 1; -+ s64 true_smin = opcode == BPF_JSLT ? sval + 1 : sval; -+ -+ if (is_jmp32 && !cmp_val_with_extended_s64(sval, false_reg)) -+ break; -+ false_reg->smax_value = min(false_reg->smax_value, false_smax); -+ true_reg->smin_value = max(true_reg->smin_value, true_smin); -+ break; -+ } -+ default: -+ break; -+ } -+ -+ __reg_deduce_bounds(false_reg); -+ __reg_deduce_bounds(true_reg); -+ /* We might have learned some bits from the bounds. */ -+ __reg_bound_offset(false_reg); -+ __reg_bound_offset(true_reg); -+ /* Intersecting with the old var_off might have improved our bounds -+ * slightly. e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc), -+ * then new var_off is (0; 0x7f...fc) which improves our umax. -+ */ -+ __update_reg_bounds(false_reg); -+ __update_reg_bounds(true_reg); -+} -+ -+/* Regs are known to be equal, so intersect their min/max/var_off */ -+static void __reg_combine_min_max(struct bpf_reg_state *src_reg, -+ struct bpf_reg_state *dst_reg) -+{ -+ src_reg->umin_value = dst_reg->umin_value = max(src_reg->umin_value, -+ dst_reg->umin_value); -+ src_reg->umax_value = dst_reg->umax_value = min(src_reg->umax_value, -+ dst_reg->umax_value); -+ src_reg->smin_value = dst_reg->smin_value = max(src_reg->smin_value, -+ dst_reg->smin_value); -+ src_reg->smax_value = dst_reg->smax_value = min(src_reg->smax_value, -+ dst_reg->smax_value); -+ src_reg->var_off = dst_reg->var_off = tnum_intersect(src_reg->var_off, -+ dst_reg->var_off); -+ /* We might have learned new bounds from the var_off. */ -+ __update_reg_bounds(src_reg); -+ __update_reg_bounds(dst_reg); -+ /* We might have learned something about the sign bit. */ -+ __reg_deduce_bounds(src_reg); -+ __reg_deduce_bounds(dst_reg); -+ /* We might have learned some bits from the bounds. */ -+ __reg_bound_offset(src_reg); -+ __reg_bound_offset(dst_reg); -+ /* Intersecting with the old var_off might have improved our bounds -+ * slightly. e.g. if umax was 0x7f...f and var_off was (0; 0xf...fc), -+ * then new var_off is (0; 0x7f...fc) which improves our umax. -+ */ -+ __update_reg_bounds(src_reg); -+ __update_reg_bounds(dst_reg); -+} -+ -+static void reg_combine_min_max(struct bpf_reg_state *true_src, -+ struct bpf_reg_state *true_dst, -+ struct bpf_reg_state *false_src, -+ struct bpf_reg_state *false_dst, -+ u8 opcode) -+{ -+ switch (opcode) { -+ case BPF_JEQ: -+ __reg_combine_min_max(true_src, true_dst); -+ break; -+ case BPF_JNE: -+ __reg_combine_min_max(false_src, false_dst); -+ break; -+ } -+} -+ -+static void mark_ptr_or_null_reg(struct bpf_func_state *state, -+ struct bpf_reg_state *reg, u32 id, -+ bool is_null) -+{ -+ if (reg_type_may_be_null(reg->type) && reg->id == id) { -+ /* Old offset (both fixed and variable parts) should -+ * have been known-zero, because we don't allow pointer -+ * arithmetic on pointers that might be NULL. -+ */ -+ if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || -+ !tnum_equals_const(reg->var_off, 0) || -+ reg->off)) { -+ __mark_reg_known_zero(reg); -+ reg->off = 0; -+ } -+ if (is_null) { -+ reg->type = SCALAR_VALUE; -+ } else if (reg->type == PTR_TO_MAP_VALUE_OR_NULL) { -+ if (reg->map_ptr->inner_map_meta) { -+ reg->type = CONST_PTR_TO_MAP; -+ reg->map_ptr = reg->map_ptr->inner_map_meta; -+ } else if (reg->map_ptr->map_type == -+ BPF_MAP_TYPE_XSKMAP) { -+ reg->type = PTR_TO_XDP_SOCK; -+ } else { -+ reg->type = PTR_TO_MAP_VALUE; -+ } -+ } else if (reg->type == PTR_TO_SOCKET_OR_NULL) { -+ reg->type = PTR_TO_SOCKET; -+ } else if (reg->type == PTR_TO_SOCK_COMMON_OR_NULL) { -+ reg->type = PTR_TO_SOCK_COMMON; -+ } else if (reg->type == PTR_TO_TCP_SOCK_OR_NULL) { -+ reg->type = PTR_TO_TCP_SOCK; -+ } -+ if (is_null) { -+ /* We don't need id and ref_obj_id from this point -+ * onwards anymore, thus we should better reset it, -+ * so that state pruning has chances to take effect. -+ */ -+ reg->id = 0; -+ reg->ref_obj_id = 0; -+ } else if (!reg_may_point_to_spin_lock(reg)) { -+ /* For not-NULL ptr, reg->ref_obj_id will be reset -+ * in release_reg_references(). -+ * -+ * reg->id is still used by spin_lock ptr. Other -+ * than spin_lock ptr type, reg->id can be reset. -+ */ -+ reg->id = 0; -+ } -+ } -+} -+ -+static void __mark_ptr_or_null_regs(struct bpf_func_state *state, u32 id, -+ bool is_null) -+{ -+ struct bpf_reg_state *reg; -+ int i; -+ -+ for (i = 0; i < MAX_BPF_REG; i++) -+ mark_ptr_or_null_reg(state, &state->regs[i], id, is_null); -+ -+ bpf_for_each_spilled_reg(i, state, reg) { -+ if (!reg) -+ continue; -+ mark_ptr_or_null_reg(state, reg, id, is_null); -+ } -+} -+ -+/* The logic is similar to find_good_pkt_pointers(), both could eventually -+ * be folded together at some point. -+ */ -+static void mark_ptr_or_null_regs(struct bpf_verifier_state *vstate, u32 regno, -+ bool is_null) -+{ -+ struct bpf_func_state *state = vstate->frame[vstate->curframe]; -+ struct bpf_reg_state *regs = state->regs; -+ u32 ref_obj_id = regs[regno].ref_obj_id; -+ u32 id = regs[regno].id; -+ int i; -+ -+ if (ref_obj_id && ref_obj_id == id && is_null) -+ /* regs[regno] is in the " == NULL" branch. -+ * No one could have freed the reference state before -+ * doing the NULL check. -+ */ -+ WARN_ON_ONCE(release_reference_state(state, id)); -+ -+ for (i = 0; i <= vstate->curframe; i++) -+ __mark_ptr_or_null_regs(vstate->frame[i], id, is_null); -+} -+ -+static bool try_match_pkt_pointers(const struct bpf_insn *insn, -+ struct bpf_reg_state *dst_reg, -+ struct bpf_reg_state *src_reg, -+ struct bpf_verifier_state *this_branch, -+ struct bpf_verifier_state *other_branch) -+{ -+ if (BPF_SRC(insn->code) != BPF_X) -+ return false; -+ -+ /* Pointers are always 64-bit. */ -+ if (BPF_CLASS(insn->code) == BPF_JMP32) -+ return false; -+ -+ switch (BPF_OP(insn->code)) { -+ case BPF_JGT: -+ if ((dst_reg->type == PTR_TO_PACKET && -+ src_reg->type == PTR_TO_PACKET_END) || -+ (dst_reg->type == PTR_TO_PACKET_META && -+ reg_is_init_pkt_pointer(src_reg, PTR_TO_PACKET))) { -+ /* pkt_data' > pkt_end, pkt_meta' > pkt_data */ -+ find_good_pkt_pointers(this_branch, dst_reg, -+ dst_reg->type, false); -+ } else if ((dst_reg->type == PTR_TO_PACKET_END && -+ src_reg->type == PTR_TO_PACKET) || -+ (reg_is_init_pkt_pointer(dst_reg, PTR_TO_PACKET) && -+ src_reg->type == PTR_TO_PACKET_META)) { -+ /* pkt_end > pkt_data', pkt_data > pkt_meta' */ -+ find_good_pkt_pointers(other_branch, src_reg, -+ src_reg->type, true); -+ } else { -+ return false; -+ } -+ break; -+ case BPF_JLT: -+ if ((dst_reg->type == PTR_TO_PACKET && -+ src_reg->type == PTR_TO_PACKET_END) || -+ (dst_reg->type == PTR_TO_PACKET_META && -+ reg_is_init_pkt_pointer(src_reg, PTR_TO_PACKET))) { -+ /* pkt_data' < pkt_end, pkt_meta' < pkt_data */ -+ find_good_pkt_pointers(other_branch, dst_reg, -+ dst_reg->type, true); -+ } else if ((dst_reg->type == PTR_TO_PACKET_END && -+ src_reg->type == PTR_TO_PACKET) || -+ (reg_is_init_pkt_pointer(dst_reg, PTR_TO_PACKET) && -+ src_reg->type == PTR_TO_PACKET_META)) { -+ /* pkt_end < pkt_data', pkt_data > pkt_meta' */ -+ find_good_pkt_pointers(this_branch, src_reg, -+ src_reg->type, false); -+ } else { -+ return false; -+ } -+ break; -+ case BPF_JGE: -+ if ((dst_reg->type == PTR_TO_PACKET && -+ src_reg->type == PTR_TO_PACKET_END) || -+ (dst_reg->type == PTR_TO_PACKET_META && -+ reg_is_init_pkt_pointer(src_reg, PTR_TO_PACKET))) { -+ /* pkt_data' >= pkt_end, pkt_meta' >= pkt_data */ -+ find_good_pkt_pointers(this_branch, dst_reg, -+ dst_reg->type, true); -+ } else if ((dst_reg->type == PTR_TO_PACKET_END && -+ src_reg->type == PTR_TO_PACKET) || -+ (reg_is_init_pkt_pointer(dst_reg, PTR_TO_PACKET) && -+ src_reg->type == PTR_TO_PACKET_META)) { -+ /* pkt_end >= pkt_data', pkt_data >= pkt_meta' */ -+ find_good_pkt_pointers(other_branch, src_reg, -+ src_reg->type, false); -+ } else { -+ return false; -+ } -+ break; -+ case BPF_JLE: -+ if ((dst_reg->type == PTR_TO_PACKET && -+ src_reg->type == PTR_TO_PACKET_END) || -+ (dst_reg->type == PTR_TO_PACKET_META && -+ reg_is_init_pkt_pointer(src_reg, PTR_TO_PACKET))) { -+ /* pkt_data' <= pkt_end, pkt_meta' <= pkt_data */ -+ find_good_pkt_pointers(other_branch, dst_reg, -+ dst_reg->type, false); -+ } else if ((dst_reg->type == PTR_TO_PACKET_END && -+ src_reg->type == PTR_TO_PACKET) || -+ (reg_is_init_pkt_pointer(dst_reg, PTR_TO_PACKET) && -+ src_reg->type == PTR_TO_PACKET_META)) { -+ /* pkt_end <= pkt_data', pkt_data <= pkt_meta' */ -+ find_good_pkt_pointers(this_branch, src_reg, -+ src_reg->type, true); -+ } else { -+ return false; -+ } -+ break; -+ default: -+ return false; -+ } -+ -+ return true; -+} -+ -+static int check_cond_jmp_op(struct bpf_verifier_env *env, - struct bpf_insn *insn, int *insn_idx) - { -- struct reg_state *regs = env->cur_state.regs; -- struct verifier_state *other_branch; -+ struct bpf_verifier_state *this_branch = env->cur_state; -+ struct bpf_verifier_state *other_branch; -+ struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs; -+ struct bpf_reg_state *dst_reg, *other_branch_regs, *src_reg = NULL; - u8 opcode = BPF_OP(insn->code); -+ bool is_jmp32; -+ int pred = -1; - int err; - -- if (opcode > BPF_EXIT) { -- verbose("invalid BPF_JMP opcode %x\n", opcode); -+ /* Only conditional jumps are expected to reach here. */ -+ if (opcode == BPF_JA || opcode > BPF_JSLE) { -+ verbose(env, "invalid BPF_JMP/JMP32 opcode %x\n", opcode); - return -EINVAL; - } - - if (BPF_SRC(insn->code) == BPF_X) { - if (insn->imm != 0) { -- verbose("BPF_JMP uses reserved fields\n"); -+ verbose(env, "BPF_JMP/JMP32 uses reserved fields\n"); - return -EINVAL; - } - - /* check src1 operand */ -- err = check_reg_arg(regs, insn->src_reg, SRC_OP); -+ err = check_reg_arg(env, insn->src_reg, SRC_OP); - if (err) - return err; - - if (is_pointer_value(env, insn->src_reg)) { -- verbose("R%d pointer comparison prohibited\n", -+ verbose(env, "R%d pointer comparison prohibited\n", - insn->src_reg); - return -EACCES; - } -+ src_reg = ®s[insn->src_reg]; - } else { - if (insn->src_reg != BPF_REG_0) { -- verbose("BPF_JMP uses reserved fields\n"); -+ verbose(env, "BPF_JMP/JMP32 uses reserved fields\n"); - return -EINVAL; - } - } - - /* check src2 operand */ -- err = check_reg_arg(regs, insn->dst_reg, SRC_OP); -+ err = check_reg_arg(env, insn->dst_reg, SRC_OP); - if (err) - return err; - -- /* detect if R == 0 where R was initialized to zero earlier */ -- if (BPF_SRC(insn->code) == BPF_K && -- (opcode == BPF_JEQ || opcode == BPF_JNE) && -- regs[insn->dst_reg].type == CONST_IMM && -- regs[insn->dst_reg].imm == insn->imm) { -- if (opcode == BPF_JEQ) { -- /* if (imm == imm) goto pc+off; -- * only follow the goto, ignore fall-through -- */ -- *insn_idx += insn->off; -- return 0; -- } else { -- /* if (imm != imm) goto pc+off; -- * only follow fall-through branch, since -- * that's where the program will go -- */ -- return 0; -- } -+ dst_reg = ®s[insn->dst_reg]; -+ is_jmp32 = BPF_CLASS(insn->code) == BPF_JMP32; -+ -+ if (BPF_SRC(insn->code) == BPF_K) -+ pred = is_branch_taken(dst_reg, insn->imm, -+ opcode, is_jmp32); -+ else if (src_reg->type == SCALAR_VALUE && -+ tnum_is_const(src_reg->var_off)) -+ pred = is_branch_taken(dst_reg, src_reg->var_off.value, -+ opcode, is_jmp32); -+ if (pred >= 0) { -+ err = mark_chain_precision(env, insn->dst_reg); -+ if (BPF_SRC(insn->code) == BPF_X && !err) -+ err = mark_chain_precision(env, insn->src_reg); -+ if (err) -+ return err; -+ } -+ -+ if (pred == 1) { -+ /* Only follow the goto, ignore fall-through. If needed, push -+ * the fall-through branch for simulation under speculative -+ * execution. -+ */ -+ if (!env->allow_ptr_leaks && -+ !sanitize_speculative_path(env, insn, *insn_idx + 1, -+ *insn_idx)) -+ return -EFAULT; -+ *insn_idx += insn->off; -+ return 0; -+ } else if (pred == 0) { -+ /* Only follow the fall-through branch, since that's where the -+ * program will go. If needed, push the goto branch for -+ * simulation under speculative execution. -+ */ -+ if (!env->allow_ptr_leaks && -+ !sanitize_speculative_path(env, insn, -+ *insn_idx + insn->off + 1, -+ *insn_idx)) -+ return -EFAULT; -+ return 0; - } - -- other_branch = push_stack(env, *insn_idx + insn->off + 1, *insn_idx); -+ other_branch = push_stack(env, *insn_idx + insn->off + 1, *insn_idx, -+ false); - if (!other_branch) - return -EFAULT; -+ other_branch_regs = other_branch->frame[other_branch->curframe]->regs; - -- /* detect if R == 0 where R is returned value from bpf_map_lookup_elem() */ -- if (BPF_SRC(insn->code) == BPF_K && -- insn->imm == 0 && (opcode == BPF_JEQ || -- opcode == BPF_JNE) && -- regs[insn->dst_reg].type == PTR_TO_MAP_VALUE_OR_NULL) { -- if (opcode == BPF_JEQ) { -- /* next fallthrough insn can access memory via -- * this register -- */ -- regs[insn->dst_reg].type = PTR_TO_MAP_VALUE; -- /* branch targer cannot access it, since reg == 0 */ -- other_branch->regs[insn->dst_reg].type = CONST_IMM; -- other_branch->regs[insn->dst_reg].imm = 0; -- } else { -- other_branch->regs[insn->dst_reg].type = PTR_TO_MAP_VALUE; -- regs[insn->dst_reg].type = CONST_IMM; -- regs[insn->dst_reg].imm = 0; -- } -- } else if (is_pointer_value(env, insn->dst_reg)) { -- verbose("R%d pointer comparison prohibited\n", insn->dst_reg); -+ /* detect if we are comparing against a constant value so we can adjust -+ * our min/max values for our dst register. -+ * this is only legit if both are scalars (or pointers to the same -+ * object, I suppose, but we don't support that right now), because -+ * otherwise the different base pointers mean the offsets aren't -+ * comparable. -+ */ -+ if (BPF_SRC(insn->code) == BPF_X) { -+ struct bpf_reg_state *src_reg = ®s[insn->src_reg]; -+ struct bpf_reg_state lo_reg0 = *dst_reg; -+ struct bpf_reg_state lo_reg1 = *src_reg; -+ struct bpf_reg_state *src_lo, *dst_lo; -+ -+ dst_lo = &lo_reg0; -+ src_lo = &lo_reg1; -+ coerce_reg_to_size(dst_lo, 4); -+ coerce_reg_to_size(src_lo, 4); -+ -+ if (dst_reg->type == SCALAR_VALUE && -+ src_reg->type == SCALAR_VALUE) { -+ if (tnum_is_const(src_reg->var_off) || -+ (is_jmp32 && tnum_is_const(src_lo->var_off))) -+ reg_set_min_max(&other_branch_regs[insn->dst_reg], -+ dst_reg, -+ is_jmp32 -+ ? src_lo->var_off.value -+ : src_reg->var_off.value, -+ opcode, is_jmp32); -+ else if (tnum_is_const(dst_reg->var_off) || -+ (is_jmp32 && tnum_is_const(dst_lo->var_off))) -+ reg_set_min_max_inv(&other_branch_regs[insn->src_reg], -+ src_reg, -+ is_jmp32 -+ ? dst_lo->var_off.value -+ : dst_reg->var_off.value, -+ opcode, is_jmp32); -+ else if (!is_jmp32 && -+ (opcode == BPF_JEQ || opcode == BPF_JNE)) -+ /* Comparing for equality, we can combine knowledge */ -+ reg_combine_min_max(&other_branch_regs[insn->src_reg], -+ &other_branch_regs[insn->dst_reg], -+ src_reg, dst_reg, opcode); -+ } -+ } else if (dst_reg->type == SCALAR_VALUE) { -+ reg_set_min_max(&other_branch_regs[insn->dst_reg], -+ dst_reg, insn->imm, opcode, is_jmp32); -+ } -+ -+ /* detect if R == 0 where R is returned from bpf_map_lookup_elem(). -+ * NOTE: these optimizations below are related with pointer comparison -+ * which will never be JMP32. -+ */ -+ if (!is_jmp32 && BPF_SRC(insn->code) == BPF_K && -+ insn->imm == 0 && (opcode == BPF_JEQ || opcode == BPF_JNE) && -+ reg_type_may_be_null(dst_reg->type)) { -+ /* Mark all identical registers in each branch as either -+ * safe or unknown depending R == 0 or R != 0 conditional. -+ */ -+ mark_ptr_or_null_regs(this_branch, insn->dst_reg, -+ opcode == BPF_JNE); -+ mark_ptr_or_null_regs(other_branch, insn->dst_reg, -+ opcode == BPF_JEQ); -+ } else if (!try_match_pkt_pointers(insn, dst_reg, ®s[insn->src_reg], -+ this_branch, other_branch) && -+ is_pointer_value(env, insn->dst_reg)) { -+ verbose(env, "R%d pointer comparison prohibited\n", -+ insn->dst_reg); - return -EACCES; -- } else if (BPF_SRC(insn->code) == BPF_K && -- (opcode == BPF_JEQ || opcode == BPF_JNE)) { -- -- if (opcode == BPF_JEQ) { -- /* detect if (R == imm) goto -- * and in the target state recognize that R = imm -- */ -- other_branch->regs[insn->dst_reg].type = CONST_IMM; -- other_branch->regs[insn->dst_reg].imm = insn->imm; -- } else { -- /* detect if (R != imm) goto -- * and in the fall-through state recognize that R = imm -- */ -- regs[insn->dst_reg].type = CONST_IMM; -- regs[insn->dst_reg].imm = insn->imm; -- } - } -- if (log_level) -- print_verifier_state(env); -+ if (env->log.level & BPF_LOG_LEVEL) -+ print_verifier_state(env, this_branch->frame[this_branch->curframe]); - return 0; - } - --/* return the map pointer stored inside BPF_LD_IMM64 instruction */ --static struct bpf_map *ld_imm64_to_map_ptr(struct bpf_insn *insn) --{ -- u64 imm64 = ((u64) (u32) insn[0].imm) | ((u64) (u32) insn[1].imm) << 32; -- -- return (struct bpf_map *) (unsigned long) imm64; --} -- - /* verify BPF_LD_IMM64 instruction */ --static int check_ld_imm(struct verifier_env *env, struct bpf_insn *insn) -+static int check_ld_imm(struct bpf_verifier_env *env, struct bpf_insn *insn) - { -- struct reg_state *regs = env->cur_state.regs; -+ struct bpf_insn_aux_data *aux = cur_aux(env); -+ struct bpf_reg_state *regs = cur_regs(env); -+ struct bpf_map *map; - int err; - - if (BPF_SIZE(insn->code) != BPF_DW) { -- verbose("invalid BPF_LD_IMM insn\n"); -+ verbose(env, "invalid BPF_LD_IMM insn\n"); - return -EINVAL; - } - if (insn->off != 0) { -- verbose("BPF_LD_IMM64 uses reserved fields\n"); -+ verbose(env, "BPF_LD_IMM64 uses reserved fields\n"); - return -EINVAL; - } - -- err = check_reg_arg(regs, insn->dst_reg, DST_OP); -+ err = check_reg_arg(env, insn->dst_reg, DST_OP); - if (err) - return err; - -- if (insn->src_reg == 0) -- /* generic move 64-bit immediate into a register */ -+ if (insn->src_reg == 0) { -+ u64 imm = ((u64)(insn + 1)->imm << 32) | (u32)insn->imm; -+ -+ regs[insn->dst_reg].type = SCALAR_VALUE; -+ __mark_reg_known(®s[insn->dst_reg], imm); - return 0; -+ } - -- /* replace_map_fd_with_map_ptr() should have caught bad ld_imm64 */ -- BUG_ON(insn->src_reg != BPF_PSEUDO_MAP_FD); -+ map = env->used_maps[aux->map_index]; -+ mark_reg_known_zero(env, regs, insn->dst_reg); -+ regs[insn->dst_reg].map_ptr = map; -+ -+ if (insn->src_reg == BPF_PSEUDO_MAP_VALUE) { -+ regs[insn->dst_reg].type = PTR_TO_MAP_VALUE; -+ regs[insn->dst_reg].off = aux->map_off; -+ if (map_value_has_spin_lock(map)) -+ regs[insn->dst_reg].id = ++env->id_gen; -+ } else if (insn->src_reg == BPF_PSEUDO_MAP_FD) { -+ regs[insn->dst_reg].type = CONST_PTR_TO_MAP; -+ } else { -+ verbose(env, "bpf verifier is misconfigured\n"); -+ return -EINVAL; -+ } - -- regs[insn->dst_reg].type = CONST_PTR_TO_MAP; -- regs[insn->dst_reg].map_ptr = ld_imm64_to_map_ptr(insn); - return 0; - } - -@@ -1357,53 +6272,148 @@ static bool may_access_skb(enum bpf_prog - * Output: - * R0 - 8/16/32-bit skb data converted to cpu endianness - */ --static int check_ld_abs(struct verifier_env *env, struct bpf_insn *insn) -+static int check_ld_abs(struct bpf_verifier_env *env, struct bpf_insn *insn) - { -- struct reg_state *regs = env->cur_state.regs; -+ struct bpf_reg_state *regs = cur_regs(env); -+ static const int ctx_reg = BPF_REG_6; - u8 mode = BPF_MODE(insn->code); -- struct reg_state *reg; - int i, err; - - if (!may_access_skb(env->prog->type)) { -- verbose("BPF_LD_ABS|IND instructions not allowed for this program type\n"); -+ verbose(env, "BPF_LD_[ABS|IND] instructions not allowed for this program type\n"); -+ return -EINVAL; -+ } -+ -+ if (!env->ops->gen_ld_abs) { -+ verbose(env, "bpf verifier is misconfigured\n"); -+ return -EINVAL; -+ } -+ -+ if (env->subprog_cnt > 1) { -+ /* when program has LD_ABS insn JITs and interpreter assume -+ * that r1 == ctx == skb which is not the case for callees -+ * that can have arbitrary arguments. It's problematic -+ * for main prog as well since JITs would need to analyze -+ * all functions in order to make proper register save/restore -+ * decisions in the main prog. Hence disallow LD_ABS with calls -+ */ -+ verbose(env, "BPF_LD_[ABS|IND] instructions cannot be mixed with bpf-to-bpf calls\n"); - return -EINVAL; - } - - if (insn->dst_reg != BPF_REG_0 || insn->off != 0 || - BPF_SIZE(insn->code) == BPF_DW || - (mode == BPF_ABS && insn->src_reg != BPF_REG_0)) { -- verbose("BPF_LD_ABS uses reserved fields\n"); -+ verbose(env, "BPF_LD_[ABS|IND] uses reserved fields\n"); - return -EINVAL; - } - - /* check whether implicit source operand (register R6) is readable */ -- err = check_reg_arg(regs, BPF_REG_6, SRC_OP); -+ err = check_reg_arg(env, ctx_reg, SRC_OP); - if (err) - return err; - -- if (regs[BPF_REG_6].type != PTR_TO_CTX) { -- verbose("at the time of BPF_LD_ABS|IND R6 != pointer to skb\n"); -+ /* Disallow usage of BPF_LD_[ABS|IND] with reference tracking, as -+ * gen_ld_abs() may terminate the program at runtime, leading to -+ * reference leak. -+ */ -+ err = check_reference_leak(env); -+ if (err) { -+ verbose(env, "BPF_LD_[ABS|IND] cannot be mixed with socket references\n"); -+ return err; -+ } -+ -+ if (env->cur_state->active_spin_lock) { -+ verbose(env, "BPF_LD_[ABS|IND] cannot be used inside bpf_spin_lock-ed region\n"); -+ return -EINVAL; -+ } -+ -+ if (regs[ctx_reg].type != PTR_TO_CTX) { -+ verbose(env, -+ "at the time of BPF_LD_ABS|IND R6 != pointer to skb\n"); - return -EINVAL; - } - - if (mode == BPF_IND) { - /* check explicit source operand */ -- err = check_reg_arg(regs, insn->src_reg, SRC_OP); -+ err = check_reg_arg(env, insn->src_reg, SRC_OP); - if (err) - return err; - } - -+ err = check_ctx_reg(env, ®s[ctx_reg], ctx_reg); -+ if (err < 0) -+ return err; -+ - /* reset caller saved regs to unreadable */ - for (i = 0; i < CALLER_SAVED_REGS; i++) { -- reg = regs + caller_saved[i]; -- reg->type = NOT_INIT; -- reg->imm = 0; -+ mark_reg_not_init(env, regs, caller_saved[i]); -+ check_reg_arg(env, caller_saved[i], DST_OP_NO_MARK); - } - - /* mark destination R0 register as readable, since it contains -- * the value fetched from the packet -+ * the value fetched from the packet. -+ * Already marked as written above. - */ -- regs[BPF_REG_0].type = UNKNOWN_VALUE; -+ mark_reg_unknown(env, regs, BPF_REG_0); -+ /* ld_abs load up to 32-bit skb data. */ -+ regs[BPF_REG_0].subreg_def = env->insn_idx + 1; -+ return 0; -+} -+ -+static int check_return_code(struct bpf_verifier_env *env) -+{ -+ struct tnum enforce_attach_type_range = tnum_unknown; -+ struct bpf_reg_state *reg; -+ struct tnum range = tnum_range(0, 1); -+ -+ switch (env->prog->type) { -+ case BPF_PROG_TYPE_CGROUP_SOCK_ADDR: -+ if (env->prog->expected_attach_type == BPF_CGROUP_UDP4_RECVMSG || -+ env->prog->expected_attach_type == BPF_CGROUP_UDP6_RECVMSG) -+ range = tnum_range(1, 1); -+ break; -+ case BPF_PROG_TYPE_CGROUP_SKB: -+ if (env->prog->expected_attach_type == BPF_CGROUP_INET_EGRESS) { -+ range = tnum_range(0, 3); -+ enforce_attach_type_range = tnum_range(2, 3); -+ } -+ break; -+ case BPF_PROG_TYPE_CGROUP_SOCK: -+ case BPF_PROG_TYPE_SOCK_OPS: -+ case BPF_PROG_TYPE_CGROUP_DEVICE: -+ case BPF_PROG_TYPE_CGROUP_SYSCTL: -+ case BPF_PROG_TYPE_CGROUP_SOCKOPT: -+ break; -+ default: -+ return 0; -+ } -+ -+ reg = cur_regs(env) + BPF_REG_0; -+ if (reg->type != SCALAR_VALUE) { -+ verbose(env, "At program exit the register R0 is not a known value (%s)\n", -+ reg_type_str[reg->type]); -+ return -EINVAL; -+ } -+ -+ if (!tnum_in(range, reg->var_off)) { -+ char tn_buf[48]; -+ -+ verbose(env, "At program exit the register R0 "); -+ if (!tnum_is_unknown(reg->var_off)) { -+ tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -+ verbose(env, "has value %s", tn_buf); -+ } else { -+ verbose(env, "has unknown scalar value"); -+ } -+ tnum_strn(tn_buf, sizeof(tn_buf), range); -+ verbose(env, " should have been in %s\n", tn_buf); -+ return -EINVAL; -+ } -+ -+ if (!tnum_is_unknown(enforce_attach_type_range) && -+ tnum_in(enforce_attach_type_range, reg->var_off)) -+ env->prog->enforce_expected_attach_type = 1; - return 0; - } - -@@ -1447,19 +6457,37 @@ enum { - BRANCH = 2, - }; - --#define STATE_LIST_MARK ((struct verifier_state_list *) -1L) -+static u32 state_htab_size(struct bpf_verifier_env *env) -+{ -+ return env->prog->len; -+} -+ -+static struct bpf_verifier_state_list **explored_state( -+ struct bpf_verifier_env *env, -+ int idx) -+{ -+ struct bpf_verifier_state *cur = env->cur_state; -+ struct bpf_func_state *state = cur->frame[cur->curframe]; -+ -+ return &env->explored_states[(idx ^ state->callsite) % state_htab_size(env)]; -+} - --static int *insn_stack; /* stack of insns to process */ --static int cur_stack; /* current stack index */ --static int *insn_state; -+static void init_explored_state(struct bpf_verifier_env *env, int idx) -+{ -+ env->insn_aux_data[idx].prune_point = true; -+} - - /* t, w, e - match pseudo-code above: - * t - index of current instruction - * w - next instruction - * e - edge - */ --static int push_insn(int t, int w, int e, struct verifier_env *env) -+static int push_insn(int t, int w, int e, struct bpf_verifier_env *env, -+ bool loop_ok) - { -+ int *insn_stack = env->cfg.insn_stack; -+ int *insn_state = env->cfg.insn_state; -+ - if (e == FALLTHROUGH && insn_state[t] >= (DISCOVERED | FALLTHROUGH)) - return 0; - -@@ -1467,30 +6495,35 @@ static int push_insn(int t, int w, int e - return 0; - - if (w < 0 || w >= env->prog->len) { -- verbose("jump out of range from insn %d to %d\n", t, w); -+ verbose_linfo(env, t, "%d: ", t); -+ verbose(env, "jump out of range from insn %d to %d\n", t, w); - return -EINVAL; - } - - if (e == BRANCH) - /* mark branch target for state pruning */ -- env->explored_states[w] = STATE_LIST_MARK; -+ init_explored_state(env, w); - - if (insn_state[w] == 0) { - /* tree-edge */ - insn_state[t] = DISCOVERED | e; - insn_state[w] = DISCOVERED; -- if (cur_stack >= env->prog->len) -+ if (env->cfg.cur_stack >= env->prog->len) - return -E2BIG; -- insn_stack[cur_stack++] = w; -+ insn_stack[env->cfg.cur_stack++] = w; - return 1; - } else if ((insn_state[w] & 0xF0) == DISCOVERED) { -- verbose("back-edge from insn %d to %d\n", t, w); -+ if (loop_ok && env->allow_ptr_leaks) -+ return 0; -+ verbose_linfo(env, t, "%d: ", t); -+ verbose_linfo(env, w, "%d: ", w); -+ verbose(env, "back-edge from insn %d to %d\n", t, w); - return -EINVAL; - } else if (insn_state[w] == EXPLORED) { - /* forward- or cross-edge */ - insn_state[t] = DISCOVERED | e; - } else { -- verbose("insn state internal bug\n"); -+ verbose(env, "insn state internal bug\n"); - return -EFAULT; - } - return 0; -@@ -1499,43 +6532,56 @@ static int push_insn(int t, int w, int e - /* non-recursive depth-first-search to detect loops in BPF program - * loop == back-edge in directed graph - */ --static int check_cfg(struct verifier_env *env) -+static int check_cfg(struct bpf_verifier_env *env) - { - struct bpf_insn *insns = env->prog->insnsi; - int insn_cnt = env->prog->len; -+ int *insn_stack, *insn_state; - int ret = 0; - int i, t; - -- insn_state = kcalloc(insn_cnt, sizeof(int), GFP_KERNEL); -+ insn_state = env->cfg.insn_state = kcalloc(insn_cnt, sizeof(int), GFP_KERNEL); - if (!insn_state) - return -ENOMEM; - -- insn_stack = kcalloc(insn_cnt, sizeof(int), GFP_KERNEL); -+ insn_stack = env->cfg.insn_stack = kcalloc(insn_cnt, sizeof(int), GFP_KERNEL); - if (!insn_stack) { -- kfree(insn_state); -+ kvfree(insn_state); - return -ENOMEM; - } - - insn_state[0] = DISCOVERED; /* mark 1st insn as discovered */ - insn_stack[0] = 0; /* 0 is the first instruction */ -- cur_stack = 1; -+ env->cfg.cur_stack = 1; - - peek_stack: -- if (cur_stack == 0) -+ if (env->cfg.cur_stack == 0) - goto check_state; -- t = insn_stack[cur_stack - 1]; -+ t = insn_stack[env->cfg.cur_stack - 1]; - -- if (BPF_CLASS(insns[t].code) == BPF_JMP) { -+ if (BPF_CLASS(insns[t].code) == BPF_JMP || -+ BPF_CLASS(insns[t].code) == BPF_JMP32) { - u8 opcode = BPF_OP(insns[t].code); - - if (opcode == BPF_EXIT) { - goto mark_explored; - } else if (opcode == BPF_CALL) { -- ret = push_insn(t, t + 1, FALLTHROUGH, env); -+ ret = push_insn(t, t + 1, FALLTHROUGH, env, false); - if (ret == 1) - goto peek_stack; - else if (ret < 0) - goto err_free; -+ if (t + 1 < insn_cnt) -+ init_explored_state(env, t + 1); -+ if (insns[t].src_reg == BPF_PSEUDO_CALL) { -+ init_explored_state(env, t); -+ ret = push_insn(t, t + insns[t].imm + 1, BRANCH, -+ env, false); -+ if (ret == 1) -+ goto peek_stack; -+ else if (ret < 0) -+ goto err_free; -+ } - } else if (opcode == BPF_JA) { - if (BPF_SRC(insns[t].code) != BPF_K) { - ret = -EINVAL; -@@ -1543,25 +6589,31 @@ peek_stack: - } - /* unconditional jump with single edge */ - ret = push_insn(t, t + insns[t].off + 1, -- FALLTHROUGH, env); -+ FALLTHROUGH, env, true); - if (ret == 1) - goto peek_stack; - else if (ret < 0) - goto err_free; -+ /* unconditional jmp is not a good pruning point, -+ * but it's marked, since backtracking needs -+ * to record jmp history in is_state_visited(). -+ */ -+ init_explored_state(env, t + insns[t].off + 1); - /* tell verifier to check for equivalent states - * after every call and jump - */ - if (t + 1 < insn_cnt) -- env->explored_states[t + 1] = STATE_LIST_MARK; -+ init_explored_state(env, t + 1); - } else { - /* conditional jump with two edges */ -- ret = push_insn(t, t + 1, FALLTHROUGH, env); -+ init_explored_state(env, t); -+ ret = push_insn(t, t + 1, FALLTHROUGH, env, true); - if (ret == 1) - goto peek_stack; - else if (ret < 0) - goto err_free; - -- ret = push_insn(t, t + insns[t].off + 1, BRANCH, env); -+ ret = push_insn(t, t + insns[t].off + 1, BRANCH, env, true); - if (ret == 1) - goto peek_stack; - else if (ret < 0) -@@ -1571,7 +6623,7 @@ peek_stack: - /* all other non-branch instructions with single - * fall-through edge - */ -- ret = push_insn(t, t + 1, FALLTHROUGH, env); -+ ret = push_insn(t, t + 1, FALLTHROUGH, env, false); - if (ret == 1) - goto peek_stack; - else if (ret < 0) -@@ -1580,8 +6632,8 @@ peek_stack: - - mark_explored: - insn_state[t] = EXPLORED; -- if (cur_stack-- <= 0) { -- verbose("pop stack internal bug\n"); -+ if (env->cfg.cur_stack-- <= 0) { -+ verbose(env, "pop stack internal bug\n"); - ret = -EFAULT; - goto err_free; - } -@@ -1590,7 +6642,7 @@ mark_explored: - check_state: - for (i = 0; i < insn_cnt; i++) { - if (insn_state[i] != EXPLORED) { -- verbose("unreachable insn %d\n", i); -+ verbose(env, "unreachable insn %d\n", i); - ret = -EINVAL; - goto err_free; - } -@@ -1598,11 +6650,616 @@ check_state: - ret = 0; /* cfg looks good */ - - err_free: -- kfree(insn_state); -- kfree(insn_stack); -+ kvfree(insn_state); -+ kvfree(insn_stack); -+ env->cfg.insn_state = env->cfg.insn_stack = NULL; - return ret; - } - -+/* The minimum supported BTF func info size */ -+#define MIN_BPF_FUNCINFO_SIZE 8 -+#define MAX_FUNCINFO_REC_SIZE 252 -+ -+static int check_btf_func(struct bpf_verifier_env *env, -+ const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ u32 i, nfuncs, urec_size, min_size; -+ u32 krec_size = sizeof(struct bpf_func_info); -+ struct bpf_func_info *krecord; -+ const struct btf_type *type; -+ struct bpf_prog *prog; -+ const struct btf *btf; -+ void __user *urecord; -+ u32 prev_offset = 0; -+ int ret = 0; -+ -+ nfuncs = attr->func_info_cnt; -+ if (!nfuncs) -+ return 0; -+ -+ if (nfuncs != env->subprog_cnt) { -+ verbose(env, "number of funcs in func_info doesn't match number of subprogs\n"); -+ return -EINVAL; -+ } -+ -+ urec_size = attr->func_info_rec_size; -+ if (urec_size < MIN_BPF_FUNCINFO_SIZE || -+ urec_size > MAX_FUNCINFO_REC_SIZE || -+ urec_size % sizeof(u32)) { -+ verbose(env, "invalid func info rec size %u\n", urec_size); -+ return -EINVAL; -+ } -+ -+ prog = env->prog; -+ btf = prog->aux->btf; -+ -+ urecord = u64_to_user_ptr(attr->func_info); -+ min_size = min_t(u32, krec_size, urec_size); -+ -+ krecord = kcalloc(nfuncs, krec_size, GFP_KERNEL | __GFP_NOWARN); -+ if (!krecord) -+ return -ENOMEM; -+ -+ for (i = 0; i < nfuncs; i++) { -+ ret = bpf_check_uarg_tail_zero(urecord, krec_size, urec_size); -+ if (ret) { -+ if (ret == -E2BIG) { -+ verbose(env, "nonzero tailing record in func info"); -+ /* set the size kernel expects so loader can zero -+ * out the rest of the record. -+ */ -+ if (put_user(min_size, &uattr->func_info_rec_size)) -+ ret = -EFAULT; -+ } -+ goto err_free; -+ } -+ -+ if (copy_from_user(&krecord[i], urecord, min_size)) { -+ ret = -EFAULT; -+ goto err_free; -+ } -+ -+ /* check insn_off */ -+ if (i == 0) { -+ if (krecord[i].insn_off) { -+ verbose(env, -+ "nonzero insn_off %u for the first func info record", -+ krecord[i].insn_off); -+ ret = -EINVAL; -+ goto err_free; -+ } -+ } else if (krecord[i].insn_off <= prev_offset) { -+ verbose(env, -+ "same or smaller insn offset (%u) than previous func info record (%u)", -+ krecord[i].insn_off, prev_offset); -+ ret = -EINVAL; -+ goto err_free; -+ } -+ -+ if (env->subprog_info[i].start != krecord[i].insn_off) { -+ verbose(env, "func_info BTF section doesn't match subprog layout in BPF program\n"); -+ ret = -EINVAL; -+ goto err_free; -+ } -+ -+ /* check type_id */ -+ type = btf_type_by_id(btf, krecord[i].type_id); -+ if (!type || BTF_INFO_KIND(type->info) != BTF_KIND_FUNC) { -+ verbose(env, "invalid type id %d in func info", -+ krecord[i].type_id); -+ ret = -EINVAL; -+ goto err_free; -+ } -+ -+ prev_offset = krecord[i].insn_off; -+ urecord += urec_size; -+ } -+ -+ prog->aux->func_info = krecord; -+ prog->aux->func_info_cnt = nfuncs; -+ return 0; -+ -+err_free: -+ kvfree(krecord); -+ return ret; -+} -+ -+static void adjust_btf_func(struct bpf_verifier_env *env) -+{ -+ int i; -+ -+ if (!env->prog->aux->func_info) -+ return; -+ -+ for (i = 0; i < env->subprog_cnt; i++) -+ env->prog->aux->func_info[i].insn_off = env->subprog_info[i].start; -+} -+ -+#define MIN_BPF_LINEINFO_SIZE (offsetof(struct bpf_line_info, line_col) + \ -+ sizeof(((struct bpf_line_info *)(0))->line_col)) -+#define MAX_LINEINFO_REC_SIZE MAX_FUNCINFO_REC_SIZE -+ -+static int check_btf_line(struct bpf_verifier_env *env, -+ const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ u32 i, s, nr_linfo, ncopy, expected_size, rec_size, prev_offset = 0; -+ struct bpf_subprog_info *sub; -+ struct bpf_line_info *linfo; -+ struct bpf_prog *prog; -+ const struct btf *btf; -+ void __user *ulinfo; -+ int err; -+ -+ nr_linfo = attr->line_info_cnt; -+ if (!nr_linfo) -+ return 0; -+ -+ rec_size = attr->line_info_rec_size; -+ if (rec_size < MIN_BPF_LINEINFO_SIZE || -+ rec_size > MAX_LINEINFO_REC_SIZE || -+ rec_size & (sizeof(u32) - 1)) -+ return -EINVAL; -+ -+ /* Need to zero it in case the userspace may -+ * pass in a smaller bpf_line_info object. -+ */ -+ linfo = kcalloc(nr_linfo, sizeof(struct bpf_line_info), -+ GFP_KERNEL | __GFP_NOWARN); -+ if (!linfo) -+ return -ENOMEM; -+ -+ prog = env->prog; -+ btf = prog->aux->btf; -+ -+ s = 0; -+ sub = env->subprog_info; -+ ulinfo = u64_to_user_ptr(attr->line_info); -+ expected_size = sizeof(struct bpf_line_info); -+ ncopy = min_t(u32, expected_size, rec_size); -+ for (i = 0; i < nr_linfo; i++) { -+ err = bpf_check_uarg_tail_zero(ulinfo, expected_size, rec_size); -+ if (err) { -+ if (err == -E2BIG) { -+ verbose(env, "nonzero tailing record in line_info"); -+ if (put_user(expected_size, -+ &uattr->line_info_rec_size)) -+ err = -EFAULT; -+ } -+ goto err_free; -+ } -+ -+ if (copy_from_user(&linfo[i], ulinfo, ncopy)) { -+ err = -EFAULT; -+ goto err_free; -+ } -+ -+ /* -+ * Check insn_off to ensure -+ * 1) strictly increasing AND -+ * 2) bounded by prog->len -+ * -+ * The linfo[0].insn_off == 0 check logically falls into -+ * the later "missing bpf_line_info for func..." case -+ * because the first linfo[0].insn_off must be the -+ * first sub also and the first sub must have -+ * subprog_info[0].start == 0. -+ */ -+ if ((i && linfo[i].insn_off <= prev_offset) || -+ linfo[i].insn_off >= prog->len) { -+ verbose(env, "Invalid line_info[%u].insn_off:%u (prev_offset:%u prog->len:%u)\n", -+ i, linfo[i].insn_off, prev_offset, -+ prog->len); -+ err = -EINVAL; -+ goto err_free; -+ } -+ -+ if (!prog->insnsi[linfo[i].insn_off].code) { -+ verbose(env, -+ "Invalid insn code at line_info[%u].insn_off\n", -+ i); -+ err = -EINVAL; -+ goto err_free; -+ } -+ -+ if (!btf_name_by_offset(btf, linfo[i].line_off) || -+ !btf_name_by_offset(btf, linfo[i].file_name_off)) { -+ verbose(env, "Invalid line_info[%u].line_off or .file_name_off\n", i); -+ err = -EINVAL; -+ goto err_free; -+ } -+ -+ if (s != env->subprog_cnt) { -+ if (linfo[i].insn_off == sub[s].start) { -+ sub[s].linfo_idx = i; -+ s++; -+ } else if (sub[s].start < linfo[i].insn_off) { -+ verbose(env, "missing bpf_line_info for func#%u\n", s); -+ err = -EINVAL; -+ goto err_free; -+ } -+ } -+ -+ prev_offset = linfo[i].insn_off; -+ ulinfo += rec_size; -+ } -+ -+ if (s != env->subprog_cnt) { -+ verbose(env, "missing bpf_line_info for %u funcs starting from func#%u\n", -+ env->subprog_cnt - s, s); -+ err = -EINVAL; -+ goto err_free; -+ } -+ -+ prog->aux->linfo = linfo; -+ prog->aux->nr_linfo = nr_linfo; -+ -+ return 0; -+ -+err_free: -+ kvfree(linfo); -+ return err; -+} -+ -+static int check_btf_info(struct bpf_verifier_env *env, -+ const union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ struct btf *btf; -+ int err; -+ -+ if (!attr->func_info_cnt && !attr->line_info_cnt) -+ return 0; -+ -+ btf = btf_get_by_fd(attr->prog_btf_fd); -+ if (IS_ERR(btf)) -+ return PTR_ERR(btf); -+ env->prog->aux->btf = btf; -+ -+ err = check_btf_func(env, attr, uattr); -+ if (err) -+ return err; -+ -+ err = check_btf_line(env, attr, uattr); -+ if (err) -+ return err; -+ -+ return 0; -+} -+ -+/* check %cur's range satisfies %old's */ -+static bool range_within(struct bpf_reg_state *old, -+ struct bpf_reg_state *cur) -+{ -+ return old->umin_value <= cur->umin_value && -+ old->umax_value >= cur->umax_value && -+ old->smin_value <= cur->smin_value && -+ old->smax_value >= cur->smax_value; -+} -+ -+/* Maximum number of register states that can exist at once */ -+#define ID_MAP_SIZE (MAX_BPF_REG + MAX_BPF_STACK / BPF_REG_SIZE) -+struct idpair { -+ u32 old; -+ u32 cur; -+}; -+ -+/* If in the old state two registers had the same id, then they need to have -+ * the same id in the new state as well. But that id could be different from -+ * the old state, so we need to track the mapping from old to new ids. -+ * Once we have seen that, say, a reg with old id 5 had new id 9, any subsequent -+ * regs with old id 5 must also have new id 9 for the new state to be safe. But -+ * regs with a different old id could still have new id 9, we don't care about -+ * that. -+ * So we look through our idmap to see if this old id has been seen before. If -+ * so, we require the new id to match; otherwise, we add the id pair to the map. -+ */ -+static bool check_ids(u32 old_id, u32 cur_id, struct idpair *idmap) -+{ -+ unsigned int i; -+ -+ for (i = 0; i < ID_MAP_SIZE; i++) { -+ if (!idmap[i].old) { -+ /* Reached an empty slot; haven't seen this id before */ -+ idmap[i].old = old_id; -+ idmap[i].cur = cur_id; -+ return true; -+ } -+ if (idmap[i].old == old_id) -+ return idmap[i].cur == cur_id; -+ } -+ /* We ran out of idmap slots, which should be impossible */ -+ WARN_ON_ONCE(1); -+ return false; -+} -+ -+static void clean_func_state(struct bpf_verifier_env *env, -+ struct bpf_func_state *st) -+{ -+ enum bpf_reg_liveness live; -+ int i, j; -+ -+ for (i = 0; i < BPF_REG_FP; i++) { -+ live = st->regs[i].live; -+ /* liveness must not touch this register anymore */ -+ st->regs[i].live |= REG_LIVE_DONE; -+ if (!(live & REG_LIVE_READ)) -+ /* since the register is unused, clear its state -+ * to make further comparison simpler -+ */ -+ __mark_reg_not_init(env, &st->regs[i]); -+ } -+ -+ for (i = 0; i < st->allocated_stack / BPF_REG_SIZE; i++) { -+ live = st->stack[i].spilled_ptr.live; -+ /* liveness must not touch this stack slot anymore */ -+ st->stack[i].spilled_ptr.live |= REG_LIVE_DONE; -+ if (!(live & REG_LIVE_READ)) { -+ __mark_reg_not_init(env, &st->stack[i].spilled_ptr); -+ for (j = 0; j < BPF_REG_SIZE; j++) -+ st->stack[i].slot_type[j] = STACK_INVALID; -+ } -+ } -+} -+ -+static void clean_verifier_state(struct bpf_verifier_env *env, -+ struct bpf_verifier_state *st) -+{ -+ int i; -+ -+ if (st->frame[0]->regs[0].live & REG_LIVE_DONE) -+ /* all regs in this state in all frames were already marked */ -+ return; -+ -+ for (i = 0; i <= st->curframe; i++) -+ clean_func_state(env, st->frame[i]); -+} -+ -+/* the parentage chains form a tree. -+ * the verifier states are added to state lists at given insn and -+ * pushed into state stack for future exploration. -+ * when the verifier reaches bpf_exit insn some of the verifer states -+ * stored in the state lists have their final liveness state already, -+ * but a lot of states will get revised from liveness point of view when -+ * the verifier explores other branches. -+ * Example: -+ * 1: r0 = 1 -+ * 2: if r1 == 100 goto pc+1 -+ * 3: r0 = 2 -+ * 4: exit -+ * when the verifier reaches exit insn the register r0 in the state list of -+ * insn 2 will be seen as !REG_LIVE_READ. Then the verifier pops the other_branch -+ * of insn 2 and goes exploring further. At the insn 4 it will walk the -+ * parentage chain from insn 4 into insn 2 and will mark r0 as REG_LIVE_READ. -+ * -+ * Since the verifier pushes the branch states as it sees them while exploring -+ * the program the condition of walking the branch instruction for the second -+ * time means that all states below this branch were already explored and -+ * their final liveness markes are already propagated. -+ * Hence when the verifier completes the search of state list in is_state_visited() -+ * we can call this clean_live_states() function to mark all liveness states -+ * as REG_LIVE_DONE to indicate that 'parent' pointers of 'struct bpf_reg_state' -+ * will not be used. -+ * This function also clears the registers and stack for states that !READ -+ * to simplify state merging. -+ * -+ * Important note here that walking the same branch instruction in the callee -+ * doesn't meant that the states are DONE. The verifier has to compare -+ * the callsites -+ */ -+static void clean_live_states(struct bpf_verifier_env *env, int insn, -+ struct bpf_verifier_state *cur) -+{ -+ struct bpf_verifier_state_list *sl; -+ int i; -+ -+ sl = *explored_state(env, insn); -+ while (sl) { -+ if (sl->state.branches) -+ goto next; -+ if (sl->state.insn_idx != insn || -+ sl->state.curframe != cur->curframe) -+ goto next; -+ for (i = 0; i <= cur->curframe; i++) -+ if (sl->state.frame[i]->callsite != cur->frame[i]->callsite) -+ goto next; -+ clean_verifier_state(env, &sl->state); -+next: -+ sl = sl->next; -+ } -+} -+ -+/* Returns true if (rold safe implies rcur safe) */ -+static bool regsafe(struct bpf_reg_state *rold, struct bpf_reg_state *rcur, -+ struct idpair *idmap) -+{ -+ bool equal; -+ -+ if (!(rold->live & REG_LIVE_READ)) -+ /* explored state didn't use this */ -+ return true; -+ -+ equal = memcmp(rold, rcur, offsetof(struct bpf_reg_state, parent)) == 0; -+ -+ if (rold->type == PTR_TO_STACK) -+ /* two stack pointers are equal only if they're pointing to -+ * the same stack frame, since fp-8 in foo != fp-8 in bar -+ */ -+ return equal && rold->frameno == rcur->frameno; -+ -+ if (equal) -+ return true; -+ -+ if (rold->type == NOT_INIT) -+ /* explored state can't have used this */ -+ return true; -+ if (rcur->type == NOT_INIT) -+ return false; -+ switch (rold->type) { -+ case SCALAR_VALUE: -+ if (rcur->type == SCALAR_VALUE) { -+ if (!rold->precise && !rcur->precise) -+ return true; -+ /* new val must satisfy old val knowledge */ -+ return range_within(rold, rcur) && -+ tnum_in(rold->var_off, rcur->var_off); -+ } else { -+ /* We're trying to use a pointer in place of a scalar. -+ * Even if the scalar was unbounded, this could lead to -+ * pointer leaks because scalars are allowed to leak -+ * while pointers are not. We could make this safe in -+ * special cases if root is calling us, but it's -+ * probably not worth the hassle. -+ */ -+ return false; -+ } -+ case PTR_TO_MAP_VALUE: -+ /* If the new min/max/var_off satisfy the old ones and -+ * everything else matches, we are OK. -+ * 'id' is not compared, since it's only used for maps with -+ * bpf_spin_lock inside map element and in such cases if -+ * the rest of the prog is valid for one map element then -+ * it's valid for all map elements regardless of the key -+ * used in bpf_map_lookup() -+ */ -+ return memcmp(rold, rcur, offsetof(struct bpf_reg_state, id)) == 0 && -+ range_within(rold, rcur) && -+ tnum_in(rold->var_off, rcur->var_off); -+ case PTR_TO_MAP_VALUE_OR_NULL: -+ /* a PTR_TO_MAP_VALUE could be safe to use as a -+ * PTR_TO_MAP_VALUE_OR_NULL into the same map. -+ * However, if the old PTR_TO_MAP_VALUE_OR_NULL then got NULL- -+ * checked, doing so could have affected others with the same -+ * id, and we can't check for that because we lost the id when -+ * we converted to a PTR_TO_MAP_VALUE. -+ */ -+ if (rcur->type != PTR_TO_MAP_VALUE_OR_NULL) -+ return false; -+ if (memcmp(rold, rcur, offsetof(struct bpf_reg_state, id))) -+ return false; -+ /* Check our ids match any regs they're supposed to */ -+ return check_ids(rold->id, rcur->id, idmap); -+ case PTR_TO_PACKET_META: -+ case PTR_TO_PACKET: -+ if (rcur->type != rold->type) -+ return false; -+ /* We must have at least as much range as the old ptr -+ * did, so that any accesses which were safe before are -+ * still safe. This is true even if old range < old off, -+ * since someone could have accessed through (ptr - k), or -+ * even done ptr -= k in a register, to get a safe access. -+ */ -+ if (rold->range > rcur->range) -+ return false; -+ /* If the offsets don't match, we can't trust our alignment; -+ * nor can we be sure that we won't fall out of range. -+ */ -+ if (rold->off != rcur->off) -+ return false; -+ /* id relations must be preserved */ -+ if (rold->id && !check_ids(rold->id, rcur->id, idmap)) -+ return false; -+ /* new val must satisfy old val knowledge */ -+ return range_within(rold, rcur) && -+ tnum_in(rold->var_off, rcur->var_off); -+ case PTR_TO_CTX: -+ case CONST_PTR_TO_MAP: -+ case PTR_TO_PACKET_END: -+ case PTR_TO_FLOW_KEYS: -+ case PTR_TO_SOCKET: -+ case PTR_TO_SOCKET_OR_NULL: -+ case PTR_TO_SOCK_COMMON: -+ case PTR_TO_SOCK_COMMON_OR_NULL: -+ case PTR_TO_TCP_SOCK: -+ case PTR_TO_TCP_SOCK_OR_NULL: -+ case PTR_TO_XDP_SOCK: -+ /* Only valid matches are exact, which memcmp() above -+ * would have accepted -+ */ -+ default: -+ /* Don't know what's going on, just say it's not safe */ -+ return false; -+ } -+ -+ /* Shouldn't get here; if we do, say it's not safe */ -+ WARN_ON_ONCE(1); -+ return false; -+} -+ -+static bool stacksafe(struct bpf_func_state *old, -+ struct bpf_func_state *cur, -+ struct idpair *idmap) -+{ -+ int i, spi; -+ -+ /* walk slots of the explored stack and ignore any additional -+ * slots in the current stack, since explored(safe) state -+ * didn't use them -+ */ -+ for (i = 0; i < old->allocated_stack; i++) { -+ spi = i / BPF_REG_SIZE; -+ -+ if (!(old->stack[spi].spilled_ptr.live & REG_LIVE_READ)) { -+ i += BPF_REG_SIZE - 1; -+ /* explored state didn't use this */ -+ continue; -+ } -+ -+ if (old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_INVALID) -+ continue; -+ -+ /* explored stack has more populated slots than current stack -+ * and these slots were used -+ */ -+ if (i >= cur->allocated_stack) -+ return false; -+ -+ /* if old state was safe with misc data in the stack -+ * it will be safe with zero-initialized stack. -+ * The opposite is not true -+ */ -+ if (old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_MISC && -+ cur->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_ZERO) -+ continue; -+ if (old->stack[spi].slot_type[i % BPF_REG_SIZE] != -+ cur->stack[spi].slot_type[i % BPF_REG_SIZE]) -+ /* Ex: old explored (safe) state has STACK_SPILL in -+ * this stack slot, but current has has STACK_MISC -> -+ * this verifier states are not equivalent, -+ * return false to continue verification of this path -+ */ -+ return false; -+ if (i % BPF_REG_SIZE) -+ continue; -+ if (old->stack[spi].slot_type[0] != STACK_SPILL) -+ continue; -+ if (!regsafe(&old->stack[spi].spilled_ptr, -+ &cur->stack[spi].spilled_ptr, -+ idmap)) -+ /* when explored and current stack slot are both storing -+ * spilled registers, check that stored pointers types -+ * are the same as well. -+ * Ex: explored safe path could have stored -+ * (bpf_reg_state) {.type = PTR_TO_STACK, .off = -8} -+ * but current path has stored: -+ * (bpf_reg_state) {.type = PTR_TO_STACK, .off = -16} -+ * such verifier states are not equivalent. -+ * return false to continue verification of this path -+ */ -+ return false; -+ } -+ return true; -+} -+ -+static bool refsafe(struct bpf_func_state *old, struct bpf_func_state *cur) -+{ -+ if (old->acquired_refs != cur->acquired_refs) -+ return false; -+ return !memcmp(old->refs, cur->refs, -+ sizeof(*old->refs) * old->acquired_refs); -+} -+ - /* compare two verifier states - * - * all states stored in state_list are known to be valid, since -@@ -1629,165 +7286,562 @@ err_free: - * whereas register type in current state is meaningful, it means that - * the current state will reach 'bpf_exit' instruction safely - */ --static bool states_equal(struct verifier_state *old, struct verifier_state *cur) -+static bool func_states_equal(struct bpf_func_state *old, -+ struct bpf_func_state *cur) - { -+ struct idpair *idmap; -+ bool ret = false; - int i; - -+ idmap = kcalloc(ID_MAP_SIZE, sizeof(struct idpair), GFP_KERNEL); -+ /* If we failed to allocate the idmap, just say it's not safe */ -+ if (!idmap) -+ return false; -+ - for (i = 0; i < MAX_BPF_REG; i++) { -- if (memcmp(&old->regs[i], &cur->regs[i], -- sizeof(old->regs[0])) != 0) { -- if (old->regs[i].type == NOT_INIT || -- (old->regs[i].type == UNKNOWN_VALUE && -- cur->regs[i].type != NOT_INIT)) -- continue; -+ if (!regsafe(&old->regs[i], &cur->regs[i], idmap)) -+ goto out_free; -+ } -+ -+ if (!stacksafe(old, cur, idmap)) -+ goto out_free; -+ -+ if (!refsafe(old, cur)) -+ goto out_free; -+ ret = true; -+out_free: -+ kfree(idmap); -+ return ret; -+} -+ -+static bool states_equal(struct bpf_verifier_env *env, -+ struct bpf_verifier_state *old, -+ struct bpf_verifier_state *cur) -+{ -+ int i; -+ -+ if (old->curframe != cur->curframe) -+ return false; -+ -+ /* Verification state from speculative execution simulation -+ * must never prune a non-speculative execution one. -+ */ -+ if (old->speculative && !cur->speculative) -+ return false; -+ -+ if (old->active_spin_lock != cur->active_spin_lock) -+ return false; -+ -+ /* for states to be equal callsites have to be the same -+ * and all frame states need to be equivalent -+ */ -+ for (i = 0; i <= old->curframe; i++) { -+ if (old->frame[i]->callsite != cur->frame[i]->callsite) -+ return false; -+ if (!func_states_equal(old->frame[i], cur->frame[i])) - return false; -+ } -+ return true; -+} -+ -+/* Return 0 if no propagation happened. Return negative error code if error -+ * happened. Otherwise, return the propagated bit. -+ */ -+static int propagate_liveness_reg(struct bpf_verifier_env *env, -+ struct bpf_reg_state *reg, -+ struct bpf_reg_state *parent_reg) -+{ -+ u8 parent_flag = parent_reg->live & REG_LIVE_READ; -+ u8 flag = reg->live & REG_LIVE_READ; -+ int err; -+ -+ /* When comes here, read flags of PARENT_REG or REG could be any of -+ * REG_LIVE_READ64, REG_LIVE_READ32, REG_LIVE_NONE. There is no need -+ * of propagation if PARENT_REG has strongest REG_LIVE_READ64. -+ */ -+ if (parent_flag == REG_LIVE_READ64 || -+ /* Or if there is no read flag from REG. */ -+ !flag || -+ /* Or if the read flag from REG is the same as PARENT_REG. */ -+ parent_flag == flag) -+ return 0; -+ -+ err = mark_reg_read(env, reg, parent_reg, flag); -+ if (err) -+ return err; -+ -+ return flag; -+} -+ -+/* A write screens off any subsequent reads; but write marks come from the -+ * straight-line code between a state and its parent. When we arrive at an -+ * equivalent state (jump target or such) we didn't arrive by the straight-line -+ * code, so read marks in the state must propagate to the parent regardless -+ * of the state's write marks. That's what 'parent == state->parent' comparison -+ * in mark_reg_read() is for. -+ */ -+static int propagate_liveness(struct bpf_verifier_env *env, -+ const struct bpf_verifier_state *vstate, -+ struct bpf_verifier_state *vparent) -+{ -+ struct bpf_reg_state *state_reg, *parent_reg; -+ struct bpf_func_state *state, *parent; -+ int i, frame, err = 0; -+ -+ if (vparent->curframe != vstate->curframe) { -+ WARN(1, "propagate_live: parent frame %d current frame %d\n", -+ vparent->curframe, vstate->curframe); -+ return -EFAULT; -+ } -+ /* Propagate read liveness of registers... */ -+ BUILD_BUG_ON(BPF_REG_FP + 1 != MAX_BPF_REG); -+ for (frame = 0; frame <= vstate->curframe; frame++) { -+ parent = vparent->frame[frame]; -+ state = vstate->frame[frame]; -+ parent_reg = parent->regs; -+ state_reg = state->regs; -+ /* We don't need to worry about FP liveness, it's read-only */ -+ for (i = frame < vstate->curframe ? BPF_REG_6 : 0; i < BPF_REG_FP; i++) { -+ err = propagate_liveness_reg(env, &state_reg[i], -+ &parent_reg[i]); -+ if (err < 0) -+ return err; -+ if (err == REG_LIVE_READ64) -+ mark_insn_zext(env, &parent_reg[i]); -+ } -+ -+ /* Propagate stack slots. */ -+ for (i = 0; i < state->allocated_stack / BPF_REG_SIZE && -+ i < parent->allocated_stack / BPF_REG_SIZE; i++) { -+ parent_reg = &parent->stack[i].spilled_ptr; -+ state_reg = &state->stack[i].spilled_ptr; -+ err = propagate_liveness_reg(env, state_reg, -+ parent_reg); -+ if (err < 0) -+ return err; - } - } -+ return 0; -+} - -- for (i = 0; i < MAX_BPF_STACK; i++) { -- if (old->stack_slot_type[i] == STACK_INVALID) -+/* find precise scalars in the previous equivalent state and -+ * propagate them into the current state -+ */ -+static int propagate_precision(struct bpf_verifier_env *env, -+ const struct bpf_verifier_state *old) -+{ -+ struct bpf_reg_state *state_reg; -+ struct bpf_func_state *state; -+ int i, err = 0; -+ -+ state = old->frame[old->curframe]; -+ state_reg = state->regs; -+ for (i = 0; i < BPF_REG_FP; i++, state_reg++) { -+ if (state_reg->type != SCALAR_VALUE || -+ !state_reg->precise) - continue; -- if (old->stack_slot_type[i] != cur->stack_slot_type[i]) -- /* Ex: old explored (safe) state has STACK_SPILL in -- * this stack slot, but current has has STACK_MISC -> -- * this verifier states are not equivalent, -- * return false to continue verification of this path -- */ -- return false; -- if (i % BPF_REG_SIZE) -+ if (env->log.level & BPF_LOG_LEVEL2) -+ verbose(env, "propagating r%d\n", i); -+ err = mark_chain_precision(env, i); -+ if (err < 0) -+ return err; -+ } -+ -+ for (i = 0; i < state->allocated_stack / BPF_REG_SIZE; i++) { -+ if (state->stack[i].slot_type[0] != STACK_SPILL) - continue; -- if (memcmp(&old->spilled_regs[i / BPF_REG_SIZE], -- &cur->spilled_regs[i / BPF_REG_SIZE], -- sizeof(old->spilled_regs[0]))) -- /* when explored and current stack slot types are -- * the same, check that stored pointers types -- * are the same as well. -- * Ex: explored safe path could have stored -- * (struct reg_state) {.type = PTR_TO_STACK, .imm = -8} -- * but current path has stored: -- * (struct reg_state) {.type = PTR_TO_STACK, .imm = -16} -- * such verifier states are not equivalent. -- * return false to continue verification of this path -- */ -- return false; -- else -+ state_reg = &state->stack[i].spilled_ptr; -+ if (state_reg->type != SCALAR_VALUE || -+ !state_reg->precise) - continue; -+ if (env->log.level & BPF_LOG_LEVEL2) -+ verbose(env, "propagating fp%d\n", -+ (-i - 1) * BPF_REG_SIZE); -+ err = mark_chain_precision_stack(env, i); -+ if (err < 0) -+ return err; - } -+ return 0; -+} -+ -+static bool states_maybe_looping(struct bpf_verifier_state *old, -+ struct bpf_verifier_state *cur) -+{ -+ struct bpf_func_state *fold, *fcur; -+ int i, fr = cur->curframe; -+ -+ if (old->curframe != fr) -+ return false; -+ -+ fold = old->frame[fr]; -+ fcur = cur->frame[fr]; -+ for (i = 0; i < MAX_BPF_REG; i++) -+ if (memcmp(&fold->regs[i], &fcur->regs[i], -+ offsetof(struct bpf_reg_state, parent))) -+ return false; - return true; - } - --static int is_state_visited(struct verifier_env *env, int insn_idx) -+ -+static int is_state_visited(struct bpf_verifier_env *env, int insn_idx) - { -- struct verifier_state_list *new_sl; -- struct verifier_state_list *sl; -+ struct bpf_verifier_state_list *new_sl; -+ struct bpf_verifier_state_list *sl, **pprev; -+ struct bpf_verifier_state *cur = env->cur_state, *new; -+ int i, j, err, states_cnt = 0; -+ bool add_new_state = env->test_state_freq ? true : false; - -- sl = env->explored_states[insn_idx]; -- if (!sl) -+ cur->last_insn_idx = env->prev_insn_idx; -+ if (!env->insn_aux_data[insn_idx].prune_point) - /* this 'insn_idx' instruction wasn't marked, so we will not - * be doing state search here - */ - return 0; - -- while (sl != STATE_LIST_MARK) { -- if (states_equal(&sl->state, &env->cur_state)) -+ /* bpf progs typically have pruning point every 4 instructions -+ * http://vger.kernel.org/bpfconf2019.html#session-1 -+ * Do not add new state for future pruning if the verifier hasn't seen -+ * at least 2 jumps and at least 8 instructions. -+ * This heuristics helps decrease 'total_states' and 'peak_states' metric. -+ * In tests that amounts to up to 50% reduction into total verifier -+ * memory consumption and 20% verifier time speedup. -+ */ -+ if (env->jmps_processed - env->prev_jmps_processed >= 2 && -+ env->insn_processed - env->prev_insn_processed >= 8) -+ add_new_state = true; -+ -+ pprev = explored_state(env, insn_idx); -+ sl = *pprev; -+ -+ clean_live_states(env, insn_idx, cur); -+ -+ while (sl) { -+ states_cnt++; -+ if (sl->state.insn_idx != insn_idx) -+ goto next; -+ if (sl->state.branches) { -+ if (states_maybe_looping(&sl->state, cur) && -+ states_equal(env, &sl->state, cur)) { -+ verbose_linfo(env, insn_idx, "; "); -+ verbose(env, "infinite loop detected at insn %d\n", insn_idx); -+ return -EINVAL; -+ } -+ /* if the verifier is processing a loop, avoid adding new state -+ * too often, since different loop iterations have distinct -+ * states and may not help future pruning. -+ * This threshold shouldn't be too low to make sure that -+ * a loop with large bound will be rejected quickly. -+ * The most abusive loop will be: -+ * r1 += 1 -+ * if r1 < 1000000 goto pc-2 -+ * 1M insn_procssed limit / 100 == 10k peak states. -+ * This threshold shouldn't be too high either, since states -+ * at the end of the loop are likely to be useful in pruning. -+ */ -+ if (env->jmps_processed - env->prev_jmps_processed < 20 && -+ env->insn_processed - env->prev_insn_processed < 100) -+ add_new_state = false; -+ goto miss; -+ } -+ if (states_equal(env, &sl->state, cur)) { -+ sl->hit_cnt++; - /* reached equivalent register/stack state, -- * prune the search -+ * prune the search. -+ * Registers read by the continuation are read by us. -+ * If we have any write marks in env->cur_state, they -+ * will prevent corresponding reads in the continuation -+ * from reaching our parent (an explored_state). Our -+ * own state will get the read marks recorded, but -+ * they'll be immediately forgotten as we're pruning -+ * this state and will pop a new one. - */ -- return 1; -- sl = sl->next; -- } -+ err = propagate_liveness(env, &sl->state, cur); - -- /* there were no equivalent states, remember current one. -- * technically the current state is not proven to be safe yet, -- * but it will either reach bpf_exit (which means it's safe) or -- * it will be rejected. Since there are no loops, we won't be -- * seeing this 'insn_idx' instruction again on the way to bpf_exit -+ /* if previous state reached the exit with precision and -+ * current state is equivalent to it (except precsion marks) -+ * the precision needs to be propagated back in -+ * the current state. -+ */ -+ err = err ? : push_jmp_history(env, cur); -+ err = err ? : propagate_precision(env, &sl->state); -+ if (err) -+ return err; -+ return 1; -+ } -+miss: -+ /* when new state is not going to be added do not increase miss count. -+ * Otherwise several loop iterations will remove the state -+ * recorded earlier. The goal of these heuristics is to have -+ * states from some iterations of the loop (some in the beginning -+ * and some at the end) to help pruning. -+ */ -+ if (add_new_state) -+ sl->miss_cnt++; -+ /* heuristic to determine whether this state is beneficial -+ * to keep checking from state equivalence point of view. -+ * Higher numbers increase max_states_per_insn and verification time, -+ * but do not meaningfully decrease insn_processed. -+ */ -+ if (sl->miss_cnt > sl->hit_cnt * 3 + 3) { -+ /* the state is unlikely to be useful. Remove it to -+ * speed up verification -+ */ -+ *pprev = sl->next; -+ if (sl->state.frame[0]->regs[0].live & REG_LIVE_DONE) { -+ u32 br = sl->state.branches; -+ -+ WARN_ONCE(br, -+ "BUG live_done but branches_to_explore %d\n", -+ br); -+ free_verifier_state(&sl->state, false); -+ kfree(sl); -+ env->peak_states--; -+ } else { -+ /* cannot free this state, since parentage chain may -+ * walk it later. Add it for free_list instead to -+ * be freed at the end of verification -+ */ -+ sl->next = env->free_list; -+ env->free_list = sl; -+ } -+ sl = *pprev; -+ continue; -+ } -+next: -+ pprev = &sl->next; -+ sl = *pprev; -+ } -+ -+ if (env->max_states_per_insn < states_cnt) -+ env->max_states_per_insn = states_cnt; -+ -+ if (!env->allow_ptr_leaks && states_cnt > BPF_COMPLEXITY_LIMIT_STATES) -+ return push_jmp_history(env, cur); -+ -+ if (!add_new_state) -+ return push_jmp_history(env, cur); -+ -+ /* There were no equivalent states, remember the current one. -+ * Technically the current state is not proven to be safe yet, -+ * but it will either reach outer most bpf_exit (which means it's safe) -+ * or it will be rejected. When there are no loops the verifier won't be -+ * seeing this tuple (frame[0].callsite, frame[1].callsite, .. insn_idx) -+ * again on the way to bpf_exit. -+ * When looping the sl->state.branches will be > 0 and this state -+ * will not be considered for equivalence until branches == 0. - */ -- new_sl = kmalloc(sizeof(struct verifier_state_list), GFP_USER); -+ new_sl = kzalloc(sizeof(struct bpf_verifier_state_list), GFP_KERNEL); - if (!new_sl) - return -ENOMEM; -+ env->total_states++; -+ env->peak_states++; -+ env->prev_jmps_processed = env->jmps_processed; -+ env->prev_insn_processed = env->insn_processed; - - /* add new state to the head of linked list */ -- memcpy(&new_sl->state, &env->cur_state, sizeof(env->cur_state)); -- new_sl->next = env->explored_states[insn_idx]; -- env->explored_states[insn_idx] = new_sl; -+ new = &new_sl->state; -+ err = copy_verifier_state(new, cur); -+ if (err) { -+ free_verifier_state(new, false); -+ kfree(new_sl); -+ return err; -+ } -+ new->insn_idx = insn_idx; -+ WARN_ONCE(new->branches != 1, -+ "BUG is_state_visited:branches_to_explore=%d insn %d\n", new->branches, insn_idx); -+ -+ cur->parent = new; -+ cur->first_insn_idx = insn_idx; -+ clear_jmp_history(cur); -+ new_sl->next = *explored_state(env, insn_idx); -+ *explored_state(env, insn_idx) = new_sl; -+ /* connect new state to parentage chain. Current frame needs all -+ * registers connected. Only r6 - r9 of the callers are alive (pushed -+ * to the stack implicitly by JITs) so in callers' frames connect just -+ * r6 - r9 as an optimization. Callers will have r1 - r5 connected to -+ * the state of the call instruction (with WRITTEN set), and r0 comes -+ * from callee with its full parentage chain, anyway. -+ */ -+ /* clear write marks in current state: the writes we did are not writes -+ * our child did, so they don't screen off its reads from us. -+ * (There are no read marks in current state, because reads always mark -+ * their parent and current state never has children yet. Only -+ * explored_states can get read marks.) -+ */ -+ for (j = 0; j <= cur->curframe; j++) { -+ for (i = j < cur->curframe ? BPF_REG_6 : 0; i < BPF_REG_FP; i++) -+ cur->frame[j]->regs[i].parent = &new->frame[j]->regs[i]; -+ for (i = 0; i < BPF_REG_FP; i++) -+ cur->frame[j]->regs[i].live = REG_LIVE_NONE; -+ } -+ -+ /* all stack frames are accessible from callee, clear them all */ -+ for (j = 0; j <= cur->curframe; j++) { -+ struct bpf_func_state *frame = cur->frame[j]; -+ struct bpf_func_state *newframe = new->frame[j]; -+ -+ for (i = 0; i < frame->allocated_stack / BPF_REG_SIZE; i++) { -+ frame->stack[i].spilled_ptr.live = REG_LIVE_NONE; -+ frame->stack[i].spilled_ptr.parent = -+ &newframe->stack[i].spilled_ptr; -+ } -+ } - return 0; - } - --static int do_check(struct verifier_env *env) -+/* Return true if it's OK to have the same insn return a different type. */ -+static bool reg_type_mismatch_ok(enum bpf_reg_type type) - { -- struct verifier_state *state = &env->cur_state; -+ switch (type) { -+ case PTR_TO_CTX: -+ case PTR_TO_SOCKET: -+ case PTR_TO_SOCKET_OR_NULL: -+ case PTR_TO_SOCK_COMMON: -+ case PTR_TO_SOCK_COMMON_OR_NULL: -+ case PTR_TO_TCP_SOCK: -+ case PTR_TO_TCP_SOCK_OR_NULL: -+ case PTR_TO_XDP_SOCK: -+ return false; -+ default: -+ return true; -+ } -+} -+ -+/* If an instruction was previously used with particular pointer types, then we -+ * need to be careful to avoid cases such as the below, where it may be ok -+ * for one branch accessing the pointer, but not ok for the other branch: -+ * -+ * R1 = sock_ptr -+ * goto X; -+ * ... -+ * R1 = some_other_valid_ptr; -+ * goto X; -+ * ... -+ * R2 = *(u32 *)(R1 + 0); -+ */ -+static bool reg_type_mismatch(enum bpf_reg_type src, enum bpf_reg_type prev) -+{ -+ return src != prev && (!reg_type_mismatch_ok(src) || -+ !reg_type_mismatch_ok(prev)); -+} -+ -+static int do_check(struct bpf_verifier_env *env) -+{ -+ struct bpf_verifier_state *state; - struct bpf_insn *insns = env->prog->insnsi; -- struct reg_state *regs = state->regs; -+ struct bpf_reg_state *regs; - int insn_cnt = env->prog->len; -- int insn_idx, prev_insn_idx = 0; -- int insn_processed = 0; - bool do_print_state = false; -+ int prev_insn_idx = -1; -+ -+ env->prev_linfo = NULL; -+ -+ state = kzalloc(sizeof(struct bpf_verifier_state), GFP_KERNEL); -+ if (!state) -+ return -ENOMEM; -+ state->curframe = 0; -+ state->speculative = false; -+ state->branches = 1; -+ state->frame[0] = kzalloc(sizeof(struct bpf_func_state), GFP_KERNEL); -+ if (!state->frame[0]) { -+ kfree(state); -+ return -ENOMEM; -+ } -+ env->cur_state = state; -+ init_func_state(env, state->frame[0], -+ BPF_MAIN_FUNC /* callsite */, -+ 0 /* frameno */, -+ 0 /* subprogno, zero == main subprog */); - -- init_reg_state(regs); -- insn_idx = 0; - for (;;) { - struct bpf_insn *insn; - u8 class; - int err; - -- if (insn_idx >= insn_cnt) { -- verbose("invalid insn idx %d insn_cnt %d\n", -- insn_idx, insn_cnt); -+ env->prev_insn_idx = prev_insn_idx; -+ if (env->insn_idx >= insn_cnt) { -+ verbose(env, "invalid insn idx %d insn_cnt %d\n", -+ env->insn_idx, insn_cnt); - return -EFAULT; - } - -- insn = &insns[insn_idx]; -+ insn = &insns[env->insn_idx]; - class = BPF_CLASS(insn->code); - -- if (++insn_processed > 32768) { -- verbose("BPF program is too large. Proccessed %d insn\n", -- insn_processed); -+ if (++env->insn_processed > BPF_COMPLEXITY_LIMIT_INSNS) { -+ verbose(env, -+ "BPF program is too large. Processed %d insn\n", -+ env->insn_processed); - return -E2BIG; - } - -- err = is_state_visited(env, insn_idx); -+ err = is_state_visited(env, env->insn_idx); - if (err < 0) - return err; - if (err == 1) { - /* found equivalent state, can prune the search */ -- if (log_level) { -+ if (env->log.level & BPF_LOG_LEVEL) { - if (do_print_state) -- verbose("\nfrom %d to %d: safe\n", -- prev_insn_idx, insn_idx); -+ verbose(env, "\nfrom %d to %d%s: safe\n", -+ env->prev_insn_idx, env->insn_idx, -+ env->cur_state->speculative ? -+ " (speculative execution)" : ""); - else -- verbose("%d: safe\n", insn_idx); -+ verbose(env, "%d: safe\n", env->insn_idx); - } - goto process_bpf_exit; - } - -- if (log_level && do_print_state) { -- verbose("\nfrom %d to %d:", prev_insn_idx, insn_idx); -- print_verifier_state(env); -+ if (signal_pending(current)) -+ return -EAGAIN; -+ -+ if (need_resched()) -+ cond_resched(); -+ -+ if (env->log.level & BPF_LOG_LEVEL2 || -+ (env->log.level & BPF_LOG_LEVEL && do_print_state)) { -+ if (env->log.level & BPF_LOG_LEVEL2) -+ verbose(env, "%d:", env->insn_idx); -+ else -+ verbose(env, "\nfrom %d to %d%s:", -+ env->prev_insn_idx, env->insn_idx, -+ env->cur_state->speculative ? -+ " (speculative execution)" : ""); -+ print_verifier_state(env, state->frame[state->curframe]); - do_print_state = false; - } - -- if (log_level) { -- verbose("%d: ", insn_idx); -- print_bpf_insn(env, insn); -+ if (env->log.level & BPF_LOG_LEVEL) { -+ const struct bpf_insn_cbs cbs = { -+ .cb_print = verbose, -+ .private_data = env, -+ }; -+ -+ verbose_linfo(env, env->insn_idx, "; "); -+ verbose(env, "%d: ", env->insn_idx); -+ print_bpf_insn(&cbs, insn, env->allow_ptr_leaks); - } - -+ regs = cur_regs(env); -+ sanitize_mark_insn_seen(env); -+ prev_insn_idx = env->insn_idx; -+ - if (class == BPF_ALU || class == BPF_ALU64) { - err = check_alu_op(env, insn); - if (err) - return err; - - } else if (class == BPF_LDX) { -- enum bpf_reg_type src_reg_type; -+ enum bpf_reg_type *prev_src_type, src_reg_type; - - /* check for reserved fields is already done */ - - /* check src operand */ -- err = check_reg_arg(regs, insn->src_reg, SRC_OP); -+ err = check_reg_arg(env, insn->src_reg, SRC_OP); - if (err) - return err; - -- err = check_reg_arg(regs, insn->dst_reg, DST_OP_NO_MARK); -+ err = check_reg_arg(env, insn->dst_reg, DST_OP_NO_MARK); - if (err) - return err; - -@@ -1796,27 +7850,22 @@ static int do_check(struct verifier_env - /* check that memory (src_reg + off) is readable, - * the state of dst_reg will be updated by this func - */ -- err = check_mem_access(env, insn->src_reg, insn->off, -- BPF_SIZE(insn->code), BPF_READ, -- insn->dst_reg); -+ err = check_mem_access(env, env->insn_idx, insn->src_reg, -+ insn->off, BPF_SIZE(insn->code), -+ BPF_READ, insn->dst_reg, false); - if (err) - return err; - -- if (BPF_SIZE(insn->code) != BPF_W) { -- insn_idx++; -- continue; -- } -+ prev_src_type = &env->insn_aux_data[env->insn_idx].ptr_type; - -- if (insn->imm == 0) { -+ if (*prev_src_type == NOT_INIT) { - /* saw a valid insn - * dst_reg = *(u32 *)(src_reg + off) -- * use reserved 'imm' field to mark this insn -+ * save type to validate intersecting paths - */ -- insn->imm = src_reg_type; -+ *prev_src_type = src_reg_type; - -- } else if (src_reg_type != insn->imm && -- (src_reg_type == PTR_TO_CTX || -- insn->imm == PTR_TO_CTX)) { -+ } else if (reg_type_mismatch(src_reg_type, *prev_src_type)) { - /* ABuser program is trying to use the same insn - * dst_reg = *(u32*) (src_reg + off) - * with different pointer types: -@@ -1824,79 +7873,98 @@ static int do_check(struct verifier_env - * src_reg == stack|map in some other branch. - * Reject it. - */ -- verbose("same insn cannot be used with different pointers\n"); -+ verbose(env, "same insn cannot be used with different pointers\n"); - return -EINVAL; - } - - } else if (class == BPF_STX) { -- enum bpf_reg_type dst_reg_type; -+ enum bpf_reg_type *prev_dst_type, dst_reg_type; - - if (BPF_MODE(insn->code) == BPF_XADD) { -- err = check_xadd(env, insn); -+ err = check_xadd(env, env->insn_idx, insn); - if (err) - return err; -- insn_idx++; -+ env->insn_idx++; - continue; - } - - /* check src1 operand */ -- err = check_reg_arg(regs, insn->src_reg, SRC_OP); -+ err = check_reg_arg(env, insn->src_reg, SRC_OP); - if (err) - return err; - /* check src2 operand */ -- err = check_reg_arg(regs, insn->dst_reg, SRC_OP); -+ err = check_reg_arg(env, insn->dst_reg, SRC_OP); - if (err) - return err; - - dst_reg_type = regs[insn->dst_reg].type; - - /* check that memory (dst_reg + off) is writeable */ -- err = check_mem_access(env, insn->dst_reg, insn->off, -- BPF_SIZE(insn->code), BPF_WRITE, -- insn->src_reg); -+ err = check_mem_access(env, env->insn_idx, insn->dst_reg, -+ insn->off, BPF_SIZE(insn->code), -+ BPF_WRITE, insn->src_reg, false); - if (err) - return err; - -- if (insn->imm == 0) { -- insn->imm = dst_reg_type; -- } else if (dst_reg_type != insn->imm && -- (dst_reg_type == PTR_TO_CTX || -- insn->imm == PTR_TO_CTX)) { -- verbose("same insn cannot be used with different pointers\n"); -+ prev_dst_type = &env->insn_aux_data[env->insn_idx].ptr_type; -+ -+ if (*prev_dst_type == NOT_INIT) { -+ *prev_dst_type = dst_reg_type; -+ } else if (reg_type_mismatch(dst_reg_type, *prev_dst_type)) { -+ verbose(env, "same insn cannot be used with different pointers\n"); - return -EINVAL; - } - - } else if (class == BPF_ST) { - if (BPF_MODE(insn->code) != BPF_MEM || - insn->src_reg != BPF_REG_0) { -- verbose("BPF_ST uses reserved fields\n"); -+ verbose(env, "BPF_ST uses reserved fields\n"); - return -EINVAL; - } - /* check src operand */ -- err = check_reg_arg(regs, insn->dst_reg, SRC_OP); -+ err = check_reg_arg(env, insn->dst_reg, SRC_OP); - if (err) - return err; - -+ if (is_ctx_reg(env, insn->dst_reg)) { -+ verbose(env, "BPF_ST stores into R%d %s is not allowed\n", -+ insn->dst_reg, -+ reg_type_str[reg_state(env, insn->dst_reg)->type]); -+ return -EACCES; -+ } -+ - /* check that memory (dst_reg + off) is writeable */ -- err = check_mem_access(env, insn->dst_reg, insn->off, -- BPF_SIZE(insn->code), BPF_WRITE, -- -1); -+ err = check_mem_access(env, env->insn_idx, insn->dst_reg, -+ insn->off, BPF_SIZE(insn->code), -+ BPF_WRITE, -1, false); - if (err) - return err; - -- } else if (class == BPF_JMP) { -+ } else if (class == BPF_JMP || class == BPF_JMP32) { - u8 opcode = BPF_OP(insn->code); - -+ env->jmps_processed++; - if (opcode == BPF_CALL) { - if (BPF_SRC(insn->code) != BPF_K || - insn->off != 0 || -- insn->src_reg != BPF_REG_0 || -- insn->dst_reg != BPF_REG_0) { -- verbose("BPF_CALL uses reserved fields\n"); -+ (insn->src_reg != BPF_REG_0 && -+ insn->src_reg != BPF_PSEUDO_CALL) || -+ insn->dst_reg != BPF_REG_0 || -+ class == BPF_JMP32) { -+ verbose(env, "BPF_CALL uses reserved fields\n"); - return -EINVAL; - } - -- err = check_call(env, insn->imm); -+ if (env->cur_state->active_spin_lock && -+ (insn->src_reg == BPF_PSEUDO_CALL || -+ insn->imm != BPF_FUNC_spin_unlock)) { -+ verbose(env, "function calls are not allowed while holding a lock\n"); -+ return -EINVAL; -+ } -+ if (insn->src_reg == BPF_PSEUDO_CALL) -+ err = check_func_call(env, insn, &env->insn_idx); -+ else -+ err = check_helper_call(env, insn->imm, env->insn_idx); - if (err) - return err; - -@@ -1904,48 +7972,75 @@ static int do_check(struct verifier_env - if (BPF_SRC(insn->code) != BPF_K || - insn->imm != 0 || - insn->src_reg != BPF_REG_0 || -- insn->dst_reg != BPF_REG_0) { -- verbose("BPF_JA uses reserved fields\n"); -+ insn->dst_reg != BPF_REG_0 || -+ class == BPF_JMP32) { -+ verbose(env, "BPF_JA uses reserved fields\n"); - return -EINVAL; - } - -- insn_idx += insn->off + 1; -+ env->insn_idx += insn->off + 1; - continue; - - } else if (opcode == BPF_EXIT) { - if (BPF_SRC(insn->code) != BPF_K || - insn->imm != 0 || - insn->src_reg != BPF_REG_0 || -- insn->dst_reg != BPF_REG_0) { -- verbose("BPF_EXIT uses reserved fields\n"); -+ insn->dst_reg != BPF_REG_0 || -+ class == BPF_JMP32) { -+ verbose(env, "BPF_EXIT uses reserved fields\n"); - return -EINVAL; - } - -+ if (env->cur_state->active_spin_lock) { -+ verbose(env, "bpf_spin_unlock is missing\n"); -+ return -EINVAL; -+ } -+ -+ if (state->curframe) { -+ /* exit from nested function */ -+ err = prepare_func_exit(env, &env->insn_idx); -+ if (err) -+ return err; -+ do_print_state = true; -+ continue; -+ } -+ -+ err = check_reference_leak(env); -+ if (err) -+ return err; -+ - /* eBPF calling convetion is such that R0 is used - * to return the value from eBPF program. - * Make sure that it's readable at this time - * of bpf_exit, which means that program wrote - * something into it earlier - */ -- err = check_reg_arg(regs, BPF_REG_0, SRC_OP); -+ err = check_reg_arg(env, BPF_REG_0, SRC_OP); - if (err) - return err; - - if (is_pointer_value(env, BPF_REG_0)) { -- verbose("R0 leaks addr as return value\n"); -+ verbose(env, "R0 leaks addr as return value\n"); - return -EACCES; - } - -+ err = check_return_code(env); -+ if (err) -+ return err; - process_bpf_exit: -- insn_idx = pop_stack(env, &prev_insn_idx); -- if (insn_idx < 0) { -+ update_branch_counts(env, env->cur_state); -+ err = pop_stack(env, &prev_insn_idx, -+ &env->insn_idx); -+ if (err < 0) { -+ if (err != -ENOENT) -+ return err; - break; - } else { - do_print_state = true; - continue; - } - } else { -- err = check_cond_jmp_op(env, insn, &insn_idx); -+ err = check_cond_jmp_op(env, insn, &env->insn_idx); - if (err) - return err; - } -@@ -1962,83 +8057,194 @@ process_bpf_exit: - if (err) - return err; - -- insn_idx++; -+ env->insn_idx++; -+ sanitize_mark_insn_seen(env); - } else { -- verbose("invalid BPF_LD mode\n"); -+ verbose(env, "invalid BPF_LD mode\n"); - return -EINVAL; - } - } else { -- verbose("unknown insn class %d\n", class); -+ verbose(env, "unknown insn class %d\n", class); - return -EINVAL; - } - -- insn_idx++; -+ env->insn_idx++; - } - -+ env->prog->aux->stack_depth = env->subprog_info[0].stack_depth; - return 0; - } - -+static int check_map_prealloc(struct bpf_map *map) -+{ -+ return (map->map_type != BPF_MAP_TYPE_HASH && -+ map->map_type != BPF_MAP_TYPE_PERCPU_HASH && -+ map->map_type != BPF_MAP_TYPE_HASH_OF_MAPS) || -+ !(map->map_flags & BPF_F_NO_PREALLOC); -+} -+ -+static bool is_tracing_prog_type(enum bpf_prog_type type) -+{ -+ switch (type) { -+ case BPF_PROG_TYPE_KPROBE: -+ case BPF_PROG_TYPE_TRACEPOINT: -+ case BPF_PROG_TYPE_PERF_EVENT: -+ case BPF_PROG_TYPE_RAW_TRACEPOINT: -+ return true; -+ default: -+ return false; -+ } -+} -+ -+static int check_map_prog_compatibility(struct bpf_verifier_env *env, -+ struct bpf_map *map, -+ struct bpf_prog *prog) -+ -+{ -+ /* Make sure that BPF_PROG_TYPE_PERF_EVENT programs only use -+ * preallocated hash maps, since doing memory allocation -+ * in overflow_handler can crash depending on where nmi got -+ * triggered. -+ */ -+ if (prog->type == BPF_PROG_TYPE_PERF_EVENT) { -+ if (!check_map_prealloc(map)) { -+ verbose(env, "perf_event programs can only use preallocated hash map\n"); -+ return -EINVAL; -+ } -+ if (map->inner_map_meta && -+ !check_map_prealloc(map->inner_map_meta)) { -+ verbose(env, "perf_event programs can only use preallocated inner hash map\n"); -+ return -EINVAL; -+ } -+ } -+ -+ if ((is_tracing_prog_type(prog->type) || -+ prog->type == BPF_PROG_TYPE_SOCKET_FILTER) && -+ map_value_has_spin_lock(map)) { -+ verbose(env, "tracing progs cannot use bpf_spin_lock yet\n"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static bool bpf_map_is_cgroup_storage(struct bpf_map *map) -+{ -+ return (map->map_type == BPF_MAP_TYPE_CGROUP_STORAGE || -+ map->map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE); -+} -+ - /* look for pseudo eBPF instructions that access map FDs and - * replace them with actual map pointers - */ --static int replace_map_fd_with_map_ptr(struct verifier_env *env) -+static int replace_map_fd_with_map_ptr(struct bpf_verifier_env *env) - { - struct bpf_insn *insn = env->prog->insnsi; - int insn_cnt = env->prog->len; -- int i, j; -+ int i, j, err; -+ -+ err = bpf_prog_calc_tag(env->prog); -+ if (err) -+ return err; - - for (i = 0; i < insn_cnt; i++, insn++) { - if (BPF_CLASS(insn->code) == BPF_LDX && - (BPF_MODE(insn->code) != BPF_MEM || insn->imm != 0)) { -- verbose("BPF_LDX uses reserved fields\n"); -+ verbose(env, "BPF_LDX uses reserved fields\n"); - return -EINVAL; - } - - if (BPF_CLASS(insn->code) == BPF_STX && - ((BPF_MODE(insn->code) != BPF_MEM && - BPF_MODE(insn->code) != BPF_XADD) || insn->imm != 0)) { -- verbose("BPF_STX uses reserved fields\n"); -+ verbose(env, "BPF_STX uses reserved fields\n"); - return -EINVAL; - } - - if (insn[0].code == (BPF_LD | BPF_IMM | BPF_DW)) { -+ struct bpf_insn_aux_data *aux; - struct bpf_map *map; - struct fd f; -+ u64 addr; - - if (i == insn_cnt - 1 || insn[1].code != 0 || - insn[1].dst_reg != 0 || insn[1].src_reg != 0 || - insn[1].off != 0) { -- verbose("invalid bpf_ld_imm64 insn\n"); -+ verbose(env, "invalid bpf_ld_imm64 insn\n"); - return -EINVAL; - } - -- if (insn->src_reg == 0) -+ if (insn[0].src_reg == 0) - /* valid generic load 64-bit imm */ - goto next_insn; - -- if (insn->src_reg != BPF_PSEUDO_MAP_FD) { -- verbose("unrecognized bpf_ld_imm64 insn\n"); -+ /* In final convert_pseudo_ld_imm64() step, this is -+ * converted into regular 64-bit imm load insn. -+ */ -+ if ((insn[0].src_reg != BPF_PSEUDO_MAP_FD && -+ insn[0].src_reg != BPF_PSEUDO_MAP_VALUE) || -+ (insn[0].src_reg == BPF_PSEUDO_MAP_FD && -+ insn[1].imm != 0)) { -+ verbose(env, -+ "unrecognized bpf_ld_imm64 insn\n"); - return -EINVAL; - } - -- f = fdget(insn->imm); -+ f = fdget(insn[0].imm); - map = __bpf_map_get(f); - if (IS_ERR(map)) { -- verbose("fd %d is not pointing to valid bpf_map\n", -- insn->imm); -+ verbose(env, "fd %d is not pointing to valid bpf_map\n", -+ insn[0].imm); - return PTR_ERR(map); - } - -- /* store map pointer inside BPF_LD_IMM64 instruction */ -- insn[0].imm = (u32) (unsigned long) map; -- insn[1].imm = ((u64) (unsigned long) map) >> 32; -+ err = check_map_prog_compatibility(env, map, env->prog); -+ if (err) { -+ fdput(f); -+ return err; -+ } -+ -+ aux = &env->insn_aux_data[i]; -+ if (insn->src_reg == BPF_PSEUDO_MAP_FD) { -+ addr = (unsigned long)map; -+ } else { -+ u32 off = insn[1].imm; -+ -+ if (off >= BPF_MAX_VAR_OFF) { -+ verbose(env, "direct value offset of %u is not allowed\n", off); -+ fdput(f); -+ return -EINVAL; -+ } -+ -+ if (!map->ops->map_direct_value_addr) { -+ verbose(env, "no direct value access support for this map type\n"); -+ fdput(f); -+ return -EINVAL; -+ } -+ -+ err = map->ops->map_direct_value_addr(map, &addr, off); -+ if (err) { -+ verbose(env, "invalid access to map value pointer, value_size=%u off=%u\n", -+ map->value_size, off); -+ fdput(f); -+ return err; -+ } -+ -+ aux->map_off = off; -+ addr += off; -+ } -+ -+ insn[0].imm = (u32)addr; -+ insn[1].imm = addr >> 32; - - /* check whether we recorded this map already */ -- for (j = 0; j < env->used_map_cnt; j++) -+ for (j = 0; j < env->used_map_cnt; j++) { - if (env->used_maps[j] == map) { -+ aux->map_index = j; - fdput(f); - goto next_insn; - } -+ } - - if (env->used_map_cnt >= MAX_USED_MAPS) { - fdput(f); -@@ -2048,19 +8254,31 @@ static int replace_map_fd_with_map_ptr(s - /* hold the map. If the program is rejected by verifier, - * the map will be released by release_maps() or it - * will be used by the valid program until it's unloaded -- * and all maps are released in free_bpf_prog_info() -+ * and all maps are released in free_used_maps() - */ - map = bpf_map_inc(map, false); - if (IS_ERR(map)) { - fdput(f); - return PTR_ERR(map); - } -+ -+ aux->map_index = env->used_map_cnt; - env->used_maps[env->used_map_cnt++] = map; - -+ if (bpf_map_is_cgroup_storage(map)) -+ return -EINVAL; -+ - fdput(f); - next_insn: - insn++; - i++; -+ continue; -+ } -+ -+ /* Basic sanity check before we invest more work here. */ -+ if (!bpf_opcode_in_insntable(insn->code)) { -+ verbose(env, "unknown opcode %02x\n", insn->code); -+ return -EINVAL; - } - } - -@@ -2072,7 +8290,7 @@ next_insn: - } - - /* drop refcnt of maps used by the rejected program */ --static void release_maps(struct verifier_env *env) -+static void release_maps(struct bpf_verifier_env *env) - { - int i; - -@@ -2081,7 +8299,7 @@ static void release_maps(struct verifier - } - - /* convert pseudo BPF_LD_IMM64 into generic BPF_LD_IMM64 */ --static void convert_pseudo_ld_imm64(struct verifier_env *env) -+static void convert_pseudo_ld_imm64(struct bpf_verifier_env *env) - { - struct bpf_insn *insn = env->prog->insnsi; - int insn_cnt = env->prog->len; -@@ -2092,201 +8310,1266 @@ static void convert_pseudo_ld_imm64(stru - insn->src_reg = 0; - } - --static void adjust_branches(struct bpf_prog *prog, int pos, int delta) -+/* single env->prog->insni[off] instruction was replaced with the range -+ * insni[off, off + cnt). Adjust corresponding insn_aux_data by copying -+ * [0, off) and [off, end) to new locations, so the patched range stays zero -+ */ -+static int adjust_insn_aux_data(struct bpf_verifier_env *env, -+ struct bpf_prog *new_prog, u32 off, u32 cnt) - { -- struct bpf_insn *insn = prog->insnsi; -- int insn_cnt = prog->len; -+ struct bpf_insn_aux_data *new_data, *old_data = env->insn_aux_data; -+ struct bpf_insn *insn = new_prog->insnsi; -+ bool old_seen = old_data[off].seen; -+ u32 prog_len; - int i; - -- for (i = 0; i < insn_cnt; i++, insn++) { -- if (BPF_CLASS(insn->code) != BPF_JMP || -- BPF_OP(insn->code) == BPF_CALL || -- BPF_OP(insn->code) == BPF_EXIT) -+ /* aux info at OFF always needs adjustment, no matter fast path -+ * (cnt == 1) is taken or not. There is no guarantee INSN at OFF is the -+ * original insn at old prog. -+ */ -+ old_data[off].zext_dst = insn_has_def32(env, insn + off + cnt - 1); -+ -+ if (cnt == 1) -+ return 0; -+ prog_len = new_prog->len; -+ new_data = vzalloc(array_size(prog_len, -+ sizeof(struct bpf_insn_aux_data))); -+ if (!new_data) -+ return -ENOMEM; -+ memcpy(new_data, old_data, sizeof(struct bpf_insn_aux_data) * off); -+ memcpy(new_data + off + cnt - 1, old_data + off, -+ sizeof(struct bpf_insn_aux_data) * (prog_len - off - cnt + 1)); -+ for (i = off; i < off + cnt - 1; i++) { -+ /* Expand insni[off]'s seen count to the patched range. */ -+ new_data[i].seen = old_seen; -+ new_data[i].zext_dst = insn_has_def32(env, insn + i); -+ } -+ env->insn_aux_data = new_data; -+ vfree(old_data); -+ return 0; -+} -+ -+static void adjust_subprog_starts(struct bpf_verifier_env *env, u32 off, u32 len) -+{ -+ int i; -+ -+ if (len == 1) -+ return; -+ /* NOTE: fake 'exit' subprog should be updated as well. */ -+ for (i = 0; i <= env->subprog_cnt; i++) { -+ if (env->subprog_info[i].start <= off) - continue; -+ env->subprog_info[i].start += len - 1; -+ } -+} -+ -+static struct bpf_prog *bpf_patch_insn_data(struct bpf_verifier_env *env, u32 off, -+ const struct bpf_insn *patch, u32 len) -+{ -+ struct bpf_prog *new_prog; -+ -+ new_prog = bpf_patch_insn_single(env->prog, off, patch, len); -+ if (IS_ERR(new_prog)) { -+ if (PTR_ERR(new_prog) == -ERANGE) -+ verbose(env, -+ "insn %d cannot be patched due to 16-bit range\n", -+ env->insn_aux_data[off].orig_idx); -+ return NULL; -+ } -+ if (adjust_insn_aux_data(env, new_prog, off, len)) -+ return NULL; -+ adjust_subprog_starts(env, off, len); -+ return new_prog; -+} - -- /* adjust offset of jmps if necessary */ -- if (i < pos && i + insn->off + 1 > pos) -- insn->off += delta; -- else if (i > pos + delta && i + insn->off + 1 <= pos + delta) -- insn->off -= delta; -+static int adjust_subprog_starts_after_remove(struct bpf_verifier_env *env, -+ u32 off, u32 cnt) -+{ -+ int i, j; -+ -+ /* find first prog starting at or after off (first to remove) */ -+ for (i = 0; i < env->subprog_cnt; i++) -+ if (env->subprog_info[i].start >= off) -+ break; -+ /* find first prog starting at or after off + cnt (first to stay) */ -+ for (j = i; j < env->subprog_cnt; j++) -+ if (env->subprog_info[j].start >= off + cnt) -+ break; -+ /* if j doesn't start exactly at off + cnt, we are just removing -+ * the front of previous prog -+ */ -+ if (env->subprog_info[j].start != off + cnt) -+ j--; -+ -+ if (j > i) { -+ struct bpf_prog_aux *aux = env->prog->aux; -+ int move; -+ -+ /* move fake 'exit' subprog as well */ -+ move = env->subprog_cnt + 1 - j; -+ -+ memmove(env->subprog_info + i, -+ env->subprog_info + j, -+ sizeof(*env->subprog_info) * move); -+ env->subprog_cnt -= j - i; -+ -+ /* remove func_info */ -+ if (aux->func_info) { -+ move = aux->func_info_cnt - j; -+ -+ memmove(aux->func_info + i, -+ aux->func_info + j, -+ sizeof(*aux->func_info) * move); -+ aux->func_info_cnt -= j - i; -+ /* func_info->insn_off is set after all code rewrites, -+ * in adjust_btf_func() - no need to adjust -+ */ -+ } -+ } else { -+ /* convert i from "first prog to remove" to "first to adjust" */ -+ if (env->subprog_info[i].start == off) -+ i++; - } -+ -+ /* update fake 'exit' subprog as well */ -+ for (; i <= env->subprog_cnt; i++) -+ env->subprog_info[i].start -= cnt; -+ -+ return 0; -+} -+ -+static int bpf_adj_linfo_after_remove(struct bpf_verifier_env *env, u32 off, -+ u32 cnt) -+{ -+ struct bpf_prog *prog = env->prog; -+ u32 i, l_off, l_cnt, nr_linfo; -+ struct bpf_line_info *linfo; -+ -+ nr_linfo = prog->aux->nr_linfo; -+ if (!nr_linfo) -+ return 0; -+ -+ linfo = prog->aux->linfo; -+ -+ /* find first line info to remove, count lines to be removed */ -+ for (i = 0; i < nr_linfo; i++) -+ if (linfo[i].insn_off >= off) -+ break; -+ -+ l_off = i; -+ l_cnt = 0; -+ for (; i < nr_linfo; i++) -+ if (linfo[i].insn_off < off + cnt) -+ l_cnt++; -+ else -+ break; -+ -+ /* First live insn doesn't match first live linfo, it needs to "inherit" -+ * last removed linfo. prog is already modified, so prog->len == off -+ * means no live instructions after (tail of the program was removed). -+ */ -+ if (prog->len != off && l_cnt && -+ (i == nr_linfo || linfo[i].insn_off != off + cnt)) { -+ l_cnt--; -+ linfo[--i].insn_off = off + cnt; -+ } -+ -+ /* remove the line info which refer to the removed instructions */ -+ if (l_cnt) { -+ memmove(linfo + l_off, linfo + i, -+ sizeof(*linfo) * (nr_linfo - i)); -+ -+ prog->aux->nr_linfo -= l_cnt; -+ nr_linfo = prog->aux->nr_linfo; -+ } -+ -+ /* pull all linfo[i].insn_off >= off + cnt in by cnt */ -+ for (i = l_off; i < nr_linfo; i++) -+ linfo[i].insn_off -= cnt; -+ -+ /* fix up all subprogs (incl. 'exit') which start >= off */ -+ for (i = 0; i <= env->subprog_cnt; i++) -+ if (env->subprog_info[i].linfo_idx > l_off) { -+ /* program may have started in the removed region but -+ * may not be fully removed -+ */ -+ if (env->subprog_info[i].linfo_idx >= l_off + l_cnt) -+ env->subprog_info[i].linfo_idx -= l_cnt; -+ else -+ env->subprog_info[i].linfo_idx = l_off; -+ } -+ -+ return 0; -+} -+ -+static int verifier_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt) -+{ -+ struct bpf_insn_aux_data *aux_data = env->insn_aux_data; -+ unsigned int orig_prog_len = env->prog->len; -+ int err; -+ -+ err = bpf_remove_insns(env->prog, off, cnt); -+ if (err) -+ return err; -+ -+ err = adjust_subprog_starts_after_remove(env, off, cnt); -+ if (err) -+ return err; -+ -+ err = bpf_adj_linfo_after_remove(env, off, cnt); -+ if (err) -+ return err; -+ -+ memmove(aux_data + off, aux_data + off + cnt, -+ sizeof(*aux_data) * (orig_prog_len - off - cnt)); -+ -+ return 0; - } - --/* convert load instructions that access fields of 'struct __sk_buff' -- * into sequence of instructions that access fields of 'struct sk_buff' -+/* The verifier does more data flow analysis than llvm and will not -+ * explore branches that are dead at run time. Malicious programs can -+ * have dead code too. Therefore replace all dead at-run-time code -+ * with 'ja -1'. -+ * -+ * Just nops are not optimal, e.g. if they would sit at the end of the -+ * program and through another bug we would manage to jump there, then -+ * we'd execute beyond program memory otherwise. Returning exception -+ * code also wouldn't work since we can have subprogs where the dead -+ * code could be located. - */ --static int convert_ctx_accesses(struct verifier_env *env) -+static void sanitize_dead_code(struct bpf_verifier_env *env) - { -+ struct bpf_insn_aux_data *aux_data = env->insn_aux_data; -+ struct bpf_insn trap = BPF_JMP_IMM(BPF_JA, 0, 0, -1); - struct bpf_insn *insn = env->prog->insnsi; -+ const int insn_cnt = env->prog->len; -+ int i; -+ -+ for (i = 0; i < insn_cnt; i++) { -+ if (aux_data[i].seen) -+ continue; -+ memcpy(insn + i, &trap, sizeof(trap)); -+ } -+} -+ -+static bool insn_is_cond_jump(u8 code) -+{ -+ u8 op; -+ -+ if (BPF_CLASS(code) == BPF_JMP32) -+ return true; -+ -+ if (BPF_CLASS(code) != BPF_JMP) -+ return false; -+ -+ op = BPF_OP(code); -+ return op != BPF_JA && op != BPF_EXIT && op != BPF_CALL; -+} -+ -+static void opt_hard_wire_dead_code_branches(struct bpf_verifier_env *env) -+{ -+ struct bpf_insn_aux_data *aux_data = env->insn_aux_data; -+ struct bpf_insn ja = BPF_JMP_IMM(BPF_JA, 0, 0, 0); -+ struct bpf_insn *insn = env->prog->insnsi; -+ const int insn_cnt = env->prog->len; -+ int i; -+ -+ for (i = 0; i < insn_cnt; i++, insn++) { -+ if (!insn_is_cond_jump(insn->code)) -+ continue; -+ -+ if (!aux_data[i + 1].seen) -+ ja.off = insn->off; -+ else if (!aux_data[i + 1 + insn->off].seen) -+ ja.off = 0; -+ else -+ continue; -+ -+ memcpy(insn, &ja, sizeof(ja)); -+ } -+} -+ -+static int opt_remove_dead_code(struct bpf_verifier_env *env) -+{ -+ struct bpf_insn_aux_data *aux_data = env->insn_aux_data; - int insn_cnt = env->prog->len; -- struct bpf_insn insn_buf[16]; -+ int i, err; -+ -+ for (i = 0; i < insn_cnt; i++) { -+ int j; -+ -+ j = 0; -+ while (i + j < insn_cnt && !aux_data[i + j].seen) -+ j++; -+ if (!j) -+ continue; -+ -+ err = verifier_remove_insns(env, i, j); -+ if (err) -+ return err; -+ insn_cnt = env->prog->len; -+ } -+ -+ return 0; -+} -+ -+static int opt_remove_nops(struct bpf_verifier_env *env) -+{ -+ const struct bpf_insn ja = BPF_JMP_IMM(BPF_JA, 0, 0, 0); -+ struct bpf_insn *insn = env->prog->insnsi; -+ int insn_cnt = env->prog->len; -+ int i, err; -+ -+ for (i = 0; i < insn_cnt; i++) { -+ if (memcmp(&insn[i], &ja, sizeof(ja))) -+ continue; -+ -+ err = verifier_remove_insns(env, i, 1); -+ if (err) -+ return err; -+ insn_cnt--; -+ i--; -+ } -+ -+ return 0; -+} -+ -+static int opt_subreg_zext_lo32_rnd_hi32(struct bpf_verifier_env *env, -+ const union bpf_attr *attr) -+{ -+ struct bpf_insn *patch, zext_patch[2], rnd_hi32_patch[4]; -+ struct bpf_insn_aux_data *aux = env->insn_aux_data; -+ int i, patch_len, delta = 0, len = env->prog->len; -+ struct bpf_insn *insns = env->prog->insnsi; -+ struct bpf_prog *new_prog; -+ bool rnd_hi32; -+ -+ rnd_hi32 = attr->prog_flags & BPF_F_TEST_RND_HI32; -+ zext_patch[1] = BPF_ZEXT_REG(0); -+ rnd_hi32_patch[1] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_AX, 0); -+ rnd_hi32_patch[2] = BPF_ALU64_IMM(BPF_LSH, BPF_REG_AX, 32); -+ rnd_hi32_patch[3] = BPF_ALU64_REG(BPF_OR, 0, BPF_REG_AX); -+ for (i = 0; i < len; i++) { -+ int adj_idx = i + delta; -+ struct bpf_insn insn; -+ -+ insn = insns[adj_idx]; -+ if (!aux[adj_idx].zext_dst) { -+ u8 code, class; -+ u32 imm_rnd; -+ -+ if (!rnd_hi32) -+ continue; -+ -+ code = insn.code; -+ class = BPF_CLASS(code); -+ if (insn_no_def(&insn)) -+ continue; -+ -+ /* NOTE: arg "reg" (the fourth one) is only used for -+ * BPF_STX which has been ruled out in above -+ * check, it is safe to pass NULL here. -+ */ -+ if (is_reg64(env, &insn, insn.dst_reg, NULL, DST_OP)) { -+ if (class == BPF_LD && -+ BPF_MODE(code) == BPF_IMM) -+ i++; -+ continue; -+ } -+ -+ /* ctx load could be transformed into wider load. */ -+ if (class == BPF_LDX && -+ aux[adj_idx].ptr_type == PTR_TO_CTX) -+ continue; -+ -+ imm_rnd = get_random_int(); -+ rnd_hi32_patch[0] = insn; -+ rnd_hi32_patch[1].imm = imm_rnd; -+ rnd_hi32_patch[3].dst_reg = insn.dst_reg; -+ patch = rnd_hi32_patch; -+ patch_len = 4; -+ goto apply_patch_buffer; -+ } -+ -+ if (!bpf_jit_needs_zext()) -+ continue; -+ -+ zext_patch[0] = insn; -+ zext_patch[1].dst_reg = insn.dst_reg; -+ zext_patch[1].src_reg = insn.dst_reg; -+ patch = zext_patch; -+ patch_len = 2; -+apply_patch_buffer: -+ new_prog = bpf_patch_insn_data(env, adj_idx, patch, patch_len); -+ if (!new_prog) -+ return -ENOMEM; -+ env->prog = new_prog; -+ insns = new_prog->insnsi; -+ aux = env->insn_aux_data; -+ delta += patch_len - 1; -+ } -+ -+ return 0; -+} -+ -+/* convert load instructions that access fields of a context type into a -+ * sequence of instructions that access fields of the underlying structure: -+ * struct __sk_buff -> struct sk_buff -+ * struct bpf_sock_ops -> struct sock -+ */ -+static int convert_ctx_accesses(struct bpf_verifier_env *env) -+{ -+ const struct bpf_verifier_ops *ops = env->ops; -+ int i, cnt, size, ctx_field_size, delta = 0; -+ const int insn_cnt = env->prog->len; -+ struct bpf_insn insn_buf[16], *insn; -+ u32 target_size, size_default, off; - struct bpf_prog *new_prog; -- u32 cnt; -- int i; - enum bpf_access_type type; -+ bool is_narrower_load; -+ -+ if (ops->gen_prologue || env->seen_direct_write) { -+ if (!ops->gen_prologue) { -+ verbose(env, "bpf verifier is misconfigured\n"); -+ return -EINVAL; -+ } -+ cnt = ops->gen_prologue(insn_buf, env->seen_direct_write, -+ env->prog); -+ if (cnt >= ARRAY_SIZE(insn_buf)) { -+ verbose(env, "bpf verifier is misconfigured\n"); -+ return -EINVAL; -+ } else if (cnt) { -+ new_prog = bpf_patch_insn_data(env, 0, insn_buf, cnt); -+ if (!new_prog) -+ return -ENOMEM; -+ -+ env->prog = new_prog; -+ delta += cnt - 1; -+ } -+ } - -- if (!env->prog->aux->ops->convert_ctx_access) -+ if (bpf_prog_is_dev_bound(env->prog->aux)) - return 0; - -+ insn = env->prog->insnsi + delta; -+ - for (i = 0; i < insn_cnt; i++, insn++) { -- if (insn->code == (BPF_LDX | BPF_MEM | BPF_W)) -+ bpf_convert_ctx_access_t convert_ctx_access; -+ -+ if (insn->code == (BPF_LDX | BPF_MEM | BPF_B) || -+ insn->code == (BPF_LDX | BPF_MEM | BPF_H) || -+ insn->code == (BPF_LDX | BPF_MEM | BPF_W) || -+ insn->code == (BPF_LDX | BPF_MEM | BPF_DW)) - type = BPF_READ; -- else if (insn->code == (BPF_STX | BPF_MEM | BPF_W)) -+ else if (insn->code == (BPF_STX | BPF_MEM | BPF_B) || -+ insn->code == (BPF_STX | BPF_MEM | BPF_H) || -+ insn->code == (BPF_STX | BPF_MEM | BPF_W) || -+ insn->code == (BPF_STX | BPF_MEM | BPF_DW)) - type = BPF_WRITE; - else - continue; - -- if (insn->imm != PTR_TO_CTX) { -- /* clear internal mark */ -- insn->imm = 0; -+ if (type == BPF_WRITE && -+ env->insn_aux_data[i + delta].sanitize_stack_off) { -+ struct bpf_insn patch[] = { -+ /* Sanitize suspicious stack slot with zero. -+ * There are no memory dependencies for this store, -+ * since it's only using frame pointer and immediate -+ * constant of zero -+ */ -+ BPF_ST_MEM(BPF_DW, BPF_REG_FP, -+ env->insn_aux_data[i + delta].sanitize_stack_off, -+ 0), -+ /* the original STX instruction will immediately -+ * overwrite the same stack slot with appropriate value -+ */ -+ *insn, -+ }; -+ -+ cnt = ARRAY_SIZE(patch); -+ new_prog = bpf_patch_insn_data(env, i + delta, patch, cnt); -+ if (!new_prog) -+ return -ENOMEM; -+ -+ delta += cnt - 1; -+ env->prog = new_prog; -+ insn = new_prog->insnsi + i + delta; -+ continue; -+ } -+ -+ switch (env->insn_aux_data[i + delta].ptr_type) { -+ case PTR_TO_CTX: -+ if (!ops->convert_ctx_access) -+ continue; -+ convert_ctx_access = ops->convert_ctx_access; -+ break; -+ default: - continue; - } - -- cnt = env->prog->aux->ops-> -- convert_ctx_access(type, insn->dst_reg, insn->src_reg, -- insn->off, insn_buf, env->prog); -- if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf)) { -- verbose("bpf verifier is misconfigured\n"); -+ ctx_field_size = env->insn_aux_data[i + delta].ctx_field_size; -+ size = BPF_LDST_BYTES(insn); -+ -+ /* If the read access is a narrower load of the field, -+ * convert to a 4/8-byte load, to minimum program type specific -+ * convert_ctx_access changes. If conversion is successful, -+ * we will apply proper mask to the result. -+ */ -+ is_narrower_load = size < ctx_field_size; -+ size_default = bpf_ctx_off_adjust_machine(ctx_field_size); -+ off = insn->off; -+ if (is_narrower_load) { -+ u8 size_code; -+ -+ if (type == BPF_WRITE) { -+ verbose(env, "bpf verifier narrow ctx access misconfigured\n"); -+ return -EINVAL; -+ } -+ -+ size_code = BPF_H; -+ if (ctx_field_size == 4) -+ size_code = BPF_W; -+ else if (ctx_field_size == 8) -+ size_code = BPF_DW; -+ -+ insn->off = off & ~(size_default - 1); -+ insn->code = BPF_LDX | BPF_MEM | size_code; -+ } -+ -+ target_size = 0; -+ cnt = convert_ctx_access(type, insn, insn_buf, env->prog, -+ &target_size); -+ if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf) || -+ (ctx_field_size && !target_size)) { -+ verbose(env, "bpf verifier is misconfigured\n"); - return -EINVAL; - } - -- if (cnt == 1) { -- memcpy(insn, insn_buf, sizeof(*insn)); -- continue; -+ if (is_narrower_load && size < target_size) { -+ u8 shift = bpf_ctx_narrow_access_offset( -+ off, size, size_default) * 8; -+ if (ctx_field_size <= 4) { -+ if (shift) -+ insn_buf[cnt++] = BPF_ALU32_IMM(BPF_RSH, -+ insn->dst_reg, -+ shift); -+ insn_buf[cnt++] = BPF_ALU32_IMM(BPF_AND, insn->dst_reg, -+ (1 << size * 8) - 1); -+ } else { -+ if (shift) -+ insn_buf[cnt++] = BPF_ALU64_IMM(BPF_RSH, -+ insn->dst_reg, -+ shift); -+ insn_buf[cnt++] = BPF_ALU64_IMM(BPF_AND, insn->dst_reg, -+ (1ULL << size * 8) - 1); -+ } - } - -- /* several new insns need to be inserted. Make room for them */ -- insn_cnt += cnt - 1; -- new_prog = bpf_prog_realloc(env->prog, -- bpf_prog_size(insn_cnt), -- GFP_USER); -+ new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); - if (!new_prog) - return -ENOMEM; - -- new_prog->len = insn_cnt; -+ delta += cnt - 1; - -- memmove(new_prog->insnsi + i + cnt, new_prog->insns + i + 1, -- sizeof(*insn) * (insn_cnt - i - cnt)); -+ /* keep walking new program and skip insns we just inserted */ -+ env->prog = new_prog; -+ insn = new_prog->insnsi + i + delta; -+ } - -- /* copy substitute insns in place of load instruction */ -- memcpy(new_prog->insnsi + i, insn_buf, sizeof(*insn) * cnt); -+ return 0; -+} - -- /* adjust branches in the whole program */ -- adjust_branches(new_prog, i, cnt - 1); -+static int jit_subprogs(struct bpf_verifier_env *env) -+{ -+ struct bpf_prog *prog = env->prog, **func, *tmp; -+ int i, j, subprog_start, subprog_end = 0, len, subprog; -+ struct bpf_insn *insn; -+ void *old_bpf_func; -+ int err; - -- /* keep walking new program and skip insns we just inserted */ -- env->prog = new_prog; -- insn = new_prog->insnsi + i + cnt - 1; -- i += cnt - 1; -+ if (env->subprog_cnt <= 1) -+ return 0; -+ -+ for (i = 0, insn = prog->insnsi; i < prog->len; i++, insn++) { -+ if (insn->code != (BPF_JMP | BPF_CALL) || -+ insn->src_reg != BPF_PSEUDO_CALL) -+ continue; -+ /* Upon error here we cannot fall back to interpreter but -+ * need a hard reject of the program. Thus -EFAULT is -+ * propagated in any case. -+ */ -+ subprog = find_subprog(env, i + insn->imm + 1); -+ if (subprog < 0) { -+ WARN_ONCE(1, "verifier bug. No program starts at insn %d\n", -+ i + insn->imm + 1); -+ return -EFAULT; -+ } -+ /* temporarily remember subprog id inside insn instead of -+ * aux_data, since next loop will split up all insns into funcs -+ */ -+ insn->off = subprog; -+ /* remember original imm in case JIT fails and fallback -+ * to interpreter will be needed -+ */ -+ env->insn_aux_data[i].call_imm = insn->imm; -+ /* point imm to __bpf_call_base+1 from JITs point of view */ -+ insn->imm = 1; -+ } -+ -+ err = bpf_prog_alloc_jited_linfo(prog); -+ if (err) -+ goto out_undo_insn; -+ -+ err = -ENOMEM; -+ func = kcalloc(env->subprog_cnt, sizeof(prog), GFP_KERNEL); -+ if (!func) -+ goto out_undo_insn; -+ -+ for (i = 0; i < env->subprog_cnt; i++) { -+ subprog_start = subprog_end; -+ subprog_end = env->subprog_info[i + 1].start; -+ -+ len = subprog_end - subprog_start; -+ /* BPF_PROG_RUN doesn't call subprogs directly, -+ * hence main prog stats include the runtime of subprogs. -+ * subprogs don't have IDs and not reachable via prog_get_next_id -+ * func[i]->aux->stats will never be accessed and stays NULL -+ */ -+ func[i] = bpf_prog_alloc_no_stats(bpf_prog_size(len), GFP_USER); -+ if (!func[i]) -+ goto out_free; -+ memcpy(func[i]->insnsi, &prog->insnsi[subprog_start], -+ len * sizeof(struct bpf_insn)); -+ func[i]->type = prog->type; -+ func[i]->len = len; -+ if (bpf_prog_calc_tag(func[i])) -+ goto out_free; -+ func[i]->is_func = 1; -+ func[i]->aux->func_idx = i; -+ /* the btf and func_info will be freed only at prog->aux */ -+ func[i]->aux->btf = prog->aux->btf; -+ func[i]->aux->func_info = prog->aux->func_info; -+ -+ /* Use bpf_prog_F_tag to indicate functions in stack traces. -+ * Long term would need debug info to populate names -+ */ -+ func[i]->aux->name[0] = 'F'; -+ func[i]->aux->stack_depth = env->subprog_info[i].stack_depth; -+ func[i]->jit_requested = 1; -+ func[i]->aux->linfo = prog->aux->linfo; -+ func[i]->aux->nr_linfo = prog->aux->nr_linfo; -+ func[i]->aux->jited_linfo = prog->aux->jited_linfo; -+ func[i]->aux->linfo_idx = env->subprog_info[i].linfo_idx; -+ func[i] = bpf_int_jit_compile(func[i]); -+ if (!func[i]->jited) { -+ err = -ENOTSUPP; -+ goto out_free; -+ } -+ cond_resched(); -+ } -+ /* at this point all bpf functions were successfully JITed -+ * now populate all bpf_calls with correct addresses and -+ * run last pass of JIT -+ */ -+ for (i = 0; i < env->subprog_cnt; i++) { -+ insn = func[i]->insnsi; -+ for (j = 0; j < func[i]->len; j++, insn++) { -+ if (insn->code != (BPF_JMP | BPF_CALL) || -+ insn->src_reg != BPF_PSEUDO_CALL) -+ continue; -+ subprog = insn->off; -+ insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) - -+ __bpf_call_base; -+ } -+ -+ /* we use the aux data to keep a list of the start addresses -+ * of the JITed images for each function in the program -+ * -+ * for some architectures, such as powerpc64, the imm field -+ * might not be large enough to hold the offset of the start -+ * address of the callee's JITed image from __bpf_call_base -+ * -+ * in such cases, we can lookup the start address of a callee -+ * by using its subprog id, available from the off field of -+ * the call instruction, as an index for this list -+ */ -+ func[i]->aux->func = func; -+ func[i]->aux->func_cnt = env->subprog_cnt; -+ } -+ for (i = 0; i < env->subprog_cnt; i++) { -+ old_bpf_func = func[i]->bpf_func; -+ tmp = bpf_int_jit_compile(func[i]); -+ if (tmp != func[i] || func[i]->bpf_func != old_bpf_func) { -+ verbose(env, "JIT doesn't support bpf-to-bpf calls\n"); -+ err = -ENOTSUPP; -+ goto out_free; -+ } -+ cond_resched(); -+ } -+ -+ /* finally lock prog and jit images for all functions and -+ * populate kallsysm -+ */ -+ for (i = 0; i < env->subprog_cnt; i++) { -+ bpf_prog_lock_ro(func[i]); -+ bpf_prog_kallsyms_add(func[i]); -+ } -+ -+ /* Last step: make now unused interpreter insns from main -+ * prog consistent for later dump requests, so they can -+ * later look the same as if they were interpreted only. -+ */ -+ for (i = 0, insn = prog->insnsi; i < prog->len; i++, insn++) { -+ if (insn->code != (BPF_JMP | BPF_CALL) || -+ insn->src_reg != BPF_PSEUDO_CALL) -+ continue; -+ insn->off = env->insn_aux_data[i].call_imm; -+ subprog = find_subprog(env, i + insn->off + 1); -+ insn->imm = subprog; - } - -+ prog->jited = 1; -+ prog->bpf_func = func[0]->bpf_func; -+ prog->aux->func = func; -+ prog->aux->func_cnt = env->subprog_cnt; -+ bpf_prog_free_unused_jited_linfo(prog); - return 0; -+out_free: -+ for (i = 0; i < env->subprog_cnt; i++) -+ if (func[i]) -+ bpf_jit_free(func[i]); -+ kfree(func); -+out_undo_insn: -+ /* cleanup main prog to be interpreted */ -+ prog->jit_requested = 0; -+ for (i = 0, insn = prog->insnsi; i < prog->len; i++, insn++) { -+ if (insn->code != (BPF_JMP | BPF_CALL) || -+ insn->src_reg != BPF_PSEUDO_CALL) -+ continue; -+ insn->off = 0; -+ insn->imm = env->insn_aux_data[i].call_imm; -+ } -+ bpf_prog_free_jited_linfo(prog); -+ return err; - } - --static void free_states(struct verifier_env *env) -+static int fixup_call_args(struct bpf_verifier_env *env) - { -- struct verifier_state_list *sl, *sln; -+#ifndef CONFIG_BPF_JIT_ALWAYS_ON -+ struct bpf_prog *prog = env->prog; -+ struct bpf_insn *insn = prog->insnsi; -+ int i, depth; -+#endif -+ int err = 0; -+ -+ if (env->prog->jit_requested && -+ !bpf_prog_is_dev_bound(env->prog->aux)) { -+ err = jit_subprogs(env); -+ if (err == 0) -+ return 0; -+ if (err == -EFAULT) -+ return err; -+ } -+#ifndef CONFIG_BPF_JIT_ALWAYS_ON -+ for (i = 0; i < prog->len; i++, insn++) { -+ if (insn->code != (BPF_JMP | BPF_CALL) || -+ insn->src_reg != BPF_PSEUDO_CALL) -+ continue; -+ depth = get_callee_stack_depth(env, insn, i); -+ if (depth < 0) -+ return depth; -+ bpf_patch_call_args(insn, depth); -+ } -+ err = 0; -+#endif -+ return err; -+} -+ -+/* fixup insn->imm field of bpf_call instructions -+ * and inline eligible helpers as explicit sequence of BPF instructions -+ * -+ * this function is called after eBPF program passed verification -+ */ -+static int fixup_bpf_calls(struct bpf_verifier_env *env) -+{ -+ struct bpf_prog *prog = env->prog; -+ struct bpf_insn *insn = prog->insnsi; -+ const struct bpf_func_proto *fn; -+ const int insn_cnt = prog->len; -+ const struct bpf_map_ops *ops; -+ struct bpf_insn_aux_data *aux; -+ struct bpf_insn insn_buf[16]; -+ struct bpf_prog *new_prog; -+ struct bpf_map *map_ptr; -+ int i, cnt, delta = 0; -+ -+ for (i = 0; i < insn_cnt; i++, insn++) { -+ if (insn->code == (BPF_ALU64 | BPF_MOD | BPF_X) || -+ insn->code == (BPF_ALU64 | BPF_DIV | BPF_X) || -+ insn->code == (BPF_ALU | BPF_MOD | BPF_X) || -+ insn->code == (BPF_ALU | BPF_DIV | BPF_X)) { -+ bool is64 = BPF_CLASS(insn->code) == BPF_ALU64; -+ bool isdiv = BPF_OP(insn->code) == BPF_DIV; -+ struct bpf_insn *patchlet; -+ struct bpf_insn chk_and_div[] = { -+ /* [R,W]x div 0 -> 0 */ -+ BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) | -+ BPF_JNE | BPF_K, insn->src_reg, -+ 0, 2, 0), -+ BPF_ALU32_REG(BPF_XOR, insn->dst_reg, insn->dst_reg), -+ BPF_JMP_IMM(BPF_JA, 0, 0, 1), -+ *insn, -+ }; -+ struct bpf_insn chk_and_mod[] = { -+ /* [R,W]x mod 0 -> [R,W]x */ -+ BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) | -+ BPF_JEQ | BPF_K, insn->src_reg, -+ 0, 1 + (is64 ? 0 : 1), 0), -+ *insn, -+ BPF_JMP_IMM(BPF_JA, 0, 0, 1), -+ BPF_MOV32_REG(insn->dst_reg, insn->dst_reg), -+ }; -+ -+ patchlet = isdiv ? chk_and_div : chk_and_mod; -+ cnt = isdiv ? ARRAY_SIZE(chk_and_div) : -+ ARRAY_SIZE(chk_and_mod) - (is64 ? 2 : 0); -+ -+ new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt); -+ if (!new_prog) -+ return -ENOMEM; -+ -+ delta += cnt - 1; -+ env->prog = prog = new_prog; -+ insn = new_prog->insnsi + i + delta; -+ continue; -+ } -+ -+ if (BPF_CLASS(insn->code) == BPF_LD && -+ (BPF_MODE(insn->code) == BPF_ABS || -+ BPF_MODE(insn->code) == BPF_IND)) { -+ cnt = env->ops->gen_ld_abs(insn, insn_buf); -+ if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf)) { -+ verbose(env, "bpf verifier is misconfigured\n"); -+ return -EINVAL; -+ } -+ -+ new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); -+ if (!new_prog) -+ return -ENOMEM; -+ -+ delta += cnt - 1; -+ env->prog = prog = new_prog; -+ insn = new_prog->insnsi + i + delta; -+ continue; -+ } -+ -+ if (insn->code == (BPF_ALU64 | BPF_ADD | BPF_X) || -+ insn->code == (BPF_ALU64 | BPF_SUB | BPF_X)) { -+ const u8 code_add = BPF_ALU64 | BPF_ADD | BPF_X; -+ const u8 code_sub = BPF_ALU64 | BPF_SUB | BPF_X; -+ struct bpf_insn insn_buf[16]; -+ struct bpf_insn *patch = &insn_buf[0]; -+ bool issrc, isneg, isimm; -+ u32 off_reg; -+ -+ aux = &env->insn_aux_data[i + delta]; -+ if (!aux->alu_state || -+ aux->alu_state == BPF_ALU_NON_POINTER) -+ continue; -+ -+ isneg = aux->alu_state & BPF_ALU_NEG_VALUE; -+ issrc = (aux->alu_state & BPF_ALU_SANITIZE) == -+ BPF_ALU_SANITIZE_SRC; -+ isimm = aux->alu_state & BPF_ALU_IMMEDIATE; -+ -+ off_reg = issrc ? insn->src_reg : insn->dst_reg; -+ if (isimm) { -+ *patch++ = BPF_MOV32_IMM(BPF_REG_AX, aux->alu_limit); -+ } else { -+ if (isneg) -+ *patch++ = BPF_ALU64_IMM(BPF_MUL, off_reg, -1); -+ *patch++ = BPF_MOV32_IMM(BPF_REG_AX, aux->alu_limit); -+ *patch++ = BPF_ALU64_REG(BPF_SUB, BPF_REG_AX, off_reg); -+ *patch++ = BPF_ALU64_REG(BPF_OR, BPF_REG_AX, off_reg); -+ *patch++ = BPF_ALU64_IMM(BPF_NEG, BPF_REG_AX, 0); -+ *patch++ = BPF_ALU64_IMM(BPF_ARSH, BPF_REG_AX, 63); -+ *patch++ = BPF_ALU64_REG(BPF_AND, BPF_REG_AX, off_reg); -+ } -+ if (!issrc) -+ *patch++ = BPF_MOV64_REG(insn->dst_reg, insn->src_reg); -+ insn->src_reg = BPF_REG_AX; -+ if (isneg) -+ insn->code = insn->code == code_add ? -+ code_sub : code_add; -+ *patch++ = *insn; -+ if (issrc && isneg && !isimm) -+ *patch++ = BPF_ALU64_IMM(BPF_MUL, off_reg, -1); -+ cnt = patch - insn_buf; -+ -+ new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); -+ if (!new_prog) -+ return -ENOMEM; -+ -+ delta += cnt - 1; -+ env->prog = prog = new_prog; -+ insn = new_prog->insnsi + i + delta; -+ continue; -+ } -+ -+ if (insn->code != (BPF_JMP | BPF_CALL)) -+ continue; -+ if (insn->src_reg == BPF_PSEUDO_CALL) -+ continue; -+ -+ if (insn->imm == BPF_FUNC_get_route_realm) -+ prog->dst_needed = 1; -+ if (insn->imm == BPF_FUNC_get_prandom_u32) -+ bpf_user_rnd_init_once(); -+ if (insn->imm == BPF_FUNC_override_return) -+ prog->kprobe_override = 1; -+ if (insn->imm == BPF_FUNC_tail_call) { -+ /* If we tail call into other programs, we -+ * cannot make any assumptions since they can -+ * be replaced dynamically during runtime in -+ * the program array. -+ */ -+ prog->cb_access = 1; -+ env->prog->aux->stack_depth = MAX_BPF_STACK; -+ env->prog->aux->max_pkt_offset = MAX_PACKET_OFF; -+ -+ /* mark bpf_tail_call as different opcode to avoid -+ * conditional branch in the interpeter for every normal -+ * call and to prevent accidental JITing by JIT compiler -+ * that doesn't support bpf_tail_call yet -+ */ -+ insn->imm = 0; -+ insn->code = BPF_JMP | BPF_TAIL_CALL; -+ -+ aux = &env->insn_aux_data[i + delta]; -+ if (!bpf_map_ptr_unpriv(aux)) -+ continue; -+ -+ /* instead of changing every JIT dealing with tail_call -+ * emit two extra insns: -+ * if (index >= max_entries) goto out; -+ * index &= array->index_mask; -+ * to avoid out-of-bounds cpu speculation -+ */ -+ if (bpf_map_ptr_poisoned(aux)) { -+ verbose(env, "tail_call abusing map_ptr\n"); -+ return -EINVAL; -+ } -+ -+ map_ptr = BPF_MAP_PTR(aux->map_state); -+ insn_buf[0] = BPF_JMP_IMM(BPF_JGE, BPF_REG_3, -+ map_ptr->max_entries, 2); -+ insn_buf[1] = BPF_ALU32_IMM(BPF_AND, BPF_REG_3, -+ container_of(map_ptr, -+ struct bpf_array, -+ map)->index_mask); -+ insn_buf[2] = *insn; -+ cnt = 3; -+ new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); -+ if (!new_prog) -+ return -ENOMEM; -+ -+ delta += cnt - 1; -+ env->prog = prog = new_prog; -+ insn = new_prog->insnsi + i + delta; -+ continue; -+ } -+ -+ /* BPF_EMIT_CALL() assumptions in some of the map_gen_lookup -+ * and other inlining handlers are currently limited to 64 bit -+ * only. -+ */ -+ if (prog->jit_requested && BITS_PER_LONG == 64 && -+ (insn->imm == BPF_FUNC_map_lookup_elem || -+ insn->imm == BPF_FUNC_map_update_elem || -+ insn->imm == BPF_FUNC_map_delete_elem || -+ insn->imm == BPF_FUNC_map_push_elem || -+ insn->imm == BPF_FUNC_map_pop_elem || -+ insn->imm == BPF_FUNC_map_peek_elem)) { -+ aux = &env->insn_aux_data[i + delta]; -+ if (bpf_map_ptr_poisoned(aux)) -+ goto patch_call_imm; -+ -+ map_ptr = BPF_MAP_PTR(aux->map_state); -+ ops = map_ptr->ops; -+ if (insn->imm == BPF_FUNC_map_lookup_elem && -+ ops->map_gen_lookup) { -+ cnt = ops->map_gen_lookup(map_ptr, insn_buf); -+ if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf)) { -+ verbose(env, "bpf verifier is misconfigured\n"); -+ return -EINVAL; -+ } -+ -+ new_prog = bpf_patch_insn_data(env, i + delta, -+ insn_buf, cnt); -+ if (!new_prog) -+ return -ENOMEM; -+ -+ delta += cnt - 1; -+ env->prog = prog = new_prog; -+ insn = new_prog->insnsi + i + delta; -+ continue; -+ } -+ -+ BUILD_BUG_ON(!__same_type(ops->map_lookup_elem, -+ (void *(*)(struct bpf_map *map, void *key))NULL)); -+ BUILD_BUG_ON(!__same_type(ops->map_delete_elem, -+ (int (*)(struct bpf_map *map, void *key))NULL)); -+ BUILD_BUG_ON(!__same_type(ops->map_update_elem, -+ (int (*)(struct bpf_map *map, void *key, void *value, -+ u64 flags))NULL)); -+ BUILD_BUG_ON(!__same_type(ops->map_push_elem, -+ (int (*)(struct bpf_map *map, void *value, -+ u64 flags))NULL)); -+ BUILD_BUG_ON(!__same_type(ops->map_pop_elem, -+ (int (*)(struct bpf_map *map, void *value))NULL)); -+ BUILD_BUG_ON(!__same_type(ops->map_peek_elem, -+ (int (*)(struct bpf_map *map, void *value))NULL)); -+ -+ switch (insn->imm) { -+ case BPF_FUNC_map_lookup_elem: -+ insn->imm = BPF_CAST_CALL(ops->map_lookup_elem) - -+ __bpf_call_base; -+ continue; -+ case BPF_FUNC_map_update_elem: -+ insn->imm = BPF_CAST_CALL(ops->map_update_elem) - -+ __bpf_call_base; -+ continue; -+ case BPF_FUNC_map_delete_elem: -+ insn->imm = BPF_CAST_CALL(ops->map_delete_elem) - -+ __bpf_call_base; -+ continue; -+ case BPF_FUNC_map_push_elem: -+ insn->imm = BPF_CAST_CALL(ops->map_push_elem) - -+ __bpf_call_base; -+ continue; -+ case BPF_FUNC_map_pop_elem: -+ insn->imm = BPF_CAST_CALL(ops->map_pop_elem) - -+ __bpf_call_base; -+ continue; -+ case BPF_FUNC_map_peek_elem: -+ insn->imm = BPF_CAST_CALL(ops->map_peek_elem) - -+ __bpf_call_base; -+ continue; -+ } -+ -+ goto patch_call_imm; -+ } -+ -+patch_call_imm: -+ fn = env->ops->get_func_proto(insn->imm, env->prog); -+ /* all functions that have prototype and verifier allowed -+ * programs to call them, must be real in-kernel functions -+ */ -+ if (!fn->func) { -+ verbose(env, -+ "kernel subsystem misconfigured func %s#%d\n", -+ func_id_name(insn->imm), insn->imm); -+ return -EFAULT; -+ } -+ insn->imm = fn->func - __bpf_call_base; -+ } -+ -+ return 0; -+} -+ -+static void free_states(struct bpf_verifier_env *env) -+{ -+ struct bpf_verifier_state_list *sl, *sln; - int i; - -+ sl = env->free_list; -+ while (sl) { -+ sln = sl->next; -+ free_verifier_state(&sl->state, false); -+ kfree(sl); -+ sl = sln; -+ } -+ - if (!env->explored_states) - return; - -- for (i = 0; i < env->prog->len; i++) { -+ for (i = 0; i < state_htab_size(env); i++) { - sl = env->explored_states[i]; - -- if (sl) -- while (sl != STATE_LIST_MARK) { -- sln = sl->next; -- kfree(sl); -- sl = sln; -- } -+ while (sl) { -+ sln = sl->next; -+ free_verifier_state(&sl->state, false); -+ kfree(sl); -+ sl = sln; -+ } - } - -- kfree(env->explored_states); -+ kvfree(env->explored_states); - } - --int bpf_check(struct bpf_prog **prog, union bpf_attr *attr) -+static void print_verification_stats(struct bpf_verifier_env *env) - { -- char __user *log_ubuf = NULL; -- struct verifier_env *env; -- int ret = -EINVAL; -+ int i; - -- if ((*prog)->len <= 0 || (*prog)->len > BPF_MAXINSNS) -- return -E2BIG; -+ if (env->log.level & BPF_LOG_STATS) { -+ verbose(env, "verification time %lld usec\n", -+ div_u64(env->verification_time, 1000)); -+ verbose(env, "stack depth "); -+ for (i = 0; i < env->subprog_cnt; i++) { -+ u32 depth = env->subprog_info[i].stack_depth; -+ -+ verbose(env, "%d", depth); -+ if (i + 1 < env->subprog_cnt) -+ verbose(env, "+"); -+ } -+ verbose(env, "\n"); -+ } -+ verbose(env, "processed %d insns (limit %d) max_states_per_insn %d " -+ "total_states %d peak_states %d mark_read %d\n", -+ env->insn_processed, BPF_COMPLEXITY_LIMIT_INSNS, -+ env->max_states_per_insn, env->total_states, -+ env->peak_states, env->longest_mark_read_walk); -+} -+ -+int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, -+ union bpf_attr __user *uattr) -+{ -+ u64 start_time = ktime_get_ns(); -+ struct bpf_verifier_env *env; -+ struct bpf_verifier_log *log; -+ int i, len, ret = -EINVAL; -+ bool is_priv; - -- /* 'struct verifier_env' can be global, but since it's not small, -+ /* no program is valid */ -+ if (ARRAY_SIZE(bpf_verifier_ops) == 0) -+ return -EINVAL; -+ -+ /* 'struct bpf_verifier_env' can be global, but since it's not small, - * allocate/free it every time bpf_check() is called - */ -- env = kzalloc(sizeof(struct verifier_env), GFP_KERNEL); -+ env = kzalloc(sizeof(struct bpf_verifier_env), GFP_KERNEL); - if (!env) - return -ENOMEM; -+ log = &env->log; - -+ len = (*prog)->len; -+ env->insn_aux_data = -+ vzalloc(array_size(sizeof(struct bpf_insn_aux_data), len)); -+ ret = -ENOMEM; -+ if (!env->insn_aux_data) -+ goto err_free_env; -+ for (i = 0; i < len; i++) -+ env->insn_aux_data[i].orig_idx = i; - env->prog = *prog; -+ env->ops = bpf_verifier_ops[env->prog->type]; -+ is_priv = capable(CAP_SYS_ADMIN); - - /* grab the mutex to protect few globals used by verifier */ -- mutex_lock(&bpf_verifier_lock); -+ if (!is_priv) -+ mutex_lock(&bpf_verifier_lock); - - if (attr->log_level || attr->log_buf || attr->log_size) { - /* user requested verbose verifier output - * and supplied buffer to store the verification trace - */ -- log_level = attr->log_level; -- log_ubuf = (char __user *) (unsigned long) attr->log_buf; -- log_size = attr->log_size; -- log_len = 0; -+ log->level = attr->log_level; -+ log->ubuf = (char __user *) (unsigned long) attr->log_buf; -+ log->len_total = attr->log_size; - - ret = -EINVAL; -- /* log_* values have to be sane */ -- if (log_size < 128 || log_size > UINT_MAX >> 8 || -- log_level == 0 || log_ubuf == NULL) -- goto free_env; -- -- ret = -ENOMEM; -- log_buf = vmalloc(log_size); -- if (!log_buf) -- goto free_env; -- } else { -- log_level = 0; -- } -+ /* log attributes have to be sane */ -+ if (log->len_total < 128 || log->len_total > UINT_MAX >> 2 || -+ !log->level || !log->ubuf || log->level & ~BPF_LOG_MASK) -+ goto err_unlock; -+ } -+ -+ env->strict_alignment = !!(attr->prog_flags & BPF_F_STRICT_ALIGNMENT); -+ if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) -+ env->strict_alignment = true; -+ if (attr->prog_flags & BPF_F_ANY_ALIGNMENT) -+ env->strict_alignment = false; -+ -+ env->allow_ptr_leaks = is_priv; -+ -+ if (is_priv) -+ env->test_state_freq = attr->prog_flags & BPF_F_TEST_STATE_FREQ; - - ret = replace_map_fd_with_map_ptr(env); - if (ret < 0) - goto skip_full_check; - -- env->explored_states = kcalloc(env->prog->len, -- sizeof(struct verifier_state_list *), -+ env->explored_states = kcalloc(state_htab_size(env), -+ sizeof(struct bpf_verifier_state_list *), - GFP_USER); - ret = -ENOMEM; - if (!env->explored_states) - goto skip_full_check; - -- ret = check_cfg(env); -+ ret = check_subprogs(env); -+ if (ret < 0) -+ goto skip_full_check; -+ -+ ret = check_btf_info(env, attr, uattr); - if (ret < 0) - goto skip_full_check; - -- env->allow_ptr_leaks = capable(CAP_SYS_ADMIN); -+ ret = check_cfg(env); -+ if (ret < 0) -+ goto skip_full_check; - - ret = do_check(env); -+ if (env->cur_state) { -+ free_verifier_state(env->cur_state, true); -+ env->cur_state = NULL; -+ } - - skip_full_check: -- while (pop_stack(env, NULL) >= 0); -+ while (!pop_stack(env, NULL, NULL)); - free_states(env); - - if (ret == 0) -+ ret = check_max_stack_depth(env); -+ -+ /* instruction rewrites happen after this point */ -+ if (is_priv) { -+ if (ret == 0) -+ opt_hard_wire_dead_code_branches(env); -+ if (ret == 0) -+ ret = opt_remove_dead_code(env); -+ if (ret == 0) -+ ret = opt_remove_nops(env); -+ } else { -+ if (ret == 0) -+ sanitize_dead_code(env); -+ } -+ -+ if (ret == 0) - /* program is valid, convert *(u32*)(ctx + off) accesses */ - ret = convert_ctx_accesses(env); - -- if (log_level && log_len >= log_size - 1) { -- BUG_ON(log_len >= log_size); -- /* verifier log exceeded user supplied buffer */ -- ret = -ENOSPC; -- /* fall through to return what was recorded */ -+ if (ret == 0) -+ ret = fixup_bpf_calls(env); -+ -+ /* do 32-bit optimization after insn patching has done so those patched -+ * insns could be handled correctly. -+ */ -+ if (ret == 0 && !bpf_prog_is_dev_bound(env->prog->aux)) { -+ ret = opt_subreg_zext_lo32_rnd_hi32(env, attr); -+ env->prog->aux->verifier_zext = bpf_jit_needs_zext() ? !ret -+ : false; - } - -- /* copy verifier log back to user space including trailing zero */ -- if (log_level && copy_to_user(log_ubuf, log_buf, log_len + 1) != 0) { -+ if (ret == 0) -+ ret = fixup_call_args(env); -+ -+ env->verification_time = ktime_get_ns() - start_time; -+ print_verification_stats(env); -+ -+ if (log->level && bpf_verifier_log_full(log)) -+ ret = -ENOSPC; -+ if (log->level && !log->ubuf) { - ret = -EFAULT; -- goto free_log_buf; -+ goto err_release_maps; - } - - if (ret == 0 && env->used_map_cnt) { -@@ -2297,7 +9580,7 @@ skip_full_check: - - if (!env->prog->aux->used_maps) { - ret = -ENOMEM; -- goto free_log_buf; -+ goto err_release_maps; - } - - memcpy(env->prog->aux->used_maps, env->used_maps, -@@ -2310,17 +9593,21 @@ skip_full_check: - convert_pseudo_ld_imm64(env); - } - --free_log_buf: -- if (log_level) -- vfree(log_buf); --free_env: -+ if (ret == 0) -+ adjust_btf_func(env); -+ -+err_release_maps: - if (!env->prog->aux->used_maps) - /* if we didn't copy map pointers into bpf_prog_info, release -- * them now. Otherwise free_bpf_prog_info() will release them. -+ * them now. Otherwise free_used_maps() will release them. - */ - release_maps(env); - *prog = env->prog; -+err_unlock: -+ if (!is_priv) -+ mutex_unlock(&bpf_verifier_lock); -+ vfree(env->insn_aux_data); -+err_free_env: - kfree(env); -- mutex_unlock(&bpf_verifier_lock); - return ret; - } ---- a/include/linux/filter.h -+++ b/include/linux/filter.h -@@ -1,3 +1,4 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ - /* - * Linux Socket Filter Data Structures - */ -@@ -7,16 +8,22 @@ - #include - - #include -+#include - #include - #include - #include - #include - #include - #include --#include -+#include -+#include -+#include -+#include -+#include - --#include -+#include - -+#include - #include - #include - -@@ -24,6 +31,11 @@ struct sk_buff; - struct sock; - struct seccomp_data; - struct bpf_prog_aux; -+struct xdp_rxq_info; -+struct xdp_buff; -+struct sock_reuseport; -+struct ctl_table; -+struct ctl_table_header; - - /* ArgX, context and stack frame pointer register positions. Note, - * Arg1, Arg2, Arg3, etc are used as argument mappings of function -@@ -40,7 +52,26 @@ struct bpf_prog_aux; - /* Additional register mappings for converted user programs. */ - #define BPF_REG_A BPF_REG_0 - #define BPF_REG_X BPF_REG_7 --#define BPF_REG_TMP BPF_REG_8 -+#define BPF_REG_TMP BPF_REG_2 /* scratch reg */ -+#define BPF_REG_D BPF_REG_8 /* data, callee-saved */ -+#define BPF_REG_H BPF_REG_9 /* hlen, callee-saved */ -+ -+/* Kernel hidden auxiliary/helper register. */ -+#define BPF_REG_AX MAX_BPF_REG -+#define MAX_BPF_EXT_REG (MAX_BPF_REG + 1) -+#define MAX_BPF_JIT_REG MAX_BPF_EXT_REG -+ -+/* unused opcode to mark special call to bpf_tail_call() helper */ -+#define BPF_TAIL_CALL 0xf0 -+ -+/* unused opcode to mark call to interpreter with arguments */ -+#define BPF_CALL_ARGS 0xe0 -+ -+/* As per nm, we expose JITed images as text (code) section for -+ * kallsyms. That way, tools like perf can find it to match -+ * addresses. -+ */ -+#define BPF_SYM_ELF_TYPE 't' - - /* BPF program can access up to 512 bytes of stack space. */ - #define MAX_BPF_STACK 512 -@@ -129,6 +160,20 @@ struct bpf_prog_aux; - .off = 0, \ - .imm = IMM }) - -+/* Special form of mov32, used for doing explicit zero extension on dst. */ -+#define BPF_ZEXT_REG(DST) \ -+ ((struct bpf_insn) { \ -+ .code = BPF_ALU | BPF_MOV | BPF_X, \ -+ .dst_reg = DST, \ -+ .src_reg = DST, \ -+ .off = 0, \ -+ .imm = 1 }) -+ -+static inline bool insn_is_zext(const struct bpf_insn *insn) -+{ -+ return insn->code == (BPF_ALU | BPF_MOV | BPF_X) && insn->imm == 1; -+} -+ - /* BPF_LD_IMM64 macro encodes single 'load 64-bit immediate' insn */ - #define BPF_LD_IMM64(DST, IMM) \ - BPF_LD_IMM64_RAW(DST, 0, IMM) -@@ -249,8 +294,51 @@ struct bpf_prog_aux; - .off = OFF, \ - .imm = IMM }) - -+/* Like BPF_JMP_REG, but with 32-bit wide operands for comparison. */ -+ -+#define BPF_JMP32_REG(OP, DST, SRC, OFF) \ -+ ((struct bpf_insn) { \ -+ .code = BPF_JMP32 | BPF_OP(OP) | BPF_X, \ -+ .dst_reg = DST, \ -+ .src_reg = SRC, \ -+ .off = OFF, \ -+ .imm = 0 }) -+ -+/* Like BPF_JMP_IMM, but with 32-bit wide operands for comparison. */ -+ -+#define BPF_JMP32_IMM(OP, DST, IMM, OFF) \ -+ ((struct bpf_insn) { \ -+ .code = BPF_JMP32 | BPF_OP(OP) | BPF_K, \ -+ .dst_reg = DST, \ -+ .src_reg = 0, \ -+ .off = OFF, \ -+ .imm = IMM }) -+ -+/* Unconditional jumps, goto pc + off16 */ -+ -+#define BPF_JMP_A(OFF) \ -+ ((struct bpf_insn) { \ -+ .code = BPF_JMP | BPF_JA, \ -+ .dst_reg = 0, \ -+ .src_reg = 0, \ -+ .off = OFF, \ -+ .imm = 0 }) -+ -+/* Relative call */ -+ -+#define BPF_CALL_REL(TGT) \ -+ ((struct bpf_insn) { \ -+ .code = BPF_JMP | BPF_CALL, \ -+ .dst_reg = 0, \ -+ .src_reg = BPF_PSEUDO_CALL, \ -+ .off = 0, \ -+ .imm = TGT }) -+ - /* Function call */ - -+#define BPF_CAST_CALL(x) \ -+ ((u64 (*)(u64, u64, u64, u64, u64))(x)) -+ - #define BPF_EMIT_CALL(FUNC) \ - ((struct bpf_insn) { \ - .code = BPF_JMP | BPF_CALL, \ -@@ -303,6 +391,112 @@ struct bpf_prog_aux; - bpf_size; \ - }) - -+#define bpf_size_to_bytes(bpf_size) \ -+({ \ -+ int bytes = -EINVAL; \ -+ \ -+ if (bpf_size == BPF_B) \ -+ bytes = sizeof(u8); \ -+ else if (bpf_size == BPF_H) \ -+ bytes = sizeof(u16); \ -+ else if (bpf_size == BPF_W) \ -+ bytes = sizeof(u32); \ -+ else if (bpf_size == BPF_DW) \ -+ bytes = sizeof(u64); \ -+ \ -+ bytes; \ -+}) -+ -+#define BPF_SIZEOF(type) \ -+ ({ \ -+ const int __size = bytes_to_bpf_size(sizeof(type)); \ -+ BUILD_BUG_ON(__size < 0); \ -+ __size; \ -+ }) -+ -+#define BPF_FIELD_SIZEOF(type, field) \ -+ ({ \ -+ const int __size = bytes_to_bpf_size(FIELD_SIZEOF(type, field)); \ -+ BUILD_BUG_ON(__size < 0); \ -+ __size; \ -+ }) -+ -+#define BPF_LDST_BYTES(insn) \ -+ ({ \ -+ const int __size = bpf_size_to_bytes(BPF_SIZE((insn)->code)); \ -+ WARN_ON(__size < 0); \ -+ __size; \ -+ }) -+ -+#define __BPF_MAP_0(m, v, ...) v -+#define __BPF_MAP_1(m, v, t, a, ...) m(t, a) -+#define __BPF_MAP_2(m, v, t, a, ...) m(t, a), __BPF_MAP_1(m, v, __VA_ARGS__) -+#define __BPF_MAP_3(m, v, t, a, ...) m(t, a), __BPF_MAP_2(m, v, __VA_ARGS__) -+#define __BPF_MAP_4(m, v, t, a, ...) m(t, a), __BPF_MAP_3(m, v, __VA_ARGS__) -+#define __BPF_MAP_5(m, v, t, a, ...) m(t, a), __BPF_MAP_4(m, v, __VA_ARGS__) -+ -+#define __BPF_REG_0(...) __BPF_PAD(5) -+#define __BPF_REG_1(...) __BPF_MAP(1, __VA_ARGS__), __BPF_PAD(4) -+#define __BPF_REG_2(...) __BPF_MAP(2, __VA_ARGS__), __BPF_PAD(3) -+#define __BPF_REG_3(...) __BPF_MAP(3, __VA_ARGS__), __BPF_PAD(2) -+#define __BPF_REG_4(...) __BPF_MAP(4, __VA_ARGS__), __BPF_PAD(1) -+#define __BPF_REG_5(...) __BPF_MAP(5, __VA_ARGS__) -+ -+#define __BPF_MAP(n, ...) __BPF_MAP_##n(__VA_ARGS__) -+#define __BPF_REG(n, ...) __BPF_REG_##n(__VA_ARGS__) -+ -+#define __BPF_CAST(t, a) \ -+ (__force t) \ -+ (__force \ -+ typeof(__builtin_choose_expr(sizeof(t) == sizeof(unsigned long), \ -+ (unsigned long)0, (t)0))) a -+#define __BPF_V void -+#define __BPF_N -+ -+#define __BPF_DECL_ARGS(t, a) t a -+#define __BPF_DECL_REGS(t, a) u64 a -+ -+#define __BPF_PAD(n) \ -+ __BPF_MAP(n, __BPF_DECL_ARGS, __BPF_N, u64, __ur_1, u64, __ur_2, \ -+ u64, __ur_3, u64, __ur_4, u64, __ur_5) -+ -+#define BPF_CALL_x(x, name, ...) \ -+ static __always_inline \ -+ u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ -+ u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \ -+ u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \ -+ { \ -+ return ____##name(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\ -+ } \ -+ static __always_inline \ -+ u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)) -+ -+#define BPF_CALL_0(name, ...) BPF_CALL_x(0, name, __VA_ARGS__) -+#define BPF_CALL_1(name, ...) BPF_CALL_x(1, name, __VA_ARGS__) -+#define BPF_CALL_2(name, ...) BPF_CALL_x(2, name, __VA_ARGS__) -+#define BPF_CALL_3(name, ...) BPF_CALL_x(3, name, __VA_ARGS__) -+#define BPF_CALL_4(name, ...) BPF_CALL_x(4, name, __VA_ARGS__) -+#define BPF_CALL_5(name, ...) BPF_CALL_x(5, name, __VA_ARGS__) -+ -+#define bpf_ctx_range(TYPE, MEMBER) \ -+ offsetof(TYPE, MEMBER) ... offsetofend(TYPE, MEMBER) - 1 -+#define bpf_ctx_range_till(TYPE, MEMBER1, MEMBER2) \ -+ offsetof(TYPE, MEMBER1) ... offsetofend(TYPE, MEMBER2) - 1 -+#if BITS_PER_LONG == 64 -+# define bpf_ctx_range_ptr(TYPE, MEMBER) \ -+ offsetof(TYPE, MEMBER) ... offsetofend(TYPE, MEMBER) - 1 -+#else -+# define bpf_ctx_range_ptr(TYPE, MEMBER) \ -+ offsetof(TYPE, MEMBER) ... offsetof(TYPE, MEMBER) + 8 - 1 -+#endif /* BITS_PER_LONG == 64 */ -+ -+#define bpf_target_off(TYPE, MEMBER, SIZE, PTR_SIZE) \ -+ ({ \ -+ BUILD_BUG_ON(FIELD_SIZEOF(TYPE, MEMBER) != (SIZE)); \ -+ *(PTR_SIZE) = (SIZE); \ -+ offsetof(TYPE, MEMBER); \ -+ }) -+ - #ifdef CONFIG_COMPAT - /* A struct sock_filter is architecture independent. */ - struct compat_sock_fprog { -@@ -317,24 +511,33 @@ struct sock_fprog_kern { - }; - - struct bpf_binary_header { -- unsigned int pages; -- u8 image[]; -+ u32 pages; -+ /* Some arches need word alignment for their instructions */ -+ u8 image[] __aligned(4); - }; - - struct bpf_prog { - u16 pages; /* Number of allocated pages */ -- kmemcheck_bitfield_begin(meta); - u16 jited:1, /* Is our filter JIT'ed? */ -+ jit_requested:1,/* archs need to JIT the prog */ -+ undo_set_mem:1, /* Passed set_memory_ro() checkpoint */ - gpl_compatible:1, /* Is filter GPL compatible? */ - cb_access:1, /* Is control block accessed? */ -- dst_needed:1; /* Do we need dst entry? */ -- kmemcheck_bitfield_end(meta); -- u32 len; /* Number of filter blocks */ -+ dst_needed:1, /* Do we need dst entry? */ -+ blinded:1, /* Was blinded */ -+ is_func:1, /* program is a bpf function */ -+ kprobe_override:1, /* Do we override a kprobe? */ -+ has_callchain_buf:1, /* callchain buffer allocated? */ -+ enforce_expected_attach_type:1; /* Enforce expected_attach_type checking at attach time */ - enum bpf_prog_type type; /* Type of BPF program */ -+ enum bpf_attach_type expected_attach_type; /* For some prog types */ -+ u32 len; /* Number of filter blocks */ -+ u32 jited_len; /* Size of jited insns in bytes */ -+ u8 tag[BPF_TAG_SIZE]; - struct bpf_prog_aux *aux; /* Auxiliary fields */ - struct sock_fprog_kern *orig_prog; /* Original BPF program */ -- unsigned int (*bpf_func)(const struct sk_buff *skb, -- const struct bpf_insn *filter); -+ unsigned int (*bpf_func)(const void *ctx, -+ const struct bpf_insn *insn); - /* Instructions for interpreter */ - union { - struct sock_filter insns[0]; -@@ -343,44 +546,160 @@ struct bpf_prog { - }; - - struct sk_filter { -- atomic_t refcnt; -+ refcount_t refcnt; - struct rcu_head rcu; - struct bpf_prog *prog; - }; - --#define BPF_PROG_RUN(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi) -+#define BPF_PROG_RUN(prog, ctx) ({ \ -+ u32 ret; \ -+ ret = (*(prog)->bpf_func)(ctx, (prog)->insnsi); \ -+ ret; }) -+ -+#define BPF_SKB_CB_LEN QDISC_CB_PRIV_LEN -+ -+struct bpf_skb_data_end { -+ struct qdisc_skb_cb qdisc_cb; -+ void *data_meta; -+ void *data_end; -+}; - --static inline u32 bpf_prog_run_save_cb(const struct bpf_prog *prog, -- struct sk_buff *skb) -+struct bpf_redirect_info { -+ u32 flags; -+ u32 tgt_index; -+ void *tgt_value; -+ struct bpf_map *map; -+ struct bpf_map *map_to_flush; -+ u32 kern_flags; -+}; -+ -+DECLARE_PER_CPU(struct bpf_redirect_info, bpf_redirect_info); -+ -+/* flags for bpf_redirect_info kern_flags */ -+#define BPF_RI_F_RF_NO_DIRECT BIT(0) /* no napi_direct on return_frame */ -+ -+/* Compute the linear packet data range [data, data_end) which -+ * will be accessed by various program types (cls_bpf, act_bpf, -+ * lwt, ...). Subsystems allowing direct data access must (!) -+ * ensure that cb[] area can be written to when BPF program is -+ * invoked (otherwise cb[] save/restore is necessary). -+ */ -+static inline void bpf_compute_data_pointers(struct sk_buff *skb) - { -- u8 *cb_data = qdisc_skb_cb(skb)->data; -- u8 saved_cb[QDISC_CB_PRIV_LEN]; -- u32 res; -+ struct bpf_skb_data_end *cb = (struct bpf_skb_data_end *)skb->cb; -+ -+ BUILD_BUG_ON(sizeof(*cb) > FIELD_SIZEOF(struct sk_buff, cb)); -+ cb->data_meta = skb->data; -+ cb->data_end = skb->data + skb_headlen(skb); -+} - -+/* Similar to bpf_compute_data_pointers(), except that save orginal -+ * data in cb->data and cb->meta_data for restore. -+ */ -+static inline void bpf_compute_and_save_data_end( -+ struct sk_buff *skb, void **saved_data_end) -+{ -+ struct bpf_skb_data_end *cb = (struct bpf_skb_data_end *)skb->cb; -+ -+ *saved_data_end = cb->data_end; -+ cb->data_end = skb->data + skb_headlen(skb); -+} -+ -+/* Restore data saved by bpf_compute_data_pointers(). */ -+static inline void bpf_restore_data_end( -+ struct sk_buff *skb, void *saved_data_end) -+{ -+ struct bpf_skb_data_end *cb = (struct bpf_skb_data_end *)skb->cb; -+ -+ cb->data_end = saved_data_end; -+} -+ -+static inline u8 *bpf_skb_cb(struct sk_buff *skb) -+{ -+ /* eBPF programs may read/write skb->cb[] area to transfer meta -+ * data between tail calls. Since this also needs to work with -+ * tc, that scratch memory is mapped to qdisc_skb_cb's data area. -+ * -+ * In some socket filter cases, the cb unfortunately needs to be -+ * saved/restored so that protocol specific skb->cb[] data won't -+ * be lost. In any case, due to unpriviledged eBPF programs -+ * attached to sockets, we need to clear the bpf_skb_cb() area -+ * to not leak previous contents to user space. -+ */ -+ BUILD_BUG_ON(FIELD_SIZEOF(struct __sk_buff, cb) != BPF_SKB_CB_LEN); - BUILD_BUG_ON(FIELD_SIZEOF(struct __sk_buff, cb) != -- QDISC_CB_PRIV_LEN); -+ FIELD_SIZEOF(struct qdisc_skb_cb, data)); -+ -+ return qdisc_skb_cb(skb)->data; -+} -+ -+static inline u32 __bpf_prog_run_save_cb(const struct bpf_prog *prog, -+ struct sk_buff *skb) -+{ -+ u8 *cb_data = bpf_skb_cb(skb); -+ u8 cb_saved[BPF_SKB_CB_LEN]; -+ u32 res; - - if (unlikely(prog->cb_access)) { -- memcpy(saved_cb, cb_data, sizeof(saved_cb)); -- memset(cb_data, 0, sizeof(saved_cb)); -+ memcpy(cb_saved, cb_data, sizeof(cb_saved)); -+ memset(cb_data, 0, sizeof(cb_saved)); - } - - res = BPF_PROG_RUN(prog, skb); - - if (unlikely(prog->cb_access)) -- memcpy(cb_data, saved_cb, sizeof(saved_cb)); -+ memcpy(cb_data, cb_saved, sizeof(cb_saved)); -+ -+ return res; -+} -+ -+static inline u32 bpf_prog_run_save_cb(const struct bpf_prog *prog, -+ struct sk_buff *skb) -+{ -+ u32 res; - -+ preempt_disable(); -+ res = __bpf_prog_run_save_cb(prog, skb); -+ preempt_enable(); - return res; - } - - static inline u32 bpf_prog_run_clear_cb(const struct bpf_prog *prog, - struct sk_buff *skb) - { -- u8 *cb_data = qdisc_skb_cb(skb)->data; -+ u8 *cb_data = bpf_skb_cb(skb); -+ u32 res; - - if (unlikely(prog->cb_access)) -- memset(cb_data, 0, QDISC_CB_PRIV_LEN); -- return BPF_PROG_RUN(prog, skb); -+ memset(cb_data, 0, BPF_SKB_CB_LEN); -+ -+ preempt_disable(); -+ res = BPF_PROG_RUN(prog, skb); -+ preempt_enable(); -+ return res; -+} -+ -+static __always_inline u32 bpf_prog_run_xdp(const struct bpf_prog *prog, -+ struct xdp_buff *xdp) -+{ -+ /* Caller needs to hold rcu_read_lock() (!), otherwise program -+ * can be released while still running, or map elements could be -+ * freed early while still having concurrent users. XDP fastpath -+ * already takes rcu_read_lock() when fetching the program, so -+ * it's not necessary here anymore. -+ */ -+ return BPF_PROG_RUN(prog, xdp); -+} -+ -+static inline u32 bpf_prog_insn_size(const struct bpf_prog *prog) -+{ -+ return prog->len * sizeof(struct bpf_insn); -+} -+ -+static inline u32 bpf_prog_tag_scratch_size(const struct bpf_prog *prog) -+{ -+ return round_up(bpf_prog_insn_size(prog) + -+ sizeof(__be64) + 1, SHA_MESSAGE_BYTES); - } - - static inline unsigned int bpf_prog_size(unsigned int proglen) -@@ -399,27 +718,77 @@ static inline bool bpf_prog_was_classic( - return prog->type == BPF_PROG_TYPE_UNSPEC; - } - -+static inline u32 bpf_ctx_off_adjust_machine(u32 size) -+{ -+ const u32 size_machine = sizeof(unsigned long); -+ -+ if (size > size_machine && size % size_machine == 0) -+ size = size_machine; -+ -+ return size; -+} -+ -+static inline bool -+bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default) -+{ -+ return size <= size_default && (size & (size - 1)) == 0; -+} -+ -+static inline u8 -+bpf_ctx_narrow_access_offset(u32 off, u32 size, u32 size_default) -+{ -+ u8 access_off = off & (size_default - 1); -+ -+#ifdef __LITTLE_ENDIAN -+ return access_off; -+#else -+ return size_default - (access_off + size); -+#endif -+} -+ -+#define bpf_ctx_wide_access_ok(off, size, type, field) \ -+ (size == sizeof(__u64) && \ -+ off >= offsetof(type, field) && \ -+ off + sizeof(__u64) <= offsetofend(type, field) && \ -+ off % sizeof(__u64) == 0) -+ - #define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0])) - --#ifdef CONFIG_DEBUG_SET_MODULE_RONX - static inline void bpf_prog_lock_ro(struct bpf_prog *fp) - { -- set_memory_ro((unsigned long)fp, fp->pages); -+#ifndef CONFIG_BPF_JIT_ALWAYS_ON -+ if (!fp->jited) { -+ fp->undo_set_mem = 1; -+ set_memory_ro((unsigned long)fp, fp->pages); -+ } -+#endif - } - - static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) - { -- set_memory_rw((unsigned long)fp, fp->pages); -+ if (fp->undo_set_mem) -+ set_memory_rw((unsigned long)fp, fp->pages); - } --#else --static inline void bpf_prog_lock_ro(struct bpf_prog *fp) -+ -+static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) - { -+ set_memory_ro((unsigned long)hdr, hdr->pages); -+ set_memory_x((unsigned long)hdr, hdr->pages); - } - --static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) -+static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) -+{ -+ set_memory_rw((unsigned long)hdr, hdr->pages); -+} -+ -+static inline struct bpf_binary_header * -+bpf_jit_binary_hdr(const struct bpf_prog *fp) - { -+ unsigned long real_start = (unsigned long)fp->bpf_func; -+ unsigned long addr = real_start & PAGE_MASK; -+ -+ return (void *)addr; - } --#endif /* CONFIG_DEBUG_SET_MODULE_RONX */ - - int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap); - static inline int sk_filter(struct sock *sk, struct sk_buff *skb) -@@ -427,10 +796,20 @@ static inline int sk_filter(struct sock - return sk_filter_trim_cap(sk, skb, 1); - } - --int bpf_prog_select_runtime(struct bpf_prog *fp); -+struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err); - void bpf_prog_free(struct bpf_prog *fp); - -+bool bpf_opcode_in_insntable(u8 code); -+ -+void bpf_prog_free_linfo(struct bpf_prog *prog); -+void bpf_prog_fill_jited_linfo(struct bpf_prog *prog, -+ const u32 *insn_to_jit_off); -+int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog); -+void bpf_prog_free_jited_linfo(struct bpf_prog *prog); -+void bpf_prog_free_unused_jited_linfo(struct bpf_prog *prog); -+ - struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags); -+struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flags); - struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size, - gfp_t gfp_extra_flags); - void __bpf_prog_free(struct bpf_prog *fp); -@@ -450,12 +829,11 @@ int bpf_prog_create_from_user(struct bpf - void bpf_prog_destroy(struct bpf_prog *fp); - - int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); --int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk, -- bool locked); - int sk_attach_bpf(u32 ufd, struct sock *sk); -+int sk_reuseport_attach_filter(struct sock_fprog *fprog, struct sock *sk); -+int sk_reuseport_attach_bpf(u32 ufd, struct sock *sk); -+void sk_reuseport_prog_free(struct bpf_prog *prog); - int sk_detach_filter(struct sock *sk); --int __sk_detach_filter(struct sock *sk, bool locked); -- - int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, - unsigned int len); - -@@ -463,10 +841,100 @@ bool sk_filter_charge(struct sock *sk, s - void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp); - - u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5); --void bpf_int_jit_compile(struct bpf_prog *fp); --bool bpf_helper_changes_skb_data(void *func); -+#define __bpf_call_base_args \ -+ ((u64 (*)(u64, u64, u64, u64, u64, const struct bpf_insn *)) \ -+ (void *)__bpf_call_base) -+ -+struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog); -+void bpf_jit_compile(struct bpf_prog *prog); -+bool bpf_jit_needs_zext(void); -+bool bpf_helper_changes_pkt_data(void *func); -+ -+static inline bool bpf_dump_raw_ok(const struct cred *cred) -+{ -+ /* Reconstruction of call-sites is dependent on kallsyms, -+ * thus make dump the same restriction. -+ */ -+ return true; -+} -+ -+struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, -+ const struct bpf_insn *patch, u32 len); -+int bpf_remove_insns(struct bpf_prog *prog, u32 off, u32 cnt); -+ -+void bpf_clear_redirect_map(struct bpf_map *map); -+ -+static inline bool xdp_return_frame_no_direct(void) -+{ -+ struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); -+ -+ return ri->kern_flags & BPF_RI_F_RF_NO_DIRECT; -+} -+ -+static inline void xdp_set_return_frame_no_direct(void) -+{ -+ struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); -+ -+ ri->kern_flags |= BPF_RI_F_RF_NO_DIRECT; -+} -+ -+static inline void xdp_clear_return_frame_no_direct(void) -+{ -+ struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); -+ -+ ri->kern_flags &= ~BPF_RI_F_RF_NO_DIRECT; -+} -+ -+static inline int xdp_ok_fwd_dev(const struct net_device *fwd, -+ unsigned int pktlen) -+{ -+ unsigned int len; -+ -+ if (unlikely(!(fwd->flags & IFF_UP))) -+ return -ENETDOWN; -+ -+ len = fwd->mtu + fwd->hard_header_len + VLAN_HLEN; -+ if (pktlen > len) -+ return -EMSGSIZE; -+ -+ return 0; -+} -+ -+/* The pair of xdp_do_redirect and xdp_do_flush_map MUST be called in the -+ * same cpu context. Further for best results no more than a single map -+ * for the do_redirect/do_flush pair should be used. This limitation is -+ * because we only track one map and force a flush when the map changes. -+ * This does not appear to be a real limitation for existing software. -+ */ -+int xdp_do_generic_redirect(struct net_device *dev, struct sk_buff *skb, -+ struct xdp_buff *xdp, struct bpf_prog *prog); -+int xdp_do_redirect(struct net_device *dev, -+ struct xdp_buff *xdp, -+ struct bpf_prog *prog); -+void xdp_do_flush_map(void); -+ -+void bpf_warn_invalid_xdp_action(u32 act); -+ -+#ifdef CONFIG_INET -+struct sock *bpf_run_sk_reuseport(struct sock_reuseport *reuse, struct sock *sk, -+ struct bpf_prog *prog, struct sk_buff *skb, -+ u32 hash); -+#else -+static inline struct sock * -+bpf_run_sk_reuseport(struct sock_reuseport *reuse, struct sock *sk, -+ struct bpf_prog *prog, struct sk_buff *skb, -+ u32 hash) -+{ -+ return NULL; -+} -+#endif - - #ifdef CONFIG_BPF_JIT -+extern int bpf_jit_enable; -+extern int bpf_jit_harden; -+extern int bpf_jit_kallsyms; -+extern long bpf_jit_limit; -+ - typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size); - - struct bpf_binary_header * -@@ -474,10 +942,18 @@ bpf_jit_binary_alloc(unsigned int progle - unsigned int alignment, - bpf_jit_fill_hole_t bpf_fill_ill_insns); - void bpf_jit_binary_free(struct bpf_binary_header *hdr); -- --void bpf_jit_compile(struct bpf_prog *fp); -+u64 bpf_jit_alloc_exec_limit(void); -+void *bpf_jit_alloc_exec(unsigned long size); -+void bpf_jit_free_exec(void *addr); - void bpf_jit_free(struct bpf_prog *fp); - -+int bpf_jit_get_func_addr(const struct bpf_prog *prog, -+ const struct bpf_insn *insn, bool extra_pass, -+ u64 *func_addr, bool *func_addr_fixed); -+ -+struct bpf_prog *bpf_jit_blind_constants(struct bpf_prog *fp); -+void bpf_jit_prog_release_other(struct bpf_prog *fp, struct bpf_prog *fp_other); -+ - static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, - u32 pass, void *image) - { -@@ -488,17 +964,144 @@ static inline void bpf_jit_dump(unsigned - print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET, - 16, 1, image, proglen, false); - } --#else --static inline void bpf_jit_compile(struct bpf_prog *fp) -+ -+static inline bool bpf_jit_is_ebpf(void) -+{ -+# ifdef CONFIG_HAVE_EBPF_JIT -+ return true; -+# else -+ return false; -+# endif -+} -+ -+static inline bool ebpf_jit_enabled(void) -+{ -+ return bpf_jit_enable && bpf_jit_is_ebpf(); -+} -+ -+static inline bool bpf_prog_ebpf_jited(const struct bpf_prog *fp) -+{ -+ return fp->jited && bpf_jit_is_ebpf(); -+} -+ -+static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog) -+{ -+ /* These are the prerequisites, should someone ever have the -+ * idea to call blinding outside of them, we make sure to -+ * bail out. -+ */ -+ if (!bpf_jit_is_ebpf()) -+ return false; -+ if (!prog->jit_requested) -+ return false; -+ if (!bpf_jit_harden) -+ return false; -+ if (bpf_jit_harden == 1 && capable(CAP_SYS_ADMIN)) -+ return false; -+ -+ return true; -+} -+ -+static inline bool bpf_jit_kallsyms_enabled(void) - { -+ /* There are a couple of corner cases where kallsyms should -+ * not be enabled f.e. on hardening. -+ */ -+ if (bpf_jit_harden) -+ return false; -+ if (!bpf_jit_kallsyms) -+ return false; -+ if (bpf_jit_kallsyms == 1) -+ return true; -+ -+ return false; -+} -+ -+const char *__bpf_address_lookup(unsigned long addr, unsigned long *size, -+ unsigned long *off, char *sym); -+bool is_bpf_text_address(unsigned long addr); -+int bpf_get_kallsym(unsigned int symnum, unsigned long *value, char *type, -+ char *sym); -+ -+static inline const char * -+bpf_address_lookup(unsigned long addr, unsigned long *size, -+ unsigned long *off, char **modname, char *sym) -+{ -+ const char *ret = __bpf_address_lookup(addr, size, off, sym); -+ -+ if (ret && modname) -+ *modname = NULL; -+ return ret; -+} -+ -+void bpf_prog_kallsyms_add(struct bpf_prog *fp); -+void bpf_prog_kallsyms_del(struct bpf_prog *fp); -+void bpf_get_prog_name(const struct bpf_prog *prog, char *sym); -+ -+#else /* CONFIG_BPF_JIT */ -+ -+static inline bool ebpf_jit_enabled(void) -+{ -+ return false; -+} -+ -+static inline bool bpf_prog_ebpf_jited(const struct bpf_prog *fp) -+{ -+ return false; - } - - static inline void bpf_jit_free(struct bpf_prog *fp) - { - bpf_prog_unlock_free(fp); - } -+ -+static inline bool bpf_jit_kallsyms_enabled(void) -+{ -+ return false; -+} -+ -+static inline const char * -+__bpf_address_lookup(unsigned long addr, unsigned long *size, -+ unsigned long *off, char *sym) -+{ -+ return NULL; -+} -+ -+static inline bool is_bpf_text_address(unsigned long addr) -+{ -+ return false; -+} -+ -+static inline int bpf_get_kallsym(unsigned int symnum, unsigned long *value, -+ char *type, char *sym) -+{ -+ return -ERANGE; -+} -+ -+static inline const char * -+bpf_address_lookup(unsigned long addr, unsigned long *size, -+ unsigned long *off, char **modname, char *sym) -+{ -+ return NULL; -+} -+ -+static inline void bpf_prog_kallsyms_add(struct bpf_prog *fp) -+{ -+} -+ -+static inline void bpf_prog_kallsyms_del(struct bpf_prog *fp) -+{ -+} -+ -+static inline void bpf_get_prog_name(const struct bpf_prog *prog, char *sym) -+{ -+ sym[0] = '\0'; -+} -+ - #endif /* CONFIG_BPF_JIT */ - -+void bpf_prog_kallsyms_del_all(struct bpf_prog *fp); -+ - #define BPF_ANC BIT(15) - - static inline bool bpf_needs_clear_a(const struct sock_filter *first) -@@ -571,4 +1174,59 @@ static inline int bpf_tell_extensions(vo - return SKF_AD_MAX; - } - -+struct bpf_sock_addr_kern { -+ struct sock *sk; -+ struct sockaddr *uaddr; -+ /* Temporary "register" to make indirect stores to nested structures -+ * defined above. We need three registers to make such a store, but -+ * only two (src and dst) are available at convert_ctx_access time -+ */ -+ u64 tmp_reg; -+ void *t_ctx; /* Attach type specific context. */ -+}; -+ -+struct bpf_sock_ops_kern { -+ struct sock *sk; -+ u32 op; -+ union { -+ u32 args[4]; -+ u32 reply; -+ u32 replylong[4]; -+ }; -+ u32 is_fullsock; -+ u64 temp; /* temp and everything after is not -+ * initialized to 0 before calling -+ * the BPF program. New fields that -+ * should be initialized to 0 should -+ * be inserted before temp. -+ * temp is scratch storage used by -+ * sock_ops_convert_ctx_access -+ * as temporary storage of a register. -+ */ -+}; -+ -+struct bpf_sysctl_kern { -+ struct ctl_table_header *head; -+ struct ctl_table *table; -+ void *cur_val; -+ size_t cur_len; -+ void *new_val; -+ size_t new_len; -+ int new_updated; -+ int write; -+ loff_t *ppos; -+ /* Temporary "register" for indirect stores to ppos. */ -+ u64 tmp_reg; -+}; -+ -+struct bpf_sockopt_kern { -+ struct sock *sk; -+ u8 *optval; -+ u8 *optval_end; -+ s32 level; -+ s32 optname; -+ s32 optlen; -+ s32 retval; -+}; -+ - #endif /* __LINUX_FILTER_H__ */ ---- /dev/null -+++ b/include/linux/set_memory.h -@@ -0,0 +1,47 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+/* -+ * Copyright 2017, Michael Ellerman, IBM Corporation. -+ */ -+#ifndef _LINUX_SET_MEMORY_H_ -+#define _LINUX_SET_MEMORY_H_ -+ -+#include -+ -+#ifndef CONFIG_ARCH_HAS_SET_DIRECT_MAP -+static inline int set_direct_map_invalid_noflush(struct page *page) -+{ -+ return 0; -+} -+static inline int set_direct_map_default_noflush(struct page *page) -+{ -+ return 0; -+} -+#endif -+ -+#ifndef set_mce_nospec -+static inline int set_mce_nospec(unsigned long pfn, bool unmap) -+{ -+ return 0; -+} -+#endif -+ -+#ifndef clear_mce_nospec -+static inline int clear_mce_nospec(unsigned long pfn) -+{ -+ return 0; -+} -+#endif -+ -+#ifndef CONFIG_ARCH_HAS_MEM_ENCRYPT -+static inline int set_memory_encrypted(unsigned long addr, int numpages) -+{ -+ return 0; -+} -+ -+static inline int set_memory_decrypted(unsigned long addr, int numpages) -+{ -+ return 0; -+} -+#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */ -+ -+#endif /* _LINUX_SET_MEMORY_H_ */ ---- /dev/null -+++ b/include/trace/events/xdp.h -@@ -0,0 +1,407 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+#undef TRACE_SYSTEM -+#define TRACE_SYSTEM xdp -+ -+#if !defined(_TRACE_XDP_H) || defined(TRACE_HEADER_MULTI_READ) -+#define _TRACE_XDP_H -+ -+#include -+#include -+#include -+#include -+ -+#define __XDP_ACT_MAP(FN) \ -+ FN(ABORTED) \ -+ FN(DROP) \ -+ FN(PASS) \ -+ FN(TX) \ -+ FN(REDIRECT) -+ -+#define __XDP_ACT_TP_FN(x) \ -+ TRACE_DEFINE_ENUM(XDP_##x); -+#define __XDP_ACT_SYM_FN(x) \ -+ { XDP_##x, #x }, -+#define __XDP_ACT_SYM_TAB \ -+ __XDP_ACT_MAP(__XDP_ACT_SYM_FN) { -1, 0 } -+__XDP_ACT_MAP(__XDP_ACT_TP_FN) -+ -+TRACE_EVENT(xdp_exception, -+ -+ TP_PROTO(const struct net_device *dev, -+ const struct bpf_prog *xdp, u32 act), -+ -+ TP_ARGS(dev, xdp, act), -+ -+ TP_STRUCT__entry( -+ __field(int, prog_id) -+ __field(u32, act) -+ __field(int, ifindex) -+ ), -+ -+ TP_fast_assign( -+ __entry->prog_id = xdp->aux->id; -+ __entry->act = act; -+ __entry->ifindex = dev->ifindex; -+ ), -+ -+ TP_printk("prog_id=%d action=%s ifindex=%d", -+ __entry->prog_id, -+ __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB), -+ __entry->ifindex) -+); -+ -+TRACE_EVENT(xdp_bulk_tx, -+ -+ TP_PROTO(const struct net_device *dev, -+ int sent, int drops, int err), -+ -+ TP_ARGS(dev, sent, drops, err), -+ -+ TP_STRUCT__entry( -+ __field(int, ifindex) -+ __field(u32, act) -+ __field(int, drops) -+ __field(int, sent) -+ __field(int, err) -+ ), -+ -+ TP_fast_assign( -+ __entry->ifindex = dev->ifindex; -+ __entry->act = XDP_TX; -+ __entry->drops = drops; -+ __entry->sent = sent; -+ __entry->err = err; -+ ), -+ -+ TP_printk("ifindex=%d action=%s sent=%d drops=%d err=%d", -+ __entry->ifindex, -+ __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB), -+ __entry->sent, __entry->drops, __entry->err) -+); -+ -+DECLARE_EVENT_CLASS(xdp_redirect_template, -+ -+ TP_PROTO(const struct net_device *dev, -+ const struct bpf_prog *xdp, -+ int to_ifindex, int err, -+ const struct bpf_map *map, u32 map_index), -+ -+ TP_ARGS(dev, xdp, to_ifindex, err, map, map_index), -+ -+ TP_STRUCT__entry( -+ __field(int, prog_id) -+ __field(u32, act) -+ __field(int, ifindex) -+ __field(int, err) -+ __field(int, to_ifindex) -+ __field(u32, map_id) -+ __field(int, map_index) -+ ), -+ -+ TP_fast_assign( -+ __entry->prog_id = xdp->aux->id; -+ __entry->act = XDP_REDIRECT; -+ __entry->ifindex = dev->ifindex; -+ __entry->err = err; -+ __entry->to_ifindex = to_ifindex; -+ __entry->map_id = map ? map->id : 0; -+ __entry->map_index = map_index; -+ ), -+ -+ TP_printk("prog_id=%d action=%s ifindex=%d to_ifindex=%d err=%d", -+ __entry->prog_id, -+ __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB), -+ __entry->ifindex, __entry->to_ifindex, -+ __entry->err) -+); -+ -+DEFINE_EVENT(xdp_redirect_template, xdp_redirect, -+ TP_PROTO(const struct net_device *dev, -+ const struct bpf_prog *xdp, -+ int to_ifindex, int err, -+ const struct bpf_map *map, u32 map_index), -+ TP_ARGS(dev, xdp, to_ifindex, err, map, map_index) -+); -+ -+DEFINE_EVENT(xdp_redirect_template, xdp_redirect_err, -+ TP_PROTO(const struct net_device *dev, -+ const struct bpf_prog *xdp, -+ int to_ifindex, int err, -+ const struct bpf_map *map, u32 map_index), -+ TP_ARGS(dev, xdp, to_ifindex, err, map, map_index) -+); -+ -+#define _trace_xdp_redirect(dev, xdp, to) \ -+ trace_xdp_redirect(dev, xdp, to, 0, NULL, 0); -+ -+#define _trace_xdp_redirect_err(dev, xdp, to, err) \ -+ trace_xdp_redirect_err(dev, xdp, to, err, NULL, 0); -+ -+DEFINE_EVENT_PRINT(xdp_redirect_template, xdp_redirect_map, -+ TP_PROTO(const struct net_device *dev, -+ const struct bpf_prog *xdp, -+ int to_ifindex, int err, -+ const struct bpf_map *map, u32 map_index), -+ TP_ARGS(dev, xdp, to_ifindex, err, map, map_index), -+ TP_printk("prog_id=%d action=%s ifindex=%d to_ifindex=%d err=%d" -+ " map_id=%d map_index=%d", -+ __entry->prog_id, -+ __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB), -+ __entry->ifindex, __entry->to_ifindex, -+ __entry->err, -+ __entry->map_id, __entry->map_index) -+); -+ -+DEFINE_EVENT_PRINT(xdp_redirect_template, xdp_redirect_map_err, -+ TP_PROTO(const struct net_device *dev, -+ const struct bpf_prog *xdp, -+ int to_ifindex, int err, -+ const struct bpf_map *map, u32 map_index), -+ TP_ARGS(dev, xdp, to_ifindex, err, map, map_index), -+ TP_printk("prog_id=%d action=%s ifindex=%d to_ifindex=%d err=%d" -+ " map_id=%d map_index=%d", -+ __entry->prog_id, -+ __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB), -+ __entry->ifindex, __entry->to_ifindex, -+ __entry->err, -+ __entry->map_id, __entry->map_index) -+); -+ -+#ifndef __DEVMAP_OBJ_TYPE -+#define __DEVMAP_OBJ_TYPE -+struct _bpf_dtab_netdev { -+ struct net_device *dev; -+}; -+#endif /* __DEVMAP_OBJ_TYPE */ -+ -+#define devmap_ifindex(fwd, map) \ -+ ((map->map_type == BPF_MAP_TYPE_DEVMAP || \ -+ map->map_type == BPF_MAP_TYPE_DEVMAP_HASH) ? \ -+ ((struct _bpf_dtab_netdev *)fwd)->dev->ifindex : 0) -+ -+#define _trace_xdp_redirect_map(dev, xdp, fwd, map, idx) \ -+ trace_xdp_redirect_map(dev, xdp, devmap_ifindex(fwd, map), \ -+ 0, map, idx) -+ -+#define _trace_xdp_redirect_map_err(dev, xdp, fwd, map, idx, err) \ -+ trace_xdp_redirect_map_err(dev, xdp, devmap_ifindex(fwd, map), \ -+ err, map, idx) -+ -+TRACE_EVENT(xdp_cpumap_kthread, -+ -+ TP_PROTO(int map_id, unsigned int processed, unsigned int drops, -+ int sched), -+ -+ TP_ARGS(map_id, processed, drops, sched), -+ -+ TP_STRUCT__entry( -+ __field(int, map_id) -+ __field(u32, act) -+ __field(int, cpu) -+ __field(unsigned int, drops) -+ __field(unsigned int, processed) -+ __field(int, sched) -+ ), -+ -+ TP_fast_assign( -+ __entry->map_id = map_id; -+ __entry->act = XDP_REDIRECT; -+ __entry->cpu = smp_processor_id(); -+ __entry->drops = drops; -+ __entry->processed = processed; -+ __entry->sched = sched; -+ ), -+ -+ TP_printk("kthread" -+ " cpu=%d map_id=%d action=%s" -+ " processed=%u drops=%u" -+ " sched=%d", -+ __entry->cpu, __entry->map_id, -+ __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB), -+ __entry->processed, __entry->drops, -+ __entry->sched) -+); -+ -+TRACE_EVENT(xdp_cpumap_enqueue, -+ -+ TP_PROTO(int map_id, unsigned int processed, unsigned int drops, -+ int to_cpu), -+ -+ TP_ARGS(map_id, processed, drops, to_cpu), -+ -+ TP_STRUCT__entry( -+ __field(int, map_id) -+ __field(u32, act) -+ __field(int, cpu) -+ __field(unsigned int, drops) -+ __field(unsigned int, processed) -+ __field(int, to_cpu) -+ ), -+ -+ TP_fast_assign( -+ __entry->map_id = map_id; -+ __entry->act = XDP_REDIRECT; -+ __entry->cpu = smp_processor_id(); -+ __entry->drops = drops; -+ __entry->processed = processed; -+ __entry->to_cpu = to_cpu; -+ ), -+ -+ TP_printk("enqueue" -+ " cpu=%d map_id=%d action=%s" -+ " processed=%u drops=%u" -+ " to_cpu=%d", -+ __entry->cpu, __entry->map_id, -+ __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB), -+ __entry->processed, __entry->drops, -+ __entry->to_cpu) -+); -+ -+TRACE_EVENT(xdp_devmap_xmit, -+ -+ TP_PROTO(const struct bpf_map *map, u32 map_index, -+ int sent, int drops, -+ const struct net_device *from_dev, -+ const struct net_device *to_dev, int err), -+ -+ TP_ARGS(map, map_index, sent, drops, from_dev, to_dev, err), -+ -+ TP_STRUCT__entry( -+ __field(int, map_id) -+ __field(u32, act) -+ __field(u32, map_index) -+ __field(int, drops) -+ __field(int, sent) -+ __field(int, from_ifindex) -+ __field(int, to_ifindex) -+ __field(int, err) -+ ), -+ -+ TP_fast_assign( -+ __entry->map_id = map->id; -+ __entry->act = XDP_REDIRECT; -+ __entry->map_index = map_index; -+ __entry->drops = drops; -+ __entry->sent = sent; -+ __entry->from_ifindex = from_dev->ifindex; -+ __entry->to_ifindex = to_dev->ifindex; -+ __entry->err = err; -+ ), -+ -+ TP_printk("ndo_xdp_xmit" -+ " map_id=%d map_index=%d action=%s" -+ " sent=%d drops=%d" -+ " from_ifindex=%d to_ifindex=%d err=%d", -+ __entry->map_id, __entry->map_index, -+ __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB), -+ __entry->sent, __entry->drops, -+ __entry->from_ifindex, __entry->to_ifindex, __entry->err) -+); -+ -+/* Expect users already include , but not xdp_priv.h */ -+#include -+ -+#define __MEM_TYPE_MAP(FN) \ -+ FN(PAGE_SHARED) \ -+ FN(PAGE_ORDER0) \ -+ FN(PAGE_POOL) \ -+ FN(ZERO_COPY) -+ -+#define __MEM_TYPE_TP_FN(x) \ -+ TRACE_DEFINE_ENUM(MEM_TYPE_##x); -+#define __MEM_TYPE_SYM_FN(x) \ -+ { MEM_TYPE_##x, #x }, -+#define __MEM_TYPE_SYM_TAB \ -+ __MEM_TYPE_MAP(__MEM_TYPE_SYM_FN) { -1, 0 } -+__MEM_TYPE_MAP(__MEM_TYPE_TP_FN) -+ -+TRACE_EVENT(mem_disconnect, -+ -+ TP_PROTO(const struct xdp_mem_allocator *xa), -+ -+ TP_ARGS(xa), -+ -+ TP_STRUCT__entry( -+ __field(const struct xdp_mem_allocator *, xa) -+ __field(u32, mem_id) -+ __field(u32, mem_type) -+ __field(const void *, allocator) -+ ), -+ -+ TP_fast_assign( -+ __entry->xa = xa; -+ __entry->mem_id = xa->mem.id; -+ __entry->mem_type = xa->mem.type; -+ __entry->allocator = xa->allocator; -+ ), -+ -+ TP_printk("mem_id=%d mem_type=%s allocator=%p", -+ __entry->mem_id, -+ __print_symbolic(__entry->mem_type, __MEM_TYPE_SYM_TAB), -+ __entry->allocator -+ ) -+); -+ -+TRACE_EVENT(mem_connect, -+ -+ TP_PROTO(const struct xdp_mem_allocator *xa, -+ const struct xdp_rxq_info *rxq), -+ -+ TP_ARGS(xa, rxq), -+ -+ TP_STRUCT__entry( -+ __field(const struct xdp_mem_allocator *, xa) -+ __field(u32, mem_id) -+ __field(u32, mem_type) -+ __field(const void *, allocator) -+ __field(const struct xdp_rxq_info *, rxq) -+ __field(int, ifindex) -+ ), -+ -+ TP_fast_assign( -+ __entry->xa = xa; -+ __entry->mem_id = xa->mem.id; -+ __entry->mem_type = xa->mem.type; -+ __entry->allocator = xa->allocator; -+ __entry->rxq = rxq; -+ __entry->ifindex = rxq->dev->ifindex; -+ ), -+ -+ TP_printk("mem_id=%d mem_type=%s allocator=%p" -+ " ifindex=%d", -+ __entry->mem_id, -+ __print_symbolic(__entry->mem_type, __MEM_TYPE_SYM_TAB), -+ __entry->allocator, -+ __entry->ifindex -+ ) -+); -+ -+TRACE_EVENT(mem_return_failed, -+ -+ TP_PROTO(const struct xdp_mem_info *mem, -+ const struct page *page), -+ -+ TP_ARGS(mem, page), -+ -+ TP_STRUCT__entry( -+ __field(const struct page *, page) -+ __field(u32, mem_id) -+ __field(u32, mem_type) -+ ), -+ -+ TP_fast_assign( -+ __entry->page = page; -+ __entry->mem_id = mem->id; -+ __entry->mem_type = mem->type; -+ ), -+ -+ TP_printk("mem_id=%d mem_type=%s page=%p", -+ __entry->mem_id, -+ __print_symbolic(__entry->mem_type, __MEM_TYPE_SYM_TAB), -+ __entry->page -+ ) -+); -+ -+#endif /* _TRACE_XDP_H */ -+ -+#include ---- /dev/null -+++ b/include/net/xdp_priv.h -@@ -0,0 +1,20 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+#ifndef __LINUX_NET_XDP_PRIV_H__ -+#define __LINUX_NET_XDP_PRIV_H__ -+ -+#include -+#include -+ -+/* Private to net/core/xdp.c, but used by trace/events/xdp.h */ -+struct xdp_mem_allocator { -+ struct xdp_mem_info mem; -+ union { -+ void *allocator; -+ struct page_pool *page_pool; -+ struct zero_copy_allocator *zc_alloc; -+ }; -+ struct rhash_head node; -+ struct rcu_head rcu; -+}; -+ -+#endif /* __LINUX_NET_XDP_PRIV_H__ */ ---- /dev/null -+++ b/include/net/xdp.h -@@ -0,0 +1,184 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+/* include/net/xdp.h -+ * -+ * Copyright (c) 2017 Jesper Dangaard Brouer, Red Hat Inc. -+ */ -+#ifndef __LINUX_NET_XDP_H__ -+#define __LINUX_NET_XDP_H__ -+ -+/** -+ * DOC: XDP RX-queue information -+ * -+ * The XDP RX-queue info (xdp_rxq_info) is associated with the driver -+ * level RX-ring queues. It is information that is specific to how -+ * the driver have configured a given RX-ring queue. -+ * -+ * Each xdp_buff frame received in the driver carry a (pointer) -+ * reference to this xdp_rxq_info structure. This provides the XDP -+ * data-path read-access to RX-info for both kernel and bpf-side -+ * (limited subset). -+ * -+ * For now, direct access is only safe while running in NAPI/softirq -+ * context. Contents is read-mostly and must not be updated during -+ * driver NAPI/softirq poll. -+ * -+ * The driver usage API is a register and unregister API. -+ * -+ * The struct is not directly tied to the XDP prog. A new XDP prog -+ * can be attached as long as it doesn't change the underlying -+ * RX-ring. If the RX-ring does change significantly, the NIC driver -+ * naturally need to stop the RX-ring before purging and reallocating -+ * memory. In that process the driver MUST call unregistor (which -+ * also apply for driver shutdown and unload). The register API is -+ * also mandatory during RX-ring setup. -+ */ -+ -+enum xdp_mem_type { -+ MEM_TYPE_PAGE_SHARED = 0, /* Split-page refcnt based model */ -+ MEM_TYPE_PAGE_ORDER0, /* Orig XDP full page model */ -+ MEM_TYPE_PAGE_POOL, -+ MEM_TYPE_ZERO_COPY, -+ MEM_TYPE_MAX, -+}; -+ -+/* XDP flags for ndo_xdp_xmit */ -+#define XDP_XMIT_FLUSH (1U << 0) /* doorbell signal consumer */ -+#define XDP_XMIT_FLAGS_MASK XDP_XMIT_FLUSH -+ -+struct xdp_mem_info { -+ u32 type; /* enum xdp_mem_type, but known size type */ -+ u32 id; -+}; -+ -+struct page_pool; -+ -+struct zero_copy_allocator { -+ void (*free)(struct zero_copy_allocator *zca, unsigned long handle); -+}; -+ -+struct xdp_rxq_info { -+ struct net_device *dev; -+ u32 queue_index; -+ u32 reg_state; -+ struct xdp_mem_info mem; -+} ____cacheline_aligned; /* perf critical, avoid false-sharing */ -+ -+struct xdp_buff { -+ void *data; -+ void *data_end; -+ void *data_meta; -+ void *data_hard_start; -+ unsigned long handle; -+ struct xdp_rxq_info *rxq; -+}; -+ -+struct xdp_frame { -+ void *data; -+ u16 len; -+ u16 headroom; -+ u16 metasize; -+ /* Lifetime of xdp_rxq_info is limited to NAPI/enqueue time, -+ * while mem info is valid on remote CPU. -+ */ -+ struct xdp_mem_info mem; -+ struct net_device *dev_rx; /* used by cpumap */ -+}; -+ -+/* Clear kernel pointers in xdp_frame */ -+static inline void xdp_scrub_frame(struct xdp_frame *frame) -+{ -+ frame->data = NULL; -+ frame->dev_rx = NULL; -+} -+ -+struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp); -+ -+/* Convert xdp_buff to xdp_frame */ -+static inline -+struct xdp_frame *convert_to_xdp_frame(struct xdp_buff *xdp) -+{ -+ struct xdp_frame *xdp_frame; -+ int metasize; -+ int headroom; -+ -+ if (xdp->rxq->mem.type == MEM_TYPE_ZERO_COPY) -+ return xdp_convert_zc_to_xdp_frame(xdp); -+ -+ /* Assure headroom is available for storing info */ -+ headroom = xdp->data - xdp->data_hard_start; -+ metasize = xdp->data - xdp->data_meta; -+ metasize = metasize > 0 ? metasize : 0; -+ if (unlikely((headroom - metasize) < sizeof(*xdp_frame))) -+ return NULL; -+ -+ /* Store info in top of packet */ -+ xdp_frame = xdp->data_hard_start; -+ -+ xdp_frame->data = xdp->data; -+ xdp_frame->len = xdp->data_end - xdp->data; -+ xdp_frame->headroom = headroom - sizeof(*xdp_frame); -+ xdp_frame->metasize = metasize; -+ -+ /* rxq only valid until napi_schedule ends, convert to xdp_mem_info */ -+ xdp_frame->mem = xdp->rxq->mem; -+ -+ return xdp_frame; -+} -+ -+void xdp_return_frame(struct xdp_frame *xdpf); -+void xdp_return_frame_rx_napi(struct xdp_frame *xdpf); -+void xdp_return_buff(struct xdp_buff *xdp); -+ -+/* When sending xdp_frame into the network stack, then there is no -+ * return point callback, which is needed to release e.g. DMA-mapping -+ * resources with page_pool. Thus, have explicit function to release -+ * frame resources. -+ */ -+void __xdp_release_frame(void *data, struct xdp_mem_info *mem); -+static inline void xdp_release_frame(struct xdp_frame *xdpf) -+{ -+ struct xdp_mem_info *mem = &xdpf->mem; -+ -+ /* Curr only page_pool needs this */ -+ if (mem->type == MEM_TYPE_PAGE_POOL) -+ __xdp_release_frame(xdpf->data, mem); -+} -+ -+int xdp_rxq_info_reg(struct xdp_rxq_info *xdp_rxq, -+ struct net_device *dev, u32 queue_index); -+void xdp_rxq_info_unreg(struct xdp_rxq_info *xdp_rxq); -+void xdp_rxq_info_unused(struct xdp_rxq_info *xdp_rxq); -+bool xdp_rxq_info_is_reg(struct xdp_rxq_info *xdp_rxq); -+int xdp_rxq_info_reg_mem_model(struct xdp_rxq_info *xdp_rxq, -+ enum xdp_mem_type type, void *allocator); -+void xdp_rxq_info_unreg_mem_model(struct xdp_rxq_info *xdp_rxq); -+ -+/* Drivers not supporting XDP metadata can use this helper, which -+ * rejects any room expansion for metadata as a result. -+ */ -+static __always_inline void -+xdp_set_data_meta_invalid(struct xdp_buff *xdp) -+{ -+ xdp->data_meta = xdp->data + 1; -+} -+ -+static __always_inline bool -+xdp_data_meta_unsupported(const struct xdp_buff *xdp) -+{ -+ return unlikely(xdp->data_meta > xdp->data); -+} -+ -+struct xdp_attachment_info { -+ struct bpf_prog *prog; -+ u32 flags; -+}; -+ -+struct netdev_bpf; -+int xdp_attachment_query(struct xdp_attachment_info *info, -+ struct netdev_bpf *bpf); -+bool xdp_attachment_flags_ok(struct xdp_attachment_info *info, -+ struct netdev_bpf *bpf); -+void xdp_attachment_setup(struct xdp_attachment_info *info, -+ struct netdev_bpf *bpf); -+ -+#endif /* __LINUX_NET_XDP_H__ */ ---- a/include/linux/atomic.h -+++ b/include/linux/atomic.h -@@ -437,6 +437,8 @@ static inline int atomic_add_unless(atom - return __atomic_add_unless(v, a, u) != u; - } - -+#define atomic_fetch_add_unless __atomic_add_unless -+ - /** - * atomic_inc_not_zero - increment unless the number is zero - * @v: pointer of type atomic_t ---- a/include/linux/kernel.h -+++ b/include/linux/kernel.h -@@ -45,6 +45,13 @@ - - #define STACK_MAGIC 0xdeadbeef - -+#define u64_to_user_ptr(x) ( \ -+ { \ -+ typecheck(u64, (x)); \ -+ (void __user *)(uintptr_t)(x); \ -+ } \ -+) -+ - #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) - - #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) ---- /dev/null -+++ b/include/linux/tnum.h -@@ -0,0 +1,89 @@ -+/* tnum: tracked (or tristate) numbers -+ * -+ * A tnum tracks knowledge about the bits of a value. Each bit can be either -+ * known (0 or 1), or unknown (x). Arithmetic operations on tnums will -+ * propagate the unknown bits such that the tnum result represents all the -+ * possible results for possible values of the operands. -+ */ -+ -+#ifndef _LINUX_TNUM_H -+#define _LINUX_TNUM_H -+ -+#include -+ -+struct tnum { -+ u64 value; -+ u64 mask; -+}; -+ -+/* Constructors */ -+/* Represent a known constant as a tnum. */ -+struct tnum tnum_const(u64 value); -+/* A completely unknown value */ -+extern const struct tnum tnum_unknown; -+/* A value that's unknown except that @min <= value <= @max */ -+struct tnum tnum_range(u64 min, u64 max); -+ -+/* Arithmetic and logical ops */ -+/* Shift a tnum left (by a fixed shift) */ -+struct tnum tnum_lshift(struct tnum a, u8 shift); -+/* Shift (rsh) a tnum right (by a fixed shift) */ -+struct tnum tnum_rshift(struct tnum a, u8 shift); -+/* Shift (arsh) a tnum right (by a fixed min_shift) */ -+struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness); -+/* Add two tnums, return @a + @b */ -+struct tnum tnum_add(struct tnum a, struct tnum b); -+/* Subtract two tnums, return @a - @b */ -+struct tnum tnum_sub(struct tnum a, struct tnum b); -+/* Bitwise-AND, return @a & @b */ -+struct tnum tnum_and(struct tnum a, struct tnum b); -+/* Bitwise-OR, return @a | @b */ -+struct tnum tnum_or(struct tnum a, struct tnum b); -+/* Bitwise-XOR, return @a ^ @b */ -+struct tnum tnum_xor(struct tnum a, struct tnum b); -+/* Multiply two tnums, return @a * @b */ -+struct tnum tnum_mul(struct tnum a, struct tnum b); -+ -+/* Return a tnum representing numbers satisfying both @a and @b */ -+struct tnum tnum_intersect(struct tnum a, struct tnum b); -+ -+/* Return @a with all but the lowest @size bytes cleared */ -+struct tnum tnum_cast(struct tnum a, u8 size); -+ -+/* Returns true if @a is a known constant */ -+static inline bool tnum_is_const(struct tnum a) -+{ -+ return !a.mask; -+} -+ -+/* Returns true if @a == tnum_const(@b) */ -+static inline bool tnum_equals_const(struct tnum a, u64 b) -+{ -+ return tnum_is_const(a) && a.value == b; -+} -+ -+/* Returns true if @a is completely unknown */ -+static inline bool tnum_is_unknown(struct tnum a) -+{ -+ return !~a.mask; -+} -+ -+/* Returns true if @a is known to be a multiple of @size. -+ * @size must be a power of two. -+ */ -+bool tnum_is_aligned(struct tnum a, u64 size); -+ -+/* Returns true if @b represents a subset of @a. */ -+bool tnum_in(struct tnum a, struct tnum b); -+ -+/* Formatting functions. These have snprintf-like semantics: they will write -+ * up to @size bytes (including the terminating NUL byte), and return the number -+ * of bytes (excluding the terminating NUL) which would have been written had -+ * sufficient space been available. (Thus tnum_sbin always returns 64.) -+ */ -+/* Format a tnum as a pair of hex numbers (value; mask) */ -+int tnum_strn(char *str, size_t size, struct tnum a); -+/* Format a tnum as tristate binary expansion */ -+int tnum_sbin(char *str, size_t size, struct tnum a); -+ -+#endif /* _LINUX_TNUM_H */ ---- a/include/linux/bitmap.h -+++ b/include/linux/bitmap.h -@@ -326,6 +326,24 @@ static inline int bitmap_parse(const cha - return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits); - } - -+/** -+ * bitmap_from_u64 - Check and swap words within u64. -+ * @mask: source bitmap -+ * @dst: destination bitmap -+ * -+ * In 32-bit Big Endian kernel, when using ``(u32 *)(&val)[*]`` -+ * to read u64 mask, we will get the wrong word. -+ * That is ``(u32 *)(&val)[0]`` gets the upper 32 bits, -+ * but we expect the lower 32-bits of u64. -+ */ -+static inline void bitmap_from_u64(unsigned long *dst, u64 mask) -+{ -+ dst[0] = mask & ULONG_MAX; -+ -+ if (sizeof(mask) > sizeof(unsigned long)) -+ dst[1] = mask >> 32; -+} -+ - #endif /* __ASSEMBLY__ */ - - #endif /* __LINUX_BITMAP_H */ ---- /dev/null -+++ b/include/linux/overflow.h -@@ -0,0 +1,320 @@ -+/* SPDX-License-Identifier: GPL-2.0 OR MIT */ -+#ifndef __LINUX_OVERFLOW_H -+#define __LINUX_OVERFLOW_H -+ -+#include -+#include -+ -+/* -+ * In the fallback code below, we need to compute the minimum and -+ * maximum values representable in a given type. These macros may also -+ * be useful elsewhere, so we provide them outside the -+ * COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW block. -+ * -+ * It would seem more obvious to do something like -+ * -+ * #define type_min(T) (T)(is_signed_type(T) ? (T)1 << (8*sizeof(T)-1) : 0) -+ * #define type_max(T) (T)(is_signed_type(T) ? ((T)1 << (8*sizeof(T)-1)) - 1 : ~(T)0) -+ * -+ * Unfortunately, the middle expressions, strictly speaking, have -+ * undefined behaviour, and at least some versions of gcc warn about -+ * the type_max expression (but not if -fsanitize=undefined is in -+ * effect; in that case, the warning is deferred to runtime...). -+ * -+ * The slightly excessive casting in type_min is to make sure the -+ * macros also produce sensible values for the exotic type _Bool. [The -+ * overflow checkers only almost work for _Bool, but that's -+ * a-feature-not-a-bug, since people shouldn't be doing arithmetic on -+ * _Bools. Besides, the gcc builtins don't allow _Bool* as third -+ * argument.] -+ * -+ * Idea stolen from -+ * https://mail-index.netbsd.org/tech-misc/2007/02/05/0000.html - -+ * credit to Christian Biere. -+ */ -+#define is_signed_type(type) (((type)(-1)) < (type)1) -+#define __type_half_max(type) ((type)1 << (8*sizeof(type) - 1 - is_signed_type(type))) -+#define type_max(T) ((T)((__type_half_max(T) - 1) + __type_half_max(T))) -+#define type_min(T) ((T)((T)-type_max(T)-(T)1)) -+ -+/* -+ * Avoids triggering -Wtype-limits compilation warning, -+ * while using unsigned data types to check a < 0. -+ */ -+#define is_non_negative(a) ((a) > 0 || (a) == 0) -+#define is_negative(a) (!(is_non_negative(a))) -+ -+#ifdef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW -+/* -+ * For simplicity and code hygiene, the fallback code below insists on -+ * a, b and *d having the same type (similar to the min() and max() -+ * macros), whereas gcc's type-generic overflow checkers accept -+ * different types. Hence we don't just make check_add_overflow an -+ * alias for __builtin_add_overflow, but add type checks similar to -+ * below. -+ */ -+#define check_add_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ __builtin_add_overflow(__a, __b, __d); \ -+}) -+ -+#define check_sub_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ __builtin_sub_overflow(__a, __b, __d); \ -+}) -+ -+#define check_mul_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ __builtin_mul_overflow(__a, __b, __d); \ -+}) -+ -+#else -+ -+ -+/* Checking for unsigned overflow is relatively easy without causing UB. */ -+#define __unsigned_add_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ *__d = __a + __b; \ -+ *__d < __a; \ -+}) -+#define __unsigned_sub_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ *__d = __a - __b; \ -+ __a < __b; \ -+}) -+/* -+ * If one of a or b is a compile-time constant, this avoids a division. -+ */ -+#define __unsigned_mul_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ *__d = __a * __b; \ -+ __builtin_constant_p(__b) ? \ -+ __b > 0 && __a > type_max(typeof(__a)) / __b : \ -+ __a > 0 && __b > type_max(typeof(__b)) / __a; \ -+}) -+ -+/* -+ * For signed types, detecting overflow is much harder, especially if -+ * we want to avoid UB. But the interface of these macros is such that -+ * we must provide a result in *d, and in fact we must produce the -+ * result promised by gcc's builtins, which is simply the possibly -+ * wrapped-around value. Fortunately, we can just formally do the -+ * operations in the widest relevant unsigned type (u64) and then -+ * truncate the result - gcc is smart enough to generate the same code -+ * with and without the (u64) casts. -+ */ -+ -+/* -+ * Adding two signed integers can overflow only if they have the same -+ * sign, and overflow has happened iff the result has the opposite -+ * sign. -+ */ -+#define __signed_add_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ *__d = (u64)__a + (u64)__b; \ -+ (((~(__a ^ __b)) & (*__d ^ __a)) \ -+ & type_min(typeof(__a))) != 0; \ -+}) -+ -+/* -+ * Subtraction is similar, except that overflow can now happen only -+ * when the signs are opposite. In this case, overflow has happened if -+ * the result has the opposite sign of a. -+ */ -+#define __signed_sub_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ *__d = (u64)__a - (u64)__b; \ -+ ((((__a ^ __b)) & (*__d ^ __a)) \ -+ & type_min(typeof(__a))) != 0; \ -+}) -+ -+/* -+ * Signed multiplication is rather hard. gcc always follows C99, so -+ * division is truncated towards 0. This means that we can write the -+ * overflow check like this: -+ * -+ * (a > 0 && (b > MAX/a || b < MIN/a)) || -+ * (a < -1 && (b > MIN/a || b < MAX/a) || -+ * (a == -1 && b == MIN) -+ * -+ * The redundant casts of -1 are to silence an annoying -Wtype-limits -+ * (included in -Wextra) warning: When the type is u8 or u16, the -+ * __b_c_e in check_mul_overflow obviously selects -+ * __unsigned_mul_overflow, but unfortunately gcc still parses this -+ * code and warns about the limited range of __b. -+ */ -+ -+#define __signed_mul_overflow(a, b, d) ({ \ -+ typeof(a) __a = (a); \ -+ typeof(b) __b = (b); \ -+ typeof(d) __d = (d); \ -+ typeof(a) __tmax = type_max(typeof(a)); \ -+ typeof(a) __tmin = type_min(typeof(a)); \ -+ (void) (&__a == &__b); \ -+ (void) (&__a == __d); \ -+ *__d = (u64)__a * (u64)__b; \ -+ (__b > 0 && (__a > __tmax/__b || __a < __tmin/__b)) || \ -+ (__b < (typeof(__b))-1 && (__a > __tmin/__b || __a < __tmax/__b)) || \ -+ (__b == (typeof(__b))-1 && __a == __tmin); \ -+}) -+ -+ -+#define check_add_overflow(a, b, d) \ -+ __builtin_choose_expr(is_signed_type(typeof(a)), \ -+ __signed_add_overflow(a, b, d), \ -+ __unsigned_add_overflow(a, b, d)) -+ -+#define check_sub_overflow(a, b, d) \ -+ __builtin_choose_expr(is_signed_type(typeof(a)), \ -+ __signed_sub_overflow(a, b, d), \ -+ __unsigned_sub_overflow(a, b, d)) -+ -+#define check_mul_overflow(a, b, d) \ -+ __builtin_choose_expr(is_signed_type(typeof(a)), \ -+ __signed_mul_overflow(a, b, d), \ -+ __unsigned_mul_overflow(a, b, d)) -+ -+ -+#endif /* COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW */ -+ -+/** check_shl_overflow() - Calculate a left-shifted value and check overflow -+ * -+ * @a: Value to be shifted -+ * @s: How many bits left to shift -+ * @d: Pointer to where to store the result -+ * -+ * Computes *@d = (@a << @s) -+ * -+ * Returns true if '*d' cannot hold the result or when 'a << s' doesn't -+ * make sense. Example conditions: -+ * - 'a << s' causes bits to be lost when stored in *d. -+ * - 's' is garbage (e.g. negative) or so large that the result of -+ * 'a << s' is guaranteed to be 0. -+ * - 'a' is negative. -+ * - 'a << s' sets the sign bit, if any, in '*d'. -+ * -+ * '*d' will hold the results of the attempted shift, but is not -+ * considered "safe for use" if false is returned. -+ */ -+#define check_shl_overflow(a, s, d) ({ \ -+ typeof(a) _a = a; \ -+ typeof(s) _s = s; \ -+ typeof(d) _d = d; \ -+ u64 _a_full = _a; \ -+ unsigned int _to_shift = \ -+ is_non_negative(_s) && _s < 8 * sizeof(*d) ? _s : 0; \ -+ *_d = (_a_full << _to_shift); \ -+ (_to_shift != _s || is_negative(*_d) || is_negative(_a) || \ -+ (*_d >> _to_shift) != _a); \ -+}) -+ -+/** -+ * array_size() - Calculate size of 2-dimensional array. -+ * -+ * @a: dimension one -+ * @b: dimension two -+ * -+ * Calculates size of 2-dimensional array: @a * @b. -+ * -+ * Returns: number of bytes needed to represent the array or SIZE_MAX on -+ * overflow. -+ */ -+static inline __must_check size_t array_size(size_t a, size_t b) -+{ -+ size_t bytes; -+ -+ if (check_mul_overflow(a, b, &bytes)) -+ return SIZE_MAX; -+ -+ return bytes; -+} -+ -+/** -+ * array3_size() - Calculate size of 3-dimensional array. -+ * -+ * @a: dimension one -+ * @b: dimension two -+ * @c: dimension three -+ * -+ * Calculates size of 3-dimensional array: @a * @b * @c. -+ * -+ * Returns: number of bytes needed to represent the array or SIZE_MAX on -+ * overflow. -+ */ -+static inline __must_check size_t array3_size(size_t a, size_t b, size_t c) -+{ -+ size_t bytes; -+ -+ if (check_mul_overflow(a, b, &bytes)) -+ return SIZE_MAX; -+ if (check_mul_overflow(bytes, c, &bytes)) -+ return SIZE_MAX; -+ -+ return bytes; -+} -+ -+/* -+ * Compute a*b+c, returning SIZE_MAX on overflow. Internal helper for -+ * struct_size() below. -+ */ -+static inline __must_check size_t __ab_c_size(size_t a, size_t b, size_t c) -+{ -+ size_t bytes; -+ -+ if (check_mul_overflow(a, b, &bytes)) -+ return SIZE_MAX; -+ if (check_add_overflow(bytes, c, &bytes)) -+ return SIZE_MAX; -+ -+ return bytes; -+} -+ -+/** -+ * struct_size() - Calculate size of structure with trailing array. -+ * @p: Pointer to the structure. -+ * @member: Name of the array member. -+ * @n: Number of elements in the array. -+ * -+ * Calculates size of memory needed for structure @p followed by an -+ * array of @n @member elements. -+ * -+ * Return: number of bytes needed or SIZE_MAX on overflow. -+ */ -+#define struct_size(p, member, n) \ -+ __ab_c_size(n, \ -+ sizeof(*(p)->member) + __must_be_array((p)->member),\ -+ sizeof(*(p))) -+ -+#endif /* __LINUX_OVERFLOW_H */ ---- a/net/core/filter.c -+++ b/net/core/filter.c -@@ -1,3 +1,4 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later - /* - * Linux Socket Filter - Kernel level socket filtering - * -@@ -12,11 +13,6 @@ - * Alexei Starovoitov - * Daniel Borkmann - * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * as published by the Free Software Foundation; either version -- * 2 of the License, or (at your option) any later version. -- * - * Andi Kleen - Fix a few bad bugs and races. - * Kris Katterjohn - Added many additional checks in bpf_check_classic() - */ -@@ -26,11 +22,14 @@ - #include - #include - #include -+#include - #include - #include - #include - #include -+#include - #include -+#include - #include - #include - #include -@@ -39,17 +38,32 @@ - #include - #include - #include --#include -+#include - #include -+#include - #include - #include - #include - #include - #include - #include --#include - #include - #include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - /** - * sk_filter_trim_cap - run a packet through a socket filter -@@ -84,7 +98,12 @@ int sk_filter_trim_cap(struct sock *sk, - rcu_read_lock(); - filter = rcu_dereference(sk->sk_filter); - if (filter) { -- unsigned int pkt_len = bpf_prog_run_save_cb(filter->prog, skb); -+ struct sock *save_sk = skb->sk; -+ unsigned int pkt_len; -+ -+ skb->sk = sk; -+ pkt_len = bpf_prog_run_save_cb(filter->prog, skb); -+ skb->sk = save_sk; - err = pkt_len ? pskb_trim(skb, max(cap, pkt_len)) : -EPERM; - } - rcu_read_unlock(); -@@ -93,14 +112,13 @@ int sk_filter_trim_cap(struct sock *sk, - } - EXPORT_SYMBOL(sk_filter_trim_cap); - --static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5) -+BPF_CALL_1(bpf_skb_get_pay_offset, struct sk_buff *, skb) - { -- return skb_get_poff((struct sk_buff *)(unsigned long) ctx); -+ return skb_get_poff(skb); - } - --static u64 __skb_get_nlattr(u64 ctx, u64 a, u64 x, u64 r4, u64 r5) -+BPF_CALL_3(bpf_skb_get_nlattr, struct sk_buff *, skb, u32, a, u32, x) - { -- struct sk_buff *skb = (struct sk_buff *)(unsigned long) ctx; - struct nlattr *nla; - - if (skb_is_nonlinear(skb)) -@@ -119,9 +137,8 @@ static u64 __skb_get_nlattr(u64 ctx, u64 - return 0; - } - --static u64 __skb_get_nlattr_nest(u64 ctx, u64 a, u64 x, u64 r4, u64 r5) -+BPF_CALL_3(bpf_skb_get_nlattr_nest, struct sk_buff *, skb, u32, a, u32, x) - { -- struct sk_buff *skb = (struct sk_buff *)(unsigned long) ctx; - struct nlattr *nla; - - if (skb_is_nonlinear(skb)) -@@ -144,11 +161,98 @@ static u64 __skb_get_nlattr_nest(u64 ctx - return 0; - } - --static u64 __get_raw_cpu_id(u64 ctx, u64 a, u64 x, u64 r4, u64 r5) -+BPF_CALL_4(bpf_skb_load_helper_8, const struct sk_buff *, skb, const void *, -+ data, int, headlen, int, offset) -+{ -+ u8 tmp, *ptr; -+ const int len = sizeof(tmp); -+ -+ if (offset >= 0) { -+ if (headlen - offset >= len) -+ return *(u8 *)(data + offset); -+ if (!skb_copy_bits(skb, offset, &tmp, sizeof(tmp))) -+ return tmp; -+ } else { -+ ptr = bpf_internal_load_pointer_neg_helper(skb, offset, len); -+ if (likely(ptr)) -+ return *(u8 *)ptr; -+ } -+ -+ return -EFAULT; -+} -+ -+BPF_CALL_2(bpf_skb_load_helper_8_no_cache, const struct sk_buff *, skb, -+ int, offset) -+{ -+ return ____bpf_skb_load_helper_8(skb, skb->data, skb->len - skb->data_len, -+ offset); -+} -+ -+BPF_CALL_4(bpf_skb_load_helper_16, const struct sk_buff *, skb, const void *, -+ data, int, headlen, int, offset) -+{ -+ u16 tmp, *ptr; -+ const int len = sizeof(tmp); -+ -+ if (offset >= 0) { -+ if (headlen - offset >= len) -+ return get_unaligned_be16(data + offset); -+ if (!skb_copy_bits(skb, offset, &tmp, sizeof(tmp))) -+ return be16_to_cpu(tmp); -+ } else { -+ ptr = bpf_internal_load_pointer_neg_helper(skb, offset, len); -+ if (likely(ptr)) -+ return get_unaligned_be16(ptr); -+ } -+ -+ return -EFAULT; -+} -+ -+BPF_CALL_2(bpf_skb_load_helper_16_no_cache, const struct sk_buff *, skb, -+ int, offset) -+{ -+ return ____bpf_skb_load_helper_16(skb, skb->data, skb->len - skb->data_len, -+ offset); -+} -+ -+BPF_CALL_4(bpf_skb_load_helper_32, const struct sk_buff *, skb, const void *, -+ data, int, headlen, int, offset) -+{ -+ u32 tmp, *ptr; -+ const int len = sizeof(tmp); -+ -+ if (likely(offset >= 0)) { -+ if (headlen - offset >= len) -+ return get_unaligned_be32(data + offset); -+ if (!skb_copy_bits(skb, offset, &tmp, sizeof(tmp))) -+ return be32_to_cpu(tmp); -+ } else { -+ ptr = bpf_internal_load_pointer_neg_helper(skb, offset, len); -+ if (likely(ptr)) -+ return get_unaligned_be32(ptr); -+ } -+ -+ return -EFAULT; -+} -+ -+BPF_CALL_2(bpf_skb_load_helper_32_no_cache, const struct sk_buff *, skb, -+ int, offset) -+{ -+ return ____bpf_skb_load_helper_32(skb, skb->data, skb->len - skb->data_len, -+ offset); -+} -+ -+BPF_CALL_0(bpf_get_raw_cpu_id) - { - return raw_smp_processor_id(); - } - -+static const struct bpf_func_proto bpf_get_raw_smp_processor_id_proto = { -+ .func = bpf_get_raw_cpu_id, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+}; -+ - static u32 convert_skb_access(int skb_field, int dst_reg, int src_reg, - struct bpf_insn *insn_buf) - { -@@ -178,22 +282,18 @@ static u32 convert_skb_access(int skb_fi - break; - - case SKF_AD_VLAN_TAG: -- case SKF_AD_VLAN_TAG_PRESENT: - BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2); -- BUILD_BUG_ON(VLAN_TAG_PRESENT != 0x1000); - - /* dst_reg = *(u16 *) (src_reg + offsetof(vlan_tci)) */ - *insn++ = BPF_LDX_MEM(BPF_H, dst_reg, src_reg, - offsetof(struct sk_buff, vlan_tci)); -- if (skb_field == SKF_AD_VLAN_TAG) { -- *insn++ = BPF_ALU32_IMM(BPF_AND, dst_reg, -- ~VLAN_TAG_PRESENT); -- } else { -- /* dst_reg >>= 12 */ -- *insn++ = BPF_ALU32_IMM(BPF_RSH, dst_reg, 12); -- /* dst_reg &= 1 */ -+ break; -+ case SKF_AD_VLAN_TAG_PRESENT: -+ *insn++ = BPF_LDX_MEM(BPF_B, dst_reg, src_reg, PKT_VLAN_PRESENT_OFFSET()); -+ if (PKT_VLAN_PRESENT_BIT) -+ *insn++ = BPF_ALU32_IMM(BPF_RSH, dst_reg, PKT_VLAN_PRESENT_BIT); -+ if (PKT_VLAN_PRESENT_BIT < 7) - *insn++ = BPF_ALU32_IMM(BPF_AND, dst_reg, 1); -- } - break; - } - -@@ -226,9 +326,8 @@ static bool convert_bpf_extensions(struc - case SKF_AD_OFF + SKF_AD_HATYPE: - BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, ifindex) != 4); - BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, type) != 2); -- BUILD_BUG_ON(bytes_to_bpf_size(FIELD_SIZEOF(struct sk_buff, dev)) < 0); - -- *insn++ = BPF_LDX_MEM(bytes_to_bpf_size(FIELD_SIZEOF(struct sk_buff, dev)), -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, dev), - BPF_REG_TMP, BPF_REG_CTX, - offsetof(struct sk_buff, dev)); - /* if (tmp != 0) goto pc + 1 */ -@@ -295,16 +394,16 @@ static bool convert_bpf_extensions(struc - /* Emit call(arg1=CTX, arg2=A, arg3=X) */ - switch (fp->k) { - case SKF_AD_OFF + SKF_AD_PAY_OFFSET: -- *insn = BPF_EMIT_CALL(__skb_get_pay_offset); -+ *insn = BPF_EMIT_CALL(bpf_skb_get_pay_offset); - break; - case SKF_AD_OFF + SKF_AD_NLATTR: -- *insn = BPF_EMIT_CALL(__skb_get_nlattr); -+ *insn = BPF_EMIT_CALL(bpf_skb_get_nlattr); - break; - case SKF_AD_OFF + SKF_AD_NLATTR_NEST: -- *insn = BPF_EMIT_CALL(__skb_get_nlattr_nest); -+ *insn = BPF_EMIT_CALL(bpf_skb_get_nlattr_nest); - break; - case SKF_AD_OFF + SKF_AD_CPU: -- *insn = BPF_EMIT_CALL(__get_raw_cpu_id); -+ *insn = BPF_EMIT_CALL(bpf_get_raw_cpu_id); - break; - case SKF_AD_OFF + SKF_AD_RANDOM: - *insn = BPF_EMIT_CALL(bpf_user_rnd_u32); -@@ -331,35 +430,101 @@ static bool convert_bpf_extensions(struc - return true; - } - -+static bool convert_bpf_ld_abs(struct sock_filter *fp, struct bpf_insn **insnp) -+{ -+ const bool unaligned_ok = IS_BUILTIN(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS); -+ int size = bpf_size_to_bytes(BPF_SIZE(fp->code)); -+ bool endian = BPF_SIZE(fp->code) == BPF_H || -+ BPF_SIZE(fp->code) == BPF_W; -+ bool indirect = BPF_MODE(fp->code) == BPF_IND; -+ const int ip_align = NET_IP_ALIGN; -+ struct bpf_insn *insn = *insnp; -+ int offset = fp->k; -+ -+ if (!indirect && -+ ((unaligned_ok && offset >= 0) || -+ (!unaligned_ok && offset >= 0 && -+ offset + ip_align >= 0 && -+ offset + ip_align % size == 0))) { -+ bool ldx_off_ok = offset <= S16_MAX; -+ -+ *insn++ = BPF_MOV64_REG(BPF_REG_TMP, BPF_REG_H); -+ if (offset) -+ *insn++ = BPF_ALU64_IMM(BPF_SUB, BPF_REG_TMP, offset); -+ *insn++ = BPF_JMP_IMM(BPF_JSLT, BPF_REG_TMP, -+ size, 2 + endian + (!ldx_off_ok * 2)); -+ if (ldx_off_ok) { -+ *insn++ = BPF_LDX_MEM(BPF_SIZE(fp->code), BPF_REG_A, -+ BPF_REG_D, offset); -+ } else { -+ *insn++ = BPF_MOV64_REG(BPF_REG_TMP, BPF_REG_D); -+ *insn++ = BPF_ALU64_IMM(BPF_ADD, BPF_REG_TMP, offset); -+ *insn++ = BPF_LDX_MEM(BPF_SIZE(fp->code), BPF_REG_A, -+ BPF_REG_TMP, 0); -+ } -+ if (endian) -+ *insn++ = BPF_ENDIAN(BPF_FROM_BE, BPF_REG_A, size * 8); -+ *insn++ = BPF_JMP_A(8); -+ } -+ -+ *insn++ = BPF_MOV64_REG(BPF_REG_ARG1, BPF_REG_CTX); -+ *insn++ = BPF_MOV64_REG(BPF_REG_ARG2, BPF_REG_D); -+ *insn++ = BPF_MOV64_REG(BPF_REG_ARG3, BPF_REG_H); -+ if (!indirect) { -+ *insn++ = BPF_MOV64_IMM(BPF_REG_ARG4, offset); -+ } else { -+ *insn++ = BPF_MOV64_REG(BPF_REG_ARG4, BPF_REG_X); -+ if (fp->k) -+ *insn++ = BPF_ALU64_IMM(BPF_ADD, BPF_REG_ARG4, offset); -+ } -+ -+ switch (BPF_SIZE(fp->code)) { -+ case BPF_B: -+ *insn++ = BPF_EMIT_CALL(bpf_skb_load_helper_8); -+ break; -+ case BPF_H: -+ *insn++ = BPF_EMIT_CALL(bpf_skb_load_helper_16); -+ break; -+ case BPF_W: -+ *insn++ = BPF_EMIT_CALL(bpf_skb_load_helper_32); -+ break; -+ default: -+ return false; -+ } -+ -+ *insn++ = BPF_JMP_IMM(BPF_JSGE, BPF_REG_A, 0, 2); -+ *insn++ = BPF_ALU32_REG(BPF_XOR, BPF_REG_A, BPF_REG_A); -+ *insn = BPF_EXIT_INSN(); -+ -+ *insnp = insn; -+ return true; -+} -+ - /** - * bpf_convert_filter - convert filter program - * @prog: the user passed filter program - * @len: the length of the user passed filter program -- * @new_prog: buffer where converted program will be stored -+ * @new_prog: allocated 'struct bpf_prog' or NULL - * @new_len: pointer to store length of converted program -+ * @seen_ld_abs: bool whether we've seen ld_abs/ind - * -- * Remap 'sock_filter' style BPF instruction set to 'sock_filter_ext' style. -+ * Remap 'sock_filter' style classic BPF (cBPF) instruction set to 'bpf_insn' -+ * style extended BPF (eBPF). - * Conversion workflow: - * - * 1) First pass for calculating the new program length: -- * bpf_convert_filter(old_prog, old_len, NULL, &new_len) -+ * bpf_convert_filter(old_prog, old_len, NULL, &new_len, &seen_ld_abs) - * - * 2) 2nd pass to remap in two passes: 1st pass finds new - * jump offsets, 2nd pass remapping: -- * new_prog = kmalloc(sizeof(struct bpf_insn) * new_len); -- * bpf_convert_filter(old_prog, old_len, new_prog, &new_len); -- * -- * User BPF's register A is mapped to our BPF register 6, user BPF -- * register X is mapped to BPF register 7; frame pointer is always -- * register 10; Context 'void *ctx' is stored in register 1, that is, -- * for socket filters: ctx == 'struct sk_buff *', for seccomp: -- * ctx == 'struct seccomp_data *'. -+ * bpf_convert_filter(old_prog, old_len, new_prog, &new_len, &seen_ld_abs) - */ - static int bpf_convert_filter(struct sock_filter *prog, int len, -- struct bpf_insn *new_prog, int *new_len) -+ struct bpf_prog *new_prog, int *new_len, -+ bool *seen_ld_abs) - { -- int new_flen = 0, pass = 0, target, i; -- struct bpf_insn *new_insn; -+ int new_flen = 0, pass = 0, target, i, stack_off; -+ struct bpf_insn *new_insn, *first_insn = NULL; - struct sock_filter *fp; - int *addrs = NULL; - u8 bpf_src; -@@ -371,6 +536,7 @@ static int bpf_convert_filter(struct soc - return -EINVAL; - - if (new_prog) { -+ first_insn = new_prog->insnsi; - addrs = kcalloc(len, sizeof(*addrs), - GFP_KERNEL | __GFP_NOWARN); - if (!addrs) -@@ -378,19 +544,47 @@ static int bpf_convert_filter(struct soc - } - - do_pass: -- new_insn = new_prog; -+ new_insn = first_insn; - fp = prog; - -- if (new_insn) -- *new_insn = BPF_MOV64_REG(BPF_REG_CTX, BPF_REG_ARG1); -- new_insn++; -+ /* Classic BPF related prologue emission. */ -+ if (new_prog) { -+ /* Classic BPF expects A and X to be reset first. These need -+ * to be guaranteed to be the first two instructions. -+ */ -+ *new_insn++ = BPF_ALU32_REG(BPF_XOR, BPF_REG_A, BPF_REG_A); -+ *new_insn++ = BPF_ALU32_REG(BPF_XOR, BPF_REG_X, BPF_REG_X); -+ -+ /* All programs must keep CTX in callee saved BPF_REG_CTX. -+ * In eBPF case it's done by the compiler, here we need to -+ * do this ourself. Initial CTX is present in BPF_REG_ARG1. -+ */ -+ *new_insn++ = BPF_MOV64_REG(BPF_REG_CTX, BPF_REG_ARG1); -+ if (*seen_ld_abs) { -+ /* For packet access in classic BPF, cache skb->data -+ * in callee-saved BPF R8 and skb->len - skb->data_len -+ * (headlen) in BPF R9. Since classic BPF is read-only -+ * on CTX, we only need to cache it once. -+ */ -+ *new_insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, data), -+ BPF_REG_D, BPF_REG_CTX, -+ offsetof(struct sk_buff, data)); -+ *new_insn++ = BPF_LDX_MEM(BPF_W, BPF_REG_H, BPF_REG_CTX, -+ offsetof(struct sk_buff, len)); -+ *new_insn++ = BPF_LDX_MEM(BPF_W, BPF_REG_TMP, BPF_REG_CTX, -+ offsetof(struct sk_buff, data_len)); -+ *new_insn++ = BPF_ALU32_REG(BPF_SUB, BPF_REG_H, BPF_REG_TMP); -+ } -+ } else { -+ new_insn += 3; -+ } - - for (i = 0; i < len; fp++, i++) { -- struct bpf_insn tmp_insns[6] = { }; -+ struct bpf_insn tmp_insns[32] = { }; - struct bpf_insn *insn = tmp_insns; - - if (addrs) -- addrs[i] = new_insn - new_prog; -+ addrs[i] = new_insn - first_insn; - - switch (fp->code) { - /* All arithmetic insns and skb loads map as-is. */ -@@ -429,6 +623,22 @@ do_pass: - BPF_MODE(fp->code) == BPF_ABS && - convert_bpf_extensions(fp, &insn)) - break; -+ if (BPF_CLASS(fp->code) == BPF_LD && -+ convert_bpf_ld_abs(fp, &insn)) { -+ *seen_ld_abs = true; -+ break; -+ } -+ -+ if (fp->code == (BPF_ALU | BPF_DIV | BPF_X) || -+ fp->code == (BPF_ALU | BPF_MOD | BPF_X)) { -+ *insn++ = BPF_MOV32_REG(BPF_REG_X, BPF_REG_X); -+ /* Error with exception code on div/mod by 0. -+ * For cBPF programs, this was always return 0. -+ */ -+ *insn++ = BPF_JMP_IMM(BPF_JNE, BPF_REG_X, 0, 2); -+ *insn++ = BPF_ALU32_REG(BPF_XOR, BPF_REG_A, BPF_REG_A); -+ *insn++ = BPF_EXIT_INSN(); -+ } - - *insn = BPF_RAW_INSN(fp->code, BPF_REG_A, BPF_REG_X, 0, fp->k); - break; -@@ -441,11 +651,18 @@ do_pass: - - #define BPF_EMIT_JMP \ - do { \ -+ const s32 off_min = S16_MIN, off_max = S16_MAX; \ -+ s32 off; \ -+ \ - if (target >= len || target < 0) \ - goto err; \ -- insn->off = addrs ? addrs[target] - addrs[i] - 1 : 0; \ -+ off = addrs ? addrs[target] - addrs[i] - 1 : 0; \ - /* Adjust pc relative offset for 2nd or 3rd insn. */ \ -- insn->off -= insn - tmp_insns; \ -+ off -= insn - tmp_insns; \ -+ /* Reject anything not fitting into insn->off. */ \ -+ if (off < off_min || off > off_max) \ -+ goto err; \ -+ insn->off = off; \ - } while (0) - - case BPF_JMP | BPF_JA: -@@ -487,14 +704,27 @@ do_pass: - break; - } - -- /* Convert JEQ into JNE when 'jump_true' is next insn. */ -- if (fp->jt == 0 && BPF_OP(fp->code) == BPF_JEQ) { -- insn->code = BPF_JMP | BPF_JNE | bpf_src; -+ /* Convert some jumps when 'jump_true' is next insn. */ -+ if (fp->jt == 0) { -+ switch (BPF_OP(fp->code)) { -+ case BPF_JEQ: -+ insn->code = BPF_JMP | BPF_JNE | bpf_src; -+ break; -+ case BPF_JGT: -+ insn->code = BPF_JMP | BPF_JLE | bpf_src; -+ break; -+ case BPF_JGE: -+ insn->code = BPF_JMP | BPF_JLT | bpf_src; -+ break; -+ default: -+ goto jmp_rest; -+ } -+ - target = i + fp->jf + 1; - BPF_EMIT_JMP; - break; - } -- -+jmp_rest: - /* Other jumps are mapped into two insns: Jxx and JA. */ - target = i + fp->jt + 1; - insn->code = BPF_JMP | BPF_OP(fp->code) | bpf_src; -@@ -507,44 +737,64 @@ do_pass: - break; - - /* ldxb 4 * ([14] & 0xf) is remaped into 6 insns. */ -- case BPF_LDX | BPF_MSH | BPF_B: -- /* tmp = A */ -- *insn++ = BPF_MOV64_REG(BPF_REG_TMP, BPF_REG_A); -+ case BPF_LDX | BPF_MSH | BPF_B: { -+ struct sock_filter tmp = { -+ .code = BPF_LD | BPF_ABS | BPF_B, -+ .k = fp->k, -+ }; -+ -+ *seen_ld_abs = true; -+ -+ /* X = A */ -+ *insn++ = BPF_MOV64_REG(BPF_REG_X, BPF_REG_A); - /* A = BPF_R0 = *(u8 *) (skb->data + K) */ -- *insn++ = BPF_LD_ABS(BPF_B, fp->k); -+ convert_bpf_ld_abs(&tmp, &insn); -+ insn++; - /* A &= 0xf */ - *insn++ = BPF_ALU32_IMM(BPF_AND, BPF_REG_A, 0xf); - /* A <<= 2 */ - *insn++ = BPF_ALU32_IMM(BPF_LSH, BPF_REG_A, 2); -+ /* tmp = X */ -+ *insn++ = BPF_MOV64_REG(BPF_REG_TMP, BPF_REG_X); - /* X = A */ - *insn++ = BPF_MOV64_REG(BPF_REG_X, BPF_REG_A); - /* A = tmp */ - *insn = BPF_MOV64_REG(BPF_REG_A, BPF_REG_TMP); - break; -- -- /* RET_K, RET_A are remaped into 2 insns. */ -+ } -+ /* RET_K is remaped into 2 insns. RET_A case doesn't need an -+ * extra mov as BPF_REG_0 is already mapped into BPF_REG_A. -+ */ - case BPF_RET | BPF_A: - case BPF_RET | BPF_K: -- *insn++ = BPF_MOV32_RAW(BPF_RVAL(fp->code) == BPF_K ? -- BPF_K : BPF_X, BPF_REG_0, -- BPF_REG_A, fp->k); -+ if (BPF_RVAL(fp->code) == BPF_K) -+ *insn++ = BPF_MOV32_RAW(BPF_K, BPF_REG_0, -+ 0, fp->k); - *insn = BPF_EXIT_INSN(); - break; - - /* Store to stack. */ - case BPF_ST: - case BPF_STX: -+ stack_off = fp->k * 4 + 4; - *insn = BPF_STX_MEM(BPF_W, BPF_REG_FP, BPF_CLASS(fp->code) == - BPF_ST ? BPF_REG_A : BPF_REG_X, -- -(BPF_MEMWORDS - fp->k) * 4); -+ -stack_off); -+ /* check_load_and_stores() verifies that classic BPF can -+ * load from stack only after write, so tracking -+ * stack_depth for ST|STX insns is enough -+ */ -+ if (new_prog && new_prog->aux->stack_depth < stack_off) -+ new_prog->aux->stack_depth = stack_off; - break; - - /* Load from stack. */ - case BPF_LD | BPF_MEM: - case BPF_LDX | BPF_MEM: -+ stack_off = fp->k * 4 + 4; - *insn = BPF_LDX_MEM(BPF_W, BPF_CLASS(fp->code) == BPF_LD ? - BPF_REG_A : BPF_REG_X, BPF_REG_FP, -- -(BPF_MEMWORDS - fp->k) * 4); -+ -stack_off); - break; - - /* A = K or X = K */ -@@ -592,13 +842,15 @@ do_pass: - - if (!new_prog) { - /* Only calculating new length. */ -- *new_len = new_insn - new_prog; -+ *new_len = new_insn - first_insn; -+ if (*seen_ld_abs) -+ *new_len += 4; /* Prologue bits. */ - return 0; - } - - pass++; -- if (new_flen != new_insn - new_prog) { -- new_flen = new_insn - new_prog; -+ if (new_flen != new_insn - first_insn) { -+ new_flen = new_insn - first_insn; - if (pass > 2) - goto err; - goto do_pass; -@@ -738,6 +990,17 @@ static bool chk_code_allowed(u16 code_to - return codes[code_to_probe]; - } - -+static bool bpf_check_basics_ok(const struct sock_filter *filter, -+ unsigned int flen) -+{ -+ if (filter == NULL) -+ return false; -+ if (flen == 0 || flen > BPF_MAXINSNS) -+ return false; -+ -+ return true; -+} -+ - /** - * bpf_check_classic - verify socket filter code - * @filter: filter to verify -@@ -758,9 +1021,6 @@ static int bpf_check_classic(const struc - bool anc_found; - int pc; - -- if (flen == 0 || flen > BPF_MAXINSNS) -- return -EINVAL; -- - /* Check the filter code now */ - for (pc = 0; pc < flen; pc++) { - const struct sock_filter *ftest = &filter[pc]; -@@ -901,7 +1161,7 @@ static void sk_filter_release_rcu(struct - */ - static void sk_filter_release(struct sk_filter *fp) - { -- if (atomic_dec_and_test(&fp->refcnt)) -+ if (refcount_dec_and_test(&fp->refcnt)) - call_rcu(&fp->rcu, sk_filter_release_rcu); - } - -@@ -916,25 +1176,37 @@ void sk_filter_uncharge(struct sock *sk, - /* try to charge the socket memory if there is space available - * return true on success - */ --bool sk_filter_charge(struct sock *sk, struct sk_filter *fp) -+static bool __sk_filter_charge(struct sock *sk, struct sk_filter *fp) - { - u32 filter_size = bpf_prog_size(fp->prog->len); - - /* same check as in sock_kmalloc() */ - if (filter_size <= sysctl_optmem_max && - atomic_read(&sk->sk_omem_alloc) + filter_size < sysctl_optmem_max) { -- atomic_inc(&fp->refcnt); - atomic_add(filter_size, &sk->sk_omem_alloc); - return true; - } - return false; - } - -+bool sk_filter_charge(struct sock *sk, struct sk_filter *fp) -+{ -+ if (!refcount_inc_not_zero(&fp->refcnt)) -+ return false; -+ -+ if (!__sk_filter_charge(sk, fp)) { -+ sk_filter_release(fp); -+ return false; -+ } -+ return true; -+} -+ - static struct bpf_prog *bpf_migrate_filter(struct bpf_prog *fp) - { - struct sock_filter *old_prog; - struct bpf_prog *old_fp; - int err, new_len, old_len = fp->len; -+ bool seen_ld_abs = false; - - /* We are free to overwrite insns et al right here as it - * won't be used at this point in time anymore internally -@@ -956,7 +1228,8 @@ static struct bpf_prog *bpf_migrate_filt - } - - /* 1st pass: calculate the new program length. */ -- err = bpf_convert_filter(old_prog, old_len, NULL, &new_len); -+ err = bpf_convert_filter(old_prog, old_len, NULL, &new_len, -+ &seen_ld_abs); - if (err) - goto out_err_free; - -@@ -975,7 +1248,8 @@ static struct bpf_prog *bpf_migrate_filt - fp->len = new_len; - - /* 2nd pass: remap sock_filter insns into bpf_insn insns. */ -- err = bpf_convert_filter(old_prog, old_len, fp->insnsi, &new_len); -+ err = bpf_convert_filter(old_prog, old_len, fp, &new_len, -+ &seen_ld_abs); - if (err) - /* 2nd bpf_convert_filter() can fail only if it fails - * to allocate memory, remapping must succeed. Note, -@@ -984,7 +1258,9 @@ static struct bpf_prog *bpf_migrate_filt - */ - goto out_err_free; - -- bpf_prog_select_runtime(fp); -+ fp = bpf_prog_select_runtime(fp, &err); -+ if (err) -+ goto out_err_free; - - kfree(old_prog); - return fp; -@@ -1051,7 +1327,7 @@ int bpf_prog_create(struct bpf_prog **pf - struct bpf_prog *fp; - - /* Make sure new filter is there and in the right amounts. */ -- if (fprog->filter == NULL) -+ if (!bpf_check_basics_ok(fprog->filter, fprog->len)) - return -EINVAL; - - fp = bpf_prog_alloc(bpf_prog_size(fprog->len), 0); -@@ -1098,7 +1374,7 @@ int bpf_prog_create_from_user(struct bpf - int err; - - /* Make sure new filter is there and in the right amounts. */ -- if (fprog->filter == NULL) -+ if (!bpf_check_basics_ok(fprog->filter, fprog->len)) - return -EINVAL; - - fp = bpf_prog_alloc(bpf_prog_size(fprog->len), 0); -@@ -1139,8 +1415,7 @@ void bpf_prog_destroy(struct bpf_prog *f - } - EXPORT_SYMBOL_GPL(bpf_prog_destroy); - --static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk, -- bool locked) -+static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk) - { - struct sk_filter *fp, *old_fp; - -@@ -1149,53 +1424,44 @@ static int __sk_attach_prog(struct bpf_p - return -ENOMEM; - - fp->prog = prog; -- atomic_set(&fp->refcnt, 0); - -- if (!sk_filter_charge(sk, fp)) { -+ if (!__sk_filter_charge(sk, fp)) { - kfree(fp); - return -ENOMEM; - } -+ refcount_set(&fp->refcnt, 1); - -- old_fp = rcu_dereference_protected(sk->sk_filter, locked); -+ old_fp = rcu_dereference_protected(sk->sk_filter, -+ lockdep_sock_is_held(sk)); - rcu_assign_pointer(sk->sk_filter, fp); -+ - if (old_fp) - sk_filter_uncharge(sk, old_fp); - - return 0; - } - --/** -- * sk_attach_filter - attach a socket filter -- * @fprog: the filter program -- * @sk: the socket to use -- * -- * Attach the user's filter code. We first run some sanity checks on -- * it to make sure it does not explode on us later. If an error -- * occurs or there is insufficient memory for the filter a negative -- * errno code is returned. On success the return is zero. -- */ --int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk, -- bool locked) -+static -+struct bpf_prog *__get_filter(struct sock_fprog *fprog, struct sock *sk) - { - unsigned int fsize = bpf_classic_proglen(fprog); -- unsigned int bpf_fsize = bpf_prog_size(fprog->len); - struct bpf_prog *prog; - int err; - - if (sock_flag(sk, SOCK_FILTER_LOCKED)) -- return -EPERM; -+ return ERR_PTR(-EPERM); - - /* Make sure new filter is there and in the right amounts. */ -- if (fprog->filter == NULL) -- return -EINVAL; -+ if (!bpf_check_basics_ok(fprog->filter, fprog->len)) -+ return ERR_PTR(-EINVAL); - -- prog = bpf_prog_alloc(bpf_fsize, 0); -+ prog = bpf_prog_alloc(bpf_prog_size(fprog->len), 0); - if (!prog) -- return -ENOMEM; -+ return ERR_PTR(-ENOMEM); - - if (copy_from_user(prog->insns, fprog->filter, fsize)) { - __bpf_prog_free(prog); -- return -EFAULT; -+ return ERR_PTR(-EINVAL); - } - - prog->len = fprog->len; -@@ -1203,17 +1469,34 @@ int __sk_attach_filter(struct sock_fprog - err = bpf_prog_store_orig_filter(prog, fprog); - if (err) { - __bpf_prog_free(prog); -- return -ENOMEM; -+ return ERR_PTR(-ENOMEM); - } - - /* bpf_prepare_filter() already takes care of freeing - * memory in case something goes wrong. - */ -- prog = bpf_prepare_filter(prog, NULL); -+ return bpf_prepare_filter(prog, NULL); -+} -+ -+/** -+ * sk_attach_filter - attach a socket filter -+ * @fprog: the filter program -+ * @sk: the socket to use -+ * -+ * Attach the user's filter code. We first run some sanity checks on -+ * it to make sure it does not explode on us later. If an error -+ * occurs or there is insufficient memory for the filter a negative -+ * errno code is returned. On success the return is zero. -+ */ -+int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) -+{ -+ struct bpf_prog *prog = __get_filter(fprog, sk); -+ int err; -+ - if (IS_ERR(prog)) - return PTR_ERR(prog); - -- err = __sk_attach_prog(prog, sk, locked); -+ err = __sk_attach_prog(prog, sk); - if (err < 0) { - __bpf_prog_release(prog); - return err; -@@ -1221,31 +1504,25 @@ int __sk_attach_filter(struct sock_fprog - - return 0; - } --EXPORT_SYMBOL_GPL(__sk_attach_filter); -+EXPORT_SYMBOL_GPL(sk_attach_filter); - --int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) -+static struct bpf_prog *__get_bpf(u32 ufd, struct sock *sk) - { -- return __sk_attach_filter(fprog, sk, sock_owned_by_user(sk)); -+ if (sock_flag(sk, SOCK_FILTER_LOCKED)) -+ return ERR_PTR(-EPERM); -+ -+ return bpf_prog_get_type(ufd, BPF_PROG_TYPE_SOCKET_FILTER); - } - - int sk_attach_bpf(u32 ufd, struct sock *sk) - { -- struct bpf_prog *prog; -+ struct bpf_prog *prog = __get_bpf(ufd, sk); - int err; - -- if (sock_flag(sk, SOCK_FILTER_LOCKED)) -- return -EPERM; -- -- prog = bpf_prog_get(ufd); - if (IS_ERR(prog)) - return PTR_ERR(prog); - -- if (prog->type != BPF_PROG_TYPE_SOCKET_FILTER) { -- bpf_prog_put(prog); -- return -EINVAL; -- } -- -- err = __sk_attach_prog(prog, sk, sock_owned_by_user(sk)); -+ err = __sk_attach_prog(prog, sk); - if (err < 0) { - bpf_prog_put(prog); - return err; -@@ -1254,79 +1531,201 @@ int sk_attach_bpf(u32 ufd, struct sock * - return 0; - } - --#define BPF_RECOMPUTE_CSUM(flags) ((flags) & 1) -+struct bpf_scratchpad { -+ union { -+ __be32 diff[MAX_BPF_STACK / sizeof(__be32)]; -+ u8 buff[MAX_BPF_STACK]; -+ }; -+}; -+ -+static DEFINE_PER_CPU(struct bpf_scratchpad, bpf_sp); -+ -+static inline int __bpf_try_make_writable(struct sk_buff *skb, -+ unsigned int write_len) -+{ -+ return skb_ensure_writable(skb, write_len); -+} -+ -+static inline int bpf_try_make_writable(struct sk_buff *skb, -+ unsigned int write_len) -+{ -+ int err = __bpf_try_make_writable(skb, write_len); -+ -+ bpf_compute_data_pointers(skb); -+ return err; -+} -+ -+static int bpf_try_make_head_writable(struct sk_buff *skb) -+{ -+ return bpf_try_make_writable(skb, skb_headlen(skb)); -+} - --static u64 bpf_skb_store_bytes(u64 r1, u64 r2, u64 r3, u64 r4, u64 flags) -+static inline void bpf_push_mac_rcsum(struct sk_buff *skb) -+{ -+ if (skb_at_tc_ingress(skb)) -+ skb_postpush_rcsum(skb, skb_mac_header(skb), skb->mac_len); -+} -+ -+static inline void bpf_pull_mac_rcsum(struct sk_buff *skb) -+{ -+ if (skb_at_tc_ingress(skb)) -+ skb_postpull_rcsum(skb, skb_mac_header(skb), skb->mac_len); -+} -+ -+BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset, -+ const void *, from, u32, len, u64, flags) - { -- struct sk_buff *skb = (struct sk_buff *) (long) r1; -- int offset = (int) r2; -- void *from = (void *) (long) r3; -- unsigned int len = (unsigned int) r4; -- char buf[16]; - void *ptr; - -- /* bpf verifier guarantees that: -- * 'from' pointer points to bpf program stack -- * 'len' bytes of it were initialized -- * 'len' > 0 -- * 'skb' is a valid pointer to 'struct sk_buff' -- * -- * so check for invalid 'offset' and too large 'len' -- */ -- if (unlikely((u32) offset > 0xffff || len > sizeof(buf))) -+ if (unlikely(flags & ~(BPF_F_RECOMPUTE_CSUM | BPF_F_INVALIDATE_HASH))) -+ return -EINVAL; -+ if (unlikely(offset > 0xffff)) - return -EFAULT; -- if (unlikely(skb_try_make_writable(skb, offset + len))) -+ if (unlikely(bpf_try_make_writable(skb, offset + len))) - return -EFAULT; - -- ptr = skb_header_pointer(skb, offset, len, buf); -- if (unlikely(!ptr)) -- return -EFAULT; -- -- if (BPF_RECOMPUTE_CSUM(flags)) -- skb_postpull_rcsum(skb, ptr, len); -+ ptr = skb->data + offset; -+ if (flags & BPF_F_RECOMPUTE_CSUM) -+ __skb_postpull_rcsum(skb, ptr, len, offset); - - memcpy(ptr, from, len); - -- if (ptr == buf) -- /* skb_store_bits cannot return -EFAULT here */ -- skb_store_bits(skb, offset, ptr, len); -+ if (flags & BPF_F_RECOMPUTE_CSUM) -+ __skb_postpush_rcsum(skb, ptr, len, offset); -+ if (flags & BPF_F_INVALIDATE_HASH) -+ skb_clear_hash(skb); - -- if (BPF_RECOMPUTE_CSUM(flags) && skb->ip_summed == CHECKSUM_COMPLETE) -- skb->csum = csum_add(skb->csum, csum_partial(ptr, len, 0)); - return 0; - } - --const struct bpf_func_proto bpf_skb_store_bytes_proto = { -+static const struct bpf_func_proto bpf_skb_store_bytes_proto = { - .func = bpf_skb_store_bytes, - .gpl_only = false, - .ret_type = RET_INTEGER, - .arg1_type = ARG_PTR_TO_CTX, - .arg2_type = ARG_ANYTHING, -- .arg3_type = ARG_PTR_TO_STACK, -- .arg4_type = ARG_CONST_STACK_SIZE, -+ .arg3_type = ARG_PTR_TO_MEM, -+ .arg4_type = ARG_CONST_SIZE, - .arg5_type = ARG_ANYTHING, - }; - --#define BPF_HEADER_FIELD_SIZE(flags) ((flags) & 0x0f) --#define BPF_IS_PSEUDO_HEADER(flags) ((flags) & 0x10) -+BPF_CALL_4(bpf_skb_load_bytes, const struct sk_buff *, skb, u32, offset, -+ void *, to, u32, len) -+{ -+ void *ptr; -+ -+ if (unlikely(offset > 0xffff)) -+ goto err_clear; -+ -+ ptr = skb_header_pointer(skb, offset, len, to); -+ if (unlikely(!ptr)) -+ goto err_clear; -+ if (ptr != to) -+ memcpy(to, ptr, len); - --static u64 bpf_l3_csum_replace(u64 r1, u64 r2, u64 from, u64 to, u64 flags) -+ return 0; -+err_clear: -+ memset(to, 0, len); -+ return -EFAULT; -+} -+ -+static const struct bpf_func_proto bpf_skb_load_bytes_proto = { -+ .func = bpf_skb_load_bytes, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, -+ .arg3_type = ARG_PTR_TO_UNINIT_MEM, -+ .arg4_type = ARG_CONST_SIZE, -+}; -+ -+BPF_CALL_5(bpf_skb_load_bytes_relative, const struct sk_buff *, skb, -+ u32, offset, void *, to, u32, len, u32, start_header) - { -- struct sk_buff *skb = (struct sk_buff *) (long) r1; -- int offset = (int) r2; -- __sum16 sum, *ptr; -+ u8 *end = skb_tail_pointer(skb); -+ u8 *start, *ptr; - -- if (unlikely((u32) offset > 0xffff)) -- return -EFAULT; -+ if (unlikely(offset > 0xffff)) -+ goto err_clear; - -- if (unlikely(skb_try_make_writable(skb, offset + sizeof(sum)))) -- return -EFAULT; -+ switch (start_header) { -+ case BPF_HDR_START_MAC: -+ if (unlikely(!skb_mac_header_was_set(skb))) -+ goto err_clear; -+ start = skb_mac_header(skb); -+ break; -+ case BPF_HDR_START_NET: -+ start = skb_network_header(skb); -+ break; -+ default: -+ goto err_clear; -+ } - -- ptr = skb_header_pointer(skb, offset, sizeof(sum), &sum); -- if (unlikely(!ptr)) -+ ptr = start + offset; -+ -+ if (likely(ptr + len <= end)) { -+ memcpy(to, ptr, len); -+ return 0; -+ } -+ -+err_clear: -+ memset(to, 0, len); -+ return -EFAULT; -+} -+ -+static const struct bpf_func_proto bpf_skb_load_bytes_relative_proto = { -+ .func = bpf_skb_load_bytes_relative, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, -+ .arg3_type = ARG_PTR_TO_UNINIT_MEM, -+ .arg4_type = ARG_CONST_SIZE, -+ .arg5_type = ARG_ANYTHING, -+}; -+ -+BPF_CALL_2(bpf_skb_pull_data, struct sk_buff *, skb, u32, len) -+{ -+ /* Idea is the following: should the needed direct read/write -+ * test fail during runtime, we can pull in more data and redo -+ * again, since implicitly, we invalidate previous checks here. -+ * -+ * Or, since we know how much we need to make read/writeable, -+ * this can be done once at the program beginning for direct -+ * access case. By this we overcome limitations of only current -+ * headroom being accessible. -+ */ -+ return bpf_try_make_writable(skb, len ? : skb_headlen(skb)); -+} -+ -+static const struct bpf_func_proto bpf_skb_pull_data_proto = { -+ .func = bpf_skb_pull_data, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, -+}; -+ -+BPF_CALL_5(bpf_l3_csum_replace, struct sk_buff *, skb, u32, offset, -+ u64, from, u64, to, u64, flags) -+{ -+ __sum16 *ptr; -+ -+ if (unlikely(flags & ~(BPF_F_HDR_FIELD_MASK))) -+ return -EINVAL; -+ if (unlikely(offset > 0xffff || offset & 1)) -+ return -EFAULT; -+ if (unlikely(bpf_try_make_writable(skb, offset + sizeof(*ptr)))) - return -EFAULT; - -- switch (BPF_HEADER_FIELD_SIZE(flags)) { -+ ptr = (__sum16 *)(skb->data + offset); -+ switch (flags & BPF_F_HDR_FIELD_MASK) { -+ case 0: -+ if (unlikely(from != 0)) -+ return -EINVAL; -+ -+ csum_replace_by_diff(ptr, to); -+ break; - case 2: - csum_replace2(ptr, from, to); - break; -@@ -1337,14 +1736,10 @@ static u64 bpf_l3_csum_replace(u64 r1, u - return -EINVAL; - } - -- if (ptr == &sum) -- /* skb_store_bits guaranteed to not return -EFAULT here */ -- skb_store_bits(skb, offset, ptr, sizeof(sum)); -- - return 0; - } - --const struct bpf_func_proto bpf_l3_csum_replace_proto = { -+static const struct bpf_func_proto bpf_l3_csum_replace_proto = { - .func = bpf_l3_csum_replace, - .gpl_only = false, - .ret_type = RET_INTEGER, -@@ -1355,23 +1750,33 @@ const struct bpf_func_proto bpf_l3_csum_ - .arg5_type = ARG_ANYTHING, - }; - --static u64 bpf_l4_csum_replace(u64 r1, u64 r2, u64 from, u64 to, u64 flags) -+BPF_CALL_5(bpf_l4_csum_replace, struct sk_buff *, skb, u32, offset, -+ u64, from, u64, to, u64, flags) - { -- struct sk_buff *skb = (struct sk_buff *) (long) r1; -- bool is_pseudo = !!BPF_IS_PSEUDO_HEADER(flags); -- int offset = (int) r2; -- __sum16 sum, *ptr; -+ bool is_pseudo = flags & BPF_F_PSEUDO_HDR; -+ bool is_mmzero = flags & BPF_F_MARK_MANGLED_0; -+ bool do_mforce = flags & BPF_F_MARK_ENFORCE; -+ __sum16 *ptr; - -- if (unlikely((u32) offset > 0xffff)) -+ if (unlikely(flags & ~(BPF_F_MARK_MANGLED_0 | BPF_F_MARK_ENFORCE | -+ BPF_F_PSEUDO_HDR | BPF_F_HDR_FIELD_MASK))) -+ return -EINVAL; -+ if (unlikely(offset > 0xffff || offset & 1)) - return -EFAULT; -- if (unlikely(skb_try_make_writable(skb, offset + sizeof(sum)))) -+ if (unlikely(bpf_try_make_writable(skb, offset + sizeof(*ptr)))) - return -EFAULT; - -- ptr = skb_header_pointer(skb, offset, sizeof(sum), &sum); -- if (unlikely(!ptr)) -- return -EFAULT; -+ ptr = (__sum16 *)(skb->data + offset); -+ if (is_mmzero && !do_mforce && !*ptr) -+ return 0; - -- switch (BPF_HEADER_FIELD_SIZE(flags)) { -+ switch (flags & BPF_F_HDR_FIELD_MASK) { -+ case 0: -+ if (unlikely(from != 0)) -+ return -EINVAL; -+ -+ inet_proto_csum_replace_by_diff(ptr, skb, to, is_pseudo); -+ break; - case 2: - inet_proto_csum_replace2(ptr, skb, from, to, is_pseudo); - break; -@@ -1382,14 +1787,12 @@ static u64 bpf_l4_csum_replace(u64 r1, u - return -EINVAL; - } - -- if (ptr == &sum) -- /* skb_store_bits guaranteed to not return -EFAULT here */ -- skb_store_bits(skb, offset, ptr, sizeof(sum)); -- -+ if (is_mmzero && !*ptr) -+ *ptr = CSUM_MANGLED_0; - return 0; - } - --const struct bpf_func_proto bpf_l4_csum_replace_proto = { -+static const struct bpf_func_proto bpf_l4_csum_replace_proto = { - .func = bpf_l4_csum_replace, - .gpl_only = false, - .ret_type = RET_INTEGER, -@@ -1400,30 +1803,172 @@ const struct bpf_func_proto bpf_l4_csum_ - .arg5_type = ARG_ANYTHING, - }; - --#define BPF_IS_REDIRECT_INGRESS(flags) ((flags) & 1) -+BPF_CALL_5(bpf_csum_diff, __be32 *, from, u32, from_size, -+ __be32 *, to, u32, to_size, __wsum, seed) -+{ -+ struct bpf_scratchpad *sp = this_cpu_ptr(&bpf_sp); -+ u32 diff_size = from_size + to_size; -+ int i, j = 0; -+ -+ /* This is quite flexible, some examples: -+ * -+ * from_size == 0, to_size > 0, seed := csum --> pushing data -+ * from_size > 0, to_size == 0, seed := csum --> pulling data -+ * from_size > 0, to_size > 0, seed := 0 --> diffing data -+ * -+ * Even for diffing, from_size and to_size don't need to be equal. -+ */ -+ if (unlikely(((from_size | to_size) & (sizeof(__be32) - 1)) || -+ diff_size > sizeof(sp->diff))) -+ return -EINVAL; -+ -+ for (i = 0; i < from_size / sizeof(__be32); i++, j++) -+ sp->diff[j] = ~from[i]; -+ for (i = 0; i < to_size / sizeof(__be32); i++, j++) -+ sp->diff[j] = to[i]; -+ -+ return csum_partial(sp->diff, diff_size, seed); -+} -+ -+static const struct bpf_func_proto bpf_csum_diff_proto = { -+ .func = bpf_csum_diff, -+ .gpl_only = false, -+ .pkt_access = true, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_MEM_OR_NULL, -+ .arg2_type = ARG_CONST_SIZE_OR_ZERO, -+ .arg3_type = ARG_PTR_TO_MEM_OR_NULL, -+ .arg4_type = ARG_CONST_SIZE_OR_ZERO, -+ .arg5_type = ARG_ANYTHING, -+}; -+ -+BPF_CALL_2(bpf_csum_update, struct sk_buff *, skb, __wsum, csum) -+{ -+ /* The interface is to be used in combination with bpf_csum_diff() -+ * for direct packet writes. csum rotation for alignment as well -+ * as emulating csum_sub() can be done from the eBPF program. -+ */ -+ if (skb->ip_summed == CHECKSUM_COMPLETE) -+ return (skb->csum = csum_add(skb->csum, csum)); -+ -+ return -ENOTSUPP; -+} -+ -+static const struct bpf_func_proto bpf_csum_update_proto = { -+ .func = bpf_csum_update, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, -+}; -+ -+static inline int __bpf_rx_skb(struct net_device *dev, struct sk_buff *skb) -+{ -+ return dev_forward_skb(dev, skb); -+} -+ -+static inline int __bpf_rx_skb_no_mac(struct net_device *dev, -+ struct sk_buff *skb) -+{ -+ int ret = ____dev_forward_skb(dev, skb); -+ -+ if (likely(!ret)) { -+ skb->dev = dev; -+ ret = netif_rx(skb); -+ } -+ -+ return ret; -+} -+ -+static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) -+{ -+ int ret; -+ -+ skb->dev = dev; -+ skb->tstamp.tv64 = 0; -+ -+ ret = dev_queue_xmit(skb); -+ -+ return ret; -+} -+ -+static int __bpf_redirect_no_mac(struct sk_buff *skb, struct net_device *dev, -+ u32 flags) -+{ -+ unsigned int mlen = skb_network_offset(skb); -+ -+ if (mlen) { -+ __skb_pull(skb, mlen); -+ -+ /* At ingress, the mac header has already been pulled once. -+ * At egress, skb_pospull_rcsum has to be done in case that -+ * the skb is originated from ingress (i.e. a forwarded skb) -+ * to ensure that rcsum starts at net header. -+ */ -+ if (!skb_at_tc_ingress(skb)) -+ skb_postpull_rcsum(skb, skb_mac_header(skb), mlen); -+ } -+ skb_pop_mac_header(skb); -+ skb_reset_mac_len(skb); -+ return flags & BPF_F_INGRESS ? -+ __bpf_rx_skb_no_mac(dev, skb) : __bpf_tx_skb(dev, skb); -+} - --static u64 bpf_clone_redirect(u64 r1, u64 ifindex, u64 flags, u64 r4, u64 r5) -+static int __bpf_redirect_common(struct sk_buff *skb, struct net_device *dev, -+ u32 flags) -+{ -+ /* Verify that a link layer header is carried */ -+ if (unlikely(skb->mac_header >= skb->network_header)) { -+ kfree_skb(skb); -+ return -ERANGE; -+ } -+ -+ bpf_push_mac_rcsum(skb); -+ return flags & BPF_F_INGRESS ? -+ __bpf_rx_skb(dev, skb) : __bpf_tx_skb(dev, skb); -+} -+ -+static int __bpf_redirect(struct sk_buff *skb, struct net_device *dev, -+ u32 flags) -+{ -+ if (dev_is_mac_header_xmit(dev)) -+ return __bpf_redirect_common(skb, dev, flags); -+ else -+ return __bpf_redirect_no_mac(skb, dev, flags); -+} -+ -+BPF_CALL_3(bpf_clone_redirect, struct sk_buff *, skb, u32, ifindex, u64, flags) - { -- struct sk_buff *skb = (struct sk_buff *) (long) r1, *skb2; - struct net_device *dev; -+ struct sk_buff *clone; -+ int ret; -+ -+ if (unlikely(flags & ~(BPF_F_INGRESS))) -+ return -EINVAL; - - dev = dev_get_by_index_rcu(dev_net(skb->dev), ifindex); - if (unlikely(!dev)) - return -EINVAL; - -- skb2 = skb_clone(skb, GFP_ATOMIC); -- if (unlikely(!skb2)) -+ clone = skb_clone(skb, GFP_ATOMIC); -+ if (unlikely(!clone)) - return -ENOMEM; - -- if (BPF_IS_REDIRECT_INGRESS(flags)) -- return dev_forward_skb(dev, skb2); -+ /* For direct write, we need to keep the invariant that the skbs -+ * we're dealing with need to be uncloned. Should uncloning fail -+ * here, we need to free the just generated clone to unclone once -+ * again. -+ */ -+ ret = bpf_try_make_head_writable(skb); -+ if (unlikely(ret)) { -+ kfree_skb(clone); -+ return -ENOMEM; -+ } - -- skb2->dev = dev; -- skb_sender_cpu_clear(skb2); -- return dev_queue_xmit(skb2); -+ return __bpf_redirect(clone, dev, flags); - } - --const struct bpf_func_proto bpf_clone_redirect_proto = { -+static const struct bpf_func_proto bpf_clone_redirect_proto = { - .func = bpf_clone_redirect, - .gpl_only = false, - .ret_type = RET_INTEGER, -@@ -1432,42 +1977,38 @@ const struct bpf_func_proto bpf_clone_re - .arg3_type = ARG_ANYTHING, - }; - --struct redirect_info { -- u32 ifindex; -- u32 flags; --}; -+DEFINE_PER_CPU(struct bpf_redirect_info, bpf_redirect_info); -+EXPORT_PER_CPU_SYMBOL_GPL(bpf_redirect_info); - --static DEFINE_PER_CPU(struct redirect_info, redirect_info); --static u64 bpf_redirect(u64 ifindex, u64 flags, u64 r3, u64 r4, u64 r5) -+BPF_CALL_2(bpf_redirect, u32, ifindex, u64, flags) - { -- struct redirect_info *ri = this_cpu_ptr(&redirect_info); -+ struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); -+ -+ if (unlikely(flags & ~(BPF_F_INGRESS))) -+ return TC_ACT_SHOT; - -- ri->ifindex = ifindex; - ri->flags = flags; -+ ri->tgt_index = ifindex; -+ - return TC_ACT_REDIRECT; - } - - int skb_do_redirect(struct sk_buff *skb) - { -- struct redirect_info *ri = this_cpu_ptr(&redirect_info); -+ struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); - struct net_device *dev; - -- dev = dev_get_by_index_rcu(dev_net(skb->dev), ri->ifindex); -- ri->ifindex = 0; -+ dev = dev_get_by_index_rcu(dev_net(skb->dev), ri->tgt_index); -+ ri->tgt_index = 0; - if (unlikely(!dev)) { - kfree_skb(skb); - return -EINVAL; - } - -- if (BPF_IS_REDIRECT_INGRESS(ri->flags)) -- return dev_forward_skb(dev, skb); -- -- skb->dev = dev; -- skb_sender_cpu_clear(skb); -- return dev_queue_xmit(skb); -+ return __bpf_redirect(skb, dev, ri->flags); - } - --const struct bpf_func_proto bpf_redirect_proto = { -+static const struct bpf_func_proto bpf_redirect_proto = { - .func = bpf_redirect, - .gpl_only = false, - .ret_type = RET_INTEGER, -@@ -1475,50 +2016,75 @@ const struct bpf_func_proto bpf_redirect - .arg2_type = ARG_ANYTHING, - }; - --static u64 bpf_get_cgroup_classid(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_1(bpf_get_hash_recalc, struct sk_buff *, skb) - { -- return task_get_classid((struct sk_buff *) (unsigned long) r1); -+ /* If skb_clear_hash() was called due to mangling, we can -+ * trigger SW recalculation here. Later access to hash -+ * can then use the inline skb->hash via context directly -+ * instead of calling this helper again. -+ */ -+ return skb_get_hash(skb); - } - --static const struct bpf_func_proto bpf_get_cgroup_classid_proto = { -- .func = bpf_get_cgroup_classid, -- .gpl_only = false, -- .ret_type = RET_INTEGER, -- .arg1_type = ARG_PTR_TO_CTX, -+static const struct bpf_func_proto bpf_get_hash_recalc_proto = { -+ .func = bpf_get_hash_recalc, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, - }; - --static u64 bpf_get_route_realm(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_1(bpf_set_hash_invalid, struct sk_buff *, skb) - { --#ifdef CONFIG_IP_ROUTE_CLASSID -- const struct dst_entry *dst; -+ /* After all direct packet write, this can be used once for -+ * triggering a lazy recalc on next skb_get_hash() invocation. -+ */ -+ skb_clear_hash(skb); -+ return 0; -+} - -- dst = skb_dst((struct sk_buff *) (unsigned long) r1); -- if (dst) -- return dst->tclassid; --#endif -+static const struct bpf_func_proto bpf_set_hash_invalid_proto = { -+ .func = bpf_set_hash_invalid, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+}; -+ -+BPF_CALL_2(bpf_set_hash, struct sk_buff *, skb, u32, hash) -+{ -+ /* Set user specified hash as L4(+), so that it gets returned -+ * on skb_get_hash() call unless BPF prog later on triggers a -+ * skb_clear_hash(). -+ */ -+ __skb_set_sw_hash(skb, hash, true); - return 0; - } - --static const struct bpf_func_proto bpf_get_route_realm_proto = { -- .func = bpf_get_route_realm, -- .gpl_only = false, -- .ret_type = RET_INTEGER, -- .arg1_type = ARG_PTR_TO_CTX, -+static const struct bpf_func_proto bpf_set_hash_proto = { -+ .func = bpf_set_hash, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, - }; - --static u64 bpf_skb_vlan_push(u64 r1, u64 r2, u64 vlan_tci, u64 r4, u64 r5) -+BPF_CALL_3(bpf_skb_vlan_push, struct sk_buff *, skb, __be16, vlan_proto, -+ u16, vlan_tci) - { -- struct sk_buff *skb = (struct sk_buff *) (long) r1; -- __be16 vlan_proto = (__force __be16) r2; -+ int ret; - - if (unlikely(vlan_proto != htons(ETH_P_8021Q) && - vlan_proto != htons(ETH_P_8021AD))) - vlan_proto = htons(ETH_P_8021Q); - -- return skb_vlan_push(skb, vlan_proto, vlan_tci); -+ bpf_push_mac_rcsum(skb); -+ ret = skb_vlan_push(skb, vlan_proto, vlan_tci); -+ bpf_pull_mac_rcsum(skb); -+ -+ bpf_compute_data_pointers(skb); -+ return ret; - } - --const struct bpf_func_proto bpf_skb_vlan_push_proto = { -+static const struct bpf_func_proto bpf_skb_vlan_push_proto = { - .func = bpf_skb_vlan_push, - .gpl_only = false, - .ret_type = RET_INTEGER, -@@ -1526,116 +2092,401 @@ const struct bpf_func_proto bpf_skb_vlan - .arg2_type = ARG_ANYTHING, - .arg3_type = ARG_ANYTHING, - }; --EXPORT_SYMBOL_GPL(bpf_skb_vlan_push_proto); - --static u64 bpf_skb_vlan_pop(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) -+BPF_CALL_1(bpf_skb_vlan_pop, struct sk_buff *, skb) - { -- struct sk_buff *skb = (struct sk_buff *) (long) r1; -+ int ret; -+ -+ bpf_push_mac_rcsum(skb); -+ ret = skb_vlan_pop(skb); -+ bpf_pull_mac_rcsum(skb); - -- return skb_vlan_pop(skb); -+ bpf_compute_data_pointers(skb); -+ return ret; - } - --const struct bpf_func_proto bpf_skb_vlan_pop_proto = { -+static const struct bpf_func_proto bpf_skb_vlan_pop_proto = { - .func = bpf_skb_vlan_pop, - .gpl_only = false, - .ret_type = RET_INTEGER, - .arg1_type = ARG_PTR_TO_CTX, - }; --EXPORT_SYMBOL_GPL(bpf_skb_vlan_pop_proto); - --bool bpf_helper_changes_skb_data(void *func) -+BPF_CALL_2(bpf_skb_change_type, struct sk_buff *, skb, u32, pkt_type) - { -- if (func == bpf_skb_vlan_push) -- return true; -- if (func == bpf_skb_vlan_pop) -- return true; -- if (func == bpf_skb_store_bytes) -- return true; -- if (func == bpf_l3_csum_replace) -- return true; -- if (func == bpf_l4_csum_replace) -- return true; -+ /* We only allow a restricted subset to be changed for now. */ -+ if (unlikely(!skb_pkt_type_ok(skb->pkt_type) || -+ !skb_pkt_type_ok(pkt_type))) -+ return -EINVAL; - -- return false; -+ skb->pkt_type = pkt_type; -+ return 0; -+} -+ -+static const struct bpf_func_proto bpf_skb_change_type_proto = { -+ .func = bpf_skb_change_type, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, -+}; -+ -+#define BPF_F_ADJ_ROOM_ENCAP_L3_MASK (BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 | \ -+ BPF_F_ADJ_ROOM_ENCAP_L3_IPV6) -+ -+#define BPF_F_ADJ_ROOM_MASK (BPF_F_ADJ_ROOM_FIXED_GSO | \ -+ BPF_F_ADJ_ROOM_ENCAP_L3_MASK | \ -+ BPF_F_ADJ_ROOM_ENCAP_L4_GRE | \ -+ BPF_F_ADJ_ROOM_ENCAP_L4_UDP | \ -+ BPF_F_ADJ_ROOM_ENCAP_L2( \ -+ BPF_ADJ_ROOM_ENCAP_L2_MASK)) -+ -+#define BPF_SKB_MAX_LEN SKB_MAX_ALLOC -+ -+static u32 __bpf_skb_min_len(const struct sk_buff *skb) -+{ -+ u32 min_len = skb_network_offset(skb); -+ -+ if (skb_transport_header_was_set(skb)) -+ min_len = skb_transport_offset(skb); -+ if (skb->ip_summed == CHECKSUM_PARTIAL) -+ min_len = skb_checksum_start_offset(skb) + -+ skb->csum_offset + sizeof(__sum16); -+ return min_len; - } - --static u64 bpf_skb_get_tunnel_key(u64 r1, u64 r2, u64 size, u64 flags, u64 r5) -+static int bpf_skb_grow_rcsum(struct sk_buff *skb, unsigned int new_len) - { -- struct sk_buff *skb = (struct sk_buff *) (long) r1; -- struct bpf_tunnel_key *to = (struct bpf_tunnel_key *) (long) r2; -- struct ip_tunnel_info *info = skb_tunnel_info(skb); -+ unsigned int old_len = skb->len; -+ int ret; - -- if (unlikely(size != sizeof(struct bpf_tunnel_key) || flags || !info)) -+ ret = __skb_grow_rcsum(skb, new_len); -+ if (!ret) -+ memset(skb->data + old_len, 0, new_len - old_len); -+ return ret; -+} -+ -+static int bpf_skb_trim_rcsum(struct sk_buff *skb, unsigned int new_len) -+{ -+ return __skb_trim_rcsum(skb, new_len); -+} -+ -+static inline int __bpf_skb_change_tail(struct sk_buff *skb, u32 new_len, -+ u64 flags) -+{ -+ u32 max_len = BPF_SKB_MAX_LEN; -+ u32 min_len = __bpf_skb_min_len(skb); -+ int ret; -+ -+ if (unlikely(flags || new_len > max_len || new_len < min_len)) - return -EINVAL; -- if (ip_tunnel_info_af(info) != AF_INET) -+ if (skb->encapsulation) -+ return -ENOTSUPP; -+ -+ /* The basic idea of this helper is that it's performing the -+ * needed work to either grow or trim an skb, and eBPF program -+ * rewrites the rest via helpers like bpf_skb_store_bytes(), -+ * bpf_lX_csum_replace() and others rather than passing a raw -+ * buffer here. This one is a slow path helper and intended -+ * for replies with control messages. -+ * -+ * Like in bpf_skb_change_proto(), we want to keep this rather -+ * minimal and without protocol specifics so that we are able -+ * to separate concerns as in bpf_skb_store_bytes() should only -+ * be the one responsible for writing buffers. -+ * -+ * It's really expected to be a slow path operation here for -+ * control message replies, so we're implicitly linearizing, -+ * uncloning and drop offloads from the skb by this. -+ */ -+ ret = __bpf_try_make_writable(skb, skb->len); -+ if (!ret) { -+ if (new_len > skb->len) -+ ret = bpf_skb_grow_rcsum(skb, new_len); -+ else if (new_len < skb->len) -+ ret = bpf_skb_trim_rcsum(skb, new_len); -+ if (!ret && skb_is_gso(skb)) -+ skb_gso_reset(skb); -+ } -+ return ret; -+} -+ -+BPF_CALL_3(bpf_skb_change_tail, struct sk_buff *, skb, u32, new_len, -+ u64, flags) -+{ -+ int ret = __bpf_skb_change_tail(skb, new_len, flags); -+ -+ bpf_compute_data_pointers(skb); -+ return ret; -+} -+ -+static const struct bpf_func_proto bpf_skb_change_tail_proto = { -+ .func = bpf_skb_change_tail, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, -+ .arg3_type = ARG_ANYTHING, -+}; -+ -+static inline int __bpf_skb_change_head(struct sk_buff *skb, u32 head_room, -+ u64 flags) -+{ -+ u32 max_len = BPF_SKB_MAX_LEN; -+ u32 new_len = skb->len + head_room; -+ int ret; -+ -+ if (unlikely(flags || (!skb_is_gso(skb) && new_len > max_len) || -+ new_len < skb->len)) - return -EINVAL; - -- to->tunnel_id = be64_to_cpu(info->key.tun_id); -- to->remote_ipv4 = be32_to_cpu(info->key.u.ipv4.src); -+ ret = skb_cow(skb, head_room); -+ if (likely(!ret)) { -+ /* Idea for this helper is that we currently only -+ * allow to expand on mac header. This means that -+ * skb->protocol network header, etc, stay as is. -+ * Compared to bpf_skb_change_tail(), we're more -+ * flexible due to not needing to linearize or -+ * reset GSO. Intention for this helper is to be -+ * used by an L3 skb that needs to push mac header -+ * for redirection into L2 device. -+ */ -+ __skb_push(skb, head_room); -+ memset(skb->data, 0, head_room); -+ skb_reset_mac_header(skb); -+ skb_reset_mac_len(skb); -+ } - -- return 0; -+ return ret; - } - --const struct bpf_func_proto bpf_skb_get_tunnel_key_proto = { -- .func = bpf_skb_get_tunnel_key, -+BPF_CALL_3(bpf_skb_change_head, struct sk_buff *, skb, u32, head_room, -+ u64, flags) -+{ -+ int ret = __bpf_skb_change_head(skb, head_room, flags); -+ -+ bpf_compute_data_pointers(skb); -+ return ret; -+} -+ -+static const struct bpf_func_proto bpf_skb_change_head_proto = { -+ .func = bpf_skb_change_head, - .gpl_only = false, - .ret_type = RET_INTEGER, - .arg1_type = ARG_PTR_TO_CTX, -- .arg2_type = ARG_PTR_TO_STACK, -- .arg3_type = ARG_CONST_STACK_SIZE, -- .arg4_type = ARG_ANYTHING, -+ .arg2_type = ARG_ANYTHING, -+ .arg3_type = ARG_ANYTHING, - }; - --static struct metadata_dst __percpu *md_dst; -+void bpf_clear_redirect_map(struct bpf_map *map) -+{ -+ struct bpf_redirect_info *ri; -+ int cpu; -+ -+ for_each_possible_cpu(cpu) { -+ ri = per_cpu_ptr(&bpf_redirect_info, cpu); -+ /* Avoid polluting remote cacheline due to writes if -+ * not needed. Once we pass this test, we need the -+ * cmpxchg() to make sure it hasn't been changed in -+ * the meantime by remote CPU. -+ */ -+ if (unlikely(READ_ONCE(ri->map) == map)) -+ cmpxchg(&ri->map, map, NULL); -+ } -+} -+ -+static unsigned long bpf_skb_copy(void *dst_buff, const void *skb, -+ unsigned long off, unsigned long len) -+{ -+ void *ptr = skb_header_pointer(skb, off, len, dst_buff); -+ -+ if (unlikely(!ptr)) -+ return len; -+ if (ptr != dst_buff) -+ memcpy(dst_buff, ptr, len); -+ -+ return 0; -+} - --static u64 bpf_skb_set_tunnel_key(u64 r1, u64 r2, u64 size, u64 flags, u64 r5) -+BPF_CALL_5(bpf_skb_event_output, struct sk_buff *, skb, struct bpf_map *, map, -+ u64, flags, void *, meta, u64, meta_size) - { -- struct sk_buff *skb = (struct sk_buff *) (long) r1; -- struct bpf_tunnel_key *from = (struct bpf_tunnel_key *) (long) r2; -- struct metadata_dst *md = this_cpu_ptr(md_dst); -- struct ip_tunnel_info *info; -+ u64 skb_size = (flags & BPF_F_CTXLEN_MASK) >> 32; - -- if (unlikely(size != sizeof(struct bpf_tunnel_key) || flags)) -+ if (unlikely(flags & ~(BPF_F_CTXLEN_MASK | BPF_F_INDEX_MASK))) - return -EINVAL; -+ if (unlikely(skb_size > skb->len)) -+ return -EFAULT; - -- skb_dst_drop(skb); -- dst_hold((struct dst_entry *) md); -- skb_dst_set(skb, (struct dst_entry *) md); -+ return bpf_event_output(map, flags, meta, meta_size, skb, skb_size, -+ bpf_skb_copy); -+} - -- info = &md->u.tun_info; -- info->mode = IP_TUNNEL_INFO_TX; -- info->key.tun_flags = TUNNEL_KEY; -- info->key.tun_id = cpu_to_be64(from->tunnel_id); -- info->key.u.ipv4.dst = cpu_to_be32(from->remote_ipv4); -+static const struct bpf_func_proto bpf_skb_event_output_proto = { -+ .func = bpf_skb_event_output, -+ .gpl_only = true, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_CONST_MAP_PTR, -+ .arg3_type = ARG_ANYTHING, -+ .arg4_type = ARG_PTR_TO_MEM, -+ .arg5_type = ARG_CONST_SIZE_OR_ZERO, -+}; -+ -+ -+const struct ipv6_bpf_stub *ipv6_bpf_stub __read_mostly; -+EXPORT_SYMBOL_GPL(ipv6_bpf_stub); -+ -+#ifdef CONFIG_XFRM -+BPF_CALL_5(bpf_skb_get_xfrm_state, struct sk_buff *, skb, u32, index, -+ struct bpf_xfrm_state *, to, u32, size, u64, flags) -+{ -+ const struct sec_path *sp = skb_sec_path(skb); -+ const struct xfrm_state *x; -+ -+ if (!sp || unlikely(index >= sp->len || flags)) -+ goto err_clear; -+ -+ x = sp->xvec[index]; -+ -+ if (unlikely(size != sizeof(struct bpf_xfrm_state))) -+ goto err_clear; -+ -+ to->reqid = x->props.reqid; -+ to->spi = x->id.spi; -+ to->family = x->props.family; -+ to->ext = 0; -+ -+ if (to->family == AF_INET6) { -+ memcpy(to->remote_ipv6, x->props.saddr.a6, -+ sizeof(to->remote_ipv6)); -+ } else { -+ to->remote_ipv4 = x->props.saddr.a4; -+ memset(&to->remote_ipv6[1], 0, sizeof(__u32) * 3); -+ } - - return 0; -+err_clear: -+ memset(to, 0, size); -+ return -EINVAL; - } - --const struct bpf_func_proto bpf_skb_set_tunnel_key_proto = { -- .func = bpf_skb_set_tunnel_key, -+static const struct bpf_func_proto bpf_skb_get_xfrm_state_proto = { -+ .func = bpf_skb_get_xfrm_state, - .gpl_only = false, - .ret_type = RET_INTEGER, - .arg1_type = ARG_PTR_TO_CTX, -- .arg2_type = ARG_PTR_TO_STACK, -- .arg3_type = ARG_CONST_STACK_SIZE, -- .arg4_type = ARG_ANYTHING, -+ .arg2_type = ARG_ANYTHING, -+ .arg3_type = ARG_PTR_TO_UNINIT_MEM, -+ .arg4_type = ARG_CONST_SIZE, -+ .arg5_type = ARG_ANYTHING, - }; -+#endif -+ - --static const struct bpf_func_proto *bpf_get_skb_set_tunnel_key_proto(void) -+#if IS_ENABLED(CONFIG_LWTUNNEL_BPF) -+static int bpf_push_ip_encap(struct sk_buff *skb, void *hdr, u32 len, -+ bool ingress) - { -- if (!md_dst) { -- /* race is not possible, since it's called from -- * verifier that is holding verifier mutex -- */ -- md_dst = metadata_dst_alloc_percpu(0, GFP_KERNEL); -- if (!md_dst) -- return NULL; -+ return bpf_lwt_push_ip_encap(skb, hdr, len, ingress); -+} -+#endif -+ -+BPF_CALL_4(bpf_lwt_in_push_encap, struct sk_buff *, skb, u32, type, void *, hdr, -+ u32, len) -+{ -+ switch (type) { -+#if IS_ENABLED(CONFIG_LWTUNNEL_BPF) -+ case BPF_LWT_ENCAP_IP: -+ return bpf_push_ip_encap(skb, hdr, len, true /* ingress */); -+#endif -+ default: -+ return -EINVAL; - } -- return &bpf_skb_set_tunnel_key_proto; -+} -+ -+BPF_CALL_4(bpf_lwt_xmit_push_encap, struct sk_buff *, skb, u32, type, -+ void *, hdr, u32, len) -+{ -+ switch (type) { -+#if IS_ENABLED(CONFIG_LWTUNNEL_BPF) -+ case BPF_LWT_ENCAP_IP: -+ return bpf_push_ip_encap(skb, hdr, len, false /* egress */); -+#endif -+ default: -+ return -EINVAL; -+ } -+} -+ -+static const struct bpf_func_proto bpf_lwt_in_push_encap_proto = { -+ .func = bpf_lwt_in_push_encap, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, -+ .arg3_type = ARG_PTR_TO_MEM, -+ .arg4_type = ARG_CONST_SIZE -+}; -+ -+static const struct bpf_func_proto bpf_lwt_xmit_push_encap_proto = { -+ .func = bpf_lwt_xmit_push_encap, -+ .gpl_only = false, -+ .ret_type = RET_INTEGER, -+ .arg1_type = ARG_PTR_TO_CTX, -+ .arg2_type = ARG_ANYTHING, -+ .arg3_type = ARG_PTR_TO_MEM, -+ .arg4_type = ARG_CONST_SIZE -+}; -+ -+bool bpf_tcp_sock_is_valid_access(int off, int size, enum bpf_access_type type, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+u32 bpf_tcp_sock_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) -+{ -+ return 0; -+} -+ -+BPF_CALL_1(bpf_tcp_sock, struct sock *, sk) -+{ -+ if (sk_fullsock(sk) && sk->sk_protocol == IPPROTO_TCP) -+ return (unsigned long)sk; -+ -+ return (unsigned long)NULL; -+} -+ -+const struct bpf_func_proto bpf_tcp_sock_proto = { -+ .func = bpf_tcp_sock, -+ .gpl_only = false, -+ .ret_type = RET_PTR_TO_TCP_SOCK_OR_NULL, -+ .arg1_type = ARG_PTR_TO_SOCK_COMMON, -+}; -+ -+bool bpf_helper_changes_pkt_data(void *func) -+{ -+ if (func == bpf_skb_vlan_push || -+ func == bpf_skb_vlan_pop || -+ func == bpf_skb_store_bytes || -+ func == bpf_skb_change_head || -+ func == bpf_skb_change_tail || -+ func == bpf_skb_pull_data || -+ func == bpf_clone_redirect || -+ func == bpf_l3_csum_replace || -+ func == bpf_l4_csum_replace || -+ func == bpf_lwt_in_push_encap || -+ func == bpf_lwt_xmit_push_encap) -+ return true; -+ -+ return false; - } - - static const struct bpf_func_proto * --sk_filter_func_proto(enum bpf_func_id func_id) -+bpf_base_func_proto(enum bpf_func_id func_id) - { - switch (func_id) { - case BPF_FUNC_map_lookup_elem: -@@ -1644,283 +2495,1168 @@ sk_filter_func_proto(enum bpf_func_id fu - return &bpf_map_update_elem_proto; - case BPF_FUNC_map_delete_elem: - return &bpf_map_delete_elem_proto; -+ case BPF_FUNC_map_push_elem: -+ return &bpf_map_push_elem_proto; -+ case BPF_FUNC_map_pop_elem: -+ return &bpf_map_pop_elem_proto; -+ case BPF_FUNC_map_peek_elem: -+ return &bpf_map_peek_elem_proto; - case BPF_FUNC_get_prandom_u32: - return &bpf_get_prandom_u32_proto; - case BPF_FUNC_get_smp_processor_id: -- return &bpf_get_smp_processor_id_proto; -+ return &bpf_get_raw_smp_processor_id_proto; -+ case BPF_FUNC_get_numa_node_id: -+ return &bpf_get_numa_node_id_proto; - case BPF_FUNC_tail_call: - return &bpf_tail_call_proto; - case BPF_FUNC_ktime_get_ns: - return &bpf_ktime_get_ns_proto; -+ default: -+ break; -+ } -+ -+ if (!capable(CAP_SYS_ADMIN)) -+ return NULL; -+ -+ switch (func_id) { -+ case BPF_FUNC_spin_lock: -+ return &bpf_spin_lock_proto; -+ case BPF_FUNC_spin_unlock: -+ return &bpf_spin_unlock_proto; - case BPF_FUNC_trace_printk: -- if (capable(CAP_SYS_ADMIN)) -- return bpf_get_trace_printk_proto(); -+ return bpf_get_trace_printk_proto(); - default: - return NULL; - } - } - - static const struct bpf_func_proto * --tc_cls_act_func_proto(enum bpf_func_id func_id) -+sock_filter_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ return bpf_base_func_proto(func_id); -+} -+ -+static const struct bpf_func_proto * -+sock_addr_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ return bpf_base_func_proto(func_id); -+} -+ -+const struct bpf_func_proto bpf_sk_storage_get_proto __weak; -+const struct bpf_func_proto bpf_sk_storage_delete_proto __weak; -+ -+static const struct bpf_func_proto * -+tc_cls_act_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) - { - switch (func_id) { - case BPF_FUNC_skb_store_bytes: - return &bpf_skb_store_bytes_proto; -+ case BPF_FUNC_skb_load_bytes: -+ return &bpf_skb_load_bytes_proto; -+ case BPF_FUNC_skb_load_bytes_relative: -+ return &bpf_skb_load_bytes_relative_proto; -+ case BPF_FUNC_skb_pull_data: -+ return &bpf_skb_pull_data_proto; -+ case BPF_FUNC_csum_diff: -+ return &bpf_csum_diff_proto; -+ case BPF_FUNC_csum_update: -+ return &bpf_csum_update_proto; - case BPF_FUNC_l3_csum_replace: - return &bpf_l3_csum_replace_proto; - case BPF_FUNC_l4_csum_replace: - return &bpf_l4_csum_replace_proto; - case BPF_FUNC_clone_redirect: - return &bpf_clone_redirect_proto; -- case BPF_FUNC_get_cgroup_classid: -- return &bpf_get_cgroup_classid_proto; - case BPF_FUNC_skb_vlan_push: - return &bpf_skb_vlan_push_proto; - case BPF_FUNC_skb_vlan_pop: - return &bpf_skb_vlan_pop_proto; -- case BPF_FUNC_skb_get_tunnel_key: -- return &bpf_skb_get_tunnel_key_proto; -- case BPF_FUNC_skb_set_tunnel_key: -- return bpf_get_skb_set_tunnel_key_proto(); -+ case BPF_FUNC_skb_change_type: -+ return &bpf_skb_change_type_proto; -+ case BPF_FUNC_skb_change_tail: -+ return &bpf_skb_change_tail_proto; -+ case BPF_FUNC_redirect: -+ return &bpf_redirect_proto; -+ case BPF_FUNC_get_hash_recalc: -+ return &bpf_get_hash_recalc_proto; -+ case BPF_FUNC_set_hash_invalid: -+ return &bpf_set_hash_invalid_proto; -+ case BPF_FUNC_set_hash: -+ return &bpf_set_hash_proto; -+ case BPF_FUNC_perf_event_output: -+ return &bpf_skb_event_output_proto; -+ case BPF_FUNC_get_smp_processor_id: -+ return &bpf_get_smp_processor_id_proto; -+#ifdef CONFIG_XFRM -+ case BPF_FUNC_skb_get_xfrm_state: -+ return &bpf_skb_get_xfrm_state_proto; -+#endif -+ default: -+ return bpf_base_func_proto(func_id); -+ } -+} -+ -+static const struct bpf_func_proto * -+xdp_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+ default: -+ return bpf_base_func_proto(func_id); -+ } -+} -+ -+const struct bpf_func_proto bpf_sock_map_update_proto __weak; -+const struct bpf_func_proto bpf_sock_hash_update_proto __weak; -+ -+static const struct bpf_func_proto * -+sock_ops_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+ default: -+ return bpf_base_func_proto(func_id); -+ } -+} -+ -+const struct bpf_func_proto bpf_msg_redirect_map_proto __weak; -+const struct bpf_func_proto bpf_msg_redirect_hash_proto __weak; -+ -+static const struct bpf_func_proto * -+sk_msg_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+ default: -+ return bpf_base_func_proto(func_id); -+ } -+} -+ -+const struct bpf_func_proto bpf_sk_redirect_map_proto __weak; -+const struct bpf_func_proto bpf_sk_redirect_hash_proto __weak; -+ -+static const struct bpf_func_proto * -+sk_skb_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ return bpf_base_func_proto(func_id); -+} -+ -+static const struct bpf_func_proto * -+flow_dissector_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+ default: -+ return bpf_base_func_proto(func_id); -+ } -+} -+ -+static const struct bpf_func_proto * -+lwt_out_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+ case BPF_FUNC_skb_load_bytes: -+ return &bpf_skb_load_bytes_proto; -+ case BPF_FUNC_skb_pull_data: -+ return &bpf_skb_pull_data_proto; -+ case BPF_FUNC_csum_diff: -+ return &bpf_csum_diff_proto; -+ case BPF_FUNC_get_hash_recalc: -+ return &bpf_get_hash_recalc_proto; -+ case BPF_FUNC_perf_event_output: -+ return &bpf_skb_event_output_proto; -+ case BPF_FUNC_get_smp_processor_id: -+ return &bpf_get_smp_processor_id_proto; -+ default: -+ return bpf_base_func_proto(func_id); -+ } -+} -+ -+static const struct bpf_func_proto * -+lwt_in_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { -+ case BPF_FUNC_lwt_push_encap: -+ return &bpf_lwt_in_push_encap_proto; -+ default: -+ return lwt_out_func_proto(func_id, prog); -+ } -+} -+ -+static const struct bpf_func_proto * -+lwt_xmit_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) -+{ -+ switch (func_id) { - case BPF_FUNC_redirect: - return &bpf_redirect_proto; -- case BPF_FUNC_get_route_realm: -- return &bpf_get_route_realm_proto; -+ case BPF_FUNC_clone_redirect: -+ return &bpf_clone_redirect_proto; -+ case BPF_FUNC_skb_change_tail: -+ return &bpf_skb_change_tail_proto; -+ case BPF_FUNC_skb_change_head: -+ return &bpf_skb_change_head_proto; -+ case BPF_FUNC_skb_store_bytes: -+ return &bpf_skb_store_bytes_proto; -+ case BPF_FUNC_csum_update: -+ return &bpf_csum_update_proto; -+ case BPF_FUNC_l3_csum_replace: -+ return &bpf_l3_csum_replace_proto; -+ case BPF_FUNC_l4_csum_replace: -+ return &bpf_l4_csum_replace_proto; -+ case BPF_FUNC_set_hash_invalid: -+ return &bpf_set_hash_invalid_proto; -+ case BPF_FUNC_lwt_push_encap: -+ return &bpf_lwt_xmit_push_encap_proto; - default: -- return sk_filter_func_proto(func_id); -+ return lwt_out_func_proto(func_id, prog); - } - } - --static bool __is_valid_access(int off, int size, enum bpf_access_type type) -+static const struct bpf_func_proto * -+lwt_seg6local_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) - { -- /* check bounds */ -+ switch (func_id) { -+ default: -+ return lwt_out_func_proto(func_id, prog); -+ } -+} -+ -+static bool bpf_skb_is_valid_access(int off, int size, enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ const int size_default = sizeof(__u32); -+ - if (off < 0 || off >= sizeof(struct __sk_buff)) - return false; - -- /* disallow misaligned access */ -+ /* The verifier guarantees that size > 0. */ - if (off % size != 0) - return false; - -- /* all __sk_buff fields are __u32 */ -- if (size != 4) -+ switch (off) { -+ case bpf_ctx_range_till(struct __sk_buff, cb[0], cb[4]): -+ if (off + size > offsetofend(struct __sk_buff, cb[4])) -+ return false; -+ break; -+ case bpf_ctx_range_till(struct __sk_buff, remote_ip6[0], remote_ip6[3]): -+ case bpf_ctx_range_till(struct __sk_buff, local_ip6[0], local_ip6[3]): -+ case bpf_ctx_range_till(struct __sk_buff, remote_ip4, remote_ip4): -+ case bpf_ctx_range_till(struct __sk_buff, local_ip4, local_ip4): -+ case bpf_ctx_range(struct __sk_buff, data): -+ case bpf_ctx_range(struct __sk_buff, data_meta): -+ case bpf_ctx_range(struct __sk_buff, data_end): -+ if (size != size_default) -+ return false; -+ break; -+ case bpf_ctx_range_ptr(struct __sk_buff, flow_keys): - return false; -+ case bpf_ctx_range(struct __sk_buff, tstamp): -+ if (size != sizeof(__u64)) -+ return false; -+ break; -+ case offsetof(struct __sk_buff, sk): -+ if (type == BPF_WRITE || size != sizeof(__u64)) -+ return false; -+ info->reg_type = PTR_TO_SOCK_COMMON_OR_NULL; -+ break; -+ default: -+ /* Only narrow read access allowed for now. */ -+ if (type == BPF_WRITE) { -+ if (size != size_default) -+ return false; -+ } else { -+ bpf_ctx_record_field_size(info, size_default); -+ if (!bpf_ctx_narrow_access_ok(off, size, size_default)) -+ return false; -+ } -+ } - - return true; - } - - static bool sk_filter_is_valid_access(int off, int size, -- enum bpf_access_type type) -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) - { -- if (off == offsetof(struct __sk_buff, tc_classid)) -+ return false; -+} -+ -+static bool lwt_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ switch (off) { -+ case bpf_ctx_range(struct __sk_buff, tc_classid): -+ case bpf_ctx_range_till(struct __sk_buff, family, local_port): -+ case bpf_ctx_range(struct __sk_buff, data_meta): -+ case bpf_ctx_range(struct __sk_buff, tstamp): -+ case bpf_ctx_range(struct __sk_buff, wire_len): - return false; -+ } - - if (type == BPF_WRITE) { - switch (off) { -- case offsetof(struct __sk_buff, cb[0]) ... -- offsetof(struct __sk_buff, cb[4]): -+ case bpf_ctx_range(struct __sk_buff, mark): -+ case bpf_ctx_range(struct __sk_buff, priority): -+ case bpf_ctx_range_till(struct __sk_buff, cb[0], cb[4]): - break; - default: - return false; - } - } - -- return __is_valid_access(off, size, type); -+ switch (off) { -+ case bpf_ctx_range(struct __sk_buff, data): -+ info->reg_type = PTR_TO_PACKET; -+ break; -+ case bpf_ctx_range(struct __sk_buff, data_end): -+ info->reg_type = PTR_TO_PACKET_END; -+ break; -+ } -+ -+ return bpf_skb_is_valid_access(off, size, type, prog, info); - } - --static bool tc_cls_act_is_valid_access(int off, int size, -- enum bpf_access_type type) -+ -+bool bpf_sock_common_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ struct bpf_insn_access_aux *info) -+{ -+ switch (off) { -+ case bpf_ctx_range_till(struct bpf_sock, type, priority): -+ return false; -+ default: -+ return bpf_sock_is_valid_access(off, size, type, info); -+ } -+} -+ -+bool bpf_sock_is_valid_access(int off, int size, enum bpf_access_type type, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+static bool sock_filter_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+static int bpf_noop_prologue(struct bpf_insn *insn_buf, bool direct_write, -+ const struct bpf_prog *prog) -+{ -+ /* Neither direct read nor direct write requires any preliminary -+ * action. -+ */ -+ return 0; -+} -+ -+static int bpf_unclone_prologue(struct bpf_insn *insn_buf, bool direct_write, -+ const struct bpf_prog *prog, int drop_verdict) -+{ -+ struct bpf_insn *insn = insn_buf; -+ -+ if (!direct_write) -+ return 0; -+ -+ /* if (!skb->cloned) -+ * goto start; -+ * -+ * (Fast-path, otherwise approximation that we might be -+ * a clone, do the rest in helper.) -+ */ -+ *insn++ = BPF_LDX_MEM(BPF_B, BPF_REG_6, BPF_REG_1, CLONED_OFFSET()); -+ *insn++ = BPF_ALU32_IMM(BPF_AND, BPF_REG_6, CLONED_MASK); -+ *insn++ = BPF_JMP_IMM(BPF_JEQ, BPF_REG_6, 0, 7); -+ -+ /* ret = bpf_skb_pull_data(skb, 0); */ -+ *insn++ = BPF_MOV64_REG(BPF_REG_6, BPF_REG_1); -+ *insn++ = BPF_ALU64_REG(BPF_XOR, BPF_REG_2, BPF_REG_2); -+ *insn++ = BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, -+ BPF_FUNC_skb_pull_data); -+ /* if (!ret) -+ * goto restore; -+ * return TC_ACT_SHOT; -+ */ -+ *insn++ = BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 2); -+ *insn++ = BPF_ALU32_IMM(BPF_MOV, BPF_REG_0, drop_verdict); -+ *insn++ = BPF_EXIT_INSN(); -+ -+ /* restore: */ -+ *insn++ = BPF_MOV64_REG(BPF_REG_1, BPF_REG_6); -+ /* start: */ -+ *insn++ = prog->insnsi[0]; -+ -+ return insn - insn_buf; -+} -+ -+static int bpf_gen_ld_abs(const struct bpf_insn *orig, -+ struct bpf_insn *insn_buf) -+{ -+ bool indirect = BPF_MODE(orig->code) == BPF_IND; -+ struct bpf_insn *insn = insn_buf; -+ -+ if (!indirect) { -+ *insn++ = BPF_MOV64_IMM(BPF_REG_2, orig->imm); -+ } else { -+ *insn++ = BPF_MOV64_REG(BPF_REG_2, orig->src_reg); -+ if (orig->imm) -+ *insn++ = BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, orig->imm); -+ } -+ /* We're guaranteed here that CTX is in R6. */ -+ *insn++ = BPF_MOV64_REG(BPF_REG_1, BPF_REG_CTX); -+ -+ switch (BPF_SIZE(orig->code)) { -+ case BPF_B: -+ *insn++ = BPF_EMIT_CALL(bpf_skb_load_helper_8_no_cache); -+ break; -+ case BPF_H: -+ *insn++ = BPF_EMIT_CALL(bpf_skb_load_helper_16_no_cache); -+ break; -+ case BPF_W: -+ *insn++ = BPF_EMIT_CALL(bpf_skb_load_helper_32_no_cache); -+ break; -+ } -+ -+ *insn++ = BPF_JMP_IMM(BPF_JSGE, BPF_REG_0, 0, 2); -+ *insn++ = BPF_ALU32_REG(BPF_XOR, BPF_REG_0, BPF_REG_0); -+ *insn++ = BPF_EXIT_INSN(); -+ -+ return insn - insn_buf; -+} -+ -+static int tc_cls_act_prologue(struct bpf_insn *insn_buf, bool direct_write, -+ const struct bpf_prog *prog) - { -- if (off == offsetof(struct __sk_buff, tc_classid)) -- return type == BPF_WRITE ? true : false; -+ return bpf_unclone_prologue(insn_buf, direct_write, prog, TC_ACT_SHOT); -+} - -+static bool tc_cls_act_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ - if (type == BPF_WRITE) { - switch (off) { -- case offsetof(struct __sk_buff, mark): -- case offsetof(struct __sk_buff, tc_index): -- case offsetof(struct __sk_buff, priority): -- case offsetof(struct __sk_buff, cb[0]) ... -- offsetof(struct __sk_buff, cb[4]): -+ case bpf_ctx_range(struct __sk_buff, mark): -+ case bpf_ctx_range(struct __sk_buff, tc_index): -+ case bpf_ctx_range(struct __sk_buff, priority): -+ case bpf_ctx_range(struct __sk_buff, tc_classid): -+ case bpf_ctx_range_till(struct __sk_buff, cb[0], cb[4]): -+ case bpf_ctx_range(struct __sk_buff, tstamp): -+ case bpf_ctx_range(struct __sk_buff, queue_mapping): - break; - default: - return false; - } - } -- return __is_valid_access(off, size, type); -+ -+ switch (off) { -+ case bpf_ctx_range(struct __sk_buff, data): -+ info->reg_type = PTR_TO_PACKET; -+ break; -+ case bpf_ctx_range(struct __sk_buff, data_meta): -+ info->reg_type = PTR_TO_PACKET_META; -+ break; -+ case bpf_ctx_range(struct __sk_buff, data_end): -+ info->reg_type = PTR_TO_PACKET_END; -+ break; -+ case bpf_ctx_range_till(struct __sk_buff, family, local_port): -+ return false; -+ } -+ -+ return bpf_skb_is_valid_access(off, size, type, prog, info); -+} -+ -+static bool xdp_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+void bpf_warn_invalid_xdp_action(u32 act) -+{ -+} -+EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action); -+ -+static bool sock_addr_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+static bool sock_ops_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+static int sk_skb_prologue(struct bpf_insn *insn_buf, bool direct_write, -+ const struct bpf_prog *prog) -+{ -+ return bpf_unclone_prologue(insn_buf, direct_write, prog, SK_DROP); -+} -+ -+static bool sk_skb_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+static bool sk_msg_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; -+} -+ -+static bool flow_dissector_is_valid_access(int off, int size, -+ enum bpf_access_type type, -+ const struct bpf_prog *prog, -+ struct bpf_insn_access_aux *info) -+{ -+ return false; - } - --static u32 bpf_net_convert_ctx_access(enum bpf_access_type type, int dst_reg, -- int src_reg, int ctx_off, -- struct bpf_insn *insn_buf, -- struct bpf_prog *prog) -+static u32 flow_dissector_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size) -+ -+{ -+ return 0; -+} -+ -+static u32 bpf_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) - { - struct bpf_insn *insn = insn_buf; -+ int off; - -- switch (ctx_off) { -+ switch (si->off) { - case offsetof(struct __sk_buff, len): -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4); -- -- *insn++ = BPF_LDX_MEM(BPF_W, dst_reg, src_reg, -- offsetof(struct sk_buff, len)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, len, 4, -+ target_size)); - break; - - case offsetof(struct __sk_buff, protocol): -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, protocol) != 2); -- -- *insn++ = BPF_LDX_MEM(BPF_H, dst_reg, src_reg, -- offsetof(struct sk_buff, protocol)); -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, protocol, 2, -+ target_size)); - break; - - case offsetof(struct __sk_buff, vlan_proto): -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_proto) != 2); -- -- *insn++ = BPF_LDX_MEM(BPF_H, dst_reg, src_reg, -- offsetof(struct sk_buff, vlan_proto)); -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, vlan_proto, 2, -+ target_size)); - break; - - case offsetof(struct __sk_buff, priority): -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, priority) != 4); -- - if (type == BPF_WRITE) -- *insn++ = BPF_STX_MEM(BPF_W, dst_reg, src_reg, -- offsetof(struct sk_buff, priority)); -+ *insn++ = BPF_STX_MEM(BPF_W, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, priority, 4, -+ target_size)); - else -- *insn++ = BPF_LDX_MEM(BPF_W, dst_reg, src_reg, -- offsetof(struct sk_buff, priority)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, priority, 4, -+ target_size)); - break; - - case offsetof(struct __sk_buff, ingress_ifindex): -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, skb_iif) != 4); -- -- *insn++ = BPF_LDX_MEM(BPF_W, dst_reg, src_reg, -- offsetof(struct sk_buff, skb_iif)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, skb_iif, 4, -+ target_size)); - break; - - case offsetof(struct __sk_buff, ifindex): -- BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, ifindex) != 4); -- -- *insn++ = BPF_LDX_MEM(bytes_to_bpf_size(FIELD_SIZEOF(struct sk_buff, dev)), -- dst_reg, src_reg, -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, dev), -+ si->dst_reg, si->src_reg, - offsetof(struct sk_buff, dev)); -- *insn++ = BPF_JMP_IMM(BPF_JEQ, dst_reg, 0, 1); -- *insn++ = BPF_LDX_MEM(BPF_W, dst_reg, dst_reg, -- offsetof(struct net_device, ifindex)); -+ *insn++ = BPF_JMP_IMM(BPF_JEQ, si->dst_reg, 0, 1); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->dst_reg, -+ bpf_target_off(struct net_device, ifindex, 4, -+ target_size)); - break; - - case offsetof(struct __sk_buff, hash): -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4); -- -- *insn++ = BPF_LDX_MEM(BPF_W, dst_reg, src_reg, -- offsetof(struct sk_buff, hash)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, hash, 4, -+ target_size)); - break; - - case offsetof(struct __sk_buff, mark): -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, mark) != 4); -- - if (type == BPF_WRITE) -- *insn++ = BPF_STX_MEM(BPF_W, dst_reg, src_reg, -- offsetof(struct sk_buff, mark)); -+ *insn++ = BPF_STX_MEM(BPF_W, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, mark, 4, -+ target_size)); - else -- *insn++ = BPF_LDX_MEM(BPF_W, dst_reg, src_reg, -- offsetof(struct sk_buff, mark)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, mark, 4, -+ target_size)); - break; - - case offsetof(struct __sk_buff, pkt_type): -- return convert_skb_access(SKF_AD_PKTTYPE, dst_reg, src_reg, insn); -+ *target_size = 1; -+ *insn++ = BPF_LDX_MEM(BPF_B, si->dst_reg, si->src_reg, -+ PKT_TYPE_OFFSET()); -+ *insn++ = BPF_ALU32_IMM(BPF_AND, si->dst_reg, PKT_TYPE_MAX); -+#ifdef __BIG_ENDIAN_BITFIELD -+ *insn++ = BPF_ALU32_IMM(BPF_RSH, si->dst_reg, 5); -+#endif -+ break; - - case offsetof(struct __sk_buff, queue_mapping): -- return convert_skb_access(SKF_AD_QUEUE, dst_reg, src_reg, insn); -+ if (type == BPF_WRITE) { -+ *insn++ = BPF_JMP_IMM(BPF_JGE, si->src_reg, USHRT_MAX, 1); -+ *insn++ = BPF_STX_MEM(BPF_H, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, -+ queue_mapping, -+ 2, target_size)); -+ } else { -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, -+ queue_mapping, -+ 2, target_size)); -+ } -+ break; - - case offsetof(struct __sk_buff, vlan_present): -- return convert_skb_access(SKF_AD_VLAN_TAG_PRESENT, -- dst_reg, src_reg, insn); -+ *target_size = 1; -+ *insn++ = BPF_LDX_MEM(BPF_B, si->dst_reg, si->src_reg, -+ PKT_VLAN_PRESENT_OFFSET()); -+ if (PKT_VLAN_PRESENT_BIT) -+ *insn++ = BPF_ALU32_IMM(BPF_RSH, si->dst_reg, PKT_VLAN_PRESENT_BIT); -+ if (PKT_VLAN_PRESENT_BIT < 7) -+ *insn++ = BPF_ALU32_IMM(BPF_AND, si->dst_reg, 1); -+ break; - - case offsetof(struct __sk_buff, vlan_tci): -- return convert_skb_access(SKF_AD_VLAN_TAG, -- dst_reg, src_reg, insn); -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, vlan_tci, 2, -+ target_size)); -+ break; - - case offsetof(struct __sk_buff, cb[0]) ... -- offsetof(struct __sk_buff, cb[4]): -+ offsetofend(struct __sk_buff, cb[4]) - 1: - BUILD_BUG_ON(FIELD_SIZEOF(struct qdisc_skb_cb, data) < 20); -+ BUILD_BUG_ON((offsetof(struct sk_buff, cb) + -+ offsetof(struct qdisc_skb_cb, data)) % -+ sizeof(__u64)); - - prog->cb_access = 1; -- ctx_off -= offsetof(struct __sk_buff, cb[0]); -- ctx_off += offsetof(struct sk_buff, cb); -- ctx_off += offsetof(struct qdisc_skb_cb, data); -+ off = si->off; -+ off -= offsetof(struct __sk_buff, cb[0]); -+ off += offsetof(struct sk_buff, cb); -+ off += offsetof(struct qdisc_skb_cb, data); - if (type == BPF_WRITE) -- *insn++ = BPF_STX_MEM(BPF_W, dst_reg, src_reg, ctx_off); -+ *insn++ = BPF_STX_MEM(BPF_SIZE(si->code), si->dst_reg, -+ si->src_reg, off); - else -- *insn++ = BPF_LDX_MEM(BPF_W, dst_reg, src_reg, ctx_off); -+ *insn++ = BPF_LDX_MEM(BPF_SIZE(si->code), si->dst_reg, -+ si->src_reg, off); - break; - - case offsetof(struct __sk_buff, tc_classid): -- ctx_off -= offsetof(struct __sk_buff, tc_classid); -- ctx_off += offsetof(struct sk_buff, cb); -- ctx_off += offsetof(struct qdisc_skb_cb, tc_classid); -- WARN_ON(type != BPF_WRITE); -- *insn++ = BPF_STX_MEM(BPF_H, dst_reg, src_reg, ctx_off); -+ BUILD_BUG_ON(FIELD_SIZEOF(struct qdisc_skb_cb, tc_classid) != 2); -+ -+ off = si->off; -+ off -= offsetof(struct __sk_buff, tc_classid); -+ off += offsetof(struct sk_buff, cb); -+ off += offsetof(struct qdisc_skb_cb, tc_classid); -+ *target_size = 2; -+ if (type == BPF_WRITE) -+ *insn++ = BPF_STX_MEM(BPF_H, si->dst_reg, -+ si->src_reg, off); -+ else -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, -+ si->src_reg, off); -+ break; -+ -+ case offsetof(struct __sk_buff, data): -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, data), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, data)); -+ break; -+ -+ case offsetof(struct __sk_buff, data_meta): -+ off = si->off; -+ off -= offsetof(struct __sk_buff, data_meta); -+ off += offsetof(struct sk_buff, cb); -+ off += offsetof(struct bpf_skb_data_end, data_meta); -+ *insn++ = BPF_LDX_MEM(BPF_SIZEOF(void *), si->dst_reg, -+ si->src_reg, off); -+ break; -+ -+ case offsetof(struct __sk_buff, data_end): -+ off = si->off; -+ off -= offsetof(struct __sk_buff, data_end); -+ off += offsetof(struct sk_buff, cb); -+ off += offsetof(struct bpf_skb_data_end, data_end); -+ *insn++ = BPF_LDX_MEM(BPF_SIZEOF(void *), si->dst_reg, -+ si->src_reg, off); - break; - - case offsetof(struct __sk_buff, tc_index): - #ifdef CONFIG_NET_SCHED -- BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, tc_index) != 2); -- - if (type == BPF_WRITE) -- *insn++ = BPF_STX_MEM(BPF_H, dst_reg, src_reg, -- offsetof(struct sk_buff, tc_index)); -+ *insn++ = BPF_STX_MEM(BPF_H, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, tc_index, 2, -+ target_size)); - else -- *insn++ = BPF_LDX_MEM(BPF_H, dst_reg, src_reg, -- offsetof(struct sk_buff, tc_index)); -- break; -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, tc_index, 2, -+ target_size)); - #else -+ *target_size = 2; - if (type == BPF_WRITE) -- *insn++ = BPF_MOV64_REG(dst_reg, dst_reg); -+ *insn++ = BPF_MOV64_REG(si->dst_reg, si->dst_reg); - else -- *insn++ = BPF_MOV64_IMM(dst_reg, 0); -+ *insn++ = BPF_MOV64_IMM(si->dst_reg, 0); -+#endif -+ break; -+ -+ case offsetof(struct __sk_buff, napi_id): -+ *target_size = 4; -+ *insn++ = BPF_MOV64_IMM(si->dst_reg, 0); -+ break; -+ case offsetof(struct __sk_buff, family): -+ BUILD_BUG_ON(FIELD_SIZEOF(struct sock_common, skc_family) != 2); -+ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, sk), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, sk)); -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->dst_reg, -+ bpf_target_off(struct sock_common, -+ skc_family, -+ 2, target_size)); -+ break; -+ case offsetof(struct __sk_buff, remote_ip4): -+ BUILD_BUG_ON(FIELD_SIZEOF(struct sock_common, skc_daddr) != 4); -+ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, sk), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, sk)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->dst_reg, -+ bpf_target_off(struct sock_common, -+ skc_daddr, -+ 4, target_size)); -+ break; -+ case offsetof(struct __sk_buff, local_ip4): -+ BUILD_BUG_ON(FIELD_SIZEOF(struct sock_common, -+ skc_rcv_saddr) != 4); -+ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, sk), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, sk)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->dst_reg, -+ bpf_target_off(struct sock_common, -+ skc_rcv_saddr, -+ 4, target_size)); -+ break; -+ case offsetof(struct __sk_buff, remote_ip6[0]) ... -+ offsetof(struct __sk_buff, remote_ip6[3]): -+#if IS_ENABLED(CONFIG_IPV6) -+ BUILD_BUG_ON(FIELD_SIZEOF(struct sock_common, -+ skc_v6_daddr.s6_addr32[0]) != 4); -+ -+ off = si->off; -+ off -= offsetof(struct __sk_buff, remote_ip6[0]); -+ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, sk), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, sk)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->dst_reg, -+ offsetof(struct sock_common, -+ skc_v6_daddr.s6_addr32[0]) + -+ off); -+#else -+ *insn++ = BPF_MOV32_IMM(si->dst_reg, 0); -+#endif -+ break; -+ case offsetof(struct __sk_buff, local_ip6[0]) ... -+ offsetof(struct __sk_buff, local_ip6[3]): -+#if IS_ENABLED(CONFIG_IPV6) -+ BUILD_BUG_ON(FIELD_SIZEOF(struct sock_common, -+ skc_v6_rcv_saddr.s6_addr32[0]) != 4); -+ -+ off = si->off; -+ off -= offsetof(struct __sk_buff, local_ip6[0]); -+ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, sk), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, sk)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->dst_reg, -+ offsetof(struct sock_common, -+ skc_v6_rcv_saddr.s6_addr32[0]) + -+ off); -+#else -+ *insn++ = BPF_MOV32_IMM(si->dst_reg, 0); -+#endif -+ break; -+ -+ case offsetof(struct __sk_buff, remote_port): -+ BUILD_BUG_ON(FIELD_SIZEOF(struct sock_common, skc_dport) != 2); -+ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, sk), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, sk)); -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->dst_reg, -+ bpf_target_off(struct sock_common, -+ skc_dport, -+ 2, target_size)); -+#ifndef __BIG_ENDIAN_BITFIELD -+ *insn++ = BPF_ALU32_IMM(BPF_LSH, si->dst_reg, 16); -+#endif - break; -+ -+ case offsetof(struct __sk_buff, local_port): -+ BUILD_BUG_ON(FIELD_SIZEOF(struct sock_common, skc_num) != 2); -+ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, sk), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, sk)); -+ *insn++ = BPF_LDX_MEM(BPF_H, si->dst_reg, si->dst_reg, -+ bpf_target_off(struct sock_common, -+ skc_num, 2, target_size)); -+ break; -+ -+ case offsetof(struct __sk_buff, tstamp): -+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, tstamp) != 8); -+ -+ if (type == BPF_WRITE) -+ *insn++ = BPF_STX_MEM(BPF_DW, -+ si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, -+ tstamp, 8, -+ target_size)); -+ else -+ *insn++ = BPF_LDX_MEM(BPF_DW, -+ si->dst_reg, si->src_reg, -+ bpf_target_off(struct sk_buff, -+ tstamp, 8, -+ target_size)); -+ break; -+ -+ case offsetof(struct __sk_buff, gso_segs): -+ /* si->dst_reg = skb_shinfo(SKB); */ -+#ifdef NET_SKBUFF_DATA_USES_OFFSET -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, end), -+ BPF_REG_AX, si->src_reg, -+ offsetof(struct sk_buff, end)); -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, head), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, head)); -+ *insn++ = BPF_ALU64_REG(BPF_ADD, si->dst_reg, BPF_REG_AX); -+#else -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, end), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, end)); - #endif -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct skb_shared_info, gso_segs), -+ si->dst_reg, si->dst_reg, -+ bpf_target_off(struct skb_shared_info, -+ gso_segs, 2, -+ target_size)); -+ break; -+ case offsetof(struct __sk_buff, wire_len): -+ BUILD_BUG_ON(FIELD_SIZEOF(struct qdisc_skb_cb, pkt_len) != 4); -+ -+ off = si->off; -+ off -= offsetof(struct __sk_buff, wire_len); -+ off += offsetof(struct sk_buff, cb); -+ off += offsetof(struct qdisc_skb_cb, pkt_len); -+ *target_size = 4; -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->src_reg, off); -+ break; -+ -+ case offsetof(struct __sk_buff, sk): -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, sk), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, sk)); -+ break; - } - - return insn - insn_buf; - } - --static const struct bpf_verifier_ops sk_filter_ops = { -- .get_func_proto = sk_filter_func_proto, -- .is_valid_access = sk_filter_is_valid_access, -- .convert_ctx_access = bpf_net_convert_ctx_access, -+u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) -+{ -+ return 0; -+} -+ -+static u32 tc_cls_act_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) -+{ -+ struct bpf_insn *insn = insn_buf; -+ -+ switch (si->off) { -+ case offsetof(struct __sk_buff, ifindex): -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct sk_buff, dev), -+ si->dst_reg, si->src_reg, -+ offsetof(struct sk_buff, dev)); -+ *insn++ = BPF_LDX_MEM(BPF_W, si->dst_reg, si->dst_reg, -+ bpf_target_off(struct net_device, ifindex, 4, -+ target_size)); -+ break; -+ default: -+ return bpf_convert_ctx_access(type, si, insn_buf, prog, -+ target_size); -+ } -+ -+ return insn - insn_buf; -+} -+ -+static u32 xdp_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) -+{ -+ return 0; -+} -+ -+/* SOCK_ADDR_LOAD_NESTED_FIELD() loads Nested Field S.F.NF where S is type of -+ * context Structure, F is Field in context structure that contains a pointer -+ * to Nested Structure of type NS that has the field NF. -+ * -+ * SIZE encodes the load size (BPF_B, BPF_H, etc). It's up to caller to make -+ * sure that SIZE is not greater than actual size of S.F.NF. -+ * -+ * If offset OFF is provided, the load happens from that offset relative to -+ * offset of NF. -+ */ -+#define SOCK_ADDR_LOAD_NESTED_FIELD_SIZE_OFF(S, NS, F, NF, SIZE, OFF) \ -+ do { \ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(S, F), si->dst_reg, \ -+ si->src_reg, offsetof(S, F)); \ -+ *insn++ = BPF_LDX_MEM( \ -+ SIZE, si->dst_reg, si->dst_reg, \ -+ bpf_target_off(NS, NF, FIELD_SIZEOF(NS, NF), \ -+ target_size) \ -+ + OFF); \ -+ } while (0) -+ -+#define SOCK_ADDR_LOAD_NESTED_FIELD(S, NS, F, NF) \ -+ SOCK_ADDR_LOAD_NESTED_FIELD_SIZE_OFF(S, NS, F, NF, \ -+ BPF_FIELD_SIZEOF(NS, NF), 0) -+ -+/* SOCK_ADDR_STORE_NESTED_FIELD_OFF() has semantic similar to -+ * SOCK_ADDR_LOAD_NESTED_FIELD_SIZE_OFF() but for store operation. -+ * -+ * In addition it uses Temporary Field TF (member of struct S) as the 3rd -+ * "register" since two registers available in convert_ctx_access are not -+ * enough: we can't override neither SRC, since it contains value to store, nor -+ * DST since it contains pointer to context that may be used by later -+ * instructions. But we need a temporary place to save pointer to nested -+ * structure whose field we want to store to. -+ */ -+#define SOCK_ADDR_STORE_NESTED_FIELD_OFF(S, NS, F, NF, SIZE, OFF, TF) \ -+ do { \ -+ int tmp_reg = BPF_REG_9; \ -+ if (si->src_reg == tmp_reg || si->dst_reg == tmp_reg) \ -+ --tmp_reg; \ -+ if (si->src_reg == tmp_reg || si->dst_reg == tmp_reg) \ -+ --tmp_reg; \ -+ *insn++ = BPF_STX_MEM(BPF_DW, si->dst_reg, tmp_reg, \ -+ offsetof(S, TF)); \ -+ *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(S, F), tmp_reg, \ -+ si->dst_reg, offsetof(S, F)); \ -+ *insn++ = BPF_STX_MEM(SIZE, tmp_reg, si->src_reg, \ -+ bpf_target_off(NS, NF, FIELD_SIZEOF(NS, NF), \ -+ target_size) \ -+ + OFF); \ -+ *insn++ = BPF_LDX_MEM(BPF_DW, tmp_reg, si->dst_reg, \ -+ offsetof(S, TF)); \ -+ } while (0) -+ -+#define SOCK_ADDR_LOAD_OR_STORE_NESTED_FIELD_SIZE_OFF(S, NS, F, NF, SIZE, OFF, \ -+ TF) \ -+ do { \ -+ if (type == BPF_WRITE) { \ -+ SOCK_ADDR_STORE_NESTED_FIELD_OFF(S, NS, F, NF, SIZE, \ -+ OFF, TF); \ -+ } else { \ -+ SOCK_ADDR_LOAD_NESTED_FIELD_SIZE_OFF( \ -+ S, NS, F, NF, SIZE, OFF); \ -+ } \ -+ } while (0) -+ -+#define SOCK_ADDR_LOAD_OR_STORE_NESTED_FIELD(S, NS, F, NF, TF) \ -+ SOCK_ADDR_LOAD_OR_STORE_NESTED_FIELD_SIZE_OFF( \ -+ S, NS, F, NF, BPF_FIELD_SIZEOF(NS, NF), 0, TF) -+ -+static u32 sock_addr_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) -+{ -+ return 0; -+} -+ -+static u32 sock_ops_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, -+ u32 *target_size) -+{ -+ return 0; -+} -+ -+static u32 sk_skb_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) -+{ -+ return 0; -+} -+ -+static u32 sk_msg_convert_ctx_access(enum bpf_access_type type, -+ const struct bpf_insn *si, -+ struct bpf_insn *insn_buf, -+ struct bpf_prog *prog, u32 *target_size) -+{ -+ return 0; -+} -+ -+const struct bpf_verifier_ops sk_filter_verifier_ops = { -+ .is_valid_access = sk_filter_is_valid_access, -+ .convert_ctx_access = bpf_convert_ctx_access, -+ .gen_ld_abs = bpf_gen_ld_abs, - }; - --static const struct bpf_verifier_ops tc_cls_act_ops = { -- .get_func_proto = tc_cls_act_func_proto, -- .is_valid_access = tc_cls_act_is_valid_access, -- .convert_ctx_access = bpf_net_convert_ctx_access, -+const struct bpf_prog_ops sk_filter_prog_ops = { - }; - --static struct bpf_prog_type_list sk_filter_type __read_mostly = { -- .ops = &sk_filter_ops, -- .type = BPF_PROG_TYPE_SOCKET_FILTER, -+const struct bpf_verifier_ops tc_cls_act_verifier_ops = { -+ .get_func_proto = tc_cls_act_func_proto, -+ .is_valid_access = tc_cls_act_is_valid_access, -+ .convert_ctx_access = tc_cls_act_convert_ctx_access, -+ .gen_prologue = tc_cls_act_prologue, -+ .gen_ld_abs = bpf_gen_ld_abs, - }; - --static struct bpf_prog_type_list sched_cls_type __read_mostly = { -- .ops = &tc_cls_act_ops, -- .type = BPF_PROG_TYPE_SCHED_CLS, -+const struct bpf_prog_ops tc_cls_act_prog_ops = { - }; - --static struct bpf_prog_type_list sched_act_type __read_mostly = { -- .ops = &tc_cls_act_ops, -- .type = BPF_PROG_TYPE_SCHED_ACT, -+const struct bpf_verifier_ops xdp_verifier_ops = { -+ .get_func_proto = xdp_func_proto, -+ .is_valid_access = xdp_is_valid_access, -+ .convert_ctx_access = xdp_convert_ctx_access, -+ .gen_prologue = bpf_noop_prologue, - }; - --static int __init register_sk_filter_ops(void) --{ -- bpf_register_prog_type(&sk_filter_type); -- bpf_register_prog_type(&sched_cls_type); -- bpf_register_prog_type(&sched_act_type); -+const struct bpf_verifier_ops lwt_in_verifier_ops = { -+ .get_func_proto = lwt_in_func_proto, -+ .is_valid_access = lwt_is_valid_access, -+ .convert_ctx_access = bpf_convert_ctx_access, -+}; - -- return 0; --} --late_initcall(register_sk_filter_ops); -+const struct bpf_prog_ops lwt_in_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops lwt_out_verifier_ops = { -+ .get_func_proto = lwt_out_func_proto, -+ .is_valid_access = lwt_is_valid_access, -+ .convert_ctx_access = bpf_convert_ctx_access, -+}; -+ -+const struct bpf_prog_ops lwt_out_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops lwt_xmit_verifier_ops = { -+ .get_func_proto = lwt_xmit_func_proto, -+ .is_valid_access = lwt_is_valid_access, -+ .convert_ctx_access = bpf_convert_ctx_access, -+ .gen_prologue = tc_cls_act_prologue, -+}; -+ -+const struct bpf_prog_ops lwt_xmit_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops lwt_seg6local_verifier_ops = { -+ .get_func_proto = lwt_seg6local_func_proto, -+ .is_valid_access = lwt_is_valid_access, -+ .convert_ctx_access = bpf_convert_ctx_access, -+}; -+ -+const struct bpf_prog_ops lwt_seg6local_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops cg_sock_verifier_ops = { -+ .get_func_proto = sock_filter_func_proto, -+ .is_valid_access = sock_filter_is_valid_access, -+ .convert_ctx_access = bpf_sock_convert_ctx_access, -+}; -+ -+const struct bpf_prog_ops cg_sock_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops cg_sock_addr_verifier_ops = { -+ .get_func_proto = sock_addr_func_proto, -+ .is_valid_access = sock_addr_is_valid_access, -+ .convert_ctx_access = sock_addr_convert_ctx_access, -+}; - --int __sk_detach_filter(struct sock *sk, bool locked) -+const struct bpf_prog_ops cg_sock_addr_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops sock_ops_verifier_ops = { -+ .get_func_proto = sock_ops_func_proto, -+ .is_valid_access = sock_ops_is_valid_access, -+ .convert_ctx_access = sock_ops_convert_ctx_access, -+}; -+ -+const struct bpf_prog_ops sock_ops_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops sk_skb_verifier_ops = { -+ .get_func_proto = sk_skb_func_proto, -+ .is_valid_access = sk_skb_is_valid_access, -+ .convert_ctx_access = sk_skb_convert_ctx_access, -+ .gen_prologue = sk_skb_prologue, -+}; -+ -+const struct bpf_prog_ops sk_skb_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops sk_msg_verifier_ops = { -+ .get_func_proto = sk_msg_func_proto, -+ .is_valid_access = sk_msg_is_valid_access, -+ .convert_ctx_access = sk_msg_convert_ctx_access, -+ .gen_prologue = bpf_noop_prologue, -+}; -+ -+const struct bpf_prog_ops sk_msg_prog_ops = { -+}; -+ -+const struct bpf_verifier_ops flow_dissector_verifier_ops = { -+ .get_func_proto = flow_dissector_func_proto, -+ .is_valid_access = flow_dissector_is_valid_access, -+ .convert_ctx_access = flow_dissector_convert_ctx_access, -+}; -+ -+const struct bpf_prog_ops flow_dissector_prog_ops = { -+}; -+ -+int sk_detach_filter(struct sock *sk) - { - int ret = -ENOENT; - struct sk_filter *filter; -@@ -1928,7 +3664,8 @@ int __sk_detach_filter(struct sock *sk, - if (sock_flag(sk, SOCK_FILTER_LOCKED)) - return -EPERM; - -- filter = rcu_dereference_protected(sk->sk_filter, locked); -+ filter = rcu_dereference_protected(sk->sk_filter, -+ lockdep_sock_is_held(sk)); - if (filter) { - RCU_INIT_POINTER(sk->sk_filter, NULL); - sk_filter_uncharge(sk, filter); -@@ -1937,12 +3674,7 @@ int __sk_detach_filter(struct sock *sk, - - return ret; - } --EXPORT_SYMBOL_GPL(__sk_detach_filter); -- --int sk_detach_filter(struct sock *sk) --{ -- return __sk_detach_filter(sk, sock_owned_by_user(sk)); --} -+EXPORT_SYMBOL_GPL(sk_detach_filter); - - int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf, - unsigned int len) -@@ -1953,7 +3685,7 @@ int sk_get_filter(struct sock *sk, struc - - lock_sock(sk); - filter = rcu_dereference_protected(sk->sk_filter, -- sock_owned_by_user(sk)); -+ lockdep_sock_is_held(sk)); - if (!filter) - goto out; - -@@ -1987,3 +3719,5 @@ out: - release_sock(sk); - return ret; - } -+ -+ ---- a/include/asm-generic/barrier.h -+++ b/include/asm-generic/barrier.h -@@ -119,5 +119,29 @@ do { \ - ___p1; \ - }) - -+/** -+ * smp_cond_load_relaxed() - (Spin) wait for cond with no ordering guarantees -+ * @ptr: pointer to the variable to wait on -+ * @cond: boolean expression to wait for -+ * -+ * Equivalent to using READ_ONCE() on the condition variable. -+ * -+ * Due to C lacking lambda expressions we load the value of *ptr into a -+ * pre-named variable @VAL to be used in @cond. -+ */ -+#ifndef smp_cond_load_relaxed -+#define smp_cond_load_relaxed(ptr, cond_expr) ({ \ -+ typeof(ptr) __PTR = (ptr); \ -+ typeof(*ptr) VAL; \ -+ for (;;) { \ -+ VAL = READ_ONCE(*__PTR); \ -+ if (cond_expr) \ -+ break; \ -+ cpu_relax(); \ -+ } \ -+ VAL; \ -+}) -+#endif -+ - #endif /* !__ASSEMBLY__ */ - #endif /* __ASM_GENERIC_BARRIER_H */ ---- a/arch/arm/include/asm/barrier.h -+++ b/arch/arm/include/asm/barrier.h -@@ -94,4 +94,6 @@ do { \ - #define smp_mb__after_atomic() smp_mb() - - #endif /* !__ASSEMBLY__ */ -+ -+#include - #endif /* __ASM_BARRIER_H */ ---- a/include/linux/list_nulls.h -+++ b/include/linux/list_nulls.h -@@ -1,3 +1,4 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ - #ifndef _LINUX_LIST_NULLS_H - #define _LINUX_LIST_NULLS_H - -@@ -29,6 +30,11 @@ struct hlist_nulls_node { - ((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls)) - - #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) -+ -+#define hlist_nulls_entry_safe(ptr, type, member) \ -+ ({ typeof(ptr) ____ptr = (ptr); \ -+ !is_a_nulls(____ptr) ? hlist_nulls_entry(____ptr, type, member) : NULL; \ -+ }) - /** - * ptr_is_a_nulls - Test if a ptr is a nulls - * @ptr: ptr to be tested -@@ -57,7 +63,7 @@ static inline int hlist_nulls_unhashed(c - - static inline int hlist_nulls_empty(const struct hlist_nulls_head *h) - { -- return is_a_nulls(h->first); -+ return is_a_nulls(READ_ONCE(h->first)); - } - - static inline void hlist_nulls_add_head(struct hlist_nulls_node *n, -@@ -66,10 +72,10 @@ static inline void hlist_nulls_add_head( - struct hlist_nulls_node *first = h->first; - - n->next = first; -- n->pprev = &h->first; -+ WRITE_ONCE(n->pprev, &h->first); - h->first = n; - if (!is_a_nulls(first)) -- first->pprev = &n->next; -+ WRITE_ONCE(first->pprev, &n->next); - } - - static inline void __hlist_nulls_del(struct hlist_nulls_node *n) -@@ -79,13 +85,13 @@ static inline void __hlist_nulls_del(str - - WRITE_ONCE(*pprev, next); - if (!is_a_nulls(next)) -- next->pprev = pprev; -+ WRITE_ONCE(next->pprev, pprev); - } - - static inline void hlist_nulls_del(struct hlist_nulls_node *n) - { - __hlist_nulls_del(n); -- n->pprev = LIST_POISON2; -+ WRITE_ONCE(n->pprev, LIST_POISON2); - } - - /** ---- a/include/linux/rculist_nulls.h -+++ b/include/linux/rculist_nulls.h -@@ -1,3 +1,4 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ - #ifndef _LINUX_RCULIST_NULLS_H - #define _LINUX_RCULIST_NULLS_H - -@@ -33,7 +34,7 @@ static inline void hlist_nulls_del_init_ - { - if (!hlist_nulls_unhashed(n)) { - __hlist_nulls_del(n); -- n->pprev = NULL; -+ WRITE_ONCE(n->pprev, NULL); - } - } - -@@ -65,7 +66,7 @@ static inline void hlist_nulls_del_init_ - static inline void hlist_nulls_del_rcu(struct hlist_nulls_node *n) - { - __hlist_nulls_del(n); -- n->pprev = LIST_POISON2; -+ WRITE_ONCE(n->pprev, LIST_POISON2); - } - - /** -@@ -93,11 +94,49 @@ static inline void hlist_nulls_add_head_ - struct hlist_nulls_node *first = h->first; - - n->next = first; -- n->pprev = &h->first; -+ WRITE_ONCE(n->pprev, &h->first); - rcu_assign_pointer(hlist_nulls_first_rcu(h), n); - if (!is_a_nulls(first)) -- first->pprev = &n->next; -+ WRITE_ONCE(first->pprev, &n->next); - } -+ -+/** -+ * hlist_nulls_add_tail_rcu -+ * @n: the element to add to the hash list. -+ * @h: the list to add to. -+ * -+ * Description: -+ * Adds the specified element to the specified hlist_nulls, -+ * while permitting racing traversals. -+ * -+ * The caller must take whatever precautions are necessary -+ * (such as holding appropriate locks) to avoid racing -+ * with another list-mutation primitive, such as hlist_nulls_add_head_rcu() -+ * or hlist_nulls_del_rcu(), running on this same list. -+ * However, it is perfectly legal to run concurrently with -+ * the _rcu list-traversal primitives, such as -+ * hlist_nulls_for_each_entry_rcu(), used to prevent memory-consistency -+ * problems on Alpha CPUs. Regardless of the type of CPU, the -+ * list-traversal primitive must be guarded by rcu_read_lock(). -+ */ -+static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n, -+ struct hlist_nulls_head *h) -+{ -+ struct hlist_nulls_node *i, *last = NULL; -+ -+ /* Note: write side code, so rcu accessors are not needed. */ -+ for (i = h->first; !is_a_nulls(i); i = i->next) -+ last = i; -+ -+ if (last) { -+ n->next = last->next; -+ n->pprev = &last->next; -+ rcu_assign_pointer(hlist_next_rcu(last), n); -+ } else { -+ hlist_nulls_add_head_rcu(n, h); -+ } -+} -+ - /** - * hlist_nulls_for_each_entry_rcu - iterate over rcu list of given type - * @tpos: the type * to use as a loop cursor. -@@ -107,7 +146,7 @@ static inline void hlist_nulls_add_head_ - * - * The barrier() is needed to make sure compiler doesn't cache first element [1], - * as this loop can be restarted [2] -- * [1] Documentation/atomic_ops.txt around line 114 -+ * [1] Documentation/core-api/atomic_ops.rst around line 114 - * [2] Documentation/RCU/rculist_nulls.txt around line 146 - */ - #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ -@@ -117,5 +156,19 @@ static inline void hlist_nulls_add_head_ - ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ - pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos))) - -+/** -+ * hlist_nulls_for_each_entry_safe - -+ * iterate over list of given type safe against removal of list entry -+ * @tpos: the type * to use as a loop cursor. -+ * @pos: the &struct hlist_nulls_node to use as a loop cursor. -+ * @head: the head for your list. -+ * @member: the name of the hlist_nulls_node within the struct. -+ */ -+#define hlist_nulls_for_each_entry_safe(tpos, pos, head, member) \ -+ for (({barrier();}), \ -+ pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ -+ (!is_a_nulls(pos)) && \ -+ ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); \ -+ pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos)); 1; });) - #endif - #endif ---- a/drivers/net/tun.c -+++ b/drivers/net/tun.c -@@ -627,8 +627,9 @@ static int tun_attach(struct tun_struct - - /* Re-attach the filter to persist device */ - if (!skip_filter && (tun->filter_attached == true)) { -- err = __sk_attach_filter(&tun->fprog, tfile->socket.sk, -- lockdep_rtnl_is_held()); -+ lock_sock(tfile->socket.sk); -+ err = sk_attach_filter(&tun->fprog, tfile->socket.sk); -+ release_sock(tfile->socket.sk); - if (!err) - goto out; - } -@@ -1835,7 +1836,9 @@ static void tun_detach_filter(struct tun - - for (i = 0; i < n; i++) { - tfile = rtnl_dereference(tun->tfiles[i]); -- __sk_detach_filter(tfile->socket.sk, lockdep_rtnl_is_held()); -+ lock_sock(tfile->socket.sk); -+ sk_detach_filter(tfile->socket.sk); -+ release_sock(tfile->socket.sk); - } - - tun->filter_attached = false; -@@ -1848,8 +1851,9 @@ static int tun_attach_filter(struct tun_ - - for (i = 0; i < tun->numqueues; i++) { - tfile = rtnl_dereference(tun->tfiles[i]); -- ret = __sk_attach_filter(&tun->fprog, tfile->socket.sk, -- lockdep_rtnl_is_held()); -+ lock_sock(tfile->socket.sk); -+ ret = sk_attach_filter(&tun->fprog, tfile->socket.sk); -+ release_sock(tfile->socket.sk); - if (ret) { - tun_detach_filter(tun, i); - return ret; ---- a/include/linux/list.h -+++ b/include/linux/list.h -@@ -1,3 +1,4 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ - #ifndef _LINUX_LIST_H - #define _LINUX_LIST_H - -@@ -24,31 +25,46 @@ - - static inline void INIT_LIST_HEAD(struct list_head *list) - { -- list->next = list; -+ WRITE_ONCE(list->next, list); - list->prev = list; - } - -+#ifdef CONFIG_DEBUG_LIST -+extern bool __list_add_valid(struct list_head *new, -+ struct list_head *prev, -+ struct list_head *next); -+extern bool __list_del_entry_valid(struct list_head *entry); -+#else -+static inline bool __list_add_valid(struct list_head *new, -+ struct list_head *prev, -+ struct list_head *next) -+{ -+ return true; -+} -+static inline bool __list_del_entry_valid(struct list_head *entry) -+{ -+ return true; -+} -+#endif -+ - /* - * Insert a new entry between two known consecutive entries. - * - * This is only for internal list manipulation where we know - * the prev/next entries already! - */ --#ifndef CONFIG_DEBUG_LIST - static inline void __list_add(struct list_head *new, - struct list_head *prev, - struct list_head *next) - { -+ if (!__list_add_valid(new, prev, next)) -+ return; -+ - next->prev = new; - new->next = next; - new->prev = prev; -- prev->next = new; -+ WRITE_ONCE(prev->next, new); - } --#else --extern void __list_add(struct list_head *new, -- struct list_head *prev, -- struct list_head *next); --#endif - - /** - * list_add - add a new entry -@@ -90,28 +106,40 @@ static inline void __list_del(struct lis - WRITE_ONCE(prev->next, next); - } - -+/* -+ * Delete a list entry and clear the 'prev' pointer. -+ * -+ * This is a special-purpose list clearing method used in the networking code -+ * for lists allocated as per-cpu, where we don't want to incur the extra -+ * WRITE_ONCE() overhead of a regular list_del_init(). The code that uses this -+ * needs to check the node 'prev' pointer instead of calling list_empty(). -+ */ -+static inline void __list_del_clearprev(struct list_head *entry) -+{ -+ __list_del(entry->prev, entry->next); -+ entry->prev = NULL; -+} -+ - /** - * list_del - deletes entry from list. - * @entry: the element to delete from the list. - * Note: list_empty() on entry does not return true after this, the entry is - * in an undefined state. - */ --#ifndef CONFIG_DEBUG_LIST - static inline void __list_del_entry(struct list_head *entry) - { -+ if (!__list_del_entry_valid(entry)) -+ return; -+ - __list_del(entry->prev, entry->next); - } - - static inline void list_del(struct list_head *entry) - { -- __list_del(entry->prev, entry->next); -+ __list_del_entry(entry); - entry->next = LIST_POISON1; - entry->prev = LIST_POISON2; - } --#else --extern void __list_del_entry(struct list_head *entry); --extern void list_del(struct list_head *entry); --#endif - - /** - * list_replace - replace old entry by new one -@@ -137,6 +165,23 @@ static inline void list_replace_init(str - } - - /** -+ * list_swap - replace entry1 with entry2 and re-add entry1 at entry2's position -+ * @entry1: the location to place entry2 -+ * @entry2: the location to place entry1 -+ */ -+static inline void list_swap(struct list_head *entry1, -+ struct list_head *entry2) -+{ -+ struct list_head *pos = entry2->prev; -+ -+ list_del(entry2); -+ list_replace(entry1, entry2); -+ if (pos == entry1) -+ pos = entry2; -+ list_add(entry1, pos); -+} -+ -+/** - * list_del_init - deletes entry from list and reinitialize it. - * @entry: the element to delete from the list. - */ -@@ -170,6 +215,40 @@ static inline void list_move_tail(struct - } - - /** -+ * list_bulk_move_tail - move a subsection of a list to its tail -+ * @head: the head that will follow our entry -+ * @first: first entry to move -+ * @last: last entry to move, can be the same as first -+ * -+ * Move all entries between @first and including @last before @head. -+ * All three entries must belong to the same linked list. -+ */ -+static inline void list_bulk_move_tail(struct list_head *head, -+ struct list_head *first, -+ struct list_head *last) -+{ -+ first->prev->next = last->next; -+ last->next->prev = first->prev; -+ -+ head->prev->next = first; -+ first->prev = head->prev; -+ -+ last->next = head; -+ head->prev = last; -+} -+ -+/** -+ * list_is_first -- tests whether @list is the first entry in list @head -+ * @list: the entry to test -+ * @head: the head of the list -+ */ -+static inline int list_is_first(const struct list_head *list, -+ const struct list_head *head) -+{ -+ return list->prev == head; -+} -+ -+/** - * list_is_last - tests whether @list is the last entry in list @head - * @list: the entry to test - * @head: the head of the list -@@ -186,7 +265,7 @@ static inline int list_is_last(const str - */ - static inline int list_empty(const struct list_head *head) - { -- return head->next == head; -+ return READ_ONCE(head->next) == head; - } - - /** -@@ -223,6 +302,24 @@ static inline void list_rotate_left(stru - } - - /** -+ * list_rotate_to_front() - Rotate list to specific item. -+ * @list: The desired new front of the list. -+ * @head: The head of the list. -+ * -+ * Rotates list so that @list becomes the new front of the list. -+ */ -+static inline void list_rotate_to_front(struct list_head *list, -+ struct list_head *head) -+{ -+ /* -+ * Deletes the list head from the list denoted by @head and -+ * places it as the tail of @list, this effectively rotates the -+ * list so that @list is at the front. -+ */ -+ list_move_tail(head, list); -+} -+ -+/** - * list_is_singular - tests whether a list has just one entry. - * @head: the list to test. - */ -@@ -271,6 +368,36 @@ static inline void list_cut_position(str - __list_cut_position(list, head, entry); - } - -+/** -+ * list_cut_before - cut a list into two, before given entry -+ * @list: a new list to add all removed entries -+ * @head: a list with entries -+ * @entry: an entry within head, could be the head itself -+ * -+ * This helper moves the initial part of @head, up to but -+ * excluding @entry, from @head to @list. You should pass -+ * in @entry an element you know is on @head. @list should -+ * be an empty list or a list you do not care about losing -+ * its data. -+ * If @entry == @head, all entries on @head are moved to -+ * @list. -+ */ -+static inline void list_cut_before(struct list_head *list, -+ struct list_head *head, -+ struct list_head *entry) -+{ -+ if (head->next == entry) { -+ INIT_LIST_HEAD(list); -+ return; -+ } -+ list->next = head->next; -+ list->next->prev = list; -+ list->prev = entry->prev; -+ list->prev->next = list; -+ head->next = entry; -+ entry->prev = head; -+} -+ - static inline void __list_splice(const struct list_head *list, - struct list_head *prev, - struct list_head *next) -@@ -381,8 +508,11 @@ static inline void list_splice_tail_init - * - * Note that if the list is empty, it returns NULL. - */ --#define list_first_entry_or_null(ptr, type, member) \ -- (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) -+#define list_first_entry_or_null(ptr, type, member) ({ \ -+ struct list_head *head__ = (ptr); \ -+ struct list_head *pos__ = READ_ONCE(head__->next); \ -+ pos__ != head__ ? list_entry(pos__, type, member) : NULL; \ -+}) - - /** - * list_next_entry - get the next element in list -@@ -511,6 +641,19 @@ static inline void list_splice_tail_init - pos = list_next_entry(pos, member)) - - /** -+ * list_for_each_entry_from_reverse - iterate backwards over list of given type -+ * from the current point -+ * @pos: the type * to use as a loop cursor. -+ * @head: the head for your list. -+ * @member: the name of the list_head within the struct. -+ * -+ * Iterate backwards over list of given type, continuing from current position. -+ */ -+#define list_for_each_entry_from_reverse(pos, head, member) \ -+ for (; &pos->member != (head); \ -+ pos = list_prev_entry(pos, member)) -+ -+/** - * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry - * @pos: the type * to use as a loop cursor. - * @n: another type * to use as temporary storage -@@ -608,7 +751,7 @@ static inline int hlist_unhashed(const s - - static inline int hlist_empty(const struct hlist_head *h) - { -- return !h->first; -+ return !READ_ONCE(h->first); - } - - static inline void __hlist_del(struct hlist_node *n) -@@ -642,7 +785,7 @@ static inline void hlist_add_head(struct - n->next = first; - if (first) - first->pprev = &n->next; -- h->first = n; -+ WRITE_ONCE(h->first, n); - n->pprev = &h->first; - } - -@@ -653,7 +796,7 @@ static inline void hlist_add_before(stru - n->pprev = next->pprev; - n->next = next; - next->pprev = &n->next; -- *(n->pprev) = n; -+ WRITE_ONCE(*(n->pprev), n); - } - - static inline void hlist_add_behind(struct hlist_node *n, -@@ -679,6 +822,16 @@ static inline bool hlist_fake(struct hli - } - - /* -+ * Check whether the node is the only node of the head without -+ * accessing head: -+ */ -+static inline bool -+hlist_is_singular_node(struct hlist_node *n, struct hlist_head *h) -+{ -+ return !n->next && n->pprev == &h->first; -+} -+ -+/* - * Move a list from one list head to another. Fixup the pprev - * reference of the first entry if it exists. - */ ---- /dev/null -+++ b/include/linux/ptr_ring.h -@@ -0,0 +1,673 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+/* -+ * Definitions for the 'struct ptr_ring' datastructure. -+ * -+ * Author: -+ * Michael S. Tsirkin -+ * -+ * Copyright (C) 2016 Red Hat, Inc. -+ * -+ * This is a limited-size FIFO maintaining pointers in FIFO order, with -+ * one CPU producing entries and another consuming entries from a FIFO. -+ * -+ * This implementation tries to minimize cache-contention when there is a -+ * single producer and a single consumer CPU. -+ */ -+ -+#ifndef _LINUX_PTR_RING_H -+#define _LINUX_PTR_RING_H 1 -+ -+#ifdef __KERNEL__ -+#include -+#include -+#include -+#include -+#include -+#include -+#endif -+ -+struct ptr_ring { -+ int producer ____cacheline_aligned_in_smp; -+ spinlock_t producer_lock; -+ int consumer_head ____cacheline_aligned_in_smp; /* next valid entry */ -+ int consumer_tail; /* next entry to invalidate */ -+ spinlock_t consumer_lock; -+ /* Shared consumer/producer data */ -+ /* Read-only by both the producer and the consumer */ -+ int size ____cacheline_aligned_in_smp; /* max entries in queue */ -+ int batch; /* number of entries to consume in a batch */ -+ void **queue; -+}; -+ -+/* Note: callers invoking this in a loop must use a compiler barrier, -+ * for example cpu_relax(). -+ * -+ * NB: this is unlike __ptr_ring_empty in that callers must hold producer_lock: -+ * see e.g. ptr_ring_full. -+ */ -+static inline bool __ptr_ring_full(struct ptr_ring *r) -+{ -+ return r->queue[r->producer]; -+} -+ -+static inline bool ptr_ring_full(struct ptr_ring *r) -+{ -+ bool ret; -+ -+ spin_lock(&r->producer_lock); -+ ret = __ptr_ring_full(r); -+ spin_unlock(&r->producer_lock); -+ -+ return ret; -+} -+ -+static inline bool ptr_ring_full_irq(struct ptr_ring *r) -+{ -+ bool ret; -+ -+ spin_lock_irq(&r->producer_lock); -+ ret = __ptr_ring_full(r); -+ spin_unlock_irq(&r->producer_lock); -+ -+ return ret; -+} -+ -+static inline bool ptr_ring_full_any(struct ptr_ring *r) -+{ -+ unsigned long flags; -+ bool ret; -+ -+ spin_lock_irqsave(&r->producer_lock, flags); -+ ret = __ptr_ring_full(r); -+ spin_unlock_irqrestore(&r->producer_lock, flags); -+ -+ return ret; -+} -+ -+static inline bool ptr_ring_full_bh(struct ptr_ring *r) -+{ -+ bool ret; -+ -+ spin_lock_bh(&r->producer_lock); -+ ret = __ptr_ring_full(r); -+ spin_unlock_bh(&r->producer_lock); -+ -+ return ret; -+} -+ -+/* Note: callers invoking this in a loop must use a compiler barrier, -+ * for example cpu_relax(). Callers must hold producer_lock. -+ * Callers are responsible for making sure pointer that is being queued -+ * points to a valid data. -+ */ -+static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr) -+{ -+ if (unlikely(!r->size) || r->queue[r->producer]) -+ return -ENOSPC; -+ -+ /* Make sure the pointer we are storing points to a valid data. */ -+ /* Pairs with smp_read_barrier_depends in __ptr_ring_consume. */ -+ smp_wmb(); -+ -+ WRITE_ONCE(r->queue[r->producer++], ptr); -+ if (unlikely(r->producer >= r->size)) -+ r->producer = 0; -+ return 0; -+} -+ -+/* -+ * Note: resize (below) nests producer lock within consumer lock, so if you -+ * consume in interrupt or BH context, you must disable interrupts/BH when -+ * calling this. -+ */ -+static inline int ptr_ring_produce(struct ptr_ring *r, void *ptr) -+{ -+ int ret; -+ -+ spin_lock(&r->producer_lock); -+ ret = __ptr_ring_produce(r, ptr); -+ spin_unlock(&r->producer_lock); -+ -+ return ret; -+} -+ -+static inline int ptr_ring_produce_irq(struct ptr_ring *r, void *ptr) -+{ -+ int ret; -+ -+ spin_lock_irq(&r->producer_lock); -+ ret = __ptr_ring_produce(r, ptr); -+ spin_unlock_irq(&r->producer_lock); -+ -+ return ret; -+} -+ -+static inline int ptr_ring_produce_any(struct ptr_ring *r, void *ptr) -+{ -+ unsigned long flags; -+ int ret; -+ -+ spin_lock_irqsave(&r->producer_lock, flags); -+ ret = __ptr_ring_produce(r, ptr); -+ spin_unlock_irqrestore(&r->producer_lock, flags); -+ -+ return ret; -+} -+ -+static inline int ptr_ring_produce_bh(struct ptr_ring *r, void *ptr) -+{ -+ int ret; -+ -+ spin_lock_bh(&r->producer_lock); -+ ret = __ptr_ring_produce(r, ptr); -+ spin_unlock_bh(&r->producer_lock); -+ -+ return ret; -+} -+ -+static inline void *__ptr_ring_peek(struct ptr_ring *r) -+{ -+ if (likely(r->size)) -+ return READ_ONCE(r->queue[r->consumer_head]); -+ return NULL; -+} -+ -+/* -+ * Test ring empty status without taking any locks. -+ * -+ * NB: This is only safe to call if ring is never resized. -+ * -+ * However, if some other CPU consumes ring entries at the same time, the value -+ * returned is not guaranteed to be correct. -+ * -+ * In this case - to avoid incorrectly detecting the ring -+ * as empty - the CPU consuming the ring entries is responsible -+ * for either consuming all ring entries until the ring is empty, -+ * or synchronizing with some other CPU and causing it to -+ * re-test __ptr_ring_empty and/or consume the ring enteries -+ * after the synchronization point. -+ * -+ * Note: callers invoking this in a loop must use a compiler barrier, -+ * for example cpu_relax(). -+ */ -+static inline bool __ptr_ring_empty(struct ptr_ring *r) -+{ -+ if (likely(r->size)) -+ return !r->queue[READ_ONCE(r->consumer_head)]; -+ return true; -+} -+ -+static inline bool ptr_ring_empty(struct ptr_ring *r) -+{ -+ bool ret; -+ -+ spin_lock(&r->consumer_lock); -+ ret = __ptr_ring_empty(r); -+ spin_unlock(&r->consumer_lock); -+ -+ return ret; -+} -+ -+static inline bool ptr_ring_empty_irq(struct ptr_ring *r) -+{ -+ bool ret; -+ -+ spin_lock_irq(&r->consumer_lock); -+ ret = __ptr_ring_empty(r); -+ spin_unlock_irq(&r->consumer_lock); -+ -+ return ret; -+} -+ -+static inline bool ptr_ring_empty_any(struct ptr_ring *r) -+{ -+ unsigned long flags; -+ bool ret; -+ -+ spin_lock_irqsave(&r->consumer_lock, flags); -+ ret = __ptr_ring_empty(r); -+ spin_unlock_irqrestore(&r->consumer_lock, flags); -+ -+ return ret; -+} -+ -+static inline bool ptr_ring_empty_bh(struct ptr_ring *r) -+{ -+ bool ret; -+ -+ spin_lock_bh(&r->consumer_lock); -+ ret = __ptr_ring_empty(r); -+ spin_unlock_bh(&r->consumer_lock); -+ -+ return ret; -+} -+ -+/* Must only be called after __ptr_ring_peek returned !NULL */ -+static inline void __ptr_ring_discard_one(struct ptr_ring *r) -+{ -+ /* Fundamentally, what we want to do is update consumer -+ * index and zero out the entry so producer can reuse it. -+ * Doing it naively at each consume would be as simple as: -+ * consumer = r->consumer; -+ * r->queue[consumer++] = NULL; -+ * if (unlikely(consumer >= r->size)) -+ * consumer = 0; -+ * r->consumer = consumer; -+ * but that is suboptimal when the ring is full as producer is writing -+ * out new entries in the same cache line. Defer these updates until a -+ * batch of entries has been consumed. -+ */ -+ /* Note: we must keep consumer_head valid at all times for __ptr_ring_empty -+ * to work correctly. -+ */ -+ int consumer_head = r->consumer_head; -+ int head = consumer_head++; -+ -+ /* Once we have processed enough entries invalidate them in -+ * the ring all at once so producer can reuse their space in the ring. -+ * We also do this when we reach end of the ring - not mandatory -+ * but helps keep the implementation simple. -+ */ -+ if (unlikely(consumer_head - r->consumer_tail >= r->batch || -+ consumer_head >= r->size)) { -+ /* Zero out entries in the reverse order: this way we touch the -+ * cache line that producer might currently be reading the last; -+ * producer won't make progress and touch other cache lines -+ * besides the first one until we write out all entries. -+ */ -+ while (likely(head >= r->consumer_tail)) -+ r->queue[head--] = NULL; -+ r->consumer_tail = consumer_head; -+ } -+ if (unlikely(consumer_head >= r->size)) { -+ consumer_head = 0; -+ r->consumer_tail = 0; -+ } -+ /* matching READ_ONCE in __ptr_ring_empty for lockless tests */ -+ WRITE_ONCE(r->consumer_head, consumer_head); -+} -+ -+static inline void *__ptr_ring_consume(struct ptr_ring *r) -+{ -+ void *ptr; -+ -+ /* The READ_ONCE in __ptr_ring_peek guarantees that anyone -+ * accessing data through the pointer is up to date. Pairs -+ * with smp_wmb in __ptr_ring_produce. -+ */ -+ ptr = __ptr_ring_peek(r); -+ if (ptr) -+ __ptr_ring_discard_one(r); -+ -+ return ptr; -+} -+ -+static inline int __ptr_ring_consume_batched(struct ptr_ring *r, -+ void **array, int n) -+{ -+ void *ptr; -+ int i; -+ -+ for (i = 0; i < n; i++) { -+ ptr = __ptr_ring_consume(r); -+ if (!ptr) -+ break; -+ array[i] = ptr; -+ } -+ -+ return i; -+} -+ -+/* -+ * Note: resize (below) nests producer lock within consumer lock, so if you -+ * call this in interrupt or BH context, you must disable interrupts/BH when -+ * producing. -+ */ -+static inline void *ptr_ring_consume(struct ptr_ring *r) -+{ -+ void *ptr; -+ -+ spin_lock(&r->consumer_lock); -+ ptr = __ptr_ring_consume(r); -+ spin_unlock(&r->consumer_lock); -+ -+ return ptr; -+} -+ -+static inline void *ptr_ring_consume_irq(struct ptr_ring *r) -+{ -+ void *ptr; -+ -+ spin_lock_irq(&r->consumer_lock); -+ ptr = __ptr_ring_consume(r); -+ spin_unlock_irq(&r->consumer_lock); -+ -+ return ptr; -+} -+ -+static inline void *ptr_ring_consume_any(struct ptr_ring *r) -+{ -+ unsigned long flags; -+ void *ptr; -+ -+ spin_lock_irqsave(&r->consumer_lock, flags); -+ ptr = __ptr_ring_consume(r); -+ spin_unlock_irqrestore(&r->consumer_lock, flags); -+ -+ return ptr; -+} -+ -+static inline void *ptr_ring_consume_bh(struct ptr_ring *r) -+{ -+ void *ptr; -+ -+ spin_lock_bh(&r->consumer_lock); -+ ptr = __ptr_ring_consume(r); -+ spin_unlock_bh(&r->consumer_lock); -+ -+ return ptr; -+} -+ -+static inline int ptr_ring_consume_batched(struct ptr_ring *r, -+ void **array, int n) -+{ -+ int ret; -+ -+ spin_lock(&r->consumer_lock); -+ ret = __ptr_ring_consume_batched(r, array, n); -+ spin_unlock(&r->consumer_lock); -+ -+ return ret; -+} -+ -+static inline int ptr_ring_consume_batched_irq(struct ptr_ring *r, -+ void **array, int n) -+{ -+ int ret; -+ -+ spin_lock_irq(&r->consumer_lock); -+ ret = __ptr_ring_consume_batched(r, array, n); -+ spin_unlock_irq(&r->consumer_lock); -+ -+ return ret; -+} -+ -+static inline int ptr_ring_consume_batched_any(struct ptr_ring *r, -+ void **array, int n) -+{ -+ unsigned long flags; -+ int ret; -+ -+ spin_lock_irqsave(&r->consumer_lock, flags); -+ ret = __ptr_ring_consume_batched(r, array, n); -+ spin_unlock_irqrestore(&r->consumer_lock, flags); -+ -+ return ret; -+} -+ -+static inline int ptr_ring_consume_batched_bh(struct ptr_ring *r, -+ void **array, int n) -+{ -+ int ret; -+ -+ spin_lock_bh(&r->consumer_lock); -+ ret = __ptr_ring_consume_batched(r, array, n); -+ spin_unlock_bh(&r->consumer_lock); -+ -+ return ret; -+} -+ -+/* Cast to structure type and call a function without discarding from FIFO. -+ * Function must return a value. -+ * Callers must take consumer_lock. -+ */ -+#define __PTR_RING_PEEK_CALL(r, f) ((f)(__ptr_ring_peek(r))) -+ -+#define PTR_RING_PEEK_CALL(r, f) ({ \ -+ typeof((f)(NULL)) __PTR_RING_PEEK_CALL_v; \ -+ \ -+ spin_lock(&(r)->consumer_lock); \ -+ __PTR_RING_PEEK_CALL_v = __PTR_RING_PEEK_CALL(r, f); \ -+ spin_unlock(&(r)->consumer_lock); \ -+ __PTR_RING_PEEK_CALL_v; \ -+}) -+ -+#define PTR_RING_PEEK_CALL_IRQ(r, f) ({ \ -+ typeof((f)(NULL)) __PTR_RING_PEEK_CALL_v; \ -+ \ -+ spin_lock_irq(&(r)->consumer_lock); \ -+ __PTR_RING_PEEK_CALL_v = __PTR_RING_PEEK_CALL(r, f); \ -+ spin_unlock_irq(&(r)->consumer_lock); \ -+ __PTR_RING_PEEK_CALL_v; \ -+}) -+ -+#define PTR_RING_PEEK_CALL_BH(r, f) ({ \ -+ typeof((f)(NULL)) __PTR_RING_PEEK_CALL_v; \ -+ \ -+ spin_lock_bh(&(r)->consumer_lock); \ -+ __PTR_RING_PEEK_CALL_v = __PTR_RING_PEEK_CALL(r, f); \ -+ spin_unlock_bh(&(r)->consumer_lock); \ -+ __PTR_RING_PEEK_CALL_v; \ -+}) -+ -+#define PTR_RING_PEEK_CALL_ANY(r, f) ({ \ -+ typeof((f)(NULL)) __PTR_RING_PEEK_CALL_v; \ -+ unsigned long __PTR_RING_PEEK_CALL_f;\ -+ \ -+ spin_lock_irqsave(&(r)->consumer_lock, __PTR_RING_PEEK_CALL_f); \ -+ __PTR_RING_PEEK_CALL_v = __PTR_RING_PEEK_CALL(r, f); \ -+ spin_unlock_irqrestore(&(r)->consumer_lock, __PTR_RING_PEEK_CALL_f); \ -+ __PTR_RING_PEEK_CALL_v; \ -+}) -+ -+/* Not all gfp_t flags (besides GFP_KERNEL) are allowed. See -+ * documentation for vmalloc for which of them are legal. -+ */ -+static inline void **__ptr_ring_init_queue_alloc(unsigned int size, gfp_t gfp) -+{ -+ if (size > KMALLOC_MAX_SIZE / sizeof(void *)) -+ return NULL; -+ return kmalloc_array(size, sizeof(void *), gfp | __GFP_ZERO); -+} -+ -+static inline void __ptr_ring_set_size(struct ptr_ring *r, int size) -+{ -+ r->size = size; -+ r->batch = SMP_CACHE_BYTES * 2 / sizeof(*(r->queue)); -+ /* We need to set batch at least to 1 to make logic -+ * in __ptr_ring_discard_one work correctly. -+ * Batching too much (because ring is small) would cause a lot of -+ * burstiness. Needs tuning, for now disable batching. -+ */ -+ if (r->batch > r->size / 2 || !r->batch) -+ r->batch = 1; -+} -+ -+static inline int ptr_ring_init(struct ptr_ring *r, int size, gfp_t gfp) -+{ -+ r->queue = __ptr_ring_init_queue_alloc(size, gfp); -+ if (!r->queue) -+ return -ENOMEM; -+ -+ __ptr_ring_set_size(r, size); -+ r->producer = r->consumer_head = r->consumer_tail = 0; -+ spin_lock_init(&r->producer_lock); -+ spin_lock_init(&r->consumer_lock); -+ -+ return 0; -+} -+ -+/* -+ * Return entries into ring. Destroy entries that don't fit. -+ * -+ * Note: this is expected to be a rare slow path operation. -+ * -+ * Note: producer lock is nested within consumer lock, so if you -+ * resize you must make sure all uses nest correctly. -+ * In particular if you consume ring in interrupt or BH context, you must -+ * disable interrupts/BH when doing so. -+ */ -+static inline void ptr_ring_unconsume(struct ptr_ring *r, void **batch, int n, -+ void (*destroy)(void *)) -+{ -+ unsigned long flags; -+ int head; -+ -+ spin_lock_irqsave(&r->consumer_lock, flags); -+ spin_lock(&r->producer_lock); -+ -+ if (!r->size) -+ goto done; -+ -+ /* -+ * Clean out buffered entries (for simplicity). This way following code -+ * can test entries for NULL and if not assume they are valid. -+ */ -+ head = r->consumer_head - 1; -+ while (likely(head >= r->consumer_tail)) -+ r->queue[head--] = NULL; -+ r->consumer_tail = r->consumer_head; -+ -+ /* -+ * Go over entries in batch, start moving head back and copy entries. -+ * Stop when we run into previously unconsumed entries. -+ */ -+ while (n) { -+ head = r->consumer_head - 1; -+ if (head < 0) -+ head = r->size - 1; -+ if (r->queue[head]) { -+ /* This batch entry will have to be destroyed. */ -+ goto done; -+ } -+ r->queue[head] = batch[--n]; -+ r->consumer_tail = head; -+ /* matching READ_ONCE in __ptr_ring_empty for lockless tests */ -+ WRITE_ONCE(r->consumer_head, head); -+ } -+ -+done: -+ /* Destroy all entries left in the batch. */ -+ while (n) -+ destroy(batch[--n]); -+ spin_unlock(&r->producer_lock); -+ spin_unlock_irqrestore(&r->consumer_lock, flags); -+} -+ -+static inline void **__ptr_ring_swap_queue(struct ptr_ring *r, void **queue, -+ int size, gfp_t gfp, -+ void (*destroy)(void *)) -+{ -+ int producer = 0; -+ void **old; -+ void *ptr; -+ -+ while ((ptr = __ptr_ring_consume(r))) -+ if (producer < size) -+ queue[producer++] = ptr; -+ else if (destroy) -+ destroy(ptr); -+ -+ if (producer >= size) -+ producer = 0; -+ __ptr_ring_set_size(r, size); -+ r->producer = producer; -+ r->consumer_head = 0; -+ r->consumer_tail = 0; -+ old = r->queue; -+ r->queue = queue; -+ -+ return old; -+} -+ -+/* -+ * Note: producer lock is nested within consumer lock, so if you -+ * resize you must make sure all uses nest correctly. -+ * In particular if you consume ring in interrupt or BH context, you must -+ * disable interrupts/BH when doing so. -+ */ -+static inline int ptr_ring_resize(struct ptr_ring *r, int size, gfp_t gfp, -+ void (*destroy)(void *)) -+{ -+ unsigned long flags; -+ void **queue = __ptr_ring_init_queue_alloc(size, gfp); -+ void **old; -+ -+ if (!queue) -+ return -ENOMEM; -+ -+ spin_lock_irqsave(&(r)->consumer_lock, flags); -+ spin_lock(&(r)->producer_lock); -+ -+ old = __ptr_ring_swap_queue(r, queue, size, gfp, destroy); -+ -+ spin_unlock(&(r)->producer_lock); -+ spin_unlock_irqrestore(&(r)->consumer_lock, flags); -+ -+ kvfree(old); -+ -+ return 0; -+} -+ -+/* -+ * Note: producer lock is nested within consumer lock, so if you -+ * resize you must make sure all uses nest correctly. -+ * In particular if you consume ring in interrupt or BH context, you must -+ * disable interrupts/BH when doing so. -+ */ -+static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, -+ unsigned int nrings, -+ int size, -+ gfp_t gfp, void (*destroy)(void *)) -+{ -+ unsigned long flags; -+ void ***queues; -+ int i; -+ -+ queues = kmalloc_array(nrings, sizeof(*queues), gfp); -+ if (!queues) -+ goto noqueues; -+ -+ for (i = 0; i < nrings; ++i) { -+ queues[i] = __ptr_ring_init_queue_alloc(size, gfp); -+ if (!queues[i]) -+ goto nomem; -+ } -+ -+ for (i = 0; i < nrings; ++i) { -+ spin_lock_irqsave(&(rings[i])->consumer_lock, flags); -+ spin_lock(&(rings[i])->producer_lock); -+ queues[i] = __ptr_ring_swap_queue(rings[i], queues[i], -+ size, gfp, destroy); -+ spin_unlock(&(rings[i])->producer_lock); -+ spin_unlock_irqrestore(&(rings[i])->consumer_lock, flags); -+ } -+ -+ for (i = 0; i < nrings; ++i) -+ kvfree(queues[i]); -+ -+ kfree(queues); -+ -+ return 0; -+ -+nomem: -+ while (--i >= 0) -+ kvfree(queues[i]); -+ -+ kfree(queues); -+ -+noqueues: -+ return -ENOMEM; -+} -+ -+static inline void ptr_ring_cleanup(struct ptr_ring *r, void (*destroy)(void *)) -+{ -+ void *ptr; -+ -+ if (destroy) -+ while ((ptr = ptr_ring_consume(r))) -+ destroy(ptr); -+ kvfree(r->queue); -+} -+ -+#endif /* _LINUX_PTR_RING_H */ ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - #include - - /* A. Checksumming of received packets by device. -@@ -592,13 +593,23 @@ struct sk_buff { - */ - kmemcheck_bitfield_begin(flags1); - __u16 queue_mapping; -+ -+/* if you move cloned around you also must adapt those constants */ -+#ifdef __BIG_ENDIAN_BITFIELD -+#define CLONED_MASK (1 << 7) -+#else -+#define CLONED_MASK 1 -+#endif -+#define CLONED_OFFSET() offsetof(struct sk_buff, __cloned_offset) -+ -+ __u8 __cloned_offset[0]; - __u8 cloned:1, - nohdr:1, - fclone:2, - peeked:1, - head_frag:1, -- xmit_more:1; -- /* one bit hole */ -+ xmit_more:1, -+ __unused:1; /* one bit hole */ - kmemcheck_bitfield_end(flags1); - - /* fields enclosed in headers_start/headers_end are copied -@@ -639,6 +650,14 @@ struct sk_buff { - __u8 csum_level:2; - __u8 csum_bad:1; - -+#ifdef __BIG_ENDIAN_BITFIELD -+#define PKT_VLAN_PRESENT_BIT 7 -+#else -+#define PKT_VLAN_PRESENT_BIT 0 -+#endif -+#define PKT_VLAN_PRESENT_OFFSET() offsetof(struct sk_buff, __pkt_vlan_present_offset) -+ __u8 __pkt_vlan_present_offset[0]; -+ __u8 vlan_present:1; - #ifdef CONFIG_IPV6_NDISC_NODETYPE - __u8 ndisc_nodetype:2; - #endif -@@ -647,7 +666,7 @@ struct sk_buff { - __u8 remcsum_offload:1; - __u8 gro_skip:1; - __u8 fast_forwarded:1; -- /* 1 or 3 bit hole */ -+ /* 0 or 2 bit hole */ - - #ifdef CONFIG_NET_SCHED - __u16 tc_index; /* traffic control index */ -@@ -805,6 +824,15 @@ static inline struct rtable *skb_rtable( - return (struct rtable *)skb_dst(skb); - } - -+/* For mangling skb->pkt_type from user space side from applications -+ * such as nft, tc, etc, we only allow a conservative subset of -+ * possible pkt_types to be set. -+*/ -+static inline bool skb_pkt_type_ok(u32 ptype) -+{ -+ return ptype <= PACKET_OTHERHOST; -+} -+ - void kfree_skb(struct sk_buff *skb); - void kfree_skb_list(struct sk_buff *segs); - void skb_tx_error(struct sk_buff *skb); -@@ -2127,6 +2155,11 @@ static inline unsigned char *skb_mac_hea - return skb->head + skb->mac_header; - } - -+static inline u32 skb_mac_header_len(const struct sk_buff *skb) -+{ -+ return skb->network_header - skb->mac_header; -+} -+ - static inline int skb_mac_header_was_set(const struct sk_buff *skb) - { - return skb->mac_header != (typeof(skb->mac_header))~0U; -@@ -2256,7 +2289,7 @@ static inline int pskb_network_may_pull( - - int ___pskb_trim(struct sk_buff *skb, unsigned int len); - --static inline void __skb_trim(struct sk_buff *skb, unsigned int len) -+static inline void __skb_set_length(struct sk_buff *skb, unsigned int len) - { - if (unlikely(skb_is_nonlinear(skb))) { - WARN_ON(1); -@@ -2266,6 +2299,11 @@ static inline void __skb_trim(struct sk_ - skb_set_tail_pointer(skb, len); - } - -+static inline void __skb_trim(struct sk_buff *skb, unsigned int len) -+{ -+ __skb_set_length(skb, len); -+} -+ - void skb_trim(struct sk_buff *skb, unsigned int len); - - static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) -@@ -2318,6 +2356,20 @@ static inline struct sk_buff *skb_reduce - return skb; - } - -+static inline int __skb_grow(struct sk_buff *skb, unsigned int len) -+{ -+ unsigned int diff = len - skb->len; -+ -+ if (skb_tailroom(skb) < diff) { -+ int ret = pskb_expand_head(skb, 0, diff - skb_tailroom(skb), -+ GFP_ATOMIC); -+ if (ret) -+ return ret; -+ } -+ __skb_set_length(skb, len); -+ return 0; -+} -+ - /** - * skb_orphan - orphan a buffer - * @skb: buffer to orphan -@@ -2818,6 +2870,18 @@ static inline int skb_linearize_cow(stru - __skb_linearize(skb) : 0; - } - -+static __always_inline void -+__skb_postpull_rcsum(struct sk_buff *skb, const void *start, unsigned int len, -+ unsigned int off) -+{ -+ if (skb->ip_summed == CHECKSUM_COMPLETE) -+ skb->csum = csum_block_sub(skb->csum, -+ csum_partial(start, len, 0), off); -+ else if (skb->ip_summed == CHECKSUM_PARTIAL && -+ skb_checksum_start_offset(skb) < 0) -+ skb->ip_summed = CHECKSUM_NONE; -+} -+ - /** - * skb_postpull_rcsum - update checksum for received skb after pull - * @skb: buffer to update -@@ -2828,36 +2892,38 @@ static inline int skb_linearize_cow(stru - * update the CHECKSUM_COMPLETE checksum, or set ip_summed to - * CHECKSUM_NONE so that it can be recomputed from scratch. - */ -- - static inline void skb_postpull_rcsum(struct sk_buff *skb, - const void *start, unsigned int len) - { -- if (skb->ip_summed == CHECKSUM_COMPLETE) -- skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); -- else if (skb->ip_summed == CHECKSUM_PARTIAL && -- skb_checksum_start_offset(skb) < 0) -- skb->ip_summed = CHECKSUM_NONE; -+ __skb_postpull_rcsum(skb, start, len, 0); - } - --unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); -+static __always_inline void -+__skb_postpush_rcsum(struct sk_buff *skb, const void *start, unsigned int len, -+ unsigned int off) -+{ -+ if (skb->ip_summed == CHECKSUM_COMPLETE) -+ skb->csum = csum_block_add(skb->csum, -+ csum_partial(start, len, 0), off); -+} - -+/** -+ * skb_postpush_rcsum - update checksum for received skb after push -+ * @skb: buffer to update -+ * @start: start of data after push -+ * @len: length of data pushed -+ * -+ * After doing a push on a received packet, you need to call this to -+ * update the CHECKSUM_COMPLETE checksum. -+ */ - static inline void skb_postpush_rcsum(struct sk_buff *skb, - const void *start, unsigned int len) - { -- /* For performing the reverse operation to skb_postpull_rcsum(), -- * we can instead of ... -- * -- * skb->csum = csum_add(skb->csum, csum_partial(start, len, 0)); -- * -- * ... just use this equivalent version here to save a few -- * instructions. Feeding csum of 0 in csum_partial() and later -- * on adding skb->csum is equivalent to feed skb->csum in the -- * first place. -- */ -- if (skb->ip_summed == CHECKSUM_COMPLETE) -- skb->csum = csum_partial(start, len, skb->csum); -+ __skb_postpush_rcsum(skb, start, len, 0); - } - -+unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); -+ - /** - * skb_push_rcsum - push skb and update receive checksum - * @skb: buffer to update -@@ -2901,6 +2967,21 @@ static inline int pskb_trim_rcsum(struct - #define skb_rb_next(skb) rb_to_skb(rb_next(&(skb)->rbnode)) - #define skb_rb_prev(skb) rb_to_skb(rb_prev(&(skb)->rbnode)) - -+static inline int __skb_trim_rcsum(struct sk_buff *skb, unsigned int len) -+{ -+ if (skb->ip_summed == CHECKSUM_COMPLETE) -+ skb->ip_summed = CHECKSUM_NONE; -+ __skb_trim(skb, len); -+ return 0; -+} -+ -+static inline int __skb_grow_rcsum(struct sk_buff *skb, unsigned int len) -+{ -+ if (skb->ip_summed == CHECKSUM_COMPLETE) -+ skb->ip_summed = CHECKSUM_NONE; -+ return __skb_grow(skb, len); -+} -+ - #define skb_queue_walk(queue, skb) \ - for (skb = (queue)->next; \ - skb != (struct sk_buff *)(queue); \ -@@ -3662,6 +3743,13 @@ static inline bool skb_is_gso_v6(const s - return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; - } - -+static inline void skb_gso_reset(struct sk_buff *skb) -+{ -+ skb_shinfo(skb)->gso_size = 0; -+ skb_shinfo(skb)->gso_segs = 0; -+ skb_shinfo(skb)->gso_type = 0; -+} -+ - void __skb_warn_lro_forwarding(const struct sk_buff *skb); - - static inline bool skb_warn_if_lro(const struct sk_buff *skb) ---- a/include/linux/if_arp.h -+++ b/include/linux/if_arp.h -@@ -44,4 +44,21 @@ static inline int arp_hdr_len(struct net - return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2; - } - } -+ -+static inline bool dev_is_mac_header_xmit(const struct net_device *dev) -+{ -+ switch (dev->type) { -+ case ARPHRD_TUNNEL: -+ case ARPHRD_TUNNEL6: -+ case ARPHRD_SIT: -+ case ARPHRD_IPGRE: -+ case ARPHRD_VOID: -+ case ARPHRD_NONE: -+ case ARPHRD_RAWIP: -+ return false; -+ default: -+ return true; -+ } -+} -+ - #endif /* _LINUX_IF_ARP_H */ ---- a/include/linux/if_vlan.h -+++ b/include/linux/if_vlan.h -@@ -66,7 +66,6 @@ static inline struct vlan_ethhdr *vlan_e - #define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */ - #define VLAN_PRIO_SHIFT 13 - #define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */ --#define VLAN_TAG_PRESENT VLAN_CFI_MASK - #define VLAN_VID_MASK 0x0fff /* VLAN Identifier */ - #define VLAN_N_VID 4096 - -@@ -78,8 +77,8 @@ static inline bool is_vlan_dev(struct ne - return dev->priv_flags & IFF_802_1Q_VLAN; - } - --#define skb_vlan_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) --#define skb_vlan_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) -+#define skb_vlan_tag_present(__skb) ((__skb)->vlan_present) -+#define skb_vlan_tag_get(__skb) ((__skb)->vlan_tci) - #define skb_vlan_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) - - /** -@@ -376,6 +375,31 @@ static inline struct sk_buff *vlan_inser - return skb; - } - -+/** -+ * __vlan_hwaccel_clear_tag - clear hardware accelerated VLAN info -+ * @skb: skbuff to clear -+ * -+ * Clears the VLAN information from @skb -+ */ -+static inline void __vlan_hwaccel_clear_tag(struct sk_buff *skb) -+{ -+ skb->vlan_present = 0; -+} -+ -+/** -+ * __vlan_hwaccel_copy_tag - copy hardware accelerated VLAN info from another skb -+ * @dst: skbuff to copy to -+ * @src: skbuff to copy from -+ * -+ * Copies VLAN information from @src to @dst (for branchless code) -+ */ -+static inline void __vlan_hwaccel_copy_tag(struct sk_buff *dst, const struct sk_buff *src) -+{ -+ dst->vlan_present = src->vlan_present; -+ dst->vlan_proto = src->vlan_proto; -+ dst->vlan_tci = src->vlan_tci; -+} -+ - /* - * __vlan_hwaccel_push_inside - pushes vlan tag to the payload - * @skb: skbuff to tag -@@ -390,7 +414,7 @@ static inline struct sk_buff *__vlan_hwa - skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, - skb_vlan_tag_get(skb)); - if (likely(skb)) -- skb->vlan_tci = 0; -+ __vlan_hwaccel_clear_tag(skb); - return skb; - } - /* -@@ -422,7 +446,8 @@ static inline void __vlan_hwaccel_put_ta - __be16 vlan_proto, u16 vlan_tci) - { - skb->vlan_proto = vlan_proto; -- skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci; -+ skb->vlan_tci = vlan_tci; -+ skb->vlan_present = 1; - } - - /** ---- a/include/net/checksum.h -+++ b/include/net/checksum.h -@@ -120,6 +120,11 @@ static inline __wsum csum_partial_ext(co - - #define CSUM_MANGLED_0 ((__force __sum16)0xffff) - -+static inline void csum_replace_by_diff(__sum16 *sum, __wsum diff) -+{ -+ *sum = csum_fold(csum_add(diff, ~csum_unfold(*sum))); -+} -+ - static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to) - { - __wsum tmp = csum_sub(~csum_unfold(*sum), (__force __wsum)from); ---- a/lib/test_bpf.c -+++ b/lib/test_bpf.c -@@ -38,6 +38,7 @@ - #define SKB_HASH 0x1234aaab - #define SKB_QUEUE_MAP 123 - #define SKB_VLAN_TCI 0xffff -+#define SKB_VLAN_PRESENT 1 - #define SKB_DEV_IFINDEX 577 - #define SKB_DEV_TYPE 588 - -@@ -691,8 +692,8 @@ static struct bpf_test tests[] = { - CLASSIC, - { }, - { -- { 1, SKB_VLAN_TCI & ~VLAN_TAG_PRESENT }, -- { 10, SKB_VLAN_TCI & ~VLAN_TAG_PRESENT } -+ { 1, SKB_VLAN_TCI }, -+ { 10, SKB_VLAN_TCI } - }, - }, - { -@@ -705,8 +706,8 @@ static struct bpf_test tests[] = { - CLASSIC, - { }, - { -- { 1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }, -- { 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) } -+ { 1, SKB_VLAN_PRESENT }, -+ { 10, SKB_VLAN_PRESENT } - }, - }, - { -@@ -4432,8 +4433,8 @@ static struct bpf_test tests[] = { - CLASSIC, - { }, - { -- { 1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }, -- { 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) } -+ { 1, SKB_VLAN_PRESENT }, -+ { 10, SKB_VLAN_PRESENT } - }, - .fill_helper = bpf_fill_maxinsns6, - }, -@@ -5144,6 +5145,7 @@ static struct sk_buff *populate_skb(char - skb->hash = SKB_HASH; - skb->queue_mapping = SKB_QUEUE_MAP; - skb->vlan_tci = SKB_VLAN_TCI; -+ skb->vlan_present = SKB_VLAN_PRESENT; - skb->dev = &dev; - skb->dev->ifindex = SKB_DEV_IFINDEX; - skb->dev->type = SKB_DEV_TYPE; ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -3171,6 +3171,21 @@ int __dev_forward_skb(struct net_device - int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); - bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb); - -+static __always_inline int ____dev_forward_skb(struct net_device *dev, -+ struct sk_buff *skb) -+{ -+ if (skb_orphan_frags(skb, GFP_ATOMIC) || -+ unlikely(!is_skb_forwardable(dev, skb))) { -+ atomic_long_inc(&dev->rx_dropped); -+ kfree_skb(skb); -+ return NET_RX_DROP; -+ } -+ -+ skb_scrub_packet(skb, true); -+ skb->priority = 0; -+ return 0; -+} -+ - extern int netdev_budget; - - /* Called by rtnetlink.c:rtnl_unlock() */ ---- a/net/openvswitch/actions.c -+++ b/net/openvswitch/actions.c -@@ -246,7 +246,7 @@ static int push_vlan(struct sk_buff *skb - else - key->eth.tci = vlan->vlan_tci; - return skb_vlan_push(skb, vlan->vlan_tpid, -- ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT); -+ ntohs(vlan->vlan_tci) & ~VLAN_CFI_MASK); - } - - /* 'src' is already properly masked. */ ---- a/net/openvswitch/flow.c -+++ b/net/openvswitch/flow.c -@@ -318,7 +318,7 @@ static int parse_vlan(struct sk_buff *sk - return -ENOMEM; - - qp = (struct qtag_prefix *) skb->data; -- key->eth.tci = qp->tci | htons(VLAN_TAG_PRESENT); -+ key->eth.tci = qp->tci | htons(VLAN_CFI_MASK); - __skb_pull(skb, sizeof(struct qtag_prefix)); - - return 0; ---- a/net/openvswitch/flow.h -+++ b/net/openvswitch/flow.h -@@ -69,7 +69,7 @@ struct sw_flow_key { - struct { - u8 src[ETH_ALEN]; /* Ethernet source address. */ - u8 dst[ETH_ALEN]; /* Ethernet destination address. */ -- __be16 tci; /* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ -+ __be16 tci; /* 0 if no VLAN, VLAN_CFI_MASK set otherwise. */ - __be16 type; /* Ethernet frame type. */ - } eth; - union { ---- a/net/openvswitch/flow_netlink.c -+++ b/net/openvswitch/flow_netlink.c -@@ -925,11 +925,11 @@ static int ovs_key_from_nlattrs(struct n - __be16 tci; - - tci = nla_get_be16(a[OVS_KEY_ATTR_VLAN]); -- if (!(tci & htons(VLAN_TAG_PRESENT))) { -+ if (!(tci & htons(VLAN_CFI_MASK))) { - if (is_mask) -- OVS_NLERR(log, "VLAN TCI mask does not have exact match for VLAN_TAG_PRESENT bit."); -+ OVS_NLERR(log, "VLAN TCI mask does not have exact match for VLAN_CFI_MASK bit."); - else -- OVS_NLERR(log, "VLAN TCI does not have VLAN_TAG_PRESENT bit set."); -+ OVS_NLERR(log, "VLAN TCI does not have VLAN_CFI_MASK bit set."); - - return -EINVAL; - } -@@ -1209,7 +1209,7 @@ int ovs_nla_get_match(struct net *net, s - key_attrs &= ~(1 << OVS_KEY_ATTR_ENCAP); - encap_valid = true; - -- if (tci & htons(VLAN_TAG_PRESENT)) { -+ if (tci & htons(VLAN_CFI_MASK)) { - err = parse_flow_nlattrs(encap, a, &key_attrs, log); - if (err) - return err; -@@ -1297,7 +1297,7 @@ int ovs_nla_get_match(struct net *net, s - if (a[OVS_KEY_ATTR_VLAN]) - tci = nla_get_be16(a[OVS_KEY_ATTR_VLAN]); - -- if (!(tci & htons(VLAN_TAG_PRESENT))) { -+ if (!(tci & htons(VLAN_CFI_MASK))) { - OVS_NLERR(log, "VLAN tag present bit must have an exact match (tci_mask=%x).", - ntohs(tci)); - err = -EINVAL; -@@ -2272,7 +2272,7 @@ static int __ovs_nla_copy_actions(struct - vlan = nla_data(a); - if (vlan->vlan_tpid != htons(ETH_P_8021Q)) - return -EINVAL; -- if (!(vlan->vlan_tci & htons(VLAN_TAG_PRESENT))) -+ if (!(vlan->vlan_tci & htons(VLAN_CFI_MASK))) - return -EINVAL; - vlan_tci = vlan->vlan_tci; - break; -@@ -2288,7 +2288,7 @@ static int __ovs_nla_copy_actions(struct - /* Prohibit push MPLS other than to a white list - * for packets that have a known tag order. - */ -- if (vlan_tci & htons(VLAN_TAG_PRESENT) || -+ if (vlan_tci & htons(VLAN_CFI_MASK) || - (eth_type != htons(ETH_P_IP) && - eth_type != htons(ETH_P_IPV6) && - eth_type != htons(ETH_P_ARP) && -@@ -2300,7 +2300,7 @@ static int __ovs_nla_copy_actions(struct - } - - case OVS_ACTION_ATTR_POP_MPLS: -- if (vlan_tci & htons(VLAN_TAG_PRESENT) || -+ if (vlan_tci & htons(VLAN_CFI_MASK) || - !eth_p_mpls(eth_type)) - return -EINVAL; - ---- a/net/sched/act_bpf.c -+++ b/net/sched/act_bpf.c -@@ -220,7 +220,7 @@ static int tcf_bpf_init_from_efd(struct - - bpf_fd = nla_get_u32(tb[TCA_ACT_BPF_FD]); - -- fp = bpf_prog_get(bpf_fd); -+ fp = bpf_prog_get_type_dev(bpf_fd, BPF_PROG_TYPE_SCHED_ACT, false); - if (IS_ERR(fp)) - return PTR_ERR(fp); - ---- a/net/sched/cls_bpf.c -+++ b/net/sched/cls_bpf.c -@@ -267,7 +267,7 @@ static int cls_bpf_prog_from_efd(struct - - bpf_fd = nla_get_u32(tb[TCA_BPF_FD]); - -- fp = bpf_prog_get(bpf_fd); -+ fp = bpf_prog_get_type_dev(bpf_fd, BPF_PROG_TYPE_SCHED_CLS, false); - if (IS_ERR(fp)) - return PTR_ERR(fp); - ---- a/net/8021q/vlan_core.c -+++ b/net/8021q/vlan_core.c -@@ -50,7 +50,7 @@ bool vlan_do_receive(struct sk_buff **sk - } - - skb->priority = vlan_get_ingress_priority(vlan_dev, skb->vlan_tci); -- skb->vlan_tci = 0; -+ __vlan_hwaccel_clear_tag(skb); - - rx_stats = this_cpu_ptr(vlan_dev_priv(vlan_dev)->vlan_pcpu_stats); - ---- a/net/ipv4/ip_tunnel_core.c -+++ b/net/ipv4/ip_tunnel_core.c -@@ -128,7 +128,7 @@ int iptunnel_pull_header(struct sk_buff - secpath_reset(skb); - skb_clear_hash_if_not_l4(skb); - skb_dst_drop(skb); -- skb->vlan_tci = 0; -+ __vlan_hwaccel_clear_tag(skb); - skb_set_queue_mapping(skb, 0); - skb->pkt_type = PACKET_HOST; - ---- a/net/bridge/br_netfilter_hooks.c -+++ b/net/bridge/br_netfilter_hooks.c -@@ -673,10 +673,8 @@ static int br_nf_push_frag_xmit(struct n - return 0; - } - -- if (data->vlan_tci) { -- skb->vlan_tci = data->vlan_tci; -- skb->vlan_proto = data->vlan_proto; -- } -+ if (data->vlan_proto) -+ __vlan_hwaccel_put_tag(skb, data->vlan_proto, data->vlan_tci); - - skb_copy_to_linear_data_offset(skb, -data->size, data->mac, data->size); - __skb_push(skb, data->encap_size); -@@ -740,8 +738,13 @@ static int br_nf_dev_queue_xmit(struct n - - data = this_cpu_ptr(&brnf_frag_data_storage); - -- data->vlan_tci = skb->vlan_tci; -- data->vlan_proto = skb->vlan_proto; -+ if (skb_vlan_tag_present(skb)) { -+ data->vlan_tci = skb->vlan_tci; -+ data->vlan_proto = skb->vlan_proto; -+ } else { -+ data->vlan_proto = 0; -+ } -+ - data->encap_size = nf_bridge_encap_header_len(skb); - data->size = ETH_HLEN + data->encap_size; - ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -751,7 +751,7 @@ static inline int br_vlan_get_tag(const - int err = 0; - - if (skb_vlan_tag_present(skb)) { -- *vid = skb_vlan_tag_get(skb) & VLAN_VID_MASK; -+ *vid = skb_vlan_tag_get_id(skb); - } else { - *vid = 0; - err = -EINVAL; ---- a/net/bridge/br_vlan.c -+++ b/net/bridge/br_vlan.c -@@ -354,7 +354,7 @@ struct sk_buff *br_handle_vlan(struct ne - } - } - if (v->flags & BRIDGE_VLAN_INFO_UNTAGGED) -- skb->vlan_tci = 0; -+ __vlan_hwaccel_clear_tag(skb); - - out: - return skb; -@@ -420,8 +420,8 @@ static bool __allowed_ingress(struct net - __vlan_hwaccel_put_tag(skb, proto, pvid); - else - /* Priority-tagged Frame. -- * At this point, We know that skb->vlan_tci had -- * VLAN_TAG_PRESENT bit and its VID field was 0x000. -+ * At this point, we know that skb->vlan_tci VID -+ * field was 0. - * We update only VID field and preserve PCP field. - */ - skb->vlan_tci |= pvid; ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3988,7 +3988,7 @@ ncls: - * and set skb->priority like in vlan_do_receive() - * For the time being, just ignore Priority Code Point - */ -- skb->vlan_tci = 0; -+ __vlan_hwaccel_clear_tag(skb); - } - - type = skb->protocol; -@@ -4211,7 +4211,9 @@ static void gro_list_prepare(struct napi - } - - diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev; -- diffs |= p->vlan_tci ^ skb->vlan_tci; -+ diffs |= skb_vlan_tag_present(p) ^ skb_vlan_tag_present(skb); -+ if (skb_vlan_tag_present(p)) -+ diffs |= p->vlan_tci ^ skb->vlan_tci; - diffs |= skb_metadata_dst_cmp(p, skb); - if (maclen == ETH_HLEN) - diffs |= compare_ether_header(skb_mac_header(p), -@@ -4452,7 +4454,7 @@ static void napi_reuse_skb(struct napi_s - __skb_pull(skb, skb_headlen(skb)); - /* restore the reserve we had after netdev_alloc_skb_ip_align() */ - skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb)); -- skb->vlan_tci = 0; -+ __vlan_hwaccel_clear_tag(skb); - skb->dev = napi->dev; - skb->skb_iif = 0; - skb->encapsulation = 0; ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -4491,7 +4491,7 @@ int skb_vlan_pop(struct sk_buff *skb) - int err; - - if (likely(skb_vlan_tag_present(skb))) { -- skb->vlan_tci = 0; -+ __vlan_hwaccel_clear_tag(skb); - } else { - if (unlikely((skb->protocol != htons(ETH_P_8021Q) && - skb->protocol != htons(ETH_P_8021AD)) || ---- a/include/net/sock.h -+++ b/include/net/sock.h -@@ -1484,6 +1484,14 @@ do { \ - lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \ - } while (0) - -+#ifdef CONFIG_LOCKDEP -+static inline bool lockdep_sock_is_held(struct sock *sk) -+{ -+ return lockdep_is_held(&sk->sk_lock) || -+ lockdep_is_held(&sk->sk_lock.slock); -+} -+#endif -+ - void lock_sock_nested(struct sock *sk, int subclass); - - static inline void lock_sock(struct sock *sk) diff --git a/feeds/ipq807x/ipq807x/patches/210-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch b/feeds/ipq807x/ipq807x/patches/210-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch deleted file mode 100644 index 961140aab..000000000 --- a/feeds/ipq807x/ipq807x/patches/210-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch +++ /dev/null @@ -1,88 +0,0 @@ -From: Felix Fietkau -Date: Mon, 8 Feb 2021 11:34:08 -0800 -Subject: [PATCH] net: extract napi poll functionality to __napi_poll() - -This commit introduces a new function __napi_poll() which does the main -logic of the existing napi_poll() function, and will be called by other -functions in later commits. -This idea and implementation is done by Felix Fietkau and -is proposed as part of the patch to move napi work to work_queue -context. -This commit by itself is a code restructure. - -Signed-off-by: Felix Fietkau -Signed-off-by: Wei Wang -Reviewed-by: Alexander Duyck -Signed-off-by: David S. Miller ---- - ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -6322,15 +6322,10 @@ void netif_napi_del(struct napi_struct * - } - EXPORT_SYMBOL(netif_napi_del); - --static int napi_poll(struct napi_struct *n, struct list_head *repoll) -+static int __napi_poll(struct napi_struct *n, bool *repoll) - { -- void *have; - int work, weight; - -- list_del_init(&n->poll_list); -- -- have = netpoll_poll_lock(n); -- - weight = n->weight; - - /* This NAPI_STATE_SCHED test is for avoiding a race -@@ -6348,7 +6343,7 @@ static int napi_poll(struct napi_struct - WARN_ON_ONCE(work > weight); - - if (likely(work < weight)) -- goto out_unlock; -+ return work; - - /* Drivers must not modify the NAPI state if they - * consume the entire weight. In such cases this code -@@ -6357,7 +6352,7 @@ static int napi_poll(struct napi_struct - */ - if (unlikely(napi_disable_pending(n))) { - napi_complete(n); -- goto out_unlock; -+ return work; - } - - if (n->gro_bitmask) { -@@ -6375,12 +6370,29 @@ static int napi_poll(struct napi_struct - if (unlikely(!list_empty(&n->poll_list))) { - pr_warn_once("%s: Budget exhausted after napi rescheduled\n", - n->dev ? n->dev->name : "backlog"); -- goto out_unlock; -+ return work; - } - -- list_add_tail(&n->poll_list, repoll); -+ *repoll = true; -+ -+ return work; -+} -+ -+static int napi_poll(struct napi_struct *n, struct list_head *repoll) -+{ -+ bool do_repoll = false; -+ void *have; -+ int work; -+ -+ list_del_init(&n->poll_list); -+ -+ have = netpoll_poll_lock(n); -+ -+ work = __napi_poll(n, &do_repoll); -+ -+ if (do_repoll) -+ list_add_tail(&n->poll_list, repoll); - --out_unlock: - netpoll_poll_unlock(have); - - return work; diff --git a/feeds/ipq807x/ipq807x/patches/211-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch b/feeds/ipq807x/ipq807x/patches/211-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch deleted file mode 100644 index e1268d96b..000000000 --- a/feeds/ipq807x/ipq807x/patches/211-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch +++ /dev/null @@ -1,245 +0,0 @@ -From: Wei Wang -Date: Mon, 8 Feb 2021 11:34:09 -0800 -Subject: [PATCH] net: implement threaded-able napi poll loop support - -This patch allows running each napi poll loop inside its own -kernel thread. -The kthread is created during netif_napi_add() if dev->threaded -is set. And threaded mode is enabled in napi_enable(). We will -provide a way to set dev->threaded and enable threaded mode -without a device up/down in the following patch. - -Once that threaded mode is enabled and the kthread is -started, napi_schedule() will wake-up such thread instead -of scheduling the softirq. - -The threaded poll loop behaves quite likely the net_rx_action, -but it does not have to manipulate local irqs and uses -an explicit scheduling point based on netdev_budget. - -Co-developed-by: Paolo Abeni -Signed-off-by: Paolo Abeni -Co-developed-by: Hannes Frederic Sowa -Signed-off-by: Hannes Frederic Sowa -Co-developed-by: Jakub Kicinski -Signed-off-by: Jakub Kicinski -Signed-off-by: Wei Wang -Reviewed-by: Alexander Duyck -Signed-off-by: David S. Miller ---- - ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -319,6 +319,7 @@ struct napi_struct { - struct list_head dev_list; - struct hlist_node napi_hash_node; - unsigned int napi_id; -+ struct task_struct *thread; - }; - - enum { -@@ -326,6 +327,7 @@ enum { - NAPI_STATE_DISABLE, /* Disable pending */ - NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ - NAPI_STATE_HASHED, /* In NAPI hash */ -+ NAPI_STATE_THREADED, /* The poll is performed inside its own thread*/ - }; - - enum gro_result { -@@ -501,13 +503,7 @@ void napi_disable(struct napi_struct *n) - * Resume NAPI from being scheduled on this context. - * Must be paired with napi_disable. - */ --static inline void napi_enable(struct napi_struct *n) --{ -- BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state)); -- smp_mb__before_atomic(); -- clear_bit(NAPI_STATE_SCHED, &n->state); -- clear_bit(NAPI_STATE_NPSVC, &n->state); --} -+void napi_enable(struct napi_struct *n); - - /** - * napi_synchronize - wait until NAPI is not running -@@ -1573,6 +1569,8 @@ enum netdev_priv_flags_ext { - * switch driver and used to set the phys state of the - * switch port. - * -+ * @threaded: napi threaded mode is enabled -+ * - * FIXME: cleanup struct net_device such that network protocol info - * moves out. - */ -@@ -1852,6 +1850,7 @@ struct net_device { - struct phy_device *phydev; - struct lock_class_key *qdisc_tx_busylock; - bool proto_down; -+ unsigned threaded:1; - }; - #define to_net_dev(d) container_of(d, struct net_device, dev) - ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -94,6 +94,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1304,6 +1305,27 @@ void netdev_notify_peers(struct net_devi - } - EXPORT_SYMBOL(netdev_notify_peers); - -+static int napi_threaded_poll(void *data); -+ -+static int napi_kthread_create(struct napi_struct *n) -+{ -+ int err = 0; -+ -+ /* Create and wake up the kthread once to put it in -+ * TASK_INTERRUPTIBLE mode to avoid the blocked task -+ * warning and work with loadavg. -+ */ -+ n->thread = kthread_run(napi_threaded_poll, n, "napi/%s-%d", -+ n->dev->name, n->napi_id); -+ if (IS_ERR(n->thread)) { -+ err = PTR_ERR(n->thread); -+ pr_err("kthread_run failed with err %d\n", err); -+ n->thread = NULL; -+ } -+ -+ return err; -+} -+ - static int __dev_open(struct net_device *dev) - { - const struct net_device_ops *ops = dev->netdev_ops; -@@ -3248,6 +3270,21 @@ int weight_p __read_mostly = 64; - static inline void ____napi_schedule(struct softnet_data *sd, - struct napi_struct *napi) - { -+ struct task_struct *thread; -+ -+ if (test_bit(NAPI_STATE_THREADED, &napi->state)) { -+ /* Paired with smp_mb__before_atomic() in -+ * napi_enable(). Use READ_ONCE() to guarantee -+ * a complete read on napi->thread. Only call -+ * wake_up_process() when it's not NULL. -+ */ -+ thread = READ_ONCE(napi->thread); -+ if (thread) { -+ wake_up_process(thread); -+ return; -+ } -+ } -+ - list_add_tail(&napi->poll_list, &sd->poll_list); - __raise_softirq_irqoff(NET_RX_SOFTIRQ); - } -@@ -4828,9 +4865,33 @@ void netif_napi_add(struct net_device *d - napi->poll_owner = -1; - #endif - set_bit(NAPI_STATE_SCHED, &napi->state); -+ /* Create kthread for this napi if dev->threaded is set. -+ * Clear dev->threaded if kthread creation failed so that -+ * threaded mode will not be enabled in napi_enable(). -+ */ -+ if (dev->threaded && napi_kthread_create(napi)) -+ dev->threaded = 0; - } - EXPORT_SYMBOL(netif_napi_add); - -+/** -+ * napi_enable - enable NAPI scheduling -+ * @n: NAPI context -+ * -+ * Resume NAPI from being scheduled on this context. -+ * Must be paired with napi_disable. -+ */ -+void napi_enable(struct napi_struct *n) -+{ -+ BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state)); -+ smp_mb__before_atomic(); -+ clear_bit(NAPI_STATE_SCHED, &n->state); -+ clear_bit(NAPI_STATE_NPSVC, &n->state); -+ if (n->dev->threaded && n->thread) -+ set_bit(NAPI_STATE_THREADED, &n->state); -+} -+EXPORT_SYMBOL(napi_enable); -+ - void napi_disable(struct napi_struct *n) - { - might_sleep(); -@@ -4844,6 +4905,7 @@ void napi_disable(struct napi_struct *n) - hrtimer_cancel(&n->timer); - - clear_bit(NAPI_STATE_DISABLE, &n->state); -+ clear_bit(NAPI_STATE_THREADED, &n->state); - } - EXPORT_SYMBOL(napi_disable); - -@@ -4855,6 +4917,11 @@ void netif_napi_del(struct napi_struct * - kfree_skb_list(napi->gro_list); - napi->gro_list = NULL; - napi->gro_count = 0; -+ -+ if (napi->thread) { -+ kthread_stop(napi->thread); -+ napi->thread = NULL; -+ } - } - EXPORT_SYMBOL(netif_napi_del); - -@@ -4940,6 +5007,50 @@ static int napi_poll(struct napi_struct - return work; - } - -+static int napi_thread_wait(struct napi_struct *napi) -+{ -+ set_current_state(TASK_INTERRUPTIBLE); -+ -+ while (!kthread_should_stop() && !napi_disable_pending(napi)) { -+ if (test_bit(NAPI_STATE_SCHED, &napi->state)) { -+ WARN_ON(!list_empty(&napi->poll_list)); -+ __set_current_state(TASK_RUNNING); -+ return 0; -+ } -+ -+ schedule(); -+ set_current_state(TASK_INTERRUPTIBLE); -+ } -+ __set_current_state(TASK_RUNNING); -+ return -1; -+} -+ -+static int napi_threaded_poll(void *data) -+{ -+ struct napi_struct *napi = data; -+ void *have; -+ -+ while (!napi_thread_wait(napi)) { -+ for (;;) { -+ bool repoll = false; -+ -+ local_bh_disable(); -+ -+ have = netpoll_poll_lock(napi); -+ __napi_poll(napi, &repoll); -+ netpoll_poll_unlock(have); -+ -+ local_bh_enable(); -+ -+ if (!repoll) -+ break; -+ -+ cond_resched(); -+ } -+ } -+ return 0; -+} -+ - static void net_rx_action(struct softirq_action *h) - { - struct softnet_data *sd = this_cpu_ptr(&softnet_data); diff --git a/feeds/ipq807x/ipq807x/patches/212-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch b/feeds/ipq807x/ipq807x/patches/212-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch deleted file mode 100644 index 5db5c8171..000000000 --- a/feeds/ipq807x/ipq807x/patches/212-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch +++ /dev/null @@ -1,156 +0,0 @@ -From: Wei Wang -Date: Mon, 8 Feb 2021 11:34:10 -0800 -Subject: [PATCH] net: add sysfs attribute to control napi threaded mode - -This patch adds a new sysfs attribute to the network device class. -Said attribute provides a per-device control to enable/disable the -threaded mode for all the napi instances of the given network device, -without the need for a device up/down. -User sets it to 1 or 0 to enable or disable threaded mode. -Note: when switching between threaded and the current softirq based mode -for a napi instance, it will not immediately take effect if the napi is -currently being polled. The mode switch will happen for the next time -napi_schedule() is called. - -Co-developed-by: Paolo Abeni -Signed-off-by: Paolo Abeni -Co-developed-by: Hannes Frederic Sowa -Signed-off-by: Hannes Frederic Sowa -Co-developed-by: Felix Fietkau -Signed-off-by: Felix Fietkau -Signed-off-by: Wei Wang -Reviewed-by: Alexander Duyck -Signed-off-by: David S. Miller ---- - ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -496,6 +496,8 @@ void napi_hash_del(struct napi_struct *n - */ - void napi_disable(struct napi_struct *n); - -+int dev_set_threaded(struct net_device *dev, bool threaded); -+ - /** - * napi_enable - enable NAPI scheduling - * @n: napi context ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3274,8 +3274,9 @@ static inline void ____napi_schedule(str - - if (test_bit(NAPI_STATE_THREADED, &napi->state)) { - /* Paired with smp_mb__before_atomic() in -- * napi_enable(). Use READ_ONCE() to guarantee -- * a complete read on napi->thread. Only call -+ * napi_enable()/dev_set_threaded(). -+ * Use READ_ONCE() to guarantee a complete -+ * read on napi->thread. Only call - * wake_up_process() when it's not NULL. - */ - thread = READ_ONCE(napi->thread); -@@ -4844,6 +4845,49 @@ static enum hrtimer_restart napi_watchdo - return HRTIMER_NORESTART; - } - -+int dev_set_threaded(struct net_device *dev, bool threaded) -+{ -+ struct napi_struct *napi; -+ int err = 0; -+ -+ if (dev->threaded == threaded) -+ return 0; -+ -+ if (threaded) { -+ list_for_each_entry(napi, &dev->napi_list, dev_list) { -+ if (!napi->thread) { -+ err = napi_kthread_create(napi); -+ if (err) { -+ threaded = false; -+ break; -+ } -+ } -+ } -+ } -+ -+ dev->threaded = threaded; -+ -+ /* Make sure kthread is created before THREADED bit -+ * is set. -+ */ -+ smp_mb__before_atomic(); -+ -+ /* Setting/unsetting threaded mode on a napi might not immediately -+ * take effect, if the current napi instance is actively being -+ * polled. In this case, the switch between threaded mode and -+ * softirq mode will happen in the next round of napi_schedule(). -+ * This should not cause hiccups/stalls to the live traffic. -+ */ -+ list_for_each_entry(napi, &dev->napi_list, dev_list) { -+ if (threaded) -+ set_bit(NAPI_STATE_THREADED, &napi->state); -+ else -+ clear_bit(NAPI_STATE_THREADED, &napi->state); -+ } -+ -+ return err; -+} -+ - void netif_napi_add(struct net_device *dev, struct napi_struct *napi, - int (*poll)(struct napi_struct *, int), int weight) - { ---- a/net/core/net-sysfs.c -+++ b/net/core/net-sysfs.c -@@ -486,6 +486,45 @@ static ssize_t phys_switch_id_show(struc - } - static DEVICE_ATTR_RO(phys_switch_id); - -+static ssize_t threaded_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct net_device *netdev = to_net_dev(dev); -+ ssize_t ret = -EINVAL; -+ -+ if (!rtnl_trylock()) -+ return restart_syscall(); -+ -+ if (dev_isalive(netdev)) -+ ret = sprintf(buf, fmt_dec, netdev->threaded); -+ -+ rtnl_unlock(); -+ return ret; -+} -+ -+static int modify_napi_threaded(struct net_device *dev, unsigned long val) -+{ -+ int ret; -+ -+ if (list_empty(&dev->napi_list)) -+ return -EOPNOTSUPP; -+ -+ if (val != 0 && val != 1) -+ return -EOPNOTSUPP; -+ -+ ret = dev_set_threaded(dev, val); -+ -+ return ret; -+} -+ -+static ssize_t threaded_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ return netdev_store(dev, attr, buf, len, modify_napi_threaded); -+} -+static DEVICE_ATTR_RW(threaded); -+ - static struct attribute *net_class_attrs[] = { - &dev_attr_netdev_group.attr, - &dev_attr_type.attr, -@@ -514,6 +553,7 @@ static struct attribute *net_class_attrs - &dev_attr_phys_port_name.attr, - &dev_attr_phys_switch_id.attr, - &dev_attr_proto_down.attr, -+ &dev_attr_threaded.attr, - NULL, - }; - ATTRIBUTE_GROUPS(net_class); diff --git a/feeds/ipq807x/ipq807x/patches/213-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch b/feeds/ipq807x/ipq807x/patches/213-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch deleted file mode 100644 index 82f4a352d..000000000 --- a/feeds/ipq807x/ipq807x/patches/213-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch +++ /dev/null @@ -1,118 +0,0 @@ -From: Wei Wang -Date: Mon, 1 Mar 2021 17:21:13 -0800 -Subject: [PATCH] net: fix race between napi kthread mode and busy poll - -Currently, napi_thread_wait() checks for NAPI_STATE_SCHED bit to -determine if the kthread owns this napi and could call napi->poll() on -it. However, if socket busy poll is enabled, it is possible that the -busy poll thread grabs this SCHED bit (after the previous napi->poll() -invokes napi_complete_done() and clears SCHED bit) and tries to poll -on the same napi. napi_disable() could grab the SCHED bit as well. -This patch tries to fix this race by adding a new bit -NAPI_STATE_SCHED_THREADED in napi->state. This bit gets set in -____napi_schedule() if the threaded mode is enabled, and gets cleared -in napi_complete_done(), and we only poll the napi in kthread if this -bit is set. This helps distinguish the ownership of the napi between -kthread and other scenarios and fixes the race issue. - -Fixes: 29863d41bb6e ("net: implement threaded-able napi poll loop support") -Reported-by: Martin Zaharinov -Suggested-by: Jakub Kicinski -Signed-off-by: Wei Wang -Cc: Alexander Duyck -Cc: Eric Dumazet -Cc: Paolo Abeni -Cc: Hannes Frederic Sowa ---- - ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -328,6 +328,7 @@ enum { - NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ - NAPI_STATE_HASHED, /* In NAPI hash */ - NAPI_STATE_THREADED, /* The poll is performed inside its own thread*/ -+ NAPI_STATE_SCHED_THREADED, /* Napi is currently scheduled in threaded mode */ - }; - - enum gro_result { ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3281,6 +3281,8 @@ static inline void ____napi_schedule(str - */ - thread = READ_ONCE(napi->thread); - if (thread) { -+ if (thread->state != TASK_INTERRUPTIBLE) -+ set_bit(NAPI_STATE_SCHED_THREADED, &napi->state); - wake_up_process(thread); - return; - } -@@ -4745,12 +4747,14 @@ void __napi_complete(struct napi_struct - list_del_init(&n->poll_list); - smp_mb__before_atomic(); - clear_bit(NAPI_STATE_SCHED, &n->state); -+ clear_bit(NAPI_STATE_SCHED_THREADED, &n->state); - } - EXPORT_SYMBOL(__napi_complete); - - void napi_complete_done(struct napi_struct *n, int work_done) - { - unsigned long flags; -+ unsigned long val, new; - - /* - * don't let napi dequeue from the cpu poll list -@@ -4771,14 +4775,19 @@ void napi_complete_done(struct napi_stru - else - napi_gro_flush(n, false); - } -- if (likely(list_empty(&n->poll_list))) { -- WARN_ON_ONCE(!test_and_clear_bit(NAPI_STATE_SCHED, &n->state)); -- } else { -- /* If n->poll_list is not empty, we need to mask irqs */ -- local_irq_save(flags); -- __napi_complete(n); -- local_irq_restore(flags); -- } -+ -+ /* If n->poll_list is not empty, we need to mask irqs */ -+ local_irq_save(flags); -+ list_del_init(&n->poll_list); -+ local_irq_restore(flags); -+ -+ do { -+ val = READ_ONCE(n->state); -+ -+ WARN_ON_ONCE(!(val & BIT(NAPI_STATE_SCHED))); -+ new = val & ~(BIT(NAPI_STATE_SCHED) | -+ BIT(NAPI_STATE_SCHED_THREADED)); -+ } while (cmpxchg(&n->state, val, new) != val); - } - EXPORT_SYMBOL(napi_complete_done); - -@@ -5053,16 +5062,25 @@ static int napi_poll(struct napi_struct - - static int napi_thread_wait(struct napi_struct *napi) - { -+ bool woken = false; -+ - set_current_state(TASK_INTERRUPTIBLE); - - while (!kthread_should_stop() && !napi_disable_pending(napi)) { -- if (test_bit(NAPI_STATE_SCHED, &napi->state)) { -+ /* Testing SCHED_THREADED bit here to make sure the current -+ * kthread owns this napi and could poll on this napi. -+ * Testing SCHED bit is not enough because SCHED bit might be -+ * set by some other busy poll thread or by napi_disable(). -+ */ -+ if (test_bit(NAPI_STATE_SCHED_THREADED, &napi->state) || woken) { - WARN_ON(!list_empty(&napi->poll_list)); - __set_current_state(TASK_RUNNING); - return 0; - } - - schedule(); -+ /* woken being true indicates this thread owns this napi. */ -+ woken = true; - set_current_state(TASK_INTERRUPTIBLE); - } - __set_current_state(TASK_RUNNING); diff --git a/feeds/ipq807x/ipq807x/patches/214-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch b/feeds/ipq807x/ipq807x/patches/214-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch deleted file mode 100644 index 6ad3ef3a9..000000000 --- a/feeds/ipq807x/ipq807x/patches/214-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: Paolo Abeni -Date: Fri, 9 Apr 2021 17:24:17 +0200 -Subject: [PATCH] net: fix hangup on napi_disable for threaded napi - -napi_disable() is subject to an hangup, when the threaded -mode is enabled and the napi is under heavy traffic. - -If the relevant napi has been scheduled and the napi_disable() -kicks in before the next napi_threaded_wait() completes - so -that the latter quits due to the napi_disable_pending() condition, -the existing code leaves the NAPI_STATE_SCHED bit set and the -napi_disable() loop waiting for such bit will hang. - -This patch addresses the issue by dropping the NAPI_STATE_DISABLE -bit test in napi_thread_wait(). The later napi_threaded_poll() -iteration will take care of clearing the NAPI_STATE_SCHED. - -This also addresses a related problem reported by Jakub: -before this patch a napi_disable()/napi_enable() pair killed -the napi thread, effectively disabling the threaded mode. -On the patched kernel napi_disable() simply stops scheduling -the relevant thread. - -v1 -> v2: - - let the main napi_thread_poll() loop clear the SCHED bit - -Reported-by: Jakub Kicinski -Fixes: 29863d41bb6e ("net: implement threaded-able napi poll loop support") -Signed-off-by: Paolo Abeni -Reviewed-by: Eric Dumazet -Link: https://lore.kernel.org/r/883923fa22745a9589e8610962b7dc59df09fb1f.1617981844.git.pabeni@redhat.com -Signed-off-by: Jakub Kicinski ---- - ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -5066,7 +5066,7 @@ static int napi_thread_wait(struct napi_ - - set_current_state(TASK_INTERRUPTIBLE); - -- while (!kthread_should_stop() && !napi_disable_pending(napi)) { -+ while (!kthread_should_stop()) { - /* Testing SCHED_THREADED bit here to make sure the current - * kthread owns this napi and could poll on this napi. - * Testing SCHED bit is not enough because SCHED bit might be -@@ -5084,6 +5084,7 @@ static int napi_thread_wait(struct napi_ - set_current_state(TASK_INTERRUPTIBLE); - } - __set_current_state(TASK_RUNNING); -+ - return -1; - } - diff --git a/feeds/ipq807x/ipq807x/patches/220-net-sched-add-clsact-qdisc.patch b/feeds/ipq807x/ipq807x/patches/220-net-sched-add-clsact-qdisc.patch deleted file mode 100644 index b5aec6a16..000000000 --- a/feeds/ipq807x/ipq807x/patches/220-net-sched-add-clsact-qdisc.patch +++ /dev/null @@ -1,439 +0,0 @@ -From: Daniel Borkmann -Date: Thu, 7 Jan 2016 22:29:47 +0100 -Subject: [PATCH] net, sched: add clsact qdisc - -This work adds a generalization of the ingress qdisc as a qdisc holding -only classifiers. The clsact qdisc works on ingress, but also on egress. -In both cases, it's execution happens without taking the qdisc lock, and -the main difference for the egress part compared to prior version of [1] -is that this can be applied with _any_ underlying real egress qdisc (also -classless ones). - -Besides solving the use-case of [1], that is, allowing for more programmability -on assigning skb->priority for the mqprio case that is supported by most -popular 10G+ NICs, it also opens up a lot more flexibility for other tc -applications. The main work on classification can already be done at clsact -egress time if the use-case allows and state stored for later retrieval -f.e. again in skb->priority with major/minors (which is checked by most -classful qdiscs before consulting tc_classify()) and/or in other skb fields -like skb->tc_index for some light-weight post-processing to get to the -eventual classid in case of a classful qdisc. Another use case is that -the clsact egress part allows to have a central egress counterpart to -the ingress classifiers, so that classifiers can easily share state (e.g. -in cls_bpf via eBPF maps) for ingress and egress. - -Currently, default setups like mq + pfifo_fast would require for this to -use, for example, prio qdisc instead (to get a tc_classify() run) and to -duplicate the egress classifier for each queue. With clsact, it allows -for leaving the setup as is, it can additionally assign skb->priority to -put the skb in one of pfifo_fast's bands and it can share state with maps. -Moreover, we can access the skb's dst entry (f.e. to retrieve tclassid) -w/o the need to perform a skb_dst_force() to hold on to it any longer. In -lwt case, we can also use this facility to setup dst metadata via cls_bpf -(bpf_skb_set_tunnel_key()) without needing a real egress qdisc just for -that (case of IFF_NO_QUEUE devices, for example). - -The realization can be done without any changes to the scheduler core -framework. All it takes is that we have two a-priori defined minors/child -classes, where we can mux between ingress and egress classifier list -(dev->ingress_cl_list and dev->egress_cl_list, latter stored close to -dev->_tx to avoid extra cacheline miss for moderate loads). The egress -part is a bit similar modelled to handle_ing() and patched to a noop in -case the functionality is not used. Both handlers are now called -sch_handle_ingress() and sch_handle_egress(), code sharing among the two -doesn't seem practical as there are various minor differences in both -paths, so that making them conditional in a single handler would rather -slow things down. - -Full compatibility to ingress qdisc is provided as well. Since both -piggyback on TC_H_CLSACT, only one of them (ingress/clsact) can exist -per netdevice, and thus ingress qdisc specific behaviour can be retained -for user space. This means, either a user does 'tc qdisc add dev foo ingress' -and configures ingress qdisc as usual, or the 'tc qdisc add dev foo clsact' -alternative, where both, ingress and egress classifier can be configured -as in the below example. ingress qdisc supports attaching classifier to any -minor number whereas clsact has two fixed minors for muxing between the -lists, therefore to not break user space setups, they are better done as -two separate qdiscs. - -I decided to extend the sch_ingress module with clsact functionality so -that commonly used code can be reused, the module is being aliased with -sch_clsact so that it can be auto-loaded properly. Alternative would have been -to add a flag when initializing ingress to alter its behaviour plus aliasing -to a different name (as it's more than just ingress). However, the first would -end up, based on the flag, choosing the new/old behaviour by calling different -function implementations to handle each anyway, the latter would require to -register ingress qdisc once again under different alias. So, this really begs -to provide a minimal, cleaner approach to have Qdisc_ops and Qdisc_class_ops -by its own that share callbacks used by both. - -Example, adding qdisc: - - # tc qdisc add dev foo clsact - # tc qdisc show dev foo - qdisc mq 0: root - qdisc pfifo_fast 0: parent :1 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 - qdisc pfifo_fast 0: parent :2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 - qdisc pfifo_fast 0: parent :3 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 - qdisc pfifo_fast 0: parent :4 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 - qdisc clsact ffff: parent ffff:fff1 - -Adding filters (deleting, etc works analogous by specifying ingress/egress): - - # tc filter add dev foo ingress bpf da obj bar.o sec ingress - # tc filter add dev foo egress bpf da obj bar.o sec egress - # tc filter show dev foo ingress - filter protocol all pref 49152 bpf - filter protocol all pref 49152 bpf handle 0x1 bar.o:[ingress] direct-action - # tc filter show dev foo egress - filter protocol all pref 49152 bpf - filter protocol all pref 49152 bpf handle 0x1 bar.o:[egress] direct-action - -A 'tc filter show dev foo' or 'tc filter show dev foo parent ffff:' will -show an empty list for clsact. Either using the parent names (ingress/egress) -or specifying the full major/minor will then show the related filter lists. - -Prior work on a mqprio prequeue() facility [1] was done mainly by John Fastabend. - - [1] http://patchwork.ozlabs.org/patch/512949/ - -Signed-off-by: Daniel Borkmann -Acked-by: John Fastabend -Signed-off-by: David S. Miller ---- - ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -1770,7 +1770,9 @@ struct net_device { - #ifdef CONFIG_XPS - struct xps_dev_maps __rcu *xps_maps; - #endif -- -+#ifdef CONFIG_NET_CLS_ACT -+ struct tcf_proto __rcu *egress_cl_list; -+#endif - #ifdef CONFIG_NET_SWITCHDEV - u32 offload_fwd_mark; - #endif ---- a/include/linux/rtnetlink.h -+++ b/include/linux/rtnetlink.h -@@ -84,6 +84,11 @@ void net_inc_ingress_queue(void); - void net_dec_ingress_queue(void); - #endif - -+#ifdef CONFIG_NET_EGRESS -+void net_inc_egress_queue(void); -+void net_dec_egress_queue(void); -+#endif -+ - extern void rtnetlink_init(void); - extern void __rtnl_unlock(void); - ---- a/include/uapi/linux/pkt_sched.h -+++ b/include/uapi/linux/pkt_sched.h -@@ -72,6 +72,10 @@ struct tc_estimator { - #define TC_H_UNSPEC (0U) - #define TC_H_ROOT (0xFFFFFFFFU) - #define TC_H_INGRESS (0xFFFFFFF1U) -+#define TC_H_CLSACT TC_H_INGRESS -+ -+#define TC_H_MIN_INGRESS 0xFFF2U -+#define TC_H_MIN_EGRESS 0xFFF3U - - /* Need to corrospond to iproute2 tc/tc_core.h "enum link_layer" */ - enum tc_link_layer { ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -1697,6 +1697,22 @@ void net_dec_ingress_queue(void) - EXPORT_SYMBOL_GPL(net_dec_ingress_queue); - #endif - -+#ifdef CONFIG_NET_EGRESS -+static struct static_key egress_needed __read_mostly; -+ -+void net_inc_egress_queue(void) -+{ -+ static_key_slow_inc(&egress_needed); -+} -+EXPORT_SYMBOL_GPL(net_inc_egress_queue); -+ -+void net_dec_egress_queue(void) -+{ -+ static_key_slow_dec(&egress_needed); -+} -+EXPORT_SYMBOL_GPL(net_dec_egress_queue); -+#endif -+ - static struct static_key netstamp_needed __read_mostly; - #ifdef HAVE_JUMP_LABEL - static atomic_t netstamp_needed_deferred; -@@ -2936,7 +2952,6 @@ static inline int __dev_xmit_skb(struct - bool contended; - int rc; - -- qdisc_pkt_len_init(skb); - qdisc_calculate_pkt_len(skb, q); - /* - * Heuristic to force contended enqueues to serialize on a -@@ -3028,6 +3043,49 @@ int dev_loopback_xmit(struct net *net, s - } - EXPORT_SYMBOL(dev_loopback_xmit); - -+#ifdef CONFIG_NET_EGRESS -+static struct sk_buff * -+sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev) -+{ -+ struct tcf_proto *cl = rcu_dereference_bh(dev->egress_cl_list); -+ struct tcf_result cl_res; -+ -+ if (!cl) -+ return skb; -+ -+ /* skb->tc_verd and qdisc_skb_cb(skb)->pkt_len were already set -+ * earlier by the caller. -+ */ -+ qdisc_bstats_cpu_update(cl->q, skb); -+ -+ switch (tc_classify(skb, cl, &cl_res, false)) { -+ case TC_ACT_OK: -+ case TC_ACT_RECLASSIFY: -+ skb->tc_index = TC_H_MIN(cl_res.classid); -+ break; -+ case TC_ACT_SHOT: -+ qdisc_qstats_cpu_drop(cl->q); -+ *ret = NET_XMIT_DROP; -+ goto drop; -+ case TC_ACT_STOLEN: -+ case TC_ACT_QUEUED: -+ *ret = NET_XMIT_SUCCESS; -+drop: -+ kfree_skb(skb); -+ return NULL; -+ case TC_ACT_REDIRECT: -+ /* No need to push/pop skb's mac_header here on egress! */ -+ skb_do_redirect(skb); -+ *ret = NET_XMIT_SUCCESS; -+ return NULL; -+ default: -+ break; -+ } -+ -+ return skb; -+} -+#endif /* CONFIG_NET_EGRESS */ -+ - static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb) - { - #ifdef CONFIG_XPS -@@ -3152,6 +3210,17 @@ static int __dev_queue_xmit(struct sk_bu - - skb_update_prio(skb); - -+ qdisc_pkt_len_init(skb); -+#ifdef CONFIG_NET_CLS_ACT -+ skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS); -+# ifdef CONFIG_NET_EGRESS -+ if (static_key_false(&egress_needed)) { -+ skb = sch_handle_egress(skb, &rc, dev); -+ if (!skb) -+ goto out; -+ } -+# endif -+#endif - /* If device/qdisc don't need skb->dst, release it right now while - * its hot in this cpu cache. - */ -@@ -3173,9 +3242,6 @@ static int __dev_queue_xmit(struct sk_bu - txq = netdev_pick_tx(dev, skb, accel_priv); - q = rcu_dereference_bh(txq->qdisc); - --#ifdef CONFIG_NET_CLS_ACT -- skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS); --#endif - trace_net_dev_queue(skb); - if (q->enqueue) { - rc = __dev_xmit_skb(skb, q, dev, txq); -@@ -3750,9 +3816,9 @@ int (*br_fdb_test_addr_hook)(struct net_ - EXPORT_SYMBOL_GPL(br_fdb_test_addr_hook); - #endif - --static inline struct sk_buff *handle_ing(struct sk_buff *skb, -- struct packet_type **pt_prev, -- int *ret, struct net_device *orig_dev) -+static inline struct sk_buff * -+sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret, -+ struct net_device *orig_dev) - { - #ifdef CONFIG_NET_CLS_ACT - struct tcf_proto *cl = rcu_dereference_bh(skb->dev->ingress_cl_list); -@@ -3974,7 +4040,7 @@ another_round: - skip_taps: - #ifdef CONFIG_NET_INGRESS - if (static_key_false(&ingress_needed)) { -- skb = handle_ing(skb, &pt_prev, &ret, orig_dev); -+ skb = sch_handle_ingress(skb, &pt_prev, &ret, orig_dev); - if (!skb) - goto out; - ---- a/net/Kconfig -+++ b/net/Kconfig -@@ -54,6 +54,9 @@ config COMPAT_NETLINK_MESSAGES - config NET_INGRESS - bool - -+config NET_EGRESS -+ bool -+ - menu "Networking options" - - source "net/packet/Kconfig" ---- a/net/sched/cls_bpf.c -+++ b/net/sched/cls_bpf.c -@@ -291,7 +291,7 @@ static int cls_bpf_prog_from_efd(struct - prog->bpf_name = name; - prog->filter = fp; - -- if (fp->dst_needed) -+ if (fp->dst_needed && !(tp->q->flags & TCQ_F_INGRESS)) - netif_keep_dst(qdisc_dev(tp->q)); - - return 0; ---- a/net/sched/Kconfig -+++ b/net/sched/Kconfig -@@ -342,15 +342,21 @@ config NET_SCH_PIE - If unsure, say N. - - config NET_SCH_INGRESS -- tristate "Ingress Qdisc" -+ tristate "Ingress/classifier-action Qdisc" - depends on NET_CLS_ACT - select NET_INGRESS -+ select NET_EGRESS - ---help--- -- Say Y here if you want to use classifiers for incoming packets. -+ Say Y here if you want to use classifiers for incoming and/or outgoing -+ packets. This qdisc doesn't do anything else besides running classifiers, -+ which can also have actions attached to them. In case of outgoing packets, -+ classifiers that this qdisc holds are executed in the transmit path -+ before real enqueuing to an egress qdisc happens. -+ - If unsure, say Y. - -- To compile this code as a module, choose M here: the -- module will be called sch_ingress. -+ To compile this code as a module, choose M here: the module will be -+ called sch_ingress with alias of sch_clsact. - - config NET_SCH_PLUG - tristate "Plug network traffic until release (PLUG)" ---- a/net/sched/sch_ingress.c -+++ b/net/sched/sch_ingress.c -@@ -1,4 +1,5 @@ --/* net/sched/sch_ingress.c - Ingress qdisc -+/* net/sched/sch_ingress.c - Ingress and clsact qdisc -+ * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version -@@ -98,17 +99,100 @@ static struct Qdisc_ops ingress_qdisc_op - .owner = THIS_MODULE, - }; - -+static unsigned long clsact_get(struct Qdisc *sch, u32 classid) -+{ -+ switch (TC_H_MIN(classid)) { -+ case TC_H_MIN(TC_H_MIN_INGRESS): -+ case TC_H_MIN(TC_H_MIN_EGRESS): -+ return TC_H_MIN(classid); -+ default: -+ return 0; -+ } -+} -+ -+static unsigned long clsact_bind_filter(struct Qdisc *sch, -+ unsigned long parent, u32 classid) -+{ -+ return clsact_get(sch, classid); -+} -+ -+static struct tcf_proto __rcu **clsact_find_tcf(struct Qdisc *sch, -+ unsigned long cl) -+{ -+ struct net_device *dev = qdisc_dev(sch); -+ -+ switch (cl) { -+ case TC_H_MIN(TC_H_MIN_INGRESS): -+ return &dev->ingress_cl_list; -+ case TC_H_MIN(TC_H_MIN_EGRESS): -+ return &dev->egress_cl_list; -+ default: -+ return NULL; -+ } -+} -+ -+static int clsact_init(struct Qdisc *sch, struct nlattr *opt) -+{ -+ net_inc_ingress_queue(); -+ net_inc_egress_queue(); -+ -+ sch->flags |= TCQ_F_CPUSTATS; -+ -+ return 0; -+} -+ -+static void clsact_destroy(struct Qdisc *sch) -+{ -+ struct net_device *dev = qdisc_dev(sch); -+ -+ tcf_destroy_chain(&dev->ingress_cl_list); -+ tcf_destroy_chain(&dev->egress_cl_list); -+ -+ net_dec_ingress_queue(); -+ net_dec_egress_queue(); -+} -+ -+static const struct Qdisc_class_ops clsact_class_ops = { -+ .leaf = ingress_leaf, -+ .get = clsact_get, -+ .put = ingress_put, -+ .walk = ingress_walk, -+ .tcf_chain = clsact_find_tcf, -+ .bind_tcf = clsact_bind_filter, -+ .unbind_tcf = ingress_put, -+}; -+ -+static struct Qdisc_ops clsact_qdisc_ops __read_mostly = { -+ .cl_ops = &clsact_class_ops, -+ .id = "clsact", -+ .init = clsact_init, -+ .destroy = clsact_destroy, -+ .dump = ingress_dump, -+ .owner = THIS_MODULE, -+}; -+ - static int __init ingress_module_init(void) - { -- return register_qdisc(&ingress_qdisc_ops); -+ int ret; -+ -+ ret = register_qdisc(&ingress_qdisc_ops); -+ if (!ret) { -+ ret = register_qdisc(&clsact_qdisc_ops); -+ if (ret) -+ unregister_qdisc(&ingress_qdisc_ops); -+ } -+ -+ return ret; - } - - static void __exit ingress_module_exit(void) - { - unregister_qdisc(&ingress_qdisc_ops); -+ unregister_qdisc(&clsact_qdisc_ops); - } - - module_init(ingress_module_init); - module_exit(ingress_module_exit); - -+MODULE_ALIAS("sch_clsact"); - MODULE_LICENSE("GPL"); diff --git a/feeds/ipq807x/ipq807x/patches/221-net-sched-act_mirred-Rename-tcfm_ok_push-to-tcfm_mac.patch b/feeds/ipq807x/ipq807x/patches/221-net-sched-act_mirred-Rename-tcfm_ok_push-to-tcfm_mac.patch deleted file mode 100644 index 199fee15e..000000000 --- a/feeds/ipq807x/ipq807x/patches/221-net-sched-act_mirred-Rename-tcfm_ok_push-to-tcfm_mac.patch +++ /dev/null @@ -1,75 +0,0 @@ -From: Shmulik Ladkani -Date: Thu, 13 Oct 2016 09:06:41 +0300 -Subject: [PATCH] net/sched: act_mirred: Rename tcfm_ok_push to - tcfm_mac_header_xmit and make it a bool - -'tcfm_ok_push' specifies whether a mac_len sized push is needed upon -egress to the target device (if action is performed at ingress). - -Rename it to 'tcfm_mac_header_xmit' as this is actually an attribute of -the target device (and use a bool instead of int). - -This allows to decouple the attribute from the action to be taken. - -Signed-off-by: Shmulik Ladkani -Acked-by: Jamal Hadi Salim -Signed-off-by: David S. Miller ---- - ---- a/include/net/tc_act/tc_mirred.h -+++ b/include/net/tc_act/tc_mirred.h -@@ -7,7 +7,7 @@ struct tcf_mirred { - struct tcf_common common; - int tcfm_eaction; - int tcfm_ifindex; -- int tcfm_ok_push; -+ bool tcfm_mac_header_xmit; - struct net_device __rcu *tcfm_dev; - struct list_head tcfm_list; - }; ---- a/net/sched/act_mirred.c -+++ b/net/sched/act_mirred.c -@@ -55,10 +55,11 @@ static int tcf_mirred_init(struct net *n - int bind) - { - struct nlattr *tb[TCA_MIRRED_MAX + 1]; -+ bool mac_header_xmit = false; - struct tc_mirred *parm; - struct tcf_mirred *m; - struct net_device *dev; -- int ret, ok_push = 0; -+ int ret; - - if (nla == NULL) - return -EINVAL; -@@ -86,10 +87,10 @@ static int tcf_mirred_init(struct net *n - case ARPHRD_IPGRE: - case ARPHRD_VOID: - case ARPHRD_NONE: -- ok_push = 0; -+ mac_header_xmit = false; - break; - default: -- ok_push = 1; -+ mac_header_xmit = true; - break; - } - } else { -@@ -123,7 +124,7 @@ static int tcf_mirred_init(struct net *n - dev_put(rcu_dereference_protected(m->tcfm_dev, 1)); - dev_hold(dev); - rcu_assign_pointer(m->tcfm_dev, dev); -- m->tcfm_ok_push = ok_push; -+ m->tcfm_mac_header_xmit = mac_header_xmit; - } - - if (ret == ACT_P_CREATED) { -@@ -169,7 +170,7 @@ static int tcf_mirred(struct sk_buff *sk - goto out; - - if (!(at & AT_EGRESS)) { -- if (m->tcfm_ok_push) -+ if (m->tcfm_mac_header_xmit) - skb_push_rcsum(skb2, skb->mac_len); - } - diff --git a/feeds/ipq807x/ipq807x/patches/222-net-sched-act_mirred-Refactor-detection-whether-dev-.patch b/feeds/ipq807x/ipq807x/patches/222-net-sched-act_mirred-Refactor-detection-whether-dev-.patch deleted file mode 100644 index b752c5c3f..000000000 --- a/feeds/ipq807x/ipq807x/patches/222-net-sched-act_mirred-Refactor-detection-whether-dev-.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Shmulik Ladkani -Date: Thu, 13 Oct 2016 09:06:42 +0300 -Subject: [PATCH] net/sched: act_mirred: Refactor detection whether dev needs - xmit at mac header - -Move detection logic that tests whether device expects skb data to point -at mac_header upon xmit into a function. - -Signed-off-by: Shmulik Ladkani -Acked-by: Jamal Hadi Salim -Signed-off-by: David S. Miller ---- - ---- a/net/sched/act_mirred.c -+++ b/net/sched/act_mirred.c -@@ -80,19 +80,7 @@ static int tcf_mirred_init(struct net *n - dev = __dev_get_by_index(net, parm->ifindex); - if (dev == NULL) - return -ENODEV; -- switch (dev->type) { -- case ARPHRD_TUNNEL: -- case ARPHRD_TUNNEL6: -- case ARPHRD_SIT: -- case ARPHRD_IPGRE: -- case ARPHRD_VOID: -- case ARPHRD_NONE: -- mac_header_xmit = false; -- break; -- default: -- mac_header_xmit = true; -- break; -- } -+ mac_header_xmit = dev_is_mac_header_xmit(dev); - } else { - dev = NULL; - } diff --git a/feeds/ipq807x/ipq807x/patches/223-net-sched-act_mirred-Implement-ingress-actions.patch b/feeds/ipq807x/ipq807x/patches/223-net-sched-act_mirred-Implement-ingress-actions.patch deleted file mode 100644 index 14373e539..000000000 --- a/feeds/ipq807x/ipq807x/patches/223-net-sched-act_mirred-Implement-ingress-actions.patch +++ /dev/null @@ -1,125 +0,0 @@ -From: Shmulik Ladkani -Date: Thu, 13 Oct 2016 09:06:44 +0300 -Subject: [PATCH] net/sched: act_mirred: Implement ingress actions - -Up until now, 'action mirred' supported only egress actions (either -TCA_EGRESS_REDIR or TCA_EGRESS_MIRROR). - -This patch implements the corresponding ingress actions -TCA_INGRESS_REDIR and TCA_INGRESS_MIRROR. - -This allows attaching filters whose target is to hand matching skbs into -the rx processing of a specified device. - -Signed-off-by: Shmulik Ladkani -Cc: Jamal Hadi Salim -Cc: Eric Dumazet -Cc: Cong Wang -Tested-by: Jamal Hadi Salim -Acked-by: Jamal Hadi Salim -Signed-off-by: David S. Miller ---- - ---- a/net/sched/act_mirred.c -+++ b/net/sched/act_mirred.c -@@ -33,6 +33,25 @@ - static LIST_HEAD(mirred_list); - static DEFINE_SPINLOCK(mirred_list_lock); - -+static bool tcf_mirred_is_act_redirect(int action) -+{ -+ return action == TCA_EGRESS_REDIR || action == TCA_INGRESS_REDIR; -+} -+ -+static u32 tcf_mirred_act_direction(int action) -+{ -+ switch (action) { -+ case TCA_EGRESS_REDIR: -+ case TCA_EGRESS_MIRROR: -+ return AT_EGRESS; -+ case TCA_INGRESS_REDIR: -+ case TCA_INGRESS_MIRROR: -+ return AT_INGRESS; -+ default: -+ BUG(); -+ } -+} -+ - static void tcf_mirred_release(struct tc_action *a, int bind) - { - struct tcf_mirred *m = to_mirred(a); -@@ -72,6 +91,8 @@ static int tcf_mirred_init(struct net *n - switch (parm->eaction) { - case TCA_EGRESS_MIRROR: - case TCA_EGRESS_REDIR: -+ case TCA_INGRESS_REDIR: -+ case TCA_INGRESS_MIRROR: - break; - default: - return -EINVAL; -@@ -129,9 +150,12 @@ static int tcf_mirred(struct sk_buff *sk - struct tcf_result *res) - { - struct tcf_mirred *m = a->priv; -+ bool m_mac_header_xmit; - struct net_device *dev; - struct sk_buff *skb2; -- int retval, err; -+ int retval, err = 0; -+ int m_eaction; -+ int mac_len; - u32 at; - - tcf_lastuse_update(&m->tcf_tm); -@@ -139,6 +163,8 @@ static int tcf_mirred(struct sk_buff *sk - bstats_cpu_update(this_cpu_ptr(m->common.cpu_bstats), skb); - - rcu_read_lock(); -+ m_mac_header_xmit = READ_ONCE(m->tcfm_mac_header_xmit); -+ m_eaction = READ_ONCE(m->tcfm_eaction); - retval = READ_ONCE(m->tcf_action); - dev = rcu_dereference(m->tcfm_dev); - if (unlikely(!dev)) { -@@ -157,24 +183,37 @@ static int tcf_mirred(struct sk_buff *sk - if (!skb2) - goto out; - -- if (!(at & AT_EGRESS)) { -- if (m->tcfm_mac_header_xmit) -+ /* If action's target direction differs than filter's direction, -+ * and devices expect a mac header on xmit, then mac push/pull is -+ * needed. -+ */ -+ if (at != tcf_mirred_act_direction(m_eaction) && m_mac_header_xmit) { -+ if (at & AT_EGRESS) { -+ /* caught at egress, act ingress: pull mac */ -+ mac_len = skb_network_header(skb) - skb_mac_header(skb); -+ skb_pull_rcsum(skb2, mac_len); -+ } else { -+ /* caught at ingress, act egress: push mac */ - skb_push_rcsum(skb2, skb->mac_len); -+ } - } - - /* mirror is always swallowed */ -- if (m->tcfm_eaction != TCA_EGRESS_MIRROR) -+ if (tcf_mirred_is_act_redirect(m_eaction)) - skb2->tc_verd = SET_TC_FROM(skb2->tc_verd, at); - - skb2->skb_iif = skb->dev->ifindex; - skb2->dev = dev; - skb_sender_cpu_clear(skb2); -- err = dev_queue_xmit(skb2); -+ if (tcf_mirred_act_direction(m_eaction) & AT_EGRESS) -+ err = dev_queue_xmit(skb2); -+ else -+ err = netif_receive_skb(skb2); - - if (err) { - out: - qstats_overlimit_inc(this_cpu_ptr(m->common.cpu_qstats)); -- if (m->tcfm_eaction != TCA_EGRESS_MIRROR) -+ if (tcf_mirred_is_act_redirect(m_eaction)) - retval = TC_ACT_SHOT; - } - rcu_read_unlock(); diff --git a/feeds/ipq807x/ipq807x/patches/224-clear-skbuffs-cb-for-incoming-packets.patch b/feeds/ipq807x/ipq807x/patches/224-clear-skbuffs-cb-for-incoming-packets.patch deleted file mode 100644 index 85e8bc9e9..000000000 --- a/feeds/ipq807x/ipq807x/patches/224-clear-skbuffs-cb-for-incoming-packets.patch +++ /dev/null @@ -1,30 +0,0 @@ -From a0d398a7373b395a2cbdc865815560671d1e8a08 Mon Sep 17 00:00:00 2001 -From: Venkat Chimata -Date: Fri, 12 Aug 2022 15:42:40 +0530 -Subject: [PATCH] sk_buff's cb should be cleared in the entry point for both - incoming and outgoing packets at each layer. At bridge, it is already handled - in the outgoing path, but not in the incoming path. We have seen cases where - proxyarp_replied was 1 on sk_buffs coming from the WLAN driver and they were - getting dropped in forwarding path. - -Signed-off-by: Venkat Chimata ---- - net/bridge/br_input.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c -index e6b745b7..09cd5b72 100644 ---- a/net/bridge/br_input.c -+++ b/net/bridge/br_input.c -@@ -282,6 +282,8 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb) - if (!skb) - return RX_HANDLER_CONSUMED; - -+ memset(skb->cb, 0, sizeof(struct br_input_skb_cb)); -+ - p = br_port_get_rcu(skb->dev); - - if (unlikely(is_link_local_ether_addr(dest))) { --- -2.34.1 - diff --git a/feeds/ipq807x/ipq807x/patches/225-net-sched-introduce-Match-all-classifier.patch b/feeds/ipq807x/ipq807x/patches/225-net-sched-introduce-Match-all-classifier.patch deleted file mode 100644 index 512928b63..000000000 --- a/feeds/ipq807x/ipq807x/patches/225-net-sched-introduce-Match-all-classifier.patch +++ /dev/null @@ -1,315 +0,0 @@ -From: Jiri Pirko -Date: Thu, 21 Jul 2016 12:03:11 +0200 -Subject: [PATCH] net/sched: introduce Match-all classifier - -The matchall classifier matches every packet and allows the user to apply -actions on it. This filter is very useful in usecases where every packet -should be matched, for example, packet mirroring (SPAN) can be setup very -easily using that filter. - -Signed-off-by: Jiri Pirko -Signed-off-by: Yotam Gigi -Signed-off-by: David S. Miller ---- - create mode 100644 net/sched/cls_matchall.c - ---- a/include/uapi/linux/pkt_cls.h -+++ b/include/uapi/linux/pkt_cls.h -@@ -427,6 +427,17 @@ enum { - - #define TCA_FLOWER_MAX (__TCA_FLOWER_MAX - 1) - -+/* Match-all classifier */ -+ -+enum { -+ TCA_MATCHALL_UNSPEC, -+ TCA_MATCHALL_CLASSID, -+ TCA_MATCHALL_ACT, -+ __TCA_MATCHALL_MAX, -+}; -+ -+#define TCA_MATCHALL_MAX (__TCA_MATCHALL_MAX - 1) -+ - /* Extended Matches */ - - struct tcf_ematch_tree_hdr { ---- /dev/null -+++ b/net/sched/cls_matchall.c -@@ -0,0 +1,248 @@ -+/* -+ * net/sched/cls_matchll.c Match-all classifier -+ * -+ * Copyright (c) 2016 Jiri Pirko -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ */ -+ -+#include -+#include -+#include -+ -+#include -+#include -+ -+struct cls_mall_filter { -+ struct tcf_exts exts; -+ struct tcf_result res; -+ u32 handle; -+ struct rcu_head rcu; -+}; -+ -+struct cls_mall_head { -+ struct cls_mall_filter *filter; -+ struct rcu_head rcu; -+}; -+ -+static int mall_classify(struct sk_buff *skb, const struct tcf_proto *tp, -+ struct tcf_result *res) -+{ -+ struct cls_mall_head *head = rcu_dereference_bh(tp->root); -+ struct cls_mall_filter *f = head->filter; -+ -+ return tcf_exts_exec(skb, &f->exts, res); -+} -+ -+static int mall_init(struct tcf_proto *tp) -+{ -+ struct cls_mall_head *head; -+ -+ head = kzalloc(sizeof(*head), GFP_KERNEL); -+ if (!head) -+ return -ENOBUFS; -+ -+ rcu_assign_pointer(tp->root, head); -+ -+ return 0; -+} -+ -+static void mall_destroy_filter(struct rcu_head *head) -+{ -+ struct cls_mall_filter *f = container_of(head, struct cls_mall_filter, rcu); -+ -+ tcf_exts_destroy(&f->exts); -+ kfree(f); -+} -+ -+static bool mall_destroy(struct tcf_proto *tp, bool force) -+{ -+ struct cls_mall_head *head = rtnl_dereference(tp->root); -+ -+ if (!force && head->filter) -+ return false; -+ -+ if (head->filter) -+ call_rcu(&head->filter->rcu, mall_destroy_filter); -+ RCU_INIT_POINTER(tp->root, NULL); -+ kfree_rcu(head, rcu); -+ return true; -+} -+ -+static unsigned long mall_get(struct tcf_proto *tp, u32 handle) -+{ -+ struct cls_mall_head *head = rtnl_dereference(tp->root); -+ struct cls_mall_filter *f = head->filter; -+ -+ if (f && f->handle == handle) -+ return (unsigned long) f; -+ return 0; -+} -+ -+static const struct nla_policy mall_policy[TCA_MATCHALL_MAX + 1] = { -+ [TCA_MATCHALL_UNSPEC] = { .type = NLA_UNSPEC }, -+ [TCA_MATCHALL_CLASSID] = { .type = NLA_U32 }, -+}; -+ -+static int mall_set_parms(struct net *net, struct tcf_proto *tp, -+ struct cls_mall_filter *f, -+ unsigned long base, struct nlattr **tb, -+ struct nlattr *est, bool ovr) -+{ -+ struct tcf_exts e; -+ int err; -+ -+ tcf_exts_init(&e, TCA_MATCHALL_ACT, 0); -+ err = tcf_exts_validate(net, tp, tb, est, &e, ovr); -+ if (err < 0) -+ return err; -+ -+ if (tb[TCA_MATCHALL_CLASSID]) { -+ f->res.classid = nla_get_u32(tb[TCA_MATCHALL_CLASSID]); -+ tcf_bind_filter(tp, &f->res, base); -+ } -+ -+ tcf_exts_change(tp, &f->exts, &e); -+ -+ return 0; -+} -+ -+static int mall_change(struct net *net, struct sk_buff *in_skb, -+ struct tcf_proto *tp, unsigned long base, -+ u32 handle, struct nlattr **tca, -+ unsigned long *arg, bool ovr) -+{ -+ struct cls_mall_head *head = rtnl_dereference(tp->root); -+ struct cls_mall_filter *fold = (struct cls_mall_filter *) *arg; -+ struct cls_mall_filter *f; -+ struct nlattr *tb[TCA_MATCHALL_MAX + 1]; -+ int err; -+ -+ if (!tca[TCA_OPTIONS]) -+ return -EINVAL; -+ -+ if (head->filter) -+ return -EBUSY; -+ -+ if (fold) -+ return -EINVAL; -+ -+ err = nla_parse_nested(tb, TCA_MATCHALL_MAX, -+ tca[TCA_OPTIONS], mall_policy); -+ if (err < 0) -+ return err; -+ -+ f = kzalloc(sizeof(*f), GFP_KERNEL); -+ if (!f) -+ return -ENOBUFS; -+ -+ tcf_exts_init(&f->exts, TCA_MATCHALL_ACT, 0); -+ -+ if (!handle) -+ handle = 1; -+ f->handle = handle; -+ -+ err = mall_set_parms(net, tp, f, base, tb, tca[TCA_RATE], ovr); -+ if (err) -+ goto errout; -+ -+ *arg = (unsigned long) f; -+ rcu_assign_pointer(head->filter, f); -+ -+ return 0; -+ -+errout: -+ kfree(f); -+ return err; -+} -+ -+static int mall_delete(struct tcf_proto *tp, unsigned long arg) -+{ -+ struct cls_mall_head *head = rtnl_dereference(tp->root); -+ struct cls_mall_filter *f = (struct cls_mall_filter *) arg; -+ -+ RCU_INIT_POINTER(head->filter, NULL); -+ tcf_unbind_filter(tp, &f->res); -+ call_rcu(&f->rcu, mall_destroy_filter); -+ return 0; -+} -+ -+static void mall_walk(struct tcf_proto *tp, struct tcf_walker *arg) -+{ -+ struct cls_mall_head *head = rtnl_dereference(tp->root); -+ struct cls_mall_filter *f = head->filter; -+ -+ if (arg->count < arg->skip) -+ goto skip; -+ if (arg->fn(tp, (unsigned long) f, arg) < 0) -+ arg->stop = 1; -+skip: -+ arg->count++; -+} -+ -+static int mall_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, -+ struct sk_buff *skb, struct tcmsg *t) -+{ -+ struct cls_mall_filter *f = (struct cls_mall_filter *) fh; -+ struct nlattr *nest; -+ -+ if (!f) -+ return skb->len; -+ -+ t->tcm_handle = f->handle; -+ -+ nest = nla_nest_start(skb, TCA_OPTIONS); -+ if (!nest) -+ goto nla_put_failure; -+ -+ if (f->res.classid && -+ nla_put_u32(skb, TCA_MATCHALL_CLASSID, f->res.classid)) -+ goto nla_put_failure; -+ -+ if (tcf_exts_dump(skb, &f->exts)) -+ goto nla_put_failure; -+ -+ nla_nest_end(skb, nest); -+ -+ if (tcf_exts_dump_stats(skb, &f->exts) < 0) -+ goto nla_put_failure; -+ -+ return skb->len; -+ -+nla_put_failure: -+ nla_nest_cancel(skb, nest); -+ return -1; -+} -+ -+static struct tcf_proto_ops cls_mall_ops __read_mostly = { -+ .kind = "matchall", -+ .classify = mall_classify, -+ .init = mall_init, -+ .destroy = mall_destroy, -+ .get = mall_get, -+ .change = mall_change, -+ .delete = mall_delete, -+ .walk = mall_walk, -+ .dump = mall_dump, -+ .owner = THIS_MODULE, -+}; -+ -+static int __init cls_mall_init(void) -+{ -+ return register_tcf_proto_ops(&cls_mall_ops); -+} -+ -+static void __exit cls_mall_exit(void) -+{ -+ unregister_tcf_proto_ops(&cls_mall_ops); -+} -+ -+module_init(cls_mall_init); -+module_exit(cls_mall_exit); -+ -+MODULE_AUTHOR("Jiri Pirko "); -+MODULE_DESCRIPTION("Match-all classifier"); -+MODULE_LICENSE("GPL v2"); ---- a/net/sched/Kconfig -+++ b/net/sched/Kconfig -@@ -526,6 +526,16 @@ config NET_CLS_FLOWER - To compile this code as a module, choose M here: the module will - be called cls_flower. - -+config NET_CLS_MATCHALL -+ tristate "Match-all classifier" -+ select NET_CLS -+ ---help--- -+ If you say Y here, you will be able to classify packets based on -+ nothing. Every packet will match. -+ -+ To compile this code as a module, choose M here: the module will -+ be called cls_matchall. -+ - config NET_EMATCH - bool "Extended Matches" - select NET_CLS ---- a/net/sched/Makefile -+++ b/net/sched/Makefile -@@ -58,6 +58,7 @@ obj-$(CONFIG_NET_CLS_FLOW) += cls_flow.o - obj-$(CONFIG_NET_CLS_CGROUP) += cls_cgroup.o - obj-$(CONFIG_NET_CLS_BPF) += cls_bpf.o - obj-$(CONFIG_NET_CLS_FLOWER) += cls_flower.o -+obj-$(CONFIG_NET_CLS_MATCHALL) += cls_matchall.o - obj-$(CONFIG_NET_EMATCH) += ematch.o - obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o - obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o diff --git a/feeds/ipq807x/ipq807x/patches/230-ipv4-route-Ignore-output-interface-in-FIB-lookup-for.patch b/feeds/ipq807x/ipq807x/patches/230-ipv4-route-Ignore-output-interface-in-FIB-lookup-for.patch deleted file mode 100644 index fead582cc..000000000 --- a/feeds/ipq807x/ipq807x/patches/230-ipv4-route-Ignore-output-interface-in-FIB-lookup-for.patch +++ /dev/null @@ -1,72 +0,0 @@ -From: Stefano Brivio -Date: Tue, 4 Aug 2020 07:53:42 +0200 -Subject: [PATCH] ipv4: route: Ignore output interface in FIB lookup for PMTU - route - -Currently, processes sending traffic to a local bridge with an -encapsulation device as a port don't get ICMP errors if they exceed -the PMTU of the encapsulated link. - -David Ahern suggested this as a hack, but it actually looks like -the correct solution: when we update the PMTU for a given destination -by means of updating or creating a route exception, the encapsulation -might trigger this because of PMTU discovery happening either on the -encapsulation device itself, or its lower layer. This happens on -bridged encapsulations only. - -The output interface shouldn't matter, because we already have a -valid destination. Drop the output interface restriction from the -associated route lookup. - -For UDP tunnels, we will now have a route exception created for the -encapsulation itself, with a MTU value reflecting its headroom, which -allows a bridge forwarding IP packets originated locally to deliver -errors back to the sending socket. - -The behaviour is now consistent with IPv6 and verified with selftests -pmtu_ipv{4,6}_br_{geneve,vxlan}{4,6}_exception introduced later in -this series. - -v2: -- reset output interface only for bridge ports (David Ahern) -- add and use netif_is_any_bridge_port() helper (David Ahern) - -Suggested-by: David Ahern -Signed-off-by: Stefano Brivio -Reviewed-by: David Ahern -Signed-off-by: David S. Miller ---- - ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -4015,6 +4015,16 @@ static inline bool netif_is_ovs_master(c - return dev->priv_flags & IFF_OPENVSWITCH; - } - -+static inline bool netif_is_ovs_port(const struct net_device *dev) -+{ -+ return dev->priv_flags & IFF_OVS_DATAPATH; -+} -+ -+static inline bool netif_is_any_bridge_port(const struct net_device *dev) -+{ -+ return netif_is_bridge_port(dev) || netif_is_ovs_port(dev); -+} -+ - static inline bool netif_is_ifb_dev(const struct net_device *dev) - { - return dev->priv_flags_ext & IFF_EXT_IFB; ---- a/net/ipv4/route.c -+++ b/net/ipv4/route.c -@@ -1004,6 +1004,11 @@ static void ip_rt_update_pmtu(struct dst - struct flowi4 fl4; - - ip_rt_build_flow_key(&fl4, sk, skb); -+ -+ /* Don't make lookup fail for bridged encapsulations */ -+ if (skb && netif_is_any_bridge_port(skb->dev)) -+ fl4.flowi4_oif = 0; -+ - __ip_rt_update_pmtu(rt, &fl4, mtu); - } - diff --git a/feeds/ipq807x/ipq807x/patches/231-icmp-add-helpers-to-recognize-ICMP-error-packets.patch b/feeds/ipq807x/ipq807x/patches/231-icmp-add-helpers-to-recognize-ICMP-error-packets.patch deleted file mode 100644 index f697ae483..000000000 --- a/feeds/ipq807x/ipq807x/patches/231-icmp-add-helpers-to-recognize-ICMP-error-packets.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Matteo Croce -Date: Sat, 2 Nov 2019 01:12:03 +0100 -Subject: [PATCH] icmp: add helpers to recognize ICMP error packets - -Add two helper functions, one for IPv4 and one for IPv6, to recognize -the ICMP packets which are error responses. -This packets are special because they have as payload the original -header of the packet which generated it (RFC 792 says at least 8 bytes, -but Linux actually includes much more than that). - -Signed-off-by: Matteo Croce -Signed-off-by: David S. Miller ---- - ---- a/include/linux/icmp.h -+++ b/include/linux/icmp.h -@@ -24,4 +24,19 @@ static inline struct icmphdr *icmp_hdr(c - { - return (struct icmphdr *)skb_transport_header(skb); - } -+ -+static inline bool icmp_is_err(int type) -+{ -+ switch (type) { -+ case ICMP_DEST_UNREACH: -+ case ICMP_SOURCE_QUENCH: -+ case ICMP_REDIRECT: -+ case ICMP_TIME_EXCEEDED: -+ case ICMP_PARAMETERPROB: -+ return true; -+ } -+ -+ return false; -+} -+ - #endif /* _LINUX_ICMP_H */ ---- a/include/linux/icmpv6.h -+++ b/include/linux/icmpv6.h -@@ -42,4 +42,18 @@ extern void icmpv6_flow_init(struct s - const struct in6_addr *saddr, - const struct in6_addr *daddr, - int oif); -+ -+static inline bool icmpv6_is_err(int type) -+{ -+ switch (type) { -+ case ICMPV6_DEST_UNREACH: -+ case ICMPV6_PKT_TOOBIG: -+ case ICMPV6_TIME_EXCEED: -+ case ICMPV6_PARAMPROB: -+ return true; -+ } -+ -+ return false; -+} -+ - #endif diff --git a/feeds/ipq807x/ipq807x/patches/232-tunnels-PMTU-discovery-support-for-directly-bridged-.patch b/feeds/ipq807x/ipq807x/patches/232-tunnels-PMTU-discovery-support-for-directly-bridged-.patch deleted file mode 100644 index e87b920fc..000000000 --- a/feeds/ipq807x/ipq807x/patches/232-tunnels-PMTU-discovery-support-for-directly-bridged-.patch +++ /dev/null @@ -1,360 +0,0 @@ -From: Stefano Brivio -Date: Tue, 4 Aug 2020 07:53:43 +0200 -Subject: [PATCH] tunnels: PMTU discovery support for directly bridged IP - packets - -It's currently possible to bridge Ethernet tunnels carrying IP -packets directly to external interfaces without assigning them -addresses and routes on the bridged network itself: this is the case -for UDP tunnels bridged with a standard bridge or by Open vSwitch. - -PMTU discovery is currently broken with those configurations, because -the encapsulation effectively decreases the MTU of the link, and -while we are able to account for this using PMTU discovery on the -lower layer, we don't have a way to relay ICMP or ICMPv6 messages -needed by the sender, because we don't have valid routes to it. - -On the other hand, as a tunnel endpoint, we can't fragment packets -as a general approach: this is for instance clearly forbidden for -VXLAN by RFC 7348, section 4.3: - - VTEPs MUST NOT fragment VXLAN packets. Intermediate routers may - fragment encapsulated VXLAN packets due to the larger frame size. - The destination VTEP MAY silently discard such VXLAN fragments. - -The same paragraph recommends that the MTU over the physical network -accomodates for encapsulations, but this isn't a practical option for -complex topologies, especially for typical Open vSwitch use cases. - -Further, it states that: - - Other techniques like Path MTU discovery (see [RFC1191] and - [RFC1981]) MAY be used to address this requirement as well. - -Now, PMTU discovery already works for routed interfaces, we get -route exceptions created by the encapsulation device as they receive -ICMP Fragmentation Needed and ICMPv6 Packet Too Big messages, and -we already rebuild those messages with the appropriate MTU and route -them back to the sender. - -Add the missing bits for bridged cases: - -- checks in skb_tunnel_check_pmtu() to understand if it's appropriate - to trigger a reply according to RFC 1122 section 3.2.2 for ICMP and - RFC 4443 section 2.4 for ICMPv6. This function is already called by - UDP tunnels - -- a new function generating those ICMP or ICMPv6 replies. We can't - reuse icmp_send() and icmp6_send() as we don't see the sender as a - valid destination. This doesn't need to be generic, as we don't - cover any other type of ICMP errors given that we only provide an - encapsulation function to the sender - -While at it, make the MTU check in skb_tunnel_check_pmtu() accurate: -we might receive GSO buffers here, and the passed headroom already -includes the inner MAC length, so we don't have to account for it -a second time (that would imply three MAC headers on the wire, but -there are just two). - -This issue became visible while bridging IPv6 packets with 4500 bytes -of payload over GENEVE using IPv4 with a PMTU of 4000. Given the 50 -bytes of encapsulation headroom, we would advertise MTU as 3950, and -we would reject fragmented IPv6 datagrams of 3958 bytes size on the -wire. We're exclusively dealing with network MTU here, though, so we -could get Ethernet frames up to 3964 octets in that case. - -v2: -- moved skb_tunnel_check_pmtu() to ip_tunnel_core.c (David Ahern) -- split IPv4/IPv6 functions (David Ahern) - -Signed-off-by: Stefano Brivio -Reviewed-by: David Ahern -Signed-off-by: David S. Miller ---- - ---- a/include/net/ip_tunnels.h -+++ b/include/net/ip_tunnels.h -@@ -279,6 +279,8 @@ int iptunnel_xmit(struct sock *sk, struc - u8 tos, u8 ttl, __be16 df, bool xnet); - struct metadata_dst *iptunnel_metadata_reply(struct metadata_dst *md, - gfp_t flags); -+int skb_tunnel_check_pmtu(struct sk_buff *skb, struct dst_entry *encap_dst, -+ int headroom, bool reply); - - struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum, - int gso_type_mask); ---- a/net/ipv4/ip_tunnel_core.c -+++ b/net/ipv4/ip_tunnel_core.c -@@ -204,6 +204,252 @@ error: - } - EXPORT_SYMBOL_GPL(iptunnel_handle_offloads); - -+/** -+ * iptunnel_pmtud_build_icmp() - Build ICMP error message for PMTUD -+ * @skb: Original packet with L2 header -+ * @mtu: MTU value for ICMP error -+ * -+ * Return: length on success, negative error code if message couldn't be built. -+ */ -+static int iptunnel_pmtud_build_icmp(struct sk_buff *skb, int mtu) -+{ -+ const struct iphdr *iph = ip_hdr(skb); -+ struct icmphdr *icmph; -+ struct iphdr *niph; -+ struct ethhdr eh; -+ int len, err; -+ -+ if (!pskb_may_pull(skb, ETH_HLEN + sizeof(struct iphdr))) -+ return -EINVAL; -+ -+ skb_copy_bits(skb, skb_mac_header(skb) - skb->data, &eh, ETH_HLEN); -+ pskb_pull(skb, ETH_HLEN); -+ skb_reset_network_header(skb); -+ -+ err = pskb_trim(skb, 576 - sizeof(*niph) - sizeof(*icmph)); -+ if (err) -+ return err; -+ -+ len = skb->len + sizeof(*icmph); -+ err = skb_cow(skb, sizeof(*niph) + sizeof(*icmph) + ETH_HLEN); -+ if (err) -+ return err; -+ -+ icmph = (struct icmphdr *)skb_push(skb, sizeof(*icmph)); -+ *icmph = (struct icmphdr) { -+ .type = ICMP_DEST_UNREACH, -+ .code = ICMP_FRAG_NEEDED, -+ .checksum = 0, -+ .un.frag.__unused = 0, -+ .un.frag.mtu = ntohs(mtu), -+ }; -+ icmph->checksum = ip_compute_csum(icmph, len); -+ skb_reset_transport_header(skb); -+ -+ niph = (struct iphdr *)skb_push(skb, sizeof(*niph)); -+ *niph = (struct iphdr) { -+ .ihl = sizeof(*niph) / 4u, -+ .version = 4, -+ .tos = 0, -+ .tot_len = htons(len + sizeof(*niph)), -+ .id = 0, -+ .frag_off = htons(IP_DF), -+ .ttl = iph->ttl, -+ .protocol = IPPROTO_ICMP, -+ .saddr = iph->daddr, -+ .daddr = iph->saddr, -+ }; -+ ip_send_check(niph); -+ skb_reset_network_header(skb); -+ -+ skb->ip_summed = CHECKSUM_NONE; -+ -+ eth_header(skb, skb->dev, htons(eh.h_proto), eh.h_source, eh.h_dest, 0); -+ skb_reset_mac_header(skb); -+ -+ return skb->len; -+} -+ -+/** -+ * iptunnel_pmtud_check_icmp() - Trigger ICMP reply if needed and allowed -+ * @skb: Buffer being sent by encapsulation, L2 headers expected -+ * @mtu: Network MTU for path -+ * -+ * Return: 0 for no ICMP reply, length if built, negative value on error. -+ */ -+static int iptunnel_pmtud_check_icmp(struct sk_buff *skb, int mtu) -+{ -+ const struct icmphdr *icmph = icmp_hdr(skb); -+ const struct iphdr *iph = ip_hdr(skb); -+ -+ if (mtu <= 576 || iph->frag_off != htons(IP_DF)) -+ return 0; -+ -+ if (ipv4_is_lbcast(iph->daddr) || ipv4_is_multicast(iph->daddr) || -+ ipv4_is_zeronet(iph->saddr) || ipv4_is_loopback(iph->saddr) || -+ ipv4_is_lbcast(iph->saddr) || ipv4_is_multicast(iph->saddr)) -+ return 0; -+ -+ if (iph->protocol == IPPROTO_ICMP && icmp_is_err(icmph->type)) -+ return 0; -+ -+ return iptunnel_pmtud_build_icmp(skb, mtu); -+} -+ -+#if IS_ENABLED(CONFIG_IPV6) -+/** -+ * iptunnel_pmtud_build_icmpv6() - Build ICMPv6 error message for PMTUD -+ * @skb: Original packet with L2 header -+ * @mtu: MTU value for ICMPv6 error -+ * -+ * Return: length on success, negative error code if message couldn't be built. -+ */ -+static int iptunnel_pmtud_build_icmpv6(struct sk_buff *skb, int mtu) -+{ -+ const struct ipv6hdr *ip6h = ipv6_hdr(skb); -+ struct icmp6hdr *icmp6h; -+ struct ipv6hdr *nip6h; -+ struct ethhdr eh; -+ int len, err; -+ __wsum csum; -+ -+ if (!pskb_may_pull(skb, ETH_HLEN + sizeof(struct ipv6hdr))) -+ return -EINVAL; -+ -+ skb_copy_bits(skb, skb_mac_header(skb) - skb->data, &eh, ETH_HLEN); -+ pskb_pull(skb, ETH_HLEN); -+ skb_reset_network_header(skb); -+ -+ err = pskb_trim(skb, IPV6_MIN_MTU - sizeof(*nip6h) - sizeof(*icmp6h)); -+ if (err) -+ return err; -+ -+ len = skb->len + sizeof(*icmp6h); -+ err = skb_cow(skb, sizeof(*nip6h) + sizeof(*icmp6h) + ETH_HLEN); -+ if (err) -+ return err; -+ -+ icmp6h = (struct icmp6hdr *)skb_push(skb, sizeof(*icmp6h)); -+ *icmp6h = (struct icmp6hdr) { -+ .icmp6_type = ICMPV6_PKT_TOOBIG, -+ .icmp6_code = 0, -+ .icmp6_cksum = 0, -+ .icmp6_mtu = htonl(mtu), -+ }; -+ skb_reset_transport_header(skb); -+ -+ nip6h = (struct ipv6hdr *)skb_push(skb, sizeof(*nip6h)); -+ *nip6h = (struct ipv6hdr) { -+ .priority = 0, -+ .version = 6, -+ .flow_lbl = { 0 }, -+ .payload_len = htons(len), -+ .nexthdr = IPPROTO_ICMPV6, -+ .hop_limit = ip6h->hop_limit, -+ .saddr = ip6h->daddr, -+ .daddr = ip6h->saddr, -+ }; -+ skb_reset_network_header(skb); -+ -+ csum = csum_partial(icmp6h, len, 0); -+ icmp6h->icmp6_cksum = csum_ipv6_magic(&nip6h->saddr, &nip6h->daddr, len, -+ IPPROTO_ICMPV6, csum); -+ -+ skb->ip_summed = CHECKSUM_NONE; -+ -+ eth_header(skb, skb->dev, htons(eh.h_proto), eh.h_source, eh.h_dest, 0); -+ skb_reset_mac_header(skb); -+ -+ return skb->len; -+} -+ -+/** -+ * iptunnel_pmtud_check_icmpv6() - Trigger ICMPv6 reply if needed and allowed -+ * @skb: Buffer being sent by encapsulation, L2 headers expected -+ * @mtu: Network MTU for path -+ * -+ * Return: 0 for no ICMPv6 reply, length if built, negative value on error. -+ */ -+static int iptunnel_pmtud_check_icmpv6(struct sk_buff *skb, int mtu) -+{ -+ const struct ipv6hdr *ip6h = ipv6_hdr(skb); -+ int stype = ipv6_addr_type(&ip6h->saddr); -+ u8 proto = ip6h->nexthdr; -+ __be16 frag_off; -+ int offset; -+ -+ if (mtu <= IPV6_MIN_MTU) -+ return 0; -+ -+ if (stype == IPV6_ADDR_ANY || stype == IPV6_ADDR_MULTICAST || -+ stype == IPV6_ADDR_LOOPBACK) -+ return 0; -+ -+ offset = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &proto, -+ &frag_off); -+ if (offset < 0 || (frag_off & htons(~0x7))) -+ return 0; -+ -+ if (proto == IPPROTO_ICMPV6) { -+ struct icmp6hdr *icmp6h; -+ -+ if (!pskb_may_pull(skb, skb_network_header(skb) + -+ offset + 1 - skb->data)) -+ return 0; -+ -+ icmp6h = (struct icmp6hdr *)(skb_network_header(skb) + offset); -+ if (icmpv6_is_err(icmp6h->icmp6_type) || -+ icmp6h->icmp6_type == NDISC_REDIRECT) -+ return 0; -+ } -+ -+ return iptunnel_pmtud_build_icmpv6(skb, mtu); -+} -+#endif /* IS_ENABLED(CONFIG_IPV6) */ -+ -+/** -+ * skb_tunnel_check_pmtu() - Check, update PMTU and trigger ICMP reply as needed -+ * @skb: Buffer being sent by encapsulation, L2 headers expected -+ * @encap_dst: Destination for tunnel encapsulation (outer IP) -+ * @headroom: Encapsulation header size, bytes -+ * @reply: Build matching ICMP or ICMPv6 message as a result -+ * -+ * L2 tunnel implementations that can carry IP and can be directly bridged -+ * (currently UDP tunnels) can't always rely on IP forwarding paths to handle -+ * PMTU discovery. In the bridged case, ICMP or ICMPv6 messages need to be built -+ * based on payload and sent back by the encapsulation itself. -+ * -+ * For routable interfaces, we just need to update the PMTU for the destination. -+ * -+ * Return: 0 if ICMP error not needed, length if built, negative value on error -+ */ -+int skb_tunnel_check_pmtu(struct sk_buff *skb, struct dst_entry *encap_dst, -+ int headroom, bool reply) -+{ -+ struct dst_entry *dst = skb_dst(skb); -+ u32 mtu = dst_mtu(encap_dst) - headroom; -+ -+ if ((skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu) || -+ (!skb_is_gso(skb) && (skb->len - skb_mac_header_len(skb)) <= mtu)) -+ return 0; -+ -+ if (dst && dst->ops->update_pmtu) -+ dst->ops->update_pmtu(dst, NULL, skb, mtu); -+ -+ if (!reply || skb->pkt_type == PACKET_HOST) -+ return 0; -+ -+ if (skb->protocol == htons(ETH_P_IP)) -+ return iptunnel_pmtud_check_icmp(skb, mtu); -+ -+#if IS_ENABLED(CONFIG_IPV6) -+ if (skb->protocol == htons(ETH_P_IPV6)) -+ return iptunnel_pmtud_check_icmpv6(skb, mtu); -+#endif -+ return 0; -+} -+EXPORT_SYMBOL(skb_tunnel_check_pmtu); -+ - /* Often modified stats are per cpu, other are shared (netdev->stats) */ - struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *tot) ---- a/drivers/net/vxlan.c -+++ b/drivers/net/vxlan.c -@@ -2076,6 +2076,8 @@ static void vxlan_xmit_one(struct sk_buf - /* Reset the skb_iif to Tunnels interface index */ - skb->skb_iif = dev->ifindex; - -+ skb_tunnel_check_pmtu(skb, &rt->dst, VXLAN_HEADROOM, false); -+ - tos = ip_tunnel_ecn_encap(tos, old_iph, skb); - ttl = ttl ? : ip4_dst_hoplimit(&rt->dst); - err = vxlan_xmit_skb(rt, sk, skb, fl4.saddr, -@@ -2141,6 +2143,8 @@ static void vxlan_xmit_one(struct sk_buf - flags |= VXLAN_F_UDP_ZERO_CSUM6_TX; - } - -+ skb_tunnel_check_pmtu(skb, ndst, VXLAN6_HEADROOM, false); -+ - ttl = ttl ? : ip6_dst_hoplimit(ndst); - err = vxlan6_xmit_skb(ndst, sk, skb, dev, &saddr, &dst->sin6.sin6_addr, - 0, ttl, src_port, dst_port, htonl(vni << 8), md, diff --git a/feeds/ipq807x/ipq807x/patches/233-vxlan-simplify-RTF_LOCAL-handling.patch b/feeds/ipq807x/ipq807x/patches/233-vxlan-simplify-RTF_LOCAL-handling.patch deleted file mode 100644 index 7aecd7f3a..000000000 --- a/feeds/ipq807x/ipq807x/patches/233-vxlan-simplify-RTF_LOCAL-handling.patch +++ /dev/null @@ -1,114 +0,0 @@ -From: pravin shelar -Date: Sun, 13 Nov 2016 20:43:56 -0800 -Subject: [PATCH] vxlan: simplify RTF_LOCAL handling. - -Avoid code duplicate code for handling RTF_LOCAL routes. - -Signed-off-by: Pravin B Shelar -Acked-by: Jiri Benc -Signed-off-by: David S. Miller ---- - ---- a/drivers/net/vxlan.c -+++ b/drivers/net/vxlan.c -@@ -1946,6 +1946,40 @@ static void vxlan_encap_bypass(struct sk - } - } - -+static int encap_bypass_if_local(struct sk_buff *skb, struct net_device *dev, -+ struct vxlan_dev *vxlan, union vxlan_addr *daddr, -+ __be32 dst_port, __be32 vni, struct dst_entry *dst, -+ u32 rt_flags) -+{ -+#if IS_ENABLED(CONFIG_IPV6) -+ /* IPv6 rt-flags are checked against RTF_LOCAL, but the value of -+ * RTF_LOCAL is equal to RTCF_LOCAL. So to keep code simple -+ * we can use RTCF_LOCAL which works for ipv4 and ipv6 route entry. -+ */ -+ BUILD_BUG_ON(RTCF_LOCAL != RTF_LOCAL); -+#endif -+ /* Bypass encapsulation if the destination is local */ -+ if (rt_flags & RTCF_LOCAL && -+ !(rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))) { -+ struct vxlan_dev *dst_vxlan; -+ -+ dst_release(dst); -+ dst_vxlan = vxlan_find_vni(vxlan->net, vni, -+ daddr->sa.sa_family, dst_port, -+ vxlan->flags); -+ if (!dst_vxlan) { -+ dev->stats.tx_errors++; -+ kfree_skb(skb); -+ -+ return -ENOENT; -+ } -+ vxlan_encap_bypass(skb, vxlan, dst_vxlan); -+ return 1; -+ } -+ -+ return 0; -+} -+ - static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, - struct vxlan_rdst *rdst, bool did_rsc) - { -@@ -2059,18 +2093,12 @@ static void vxlan_xmit_one(struct sk_buf - } - - /* Bypass encapsulation if the destination is local */ -- if (rt->rt_flags & RTCF_LOCAL && -- !(rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))) { -- struct vxlan_dev *dst_vxlan; -- -- ip_rt_put(rt); -- dst_vxlan = vxlan_find_vni(vxlan->net, vni, -- dst->sa.sa_family, dst_port, -- vxlan->flags); -- if (!dst_vxlan) -- goto tx_error; -- vxlan_encap_bypass(skb, vxlan, dst_vxlan); -- return; -+ if (!info) { -+ err = encap_bypass_if_local(skb, dev, vxlan, dst, -+ dst_port, vni, &rt->dst, -+ rt->rt_flags); -+ if (err) -+ return; - } - - /* Reset the skb_iif to Tunnels interface index */ -@@ -2096,7 +2124,6 @@ static void vxlan_xmit_one(struct sk_buf - } else { - struct dst_entry *ndst; - struct in6_addr saddr; -- u32 rt6i_flags; - - if (!vxlan->vn6_sock) - goto drop; -@@ -2121,19 +2148,14 @@ static void vxlan_xmit_one(struct sk_buf - } - - /* Bypass encapsulation if the destination is local */ -- rt6i_flags = ((struct rt6_info *)ndst)->rt6i_flags; -- if (rt6i_flags & RTF_LOCAL && -- !(rt6i_flags & (RTCF_BROADCAST | RTCF_MULTICAST))) { -- struct vxlan_dev *dst_vxlan; -+ if (!info) { -+ u32 rt6i_flags = ((struct rt6_info *)ndst)->rt6i_flags; - -- dst_release(ndst); -- dst_vxlan = vxlan_find_vni(vxlan->net, vni, -- dst->sa.sa_family, dst_port, -- vxlan->flags); -- if (!dst_vxlan) -- goto tx_error; -- vxlan_encap_bypass(skb, vxlan, dst_vxlan); -- return; -+ err = encap_bypass_if_local(skb, dev, vxlan, dst, -+ dst_port, vni, ndst, -+ rt6i_flags); -+ if (err) -+ return; - } - - if (info) { diff --git a/feeds/ipq807x/ipq807x/patches/234-vxlan-Support-for-PMTU-discovery-on-directly-bridged.patch b/feeds/ipq807x/ipq807x/patches/234-vxlan-Support-for-PMTU-discovery-on-directly-bridged.patch deleted file mode 100644 index 0a07832e5..000000000 --- a/feeds/ipq807x/ipq807x/patches/234-vxlan-Support-for-PMTU-discovery-on-directly-bridged.patch +++ /dev/null @@ -1,140 +0,0 @@ -From: Stefano Brivio -Date: Tue, 4 Aug 2020 07:53:44 +0200 -Subject: [PATCH] vxlan: Support for PMTU discovery on directly bridged links - -If the interface is a bridge or Open vSwitch port, and we can't -forward a packet because it exceeds the local PMTU estimate, -trigger an ICMP or ICMPv6 reply to the sender, using the same -interface to forward it back. - -If metadata collection is enabled, reverse destination and source -addresses, so that Open vSwitch is able to match this packet against -the existing, reverse flow. - -v2: Use netif_is_any_bridge_port() (David Ahern) - -Signed-off-by: Stefano Brivio -Signed-off-by: David S. Miller ---- - ---- a/drivers/net/vxlan.c -+++ b/drivers/net/vxlan.c -@@ -1903,7 +1903,7 @@ static struct dst_entry *vxlan6_get_rout - - /* Bypass encapsulation if the destination is local */ - static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan, -- struct vxlan_dev *dst_vxlan) -+ struct vxlan_dev *dst_vxlan, bool snoop) - { - struct pcpu_sw_netstats *tx_stats, *rx_stats; - union vxlan_addr loopback; -@@ -1928,7 +1928,7 @@ static void vxlan_encap_bypass(struct sk - #endif - } - -- if (dst_vxlan->flags & VXLAN_F_LEARN) -+ if ((dst_vxlan->flags & VXLAN_F_LEARN) && snoop) - vxlan_snoop(skb->dev, &loopback, eth_hdr(skb)->h_source); - - u64_stats_update_begin(&tx_stats->syncp); -@@ -1973,7 +1973,7 @@ static int encap_bypass_if_local(struct - - return -ENOENT; - } -- vxlan_encap_bypass(skb, vxlan, dst_vxlan); -+ vxlan_encap_bypass(skb, vxlan, dst_vxlan, true); - return 1; - } - -@@ -1990,7 +1990,7 @@ static void vxlan_xmit_one(struct sk_buf - const struct iphdr *old_iph; - struct flowi4 fl4; - union vxlan_addr *dst; -- union vxlan_addr remote_ip; -+ union vxlan_addr remote_ip, local_ip; - struct vxlan_metadata _md; - struct vxlan_metadata *md = &_md; - __be16 src_port = 0, dst_port; -@@ -2006,6 +2006,7 @@ static void vxlan_xmit_one(struct sk_buf - dst_port = rdst->remote_port ? rdst->remote_port : vxlan->cfg.dst_port; - vni = rdst->remote_vni; - dst = &rdst->remote_ip; -+ local_ip = vxlan->cfg.saddr; - } else { - if (!info) { - WARN_ONCE(1, "%s: Missing encapsulation instructions\n", -@@ -2015,17 +2016,20 @@ static void vxlan_xmit_one(struct sk_buf - dst_port = info->key.tp_dst ? : vxlan->cfg.dst_port; - vni = be64_to_cpu(info->key.tun_id); - remote_ip.sa.sa_family = ip_tunnel_info_af(info); -- if (remote_ip.sa.sa_family == AF_INET) -+ if (remote_ip.sa.sa_family == AF_INET) { - remote_ip.sin.sin_addr.s_addr = info->key.u.ipv4.dst; -- else -+ local_ip.sin.sin_addr.s_addr = info->key.u.ipv4.src; -+ } else { - remote_ip.sin6.sin6_addr = info->key.u.ipv6.dst; -+ local_ip.sin6.sin6_addr = info->key.u.ipv6.src; -+ } - dst = &remote_ip; - } - - if (vxlan_addr_any(dst)) { - if (did_rsc) { - /* short-circuited back to local bridge */ -- vxlan_encap_bypass(skb, vxlan, vxlan); -+ vxlan_encap_bypass(skb, vxlan, vxlan, true); - return; - } - goto drop; -@@ -2104,7 +2108,23 @@ static void vxlan_xmit_one(struct sk_buf - /* Reset the skb_iif to Tunnels interface index */ - skb->skb_iif = dev->ifindex; - -- skb_tunnel_check_pmtu(skb, &rt->dst, VXLAN_HEADROOM, false); -+ err = skb_tunnel_check_pmtu(skb, &rt->dst, VXLAN_HEADROOM, -+ netif_is_any_bridge_port(dev)); -+ if (err < 0) { -+ goto tx_error; -+ } else if (err) { -+ if (info) { -+ struct in_addr src, dst; -+ -+ src = remote_ip.sin.sin_addr; -+ dst = local_ip.sin.sin_addr; -+ info->key.u.ipv4.src = src.s_addr; -+ info->key.u.ipv4.dst = dst.s_addr; -+ } -+ vxlan_encap_bypass(skb, vxlan, vxlan, false); -+ ip_rt_put(rt); -+ return; -+ } - - tos = ip_tunnel_ecn_encap(tos, old_iph, skb); - ttl = ttl ? : ip4_dst_hoplimit(&rt->dst); -@@ -2165,7 +2185,24 @@ static void vxlan_xmit_one(struct sk_buf - flags |= VXLAN_F_UDP_ZERO_CSUM6_TX; - } - -- skb_tunnel_check_pmtu(skb, ndst, VXLAN6_HEADROOM, false); -+ err = skb_tunnel_check_pmtu(skb, ndst, VXLAN6_HEADROOM, -+ netif_is_any_bridge_port(dev)); -+ if (err < 0) { -+ goto tx_error; -+ } else if (err) { -+ if (info) { -+ struct in6_addr src, dst; -+ -+ src = remote_ip.sin6.sin6_addr; -+ dst = local_ip.sin6.sin6_addr; -+ info->key.u.ipv6.src = src; -+ info->key.u.ipv6.dst = dst; -+ } -+ -+ vxlan_encap_bypass(skb, vxlan, vxlan, false); -+ ip_rt_put(rt); -+ return; -+ } - - ttl = ttl ? : ip6_dst_hoplimit(ndst); - err = vxlan6_xmit_skb(ndst, sk, skb, dev, &saddr, &dst->sin6.sin6_addr, diff --git a/feeds/ipq807x/ipq807x/patches/235-generic-Fix-per-interface-nf_call_iptables-setting.patch b/feeds/ipq807x/ipq807x/patches/235-generic-Fix-per-interface-nf_call_iptables-setting.patch deleted file mode 100644 index dbec5d6d1..000000000 --- a/feeds/ipq807x/ipq807x/patches/235-generic-Fix-per-interface-nf_call_iptables-setting.patch +++ /dev/null @@ -1,234 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 2 Sep 2015 19:47:43 +0200 -Subject: generic: Fix per interface nf_call_iptables setting - -commit r30917 ("kernel: bypass all netfilter hooks if the sysctls for that -functionality have been disabled - eliminates the overhead of enabling -CONFIG_BRIDGE_NETFILTER in the kernel config") introduced an optimization -which should reduce/eliminate the overhead for traffic send over bridges on -kernels compiled with CONFIG_BRIDGE_NETFILTER=y. But this optimization -breaks the nf_call_iptables per bridge setting which is more fine grained -than the global sysctl net.bridge.bridge-nf-call-iptables setting. - -A test reflecting a real world setup was created to identify if this really -eliminates the overhead and if per-bridge nf_call_iptables could be used in -some setups to increase the throughput. A Qualcomm Atheros QCA9558 based -system with one ethernet and an ath9k wifi 3x3 in HT40 mode was used. -Cables from the AP to the wifi station were used to reduce interference -problems during the tests. - -The wlan interface was put in one bridge interface called br-wlan. This -bridge usually contains some more wlan interfaces. The eth0 was put in a -second bridge called br-lan. This usually contains some other privileged -wlan or mesh interfaces. Routing was added between br-lan and br-wlan. - -Three kernels were tested: - - * (default) OpenWrt kernel for this device - * (brfilter-global) OpenWrt kernel with CONFIG_BRIDGE_NETFILTER=y - * (brfilter-local) OpenWrt kernel with CONFIG_BRIDGE_NETFILTER=y and - without 644-bridge_optimize_netfilter_hooks.patch - -The changes to the the netfilter settings of the bridge were done via: - - * (brfilter-global) /sbin/sysctl -w net.bridge.bridge-nf-call-iptables=1 - * (brfilter-lobal) echo 1 > /sys/class/net/br-lan/bridge/nf_call_iptables - and/or echo 1 > /sys/class/net/br-wan/bridge/nf_call_iptables - -A station connected to the wlan0 (AP) interface was used to send traffic to -a PC connected via ethernet. iperf with 3 concurrent transmissions was used -to generate the traffic. - -| kernel | br-nf-* global | nf-call* iface | download | upload | -|-----------------|----------------|----------------|----------|----------| -| default | 0 | - | 209 | 268 | -| brfilter-global | 0 | - | 185 | 243 | -| brfilter-local | 0 | - | 187 | 243 | -| brfilter-local | 0 | br-lan | 157 | 226 | -| brfilter-local | 0 | br-lan br-wlan | 139 | 161 | -| brfilter-global | 1 | - | 136 | 162 | - -Download/upload results in Mibit/s - -It can be seen that the patch doesn't eliminate the overhead. It can also -be seen that the throughput of brfilter-global and brfilter-local with -disabled filtering is the roughly the same. Also the throughput for -brfilter-global and brfilter-local for enabled filtering on all bridges is -roughly the same. - -But also the brfilter-local throughput is higher when only br-lan requires -the filtering. This setting would not be possible with -644-bridge_optimize_netfilter_hooks.patch applied and thus can only be -compared with brfilter-global and filtering enabled for all interfaces. - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/513592/ -Applied-Upstream: https://dev.openwrt.org/changeset/46835 - ---- a/net/bridge/br_forward.c -+++ b/net/bridge/br_forward.c -@@ -69,7 +69,7 @@ EXPORT_SYMBOL_GPL(br_dev_queue_push_xmit - - int br_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb) - { -- return BR_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, -+ return NF_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, - net, sk, skb, NULL, skb->dev, - br_dev_queue_push_xmit); - -@@ -97,7 +97,7 @@ static void __br_deliver(const struct ne - return; - } - -- BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, -+ NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, - dev_net(skb->dev), NULL, skb,NULL, skb->dev, - br_forward_finish); - } -@@ -121,7 +121,7 @@ static void __br_forward(const struct ne - skb->dev = to->dev; - skb_forward_csum(skb); - -- BR_HOOK(NFPROTO_BRIDGE, NF_BR_FORWARD, -+ NF_HOOK(NFPROTO_BRIDGE, NF_BR_FORWARD, - dev_net(indev), NULL, skb, indev, skb->dev, - br_forward_finish); - } ---- a/net/bridge/br_input.c -+++ b/net/bridge/br_input.c -@@ -70,7 +70,7 @@ int br_pass_frame_up(struct sk_buff *skb - if (!skb) - return NET_RX_DROP; - -- return BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, -+ return NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, - dev_net(indev), NULL, skb, indev, NULL, - br_netif_receive_skb); - } -@@ -320,7 +320,7 @@ rx_handler_result_t br_handle_frame(stru - } - - /* Deliver packet to local host only */ -- if (BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, -+ if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, - dev_net(skb->dev), NULL, skb, skb->dev, NULL, - br_handle_local_finish)) { - return RX_HANDLER_CONSUMED; /* consumed by filter */ -@@ -337,7 +337,7 @@ forward: - if (ether_addr_equal(p->br->dev->dev_addr, dest)) - skb->pkt_type = PACKET_HOST; - -- if (BR_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, dev_net(skb->dev), NULL, -+ if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, dev_net(skb->dev), NULL, - skb, skb->dev, NULL, br_handle_local_finish)) - break; - -@@ -361,7 +361,7 @@ forward: - if (ether_addr_equal(p->br->dev->dev_addr, dest)) - skb->pkt_type = PACKET_HOST; - -- BR_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, -+ NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, - dev_net(skb->dev), NULL, skb, skb->dev, NULL, - br_handle_frame_finish); - break; ---- a/net/bridge/br_multicast.c -+++ b/net/bridge/br_multicast.c -@@ -856,7 +856,7 @@ static void __br_multicast_send_query(st - - if (port) { - skb->dev = port->dev; -- BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, -+ NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, - dev_net(port->dev), NULL, skb, NULL, skb->dev, - br_dev_queue_push_xmit); - } else { ---- a/net/bridge/br_netfilter_hooks.c -+++ b/net/bridge/br_netfilter_hooks.c -@@ -72,15 +72,6 @@ static int brnf_pass_vlan_indev __read_m - #define IS_ARP(skb) \ - (!skb_vlan_tag_present(skb) && skb->protocol == htons(ETH_P_ARP)) - --int brnf_call_ebtables __read_mostly; --EXPORT_SYMBOL_GPL(brnf_call_ebtables); -- --bool br_netfilter_run_hooks(void) --{ -- return brnf_call_iptables | brnf_call_ip6tables | brnf_call_arptables | -- brnf_call_ebtables | brnf_call_custom; --} -- - static inline __be16 vlan_proto(const struct sk_buff *skb) - { - if (skb_vlan_tag_present(skb)) ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -909,29 +909,15 @@ extern const struct nf_br_ops __rcu *nf_ - - /* br_netfilter.c */ - #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) --extern int brnf_call_ebtables; - int br_nf_core_init(void); - void br_nf_core_fini(void); - void br_netfilter_rtable_init(struct net_bridge *); --bool br_netfilter_run_hooks(void); - #else - static inline int br_nf_core_init(void) { return 0; } - static inline void br_nf_core_fini(void) {} - #define br_netfilter_rtable_init(x) --#define br_netfilter_run_hooks() false - #endif - --static inline int --BR_HOOK(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, -- struct sk_buff *skb, struct net_device *in, struct net_device *out, -- int (*okfn)(struct net *, struct sock *, struct sk_buff *)) --{ -- if (!br_netfilter_run_hooks()) -- return okfn(net, sk, skb); -- -- return NF_HOOK(pf, hook, net, sk, skb, in, out, okfn); --} -- - /* br_stp.c */ - void br_log_state(const struct net_bridge_port *p); - void br_set_state(struct net_bridge_port *p, unsigned int state); ---- a/net/bridge/br_stp_bpdu.c -+++ b/net/bridge/br_stp_bpdu.c -@@ -60,7 +60,7 @@ static void br_send_bpdu(struct net_brid - - skb_reset_mac_header(skb); - -- BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, -+ NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, - dev_net(p->dev), NULL, skb, NULL, skb->dev, - br_send_bpdu_finish); - } ---- a/net/bridge/netfilter/ebtables.c -+++ b/net/bridge/netfilter/ebtables.c -@@ -2416,13 +2416,11 @@ static int __init ebtables_init(void) - } - - printk(KERN_INFO "Ebtables v2.0 registered\n"); -- brnf_call_ebtables = 1; - return 0; - } - - static void __exit ebtables_fini(void) - { -- brnf_call_ebtables = 0; - nf_unregister_sockopt(&ebt_sockopts); - xt_unregister_target(&ebt_standard_target); - printk(KERN_INFO "Ebtables v2.0 unregistered\n"); ---- a/net/ipv4/netfilter/nf_nat_l3proto_ipv4.c -+++ b/net/ipv4/netfilter/nf_nat_l3proto_ipv4.c -@@ -310,7 +310,7 @@ nf_nat_ipv4_fn(void *priv, struct sk_buf - * nf_bridge will be set and nf_bridge->physoutdev is not null, - * We can assume that it is not expecting NAT operation. - * -- * when BR_HOOK is enabled, multicast packets will reach -+ * when NF_HOOK is enabled, multicast packets will reach - * postrouting twice,the first time is when it is forwarded - * between ports of a bridge, the second time is that it is - * forwarded to upstream port. diff --git a/feeds/ipq807x/ipq807x/patches/236-net-act_pedit-Support-using-offset-relative-to-the-c.patch b/feeds/ipq807x/ipq807x/patches/236-net-act_pedit-Support-using-offset-relative-to-the-c.patch deleted file mode 100644 index 9d47f8fd2..000000000 --- a/feeds/ipq807x/ipq807x/patches/236-net-act_pedit-Support-using-offset-relative-to-the-c.patch +++ /dev/null @@ -1,421 +0,0 @@ -From: Amir Vadai -Date: Tue, 7 Feb 2017 09:56:07 +0200 -Subject: [PATCH] net/act_pedit: Support using offset relative to the - conventional network headers - -Extend pedit to enable the user setting offset relative to network -headers. This change would enable to work with more complex header -schemes (vs the simple IPv4 case) where setting a fixed offset relative -to the network header is not enough. - -After this patch, the action has information about the exact header type -and field inside this header. This information could be used later on -for hardware offloading of pedit. - -Backward compatibility was being kept: -1. Old kernel <-> new userspace -2. New kernel <-> old userspace -3. add rule using new userspace <-> dump using old userspace -4. add rule using old userspace <-> dump using new userspace - -When using the extended api, new netlink attributes are being used. This -way, operation will fail in (1) and (3) - and no malformed rule be added -or dumped. Of course, new user space that doesn't need the new -functionality can use the old netlink attributes and operation will -succeed. -Since action can support both api's, (2) should work, and it is easy to -write the new user space to have (4) work. - -The action is having a strict check that only header types and commands -it can handle are accepted. This way future additions will be much -easier. - -Usage example: -$ tc filter add dev enp0s9 protocol ip parent ffff: \ - flower \ - ip_proto tcp \ - dst_port 80 \ - action pedit munge tcp dport set 8080 pipe \ - action mirred egress redirect dev veth0 - -Will forward tcp port whose original dest port is 80, while modifying -the destination port to 8080. - -Signed-off-by: Amir Vadai -Reviewed-by: Or Gerlitz -Signed-off-by: David S. Miller ---- - ---- a/net/sched/act_pedit.c -+++ b/net/sched/act_pedit.c -@@ -22,22 +22,117 @@ - #include - #include - #include -+#include - - #define PEDIT_TAB_MASK 15 - - static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = { - [TCA_PEDIT_PARMS] = { .len = sizeof(struct tc_pedit) }, -+ [TCA_PEDIT_KEYS_EX] = { .type = NLA_NESTED }, - }; - -+static const struct nla_policy pedit_key_ex_policy[TCA_PEDIT_KEY_EX_MAX + 1] = { -+ [TCA_PEDIT_KEY_EX_HTYPE] = { .type = NLA_U16 }, -+}; -+ -+static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla, -+ u8 n) -+{ -+ struct tcf_pedit_key_ex *keys_ex; -+ struct tcf_pedit_key_ex *k; -+ const struct nlattr *ka; -+ int err = -EINVAL; -+ int rem; -+ -+ if (!nla || !n) -+ return NULL; -+ -+ keys_ex = kcalloc(n, sizeof(*k), GFP_KERNEL); -+ if (!keys_ex) -+ return ERR_PTR(-ENOMEM); -+ -+ k = keys_ex; -+ -+ nla_for_each_nested(ka, nla, rem) { -+ struct nlattr *tb[TCA_PEDIT_KEY_EX_MAX + 1]; -+ -+ if (!n) { -+ err = -EINVAL; -+ goto err_out; -+ } -+ n--; -+ -+ if (nla_type(ka) != TCA_PEDIT_KEY_EX) { -+ err = -EINVAL; -+ goto err_out; -+ } -+ -+ err = nla_parse_nested(tb, TCA_PEDIT_KEY_EX_MAX, ka, -+ pedit_key_ex_policy); -+ if (err) -+ goto err_out; -+ -+ if (!tb[TCA_PEDIT_KEY_EX_HTYPE]) { -+ err = -EINVAL; -+ goto err_out; -+ } -+ -+ k->htype = nla_get_u16(tb[TCA_PEDIT_KEY_EX_HTYPE]); -+ -+ if (k->htype > TCA_PEDIT_HDR_TYPE_MAX) { -+ err = -EINVAL; -+ goto err_out; -+ } -+ -+ k++; -+ } -+ -+ if (n) -+ goto err_out; -+ -+ return keys_ex; -+ -+err_out: -+ kfree(keys_ex); -+ return ERR_PTR(err); -+} -+ -+static int tcf_pedit_key_ex_dump(struct sk_buff *skb, -+ struct tcf_pedit_key_ex *keys_ex, int n) -+{ -+ struct nlattr *keys_start = nla_nest_start(skb, TCA_PEDIT_KEYS_EX); -+ -+ for (; n > 0; n--) { -+ struct nlattr *key_start; -+ -+ key_start = nla_nest_start(skb, TCA_PEDIT_KEY_EX); -+ -+ if (nla_put_u16(skb, TCA_PEDIT_KEY_EX_HTYPE, keys_ex->htype)) { -+ nlmsg_trim(skb, keys_start); -+ return -EINVAL; -+ } -+ -+ nla_nest_end(skb, key_start); -+ -+ keys_ex++; -+ } -+ -+ nla_nest_end(skb, keys_start); -+ -+ return 0; -+} -+ - static int tcf_pedit_init(struct net *net, struct nlattr *nla, - struct nlattr *est, struct tc_action *a, - int ovr, int bind) - { - struct nlattr *tb[TCA_PEDIT_MAX + 1]; -+ struct nlattr *pattr; - struct tc_pedit *parm; - int ret = 0, err; - struct tcf_pedit *p; - struct tc_pedit_key *keys = NULL; -+ struct tcf_pedit_key_ex *keys_ex; - int ksize; - - if (nla == NULL) -@@ -47,13 +142,21 @@ static int tcf_pedit_init(struct net *ne - if (err < 0) - return err; - -- if (tb[TCA_PEDIT_PARMS] == NULL) -+ pattr = tb[TCA_PEDIT_PARMS]; -+ if (!pattr) -+ pattr = tb[TCA_PEDIT_PARMS_EX]; -+ if (!pattr) - return -EINVAL; -- parm = nla_data(tb[TCA_PEDIT_PARMS]); -+ -+ parm = nla_data(pattr); - ksize = parm->nkeys * sizeof(struct tc_pedit_key); -- if (nla_len(tb[TCA_PEDIT_PARMS]) < sizeof(*parm) + ksize) -+ if (nla_len(pattr) < sizeof(*parm) + ksize) - return -EINVAL; - -+ keys_ex = tcf_pedit_keys_ex_parse(tb[TCA_PEDIT_KEYS_EX], parm->nkeys); -+ if (IS_ERR(keys_ex)) -+ return PTR_ERR(keys_ex); -+ - if (!tcf_hash_check(parm->index, a, bind)) { - if (!parm->nkeys) - return -EINVAL; -@@ -65,6 +168,7 @@ static int tcf_pedit_init(struct net *ne - keys = kmalloc(ksize, GFP_KERNEL); - if (keys == NULL) { - tcf_hash_cleanup(a, est); -+ kfree(keys_ex); - return -ENOMEM; - } - ret = ACT_P_CREATED; -@@ -77,8 +181,10 @@ static int tcf_pedit_init(struct net *ne - p = to_pedit(a); - if (p->tcfp_nkeys && p->tcfp_nkeys != parm->nkeys) { - keys = kmalloc(ksize, GFP_KERNEL); -- if (keys == NULL) -+ if (!keys) { -+ kfree(keys_ex); - return -ENOMEM; -+ } - } - } - -@@ -91,6 +197,10 @@ static int tcf_pedit_init(struct net *ne - p->tcfp_nkeys = parm->nkeys; - } - memcpy(p->tcfp_keys, parm->keys, ksize); -+ -+ kfree(p->tcfp_keys_ex); -+ p->tcfp_keys_ex = keys_ex; -+ - spin_unlock_bh(&p->tcf_lock); - if (ret == ACT_P_CREATED) - tcf_hash_insert(a); -@@ -102,6 +212,7 @@ static void tcf_pedit_cleanup(struct tc_ - struct tcf_pedit *p = a->priv; - struct tc_pedit_key *keys = p->tcfp_keys; - kfree(keys); -+ kfree(p->tcfp_keys_ex); - } - - static bool offset_valid(struct sk_buff *skb, int offset) -@@ -115,38 +226,84 @@ static bool offset_valid(struct sk_buff - return true; - } - -+static int pedit_skb_hdr_offset(struct sk_buff *skb, -+ enum pedit_header_type htype, int *hoffset) -+{ -+ int ret = -EINVAL; -+ -+ switch (htype) { -+ case TCA_PEDIT_KEY_EX_HDR_TYPE_ETH: -+ if (skb_mac_header_was_set(skb)) { -+ *hoffset = skb_mac_header(skb) - skb->data; -+ ret = 0; -+ } -+ break; -+ case TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK: -+ case TCA_PEDIT_KEY_EX_HDR_TYPE_IP4: -+ case TCA_PEDIT_KEY_EX_HDR_TYPE_IP6: -+ *hoffset = skb_network_offset(skb); -+ ret = 0; -+ break; -+ case TCA_PEDIT_KEY_EX_HDR_TYPE_TCP: -+ case TCA_PEDIT_KEY_EX_HDR_TYPE_UDP: -+ if (skb_transport_header_was_set(skb)) { -+ *hoffset = skb_transport_offset(skb); -+ ret = 0; -+ } -+ break; -+ default: -+ ret = -EINVAL; -+ break; -+ }; -+ -+ return ret; -+} -+ - static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a, - struct tcf_result *res) - { - struct tcf_pedit *p = a->priv; - int i; -- unsigned int off; - - if (skb_unclone(skb, GFP_ATOMIC)) - return p->tcf_action; - -- off = skb_network_offset(skb); -- - spin_lock(&p->tcf_lock); - - p->tcf_tm.lastuse = jiffies; - - if (p->tcfp_nkeys > 0) { - struct tc_pedit_key *tkey = p->tcfp_keys; -+ struct tcf_pedit_key_ex *tkey_ex = p->tcfp_keys_ex; -+ enum pedit_header_type htype = TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK; - - for (i = p->tcfp_nkeys; i > 0; i--, tkey++) { - u32 *ptr, _data; - int offset = tkey->off; -+ int hoffset; -+ int rc; -+ -+ if (tkey_ex) { -+ htype = tkey_ex->htype; -+ tkey_ex++; -+ } -+ -+ rc = pedit_skb_hdr_offset(skb, htype, &hoffset); -+ if (rc) { -+ pr_info("tc filter pedit bad header type specified (0x%x)\n", -+ htype); -+ goto bad; -+ } - - if (tkey->offmask) { - char *d, _d; - -- if (!offset_valid(skb, off + tkey->at)) { -+ if (!offset_valid(skb, hoffset + tkey->at)) { - pr_info("tc filter pedit 'at' offset %d out of bounds\n", -- off + tkey->at); -+ hoffset + tkey->at); - goto bad; - } -- d = skb_header_pointer(skb, off + tkey->at, 1, -+ d = skb_header_pointer(skb, hoffset + tkey->at, 1, - &_d); - if (!d) - goto bad; -@@ -159,19 +316,19 @@ static int tcf_pedit(struct sk_buff *skb - goto bad; - } - -- if (!offset_valid(skb, off + offset)) { -+ if (!offset_valid(skb, hoffset + offset)) { - pr_info("tc filter pedit offset %d out of bounds\n", -- offset); -+ hoffset + offset); - goto bad; - } - -- ptr = skb_header_pointer(skb, off + offset, 4, &_data); -+ ptr = skb_header_pointer(skb, hoffset + offset, 4, &_data); - if (!ptr) - goto bad; - /* just do it, baby */ - *ptr = ((*ptr & tkey->mask) ^ tkey->val); - if (ptr == &_data) -- skb_store_bits(skb, off + offset, ptr, 4); -+ skb_store_bits(skb, hoffset + offset, ptr, 4); - } - - goto done; -@@ -211,8 +368,15 @@ static int tcf_pedit_dump(struct sk_buff - opt->refcnt = p->tcf_refcnt - ref; - opt->bindcnt = p->tcf_bindcnt - bind; - -- if (nla_put(skb, TCA_PEDIT_PARMS, s, opt)) -- goto nla_put_failure; -+ if (p->tcfp_keys_ex) { -+ tcf_pedit_key_ex_dump(skb, p->tcfp_keys_ex, p->tcfp_nkeys); -+ -+ if (nla_put(skb, TCA_PEDIT_PARMS_EX, s, opt)) -+ goto nla_put_failure; -+ } else { -+ if (nla_put(skb, TCA_PEDIT_PARMS, s, opt)) -+ goto nla_put_failure; -+ } - t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); - t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); - t.expires = jiffies_to_clock_t(p->tcf_tm.expires); ---- a/include/net/tc_act/tc_pedit.h -+++ b/include/net/tc_act/tc_pedit.h -@@ -3,11 +3,16 @@ - - #include - -+struct tcf_pedit_key_ex { -+ enum pedit_header_type htype; -+}; -+ - struct tcf_pedit { - struct tcf_common common; - unsigned char tcfp_nkeys; - unsigned char tcfp_flags; - struct tc_pedit_key *tcfp_keys; -+ struct tcf_pedit_key_ex *tcfp_keys_ex; - }; - #define to_pedit(a) \ - container_of(a->priv, struct tcf_pedit, common) ---- a/include/uapi/linux/tc_act/tc_pedit.h -+++ b/include/uapi/linux/tc_act/tc_pedit.h -@@ -10,10 +10,34 @@ enum { - TCA_PEDIT_UNSPEC, - TCA_PEDIT_TM, - TCA_PEDIT_PARMS, -+ TCA_PEDIT_PAD, -+ TCA_PEDIT_PARMS_EX, -+ TCA_PEDIT_KEYS_EX, -+ TCA_PEDIT_KEY_EX, - __TCA_PEDIT_MAX - }; - #define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) - -+enum { -+ TCA_PEDIT_KEY_EX_HTYPE = 1, -+ __TCA_PEDIT_KEY_EX_MAX -+}; -+#define TCA_PEDIT_KEY_EX_MAX (__TCA_PEDIT_KEY_EX_MAX - 1) -+ -+ /* TCA_PEDIT_KEY_EX_HDR_TYPE_NETWROK is a special case for legacy users. It -+ * means no specific header type - offset is relative to the network layer -+ */ -+enum pedit_header_type { -+ TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK = 0, -+ TCA_PEDIT_KEY_EX_HDR_TYPE_ETH = 1, -+ TCA_PEDIT_KEY_EX_HDR_TYPE_IP4 = 2, -+ TCA_PEDIT_KEY_EX_HDR_TYPE_IP6 = 3, -+ TCA_PEDIT_KEY_EX_HDR_TYPE_TCP = 4, -+ TCA_PEDIT_KEY_EX_HDR_TYPE_UDP = 5, -+ __PEDIT_HDR_TYPE_MAX, -+}; -+#define TCA_PEDIT_HDR_TYPE_MAX (__PEDIT_HDR_TYPE_MAX - 1) -+ - struct tc_pedit_key { - __u32 mask; /* AND */ - __u32 val; /*XOR */ diff --git a/feeds/ipq807x/ipq807x/patches/237-net-act_pedit-Introduce-add-operation.patch b/feeds/ipq807x/ipq807x/patches/237-net-act_pedit-Introduce-add-operation.patch deleted file mode 100644 index 86cbba6a2..000000000 --- a/feeds/ipq807x/ipq807x/patches/237-net-act_pedit-Introduce-add-operation.patch +++ /dev/null @@ -1,136 +0,0 @@ -From: Amir Vadai -Date: Tue, 7 Feb 2017 09:56:08 +0200 -Subject: [PATCH] net/act_pedit: Introduce 'add' operation - -This command could be useful to inc/dec fields. - -For example, to forward any TCP packet and decrease its TTL: -$ tc filter add dev enp0s9 protocol ip parent ffff: \ - flower ip_proto tcp \ - action pedit munge ip ttl add 0xff pipe \ - action mirred egress redirect dev veth0 - -In the example above, adding 0xff to this u8 field is actually -decreasing it by one, since the operation is masked. - -Signed-off-by: Amir Vadai -Reviewed-by: Or Gerlitz -Signed-off-by: David S. Miller ---- - ---- a/include/net/tc_act/tc_pedit.h -+++ b/include/net/tc_act/tc_pedit.h -@@ -5,6 +5,7 @@ - - struct tcf_pedit_key_ex { - enum pedit_header_type htype; -+ enum pedit_cmd cmd; - }; - - struct tcf_pedit { ---- a/include/uapi/linux/tc_act/tc_pedit.h -+++ b/include/uapi/linux/tc_act/tc_pedit.h -@@ -20,6 +20,7 @@ enum { - - enum { - TCA_PEDIT_KEY_EX_HTYPE = 1, -+ TCA_PEDIT_KEY_EX_CMD = 2, - __TCA_PEDIT_KEY_EX_MAX - }; - #define TCA_PEDIT_KEY_EX_MAX (__TCA_PEDIT_KEY_EX_MAX - 1) -@@ -38,6 +39,13 @@ enum pedit_header_type { - }; - #define TCA_PEDIT_HDR_TYPE_MAX (__PEDIT_HDR_TYPE_MAX - 1) - -+enum pedit_cmd { -+ TCA_PEDIT_KEY_EX_CMD_SET = 0, -+ TCA_PEDIT_KEY_EX_CMD_ADD = 1, -+ __PEDIT_CMD_MAX, -+}; -+#define TCA_PEDIT_CMD_MAX (__PEDIT_CMD_MAX - 1) -+ - struct tc_pedit_key { - __u32 mask; /* AND */ - __u32 val; /*XOR */ ---- a/net/sched/act_pedit.c -+++ b/net/sched/act_pedit.c -@@ -33,6 +33,7 @@ static const struct nla_policy pedit_pol - - static const struct nla_policy pedit_key_ex_policy[TCA_PEDIT_KEY_EX_MAX + 1] = { - [TCA_PEDIT_KEY_EX_HTYPE] = { .type = NLA_U16 }, -+ [TCA_PEDIT_KEY_EX_CMD] = { .type = NLA_U16 }, - }; - - static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla, -@@ -72,14 +73,17 @@ static struct tcf_pedit_key_ex *tcf_pedi - if (err) - goto err_out; - -- if (!tb[TCA_PEDIT_KEY_EX_HTYPE]) { -+ if (!tb[TCA_PEDIT_KEY_EX_HTYPE] || -+ !tb[TCA_PEDIT_KEY_EX_CMD]) { - err = -EINVAL; - goto err_out; - } - - k->htype = nla_get_u16(tb[TCA_PEDIT_KEY_EX_HTYPE]); -+ k->cmd = nla_get_u16(tb[TCA_PEDIT_KEY_EX_CMD]); - -- if (k->htype > TCA_PEDIT_HDR_TYPE_MAX) { -+ if (k->htype > TCA_PEDIT_HDR_TYPE_MAX || -+ k->cmd > TCA_PEDIT_CMD_MAX) { - err = -EINVAL; - goto err_out; - } -@@ -107,7 +111,8 @@ static int tcf_pedit_key_ex_dump(struct - - key_start = nla_nest_start(skb, TCA_PEDIT_KEY_EX); - -- if (nla_put_u16(skb, TCA_PEDIT_KEY_EX_HTYPE, keys_ex->htype)) { -+ if (nla_put_u16(skb, TCA_PEDIT_KEY_EX_HTYPE, keys_ex->htype) || -+ nla_put_u16(skb, TCA_PEDIT_KEY_EX_CMD, keys_ex->cmd)) { - nlmsg_trim(skb, keys_start); - return -EINVAL; - } -@@ -276,15 +281,19 @@ static int tcf_pedit(struct sk_buff *skb - struct tc_pedit_key *tkey = p->tcfp_keys; - struct tcf_pedit_key_ex *tkey_ex = p->tcfp_keys_ex; - enum pedit_header_type htype = TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK; -+ enum pedit_cmd cmd = TCA_PEDIT_KEY_EX_CMD_SET; - - for (i = p->tcfp_nkeys; i > 0; i--, tkey++) { - u32 *ptr, _data; - int offset = tkey->off; - int hoffset; -+ u32 val; - int rc; - - if (tkey_ex) { - htype = tkey_ex->htype; -+ cmd = tkey_ex->cmd; -+ - tkey_ex++; - } - -@@ -326,7 +335,20 @@ static int tcf_pedit(struct sk_buff *skb - if (!ptr) - goto bad; - /* just do it, baby */ -- *ptr = ((*ptr & tkey->mask) ^ tkey->val); -+ switch (cmd) { -+ case TCA_PEDIT_KEY_EX_CMD_SET: -+ val = tkey->val; -+ break; -+ case TCA_PEDIT_KEY_EX_CMD_ADD: -+ val = (*ptr + tkey->val) & ~tkey->mask; -+ break; -+ default: -+ pr_info("tc filter pedit bad command (%d)\n", -+ cmd); -+ goto bad; -+ } -+ -+ *ptr = ((*ptr & tkey->mask) ^ val); - if (ptr == &_data) - skb_store_bits(skb, hoffset + offset, ptr, 4); - } diff --git a/feeds/ipq807x/ipq807x/patches/238-net-core-Allow-live-renaming-when-an-interface-is-up.patch b/feeds/ipq807x/ipq807x/patches/238-net-core-Allow-live-renaming-when-an-interface-is-up.patch deleted file mode 100644 index 1a97d2759..000000000 --- a/feeds/ipq807x/ipq807x/patches/238-net-core-Allow-live-renaming-when-an-interface-is-up.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Andy Ren -Date: Mon, 7 Nov 2022 09:42:42 -0800 -Subject: [PATCH] net/core: Allow live renaming when an interface is up - -Allow a network interface to be renamed when the interface -is up. - -As described in the netconsole documentation [1], when netconsole is -used as a built-in, it will bring up the specified interface as soon as -possible. As a result, user space will not be able to rename the -interface since the kernel disallows renaming of interfaces that are -administratively up unless the 'IFF_LIVE_RENAME_OK' private flag was set -by the kernel. - -The original solution [2] to this problem was to add a new parameter to -the netconsole configuration parameters that allows renaming of -the interface used by netconsole while it is administratively up. -However, during the discussion that followed, it became apparent that we -have no reason to keep the current restriction and instead we should -allow user space to rename interfaces regardless of their administrative -state: - -1. The restriction was put in place over 20 years ago when renaming was -only possible via IOCTL and before rtnetlink started notifying user -space about such changes like it does today. - -2. The 'IFF_LIVE_RENAME_OK' flag was added over 3 years ago in version -5.2 and no regressions were reported. - -3. In-kernel listeners to 'NETDEV_CHANGENAME' do not seem to care about -the administrative state of interface. - -Therefore, allow user space to rename running interfaces by removing the -restriction and the associated 'IFF_LIVE_RENAME_OK' flag. Help in -possible triage by emitting a message to the kernel log that an -interface was renamed while UP. - -[1] https://www.kernel.org/doc/Documentation/networking/netconsole.rst -[2] https://lore.kernel.org/netdev/20221102002420.2613004-1-andy.ren@getcruise.com/ - -Signed-off-by: Andy Ren -Reviewed-by: Ido Schimmel -Reviewed-by: David Ahern -Signed-off-by: David S. Miller ---- - ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -1152,8 +1152,6 @@ int dev_change_name(struct net_device *d - BUG_ON(!dev_net(dev)); - - net = dev_net(dev); -- if (dev->flags & IFF_UP) -- return -EBUSY; - - write_seqcount_begin(&devnet_rename_seq); - -@@ -1171,7 +1169,8 @@ int dev_change_name(struct net_device *d - } - - if (oldname[0] && !strchr(oldname, '%')) -- netdev_info(dev, "renamed from %s\n", oldname); -+ netdev_info(dev, "renamed from %s%s\n", oldname, -+ dev->flags & IFF_UP ? " (while UP)" : ""); - - old_assign_type = dev->name_assign_type; - dev->name_assign_type = NET_NAME_RENAMED; diff --git a/feeds/ipq807x/ipq807x/patches/700-RTL8367C_S.patch b/feeds/ipq807x/ipq807x/patches/700-RTL8367C_S.patch deleted file mode 100644 index 1e3f06333..000000000 --- a/feeds/ipq807x/ipq807x/patches/700-RTL8367C_S.patch +++ /dev/null @@ -1,3649 +0,0 @@ -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/Kconfig -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/net/phy/Kconfig -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/Kconfig -@@ -332,6 +332,10 @@ config RTL8367B_PHY - tristate "Driver fot the Realtek RTL8367R-VB switch" - select SWCONFIG - -+config RTL8367C_PHY -+ tristate "Driver fot the Realtek RTL8367C/S switch" -+ select SWCONFIG -+ - endif # RTL8366_SMI - - source "drivers/net/phy/b53/Kconfig" -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/Makefile -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/net/phy/Makefile -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/Makefile -@@ -34,6 +34,7 @@ obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o - obj-$(CONFIG_RTL8366RB_PHY) += rtl8366rb.o - obj-$(CONFIG_RTL8367_PHY) += rtl8367.o - obj-$(CONFIG_RTL8367B_PHY) += rtl8367b.o -+obj-$(CONFIG_RTL8367C_PHY) += rtl8367c.o - obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o - obj-$(CONFIG_PSB6970_PHY) += psb6970.o - obj-$(CONFIG_B53) += b53/ -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/rtl8366_smi.h -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/net/phy/rtl8366_smi.h -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/rtl8366_smi.h -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - struct rtl8366_smi_ops; - struct rtl8366_vlan_ops; -@@ -33,7 +34,7 @@ struct rtl8366_smi { - struct device *parent; - unsigned int gpio_sda; - unsigned int gpio_sck; -- void (*hw_reset)(bool active); -+ void (*hw_reset)(struct rtl8366_smi *smi, bool active); - unsigned int clk_delay; /* ns */ - u8 cmd_read; - u8 cmd_write; -@@ -54,11 +55,16 @@ struct rtl8366_smi { - int vlan4k_enabled; - - char buf[4096]; -+ -+ struct reset_control *reset; -+ - #ifdef CONFIG_RTL8366_SMI_DEBUG_FS - struct dentry *debugfs_root; - u16 dbg_reg; - u8 dbg_vlan_4k_page; - #endif -+ struct mii_bus *ext_mbus; -+ u32 phy_addr; - }; - - struct rtl8366_vlan_mc { -@@ -109,6 +115,10 @@ int rtl8366_smi_write_reg(struct rtl8366 - int rtl8366_smi_write_reg_noack(struct rtl8366_smi *smi, u32 addr, u32 data); - int rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data); - int rtl8366_smi_rmwr(struct rtl8366_smi *smi, u32 addr, u32 mask, u32 data); -+int rtl8366_smi_rwbt(struct rtl8366_smi *smi, u32 addr, u32 bit, u32 value); -+int rtl8366_smi_rwbts(struct rtl8366_smi *smi, u32 addr, u32 bits, u32 value); -+int rtl8366_smi_rdbt(struct rtl8366_smi *smi, u32 addr, u32 bit, u32 *value); -+int rtl8366_smi_rdbts(struct rtl8366_smi *smi, u32 addr, u32 bits, u32 *value); - - int rtl8366_reset_vlan(struct rtl8366_smi *smi); - int rtl8366_enable_vlan(struct rtl8366_smi *smi, int enable); -@@ -146,6 +156,9 @@ int rtl8366_sw_get_vlan_enable(struct sw - int rtl8366_sw_set_vlan_enable(struct switch_dev *dev, - const struct switch_attr *attr, - struct switch_val *val); -+int rtl8366_sw_get_port_stats(struct switch_dev *dev, int port, -+ struct switch_port_stats *stats, -+ int txb_id, int rxb_id); - - struct rtl8366_smi* rtl8366_smi_probe(struct platform_device *pdev); - -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/rtl8366_smi.c -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/net/phy/rtl8366_smi.c -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/rtl8366_smi.c -@@ -19,6 +19,8 @@ - #include - #include - #include -+#include -+#include - - #ifdef CONFIG_RTL8366_SMI_DEBUG_FS - #include -@@ -197,7 +199,7 @@ static int rtl8366_smi_read_byte1(struct - return 0; - } - --int rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data) -+static int __rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data) - { - unsigned long flags; - u8 lo = 0; -@@ -238,6 +240,101 @@ int rtl8366_smi_read_reg(struct rtl8366_ - - return ret; - } -+/* Add Read/write via mdiobus */ -+#define MDC_MDIO_CTRL0_REG 31 -+#define MDC_MDIO_START_REG 29 -+#define MDC_MDIO_CTRL1_REG 21 -+#define MDC_MDIO_ADDRESS_REG 23 -+#define MDC_MDIO_DATA_WRITE_REG 24 -+#define MDC_MDIO_DATA_READ_REG 25 -+ -+#define MDC_MDIO_START_OP 0xFFFF -+#define MDC_MDIO_ADDR_OP 0x000E -+#define MDC_MDIO_READ_OP 0x0001 -+#define MDC_MDIO_WRITE_OP 0x0003 -+#define MDC_REALTEK_PHY_ADDR 0 -+ -+int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data) -+{ -+ u32 phy_id = smi->phy_addr?smi->phy_addr:MDC_REALTEK_PHY_ADDR; -+ struct mii_bus *mbus = smi->ext_mbus; -+ -+ BUG_ON(in_interrupt()); -+ -+ mutex_lock(&mbus->mdio_lock); -+ /* Write Start command to register 29 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_START_REG, MDC_MDIO_START_OP); -+ -+ /* Write address control code to register 31 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_CTRL0_REG, MDC_MDIO_ADDR_OP); -+ -+ /* Write Start command to register 29 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_START_REG, MDC_MDIO_START_OP); -+ -+ /* Write address to register 23 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_ADDRESS_REG, addr); -+ -+ /* Write Start command to register 29 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_START_REG, MDC_MDIO_START_OP); -+ -+ /* Write read control code to register 21 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_CTRL1_REG, MDC_MDIO_READ_OP); -+ -+ /* Write Start command to register 29 */ -+ mbus->write(smi->ext_mbus, phy_id, MDC_MDIO_START_REG, MDC_MDIO_START_OP); -+ -+ /* Read data from register 25 */ -+ *data = mbus->read(mbus, phy_id, MDC_MDIO_DATA_READ_REG); -+ -+ mutex_unlock(&mbus->mdio_lock); -+ -+ return 0; -+} -+ -+static int __rtl8366_mdio_write_reg(struct rtl8366_smi *smi, u32 addr, u32 data) -+{ -+ u32 phy_id = smi->phy_addr?smi->phy_addr:MDC_REALTEK_PHY_ADDR; -+ struct mii_bus *mbus = smi->ext_mbus; -+ -+ BUG_ON(in_interrupt()); -+ -+ mutex_lock(&mbus->mdio_lock); -+ -+ /* Write Start command to register 29 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_START_REG, MDC_MDIO_START_OP); -+ -+ /* Write address control code to register 31 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_CTRL0_REG, MDC_MDIO_ADDR_OP); -+ -+ /* Write Start command to register 29 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_START_REG, MDC_MDIO_START_OP); -+ -+ /* Write address to register 23 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_ADDRESS_REG, addr); -+ -+ /* Write Start command to register 29 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_START_REG, MDC_MDIO_START_OP); -+ -+ /* Write data to register 24 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_DATA_WRITE_REG, data); -+ -+ /* Write Start command to register 29 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_START_REG, MDC_MDIO_START_OP); -+ -+ /* Write data control code to register 21 */ -+ mbus->write(mbus, phy_id, MDC_MDIO_CTRL1_REG, MDC_MDIO_WRITE_OP); -+ -+ mutex_unlock(&mbus->mdio_lock); -+ return 0; -+} -+ -+int rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data) -+{ -+ if (smi->ext_mbus) -+ return __rtl8366_mdio_read_reg(smi, addr, data); -+ else -+ return __rtl8366_smi_read_reg(smi, addr, data); -+} - EXPORT_SYMBOL_GPL(rtl8366_smi_read_reg); - - static int __rtl8366_smi_write_reg(struct rtl8366_smi *smi, -@@ -289,7 +386,10 @@ static int __rtl8366_smi_write_reg(struc - - int rtl8366_smi_write_reg(struct rtl8366_smi *smi, u32 addr, u32 data) - { -- return __rtl8366_smi_write_reg(smi, addr, data, true); -+ if (smi->ext_mbus) -+ return __rtl8366_mdio_write_reg(smi, addr, data); -+ else -+ return __rtl8366_smi_write_reg(smi, addr, data, true); - } - EXPORT_SYMBOL_GPL(rtl8366_smi_write_reg); - -@@ -314,12 +414,98 @@ int rtl8366_smi_rmwr(struct rtl8366_smi - } - EXPORT_SYMBOL_GPL(rtl8366_smi_rmwr); - -+ -+int rtl8366_smi_rwbt(struct rtl8366_smi *smi, u32 addr, u32 bit, u32 value) -+{ -+ u32 t; -+ int err; -+ -+ err = rtl8366_smi_read_reg(smi, addr, &t); -+ if (err) -+ return err; -+ -+ if(value) -+ t = t | (1 << bit); -+ else -+ t = t & (~(1 << bit)); -+ -+ err = rtl8366_smi_write_reg(smi, addr, t); -+ return err; -+} -+EXPORT_SYMBOL_GPL(rtl8366_smi_rwbt); -+ -+int rtl8366_smi_rdbt(struct rtl8366_smi *smi, u32 addr, u32 bit, u32 *value) -+{ -+ u32 t; -+ int err; -+ -+ err = rtl8366_smi_read_reg(smi, addr, &t); -+ if (err) -+ return err; -+ -+ *value = (t & (0x1 << bit)) >> bit; -+ -+ return err; -+} -+EXPORT_SYMBOL_GPL(rtl8366_smi_rdbt); -+ -+ -+int rtl8366_smi_rwbts(struct rtl8366_smi *smi, u32 addr, u32 bits, u32 value) -+{ -+ u32 t; -+ int err; -+ u32 bitsShift; -+ u32 valueShifted; -+ -+ bitsShift = 0; -+ while(!(bits & (1 << bitsShift))) -+ { -+ bitsShift++; -+ } -+ valueShifted = value << bitsShift; -+ -+ err = rtl8366_smi_read_reg(smi, addr, &t); -+ if (err) -+ return err; -+ -+ t = t & (~bits); -+ t = t | (valueShifted & bits); -+ -+ err = rtl8366_smi_write_reg(smi, addr, t); -+ return err; -+} -+EXPORT_SYMBOL_GPL(rtl8366_smi_rwbts); -+ -+int rtl8366_smi_rdbts(struct rtl8366_smi *smi, u32 addr, u32 bits, u32 *value) -+{ -+ u32 t; -+ int err; -+ -+ u32 bitsShift; -+ -+ bitsShift = 0; -+ while(!(bits & (1 << bitsShift))) -+ { -+ bitsShift++; -+ } -+ -+ err = rtl8366_smi_read_reg(smi, addr, &t); -+ if (err) -+ return err; -+ *value = (t & bits) >> bitsShift; -+ -+ return err; -+} -+EXPORT_SYMBOL_GPL(rtl8366_smi_rdbts); -+ -+ -+ - static int rtl8366_reset(struct rtl8366_smi *smi) - { - if (smi->hw_reset) { -- smi->hw_reset(true); -+ smi->hw_reset(smi, true); - msleep(RTL8366_SMI_HW_STOP_DELAY); -- smi->hw_reset(false); -+ smi->hw_reset(smi, false); - msleep(RTL8366_SMI_HW_START_DELAY); - return 0; - } -@@ -914,7 +1100,12 @@ static inline void rtl8366_debugfs_remov - static int rtl8366_smi_mii_init(struct rtl8366_smi *smi) - { - int ret; -- int i; -+ -+#ifdef CONFIG_OF -+ struct device_node *np = NULL; -+ -+ np = of_get_child_by_name(smi->parent->of_node, "mdio-bus"); -+#endif - - smi->mii_bus = mdiobus_alloc(); - if (smi->mii_bus == NULL) { -@@ -930,11 +1121,14 @@ static int rtl8366_smi_mii_init(struct r - dev_name(smi->parent)); - smi->mii_bus->parent = smi->parent; - smi->mii_bus->phy_mask = ~(0x1f); -- smi->mii_bus->irq = smi->mii_irq; -- for (i = 0; i < PHY_MAX_ADDR; i++) -- smi->mii_irq[i] = PHY_POLL; - -- ret = mdiobus_register(smi->mii_bus); -+#ifdef CONFIG_OF -+ if (np) -+ ret = of_mdiobus_register(smi->mii_bus, np); -+ else -+#endif -+ ret = mdiobus_register(smi->mii_bus); -+ - if (ret) - goto err_free; - -@@ -1025,6 +1219,33 @@ int rtl8366_sw_get_port_mib(struct switc - } - EXPORT_SYMBOL_GPL(rtl8366_sw_get_port_mib); - -+int rtl8366_sw_get_port_stats(struct switch_dev *dev, int port, -+ struct switch_port_stats *stats, -+ int txb_id, int rxb_id) -+{ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ unsigned long long counter = 0; -+ int ret; -+ -+ if (port >= smi->num_ports) -+ return -EINVAL; -+ -+ ret = smi->ops->get_mib_counter(smi, txb_id, port, &counter); -+ if (ret) -+ return ret; -+ -+ stats->tx_bytes = counter; -+ -+ ret = smi->ops->get_mib_counter(smi, rxb_id, port, &counter); -+ if (ret) -+ return ret; -+ -+ stats->rx_bytes = counter; -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(rtl8366_sw_get_port_stats); -+ - int rtl8366_sw_get_vlan_info(struct switch_dev *dev, - const struct switch_attr *attr, - struct switch_val *val) -@@ -1207,9 +1428,9 @@ int rtl8366_sw_set_vlan_enable(struct sw - if (attr->ofs > 2) - return -EINVAL; - -- if (attr->ofs == 1) -+/* if (attr->ofs == 1) - err = rtl8366_enable_vlan(smi, val->value.i); -- else -+ else*/ - err = rtl8366_enable_vlan4k(smi, val->value.i); - - return err; -@@ -1237,25 +1458,27 @@ static int __rtl8366_smi_init(struct rtl - { - int err; - -- err = gpio_request(smi->gpio_sda, name); -- if (err) { -- printk(KERN_ERR "rtl8366_smi: gpio_request failed for %u, err=%d\n", -- smi->gpio_sda, err); -- goto err_out; -- } -+ if (!smi->ext_mbus) { -+ err = gpio_request(smi->gpio_sda, name); -+ if (err) { -+ printk(KERN_ERR "rtl8366_smi: gpio_request failed for %u, err=%d\n", -+ smi->gpio_sda, err); -+ goto err_out; -+ } - -- err = gpio_request(smi->gpio_sck, name); -- if (err) { -- printk(KERN_ERR "rtl8366_smi: gpio_request failed for %u, err=%d\n", -- smi->gpio_sck, err); -- goto err_free_sda; -+ err = gpio_request(smi->gpio_sck, name); -+ if (err) { -+ printk(KERN_ERR "rtl8366_smi: gpio_request failed for %u, err=%d\n", -+ smi->gpio_sck, err); -+ goto err_free_sda; -+ } - } - - spin_lock_init(&smi->lock); - - /* start the switch */ - if (smi->hw_reset) { -- smi->hw_reset(false); -+ smi->hw_reset(smi, false); - msleep(RTL8366_SMI_HW_START_DELAY); - } - -@@ -1270,10 +1493,12 @@ static int __rtl8366_smi_init(struct rtl - static void __rtl8366_smi_cleanup(struct rtl8366_smi *smi) - { - if (smi->hw_reset) -- smi->hw_reset(true); -+ smi->hw_reset(smi, true); - -- gpio_free(smi->gpio_sck); -- gpio_free(smi->gpio_sda); -+ if (!smi->ext_mbus) { -+ gpio_free(smi->gpio_sck); -+ gpio_free(smi->gpio_sda); -+ } - } - - enum rtl8366_type rtl8366_smi_detect(struct rtl8366_platform_data *pdata) -@@ -1326,8 +1551,11 @@ int rtl8366_smi_init(struct rtl8366_smi - if (err) - goto err_out; - -- dev_info(smi->parent, "using GPIO pins %u (SDA) and %u (SCK)\n", -- smi->gpio_sda, smi->gpio_sck); -+ if (!smi->ext_mbus) -+ dev_info(smi->parent, "using GPIO pins %u (SDA) and %u (SCK)\n", -+ smi->gpio_sda, smi->gpio_sck); -+ else -+ dev_info(smi->parent, "using MDIO bus '%s'\n", smi->ext_mbus->name); - - err = smi->ops->detect(smi); - if (err) { -@@ -1380,18 +1608,62 @@ void rtl8366_smi_cleanup(struct rtl8366_ - EXPORT_SYMBOL_GPL(rtl8366_smi_cleanup); - - #ifdef CONFIG_OF -+static void rtl8366_smi_reset(struct rtl8366_smi *smi, bool active) -+{ -+ if (active) -+ reset_control_assert(smi->reset); -+ else -+ reset_control_deassert(smi->reset); -+} -+ - int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi) - { - int sck = of_get_named_gpio(pdev->dev.of_node, "gpio-sck", 0); - int sda = of_get_named_gpio(pdev->dev.of_node, "gpio-sda", 0); -+ struct device_node *np = pdev->dev.of_node; -+ struct device_node *mdio_node; -+ const __be32 *phy_addr; -+ int len; -+ phy_addr = of_get_property(np, "phy-addr", &len); -+ if (!phy_addr || len != sizeof(uint32_t)) { -+ smi->phy_addr = 0; -+ }else{ -+ smi->phy_addr = be32_to_cpup(phy_addr); -+ } -+ -+ dev_err(&pdev->dev, "phy addr = %x\n",smi->phy_addr); -+ -+ -+ mdio_node = of_parse_phandle(np, "mii-bus", 0); -+ if (!mdio_node) { -+ dev_err(&pdev->dev, "cannot find mdio node phandle"); -+ goto try_gpio; -+ } -+ -+ smi->ext_mbus = of_mdio_find_bus(mdio_node); -+ if (!smi->ext_mbus) { -+ dev_info(&pdev->dev, -+ "cannot find mdio bus from bus handle (yet)"); -+ goto try_gpio; -+ } - -+ return 0; -+ -+try_gpio: - if (!gpio_is_valid(sck) || !gpio_is_valid(sda)) { -- dev_err(&pdev->dev, "gpios missing in devictree\n"); -- return -EINVAL; -+ if (!mdio_node) { -+ dev_err(&pdev->dev, "gpios missing in devictree\n"); -+ return -EINVAL; -+ } else { -+ return -EPROBE_DEFER; -+ } - } - - smi->gpio_sda = sda; - smi->gpio_sck = sck; -+ smi->reset = devm_reset_control_get(&pdev->dev, "switch"); -+ if (!IS_ERR(smi->reset)) -+ smi->hw_reset = rtl8366_smi_reset; - - return 0; - } -@@ -1440,7 +1712,7 @@ struct rtl8366_smi *rtl8366_smi_probe(st - - free_smi: - kfree(smi); -- return NULL; -+ return ERR_PTR(err); - } - EXPORT_SYMBOL_GPL(rtl8366_smi_probe); - -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/rtl8367c.c -=================================================================== ---- /dev/null -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/rtl8367c.c -@@ -0,0 +1,2976 @@ -+/* -+ * Platform driver for the Realtek RTL8367R-VB/S/C ethernet switches -+ * -+ * 2023 CIG wf186w board + rtl8367S/C switch driver based off rtl8367b.c -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 as published -+ * by the Free Software Foundation. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+ -+ -+#include "rtl8366_smi.h" -+ -+#define RTL8367B_RESET_DELAY 1000 /* msecs*/ -+ -+#define RTL8367B_PHY_ADDR_MAX 8 -+#define RTL8367B_PHY_REG_MAX 31 -+ -+#define RTL8367B_VID_MASK 0x3fff -+#define RTL8367B_FID_MASK 0xf -+#define RTL8367B_UNTAG_MASK 0xff -+#define RTL8367B_MEMBER_MASK 0xff -+ -+#define RTL8367B_PORT_MISC_CFG_REG(_p) (0x000e + 0x20 * (_p)) -+#define RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT 4 -+#define RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK 0x3 -+#define RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL 0 -+#define RTL8367B_PORT_MISC_CFG_EGRESS_MODE_KEEP 1 -+#define RTL8367B_PORT_MISC_CFG_EGRESS_MODE_PRI 2 -+#define RTL8367B_PORT_MISC_CFG_EGRESS_MODE_REAL 3 -+ -+#define RTL8367B_BYPASS_LINE_RATE_REG 0x03f7 -+ -+#define RTL8367B_TA_CTRL_REG 0x0500 /*GOOD*/ -+#define RTL8367B_TA_CTRL_SPA_SHIFT 8 -+#define RTL8367B_TA_CTRL_SPA_MASK 0x7 -+#define RTL8367B_TA_CTRL_METHOD BIT(4)/*GOOD*/ -+#define RTL8367B_TA_CTRL_CMD_SHIFT 3 -+#define RTL8367B_TA_CTRL_CMD_READ 0 -+#define RTL8367B_TA_CTRL_CMD_WRITE 1 -+#define RTL8367B_TA_CTRL_TABLE_SHIFT 0 /*GOOD*/ -+#define RTL8367B_TA_CTRL_TABLE_ACLRULE 1 -+#define RTL8367B_TA_CTRL_TABLE_ACLACT 2 -+#define RTL8367B_TA_CTRL_TABLE_CVLAN 3 -+#define RTL8367B_TA_CTRL_TABLE_L2 4 -+#define RTL8367B_TA_CTRL_CVLAN_READ \ -+ ((RTL8367B_TA_CTRL_CMD_READ << RTL8367B_TA_CTRL_CMD_SHIFT) | \ -+ RTL8367B_TA_CTRL_TABLE_CVLAN) -+#define RTL8367B_TA_CTRL_CVLAN_WRITE \ -+ ((RTL8367B_TA_CTRL_CMD_WRITE << RTL8367B_TA_CTRL_CMD_SHIFT) | \ -+ RTL8367B_TA_CTRL_TABLE_CVLAN) -+ -+#define RTL8367B_TA_ADDR_REG 0x0501/*GOOD*/ -+#define RTL8367B_TA_ADDR_MASK 0x3fff/*GOOD*/ -+ -+#define RTL8367B_TA_LUT_REG 0x0502/*GOOD*/ -+ -+#define RTL8367B_TA_WRDATA_REG(_x) (0x0510 + (_x))/*GOOD*/ -+#define RTL8367B_TA_VLAN_NUM_WORDS 2 -+#define RTL8367B_TA_VLAN_VID_MASK RTL8367B_VID_MASK -+#define RTL8367B_TA_VLAN0_MEMBER_SHIFT 0 -+#define RTL8367B_TA_VLAN0_MEMBER_MASK RTL8367B_MEMBER_MASK -+#define RTL8367B_TA_VLAN0_UNTAG_SHIFT 8 -+#define RTL8367B_TA_VLAN0_UNTAG_MASK RTL8367B_MEMBER_MASK -+#define RTL8367B_TA_VLAN1_FID_SHIFT 0 -+#define RTL8367B_TA_VLAN1_FID_MASK RTL8367B_FID_MASK -+ -+#define RTL8367B_TA_RDDATA_REG(_x) (0x0520 + (_x))/*GOOD*/ -+ -+#define RTL8367B_VLAN_PVID_CTRL_REG(_p) (0x0700 + (_p) / 2) /*GOOD*/ -+#define RTL8367B_VLAN_PVID_CTRL_MASK 0x1f /*GOOD*/ -+#define RTL8367B_VLAN_PVID_CTRL_SHIFT(_p) (8 * ((_p) % 2)) /*GOOD*/ -+ -+#define RTL8367B_VLAN_MC_BASE(_x) (0x0728 + (_x) * 4) /*GOOD*/ -+#define RTL8367B_VLAN_MC_NUM_WORDS 4 /*GOOD*/ -+#define RTL8367B_VLAN_MC0_MEMBER_SHIFT 0/*GOOD*/ -+#define RTL8367B_VLAN_MC0_MEMBER_MASK RTL8367B_MEMBER_MASK/*GOOD*/ -+#define RTL8367B_VLAN_MC1_FID_SHIFT 0/*GOOD*/ -+#define RTL8367B_VLAN_MC1_FID_MASK RTL8367B_FID_MASK/*GOOD*/ -+#define RTL8367B_VLAN_MC3_EVID_SHIFT 0/*GOOD*/ -+#define RTL8367B_VLAN_MC3_EVID_MASK RTL8367B_VID_MASK/*GOOD*/ -+ -+#define RTL8367B_VLAN_CTRL_REG 0x07a8 /*GOOD*/ -+#define RTL8367B_VLAN_CTRL_ENABLE BIT(0) -+ -+#define RTL8367B_VLAN_INGRESS_REG 0x07a9 /*GOOD*/ -+ -+#define RTL8367B_PORT_ISOLATION_REG(_p) (0x08a2 + (_p)) /*GOOD*/ -+ -+#define RTL8367B_MIB_COUNTER_REG(_x) (0x1000 + (_x)) /*GOOD*/ -+#define RTL8367B_MIB_COUNTER_PORT_OFFSET 0x007c /*GOOD*/ -+ -+#define RTL8367B_MIB_ADDRESS_REG 0x1004 /*GOOD*/ -+ -+#define RTL8367B_MIB_CTRL0_REG(_x) (0x1005 + (_x)) /*GOOD*/ -+#define RTL8367B_MIB_CTRL0_GLOBAL_RESET_MASK BIT(11) /*GOOD*/ -+#define RTL8367B_MIB_CTRL0_QM_RESET_MASK BIT(10) /*GOOD*/ -+#define RTL8367B_MIB_CTRL0_PORT_RESET_MASK(_p) BIT(2 + (_p)) /*GOOD*/ -+#define RTL8367B_MIB_CTRL0_RESET_MASK BIT(1) /*GOOD*/ -+#define RTL8367B_MIB_CTRL0_BUSY_MASK BIT(0) /*GOOD*/ -+ -+#define RTL8367B_SWC0_REG 0x1200/*GOOD*/ -+#define RTL8367B_SWC0_MAX_LENGTH_SHIFT 13/*GOOD*/ -+#define RTL8367B_SWC0_MAX_LENGTH(_x) ((_x) << 13) /*GOOD*/ -+#define RTL8367B_SWC0_MAX_LENGTH_MASK RTL8367B_SWC0_MAX_LENGTH(0x3) -+#define RTL8367B_SWC0_MAX_LENGTH_1522 RTL8367B_SWC0_MAX_LENGTH(0) -+#define RTL8367B_SWC0_MAX_LENGTH_1536 RTL8367B_SWC0_MAX_LENGTH(1) -+#define RTL8367B_SWC0_MAX_LENGTH_1552 RTL8367B_SWC0_MAX_LENGTH(2) -+#define RTL8367B_SWC0_MAX_LENGTH_16000 RTL8367B_SWC0_MAX_LENGTH(3) -+ -+#define RTL8367B_CHIP_NUMBER_REG 0x1300/*GOOD*/ -+ -+#define RTL8367B_CHIP_VER_REG 0x1301/*GOOD*/ -+#define RTL8367B_CHIP_VER_RLVID_SHIFT 12/*GOOD*/ -+#define RTL8367B_CHIP_VER_RLVID_MASK 0xf/*GOOD*/ -+#define RTL8367B_CHIP_VER_MCID_SHIFT 8/*GOOD*/ -+#define RTL8367B_CHIP_VER_MCID_MASK 0xf/*GOOD*/ -+#define RTL8367B_CHIP_VER_BOID_SHIFT 4/*GOOD*/ -+#define RTL8367B_CHIP_VER_BOID_MASK 0xf/*GOOD*/ -+#define RTL8367B_CHIP_VER_AFE_SHIFT 0/*GOOD*/ -+#define RTL8367B_CHIP_VER_AFE_MASK 0x1/*GOOD*/ -+ -+#define RTL8367B_CHIP_MODE_REG 0x1302 -+#define RTL8367B_CHIP_MODE_MASK 0x7 -+ -+#define RTL8367B_CHIP_DEBUG0_REG 0x1303 -+#define RTL8367B_CHIP_DEBUG0_DUMMY0(_x) BIT(8 + (_x)) -+ -+#define RTL8367B_CHIP_DEBUG1_REG 0x1304 -+ -+#define RTL8367B_DIS_REG 0x1305 -+#define RTL8367B_DIS_SKIP_MII_RXER(_x) BIT(12 + (_x)) -+#define RTL8367B_DIS_RGMII_SHIFT(_x) (4 * (_x)) -+#define RTL8367B_DIS_RGMII_MASK 0x7 -+ -+#define RTL8367B_EXT_RGMXF_REG(_x) (0x1306 + (_x)) -+#define RTL8367B_EXT_RGMXF_DUMMY0_SHIFT 5 -+#define RTL8367B_EXT_RGMXF_DUMMY0_MASK 0x7ff -+#define RTL8367B_EXT_RGMXF_TXDELAY_SHIFT 3 -+#define RTL8367B_EXT_RGMXF_TXDELAY_MASK 1 -+#define RTL8367B_EXT_RGMXF_RXDELAY_MASK 0x7 -+ -+#define RTL8367B_DI_FORCE_REG(_x) (0x1310 + (_x)) -+#define RTL8367B_DI_FORCE_MODE BIT(12) -+#define RTL8367B_DI_FORCE_NWAY BIT(7) -+#define RTL8367B_DI_FORCE_TXPAUSE BIT(6) -+#define RTL8367B_DI_FORCE_RXPAUSE BIT(5) -+#define RTL8367B_DI_FORCE_LINK BIT(4) -+#define RTL8367B_DI_FORCE_DUPLEX BIT(2) -+#define RTL8367B_DI_FORCE_SPEED_MASK 3 -+#define RTL8367B_DI_FORCE_SPEED_10 0 -+#define RTL8367B_DI_FORCE_SPEED_100 1 -+#define RTL8367B_DI_FORCE_SPEED_1000 2 -+ -+#define RTL8367B_MAC_FORCE_REG(_x) (0x1312 + (_x)) -+ -+#define RTL8367B_CHIP_RESET_REG 0x1322 /*GOOD*/ -+#define RTL8367B_CHIP_RESET_SW BIT(1) /*GOOD*/ -+#define RTL8367B_CHIP_RESET_HW BIT(0) /*GOOD*/ -+ -+#define RTL8367B_PORT_STATUS_REG(_p) (0x1352 + (_p)) /*GOOD*/ -+#define RTL8367B_PORT_STATUS_EN_1000_SPI BIT(11) /*GOOD*/ -+#define RTL8367B_PORT_STATUS_EN_100_SPI BIT(10)/*GOOD*/ -+#define RTL8367B_PORT_STATUS_NWAY_FAULT BIT(9)/*GOOD*/ -+#define RTL8367B_PORT_STATUS_LINK_MASTER BIT(8)/*GOOD*/ -+#define RTL8367B_PORT_STATUS_NWAY BIT(7)/*GOOD*/ -+#define RTL8367B_PORT_STATUS_TXPAUSE BIT(6)/*GOOD*/ -+#define RTL8367B_PORT_STATUS_RXPAUSE BIT(5)/*GOOD*/ -+#define RTL8367B_PORT_STATUS_LINK BIT(4)/*GOOD*/ -+#define RTL8367B_PORT_STATUS_DUPLEX BIT(2)/*GOOD*/ -+#define RTL8367B_PORT_STATUS_SPEED_MASK 0x0003/*GOOD*/ -+#define RTL8367B_PORT_STATUS_SPEED_10 0/*GOOD*/ -+#define RTL8367B_PORT_STATUS_SPEED_100 1/*GOOD*/ -+#define RTL8367B_PORT_STATUS_SPEED_1000 2/*GOOD*/ -+ -+#define RTL8367B_RTL_MAGIC_ID_REG 0x13c2 -+#define RTL8367B_RTL_MAGIC_ID_VAL 0x0249 -+ -+#define RTL8367S_EXT_TXC_DLY_REG 0x13f9 -+#define RTL8367S_EXT1_GMII_TX_DELAY_SHIFT 12 -+#define RTL8367S_EXT0_GMII_TX_DELAY_SHIFT 9 -+#define RTL8367S_EXT_GMII_TX_DELAY_MASK GENMASK(2,0) -+ -+#define RTL8367S_SDS_MISC 0x1d11 -+#define RTL8367S_CFG_SGMII_RXFC BIT(14) -+#define RTL8367S_CFG_SGMII_TXFC BIT(13) -+#define RTL8367S_CFG_MAC8_SEL_HSGMII_SHIFT 11 -+#define RTL8367S_CFG_MAC8_SEL_HSGMII_MASK BIT(11) -+#define RTL8367S_CFG_SGMII_FDUP BIT(10) -+#define RTL8367S_CFG_SGMII_LINK BIT(9) -+#define RTL8367S_CFG_SGMII_SPD_SHIFT 7 -+#define RTL8367S_CFG_SGMII_SPD_MASK GENMASK(8,7) -+#define RTL8367S_CFG_MAC8_SEL_SGMII BIT(6) -+ -+#define RTL8367B_IA_CTRL_REG 0x1f00 -+#define RTL8367B_IA_CTRL_RW(_x) ((_x) << 1) -+#define RTL8367B_IA_CTRL_RW_READ RTL8367B_IA_CTRL_RW(0) -+#define RTL8367B_IA_CTRL_RW_WRITE RTL8367B_IA_CTRL_RW(1) -+#define RTL8367B_IA_CTRL_CMD_MASK BIT(0) -+ -+#define RTL8367B_IA_STATUS_REG 0x1f01 -+#define RTL8367B_IA_STATUS_PHY_BUSY BIT(2) -+#define RTL8367B_IA_STATUS_SDS_BUSY BIT(1) -+#define RTL8367B_IA_STATUS_MDX_BUSY BIT(0) -+ -+#define RTL8367B_IA_ADDRESS_REG 0x1f02 -+#define RTL8367B_IA_WRITE_DATA_REG 0x1f03 -+#define RTL8367B_IA_READ_DATA_REG 0x1f04 -+ -+#define RTL8367B_INTERNAL_PHY_REG(_a, _r) (0x2000 + 32 * (_a) + (_r)) -+ -+/* SerDes indirect access */ -+#define RTL8367S_SDS_INDACS_CMD_REG 0x6600 -+#define RTL8367S_SDS_CMD BIT(7) -+#define RTL8367S_SDS_RWOP BIT(6) -+#define RTL8367S_SDS_INDACS_ADDR_REG 0x6601 -+#define RTL8367S_SDS_INDACS_DATA_REG 0x6602 -+ -+#define RTL8367B_NUM_MIB_COUNTERS 58 -+ -+#define RTL8367S_PHY_ADDR 29 -+#define RTL8367B_CPU_PORT_NUM 5 -+#define RTL8367S_CPU_PORT_NUM 6 -+#define RTL8367B_NUM_PORTS 8 -+#define RTL8367B_NUM_VLANS 32 -+#define RTL8367B_NUM_VIDS 4096 -+#define RTL8367B_PRIORITYMAX 7 -+#define RTL8367B_FIDMAX 7 -+ -+#define RTL8367B_PORT_0 BIT(0) -+#define RTL8367B_PORT_1 BIT(1) -+#define RTL8367B_PORT_2 BIT(2) -+#define RTL8367B_PORT_3 BIT(3) -+#define RTL8367B_PORT_4 BIT(4) -+#define RTL8367B_PORT_E0 BIT(5) /* External port 0 */ -+#define RTL8367B_PORT_E1 BIT(6) /* External port 1 */ -+#define RTL8367B_PORT_E2 BIT(7) /* External port 2 */ -+ -+#define RTL8367B_MIB_RXB_ID 0 /* IfInOctets */ -+#define RTL8367B_MIB_TXB_ID 28 /* IfOutOctets */ -+ -+#define RTL8367B_PORTS_ALL \ -+ (RTL8367B_PORT_0 | RTL8367B_PORT_1 | RTL8367B_PORT_2 | \ -+ RTL8367B_PORT_3 | RTL8367B_PORT_4 | RTL8367B_PORT_E0 | \ -+ RTL8367B_PORT_E1 | RTL8367B_PORT_E2) -+ -+#define RTL8367B_PORTS_ALL_BUT_CPU \ -+ (RTL8367B_PORT_0 | RTL8367B_PORT_1 | RTL8367B_PORT_2 | \ -+ RTL8367B_PORT_3 | RTL8367B_PORT_4 | RTL8367B_PORT_E1 | \ -+ RTL8367B_PORT_E2) -+ -+#define RTL8367S_REG_SDS_MISC 0x1d11 -+#define RTL8367S_CFG_MAC8_SEL_SGMII_OFFSET 6 -+#define RTL8367S_CFG_MAC8_SEL_HSGMII_OFFSET 11 -+#define RTL8367S_CFG_SGMII_FDUP_OFFSET 10 -+//#define RTL8367S_CFG_SGMII_SPD_MASK 0x180 -+#define RTL8367S_CFG_SGMII_LINK_OFFSET 9 -+#define RTL8367S_CFG_SGMII_TXFC_OFFSET 13 -+#define RTL8367S_CFG_SGMII_RXFC_OFFSET 14 -+#define RTL8367S_REG_DIGITAL_INTERFACE0_FORCE 0x1310 -+#define RTL8367S_REG_DIGITAL_INTERFACE2_FORCE 0x13c4 -+ -+#define RTL8367S_REG_REG_TO_ECO4 0x1d41 -+#define RTL8367S_REG_CHIP_RESET 0x1322 -+ -+#define RTL8367S_DW8051_RST_OFFSET 4 -+#define RTL8367S_REG_MISCELLANEOUS_CONFIGURE0 0x130c -+#define RTL8367S_REG_MISCELLANEOUS_CONFIGURE0 0x130c -+#define RTL8367S_REG_DW8051_RDY 0x1336 -+#define RTL8367S_ACS_IROM_ENABLE_OFFSET 1 -+#define RTL8367S_IROM_MSB_OFFSET 2 -+ -+#define RTL8367S_REG_BYPASS_LINE_RATE 0x03f7 -+ -+#define RTL8367S_REG_SDS_INDACS_DATA 0x6602 -+#define RTL8367S_REG_SDS_INDACS_ADR 0x6601 -+ -+#define RTL8367S_REG_SDS_INDACS_CMD 0x6600 -+ -+#define RTL8367S_REG_DIGITAL_INTERFACE_SELECT 0x1305 -+#define RTL8367S_SELECT_GMII_0_MASK 0xF -+#define RTL8367S_SELECT_GMII_1_OFFSET 4 -+#define RTL8367S_REG_DIGITAL_INTERFACE_SELECT_1 0x13c3 -+#define RTL8367S_SELECT_GMII_2_MASK 0xF -+ -+#define RTL8367S_DW8051_EN_OFFSET 5 -+#define SGMII_INIT_SIZE 1223 -+ -+/*****/ -+#define RTL8367S_REG_SPEED_SELECTION_LOW_OFFSET 13 -+#define RTL8367S_REG_AUTO_NEGO_EN_OFFSET 12 -+#define RTL8367S_REG_POWER_DOWN_OFFSET 11 -+#define RTL8367S_REG_RESTART_AUTO_NEGO_OFFSET 9 -+#define RTL8367S_REG_DUPLEX_MODE_OFFSET 8 -+#define RTL8367S_REG_SPEED_SELECTION_HIGH_OFFSET 6 -+#define RTL8367S_SET_BIT(x,bit) (x |= (1<>bit)&0x1) -+ -+#define PHY_CONTROL_REG 0 -+#define PHY_STATUS_REG 1 -+#define RTL8367C_REGBITLENGTH 16 -+#define RTL8367C_REG_PHY_AD 0x130f -+#define RTL8367C_PDNPHY_OFFSET 5 -+#define MDC_MDIO_PHY_ID 0x1d /* PHY ID 0 or 29 */ -+#define MDC_MDIO_CTRL0_REG 0x1f -+#define MDC_MDIO_ADDR_OP 0x000E -+#define MDC_MDIO_ADDRESS_REG 0x17 -+#define MDC_MDIO_DATA_WRITE_REG 0x18 -+#define MDC_MDIO_CTRL1_REG 0x15 -+#define MDC_MDIO_WRITE_OP 0x0003 -+#define MDC_MDIO_READ_OP 0x0001 -+#define MDC_MDIO_DATA_READ_REG 0x19 -+#ifdef MDIO_12_5_MHZ -+#define CTRL_0_REG_C45_DEFAULT_VALUE 0x15107 -+#else -+#define CTRL_0_REG_C45_DEFAULT_VALUE 0x151FF -+#endif -+#define IPQ_MDIO_BASE 0x90000 -+#define MDIO_CTRL_0_REG 0x40 -+#define MDIO_CTRL_1_REG 0x44 -+#define MDIO_CTRL_2_REG 0x48 -+#define MDIO_CTRL_3_REG 0x4c -+#define MDIO_CTRL_4_REG 0x50 -+#define MDIO_CTRL_4_ACCESS_BUSY (1 << 16) -+#define MDIO_CTRL_4_ACCESS_START (1 << 8) -+#define MDIO_CTRL_4_ACCESS_CODE_READ 0 -+#define MDIO_CTRL_4_ACCESS_CODE_WRITE 1 -+#define MDIO_CTRL_4_ACCESS_CODE_C45_ADDR 0 -+#define MDIO_CTRL_4_ACCESS_CODE_C45_WRITE 1 -+#define MDIO_CTRL_4_ACCESS_CODE_C45_READ 2 -+#define CTRL_0_REG_DEFAULT_VALUE 0x150FF -+#define MDIO_CTRL_4_ACCESS_BUSY (1 << 16) -+#define IPQ_MDIO_RETRY 1000 -+#define IPQ_MDIO_DELAY 5 -+#define RTL8367C_REG_GPHY_OCP_MSB_0 0x1d15 -+#define RTL8367C_CFG_CPU_OCPADR_MSB_MASK 0xFC0 -+#define RTL8367C_PHY_BASE 0x2000 -+#define RTL8367C_PHY_EXT_BASE 0xA000 -+#define RTL8367C_REGDATAMAX 0xFFFF -+#define RTL8367C_PHY_OFFSET 5 -+#define RTL8367C_PHY_REGNOMAX 0x1F -+ -+typedef enum rt_error_code_e -+{ -+ RT_ERR_FAILED = -1, /* General Error */ -+ /* 0x0000xxxx for common error code */ -+ RT_ERR_OK = 0, /* 0x00000000, OK */ -+ RT_ERR_INPUT, /* 0x00000001, invalid input parameter */ -+ RT_ERR_UNIT_ID, /* 0x00000002, invalid unit id */ -+ RT_ERR_PORT_ID, /* 0x00000003, invalid port id */ -+ RT_ERR_PORT_MASK, /* 0x00000004, invalid port mask */ -+ RT_ERR_PORT_LINKDOWN, /* 0x00000005, link down port status */ -+ RT_ERR_ENTRY_INDEX, /* 0x00000006, invalid entry index */ -+ RT_ERR_NULL_POINTER, /* 0x00000007, input parameter is null pointer */ -+ RT_ERR_QUEUE_ID, /* 0x00000008, invalid queue id */ -+ RT_ERR_QUEUE_NUM, /* 0x00000009, invalid queue number */ -+ RT_ERR_BUSYWAIT_TIMEOUT, /* 0x0000000a, busy watting time out */ -+ RT_ERR_MAC, /* 0x0000000b, invalid mac address */ -+ RT_ERR_OUT_OF_RANGE, /* 0x0000000c, input parameter out of range */ -+ RT_ERR_PHY_REG_ID, /* 0x000e0001, invalid PHY reg id*/ -+ RT_ERR_SMI, /* 0x0000000e, SMI error */ -+}; -+ -+u8 Sgmii_Init[SGMII_INIT_SIZE] = { -+0x02,0x03,0xA9,0xE4,0xF5,0xA8, -+0xD2,0xAF,0x22,0x00,0x00,0x02,0x04,0x35, -+0xC5,0xF0,0xF8,0xA3,0xE0,0x28,0xF0,0xC5, -+0xF0,0xF8,0xE5,0x82,0x15,0x82,0x70,0x02, -+0x15,0x83,0xE0,0x38,0xF0,0x22,0x75,0xF0, -+0x08,0x75,0x82,0x00,0xEF,0x2F,0xFF,0xEE, -+0x33,0xFE,0xCD,0x33,0xCD,0xCC,0x33,0xCC, -+0xC5,0x82,0x33,0xC5,0x82,0x9B,0xED,0x9A, -+0xEC,0x99,0xE5,0x82,0x98,0x40,0x0C,0xF5, -+0x82,0xEE,0x9B,0xFE,0xED,0x9A,0xFD,0xEC, -+0x99,0xFC,0x0F,0xD5,0xF0,0xD6,0xE4,0xCE, -+0xFB,0xE4,0xCD,0xFA,0xE4,0xCC,0xF9,0xA8, -+0x82,0x22,0xB8,0x00,0xC1,0xB9,0x00,0x59, -+0xBA,0x00,0x2D,0xEC,0x8B,0xF0,0x84,0xCF, -+0xCE,0xCD,0xFC,0xE5,0xF0,0xCB,0xF9,0x78, -+0x18,0xEF,0x2F,0xFF,0xEE,0x33,0xFE,0xED, -+0x33,0xFD,0xEC,0x33,0xFC,0xEB,0x33,0xFB, -+0x10,0xD7,0x03,0x99,0x40,0x04,0xEB,0x99, -+0xFB,0x0F,0xD8,0xE5,0xE4,0xF9,0xFA,0x22, -+0x78,0x18,0xEF,0x2F,0xFF,0xEE,0x33,0xFE, -+0xED,0x33,0xFD,0xEC,0x33,0xFC,0xC9,0x33, -+0xC9,0x10,0xD7,0x05,0x9B,0xE9,0x9A,0x40, -+0x07,0xEC,0x9B,0xFC,0xE9,0x9A,0xF9,0x0F, -+0xD8,0xE0,0xE4,0xC9,0xFA,0xE4,0xCC,0xFB, -+0x22,0x75,0xF0,0x10,0xEF,0x2F,0xFF,0xEE, -+0x33,0xFE,0xED,0x33,0xFD,0xCC,0x33,0xCC, -+0xC8,0x33,0xC8,0x10,0xD7,0x07,0x9B,0xEC, -+0x9A,0xE8,0x99,0x40,0x0A,0xED,0x9B,0xFD, -+0xEC,0x9A,0xFC,0xE8,0x99,0xF8,0x0F,0xD5, -+0xF0,0xDA,0xE4,0xCD,0xFB,0xE4,0xCC,0xFA, -+0xE4,0xC8,0xF9,0x22,0xEB,0x9F,0xF5,0xF0, -+0xEA,0x9E,0x42,0xF0,0xE9,0x9D,0x42,0xF0, -+0xE8,0x9C,0x45,0xF0,0x22,0xE0,0xFC,0xA3, -+0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF, -+0x22,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0, -+0xFA,0xA3,0xE0,0xFB,0x22,0xEC,0xF0,0xA3, -+0xED,0xF0,0xA3,0xEE,0xF0,0xA3,0xEF,0xF0, -+0x22,0xE4,0x90,0x06,0x28,0xF0,0xFD,0x7C, -+0x01,0x7F,0x3F,0x7E,0x1D,0x12,0x04,0x93, -+0x7D,0x40,0x7C,0x00,0x7F,0x36,0x7E,0x13, -+0x12,0x04,0x93,0xE4,0xFF,0xFE,0xFD,0x80, -+0x25,0xE4,0x7F,0xFF,0x7E,0xFF,0xFD,0xFC, -+0x90,0x06,0x24,0x12,0x01,0x0F,0xC3,0x12, -+0x00,0xF2,0x50,0x1B,0x90,0x06,0x24,0x12, -+0x01,0x03,0xEF,0x24,0x01,0xFF,0xE4,0x3E, -+0xFE,0xE4,0x3D,0xFD,0xE4,0x3C,0xFC,0x90, -+0x06,0x24,0x12,0x01,0x1B,0x80,0xD2,0xE4, -+0xF5,0xA8,0xD2,0xAF,0x7D,0x1F,0xFC,0x7F, -+0x49,0x7E,0x13,0x12,0x04,0x93,0x12,0x04, -+0xBA,0x7D,0xFE,0x7C,0x00,0x7F,0xAA,0x7E, -+0x12,0x12,0x04,0x93,0x7D,0x41,0x7C,0x00, -+0x7F,0x36,0x7E,0x13,0x12,0x04,0x93,0xE4, -+0xFF,0xFE,0xFD,0x80,0x25,0xE4,0x7F,0x20, -+0x7E,0x4E,0xFD,0xFC,0x90,0x06,0x24,0x12, -+0x01,0x0F,0xC3,0x12,0x00,0xF2,0x50,0x1B, -+0x90,0x06,0x24,0x12,0x01,0x03,0xEF,0x24, -+0x01,0xFF,0xE4,0x3E,0xFE,0xE4,0x3D,0xFD, -+0xE4,0x3C,0xFC,0x90,0x06,0x24,0x12,0x01, -+0x1B,0x80,0xD2,0xC2,0x00,0xC2,0x01,0xD2, -+0xA9,0xD2,0x8C,0x7D,0x3D,0x7C,0x00,0x7F, -+0x01,0x7E,0x66,0x12,0x04,0x93,0x7D,0x80, -+0x7C,0x00,0x7F,0x00,0x7E,0x66,0x12,0x04, -+0x93,0x7F,0x02,0x7E,0x66,0x12,0x04,0x6F, -+0x7F,0x02,0x7E,0x66,0x12,0x04,0x6F,0xEF, -+0x30,0xE4,0x07,0xE4,0x90,0x06,0x28,0xF0, -+0x80,0xD1,0x90,0x06,0x28,0xE0,0x70,0x12, -+0x12,0x03,0x03,0x90,0x06,0x28,0x74,0x01, -+0xF0,0xE4,0x90,0x06,0x2B,0xF0,0xA3,0xF0, -+0x80,0xB9,0xC3,0x90,0x06,0x2C,0xE0,0x94, -+0x62,0x90,0x06,0x2B,0xE0,0x94,0x00,0x40, -+0xAA,0xE4,0xF0,0xA3,0xF0,0x12,0x03,0x03, -+0x90,0x06,0x28,0x74,0x01,0xF0,0x80,0x9B, -+0x75,0x0F,0x80,0x75,0x0E,0x7E,0x75,0x0D, -+0xAA,0x75,0x0C,0x83,0xE4,0xF5,0x10,0x7F, -+0x36,0x7E,0x13,0x12,0x04,0x6F,0xEE,0xC4, -+0xF8,0x54,0xF0,0xC8,0xEF,0xC4,0x54,0x0F, -+0x48,0x54,0x07,0xFB,0x7A,0x00,0xEA,0x70, -+0x4A,0xEB,0x14,0x60,0x1C,0x14,0x60,0x27, -+0x24,0xFE,0x60,0x31,0x14,0x60,0x3C,0x24, -+0x05,0x70,0x38,0x75,0x0B,0x00,0x75,0x0A, -+0xC2,0x75,0x09,0xEB,0x75,0x08,0x0B,0x80, -+0x36,0x75,0x0B,0x40,0x75,0x0A,0x59,0x75, -+0x09,0x73,0x75,0x08,0x07,0x80,0x28,0x75, -+0x0B,0x00,0x75,0x0A,0xE1,0x75,0x09,0xF5, -+0x75,0x08,0x05,0x80,0x1A,0x75,0x0B,0xA0, -+0x75,0x0A,0xAC,0x75,0x09,0xB9,0x75,0x08, -+0x03,0x80,0x0C,0x75,0x0B,0x00,0x75,0x0A, -+0x62,0x75,0x09,0x3D,0x75,0x08,0x01,0x75, -+0x89,0x11,0xE4,0x7B,0x60,0x7A,0x09,0xF9, -+0xF8,0xAF,0x0B,0xAE,0x0A,0xAD,0x09,0xAC, -+0x08,0x12,0x00,0x60,0xAA,0x06,0xAB,0x07, -+0xC3,0xE4,0x9B,0xFB,0xE4,0x9A,0xFA,0x78, -+0x17,0xF6,0xAF,0x03,0xEF,0x08,0xF6,0x18, -+0xE6,0xF5,0x8C,0x08,0xE6,0xF5,0x8A,0x74, -+0x0D,0x2B,0xFB,0xE4,0x3A,0x18,0xF6,0xAF, -+0x03,0xEF,0x08,0xF6,0x75,0x88,0x10,0x53, -+0x8E,0xC7,0xD2,0xA9,0x22,0x7D,0x02,0x7C, -+0x00,0x7F,0x4A,0x7E,0x13,0x12,0x04,0x93, -+0x7D,0x46,0x7C,0x71,0x7F,0x02,0x7E,0x66, -+0x12,0x04,0x93,0x7D,0x03,0x7C,0x00,0x7F, -+0x01,0x7E,0x66,0x12,0x04,0x93,0x7D,0xC0, -+0x7C,0x00,0x7F,0x00,0x7E,0x66,0x12,0x04, -+0x93,0xE4,0xFF,0xFE,0x0F,0xBF,0x00,0x01, -+0x0E,0xEF,0x64,0x64,0x4E,0x70,0xF5,0x7D, -+0x04,0x7C,0x00,0x7F,0x02,0x7E,0x66,0x12, -+0x04,0x93,0x7D,0x00,0x7C,0x04,0x7F,0x01, -+0x7E,0x66,0x12,0x04,0x93,0x7D,0xC0,0x7C, -+0x00,0x7F,0x00,0x7E,0x66,0x12,0x04,0x93, -+0xE4,0xFD,0xFC,0x7F,0x02,0x7E,0x66,0x12, -+0x04,0x93,0x7D,0x00,0x7C,0x04,0x7F,0x01, -+0x7E,0x66,0x12,0x04,0x93,0x7D,0xC0,0x7C, -+0x00,0x7F,0x00,0x7E,0x66,0x12,0x04,0x93, -+0xE4,0xFD,0xFC,0x7F,0x4A,0x7E,0x13,0x12, -+0x04,0x93,0x7D,0x06,0x7C,0x71,0x7F,0x02, -+0x7E,0x66,0x12,0x04,0x93,0x7D,0x03,0x7C, -+0x00,0x7F,0x01,0x7E,0x66,0x12,0x04,0x93, -+0x7D,0xC0,0x7C,0x00,0x7F,0x00,0x7E,0x66, -+0x02,0x04,0x93,0x78,0x7F,0xE4,0xF6,0xD8, -+0xFD,0x75,0x81,0x3C,0x02,0x03,0xF0,0x02, -+0x01,0x27,0xE4,0x93,0xA3,0xF8,0xE4,0x93, -+0xA3,0x40,0x03,0xF6,0x80,0x01,0xF2,0x08, -+0xDF,0xF4,0x80,0x29,0xE4,0x93,0xA3,0xF8, -+0x54,0x07,0x24,0x0C,0xC8,0xC3,0x33,0xC4, -+0x54,0x0F,0x44,0x20,0xC8,0x83,0x40,0x04, -+0xF4,0x56,0x80,0x01,0x46,0xF6,0xDF,0xE4, -+0x80,0x0B,0x01,0x02,0x04,0x08,0x10,0x20, -+0x40,0x80,0x90,0x04,0xAF,0xE4,0x7E,0x01, -+0x93,0x60,0xBC,0xA3,0xFF,0x54,0x3F,0x30, -+0xE5,0x09,0x54,0x1F,0xFE,0xE4,0x93,0xA3, -+0x60,0x01,0x0E,0xCF,0x54,0xC0,0x25,0xE0, -+0x60,0xA8,0x40,0xB8,0xE4,0x93,0xA3,0xFA, -+0xE4,0x93,0xA3,0xF8,0xE4,0x93,0xA3,0xC8, -+0xC5,0x82,0xC8,0xCA,0xC5,0x83,0xCA,0xF0, -+0xA3,0xC8,0xC5,0x82,0xC8,0xCA,0xC5,0x83, -+0xCA,0xDF,0xE9,0xDE,0xE7,0x80,0xBE,0xC0, -+0xE0,0xC0,0xF0,0xC0,0x83,0xC0,0x82,0xC0, -+0xD0,0x75,0xD0,0x00,0xC0,0x00,0x78,0x17, -+0xE6,0xF5,0x8C,0x78,0x18,0xE6,0xF5,0x8A, -+0x90,0x06,0x29,0xE4,0x75,0xF0,0x01,0x12, -+0x00,0x0E,0x90,0x06,0x2B,0xE4,0x75,0xF0, -+0x01,0x12,0x00,0x0E,0xD0,0x00,0xD0,0xD0, -+0xD0,0x82,0xD0,0x83,0xD0,0xF0,0xD0,0xE0, -+0x32,0xC2,0xAF,0xAD,0x07,0xAC,0x06,0x8C, -+0xA2,0x8D,0xA3,0x75,0xA0,0x01,0x00,0x00, -+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -+0x00,0xAE,0xA1,0xBE,0x00,0xF0,0xAE,0xA6, -+0xAF,0xA7,0xD2,0xAF,0x22,0xC2,0xAF,0xAB, -+0x07,0xAA,0x06,0x8A,0xA2,0x8B,0xA3,0x8C, -+0xA4,0x8D,0xA5,0x75,0xA0,0x03,0x00,0x00, -+0x00,0xAA,0xA1,0xBA,0x00,0xF8,0xD2,0xAF, -+0x22,0x42,0x06,0x2B,0x00,0x00,0x42,0x06, -+0x29,0x00,0x00,0x00,0x12,0x04,0xC3,0x12, -+0x02,0x3E,0x02,0x00,0x03,0xE4,0xF5,0x8E, -+0x22}; -+ -+#define FIBER2_1G_INIT_SIZE 1842 -+u8 Fiber2_1G[FIBER2_1G_INIT_SIZE] = { -+0x02,0x05,0x97,0xE4,0xF5,0xA8, -+0xD2,0xAF,0x22,0x00,0x00,0x02,0x06,0x89, -+0xC5,0xF0,0xF8,0xA3,0xE0,0x28,0xF0,0xC5, -+0xF0,0xF8,0xE5,0x82,0x15,0x82,0x70,0x02, -+0x15,0x83,0xE0,0x38,0xF0,0x22,0x75,0xF0, -+0x08,0x75,0x82,0x00,0xEF,0x2F,0xFF,0xEE, -+0x33,0xFE,0xCD,0x33,0xCD,0xCC,0x33,0xCC, -+0xC5,0x82,0x33,0xC5,0x82,0x9B,0xED,0x9A, -+0xEC,0x99,0xE5,0x82,0x98,0x40,0x0C,0xF5, -+0x82,0xEE,0x9B,0xFE,0xED,0x9A,0xFD,0xEC, -+0x99,0xFC,0x0F,0xD5,0xF0,0xD6,0xE4,0xCE, -+0xFB,0xE4,0xCD,0xFA,0xE4,0xCC,0xF9,0xA8, -+0x82,0x22,0xB8,0x00,0xC1,0xB9,0x00,0x59, -+0xBA,0x00,0x2D,0xEC,0x8B,0xF0,0x84,0xCF, -+0xCE,0xCD,0xFC,0xE5,0xF0,0xCB,0xF9,0x78, -+0x18,0xEF,0x2F,0xFF,0xEE,0x33,0xFE,0xED, -+0x33,0xFD,0xEC,0x33,0xFC,0xEB,0x33,0xFB, -+0x10,0xD7,0x03,0x99,0x40,0x04,0xEB,0x99, -+0xFB,0x0F,0xD8,0xE5,0xE4,0xF9,0xFA,0x22, -+0x78,0x18,0xEF,0x2F,0xFF,0xEE,0x33,0xFE, -+0xED,0x33,0xFD,0xEC,0x33,0xFC,0xC9,0x33, -+0xC9,0x10,0xD7,0x05,0x9B,0xE9,0x9A,0x40, -+0x07,0xEC,0x9B,0xFC,0xE9,0x9A,0xF9,0x0F, -+0xD8,0xE0,0xE4,0xC9,0xFA,0xE4,0xCC,0xFB, -+0x22,0x75,0xF0,0x10,0xEF,0x2F,0xFF,0xEE, -+0x33,0xFE,0xED,0x33,0xFD,0xCC,0x33,0xCC, -+0xC8,0x33,0xC8,0x10,0xD7,0x07,0x9B,0xEC, -+0x9A,0xE8,0x99,0x40,0x0A,0xED,0x9B,0xFD, -+0xEC,0x9A,0xFC,0xE8,0x99,0xF8,0x0F,0xD5, -+0xF0,0xDA,0xE4,0xCD,0xFB,0xE4,0xCC,0xFA, -+0xE4,0xC8,0xF9,0x22,0xEB,0x9F,0xF5,0xF0, -+0xEA,0x9E,0x42,0xF0,0xE9,0x9D,0x42,0xF0, -+0xE8,0x9C,0x45,0xF0,0x22,0xE0,0xFC,0xA3, -+0xE0,0xFD,0xA3,0xE0,0xFE,0xA3,0xE0,0xFF, -+0x22,0xE0,0xF8,0xA3,0xE0,0xF9,0xA3,0xE0, -+0xFA,0xA3,0xE0,0xFB,0x22,0xEC,0xF0,0xA3, -+0xED,0xF0,0xA3,0xEE,0xF0,0xA3,0xEF,0xF0, -+0x22,0x7D,0xD7,0x7C,0x04,0x7F,0x02,0x7E, -+0x66,0x12,0x06,0xE7,0x7D,0x80,0x7C,0x04, -+0x7F,0x01,0x7E,0x66,0x12,0x06,0xE7,0x7D, -+0xC0,0x7C,0x00,0x7F,0x00,0x7E,0x66,0x12, -+0x06,0xE7,0x7D,0x94,0x7C,0xF9,0x7F,0x02, -+0x7E,0x66,0x12,0x06,0xE7,0x7D,0x81,0x7C, -+0x04,0x7F,0x01,0x7E,0x66,0x12,0x06,0xE7, -+0x7D,0xC0,0x7C,0x00,0x7F,0x00,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0xA2,0x7C,0x31,0x7F, -+0x02,0x7E,0x66,0x12,0x06,0xE7,0x7D,0x82, -+0x7C,0x04,0x7F,0x01,0x7E,0x66,0x12,0x06, -+0xE7,0x7D,0xC0,0x7C,0x00,0x7F,0x00,0x7E, -+0x66,0x12,0x06,0xE7,0x7D,0x60,0x7C,0x69, -+0x7F,0x02,0x7E,0x66,0x12,0x06,0xE7,0x7D, -+0x83,0x7C,0x04,0x7F,0x01,0x7E,0x66,0x12, -+0x06,0xE7,0x7D,0xC0,0x7C,0x00,0x7F,0x00, -+0x7E,0x66,0x12,0x06,0xE7,0x7D,0x28,0x7C, -+0x97,0x7F,0x02,0x7E,0x66,0x12,0x06,0xE7, -+0x7D,0x84,0x7C,0x04,0x7F,0x01,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0xC0,0x7C,0x00,0x7F, -+0x00,0x7E,0x66,0x12,0x06,0xE7,0x7D,0x85, -+0x7C,0x9D,0x7F,0x02,0x7E,0x66,0x12,0x06, -+0xE7,0x7D,0x23,0x7C,0x04,0x7F,0x01,0x7E, -+0x66,0x12,0x06,0xE7,0x7D,0xC0,0x7C,0x00, -+0x7F,0x00,0x7E,0x66,0x12,0x06,0xE7,0x7D, -+0x10,0x7C,0xD8,0x7F,0x02,0x7E,0x66,0x12, -+0x06,0xE7,0x7D,0x24,0x7C,0x04,0x7F,0x01, -+0x7E,0x66,0x12,0x06,0xE7,0x7D,0xC0,0x7C, -+0x00,0x7F,0x00,0x7E,0x66,0x12,0x06,0xE7, -+0x7D,0x00,0x7C,0x04,0x7F,0x02,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0x2F,0x7C,0x00,0x7F, -+0x01,0x7E,0x66,0x12,0x06,0xE7,0x7D,0xC0, -+0x7C,0x00,0x7F,0x00,0x7E,0x66,0x02,0x06, -+0xE7,0x7D,0x03,0x7C,0x00,0x7F,0x01,0x7E, -+0x66,0x12,0x06,0xE7,0x7D,0x80,0x7C,0x00, -+0x7F,0x00,0x7E,0x66,0x12,0x06,0xE7,0x7F, -+0x02,0x7E,0x66,0x12,0x06,0xC3,0xEF,0x44, -+0x40,0xFD,0xAC,0x06,0x7F,0x02,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0x03,0x7C,0x00,0x7F, -+0x01,0x7E,0x66,0x12,0x06,0xE7,0x7D,0xC0, -+0x7C,0x00,0x7F,0x00,0x7E,0x66,0x12,0x06, -+0xE7,0x7D,0x03,0x7C,0x00,0x7F,0x01,0x7E, -+0x66,0x12,0x06,0xE7,0x7D,0x80,0x7C,0x00, -+0x7F,0x00,0x7E,0x66,0x12,0x06,0xE7,0x7F, -+0x02,0x7E,0x66,0x12,0x06,0xC3,0xEF,0x54, -+0xBF,0xFD,0xAC,0x06,0x7F,0x02,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0x03,0x7C,0x00,0x7F, -+0x01,0x7E,0x66,0x12,0x06,0xE7,0x7D,0xC0, -+0x7C,0x00,0x7F,0x00,0x7E,0x66,0x12,0x06, -+0xE7,0xE4,0xFD,0xFC,0x7F,0x01,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0x80,0x7C,0x00,0x7F, -+0x00,0x7E,0x66,0x12,0x06,0xE7,0x7F,0x02, -+0x7E,0x66,0x12,0x06,0xC3,0xEF,0x54,0xFD, -+0x54,0xFE,0xFD,0xAC,0x06,0x7F,0x02,0x7E, -+0x66,0x12,0x06,0xE7,0xE4,0xFD,0xFC,0x7F, -+0x01,0x7E,0x66,0x12,0x06,0xE7,0x7D,0xC0, -+0x7C,0x00,0x7F,0x00,0x7E,0x66,0x12,0x06, -+0xE7,0xE4,0xFD,0xFC,0x7F,0x01,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0x80,0x7C,0x00,0x7F, -+0x00,0x7E,0x66,0x12,0x06,0xE7,0x7F,0x02, -+0x7E,0x66,0x12,0x06,0xC3,0xEF,0x44,0x02, -+0x44,0x01,0xFD,0xAC,0x06,0x7F,0x02,0x7E, -+0x66,0x12,0x06,0xE7,0xE4,0xFD,0xFC,0x7F, -+0x01,0x7E,0x66,0x12,0x06,0xE7,0x7D,0xC0, -+0x7C,0x00,0x7F,0x00,0x7E,0x66,0x02,0x06, -+0xE7,0xE4,0x90,0x06,0x2C,0xF0,0xFD,0x7C, -+0x01,0x7F,0x3F,0x7E,0x1D,0x12,0x06,0xE7, -+0x7D,0x40,0x7C,0x00,0x7F,0x36,0x7E,0x13, -+0x12,0x06,0xE7,0xE4,0xFF,0xFE,0xFD,0x80, -+0x25,0xE4,0x7F,0x20,0x7E,0x4E,0xFD,0xFC, -+0x90,0x06,0x24,0x12,0x01,0x0F,0xC3,0x12, -+0x00,0xF2,0x50,0x1B,0x90,0x06,0x24,0x12, -+0x01,0x03,0xEF,0x24,0x01,0xFF,0xE4,0x3E, -+0xFE,0xE4,0x3D,0xFD,0xE4,0x3C,0xFC,0x90, -+0x06,0x24,0x12,0x01,0x1B,0x80,0xD2,0xE4, -+0xF5,0xA8,0xD2,0xAF,0x12,0x07,0x17,0x7D, -+0xFE,0x7C,0x00,0x7F,0xAA,0x7E,0x12,0x12, -+0x06,0xE7,0x12,0x01,0x27,0x12,0x06,0x23, -+0x7D,0x41,0x7C,0x00,0x7F,0x36,0x7E,0x13, -+0x12,0x06,0xE7,0xE4,0xFF,0xFE,0xFD,0x80, -+0x25,0xE4,0x7F,0x20,0x7E,0x4E,0xFD,0xFC, -+0x90,0x06,0x24,0x12,0x01,0x0F,0xC3,0x12, -+0x00,0xF2,0x50,0x1B,0x90,0x06,0x24,0x12, -+0x01,0x03,0xEF,0x24,0x01,0xFF,0xE4,0x3E, -+0xFE,0xE4,0x3D,0xFD,0xE4,0x3C,0xFC,0x90, -+0x06,0x24,0x12,0x01,0x1B,0x80,0xD2,0xC2, -+0x00,0xC2,0x01,0xD2,0xA9,0xD2,0x8C,0x7F, -+0x01,0x7E,0x62,0x12,0x06,0xC3,0x7F,0x01, -+0x7E,0x62,0x12,0x06,0xC3,0xEF,0x30,0xE2, -+0x07,0xE4,0x90,0x06,0x2C,0xF0,0x80,0xE7, -+0x90,0x06,0x2C,0xE0,0x70,0x12,0x12,0x04, -+0xF1,0x90,0x06,0x2C,0x74,0x01,0xF0,0xE4, -+0x90,0x06,0x33,0xF0,0xA3,0xF0,0x80,0xCF, -+0xC3,0x90,0x06,0x34,0xE0,0x94,0x62,0x90, -+0x06,0x33,0xE0,0x94,0x00,0x40,0xC0,0xE4, -+0xF0,0xA3,0xF0,0x12,0x04,0xF1,0x90,0x06, -+0x2C,0x74,0x01,0xF0,0x80,0xB1,0x75,0x0F, -+0x80,0x75,0x0E,0x7E,0x75,0x0D,0xAA,0x75, -+0x0C,0x83,0xE4,0xF5,0x10,0x7F,0x36,0x7E, -+0x13,0x12,0x06,0xC3,0xEE,0xC4,0xF8,0x54, -+0xF0,0xC8,0xEF,0xC4,0x54,0x0F,0x48,0x54, -+0x07,0xFB,0x7A,0x00,0xEA,0x70,0x4A,0xEB, -+0x14,0x60,0x1C,0x14,0x60,0x27,0x24,0xFE, -+0x60,0x31,0x14,0x60,0x3C,0x24,0x05,0x70, -+0x38,0x75,0x0B,0x00,0x75,0x0A,0xC2,0x75, -+0x09,0xEB,0x75,0x08,0x0B,0x80,0x36,0x75, -+0x0B,0x40,0x75,0x0A,0x59,0x75,0x09,0x73, -+0x75,0x08,0x07,0x80,0x28,0x75,0x0B,0x00, -+0x75,0x0A,0xE1,0x75,0x09,0xF5,0x75,0x08, -+0x05,0x80,0x1A,0x75,0x0B,0xA0,0x75,0x0A, -+0xAC,0x75,0x09,0xB9,0x75,0x08,0x03,0x80, -+0x0C,0x75,0x0B,0x00,0x75,0x0A,0x62,0x75, -+0x09,0x3D,0x75,0x08,0x01,0x75,0x89,0x11, -+0xE4,0x7B,0x60,0x7A,0x09,0xF9,0xF8,0xAF, -+0x0B,0xAE,0x0A,0xAD,0x09,0xAC,0x08,0x12, -+0x00,0x60,0xAA,0x06,0xAB,0x07,0xC3,0xE4, -+0x9B,0xFB,0xE4,0x9A,0xFA,0x78,0x17,0xF6, -+0xAF,0x03,0xEF,0x08,0xF6,0x18,0xE6,0xF5, -+0x8C,0x08,0xE6,0xF5,0x8A,0x74,0x0D,0x2B, -+0xFB,0xE4,0x3A,0x18,0xF6,0xAF,0x03,0xEF, -+0x08,0xF6,0x75,0x88,0x10,0x53,0x8E,0xC7, -+0xD2,0xA9,0x22,0x7D,0x02,0x7C,0x00,0x7F, -+0x4A,0x7E,0x13,0x12,0x06,0xE7,0x7D,0x46, -+0x7C,0x71,0x7F,0x02,0x7E,0x66,0x12,0x06, -+0xE7,0x7D,0x03,0x7C,0x00,0x7F,0x01,0x7E, -+0x66,0x12,0x06,0xE7,0x7D,0xC0,0x7C,0x00, -+0x7F,0x00,0x7E,0x66,0x12,0x06,0xE7,0xE4, -+0xFF,0xFE,0x0F,0xBF,0x00,0x01,0x0E,0xEF, -+0x64,0x64,0x4E,0x70,0xF5,0x7D,0x04,0x7C, -+0x00,0x7F,0x02,0x7E,0x66,0x12,0x06,0xE7, -+0x7D,0x00,0x7C,0x04,0x7F,0x01,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0xC0,0x7C,0x00,0x7F, -+0x00,0x7E,0x66,0x12,0x06,0xE7,0xE4,0xFD, -+0xFC,0x7F,0x02,0x7E,0x66,0x12,0x06,0xE7, -+0x7D,0x00,0x7C,0x04,0x7F,0x01,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0xC0,0x7C,0x00,0x7F, -+0x00,0x7E,0x66,0x12,0x06,0xE7,0xE4,0xFD, -+0xFC,0x7F,0x4A,0x7E,0x13,0x12,0x06,0xE7, -+0x7D,0x06,0x7C,0x71,0x7F,0x02,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0x03,0x7C,0x00,0x7F, -+0x01,0x7E,0x66,0x12,0x06,0xE7,0x7D,0xC0, -+0x7C,0x00,0x7F,0x00,0x7E,0x66,0x02,0x06, -+0xE7,0x78,0x7F,0xE4,0xF6,0xD8,0xFD,0x75, -+0x81,0x3C,0x02,0x05,0xDE,0x02,0x03,0x2F, -+0xE4,0x93,0xA3,0xF8,0xE4,0x93,0xA3,0x40, -+0x03,0xF6,0x80,0x01,0xF2,0x08,0xDF,0xF4, -+0x80,0x29,0xE4,0x93,0xA3,0xF8,0x54,0x07, -+0x24,0x0C,0xC8,0xC3,0x33,0xC4,0x54,0x0F, -+0x44,0x20,0xC8,0x83,0x40,0x04,0xF4,0x56, -+0x80,0x01,0x46,0xF6,0xDF,0xE4,0x80,0x0B, -+0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80, -+0x90,0x07,0x23,0xE4,0x7E,0x01,0x93,0x60, -+0xBC,0xA3,0xFF,0x54,0x3F,0x30,0xE5,0x09, -+0x54,0x1F,0xFE,0xE4,0x93,0xA3,0x60,0x01, -+0x0E,0xCF,0x54,0xC0,0x25,0xE0,0x60,0xA8, -+0x40,0xB8,0xE4,0x93,0xA3,0xFA,0xE4,0x93, -+0xA3,0xF8,0xE4,0x93,0xA3,0xC8,0xC5,0x82, -+0xC8,0xCA,0xC5,0x83,0xCA,0xF0,0xA3,0xC8, -+0xC5,0x82,0xC8,0xCA,0xC5,0x83,0xCA,0xDF, -+0xE9,0xDE,0xE7,0x80,0xBE,0x7D,0xD7,0x7C, -+0x04,0x7F,0x02,0x7E,0x66,0x12,0x06,0xE7, -+0x7D,0x80,0x7C,0x04,0x7F,0x01,0x7E,0x66, -+0x12,0x06,0xE7,0x7D,0xC0,0x7C,0x00,0x7F, -+0x00,0x7E,0x66,0x12,0x06,0xE7,0x7D,0x40, -+0x7C,0x17,0x7F,0x11,0x7E,0x1D,0x12,0x06, -+0xE7,0x7D,0xBB,0x7C,0x15,0x7F,0xEB,0x7E, -+0x13,0x12,0x06,0xE7,0x7D,0x0C,0x7C,0x00, -+0x7F,0xE7,0x7E,0x13,0x12,0x06,0xE7,0x7F, -+0x41,0x7E,0x1D,0x12,0x06,0xC3,0xEF,0x44, -+0x20,0x44,0x80,0xFD,0xAC,0x06,0x7F,0x41, -+0x7E,0x1D,0x12,0x06,0xE7,0x7D,0x40,0x7C, -+0x01,0x7F,0x00,0x7E,0x62,0x12,0x06,0xE7, -+0x02,0x02,0x2F,0xC0,0xE0,0xC0,0xF0,0xC0, -+0x83,0xC0,0x82,0xC0,0xD0,0x75,0xD0,0x00, -+0xC0,0x00,0x78,0x17,0xE6,0xF5,0x8C,0x78, -+0x18,0xE6,0xF5,0x8A,0x90,0x06,0x31,0xE4, -+0x75,0xF0,0x01,0x12,0x00,0x0E,0x90,0x06, -+0x33,0xE4,0x75,0xF0,0x01,0x12,0x00,0x0E, -+0xD0,0x00,0xD0,0xD0,0xD0,0x82,0xD0,0x83, -+0xD0,0xF0,0xD0,0xE0,0x32,0xC2,0xAF,0xAD, -+0x07,0xAC,0x06,0x8C,0xA2,0x8D,0xA3,0x75, -+0xA0,0x01,0x00,0x00,0x00,0x00,0x00,0x00, -+0x00,0x00,0x00,0x00,0x00,0xAE,0xA1,0xBE, -+0x00,0xF0,0xAE,0xA6,0xAF,0xA7,0xD2,0xAF, -+0x22,0xC2,0xAF,0xAB,0x07,0xAA,0x06,0x8A, -+0xA2,0x8B,0xA3,0x8C,0xA4,0x8D,0xA5,0x75, -+0xA0,0x03,0x00,0x00,0x00,0xAA,0xA1,0xBA, -+0x00,0xF8,0xD2,0xAF,0x22,0x7F,0x0C,0x7E, -+0x13,0x12,0x06,0xC3,0xEF,0x44,0x50,0xFD, -+0xAC,0x06,0x7F,0x0C,0x7E,0x13,0x02,0x06, -+0xE7,0x12,0x07,0x03,0x12,0x07,0x2E,0x12, -+0x04,0x2C,0x02,0x00,0x03,0x42,0x06,0x33, -+0x00,0x00,0x42,0x06,0x31,0x00,0x00,0x00, -+0xE4,0xF5,0x8E,0x22}; -+ -+static int rtl8367c_setAsicReg(struct rtl8366_smi *smi,u32 reg, u32 value); -+ -+struct rtl8367b_initval { -+ u16 reg; -+ u16 val; -+}; -+ -+static struct rtl8366_mib_counter -+rtl8367b_mib_counters[RTL8367B_NUM_MIB_COUNTERS] = { -+ {0, 0, 4, "ifInOctets" }, -+ {0, 4, 2, "dot3StatsFCSErrors" }, -+ {0, 6, 2, "dot3StatsSymbolErrors" }, -+ {0, 8, 2, "dot3InPauseFrames" }, -+ {0, 10, 2, "dot3ControlInUnknownOpcodes" }, -+ {0, 12, 2, "etherStatsFragments" }, -+ {0, 14, 2, "etherStatsJabbers" }, -+ {0, 16, 2, "ifInUcastPkts" }, -+ {0, 18, 2, "etherStatsDropEvents" }, -+ {0, 20, 2, "ifInMulticastPkts" }, -+ {0, 22, 2, "ifInBroadcastPkts" }, -+ {0, 24, 2, "inMldChecksumError" }, -+ {0, 26, 2, "inIgmpChecksumError" }, -+ {0, 28, 2, "inMldSpecificQuery" }, -+ {0, 30, 2, "inMldGeneralQuery" }, -+ {0, 32, 2, "inIgmpSpecificQuery" }, -+ {0, 34, 2, "inIgmpGeneralQuery" }, -+ {0, 36, 2, "inMldLeaves" }, -+ {0, 38, 2, "inIgmpLeaves" }, -+ -+ {0, 40, 4, "etherStatsOctets" }, -+ {0, 44, 2, "etherStatsUnderSizePkts" }, -+ {0, 46, 2, "etherOversizeStats" }, -+ {0, 48, 2, "etherStatsPkts64Octets" }, -+ {0, 50, 2, "etherStatsPkts65to127Octets" }, -+ {0, 52, 2, "etherStatsPkts128to255Octets" }, -+ {0, 54, 2, "etherStatsPkts256to511Octets" }, -+ {0, 56, 2, "etherStatsPkts512to1023Octets" }, -+ {0, 58, 2, "etherStatsPkts1024to1518Octets" }, -+ -+ {0, 60, 4, "ifOutOctets" }, -+ {0, 64, 2, "dot3StatsSingleCollisionFrames" }, -+ {0, 66, 2, "dot3StatMultipleCollisionFrames" }, -+ {0, 68, 2, "dot3sDeferredTransmissions" }, -+ {0, 70, 2, "dot3StatsLateCollisions" }, -+ {0, 72, 2, "etherStatsCollisions" }, -+ {0, 74, 2, "dot3StatsExcessiveCollisions" }, -+ {0, 76, 2, "dot3OutPauseFrames" }, -+ {0, 78, 2, "ifOutDiscards" }, -+ {0, 80, 2, "dot1dTpPortInDiscards" }, -+ {0, 82, 2, "ifOutUcastPkts" }, -+ {0, 84, 2, "ifOutMulticastPkts" }, -+ {0, 86, 2, "ifOutBroadcastPkts" }, -+ {0, 88, 2, "outOampduPkts" }, -+ {0, 90, 2, "inOampduPkts" }, -+ {0, 92, 2, "inIgmpJoinsSuccess" }, -+ {0, 94, 2, "inIgmpJoinsFail" }, -+ {0, 96, 2, "inMldJoinsSuccess" }, -+ {0, 98, 2, "inMldJoinsFail" }, -+ {0, 100, 2, "inReportSuppressionDrop" }, -+ {0, 102, 2, "inLeaveSuppressionDrop" }, -+ {0, 104, 2, "outIgmpReports" }, -+ {0, 106, 2, "outIgmpLeaves" }, -+ {0, 108, 2, "outIgmpGeneralQuery" }, -+ {0, 110, 2, "outIgmpSpecificQuery" }, -+ {0, 112, 2, "outMldReports" }, -+ {0, 114, 2, "outMldLeaves" }, -+ {0, 116, 2, "outMldGeneralQuery" }, -+ {0, 118, 2, "outMldSpecificQuery" }, -+ {0, 120, 2, "inKnownMulticastPkts" }, -+}; -+ -+#define REG_RD(_smi, _reg, _val) \ -+ do { \ -+ err = rtl8366_smi_read_reg(_smi, _reg, _val); \ -+ if (err) \ -+ return err; \ -+ } while (0) -+ -+#define REG_WR(_smi, _reg, _val) \ -+ do { \ -+ err = rtl8366_smi_write_reg(_smi, _reg, _val); \ -+ if (err) \ -+ return err; \ -+ } while (0) -+ -+#define REG_RMW(_smi, _reg, _mask, _val) \ -+ do { \ -+ err = rtl8366_smi_rmwr(_smi, _reg, _mask, _val); \ -+ if (err) \ -+ return err; \ -+ } while (0) -+ -+#define REG_RWBTS(_smi, _reg, _bits, _val) \ -+ do { \ -+ err = rtl8366_smi_rwbts(_smi, _reg, _bits, _val); \ -+ if (err) \ -+ return err; \ -+ } while (0) -+ -+#define REG_RWBT(_smi, _reg, _bit, _val) \ -+ do { \ -+ err = rtl8366_smi_rwbt(_smi, _reg, _bit, _val); \ -+ if (err) \ -+ return err; \ -+ } while (0) -+ -+#define REG_RDBT(_smi, _reg, _bit, _val) \ -+ do { \ -+ err = rtl8366_smi_rdbt(_smi, _reg, _bit, _val); \ -+ if (err) \ -+ return err; \ -+ } while (0) -+ -+#define REG_RDBTS(_smi, _reg, _bits, _val) \ -+ do { \ -+ err = rtl8366_smi_rdbts(_smi, _reg, _bits, _val); \ -+ if (err) \ -+ return err; \ -+ } while (0) -+ -+static const struct rtl8367b_initval rtl8367r_vb_initvals_0[] = { -+ {0x1B03, 0x0876}, {0x1200, 0x7FC4}, {0x0301, 0x0026}, {0x1722, 0x0E14}, -+ {0x205F, 0x0002}, {0x2059, 0x1A00}, {0x205F, 0x0000}, {0x207F, 0x0002}, -+ {0x2077, 0x0000}, {0x2078, 0x0000}, {0x2079, 0x0000}, {0x207A, 0x0000}, -+ {0x207B, 0x0000}, {0x207F, 0x0000}, {0x205F, 0x0002}, {0x2053, 0x0000}, -+ {0x2054, 0x0000}, {0x2055, 0x0000}, {0x2056, 0x0000}, {0x2057, 0x0000}, -+ {0x205F, 0x0000}, {0x12A4, 0x110A}, {0x12A6, 0x150A}, {0x13F1, 0x0013}, -+ {0x13F4, 0x0010}, {0x13F5, 0x0000}, {0x0018, 0x0F00}, {0x0038, 0x0F00}, -+ {0x0058, 0x0F00}, {0x0078, 0x0F00}, {0x0098, 0x0F00}, {0x12B6, 0x0C02}, -+ {0x12B7, 0x030F}, {0x12B8, 0x11FF}, {0x12BC, 0x0004}, {0x1362, 0x0115}, -+ {0x1363, 0x0002}, {0x1363, 0x0000}, {0x133F, 0x0030}, {0x133E, 0x000E}, -+ {0x221F, 0x0007}, {0x221E, 0x002D}, {0x2218, 0xF030}, {0x221F, 0x0007}, -+ {0x221E, 0x0023}, {0x2216, 0x0005}, {0x2215, 0x00B9}, {0x2219, 0x0044}, -+ {0x2215, 0x00BA}, {0x2219, 0x0020}, {0x2215, 0x00BB}, {0x2219, 0x00C1}, -+ {0x2215, 0x0148}, {0x2219, 0x0096}, {0x2215, 0x016E}, {0x2219, 0x0026}, -+ {0x2216, 0x0000}, {0x2216, 0x0000}, {0x221E, 0x002D}, {0x2218, 0xF010}, -+ {0x221F, 0x0007}, {0x221E, 0x0020}, {0x2215, 0x0D00}, {0x221F, 0x0000}, -+ {0x221F, 0x0000}, {0x2217, 0x2160}, {0x221F, 0x0001}, {0x2210, 0xF25E}, -+ {0x221F, 0x0007}, {0x221E, 0x0042}, {0x2215, 0x0F00}, {0x2215, 0x0F00}, -+ {0x2216, 0x7408}, {0x2215, 0x0E00}, {0x2215, 0x0F00}, {0x2215, 0x0F01}, -+ {0x2216, 0x4000}, {0x2215, 0x0E01}, {0x2215, 0x0F01}, {0x2215, 0x0F02}, -+ {0x2216, 0x9400}, {0x2215, 0x0E02}, {0x2215, 0x0F02}, {0x2215, 0x0F03}, -+ {0x2216, 0x7408}, {0x2215, 0x0E03}, {0x2215, 0x0F03}, {0x2215, 0x0F04}, -+ {0x2216, 0x4008}, {0x2215, 0x0E04}, {0x2215, 0x0F04}, {0x2215, 0x0F05}, -+ {0x2216, 0x9400}, {0x2215, 0x0E05}, {0x2215, 0x0F05}, {0x2215, 0x0F06}, -+ {0x2216, 0x0803}, {0x2215, 0x0E06}, {0x2215, 0x0F06}, {0x2215, 0x0D00}, -+ {0x2215, 0x0100}, {0x221F, 0x0001}, {0x2210, 0xF05E}, {0x221F, 0x0000}, -+ {0x2217, 0x2100}, {0x221F, 0x0000}, {0x220D, 0x0003}, {0x220E, 0x0015}, -+ {0x220D, 0x4003}, {0x220E, 0x0006}, {0x221F, 0x0000}, {0x2200, 0x1340}, -+ {0x133F, 0x0010}, {0x12A0, 0x0058}, {0x12A1, 0x0058}, {0x133E, 0x000E}, -+ {0x133F, 0x0030}, {0x221F, 0x0000}, {0x2210, 0x0166}, {0x221F, 0x0000}, -+ {0x133E, 0x000E}, {0x133F, 0x0010}, {0x133F, 0x0030}, {0x133E, 0x000E}, -+ {0x221F, 0x0005}, {0x2205, 0xFFF6}, {0x2206, 0x0080}, {0x2205, 0x8B6E}, -+ {0x2206, 0x0000}, {0x220F, 0x0100}, {0x2205, 0x8000}, {0x2206, 0x0280}, -+ {0x2206, 0x28F7}, {0x2206, 0x00E0}, {0x2206, 0xFFF7}, {0x2206, 0xA080}, -+ {0x2206, 0x02AE}, {0x2206, 0xF602}, {0x2206, 0x0153}, {0x2206, 0x0201}, -+ {0x2206, 0x6602}, {0x2206, 0x80B9}, {0x2206, 0xE08B}, {0x2206, 0x8CE1}, -+ {0x2206, 0x8B8D}, {0x2206, 0x1E01}, {0x2206, 0xE18B}, {0x2206, 0x8E1E}, -+ {0x2206, 0x01A0}, {0x2206, 0x00E7}, {0x2206, 0xAEDB}, {0x2206, 0xEEE0}, -+ {0x2206, 0x120E}, {0x2206, 0xEEE0}, {0x2206, 0x1300}, {0x2206, 0xEEE0}, -+ {0x2206, 0x2001}, {0x2206, 0xEEE0}, {0x2206, 0x2166}, {0x2206, 0xEEE0}, -+ {0x2206, 0xC463}, {0x2206, 0xEEE0}, {0x2206, 0xC5E8}, {0x2206, 0xEEE0}, -+ {0x2206, 0xC699}, {0x2206, 0xEEE0}, {0x2206, 0xC7C2}, {0x2206, 0xEEE0}, -+ {0x2206, 0xC801}, {0x2206, 0xEEE0}, {0x2206, 0xC913}, {0x2206, 0xEEE0}, -+ {0x2206, 0xCA30}, {0x2206, 0xEEE0}, {0x2206, 0xCB3E}, {0x2206, 0xEEE0}, -+ {0x2206, 0xDCE1}, {0x2206, 0xEEE0}, {0x2206, 0xDD00}, {0x2206, 0xEEE2}, -+ {0x2206, 0x0001}, {0x2206, 0xEEE2}, {0x2206, 0x0100}, {0x2206, 0xEEE4}, -+ {0x2206, 0x8860}, {0x2206, 0xEEE4}, {0x2206, 0x8902}, {0x2206, 0xEEE4}, -+ {0x2206, 0x8C00}, {0x2206, 0xEEE4}, {0x2206, 0x8D30}, {0x2206, 0xEEEA}, -+ {0x2206, 0x1480}, {0x2206, 0xEEEA}, {0x2206, 0x1503}, {0x2206, 0xEEEA}, -+ {0x2206, 0xC600}, {0x2206, 0xEEEA}, {0x2206, 0xC706}, {0x2206, 0xEE85}, -+ {0x2206, 0xEE00}, {0x2206, 0xEE85}, {0x2206, 0xEF00}, {0x2206, 0xEE8B}, -+ {0x2206, 0x6750}, {0x2206, 0xEE8B}, {0x2206, 0x6632}, {0x2206, 0xEE8A}, -+ {0x2206, 0xD448}, {0x2206, 0xEE8A}, {0x2206, 0xD548}, {0x2206, 0xEE8A}, -+ {0x2206, 0xD649}, {0x2206, 0xEE8A}, {0x2206, 0xD7F8}, {0x2206, 0xEE8B}, -+ {0x2206, 0x85E2}, {0x2206, 0xEE8B}, {0x2206, 0x8700}, {0x2206, 0xEEFF}, -+ {0x2206, 0xF600}, {0x2206, 0xEEFF}, {0x2206, 0xF7FC}, {0x2206, 0x04F8}, -+ {0x2206, 0xE08B}, {0x2206, 0x8EAD}, {0x2206, 0x2023}, {0x2206, 0xF620}, -+ {0x2206, 0xE48B}, {0x2206, 0x8E02}, {0x2206, 0x2877}, {0x2206, 0x0225}, -+ {0x2206, 0xC702}, {0x2206, 0x26A1}, {0x2206, 0x0281}, {0x2206, 0xB302}, -+ {0x2206, 0x8496}, {0x2206, 0x0202}, {0x2206, 0xA102}, {0x2206, 0x27F1}, -+ {0x2206, 0x0228}, {0x2206, 0xF902}, {0x2206, 0x2AA0}, {0x2206, 0x0282}, -+ {0x2206, 0xB8E0}, {0x2206, 0x8B8E}, {0x2206, 0xAD21}, {0x2206, 0x08F6}, -+ {0x2206, 0x21E4}, {0x2206, 0x8B8E}, {0x2206, 0x0202}, {0x2206, 0x80E0}, -+ {0x2206, 0x8B8E}, {0x2206, 0xAD22}, {0x2206, 0x05F6}, {0x2206, 0x22E4}, -+ {0x2206, 0x8B8E}, {0x2206, 0xE08B}, {0x2206, 0x8EAD}, {0x2206, 0x2305}, -+ {0x2206, 0xF623}, {0x2206, 0xE48B}, {0x2206, 0x8EE0}, {0x2206, 0x8B8E}, -+ {0x2206, 0xAD24}, {0x2206, 0x08F6}, {0x2206, 0x24E4}, {0x2206, 0x8B8E}, -+ {0x2206, 0x0227}, {0x2206, 0x6AE0}, {0x2206, 0x8B8E}, {0x2206, 0xAD25}, -+ {0x2206, 0x05F6}, {0x2206, 0x25E4}, {0x2206, 0x8B8E}, {0x2206, 0xE08B}, -+ {0x2206, 0x8EAD}, {0x2206, 0x260B}, {0x2206, 0xF626}, {0x2206, 0xE48B}, -+ {0x2206, 0x8E02}, {0x2206, 0x830D}, {0x2206, 0x021D}, {0x2206, 0x6BE0}, -+ {0x2206, 0x8B8E}, {0x2206, 0xAD27}, {0x2206, 0x05F6}, {0x2206, 0x27E4}, -+ {0x2206, 0x8B8E}, {0x2206, 0x0281}, {0x2206, 0x4402}, {0x2206, 0x045C}, -+ {0x2206, 0xFC04}, {0x2206, 0xF8E0}, {0x2206, 0x8B83}, {0x2206, 0xAD23}, -+ {0x2206, 0x30E0}, {0x2206, 0xE022}, {0x2206, 0xE1E0}, {0x2206, 0x2359}, -+ {0x2206, 0x02E0}, {0x2206, 0x85EF}, {0x2206, 0xE585}, {0x2206, 0xEFAC}, -+ {0x2206, 0x2907}, {0x2206, 0x1F01}, {0x2206, 0x9E51}, {0x2206, 0xAD29}, -+ {0x2206, 0x20E0}, {0x2206, 0x8B83}, {0x2206, 0xAD21}, {0x2206, 0x06E1}, -+ {0x2206, 0x8B84}, {0x2206, 0xAD28}, {0x2206, 0x42E0}, {0x2206, 0x8B85}, -+ {0x2206, 0xAD21}, {0x2206, 0x06E1}, {0x2206, 0x8B84}, {0x2206, 0xAD29}, -+ {0x2206, 0x36BF}, {0x2206, 0x34BF}, {0x2206, 0x022C}, {0x2206, 0x31AE}, -+ {0x2206, 0x2EE0}, {0x2206, 0x8B83}, {0x2206, 0xAD21}, {0x2206, 0x10E0}, -+ {0x2206, 0x8B84}, {0x2206, 0xF620}, {0x2206, 0xE48B}, {0x2206, 0x84EE}, -+ {0x2206, 0x8ADA}, {0x2206, 0x00EE}, {0x2206, 0x8ADB}, {0x2206, 0x00E0}, -+ {0x2206, 0x8B85}, {0x2206, 0xAD21}, {0x2206, 0x0CE0}, {0x2206, 0x8B84}, -+ {0x2206, 0xF621}, {0x2206, 0xE48B}, {0x2206, 0x84EE}, {0x2206, 0x8B72}, -+ {0x2206, 0xFFBF}, {0x2206, 0x34C2}, {0x2206, 0x022C}, {0x2206, 0x31FC}, -+ {0x2206, 0x04F8}, {0x2206, 0xFAEF}, {0x2206, 0x69E0}, {0x2206, 0x8B85}, -+ {0x2206, 0xAD21}, {0x2206, 0x42E0}, {0x2206, 0xE022}, {0x2206, 0xE1E0}, -+ {0x2206, 0x2358}, {0x2206, 0xC059}, {0x2206, 0x021E}, {0x2206, 0x01E1}, -+ {0x2206, 0x8B72}, {0x2206, 0x1F10}, {0x2206, 0x9E2F}, {0x2206, 0xE48B}, -+ {0x2206, 0x72AD}, {0x2206, 0x2123}, {0x2206, 0xE18B}, {0x2206, 0x84F7}, -+ {0x2206, 0x29E5}, {0x2206, 0x8B84}, {0x2206, 0xAC27}, {0x2206, 0x10AC}, -+ {0x2206, 0x2605}, {0x2206, 0x0205}, {0x2206, 0x23AE}, {0x2206, 0x1602}, -+ {0x2206, 0x0535}, {0x2206, 0x0282}, {0x2206, 0x30AE}, {0x2206, 0x0E02}, -+ {0x2206, 0x056A}, {0x2206, 0x0282}, {0x2206, 0x75AE}, {0x2206, 0x0602}, -+ {0x2206, 0x04DC}, {0x2206, 0x0282}, {0x2206, 0x04EF}, {0x2206, 0x96FE}, -+ {0x2206, 0xFC04}, {0x2206, 0xF8F9}, {0x2206, 0xE08B}, {0x2206, 0x87AD}, -+ {0x2206, 0x2321}, {0x2206, 0xE0EA}, {0x2206, 0x14E1}, {0x2206, 0xEA15}, -+ {0x2206, 0xAD26}, {0x2206, 0x18F6}, {0x2206, 0x27E4}, {0x2206, 0xEA14}, -+ {0x2206, 0xE5EA}, {0x2206, 0x15F6}, {0x2206, 0x26E4}, {0x2206, 0xEA14}, -+ {0x2206, 0xE5EA}, {0x2206, 0x15F7}, {0x2206, 0x27E4}, {0x2206, 0xEA14}, -+ {0x2206, 0xE5EA}, {0x2206, 0x15FD}, {0x2206, 0xFC04}, {0x2206, 0xF8F9}, -+ {0x2206, 0xE08B}, {0x2206, 0x87AD}, {0x2206, 0x233A}, {0x2206, 0xAD22}, -+ {0x2206, 0x37E0}, {0x2206, 0xE020}, {0x2206, 0xE1E0}, {0x2206, 0x21AC}, -+ {0x2206, 0x212E}, {0x2206, 0xE0EA}, {0x2206, 0x14E1}, {0x2206, 0xEA15}, -+ {0x2206, 0xF627}, {0x2206, 0xE4EA}, {0x2206, 0x14E5}, {0x2206, 0xEA15}, -+ {0x2206, 0xE2EA}, {0x2206, 0x12E3}, {0x2206, 0xEA13}, {0x2206, 0x5A8F}, -+ {0x2206, 0x6A20}, {0x2206, 0xE6EA}, {0x2206, 0x12E7}, {0x2206, 0xEA13}, -+ {0x2206, 0xF726}, {0x2206, 0xE4EA}, {0x2206, 0x14E5}, {0x2206, 0xEA15}, -+ {0x2206, 0xF727}, {0x2206, 0xE4EA}, {0x2206, 0x14E5}, {0x2206, 0xEA15}, -+ {0x2206, 0xFDFC}, {0x2206, 0x04F8}, {0x2206, 0xF9E0}, {0x2206, 0x8B87}, -+ {0x2206, 0xAD23}, {0x2206, 0x38AD}, {0x2206, 0x2135}, {0x2206, 0xE0E0}, -+ {0x2206, 0x20E1}, {0x2206, 0xE021}, {0x2206, 0xAC21}, {0x2206, 0x2CE0}, -+ {0x2206, 0xEA14}, {0x2206, 0xE1EA}, {0x2206, 0x15F6}, {0x2206, 0x27E4}, -+ {0x2206, 0xEA14}, {0x2206, 0xE5EA}, {0x2206, 0x15E2}, {0x2206, 0xEA12}, -+ {0x2206, 0xE3EA}, {0x2206, 0x135A}, {0x2206, 0x8FE6}, {0x2206, 0xEA12}, -+ {0x2206, 0xE7EA}, {0x2206, 0x13F7}, {0x2206, 0x26E4}, {0x2206, 0xEA14}, -+ {0x2206, 0xE5EA}, {0x2206, 0x15F7}, {0x2206, 0x27E4}, {0x2206, 0xEA14}, -+ {0x2206, 0xE5EA}, {0x2206, 0x15FD}, {0x2206, 0xFC04}, {0x2206, 0xF8FA}, -+ {0x2206, 0xEF69}, {0x2206, 0xE08B}, {0x2206, 0x86AD}, {0x2206, 0x2146}, -+ {0x2206, 0xE0E0}, {0x2206, 0x22E1}, {0x2206, 0xE023}, {0x2206, 0x58C0}, -+ {0x2206, 0x5902}, {0x2206, 0x1E01}, {0x2206, 0xE18B}, {0x2206, 0x651F}, -+ {0x2206, 0x109E}, {0x2206, 0x33E4}, {0x2206, 0x8B65}, {0x2206, 0xAD21}, -+ {0x2206, 0x22AD}, {0x2206, 0x272A}, {0x2206, 0xD400}, {0x2206, 0x01BF}, -+ {0x2206, 0x34F2}, {0x2206, 0x022C}, {0x2206, 0xA2BF}, {0x2206, 0x34F5}, -+ {0x2206, 0x022C}, {0x2206, 0xE0E0}, {0x2206, 0x8B67}, {0x2206, 0x1B10}, -+ {0x2206, 0xAA14}, {0x2206, 0xE18B}, {0x2206, 0x660D}, {0x2206, 0x1459}, -+ {0x2206, 0x0FAE}, {0x2206, 0x05E1}, {0x2206, 0x8B66}, {0x2206, 0x590F}, -+ {0x2206, 0xBF85}, {0x2206, 0x6102}, {0x2206, 0x2CA2}, {0x2206, 0xEF96}, -+ {0x2206, 0xFEFC}, {0x2206, 0x04F8}, {0x2206, 0xF9FA}, {0x2206, 0xFBEF}, -+ {0x2206, 0x79E2}, {0x2206, 0x8AD2}, {0x2206, 0xAC19}, {0x2206, 0x2DE0}, -+ {0x2206, 0xE036}, {0x2206, 0xE1E0}, {0x2206, 0x37EF}, {0x2206, 0x311F}, -+ {0x2206, 0x325B}, {0x2206, 0x019E}, {0x2206, 0x1F7A}, {0x2206, 0x0159}, -+ {0x2206, 0x019F}, {0x2206, 0x0ABF}, {0x2206, 0x348E}, {0x2206, 0x022C}, -+ {0x2206, 0x31F6}, {0x2206, 0x06AE}, {0x2206, 0x0FF6}, {0x2206, 0x0302}, -+ {0x2206, 0x0470}, {0x2206, 0xF703}, {0x2206, 0xF706}, {0x2206, 0xBF34}, -+ {0x2206, 0x9302}, {0x2206, 0x2C31}, {0x2206, 0xAC1A}, {0x2206, 0x25E0}, -+ {0x2206, 0xE022}, {0x2206, 0xE1E0}, {0x2206, 0x23EF}, {0x2206, 0x300D}, -+ {0x2206, 0x311F}, {0x2206, 0x325B}, {0x2206, 0x029E}, {0x2206, 0x157A}, -+ {0x2206, 0x0258}, {0x2206, 0xC4A0}, {0x2206, 0x0408}, {0x2206, 0xBF34}, -+ {0x2206, 0x9E02}, {0x2206, 0x2C31}, {0x2206, 0xAE06}, {0x2206, 0xBF34}, -+ {0x2206, 0x9C02}, {0x2206, 0x2C31}, {0x2206, 0xAC1B}, {0x2206, 0x4AE0}, -+ {0x2206, 0xE012}, {0x2206, 0xE1E0}, {0x2206, 0x13EF}, {0x2206, 0x300D}, -+ {0x2206, 0x331F}, {0x2206, 0x325B}, {0x2206, 0x1C9E}, {0x2206, 0x3AEF}, -+ {0x2206, 0x325B}, {0x2206, 0x1C9F}, {0x2206, 0x09BF}, {0x2206, 0x3498}, -+ {0x2206, 0x022C}, {0x2206, 0x3102}, {0x2206, 0x83C5}, {0x2206, 0x5A03}, -+ {0x2206, 0x0D03}, {0x2206, 0x581C}, {0x2206, 0x1E20}, {0x2206, 0x0207}, -+ {0x2206, 0xA0A0}, {0x2206, 0x000E}, {0x2206, 0x0284}, {0x2206, 0x17AD}, -+ {0x2206, 0x1817}, {0x2206, 0xBF34}, {0x2206, 0x9A02}, {0x2206, 0x2C31}, -+ {0x2206, 0xAE0F}, {0x2206, 0xBF34}, {0x2206, 0xC802}, {0x2206, 0x2C31}, -+ {0x2206, 0xBF34}, {0x2206, 0xC502}, {0x2206, 0x2C31}, {0x2206, 0x0284}, -+ {0x2206, 0x52E6}, {0x2206, 0x8AD2}, {0x2206, 0xEF97}, {0x2206, 0xFFFE}, -+ {0x2206, 0xFDFC}, {0x2206, 0x04F8}, {0x2206, 0xBF34}, {0x2206, 0xDA02}, -+ {0x2206, 0x2CE0}, {0x2206, 0xE58A}, {0x2206, 0xD3BF}, {0x2206, 0x34D4}, -+ {0x2206, 0x022C}, {0x2206, 0xE00C}, {0x2206, 0x1159}, {0x2206, 0x02E0}, -+ {0x2206, 0x8AD3}, {0x2206, 0x1E01}, {0x2206, 0xE48A}, {0x2206, 0xD3D1}, -+ {0x2206, 0x00BF}, {0x2206, 0x34DA}, {0x2206, 0x022C}, {0x2206, 0xA2D1}, -+ {0x2206, 0x01BF}, {0x2206, 0x34D4}, {0x2206, 0x022C}, {0x2206, 0xA2BF}, -+ {0x2206, 0x34CB}, {0x2206, 0x022C}, {0x2206, 0xE0E5}, {0x2206, 0x8ACE}, -+ {0x2206, 0xBF85}, {0x2206, 0x6702}, {0x2206, 0x2CE0}, {0x2206, 0xE58A}, -+ {0x2206, 0xCFBF}, {0x2206, 0x8564}, {0x2206, 0x022C}, {0x2206, 0xE0E5}, -+ {0x2206, 0x8AD0}, {0x2206, 0xBF85}, {0x2206, 0x6A02}, {0x2206, 0x2CE0}, -+ {0x2206, 0xE58A}, {0x2206, 0xD1FC}, {0x2206, 0x04F8}, {0x2206, 0xE18A}, -+ {0x2206, 0xD1BF}, {0x2206, 0x856A}, {0x2206, 0x022C}, {0x2206, 0xA2E1}, -+ {0x2206, 0x8AD0}, {0x2206, 0xBF85}, {0x2206, 0x6402}, {0x2206, 0x2CA2}, -+ {0x2206, 0xE18A}, {0x2206, 0xCFBF}, {0x2206, 0x8567}, {0x2206, 0x022C}, -+ {0x2206, 0xA2E1}, {0x2206, 0x8ACE}, {0x2206, 0xBF34}, {0x2206, 0xCB02}, -+ {0x2206, 0x2CA2}, {0x2206, 0xE18A}, {0x2206, 0xD3BF}, {0x2206, 0x34DA}, -+ {0x2206, 0x022C}, {0x2206, 0xA2E1}, {0x2206, 0x8AD3}, {0x2206, 0x0D11}, -+ {0x2206, 0xBF34}, {0x2206, 0xD402}, {0x2206, 0x2CA2}, {0x2206, 0xFC04}, -+ {0x2206, 0xF9A0}, {0x2206, 0x0405}, {0x2206, 0xE38A}, {0x2206, 0xD4AE}, -+ {0x2206, 0x13A0}, {0x2206, 0x0805}, {0x2206, 0xE38A}, {0x2206, 0xD5AE}, -+ {0x2206, 0x0BA0}, {0x2206, 0x0C05}, {0x2206, 0xE38A}, {0x2206, 0xD6AE}, -+ {0x2206, 0x03E3}, {0x2206, 0x8AD7}, {0x2206, 0xEF13}, {0x2206, 0xBF34}, -+ {0x2206, 0xCB02}, {0x2206, 0x2CA2}, {0x2206, 0xEF13}, {0x2206, 0x0D11}, -+ {0x2206, 0xBF85}, {0x2206, 0x6702}, {0x2206, 0x2CA2}, {0x2206, 0xEF13}, -+ {0x2206, 0x0D14}, {0x2206, 0xBF85}, {0x2206, 0x6402}, {0x2206, 0x2CA2}, -+ {0x2206, 0xEF13}, {0x2206, 0x0D17}, {0x2206, 0xBF85}, {0x2206, 0x6A02}, -+ {0x2206, 0x2CA2}, {0x2206, 0xFD04}, {0x2206, 0xF8E0}, {0x2206, 0x8B85}, -+ {0x2206, 0xAD27}, {0x2206, 0x2DE0}, {0x2206, 0xE036}, {0x2206, 0xE1E0}, -+ {0x2206, 0x37E1}, {0x2206, 0x8B73}, {0x2206, 0x1F10}, {0x2206, 0x9E20}, -+ {0x2206, 0xE48B}, {0x2206, 0x73AC}, {0x2206, 0x200B}, {0x2206, 0xAC21}, -+ {0x2206, 0x0DAC}, {0x2206, 0x250F}, {0x2206, 0xAC27}, {0x2206, 0x0EAE}, -+ {0x2206, 0x0F02}, {0x2206, 0x84CC}, {0x2206, 0xAE0A}, {0x2206, 0x0284}, -+ {0x2206, 0xD1AE}, {0x2206, 0x05AE}, {0x2206, 0x0302}, {0x2206, 0x84D8}, -+ {0x2206, 0xFC04}, {0x2206, 0xEE8B}, {0x2206, 0x6800}, {0x2206, 0x0402}, -+ {0x2206, 0x84E5}, {0x2206, 0x0285}, {0x2206, 0x2804}, {0x2206, 0x0285}, -+ {0x2206, 0x4904}, {0x2206, 0xEE8B}, {0x2206, 0x6800}, {0x2206, 0xEE8B}, -+ {0x2206, 0x6902}, {0x2206, 0x04F8}, {0x2206, 0xF9E0}, {0x2206, 0x8B85}, -+ {0x2206, 0xAD26}, {0x2206, 0x38D0}, {0x2206, 0x0B02}, {0x2206, 0x2B4D}, -+ {0x2206, 0x5882}, {0x2206, 0x7882}, {0x2206, 0x9F2D}, {0x2206, 0xE08B}, -+ {0x2206, 0x68E1}, {0x2206, 0x8B69}, {0x2206, 0x1F10}, {0x2206, 0x9EC8}, -+ {0x2206, 0x10E4}, {0x2206, 0x8B68}, {0x2206, 0xE0E0}, {0x2206, 0x00E1}, -+ {0x2206, 0xE001}, {0x2206, 0xF727}, {0x2206, 0xE4E0}, {0x2206, 0x00E5}, -+ {0x2206, 0xE001}, {0x2206, 0xE2E0}, {0x2206, 0x20E3}, {0x2206, 0xE021}, -+ {0x2206, 0xAD30}, {0x2206, 0xF7F6}, {0x2206, 0x27E4}, {0x2206, 0xE000}, -+ {0x2206, 0xE5E0}, {0x2206, 0x01FD}, {0x2206, 0xFC04}, {0x2206, 0xF8FA}, -+ {0x2206, 0xEF69}, {0x2206, 0xE08B}, {0x2206, 0x86AD}, {0x2206, 0x2212}, -+ {0x2206, 0xE0E0}, {0x2206, 0x14E1}, {0x2206, 0xE015}, {0x2206, 0xAD26}, -+ {0x2206, 0x9CE1}, {0x2206, 0x85E0}, {0x2206, 0xBF85}, {0x2206, 0x6D02}, -+ {0x2206, 0x2CA2}, {0x2206, 0xEF96}, {0x2206, 0xFEFC}, {0x2206, 0x04F8}, -+ {0x2206, 0xFAEF}, {0x2206, 0x69E0}, {0x2206, 0x8B86}, {0x2206, 0xAD22}, -+ {0x2206, 0x09E1}, {0x2206, 0x85E1}, {0x2206, 0xBF85}, {0x2206, 0x6D02}, -+ {0x2206, 0x2CA2}, {0x2206, 0xEF96}, {0x2206, 0xFEFC}, {0x2206, 0x0464}, -+ {0x2206, 0xE48C}, {0x2206, 0xFDE4}, {0x2206, 0x80CA}, {0x2206, 0xE480}, -+ {0x2206, 0x66E0}, {0x2206, 0x8E70}, {0x2206, 0xE076}, {0x2205, 0xE142}, -+ {0x2206, 0x0701}, {0x2205, 0xE140}, {0x2206, 0x0405}, {0x220F, 0x0000}, -+ {0x221F, 0x0000}, {0x2200, 0x1340}, {0x133E, 0x000E}, {0x133F, 0x0010}, -+ {0x13EB, 0x11BB} -+}; -+ -+static const struct rtl8367b_initval rtl8367r_vb_initvals_1[] = { -+ {0x1B03, 0x0876}, {0x1200, 0x7FC4}, {0x1305, 0xC000}, {0x121E, 0x03CA}, -+ {0x1233, 0x0352}, {0x1234, 0x0064}, {0x1237, 0x0096}, {0x1238, 0x0078}, -+ {0x1239, 0x0084}, {0x123A, 0x0030}, {0x205F, 0x0002}, {0x2059, 0x1A00}, -+ {0x205F, 0x0000}, {0x207F, 0x0002}, {0x2077, 0x0000}, {0x2078, 0x0000}, -+ {0x2079, 0x0000}, {0x207A, 0x0000}, {0x207B, 0x0000}, {0x207F, 0x0000}, -+ {0x205F, 0x0002}, {0x2053, 0x0000}, {0x2054, 0x0000}, {0x2055, 0x0000}, -+ {0x2056, 0x0000}, {0x2057, 0x0000}, {0x205F, 0x0000}, {0x133F, 0x0030}, -+ {0x133E, 0x000E}, {0x221F, 0x0005}, {0x2205, 0x8B86}, {0x2206, 0x800E}, -+ {0x221F, 0x0000}, {0x133F, 0x0010}, {0x12A3, 0x2200}, {0x6107, 0xE58B}, -+ {0x6103, 0xA970}, {0x0018, 0x0F00}, {0x0038, 0x0F00}, {0x0058, 0x0F00}, -+ {0x0078, 0x0F00}, {0x0098, 0x0F00}, {0x133F, 0x0030}, {0x133E, 0x000E}, -+ {0x221F, 0x0005}, {0x2205, 0x8B6E}, {0x2206, 0x0000}, {0x220F, 0x0100}, -+ {0x2205, 0xFFF6}, {0x2206, 0x0080}, {0x2205, 0x8000}, {0x2206, 0x0280}, -+ {0x2206, 0x2BF7}, {0x2206, 0x00E0}, {0x2206, 0xFFF7}, {0x2206, 0xA080}, -+ {0x2206, 0x02AE}, {0x2206, 0xF602}, {0x2206, 0x0153}, {0x2206, 0x0201}, -+ {0x2206, 0x6602}, {0x2206, 0x8044}, {0x2206, 0x0201}, {0x2206, 0x7CE0}, -+ {0x2206, 0x8B8C}, {0x2206, 0xE18B}, {0x2206, 0x8D1E}, {0x2206, 0x01E1}, -+ {0x2206, 0x8B8E}, {0x2206, 0x1E01}, {0x2206, 0xA000}, {0x2206, 0xE4AE}, -+ {0x2206, 0xD8EE}, {0x2206, 0x85C0}, {0x2206, 0x00EE}, {0x2206, 0x85C1}, -+ {0x2206, 0x00EE}, {0x2206, 0x8AFC}, {0x2206, 0x07EE}, {0x2206, 0x8AFD}, -+ {0x2206, 0x73EE}, {0x2206, 0xFFF6}, {0x2206, 0x00EE}, {0x2206, 0xFFF7}, -+ {0x2206, 0xFC04}, {0x2206, 0xF8E0}, {0x2206, 0x8B8E}, {0x2206, 0xAD20}, -+ {0x2206, 0x0302}, {0x2206, 0x8050}, {0x2206, 0xFC04}, {0x2206, 0xF8F9}, -+ {0x2206, 0xE08B}, {0x2206, 0x85AD}, {0x2206, 0x2548}, {0x2206, 0xE08A}, -+ {0x2206, 0xE4E1}, {0x2206, 0x8AE5}, {0x2206, 0x7C00}, {0x2206, 0x009E}, -+ {0x2206, 0x35EE}, {0x2206, 0x8AE4}, {0x2206, 0x00EE}, {0x2206, 0x8AE5}, -+ {0x2206, 0x00E0}, {0x2206, 0x8AFC}, {0x2206, 0xE18A}, {0x2206, 0xFDE2}, -+ {0x2206, 0x85C0}, {0x2206, 0xE385}, {0x2206, 0xC102}, {0x2206, 0x2DAC}, -+ {0x2206, 0xAD20}, {0x2206, 0x12EE}, {0x2206, 0x8AE4}, {0x2206, 0x03EE}, -+ {0x2206, 0x8AE5}, {0x2206, 0xB7EE}, {0x2206, 0x85C0}, {0x2206, 0x00EE}, -+ {0x2206, 0x85C1}, {0x2206, 0x00AE}, {0x2206, 0x1115}, {0x2206, 0xE685}, -+ {0x2206, 0xC0E7}, {0x2206, 0x85C1}, {0x2206, 0xAE08}, {0x2206, 0xEE85}, -+ {0x2206, 0xC000}, {0x2206, 0xEE85}, {0x2206, 0xC100}, {0x2206, 0xFDFC}, -+ {0x2206, 0x0400}, {0x2205, 0xE142}, {0x2206, 0x0701}, {0x2205, 0xE140}, -+ {0x2206, 0x0405}, {0x220F, 0x0000}, {0x221F, 0x0000}, {0x133E, 0x000E}, -+ {0x133F, 0x0010}, {0x13EB, 0x11BB}, {0x207F, 0x0002}, {0x2073, 0x1D22}, -+ {0x207F, 0x0000}, {0x133F, 0x0030}, {0x133E, 0x000E}, {0x2200, 0x1340}, -+ {0x133E, 0x000E}, {0x133F, 0x0010}, -+}; -+ -+static const struct rtl8367b_initval rtl8367s_initvals0[] = { -+ {0x13c2, 0x0000}, {0x0018, 0x0f00}, {0x0038, 0x0f00}, {0x0058, 0x0f00}, -+ {0x0078, 0x0f00}, {0x0098, 0x0f00}, {0x1d15, 0x0a69}, {0x2000, 0x1340}, -+ {0x2020, 0x1340}, {0x2040, 0x1340}, {0x2060, 0x1340}, {0x2080, 0x1340}, -+ {0x13eb, 0x15bb}, {0x1303, 0x06d6}, {0x1304, 0x0700}, {0x13E2, 0x003F}, -+ {0x13F9, 0x0090}, {0x121e, 0x03CA}, {0x1233, 0x0352}, {0x1237, 0x00a0}, -+ {0x123a, 0x0030}, {0x1239, 0x0084}, {0x0301, 0x1000}, {0x1349, 0x001F}, -+ {0x18e0, 0x4004}, {0x122b, 0x641c}, {0x1305, 0xc000}, {0x1200, 0x7fcb}, -+ {0x0884, 0x0003}, {0x06eb, 0x0001}, {0x00cf, 0xffff}, {0x00d0, 0x0007}, -+ {0x00ce, 0x48b0}, {0x00ce, 0x48b0}, {0x0398, 0xffff}, {0x0399, 0x0007}, -+ {0x0300, 0x0001}, {0x03fa, 0x0007}, {0x08c8, 0x00c0}, {0x0a30, 0x020e}, -+ {0x0800, 0x0000}, {0x0802, 0x0000}, {0x09da, 0x0017}, {0x1d32, 0x0002}, -+}; -+ -+static int rtl8367b_write_initvals(struct rtl8366_smi *smi, -+ const struct rtl8367b_initval *initvals, -+ int count) -+{ -+ int err; -+ int i; -+ -+ for (i = 0; i < count; i++) -+ REG_WR(smi, initvals[i].reg, initvals[i].val); -+ -+ return 0; -+} -+ -+static int rtl8367b_read_phy_reg(struct rtl8366_smi *smi, -+ u32 phy_addr, u32 phy_reg, u32 *val) -+{ -+ int timeout; -+ u32 data; -+ int err; -+ -+ if (phy_addr > RTL8367B_PHY_ADDR_MAX) -+ return -EINVAL; -+ -+ if (phy_reg > RTL8367B_PHY_REG_MAX) -+ return -EINVAL; -+ -+ REG_RD(smi, RTL8367B_IA_STATUS_REG, &data); -+ if (data & RTL8367B_IA_STATUS_PHY_BUSY) -+ return -ETIMEDOUT; -+ -+ /* prepare address */ -+ REG_WR(smi, RTL8367B_IA_ADDRESS_REG, -+ RTL8367B_INTERNAL_PHY_REG(phy_addr, phy_reg)); -+ -+ /* send read command */ -+ REG_WR(smi, RTL8367B_IA_CTRL_REG, -+ RTL8367B_IA_CTRL_CMD_MASK | RTL8367B_IA_CTRL_RW_READ); -+ -+ timeout = 5; -+ do { -+ REG_RD(smi, RTL8367B_IA_STATUS_REG, &data); -+ if ((data & RTL8367B_IA_STATUS_PHY_BUSY) == 0) -+ break; -+ -+ if (timeout--) { -+ dev_err(smi->parent, "phy read timed out\n"); -+ return -ETIMEDOUT; -+ } -+ -+ udelay(1); -+ } while (1); -+ -+ /* read data */ -+ REG_RD(smi, RTL8367B_IA_READ_DATA_REG, val); -+ -+ dev_dbg(smi->parent, "phy_read: addr:%02x, reg:%02x, val:%04x\n", -+ phy_addr, phy_reg, *val); -+ return 0; -+} -+ -+static int rtl8367b_write_phy_reg(struct rtl8366_smi *smi, -+ u32 phy_addr, u32 phy_reg, u32 val) -+{ -+ int timeout; -+ u32 data; -+ int err; -+ -+ dev_dbg(smi->parent, "phy_write: addr:%02x, reg:%02x, val:%04x\n", -+ phy_addr, phy_reg, val); -+ -+ if (phy_addr > RTL8367B_PHY_ADDR_MAX) -+ return -EINVAL; -+ -+ if (phy_reg > RTL8367B_PHY_REG_MAX) -+ return -EINVAL; -+ -+ REG_RD(smi, RTL8367B_IA_STATUS_REG, &data); -+ if (data & RTL8367B_IA_STATUS_PHY_BUSY) -+ return -ETIMEDOUT; -+ -+ /* preapre data */ -+ REG_WR(smi, RTL8367B_IA_WRITE_DATA_REG, val); -+ -+ /* prepare address */ -+ REG_WR(smi, RTL8367B_IA_ADDRESS_REG, -+ RTL8367B_INTERNAL_PHY_REG(phy_addr, phy_reg)); -+ -+ /* send write command */ -+ REG_WR(smi, RTL8367B_IA_CTRL_REG, -+ RTL8367B_IA_CTRL_CMD_MASK | RTL8367B_IA_CTRL_RW_WRITE); -+ -+ timeout = 5; -+ do { -+ REG_RD(smi, RTL8367B_IA_STATUS_REG, &data); -+ if ((data & RTL8367B_IA_STATUS_PHY_BUSY) == 0) -+ break; -+ -+ if (timeout--) { -+ dev_err(smi->parent, "phy write timed out\n"); -+ return -ETIMEDOUT; -+ } -+ -+ udelay(1); -+ } while (1); -+ -+ return 0; -+} -+ -+static int rtl8367b_init_regs(struct rtl8366_smi *smi) -+{ -+ const struct rtl8367b_initval *initvals; -+ u32 chip_ver; -+ u32 rlvid; -+ int count; -+ int err; -+ -+ REG_WR(smi, RTL8367B_RTL_MAGIC_ID_REG, RTL8367B_RTL_MAGIC_ID_VAL); -+ REG_RD(smi, RTL8367B_CHIP_VER_REG, &chip_ver); -+ -+ rlvid = (chip_ver >> RTL8367B_CHIP_VER_RLVID_SHIFT) & -+ RTL8367B_CHIP_VER_RLVID_MASK; -+ -+ if (of_device_is_compatible(smi->parent->of_node, -+ "realtek,rtl8367s")) { -+ initvals = rtl8367s_initvals0; -+ count = ARRAY_SIZE(rtl8367s_initvals0); -+ } else { -+ switch (rlvid) { -+ case 0: -+ initvals = rtl8367r_vb_initvals_0; -+ count = ARRAY_SIZE(rtl8367r_vb_initvals_0); -+ break; -+ -+ case 1: -+ initvals = rtl8367r_vb_initvals_1; -+ count = ARRAY_SIZE(rtl8367r_vb_initvals_1); -+ break; -+ -+ default: -+ dev_err(smi->parent, "unknow rlvid %u\n", rlvid); -+ return -ENODEV; -+ } -+ } -+ -+ /* TODO: disable RLTP */ -+ -+ return rtl8367b_write_initvals(smi, initvals, count); -+} -+ -+static int rtl8367b_reset_chip(struct rtl8366_smi *smi) -+{ -+ int timeout = 10; -+ int err; -+ u32 data; -+ -+ REG_WR(smi, RTL8367B_CHIP_RESET_REG, RTL8367B_CHIP_RESET_HW); -+ msleep(RTL8367B_RESET_DELAY); -+ -+ do { -+ REG_RD(smi, RTL8367B_CHIP_RESET_REG, &data); -+ if (!(data & RTL8367B_CHIP_RESET_HW)) -+ break; -+ -+ msleep(1); -+ } while (--timeout); -+ -+ if (!timeout) { -+ dev_err(smi->parent, "chip reset timed out\n"); -+ return -ETIMEDOUT; -+ } -+ -+ return 0; -+} -+ -+static int rtl8367b_extif_set_mode(struct rtl8366_smi *smi, int id, -+ enum rtl8367_extif_mode mode) -+{ -+ int err; -+ -+ /* set port mode */ -+ switch (mode) { -+ case RTL8367_EXTIF_MODE_RGMII: -+ case RTL8367_EXTIF_MODE_RGMII_33V: -+ REG_WR(smi, RTL8367B_CHIP_DEBUG0_REG, 0x0367); -+ REG_WR(smi, RTL8367B_CHIP_DEBUG1_REG, 0x7777); -+ break; -+ -+ case RTL8367_EXTIF_MODE_TMII_MAC: -+ case RTL8367_EXTIF_MODE_TMII_PHY: -+ REG_RMW(smi, RTL8367B_BYPASS_LINE_RATE_REG, -+ BIT((id + 1) % 2), BIT((id + 1) % 2)); -+ break; -+ -+ case RTL8367_EXTIF_MODE_GMII: -+ REG_RMW(smi, RTL8367B_CHIP_DEBUG0_REG, -+ RTL8367B_CHIP_DEBUG0_DUMMY0(id), -+ RTL8367B_CHIP_DEBUG0_DUMMY0(id)); -+ REG_RMW(smi, RTL8367B_EXT_RGMXF_REG(id), BIT(6), BIT(6)); -+ break; -+ -+ case RTL8367_EXTIF_MODE_MII_MAC: -+ case RTL8367_EXTIF_MODE_MII_PHY: -+ case RTL8367_EXTIF_MODE_DISABLED: -+ REG_RMW(smi, RTL8367B_BYPASS_LINE_RATE_REG, -+ BIT((id + 1) % 2), 0); -+ REG_RMW(smi, RTL8367B_EXT_RGMXF_REG(id), BIT(6), 0); -+ break; -+ -+ default: -+ dev_err(smi->parent, -+ "invalid mode for external interface %d\n", id); -+ return -EINVAL; -+ } -+ -+ -+ REG_RMW(smi, RTL8367B_DIS_REG, -+ RTL8367B_DIS_RGMII_MASK << RTL8367B_DIS_RGMII_SHIFT(id), -+ mode << RTL8367B_DIS_RGMII_SHIFT(id)); -+ -+ return 0; -+} -+ -+static int rtl8367b_extif_set_force(struct rtl8366_smi *smi, int id, -+ struct rtl8367_port_ability *pa) -+{ -+ u32 mask; -+ u32 val; -+ int err; -+ -+ mask = (RTL8367B_DI_FORCE_MODE | -+ RTL8367B_DI_FORCE_NWAY | -+ RTL8367B_DI_FORCE_TXPAUSE | -+ RTL8367B_DI_FORCE_RXPAUSE | -+ RTL8367B_DI_FORCE_LINK | -+ RTL8367B_DI_FORCE_DUPLEX | -+ RTL8367B_DI_FORCE_SPEED_MASK); -+ -+ val = pa->speed; -+ val |= pa->force_mode ? RTL8367B_DI_FORCE_MODE : 0; -+ val |= pa->nway ? RTL8367B_DI_FORCE_NWAY : 0; -+ val |= pa->txpause ? RTL8367B_DI_FORCE_TXPAUSE : 0; -+ val |= pa->rxpause ? RTL8367B_DI_FORCE_RXPAUSE : 0; -+ val |= pa->link ? RTL8367B_DI_FORCE_LINK : 0; -+ val |= pa->duplex ? RTL8367B_DI_FORCE_DUPLEX : 0; -+ -+ REG_RMW(smi, RTL8367B_DI_FORCE_REG(id), mask, val); -+ -+ return 0; -+} -+ -+ -+int rtl8367s_setAsicPortForceLinkExt(struct rtl8366_smi *smi, u32 id, struct rtl8367_port_ability *pPortAbility) -+{ -+ u32 regValue; -+ u32 reg_data = 0; -+ int err; -+ -+ reg_data |= pPortAbility->force_mode << 12; -+// reg_data |= pPortAbility->mstfault << 9; -+// reg_data |= pPortAbility->mstmode << 8; -+ reg_data |= pPortAbility->nway << 7; -+ reg_data |= pPortAbility->txpause << 6; -+ reg_data |= pPortAbility->rxpause << 5; -+ reg_data |= pPortAbility->link << 4; -+ reg_data |= pPortAbility->duplex << 2; -+ reg_data |= pPortAbility->speed; -+ -+ -+ if(1 == id) -+ { -+ REG_RD(smi, RTL8367S_REG_REG_TO_ECO4, ®Value); -+ if((regValue & (0x0001 << 5)) && (regValue & (0x0001 << 7))) -+ return 0; -+ -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_FDUP_OFFSET, pPortAbility->duplex); -+ REG_RWBTS(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_SPD_MASK, pPortAbility->speed); -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_LINK_OFFSET, pPortAbility->link); -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_TXFC_OFFSET, pPortAbility->txpause); -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_RXFC_OFFSET, pPortAbility->rxpause); -+ -+ } -+ -+ if(0 == id || 1 == id) -+ REG_WR(smi, RTL8367S_REG_DIGITAL_INTERFACE0_FORCE + id, reg_data); -+ else -+ REG_WR(smi, RTL8367S_REG_DIGITAL_INTERFACE2_FORCE, reg_data); -+ -+ -+ return 0; -+} -+ -+int rtl8367s_getAsicPortForceLinkExt(struct rtl8366_smi *smi, u32 id, struct rtl8367_port_ability *pPortAbility) -+{ -+ u32 reg_data; -+ u32 sgmiiSel; -+ u32 hsgmiiSel; -+ int err; -+ -+ -+ if(1 == id) -+ { -+ REG_RDBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_MAC8_SEL_SGMII_OFFSET, &sgmiiSel); -+ REG_RDBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_MAC8_SEL_HSGMII_OFFSET, &hsgmiiSel); -+ if( (sgmiiSel == 1) || (hsgmiiSel == 1) ) -+ { -+ memset(pPortAbility, 0x00, sizeof(struct rtl8367_port_ability)); -+ pPortAbility->force_mode = 1; -+ REG_RDBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_FDUP_OFFSET, ®_data); -+ pPortAbility->duplex = reg_data; -+ REG_RDBTS(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_SPD_MASK, ®_data); -+ pPortAbility->speed = reg_data; -+ REG_RDBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_LINK_OFFSET, ®_data); -+ pPortAbility->link = reg_data; -+ REG_RDBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_TXFC_OFFSET, ®_data); -+ pPortAbility->txpause = reg_data; -+ REG_RDBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_SGMII_RXFC_OFFSET, ®_data); -+ pPortAbility->rxpause = reg_data; -+ return 0; -+ } -+ } -+ -+ if(0 == id || 1 == id) -+ REG_RD(smi, RTL8367S_REG_DIGITAL_INTERFACE0_FORCE+id, ®_data); -+ else -+ REG_RD(smi, RTL8367S_REG_DIGITAL_INTERFACE2_FORCE, ®_data); -+ -+ pPortAbility->force_mode = (reg_data >> 12) & 0x0001; -+// pPortAbility->mstfault = (reg_data >> 9) & 0x0001; -+// pPortAbility->mstmode = (reg_data >> 8) & 0x0001; -+ pPortAbility->nway = (reg_data >> 7) & 0x0001; -+ pPortAbility->txpause = (reg_data >> 6) & 0x0001; -+ pPortAbility->rxpause = (reg_data >> 5) & 0x0001; -+ pPortAbility->link = (reg_data >> 4) & 0x0001; -+ pPortAbility->duplex = (reg_data >> 2) & 0x0001; -+ pPortAbility->speed = reg_data & 0x0003; -+ -+ return 0; -+} -+ -+int rtl8367s_setAsicPortExtMode(struct rtl8366_smi *smi, u32 id, u32 mode) -+{ -+ u32 i, option, regValue; -+ u32 idx; -+ int err; -+ u32 redData[][2] = { {0x04D7, 0x0480}, {0xF994, 0x0481}, {0x21A2, 0x0482}, {0x6960, 0x0483}, {0x9728, 0x0484}, {0x9D85, 0x0423}, {0xD810, 0x0424}, {0x83F2, 0x002E} }; -+ u32 redDataSB[][2] = { {0x04D7, 0x0480}, {0xF994, 0x0481}, {0x2420, 0x0482}, {0x6960, 0x0483}, {0x9728, 0x0484}, {0x9D85, 0x0423}, {0xD810, 0x0424}, {0x83F2, 0x002E} }; -+ u32 redData1[][2] = { {0x82F1, 0x0500}, {0xF195, 0x0501}, {0x31A2, 0x0502}, {0x796C, 0x0503}, {0x9728, 0x0504}, {0x9D85, 0x0423}, {0xD810, 0x0424}, {0x0F80, 0x0001}, {0x83F2, 0x002E} }; -+ u32 redData5[][2] = { {0x82F1, 0x0500}, {0xF195, 0x0501}, {0x31A2, 0x0502}, {0x796C, 0x0503}, {0x9728, 0x0504}, {0x9D85, 0x0423}, {0xD810, 0x0424}, {0x0F80, 0x0001}, {0x83F2, 0x002E} }; -+ u32 redData6[][2] = { {0x82F1, 0x0500}, {0xF195, 0x0501}, {0x31A2, 0x0502}, {0x796C, 0x0503}, {0x9728, 0x0504}, {0x9D85, 0x0423}, {0xD810, 0x0424}, {0x0F80, 0x0001}, {0x83F2, 0x002E} }; -+ u32 redData8[][2] = { {0x82F1, 0x0500}, {0xF995, 0x0501}, {0x31A2, 0x0502}, {0x796C, 0x0503}, {0x9728, 0x0504}, {0x9D85, 0x0423}, {0xD810, 0x0424}, {0x0F80, 0x0001}, {0x83F2, 0x002E} }; -+ u32 redData9[][2] = { {0x82F1, 0x0500}, {0xF995, 0x0501}, {0x31A2, 0x0502}, {0x796C, 0x0503}, {0x9728, 0x0504}, {0x9D85, 0x0423}, {0xD810, 0x0424}, {0x0F80, 0x0001}, {0x83F2, 0x002E} }; -+ u32 redDataHB[][2] = { {0x82F0, 0x0500}, {0xF195, 0x0501}, {0x31A2, 0x0502}, {0x7960, 0x0503}, {0x9728, 0x0504}, {0x9D85, 0x0423}, {0xD810, 0x0424}, {0x0F80, 0x0001}, {0x83F2, 0x002E} }; -+ -+ -+ printk("======mode 2==============\n"); -+ -+ if(mode == RTL8367S_EXTIF_MODE_1000X) -+ { -+ REG_RWBT(smi, RTL8367S_REG_REG_TO_ECO4, 5, 1); -+ REG_RWBT(smi, RTL8367S_REG_REG_TO_ECO4, 7, 1); -+ REG_RWBT(smi, RTL8367S_REG_CHIP_RESET, RTL8367S_DW8051_RST_OFFSET, 1); -+ REG_RWBT(smi, RTL8367S_REG_MISCELLANEOUS_CONFIGURE0, RTL8367S_DW8051_EN_OFFSET, 1); -+ REG_RWBT(smi, RTL8367S_REG_DW8051_RDY, RTL8367S_ACS_IROM_ENABLE_OFFSET, 1); -+ REG_RWBT(smi, RTL8367S_REG_DW8051_RDY, RTL8367S_IROM_MSB_OFFSET, 0); -+ -+ -+ for(idx = 0; idx < FIBER2_1G_INIT_SIZE; idx++) -+ { -+ REG_WR(smi, 0xE000 + idx, (u32)Fiber2_1G[idx]); -+ } -+ -+ REG_RWBT(smi, RTL8367S_REG_DW8051_RDY, RTL8367S_IROM_MSB_OFFSET, 0); -+ REG_RWBT(smi, RTL8367S_REG_DW8051_RDY, RTL8367S_ACS_IROM_ENABLE_OFFSET, 0); -+ REG_RWBT(smi, RTL8367S_REG_CHIP_RESET, RTL8367S_DW8051_RST_OFFSET, 0); -+ } -+ -+ -+ /* Serdes reset */ -+// if( (mode == RTL8367C_EXT_TMII_MAC) || (mode == RTL8367C_EXT_TMII_PHY) ) -+ // { -+ // REG_RWBT(smi, RTL8367S_REG_BYPASS_LINE_RATE, id, 1); -+ // } -+ // else -+ // { -+ REG_RWBT(smi, RTL8367S_REG_BYPASS_LINE_RATE, id, 0); -+ // } -+ if( (mode == RTL8367S_EXTIF_MODE_SGMII) || (mode == RTL8367S_EXTIF_MODE_HSGMII) ) -+ { -+ REG_WR(smi, 0x13C0, 0x0249); -+ REG_RD(smi, 0x13C1, &option); -+ REG_WR(smi, 0x13C0, 0x0000); -+ } -+ if(mode == RTL8367S_EXTIF_MODE_SGMII) -+ { -+ if(option == 0) -+ { -+ for(i = 0; i <= 7; i++) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, redData[i][0]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, redData[i][1]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ } -+ } -+ else -+ { -+ for(i = 0; i <= 7; i++) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, redDataSB[i][0]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, redDataSB[i][1]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ } -+ } -+ } -+ if(mode == RTL8367S_EXTIF_MODE_HSGMII) -+ { -+ if(option == 0) -+ { -+ REG_WR(smi, 0x13c2, 0x0249); -+ REG_RD(smi, 0x1301, ®Value); -+ REG_WR(smi, 0x13c2, 0x0000); -+ if ( ((regValue & 0x00F0) >> 4) == 0x0001) -+ { -+ for(i = 0; i <= 8; i++) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, redData1[i][0]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, redData1[i][1]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ } -+ } -+ else if ( ((regValue & 0x00F0) >> 4) == 0x0005) -+ { -+ for(i = 0; i <= 8; i++) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, redData5[i][0]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, redData5[i][1]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ } -+ } -+ else if ( ((regValue & 0x00F0) >> 4) == 0x0006) -+ { -+ for(i = 0; i <= 8; i++) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, redData6[i][0]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, redData6[i][1]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ } -+ } -+ else if ( ((regValue & 0x00F0) >> 4) == 0x0008) -+ { -+ for(i = 0; i <= 8; i++) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, redData8[i][0]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, redData8[i][1]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ } -+ } -+ else if ( ((regValue & 0x00F0) >> 4) == 0x0009) -+ { -+ for(i = 0; i <= 8; i++) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, redData9[i][0]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, redData9[i][1]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ } -+ } -+ } -+ else -+ { -+ for(i = 0; i <= 8; i++) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, redDataHB[i][0]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, redDataHB[i][1]); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ -+ } -+ } -+ } -+ -+ /* Only one ext port should care SGMII setting */ -+ if(id == 1) -+ { -+ if(mode == RTL8367S_EXTIF_MODE_SGMII) -+ { -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_MAC8_SEL_SGMII_OFFSET, 1); -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_MAC8_SEL_HSGMII_OFFSET, 0); -+ } -+ else if(mode == RTL8367S_EXTIF_MODE_HSGMII) -+ { -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_MAC8_SEL_SGMII_OFFSET, 0); -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_MAC8_SEL_HSGMII_OFFSET, 1); -+ } -+ else -+ { -+ if(mode != RTL8367S_EXTIF_MODE_1000X) -+ { -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_MAC8_SEL_SGMII_OFFSET, 0); -+ REG_RWBT(smi, RTL8367S_REG_SDS_MISC, RTL8367S_CFG_MAC8_SEL_HSGMII_OFFSET, 0); -+ } -+ } -+ } -+ -+ if(0 == id || 1 == id) -+ { -+ REG_RWBTS(smi, RTL8367S_REG_DIGITAL_INTERFACE_SELECT, RTL8367S_SELECT_GMII_0_MASK << (id * RTL8367S_SELECT_GMII_1_OFFSET), mode); -+ } -+ else -+ { -+ REG_RWBTS(smi, RTL8367S_REG_DIGITAL_INTERFACE_SELECT_1, RTL8367S_SELECT_GMII_2_MASK, mode); -+ } -+ -+ /* Serdes not reset */ -+ if( (mode == RTL8367S_EXTIF_MODE_SGMII) || (mode == RTL8367S_EXTIF_MODE_HSGMII) ) -+ { -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_DATA, 0x7106); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_ADR, 0x0003); -+ REG_WR(smi, RTL8367S_REG_SDS_INDACS_CMD, 0x00C0); -+ } -+ -+ if( (mode == RTL8367S_EXTIF_MODE_SGMII) || (mode == RTL8367S_EXTIF_MODE_HSGMII) ) -+ { -+ REG_RWBT(smi, RTL8367S_REG_CHIP_RESET, RTL8367S_DW8051_RST_OFFSET, 1); -+ REG_RWBT(smi, RTL8367S_REG_MISCELLANEOUS_CONFIGURE0, RTL8367S_DW8051_EN_OFFSET, 1); -+ REG_RWBT(smi, RTL8367S_REG_DW8051_RDY, RTL8367S_ACS_IROM_ENABLE_OFFSET, 1); -+ REG_RWBT(smi, RTL8367S_REG_DW8051_RDY, RTL8367S_IROM_MSB_OFFSET, 0); -+ for(idx = 0; idx < SGMII_INIT_SIZE; idx++) -+ { -+ REG_WR(smi, 0xE000 + idx, (u32)Sgmii_Init[idx]); -+ } -+ -+ REG_RWBT(smi, RTL8367S_REG_DW8051_RDY, RTL8367S_IROM_MSB_OFFSET, 0); -+ REG_RWBT(smi, RTL8367S_REG_DW8051_RDY, RTL8367S_ACS_IROM_ENABLE_OFFSET, 0); -+ REG_RWBT(smi, RTL8367S_REG_CHIP_RESET, RTL8367S_DW8051_RST_OFFSET, 0); -+ } -+ -+ return 0; -+} -+ -+static int rtl8367c_setAsicReg(struct rtl8366_smi *smi, u32 reg, u32 value) -+{ -+ -+ int err; -+ -+ REG_WR(smi, reg, value); -+ if(err != RT_ERR_OK) -+ return RT_ERR_SMI; -+ -+ return RT_ERR_OK; -+} -+ -+static int rtl8367c_getAsicReg(struct rtl8366_smi *smi, u32 reg, u32 *pValue) -+{ -+ u32 regData; -+ int err; -+ -+ REG_RD(smi, reg, ®Data); -+ if(err != RT_ERR_OK) -+ return RT_ERR_SMI; -+ -+ *pValue = regData; -+ -+ return RT_ERR_OK; -+} -+ -+static int rtl8367c_setAsicRegBits(struct rtl8366_smi *smi, u32 reg, u32 bits, u32 value) -+{ -+ u32 regData; -+ int err; -+ u32 bitsShift; -+ u32 valueShifted; -+ -+ if(bits >= (1 << RTL8367C_REGBITLENGTH) ) -+ return RT_ERR_INPUT; -+ -+ bitsShift = 0; -+ while(!(bits & (1 << bitsShift))) -+ { -+ bitsShift++; -+ if(bitsShift >= RTL8367C_REGBITLENGTH) -+ return RT_ERR_INPUT; -+ } -+ valueShifted = value << bitsShift; -+ -+ if(valueShifted > RTL8367C_REGDATAMAX) -+ return RT_ERR_INPUT; -+ REG_RD(smi, reg, ®Data); -+ if(err != RT_ERR_OK) -+ return RT_ERR_SMI; -+ regData = regData & (~bits); -+ regData = regData | (valueShifted & bits); -+ REG_WR(smi, reg, regData); -+ if(err != RT_ERR_OK) -+ return RT_ERR_SMI; -+ -+ return RT_ERR_OK; -+} -+ -+static int rtl8367c_getAsicPHYOCPReg(struct rtl8366_smi *smi, int phyNo, u32 ocpAddr, u32 *pRegData) -+{ -+ int retVal; -+ u32 regAddr; -+ u32 ocpAddrPrefix, ocpAddr9_6, ocpAddr5_1; -+ -+ /* OCP prefix */ -+ ocpAddrPrefix = ((ocpAddr & 0xFC00) >> 10); -+ retVal = rtl8367c_setAsicRegBits(smi, RTL8367C_REG_GPHY_OCP_MSB_0, RTL8367C_CFG_CPU_OCPADR_MSB_MASK, ocpAddrPrefix); -+ if(retVal != RT_ERR_OK) -+ return retVal; -+ -+ /*prepare access address*/ -+ ocpAddr9_6 = ((ocpAddr >> 6) & 0x000F); -+ ocpAddr5_1 = ((ocpAddr >> 1) & 0x001F); -+ regAddr = RTL8367C_PHY_BASE | (ocpAddr9_6 << 8) | (phyNo << RTL8367C_PHY_OFFSET) | ocpAddr5_1; -+ retVal = rtl8367c_getAsicReg(smi, regAddr, pRegData); -+ if(retVal != RT_ERR_OK) -+ return retVal; -+ -+ return RT_ERR_OK; -+ -+ -+} -+ -+static int rtl8367c_setAsicPHYOCPReg(struct rtl8366_smi *smi, int phyNo, u32 ocpAddr, u32 ocpData ) -+{ -+ int retVal; -+ u32 regAddr; -+ u32 ocpAddrPrefix, ocpAddr9_6, ocpAddr5_1; -+ -+ /* OCP prefix */ -+ ocpAddrPrefix = ((ocpAddr & 0xFC00) >> 10); -+ if((retVal = rtl8367c_setAsicRegBits(smi, RTL8367C_REG_GPHY_OCP_MSB_0, RTL8367C_CFG_CPU_OCPADR_MSB_MASK, ocpAddrPrefix)) != RT_ERR_OK) -+ return retVal; -+ -+ /*prepare access address*/ -+ ocpAddr9_6 = ((ocpAddr >> 6) & 0x000F); -+ ocpAddr5_1 = ((ocpAddr >> 1) & 0x001F); -+ regAddr = RTL8367C_PHY_BASE | (ocpAddr9_6 << 8) | (phyNo << RTL8367C_PHY_OFFSET) | ocpAddr5_1; -+ if((retVal = rtl8367c_setAsicReg(smi, regAddr, ocpData)) != RT_ERR_OK) -+ return retVal; -+ -+ return RT_ERR_OK; -+} -+ -+static u16 rtl8367c_getAsicPHYReg(struct rtl8366_smi *smi, int phyNo, u32 phyAddr, u32 *pRegData ) -+{ -+ u32 ocp_addr; -+ -+ ocp_addr = 0xa400 + phyAddr*2; -+ -+ return rtl8367c_getAsicPHYOCPReg(smi, phyNo, ocp_addr, pRegData); -+} -+ -+static u32 rtl8367c_setAsicPHYReg(struct rtl8366_smi *smi, int phyNo, u32 phyAddr, u32 phyData ) -+{ -+ u32 ocp_addr; -+ -+ if(phyAddr > RTL8367C_PHY_REGNOMAX) -+ return RT_ERR_PHY_REG_ID; -+ -+ ocp_addr = 0xa400 + phyAddr*2; -+ -+ return rtl8367c_setAsicPHYOCPReg(smi, phyNo, ocp_addr, phyData); -+} -+ -+static int dal_rtl8367c_port_phyReg_set(struct rtl8366_smi *smi, int port, u32 reg, u32 regData) -+{ -+ int retVal; -+ -+ -+ if ((retVal = rtl8367c_setAsicPHYReg(smi, port, reg, regData)) != RT_ERR_OK) -+ return retVal; -+ -+ return RT_ERR_OK; -+} -+ -+static int dal_rtl8367c_port_phyReg_get(struct rtl8366_smi *smi, int port, u32 reg, u32 *pData) -+{ -+ int retVal; -+ -+ -+ if ((retVal = rtl8367c_getAsicPHYReg(smi, port, reg, pData)) != RT_ERR_OK) -+ return retVal; -+ -+ return RT_ERR_OK; -+} -+ -+static int ipq_mdio_wait_busy(void) -+{ -+ int i; -+ u32 busy; -+ for (i = 0; i < IPQ_MDIO_RETRY; i++) { -+ busy = readl(IPQ_MDIO_BASE + -+ MDIO_CTRL_4_REG) & -+ MDIO_CTRL_4_ACCESS_BUSY; -+ if (!busy) -+ return 0; -+ } -+ printk("%s: MDIO operation timed out\n",__func__); -+ return -ETIMEDOUT; -+} -+ -+ -+static int rtk_mdio_write(struct rtl8366_smi *smi, int mii_id, int regnum, u32 value) -+{ -+ u32 cmd; -+ -+ if (regnum & MII_ADDR_C45) { -+ unsigned int mmd = (regnum >> 16) & 0x1F; -+ unsigned int reg = regnum & 0xFFFF; -+ -+ writel(CTRL_0_REG_C45_DEFAULT_VALUE, -+ IPQ_MDIO_BASE + MDIO_CTRL_0_REG); -+ -+ /* Issue the phy address and reg */ -+ writel((mii_id << 8) | mmd, -+ IPQ_MDIO_BASE + MDIO_CTRL_1_REG); -+ -+ writel(reg, IPQ_MDIO_BASE + MDIO_CTRL_2_REG); -+ -+ /* issue read command */ -+ cmd = MDIO_CTRL_4_ACCESS_START | MDIO_CTRL_4_ACCESS_CODE_C45_ADDR; -+ -+ writel(cmd, IPQ_MDIO_BASE + MDIO_CTRL_4_REG); -+ -+ if (ipq_mdio_wait_busy()) -+ return -ETIMEDOUT; -+ } else { -+ writel(CTRL_0_REG_DEFAULT_VALUE, -+ IPQ_MDIO_BASE + MDIO_CTRL_0_REG); -+ -+ /* Issue the phy addreass and reg */ -+ writel((mii_id << 8 | regnum), -+ IPQ_MDIO_BASE + MDIO_CTRL_1_REG); -+ } -+ -+ /* Issue a write data */ -+ writel(value, IPQ_MDIO_BASE + MDIO_CTRL_2_REG); -+ -+ if (regnum & MII_ADDR_C45) { -+ cmd = MDIO_CTRL_4_ACCESS_START | MDIO_CTRL_4_ACCESS_CODE_C45_WRITE ; -+ } else { -+ cmd = MDIO_CTRL_4_ACCESS_START | MDIO_CTRL_4_ACCESS_CODE_WRITE ; -+ } -+ -+ writel(cmd, IPQ_MDIO_BASE + MDIO_CTRL_4_REG); -+ /* Wait for write complete */ -+ -+ if (ipq_mdio_wait_busy()) -+ return -ETIMEDOUT; -+ -+ return 0; -+} -+ -+static int rtk_mdio_read(struct rtl8366_smi *smi, int mii_id, int regnum, u32 *data) -+{ -+ u32 val,cmd; -+ -+ if (regnum & MII_ADDR_C45) { -+ -+ unsigned int mmd = (regnum >> 16) & 0x1F; -+ unsigned int reg = regnum & 0xFFFF; -+ -+ writel(CTRL_0_REG_C45_DEFAULT_VALUE, -+ IPQ_MDIO_BASE + MDIO_CTRL_0_REG); -+ -+ /* Issue the phy address and reg */ -+ writel((mii_id << 8) | mmd, -+ IPQ_MDIO_BASE + MDIO_CTRL_1_REG); -+ -+ -+ writel(reg, IPQ_MDIO_BASE + MDIO_CTRL_2_REG); -+ -+ /* issue read command */ -+ cmd = MDIO_CTRL_4_ACCESS_START | MDIO_CTRL_4_ACCESS_CODE_C45_ADDR; -+ } else { -+ -+ writel(CTRL_0_REG_DEFAULT_VALUE, -+ IPQ_MDIO_BASE + MDIO_CTRL_0_REG); -+ -+ /* Issue the phy address and reg */ -+ writel((mii_id << 8 | regnum ) , -+ IPQ_MDIO_BASE + MDIO_CTRL_1_REG); -+ -+ /* issue read command */ -+ cmd = MDIO_CTRL_4_ACCESS_START | MDIO_CTRL_4_ACCESS_CODE_READ ; -+ } -+ -+ /* issue read command */ -+ writel(cmd, IPQ_MDIO_BASE + MDIO_CTRL_4_REG); -+ -+ if (ipq_mdio_wait_busy()) -+ return -ETIMEDOUT; -+ -+ if (regnum & MII_ADDR_C45) { -+ cmd = MDIO_CTRL_4_ACCESS_START | MDIO_CTRL_4_ACCESS_CODE_C45_READ; -+ writel(cmd, IPQ_MDIO_BASE + MDIO_CTRL_4_REG); -+ -+ if (ipq_mdio_wait_busy()) -+ return -ETIMEDOUT; -+ } -+ -+ /* Read data */ -+ val = readl(IPQ_MDIO_BASE + MDIO_CTRL_3_REG); -+ -+ if (data != NULL) -+ *data = val; -+ -+ return val; -+} -+ -+static int rtl8367c_setAsicRegBit(struct rtl8366_smi *smi, u32 reg, u32 bit, u32 value) -+{ -+ u32 regData; -+ int err; -+ -+ if(bit >= RTL8367C_REGBITLENGTH) -+ return RT_ERR_INPUT; -+ -+ REG_RD(smi, reg, ®Data); -+ if(err != RT_ERR_OK) -+ return RT_ERR_SMI; -+ -+ if(value) -+ regData = regData | (1 << bit); -+ else -+ regData = regData & (~(1 << bit)); -+ -+ REG_WR(smi, reg, regData); -+ if(err != RT_ERR_OK) -+ return RT_ERR_SMI; -+ -+ return RT_ERR_OK; -+} -+ -+static int rtl8367c_setAsicPortEnableAll(struct rtl8366_smi *smi, u32 enable) -+{ -+ if(enable >= 2) -+ return RT_ERR_INPUT; -+ return rtl8367c_setAsicRegBit(smi, RTL8367C_REG_PHY_AD, RTL8367C_PDNPHY_OFFSET, enable); -+} -+ -+static int dal_rtl8367c_port_phyEnableAll_set(struct switch_dev *dev,const struct switch_attr *attr,struct switch_val *val) -+{ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ int retVal; -+ u32 data; -+ int port = val->port_vlan; -+ int enable; -+ enable = val->value.i; -+ if(enable >= 2) -+ return -EINVAL; -+ -+ if ((retVal = rtl8367c_setAsicPortEnableAll(smi, enable)) != RT_ERR_OK) -+ return retVal; -+ -+ if ((retVal = dal_rtl8367c_port_phyReg_get(smi, port, PHY_CONTROL_REG, &data)) != RT_ERR_OK) -+ return retVal; -+ -+ if (1 == enable) -+ { -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_POWER_DOWN_OFFSET); -+ RTL8367S_SET_BIT(data,RTL8367S_REG_RESTART_AUTO_NEGO_OFFSET); -+ } -+ else -+ { -+ RTL8367S_SET_BIT(data,RTL8367S_REG_POWER_DOWN_OFFSET); -+ } -+ -+ if ((retVal = dal_rtl8367c_port_phyReg_set(smi, port, PHY_CONTROL_REG, data)) != RT_ERR_OK) -+ return retVal; -+ -+ return RT_ERR_OK; -+} -+ -+int get_port_state(struct switch_dev *dev,const struct switch_attr *attr,struct switch_val *val) -+{ -+ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ u32 data; -+ int port; -+ port = val->port_vlan; -+ -+ dal_rtl8367c_port_phyReg_get(smi, port, PHY_CONTROL_REG, &data); -+ -+ if(RTL8367S_CHECK_BIT(data,RTL8367S_REG_POWER_DOWN_OFFSET)) //check whether bit11 is true -+ { -+ printk("disabled\n"); -+ } -+ else -+ { -+ printk("enabled\n"); -+ } -+ -+ return 0; -+} -+ -+static int dal_rtl8367c_port_crtl_status(struct switch_dev *dev,const struct switch_attr *attr,struct switch_val *val) -+{ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ int retVal; -+ u32 data; -+ int port = val->port_vlan; -+ int enable; -+ enable = val->value.i; -+ if(enable >= 5) -+ return -EINVAL; -+ if ((retVal = dal_rtl8367c_port_phyReg_get(smi, port, PHY_CONTROL_REG, &data)) != RT_ERR_OK) -+ return retVal; -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_AUTO_NEGO_EN_OFFSET); //diasble auto -+ switch(enable) -+ { -+ case 0: //10M-half -+ { -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_DUPLEX_MODE_OFFSET); -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_SPEED_SELECTION_LOW_OFFSET); -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_SPEED_SELECTION_HIGH_OFFSET); -+ } -+ break; -+ case 1: //10M-full -+ { -+ RTL8367S_SET_BIT(data,RTL8367S_REG_DUPLEX_MODE_OFFSET); -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_SPEED_SELECTION_LOW_OFFSET); -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_SPEED_SELECTION_HIGH_OFFSET); -+ } -+ break; -+ case 2: //100M-half -+ { -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_DUPLEX_MODE_OFFSET); -+ RTL8367S_SET_BIT(data,RTL8367S_REG_SPEED_SELECTION_LOW_OFFSET); -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_SPEED_SELECTION_HIGH_OFFSET); -+ } -+ break; -+ case 3: //100M-full -+ { -+ RTL8367S_SET_BIT(data,RTL8367S_REG_DUPLEX_MODE_OFFSET); -+ RTL8367S_SET_BIT(data,RTL8367S_REG_SPEED_SELECTION_LOW_OFFSET); -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_SPEED_SELECTION_HIGH_OFFSET); -+ } -+ break; -+ case 4: //1000M-full == auto -+ { -+ RTL8367S_SET_BIT(data,RTL8367S_REG_AUTO_NEGO_EN_OFFSET); -+ RTL8367S_SET_BIT(data,RTL8367S_REG_DUPLEX_MODE_OFFSET); -+ RTL8367S_CLEAR_BIT(data,RTL8367S_REG_SPEED_SELECTION_LOW_OFFSET); -+ RTL8367S_SET_BIT(data,RTL8367S_REG_SPEED_SELECTION_HIGH_OFFSET); -+ } -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ if ((retVal = dal_rtl8367c_port_phyReg_set(smi, port, PHY_CONTROL_REG, data)) != RT_ERR_OK) -+ return retVal; -+ return RT_ERR_OK; -+} -+ -+static int rtl8367s_extif_set_force(struct rtl8366_smi *smi, int id, int mode, -+ struct rtl8367_port_ability *pa) -+{ -+ int retVal; -+ struct rtl8367_port_ability ability; -+ u32 ext_id; -+ -+ ext_id = 1; -+ -+ if(mode == RTL8367_EXTIF_MODE_DISABLED) -+ { -+ memset(&ability, 0x00, sizeof(struct rtl8367_port_ability)); -+ if ((retVal = rtl8367s_setAsicPortForceLinkExt(smi, ext_id, &ability)) != 0) -+ return retVal; -+ -+ if ((retVal = rtl8367s_setAsicPortExtMode(smi, ext_id, mode)) != 0) -+ return retVal; -+ } -+ -+ else -+ { -+ if ((retVal = rtl8367s_setAsicPortExtMode(smi, ext_id, mode)) != 0) -+ return retVal; -+ if ((retVal = rtl8367s_getAsicPortForceLinkExt(smi, ext_id, &ability)) != 0) -+ return retVal; -+ -+ ability.force_mode = pa->force_mode; -+ ability.speed = pa->speed; -+ ability.duplex = pa->duplex; -+ ability.link = pa->link; -+ ability.nway = pa->nway; -+ ability.txpause = pa->txpause; -+ ability.rxpause = pa->rxpause; -+ -+ if ((retVal = rtl8367s_setAsicPortForceLinkExt(smi, ext_id, &ability)) != 0) -+ return retVal; -+ } -+ -+ return 0; -+} -+ -+static int rtl8367b_extif_set_rgmii_delay(struct rtl8366_smi *smi, int id, -+ unsigned txdelay, unsigned rxdelay) -+{ -+ u32 mask; -+ u32 val; -+ int err; -+ -+ mask = (RTL8367B_EXT_RGMXF_RXDELAY_MASK | -+ (RTL8367B_EXT_RGMXF_TXDELAY_MASK << -+ RTL8367B_EXT_RGMXF_TXDELAY_SHIFT)); -+ -+ val = rxdelay; -+ val |= txdelay << RTL8367B_EXT_RGMXF_TXDELAY_SHIFT; -+ -+ REG_RMW(smi, RTL8367B_EXT_RGMXF_REG(id), mask, val); -+ -+ return 0; -+} -+ -+static int rtl8367b_extif_init(struct rtl8366_smi *smi, int id, -+ struct rtl8367_extif_config *cfg) -+{ -+ enum rtl8367_extif_mode mode; -+ int err; -+ -+ mode = (cfg) ? cfg->mode : RTL8367_EXTIF_MODE_DISABLED; -+ -+ if (!of_device_is_compatible(smi->parent->of_node, "realtek,rtl8367s")) -+ { -+ err = rtl8367b_extif_set_mode(smi, id, mode); -+ if (err) -+ return err; -+ } -+ -+ if (mode != RTL8367_EXTIF_MODE_DISABLED) { -+ if (of_device_is_compatible(smi->parent->of_node, "realtek,rtl8367s")) -+ err = rtl8367s_extif_set_force(smi, id, mode, &cfg->ability); -+ else -+ err = rtl8367b_extif_set_force(smi, id, &cfg->ability); -+ if (err) -+ return err; -+ -+ err = rtl8367b_extif_set_rgmii_delay(smi, id, cfg->txdelay, -+ cfg->rxdelay); -+ if (err) -+ return err; -+ } -+ -+ return 0; -+} -+ -+#ifdef CONFIG_OF -+static int rtl8367b_extif_init_of(struct rtl8366_smi *smi, int id, -+ const char *name) -+{ -+ struct rtl8367_extif_config *cfg; -+ const __be32 *prop; -+ int size; -+ int err; -+ -+ prop = of_get_property(smi->parent->of_node, name, &size); -+ if (!prop) -+ return rtl8367b_extif_init(smi, id, NULL); -+ -+ if (size != (9 * sizeof(*prop))) { -+ dev_err(smi->parent, "%s property is invalid\n", name); -+ return -EINVAL; -+ } -+ -+ cfg = kzalloc(sizeof(struct rtl8367_extif_config), GFP_KERNEL); -+ if (!cfg) -+ return -ENOMEM; -+ -+ cfg->txdelay = be32_to_cpup(prop++); -+ cfg->rxdelay = be32_to_cpup(prop++); -+ cfg->mode = be32_to_cpup(prop++); -+ cfg->ability.force_mode = be32_to_cpup(prop++); -+ cfg->ability.txpause = be32_to_cpup(prop++); -+ cfg->ability.rxpause = be32_to_cpup(prop++); -+ cfg->ability.link = be32_to_cpup(prop++); -+ cfg->ability.duplex = be32_to_cpup(prop++); -+ cfg->ability.speed = be32_to_cpup(prop++); -+ -+ err = rtl8367b_extif_init(smi, id, cfg); -+ kfree(cfg); -+ -+ return err; -+} -+#else -+static int rtl8367b_extif_init_of(struct rtl8366_smi *smi, int id, -+ const char *name) -+{ -+ return -EINVAL; -+} -+#endif -+ -+static int rtl8367b_setup(struct rtl8366_smi *smi) -+{ -+ struct rtl8367_platform_data *pdata; -+ int err; -+ int i; -+ -+ pdata = smi->parent->platform_data; -+ -+ err = rtl8367b_init_regs(smi); -+ if (err) -+ return err; -+ -+ /* initialize external interfaces */ -+ if (smi->parent->of_node) { -+ err = rtl8367b_extif_init_of(smi, 0, "realtek,extif0"); -+ if (err) -+ return err; -+ -+ err = rtl8367b_extif_init_of(smi, 1, "realtek,extif1"); -+ if (err) -+ return err; -+ } else { -+ err = rtl8367b_extif_init(smi, 0, pdata->extif0_cfg); -+ if (err) -+ return err; -+ -+ err = rtl8367b_extif_init(smi, 1, pdata->extif1_cfg); -+ if (err) -+ return err; -+ } -+ -+ /* set maximum packet length to 1536 bytes */ -+ REG_RMW(smi, RTL8367B_SWC0_REG, RTL8367B_SWC0_MAX_LENGTH_MASK, -+ RTL8367B_SWC0_MAX_LENGTH_1536); -+ -+ /* -+ * discard VLAN tagged packets if the port is not a member of -+ * the VLAN with which the packets is associated. -+ */ -+ REG_WR(smi, RTL8367B_VLAN_INGRESS_REG, RTL8367B_PORTS_ALL); -+ -+ /* -+ * Setup egress tag mode for each port. -+ */ -+ for (i = 0; i < RTL8367B_NUM_PORTS; i++) -+ REG_RMW(smi, -+ RTL8367B_PORT_MISC_CFG_REG(i), -+ RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK << -+ RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT, -+ RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL << -+ RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT); -+ -+ return 0; -+} -+ -+static int rtl8367b_get_mib_counter(struct rtl8366_smi *smi, int counter, -+ int port, unsigned long long *val) -+{ -+ struct rtl8366_mib_counter *mib; -+ int offset; -+ int i; -+ int err; -+ u32 addr, data; -+ u64 mibvalue; -+ -+ if (port > RTL8367B_NUM_PORTS || -+ counter >= RTL8367B_NUM_MIB_COUNTERS) -+ return -EINVAL; -+ -+ mib = &rtl8367b_mib_counters[counter]; -+ addr = RTL8367B_MIB_COUNTER_PORT_OFFSET * port + mib->offset; -+ -+ /* -+ * Writing access counter address first -+ * then ASIC will prepare 64bits counter wait for being retrived -+ */ -+ REG_WR(smi, RTL8367B_MIB_ADDRESS_REG, addr >> 2); -+ -+ /* read MIB control register */ -+ REG_RD(smi, RTL8367B_MIB_CTRL0_REG(0), &data); -+ -+ if (data & RTL8367B_MIB_CTRL0_BUSY_MASK) -+ return -EBUSY; -+ -+ if (data & RTL8367B_MIB_CTRL0_RESET_MASK) -+ return -EIO; -+ -+ if (mib->length == 4) -+ offset = 3; -+ else -+ offset = (mib->offset + 1) % 4; -+ -+ mibvalue = 0; -+ for (i = 0; i < mib->length; i++) { -+ REG_RD(smi, RTL8367B_MIB_COUNTER_REG(offset - i), &data); -+ mibvalue = (mibvalue << 16) | (data & 0xFFFF); -+ } -+ -+ *val = mibvalue; -+ return 0; -+} -+ -+static int rtl8367b_get_vlan_4k(struct rtl8366_smi *smi, u32 vid, -+ struct rtl8366_vlan_4k *vlan4k) -+{ -+ u32 data[RTL8367B_TA_VLAN_NUM_WORDS]; -+ int err; -+ int i; -+ -+ memset(vlan4k, '\0', sizeof(struct rtl8366_vlan_4k)); -+ -+ if (vid >= RTL8367B_NUM_VIDS) -+ return -EINVAL; -+ -+ /* write VID */ -+ REG_WR(smi, RTL8367B_TA_ADDR_REG, vid); -+ -+ /* write table access control word */ -+ REG_WR(smi, RTL8367B_TA_CTRL_REG, RTL8367B_TA_CTRL_CVLAN_READ); -+ -+ for (i = 0; i < ARRAY_SIZE(data); i++) -+ REG_RD(smi, RTL8367B_TA_RDDATA_REG(i), &data[i]); -+ -+ vlan4k->vid = vid; -+ vlan4k->member = (data[0] >> RTL8367B_TA_VLAN0_MEMBER_SHIFT) & -+ RTL8367B_TA_VLAN0_MEMBER_MASK; -+ vlan4k->untag = (data[0] >> RTL8367B_TA_VLAN0_UNTAG_SHIFT) & -+ RTL8367B_TA_VLAN0_UNTAG_MASK; -+ vlan4k->fid = (data[1] >> RTL8367B_TA_VLAN1_FID_SHIFT) & -+ RTL8367B_TA_VLAN1_FID_MASK; -+ -+ return 0; -+} -+ -+static int rtl8367b_set_vlan_4k(struct rtl8366_smi *smi, -+ const struct rtl8366_vlan_4k *vlan4k) -+{ -+ u32 data[RTL8367B_TA_VLAN_NUM_WORDS]; -+ int err; -+ int i; -+ -+ if (vlan4k->vid >= RTL8367B_NUM_VIDS || -+ vlan4k->member > RTL8367B_TA_VLAN0_MEMBER_MASK || -+ vlan4k->untag > RTL8367B_UNTAG_MASK || -+ vlan4k->fid > RTL8367B_FIDMAX) -+ return -EINVAL; -+ -+ memset(data, 0, sizeof(data)); -+ -+ data[0] = (vlan4k->member & RTL8367B_TA_VLAN0_MEMBER_MASK) << -+ RTL8367B_TA_VLAN0_MEMBER_SHIFT; -+ data[0] |= (vlan4k->untag & RTL8367B_TA_VLAN0_UNTAG_MASK) << -+ RTL8367B_TA_VLAN0_UNTAG_SHIFT; -+ data[1] = (vlan4k->fid & RTL8367B_TA_VLAN1_FID_MASK) << -+ RTL8367B_TA_VLAN1_FID_SHIFT | (1 << 14); -+ -+ for (i = 0; i < ARRAY_SIZE(data); i++) -+ REG_WR(smi, RTL8367B_TA_WRDATA_REG(i), data[i]); -+ -+ /* write VID */ -+ REG_WR(smi, RTL8367B_TA_ADDR_REG, -+ vlan4k->vid & RTL8367B_TA_VLAN_VID_MASK); -+ -+ /* write table access control word */ -+ REG_WR(smi, RTL8367B_TA_CTRL_REG, RTL8367B_TA_CTRL_CVLAN_WRITE); -+ -+ return 0; -+} -+ -+static int rtl8367b_get_vlan_mc(struct rtl8366_smi *smi, u32 index, -+ struct rtl8366_vlan_mc *vlanmc) -+{ -+ u32 data[RTL8367B_VLAN_MC_NUM_WORDS]; -+ int err; -+ int i; -+ -+ memset(vlanmc, '\0', sizeof(struct rtl8366_vlan_mc)); -+ -+ if (index >= RTL8367B_NUM_VLANS) -+ return -EINVAL; -+ -+ for (i = 0; i < ARRAY_SIZE(data); i++) -+ REG_RD(smi, RTL8367B_VLAN_MC_BASE(index) + i, &data[i]); -+ -+ vlanmc->member = (data[0] >> RTL8367B_VLAN_MC0_MEMBER_SHIFT) & -+ RTL8367B_VLAN_MC0_MEMBER_MASK; -+ vlanmc->fid = (data[1] >> RTL8367B_VLAN_MC1_FID_SHIFT) & -+ RTL8367B_VLAN_MC1_FID_MASK; -+ vlanmc->vid = (data[3] >> RTL8367B_VLAN_MC3_EVID_SHIFT) & -+ RTL8367B_VLAN_MC3_EVID_MASK; -+ -+ return 0; -+} -+ -+static int rtl8367b_set_vlan_mc(struct rtl8366_smi *smi, u32 index, -+ const struct rtl8366_vlan_mc *vlanmc) -+{ -+ u32 data[RTL8367B_VLAN_MC_NUM_WORDS]; -+ int err; -+ int i; -+ -+ if (index >= RTL8367B_NUM_VLANS || -+ vlanmc->vid >= RTL8367B_NUM_VIDS || -+ vlanmc->priority > RTL8367B_PRIORITYMAX || -+ vlanmc->member > RTL8367B_VLAN_MC0_MEMBER_MASK || -+ vlanmc->untag > RTL8367B_UNTAG_MASK || -+ vlanmc->fid > RTL8367B_FIDMAX) -+ return -EINVAL; -+ -+ data[0] = (vlanmc->member & RTL8367B_VLAN_MC0_MEMBER_MASK) << -+ RTL8367B_VLAN_MC0_MEMBER_SHIFT; -+ data[1] = (vlanmc->fid & RTL8367B_VLAN_MC1_FID_MASK) << -+ RTL8367B_VLAN_MC1_FID_SHIFT; -+ data[2] = 0; -+ data[3] = (vlanmc->vid & RTL8367B_VLAN_MC3_EVID_MASK) << -+ RTL8367B_VLAN_MC3_EVID_SHIFT; -+ -+ for (i = 0; i < ARRAY_SIZE(data); i++) -+ REG_WR(smi, RTL8367B_VLAN_MC_BASE(index) + i, data[i]); -+ -+ return 0; -+} -+ -+static int rtl8367b_get_mc_index(struct rtl8366_smi *smi, int port, int *val) -+{ -+ u32 data; -+ int err; -+ -+ if (port >= RTL8367B_NUM_PORTS) -+ return -EINVAL; -+ -+ REG_RD(smi, RTL8367B_VLAN_PVID_CTRL_REG(port), &data); -+ -+ *val = (data >> RTL8367B_VLAN_PVID_CTRL_SHIFT(port)) & -+ RTL8367B_VLAN_PVID_CTRL_MASK; -+ -+ return 0; -+} -+ -+static int rtl8367b_set_mc_index(struct rtl8366_smi *smi, int port, int index) -+{ -+ if (port >= RTL8367B_NUM_PORTS || index >= RTL8367B_NUM_VLANS) -+ return -EINVAL; -+ -+ return rtl8366_smi_rmwr(smi, RTL8367B_VLAN_PVID_CTRL_REG(port), -+ RTL8367B_VLAN_PVID_CTRL_MASK << -+ RTL8367B_VLAN_PVID_CTRL_SHIFT(port), -+ (index & RTL8367B_VLAN_PVID_CTRL_MASK) << -+ RTL8367B_VLAN_PVID_CTRL_SHIFT(port)); -+} -+ -+static int rtl8367b_enable_vlan(struct rtl8366_smi *smi, int enable) -+{ -+ return rtl8366_smi_rmwr(smi, RTL8367B_VLAN_CTRL_REG, -+ RTL8367B_VLAN_CTRL_ENABLE, -+ (enable) ? RTL8367B_VLAN_CTRL_ENABLE : 0); -+} -+ -+static int rtl8367b_enable_vlan4k(struct rtl8366_smi *smi, int enable) -+{ -+ return 0; -+} -+ -+static int rtl8367b_is_vlan_valid(struct rtl8366_smi *smi, unsigned vlan) -+{ -+ unsigned max = RTL8367B_NUM_VLANS; -+ -+ if (smi->vlan4k_enabled) -+ max = RTL8367B_NUM_VIDS - 1; -+ -+ if (vlan == 0 || vlan >= max) -+ return 0; -+ -+ return 1; -+} -+ -+static int rtl8367b_enable_port(struct rtl8366_smi *smi, int port, int enable) -+{ -+ int err; -+ -+ REG_WR(smi, RTL8367B_PORT_ISOLATION_REG(port), -+ (enable) ? RTL8367B_PORTS_ALL : 0); -+ -+ return 0; -+} -+ -+static int rtl8367b_sw_reset_mibs(struct switch_dev *dev, -+ const struct switch_attr *attr, -+ struct switch_val *val) -+{ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ -+ return rtl8366_smi_rmwr(smi, RTL8367B_MIB_CTRL0_REG(0), 0, -+ RTL8367B_MIB_CTRL0_GLOBAL_RESET_MASK); -+} -+ -+static int rtl8367b_sw_get_port_link(struct switch_dev *dev, -+ int port, -+ struct switch_port_link *link) -+{ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ u32 data = 0, sds_misc = 0; -+ u32 speed; -+ -+ if (port >= RTL8367B_NUM_PORTS) -+ return -EINVAL; -+ -+ if (port == 6 && -+ of_device_is_compatible(smi->parent->of_node, "realtek,rtl8367s")) -+ rtl8366_smi_read_reg(smi, RTL8367S_SDS_MISC, &sds_misc); -+ -+ rtl8366_smi_read_reg(smi, RTL8367B_PORT_STATUS_REG(port), &data); -+ link->link = !!(data & RTL8367B_PORT_STATUS_LINK); -+ if (!link->link) -+ return 0; -+ -+ link->duplex = !!(data & RTL8367B_PORT_STATUS_DUPLEX); -+ link->rx_flow = !!(data & RTL8367B_PORT_STATUS_RXPAUSE); -+ link->tx_flow = !!(data & RTL8367B_PORT_STATUS_TXPAUSE); -+ link->aneg = !!(data & RTL8367B_PORT_STATUS_NWAY); -+ -+ speed = (data & RTL8367B_PORT_STATUS_SPEED_MASK); -+ switch (speed) { -+ case 0: -+ link->speed = SWITCH_PORT_SPEED_10; -+ break; -+ case 1: -+ link->speed = SWITCH_PORT_SPEED_100; -+ break; -+ case 2: -+ link->speed = (((sds_misc & RTL8367S_CFG_MAC8_SEL_HSGMII_MASK) -+ >> RTL8367S_CFG_MAC8_SEL_HSGMII_SHIFT) == 1) -+ ? SWITCH_PORT_SPEED_2500 -+ : SWITCH_PORT_SPEED_1000; -+ break; -+ default: -+ link->speed = SWITCH_PORT_SPEED_UNKNOWN; -+ break; -+ } -+ -+ return 0; -+} -+ -+static int rtl8367b_sw_get_max_length(struct switch_dev *dev, -+ const struct switch_attr *attr, -+ struct switch_val *val) -+{ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ u32 data; -+ -+ rtl8366_smi_read_reg(smi, RTL8367B_SWC0_REG, &data); -+ val->value.i = (data & RTL8367B_SWC0_MAX_LENGTH_MASK) >> -+ RTL8367B_SWC0_MAX_LENGTH_SHIFT; -+ -+ return 0; -+} -+ -+static int rtl8367b_sw_set_max_length(struct switch_dev *dev, -+ const struct switch_attr *attr, -+ struct switch_val *val) -+{ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ u32 max_len; -+ -+ switch (val->value.i) { -+ case 0: -+ max_len = RTL8367B_SWC0_MAX_LENGTH_1522; -+ break; -+ case 1: -+ max_len = RTL8367B_SWC0_MAX_LENGTH_1536; -+ break; -+ case 2: -+ max_len = RTL8367B_SWC0_MAX_LENGTH_1552; -+ break; -+ case 3: -+ max_len = RTL8367B_SWC0_MAX_LENGTH_16000; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ return rtl8366_smi_rmwr(smi, RTL8367B_SWC0_REG, -+ RTL8367B_SWC0_MAX_LENGTH_MASK, max_len); -+} -+ -+static int rtl8367b_sw_reset_port_mibs(struct switch_dev *dev, -+ const struct switch_attr *attr, -+ struct switch_val *val) -+{ -+ struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); -+ int port; -+ -+ port = val->port_vlan; -+ if (port >= RTL8367B_NUM_PORTS) -+ return -EINVAL; -+ -+ return rtl8366_smi_rmwr(smi, RTL8367B_MIB_CTRL0_REG(port / 8), 0, -+ RTL8367B_MIB_CTRL0_PORT_RESET_MASK(port % 8)); -+} -+ -+ -+static struct switch_attr rtl8367b_globals[] = { -+ { -+ .type = SWITCH_TYPE_INT, -+ .name = "enable_vlan", -+ .description = "Enable VLAN mode", -+ .set = rtl8366_sw_set_vlan_enable, -+ .get = rtl8366_sw_get_vlan_enable, -+ .max = 1, -+ .ofs = 1 -+ }, { -+ .type = SWITCH_TYPE_INT, -+ .name = "enable_vlan4k", -+ .description = "Enable VLAN 4K mode", -+ .set = rtl8366_sw_set_vlan_enable, -+ .get = rtl8366_sw_get_vlan_enable, -+ .max = 1, -+ .ofs = 2 -+ }, { -+ .type = SWITCH_TYPE_NOVAL, -+ .name = "reset_mibs", -+ .description = "Reset all MIB counters", -+ .set = rtl8367b_sw_reset_mibs, -+ }, { -+ .type = SWITCH_TYPE_INT, -+ .name = "max_length", -+ .description = "Get/Set the maximum length of valid packets" -+ "(0:1522, 1:1536, 2:1552, 3:16000)", -+ .set = rtl8367b_sw_set_max_length, -+ .get = rtl8367b_sw_get_max_length, -+ .max = 3, -+ } -+}; -+ -+static struct switch_attr rtl8367b_port[] = { -+ { -+ .type = SWITCH_TYPE_NOVAL, -+ .name = "reset_mib", -+ .description = "Reset single port MIB counters", -+ .set = rtl8367b_sw_reset_port_mibs, -+ }, { -+ .type = SWITCH_TYPE_STRING, -+ .name = "mib", -+ .description = "Get MIB counters for port", -+ .max = 33, -+ .set = NULL, -+ .get = rtl8366_sw_get_port_mib, -+ }, { -+ .type = SWITCH_TYPE_INT, -+ .name = "enable_port", -+ .description = "Enable or disable the port", -+ .set = dal_rtl8367c_port_phyEnableAll_set, -+ .get = get_port_state, -+ .max = 1, -+ }, { -+ .type = SWITCH_TYPE_INT, -+ .name = "set_autoNego", -+ .description = "Set auto nego of the port---" -+ "0:10M-half 1:10M-full 2:100M-half 3:100M-full 4:1000M-full(auto)", -+ .set = dal_rtl8367c_port_crtl_status, -+ .max = 4, -+ }, -+}; -+ -+static struct switch_attr rtl8367b_vlan[] = { -+ { -+ .type = SWITCH_TYPE_STRING, -+ .name = "info", -+ .description = "Get vlan information", -+ .max = 1, -+ .set = NULL, -+ .get = rtl8366_sw_get_vlan_info, -+ }, -+}; -+ -+static const struct switch_dev_ops rtl8367b_sw_ops = { -+ .attr_global = { -+ .attr = rtl8367b_globals, -+ .n_attr = ARRAY_SIZE(rtl8367b_globals), -+ }, -+ .attr_port = { -+ .attr = rtl8367b_port, -+ .n_attr = ARRAY_SIZE(rtl8367b_port), -+ }, -+ .attr_vlan = { -+ .attr = rtl8367b_vlan, -+ .n_attr = ARRAY_SIZE(rtl8367b_vlan), -+ }, -+ -+ .get_vlan_ports = rtl8366_sw_get_vlan_ports, -+ .set_vlan_ports = rtl8366_sw_set_vlan_ports, -+ .get_port_pvid = rtl8366_sw_get_port_pvid, -+ .set_port_pvid = rtl8366_sw_set_port_pvid, -+ .reset_switch = rtl8366_sw_reset_switch, -+ .get_port_link = rtl8367b_sw_get_port_link, -+}; -+ -+static int rtl8367b_switch_init(struct rtl8366_smi *smi) -+{ -+ struct switch_dev *dev = &smi->sw_dev; -+ int err; -+ -+ dev->name = "RTL8367B"; -+ dev->cpu_port = smi->cpu_port; -+ dev->ports = RTL8367B_NUM_PORTS; -+ dev->vlans = RTL8367B_NUM_VIDS; -+ dev->ops = &rtl8367b_sw_ops; -+ dev->alias = dev_name(smi->parent); -+ -+ err = register_switch(dev, NULL); -+ if (err) -+ dev_err(smi->parent, "switch registration failed\n"); -+ -+ return err; -+} -+ -+static void rtl8367b_switch_cleanup(struct rtl8366_smi *smi) -+{ -+ unregister_switch(&smi->sw_dev); -+} -+ -+static int rtl8367b_mii_read(struct mii_bus *bus, int addr, int reg) -+{ -+ struct rtl8366_smi *smi = bus->priv; -+ u32 val = 0; -+ int err; -+ -+ err = rtl8367b_read_phy_reg(smi, addr, reg, &val); -+ if (err) -+ return 0xffff; -+ -+ return val; -+} -+ -+static int rtl8367b_mii_write(struct mii_bus *bus, int addr, int reg, u16 val) -+{ -+ struct rtl8366_smi *smi = bus->priv; -+ u32 t; -+ int err; -+ -+ err = rtl8367b_write_phy_reg(smi, addr, reg, val); -+ if (err) -+ return err; -+ -+ /* flush write */ -+ (void) rtl8367b_read_phy_reg(smi, addr, reg, &t); -+ -+ return err; -+} -+ -+static int rtl8367b_detect(struct rtl8366_smi *smi) -+{ -+ const char *chip_name; -+ u32 chip_num; -+ u32 chip_ver; -+ u32 chip_mode; -+ int ret; -+ -+ /* TODO: improve chip detection */ -+ rtl8366_smi_write_reg(smi, RTL8367B_RTL_MAGIC_ID_REG, -+ RTL8367B_RTL_MAGIC_ID_VAL); -+ -+ ret = rtl8366_smi_read_reg(smi, RTL8367B_CHIP_NUMBER_REG, &chip_num); -+ if (ret) { -+ dev_err(smi->parent, "unable to read %s register\n", -+ "chip number"); -+ return ret; -+ } -+ -+ ret = rtl8366_smi_read_reg(smi, RTL8367B_CHIP_VER_REG, &chip_ver); -+ if (ret) { -+ dev_err(smi->parent, "unable to read %s register\n", -+ "chip version"); -+ return ret; -+ } -+ -+ ret = rtl8366_smi_read_reg(smi, RTL8367B_CHIP_MODE_REG, &chip_mode); -+ if (ret) { -+ dev_err(smi->parent, "unable to read %s register\n", -+ "chip mode"); -+ return ret; -+ } -+ -+ /* rtl8367s: known chip num:6367 ver:00a0, mode:00a0 */ -+ -+ if (of_device_is_compatible(smi->parent->of_node, "realtek,rtl8367s")) { -+ chip_name = "8367S"; -+ } else { -+ switch (chip_ver) { -+ case 0x1000: -+ chip_name = "8367RB"; -+ break; -+ case 0x1010: -+ chip_name = "8367R-VB"; -+ break; -+ default: -+ dev_err(smi->parent, -+ "unknown chip num:%04x ver:%04x, mode:%04x\n", -+ chip_num, chip_ver, chip_mode); -+ return -ENODEV; -+ } -+ } -+ -+ dev_info(smi->parent, "RTL%s chip found\n", chip_name); -+ -+ return 0; -+} -+ -+static struct rtl8366_smi_ops rtl8367b_smi_ops = { -+ .detect = rtl8367b_detect, -+ .reset_chip = rtl8367b_reset_chip, -+ .setup = rtl8367b_setup, -+ -+ .mii_read = rtl8367b_mii_read, -+ .mii_write = rtl8367b_mii_write, -+ -+ .get_vlan_mc = rtl8367b_get_vlan_mc, -+ .set_vlan_mc = rtl8367b_set_vlan_mc, -+ .get_vlan_4k = rtl8367b_get_vlan_4k, -+ .set_vlan_4k = rtl8367b_set_vlan_4k, -+ .get_mc_index = rtl8367b_get_mc_index, -+ .set_mc_index = rtl8367b_set_mc_index, -+ .get_mib_counter = rtl8367b_get_mib_counter, -+ .is_vlan_valid = rtl8367b_is_vlan_valid, -+ .enable_vlan = rtl8367b_enable_vlan, -+ .enable_vlan4k = rtl8367b_enable_vlan4k, -+ .enable_port = rtl8367b_enable_port, -+}; -+ -+static int rtl8367b_probe(struct platform_device *pdev) -+{ -+ struct rtl8366_smi *smi; -+ int err; -+ -+ smi = rtl8366_smi_probe(pdev); -+ if (IS_ERR(smi)) -+ return PTR_ERR(smi); -+ -+ smi->clk_delay = 1500; -+ smi->cmd_read = 0xb9; -+ smi->cmd_write = 0xb8; -+ -+ smi->ops = &rtl8367b_smi_ops; -+ if (of_device_is_compatible(pdev->dev.of_node, "realtek,rtl8367s")) -+ smi->cpu_port = RTL8367S_CPU_PORT_NUM; -+ else -+ smi->cpu_port = RTL8367B_CPU_PORT_NUM; -+ -+ smi->num_ports = RTL8367B_NUM_PORTS; -+ smi->num_vlan_mc = RTL8367B_NUM_VLANS; -+ smi->mib_counters = rtl8367b_mib_counters; -+ smi->num_mib_counters = ARRAY_SIZE(rtl8367b_mib_counters); -+ -+ err = rtl8366_smi_init(smi); -+ if (err) -+ goto err_free_smi; -+ -+ platform_set_drvdata(pdev, smi); -+ -+ err = rtl8367b_switch_init(smi); -+ if (err) -+ goto err_clear_drvdata; -+ -+ return 0; -+ -+ err_clear_drvdata: -+ platform_set_drvdata(pdev, NULL); -+ rtl8366_smi_cleanup(smi); -+ err_free_smi: -+ kfree(smi); -+ return err; -+} -+ -+static int rtl8367b_remove(struct platform_device *pdev) -+{ -+ struct rtl8366_smi *smi = platform_get_drvdata(pdev); -+ -+ if (smi) { -+ rtl8367b_switch_cleanup(smi); -+ platform_set_drvdata(pdev, NULL); -+ rtl8366_smi_cleanup(smi); -+ kfree(smi); -+ } -+ -+ return 0; -+} -+ -+static void rtl8367b_shutdown(struct platform_device *pdev) -+{ -+ struct rtl8366_smi *smi = platform_get_drvdata(pdev); -+ -+ if (smi) -+ rtl8367b_reset_chip(smi); -+} -+ -+#ifdef CONFIG_OF -+static const struct of_device_id rtl8367b_match[] = { -+ { .compatible = "realtek,rtl8367b" }, -+ { .compatible = "rtl8367b" }, -+ { .compatible = "realtek,rtl8367s" }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, rtl8367b_match); -+#endif -+ -+static struct platform_driver rtl8367b_driver = { -+ .driver = { -+ .name = RTL8367B_DRIVER_NAME, -+ .owner = THIS_MODULE, -+#ifdef CONFIG_OF -+ .of_match_table = of_match_ptr(rtl8367b_match), -+#endif -+ }, -+ .probe = rtl8367b_probe, -+ .remove = rtl8367b_remove, -+ .shutdown = rtl8367b_shutdown, -+}; -+ -+module_platform_driver(rtl8367b_driver); -+ -+MODULE_DESCRIPTION(RTL8367S_DRIVER_DESC); -+MODULE_LICENSE("GPL v2"); -+MODULE_ALIAS("platform:" RTL8367S_DRIVER_NAME); -+ -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/include/linux/rtl8367.h -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/include/linux/rtl8367.h -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/include/linux/rtl8367.h -@@ -18,6 +18,8 @@ enum rtl8367_port_speed { - RTL8367_PORT_SPEED_10 = 0, - RTL8367_PORT_SPEED_100, - RTL8367_PORT_SPEED_1000, -+ RTL8367S_PORT_SPEED_500M, -+ RTL8367S_PORT_SPEED_2500M, - }; - - struct rtl8367_port_ability { -@@ -39,6 +41,13 @@ enum rtl8367_extif_mode { - RTL8367_EXTIF_MODE_TMII_PHY, - RTL8367_EXTIF_MODE_GMII, - RTL8367_EXTIF_MODE_RGMII_33V, -+ RTL8367B_EXTIF_MODE_RMII_MAC = 7, -+ RTL8367B_EXTIF_MODE_RMII_PHY, -+ RTL8367B_EXTIF_MODE_RGMII_33V, -+ RTL8367S_EXTIF_MODE_1000X = 10, -+ RTL8367S_EXTIF_MODE_SGMII, -+ RTL8367S_EXTIF_MODE_HSGMII, -+ - }; - - struct rtl8367_extif_config { -Index: linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/mdio-qca.c -=================================================================== ---- linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016.orig/drivers/net/phy/mdio-qca.c -+++ linux-4.4.60-qsdk-11f09717303ecd83c3a64e9efe23f25921dc1016/drivers/net/phy/mdio-qca.c -@@ -37,8 +37,9 @@ - #define MDIO_CTRL_4_ACCESS_CODE_C45_ADDR 0 - #define MDIO_CTRL_4_ACCESS_CODE_C45_WRITE 1 - #define MDIO_CTRL_4_ACCESS_CODE_C45_READ 2 --#define CTRL_0_REG_DEFAULT_VALUE 0x1500F --#define CTRL_0_REG_C45_DEFAULT_VALUE 0x1510F -+#define CTRL_0_REG_DEFAULT_VALUE(div) (0x15000 | (div & 0xff)) // for mdio clock setting -+#define CTRL_0_REG_C45_DEFAULT_VALUE(div) (0x15100 | (div & 0xff)) -+ - - #define QCA_MDIO_RETRY 1000 - #define QCA_MDIO_DELAY 10 -@@ -56,6 +57,7 @@ struct qca_mdio_data { - struct clk *mdio_clk; - void __iomem *membase; - int phy_irq[PHY_MAX_ADDR]; -+ int clk_div; - }; - - static int qca_mdio_wait_busy(struct qca_mdio_data *am) -@@ -91,7 +93,7 @@ static int qca_mdio_read(struct mii_bus - unsigned int mmd = (regnum >> 16) & 0x1F; - unsigned int reg = regnum & 0xFFFF; - -- writel(CTRL_0_REG_C45_DEFAULT_VALUE, -+ writel(CTRL_0_REG_C45_DEFAULT_VALUE(am->clk_div), - am->membase + MDIO_CTRL_0_REG); - /* issue the phy address and mmd */ - writel((mii_id << 8) | mmd, am->membase + MDIO_CTRL_1_REG); -@@ -100,7 +102,7 @@ static int qca_mdio_read(struct mii_bus - cmd = MDIO_CTRL_4_ACCESS_START | - MDIO_CTRL_4_ACCESS_CODE_C45_ADDR; - } else { -- writel(CTRL_0_REG_DEFAULT_VALUE, am->membase + MDIO_CTRL_0_REG); -+ writel(CTRL_0_REG_DEFAULT_VALUE(am->clk_div), am->membase + MDIO_CTRL_0_REG); - /* issue the phy address and reg */ - writel((mii_id << 8) | regnum, am->membase + MDIO_CTRL_1_REG); - cmd = MDIO_CTRL_4_ACCESS_START | MDIO_CTRL_4_ACCESS_CODE_READ; -@@ -140,7 +142,7 @@ static int qca_mdio_write(struct mii_bus - unsigned int mmd = (regnum >> 16) & 0x1F; - unsigned int reg = regnum & 0xFFFF; - -- writel(CTRL_0_REG_C45_DEFAULT_VALUE, -+ writel(CTRL_0_REG_C45_DEFAULT_VALUE(am->clk_div), - am->membase + MDIO_CTRL_0_REG); - /* issue the phy address and mmd */ - writel((mii_id << 8) | mmd, am->membase + MDIO_CTRL_1_REG); -@@ -152,7 +154,7 @@ static int qca_mdio_write(struct mii_bus - if (qca_mdio_wait_busy(am)) - return -ETIMEDOUT; - } else { -- writel(CTRL_0_REG_DEFAULT_VALUE, am->membase + MDIO_CTRL_0_REG); -+ writel(CTRL_0_REG_DEFAULT_VALUE(am->clk_div), am->membase + MDIO_CTRL_0_REG); - /* issue the phy address and reg */ - writel((mii_id << 8) | regnum, am->membase + MDIO_CTRL_1_REG); - } -@@ -252,7 +254,7 @@ static int qca_mdio_probe(struct platfor - struct resource *res; - int ret, i; - struct reset_control *rst = ERR_PTR(-EINVAL); -- -+ int clk_div = 0xf; - if (of_machine_is_compatible("qcom,ipq5018")) { - qca_tcsr_ldo_rdy_set(true); - rst = of_reset_control_get(pdev->dev.of_node, "gephy_mdc_rst"); -@@ -260,9 +262,13 @@ static int qca_mdio_probe(struct platfor - reset_control_deassert(rst); - usleep_range(100000, 110000); - } -+ if (0 == of_property_read_u32(pdev->dev.of_node, "cig_clk_div", &ret)) //read the mdio clock value from dts -+ clk_div = ret; -+ dev_err(&pdev->dev,"CIG clk_div =%x\n",clk_div); - } - -- ret = qca_phy_reset(pdev); -+ -+ ret = qca_phy_reset(pdev); - if (ret) - dev_err(&pdev->dev, "Could not find reset gpio\n"); - -@@ -299,8 +305,8 @@ static int qca_mdio_probe(struct platfor - ret = -ENOMEM; - goto err_disable_clk; - } -- -- writel(CTRL_0_REG_DEFAULT_VALUE, am->membase + MDIO_CTRL_0_REG); -+ am->clk_div = clk_div ; -+ writel(CTRL_0_REG_DEFAULT_VALUE(am->clk_div), am->membase + MDIO_CTRL_0_REG); - - am->mii_bus->name = "qca_mdio"; - am->mii_bus->read = &qca_mdio_read; diff --git a/feeds/ipq807x/ipq807x/patches/800-GPIO-add-named-gpio-exports.patch b/feeds/ipq807x/ipq807x/patches/800-GPIO-add-named-gpio-exports.patch deleted file mode 100644 index a6ba92895..000000000 --- a/feeds/ipq807x/ipq807x/patches/800-GPIO-add-named-gpio-exports.patch +++ /dev/null @@ -1,162 +0,0 @@ -From cc809a441d8f2924f785eb863dfa6aef47a25b0b Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Tue, 12 Aug 2014 20:49:27 +0200 -Subject: [PATCH 30/36] GPIO: add named gpio exports - -Signed-off-by: John Crispin ---- a/drivers/gpio/gpiolib-of.c -+++ b/drivers/gpio/gpiolib-of.c -@@ -23,6 +23,8 @@ - #include - #include - #include -+#include -+#include - - #include "gpiolib.h" - -@@ -450,3 +452,72 @@ void of_gpiochip_remove(struct gpio_chip - gpiochip_remove_pin_ranges(chip); - of_node_put(chip->of_node); - } -+ -+#ifdef CONFIG_GPIO_SYSFS -+ -+static struct of_device_id gpio_export_ids[] = { -+ { .compatible = "gpio-export" }, -+ { /* sentinel */ } -+}; -+ -+static int of_gpio_export_probe(struct platform_device *pdev) -+{ -+ struct device_node *np = pdev->dev.of_node; -+ struct device_node *cnp; -+ u32 val; -+ int nb = 0; -+ -+ for_each_child_of_node(np, cnp) { -+ const char *name = NULL; -+ int gpio; -+ bool dmc; -+ int max_gpio = 1; -+ int i; -+ -+ of_property_read_string(cnp, "gpio-export,name", &name); -+ -+ if (!name) -+ max_gpio = of_gpio_count(cnp); -+ -+ for (i = 0; i < max_gpio; i++) { -+ unsigned flags = 0; -+ enum of_gpio_flags of_flags; -+ -+ gpio = of_get_gpio_flags(cnp, i, &of_flags); -+ if (!gpio_is_valid(gpio)) -+ return gpio; -+ -+ if (of_flags == OF_GPIO_ACTIVE_LOW) -+ flags |= GPIOF_ACTIVE_LOW; -+ -+ if (!of_property_read_u32(cnp, "gpio-export,output", &val)) -+ flags |= val ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; -+ else -+ flags |= GPIOF_IN; -+ -+ if (devm_gpio_request_one(&pdev->dev, gpio, flags, name ? name : of_node_full_name(np))) -+ continue; -+ -+ dmc = of_property_read_bool(cnp, "gpio-export,direction_may_change"); -+ gpio_export_with_name(gpio, dmc, name); -+ nb++; -+ } -+ } -+ -+ dev_info(&pdev->dev, "%d gpio(s) exported\n", nb); -+ -+ return 0; -+} -+ -+static struct platform_driver gpio_export_driver = { -+ .driver = { -+ .name = "gpio-export", -+ .owner = THIS_MODULE, -+ .of_match_table = of_match_ptr(gpio_export_ids), -+ }, -+ .probe = of_gpio_export_probe, -+}; -+ -+module_platform_driver(gpio_export_driver); -+ -+#endif ---- a/include/asm-generic/gpio.h -+++ b/include/asm-generic/gpio.h -@@ -122,6 +122,12 @@ static inline int gpio_export(unsigned g - return gpiod_export(gpio_to_desc(gpio), direction_may_change); - } - -+int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name); -+static inline int gpio_export_with_name(unsigned gpio, bool direction_may_change, const char *name) -+{ -+ return __gpiod_export(gpio_to_desc(gpio), direction_may_change, name); -+} -+ - static inline int gpio_export_link(struct device *dev, const char *name, - unsigned gpio) - { ---- a/include/linux/gpio/consumer.h -+++ b/include/linux/gpio/consumer.h -@@ -427,6 +427,7 @@ static inline struct gpio_desc *devm_get - - #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) - -+int _gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name); - int gpiod_export(struct gpio_desc *desc, bool direction_may_change); - int gpiod_export_link(struct device *dev, const char *name, - struct gpio_desc *desc); -@@ -434,6 +435,13 @@ void gpiod_unexport(struct gpio_desc *de - - #else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ - -+static inline int _gpiod_export(struct gpio_desc *desc, -+ bool direction_may_change, -+ const char *name) -+{ -+ return -ENOSYS; -+} -+ - static inline int gpiod_export(struct gpio_desc *desc, - bool direction_may_change) - { ---- a/drivers/gpio/gpiolib-sysfs.c -+++ b/drivers/gpio/gpiolib-sysfs.c -@@ -544,7 +544,7 @@ static struct class gpio_class = { - * - * Returns zero on success, else an error. - */ --int gpiod_export(struct gpio_desc *desc, bool direction_may_change) -+int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name) - { - struct gpio_chip *chip; - struct gpiod_data *data; -@@ -604,6 +604,8 @@ int gpiod_export(struct gpio_desc *desc, - offset = gpio_chip_hwgpio(desc); - if (chip->names && chip->names[offset]) - ioname = chip->names[offset]; -+ if (name) -+ ioname = name; - - dev = device_create_with_groups(&gpio_class, chip->dev, - MKDEV(0, 0), data, gpio_groups, -@@ -625,6 +627,12 @@ err_unlock: - gpiod_dbg(desc, "%s: status %d\n", __func__, status); - return status; - } -+EXPORT_SYMBOL_GPL(__gpiod_export); -+ -+int gpiod_export(struct gpio_desc *desc, bool direction_may_change) -+{ -+ return __gpiod_export(desc, direction_may_change, NULL); -+} - EXPORT_SYMBOL_GPL(gpiod_export); - - static int match_export(struct device *dev, const void *desc) diff --git a/feeds/ipq807x/ipq807x/patches/801-v4.9-Bluetooth-Fix-using-the-correct-source-address-type.patch b/feeds/ipq807x/ipq807x/patches/801-v4.9-Bluetooth-Fix-using-the-correct-source-address-type.patch deleted file mode 100644 index cca715677..000000000 --- a/feeds/ipq807x/ipq807x/patches/801-v4.9-Bluetooth-Fix-using-the-correct-source-address-type.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 39385cb5f3274735b03ed1f8e7ff517b02a0beed Mon Sep 17 00:00:00 2001 -From: Johan Hedberg -Date: Sat, 12 Nov 2016 17:03:07 +0200 -Subject: [PATCH] Bluetooth: Fix using the correct source address type - -The hci_get_route() API is used to look up local HCI devices, however -so far it has been incapable of dealing with anything else than the -public address of HCI devices. This completely breaks with LE-only HCI -devices that do not come with a public address, but use a static -random address instead. - -This patch exteds the hci_get_route() API with a src_type parameter -that's used for comparing with the right address of each HCI device. - -Signed-off-by: Johan Hedberg -Signed-off-by: Marcel Holtmann ---- - include/net/bluetooth/hci_core.h | 2 +- - net/bluetooth/6lowpan.c | 4 ++-- - net/bluetooth/hci_conn.c | 26 ++++++++++++++++++++++++-- - net/bluetooth/l2cap_core.c | 2 +- - net/bluetooth/rfcomm/tty.c | 2 +- - net/bluetooth/sco.c | 2 +- - 6 files changed, 30 insertions(+), 8 deletions(-) - ---- a/include/net/bluetooth/hci_core.h -+++ b/include/net/bluetooth/hci_core.h -@@ -1003,7 +1003,7 @@ static inline void hci_set_drvdata(struc - } - - struct hci_dev *hci_dev_get(int index); --struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); -+struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src, u8 src_type); - - struct hci_dev *hci_alloc_dev(void); - void hci_free_dev(struct hci_dev *hdev); ---- a/net/bluetooth/6lowpan.c -+++ b/net/bluetooth/6lowpan.c -@@ -1102,7 +1102,6 @@ static int get_l2cap_conn(char *buf, bda - { - struct hci_conn *hcon; - struct hci_dev *hdev; -- bdaddr_t *src = BDADDR_ANY; - int n; - - n = sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hhu", -@@ -1113,7 +1112,8 @@ static int get_l2cap_conn(char *buf, bda - if (n < 7) - return -EINVAL; - -- hdev = hci_get_route(addr, src); -+ /* The LE_PUBLIC address type is ignored because of BDADDR_ANY */ -+ hdev = hci_get_route(addr, BDADDR_ANY, BDADDR_LE_PUBLIC); - if (!hdev) - return -ENOENT; - ---- a/net/bluetooth/hci_conn.c -+++ b/net/bluetooth/hci_conn.c -@@ -609,7 +609,7 @@ int hci_conn_del(struct hci_conn *conn) - return 0; - } - --struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src) -+struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src, uint8_t src_type) - { - int use_src = bacmp(src, BDADDR_ANY); - struct hci_dev *hdev = NULL, *d; -@@ -630,7 +630,29 @@ struct hci_dev *hci_get_route(bdaddr_t * - */ - - if (use_src) { -- if (!bacmp(&d->bdaddr, src)) { -+ bdaddr_t id_addr; -+ u8 id_addr_type; -+ -+ if (src_type == BDADDR_BREDR) { -+ if (!lmp_bredr_capable(d)) -+ continue; -+ bacpy(&id_addr, &d->bdaddr); -+ id_addr_type = BDADDR_BREDR; -+ } else { -+ if (!lmp_le_capable(d)) -+ continue; -+ -+ hci_copy_identity_address(d, &id_addr, -+ &id_addr_type); -+ -+ /* Convert from HCI to three-value type */ -+ if (id_addr_type == ADDR_LE_DEV_PUBLIC) -+ id_addr_type = BDADDR_LE_PUBLIC; -+ else -+ id_addr_type = BDADDR_LE_RANDOM; -+ } -+ -+ if (!bacmp(&id_addr, src) && id_addr_type == src_type) { - hdev = d; break; - } - } else { ---- a/net/bluetooth/l2cap_core.c -+++ b/net/bluetooth/l2cap_core.c -@@ -7044,7 +7044,7 @@ int l2cap_chan_connect(struct l2cap_chan - BT_DBG("%pMR -> %pMR (type %u) psm 0x%2.2x", &chan->src, dst, - dst_type, __le16_to_cpu(psm)); - -- hdev = hci_get_route(dst, &chan->src); -+ hdev = hci_get_route(dst, &chan->src, chan->src_type); - if (!hdev) - return -EHOSTUNREACH; - ---- a/net/bluetooth/rfcomm/tty.c -+++ b/net/bluetooth/rfcomm/tty.c -@@ -178,7 +178,7 @@ static void rfcomm_reparent_device(struc - struct hci_dev *hdev; - struct hci_conn *conn; - -- hdev = hci_get_route(&dev->dst, &dev->src); -+ hdev = hci_get_route(&dev->dst, &dev->src, BDADDR_BREDR); - if (!hdev) - return; - ---- a/net/bluetooth/sco.c -+++ b/net/bluetooth/sco.c -@@ -219,7 +219,7 @@ static int sco_connect(struct sock *sk) - - BT_DBG("%pMR -> %pMR", &sco_pi(sk)->src, &sco_pi(sk)->dst); - -- hdev = hci_get_route(&sco_pi(sk)->dst, &sco_pi(sk)->src); -+ hdev = hci_get_route(&sco_pi(sk)->dst, &sco_pi(sk)->src, BDADDR_BREDR); - if (!hdev) - return -EHOSTUNREACH; - diff --git a/feeds/ipq807x/ipq807x/patches/802-v4.9-Bluetooth-Fix-the-HCI-to-MGMT-status-conversion-tabl.patch b/feeds/ipq807x/ipq807x/patches/802-v4.9-Bluetooth-Fix-the-HCI-to-MGMT-status-conversion-tabl.patch deleted file mode 100644 index 11b392e9d..000000000 --- a/feeds/ipq807x/ipq807x/patches/802-v4.9-Bluetooth-Fix-the-HCI-to-MGMT-status-conversion-tabl.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 345bafc04fa2dea44dbdc8bda5633de256a74262 Mon Sep 17 00:00:00 2001 -From: Yu Liu -Date: Mon, 19 Apr 2021 16:53:30 -0700 -Subject: [PATCH] Bluetooth: Fix the HCI to MGMT status conversion table - -[ Upstream commit 4ef36a52b0e47c80bbfd69c0cce61c7ae9f541ed ] - -0x2B, 0x31 and 0x33 are reserved for future use but were not present in -the HCI to MGMT conversion table, this caused the conversion to be -incorrect for the HCI status code greater than 0x2A. - -Reviewed-by: Miao-chen Chou -Signed-off-by: Yu Liu -Signed-off-by: Marcel Holtmann -Signed-off-by: Sasha Levin ---- - net/bluetooth/mgmt.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/net/bluetooth/mgmt.c -+++ b/net/bluetooth/mgmt.c -@@ -212,12 +212,15 @@ static u8 mgmt_status_table[] = { - MGMT_STATUS_TIMEOUT, /* Instant Passed */ - MGMT_STATUS_NOT_SUPPORTED, /* Pairing Not Supported */ - MGMT_STATUS_FAILED, /* Transaction Collision */ -+ MGMT_STATUS_FAILED, /* Reserved for future use */ - MGMT_STATUS_INVALID_PARAMS, /* Unacceptable Parameter */ - MGMT_STATUS_REJECTED, /* QoS Rejected */ - MGMT_STATUS_NOT_SUPPORTED, /* Classification Not Supported */ - MGMT_STATUS_REJECTED, /* Insufficient Security */ - MGMT_STATUS_INVALID_PARAMS, /* Parameter Out Of Range */ -+ MGMT_STATUS_FAILED, /* Reserved for future use */ - MGMT_STATUS_BUSY, /* Role Switch Pending */ -+ MGMT_STATUS_FAILED, /* Reserved for future use */ - MGMT_STATUS_FAILED, /* Slot Violation */ - MGMT_STATUS_FAILED, /* Role Switch Failed */ - MGMT_STATUS_INVALID_PARAMS, /* EIR Too Large */ diff --git a/feeds/ipq807x/ipq807x/patches/803-v4.9-Bluetooth-skip-invalid-hci_sync_conn_complete_evt.patch b/feeds/ipq807x/ipq807x/patches/803-v4.9-Bluetooth-skip-invalid-hci_sync_conn_complete_evt.patch deleted file mode 100644 index a6099e468..000000000 --- a/feeds/ipq807x/ipq807x/patches/803-v4.9-Bluetooth-skip-invalid-hci_sync_conn_complete_evt.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 433c3febcb837cf8f2758660c6a89e1d734c55dc Mon Sep 17 00:00:00 2001 -From: Desmond Cheong Zhi Xi -Date: Wed, 28 Jul 2021 15:51:04 +0800 -Subject: [PATCH] Bluetooth: skip invalid hci_sync_conn_complete_evt - -[ Upstream commit 92fe24a7db751b80925214ede43f8d2be792ea7b ] - -Syzbot reported a corrupted list in kobject_add_internal [1]. This -happens when multiple HCI_EV_SYNC_CONN_COMPLETE event packets with -status 0 are sent for the same HCI connection. This causes us to -register the device more than once which corrupts the kset list. - -As this is forbidden behavior, we add a check for whether we're -trying to process the same HCI_EV_SYNC_CONN_COMPLETE event multiple -times for one connection. If that's the case, the event is invalid, so -we report an error that the device is misbehaving, and ignore the -packet. - -Link: https://syzkaller.appspot.com/bug?extid=66264bf2fd0476be7e6c [1] -Reported-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com -Tested-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com -Signed-off-by: Desmond Cheong Zhi Xi -Signed-off-by: Marcel Holtmann -Signed-off-by: Sasha Levin ---- - net/bluetooth/hci_event.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - ---- a/net/bluetooth/hci_event.c -+++ b/net/bluetooth/hci_event.c -@@ -3748,6 +3748,21 @@ static void hci_sync_conn_complete_evt(s - - switch (ev->status) { - case 0x00: -+ /* The synchronous connection complete event should only be -+ * sent once per new connection. Receiving a successful -+ * complete event when the connection status is already -+ * BT_CONNECTED means that the device is misbehaving and sent -+ * multiple complete event packets for the same new connection. -+ * -+ * Registering the device more than once can corrupt kernel -+ * memory, hence upon detecting this invalid event, we report -+ * an error and ignore the packet. -+ */ -+ if (conn->state == BT_CONNECTED) { -+ bt_dev_err(hdev, "Ignoring connect complete event for existing connection"); -+ goto unlock; -+ } -+ - conn->handle = __le16_to_cpu(ev->handle); - conn->state = BT_CONNECTED; - conn->type = ev->link_type; diff --git a/feeds/ipq807x/ipq807x/patches/804-v4.9-Bluetooth-Fix-debugfs-entry-leak-in-hci_register_dev.patch b/feeds/ipq807x/ipq807x/patches/804-v4.9-Bluetooth-Fix-debugfs-entry-leak-in-hci_register_dev.patch deleted file mode 100644 index 794aac5b1..000000000 --- a/feeds/ipq807x/ipq807x/patches/804-v4.9-Bluetooth-Fix-debugfs-entry-leak-in-hci_register_dev.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 69f728dac41d13fc3e8d4514684e476ebd0d61f5 Mon Sep 17 00:00:00 2001 -From: Wei Yongjun -Date: Wed, 13 Oct 2021 16:55:46 +0800 -Subject: [PATCH] Bluetooth: Fix debugfs entry leak in hci_register_dev() - -[ Upstream commit 5a4bb6a8e981d3d0d492aa38412ee80b21033177 ] - -Fault injection test report debugfs entry leak as follows: - -debugfs: Directory 'hci0' with parent 'bluetooth' already present! - -When register_pm_notifier() failed in hci_register_dev(), the debugfs -create by debugfs_create_dir() do not removed in the error handing path. - -Add the remove debugfs code to fix it. - -Signed-off-by: Wei Yongjun -Signed-off-by: Marcel Holtmann -Signed-off-by: Sasha Levin ---- - net/bluetooth/hci_core.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/net/bluetooth/hci_core.c -+++ b/net/bluetooth/hci_core.c -@@ -3420,6 +3420,7 @@ int hci_register_dev(struct hci_dev *hde - return id; - - err_wqueue: -+ debugfs_remove_recursive(hdev->debugfs); - destroy_workqueue(hdev->workqueue); - destroy_workqueue(hdev->req_workqueue); - err: diff --git a/feeds/ipq807x/kmod-sched-cake/Makefile b/feeds/ipq807x/kmod-sched-cake/Makefile deleted file mode 100644 index cf859745b..000000000 --- a/feeds/ipq807x/kmod-sched-cake/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright (C) 2016 LEDE -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=sched-cake -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_MIRROR_HASH:=8bb4fa43368be5b5839a350419701b0bb3881b1641e037affea42630d75e56e6 -PKG_SOURCE_DATE:=2021-07-09 -PKG_SOURCE_VERSION:=d9e1398cc9091e9e7c7a740361e4617b75c24427 -#PKG_MIRROR_HASH:=5bf06a804824db36ae393fc174aeec7b12633176e05a765c0931b39df5bd34df -PKG_MAINTAINER:=Kevin Darbyshire-Bryant - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/sched-cake - SUBMENU:=Network Support - TITLE:=Cake fq_codel/blue derived shaper - URL:=https://github.com/dtaht/sch_cake - FILES:=$(PKG_BUILD_DIR)/sch_cake.ko - AUTOLOAD:=$(call AutoLoad,75,sch_cake) - DEPENDS:=+kmod-ipt-conntrack -endef - -include $(INCLUDE_DIR)/kernel-defaults.mk - -define KernelPackage/sched-cake/description - Common Applications Kept Enhanced fq_codel/blue derived shaper -endef - -define Build/Compile - $(KERNEL_MAKE) SUBDIRS="$(PKG_BUILD_DIR)" modules -endef - -$(eval $(call KernelPackage,sched-cake)) diff --git a/feeds/ipq807x/kmod-sched-cake/patches/100-compat.patch b/feeds/ipq807x/kmod-sched-cake/patches/100-compat.patch deleted file mode 100644 index aaa1272b9..000000000 --- a/feeds/ipq807x/kmod-sched-cake/patches/100-compat.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: sched-cake-2021-07-09-d9e1398c/cobalt_compat.h -=================================================================== ---- sched-cake-2021-07-09-d9e1398c.orig/cobalt_compat.h -+++ sched-cake-2021-07-09-d9e1398c/cobalt_compat.h -@@ -95,15 +95,6 @@ static inline unsigned int __tcp_hdrlen( - } - #endif - --#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE --static inline int skb_try_make_writable(struct sk_buff *skb, -- unsigned int write_len) --{ -- return skb_cloned(skb) && !skb_clone_writable(skb, write_len) && -- pskb_expand_head(skb, 0, 0, GFP_ATOMIC); --} --#endif -- - #if KERNEL_VERSION(4, 11, 0) > LINUX_VERSION_CODE - static inline int skb_mac_offset(const struct sk_buff *skb) - { diff --git a/feeds/ipq807x/linux/Makefile b/feeds/ipq807x/linux/Makefile deleted file mode 100644 index cf99f0b79..000000000 --- a/feeds/ipq807x/linux/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# -# Copyright (C) 2006-2010 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=kernel -PKG_FLAGS:=hold - -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages -SUBTARGETS = $(sort $(filter-out feeds,$(notdir $(wildcard $(TOPDIR)/target/linux/* $(TOPDIR)/target/linux/feeds/*)))) -SUBTARGET_MODULES = $(foreach t,$(SUBTARGETS),$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(t)/modules.mk $(TOPDIR)/target/linux/$(t)/modules.mk))) -SCAN_DEPS=modules/*.mk $(SUBTARGET_MODULES) $(TOPDIR)/include/netfilter-4.4.mk - -PKG_LICENSE:=GPL-2.0 -PKG_LICENSE_FILES:= - -export SHELL:=/bin/sh -.ONESHELL: -.SHELLFLAGS = -ec - -include $(INCLUDE_DIR)/package.mk - -ifeq ($(DUMP),) - STAMP_BUILT:=$(STAMP_BUILT)_$(shell $(SCRIPT_DIR)/kconfig.pl $(LINUX_DIR)/.config | $(MKHASH) md5) - -include $(LINUX_DIR)/.config -endif - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define KernelPackage/depends -endef - -CONFIG_PACKAGE_kernel=y -define Package/kernel - SECTION:=sys - CATEGORY:=Kernel - DEFAULT:=y - TITLE:=Virtual kernel package - VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC) - URL:=http://www.kernel.org/ - PKG_FLAGS:=nonshared - DEPENDS:=@!TARGET_ipq807x -endef - -define Package/kernel/install - # nothing to do -endef - -define Package/kernel/extra_provides - sed -e 's,.*/,,' $(LINUX_DIR)/modules.builtin; -endef - -$(eval $(if $(DUMP),,$(call BuildPackage,kernel))) - -include $(sort $(wildcard ./modules/*.mk)) --include $(SUBTARGET_MODULES) diff --git a/feeds/ipq807x/linux/files/hotplug-sched-teql.sh b/feeds/ipq807x/linux/files/hotplug-sched-teql.sh deleted file mode 100644 index 2dc4ed4a8..000000000 --- a/feeds/ipq807x/linux/files/hotplug-sched-teql.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh - -if [ "$ACTION" != "ifup" ]; then - exit -fi - -config_load network - -config_get teql $INTERFACE teql - -if [ "$teql" != "" ]; then - logger Adding device $DEVICE to TEQL master $teql - modprobe sch_teql - tc qdisc add dev $DEVICE root $teql - - # The kernel doesn't let us bring it up until it has at least one - # slave. So bring it up now, if it isn't already. - if ! cat /sys/class/net/$teql/carrier &>/dev/null; then - ifup $teql & - fi -fi diff --git a/feeds/ipq807x/linux/files/sysctl-br-netfilter.conf b/feeds/ipq807x/linux/files/sysctl-br-netfilter.conf deleted file mode 100644 index b10ddc087..000000000 --- a/feeds/ipq807x/linux/files/sysctl-br-netfilter.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Do not edit, changes to this file will be lost on upgrades -# /etc/sysctl.conf can be used to customize sysctl settings - -# disable bridge firewalling by default -net.bridge.bridge-nf-call-arptables=0 -net.bridge.bridge-nf-call-ip6tables=0 -net.bridge.bridge-nf-call-iptables=0 diff --git a/feeds/ipq807x/linux/files/sysctl-nf-conntrack.conf b/feeds/ipq807x/linux/files/sysctl-nf-conntrack.conf deleted file mode 100644 index c6a0ef362..000000000 --- a/feeds/ipq807x/linux/files/sysctl-nf-conntrack.conf +++ /dev/null @@ -1,8 +0,0 @@ -# Do not edit, changes to this file will be lost on upgrades -# /etc/sysctl.conf can be used to customize sysctl settings - -net.netfilter.nf_conntrack_acct=1 -net.netfilter.nf_conntrack_checksum=0 -net.netfilter.nf_conntrack_tcp_timeout_established=7440 -net.netfilter.nf_conntrack_udp_timeout=60 -net.netfilter.nf_conntrack_udp_timeout_stream=180 diff --git a/feeds/ipq807x/linux/files/sysctl-tcp-bbr.conf b/feeds/ipq807x/linux/files/sysctl-tcp-bbr.conf deleted file mode 100644 index 3a7dba2f0..000000000 --- a/feeds/ipq807x/linux/files/sysctl-tcp-bbr.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Do not edit, changes to this file will be lost on upgrades -# /etc/sysctl.conf can be used to customize sysctl settings - -net.ipv4.tcp_congestion_control=bbr diff --git a/feeds/ipq807x/linux/modules/001-depends.mk b/feeds/ipq807x/linux/modules/001-depends.mk deleted file mode 100644 index 806c3dcfd..000000000 --- a/feeds/ipq807x/linux/modules/001-depends.mk +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (C) 2010-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define AddDepends/nls - DEPENDS+= +kmod-nls-base $(foreach cp,$(1),+kmod-nls-$(cp)) -endef - -define AddDepends/rfkill - DEPENDS+= +USE_RFKILL:kmod-rfkill $(1) -endef diff --git a/feeds/ipq807x/linux/modules/block.mk b/feeds/ipq807x/linux/modules/block.mk deleted file mode 100644 index b7767b3d1..000000000 --- a/feeds/ipq807x/linux/modules/block.mk +++ /dev/null @@ -1,589 +0,0 @@ -# -# Copyright (C) 2006-2012 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -BLOCK_MENU:=Block Devices - -define KernelPackage/aoe - SUBMENU:=$(BLOCK_MENU) - TITLE:=ATA over Ethernet support - KCONFIG:=CONFIG_ATA_OVER_ETH - FILES:=$(LINUX_DIR)/drivers/block/aoe/aoe.ko - AUTOLOAD:=$(call AutoLoad,30,aoe) -endef - -define KernelPackage/aoe/description - Kernel support for ATA over Ethernet -endef - -$(eval $(call KernelPackage,aoe)) - - -define KernelPackage/ata-core - SUBMENU:=$(BLOCK_MENU) - TITLE:=Serial and Parallel ATA support - DEPENDS:=@PCI_SUPPORT||TARGET_sunxi +kmod-scsi-core - KCONFIG:=CONFIG_ATA - FILES:=$(LINUX_DIR)/drivers/ata/libata.ko -ifneq ($(wildcard $(LINUX_DIR)/drivers/ata/libahci.ko),) - FILES+=$(LINUX_DIR)/drivers/ata/libahci.ko -endif -endef - -$(eval $(call KernelPackage,ata-core)) - - -define AddDepends/ata - SUBMENU:=$(BLOCK_MENU) - DEPENDS+=+kmod-ata-core $(1) -endef - - -define KernelPackage/ata-ahci - TITLE:=AHCI Serial ATA support - KCONFIG:=CONFIG_SATA_AHCI - FILES:= \ - $(LINUX_DIR)/drivers/ata/ahci.ko - AUTOLOAD:=$(call AutoLoad,41,libahci ahci,1) - $(call AddDepends/ata) -endef - -define KernelPackage/ata-ahci/description - Support for AHCI Serial ATA controllers -endef - -$(eval $(call KernelPackage,ata-ahci)) - - -define KernelPackage/ata-ahci-platform - TITLE:=AHCI Serial ATA Platform support - KCONFIG:=CONFIG_SATA_AHCI_PLATFORM - FILES:= \ - $(LINUX_DIR)/drivers/ata/ahci_platform.ko \ - $(LINUX_DIR)/drivers/ata/libahci_platform.ko - AUTOLOAD:=$(call AutoLoad,40,libahci libahci_platform ahci_platform,1) - $(call AddDepends/ata,@TARGET_ipq806x||TARGET_layerscape||TARGET_sunxi) -endef - -define KernelPackage/ata-ahci-platform/description - Platform support for AHCI Serial ATA controllers -endef - -$(eval $(call KernelPackage,ata-ahci-platform)) - - -define KernelPackage/ata-artop - TITLE:=ARTOP 6210/6260 PATA support - KCONFIG:=CONFIG_PATA_ARTOP - FILES:=$(LINUX_DIR)/drivers/ata/pata_artop.ko - AUTOLOAD:=$(call AutoLoad,41,pata_artop,1) - $(call AddDepends/ata) -endef - -define KernelPackage/ata-artop/description - PATA support for ARTOP 6210/6260 host controllers -endef - -$(eval $(call KernelPackage,ata-artop)) - - -define KernelPackage/ata-marvell-sata - TITLE:=Marvell Serial ATA support - KCONFIG:=CONFIG_SATA_MV - FILES:=$(LINUX_DIR)/drivers/ata/sata_mv.ko - AUTOLOAD:=$(call AutoLoad,41,sata_mv,1) - $(call AddDepends/ata) -endef - -define KernelPackage/ata-marvell-sata/description - SATA support for marvell chipsets -endef - -$(eval $(call KernelPackage,ata-marvell-sata)) - - -define KernelPackage/ata-nvidia-sata - TITLE:=Nvidia Serial ATA support - KCONFIG:=CONFIG_SATA_NV - FILES:=$(LINUX_DIR)/drivers/ata/sata_nv.ko - AUTOLOAD:=$(call AutoLoad,41,sata_nv,1) - $(call AddDepends/ata) -endef - -$(eval $(call KernelPackage,ata-nvidia-sata)) - - -define KernelPackage/ata-pdc202xx-old - TITLE:=Older Promise PATA controller support - KCONFIG:= \ - CONFIG_ATA_SFF=y \ - CONFIG_PATA_PDC_OLD - FILES:=$(LINUX_DIR)/drivers/ata/pata_pdc202xx_old.ko - AUTOLOAD:=$(call AutoLoad,41,pata_pdc202xx_old,1) - $(call AddDepends/ata) -endef - -define KernelPackage/ata-pdc202xx-old/description - This option enables support for the Promise 20246, 20262, 20263, - 20265 and 20267 adapters -endef - -$(eval $(call KernelPackage,ata-pdc202xx-old)) - - -define KernelPackage/ata-piix - TITLE:=Intel PIIX PATA/SATA support - KCONFIG:=CONFIG_ATA_PIIX - FILES:=$(LINUX_DIR)/drivers/ata/ata_piix.ko - AUTOLOAD:=$(call AutoLoad,41,ata_piix,1) - $(call AddDepends/ata) -endef - -define KernelPackage/ata-piix/description - SATA support for Intel ICH5/6/7/8 series host controllers and - PATA support for Intel ESB/ICH/PIIX3/PIIX4 series host controllers -endef - -$(eval $(call KernelPackage,ata-piix)) - - -define KernelPackage/ata-sil - TITLE:=Silicon Image SATA support - KCONFIG:=CONFIG_SATA_SIL - FILES:=$(LINUX_DIR)/drivers/ata/sata_sil.ko - AUTOLOAD:=$(call AutoLoad,41,sata_sil,1) - $(call AddDepends/ata) -endef - -define KernelPackage/ata-sil/description - Support for Silicon Image Serial ATA controllers -endef - -$(eval $(call KernelPackage,ata-sil)) - - -define KernelPackage/ata-sil24 - TITLE:=Silicon Image 3124/3132 SATA support - KCONFIG:=CONFIG_SATA_SIL24 - FILES:=$(LINUX_DIR)/drivers/ata/sata_sil24.ko - AUTOLOAD:=$(call AutoLoad,41,sata_sil24,1) - $(call AddDepends/ata) -endef - -define KernelPackage/ata-sil24/description - Support for Silicon Image 3124/3132 Serial ATA controllers -endef - -$(eval $(call KernelPackage,ata-sil24)) - - -define KernelPackage/ata-via-sata - TITLE:=VIA SATA support - KCONFIG:=CONFIG_SATA_VIA - FILES:=$(LINUX_DIR)/drivers/ata/sata_via.ko - AUTOLOAD:=$(call AutoLoad,41,sata_via,1) - $(call AddDepends/ata) -endef - -define KernelPackage/ata-via-sata/description - This option enables support for VIA Serial ATA -endef - -$(eval $(call KernelPackage,ata-via-sata)) - - -define KernelPackage/block2mtd - SUBMENU:=$(BLOCK_MENU) - TITLE:=Block device MTD emulation - KCONFIG:=CONFIG_MTD_BLOCK2MTD - FILES:=$(LINUX_DIR)/drivers/mtd/devices/block2mtd.ko -endef - -$(eval $(call KernelPackage,block2mtd)) - - -define KernelPackage/dax - SUBMENU:=$(BLOCK_MENU) - TITLE:=DAX: direct access to differentiated memory - KCONFIG:=CONFIG_DAX - FILES:=$(LINUX_DIR)/drivers/dax/dax.ko -endef - -$(eval $(call KernelPackage,dax)) - - -define KernelPackage/dm - SUBMENU:=$(BLOCK_MENU) - TITLE:=Device Mapper - DEPENDS:=+kmod-crypto-manager +kmod-dax - # All the "=n" are unnecessary, they're only there - # to stop the config from asking the question. - # MIRROR is M because I've needed it for pvmove. - KCONFIG:= \ - CONFIG_BLK_DEV_MD=n \ - CONFIG_DM_DEBUG=n \ - CONFIG_DM_UEVENT=n \ - CONFIG_DM_DELAY=n \ - CONFIG_DM_LOG_WRITES=n \ - CONFIG_DM_MQ_DEFAULT=n \ - CONFIG_DM_MULTIPATH=n \ - CONFIG_DM_ZERO=n \ - CONFIG_DM_SNAPSHOT=n \ - CONFIG_DM_LOG_USERSPACE=n \ - CONFIG_MD=y \ - CONFIG_BLK_DEV_DM \ - CONFIG_DM_CRYPT \ - CONFIG_DM_MIRROR - FILES:= \ - $(LINUX_DIR)/drivers/md/dm-mod.ko \ - $(LINUX_DIR)/drivers/md/dm-crypt.ko \ - $(LINUX_DIR)/drivers/md/dm-log.ko \ - $(LINUX_DIR)/drivers/md/dm-mirror.ko \ - $(LINUX_DIR)/drivers/md/dm-region-hash.ko - AUTOLOAD:=$(call AutoLoad,30,dm-mod dm-log dm-region-hash dm-mirror dm-crypt) -endef - -define KernelPackage/dm/description - Kernel module necessary for LVM2 support -endef - -$(eval $(call KernelPackage,dm)) - -define KernelPackage/dm-raid - SUBMENU:=$(BLOCK_MENU) - TITLE:=LVM2 raid support - DEPENDS:=+kmod-dm +kmod-md-mod \ - +kmod-md-raid0 +kmod-md-raid1 +kmod-md-raid10 +kmod-md-raid456 - KCONFIG:= \ - CONFIG_DM_RAID - FILES:=$(LINUX_DIR)/drivers/md/dm-raid.ko - AUTOLOAD:=$(call AutoLoad,31,dm-raid) -endef - -define KernelPackage/dm-raid/description - Kernel module necessary for LVM2 raid support -endef - -$(eval $(call KernelPackage,dm-raid)) - - -define KernelPackage/iscsi-initiator - SUBMENU:=$(BLOCK_MENU) - TITLE:=iSCSI Initiator over TCP/IP - DEPENDS:=+kmod-scsi-core +kmod-crypto-hash - KCONFIG:= \ - CONFIG_INET \ - CONFIG_SCSI_LOWLEVEL=y \ - CONFIG_ISCSI_TCP \ - CONFIG_SCSI_ISCSI_ATTRS=y - FILES:= \ - $(LINUX_DIR)/drivers/scsi/iscsi_tcp.ko \ - $(LINUX_DIR)/drivers/scsi/libiscsi.ko \ - $(LINUX_DIR)/drivers/scsi/libiscsi_tcp.ko \ - $(LINUX_DIR)/drivers/scsi/scsi_transport_iscsi.ko - AUTOLOAD:=$(call AutoProbe,libiscsi libiscsi_tcp scsi_transport_iscsi iscsi_tcp) -endef - -define KernelPackage/iscsi-initiator/description -The iSCSI Driver provides a host with the ability to access storage through an -IP network. The driver uses the iSCSI protocol to transport SCSI requests and -responses over a TCP/IP network between the host (the "initiator") and "targets". -endef - -$(eval $(call KernelPackage,iscsi-initiator)) - - -define KernelPackage/md-mod - SUBMENU:=$(BLOCK_MENU) - TITLE:=MD RAID - KCONFIG:= \ - CONFIG_MD=y \ - CONFIG_BLK_DEV_MD=m \ - CONFIG_MD_AUTODETECT=y \ - CONFIG_MD_FAULTY=n - FILES:=$(LINUX_DIR)/drivers/md/md-mod.ko - AUTOLOAD:=$(call AutoLoad,27,md-mod) -endef - -define KernelPackage/md-mod/description - Kernel RAID md module (md-mod.ko). - You will need to select at least one RAID level module below. -endef - -$(eval $(call KernelPackage,md-mod)) - - -define KernelPackage/md/Depends - SUBMENU:=$(BLOCK_MENU) - DEPENDS:=kmod-md-mod $(1) -endef - - -define KernelPackage/md-linear -$(call KernelPackage/md/Depends,) - TITLE:=RAID Linear Module - KCONFIG:=CONFIG_MD_LINEAR - FILES:=$(LINUX_DIR)/drivers/md/linear.ko - AUTOLOAD:=$(call AutoLoad,28,linear) -endef - -define KernelPackage/md-linear/description - RAID "Linear" or "Append" driver module (linear.ko) -endef - -$(eval $(call KernelPackage,md-linear)) - - -define KernelPackage/md-raid0 -$(call KernelPackage/md/Depends,) - TITLE:=RAID0 Module - KCONFIG:=CONFIG_MD_RAID0 - FILES:=$(LINUX_DIR)/drivers/md/raid0.ko - AUTOLOAD:=$(call AutoLoad,28,raid0) -endef - -define KernelPackage/md-raid0/description - RAID Level 0 (Striping) driver module (raid0.ko) -endef - -$(eval $(call KernelPackage,md-raid0)) - - -define KernelPackage/md-raid1 -$(call KernelPackage/md/Depends,) - TITLE:=RAID1 Module - KCONFIG:=CONFIG_MD_RAID1 - FILES:=$(LINUX_DIR)/drivers/md/raid1.ko - AUTOLOAD:=$(call AutoLoad,28,raid1) -endef - -define KernelPackage/md-raid1/description - RAID Level 1 (Mirroring) driver (raid1.ko) -endef - -$(eval $(call KernelPackage,md-raid1)) - - -define KernelPackage/md-raid10 -$(call KernelPackage/md/Depends,) - TITLE:=RAID10 Module - KCONFIG:=CONFIG_MD_RAID10 - FILES:=$(LINUX_DIR)/drivers/md/raid10.ko - AUTOLOAD:=$(call AutoLoad,28,raid10) -endef - -define KernelPackage/md-raid10/description - RAID Level 10 (Mirroring+Striping) driver module (raid10.ko) -endef - -$(eval $(call KernelPackage,md-raid10)) - - -define KernelPackage/md-raid456 -$(call KernelPackage/md/Depends,+kmod-lib-raid6 +kmod-lib-xor +kmod-lib-crc32c) - TITLE:=RAID Level 456 Driver - KCONFIG:= \ - CONFIG_ASYNC_CORE \ - CONFIG_ASYNC_MEMCPY \ - CONFIG_ASYNC_XOR \ - CONFIG_ASYNC_PQ \ - CONFIG_ASYNC_RAID6_RECOV \ - CONFIG_ASYNC_RAID6_TEST=n \ - CONFIG_MD_RAID456 \ - CONFIG_MULTICORE_RAID456=n - FILES:= \ - $(LINUX_DIR)/crypto/async_tx/async_tx.ko \ - $(LINUX_DIR)/crypto/async_tx/async_memcpy.ko \ - $(LINUX_DIR)/crypto/async_tx/async_xor.ko \ - $(LINUX_DIR)/crypto/async_tx/async_pq.ko \ - $(LINUX_DIR)/crypto/async_tx/async_raid6_recov.ko \ - $(LINUX_DIR)/drivers/md/raid456.ko - AUTOLOAD:=$(call AutoLoad,28, async_tx async_memcpy async_xor async_pq async_raid6_recov raid456) -endef - -define KernelPackage/md-raid456/description - RAID Level 4,5,6 kernel module (raid456.ko) - - Includes the following modules required by - raid456.ko: - xor.ko - async_tx.ko - async_xor.ko - async_memcpy.ko - async_pq.ko - async_raid5_recov.ko - raid6_pq.ko -endef - -$(eval $(call KernelPackage,md-raid456)) - - -define KernelPackage/md-multipath -$(call KernelPackage/md/Depends,) - TITLE:=MD Multipath Module - KCONFIG:=CONFIG_MD_MULTIPATH - FILES:=$(LINUX_DIR)/drivers/md/multipath.ko - AUTOLOAD:=$(call AutoLoad,29,multipath) -endef - -define KernelPackage/md-multipath/description - Multipath driver module (multipath.ko) -endef - -$(eval $(call KernelPackage,md-multipath)) - - -define KernelPackage/libsas - SUBMENU:=$(BLOCK_MENU) - DEPENDS:=@TARGET_x86 - TITLE:=SAS Domain Transport Attributes - KCONFIG:=CONFIG_SCSI_SAS_LIBSAS \ - CONFIG_SCSI_SAS_ATTRS \ - CONFIG_SCSI_SAS_ATA=y \ - CONFIG_SCSI_SAS_HOST_SMP=y \ - CONFIG_SCSI_SAS_LIBSAS_DEBUG=y - FILES:= \ - $(LINUX_DIR)/drivers/scsi/scsi_transport_sas.ko \ - $(LINUX_DIR)/drivers/scsi/libsas/libsas.ko - AUTOLOAD:=$(call AutoLoad,29,scsi_transport_sas libsas,1) -endef - -define KernelPackage/libsas/description - SAS Domain Transport Attributes support -endef - -$(eval $(call KernelPackage,libsas,1)) - - -define KernelPackage/loop - SUBMENU:=$(BLOCK_MENU) - TITLE:=Loopback device support - KCONFIG:= \ - CONFIG_BLK_DEV_LOOP \ - CONFIG_BLK_DEV_CRYPTOLOOP=n - FILES:=$(LINUX_DIR)/drivers/block/loop.ko - AUTOLOAD:=$(call AutoLoad,30,loop) -endef - -define KernelPackage/loop/description - Kernel module for loopback device support -endef - -$(eval $(call KernelPackage,loop)) - - -define KernelPackage/mvsas - SUBMENU:=$(BLOCK_MENU) - TITLE:=Marvell 88SE6440 SAS/SATA driver - DEPENDS:=@TARGET_x86 +kmod-libsas - KCONFIG:= \ - CONFIG_SCSI_MVSAS \ - CONFIG_SCSI_MVSAS_TASKLET=n - FILES:=$(LINUX_DIR)/drivers/scsi/mvsas/mvsas.ko - AUTOLOAD:=$(call AutoLoad,40,mvsas,1) -endef - -define KernelPackage/mvsas/description - Kernel support for the Marvell SAS SCSI adapters -endef - -$(eval $(call KernelPackage,mvsas)) - - -define KernelPackage/nbd - SUBMENU:=$(BLOCK_MENU) - TITLE:=Network block device support - KCONFIG:=CONFIG_BLK_DEV_NBD - FILES:=$(LINUX_DIR)/drivers/block/nbd.ko - AUTOLOAD:=$(call AutoLoad,30,nbd) -endef - -define KernelPackage/nbd/description - Kernel module for network block device support -endef - -$(eval $(call KernelPackage,nbd)) - - -define KernelPackage/scsi-core - SUBMENU:=$(BLOCK_MENU) - TITLE:=SCSI device support - KCONFIG:= \ - CONFIG_SCSI \ - CONFIG_BLK_DEV_SD - FILES:= \ - $(LINUX_DIR)/drivers/scsi/scsi_mod.ko \ - $(LINUX_DIR)/drivers/scsi/sd_mod.ko - AUTOLOAD:=$(call AutoLoad,40,scsi_mod sd_mod,1) -endef - -$(eval $(call KernelPackage,scsi-core)) - - -define KernelPackage/scsi-generic - SUBMENU:=$(BLOCK_MENU) - TITLE:=Kernel support for SCSI generic - DEPENDS:=+kmod-scsi-core - KCONFIG:= \ - CONFIG_CHR_DEV_SG - FILES:= \ - $(LINUX_DIR)/drivers/scsi/sg.ko - AUTOLOAD:=$(call AutoLoad,65,sg) -endef - -$(eval $(call KernelPackage,scsi-generic)) - - -define KernelPackage/cdrom - TITLE:=Kernel library module for CD / DVD drives - KCONFIG:=CONFIG_CDROM - HIDDEN:=1 - FILES:=$(LINUX_DIR)/drivers/cdrom/cdrom.ko -endef - -$(eval $(call KernelPackage,cdrom)) - - -define KernelPackage/scsi-cdrom - SUBMENU:=$(BLOCK_MENU) - TITLE:=Kernel support for CD / DVD drives - DEPENDS:=+kmod-scsi-core +kmod-cdrom - KCONFIG:= \ - CONFIG_BLK_DEV_SR \ - CONFIG_BLK_DEV_SR_VENDOR=n - FILES:=$(LINUX_DIR)/drivers/scsi/sr_mod.ko - AUTOLOAD:=$(call AutoLoad,45,sr_mod) -endef - -$(eval $(call KernelPackage,scsi-cdrom)) - - -define KernelPackage/scsi-tape - SUBMENU:=$(BLOCK_MENU) - TITLE:=Kernel support for scsi tape drives - DEPENDS:=+kmod-scsi-core - KCONFIG:= \ - CONFIG_CHR_DEV_ST - FILES:= \ - $(LINUX_DIR)/drivers/scsi/st.ko - AUTOLOAD:=$(call AutoLoad,45,st) -endef - -$(eval $(call KernelPackage,scsi-tape)) - -define KernelPackage/iosched-bfq - SUBMENU:=$(BLOCK_MENU) - TITLE:=Kernel support for BFQ I/O scheduler - KCONFIG:= \ - CONFIG_IOSCHED_BFQ \ - CONFIG_BFQ_GROUP_IOSCHED=y \ - CONFIG_BFQ_CGROUP_DEBUG=n - FILES:= \ - $(LINUX_DIR)/block/bfq.ko - AUTOLOAD:=$(call AutoLoad,10,bfq) -endef - -$(eval $(call KernelPackage,iosched-bfq)) diff --git a/feeds/ipq807x/linux/modules/can.mk b/feeds/ipq807x/linux/modules/can.mk deleted file mode 100644 index 5542c4fe0..000000000 --- a/feeds/ipq807x/linux/modules/can.mk +++ /dev/null @@ -1,309 +0,0 @@ -# -# Copyright (C) 2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -CAN_MENU:=CAN Support - -define KernelPackage/can - SUBMENU:=$(CAN_MENU) - TITLE:=CAN bus support - KCONFIG:=\ - CONFIG_CAN=m \ - CONFIG_CAN_DEV \ - CONFIG_CAN_CALC_BITTIMING=y \ - CONFIG_CAN_LEDS=y \ - CONFIG_CAN_AT91=n \ - CONFIG_CAN_TI_HECC=n \ - CONFIG_CAN_MCP251X=n \ - CONFIG_CAN_BFIN=n \ - CONFIG_CAN_JANZ_ICAN3=n \ - CONFIG_PCH_CAN=n \ - CONFIG_CAN_GRCAN=n \ - CONFIG_CAN_CC770=n \ - CONFIG_CAN_MSCAN=n \ - CONFIG_CAN_SJA1000=n \ - CONFIG_CAN_SOFTING=n \ - CONFIG_NET_EMATCH_CANID=n \ - CONFIG_CAN_DEBUG_DEVICES=n - FILES:=$(LINUX_DIR)/drivers/net/can/dev/can-dev.ko \ - $(LINUX_DIR)/net/can/can.ko - AUTOLOAD:=$(call AutoProbe,can can-dev) -endef - -define KernelPackage/can/description - Kernel module for CAN bus support. -endef - -$(eval $(call KernelPackage,can)) - - -define AddDepends/can - SUBMENU:=$(CAN_MENU) - DEPENDS+=kmod-can $(1) -endef - - -define KernelPackage/can-bcm - TITLE:=Broadcast Manager CAN Protcol - KCONFIG:=CONFIG_CAN_BCM - FILES:=$(LINUX_DIR)/net/can/can-bcm.ko - AUTOLOAD:=$(call AutoProbe,can-bcm) - $(call AddDepends/can) -endef - -define KernelPackage/can-bcm/description - The Broadcast Manager offers content filtering, timeout monitoring, - sending of RTR frames, and cyclic CAN messages without permanent user - interaction. -endef - -$(eval $(call KernelPackage,can-bcm)) - - -define KernelPackage/can-c-can - TITLE:=BOSCH C_CAN/D_CAN drivers - KCONFIG:=CONFIG_CAN_C_CAN - FILES:=$(LINUX_DIR)/drivers/net/can/c_can/c_can.ko - AUTOLOAD:=$(call AutoProbe,c_can) - $(call AddDepends/can) -endef - -define KernelPackage/can-c-can/description - This driver adds generic support for the C_CAN/D_CAN chips. -endef - -$(eval $(call KernelPackage,can-c-can)) - - -define KernelPackage/can-c-can-pci - TITLE:=PCI Bus based BOSCH C_CAN/D_CAN driver - KCONFIG:=CONFIG_CAN_C_CAN_PCI - DEPENDS:=kmod-can-c-can @PCI_SUPPORT - FILES:=$(LINUX_DIR)/drivers/net/can/c_can/c_can_pci.ko - AUTOLOAD:=$(call AutoProbe,c_can_pci) - $(call AddDepends/can) -endef - -define KernelPackage/can-c-can-pci/description - This driver adds support for the C_CAN/D_CAN chips connected - to the PCI bus. -endef - -$(eval $(call KernelPackage,can-c-can-pci)) - - -define KernelPackage/can-c-can-platform - TITLE:=Platform Bus based BOSCH C_CAN/D_CAN driver - KCONFIG:=CONFIG_CAN_C_CAN_PLATFORM - DEPENDS:=kmod-can-c-can +kmod-regmap-core - FILES:=$(LINUX_DIR)/drivers/net/can/c_can/c_can_platform.ko - AUTOLOAD:=$(call AutoProbe,c_can_platform) - $(call AddDepends/can) -endef - -define KernelPackage/can-c-can-platform/description - This driver adds support for the C_CAN/D_CAN chips connected - to the "platform bus" (Linux abstraction for directly to the - processor attached devices) which can be found on various - boards from ST Microelectronics (http://www.st.com) like the - SPEAr1310 and SPEAr320 evaluation boards & TI (www.ti.com) - boards like am335x, dm814x, dm813x and dm811x. -endef - -$(eval $(call KernelPackage,can-c-can-platform)) - - -define KernelPackage/can-flexcan - TITLE:=Support for Freescale FLEXCAN based chips - KCONFIG:=CONFIG_CAN_FLEXCAN - FILES:=$(LINUX_DIR)/drivers/net/can/flexcan.ko - AUTOLOAD:=$(call AutoProbe,flexcan) - $(call AddDepends/can,@TARGET_imx6) -endef - -define KernelPackage/can-flexcan/description - Freescale FLEXCAN CAN bus controller implementation. -endef - -$(eval $(call KernelPackage,can-flexcan)) - - -define KernelPackage/can-gw - TITLE:=CAN Gateway/Router - KCONFIG:=CONFIG_CAN_GW - FILES:=$(LINUX_DIR)/net/can/can-gw.ko - AUTOLOAD:=$(call AutoProbe,can-gw) - $(call AddDepends/can) -endef - -define KernelPackage/can-gw/description - The CAN Gateway/Router is used to route (and modify) CAN frames. -endef - -$(eval $(call KernelPackage,can-gw)) - - -define KernelPackage/can-mcp251x - TITLE:=MCP251x SPI CAN controller - KCONFIG:=\ - CONFIG_SPI=y \ - CONFIG_CAN_MCP251X - FILES:=$(LINUX_DIR)/drivers/net/can/spi/mcp251x.ko - AUTOLOAD:=$(call AutoProbe,can-mcp251x) - $(call AddDepends/can) -endef - -define KernelPackage/can-mcp251x/description - Microchip MCP251x SPI CAN controller -endef - -$(eval $(call KernelPackage,can-mcp251x)) - - -define KernelPackage/can-raw - TITLE:=Raw CAN Protcol - KCONFIG:=CONFIG_CAN_RAW - FILES:=$(LINUX_DIR)/net/can/can-raw.ko - AUTOLOAD:=$(call AutoProbe,can-raw) - $(call AddDepends/can) -endef - -define KernelPackage/can-raw/description - The raw CAN protocol option offers access to the CAN bus via - the BSD socket API. -endef - -$(eval $(call KernelPackage,can-raw)) - - -define KernelPackage/can-slcan - TITLE:=Serial / USB serial CAN Adaptors (slcan) - KCONFIG:=CONFIG_CAN_SLCAN - FILES:=$(LINUX_DIR)/drivers/net/can/slcan.ko - AUTOLOAD:=$(call AutoProbe,slcan) - $(call AddDepends/can) -endef - -define KernelPackage/can-slcan/description - CAN driver for several 'low cost' CAN interfaces that are attached - via serial lines or via USB-to-serial adapters using the LAWICEL - ASCII protocol. -endef - -$(eval $(call KernelPackage,can-slcan)) - - -define KernelPackage/can-usb-8dev - TITLE:=8 devices USB2CAN interface - KCONFIG:=CONFIG_CAN_8DEV_USB - FILES:=$(LINUX_DIR)/drivers/net/can/usb/usb_8dev.ko - AUTOLOAD:=$(call AutoProbe,usb_8dev) - $(call AddDepends/can,+kmod-usb-core) -endef - -define KernelPackage/can-usb-8dev/description - This driver supports the USB2CAN interface - from 8 devices (http://www.8devices.com). -endef - -$(eval $(call KernelPackage,can-usb-8dev)) - - -define KernelPackage/can-usb-ems - TITLE:=EMS CPC-USB/ARM7 CAN/USB interface - KCONFIG:=CONFIG_CAN_EMS_USB - FILES:=$(LINUX_DIR)/drivers/net/can/usb/ems_usb.ko - AUTOLOAD:=$(call AutoProbe,ems_usb) - $(call AddDepends/can,+kmod-usb-core) -endef - -define KernelPackage/can-usb-ems/description - This driver is for the one channel CPC-USB/ARM7 CAN/USB interface - from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de). -endef - -$(eval $(call KernelPackage,can-usb-ems)) - - -define KernelPackage/can-usb-esd - TITLE:=ESD USB/2 CAN/USB interface - KCONFIG:=CONFIG_CAN_ESD_USB2 - FILES:=$(LINUX_DIR)/drivers/net/can/usb/esd_usb2.ko - AUTOLOAD:=$(call AutoProbe,esd_usb2) - $(call AddDepends/can,+kmod-usb-core) -endef - -define KernelPackage/can-usb-esd/description - This driver supports the CAN-USB/2 interface - from esd electronic system design gmbh (http://www.esd.eu). -endef - -$(eval $(call KernelPackage,can-usb-esd)) - - -define KernelPackage/can-usb-kvaser - TITLE:=Kvaser CAN/USB interface - KCONFIG:=CONFIG_CAN_KVASER_USB - FILES:= \ - $(LINUX_DIR)/drivers/net/can/usb/kvaser_usb.ko@lt4.19 \ - $(LINUX_DIR)/drivers/net/can/usb/kvaser_usb/kvaser_usb.ko@ge4.19 - AUTOLOAD:=$(call AutoProbe,kvaser_usb) - $(call AddDepends/can,+kmod-usb-core) -endef - -define KernelPackage/can-usb-kvaser/description - This driver adds support for Kvaser CAN/USB devices like Kvaser - Leaf Light. -endef - -$(eval $(call KernelPackage,can-usb-kvaser)) - - -define KernelPackage/can-usb-peak - TITLE:=PEAK PCAN-USB/USB Pro interfaces - KCONFIG:=CONFIG_CAN_PEAK_USB - FILES:=$(LINUX_DIR)/drivers/net/can/usb/peak_usb/peak_usb.ko - AUTOLOAD:=$(call AutoProbe,peak_usb) - $(call AddDepends/can,+kmod-usb-core) -endef - -define KernelPackage/can-usb-peak/description - This driver supports the PCAN-USB and PCAN-USB Pro adapters - from PEAK-System Technik (http://www.peak-system.com). -endef - -$(eval $(call KernelPackage,can-usb-peak)) - - -define KernelPackage/can-vcan - TITLE:=Virtual Local CAN Interface (vcan) - KCONFIG:=CONFIG_CAN_VCAN - FILES:=$(LINUX_DIR)/drivers/net/can/vcan.ko - AUTOLOAD:=$(call AutoProbe,vcan) - $(call AddDepends/can) -endef - -define KernelPackage/can-vcan/description - Similar to the network loopback devices, vcan offers a - virtual local CAN interface. -endef - -$(eval $(call KernelPackage,can-vcan)) - -define KernelPackage/can-xilinx-can - TITLE:=Xilinx CAN IP - KCONFIG:=CONFIG_CAN_XILINXCAN - FILES:=$(LINUX_DIR)/drivers/net/can/xilinx_can.ko - AUTOLOAD:=$(call AutoProbe,xilinx_can) - $(call AddDepends/can,@TARGET_zynq) -endef - -define KernelPackage/can-xilinx-can/description - Xilinx CAN driver. This driver supports both - soft AXI CAN IP and Zynq CANPS IP. -endef - -$(eval $(call KernelPackage,can-xilinx-can)) diff --git a/feeds/ipq807x/linux/modules/crypto.mk b/feeds/ipq807x/linux/modules/crypto.mk deleted file mode 100644 index a68459d98..000000000 --- a/feeds/ipq807x/linux/modules/crypto.mk +++ /dev/null @@ -1,1005 +0,0 @@ -# -# Copyright (C) 2006-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -CRYPTO_MENU:=Cryptographic API modules - -CRYPTO_MODULES = \ - ALGAPI2=crypto_algapi \ - BLKCIPHER2=crypto_blkcipher - -CRYPTO_TARGET = $(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic) - -crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1))) -crypto_file=$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).ko -crypto_name=$(if $(findstring y,$($(call crypto_confvar,$(1)))),,$(word 2,$(subst =,$(space),$(1)))) - -define AddDepends/crypto - SUBMENU:=$(CRYPTO_MENU) - DEPENDS+= $(1) -endef - - -define KernelPackage/crypto-acompress - TITLE:=Asynchronous Compression operations - HIDDEN:=1 - KCONFIG:=CONFIG_CRYPTO_ACOMP2 - FILES:=$(LINUX_DIR)/crypto/crypto_acompress.ko - AUTOLOAD:=$(call AutoLoad,09,crypto_acompress) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-acompress)) - - -define KernelPackage/crypto-aead - TITLE:=CryptoAPI AEAD support - KCONFIG:= \ - CONFIG_CRYPTO_AEAD \ - CONFIG_CRYPTO_AEAD2 - FILES:=$(LINUX_DIR)/crypto/aead.ko - AUTOLOAD:=$(call AutoLoad,09,aead,1) - $(call AddDepends/crypto, +kmod-crypto-null) -endef - -$(eval $(call KernelPackage,crypto-aead)) - - -define KernelPackage/crypto-arc4 - TITLE:=ARC4 cipher CryptoAPI module - KCONFIG:=CONFIG_CRYPTO_ARC4 - FILES:=$(LINUX_DIR)/crypto/arc4.ko - AUTOLOAD:=$(call AutoLoad,09,arc4) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-arc4)) - - -define KernelPackage/crypto-authenc - TITLE:=Combined mode wrapper for IPsec - DEPENDS:=+kmod-crypto-manager +kmod-crypto-null - KCONFIG:=CONFIG_CRYPTO_AUTHENC - FILES:=$(LINUX_DIR)/crypto/authenc.ko - AUTOLOAD:=$(call AutoLoad,09,authenc) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-authenc)) - - -define KernelPackage/crypto-cbc - TITLE:=Cipher Block Chaining CryptoAPI module - DEPENDS:=+kmod-crypto-manager - KCONFIG:=CONFIG_CRYPTO_CBC - FILES:=$(LINUX_DIR)/crypto/cbc.ko - AUTOLOAD:=$(call AutoLoad,09,cbc) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-cbc)) - - -define KernelPackage/crypto-ccm - TITLE:=Support for Counter with CBC MAC (CCM) - DEPENDS:=+kmod-crypto-ctr +kmod-crypto-aead - KCONFIG:=CONFIG_CRYPTO_CCM - FILES:=$(LINUX_DIR)/crypto/ccm.ko - AUTOLOAD:=$(call AutoLoad,09,ccm) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-ccm)) - - -define KernelPackage/crypto-cmac - TITLE:=Support for Cipher-based Message Authentication Code (CMAC) - DEPENDS:=+kmod-crypto-hash - KCONFIG:=CONFIG_CRYPTO_CMAC - FILES:=$(LINUX_DIR)/crypto/cmac.ko - AUTOLOAD:=$(call AutoLoad,09,cmac) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-cmac)) - - -define KernelPackage/crypto-crc32 - TITLE:=CRC32 CRC module - DEPENDS:=+kmod-crypto-hash - KCONFIG:=CONFIG_CRYPTO_CRC32 - HIDDEN:=1 - FILES:=$(LINUX_DIR)/crypto/crc32_generic.ko - AUTOLOAD:=$(call AutoLoad,04,crc32_generic,1) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-crc32)) - - -define KernelPackage/crypto-crc32c - TITLE:=CRC32c CRC module - DEPENDS:=+kmod-crypto-hash - KCONFIG:=CONFIG_CRYPTO_CRC32C - FILES:=$(LINUX_DIR)/crypto/crc32c_generic.ko - AUTOLOAD:=$(call AutoLoad,04,crc32c_generic,1) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-crc32c)) - - -define KernelPackage/crypto-ctr - TITLE:=Counter Mode CryptoAPI module - DEPENDS:=+kmod-crypto-manager +kmod-crypto-seqiv - KCONFIG:=CONFIG_CRYPTO_CTR - FILES:=$(LINUX_DIR)/crypto/ctr.ko - AUTOLOAD:=$(call AutoLoad,09,ctr) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-ctr)) - - -define KernelPackage/crypto-cts - TITLE:=Cipher Text Stealing CryptoAPI module - DEPENDS:=+kmod-crypto-manager - KCONFIG:=CONFIG_CRYPTO_CTS - FILES:=$(LINUX_DIR)/crypto/cts.ko - AUTOLOAD:=$(call AutoLoad,09,cts) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-cts)) - - -define KernelPackage/crypto-deflate - TITLE:=Deflate compression CryptoAPI module - DEPENDS:=+kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-crypto-acompress - KCONFIG:=CONFIG_CRYPTO_DEFLATE - FILES:=$(LINUX_DIR)/crypto/deflate.ko - AUTOLOAD:=$(call AutoLoad,09,deflate) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-deflate)) - - -define KernelPackage/crypto-des - TITLE:=DES/3DES cipher CryptoAPI module - KCONFIG:=CONFIG_CRYPTO_DES - FILES:= \ - $(LINUX_DIR)/crypto/des_generic.ko \ - $(LINUX_DIR)/lib/crypto/libdes.ko - AUTOLOAD:=$(call AutoLoad,09,des_generic) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-des)) - - -define KernelPackage/crypto-ecb - TITLE:=Electronic CodeBook CryptoAPI module - DEPENDS:=+kmod-crypto-manager - KCONFIG:=CONFIG_CRYPTO_ECB - FILES:=$(LINUX_DIR)/crypto/ecb.ko - AUTOLOAD:=$(call AutoLoad,09,ecb) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-ecb)) - - -define KernelPackage/crypto-ecdh - TITLE:=ECDH algorithm - DEPENDS:=+kmod-crypto-kpp - KCONFIG:= CONFIG_CRYPTO_ECDH - FILES:= \ - $(LINUX_DIR)/crypto/ecdh_generic.ko \ - $(LINUX_DIR)/crypto/ecc.ko - AUTOLOAD:=$(call AutoLoad,10,ecdh_generic) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-ecdh)) - - -define KernelPackage/crypto-echainiv - TITLE:=Encrypted Chain IV Generator - DEPENDS:=+kmod-crypto-aead - KCONFIG:=CONFIG_CRYPTO_ECHAINIV - FILES:=$(LINUX_DIR)/crypto/echainiv.ko - AUTOLOAD:=$(call AutoLoad,09,echainiv) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-echainiv)) - - -define KernelPackage/crypto-fcrypt - TITLE:=FCRYPT cipher CryptoAPI module - KCONFIG:=CONFIG_CRYPTO_FCRYPT - FILES:=$(LINUX_DIR)/crypto/fcrypt.ko - AUTOLOAD:=$(call AutoLoad,09,fcrypt) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-fcrypt)) - - -define KernelPackage/crypto-gcm - TITLE:=GCM/GMAC CryptoAPI module - DEPENDS:=+kmod-crypto-ctr +kmod-crypto-ghash +kmod-crypto-null - KCONFIG:=CONFIG_CRYPTO_GCM - FILES:=$(LINUX_DIR)/crypto/gcm.ko - AUTOLOAD:=$(call AutoLoad,09,gcm) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-gcm)) - - -define KernelPackage/crypto-xcbc - TITLE:=XCBC CryptoAPI module - DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager - KCONFIG:=CONFIG_CRYPTO_XCBC - FILES:=$(LINUX_DIR)/crypto/xcbc.ko - AUTOLOAD:=$(call AutoLoad,09,xcbc) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-xcbc)) - - -define KernelPackage/crypto-gf128 - TITLE:=GF(2^128) multiplication functions CryptoAPI module - KCONFIG:=CONFIG_CRYPTO_GF128MUL - FILES:=$(LINUX_DIR)/crypto/gf128mul.ko - AUTOLOAD:=$(call AutoLoad,09,gf128mul) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-gf128)) - - -define KernelPackage/crypto-ghash - TITLE:=GHASH digest CryptoAPI module - DEPENDS:=+kmod-crypto-gf128 +kmod-crypto-hash - KCONFIG:= \ - CONFIG_CRYPTO_GHASH \ - CONFIG_CRYPTO_GHASH_ARM_CE - FILES:=$(LINUX_DIR)/crypto/ghash-generic.ko - AUTOLOAD:=$(call AutoLoad,09,ghash-generic) - $(call AddDepends/crypto) -endef - -define KernelPackage/crypto-ghash/arm-ce - FILES+= $(LINUX_DIR)/arch/arm/crypto/ghash-arm-ce.ko - AUTOLOAD+=$(call AutoLoad,09,ghash-arm-ce) -endef - -KernelPackage/crypto-ghash/imx6=$(KernelPackage/crypto-ghash/arm-ce) -KernelPackage/crypto-ghash/ipq40xx=$(KernelPackage/crypto-ghash/arm-ce) -KernelPackage/crypto-ghash/mvebu/cortexa9=$(KernelPackage/crypto-ghash/arm-ce) - -$(eval $(call KernelPackage,crypto-ghash)) - - -define KernelPackage/crypto-hash - TITLE:=CryptoAPI hash support - KCONFIG:=CONFIG_CRYPTO_HASH - FILES:=$(LINUX_DIR)/crypto/crypto_hash.ko - AUTOLOAD:=$(call AutoLoad,02,crypto_hash,1) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-hash)) - - -define KernelPackage/crypto-hmac - TITLE:=HMAC digest CryptoAPI module - DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager - KCONFIG:=CONFIG_CRYPTO_HMAC - FILES:=$(LINUX_DIR)/crypto/hmac.ko - AUTOLOAD:=$(call AutoLoad,09,hmac) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-hmac)) - - -define KernelPackage/crypto-hw-ccp - TITLE:=AMD Cryptographic Coprocessor - DEPENDS:= \ - @TARGET_x86 \ - +kmod-crypto-authenc \ - +kmod-crypto-hash \ - +kmod-crypto-manager \ - +kmod-crypto-rsa \ - +kmod-crypto-sha1 \ - +kmod-crypto-sha256 \ - +kmod-random-core - KCONFIG:= \ - CONFIG_CRYPTO_HW=y \ - CONFIG_CRYPTO_DEV_CCP=y \ - CONFIG_CRYPTO_DEV_CCP_CRYPTO \ - CONFIG_CRYPTO_DEV_CCP_DD \ - CONFIG_CRYPTO_DEV_SP_CCP=y - FILES:= \ - $(LINUX_DIR)/drivers/crypto/ccp/ccp.ko \ - $(LINUX_DIR)/drivers/crypto/ccp/ccp-crypto.ko - AUTOLOAD:=$(call AutoLoad,09,ccp ccp-crypto) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-hw-ccp)) - - -define KernelPackage/crypto-hw-geode - TITLE:=AMD Geode hardware crypto module - DEPENDS:=+kmod-crypto-manager - KCONFIG:= \ - CONFIG_CRYPTO_HW=y \ - CONFIG_CRYPTO_DEV_GEODE - FILES:=$(LINUX_DIR)/drivers/crypto/geode-aes.ko - AUTOLOAD:=$(call AutoLoad,09,geode-aes) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-hw-geode)) - - -define KernelPackage/crypto-hw-hifn-795x - TITLE:=HIFN 795x crypto accelerator - DEPENDS:=+kmod-random-core +kmod-crypto-manager - KCONFIG:= \ - CONFIG_CRYPTO_HW=y \ - CONFIG_CRYPTO_DEV_HIFN_795X \ - CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y - FILES:=$(LINUX_DIR)/drivers/crypto/hifn_795x.ko - AUTOLOAD:=$(call AutoLoad,09,hifn_795x) - $(call AddDepends/crypto,+kmod-crypto-des) -endef - -$(eval $(call KernelPackage,crypto-hw-hifn-795x)) - - -define KernelPackage/crypto-hw-padlock - TITLE:=VIA PadLock ACE with AES/SHA hw crypto module - DEPENDS:=+kmod-crypto-manager - KCONFIG:= \ - CONFIG_CRYPTO_HW=y \ - CONFIG_CRYPTO_DEV_PADLOCK \ - CONFIG_CRYPTO_DEV_PADLOCK_AES \ - CONFIG_CRYPTO_DEV_PADLOCK_SHA - FILES:= \ - $(LINUX_DIR)/drivers/crypto/padlock-aes.ko \ - $(LINUX_DIR)/drivers/crypto/padlock-sha.ko - AUTOLOAD:=$(call AutoLoad,09,padlock-aes padlock-sha) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-hw-padlock)) - - -define KernelPackage/crypto-hw-safexcel - TITLE:= MVEBU SafeXcel Crypto Engine module - DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) +eip197-mini-firmware \ - +kmod-crypto-authenc +kmod-crypto-md5 +kmod-crypto-hmac +kmod-crypto-sha256 +kmod-crypto-sha512 - KCONFIG:= \ - CONFIG_CRYPTO_HW=y \ - CONFIG_CRYPTO_DEV_SAFEXCEL - FILES:=$(LINUX_DIR)/drivers/crypto/inside-secure/crypto_safexcel.ko - AUTOLOAD:=$(call AutoLoad,90,crypto_safexcel) - $(call AddDepends/crypto) -endef - -define KernelPackage/crypto-hw-safexcel/description -MVEBU's EIP97 and EIP197 Cryptographic Engine driver designed by -Inside Secure. This is found on Marvell Armada 37xx/7k/8k SoCs. - -Particular version of these IP (EIP197B and EIP197D) require firmware. -The mini firmware package provides limited functionality, for most operations -a full-featured firmware is required. Unfortunately the "full" firmware is not -freely available and needs signed Non-Disclosure Agreement (NDA) with Marvell. -For those who have signed NDA the firmware can be obtained at -https://extranet.marvell.com. -endef - -$(eval $(call KernelPackage,crypto-hw-safexcel)) - - -define KernelPackage/crypto-hw-talitos - TITLE:=Freescale integrated security engine (SEC) driver - DEPENDS:=+kmod-crypto-manager +kmod-crypto-hash +kmod-random-core +kmod-crypto-authenc +kmod-crypto-des - KCONFIG:= \ - CONFIG_CRYPTO_HW=y \ - CONFIG_CRYPTO_DEV_TALITOS \ - CONFIG_CRYPTO_DEV_TALITOS1=y \ - CONFIG_CRYPTO_DEV_TALITOS2=y - FILES:= \ - $(LINUX_DIR)/drivers/crypto/talitos.ko - AUTOLOAD:=$(call AutoLoad,09,talitos) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-hw-talitos)) - - -define KernelPackage/crypto-kpp - TITLE:=Key-agreement Protocol Primitives - KCONFIG:=CONFIG_CRYPTO_KPP - FILES:=$(LINUX_DIR)/crypto/kpp.ko - AUTOLOAD:=$(call AutoLoad,09,kpp) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-kpp)) - - -define KernelPackage/crypto-lib-blake2s - TITLE:=BLAKE2s hash function library - KCONFIG:=CONFIG_CRYPTO_LIB_BLAKE2S - HIDDEN:=1 - FILES:= \ - $(LINUX_DIR)/lib/crypto/libblake2s.ko \ - $(LINUX_DIR)/lib/crypto/libblake2s-generic.ko - $(call AddDepends/crypto,+PACKAGE_kmod-crypto-hash:kmod-crypto-hash) -endef - -define KernelPackage/crypto-lib-blake2s/config - imply PACKAGE_kmod-crypto-hash -endef - -define KernelPackage/crypto-lib-blake2s/x86/64 - KCONFIG+=CONFIG_CRYPTO_BLAKE2S_X86 - FILES+=$(LINUX_DIR)/arch/x86/crypto/blake2s-x86_64.ko -endef - -$(eval $(call KernelPackage,crypto-lib-blake2s)) - - -define KernelPackage/crypto-lib-chacha20 - TITLE:=ChaCha library interface - KCONFIG:=CONFIG_CRYPTO_LIB_CHACHA - HIDDEN:=1 - FILES:=$(LINUX_DIR)/lib/crypto/libchacha.ko - $(call AddDepends/crypto) -endef - -define KernelPackage/crypto-lib-chacha20/x86_64 - KCONFIG+=CONFIG_CRYPTO_CHACHA20_X86_64 - FILES+=$(LINUX_DIR)/arch/x86/crypto/chacha-x86_64.ko -endef - -# Note that a non-neon fallback implementation is available on arm32 when -# NEON is not supported, hence all arm targets can utilize lib-chacha20/arm -define KernelPackage/crypto-lib-chacha20/arm - KCONFIG+=CONFIG_CRYPTO_CHACHA20_NEON - FILES:=$(LINUX_DIR)/arch/arm/crypto/chacha-neon.ko -endef - -define KernelPackage/crypto-lib-chacha20/aarch64 - KCONFIG+=CONFIG_CRYPTO_CHACHA20_NEON - FILES+=$(LINUX_DIR)/arch/arm64/crypto/chacha-neon.ko -endef - -define KernelPackage/crypto-lib-chacha20/mips32r2 - KCONFIG+=CONFIG_CRYPTO_CHACHA_MIPS - FILES:=$(LINUX_DIR)/arch/mips/crypto/chacha-mips.ko -endef - -ifeq ($(CONFIG_CPU_MIPS32_R2),y) - KernelPackage/crypto-lib-chacha20/$(ARCH)=\ - $(KernelPackage/crypto-lib-chacha20/mips32r2) -endif - -ifdef KernelPackage/crypto-lib-chacha20/$(ARCH) - KernelPackage/crypto-lib-chacha20/$(CRYPTO_TARGET)=\ - $(KernelPackage/crypto-lib-chacha20/$(ARCH)) -endif - -$(eval $(call KernelPackage,crypto-lib-chacha20)) - - -define KernelPackage/crypto-lib-chacha20poly1305 - TITLE:=ChaCha20-Poly1305 AEAD support (8-byte nonce library version) - KCONFIG:=CONFIG_CRYPTO_LIB_CHACHA20POLY1305 - HIDDEN:=1 - FILES:=$(LINUX_DIR)/lib/crypto/libchacha20poly1305.ko - $(call AddDepends/crypto, +kmod-crypto-lib-chacha20 +kmod-crypto-lib-poly1305) -endef - -$(eval $(call KernelPackage,crypto-lib-chacha20poly1305)) - - -define KernelPackage/crypto-lib-curve25519 - TITLE:=Curve25519 scalar multiplication library - KCONFIG:=CONFIG_CRYPTO_LIB_CURVE25519 - HIDDEN:=1 - FILES:= \ - $(LINUX_DIR)/lib/crypto/libcurve25519.ko \ - $(LINUX_DIR)/lib/crypto/libcurve25519-generic.ko - $(call AddDepends/crypto,+PACKAGE_kmod-crypto-kpp:kmod-crypto-kpp) -endef - -define KernelPackage/crypto-lib-curve25519/config - imply PACKAGE_kmod-crypto-kpp -endef - -define KernelPackage/crypto-lib-curve25519/x86/64 - KCONFIG+=CONFIG_CRYPTO_CURVE25519_X86 - FILES+=$(LINUX_DIR)/arch/x86/crypto/curve25519-x86_64.ko -endef - -define KernelPackage/crypto-lib-curve25519/arm-neon - KCONFIG+=CONFIG_CRYPTO_CURVE25519_NEON - FILES+=$(LINUX_DIR)/arch/arm/crypto/curve25519-neon.ko -endef - -ifeq ($(ARCH)-$(CONFIG_KERNEL_MODE_NEON),arm-y) - KernelPackage/crypto-lib-curve25519/$(CRYPTO_TARGET)=\ - $(KernelPackage/crypto-lib-curve25519/arm-neon) -endif - -$(eval $(call KernelPackage,crypto-lib-curve25519)) - - -define KernelPackage/crypto-lib-poly1305 - TITLE:=Poly1305 library interface - KCONFIG:=CONFIG_CRYPTO_LIB_POLY1305 - HIDDEN:=1 - FILES:=$(LINUX_DIR)/lib/crypto/libpoly1305.ko - $(call AddDepends/crypto,+PACKAGE_kmod-crypto-hash:kmod-crypto-hash) -endef - -define KernelPackage/crypto-lib-poly1305/config - imply PACKAGE_kmod-crypto-hash -endef - -define KernelPackage/crypto-lib-poly1305/x86_64 - KCONFIG+=CONFIG_CRYPTO_POLY1305_X86_64 - FILES+=$(LINUX_DIR)/arch/x86/crypto/poly1305-x86_64.ko -endef - -define KernelPackage/crypto-lib-poly1305/arm - KCONFIG+=CONFIG_CRYPTO_POLY1305_ARM - FILES:=$(LINUX_DIR)/arch/arm/crypto/poly1305-arm.ko -endef - -define KernelPackage/crypto-lib-poly1305/aarch64 - KCONFIG+=CONFIG_CRYPTO_POLY1305_NEON - FILES:=$(LINUX_DIR)/arch/arm64/crypto/poly1305-neon.ko -endef - -define KernelPackage/crypto-lib-poly1305/mips - KCONFIG+=CONFIG_CRYPTO_POLY1305_MIPS - FILES:=$(LINUX_DIR)/arch/mips/crypto/poly1305-mips.ko -endef - -KernelPackage/crypto-lib-poly1305/mipsel=$(KernelPackage/crypto-lib-poly1305/mips) -KernelPackage/crypto-lib-poly1305/mips64=$(KernelPackage/crypto-lib-poly1305/mips) -KernelPackage/crypto-lib-poly1305/mips64el=$(KernelPackage/crypto-lib-poly1305/mips) - -ifdef KernelPackage/crypto-lib-poly1305/$(ARCH) - KernelPackage/crypto-lib-poly1305/$(CRYPTO_TARGET)=\ - $(KernelPackage/crypto-lib-poly1305/$(ARCH)) -endif - -$(eval $(call KernelPackage,crypto-lib-poly1305)) - - -define KernelPackage/crypto-manager - TITLE:=CryptoAPI algorithm manager - DEPENDS:=+kmod-crypto-aead +kmod-crypto-hash +kmod-crypto-pcompress - KCONFIG:= \ - CONFIG_CRYPTO_MANAGER \ - CONFIG_CRYPTO_MANAGER2 - FILES:=$(LINUX_DIR)/crypto/cryptomgr.ko - AUTOLOAD:=$(call AutoLoad,09,cryptomgr,1) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-manager)) - - -define KernelPackage/crypto-md4 - TITLE:=MD4 digest CryptoAPI module - DEPENDS:=+kmod-crypto-hash - KCONFIG:=CONFIG_CRYPTO_MD4 - FILES:=$(LINUX_DIR)/crypto/md4.ko - AUTOLOAD:=$(call AutoLoad,09,md4) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-md4)) - - -define KernelPackage/crypto-md5 - TITLE:=MD5 digest CryptoAPI module - DEPENDS:=+kmod-crypto-hash - KCONFIG:= \ - CONFIG_CRYPTO_MD5 \ - CONFIG_CRYPTO_MD5_OCTEON - FILES:=$(LINUX_DIR)/crypto/md5.ko - AUTOLOAD:=$(call AutoLoad,09,md5) - $(call AddDepends/crypto) -endef - -define KernelPackage/crypto-md5/octeon - FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-md5.ko - AUTOLOAD+=$(call AutoLoad,09,octeon-md5) -endef - -$(eval $(call KernelPackage,crypto-md5)) - - -define KernelPackage/crypto-michael-mic - TITLE:=Michael MIC keyed digest CryptoAPI module - DEPENDS:=+kmod-crypto-hash - KCONFIG:=CONFIG_CRYPTO_MICHAEL_MIC - FILES:=$(LINUX_DIR)/crypto/michael_mic.ko - AUTOLOAD:=$(call AutoLoad,09,michael_mic) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-michael-mic)) - - -define KernelPackage/crypto-misc - TITLE:=Other CryptoAPI modules - DEPENDS:=+kmod-crypto-xts - KCONFIG:= \ - CONFIG_CRYPTO_CAMELLIA_X86_64 \ - CONFIG_CRYPTO_BLOWFISH_X86_64 \ - CONFIG_CRYPTO_TWOFISH_X86_64 \ - CONFIG_CRYPTO_TWOFISH_X86_64_3WAY \ - CONFIG_CRYPTO_SERPENT_SSE2_X86_64 \ - CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 \ - CONFIG_CRYPTO_CAST5_AVX_X86_64 \ - CONFIG_CRYPTO_CAST6_AVX_X86_64 \ - CONFIG_CRYPTO_TWOFISH_AVX_X86_64 \ - CONFIG_CRYPTO_SERPENT_AVX_X86_64 \ - CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 \ - CONFIG_CRYPTO_SERPENT_AVX2_X86_64 \ - CONFIG_CRYPTO_SERPENT_SSE2_586 \ - CONFIG_CRYPTO_ANUBIS \ - CONFIG_CRYPTO_BLOWFISH \ - CONFIG_CRYPTO_CAMELLIA \ - CONFIG_CRYPTO_CAST5 \ - CONFIG_CRYPTO_CAST6 \ - CONFIG_CRYPTO_FCRYPT \ - CONFIG_CRYPTO_KHAZAD \ - CONFIG_CRYPTO_SERPENT \ - CONFIG_CRYPTO_TEA \ - CONFIG_CRYPTO_TGR192 \ - CONFIG_CRYPTO_TWOFISH \ - CONFIG_CRYPTO_TWOFISH_COMMON \ - CONFIG_CRYPTO_TWOFISH_586 \ - CONFIG_CRYPTO_WP512 - FILES:= \ - $(LINUX_DIR)/crypto/anubis.ko \ - $(LINUX_DIR)/crypto/camellia_generic.ko \ - $(LINUX_DIR)/crypto/cast_common.ko \ - $(LINUX_DIR)/crypto/cast5_generic.ko \ - $(LINUX_DIR)/crypto/cast6_generic.ko \ - $(LINUX_DIR)/crypto/khazad.ko \ - $(LINUX_DIR)/crypto/tea.ko \ - $(LINUX_DIR)/crypto/tgr192.ko \ - $(LINUX_DIR)/crypto/twofish_common.ko \ - $(LINUX_DIR)/crypto/wp512.ko \ - $(LINUX_DIR)/crypto/twofish_generic.ko \ - $(LINUX_DIR)/crypto/blowfish_common.ko \ - $(LINUX_DIR)/crypto/blowfish_generic.ko \ - $(LINUX_DIR)/crypto/serpent_generic.ko - AUTOLOAD:=$(call AutoLoad,10,anubis camellia_generic cast_common \ - cast5_generic cast6_generic khazad tea tgr192 twofish_common \ - wp512 blowfish_common serpent_generic) - ifndef CONFIG_TARGET_x86 - AUTOLOAD+= $(call AutoLoad,10,twofish_generic blowfish_generic) - endif - $(call AddDepends/crypto) -endef - -ifndef CONFIG_TARGET_x86_64 - define KernelPackage/crypto-misc/x86 - FILES+= \ - $(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko \ - $(LINUX_DIR)/arch/x86/crypto/serpent-sse2-i586.ko \ - $(LINUX_DIR)/arch/x86/crypto/glue_helper.ko \ - $(LINUX_DIR)/crypto/ablk_helper.ko@lt4.17 \ - $(LINUX_DIR)/crypto/cryptd.ko \ - $(LINUX_DIR)/crypto/lrw.ko@lt4.17 \ - $(LINUX_DIR)/crypto/crypto_simd.ko@ge4.17 - AUTOLOAD+= $(call AutoLoad,10,cryptd glue_helper \ - serpent-sse2-i586 twofish-i586 blowfish_generic) - endef -endif - -define KernelPackage/crypto-misc/x86/64 - FILES+= \ - $(LINUX_DIR)/arch/x86/crypto/camellia-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/blowfish-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/twofish-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/twofish-x86_64-3way.ko \ - $(LINUX_DIR)/arch/x86/crypto/serpent-sse2-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/camellia-aesni-avx-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/cast5-avx-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/cast6-avx-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/twofish-avx-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/serpent-avx-x86_64.ko \ - $(LINUX_DIR)/arch/x86/crypto/camellia-aesni-avx2.ko \ - $(LINUX_DIR)/arch/x86/crypto/serpent-avx2.ko \ - $(LINUX_DIR)/crypto/ablk_helper.ko@lt4.17 - AUTOLOAD+= $(call AutoLoad,10,camellia-x86_64 \ - camellia-aesni-avx-x86_64 camellia-aesni-avx2 cast5-avx-x86_64 \ - cast6-avx-x86_64 twofish-x86_64 twofish-x86_64-3way \ - twofish-avx-x86_64 blowfish-x86_64 serpent-avx-x86_64 serpent-avx2) -endef - -$(eval $(call KernelPackage,crypto-misc)) - - -define KernelPackage/crypto-null - TITLE:=Null CryptoAPI module - KCONFIG:=CONFIG_CRYPTO_NULL - FILES:=$(LINUX_DIR)/crypto/crypto_null.ko - AUTOLOAD:=$(call AutoLoad,09,crypto_null) - $(call AddDepends/crypto, +kmod-crypto-hash) -endef - -$(eval $(call KernelPackage,crypto-null)) - - -define KernelPackage/crypto-pcbc - TITLE:=Propagating Cipher Block Chaining CryptoAPI module - DEPENDS:=+kmod-crypto-manager - KCONFIG:=CONFIG_CRYPTO_PCBC - FILES:=$(LINUX_DIR)/crypto/pcbc.ko - AUTOLOAD:=$(call AutoLoad,09,pcbc) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-pcbc)) - - -define KernelPackage/crypto-pcompress - TITLE:=CryptoAPI Partial (de)compression operations - KCONFIG:= \ - CONFIG_CRYPTO_PCOMP=y \ - CONFIG_CRYPTO_PCOMP2 - FILES:=$(LINUX_DIR)/crypto/pcompress.ko - AUTOLOAD:=$(call AutoLoad,09,pcompress) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-pcompress)) - - -define KernelPackage/crypto-rsa - TITLE:=RSA algorithm - DEPENDS:=+kmod-crypto-manager +kmod-asn1-decoder - KCONFIG:= CONFIG_CRYPTO_RSA - HIDDEN:=1 - FILES:= \ - $(LINUX_DIR)/lib/mpi/mpi.ko \ - $(LINUX_DIR)/crypto/akcipher.ko \ - $(LINUX_DIR)/crypto/rsa_generic.ko - AUTOLOAD:=$(call AutoLoad,10,rsa_generic) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-rsa)) - - -define KernelPackage/crypto-rmd160 - TITLE:=RIPEMD160 digest CryptoAPI module - DEPENDS:=+kmod-crypto-hash - KCONFIG:=CONFIG_CRYPTO_RMD160 - FILES:=$(LINUX_DIR)/crypto/rmd160.ko - AUTOLOAD:=$(call AutoLoad,09,rmd160) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-rmd160)) - - -define KernelPackage/crypto-rng - TITLE:=CryptoAPI random number generation - DEPENDS:=+kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha256 - KCONFIG:= \ - CONFIG_CRYPTO_DRBG \ - CONFIG_CRYPTO_DRBG_HMAC=y \ - CONFIG_CRYPTO_DRBG_HASH=n \ - CONFIG_CRYPTO_DRBG_MENU \ - CONFIG_CRYPTO_JITTERENTROPY \ - CONFIG_CRYPTO_RNG2 - FILES:= \ - $(LINUX_DIR)/crypto/drbg.ko \ - $(LINUX_DIR)/crypto/jitterentropy_rng.ko \ - $(LINUX_DIR)/crypto/rng.ko - AUTOLOAD:=$(call AutoLoad,09,drbg jitterentropy_rng rng) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-rng)) - - -define KernelPackage/crypto-seqiv - TITLE:=CryptoAPI Sequence Number IV Generator - DEPENDS:=+kmod-crypto-aead +kmod-crypto-rng - KCONFIG:=CONFIG_CRYPTO_SEQIV - FILES:=$(LINUX_DIR)/crypto/seqiv.ko - AUTOLOAD:=$(call AutoLoad,09,seqiv) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-seqiv)) - - -define KernelPackage/crypto-sha1 - TITLE:=SHA1 digest CryptoAPI module - DEPENDS:=+kmod-crypto-hash - KCONFIG:= \ - CONFIG_CRYPTO_SHA1 \ - CONFIG_CRYPTO_SHA1_ARM \ - CONFIG_CRYPTO_SHA1_ARM_NEON \ - CONFIG_CRYPTO_SHA1_OCTEON \ - CONFIG_CRYPTO_SHA1_SSSE3 - FILES:=$(LINUX_DIR)/crypto/sha1_generic.ko - AUTOLOAD:=$(call AutoLoad,09,sha1_generic) - $(call AddDepends/crypto) -endef - -define KernelPackage/crypto-sha1/arm - FILES+=$(LINUX_DIR)/arch/arm/crypto/sha1-arm.ko - AUTOLOAD+=$(call AutoLoad,09,sha1-arm) -endef - -define KernelPackage/crypto-sha1/arm-neon - $(call KernelPackage/crypto-sha1/arm) - FILES+=$(LINUX_DIR)/arch/arm/crypto/sha1-arm-neon.ko - AUTOLOAD+=$(call AutoLoad,09,sha1-arm-neon) -endef - -KernelPackage/crypto-sha1/imx6=$(KernelPackage/crypto-sha1/arm-neon) -KernelPackage/crypto-sha1/ipq40xx=$(KernelPackage/crypto-sha1/arm-neon) -KernelPackage/crypto-sha1/mvebu/cortexa9=$(KernelPackage/crypto-sha1/arm-neon) - -define KernelPackage/crypto-sha1/octeon - FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha1.ko - AUTOLOAD+=$(call AutoLoad,09,octeon-sha1) -endef - -KernelPackage/crypto-sha1/tegra=$(KernelPakcage/crypto-sha1/arm) - -define KernelPackage/crypto-sha1/x86/64 - FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko - AUTOLOAD+=$(call AutoLoad,09,sha1-ssse3) -endef - -$(eval $(call KernelPackage,crypto-sha1)) - - -define KernelPackage/crypto-sha256 - TITLE:=SHA224 SHA256 digest CryptoAPI module - DEPENDS:=+kmod-crypto-hash - KCONFIG:= \ - CONFIG_CRYPTO_SHA256 \ - CONFIG_CRYPTO_SHA256_OCTEON \ - CONFIG_CRYPTO_SHA256_SSSE3 - FILES:= \ - $(LINUX_DIR)/crypto/sha256_generic.ko \ - $(LINUX_DIR)/lib/crypto/libsha256.ko - AUTOLOAD:=$(call AutoLoad,09,sha256_generic) - $(call AddDepends/crypto) -endef - -define KernelPackage/crypto-sha256/octeon - FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha256.ko - AUTOLOAD+=$(call AutoLoad,09,octeon-sha256) -endef - -define KernelPackage/crypto-sha256/x86/64 - FILES+=$(LINUX_DIR)/arch/x86/crypto/sha256-ssse3.ko - AUTOLOAD+=$(call AutoLoad,09,sha256-ssse3) -endef - -$(eval $(call KernelPackage,crypto-sha256)) - - -define KernelPackage/crypto-sha512 - TITLE:=SHA512 digest CryptoAPI module - DEPENDS:=+kmod-crypto-hash - KCONFIG:= \ - CONFIG_CRYPTO_SHA512 \ - CONFIG_CRYPTO_SHA512_ARM \ - CONFIG_CRYPTO_SHA512_OCTEON \ - CONFIG_CRYPTO_SHA512_SSSE3 - FILES:=$(LINUX_DIR)/crypto/sha512_generic.ko - AUTOLOAD:=$(call AutoLoad,09,sha512_generic) - $(call AddDepends/crypto) -endef - -define KernelPackage/crypto-sha512/arm - FILES+=$(LINUX_DIR)/arch/arm/crypto/sha512-arm.ko - AUTOLOAD+=$(call AutoLoad,09,sha512-arm) -endef - -KernelPackage/crypto-sha512/imx6=$(KernelPackage/crypto-sha512/arm) -KernelPackage/crypto-sha512/ipq40xx=$(KernelPackage/crypto-sha512/arm) -KernelPackage/crypto-sha512/mvebu/cortexa9=$(KernelPackage/crypto-sha512/arm) - -define KernelPackage/crypto-sha512/octeon - FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha512.ko - AUTOLOAD+=$(call AutoLoad,09,octeon-sha512) -endef - -KernelPackage/crypto-sha512/tegra=$(KernelPackage/crypto-sha512/arm) - -define KernelPackage/crypto-sha512/x86/64 - FILES+=$(LINUX_DIR)/arch/x86/crypto/sha512-ssse3.ko - AUTOLOAD+=$(call AutoLoad,09,sha512-ssse3) -endef - -$(eval $(call KernelPackage,crypto-sha512)) - - -define KernelPackage/crypto-test - TITLE:=Test CryptoAPI module - KCONFIG:=CONFIG_CRYPTO_TEST - FILES:=$(LINUX_DIR)/crypto/tcrypt.ko - $(call AddDepends/crypto,+kmod-crypto-manager) -endef - -$(eval $(call KernelPackage,crypto-test)) - - -define KernelPackage/crypto-user - TITLE:=CryptoAPI userspace interface - DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager - KCONFIG:= \ - CONFIG_CRYPTO_USER \ - CONFIG_CRYPTO_USER_API \ - CONFIG_CRYPTO_USER_API_AEAD \ - CONFIG_CRYPTO_USER_API_HASH \ - CONFIG_CRYPTO_USER_API_RNG \ - CONFIG_CRYPTO_USER_API_SKCIPHER - FILES:= \ - $(LINUX_DIR)/crypto/af_alg.ko \ - $(LINUX_DIR)/crypto/algif_aead.ko \ - $(LINUX_DIR)/crypto/algif_hash.ko \ - $(LINUX_DIR)/crypto/algif_rng.ko \ - $(LINUX_DIR)/crypto/algif_skcipher.ko \ - $(LINUX_DIR)/crypto/crypto_user.ko - AUTOLOAD:=$(call AutoLoad,09,af_alg algif_aead algif_hash algif_rng algif_skcipher crypto_user) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-user)) - - -define KernelPackage/crypto-wq - TITLE:=CryptoAPI work queue handling - KCONFIG:=CONFIG_CRYPTO_WORKQUEUE - FILES:=$(LINUX_DIR)/crypto/crypto_wq.ko - AUTOLOAD:=$(call AutoLoad,09,crypto_wq) - $(call AddDepends/crypto) -endef -$(eval $(call KernelPackage,crypto-wq)) - - -define KernelPackage/crypto-xts - TITLE:=XTS cipher CryptoAPI module - DEPENDS:=+kmod-crypto-gf128 +kmod-crypto-manager - KCONFIG:=CONFIG_CRYPTO_XTS - FILES:=$(LINUX_DIR)/crypto/xts.ko - AUTOLOAD:=$(call AutoLoad,09,xts) - $(call AddDepends/crypto) -endef - -$(eval $(call KernelPackage,crypto-xts)) - diff --git a/feeds/ipq807x/linux/modules/firewire.mk b/feeds/ipq807x/linux/modules/firewire.mk deleted file mode 100644 index 1e2d94272..000000000 --- a/feeds/ipq807x/linux/modules/firewire.mk +++ /dev/null @@ -1,76 +0,0 @@ -# -# Copyright (C) 2008-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -FIREWIRE_MENU:=FireWire support - -define KernelPackage/firewire - SUBMENU:=$(FIREWIRE_MENU) - TITLE:=Support for FireWire (new stack) - DEPENDS:=@PCI_SUPPORT +kmod-lib-crc-itu-t - KCONFIG:=CONFIG_FIREWIRE - FILES:=$(LINUX_DIR)/drivers/firewire/firewire-core.ko -endef - -define KernelPackage/firewire/description - Kernel support for FireWire (new stack) -endef - -$(eval $(call KernelPackage,firewire)) - - -define KernelPackage/firewire-net - SUBMENU:=$(FIREWIRE_MENU) - TITLE:=Support for IP networking over FireWire - DEPENDS:=kmod-firewire - KCONFIG:=CONFIG_FIREWIRE_NET - FILES:=$(LINUX_DIR)/drivers/firewire/firewire-net.ko - AUTOLOAD:=$(call AutoProbe,firewire-net) -endef - -define KernelPackage/firewire-net/description - Kernel support for IPv4 over FireWire -endef - -$(eval $(call KernelPackage,firewire-net)) - - -define KernelPackage/firewire-ohci - SUBMENU:=$(FIREWIRE_MENU) - TITLE:=Support for OHCI-1394 controllers - DEPENDS:=kmod-firewire - KCONFIG:= \ - CONFIG_FIREWIRE_OHCI \ - CONFIG_FIREWIRE_OHCI_DEBUG=n \ - CONFIG_FIREWIRE_OHCI_REMOTE_DMA=n - FILES:=$(LINUX_DIR)/drivers/firewire/firewire-ohci.ko - AUTOLOAD:=$(call AutoProbe,firewire-ohci) -endef - - -define KernelPackage/firewire-ohci/description - Kernel support for FireWire OHCI-1394 controllers -endef - -$(eval $(call KernelPackage,firewire-ohci)) - - -define KernelPackage/firewire-sbp2 - SUBMENU:=$(FIREWIRE_MENU) - TITLE:=Support for SBP-2 devices over FireWire - DEPENDS:=kmod-firewire +kmod-scsi-core - KCONFIG:=CONFIG_FIREWIRE_SBP2 - FILES:=$(LINUX_DIR)/drivers/firewire/firewire-sbp2.ko - AUTOLOAD:=$(call AutoProbe,firewire-sbp2) -endef - -define KernelPackage/firewire-sbp2/description - Kernel support for SBP-2 devices over FireWire -endef - -$(eval $(call KernelPackage,firewire-sbp2)) - - diff --git a/feeds/ipq807x/linux/modules/fs.mk b/feeds/ipq807x/linux/modules/fs.mk deleted file mode 100644 index ff9990c59..000000000 --- a/feeds/ipq807x/linux/modules/fs.mk +++ /dev/null @@ -1,578 +0,0 @@ -# -# Copyright (C) 2006-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -FS_MENU:=Filesystems - -define KernelPackage/fs-9p - SUBMENU:=$(FS_MENU) - TITLE:=Plan 9 Resource Sharing Support - DEPENDS:=+kmod-9pnet - KCONFIG:=\ - CONFIG_9P_FS \ - CONFIG_9P_FS_POSIX_ACL=n \ - CONFIG_9P_FS_SECURITY=n \ - CONFIG_9P_FSCACHE=n - FILES:=$(LINUX_DIR)/fs/9p/9p.ko - AUTOLOAD:=$(call AutoLoad,30,9p) -endef - -define KernelPackage/fs-9p/description - Kernel module for Plan 9 Resource Sharing Support support -endef - -$(eval $(call KernelPackage,fs-9p)) - - -define KernelPackage/fs-afs - SUBMENU:=$(FS_MENU) - TITLE:=Andrew FileSystem client - DEFAULT:=n - DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +kmod-fs-fscache - KCONFIG:=\ - CONFIG_AFS_FS=m \ - CONFIG_AFS_DEBUG=n \ - CONFIG_AFS_FSCACHE=y - FILES:=$(LINUX_DIR)/fs/afs/kafs.ko - AUTOLOAD:=$(call AutoLoad,30,kafs) -endef - -define KernelPackage/fs-afs/description - Kernel module for Andrew FileSystem client support -endef - -$(eval $(call KernelPackage,fs-afs)) - -define KernelPackage/fs-autofs4 - SUBMENU:=$(FS_MENU) - TITLE:=AUTOFS4 filesystem support - KCONFIG:= \ - CONFIG_AUTOFS4_FS \ - CONFIG_AUTOFS_FS - FILES:= \ - $(LINUX_DIR)/fs/autofs4/autofs4.ko@lt4.18 \ - $(LINUX_DIR)/fs/autofs/autofs4.ko@ge4.18 - AUTOLOAD:=$(call AutoLoad,30,autofs4) -endef - -define KernelPackage/fs-autofs4/description - Kernel module for AutoFS4 support -endef - -$(eval $(call KernelPackage,fs-autofs4)) - - -define KernelPackage/fs-btrfs - SUBMENU:=$(FS_MENU) - TITLE:=BTRFS filesystem support - DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor +kmod-lib-zstd - KCONFIG:=\ - CONFIG_BTRFS_FS \ - CONFIG_BTRFS_FS_POSIX_ACL=n \ - CONFIG_BTRFS_FS_CHECK_INTEGRITY=n - FILES:=\ - $(LINUX_DIR)/fs/btrfs/btrfs.ko - AUTOLOAD:=$(call AutoLoad,30,btrfs,1) -endef - -define KernelPackage/fs-btrfs/description - Kernel module for BTRFS support -endef - -$(eval $(call KernelPackage,fs-btrfs)) - - -define KernelPackage/fs-cifs - SUBMENU:=$(FS_MENU) - TITLE:=CIFS support - KCONFIG:= \ - CONFIG_CIFS \ - CONFIG_CIFS_DFS_UPCALL=n \ - CONFIG_CIFS_UPCALL=n - FILES:=$(LINUX_DIR)/fs/cifs/cifs.ko - AUTOLOAD:=$(call AutoLoad,30,cifs) - $(call AddDepends/nls) - DEPENDS+= \ - +kmod-crypto-md4 \ - +kmod-crypto-md5 \ - +kmod-crypto-sha256 \ - +kmod-crypto-sha512 \ - +kmod-crypto-cmac \ - +kmod-crypto-hmac \ - +kmod-crypto-arc4 \ - +kmod-crypto-aead \ - +kmod-crypto-ccm \ - +kmod-crypto-ecb \ - +kmod-crypto-des -endef - -define KernelPackage/fs-cifs/description - Kernel module for CIFS support -endef - -$(eval $(call KernelPackage,fs-cifs)) - - -define KernelPackage/fs-configfs - SUBMENU:=$(FS_MENU) - TITLE:=Configuration filesystem support - KCONFIG:= \ - CONFIG_CONFIGFS_FS - FILES:=$(LINUX_DIR)/fs/configfs/configfs.ko - AUTOLOAD:=$(call AutoLoad,30,configfs) -endef - -define KernelPackage/fs-configfs/description - Kernel module for configfs support -endef - -$(eval $(call KernelPackage,fs-configfs)) - - -define KernelPackage/fs-cramfs - SUBMENU:=$(FS_MENU) - TITLE:=Compressed RAM/ROM filesystem support - DEPENDS:=+kmod-lib-zlib-inflate - KCONFIG:= \ - CONFIG_CRAMFS - FILES:=$(LINUX_DIR)/fs/cramfs/cramfs.ko - AUTOLOAD:=$(call AutoLoad,30,cramfs) -endef - -define KernelPackage/fs-cramfs/description - Kernel module for cramfs support -endef - -$(eval $(call KernelPackage,fs-cramfs)) - - -define KernelPackage/fs-efivarfs - SUBMENU:=$(FS_MENU) - TITLE:=efivar filesystem support - KCONFIG:=CONFIG_EFIVAR_FS - FILES:=$(LINUX_DIR)/fs/efivarfs/efivarfs.ko - DEPENDS:=@(x86_64||x86) - AUTOLOAD:=$(call Autoload,90,efivarfs) -endef - -define KernelPackage/fs-efivarfs/description - Kernel module to support efivarfs file system mountpoint. -endef - -$(eval $(call KernelPackage,fs-efivarfs)) - - -define KernelPackage/fs-exportfs - SUBMENU:=$(FS_MENU) - TITLE:=exportfs kernel server support - KCONFIG:=CONFIG_EXPORTFS - FILES=$(LINUX_DIR)/fs/exportfs/exportfs.ko - AUTOLOAD:=$(call AutoLoad,20,exportfs,1) -endef - -define KernelPackage/fs-exportfs/description - Kernel module for exportfs. Needed for some other modules. -endef - -$(eval $(call KernelPackage,fs-exportfs)) - - -define KernelPackage/fs-ext4 - SUBMENU:=$(FS_MENU) - TITLE:=EXT4 filesystem support - DEPENDS := \ - +kmod-lib-crc16 \ - +kmod-crypto-hash \ - +kmod-crypto-crc32c - KCONFIG:= \ - CONFIG_EXT4_FS \ - CONFIG_EXT4_ENCRYPTION=n \ - CONFIG_JBD2 - FILES:= \ - $(LINUX_DIR)/fs/ext4/ext4.ko \ - $(LINUX_DIR)/fs/jbd2/jbd2.ko \ - $(LINUX_DIR)/fs/mbcache.ko - AUTOLOAD:=$(call AutoLoad,30,mbcache jbd2 ext4,1) -endef - -define KernelPackage/fs-ext4/description - Kernel module for EXT4 filesystem support -endef - -$(eval $(call KernelPackage,fs-ext4)) - - -define KernelPackage/fs-f2fs - SUBMENU:=$(FS_MENU) - TITLE:=F2FS filesystem support - DEPENDS:= +kmod-crypto-hash +kmod-crypto-crc32 +kmod-nls-base - KCONFIG:=CONFIG_F2FS_FS - FILES:=$(LINUX_DIR)/fs/f2fs/f2fs.ko - AUTOLOAD:=$(call AutoLoad,30,f2fs,1) -endef - -define KernelPackage/fs-f2fs/description - Kernel module for F2FS filesystem support -endef - -$(eval $(call KernelPackage,fs-f2fs)) - - -define KernelPackage/fs-fscache - SUBMENU:=$(FS_MENU) - TITLE:=General filesystem local cache manager - DEPENDS:= - KCONFIG:=\ - CONFIG_FSCACHE=m \ - CONFIG_FSCACHE_STATS=y \ - CONFIG_FSCACHE_HISTOGRAM=n \ - CONFIG_FSCACHE_DEBUG=n \ - CONFIG_FSCACHE_OBJECT_LIST=n \ - CONFIG_CACHEFILES=y \ - CONFIG_CACHEFILES_DEBUG=n \ - CONFIG_CACHEFILES_HISTOGRAM=n - FILES:=$(LINUX_DIR)/fs/fscache/fscache.ko - AUTOLOAD:=$(call AutoLoad,29,fscache) -endef - -$(eval $(call KernelPackage,fs-fscache)) - - -define KernelPackage/fs-hfs - SUBMENU:=$(FS_MENU) - TITLE:=HFS filesystem support - DEPENDS:=+kmod-cdrom - KCONFIG:=CONFIG_HFS_FS - FILES:=$(LINUX_DIR)/fs/hfs/hfs.ko - AUTOLOAD:=$(call AutoLoad,30,hfs) - $(call AddDepends/nls) -endef - -define KernelPackage/fs-hfs/description - Kernel module for HFS filesystem support -endef - -$(eval $(call KernelPackage,fs-hfs)) - - -define KernelPackage/fs-hfsplus - SUBMENU:=$(FS_MENU) - TITLE:=HFS+ filesystem support - DEPENDS:=+kmod-cdrom - KCONFIG:=CONFIG_HFSPLUS_FS - FILES:=$(LINUX_DIR)/fs/hfsplus/hfsplus.ko - AUTOLOAD:=$(call AutoLoad,30,hfsplus) - $(call AddDepends/nls,utf8) -endef - -define KernelPackage/fs-hfsplus/description - Kernel module for HFS+ filesystem support -endef - -$(eval $(call KernelPackage,fs-hfsplus)) - - -define KernelPackage/fs-isofs - SUBMENU:=$(FS_MENU) - TITLE:=ISO9660 filesystem support - DEPENDS:=+kmod-lib-zlib-inflate +kmod-cdrom - KCONFIG:=CONFIG_ISO9660_FS CONFIG_JOLIET=y CONFIG_ZISOFS=n - FILES:=$(LINUX_DIR)/fs/isofs/isofs.ko - AUTOLOAD:=$(call AutoLoad,30,isofs) - $(call AddDepends/nls) -endef - -define KernelPackage/fs-isofs/description - Kernel module for ISO9660 filesystem support -endef - -$(eval $(call KernelPackage,fs-isofs)) - - -define KernelPackage/fs-jfs - SUBMENU:=$(FS_MENU) - TITLE:=JFS filesystem support - KCONFIG:=CONFIG_JFS_FS - FILES:=$(LINUX_DIR)/fs/jfs/jfs.ko - AUTOLOAD:=$(call AutoLoad,30,jfs,1) - $(call AddDepends/nls) -endef - -define KernelPackage/fs-jfs/description - Kernel module for JFS support -endef - -$(eval $(call KernelPackage,fs-jfs)) - -define KernelPackage/fs-minix - SUBMENU:=$(FS_MENU) - TITLE:=Minix filesystem support - KCONFIG:=CONFIG_MINIX_FS - FILES:=$(LINUX_DIR)/fs/minix/minix.ko - AUTOLOAD:=$(call AutoLoad,30,minix) -endef - -define KernelPackage/fs-minix/description - Kernel module for Minix filesystem support -endef - -$(eval $(call KernelPackage,fs-minix)) - - -define KernelPackage/fs-msdos - SUBMENU:=$(FS_MENU) - TITLE:=MSDOS filesystem support - DEPENDS:=+kmod-fs-vfat - KCONFIG:=CONFIG_MSDOS_FS - FILES:=$(LINUX_DIR)/fs/fat/msdos.ko - AUTOLOAD:=$(call AutoLoad,40,msdos) - $(call AddDepends/nls) -endef - -define KernelPackage/fs-msdos/description - Kernel module for MSDOS filesystem support -endef - -$(eval $(call KernelPackage,fs-msdos)) - - -define KernelPackage/fs-nfs - SUBMENU:=$(FS_MENU) - TITLE:=NFS filesystem client support - DEPENDS:=+kmod-fs-nfs-common +kmod-dnsresolver - KCONFIG:= \ - CONFIG_NFS_FS \ - CONFIG_NFS_USE_LEGACY_DNS=n \ - CONFIG_NFS_USE_NEW_IDMAPPER=n - FILES:= \ - $(LINUX_DIR)/fs/nfs/nfs.ko - AUTOLOAD:=$(call AutoLoad,40,nfs) -endef - -define KernelPackage/fs-nfs/description - Kernel module for NFS client support -endef - -$(eval $(call KernelPackage,fs-nfs)) - - -define KernelPackage/fs-nfs-common - SUBMENU:=$(FS_MENU) - TITLE:=Common NFS filesystem modules - KCONFIG:= \ - CONFIG_LOCKD \ - CONFIG_SUNRPC \ - CONFIG_GRACE_PERIOD - FILES:= \ - $(LINUX_DIR)/fs/lockd/lockd.ko \ - $(LINUX_DIR)/net/sunrpc/sunrpc.ko \ - $(LINUX_DIR)/fs/nfs_common/grace.ko - AUTOLOAD:=$(call AutoLoad,30,grace sunrpc lockd) -endef - -$(eval $(call KernelPackage,fs-nfs-common)) - - -define KernelPackage/fs-nfs-common-rpcsec - SUBMENU:=$(FS_MENU) - TITLE:=NFS Secure RPC - DEPENDS:= \ - +kmod-fs-nfs-common \ - +kmod-crypto-des \ - +kmod-crypto-cbc \ - +kmod-crypto-cts \ - +kmod-crypto-md5 \ - +kmod-crypto-sha1 \ - +kmod-crypto-hmac \ - +kmod-crypto-ecb \ - +kmod-crypto-arc4 - KCONFIG:= \ - CONFIG_SUNRPC_GSS \ - CONFIG_RPCSEC_GSS_KRB5 - FILES:= \ - $(LINUX_DIR)/lib/oid_registry.ko \ - $(LINUX_DIR)/net/sunrpc/auth_gss/auth_rpcgss.ko \ - $(LINUX_DIR)/net/sunrpc/auth_gss/rpcsec_gss_krb5.ko - AUTOLOAD:=$(call AutoLoad,31,oid_registry auth_rpcgss rpcsec_gss_krb5) -endef - -define KernelPackage/fs-nfs-common-rpcsec/description - Kernel modules for NFS Secure RPC -endef - -$(eval $(call KernelPackage,fs-nfs-common-rpcsec)) - - -define KernelPackage/fs-nfs-v3 - SUBMENU:=$(FS_MENU) - TITLE:=NFS3 filesystem client support - DEPENDS:=+kmod-fs-nfs - FILES:= \ - $(LINUX_DIR)/fs/nfs/nfsv3.ko - AUTOLOAD:=$(call AutoLoad,41,nfsv3) -endef - -define KernelPackage/fs-nfs-v3/description - Kernel module for NFS v3 client support -endef - -$(eval $(call KernelPackage,fs-nfs-v3)) - - -define KernelPackage/fs-nfs-v4 - SUBMENU:=$(FS_MENU) - TITLE:=NFS4 filesystem client support - DEPENDS:=+kmod-fs-nfs - KCONFIG:= \ - CONFIG_NFS_V4=y - FILES:= \ - $(LINUX_DIR)/fs/nfs/nfsv4.ko - AUTOLOAD:=$(call AutoLoad,41,nfsv4) -endef - -define KernelPackage/fs-nfs-v4/description - Kernel module for NFS v4 client support -endef - -$(eval $(call KernelPackage,fs-nfs-v4)) - - -define KernelPackage/fs-nfsd - SUBMENU:=$(FS_MENU) - TITLE:=NFS kernel server support - DEPENDS:=+kmod-fs-nfs-common +kmod-fs-exportfs +kmod-fs-nfs-common-rpcsec - KCONFIG:= \ - CONFIG_NFSD \ - CONFIG_NFSD_V4=y \ - CONFIG_NFSD_V4_SECURITY_LABEL=n \ - CONFIG_NFSD_BLOCKLAYOUT=n \ - CONFIG_NFSD_SCSILAYOUT=n \ - CONFIG_NFSD_FLEXFILELAYOUT=n \ - CONFIG_NFSD_FAULT_INJECTION=n - FILES:=$(LINUX_DIR)/fs/nfsd/nfsd.ko - AUTOLOAD:=$(call AutoLoad,40,nfsd) -endef - -define KernelPackage/fs-nfsd/description - Kernel module for NFS kernel server support -endef - -$(eval $(call KernelPackage,fs-nfsd)) - - -define KernelPackage/fs-ntfs - SUBMENU:=$(FS_MENU) - TITLE:=NTFS filesystem support - KCONFIG:=CONFIG_NTFS_FS - FILES:=$(LINUX_DIR)/fs/ntfs/ntfs.ko - AUTOLOAD:=$(call AutoLoad,30,ntfs) - $(call AddDepends/nls) -endef - -define KernelPackage/fs-ntfs/description - Kernel module for NTFS filesystem support -endef - -$(eval $(call KernelPackage,fs-ntfs)) - - -define KernelPackage/fs-reiserfs - SUBMENU:=$(FS_MENU) - TITLE:=ReiserFS filesystem support - KCONFIG:=CONFIG_REISERFS_FS - FILES:=$(LINUX_DIR)/fs/reiserfs/reiserfs.ko - AUTOLOAD:=$(call AutoLoad,30,reiserfs,1) -endef - -define KernelPackage/fs-reiserfs/description - Kernel module for ReiserFS support -endef - -$(eval $(call KernelPackage,fs-reiserfs)) - - -define KernelPackage/fs-squashfs - SUBMENU:=$(FS_MENU) - TITLE:=SquashFS 4.0 filesystem support - KCONFIG:=CONFIG_SQUASHFS \ - CONFIG_SQUASHFS_XZ=y - FILES:=$(LINUX_DIR)/fs/squashfs/squashfs.ko - AUTOLOAD:=$(call AutoLoad,30,squashfs,1) -endef - -define KernelPackage/fs-squashfs/description - Kernel module for SquashFS 4.0 support -endef - -$(eval $(call KernelPackage,fs-squashfs)) - - -define KernelPackage/fs-udf - SUBMENU:=$(FS_MENU) - TITLE:=UDF filesystem support - KCONFIG:=CONFIG_UDF_FS - FILES:=$(LINUX_DIR)/fs/udf/udf.ko - AUTOLOAD:=$(call AutoLoad,30,udf) - DEPENDS:=+kmod-lib-crc-itu-t +kmod-cdrom - $(call AddDepends/nls) -endef - -define KernelPackage/fs-udf/description - Kernel module for UDF filesystem support -endef - -$(eval $(call KernelPackage,fs-udf)) - - -define KernelPackage/fs-vfat - SUBMENU:=$(FS_MENU) - TITLE:=VFAT filesystem support - KCONFIG:= \ - CONFIG_FAT_FS \ - CONFIG_VFAT_FS - FILES:= \ - $(LINUX_DIR)/fs/fat/fat.ko \ - $(LINUX_DIR)/fs/fat/vfat.ko - AUTOLOAD:=$(call AutoLoad,30,fat vfat) - $(call AddDepends/nls,cp437 iso8859-1 utf8) -endef - -define KernelPackage/fs-vfat/description - Kernel module for VFAT filesystem support -endef - -$(eval $(call KernelPackage,fs-vfat)) - - -define KernelPackage/fs-xfs - SUBMENU:=$(FS_MENU) - TITLE:=XFS filesystem support - KCONFIG:=CONFIG_XFS_FS - DEPENDS:= +kmod-fs-exportfs +kmod-lib-crc32c - FILES:=$(LINUX_DIR)/fs/xfs/xfs.ko - AUTOLOAD:=$(call AutoLoad,30,xfs,1) -endef - -define KernelPackage/fs-xfs/description - Kernel module for XFS support -endef - -$(eval $(call KernelPackage,fs-xfs)) - - -define KernelPackage/fuse - SUBMENU:=$(FS_MENU) - TITLE:=FUSE (Filesystem in Userspace) support - KCONFIG:= CONFIG_FUSE_FS - FILES:=$(LINUX_DIR)/fs/fuse/fuse.ko - AUTOLOAD:=$(call AutoLoad,80,fuse) -endef - -define KernelPackage/fuse/description - Kernel module for userspace filesystem support -endef - -$(eval $(call KernelPackage,fuse)) diff --git a/feeds/ipq807x/linux/modules/hwmon.mk b/feeds/ipq807x/linux/modules/hwmon.mk deleted file mode 100644 index a39a8910f..000000000 --- a/feeds/ipq807x/linux/modules/hwmon.mk +++ /dev/null @@ -1,572 +0,0 @@ -# -# Copyright (C) 2006-2014 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -HWMON_MENU:=Hardware Monitoring Support - -define KernelPackage/hwmon-core - SUBMENU:=$(HWMON_MENU) - TITLE:=Hardware monitoring support - KCONFIG:= \ - CONFIG_HWMON \ - CONFIG_HWMON_DEBUG_CHIP=n - FILES:= \ - $(LINUX_DIR)/drivers/hwmon/hwmon.ko -endef - -define KernelPackage/hwmon-core/description - Kernel modules for hardware monitoring -endef - -$(eval $(call KernelPackage,hwmon-core)) - - -define AddDepends/hwmon - SUBMENU:=$(HWMON_MENU) - DEPENDS:=+kmod-hwmon-core $(1) -endef - -define KernelPackage/hwmon-ad7418 - TITLE:=AD741x monitoring support - KCONFIG:=CONFIG_SENSORS_AD7418 - FILES:=$(LINUX_DIR)/drivers/hwmon/ad7418.ko - AUTOLOAD:=$(call AutoLoad,60,ad7418 ad7418) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-ad7418/description - Kernel module for Analog Devices AD7416, AD7417 and AD7418 temperature monitor chip -endef - -$(eval $(call KernelPackage,hwmon-ad7418)) - -define KernelPackage/hwmon-ads1015 - TITLE:=Texas Instruments ADS1015 - KCONFIG:= CONFIG_SENSORS_ADS1015 - FILES:= $(LINUX_DIR)/drivers/hwmon/ads1015.ko - AUTOLOAD:=$(call AutoLoad,60,ads1015) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-ads1015/description - Kernel module for Texas Instruments ADS1015 Analog-to-Digital converter -endef - -$(eval $(call KernelPackage,hwmon-ads1015)) - -define KernelPackage/hwmon-adt7410 - TITLE:=ADT7410 monitoring support - KCONFIG:= \ - CONFIG_SENSORS_ADT7X10 \ - CONFIG_SENSORS_ADT7410 - FILES:= \ - $(LINUX_DIR)/drivers/hwmon/adt7x10.ko \ - $(LINUX_DIR)/drivers/hwmon/adt7410.ko - AUTOLOAD:=$(call AutoLoad,60,adt7x10 adt7410) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-adt7410/description - Kernel module for ADT7410/7420 I2C thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-adt7410)) - - -define KernelPackage/hwmon-adt7475 - TITLE:=ADT7473/7475/7476/7490 monitoring support - KCONFIG:=CONFIG_SENSORS_ADT7475 - FILES:=$(LINUX_DIR)/drivers/hwmon/adt7475.ko - AUTOLOAD:=$(call AutoProbe,adt7475) - $(call AddDepends/hwmon,+kmod-i2c-core +kmod-hwmon-vid) -endef - -define KernelPackage/hwmon-adt7475/description - Kernel module for ADT7473/7475/7476/7490 thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-adt7475)) - - -define KernelPackage/hwmon-dme1737 - TITLE:=SMSC DME1737 and compatible monitoring support - KCONFIG:=CONFIG_SENSORS_DME1737 - FILES:= \ - $(LINUX_DIR)/drivers/hwmon/dme1737.ko - AUTOLOAD:=$(call AutoProbe,dme1737) - $(call AddDepends/hwmon,+kmod-i2c-core +kmod-hwmon-vid) -endef - -define KernelPackage/hwmon-dme1737/description - SMSC DME1737, SCH3112, SCH3114, SCH3116, SCH5027 monitoring support -endef - -$(eval $(call KernelPackage,hwmon-dme1737)) - - -define KernelPackage/hwmon-drivetemp - TITLE:=Hard disk drives with temperature sensor - KCONFIG:=CONFIG_SENSORS_DRIVETEMP - FILES:=$(LINUX_DIR)/drivers/hwmon/drivetemp.ko - AUTOLOAD:=$(call AutoLoad,60,drivetemp) - $(call AddDepends/hwmon,+kmod-ata-core +kmod-scsi-core) -endef - -define KernelPackage/hwmon-drivetemp/description - Kernel module for Hard disk drives with temperature sensor -endef - -$(eval $(call KernelPackage,hwmon-drivetemp)) - - -define KernelPackage/hwmon-gpiofan - TITLE:=Generic GPIO FAN support - KCONFIG:=CONFIG_SENSORS_GPIO_FAN - FILES:=$(LINUX_DIR)/drivers/hwmon/gpio-fan.ko - AUTOLOAD:=$(call AutoLoad,60,gpio-fan) - $(call AddDepends/hwmon,+kmod-i2c-core +PACKAGE_kmod-thermal:kmod-thermal) -endef - -define KernelPackage/hwmon-gpiofan/description - Kernel module for GPIO controlled FANs -endef - -$(eval $(call KernelPackage,hwmon-gpiofan)) - - -define KernelPackage/hwmon-f71882fg - TITLE:=F71882FG compatible monitoring support - KCONFIG:=CONFIG_SENSORS_F71882FG - FILES:=$(LINUX_DIR)/drivers/hwmon/f71882fg.ko - AUTOLOAD:=$(call AutoProbe,f71882fg) - $(call AddDepends/hwmon,@TARGET_x86) -endef - -define KernelPackage/hwmon-f71882fg/description - Kernel module for hardware monitoring via many Fintek Super-IO chips. -endef - -$(eval $(call KernelPackage,hwmon-f71882fg)) - - -define KernelPackage/hwmon-ina209 - TITLE:=INA209 monitoring support - KCONFIG:=CONFIG_SENSORS_INA209 - FILES:=$(LINUX_DIR)/drivers/hwmon/ina209.ko - AUTOLOAD:=$(call AutoProbe,ina209) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-ina209/description - Kernel module for ina209 dc power monitor chips -endef - -$(eval $(call KernelPackage,hwmon-ina209)) - - -define KernelPackage/hwmon-ina2xx - TITLE:=INA2XX monitoring support - KCONFIG:=CONFIG_SENSORS_INA2XX - FILES:=$(LINUX_DIR)/drivers/hwmon/ina2xx.ko - AUTOLOAD:=$(call AutoProbe,ina2xx) - $(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap-i2c) -endef - -define KernelPackage/hwmon-ina2xx/description - Kernel module for ina2xx dc current monitor chips -endef - -$(eval $(call KernelPackage,hwmon-ina2xx)) - - -define KernelPackage/hwmon-it87 - TITLE:=IT87 monitoring support - KCONFIG:=CONFIG_SENSORS_IT87 - FILES:=$(LINUX_DIR)/drivers/hwmon/it87.ko - AUTOLOAD:=$(call AutoProbe,it87) - $(call AddDepends/hwmon,+kmod-i2c-core +kmod-hwmon-vid +PACKAGE_kmod-thermal:kmod-thermal) -endef - -define KernelPackage/hwmon-it87/description - Kernel module for it87 thermal and voltage monitor chip -endef - -$(eval $(call KernelPackage,hwmon-it87)) - - -define KernelPackage/hwmon-lm63 - TITLE:=LM63/64 monitoring support - KCONFIG:=CONFIG_SENSORS_LM63 - FILES:=$(LINUX_DIR)/drivers/hwmon/lm63.ko - AUTOLOAD:=$(call AutoProbe,lm63) - $(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap-i2c) -endef - -define KernelPackage/hwmon-lm63/description - Kernel module for lm63 and lm64 thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-lm63)) - - -define KernelPackage/hwmon-lm75 - TITLE:=LM75 monitoring support - KCONFIG:=CONFIG_SENSORS_LM75 - FILES:=$(LINUX_DIR)/drivers/hwmon/lm75.ko - AUTOLOAD:=$(call AutoProbe,lm75) - $(call AddDepends/hwmon,+kmod-i2c-core +PACKAGE_kmod-thermal:kmod-thermal +kmod-regmap-i2c) -endef - -define KernelPackage/hwmon-lm75/description - Kernel module for lm75 thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-lm75)) - - -define KernelPackage/hwmon-lm77 - TITLE:=LM77 monitoring support - KCONFIG:=CONFIG_SENSORS_LM77 - FILES:=$(LINUX_DIR)/drivers/hwmon/lm77.ko - AUTOLOAD:=$(call AutoProbe,lm77) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-lm77/description - Kernel module for LM77 thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-lm77)) - - -define KernelPackage/hwmon-lm85 - TITLE:=LM85 monitoring support - KCONFIG:=CONFIG_SENSORS_LM85 - FILES:=$(LINUX_DIR)/drivers/hwmon/lm85.ko - AUTOLOAD:=$(call AutoProbe,lm85) - $(call AddDepends/hwmon,+kmod-i2c-core +kmod-hwmon-vid) -endef - -define KernelPackage/hwmon-lm85/description - Kernel module for LM85 thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-lm85)) - - -define KernelPackage/hwmon-lm90 - TITLE:=LM90 monitoring support - KCONFIG:=CONFIG_SENSORS_LM90 - FILES:=$(LINUX_DIR)/drivers/hwmon/lm90.ko - AUTOLOAD:=$(call AutoProbe,lm90) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-lm90/description - Kernel module for LM90 thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-lm90)) - - -define KernelPackage/hwmon-lm92 - TITLE:=LM92 monitoring support - KCONFIG:=CONFIG_SENSORS_LM92 - FILES:=$(LINUX_DIR)/drivers/hwmon/lm92.ko - AUTOLOAD:=$(call AutoProbe,lm92) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-lm92/description - Kernel module for LM92 thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-lm92)) - - -define KernelPackage/hwmon-lm95241 - TITLE:=LM95241 monitoring support - KCONFIG:=CONFIG_SENSORS_LM95241 - FILES:=$(LINUX_DIR)/drivers/hwmon/lm95241.ko - AUTOLOAD:=$(call AutoProbe,lm95241) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-lm95241/description - Kernel module for LM95241 thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-lm95241)) - - -define KernelPackage/hwmon-ltc4151 - TITLE:=LTC4151 monitoring support - KCONFIG:=CONFIG_SENSORS_LTC4151 - FILES:=$(LINUX_DIR)/drivers/hwmon/ltc4151.ko - AUTOLOAD:=$(call AutoProbe,ltc4151) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-ltc4151/description - Kernel module for Linear Technology LTC4151 current and voltage monitor chip -endef - -$(eval $(call KernelPackage,hwmon-ltc4151)) - - -define KernelPackage/hwmon-mcp3021 - TITLE:=MCP3021/3221 monitoring support - KCONFIG:=CONFIG_SENSORS_MCP3021 - FILES:=$(LINUX_DIR)/drivers/hwmon/mcp3021.ko - AUTOLOAD:=$(call AutoProbe,mcp3021) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-mcp3021/description - Kernel module for Linear Technology MCP3021/3221 current and voltage monitor chip -endef - -$(eval $(call KernelPackage,hwmon-mcp3021)) - - -define KernelPackage/hwmon-nct6775 - TITLE:=NCT6106D/6775F/6776F/6779D/6791D/6792D/6793D and compatibles monitoring support - KCONFIG:=CONFIG_SENSORS_NCT6775 - FILES:=$(LINUX_DIR)/drivers/hwmon/nct6775.ko - AUTOLOAD:=$(call AutoProbe,nct6775) - $(call AddDepends/hwmon,@PCI_SUPPORT @TARGET_x86 +kmod-hwmon-vid) -endef - -define KernelPackage/hwmon-nct6775/description - Kernel module for NCT6106D/6775F/6776F/6779D/6791D/6792D/6793D thermal monitor chip -endef - -$(eval $(call KernelPackage,hwmon-nct6775)) - - -define KernelPackage/hwmon-pc87360 - TITLE:=PC87360 monitoring support - KCONFIG:=CONFIG_SENSORS_PC87360 - FILES:=$(LINUX_DIR)/drivers/hwmon/pc87360.ko - AUTOLOAD:=$(call AutoProbe,pc87360) - $(call AddDepends/hwmon,@TARGET_x86 +kmod-hwmon-vid) -endef - -define KernelPackage/hwmon-pc87360/description - Kernel modules for PC87360 chips -endef - -$(eval $(call KernelPackage,hwmon-pc87360)) - - -define KernelPackage/pmbus-core - TITLE:=PMBus support - KCONFIG:= CONFIG_PMBUS - FILES:=$(LINUX_DIR)/drivers/hwmon/pmbus/pmbus_core.ko - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/pmbus-core/description - Kernel modules for Power Management Bus -endef - -$(eval $(call KernelPackage,pmbus-core)) - - -define KernelPackage/pmbus-zl6100 - TITLE:=Intersil / Zilker Labs ZL6100 hardware monitoring - KCONFIG:=CONFIG_SENSORS_ZL6100 - FILES:=$(LINUX_DIR)/drivers/hwmon/pmbus/zl6100.ko - AUTOLOAD:=$(call AutoProbe,zl6100) - $(call AddDepends/hwmon, +kmod-pmbus-core) -endef - -define KernelPackage/pmbus-zl6100/description - Kernel module for Intersil / Zilker Labs ZL6100 and -compatible digital DC-DC controllers -endef - -$(eval $(call KernelPackage,pmbus-zl6100)) - - -define KernelPackage/hwmon-pwmfan - TITLE:=Generic PWM FAN support - KCONFIG:=CONFIG_SENSORS_PWM_FAN - FILES:=$(LINUX_DIR)/drivers/hwmon/pwm-fan.ko - AUTOLOAD:=$(call AutoLoad,60,pwm-fan) - $(call AddDepends/hwmon, +PACKAGE_kmod-thermal:kmod-thermal) -endef - -define KernelPackage/hwmon-pwmfan/description - Kernel module for PWM controlled FANs -endef - -$(eval $(call KernelPackage,hwmon-pwmfan)) - - -define KernelPackage/hwmon-sch5627 - TITLE:=SMSC SCH5627 monitoring support - KCONFIG:= \ - CONFIG_SENSORS_SCH5627 \ - CONFIG_WATCHDOG_CORE=y - FILES:= \ - $(LINUX_DIR)/drivers/hwmon/sch5627.ko \ - $(LINUX_DIR)/drivers/hwmon/sch56xx-common.ko - AUTOLOAD:=$(call AutoProbe,sch5627) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-sch5627/description - SMSC SCH5627 Super I/O chips include complete hardware monitoring -endef - -$(eval $(call KernelPackage,hwmon-sch5627)) - - -define KernelPackage/hwmon-sht21 - TITLE:=Sensiron SHT21 and compat. monitoring support - KCONFIG:=CONFIG_SENSORS_SHT21 - FILES:=$(LINUX_DIR)/drivers/hwmon/sht21.ko - AUTOLOAD:=$(call AutoProbe,sht21) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-sht21/description - Kernel module for Sensirion SHT21 and SHT25 temperature and humidity sensors chip -endef - -$(eval $(call KernelPackage,hwmon-sht21)) - - -define KernelPackage/hwmon-tmp102 - TITLE:=Texas Instruments TMP102 monitoring support - KCONFIG:=CONFIG_SENSORS_TMP102 - FILES:=$(LINUX_DIR)/drivers/hwmon/tmp102.ko - AUTOLOAD:=$(call AutoProbe,tmp102) - $(call AddDepends/hwmon,+kmod-i2c-core +PACKAGE_kmod-thermal:kmod-thermal +kmod-regmap-i2c) -endef - -define KernelPackage/hwmon-tmp102/description - Kernel module for Texas Instruments TMP102 temperature sensors chip -endef - -$(eval $(call KernelPackage,hwmon-tmp102)) - - -define KernelPackage/hwmon-tmp103 - TITLE:=Texas Instruments TMP103 monitoring support - KCONFIG:=CONFIG_SENSORS_TMP103 - FILES:=$(LINUX_DIR)/drivers/hwmon/tmp103.ko - AUTOLOAD:=$(call AutoProbe,tmp103) - $(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap-i2c) -endef - -define KernelPackage/hwmon-tmp103/description - Kernel module for Texas Instruments TMP103 temperature sensors chip -endef - -$(eval $(call KernelPackage,hwmon-tmp103)) - - -define KernelPackage/hwmon-tmp421 - TITLE:=TI TMP421 and compatible monitoring support - KCONFIG:=CONFIG_SENSORS_TMP421 - FILES:=$(LINUX_DIR)/drivers/hwmon/tmp421.ko - AUTOLOAD:=$(call AutoLoad,60,tmp421) - $(call AddDepends/hwmon,+kmod-i2c-core) -endef - -define KernelPackage/hwmon-tmp421/description - Kernel module for the Texas Instruments TMP421 and compatible chips. -endef - -$(eval $(call KernelPackage,hwmon-tmp421)) - - -define KernelPackage/hwmon-vid - TITLE:=VID/VRM/VRD voltage conversion module. - KCONFIG:=CONFIG_HWMON_VID - FILES:=$(LINUX_DIR)/drivers/hwmon/hwmon-vid.ko - AUTOLOAD:=$(call AutoLoad,41,hwmon-vid) - $(call AddDepends/hwmon,) -endef - -define KernelPackage/hwmon-vid/description - VID/VRM/VRD voltage conversion module for hardware monitoring -endef - -$(eval $(call KernelPackage,hwmon-vid)) - - -define KernelPackage/hwmon-w83627ehf - TITLE:=Winbond W83627EHF/EHG/DHG/UHG, W83667HG monitoring support - KCONFIG:=CONFIG_SENSORS_W83627EHF - FILES:=$(LINUX_DIR)/drivers/hwmon/w83627ehf.ko - AUTOLOAD:=$(call AutoProbe,w83627ehf) - $(call AddDepends/hwmon,@TARGET_x86 +kmod-hwmon-vid) -endef - -define KernelPackage/hwmon-w83627ehf/description - Kernel module for Winbond W83627EHF/EHG/DHG/UHG and W83667HG thermal monitor chip - Support for NCT6775F and NCT6776F has been removed from this driver in favour of - using the nct6775 driver to handle those chips. -endef - -$(eval $(call KernelPackage,hwmon-w83627ehf)) - - -define KernelPackage/hwmon-w83627hf - TITLE:=Winbond W83627HF monitoring support - KCONFIG:=CONFIG_SENSORS_W83627HF - FILES:=$(LINUX_DIR)/drivers/hwmon/w83627hf.ko - AUTOLOAD:=$(call AutoLoad,50,w83627hf) - $(call AddDepends/hwmon,@TARGET_x86 +kmod-hwmon-vid) -endef - -define KernelPackage/hwmon-w83627hf/description - Kernel module for the Winbond W83627HF chips. -endef - -$(eval $(call KernelPackage,hwmon-w83627hf)) - - -define KernelPackage/hwmon-w83793 - TITLE:=Winbond W83793G/R monitoring support - KCONFIG:=CONFIG_SENSORS_W83793 - FILES:=$(LINUX_DIR)/drivers/hwmon/w83793.ko - AUTOLOAD:=$(call AutoProbe,w83793) - $(call AddDepends/hwmon,+kmod-i2c-core +kmod-hwmon-vid) -endef - -define KernelPackage/hwmon-w83793/description - Kernel module for the Winbond W83793G and W83793R chips. -endef - -$(eval $(call KernelPackage,hwmon-w83793)) - - -define KernelPackage/hwmon-adcxx - TITLE:=ADCxx monitoring support - KCONFIG:=CONFIG_SENSORS_ADCXX - FILES:=$(LINUX_DIR)/drivers/hwmon/adcxx.ko - AUTOLOAD:=$(call AutoLoad,60,adcxx) - $(call AddDepends/hwmon,) -endef - -define KernelPackage/hwmon-adcxx/description - Kernel module for the National Semiconductor - ADCS chip family, where - * bb is the resolution in number of bits (8, 10, 12) - * c is the number of channels (1, 2, 4, 8) - * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 - kSPS and 101 for 1 MSPS) - - Examples : ADC081S101, ADC124S501, ... -endef - -$(eval $(call KernelPackage,hwmon-adcxx)) - - diff --git a/feeds/ipq807x/linux/modules/i2c.mk b/feeds/ipq807x/linux/modules/i2c.mk deleted file mode 100644 index ca6463c81..000000000 --- a/feeds/ipq807x/linux/modules/i2c.mk +++ /dev/null @@ -1,261 +0,0 @@ -# -# Copyright (C) 2006-2009 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -I2C_MENU:=I2C support - -ModuleConfVar=$(word 1,$(subst :,$(space),$(1))) -ModuleFullPath=$(LINUX_DIR)/$(word 2,$(subst :,$(space),$(1))).ko -ModuleKconfig=$(foreach mod,$(1),$(call ModuleConfVar,$(mod))) -ModuleFiles=$(foreach mod,$(1),$(call ModuleFullPath,$(mod))) -ModuleAuto=$(call AutoLoad,$(1),$(foreach mod,$(2),$(basename $(notdir $(call ModuleFullPath,$(mod))))),$(3)) - -define i2c_defaults - SUBMENU:=$(I2C_MENU) - KCONFIG:=$(call ModuleKconfig,$(1)) - FILES:=$(call ModuleFiles,$(1)) - AUTOLOAD:=$(call ModuleAuto,$(2),$(1),$(3)) -endef - -I2C_CORE_MODULES:= \ - CONFIG_I2C:drivers/i2c/i2c-core \ - CONFIG_I2C_CHARDEV:drivers/i2c/i2c-dev - -define KernelPackage/i2c-core - $(call i2c_defaults,$(I2C_CORE_MODULES),51) - TITLE:=I2C support -endef - -define KernelPackage/i2c-core/description - Kernel modules for I2C support -endef - -$(eval $(call KernelPackage,i2c-core)) - - -I2C_ALGOBIT_MODULES:= \ - CONFIG_I2C_ALGOBIT:drivers/i2c/algos/i2c-algo-bit - -define KernelPackage/i2c-algo-bit - $(call i2c_defaults,$(I2C_ALGOBIT_MODULES),55) - TITLE:=I2C bit-banging interfaces - DEPENDS:=+kmod-i2c-core -endef - -define KernelPackage/i2c-algo-bit/description - Kernel modules for I2C bit-banging interfaces -endef - -$(eval $(call KernelPackage,i2c-algo-bit)) - - -I2C_ALGOPCA_MODULES:= \ - CONFIG_I2C_ALGOPCA:drivers/i2c/algos/i2c-algo-pca - -define KernelPackage/i2c-algo-pca - $(call i2c_defaults,$(I2C_ALGOPCA_MODULES),55) - TITLE:=I2C PCA 9564 interfaces - DEPENDS:=+kmod-i2c-core -endef - -define KernelPackage/i2c-algo-pca/description - Kernel modules for I2C PCA 9564 interfaces -endef - -$(eval $(call KernelPackage,i2c-algo-pca)) - - -I2C_ALGOPCF_MODULES:= \ - CONFIG_I2C_ALGOPCF:drivers/i2c/algos/i2c-algo-pcf - -define KernelPackage/i2c-algo-pcf - $(call i2c_defaults,$(I2C_ALGOPCF_MODULES),55) - TITLE:=I2C PCF 8584 interfaces - DEPENDS:=+kmod-i2c-core -endef - -define KernelPackage/i2c-algo-pcf/description - Kernel modules for I2C PCF 8584 interfaces -endef - -$(eval $(call KernelPackage,i2c-algo-pcf)) - - -I2C_GPIO_MODULES:= \ - CONFIG_I2C_GPIO:drivers/i2c/busses/i2c-gpio - -define KernelPackage/i2c-gpio - $(call i2c_defaults,$(I2C_GPIO_MODULES),59) - TITLE:=GPIO-based bitbanging I2C - DEPENDS:=@GPIO_SUPPORT +kmod-i2c-algo-bit -endef - -define KernelPackage/i2c-gpio/description - Kernel modules for a very simple bitbanging I2C driver utilizing the - arch-neutral GPIO API to control the SCL and SDA lines. -endef - -$(eval $(call KernelPackage,i2c-gpio)) - - -I2C_I801_MODULES:= \ - CONFIG_I2C_I801:drivers/i2c/busses/i2c-i801 - -define KernelPackage/i2c-i801 - $(call i2c_defaults,$(I2C_I801_MODULES),59) - TITLE:=Intel I801 and compatible I2C interfaces - DEPENDS:=@PCI_SUPPORT @TARGET_x86 +kmod-i2c-core +kmod-i2c-smbus -endef - -define KernelPackage/i2c-i801/description - Support for the Intel I801 family of mainboard I2C interfaces, - specifically 82801AA, 82801AB, 82801BA, 82801CA/CAM, 82801DB, - 82801EB/ER (ICH5/ICH5R), 6300ESB, ICH6, ICH7, ESB2, ICH8, ICH9, - EP80579 (Tolapai), ICH10, 5/3400 Series (PCH), 6 Series (PCH), - Patsburg (PCH), DH89xxCC (PCH), Panther Point (PCH), - Lynx Point (PCH), Lynx Point-LP (PCH), Avoton (SOC), - Wellsburg (PCH), Coleto Creek (PCH), Wildcat Point (PCH), - Wildcat Point-LP (PCH), BayTrail (SOC), Sunrise Point-H (PCH), - Sunrise Point-LP (PCH), DNV (SOC), Broxton (SOC), - Lewisburg (PCH). -endef - -$(eval $(call KernelPackage,i2c-i801)) - - -I2C_MUX_MODULES:= \ - CONFIG_I2C_MUX:drivers/i2c/i2c-mux - -define KernelPackage/i2c-mux - $(call i2c_defaults,$(I2C_MUX_MODULES),51) - TITLE:=I2C bus multiplexing support - DEPENDS:=+kmod-i2c-core -endef - -define KernelPackage/i2c-mux/description - Kernel modules for I2C bus multiplexing support -endef - -$(eval $(call KernelPackage,i2c-mux)) - -I2C_MUX_GPIO_MODULES:= \ - CONFIG_I2C_MUX_GPIO:drivers/i2c/muxes/i2c-mux-gpio - -define KernelPackage/i2c-mux-gpio - $(call i2c_defaults,$(I2C_MUX_GPIO_MODULES),51) - TITLE:=GPIO-based I2C mux/switches - DEPENDS:=+kmod-i2c-mux -endef - -define KernelPackage/i2c-mux-gpio/description - Kernel modules for GENERIC_GPIO I2C bus mux/switching devices -endef - -$(eval $(call KernelPackage,i2c-mux-gpio)) - - -I2C_MUX_PCA9541_MODULES:= \ - CONFIG_I2C_MUX_PCA9541:drivers/i2c/muxes/i2c-mux-pca9541 - -define KernelPackage/i2c-mux-pca9541 - $(call i2c_defaults,$(I2C_MUX_PCA9541_MODULES),51) - TITLE:=Philips PCA9541 I2C mux/switches - DEPENDS:=+kmod-i2c-mux -endef - -define KernelPackage/i2c-mux-pca9541/description - Kernel modules for PCA9541 I2C bus mux/switching devices -endef - -$(eval $(call KernelPackage,i2c-mux-pca9541)) - -I2C_MUX_PCA954x_MODULES:= \ - CONFIG_I2C_MUX_PCA954x:drivers/i2c/muxes/i2c-mux-pca954x - -define KernelPackage/i2c-mux-pca954x - $(call i2c_defaults,$(I2C_MUX_PCA954x_MODULES),51) - TITLE:=Philips PCA954x I2C mux/switches - DEPENDS:=+kmod-i2c-mux -endef - -define KernelPackage/i2c-mux-pca954x/description - Kernel modules for PCA954x I2C bus mux/switching devices -endef - -$(eval $(call KernelPackage,i2c-mux-pca954x)) - - -I2C_PIIX4_MODULES:= \ - CONFIG_I2C_PIIX4:drivers/i2c/busses/i2c-piix4 - -define KernelPackage/i2c-piix4 - $(call i2c_defaults,$(I2C_PIIX4_MODULES),59) - TITLE:=Intel PIIX4 and compatible I2C interfaces - DEPENDS:=@PCI_SUPPORT @TARGET_x86 +kmod-i2c-core -endef - -define KernelPackage/i2c-piix4/description - Support for the Intel PIIX4 family of mainboard I2C interfaces, - specifically Intel PIIX4, Intel 440MX, ATI IXP200, ATI IXP300, - ATI IXP400, ATI SB600, ATI SB700/SP5100, ATI SB800, AMD Hudson-2, - AMD ML, AMD CZ, Serverworks OSB4, Serverworks CSB5, - Serverworks CSB6, Serverworks HT-1000, Serverworks HT-1100 and - SMSC Victory66. -endef - -$(eval $(call KernelPackage,i2c-piix4)) - - -I2C_PXA_MODULES:= \ - CONFIG_I2C_PXA:drivers/i2c/busses/i2c-pxa - -define KernelPackage/i2c-pxa - $(call i2c_defaults,$(I2C_PXA_MODULES),50) - TITLE:=Intel PXA I2C bus driver - DEPENDS:=+kmod-i2c-core -endef - -define KernelPackage/i2c-pxa/description - Kernel module for Intel PXA2XX I2C adapter -endef - -$(eval $(call KernelPackage,i2c-pxa)) - - -I2C_SMBUS_MODULES:= \ - CONFIG_I2C_SMBUS:drivers/i2c/i2c-smbus - -define KernelPackage/i2c-smbus - $(call i2c_defaults,$(I2C_SMBUS_MODULES),58) - TITLE:=SMBus-specific protocols helper - DEPENDS:=+kmod-i2c-core -endef - -define KernelPackage/i2c-smbus/description - Support for the SMBus extensions to the I2C specification. -endef - -$(eval $(call KernelPackage,i2c-smbus)) - - - -I2C_TINY_USB_MODULES:= \ - CONFIG_I2C_TINY_USB:drivers/i2c/busses/i2c-tiny-usb - -define KernelPackage/i2c-tiny-usb - $(call i2c_defaults,$(I2C_TINY_USB_MODULES),59) - TITLE:=I2C Tiny USB adaptor - DEPENDS:=@USB_SUPPORT +kmod-i2c-core +kmod-usb-core -endef - -define KernelPackage/i2c-tiny-usb/description - Kernel module for the I2C Tiny USB adaptor developed - by Till Harbaum (http://www.harbaum.org/till/i2c_tiny_usb) -endef - -$(eval $(call KernelPackage,i2c-tiny-usb)) - - diff --git a/feeds/ipq807x/linux/modules/iio.mk b/feeds/ipq807x/linux/modules/iio.mk deleted file mode 100644 index 0ea7ba8bd..000000000 --- a/feeds/ipq807x/linux/modules/iio.mk +++ /dev/null @@ -1,546 +0,0 @@ -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -IIO_MENU:=Industrial I/O Modules - - -define KernelPackage/iio-core - SUBMENU:=$(IIO_MENU) - TITLE:=Industrial IO core - KCONFIG:= \ - CONFIG_IIO \ - CONFIG_IIO_BUFFER=y \ - CONFIG_IIO_TRIGGER=y - FILES:=$(LINUX_DIR)/drivers/iio/industrialio.ko - AUTOLOAD:=$(call AutoLoad,55,industrialio) -endef - -define KernelPackage/iio-core/description - The industrial I/O subsystem provides a unified framework for - drivers for many different types of embedded sensors using a - number of different physical interfaces (i2c, spi, etc) -endef - -$(eval $(call KernelPackage,iio-core)) - - -define KernelPackage/iio-kfifo-buf - SUBMENU:=$(IIO_MENU) - TITLE:=Industrial I/O buffering based on kfifo - DEPENDS:=+kmod-iio-core - KCONFIG:=CONFIG_IIO_KFIFO_BUF - FILES:=$(LINUX_DIR)/drivers/iio/buffer/kfifo_buf.ko - AUTOLOAD:=$(call AutoLoad,55,kfifo_buf) -endef - -define KernelPackage/iio-kfifo-buf/description - A simple fifo based on kfifo. Note that this currently provides no buffer - events so it is up to userspace to work out how often to read from the buffer. -endef - -$(eval $(call KernelPackage,iio-kfifo-buf)) - - -define KernelPackage/industrialio-triggered-buffer - SUBMENU:=$(IIO_MENU) - TITLE:=Provides helper functions for setting up triggered buffers. - DEPENDS:=+kmod-iio-core +kmod-iio-kfifo-buf - KCONFIG:=CONFIG_IIO_TRIGGERED_BUFFER - FILES:=$(LINUX_DIR)/drivers/iio/buffer/industrialio-triggered-buffer.ko - AUTOLOAD:=$(call AutoLoad,55,industrialio-triggered-buffer) -endef - -define KernelPackage/industrialio-triggered-buffer/description - Provides helper functions for setting up triggered buffers. -endef - -$(eval $(call KernelPackage,industrialio-triggered-buffer)) - - -define KernelPackage/iio-ad799x - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-i2c-core +kmod-iio-core +kmod-industrialio-triggered-buffer - TITLE:=Analog Devices AD799x ADC driver - KCONFIG:= \ - CONFIG_AD799X_RING_BUFFER=y \ - CONFIG_AD799X - FILES:=$(LINUX_DIR)/drivers/iio/adc/ad799x.ko - AUTOLOAD:=$(call AutoLoad,56,ad799x) -endef - -define KernelPackage/iio-ad799x/description - support for Analog Devices: - ad7991, ad7995, ad7999, ad7992, ad7993, ad7994, ad7997, ad7998 - i2c analog to digital converters (ADC). -endef - -$(eval $(call KernelPackage,iio-ad799x)) - -define KernelPackage/iio-hmc5843 - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-i2c-core +kmod-iio-core +kmod-regmap-i2c +kmod-industrialio-triggered-buffer - TITLE:=Honeywell HMC58x3 Magnetometer - KCONFIG:= CONFIG_SENSORS_HMC5843_I2C - FILES:= \ - $(LINUX_DIR)/drivers/iio/magnetometer/hmc5843_i2c.ko \ - $(LINUX_DIR)/drivers/iio/magnetometer/hmc5843_core.ko - AUTOLOAD:=$(call AutoLoad,56,hmc5843) -endef - -define KernelPackage/iio-hmc5843/description - Honeywell HMC5843/5883/5883L 3-Axis Magnetometer -endef - -$(eval $(call KernelPackage,iio-hmc5843)) - -define KernelPackage/iio-bh1750 - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-i2c-core +kmod-iio-core - TITLE:=ROHM BH1750 ambient light sensor - KCONFIG:= CONFIG_BH1750 - FILES:=$(LINUX_DIR)/drivers/iio/light/bh1750.ko - AUTOLOAD:=$(call AutoLoad,56,bh1750) -endef -define KernelPackage/iio-bh1750/description - ROHM BH1750 ambient light sensor (i2c bus) -endef -$(eval $(call KernelPackage,iio-bh1750)) - -define KernelPackage/iio-am2315 - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-i2c-core +kmod-iio-core +kmod-industrialio-triggered-buffer - TITLE:=Asong AM2315 humidity/temperature sensor - KCONFIG:= CONFIG_AM2315 - FILES:=$(LINUX_DIR)/drivers/iio/humidity/am2315.ko - AUTOLOAD:=$(call AutoLoad,56,am2315) -endef -define KernelPackage/iio-am2315/description - Aosong AM2315 humidity/temperature sensor (I2C bus) -endef -$(eval $(call KernelPackage,iio-am2315)) - -define KernelPackage/iio-mxs-lradc - SUBMENU:=$(IIO_MENU) - DEPENDS:=@TARGET_mxs +kmod-iio-core +kmod-industrialio-triggered-buffer - TITLE:=Freescale i.MX23/i.MX28 LRADC ADC driver - KCONFIG:= \ - CONFIG_MXS_LRADC_ADC - FILES:=$(LINUX_DIR)/drivers/iio/adc/mxs-lradc-adc.ko - AUTOLOAD:=$(call AutoLoad,56,mxs-lradc-adc) -endef - -define KernelPackage/iio-mxs-lradc/description - Support for Freescale's i.MX23/i.MX28 SoC internal Low-Resolution ADC -endef - -$(eval $(call KernelPackage,iio-mxs-lradc)) - -define KernelPackage/iio-dht11 - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-iio-core @GPIO_SUPPORT @USES_DEVICETREE - TITLE:=DHT11 (and compatible) humidity and temperature sensors - KCONFIG:= \ - CONFIG_DHT11 - FILES:=$(LINUX_DIR)/drivers/iio/humidity/dht11.ko - AUTOLOAD:=$(call AutoLoad,56,dht11) -endef - -define KernelPackage/iio-dht11/description - support for DHT11 and DHT22 digitial humidity and temperature sensors - attached at GPIO lines. You will need a custom device tree file to - specify the GPIO line to use. -endef - -$(eval $(call KernelPackage,iio-dht11)) - - -define KernelPackage/iio-bme680 - SUBMENU:=$(IIO_MENU) - TITLE:=BME680 gas/humidity/pressure/temperature sensor - DEPENDS:=@!LINUX_4_14 +kmod-iio-core +kmod-regmap-core - KCONFIG:=CONFIG_BME680 - FILES:=$(LINUX_DIR)/drivers/iio/chemical/bme680_core.ko -endef - -define KernelPackage/iio-bme680/description - This driver adds support for Bosch Sensortec BME680 sensor with gas, - humidity, pressure and temperatue sensing capability. -endef - -$(eval $(call KernelPackage,iio-bme680)) - -define KernelPackage/iio-bme680-i2c - SUBMENU:=$(IIO_MENU) - TITLE:=BME680 gas/humidity/pressure/temperature sensor (I2C) - DEPENDS:=+kmod-iio-bme680 +kmod-regmap-i2c - KCONFIG:=CONFIG_BME680_I2C - FILES:=$(LINUX_DIR)/drivers/iio/chemical/bme680_i2c.ko - AUTOLOAD:=$(call AutoProbe,bme680-i2c) -endef -define KernelPackage/iio-bme680-i2c/description - This driver adds support for Bosch Sensortec's BME680 connected via I2C. -endef - -$(eval $(call KernelPackage,iio-bme680-i2c)) - -define KernelPackage/iio-bme680-spi - SUBMENU:=$(IIO_MENU) - TITLE:=BME680 gas/humidity/pressure/temperature sensor (SPI) - DEPENDS:=+kmod-iio-bme680 +kmod-regmap-spi - KCONFIG:=CONFIG_BME680_SPI - FILES:=$(LINUX_DIR)/drivers/iio/chemical/bme680_spi.ko - AUTOLOAD:=$(call AutoProbe,bme680-spi) -endef -define KernelPackage/iio-bme680-spi/description - This driver adds support for Bosch Sensortec's BME680 connected via SPI. -endef - -$(eval $(call KernelPackage,iio-bme680-spi)) - - -define KernelPackage/iio-bmp280 - SUBMENU:=$(IIO_MENU) - TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor - DEPENDS:=+kmod-iio-core +kmod-regmap-core - KCONFIG:=CONFIG_BMP280 - FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280.ko -endef - -define KernelPackage/iio-bmp280/description - This driver adds support for Bosch Sensortec BMP180 and BMP280 pressure and - temperature sensors. Also supports the BME280 with an additional humidity - sensor channel. -endef - -$(eval $(call KernelPackage,iio-bmp280)) - - -define KernelPackage/iio-bmp280-i2c - SUBMENU:=$(IIO_MENU) - TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor (I2C) - DEPENDS:=+kmod-iio-bmp280 +kmod-i2c-core +kmod-regmap-i2c - KCONFIG:=CONFIG_BMP280_I2C - FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280-i2c.ko - AUTOLOAD:=$(call AutoProbe,bmp280-i2c) -endef -define KernelPackage/iio-bmp280-i2c/description - This driver adds support for Bosch Sensortec's digital pressure and - temperature sensor connected via I2C. -endef - -$(eval $(call KernelPackage,iio-bmp280-i2c)) - - -define KernelPackage/iio-bmp280-spi - SUBMENU:=$(IIO_MENU) - TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor (SPI) - DEPENDS:=+kmod-iio-bmp280 +kmod-spi-bitbang - KCONFIG:=CONFIG_BMP280_SPI - FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280-spi.ko - AUTOLOAD:=$(call AutoProbe,bmp280-spi) -endef -define KernelPackage/iio-bmp280-spi/description - This driver adds support for Bosch Sensortec's digital pressure and - temperature sensor connected via SPI. -endef - -$(eval $(call KernelPackage,iio-bmp280-spi)) - -define KernelPackage/iio-htu21 - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-i2c-core +kmod-iio-core - TITLE:=HTU21 humidity & temperature sensor - KCONFIG:= \ - CONFIG_HTU21 \ - CONFIG_IIO_MS_SENSORS_I2C - FILES:= \ - $(LINUX_DIR)/drivers/iio/humidity/htu21.ko \ - $(LINUX_DIR)/drivers/iio/common/ms_sensors/ms_sensors_i2c.ko - AUTOLOAD:=$(call AutoLoad,56,htu21) -endef - -define KernelPackage/iio-htu21/description - support for the Measurement Specialties HTU21 humidity and - temperature sensor. - This driver is also used for MS8607 temperature, pressure & humidity - sensor -endef - -$(eval $(call KernelPackage,iio-htu21)) - - -define KernelPackage/iio-ccs811 - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-i2c-core +kmod-iio-core +kmod-industrialio-triggered-buffer - TITLE:=AMS CCS811 VOC sensor - KCONFIG:= \ - CONFIG_CCS811 - FILES:= $(LINUX_DIR)/drivers/iio/chemical/ccs811.ko - AUTOLOAD:=$(call AutoLoad,56,ccs811) -endef - -define KernelPackage/iio-ccs811/description - Support for the AMS CCS811 VOC (Volatile Organic Compounds) sensor -endef - -$(eval $(call KernelPackage,iio-ccs811)) - - -define KernelPackage/iio-si7020 - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-i2c-core +kmod-iio-core - TITLE:=Silicon Labs Si7020 sensor - KCONFIG:= CONFIG_SI7020 - FILES:=$(LINUX_DIR)/drivers/iio/humidity/si7020.ko - AUTOLOAD:=$(call AutoLoad,56,si7020) -endef - -define KernelPackage/iio-si7020/description - Support for Silicon Labs Si7020 family of relative humidity and - temperature sensors connected via I2C. Following models are usable: - Si7013, Si7020, Si7021, Hoperf TH06. -endef - -$(eval $(call KernelPackage,iio-si7020)) - - -define KernelPackage/iio-st_accel - SUBMENU:=$(IIO_MENU) - TITLE:=STMicroelectronics accelerometer 3-Axis Driver - DEPENDS:=+kmod-iio-core +kmod-regmap-core +kmod-industrialio-triggered-buffer - KCONFIG:= \ - CONFIG_IIO_ST_ACCEL_3AXIS \ - CONFIG_IIO_ST_SENSORS_CORE - FILES:= \ - $(LINUX_DIR)/drivers/iio/accel/st_accel.ko \ - $(LINUX_DIR)/drivers/iio/common/st_sensors/st_sensors.ko -endef - -define KernelPackage/iio-st_accel/description - This package adds support for STMicroelectronics accelerometers: - LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC, - LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12, H3LIS331DL, - LNG2DM, LIS3DE, LIS2DE12 -endef - -$(eval $(call KernelPackage,iio-st_accel)) - - -define KernelPackage/iio-st_accel-i2c - SUBMENU:=$(IIO_MENU) - TITLE:=STMicroelectronics accelerometer 3-Axis Driver (I2C) - DEPENDS:=+kmod-iio-st_accel +kmod-i2c-core +kmod-regmap-i2c - KCONFIG:= CONFIG_IIO_ST_ACCEL_I2C_3AXIS - FILES:= \ - $(LINUX_DIR)/drivers/iio/accel/st_accel_i2c.ko \ - $(LINUX_DIR)/drivers/iio/common/st_sensors/st_sensors_i2c.ko - AUTOLOAD:=$(call AutoLoad,56,st_accel_i2c) -endef - -define KernelPackage/iio-st_accel-i2c/description - This package adds support for STMicroelectronics I2C based accelerometers -endef - -$(eval $(call KernelPackage,iio-st_accel-i2c)) - - -define KernelPackage/iio-st_accel-spi - SUBMENU:=$(IIO_MENU) - TITLE:=STMicroelectronics accelerometer 3-Axis Driver (SPI) - DEPENDS:=+kmod-iio-st_accel +kmod-regmap-spi - KCONFIG:= CONFIG_IIO_ST_ACCEL_SPI_3AXIS - FILES:= \ - $(LINUX_DIR)/drivers/iio/accel/st_accel_spi.ko \ - $(LINUX_DIR)/drivers/iio/common/st_sensors/st_sensors_spi.ko - AUTOLOAD:=$(call AutoLoad,56,st_accel_spi) -endef - -define KernelPackage/iio-st_accel-spi/description - This package adds support for STMicroelectronics SPI based accelerometers -endef - -$(eval $(call KernelPackage,iio-st_accel-spi)) - - -define KernelPackage/iio-lsm6dsx - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-iio-core +kmod-iio-kfifo-buf +kmod-regmap-core - TITLE:=ST LSM6DSx driver for IMU MEMS sensors - KCONFIG:=CONFIG_IIO_ST_LSM6DSX - FILES:=$(LINUX_DIR)/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.ko - AUTOLOAD:=$(call AutoProbe,st_lsm6dsx) -endef - -define KernelPackage/iio-lsm6dsx/description - Support for the ST LSM6DSx and related IMU MEMS sensors. -endef - -$(eval $(call KernelPackage,iio-lsm6dsx)) - - -define KernelPackage/iio-lsm6dsx-i2c - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-iio-lsm6dsx +kmod-i2c-core +kmod-regmap-i2c - TITLE:=ST LSM6DSx driver for IMU MEMS sensors (I2C) - KCONFIG:=CONFIG_IIO_ST_LSM6DSX - FILES:=$(LINUX_DIR)/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.ko - AUTOLOAD:=$(call AutoProbe,st_lsm6dsx-i2c) -endef - -define KernelPackage/iio-lsm6dsx-i2c/description - Support for the ST LSM6DSx and related IMU MEMS I2C sensors. -endef - -$(eval $(call KernelPackage,iio-lsm6dsx-i2c)) - - -define KernelPackage/iio-lsm6dsx-spi - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-iio-lsm6dsx +kmod-regmap-spi - TITLE:=ST LSM6DSx driver for IMU MEMS sensors (SPI) - KCONFIG:=CONFIG_IIO_ST_LSM6DSX - FILES:=$(LINUX_DIR)/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.ko - AUTOLOAD:=$(call AutoProbe,st_lsm6dsx-spi) -endef - -define KernelPackage/iio-lsm6dsx-spi/description - Support for the ST LSM6DSx and related IMU MEMS SPI sensors. -endef - -$(eval $(call KernelPackage,iio-lsm6dsx-spi)) - - -define KernelPackage/iio-sps30 - SUBMENU:=$(IIO_MENU) - DEPENDS:=@!LINUX_4_14 +kmod-i2c-core +kmod-iio-core +kmod-industrialio-triggered-buffer +kmod-lib-crc8 - TITLE:=Sensirion SPS30 particulate matter sensor - KCONFIG:=CONFIG_SPS30 - FILES:=$(LINUX_DIR)/drivers/iio/chemical/sps30.ko - AUTOLOAD:=$(call AutoProbe,sps30) -endef - -define KernelPackage/iio-sps30/description - Support for the Sensirion SPS30 particulate matter sensor. -endef - -$(eval $(call KernelPackage,iio-sps30)) - - -define KernelPackage/iio-tsl4531 - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-i2c-core +kmod-iio-core - TITLE:=TAOS TSL4531 ambient light sensor - KCONFIG:= CONFIG_TSL4531 - FILES:=$(LINUX_DIR)/drivers/iio/light/tsl4531.ko - AUTOLOAD:=$(call AutoLoad,56,tsl4531) -endef - -define KernelPackage/iio-tsl4531/description - Support for TAOS TSL4531x family of ambient light sensors - connected via I2C. Following models are usable: - TSL45311, TSL45313, TSL45315, TSL45317. -endef - -$(eval $(call KernelPackage,iio-tsl4531)) - - -define KernelPackage/iio-fxas21002c - SUBMENU:=$(IIO_MENU) - TITLE:=Freescale FXAS21002C 3-axis gyro driver - DEPENDS:=+kmod-iio-core +kmod-regmap-core +kmod-industrialio-triggered-buffer - KCONFIG:= CONFIG_FXAS21002C - FILES:=$(LINUX_DIR)/drivers/iio/gyro/fxas21002c_core.ko - AUTOLOAD:=$(call AutoLoad,56,fxas21002c) -endef - -define KernelPackage/iio-fxas21002c/description - Support for Freescale FXAS21002C 3-axis gyro. -endef - -$(eval $(call KernelPackage,iio-fxas21002c)) - - -define KernelPackage/iio-fxas21002c-i2c - SUBMENU:=$(IIO_MENU) - TITLE:=Freescale FXAS21002C 3-axis gyro driver (I2C) - DEPENDS:=+kmod-iio-fxas21002c +kmod-i2c-core +kmod-regmap-i2c - KCONFIG:= CONFIG_FXAS21002C_I2C - FILES:=$(LINUX_DIR)/drivers/iio/gyro/fxas21002c_i2c.ko - AUTOLOAD:=$(call AutoLoad,56,fxas21002c_i2c) -endef - -define KernelPackage/iio-fxas21002c-i2c/description - Support for Freescale FXAS21002C 3-axis gyro - connected via I2C. -endef - - -$(eval $(call KernelPackage,iio-fxas21002c-i2c)) - -define KernelPackage/iio-fxas21002c-spi - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-iio-fxas21002c +kmod-regmap-spi - TITLE:=Freescale FXAS21002C 3-axis gyro driver (SPI) - KCONFIG:= CONFIG_FXAS21002C_SPI - FILES:=$(LINUX_DIR)/drivers/iio/gyro/fxas21002c_spi.ko - AUTOLOAD:=$(call AutoLoad,56,fxas21002c_spi) -endef - -define KernelPackage/iio-fxas21002c-spi/description - Support for Freescale FXAS21002C 3-axis gyro - connected via SPI. -endef - -$(eval $(call KernelPackage,iio-fxas21002c-spi)) - - -define KernelPackage/iio-fxos8700 - SUBMENU:=$(IIO_MENU) - TITLE:=Freescale FXOS8700 3-axis accelerometer driver - DEPENDS:=+kmod-iio-core +kmod-regmap-core - KCONFIG:= CONFIG_FXOS8700 - FILES:=$(LINUX_DIR)/drivers/iio/imu/fxos8700_core.ko - AUTOLOAD:=$(call AutoLoad,56,fxos8700) -endef - -define KernelPackage/iio-fxos8700/description - Support for Freescale FXOS8700 3-axis accelerometer. -endef - -$(eval $(call KernelPackage,iio-fxos8700)) - - -define KernelPackage/iio-fxos8700-i2c - SUBMENU:=$(IIO_MENU) - TITLE:=Freescale FXOS8700 3-axis acceleromter driver (I2C) - DEPENDS:=+kmod-iio-fxos8700 +kmod-i2c-core +kmod-regmap-i2c - KCONFIG:= CONFIG_FXOS8700_I2C - FILES:=$(LINUX_DIR)/drivers/iio/imu/fxos8700_i2c.ko - AUTOLOAD:=$(call AutoLoad,56,fxos8700_i2c) -endef - -define KernelPackage/iio-fxos8700-i2c/description - Support for Freescale FXOS8700 3-axis accelerometer - connected via I2C. -endef - - -$(eval $(call KernelPackage,iio-fxos8700-i2c)) - -define KernelPackage/iio-fxos8700-spi - SUBMENU:=$(IIO_MENU) - DEPENDS:=+kmod-iio-fxos8700 +kmod-regmap-spi - TITLE:=Freescale FXOS8700 3-axis accelerometer driver (SPI) - KCONFIG:= CONFIG_FXOS8700_SPI - FILES:=$(LINUX_DIR)/drivers/iio/imu/fxos8700_spi.ko - AUTOLOAD:=$(call AutoLoad,56,fxos8700_spi) -endef - -define KernelPackage/iio-fxos8700-spi/description - Support for Freescale FXOS8700 3-axis accelerometer - connected via SPI. -endef - -$(eval $(call KernelPackage,iio-fxos8700-spi)) diff --git a/feeds/ipq807x/linux/modules/input.mk b/feeds/ipq807x/linux/modules/input.mk deleted file mode 100644 index c2f39ddd9..000000000 --- a/feeds/ipq807x/linux/modules/input.mk +++ /dev/null @@ -1,229 +0,0 @@ -# -# Copyright (C) 2006-2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -INPUT_MODULES_MENU:=Input modules - -define KernelPackage/hid - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=HID Devices - DEPENDS:=+kmod-input-core +kmod-input-evdev - KCONFIG:=CONFIG_HID CONFIG_HIDRAW=y CONFIG_HID_BATTERY_STRENGTH=y - FILES:=$(LINUX_DIR)/drivers/hid/hid.ko - AUTOLOAD:=$(call AutoLoad,61,hid) -endef - -define KernelPackage/hid/description - Kernel modules for HID devices -endef - -$(eval $(call KernelPackage,hid)) - -define KernelPackage/hid-generic - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=Generic HID device support - DEPENDS:=+kmod-hid - KCONFIG:=CONFIG_HID_GENERIC - FILES:=$(LINUX_DIR)/drivers/hid/hid-generic.ko - AUTOLOAD:=$(call AutoProbe,hid-generic) -endef - -define KernelPackage/hid/description - Kernel modules for generic HID device (e.g. keyboards and mice) support -endef - -$(eval $(call KernelPackage,hid-generic)) - -define KernelPackage/input-core - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=Input device core - KCONFIG:=CONFIG_INPUT - FILES:=$(LINUX_DIR)/drivers/input/input-core.ko -endef - -define KernelPackage/input-core/description - Kernel modules for support of input device -endef - -$(eval $(call KernelPackage,input-core)) - - -define KernelPackage/input-evdev - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=Input event device - DEPENDS:=+kmod-input-core - KCONFIG:=CONFIG_INPUT_EVDEV - FILES:=$(LINUX_DIR)/drivers/input/evdev.ko - AUTOLOAD:=$(call AutoLoad,60,evdev) -endef - -define KernelPackage/input-evdev/description - Kernel modules for support of input device events -endef - -$(eval $(call KernelPackage,input-evdev)) - - -define KernelPackage/input-gpio-keys - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=GPIO key support - DEPENDS:= @GPIO_SUPPORT +kmod-input-core - KCONFIG:= \ - CONFIG_KEYBOARD_GPIO \ - CONFIG_INPUT_KEYBOARD=y - FILES:=$(LINUX_DIR)/drivers/input/keyboard/gpio_keys.ko - AUTOLOAD:=$(call AutoProbe,gpio_keys,1) -endef - -define KernelPackage/input-gpio-keys/description - This driver implements support for buttons connected - to GPIO pins of various CPUs (and some other chips). - - See also gpio-button-hotplug which is an alternative, lower overhead - implementation that generates uevents instead of kernel input events. -endef - -$(eval $(call KernelPackage,input-gpio-keys)) - - -define KernelPackage/input-gpio-keys-polled - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=Polled GPIO key support - DEPENDS:=@GPIO_SUPPORT +kmod-input-polldev - KCONFIG:= \ - CONFIG_KEYBOARD_GPIO_POLLED \ - CONFIG_INPUT_KEYBOARD=y - FILES:=$(LINUX_DIR)/drivers/input/keyboard/gpio_keys_polled.ko - AUTOLOAD:=$(call AutoProbe,gpio_keys_polled,1) -endef - -define KernelPackage/input-gpio-keys-polled/description - Kernel module for support polled GPIO keys input device - - See also gpio-button-hotplug which is an alternative, lower overhead - implementation that generates uevents instead of kernel input events. -endef - -$(eval $(call KernelPackage,input-gpio-keys-polled)) - - -define KernelPackage/input-gpio-encoder - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=GPIO rotary encoder - DEPENDS:=@GPIO_SUPPORT +kmod-input-core - KCONFIG:=CONFIG_INPUT_GPIO_ROTARY_ENCODER - FILES:=$(LINUX_DIR)/drivers/input/misc/rotary_encoder.ko - AUTOLOAD:=$(call AutoProbe,rotary_encoder) -endef - -define KernelPackage/input-gpio-encoder/description - Kernel module to use rotary encoders connected to GPIO pins -endef - -$(eval $(call KernelPackage,input-gpio-encoder)) - - -define KernelPackage/input-joydev - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=Joystick device support - DEPENDS:=+kmod-input-core - KCONFIG:=CONFIG_INPUT_JOYDEV - FILES:=$(LINUX_DIR)/drivers/input/joydev.ko - AUTOLOAD:=$(call AutoProbe,joydev) -endef - -define KernelPackage/input-joydev/description - Kernel module for joystick support -endef - -$(eval $(call KernelPackage,input-joydev)) - - -define KernelPackage/input-polldev - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=Polled Input device support - DEPENDS:=+kmod-input-core - KCONFIG:=CONFIG_INPUT_POLLDEV - FILES:=$(LINUX_DIR)/drivers/input/input-polldev.ko -endef - -define KernelPackage/input-polldev/description - Kernel module for support of polled input devices -endef - -$(eval $(call KernelPackage,input-polldev)) - - -define KernelPackage/input-matrixkmap - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=Input matrix devices support - DEPENDS:=+kmod-input-core - KCONFIG:=CONFIG_INPUT_MATRIXKMAP - FILES:=$(LINUX_DIR)/drivers/input/matrix-keymap.ko - AUTOLOAD:=$(call AutoProbe,matrix-keymap) -endef - -define KernelPackage/input-matrixkmap/description - Kernel module support for input matrix devices -endef - -$(eval $(call KernelPackage,input-matrixkmap)) - - -define KernelPackage/input-touchscreen-ads7846 - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens - DEPENDS:=+kmod-hwmon-core +kmod-input-core +kmod-spi-bitbang - KCONFIG:= \ - CONFIG_INPUT_TOUCHSCREEN=y \ - CONFIG_TOUCHSCREEN_PROPERTIES=y \ - CONFIG_TOUCHSCREEN_ADS7846 - FILES:=$(LINUX_DIR)/drivers/input/touchscreen/ads7846.ko \ - $(LINUX_DIR)/drivers/input/touchscreen/of_touchscreen.ko - AUTOLOAD:=$(call AutoProbe,ads7846) -endef - -define KernelPackage/input-touchscreen-ads7846/description - Kernel module for ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens -endef - -$(eval $(call KernelPackage,input-touchscreen-ads7846)) - - -define KernelPackage/keyboard-imx - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=IMX keypad support - DEPENDS:=@(TARGET_mxs||TARGET_imx6) +kmod-input-matrixkmap - KCONFIG:= \ - CONFIG_KEYBOARD_IMX \ - CONFIG_INPUT_KEYBOARD=y - FILES:=$(LINUX_DIR)/drivers/input/keyboard/imx_keypad.ko - AUTOLOAD:=$(call AutoProbe,imx_keypad) -endef - -define KernelPackage/keyboard-imx/description - Enable support for IMX keypad port. -endef - -$(eval $(call KernelPackage,keyboard-imx)) - - -define KernelPackage/input-uinput - SUBMENU:=$(INPUT_MODULES_MENU) - TITLE:=user input module - DEPENDS:=+kmod-input-core - KCONFIG:= \ - CONFIG_INPUT_MISC=y \ - CONFIG_INPUT_UINPUT - FILES:=$(LINUX_DIR)/drivers/input/misc/uinput.ko - AUTOLOAD:=$(call AutoProbe,uinput) -endef - -define KernelPackage/input-uinput/description - user input modules needed for bluez -endef - -$(eval $(call KernelPackage,input-uinput)) diff --git a/feeds/ipq807x/linux/modules/leds.mk b/feeds/ipq807x/linux/modules/leds.mk deleted file mode 100644 index bc94e54ae..000000000 --- a/feeds/ipq807x/linux/modules/leds.mk +++ /dev/null @@ -1,116 +0,0 @@ -# -# Copyright (C) 2006-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -LEDS_MENU:=LED modules - -define KernelPackage/leds-gpio - SUBMENU:=$(LEDS_MENU) - TITLE:=GPIO LED support - DEPENDS:= @GPIO_SUPPORT - KCONFIG:=CONFIG_LEDS_GPIO - FILES:=$(LINUX_DIR)/drivers/leds/leds-gpio.ko - AUTOLOAD:=$(call AutoLoad,60,leds-gpio,1) -endef - -define KernelPackage/leds-gpio/description - Kernel module for LEDs on GPIO lines -endef - -$(eval $(call KernelPackage,leds-gpio)) - -LED_TRIGGER_DIR=$(LINUX_DIR)/drivers/leds/trigger - -define KernelPackage/ledtrig-activity - SUBMENU:=$(LEDS_MENU) - TITLE:=LED Activity Trigger - KCONFIG:=CONFIG_LEDS_TRIGGER_ACTIVITY - FILES:=$(LED_TRIGGER_DIR)/ledtrig-activity.ko - AUTOLOAD:=$(call AutoLoad,50,ledtrig-activity) -endef - -define KernelPackage/ledtrig-activity/description - Kernel module that allows LEDs to blink based on system load -endef - -$(eval $(call KernelPackage,ledtrig-activity)) - -define KernelPackage/ledtrig-gpio - SUBMENU:=$(LEDS_MENU) - TITLE:=LED GPIO Trigger - KCONFIG:=CONFIG_LEDS_TRIGGER_GPIO - FILES:=$(LED_TRIGGER_DIR)/ledtrig-gpio.ko - AUTOLOAD:=$(call AutoLoad,50,ledtrig-gpio) -endef - -define KernelPackage/ledtrig-gpio/description - Kernel module that allows LEDs to be controlled by gpio events -endef - -$(eval $(call KernelPackage,ledtrig-gpio)) - - -define KernelPackage/ledtrig-transient - SUBMENU:=$(LEDS_MENU) - TITLE:=LED Transient Trigger - KCONFIG:=CONFIG_LEDS_TRIGGER_TRANSIENT - FILES:=$(LED_TRIGGER_DIR)/ledtrig-transient.ko - AUTOLOAD:=$(call AutoLoad,50,ledtrig-transient,1) -endef - -define KernelPackage/ledtrig-transient/description - Kernel module that allows LEDs one time activation of a transient state. -endef - -$(eval $(call KernelPackage,ledtrig-transient)) - - -define KernelPackage/ledtrig-oneshot - SUBMENU:=$(LEDS_MENU) - TITLE:=LED One-Shot Trigger - KCONFIG:=CONFIG_LEDS_TRIGGER_ONESHOT - FILES:=$(LED_TRIGGER_DIR)/ledtrig-oneshot.ko - AUTOLOAD:=$(call AutoLoad,50,ledtrig-oneshot) -endef - -define KernelPackage/ledtrig-oneshot/description - Kernel module that allows LEDs to be triggered by sporadic events in - one-shot pulses -endef - -$(eval $(call KernelPackage,ledtrig-oneshot)) - - -define KernelPackage/leds-pca963x - SUBMENU:=$(LEDS_MENU) - TITLE:=PCA963x LED support - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_LEDS_PCA963X - FILES:=$(LINUX_DIR)/drivers/leds/leds-pca963x.ko - AUTOLOAD:=$(call AutoLoad,60,leds-pca963x,1) -endef - -define KernelPackage/leds-pca963x/description - Driver for the NXP PCA963x I2C LED controllers. -endef - -$(eval $(call KernelPackage,leds-pca963x)) - - -define KernelPackage/leds-pwm - SUBMENU:=$(LEDS_MENU) - TITLE:=PWM driven LED Support - KCONFIG:=CONFIG_LEDS_PWM - DEPENDS:= @PWM_SUPPORT - FILES:=$(LINUX_DIR)/drivers/leds/leds-pwm.ko - AUTOLOAD:=$(call AutoLoad,60,leds-pwm,1) -endef - -define KernelPackage/leds-pwm/description - This option enables support for pwm driven LEDs -endef - -$(eval $(call KernelPackage,leds-pwm)) diff --git a/feeds/ipq807x/linux/modules/lib.mk b/feeds/ipq807x/linux/modules/lib.mk deleted file mode 100644 index 9a341932b..000000000 --- a/feeds/ipq807x/linux/modules/lib.mk +++ /dev/null @@ -1,274 +0,0 @@ -# -# Copyright (C) 2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -LIB_MENU:=Libraries - -define KernelPackage/lib-crc-ccitt - SUBMENU:=$(LIB_MENU) - TITLE:=CRC-CCITT support - KCONFIG:=CONFIG_CRC_CCITT - FILES:=$(LINUX_DIR)/lib/crc-ccitt.ko - AUTOLOAD:=$(call AutoProbe,crc-ccitt) -endef - -define KernelPackage/lib-crc-ccitt/description - Kernel module for CRC-CCITT support -endef - -$(eval $(call KernelPackage,lib-crc-ccitt)) - - -define KernelPackage/lib-crc-itu-t - SUBMENU:=$(LIB_MENU) - TITLE:=CRC ITU-T V.41 support - KCONFIG:=CONFIG_CRC_ITU_T - FILES:=$(LINUX_DIR)/lib/crc-itu-t.ko - AUTOLOAD:=$(call AutoProbe,crc-itu-t) -endef - -define KernelPackage/lib-crc-itu-t/description - Kernel module for CRC ITU-T V.41 support -endef - -$(eval $(call KernelPackage,lib-crc-itu-t)) - - -define KernelPackage/lib-crc7 - SUBMENU:=$(LIB_MENU) - TITLE:=CRC7 support - KCONFIG:=CONFIG_CRC7 - FILES:=$(LINUX_DIR)/lib/crc7.ko - AUTOLOAD:=$(call AutoProbe,crc7) -endef - -define KernelPackage/lib-crc7/description - Kernel module for CRC7 support -endef - -$(eval $(call KernelPackage,lib-crc7)) - - -define KernelPackage/lib-crc8 - SUBMENU:=$(LIB_MENU) - TITLE:=CRC8 support - KCONFIG:=CONFIG_CRC8 - FILES:=$(LINUX_DIR)/lib/crc8.ko - AUTOLOAD:=$(call AutoProbe,crc8) -endef - -define KernelPackage/lib-crc8/description - Kernel module for CRC8 support -endef - -$(eval $(call KernelPackage,lib-crc8)) - - -define KernelPackage/lib-crc16 - SUBMENU:=$(LIB_MENU) - TITLE:=CRC16 support - KCONFIG:=CONFIG_CRC16 - FILES:=$(LINUX_DIR)/lib/crc16.ko - AUTOLOAD:=$(call AutoLoad,20,crc16,1) -endef - -define KernelPackage/lib-crc16/description - Kernel module for CRC16 support -endef - -$(eval $(call KernelPackage,lib-crc16)) - - -define KernelPackage/lib-crc32c - SUBMENU:=$(LIB_MENU) - TITLE:=CRC32 support - KCONFIG:=CONFIG_LIBCRC32C - DEPENDS:=+kmod-crypto-crc32c - FILES:=$(LINUX_DIR)/lib/libcrc32c.ko - AUTOLOAD:=$(call AutoProbe,libcrc32c) -endef - -define KernelPackage/lib-crc32c/description - Kernel module for CRC32 support -endef - -$(eval $(call KernelPackage,lib-crc32c)) - - -define KernelPackage/lib-lzo - SUBMENU:=$(LIB_MENU) - TITLE:=LZO support - DEPENDS:=+kmod-crypto-acompress - KCONFIG:= \ - CONFIG_CRYPTO_LZO \ - CONFIG_LZO_COMPRESS \ - CONFIG_LZO_DECOMPRESS - HIDDEN:=1 - FILES:= \ - $(LINUX_DIR)/crypto/lzo.ko \ - $(LINUX_DIR)/lib/lzo/lzo_compress.ko \ - $(LINUX_DIR)/lib/lzo/lzo_decompress.ko - AUTOLOAD:=$(call AutoProbe,lzo lzo_compress lzo_decompress) -endef - -define KernelPackage/lib-lzo/description - Kernel module for LZO compression/decompression support -endef - -$(eval $(call KernelPackage,lib-lzo)) - - -define KernelPackage/lib-zstd - SUBMENU:=$(LIB_MENU) - TITLE:=ZSTD support - DEPENDS:=+kmod-crypto-acompress - KCONFIG:= \ - CONFIG_CRYPTO_ZSTD \ - CONFIG_ZSTD_COMPRESS \ - CONFIG_ZSTD_DECOMPRESS \ - CONFIG_XXHASH - FILES:= \ - $(LINUX_DIR)/crypto/zstd.ko \ - $(LINUX_DIR)/lib/xxhash.ko \ - $(LINUX_DIR)/lib/zstd/zstd_compress.ko \ - $(LINUX_DIR)/lib/zstd/zstd_decompress.ko - AUTOLOAD:=$(call AutoProbe,xxhash zstd zstd_compress zstd_decompress) -endef - -define KernelPackage/lib-zstd/description - Kernel module for ZSTD compression/decompression support -endef - -$(eval $(call KernelPackage,lib-zstd)) - - -define KernelPackage/lib-lz4 - SUBMENU:=$(LIB_MENU) - TITLE:=LZ4 support - DEPENDS:=+kmod-crypto-acompress - KCONFIG:= \ - CONFIG_CRYPTO_LZ4 \ - CONFIG_LZ4_COMPRESS \ - CONFIG_LZ4_DECOMPRESS - FILES:= \ - $(LINUX_DIR)/crypto/lz4.ko \ - $(LINUX_DIR)/lib/lz4/lz4_compress.ko \ - $(LINUX_DIR)/lib/lz4/lz4_decompress.ko - AUTOLOAD:=$(call AutoProbe,lz4 lz4_compress lz4_decompress) -endef - -define KernelPackage/lib-lz4/description - Kernel module for LZ4 compression/decompression support -endef - -$(eval $(call KernelPackage,lib-lz4)) - - -define KernelPackage/lib-raid6 - SUBMENU:=$(LIB_MENU) - TITLE:=RAID6 algorithm support - HIDDEN:=1 - KCONFIG:=CONFIG_RAID6_PQ - FILES:=$(LINUX_DIR)/lib/raid6/raid6_pq.ko - AUTOLOAD:=$(call AutoProbe,raid6_pq) -endef - -define KernelPackage/lib-raid6/description - Kernel module for RAID6 algorithms -endef - -$(eval $(call KernelPackage,lib-raid6)) - - -define KernelPackage/lib-xor - SUBMENU:=$(LIB_MENU) - TITLE:=XOR blocks algorithm support - HIDDEN:=1 - KCONFIG:=CONFIG_XOR_BLOCKS -ifneq ($(wildcard $(LINUX_DIR)/arch/$(LINUX_KARCH)/lib/xor-neon.ko),) - FILES:= \ - $(LINUX_DIR)/crypto/xor.ko \ - $(LINUX_DIR)/arch/$(LINUX_KARCH)/lib/xor-neon.ko - AUTOLOAD:=$(call AutoProbe,xor-neon xor) -else - FILES:=$(LINUX_DIR)/crypto/xor.ko - AUTOLOAD:=$(call AutoProbe,xor) -endif -endef - -define KernelPackage/lib-xor/description - Kernel module for XOR blocks algorithms -endef - -$(eval $(call KernelPackage,lib-xor)) - - -define KernelPackage/lib-textsearch -SUBMENU:=$(LIB_MENU) - TITLE:=Textsearch support - KCONFIG:= \ - CONFIG_TEXTSEARCH=y \ - CONFIG_TEXTSEARCH_KMP \ - CONFIG_TEXTSEARCH_BM \ - CONFIG_TEXTSEARCH_FSM - FILES:= \ - $(LINUX_DIR)/lib/ts_kmp.ko \ - $(LINUX_DIR)/lib/ts_bm.ko \ - $(LINUX_DIR)/lib/ts_fsm.ko - AUTOLOAD:=$(call AutoProbe,ts_kmp ts_bm ts_fsm) -endef - -$(eval $(call KernelPackage,lib-textsearch)) - - -define KernelPackage/lib-zlib-inflate - SUBMENU:=$(LIB_MENU) - TITLE:=Zlib support - HIDDEN:=1 - KCONFIG:=CONFIG_ZLIB_INFLATE - FILES:=$(LINUX_DIR)/lib/zlib_inflate/zlib_inflate.ko - AUTOLOAD:=$(call AutoProbe,zlib_inflate) -endef - -$(eval $(call KernelPackage,lib-zlib-inflate)) - - -define KernelPackage/lib-zlib-deflate - SUBMENU:=$(LIB_MENU) - TITLE:=Zlib support - HIDDEN:=1 - KCONFIG:=CONFIG_ZLIB_DEFLATE - FILES:=$(LINUX_DIR)/lib/zlib_deflate/zlib_deflate.ko - AUTOLOAD:=$(call AutoProbe,zlib_deflate) -endef - -$(eval $(call KernelPackage,lib-zlib-deflate)) - - -define KernelPackage/lib-cordic - SUBMENU:=$(LIB_MENU) - TITLE:=Cordic function support - KCONFIG:=CONFIG_CORDIC - FILES:=$(LINUX_DIR)/lib/math/cordic.ko - AUTOLOAD:=$(call AutoProbe,cordic) -endef - -define KernelPackage/lib-cordic/description - Kernel module for Cordic function support -endef - -$(eval $(call KernelPackage,lib-cordic)) - - -define KernelPackage/asn1-decoder - SUBMENU:=$(LIB_MENU) - TITLE:=Simple ASN1 decoder - KCONFIG:= CONFIG_ASN1 - HIDDEN:=1 - FILES:=$(LINUX_DIR)/lib/asn1_decoder.ko -endef - -$(eval $(call KernelPackage,asn1-decoder)) diff --git a/feeds/ipq807x/linux/modules/netdevices.mk b/feeds/ipq807x/linux/modules/netdevices.mk deleted file mode 100644 index 44a91d3d8..000000000 --- a/feeds/ipq807x/linux/modules/netdevices.mk +++ /dev/null @@ -1,1244 +0,0 @@ -# -# Copyright (C) 2006-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -NETWORK_DEVICES_MENU:=Network Devices - -define KernelPackage/sis190 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=SiS 190 Fast/Gigabit Ethernet support - DEPENDS:=@PCI_SUPPORT +kmod-mii - KCONFIG:=CONFIG_SIS190 - FILES:=$(LINUX_DIR)/drivers/net/ethernet/sis/sis190.ko - AUTOLOAD:=$(call AutoProbe,sis190) -endef - -$(eval $(call KernelPackage,sis190)) - - -define KernelPackage/skge - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=SysKonnect Yukon support - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_SKGE \ - CONFIG_SKGE_DEBUG=n \ - CONFIG_SKGE_GENESIS=n - FILES:=$(LINUX_DIR)/drivers/net/ethernet/marvell/skge.ko - AUTOLOAD:=$(call AutoProbe,skge) -endef - -$(eval $(call KernelPackage,skge)) - - -define KernelPackage/alx - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Qualcomm Atheros AR816x/AR817x PCI-E Ethernet Network Driver - DEPENDS:=@PCI_SUPPORT +kmod-mdio - KCONFIG:=CONFIG_ALX - FILES:=$(LINUX_DIR)/drivers/net/ethernet/atheros/alx/alx.ko - AUTOLOAD:=$(call AutoProbe,alx) -endef - -$(eval $(call KernelPackage,alx)) - - -define KernelPackage/atl2 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Atheros L2 Fast Ethernet support - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_ATL2 - FILES:=$(LINUX_DIR)/drivers/net/ethernet/atheros/atlx/atl2.ko - AUTOLOAD:=$(call AutoProbe,atl2) -endef - -$(eval $(call KernelPackage,atl2)) - - -define KernelPackage/atl1 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Atheros L1 Gigabit Ethernet support - DEPENDS:=@PCI_SUPPORT +kmod-mii - KCONFIG:=CONFIG_ATL1 - FILES:=$(LINUX_DIR)/drivers/net/ethernet/atheros/atlx/atl1.ko - AUTOLOAD:=$(call AutoProbe,atl1) -endef - -$(eval $(call KernelPackage,atl1)) - - -define KernelPackage/atl1c - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Atheros L1C - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_ATL1C - FILES:=$(LINUX_DIR)/drivers/net/ethernet/atheros/atl1c/atl1c.ko - AUTOLOAD:=$(call AutoProbe,atl1c) -endef - -$(eval $(call KernelPackage,atl1c)) - - -define KernelPackage/atl1e - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Atheros L1E - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_ATL1E - FILES:=$(LINUX_DIR)/drivers/net/ethernet/atheros/atl1e/atl1e.ko - AUTOLOAD:=$(call AutoProbe,atl1e) -endef - -$(eval $(call KernelPackage,atl1e)) - - -define KernelPackage/libphy - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=PHY library - KCONFIG:=CONFIG_PHYLIB - FILES:=$(LINUX_DIR)/drivers/net/phy/libphy.ko - AUTOLOAD:=$(call AutoLoad,15,libphy,1) -endef - -define KernelPackage/libphy/description - PHY library -endef - -$(eval $(call KernelPackage,libphy)) - - -define KernelPackage/phylink - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Model for MAC to optional PHY connection - KCONFIG:=CONFIG_PHYLINK - FILES:=$(LINUX_DIR)/drivers/net/phy/phylink.ko - AUTOLOAD:=$(call AutoLoad,15,phylink,1) -endef - -define KernelPackage/phylink/description - Model for MAC to optional PHY connection -endef - -$(eval $(call KernelPackage,phylink)) - - -define KernelPackage/mii - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=MII library - KCONFIG:=CONFIG_MII - FILES:=$(LINUX_DIR)/drivers/net/mii.ko - AUTOLOAD:=$(call AutoLoad,15,mii,1) -endef - -define KernelPackage/mii/description - MII library -endef - -$(eval $(call KernelPackage,mii)) - - -define KernelPackage/mdio-gpio - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:= Supports GPIO lib-based MDIO busses - DEPENDS:=+kmod-libphy @GPIO_SUPPORT +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_tegra):kmod-of-mdio - KCONFIG:= \ - CONFIG_MDIO_BITBANG \ - CONFIG_MDIO_GPIO - FILES:= \ - $(LINUX_DIR)/drivers/net/phy/mdio-gpio.ko \ - $(LINUX_DIR)/drivers/net/phy/mdio-bitbang.ko - AUTOLOAD:=$(call AutoProbe,mdio-gpio) -endef - -define KernelPackage/mdio-gpio/description - Supports GPIO lib-based MDIO busses -endef - -$(eval $(call KernelPackage,mdio-gpio)) - - -define KernelPackage/et131x - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Agere ET131x Gigabit Ethernet driver - URL:=http://sourceforge.net/projects/et131x - FILES:= \ - $(LINUX_DIR)/drivers/net/ethernet/agere/et131x.ko - KCONFIG:= \ - CONFIG_ET131X \ - CONFIG_ET131X_DEBUG=n - DEPENDS:=@PCI_SUPPORT +kmod-libphy - AUTOLOAD:=$(call AutoProbe,et131x) -endef - -define KernelPackage/et131x/description - This package contains the et131x kernel module -endef - -$(eval $(call KernelPackage,et131x)) - - -define KernelPackage/phylib-broadcom - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Broadcom Ethernet PHY library - KCONFIG:=CONFIG_BCM_NET_PHYLIB - HIDDEN:=1 - DEPENDS:=+kmod-libphy - FILES:=$(LINUX_DIR)/drivers/net/phy/bcm-phy-lib.ko - AUTOLOAD:=$(call AutoLoad,17,bcm-phy-lib) -endef - -$(eval $(call KernelPackage,phylib-broadcom)) - - -define KernelPackage/phy-broadcom - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Broadcom Ethernet PHY driver - KCONFIG:=CONFIG_BROADCOM_PHY - DEPENDS:=+kmod-libphy +kmod-phylib-broadcom - FILES:=$(LINUX_DIR)/drivers/net/phy/broadcom.ko - AUTOLOAD:=$(call AutoLoad,18,broadcom,1) -endef - -define KernelPackage/phy-broadcom/description - Currently supports the BCM5411, BCM5421, BCM5461, BCM5464, BCM5481, - BCM5482 and BCM57780 PHYs. -endef - -$(eval $(call KernelPackage,phy-broadcom)) - - -define KernelPackage/phy-bcm84881 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Broadcom BCM84881 PHY driver - KCONFIG:=CONFIG_BCM84881_PHY - DEPENDS:=+kmod-libphy - FILES:=$(LINUX_DIR)/drivers/net/phy/bcm84881.ko - AUTOLOAD:=$(call AutoLoad,18,bcm84881,1) -endef - -define KernelPackage/phy-bcm84881/description - Supports the Broadcom 84881 PHY. -endef - -$(eval $(call KernelPackage,phy-bcm84881)) - - - -define KernelPackage/phy-realtek - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Realtek Ethernet PHY driver - KCONFIG:=CONFIG_REALTEK_PHY - DEPENDS:=+kmod-libphy - FILES:=$(LINUX_DIR)/drivers/net/phy/realtek.ko - AUTOLOAD:=$(call AutoLoad,18,realtek,1) -endef - -define KernelPackage/phy-realtek/description - Supports the Realtek 821x PHY. -endef - -$(eval $(call KernelPackage,phy-realtek)) - - -define KernelPackage/swconfig - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=switch configuration API - DEPENDS:=+kmod-libphy - KCONFIG:=CONFIG_SWCONFIG - FILES:=$(LINUX_DIR)/drivers/net/phy/swconfig.ko - AUTOLOAD:=$(call AutoLoad,41,swconfig) -endef - -define KernelPackage/swconfig/description - Switch configuration API module -endef - -$(eval $(call KernelPackage,swconfig)) - -define KernelPackage/switch-bcm53xx - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Broadcom bcm53xx switch support - DEPENDS:=+kmod-swconfig - KCONFIG:=CONFIG_SWCONFIG_B53 - FILES:=$(LINUX_DIR)/drivers/net/phy/b53/b53_common.ko - AUTOLOAD:=$(call AutoLoad,42,b53_common) -endef - -define KernelPackage/switch-bcm53xx/description - Broadcom bcm53xx switch support -endef - -$(eval $(call KernelPackage,switch-bcm53xx)) - -define KernelPackage/switch-bcm53xx-mdio - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Broadcom bcm53xx switch MDIO support - DEPENDS:=+kmod-switch-bcm53xx - KCONFIG:=CONFIG_SWCONFIG_B53_PHY_DRIVER - FILES:=$(LINUX_DIR)/drivers/net/phy/b53/b53_mdio.ko - AUTOLOAD:=$(call AutoLoad,42,b53_mdio) -endef - -define KernelPackage/switch-bcm53xx-mdio/description - Broadcom bcm53xx switch MDIO support -endef - -$(eval $(call KernelPackage,switch-bcm53xx-mdio)) - - -define KernelPackage/switch-ip17xx - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=IC+ IP17XX switch support - DEPENDS:=+kmod-swconfig - KCONFIG:=CONFIG_IP17XX_PHY - FILES:=$(LINUX_DIR)/drivers/net/phy/ip17xx.ko - AUTOLOAD:=$(call AutoLoad,42,ip17xx) -endef - -define KernelPackage/switch-ip17xx/description - IC+ IP175C/IP178C switch support -endef - -$(eval $(call KernelPackage,switch-ip17xx)) - - -define KernelPackage/switch-rtl8306 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Realtek RTL8306S switch support - DEPENDS:=+kmod-swconfig - KCONFIG:=CONFIG_RTL8306_PHY - FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8306.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8306) -endef - -define KernelPackage/switch-rtl8306/description - Realtek RTL8306S switch support -endef - -$(eval $(call KernelPackage,switch-rtl8306)) - - -define KernelPackage/switch-rtl8366-smi - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Realtek RTL8366 SMI switch interface support - DEPENDS:=@GPIO_SUPPORT +kmod-swconfig +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_tegra):kmod-of-mdio - KCONFIG:=CONFIG_RTL8366_SMI=y - FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366_smi.ko - AUTOLOAD:=$(call AutoLoad,42,rtl8366_smi,1) -endef - -define KernelPackage/switch-rtl8366-smi/description - Realtek RTL8366 series SMI switch interface support -endef - -$(eval $(call KernelPackage,switch-rtl8366-smi)) - - -define KernelPackage/switch-rtl8366rb - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Realtek RTL8366RB switch support - DEPENDS:=+kmod-switch-rtl8366-smi - KCONFIG:=CONFIG_RTL8366RB_PHY - FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366rb.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8366rb) -endef - -define KernelPackage/switch-rtl8366rb/description - Realtek RTL8366RB switch support -endef - -$(eval $(call KernelPackage,switch-rtl8366rb)) - - -define KernelPackage/switch-rtl8366s - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Realtek RTL8366S switch support - DEPENDS:=+kmod-switch-rtl8366-smi - KCONFIG:=CONFIG_RTL8366S_PHY - FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366s.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8366s) -endef - -define KernelPackage/switch-rtl8366s/description - Realtek RTL8366S switch support -endef - -$(eval $(call KernelPackage,switch-rtl8366s)) - - -define KernelPackage/switch-rtl8367b - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Realtek RTL8367R/B switch support - DEPENDS:=+kmod-switch-rtl8366-smi - KCONFIG:=CONFIG_RTL8367B_PHY - FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8367b.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8367b,1) -endef - -define KernelPackage/switch-rtl8367b/description - Realtek RTL8367R/B switch support -endef - -$(eval $(call KernelPackage,switch-rtl8367b)) - -define KernelPackage/switch-rtl8367c - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Realtek RTL8367C/S switch support - DEPENDS:=+kmod-switch-rtl8366-smi - KCONFIG:=CONFIG_RTL8367C_PHY=y - FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8367c.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8367c,1) -endef - -define KernelPackage/switch-rtl8367c/description - Realtek RTL8367C/S switch support -endef - -$(eval $(call KernelPackage,switch-rtl8367c)) - - -define KernelPackage/natsemi - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=National Semiconductor DP8381x series - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_NATSEMI - FILES:=$(LINUX_DIR)/drivers/net/ethernet/natsemi/natsemi.ko - AUTOLOAD:=$(call AutoLoad,20,natsemi) -endef - -define KernelPackage/natsemi/description - Kernel modules for National Semiconductor DP8381x series PCI Ethernet - adapters. -endef - -$(eval $(call KernelPackage,natsemi)) - - -define KernelPackage/r6040 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=RDC Fast-Ethernet support - DEPENDS:=@PCI_SUPPORT +kmod-libphy - KCONFIG:=CONFIG_R6040 \ - CONFIG_R6040_NAPI=y - FILES:=$(LINUX_DIR)/drivers/net/ethernet/rdc/r6040.ko - AUTOLOAD:=$(call AutoProbe,r6040) -endef - -define KernelPackage/r6040/description - Kernel modules for RDC Fast-Ethernet adapters. -endef - -$(eval $(call KernelPackage,r6040)) - - -define KernelPackage/niu - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Sun Neptune 10Gbit Ethernet support - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_NIU - FILES:=$(LINUX_DIR)/drivers/net/ethernet/sun/niu.ko - AUTOLOAD:=$(call AutoProbe,niu) -endef - -define KernelPackage/niu/description - This enables support for cards based upon Sun's Neptune chipset. -endef - -$(eval $(call KernelPackage,niu)) - - -define KernelPackage/sis900 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=SiS 900 Ethernet support - DEPENDS:=@PCI_SUPPORT +kmod-mii - KCONFIG:=CONFIG_SIS900 - FILES:=$(LINUX_DIR)/drivers/net/ethernet/sis/sis900.ko - AUTOLOAD:=$(call AutoProbe,sis900) -endef - -define KernelPackage/sis900/description - Kernel modules for Sis 900 Ethernet adapters. -endef - -$(eval $(call KernelPackage,sis900)) - - -define KernelPackage/sky2 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=SysKonnect Yukon2 support - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_SKY2 - FILES:=$(LINUX_DIR)/drivers/net/ethernet/marvell/sky2.ko - AUTOLOAD:=$(call AutoProbe,sky2) -endef - -define KernelPackage/sky2/description - This driver supports Gigabit Ethernet adapters based on the - Marvell Yukon 2 chipset: - Marvell 88E8021/88E8022/88E8035/88E8036/88E8038/88E8050/88E8052/ - 88E8053/88E8055/88E8061/88E8062, SysKonnect SK-9E21D/SK-9S21 - - There is companion driver for the older Marvell Yukon and - Genesis based adapters: skge. -endef - -$(eval $(call KernelPackage,sky2)) - - -define KernelPackage/via-rhine - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Via Rhine ethernet support - DEPENDS:=@PCI_SUPPORT +kmod-mii - KCONFIG:=CONFIG_VIA_RHINE \ - CONFIG_VIA_RHINE_MMIO=y - FILES:=$(LINUX_DIR)/drivers/net/ethernet/via/via-rhine.ko - AUTOLOAD:=$(call AutoProbe,via-rhine) -endef - -define KernelPackage/via-rhine/description - Kernel modules for Via Rhine Ethernet chipsets -endef - -$(eval $(call KernelPackage,via-rhine)) - - -define KernelPackage/via-velocity - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=VIA Velocity Gigabit Ethernet Adapter kernel support - DEPENDS:=@PCI_SUPPORT +kmod-lib-crc-ccitt - KCONFIG:=CONFIG_VIA_VELOCITY - FILES:=$(LINUX_DIR)/drivers/net/ethernet/via/via-velocity.ko - AUTOLOAD:=$(call AutoProbe,via-velocity) -endef - -define KernelPackage/via-velocity/description - Kernel modules for VIA Velocity Gigabit Ethernet chipsets -endef - -$(eval $(call KernelPackage,via-velocity)) - - -define KernelPackage/8139too - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=RealTek RTL-8139 PCI Fast Ethernet Adapter kernel support - DEPENDS:=@PCI_SUPPORT +kmod-mii - KCONFIG:=CONFIG_8139TOO \ - CONFIG_8139TOO_PIO=y \ - CONFIG_8139TOO_TUNE_TWISTER=n \ - CONFIG_8139TOO_8129=n \ - CONFIG_8139_OLD_RX_RESET=n - FILES:=$(LINUX_DIR)/drivers/net/ethernet/realtek/8139too.ko - AUTOLOAD:=$(call AutoProbe,8139too) -endef - -define KernelPackage/8139too/description - Kernel modules for RealTek RTL-8139 PCI Fast Ethernet adapters -endef - -$(eval $(call KernelPackage,8139too)) - - -define KernelPackage/8139cp - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=RealTek RTL-8139C+ PCI Fast Ethernet Adapter kernel support - DEPENDS:=@PCI_SUPPORT +kmod-mii - KCONFIG:=CONFIG_8139CP - FILES:=$(LINUX_DIR)/drivers/net/ethernet/realtek/8139cp.ko - AUTOLOAD:=$(call AutoProbe,8139cp) -endef - -define KernelPackage/8139cp/description - Kernel module for RealTek RTL-8139C+ PCI Fast Ethernet adapters -endef - -$(eval $(call KernelPackage,8139cp)) - - -define KernelPackage/r8169 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=RealTek RTL-8169 PCI Gigabit Ethernet Adapter kernel support - DEPENDS:=@PCI_SUPPORT +kmod-mii +r8169-firmware +!LINUX_4_14:kmod-phy-realtek - KCONFIG:=CONFIG_R8169 \ - CONFIG_R8169_NAPI=y \ - CONFIG_R8169_VLAN=n - FILES:=$(LINUX_DIR)/drivers/net/ethernet/realtek/r8169.ko - AUTOLOAD:=$(call AutoProbe,r8169) -endef - -define KernelPackage/r8169/description - Kernel modules for RealTek RTL-8169 PCI Gigabit Ethernet adapters -endef - -$(eval $(call KernelPackage,r8169)) - - -define KernelPackage/ne2k-pci - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=ne2k-pci Ethernet Adapter kernel support - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_NE2K_PCI - FILES:= \ - $(LINUX_DIR)/drivers/net/ethernet/8390/ne2k-pci.ko \ - $(LINUX_DIR)/drivers/net/ethernet/8390/8390.ko - AUTOLOAD:=$(call AutoProbe,8390 ne2k-pci) -endef - -define KernelPackage/ne2k-pci/description - Kernel modules for NE2000 PCI Ethernet Adapter kernel -endef - -$(eval $(call KernelPackage,ne2k-pci)) - - -define KernelPackage/e100 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) PRO/100+ cards kernel support - DEPENDS:=@PCI_SUPPORT +kmod-mii +e100-firmware - KCONFIG:=CONFIG_E100 - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e100.ko - AUTOLOAD:=$(call AutoProbe,e100) -endef - -define KernelPackage/e100/description - Kernel modules for Intel(R) PRO/100+ Ethernet adapters -endef - -$(eval $(call KernelPackage,e100)) - - -define KernelPackage/e1000 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) PRO/1000 PCI cards kernel support - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_E1000 \ - CONFIG_E1000_DISABLE_PACKET_SPLIT=n \ - CONFIG_E1000_NAPI=y - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e1000/e1000.ko - AUTOLOAD:=$(call AutoLoad,35,e1000) -endef - -define KernelPackage/e1000/description - Kernel modules for Intel(R) PRO/1000 PCI Ethernet adapters. -endef - -$(eval $(call KernelPackage,e1000)) - - -define KernelPackage/e1000e - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) PRO/1000 PCIe cards kernel support - DEPENDS:=@PCIE_SUPPORT +kmod-ptp - KCONFIG:=CONFIG_E1000E - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e1000e/e1000e.ko - AUTOLOAD:=$(call AutoProbe,e1000e) - MODPARAMS.e1000e:= \ - IntMode=1 \ - InterruptThrottleRate=4,4,4,4,4,4,4,4 -endef - -define KernelPackage/e1000e/description - Kernel modules for Intel(R) PRO/1000 PCIe Ethernet adapters. -endef - -$(eval $(call KernelPackage,e1000e)) - - -define KernelPackage/igb - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support - DEPENDS:=@PCI_SUPPORT +kmod-i2c-core +kmod-i2c-algo-bit +kmod-ptp +kmod-hwmon-core - KCONFIG:=CONFIG_IGB \ - CONFIG_IGB_HWMON=y \ - CONFIG_IGB_DCA=n - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/igb/igb.ko - AUTOLOAD:=$(call AutoLoad,35,igb) -endef - -define KernelPackage/igb/description - Kernel modules for Intel(R) 82575/82576 PCI-Express Gigabit Ethernet adapters. -endef - -$(eval $(call KernelPackage,igb)) - - -define KernelPackage/igbvf - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) 82576 Virtual Function Ethernet support - DEPENDS:=@PCI_SUPPORT @TARGET_x86 +kmod-i2c-core +kmod-i2c-algo-bit +kmod-ptp - KCONFIG:=CONFIG_IGBVF \ - CONFIG_IGB_HWMON=y \ - CONFIG_IGB_DCA=n - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/igbvf/igbvf.ko - AUTOLOAD:=$(call AutoLoad,35,igbvf) -endef - -define KernelPackage/igbvf/description - Kernel modules for Intel(R) 82576 Virtual Function Ethernet adapters. -endef - -$(eval $(call KernelPackage,igbvf)) - - -define KernelPackage/ixgbe - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) 82598/82599 PCI-Express 10 Gigabit Ethernet support - DEPENDS:=@PCI_SUPPORT +kmod-mdio +kmod-ptp +kmod-hwmon-core +kmod-libphy - KCONFIG:=CONFIG_IXGBE \ - CONFIG_IXGBE_VXLAN=n \ - CONFIG_IXGBE_HWMON=y \ - CONFIG_IXGBE_DCA=n - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/ixgbe/ixgbe.ko - AUTOLOAD:=$(call AutoLoad,35,ixgbe) -endef - -define KernelPackage/ixgbe/description - Kernel modules for Intel(R) 82598/82599 PCI-Express 10 Gigabit Ethernet adapters. -endef - -$(eval $(call KernelPackage,ixgbe)) - - -define KernelPackage/ixgbevf - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) 82599 Virtual Function Ethernet support - DEPENDS:=@PCI_SUPPORT +kmod-ixgbe - KCONFIG:=CONFIG_IXGBEVF \ - CONFIG_IXGBE_VXLAN=n \ - CONFIG_IXGBE_HWMON=y \ - CONFIG_IXGBE_DCA=n - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/ixgbevf/ixgbevf.ko - AUTOLOAD:=$(call AutoLoad,35,ixgbevf) -endef - -define KernelPackage/ixgbevf/description - Kernel modules for Intel(R) 82599 Virtual Function Ethernet adapters. -endef - -$(eval $(call KernelPackage,ixgbevf)) - - -define KernelPackage/i40e - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) Ethernet Controller XL710 Family support - DEPENDS:=@PCI_SUPPORT +kmod-mdio +kmod-ptp +kmod-hwmon-core +kmod-libphy - KCONFIG:=CONFIG_I40E \ - CONFIG_I40E_VXLAN=n \ - CONFIG_I40E_HWMON=y \ - CONFIG_I40E_DCA=n - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/i40e/i40e.ko - AUTOLOAD:=$(call AutoProbe,i40e) -endef - -define KernelPackage/i40e/description - Kernel modules for Intel(R) Ethernet Controller XL710 Family 40 Gigabit Ethernet adapters. -endef - -$(eval $(call KernelPackage,i40e)) - - -define KernelPackage/iavf - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) Ethernet Adaptive Virtual Function support - DEPENDS:=@PCI_SUPPORT - KCONFIG:= \ - CONFIG_I40EVF \ - CONFIG_IAVF - FILES:= \ - $(LINUX_DIR)/drivers/net/ethernet/intel/iavf/iavf.ko - AUTOLOAD:=$(call AutoProbe,i40evf iavf) - AUTOLOAD:=$(call AutoProbe,iavf) -endef - -define KernelPackage/iavf/description - Kernel modules for Intel XL710, - X710, X722, XXV710, and all devices advertising support for - Intel Ethernet Adaptive Virtual Function devices. -endef - -$(eval $(call KernelPackage,iavf)) - - -define KernelPackage/b44 - TITLE:=Broadcom 44xx driver - KCONFIG:=CONFIG_B44 - DEPENDS:=@PCI_SUPPORT @!TARGET_bcm47xx_mips74k +!TARGET_bcm47xx:kmod-ssb +kmod-mii +kmod-libphy - SUBMENU:=$(NETWORK_DEVICES_MENU) - FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/b44.ko - AUTOLOAD:=$(call AutoLoad,19,b44,1) -endef - -define KernelPackage/b44/description - Kernel modules for Broadcom 44xx Ethernet adapters. -endef - -$(eval $(call KernelPackage,b44)) - - -define KernelPackage/3c59x - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=3Com 3c590/3c900 series (592/595/597) Vortex/Boomerang - DEPENDS:=@PCI_SUPPORT +kmod-mii - KCONFIG:=CONFIG_VORTEX - FILES:=$(LINUX_DIR)/drivers/net/ethernet/3com/3c59x.ko - AUTOLOAD:=$(call AutoProbe,3c59x) -endef - -define KernelPackage/3c59x/description - This option enables driver support for a large number of 10mbps and - 10/100mbps EISA, PCI and PCMCIA 3Com Ethernet adapters: - - "Vortex" (Fast EtherLink 3c590/3c592/3c595/3c597) EISA and PCI - - "Boomerang" (EtherLink XL 3c900 or 3c905) PCI - - "Cyclone" (3c540/3c900/3c905/3c980/3c575/3c656) PCI and Cardbus - - "Tornado" (3c905) PCI - - "Hurricane" (3c555/3cSOHO) PCI -endef - -$(eval $(call KernelPackage,3c59x)) - - -define KernelPackage/pcnet32 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=AMD PCnet32 PCI support - DEPENDS:=@(PCI_SUPPORT||TARGET_malta) +kmod-mii - KCONFIG:=CONFIG_PCNET32 - FILES:=$(LINUX_DIR)/drivers/net/ethernet/amd/pcnet32.ko - AUTOLOAD:=$(call AutoProbe,pcnet32) -endef - -define KernelPackage/pcnet32/description - Kernel modules for AMD PCnet32 Ethernet adapters -endef - -$(eval $(call KernelPackage,pcnet32)) - - -define KernelPackage/tg3 - TITLE:=Broadcom Tigon3 Gigabit Ethernet - KCONFIG:=CONFIG_TIGON3 \ - CONFIG_TIGON3_HWMON=n - DEPENDS:=+!TARGET_bcm47xx:kmod-libphy +kmod-ptp - SUBMENU:=$(NETWORK_DEVICES_MENU) - FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/tg3.ko - AUTOLOAD:=$(call AutoLoad,19,tg3,1) -endef - -define KernelPackage/tg3/description - Kernel modules for Broadcom Tigon3 Gigabit Ethernet adapters -endef - -$(eval $(call KernelPackage,tg3)) - - -define KernelPackage/hfcpci - TITLE:=HFC PCI cards (single port) support for mISDN - KCONFIG:=CONFIG_MISDN_HFCPCI - DEPENDS:=+kmod-misdn - SUBMENU:=$(NETWORK_DEVICES_MENU) - FILES:=$(LINUX_DIR)/drivers/isdn/hardware/mISDN/hfcpci.ko - AUTOLOAD:=$(call AutoLoad,31,hfcpci) -endef - -define KernelPackage/hfcpci/description - Kernel modules for Cologne AG's HFC pci cards (single port) - using the mISDN V2 stack -endef - -$(eval $(call KernelPackage,hfcpci)) - - -define KernelPackage/hfcmulti - TITLE:=HFC multiport cards (HFC-4S/8S/E1) support for mISDN - KCONFIG:=CONFIG_MISDN_HFCMULTI - DEPENDS:=+kmod-misdn - SUBMENU:=$(NETWORK_DEVICES_MENU) - FILES:=$(LINUX_DIR)/drivers/isdn/hardware/mISDN/hfcmulti.ko - AUTOLOAD:=$(call AutoLoad,31,hfcmulti) -endef - -define KernelPackage/hfcmulti/description - Kernel modules for Cologne AG's HFC multiport cards (HFC-4S/8S/E1) - using the mISDN V2 stack -endef - -$(eval $(call KernelPackage,hfcmulti)) - - -define KernelPackage/macvlan - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=MAC-VLAN support - KCONFIG:=CONFIG_MACVLAN - FILES:=$(LINUX_DIR)/drivers/net/macvlan.ko - AUTOLOAD:=$(call AutoProbe,macvlan) -endef - -define KernelPackage/macvlan/description - A kernel module which allows one to create virtual interfaces that - map packets to or from specific MAC addresses to a particular interface -endef - -$(eval $(call KernelPackage,macvlan)) - - -define KernelPackage/tulip - TITLE:=Tulip family network device support - DEPENDS:=@PCI_SUPPORT +kmod-mii - SUBMENU:=$(NETWORK_DEVICES_MENU) - KCONFIG:= \ - CONFIG_NET_TULIP=y \ - CONFIG_DE2104X \ - CONFIG_DE2104X_DSL=0 \ - CONFIG_TULIP \ - CONFIG_TULIP_MWI=y \ - CONFIG_TULIP_MMIO=y \ - CONFIG_TULIP_NAPI=y \ - CONFIG_TULIP_NAPI_HW_MITIGATION=y \ - CONFIG_DE4X5=n \ - CONFIG_WINBOND_840 \ - CONFIG_DM9102 \ - CONFIG_ULI526X - FILES:= \ - $(LINUX_DIR)/drivers/net/ethernet/dec/tulip/tulip.ko \ - $(LINUX_DIR)/drivers/net/ethernet/dec/tulip/de2104x.ko \ - $(LINUX_DIR)/drivers/net/ethernet/dec/tulip/dmfe.ko \ - $(LINUX_DIR)/drivers/net/ethernet/dec/tulip/uli526x.ko \ - $(LINUX_DIR)/drivers/net/ethernet/dec/tulip/winbond-840.ko - AUTOLOAD:=$(call AutoProbe,tulip) -endef - -define KernelPackage/tulip/description - Kernel modules for the Tulip family of network cards, - including DECchip Tulip, DIGITAL EtherWORKS, Winbond W89c840, - Davicom DM910x/DM980x and ULi M526x controller support. -endef - -$(eval $(call KernelPackage,tulip)) - - -define KernelPackage/solos-pci - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Solos ADSL2+ multiport modem - DEPENDS:=@PCI_SUPPORT +kmod-atm - KCONFIG:=CONFIG_ATM_SOLOS - FILES:=$(LINUX_DIR)/drivers/atm/solos-pci.ko - AUTOLOAD:=$(call AutoProbe,solos-pci) -endef - -define KernelPackage/solos-pci/description - Kernel module for Traverse Technologies' Solos PCI cards - and Geos ADSL2+ x86 motherboard -endef - -$(eval $(call KernelPackage,solos-pci)) - - -define KernelPackage/dummy - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Dummy network device - KCONFIG:=CONFIG_DUMMY - FILES:=$(LINUX_DIR)/drivers/net/dummy.ko - AUTOLOAD:=$(call AutoLoad,34,dummy) -endef - -define KernelPackage/dummy/description - The dummy network device -endef - -$(eval $(call KernelPackage,dummy)) - - -define KernelPackage/ifb - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intermediate Functional Block support - KCONFIG:= \ - CONFIG_IFB \ - CONFIG_NET_CLS=y - FILES:=$(LINUX_DIR)/drivers/net/ifb.ko - AUTOLOAD:=$(call AutoLoad,34,ifb) - MODPARAMS.ifb:=numifbs=0 -endef - -define KernelPackage/ifb/description - The Intermediate Functional Block -endef - -$(eval $(call KernelPackage,ifb)) - - -define KernelPackage/dm9000 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Davicom 9000 Ethernet support - DEPENDS:=+kmod-mii - KCONFIG:=CONFIG_DM9000 \ - CONFIG_DM9000_DEBUGLEVEL=4 \ - CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y - FILES:=$(LINUX_DIR)/drivers/net/ethernet/davicom/dm9000.ko - AUTOLOAD:=$(call AutoLoad,34,dm9000) -endef - -define KernelPackage/dm9000/description - Kernel driver for Davicom 9000 Ethernet adapters. -endef - -$(eval $(call KernelPackage,dm9000)) - - -define KernelPackage/forcedeth - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=nForce Ethernet support - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_FORCEDETH - FILES:=$(LINUX_DIR)/drivers/net/ethernet/nvidia/forcedeth.ko - AUTOLOAD:=$(call AutoProbe,forcedeth) -endef - -define KernelPackage/forcedeth/description - Kernel driver for Nvidia Ethernet support -endef - -$(eval $(call KernelPackage,forcedeth)) - -define KernelPackage/of-mdio - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=OpenFirmware MDIO support - DEPENDS:=+kmod-libphy - KCONFIG:=CONFIG_OF_MDIO - FILES:= \ - $(LINUX_DIR)/drivers/net/phy/fixed_phy.ko \ - $(LINUX_DIR)/drivers/of/of_mdio.ko - AUTOLOAD:=$(call AutoLoad,41,of_mdio) -endef - -define KernelPackage/of-mdio/description - Kernel driver for OpenFirmware MDIO support -endef - -$(eval $(call KernelPackage,of-mdio)) - - -define KernelPackage/vmxnet3 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=VMware VMXNET3 ethernet driver - DEPENDS:=@PCI_SUPPORT - KCONFIG:=CONFIG_VMXNET3 - FILES:=$(LINUX_DIR)/drivers/net/vmxnet3/vmxnet3.ko - AUTOLOAD:=$(call AutoLoad,35,vmxnet3) -endef - -define KernelPackage/vmxnet3/description - Kernel modules for VMware VMXNET3 ethernet adapters. -endef - -$(eval $(call KernelPackage,vmxnet3)) - - -define KernelPackage/spi-ks8995 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Micrel/Kendin KS8995 Ethernet switch control - FILES:=$(LINUX_DIR)/drivers/net/phy/spi_ks8995.ko - KCONFIG:=CONFIG_MICREL_KS8995MA \ - CONFIG_SPI=y \ - CONFIG_SPI_MASTER=y - AUTOLOAD:=$(call AutoLoad,50,spi_ks8995) -endef - -define KernelPackage/spi-ks8995/description - Kernel module for Micrel/Kendin KS8995 ethernet switch -endef - -$(eval $(call KernelPackage,spi-ks8995)) - - -define KernelPackage/ethoc - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Opencore.org ethoc driver - DEPENDS:=+kmod-libphy - FILES:=$(LINUX_DIR)/drivers/net/ethernet/ethoc.ko - KCONFIG:=CONFIG_ETHOC - AUTOLOAD:=$(call AutoProbe,ethoc) -endef - -define KernelPackage/ethoc/description - Kernel module for the Opencores.org ethernet adapter -endef - -$(eval $(call KernelPackage,ethoc)) - - -define KernelPackage/bnx2 - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=BCM5706/5708/5709/5716 ethernet adapter driver - DEPENDS:=@PCI_SUPPORT +bnx2-firmware - FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/bnx2.ko - KCONFIG:=CONFIG_BNX2 - AUTOLOAD:=$(call AutoProbe,bnx2) -endef - -define KernelPackage/bnx2/description - Kernel module for the BCM5706/5708/5709/5716 ethernet adapter -endef - -$(eval $(call KernelPackage,bnx2)) - - -define KernelPackage/bnx2x - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=QLogic 5771x/578xx 10/20-Gigabit ethernet adapter driver - DEPENDS:=@PCI_SUPPORT +bnx2x-firmware +kmod-lib-crc32c +kmod-mdio +kmod-ptp +kmod-lib-zlib-inflate - FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/bnx2x/bnx2x.ko - KCONFIG:= \ - CONFIG_BNX2X \ - CONFIG_BNX2X_SRIOV=y - AUTOLOAD:=$(call AutoProbe,bnx2x) -endef - -define KernelPackage/bnx2x/description - QLogic BCM57710/57711/57711E/57712/57712_MF/57800/57800_MF/57810/57810_MF/57840/57840_MF Driver -endef - -$(eval $(call KernelPackage,bnx2x)) - -define KernelPackage/be2net - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Broadcom Emulex OneConnect 10Gbps NIC - DEPENDS:=@PCI_SUPPORT +kmod-hwmon-core - FILES:=$(LINUX_DIR)/drivers/net/ethernet/emulex/benet/be2net.ko - KCONFIG:= \ - CONFIG_BE2NET \ - CONFIG_BE2NET_BE2=y \ - CONFIG_BE2NET_BE3=y \ - CONFIG_BE2NET_LANCER=y \ - CONFIG_BE2NET_SKYHAWK=y \ - CONFIG_BE2NET_HWMON=y - AUTOLOAD:=$(call AutoProbe,be2net) -endef - -define KernelPackage/be2net/description - Broadcom Emulex OneConnect 10Gbit SFP+ support, OneConnect OCe10xxx OCe11xxx OCe14xxx, LightPulse LPe12xxx -endef - -$(eval $(call KernelPackage,be2net)) - -define KernelPackage/mlx4-core - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Mellanox ConnectX(R) mlx4 core Network Driver - DEPENDS:=@PCI_SUPPORT +kmod-ptp - FILES:= \ - $(LINUX_DIR)/drivers/net/ethernet/mellanox/mlx4/mlx4_core.ko \ - $(LINUX_DIR)/drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko - KCONFIG:= CONFIG_MLX4_EN \ - CONFIG_MLX4_EN_DCB=n \ - CONFIG_MLX4_CORE=y \ - CONFIG_MLX4_CORE_GEN2=y \ - CONFIG_MLX4_DEBUG=n - AUTOLOAD:=$(call AutoProbe,mlx4_core mlx4_en) -endef - -define KernelPackage/mlx4-core/description - Supports Mellanox ConnectX-3 series and previous cards -endef - -$(eval $(call KernelPackage,mlx4-core)) - -define KernelPackage/mlx5-core - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Mellanox ConnectX(R) mlx5 core Network Driver - DEPENDS:=@PCI_SUPPORT +kmod-ptp - FILES:=$(LINUX_DIR)/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko - KCONFIG:= CONFIG_MLX5_CORE \ - CONFIG_MLX5_CORE_EN=y \ - CONFIG_MLX5_CORE_EN_DCB=n \ - CONFIG_MLX5_CORE_IPOIB=n \ - CONFIG_MLX5_EN_ARFS=n \ - CONFIG_MLX5_EN_IPSEC=n \ - CONFIG_MLX5_EN_RXNFC=y \ - CONFIG_MLX5_EN_TLS=n \ - CONFIG_MLX5_ESWITCH=n \ - CONFIG_MLX5_FPGA=n \ - CONFIG_MLX5_FPGA_IPSEC=n \ - CONFIG_MLX5_FPGA_TLS=n \ - CONFIG_MLX5_MPFS=y \ - CONFIG_MLX5_SW_STEERING=n \ - CONFIG_MLX5_TC_CT=n \ - CONFIG_MLX5_TLS=n - AUTOLOAD:=$(call AutoProbe,mlx5_core) -endef - -define KernelPackage/mlx5-core/description - Supports Mellanox Connect-IB/ConnectX-4 series and later cards -endef - -$(eval $(call KernelPackage,mlx5-core)) - - -define KernelPackage/sfp - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=SFP cage support - DEPENDS:=+kmod-i2c-core +kmod-hwmon-core +kmod-phylink - KCONFIG:= \ - CONFIG_SFP \ - CONFIG_MDIO_I2C - FILES:= \ - $(LINUX_DIR)/drivers/net/phy/sfp.ko \ - $(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko - AUTOLOAD:=$(call AutoProbe,mdio-i2c sfp) -endef - -define KernelPackage/sfp/description - Kernel module to support SFP cages -endef - -$(eval $(call KernelPackage,sfp)) - -define KernelPackage/igc - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Intel(R) Ethernet Controller I225 Series support - DEPENDS:=@PCI_SUPPORT +kmod-ptp - KCONFIG:=CONFIG_IGC - FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/igc/igc.ko - AUTOLOAD:=$(call AutoProbe,igc) -endef - -define KernelPackage/igc/description - Kernel modules for Intel(R) Ethernet Controller I225 Series -endef - -$(eval $(call KernelPackage,igc)) - -define KernelPackage/sfc - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Solarflare SFC9000/SFC9100/EF100-family support - DEPENDS:=@PCI_SUPPORT +kmod-mdio +kmod-lib-crc32c +kmod-ptp +kmod-hwmon-core - KCONFIG:= \ - CONFIG_SFC \ - CONFIG_SFC_MTD=y \ - CONFIG_SFC_MCDI_MON=y \ - CONFIG_SFC_MCDI_LOGGING=y \ - CONFIG_SFC_SRIOV=y - FILES:=$(LINUX_DIR)/drivers/net/ethernet/sfc/sfc.ko - AUTOLOAD:=$(call AutoProbe,sfc) -endef - -define KernelPackage/sfc/description - Solarflare SFC9000/SFC9100/EF100-family support - Solarflare EF100 support requires at least kernel version 5.9 -endef - -$(eval $(call KernelPackage,sfc)) - -define KernelPackage/sfc-falcon - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Solarflare SFC4000 support - DEPENDS:=@PCI_SUPPORT +kmod-mdio +kmod-lib-crc32c +kmod-i2c-algo-bit - KCONFIG:= \ - CONFIG_SFC_FALCON \ - CONFIG_SFC_FALCON_MTD=y - FILES:=$(LINUX_DIR)/drivers/net/ethernet/sfc/falcon/sfc-falcon.ko - AUTOLOAD:=$(call AutoProbe,sfc-falcon) -endef - -define KernelPackage/sfc-falcon/description - Solarflare SFC4000 support -endef - -$(eval $(call KernelPackage,sfc-falcon)) diff --git a/feeds/ipq807x/linux/modules/netfilter.mk b/feeds/ipq807x/linux/modules/netfilter.mk deleted file mode 100644 index 97102524d..000000000 --- a/feeds/ipq807x/linux/modules/netfilter.mk +++ /dev/null @@ -1,1182 +0,0 @@ - -# -# Copyright (C) 2006-2010 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -NF_MENU:=Netfilter Extensions -NF_KMOD:=1 -include $(INCLUDE_DIR)/netfilter-4.4.mk - - -define KernelPackage/nf-reject - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter IPv4 reject support - KCONFIG:= \ - CONFIG_NETFILTER=y \ - CONFIG_NETFILTER_ADVANCED=y \ - $(KCONFIG_NF_REJECT) - FILES:=$(foreach mod,$(NF_REJECT-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_REJECT-m))) -endef - -$(eval $(call KernelPackage,nf-reject)) - - -define KernelPackage/nf-reject6 - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter IPv6 reject support - KCONFIG:= \ - CONFIG_NETFILTER=y \ - CONFIG_NETFILTER_ADVANCED=y \ - $(KCONFIG_NF_REJECT6) - DEPENDS:=@IPV6 - FILES:=$(foreach mod,$(NF_REJECT6-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_REJECT6-m))) -endef - -$(eval $(call KernelPackage,nf-reject6)) - - -define KernelPackage/nf-ipt - SUBMENU:=$(NF_MENU) - TITLE:=Iptables core - KCONFIG:=$(KCONFIG_NF_IPT) - FILES:=$(foreach mod,$(NF_IPT-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_IPT-m))) -endef - -$(eval $(call KernelPackage,nf-ipt)) - - -define KernelPackage/nf-ipt6 - SUBMENU:=$(NF_MENU) - TITLE:=Ip6tables core - KCONFIG:=$(KCONFIG_NF_IPT6) - FILES:=$(foreach mod,$(NF_IPT6-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_IPT6-m))) - DEPENDS:=+kmod-nf-ipt -endef - -$(eval $(call KernelPackage,nf-ipt6)) - - - -define KernelPackage/ipt-core - SUBMENU:=$(NF_MENU) - TITLE:=Iptables core - KCONFIG:=$(KCONFIG_IPT_CORE) - FILES:=$(foreach mod,$(IPT_CORE-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CORE-m))) - DEPENDS:=+kmod-nf-reject +kmod-nf-ipt -endef - -define KernelPackage/ipt-core/description - Netfilter core kernel modules - Includes: - - comment - - limit - - LOG - - mac - - multiport - - REJECT - - TCPMSS -endef - -$(eval $(call KernelPackage,ipt-core)) - - -define KernelPackage/nf-conntrack - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter connection tracking - KCONFIG:= \ - CONFIG_NETFILTER=y \ - CONFIG_NETFILTER_ADVANCED=y \ - CONFIG_NF_CONNTRACK_MARK=y \ - CONFIG_NF_CONNTRACK_ZONES=y \ - $(KCONFIG_NF_CONNTRACK) - FILES:=$(foreach mod,$(NF_CONNTRACK-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_CONNTRACK-m))) -endef - -define KernelPackage/nf-conntrack/install - $(INSTALL_DIR) $(1)/etc/sysctl.d - $(INSTALL_DATA) ./files/sysctl-nf-conntrack.conf $(1)/etc/sysctl.d/11-nf-conntrack.conf -endef - -$(eval $(call KernelPackage,nf-conntrack)) - - -define KernelPackage/nf-conntrack6 - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter IPv6 connection tracking - KCONFIG:=$(KCONFIG_NF_CONNTRACK6) - DEPENDS:=@IPV6 +kmod-nf-conntrack - FILES:=$(foreach mod,$(NF_CONNTRACK6-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_CONNTRACK6-m))) -endef - -$(eval $(call KernelPackage,nf-conntrack6)) - - -define KernelPackage/nf-nat - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter NAT - KCONFIG:=$(KCONFIG_NF_NAT) - DEPENDS:=+kmod-nf-conntrack - FILES:=$(foreach mod,$(NF_NAT-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_NAT-m))) -endef - -$(eval $(call KernelPackage,nf-nat)) - - -define KernelPackage/nf-nat6 - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter IPV6-NAT - KCONFIG:=$(KCONFIG_NF_NAT6) - DEPENDS:=@IPV6 +kmod-nf-conntrack6 +kmod-nf-nat - FILES:=$(foreach mod,$(NF_NAT6-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_NAT6-m))) -endef - -$(eval $(call KernelPackage,nf-nat6)) - - -define KernelPackage/nf-flow - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter flowtable support - KCONFIG:= \ - CONFIG_NETFILTER_INGRESS=y \ - CONFIG_NF_FLOW_TABLE \ - CONFIG_NF_FLOW_TABLE_HW - DEPENDS:=+kmod-nf-conntrack - FILES:= \ - $(LINUX_DIR)/net/netfilter/nf_flow_table.ko \ - $(if $(CONFIG_LINUX_5_4),$(LINUX_DIR)/net/netfilter/nf_flow_table_hw.ko) - AUTOLOAD:=$(call AutoProbe,nf_flow_table nf_flow_table_hw) -endef - -$(eval $(call KernelPackage,nf-flow)) - - -define AddDepends/ipt - SUBMENU:=$(NF_MENU) - DEPENDS+= +kmod-ipt-core $(1) -endef - - -define KernelPackage/ipt-conntrack - TITLE:=Basic connection tracking modules - KCONFIG:=$(KCONFIG_IPT_CONNTRACK) - FILES:=$(foreach mod,$(IPT_CONNTRACK-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CONNTRACK-m))) - $(call AddDepends/ipt,+kmod-nf-conntrack) -endef - -define KernelPackage/ipt-conntrack/description - Netfilter (IPv4) kernel modules for connection tracking - Includes: - - conntrack - - defrag - - iptables_raw - - NOTRACK - - state -endef - -$(eval $(call KernelPackage,ipt-conntrack)) - - -define KernelPackage/ipt-conntrack-extra - TITLE:=Extra connection tracking modules - KCONFIG:=$(KCONFIG_IPT_CONNTRACK_EXTRA) - FILES:=$(foreach mod,$(IPT_CONNTRACK_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CONNTRACK_EXTRA-m))) - $(call AddDepends/ipt,+kmod-ipt-conntrack) -endef - -define KernelPackage/ipt-conntrack-extra/description - Netfilter (IPv4) extra kernel modules for connection tracking - Includes: - - connbytes - - connmark/CONNMARK - - conntrack - - helper - - recent -endef - -$(eval $(call KernelPackage,ipt-conntrack-extra)) - -define KernelPackage/ipt-conntrack-label - TITLE:=Module for handling connection tracking labels - KCONFIG:=$(KCONFIG_IPT_CONNTRACK_LABEL) - FILES:=$(foreach mod,$(IPT_CONNTRACK_LABEL-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CONNTRACK_LABEL-m))) - $(call AddDepends/ipt,+kmod-ipt-conntrack) -endef - -define KernelPackage/ipt-conntrack-label/description - Netfilter (IPv4) module for handling connection tracking labels - Includes: - - connlabel -endef - -$(eval $(call KernelPackage,ipt-conntrack-label)) - -define KernelPackage/ipt-filter - TITLE:=Modules for packet content inspection - KCONFIG:=$(KCONFIG_IPT_FILTER) - FILES:=$(foreach mod,$(IPT_FILTER-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_FILTER-m))) - $(call AddDepends/ipt,+kmod-lib-textsearch +kmod-ipt-conntrack) -endef - -define KernelPackage/ipt-filter/description - Netfilter (IPv4) kernel modules for packet content inspection - Includes: - - string - - bpf -endef - -$(eval $(call KernelPackage,ipt-filter)) - - -define KernelPackage/ipt-offload - TITLE:=Netfilter routing/NAT offload support - KCONFIG:=$(KCONFIG_IPT_FLOW) - FILES:=$(foreach mod,$(IPT_FLOW-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_FLOW-m))) - $(call AddDepends/ipt,+kmod-nf-flow) -endef - -$(eval $(call KernelPackage,ipt-offload)) - - -define KernelPackage/ipt-ipopt - TITLE:=Modules for matching/changing IP packet options - KCONFIG:=$(KCONFIG_IPT_IPOPT) - FILES:=$(foreach mod,$(IPT_IPOPT-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_IPOPT-m))) - $(call AddDepends/ipt,+kmod-nf-conntrack) -endef - -define KernelPackage/ipt-ipopt/description - Netfilter (IPv4) modules for matching/changing IP packet options - Includes: - - CLASSIFY - - dscp/DSCP - - ecn/ECN - - hl/HL - - length - - mark/MARK - - statistic - - tcpmss - - time - - ttl/TTL - - unclean -endef - -$(eval $(call KernelPackage,ipt-ipopt)) - - -define KernelPackage/ipt-ipsec - TITLE:=Modules for matching IPSec packets - KCONFIG:=$(KCONFIG_IPT_IPSEC) - FILES:=$(foreach mod,$(IPT_IPSEC-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_IPSEC-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-ipsec/description - Netfilter (IPv4) modules for matching IPSec packets - Includes: - - ah - - esp - - policy -endef - -$(eval $(call KernelPackage,ipt-ipsec)) - -IPSET_MODULES:= \ - ipset/ip_set \ - ipset/ip_set_bitmap_ip \ - ipset/ip_set_bitmap_ipmac \ - ipset/ip_set_bitmap_port \ - ipset/ip_set_hash_ip \ - ipset/ip_set_hash_ipmark \ - ipset/ip_set_hash_ipport \ - ipset/ip_set_hash_ipportip \ - ipset/ip_set_hash_ipportnet \ - ipset/ip_set_hash_mac \ - ipset/ip_set_hash_netportnet \ - ipset/ip_set_hash_net \ - ipset/ip_set_hash_netnet \ - ipset/ip_set_hash_netport \ - ipset/ip_set_hash_netiface \ - ipset/ip_set_list_set \ - xt_set - -define KernelPackage/ipt-ipset - SUBMENU:=Netfilter Extensions - TITLE:=IPset netfilter modules - DEPENDS+= +kmod-ipt-core +kmod-nfnetlink - KCONFIG:= \ - CONFIG_IP_SET \ - CONFIG_IP_SET_MAX=256 \ - CONFIG_NETFILTER_XT_SET \ - CONFIG_IP_SET_BITMAP_IP \ - CONFIG_IP_SET_BITMAP_IPMAC \ - CONFIG_IP_SET_BITMAP_PORT \ - CONFIG_IP_SET_HASH_IP \ - CONFIG_IP_SET_HASH_IPMAC \ - CONFIG_IP_SET_HASH_IPMARK \ - CONFIG_IP_SET_HASH_IPPORT \ - CONFIG_IP_SET_HASH_IPPORTIP \ - CONFIG_IP_SET_HASH_IPPORTNET \ - CONFIG_IP_SET_HASH_MAC \ - CONFIG_IP_SET_HASH_NET \ - CONFIG_IP_SET_HASH_NETNET \ - CONFIG_IP_SET_HASH_NETIFACE \ - CONFIG_IP_SET_HASH_NETPORT \ - CONFIG_IP_SET_HASH_NETPORTNET \ - CONFIG_IP_SET_LIST_SET \ - CONFIG_NET_EMATCH_IPSET=n - FILES:=$(foreach mod,$(IPSET_MODULES),$(LINUX_DIR)/net/netfilter/$(mod).ko) - AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPSET_MODULES))) -endef -$(eval $(call KernelPackage,ipt-ipset)) - - -IPVS_MODULES:= \ - ipvs/ip_vs \ - ipvs/ip_vs_lc \ - ipvs/ip_vs_wlc \ - ipvs/ip_vs_rr \ - ipvs/ip_vs_wrr \ - ipvs/ip_vs_lblc \ - ipvs/ip_vs_lblcr \ - ipvs/ip_vs_dh \ - ipvs/ip_vs_sh \ - ipvs/ip_vs_fo \ - ipvs/ip_vs_ovf \ - ipvs/ip_vs_nq \ - ipvs/ip_vs_sed \ - xt_ipvs - -define KernelPackage/nf-ipvs - SUBMENU:=Netfilter Extensions - TITLE:=IP Virtual Server modules - DEPENDS:=@IPV6 +kmod-lib-crc32c +kmod-ipt-conntrack +kmod-nf-conntrack +LINUX_4_14:kmod-nf-conntrack6 - KCONFIG:= \ - CONFIG_IP_VS \ - CONFIG_IP_VS_IPV6=y \ - CONFIG_IP_VS_DEBUG=n \ - CONFIG_IP_VS_PROTO_TCP=y \ - CONFIG_IP_VS_PROTO_UDP=y \ - CONFIG_IP_VS_PROTO_AH_ESP=y \ - CONFIG_IP_VS_PROTO_ESP=y \ - CONFIG_IP_VS_PROTO_AH=y \ - CONFIG_IP_VS_PROTO_SCTP=y \ - CONFIG_IP_VS_TAB_BITS=12 \ - CONFIG_IP_VS_RR \ - CONFIG_IP_VS_WRR \ - CONFIG_IP_VS_LC \ - CONFIG_IP_VS_WLC \ - CONFIG_IP_VS_FO \ - CONFIG_IP_VS_OVF \ - CONFIG_IP_VS_LBLC \ - CONFIG_IP_VS_LBLCR \ - CONFIG_IP_VS_DH \ - CONFIG_IP_VS_SH \ - CONFIG_IP_VS_SED \ - CONFIG_IP_VS_NQ \ - CONFIG_IP_VS_SH_TAB_BITS=8 \ - CONFIG_IP_VS_NFCT=y \ - CONFIG_NETFILTER_XT_MATCH_IPVS - FILES:=$(foreach mod,$(IPVS_MODULES),$(LINUX_DIR)/net/netfilter/$(mod).ko) - $(call AddDepends/ipt,+kmod-ipt-conntrack,+kmod-nf-conntrack) -endef - -define KernelPackage/nf-ipvs/description - IPVS (IP Virtual Server) implements transport-layer load balancing inside - the Linux kernel so called Layer-4 switching. -endef - -$(eval $(call KernelPackage,nf-ipvs)) - - -define KernelPackage/nf-ipvs-ftp - SUBMENU:=$(NF_MENU) - TITLE:=Virtual Server FTP protocol support - KCONFIG:=CONFIG_IP_VS_FTP - DEPENDS:=kmod-nf-ipvs +kmod-nf-nat +kmod-nf-nathelper - FILES:=$(LINUX_DIR)/net/netfilter/ipvs/ip_vs_ftp.ko -endef - -define KernelPackage/nf-ipvs-ftp/description - In the virtual server via Network Address Translation, - the IP address and port number of real servers cannot be sent to - clients in ftp connections directly, so FTP protocol helper is - required for tracking the connection and mangling it back to that of - virtual service. -endef - -$(eval $(call KernelPackage,nf-ipvs-ftp)) - - -define KernelPackage/nf-ipvs-sip - SUBMENU:=$(NF_MENU) - TITLE:=Virtual Server SIP protocol support - KCONFIG:=CONFIG_IP_VS_PE_SIP - DEPENDS:=kmod-nf-ipvs +kmod-nf-nathelper-extra - FILES:=$(LINUX_DIR)/net/netfilter/ipvs/ip_vs_pe_sip.ko -endef - -define KernelPackage/nf-ipvs-sip/description - Allow persistence based on the SIP Call-ID -endef - -$(eval $(call KernelPackage,nf-ipvs-sip)) - - -define KernelPackage/ipt-nat - TITLE:=Basic NAT targets - KCONFIG:=$(KCONFIG_IPT_NAT) - FILES:=$(foreach mod,$(IPT_NAT-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_NAT-m))) - $(call AddDepends/ipt,+kmod-nf-nat) -endef - -define KernelPackage/ipt-nat/description - Netfilter (IPv4) kernel modules for basic NAT targets - Includes: - - MASQUERADE -endef - -$(eval $(call KernelPackage,ipt-nat)) - - -define KernelPackage/ipt-raw - TITLE:=Netfilter IPv4 raw table support - KCONFIG:=CONFIG_IP_NF_RAW - FILES:=$(LINUX_DIR)/net/ipv4/netfilter/iptable_raw.ko - AUTOLOAD:=$(call AutoProbe,iptable_raw) - $(call AddDepends/ipt) -endef - -$(eval $(call KernelPackage,ipt-raw)) - - -define KernelPackage/ipt-raw6 - TITLE:=Netfilter IPv6 raw table support - DEPENDS:=@IPV6 - KCONFIG:=CONFIG_IP6_NF_RAW - FILES:=$(LINUX_DIR)/net/ipv6/netfilter/ip6table_raw.ko - AUTOLOAD:=$(call AutoProbe,ip6table_raw) - $(call AddDepends/ipt,+kmod-ip6tables) -endef - -$(eval $(call KernelPackage,ipt-raw6)) - - -define KernelPackage/ipt-nat6 - TITLE:=IPv6 NAT targets - DEPENDS:=@IPV6 - KCONFIG:=$(KCONFIG_IPT_NAT6) - FILES:=$(foreach mod,$(IPT_NAT6-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT6-m))) - $(call AddDepends/ipt,+kmod-nf-nat6) - $(call AddDepends/ipt,+kmod-ipt-conntrack) - $(call AddDepends/ipt,+kmod-ipt-nat) - $(call AddDepends/ipt,+kmod-ip6tables) -endef - -define KernelPackage/ipt-nat6/description - Netfilter (IPv6) kernel modules for NAT targets -endef - -$(eval $(call KernelPackage,ipt-nat6)) - - -define KernelPackage/ipt-nat-extra - TITLE:=Extra NAT targets - KCONFIG:=$(KCONFIG_IPT_NAT_EXTRA) - FILES:=$(foreach mod,$(IPT_NAT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_NAT_EXTRA-m))) - $(call AddDepends/ipt,+kmod-ipt-nat) -endef - -define KernelPackage/ipt-nat-extra/description - Netfilter (IPv4) kernel modules for extra NAT targets - Includes: - - NETMAP - - REDIRECT -endef - -$(eval $(call KernelPackage,ipt-nat-extra)) - - -define KernelPackage/nf-nathelper - SUBMENU:=$(NF_MENU) - TITLE:=Basic Conntrack and NAT helpers - KCONFIG:=$(KCONFIG_NF_NATHELPER) - FILES:=$(foreach mod,$(NF_NATHELPER-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_NATHELPER-m))) - DEPENDS:=+kmod-nf-nat -endef - -define KernelPackage/nf-nathelper/description - Default Netfilter (IPv4) Conntrack and NAT helpers - Includes: - - ftp -endef - -$(eval $(call KernelPackage,nf-nathelper)) - - -define KernelPackage/nf-nathelper-extra - SUBMENU:=$(NF_MENU) - TITLE:=Extra Conntrack and NAT helpers - KCONFIG:=$(KCONFIG_NF_NATHELPER_EXTRA) - FILES:=$(foreach mod,$(NF_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_NATHELPER_EXTRA-m))) - DEPENDS:=+kmod-nf-nat +kmod-lib-textsearch +kmod-ipt-raw +!LINUX_4_14:kmod-asn1-decoder -endef - -define KernelPackage/nf-nathelper-extra/description - Extra Netfilter (IPv4) Conntrack and NAT helpers - Includes: - - amanda - - h323 - - irc - - mms - - pptp - - proto_gre - - sip - - snmp_basic - - tftp - - broadcast -endef - -$(eval $(call KernelPackage,nf-nathelper-extra)) - - -define KernelPackage/ipt-ulog - TITLE:=Module for user-space packet logging - KCONFIG:=$(KCONFIG_IPT_ULOG) - FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_ULOG-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-ulog/description - Netfilter (IPv4) module for user-space packet logging - Includes: - - ULOG -endef - -$(eval $(call KernelPackage,ipt-ulog)) - - -define KernelPackage/ipt-nflog - TITLE:=Module for user-space packet logging - KCONFIG:=$(KCONFIG_IPT_NFLOG) - FILES:=$(foreach mod,$(IPT_NFLOG-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_NFLOG-m))) - $(call AddDepends/ipt,+kmod-nfnetlink-log) -endef - -define KernelPackage/ipt-nflog/description - Netfilter module for user-space packet logging - Includes: - - NFLOG -endef - -$(eval $(call KernelPackage,ipt-nflog)) - - -define KernelPackage/ipt-nfqueue - TITLE:=Module for user-space packet queuing - KCONFIG:=$(KCONFIG_IPT_NFQUEUE) - FILES:=$(foreach mod,$(IPT_NFQUEUE-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_NFQUEUE-m))) - $(call AddDepends/ipt,+kmod-nfnetlink-queue) -endef - -define KernelPackage/ipt-nfqueue/description - Netfilter module for user-space packet queuing - Includes: - - NFQUEUE -endef - -$(eval $(call KernelPackage,ipt-nfqueue)) - - -define KernelPackage/ipt-debug - TITLE:=Module for debugging/development - KCONFIG:=$(KCONFIG_IPT_DEBUG) - FILES:=$(foreach mod,$(IPT_DEBUG-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_DEBUG-m))) - $(call AddDepends/ipt,+kmod-ipt-raw +IPV6:kmod-ipt-raw6) -endef - -define KernelPackage/ipt-debug/description - Netfilter modules for debugging/development of the firewall - Includes: - - TRACE -endef - -$(eval $(call KernelPackage,ipt-debug)) - - -define KernelPackage/ipt-led - TITLE:=Module to trigger a LED with a Netfilter rule - KCONFIG:=$(KCONFIG_IPT_LED) - FILES:=$(foreach mod,$(IPT_LED-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_LED-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-led/description - Netfilter target to trigger a LED when a network packet is matched. -endef - -$(eval $(call KernelPackage,ipt-led)) - -define KernelPackage/ipt-tproxy - TITLE:=Transparent proxying support - DEPENDS+=+kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +IPV6:kmod-ip6tables - KCONFIG:=$(KCONFIG_IPT_TPROXY) - FILES:=$(foreach mod,$(IPT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_TPROXY-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-tproxy/description - Kernel modules for Transparent Proxying -endef - -$(eval $(call KernelPackage,ipt-tproxy)) - -define KernelPackage/ipt-tee - TITLE:=TEE support - DEPENDS:=+kmod-ipt-conntrack - KCONFIG:=$(KCONFIG_IPT_TEE) - FILES:=$(foreach mod,$(IPT_TEE-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir nf_tee $(IPT_TEE-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-tee/description - Kernel modules for TEE -endef - -$(eval $(call KernelPackage,ipt-tee)) - - -define KernelPackage/ipt-u32 - TITLE:=U32 support - KCONFIG:=$(KCONFIG_IPT_U32) - FILES:=$(foreach mod,$(IPT_U32-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir nf_tee $(IPT_U32-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-u32/description - Kernel modules for U32 -endef - -$(eval $(call KernelPackage,ipt-u32)) - -define KernelPackage/ipt-checksum - TITLE:=CHECKSUM support - KCONFIG:=$(KCONFIG_IPT_CHECKSUM) - FILES:=$(foreach mod,$(IPT_CHECKSUM-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CHECKSUM-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-checksum/description - Kernel modules for CHECKSUM fillin target -endef - -$(eval $(call KernelPackage,ipt-checksum)) - - -define KernelPackage/ipt-iprange - TITLE:=Module for matching ip ranges - KCONFIG:=$(KCONFIG_IPT_IPRANGE) - FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_IPRANGE-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-iprange/description - Netfilter (IPv4) module for matching ip ranges - Includes: - - iprange -endef - -$(eval $(call KernelPackage,ipt-iprange)) - -define KernelPackage/ipt-cluster - TITLE:=Module for matching cluster - KCONFIG:=$(KCONFIG_IPT_CLUSTER) - FILES:=$(foreach mod,$(IPT_CLUSTER-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CLUSTER-m))) - $(call AddDepends/ipt,+kmod-nf-conntrack) -endef - -define KernelPackage/ipt-cluster/description - Netfilter (IPv4/IPv6) module for matching cluster - This option allows you to build work-load-sharing clusters of - network servers/stateful firewalls without having a dedicated - load-balancing router/server/switch. Basically, this match returns - true when the packet must be handled by this cluster node. Thus, - all nodes see all packets and this match decides which node handles - what packets. The work-load sharing algorithm is based on source - address hashing. - - This module is usable for ipv4 and ipv6. - - To use it also enable iptables-mod-cluster - - see `iptables -m cluster --help` for more information. -endef - -$(eval $(call KernelPackage,ipt-cluster)) - -define KernelPackage/ipt-clusterip - TITLE:=Module for CLUSTERIP - KCONFIG:=$(KCONFIG_IPT_CLUSTERIP) - FILES:=$(foreach mod,$(IPT_CLUSTERIP-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CLUSTERIP-m))) - $(call AddDepends/ipt,+kmod-nf-conntrack) -endef - -define KernelPackage/ipt-clusterip/description - Netfilter (IPv4-only) module for CLUSTERIP - The CLUSTERIP target allows you to build load-balancing clusters of - network servers without having a dedicated load-balancing - router/server/switch. - - To use it also enable iptables-mod-clusterip - - see `iptables -j CLUSTERIP --help` for more information. -endef - -$(eval $(call KernelPackage,ipt-clusterip)) - - -define KernelPackage/ipt-extra - TITLE:=Extra modules - KCONFIG:=$(KCONFIG_IPT_EXTRA) - FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_EXTRA-m))) - $(call AddDepends/ipt) -endef - -define KernelPackage/ipt-extra/description - Other Netfilter (IPv4) kernel modules - Includes: - - addrtype - - owner - - pkttype - - quota -endef - -$(eval $(call KernelPackage,ipt-extra)) - - -define KernelPackage/ipt-physdev - TITLE:=physdev module - KCONFIG:=$(KCONFIG_IPT_PHYSDEV) - FILES:=$(foreach mod,$(IPT_PHYSDEV-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_PHYSDEV-m))) - $(call AddDepends/ipt,+kmod-br-netfilter) -endef - -define KernelPackage/ipt-physdev/description - The iptables physdev kernel module -endef - -$(eval $(call KernelPackage,ipt-physdev)) - - -define KernelPackage/ip6tables - SUBMENU:=$(NF_MENU) - TITLE:=IPv6 modules - DEPENDS:=@IPV6 +kmod-nf-reject6 +kmod-nf-ipt6 +kmod-ipt-core - KCONFIG:=$(KCONFIG_IPT_IPV6) - FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_IPV6-m))) -endef - -define KernelPackage/ip6tables/description - Netfilter IPv6 firewalling support -endef - -$(eval $(call KernelPackage,ip6tables)) - -define KernelPackage/ip6tables-extra - SUBMENU:=$(NF_MENU) - TITLE:=Extra IPv6 modules - DEPENDS:=@IPV6 +kmod-ip6tables - KCONFIG:=$(KCONFIG_IPT_IPV6_EXTRA) - FILES:=$(foreach mod,$(IPT_IPV6_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_IPV6_EXTRA-m))) -endef - -define KernelPackage/ip6tables-extra/description - Netfilter IPv6 extra header matching modules -endef - -$(eval $(call KernelPackage,ip6tables-extra)) - -ARP_MODULES = arp_tables arpt_mangle arptable_filter -define KernelPackage/arptables - SUBMENU:=$(NF_MENU) - TITLE:=ARP firewalling modules - DEPENDS:=+kmod-ipt-core - FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.ko - KCONFIG:=CONFIG_IP_NF_ARPTABLES \ - CONFIG_IP_NF_ARPFILTER \ - CONFIG_IP_NF_ARP_MANGLE - AUTOLOAD:=$(call AutoProbe,$(ARP_MODULES)) -endef - -define KernelPackage/arptables/description - Kernel modules for ARP firewalling -endef - -$(eval $(call KernelPackage,arptables)) - - -define KernelPackage/br-netfilter - SUBMENU:=$(NF_MENU) - TITLE:=Bridge netfilter support modules - DEPENDS:=+kmod-ipt-core - FILES:=$(LINUX_DIR)/net/bridge/br_netfilter.ko - KCONFIG:=CONFIG_BRIDGE_NETFILTER - AUTOLOAD:=$(call AutoProbe,br_netfilter) -endef - -define KernelPackage/br-netfilter/install - $(INSTALL_DIR) $(1)/etc/sysctl.d - $(INSTALL_DATA) ./files/sysctl-br-netfilter.conf $(1)/etc/sysctl.d/11-br-netfilter.conf -endef - -$(eval $(call KernelPackage,br-netfilter)) - - -define KernelPackage/ebtables - SUBMENU:=$(NF_MENU) - TITLE:=Bridge firewalling modules - DEPENDS:=+kmod-ipt-core - FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).ko) - KCONFIG:=$(KCONFIG_EBTABLES) - AUTOLOAD:=$(call AutoProbe,$(notdir $(EBTABLES-m))) -endef - -define KernelPackage/ebtables/description - ebtables is a general, extensible frame/packet identification - framework. It provides you to do Ethernet - filtering/NAT/brouting on the Ethernet bridge. -endef - -$(eval $(call KernelPackage,ebtables)) - - -define AddDepends/ebtables - SUBMENU:=$(NF_MENU) - DEPENDS+= +kmod-ebtables $(1) -endef - - -define KernelPackage/ebtables-ipv4 - TITLE:=ebtables: IPv4 support - FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).ko) - KCONFIG:=$(KCONFIG_EBTABLES_IP4) - AUTOLOAD:=$(call AutoProbe,$(notdir $(EBTABLES_IP4-m))) - $(call AddDepends/ebtables) -endef - -define KernelPackage/ebtables-ipv4/description - This option adds the IPv4 support to ebtables, which allows basic - IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets. -endef - -$(eval $(call KernelPackage,ebtables-ipv4)) - - -define KernelPackage/ebtables-ipv6 - TITLE:=ebtables: IPv6 support - DEPENDS:=@IPV6 - FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).ko) - KCONFIG:=$(KCONFIG_EBTABLES_IP6) - AUTOLOAD:=$(call AutoProbe,$(notdir $(EBTABLES_IP6-m))) - $(call AddDepends/ebtables) -endef - -define KernelPackage/ebtables-ipv6/description - This option adds the IPv6 support to ebtables, which allows basic - IPv6 header field filtering and target support. -endef - -$(eval $(call KernelPackage,ebtables-ipv6)) - - -define KernelPackage/ebtables-watchers - TITLE:=ebtables: watchers support - FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).ko) - KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS) - AUTOLOAD:=$(call AutoProbe,$(notdir $(EBTABLES_WATCHERS-m))) - $(call AddDepends/ebtables) -endef - -define KernelPackage/ebtables-watchers/description - This option adds the log watchers, that you can use in any rule - in any ebtables table. -endef - -$(eval $(call KernelPackage,ebtables-watchers)) - - -define KernelPackage/nfnetlink - SUBMENU:=$(NF_MENU) - TITLE:=Netlink-based userspace interface - FILES:=$(foreach mod,$(NFNETLINK-m),$(LINUX_DIR)/net/$(mod).ko) - KCONFIG:=$(KCONFIG_NFNETLINK) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFNETLINK-m))) -endef - -define KernelPackage/nfnetlink/description - Kernel modules support for a netlink-based userspace interface -endef - -$(eval $(call KernelPackage,nfnetlink)) - - -define AddDepends/nfnetlink - SUBMENU:=$(NF_MENU) - DEPENDS+=+kmod-nfnetlink $(1) -endef - - -define KernelPackage/nfnetlink-log - TITLE:=Netfilter LOG over NFNETLINK interface - FILES:=$(foreach mod,$(NFNETLINK_LOG-m),$(LINUX_DIR)/net/$(mod).ko) - KCONFIG:=$(KCONFIG_NFNETLINK_LOG) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFNETLINK_LOG-m))) - $(call AddDepends/nfnetlink) -endef - -define KernelPackage/nfnetlink-log/description - Kernel modules support for logging packets via NFNETLINK - Includes: - - NFLOG -endef - -$(eval $(call KernelPackage,nfnetlink-log)) - - -define KernelPackage/nfnetlink-queue - TITLE:=Netfilter QUEUE over NFNETLINK interface - FILES:=$(foreach mod,$(NFNETLINK_QUEUE-m),$(LINUX_DIR)/net/$(mod).ko) - KCONFIG:=$(KCONFIG_NFNETLINK_QUEUE) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFNETLINK_QUEUE-m))) - $(call AddDepends/nfnetlink) -endef - -define KernelPackage/nfnetlink-queue/description - Kernel modules support for queueing packets via NFNETLINK - Includes: - - NFQUEUE -endef - -$(eval $(call KernelPackage,nfnetlink-queue)) - - -define KernelPackage/nf-conntrack-netlink - TITLE:=Connection tracking netlink interface - FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.ko - KCONFIG:=CONFIG_NF_CT_NETLINK CONFIG_NF_CONNTRACK_EVENTS=y CONFIG_NETFILTER_NETLINK_GLUE_CT=y - AUTOLOAD:=$(call AutoProbe,nf_conntrack_netlink) - $(call AddDepends/nfnetlink,+kmod-ipt-conntrack) -endef - -define KernelPackage/nf-conntrack-netlink/description - Kernel modules support for a netlink-based connection tracking - userspace interface -endef - -$(eval $(call KernelPackage,nf-conntrack-netlink)) - -define KernelPackage/ipt-hashlimit - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter hashlimit match - DEPENDS:=+kmod-ipt-core - KCONFIG:=$(KCONFIG_IPT_HASHLIMIT) - FILES:=$(LINUX_DIR)/net/netfilter/xt_hashlimit.ko - AUTOLOAD:=$(call AutoProbe,xt_hashlimit) - $(call KernelPackage/ipt) -endef - -define KernelPackage/ipt-hashlimit/description - Kernel modules support for the hashlimit bucket match module -endef - -$(eval $(call KernelPackage,ipt-hashlimit)) - -define KernelPackage/ipt-rpfilter - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter rpfilter match - DEPENDS:=+kmod-ipt-core - KCONFIG:=$(KCONFIG_IPT_RPFILTER) - FILES:=$(realpath \ - $(LINUX_DIR)/net/ipv4/netfilter/ipt_rpfilter.ko \ - $(LINUX_DIR)/net/ipv6/netfilter/ip6t_rpfilter.ko) - AUTOLOAD:=$(call AutoProbe,ipt_rpfilter ip6t_rpfilter) - $(call KernelPackage/ipt) -endef - -define KernelPackage/ipt-rpfilter/description - Kernel modules support for the Netfilter rpfilter match -endef - -$(eval $(call KernelPackage,ipt-rpfilter)) - - -define KernelPackage/nft-core - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables support - DEPENDS:=+kmod-nfnetlink +kmod-nf-reject +IPV6:kmod-nf-reject6 +IPV6:kmod-nf-conntrack6 +kmod-lib-crc32c +LINUX_5_4:kmod-nf-nat +LINUX_5_10:kmod-nf-nat - FILES:=$(foreach mod,$(NFT_CORE-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_CORE-m))) - KCONFIG:= \ - CONFIG_NFT_COMPAT=n \ - CONFIG_NFT_QUEUE=n \ - $(KCONFIG_NFT_CORE) -endef - -define KernelPackage/nft-core/description - Kernel module support for nftables -endef - -$(eval $(call KernelPackage,nft-core)) - - -define KernelPackage/nft-arp - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables ARP table support - DEPENDS:=+kmod-nft-core - FILES:=$(foreach mod,$(NFT_ARP-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_ARP-m))) - KCONFIG:=$(KCONFIG_NFT_ARP) -endef - -$(eval $(call KernelPackage,nft-arp)) - - -define KernelPackage/nft-bridge - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables bridge table support - DEPENDS:=+kmod-nft-core - FILES:=$(foreach mod,$(NFT_BRIDGE-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_BRIDGE-m))) - KCONFIG:= \ - CONFIG_NF_LOG_BRIDGE=n \ - $(KCONFIG_NFT_BRIDGE) -endef - -$(eval $(call KernelPackage,nft-bridge)) - - -define KernelPackage/nft-nat - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables NAT support - DEPENDS:=+kmod-nft-core +kmod-nf-nat - FILES:=$(foreach mod,$(NFT_NAT-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_NAT-m))) - KCONFIG:=$(KCONFIG_NFT_NAT) -endef - -$(eval $(call KernelPackage,nft-nat)) - - -define KernelPackage/nft-offload - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables routing/NAT offload support - DEPENDS:=@IPV6 +kmod-nf-flow +kmod-nft-nat - KCONFIG:= \ - CONFIG_NF_FLOW_TABLE_INET \ - CONFIG_NF_FLOW_TABLE_IPV4 \ - CONFIG_NF_FLOW_TABLE_IPV6 \ - CONFIG_NFT_FLOW_OFFLOAD - FILES:= \ - $(LINUX_DIR)/net/netfilter/nf_flow_table_inet.ko \ - $(LINUX_DIR)/net/ipv4/netfilter/nf_flow_table_ipv4.ko \ - $(LINUX_DIR)/net/ipv6/netfilter/nf_flow_table_ipv6.ko \ - $(LINUX_DIR)/net/netfilter/nft_flow_offload.ko - AUTOLOAD:=$(call AutoProbe,nf_flow_table_inet nf_flow_table_ipv4 nf_flow_table_ipv6 nft_flow_offload) -endef - -$(eval $(call KernelPackage,nft-offload)) - - -define KernelPackage/nft-nat6 - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables IPv6-NAT support - DEPENDS:=+kmod-nft-nat +kmod-nf-nat6 - FILES:=$(foreach mod,$(NFT_NAT6-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_NAT6-m))) - KCONFIG:=$(KCONFIG_NFT_NAT6) -endef - -$(eval $(call KernelPackage,nft-nat6)) - -define KernelPackage/nft-netdev - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables netdev support - DEPENDS:=+kmod-nft-core - KCONFIG:= \ - CONFIG_NETFILTER_INGRESS=y \ - CONFIG_NF_TABLES_NETDEV \ - CONFIG_NF_DUP_NETDEV \ - CONFIG_NFT_DUP_NETDEV \ - CONFIG_NFT_FWD_NETDEV - FILES:= \ - $(LINUX_DIR)/net/netfilter/nf_tables_netdev.ko@lt4.17 \ - $(LINUX_DIR)/net/netfilter/nf_dup_netdev.ko@gt4.5 \ - $(LINUX_DIR)/net/netfilter/nft_dup_netdev.ko@gt4.5 \ - $(LINUX_DIR)/net/netfilter/nft_fwd_netdev.ko@gt4.5 - AUTOLOAD:=$(call AutoProbe,nf_tables_netdev nf_dup_netdev nft_dup_netdev nft_fwd_netdev) -endef - -$(eval $(call KernelPackage,nft-netdev)) - - -define KernelPackage/nft-fib - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables fib support - DEPENDS:=+kmod-nft-core - FILES:=$(foreach mod,$(NFT_FIB-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_FIB-m))) - KCONFIG:=$(KCONFIG_NFT_FIB) -endef - -$(eval $(call KernelPackage,nft-fib)) - - -define KernelPackage/nft-queue - SUBMENU:=$(NF_MENU) - TITLE:=Netfilter nf_tables queue support - DEPENDS:=+kmod-nft-core +kmod-nfnetlink-queue - FILES:=$(foreach mod,$(NFT_QUEUE-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_QUEUE-m))) - KCONFIG:=$(KCONFIG_NFT_QUEUE) -endef - -$(eval $(call KernelPackage,nft-queue)) diff --git a/feeds/ipq807x/linux/modules/netsupport.mk b/feeds/ipq807x/linux/modules/netsupport.mk deleted file mode 100644 index 4343e850e..000000000 --- a/feeds/ipq807x/linux/modules/netsupport.mk +++ /dev/null @@ -1,1287 +0,0 @@ -# -# Copyright (C) 2006-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -NETWORK_SUPPORT_MENU:=Network Support - -define KernelPackage/atm - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=ATM support - KCONFIG:= \ - CONFIG_ATM \ - CONFIG_ATM_BR2684 - FILES:= \ - $(LINUX_DIR)/net/atm/atm.ko \ - $(LINUX_DIR)/net/atm/br2684.ko - AUTOLOAD:=$(call AutoLoad,30,atm br2684) -endef - -define KernelPackage/atm/description - Kernel modules for ATM support -endef - -$(eval $(call KernelPackage,atm)) - - -define KernelPackage/atmtcp - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=ATM over TCP - DEPENDS:=kmod-atm - KCONFIG:=CONFIG_ATM_TCP CONFIG_ATM_DRIVERS=y - FILES:=$(LINUX_DIR)/drivers/atm/atmtcp.ko - AUTOLOAD:=$(call AutoLoad,40,atmtcp) -endef - -define KernelPackage/atmtcp/description - Kernel module for ATM over TCP support -endef - -$(eval $(call KernelPackage,atmtcp)) - - -define KernelPackage/bonding - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Ethernet bonding driver - KCONFIG:=CONFIG_BONDING - FILES:=$(LINUX_DIR)/drivers/net/bonding/bonding.ko - AUTOLOAD:=$(call AutoLoad,40,bonding) -endef - -define KernelPackage/bonding/description - Kernel module for NIC bonding. -endef - -$(eval $(call KernelPackage,bonding)) - - -define KernelPackage/udptunnel4 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPv4 UDP tunneling support - KCONFIG:=CONFIG_NET_UDP_TUNNEL - HIDDEN:=1 - FILES:=$(LINUX_DIR)/net/ipv4/udp_tunnel.ko - AUTOLOAD:=$(call AutoLoad,32,udp_tunnel) -endef - - -$(eval $(call KernelPackage,udptunnel4)) - -define KernelPackage/udptunnel6 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPv6 UDP tunneling support - DEPENDS:=@IPV6 - KCONFIG:=CONFIG_NET_UDP_TUNNEL - HIDDEN:=1 - FILES:=$(LINUX_DIR)/net/ipv6/ip6_udp_tunnel.ko - AUTOLOAD:=$(call AutoLoad,32,ip6_udp_tunnel) -endef - -$(eval $(call KernelPackage,udptunnel6)) - - -define KernelPackage/vxlan - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Native VXLAN Kernel support - DEPENDS:= \ - +kmod-iptunnel \ - +kmod-udptunnel4 \ - +IPV6:kmod-udptunnel6 - KCONFIG:=CONFIG_VXLAN - FILES:=$(LINUX_DIR)/drivers/net/vxlan.ko - AUTOLOAD:=$(call AutoLoad,13,vxlan) -endef - -define KernelPackage/vxlan/description - Kernel module for supporting VXLAN in the Kernel. - Requires Kernel 3.12 or newer. -endef - -$(eval $(call KernelPackage,vxlan)) - - -define KernelPackage/geneve - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Generic Network Virtualization Encapsulation (Geneve) support - DEPENDS:= \ - +kmod-iptunnel \ - +kmod-udptunnel4 \ - +IPV6:kmod-udptunnel6 - KCONFIG:=CONFIG_GENEVE - FILES:= \ - $(LINUX_DIR)/drivers/net/geneve.ko - AUTOLOAD:=$(call AutoLoad,13,geneve) -endef - -define KernelPackage/geneve/description - Kernel module for supporting Geneve in the Kernel. - Requires Kernel 3.18 or newer. -endef - -$(eval $(call KernelPackage,geneve)) - - -define KernelPackage/nsh - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Network Service Header (NSH) protocol - DEPENDS:= - KCONFIG:=CONFIG_NET_NSH - FILES:=$(LINUX_DIR)/net/nsh/nsh.ko - AUTOLOAD:=$(call AutoLoad,13,nsh) -endef - -define KernelPackage/nsh/description - Network Service Header is an implementation of Service Function - Chaining (RFC 7665). Requires kernel 4.14 or newer -endef - -$(eval $(call KernelPackage,nsh)) - - -define KernelPackage/misdn - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=mISDN (ISDN) Support - KCONFIG:= \ - CONFIG_ISDN=y \ - CONFIG_MISDN \ - CONFIG_MISDN_DSP \ - CONFIG_MISDN_L1OIP - FILES:= \ - $(LINUX_DIR)/drivers/isdn/mISDN/mISDN_core.ko \ - $(LINUX_DIR)/drivers/isdn/mISDN/mISDN_dsp.ko \ - $(LINUX_DIR)/drivers/isdn/mISDN/l1oip.ko - AUTOLOAD:=$(call AutoLoad,30,mISDN_core mISDN_dsp l1oip) -endef - -define KernelPackage/misdn/description - Modular ISDN driver support -endef - -$(eval $(call KernelPackage,misdn)) - - -define KernelPackage/isdn4linux - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Old ISDN4Linux (deprecated) - DEPENDS:=+kmod-ppp - KCONFIG:= \ - CONFIG_ISDN=y \ - CONFIG_ISDN_I4L \ - CONFIG_ISDN_PPP=y \ - CONFIG_ISDN_PPP_VJ=y \ - CONFIG_ISDN_MPP=y \ - CONFIG_IPPP_FILTER=y \ - CONFIG_ISDN_PPP_BSDCOMP \ - CONFIG_ISDN_CAPI_MIDDLEWARE=y \ - CONFIG_ISDN_CAPI_CAPIFS_BOOL=y \ - CONFIG_ISDN_AUDIO=y \ - CONFIG_ISDN_TTY_FAX=y \ - CONFIG_ISDN_X25=y \ - CONFIG_ISDN_DIVERSION - FILES:= \ - $(LINUX_DIR)/drivers/isdn/divert/dss1_divert.ko \ - $(LINUX_DIR)/drivers/isdn/i4l/isdn.ko \ - $(LINUX_DIR)/drivers/isdn/i4l/isdn_bsdcomp.ko - AUTOLOAD:=$(call AutoLoad,40,isdn isdn_bsdcomp dss1_divert) -endef - -define KernelPackage/isdn4linux/description - This driver allows you to use an ISDN adapter for networking -endef - -$(eval $(call KernelPackage,isdn4linux)) - - -define KernelPackage/ipip - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IP-in-IP encapsulation - DEPENDS:=+kmod-iptunnel +kmod-iptunnel4 - KCONFIG:=CONFIG_NET_IPIP - FILES:=$(LINUX_DIR)/net/ipv4/ipip.ko - AUTOLOAD:=$(call AutoLoad,32,ipip) -endef - -define KernelPackage/ipip/description - Kernel modules for IP-in-IP encapsulation -endef - -$(eval $(call KernelPackage,ipip)) - - -IPSEC-m:= \ - xfrm/xfrm_algo \ - xfrm/xfrm_ipcomp \ - xfrm/xfrm_user \ - key/af_key \ - -define KernelPackage/ipsec - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPsec related modules (IPv4 and IPv6) - DEPENDS:= \ - +kmod-crypto-authenc +kmod-crypto-cbc +kmod-crypto-deflate \ - +kmod-crypto-des +kmod-crypto-echainiv +kmod-crypto-hmac \ - +kmod-crypto-md5 +kmod-crypto-sha1 - KCONFIG:= \ - CONFIG_NET_KEY \ - CONFIG_XFRM_USER \ - CONFIG_INET_IPCOMP \ - CONFIG_XFRM_IPCOMP - FILES:=$(foreach mod,$(IPSEC-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoLoad,30,$(notdir $(IPSEC-m))) -endef - -define KernelPackage/ipsec/description - Kernel modules for IPsec support in both IPv4 and IPv6. - Includes: - - af_key - - xfrm_algo - - xfrm_ipcomp - - xfrm_user -endef - -$(eval $(call KernelPackage,ipsec)) - -IPSEC4-m = \ - ipv4/ah4 \ - ipv4/esp4 \ - ipv4/xfrm4_tunnel \ - ipv4/ipcomp \ - -IPSEC4-m += $(ifeq ($$(strip $$(call CompareKernelPatchVer,$$(KERNEL_PATCHVER),le,5.2))),ipv4/xfrm4_mode_beet ipv4/xfrm4_mode_transport ipv4/xfrm4_mode_tunnel) - -define KernelPackage/ipsec4 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPsec related modules (IPv4) - DEPENDS:=kmod-ipsec +kmod-iptunnel4 - KCONFIG:= \ - CONFIG_INET_AH \ - CONFIG_INET_ESP \ - CONFIG_INET_IPCOMP \ - CONFIG_INET_XFRM_MODE_BEET \ - CONFIG_INET_XFRM_MODE_TRANSPORT \ - CONFIG_INET_XFRM_MODE_TUNNEL \ - CONFIG_INET_XFRM_TUNNEL \ - CONFIG_INET_ESP_OFFLOAD=n - FILES:=$(foreach mod,$(IPSEC4-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoLoad,32,$(notdir $(IPSEC4-m))) -endef - -define KernelPackage/ipsec4/description - Kernel modules for IPsec support in IPv4. - Includes: - - ah4 - - esp4 - - ipcomp4 - - xfrm4_mode_beet - - xfrm4_mode_transport - - xfrm4_mode_tunnel - - xfrm4_tunnel -endef - -$(eval $(call KernelPackage,ipsec4)) - - -IPSEC6-m = \ - ipv6/ah6 \ - ipv6/esp6 \ - ipv6/xfrm6_tunnel \ - ipv6/ipcomp6 \ - -IPSEC6-m += $(ifeq ($$(strip $$(call CompareKernelPatchVer,$$(KERNEL_PATCHVER),le,5.2))),ipv6/xfrm6_mode_beet ipv6/xfrm6_mode_transport ipv6/xfrm6_mode_tunnel) - -define KernelPackage/ipsec6 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPsec related modules (IPv6) - DEPENDS:=@IPV6 kmod-ipsec +kmod-iptunnel6 - KCONFIG:= \ - CONFIG_INET6_AH \ - CONFIG_INET6_ESP \ - CONFIG_INET6_IPCOMP \ - CONFIG_INET6_XFRM_MODE_BEET \ - CONFIG_INET6_XFRM_MODE_TRANSPORT \ - CONFIG_INET6_XFRM_MODE_TUNNEL \ - CONFIG_INET6_XFRM_TUNNEL \ - CONFIG_INET6_ESP_OFFLOAD=n - FILES:=$(foreach mod,$(IPSEC6-m),$(LINUX_DIR)/net/$(mod).ko) - AUTOLOAD:=$(call AutoLoad,32,$(notdir $(IPSEC6-m))) -endef - -define KernelPackage/ipsec6/description - Kernel modules for IPsec support in IPv6. - Includes: - - ah6 - - esp6 - - ipcomp6 - - xfrm6_mode_beet - - xfrm6_mode_transport - - xfrm6_mode_tunnel - - xfrm6_tunnel -endef - -$(eval $(call KernelPackage,ipsec6)) - - -define KernelPackage/iptunnel - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IP tunnel support - HIDDEN:=1 - KCONFIG:= \ - CONFIG_NET_IP_TUNNEL - FILES:=$(LINUX_DIR)/net/ipv4/ip_tunnel.ko - AUTOLOAD:=$(call AutoLoad,31,ip_tunnel) -endef - -define KernelPackage/iptunnel/description - Kernel module for generic IP tunnel support -endef - -$(eval $(call KernelPackage,iptunnel)) - - -define KernelPackage/ip-vti - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IP VTI (Virtual Tunnel Interface) - DEPENDS:=+kmod-iptunnel +kmod-iptunnel4 +kmod-ipsec4 - KCONFIG:=CONFIG_NET_IPVTI - FILES:=$(LINUX_DIR)/net/ipv4/ip_vti.ko - AUTOLOAD:=$(call AutoLoad,33,ip_vti) -endef - -define KernelPackage/ip-vti/description - Kernel modules for IP VTI (Virtual Tunnel Interface) -endef - -$(eval $(call KernelPackage,ip-vti)) - - -define KernelPackage/ip6-vti - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPv6 VTI (Virtual Tunnel Interface) - DEPENDS:=@IPV6 +kmod-iptunnel +kmod-ip6-tunnel +kmod-ipsec6 - KCONFIG:=CONFIG_IPV6_VTI - FILES:=$(LINUX_DIR)/net/ipv6/ip6_vti.ko - AUTOLOAD:=$(call AutoLoad,33,ip6_vti) -endef - -define KernelPackage/ip6-vti/description - Kernel modules for IPv6 VTI (Virtual Tunnel Interface) -endef - -$(eval $(call KernelPackage,ip6-vti)) - - -define KernelPackage/xfrm-interface - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPsec XFRM Interface - DEPENDS:=+kmod-ipsec4 +IPV6:kmod-ipsec6 @!LINUX_4_14 - KCONFIG:=CONFIG_XFRM_INTERFACE - FILES:=$(LINUX_DIR)/net/xfrm/xfrm_interface.ko - AUTOLOAD:=$(call AutoProbe,xfrm_interface) -endef - -define KernelPackage/xfrm-interface/description - Kernel module for XFRM interface support -endef - -$(eval $(call KernelPackage,xfrm-interface)) - - -define KernelPackage/iptunnel4 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPv4 tunneling - HIDDEN:=1 - KCONFIG:= \ - CONFIG_INET_TUNNEL \ - CONFIG_NET_IPIP=m - FILES:=$(LINUX_DIR)/net/ipv4/tunnel4.ko - AUTOLOAD:=$(call AutoLoad,31,tunnel4) -endef - -define KernelPackage/iptunnel4/description - Kernel modules for IPv4 tunneling -endef - -$(eval $(call KernelPackage,iptunnel4)) - - -define KernelPackage/iptunnel6 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPv6 tunneling - DEPENDS:=@IPV6 - KCONFIG:= \ - CONFIG_INET6_TUNNEL - FILES:=$(LINUX_DIR)/net/ipv6/tunnel6.ko - AUTOLOAD:=$(call AutoLoad,31,tunnel6) -endef - -define KernelPackage/iptunnel6/description - Kernel modules for IPv6 tunneling -endef - -$(eval $(call KernelPackage,iptunnel6)) - - -define KernelPackage/sit - SUBMENU:=$(NETWORK_SUPPORT_MENU) - DEPENDS:=@IPV6 +kmod-iptunnel +kmod-iptunnel4 - TITLE:=IPv6-in-IPv4 tunnel - KCONFIG:=CONFIG_IPV6_SIT \ - CONFIG_IPV6_SIT_6RD=y - FILES:=$(LINUX_DIR)/net/ipv6/sit.ko - AUTOLOAD:=$(call AutoLoad,32,sit) -endef - -define KernelPackage/sit/description - Kernel modules for IPv6-in-IPv4 tunnelling -endef - -$(eval $(call KernelPackage,sit)) - - -define KernelPackage/fou - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=FOU and GUE decapsulation - DEPENDS:= \ - +kmod-iptunnel \ - +kmod-udptunnel4 \ - +IPV6:kmod-udptunnel6 - KCONFIG:= \ - CONFIG_NET_FOU \ - CONFIG_NET_FOU_IP_TUNNELS=y - FILES:=$(LINUX_DIR)/net/ipv4/fou.ko - AUTOLOAD:=$(call AutoProbe,fou) -endef - -define KernelPackage/fou/description - Kernel module for FOU (Foo over UDP) and GUE (Generic UDP Encapsulation) tunnelling. - Requires Kernel 3.18 or newer. -endef - -$(eval $(call KernelPackage,fou)) - - -define KernelPackage/fou6 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=FOU and GUE decapsulation over IPv6 - DEPENDS:= @IPV6 \ - +kmod-fou \ - +kmod-ip6-tunnel - KCONFIG:= \ - CONFIG_IPV6_FOU \ - CONFIG_IPV6_FOU_TUNNEL - FILES:=$(LINUX_DIR)/net/ipv6/fou6.ko - AUTOLOAD:=$(call AutoProbe,fou6) -endef - -define KernelPackage/fou6/description - Kernel module for FOU (Foo over UDP) and GUE (Generic UDP Encapsulation) tunnelling over IPv6. - Requires Kernel 3.18 or newer. -endef - -$(eval $(call KernelPackage,fou6)) - - -define KernelPackage/ip6-tunnel - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IP-in-IPv6 tunnelling - DEPENDS:=@IPV6 +kmod-iptunnel6 - KCONFIG:= CONFIG_IPV6_TUNNEL - FILES:=$(LINUX_DIR)/net/ipv6/ip6_tunnel.ko - AUTOLOAD:=$(call AutoLoad,32,ip6_tunnel) -endef - -define KernelPackage/ip6-tunnel/description - Kernel modules for IPv6-in-IPv6 and IPv4-in-IPv6 tunnelling -endef - -$(eval $(call KernelPackage,ip6-tunnel)) - - -define KernelPackage/gre - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=GRE support - DEPENDS:=+kmod-iptunnel - KCONFIG:=CONFIG_NET_IPGRE CONFIG_NET_IPGRE_DEMUX - FILES:=$(LINUX_DIR)/net/ipv4/ip_gre.ko $(LINUX_DIR)/net/ipv4/gre.ko - AUTOLOAD:=$(call AutoLoad,39,gre ip_gre) -endef - -define KernelPackage/gre/description - Generic Routing Encapsulation support -endef - -$(eval $(call KernelPackage,gre)) - - -define KernelPackage/gre6 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=GRE support over IPV6 - DEPENDS:=@IPV6 +kmod-iptunnel +kmod-ip6-tunnel +kmod-gre - KCONFIG:=CONFIG_IPV6_GRE - FILES:=$(LINUX_DIR)/net/ipv6/ip6_gre.ko - AUTOLOAD:=$(call AutoLoad,39,ip6_gre) -endef - -define KernelPackage/gre6/description - Generic Routing Encapsulation support over IPv6 -endef - -$(eval $(call KernelPackage,gre6)) - - -define KernelPackage/tun - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Universal TUN/TAP driver - KCONFIG:=CONFIG_TUN - FILES:=$(LINUX_DIR)/drivers/net/tun.ko - AUTOLOAD:=$(call AutoLoad,30,tun) -endef - -define KernelPackage/tun/description - Kernel support for the TUN/TAP tunneling device -endef - -$(eval $(call KernelPackage,tun)) - - -define KernelPackage/veth - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Virtual ethernet pair device - KCONFIG:=CONFIG_VETH - FILES:=$(LINUX_DIR)/drivers/net/veth.ko - AUTOLOAD:=$(call AutoLoad,30,veth) -endef - -define KernelPackage/veth/description - This device is a local ethernet tunnel. Devices are created in pairs. - When one end receives the packet it appears on its pair and vice - versa. -endef - -$(eval $(call KernelPackage,veth)) - - -define KernelPackage/slhc - SUBMENU:=$(NETWORK_SUPPORT_MENU) - HIDDEN:=1 - TITLE:=Serial Line Header Compression - DEPENDS:=+kmod-lib-crc-ccitt - KCONFIG:=CONFIG_SLHC - FILES:=$(LINUX_DIR)/drivers/net/slip/slhc.ko -endef - -$(eval $(call KernelPackage,slhc)) - - -define KernelPackage/ppp - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=PPP modules - DEPENDS:=+kmod-lib-crc-ccitt +kmod-slhc - KCONFIG:= \ - CONFIG_PPP \ - CONFIG_PPP_ASYNC - FILES:= \ - $(LINUX_DIR)/drivers/net/ppp/ppp_async.ko \ - $(LINUX_DIR)/drivers/net/ppp/ppp_generic.ko - AUTOLOAD:=$(call AutoProbe,ppp_async) -endef - -define KernelPackage/ppp/description - Kernel modules for PPP support -endef - -$(eval $(call KernelPackage,ppp)) - - -define KernelPackage/ppp-synctty - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=PPP sync tty support - DEPENDS:=kmod-ppp - KCONFIG:=CONFIG_PPP_SYNC_TTY - FILES:=$(LINUX_DIR)/drivers/net/ppp/ppp_synctty.ko - AUTOLOAD:=$(call AutoProbe,ppp_synctty) -endef - -define KernelPackage/ppp-synctty/description - Kernel modules for PPP sync tty support -endef - -$(eval $(call KernelPackage,ppp-synctty)) - - -define KernelPackage/pppox - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=PPPoX helper - DEPENDS:=kmod-ppp - KCONFIG:=CONFIG_PPPOE - FILES:=$(LINUX_DIR)/drivers/net/ppp/pppox.ko -endef - -define KernelPackage/pppox/description - Kernel helper module for PPPoE and PPTP support -endef - -$(eval $(call KernelPackage,pppox)) - - -define KernelPackage/pppoe - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=PPPoE support - DEPENDS:=kmod-ppp +kmod-pppox - KCONFIG:=CONFIG_PPPOE - FILES:=$(LINUX_DIR)/drivers/net/ppp/pppoe.ko - AUTOLOAD:=$(call AutoProbe,pppoe) -endef - -define KernelPackage/pppoe/description - Kernel module for PPPoE (PPP over Ethernet) support -endef - -$(eval $(call KernelPackage,pppoe)) - - -define KernelPackage/pppoa - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=PPPoA support - DEPENDS:=kmod-ppp +kmod-atm - KCONFIG:=CONFIG_PPPOATM CONFIG_ATM_DRIVERS=y - FILES:=$(LINUX_DIR)/net/atm/pppoatm.ko - AUTOLOAD:=$(call AutoLoad,40,pppoatm) -endef - -define KernelPackage/pppoa/description - Kernel modules for PPPoA (PPP over ATM) support -endef - -$(eval $(call KernelPackage,pppoa)) - - -define KernelPackage/pptp - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=PPtP support - DEPENDS:=kmod-ppp +kmod-gre +kmod-pppox - KCONFIG:=CONFIG_PPTP - FILES:=$(LINUX_DIR)/drivers/net/ppp/pptp.ko - AUTOLOAD:=$(call AutoProbe,pptp) -endef - -$(eval $(call KernelPackage,pptp)) - - -define KernelPackage/pppol2tp - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=PPPoL2TP support - DEPENDS:=kmod-ppp +kmod-pppox +kmod-l2tp - KCONFIG:=CONFIG_PPPOL2TP - FILES:=$(LINUX_DIR)/net/l2tp/l2tp_ppp.ko - AUTOLOAD:=$(call AutoProbe,l2tp_ppp) -endef - -define KernelPackage/pppol2tp/description - Kernel modules for PPPoL2TP (PPP over L2TP) support -endef - -$(eval $(call KernelPackage,pppol2tp)) - - -define KernelPackage/ipoa - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IPoA support - DEPENDS:=kmod-atm - KCONFIG:=CONFIG_ATM_CLIP - FILES:=$(LINUX_DIR)/net/atm/clip.ko - AUTOLOAD:=$(call AutoProbe,clip) -endef - -define KernelPackage/ipoa/description - Kernel modules for IPoA (IP over ATM) support -endef - -$(eval $(call KernelPackage,ipoa)) - - -define KernelPackage/mppe - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Microsoft PPP compression/encryption - DEPENDS:=kmod-ppp +kmod-crypto-arc4 +kmod-crypto-sha1 +kmod-crypto-ecb - KCONFIG:= \ - CONFIG_PPP_MPPE_MPPC \ - CONFIG_PPP_MPPE - FILES:=$(LINUX_DIR)/drivers/net/ppp/ppp_mppe.ko - AUTOLOAD:=$(call AutoProbe,ppp_mppe) -endef - -define KernelPackage/mppe/description - Kernel modules for Microsoft PPP compression/encryption -endef - -$(eval $(call KernelPackage,mppe)) - - -SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko)) -SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall -SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark act_ctinfo sch_cake sch_netem sch_mqprio em_ipset cls_bpf cls_flower act_bpf act_vlan -SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES)) -SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES))) -SCHED_FILES_EXTRA = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(SCHED_MODULES_EXTRA)) - -define KernelPackage/sched-core - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic schedulers - KCONFIG:= \ - CONFIG_NET_SCHED=y \ - CONFIG_NET_SCH_HFSC \ - CONFIG_NET_SCH_HTB \ - CONFIG_NET_SCH_TBF \ - CONFIG_NET_SCH_INGRESS \ - CONFIG_NET_SCH_FQ_CODEL \ - CONFIG_NET_CLS=y \ - CONFIG_NET_CLS_ACT=y \ - CONFIG_NET_CLS_BASIC \ - CONFIG_NET_CLS_FLOW \ - CONFIG_NET_CLS_FW \ - CONFIG_NET_CLS_ROUTE4 \ - CONFIG_NET_CLS_TCINDEX \ - CONFIG_NET_CLS_U32 \ - CONFIG_NET_ACT_GACT \ - CONFIG_NET_ACT_MIRRED \ - CONFIG_NET_ACT_SKBEDIT \ - CONFIG_NET_CLS_MATCHALL \ - CONFIG_NET_EMATCH=y \ - CONFIG_NET_EMATCH_U32 - FILES:=$(SCHED_FILES) - AUTOLOAD:=$(call AutoLoad,70, $(SCHED_MODULES_CORE)) -endef - -define KernelPackage/sched-core/description - Core kernel scheduler support for IP traffic -endef - -$(eval $(call KernelPackage,sched-core)) - - -define KernelPackage/sched-cake - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Cake fq_codel/blue derived shaper - DEPENDS:=@!LINUX_4_14 +kmod-sched-core - KCONFIG:=CONFIG_NET_SCH_CAKE - FILES:=$(LINUX_DIR)/net/sched/sch_cake.ko - AUTOLOAD:=$(call AutoProbe,sch_cake) -endef - -define KernelPackage/sched-cake/description - Common Applications Kept Enhanced fq_codel/blue derived shaper -endef - -$(eval $(call KernelPackage,sched-cake)) - -define KernelPackage/sched-flower - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Flower traffic classifier - DEPENDS:=+kmod-sched-core - KCONFIG:=CONFIG_NET_CLS_FLOWER - FILES:=$(LINUX_DIR)/net/sched/cls_flower.ko - AUTOLOAD:=$(call AutoProbe, cls_flower) -endef - -define KernelPackage/sched-flower/description - Allows to classify packets based on a configurable combination of packet keys and masks. -endef - -$(eval $(call KernelPackage,sched-flower)) - - -define KernelPackage/sched-act-vlan - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic VLAN manipulation - DEPENDS:=+kmod-sched-core - KCONFIG:=CONFIG_NET_ACT_VLAN - FILES:=$(LINUX_DIR)/net/sched/act_vlan.ko - AUTOLOAD:=$(call AutoProbe, act_vlan) -endef - -define KernelPackage/sched-act-vlan/description - Allows to configure rules to push or pop vlan headers. -endef - -$(eval $(call KernelPackage,sched-act-vlan)) - - -define KernelPackage/sched-mqprio - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Multi-queue priority scheduler (MQPRIO) - DEPENDS:=+kmod-sched-core - KCONFIG:=CONFIG_NET_SCH_MQPRIO - FILES:=$(LINUX_DIR)/net/sched/sch_mqprio.ko - AUTOLOAD:=$(call AutoProbe, sch_mqprio) -endef - -define KernelPackage/sched-mqprio/description - This scheduler allows QOS to be offloaded on NICs that have support for offloading QOS schedulers. -endef - -$(eval $(call KernelPackage,sched-mqprio)) - -define KernelPackage/sched-connmark - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic shaper conntrack mark support - DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-ipt-conntrack-extra - KCONFIG:=CONFIG_NET_ACT_CONNMARK - FILES:=$(LINUX_DIR)/net/sched/act_connmark.ko - AUTOLOAD:=$(call AutoLoad,71, act_connmark) -endef -$(eval $(call KernelPackage,sched-connmark)) - -define KernelPackage/sched-ctinfo - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic shaper ctinfo support - DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-ipt-conntrack-extra - KCONFIG:=CONFIG_NET_ACT_CTINFO - FILES:=$(LINUX_DIR)/net/sched/act_ctinfo.ko - AUTOLOAD:=$(call AutoLoad,71, act_ctinfo) -endef -$(eval $(call KernelPackage,sched-ctinfo)) - -define KernelPackage/sched-ipset - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic shaper ipset support - DEPENDS:=+kmod-sched-core +kmod-ipt-ipset - KCONFIG:= \ - CONFIG_NET_EMATCH_IPSET - FILES:= \ - $(LINUX_DIR)/net/sched/em_ipset.ko - AUTOLOAD:=$(call AutoLoad,72,em_ipset) -endef - -$(eval $(call KernelPackage,sched-ipset)) - - -define KernelPackage/sched-bpf - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic shaper support for Berkeley Packet Filter - KCONFIG:= \ - CONFIG_NET_CLS_BPF \ - CONFIG_NET_ACT_BPF - FILES:= \ - $(LINUX_DIR)/net/sched/cls_bpf.ko \ - $(LINUX_DIR)/net/sched/act_bpf.ko - AUTOLOAD:=$(call AutoLoad,72,cls_bpf act_bpf) -endef - -$(eval $(call KernelPackage,sched-bpf)) - - -define KernelPackage/bpf-test - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Test Berkeley Packet Filter functionality - KCONFIG:=CONFIG_TEST_BPF - FILES:=$(LINUX_DIR)/lib/test_bpf.ko -endef - -$(eval $(call KernelPackage,bpf-test)) - - -define KernelPackage/sched - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Extra traffic schedulers - DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-lib-crc32c - KCONFIG:= \ - CONFIG_NET_SCH_CODEL \ - CONFIG_NET_SCH_DSMARK \ - CONFIG_NET_SCH_FIFO \ - CONFIG_NET_SCH_GRED \ - CONFIG_NET_SCH_MULTIQ \ - CONFIG_NET_SCH_PRIO \ - CONFIG_NET_SCH_RED \ - CONFIG_NET_SCH_SFQ \ - CONFIG_NET_SCH_TEQL \ - CONFIG_NET_SCH_FQ \ - CONFIG_NET_SCH_PIE \ - CONFIG_NET_ACT_POLICE \ - CONFIG_NET_ACT_IPT \ - CONFIG_NET_ACT_PEDIT \ - CONFIG_NET_ACT_SIMP \ - CONFIG_NET_ACT_CSUM \ - CONFIG_NET_EMATCH_CMP \ - CONFIG_NET_EMATCH_NBYTE \ - CONFIG_NET_EMATCH_META \ - CONFIG_NET_EMATCH_TEXT - FILES:=$(SCHED_FILES_EXTRA) - AUTOLOAD:=$(call AutoLoad,73, $(SCHED_MODULES_EXTRA)) -endef - -define KernelPackage/sched/description - Extra kernel schedulers modules for IP traffic -endef - -SCHED_TEQL_HOTPLUG:=hotplug-sched-teql.sh - -define KernelPackage/sched/install - $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_DATA) ./files/$(SCHED_TEQL_HOTPLUG) $(1)/etc/hotplug.d/iface/15-teql -endef - -$(eval $(call KernelPackage,sched)) - - -define KernelPackage/tcp-bbr - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=BBR TCP congestion control - KCONFIG:=CONFIG_TCP_CONG_BBR - FILES:=$(LINUX_DIR)/net/ipv4/tcp_bbr.ko - AUTOLOAD:=$(call AutoProbe,tcp_bbr) -endef - -define KernelPackage/tcp-bbr/description - Kernel module for BBR (Bottleneck Bandwidth and RTT) TCP congestion - control. It requires the fq ("Fair Queue") pacing packet scheduler. - For kernel 4.13+, TCP internal pacing is implemented as fallback. -endef - -TCP_BBR_SYSCTL_CONF:=sysctl-tcp-bbr.conf - -define KernelPackage/tcp-bbr/install - $(INSTALL_DIR) $(1)/etc/sysctl.d - $(INSTALL_DATA) ./files/$(TCP_BBR_SYSCTL_CONF) $(1)/etc/sysctl.d/12-tcp-bbr.conf -endef - -$(eval $(call KernelPackage,tcp-bbr)) - - -define KernelPackage/tcp-hybla - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=TCP-Hybla congestion control algorithm - KCONFIG:=CONFIG_TCP_CONG_HYBLA - FILES:=$(LINUX_DIR)/net/ipv4/tcp_hybla.ko - AUTOLOAD:=$(call AutoProbe,tcp_hybla) -endef - -define KernelPackage/tcp-hybla/description - TCP-Hybla is a sender-side only change that eliminates penalization of - long-RTT, large-bandwidth connections, like when satellite legs are - involved, especially when sharing a common bottleneck with normal - terrestrial connections. -endef - -$(eval $(call KernelPackage,tcp-hybla)) - - -define KernelPackage/ax25 - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=AX25 support - DEPENDS:=+kmod-lib-crc16 - KCONFIG:= \ - CONFIG_HAMRADIO=y \ - CONFIG_AX25 \ - CONFIG_MKISS - FILES:= \ - $(LINUX_DIR)/net/ax25/ax25.ko \ - $(LINUX_DIR)/drivers/net/hamradio/mkiss.ko - AUTOLOAD:=$(call AutoLoad,80,ax25 mkiss) -endef - -define KernelPackage/ax25/description - Kernel modules for AX25 support -endef - -$(eval $(call KernelPackage,ax25)) - - -define KernelPackage/pktgen - SUBMENU:=$(NETWORK_SUPPORT_MENU) - DEPENDS:=@!TARGET_uml - TITLE:=Network packet generator - KCONFIG:=CONFIG_NET_PKTGEN - FILES:=$(LINUX_DIR)/net/core/pktgen.ko - AUTOLOAD:=$(call AutoLoad,99,pktgen) -endef - -define KernelPackage/pktgen/description - Kernel modules for the Network Packet Generator -endef - -$(eval $(call KernelPackage,pktgen)) - -define KernelPackage/l2tp - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Layer Two Tunneling Protocol (L2TP) - DEPENDS:= \ - +kmod-udptunnel4 \ - +IPV6:kmod-udptunnel6 - KCONFIG:=CONFIG_L2TP \ - CONFIG_L2TP_V3=y \ - CONFIG_L2TP_DEBUGFS=n - FILES:=$(LINUX_DIR)/net/l2tp/l2tp_core.ko \ - $(LINUX_DIR)/net/l2tp/l2tp_netlink.ko - AUTOLOAD:=$(call AutoLoad,32,l2tp_core l2tp_netlink) -endef - -define KernelPackage/l2tp/description - Kernel modules for L2TP V3 Support -endef - -$(eval $(call KernelPackage,l2tp)) - - -define KernelPackage/l2tp-eth - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=L2TP ethernet pseudowire support for L2TPv3 - DEPENDS:=+kmod-l2tp - KCONFIG:=CONFIG_L2TP_ETH - FILES:=$(LINUX_DIR)/net/l2tp/l2tp_eth.ko - AUTOLOAD:=$(call AutoLoad,33,l2tp_eth) -endef - -define KernelPackage/l2tp-eth/description - Kernel modules for L2TP ethernet pseudowire support for L2TPv3 -endef - -$(eval $(call KernelPackage,l2tp-eth)) - -define KernelPackage/l2tp-ip - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=L2TP IP encapsulation for L2TPv3 - DEPENDS:=+kmod-l2tp - KCONFIG:=CONFIG_L2TP_IP - FILES:= \ - $(LINUX_DIR)/net/l2tp/l2tp_ip.ko \ - $(if $(CONFIG_IPV6),$(LINUX_DIR)/net/l2tp/l2tp_ip6.ko) - AUTOLOAD:=$(call AutoLoad,33,l2tp_ip $(if $(CONFIG_IPV6),l2tp_ip6)) -endef - -define KernelPackage/l2tp-ip/description - Kernel modules for L2TP IP encapsulation for L2TPv3 -endef - -$(eval $(call KernelPackage,l2tp-ip)) - - -define KernelPackage/sctp - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=SCTP protocol kernel support - KCONFIG:=\ - CONFIG_IP_SCTP \ - CONFIG_SCTP_DBG_MSG=n \ - CONFIG_SCTP_DBG_OBJCNT=n \ - CONFIG_SCTP_HMAC_NONE=n \ - CONFIG_SCTP_HMAC_SHA1=n \ - CONFIG_SCTP_HMAC_MD5=y \ - CONFIG_SCTP_COOKIE_HMAC_SHA1=n \ - CONFIG_SCTP_COOKIE_HMAC_MD5=y \ - CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE=n \ - CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1=n \ - CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y - FILES:= $(LINUX_DIR)/net/sctp/sctp.ko - AUTOLOAD:= $(call AutoLoad,32,sctp) - DEPENDS:=+kmod-lib-crc32c +kmod-crypto-md5 +kmod-crypto-hmac -endef - -define KernelPackage/sctp/description - Kernel modules for SCTP protocol support -endef - -$(eval $(call KernelPackage,sctp)) - - -define KernelPackage/netem - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Network emulation functionality - DEPENDS:=+kmod-sched - KCONFIG:=CONFIG_NET_SCH_NETEM - FILES:=$(LINUX_DIR)/net/sched/sch_netem.ko - AUTOLOAD:=$(call AutoLoad,99,netem) -endef - -define KernelPackage/netem/description - Kernel modules for emulating the properties of wide area networks -endef - -$(eval $(call KernelPackage,netem)) - -define KernelPackage/slip - SUBMENU:=$(NETWORK_SUPPORT_MENU) - DEPENDS:=+kmod-slhc - TITLE:=SLIP modules - KCONFIG:= \ - CONFIG_SLIP \ - CONFIG_SLIP_COMPRESSED=y \ - CONFIG_SLIP_SMART=y \ - CONFIG_SLIP_MODE_SLIP6=y - - FILES:= \ - $(LINUX_DIR)/drivers/net/slip/slip.ko - AUTOLOAD:=$(call AutoLoad,30,slip) -endef - -define KernelPackage/slip/description - Kernel modules for SLIP support -endef - -$(eval $(call KernelPackage,slip)) - -define KernelPackage/dnsresolver - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=In-kernel DNS Resolver - KCONFIG:= CONFIG_DNS_RESOLVER - FILES:=$(LINUX_DIR)/net/dns_resolver/dns_resolver.ko - AUTOLOAD:=$(call AutoLoad,30,dns_resolver) -endef - -$(eval $(call KernelPackage,dnsresolver)) - -define KernelPackage/rxrpc - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=AF_RXRPC support - HIDDEN:=1 - KCONFIG:= \ - CONFIG_AF_RXRPC \ - CONFIG_RXKAD=m \ - CONFIG_AF_RXRPC_DEBUG=n - FILES:= \ - $(LINUX_DIR)/net/rxrpc/rxrpc.ko - AUTOLOAD:=$(call AutoLoad,30,rxrpc.ko) - DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt -endef - -define KernelPackage/rxrpc/description - Kernel support for AF_RXRPC; required for AFS client -endef - -$(eval $(call KernelPackage,rxrpc)) - -define KernelPackage/mpls - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=MPLS support - DEPENDS:=+!LINUX_4_14:kmod-iptunnel - KCONFIG:= \ - CONFIG_MPLS=y \ - CONFIG_LWTUNNEL=y \ - CONFIG_LWTUNNEL_BPF=n \ - CONFIG_NET_MPLS_GSO=m \ - CONFIG_MPLS_ROUTING=m \ - CONFIG_MPLS_IPTUNNEL=m - FILES:= \ - $(LINUX_DIR)/net/mpls/mpls_gso.ko \ - $(LINUX_DIR)/net/mpls/mpls_iptunnel.ko \ - $(LINUX_DIR)/net/mpls/mpls_router.ko - AUTOLOAD:=$(call AutoLoad,30,mpls_router mpls_iptunnel mpls_gso) -endef - -define KernelPackage/mpls/description - Kernel support for MPLS -endef - -$(eval $(call KernelPackage,mpls)) - -define KernelPackage/9pnet - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Plan 9 Resource Sharing Support (9P2000) - DEPENDS:=@VIRTIO_SUPPORT - KCONFIG:= \ - CONFIG_NET_9P \ - CONFIG_NET_9P_DEBUG=n \ - CONFIG_NET_9P_XEN=n \ - CONFIG_NET_9P_VIRTIO - FILES:= \ - $(LINUX_DIR)/net/9p/9pnet.ko \ - $(LINUX_DIR)/net/9p/9pnet_virtio.ko - AUTOLOAD:=$(call AutoLoad,29,9pnet 9pnet_virtio) -endef - -define KernelPackage/9pnet/description - Kernel support support for - Plan 9 resource sharing via the 9P2000 protocol. -endef - -$(eval $(call KernelPackage,9pnet)) - - -define KernelPackage/nlmon - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Virtual netlink monitoring device - KCONFIG:=CONFIG_NLMON - FILES:=$(LINUX_DIR)/drivers/net/nlmon.ko - AUTOLOAD:=$(call AutoProbe,nlmon) -endef - -define KernelPackage/nlmon/description - Kernel module which adds a monitoring device for netlink. -endef - -$(eval $(call KernelPackage,nlmon)) - - -define KernelPackage/mdio - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=MDIO (clause 45) PHY support - KCONFIG:=CONFIG_MDIO - HIDDEN:=1 - FILES:=$(LINUX_DIR)/drivers/net/mdio.ko - AUTOLOAD:=$(call AutoLoad,32,mdio) -endef - -define KernelPackage/mdio/description - Kernel modules for MDIO (clause 45) PHY support -endef - -$(eval $(call KernelPackage,mdio)) - -define KernelPackage/macsec - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=IEEE 802.1AE MAC-level encryption (MAC) - DEPENDS:=+kmod-crypto-gcm - KCONFIG:=CONFIG_MACSEC - FILES:=$(LINUX_DIR)/drivers/net/macsec.ko - AUTOLOAD:=$(call AutoLoad,13,macsec) -endef - -define KernelPackage/macsec/description - MACsec is an encryption standard for Ethernet. -endef - -$(eval $(call KernelPackage,macsec)) - - -define KernelPackage/netlink-diag - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Netlink diag support for ss utility - KCONFIG:=CONFIG_NETLINK_DIAG - FILES:=$(LINUX_DIR)/net/netlink/netlink_diag.ko - AUTOLOAD:=$(call AutoLoad,31,netlink-diag) -endef - -define KernelPackage/netlink-diag/description - Netlink diag is a module made for use with iproute2's ss utility -endef - -$(eval $(call KernelPackage,netlink-diag)) - - -define KernelPackage/wireguard - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=WireGuard secure network tunnel - DEPENDS:= \ - +kmod-crypto-lib-blake2s \ - +kmod-crypto-lib-chacha20poly1305 \ - +kmod-crypto-lib-curve25519 \ - +kmod-udptunnel4 \ - +IPV6:kmod-udptunnel6 - KCONFIG:= \ - CONFIG_WIREGUARD \ - CONFIG_WIREGUARD_DEBUG=n - FILES:=$(LINUX_DIR)/drivers/net/wireguard/wireguard.ko - AUTOLOAD:=$(call AutoProbe,wireguard) -endef - -define KernelPackage/wireguard/description - WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes - state-of-the-art cryptography. It aims to be faster, simpler, leaner, and - more useful than IPSec, while avoiding the massive headache. It intends to - be considerably more performant than OpenVPN. WireGuard is designed as a - general purpose VPN for running on embedded interfaces and super computers - alike, fit for many different circumstances. It uses UDP. -endef - -$(eval $(call KernelPackage,wireguard)) diff --git a/feeds/ipq807x/linux/modules/nls.mk b/feeds/ipq807x/linux/modules/nls.mk deleted file mode 100644 index 05fce27bb..000000000 --- a/feeds/ipq807x/linux/modules/nls.mk +++ /dev/null @@ -1,339 +0,0 @@ -# -# Copyright (C) 2006-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define KernelPackage/nls-base - SUBMENU:=Native Language Support - TITLE:=Native Language Support - KCONFIG:=CONFIG_NLS - FILES:=$(LINUX_DIR)/fs/nls/nls_base.ko -endef - -define KernelPackage/nls-base/description - Kernel module for NLS (Native Language Support) -endef - -$(eval $(call KernelPackage,nls-base)) - - -define KernelPackage/nls-cp437 - SUBMENU:=Native Language Support - TITLE:=Codepage 437 (United States, Canada) - KCONFIG:=CONFIG_NLS_CODEPAGE_437 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp437.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp437) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp437/description - Kernel module for NLS Codepage 437 (United States, Canada) -endef - -$(eval $(call KernelPackage,nls-cp437)) - - -define KernelPackage/nls-cp775 - SUBMENU:=Native Language Support - TITLE:=Codepage 775 (Baltic Rim) - KCONFIG:=CONFIG_NLS_CODEPAGE_775 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp775.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp775) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp775/description - Kernel module for NLS Codepage 775 (Baltic Rim) -endef - -$(eval $(call KernelPackage,nls-cp775)) - - -define KernelPackage/nls-cp850 - SUBMENU:=Native Language Support - TITLE:=Codepage 850 (Europe) - KCONFIG:=CONFIG_NLS_CODEPAGE_850 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp850.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp850) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp850/description - Kernel module for NLS Codepage 850 (Europe) -endef - -$(eval $(call KernelPackage,nls-cp850)) - - -define KernelPackage/nls-cp852 - SUBMENU:=Native Language Support - TITLE:=Codepage 852 (Europe) - KCONFIG:=CONFIG_NLS_CODEPAGE_852 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp852.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp852) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp852/description - Kernel module for NLS Codepage 852 (Europe) -endef - -$(eval $(call KernelPackage,nls-cp852)) - - -define KernelPackage/nls-cp862 - SUBMENU:=Native Language Support - TITLE:=Codepage 862 (Hebrew) - KCONFIG:=CONFIG_NLS_CODEPAGE_862 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp862.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp862) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp862/description - Kernel module for NLS Codepage 862 (Hebrew) -endef - -$(eval $(call KernelPackage,nls-cp862)) - - -define KernelPackage/nls-cp864 - SUBMENU:=Native Language Support - TITLE:=Codepage 864 (Arabic) - KCONFIG:=CONFIG_NLS_CODEPAGE_864 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp864.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp864) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp864/description - Kernel module for NLS Codepage 864 (Arabic) -endef - -$(eval $(call KernelPackage,nls-cp864)) - - -define KernelPackage/nls-cp866 - SUBMENU:=Native Language Support - TITLE:=Codepage 866 (Cyrillic) - KCONFIG:=CONFIG_NLS_CODEPAGE_866 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp866.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp866) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp866/description - Kernel module for NLS Codepage 866 (Cyrillic) -endef - -$(eval $(call KernelPackage,nls-cp866)) - - -define KernelPackage/nls-cp932 - SUBMENU:=Native Language Support - TITLE:=Codepage 932 (Japanese) - KCONFIG:=CONFIG_NLS_CODEPAGE_932 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp932.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp932) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp932/description - Kernel module for NLS Codepage 932 (Japanese) -endef - -$(eval $(call KernelPackage,nls-cp932)) - - -define KernelPackage/nls-cp936 - SUBMENU:=Native Language Support - TITLE:=Codepage 936 (Simplified Chinese) - KCONFIG:=CONFIG_NLS_CODEPAGE_936 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp936.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp936) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp936/description - Kernel module for NLS Codepage 936 (Simplified Chinese) -endef - -$(eval $(call KernelPackage,nls-cp936)) - - -define KernelPackage/nls-cp950 - SUBMENU:=Native Language Support - TITLE:=Codepage 950 (Traditional Chinese) - KCONFIG:=CONFIG_NLS_CODEPAGE_950 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp950.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp950) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp950/description - Kernel module for NLS Codepage 950 (Traditional Chinese) -endef - -$(eval $(call KernelPackage,nls-cp950)) - - -define KernelPackage/nls-cp1250 - SUBMENU:=Native Language Support - TITLE:=Codepage 1250 (Eastern Europe) - KCONFIG:=CONFIG_NLS_CODEPAGE_1250 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp1250.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp1250) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp1250/description - Kernel module for NLS Codepage 1250 (Eastern Europe) -endef - -$(eval $(call KernelPackage,nls-cp1250)) - - -define KernelPackage/nls-cp1251 - SUBMENU:=Native Language Support - TITLE:=Codepage 1251 (Russian) - KCONFIG:=CONFIG_NLS_CODEPAGE_1251 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp1251.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp1251) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-cp1251/description - Kernel module for NLS Codepage 1251 (Russian) -endef - -$(eval $(call KernelPackage,nls-cp1251)) - - -define KernelPackage/nls-iso8859-1 - SUBMENU:=Native Language Support - TITLE:=ISO 8859-1 (Latin 1; Western European Languages) - KCONFIG:=CONFIG_NLS_ISO8859_1 - FILES:=$(LINUX_DIR)/fs/nls/nls_iso8859-1.ko - AUTOLOAD:=$(call AutoLoad,25,nls_iso8859-1) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-iso8859-1/description - Kernel module for NLS ISO 8859-1 (Latin 1) -endef - -$(eval $(call KernelPackage,nls-iso8859-1)) - - -define KernelPackage/nls-iso8859-2 - SUBMENU:=Native Language Support - TITLE:=ISO 8859-2 (Latin 2; Central European Languages) - KCONFIG:=CONFIG_NLS_ISO8859_2 - FILES:=$(LINUX_DIR)/fs/nls/nls_iso8859-2.ko - AUTOLOAD:=$(call AutoLoad,25,nls_iso8859-2) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-iso8859-2/description - Kernel module for NLS ISO 8859-2 (Latin 2) -endef - -$(eval $(call KernelPackage,nls-iso8859-2)) - - -define KernelPackage/nls-iso8859-6 - SUBMENU:=Native Language Support - TITLE:=ISO 8859-6 (Arabic) - KCONFIG:=CONFIG_NLS_ISO8859_6 - FILES:=$(LINUX_DIR)/fs/nls/nls_iso8859-6.ko - AUTOLOAD:=$(call AutoLoad,25,nls_iso8859-6) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-iso8859-6/description - Kernel module for NLS ISO 8859-6 (Arabic) -endef - -$(eval $(call KernelPackage,nls-iso8859-6)) - - -define KernelPackage/nls-iso8859-8 - SUBMENU:=Native Language Support - TITLE:=ISO 8859-8, CP1255 (Hebrew) - KCONFIG:=CONFIG_NLS_ISO8859_8 - FILES:=$(LINUX_DIR)/fs/nls/nls_cp1255.ko - AUTOLOAD:=$(call AutoLoad,25,nls_cp1255) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-iso8859-8/description - Kernel module for Hebrew charsets (ISO-8859-8, CP1255) -endef - -$(eval $(call KernelPackage,nls-iso8859-8)) - - -define KernelPackage/nls-iso8859-13 - SUBMENU:=Native Language Support - TITLE:=ISO 8859-13 (Latin 7; Baltic) - KCONFIG:=CONFIG_NLS_ISO8859_13 - FILES:=$(LINUX_DIR)/fs/nls/nls_iso8859-13.ko - AUTOLOAD:=$(call AutoLoad,25,nls_iso8859-13) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-iso8859-13/description - Kernel module for NLS ISO 8859-13 (Latin 7; Baltic) -endef - -$(eval $(call KernelPackage,nls-iso8859-13)) - - -define KernelPackage/nls-iso8859-15 - SUBMENU:=Native Language Support - TITLE:=ISO 8859-15 (Latin 9; Western, with Euro symbol) - KCONFIG:=CONFIG_NLS_ISO8859_15 - FILES:=$(LINUX_DIR)/fs/nls/nls_iso8859-15.ko - AUTOLOAD:=$(call AutoLoad,25,nls_iso8859-15) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-iso8859-15/description - Kernel module for NLS ISO 8859-15 (Latin 9) -endef - -$(eval $(call KernelPackage,nls-iso8859-15)) - - -define KernelPackage/nls-koi8r - SUBMENU:=Native Language Support - TITLE:=KOI8-R (Russian) - KCONFIG:=CONFIG_NLS_KOI8_R - FILES:=$(LINUX_DIR)/fs/nls/nls_koi8-r.ko - AUTOLOAD:=$(call AutoLoad,25,nls_koi8-r) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-koi8r/description - Kernel module for NLS KOI8-R (Russian) -endef - -$(eval $(call KernelPackage,nls-koi8r)) - - -define KernelPackage/nls-utf8 - SUBMENU:=Native Language Support - TITLE:=UTF-8 - KCONFIG:=CONFIG_NLS_UTF8 - FILES:=$(LINUX_DIR)/fs/nls/nls_utf8.ko - AUTOLOAD:=$(call AutoLoad,25,nls_utf8) - $(call AddDepends/nls) -endef - -define KernelPackage/nls-utf8/description - Kernel module for NLS UTF-8 -endef - -$(eval $(call KernelPackage,nls-utf8)) diff --git a/feeds/ipq807x/linux/modules/other.mk b/feeds/ipq807x/linux/modules/other.mk deleted file mode 100644 index 784adcb74..000000000 --- a/feeds/ipq807x/linux/modules/other.mk +++ /dev/null @@ -1,1305 +0,0 @@ -# -# Copyright (C) 2006-2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -OTHER_MENU:=Other modules - -WATCHDOG_DIR:=watchdog - - -define KernelPackage/6lowpan - SUBMENU:=$(OTHER_MENU) - TITLE:=6LoWPAN shared code - KCONFIG:= \ - CONFIG_6LOWPAN \ - CONFIG_6LOWPAN_NHC=n - FILES:=$(LINUX_DIR)/net/6lowpan/6lowpan.ko - AUTOLOAD:=$(call AutoProbe,6lowpan) -endef - -define KernelPackage/6lowpan/description - Shared 6lowpan code for IEEE 802.15.4 and Bluetooth. -endef - -$(eval $(call KernelPackage,6lowpan)) - - -define KernelPackage/bluetooth - SUBMENU:=$(OTHER_MENU) - TITLE:=Bluetooth support - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +kmod-crypto-cmac +kmod-regmap-core +kmod-crypto-ecdh - KCONFIG:= \ - CONFIG_BT \ - CONFIG_BT_BREDR=y \ - CONFIG_BT_DEBUGFS=n \ - CONFIG_BT_LE=y \ - CONFIG_BT_RFCOMM \ - CONFIG_BT_BNEP \ - CONFIG_BT_HCIBTUSB \ - CONFIG_BT_HCIBTUSB_BCM=n \ - CONFIG_BT_HCIUART \ - CONFIG_BT_HCIUART_BCM=n \ - CONFIG_BT_HCIUART_INTEL=n \ - CONFIG_BT_HCIUART_H4 \ - CONFIG_BT_HCIUART_NOKIA=n \ - CONFIG_BT_HIDP - $(call AddDepends/rfkill) - FILES:= \ - $(LINUX_DIR)/net/bluetooth/bluetooth.ko \ - $(LINUX_DIR)/net/bluetooth/rfcomm/rfcomm.ko \ - $(LINUX_DIR)/net/bluetooth/bnep/bnep.ko \ - $(LINUX_DIR)/net/bluetooth/hidp/hidp.ko \ - $(LINUX_DIR)/drivers/bluetooth/hci_uart.ko \ - $(LINUX_DIR)/drivers/bluetooth/btusb.ko \ - $(LINUX_DIR)/drivers/bluetooth/btintel.ko - AUTOLOAD:=$(call AutoProbe,bluetooth rfcomm bnep hidp hci_uart btusb) -endef - -define KernelPackage/bluetooth/description - Kernel support for Bluetooth devices -endef - -$(eval $(call KernelPackage,bluetooth)) - -define KernelPackage/ath3k - SUBMENU:=$(OTHER_MENU) - TITLE:=ATH3K Kernel Module support - DEPENDS:=+kmod-bluetooth +ar3k-firmware - KCONFIG:= \ - CONFIG_BT_ATH3K \ - CONFIG_BT_HCIUART_ATH3K=y - $(call AddDepends/bluetooth) - FILES:= \ - $(LINUX_DIR)/drivers/bluetooth/ath3k.ko - AUTOLOAD:=$(call AutoProbe,ath3k) -endef - -define KernelPackage/ath3k/description - Kernel support for ATH3K Module -endef - -$(eval $(call KernelPackage,ath3k)) - - -define KernelPackage/bluetooth-6lowpan - SUBMENU:=$(OTHER_MENU) - TITLE:=Bluetooth 6LoWPAN support - DEPENDS:=+kmod-6lowpan +kmod-bluetooth - KCONFIG:=CONFIG_BT_6LOWPAN - FILES:=$(LINUX_DIR)/net/bluetooth/bluetooth_6lowpan.ko - AUTOLOAD:=$(call AutoProbe,bluetooth_6lowpan) -endef - -define KernelPackage/bluetooth-6lowpan/description - Kernel support for 6LoWPAN over Bluetooth Low Energy devices -endef - -$(eval $(call KernelPackage,bluetooth-6lowpan)) - - -define KernelPackage/btmrvl - SUBMENU:=$(OTHER_MENU) - TITLE:=Marvell Bluetooth Kernel Module support - DEPENDS:=+kmod-mmc +kmod-bluetooth +mwifiex-sdio-firmware - KCONFIG:= \ - CONFIG_BT_MRVL \ - CONFIG_BT_MRVL_SDIO - $(call AddDepends/bluetooth) - FILES:= \ - $(LINUX_DIR)/drivers/bluetooth/btmrvl.ko \ - $(LINUX_DIR)/drivers/bluetooth/btmrvl_sdio.ko - AUTOLOAD:=$(call AutoProbe,btmrvl btmrvl_sdio) -endef - -define KernelPackage/btmrvl/description - Kernel support for Marvell SDIO Bluetooth Module -endef - -$(eval $(call KernelPackage,btmrvl)) - - -define KernelPackage/dma-buf - SUBMENU:=$(OTHER_MENU) - TITLE:=DMA shared buffer support - HIDDEN:=1 - KCONFIG:=CONFIG_DMA_SHARED_BUFFER - ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") - ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"") - FILES:=$(LINUX_DIR)/drivers/dma-buf/dma-shared-buffer.ko - endif - endif - AUTOLOAD:=$(call AutoLoad,20,dma-shared-buffer) -endef -$(eval $(call KernelPackage,dma-buf)) - - -define KernelPackage/eeprom-93cx6 - SUBMENU:=$(OTHER_MENU) - TITLE:=EEPROM 93CX6 support - KCONFIG:=CONFIG_EEPROM_93CX6 - FILES:=$(LINUX_DIR)/drivers/misc/eeprom/eeprom_93cx6.ko - AUTOLOAD:=$(call AutoLoad,20,eeprom_93cx6) -endef - -define KernelPackage/eeprom-93cx6/description - Kernel module for EEPROM 93CX6 support -endef - -$(eval $(call KernelPackage,eeprom-93cx6)) - - -define KernelPackage/eeprom-at24 - SUBMENU:=$(OTHER_MENU) - TITLE:=EEPROM AT24 support - KCONFIG:=CONFIG_EEPROM_AT24 - DEPENDS:=+kmod-i2c-core +kmod-regmap-i2c - FILES:=$(LINUX_DIR)/drivers/misc/eeprom/at24.ko - AUTOLOAD:=$(call AutoProbe,at24) -endef - -define KernelPackage/eeprom-at24/description - Kernel module for most I2C EEPROMs -endef - -$(eval $(call KernelPackage,eeprom-at24)) - - -define KernelPackage/eeprom-at25 - SUBMENU:=$(OTHER_MENU) - TITLE:=EEPROM AT25 support - KCONFIG:=CONFIG_EEPROM_AT25 - FILES:=$(LINUX_DIR)/drivers/misc/eeprom/at25.ko - AUTOLOAD:=$(call AutoProbe,at25) -endef - -define KernelPackage/eeprom-at25/description - Kernel module for most SPI EEPROMs -endef - -$(eval $(call KernelPackage,eeprom-at25)) - - -define KernelPackage/gpio-dev - SUBMENU:=$(OTHER_MENU) - TITLE:=Generic GPIO char device support - DEPENDS:=@GPIO_SUPPORT - KCONFIG:=CONFIG_GPIO_DEVICE - FILES:=$(LINUX_DIR)/drivers/char/gpio_dev.ko - AUTOLOAD:=$(call AutoLoad,40,gpio_dev) -endef - -define KernelPackage/gpio-dev/description - Kernel module to allows control of GPIO pins using a character device. -endef - -$(eval $(call KernelPackage,gpio-dev)) - - -define KernelPackage/gpio-f7188x - SUBMENU:=$(OTHER_MENU) - TITLE:=Fintek F718xx/F818xx GPIO Support - DEPENDS:=@GPIO_SUPPORT @TARGET_x86 - KCONFIG:=CONFIG_GPIO_F7188X - FILES:=$(LINUX_DIR)/drivers/gpio/gpio-f7188x.ko - AUTOLOAD:=$(call AutoProbe,gpio-f7188x) -endef - -define KernelPackage/gpio-f7188x/description - Kernel module for the GPIOs found on many Fintek Super-IO chips. -endef - -$(eval $(call KernelPackage,gpio-f7188x)) - - -define KernelPackage/gpio-mcp23s08 - SUBMENU:=$(OTHER_MENU) - TITLE:=Microchip MCP23xxx I/O expander - DEPENDS:=@GPIO_SUPPORT +kmod-i2c-core +kmod-regmap-i2c - KCONFIG:= \ - CONFIG_GPIO_MCP23S08 \ - CONFIG_PINCTRL_MCP23S08 - FILES:= \ - $(LINUX_DIR)/drivers/pinctrl/pinctrl-mcp23s08.ko - AUTOLOAD:=$(call AutoLoad,40,pinctrl-mcp23s08) -endef - -define KernelPackage/gpio-mcp23s08/description - Kernel module for Microchip MCP23xxx SPI/I2C I/O expander -endef - -$(eval $(call KernelPackage,gpio-mcp23s08)) - - -define KernelPackage/gpio-nxp-74hc164 - SUBMENU:=$(OTHER_MENU) - TITLE:=NXP 74HC164 GPIO expander support - KCONFIG:=CONFIG_GPIO_74X164 - FILES:=$(LINUX_DIR)/drivers/gpio/gpio-74x164.ko - AUTOLOAD:=$(call AutoProbe,gpio-74x164) -endef - -define KernelPackage/gpio-nxp-74hc164/description - Kernel module for NXP 74HC164 GPIO expander -endef - -$(eval $(call KernelPackage,gpio-nxp-74hc164)) - -define KernelPackage/gpio-pca953x - SUBMENU:=$(OTHER_MENU) - DEPENDS:=@GPIO_SUPPORT +kmod-i2c-core +kmod-regmap-i2c - TITLE:=PCA95xx, TCA64xx, and MAX7310 I/O ports - KCONFIG:=CONFIG_GPIO_PCA953X - FILES:=$(LINUX_DIR)/drivers/gpio/gpio-pca953x.ko - AUTOLOAD:=$(call AutoLoad,55,gpio-pca953x) -endef - -define KernelPackage/gpio-pca953x/description - Kernel module for MAX731{0,2,3,5}, PCA6107, PCA953{4-9}, PCA955{4-7}, - PCA957{4,5} and TCA64{08,16} I2C GPIO expanders -endef - -$(eval $(call KernelPackage,gpio-pca953x)) - -define KernelPackage/gpio-pcf857x - SUBMENU:=$(OTHER_MENU) - DEPENDS:=@GPIO_SUPPORT +kmod-i2c-core - TITLE:=PCX857x, PCA967x and MAX732X I2C GPIO expanders - KCONFIG:=CONFIG_GPIO_PCF857X - FILES:=$(LINUX_DIR)/drivers/gpio/gpio-pcf857x.ko - AUTOLOAD:=$(call AutoLoad,55,gpio-pcf857x) -endef - -define KernelPackage/gpio-pcf857x/description - Kernel module for PCF857x, PCA{85,96}7x, and MAX732[89] I2C GPIO expanders -endef - -$(eval $(call KernelPackage,gpio-pcf857x)) - - -define KernelPackage/gpio-it87 - SUBMENU:=$(OTHER_MENU) - DEPENDS:=@GPIO_SUPPORT @TARGET_x86 - TITLE:=GPIO support for IT87xx Super I/O chips - KCONFIG:=CONFIG_GPIO_IT87 - FILES:=$(LINUX_DIR)/drivers/gpio/gpio-it87.ko - AUTOLOAD:=$(call AutoLoad,25,gpio-it87,1) -endef - -define KernelPackage/gpio-it87/description - This driver is tested with ITE IT8728 and IT8732 Super I/O chips, and - supports the IT8761E, IT8613, IT8620E, and IT8628E Super I/O chips as - well. -endef - -$(eval $(call KernelPackage,gpio-it87)) - - -define KernelPackage/gpio-amd-fch - SUBMENU:=$(OTHER_MENU) - DEPENDS:=@GPIO_SUPPORT @TARGET_x86 - TITLE:=GPIO support for AMD Fusion Controller Hub (G-series SOCs) - KCONFIG:=CONFIG_GPIO_AMD_FCH - FILES:=$(LINUX_DIR)/drivers/gpio/gpio-amd-fch.ko - AUTOLOAD:=$(call AutoLoad,25,gpio-amd-fch,1) -endef - -define KernelPackage/gpio-amd-fch/description - This option enables driver for GPIO on AMDs Fusion Controller Hub, - as found on G-series SOCs (eg. GX-412TC) -endef - -$(eval $(call KernelPackage,gpio-amd-fch)) - - -define KernelPackage/ppdev - SUBMENU:=$(OTHER_MENU) - TITLE:=Parallel port support - KCONFIG:= \ - CONFIG_PARPORT \ - CONFIG_PPDEV - FILES:= \ - $(LINUX_DIR)/drivers/parport/parport.ko \ - $(LINUX_DIR)/drivers/char/ppdev.ko - AUTOLOAD:=$(call AutoLoad,50,parport ppdev) -endef - -$(eval $(call KernelPackage,ppdev)) - - -define KernelPackage/parport-pc - SUBMENU:=$(OTHER_MENU) - TITLE:=Parallel port interface (PC-style) support - DEPENDS:=+kmod-ppdev - KCONFIG:= \ - CONFIG_KS0108=n \ - CONFIG_PARPORT_PC \ - CONFIG_PARPORT_1284=y \ - CONFIG_PARPORT_PC_FIFO=y \ - CONFIG_PARPORT_PC_PCMCIA=n \ - CONFIG_PARPORT_PC_SUPERIO=y \ - CONFIG_PARPORT_SERIAL=n \ - CONFIG_PARIDE=n \ - CONFIG_SCSI_IMM=n \ - CONFIG_SCSI_PPA=n - FILES:= \ - $(LINUX_DIR)/drivers/parport/parport_pc.ko - AUTOLOAD:=$(call AutoLoad,51,parport_pc) -endef - -$(eval $(call KernelPackage,parport-pc)) - - -define KernelPackage/lp - SUBMENU:=$(OTHER_MENU) - TITLE:=Parallel port line printer device support - DEPENDS:=+kmod-ppdev - KCONFIG:= \ - CONFIG_PRINTER - FILES:= \ - $(LINUX_DIR)/drivers/char/lp.ko - AUTOLOAD:=$(call AutoLoad,52,lp) -endef - -$(eval $(call KernelPackage,lp)) - - -define KernelPackage/mmc - SUBMENU:=$(OTHER_MENU) - TITLE:=MMC/SD Card Support - DEPENDS:=@!TARGET_uml - KCONFIG:= \ - CONFIG_MMC \ - CONFIG_MMC_BLOCK \ - CONFIG_MMC_DEBUG=n \ - CONFIG_MMC_UNSAFE_RESUME=n \ - CONFIG_MMC_BLOCK_BOUNCE=y \ - CONFIG_MMC_TIFM_SD=n \ - CONFIG_MMC_WBSD=n \ - CONFIG_SDIO_UART=n - FILES:= \ - $(LINUX_DIR)/drivers/mmc/core/mmc_core.ko \ - $(LINUX_DIR)/drivers/mmc/core/mmc_block.ko - AUTOLOAD:=$(call AutoProbe,mmc_core mmc_block,1) -endef - -define KernelPackage/mmc/description - Kernel support for MMC/SD cards -endef - -$(eval $(call KernelPackage,mmc)) - - -define KernelPackage/mvsdio - SUBMENU:=$(OTHER_MENU) - TITLE:=Marvell MMC/SD/SDIO host driver - DEPENDS:=+kmod-mmc @TARGET_kirkwood - KCONFIG:= CONFIG_MMC_MVSDIO - FILES:= \ - $(LINUX_DIR)/drivers/mmc/host/mvsdio.ko - AUTOLOAD:=$(call AutoProbe,mvsdio,1) -endef - -define KernelPackage/mvsdio/description - Kernel support for the Marvell SDIO host driver. -endef - -$(eval $(call KernelPackage,mvsdio)) - - -define KernelPackage/sdhci - SUBMENU:=$(OTHER_MENU) - TITLE:=Secure Digital Host Controller Interface support - DEPENDS:=+kmod-mmc - KCONFIG:= \ - CONFIG_MMC_SDHCI \ - CONFIG_MMC_SDHCI_PLTFM \ - CONFIG_MMC_SDHCI_PCI=n - FILES:= \ - $(LINUX_DIR)/drivers/mmc/host/sdhci.ko \ - $(LINUX_DIR)/drivers/mmc/host/sdhci-pltfm.ko - - AUTOLOAD:=$(call AutoProbe,sdhci-pltfm,1) -endef - -define KernelPackage/sdhci/description - Kernel support for SDHCI Hosts -endef - -$(eval $(call KernelPackage,sdhci)) - - -define KernelPackage/rfkill - SUBMENU:=$(OTHER_MENU) - TITLE:=RF switch subsystem support - DEPENDS:=@USE_RFKILL +kmod-input-core - KCONFIG:= \ - CONFIG_RFKILL_FULL \ - CONFIG_RFKILL_INPUT=y \ - CONFIG_RFKILL_LEDS=y - FILES:= \ - $(LINUX_DIR)/net/rfkill/rfkill.ko - AUTOLOAD:=$(call AutoLoad,20,rfkill) -endef - -define KernelPackage/rfkill/description - Say Y here if you want to have control over RF switches - found on many WiFi and Bluetooth cards -endef - -$(eval $(call KernelPackage,rfkill)) - - -define KernelPackage/softdog - SUBMENU:=$(OTHER_MENU) - TITLE:=Software watchdog driver - KCONFIG:=CONFIG_SOFT_WATCHDOG \ - CONFIG_SOFT_WATCHDOG_PRETIMEOUT=n - FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/softdog.ko - AUTOLOAD:=$(call AutoLoad,50,softdog,1) -endef - -define KernelPackage/softdog/description - Software watchdog driver -endef - -$(eval $(call KernelPackage,softdog)) - - -define KernelPackage/ssb - SUBMENU:=$(OTHER_MENU) - TITLE:=Silicon Sonics Backplane glue code - DEPENDS:=@PCI_SUPPORT @!TARGET_bcm47xx @!TARGET_bcm63xx - KCONFIG:=\ - CONFIG_SSB \ - CONFIG_SSB_B43_PCI_BRIDGE=y \ - CONFIG_SSB_DRIVER_MIPS=n \ - CONFIG_SSB_DRIVER_PCICORE=y \ - CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y \ - CONFIG_SSB_PCIHOST=y \ - CONFIG_SSB_PCIHOST_POSSIBLE=y \ - CONFIG_SSB_POSSIBLE=y \ - CONFIG_SSB_SPROM=y \ - CONFIG_SSB_SILENT=y - FILES:=$(LINUX_DIR)/drivers/ssb/ssb.ko - AUTOLOAD:=$(call AutoLoad,18,ssb,1) -endef - -define KernelPackage/ssb/description - Silicon Sonics Backplane glue code. -endef - -$(eval $(call KernelPackage,ssb)) - - -define KernelPackage/bcma - SUBMENU:=$(OTHER_MENU) - TITLE:=BCMA support - DEPENDS:=@PCI_SUPPORT @!TARGET_bcm47xx @!TARGET_bcm53xx - KCONFIG:=\ - CONFIG_BCMA \ - CONFIG_BCMA_POSSIBLE=y \ - CONFIG_BCMA_BLOCKIO=y \ - CONFIG_BCMA_HOST_PCI_POSSIBLE=y \ - CONFIG_BCMA_HOST_PCI=y \ - CONFIG_BCMA_HOST_SOC=n \ - CONFIG_BCMA_DRIVER_MIPS=n \ - CONFIG_BCMA_DRIVER_PCI_HOSTMODE=n \ - CONFIG_BCMA_DRIVER_GMAC_CMN=n \ - CONFIG_BCMA_DEBUG=n - FILES:=$(LINUX_DIR)/drivers/bcma/bcma.ko - AUTOLOAD:=$(call AutoLoad,29,bcma) -endef - -define KernelPackage/bcma/description - Bus driver for Broadcom specific Advanced Microcontroller Bus Architecture -endef - -$(eval $(call KernelPackage,bcma)) - - -define KernelPackage/rtc-ds1307 - SUBMENU:=$(OTHER_MENU) - TITLE:=Dallas/Maxim DS1307 (and compatible) RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core +kmod-regmap-i2c +kmod-hwmon-core - KCONFIG:=CONFIG_RTC_DRV_DS1307 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-ds1307.ko - AUTOLOAD:=$(call AutoProbe,rtc-ds1307) -endef - -define KernelPackage/rtc-ds1307/description - Kernel module for Dallas/Maxim DS1307/DS1337/DS1338/DS1340/DS1388/DS3231, - Epson RX-8025 and various other compatible RTC chips connected via I2C. -endef - -$(eval $(call KernelPackage,rtc-ds1307)) - - -define KernelPackage/rtc-ds1374 - SUBMENU:=$(OTHER_MENU) - TITLE:=Dallas/Maxim DS1374 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_DS1374 \ - CONFIG_RTC_DRV_DS1374_WDT=n \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-ds1374.ko - AUTOLOAD:=$(call AutoProbe,rtc-ds1374) -endef - -define KernelPackage/rtc-ds1374/description - Kernel module for Dallas/Maxim DS1374. -endef - -$(eval $(call KernelPackage,rtc-ds1374)) - - -define KernelPackage/rtc-ds1672 - SUBMENU:=$(OTHER_MENU) - TITLE:=Dallas/Maxim DS1672 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_DS1672 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-ds1672.ko - AUTOLOAD:=$(call AutoProbe,rtc-ds1672) -endef - -define KernelPackage/rtc-ds1672/description - Kernel module for Dallas/Maxim DS1672 RTC. -endef - -$(eval $(call KernelPackage,rtc-ds1672)) - - -define KernelPackage/rtc-em3027 - SUBMENU:=$(OTHER_MENU) - TITLE:=Microelectronic EM3027 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_EM3027 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-em3027.ko - AUTOLOAD:=$(call AutoProbe,rtc-em3027) -endef - -define KernelPackage/rtc-em3027/description - Kernel module for Microelectronic EM3027 RTC. -endef - -$(eval $(call KernelPackage,rtc-em3027)) - - -define KernelPackage/rtc-isl1208 - SUBMENU:=$(OTHER_MENU) - TITLE:=Intersil ISL1208 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_ISL1208 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-isl1208.ko - AUTOLOAD:=$(call AutoProbe,rtc-isl1208) -endef - -define KernelPackage/rtc-isl1208/description - Kernel module for Intersil ISL1208 RTC. -endef - -$(eval $(call KernelPackage,rtc-isl1208)) - - -define KernelPackage/rtc-pcf8563 - SUBMENU:=$(OTHER_MENU) - TITLE:=Philips PCF8563/Epson RTC8564 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_PCF8563 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-pcf8563.ko - AUTOLOAD:=$(call AutoProbe,rtc-pcf8563) -endef - -define KernelPackage/rtc-pcf8563/description - Kernel module for Philips PCF8563 RTC chip. - The Epson RTC8564 should work as well. -endef - -$(eval $(call KernelPackage,rtc-pcf8563)) - - -define KernelPackage/rtc-pcf2123 - SUBMENU:=$(OTHER_MENU) - TITLE:=Philips PCF2123 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-regmap-spi - KCONFIG:=CONFIG_RTC_DRV_PCF2123 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-pcf2123.ko - AUTOLOAD:=$(call AutoProbe,rtc-pcf2123) -endef - -define KernelPackage/rtc-pcf2123/description - Kernel module for Philips PCF2123 RTC chip -endef - -$(eval $(call KernelPackage,rtc-pcf2123)) - -define KernelPackage/rtc-pcf2127 - SUBMENU:=$(OTHER_MENU) - TITLE:=NXP PCF2127 and PCF2129 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core +kmod-regmap-spi - KCONFIG:=CONFIG_RTC_DRV_PCF2127 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-pcf2127.ko - AUTOLOAD:=$(call AutoProbe,rtc-pcf2127) -endef - -define KernelPackage/rtc-pcf2127/description - Kernel module for NXP PCF2127 and PCF2129 RTC chip -endef - -$(eval $(call KernelPackage,rtc-pcf2127)) - -define KernelPackage/rtc-pt7c4338 - SUBMENU:=$(OTHER_MENU) - TITLE:=Pericom PT7C4338 RTC support - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_PT7C4338 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-pt7c4338.ko - AUTOLOAD:=$(call AutoProbe,rtc-pt7c4338) -endef - -define KernelPackage/rtc-pt7c4338/description - Kernel module for Pericom PT7C4338 i2c RTC chip -endef - -$(eval $(call KernelPackage,rtc-pt7c4338)) - -define KernelPackage/rtc-rs5c372a - SUBMENU:=$(OTHER_MENU) - TITLE:=Ricoh R2025S/D, RS5C372A/B, RV5C386, RV5C387A - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_RS5C372 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-rs5c372.ko - AUTOLOAD:=$(call AutoLoad,50,rtc-rs5c372,1) -endef - -define KernelPackage/rtc-rs5c372a/description - Kernel module for Ricoh R2025S/D, RS5C372A/B, RV5C386, RV5C387A RTC on chip module -endef - -$(eval $(call KernelPackage,rtc-rs5c372a)) - -define KernelPackage/rtc-rx8025 - SUBMENU:=$(OTHER_MENU) - TITLE:=Epson RX-8025 / RX-8035 - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_RX8025 \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-rx8025.ko - AUTOLOAD:=$(call AutoLoad,50,rtc-rx8025,1) -endef - -define KernelPackage/rtc-rx8025/description - Kernel module for Epson RX-8025 and RX-8035 I2C RTC chip -endef - -$(eval $(call KernelPackage,rtc-rx8025)) - -define KernelPackage/rtc-s35390a - SUBMENU:=$(OTHER_MENU) - TITLE:=Seico S-35390A - DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core - KCONFIG:=CONFIG_RTC_DRV_S35390A \ - CONFIG_RTC_CLASS=y - FILES:=$(LINUX_DIR)/drivers/rtc/rtc-s35390a.ko - AUTOLOAD:=$(call AutoLoad,50,rtc-s35390a,1) -endef - -define KernelPackage/rtc-s35390a/description - Kernel module for Seiko Instruments S-35390A I2C RTC chip -endef - -$(eval $(call KernelPackage,rtc-s35390a)) - - -define KernelPackage/mtdtests - SUBMENU:=$(OTHER_MENU) - TITLE:=MTD subsystem tests - KCONFIG:=CONFIG_MTD_TESTS - FILES:=\ - $(LINUX_DIR)/drivers/mtd/tests/mtd_nandecctest.ko \ - $(LINUX_DIR)/drivers/mtd/tests/mtd_oobtest.ko \ - $(LINUX_DIR)/drivers/mtd/tests/mtd_pagetest.ko \ - $(LINUX_DIR)/drivers/mtd/tests/mtd_readtest.ko \ - $(LINUX_DIR)/drivers/mtd/tests/mtd_speedtest.ko \ - $(LINUX_DIR)/drivers/mtd/tests/mtd_stresstest.ko \ - $(LINUX_DIR)/drivers/mtd/tests/mtd_subpagetest.ko \ - $(LINUX_DIR)/drivers/mtd/tests/mtd_torturetest.ko -endef - -define KernelPackage/mtdtests/description - Kernel modules for MTD subsystem/driver testing -endef - -$(eval $(call KernelPackage,mtdtests)) - - -define KernelPackage/mtdoops - SUBMENU:=$(OTHER_MENU) - TITLE:=Log panic/oops to an MTD buffer - KCONFIG:=CONFIG_MTD_OOPS - FILES:=$(LINUX_DIR)/drivers/mtd/mtdoops.ko -endef - -define KernelPackage/mtdoops/description - Kernel modules for Log panic/oops to an MTD buffer -endef - -$(eval $(call KernelPackage,mtdoops)) - - -define KernelPackage/mtdram - SUBMENU:=$(OTHER_MENU) - TITLE:=Test MTD driver using RAM - KCONFIG:=CONFIG_MTD_MTDRAM \ - CONFIG_MTDRAM_TOTAL_SIZE=4096 \ - CONFIG_MTDRAM_ERASE_SIZE=128 - FILES:=$(LINUX_DIR)/drivers/mtd/devices/mtdram.ko -endef - -define KernelPackage/mtdram/description - Test MTD driver using RAM -endef - -$(eval $(call KernelPackage,mtdram)) - - -define KernelPackage/serial-8250 - SUBMENU:=$(OTHER_MENU) - TITLE:=8250 UARTs - KCONFIG:= CONFIG_SERIAL_8250 \ - CONFIG_SERIAL_8250_PCI \ - CONFIG_SERIAL_8250_NR_UARTS=16 \ - CONFIG_SERIAL_8250_RUNTIME_UARTS=16 \ - CONFIG_SERIAL_8250_EXTENDED=y \ - CONFIG_SERIAL_8250_MANY_PORTS=y \ - CONFIG_SERIAL_8250_SHARE_IRQ=y \ - CONFIG_SERIAL_8250_DETECT_IRQ=n \ - CONFIG_SERIAL_8250_RSA=n - FILES:= \ - $(LINUX_DIR)/drivers/tty/serial/8250/8250.ko \ - $(LINUX_DIR)/drivers/tty/serial/8250/8250_base.ko \ - $(if $(CONFIG_PCI),$(LINUX_DIR)/drivers/tty/serial/8250/8250_pci.ko) \ - $(if $(CONFIG_GPIOLIB),$(LINUX_DIR)/drivers/tty/serial/serial_mctrl_gpio.ko) - AUTOLOAD:=$(call AutoProbe,8250 8250_base 8250_pci) -endef - -define KernelPackage/serial-8250/description - Kernel module for 8250 UART based serial ports -endef - -$(eval $(call KernelPackage,serial-8250)) - - -define KernelPackage/serial-8250-exar - SUBMENU:=$(OTHER_MENU) - TITLE:=Exar 8250 UARTs - KCONFIG:= CONFIG_SERIAL_8250_EXAR - FILES:=$(LINUX_DIR)/drivers/tty/serial/8250/8250_exar.ko - AUTOLOAD:=$(call AutoProbe,8250 8250_base 8250_exar) - DEPENDS:=+kmod-serial-8250 -endef - -define KernelPackage/serial-8250-exar/description - Kernel module for Exar serial ports -endef - -$(eval $(call KernelPackage,serial-8250-exar)) - - -define KernelPackage/regmap-core - SUBMENU:=$(OTHER_MENU) - TITLE:=Generic register map support - HIDDEN:=1 - KCONFIG:=CONFIG_REGMAP -ifneq ($(wildcard $(LINUX_DIR)/drivers/base/regmap/regmap-core.ko),) - FILES:=$(LINUX_DIR)/drivers/base/regmap/regmap-core.ko -endif -endef - -define KernelPackage/regmap-core/description - Generic register map support -endef - -$(eval $(call KernelPackage,regmap-core)) - - -define KernelPackage/regmap-spi - SUBMENU:=$(OTHER_MENU) - TITLE:=SPI register map support - DEPENDS:=+kmod-regmap-core - HIDDEN:=1 - KCONFIG:=CONFIG_REGMAP_SPI \ - CONFIG_SPI=y - FILES:=$(LINUX_DIR)/drivers/base/regmap/regmap-spi.ko -endef - -define KernelPackage/regmap-spi/description - SPI register map support -endef - -$(eval $(call KernelPackage,regmap-spi)) - - -define KernelPackage/regmap-i2c - SUBMENU:=$(OTHER_MENU) - TITLE:=I2C register map support - DEPENDS:=+kmod-regmap-core +kmod-i2c-core - HIDDEN:=1 - KCONFIG:=CONFIG_REGMAP_I2C - FILES:=$(LINUX_DIR)/drivers/base/regmap/regmap-i2c.ko -endef - -define KernelPackage/regmap-i2c/description - I2C register map support -endef - -$(eval $(call KernelPackage,regmap-i2c)) - - -define KernelPackage/regmap-mmio - SUBMENU:=$(OTHER_MENU) - TITLE:=MMIO register map support - DEPENDS:=+kmod-regmap-core - HIDDEN:=1 - KCONFIG:=CONFIG_REGMAP_MMIO - FILES:=$(LINUX_DIR)/drivers/base/regmap/regmap-mmio.ko -endef - -define KernelPackage/regmap-mmio/description - MMIO register map support -endef - -$(eval $(call KernelPackage,regmap-mmio)) - - -define KernelPackage/ikconfig - SUBMENU:=$(OTHER_MENU) - TITLE:=Kernel configuration via /proc/config.gz - KCONFIG:=CONFIG_IKCONFIG \ - CONFIG_IKCONFIG_PROC=y - FILES:=$(LINUX_DIR)/kernel/configs.ko - AUTOLOAD:=$(call AutoLoad,70,configs) -endef - -define KernelPackage/ikconfig/description - Kernel configuration via /proc/config.gz -endef - -$(eval $(call KernelPackage,ikconfig)) - - -define KernelPackage/zram - SUBMENU:=$(OTHER_MENU) - TITLE:=ZRAM - DEPENDS:=+kmod-lib-lzo - KCONFIG:= \ - CONFIG_ZSMALLOC \ - CONFIG_ZRAM \ - CONFIG_ZRAM_DEBUG=n \ - CONFIG_PGTABLE_MAPPING=n \ - CONFIG_ZRAM_WRITEBACK=n \ - CONFIG_ZSMALLOC_STAT=n - FILES:= \ - $(LINUX_DIR)/mm/zsmalloc.ko \ - $(LINUX_DIR)/drivers/block/zram/zram.ko - AUTOLOAD:=$(call AutoLoad,20,zsmalloc zram) -endef - -define KernelPackage/zram/description - Compressed RAM block device support -endef - -$(eval $(call KernelPackage,zram)) - - -define KernelPackage/pps - SUBMENU:=$(OTHER_MENU) - TITLE:=PPS support - KCONFIG:=CONFIG_PPS - FILES:=$(LINUX_DIR)/drivers/pps/pps_core.ko - AUTOLOAD:=$(call AutoLoad,17,pps_core,1) -endef - -define KernelPackage/pps/description - PPS (Pulse Per Second) is a special pulse provided by some GPS - antennae. Userland can use it to get a high-precision time - reference. -endef - -$(eval $(call KernelPackage,pps)) - - -define KernelPackage/pps-gpio - SUBMENU:=$(OTHER_MENU) - TITLE:=PPS client using GPIO - DEPENDS:=+kmod-pps - KCONFIG:=CONFIG_PPS_CLIENT_GPIO - FILES:=$(LINUX_DIR)/drivers/pps/clients/pps-gpio.ko - AUTOLOAD:=$(call AutoLoad,18,pps-gpio,1) -endef - -define KernelPackage/pps-gpio/description - Support for a PPS source using GPIO. To be useful you must - also register a platform device specifying the GPIO pin and - other options, usually in your board setup. -endef - -$(eval $(call KernelPackage,pps-gpio)) - - -define KernelPackage/pps-ldisc - SUBMENU:=$(OTHER_MENU) - TITLE:=PPS line discipline - DEPENDS:=+kmod-pps - KCONFIG:=CONFIG_PPS_CLIENT_LDISC - FILES:=$(LINUX_DIR)/drivers/pps/clients/pps-ldisc.ko - AUTOLOAD:=$(call AutoLoad,18,pps-ldisc,1) -endef - -define KernelPackage/pps-ldisc/description - Support for a PPS source connected with the CD (Carrier - Detect) pin of your serial port. -endef - -$(eval $(call KernelPackage,pps-ldisc)) - - -define KernelPackage/ptp - SUBMENU:=$(OTHER_MENU) - TITLE:=PTP clock support - DEPENDS:=+kmod-pps - KCONFIG:= \ - CONFIG_PTP_1588_CLOCK \ - CONFIG_NET_PTP_CLASSIFY=y - FILES:=$(LINUX_DIR)/drivers/ptp/ptp.ko - AUTOLOAD:=$(call AutoLoad,18,ptp,1) -endef - -define KernelPackage/ptp/description - The IEEE 1588 standard defines a method to precisely - synchronize distributed clocks over Ethernet networks. -endef - -$(eval $(call KernelPackage,ptp)) - - -define KernelPackage/ptp-gianfar - SUBMENU:=$(OTHER_MENU) - TITLE:=Freescale Gianfar PTP support - DEPENDS:=@TARGET_mpc85xx +kmod-ptp @LINUX_4_14 - KCONFIG:=CONFIG_PTP_1588_CLOCK_GIANFAR - FILES:=$(LINUX_DIR)/drivers/net/ethernet/freescale/gianfar_ptp.ko - AUTOLOAD:=$(call AutoProbe,gianfar_ptp) -endef - -define KernelPackage/ptp-gianfar/description - Kernel module for IEEE 1588 support for Freescale - Gianfar Ethernet drivers -endef - -$(eval $(call KernelPackage,ptp-gianfar)) - -define KernelPackage/ptp-qoriq - SUBMENU:=$(OTHER_MENU) - TITLE:=Freescale QorIQ PTP support - DEPENDS:=@TARGET_mpc85xx +kmod-ptp @!LINUX_4_14 - KCONFIG:=CONFIG_PTP_1588_CLOCK_QORIQ - FILES:=$(LINUX_DIR)/drivers/ptp/ptp-qoriq.ko - AUTOLOAD:=$(call AutoProbe,ptp-qoriq) -endef - - -define KernelPackage/ptp-qoriq/description - Kernel module for IEEE 1588 support for Freescale - QorIQ Ethernet drivers -endef - -$(eval $(call KernelPackage,ptp-qoriq)) - -define KernelPackage/random-core - SUBMENU:=$(OTHER_MENU) - TITLE:=Hardware Random Number Generator Core support - KCONFIG:=CONFIG_HW_RANDOM - FILES:=$(LINUX_DIR)/drivers/char/hw_random/rng-core.ko -endef - -define KernelPackage/random-core/description - Kernel module for the HW random number generator core infrastructure -endef - -$(eval $(call KernelPackage,random-core)) - - -define KernelPackage/random-tpm - SUBMENU:=$(OTHER_MENU) - TITLE:=Hardware Random Number Generator TPM support - KCONFIG:=CONFIG_HW_RANDOM_TPM - FILES:=$(LINUX_DIR)/drivers/char/hw_random/tpm-rng.ko - DEPENDS:= +kmod-random-core +kmod-tpm @LINUX_4_14 - AUTOLOAD:=$(call AutoProbe,tpm-rng) -endef - -define KernelPackage/random-tpm/description - Kernel module for the Random Number Generator - in the Trusted Platform Module. -endef - -$(eval $(call KernelPackage,random-tpm)) - -define KernelPackage/thermal - SUBMENU:=$(OTHER_MENU) - TITLE:=Thermal driver - DEPENDS:=+kmod-hwmon-core - HIDDEN:=1 - KCONFIG:= \ - CONFIG_THERMAL=y \ - CONFIG_THERMAL_OF=y \ - CONFIG_CPU_THERMAL=y \ - CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y \ - CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE=n \ - CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE=n \ - CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 \ - CONFIG_THERMAL_GOV_FAIR_SHARE=n \ - CONFIG_THERMAL_GOV_STEP_WISE=y \ - CONFIG_THERMAL_GOV_USER_SPACE=n \ - CONFIG_THERMAL_HWMON=y \ - CONFIG_THERMAL_EMULATION=n -endef - -define KernelPackage/thermal/description - Thermal driver offers a generic mechanism for thermal management. - Usually it's made up of one or more thermal zone and cooling device. -endef - -$(eval $(call KernelPackage,thermal)) - - -define KernelPackage/gpio-beeper - SUBMENU:=$(OTHER_MENU) - TITLE:=GPIO beeper support - DEPENDS:=+kmod-input-core - KCONFIG:= \ - CONFIG_INPUT_MISC=y \ - CONFIG_INPUT_GPIO_BEEPER - FILES:= \ - $(LINUX_DIR)/drivers/input/misc/gpio-beeper.ko - AUTOLOAD:=$(call AutoLoad,50,gpio-beeper) -endef - -define KernelPackage/gpio-beeper/description - This enables playing beeps through an GPIO-connected buzzer -endef - -$(eval $(call KernelPackage,gpio-beeper)) - - -define KernelPackage/echo - SUBMENU:=$(OTHER_MENU) - TITLE:=Line Echo Canceller - KCONFIG:=CONFIG_ECHO - FILES:=$(LINUX_DIR)/drivers/misc/echo/echo.ko - AUTOLOAD:=$(call AutoLoad,50,echo) -endef - -define KernelPackage/echo/description - This driver provides line echo cancelling support for mISDN and - DAHDI drivers -endef - -$(eval $(call KernelPackage,echo)) - - -define KernelPackage/keys-encrypted - SUBMENU:=$(OTHER_MENU) - TITLE:=encrypted keys on kernel keyring - DEPENDS:=@KERNEL_KEYS +kmod-crypto-cbc +kmod-crypto-hmac +kmod-crypto-rng \ - +kmod-crypto-sha256 +kmod-keys-trusted - KCONFIG:=CONFIG_ENCRYPTED_KEYS - FILES:=$(LINUX_DIR)/security/keys/encrypted-keys/encrypted-keys.ko - AUTOLOAD:=$(call AutoLoad,01,encrypted-keys,1) -endef - -define KernelPackage/keys-encrypted/description - This module provides support for create/encrypting/decrypting keys - in the kernel. Encrypted keys are kernel generated random numbers, - which are encrypted/decrypted with a 'master' symmetric key. The - 'master' key can be either a trusted-key or user-key type. - Userspace only ever sees/stores encrypted blobs. -endef - -$(eval $(call KernelPackage,keys-encrypted)) - - -define KernelPackage/keys-trusted - SUBMENU:=$(OTHER_MENU) - TITLE:=TPM trusted keys on kernel keyring - DEPENDS:=@KERNEL_KEYS +kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha1 +kmod-tpm - KCONFIG:=CONFIG_TRUSTED_KEYS - FILES:=$(LINUX_DIR)/security/keys/trusted.ko - AUTOLOAD:=$(call AutoLoad,01,trusted-keys,1) -endef - -define KernelPackage/keys-trusted/description - This module provides support for creating, sealing, and unsealing - keys in the kernel. Trusted keys are random number symmetric keys, - generated and RSA-sealed by the TPM. The TPM only unseals the keys, - if the boot PCRs and other criteria match. Userspace will only ever - see encrypted blobs. -endef - -$(eval $(call KernelPackage,keys-trusted)) - - -define KernelPackage/tpm - SUBMENU:=$(OTHER_MENU) - TITLE:=TPM Hardware Support - DEPENDS:= +!LINUX_4_14:kmod-random-core - KCONFIG:= CONFIG_TCG_TPM - FILES:= $(LINUX_DIR)/drivers/char/tpm/tpm.ko - AUTOLOAD:=$(call AutoLoad,10,tpm,1) -endef - -define KernelPackage/tpm/description - This enables TPM Hardware Support. -endef - -$(eval $(call KernelPackage,tpm)) - -define KernelPackage/tpm-tis - SUBMENU:=$(OTHER_MENU) - TITLE:=TPM TIS 1.2 Interface / TPM 2.0 FIFO Interface - DEPENDS:= @TARGET_x86 +kmod-tpm - KCONFIG:= CONFIG_TCG_TIS - FILES:= \ - $(LINUX_DIR)/drivers/char/tpm/tpm_tis.ko \ - $(LINUX_DIR)/drivers/char/tpm/tpm_tis_core.ko - AUTOLOAD:=$(call AutoLoad,20,tpm_tis,1) -endef - -define KernelPackage/tpm-tis/description - If you have a TPM security chip that is compliant with the - TCG TIS 1.2 TPM specification (TPM1.2) or the TCG PTP FIFO - specification (TPM2.0) say Yes and it will be accessible from - within Linux. -endef - -$(eval $(call KernelPackage,tpm-tis)) - -define KernelPackage/tpm-i2c-atmel - SUBMENU:=$(OTHER_MENU) - TITLE:=TPM I2C Atmel Support - DEPENDS:= +kmod-tpm +kmod-i2c-core - KCONFIG:= CONFIG_TCG_TIS_I2C_ATMEL - FILES:= $(LINUX_DIR)/drivers/char/tpm/tpm_i2c_atmel.ko - AUTOLOAD:=$(call AutoLoad,40,tpm_i2c_atmel,1) -endef - -define KernelPackage/tpm-i2c-atmel/description - This enables the TPM Interface Specification 1.2 Interface (I2C - Atmel) -endef - -$(eval $(call KernelPackage,tpm-i2c-atmel)) - -define KernelPackage/tpm-i2c-infineon - SUBMENU:=$(OTHER_MENU) - TITLE:= TPM I2C Infineon driver - DEPENDS:= +kmod-tpm +kmod-i2c-core - KCONFIG:= CONFIG_TCG_TIS_I2C_INFINEON - FILES:= $(LINUX_DIR)/drivers/char/tpm/tpm_i2c_infineon.ko - AUTOLOAD:= $(call AutoLoad,40,tpm_i2c_infineon,1) -endef - -define KernelPackage/tpm-i2c-infineon/description - This enables the TPM Interface Specification 1.2 Interface (I2C - Infineon) -endef - -$(eval $(call KernelPackage,tpm-i2c-infineon)) - - -define KernelPackage/w83627hf-wdt - SUBMENU:=$(OTHER_MENU) - TITLE:=Winbond 83627HF Watchdog Timer - KCONFIG:=CONFIG_W83627HF_WDT - FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/w83627hf_wdt.ko - AUTOLOAD:=$(call AutoLoad,50,w83627hf-wdt,1) -endef - -define KernelPackage/w83627hf-wdt/description - Kernel module for Winbond 83627HF Watchdog Timer -endef - -$(eval $(call KernelPackage,w83627hf-wdt)) - - -define KernelPackage/itco-wdt - SUBMENU:=$(OTHER_MENU) - TITLE:=Intel iTCO Watchdog Timer - KCONFIG:=CONFIG_ITCO_WDT \ - CONFIG_ITCO_VENDOR_SUPPORT=y - FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/iTCO_wdt.ko \ - $(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/iTCO_vendor_support.ko - AUTOLOAD:=$(call AutoLoad,50,iTCO_vendor_support iTCO_wdt,1) -endef - -define KernelPackage/itco-wdt/description - Kernel module for Intel iTCO Watchdog Timer -endef - -$(eval $(call KernelPackage,itco-wdt)) - - -define KernelPackage/it87-wdt - SUBMENU:=$(OTHER_MENU) - TITLE:=ITE IT87 Watchdog Timer - KCONFIG:=CONFIG_IT87_WDT - FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/it87_wdt.ko - AUTOLOAD:=$(call AutoLoad,50,it87-wdt,1) - MODPARAMS.it87-wdt:= \ - nogameport=1 \ - nocir=1 -endef - -define KernelPackage/it87-wdt/description - Kernel module for ITE IT87 Watchdog Timer -endef - -$(eval $(call KernelPackage,it87-wdt)) - - -define KernelPackage/f71808e-wdt - SUBMENU:=$(OTHER_MENU) - TITLE:=Fintek F718xx/F818xx Watchdog Timer - DEPENDS:=@TARGET_x86 - KCONFIG:=CONFIG_F71808E_WDT - FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/f71808e_wdt.ko - AUTOLOAD:=$(call AutoProbe,f71808e-wdt,1) -endef - -define KernelPackage/f71808e-wdt/description - Kernel module for the watchdog timer found on many Fintek Super-IO chips. -endef - -$(eval $(call KernelPackage,f71808e-wdt)) diff --git a/feeds/ipq807x/linux/modules/pcmcia.mk b/feeds/ipq807x/linux/modules/pcmcia.mk deleted file mode 100644 index 11c2106cb..000000000 --- a/feeds/ipq807x/linux/modules/pcmcia.mk +++ /dev/null @@ -1,113 +0,0 @@ -# -# Copyright (C) 2006-2010 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -PCMCIA_MENU:=PCMCIA support - -define KernelPackage/pcmcia-core - SUBMENU:=$(PCMCIA_MENU) - TITLE:=PCMCIA/CardBus support - DEPENDS:=@PCMCIA_SUPPORT - KCONFIG:= \ - CONFIG_PCMCIA \ - CONFIG_PCMCIA_LOAD_CIS=y \ - CONFIG_CARDBUS \ - CONFIG_PCCARD \ - PCMCIA_DEBUG=n - FILES:= \ - $(LINUX_DIR)/drivers/pcmcia/pcmcia_core.ko \ - $(LINUX_DIR)/drivers/pcmcia/pcmcia.ko - AUTOLOAD:=$(call AutoLoad,25,pcmcia_core pcmcia) -endef - -define KernelPackage/pcmcia-core/description - Kernel support for PCMCIA/CardBus controllers -endef - -$(eval $(call KernelPackage,pcmcia-core)) - - -define AddDepends/pcmcia - SUBMENU:=$(PCMCIA_MENU) - DEPENDS+=kmod-pcmcia-core $(1) -endef - - -define KernelPackage/pcmcia-rsrc - TITLE:=PCMCIA resource support - KCONFIG:=CONFIG_PCCARD_NONSTATIC=y - FILES:=$(LINUX_DIR)/drivers/pcmcia/pcmcia_rsrc.ko - AUTOLOAD:=$(call AutoLoad,26,pcmcia_rsrc) - $(call AddDepends/pcmcia) -endef - -define KernelPackage/pcmcia-rsrc/description - Kernel support for PCMCIA resource allocation -endef - -$(eval $(call KernelPackage,pcmcia-rsrc)) - - -define KernelPackage/pcmcia-yenta - TITLE:=yenta socket driver - KCONFIG:=CONFIG_YENTA - FILES:=$(LINUX_DIR)/drivers/pcmcia/yenta_socket.ko - AUTOLOAD:=$(call AutoLoad,41,yenta_socket) - DEPENDS:=+kmod-pcmcia-rsrc - $(call AddDepends/pcmcia) -endef - -$(eval $(call KernelPackage,pcmcia-yenta)) - - -define KernelPackage/pcmcia-serial - TITLE:=Serial devices support - KCONFIG:= \ - CONFIG_PCMCIA_SERIAL_CS \ - CONFIG_SERIAL_8250_CS - FILES:=$(LINUX_DIR)/drivers/tty/serial/8250/serial_cs.ko - AUTOLOAD:=$(call AutoLoad,45,serial_cs) - DEPENDS:=+kmod-serial-8250 - $(call AddDepends/pcmcia) -endef - -define KernelPackage/pcmcia-serial/description - Kernel support for PCMCIA/CardBus serial devices -endef - -$(eval $(call KernelPackage,pcmcia-serial)) - - -define KernelPackage/pcmcia-pd6729 - TITLE:=Cirrus PD6729 compatible bridge support - KCONFIG:=CONFIG_PD6729 - FILES:=$(LINUX_DIR)/drivers/pcmcia/pd6729.ko - AUTOLOAD:=$(call AutoLoad,41,pd6729) - DEPENDS:=+kmod-pcmcia-rsrc - $(call AddDepends/pcmcia) -endef - -define KernelPackage/pcmcia-pd6729/description - Kernel support for the Cirrus PD6729 PCI-to-PCMCIA bridge -endef - -$(eval $(call KernelPackage,pcmcia-pd6729)) - - -define KernelPackage/pcmcia-nozomi - TITLE:=Option Fusion+ card - KCONFIG:=CONFIG_NOZOMI - FILES:=$(LINUX_DIR)/drivers/tty/nozomi.ko - AUTOLOAD:=$(call AutoLoad,60,nozomi) - DEPENDS:=+kmod-pcmcia-rsrc - $(call AddDepends/pcmcia) -endef - -define KernelPackage/pcmcia-nozomi/description - Kernel support for Option Fusion+ card -endef - -$(eval $(call KernelPackage,pcmcia-nozomi)) diff --git a/feeds/ipq807x/linux/modules/sound.mk b/feeds/ipq807x/linux/modules/sound.mk deleted file mode 100644 index 66194a5a7..000000000 --- a/feeds/ipq807x/linux/modules/sound.mk +++ /dev/null @@ -1,534 +0,0 @@ -# -# Copyright (C) 2006-2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -SOUND_MENU:=Sound Support - -# allow targets to override the soundcore stuff -SOUNDCORE_LOAD ?= \ - soundcore \ - snd \ - snd-hwdep \ - snd-seq-device \ - snd-rawmidi \ - snd-timer \ - snd-pcm \ - snd-mixer-oss \ - snd-pcm-oss \ - snd-compress - -SOUNDCORE_FILES ?= \ - $(LINUX_DIR)/sound/soundcore.ko \ - $(LINUX_DIR)/sound/core/snd.ko \ - $(LINUX_DIR)/sound/core/snd-hwdep.ko \ - $(LINUX_DIR)/sound/core/snd-seq-device.ko \ - $(LINUX_DIR)/sound/core/snd-rawmidi.ko \ - $(LINUX_DIR)/sound/core/snd-timer.ko \ - $(LINUX_DIR)/sound/core/snd-pcm.ko \ - $(LINUX_DIR)/sound/core/oss/snd-mixer-oss.ko \ - $(LINUX_DIR)/sound/core/oss/snd-pcm-oss.ko \ - $(LINUX_DIR)/sound/core/snd-compress.ko - -SOUNDCORE_LOAD += \ - $(if $(CONFIG_SND_DMAENGINE_PCM),snd-pcm-dmaengine) - -SOUNDCORE_FILES += \ - $(if $(CONFIG_SND_DMAENGINE_PCM),$(LINUX_DIR)/sound/core/snd-pcm-dmaengine.ko) - -define KernelPackage/sound-core - SUBMENU:=$(SOUND_MENU) - TITLE:=Sound support - DEPENDS:=@AUDIO_SUPPORT +kmod-input-core - KCONFIG:= \ - CONFIG_SOUND \ - CONFIG_SND \ - CONFIG_SND_HWDEP \ - CONFIG_SND_RAWMIDI \ - CONFIG_SND_TIMER \ - CONFIG_SND_PCM \ - CONFIG_SND_PCM_TIMER=y \ - CONFIG_SND_SEQUENCER \ - CONFIG_SND_VIRMIDI \ - CONFIG_SND_SEQ_DUMMY \ - CONFIG_SND_SEQUENCER_OSS=y \ - CONFIG_HOSTAUDIO \ - CONFIG_SND_PCM_OSS \ - CONFIG_SND_MIXER_OSS \ - CONFIG_SOUND_OSS_CORE_PRECLAIM=y \ - CONFIG_SND_COMPRESS_OFFLOAD - FILES:=$(SOUNDCORE_FILES) - AUTOLOAD:=$(call AutoLoad,30,$(SOUNDCORE_LOAD)) -endef - -define KernelPackage/sound-core/uml - FILES:= \ - $(LINUX_DIR)/sound/soundcore.ko \ - $(LINUX_DIR)/arch/um/drivers/hostaudio.ko - AUTOLOAD+=$(call AutoLoad,30,soundcore hostaudio) -endef - -define KernelPackage/sound-core/description - Kernel modules for sound support -endef - -$(eval $(call KernelPackage,sound-core)) - - -define AddDepends/sound - SUBMENU:=$(SOUND_MENU) - DEPENDS+=kmod-sound-core $(1) @!TARGET_uml -endef - - -define KernelPackage/ac97 - TITLE:=ac97 controller - KCONFIG:=CONFIG_SND_AC97_CODEC - FILES:= \ - $(LINUX_DIR)/sound/ac97_bus.ko \ - $(LINUX_DIR)/sound/pci/ac97/snd-ac97-codec.ko - AUTOLOAD:=$(call AutoLoad,35,ac97_bus snd-ac97-codec) - $(call AddDepends/sound) -endef - -define KernelPackage/ac97/description - The ac97 controller -endef - -$(eval $(call KernelPackage,ac97)) - - -define KernelPackage/sound-mpu401 - TITLE:=MPU-401 uart driver - KCONFIG:=CONFIG_SND_MPU401_UART - FILES:= \ - $(LINUX_DIR)/sound/drivers/mpu401/snd-mpu401-uart.ko - AUTOLOAD:=$(call AutoLoad,35,snd-mpu401-uart) - $(call AddDepends/sound) -endef - -define KernelPackage/sound-mpu401/description - support for MIDI ports compatible with the Roland MPU-401 - interface in UART mode. -endef - -$(eval $(call KernelPackage,sound-mpu401)) - - -define KernelPackage/sound-seq - TITLE:=Sequencer support - FILES:= \ - $(LINUX_DIR)/sound/core/seq/snd-seq.ko \ - $(LINUX_DIR)/sound/core/seq/snd-seq-midi-event.ko \ - $(LINUX_DIR)/sound/core/seq/snd-seq-midi.ko - AUTOLOAD:=$(call AutoLoad,35,snd-seq snd-seq-midi-event snd-seq-midi) - $(call AddDepends/sound) -endef - -define KernelPackage/sound-seq/description - Kernel modules for sequencer support -endef - -$(eval $(call KernelPackage,sound-seq)) - - -define KernelPackage/sound-ens1371 - TITLE:=(Creative) Ensoniq AudioPCI 1371 - KCONFIG:=CONFIG_SND_ENS1371 - DEPENDS:=@PCI_SUPPORT +kmod-ac97 - FILES:=$(LINUX_DIR)/sound/pci/snd-ens1371.ko - AUTOLOAD:=$(call AutoLoad,36,snd-ens1371) - $(call AddDepends/sound) -endef - -define KernelPackage/sound-ens1371/description - support for (Creative) Ensoniq AudioPCI 1371 chips -endef - -$(eval $(call KernelPackage,sound-ens1371)) - - -define KernelPackage/sound-i8x0 - TITLE:=Intel/SiS/nVidia/AMD/ALi AC97 Controller - DEPENDS:=+kmod-ac97 - KCONFIG:=CONFIG_SND_INTEL8X0 - FILES:=$(LINUX_DIR)/sound/pci/snd-intel8x0.ko - AUTOLOAD:=$(call AutoLoad,36,snd-intel8x0) - $(call AddDepends/sound) -endef - -define KernelPackage/sound-i8x0/description - support for the integrated AC97 sound device on motherboards - with Intel/SiS/nVidia/AMD chipsets, or ALi chipsets using - the M5455 Audio Controller. -endef - -$(eval $(call KernelPackage,sound-i8x0)) - - -define KernelPackage/sound-via82xx - TITLE:=VIA 82xx AC97 Controller - DEPENDS:=+kmod-ac97 +kmod-sound-mpu401 - KCONFIG:=CONFIG_SND_VIA82XX - FILES:=$(LINUX_DIR)/sound/pci/snd-via82xx.ko - AUTOLOAD:=$(call AutoLoad,36,snd-via82xx) - $(call AddDepends/sound) -endef - -define KernelPackage/sound-via82xx/description - support for the integrated AC97 sound device on motherboards - with VIA chipsets. -endef - -$(eval $(call KernelPackage,sound-via82xx)) - - -define KernelPackage/sound-soc-core - TITLE:=SoC sound support - DEPENDS:=+kmod-regmap-core +kmod-ac97 - KCONFIG:= \ - CONFIG_SND_SOC \ - CONFIG_SND_SOC_ADI=n \ - CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y \ - CONFIG_SND_SOC_ALL_CODECS=n - FILES:=$(LINUX_DIR)/sound/soc/snd-soc-core.ko - AUTOLOAD:=$(call AutoLoad,55,snd-soc-core) - $(call AddDepends/sound) -endef - -$(eval $(call KernelPackage,sound-soc-core)) - - -define KernelPackage/sound-soc-ac97 - TITLE:=AC97 Codec support - KCONFIG:=CONFIG_SND_SOC_AC97_CODEC - FILES:=$(LINUX_DIR)/sound/soc/codecs/snd-soc-ac97.ko - AUTOLOAD:=$(call AutoLoad,57,snd-soc-ac97) - DEPENDS:=+kmod-ac97 +kmod-sound-soc-core - $(call AddDepends/sound) -endef - -$(eval $(call KernelPackage,sound-soc-ac97)) - - -define KernelPackage/sound-soc-imx - TITLE:=IMX SoC support - KCONFIG:=\ - CONFIG_SND_IMX_SOC \ - CONFIG_SND_SOC_IMX_AUDMUX \ - CONFIG_SND_SOC_FSL_SSI \ - CONFIG_SND_SOC_IMX_PCM_DMA - FILES:= \ - $(LINUX_DIR)/sound/soc/fsl/snd-soc-imx-audmux.ko \ - $(LINUX_DIR)/sound/soc/fsl/snd-soc-fsl-ssi.ko \ - $(LINUX_DIR)/sound/soc/fsl/imx-pcm-dma.ko - AUTOLOAD:=$(call AutoLoad,56,snd-soc-imx-audmux snd-soc-fsl-ssi snd-soc-imx-pcm) - DEPENDS:=@TARGET_imx6 +kmod-sound-soc-core - $(call AddDepends/sound) -endef - -define KernelPackage/sound-soc-imx/description - Support for i.MX6 Platform sound (ssi/audmux/pcm) -endef - -$(eval $(call KernelPackage,sound-soc-imx)) - - -define KernelPackage/sound-soc-imx-sgtl5000 - TITLE:=IMX SoC support for SGTL5000 - KCONFIG:=CONFIG_SND_SOC_IMX_SGTL5000 - FILES:=\ - $(LINUX_DIR)/sound/soc/codecs/snd-soc-sgtl5000.ko \ - $(LINUX_DIR)/sound/soc/fsl/snd-soc-imx-sgtl5000.ko - AUTOLOAD:=$(call AutoLoad,57,snd-soc-sgtl5000 snd-soc-imx-sgtl5000) - DEPENDS:=@TARGET_imx6 +kmod-sound-soc-imx - $(call AddDepends/sound) -endef - -define KernelPackage/sound-soc-imx-sgtl5000/description - Support for i.MX6 Platform sound SGTL5000 codec -endef - -$(eval $(call KernelPackage,sound-soc-imx-sgtl5000)) - - -define KernelPackage/sound-soc-spdif - TITLE:=SoC S/PDIF codec support - KCONFIG:=CONFIG_SND_SOC_SPDIF - FILES:= \ - $(LINUX_DIR)/sound/soc/codecs/snd-soc-spdif-tx.ko \ - $(LINUX_DIR)/sound/soc/codecs/snd-soc-spdif-rx.ko - DEPENDS:=+kmod-sound-soc-core - AUTOLOAD:=$(call AutoProbe,snd-soc-spdif-tx snd-soc-spdif-rx) - $(call AddDepends/sound) -endef - -$(eval $(call KernelPackage,sound-soc-spdif)) - - -define KernelPackage/pcspkr - DEPENDS:=@TARGET_x86 +kmod-input-core - TITLE:=PC speaker support - KCONFIG:= \ - CONFIG_SND_PCSP - FILES:= \ - $(LINUX_DIR)/sound/drivers/pcsp/snd-pcsp.ko - AUTOLOAD:=$(call AutoLoad,50,snd-pcsp) - $(call AddDepends/sound) -endef - -define KernelPackage/pcspkr/description - This enables sounds (tones) through the pc speaker -endef - -$(eval $(call KernelPackage,pcspkr)) - -define KernelPackage/sound-dummy - $(call AddDepends/sound) - TITLE:=Null sound output driver (sink) - KCONFIG:= \ - CONFIG_SND_DUMMY - FILES:= \ - $(LINUX_DIR)/sound/drivers/snd-dummy.ko - AUTOLOAD:=$(call AutoLoad,32,snd-dummy) -endef - -define KernelPackage/sound-dummy/description - Dummy sound device for Alsa when no hardware present -endef - -$(eval $(call KernelPackage,sound-dummy)) - -define KernelPackage/sound-hda-core - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Sound Core Support - KCONFIG:= \ - CONFIG_SND_HDA_CORE \ - CONFIG_SND_HDA_HWDEP=y \ - CONFIG_SND_HDA_RECONFIG=n \ - CONFIG_SND_HDA_INPUT_BEEP=n \ - CONFIG_SND_HDA_PATCH_LOADER=n \ - CONFIG_SND_HDA_GENERIC - FILES:= \ - $(LINUX_DIR)/sound/hda/snd-hda-core.ko \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec.ko \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-generic.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-core snd-hda-codec snd-hda-codec-generic) - $(call AddDepends/sound,+kmod-regmap-core) -endef - -define KernelPackage/sound-hda-core/description - Kernel modules for HD Audio sound support -endef - -$(eval $(call KernelPackage,sound-hda-core)) - -define KernelPackage/sound-hda-codec-realtek - SUBMENU:=$(SOUND_MENU) - TITLE:= HD Audio Realtek Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_REALTEK - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-realtek.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-realtek) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-realtek/description - Kernel modules for Intel HDA Realtek codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-realtek)) - -define KernelPackage/sound-hda-codec-cmedia - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio C-Media Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_CMEDIA - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-cmedia.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-cmedia) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-cmedia/description - Kernel modules for HD Audio C-Media codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-cmedia)) - -define KernelPackage/sound-hda-codec-analog - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Analog Devices Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_ANALOG - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-analog.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-analog) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-analog/description - Kernel modules for HD Audio Analog Devices codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-analog)) - -define KernelPackage/sound-hda-codec-idt - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Sigmatel IDT Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_SIGMATEL - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-idt.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-idt) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-idt/description - Kernel modules for HD Audio Sigmatel IDT codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-idt)) - -define KernelPackage/sound-hda-codec-si3054 - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Silicon Labs 3054 Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_SI3054 - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-si3054.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-si3054) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-si3054/description - Kernel modules for HD Audio Silicon Labs 3054 codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-si3054)) - -define KernelPackage/sound-hda-codec-cirrus - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Cirrus Logic Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_CIRRUS - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-cirrus.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-cirrus) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-cirrus/description - Kernel modules for HD Audio Cirrus Logic codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-cirrus)) - -define KernelPackage/sound-hda-codec-ca0110 - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Creative CA0110 Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_CA0110 - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-ca0110.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-ca0110) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-ca0110/description - Kernel modules for HD Audio Creative CA0110 codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-ca0110)) - -define KernelPackage/sound-hda-codec-ca0132 - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Creative CA0132 Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_CA0132 \ - CONFIG_SND_HDA_CODEC_CA0132_DSP=n - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-ca0132.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-ca0132) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-ca0132/description - Kernel modules for HD Audio Creative CA0132 codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-ca0132)) - -define KernelPackage/sound-hda-codec-conexant - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Conexant Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_CONEXANT - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-conexant.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-conexant) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-conexant/description - Kernel modules for HD Audio Conexant codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-conexant)) - -define KernelPackage/sound-hda-codec-via - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Via Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_VIA - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-via.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-via) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-via/description - Kernel modules for HD Audio VIA codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-via)) - -define KernelPackage/sound-hda-codec-hdmi - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio HDMI/DisplayPort Codec - KCONFIG:= \ - CONFIG_SND_HDA_CODEC_HDMI - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-codec-hdmi.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-codec-hdmi) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-codec-hdmi/description - Kernel modules for HD Audio HDMI codec support -endef - -$(eval $(call KernelPackage,sound-hda-codec-hdmi)) - -define KernelPackage/sound-hda-intel - SUBMENU:=$(SOUND_MENU) - TITLE:=HD Audio Intel Driver - DEPENDS:=@TARGET_x86 - KCONFIG:= \ - CONFIG_SOUND_PCI \ - CONFIG_SND_HDA_INTEL - FILES:= \ - $(LINUX_DIR)/sound/pci/hda/snd-hda-intel.ko \ - $(LINUX_DIR)/sound/hda/snd-intel-nhlt.ko - AUTOLOAD:=$(call AutoProbe,snd-hda-intel) - $(call AddDepends/sound,kmod-sound-hda-core) -endef - -define KernelPackage/sound-hda-intel/description - Kernel modules for HD Audio Intel driver support -endef - -$(eval $(call KernelPackage,sound-hda-intel)) diff --git a/feeds/ipq807x/linux/modules/spi.mk b/feeds/ipq807x/linux/modules/spi.mk deleted file mode 100644 index 01dc7dc7e..000000000 --- a/feeds/ipq807x/linux/modules/spi.mk +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright (C) 2006-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -SPI_MENU:=SPI Support - -define KernelPackage/mmc-spi - SUBMENU:=$(SPI_MENU) - TITLE:=MMC/SD over SPI Support - DEPENDS:=+kmod-mmc +kmod-lib-crc-itu-t +kmod-lib-crc7 - KCONFIG:=CONFIG_MMC_SPI \ - CONFIG_SPI=y \ - CONFIG_SPI_MASTER=y - FILES:=\ - $(if $(CONFIG_OF),$(LINUX_DIR)/drivers/mmc/host/of_mmc_spi.ko) \ - $(LINUX_DIR)/drivers/mmc/host/mmc_spi.ko - AUTOLOAD:=$(call AutoProbe,$(if $(CONFIG_OF),of_mmc_spi) mmc_spi) -endef - -define KernelPackage/mmc-spi/description - Kernel support for MMC/SD over SPI -endef - -$(eval $(call KernelPackage,mmc-spi)) - - -define KernelPackage/spi-bitbang - SUBMENU:=$(SPI_MENU) - TITLE:=Serial Peripheral Interface bitbanging library - KCONFIG:=CONFIG_SPI_BITBANG \ - CONFIG_SPI=y \ - CONFIG_SPI_MASTER=y - FILES:=$(LINUX_DIR)/drivers/spi/spi-bitbang.ko -endef - -define KernelPackage/spi-bitbang/description - This package contains the SPI bitbanging library -endef - -$(eval $(call KernelPackage,spi-bitbang)) - - -define KernelPackage/spi-gpio - SUBMENU:=$(SPI_MENU) - TITLE:=GPIO-based bitbanging SPI Master - DEPENDS:=@GPIO_SUPPORT +kmod-spi-bitbang - KCONFIG:=CONFIG_SPI_GPIO - FILES:=$(LINUX_DIR)/drivers/spi/spi-gpio.ko - AUTOLOAD:=$(call AutoProbe,spi-gpio) -endef - -define KernelPackage/spi-gpio/description - This package contains the GPIO-based bitbanging SPI Master -endef - -$(eval $(call KernelPackage,spi-gpio)) - -define KernelPackage/spi-dev - SUBMENU:=$(SPI_MENU) - TITLE:=User mode SPI device driver - KCONFIG:=CONFIG_SPI_SPIDEV \ - CONFIG_SPI=y \ - CONFIG_SPI_MASTER=y - FILES:=$(LINUX_DIR)/drivers/spi/spidev.ko - AUTOLOAD:=$(call AutoProbe,spidev) -endef - -define KernelPackage/spi-dev/description - This package contains the user mode SPI device driver -endef - -$(eval $(call KernelPackage,spi-dev)) diff --git a/feeds/ipq807x/linux/modules/usb.mk b/feeds/ipq807x/linux/modules/usb.mk deleted file mode 100644 index 5530a1837..000000000 --- a/feeds/ipq807x/linux/modules/usb.mk +++ /dev/null @@ -1,1736 +0,0 @@ -# -# Copyright (C) 2006-2014 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -USB_MENU:=USB Support - -USBNET_DIR:=net/usb -USBHID_DIR?=hid/usbhid -USBINPUT_DIR?=input/misc - -define KernelPackage/usb-core - SUBMENU:=$(USB_MENU) - TITLE:=Support for USB - DEPENDS:=@USB_SUPPORT - KCONFIG:=CONFIG_USB CONFIG_XPS_USB_HCD_XILINX=n CONFIG_USB_FHCI_HCD=n - FILES:= \ - $(LINUX_DIR)/drivers/usb/core/usbcore.ko \ - $(LINUX_DIR)/drivers/usb/common/usb-common.ko - AUTOLOAD:=$(call AutoLoad,20,usb-common usbcore,1) - $(call AddDepends/nls) -endef - -define KernelPackage/usb-core/description - Kernel support for USB -endef - -$(eval $(call KernelPackage,usb-core)) - - -define AddDepends/usb - SUBMENU:=$(USB_MENU) - DEPENDS+=+kmod-usb-core $(1) -endef - - -define KernelPackage/usb-ledtrig-usbport - TITLE:=LED trigger for USB ports - KCONFIG:=CONFIG_USB_LEDS_TRIGGER_USBPORT - FILES:=$(LINUX_DIR)/drivers/usb/core/ledtrig-usbport.ko - AUTOLOAD:=$(call AutoLoad,50,ledtrig-usbport) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-ledtrig-usbport/description - This driver allows LEDs to be controlled by USB events. Enabling this - trigger allows specifying list of USB ports that should turn on LED - when some USB device gets connected. - If possible it should be prefered over similar ledtrig-usbdev. -endef - -$(eval $(call KernelPackage,usb-ledtrig-usbport)) - - -define KernelPackage/usb-phy-nop - TITLE:=Support for USB NOP transceiver - KCONFIG:=CONFIG_NOP_USB_XCEIV - HIDDEN:=1 - FILES:=$(LINUX_DIR)/drivers/usb/phy/phy-generic.ko - AUTOLOAD:=$(call AutoLoad,21,phy-generic,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-phy-nop/description - Support for USB NOP transceiver -endef - -$(eval $(call KernelPackage,usb-phy-nop)) - - -define KernelPackage/phy-ath79-usb - TITLE:=Support for ATH79 USB PHY - KCONFIG:=CONFIG_PHY_AR7100_USB \ - CONFIG_PHY_AR7200_USB - DEPENDS:=@TARGET_ath79 - HIDDEN:=1 - FILES:=$(LINUX_DIR)/drivers/phy/phy-ar7100-usb.ko \ - $(LINUX_DIR)/drivers/phy/phy-ar7200-usb.ko - AUTOLOAD:=$(call AutoLoad,21,phy-ar7100-usb phy-ar7200-usb,1) - $(call AddDepends/usb) -endef - -define KernelPackage/phy-ath79-usb/description - Support for ATH79 USB transceiver -endef - -$(eval $(call KernelPackage,phy-ath79-usb)) - - -define KernelPackage/usb-gadget - TITLE:=USB Gadget support - KCONFIG:=CONFIG_USB_GADGET - HIDDEN:=1 - FILES:=\ - $(LINUX_DIR)/drivers/usb/gadget/udc/udc-core.ko - AUTOLOAD:=$(call AutoLoad,21,udc-core,1) - DEPENDS:=@USB_GADGET_SUPPORT - $(call AddDepends/usb) -endef - -define KernelPackage/usb-gadget/description - Kernel support for USB Gadget mode -endef - -$(eval $(call KernelPackage,usb-gadget)) - -define KernelPackage/usb-lib-composite - TITLE:=USB lib composite - KCONFIG:=CONFIG_USB_LIBCOMPOSITE - DEPENDS:=+kmod-usb-gadget +kmod-fs-configfs - HIDDEN:=1 - FILES:=$(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko - AUTOLOAD:=$(call AutoLoad,50,libcomposite) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-lib-composite/description - Lib Composite -endef - -$(eval $(call KernelPackage,usb-lib-composite)) - -define KernelPackage/usb-gadget-hid - TITLE:=USB HID Gadget Support - KCONFIG:=CONFIG_USB_G_HID - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite - FILES:= \ - $(LINUX_DIR)/drivers/usb/gadget/legacy/g_hid.ko \ - $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_hid.ko - AUTOLOAD:=$(call AutoLoad,52,usb_f_hid) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-gadget-hid/description - Kernel support for USB HID Gadget. -endef - -$(eval $(call KernelPackage,usb-gadget-hid)) - -define KernelPackage/usb-gadget-ehci-debug - TITLE:=USB EHCI debug port Gadget support - KCONFIG:=\ - CONFIG_USB_G_DBGP \ - CONFIG_USB_G_DBGP_SERIAL=y \ - CONFIG_USB_G_DBGP_PRINTK=n - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite +kmod-usb-gadget-serial - FILES:=$(LINUX_DIR)/drivers/usb/gadget/legacy/g_dbgp.ko - $(call AddDepends/usb) -endef - -define KernelPackage/usb-gadget-ehci-debug/description - Kernel support for USB EHCI debug port Gadget. -endef - -$(eval $(call KernelPackage,usb-gadget-ehci-debug)) - -define KernelPackage/usb-gadget-eth - TITLE:=USB Ethernet Gadget support - KCONFIG:= \ - CONFIG_USB_ETH \ - CONFIG_USB_ETH_RNDIS=y \ - CONFIG_USB_ETH_EEM=n - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite - FILES:= \ - $(LINUX_DIR)/drivers/usb/gadget/function/u_ether.ko \ - $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ecm.ko \ - $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ecm_subset.ko \ - $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_rndis.ko \ - $(LINUX_DIR)/drivers/usb/gadget/legacy/g_ether.ko - AUTOLOAD:=$(call AutoLoad,52,usb_f_ecm) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-gadget-eth/description - Kernel support for USB Ethernet Gadget -endef - -$(eval $(call KernelPackage,usb-gadget-eth)) - - -define KernelPackage/usb-gadget-serial - TITLE:=USB Serial Gadget support - KCONFIG:=CONFIG_USB_G_SERIAL - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite - FILES:= \ - $(LINUX_DIR)/drivers/usb/gadget/function/u_serial.ko \ - $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_acm.ko \ - $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_obex.ko \ - $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_serial.ko \ - $(LINUX_DIR)/drivers/usb/gadget/legacy/g_serial.ko - AUTOLOAD:=$(call AutoLoad,52,usb_f_acm) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-gadget-serial/description - Kernel support for USB Serial Gadget. -endef - -$(eval $(call KernelPackage,usb-gadget-serial)) - -define KernelPackage/usb-gadget-mass-storage - TITLE:=USB Mass Storage support - KCONFIG:=CONFIG_USB_MASS_STORAGE - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite - FILES:= \ - $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_mass_storage.ko \ - $(LINUX_DIR)/drivers/usb/gadget/legacy/g_mass_storage.ko - AUTOLOAD:=$(call AutoLoad,52,usb_f_mass_storage) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-gadget-mass-storage/description - Kernel support for USB Gadget Mass Storage -endef - -$(eval $(call KernelPackage,usb-gadget-mass-storage)) - -define KernelPackage/usb-gadget-cdc-composite - TITLE:= USB CDC Composite (Ethernet + ACM) - KCONFIG:=CONFIG_USB_CDC_COMPOSITE - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite \ - +kmod-usb-gadget-eth +kmod-usb-gadget-serial - FILES:= $(LINUX_DIR)/drivers/usb/gadget/legacy/g_cdc.ko - $(call AddDepends/usb) -endef - -define KernelPackage/usb-gadget-cdc-composite/description - Kernel support for the USB CDC Composite gadget. - This appears as an ethernet + ACM serial gadget. -endef - -$(eval $(call KernelPackage,usb-gadget-cdc-composite)) - - -define KernelPackage/usb-uhci - TITLE:=Support for UHCI controllers - KCONFIG:= \ - CONFIG_USB_PCI=y \ - CONFIG_USB_UHCI_ALT \ - CONFIG_USB_UHCI_HCD - FILES:=$(LINUX_DIR)/drivers/usb/host/uhci-hcd.ko - AUTOLOAD:=$(call AutoLoad,50,uhci-hcd,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-uhci/description - Kernel support for USB UHCI controllers -endef - -$(eval $(call KernelPackage,usb-uhci,1)) - - -define KernelPackage/usb-ohci - TITLE:=Support for OHCI controllers - DEPENDS:= \ - +TARGET_bcm53xx:kmod-usb-bcma \ - +TARGET_bcm47xx:kmod-usb-bcma \ - +TARGET_bcm47xx:kmod-usb-ssb - KCONFIG:= \ - CONFIG_USB_OHCI \ - CONFIG_USB_OHCI_HCD \ - CONFIG_USB_OHCI_ATH79=y \ - CONFIG_USB_OHCI_HCD_AT91=y \ - CONFIG_USB_OHCI_BCM63XX=y \ - CONFIG_USB_OCTEON_OHCI=y \ - CONFIG_USB_OHCI_HCD_OMAP3=y \ - CONFIG_USB_OHCI_HCD_PLATFORM=y - FILES:= \ - $(LINUX_DIR)/drivers/usb/host/ohci-hcd.ko \ - $(LINUX_DIR)/drivers/usb/host/ohci-platform.ko - ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ohci-at91.ko),) - FILES+=$(LINUX_DIR)/drivers/usb/host/ohci-at91.ko - endif - AUTOLOAD:=$(call AutoLoad,50,ohci-hcd ohci-platform ohci-at91,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-ohci/description - Kernel support for USB OHCI controllers -endef - -$(eval $(call KernelPackage,usb-ohci,1)) - - -define KernelPackage/usb-ohci-pci - TITLE:=Support for PCI OHCI controllers - DEPENDS:=@PCI_SUPPORT +kmod-usb-ohci - KCONFIG:= \ - CONFIG_USB_PCI=y \ - CONFIG_USB_OHCI_HCD_PCI - FILES:=$(LINUX_DIR)/drivers/usb/host/ohci-pci.ko - AUTOLOAD:=$(call AutoLoad,51,ohci-pci,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-ohci-pci/description - Kernel support for PCI OHCI controllers -endef - -$(eval $(call KernelPackage,usb-ohci-pci)) - - -define KernelPackage/usb-bcma - TITLE:=Support for BCMA USB controllers - DEPENDS:=@USB_SUPPORT @TARGET_bcm47xx||TARGET_bcm53xx - HIDDEN:=1 - KCONFIG:=CONFIG_USB_HCD_BCMA - FILES:= \ - $(if $(CONFIG_USB_HCD_BCMA),$(LINUX_DIR)/drivers/usb/host/bcma-hcd.ko) - AUTOLOAD:=$(call AutoLoad,19,$(if $(CONFIG_USB_HCD_BCMA),bcma-hcd),1) - $(call AddDepends/usb) -endef -$(eval $(call KernelPackage,usb-bcma)) - -define KernelPackage/usb-fotg210 - TITLE:=Support for FOTG210 USB host controllers - DEPENDS:=@USB_SUPPORT @TARGET_gemini - KCONFIG:=CONFIG_USB_FOTG210_HCD - FILES:= \ - $(if $(CONFIG_USB_FOTG210_HCD),$(LINUX_DIR)/drivers/usb/host/fotg210-hcd.ko) - AUTOLOAD:=$(call AutoLoad,50,fotg210-hcd,1) - $(call AddDepends/usb) -endef -$(eval $(call KernelPackage,usb-fotg210)) - -define KernelPackage/usb-ssb - TITLE:=Support for SSB USB controllers - DEPENDS:=@USB_SUPPORT @TARGET_bcm47xx - HIDDEN:=1 - KCONFIG:=CONFIG_USB_HCD_SSB - FILES:= \ - $(if $(CONFIG_USB_HCD_SSB),$(LINUX_DIR)/drivers/usb/host/ssb-hcd.ko) - AUTOLOAD:=$(call AutoLoad,19,$(if $(CONFIG_USB_HCD_SSB),ssb-hcd),1) - $(call AddDepends/usb) -endef -$(eval $(call KernelPackage,usb-ssb)) - -define KernelPackage/usb-ehci - TITLE:=EHCI controller support - HIDDEN:=1 - KCONFIG:= \ - CONFIG_USB_EHCI_HCD - FILES:= \ - $(LINUX_DIR)/drivers/usb/host/ehci-hcd.ko - AUTOLOAD:=$(call AutoLoad,35,ehci-hcd,1) - $(call AddDepends/usb) -endef -$(eval $(call KernelPackage,usb-ehci)) - -define KernelPackage/usb2 - TITLE:=Support for USB2 controllers - DEPENDS:=\ - +TARGET_bcm47xx:kmod-usb-bcma \ - +TARGET_bcm47xx:kmod-usb-ssb \ - +TARGET_bcm53xx:kmod-usb-bcma \ - +TARGET_bcm53xx:kmod-phy-bcm-ns-usb2 \ - +TARGET_ath79:kmod-phy-ath79-usb \ - +kmod-usb-ehci - KCONFIG:=\ - CONFIG_USB_EHCI_HCD_PLATFORM \ - CONFIG_USB_EHCI_BCM63XX=y \ - CONFIG_USB_IMX21_HCD=y \ - CONFIG_USB_EHCI_MXC=y \ - CONFIG_USB_OCTEON_EHCI=y \ - CONFIG_USB_EHCI_HCD_ORION=y \ - CONFIG_USB_EHCI_HCD_AT91=y \ - CONFIG_USB_EHCI_FSL - FILES:= \ - $(LINUX_DIR)/drivers/usb/host/ehci-platform.ko - ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-orion.ko),) - FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-orion.ko - endif - ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-atmel.ko),) - FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-atmel.ko - endif - ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-fsl.ko),) - FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-fsl.ko - endif - ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/fsl-mph-dr-of.ko),) - FILES+=$(LINUX_DIR)/drivers/usb/host/fsl-mph-dr-of.ko - endif - AUTOLOAD:=$(call AutoLoad,40,ehci-hcd ehci-platform ehci-orion ehci-atmel ehci-fsl fsl-mph-dr-of,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb2/description - Kernel support for USB2 (EHCI) controllers -endef - -$(eval $(call KernelPackage,usb2)) - - -define KernelPackage/usb2-pci - TITLE:=Support for PCI USB2 controllers - DEPENDS:=@PCI_SUPPORT +kmod-usb2 - KCONFIG:= \ - CONFIG_USB_PCI=y \ - CONFIG_USB_EHCI_PCI - FILES:=$(LINUX_DIR)/drivers/usb/host/ehci-pci.ko - AUTOLOAD:=$(call AutoLoad,42,ehci-pci,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb2-pci/description - Kernel support for PCI USB2 (EHCI) controllers -endef - -$(eval $(call KernelPackage,usb2-pci)) - - -define KernelPackage/usb-dwc2 - TITLE:=DWC2 USB controller driver - DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget - KCONFIG:= \ - CONFIG_USB_PCI=y \ - CONFIG_USB_DWC2 \ - CONFIG_USB_DWC2_PCI \ - CONFIG_USB_DWC2_PLATFORM \ - CONFIG_USB_DWC2_DEBUG=n \ - CONFIG_USB_DWC2_VERBOSE=n \ - CONFIG_USB_DWC2_TRACK_MISSED_SOFS=n \ - CONFIG_USB_DWC2_DEBUG_PERIODIC=n - FILES:= \ - $(LINUX_DIR)/drivers/usb/dwc2/dwc2.ko - AUTOLOAD:=$(call AutoLoad,54,dwc2,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-dwc2/description - This driver provides USB Device Controller support for the - Synopsys DesignWare USB OTG Core -endef - -$(eval $(call KernelPackage,usb-dwc2)) - - -define KernelPackage/usb-dwc3 - TITLE:=DWC3 USB controller driver - KCONFIG:= \ - CONFIG_USB_DWC3 \ - CONFIG_USB_DWC3_HOST=y \ - CONFIG_USB_DWC3_GADGET=n \ - CONFIG_USB_DWC3_DUAL_ROLE=n \ - CONFIG_USB_DWC3_DEBUG=n \ - CONFIG_USB_DWC3_VERBOSE=n - FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3.ko - AUTOLOAD:=$(call AutoLoad,54,dwc3,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-dwc3/description - This driver provides support for the Dual Role SuperSpeed - USB Controller based on the Synopsys DesignWare USB3 IP Core -endef - -$(eval $(call KernelPackage,usb-dwc3)) - - -define KernelPackage/usb-dwc3-of-simple - TITLE:=DWC3 USB simple OF driver - DEPENDS:=@!LINUX_4_19 @(TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x) +kmod-usb-dwc3 - KCONFIG:= CONFIG_USB_DWC3_OF_SIMPLE - FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-of-simple.ko \ - $(LINUX_DIR)/drivers/usb/dwc3/dbm.ko - AUTOLOAD:=$(call AutoLoad,53,dwc3-of-simple,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-dwc3-of-simple/description - This driver provides generic platform glue for the integrated DesignWare - USB3 IP Core. -endef - - -$(eval $(call KernelPackage,usb-dwc3-of-simple)) - - -define KernelPackage/usb-dwc3-qcom - TITLE:=DWC3 Qualcomm USB driver - DEPENDS:=@(!LINUX_4_14) @(TARGET_ipq40xx||TARGET_ipq806x) +kmod-usb-dwc3 - KCONFIG:= CONFIG_USB_DWC3_QCOM - FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-qcom.ko - AUTOLOAD:=$(call AutoLoad,53,dwc3-qcom,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-dwc3-qcom/description - Some Qualcomm SoCs use DesignWare Core IP for USB2/3 functionality. - This driver also handles Qscratch wrapper which is needed for - peripheral mode support. -endef - - -$(eval $(call KernelPackage,usb-dwc3-qcom)) - - -define KernelPackage/usb-acm - TITLE:=Support for modems/isdn controllers - KCONFIG:=CONFIG_USB_ACM - FILES:=$(LINUX_DIR)/drivers/usb/class/cdc-acm.ko - AUTOLOAD:=$(call AutoProbe,cdc-acm) -$(call AddDepends/usb) -endef - -define KernelPackage/usb-acm/description - Kernel support for USB ACM devices (modems/isdn controllers) -endef - -$(eval $(call KernelPackage,usb-acm)) - - -define KernelPackage/usb-wdm - TITLE:=USB Wireless Device Management - KCONFIG:=CONFIG_USB_WDM - FILES:=$(LINUX_DIR)/drivers/usb/class/cdc-wdm.ko - AUTOLOAD:=$(call AutoProbe,cdc-wdm) -$(call AddDepends/usb) -$(call AddDepends/usb-net) -endef - -define KernelPackage/usb-wdm/description - USB Wireless Device Management support -endef - -$(eval $(call KernelPackage,usb-wdm)) - - -define KernelPackage/usb-audio - TITLE:=Support for USB audio devices - KCONFIG:= \ - CONFIG_USB_AUDIO \ - CONFIG_SND_USB=y \ - CONFIG_SND_USB_AUDIO - $(call AddDepends/usb) - $(call AddDepends/sound) - FILES:= \ - $(LINUX_DIR)/sound/usb/snd-usbmidi-lib.ko \ - $(LINUX_DIR)/sound/usb/snd-usb-audio.ko - AUTOLOAD:=$(call AutoProbe,snd-usbmidi-lib snd-usb-audio) -endef - -define KernelPackage/usb-audio/description - Kernel support for USB audio devices -endef - -$(eval $(call KernelPackage,usb-audio)) - - -define KernelPackage/usb-printer - TITLE:=Support for printers - KCONFIG:=CONFIG_USB_PRINTER - FILES:=$(LINUX_DIR)/drivers/usb/class/usblp.ko - AUTOLOAD:=$(call AutoProbe,usblp) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-printer/description - Kernel support for USB printers -endef - -$(eval $(call KernelPackage,usb-printer)) - - -define KernelPackage/usb-serial - TITLE:=Support for USB-to-Serial converters - KCONFIG:=CONFIG_USB_SERIAL - FILES:=$(LINUX_DIR)/drivers/usb/serial/usbserial.ko - AUTOLOAD:=$(call AutoProbe,usbserial) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-serial/description - Kernel support for USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial)) - - -define AddDepends/usb-serial - SUBMENU:=$(USB_MENU) - DEPENDS+=+kmod-usb-serial $(1) -endef - - -define KernelPackage/usb-serial-belkin - TITLE:=Support for Belkin devices - KCONFIG:=CONFIG_USB_SERIAL_BELKIN - FILES:=$(LINUX_DIR)/drivers/usb/serial/belkin_sa.ko - AUTOLOAD:=$(call AutoProbe,belkin_sa) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-belkin/description - Kernel support for Belkin USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-belkin)) - - -define KernelPackage/usb-serial-ch341 - TITLE:=Support for CH341 devices - KCONFIG:=CONFIG_USB_SERIAL_CH341 - FILES:=$(LINUX_DIR)/drivers/usb/serial/ch341.ko - AUTOLOAD:=$(call AutoProbe,ch341) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-ch341/description - Kernel support for Winchiphead CH341 USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-ch341)) - - -define KernelPackage/usb-serial-edgeport - TITLE:=Support for Digi Edgeport devices - KCONFIG:=CONFIG_USB_SERIAL_EDGEPORT - FILES:=$(LINUX_DIR)/drivers/usb/serial/io_edgeport.ko - AUTOLOAD:=$(call AutoProbe,io_edgeport) - $(call AddDepends/usb-serial) - DEPENDS+=+edgeport-firmware -endef - -define KernelPackage/usb-serial-edgeport/description - Kernel support for Inside Out Networks (Digi) - Edgeport/4 - Rapidport/4 - Edgeport/4t - Edgeport/2 - Edgeport/4i - Edgeport/2i - Edgeport/421 - Edgeport/21 - Edgeport/8 - Edgeport/8 Dual - Edgeport/2D8 - Edgeport/4D8 - Edgeport/8i - Edgeport/2 DIN - Edgeport/4 DIN - Edgeport/16 Dual -endef - -$(eval $(call KernelPackage,usb-serial-edgeport)) - - -define KernelPackage/usb-serial-ftdi - TITLE:=Support for FTDI devices - KCONFIG:=CONFIG_USB_SERIAL_FTDI_SIO - FILES:=$(LINUX_DIR)/drivers/usb/serial/ftdi_sio.ko - AUTOLOAD:=$(call AutoProbe,ftdi_sio) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-ftdi/description - Kernel support for FTDI USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-ftdi)) - - -define KernelPackage/usb-serial-garmin - TITLE:=Support for Garmin GPS devices - KCONFIG:=CONFIG_USB_SERIAL_GARMIN - FILES:=$(LINUX_DIR)/drivers/usb/serial/garmin_gps.ko - AUTOLOAD:=$(call AutoProbe,garmin_gps) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-garmin/description - Should work with most Garmin GPS devices which have a native USB port. -endef - -$(eval $(call KernelPackage,usb-serial-garmin)) - - -define KernelPackage/usb-serial-simple - TITLE:=USB Serial Simple (Motorola phone) - KCONFIG:=CONFIG_USB_SERIAL_SIMPLE - FILES:=$(LINUX_DIR)/drivers/usb/serial/usb-serial-simple.ko - AUTOLOAD:=$(call AutoProbe,usb-serial-simple) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-simple/description - Kernel support for "very simple devices". - -Specifically, it supports: - - Suunto ANT+ USB device. - - Medtronic CareLink USB device (3.18) - - Fundamental Software dongle. - - Google USB serial devices (3.19) - - HP4x calculators - - a number of Motorola phones - - Novatel Wireless GPS receivers (3.18) - - Siemens USB/MPI adapter. - - ViVOtech ViVOpay USB device. - - Infineon Modem Flashloader USB interface - - ZIO Motherboard USB serial interface -endef - -$(eval $(call KernelPackage,usb-serial-simple)) - - -define KernelPackage/usb-serial-ti-usb - TITLE:=Support for TI USB 3410/5052 - KCONFIG:=CONFIG_USB_SERIAL_TI - FILES:=$(LINUX_DIR)/drivers/usb/serial/ti_usb_3410_5052.ko - AUTOLOAD:=$(call AutoProbe,ti_usb_3410_5052) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-ti-usb/description - Kernel support for TI USB 3410/5052 devices -endef - -$(eval $(call KernelPackage,usb-serial-ti-usb)) - - -define KernelPackage/usb-serial-ipw - TITLE:=Support for IPWireless 3G devices - KCONFIG:=CONFIG_USB_SERIAL_IPW - FILES:=$(LINUX_DIR)/drivers/usb/serial/ipw.ko - AUTOLOAD:=$(call AutoProbe,ipw) - $(call AddDepends/usb-serial,+kmod-usb-serial-wwan) -endef - -$(eval $(call KernelPackage,usb-serial-ipw)) - - -define KernelPackage/usb-serial-mct - TITLE:=Support for Magic Control Tech. devices - KCONFIG:=CONFIG_USB_SERIAL_MCT_U232 - FILES:=$(LINUX_DIR)/drivers/usb/serial/mct_u232.ko - AUTOLOAD:=$(call AutoProbe,mct_u232) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-mct/description - Kernel support for Magic Control Technology USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-mct)) - - -define KernelPackage/usb-serial-mos7720 - TITLE:=Support for Moschip MOS7720 devices - KCONFIG:=CONFIG_USB_SERIAL_MOS7720 - FILES:=$(LINUX_DIR)/drivers/usb/serial/mos7720.ko - AUTOLOAD:=$(call AutoProbe,mos7720) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-mos7720/description - Kernel support for Moschip MOS7720 USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-mos7720)) - - -define KernelPackage/usb-serial-mos7840 - TITLE:=Support for Moschip MOS7840 devices - KCONFIG:=CONFIG_USB_SERIAL_MOS7840 - FILES:=$(LINUX_DIR)/drivers/usb/serial/mos7840.ko - AUTOLOAD:=$(call AutoProbe,mos7840) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-mos7840/description - Kernel support for Moschip MOS7840 USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-mos7840)) - - -define KernelPackage/usb-serial-pl2303 - TITLE:=Support for Prolific PL2303 devices - KCONFIG:=CONFIG_USB_SERIAL_PL2303 - FILES:=$(LINUX_DIR)/drivers/usb/serial/pl2303.ko - AUTOLOAD:=$(call AutoProbe,pl2303) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-pl2303/description - Kernel support for Prolific PL2303 USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-pl2303)) - - -define KernelPackage/usb-serial-cp210x - TITLE:=Support for Silicon Labs cp210x devices - KCONFIG:=CONFIG_USB_SERIAL_CP210X - FILES:=$(LINUX_DIR)/drivers/usb/serial/cp210x.ko - AUTOLOAD:=$(call AutoProbe,cp210x) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-cp210x/description - Kernel support for Silicon Labs cp210x USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-cp210x)) - - -define KernelPackage/usb-serial-ark3116 - TITLE:=Support for ArkMicroChips ARK3116 devices - KCONFIG:=CONFIG_USB_SERIAL_ARK3116 - FILES:=$(LINUX_DIR)/drivers/usb/serial/ark3116.ko - AUTOLOAD:=$(call AutoProbe,ark3116) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-ark3116/description - Kernel support for ArkMicroChips ARK3116 USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-ark3116)) - - -define KernelPackage/usb-serial-oti6858 - TITLE:=Support for Ours Technology OTI6858 devices - KCONFIG:=CONFIG_USB_SERIAL_OTI6858 - FILES:=$(LINUX_DIR)/drivers/usb/serial/oti6858.ko - AUTOLOAD:=$(call AutoProbe,oti6858) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-oti6858/description - Kernel support for Ours Technology OTI6858 USB-to-Serial converters -endef - -$(eval $(call KernelPackage,usb-serial-oti6858)) - - -define KernelPackage/usb-serial-sierrawireless - TITLE:=Support for Sierra Wireless devices - KCONFIG:=CONFIG_USB_SERIAL_SIERRAWIRELESS - FILES:=$(LINUX_DIR)/drivers/usb/serial/sierra.ko - AUTOLOAD:=$(call AutoProbe,sierra) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-sierrawireless/description - Kernel support for Sierra Wireless devices -endef - -$(eval $(call KernelPackage,usb-serial-sierrawireless)) - - -define KernelPackage/usb-serial-visor - TITLE:=Support for Handspring Visor devices - KCONFIG:=CONFIG_USB_SERIAL_VISOR - FILES:=$(LINUX_DIR)/drivers/usb/serial/visor.ko - AUTOLOAD:=$(call AutoProbe,visor) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-visor/description - Kernel support for Handspring Visor PDAs -endef - -$(eval $(call KernelPackage,usb-serial-visor)) - - -define KernelPackage/usb-serial-cypress-m8 - TITLE:=Support for CypressM8 USB-Serial - KCONFIG:=CONFIG_USB_SERIAL_CYPRESS_M8 - FILES:=$(LINUX_DIR)/drivers/usb/serial/cypress_m8.ko - AUTOLOAD:=$(call AutoProbe,cypress_m8) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-cypress-m8/description - Kernel support for devices with Cypress M8 USB to Serial chip - (for example, the Delorme Earthmate LT-20 GPS) - Supported microcontrollers in the CY4601 family are: - CY7C63741 CY7C63742 CY7C63743 CY7C64013 -endef - -$(eval $(call KernelPackage,usb-serial-cypress-m8)) - - -define KernelPackage/usb-serial-keyspan - TITLE:=Support for Keyspan USB-to-Serial devices - KCONFIG:= \ - CONFIG_USB_SERIAL_KEYSPAN \ - CONFIG_USB_SERIAL_KEYSPAN_USA28 \ - CONFIG_USB_SERIAL_KEYSPAN_USA28X \ - CONFIG_USB_SERIAL_KEYSPAN_USA28XA \ - CONFIG_USB_SERIAL_KEYSPAN_USA28XB \ - CONFIG_USB_SERIAL_KEYSPAN_USA19 \ - CONFIG_USB_SERIAL_KEYSPAN_USA18X \ - CONFIG_USB_SERIAL_KEYSPAN_USA19W \ - CONFIG_USB_SERIAL_KEYSPAN_USA19QW \ - CONFIG_USB_SERIAL_KEYSPAN_USA19QI \ - CONFIG_USB_SERIAL_KEYSPAN_MPR \ - CONFIG_USB_SERIAL_KEYSPAN_USA49W \ - CONFIG_USB_SERIAL_KEYSPAN_USA49WLC - FILES:= \ - $(LINUX_DIR)/drivers/usb/serial/keyspan.ko \ - $(wildcard $(LINUX_DIR)/drivers/usb/misc/ezusb.ko) - AUTOLOAD:=$(call AutoProbe,ezusb keyspan) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-keyspan/description - Kernel support for Keyspan USB-to-Serial devices -endef - -$(eval $(call KernelPackage,usb-serial-keyspan)) - - -define KernelPackage/usb-serial-wwan - TITLE:=Support for GSM and CDMA modems - KCONFIG:=CONFIG_USB_SERIAL_WWAN - FILES:=$(LINUX_DIR)/drivers/usb/serial/usb_wwan.ko - HIDDEN:=1 - AUTOLOAD:=$(call AutoProbe,usb_wwan) - $(call AddDepends/usb-serial) -endef - -define KernelPackage/usb-serial-wwan/description - Kernel support for USB GSM and CDMA modems -endef - -$(eval $(call KernelPackage,usb-serial-wwan)) - - -define KernelPackage/usb-serial-option - TITLE:=Support for Option HSDPA modems - KCONFIG:=CONFIG_USB_SERIAL_OPTION - FILES:=$(LINUX_DIR)/drivers/usb/serial/option.ko - AUTOLOAD:=$(call AutoProbe,option) - $(call AddDepends/usb-serial,+kmod-usb-serial-wwan) -endef - -define KernelPackage/usb-serial-option/description - Kernel support for Option HSDPA modems -endef - -$(eval $(call KernelPackage,usb-serial-option)) - - -define KernelPackage/usb-serial-qualcomm - TITLE:=Support for Qualcomm USB serial - KCONFIG:=CONFIG_USB_SERIAL_QUALCOMM - FILES:=$(LINUX_DIR)/drivers/usb/serial/qcserial.ko - AUTOLOAD:=$(call AutoProbe,qcserial) - $(call AddDepends/usb-serial,+kmod-usb-serial-wwan) -endef - -define KernelPackage/usb-serial-qualcomm/description - Kernel support for Qualcomm USB Serial devices (Gobi) -endef - -$(eval $(call KernelPackage,usb-serial-qualcomm)) - - -define KernelPackage/usb-storage - TITLE:=USB Storage support - DEPENDS:= +kmod-scsi-core - KCONFIG:=CONFIG_USB_STORAGE - FILES:=$(LINUX_DIR)/drivers/usb/storage/usb-storage.ko - AUTOLOAD:=$(call AutoProbe,usb-storage,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-storage/description - Kernel support for USB Mass Storage devices -endef - -$(eval $(call KernelPackage,usb-storage)) - - -define KernelPackage/usb-storage-extras - SUBMENU:=$(USB_MENU) - TITLE:=Extra drivers for usb-storage - DEPENDS:=+kmod-usb-storage - KCONFIG:= \ - CONFIG_USB_STORAGE_ALAUDA \ - CONFIG_USB_STORAGE_CYPRESS_ATACB \ - CONFIG_USB_STORAGE_DATAFAB \ - CONFIG_USB_STORAGE_FREECOM \ - CONFIG_USB_STORAGE_ISD200 \ - CONFIG_USB_STORAGE_JUMPSHOT \ - CONFIG_USB_STORAGE_KARMA \ - CONFIG_USB_STORAGE_SDDR09 \ - CONFIG_USB_STORAGE_SDDR55 \ - CONFIG_USB_STORAGE_USBAT - FILES:= \ - $(LINUX_DIR)/drivers/usb/storage/ums-alauda.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-cypress.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-datafab.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-freecom.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-isd200.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-jumpshot.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-karma.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-sddr09.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-sddr55.ko \ - $(LINUX_DIR)/drivers/usb/storage/ums-usbat.ko - AUTOLOAD:=$(call AutoProbe,ums-alauda ums-cypress ums-datafab \ - ums-freecom ums-isd200 ums-jumpshot \ - ums-karma ums-sddr09 ums-sddr55 ums-usbat) -endef - -define KernelPackage/usb-storage-extras/description - Say Y here if you want to have some more drivers, - such as for SmartMedia card readers -endef - -$(eval $(call KernelPackage,usb-storage-extras)) - - -define KernelPackage/usb-storage-uas - SUBMENU:=$(USB_MENU) - TITLE:=USB Attached SCSI (UASP) support - DEPENDS:=+kmod-usb-storage - KCONFIG:=CONFIG_USB_UAS - FILES:=$(LINUX_DIR)/drivers/usb/storage/uas.ko - AUTOLOAD:=$(call AutoProbe,uas,1) -endef - -define KernelPackage/usb-storage-uas/description - Say Y here if you want to include support for - USB Attached SCSI (UAS/UASP), a higher - performance protocol available on many - newer USB 3.0 storage devices -endef - -$(eval $(call KernelPackage,usb-storage-uas)) - - -define KernelPackage/usb-atm - TITLE:=Support for ATM on USB bus - DEPENDS:=+kmod-atm - KCONFIG:=CONFIG_USB_ATM - FILES:=$(LINUX_DIR)/drivers/usb/atm/usbatm.ko - AUTOLOAD:=$(call AutoProbe,usbatm) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-atm/description - Kernel support for USB DSL modems -endef - -$(eval $(call KernelPackage,usb-atm)) - - -define AddDepends/usb-atm - SUBMENU:=$(USB_MENU) - DEPENDS+=kmod-usb-atm $(1) -endef - - -define KernelPackage/usb-atm-speedtouch - TITLE:=SpeedTouch USB ADSL modems support - KCONFIG:=CONFIG_USB_SPEEDTOUCH - FILES:=$(LINUX_DIR)/drivers/usb/atm/speedtch.ko - AUTOLOAD:=$(call AutoProbe,speedtch) - $(call AddDepends/usb-atm) -endef - -define KernelPackage/usb-atm-speedtouch/description - Kernel support for SpeedTouch USB ADSL modems -endef - -$(eval $(call KernelPackage,usb-atm-speedtouch)) - - -define KernelPackage/usb-atm-ueagle - TITLE:=Eagle 8051 based USB ADSL modems support - FILES:=$(LINUX_DIR)/drivers/usb/atm/ueagle-atm.ko - KCONFIG:=CONFIG_USB_UEAGLEATM - AUTOLOAD:=$(call AutoProbe,ueagle-atm) - $(call AddDepends/usb-atm) -endef - -define KernelPackage/usb-atm-ueagle/description - Kernel support for Eagle 8051 based USB ADSL modems -endef - -$(eval $(call KernelPackage,usb-atm-ueagle)) - - -define KernelPackage/usb-atm-cxacru - TITLE:=cxacru - FILES:=$(LINUX_DIR)/drivers/usb/atm/cxacru.ko - KCONFIG:=CONFIG_USB_CXACRU - AUTOLOAD:=$(call AutoProbe,cxacru) - $(call AddDepends/usb-atm) -endef - -define KernelPackage/usb-atm-cxacru/description - Kernel support for cxacru based USB ADSL modems -endef - -$(eval $(call KernelPackage,usb-atm-cxacru)) - - -define KernelPackage/usb-net - TITLE:=Kernel modules for USB-to-Ethernet convertors - DEPENDS:=+kmod-mii - KCONFIG:=CONFIG_USB_USBNET \ - CONFIG_USB_NET_DRIVERS - AUTOLOAD:=$(call AutoProbe,usbnet) - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/usbnet.ko - $(call AddDepends/usb) -endef - -define KernelPackage/usb-net/description - Kernel modules for USB-to-Ethernet convertors -endef - -$(eval $(call KernelPackage,usb-net)) - - -define AddDepends/usb-net - SUBMENU:=$(USB_MENU) - DEPENDS+=+kmod-usb-net $(1) -endef - - -define KernelPackage/usb-net-aqc111 - TITLE:=Support for USB-to-Ethernet Aquantia AQtion 5/2.5GbE - KCONFIG:=CONFIG_USB_NET_AQC111 - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/aqc111.ko - AUTOLOAD:=$(call AutoProbe,aqc111) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-aqc111/description - Support for USB-to-Ethernet Aquantia AQtion 5/2.5GbE -endef - -$(eval $(call KernelPackage,usb-net-aqc111)) - - -define KernelPackage/usb-net-asix - TITLE:=Kernel module for USB-to-Ethernet Asix convertors - DEPENDS:=+kmod-libphy - KCONFIG:=CONFIG_USB_NET_AX8817X - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/asix.ko - AUTOLOAD:=$(call AutoProbe,asix) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-asix/description - Kernel module for USB-to-Ethernet Asix convertors -endef - -$(eval $(call KernelPackage,usb-net-asix)) - - -define KernelPackage/usb-net-asix-ax88179 - TITLE:=Kernel module for USB-to-Gigabit-Ethernet Asix convertors - DEPENDS:=+kmod-libphy - KCONFIG:=CONFIG_USB_NET_AX88179_178A - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/ax88179_178a.ko - AUTOLOAD:=$(call AutoProbe,ax88179_178a) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-asix-ax88179/description - Kernel module for USB-to-Ethernet ASIX AX88179 based USB 3.0/2.0 - to Gigabit Ethernet adapters. -endef - -$(eval $(call KernelPackage,usb-net-asix-ax88179)) - - -define KernelPackage/usb-net-hso - TITLE:=Kernel module for Option USB High Speed Mobile Devices - KCONFIG:=CONFIG_USB_HSO - FILES:= \ - $(LINUX_DIR)/drivers/$(USBNET_DIR)/hso.ko - AUTOLOAD:=$(call AutoProbe,hso) - $(call AddDepends/usb-net) - $(call AddDepends/rfkill) -endef - -define KernelPackage/usb-net-hso/description - Kernel module for Option USB High Speed Mobile Devices -endef - -$(eval $(call KernelPackage,usb-net-hso)) - - -define KernelPackage/usb-net-kaweth - TITLE:=Kernel module for USB-to-Ethernet Kaweth convertors - KCONFIG:=CONFIG_USB_KAWETH - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/kaweth.ko - AUTOLOAD:=$(call AutoProbe,kaweth) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-kaweth/description - Kernel module for USB-to-Ethernet Kaweth convertors -endef - -$(eval $(call KernelPackage,usb-net-kaweth)) - - -define KernelPackage/usb-net-pegasus - TITLE:=Kernel module for USB-to-Ethernet Pegasus convertors - KCONFIG:=CONFIG_USB_PEGASUS - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/pegasus.ko - AUTOLOAD:=$(call AutoProbe,pegasus) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-pegasus/description - Kernel module for USB-to-Ethernet Pegasus convertors -endef - -$(eval $(call KernelPackage,usb-net-pegasus)) - - -define KernelPackage/usb-net-mcs7830 - TITLE:=Kernel module for USB-to-Ethernet MCS7830 convertors - KCONFIG:=CONFIG_USB_NET_MCS7830 - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/mcs7830.ko - AUTOLOAD:=$(call AutoProbe,mcs7830) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-mcs7830/description - Kernel module for USB-to-Ethernet MCS7830 convertors -endef - -$(eval $(call KernelPackage,usb-net-mcs7830)) - - -define KernelPackage/usb-net-smsc95xx - TITLE:=SMSC LAN95XX based USB 2.0 10/100 ethernet devices - KCONFIG:=CONFIG_USB_NET_SMSC95XX - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/smsc95xx.ko - AUTOLOAD:=$(call AutoProbe,smsc95xx) - $(call AddDepends/usb-net, +kmod-lib-crc16) -endef - -define KernelPackage/usb-net-smsc95xx/description - Kernel module for SMSC LAN95XX based devices -endef - -$(eval $(call KernelPackage,usb-net-smsc95xx)) - - -define KernelPackage/usb-net-dm9601-ether - TITLE:=Support for DM9601 ethernet connections - KCONFIG:=CONFIG_USB_NET_DM9601 - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/dm9601.ko - AUTOLOAD:=$(call AutoProbe,dm9601) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-dm9601-ether/description - Kernel support for USB DM9601 devices -endef - -$(eval $(call KernelPackage,usb-net-dm9601-ether)) - -define KernelPackage/usb-net-cdc-ether - TITLE:=Support for cdc ethernet connections - KCONFIG:=CONFIG_USB_NET_CDCETHER - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/cdc_ether.ko - AUTOLOAD:=$(call AutoProbe,cdc_ether) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-cdc-ether/description - Kernel support for USB CDC Ethernet devices -endef - -$(eval $(call KernelPackage,usb-net-cdc-ether)) - - -define KernelPackage/usb-net-cdc-eem - TITLE:=Support for CDC EEM connections - KCONFIG:=CONFIG_USB_NET_CDC_EEM - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/cdc_eem.ko - AUTOLOAD:=$(call AutoProbe,cdc_eem) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-cdc-eem/description - Kernel support for USB CDC EEM -endef - -$(eval $(call KernelPackage,usb-net-cdc-eem)) - - -define KernelPackage/usb-net-cdc-subset - TITLE:=Support for CDC Ethernet subset connections - KCONFIG:= \ - CONFIG_USB_NET_CDC_SUBSET \ - CONFIG_USB_ARMLINUX - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/cdc_subset.ko - AUTOLOAD:=$(call AutoProbe,cdc_subset) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-cdc-subset/description - Kernel support for Simple USB Network Links (CDC Ethernet subset) -endef - -$(eval $(call KernelPackage,usb-net-cdc-subset)) - - -define KernelPackage/usb-net-qmi-wwan - TITLE:=QMI WWAN driver - KCONFIG:=CONFIG_USB_NET_QMI_WWAN - FILES:= $(LINUX_DIR)/drivers/$(USBNET_DIR)/qmi_wwan.ko - AUTOLOAD:=$(call AutoProbe,qmi_wwan) - $(call AddDepends/usb-net,+kmod-usb-wdm) -endef - -define KernelPackage/usb-net-qmi-wwan/description - QMI WWAN driver for Qualcomm MSM based 3G and LTE modems -endef - -$(eval $(call KernelPackage,usb-net-qmi-wwan)) - - -define KernelPackage/usb-net-rtl8150 - TITLE:=Kernel module for USB-to-Ethernet Realtek convertors - KCONFIG:=CONFIG_USB_RTL8150 - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/rtl8150.ko - AUTOLOAD:=$(call AutoProbe,rtl8150) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-rtl8150/description - Kernel module for USB-to-Ethernet Realtek 8150 convertors -endef - -$(eval $(call KernelPackage,usb-net-rtl8150)) - - -define KernelPackage/usb-net-rtl8152 - TITLE:=Kernel module for USB-to-Ethernet Realtek convertors - KCONFIG:=CONFIG_USB_RTL8152 - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko - AUTOLOAD:=$(call AutoProbe,r8152) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-rtl8152/description - Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors -endef - -$(eval $(call KernelPackage,usb-net-rtl8152)) - - -define KernelPackage/usb-net-sr9700 - TITLE:=Support for CoreChip SR9700 ethernet devices - KCONFIG:=CONFIG_USB_NET_SR9700 - FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/sr9700.ko - AUTOLOAD:=$(call AutoProbe,sr9700) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-sr9700/description - Kernel module for CoreChip-sz SR9700 based USB 1.1 10/100 ethernet devices -endef - -$(eval $(call KernelPackage,usb-net-sr9700)) - - -define KernelPackage/usb-net-rndis - TITLE:=Support for RNDIS connections - KCONFIG:=CONFIG_USB_NET_RNDIS_HOST - FILES:= $(LINUX_DIR)/drivers/$(USBNET_DIR)/rndis_host.ko - AUTOLOAD:=$(call AutoProbe,rndis_host) - $(call AddDepends/usb-net,+kmod-usb-net-cdc-ether) -endef - -define KernelPackage/usb-net-rndis/description - Kernel support for RNDIS connections -endef - -$(eval $(call KernelPackage,usb-net-rndis)) - - -define KernelPackage/usb-net-cdc-mbim - SUBMENU:=$(USB_MENU) - TITLE:=Kernel module for MBIM Devices - KCONFIG:=CONFIG_USB_NET_CDC_MBIM - FILES:= \ - $(LINUX_DIR)/drivers/$(USBNET_DIR)/cdc_mbim.ko - AUTOLOAD:=$(call AutoProbe,cdc_mbim) - $(call AddDepends/usb-net,+kmod-usb-wdm +kmod-usb-net-cdc-ncm) -endef - -define KernelPackage/usb-net-cdc-mbim/description - Kernel module for CDC MBIM (Mobile Broadband Interface Model) devices -endef - -$(eval $(call KernelPackage,usb-net-cdc-mbim)) - - -define KernelPackage/usb-net-cdc-ncm - TITLE:=Support for CDC NCM connections - KCONFIG:=CONFIG_USB_NET_CDC_NCM - FILES:= $(LINUX_DIR)/drivers/$(USBNET_DIR)/cdc_ncm.ko - AUTOLOAD:=$(call AutoProbe,cdc_ncm) - $(call AddDepends/usb-net,+kmod-usb-net-cdc-ether) -endef - -define KernelPackage/usb-net-cdc-ncm/description - Kernel support for CDC NCM connections -endef - -$(eval $(call KernelPackage,usb-net-cdc-ncm)) - - -define KernelPackage/usb-net-huawei-cdc-ncm - TITLE:=Support for Huawei CDC NCM connections - KCONFIG:=CONFIG_USB_NET_HUAWEI_CDC_NCM - FILES:= $(LINUX_DIR)/drivers/$(USBNET_DIR)/huawei_cdc_ncm.ko - AUTOLOAD:=$(call AutoProbe,huawei_cdc_ncm) - $(call AddDepends/usb-net,+kmod-usb-net-cdc-ncm +kmod-usb-wdm) -endef - -define KernelPackage/usb-net-huawei-cdc-ncm/description - Kernel support for Huawei CDC NCM connections -endef - -$(eval $(call KernelPackage,usb-net-huawei-cdc-ncm)) - - -define KernelPackage/usb-net-sierrawireless - TITLE:=Support for Sierra Wireless devices - KCONFIG:=CONFIG_USB_SIERRA_NET - FILES:=$(LINUX_DIR)/drivers/net/usb/sierra_net.ko - AUTOLOAD:=$(call AutoProbe,sierra_net) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-sierrawireless/description - Kernel support for Sierra Wireless devices -endef - -$(eval $(call KernelPackage,usb-net-sierrawireless)) - - -define KernelPackage/usb-net-ipheth - TITLE:=Apple iPhone USB Ethernet driver - KCONFIG:=CONFIG_USB_IPHETH - FILES:=$(LINUX_DIR)/drivers/net/usb/ipheth.ko - AUTOLOAD:=$(call AutoProbe,ipheth) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-ipheth/description - Kernel support for Apple iPhone USB Ethernet driver -endef - -$(eval $(call KernelPackage,usb-net-ipheth)) - - -define KernelPackage/usb-net-kalmia - TITLE:=Samsung Kalmia based LTE USB modem - KCONFIG:=CONFIG_USB_NET_KALMIA - FILES:=$(LINUX_DIR)/drivers/net/usb/kalmia.ko - AUTOLOAD:=$(call AutoProbe,kalmia) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-kalmia/description - Kernel support for Samsung Kalmia based LTE USB modem -endef - -$(eval $(call KernelPackage,usb-net-kalmia)) - -define KernelPackage/usb-net-pl - TITLE:=Prolific PL-2301/2302/25A1 based cables - KCONFIG:=CONFIG_USB_NET_PLUSB - FILES:=$(LINUX_DIR)/drivers/net/usb/plusb.ko - AUTOLOAD:=$(call AutoProbe,plusb) - $(call AddDepends/usb-net) -endef - -define KernelPackage/usb-net-pl/description - Kernel support for Prolific PL-2301/2302/25A1 based cables -endef - -$(eval $(call KernelPackage,usb-net-pl)) - -define KernelPackage/usb-hid - TITLE:=Support for USB Human Input Devices - KCONFIG:=CONFIG_HID_SUPPORT=y CONFIG_USB_HID CONFIG_USB_HIDDEV=y - DEPENDS:=+kmod-hid +kmod-hid-generic +kmod-input-evdev - FILES:=$(LINUX_DIR)/drivers/$(USBHID_DIR)/usbhid.ko - AUTOLOAD:=$(call AutoProbe,usbhid) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-hid/description - Kernel support for USB HID devices such as keyboards and mice -endef - -$(eval $(call KernelPackage,usb-hid)) - - -define KernelPackage/usb-hid-cp2112 - SUBMENU:=$(USB_MENU) - TITLE:=Silicon Labs CP2112 HID USB to SMBus Master Bridge - KCONFIG:=CONFIG_GPIOLIB=y CONFIG_HID_CP2112 - DEPENDS:=+kmod-usb-hid +kmod-i2c-core - FILES:=$(LINUX_DIR)/drivers/hid/hid-cp2112.ko - AUTOLOAD:=$(call AutoProbe,hid-cp2112) -endef - -define KernelPackage/usb-hid-cp2112/description - HID device driver which registers as an i2c adapter and gpiochip to expose - these functions of the CP2112. -endef - -$(eval $(call KernelPackage,usb-hid-cp2112)) - - -define KernelPackage/usb-yealink - TITLE:=USB Yealink VOIP phone - DEPENDS:=+kmod-input-evdev - KCONFIG:=CONFIG_USB_YEALINK CONFIG_INPUT_YEALINK CONFIG_INPUT=m CONFIG_INPUT_MISC=y - FILES:=$(LINUX_DIR)/drivers/$(USBINPUT_DIR)/yealink.ko - AUTOLOAD:=$(call AutoProbe,yealink) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-yealink/description - Kernel support for Yealink VOIP phone -endef - -$(eval $(call KernelPackage,usb-yealink)) - - -define KernelPackage/usb-cm109 - TITLE:=Support for CM109 device - DEPENDS:=+kmod-input-evdev - KCONFIG:=CONFIG_USB_CM109 CONFIG_INPUT_CM109 CONFIG_INPUT=m CONFIG_INPUT_MISC=y - FILES:=$(LINUX_DIR)/drivers/$(USBINPUT_DIR)/cm109.ko - AUTOLOAD:=$(call AutoProbe,cm109) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-cm109/description - Kernel support for CM109 VOIP phone -endef - -$(eval $(call KernelPackage,usb-cm109)) - - -define KernelPackage/usb-test - TITLE:=USB Testing Driver - DEPENDS:=@DEVEL - KCONFIG:=CONFIG_USB_TEST - FILES:=$(LINUX_DIR)/drivers/usb/misc/usbtest.ko - $(call AddDepends/usb) -endef - -define KernelPackage/usb-test/description - Kernel support for testing USB Host Controller software -endef - -$(eval $(call KernelPackage,usb-test)) - - -define KernelPackage/usbip - TITLE := USB-over-IP kernel support - KCONFIG:= \ - CONFIG_USBIP_CORE \ - CONFIG_USBIP_DEBUG=n - FILES:=$(LINUX_DIR)/drivers/usb/usbip/usbip-core.ko - AUTOLOAD:=$(call AutoProbe,usbip-core) - $(call AddDepends/usb) -endef - -$(eval $(call KernelPackage,usbip)) - - -define KernelPackage/usbip-client - TITLE := USB-over-IP client driver - DEPENDS := +kmod-usbip - KCONFIG := CONFIG_USBIP_VHCI_HCD - FILES :=$(LINUX_DIR)/drivers/usb/usbip/vhci-hcd.ko - AUTOLOAD := $(call AutoProbe,vhci-hcd) - $(call AddDepends/usb) -endef - -$(eval $(call KernelPackage,usbip-client)) - - -define KernelPackage/usbip-server -$(call KernelPackage/usbip/Default) - TITLE := USB-over-IP host driver - DEPENDS := +kmod-usbip - KCONFIG := CONFIG_USBIP_HOST - FILES :=$(LINUX_DIR)/drivers/usb/usbip/usbip-host.ko - AUTOLOAD := $(call AutoProbe,usbip-host) - $(call AddDepends/usb) -endef - -$(eval $(call KernelPackage,usbip-server)) - - -define KernelPackage/usb-chipidea - TITLE:=Host and device support for Chipidea controllers - DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget @TARGET_ath79 +kmod-usb-ehci +kmod-usb-phy-nop - KCONFIG:= \ - CONFIG_EXTCON \ - CONFIG_USB_CHIPIDEA \ - CONFIG_USB_CHIPIDEA_HOST=y \ - CONFIG_USB_CHIPIDEA_UDC=y \ - CONFIG_USB_CHIPIDEA_DEBUG=y - FILES:= \ - $(LINUX_DIR)/drivers/extcon/extcon-core.ko \ - $(LINUX_DIR)/drivers/usb/chipidea/ci_hdrc.ko \ - $(LINUX_DIR)/drivers/usb/common/ulpi.ko \ - $(LINUX_DIR)/drivers/usb/roles/roles.ko - AUTOLOAD:=$(call AutoLoad,39,ci_hdrc,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-chipidea/description - Kernel support for USB Chipidea controllers -endef - -$(eval $(call KernelPackage,usb-chipidea)) - - -define KernelPackage/usb-chipidea2 - TITLE:=Host and device support for Chipidea2 controllers - DEPENDS:=+kmod-usb-chipidea - KCONFIG:= \ - CONFIG_EXTCON \ - CONFIG_USB_CHIPIDEA \ - CONFIG_USB_CHIPIDEA_HOST=y \ - CONFIG_USB_CHIPIDEA_UDC=y \ - CONFIG_USB_CHIPIDEA_DEBUG=y - FILES:= \ - $(LINUX_DIR)/drivers/extcon/extcon-core.ko \ - $(LINUX_DIR)/drivers/usb/chipidea/ci_hdrc_usb2.ko - AUTOLOAD:=$(call AutoLoad,39,ci_hdrc_usb2,1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-chipidea2/description - Kernel support for USB Chipidea controllers -endef - -$(eval $(call KernelPackage,usb-chipidea2)) - - -define KernelPackage/usbmon - TITLE:=USB traffic monitor - KCONFIG:=CONFIG_USB_MON - $(call AddDepends/usb) - FILES:=$(LINUX_DIR)/drivers/usb/mon/usbmon.ko - AUTOLOAD:=$(call AutoProbe,usbmon) -endef - -define KernelPackage/usbmon/description - Kernel support for USB traffic monitoring -endef - -$(eval $(call KernelPackage,usbmon)) - -XHCI_MODULES := xhci-hcd xhci-pci xhci-plat-hcd -ifdef CONFIG_TARGET_ramips_mt7621 - XHCI_MODULES += xhci-mtk -endif -XHCI_FILES := $(wildcard $(patsubst %,$(LINUX_DIR)/drivers/usb/host/%.ko,$(XHCI_MODULES))) -XHCI_AUTOLOAD := $(patsubst $(LINUX_DIR)/drivers/usb/host/%.ko,%,$(XHCI_FILES)) - -define KernelPackage/usb3 - TITLE:=Support for USB3 controllers - DEPENDS:= \ - +TARGET_bcm53xx:kmod-usb-bcma \ - +TARGET_bcm53xx:kmod-phy-bcm-ns-usb3 - KCONFIG:= \ - CONFIG_USB_PCI=y \ - CONFIG_USB_XHCI_HCD \ - CONFIG_USB_XHCI_PCI \ - CONFIG_USB_XHCI_PLATFORM \ - CONFIG_USB_XHCI_MTK \ - CONFIG_USB_XHCI_HCD_DEBUGGING=n - FILES:= \ - $(XHCI_FILES) - AUTOLOAD:=$(call AutoLoad,54,$(XHCI_AUTOLOAD),1) - $(call AddDepends/usb) -endef - -define KernelPackage/usb3/description - Kernel support for USB3 (XHCI) controllers -endef - -$(eval $(call KernelPackage,usb3)) - - -define KernelPackage/usb-net2280 - TITLE:=Support for NetChip 228x PCI USB peripheral controller - KCONFIG:= \ - CONFIG_USB_PCI=y \ - CONFIG_USB_NET2280 - DEPENDS:=@PCI_SUPPORT +kmod-usb-gadget - FILES:=$(LINUX_DIR)/drivers/usb/gadget/udc/net2280.ko - AUTOLOAD:=$(call AutoLoad,46,net2280) - $(call AddDepends/usb) -endef - -define KernelPackage/usb-net2280/description - Kernel support for NetChip 228x / PLX USB338x PCI USB peripheral controller. -endef - -$(eval $(call KernelPackage,usb-net2280)) - -define KernelPackage/chaoskey - SUBMENU:=$(USB_MENU) - TITLE:=Chaoskey hardware RNG support - DEPENDS:=+kmod-random-core - KCONFIG:=CONFIG_USB_CHAOSKEY - FILES:=$(LINUX_DIR)/drivers/usb/misc/chaoskey.ko - AUTOLOAD:=$(call AutoProbe,chaoskey) - $(call AddDepends/usb) -endef - -define KernelPackage/chaoskey/description - Kernel module for chaoskey, USB attached true random number generator -endef - -$(eval $(call KernelPackage,chaoskey)) - diff --git a/feeds/ipq807x/linux/modules/video.mk b/feeds/ipq807x/linux/modules/video.mk deleted file mode 100644 index a50fdad57..000000000 --- a/feeds/ipq807x/linux/modules/video.mk +++ /dev/null @@ -1,1025 +0,0 @@ -# -# Copyright (C) 2009 David Cooper -# Copyright (C) 2006-2010 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -VIDEO_MENU:=Video Support - -V4L2_DIR=v4l2-core -V4L2_USB_DIR=usb - -# -# Video Display -# - -define KernelPackage/backlight - SUBMENU:=$(VIDEO_MENU) - TITLE:=Backlight support - DEPENDS:=@DISPLAY_SUPPORT - HIDDEN:=1 - KCONFIG:=CONFIG_BACKLIGHT_CLASS_DEVICE \ - CONFIG_BACKLIGHT_LCD_SUPPORT=y \ - CONFIG_LCD_CLASS_DEVICE=n \ - CONFIG_BACKLIGHT_GENERIC=n \ - CONFIG_BACKLIGHT_ADP8860=n \ - CONFIG_BACKLIGHT_ADP8870=n \ - CONFIG_BACKLIGHT_OT200=n \ - CONFIG_BACKLIGHT_PM8941_WLED=n - FILES:=$(LINUX_DIR)/drivers/video/backlight/backlight.ko - AUTOLOAD:=$(call AutoProbe,video backlight) -endef - -define KernelPackage/backlight/description - Kernel module for Backlight support. -endef - -$(eval $(call KernelPackage,backlight)) - -define KernelPackage/backlight-pwm - SUBMENU:=$(VIDEO_MENU) - TITLE:=PWM Backlight support - DEPENDS:=+kmod-backlight - KCONFIG:=CONFIG_BACKLIGHT_PWM - FILES:=$(LINUX_DIR)/drivers/video/backlight/pwm_bl.ko - AUTOLOAD:=$(call AutoProbe,video pwm_bl) -endef - -define KernelPackage/backlight-pwm/description - Kernel module for PWM based Backlight support. -endef - -$(eval $(call KernelPackage,backlight-pwm)) - - -define KernelPackage/fb - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer and framebuffer console support - DEPENDS:=@DISPLAY_SUPPORT - KCONFIG:= \ - CONFIG_FB \ - CONFIG_FB_MXS=n \ - CONFIG_FB_SM750=n \ - CONFIG_FRAMEBUFFER_CONSOLE=y \ - CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y \ - CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y \ - CONFIG_FONTS=y \ - CONFIG_FONT_8x8=y \ - CONFIG_FONT_8x16=y \ - CONFIG_FONT_6x11=n \ - CONFIG_FONT_7x14=n \ - CONFIG_FONT_PEARL_8x8=n \ - CONFIG_FONT_ACORN_8x8=n \ - CONFIG_FONT_MINI_4x6=n \ - CONFIG_FONT_6x10=n \ - CONFIG_FONT_SUN8x16=n \ - CONFIG_FONT_SUN12x22=n \ - CONFIG_FONT_10x18=n \ - CONFIG_VT=y \ - CONFIG_CONSOLE_TRANSLATIONS=y \ - CONFIG_VT_CONSOLE=y \ - CONFIG_VT_HW_CONSOLE_BINDING=y - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb.ko \ - $(LINUX_DIR)/lib/fonts/font.ko - AUTOLOAD:=$(call AutoLoad,06,fb font) -endef - -define KernelPackage/fb/description - Kernel support for framebuffers and framebuffer console. -endef - -define KernelPackage/fb/x86 - FILES+=$(LINUX_DIR)/arch/x86/video/fbdev.ko - AUTOLOAD:=$(call AutoLoad,06,fbdev fb font) -endef - -$(eval $(call KernelPackage,fb)) - - -define KernelPackage/fb-cfb-fillrect - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer software rectangle filling support - DEPENDS:=+kmod-fb - KCONFIG:=CONFIG_FB_CFB_FILLRECT - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbfillrect.ko - AUTOLOAD:=$(call AutoLoad,07,cfbfillrect) -endef - -define KernelPackage/fb-cfb-fillrect/description - Kernel support for software rectangle filling -endef - -$(eval $(call KernelPackage,fb-cfb-fillrect)) - - -define KernelPackage/fb-cfb-copyarea - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer software copy area support - DEPENDS:=+kmod-fb - KCONFIG:=CONFIG_FB_CFB_COPYAREA - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbcopyarea.ko - AUTOLOAD:=$(call AutoLoad,07,cfbcopyarea) -endef - -define KernelPackage/fb-cfb-copyarea/description - Kernel support for software copy area -endef - -$(eval $(call KernelPackage,fb-cfb-copyarea)) - -define KernelPackage/fb-cfb-imgblt - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer software image blit support - DEPENDS:=+kmod-fb - KCONFIG:=CONFIG_FB_CFB_IMAGEBLIT - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbimgblt.ko - AUTOLOAD:=$(call AutoLoad,07,cfbimgblt) -endef - -define KernelPackage/fb-cfb-imgblt/description - Kernel support for software image blitting -endef - -$(eval $(call KernelPackage,fb-cfb-imgblt)) - - -define KernelPackage/fb-sys-fops - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer software sys ops support - DEPENDS:=+kmod-fb - KCONFIG:=CONFIG_FB_SYS_FOPS - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb_sys_fops.ko - AUTOLOAD:=$(call AutoLoad,07,fb_sys_fops) -endef - -define KernelPackage/fb-sys-fops/description - Kernel support for framebuffer sys ops -endef - -$(eval $(call KernelPackage,fb-sys-fops)) - - -define KernelPackage/fb-sys-ram - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer in system RAM support - DEPENDS:=+kmod-fb - KCONFIG:= \ - CONFIG_FB_SYS_COPYAREA \ - CONFIG_FB_SYS_FILLRECT \ - CONFIG_FB_SYS_IMAGEBLIT - FILES:= \ - $(LINUX_DIR)/drivers/video/fbdev/core/syscopyarea.ko \ - $(LINUX_DIR)/drivers/video/fbdev/core/sysfillrect.ko \ - $(LINUX_DIR)/drivers/video/fbdev/core/sysimgblt.ko - AUTOLOAD:=$(call AutoLoad,07,syscopyarea sysfillrect sysimgblt) -endef - -define KernelPackage/fb-sys-ram/description - Kernel support for framebuffers in system RAM -endef - -$(eval $(call KernelPackage,fb-sys-ram)) - - -define KernelPackage/fb-tft - SUBMENU:=$(VIDEO_MENU) - TITLE:=Support for small TFT LCD display modules - DEPENDS:= \ - @GPIO_SUPPORT +kmod-backlight \ - +kmod-fb +kmod-fb-sys-fops +kmod-fb-sys-ram +kmod-spi-bitbang - KCONFIG:= \ - CONFIG_FB_BACKLIGHT=y \ - CONFIG_FB_DEFERRED_IO=y \ - CONFIG_FB_TFT - FILES:= \ - $(LINUX_DIR)/drivers/staging/fbtft/fbtft.ko - AUTOLOAD:=$(call AutoLoad,08,fbtft) -endef - -define KernelPackage/fb-tft/description - Support for small TFT LCD display modules -endef - -$(eval $(call KernelPackage,fb-tft)) - - -define KernelPackage/fb-tft-ili9486 - SUBMENU:=$(VIDEO_MENU) - TITLE:=FB driver for the ILI9486 LCD Controller - DEPENDS:=+kmod-fb-tft - KCONFIG:=CONFIG_FB_TFT_ILI9486 - FILES:=$(LINUX_DIR)/drivers/staging/fbtft/fb_ili9486.ko - AUTOLOAD:=$(call AutoLoad,09,fb_ili9486) -endef - -define KernelPackage/fb-tft-ili9486/description - FB driver for the ILI9486 LCD Controller -endef - -$(eval $(call KernelPackage,fb-tft-ili9486)) - - -define KernelPackage/drm - SUBMENU:=$(VIDEO_MENU) - TITLE:=Direct Rendering Manager (DRM) support - HIDDEN:=1 - DEPENDS:=+kmod-dma-buf +kmod-i2c-core - KCONFIG:=CONFIG_DRM - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/drm.ko \ - $(LINUX_DIR)/drivers/gpu/drm/drm_panel_orientation_quirks.ko@ge4.15 - AUTOLOAD:=$(call AutoLoad,05,drm) -endef - -define KernelPackage/drm/description - Direct Rendering Manager (DRM) core support -endef - -$(eval $(call KernelPackage,drm)) - -define KernelPackage/drm-ttm - SUBMENU:=$(VIDEO_MENU) - TITLE:=GPU memory management subsystem - DEPENDS:=@DISPLAY_SUPPORT +kmod-drm - KCONFIG:=CONFIG_DRM_TTM - FILES:=$(LINUX_DIR)/drivers/gpu/drm/ttm/ttm.ko - AUTOLOAD:=$(call AutoProbe,ttm) -endef - -define KernelPackage/drm-ttm/description - GPU memory management subsystem for devices with multiple GPU memory types. - Will be enabled automatically if a device driver uses it. -endef - -$(eval $(call KernelPackage,drm-ttm)) - -define KernelPackage/drm-kms-helper - SUBMENU:=$(VIDEO_MENU) - TITLE:=CRTC helpers for KMS drivers - DEPENDS:=@DISPLAY_SUPPORT +kmod-drm +kmod-fb +kmod-fb-sys-fops +kmod-fb-cfb-copyarea \ - +kmod-fb-cfb-fillrect +kmod-fb-cfb-imgblt +kmod-fb-sys-ram - KCONFIG:= \ - CONFIG_DRM_KMS_HELPER \ - CONFIG_DRM_KMS_FB_HELPER=y - FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_kms_helper.ko - AUTOLOAD:=$(call AutoProbe,drm_kms_helper) -endef - -define KernelPackage/drm-kms-helper/description - CRTC helpers for KMS drivers. -endef - -$(eval $(call KernelPackage,drm-kms-helper)) - -define KernelPackage/drm-amdgpu - SUBMENU:=$(VIDEO_MENU) - TITLE:=AMDGPU DRM support - DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \ - +kmod-drm-kms-helper +kmod-i2c-algo-bit +amdgpu-firmware - KCONFIG:=CONFIG_DRM_AMDGPU \ - CONFIG_DRM_AMDGPU_SI=y \ - CONFIG_DRM_AMDGPU_CIK=y \ - CONFIG_DRM_AMD_DC=y \ - CONFIG_DEBUG_KERNEL_DC=n - FILES:=$(LINUX_DIR)/drivers/gpu/drm/amd/amdgpu/amdgpu.ko \ - $(LINUX_DIR)/drivers/gpu/drm/scheduler/gpu-sched.ko - AUTOLOAD:=$(call AutoProbe,amdgpu) -endef - -define KernelPackage/drm-amdgpu/description - Direct Rendering Manager (DRM) support for AMDGPU Cards -endef - -$(eval $(call KernelPackage,drm-amdgpu)) - - -define KernelPackage/drm-imx - SUBMENU:=$(VIDEO_MENU) - TITLE:=Freescale i.MX DRM support - DEPENDS:=@TARGET_imx6 +kmod-drm-kms-helper - KCONFIG:=CONFIG_DRM_IMX \ - CONFIG_DRM_FBDEV_EMULATION=y \ - CONFIG_DRM_FBDEV_OVERALLOC=100 \ - CONFIG_IMX_IPUV3_CORE \ - CONFIG_RESET_CONTROLLER=y \ - CONFIG_DRM_IMX_IPUV3 \ - CONFIG_IMX_IPUV3 \ - CONFIG_DRM_GEM_CMA_HELPER=y \ - CONFIG_DRM_KMS_CMA_HELPER=y \ - CONFIG_DRM_IMX_FB_HELPER \ - CONFIG_DRM_IMX_PARALLEL_DISPLAY=n \ - CONFIG_DRM_IMX_TVE=n \ - CONFIG_DRM_IMX_LDB=n \ - CONFIG_DRM_IMX_HDMI=n - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/imx/imxdrm.ko \ - $(LINUX_DIR)/drivers/gpu/ipu-v3/imx-ipu-v3.ko - AUTOLOAD:=$(call AutoLoad,08,imxdrm imx-ipu-v3 imx-ipuv3-crtc) -endef - -define KernelPackage/drm-imx/description - Direct Rendering Manager (DRM) support for Freescale i.MX -endef - -$(eval $(call KernelPackage,drm-imx)) - -define KernelPackage/drm-imx-hdmi - SUBMENU:=$(VIDEO_MENU) - TITLE:=Freescale i.MX HDMI DRM support - DEPENDS:=+kmod-sound-core kmod-drm-imx - KCONFIG:=CONFIG_DRM_IMX_HDMI \ - CONFIG_DRM_DW_HDMI_AHB_AUDIO \ - CONFIG_DRM_DW_HDMI_I2S_AUDIO - FILES:= \ - $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko \ - $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.ko \ - $(LINUX_DIR)/drivers/gpu/drm/imx/dw_hdmi-imx.ko - AUTOLOAD:=$(call AutoLoad,08,dw-hdmi dw-hdmi-ahb-audio.ko dw_hdmi-imx) -endef - -define KernelPackage/drm-imx-hdmi/description - Direct Rendering Manager (DRM) support for Freescale i.MX HDMI -endef - -$(eval $(call KernelPackage,drm-imx-hdmi)) - -define KernelPackage/drm-imx-ldb - SUBMENU:=$(VIDEO_MENU) - TITLE:=Freescale i.MX LVDS DRM support - DEPENDS:=+kmod-backlight kmod-drm-imx - KCONFIG:=CONFIG_DRM_IMX_LDB \ - CONFIG_DRM_PANEL_SIMPLE \ - CONFIG_DRM_PANEL=y \ - CONFIG_DRM_PANEL_SAMSUNG_LD9040=n \ - CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=n \ - CONFIG_DRM_PANEL_LG_LG4573=n \ - CONFIG_DRM_PANEL_LD9040=n \ - CONFIG_DRM_PANEL_LVDS=n \ - CONFIG_DRM_PANEL_S6E8AA0=n \ - CONFIG_DRM_PANEL_SITRONIX_ST7789V=n - FILES:=$(LINUX_DIR)/drivers/gpu/drm/imx/imx-ldb.ko \ - $(LINUX_DIR)/drivers/gpu/drm/panel/panel-simple.ko - AUTOLOAD:=$(call AutoLoad,08,imx-ldb) -endef - -define KernelPackage/drm-imx-ldb/description - Direct Rendering Manager (DRM) support for Freescale i.MX LVDS -endef - -$(eval $(call KernelPackage,drm-imx-ldb)) - -define KernelPackage/drm-radeon - SUBMENU:=$(VIDEO_MENU) - TITLE:=Radeon DRM support - DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-kms-helper \ - +kmod-drm-ttm +kmod-i2c-algo-bit +radeon-firmware - KCONFIG:=CONFIG_DRM_RADEON - FILES:=$(LINUX_DIR)/drivers/gpu/drm/radeon/radeon.ko - AUTOLOAD:=$(call AutoProbe,radeon) -endef - -define KernelPackage/drm-radeon/description - Direct Rendering Manager (DRM) support for Radeon Cards -endef - -$(eval $(call KernelPackage,drm-radeon)) - -# -# Video Capture -# - -define KernelPackage/video-core - SUBMENU:=$(VIDEO_MENU) - TITLE=Video4Linux support - DEPENDS:=@PCI_SUPPORT||USB_SUPPORT +PACKAGE_kmod-i2c-core:kmod-i2c-core - KCONFIG:= \ - CONFIG_MEDIA_SUPPORT \ - CONFIG_MEDIA_CAMERA_SUPPORT=y \ - CONFIG_VIDEO_DEV \ - CONFIG_VIDEO_V4L1=y \ - CONFIG_VIDEO_ALLOW_V4L1=y \ - CONFIG_VIDEO_CAPTURE_DRIVERS=y \ - CONFIG_V4L_USB_DRIVERS=y \ - CONFIG_V4L_PCI_DRIVERS=y \ - CONFIG_V4L_PLATFORM_DRIVERS=y \ - CONFIG_V4L_ISA_PARPORT_DRIVERS=y - FILES:= \ - $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videodev.ko - AUTOLOAD:=$(call AutoLoad,60, videodev v4l2-common) -endef - -define KernelPackage/video-core/description - Kernel modules for Video4Linux support -endef - -$(eval $(call KernelPackage,video-core)) - - -define AddDepends/video - SUBMENU:=$(VIDEO_MENU) - DEPENDS+=kmod-video-core $(1) -endef - -define AddDepends/camera -$(AddDepends/video) - KCONFIG+=CONFIG_MEDIA_USB_SUPPORT=y \ - CONFIG_MEDIA_CAMERA_SUPPORT=y -endef - - -define KernelPackage/video-videobuf2 - TITLE:=videobuf2 lib - DEPENDS:=+kmod-dma-buf - KCONFIG:= \ - CONFIG_VIDEOBUF2_CORE \ - CONFIG_VIDEOBUF2_MEMOPS \ - CONFIG_VIDEOBUF2_VMALLOC - FILES:= \ - $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videobuf2-core.ko@lt4.16 \ - $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videobuf2-v4l2.ko@lt4.16 \ - $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videobuf2-memops.ko@lt4.16 \ - $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videobuf2-vmalloc.ko@lt4.16 \ - $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-common.ko@ge4.16 \ - $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-v4l2.ko@ge4.16 \ - $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-memops.ko@ge4.16 \ - $(LINUX_DIR)/drivers/media/common/videobuf2/videobuf2-vmalloc.ko@ge4.16 - AUTOLOAD:=$(call AutoLoad,65,videobuf2-core videobuf-v4l2 videobuf2-memops videobuf2-vmalloc) - $(call AddDepends/video) -endef - -define KernelPackage/video-videobuf2/description - Kernel modules that implements three basic types of media buffers. -endef - -$(eval $(call KernelPackage,video-videobuf2)) - - -define KernelPackage/video-cpia2 - TITLE:=CPIA2 video driver - DEPENDS:=@USB_SUPPORT +kmod-usb-core - KCONFIG:=CONFIG_VIDEO_CPIA2 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/cpia2/cpia2.ko - AUTOLOAD:=$(call AutoProbe,cpia2) - $(call AddDepends/camera) -endef - -define KernelPackage/video-cpia2/description - Kernel modules for supporting CPIA2 USB based cameras -endef - -$(eval $(call KernelPackage,video-cpia2)) - - -define KernelPackage/video-pwc - TITLE:=Philips USB webcam support - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-video-videobuf2 - KCONFIG:= \ - CONFIG_USB_PWC \ - CONFIG_USB_PWC_DEBUG=n - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/pwc/pwc.ko - AUTOLOAD:=$(call AutoProbe,pwc) - $(call AddDepends/camera) -endef - -define KernelPackage/video-pwc/description - Kernel modules for supporting Philips USB based cameras -endef - -$(eval $(call KernelPackage,video-pwc)) - - -define KernelPackage/video-uvc - TITLE:=USB Video Class (UVC) support - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-video-videobuf2 +kmod-input-core - KCONFIG:= CONFIG_USB_VIDEO_CLASS - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/uvc/uvcvideo.ko - AUTOLOAD:=$(call AutoProbe,uvcvideo) - $(call AddDepends/camera) -endef - -define KernelPackage/video-uvc/description - Kernel modules for supporting USB Video Class (UVC) devices -endef - -$(eval $(call KernelPackage,video-uvc)) - - -define KernelPackage/video-gspca-core - MENU:=1 - TITLE:=GSPCA webcam core support framework - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-input-core +!LINUX_4_14:kmod-video-videobuf2 - KCONFIG:=CONFIG_USB_GSPCA - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_main.ko - AUTOLOAD:=$(call AutoProbe,gspca_main) - $(call AddDepends/camera) -endef - -define KernelPackage/video-gspca-core/description - Kernel modules for supporting GSPCA based webcam devices. Note this is just - the core of the driver, please select a submodule that supports your webcam. -endef - -$(eval $(call KernelPackage,video-gspca-core)) - - -define AddDepends/camera-gspca - SUBMENU:=$(VIDEO_MENU) - DEPENDS+=kmod-video-gspca-core $(1) -endef - - -define KernelPackage/video-gspca-conex - TITLE:=conex webcam support - KCONFIG:=CONFIG_USB_GSPCA_CONEX - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_conex.ko - AUTOLOAD:=$(call AutoProbe,gspca_conex) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-conex/description - The Conexant Camera Driver (conex) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-conex)) - - -define KernelPackage/video-gspca-etoms - TITLE:=etoms webcam support - KCONFIG:=CONFIG_USB_GSPCA_ETOMS - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_etoms.ko - AUTOLOAD:=$(call AutoProbe,gspca_etoms) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-etoms/description - The Etoms USB Camera Driver (etoms) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-etoms)) - - -define KernelPackage/video-gspca-finepix - TITLE:=finepix webcam support - KCONFIG:=CONFIG_USB_GSPCA_FINEPIX - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_finepix.ko - AUTOLOAD:=$(call AutoProbe,gspca_finepix) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-finepix/description - The Fujifilm FinePix USB V4L2 driver (finepix) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-finepix)) - - -define KernelPackage/video-gspca-mars - TITLE:=mars webcam support - KCONFIG:=CONFIG_USB_GSPCA_MARS - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_mars.ko - AUTOLOAD:=$(call AutoProbe,gspca_mars) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-mars/description - The Mars USB Camera Driver (mars) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-mars)) - - -define KernelPackage/video-gspca-mr97310a - TITLE:=mr97310a webcam support - KCONFIG:=CONFIG_USB_GSPCA_MR97310A - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_mr97310a.ko - AUTOLOAD:=$(call AutoProbe,gspca_mr97310a) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-mr97310a/description - The Mars-Semi MR97310A USB Camera Driver (mr97310a) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-mr97310a)) - - -define KernelPackage/video-gspca-ov519 - TITLE:=ov519 webcam support - KCONFIG:=CONFIG_USB_GSPCA_OV519 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov519.ko - AUTOLOAD:=$(call AutoProbe,gspca_ov519) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-ov519/description - The OV519 USB Camera Driver (ov519) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-ov519)) - - -define KernelPackage/video-gspca-ov534 - TITLE:=ov534 webcam support - KCONFIG:=CONFIG_USB_GSPCA_OV534 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov534.ko - AUTOLOAD:=$(call AutoProbe,gspca_ov534) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-ov534/description - The OV534 USB Camera Driver (ov534) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-ov534)) - - -define KernelPackage/video-gspca-ov534-9 - TITLE:=ov534-9 webcam support - KCONFIG:=CONFIG_USB_GSPCA_OV534_9 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov534_9.ko - AUTOLOAD:=$(call AutoProbe,gspca_ov534_9) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-ov534-9/description - The OV534-9 USB Camera Driver (ov534_9) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-ov534-9)) - - -define KernelPackage/video-gspca-pac207 - TITLE:=pac207 webcam support - KCONFIG:=CONFIG_USB_GSPCA_PAC207 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_pac207.ko - AUTOLOAD:=$(call AutoProbe,gspca_pac207) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-pac207/description - The Pixart PAC207 USB Camera Driver (pac207) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-pac207)) - - -define KernelPackage/video-gspca-pac7311 - TITLE:=pac7311 webcam support - KCONFIG:=CONFIG_USB_GSPCA_PAC7311 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_pac7311.ko - AUTOLOAD:=$(call AutoProbe,gspca_pac7311) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-pac7311/description - The Pixart PAC7311 USB Camera Driver (pac7311) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-pac7311)) - - -define KernelPackage/video-gspca-se401 - TITLE:=se401 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SE401 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_se401.ko - AUTOLOAD:=$(call AutoProbe,gspca_se401) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-se401/description - The SE401 USB Camera Driver kernel module -endef - -$(eval $(call KernelPackage,video-gspca-se401)) - - -define KernelPackage/video-gspca-sn9c20x - TITLE:=sn9c20x webcam support - KCONFIG:=CONFIG_USB_GSPCA_SN9C20X - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sn9c20x.ko - AUTOLOAD:=$(call AutoProbe,gspca_sn9c20x) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sn9c20x/description - The SN9C20X USB Camera Driver (sn9c20x) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sn9c20x)) - - -define KernelPackage/video-gspca-sonixb - TITLE:=sonixb webcam support - KCONFIG:=CONFIG_USB_GSPCA_SONIXB - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sonixb.ko - AUTOLOAD:=$(call AutoProbe,gspca_sonixb) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sonixb/description - The SONIX Bayer USB Camera Driver (sonixb) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sonixb)) - - -define KernelPackage/video-gspca-sonixj - TITLE:=sonixj webcam support - KCONFIG:=CONFIG_USB_GSPCA_SONIXJ - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sonixj.ko - AUTOLOAD:=$(call AutoProbe,gspca_sonixj) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sonixj/description - The SONIX JPEG USB Camera Driver (sonixj) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sonixj)) - - -define KernelPackage/video-gspca-spca500 - TITLE:=spca500 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA500 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca500.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca500) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca500/description - The SPCA500 USB Camera Driver (spca500) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca500)) - - -define KernelPackage/video-gspca-spca501 - TITLE:=spca501 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA501 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca501.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca501) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca501/description - The SPCA501 USB Camera Driver (spca501) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca501)) - - -define KernelPackage/video-gspca-spca505 - TITLE:=spca505 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA505 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca505.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca505) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca505/description - The SPCA505 USB Camera Driver (spca505) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca505)) - - -define KernelPackage/video-gspca-spca506 - TITLE:=spca506 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA506 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca506.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca506) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca506/description - The SPCA506 USB Camera Driver (spca506) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca506)) - - -define KernelPackage/video-gspca-spca508 - TITLE:=spca508 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA508 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca508.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca508) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca508/description - The SPCA508 USB Camera Driver (spca508) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca508)) - - -define KernelPackage/video-gspca-spca561 - TITLE:=spca561 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SPCA561 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca561.ko - AUTOLOAD:=$(call AutoProbe,gspca_spca561) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-spca561/description - The SPCA561 USB Camera Driver (spca561) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-spca561)) - - -define KernelPackage/video-gspca-sq905 - TITLE:=sq905 webcam support - KCONFIG:=CONFIG_USB_GSPCA_SQ905 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sq905.ko - AUTOLOAD:=$(call AutoProbe,gspca_sq905) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sq905/description - The SQ Technologies SQ905 based USB Camera Driver (sq905) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sq905)) - - -define KernelPackage/video-gspca-sq905c - TITLE:=sq905c webcam support - KCONFIG:=CONFIG_USB_GSPCA_SQ905C - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sq905c.ko - AUTOLOAD:=$(call AutoProbe,gspca_sq905c) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sq905c/description - The SQ Technologies SQ905C based USB Camera Driver (sq905c) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sq905c)) - - -define KernelPackage/video-gspca-stk014 - TITLE:=stk014 webcam support - KCONFIG:=CONFIG_USB_GSPCA_STK014 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_stk014.ko - AUTOLOAD:=$(call AutoProbe,gspca_stk014) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-stk014/description - The Syntek DV4000 (STK014) USB Camera Driver (stk014) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-stk014)) - - -define KernelPackage/video-gspca-sunplus - TITLE:=sunplus webcam support - KCONFIG:=CONFIG_USB_GSPCA_SUNPLUS - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sunplus.ko - AUTOLOAD:=$(call AutoProbe,gspca_sunplus) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-sunplus/description - The SUNPLUS USB Camera Driver (sunplus) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-sunplus)) - - -define KernelPackage/video-gspca-t613 - TITLE:=t613 webcam support - KCONFIG:=CONFIG_USB_GSPCA_T613 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_t613.ko - AUTOLOAD:=$(call AutoProbe,gspca_t613) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-t613/description - The T613 (JPEG Compliance) USB Camera Driver (t613) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-t613)) - - -define KernelPackage/video-gspca-tv8532 - TITLE:=tv8532 webcam support - KCONFIG:=CONFIG_USB_GSPCA_TV8532 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_tv8532.ko - AUTOLOAD:=$(call AutoProbe,gspca_tv8532) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-tv8532/description - The TV8532 USB Camera Driver (tv8532) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-tv8532)) - - -define KernelPackage/video-gspca-vc032x - TITLE:=vc032x webcam support - KCONFIG:=CONFIG_USB_GSPCA_VC032X - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_vc032x.ko - AUTOLOAD:=$(call AutoProbe,gspca_vc032x) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-vc032x/description - The VC032X USB Camera Driver (vc032x) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-vc032x)) - - -define KernelPackage/video-gspca-zc3xx - TITLE:=zc3xx webcam support - KCONFIG:=CONFIG_USB_GSPCA_ZC3XX - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_zc3xx.ko - AUTOLOAD:=$(call AutoProbe,gspca_zc3xx) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-zc3xx/description - The ZC3XX USB Camera Driver (zc3xx) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-zc3xx)) - - -define KernelPackage/video-gspca-m5602 - TITLE:=m5602 webcam support - KCONFIG:=CONFIG_USB_M5602 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/m5602/gspca_m5602.ko - AUTOLOAD:=$(call AutoProbe,gspca_m5602) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-m5602/description - The ALi USB m5602 Camera Driver (m5602) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-m5602)) - - -define KernelPackage/video-gspca-stv06xx - TITLE:=stv06xx webcam support - KCONFIG:=CONFIG_USB_STV06XX - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/stv06xx/gspca_stv06xx.ko - AUTOLOAD:=$(call AutoProbe,gspca_stv06xx) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-stv06xx/description - The STV06XX USB Camera Driver (stv06xx) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-stv06xx)) - - -define KernelPackage/video-gspca-gl860 - TITLE:=gl860 webcam support - KCONFIG:=CONFIG_USB_GL860 - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gl860/gspca_gl860.ko - AUTOLOAD:=$(call AutoProbe,gspca_gl860) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-gl860/description - The GL860 USB Camera Driver (gl860) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-gl860)) - - -define KernelPackage/video-gspca-jeilinj - TITLE:=jeilinj webcam support - KCONFIG:=CONFIG_USB_GSPCA_JEILINJ - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_jeilinj.ko - AUTOLOAD:=$(call AutoProbe,gspca_jeilinj) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-jeilinj/description - The JEILINJ USB Camera Driver (jeilinj) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-jeilinj)) - - -define KernelPackage/video-gspca-konica - TITLE:=konica webcam support - KCONFIG:=CONFIG_USB_GSPCA_KONICA - FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_konica.ko - AUTOLOAD:=$(call AutoProbe,gspca_konica) - $(call AddDepends/camera-gspca) -endef - -define KernelPackage/video-gspca-konica/description - The Konica USB Camera Driver (konica) kernel module -endef - -$(eval $(call KernelPackage,video-gspca-konica)) diff --git a/feeds/ipq807x/linux/modules/virt.mk b/feeds/ipq807x/linux/modules/virt.mk deleted file mode 100644 index a9a0b538f..000000000 --- a/feeds/ipq807x/linux/modules/virt.mk +++ /dev/null @@ -1,73 +0,0 @@ -# -# Copyright (C) 2016 Yousong Zhou -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -define KernelPackage/irqbypass - SUBMENU:=Virtualization - TITLE:=IRQ offload/bypass manager - KCONFIG:=CONFIG_IRQ_BYPASS_MANAGER - HIDDEN:=1 - FILES:= $(LINUX_DIR)/virt/lib/irqbypass.ko - AUTOLOAD:=$(call AutoProbe,irqbypass.ko) -endef -$(eval $(call KernelPackage,irqbypass)) - - -define KernelPackage/kvm-x86 - SUBMENU:=Virtualization - TITLE:=Kernel-based Virtual Machine (KVM) support - DEPENDS:=@TARGET_x86_generic||TARGET_x86_64 +kmod-irqbypass - KCONFIG:=\ - CONFIG_VIRTUALIZATION=y \ - CONFIG_KVM - FILES:= $(LINUX_DIR)/arch/$(LINUX_KARCH)/kvm/kvm.ko - AUTOLOAD:=$(call AutoProbe,kvm.ko) -endef - -define KernelPackage/kvm-x86/description - Support hosting fully virtualized guest machines using hardware - virtualization extensions. You will need a fairly recent - processor equipped with virtualization extensions. You will also - need to select one or more of the processor modules. - - This module provides access to the hardware capabilities through - a character device node named /dev/kvm. -endef - -$(eval $(call KernelPackage,kvm-x86)) - - -define KernelPackage/kvm-intel - SUBMENU:=Virtualization - TITLE:=KVM for Intel processors support - DEPENDS:=+kmod-kvm-x86 - KCONFIG:=CONFIG_KVM_INTEL - FILES:= $(LINUX_DIR)/arch/$(LINUX_KARCH)/kvm/kvm-intel.ko - AUTOLOAD:=$(call AutoProbe,kvm-intel.ko) -endef - -define KernelPackage/kvm-intel/description - Provides support for KVM on Intel processors equipped with the VT - extensions. -endef - -$(eval $(call KernelPackage,kvm-intel)) - - -define KernelPackage/kvm-amd - SUBMENU:=Virtualization - TITLE:=KVM for AMD processors support - DEPENDS:=+kmod-kvm-x86 - KCONFIG:=CONFIG_KVM_AMD - FILES:= $(LINUX_DIR)/arch/$(LINUX_KARCH)/kvm/kvm-amd.ko - AUTOLOAD:=$(call AutoProbe,kvm-amd.ko) -endef - -define KernelPackage/kvm-amd/description - Provides support for KVM on AMD processors equipped with the AMD-V - (SVM) extensions. -endef - -$(eval $(call KernelPackage,kvm-amd)) diff --git a/feeds/ipq807x/linux/modules/w1.mk b/feeds/ipq807x/linux/modules/w1.mk deleted file mode 100644 index 6ac7458e4..000000000 --- a/feeds/ipq807x/linux/modules/w1.mk +++ /dev/null @@ -1,193 +0,0 @@ -# -# Copyright (C) 2008-2010 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -W1_MENU:=W1 support -W1_MASTERS_DIR:=$(LINUX_DIR)/drivers/w1/masters -W1_SLAVES_DIR:=$(LINUX_DIR)/drivers/w1/slaves - -define KernelPackage/w1 - SUBMENU:=$(W1_MENU) - TITLE:=Dallas's 1-wire support - KCONFIG:=CONFIG_W1 - FILES:=$(LINUX_DIR)/drivers/w1/wire.ko - DEPENDS:=+kmod-hwmon-core -endef - -define KernelPackage/w1/description - Kernel module for Dallas's 1-wire support -endef - -$(eval $(call KernelPackage,w1)) - - -define AddDepends/w1 - SUBMENU:=$(W1_MENU) - DEPENDS+=kmod-w1 $(1) -endef - - -# -# 1-wire masters -# -define KernelPackage/w1-master-gpio - TITLE:=GPIO 1-wire bus master driver - DEPENDS:=@GPIO_SUPPORT - KCONFIG:=CONFIG_W1_MASTER_GPIO - FILES:=$(W1_MASTERS_DIR)/w1-gpio.ko - AUTOLOAD:=$(call AutoProbe,w1-gpio) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-master-gpio/description - Kernel module for the GPIO 1-wire bus master driver -endef - -$(eval $(call KernelPackage,w1-master-gpio)) - -define KernelPackage/w1-master-ds2482 - TITLE:=DS2482 1-wire i2c bus master driver - KCONFIG:=CONFIG_W1_MASTER_DS2482 - FILES:=$(W1_MASTERS_DIR)/ds2482.ko - AUTOLOAD:=$(call AutoProbe,ds2482) - $(call AddDepends/w1,+kmod-i2c-core) -endef - -define KernelPackage/w1-master-ds2482/description - Kernel module for the DS2482 i2c 1-wire bus master driver - NOTE: Init with: echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device - or use owfs -endef - -$(eval $(call KernelPackage,w1-master-ds2482)) - - -define KernelPackage/w1-master-ds2490 - TITLE:=DS2490 1-wire usb bus master driver - DEPENDS:=@USB_SUPPORT +kmod-usb-core - KCONFIG:=CONFIG_W1_MASTER_DS2490 - FILES:=$(W1_MASTERS_DIR)/ds2490.ko - AUTOLOAD:=$(call AutoProbe,ds2490) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-master-ds2490/description - Kernel module for the DS2490 usb 1-wire bus master driver -endef - -$(eval $(call KernelPackage,w1-master-ds2490)) - - -define KernelPackage/w1-master-mxc - TITLE:=Freescale MXC 1-wire busmaster - DEPENDS:=@TARGET_imx6 - KCONFIG:=CONFIG_W1_MASTER_MXC - FILES:=$(W1_MASTERS_DIR)/mxc_w1.ko - AUTOLOAD:=$(call AutoProbe,mxc_w1) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-master-mxc/description - Kernel module for 1-wire Freescale MXC 1-wire busmaster -endef - -$(eval $(call KernelPackage,w1-master-mxc)) - - -# -# 1-wire slaves -# -define KernelPackage/w1-slave-therm - TITLE:=Thermal family implementation - KCONFIG:=CONFIG_W1_SLAVE_THERM - FILES:=$(W1_SLAVES_DIR)/w1_therm.ko - AUTOLOAD:=$(call AutoProbe,w1_therm) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-slave-therm/description - Kernel module for 1-wire thermal sensors -endef - -$(eval $(call KernelPackage,w1-slave-therm)) - - -define KernelPackage/w1-slave-smem - TITLE:=Simple 64bit memory family implementation - KCONFIG:=CONFIG_W1_SLAVE_SMEM - FILES:=$(W1_SLAVES_DIR)/w1_smem.ko - AUTOLOAD:=$(call AutoProbe,w1_smem) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-slave-smem/description - Kernel module for 1-wire simple 64bit memory rom(ds2401/ds2411/ds1990*) -endef - -$(eval $(call KernelPackage,w1-slave-smem)) - -define KernelPackage/w1-slave-ds2431 - TITLE:=DS2431 1kb EEPROM driver - KCONFIG:= CONFIG_W1_SLAVE_DS2431 - FILES:=$(W1_SLAVES_DIR)/w1_ds2431.ko - AUTOLOAD:=$(call AutoProbe,w1_ds2431) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-slave-ds2431/description - Kernel module for 1-wire 1kb EEPROM (DS2431) -endef - -$(eval $(call KernelPackage,w1-slave-ds2431)) - -define KernelPackage/w1-slave-ds2433 - TITLE:=DS2433 4kb EEPROM driver - KCONFIG:= \ - CONFIG_W1_SLAVE_DS2433 \ - CONFIG_W1_SLAVE_DS2433_CRC=n - FILES:=$(W1_SLAVES_DIR)/w1_ds2433.ko - AUTOLOAD:=$(call AutoProbe,w1_ds2433) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-slave-ds2433/description - Kernel module for 1-wire 4kb EEPROM (DS2433) -endef - -$(eval $(call KernelPackage,w1-slave-ds2433)) - - -define KernelPackage/w1-slave-ds2760 - TITLE:=Dallas 2760 battery monitor chip (HP iPAQ & others) - KCONFIG:= \ - CONFIG_W1_SLAVE_DS2760 \ - CONFIG_W1_SLAVE_DS2433_CRC=n - FILES:=$(W1_SLAVES_DIR)/w1_ds2760.ko - AUTOLOAD:=$(call AutoProbe,w1_ds2760) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-slave-ds2760/description - Kernel module for 1-wire DS2760 battery monitor chip support -endef - -$(eval $(call KernelPackage,w1-slave-ds2760)) - - -define KernelPackage/w1-slave-ds2413 - TITLE:=DS2413 2 Ch. Addressable Switch - KCONFIG:= \ - CONFIG_W1_SLAVE_DS2413 - FILES:=$(W1_SLAVES_DIR)/w1_ds2413.ko - AUTOLOAD:=$(call AutoProbe,w1_ds2413) - $(call AddDepends/w1) -endef - -define KernelPackage/w1-slave-ds2413/description - Kernel module for 1-wire DS2413 Dual Channel Addressable Switch support -endef - -$(eval $(call KernelPackage,w1-slave-ds2413)) diff --git a/feeds/ipq807x/linux/modules/wireless.mk b/feeds/ipq807x/linux/modules/wireless.mk deleted file mode 100644 index f7a40ba10..000000000 --- a/feeds/ipq807x/linux/modules/wireless.mk +++ /dev/null @@ -1,42 +0,0 @@ -# -# Copyright (C) 2006-2008 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -WIRELESS_MENU:=Wireless Drivers - -define KernelPackage/net-prism54 - SUBMENU:=$(WIRELESS_MENU) - TITLE:=Intersil Prism54 support - DEPENDS:=@PCI_SUPPORT +@DRIVER_WEXT_SUPPORT +prism54-firmware - KCONFIG:=CONFIG_PRISM54 - FILES:= \ - $(LINUX_DIR)/drivers/net/wireless/intersil/prism54/prism54.ko - AUTOLOAD:=$(call AutoProbe,prism54) -endef - -define KernelPackage/net-prism54/description - Kernel modules for Intersil Prism54 support -endef - -$(eval $(call KernelPackage,net-prism54)) - - -define KernelPackage/net-rtl8192su - SUBMENU:=$(WIRELESS_MENU) - TITLE:=RTL8192SU support (staging) - DEPENDS:=@USB_SUPPORT +@DRIVER_WEXT_SUPPORT +kmod-usb-core +rtl8192su-firmware - KCONFIG:=\ - CONFIG_STAGING=y \ - CONFIG_R8712U - FILES:=$(LINUX_DIR)/drivers/staging/rtl8712/r8712u.ko - AUTOLOAD:=$(call AutoProbe,r8712u) -endef - -define KernelPackage/net-rtl8192su/description - Kernel modules for RealTek RTL8712 and RTL81XXSU fullmac support. -endef - -$(eval $(call KernelPackage,net-rtl8192su)) diff --git a/feeds/ipq807x/linux/modules/wpan.mk b/feeds/ipq807x/linux/modules/wpan.mk deleted file mode 100644 index dab8a0cb7..000000000 --- a/feeds/ipq807x/linux/modules/wpan.mk +++ /dev/null @@ -1,152 +0,0 @@ -# -# Copyright (C) 2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. - -WPAN_MENU:=WPAN 802.15.4 Support - -define KernelPackage/ieee802154 - SUBMENU:=$(WPAN_MENU) - TITLE:=IEEE-802.15.4 support - KCONFIG:= \ - CONFIG_IEEE802154 \ - CONFIG_IEEE802154_SOCKET=y \ - CONFIG_IEEE802154_NL802154_EXPERIMENTAL=n - FILES:= \ - $(LINUX_DIR)/net/ieee802154/ieee802154.ko \ - $(LINUX_DIR)/net/ieee802154/ieee802154_socket.ko - AUTOLOAD:=$(call AutoLoad,90,ieee802154 ieee802154_socket) -endef - -define KernelPackage/ieee802154/description - IEEE Std 802.15.4 defines a low data rate, low power and low - complexity short range wireless personal area networks. It was - designed to organise networks of sensors, switches, etc automation - devices. Maximum allowed data rate is 250 kb/s and typical personal - operating space around 10m. -endef - -$(eval $(call KernelPackage,ieee802154)) - -define KernelPackage/mac802154 - SUBMENU:=$(WPAN_MENU) - TITLE:=MAC-802.15.4 support - DEPENDS:=+kmod-ieee802154 +kmod-crypto-aead +kmod-lib-crc-ccitt - KCONFIG:= \ - CONFIG_MAC802154 \ - CONFIG_IEEE802154_DRIVERS=y - FILES:=$(LINUX_DIR)/net/mac802154/mac802154.ko - AUTOLOAD:=$(call AutoLoad,91,mac802154) -endef - -define KernelPackage/mac802154/description - This option enables the hardware independent IEEE 802.15.4 - networking stack for SoftMAC devices (the ones implementing - only PHY level of IEEE 802.15.4 standard). - - Note: this implementation is neither certified, nor feature - complete! Compatibility with other implementations hasn't - been tested yet! -endef - -$(eval $(call KernelPackage,mac802154)) - -define KernelPackage/fakelb - SUBMENU:=$(WPAN_MENU) - TITLE:=Fake LR-WPAN driver - DEPENDS:=+kmod-mac802154 - KCONFIG:=CONFIG_IEEE802154_FAKELB - FILES:=$(LINUX_DIR)/drivers/net/ieee802154/fakelb.ko - AUTOLOAD:=$(call AutoLoad,92,fakelb) -endef - -define KernelPackage/fakelb/description - Say Y here to enable the fake driver that can emulate a net - of several interconnected radio devices. -endef - -$(eval $(call KernelPackage,fakelb)) - -define KernelPackage/atusb - SUBMENU:=$(WPAN_MENU) - TITLE:=ATUSB transceiver driver - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-mac802154 - KCONFIG:=CONFIG_IEEE802154_ATUSB - FILES:=$(LINUX_DIR)/drivers/net/ieee802154/atusb.ko - AUTOLOAD:=$(call AutoProbe,atusb) -endef - -$(eval $(call KernelPackage,atusb)) - -define KernelPackage/at86rf230 - SUBMENU:=$(WPAN_MENU) - TITLE:=AT86RF230 transceiver driver - DEPENDS:=+kmod-mac802154 +kmod-regmap-spi - KCONFIG:=CONFIG_IEEE802154_AT86RF230 \ - CONFIG_IEEE802154_AT86RF230_DEBUGFS=n \ - CONFIG_SPI=y \ - CONFIG_SPI_MASTER=y - FILES:=$(LINUX_DIR)/drivers/net/ieee802154/at86rf230.ko - AUTOLOAD:=$(call AutoProbe,at86rf230) -endef - -$(eval $(call KernelPackage,at86rf230)) - -define KernelPackage/mrf24j40 - SUBMENU:=$(WPAN_MENU) - TITLE:=MRF24J40 transceiver driver - DEPENDS:=+kmod-mac802154 +kmod-regmap-spi - KCONFIG:=CONFIG_IEEE802154_MRF24J40 \ - CONFIG_SPI=y \ - CONFIG_SPI_MASTER=y - FILES:=$(LINUX_DIR)/drivers/net/ieee802154/mrf24j40.ko - AUTOLOAD:=$(call AutoProbe,mrf24j40) -endef - -$(eval $(call KernelPackage,mrf24j40)) - -define KernelPackage/cc2520 - SUBMENU:=$(WPAN_MENU) - TITLE:=CC2520 transceiver driver - DEPENDS:=+kmod-mac802154 - KCONFIG:=CONFIG_IEEE802154_CC2520 \ - CONFIG_SPI=y \ - CONFIG_SPI_MASTER=y - FILES:=$(LINUX_DIR)/drivers/net/ieee802154/cc2520.ko - AUTOLOAD:=$(call AutoProbe,cc2520) -endef - -$(eval $(call KernelPackage,cc2520)) - - -define KernelPackage/ca8210 - SUBMENU:=$(WPAN_MENU) - TITLE:=CA8210 transceiver driver - DEPENDS:=+kmod-mac802154 - KCONFIG:=CONFIG_IEEE802154_CA8210 \ - CONFIG_SPI=y \ - CONFIG_SPI_MASTER=y \ - CONFIG_IEEE802154_CA8210_DEBUGFS=n - FILES:=$(LINUX_DIR)/drivers/net/ieee802154/ca8210.ko - AUTOLOAD:=$(call AutoProbe,ca8210) -endef - -$(eval $(call KernelPackage,ca8210)) - - -define KernelPackage/ieee802154-6lowpan - SUBMENU:=$(WPAN_MENU) - TITLE:= 6LoWPAN support over IEEE-802.15.4 - DEPENDS:=+kmod-6lowpan +kmod-ieee802154 - KCONFIG:=CONFIG_IEEE802154_6LOWPAN - FILES:= \ - $(LINUX_DIR)/net/ieee802154/6lowpan/ieee802154_6lowpan.ko - AUTOLOAD:=$(call AutoLoad,91,ieee802154_6lowpan) -endef - -define KernelPackage/ieee802154-6lowpan/description - IPv6 compression over IEEE 802.15.4 -endef - -$(eval $(call KernelPackage,ieee802154-6lowpan)) diff --git a/feeds/ipq807x/qca-nss-clients/Makefile b/feeds/ipq807x/qca-nss-clients/Makefile deleted file mode 100644 index bb89a9e15..000000000 --- a/feeds/ipq807x/qca-nss-clients/Makefile +++ /dev/null @@ -1,635 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=qca-nss-clients -PKG_SOURCE_PROTO:=git -PKG_BRANCH:=master -PKG_RELEASE:=2 -PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-clients -PKG_MIRROR_HASH:=802bf8b2dac8da0549e108b873afd982d127370c07d6574ece71f902eafe7698 -PKG_VERSION:=153998d70fdba508a59a28c13a606032cbf32686 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=$(PKG_VERSION) - -#PKG_BUILD_DEPENDS := PACKAGE_kmod-qca-nss-crypto:kmod-qca-nss-crypto -MAKE_OPTS:= - -include $(INCLUDE_DIR)/package.mk - -# Keep default as ipq806x for branches that does not have subtarget framework -subtarget:=$(SUBTARGET) - -# DTLS Manager v2.0 for Hawkeye/Cypress - DTLSMGR_DIR:=v2.0 -# IPsec Manager v2.0 for Hawkeye/Cypress - IPSECMGR_DIR:=v2.0 - -define KernelPackage/qca-nss-drv-tun6rd - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - tun6rd - DEPENDS:=+kmod-qca-nss-drv +kmod-sit @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/qca-nss-tun6rd.ko - AUTOLOAD:=$(call AutoLoad,60,qca-nss-tun6rd) -endef - -define KernelPackage/qca-nss-drv-tun6rd/Description -Kernel modules for NSS connection manager - Support for 6rd tunnel -endef - -define KernelPackage/qca-nss-drv-dtlsmgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - dtlsmgr - DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-cfi-cryptoapi @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/dtls/$(DTLSMGR_DIR)/qca-nss-dtlsmgr.ko -endef - -define KernelPackage/qca-nss-drv-dtls/Description -Kernel modules for NSS connection manager - Support for DTLS sessions -endef - -define KernelPackage/qca-nss-drv-tlsmgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - tlsmgr - DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx +kmod-qca-nss-drv +kmod-qca-nss-cfi @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/tls/qca-nss-tlsmgr.ko -endef - -define KernelPackage/qca-nss-drv-tls/Description -Kernel modules for NSS connection manager - Support for TLS sessions -endef - -define KernelPackage/qca-nss-drv-l2tpv2 - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - l2tp - DEPENDS:=+kmod-qca-nss-drv +kmod-ppp +kmod-l2tp @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/l2tp/l2tpv2/qca-nss-l2tpv2.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-l2tpv2) -endef - -define KernelPackage/qca-nss-drv-l2tp/Description -Kernel modules for NSS connection manager - Support for l2tp tunnel -endef - -define KernelPackage/qca-nss-drv-pptp - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - PPTP - DEPENDS:=+kmod-qca-nss-drv +kmod-pptp @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/pptp/qca-nss-pptp.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-pptp) -endef - -define KernelPackage/qca-nss-drv-pptp/Description -Kernel modules for NSS connection manager - Support for PPTP tunnel -endef - -define KernelPackage/qca-nss-drv-pppoe - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - PPPoE - DEPENDS:=+kmod-qca-nss-drv +kmod-pppoe @!LINUX_3_18 \ - +!(TARGET_ipq_ipq807x_QSDK_256||TARGET_ipq_ipq60xx_QSDK_256):kmod-bonding - FILES:=$(PKG_BUILD_DIR)/pppoe/qca-nss-pppoe.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-pppoe) -endef - -define KernelPackage/qca-nss-drv-pppoe/Description -Kernel modules for NSS connection manager - Support for PPPoE -endef - -define KernelPackage/qca-nss-drv-map-t - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - MAP-T - DEPENDS:=+kmod-qca-nss-drv +kmod-nat46 @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/map/map-t/qca-nss-map-t.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-map-t) -endef - -define KernelPackage/qca-nss-drv-map-t/Description -Kernel modules for NSS connection manager - Support for MAP-T -endef - -define KernelPackage/qca-nss-drv-gre - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - GRE - DEPENDS:=@TARGET_ipq_ipq806x||TARGET_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \ - +kmod-qca-nss-drv @!LINUX_3_18 +kmod-gre6 - FILES:=$(PKG_BUILD_DIR)/gre/qca-nss-gre.ko $(PKG_BUILD_DIR)/gre/test/qca-nss-gre-test.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-gre) -endef - -define KernelPackage/qca-nss-drv-gre/Description -Kernel modules for NSS connection manager - Support for GRE -endef - -define KernelPackage/qca-nss-drv-tunipip6 - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (connection manager) - DS-lite and ipip6 Tunnel - DEPENDS:=+kmod-qca-nss-drv +kmod-iptunnel6 +kmod-ip6-tunnel @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/tunipip6/qca-nss-tunipip6.ko - AUTOLOAD:=$(call AutoLoad,60,qca-nss-tunipip6) -endef - -define KernelPackage/qca-nss-drv-tunipip6/Description -Kernel modules for NSS connection manager -Add support for DS-lite and ipip6 tunnel -endef - -define KernelPackage/qca-nss-drv-profile - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 - TITLE:=Profiler for QCA NSS driver (IPQ806x) - FILES:=$(PKG_BUILD_DIR)/profiler/qca-nss-profile-drv.ko -endef - -define KernelPackage/qca-nss-drv-profile/Description -This package contains a NSS driver profiler for QCA chipset -endef - -define KernelPackage/qca-nss-drv-ipsecmgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (ipsec manager) - ipsecmgr - DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx \ - +kmod-qca-nss-drv +kmod-qca-nss-cfi-cryptoapi +kmod-qca-nss-cfi-ocf @!LINUX_3_18 -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2),) - DEPENDS:=+kmod-qca-nss-drv-l2tpv2 -endif - FILES:=$(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/qca-nss-ipsecmgr.ko - AUTOLOAD:=$(call AutoLoad,60,qca-nss-ipsecmgr) -endef - -define KernelPackage/qca-nss-drv-ipsecmgr/Description -Kernel module for NSS IPsec offload manager -endef - -define KernelPackage/qca-nss-drv-ipsecmgr-klips - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS (ipsec klips) - DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx \ - +kmod-qca-nss-drv-ipsecmgr kmod-qca-nss-ecm - FILES:=$(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/plugins/klips/qca-nss-ipsec-klips.ko -endef - -define KernelPackage/qca-nss-drv-ipsecmgr-klips/Description -NSS Kernel module for IPsec klips offload -endef - - -define KernelPackage/qca-nss-drv-capwapmgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-drv-dtlsmgr @!LINUX_3_18 - TITLE:=NSS CAPWAP Manager for QCA NSS driver (IPQ806x) - FILES:=$(PKG_BUILD_DIR)/capwapmgr/qca-nss-capwapmgr.ko -endef - -define KernelPackage/qca-nss-drv-capwapmgr/Description -This package contains a NSS CAPWAP Manager -endef - -define KernelPackage/qca-nss-drv-bridge-mgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS bridge manager - DEPENDS:=@TARGET_ipq807x_ipq807x||TARGET_ipq807x_ipq60xx \ - +TARGET_ipq_ipq807x:kmod-qca-nss-drv-vlan-mgr \ - +TARGET_ipq_ipq807x_ipq807x:kmod-qca-nss-drv-vlan-mgr \ - +TARGET_ipq807x:kmod-qca-nss-drv-vlan-mgr \ - +TARGET_ipq807x_ipq807x:kmod-qca-nss-drv-vlan-mgr \ - +TARGET_ipq_ipq60xx:kmod-qca-nss-drv-vlan-mgr \ - +TARGET_ipq807x_ipq60xx:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \ - +!(TARGET_ipq_ipq807x_QSDK_256||TARGET_ipq_ipq60xx_QSDK_256):kmod-bonding - FILES:=$(PKG_BUILD_DIR)/bridge/qca-nss-bridge-mgr.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-bridge-mgr) -endef - -define KernelPackage/qca-nss-drv-bridge-mgr/Description -Kernel modules for NSS bridge manager -endef - -define KernelPackage/qca-nss-drv-vlan-mgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS vlan manager - DEPENDS:=@TARGET_ipq807x_ipq807x||TARGET_ipq807x_ipq60xx +kmod-qca-nss-drv @!LINUX_3_18 \ - +!(TARGET_ipq_ipq807x_QSDK_256||TARGET_ipq_ipq60xx_QSDK_256):kmod-bonding - FILES:=$(PKG_BUILD_DIR)/vlan/qca-nss-vlan.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-vlan) -endef - -define KernelPackage/qca-nss-drv-vlan-mgr/Description -Kernel modules for NSS vlan manager -endef - -define KernelPackage/qca-nss-drv-qdisc - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Support - TITLE:=Qdisc for configuring shapers in NSS - DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/nss_qdisc/qca-nss-qdisc.ko - AUTOLOAD:=$(call AutoLoad,58,qca-nss-qdisc) -endef - -define KernelPackage/qca-nss-drv-qdisc/Description -Linux qdisc that aids in configuring shapers in the NSS -endef - -define KernelPackage/qca-nss-drv-igs - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Support - TITLE:=Action for offloading traffic to an IFB interface to perform ingress shaping. - DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \ - +kmod-qca-nss-drv +kmod-sched-core +kmod-ifb +kmod-qca-nss-drv-qdisc @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/nss_qdisc/igs/act_nssmirred.ko -endef - -define KernelPackage/qca-nss-drv-igs/Description -Linux action that helps in offloading traffic to an IFB interface to perform ingress shaping. -endef - -define KernelPackage/qca-nss-drv-lag-mgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS LAG manager - DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 \ - +TARGET_ipq_ipq807x:kmod-qca-nss-drv-vlan-mgr \ - +TARGET_ipq_ipq807x_ipq807x:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \ - +TARGET_ipq807x:kmod-qca-nss-drv-vlan-mgr \ - +TARGET_ipq807x_ipq807x:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \ - +TARGET_ipq_ipq60xx:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \ - +TARGET_ipq807x_ipq60xx:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \ - +kmod-bonding - FILES:=$(PKG_BUILD_DIR)/lag/qca-nss-lag-mgr.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-lag-mgr) -endef - -define KernelPackage/qca-nss-drv-lag-mgr/Description -Kernel modules for NSS LAG manager -endef - -define KernelPackage/qca-nss-drv-netlink - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=@TARGET_ipq807x||TARGET_ipq_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \ - +kmod-qca-nss-drv @!LINUX_3_18 \ - +PACKAGE_kmod-qca-nss-drv-ipsecmgr:kmod-qca-nss-drv-ipsecmgr \ - +PACKAGE_kmod-qca-nss-drv-dtlsmgr:kmod-qca-nss-drv-dtlsmgr \ - +PACKAGE_kmod-qca-nss-drv-capwapmgr:kmod-qca-nss-drv-capwapmgr @!LINUX_3_18 - TITLE:=NSS NETLINK Manager for QCA NSS driver - FILES:=$(PKG_BUILD_DIR)/netlink/qca-nss-netlink.ko -endef - -define KernelPackage/qca-nss-drv-netlink/Description -Kernel module for NSS netlink manager -endef - -define KernelPackage/qca-nss-drv-ovpn-mgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for NSS OpenVPN manager - DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-cfi +kmod-tun +kmod-ipt-conntrack @!LINUX_3_18 \ - @TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx - FILES:=$(PKG_BUILD_DIR)/openvpn/src/qca-nss-ovpn-mgr.ko -endef - -define KernelPackage/qca-nss-drv-ovpn-mgr/Description -Kernel module for NSS OpenVPN manager -endef - -define KernelPackage/qca-nss-drv-ovpn-link - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - TITLE:=Kernel driver for interfacing NSS OpenVPN manager with ECM - DEPENDS:=+kmod-qca-nss-drv-ovpn-mgr +kmod-qca-nss-ecm-premium @!LINUX_3_18 \ - @TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx - FILES:=$(PKG_BUILD_DIR)/openvpn/plugins/qca-nss-ovpn-link.ko -endef - -define KernelPackage/qca-nss-drv-ovpn-link/Description -This module registers with ECM and communicates with NSS OpenVPN manager for supporting OpenVPN offload. -endef - -define KernelPackage/qca-nss-drv-pvxlanmgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 - TITLE:=NSS PVXLAN Manager for QCA NSS driver - FILES:=$(PKG_BUILD_DIR)/pvxlanmgr/qca-nss-pvxlanmgr.ko -endef - -define KernelPackage/qca-nss-drv-pvxlanmgr/Description -Kernel module for managing NSS PVxLAN -endef - -define KernelPackage/qca-nss-drv-eogremgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-drv-gre @!LINUX_3_18 - TITLE:=NSS EOGRE Manager for QCA NSS driver - FILES:=$(PKG_BUILD_DIR)/eogremgr/qca-nss-eogremgr.ko -endef - -define KernelPackage/qca-nss-drv-eogremgr/Description -Kernel module for managing NSS EoGRE -endef - -define KernelPackage/qca-nss-drv-clmapmgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-drv-eogremgr @!LINUX_3_18 - TITLE:=NSS clmap Manager for QCA NSS driver - FILES:=$(PKG_BUILD_DIR)/clmapmgr/qca-nss-clmapmgr.ko -endef - -define KernelPackage/qca-nss-drv-clmapmgr/Description -Kernel module for managing NSS clmap -endef - -define KernelPackage/qca-nss-drv-vxlanmgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=+kmod-qca-nss-drv +kmod-vxlan @!LINUX_3_18 - TITLE:=NSS VxLAN Manager for QCA NSS driver - FILES:=$(PKG_BUILD_DIR)/vxlanmgr/qca-nss-vxlanmgr.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-vxlanmgr) -endef - -define KernelPackage/qca-nss-drv-vxlanmgr/Description -Kernel module for managing NSS VxLAN -endef - -define KernelPackage/qca-nss-drv-match - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 - TITLE:=NSS Match for QCA NSS driver - FILES:=$(PKG_BUILD_DIR)/match/qca-nss-match.ko -endef - -define KernelPackage/qca-nss-drv-match/Description -Kernel module for managing NSS Match -endef - -define KernelPackage/qca-nss-drv-mirror - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Support - TITLE:=Module for mirroring packets from NSS to host. - DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 - FILES:=$(PKG_BUILD_DIR)/mirror/qca-nss-mirror.ko -endef - -define KernelPackage/qca-nss-drv-mirror/Description -Kernel module for managing NSS Mirror -endef - -define Build/InstallDev/qca-nss-clients - $(INSTALL_DIR) $(1)/usr/include/qca-nss-clients - $(CP) $(PKG_BUILD_DIR)/netlink/include/* $(1)/usr/include/qca-nss-clients/ - $(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-clients/ -endef - -define KernelPackage/qca-nss-drv-wifi-meshmgr - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 - TITLE:=NSS WiFi-Mesh Manager for QCA NSS driver - FILES:=$(PKG_BUILD_DIR)/wifi_meshmgr/qca-nss-wifi-meshmgr.ko - AUTOLOAD:=$(call AutoLoad,51,qca-nss-wifi-meshmgr) -endef - -define KernelPackage/qca-nss-drv-wifi-meshmgr/Description -Kernel module for WiFi Mesh manager -endef - -define Build/InstallDev - $(call Build/InstallDev/qca-nss-clients,$(1)) -endef - -define KernelPackage/qca-nss-drv-ovpn-mgr/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/qca-nss-ovpn.init $(1)/etc/init.d/qca-nss-ovpn -endef - -define KernelPackage/qca-nss-drv-ipsecmgr-klips/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/qca-nss-ipsec $(1)/etc/init.d/qca-nss-ipsec -endef - -define KernelPackage/qca-nss-drv-igs/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/qca-nss-mirred.init $(1)/etc/init.d/qca-nss-mirred -endef - -EXTRA_CFLAGS+= \ - -I$(STAGING_DIR)/usr/include/qca-nss-drv \ - -I$(STAGING_DIR)/usr/include/qca-nss-crypto \ - -I$(STAGING_DIR)/usr/include/qca-nss-cfi \ - -I$(STAGING_DIR)/usr/include/qca-nss-gmac \ - -I$(STAGING_DIR)/usr/include/qca-ssdk \ - -I$(STAGING_DIR)/usr/include/qca-ssdk/fal \ - -I$(STAGING_DIR)/usr/include/nat46 - -# Build individual packages if selected -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-profile),) -MAKE_OPTS+=profile=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-capwapmgr),) -MAKE_OPTS+=capwapmgr=y -EXTRA_CFLAGS += -DNSS_CAPWAPMGR_ONE_NETDEV -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tun6rd),) -MAKE_OPTS+=tun6rd=m -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-dtlsmgr),) -MAKE_OPTS+=dtlsmgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tlsmgr),) -MAKE_OPTS+=tlsmgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2),) -MAKE_OPTS+=l2tpv2=y -EXTRA_CFLAGS += -DNSS_L2TPV2_ENABLED -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pptp),) -MAKE_OPTS+=pptp=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-map-t),) -MAKE_OPTS+=map-t=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6),) -MAKE_OPTS+=tunipip6=m -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-qdisc),) -MAKE_OPTS+=qdisc=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-igs),) -MAKE_OPTS+=igs=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr),) -EXTRA_CFLAGS+= -I$(PKG_BUILD_DIR)/exports -MAKE_OPTS+=ipsecmgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr-klips),) -EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-ecm -MAKE_OPTS+=ipsecmgr-klips=m -endif - - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-bridge-mgr),) -MAKE_OPTS+=bridge-mgr=y -#enable OVS bridge if ovsmgr is enabled -ifneq ($(CONFIG_PACKAGE_kmod-qca-ovsmgr),) -MAKE_OPTS+= NSS_BRIDGE_MGR_OVS_ENABLE=y -EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-ovsmgr -endif -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vlan-mgr),) -MAKE_OPTS+=vlan-mgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-lag-mgr),) -MAKE_OPTS+=lag-mgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-gre),) -EXTRA_CFLAGS+= -I$(PKG_BUILD_DIR)/exports -MAKE_OPTS+=gre=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe),) -MAKE_OPTS+=pppoe=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-netlink),) -MAKE_OPTS+=netlink=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-mgr),) -MAKE_OPTS+=ovpn-mgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-link),) -MAKE_OPTS+=ovpn-link=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pvxlanmgr),) -MAKE_OPTS+=pvxlanmgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-eogremgr),) -MAKE_OPTS+=eogremgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-clmapmgr),) -MAKE_OPTS+=clmapmgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vxlanmgr),) -MAKE_OPTS+=vxlanmgr=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-match),) -MAKE_OPTS+=match=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-mirror),) -MAKE_OPTS+=mirror=y -endif - -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-wifi-meshmgr),) -MAKE_OPTS+=wifi-meshmgr=y -endif - -define Build/Compile - $(MAKE) -C "$(LINUX_DIR)" $(strip $(MAKE_OPTS)) \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ - M="$(PKG_BUILD_DIR)" \ - EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ - SoC="$(subtarget)" \ - DTLSMGR_DIR="$(DTLSMGR_DIR)" \ - IPSECMGR_DIR="$(IPSECMGR_DIR)" \ - modules -endef - -$(eval $(call KernelPackage,qca-nss-drv-profile)) -#$(eval $(call KernelPackage,qca-nss-drv-capwapmgr)) -$(eval $(call KernelPackage,qca-nss-drv-tun6rd)) -#$(eval $(call KernelPackage,qca-nss-drv-dtlsmgr)) -$(eval $(call KernelPackage,qca-nss-drv-l2tpv2)) -$(eval $(call KernelPackage,qca-nss-drv-pptp)) -$(eval $(call KernelPackage,qca-nss-drv-pppoe)) -$(eval $(call KernelPackage,qca-nss-drv-map-t)) -$(eval $(call KernelPackage,qca-nss-drv-tunipip6)) -$(eval $(call KernelPackage,qca-nss-drv-qdisc)) -$(eval $(call KernelPackage,qca-nss-drv-igs)) -#$(eval $(call KernelPackage,qca-nss-drv-netlink)) -#$(eval $(call KernelPackage,qca-nss-drv-ipsecmgr)) -#$(eval $(call KernelPackage,qca-nss-drv-ipsecmgr-klips)) -$(eval $(call KernelPackage,qca-nss-drv-bridge-mgr)) -$(eval $(call KernelPackage,qca-nss-drv-vlan-mgr)) -$(eval $(call KernelPackage,qca-nss-drv-lag-mgr)) -$(eval $(call KernelPackage,qca-nss-drv-gre)) -#$(eval $(call KernelPackage,qca-nss-drv-ovpn-mgr)) -#$(eval $(call KernelPackage,qca-nss-drv-ovpn-link)) -$(eval $(call KernelPackage,qca-nss-drv-pvxlanmgr)) -$(eval $(call KernelPackage,qca-nss-drv-eogremgr)) -$(eval $(call KernelPackage,qca-nss-drv-clmapmgr)) -$(eval $(call KernelPackage,qca-nss-drv-vxlanmgr)) -$(eval $(call KernelPackage,qca-nss-drv-match)) -#$(eval $(call KernelPackage,qca-nss-drv-tlsmgr)) -$(eval $(call KernelPackage,qca-nss-drv-mirror)) -$(eval $(call KernelPackage,qca-nss-drv-wifi-meshmgr)) diff --git a/feeds/ipq807x/qca-nss-clients/files/qca-nss-ipsec b/feeds/ipq807x/qca-nss-clients/files/qca-nss-ipsec deleted file mode 100755 index bb202e8e7..000000000 --- a/feeds/ipq807x/qca-nss-clients/files/qca-nss-ipsec +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh /etc/rc.common -# -# Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -NSS_IPSEC_LOG_FILE=/tmp/.nss_ipsec_log -NSS_IPSEC_LOG_STR_ECM="ECM_Loaded" - -ecm_load () { - if [ ! -d /sys/module/ecm ]; then - /etc/init.d/qca-nss-ecm start - if [ -d /sys/module/ecm ]; then - echo ${NSS_IPSEC_LOG_STR_ECM} >> ${NSS_IPSEC_LOG_FILE} - fi - fi -} - -ecm_unload () { - if [ -f /tmp/.nss_ipsec_log ]; then - str=`grep ${NSS_IPSEC_LOG_STR_ECM} ${NSS_IPSEC_LOG_FILE}` - if [[ $str == ${NSS_IPSEC_LOG_STR_ECM} ]]; then - /etc/init.d/qca-nss-ecm stop - `sed 's/${NSS_IPSEC_LOG_STR_ECM}/ /g' $NSS_IPSEC_LOG_FILE > $NSS_IPSEC_LOG_FILE` - fi - fi -} - -ecm_disable() { - - if [ ! -d /sys/module/ecm ]; then - return; - fi - - echo 1 > /sys/kernel/debug/ecm/front_end_ipv4_stop - echo 1 > /sys/kernel/debug/ecm/front_end_ipv6_stop - echo 1 > /sys/kernel/debug/ecm/ecm_db/defunct_all - sleep 2 -} - -ecm_enable() { - if [ ! -d /sys/module/ecm ]; then - return; - fi - - echo 0 > /sys/kernel/debug/ecm/ecm_db/defunct_all - echo 0 > /sys/kernel/debug/ecm/front_end_ipv4_stop - echo 0 > /sys/kernel/debug/ecm/front_end_ipv6_stop -} - -start() { - ecm_load - - local kernel_version=$(uname -r) - - insmod /lib/modules/${kernel_version}/qca-nss-ipsec-klips.ko - if [ "$?" -gt 0 ]; then - echo "Failed to load plugin. Please start ecm if not done already" - ecm_enable - return - fi - - /etc/init.d/ipsec start - sleep 2 - ipsec eroute - - ecm_enable -} - -stop() { - ecm_disable - - /etc/init.d/ipsec stop - rmmod qca-nss-ipsec-klips - - ecm_unload -} - -restart() { - stop - start -} diff --git a/feeds/ipq807x/qca-nss-clients/files/qca-nss-mirred.init b/feeds/ipq807x/qca-nss-clients/files/qca-nss-mirred.init deleted file mode 100644 index 1f931f090..000000000 --- a/feeds/ipq807x/qca-nss-clients/files/qca-nss-mirred.init +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh /etc/rc.common - -########################################################################### -# Copyright (c) 2019, The Linux Foundation. All rights reserved. -# Permission to use, copy, modify, and/or distribute this software for -# any purpose with or without fee is hereby granted, provided that the -# above copyright notice and this permission notice appear in all copies. -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -########################################################################### - -restart() { - rmmod act_nssmirred.ko - insmod act_nssmirred.ko -} - -start() { - insmod act_nssmirred.ko -} - -stop() { - rmmod act_nssmirred.ko -} diff --git a/feeds/ipq807x/qca-nss-clients/files/qca-nss-ovpn.init b/feeds/ipq807x/qca-nss-clients/files/qca-nss-ovpn.init deleted file mode 100644 index 622e295ee..000000000 --- a/feeds/ipq807x/qca-nss-clients/files/qca-nss-ovpn.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh /etc/rc.common - -########################################################################### -# Copyright (c) 2019, The Linux Foundation. All rights reserved. -# Permission to use, copy, modify, and/or distribute this software for -# any purpose with or without fee is hereby granted, provided that the -# above copyright notice and this permission notice appear in all copies. -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -########################################################################### - -ecm_disable() { - if [ ! -d /sys/module/ecm ]; then - return - fi - - echo 1 > /sys/kernel/debug/ecm/front_end_ipv4_stop - echo 1 > /sys/kernel/debug/ecm/front_end_ipv6_stop - echo 1 > /sys/kernel/debug/ecm/ecm_db/defunct_all - sleep 2 -} - -ecm_enable() { - if [ ! -d /sys/module/ecm ]; then - return - fi - - echo 0 > /sys/kernel/debug/ecm/ecm_db/defunct_all - echo 0 > /sys/kernel/debug/ecm/front_end_ipv4_stop - echo 0 > /sys/kernel/debug/ecm/front_end_ipv6_stop -} - -restart() { - ecm_disable - - /etc/init.d/openvpn stop - rmmod qca-nss-ovpn-link - rmmod qca-nss-ovpn-mgr - - insmod qca-nss-ovpn-mgr - insmod qca-nss-ovpn-link - - if [ "$?" -gt 0 ]; then - echo "Failed to load plugin. Please start ecm if not done already" - ecm_enable - return - fi - - ecm_enable -} - -start() { - restart -} - -stop() { - ecm_disable - - /etc/init.d/openvpn stop - rmmod qca-nss-ovpn-link - rmmod qca-nss-ovpn-mgr - - ecm_enable -} diff --git a/feeds/ipq807x/qca-nss-dp/Makefile b/feeds/ipq807x/qca-nss-dp/Makefile deleted file mode 100644 index 60df6dc53..000000000 --- a/feeds/ipq807x/qca-nss-dp/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=qca-nss-dp -PKG_SOURCE_PROTO:=git -PKG_BRANCH:=master -PKG_RELEASE:=1 - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/qca-nss-dp - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=@TARGET_ipq807x +kmod-qca-ssdk - TITLE:=Kernel driver for NSS data plane - FILES:=$(PKG_BUILD_DIR)/qca-nss-dp.ko - AUTOLOAD:=$(call AutoLoad,31,qca-nss-dp) -endef - -define KernelPackage/qca-nss-dp/Description -This package contains a NSS data plane driver for QCA chipset -endef - -define Build/InstallDev - mkdir -p $(1)/usr/include/qca-nss-dp - $(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-dp/ -endef - -EXTRA_CFLAGS+= \ - -I$(STAGING_DIR)/usr/include/qca-ssdk - -subtarget:=$(SUBTARGET) - -NSS_DP_HAL_DIR:=$(PKG_BUILD_DIR)/hal -hal_arch:=$(subtarget) - -define Build/Configure - $(LN) $(NSS_DP_HAL_DIR)/arch/$(hal_arch)/nss_$(hal_arch).h \ - $(PKG_BUILD_DIR)/exports/nss_dp_arch.h -endef - -define Build/Compile - $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ - M="$(PKG_BUILD_DIR)" \ - EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC="$(subtarget)" \ - modules -endef - -$(eval $(call KernelPackage,qca-nss-dp)) diff --git a/feeds/ipq807x/qca-nss-dp/patches/100-power-on.patch b/feeds/ipq807x/qca-nss-dp/patches/100-power-on.patch deleted file mode 100644 index 7083fcb01..000000000 --- a/feeds/ipq807x/qca-nss-dp/patches/100-power-on.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: qca-nss-dp/nss_dp_main.c -=================================================================== ---- qca-nss-dp.orig/nss_dp_main.c -+++ qca-nss-dp/nss_dp_main.c -@@ -32,6 +32,7 @@ - #include - - #include "nss_dp_hal.h" -+#include "fal/fal_port_ctrl.h" - - /* - * Number of TX/RX queue supported is based on the number of host CPU -@@ -293,6 +294,7 @@ static int nss_dp_open(struct net_device - phy_start(dp_priv->phydev); - phy_start_aneg(dp_priv->phydev); - } -+ fal_port_power_on(0, dp_priv->macid); - - return 0; - } diff --git a/feeds/ipq807x/qca-nss-dp/src/Makefile b/feeds/ipq807x/qca-nss-dp/src/Makefile deleted file mode 100644 index 04e6a4531..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -################################################### -# Makefile for the NSS data plane driver -################################################### - -obj ?= . - -obj-m += qca-nss-dp.o - -qca-nss-dp-objs += nss_dp_attach.o \ - nss_dp_ethtools.o \ - nss_dp_main.o - -ifneq ($(CONFIG_NET_SWITCHDEV),) -qca-nss-dp-objs += nss_dp_switchdev.o -endif - -ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64 ipq60xx ipq60xx_64)) -qca-nss-dp-objs += hal/edma/edma_cfg.o \ - hal/edma/edma_data_plane.o \ - hal/edma/edma_tx_rx.o \ - hal/gmac_hal_ops/qcom/qcom_if.o \ - hal/gmac_hal_ops/syn/xgmac/syn_if.o -endif - -NSS_DP_INCLUDE = -I$(obj)/include -I$(obj)/exports -I$(obj)/gmac_hal_ops/include \ - -I$(obj)/hal/include - -ifeq ($(SoC),$(filter $(SoC),ipq50xx ipq50xx_64)) -NSS_DP_INCLUDE += -I$(obj)/hal/gmac_hal_ops/syn/gmac -endif - -ccflags-y += $(NSS_DP_INCLUDE) -ccflags-y += -Wall -Werror - -ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64 ipq60xx ipq60xx_64)) -ccflags-y += -DNSS_DP_PPE_SUPPORT -endif - -ifeq ($(SoC),$(filter $(SoC),ipq60xx ipq60xx_64)) -qca-nss-dp-objs += hal/arch/ipq60xx/nss_ipq60xx.o -ccflags-y += -DNSS_DP_IPQ60XX -endif - -ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64)) -qca-nss-dp-objs += hal/arch/ipq807x/nss_ipq807x.o -ccflags-y += -DNSS_DP_IPQ807X -DNSS_DP_EDMA_TX_SMALL_PKT_WAR -endif - -ifeq ($(SoC),$(filter $(SoC),ipq50xx ipq50xx_64)) -qca-nss-dp-objs += hal/arch/ipq50xx/nss_ipq50xx.o \ - hal/gmac_hal_ops/syn/gmac/syn_if.o \ - hal/syn_gmac_dp/syn_data_plane.o \ - hal/syn_gmac_dp/syn_dp_tx_rx.o \ - hal/syn_gmac_dp/syn_dp_cfg.o -ccflags-y += -DNSS_DP_IPQ50XX -endif diff --git a/feeds/ipq807x/qca-nss-dp/src/exports/nss_dp_api_if.h b/feeds/ipq807x/qca-nss-dp/src/exports/nss_dp_api_if.h deleted file mode 100644 index 2710b790e..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/exports/nss_dp_api_if.h +++ /dev/null @@ -1,219 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_dp_api_if.h - * nss-dp exported structures/apis. - * - * This file declares all the public interfaces - * for NSS data-plane driver. - */ - -#ifndef __NSS_DP_API_IF_H -#define __NSS_DP_API_IF_H - -#include "nss_dp_arch.h" - -/** - * @addtogroup nss_dp_subsystem - * @{ - */ - -/* - * NSS DP status - */ -#define NSS_DP_SUCCESS 0 -#define NSS_DP_FAILURE -1 - -/* - * NSS DP platform specific defines - */ -#define NSS_DP_START_IFNUM NSS_DP_HAL_START_IFNUM - /**< First GMAC interface number (0/1) depending on SoC. */ -#define NSS_DP_MAX_MTU_SIZE NSS_DP_HAL_MAX_MTU_SIZE -#define NSS_DP_MAX_PACKET_LEN NSS_DP_HAL_MAX_PACKET_LEN -#define NSS_DP_MAX_INTERFACES (NSS_DP_HAL_MAX_PORTS + NSS_DP_HAL_START_IFNUM) - /**< Last interface index for the SoC, to be used by qca-nss-drv. */ - -/* - * NSS PTP service code - */ -#define NSS_PTP_EVENT_SERVICE_CODE 0x9 - -/** - * nss_dp_data_plane_ctx - * Data plane context base class. - */ -struct nss_dp_data_plane_ctx { - struct net_device *dev; -}; - -/** - * nss_dp_gmac_stats - * The per-GMAC statistics structure. - */ -struct nss_dp_gmac_stats { - struct nss_dp_hal_gmac_stats stats; -}; - -/** - * nss_dp_data_plane_ops - * Per data-plane ops structure. - * - * Default would be slowpath and can be overridden by nss-drv - */ -struct nss_dp_data_plane_ops { - int (*init)(struct nss_dp_data_plane_ctx *dpc); - int (*open)(struct nss_dp_data_plane_ctx *dpc, uint32_t tx_desc_ring, - uint32_t rx_desc_ring, uint32_t mode); - int (*close)(struct nss_dp_data_plane_ctx *dpc); - int (*link_state)(struct nss_dp_data_plane_ctx *dpc, - uint32_t link_state); - int (*mac_addr)(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr); - int (*change_mtu)(struct nss_dp_data_plane_ctx *dpc, uint32_t mtu); - netdev_tx_t (*xmit)(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *os_buf); - void (*set_features)(struct nss_dp_data_plane_ctx *dpc); - int (*pause_on_off)(struct nss_dp_data_plane_ctx *dpc, - uint32_t pause_on); - int (*vsi_assign)(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi); - int (*vsi_unassign)(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi); - int (*rx_flow_steer)(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *skb, - uint32_t cpu, bool is_add); - void (*get_stats)(struct nss_dp_data_plane_ctx *dpc, struct nss_dp_gmac_stats *stats); - int (*deinit)(struct nss_dp_data_plane_ctx *dpc); -}; - -/** - * nss_dp_receive - * Called by overlay drivers to deliver packets to nss-dp. - * - * @datatypes - * net_device - * sk_buff - * napi_struct - * - * @param[in] netdev Pointer to netdev structure on which packet is received. - * @param[in] skb Pointer to the received packet. - * @param[in] napi Pointer to napi context. - */ -void nss_dp_receive(struct net_device *netdev, struct sk_buff *skb, - struct napi_struct *napi); - -/** - * nss_dp_is_in_open_state - * Returns if a data plane is opened or not. - * - * @datatypes - * net_device - * - * @param[in] netdev Pointer to netdev structure. - * - * @return - * bool - */ -bool nss_dp_is_in_open_state(struct net_device *netdev); - -/** - * nss_dp_override_data_palne - * API to allow overlay drivers to override the data plane. - * - * @datatypes - * net_device - * nss_dp_data_plane_ops - * nss_dp_data_plane_ctx - * - * @param[in] netdev Pointer to netdev structure. - * @param[in] dp_ops Pointer to respective data plane ops structure. - * @param[in] dpc Pointer to data plane context. - * - * @return - * int - */ -int nss_dp_override_data_plane(struct net_device *netdev, - struct nss_dp_data_plane_ops *dp_ops, - struct nss_dp_data_plane_ctx *dpc); - -/** - * nss_dp_start_data_plane - * Dataplane API to inform netdev when it is ready to start. - * - * @datatypes - * net_device - * nss_dp_data_plane_ctx - * - * @param[in] netdev Pointer to netdev structure. - * @param[in] dpc Pointer to data plane context. - */ -void nss_dp_start_data_plane(struct net_device *netdev, - struct nss_dp_data_plane_ctx *dpc); - -/** - * nss_dp_restore_data_plane - * Called by overlay drivers to detach itself from nss-dp. - * - * @datatypes - * net_device - * - * @param[in] netdev Pointer to netdev structure. - */ -void nss_dp_restore_data_plane(struct net_device *netdev); - -/** - * nss_dp_get_netdev_by_nss_if_num - * Returns the net device of the corresponding id if it exists. - * - * @datatypes - * int - * - * @param[in] interface ID of the physical mac port. - * - * @return - * Pointer to netdev structure. - */ -struct net_device *nss_dp_get_netdev_by_nss_if_num(int if_num); - -/** - * nss_phy_tstamp_rx_buf - * Receive timestamp packet. - * - * @datatypes - * sk_buff - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] skb Pointer to the packet. - */ -void nss_phy_tstamp_rx_buf(void *app_data, struct sk_buff *skb); - -/** - * nss_phy_tstamp_tx_buf - * Transmit timestamp packet - * - * @datatypes - * net_device - * sk_buff - * - * @param[in] net_device Pointer to netdev structure. - * @param[in] skb Pointer to the packet. - */ -void nss_phy_tstamp_tx_buf(struct net_device *ndev, struct sk_buff *skb); - -/** - *@} - */ - -#endif /** __NSS_DP_API_IF_H */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c b/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c deleted file mode 100644 index 8ddfee8d9..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include -#include "nss_dp_hal.h" - -/* - * nss_dp_hal_tcsr_base_get - * Reads TCSR base address from DTS - */ -static uint32_t nss_dp_hal_tcsr_base_get(void) -{ - uint32_t tcsr_base_addr = 0; - struct device_node *dp_cmn; - - /* - * Get reference to NSS dp common device node - */ - dp_cmn = of_find_node_by_name(NULL, "nss-dp-common"); - if (!dp_cmn) { - pr_info("%s: NSS DP common node not found\n", __func__); - return 0; - } - - if (of_property_read_u32(dp_cmn, "qcom,tcsr-base", &tcsr_base_addr)) { - pr_err("%s: error reading TCSR base\n", __func__); - } - of_node_put(dp_cmn); - - return tcsr_base_addr; -} - -/* - * nss_dp_hal_tcsr_set - * Sets the TCSR axi cache override register - */ -static void nss_dp_hal_tcsr_set(void) -{ - void __iomem *tcsr_addr = NULL; - uint32_t tcsr_base; - int err; - - tcsr_base = nss_dp_hal_tcsr_base_get(); - if (!tcsr_base) { - pr_err("%s: Unable to get TCSR base address\n", __func__); - return; - } - - /* - * Check if Trust Zone is enabled in the system. - * If yes, we need to go through SCM API call to program TCSR register. - * If TZ is not enabled, we can write to the register directly. - */ - if (qcom_scm_is_available()) { -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) - err = qcom_scm_tcsr_reg_write((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET), - TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE); -#else - err = qti_scm_tcsr_reg_write((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET), - TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE); -#endif - if (err) { - pr_err("%s: SCM TCSR write error: %d\n", __func__, err); - } - } else { - tcsr_addr = ioremap_nocache((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET), - TCSR_GMAC_AXI_CACHE_OVERRIDE_REG_SIZE); - if (!tcsr_addr) { - pr_err("%s: ioremap failed\n", __func__); - return; - } - writel(TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE, tcsr_addr); - iounmap(tcsr_addr); - } -} - -/* - * nss_dp_hal_get_data_plane_ops - * Return the data plane ops for GMAC data plane. - */ -struct nss_dp_data_plane_ops *nss_dp_hal_get_data_plane_ops(void) -{ - return &nss_dp_gmac_ops; -} - -/* - * nss_dp_hal_clk_enable - * Function to enable GCC_SNOC_GMAC_AXI_CLK. - * - * These clocks are required for GMAC operations. - */ -void nss_dp_hal_clk_enable(struct nss_dp_dev *dp_priv) -{ - struct platform_device *pdev = dp_priv->pdev; - struct device *dev = &pdev->dev; - struct clk *gmac_clk = NULL; - int err; - - gmac_clk = devm_clk_get(dev, NSS_SNOC_GMAC_AXI_CLK); - if (IS_ERR(gmac_clk)) { - pr_err("%s: cannot get clock: %s\n", __func__, - NSS_SNOC_GMAC_AXI_CLK); - return; - } - - err = clk_prepare_enable(gmac_clk); - if (err) { - pr_err("%s: cannot enable clock: %s, err: %d\n", __func__, - NSS_SNOC_GMAC_AXI_CLK, err); - return; - } -} - -/* - * nss_dp_hal_init - * Sets the gmac ops based on the GMAC type. - */ -bool nss_dp_hal_init(void) -{ - nss_dp_hal_set_gmac_ops(&syn_hal_ops, GMAC_HAL_TYPE_SYN_GMAC); - - /* - * Program the global GMAC AXI Cache override register - * for optimized AXI DMA operation. - */ - nss_dp_hal_tcsr_set(); - return true; -} - -/* - * nss_dp_hal_cleanup - * Sets the gmac ops to NULL. - */ -void nss_dp_hal_cleanup(void) -{ - nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_SYN_GMAC); -} diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.h b/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.h deleted file mode 100644 index cae6407ce..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __NSS_DP_ARCH_H__ -#define __NSS_DP_ARCH_H__ - -#define NSS_DP_HAL_MAX_PORTS 2 -#define NSS_DP_HAL_CPU_NUM 2 -#define NSS_DP_HAL_START_IFNUM 0 -#define NSS_DP_GMAC_NORMAL_FRAME_MTU 1500 -#define NSS_DP_GMAC_MINI_JUMBO_FRAME_MTU 1978 -#define NSS_DP_GMAC_FULL_JUMBO_FRAME_MTU 9000 -#define NSS_DP_HAL_MAX_MTU_SIZE NSS_DP_GMAC_FULL_JUMBO_FRAME_MTU -#define NSS_DP_HAL_MAX_PACKET_LEN 65535 - -/* - * TCSR_GMAC_AXI_CACHE_OVERRIDE register size - */ -#define TCSR_GMAC_AXI_CACHE_OVERRIDE_REG_SIZE 4 - -/* - * TCSR_GMAC_AXI_CACHE_OVERRIDE Register offset - */ -#define TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET 0x6224 - -/* - * Value for TCSR_GMAC_AXI_CACHE_OVERRIDE register - */ -#define TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE 0x05050505 - -/* - * GCC_SNOC_GMAC_AXI_CLOCK - */ -#define NSS_SNOC_GMAC_AXI_CLK "nss-snoc-gmac-axi-clk" - -/** - * nss_dp_hal_gmac_stats - * The per-GMAC statistics structure. - */ -struct nss_dp_hal_gmac_stats { - uint64_t rx_bytes; /**< Number of RX bytes */ - uint64_t rx_packets; /**< Number of RX packets */ - uint64_t rx_errors; /**< Number of RX errors */ - uint64_t rx_receive_errors; /**< Number of RX receive errors */ - uint64_t rx_descriptor_errors; /**< Number of RX descriptor errors */ - uint64_t rx_late_collision_errors; - /**< Number of RX late collision errors */ - uint64_t rx_dribble_bit_errors; /**< Number of RX dribble bit errors */ - uint64_t rx_length_errors; /**< Number of RX length errors */ - uint64_t rx_ip_header_errors; /**< Number of RX IP header errors read from rxdec */ - uint64_t rx_ip_payload_errors; /**< Number of RX IP payload errors */ - uint64_t rx_no_buffer_errors; /**< Number of RX no-buffer errors */ - uint64_t rx_transport_csum_bypassed; - /**< Number of RX packets where the transport checksum was bypassed */ - uint64_t tx_bytes; /**< Number of TX bytes */ - uint64_t tx_packets; /**< Number of TX packets */ - uint64_t tx_collisions; /**< Number of TX collisions */ - uint64_t tx_errors; /**< Number of TX errors */ - uint64_t tx_jabber_timeout_errors; - /**< Number of TX jabber timeout errors */ - uint64_t tx_frame_flushed_errors; - /**< Number of TX frame flushed errors */ - uint64_t tx_loss_of_carrier_errors; - /**< Number of TX loss of carrier errors */ - uint64_t tx_no_carrier_errors; /**< Number of TX no carrier errors */ - uint64_t tx_late_collision_errors; - /**< Number of TX late collision errors */ - uint64_t tx_excessive_collision_errors; - /**< Number of TX excessive collision errors */ - uint64_t tx_excessive_deferral_errors; - /**< Number of TX excessive deferral errors */ - uint64_t tx_underflow_errors; /**< Number of TX underflow errors */ - uint64_t tx_ip_header_errors; /**< Number of TX IP header errors */ - uint64_t tx_ip_payload_errors; /**< Number of TX IP payload errors */ - uint64_t tx_dropped; /**< Number of TX dropped packets */ - uint64_t hw_errs[10]; /**< GMAC DMA error counters */ - uint64_t rx_missed; /**< Number of RX packets missed by the DMA */ - uint64_t fifo_overflows; /**< Number of RX FIFO overflows signalled by the DMA */ - uint64_t rx_scatter_errors; /**< Number of scattered frames received by the DMA */ - uint64_t tx_ts_create_errors; /**< Number of tx timestamp creation errors */ - uint64_t gmac_total_ticks; /**< Total clock ticks spend inside the GMAC */ - uint64_t gmac_worst_case_ticks; /**< Worst case iteration of the GMAC in ticks */ - uint64_t gmac_iterations; /**< Number of iterations around the GMAC */ - uint64_t tx_pause_frames; /**< Number of pause frames sent by the GMAC */ - uint64_t mmc_rx_overflow_errors; - /**< Number of RX overflow errors */ - uint64_t mmc_rx_watchdog_timeout_errors; - /**< Number of RX watchdog timeout errors */ - uint64_t mmc_rx_crc_errors; /**< Number of RX CRC errors */ - uint64_t mmc_rx_ip_header_errors; - /**< Number of RX IP header errors read from MMC counter*/ - uint64_t mmc_rx_octets_g; - /**< Number of good octets received */ - uint64_t mmc_rx_ucast_frames; /**< Number of Unicast frames received */ - uint64_t mmc_rx_bcast_frames; /**< Number of Bcast frames received */ - uint64_t mmc_rx_mcast_frames; /**< Number of Mcast frames received */ - uint64_t mmc_rx_undersize; - /**< Number of RX undersize frames */ - uint64_t mmc_rx_oversize; - /**< Number of RX oversize frames */ - uint64_t mmc_rx_jabber; /**< Number of jabber frames */ - uint64_t mmc_rx_octets_gb; - /**< Number of good/bad octets */ - uint64_t mmc_rx_frag_frames_g; /**< Number of good ipv4 frag frames */ - uint64_t mmc_tx_octets_g; /**< Number of good octets sent */ - uint64_t mmc_tx_ucast_frames; /**< Number of Unicast frames sent*/ - uint64_t mmc_tx_bcast_frames; /**< Number of Broadcast frames sent */ - uint64_t mmc_tx_mcast_frames; /**< Number of Multicast frames sent */ - uint64_t mmc_tx_deferred; /**< Number of Deferred frames sent */ - uint64_t mmc_tx_single_col; /**< Number of single collisions */ - uint64_t mmc_tx_multiple_col; /**< Number of multiple collisions */ - uint64_t mmc_tx_octets_gb; /**< Number of good/bad octets sent*/ -}; - -extern struct nss_dp_data_plane_ops nss_dp_gmac_ops; - -#endif /* __NSS_DP_ARCH_H__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.c b/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.c deleted file mode 100644 index dab4276e4..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "nss_dp_hal.h" -#include "edma.h" - -/* - * nss_dp_hal_get_data_plane_ops() - * Return the data plane ops for edma data plane. - */ -struct nss_dp_data_plane_ops *nss_dp_hal_get_data_plane_ops(void) -{ - return &nss_dp_edma_ops; -} - -/* - * nss_dp_hal_init() - * Initialize EDMA and set gmac ops. - */ -bool nss_dp_hal_init(void) -{ - nss_dp_hal_set_gmac_ops(&qcom_hal_ops, GMAC_HAL_TYPE_QCOM); - nss_dp_hal_set_gmac_ops(&syn_hal_ops, GMAC_HAL_TYPE_SYN_XGMAC); - - if (edma_init()) { - return false; - } - return true; -} - -/* - * nss_dp_hal_cleanup() - * Cleanup EDMA and set gmac ops to NULL. - */ -void nss_dp_hal_cleanup(void) -{ - nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_QCOM); - nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_SYN_XGMAC); - edma_cleanup(false); -} diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.h b/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.h deleted file mode 100644 index 26dc76726..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __NSS_DP_ARCH_H__ -#define __NSS_DP_ARCH_H__ - -#define NSS_DP_HAL_MAX_PORTS 5 -#define NSS_DP_HAL_CPU_NUM 4 -#define NSS_DP_HAL_START_IFNUM 1 -#define NSS_DP_HAL_MAX_MTU_SIZE 9216 -#define NSS_DP_HAL_MAX_PACKET_LEN 65535 -#define NSS_DP_PREHEADER_SIZE 32 - -/** - * nss_dp_hal_gmac_stats - * The per-GMAC statistics structure. - */ -struct nss_dp_hal_gmac_stats { -}; - -#endif /* __NSS_DP_ARCH_H__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.c b/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.c deleted file mode 100644 index dab4276e4..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "nss_dp_hal.h" -#include "edma.h" - -/* - * nss_dp_hal_get_data_plane_ops() - * Return the data plane ops for edma data plane. - */ -struct nss_dp_data_plane_ops *nss_dp_hal_get_data_plane_ops(void) -{ - return &nss_dp_edma_ops; -} - -/* - * nss_dp_hal_init() - * Initialize EDMA and set gmac ops. - */ -bool nss_dp_hal_init(void) -{ - nss_dp_hal_set_gmac_ops(&qcom_hal_ops, GMAC_HAL_TYPE_QCOM); - nss_dp_hal_set_gmac_ops(&syn_hal_ops, GMAC_HAL_TYPE_SYN_XGMAC); - - if (edma_init()) { - return false; - } - return true; -} - -/* - * nss_dp_hal_cleanup() - * Cleanup EDMA and set gmac ops to NULL. - */ -void nss_dp_hal_cleanup(void) -{ - nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_QCOM); - nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_SYN_XGMAC); - edma_cleanup(false); -} diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.h b/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.h deleted file mode 100644 index 6926e562e..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __NSS_DP_ARCH_H__ -#define __NSS_DP_ARCH_H__ - -#define NSS_DP_HAL_MAX_PORTS 6 -#define NSS_DP_HAL_CPU_NUM 4 -#define NSS_DP_HAL_START_IFNUM 1 -#define NSS_DP_HAL_MAX_MTU_SIZE 9216 -#define NSS_DP_HAL_MAX_PACKET_LEN 65535 -#define NSS_DP_PREHEADER_SIZE 32 - -/** - * nss_dp_hal_gmac_stats - * The per-GMAC statistics structure. - */ -struct nss_dp_hal_gmac_stats { -}; - -#endif /* __NSS_DP_ARCH_H__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_cfg.c b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_cfg.c deleted file mode 100644 index d2563c860..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_cfg.c +++ /dev/null @@ -1,967 +0,0 @@ -/* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include -#include -#include -#include -#include -#include - -#include "nss_dp_dev.h" -#include "edma_regs.h" -#include "edma_data_plane.h" - -#define EDMA_HW_RESET_ID "edma_rst" - -/* - * edma_cleanup_rxfill_ring_res() - * Cleanup resources for one RxFill ring - */ -static void edma_cleanup_rxfill_ring_res(struct edma_hw *ehw, - struct edma_rxfill_ring *rxfill_ring) -{ - struct platform_device *pdev = ehw->pdev; - struct sk_buff *skb; - uint16_t cons_idx, curr_idx; - struct edma_rxfill_desc *rxfill_desc; - uint32_t reg_data = 0; - struct edma_rx_preheader *rxph = NULL; - int store_idx; - - /* - * Read RXFILL ring producer index - */ - reg_data = edma_reg_read(EDMA_REG_RXFILL_PROD_IDX(rxfill_ring->id)); - curr_idx = reg_data & EDMA_RXFILL_PROD_IDX_MASK; - - /* - * Read RXFILL ring consumer index - */ - reg_data = edma_reg_read(EDMA_REG_RXFILL_CONS_IDX(rxfill_ring->id)); - cons_idx = reg_data & EDMA_RXFILL_CONS_IDX_MASK; - - while (curr_idx != cons_idx) { - /* - * Get RXFILL descriptor - */ - rxfill_desc = EDMA_RXFILL_DESC(rxfill_ring, cons_idx); - - /* - * Get Rx preheader - */ - rxph = (struct edma_rx_preheader *) - phys_to_virt(rxfill_desc->buffer_addr); - - dma_unmap_single(&pdev->dev, rxfill_desc->buffer_addr, - EDMA_RX_BUFF_SIZE, DMA_FROM_DEVICE); - - /* - * Get sk_buff and free it - */ - store_idx = rxph->opaque; - skb = ehw->rx_skb_store[store_idx]; - ehw->rx_skb_store[store_idx] = NULL; - dev_kfree_skb_any(skb); - cons_idx++; - if (cons_idx == rxfill_ring->count) - cons_idx = 0; - } - - /* - * Free RXFILL ring descriptors - */ - dma_free_coherent(&pdev->dev, - (sizeof(struct edma_rxfill_desc) - * rxfill_ring->count), - rxfill_ring->desc, rxfill_ring->dma); -} - -/* - * edma_setup_rxfill_ring_res() - * Setup resources for one RxFill ring - */ -static int edma_setup_rxfill_ring_res(struct edma_hw *ehw, - struct edma_rxfill_ring *rxfill_ring) -{ - struct platform_device *pdev = ehw->pdev; - - /* - * Allocate RxFill ring descriptors - */ - rxfill_ring->desc = dma_alloc_coherent(&pdev->dev, - (sizeof(struct edma_rxfill_desc) - * rxfill_ring->count), - &rxfill_ring->dma, GFP_KERNEL); - if (!rxfill_ring->desc) { - pr_warn("Descriptor alloc for RXFILL ring %u failed\n", - rxfill_ring->id); - return -ENOMEM; - } - - spin_lock_init(&rxfill_ring->lock); - return 0; -} - -/* - * edma_setup_rxdesc_ring_res() - * Setup resources for one RxDesc ring - */ -static int edma_setup_rxdesc_ring_res(struct edma_hw *ehw, - struct edma_rxdesc_ring *rxdesc_ring) -{ - struct platform_device *pdev = ehw->pdev; - - /* - * Allocate RxDesc ring descriptors - */ - rxdesc_ring->desc = dma_alloc_coherent(&pdev->dev, - (sizeof(struct edma_rxdesc_desc) - * rxdesc_ring->count), - &rxdesc_ring->dma, GFP_KERNEL); - if (!rxdesc_ring->desc) { - pr_warn("Descriptor alloc for RXDESC ring %u failed\n", - rxdesc_ring->id); - return -ENOMEM; - } - - return 0; -} - -/* - * edma_cleanup_rxdesc_ring_res() - * Cleanup resources for RxDesc ring - */ -static void edma_cleanup_rxdesc_ring_res(struct edma_hw *ehw, - struct edma_rxdesc_ring *rxdesc_ring) -{ - struct platform_device *pdev = ehw->pdev; - struct sk_buff *skb; - struct edma_rxdesc_desc *rxdesc_desc; - struct edma_rx_preheader *rxph = NULL; - uint16_t prod_idx = 0; - uint16_t cons_idx = 0; - int store_idx; - - cons_idx = edma_reg_read(EDMA_REG_RXDESC_CONS_IDX(rxdesc_ring->id)) - & EDMA_RXDESC_CONS_IDX_MASK; - - prod_idx = edma_reg_read(EDMA_REG_RXDESC_PROD_IDX(rxdesc_ring->id)) - & EDMA_RXDESC_PROD_IDX_MASK; - - /* - * Free any buffers assigned to any descriptors - */ - while (cons_idx != prod_idx) { - rxdesc_desc = EDMA_RXDESC_DESC(rxdesc_ring, cons_idx); - - rxph = (struct edma_rx_preheader *) - phys_to_virt(rxdesc_desc->buffer_addr); - - dma_unmap_single(&pdev->dev, rxdesc_desc->buffer_addr, - EDMA_RX_BUFF_SIZE, DMA_FROM_DEVICE); - store_idx = rxph->opaque; - skb = ehw->rx_skb_store[store_idx]; - ehw->rx_skb_store[store_idx] = NULL; - dev_kfree_skb_any(skb); - - /* - * Update consumer index - */ - if (++cons_idx == rxdesc_ring->count) - cons_idx = 0; - } - - /* - * Free RXDESC ring descriptors - */ - dma_free_coherent(&pdev->dev, - (sizeof(struct edma_rxdesc_desc) - * rxdesc_ring->count), - rxdesc_ring->desc, rxdesc_ring->dma); -} - -/* - * edma_cleanup_txcmpl_ring_res() - * Cleanup resources for one TxCmpl ring - */ -static void edma_cleanup_txcmpl_ring_res(struct edma_hw *ehw, - struct edma_txcmpl_ring *txcmpl_ring) -{ - struct platform_device *pdev = ehw->pdev; - - /* - * Free any buffers assigned to any descriptors - */ - edma_clean_tx(ehw, txcmpl_ring); - - /* - * Free TxCmpl ring descriptors - */ - dma_free_coherent(&pdev->dev, - (sizeof(struct edma_txcmpl_desc) - * txcmpl_ring->count), - txcmpl_ring->desc, txcmpl_ring->dma); -} - -/* - * edma_setup_txcmpl_ring_res() - * Setup resources for one TxCmpl ring - */ -static int edma_setup_txcmpl_ring_res(struct edma_hw *ehw, - struct edma_txcmpl_ring *txcmpl_ring) -{ - struct platform_device *pdev = ehw->pdev; - - /* - * Allocate TxCmpl ring descriptors - */ - txcmpl_ring->desc = dma_alloc_coherent(&pdev->dev, - (sizeof(struct edma_txcmpl_desc) - * txcmpl_ring->count), - &txcmpl_ring->dma, GFP_KERNEL); - - if (!txcmpl_ring->desc) { - pr_warn("Descriptor alloc for TXCMPL ring %u failed\n", - txcmpl_ring->id); - - return -ENOMEM; - } - - return 0; -} - -/* - * edma_cleanup_txdesc_ring_res() - * Cleanup resources for one TxDesc ring - */ -static void edma_cleanup_txdesc_ring_res(struct edma_hw *ehw, - struct edma_txdesc_ring *txdesc_ring) -{ - struct platform_device *pdev = ehw->pdev; - struct sk_buff *skb = NULL; - struct edma_txdesc_desc *txdesc = NULL; - uint16_t prod_idx, cons_idx; - size_t buf_len; - uint32_t data; - int store_idx; - - /* - * Free any buffers assigned to any descriptors - */ - data = edma_reg_read(EDMA_REG_TXDESC_PROD_IDX(txdesc_ring->id)); - prod_idx = data & EDMA_TXDESC_PROD_IDX_MASK; - - data = edma_reg_read(EDMA_REG_TXDESC_CONS_IDX(txdesc_ring->id)); - cons_idx = data & EDMA_TXDESC_CONS_IDX_MASK; - - while (cons_idx != prod_idx) { - txdesc = EDMA_TXDESC_DESC(txdesc_ring, cons_idx); - store_idx = txdesc->buffer_addr; - skb = ehw->tx_skb_store[store_idx]; - ehw->tx_skb_store[store_idx] = NULL; - - buf_len = (txdesc->word1 & EDMA_TXDESC_DATA_LENGTH_MASK) >> - EDMA_TXDESC_DATA_LENGTH_SHIFT; - - dma_unmap_single(&pdev->dev, (dma_addr_t)skb->data, - buf_len + EDMA_TX_PREHDR_SIZE, DMA_TO_DEVICE); - - dev_kfree_skb_any(skb); - cons_idx = (cons_idx + 1) & (txdesc_ring->count - 1); - cons_idx++; - if (cons_idx == txdesc_ring->count) - cons_idx = 0; - - } - - /* - * Free Tx ring descriptors - */ - dma_free_coherent(&pdev->dev, - (sizeof(struct edma_txdesc_desc) - * txdesc_ring->count), - txdesc_ring->desc, txdesc_ring->dma); - -} - -/* - * edma_setup_txdesc_ring_res() - * Setup resources for one TxDesc ring - */ -static int edma_setup_txdesc_ring_res(struct edma_hw *ehw, - struct edma_txdesc_ring *txdesc_ring) -{ - struct platform_device *pdev = ehw->pdev; - - /* - * Allocate Tx ring descriptors - */ - txdesc_ring->desc = dma_alloc_coherent(&pdev->dev, - (sizeof(struct edma_txdesc_desc) - * txdesc_ring->count), - &txdesc_ring->dma, GFP_KERNEL); - if (!txdesc_ring->desc) { - pr_warn("Descriptor alloc for TXDESC ring %u failed\n", - txdesc_ring->id); - return -ENOMEM; - } - - spin_lock_init(&txdesc_ring->tx_lock); - - return 0; -} - -/* - * edma_setup_ring_resources() - * Allocate/setup resources for EDMA rings - */ -static int edma_setup_ring_resources(struct edma_hw *ehw) -{ - struct edma_txcmpl_ring *txcmpl_ring = NULL; - struct edma_txdesc_ring *txdesc_ring = NULL; - struct edma_rxfill_ring *rxfill_ring = NULL; - struct edma_rxdesc_ring *rxdesc_ring = NULL; - int i; - int ret; - int index; - - /* - * Allocate TxDesc ring descriptors - */ - for (i = 0; i < ehw->txdesc_rings; i++) { - txdesc_ring = &ehw->txdesc_ring[i]; - txdesc_ring->count = EDMA_RING_SIZE; - txdesc_ring->id = ehw->txdesc_ring_start + i; - - ret = edma_setup_txdesc_ring_res(ehw, txdesc_ring); - if (ret != 0) { - while (i-- >= 0) - edma_cleanup_txdesc_ring_res(ehw, - &ehw->txdesc_ring[i]); - - return -ENOMEM; - - } - } - - /* - * Allocate TxCmpl ring descriptors - */ - for (i = 0; i < ehw->txcmpl_rings; i++) { - txcmpl_ring = &ehw->txcmpl_ring[i]; - txcmpl_ring->count = EDMA_RING_SIZE; - txcmpl_ring->id = ehw->txcmpl_ring_start + i; - - ret = edma_setup_txcmpl_ring_res(ehw, txcmpl_ring); - - if (ret != 0) { - while (i-- >= 0) - edma_cleanup_txcmpl_ring_res(ehw, - &ehw->txcmpl_ring[i]); - - goto txcmpl_mem_alloc_fail; - } - } - - /* - * Allocate Rx fill ring descriptors - */ - for (i = 0; i < ehw->rxfill_rings; i++) { - rxfill_ring = &ehw->rxfill_ring[i]; - rxfill_ring->count = EDMA_RING_SIZE; - rxfill_ring->id = ehw->rxfill_ring_start + i; - - ret = edma_setup_rxfill_ring_res(ehw, rxfill_ring); - if (ret != 0) { - while (--i >= 0) - edma_cleanup_rxfill_ring_res(ehw, - &ehw->rxfill_ring[i]); - - goto rxfill_mem_alloc_fail; - } - } - - /* - * Allocate RxDesc ring descriptors - */ - for (i = 0; i < ehw->rxdesc_rings; i++) { - rxdesc_ring = &ehw->rxdesc_ring[i]; - rxdesc_ring->count = EDMA_RING_SIZE; - rxdesc_ring->id = ehw->rxdesc_ring_start + i; - - /* - * Create a mapping between RX Desc ring and Rx fill ring. - * Number of fill rings are lesser than the descriptor rings - * Share the fill rings across descriptor rings. - */ - - index = ehw->rxfill_ring_start + (i % ehw->rxfill_rings); - rxdesc_ring->rxfill = - &ehw->rxfill_ring[index - ehw->rxfill_ring_start]; - - ret = edma_setup_rxdesc_ring_res(ehw, rxdesc_ring); - if (ret != 0) { - while (--i >= 0) - edma_cleanup_rxdesc_ring_res(ehw, - &ehw->rxdesc_ring[i]); - - goto rxdesc_mem_alloc_fail; - } - } - - return 0; - -rxdesc_mem_alloc_fail: - for (i = 0; i < ehw->rxfill_rings; i++) - edma_cleanup_rxfill_ring_res(ehw, &ehw->rxfill_ring[i]); - -rxfill_mem_alloc_fail: - for (i = 0; i < ehw->txcmpl_rings; i++) - edma_cleanup_txcmpl_ring_res(ehw, &ehw->txcmpl_ring[i]); - -txcmpl_mem_alloc_fail: - for (i = 0; i < ehw->txdesc_rings; i++) - edma_cleanup_txdesc_ring_res(ehw, &ehw->txdesc_ring[i]); - - return -ENOMEM; -} - -/* - * edma_free_rings() - * Free EDMA software rings - */ -static void edma_free_rings(struct edma_hw *ehw) -{ - kfree(ehw->rxfill_ring); - kfree(ehw->rxdesc_ring); - kfree(ehw->txdesc_ring); - kfree(ehw->txcmpl_ring); -} - -/* - * edma_alloc_rings() - * Allocate EDMA software rings - */ -static int edma_alloc_rings(struct edma_hw *ehw) -{ - ehw->rxfill_ring = kzalloc((sizeof(struct edma_rxfill_ring) * - ehw->rxfill_rings), GFP_KERNEL); - if (!ehw->rxfill_ring) - return -ENOMEM; - - ehw->rxdesc_ring = kzalloc((sizeof(struct edma_rxdesc_ring) * - ehw->rxdesc_rings), GFP_KERNEL); - if (!ehw->rxdesc_ring) - goto rxdesc_ring_alloc_fail; - - ehw->txdesc_ring = kzalloc((sizeof(struct edma_txdesc_ring) * - ehw->txdesc_rings), GFP_KERNEL); - if (!ehw->txdesc_ring) - goto txdesc_ring_alloc_fail; - - ehw->txcmpl_ring = kzalloc((sizeof(struct edma_txcmpl_ring) * - ehw->txcmpl_rings), GFP_KERNEL); - if (!ehw->txcmpl_ring) - goto txcmpl_ring_alloc_fail; - - pr_info("Num rings - TxDesc:%u (%u-%u) TxCmpl:%u (%u-%u)\n", - ehw->txdesc_rings, ehw->txdesc_ring_start, - (ehw->txdesc_ring_start + ehw->txdesc_rings - 1), - ehw->txcmpl_rings, ehw->txcmpl_ring_start, - (ehw->txcmpl_ring_start + ehw->txcmpl_rings - 1)); - - pr_info("RxDesc:%u (%u-%u) RxFill:%u (%u-%u)\n", - ehw->rxdesc_rings, ehw->rxdesc_ring_start, - (ehw->rxdesc_ring_start + ehw->rxdesc_rings - 1), - ehw->rxfill_rings, ehw->rxfill_ring_start, - (ehw->rxfill_ring_start + ehw->rxfill_rings - 1)); - - return 0; -txcmpl_ring_alloc_fail: - kfree(ehw->txdesc_ring); -txdesc_ring_alloc_fail: - kfree(ehw->rxdesc_ring); -rxdesc_ring_alloc_fail: - kfree(ehw->rxfill_ring); - return -ENOMEM; -} - -/* - * edma_cleanup_rings() - * Cleanup EDMA rings - */ -void edma_cleanup_rings(struct edma_hw *ehw) -{ - int i; - - /* - * Free any buffers assigned to any descriptors - */ - for (i = 0; i < ehw->txdesc_rings; i++) - edma_cleanup_txdesc_ring_res(ehw, &ehw->txdesc_ring[i]); - - /* - * Free Tx completion descriptors - */ - for (i = 0; i < ehw->txcmpl_rings; i++) - edma_cleanup_txcmpl_ring_res(ehw, &ehw->txcmpl_ring[i]); - - /* - * Free Rx fill ring descriptors - */ - for (i = 0; i < ehw->rxfill_rings; i++) - edma_cleanup_rxfill_ring_res(ehw, &ehw->rxfill_ring[i]); - - /* - * Free Rx completion ring descriptors - */ - for (i = 0; i < ehw->rxdesc_rings; i++) - edma_cleanup_rxdesc_ring_res(ehw, &ehw->rxdesc_ring[i]); - - edma_free_rings(ehw); -} - -/* - * edma_init_rings() - * Initialize EDMA rings - */ -static int edma_init_rings(struct edma_hw *ehw) -{ - int ret = 0; - - ret = edma_alloc_rings(ehw); - if (ret) - return ret; - - ret = edma_setup_ring_resources(ehw); - if (ret) - return ret; - - return 0; -} - -/* - * edma_configure_txdesc_ring() - * Configure one TxDesc ring - */ -static void edma_configure_txdesc_ring(struct edma_hw *ehw, - struct edma_txdesc_ring *txdesc_ring) -{ - uint32_t data = 0; - uint16_t hw_cons_idx = 0; - - /* - * Configure TXDESC ring - */ - edma_reg_write(EDMA_REG_TXDESC_BA(txdesc_ring->id), - (uint32_t)(txdesc_ring->dma & - EDMA_RING_DMA_MASK)); - - edma_reg_write(EDMA_REG_TXDESC_RING_SIZE(txdesc_ring->id), - (uint32_t)(txdesc_ring->count & - EDMA_TXDESC_RING_SIZE_MASK)); - - data = edma_reg_read(EDMA_REG_TXDESC_CONS_IDX(txdesc_ring->id)); - data &= ~(EDMA_TXDESC_CONS_IDX_MASK); - hw_cons_idx = data; - - data = edma_reg_read(EDMA_REG_TXDESC_PROD_IDX(txdesc_ring->id)); - data &= ~(EDMA_TXDESC_PROD_IDX_MASK); - data |= hw_cons_idx & EDMA_TXDESC_PROD_IDX_MASK; - edma_reg_write(EDMA_REG_TXDESC_PROD_IDX(txdesc_ring->id), data); -} - -/* - * edma_configure_txcmpl_ring() - * Configure one TxCmpl ring - */ -static void edma_configure_txcmpl_ring(struct edma_hw *ehw, - struct edma_txcmpl_ring *txcmpl_ring) -{ - uint32_t tx_mod_timer; - - /* - * Configure TxCmpl ring base address - */ - edma_reg_write(EDMA_REG_TXCMPL_BA(txcmpl_ring->id), - (uint32_t)(txcmpl_ring->dma & EDMA_RING_DMA_MASK)); - edma_reg_write(EDMA_REG_TXCMPL_RING_SIZE(txcmpl_ring->id), - (uint32_t)(txcmpl_ring->count - & EDMA_TXDESC_RING_SIZE_MASK)); - - /* - * Set TxCmpl ret mode to opaque - */ - edma_reg_write(EDMA_REG_TXCMPL_CTRL(txcmpl_ring->id), - EDMA_TXCMPL_RETMODE_OPAQUE); - - tx_mod_timer = (EDMA_TX_MOD_TIMER & EDMA_TX_MOD_TIMER_INIT_MASK) - << EDMA_TX_MOD_TIMER_INIT_SHIFT; - edma_reg_write(EDMA_REG_TX_MOD_TIMER(txcmpl_ring->id), - tx_mod_timer); - - edma_reg_write(EDMA_REG_TX_INT_CTRL(txcmpl_ring->id), 0x2); -} - -/* - * edma_configure_rxdesc_ring() - * Configure one RxDesc ring - */ -static void edma_configure_rxdesc_ring(struct edma_hw *ehw, - struct edma_rxdesc_ring *rxdesc_ring) -{ - uint32_t data; - - edma_reg_write(EDMA_REG_RXDESC_BA(rxdesc_ring->id), - (uint32_t)(rxdesc_ring->dma & 0xffffffff)); - - data = rxdesc_ring->count & EDMA_RXDESC_RING_SIZE_MASK; - data |= (ehw->rx_payload_offset & EDMA_RXDESC_PL_OFFSET_MASK) - << EDMA_RXDESC_PL_OFFSET_SHIFT; - edma_reg_write(EDMA_REG_RXDESC_RING_SIZE(rxdesc_ring->id), data); - - data = (EDMA_RX_MOD_TIMER_INIT & EDMA_RX_MOD_TIMER_INIT_MASK) - << EDMA_RX_MOD_TIMER_INIT_SHIFT; - edma_reg_write(EDMA_REG_RX_MOD_TIMER(rxdesc_ring->id), data); - - /* - * Enable ring. Set ret mode to 'opaque'. - */ - edma_reg_write(EDMA_REG_RX_INT_CTRL(rxdesc_ring->id), 0x2); -} - -/* - * edma_configure_rxfill_ring() - * Configure one RxFill ring - */ -static void edma_configure_rxfill_ring(struct edma_hw *ehw, - struct edma_rxfill_ring *rxfill_ring) -{ - uint32_t data = 0; - - edma_reg_write(EDMA_REG_RXFILL_BA(rxfill_ring->id), - (uint32_t)(rxfill_ring->dma & EDMA_RING_DMA_MASK)); - - data = rxfill_ring->count & EDMA_RXFILL_RING_SIZE_MASK; - edma_reg_write(EDMA_REG_RXFILL_RING_SIZE(rxfill_ring->id), data); - - /* - * Alloc Rx buffers - */ - edma_alloc_rx_buffer(ehw, rxfill_ring); -} - -/* - * edma_configure_rings() - * Configure EDMA rings - */ -static void edma_configure_rings(struct edma_hw *ehw) -{ - int i = 0; - - /* - * Initialize the store - */ - for (i = 0; i < EDMA_RING_SIZE; i++) { - ehw->tx_skb_store[i] = NULL; - ehw->rx_skb_store[i] = NULL; - } - - /* - * Configure TXDESC ring - */ - for (i = 0; i < ehw->txdesc_rings; i++) - edma_configure_txdesc_ring(ehw, &ehw->txdesc_ring[i]); - - /* - * Configure TXCMPL ring - */ - for (i = 0; i < ehw->txcmpl_rings; i++) - edma_configure_txcmpl_ring(ehw, &ehw->txcmpl_ring[i]); - - /* - * Configure RXFILL rings - */ - for (i = 0; i < ehw->rxfill_rings; i++) - edma_configure_rxfill_ring(ehw, &ehw->rxfill_ring[i]); - - /* - * Configure RXDESC ring - */ - for (i = 0; i < ehw->rxdesc_rings; i++) - edma_configure_rxdesc_ring(ehw, &ehw->rxdesc_ring[i]); -} - -/* - * edma_hw_reset() - * Reset EDMA Hardware during initialization - */ -int edma_hw_reset(struct edma_hw *ehw) -{ - struct reset_control *rst; - struct platform_device *pdev = ehw->pdev; - - rst = devm_reset_control_get(&pdev->dev, EDMA_HW_RESET_ID); - if (IS_ERR(rst)) { - pr_warn("DTS Node: %s does not exist\n", EDMA_HW_RESET_ID); - return -EINVAL; - } - - reset_control_assert(rst); - udelay(100); - - reset_control_deassert(rst); - udelay(100); - - pr_info("EDMA HW Reset completed succesfully\n"); - - return 0; -} - -/* - * edma_hw_init() - * EDMA hw init - */ -int edma_hw_init(struct edma_hw *ehw) -{ - int ret = 0; - int desc_index; - uint32_t i, data, reg = 0; - struct edma_rxdesc_ring *rxdesc_ring = NULL; - - data = edma_reg_read(EDMA_REG_MAS_CTRL); - pr_info("EDMA ver %d hw init\n", data); - - /* - * Setup private data structure - */ - ehw->misc_intr_mask = 0x0; - ehw->rxfill_intr_mask = EDMA_RXFILL_INT_MASK; - ehw->rxdesc_intr_mask = EDMA_RXDESC_INT_MASK_PKT_INT; - ehw->txcmpl_intr_mask = EDMA_TX_INT_MASK_PKT_INT | - EDMA_TX_INT_MASK_UGT_INT; - ehw->rx_payload_offset = EDMA_RX_PREHDR_SIZE; - ehw->active = 0; - ehw->edma_initialized = false; - - /* Reset EDMA */ - ret = edma_hw_reset(ehw); - if (ret) - return ret; - - /* - * Disable interrupts - */ - for (i = 0; i < EDMA_MAX_TXCMPL_RINGS; i++) - edma_reg_write(EDMA_REG_TX_INT_MASK(i), 0); - - for (i = 0; i < EDMA_MAX_RXFILL_RINGS; i++) - edma_reg_write(EDMA_REG_RXFILL_INT_MASK(i), 0); - - for (i = 0; i < EDMA_MAX_RXDESC_RINGS; i++) - edma_reg_write(EDMA_REG_RX_INT_CTRL(i), 0); - - /* - * Disable Rx rings - */ - for (i = 0; i < EDMA_MAX_RXDESC_RINGS; i++) { - data = edma_reg_read(EDMA_REG_RXDESC_CTRL(i)); - data &= ~EDMA_RXDESC_RX_EN; - edma_reg_write(EDMA_REG_RXDESC_CTRL(i), data); - } - - /* - * Disable RxFill Rings - */ - for (i = 0; i < EDMA_MAX_RXFILL_RINGS; i++) { - data = edma_reg_read(EDMA_REG_RXFILL_RING_EN(i)); - data &= ~EDMA_RXFILL_RING_EN; - edma_reg_write(EDMA_REG_RXFILL_RING_EN(i), data); - } - - /* - * Disable Tx rings - */ - for (desc_index = 0; desc_index < EDMA_MAX_TXDESC_RINGS; desc_index++) { - data = edma_reg_read(EDMA_REG_TXDESC_CTRL(desc_index)); - data &= ~EDMA_TXDESC_TX_EN; - edma_reg_write(EDMA_REG_TXDESC_CTRL(desc_index), data); - } - -#if defined(NSS_DP_IPQ807X) - /* - * Clear the TXDESC2CMPL_MAP_xx reg before setting up - * the mapping. This register holds TXDESC to TXFILL ring - * mapping. - */ - edma_reg_write(EDMA_REG_TXDESC2CMPL_MAP_0, 0); - edma_reg_write(EDMA_REG_TXDESC2CMPL_MAP_1, 0); - edma_reg_write(EDMA_REG_TXDESC2CMPL_MAP_2, 0); - desc_index = ehw->txcmpl_ring_start; - - /* - * 3 registers to hold the completion mapping for total 24 - * TX desc rings (0-9,10-19 and rest). In each entry 3 bits hold - * the mapping for a particular TX desc ring. - */ - for (i = ehw->txdesc_ring_start; - i < ehw->txdesc_ring_end; i++) { - if (i >= 0 && i <= 9) - reg = EDMA_REG_TXDESC2CMPL_MAP_0; - else if (i >= 10 && i <= 19) - reg = EDMA_REG_TXDESC2CMPL_MAP_1; - else - reg = EDMA_REG_TXDESC2CMPL_MAP_2; - - pr_debug("Configure TXDESC:%u to use TXCMPL:%u\n", - i, desc_index); - - data = edma_reg_read(reg); - data |= (desc_index & 0x7) << ((i % 10) * 3); - edma_reg_write(reg, data); - - desc_index++; - if (desc_index == ehw->txcmpl_ring_end) - desc_index = ehw->txcmpl_ring_start; - } -#endif - - /* - * Set PPE QID to EDMA Rx ring mapping. - * When coming up use only queue 0. - * HOST EDMA rings. FW EDMA comes up and overwrites as required. - * Each entry can hold mapping for 8 PPE queues and entry size is - * 4 bytes - */ - desc_index = ehw->rxdesc_ring_start; - data = 0; - data |= (desc_index & 0xF); - edma_reg_write(EDMA_QID2RID_TABLE_MEM(0), data); - pr_debug("Configure QID2RID reg:0x%x to 0x%x\n", reg, data); - - ret = edma_init_rings(ehw); - if (ret) - return ret; - - edma_configure_rings(ehw); - - /* - * Set RXDESC2FILL_MAP_xx reg. - * There are two registers RXDESC2FILL_0 and RXDESC2FILL_1 - * 3 bits holds the rx fill ring mapping for each of the - * rx descriptor ring. - */ - edma_reg_write(EDMA_REG_RXDESC2FILL_MAP_0, 0); - edma_reg_write(EDMA_REG_RXDESC2FILL_MAP_1, 0); - for (i = ehw->rxdesc_ring_start; - i < ehw->rxdesc_ring_end; i++) { - if ((i >= 0) && (i <= 9)) - reg = EDMA_REG_RXDESC2FILL_MAP_0; - else - reg = EDMA_REG_RXDESC2FILL_MAP_1; - - rxdesc_ring = &ehw->rxdesc_ring[i - ehw->rxdesc_ring_start]; - - pr_debug("Configure RXDESC:%u to use RXFILL:%u\n", - rxdesc_ring->id, rxdesc_ring->rxfill->id); - - data = edma_reg_read(reg); - data |= (rxdesc_ring->rxfill->id & 0x7) << ((i % 10) * 3); - edma_reg_write(reg, data); - } - - reg = EDMA_REG_RXDESC2FILL_MAP_0; - pr_debug("EDMA_REG_RXDESC2FILL_MAP_0: 0x%x\n", edma_reg_read(reg)); - reg = EDMA_REG_RXDESC2FILL_MAP_1; - pr_debug("EDMA_REG_RXDESC2FILL_MAP_1: 0x%x\n", edma_reg_read(reg)); - -#if defined(NSS_DP_IPQ807X) - reg = EDMA_REG_TXDESC2CMPL_MAP_0; - pr_debug("EDMA_REG_TXDESC2CMPL_MAP_0: 0x%x\n", edma_reg_read(reg)); - reg = EDMA_REG_TXDESC2CMPL_MAP_1; - pr_debug("EDMA_REG_TXDESC2CMPL_MAP_1: 0x%x\n", edma_reg_read(reg)); - reg = EDMA_REG_TXDESC2CMPL_MAP_2; - pr_debug("EDMA_REG_TXDESC2CMPL_MAP_2: 0x%x\n", edma_reg_read(reg)); -#endif - - /* - * Configure DMA request priority, DMA read burst length, - * and AXI write size. - */ - data = EDMA_DMAR_BURST_LEN_SET(EDMA_BURST_LEN_ENABLE) - | EDMA_DMAR_REQ_PRI_SET(0) - | EDMA_DMAR_TXDATA_OUTSTANDING_NUM_SET(31) - | EDMA_DMAR_TXDESC_OUTSTANDING_NUM_SET(7) - | EDMA_DMAR_RXFILL_OUTSTANDING_NUM_SET(7); - edma_reg_write(EDMA_REG_DMAR_CTRL, data); -#if defined(NSS_DP_IPQ60XX) - data = edma_reg_read(EDMA_REG_AXIW_CTRL); - data |= EDMA_AXIW_MAX_WR_SIZE_EN; - edma_reg_write(EDMA_REG_AXIW_CTRL, data); -#endif - - /* - * Misc error mask - */ - data = EDMA_MISC_AXI_RD_ERR_MASK_EN | - EDMA_MISC_AXI_WR_ERR_MASK_EN | - EDMA_MISC_RX_DESC_FIFO_FULL_MASK_EN | - EDMA_MISC_RX_ERR_BUF_SIZE_MASK_EN | - EDMA_MISC_TX_SRAM_FULL_MASK_EN | - EDMA_MISC_TX_CMPL_BUF_FULL_MASK_EN | - EDMA_MISC_DATA_LEN_ERR_MASK_EN; -#if defined(NSS_DP_IPQ807X) - data |= EDMA_MISC_PKT_LEN_LA_64K_MASK_EN | - EDMA_MISC_PKT_LEN_LE_40_MASK_EN; -#else - data |= EDMA_MISC_TX_TIMEOUT_MASK_EN; -#endif - edma_reg_write(EDMA_REG_MISC_INT_MASK, data); - - /* - * Global EDMA enable and padding enable - */ - data = EDMA_PORT_PAD_EN | EDMA_PORT_EDMA_EN; - edma_reg_write(EDMA_REG_PORT_CTRL, data); - - /* - * Enable Rx rings - */ - for (i = ehw->rxdesc_ring_start; i < ehw->rxdesc_ring_end; i++) { - data = edma_reg_read(EDMA_REG_RXDESC_CTRL(i)); - data |= EDMA_RXDESC_RX_EN; - edma_reg_write(EDMA_REG_RXDESC_CTRL(i), data); - } - - for (i = ehw->rxfill_ring_start; i < ehw->rxfill_ring_end; i++) { - data = edma_reg_read(EDMA_REG_RXFILL_RING_EN(i)); - data |= EDMA_RXFILL_RING_EN; - edma_reg_write(EDMA_REG_RXFILL_RING_EN(i), data); - } - - /* - * Enable Tx rings - */ - for (i = ehw->txdesc_ring_start; i < ehw->txdesc_ring_end; i++) { - data = edma_reg_read(EDMA_REG_TXDESC_CTRL(i)); - data |= EDMA_TXDESC_TX_EN; - edma_reg_write(EDMA_REG_TXDESC_CTRL(i), data); - } - - ehw->edma_initialized = true; - - return 0; -} diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.c b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.c deleted file mode 100644 index cbaee4fc4..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.c +++ /dev/null @@ -1,962 +0,0 @@ -/* - * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include -#include -#include -#include -#include -#include - -#include "nss_dp_dev.h" -#include "edma_regs.h" -#include "edma_data_plane.h" - -/* - * EDMA hardware instance - */ -struct edma_hw edma_hw; - -/* - * edma_get_port_num_from_netdev() - * Get port number from net device - */ -static int edma_get_port_num_from_netdev(struct net_device *netdev) -{ - int i; - - for (i = 0; i < EDMA_MAX_GMACS; i++) { - /* In the port-id to netdev mapping table, port-id - * starts from 1 and table index starts from 0. - * So we return index + 1 for port-id - */ - if (edma_hw.netdev_arr[i] == netdev) - return i+1; - } - - return -1; -} - -/* - * edma_reg_read() - * Read EDMA register - */ -uint32_t edma_reg_read(uint32_t reg_off) -{ - return (uint32_t)readl(edma_hw.reg_base + reg_off); -} - -/* - * edma_reg_write() - * Write EDMA register - */ -void edma_reg_write(uint32_t reg_off, uint32_t val) -{ - writel(val, edma_hw.reg_base + reg_off); -} - -/* - * edma_disable_interrupts() - * Disable EDMA RX/TX interrupt masks. - */ -static void edma_disable_interrupts(void) -{ - struct edma_rxdesc_ring *rxdesc_ring = NULL; - struct edma_rxfill_ring *rxfill_ring = NULL; - struct edma_txcmpl_ring *txcmpl_ring = NULL; - int i; - - for (i = 0; i < edma_hw.rxdesc_rings; i++) { - rxdesc_ring = &edma_hw.rxdesc_ring[i]; - edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), - EDMA_MASK_INT_CLEAR); - } - - for (i = 0; i < edma_hw.txcmpl_rings; i++) { - txcmpl_ring = &edma_hw.txcmpl_ring[i]; - edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id), - EDMA_MASK_INT_CLEAR); - } - - for (i = 0; i < edma_hw.rxfill_rings; i++) { - rxfill_ring = &edma_hw.rxfill_ring[i]; - edma_reg_write(EDMA_REG_RXFILL_INT_MASK(rxfill_ring->id), - EDMA_MASK_INT_CLEAR); - } - - /* - * Clear MISC interrupt mask. - */ - edma_reg_write(EDMA_REG_MISC_INT_MASK, EDMA_MASK_INT_CLEAR); -} - -/* - * edma_enable_interrupts() - * Enable RX/TX EDMA interrupt masks. - */ -static void edma_enable_interrupts(void) -{ - struct edma_rxdesc_ring *rxdesc_ring = NULL; - struct edma_rxfill_ring *rxfill_ring = NULL; - struct edma_txcmpl_ring *txcmpl_ring = NULL; - int i; - - for (i = 0; i < edma_hw.rxfill_rings; i++) { - rxfill_ring = &edma_hw.rxfill_ring[i]; - edma_reg_write(EDMA_REG_RXFILL_INT_MASK(rxfill_ring->id), - edma_hw.rxfill_intr_mask); - } - - for (i = 0; i < edma_hw.txcmpl_rings; i++) { - txcmpl_ring = &edma_hw.txcmpl_ring[i]; - edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id), - edma_hw.txcmpl_intr_mask); - } - - for (i = 0; i < edma_hw.rxdesc_rings; i++) { - rxdesc_ring = &edma_hw.rxdesc_ring[i]; - edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), - edma_hw.rxdesc_intr_mask); - } - - /* - * Enable MISC interrupt mask. - */ - edma_reg_write(EDMA_REG_MISC_INT_MASK, edma_hw.misc_intr_mask); -} - -/* - * nss_dp_edma_if_open() - * Do slow path data plane open - */ -static int edma_if_open(struct nss_dp_data_plane_ctx *dpc, - uint32_t tx_desc_ring, uint32_t rx_desc_ring, - uint32_t mode) -{ - if (!dpc->dev) - return NSS_DP_FAILURE; - - /* - * Enable NAPI - */ - if (edma_hw.active++ != 0) - return NSS_DP_SUCCESS; - - napi_enable(&edma_hw.napi); - - /* - * Enable the interrupt masks. - */ - edma_enable_interrupts(); - - return NSS_DP_SUCCESS; -} - -/* - * edma_if_close() - * Do slow path data plane close - */ -static int edma_if_close(struct nss_dp_data_plane_ctx *dpc) -{ - if (--edma_hw.active != 0) - return NSS_DP_SUCCESS; - - /* - * Disable the interrupt masks. - */ - edma_disable_interrupts(); - - /* - * Disable NAPI - */ - napi_disable(&edma_hw.napi); - return NSS_DP_SUCCESS; -} - -/* - * edma_if_link_state() - */ -static int edma_if_link_state(struct nss_dp_data_plane_ctx *dpc, - uint32_t link_state) -{ - return NSS_DP_SUCCESS; -} - -/* - * edma_if_mac_addr() - */ -static int edma_if_mac_addr(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr) -{ - return NSS_DP_SUCCESS; -} - -/* - * edma_if_change_mtu() - */ -static int edma_if_change_mtu(struct nss_dp_data_plane_ctx *dpc, uint32_t mtu) -{ - return NSS_DP_SUCCESS; -} - -/* - * edma_if_xmit() - * Transmit a packet using EDMA - */ -static netdev_tx_t edma_if_xmit(struct nss_dp_data_plane_ctx *dpc, - struct sk_buff *skb) -{ - struct net_device *netdev = dpc->dev; - int ret; - uint32_t tx_ring, skbq, nhead, ntail; - bool expand_skb = false; - - if (skb->len < ETH_HLEN) { - netdev_dbg(netdev, "skb->len < ETH_HLEN\n"); - goto drop; - } - - /* - * Select a Tx ring - */ - skbq = skb_get_queue_mapping(skb); - tx_ring = 0; - if ((edma_hw.txdesc_rings > 1) && (skbq > 0)) - tx_ring = edma_hw.txdesc_rings % skbq; - - /* - * Check for non-linear skb - */ - if (skb_is_nonlinear(skb)) { - netdev_dbg(netdev, "cannot Tx non-linear skb:%px\n", skb); - goto drop; - } - - /* - * Check for headroom/tailroom and clone - */ - nhead = netdev->needed_headroom; - ntail = netdev->needed_tailroom; - - if (skb_cloned(skb) || - (skb_headroom(skb) < nhead) || - (skb_headroom(skb) < ntail)) { - expand_skb = true; - } - - /* - * Expand the skb. This also unclones a cloned skb. - */ - if (expand_skb && pskb_expand_head(skb, nhead, ntail, GFP_ATOMIC)) { - netdev_dbg(netdev, "cannot expand skb:%px\n", skb); - goto drop; - } - - /* - * Transmit the packet - */ - ret = edma_ring_xmit(&edma_hw, netdev, skb, - &edma_hw.txdesc_ring[tx_ring]); - if (ret == EDMA_TX_OK) - return NETDEV_TX_OK; - - /* - * Not enough descriptors. Stop netdev Tx queue. - */ - if (ret == EDMA_TX_DESC) { - netif_stop_queue(netdev); - return NETDEV_TX_BUSY; - } - -drop: - dev_kfree_skb_any(skb); - netdev->stats.tx_dropped++; - - return NETDEV_TX_OK; -} - -/* - * edma_if_set_features() - * Set the supported net_device features - */ -static void edma_if_set_features(struct nss_dp_data_plane_ctx *dpc) -{ - /* - * TODO - add flags to support HIGHMEM/cksum offload VLAN - * the features are enabled. - */ -} - -/* TODO - check if this is needed */ -/* - * edma_if_pause_on_off() - * Set pause frames on or off - * - * No need to send a message if we defaulted to slow path. - */ -static int edma_if_pause_on_off(struct nss_dp_data_plane_ctx *dpc, - uint32_t pause_on) -{ - return NSS_DP_SUCCESS; -} - -/* - * edma_if_vsi_assign() - * assign vsi of the data plane - * - */ -static int edma_if_vsi_assign(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi) -{ - struct net_device *netdev = dpc->dev; - int32_t port_num; - - port_num = edma_get_port_num_from_netdev(netdev); - - if (port_num < 0) - return NSS_DP_FAILURE; - - if (fal_port_vsi_set(0, port_num, vsi) < 0) - return NSS_DP_FAILURE; - - return NSS_DP_SUCCESS; -} - -/* - * edma_if_vsi_unassign() - * unassign vsi of the data plane - * - */ -static int edma_if_vsi_unassign(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi) -{ - struct net_device *netdev = dpc->dev; - uint32_t port_num; - - port_num = edma_get_port_num_from_netdev(netdev); - - if (port_num < 0) - return NSS_DP_FAILURE; - - if (fal_port_vsi_set(0, port_num, 0xffff) < 0) - return NSS_DP_FAILURE; - - return NSS_DP_SUCCESS; -} - -#ifdef CONFIG_RFS_ACCEL -/* - * edma_if_rx_flow_steer() - * Flow steer of the data plane - * - * Initial receive flow steering function for data plane operation. - */ -static int edma_if_rx_flow_steer(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *skb, - uint32_t cpu, bool is_add) -{ - return NSS_DP_SUCCESS; -} -#endif - -/* - * edma_if_deinit() - * Free edma resources - */ -static int edma_if_deinit(struct nss_dp_data_plane_ctx *dpc) -{ - /* - * Free up resources used by EDMA if all the - * interfaces have been overridden - * */ - if (edma_hw.dp_override_cnt == EDMA_MAX_GMACS - 1) { - edma_cleanup(true); - } else { - edma_hw.dp_override_cnt++; - } - - return NSS_DP_SUCCESS; -} - -/* - * edma_irq_init() - * Initialize interrupt handlers for the driver - */ -static int edma_irq_init(void) -{ - int err; - uint32_t entry_num, i; - - /* - * Get TXCMPL rings IRQ numbers - */ - entry_num = 0; - for (i = 0; i < edma_hw.txcmpl_rings; i++, entry_num++) { - edma_hw.txcmpl_intr[i] = - platform_get_irq(edma_hw.pdev, entry_num); - if (edma_hw.txcmpl_intr[i] < 0) { - pr_warn("%s: txcmpl_intr[%u] irq get failed\n", - (edma_hw.device_node)->name, i); - return -1; - } - - pr_debug("%s: txcmpl_intr[%u] = %u\n", - (edma_hw.device_node)->name, - i, edma_hw.txcmpl_intr[i]); - } - - /* - * Get RXFILL rings IRQ numbers - */ - for (i = 0; i < edma_hw.rxfill_rings; i++, entry_num++) { - edma_hw.rxfill_intr[i] = - platform_get_irq(edma_hw.pdev, entry_num); - if (edma_hw.rxfill_intr[i] < 0) { - pr_warn("%s: rxfill_intr[%u] irq get failed\n", - (edma_hw.device_node)->name, i); - return -1; - } - - pr_debug("%s: rxfill_intr[%u] = %u\n", - (edma_hw.device_node)->name, - i, edma_hw.rxfill_intr[i]); - } - - /* - * Get RXDESC rings IRQ numbers - * - */ - for (i = 0; i < edma_hw.rxdesc_rings; i++, entry_num++) { - edma_hw.rxdesc_intr[i] = - platform_get_irq(edma_hw.pdev, entry_num); - if (edma_hw.rxdesc_intr[i] < 0) { - pr_warn("%s: rxdesc_intr[%u] irq get failed\n", - (edma_hw.device_node)->name, i); - return -1; - } - - pr_debug("%s: rxdesc_intr[%u] = %u\n", - (edma_hw.device_node)->name, - i, edma_hw.rxdesc_intr[i]); - } - - /* - * Get misc IRQ number - */ - edma_hw.misc_intr = platform_get_irq(edma_hw.pdev, entry_num); - pr_debug("%s: misc IRQ:%u\n", - (edma_hw.device_node)->name, - edma_hw.misc_intr); - - /* - * Request IRQ for TXCMPL rings - */ - for (i = 0; i < edma_hw.txcmpl_rings; i++) { - err = request_irq(edma_hw.txcmpl_intr[i], - edma_handle_irq, IRQF_SHARED, - "edma_txcmpl", (void *)edma_hw.pdev); - if (err) { - pr_debug("TXCMPL ring IRQ:%d request failed\n", - edma_hw.txcmpl_intr[i]); - return -1; - - } - } - - /* - * Request IRQ for RXFILL rings - */ - for (i = 0; i < edma_hw.rxfill_rings; i++) { - err = request_irq(edma_hw.rxfill_intr[i], - edma_handle_irq, IRQF_SHARED, - "edma_rxfill", (void *)edma_hw.pdev); - if (err) { - pr_debug("RXFILL ring IRQ:%d request failed\n", - edma_hw.rxfill_intr[i]); - goto rx_fill_ring_intr_req_fail; - } - } - - /* - * Request IRQ for RXDESC rings - */ - for (i = 0; i < edma_hw.rxdesc_rings; i++) { - err = request_irq(edma_hw.rxdesc_intr[i], - edma_handle_irq, IRQF_SHARED, - "edma_rxdesc", (void *)edma_hw.pdev); - if (err) { - pr_debug("RXDESC ring IRQ:%d request failed\n", - edma_hw.rxdesc_intr[i]); - goto rx_desc_ring_intr_req_fail; - } - } - - /* - * Request Misc IRQ - */ - err = request_irq(edma_hw.misc_intr, edma_handle_misc_irq, - IRQF_SHARED, "edma_misc", - (void *)edma_hw.pdev); - if (err) { - pr_debug("MISC IRQ:%d request failed\n", - edma_hw.misc_intr); - goto misc_intr_req_fail; - } - - return 0; - -misc_intr_req_fail: - - /* - * Free IRQ for RXDESC rings - */ - for (i = 0; i < edma_hw.rxdesc_rings; i++) { - synchronize_irq(edma_hw.rxdesc_intr[i]); - free_irq(edma_hw.rxdesc_intr[i], - (void *)&(edma_hw.pdev)->dev); - } - -rx_desc_ring_intr_req_fail: - - /* - * Free IRQ for RXFILL rings - */ - for (i = 0; i < edma_hw.rxfill_rings; i++) { - synchronize_irq(edma_hw.rxfill_intr[i]); - free_irq(edma_hw.rxfill_intr[i], - (void *)&(edma_hw.pdev)->dev); - } - -rx_fill_ring_intr_req_fail: - - /* - * Free IRQ for TXCMPL rings - */ - for (i = 0; i < edma_hw.txcmpl_rings; i++) { - - synchronize_irq(edma_hw.txcmpl_intr[i]); - free_irq(edma_hw.txcmpl_intr[i], - (void *)&(edma_hw.pdev)->dev); - } - - return -1; -} - -/* - * edma_register_netdevice() - * Register netdevice with EDMA - */ -static int edma_register_netdevice(struct net_device *netdev, uint32_t macid) -{ - if (!netdev) { - pr_info("nss_dp_edma: Invalid netdev pointer %px\n", netdev); - return -EINVAL; - } - - if ((macid < EDMA_START_GMACS) || (macid > EDMA_MAX_GMACS)) { - netdev_dbg(netdev, "nss_dp_edma: Invalid macid(%d) for %s\n", - macid, netdev->name); - return -EINVAL; - } - - netdev_info(netdev, "nss_dp_edma: Registering netdev %s(qcom-id:%d) with EDMA\n", - netdev->name, macid); - - /* - * We expect 'macid' to correspond to ports numbers on - * IPQ807x. These begin from '1' and hence we subtract - * one when using it as an array index. - */ - edma_hw.netdev_arr[macid - 1] = netdev; - - /* - * NAPI add - */ - if (!edma_hw.napi_added) { - netif_napi_add(netdev, &edma_hw.napi, edma_napi, - EDMA_NAPI_WORK); - /* - * Register the interrupt handlers and enable interrupts - */ - if (edma_irq_init() < 0) - return -EINVAL; - - edma_hw.napi_added = 1; - } - - return 0; -} - -/* - * edma_if_init() - */ - -static int edma_if_init(struct nss_dp_data_plane_ctx *dpc) -{ - - struct net_device *netdev = dpc->dev; - struct nss_dp_dev *dp_dev = (struct nss_dp_dev *)netdev_priv(netdev); - int ret = 0; - - /* - * Register the netdev - */ - ret = edma_register_netdevice(netdev, dp_dev->macid); - if (ret) { - netdev_dbg(netdev, - "Error registering netdevice with EDMA %s\n", - netdev->name); - return NSS_DP_FAILURE; - } - - /* - * Headroom needed for Tx preheader - */ - netdev->needed_headroom += EDMA_TX_PREHDR_SIZE; - - return NSS_DP_SUCCESS; -} - -/* - * nss_dp_edma_ops - */ -struct nss_dp_data_plane_ops nss_dp_edma_ops = { - .init = edma_if_init, - .open = edma_if_open, - .close = edma_if_close, - .link_state = edma_if_link_state, - .mac_addr = edma_if_mac_addr, - .change_mtu = edma_if_change_mtu, - .xmit = edma_if_xmit, - .set_features = edma_if_set_features, - .pause_on_off = edma_if_pause_on_off, - .vsi_assign = edma_if_vsi_assign, - .vsi_unassign = edma_if_vsi_unassign, -#ifdef CONFIG_RFS_ACCEL - .rx_flow_steer = edma_if_rx_flow_steer, -#endif - .deinit = edma_if_deinit, -}; - -/* - * edma_of_get_pdata() - * Read the device tree details for EDMA - */ -static int edma_of_get_pdata(struct resource *edma_res) -{ - /* - * Find EDMA node in device tree - */ - edma_hw.device_node = of_find_node_by_name(NULL, - EDMA_DEVICE_NODE_NAME); - if (!edma_hw.device_node) { - pr_warn("EDMA device tree node (%s) not found\n", - EDMA_DEVICE_NODE_NAME); - return -EINVAL; - } - - /* - * Get EDMA device node - */ - edma_hw.pdev = of_find_device_by_node(edma_hw.device_node); - if (!edma_hw.pdev) { - pr_warn("Platform device for node %px(%s) not found\n", - edma_hw.device_node, - (edma_hw.device_node)->name); - return -EINVAL; - } - - /* - * Get EDMA register resource - */ - if (of_address_to_resource(edma_hw.device_node, 0, edma_res) != 0) { - pr_warn("Unable to get register address for edma device: " - EDMA_DEVICE_NODE_NAME"\n"); - return -EINVAL; - } - - /* - * Get id of first TXDESC ring - */ - if (of_property_read_u32(edma_hw.device_node, "qcom,txdesc-ring-start", - &edma_hw.txdesc_ring_start) != 0) { - pr_warn("Read error 1st TXDESC ring (txdesc_ring_start)\n"); - return -EINVAL; - } - - /* - * Get number of TXDESC rings - */ - if (of_property_read_u32(edma_hw.device_node, "qcom,txdesc-rings", - &edma_hw.txdesc_rings) != 0) { - pr_warn("Unable to read number of txdesc rings.\n"); - return -EINVAL; - } - edma_hw.txdesc_ring_end = edma_hw.txdesc_ring_start + - edma_hw.txdesc_rings; - - /* - * Get id of first TXCMPL ring - */ - if (of_property_read_u32(edma_hw.device_node, "qcom,txcmpl-ring-start", - &edma_hw.txcmpl_ring_start) != 0) { - pr_warn("Read error 1st TXCMPL ring (txcmpl_ring_start)\n"); - return -EINVAL; - } - - /* - * Get number of TXCMPL rings - */ - if (of_property_read_u32(edma_hw.device_node, "qcom,txcmpl-rings", - &edma_hw.txcmpl_rings) != 0) { - pr_warn("Unable to read number of txcmpl rings.\n"); - return -EINVAL; - } - edma_hw.txcmpl_ring_end = edma_hw.txcmpl_ring_start + - edma_hw.txcmpl_rings; - - /* - * Get id of first RXFILL ring - */ - if (of_property_read_u32(edma_hw.device_node, "qcom,rxfill-ring-start", - &edma_hw.rxfill_ring_start) != 0) { - pr_warn("Read error 1st RXFILL ring (rxfill-ring-start)\n"); - return -EINVAL; - } - - /* - * Get number of RXFILL rings - */ - if (of_property_read_u32(edma_hw.device_node, "qcom,rxfill-rings", - &edma_hw.rxfill_rings) != 0) { - pr_warn("Unable to read number of rxfill rings.\n"); - return -EINVAL; - } - edma_hw.rxfill_ring_end = edma_hw.rxfill_ring_start + - edma_hw.rxfill_rings; - - /* - * Get id of first RXDESC ring - */ - if (of_property_read_u32(edma_hw.device_node, "qcom,rxdesc-ring-start", - &edma_hw.rxdesc_ring_start) != 0) { - pr_warn("Read error 1st RXDESC ring (rxdesc-ring-start)\n"); - return -EINVAL; - } - - /* - * Get number of RXDESC rings - */ - if (of_property_read_u32(edma_hw.device_node, "qcom,rxdesc-rings", - &edma_hw.rxdesc_rings) != 0) { - pr_warn("Unable to read number of rxdesc rings.\n"); - return -EINVAL; - } - edma_hw.rxdesc_ring_end = edma_hw.rxdesc_ring_start + - edma_hw.rxdesc_rings; - - return 0; -} - -/* - * edma_init() - * EDMA init - */ -int edma_init(void) -{ - int ret = 0; - struct resource res_edma; - - /* - * Get all the DTS data needed - */ - if (edma_of_get_pdata(&res_edma) < 0) { - pr_warn("Unable to get EDMA DTS data.\n"); - return -EINVAL; - } - - /* - * Request memory region for EDMA registers - */ - edma_hw.reg_resource = request_mem_region(res_edma.start, - resource_size(&res_edma), - EDMA_DEVICE_NODE_NAME); - if (!edma_hw.reg_resource) { - pr_warn("Unable to request EDMA register memory.\n"); - return -EFAULT; - } - - /* - * Remap register resource - */ - edma_hw.reg_base = ioremap_nocache((edma_hw.reg_resource)->start, - resource_size(edma_hw.reg_resource)); - if (!edma_hw.reg_base) { - pr_warn("Unable to remap EDMA register memory.\n"); - ret = -EFAULT; - goto edma_init_remap_fail; - } - - if (edma_hw_init(&edma_hw) != 0) { - ret = -EFAULT; - goto edma_init_hw_init_fail; - } - - platform_set_drvdata(edma_hw.pdev, (void *)&edma_hw); - - edma_hw.napi_added = 0; - - return 0; - -edma_init_hw_init_fail: - iounmap(edma_hw.reg_base); - -edma_init_remap_fail: - release_mem_region((edma_hw.reg_resource)->start, - resource_size(edma_hw.reg_resource)); - return ret; -} - -/* - * edma_disable_port() - * EDMA disable port - */ -static void edma_disable_port(void) -{ - edma_reg_write(EDMA_REG_PORT_CTRL, EDMA_DISABLE); -} - -/* - * edma_cleanup() - * EDMA cleanup - */ -void edma_cleanup(bool is_dp_override) -{ - int i; - struct edma_txcmpl_ring *txcmpl_ring = NULL; - struct edma_rxdesc_ring *rxdesc_ring = NULL; - - /* - * The cleanup can happen from data plane override - * or from module_exit, we want to cleanup only once - */ - if (!edma_hw.edma_initialized) { - /* - * Disable EDMA only at module exit time, since NSS firmware - * depends on this setting. - */ - if (!is_dp_override) { - edma_disable_port(); - } - return; - } - - /* - * Disable Rx rings used by this driver - */ - for (i = edma_hw.rxdesc_ring_start; i < edma_hw.rxdesc_ring_end; i++) - edma_reg_write(EDMA_REG_RXDESC_CTRL(i), EDMA_RING_DISABLE); - - /* - * Disable Tx rings used by this driver - */ - for (i = edma_hw.txdesc_ring_start; i < edma_hw.txdesc_ring_end; i++) { - txcmpl_ring = &edma_hw.txcmpl_ring[i]; - edma_reg_write(EDMA_REG_TXDESC_CTRL(i), - EDMA_RING_DISABLE); - } - - /* - * Disable RxFill Rings used by this driver - */ - for (i = edma_hw.rxfill_ring_start; i < edma_hw.rxfill_ring_end; i++) - edma_reg_write(EDMA_REG_RXFILL_RING_EN(i), EDMA_RING_DISABLE); - - /* - * Clear interrupt mask - */ - for (i = 0; i < edma_hw.rxdesc_rings; i++) { - rxdesc_ring = &edma_hw.rxdesc_ring[i]; - edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), - EDMA_MASK_INT_CLEAR); - } - - for (i = 0; i < edma_hw.txcmpl_rings; i++) { - txcmpl_ring = &edma_hw.txcmpl_ring[i]; - edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id), - EDMA_MASK_INT_CLEAR); - } - - edma_reg_write(EDMA_REG_MISC_INT_MASK, EDMA_MASK_INT_CLEAR); - /* - * Remove interrupt handlers and NAPI - */ - if (edma_hw.napi_added) { - - /* - * Free IRQ for TXCMPL rings - */ - for (i = 0; i < edma_hw.txcmpl_rings; i++) { - synchronize_irq(edma_hw.txcmpl_intr[i]); - free_irq(edma_hw.txcmpl_intr[i], - (void *)(edma_hw.pdev)); - } - - /* - * Free IRQ for RXFILL rings - */ - for (i = 0; i < edma_hw.rxfill_rings; i++) { - synchronize_irq(edma_hw.rxfill_intr[i]); - free_irq(edma_hw.rxfill_intr[i], - (void *)(edma_hw.pdev)); - } - - /* - * Free IRQ for RXDESC rings - */ - for (i = 0; i < edma_hw.rxdesc_rings; i++) { - synchronize_irq(edma_hw.rxdesc_intr[i]); - free_irq(edma_hw.rxdesc_intr[i], - (void *)(edma_hw.pdev)); - } - - /* - * Free Misc IRQ - */ - synchronize_irq(edma_hw.misc_intr); - free_irq(edma_hw.misc_intr, (void *)(edma_hw.pdev)); - - netif_napi_del(&edma_hw.napi); - edma_hw.napi_added = 0; - } - - /* - * Disable EDMA only at module exit time, since NSS firmware - * depends on this setting. - */ - if (!is_dp_override) { - edma_disable_port(); - } - - /* - * cleanup rings and free - */ - edma_cleanup_rings(&edma_hw); - iounmap(edma_hw.reg_base); - release_mem_region((edma_hw.reg_resource)->start, - resource_size(edma_hw.reg_resource)); - - /* - * Mark initialize false, so that we do not - * try to cleanup again - */ - edma_hw.edma_initialized = false; -} diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.h b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.h deleted file mode 100644 index ac6593ac2..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_data_plane.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016, 2018-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** -*/ - -#include "nss_dp_dev.h" - -#ifndef __NSS_DP_EDMA_DATAPLANE__ -#define __NSS_DP_EDMA_DATAPLANE__ - -#define EDMA_BUF_SIZE 2000 -#define EDMA_DEVICE_NODE_NAME "edma" -#define EDMA_RX_BUFF_SIZE (EDMA_BUF_SIZE + EDMA_RX_PREHDR_SIZE) -#define EDMA_RX_PREHDR_SIZE (sizeof(struct edma_rx_preheader)) -#define EDMA_TX_PREHDR_SIZE (sizeof(struct edma_tx_preheader)) -#define EDMA_RING_SIZE 128 -#define EDMA_NAPI_WORK 100 -#define EDMA_START_GMACS NSS_DP_START_IFNUM -#define EDMA_MAX_GMACS NSS_DP_HAL_MAX_PORTS -#define EDMA_TX_PKT_MIN_SIZE 33 /* IPQ807x EDMA needs a minimum packet size of 33 bytes */ -#if defined(NSS_DP_IPQ60XX) -#define EDMA_MAX_TXCMPL_RINGS 24 /* Max TxCmpl rings */ -#else -#define EDMA_MAX_TXCMPL_RINGS 8 /* Max TxCmpl rings */ -#endif -#define EDMA_MAX_RXDESC_RINGS 16 /* Max RxDesc rings */ -#define EDMA_MAX_RXFILL_RINGS 8 /* Max RxFill rings */ -#define EDMA_MAX_TXDESC_RINGS 24 /* Max TxDesc rings */ -#define EDMA_GET_DESC(R, i, type) (&(((type *)((R)->desc))[i])) -#define EDMA_RXFILL_DESC(R, i) EDMA_GET_DESC(R, i, struct edma_rxfill_desc) -#define EDMA_RXDESC_DESC(R, i) EDMA_GET_DESC(R, i, struct edma_rxdesc_desc) -#define EDMA_TXDESC_DESC(R, i) EDMA_GET_DESC(R, i, struct edma_txdesc_desc) -#define EDMA_RXPH_SRC_INFO_TYPE_GET(rxph) (((rxph)->src_info >> 8) & 0xf0) -#define EDMA_RXPH_SERVICE_CODE_GET(rxph) (((rxph)->rx_pre4) & 0xff) - -/* - * Tx descriptor - */ -struct edma_txdesc_desc { - uint32_t buffer_addr; - /* buffer address */ - uint32_t word1; - /* more bit, TSO, preheader, pool, offset and length */ -}; - -/* - * TxCmpl descriptor - */ -struct edma_txcmpl_desc { - uint32_t buffer_addr; /* buffer address/opaque */ - uint32_t status; /* status */ -}; - -/* - * Rx descriptor - */ -struct edma_rxdesc_desc { - uint32_t buffer_addr; /* buffer address */ - uint32_t status; /* status */ -}; - -/* - * RxFill descriptor - */ -struct edma_rxfill_desc { - uint32_t buffer_addr; /* Buffer address */ - uint32_t word1; /* opaque_ind and buffer size */ -}; - -/* - * Tx descriptor ring - */ -struct edma_txdesc_ring { - uint32_t id; /* TXDESC ring number */ - void *desc; /* descriptor ring virtual address */ - dma_addr_t dma; /* descriptor ring physical address */ - spinlock_t tx_lock; /* Tx ring lock */ - uint16_t count; /* number of descriptors */ -}; - -/* - * TxCmpl ring - */ -struct edma_txcmpl_ring { - uint32_t id; /* TXCMPL ring number */ - void *desc; /* descriptor ring virtual address */ - dma_addr_t dma; /* descriptor ring physical address */ - uint16_t count; /* number of descriptors in the ring */ -}; - -/* - * RxFill ring - */ -struct edma_rxfill_ring { - uint32_t id; /* RXFILL ring number */ - void *desc; /* descriptor ring virtual address */ - dma_addr_t dma; /* descriptor ring physical address */ - spinlock_t lock; /* Rx ring lock */ - uint16_t count; /* number of descriptors in the ring */ -}; - -/* - * RxDesc ring - */ -struct edma_rxdesc_ring { - uint32_t id; /* RXDESC ring number */ - struct edma_rxfill_ring *rxfill; /* RXFILL ring used */ - void *desc; /* descriptor ring virtual address */ - dma_addr_t dma; /* descriptor ring physical address */ - uint16_t count; /* number of descriptors in the ring */ -}; - -/* - * EDMA Tx Preheader - */ -struct edma_tx_preheader { - uint32_t opaque; /* Opaque, contains skb pointer */ - uint16_t src_info; /* Src information */ - uint16_t dst_info; /* Dest information */ - uint32_t tx_pre2; /* SVLAN & CVLAN flag, drop prec, hash value */ - uint32_t tx_pre3; /* STAG, CTAG */ - uint32_t tx_pre4; /* CPU code, L3 & L4 offset, service code */ - uint32_t tx_pre5; /* IP addr index, ACL index */ - uint32_t tx_pre6; /* IP payload checksum, copy2cpu, timestamp, dscp */ - uint32_t tx_pre7; /* Timestamp, QoS TAG */ -}; - -/* - * EDMA Rx Preheader - */ -struct edma_rx_preheader { - uint32_t opaque; - /* Opaque, contains skb pointer*/ - uint16_t src_info; - /* Src information */ - uint16_t dst_info; - /* Dest information */ - uint32_t rx_pre2; - /* SVLAN & CVLAN flag, drop prec, hash value */ - uint32_t rx_pre3; - /* STAG, CTAG */ - uint32_t rx_pre4; - /* CPU code, L3 & L4 offset, service code */ - uint32_t rx_pre5; - /* IP addr index, ACL index */ - uint32_t rx_pre6; - /* IP payload checksum, copy2cpu, timestamp, dscp */ - uint32_t rx_pre7; - /* Timestamp, QoS TAG */ -}; - -enum edma_tx { - EDMA_TX_OK = 0, /* Tx success */ - EDMA_TX_DESC = 1, /* Not enough descriptors */ - EDMA_TX_FAIL = 2, /* Tx failure */ -}; - -/* - * EDMA private data structure - */ -struct edma_hw { - struct napi_struct napi; - /* napi structure */ - struct net_device *netdev_arr[EDMA_MAX_GMACS]; - /* netdev for each gmac port */ - struct device_node *device_node; - /* Device tree node */ - struct platform_device *pdev; - /* Platform device */ - void __iomem *reg_base; - /* Base register address */ - struct resource *reg_resource; - /* Memory resource */ - uint16_t rx_payload_offset; - /* start of the payload offset */ - uint32_t flags; - /* internal flags */ - int active; - /* status */ - int napi_added; - /* flag to indicate napi add status */ - - /* - * Debugfs entries - */ - struct dentry *edma_dentry; - struct dentry *txdesc_dentry; - struct dentry *txcmpl_dentry; - struct dentry *rxdesc_dentry; - - /* - * Store for tx and rx skbs - */ - struct sk_buff *rx_skb_store[EDMA_RING_SIZE]; - struct sk_buff *tx_skb_store[EDMA_RING_SIZE]; - - struct edma_rxfill_ring *rxfill_ring; - /* Rx Fill Ring, SW is producer */ - struct edma_rxdesc_ring *rxdesc_ring; - /* Rx Descriptor Ring, SW is consumer */ - struct edma_txdesc_ring *txdesc_ring; - /* Tx Descriptor Ring, SW is producer */ - struct edma_txcmpl_ring *txcmpl_ring; - /* Tx Completion Ring, SW is consumer */ - - uint32_t txdesc_rings; - /* Number of TxDesc rings */ - uint32_t txdesc_ring_start; - /* Id of first TXDESC ring */ - uint32_t txdesc_ring_end; - /* Id of the last TXDESC ring */ - uint32_t txcmpl_rings; - /* Number of TxCmpl rings */ - uint32_t txcmpl_ring_start; - /* Id of first TXCMPL ring */ - uint32_t txcmpl_ring_end; - /* Id of last TXCMPL ring */ - uint32_t rxfill_rings; - /* Number of RxFill rings */ - uint32_t rxfill_ring_start; - /* Id of first RxFill ring */ - uint32_t rxfill_ring_end; - /* Id of last RxFill ring */ - uint32_t rxdesc_rings; - /* Number of RxDesc rings */ - uint32_t rxdesc_ring_start; - /* Id of first RxDesc ring */ - uint32_t rxdesc_ring_end; - /* Id of last RxDesc ring */ - uint32_t txcmpl_intr[EDMA_MAX_TXCMPL_RINGS]; - /* TxCmpl ring IRQ numbers */ - uint32_t rxfill_intr[EDMA_MAX_RXFILL_RINGS]; - /* Rx fill ring IRQ numbers */ - uint32_t rxdesc_intr[EDMA_MAX_RXDESC_RINGS]; - /* Rx desc ring IRQ numbers */ - uint32_t misc_intr; - /* Misc IRQ number */ - - uint32_t tx_intr_mask; - /* Tx interrupt mask */ - uint32_t rxfill_intr_mask; - /* Rx fill ring interrupt mask */ - uint32_t rxdesc_intr_mask; - /* Rx Desc ring interrupt mask */ - uint32_t txcmpl_intr_mask; - /* Tx Cmpl ring interrupt mask */ - uint32_t misc_intr_mask; - /* misc interrupt interrupt mask */ - uint32_t dp_override_cnt; - /* number of interfaces overriden */ - bool edma_initialized; - /* flag to check initialization status */ -}; - -extern struct edma_hw edma_hw; - -uint32_t edma_reg_read(uint32_t reg_off); -void edma_reg_write(uint32_t reg_off, uint32_t val); - -int edma_alloc_rx_buffer(struct edma_hw *ehw, - struct edma_rxfill_ring *rxfill_ring); -enum edma_tx edma_ring_xmit(struct edma_hw *ehw, - struct net_device *netdev, - struct sk_buff *skb, - struct edma_txdesc_ring *txdesc_ring); -uint32_t edma_clean_tx(struct edma_hw *ehw, - struct edma_txcmpl_ring *txcmpl_ring); -irqreturn_t edma_handle_irq(int irq, void *ctx); -irqreturn_t edma_handle_misc_irq(int irq, void *ctx); -int edma_napi(struct napi_struct *napi, int budget); -void edma_cleanup_rings(struct edma_hw *ehw); -void edma_cleanup(bool is_dp_override); -int edma_hw_init(struct edma_hw *ehw); -#endif /* __NSS_DP_EDMA_DATAPLANE__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_regs.h b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_regs.h deleted file mode 100644 index e724cc7cf..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_regs.h +++ /dev/null @@ -1,454 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016,2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** -*/ - -#ifndef __EDMA_REGS__ -#define __EDMA_REGS__ - -/* - * IPQ807x EDMA register offsets - */ -#define EDMA_REG_MAS_CTRL 0x0 -#define EDMA_REG_PORT_CTRL 0x4 -#define EDMA_REG_VLAN_CTRL 0x8 -#define EDMA_REG_RXDESC2FILL_MAP_0 0x18 -#define EDMA_REG_RXDESC2FILL_MAP_1 0x1c -#define EDMA_REG_TXQ_CTRL 0x20 -#define EDMA_REG_TXQ_CTRL_2 0x24 -#define EDMA_REG_TXQ_FC_0 0x28 -#define EDMA_REG_TXQ_FC_1 0x30 -#define EDMA_REG_TXQ_FC_2 0x34 -#define EDMA_REG_TXQ_FC_3 0x38 -#define EDMA_REG_RXQ_CTRL 0x3c -#define EDMA_REG_RX_TX_FULL_QID 0x40 -#define EDMA_REG_RXQ_FC_THRE 0x44 -#define EDMA_REG_DMAR_CTRL 0x48 -#define EDMA_REG_AXIR_CTRL 0x4c -#define EDMA_REG_AXIW_CTRL 0x50 -#define EDMA_REG_MIN_MSS 0x54 -#define EDMA_REG_LOOPBACK_CTRL 0x58 -#define EDMA_REG_MISC_INT_STAT 0x5c -#define EDMA_REG_MISC_INT_MASK 0x60 -#define EDMA_REG_DBG_CTRL 0x64 -#define EDMA_REG_DBG_DATA 0x68 -#define EDMA_REG_TXDESC_BA(n) (0x1000 + (0x1000 * n)) -#define EDMA_REG_TXDESC_PROD_IDX(n) (0x1004 + (0x1000 * n)) -#define EDMA_REG_TXDESC_CONS_IDX(n) (0x1008 + (0x1000 * n)) -#define EDMA_REG_TXDESC_RING_SIZE(n) (0x100c + (0x1000 * n)) -#define EDMA_REG_TXDESC_CTRL(n) (0x1010 + (0x1000 * n)) -#if defined(NSS_DP_IPQ807X) -#define EDMA_REG_TXDESC2CMPL_MAP_0 0xc -#define EDMA_REG_TXDESC2CMPL_MAP_1 0x10 -#define EDMA_REG_TXDESC2CMPL_MAP_2 0x14 -#define EDMA_REG_TXCMPL_BASE 0x19000 -#define EDMA_REG_TX_BASE 0x21000 -#else -#define EDMA_REG_TXCMPL_BASE 0x79000 -#define EDMA_REG_TX_BASE 0x91000 -#endif -#define EDMA_REG_TXCMPL_BA_OFFSET 0x00000 -#define EDMA_REG_TXCMPL_PROD_IDX_OFFSET 0x00004 -#define EDMA_REG_TXCMPL_CONS_IDX_OFFSET 0x00008 -#define EDMA_REG_TXCMPL_RING_SIZE_OFFSET 0x0000c -#define EDMA_REG_TXCMPL_UGT_THRE_OFFSET 0x00010 -#define EDMA_REG_TXCMPL_CTRL_OFFSET 0x00014 -#define EDMA_REG_TXCMPL_BPC_OFFSET 0x00018 -#define EDMA_REG_TX_INT_STAT_OFFSET 0x00000 -#define EDMA_REG_TX_INT_MASK_OFFSET 0x00004 -#define EDMA_REG_TX_MOD_TIMER_OFFSET 0x00008 -#define EDMA_REG_TX_INT_CTRL_OFFSET 0x0000c -#define EDMA_REG_TXCMPL_BA(n) (EDMA_REG_TXCMPL_BASE + EDMA_REG_TXCMPL_BA_OFFSET + (0x1000 * n)) -#define EDMA_REG_TXCMPL_PROD_IDX(n) (EDMA_REG_TXCMPL_BASE + EDMA_REG_TXCMPL_PROD_IDX_OFFSET + (0x1000 * n)) -#define EDMA_REG_TXCMPL_CONS_IDX(n) (EDMA_REG_TXCMPL_BASE + EDMA_REG_TXCMPL_CONS_IDX_OFFSET + (0x1000 * n)) -#define EDMA_REG_TXCMPL_RING_SIZE(n) (EDMA_REG_TXCMPL_BASE + EDMA_REG_TXCMPL_RING_SIZE_OFFSET + (0x1000 * n)) -#define EDMA_REG_TXCMPL_UGT_THRE(n) (EDMA_REG_TXCMPL_BASE + EDMA_REG_TXCMPL_UGT_THRE_OFFSET + (0x1000 * n)) -#define EDMA_REG_TXCMPL_CTRL(n) (EDMA_REG_TXCMPL_BASE + EDMA_REG_TXCMPL_CTRL_OFFSET + (0x1000 * n)) -#define EDMA_REG_TXCMPL_BPC(n) (EDMA_REG_TXCMPL_BASE + EDMA_REG_TXCMPL_BPC_OFFSET + (0x1000 * n)) -#define EDMA_REG_TX_INT_STAT(n) (EDMA_REG_TX_BASE + EDMA_REG_TX_INT_STAT_OFFSET + (0x1000 * n)) -#define EDMA_REG_TX_INT_MASK(n) (EDMA_REG_TX_BASE + EDMA_REG_TX_INT_MASK_OFFSET + (0x1000 * n)) -#define EDMA_REG_TX_MOD_TIMER(n) (EDMA_REG_TX_BASE + EDMA_REG_TX_MOD_TIMER_OFFSET + (0x1000 * n)) -#define EDMA_REG_TX_INT_CTRL(n) (EDMA_REG_TX_BASE + EDMA_REG_TX_INT_CTRL_OFFSET + (0x1000 * n)) -#define EDMA_REG_RXFILL_BA(n) (0x29000 + (0x1000 * n)) -#define EDMA_REG_RXFILL_PROD_IDX(n) (0x29004 + (0x1000 * n)) -#define EDMA_REG_RXFILL_CONS_IDX(n) (0x29008 + (0x1000 * n)) -#define EDMA_REG_RXFILL_RING_SIZE(n) (0x2900c + (0x1000 * n)) -#define EDMA_REG_RXFILL_BUFFER1_SIZE(n) (0x29010 + (0x1000 * n)) -#define EDMA_REG_RXFILL_FC_THRE(n) (0x29014 + (0x1000 * n)) -#define EDMA_REG_RXFILL_UGT_THRE(n) (0x29018 + (0x1000 * n)) -#define EDMA_REG_RXFILL_RING_EN(n) (0x2901c + (0x1000 * n)) -#define EDMA_REG_RXFILL_DISABLE(n) (0x29020 + (0x1000 * n)) -#define EDMA_REG_RXFILL_DISABLE_DONE(n) (0x29024 + (0x1000 * n)) -#define EDMA_REG_RXFILL_INT_STAT(n) (0x31000 + (0x1000 * n)) -#define EDMA_REG_RXFILL_INT_MASK(n) (0x31004 + (0x1000 * n)) -#define EDMA_REG_RXDESC_BA(n) (0x39000 + (0x1000 * n)) -#define EDMA_REG_RXDESC_PROD_IDX(n) (0x39004 + (0x1000 * n)) -#define EDMA_REG_RXDESC_CONS_IDX(n) (0x39008 + (0x1000 * n)) -#define EDMA_REG_RXDESC_RING_SIZE(n) (0x3900c + (0x1000 * n)) -#define EDMA_REG_RXDESC_FC_THRE(n) (0x39010 + (0x1000 * n)) -#define EDMA_REG_RXDESC_UGT_THRE(n) (0x39014 + (0x1000 * n)) -#define EDMA_REG_RXDESC_CTRL(n) (0x39018 + (0x1000 * n)) -#define EDMA_REG_RXDESC_BPC(n) (0x3901c + (0x1000 * n)) -#define EDMA_REG_RXDESC_INT_STAT(n) (0x49000 + (0x1000 * n)) -#define EDMA_REG_RXDESC_INT_MASK(n) (0x49004 + (0x1000 * n)) -#define EDMA_REG_RX_MOD_TIMER(n) (0x49008 + (0x1000 * n)) -#define EDMA_REG_RX_INT_CTRL(n) (0x4900c + (0x1000 * n)) -#define EDMA_QID2RID_TABLE_MEM(q) (0x5a000 + (0x4 * q)) -#define EDMA_REG_RXRING_PC(n) (0x5A200 + (0x10 * n)) -#define EDMA_REG_RXRING_BC_0(n) (0x5A204 + (0x10 * n)) -#define EDMA_REG_RXRING_BC_1(n) (0x5A208 + (0x10 * n)) -#define EDMA_REG_TXRING_PC(n) (0x74000 + (0x10 * n)) -#define EDMA_REG_TXRING_BC_0(n) (0x74004 + (0x10 * n)) -#define EDMA_REG_TXRING_BC_1(n) (0x74008 + (0x10 * n)) - -/* - * EDMA_REG_PORT_CTRL register - */ -#define EDMA_PORT_PAD_EN 0x1 -#define EDMA_PORT_EDMA_EN 0x2 - -/* - * EDMA_REG_TXQ_CTRL register - */ -#define EDMA_TXDESC_PF_THRE_MASK 0xf -#define EDMA_TXDESC_PF_THRE_SHIFT 0 -#define EDMA_TXCMPL_WB_THRE_MASK 0xf -#define EDMA_TXCMPL_WB_THRE_SHIFT 4 -#define EDMA_TXDESC_PKT_SRAM_THRE_MASK 0xff -#define EDMA_TXDESC_PKT_SRAM_THRE_SHIFT 8 -#define EDMA_TXCMPL_WB_TIMER_MASK 0xffff -#define EDMA_TXCMPL_WB_TIMER_SHIFT 16 - -/* - * EDMA_REG_RXQ_CTRL register - */ -#define EDMA_RXFILL_PF_THRE_MASK 0xf -#define EDMA_RXFILL_PF_THRE_SHIFT 0 -#define EDMA_RXDESC_WB_THRE_MASK 0xf -#define EDMA_RXDESC_WB_THRE_SHIFT 4 -#define EDMA_RXDESC_WB_TIMER_MASK 0xffff -#define EDMA_RXDESC_WB_TIMER_SHIFT 16 - -/* - * EDMA_REG_RX_TX_FULL_QID register - */ -#define EDMA_RX_DESC_FULL_QID_MASK 0xff -#define EDMA_RX_DESC_FULL_QID_SHIFT 0 -#define EDMA_TX_CMPL_BUF_FULL_QID_MASK 0xff -#define EDMA_TX_CMPL_BUF_FULL_QID_SHIFT 8 -#define EDMA_TX_SRAM_FULL_QID_MASK 0x1f -#define EDMA_TX_SRAM_FULL_QID_SHIFT 16 - -/* - * EDMA_REG_RXQ_FC_THRE reister - */ -#define EDMA_RXFILL_FIFO_XOFF_THRE_MASK 0x1f -#define EDMA_RXFILL_FIFO_XOFF_THRE_SHIFT 0 -#define EDMA_DESC_FIFO_XOFF_THRE_MASK 0x3f -#define EDMA_DESC_FIFO_XOFF_THRE_SHIFT 16 - -/* - * EDMA_REG_DMAR_CTRL register - */ -#define EDMA_DMAR_REQ_PRI_MASK 0x7 -#define EDMA_DMAR_REQ_PRI_SHIFT 0 -#define EDMA_DMAR_BURST_LEN_MASK 0x1 -#define EDMA_DMAR_BURST_LEN_SHIFT 3 -#define EDMA_DMAR_TXDATA_OUTSTANDING_NUM_MASK 0x1f -#define EDMA_DMAR_TXDATA_OUTSTANDING_NUM_SHIFT 4 -#define EDMA_DMAR_TXDESC_OUTSTANDING_NUM_MASK 0x7 -#define EDMA_DMAR_TXDESC_OUTSTANDING_NUM_SHIFT 9 -#define EDMA_DMAR_RXFILL_OUTSTANDING_NUM_MASK 0x7 -#define EDMA_DMAR_RXFILL_OUTSTANDING_NUM_SHIFT 12 - -#define EDMA_DMAR_REQ_PRI_SET(x) (((x) & EDMA_DMAR_REQ_PRI_MASK) << EDMA_DMAR_REQ_PRI_SHIFT) -#define EDMA_DMAR_TXDATA_OUTSTANDING_NUM_SET(x) (((x) & EDMA_DMAR_TXDATA_OUTSTANDING_NUM_MASK) << EDMA_DMAR_TXDATA_OUTSTANDING_NUM_SHIFT) -#define EDMA_DMAR_TXDESC_OUTSTANDING_NUM_SET(x) (((x) & EDMA_DMAR_TXDESC_OUTSTANDING_NUM_MASK) << EDMA_DMAR_TXDESC_OUTSTANDING_NUM_SHIFT) -#define EDMA_DMAR_RXFILL_OUTSTANDING_NUM_SET(x) (((x) & EDMA_DMAR_RXFILL_OUTSTANDING_NUM_MASK) << EDMA_DMAR_RXFILL_OUTSTANDING_NUM_SHIFT) -#define EDMA_DMAR_BURST_LEN_SET(x) (((x) & EDMA_DMAR_BURST_LEN_MASK) << EDMA_DMAR_BURST_LEN_SHIFT) - -/* - * Enable 128 byte EDMA burts for IPQ60xx - */ -#if defined(NSS_DP_IPQ60XX) -#define EDMA_BURST_LEN_ENABLE 1 -#else -#define EDMA_BURST_LEN_ENABLE 0 -#endif - -/* - * EDMA_REG_AXIW_CTRL_REG - */ -#define EDMA_AXIW_MAX_WR_SIZE_EN 0x400 - -/* - * EDMA DISABLE - */ -#define EDMA_DISABLE 0 - -/* - * EDMA_REG_TXDESC_PROD_IDX register - */ -#define EDMA_TXDESC_PROD_IDX_MASK 0xffff - -/* - * EDMA_REG_TXDESC_CONS_IDX register - */ -#define EDMA_TXDESC_CONS_IDX_MASK 0xffff - -/* - * EDMA_REG_TXDESC_RING_SIZE register - */ -#define EDMA_TXDESC_RING_SIZE_MASK 0xffff - -/* - * EDMA_REG_TXDESC_CTRL register - */ -#define EDMA_TXDESC_ARB_GRP_ID_MASK 0x3 -#define EDMA_TXDESC_ARB_GRP_ID_SHIFT 4 -#define EDMA_TXDESC_FC_GRP_ID_MASK 0x7 -#define EDMA_TXDESC_FC_GRP_ID_SHIFT 1 -#define EDMA_TXDESC_TX_EN 0x1 - -/* - * EDMA_REG_TXCMPL_PROD_IDX register - */ -#define EDMA_TXCMPL_PROD_IDX_MASK 0xffff - -/* - * EDMA_REG_TXCMPL_CONS_IDX register - */ -#define EDMA_TXCMPL_CONS_IDX_MASK 0xffff - -/* - * EDMA_REG_TXCMPL_RING_SIZE register - */ -#define EDMA_TXCMPL_RING_SIZE_MASK 0xffff - -/* - * EDMA_REG_TXCMPL_UGT_THRE register - */ -#define EDMA_TXCMPL_LOW_THRE_MASK 0xffff -#define EDMA_TXCMPL_LOW_THRE_SHIFT 0 -#define EDMA_TXCMPL_FC_THRE_MASK 0x3f -#define EDMA_TXCMPL_FC_THRE_SHIFT 16 - -/* - * EDMA_REG_TXCMPL_CTRL register - */ -#define EDMA_TXCMPL_RET_MODE_BUFF_ADDR 0x0 -#define EDMA_TXCMPL_RET_MODE_OPAQUE 0x1 - -/* - * EDMA_REG_TX_MOD_TIMER register - */ -#define EDMA_TX_MOD_TIMER_INIT_MASK 0xffff -#define EDMA_TX_MOD_TIMER_INIT_SHIFT 0 - -/* - * EDMA_REG_TX_INT_CTRL register - */ -#define EDMA_TX_INT_MASK 0x3 - -/* - * EDMA_REG_RXFILL_PROD_IDX register - */ -#define EDMA_RXFILL_PROD_IDX_MASK 0xffff - -/* - * EDMA_REG_RXFILL_CONS_IDX register - */ -#define EDMA_RXFILL_CONS_IDX_MASK 0xffff - -/* - * EDMA_REG_RXFILL_RING_SIZE register - */ -#define EDMA_RXFILL_RING_SIZE_MASK 0xffff -#define EDMA_RXFILL_BUF_SIZE_MASK 0x3fff -#define EDMA_RXFILL_BUF_SIZE_SHIFT 16 - -/* - * EDMA_REG_RXFILL_FC_THRE register - */ -#define EDMA_RXFILL_FC_XON_THRE_MASK 0x7ff -#define EDMA_RXFILL_FC_XON_THRE_SHIFT 12 -#define EDMA_RXFILL_FC_XOFF_THRE_MASK 0x7ff -#define EDMA_RXFILL_FC_XOFF_THRE_SHIFT 0 - -/* - * EDMA_REG_RXFILL_UGT_THRE register - */ -#define EDMA_RXFILL_LOW_THRE_MASK 0xffff -#define EDMA_RXFILL_LOW_THRE_SHIFT 0 - -/* - * EDMA_REG_RXFILL_RING_EN register - */ -#define EDMA_RXFILL_RING_EN 0x1 - -/* - * EDMA_REG_RXFILL_INT_MASK register - */ -#define EDMA_RXFILL_INT_MASK 0x1 - -/* - * EDMA_REG_RXDESC_PROD_IDX register - */ -#define EDMA_RXDESC_PROD_IDX_MASK 0xffff - -/* - * EDMA_REG_RXDESC_CONS_IDX register - */ -#define EDMA_RXDESC_CONS_IDX_MASK 0xffff - -/* - * EDMA_REG_RXDESC_RING_SIZE register - */ -#define EDMA_RXDESC_RING_SIZE_MASK 0xffff -#define EDMA_RXDESC_PL_OFFSET_MASK 0x1ff -#define EDMA_RXDESC_PL_OFFSET_SHIFT 16 - -/* - * EDMA_REG_RXDESC_FC_THRE register - */ -#define EDMA_RXDESC_FC_XON_THRE_MASK 0x7ff -#define EDMA_RXDESC_FC_XON_THRE_SHIFT 12 -#define EDMA_RXDESC_FC_XOFF_THRE_MASK 0x7ff -#define EDMA_RXDESC_FC_XOFF_THRE_SHIFT 0 - -/* - * EDMA_REG_RXDESC_UGT_THRE register - */ -#define EDMA_RXDESC_LOW_THRE_MASK 0xffff -#define EDMA_RXDESC_LOW_THRE_SHIFT 0 - -/* - * EDMA_REG_RXDESC_CTRL register - */ -#define EDMA_RXDESC_STAG_REMOVE_EN 0x8 -#define EDMA_RXDESC_CTAG_REMOVE_EN 0x4 -#define EDMA_RXDESC_QDISC_EN 0x2 -#define EDMA_RXDESC_RX_EN 0x1 - -/* - * EDMA_REG_TX_INT_MASK register - */ -#define EDMA_TX_INT_MASK_PKT_INT 0x1 -#define EDMA_TX_INT_MASK_UGT_INT 0x2 - -/* - * EDMA_REG_RXDESC_INT_STAT register - */ -#define EDMA_RXDESC_INT_STAT_PKT_INT 0x1 -#define EDMA_RXDESC_INT_STAT_UGT_INT 0x2 - -/* - * EDMA_REG_RXDESC_INT_MASK register - */ -#define EDMA_RXDESC_INT_MASK_PKT_INT 0x1 -#define EDMA_RXDESC_INT_MASK_TIMER_INT_DIS 0x2 - -#define EDMA_MASK_INT_DISABLE 0x0 -#define EDMA_MASK_INT_CLEAR 0x0 - -/* - * EDMA_REG_RX_MOD_TIMER register - */ -#define EDMA_RX_MOD_TIMER_INIT_MASK 0xffff -#define EDMA_RX_MOD_TIMER_INIT_SHIFT 0 - -/* - * EDMA QID2RID register sizes - */ -#define EDMA_QID2RID_DEPTH 0x40 -#define EDMA_QID2RID_QUEUES_PER_ENTRY 8 - -/* - * TXDESC shift values - */ -#define EDMA_TXDESC_MORE_SHIFT 31 -#define EDMA_TXDESC_TSO_EN_SHIFT 30 -#define EDMA_TXDESC_PREHEADER_SHIFT 29 -#define EDMA_TXDESC_POOL_ID_SHIFT 24 -#define EDMA_TXDESC_POOL_ID_MASK 0x1f -#define EDMA_TXDESC_DATA_OFFSET_SHIFT 16 -#define EDMA_TXDESC_DATA_OFFSET_MASK 0xff -#define EDMA_TXDESC_DATA_LENGTH_SHIFT 0 -#define EDMA_TXDESC_DATA_LENGTH_MASK 0xffff - -#define EDMA_PREHDR_DSTINFO_PORTID_IND 0x20 -#define EDMA_PREHDR_PORTNUM_BITS 0x0fff -#define EDMA_RING_DMA_MASK 0xffffffff -/* - * RXDESC shift values - */ -#define EDMA_RXDESC_RX_RXFILL_CNT_MASK 0x000f -#define EDMA_RXDESC_RX_RXFILL_CNT_SHIFT 16 - -#define EDMA_RXDESC_PKT_SIZE_MASK 0x3fff -#define EDMA_RXDESC_PKT_SIZE_SHIFT 0 - -#define EDMA_RXDESC_RXD_VALID_MASK 0x1 -#define EDMA_RXDESC_RXD_VALID_SHIFT 31 - -#define EDMA_RXDESC_PACKET_LEN_MASK 0x3fff -#define EDMA_RXDESC_RING_INT_STATUS_MASK 0x3 - -#define EDMA_RING_DISABLE 0 -#define EDMA_TXCMPL_RING_INT_STATUS_MASK 0x3 -#define EDMA_TXCMPL_RETMODE_OPAQUE 0x0 -#define EDMA_RXFILL_RING_INT_STATUS_MASK 0x1 - -/* - * TODO tune the timer and threshold values - */ -#define EDMA_RXFILL_FIFO_XOFF_THRE 0x3 -#define EDMA_RXFILL_PF_THRE 0x3 -#define EDMA_RXDESC_WB_THRE 0x0 -#define EDMA_RXDESC_WB_TIMER 0x2 - -#define EDMA_RXDESC_XON_THRE 50 -#define EDMA_RXDESC_XOFF_THRE 30 -#define EDMA_RXDESC_LOW_THRE 0 -#define EDMA_RX_MOD_TIMER_INIT 1000 - -#define EDMA_TXDESC_PF_THRE 0x3 -#define EDMA_TXCMPL_WB_THRE 0X0 -#define EDMA_TXDESC_PKT_SRAM_THRE 0x20 -#define EDMA_TXCMPL_WB_TIMER 0x2 - -#define EDMA_TX_MOD_TIMER 150 - -/* - * EDMA misc error mask - */ -#define EDMA_MISC_AXI_RD_ERR_MASK_EN 0x1 -#define EDMA_MISC_AXI_WR_ERR_MASK_EN 0x2 -#define EDMA_MISC_RX_DESC_FIFO_FULL_MASK_EN 0x4 -#define EDMA_MISC_RX_ERR_BUF_SIZE_MASK_EN 0x8 -#define EDMA_MISC_TX_SRAM_FULL_MASK_EN 0x10 -#define EDMA_MISC_TX_CMPL_BUF_FULL_MASK_EN 0x20 - -#if defined(NSS_DP_IPQ807X) -#define EDMA_MISC_PKT_LEN_LA_64K_MASK_EN 0x40 -#define EDMA_MISC_PKT_LEN_LE_40_MASK_EN 0x80 -#define EDMA_MISC_DATA_LEN_ERR_MASK_EN 0x100 -#else -#define EDMA_MISC_DATA_LEN_ERR_MASK_EN 0x40 -#define EDMA_MISC_TX_TIMEOUT_MASK_EN 0x80 -#endif - -#endif /* __EDMA_REGS__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_tx_rx.c b/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_tx_rx.c deleted file mode 100644 index 0f42a7e50..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/edma/edma_tx_rx.c +++ /dev/null @@ -1,795 +0,0 @@ -/* - * Copyright (c) 2016-2018, 2020-21, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include -#include - -#include "nss_dp_dev.h" -#include "edma_regs.h" -#include "edma_data_plane.h" - -/* - * edma_alloc_rx_buffer() - * Alloc Rx buffers for one RxFill ring - */ -int edma_alloc_rx_buffer(struct edma_hw *ehw, - struct edma_rxfill_ring *rxfill_ring) -{ - struct platform_device *pdev = ehw->pdev; - struct sk_buff *skb; - uint16_t num_alloc = 0; - uint16_t cons, next, counter; - struct edma_rxfill_desc *rxfill_desc; - uint32_t reg_data = 0; - uint32_t store_index = 0; - struct edma_rx_preheader *rxph = NULL; - - /* - * Read RXFILL ring producer index - */ - reg_data = edma_reg_read(EDMA_REG_RXFILL_PROD_IDX(rxfill_ring->id)); - next = reg_data & EDMA_RXFILL_PROD_IDX_MASK & (rxfill_ring->count - 1); - - /* - * Read RXFILL ring consumer index - */ - reg_data = edma_reg_read(EDMA_REG_RXFILL_CONS_IDX(rxfill_ring->id)); - cons = reg_data & EDMA_RXFILL_CONS_IDX_MASK; - - while (1) { - counter = next; - if (++counter == rxfill_ring->count) - counter = 0; - - if (counter == cons) - break; - - /* - * Allocate buffer - */ - skb = dev_alloc_skb(EDMA_RX_BUFF_SIZE); - if (unlikely(!skb)) - break; - - /* - * Get RXFILL descriptor - */ - rxfill_desc = EDMA_RXFILL_DESC(rxfill_ring, next); - - /* - * Make room for Rx preheader - */ - rxph = (struct edma_rx_preheader *) - skb_push(skb, EDMA_RX_PREHDR_SIZE); - - /* - * Store the skb in the rx store - */ - store_index = next; - if (ehw->rx_skb_store[store_index] != NULL) { - dev_kfree_skb_any(skb); - break; - } - ehw->rx_skb_store[store_index] = skb; - memcpy((uint8_t *)&rxph->opaque, (uint8_t *)&store_index, 4); - /* - * Save buffer size in RXFILL descriptor - */ - rxfill_desc->word1 = cpu_to_le32(EDMA_RX_BUFF_SIZE - & EDMA_RXFILL_BUF_SIZE_MASK); - - /* - * Map Rx buffer for DMA - */ - rxfill_desc->buffer_addr = cpu_to_le32(dma_map_single( - &pdev->dev, - skb->data, - EDMA_RX_BUFF_SIZE, - DMA_FROM_DEVICE)); - - if (!rxfill_desc->buffer_addr) { - dev_kfree_skb_any(skb); - ehw->rx_skb_store[store_index] = NULL; - break; - } - - num_alloc++; - next = counter; - } - - if (num_alloc) { - /* - * Update RXFILL ring producer index - */ - reg_data = next & EDMA_RXFILL_PROD_IDX_MASK; - - /* - * make sure the producer index updated before - * updating the hardware - */ - wmb(); - - edma_reg_write(EDMA_REG_RXFILL_PROD_IDX(rxfill_ring->id), - reg_data); - } - - return num_alloc; -} - -/* - * edma_clean_tx() - * Reap Tx descriptors - */ -uint32_t edma_clean_tx(struct edma_hw *ehw, - struct edma_txcmpl_ring *txcmpl_ring) -{ - struct platform_device *pdev = ehw->pdev; - struct edma_txcmpl_desc *txcmpl = NULL; - uint16_t prod_idx = 0; - uint16_t cons_idx = 0; - uint32_t data = 0; - uint32_t txcmpl_consumed = 0; - struct sk_buff *skb; - uint32_t len; - int store_index; - dma_addr_t daddr; - - /* - * Get TXCMPL ring producer index - */ - data = edma_reg_read(EDMA_REG_TXCMPL_PROD_IDX(txcmpl_ring->id)); - prod_idx = data & EDMA_TXCMPL_PROD_IDX_MASK; - - /* - * Get TXCMPL ring consumer index - */ - data = edma_reg_read(EDMA_REG_TXCMPL_CONS_IDX(txcmpl_ring->id)); - cons_idx = data & EDMA_TXCMPL_CONS_IDX_MASK; - - while (cons_idx != prod_idx) { - txcmpl = &(((struct edma_txcmpl_desc *) - (txcmpl_ring->desc))[cons_idx]); - - /* - * skb for this is stored in tx store and - * tx header contains the index in the field - * buffer address (opaque) of txcmpl - */ - store_index = txcmpl->buffer_addr; - skb = ehw->tx_skb_store[store_index]; - ehw->tx_skb_store[store_index] = NULL; - - if (unlikely(!skb)) { - pr_warn("Invalid skb: cons_idx:%u prod_idx:%u status %x\n", - cons_idx, prod_idx, txcmpl->status); - goto next_txcmpl_desc; - } - - len = skb_headlen(skb); - daddr = (dma_addr_t)virt_to_phys(skb->data); - - pr_debug("skb:%px cons_idx:%d prod_idx:%d word1:0x%x\n", - skb, cons_idx, prod_idx, txcmpl->status); - - dma_unmap_single(&pdev->dev, daddr, - len, DMA_TO_DEVICE); - dev_kfree_skb_any(skb); - -next_txcmpl_desc: - if (++cons_idx == txcmpl_ring->count) - cons_idx = 0; - - txcmpl_consumed++; - } - - if (txcmpl_consumed == 0) - return 0; - - pr_debug("TXCMPL:%u txcmpl_consumed:%u prod_idx:%u cons_idx:%u\n", - txcmpl_ring->id, txcmpl_consumed, prod_idx, cons_idx); - - /* - * Update TXCMPL ring consumer index - */ - wmb(); - edma_reg_write(EDMA_REG_TXCMPL_CONS_IDX(txcmpl_ring->id), cons_idx); - - return txcmpl_consumed; -} - -/* - * nss_phy_tstamp_rx_buf() - * Receive timestamp packet - */ -void nss_phy_tstamp_rx_buf(__attribute__((unused))void *app_data, struct sk_buff *skb) -{ - struct net_device *ndev = skb->dev; - - /* - * The PTP_CLASS_ value 0 is passed to phy driver, which will be - * set to the correct PTP class value by calling ptp_classify_raw - * in drv->rxtstamp function. - */ - if (ndev && ndev->phydev && ndev->phydev->drv && - ndev->phydev->drv->rxtstamp) - if(ndev->phydev->drv->rxtstamp(ndev->phydev, skb, 0)) - return; - - netif_receive_skb(skb); -} -EXPORT_SYMBOL(nss_phy_tstamp_rx_buf); - -/* - * nss_phy_tstamp_tx_buf() - * Transmit timestamp packet - */ -void nss_phy_tstamp_tx_buf(struct net_device *ndev, struct sk_buff *skb) -{ - /* - * Function drv->txtstamp will create a clone of skb if necessary, - * the PTP_CLASS_ value 0 is passed to phy driver, which will be - * set to the correct PTP class value by calling ptp_classify_raw - * in the drv->txtstamp function. - */ - if (ndev && ndev->phydev && ndev->phydev->drv && - ndev->phydev->drv->txtstamp) - ndev->phydev->drv->txtstamp(ndev->phydev, skb, 0); -} -EXPORT_SYMBOL(nss_phy_tstamp_tx_buf); - -/* - * edma_clean_rx() - * Reap Rx descriptors - */ -static uint32_t edma_clean_rx(struct edma_hw *ehw, - int work_to_do, - struct edma_rxdesc_ring *rxdesc_ring) -{ - struct platform_device *pdev = ehw->pdev; - struct net_device *ndev; - struct sk_buff *skb = NULL; - struct edma_rxdesc_desc *rxdesc_desc; - struct edma_rx_preheader *rxph = NULL; - uint16_t prod_idx = 0; - int src_port_num = 0; - int pkt_length = 0; - uint16_t cons_idx = 0; - uint32_t work_done = 0; - int store_index; - - /* - * Read Rx ring consumer index - */ - cons_idx = edma_reg_read(EDMA_REG_RXDESC_CONS_IDX(rxdesc_ring->id)) - & EDMA_RXDESC_CONS_IDX_MASK; - - while (1) { - /* - * Read Rx ring producer index - */ - prod_idx = edma_reg_read( - EDMA_REG_RXDESC_PROD_IDX(rxdesc_ring->id)) - & EDMA_RXDESC_PROD_IDX_MASK; - - if (cons_idx == prod_idx) - break; - - if (work_done >= work_to_do) - break; - - rxdesc_desc = EDMA_RXDESC_DESC(rxdesc_ring, cons_idx); - - /* - * Get Rx preheader - */ - rxph = (struct edma_rx_preheader *) - phys_to_virt(rxdesc_desc->buffer_addr); - - /* - * DMA unmap Rx buffer - */ - dma_unmap_single(&pdev->dev, - rxdesc_desc->buffer_addr, - EDMA_RX_BUFF_SIZE, - DMA_FROM_DEVICE); - - store_index = rxph->opaque; - skb = ehw->rx_skb_store[store_index]; - ehw->rx_skb_store[store_index] = NULL; - if (unlikely(!skb)) { - pr_warn("WARN: empty skb reference in rx_store:%d\n", - cons_idx); - goto next_rx_desc; - } - - /* - * Check src_info from Rx preheader - */ - if (EDMA_RXPH_SRC_INFO_TYPE_GET(rxph) == - EDMA_PREHDR_DSTINFO_PORTID_IND) { - src_port_num = rxph->src_info & - EDMA_PREHDR_PORTNUM_BITS; - } else { - pr_warn("WARN: src_info_type:0x%x. Drop skb:%px\n", - EDMA_RXPH_SRC_INFO_TYPE_GET(rxph), skb); - dev_kfree_skb_any(skb); - goto next_rx_desc; - } - - /* - * Get packet length - */ - pkt_length = rxdesc_desc->status & EDMA_RXDESC_PACKET_LEN_MASK; - - if (unlikely((src_port_num < NSS_DP_START_IFNUM) || - (src_port_num > NSS_DP_HAL_MAX_PORTS))) { - pr_warn("WARN: Port number error :%d. Drop skb:%px\n", - src_port_num, skb); - dev_kfree_skb_any(skb); - goto next_rx_desc; - } - - /* - * Get netdev for this port using the source port - * number as index into the netdev array. We need to - * subtract one since the indices start form '0' and - * port numbers start from '1'. - */ - ndev = ehw->netdev_arr[src_port_num - 1]; - if (unlikely(!ndev)) { - pr_warn("WARN: netdev Null src_info_type:0x%x. Drop skb:%px\n", - src_port_num, skb); - dev_kfree_skb_any(skb); - goto next_rx_desc; - } - - if (unlikely(!netif_running(ndev))) { - dev_kfree_skb_any(skb); - goto next_rx_desc; - } - - /* - * Remove Rx preheader - */ - skb_pull(skb, EDMA_RX_PREHDR_SIZE); - - /* - * Update skb fields and indicate packet to stack - */ - skb->dev = ndev; - skb->skb_iif = ndev->ifindex; - skb_put(skb, pkt_length); - skb->protocol = eth_type_trans(skb, skb->dev); -#ifdef CONFIG_NET_SWITCHDEV -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) - skb->offload_fwd_mark = ndev->offload_fwd_mark; -#else - /* - * TODO: Implement ndo_get_devlink_port() - */ - skb->offload_fwd_mark = 0; -#endif - pr_debug("skb:%px ring_idx:%u pktlen:%d proto:0x%x mark:%u\n", - skb, cons_idx, pkt_length, skb->protocol, - skb->offload_fwd_mark); -#else - pr_debug("skb:%px ring_idx:%u pktlen:%d proto:0x%x\n", - skb, cons_idx, pkt_length, skb->protocol); -#endif - /* - * Deliver the ptp packet to phy driver for RX timestamping - */ - if (unlikely(EDMA_RXPH_SERVICE_CODE_GET(rxph) == - NSS_PTP_EVENT_SERVICE_CODE)) - nss_phy_tstamp_rx_buf(ndev, skb); - else - netif_receive_skb(skb); - -next_rx_desc: - /* - * Update consumer index - */ - if (++cons_idx == rxdesc_ring->count) - cons_idx = 0; - - /* - * Update work done - */ - work_done++; - } - - edma_alloc_rx_buffer(ehw, rxdesc_ring->rxfill); - - /* - * make sure the consumer index is updated - * before updating the hardware - */ - wmb(); - edma_reg_write(EDMA_REG_RXDESC_CONS_IDX(rxdesc_ring->id), cons_idx); - return work_done; -} - -/* - * edma_napi() - * EDMA NAPI handler - */ -int edma_napi(struct napi_struct *napi, int budget) -{ - struct edma_hw *ehw = container_of(napi, struct edma_hw, napi); - struct edma_txcmpl_ring *txcmpl_ring = NULL; - struct edma_rxdesc_ring *rxdesc_ring = NULL; - struct edma_rxfill_ring *rxfill_ring = NULL; - - struct net_device *ndev; - int work_done = 0; - int i; - - for (i = 0; i < ehw->rxdesc_rings; i++) { - rxdesc_ring = &ehw->rxdesc_ring[i]; - work_done += edma_clean_rx(ehw, budget, rxdesc_ring); - } - - for (i = 0; i < ehw->txcmpl_rings; i++) { - txcmpl_ring = &ehw->txcmpl_ring[i]; - work_done += edma_clean_tx(ehw, txcmpl_ring); - } - - for (i = 0; i < ehw->rxfill_rings; i++) { - rxfill_ring = &ehw->rxfill_ring[i]; - work_done += edma_alloc_rx_buffer(ehw, rxfill_ring); - } - - /* - * Resume netdev Tx queue - */ - /* - * TODO works currently since we have a single queue. - * Need to make sure we have support in place when there is - * support for multiple queues - */ - for (i = 0; i < EDMA_MAX_GMACS; i++) { - ndev = ehw->netdev_arr[i]; - if (!ndev) - continue; - - if (netif_queue_stopped(ndev) && netif_carrier_ok(ndev)) - netif_start_queue(ndev); - } - - /* - * TODO - rework and fix the budget control - */ - if (work_done < budget) { - /* - * TODO per core NAPI - */ - napi_complete(napi); - - /* - * Set RXDESC ring interrupt mask - */ - for (i = 0; i < ehw->rxdesc_rings; i++) { - rxdesc_ring = &ehw->rxdesc_ring[i]; - edma_reg_write( - EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), - ehw->rxdesc_intr_mask); - } - - /* - * Set TXCMPL ring interrupt mask - */ - for (i = 0; i < ehw->txcmpl_rings; i++) { - txcmpl_ring = &ehw->txcmpl_ring[i]; - edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id), - ehw->txcmpl_intr_mask); - } - - /* - * Set RXFILL ring interrupt mask - */ - for (i = 0; i < ehw->rxfill_rings; i++) { - rxfill_ring = &ehw->rxfill_ring[i]; - edma_reg_write(EDMA_REG_RXFILL_INT_MASK( - rxfill_ring->id), - edma_hw.rxfill_intr_mask); - } - } - return work_done; -} - -/* - * edma_ring_xmit() - * Transmit a packet using an EDMA ring - */ -enum edma_tx edma_ring_xmit(struct edma_hw *ehw, - struct net_device *netdev, - struct sk_buff *skb, - struct edma_txdesc_ring *txdesc_ring) -{ - struct nss_dp_dev *dp_dev = netdev_priv(netdev); - struct edma_txdesc_desc *txdesc = NULL; - uint16_t buf_len; - uint16_t hw_next_to_use, hw_next_to_clean, chk_idx; - uint32_t data; - uint32_t store_index = 0; - struct edma_tx_preheader *txph = NULL; - - /* - * TODO - revisit locking - */ - spin_lock_bh(&txdesc_ring->tx_lock); - - /* - * Read TXDESC ring producer index - */ - data = edma_reg_read(EDMA_REG_TXDESC_PROD_IDX(txdesc_ring->id)); - hw_next_to_use = data & EDMA_TXDESC_PROD_IDX_MASK; - - /* - * Read TXDESC ring consumer index - */ - /* - * TODO - read to local variable to optimize uncached access - */ - data = edma_reg_read(EDMA_REG_TXDESC_CONS_IDX(txdesc_ring->id)); - hw_next_to_clean = data & EDMA_TXDESC_CONS_IDX_MASK; - - /* - * Check for available Tx descriptor - */ - chk_idx = (hw_next_to_use + 1) & (txdesc_ring->count-1); - - if (chk_idx == hw_next_to_clean) { - spin_unlock_bh(&txdesc_ring->tx_lock); - return EDMA_TX_DESC; - } - -#if defined(NSS_DP_EDMA_TX_SMALL_PKT_WAR) - /* - * IPQ807x EDMA hardware can't process the packet if the packet size is - * less than EDMA_TX_PKT_MIN_SIZE (33 Byte). So, if the packet size - * is indeed less than EDMA_TX_PKT_MIN_SIZE, perform padding - * (if possible), otherwise drop the packet. - * Using skb_padto() API for padding the packet. This API will drop - * the packet if the padding is not possible. - */ - if (unlikely(skb->len < EDMA_TX_PKT_MIN_SIZE)) { - if (skb_padto(skb, EDMA_TX_PKT_MIN_SIZE)) { - netdev_dbg(netdev, "padding couldn't happen, skb is freed.\n"); - netdev->stats.tx_dropped++; - spin_unlock_bh(&txdesc_ring->tx_lock); - return EDMA_TX_OK; - } - skb->len = EDMA_TX_PKT_MIN_SIZE; - } -#endif - - buf_len = skb_headlen(skb); - - /* - * Deliver the ptp packet to phy driver for TX timestamping - */ - if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) - nss_phy_tstamp_tx_buf(netdev, skb); - - /* - * Make room for Tx preheader - */ - txph = (struct edma_tx_preheader *)skb_push(skb, - EDMA_TX_PREHDR_SIZE); - memset((void *)txph, 0, EDMA_TX_PREHDR_SIZE); - - /* - * Populate Tx preheader dst info, port id is macid in dp_dev - */ - txph->dst_info = (EDMA_PREHDR_DSTINFO_PORTID_IND << 8) | - (dp_dev->macid & 0x0fff); - - /* - * Store the skb in tx_store - */ - store_index = hw_next_to_use & (txdesc_ring->count - 1); - if (unlikely(ehw->tx_skb_store[store_index] != NULL)) { - spin_unlock_bh(&txdesc_ring->tx_lock); - return EDMA_TX_DESC; - } - - ehw->tx_skb_store[store_index] = skb; - memcpy(skb->data, &store_index, 4); - - /* - * Get Tx descriptor - */ - txdesc = EDMA_TXDESC_DESC(txdesc_ring, hw_next_to_use); - memset(txdesc, 0, sizeof(struct edma_txdesc_desc)); - - /* - * Map buffer to DMA address - */ - txdesc->buffer_addr = cpu_to_le32(dma_map_single(&(ehw->pdev)->dev, - skb->data, - buf_len + EDMA_TX_PREHDR_SIZE, - DMA_TO_DEVICE)); - if (!txdesc->buffer_addr) { - /* - * DMA map failed for this address. Drop it - * and make sure does not got to stack again - */ - dev_kfree_skb_any(skb); - - ehw->tx_skb_store[store_index] = NULL; - spin_unlock_bh(&txdesc_ring->tx_lock); - return EDMA_TX_OK; - } - - /* - * Populate Tx descriptor - */ - txdesc->word1 |= (1 << EDMA_TXDESC_PREHEADER_SHIFT) - | ((EDMA_TX_PREHDR_SIZE & EDMA_TXDESC_DATA_OFFSET_MASK) - << EDMA_TXDESC_DATA_OFFSET_SHIFT); - txdesc->word1 |= ((buf_len & EDMA_TXDESC_DATA_LENGTH_MASK) - << EDMA_TXDESC_DATA_LENGTH_SHIFT); - - netdev_dbg(netdev, "skb:%px tx_ring:%u proto:0x%x\n", - skb, txdesc_ring->id, ntohs(skb->protocol)); - netdev_dbg(netdev, "port:%u prod_idx:%u cons_idx:%u\n", - dp_dev->macid, hw_next_to_use, hw_next_to_clean); - - /* - * Update producer index - */ - hw_next_to_use = (hw_next_to_use + 1) & (txdesc_ring->count - 1); - - /* - * make sure the hw_next_to_use is updated before the - * write to hardware - */ - wmb(); - - edma_reg_write(EDMA_REG_TXDESC_PROD_IDX(txdesc_ring->id), - hw_next_to_use & EDMA_TXDESC_PROD_IDX_MASK); - spin_unlock_bh(&txdesc_ring->tx_lock); - return EDMA_TX_OK; -} - -/* - * edma_handle_misc_irq() - * Process IRQ - */ -irqreturn_t edma_handle_misc_irq(int irq, void *ctx) -{ - uint32_t misc_intr_status = 0; - uint32_t reg_data = 0; - struct edma_hw *ehw = NULL; - struct platform_device *pdev = (struct platform_device *)ctx; - - ehw = platform_get_drvdata(pdev); - - /* - * Read Misc intr status - */ - reg_data = edma_reg_read(EDMA_REG_MISC_INT_STAT); - misc_intr_status = reg_data & ehw->misc_intr_mask; - - /* - * TODO - error logging - */ - if (misc_intr_status == 0) - return IRQ_NONE; - else - edma_reg_write(EDMA_REG_MISC_INT_MASK, EDMA_MASK_INT_DISABLE); - - return IRQ_HANDLED; -} - -/* - * edma_handle_irq() - * Process IRQ and schedule napi - */ -irqreturn_t edma_handle_irq(int irq, void *ctx) -{ - uint32_t reg_data = 0; - uint32_t rxdesc_intr_status = 0; - uint32_t txcmpl_intr_status = 0; - uint32_t rxfill_intr_status = 0; - int i; - struct edma_txcmpl_ring *txcmpl_ring = NULL; - struct edma_rxdesc_ring *rxdesc_ring = NULL; - struct edma_rxfill_ring *rxfill_ring = NULL; - struct edma_hw *ehw = NULL; - struct platform_device *pdev = (struct platform_device *)ctx; - - ehw = platform_get_drvdata(pdev); - if (!ehw) { - pr_info("Unable to retrieve platrofm data"); - return IRQ_HANDLED; - } - - /* - * Read RxDesc intr status - */ - for (i = 0; i < ehw->rxdesc_rings; i++) { - rxdesc_ring = &ehw->rxdesc_ring[i]; - reg_data = edma_reg_read( - EDMA_REG_RXDESC_INT_STAT(rxdesc_ring->id)); - rxdesc_intr_status |= reg_data & - EDMA_RXDESC_RING_INT_STATUS_MASK; - - /* - * Disable RxDesc intr - */ - edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), - EDMA_MASK_INT_DISABLE); - } - - /* - * Read TxCmpl intr status - */ - for (i = 0; i < ehw->txcmpl_rings; i++) { - txcmpl_ring = &ehw->txcmpl_ring[i]; - reg_data = edma_reg_read( - EDMA_REG_TX_INT_STAT(txcmpl_ring->id)); - txcmpl_intr_status |= reg_data & - EDMA_TXCMPL_RING_INT_STATUS_MASK; - - /* - * Disable TxCmpl intr - */ - edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id), - EDMA_MASK_INT_DISABLE); - } - - /* - * Read RxFill intr status - */ - for (i = 0; i < ehw->rxfill_rings; i++) { - rxfill_ring = &ehw->rxfill_ring[i]; - reg_data = edma_reg_read( - EDMA_REG_RXFILL_INT_STAT(rxfill_ring->id)); - rxfill_intr_status |= reg_data & - EDMA_RXFILL_RING_INT_STATUS_MASK; - - /* - * Disable RxFill intr - */ - edma_reg_write(EDMA_REG_RXFILL_INT_MASK(rxfill_ring->id), - EDMA_MASK_INT_DISABLE); - - } - - if ((rxdesc_intr_status == 0) && (txcmpl_intr_status == 0) && - (rxfill_intr_status == 0)) - return IRQ_NONE; - - for (i = 0; i < ehw->rxdesc_rings; i++) { - rxdesc_ring = &ehw->rxdesc_ring[i]; - edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id), - EDMA_MASK_INT_DISABLE); - } - - /* - *TODO - per core NAPI - */ - if (rxdesc_intr_status || txcmpl_intr_status || rxfill_intr_status) - if (likely(napi_schedule_prep(&ehw->napi))) - __napi_schedule(&ehw->napi); - - return IRQ_HANDLED; -} diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_dev.h b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_dev.h deleted file mode 100644 index 79da08661..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_dev.h +++ /dev/null @@ -1,697 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017,2020 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF0 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __QCOM_DEV_H__ -#define __QCOM_DEV_H__ - -#include -#include "qcom_reg.h" -#include -#include - -/* - * Subclass for base nss_gmac_haldev - */ -struct qcom_hal_dev { - struct nss_gmac_hal_dev nghd; /* Base class */ - fal_mib_counter_t stats; /* Stats structure */ -}; -/* - * qcom_set_rx_flow_ctrl() - */ -static inline void qcom_set_rx_flow_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_RX_FLOW_ENABLE); -} - -/* - * qcom_clear_rx_flow_ctrl() - */ -static inline void qcom_clear_rx_flow_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_RX_FLOW_ENABLE); -} - -/* - * qcom_set_tx_flow_ctrl() - */ -static inline void qcom_set_tx_flow_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_TX_FLOW_ENABLE); -} - -/* - * qcom_clear_tx_flow_ctrl() - */ -static inline void qcom_clear_tx_flow_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_TX_FLOW_ENABLE); -} - -/* - * qcom_clear_mac_ctrl0() - */ -static inline void qcom_clear_mac_ctrl0(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, QCOM_MAC_CTRL0, 0); -} - -/* - * qcom_rx_enable() - */ -static inline void qcom_rx_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_RX_MAC_ENABLE); -} - -/* - * qcom_rx_disable() - * Disable the reception of frames on GMII/MII. - * GMAC receive state machine is disabled after completion of reception of - * current frame. - */ -static inline void qcom_rx_disable(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_RX_MAC_ENABLE); -} - -/* - * qcom_tx_enable() - */ -static inline void qcom_tx_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_TX_MAC_ENABLE); -} - -/* - * qcom_tx_disable() - * Disable the transmission of frames on GMII/MII. - * GMAC transmit state machine is disabled after completion of - * transmission of current frame. - */ -static inline void qcom_tx_disable(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_TX_MAC_ENABLE); -} - -/* - * qcom_set_full_duplex() - */ -static inline void qcom_set_full_duplex(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_DUPLEX); -} - -/* - * qcom_set_half_duplex() - */ -static inline void qcom_set_half_duplex(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_ENABLE, QCOM_DUPLEX); -} - -/* - * qcom_set_ipgt() - */ -static inline void qcom_set_ipgt(struct nss_gmac_hal_dev *nghd, uint32_t ipgt) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_CTRL0); - data &= ~QCOM_IPGT_POS; - ipgt = ipgt << QCOM_IPGT_LSB; - data |= ipgt; - hal_write_reg(nghd->mac_base, QCOM_MAC_CTRL0, data); -} - -/* - * qcom_set_ipgr() - */ -static inline void qcom_set_ipgr(struct nss_gmac_hal_dev *nghd, uint32_t ipgr) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_CTRL0); - data &= ~QCOM_IPGR2_POS; - ipgr = ipgr << QCOM_IPGR2_LSB; - data |= ipgr; - hal_write_reg(nghd->mac_base, QCOM_MAC_CTRL0, data); -} - -/* - * qcom_set_half_thdf_ctrl() - */ -static inline void qcom_set_half_thdf_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_HALF_THDF_CTRL); -} - -/* - * qcom_reset_half_thdf_ctrl() - */ -static inline void qcom_reset_half_thdf_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_HALF_THDF_CTRL); -} - -/* - * qcom_set_frame_len_chk() - */ -static inline void qcom_set_frame_len_chk(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_FLCHK); -} - -/* - * qcom_reset_frame_len_chk() - */ -static inline void qcom_reset_frame_len_chk(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_FLCHK); -} - -/* - * qcom_set_abebe() - */ -static inline void qcom_set_abebe(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_ABEBE); -} - -/* - * qcom_reset_abebe() - */ -static inline void qcom_reset_abebe(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_ABEBE); -} - -/* - * qcom_set_amaxe() - */ -static inline void qcom_set_amaxe(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_AMAXE); -} - -/* - * qcom_reset_amaxe() - */ -static inline void qcom_reset_amaxe(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_AMAXE); -} - -/* - * qcom_set_bpnb() - */ -static inline void qcom_set_bpnb(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_BPNB); -} - -/* - * qcom_reset_bpnb() - */ -static inline void qcom_reset_bpnb(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_BPNB); -} - -/* - * qcom_set_nobo() - */ -static inline void qcom_set_nobo(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_NOBO); -} - -/* - * qcom_reset_nobo() - */ -static inline void qcom_reset_nobo(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_NOBO); -} - -/* - * qcom_set_drbnib_rxok() - */ -static inline void qcom_set_drbnib_rxok(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_DRBNIB_RXOK); -} - -/* - * qcom_reset_drbnib_rxok() - */ -static inline void qcom_reset_drbnib_rxok(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL0, QCOM_DRBNIB_RXOK); -} - -/* - * qcom_set_jam_ipg() - */ -static inline void qcom_set_jam_ipg(struct nss_gmac_hal_dev *nghd, - uint32_t jam_ipg) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_CTRL1); - data &= ~QCOM_JAM_IPG_POS; - jam_ipg = jam_ipg << QCOM_JAM_IPG_LSB; - data |= jam_ipg; - hal_write_reg(nghd->mac_base, QCOM_MAC_CTRL1, data); -} - -/* - * qcom_set_ctrl1_test_pause() - */ -static inline void qcom_set_ctrl1_test_pause(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_TPAUSE); -} - -/* - * qcom_reset_ctrl1_test_pause() - */ -static inline void qcom_reset_ctrl1_test_pause(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_TPAUSE); -} - -/* - * qcom_reset_ctrl1_test_pause() - */ -static inline void qcom_set_tctl(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_TCTL); -} - -/* - * qcom_reset_tctl() - */ -static inline void qcom_reset_tctl(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_TCTL); -} - -/* - * qcom_set_sstct() - */ -static inline void qcom_set_sstct(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_SSTCT); -} - -/* - * qcom_reset_sstct() - */ -static inline void qcom_reset_sstct(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_SSTCT); -} - -/* - * qcom_set_simr() - */ -static inline void qcom_set_simr(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_SIMR); -} - -/* - * qcom_reset_simr() - */ -static inline void qcom_reset_simr(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_SIMR); -} - -/* - * qcom_set_retry() - */ -static inline void qcom_set_retry(struct nss_gmac_hal_dev *nghd, uint32_t retry) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_CTRL1); - data &= ~QCOM_RETRY_POS; - retry = retry << QCOM_RETRY_LSB; - data |= retry; - hal_write_reg(nghd->mac_base, QCOM_MAC_CTRL1, data); -} - -/* - * qcom_set_prlen() - */ -static inline void qcom_set_prlen(struct nss_gmac_hal_dev *nghd, uint32_t prlen) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_CTRL1); - data &= ~QCOM_PRLEN_POS; - prlen = prlen << QCOM_PRLEN_LSB; - data |= prlen; - hal_write_reg(nghd->mac_base, QCOM_MAC_CTRL1, data); -} - -/* - * qcom_set_ppad() - */ -static inline void qcom_set_ppad(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_PPAD); -} - -/* - * qcom_reset_ppad() - */ -static inline void qcom_reset_ppad(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_PPAD); -} - -/* - * qcom_set_povr() - */ -static inline void qcom_set_povr(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_POVR); -} - -/* - * qcom_reset_povr() - */ -static inline void qcom_reset_povr(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_POVR); -} - -/* - * qcom_set_phug() - */ -static inline void qcom_set_phug(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_PHUG); -} - -/* - * qcom_reset_phug() - */ -static inline void qcom_reset_phug(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_PHUG); -} - -/* - * qcom_set_mbof() - */ -static inline void qcom_set_mbof(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_MBOF); -} - -/* - * qcom_reset_mbof() - */ -static inline void qcom_reset_mbof(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_MBOF); -} - -/* - * qcom_set_lcol() - */ -static inline void qcom_set_lcol(struct nss_gmac_hal_dev *nghd, uint32_t lcol) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_CTRL1); - data &= ~QCOM_LCOL_POS; - lcol = lcol << QCOM_LCOL_LSB; - data |= lcol; - hal_write_reg(nghd->mac_base, QCOM_MAC_CTRL1, data); -} - -/* - * qcom_set_long_jam() - */ -static inline void qcom_set_long_jam(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_LONG_JAM); -} - -/* - * qcom_reset_long_jam() - */ -static inline void qcom_reset_long_jam(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL1, QCOM_LONG_JAM); -} - -/* - * qcom_set_ipg_dec_len() - */ -static inline void qcom_set_ipg_dec_len(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_IPG_DEC_LEN); -} - -/* - * qcom_reset_ipg_dec_len() - */ -static inline void qcom_reset_ipg_dec_len(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_IPG_DEC_LEN); -} - -/* - * qcom_set_ctrl2_test_pause() - */ -static inline void qcom_set_ctrl2_test_pause(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_TEST_PAUSE); -} - -/* - * qcom_reset_ctrl2_test_pause() - */ -static inline void qcom_reset_ctrl2_test_pause(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_TEST_PAUSE); -} - -/* - * qcom_set_mac_loopback() - */ -static inline void qcom_set_mac_loopback(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_MAC_LOOPBACK); -} - -/* - * qcom_reset_mac_loopback() - */ -static inline void qcom_reset_mac_loopback(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_MAC_LOOPBACK); -} - -/* - * qcom_set_ipg_dec() - */ -static inline void qcom_set_ipg_dec(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_IPG_DEC); -} - -/* - * qcom_reset_ipg_dec() - */ -static inline void qcom_reset_ipg_dec(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_IPG_DEC); -} - -/* - * qcom_set_crs_sel() - */ -static inline void qcom_set_crs_sel(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_SRS_SEL); -} - -/* - * qcom_reset_crs_sel() - */ -static inline void qcom_reset_crs_sel(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_SRS_SEL); -} - -/* - * qcom_set_crc_rsv() - */ -static inline void qcom_set_crc_rsv(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_CRC_RSV); -} - -/* - * qcom_reset_crc_rsv() - */ -static inline void qcom_reset_crc_rsv(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_CTRL2, QCOM_CRC_RSV); -} - -/* - * qcom_set_ipgr1() - */ -static inline void qcom_set_ipgr1(struct nss_gmac_hal_dev *nghd, uint32_t ipgr1) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_DBG_CTRL); - data &= ~QCOM_DBG_IPGR1_POS; - ipgr1 = ipgr1 << QCOM_DBG_IPGR1_LSB; - data |= ipgr1; - hal_write_reg(nghd->mac_base, QCOM_MAC_DBG_CTRL, data); -} - -/* - * qcom_set_hihg_ipg() - */ -static inline void qcom_set_hihg_ipg(struct nss_gmac_hal_dev *nghd, - uint32_t hihg_ipg) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_DBG_CTRL); - data &= ~QCOM_DBG_HIHG_IPG_POS; - data |= hihg_ipg << QCOM_DBG_HIHG_IPG_LSB; - hal_write_reg(nghd->mac_base, QCOM_MAC_DBG_CTRL, data); -} - -/* - * qcom_set_mac_ipg_ctrl() - */ -static inline void qcom_set_mac_ipg_ctrl(struct nss_gmac_hal_dev *nghd, - uint32_t mac_ipg_ctrl) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_DBG_CTRL); - data &= ~QCOM_DBG_MAC_IPG_CTRL_POS; - data |= mac_ipg_ctrl << QCOM_DBG_MAC_IPG_CTRL_LSB; - hal_write_reg(nghd->mac_base, QCOM_MAC_DBG_CTRL, data); -} - -/* - * qcom_set_mac_len_ctrl() - */ -static inline void qcom_set_mac_len_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_DBG_CTRL, QCOM_DBG_MAC_LEN_CTRL); -} - -/* - * qcom_reset_mac_len_ctrl() - */ -static inline void qcom_reset_mac_len_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_DBG_CTRL, QCOM_DBG_MAC_LEN_CTRL); -} - -/* - * qcom_set_edxsdfr_transmit() - */ -static inline void qcom_set_edxsdfr_transmit(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, QCOM_MAC_DBG_CTRL, QCOM_DBG_EDxSDFR_TRANS); -} - -/* - * qcom_reset_edxsdfr_transmit() - */ -static inline void qcom_reset_edxsdfr_transmit(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, QCOM_MAC_DBG_CTRL, QCOM_DBG_EDxSDFR_TRANS); -} - -/* - * qcom_set_mac_dbg_addr() - */ -static inline void qcom_set_mac_dbg_addr(struct nss_gmac_hal_dev *nghd, - uint8_t mac_dbg_addr) -{ - hal_write_reg(nghd->mac_base, QCOM_MAC_DBG_ADDR, mac_dbg_addr); -} - -/* - * qcom_set_mac_dbg_data() - */ -static inline void qcom_set_mac_dbg_data(struct nss_gmac_hal_dev *nghd, - uint32_t mac_dbg_data) -{ - hal_write_reg(nghd->mac_base, QCOM_MAC_DBG_DATA, mac_dbg_data); -} - -/* - * qcom_set_mac_jumbosize() - */ -static inline void qcom_set_mac_jumbosize(struct nss_gmac_hal_dev *nghd, - uint16_t mac_jumbo_size) -{ - hal_write_reg(nghd->mac_base, QCOM_MAC_JMB_SIZE, mac_jumbo_size); -} - -/* - * qcom_clear_mib_ctrl() - */ -static inline void qcom_clear_mib_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, QCOM_MAC_MIB_CTRL, 0); -} - -/* - * qcom_set_mib_ctrl() - */ -static inline void qcom_set_mib_ctrl(struct nss_gmac_hal_dev *nghd, - int mib_settings) -{ - hal_set_reg_bits(nghd, QCOM_MAC_MIB_CTRL, - mib_settings); -} - -/* - * qcom_get_stats() - */ -static int qcom_get_stats(struct nss_gmac_hal_dev *nghd) -{ - struct qcom_hal_dev *qhd = (struct qcom_hal_dev *)nghd; - fal_mib_counter_t *stats = &(qhd->stats); - - if (fal_mib_counter_get(0, nghd->mac_id, stats) < 0) - return -1; - - return 0; -} -#endif /* __QCOM_DEV_H__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_if.c b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_if.c deleted file mode 100644 index b9b5968bf..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_if.c +++ /dev/null @@ -1,479 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2018, 2020 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include -#include -#include -#include -#include -#include -#include -#include "qcom_dev.h" - -#define QCOM_STAT(m) offsetof(fal_mib_counter_t, m) - -/* - * Ethtool stats pointer structure - */ -struct qcom_ethtool_stats { - uint8_t stat_string[ETH_GSTRING_LEN]; - uint32_t stat_offset; -}; - -/* - * Array of strings describing statistics - */ -static const struct qcom_ethtool_stats qcom_gstrings_stats[] = { - {"rx_broadcast", QCOM_STAT(RxBroad)}, - {"rx_pause", QCOM_STAT(RxPause)}, - {"rx_unicast", QCOM_STAT(RxUniCast)}, - {"rx_multicast", QCOM_STAT(RxMulti)}, - {"rx_fcserr", QCOM_STAT(RxFcsErr)}, - {"rx_alignerr", QCOM_STAT(RxAllignErr)}, - {"rx_runt", QCOM_STAT(RxRunt)}, - {"rx_frag", QCOM_STAT(RxFragment)}, - {"rx_jmbfcserr", QCOM_STAT(RxJumboFcsErr)}, - {"rx_jmbalignerr", QCOM_STAT(RxJumboAligenErr)}, - {"rx_pkt64", QCOM_STAT(Rx64Byte)}, - {"rx_pkt65to127", QCOM_STAT(Rx128Byte)}, - {"rx_pkt128to255", QCOM_STAT(Rx256Byte)}, - {"rx_pkt256to511", QCOM_STAT(Rx512Byte)}, - {"rx_pkt512to1023", QCOM_STAT(Rx1024Byte)}, - {"rx_pkt1024to1518", QCOM_STAT(Rx1518Byte)}, - {"rx_pkt1519tox", QCOM_STAT(RxMaxByte)}, - {"rx_toolong", QCOM_STAT(RxTooLong)}, - {"rx_pktgoodbyte", QCOM_STAT(RxGoodByte)}, - {"rx_pktbadbyte", QCOM_STAT(RxBadByte)}, - {"rx_overflow", QCOM_STAT(RxOverFlow)}, - {"tx_broadcast", QCOM_STAT(TxBroad)}, - {"tx_pause", QCOM_STAT(TxPause)}, - {"tx_multicast", QCOM_STAT(TxMulti)}, - {"tx_underrun", QCOM_STAT(TxUnderRun)}, - {"tx_pkt64", QCOM_STAT(Tx64Byte)}, - {"tx_pkt65to127", QCOM_STAT(Tx128Byte)}, - {"tx_pkt128to255", QCOM_STAT(Tx256Byte)}, - {"tx_pkt256to511", QCOM_STAT(Tx512Byte)}, - {"tx_pkt512to1023", QCOM_STAT(Tx1024Byte)}, - {"tx_pkt1024to1518", QCOM_STAT(Tx1518Byte)}, - {"tx_pkt1519tox", QCOM_STAT(TxMaxByte)}, - {"tx_oversize", QCOM_STAT(TxOverSize)}, - {"tx_pktbyte_h", QCOM_STAT(TxByte)}, - {"tx_collisions", QCOM_STAT(TxCollision)}, - {"tx_abortcol", QCOM_STAT(TxAbortCol)}, - {"tx_multicol", QCOM_STAT(TxMultiCol)}, - {"tx_singlecol", QCOM_STAT(TxSingalCol)}, - {"tx_exesdeffer", QCOM_STAT(TxExcDefer)}, - {"tx_deffer", QCOM_STAT(TxDefer)}, - {"tx_latecol", QCOM_STAT(TxLateCol)}, - {"tx_unicast", QCOM_STAT(TxUniCast)}, -}; - -/* - * Array of strings describing private flag names - */ -static const char * const qcom_strings_priv_flags[] = { - "linkpoll", - "tstamp", - "tsmode", -}; - -#define QCOM_STATS_LEN ARRAY_SIZE(qcom_gstrings_stats) -#define QCOM_PRIV_FLAGS_LEN ARRAY_SIZE(qcom_strings_priv_flags) - -/* - * qcom_set_mac_speed() - */ -static int32_t qcom_set_mac_speed(struct nss_gmac_hal_dev *nghd, - uint32_t mac_speed) -{ - struct net_device *netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * qcom_get_mac_speed() - */ -static uint32_t qcom_get_mac_speed(struct nss_gmac_hal_dev *nghd) -{ - struct net_device *netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * qcom_set_duplex_mode() - */ -static void qcom_set_duplex_mode(struct nss_gmac_hal_dev *nghd, - uint8_t duplex_mode) -{ - struct net_device *netdev = nghd->netdev; - - netdev_warn(netdev, "This API deprecated\n"); -} - -/* - * qcom_get_duplex_mode() - */ -static uint8_t qcom_get_duplex_mode(struct nss_gmac_hal_dev *nghd) -{ - struct net_device *netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * qcom_rx_flow_control() - */ -static void qcom_rx_flow_control(struct nss_gmac_hal_dev *nghd, bool enabled) -{ - if (enabled) - qcom_set_rx_flow_ctrl(nghd); - else - qcom_clear_rx_flow_ctrl(nghd); -} - -/* - * qcom_tx_flow_control() - */ -static void qcom_tx_flow_control(struct nss_gmac_hal_dev *nghd, bool enabled) -{ - if (enabled) - qcom_set_tx_flow_ctrl(nghd); - else - qcom_clear_tx_flow_ctrl(nghd); -} - -/* - * qcom_get_mib_stats() - */ -static int32_t qcom_get_mib_stats(struct nss_gmac_hal_dev *nghd) -{ - if (qcom_get_stats(nghd)) - return -1; - - return 0; -} - -/* - * qcom_set_maxframe() - */ -static int32_t qcom_set_maxframe(struct nss_gmac_hal_dev *nghd, - uint32_t maxframe) -{ - return fal_port_max_frame_size_set(0, nghd->mac_id, maxframe); -} - -/* - * qcom_get_maxframe() - */ -static int32_t qcom_get_maxframe(struct nss_gmac_hal_dev *nghd) -{ - int ret; - uint32_t mtu; - - ret = fal_port_max_frame_size_get(0, nghd->mac_id, &mtu); - - if (!ret) - return mtu; - - return ret; -} - -/* - * qcom_get_netdev_stats() - */ -static int32_t qcom_get_netdev_stats(struct nss_gmac_hal_dev *nghd, - struct rtnl_link_stats64 *stats) -{ - struct qcom_hal_dev *qhd = (struct qcom_hal_dev *)nghd; - fal_mib_counter_t *hal_stats = &(qhd->stats); - - if (qcom_get_mib_stats(nghd)) - return -1; - - stats->rx_packets = hal_stats->RxUniCast + hal_stats->RxBroad - + hal_stats->RxMulti; - stats->tx_packets = hal_stats->TxUniCast + hal_stats->TxBroad - + hal_stats->TxMulti; - stats->rx_bytes = hal_stats->RxGoodByte; - stats->tx_bytes = hal_stats->TxByte; - - /* RX errors */ - stats->rx_crc_errors = hal_stats->RxFcsErr + hal_stats->RxJumboFcsErr; - stats->rx_frame_errors = hal_stats->RxAllignErr + - hal_stats->RxJumboAligenErr; - stats->rx_fifo_errors = hal_stats->RxRunt; - stats->rx_errors = stats->rx_crc_errors + stats->rx_frame_errors + - stats->rx_fifo_errors; - - stats->rx_dropped = hal_stats->RxTooLong + stats->rx_errors; - - /* TX errors */ - stats->tx_fifo_errors = hal_stats->TxUnderRun; - stats->tx_aborted_errors = hal_stats->TxAbortCol; - stats->tx_errors = stats->tx_fifo_errors + stats->tx_aborted_errors; - - stats->collisions = hal_stats->TxCollision; - stats->multicast = hal_stats->RxMulti; - - return 0; -} - -/* - * qcom_get_strset_count() - * Get string set count for ethtool operations - */ -int32_t qcom_get_strset_count(struct nss_gmac_hal_dev *nghd, int32_t sset) -{ - struct net_device *netdev = nghd->netdev; - - switch (sset) { - case ETH_SS_STATS: - return QCOM_STATS_LEN; - case ETH_SS_PRIV_FLAGS: - return QCOM_PRIV_FLAGS_LEN; - } - - netdev_dbg(netdev, "%s: Invalid string set\n", __func__); - return -EPERM; -} - -/* - * qcom_get_strings() - * Get strings - */ -int32_t qcom_get_strings(struct nss_gmac_hal_dev *nghd, int32_t sset, - uint8_t *data) -{ - struct net_device *netdev = nghd->netdev; - int i; - - switch (sset) { - case ETH_SS_STATS: - for (i = 0; i < QCOM_STATS_LEN; i++) { - memcpy(data, qcom_gstrings_stats[i].stat_string, - strlen(qcom_gstrings_stats[i].stat_string)); - data += ETH_GSTRING_LEN; - } - break; - case ETH_SS_PRIV_FLAGS: - for (i = 0; i < QCOM_PRIV_FLAGS_LEN; i++) { - memcpy(data, qcom_strings_priv_flags[i], - strlen(qcom_strings_priv_flags[i])); - data += ETH_GSTRING_LEN; - } - break; - default: - netdev_dbg(netdev, "%s: Invalid string set\n", __func__); - return -EPERM; - } - - return 0; -} - -/* - * qcom_get_eth_stats() - */ -static int32_t qcom_get_eth_stats(struct nss_gmac_hal_dev *nghd, uint64_t *data) -{ - struct qcom_hal_dev *qhd = (struct qcom_hal_dev *)nghd; - fal_mib_counter_t *stats = &(qhd->stats); - uint8_t *p; - int i; - - if (qcom_get_mib_stats(nghd)) - return -1; - - for (i = 0; i < QCOM_STATS_LEN; i++) { - p = (uint8_t *)stats + qcom_gstrings_stats[i].stat_offset; - data[i] = *(uint32_t *)p; - } - - return 0; -} - -/* - * qcom_send_pause_frame() - */ -static void qcom_send_pause_frame(struct nss_gmac_hal_dev *nghd) -{ - qcom_set_ctrl2_test_pause(nghd); -} - -/* - * qcom_stop_pause_frame() - */ -static void qcom_stop_pause_frame(struct nss_gmac_hal_dev *nghd) -{ - qcom_reset_ctrl2_test_pause(nghd); -} - -/* - * qcom_start() - */ -static int32_t qcom_start(struct nss_gmac_hal_dev *nghd) -{ - qcom_set_full_duplex(nghd); - - /* TODO: Read speed from dts */ - - if (qcom_set_mac_speed(nghd, SPEED_1000)) - return -1; - - qcom_tx_enable(nghd); - qcom_rx_enable(nghd); - - netdev_dbg(nghd->netdev, "%s: mac_base:0x%px mac_enable:0x%x\n", - __func__, nghd->mac_base, - hal_read_reg(nghd->mac_base, QCOM_MAC_ENABLE)); - - return 0; -} - -/* - * qcom_stop() - */ -static int32_t qcom_stop(struct nss_gmac_hal_dev *nghd) -{ - qcom_tx_disable(nghd); - qcom_rx_disable(nghd); - - netdev_dbg(nghd->netdev, "%s: mac_base:0x%px mac_enable:0x%x\n", - __func__, nghd->mac_base, - hal_read_reg(nghd->mac_base, QCOM_MAC_ENABLE)); - return 0; -} - -/* - * qcom_init() - */ -static void *qcom_init(struct gmac_hal_platform_data *gmacpdata) -{ - struct qcom_hal_dev *qhd = NULL; - struct net_device *ndev = NULL; - struct nss_dp_dev *dp_priv = NULL; - struct resource *res; - - ndev = gmacpdata->netdev; - dp_priv = netdev_priv(ndev); - - res = platform_get_resource(dp_priv->pdev, IORESOURCE_MEM, 0); - if (!res) { - netdev_dbg(ndev, "Resource get failed.\n"); - return NULL; - } - - if (!devm_request_mem_region(&dp_priv->pdev->dev, res->start, - resource_size(res), ndev->name)) { - netdev_dbg(ndev, "Request mem region failed. Returning...\n"); - return NULL; - } - - qhd = (struct qcom_hal_dev *)devm_kzalloc(&dp_priv->pdev->dev, - sizeof(struct qcom_hal_dev), GFP_KERNEL); - if (!qhd) { - netdev_dbg(ndev, "kzalloc failed. Returning...\n"); - return NULL; - } - - /* Save netdev context in QCOM HAL context */ - qhd->nghd.netdev = gmacpdata->netdev; - qhd->nghd.mac_id = gmacpdata->macid; - - /* Populate the mac base addresses */ - qhd->nghd.mac_base = devm_ioremap_nocache(&dp_priv->pdev->dev, - res->start, resource_size(res)); - if (!qhd->nghd.mac_base) { - netdev_dbg(ndev, "ioremap fail.\n"); - return NULL; - } - - spin_lock_init(&qhd->nghd.slock); - - netdev_dbg(ndev, "ioremap OK.Size 0x%x Ndev base 0x%lx macbase 0x%px\n", - gmacpdata->reg_len, - ndev->base_addr, - qhd->nghd.mac_base); - - /* Reset MIB Stats */ - if (fal_mib_port_flush_counters(0, qhd->nghd.mac_id)) { - netdev_dbg(ndev, "MIB stats Reset fail.\n"); - } - - return (struct nss_gmac_hal_dev *)qhd; -} - -/* - * qcom_get_mac_address() - */ -static void qcom_get_mac_address(struct nss_gmac_hal_dev *nghd, - uint8_t *macaddr) -{ - uint32_t data = hal_read_reg(nghd->mac_base, QCOM_MAC_ADDR0); - macaddr[5] = (data >> 8) & 0xff; - macaddr[4] = (data) & 0xff; - - data = hal_read_reg(nghd->mac_base, QCOM_MAC_ADDR1); - macaddr[0] = (data >> 24) & 0xff; - macaddr[1] = (data >> 16) & 0xff; - macaddr[2] = (data >> 8) & 0xff; - macaddr[3] = (data) & 0xff; -} - -/* - * qcom_set_mac_address() - */ -static void qcom_set_mac_address(struct nss_gmac_hal_dev *nghd, - uint8_t *macaddr) -{ - uint32_t data = (macaddr[5] << 8) | macaddr[4]; - hal_write_reg(nghd->mac_base, QCOM_MAC_ADDR0, data); - data = (macaddr[0] << 24) | (macaddr[1] << 16) - | (macaddr[2] << 8) | macaddr[3]; - hal_write_reg(nghd->mac_base, QCOM_MAC_ADDR1, data); -} - -/* - * MAC hal_ops base structure - */ -struct nss_gmac_hal_ops qcom_hal_ops = { - .init = &qcom_init, - .start = &qcom_start, - .stop = &qcom_stop, - .setmacaddr = &qcom_set_mac_address, - .getmacaddr = &qcom_get_mac_address, - .rxflowcontrol = &qcom_rx_flow_control, - .txflowcontrol = &qcom_tx_flow_control, - .setspeed = &qcom_set_mac_speed, - .getspeed = &qcom_get_mac_speed, - .setduplex = &qcom_set_duplex_mode, - .getduplex = &qcom_get_duplex_mode, - .getstats = &qcom_get_mib_stats, - .setmaxframe = &qcom_set_maxframe, - .getmaxframe = &qcom_get_maxframe, - .getndostats = &qcom_get_netdev_stats, - .getssetcount = &qcom_get_strset_count, - .getstrings = &qcom_get_strings, - .getethtoolstats = &qcom_get_eth_stats, - .sendpause = &qcom_send_pause_frame, - .stoppause = &qcom_stop_pause_frame, -}; diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_reg.h b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_reg.h deleted file mode 100644 index 9210c2a50..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/qcom/qcom_reg.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016,2020 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF0 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __QCOM_REG_H__ -#define __QCOM_REG_H__ - -/* Register Offsets */ -/* Offsets of GMAC config and status registers within NSS_GMAC_QCOM_MAC_BASE */ -#define QCOM_MAC_ENABLE 0x0000 -#define QCOM_MAC_SPEED 0x0004 -#define QCOM_MAC_ADDR0 0x0008 -#define QCOM_MAC_ADDR1 0x000c -#define QCOM_MAC_CTRL0 0x0010 -#define QCOM_MAC_CTRL1 0x0014 -#define QCOM_MAC_CTRL2 0x0018 -#define QCOM_MAC_DBG_CTRL 0x001c -#define QCOM_MAC_DBG_ADDR 0x0020 -#define QCOM_MAC_DBG_DATA 0x0024 -#define QCOM_MAC_JMB_SIZE 0x0030 -#define QCOM_MAC_MIB_CTRL 0x0034 - -/* RX stats */ -#define QCOM_RXBROAD 0x0040 -#define QCOM_RXPAUSE 0x0044 -#define QCOM_RXMULTI 0x0048 -#define QCOM_RXFCSERR 0x004c -#define QCOM_RXALIGNERR 0x0050 -#define QCOM_RXRUNT 0x0054 -#define QCOM_RXFRAG 0x0058 -#define QCOM_RXJMBFCSERR 0x005c -#define QCOM_RXJMBALIGNERR 0x0060 -#define QCOM_RXPKT64 0x0064 -#define QCOM_RXPKT65TO127 0x0068 -#define QCOM_RXPKT128TO255 0x006c -#define QCOM_RXPKT256TO511 0x0070 -#define QCOM_RXPKT512TO1023 0x0074 -#define QCOM_RXPKT1024TO1518 0x0078 -#define QCOM_RXPKT1519TOX 0x007c -#define QCOM_RXPKTTOOLONG 0x0080 -#define QCOM_RXPKTGOODBYTE_L 0x0084 -#define QCOM_RXPKTGOODBYTE_H 0x0088 -#define QCOM_RXPKTBADBYTE_L 0x008c -#define QCOM_RXPKTBADBYTE_H 0x0090 -#define QCOM_RXUNI 0x0094 - -/* TX stats */ -#define QCOM_TXBROAD 0x00a0 -#define QCOM_TXPAUSE 0x00a4 -#define QCOM_TXMULTI 0x00a8 -#define QCOM_TXUNDERUN 0x00aC -#define QCOM_TXPKT64 0x00b0 -#define QCOM_TXPKT65TO127 0x00b4 -#define QCOM_TXPKT128TO255 0x00b8 -#define QCOM_TXPKT256TO511 0x00bc -#define QCOM_TXPKT512TO1023 0x00c0 -#define QCOM_TXPKT1024TO1518 0x00c4 -#define QCOM_TXPKT1519TOX 0x00c8 -#define QCOM_TXPKTBYTE_L 0x00cc -#define QCOM_TXPKTBYTE_H 0x00d0 -#define QCOM_TXCOLLISIONS 0x00d4 -#define QCOM_TXABORTCOL 0x00d8 -#define QCOM_TXMULTICOL 0x00dc -#define QCOM_TXSINGLECOL 0x00e0 -#define QCOM_TXEXCESSIVEDEFER 0x00e4 -#define QCOM_TXDEFER 0x00e8 -#define QCOM_TXLATECOL 0x00ec -#define QCOM_TXUNI 0x00f0 - -/* Bit Masks */ -/* GMAC BITs */ -#define QCOM_RX_MAC_ENABLE 1 -#define QCOM_TX_MAC_ENABLE 0x2 -#define QCOM_DUPLEX 0x10 -#define QCOM_RX_FLOW_ENABLE 0x20 -#define QCOM_TX_FLOW_ENABLE 0x40 - -#define QCOM_MAC_SPEED_10 0 -#define QCOM_MAC_SPEED_100 1 -#define QCOM_MAC_SPEED_1000 2 - -/* MAC CTRL0 */ -#define QCOM_IPGT_POS 0x0000007f -#define QCOM_IPGT_LSB 0 -#define QCOM_IPGR2_POS 0x00007f00 -#define QCOM_IPGR2_LSB 8 -#define QCOM_HALF_THDF_CTRL 0x8000 -#define QCOM_HUGE_RECV 0x10000 -#define QCOM_HUGE_TRANS 0x20000 -#define QCOM_FLCHK 0x40000 -#define QCOM_ABEBE 0x80000 -#define QCOM_AMAXE 0x10000000 -#define QCOM_BPNB 0x20000000 -#define QCOM_NOBO 0x40000000 -#define QCOM_DRBNIB_RXOK 0x80000000 - -/* MAC CTRL1 */ -#define QCOM_JAM_IPG_POS 0x0000000f -#define QCOM_JAM_IPG_LSB 0 -#define QCOM_TPAUSE 0x10 -#define QCOM_TCTL 0x20 -#define QCOM_SSTCT 0x40 -#define QCOM_SIMR 0x80 -#define QCOM_RETRY_POS 0x00000f00 -#define QCOM_RETRY_LSB 8 -#define QCOM_PRLEN_POS 0x0000f000 -#define QCOM_PRLEN_LSB 8 -#define QCOM_PPAD 0x10000 -#define QCOM_POVR 0x20000 -#define QCOM_PHUG 0x40000 -#define QCOM_MBOF 0x80000 -#define QCOM_LCOL_POS 0x0ff00000 -#define QCOM_LCOL_LSB 20 -#define QCOM_LONG_JAM 0x10000000 - -/* MAC CTRL2 */ -#define QCOM_IPG_DEC_LEN 0x2 -#define QCOM_TEST_PAUSE 0x4 -#define QCOM_MAC_LPI_TX_IDLE 0x8 -#define QCOM_MAC_LOOPBACK 0x10 -#define QCOM_IPG_DEC 0x20 -#define QCOM_SRS_SEL 0x40 -#define QCOM_CRC_RSV 0x80 -#define QCOM_MAXFR_POS 0x003fff00 -#define QCOM_MAXFR_LSB 8 - -/* MAC DEBUG_CTRL */ -#define QCOM_DBG_IPGR1_POS 0x0000007f -#define QCOM_DBG_IPGR1_LSB 0 -#define QCOM_DBG_HIHG_IPG_POS 0x0000ff00 -#define QCOM_DBG_HIHG_IPG_LSB 8 -#define QCOM_DBG_MAC_IPG_CTRL_POS 0x0000ff00 -#define QCOM_DBG_MAC_IPG_CTRL_LSB 20 -#define QCOM_DBG_MAC_LEN_CTRL 0x40000000 -#define QCOM_DBG_EDxSDFR_TRANS 0x80000000 - -/* MAC MIB-CTRL*/ -#define QCOM_MIB_ENABLE 1 -#define QCOM_MIB_RESET 0x2 -#define QCOM_MIB_RD_CLR 0x4 - -#endif /*__QCOM_REG_H__*/ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_dev.h b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_dev.h deleted file mode 100644 index 0bfec1b99..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_dev.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __SYN_DEV_H__ -#define __SYN_DEV_H__ - -#include - -/* - * Subclass for base nss_gmac_hal_dev - */ -struct syn_hal_dev { - struct nss_gmac_hal_dev nghd; /* Base class */ - struct nss_dp_gmac_stats stats; /* Stats structure */ -}; - -#endif /*__SYN_DEV_H__*/ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_if.c b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_if.c deleted file mode 100644 index 2601ff204..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_if.c +++ /dev/null @@ -1,959 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "syn_dev.h" -#include "syn_reg.h" - -#define SYN_STAT(m) offsetof(struct nss_dp_hal_gmac_stats, m) -#define HW_ERR_SIZE sizeof(uint64_t) - -/* - * Array to store ethtool statistics - */ -struct syn_ethtool_stats { - uint8_t stat_string[ETH_GSTRING_LEN]; - uint64_t stat_offset; -}; - -/* - * Array of strings describing statistics - */ -static const struct syn_ethtool_stats syn_gstrings_stats[] = { - {"rx_bytes", SYN_STAT(rx_bytes)}, - {"rx_packets", SYN_STAT(rx_packets)}, - {"rx_errors", SYN_STAT(rx_errors)}, - {"rx_receive_errors", SYN_STAT(rx_receive_errors)}, - {"rx_descriptor_errors", SYN_STAT(rx_descriptor_errors)}, - {"rx_late_collision_errors", SYN_STAT(rx_late_collision_errors)}, - {"rx_dribble_bit_errors", SYN_STAT(rx_dribble_bit_errors)}, - {"rx_length_errors", SYN_STAT(rx_length_errors)}, - {"rx_ip_header_errors", SYN_STAT(rx_ip_header_errors)}, - {"rx_ip_payload_errors", SYN_STAT(rx_ip_payload_errors)}, - {"rx_no_buffer_errors", SYN_STAT(rx_no_buffer_errors)}, - {"rx_transport_csum_bypassed", SYN_STAT(rx_transport_csum_bypassed)}, - {"tx_bytes", SYN_STAT(tx_bytes)}, - {"tx_packets", SYN_STAT(tx_packets)}, - {"tx_collisions", SYN_STAT(tx_collisions)}, - {"tx_errors", SYN_STAT(tx_errors)}, - {"tx_jabber_timeout_errors", SYN_STAT(tx_jabber_timeout_errors)}, - {"tx_frame_flushed_errors", SYN_STAT(tx_frame_flushed_errors)}, - {"tx_loss_of_carrier_errors", SYN_STAT(tx_loss_of_carrier_errors)}, - {"tx_no_carrier_errors", SYN_STAT(tx_no_carrier_errors)}, - {"tx_late_collision_errors", SYN_STAT(tx_late_collision_errors)}, - {"tx_excessive_collision_errors", SYN_STAT(tx_excessive_collision_errors)}, - {"tx_excessive_deferral_errors", SYN_STAT(tx_excessive_deferral_errors)}, - {"tx_underflow_errors", SYN_STAT(tx_underflow_errors)}, - {"tx_ip_header_errors", SYN_STAT(tx_ip_header_errors)}, - {"tx_ip_payload_errors", SYN_STAT(tx_ip_payload_errors)}, - {"tx_dropped", SYN_STAT(tx_dropped)}, - {"rx_missed", SYN_STAT(rx_missed)}, - {"fifo_overflows", SYN_STAT(fifo_overflows)}, - {"rx_scatter_errors", SYN_STAT(rx_scatter_errors)}, - {"tx_ts_create_errors", SYN_STAT(tx_ts_create_errors)}, - {"pmt_interrupts", SYN_STAT(hw_errs[0])}, - {"mmc_interrupts", SYN_STAT(hw_errs[0]) + (1 * HW_ERR_SIZE)}, - {"line_interface_interrupts", SYN_STAT(hw_errs[0]) + (2 * HW_ERR_SIZE)}, - {"fatal_bus_error_interrupts", SYN_STAT(hw_errs[0]) + (3 * HW_ERR_SIZE)}, - {"rx_buffer_unavailable_interrupts", SYN_STAT(hw_errs[0]) + (4 * HW_ERR_SIZE)}, - {"rx_process_stopped_interrupts", SYN_STAT(hw_errs[0]) + (5 * HW_ERR_SIZE)}, - {"tx_underflow_interrupts", SYN_STAT(hw_errs[0]) + (6 * HW_ERR_SIZE)}, - {"rx_overflow_interrupts", SYN_STAT(hw_errs[0]) + (7 * HW_ERR_SIZE)}, - {"tx_jabber_timeout_interrutps", SYN_STAT(hw_errs[0]) + (8 * HW_ERR_SIZE)}, - {"tx_process_stopped_interrutps", SYN_STAT(hw_errs[0]) + (9 * HW_ERR_SIZE)}, - {"gmac_total_ticks", SYN_STAT(gmac_total_ticks)}, - {"gmac_worst_case_ticks", SYN_STAT(gmac_worst_case_ticks)}, - {"gmac_iterations", SYN_STAT(gmac_iterations)}, - {"tx_pause_frames", SYN_STAT(tx_pause_frames)}, - {"mmc_rx_overflow_errors", SYN_STAT(mmc_rx_overflow_errors)}, - {"mmc_rx_watchdog_timeout_errors", SYN_STAT(mmc_rx_watchdog_timeout_errors)}, - {"mmc_rx_crc_errors", SYN_STAT(mmc_rx_crc_errors)}, - {"mmc_rx_ip_header_errors", SYN_STAT(mmc_rx_ip_header_errors)}, - {"mmc_rx_octets_g", SYN_STAT(mmc_rx_octets_g)}, - {"mmc_rx_ucast_frames", SYN_STAT(mmc_rx_ucast_frames)}, - {"mmc_rx_bcast_frames", SYN_STAT(mmc_rx_bcast_frames)}, - {"mmc_rx_mcast_frames", SYN_STAT(mmc_rx_mcast_frames)}, - {"mmc_rx_undersize", SYN_STAT(mmc_rx_undersize)}, - {"mmc_rx_oversize", SYN_STAT(mmc_rx_oversize)}, - {"mmc_rx_jabber", SYN_STAT(mmc_rx_jabber)}, - {"mmc_rx_octets_gb", SYN_STAT(mmc_rx_octets_gb)}, - {"mmc_rx_frag_frames_g", SYN_STAT(mmc_rx_frag_frames_g)}, - {"mmc_tx_octets_g", SYN_STAT(mmc_tx_octets_g)}, - {"mmc_tx_ucast_frames", SYN_STAT(mmc_tx_ucast_frames)}, - {"mmc_tx_bcast_frames", SYN_STAT(mmc_tx_bcast_frames)}, - {"mmc_tx_mcast_frames", SYN_STAT(mmc_tx_mcast_frames)}, - {"mmc_tx_deferred", SYN_STAT(mmc_tx_deferred)}, - {"mmc_tx_single_col", SYN_STAT(mmc_tx_single_col)}, - {"mmc_tx_multiple_col", SYN_STAT(mmc_tx_multiple_col)}, - {"mmc_tx_octets_gb", SYN_STAT(mmc_tx_octets_gb)}, -}; - -#define SYN_STATS_LEN ARRAY_SIZE(syn_gstrings_stats) - -/* - * syn_set_rx_flow_ctrl() - */ -static inline void syn_set_rx_flow_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_FLOW_CONTROL, - SYN_MAC_FC_RX_FLOW_CONTROL); -} - -/* - * syn_clear_rx_flow_ctrl() - */ -static inline void syn_clear_rx_flow_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, SYN_MAC_FLOW_CONTROL, - SYN_MAC_FC_RX_FLOW_CONTROL); - -} - -/* - * syn_set_tx_flow_ctrl() - */ -static inline void syn_set_tx_flow_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_FLOW_CONTROL, - SYN_MAC_FC_TX_FLOW_CONTROL); -} - -/* - * syn_send_tx_pause_frame() - */ -static inline void syn_send_tx_pause_frame(struct nss_gmac_hal_dev *nghd) -{ - syn_set_tx_flow_ctrl(nghd); - hal_set_reg_bits(nghd, SYN_MAC_FLOW_CONTROL, - SYN_MAC_FC_SEND_PAUSE_FRAME); -} - -/* - * syn_clear_tx_flow_ctrl() - */ -static inline void syn_clear_tx_flow_ctrl(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, SYN_MAC_FLOW_CONTROL, - SYN_MAC_FC_TX_FLOW_CONTROL); -} - -/* - * syn_rx_enable() - */ -static inline void syn_rx_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_CONFIGURATION, SYN_MAC_RX); - hal_set_reg_bits(nghd, SYN_MAC_FRAME_FILTER, SYN_MAC_FILTER_OFF); -} - -/* - * syn_tx_enable() - */ -static inline void syn_tx_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_CONFIGURATION, SYN_MAC_TX); -} - -/************Ip checksum offloading APIs*************/ - -/* - * syn_enable_rx_chksum_offload() - * Enable IPv4 header and IPv4/IPv6 TCP/UDP checksum calculation by GMAC. - */ -static inline void syn_enable_rx_chksum_offload(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, - SYN_MAC_CONFIGURATION, SYN_MAC_RX_IPC_OFFLOAD); -} - -/* - * syn_disable_rx_chksum_offload() - * Disable the IP checksum offloading in receive path. - */ -static inline void syn_disable_rx_chksum_offload(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, - SYN_MAC_CONFIGURATION, SYN_MAC_RX_IPC_OFFLOAD); -} - -/* - * syn_rx_tcpip_chksum_drop_enable() - * Instruct the DMA to drop the packets that fail TCP/IP checksum. - * - * This is to instruct the receive DMA engine to drop the recevied - * packet if they fails the tcp/ip checksum in hardware. Valid only when - * full checksum offloading is enabled(type-2). - */ -static inline void syn_rx_tcpip_chksum_drop_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, - SYN_DMA_OPERATION_MODE, SYN_DMA_DISABLE_DROP_TCP_CS); -} - -/*******************Ip checksum offloading APIs**********************/ - -/* - * syn_ipc_offload_init() - * Initialize IPC Checksum offloading. - */ -static inline void syn_ipc_offload_init(struct nss_gmac_hal_dev *nghd) -{ - struct nss_dp_dev *dp_priv; - dp_priv = netdev_priv(nghd->netdev); - - if (test_bit(__NSS_DP_RXCSUM, &dp_priv->flags)) { - /* - * Enable the offload engine in the receive path - */ - syn_enable_rx_chksum_offload(nghd); - - /* - * DMA drops the packets if error in encapsulated ethernet - * payload. - */ - syn_rx_tcpip_chksum_drop_enable(nghd); - netdev_dbg(nghd->netdev, "%s: enable Rx checksum\n", __func__); - } else { - syn_disable_rx_chksum_offload(nghd); - netdev_dbg(nghd->netdev, "%s: disable Rx checksum\n", __func__); - } -} - -/* - * syn_disable_mac_interrupt() - * Disable all the interrupts. - */ -static inline void syn_disable_mac_interrupt(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, SYN_INTERRUPT_MASK, 0xffffffff); -} - -/* - * syn_disable_mmc_tx_interrupt() - * Disable the MMC Tx interrupt. - * - * The MMC tx interrupts are masked out as per the mask specified. - */ -static inline void syn_disable_mmc_tx_interrupt(struct nss_gmac_hal_dev *nghd, - uint32_t mask) -{ - hal_set_reg_bits(nghd, SYN_MMC_TX_INTERRUPT_MASK, mask); -} - -/* - * syn_disable_mmc_rx_interrupt() - * Disable the MMC Rx interrupt. - * - * The MMC rx interrupts are masked out as per the mask specified. - */ -static inline void syn_disable_mmc_rx_interrupt(struct nss_gmac_hal_dev *nghd, - uint32_t mask) -{ - hal_set_reg_bits(nghd, SYN_MMC_RX_INTERRUPT_MASK, mask); -} - -/* - * syn_disable_mmc_ipc_rx_interrupt() - * Disable the MMC ipc rx checksum offload interrupt. - * - * The MMC ipc rx checksum offload interrupts are masked out as - * per the mask specified. - */ -static inline void syn_disable_mmc_ipc_rx_interrupt(struct nss_gmac_hal_dev *nghd, - uint32_t mask) -{ - hal_set_reg_bits(nghd, SYN_MMC_IPC_RX_INTR_MASK, mask); -} - -/* - * syn_disable_dma_interrupt() - * Disables all DMA interrupts. - */ -void syn_disable_dma_interrupt(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, SYN_DMA_INT_ENABLE, SYN_DMA_INT_DISABLE); -} - -/* - * syn_enable_dma_interrupt() - * Enables all DMA interrupts. - */ -void syn_enable_dma_interrupt(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, SYN_DMA_INT_ENABLE, SYN_DMA_INT_EN); -} - -/* - * syn_disable_interrupt_all() - * Disable all the interrupts. - */ -static inline void syn_disable_interrupt_all(struct nss_gmac_hal_dev *nghd) -{ - syn_disable_mac_interrupt(nghd); - syn_disable_dma_interrupt(nghd); - syn_disable_mmc_tx_interrupt(nghd, 0xFFFFFFFF); - syn_disable_mmc_rx_interrupt(nghd, 0xFFFFFFFF); - syn_disable_mmc_ipc_rx_interrupt(nghd, 0xFFFFFFFF); -} - -/* - * syn_dma_bus_mode_init() - * Function to program DMA bus mode register. - */ -static inline void syn_dma_bus_mode_init(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, SYN_DMA_BUS_MODE, SYN_DMA_BUS_MODE_VAL); -} - -/* - * syn_clear_dma_status() - * Clear all the pending dma interrupts. - */ -void syn_clear_dma_status(struct nss_gmac_hal_dev *nghd) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, SYN_DMA_STATUS); - hal_write_reg(nghd->mac_base, SYN_DMA_STATUS, data); -} - -/* - * syn_enable_dma_rx() - * Enable Rx GMAC operation - */ -void syn_enable_dma_rx(struct nss_gmac_hal_dev *nghd) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE); - data |= SYN_DMA_RX_START; - hal_write_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE, data); -} - -/* - * syn_disable_dma_rx() - * Disable Rx GMAC operation - */ -void syn_disable_dma_rx(struct nss_gmac_hal_dev *nghd) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE); - data &= ~SYN_DMA_RX_START; - hal_write_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE, data); -} - -/* - * syn_enable_dma_tx() - * Enable Rx GMAC operation - */ -void syn_enable_dma_tx(struct nss_gmac_hal_dev *nghd) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE); - data |= SYN_DMA_TX_START; - hal_write_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE, data); -} - -/* - * syn_disable_dma_tx() - * Disable Rx GMAC operation - */ -void syn_disable_dma_tx(struct nss_gmac_hal_dev *nghd) -{ - uint32_t data; - - data = hal_read_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE); - data &= ~SYN_DMA_TX_START; - hal_write_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE, data); -} - -/* - * syn_resume_dma_tx - * Resumes the DMA Transmission. - */ -void syn_resume_dma_tx(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, SYN_DMA_TX_POLL_DEMAND, 0); -} - -/* - * syn_get_rx_missed - * Get Rx missed errors - */ -uint32_t syn_get_rx_missed(struct nss_gmac_hal_dev *nghd) -{ - uint32_t missed_frame_buff_overflow; - missed_frame_buff_overflow = hal_read_reg(nghd->mac_base, SYN_DMA_MISSED_FRAME_AND_BUFF_OVERFLOW_COUNTER); - return missed_frame_buff_overflow & 0xFFFF; -} - -/* - * syn_get_fifo_overflows - * Get FIFO overflows - */ -uint32_t syn_get_fifo_overflows(struct nss_gmac_hal_dev *nghd) -{ - uint32_t missed_frame_buff_overflow; - missed_frame_buff_overflow = hal_read_reg(nghd->mac_base, SYN_DMA_MISSED_FRAME_AND_BUFF_OVERFLOW_COUNTER); - return (missed_frame_buff_overflow >> 17) & 0x7ff; -} - -/* - * syn_init_tx_desc_base() - * Programs the Dma Tx Base address with the starting address of the descriptor ring or chain. - */ -void syn_init_tx_desc_base(struct nss_gmac_hal_dev *nghd, uint32_t tx_desc_dma) -{ - hal_write_reg(nghd->mac_base, SYN_DMA_TX_DESCRIPTOR_LIST_ADDRESS, tx_desc_dma); -} - -/* - * syn_init_rx_desc_base() - * Programs the Dma Rx Base address with the starting address of the descriptor ring or chain. - */ -void syn_init_rx_desc_base(struct nss_gmac_hal_dev *nghd, uint32_t rx_desc_dma) -{ - hal_write_reg(nghd->mac_base, SYN_DMA_RX_DESCRIPTOR_LIST_ADDRESS, rx_desc_dma); -} - -/* - * syn_dma_axi_bus_mode_init() - * Function to program DMA AXI bus mode register. - */ -static inline void syn_dma_axi_bus_mode_init(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, SYN_DMA_AXI_BUS_MODE, - SYN_DMA_AXI_BUS_MODE_VAL); -} - -/* - * syn_dma_operation_mode_init() - * Function to program DMA Operation Mode register. - */ -static inline void syn_dma_operation_mode_init(struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, SYN_DMA_OPERATION_MODE, SYN_DMA_OMR); -} - -/* - * syn_broadcast_enable() - * Enables Broadcast frames. - * - * When enabled Address filtering module passes all incoming broadcast frames. - */ -static inline void syn_broadcast_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, SYN_MAC_FRAME_FILTER, SYN_MAC_BROADCAST); -} - -/* - * syn_multicast_enable() - * Enables Multicast frames. - * - * When enabled all multicast frames are passed. - */ -static inline void syn_multicast_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_FRAME_FILTER, SYN_MAC_MULTICAST_FILTER); -} - -/* - * syn_promisc_enable() - * Enables promiscous mode. - * - * When enabled Address filter modules pass all incoming frames - * regardless of their Destination and source addresses. - */ -static inline void syn_promisc_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_FRAME_FILTER, SYN_MAC_FILTER_OFF); - hal_set_reg_bits(nghd, SYN_MAC_FRAME_FILTER, - SYN_MAC_PROMISCUOUS_MODE_ON); -} - -/* - * syn_get_stats() - */ -static int syn_get_stats(struct nss_gmac_hal_dev *nghd) -{ - struct nss_dp_dev *dp_priv; - struct syn_hal_dev *shd; - struct nss_dp_gmac_stats *stats; - - BUG_ON(nghd == NULL); - - shd = (struct syn_hal_dev *)nghd; - stats = &(shd->stats); - - dp_priv = netdev_priv(nghd->netdev); - if (!dp_priv->data_plane_ops) - return -1; - - dp_priv->data_plane_ops->get_stats(dp_priv->dpc, stats); - - return 0; -} - -/* - * syn_rx_flow_control() - */ -static void syn_rx_flow_control(struct nss_gmac_hal_dev *nghd, - bool enabled) -{ - BUG_ON(nghd == NULL); - - if (enabled) - syn_set_rx_flow_ctrl(nghd); - else - syn_clear_rx_flow_ctrl(nghd); -} - -/* - * syn_tx_flow_control() - */ -static void syn_tx_flow_control(struct nss_gmac_hal_dev *nghd, - bool enabled) -{ - BUG_ON(nghd == NULL); - - if (enabled) - syn_set_tx_flow_ctrl(nghd); - else - syn_clear_tx_flow_ctrl(nghd); -} - -/* - * syn_get_max_frame_size() - */ -static int32_t syn_get_max_frame_size(struct nss_gmac_hal_dev *nghd) -{ - int ret; - uint32_t mtu; - - BUG_ON(nghd == NULL); - - ret = fal_port_max_frame_size_get(0, nghd->mac_id, &mtu); - - if (!ret) - return mtu; - - return ret; -} - -/* - * syn_set_max_frame_size() - */ -static int32_t syn_set_max_frame_size(struct nss_gmac_hal_dev *nghd, - uint32_t val) -{ - BUG_ON(nghd == NULL); - - return fal_port_max_frame_size_set(0, nghd->mac_id, val); -} - -/* - * syn_set_mac_speed() - */ -static int32_t syn_set_mac_speed(struct nss_gmac_hal_dev *nghd, - uint32_t mac_speed) -{ - struct net_device *netdev; - BUG_ON(nghd == NULL); - - netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * syn_get_mac_speed() - */ -static uint32_t syn_get_mac_speed(struct nss_gmac_hal_dev *nghd) -{ - struct net_device *netdev; - BUG_ON(nghd == NULL); - - netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * syn_set_duplex_mode() - */ -static void syn_set_duplex_mode(struct nss_gmac_hal_dev *nghd, - uint8_t duplex_mode) -{ - struct net_device *netdev; - BUG_ON(nghd == NULL); - - netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); -} - -/* - * syn_get_duplex_mode() - */ -static uint8_t syn_get_duplex_mode(struct nss_gmac_hal_dev *nghd) -{ - struct net_device *netdev; - BUG_ON(nghd == NULL); - - netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * syn_get_netdev_stats() - */ -static int syn_get_netdev_stats(struct nss_gmac_hal_dev *nghd, - struct rtnl_link_stats64 *stats) -{ - struct syn_hal_dev *shd; - struct nss_dp_hal_gmac_stats *ndo_stats; - - BUG_ON(nghd == NULL); - - shd = (struct syn_hal_dev *)nghd; - ndo_stats = &(shd->stats.stats); - - /* - * Read stats from the registered dataplane. - */ - if (syn_get_stats(nghd)) - return -1; - - stats->rx_packets = ndo_stats->rx_packets; - stats->rx_bytes = ndo_stats->rx_bytes; - stats->rx_errors = ndo_stats->rx_errors; - stats->rx_dropped = ndo_stats->rx_errors; - stats->rx_length_errors = ndo_stats->rx_length_errors; - stats->rx_over_errors = ndo_stats->mmc_rx_overflow_errors; - stats->rx_crc_errors = ndo_stats->mmc_rx_crc_errors; - stats->rx_frame_errors = ndo_stats->rx_dribble_bit_errors; - stats->rx_fifo_errors = ndo_stats->fifo_overflows; - stats->rx_missed_errors = ndo_stats->rx_missed; - stats->collisions = ndo_stats->tx_collisions + ndo_stats->rx_late_collision_errors; - stats->tx_packets = ndo_stats->tx_packets; - stats->tx_bytes = ndo_stats->tx_bytes; - stats->tx_errors = ndo_stats->tx_errors; - stats->tx_dropped = ndo_stats->tx_dropped; - stats->tx_carrier_errors = ndo_stats->tx_loss_of_carrier_errors + ndo_stats->tx_no_carrier_errors; - stats->tx_fifo_errors = ndo_stats->tx_underflow_errors; - stats->tx_window_errors = ndo_stats->tx_late_collision_errors; - - return 0; -} - -/* - * syn_get_eth_stats() - */ -static int32_t syn_get_eth_stats(struct nss_gmac_hal_dev *nghd, - uint64_t *data) -{ - struct syn_hal_dev *shd; - struct nss_dp_gmac_stats *stats; - uint8_t *p = NULL; - int i; - - BUG_ON(nghd == NULL); - - shd = (struct syn_hal_dev *)nghd; - stats = &(shd->stats); - - /* - * Read stats from the registered dataplane. - */ - if (syn_get_stats(nghd)) - return -1; - - for (i = 0; i < SYN_STATS_LEN; i++) { - p = ((uint8_t *)(stats) + - syn_gstrings_stats[i].stat_offset); - data[i] = *(uint32_t *)p; - } - - return 0; -} - -/* - * syn_get_strset_count() - */ -static int32_t syn_get_strset_count(struct nss_gmac_hal_dev *nghd, - int32_t sset) -{ - struct net_device *netdev; - BUG_ON(nghd == NULL); - - netdev = nghd->netdev; - - switch (sset) { - case ETH_SS_STATS: - return SYN_STATS_LEN; - } - - netdev_dbg(netdev, "%s: Invalid string set\n", __func__); - return -EPERM; -} - -/* - * syn_get_strings() - */ -static int32_t syn_get_strings(struct nss_gmac_hal_dev *nghd, - int32_t stringset, uint8_t *data) -{ - struct net_device *netdev; - int i; - - BUG_ON(nghd == NULL); - - netdev = nghd->netdev; - - switch (stringset) { - case ETH_SS_STATS: - for (i = 0; i < SYN_STATS_LEN; i++) { - memcpy(data, syn_gstrings_stats[i].stat_string, - ETH_GSTRING_LEN); - data += ETH_GSTRING_LEN; - } - break; - - default: - netdev_dbg(netdev, "%s: Invalid string set\n", __func__); - return -EPERM; - } - - return 0; -} - -/* - * syn_send_pause_frame() - */ -static void syn_send_pause_frame(struct nss_gmac_hal_dev *nghd) -{ - BUG_ON(nghd == NULL); - - syn_send_tx_pause_frame(nghd); -} - -/* - * syn_set_mac_address() - */ -static void syn_set_mac_address(struct nss_gmac_hal_dev *nghd, - uint8_t *macaddr) -{ - uint32_t data; - - BUG_ON(nghd == NULL); - - if (!macaddr) { - netdev_warn(nghd->netdev, "macaddr is not valid.\n"); - return; - } - - data = (macaddr[5] << 8) | macaddr[4] | SYN_MAC_ADDR_HIGH_AE; - hal_write_reg(nghd->mac_base, SYN_MAC_ADDR0_HIGH, data); - data = (macaddr[3] << 24) | (macaddr[2] << 16) | (macaddr[1] << 8) - | macaddr[0]; - hal_write_reg(nghd->mac_base, SYN_MAC_ADDR0_LOW, data); -} - -/* - * syn_get_mac_address() - */ -static void syn_get_mac_address(struct nss_gmac_hal_dev *nghd, - uint8_t *macaddr) -{ - uint32_t data; - - BUG_ON(nghd == NULL); - - if (!macaddr) { - netdev_warn(nghd->netdev, "macaddr is not valid.\n"); - return; - } - - data = hal_read_reg(nghd->mac_base, SYN_MAC_ADDR0_HIGH); - macaddr[5] = (data >> 8) & 0xff; - macaddr[4] = (data) & 0xff; - - data = hal_read_reg(nghd->mac_base, SYN_MAC_ADDR0_LOW); - macaddr[3] = (data >> 24) & 0xff; - macaddr[2] = (data >> 16) & 0xff; - macaddr[1] = (data >> 8) & 0xff; - macaddr[0] = (data) & 0xff; -} - -/* - * syn_dma_init() - * Initialize settings for GMAC DMA and AXI bus. - */ -static void syn_dma_init(struct nss_gmac_hal_dev *nghd) -{ - struct net_device *ndev = nghd->netdev; - struct nss_dp_dev *dp_priv = netdev_priv(ndev); - - /* - * Enable SoC specific GMAC clocks. - */ - nss_dp_hal_clk_enable(dp_priv); - - /* - * Configure DMA registers. - */ - syn_dma_bus_mode_init(nghd); - syn_dma_axi_bus_mode_init(nghd); - syn_dma_operation_mode_init(nghd); -} - -/* - * syn_init() - */ -static void *syn_init(struct gmac_hal_platform_data *gmacpdata) -{ - struct syn_hal_dev *shd = NULL; - struct net_device *ndev = NULL; - struct nss_dp_dev *dp_priv = NULL; - struct resource *res; - - ndev = gmacpdata->netdev; - dp_priv = netdev_priv(ndev); - - res = platform_get_resource(dp_priv->pdev, IORESOURCE_MEM, 0); - if (!res) { - netdev_dbg(ndev, "Resource get failed.\n"); - return NULL; - } - - shd = (struct syn_hal_dev *)devm_kzalloc(&dp_priv->pdev->dev, - sizeof(struct syn_hal_dev), - GFP_KERNEL); - if (!shd) { - netdev_dbg(ndev, "kzalloc failed. Returning...\n"); - return NULL; - } - - shd->nghd.mac_reg_len = resource_size(res); - shd->nghd.memres = devm_request_mem_region(&dp_priv->pdev->dev, - res->start, - resource_size(res), - ndev->name); - if (!shd->nghd.memres) { - netdev_dbg(ndev, "Request mem region failed. Returning...\n"); - devm_kfree(&dp_priv->pdev->dev, shd); - return NULL; - } - - /* - * Save netdev context in syn HAL context - */ - shd->nghd.netdev = gmacpdata->netdev; - shd->nghd.mac_id = gmacpdata->macid; - shd->nghd.duplex_mode = DUPLEX_FULL; - - set_bit(__NSS_DP_RXCSUM, &dp_priv->flags); - - /* - * Populate the mac base addresses - */ - shd->nghd.mac_base = - devm_ioremap_nocache(&dp_priv->pdev->dev, res->start, - resource_size(res)); - if (!shd->nghd.mac_base) { - netdev_dbg(ndev, "ioremap fail.\n"); - devm_kfree(&dp_priv->pdev->dev, shd); - return NULL; - } - - spin_lock_init(&shd->nghd.slock); - - netdev_dbg(ndev, "ioremap OK.Size 0x%x Ndev base 0x%lx macbase 0x%px\n", - gmacpdata->reg_len, - ndev->base_addr, - shd->nghd.mac_base); - - syn_disable_interrupt_all(&shd->nghd); - syn_dma_init(&shd->nghd); - syn_ipc_offload_init(&shd->nghd); - syn_promisc_enable(&shd->nghd); - syn_broadcast_enable(&shd->nghd); - syn_multicast_enable(&shd->nghd); - syn_rx_enable(&shd->nghd); - syn_tx_enable(&shd->nghd); - - /* - * Reset MIB Stats - */ - if (fal_mib_port_flush_counters(0, shd->nghd.mac_id)) { - netdev_dbg(ndev, "MIB stats Reset fail.\n"); - } - - return (struct nss_gmac_hal_dev *)shd; -} - -/* - * syn_exit() - */ -static void syn_exit(struct nss_gmac_hal_dev *nghd) -{ - struct nss_dp_dev *dp_priv = NULL; - - dp_priv = netdev_priv(nghd->netdev); - devm_iounmap(&dp_priv->pdev->dev, - (void *)nghd->mac_base); - devm_release_mem_region(&dp_priv->pdev->dev, - (nghd->memres)->start, - nghd->mac_reg_len); - - nghd->memres = NULL; - nghd->mac_base = NULL; -} - -struct nss_gmac_hal_ops syn_hal_ops = { - .init = &syn_init, - .start = NULL, - .stop = NULL, - .exit = &syn_exit, - .setmacaddr = &syn_set_mac_address, - .getmacaddr = &syn_get_mac_address, - .rxflowcontrol = &syn_rx_flow_control, - .txflowcontrol = &syn_tx_flow_control, - .setspeed = &syn_set_mac_speed, - .getspeed = &syn_get_mac_speed, - .setduplex = &syn_set_duplex_mode, - .getduplex = &syn_get_duplex_mode, - .setmaxframe = &syn_set_max_frame_size, - .getmaxframe = &syn_get_max_frame_size, - .getndostats = &syn_get_netdev_stats, - .getssetcount = &syn_get_strset_count, - .getstrings = &syn_get_strings, - .getethtoolstats = &syn_get_eth_stats, - .sendpause = &syn_send_pause_frame, -}; diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_reg.h b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_reg.h deleted file mode 100644 index aba916e4e..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/gmac/syn_reg.h +++ /dev/null @@ -1,531 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __SYN_REG_H__ -#define __SYN_REG_H__ - -/* - * MAC register offset - */ -#define SYN_MAC_CONFIGURATION 0x0000 -#define SYN_MAC_FRAME_FILTER 0x0004 -#define SYN_MAC_FLOW_CONTROL 0x0018 -#define SYN_VLAN_TAG 0x001C -#define SYN_VERSION 0x0020 -#define SYN_DEBUG 0x0024 -#define SYN_REMOTE_WAKE_UP_FRAME_FILTER 0x0028 -#define SYN_PMT_CONTROL_STATUS 0x002C -#define SYN_LPI_CONTROL_STATUS 0x0030 -#define SYN_LPI_TIMERS_CONTROL 0x0034 -#define SYN_INTERRUPT_STATUS 0x0038 -#define SYN_INTERRUPT_MASK 0x003C - -/* - * MAC address register offset - */ -#define SYN_MAC_ADDR0_HIGH 0x0040 -#define SYN_MAC_ADDR0_LOW 0x0044 -#define SYN_MAC_ADDR1_HIGH 0x0048 -#define SYN_MAC_ADDR1_LOW 0x004C -#define SYN_MAC_ADDR2_HIGH 0x0050 -#define SYN_MAC_ADDR2_LOW 0x0054 -#define SYN_MAC_ADDR3_HIGH 0x0058 -#define SYN_MAC_ADDR3_LOW 0x005C -#define SYN_MAC_ADDR4_HIGH 0x0060 -#define SYN_MAC_ADDR4_LOW 0x0064 - -/* - * Watchdog timeout register - */ -#define SYN_WDOG_TIMEOUT 0x00DC - -/* - * Mac Management Counters (MMC) register offset - */ -#define SYN_MMC_CONTROL 0x0100 -#define SYN_MMC_RX_INTERRUPT 0x0104 -#define SYN_MMC_TX_INTERRUPT 0x0108 -#define SYN_MMC_RX_INTERRUPT_MASK 0x010C -#define SYN_MMC_TX_INTERRUPT_MASK 0x0110 -#define SYN_MMC_IPC_RX_INTR_MASK 0x0200 - -/* - * DMA Register offset - */ -#define SYN_DMA_BUS_MODE 0x1000 -#define SYN_DMA_TX_POLL_DEMAND 0x1004 -#define SYN_DMA_RX_POLL_DEMAND 0x1008 -#define SYN_DMA_RX_DESCRIPTOR_LIST_ADDRESS 0x100C -#define SYN_DMA_TX_DESCRIPTOR_LIST_ADDRESS 0x1010 -#define SYN_DMA_STATUS 0x1014 -#define SYN_DMA_OPERATION_MODE 0x1018 -#define SYN_DMA_INT_ENABLE 0x101C -#define SYN_DMA_MISSED_FRAME_AND_BUFF_OVERFLOW_COUNTER 0x1020 -#define SYN_DMA_RX_INTERRUPT_WATCHDOG_TIMER 0x1024 -#define SYN_DMA_AXI_BUS_MODE 0x1028 -#define SYN_DMA_AHB_OR_AXI_STATUS 0x102C -#define SYN_DMA_CURRENT_HOST_TX_DESCRIPTOR 0x1048 -#define SYN_DMA_CURRENT_HOST_RX_DESCRIPTOR 0x104C -#define SYN_DMA_CURRENT_HOST_TX_BUFFER_ADDRESS 0x1050 -#define SYN_DMA_CURRENT_HOST_RX_BUFFER_ADDRESS 0x1054 - -/* - * Optional HW feature register - */ -#define SYN_HW_FEATURE 0x1058 - -/* - * Register Bit Definitions - */ - -/* - * SYN_MAC_CONFIGURATION = 0x0000, MAC config Register Layout - */ -enum syn_mac_config_reg { - SYN_MAC_TWOKPE = 0x08000000, /* Support for 2K packets */ - SYN_MAC_TWOKPE_ENABLE = 0x08000000, - SYN_MAC_TWOKPE_DISABLE = 0x00000000, - SYN_MAC_CST = 0x02000000, /* (CST) CRC Stripping for Type Frames */ - SYN_MAC_CST_ENABLE = 0x02000000, - SYN_MAC_CST_DISABLE = 0x02000000, - SYN_MAC_TC = 0x01000000, /* (TC) Transmit configuration */ - SYN_MAC_WATCHDOG = 0x00800000, - SYN_MAC_WATCHDOG_ENABLE = 0x00000000, /* Enable watchdog timer */ - SYN_MAC_WATCHDOG_DISABLE = 0x00800000, /* (WD)Disable watchdog timer on Rx */ - SYN_MAC_JABBER = 0x00400000, - SYN_MAC_JABBER_ENABLE = 0x00000000, /* Enable jabber timer */ - SYN_MAC_JABBER_DISABLE = 0x00400000, /* (JD)Disable jabber timer on Tx */ - SYN_MAC_FRAME_BURST = 0x00200000, - SYN_MAC_FRAME_BURST_ENABLE = 0x00200000, /* (BE)Enable frame bursting - during Tx */ - SYN_MAC_FRAME_BURST_DISABLE = 0x00000000, /* Disable frame bursting */ - SYN_MAC_JUMBO_FRAME = 0x00100000, - SYN_MAC_JUMBO_FRAME_ENABLE = 0x00100000, /* (JE)Enable jumbo frame for Rx */ - SYN_MAC_JUMBO_FRAME_DISABLE = 0x00000000, /* Disable jumbo frame */ - SYN_MAC_INTER_FRAME_GAP7 = 0x000E0000, /* (IFG) Config7 - 40bit times */ - SYN_MAC_INTER_FRAME_GAP6 = 0x000C0000, /* (IFG) Config6 - 48bit times */ - SYN_MAC_INTER_FRAME_GAP5 = 0x000A0000, /* (IFG) Config5 - 56bit times */ - SYN_MAC_INTER_FRAME_GAP4 = 0x00080000, /* (IFG) Config4 - 64bit times */ - SYN_MAC_INTER_FRAME_GAP3 = 0x00060000, /* (IFG) Config3 - 72bit times */ - SYN_MAC_INTER_FRAME_GAP2 = 0x00040000, /* (IFG) Config2 - 80bit times */ - SYN_MAC_INTER_FRAME_GAP1 = 0x00020000, /* (IFG) Config1 - 88bit times */ - SYN_MAC_INTER_FRAME_GAP0 = 0x00000000, /* (IFG) Config0 - 96bit times */ - SYN_MAC_DISABLE_CRS = 0x00010000, /* (DCRS) Disable Carrier Sense During Transmission */ - SYN_MAC_MII_GMII = 0x00008000, - SYN_MAC_SELECT_MII = 0x00008000, /* (PS)Port Select-MII mode */ - SYN_MAC_SELECT_GMII = 0x00000000, /* GMII mode */ - SYN_MAC_FE_SPEED100 = 0x00004000, /* (FES)Fast Ethernet speed 100Mbps */ - SYN_MAC_FE_SPEED = 0x00004000, /* (FES)Fast Ethernet speed 100Mbps */ - SYN_MAC_FE_SPEED10 = 0x00000000, /* (FES)Fast Ethernet speed 10Mbps */ - SYN_MAC_RX_OWN = 0x00002000, - SYN_MAC_DISABLE_RX_OWN = 0x00002000, /* (DO)Disable receive own packets */ - SYN_MAC_ENABLE_RX_OWN = 0x00000000, /* Enable receive own packets */ - SYN_MAC_LOOPBACK = 0x00001000, - SYN_MAC_LOOPBACK_ON = 0x00001000, /* (LM)Loopback mode for GMII/MII */ - SYN_MAC_LOOPBACK_OFF = 0x00000000, /* Normal mode */ - SYN_MAC_DUPLEX = 0x00000800, - SYN_MAC_FULL_DUPLEX = 0x00000800, /* (DM)Full duplex mode */ - SYN_MAC_HALF_DUPLEX = 0x00000000, /* Half duplex mode */ - SYN_MAC_RX_IPC_OFFLOAD = 0x00000400, /* IPC checksum offload */ - SYN_MAC_RX_IPC_OFFLOAD_ENABLE = 0x00000400, - SYN_MAC_RX_IPC_OFFLOAD_DISABLE = 0x00000000, - SYN_MAC_RETRY = 0x00000200, - SYN_MAC_RETRY_DISABLE = 0x00000200, /* (DR)Disable Retry */ - SYN_MAC_RETRY_ENABLE = 0x00000000, /* Enable retransmission as per BL */ - SYN_MAC_LINK_UP = 0x00000100, /* (LUD)Link UP */ - SYN_MAC_LINK_DOWN = 0x00000100, /* Link Down */ - SYN_MAC_PAD_CRC_STRIP = 0x00000080, - SYN_MAC_PAD_CRC_STRIP_ENABLE = 0x00000080, /* (ACS) Automatic Pad/Crc strip enable */ - SYN_MAC_PAD_CRC_STRIP_DISABLE = 0x00000000, /* Automatic Pad/Crc stripping disable */ - SYN_MAC_BACKOFF_LIMIT = 0x00000060, - SYN_MAC_BACKOFF_LIMIT3 = 0x00000060, /* (BL)Back-off limit in HD mode */ - SYN_MAC_BACKOFF_LIMIT2 = 0x00000040, - SYN_MAC_BACKOFF_LIMIT1 = 0x00000020, - SYN_MAC_BACKOFF_LIMIT0 = 0x00000000, - SYN_MAC_DEFERRAL_CHECK = 0x00000010, - SYN_MAC_DEFERRAL_CHECK_ENABLE = 0x00000010, /* (DC)Deferral check enable in HD mode */ - SYN_MAC_DEFERRAL_CHECK_DISABLE = 0x00000000, /* Deferral check disable */ - SYN_MAC_TX = 0x00000008, - SYN_MAC_TX_ENABLE = 0x00000008, /* (TE)Transmitter enable */ - SYN_MAC_TX_DISABLE = 0x00000000, /* Transmitter disable */ - SYN_MAC_RX = 0x00000004, - SYN_MAC_RX_ENABLE = 0x00000004, /* (RE)Receiver enable */ - SYN_MAC_RX_DISABLE = 0x00000000, /* Receiver disable */ - SYN_MAC_PRELEN_RESERVED = 0x00000003, /* Preamble Length for Transmit Frames */ - SYN_MAC_PRELEN_3B = 0x00000002, - SYN_MAC_PRELEN_5B = 0x00000001, - SYN_MAC_PRELEN_7B = 0x00000000, -}; - -/* - * SYN_MAC_FRAME_FILTER = 0x0004, Mac frame filtering controls Register - */ -enum syn_mac_frame_filter_reg { - SYN_MAC_FILTER = 0x80000000, - SYN_MAC_FILTER_OFF = 0x80000000, /* (RA)Receive all incoming packets */ - SYN_MAC_FILTER_ON = 0x00000000, /* Receive filtered pkts only */ - SYN_MAC_HASH_PERFECT_FILTER = 0x00000400, /* Hash or Perfect Filter enable */ - SYN_MAC_SRC_ADDR_FILTER = 0x00000200, - SYN_MAC_SRC_ADDR_FILTER_ENABLE = 0x00000200, /* (SAF)Source Address Filter enable */ - SYN_MAC_SRC_ADDR_FILTER_DISABLE = 0x00000000, - SYN_MAC_SRC_INVA_ADDR_FILTER = 0x00000100, - SYN_MAC_SRC_INV_ADDR_FILTER_EN = 0x00000100, /* (SAIF)Inv Src Addr Filter enable */ - SYN_MAC_SRC_INV_ADDR_FILTER_DIS = 0x00000000, - SYN_MAC_PASS_CONTROL = 0x000000C0, - SYN_MAC_PASS_CONTROL3 = 0x000000C0, /* (PCF)Forwards ctrl frames that pass AF */ - SYN_MAC_PASS_CONTROL2 = 0x00000080, /* Forwards all control frames - even if they fail the AF */ - SYN_MAC_PASS_CONTROL1 = 0x00000040, /* Forwards all control frames except - PAUSE control frames to application - even if they fail the AF */ - SYN_MAC_PASS_CONTROL0 = 0x00000000, /* Don't pass control frames */ - SYN_MAC_BROADCAST = 0x00000020, - SYN_MAC_BROADCAST_DISABLE = 0x00000020, /* (DBF)Disable Rx of broadcast frames */ - SYN_MAC_BROADCAST_ENABLE = 0x00000000, /* Enable broadcast frames */ - SYN_MAC_MULTICAST_FILTER = 0x00000010, - SYN_MAC_MULTICAST_FILTER_OFF = 0x00000010, /* (PM) Pass all multicast packets */ - SYN_MAC_MULTICAST_FILTER_ON = 0x00000000, /* Pass filtered multicast packets */ - SYN_MAC_DEST_ADDR_FILTER = 0x00000008, - SYN_MAC_DEST_ADDR_FILTER_INV = 0x00000008, /* (DAIF)Inverse filtering for DA */ - SYN_MAC_DEST_ADDR_FILTER_NOR = 0x00000000, /* Normal filtering for DA */ - SYN_MAC_MCAST_HASH_FILTER = 0x00000004, - SYN_MAC_MCAST_HASH_FILTER_ON = 0x00000004, /* (HMC)perfom multicast hash filtering */ - SYN_MAC_MCAST_HASH_FILTER_OFF = 0x00000000, /* perfect filtering only */ - SYN_MAC_UCAST_HASH_FILTER = 0x00000002, - SYN_MAC_UCAST_HASH_FILTER_ON = 0x00000002, /* (HUC)Unicast Hash filtering only */ - SYN_MAC_UCAST_HASH_FILTER_OFF = 0x00000000, /* perfect filtering only */ - SYN_MAC_PROMISCUOUS_MODE = 0x00000001, - SYN_MAC_PROMISCUOUS_MODE_ON = 0x00000001, /* Receive all frames */ - SYN_MAC_PROMISCUOUS_MODE_OFF = 0x00000000, /* Receive filtered packets only */ -}; - -/* - * SYN_MAC_FLOW_CONTROL = 0x0018, Flow control Register Layout - */ -enum syn_mac_flow_control_reg { - SYN_MAC_FC_PAUSE_TIME_MASK = 0xFFFF0000, /* (PT) PAUSE TIME field - in the control frame */ - SYN_MAC_FC_PAUSE_TIME_SHIFT = 16, - SYN_MAC_FC_PAUSE_LOW_THRESH = 0x00000030, - SYN_MAC_FC_PAUSE_LOW_THRESH3 = 0x00000030, /* (PLT)thresh for pause - tmr 256 slot time */ - SYN_MAC_FC_PAUSE_LOW_THRESH2 = 0x00000020, /* 144 slot time */ - SYN_MAC_FC_PAUSE_LOW_THRESH1 = 0x00000010, /* 28 slot time */ - SYN_MAC_FC_PAUSE_LOW_THRESH0 = 0x00000000, /* 4 slot time */ - SYN_MAC_FC_UNICAST_PAUSE_FRAME = 0x00000008, - SYN_MAC_FC_UNICAST_PAUSE_FRAME_ON = 0x00000008, /* (UP)Detect pause frame - with unicast addr. */ - SYN_MAC_FC_UNICAST_PAUSE_FRAME_OFF = 0x00000000,/* Detect only pause frame - with multicast addr. */ - SYN_MAC_FC_RX_FLOW_CONTROL = 0x00000004, - SYN_MAC_FC_RX_FLOW_CONTROL_ENABLE = 0x00000004, /* (RFE)Enable Rx flow control */ - SYN_MAC_FC_RX_FLOW_CONTROL_DISABLE = 0x00000000,/* Disable Rx flow control */ - SYN_MAC_FC_TX_FLOW_CONTROL = 0x00000002, - SYN_MAC_FC_TX_FLOW_CONTROL_ENABLE = 0x00000002, /* (TFE)Enable Tx flow control */ - SYN_MAC_FC_TX_FLOW_CONTROL_DISABLE = 0x00000000,/* Disable flow control */ - SYN_MAC_FC_FLOW_CONTROL_BACK_PRESSURE = 0x00000001, - SYN_MAC_FC_SEND_PAUSE_FRAME = 0x00000001, /* (FCB/PBA)send pause frm/Apply - back pressure */ -}; - -/* - * SYN_MAC_ADDR_HIGH Register - */ -enum syn_mac_addr_high { - SYN_MAC_ADDR_HIGH_AE = 0x80000000, -}; - -/* - * SYN_DMA_BUS_MODE = 0x0000, CSR0 - Bus Mode - */ -enum syn_dma_bus_mode_reg { - SYN_DMA_FIXED_BURST_ENABLE = 0x00010000, /* (FB)Fixed Burst SINGLE, INCR4, - INCR8 or INCR16 */ - SYN_DMA_FIXED_BURST_DISABLE = 0x00000000, /* SINGLE, INCR */ - SYN_DMA_TX_PRIORITY_RATIO11 = 0x00000000, /* (PR)TX:RX DMA priority ratio 1:1 */ - SYN_DMA_TX_PRIORITY_RATIO21 = 0x00004000, /* (PR)TX:RX DMA priority ratio 2:1 */ - SYN_DMA_TX_PRIORITY_RATIO31 = 0x00008000, /* (PR)TX:RX DMA priority ratio 3:1 */ - SYN_DMA_TX_PRIORITY_RATIO41 = 0x0000C000, /* (PR)TX:RX DMA priority ratio 4:1 */ - SYN_DMA_ADDRESS_ALIGNED_BEATS = 0x02000000, /* Address Aligned beats */ - SYN_DMA_BURST_LENGTHX8 = 0x01000000, /* When set mutiplies the PBL by 8 */ - SYN_DMA_BURST_LENGTH256 = 0x01002000, /* (dma_burst_lengthx8 | - dma_burst_length32) = 256 */ - SYN_DMA_BURST_LENGTH128 = 0x01001000, /* (dma_burst_lengthx8 | - dma_burst_length16) = 128 */ - SYN_DMA_BURST_LENGTH64 = 0x01000800, /* (dma_burst_lengthx8 | - dma_burst_length8) = 64 */ - /* (PBL) programmable burst length */ - SYN_DMA_BURST_LENGTH32 = 0x00002000, /* Dma burst length = 32 */ - SYN_DMA_BURST_LENGTH16 = 0x00001000, /* Dma burst length = 16 */ - SYN_DMA_BURST_LENGTH8 = 0x00000800, /* Dma burst length = 8 */ - SYN_DMA_BURST_LENGTH4 = 0x00000400, /* Dma burst length = 4 */ - SYN_DMA_BURST_LENGTH2 = 0x00000200, /* Dma burst length = 2 */ - SYN_DMA_BURST_LENGTH1 = 0x00000100, /* Dma burst length = 1 */ - SYN_DMA_BURST_LENGTH0 = 0x00000000, /* Dma burst length = 0 */ - - SYN_DMA_DESCRIPTOR8_WORDS = 0x00000080, /* Enh Descriptor works 1=> - 8 word descriptor */ - SYN_DMA_DESCRIPTOR4_WORDS = 0x00000000, /* Enh Descriptor works 0=> - 4 word descriptor */ - SYN_DMA_DESCRIPTOR_SKIP16 = 0x00000040, /* (DSL)Descriptor skip length (no.of dwords) */ - SYN_DMA_DESCRIPTOR_SKIP8 = 0x00000020, /* between two unchained descriptors */ - SYN_DMA_DESCRIPTOR_SKIP4 = 0x00000010, - SYN_DMA_DESCRIPTOR_SKIP2 = 0x00000008, - SYN_DMA_DESCRIPTOR_SKIP1 = 0x00000004, - SYN_DMA_DESCRIPTOR_SKIP0 = 0x00000000, - SYN_DMA_ARBIT_RR = 0x00000000, /* (DA) DMA RR arbitration */ - SYN_DMA_ARBIT_PR = 0x00000002, /* Rx has priority over Tx */ - SYN_DMA_RESET_ON = 0x00000001, /* (SWR)Software Reset DMA engine */ - SYN_DMA_RESET_OFF = 0x00000000, -}; - -/* - * SYN_DMA_STATUS = 0x0014, CSR5 - Dma status Register - */ -enum syn_dma_status_reg { - SYN_DMA_GMAC_PMT_INTR = 0x10000000, /* (GPI)Gmac subsystem interrupt */ - SYN_DMA_GMAC_MMC_INTR = 0x08000000, /* (GMI)Gmac MMC subsystem interrupt */ - SYN_DMA_GMAC_LINE_INTF_INTR = 0x04000000, /* Line interface interrupt */ - SYN_DMA_ERROR_BIT2 = 0x02000000, /* (EB)Error bits 0-data buffer, 1-desc access */ - SYN_DMA_ERROR_BIT1 = 0x01000000, /* (EB)Error bits 0-write trnsf, 1-read transfer */ - SYN_DMA_ERROR_BIT0 = 0x00800000, /* (EB)Error bits 0-Rx DMA, 1-Tx DMA */ - SYN_DMA_TX_STATE = 0x00700000, /* (TS)Transmit process state */ - SYN_DMA_TX_STOPPED = 0x00000000, /* Stopped - Reset or Stop Tx Command issued */ - SYN_DMA_TX_FETCHING = 0x00100000, /* Running - fetching the Tx descriptor */ - SYN_DMA_TX_WAITING = 0x00200000, /* Running - waiting for status */ - SYN_DMA_TX_READING = 0x00300000, /* Running - reading the data from host memory */ - SYN_DMA_TX_SUSPENDED = 0x00600000, /* Suspended - Tx Descriptor unavailabe */ - SYN_DMA_TX_CLOSING = 0x00700000, /* Running - closing Rx descriptor */ - SYN_DMA_RX_STATE = 0x000E0000, /* (RS)Receive process state */ - SYN_DMA_RX_STOPPED = 0x00000000, /* Stopped - Reset or Stop Rx Command issued */ - SYN_DMA_RX_FETCHING = 0x00020000, /* Running - fetching the Rx descriptor */ - SYN_DMA_RX_WAITING = 0x00060000, /* Running - waiting for packet */ - SYN_DMA_RX_SUSPENDED = 0x00080000, /* Suspended - Rx Descriptor unavailable */ - SYN_DMA_RX_CLOSING = 0x000A0000, /* Running - closing descriptor */ - SYN_DMA_RX_QUEUING = 0x000E0000, /* Running - queuing the receive frame into host memory */ - SYN_DMA_INT_NORMAL = 0x00010000, /* (NIS)Normal interrupt summary */ - SYN_DMA_INT_ABNORMAL = 0x00008000, /* (AIS)Abnormal interrupt summary */ - SYN_DMA_INT_EARLY_RX = 0x00004000, /* Early receive interrupt (Normal) */ - SYN_DMA_INT_BUS_ERROR = 0x00002000, /* Fatal bus error (Abnormal) */ - SYN_DMA_INT_EARLY_TX = 0x00000400, /* Early transmit interrupt (Abnormal) */ - SYN_DMA_INT_RX_WDOG_TO = 0x00000200, /* Receive Watchdog Timeout (Abnormal) */ - SYN_DMA_INT_RX_STOPPED = 0x00000100, /* Receive process stopped (Abnormal) */ - SYN_DMA_INT_RX_NO_BUFFER = 0x00000080, /* RX buffer unavailable (Abnormal) */ - SYN_DMA_INT_RX_COMPLETED = 0x00000040, /* Completion of frame RX (Normal) */ - SYN_DMA_INT_TX_UNDERFLOW = 0x00000020, /* Transmit underflow (Abnormal) */ - SYN_DMA_INT_RCV_OVERFLOW = 0x00000010, /* RX Buffer overflow interrupt */ - SYN_DMA_INT_TX_JABBER_TO = 0x00000008, /* TX Jabber Timeout (Abnormal) */ - SYN_DMA_INT_TX_NO_BUFFER = 0x00000004, /* TX buffer unavailable (Normal) */ - SYN_DMA_INT_TX_STOPPED = 0x00000002, /* TX process stopped (Abnormal) */ - SYN_DMA_INT_TX_COMPLETED = 0x00000001, /* Transmit completed (Normal) */ -}; - -/* - * SYN_DMA_OPERATION_MODE = 0x0018, CSR6 - Dma Operation Mode Register - */ -enum syn_dma_operation_mode_reg { - SYN_DMA_DISABLE_DROP_TCP_CS = 0x04000000, /* (DT) Dis. drop. of tcp/ip - CS error frames */ - SYN_DMA_RX_STORE_AND_FORWARD = 0x02000000, /* Rx (SF)Store and forward */ - SYN_DMA_RX_FRAME_FLUSH = 0x01000000, /* Disable Receive Frame Flush*/ - SYN_DMA_TX_STORE_AND_FORWARD = 0x00200000, /* Tx (SF)Store and forward */ - SYN_DMA_FLUSH_TX_FIFO = 0x00100000, /* (FTF)Tx FIFO controller - is reset to default */ - SYN_DMA_TX_THRESH_CTRL = 0x0001C000, /* (TTC)Controls thre Thresh of - MTL tx Fifo */ - SYN_DMA_TX_THRESH_CTRL16 = 0x0001C000, /* (TTC)Controls thre Thresh of - MTL tx Fifo 16 */ - SYN_DMA_TX_THRESH_CTRL24 = 0x00018000, /* (TTC)Controls thre Thresh of - MTL tx Fifo 24 */ - SYN_DMA_TX_THRESH_CTRL32 = 0x00014000, /* (TTC)Controls thre Thresh of - MTL tx Fifo 32 */ - SYN_DMA_TX_THRESH_CTRL40 = 0x00010000, /* (TTC)Controls thre Thresh of - MTL tx Fifo 40 */ - SYN_DMA_TX_THRESH_CTRL256 = 0x0000c000, /* (TTC)Controls thre Thresh of - MTL tx Fifo 256 */ - SYN_DMA_TX_THRESH_CTRL192 = 0x00008000, /* (TTC)Controls thre Thresh of - MTL tx Fifo 192 */ - SYN_DMA_TX_THRESH_CTRL128 = 0x00004000, /* (TTC)Controls thre Thresh of - MTL tx Fifo 128 */ - SYN_DMA_TX_THRESH_CTRL64 = 0x00000000, /* (TTC)Controls thre Thresh of - MTL tx Fifo 64 */ - SYN_DMA_TX_START = 0x00002000, /* (ST)Start/Stop transmission*/ - SYN_DMA_RX_FLOW_CTRL_DEACT = 0x00401800, /* (RFD)Rx flow control - deact. Threshold */ - SYN_DMA_RX_FLOW_CTRL_DEACT1K = 0x00000000, /* (RFD)Rx flow control - deact. Threshold (1kbytes) */ - SYN_DMA_RX_FLOW_CTRL_DEACT2K = 0x00000800, /* (RFD)Rx flow control - deact. Threshold (2kbytes) */ - SYN_DMA_RX_FLOW_CTRL_DEACT3K = 0x00001000, /* (RFD)Rx flow control - deact. Threshold (3kbytes) */ - SYN_DMA_RX_FLOW_CTRL_DEACT4K = 0x00001800, /* (RFD)Rx flow control - deact. Threshold (4kbytes) */ - SYN_DMA_RX_FLOW_CTRL_DEACT5K = 0x00400000, /* (RFD)Rx flow control - deact. Threshold (4kbytes) */ - SYN_DMA_RX_FLOW_CTRL_DEACT6K = 0x00400800, /* (RFD)Rx flow control - deact. Threshold (4kbytes) */ - SYN_DMA_RX_FLOW_CTRL_DEACT7K = 0x00401000, /* (RFD)Rx flow control - deact. Threshold (4kbytes) */ - SYN_DMA_RX_FLOW_CTRL_ACT = 0x00800600, /* (RFA)Rx flow control - Act. Threshold */ - SYN_DMA_RX_FLOW_CTRL_ACT1K = 0x00000000, /* (RFA)Rx flow control - Act. Threshold (1kbytes) */ - SYN_DMA_RX_FLOW_CTRL_ACT2K = 0x00000200, /* (RFA)Rx flow control - Act. Threshold (2kbytes) */ - SYN_DMA_RX_FLOW_CTRL_ACT3K = 0x00000400, /* (RFA)Rx flow control - Act. Threshold (3kbytes) */ - SYN_DMA_RX_FLOW_CTRL_ACT4K = 0x00000600, /* (RFA)Rx flow control - Act. Threshold (4kbytes) */ - SYN_DMA_RX_FLOW_CTRL_ACT5K = 0x00800000, /* (RFA)Rx flow control - Act. Threshold (5kbytes) */ - SYN_DMA_RX_FLOW_CTRL_ACT6K = 0x00800200, /* (RFA)Rx flow control - Act. Threshold (6kbytes) */ - SYN_DMA_RX_FLOW_CTRL_ACT7K = 0x00800400, /* (RFA)Rx flow control - Act. Threshold (7kbytes) */ - SYN_DMA_RX_THRESH_CTRL = 0x00000018, /* (RTC)Controls thre - Thresh of MTL rx Fifo */ - SYN_DMA_RX_THRESH_CTRL64 = 0x00000000, /* (RTC)Controls thre - Thresh of MTL tx Fifo 64 */ - SYN_DMA_RX_THRESH_CTRL32 = 0x00000008, /* (RTC)Controls thre - Thresh of MTL tx Fifo 32 */ - SYN_DMA_RX_THRESH_CTRL96 = 0x00000010, /* (RTC)Controls thre - Thresh of MTL tx Fifo 96 */ - SYN_DMA_RX_THRESH_CTRL128 = 0x00000018, /* (RTC)Controls thre - Thresh of MTL tx Fifo 128 */ - SYN_DMA_EN_HW_FLOW_CTRL = 0x00000100, /* (EFC)Enable HW flow control*/ - SYN_DMA_DIS_HW_FLOW_CTRL = 0x00000000, /* Disable HW flow control */ - SYN_DMA_FWD_ERROR_FRAMES = 0x00000080, /* (FEF)Forward error frames */ - SYN_DMA_FWD_UNDER_SZ_FRAMES = 0x00000040, /* (FUF)Forward undersize - frames */ - SYN_DMA_TX_SECOND_FRAME = 0x00000004, /* (OSF)Operate on 2nd frame */ - SYN_DMA_RX_START = 0x00000002, /* (SR)Start/Stop reception */ -}; - -/* - * SYN_DMA_INT_ENABLE = 0x101C, CSR7 - Interrupt enable Register Layout - */ -enum syn_dma_interrupt_reg { - SYN_DMA_IE_NORMAL = SYN_DMA_INT_NORMAL, /* Normal interrupt enable */ - SYN_DMA_IE_ABNORMAL = SYN_DMA_INT_ABNORMAL, /* Abnormal interrupt enable */ - SYN_DMA_IE_EARLY_RX = SYN_DMA_INT_EARLY_RX, /* Early RX interrupt enable */ - SYN_DMA_IE_BUS_ERROR = SYN_DMA_INT_BUS_ERROR, /* Fatal bus error enable */ - SYN_DMA_IE_EARLY_TX = SYN_DMA_INT_EARLY_TX, /* Early TX interrupt enable */ - SYN_DMA_IE_RX_WDOG_TO = SYN_DMA_INT_RX_WDOG_TO, /* RX Watchdog Timeout enable */ - SYN_DMA_IE_RX_STOPPED = SYN_DMA_INT_RX_STOPPED, /* RX process stopped enable */ - SYN_DMA_IE_RX_NO_BUFFER = SYN_DMA_INT_RX_NO_BUFFER, - /* Receive buffer unavailable enable */ - SYN_DMA_IE_RX_COMPLETED = SYN_DMA_INT_RX_COMPLETED, - /* Completion of frame reception enable */ - SYN_DMA_IE_TX_UNDERFLOW = SYN_DMA_INT_TX_UNDERFLOW, - /* TX underflow enable */ - SYN_DMA_IE_RX_OVERFLOW = SYN_DMA_INT_RCV_OVERFLOW, - /* RX Buffer overflow interrupt */ - SYN_DMA_IE_TX_JABBER_TO = SYN_DMA_INT_TX_JABBER_TO, - /* TX Jabber Timeout enable */ - SYN_DMA_IE_TX_NO_BUFFER = SYN_DMA_INT_TX_NO_BUFFER, - /* TX buffer unavailable enable */ - SYN_DMA_IE_TX_STOPPED = SYN_DMA_INT_TX_STOPPED, - /* TX process stopped enable */ - SYN_DMA_IE_TX_COMPLETED = SYN_DMA_INT_TX_COMPLETED, - /* TX completed enable */ -}; - -/* - * SYN_DMA_AXI_BUS_MODE = 0x1028 - */ -enum syn_dma_axi_bus_mode_reg { - SYN_DMA_EN_LPI = 0x80000000, - SYN_DMA_LPI_XIT_FRM = 0x40000000, - SYN_DMA_WR_OSR_NUM_REQS16 = 0x00F00000, - SYN_DMA_WR_OSR_NUM_REQS8 = 0x00700000, - SYN_DMA_WR_OSR_NUM_REQS4 = 0x00300000, - SYN_DMA_WR_OSR_NUM_REQS2 = 0x00100000, - SYN_DMA_WR_OSR_NUM_REQS1 = 0x00000000, - SYN_DMA_RD_OSR_NUM_REQS16 = 0x000F0000, - SYN_DMA_RD_OSR_NUM_REQS8 = 0x00070000, - SYN_DMA_RD_OSR_NUM_REQS4 = 0x00030000, - SYN_DMA_RD_OSR_NUM_REQS2 = 0x00010000, - SYN_DMA_RD_OSR_NUM_REQS1 = 0x00000000, - SYN_DMA_ONEKBBE = 0x00002000, - SYN_DMA_AXI_AAL = 0x00001000, - SYN_DMA_AXI_BLEN256 = 0x00000080, - SYN_DMA_AXI_BLEN128 = 0x00000040, - SYN_DMA_AXI_BLEN64 = 0x00000020, - SYN_DMA_AXI_BLEN32 = 0x00000010, - SYN_DMA_AXI_BLEN16 = 0x00000008, - SYN_DMA_AXI_BLEN8 = 0x00000004, - SYN_DMA_AXI_BLEN4 = 0x00000002, - SYN_DMA_UNDEFINED = 0x00000001, -}; - -/* - * Values to initialize DMA registers - */ -enum syn_dma_init_values { - /* - * Interrupt groups - */ - SYN_DMA_INT_ERROR_MASK = SYN_DMA_INT_BUS_ERROR, /* Error */ - SYN_DMA_INT_RX_ABN_MASK = SYN_DMA_INT_RX_NO_BUFFER, /* RX abnormal intr */ - SYN_DMA_INT_RX_NORM_MASK = SYN_DMA_INT_RX_COMPLETED, /* RXnormal intr */ - SYN_DMA_INT_RX_STOPPED_MASK = SYN_DMA_INT_RX_STOPPED, /* RXstopped */ - SYN_DMA_INT_TX_ABN_MASK = SYN_DMA_INT_TX_UNDERFLOW, /* TX abnormal intr */ - SYN_DMA_INT_TX_NORM_MASK = SYN_DMA_INT_TX_COMPLETED, /* TX normal intr */ - SYN_DMA_INT_TX_STOPPED_MASK = SYN_DMA_INT_TX_STOPPED, /* TX stopped */ - - SYN_DMA_BUS_MODE_INIT = SYN_DMA_FIXED_BURST_ENABLE | SYN_DMA_BURST_LENGTH8 - | SYN_DMA_DESCRIPTOR_SKIP2 | SYN_DMA_RESET_OFF, - - SYN_DMA_BUS_MODE_VAL = SYN_DMA_BURST_LENGTH32 - | SYN_DMA_BURST_LENGTHX8 | SYN_DMA_DESCRIPTOR_SKIP0 - | SYN_DMA_DESCRIPTOR8_WORDS | SYN_DMA_ARBIT_PR | SYN_DMA_ADDRESS_ALIGNED_BEATS, - - SYN_DMA_OMR = SYN_DMA_TX_STORE_AND_FORWARD | SYN_DMA_RX_STORE_AND_FORWARD - | SYN_DMA_RX_THRESH_CTRL128 | SYN_DMA_TX_SECOND_FRAME, - - SYN_DMA_INT_EN = SYN_DMA_IE_NORMAL | SYN_DMA_IE_ABNORMAL | SYN_DMA_INT_ERROR_MASK - | SYN_DMA_INT_RX_ABN_MASK | SYN_DMA_INT_RX_NORM_MASK - | SYN_DMA_INT_RX_STOPPED_MASK | SYN_DMA_INT_TX_ABN_MASK - | SYN_DMA_INT_TX_NORM_MASK | SYN_DMA_INT_TX_STOPPED_MASK, - SYN_DMA_INT_DISABLE = 0, - SYN_DMA_AXI_BUS_MODE_VAL = SYN_DMA_AXI_BLEN16 | SYN_DMA_RD_OSR_NUM_REQS8 - | SYN_DMA_WR_OSR_NUM_REQS8, -}; - -/* - * desc_mode - * GMAC descriptors mode - */ -enum desc_mode { - RINGMODE = 0x00000001, - CHAINMODE = 0x00000002, -}; - -extern void syn_disable_dma_interrupt(struct nss_gmac_hal_dev *nghd); -extern void syn_enable_dma_interrupt(struct nss_gmac_hal_dev *nghd); -extern void syn_enable_dma_rx(struct nss_gmac_hal_dev *nghd); -extern void syn_disable_dma_rx(struct nss_gmac_hal_dev *nghd); -extern void syn_enable_dma_tx(struct nss_gmac_hal_dev *nghd); -extern void syn_disable_dma_tx(struct nss_gmac_hal_dev *nghd); -extern void syn_clear_dma_status(struct nss_gmac_hal_dev *nghd); -extern void syn_resume_dma_tx(struct nss_gmac_hal_dev *nghd); -extern uint32_t syn_get_rx_missed(struct nss_gmac_hal_dev *nghd); -extern uint32_t syn_get_fifo_overflows(struct nss_gmac_hal_dev *nghd); - -extern void syn_init_tx_desc_base(struct nss_gmac_hal_dev *nghd, uint32_t tx_desc_dma); -extern void syn_init_rx_desc_base(struct nss_gmac_hal_dev *nghd, uint32_t rx_desc_dma); - -#endif /*__SYN_REG_H__*/ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_dev.h b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_dev.h deleted file mode 100644 index bdccd09eb..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_dev.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016,2020 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF0 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __SYN_DEV_H__ -#define __SYN_DEV_H__ - -#include "syn_reg.h" -#include -#include - -/* - * Subclass for base nss_gmac_haldev - */ -struct syn_hal_dev { - struct nss_gmac_hal_dev nghd; /* Base class */ - fal_xgmib_info_t stats; /* Stats structure */ -}; - -/* - * syn_set_rx_flow_ctrl() - */ -static inline void syn_set_rx_flow_ctrl( - struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_RX_FLOW_CTL, - SYN_MAC_RX_FLOW_ENABLE); -} - -/* - * syn_clear_rx_flow_ctrl() - */ -static inline void syn_clear_rx_flow_ctrl( - struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, SYN_MAC_RX_FLOW_CTL, - SYN_MAC_RX_FLOW_ENABLE); -} - -/* - * syn_set_tx_flow_ctrl() - */ -static inline void syn_set_tx_flow_ctrl( - struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_Q0_TX_FLOW_CTL, - SYN_MAC_TX_FLOW_ENABLE); -} - -/* - * syn_send_tx_pause_frame() - */ -static inline void syn_send_tx_pause_frame( - struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_Q0_TX_FLOW_CTL, - SYN_MAC_TX_FLOW_ENABLE); - hal_set_reg_bits(nghd, SYN_MAC_Q0_TX_FLOW_CTL, - SYN_MAC_TX_PAUSE_SEND); -} - -/* - * syn_clear_tx_flow_ctrl() - */ -static inline void syn_clear_tx_flow_ctrl( - struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, SYN_MAC_Q0_TX_FLOW_CTL, - SYN_MAC_TX_FLOW_ENABLE); -} - -/* - * syn_clear_mac_ctrl() - */ -static inline void syn_clear_mac_ctrl( - struct nss_gmac_hal_dev *nghd) -{ - hal_write_reg(nghd->mac_base, SYN_MAC_TX_CONFIG, 0); - hal_write_reg(nghd->mac_base, SYN_MAC_RX_CONFIG, 0); -} - -/* - * syn_rx_enable() - */ -static inline void syn_rx_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_RX_CONFIG, SYN_MAC_RX_ENABLE); - hal_set_reg_bits(nghd, SYN_MAC_PACKET_FILTER, SYN_MAC_RX_ENABLE); -} - -/* - * syn_rx_disable() - */ -static inline void syn_rx_disable(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, SYN_MAC_RX_CONFIG, SYN_MAC_RX_ENABLE); -} - -/* - * syn_tx_enable() - */ -static inline void syn_tx_enable(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_TX_CONFIG, SYN_MAC_TX_ENABLE); -} - -/* - * syn_tx_disable() - */ -static inline void syn_tx_disable(struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, SYN_MAC_TX_CONFIG, - SYN_MAC_TX_ENABLE); -} - -/* - * syn_set_mmc_stats() - */ -static inline void syn_set_mmc_stats(struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_MMC_CTL, - SYN_MAC_MMC_RSTONRD); -} - -/* - * syn_rx_jumbo_frame_enable() - */ -static inline void syn_rx_jumbo_frame_enable( - struct nss_gmac_hal_dev *nghd) -{ - hal_set_reg_bits(nghd, SYN_MAC_RX_CONFIG, - SYN_MAC_JUMBO_FRAME_ENABLE); -} - -/* - * syn_rx_jumbo_frame_disable() - */ -static inline void syn_rx_jumbo_frame_disable( - struct nss_gmac_hal_dev *nghd) -{ - hal_clear_reg_bits(nghd, SYN_MAC_RX_CONFIG, - SYN_MAC_JUMBO_FRAME_ENABLE); -} - -/* - * syn_set_full_duplex() - */ -static inline void syn_set_full_duplex( - struct nss_gmac_hal_dev *nghd) -{ - /* TBD */ - return; -} - -/* - * syn_set_half_duplex() - */ -static inline void syn_set_half_duplex( - struct nss_gmac_hal_dev *nghd) -{ - /* TBD */ - return; -} - -static int syn_get_stats(struct nss_gmac_hal_dev *nghd) -{ - struct syn_hal_dev *shd = (struct syn_hal_dev *)nghd; - fal_xgmib_info_t *stats = &(shd->stats); - - if (fal_get_xgmib_info(0, nghd->mac_id, stats)) - return -1; - - return 0; -} -#endif /*__SYN_DEV_H__*/ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_if.c b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_if.c deleted file mode 100644 index 1ab621a6f..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_if.c +++ /dev/null @@ -1,505 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ -#include -#include -#include -#include -#include -#include -#include -#include "syn_dev.h" - -#define SYN_STAT(m) offsetof(fal_xgmib_info_t, m) - -struct syn_ethtool_stats { - uint8_t stat_string[ETH_GSTRING_LEN]; - uint64_t stat_offset; -}; - -/* - * Array of strings describing statistics - */ -static const struct syn_ethtool_stats syn_gstrings_stats[] = { - {"rx_frame", SYN_STAT(RxFrame)}, - {"rx_bytes", SYN_STAT(RxByte)}, - {"rx_bytes_g", SYN_STAT(RxByteGood)}, - {"rx_broadcast", SYN_STAT(RxBroadGood)}, - {"rx_multicast", SYN_STAT(RxMultiGood)}, - {"rx_crc_err", SYN_STAT(RxFcsErr)}, - {"rx_runt_err", SYN_STAT(RxRuntErr)}, - {"rx_jabber_err", SYN_STAT(RxJabberError)}, - {"rx_undersize", SYN_STAT(RxUndersizeGood)}, - {"rx_oversize", SYN_STAT(RxOversizeGood)}, - {"rx_pkt64", SYN_STAT(Rx64Byte)}, - {"rx_pkt65to127", SYN_STAT(Rx128Byte)}, - {"rx_pkt128to255", SYN_STAT(Rx256Byte)}, - {"rx_pkt256to511", SYN_STAT(Rx512Byte)}, - {"rx_pkt512to1023", SYN_STAT(Rx1024Byte)}, - {"rx_pkt1024tomax", SYN_STAT(RxMaxByte)}, - {"rx_unicast", SYN_STAT(RxUnicastGood)}, - {"rx_len_err", SYN_STAT(RxLengthError)}, - {"rx_outofrange_err_ctr", SYN_STAT(RxOutOfRangeError)}, - {"rx_pause", SYN_STAT(RxPause)}, - {"rx_fifo_overflow", SYN_STAT(RxOverFlow)}, - {"rx_vlan", SYN_STAT(RxVLANFrameGoodBad)}, - {"rx_wdog", SYN_STAT(RxWatchDogError)}, - {"rx_lpi_usec_ctr", SYN_STAT(RxLPIUsec)}, - {"rx_lpi_tran_ctr", SYN_STAT(RxLPITran)}, - {"rx_drop_frame_ctr", SYN_STAT(RxDropFrameGoodBad)}, - {"rx_drop_byte_ctr", SYN_STAT(RxDropByteGoodBad)}, - {"tx_bytes", SYN_STAT(TxByte)}, - {"tx_frame", SYN_STAT(TxFrame)}, - {"tx_broadcast", SYN_STAT(TxBroadGood)}, - {"tx_broadcast_gb", SYN_STAT(TxBroad)}, - {"tx_multicast", SYN_STAT(TxMultiGood)}, - {"tx_multicast_gb", SYN_STAT(TxMulti)}, - {"tx_pkt64", SYN_STAT(Tx64Byte)}, - {"tx_pkt65to127", SYN_STAT(Tx128Byte)}, - {"tx_pkt128to255", SYN_STAT(Tx256Byte)}, - {"tx_pkt256to511", SYN_STAT(Tx512Byte)}, - {"tx_pkt512to1023", SYN_STAT(Tx1024Byte)}, - {"tx_pkt1024tomax", SYN_STAT(TxMaxByte)}, - {"tx_unicast", SYN_STAT(TxUnicast)}, - {"tx_underflow_err", SYN_STAT(TxUnderFlowError)}, - {"tx_bytes_g", SYN_STAT(TxByteGood)}, - {"tx_frame_g", SYN_STAT(TxFrameGood)}, - {"tx_pause", SYN_STAT(TxPause)}, - {"tx_vlan", SYN_STAT(TxVLANFrameGood)}, - {"tx_lpi_usec_ctr", SYN_STAT(TxLPIUsec)}, - {"tx_lpi_tran_ctr", SYN_STAT(TxLPITran)}, -}; - -/* - * Array of strings describing private flag names - */ -static const char *const syn_strings_priv_flags[] = { - "test", -}; - -#define SYN_STATS_LEN ARRAY_SIZE(syn_gstrings_stats) -#define SYN_PRIV_FLAGS_LEN ARRAY_SIZE(syn_strings_priv_flags) - -/* - * syn_rx_flow_control() - */ -static void syn_rx_flow_control(struct nss_gmac_hal_dev *nghd, - bool enabled) -{ - BUG_ON(nghd == NULL); - - if (enabled) - syn_set_rx_flow_ctrl(nghd); - else - syn_clear_rx_flow_ctrl(nghd); -} - -/* - * syn_tx_flow_control() - */ -static void syn_tx_flow_control(struct nss_gmac_hal_dev *nghd, - bool enabled) -{ - BUG_ON(nghd == NULL); - - if (enabled) - syn_set_tx_flow_ctrl(nghd); - else - syn_clear_tx_flow_ctrl(nghd); -} - -/* - * syn_get_mmc_stats() - */ -static int32_t syn_get_mmc_stats(struct nss_gmac_hal_dev *nghd) -{ - BUG_ON(nghd == NULL); - - if (syn_get_stats(nghd)) - return -1; - - return 0; -} - -/* - * syn_get_max_frame_size() - */ -static int32_t syn_get_max_frame_size(struct nss_gmac_hal_dev *nghd) -{ - int ret; - uint32_t mtu; - - ret = fal_port_max_frame_size_get(0, nghd->mac_id, &mtu); - - if (!ret) - return mtu; - - return ret; -} - -/* - * syn_set_max_frame_size() - */ -static int32_t syn_set_max_frame_size(struct nss_gmac_hal_dev *nghd, - uint32_t val) -{ - return fal_port_max_frame_size_set(0, nghd->mac_id, val); -} - -/* - * syn_set_mac_speed() - */ -static int32_t syn_set_mac_speed(struct nss_gmac_hal_dev *nghd, - uint32_t mac_speed) -{ - struct net_device *netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * syn_get_mac_speed() - */ -static uint32_t syn_get_mac_speed(struct nss_gmac_hal_dev *nghd) -{ - struct net_device *netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * syn_set_duplex_mode() - */ -static void syn_set_duplex_mode(struct nss_gmac_hal_dev *nghd, - uint8_t duplex_mode) -{ - struct net_device *netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); -} - -/* - * syn_get_duplex_mode() - */ -static uint8_t syn_get_duplex_mode(struct nss_gmac_hal_dev *nghd) -{ - struct net_device *netdev = nghd->netdev; - - netdev_warn(netdev, "API deprecated\n"); - return 0; -} - -/* - * syn_get_netdev_stats() - */ -static int syn_get_netdev_stats(struct nss_gmac_hal_dev *nghd, - struct rtnl_link_stats64 *stats) -{ - struct syn_hal_dev *shd; - fal_xgmib_info_t *hal_stats; - - BUG_ON(nghd == NULL); - - shd = (struct syn_hal_dev *)nghd; - hal_stats = &(shd->stats); - - if (syn_get_stats(nghd)) - return -1; - - stats->rx_packets = hal_stats->RxUnicastGood - + hal_stats->RxBroadGood + hal_stats->RxMultiGood; - stats->tx_packets = hal_stats->TxUnicast - + hal_stats->TxBroadGood + hal_stats->TxMultiGood; - stats->rx_bytes = hal_stats->RxByte; - stats->tx_bytes = hal_stats->TxByte; - stats->multicast = - hal_stats->RxMultiGood; - stats->rx_dropped = - hal_stats->RxDropFrameGoodBad; - stats->rx_length_errors = - hal_stats->RxLengthError; - stats->rx_crc_errors = - hal_stats->RxFcsErr; - stats->rx_fifo_errors = - hal_stats->RxOverFlow; - - return 0; -} - -/* - * syn_get_eth_stats() - */ -static int32_t syn_get_eth_stats(struct nss_gmac_hal_dev *nghd, - uint64_t *data) -{ - struct syn_hal_dev *shd; - fal_xgmib_info_t *stats; - uint8_t *p = NULL; - int i; - - BUG_ON(nghd == NULL); - - shd = (struct syn_hal_dev *)nghd; - stats = &(shd->stats); - - if (syn_get_stats(nghd)) - return -1; - - for (i = 0; i < SYN_STATS_LEN; i++) { - p = ((uint8_t *)(stats) + - syn_gstrings_stats[i].stat_offset); - data[i] = *(uint32_t *)p; - } - - return 0; -} - -/* - * syn_get_strset_count() - */ -static int32_t syn_get_strset_count(struct nss_gmac_hal_dev *nghd, - int32_t sset) -{ - struct net_device *netdev; - - BUG_ON(nghd == NULL); - - netdev = nghd->netdev; - - switch (sset) { - case ETH_SS_STATS: - return SYN_STATS_LEN; - - case ETH_SS_PRIV_FLAGS: - return SYN_PRIV_FLAGS_LEN; - } - - netdev_dbg(netdev, "%s: Invalid string set\n", __func__); - return -EPERM; -} - -/* - * syn_get_strings() - */ -static int32_t syn_get_strings(struct nss_gmac_hal_dev *nghd, - int32_t stringset, uint8_t *data) -{ - struct net_device *netdev; - int i; - - BUG_ON(nghd == NULL); - - netdev = nghd->netdev; - - switch (stringset) { - case ETH_SS_STATS: - for (i = 0; i < SYN_STATS_LEN; i++) { - memcpy(data, syn_gstrings_stats[i].stat_string, - strlen(syn_gstrings_stats[i].stat_string)); - data += ETH_GSTRING_LEN; - } - break; - - case ETH_SS_PRIV_FLAGS: - for (i = 0; i < SYN_PRIV_FLAGS_LEN; i++) { - memcpy(data, syn_strings_priv_flags[i], - strlen(syn_strings_priv_flags[i])); - data += ETH_GSTRING_LEN; - } - - break; - default: - netdev_dbg(netdev, "%s: Invalid string set\n", __func__); - return -EPERM; - } - - return 0; -} - -/* - * syn_send_pause_frame() - */ -static void syn_send_pause_frame(struct nss_gmac_hal_dev *nghd) -{ - BUG_ON(nghd == NULL); - - syn_send_tx_pause_frame(nghd); -} - -/* - * syn_start - */ -static int32_t syn_start(struct nss_gmac_hal_dev *nghd) -{ - BUG_ON(nghd == NULL); - - syn_tx_enable(nghd); - syn_rx_enable(nghd); - syn_set_full_duplex(nghd); - if (syn_set_mac_speed(nghd, SPEED_10000)) - return -1; - - netdev_dbg(nghd->netdev, - "%s: mac_base:0x%px tx_enable:0x%x rx_enable:0x%x\n", - __func__, - nghd->mac_base, - hal_read_reg(nghd->mac_base, - SYN_MAC_TX_CONFIG), - hal_read_reg(nghd->mac_base, - SYN_MAC_RX_CONFIG)); - - return 0; -} - -/* - * syn_stop - */ -static int32_t syn_stop(struct nss_gmac_hal_dev *nghd) -{ - BUG_ON(nghd == NULL); - - syn_tx_disable(nghd); - syn_rx_disable(nghd); - - netdev_dbg(nghd->netdev, "%s: Stopping mac_base:0x%px\n", __func__, - nghd->mac_base); - - return 0; -} - -/* - * syn_init() - */ -static void *syn_init(struct gmac_hal_platform_data *gmacpdata) -{ - struct syn_hal_dev *shd = NULL; - struct net_device *ndev = NULL; - struct nss_dp_dev *dp_priv = NULL; - struct resource *res; - - ndev = gmacpdata->netdev; - dp_priv = netdev_priv(ndev); - - res = platform_get_resource(dp_priv->pdev, IORESOURCE_MEM, 0); - if (!res) { - netdev_dbg(ndev, "Resource get failed.\n"); - return NULL; - } - - if (!devm_request_mem_region(&dp_priv->pdev->dev, res->start, - resource_size(res), ndev->name)) { - netdev_dbg(ndev, "Request mem region failed. Returning...\n"); - return NULL; - } - - shd = (struct syn_hal_dev *)devm_kzalloc(&dp_priv->pdev->dev, - sizeof(struct syn_hal_dev), - GFP_KERNEL); - if (!shd) { - netdev_dbg(ndev, "kzalloc failed. Returning...\n"); - return NULL; - } - - /* Save netdev context in syn HAL context */ - shd->nghd.netdev = gmacpdata->netdev; - shd->nghd.mac_id = gmacpdata->macid; - - /* Populate the mac base addresses */ - shd->nghd.mac_base = - devm_ioremap_nocache(&dp_priv->pdev->dev, res->start, - resource_size(res)); - if (!shd->nghd.mac_base) { - netdev_dbg(ndev, "ioremap fail.\n"); - return NULL; - } - - spin_lock_init(&shd->nghd.slock); - - netdev_dbg(ndev, "ioremap OK.Size 0x%x Ndev base 0x%lx macbase 0x%px\n", - gmacpdata->reg_len, - ndev->base_addr, - shd->nghd.mac_base); - - /* Reset MIB Stats */ - if (fal_mib_port_flush_counters(0, shd->nghd.mac_id)) { - netdev_dbg(ndev, "MIB stats Reset fail.\n"); - } - - return (struct nss_gmac_hal_dev *)shd; -} - -/* - * syn_set_mac_address() - */ -static void syn_set_mac_address(struct nss_gmac_hal_dev *nghd, - uint8_t *macaddr) -{ - uint32_t data; - - BUG_ON(nghd == NULL); - - data = (macaddr[5] << 8) | macaddr[4] | SYN_MAC_ADDR_RSVD_BIT; - hal_write_reg(nghd->mac_base, SYN_MAC_ADDR0_HIGH, data); - data = (macaddr[3] << 24) | (macaddr[2] << 16) | (macaddr[1] << 8) - | macaddr[0]; - hal_write_reg(nghd->mac_base, SYN_MAC_ADDR0_LOW, data); -} - -/* - * syn_get_mac_address() - */ -static void syn_get_mac_address(struct nss_gmac_hal_dev *nghd, - uint8_t *macaddr) -{ - uint32_t data; - - BUG_ON(nghd == NULL); - - data = hal_read_reg(nghd->mac_base, SYN_MAC_ADDR0_HIGH); - macaddr[5] = (data >> 8) & 0xff; - macaddr[4] = (data) & 0xff; - - data = hal_read_reg(nghd->mac_base, SYN_MAC_ADDR0_LOW); - macaddr[3] = (data >> 24) & 0xff; - macaddr[2] = (data >> 16) & 0xff; - macaddr[1] = (data >> 8) & 0xff; - macaddr[0] = (data) & 0xff; -} - -struct nss_gmac_hal_ops syn_hal_ops = { - .init = &syn_init, - .start = &syn_start, - .stop = &syn_stop, - .setmacaddr = &syn_set_mac_address, - .getmacaddr = &syn_get_mac_address, - .rxflowcontrol = &syn_rx_flow_control, - .txflowcontrol = &syn_tx_flow_control, - .setspeed = &syn_set_mac_speed, - .getspeed = &syn_get_mac_speed, - .setduplex = &syn_set_duplex_mode, - .getduplex = &syn_get_duplex_mode, - .getstats = &syn_get_mmc_stats, - .setmaxframe = &syn_set_max_frame_size, - .getmaxframe = &syn_get_max_frame_size, - .getndostats = &syn_get_netdev_stats, - .getssetcount = &syn_get_strset_count, - .getstrings = &syn_get_strings, - .getethtoolstats = &syn_get_eth_stats, - .sendpause = &syn_send_pause_frame, -}; diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_reg.h b/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_reg.h deleted file mode 100644 index f76fce1a0..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/gmac_hal_ops/syn/xgmac/syn_reg.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016,2020 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF0 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __SYN_REG_H__ -#define __SYN_REG_H__ - -/* - * - MAC Register Offset - * - */ -#define SYN_MAC_TX_CONFIG 0x0000 -#define SYN_MAC_RX_CONFIG 0x0004 -#define SYN_MAC_PACKET_FILTER 0x0008 -#define SYN_MAC_WDOG_TIMEOUT 0x000c -#define SYN_MAC_HASH_TBL_REG0 0x0010 -#define SYN_MAC_VLAN_TAG 0x0050 -#define SYN_MAC_VLAN_HASH_TBL 0x0058 -#define SYN_MAC_VLAN_INCL 0x0060 -#define SYN_MAC_INNER_VLAN_INCL 0x0064 -#define SYN_MAC_RX_ETH_TYP_MATCH 0x006c -#define SYN_MAC_Q0_TX_FLOW_CTL 0x0070 -#define SYN_MAC_Q1_TX_FLOW_CTL 0x0074 -#define SYN_MAC_Q2_TX_FLOW_CTL 0x0078 -#define SYN_MAC_Q3_TX_FLOW_CTL 0x007c -#define SYN_MAC_Q4_TX_FLOW_CTL 0x0080 -#define SYN_MAC_Q5_TX_FLOW_CTL 0x0084 -#define SYN_MAC_Q6_TX_FLOW_CTL 0x0088 -#define SYN_MAC_Q7_TX_FLOW_CTL 0x008c -#define SYN_MAC_RX_FLOW_CTL 0x0090 -#define SYN_MAC_RXQ_CTL0 0x00a0 -#define SYN_MAC_RXQ_CTL1 0x00a4 -#define SYN_MAC_RXQ_CTL2 0x00a8 -#define SYN_MAC_RXQ_CTL3 0x00ac -#define SYN_MAC_INT_STATUS 0x00b0 -#define SYN_MAC_INT_ENABLE 0x00b4 -#define SYN_MAC_TX_RX_STATUS 0x00b8 -#define SYN_MAC_PMT_CTL_STATUS 0x00c0 -#define SYN_MAC_RWK_PACKET_FILTER 0x00c4 -#define SYN_MAC_LPI_CTL_STATUS 0x00d0 -#define SYN_MAC_LPI_TIMER_STATUS 0x00d4 -#define SYN_MAC_VERSION 0x0110 -#define SYN_MAC_DEBUG 0x0114 -#define SYN_MAC_FW_FEATURE0 0x011c -#define SYN_MAC_FW_FEATURE1 0x0120 -#define SYN_MAC_FW_FEATURE2 0x0124 -#define SYN_MAC_GPIO_CTL 0x0278 -#define SYN_MAC_GPIO_STATUS 0x027c -#define SYN_MAC_ADDR0_HIGH 0x0300 -#define SYN_MAC_ADDR0_LOW 0x0304 -#define SYN_MAC_ADDR1_HIGH 0x0308 -#define SYN_MAC_ADDR1_LOW 0x030c -#define SYN_MAC_TS_CTL 0x0d00 -#define SYN_MAC_SUB_SEC_INCR 0x0d04 -#define SYN_MAC_SYS_TIME_SECS 0x0d08 -#define SYN_MAC_SYS_TIME_NSECS 0x0d0c -#define SYN_MAC_SYS_TIME_SECS_UPDATE 0x0d10 -#define SYN_MAC_SYS_TIME_NSECS_UPDATE 0x0d14 -#define SYN_MAC_TS_ADDEND 0x0d18 -#define SYN_MAC_TS_STATUS 0x0d20 -#define SYN_MAC_TX_TS_STATUS_NSECS 0x0d30 -#define SYN_MAC_TX_TS_STATUS_SECS 0x0d34 -#define SYN_MAC_PPS_CTL 0x0d70 -#define SYN_MAC_MMC_CTL 0x0800 -#define SYN_MAC_MMC_RX_INT 0x0804 -#define SYN_MAC_MMC_TX_INT 0x0808 -#define SYN_MAC_MMC_RX_INT_EN 0x080c -#define SYN_MAC_MMC_TX_INT_EN 0x0810 - -/* MAC TX MMC Counters */ -#define SYN_MAC_MMC_TX_BCAST_LO 0x0824 -#define SYN_MAC_MMC_TX_BCAST_HI 0x0828 -#define SYN_MAC_MMC_TX_FRAME_LO 0x0894 -#define SYN_MAC_MMC_TX_FRAME_HI 0x0898 -#define SYN_MAC_MMC_TX_MCAST_LO 0x082c -#define SYN_MAC_MMC_TX_MCAST_HI 0x0830 -#define SYN_MAC_MMC_TX_PKT64_LO 0x0834 -#define SYN_MAC_MMC_TX_PKT64_HI 0x0838 -#define SYN_MAC_MMC_TX_PKT65TO127_LO 0x083c -#define SYN_MAC_MMC_TX_PKT65TO127_HI 0x0840 -#define SYN_MAC_MMC_TX_PKT128TO255_LO 0x0844 -#define SYN_MAC_MMC_TX_PKT128TO255_HI 0x0848 -#define SYN_MAC_MMC_TX_PKT256TO511_LO 0x084c -#define SYN_MAC_MMC_TX_PKT256TO511_HI 0x0850 -#define SYN_MAC_MMC_TX_PKT512TO1023_LO 0x0854 -#define SYN_MAC_MMC_TX_PKT512TO1023_HI 0x0858 -#define SYN_MAC_MMC_TX_PKT1024TOMAX_LO 0x085c -#define SYN_MAC_MMC_TX_PKT1024TOMAX_HI 0x0860 -#define SYN_MAC_MMC_TX_UNICAST_LO 0x0864 -#define SYN_MAC_MMC_TX_UNICAST_HI 0x0868 -#define SYN_MAC_MMC_TX_MCAST_GB_LO 0x086c -#define SYN_MAC_MMC_TX_MCAST_GB_HI 0x0870 -#define SYN_MAC_MMC_TX_BCAST_GB_LO 0x0874 -#define SYN_MAC_MMC_TX_BCAST_GB_HI 0x0878 -#define SYN_MAC_MMC_TX_UNDERFLOW_ERR_LO 0x087c -#define SYN_MAC_MMC_TX_UNDERFLOW_ERR_HI 0x0880 -#define SYN_MAC_MMC_TX_BYTES_LO 0x0884 -#define SYN_MAC_MMC_TX_BYTES_HI 0x0888 -#define SYN_MAC_MMC_TX_PAUSE_FRAME_LO 0x0894 -#define SYN_MAC_MMC_TX_PAUSE_FRAME_HI 0x0898 -#define SYN_MAC_MMC_TX_VLAN_LO 0x089c -#define SYN_MAC_MMC_TX_VLAN_HI 0x08a0 -#define SYN_MAC_MMC_TX_LPI_USEC_CTR_LO 0x08a4 -#define SYN_MAC_MMC_TX_LPI_USEC_CTR_HI 0x08a8 - -/* MAC RX MMC Counters */ -#define SYN_MAC_MMC_RX_FRAME_LO 0x0900 -#define SYN_MAC_MMC_RX_FRAME_HI 0x0904 -#define SYN_MAC_MMC_RX_BYTES_LO 0x0910 -#define SYN_MAC_MMC_RX_BYTES_HI 0x0914 -#define SYN_MAC_MMC_RX_BCAST_LO 0x0918 -#define SYN_MAC_MMC_RX_BCAST_HI 0x091c -#define SYN_MAC_MMC_RX_MCAST_LO 0x0920 -#define SYN_MAC_MMC_RX_MCAST_HI 0x0924 -#define SYN_MAC_MMC_RX_CRC_ERR_LO 0x0928 -#define SYN_MAC_MMC_RX_CRC_ERR_HI 0x092c -#define SYN_MAC_MMC_RX_RUNT_ERR 0x0930 -#define SYN_MAC_MMC_RX_JABBER_ERR 0x0934 -#define SYN_MAC_MMC_RX_UNDERSIZE 0x0938 -#define SYN_MAC_MMC_RX_OVERSIZE 0x093c -#define SYN_MAC_MMC_RX_PKT64_LO 0x0940 -#define SYN_MAC_MMC_RX_PKT64_HI 0x0944 -#define SYN_MAC_MMC_RX_PKT65TO127_LO 0x0948 -#define SYN_MAC_MMC_RX_PKT65TO127_HI 0x094c -#define SYN_MAC_MMC_RX_PKT128TO255_LO 0x0950 -#define SYN_MAC_MMC_RX_PKT128TO255_HI 0x0954 -#define SYN_MAC_MMC_RX_PKT256TO511_LO 0x0958 -#define SYN_MAC_MMC_RX_PKT256TO511_HI 0x095c -#define SYN_MAC_MMC_RX_PKT512TO1023_LO 0x0960 -#define SYN_MAC_MMC_RX_PKT512TO1023_HI 0x0964 -#define SYN_MAC_MMC_RX_PKT1024TOMAX_LO 0x0968 -#define SYN_MAC_MMC_RX_PKT1024TOMAX_HI 0x096c -#define SYN_MAC_MMC_RX_UNICAST_LO 0x0970 -#define SYN_MAC_MMC_RX_UNICAST_HI 0x0974 -#define SYN_MAC_MMC_RX_LEN_ERR_LO 0x0978 -#define SYN_MAC_MMC_RX_LEN_ERR_HI 0x097c -#define SYN_MAC_MMC_RX_PAUSE_FRAME_LO 0x0988 -#define SYN_MAC_MMC_RX_PAUSE_FRAME_HI 0x098c -#define SYN_MAC_MMC_RX_FIFO_OVERFLOW_LO 0x0990 -#define SYN_MAC_MMC_RX_FIFO_OVERFLOW_HI 0x0994 -#define SYN_MAC_MMC_RX_VLAN_FRAME_LO 0x0998 -#define SYN_MAC_MMC_RX_VLAN_FRAME_HI 0x099c -#define SYN_MAC_MMC_RX_LPI_USEC_CTR_LO 0x09a4 -#define SYN_MAC_MMC_RX_LPI_USEC_CTR_HI 0x09a8 -#define SYN_MAC_MMC_RX_DISCARD_FRAME_LO 0x09ac -#define SYN_MAC_MMC_RX_DISCARD_FRAME_HI 0x09b0 - -/* MAC Register Bit Definitions*/ - -/* SYN_MAC_Q0_TX_FLOW_CTL Bit definitions */ -#define SYN_MAC_TX_PAUSE_SEND 0x00000001 -#define SYN_MAC_TX_FLOW_ENABLE 0x00000002 -#define SYN_MAC_TX_PAUSE_LOW_THRESHOLD 0x00000070 -#define SYN_MAC_ADDR_RSVD_BIT 0x80000000 - -/* SYN_MAC_RX_FLOW_CTL Bit definitions */ -#define SYN_MAC_RX_FLOW_ENABLE 0x00000001 - -/* SYN_MAC_TX_CONFIG Bit definitions */ -#define SYN_MAC_TX_ENABLE 0x00000001 -#define SYN_MAC_TX_SPEED_SELECT 0x60000000 - -/* SYN_MAC_RX_CONFIG Bit definitions */ -#define SYN_MAC_RX_ENABLE 0x00000001 -#define SYN_MAC_JUMBO_FRAME_ENABLE 0x00000100 - -#define SYN_MAC_SPEED_10G 0x0 -#define SYN_MAC_SPEED_2_5G 0x2 -#define SYN_MAC_SPEED_1G 0x3 -#define SYN_MAC_SPEED_BITPOS 29 -#define SYN_MAC_SPEED_BITMASK 0x3 - -#define SYN_MAC_DEFAULT_MAX_FRAME_SIZE 1518 -#define SYN_MAC_MAX_FRAME_SIZE_BITPOS 16 -#define SYN_MAC_MAX_FRAME_SIZE_BITMASK 0x3fff - -/* SYN_MAC_MMC_CTL Bit definitions */ -#define SYN_MAC_MMC_RSTONRD 0x00000004 - -/* - * - MTL Register Offset - * - */ -#define SYN_MTL_OPER_MODE 0x1000 -#define SYN_MTL_DEBUG_CTL 0x1008 -#define SYN_MTL_DEBUG_STATUS 0x100c -#define SYN_MTL_DEBUG_DATA 0x1010 -#define SYN_MTL_INT_STATUS 0x1020 -#define SYN_MTL_RXQ_DMA_MAP0 0x1030 -#define SYN_MTL_RXQ_DMA_MAP1 0x1034 -#define SYN_MTL_RXQ_DMA_MAP2 0x1038 -#define SYN_MTL_TC_PRIO_MAP0 0x1040 -#define SYN_MTL_TC_PRIO_MAP1 0x1044 -#define SYN_MTL_TXQ0_OPER_MODE 0x1100 -#define SYN_MTL_TXQ0_UNDERFLOW 0x1104 -#define SYN_MTL_TXQ0_DEBUG 0x1108 -#define SYN_MTL_TC0_ETS_CTL 0x1110 -#define SYN_MTL_TC0_ETS_STATUS 0x1114 -#define SYN_MTL_TC0_QUANTUM_WEIGHT 0x1118 -#define SYN_MTL_RXQ0_DEBUG 0x1148 -#define SYN_MTL_RXQ0_CTL 0x114c -#define SYN_MTL_RXQ0_FLOW_CTL 0x1150 -#define SYN_MTL_Q0_INT_ENABLE 0x1170 -#define SYN_MTL_Q0_INT_STATUS 0x1174 - -/* MTL Register Bit definitions */ - -/* - * - DMA Register Offset - * - */ -#define SYN_DMA_MODE 0x3000 -#define SYN_DMA_SYSBUS_MODE 0x3004 -#define SYN_DMA_INT_STATUS 0x3008 -#define SYN_DMA_AXI_TX_AR_ACE_CTL 0x3010 -#define SYN_DMA_AXI_RX_AW_ACE_CTL 0x3018 -#define SYN_DMA_AXI_TXRX_AWAR_ACE_CTL 0x301c -#define SYN_DMA_DEBUG_STATUS0 0x3020 -#define SYN_DMA_DEBUG_STATUS1 0x3024 -#define SYN_DMA_TX_EDMA_CTL 0x3040 -#define SYN_DMA_RX_EDMA_CTL 0x3044 -#define SYN_DMA_CH0_CTL 0x3100 -#define SYN_DMA_CH0_TX_CTL 0x3104 -#define SYN_DMA_CH0_RX_CTL 0x3108 -#define SYN_DMA_CH0_TXDESC_LIST_HADDR 0x3110 -#define SYN_DMA_CH0_TXDESC_LIST_LADDR 0x3114 -#define SYN_DMA_CH0_RXDESC_LIST_HADDR 0x3118 -#define SYN_DMA_CH0_RXDESC_LIST_LADDR 0x311c -#define SYN_DMA_CH0_TXDESC_TAIL_LPTR 0x3124 -#define SYN_DMA_CH0_RXDESC_TAIL_LPTR 0x312c -#define SYN_DMA_CH0_TXDESC_RING_LEN 0x3130 -#define SYN_DMA_CH0_RXDESC_RING_LEN 0x3134 -#define SYN_DMA_INT_ENABLE 0x3138 -#define SYN_DMA_RX_INT_WDOG_TIMER 0x313c - -/* DMA Register Bit definitions */ - -#endif /*__SYN_REG_H__*/ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/include/edma.h b/feeds/ipq807x/qca-nss-dp/src/hal/include/edma.h deleted file mode 100644 index 9ed0c3840..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/include/edma.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016, 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** -*/ - -/* - * This file includes declarations defined by the EDMA - * dataplane and used by other layers of this driver. - */ - -#ifndef __NSS_DP_EDMA__ -#define __NSS_DP_EDMA__ - -extern int edma_init(void); -extern void edma_cleanup(bool is_dp_override); -extern struct nss_dp_data_plane_ops nss_dp_edma_ops; - -#endif /*__NSS_DP_EDMA__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/include/nss_dp_hal.h b/feeds/ipq807x/qca-nss-dp/src/hal/include/nss_dp_hal.h deleted file mode 100644 index 89cdb1abe..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/include/nss_dp_hal.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __NSS_DP_HAL_H__ -#define __NSS_DP_HAL_H__ - -#include "nss_dp_dev.h" - -/* - * nss_dp_hal_get_gmac_ops() - * Returns gmac hal ops based on the GMAC type. - */ -static inline struct nss_gmac_hal_ops *nss_dp_hal_get_gmac_ops(uint32_t gmac_type) -{ - return dp_global_ctx.gmac_hal_ops[gmac_type]; -} - -/* - * nss_dp_hal_set_gmac_ops() - * Sets dp global gmac hal ops based on the GMAC type. - */ -static inline void nss_dp_hal_set_gmac_ops(struct nss_gmac_hal_ops *hal_ops, uint32_t gmac_type) -{ - dp_global_ctx.gmac_hal_ops[gmac_type] = hal_ops; -} - -/* - * HAL functions implemented by SoC specific source files. - */ -extern bool nss_dp_hal_init(void); -extern void nss_dp_hal_cleanup(void); -extern void nss_dp_hal_clk_enable(struct nss_dp_dev *dp_priv); -extern struct nss_dp_data_plane_ops *nss_dp_hal_get_data_plane_ops(void); - -#endif /* __NSS_DP_HAL_H__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/include/nss_dp_hal_if.h b/feeds/ipq807x/qca-nss-dp/src/hal/include/nss_dp_hal_if.h deleted file mode 100644 index 68fc2da3e..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/include/nss_dp_hal_if.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017,2020 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF0 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_DP_HAL_IF_H__ -#define __NSS_DP_HAL_IF_H__ - -#include -#include -#include - -enum gmac_device_type { - GMAC_HAL_TYPE_QCOM = 0, /* 1G GMAC type */ - GMAC_HAL_TYPE_SYN_XGMAC,/* Synopsys XGMAC type */ - GMAC_HAL_TYPE_SYN_GMAC, /* Synopsys 1G GMAC type */ - GMAC_HAL_TYPE_MAX -}; - -/* - * gmac_hal_platform_data - */ -struct gmac_hal_platform_data { - struct net_device *netdev; /* Net device */ - uint32_t reg_len; /* Register space length */ - uint32_t mactype; /* MAC chip type */ - uint32_t macid; /* MAC sequence id on the Chip */ -}; - -/* - * NSS GMAC HAL device data - */ -struct nss_gmac_hal_dev { - void __iomem *mac_base; /* Base address of MAC registers */ - uint32_t version; /* GMAC Revision version */ - uint32_t drv_flags; /* Driver specific feature flags */ - - /* - * Phy related stuff - */ - uint32_t link_state; /* Link status as reported by the Phy */ - uint32_t duplex_mode; /* Duplex mode of the Phy */ - uint32_t speed; /* Speed of the Phy */ - uint32_t loop_back_mode;/* Loopback status of the Phy */ - uint32_t phy_mii_type; /* RGMII/SGMII/XSGMII */ - - struct net_device *netdev; - struct resource *memres; - uint32_t mac_reg_len; /* MAC Register block length */ - uint32_t mac_id; /* MAC sequence id on the Chip */ - spinlock_t slock; /* lock to protect concurrent reg access */ -}; - -/* - * nss_gmac_hal_ops - */ -struct nss_gmac_hal_ops { - void* (*init)(struct gmac_hal_platform_data *); - void (*exit)(struct nss_gmac_hal_dev *); - int32_t (*start)(struct nss_gmac_hal_dev *); - int32_t (*stop)(struct nss_gmac_hal_dev *); - void (*setmacaddr)(struct nss_gmac_hal_dev *, uint8_t *); - void (*getmacaddr)(struct nss_gmac_hal_dev *, uint8_t *); - void (*promisc)(struct nss_gmac_hal_dev *, bool enabled); - void (*multicast)(struct nss_gmac_hal_dev *, bool enabled); - void (*broadcast)(struct nss_gmac_hal_dev *, bool enabled); - void (*rxcsumoffload)(struct nss_gmac_hal_dev *, bool enabled); - void (*txcsumoffload)(struct nss_gmac_hal_dev *, bool enabled); - void (*rxflowcontrol)(struct nss_gmac_hal_dev *, bool enabled); - void (*txflowcontrol)(struct nss_gmac_hal_dev *, bool enabled); - int32_t (*setspeed)(struct nss_gmac_hal_dev *, uint32_t); - uint32_t (*getspeed)(struct nss_gmac_hal_dev *); - void (*setduplex)(struct nss_gmac_hal_dev *, uint8_t); - uint8_t (*getduplex)(struct nss_gmac_hal_dev *); - int32_t (*getstats)(struct nss_gmac_hal_dev *); - int32_t (*setmaxframe)(struct nss_gmac_hal_dev *, uint32_t); - int32_t (*getmaxframe)(struct nss_gmac_hal_dev *); - int32_t (*getndostats)(struct nss_gmac_hal_dev *, - struct rtnl_link_stats64 *); - void (*sendpause)(struct nss_gmac_hal_dev *); - void (*stoppause)(struct nss_gmac_hal_dev *); - int32_t (*getssetcount)(struct nss_gmac_hal_dev *, int32_t); - int32_t (*getstrings)(struct nss_gmac_hal_dev *, int32_t, uint8_t *); - int32_t (*getethtoolstats)(struct nss_gmac_hal_dev *, uint64_t *); -}; - -extern struct nss_gmac_hal_ops qcom_hal_ops; -extern struct nss_gmac_hal_ops syn_hal_ops; - -/********************************************************** - * Common functions - **********************************************************/ -/* - * hal_read_reg() - */ -static inline uint32_t hal_read_reg(void __iomem *regbase, uint32_t regoffset) -{ - return readl_relaxed(regbase + regoffset); -} - -/* - * hal_write_reg() - */ -static inline void hal_write_reg(void __iomem *regbase, uint32_t regoffset, - uint32_t regdata) -{ - writel_relaxed(regdata, regbase + regoffset); -} - -/* - * hal_set_reg_bits() - */ -static inline void hal_set_reg_bits(struct nss_gmac_hal_dev *nghd, - uint32_t regoffset, - uint32_t bitpos) -{ - uint32_t data; - - spin_lock(&nghd->slock); - data = bitpos | hal_read_reg(nghd->mac_base, regoffset); - hal_write_reg(nghd->mac_base, regoffset, data); - spin_unlock(&nghd->slock); -} - -/* - * hal_clear_reg_bits() - */ -static inline void hal_clear_reg_bits(struct nss_gmac_hal_dev *nghd, - uint32_t regoffset, - uint32_t bitpos) -{ - uint32_t data; - - spin_lock(&nghd->slock); - data = ~bitpos & hal_read_reg(nghd->mac_base, regoffset); - hal_write_reg(nghd->mac_base, regoffset, data); - spin_unlock(&nghd->slock); -} - -/* - * hal_check_reg_bits() - */ -static inline bool hal_check_reg_bits(void __iomem *regbase, - uint32_t regoffset, - uint32_t bitpos) -{ - return (bitpos & hal_read_reg(regbase, regoffset)) != 0; -} -#endif /* __NSS_DP_HAL_IF_H__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_data_plane.c b/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_data_plane.c deleted file mode 100644 index 0b9bdce1f..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_data_plane.c +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include "syn_data_plane.h" -#include "syn_reg.h" - -#define SYN_DP_NAPI_BUDGET 64 - -/* - * GMAC Ring info - */ -struct syn_dp_info dp_info[NSS_DP_HAL_MAX_PORTS]; - -/* - * syn_dp_napi_poll() - * Scheduled by napi to process RX and TX complete - */ -static int syn_dp_napi_poll(struct napi_struct *napi, int budget) -{ - struct nss_dp_dev *gmac_dev = container_of(napi, struct nss_dp_dev, napi); - struct syn_dp_info *dev_info = &dp_info[gmac_dev->macid - 1]; - int work_done; - - /* - * Update GMAC stats - */ - spin_lock_bh(&dp_info->stats_lock); - dp_info->stats.stats.rx_missed += syn_get_rx_missed(gmac_dev->gmac_hal_ctx); - dp_info->stats.stats.rx_missed += syn_get_fifo_overflows(gmac_dev->gmac_hal_ctx); - spin_unlock_bh(&dp_info->stats_lock); - - syn_dp_process_tx_complete(gmac_dev, dev_info); - work_done = syn_dp_rx(gmac_dev, dev_info, budget); - syn_dp_rx_refill(gmac_dev, dev_info); - - if (work_done < budget) { - napi_complete(napi); - syn_enable_dma_interrupt(gmac_dev->gmac_hal_ctx); - } - - return work_done; -} - -/* - * syn_dp_handle_irq() - * Process IRQ and schedule napi - */ -static irqreturn_t syn_dp_handle_irq(int irq, void *ctx) -{ - struct nss_dp_dev *gmac_dev = (struct nss_dp_dev *)ctx; - struct nss_gmac_hal_dev *nghd = gmac_dev->gmac_hal_ctx; - - syn_clear_dma_status(nghd); - syn_disable_dma_interrupt(nghd); - - /* - * Schedule NAPI - */ - napi_schedule(&gmac_dev->napi); - - return IRQ_HANDLED; -} - -/* - * syn_dp_if_init() - * Initialize the GMAC data plane operations - */ -static int syn_dp_if_init(struct nss_dp_data_plane_ctx *dpc) -{ - struct net_device *netdev = dpc->dev; - struct nss_dp_dev *gmac_dev = (struct nss_dp_dev *)netdev_priv(netdev); - uint32_t macid = gmac_dev->macid; - struct syn_dp_info *dev_info = &dp_info[macid - 1]; - struct device *dev = &gmac_dev->pdev->dev; - int err; - - if (!netdev) { - netdev_dbg(netdev, "nss_dp_gmac: Invalid netdev pointer %px\n", netdev); - return NSS_DP_FAILURE; - } - - netdev_info(netdev, "nss_dp_gmac: Registering netdev %s(qcom-id:%d) with GMAC\n", netdev->name, macid); - - if (!dev_info->napi_added) { - netif_napi_add(netdev, &gmac_dev->napi, syn_dp_napi_poll, SYN_DP_NAPI_BUDGET); - - /* - * Requesting irq - */ - netdev->irq = platform_get_irq(gmac_dev->pdev, 0); - err = request_irq(netdev->irq, syn_dp_handle_irq, 0, "nss-dp-gmac", gmac_dev); - if (err) { - netdev_dbg(netdev, "err_code:%d, Mac %d IRQ %d request failed\n", err, - gmac_dev->macid, netdev->irq); - return NSS_DP_FAILURE; - } - - gmac_dev->drv_flags |= NSS_DP_PRIV_FLAG(IRQ_REQUESTED); - dev_info->napi_added = 1; - } - - /* - * Forcing the kernel to use 32-bit DMA addressing - */ - dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); - - /* - * Initialize the Tx/Rx ring - */ - if (syn_dp_setup_rings(gmac_dev, netdev, dev, dev_info)) { - netdev_dbg(netdev, "nss_dp_gmac: Error initializing GMAC rings %px\n", netdev); - return NSS_DP_FAILURE; - } - - spin_lock_init(&dev_info->data_lock); - spin_lock_init(&dev_info->stats_lock); - - netdev_dbg(netdev,"Synopsys GMAC dataplane initialized\n"); - - return NSS_DP_SUCCESS; -} - -/* - * syn_dp_if_open() - * Open the GMAC data plane operations - */ -static int syn_dp_if_open(struct nss_dp_data_plane_ctx *dpc, uint32_t tx_desc_ring, - uint32_t rx_desc_ring, uint32_t mode) -{ - struct net_device *netdev = dpc->dev; - struct nss_dp_dev *gmac_dev = (struct nss_dp_dev *)netdev_priv(netdev); - struct nss_gmac_hal_dev *nghd = gmac_dev->gmac_hal_ctx; - - syn_enable_dma_rx(nghd); - syn_enable_dma_tx(nghd); - - napi_enable(&gmac_dev->napi); - syn_enable_dma_interrupt(nghd); - - netdev_dbg(netdev, "Synopsys GMAC dataplane opened\n"); - - return NSS_DP_SUCCESS; -} - -/* - * syn_dp_if_close() - * Close the GMAC data plane operations - */ -static int syn_dp_if_close(struct nss_dp_data_plane_ctx *dpc) -{ - struct net_device *netdev = dpc->dev; - struct nss_dp_dev *gmac_dev = (struct nss_dp_dev *)netdev_priv(netdev); - struct nss_gmac_hal_dev *nghd = gmac_dev->gmac_hal_ctx; - - syn_disable_dma_rx(nghd); - syn_disable_dma_tx(nghd); - - syn_disable_dma_interrupt(nghd); - napi_disable(&gmac_dev->napi); - - netdev_dbg(netdev, "Synopsys GMAC dataplane closed\n"); - - return NSS_DP_SUCCESS; -} - -/* - * syn_dp_if_link_state() - * Change of link for the dataplane - */ -static int syn_dp_if_link_state(struct nss_dp_data_plane_ctx *dpc, uint32_t link_state) -{ - struct net_device *netdev = dpc->dev; - - /* - * Switch interrupt based on the link state - */ - if (link_state) { - netdev_dbg(netdev, "Data plane link up\n"); - } else { - netdev_dbg(netdev, "Data plane link down\n"); - } - - return NSS_DP_SUCCESS; -} - -/* - * syn_dp_if_mac_addr() - */ -static int syn_dp_if_mac_addr(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr) -{ - return NSS_DP_SUCCESS; -} - -/* - * syn_dp_if_change_mtu() - */ -static int syn_dp_if_change_mtu(struct nss_dp_data_plane_ctx *dpc, uint32_t mtu) -{ - /* - * TODO: Work on MTU fix along with register update for frame length - */ - return NSS_DP_SUCCESS; -} - -/* - * syn_dp_if_set_features() - * Set the supported net_device features - */ -static void syn_dp_if_set_features(struct nss_dp_data_plane_ctx *dpc) -{ - struct net_device *netdev = dpc->dev; - - netdev->features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM; - netdev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM; - netdev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM; - netdev->wanted_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM; -} - -/* - * syn_dp_if_xmit() - * Dataplane method to transmit the packet - */ -static netdev_tx_t syn_dp_if_xmit(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *skb) -{ - struct net_device *netdev = dpc->dev; - struct nss_dp_dev *gmac_dev = (struct nss_dp_dev *)netdev_priv(netdev); - struct syn_dp_info *dev_info = &dp_info[gmac_dev->macid - 1]; - int nfrags = skb_shinfo(skb)->nr_frags; - - /* - * Most likely, it is not a fragmented pkt, optimize for that - */ - if (likely(nfrags == 0)) { - if (syn_dp_tx(gmac_dev, dev_info, skb)) { - goto drop; - } - - return NETDEV_TX_OK; - } - -drop: - dev_kfree_skb_any(skb); - dev_info->stats.stats.tx_dropped++; - - return NETDEV_TX_BUSY; -} - -/* - * syn_dp_if_pause_on_off() - */ -static int syn_dp_if_pause_on_off(struct nss_dp_data_plane_ctx *dpc, uint32_t pause_on) -{ - return NSS_DP_SUCCESS; -} - -/* - * syn_dp_if_get_stats - * Get Synopsys GMAC data plane stats - */ -static void syn_dp_if_get_stats(struct nss_dp_data_plane_ctx *dpc, struct nss_dp_gmac_stats *stats) -{ - struct net_device *netdev = dpc->dev; - struct nss_dp_dev *gmac_dev = (struct nss_dp_dev *)netdev_priv(netdev); - struct syn_dp_info *dev_info = &dp_info[gmac_dev->macid - 1]; - - spin_lock_bh(&dev_info->stats_lock); - netdev_dbg(netdev, "GETTING stats: rx_packets:%llu rx_bytes:%llu mmc_rx_crc_errors:%llu", dev_info->stats.stats.rx_packets, - dev_info->stats.stats.rx_bytes, dev_info->stats.stats.mmc_rx_crc_errors); - memcpy(stats, &dev_info->stats, sizeof(*stats)); - spin_unlock_bh(&dev_info->stats_lock); -} - -/* - * syn_dp_if_deinit() - * Free all the Synopsys GMAC resources - */ -static int syn_dp_if_deinit(struct nss_dp_data_plane_ctx *dpc) -{ - struct net_device *netdev = dpc->dev; - struct nss_dp_dev *gmac_dev = (struct nss_dp_dev *)netdev_priv(netdev); - struct syn_dp_info *dev_info = &dp_info[gmac_dev->macid - 1]; - - if (dev_info->napi_added) { - /* - * Remove interrupt handlers and NAPI - */ - if (gmac_dev->drv_flags & NSS_DP_PRIV_FLAG(IRQ_REQUESTED)) { - netdev_dbg(netdev, "Freeing IRQ %d for Mac %d\n", netdev->irq, gmac_dev->macid); - synchronize_irq(netdev->irq); - free_irq(netdev->irq, gmac_dev); - gmac_dev->drv_flags &= ~NSS_DP_PRIV_FLAG(IRQ_REQUESTED); - } - - netif_napi_del(&gmac_dev->napi); - dev_info->napi_added = 0; - } - - /* - * Cleanup and free the rings - */ - syn_dp_cleanup_rings(gmac_dev, netdev, dev_info); - - return NSS_DP_SUCCESS; -} - -/* - * nss_dp_gmac_ops - * Data plane operations for Synopsys GMAC - */ -struct nss_dp_data_plane_ops nss_dp_gmac_ops = { - .init = syn_dp_if_init, - .open = syn_dp_if_open, - .close = syn_dp_if_close, - .link_state = syn_dp_if_link_state, - .mac_addr = syn_dp_if_mac_addr, - .change_mtu = syn_dp_if_change_mtu, - .xmit = syn_dp_if_xmit, - .set_features = syn_dp_if_set_features, - .pause_on_off = syn_dp_if_pause_on_off, - .get_stats = syn_dp_if_get_stats, - .deinit = syn_dp_if_deinit, -}; diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_data_plane.h b/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_data_plane.h deleted file mode 100644 index c96309599..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_data_plane.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifndef __NSS_DP_SYN_DATAPLANE__ -#define __NSS_DP_SYN_DATAPLANE__ - -#include "nss_dp_dev.h" -#include "syn_dma_desc.h" - -#define SYN_DP_TX_DESC_SIZE 128 /* Tx Descriptors needed in the descriptor pool/queue */ -#define SYN_DP_RX_DESC_SIZE 128 /* Rx Descriptors needed in the descriptor pool/queue */ -#define SYN_DP_MINI_JUMBO_FRAME_MTU 1978 -#define SYN_DP_MAX_DESC_BUFF 0x1FFF /* Max size of buffer that can be programed into one field of desc */ - -/* - * syn_dp_info - * Synopysys GMAC Dataplane information - */ -struct syn_dp_info { - struct nss_dp_gmac_stats stats; /* GMAC driver stats */ - - struct sk_buff *rx_skb_list[SYN_DP_RX_DESC_SIZE]; /* Rx skb pool helping RX DMA descriptors*/ - - dma_addr_t rx_desc_dma; /* Dma-albe address of first rx descriptor - either in ring or chain mode, this is - used by the GMAC device */ - - struct dma_desc *rx_desc; /* start address of RX descriptors ring or - chain, this is used by the driver */ - - uint32_t busy_rx_desc; /* Number of Rx Descriptors owned by - DMA at any given time */ - - uint32_t rx_desc_count; /* number of rx descriptors in the - tx descriptor queue/pool */ - - uint32_t rx_busy; /* index of the rx descriptor owned by DMA, - obtained by nss_gmac_get_rx_qptr() */ - - uint32_t rx_next; /* index of the rx descriptor next available - with driver, given to DMA by - nss_gmac_set_rx_qptr()*/ - - struct dma_desc *rx_busy_desc; /* Rx Descriptor address corresponding - to the index tx_busy */ - - struct dma_desc *rx_next_desc; /* Rx Descriptor address corresponding - to the index rx_next */ - - struct sk_buff *tx_skb_list[SYN_DP_RX_DESC_SIZE]; /* Tx skb pool helping RX DMA descriptors*/ - - dma_addr_t tx_desc_dma; /* Dma-able address of first tx descriptor - either in ring or chain mode, this is used - by the GMAC device */ - - struct dma_desc *tx_desc; /* start address of TX descriptors ring or - chain, this is used by the driver */ - - uint32_t busy_tx_desc; /* Number of Tx Descriptors owned by - DMA at any given time */ - - uint32_t tx_desc_count; /* number of tx descriptors in the - rx descriptor queue/pool */ - - uint32_t tx_busy; /* index of the tx descriptor owned by DMA, - is obtained by nss_gmac_get_tx_qptr() */ - - uint32_t tx_next; /* index of the tx descriptor next available - with driver, given to DMA by - nss_gmac_set_tx_qptr() */ - - struct dma_desc *tx_busy_desc; /* Tx Descriptor address corresponding - to the index tx_busy */ - - struct dma_desc *tx_next_desc; /* Tx Descriptor address corresponding - to the index tx_next */ - - spinlock_t data_lock; /* Lock to protect datapath */ - spinlock_t stats_lock; /* Lock to protect datapath */ - int napi_added; /* flag to indicate napi add status */ -}; - -/* - * GMAC Tx/Tx APIs - */ -int syn_dp_setup_rings(struct nss_dp_dev *gmac_dev, struct net_device *netdev, struct device *dev, struct syn_dp_info *dev_info); -int syn_dp_cleanup_rings(struct nss_dp_dev *gmac_dev, struct net_device *netdev, struct syn_dp_info *dev_info); - -int syn_dp_rx(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info, int budget); -void syn_dp_rx_refill(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info); - -int syn_dp_tx(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info, struct sk_buff *skb); -void syn_dp_process_tx_complete(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info); - -#endif /* __NSS_DP_SYN_DATAPLANE__ */ \ No newline at end of file diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dma_desc.h b/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dma_desc.h deleted file mode 100644 index 5b50d388f..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dma_desc.h +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __SYN_DESC__ -#define __SYN_DESC__ - -/********************************************************** - * DMA Engine descriptors - **********************************************************/ -/* -******Enhanced Descritpor structure to support 8K buffer per buffer ******* - -dma_rx_base_addr = 0x000C, CSR3 - Receive Descriptor list base address -dma_rx_base_addr is the pointer to the first Rx Descriptors. -The Descriptor format in Little endian with a 32 bit Data bus is as shown below. - -Similarly -dma_tx_base_addr = 0x0010, CSR4 - Transmit Descriptor list base address -dma_tx_base_addr is the pointer to the first Tx Descriptors. -The Descriptor format in Little endian with a 32 bit Data bus is as shown below. - ------------------------------------------------------------------------- - RDES0 |OWN (31)| Status | - ------------------------------------------------------------------------- - RDES1 | Ctrl | Res | Byte Count Buffer 2 | Ctrl | Res | Byte Count Buffer 1 | - ------------------------------------------------------------------------- - RDES2 | Buffer 1 Address | - ------------------------------------------------------------------------- - RDES3 | Buffer 2 Address / Next Descriptor Address | - ------------------------------------------------------------------------- - RDES4 | Extended Status | - ------------------------------------------------------------------------- - RDES5 | Reserved | - ------------------------------------------------------------------------- - RDES6 | Receive Timestamp Low | - ------------------------------------------------------------------------- - RDES7 | Receive Timestamp High | - ------------------------------------------------------------------------- - - ------------------------------------------------------------------------ - TDES0 |OWN (31)| Ctrl | Res | Ctrl | Res | Status | - ------------------------------------------------------------------------ - TDES1 | Res | Byte Count Buffer 2 | Res | Byte Count Buffer 1 | - ------------------------------------------------------------------------ - TDES2 | Buffer 1 Address | - ------------------------------------------------------------------------ - TDES3 | Buffer 2 Address / Next Descriptor Address | - ------------------------------------------------------------------------ - TDES4 | Reserved | - ------------------------------------------------------------------------ - TDES5 | Reserved | - ------------------------------------------------------------------------ - TDES6 | Transmit Timestamp Low | - ------------------------------------------------------------------------ - TDES7 | Transmit Timestamp Higher | - ------------------------------------------------------------------------ -*/ - -/* - * dma_descriptor_status - * status word of DMA descriptor - */ -enum dma_descriptor_status { - desc_own_by_dma = 0x80000000, /* (OWN)Descriptor is - owned by DMA engine */ - desc_rx_da_filter_fail = 0x40000000, /* (AFM)Rx - DA Filter - Fail for the rx frame */ - desc_rx_frame_length_mask = 0x3FFF0000, /* (FL)Receive descriptor - frame length */ - desc_rx_frame_length_shift = 16, - desc_rx_error = 0x00008000, /* (ES)Error summary bit - - OR of the following bits: - DE || OE || IPC || GF || LC || RWT - || RE || CE */ - desc_rx_truncated = 0x00004000, /* (DE)Rx - no more descriptors - for receive frame */ - desc_sa_filter_fail = 0x00002000, /* (SAF)Rx - SA Filter Fail for - the received frame */ - desc_rx_length_error = 0x00001000, /* (LE)Rx - frm size not - matching with len field */ - desc_rx_overflow = 0x00000800, /* (OE)Rx - frm was damaged due - to buffer overflow */ - desc_rx_vlan_tag = 0x00000400, /* (VLAN)Rx - received frame - is a VLAN frame */ - desc_rx_first = 0x00000200, /* (FS)Rx - first - descriptor of the frame */ - desc_rx_last = 0x00000100, /* (LS)Rx - last - descriptor of the frame */ - desc_rx_long_frame = 0x00000080, /* (Giant Frame)Rx - frame is - longer than 1518/1522 */ - desc_rx_collision = 0x00000040, /* (LC)Rx - late collision - occurred during reception */ - desc_rx_frame_ether = 0x00000020, /* (FT)Rx - Frame type - Ether, - otherwise 802.3 */ - desc_rx_watchdog = 0x00000010, /* (RWT)Rx - watchdog timer - expired during reception */ - desc_rx_mii_error = 0x00000008, /* (RE)Rx - error reported - by MII interface */ - desc_rx_dribbling = 0x00000004, /* (DE)Rx - frame contains non - int multiple of 8 bits */ - desc_rx_crc = 0x00000002, /* (CE)Rx - CRC error */ - desc_rx_ext_sts = 0x00000001, /* Extended Status Available - in RDES4 */ - desc_tx_error = 0x00008000, /* (ES)Error summary Bits */ - desc_tx_int_enable = 0x40000000, /* (IC)Tx - interrupt on - completion */ - desc_tx_last = 0x20000000, /* (LS)Tx - Last segment of the - frame */ - desc_tx_first = 0x10000000, /* (FS)Tx - First segment of the - frame */ - desc_tx_disable_crc = 0x08000000, /* (DC)Tx - Add CRC disabled - (first segment only) */ - desc_tx_disable_padd = 0x04000000, /* (DP)disable padding, - added by - reyaz */ - desc_tx_cis_mask = 0x00c00000, /* Tx checksum offloading - control mask */ - desc_tx_cis_bypass = 0x00000000, /* Checksum bypass */ - desc_tx_cis_ipv4_hdr_cs = 0x00400000, /* IPv4 header checksum */ - desc_tx_cis_tcp_only_cs = 0x00800000, /* TCP/UDP/ICMP checksum. - Pseudo header checksum - is assumed to be present */ - desc_tx_cis_tcp_pseudo_cs = 0x00c00000, /* TCP/UDP/ICMP checksum fully - in hardware including - pseudo header */ - desc_tx_desc_end_of_ring = 0x00200000, /* (TER)End of descriptor ring*/ - desc_tx_desc_chain = 0x00100000, /* (TCH)Second buffer address - is chain address */ - desc_rx_chk_bit0 = 0x00000001, /* Rx Payload Checksum Error */ - desc_rx_chk_bit7 = 0x00000080, /* (IPC CS ERROR)Rx - Ipv4 - header checksum error */ - desc_rx_chk_bit5 = 0x00000020, /* (FT)Rx - Frame type - Ether, - otherwise 802.3 */ - desc_rx_ts_avail = 0x00000080, /* Time stamp available */ - desc_rx_frame_type = 0x00000020, /* (FT)Rx - Frame type - Ether, - otherwise 802.3 */ - desc_tx_ipv4_chk_error = 0x00010000, /* (IHE) Tx Ip header error */ - desc_tx_timeout = 0x00004000, /* (JT)Tx - Transmit - jabber timeout */ - desc_tx_frame_flushed = 0x00002000, /* (FF)Tx - DMA/MTL flushed - the frame due to SW flush */ - desc_tx_pay_chk_error = 0x00001000, /* (PCE) Tx Payload checksum - Error */ - desc_tx_lost_carrier = 0x00000800, /* (LC)Tx - carrier lost - during tramsmission */ - desc_tx_no_carrier = 0x00000400, /* (NC)Tx - no carrier signal - from the tranceiver */ - desc_tx_late_collision = 0x00000200, /* (LC)Tx - transmission aborted - due to collision */ - desc_tx_exc_collisions = 0x00000100, /* (EC)Tx - transmission aborted - after 16 collisions */ - desc_tx_vlan_frame = 0x00000080, /* (VF)Tx - VLAN-type frame */ - desc_tx_coll_mask = 0x00000078, /* (CC)Tx - Collision count */ - desc_tx_coll_shift = 3, - desc_tx_exc_deferral = 0x00000004, /* (ED)Tx - excessive deferral */ - desc_tx_underflow = 0x00000002, /* (UF)Tx - late data arrival - from the memory */ - desc_tx_deferred = 0x00000001, /* (DB)Tx - frame - transmision deferred */ - - /* - * This explains the RDES1/TDES1 bits layout - * ------------------------------------------------------ - * RDES1/TDES1 | Control Bits | Byte Count Buf 2 | Byte Count Buf 1 | - * ------------------------------------------------------ - */ - - /* dma_descriptor_length */ /* length word of DMA descriptor */ - desc_rx_dis_int_compl = 0x80000000, /* (Disable Rx int on completion) */ - desc_rx_desc_end_of_ring = 0x00008000, /* (RER)End of descriptor ring */ - desc_rx_desc_chain = 0x00004000, /* (RCH)Second buffer address - is chain address */ - desc_size2_mask = 0x1FFF0000, /* (RBS2/TBS2) Buffer 2 size */ - desc_size2_shift = 16, - desc_size1_mask = 0x00001FFF, /* (RBS1/TBS1) Buffer 1 size */ - desc_size1_shift = 0, - - /* - * This explains the RDES4 Extended Status bits layout - * -------------------------------------------------------- - * RDES4 | Extended Status | - * -------------------------------------------------------- - */ - desc_rx_ts_dropped = 0x00004000, /* PTP snapshot available */ - desc_rx_ptp_ver = 0x00002000, /* When set indicates IEEE1584 - Version 2 (else Ver1) */ - desc_rx_ptp_frame_type = 0x00001000, /* PTP frame type Indicates PTP - sent over ethernet */ - desc_rx_ptp_message_type = 0x00000F00, /* Message Type */ - desc_rx_ptp_no = 0x00000000, /* 0000 => No PTP message rcvd */ - desc_rx_ptp_sync = 0x00000100, /* 0001 => Sync (all clock - types) received */ - desc_rx_ptp_follow_up = 0x00000200, /* 0010 => Follow_Up (all clock - types) received */ - desc_rx_ptp_delay_req = 0x00000300, /* 0011 => Delay_Req (all clock - types) received */ - desc_rx_ptp_delay_resp = 0x00000400, /* 0100 => Delay_Resp (all clock - types) received */ - desc_rx_ptp_pdelay_req = 0x00000500, /* 0101 => Pdelay_Req (in P - to P tras clk) or Announce - in Ord and Bound clk */ - desc_rx_ptp_pdelay_resp = 0x00000600, /* 0110 => Pdealy_Resp(in P to - P trans clk) or Management in - Ord and Bound clk */ - desc_rx_ptp_pdelay_resp_fp = 0x00000700,/* 0111 => Pdelay_Resp_Follow_Up - (in P to P trans clk) or - Signaling in Ord and Bound - clk */ - desc_rx_ptp_ipv6 = 0x00000080, /* Received Packet is in IPV6 */ - desc_rx_ptp_ipv4 = 0x00000040, /* Received Packet is in IPV4 */ - desc_rx_chk_sum_bypass = 0x00000020, /* When set indicates checksum - offload engine is bypassed */ - desc_rx_ip_payload_error = 0x00000010, /* When set indicates 16bit IP - payload CS is in error */ - desc_rx_ip_header_error = 0x00000008, /* When set indicates 16bit IPV4 - hdr CS is err or IP datagram - version is not consistent - with Ethernet type value */ - desc_rx_ip_payload_type = 0x00000007, /* Indicate the type of payload - encapsulated in IPdatagram - processed by COE (Rx) */ - desc_rx_ip_payload_unknown = 0x00000000,/* Unknown or didnot process - IP payload */ - desc_rx_ip_payload_udp = 0x00000001, /* UDP */ - desc_rx_ip_payload_tcp = 0x00000002, /* TCP */ - desc_rx_ip_payload_icmp = 0x00000003, /* ICMP */ -}; - -/* - * dma_desc - * DMA Descriptor Structure - * - * The structure is common for both receive and transmit descriptors. - */ -struct dma_desc { - uint32_t status; /* Status */ - uint32_t length; /* Buffer 1 and Buffer 2 length */ - uint32_t buffer1; /* Network Buffer 1 pointer (DMA-able)*/ - uint32_t data1; /* This holds virtual address of - buffer1, not used by DMA */ - - /* This data below is used only by driver */ - uint32_t extstatus; /* Extended status of a Rx Descriptor */ - uint32_t reserved1; /* Reserved word */ - uint32_t timestamplow; /* Lower 32 bits of the 64 - bit timestamp value */ - uint32_t timestamphigh; /* Higher 32 bits of the 64 - bit timestamp value */ -}; - -/* - * syn_dp_gmac_tx_checksum_offload_tcp_pseudo - * The checksum offload engine is enabled to do complete checksum computation. - */ -static inline void syn_dp_gmac_tx_checksum_offload_tcp_pseudo(struct dma_desc *desc) -{ - desc->status = ((desc->status & (~desc_tx_cis_mask)) | desc_tx_cis_tcp_pseudo_cs); -} - -/* - * syn_dp_gmac_tx_desc_init_ring - * Initialize the tx descriptors for ring or chain mode operation. - */ -static inline void syn_dp_gmac_tx_desc_init_ring(struct dma_desc *desc, uint32_t no_of_desc) -{ - struct dma_desc *last_desc = desc + no_of_desc - 1; - memset(desc, 0, no_of_desc * sizeof(struct dma_desc)); - last_desc->status = desc_tx_desc_end_of_ring; -} - -/* - * syn_dp_gmac_rx_desc_init_ring - * Initialize the rx descriptors for ring or chain mode operation. - */ -static inline void syn_dp_gmac_rx_desc_init_ring(struct dma_desc *desc, uint32_t no_of_desc) -{ - struct dma_desc *last_desc = desc + no_of_desc - 1; - memset(desc, 0, no_of_desc * sizeof(struct dma_desc)); - last_desc->length = desc_rx_desc_end_of_ring; -} - -/* - * syn_dp_gmac_is_rx_desc_valid - * Checks whether the rx descriptor is valid. - */ -static inline bool syn_dp_gmac_is_rx_desc_valid(uint32_t status) -{ - return (status & (desc_rx_error | desc_rx_first | desc_rx_last)) == - (desc_rx_first | desc_rx_last); -} - -/* - * syn_dp_gmac_get_rx_desc_frame_length - * Returns the byte length of received frame including CRC. - */ -static inline uint32_t syn_dp_gmac_get_rx_desc_frame_length(uint32_t status) -{ - return (status & desc_rx_frame_length_mask) >> desc_rx_frame_length_shift; -} - -/* - * syn_dp_gmac_is_desc_owned_by_dma - * Checks whether the descriptor is owned by DMA. - */ -static inline bool syn_dp_gmac_is_desc_owned_by_dma(struct dma_desc *desc) -{ - return (desc->status & desc_own_by_dma) == desc_own_by_dma; -} - -/* - * syn_dp_gmac_is_desc_empty - * Checks whether the descriptor is empty. - */ -static inline bool syn_dp_gmac_is_desc_empty(struct dma_desc *desc) -{ - /* - * If length of both buffer1 & buffer2 are zero then desc is empty - */ - return (desc->length & desc_size1_mask) == 0; -} - -/* - * syn_dp_gmac_get_tx_collision_count - * Gives the transmission collision count. - */ -static inline uint32_t syn_dp_gmac_get_tx_collision_count(uint32_t status) -{ - return (status & desc_tx_coll_mask) >> desc_tx_coll_shift; -} - -#endif /* __SYN_DESC__ */ \ No newline at end of file diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dp_cfg.c b/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dp_cfg.c deleted file mode 100644 index ff1869990..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dp_cfg.c +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include "nss_dp_dev.h" -#include "syn_data_plane.h" -#include "syn_reg.h" - -/* - * syn_dp_setup_rx_desc_queue - * This sets up the receive Descriptor queue in ring or chain mode. - */ -static int syn_dp_setup_rx_desc_queue(struct net_device *netdev, struct device *dev, struct syn_dp_info *dev_info, - uint32_t no_of_desc, uint32_t desc_mode) -{ - struct dma_desc *first_desc = NULL; - dma_addr_t dma_addr; - - dev_info->rx_desc_count = 0; - - BUG_ON(desc_mode != RINGMODE); - BUG_ON((no_of_desc & (no_of_desc - 1)) != 0); - - netdev_dbg(netdev, "total size of memory required for Rx Descriptors in Ring Mode = %u\n", (uint32_t)((sizeof(struct dma_desc) * no_of_desc))); - - first_desc = dma_alloc_coherent(dev, sizeof(struct dma_desc) * no_of_desc, &dma_addr, GFP_KERNEL); - if (first_desc == NULL) { - netdev_dbg(netdev, "Error in Rx Descriptor Memory allocation in Ring mode\n"); - return -ENOMEM; - } - - dev_info->rx_desc_count = no_of_desc; - dev_info->rx_desc = first_desc; - dev_info->rx_desc_dma = dma_addr; - - netdev_dbg(netdev, "Rx Descriptors in Ring Mode: No. of descriptors = %d base = 0x%px dma = 0x%px\n", - no_of_desc, first_desc, (void *)dma_addr); - - syn_dp_gmac_rx_desc_init_ring(dev_info->rx_desc, no_of_desc); - - dev_info->rx_next = 0; - dev_info->rx_busy = 0; - dev_info->rx_next_desc = first_desc; - dev_info->rx_busy_desc = first_desc; - dev_info->busy_rx_desc = 0; - - return 0; -} - -/* - * syn_dp_setup_tx_desc_queue - * This sets up the transmit Descriptor queue in ring or chain mode. - */ -static int syn_dp_setup_tx_desc_queue(struct net_device *netdev, struct device *dev, struct syn_dp_info *dev_info, - uint32_t no_of_desc, uint32_t desc_mode) -{ - struct dma_desc *first_desc = NULL; - dma_addr_t dma_addr; - - dev_info->tx_desc_count = 0; - - BUG_ON(desc_mode != RINGMODE); - BUG_ON((no_of_desc & (no_of_desc - 1)) != 0); - - netdev_dbg(netdev, "Total size of memory required for Tx Descriptors in Ring Mode = %u\n", (uint32_t)((sizeof(struct dma_desc) * no_of_desc))); - - first_desc = dma_alloc_coherent(dev, sizeof(struct dma_desc) * no_of_desc, &dma_addr, GFP_KERNEL); - if (first_desc == NULL) { - netdev_dbg(netdev, "Error in Tx Descriptors memory allocation\n"); - return -ENOMEM; - } - - dev_info->tx_desc_count = no_of_desc; - dev_info->tx_desc = first_desc; - dev_info->tx_desc_dma = dma_addr; - netdev_dbg(netdev, "Tx Descriptors in Ring Mode: No. of descriptors = %d base = 0x%px dma = 0x%px\n" - , no_of_desc, first_desc, (void *)dma_addr); - - syn_dp_gmac_tx_desc_init_ring(dev_info->tx_desc, dev_info->tx_desc_count); - - dev_info->tx_next = 0; - dev_info->tx_busy = 0; - dev_info->tx_next_desc = first_desc; - dev_info->tx_busy_desc = first_desc; - dev_info->busy_tx_desc = 0; - - return 0; -} - -/* - * syn_dp_setup_rings - * Perform initial setup of Tx/Rx rings - */ -int syn_dp_setup_rings(struct nss_dp_dev *gmac_dev, struct net_device *netdev, struct device *dev, struct syn_dp_info *dev_info) -{ - struct nss_gmac_hal_dev *nghd = gmac_dev->gmac_hal_ctx; - int err; - - err = syn_dp_setup_rx_desc_queue(netdev, dev, dev_info, SYN_DP_RX_DESC_SIZE, RINGMODE); - if (err) { - netdev_dbg(netdev, "nss_dp_gmac: rx descriptor setup unsuccessfull, err code: %d", err); - return NSS_DP_FAILURE; - } - - err = syn_dp_setup_tx_desc_queue(netdev, dev, dev_info, SYN_DP_TX_DESC_SIZE, RINGMODE); - if (err) { - netdev_dbg(netdev, "nss_dp_gmac: tx descriptor setup unsuccessfull, err code: %d", err); - return NSS_DP_FAILURE; - } - - syn_dp_rx_refill(gmac_dev, dev_info); - - syn_init_tx_desc_base(nghd, dev_info->tx_desc_dma); - syn_init_rx_desc_base(nghd, dev_info->rx_desc_dma); - - return NSS_DP_SUCCESS; -} - -/* - * syn_dp_cleanup_rings - * Cleanup Synopsys GMAC rings - */ -int syn_dp_cleanup_rings(struct nss_dp_dev *gmac_dev, struct net_device *netdev, struct syn_dp_info *dev_info) -{ - uint32_t rx_skb_index; - struct dma_desc *rxdesc; - - uint32_t tx_skb_index; - struct dma_desc *txdesc; - int i; - struct sk_buff *skb; - - /* - * Rx Ring cleaning - * We are assuming that the NAPI poll was already completed. - * No need of a lock here since the NAPI and interrupts have been disabled now - */ - rx_skb_index = dev_info->rx_busy; - for (i = 0; i < dev_info->busy_rx_desc; i++) { - rx_skb_index = rx_skb_index & (dev_info->rx_desc_count - 1); - rxdesc = dev_info->rx_busy_desc; - - dma_unmap_single(&(gmac_dev->netdev->dev), rxdesc->buffer1, - SYN_DP_MINI_JUMBO_FRAME_MTU, DMA_FROM_DEVICE); - - skb = dev_info->rx_skb_list[rx_skb_index]; - if (unlikely(skb != NULL)) { - dev_kfree_skb(skb); - dev_info->rx_skb_list[rx_skb_index] = NULL; - } - } - - dma_free_coherent(&(gmac_dev->netdev->dev), (sizeof(struct dma_desc) * SYN_DP_RX_DESC_SIZE), - dev_info->rx_desc, dev_info->rx_desc_dma); - - /* - * Tx Ring cleaning - */ - spin_lock_bh(&dev_info->data_lock); - - tx_skb_index = dev_info->tx_busy; - for (i = 0; i < dev_info->busy_tx_desc; i++) { - tx_skb_index = tx_skb_index & (dev_info->tx_desc_count - 1); - txdesc = dev_info->tx_busy_desc; - - dma_unmap_single(&(gmac_dev->netdev->dev), txdesc->buffer1, - SYN_DP_MINI_JUMBO_FRAME_MTU, DMA_FROM_DEVICE); - - skb = dev_info->tx_skb_list[tx_skb_index]; - if (unlikely(skb != NULL)) { - dev_kfree_skb(skb); - dev_info->tx_skb_list[tx_skb_index] = NULL; - } - } - - spin_unlock_bh(&dev_info->data_lock); - - dma_free_coherent(&(gmac_dev->netdev->dev), (sizeof(struct dma_desc) * SYN_DP_TX_DESC_SIZE), - dev_info->tx_desc, dev_info->tx_desc_dma); - - return 0; -} \ No newline at end of file diff --git a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dp_tx_rx.c b/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dp_tx_rx.c deleted file mode 100644 index ea01884d8..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/hal/syn_gmac_dp/syn_dp_tx_rx.c +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include - -#include -#include -#include - -#include "syn_data_plane.h" -#include "syn_reg.h" - -/* - * syn_dp_reset_rx_qptr - * Reset the descriptor after Rx is over. - */ -static inline void syn_dp_reset_rx_qptr(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info) -{ - - /* Index of descriptor the DMA just completed. - * May be useful when data is spread over multiple buffers/descriptors - */ - uint32_t rxnext = dev_info->rx_busy; - struct dma_desc *rxdesc = dev_info->rx_busy_desc; - - BUG_ON(rxdesc != (dev_info->rx_desc + rxnext)); - dev_info->rx_busy = (rxnext + 1) & (dev_info->rx_desc_count - 1); - dev_info->rx_busy_desc = dev_info->rx_desc + dev_info->rx_busy; - - dev_info->rx_skb_list[rxnext] = NULL; - rxdesc->status = 0; - rxdesc->length &= desc_rx_desc_end_of_ring; - rxdesc->buffer1 = 0; - rxdesc->data1 = 0; - rxdesc->reserved1 = 0; - - /* - * This returns one descriptor to processor. So busy count will be decremented by one. - */ - dev_info->busy_rx_desc--; -} - -/* - * syn_dp_set_rx_qptr - * Prepares the descriptor to receive packets. - */ -static inline int32_t syn_dp_set_rx_qptr(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info, - uint32_t Buffer1, uint32_t Length1, struct sk_buff *skb) -{ - uint32_t rxnext = dev_info->rx_next; - struct dma_desc *rxdesc = dev_info->rx_next_desc; - uint32_t rx_skb_index = rxnext; - - BUG_ON(dev_info->busy_rx_desc >= dev_info->rx_desc_count); - BUG_ON(rxdesc != (dev_info->rx_desc + rxnext)); - BUG_ON(!syn_dp_gmac_is_desc_empty(rxdesc)); - BUG_ON(syn_dp_gmac_is_desc_owned_by_dma(rxdesc)); - - if (Length1 > SYN_DP_MAX_DESC_BUFF) { - rxdesc->length |= (SYN_DP_MAX_DESC_BUFF << desc_size1_shift) & desc_size1_mask; - rxdesc->length |= ((Length1 - SYN_DP_MAX_DESC_BUFF) << desc_size2_shift) & desc_size2_mask; - } else { - rxdesc->length |= ((Length1 << desc_size1_shift) & desc_size1_mask); - } - - rxdesc->buffer1 = Buffer1; - dev_info->rx_skb_list[rx_skb_index] = skb; - - /* Program second buffer address if using two buffers. */ - if (Length1 > SYN_DP_MAX_DESC_BUFF) - rxdesc->data1 = Buffer1 + SYN_DP_MAX_DESC_BUFF; - else - rxdesc->data1 = 0; - - rxdesc->extstatus = 0; - rxdesc->timestamplow = 0; - rxdesc->timestamphigh = 0; - - /* - * Ensure all write completed before setting own by dma bit so when gmac - * HW takeover this descriptor, all the fields are filled correctly - */ - wmb(); - rxdesc->status = desc_own_by_dma; - - dev_info->rx_next = (rxnext + 1) & (dev_info->rx_desc_count - 1); - dev_info->rx_next_desc = dev_info->rx_desc + dev_info->rx_next; - - /* - * 1 descriptor will be given to HW. So busy count incremented by 1. - */ - dev_info->busy_rx_desc++; - - return rxnext; -} - -/* - * syn_dp_rx_refill - * Refill the RX descrptor - */ -void syn_dp_rx_refill(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info) -{ - struct net_device *netdev = gmac_dev->netdev; - struct device *dev = &gmac_dev->pdev->dev; - int empty_count = SYN_DP_RX_DESC_SIZE - dev_info->busy_rx_desc; - - dma_addr_t dma_addr; - int i; - struct sk_buff *skb; - - for (i = 0; i < empty_count; i++) { - skb = __netdev_alloc_skb(netdev, SYN_DP_MINI_JUMBO_FRAME_MTU, GFP_ATOMIC); - if (unlikely(skb == NULL)) { - netdev_dbg(netdev, "Unable to allocate skb, will try next time\n"); - break; - } - - skb_reserve(skb, NET_IP_ALIGN); - - dma_addr = dma_map_single(dev, skb->data, SYN_DP_MINI_JUMBO_FRAME_MTU, DMA_FROM_DEVICE); - if (unlikely(dma_mapping_error(dev, dma_addr))) { - dev_kfree_skb(skb); - netdev_dbg(netdev, "DMA mapping failed for empty buffer\n"); - break; - } - - syn_dp_set_rx_qptr(gmac_dev, dev_info, dma_addr, SYN_DP_MINI_JUMBO_FRAME_MTU, skb); - } -} - -/* - * syn_dp_rx() - * Process RX packets - */ -int syn_dp_rx(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info, int budget) -{ - struct dma_desc *desc = NULL; - int frame_length, busy; - uint32_t status; - struct sk_buff *rx_skb; - uint32_t rx_skb_index; - - if (!dev_info->busy_rx_desc) { - /* no desc are held by gmac dma, we are done */ - return 0; - } - - busy = dev_info->busy_rx_desc; - if (busy > budget) - busy = budget; - - do { - desc = dev_info->rx_busy_desc; - if (syn_dp_gmac_is_desc_owned_by_dma(desc)) { - /* desc still hold by gmac dma, so we are done */ - break; - } - - status = desc->status; - - rx_skb_index = dev_info->rx_busy; - rx_skb = dev_info->rx_skb_list[rx_skb_index]; - - dma_unmap_single(&(gmac_dev->netdev->dev), desc->buffer1, - SYN_DP_MINI_JUMBO_FRAME_MTU, DMA_FROM_DEVICE); - - spin_lock_bh(&dev_info->stats_lock); - if (likely(syn_dp_gmac_is_rx_desc_valid(status))) { - /* We have a pkt to process get the frame length */ - frame_length = syn_dp_gmac_get_rx_desc_frame_length(status); - /* Get rid of FCS: 4 */ - frame_length -= ETH_FCS_LEN; - - /* Valid packet, collect stats */ - dev_info->stats.stats.rx_packets++; - dev_info->stats.stats.rx_bytes += frame_length; - - /* type_trans and deliver to linux */ - skb_put(rx_skb, frame_length); - rx_skb->protocol = eth_type_trans(rx_skb, gmac_dev->netdev); - rx_skb->ip_summed = CHECKSUM_UNNECESSARY; - napi_gro_receive(&gmac_dev->napi, rx_skb); - - } else { - dev_info->stats.stats.rx_errors++; - dev_kfree_skb(rx_skb); - - if (status & (desc_rx_crc | desc_rx_collision | - desc_rx_overflow | desc_rx_dribbling | - desc_rx_length_error)) { - dev_info->stats.stats.mmc_rx_crc_errors += (status & desc_rx_crc) ? 1 : 0; - dev_info->stats.stats.rx_late_collision_errors += (status & desc_rx_collision) ? 1 : 0; - dev_info->stats.stats.mmc_rx_overflow_errors += (status & desc_rx_overflow) ? 1 : 0; - dev_info->stats.stats.rx_dribble_bit_errors += (status & desc_rx_dribbling) ? 1 : 0; - dev_info->stats.stats.rx_length_errors += (status & desc_rx_length_error) ? 1 : 0; - } - } - - spin_unlock_bh(&dev_info->stats_lock); - - syn_dp_reset_rx_qptr(gmac_dev, dev_info); - busy--; - } while (busy > 0); - return budget - busy; -} - -/* - * syn_dp_reset_tx_qptr - * Reset the descriptor after Tx is over. - */ -static inline void syn_dp_reset_tx_qptr(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info) -{ - uint32_t txover = dev_info->tx_busy; - struct dma_desc *txdesc = dev_info->tx_busy_desc; - - BUG_ON(txdesc != (dev_info->tx_desc + txover)); - dev_info->tx_busy = (txover + 1) & (dev_info->tx_desc_count - 1); - dev_info->tx_busy_desc = dev_info->tx_desc + dev_info->tx_busy; - - dev_info->tx_skb_list[txover] = NULL; - txdesc->status &= desc_tx_desc_end_of_ring; - txdesc->length = 0; - txdesc->buffer1 = 0; - txdesc->data1 = 0; - txdesc->reserved1 = 0; - - /* - * Busy tx descriptor is reduced by one as - * it will be handed over to Processor now. - */ - dev_info->busy_tx_desc--; -} - -/* - * syn_dp_set_tx_qptr - * Populate the tx desc structure with the buffer address. - */ -static inline struct dma_desc *syn_dp_set_tx_qptr(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info, - uint32_t Buffer1, uint32_t Length1, struct sk_buff *skb, uint32_t offload_needed, - uint32_t tx_cntl, uint32_t set_dma) -{ - uint32_t txnext = dev_info->tx_next; - struct dma_desc *txdesc = dev_info->tx_next_desc; - uint32_t tx_skb_index = txnext; - - BUG_ON(dev_info->busy_tx_desc > dev_info->tx_desc_count); - BUG_ON(txdesc != (dev_info->tx_desc + txnext)); - BUG_ON(!syn_dp_gmac_is_desc_empty(txdesc)); - BUG_ON(syn_dp_gmac_is_desc_owned_by_dma(txdesc)); - - if (Length1 > SYN_DP_MAX_DESC_BUFF) { - txdesc->length |= (SYN_DP_MAX_DESC_BUFF << desc_size1_shift) & desc_size1_mask; - txdesc->length |= - ((Length1 - SYN_DP_MAX_DESC_BUFF) << desc_size2_shift) & desc_size2_mask; - } else { - txdesc->length |= ((Length1 << desc_size1_shift) & desc_size1_mask); - } - - txdesc->status |= tx_cntl; - txdesc->buffer1 = Buffer1; - - dev_info->tx_skb_list[tx_skb_index] = skb; - - /* Program second buffer address if using two buffers. */ - if (Length1 > SYN_DP_MAX_DESC_BUFF) - txdesc->data1 = Buffer1 + SYN_DP_MAX_DESC_BUFF; - else - txdesc->data1 = 0; - - if (likely(offload_needed)) { - syn_dp_gmac_tx_checksum_offload_tcp_pseudo(txdesc); - } - - /* - * Ensure all write completed before setting own by dma bit so when gmac - * HW takeover this descriptor, all the fields are filled correctly - */ - wmb(); - txdesc->status |= set_dma; - - dev_info->tx_next = (txnext + 1) & (dev_info->tx_desc_count - 1); - dev_info->tx_next_desc = dev_info->tx_desc + dev_info->tx_next; - - return txdesc; -} - -/* - * syn_dp_tx_queue_desc - * Queue TX descriptor to the TX ring - */ -static void syn_dp_tx_desc_queue(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info, struct sk_buff *skb, dma_addr_t dma_addr) -{ - unsigned int len = skb->len; - - spin_lock_bh(&dev_info->data_lock); - - syn_dp_set_tx_qptr(gmac_dev, dev_info, dma_addr, len, skb, (skb->ip_summed == CHECKSUM_PARTIAL), - (desc_tx_last | desc_tx_first | desc_tx_int_enable), desc_own_by_dma); - dev_info->busy_tx_desc++; - - spin_unlock_bh(&dev_info->data_lock); -} - -/* - * syn_dp_process_tx_complete - * Xmit complete, clear descriptor and free the skb - */ -void syn_dp_process_tx_complete(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info) -{ - int busy, len; - uint32_t status; - struct dma_desc *desc = NULL; - struct sk_buff *skb; - uint32_t tx_skb_index; - - spin_lock_bh(&dev_info->data_lock); - busy = dev_info->busy_tx_desc; - - if (!busy) { - /* No desc are hold by gmac dma, we are done */ - spin_unlock_bh(&dev_info->data_lock); - return; - } - - do { - desc = dev_info->tx_busy_desc; - if (syn_dp_gmac_is_desc_owned_by_dma(desc)) { - /* desc still hold by gmac dma, so we are done */ - break; - } - - len = (desc->length & desc_size1_mask) >> desc_size1_shift; - dma_unmap_single(&(gmac_dev->pdev->dev), desc->buffer1, len, DMA_TO_DEVICE); - - status = desc->status; - if (status & desc_tx_last) { - /* TX is done for this whole skb, we can free it */ - /* Get the skb from the tx skb pool */ - tx_skb_index = dev_info->tx_busy; - skb = dev_info->tx_skb_list[tx_skb_index]; - - BUG_ON(!skb); - dev_kfree_skb(skb); - - spin_lock_bh(&dev_info->stats_lock); - - if (unlikely(status & desc_tx_error)) { - /* Some error happen, collect statistics */ - dev_info->stats.stats.tx_errors++; - dev_info->stats.stats.tx_jabber_timeout_errors += (status & desc_tx_timeout) ? 1 : 0; - dev_info->stats.stats.tx_frame_flushed_errors += (status & desc_tx_frame_flushed) ? 1 : 0; - dev_info->stats.stats.tx_loss_of_carrier_errors += (status & desc_tx_lost_carrier) ? 1 : 0; - dev_info->stats.stats.tx_no_carrier_errors += (status & desc_tx_no_carrier) ? 1 : 0; - dev_info->stats.stats.tx_late_collision_errors += (status & desc_tx_late_collision) ? 1 : 0; - dev_info->stats.stats.tx_excessive_collision_errors += (status & desc_tx_exc_collisions) ? 1 : 0; - dev_info->stats.stats.tx_excessive_deferral_errors += (status & desc_tx_exc_deferral) ? 1 : 0; - dev_info->stats.stats.tx_underflow_errors += (status & desc_tx_underflow) ? 1 : 0; - dev_info->stats.stats.tx_ip_header_errors += (status & desc_tx_ipv4_chk_error) ? 1 : 0; - dev_info->stats.stats.tx_ip_payload_errors += (status & desc_tx_pay_chk_error) ? 1 : 0; - } else { - /* No error, recored tx pkts/bytes and - * collision - */ - dev_info->stats.stats.tx_packets++; - dev_info->stats.stats.tx_collisions += syn_dp_gmac_get_tx_collision_count(status); - dev_info->stats.stats.tx_bytes += len; - } - - spin_unlock_bh(&dev_info->stats_lock); - } - syn_dp_reset_tx_qptr(gmac_dev, dev_info); - busy--; - } while (busy > 0); - - spin_unlock_bh(&dev_info->data_lock); -} - -/* - * syn_dp_tx - * TX routine for Synopsys GMAC - */ -int syn_dp_tx(struct nss_dp_dev *gmac_dev, struct syn_dp_info *dev_info, struct sk_buff *skb) -{ - struct net_device *netdev = gmac_dev->netdev; - struct nss_gmac_hal_dev *nghd = gmac_dev->gmac_hal_ctx; - unsigned len = skb->len; - dma_addr_t dma_addr; - - /* - * If we don't have enough tx descriptor for this pkt, return busy. - */ - if ((SYN_DP_TX_DESC_SIZE - dev_info->busy_tx_desc) < 1) { - netdev_dbg(netdev, "Not enough descriptors available"); - return -1; - } - - dma_addr = dma_map_single(&gmac_dev->pdev->dev, skb->data, len, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(&gmac_dev->pdev->dev, dma_addr))) { - netdev_dbg(netdev, "DMA mapping failed for empty buffer\n"); - return -1; - } - - /* - * Queue packet to the GMAC rings - */ - syn_dp_tx_desc_queue(gmac_dev, dev_info, skb, dma_addr); - - syn_resume_dma_tx(nghd); - - return 0; -} \ No newline at end of file diff --git a/feeds/ipq807x/qca-nss-dp/src/include/nss_dp_dev.h b/feeds/ipq807x/qca-nss-dp/src/include/nss_dp_dev.h deleted file mode 100644 index 439777349..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/include/nss_dp_dev.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_DP_DEV_H__ -#define __NSS_DP_DEV_H__ - -#include -#include -#include -#include -#include -#include -#include - -#include "nss_dp_api_if.h" -#include "nss_dp_hal_if.h" - -#define NSS_DP_ACL_DEV_ID 0 - -struct nss_dp_global_ctx; - -/* - * nss data plane device structure - */ -struct nss_dp_dev { - uint32_t macid; /* Sequence# of Mac on the platform */ - uint32_t vsi; /* vsi number */ - unsigned long flags; /* Status flags */ - unsigned long drv_flags; /* Driver specific feature flags */ - - /* Phy related stuff */ - struct phy_device *phydev; /* Phy device */ - struct mii_bus *miibus; /* MII bus */ - uint32_t phy_mii_type; /* RGMII/SGMII/QSGMII */ - uint32_t phy_mdio_addr; /* Mdio address */ - bool link_poll; /* Link polling enable? */ - uint32_t forced_speed; /* Forced speed? */ - uint32_t forced_duplex; /* Forced duplex? */ - uint32_t link_state; /* Current link state */ - uint32_t pause; /* Current flow control settings */ - - struct net_device *netdev; - struct platform_device *pdev; - struct napi_struct napi; - - struct nss_dp_data_plane_ctx *dpc; - /* context when NSS owns GMACs */ - struct nss_dp_data_plane_ops *data_plane_ops; - /* ops for each data plane */ - struct nss_dp_global_ctx *ctx; /* Global NSS DP context */ - struct nss_gmac_hal_dev *gmac_hal_ctx; /* context of gmac hal */ - struct nss_gmac_hal_ops *gmac_hal_ops; /* GMAC HAL OPS */ - - /* switchdev related attributes */ -#ifdef CONFIG_NET_SWITCHDEV - u8 stp_state; /* STP state of this physical port */ - unsigned long brport_flags; /* bridge port flags */ -#endif -}; - -/* - * nss data plane global context - */ -struct nss_dp_global_ctx { - struct nss_dp_dev *nss_dp[NSS_DP_HAL_MAX_PORTS]; - struct nss_gmac_hal_ops *gmac_hal_ops[GMAC_HAL_TYPE_MAX]; - /* GMAC HAL OPS */ - bool common_init_done; /* Flag to hold common init state */ - uint8_t slowproto_acl_bm; /* Port bitmap to allow slow protocol packets */ -}; - -/* Global data */ -extern struct nss_dp_global_ctx dp_global_ctx; -extern struct nss_dp_data_plane_ctx dp_global_data_plane_ctx[NSS_DP_HAL_MAX_PORTS]; - -/* - * nss data plane link state - */ -enum nss_dp_link_state { - __NSS_DP_LINK_UP, /* Indicate link is UP */ - __NSS_DP_LINK_DOWN /* Indicate link is down */ -}; - -/* - * nss data plane status - */ -enum nss_dp_state { - __NSS_DP_UP, /* set to indicate the interface is UP */ - __NSS_DP_RXCSUM, /* Rx checksum enabled */ - __NSS_DP_AUTONEG, /* Autonegotiation Enabled */ - __NSS_DP_LINKPOLL, /* Poll link status */ -}; - -/* - * nss data plane private flags - */ -enum nss_dp_priv_flags { - __NSS_DP_PRIV_FLAG_INIT_DONE, - __NSS_DP_PRIV_FLAG_IRQ_REQUESTED, - __NSS_DP_PRIV_FLAG_MAX, -}; -#define NSS_DP_PRIV_FLAG(x) (1 << __NSS_DP_PRIV_FLAG_ ## x) - -/* - * nss_dp_set_ethtool_ops() - */ -void nss_dp_set_ethtool_ops(struct net_device *netdev); - -/* - * nss data plane switchdev helpers - */ -#ifdef CONFIG_NET_SWITCHDEV -void nss_dp_switchdev_setup(struct net_device *dev); -bool nss_dp_is_phy_dev(struct net_device *dev); -#endif - -#endif /* __NSS_DP_DEV_H__ */ diff --git a/feeds/ipq807x/qca-nss-dp/src/nss_dp_attach.c b/feeds/ipq807x/qca-nss-dp/src/nss_dp_attach.c deleted file mode 100644 index 94e8f6900..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/nss_dp_attach.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019-2020 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include -#include "nss_dp_hal.h" - -/* - * nss_dp_reset_netdev_features() - * Resets the netdev features - */ -static inline void nss_dp_reset_netdev_features(struct net_device *netdev) -{ - netdev->features = 0; - netdev->hw_features = 0; - netdev->vlan_features = 0; - netdev->wanted_features = 0; -} - -/* - * nss_dp_receive() - * Called by overlay drivers to deliver packets to nss-dp - */ -void nss_dp_receive(struct net_device *netdev, struct sk_buff *skb, - struct napi_struct *napi) -{ - struct nss_dp_dev *dp_dev = netdev_priv(netdev); - - skb->dev = netdev; - skb->protocol = eth_type_trans(skb, netdev); - netdev_dbg(netdev, "Rx on port%d, packet len %d, CSUM %d\n", - dp_dev->macid, skb->len, skb->ip_summed); - -#ifdef CONFIG_NET_SWITCHDEV -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) - skb->offload_fwd_mark = netdev->offload_fwd_mark; -#else - /* - * TODO: Implement ndo_get_devlink_port() - */ - skb->offload_fwd_mark = 0; -#endif -#endif - - napi_gro_receive(napi, skb); -} -EXPORT_SYMBOL(nss_dp_receive); - -/* - * nss_dp_is_in_open_state() - * Return if a data plane is opened or not - */ -bool nss_dp_is_in_open_state(struct net_device *netdev) -{ - struct nss_dp_dev *dp_dev = (struct nss_dp_dev *)netdev_priv(netdev); - - if (test_bit(__NSS_DP_UP, &dp_dev->flags)) - return true; - return false; -} -EXPORT_SYMBOL(nss_dp_is_in_open_state); - -/* - * nss_dp_override_data_plane() - * API to allow overlay drivers to override the data plane - */ -int nss_dp_override_data_plane(struct net_device *netdev, - struct nss_dp_data_plane_ops *dp_ops, - struct nss_dp_data_plane_ctx *dpc) -{ - struct nss_dp_dev *dp_dev = (struct nss_dp_dev *)netdev_priv(netdev); - - if (!dp_ops->open || !dp_ops->close || !dp_ops->link_state - || !dp_ops->mac_addr || !dp_ops->change_mtu || !dp_ops->xmit - || !dp_ops->set_features || !dp_ops->pause_on_off || !dp_ops->deinit) { - netdev_dbg(netdev, "All the op functions must be present, reject this registeration\n"); - return NSS_DP_FAILURE; - } - - /* - * If this data plane is up, close the netdev to force TX/RX stop, and - * also reset the features - */ - if (test_bit(__NSS_DP_UP, &dp_dev->flags)) { - netdev->netdev_ops->ndo_stop(netdev); - nss_dp_reset_netdev_features(netdev); - } - - /* - * Free up the resources used by the data plane - */ - if (dp_dev->drv_flags & NSS_DP_PRIV_FLAG(INIT_DONE)) { - if (dp_dev->data_plane_ops->deinit(dpc)) { - netdev_dbg(netdev, "Data plane init failed\n"); - return -ENOMEM; - } - - dp_dev->drv_flags &= ~NSS_DP_PRIV_FLAG(INIT_DONE); - } - - /* - * Override the data_plane_ctx, data_plane_ops - */ - dp_dev->dpc = dpc; - dp_dev->data_plane_ops = dp_ops; - - return NSS_DP_SUCCESS; -} -EXPORT_SYMBOL(nss_dp_override_data_plane); - -/* - * nss_dp_start_data_plane() - * Data plane to inform netdev it is ready to start - */ -void nss_dp_start_data_plane(struct net_device *netdev, - struct nss_dp_data_plane_ctx *dpc) -{ - struct nss_dp_dev *dp_dev = (struct nss_dp_dev *)netdev_priv(netdev); - - if (test_bit(__NSS_DP_UP, &dp_dev->flags)) { - netdev_dbg(netdev, "This netdev already up, something is wrong\n"); - return; - } - - if (dp_dev->dpc != dpc) { - netdev_dbg(netdev, "Cookie %px does not match, reject\n", dpc); - return; - } - - netdev->netdev_ops->ndo_open(dp_dev->netdev); -} -EXPORT_SYMBOL(nss_dp_start_data_plane); - -/* - * nss_dp_restore_data_plane() - * Called by overlay drivers to detach itself from nss-dp - */ -void nss_dp_restore_data_plane(struct net_device *netdev) -{ - struct nss_dp_dev *dp_dev = (struct nss_dp_dev *)netdev_priv(netdev); - - /* - * If this data plane is up, close the netdev to force TX/RX stop, and - * also reset the features - */ - if (test_bit(__NSS_DP_UP, &dp_dev->flags)) { - netdev->netdev_ops->ndo_stop(netdev); - nss_dp_reset_netdev_features(netdev); - } - - dp_dev->data_plane_ops = nss_dp_hal_get_data_plane_ops(); - dp_dev->dpc = &dp_global_data_plane_ctx[dp_dev->macid - NSS_DP_START_IFNUM]; - - /* - * TODO: Re-initialize EDMA dataplane - */ -} -EXPORT_SYMBOL(nss_dp_restore_data_plane); - -/* - * nss_dp_get_netdev_by_nss_if_num() - * return the net device of the corrsponding id if exist - */ -struct net_device *nss_dp_get_netdev_by_nss_if_num(int if_num) -{ - struct nss_dp_dev *dp_dev; - - if ((if_num > NSS_DP_HAL_MAX_PORTS) || (if_num < NSS_DP_START_IFNUM)) { - pr_err("Invalid if_num %d\n", if_num); - return NULL; - } - - dp_dev = dp_global_ctx.nss_dp[if_num - NSS_DP_START_IFNUM]; - if (!dp_dev) - return NULL; - return dp_dev->netdev; -} -EXPORT_SYMBOL(nss_dp_get_netdev_by_nss_if_num); diff --git a/feeds/ipq807x/qca-nss-dp/src/nss_dp_ethtools.c b/feeds/ipq807x/qca-nss-dp/src/nss_dp_ethtools.c deleted file mode 100644 index 289bf87ee..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/nss_dp_ethtools.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include -#include -#include -#include -#include "nss_dp_dev.h" -#include "fal/fal_port_ctrl.h" - -/* - * nss_dp_get_ethtool_stats() - */ -static void nss_dp_get_ethtool_stats(struct net_device *netdev, - struct ethtool_stats *stats, uint64_t *data) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - dp_priv->gmac_hal_ops->getethtoolstats(dp_priv->gmac_hal_ctx, data); -} - -/* - * nss_dp_get_strset_count() - */ -static int32_t nss_dp_get_strset_count(struct net_device *netdev, int32_t sset) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - return dp_priv->gmac_hal_ops->getssetcount(dp_priv->gmac_hal_ctx, sset); -} - -/* - * nss_dp_get_strings() - */ -static void nss_dp_get_strings(struct net_device *netdev, uint32_t stringset, - uint8_t *data) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - dp_priv->gmac_hal_ops->getstrings(dp_priv->gmac_hal_ctx, stringset, - data); -} - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) -/* - * nss_dp_get_settings() - */ -static int32_t nss_dp_get_settings(struct net_device *netdev, - struct ethtool_cmd *cmd) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - /* - * If there is a PHY attached, get the status from Kernel helper - */ - if (dp_priv->phydev) - return phy_ethtool_gset(dp_priv->phydev, cmd); - - return -EIO; -} - -/* - * nss_dp_set_settings() - */ -static int32_t nss_dp_set_settings(struct net_device *netdev, - struct ethtool_cmd *cmd) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - if (!dp_priv->phydev) - return -EIO; - - return phy_ethtool_sset(dp_priv->phydev, cmd); -} -#endif - -/* - * nss_dp_get_pauseparam() - */ -static void nss_dp_get_pauseparam(struct net_device *netdev, - struct ethtool_pauseparam *pause) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - pause->rx_pause = dp_priv->pause & FLOW_CTRL_RX ? 1 : 0; - pause->tx_pause = dp_priv->pause & FLOW_CTRL_TX ? 1 : 0; - pause->autoneg = AUTONEG_ENABLE; -} - -/* - * nss_dp_set_pauseparam() - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) -static int32_t nss_dp_set_pauseparam(struct net_device *netdev, - struct ethtool_pauseparam *pause) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - /* set flow control settings */ - dp_priv->pause = 0; - if (pause->rx_pause) - dp_priv->pause |= FLOW_CTRL_RX; - - if (pause->tx_pause) - dp_priv->pause |= FLOW_CTRL_TX; - - if (!dp_priv->phydev) - return 0; - - /* Update flow control advertisment */ - dp_priv->phydev->advertising &= - ~(ADVERTISED_Pause | ADVERTISED_Asym_Pause); - - if (pause->rx_pause) - dp_priv->phydev->advertising |= - (ADVERTISED_Pause | ADVERTISED_Asym_Pause); - - if (pause->tx_pause) - dp_priv->phydev->advertising |= ADVERTISED_Asym_Pause; - - genphy_config_aneg(dp_priv->phydev); - - return 0; -} -#else -static int32_t nss_dp_set_pauseparam(struct net_device *netdev, - struct ethtool_pauseparam *pause) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - __ETHTOOL_DECLARE_LINK_MODE_MASK(advertising) = { 0, }; - - /* set flow control settings */ - dp_priv->pause = 0; - if (pause->rx_pause) - dp_priv->pause |= FLOW_CTRL_RX; - - if (pause->tx_pause) - dp_priv->pause |= FLOW_CTRL_TX; - - if (!dp_priv->phydev) - return 0; - - /* Update flow control advertisment */ - linkmode_copy(advertising, dp_priv->phydev->advertising); - - linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT, advertising); - linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, advertising); - - if (pause->rx_pause) { - linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, advertising); - linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, advertising); - } - - if (pause->tx_pause) - linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, advertising); - - linkmode_copy(dp_priv->phydev->advertising, advertising); - genphy_config_aneg(dp_priv->phydev); - - return 0; -} -#endif - -/* - * nss_dp_fal_to_ethtool_linkmode_xlate() - * Translate linkmode from FAL type to ethtool type. - */ -static inline void nss_dp_fal_to_ethtool_linkmode_xlate(uint32_t *xlate_to, uint32_t *xlate_from) -{ - uint32_t pos; - - while (*xlate_from) { - pos = ffs(*xlate_from); - switch (1 << (pos - 1)) { - case FAL_PHY_EEE_10BASE_T: - *xlate_to |= SUPPORTED_10baseT_Full; - break; - - case FAL_PHY_EEE_100BASE_T: - *xlate_to |= SUPPORTED_100baseT_Full; - break; - - case FAL_PHY_EEE_1000BASE_T: - *xlate_to |= SUPPORTED_1000baseT_Full; - break; - - case FAL_PHY_EEE_2500BASE_T: - *xlate_to |= SUPPORTED_2500baseX_Full; - break; - - case FAL_PHY_EEE_5000BASE_T: - /* - * Ethtool does not support enumeration for 5G. - */ - break; - - case FAL_PHY_EEE_10000BASE_T: - *xlate_to |= SUPPORTED_10000baseT_Full; - break; - } - - *xlate_from &= (~(1 << (pos - 1))); - } -} - -/* - * nss_dp_get_eee() - * Get EEE settings. - */ -static int32_t nss_dp_get_eee(struct net_device *netdev, struct ethtool_eee *eee) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - fal_port_eee_cfg_t port_eee_cfg; - uint32_t port_id; - sw_error_t ret; - - memset(&port_eee_cfg, 0, sizeof(fal_port_eee_cfg_t)); - port_id = dp_priv->macid; - ret = fal_port_interface_eee_cfg_get(NSS_DP_ACL_DEV_ID, port_id, &port_eee_cfg); - if (ret != SW_OK) { - netdev_dbg(netdev, "Could not fetch EEE settings err = %d\n", ret); - return -EIO; - } - - /* - * Translate the FAL linkmode types to ethtool linkmode types. - */ - nss_dp_fal_to_ethtool_linkmode_xlate(&eee->supported, &port_eee_cfg.capability); - nss_dp_fal_to_ethtool_linkmode_xlate(&eee->advertised, &port_eee_cfg.advertisement); - nss_dp_fal_to_ethtool_linkmode_xlate(&eee->lp_advertised, &port_eee_cfg.link_partner_advertisement); - eee->eee_enabled = port_eee_cfg.enable; - eee->eee_active = port_eee_cfg.eee_status; - eee->tx_lpi_enabled = port_eee_cfg.lpi_tx_enable; - eee->tx_lpi_timer = port_eee_cfg.lpi_sleep_timer; - - return 0; -} - -/* - * nss_dp_set_eee() - * Set EEE settings. - */ -static int32_t nss_dp_set_eee(struct net_device *netdev, struct ethtool_eee *eee) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - fal_port_eee_cfg_t port_eee_cfg, port_eee_cur_cfg; - uint32_t port_id, pos; - sw_error_t ret; - - memset(&port_eee_cfg, 0, sizeof(fal_port_eee_cfg_t)); - memset(&port_eee_cur_cfg, 0, sizeof(fal_port_eee_cfg_t)); - port_id = dp_priv->macid; - - /* - * Get current EEE configuration. - */ - ret = fal_port_interface_eee_cfg_get(NSS_DP_ACL_DEV_ID, port_id, &port_eee_cur_cfg); - if (ret != SW_OK) { - netdev_dbg(netdev, "Could not fetch EEE settings err = %d\n", ret); - return -EIO; - } - - port_eee_cfg.enable = eee->eee_enabled; - - /* - * Translate the ethtool speed types to FAL speed types. - */ - while (eee->advertised) { - pos = ffs(eee->advertised); - switch (1 << (pos - 1)) { - case ADVERTISED_10baseT_Full: - if (port_eee_cur_cfg.capability & FAL_PHY_EEE_10BASE_T) { - port_eee_cfg.advertisement |= FAL_PHY_EEE_10BASE_T; - break; - } - - netdev_dbg(netdev, "Advertised value 10baseT_Full is not supported\n"); - return -EIO; - - case ADVERTISED_100baseT_Full: - if (port_eee_cur_cfg.capability & FAL_PHY_EEE_100BASE_T) { - port_eee_cfg.advertisement |= FAL_PHY_EEE_100BASE_T; - break; - } - - netdev_dbg(netdev, "Advertised value 100baseT_Full is not supported\n"); - return -EIO; - - case ADVERTISED_1000baseT_Full: - if (port_eee_cur_cfg.capability & FAL_PHY_EEE_1000BASE_T) { - port_eee_cfg.advertisement |= FAL_PHY_EEE_1000BASE_T; - break; - } - - netdev_dbg(netdev, "Advertised value 1000baseT_Full is not supported\n"); - return -EIO; - - case ADVERTISED_2500baseX_Full: - if (port_eee_cur_cfg.capability & FAL_PHY_EEE_2500BASE_T) { - port_eee_cfg.advertisement |= FAL_PHY_EEE_2500BASE_T; - break; - } - - netdev_dbg(netdev, "Advertised value 2500baseX_Full is not supported\n"); - return -EIO; - - case ADVERTISED_10000baseT_Full: - if (port_eee_cur_cfg.capability & FAL_PHY_EEE_10000BASE_T) { - port_eee_cfg.advertisement |= FAL_PHY_EEE_10000BASE_T; - break; - } - - netdev_dbg(netdev, "Advertised value 10000baseT_Full is not supported\n"); - return -EIO; - - default: - netdev_dbg(netdev, "Advertised value is not supported\n"); - return -EIO; - } - - eee->advertised &= (~(1 << (pos - 1))); - } - - port_eee_cfg.lpi_tx_enable = eee->tx_lpi_enabled; - port_eee_cfg.lpi_sleep_timer = eee->tx_lpi_timer; - ret = fal_port_interface_eee_cfg_set(NSS_DP_ACL_DEV_ID, port_id, &port_eee_cfg); - if (ret != SW_OK) { - netdev_dbg(netdev, "Could not configure EEE err = %d\n", ret); - return -EIO; - } - - return 0; -} - -/* - * Ethtool operations - */ -struct ethtool_ops nss_dp_ethtool_ops = { - .get_strings = &nss_dp_get_strings, - .get_sset_count = &nss_dp_get_strset_count, - .get_ethtool_stats = &nss_dp_get_ethtool_stats, - .get_link = ðtool_op_get_link, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) - .get_settings = &nss_dp_get_settings, - .set_settings = &nss_dp_set_settings, -#else - .get_link_ksettings = phy_ethtool_get_link_ksettings, - .set_link_ksettings = phy_ethtool_set_link_ksettings, -#endif - .get_pauseparam = &nss_dp_get_pauseparam, - .set_pauseparam = &nss_dp_set_pauseparam, - .get_eee = &nss_dp_get_eee, - .set_eee = &nss_dp_set_eee, -}; - -/* - * nss_dp_set_ethtool_ops() - * Set ethtool operations - */ -void nss_dp_set_ethtool_ops(struct net_device *netdev) -{ - netdev->ethtool_ops = &nss_dp_ethtool_ops; -} diff --git a/feeds/ipq807x/qca-nss-dp/src/nss_dp_main.c b/feeds/ipq807x/qca-nss-dp/src/nss_dp_main.c deleted file mode 100644 index 5580b1331..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/nss_dp_main.c +++ /dev/null @@ -1,830 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(NSS_DP_PPE_SUPPORT) -#include -#endif -#include - -#include "nss_dp_hal.h" - -/* - * Number of TX/RX queue supported is based on the number of host CPU - */ -#define NSS_DP_NETDEV_TX_QUEUE_NUM NSS_DP_HAL_CPU_NUM -#define NSS_DP_NETDEV_RX_QUEUE_NUM NSS_DP_HAL_CPU_NUM - -/* ipq40xx_mdio_data */ -struct ipq40xx_mdio_data { - struct mii_bus *mii_bus; - void __iomem *membase; - int phy_irq[PHY_MAX_ADDR]; -}; - -/* Global data */ -struct nss_dp_global_ctx dp_global_ctx; -struct nss_dp_data_plane_ctx dp_global_data_plane_ctx[NSS_DP_HAL_MAX_PORTS]; - -/* - * nss_dp_do_ioctl() - */ -static int32_t nss_dp_do_ioctl(struct net_device *netdev, struct ifreq *ifr, - int32_t cmd) -{ - int ret = -EINVAL; - struct nss_dp_dev *dp_priv; - - if (!netdev || !ifr) - return ret; - - dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - if (dp_priv->phydev) - return phy_mii_ioctl(dp_priv->phydev, ifr, cmd); - - return ret; -} - -/* - * nss_dp_change_mtu() - */ -static int32_t nss_dp_change_mtu(struct net_device *netdev, int32_t newmtu) -{ - int ret = -EINVAL; - struct nss_dp_dev *dp_priv; - - if (!netdev) - return ret; - - dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - /* Let the underlying data plane decide if the newmtu is applicable */ - if (dp_priv->data_plane_ops->change_mtu(dp_priv->dpc, newmtu)) { - netdev_dbg(netdev, "Data plane change mtu failed\n"); - return ret; - } - - netdev->mtu = newmtu; - - return 0; -} - -/* - * nss_dp_set_mac_address() - */ -static int32_t nss_dp_set_mac_address(struct net_device *netdev, void *macaddr) -{ - struct nss_dp_dev *dp_priv; - struct sockaddr *addr = (struct sockaddr *)macaddr; - int ret = 0; - - if (!netdev) - return -EINVAL; - - dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - netdev_dbg(netdev, "AddrFamily: %d, %0x:%0x:%0x:%0x:%0x:%0x\n", - addr->sa_family, addr->sa_data[0], addr->sa_data[1], - addr->sa_data[2], addr->sa_data[3], addr->sa_data[4], - addr->sa_data[5]); - - ret = eth_prepare_mac_addr_change(netdev, macaddr); - if (ret) - return ret; - - if (dp_priv->data_plane_ops->mac_addr(dp_priv->dpc, macaddr)) { - netdev_dbg(netdev, "Data plane set MAC address failed\n"); - return -EAGAIN; - } - - eth_commit_mac_addr_change(netdev, macaddr); - - dp_priv->gmac_hal_ops->setmacaddr(dp_priv->gmac_hal_ctx, - (uint8_t *)addr->sa_data); - - return 0; -} - -/* - * nss_dp_get_stats64() - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) -static struct rtnl_link_stats64 *nss_dp_get_stats64(struct net_device *netdev, - struct rtnl_link_stats64 *stats) -{ - struct nss_dp_dev *dp_priv; - - if (!netdev) - return stats; - - dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - dp_priv->gmac_hal_ops->getndostats(dp_priv->gmac_hal_ctx, stats); - - return stats; -} -#else -static void nss_dp_get_stats64(struct net_device *netdev, - struct rtnl_link_stats64 *stats) -{ - struct nss_dp_dev *dp_priv; - - if (!netdev) - return; - - dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - dp_priv->gmac_hal_ops->getndostats(dp_priv->gmac_hal_ctx, stats); -} -#endif - -/* - * nss_dp_xmit() - */ -static netdev_tx_t nss_dp_xmit(struct sk_buff *skb, struct net_device *netdev) -{ - struct nss_dp_dev *dp_priv; - - if (!skb || !netdev) - return NETDEV_TX_OK; - - dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - netdev_dbg(netdev, "Tx packet, len %d\n", skb->len); - - return dp_priv->data_plane_ops->xmit(dp_priv->dpc, skb); -} - -/* - * nss_dp_close() - */ -static int nss_dp_close(struct net_device *netdev) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - if (!dp_priv) - return -EINVAL; - - netif_stop_queue(netdev); - netif_carrier_off(netdev); - - /* Notify data plane link is going down */ - if (dp_priv->data_plane_ops->link_state(dp_priv->dpc, 0)) { - netdev_dbg(netdev, "Data plane set link failed\n"); - return -EAGAIN; - } - - if (dp_priv->phydev) - phy_stop(dp_priv->phydev); - dp_priv->link_state = __NSS_DP_LINK_DOWN; - -#if defined(NSS_DP_PPE_SUPPORT) - /* Notify data plane to unassign VSI */ - if (dp_priv->data_plane_ops->vsi_unassign(dp_priv->dpc, dp_priv->vsi)) { - netdev_dbg(netdev, "Data plane vsi unassign failed\n"); - return -EAGAIN; - } -#endif - - /* - * Notify data plane to close - */ - if (dp_priv->data_plane_ops->close(dp_priv->dpc)) { - netdev_dbg(netdev, "Data plane close failed\n"); - return -EAGAIN; - } - - clear_bit(__NSS_DP_UP, &dp_priv->flags); - - return 0; -} - -/* - * nss_dp_open() - */ -static int nss_dp_open(struct net_device *netdev) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - - if (!dp_priv) - return -EINVAL; - - netif_carrier_off(netdev); - - /* - * Call data plane init if it has not been done yet - */ - if (!(dp_priv->drv_flags & NSS_DP_PRIV_FLAG(INIT_DONE))) { - if (dp_priv->data_plane_ops->init(dp_priv->dpc)) { - netdev_dbg(netdev, "Data plane init failed\n"); - return -ENOMEM; - } - - dp_priv->drv_flags |= NSS_DP_PRIV_FLAG(INIT_DONE); - } - - /* - * Inform the Linux Networking stack about the hardwar capability of - * checksum offloading and other features. Each data_plane is - * responsible to maintain the feature set it supports - */ - dp_priv->data_plane_ops->set_features(dp_priv->dpc); - - set_bit(__NSS_DP_UP, &dp_priv->flags); - -#if defined(NSS_DP_PPE_SUPPORT) - if (dp_priv->data_plane_ops->vsi_assign(dp_priv->dpc, dp_priv->vsi)) { - netdev_dbg(netdev, "Data plane vsi assign failed\n"); - return -EAGAIN; - } -#endif - - if (dp_priv->data_plane_ops->mac_addr(dp_priv->dpc, netdev->dev_addr)) { - netdev_dbg(netdev, "Data plane set MAC address failed\n"); - return -EAGAIN; - } - - if (dp_priv->data_plane_ops->change_mtu(dp_priv->dpc, netdev->mtu)) { - netdev_dbg(netdev, "Data plane change mtu failed\n"); - return -EAGAIN; - } - - if (dp_priv->data_plane_ops->open(dp_priv->dpc, 0, 0, 0)) { - netdev_dbg(netdev, "Data plane open failed\n"); - return -EAGAIN; - } - - netif_start_queue(netdev); - - if (!dp_priv->link_poll) { - /* Notify data plane link is up */ - if (dp_priv->data_plane_ops->link_state(dp_priv->dpc, 1)) { - netdev_dbg(netdev, "Data plane set link failed\n"); - return -EAGAIN; - } - dp_priv->link_state = __NSS_DP_LINK_UP; - netif_carrier_on(netdev); - } else { - dp_priv->link_state = __NSS_DP_LINK_DOWN; - phy_start(dp_priv->phydev); - phy_start_aneg(dp_priv->phydev); - } - - return 0; -} - -#ifdef CONFIG_RFS_ACCEL -/* - * nss_dp_rx_flow_steer() - * Steer the flow rule to NSS - */ -static int nss_dp_rx_flow_steer(struct net_device *netdev, const struct sk_buff *_skb, - uint16_t rxq, uint32_t flow) -{ - struct nss_dp_dev *dp_priv; - struct netdev_rx_queue *rxqueue; - struct rps_sock_flow_table *sock_flow_table; - struct rps_dev_flow_table *flow_table; - struct rps_dev_flow *rxflow; - struct sk_buff *skb = (struct sk_buff *)_skb; - uint16_t index; - uint32_t hash; - uint32_t rfscpu; - uint32_t rxcpu; - - if (!netdev) - return -EINVAL; - - dp_priv = (struct nss_dp_dev *)netdev_priv(netdev); - if (!dp_priv) - return -EINVAL; - - rxqueue = netdev->_rx; - - if (skb_rx_queue_recorded(skb)) { - index = skb_get_rx_queue(skb); - rxqueue += index; - } - - flow_table = rcu_dereference(rxqueue->rps_flow_table); - if (!flow_table) { - netdev_dbg(netdev, "RX queue RPS flow table not found\n"); - return -EINVAL; - } - - hash = skb_get_hash(skb); - rxflow = &flow_table->flows[hash & flow_table->mask]; - rxcpu = (uint32_t)rxflow->cpu; - - sock_flow_table = rcu_dereference(rps_sock_flow_table); - if (!sock_flow_table) { - netdev_dbg(netdev, "Global RPS flow table not found\n"); - return -EINVAL; - } - - rfscpu = sock_flow_table->ents[hash & sock_flow_table->mask]; - rfscpu &= rps_cpu_mask; - - if (rxcpu == rfscpu) - return 0; - - /* - * check rx_flow_steer is defined in data plane ops - */ - if (!dp_priv->data_plane_ops->rx_flow_steer) { - netdev_dbg(netdev, "Data plane ops not defined for flow steer\n"); - return -EINVAL; - } - - /* - * Delete the old flow rule - */ - if (dp_priv->data_plane_ops->rx_flow_steer(dp_priv->dpc, skb, rxcpu, false)) { - netdev_dbg(netdev, "Data plane delete flow rule failed\n"); - return -EAGAIN; - } - - /* - * Add the new flow rule - */ - if (dp_priv->data_plane_ops->rx_flow_steer(dp_priv->dpc, skb, rfscpu, true)) { - netdev_dbg(netdev, "Data plane add flow rule failed\n"); - return -EAGAIN; - } - - return 0; -} -#endif - -/* - * nss_dp_select_queue() - * Select tx queue - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) -static u16 nss_dp_select_queue(struct net_device *netdev, struct sk_buff *skb, - void *accel_priv, select_queue_fallback_t fallback) -#else -static u16 nss_dp_select_queue(struct net_device *netdev, struct sk_buff *skb, - struct net_device *sb_dev) -#endif -{ - int cpu = get_cpu(); - put_cpu(); - - /* - * The number of queue is matching the number of CPUs so get_cpu will - * always match a valid queue - */ - return cpu; -} - -/* - * Netdevice operations - */ -static const struct net_device_ops nss_dp_netdev_ops = { - .ndo_open = nss_dp_open, - .ndo_stop = nss_dp_close, - .ndo_start_xmit = nss_dp_xmit, - .ndo_get_stats64 = nss_dp_get_stats64, - .ndo_set_mac_address = nss_dp_set_mac_address, - .ndo_validate_addr = eth_validate_addr, - .ndo_change_mtu = nss_dp_change_mtu, - .ndo_do_ioctl = nss_dp_do_ioctl, - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) - .ndo_bridge_setlink = switchdev_port_bridge_setlink, - .ndo_bridge_getlink = switchdev_port_bridge_getlink, - .ndo_bridge_dellink = switchdev_port_bridge_dellink, -#endif - .ndo_select_queue = nss_dp_select_queue, - -#ifdef CONFIG_RFS_ACCEL - .ndo_rx_flow_steer = nss_dp_rx_flow_steer, -#endif -}; - -/* - * nss_dp_of_get_pdata() - */ -static int32_t nss_dp_of_get_pdata(struct device_node *np, - struct net_device *netdev, - struct gmac_hal_platform_data *hal_pdata) -{ - uint8_t *maddr; - struct nss_dp_dev *dp_priv; - struct resource memres_devtree = {0}; - - dp_priv = netdev_priv(netdev); - - if (of_property_read_u32(np, "qcom,id", &dp_priv->macid)) { - pr_err("%s: error reading id\n", np->name); - return -EFAULT; - } - - if (dp_priv->macid > NSS_DP_HAL_MAX_PORTS || !dp_priv->macid) { - pr_err("%s: invalid macid %d\n", np->name, dp_priv->macid); - return -EFAULT; - } - - if (of_property_read_u32(np, "qcom,mactype", &hal_pdata->mactype)) { - pr_err("%s: error reading mactype\n", np->name); - return -EFAULT; - } - - if (of_address_to_resource(np, 0, &memres_devtree) != 0) - return -EFAULT; - - netdev->base_addr = memres_devtree.start; - hal_pdata->reg_len = resource_size(&memres_devtree); - hal_pdata->netdev = netdev; - hal_pdata->macid = dp_priv->macid; - - dp_priv->phy_mii_type = of_get_phy_mode(np); - dp_priv->link_poll = of_property_read_bool(np, "qcom,link-poll"); - if (of_property_read_u32(np, "qcom,phy-mdio-addr", - &dp_priv->phy_mdio_addr) && dp_priv->link_poll) { - pr_err("%s: mdio addr required if link polling is enabled\n", - np->name); - return -EFAULT; - } - - of_property_read_u32(np, "qcom,forced-speed", &dp_priv->forced_speed); - of_property_read_u32(np, "qcom,forced-duplex", &dp_priv->forced_duplex); - - maddr = (uint8_t *)of_get_mac_address(np); -#if (LINUX_VERSION_CODE > KERNEL_VERSION(5, 4, 0)) - if (IS_ERR((void *)maddr)) { - maddr = NULL; - } -#endif - - if (maddr && is_valid_ether_addr(maddr)) { - ether_addr_copy(netdev->dev_addr, maddr); - } else { - random_ether_addr(netdev->dev_addr); - pr_info("GMAC%d(%px) Invalid MAC@ - using %pM\n", dp_priv->macid, - dp_priv, netdev->dev_addr); - } - - return 0; -} - -/* - * nss_dp_mdio_attach() - */ -static struct mii_bus *nss_dp_mdio_attach(struct platform_device *pdev) -{ - struct device_node *mdio_node; - struct platform_device *mdio_plat; - struct ipq40xx_mdio_data *mdio_data; - - /* - * Find mii_bus using "mdio-bus" handle. - */ - mdio_node = of_parse_phandle(pdev->dev.of_node, "mdio-bus", 0); - if (mdio_node) { - return of_mdio_find_bus(mdio_node); - } - - mdio_node = of_find_compatible_node(NULL, NULL, "qcom,ipq40xx-mdio"); - if (!mdio_node) { - dev_err(&pdev->dev, "cannot find mdio node by phandle\n"); - return NULL; - } - - mdio_plat = of_find_device_by_node(mdio_node); - if (!mdio_plat) { - dev_err(&pdev->dev, "cannot find platform device from mdio node\n"); - of_node_put(mdio_node); - return NULL; - } - - mdio_data = dev_get_drvdata(&mdio_plat->dev); - if (!mdio_data) { - dev_err(&pdev->dev, "cannot get mii bus reference from device data\n"); - of_node_put(mdio_node); - return NULL; - } - - return mdio_data->mii_bus; -} - -#ifdef CONFIG_NET_SWITCHDEV -/* - * nss_dp_is_phy_dev() - * Check if it is dp device - */ -bool nss_dp_is_phy_dev(struct net_device *dev) -{ - return (dev->netdev_ops == &nss_dp_netdev_ops); -} -#endif - -/* - * nss_dp_adjust_link() - */ -void nss_dp_adjust_link(struct net_device *netdev) -{ - struct nss_dp_dev *dp_priv = netdev_priv(netdev); - int current_state = dp_priv->link_state; - - if (!test_bit(__NSS_DP_UP, &dp_priv->flags)) - return; - - if (dp_priv->phydev->link && (current_state == __NSS_DP_LINK_UP)) - return; - - if (!dp_priv->phydev->link && (current_state == __NSS_DP_LINK_DOWN)) - return; - - if (current_state == __NSS_DP_LINK_DOWN) { - netdev_info(netdev, "PHY Link up speed: %d\n", - dp_priv->phydev->speed); - if (dp_priv->data_plane_ops->link_state(dp_priv->dpc, 1)) { - netdev_dbg(netdev, "Data plane set link up failed\n"); - return; - } - dp_priv->link_state = __NSS_DP_LINK_UP; - netif_carrier_on(netdev); - } else { - netdev_info(netdev, "PHY Link is down\n"); - if (dp_priv->data_plane_ops->link_state(dp_priv->dpc, 0)) { - netdev_dbg(netdev, "Data plane set link down failed\n"); - return; - } - dp_priv->link_state = __NSS_DP_LINK_DOWN; - netif_carrier_off(netdev); - } -} - -/* - * nss_dp_probe() - */ -static int32_t nss_dp_probe(struct platform_device *pdev) -{ - struct net_device *netdev; - struct nss_dp_dev *dp_priv; - struct device_node *np = pdev->dev.of_node; - struct gmac_hal_platform_data gmac_hal_pdata; - int32_t ret = 0; - uint8_t phy_id[MII_BUS_ID_SIZE + 3]; -#if defined(NSS_DP_PPE_SUPPORT) - uint32_t vsi_id; - fal_port_t port_id; -#endif - - /* TODO: See if we need to do some SoC level common init */ - - netdev = alloc_etherdev_mqs(sizeof(struct nss_dp_dev), - NSS_DP_NETDEV_TX_QUEUE_NUM, NSS_DP_NETDEV_RX_QUEUE_NUM); - if (!netdev) { - pr_info("alloc_etherdev() failed\n"); - return -ENOMEM; - } - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)) - /* max_mtu is set to 1500 in ether_setup() */ - netdev->max_mtu = ETH_MAX_MTU; -#endif - - dp_priv = netdev_priv(netdev); - memset((void *)dp_priv, 0, sizeof(struct nss_dp_dev)); - - dp_priv->pdev = pdev; - dp_priv->netdev = netdev; - netdev->watchdog_timeo = 5 * HZ; - netdev->netdev_ops = &nss_dp_netdev_ops; - nss_dp_set_ethtool_ops(netdev); -#ifdef CONFIG_NET_SWITCHDEV - nss_dp_switchdev_setup(netdev); -#endif - - ret = nss_dp_of_get_pdata(np, netdev, &gmac_hal_pdata); - if (ret != 0) { - goto fail; - } - - /* Use data plane ops as per the configured SoC */ - dp_priv->data_plane_ops = nss_dp_hal_get_data_plane_ops(); - if (!dp_priv->data_plane_ops) { - netdev_dbg(netdev, "Dataplane ops not found.\n"); - goto fail; - } - - dp_priv->dpc = &dp_global_data_plane_ctx[dp_priv->macid-1]; - dp_priv->dpc->dev = netdev; - dp_priv->ctx = &dp_global_ctx; - - /* TODO:locks init */ - - /* - * HAL's init function will return the pointer to the HAL context - * (private to hal), which dp will store in its data structures. - * The subsequent hal_ops calls expect the DP to pass the HAL - * context pointer as an argument - */ - dp_priv->gmac_hal_ops = nss_dp_hal_get_gmac_ops(gmac_hal_pdata.mactype); - if (!dp_priv->gmac_hal_ops) { - netdev_dbg(netdev, "Unsupported Mac type: %d\n", gmac_hal_pdata.mactype); - goto fail; - } - - dp_priv->gmac_hal_ctx = dp_priv->gmac_hal_ops->init(&gmac_hal_pdata); - if (!(dp_priv->gmac_hal_ctx)) { - netdev_dbg(netdev, "gmac hal init failed\n"); - goto fail; - } - - if (dp_priv->link_poll) { - dp_priv->miibus = nss_dp_mdio_attach(pdev); - if (!dp_priv->miibus) { - netdev_dbg(netdev, "failed to find miibus\n"); - goto fail; - } - snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, - dp_priv->miibus->id, dp_priv->phy_mdio_addr); - - SET_NETDEV_DEV(netdev, &pdev->dev); - - dp_priv->phydev = phy_connect(netdev, phy_id, - &nss_dp_adjust_link, - dp_priv->phy_mii_type); - if (IS_ERR(dp_priv->phydev)) { - netdev_dbg(netdev, "failed to connect to phy device\n"); - goto fail; - } - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) - dp_priv->phydev->advertising |= - (ADVERTISED_Pause | ADVERTISED_Asym_Pause); - dp_priv->phydev->supported |= - (SUPPORTED_Pause | SUPPORTED_Asym_Pause); -#else - linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, dp_priv->phydev->advertising); - linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, dp_priv->phydev->advertising); - - linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, dp_priv->phydev->supported); - linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, dp_priv->phydev->supported); -#endif - } - -#if defined(NSS_DP_PPE_SUPPORT) - /* Get port's default VSI */ - port_id = dp_priv->macid; - if (ppe_port_vsi_get(0, port_id, &vsi_id)) { - netdev_dbg(netdev, "failed to get port's default VSI\n"); - goto fail; - } - - dp_priv->vsi = vsi_id; -#endif - - /* TODO: Features: CSUM, tx/rx offload... configure */ - - /* Register the network interface */ - ret = register_netdev(netdev); - if (ret) { - netdev_dbg(netdev, "Error registering netdevice %s\n", - netdev->name); - dp_priv->gmac_hal_ops->exit(dp_priv->gmac_hal_ctx); - goto fail; - } - - dp_global_ctx.nss_dp[dp_priv->macid - 1] = dp_priv; - dp_global_ctx.slowproto_acl_bm = 0; - - netdev_dbg(netdev, "Init NSS DP GMAC%d (base = 0x%lx)\n", dp_priv->macid, netdev->base_addr); - - return 0; - -fail: - free_netdev(netdev); - return -EFAULT; -} - -/* - * nss_dp_remove() - */ -static int nss_dp_remove(struct platform_device *pdev) -{ - uint32_t i; - struct nss_dp_dev *dp_priv; - struct nss_gmac_hal_ops *hal_ops; - - for (i = 0; i < NSS_DP_HAL_MAX_PORTS; i++) { - dp_priv = dp_global_ctx.nss_dp[i]; - if (!dp_priv) - continue; - - hal_ops = dp_priv->gmac_hal_ops; - if (dp_priv->phydev) - phy_disconnect(dp_priv->phydev); - unregister_netdev(dp_priv->netdev); - hal_ops->exit(dp_priv->gmac_hal_ctx); - free_netdev(dp_priv->netdev); - dp_global_ctx.nss_dp[i] = NULL; - } - - return 0; -} - -static struct of_device_id nss_dp_dt_ids[] = { - { .compatible = "qcom,nss-dp" }, - {}, -}; -MODULE_DEVICE_TABLE(of, nss_dp_dt_ids); - -static struct platform_driver nss_dp_drv = { - .probe = nss_dp_probe, - .remove = nss_dp_remove, - .driver = { - .name = "nss-dp", - .owner = THIS_MODULE, - .of_match_table = of_match_ptr(nss_dp_dt_ids), - }, -}; - -/* - * nss_dp_init() - */ -int __init nss_dp_init(void) -{ - int ret; - - /* - * Bail out on not supported platform - * TODO: Handle this properly with SoC ops - */ - if (!of_machine_is_compatible("qcom,ipq807x") && - !of_machine_is_compatible("qcom,ipq8074") && - !of_machine_is_compatible("qcom,ipq6018") && - !of_machine_is_compatible("qcom,ipq5018")) - return 0; - - /* - * TODO Move this to soc_ops - */ - dp_global_ctx.common_init_done = false; - if (!nss_dp_hal_init()) { - pr_err("DP hal init failed.\n"); - return -EFAULT; - } - - ret = platform_driver_register(&nss_dp_drv); - if (ret) - pr_info("NSS DP platform drv register failed\n"); - - dp_global_ctx.common_init_done = true; - pr_info("**********************************************************\n"); - pr_info("* NSS Data Plane driver\n"); - pr_info("**********************************************************\n"); - - return ret; -} - -/* - * nss_dp_exit() - */ -void __exit nss_dp_exit(void) -{ - - /* - * TODO Move this to soc_ops - */ - if (dp_global_ctx.common_init_done) { - nss_dp_hal_cleanup(); - dp_global_ctx.common_init_done = false; - } - - platform_driver_unregister(&nss_dp_drv); -} - -module_init(nss_dp_init); -module_exit(nss_dp_exit); - -MODULE_LICENSE("Dual BSD/GPL"); -MODULE_DESCRIPTION("NSS Data Plane Network Driver"); diff --git a/feeds/ipq807x/qca-nss-dp/src/nss_dp_switchdev.c b/feeds/ipq807x/qca-nss-dp/src/nss_dp_switchdev.c deleted file mode 100644 index 68bc7697f..000000000 --- a/feeds/ipq807x/qca-nss-dp/src/nss_dp_switchdev.c +++ /dev/null @@ -1,367 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include -#include -#include -#include - -#include "nss_dp_dev.h" -#include "fal/fal_stp.h" -#include "fal/fal_ctrlpkt.h" - -#define NSS_DP_SWITCH_ID 0 -#define NSS_DP_SW_ETHTYPE_PID 0 /* PPE ethtype profile ID for slow protocols */ -#define ETH_P_NONE 0 - -/* - * nss_dp_set_slow_proto_filter() - * Enable/Disable filter to allow Ethernet slow-protocol - */ -static void nss_dp_set_slow_proto_filter(struct nss_dp_dev *dp_priv, bool filter_enable) -{ - sw_error_t ret = 0; - fal_ctrlpkt_profile_t profile; - fal_ctrlpkt_action_t action; - - memset(&profile, 0, sizeof(profile)); - - /* - * Action is redirect cpu - */ - action.action = FAL_MAC_RDT_TO_CPU; - action.sg_bypass = A_FALSE; - - /* - * Bypass stp - */ - action.in_stp_bypass = A_TRUE; - action.in_vlan_fltr_bypass = A_FALSE; - action.l2_filter_bypass = A_FALSE; - profile.action = action; - profile.ethtype_profile_bitmap = 0x1; - - /* - * Set port map - */ - profile.port_map = (1 << dp_priv->macid); - if (filter_enable) { - ret = fal_mgmtctrl_ctrlpkt_profile_add(NSS_DP_SWITCH_ID, &profile); - if (ret != SW_OK) { - netdev_dbg(dp_priv->netdev, "failed to add profile for port_map: 0x%x, ret: %d\n", profile.port_map, ret); - return; - } - - /* - * Enable filter to allow ethernet slow-protocol, - * if this is the first port being disabled by STP - */ - if (!dp_priv->ctx->slowproto_acl_bm) { - ret = fal_mgmtctrl_ethtype_profile_set(NSS_DP_SWITCH_ID, NSS_DP_SW_ETHTYPE_PID, ETH_P_SLOW); - if (ret != SW_OK) { - netdev_dbg(dp_priv->netdev, "failed to set ethertype profile: 0x%x, ret: %d\n", ETH_P_SLOW, ret); - ret = fal_mgmtctrl_ctrlpkt_profile_del(NSS_DP_SWITCH_ID, &profile); - if (ret != SW_OK) { - netdev_dbg(dp_priv->netdev, "failed to delete profile for port_map: 0x%x, ret: %d\n", profile.port_map, ret); - } - return; - } - } - - /* - * Add port to port bitmap - */ - dp_priv->ctx->slowproto_acl_bm = dp_priv->ctx->slowproto_acl_bm | (1 << dp_priv->macid); - } else { - - ret = fal_mgmtctrl_ctrlpkt_profile_del(NSS_DP_SWITCH_ID, &profile); - if (ret != SW_OK) { - netdev_dbg(dp_priv->netdev, "failed to delete profile for port_map: 0x%x, ret: %d\n", profile.port_map, ret); - return; - } - - /* - * Delete port from port bitmap - */ - dp_priv->ctx->slowproto_acl_bm = dp_priv->ctx->slowproto_acl_bm & (~(1 << dp_priv->macid)); - - /* - * If all ports are in STP-enabled state, then we do not need - * the filter to allow ethernet slow protocol packets - */ - if (!dp_priv->ctx->slowproto_acl_bm) { - ret = fal_mgmtctrl_ethtype_profile_set(NSS_DP_SWITCH_ID, NSS_DP_SW_ETHTYPE_PID, ETH_P_NONE); - if (ret != SW_OK) { - netdev_dbg(dp_priv->netdev, "failed to reset ethertype profile: 0x%x ret: %d\n", ETH_P_NONE, ret); - } - } - } -} - -/* - * nss_dp_stp_state_set() - * Set bridge port STP state to the port of NSS data plane. - */ -static int nss_dp_stp_state_set(struct nss_dp_dev *dp_priv, u8 state) -{ - sw_error_t err; - fal_stp_state_t stp_state; - - switch (state) { - case BR_STATE_DISABLED: - stp_state = FAL_STP_DISABLED; - - /* - * Dynamic bond interfaces which are bridge slaves need to receive - * ethernet slow protocol packets for LACP protocol even in STP - * disabled state - */ - nss_dp_set_slow_proto_filter(dp_priv, true); - break; - case BR_STATE_LISTENING: - stp_state = FAL_STP_LISTENING; - break; - case BR_STATE_BLOCKING: - stp_state = FAL_STP_BLOCKING; - break; - case BR_STATE_LEARNING: - stp_state = FAL_STP_LEARNING; - break; - case BR_STATE_FORWARDING: - stp_state = FAL_STP_FORWARDING; - - /* - * Remove the filter for allowing ethernet slow protocol packets - * for bond interfaces - */ - nss_dp_set_slow_proto_filter(dp_priv, false); - break; - default: - return -EOPNOTSUPP; - } - - err = fal_stp_port_state_set(NSS_DP_SWITCH_ID, 0, dp_priv->macid, - stp_state); - if (err) { - netdev_dbg(dp_priv->netdev, "failed to set ftp state\n"); - - /* - * Restore the slow proto filters - */ - if (state == BR_STATE_DISABLED) - nss_dp_set_slow_proto_filter(dp_priv, false); - else if (state == BR_STATE_FORWARDING) - nss_dp_set_slow_proto_filter(dp_priv, true); - - return -EINVAL; - } - - return 0; -} - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) -/* - * nss_dp_attr_get() - * Get port information to update switchdev attribute for NSS data plane. - */ -static int nss_dp_attr_get(struct net_device *dev, struct switchdev_attr *attr) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(dev); - - switch (attr->id) { - case SWITCHDEV_ATTR_ID_PORT_PARENT_ID: - attr->u.ppid.id_len = 1; - attr->u.ppid.id[0] = NSS_DP_SWITCH_ID; - break; - - case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: - attr->u.brport_flags = dp_priv->brport_flags; - break; - default: - return -EOPNOTSUPP; - } - - return 0; -} - -/* - * nss_dp_attr_set() - * Get switchdev attribute and set to the device of NSS data plane. - */ -static int nss_dp_attr_set(struct net_device *dev, - const struct switchdev_attr *attr, - struct switchdev_trans *trans) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(dev); - struct net_device *upper_dev; - struct vlan_dev_priv *vlan; - struct list_head *iter; - uint32_t stp_state = attr->u.stp_state; - - if (switchdev_trans_ph_prepare(trans)) - return 0; - - switch (attr->id) { - case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: - dp_priv->brport_flags = attr->u.brport_flags; - netdev_dbg(dev, "set brport_flags %lu\n", attr->u.brport_flags); - return 0; - case SWITCHDEV_ATTR_ID_PORT_STP_STATE: - /* - * The stp state is not changed to FAL_STP_DISABLED if - * the net_device (dev) has any vlan configured. Otherwise - * traffic on other vlan(s) will not work. - * - * Note: STP for VLANs is not supported by PPE. - */ - if ((stp_state == BR_STATE_DISABLED) || - (stp_state == BR_STATE_BLOCKING)) { - rcu_read_lock(); - netdev_for_each_upper_dev_rcu(dev, upper_dev, iter) { - if (!is_vlan_dev(upper_dev)) - continue; - - vlan = vlan_dev_priv(upper_dev); - if (vlan->real_dev == dev) { - rcu_read_unlock(); - netdev_dbg(dev, "Do not update stp state to: %u since vlan id: %d is configured on netdevice: %s\n", - stp_state, vlan->vlan_id, vlan->real_dev->name); - return 0; - } - } - - rcu_read_unlock(); - } - - return nss_dp_stp_state_set(dp_priv, stp_state); - default: - return -EOPNOTSUPP; - } -} - -/* - * nss_dp_switchdev_ops - * Switchdev operations of NSS data plane. - */ -static const struct switchdev_ops nss_dp_switchdev_ops = { - .switchdev_port_attr_get = nss_dp_attr_get, - .switchdev_port_attr_set = nss_dp_attr_set, -}; - -/* - * nss_dp_switchdev_setup() - * Set up NSS data plane switchdev operations. - */ -void nss_dp_switchdev_setup(struct net_device *dev) -{ - dev->switchdev_ops = &nss_dp_switchdev_ops; - switchdev_port_fwd_mark_set(dev, NULL, false); -} -#else - -/* - * nss_dp_port_attr_set() - * Sets attributes - */ -static int nss_dp_port_attr_set(struct net_device *dev, - const struct switchdev_attr *attr, - struct switchdev_trans *trans) -{ - struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(dev); - - if (switchdev_trans_ph_prepare(trans)) - return 0; - - switch (attr->id) { - case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: - dp_priv->brport_flags = attr->u.brport_flags; - netdev_dbg(dev, "set brport_flags %lu\n", attr->u.brport_flags); - return 0; - case SWITCHDEV_ATTR_ID_PORT_STP_STATE: - return nss_dp_stp_state_set(dp_priv, attr->u.stp_state); - default: - return -EOPNOTSUPP; - } - -} - -/* - * nss_dp_switchdev_port_attr_set_event() - * Attribute set event - */ -static int nss_dp_switchdev_port_attr_set_event(struct net_device *netdev, - struct switchdev_notifier_port_attr_info *port_attr_info) -{ - int err; - - err = nss_dp_port_attr_set(netdev, port_attr_info->attr, - port_attr_info->trans); - - port_attr_info->handled = true; - return notifier_from_errno(err); -} - -/* - * nss_dp_switchdev_event() - * Switch dev event on netdevice - */ -static int nss_dp_switchdev_event(struct notifier_block *unused, - unsigned long event, void *ptr) -{ - struct net_device *dev = switchdev_notifier_info_to_dev(ptr); - - /* - * Handle switchdev event only for physical devices - */ - if (!nss_dp_is_phy_dev(dev)) { - return NOTIFY_DONE; - } - - if (event == SWITCHDEV_PORT_ATTR_SET) - nss_dp_switchdev_port_attr_set_event(dev, ptr); - - return NOTIFY_DONE; -} - -static struct notifier_block nss_dp_switchdev_notifier = { - .notifier_call = nss_dp_switchdev_event, -}; - -static bool switch_init_done; - -/* - * nss_dp_switchdev_setup() - * Setup switch dev - */ -void nss_dp_switchdev_setup(struct net_device *dev) -{ - int err; - - if (switch_init_done) { - return; - } - - err = register_switchdev_blocking_notifier(&nss_dp_switchdev_notifier); - if (err) { - netdev_dbg(dev, "%px:Failed to register switchdev notifier\n", dev); - } - - switch_init_done = true; - -} -#endif diff --git a/feeds/ipq807x/qca-nss-drv/Makefile b/feeds/ipq807x/qca-nss-drv/Makefile deleted file mode 100644 index 71d73b564..000000000 --- a/feeds/ipq807x/qca-nss-drv/Makefile +++ /dev/null @@ -1,111 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=qca-nss-drv -PKG_BRANCH:=master -PKG_RELEASE:=2 - -NSS_CLIENTS_DIR:=$(TOPDIR)/qca/src/qca-nss-clients - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/qca-nss-drv - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Devices - DEPENDS:=@TARGET_ipq807x +kmod-qca-nss-dp - TITLE:=Kernel driver for NSS (core driver) - FILES:=$(PKG_BUILD_DIR)/qca-nss-drv.ko - AUTOLOAD:=$(call AutoLoad,32,qca-nss-drv) -endef - -define KernelPackage/qca-nss-drv/install - $(INSTALL_DIR) $(1)/lib/debug - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_DIR) $(1)/etc/sysctl.d - $(INSTALL_DIR) $(1)/etc/config - - $(INSTALL_BIN) ./files/qca-nss-drv.debug $(1)/lib/debug/qca-nss-drv - $(INSTALL_BIN) ./files/qca-nss-drv.init $(1)/etc/init.d/qca-nss-drv - $(INSTALL_BIN) ./files/qca-nss-drv.sysctl $(1)/etc/sysctl.d/qca-nss-drv.conf - $(INSTALL_BIN) ./files/qca-nss-drv.conf $(1)/etc/config/nss - -endef - -define KernelPackage/qca-nss-drv/Description -This package contains a NSS driver for QCA chipset -endef - -define Build/InstallDev - mkdir -p $(1)/usr/include/qca-nss-drv - $(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-drv/ -ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_64" "ipq60xx" "ipq60xx_64" "ipq50xx" "ipq50xx_64")) - $(RM) $(1)/usr/include/qca-nss-drv/nss_ipsecmgr.h - $(INSTALL_DIR) $(1)/usr/include/qca-nss-clients -# $(CP) $(NSS_CLIENTS_DIR)/exports/nss_ipsecmgr.h $(1)/usr/include/qca-nss-clients/. -endif -endef - -EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac -I$(STAGING_DIR)/usr/include/qca-nss-dp -I$(STAGING_DIR)/usr/include/qca-ssdk - -# Keeping default as ipq806x for branches that does not have subtarget framework -subtarget:=$(SUBTARGET) - -ifeq ($(CONFIG_KERNEL_IPQ_MEM_PROFILE),256) -EXTRA_CFLAGS+= -DNSS_MEM_PROFILE_LOW -endif - -ifeq ($(CONFIG_KERNEL_IPQ_MEM_PROFILE),512) -EXTRA_CFLAGS+= -DNSS_MEM_PROFILE_MEDIUM -endif - -ifeq ($(CONFIG_KERNEL_SKB_FIXED_SIZE_2K),y) -EXTRA_CFLAGS+= -DNSS_SKB_FIXED_SIZE_2K -endif - -DRV_MAKE_OPTS:= -ifeq ($(CONFIG_KERNEL_IPQ_MEM_PROFILE),256) -DRV_MAKE_OPTS+=NSS_DRV_C2C_ENABLE=n \ - NSS_DRV_CAPWAP_ENABLE=n \ - NSS_DRV_CLMAP_ENABLE=n \ - NSS_DRV_CRYPTO_ENABLE=n \ - NSS_DRV_DTLS_ENABLE=n \ - NSS_DRV_GRE_ENABLE=n \ - NSS_DRV_GRE_REDIR_ENABLE=n \ - NSS_DRV_GRE_TUNNEL_ENABLE=n \ - NSS_DRV_IGS_ENABLE=n \ - NSS_DRV_IPSEC_ENABLE=n \ - NSS_DRV_LAG_ENABLE=n \ - NSS_DRV_L2TP_ENABLE=n \ - NSS_DRV_MAPT_ENABLE=n \ - NSS_DRV_OAM_ENABLE=n \ - NSS_DRV_PPTP_ENABLE=n \ - NSS_DRV_PORTID_ENABLE=n \ - NSS_DRV_PVXLAN_ENABLE=n \ - NSS_DRV_QRFS_ENABLE=n \ - NSS_DRV_QVPN_ENABLE=n \ - NSS_DRV_RMNET_ENABLE=n \ - NSS_DRV_SHAPER_ENABLE=n \ - NSS_DRV_SJACK_ENABLE=n \ - NSS_DRV_TLS_ENABLE=n \ - NSS_DRV_TRUSTSEC_ENABLE=n \ - NSS_DRV_TSTAMP_ENABLE=n \ - NSS_DRV_TUN6RD_ENABLE=n \ - NSS_DRV_TUNIPIP6_ENABLE=n \ - NSS_DRV_VXLAN_ENABLE=n -endif - -define Build/Configure - $(LN) arch/nss_$(subtarget).h $(PKG_BUILD_DIR)/exports/nss_arch.h -endef - -define Build/Compile - $(MAKE) -C "$(LINUX_DIR)" $(strip $(DRV_MAKE_OPTS)) \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ - M="$(PKG_BUILD_DIR)" \ - EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC="$(subtarget)" \ - modules -endef - -$(eval $(call KernelPackage,qca-nss-drv)) diff --git a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.conf b/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.conf deleted file mode 100644 index a8a1fbf40..000000000 --- a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.conf +++ /dev/null @@ -1,6 +0,0 @@ -config nss_firmware 'qca_nss_0' - -config nss_firmware 'qca_nss_1' - -config general - option enable_rps '1' diff --git a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.debug b/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.debug deleted file mode 100644 index 5d435c3a7..000000000 --- a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.debug +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh /sbin/sysdebug -# -# Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# - -log cat /sys/kernel/debug/qca-nss-drv/stats/pppoe -log cat /sys/kernel/debug/qca-nss-drv/stats/n2h -log cat /sys/kernel/debug/qca-nss-drv/stats/ipv6 -log cat /sys/kernel/debug/qca-nss-drv/stats/ipv4 -log cat /sys/kernel/debug/qca-nss-drv/stats/gmac -log cat /sys/kernel/debug/qca-nss-drv/stats/drv -log cat /sys/kernel/debug/qca-nss-drv/stats/wifi -log cat /sys/kernel/debug/qca-nss-drv/stats/wifi_if -log cat /sys/kernel/debug/qca-nss-drv/stats/eth_rx diff --git a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.hotplug b/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.hotplug deleted file mode 100644 index 1e4813838..000000000 --- a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.hotplug +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# - -KERNEL=`uname -r` -case "${KERNEL}" in - 3.4*) - select_or_load=load_nss_fw - ;; - *) - select_or_load=select_nss_fw - ;; -esac - -load_nss_fw () { - ls -l $1 | awk ' { print $9,$5 } '> /dev/console - echo 1 > /sys/class/firmware/$DEVICENAME/loading - cat $1 > /sys/class/firmware/$DEVICENAME/data - echo 0 > /sys/class/firmware/$DEVICENAME/loading -} - -select_nss_fw () { - rm -f /lib/firmware/$DEVICENAME - ln -s $1 /lib/firmware/$DEVICENAME - ls -l /lib/firmware/$DEVICENAME | awk ' { print $9,$5 } '> /dev/console -} - -[ "$ACTION" != "add" ] && exit - -# dev name for UCI, since it doesn't let you use . or - -SDEVNAME=$(echo ${DEVICENAME} | sed s/[.-]/_/g) - -SELECTED_FW=$(uci get nss.${SDEVNAME}.firmware 2>/dev/null) -[ -e "${SELECTED_FW}" ] && { - $select_or_load ${SELECTED_FW} - exit -} - -case $DEVICENAME in - qca-nss0* | qca-nss.0*) - if [ -e /lib/firmware/qca-nss0-enterprise.bin ] ; then - $select_or_load /lib/firmware/qca-nss0-enterprise.bin - else - $select_or_load /lib/firmware/qca-nss0-retail.bin - fi - exit - ;; - qca-nss1* | qca-nss.1*) - if [ -e /lib/firmware/qca-nss1-enterprise.bin ] ; then - $select_or_load /lib/firmware/qca-nss1-enterprise.bin - else - $select_or_load /lib/firmware/qca-nss1-retail.bin - fi - exit - ;; -esac - diff --git a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.init b/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.init deleted file mode 100644 index de12cb6d1..000000000 --- a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.init +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh /etc/rc.common -# -# Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# - -START=70 - -enable_rps() { - irq_nss_rps=`grep nss_queue1 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '` - for entry in $irq_nss_rps - do - echo 2 > /proc/irq/$entry/smp_affinity - done - - irq_nss_rps=`grep nss_queue2 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '` - for entry in $irq_nss_rps - do - echo 4 > /proc/irq/$entry/smp_affinity - done - - irq_nss_rps=`grep nss_queue3 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '` - for entry in $irq_nss_rps - do - echo 8 > /proc/irq/$entry/smp_affinity - done - - # Enable NSS RPS - sysctl -w dev.nss.rps.enable=1 >/dev/null 2>/dev/null - -} - - -start() { - local rps_enabled="$(uci_get nss @general[0] enable_rps)" - if [ "$rps_enabled" -eq 1 ]; then - enable_rps - fi -} diff --git a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.sysctl b/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.sysctl deleted file mode 100644 index fc36c33eb..000000000 --- a/feeds/ipq807x/qca-nss-drv/files/qca-nss-drv.sysctl +++ /dev/null @@ -1,4 +0,0 @@ -# Default Number of connection configuration -dev.nss.ipv4cfg.ipv4_conn=4096 -dev.nss.ipv6cfg.ipv6_conn=4096 - diff --git a/feeds/ipq807x/qca-nss-drv/patches/100-compile.patch b/feeds/ipq807x/qca-nss-drv/patches/100-compile.patch deleted file mode 100644 index 21a7e6b4e..000000000 --- a/feeds/ipq807x/qca-nss-drv/patches/100-compile.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: qca-nss-drv/nss_dma_log.c -=================================================================== ---- qca-nss-drv.orig/nss_dma_log.c -+++ qca-nss-drv/nss_dma_log.c -@@ -60,8 +60,8 @@ static void nss_dma_configure_msg(struct - */ - static void nss_dma_test_perf_msg(struct nss_dma_msg *ndm) - { -- struct nss_dma_test_cfg *ndtc = &ndm->msg.test_cfg; -- struct nss_cmn_node_stats *ncns = &ndtc->node_stats; -+ //struct nss_dma_test_cfg *ndtc = &ndm->msg.test_cfg; -+ //struct nss_cmn_node_stats *ncns = &ndtc->node_stats; - - nss_trace("%px: NSS DMA test perf message: \n",ndm); - nss_trace("%px: processed (TX: %u, RX:%u, time:%u)\n", ndm, ncns->tx_packets, ncns->rx_packets, ndtc->time_delta); diff --git a/feeds/ipq807x/qca-nss-drv/patches/200-napi_threaded.patch b/feeds/ipq807x/qca-nss-drv/patches/200-napi_threaded.patch deleted file mode 100644 index 534898cdc..000000000 --- a/feeds/ipq807x/qca-nss-drv/patches/200-napi_threaded.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/nss_hal/nss_hal.c -+++ b/nss_hal/nss_hal.c -@@ -306,6 +306,8 @@ int nss_hal_probe(struct platform_device - * Initialize the dummy netdevice. - */ - init_dummy_netdev(&nss_ctx->napi_ndev); -+ strcpy(nss_ctx->napi_ndev.name, "nss"); -+ nss_ctx->napi_ndev.threaded = 1; - - for (i = 0; i < npd->num_irq; i++) { - err = nss_hal_register_irq(nss_ctx, npd, &nss_ctx->napi_ndev, i); diff --git a/feeds/ipq807x/qca-nss-drv/src/Makefile b/feeds/ipq807x/qca-nss-drv/src/Makefile deleted file mode 100644 index f5c4b9040..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/Makefile +++ /dev/null @@ -1,537 +0,0 @@ -# ################################################### -# # Makefile for the NSS driver -# ################################################### - -obj-m += qca-nss-drv.o - -# -# List the files that belong to the driver in alphabetical order. -# -qca-nss-drv-objs := \ - nss_cmn.o \ - nss_core.o \ - nss_coredump.o \ - nss_drv_stats.o \ - nss_drv_strings.o \ - nss_dynamic_interface.o \ - nss_dynamic_interface_log.o \ - nss_dynamic_interface_stats.o \ - nss_eth_rx.o \ - nss_eth_rx_stats.o \ - nss_eth_rx_strings.o \ - nss_gmac_stats.o \ - nss_if.o \ - nss_if_log.o \ - nss_init.o \ - nss_ipv4.o \ - nss_ipv4_stats.o \ - nss_ipv4_strings.o \ - nss_ipv4_log.o \ - nss_log.o \ - nss_lso_rx.o \ - nss_lso_rx_stats.o \ - nss_lso_rx_strings.o \ - nss_meminfo.o \ - nss_n2h.o \ - nss_n2h_stats.o \ - nss_n2h_strings.o \ - nss_phys_if.o \ - nss_pm.o \ - nss_profiler.o \ - nss_project.o \ - nss_pppoe.o \ - nss_pppoe_log.o \ - nss_pppoe_stats.o \ - nss_pppoe_strings.o \ - nss_rps.o \ - nss_stats.o \ - nss_strings.o \ - nss_tx_msg_sync.o \ - nss_unaligned.o \ - nss_unaligned_log.o \ - nss_unaligned_stats.o \ - nss_virt_if.o \ - nss_virt_if_stats.o \ - nss_vlan.o \ - nss_vlan_log.o \ - nss_wifi.o \ - nss_wifi_log.o \ - nss_wifi_stats.o \ - nss_wifi_vdev.o \ - nss_wifili.o \ - nss_wifili_log.o \ - nss_wifili_stats.o \ - nss_wifili_strings.o \ - nss_wifi_mac_db.o - -# Base NSS data plane/HAL support -qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o -qca-nss-drv-objs += nss_hal/nss_hal.o - -ifneq "$(NSS_DRV_BRIDGE_ENABLE)" "n" -ccflags-y += -DNSS_DRV_BRIDGE_ENABLE -qca-nss-drv-objs += \ - nss_bridge.o \ - nss_bridge_log.o -endif - -ifneq "$(NSS_DRV_WIFI_EXT_VDEV_ENABLE)" "n" -ccflags-y += -DNSS_DRV_WIFI_EXT_VDEV_ENABLE -qca-nss-drv-objs += \ - nss_wifi_ext_vdev.o \ - nss_wifi_ext_vdev_stats.o \ - nss_wifi_ext_vdev_log.o -endif - -ifneq "$(NSS_DRV_WIFI_MESH_ENABLE)" "n" -ccflags-y += -DNSS_DRV_WIFI_MESH_ENABLE -qca-nss-drv-objs += \ - nss_wifi_mesh.o \ - nss_wifi_mesh_log.o \ - nss_wifi_mesh_stats.o \ - nss_wifi_mesh_strings.o -endif - -ifneq "$(NSS_DRV_IPV4_REASM_ENABLE)" "n" -ccflags-y += -DNSS_DRV_IPV4_REASM_ENABLE -qca-nss-drv-objs += \ - nss_ipv4_reasm.o \ - nss_ipv4_reasm_stats.o \ - nss_ipv4_reasm_strings.o -endif - -ifneq "$(NSS_DRV_L2TP_ENABLE)" "n" -ccflags-y += -DNSS_DRV_L2TP_ENABLE -qca-nss-drv-objs += \ - nss_l2tpv2.o \ - nss_l2tpv2_log.o \ - nss_l2tpv2_stats.o \ - nss_l2tpv2_strings.o -endif - -ifneq "$(NSS_DRV_LAG_ENABLE)" "n" -ccflags-y += -DNSS_DRV_LAG_ENABLE -qca-nss-drv-objs += \ - nss_lag.o \ - nss_lag_log.o -endif - -ifneq "$(NSS_DRV_PVXLAN_ENABLE)" "n" -ccflags-y += -DNSS_DRV_PVXLAN_ENABLE -qca-nss-drv-objs += \ - nss_pvxlan.o \ - nss_pvxlan_log.o \ - nss_pvxlan_stats.o -endif - -ifneq "$(NSS_DRV_IPV6_ENABLE)" "n" -ccflags-y += -DNSS_DRV_IPV6_ENABLE -qca-nss-drv-objs += \ - nss_ipv6.o \ - nss_ipv6_stats.o \ - nss_ipv6_strings.o \ - nss_ipv6_log.o -ifneq "$(NSS_DRV_IPV6_REASM_ENABLE)" "n" -ccflags-y += -DNSS_DRV_IPV6_REASM_ENABLE -qca-nss-drv-objs += \ - nss_ipv6_reasm.o \ - nss_ipv6_reasm_stats.o \ - nss_ipv6_reasm_strings.o -endif -endif - -ifneq "$(NSS_DRV_TSTAMP_ENABLE)" "n" -ccflags-y += -DNSS_DRV_TSTAMP_ENABLE -qca-nss-drv-objs += \ - nss_tstamp.o \ - nss_tstamp_stats.o -endif - -ifneq "$(NSS_DRV_GRE_ENABLE)" "n" -ccflags-y += -DNSS_DRV_GRE_ENABLE -qca-nss-drv-objs += \ - nss_gre.o \ - nss_gre_log.o \ - nss_gre_stats.o \ - nss_gre_strings.o -endif - -ifneq "$(NSS_DRV_GRE_REDIR_ENABLE)" "n" -ccflags-y += -DNSS_DRV_GRE_REDIR_ENABLE -qca-nss-drv-objs += \ - nss_gre_redir.o \ - nss_gre_redir_log.o \ - nss_gre_redir_lag_ds.o \ - nss_gre_redir_lag_ds_log.o \ - nss_gre_redir_lag_ds_stats.o \ - nss_gre_redir_lag_ds_strings.o \ - nss_gre_redir_lag_us.o \ - nss_gre_redir_lag_us_log.o \ - nss_gre_redir_lag_us_stats.o \ - nss_gre_redir_lag_us_strings.o \ - nss_gre_redir_stats.o \ - nss_gre_redir_strings.o \ - nss_gre_redir_mark.o \ - nss_gre_redir_mark_log.o \ - nss_gre_redir_mark_stats.o \ - nss_gre_redir_mark_strings.o -endif - -ifneq "$(NSS_DRV_GRE_TUNNEL_ENABLE)" "n" -ccflags-y += -DNSS_DRV_GRE_TUNNEL_ENABLE -qca-nss-drv-objs += \ - nss_gre_tunnel.o \ - nss_gre_tunnel_log.o \ - nss_gre_tunnel_stats.o \ - nss_gre_tunnel_strings.o -endif - -ifneq "$(NSS_DRV_CAPWAP_ENABLE)" "n" -ccflags-y += -DNSS_DRV_CAPWAP_ENABLE -qca-nss-drv-objs += \ - nss_capwap.o \ - nss_capwap_log.o \ - nss_capwap_stats.o \ - nss_capwap_strings.o -endif - -ifneq "$(NSS_DRV_MAPT_ENABLE)" "n" -ccflags-y += -DNSS_DRV_MAPT_ENABLE -qca-nss-drv-objs += \ - nss_map_t.o \ - nss_map_t_log.o \ - nss_map_t_stats.o \ - nss_map_t_strings.o -endif - -ifneq "$(NSS_DRV_PPTP_ENABLE)" "n" -ccflags-y += -DNSS_DRV_PPTP_ENABLE -qca-nss-drv-objs += \ - nss_pptp.o \ - nss_pptp_log.o \ - nss_pptp_stats.o \ - nss_pptp_strings.o -endif - -ifneq "$(NSS_DRV_SHAPER_ENABLE)" "n" -ccflags-y += -DNSS_DRV_SHAPER_ENABLE -qca-nss-drv-objs += \ - nss_shaper.o -endif - -ifneq "$(NSS_DRV_SJACK_ENABLE)" "n" -ccflags-y += -DNSS_DRV_SJACK_ENABLE -qca-nss-drv-objs += \ - nss_sjack.o \ - nss_sjack_log.o \ - nss_sjack_stats.o -endif - -ifneq "$(NSS_DRV_TUN6RD_ENABLE)" "n" -ccflags-y += -DNSS_DRV_TUN6RD_ENABLE -qca-nss-drv-objs += \ - nss_tun6rd.o \ - nss_tun6rd_log.o -endif - -ifneq "$(NSS_DRV_TRUSTSEC_ENABLE)" "n" -ccflags-y += -DNSS_DRV_TRUSTSEC_ENABLE -qca-nss-drv-objs += \ - nss_trustsec_tx.o \ - nss_trustsec_tx_log.o \ - nss_trustsec_tx_stats.o -endif - -ifneq "$(NSS_DRV_TUNIPIP6_ENABLE)" "n" -ccflags-y += -DNSS_DRV_TUNIPIP6_ENABLE -qca-nss-drv-objs += \ - nss_tunipip6.o \ - nss_tunipip6_log.o \ - nss_tunipip6_stats.o -endif - -ifneq "$(NSS_DRV_QRFS_ENABLE)" "n" -ccflags-y += -DNSS_DRV_QRFS_ENABLE -qca-nss-drv-objs += \ - nss_qrfs.o \ - nss_qrfs_log.o \ - nss_qrfs_stats.o -endif - -ifneq "$(NSS_DRV_RMNET_ENABLE)" "n" -ccflags-y += -DNSS_DRV_RMNET_ENABLE -qca-nss-drv-objs += \ - nss_rmnet_rx.o \ - nss_rmnet_rx_stats.o -endif - -ifneq "$(NSS_DRV_PORTID_ENABLE)" "n" -ccflags-y += -DNSS_DRV_PORTID_ENABLE -qca-nss-drv-objs += \ - nss_portid.o \ - nss_portid_log.o \ - nss_portid_stats.o -endif - -ifneq "$(NSS_DRV_IGS_ENABLE)" "n" -ccflags-y += -DNSS_DRV_IGS_ENABLE -qca-nss-drv-objs += \ - nss_igs.o \ - nss_igs_stats.o -endif - -ifneq "$(NSS_DRV_OAM_ENABLE)" "n" -ccflags-y += -DNSS_DRV_OAM_ENABLE -qca-nss-drv-objs += \ - nss_oam.o \ - nss_oam_log.o -endif - -ifneq "$(NSS_DRV_CLMAP_ENABLE)" "n" -ccflags-y += -DNSS_DRV_CLMAP_ENABLE -qca-nss-drv-objs += \ - nss_clmap.o \ - nss_clmap_log.o \ - nss_clmap_stats.o \ - nss_clmap_strings.o -endif - - -ifneq "$(NSS_DRV_VXLAN_ENABLE)" "n" -ccflags-y += -DNSS_DRV_VXLAN_ENABLE -qca-nss-drv-objs += \ - nss_vxlan.o \ - nss_vxlan_log.o \ - nss_vxlan_stats.o -endif - -ifneq "$(NSS_DRV_MATCH_ENABLE)" "n" -ccflags-y += -DNSS_DRV_MATCH_ENABLE -qca-nss-drv-objs += \ - nss_match.o \ - nss_match_log.o \ - nss_match_stats.o \ - nss_match_strings.o -endif - -ifneq "$(NSS_DRV_MIRROR_ENABLE)" "n" -ccflags-y += -DNSS_DRV_MIRROR_ENABLE -qca-nss-drv-objs += \ - nss_mirror.o \ - nss_mirror_log.o \ - nss_mirror_stats.o \ - nss_mirror_strings.o -endif - -ifneq "$(NSS_DRV_UDP_ST_ENABLE)" "n" -ccflags-y += -DNSS_DRV_UDP_ST_ENABLE -qca-nss-drv-objs += \ - nss_udp_st.o \ - nss_udp_st_log.o \ - nss_udp_st_stats.o \ - nss_udp_st_strings.o -endif - -ifeq ($(SoC),$(filter $(SoC),ipq806x)) -qca-nss-drv-objs += nss_data_plane/nss_data_plane_gmac.o \ - nss_hal/ipq806x/nss_hal_pvt.o - -ifneq "$(NSS_DRV_C2C_ENABLE)" "n" -ccflags-y += -DNSS_DRV_C2C_ENABLE -qca-nss-drv-objs += \ - nss_c2c_tx.o \ - nss_c2c_tx_log.o \ - nss_c2c_tx_stats.o \ - nss_c2c_tx_strings.o \ - nss_c2c_rx.o \ - nss_c2c_rx_stats.o \ - nss_c2c_rx_strings.o -endif -ifneq "$(NSS_DRV_IPSEC_ENABLE)" "n" -ccflags-y += -DNSS_DRV_IPSEC_ENABLE -qca-nss-drv-objs += \ - nss_ipsec_log.o \ - nss_ipsec.o -endif - -ifneq "$(NSS_DRV_CRYPTO_ENABLE)" "n" -ccflags-y += -DNSS_DRV_CRYPTO_ENABLE -qca-nss-drv-objs += \ - nss_crypto.o \ - nss_crypto_log.o -endif - -ifneq "$(NSS_DRV_DTLS_ENABLE)" "n" -ccflags-y += -DNSS_DRV_DTLS_ENABLE -qca-nss-drv-objs += \ - nss_dtls.o \ - nss_dtls_log.o \ - nss_dtls_stats.o -endif -ccflags-y += -I$(obj)/nss_hal/ipq806x -DNSS_HAL_IPQ806X_SUPPORT -endif - -ifeq ($(SoC),$(filter $(SoC),ipq60xx ipq60xx_64 ipq807x ipq807x_64)) -qca-nss-drv-objs += nss_data_plane/nss_data_plane.o \ - nss_edma.o \ - nss_edma_stats.o \ - nss_edma_strings.o \ - nss_ppe.o \ - nss_ppe_log.o \ - nss_ppe_stats.o \ - nss_ppe_strings.o \ - nss_ppe_vp.o \ - nss_ppe_vp_log.o \ - nss_ppe_vp_stats.o - -ccflags-y += -DNSS_DRV_PPE_ENABLE -ccflags-y += -DNSS_DRV_EDMA_ENABLE - -ifneq "$(NSS_DRV_IPSEC_ENABLE)" "n" -ccflags-y += -DNSS_DRV_IPSEC_ENABLE -qca-nss-drv-objs += \ - nss_ipsec_cmn_log.o \ - nss_ipsec_cmn.o \ - nss_ipsec_cmn_stats.o \ - nss_ipsec_cmn_strings.o -endif - -ifneq "$(NSS_DRV_CRYPTO_ENABLE)" "n" -ccflags-y += -DNSS_DRV_CRYPTO_ENABLE -ccflags-y += -DNSS_DRV_DMA_ENABLE - -qca-nss-drv-objs += \ - nss_crypto_cmn.o \ - nss_crypto_cmn_log.o \ - nss_crypto_cmn_stats.o \ - nss_crypto_cmn_strings.o \ - nss_dma.o \ - nss_dma_log.o \ - nss_dma_stats.o \ - nss_dma_strings.o -endif - -ifneq "$(NSS_DRV_DTLS_ENABLE)" "n" -ccflags-y += -DNSS_DRV_DTLS_ENABLE -qca-nss-drv-objs += \ - nss_dtls_cmn.o \ - nss_dtls_cmn_log.o \ - nss_dtls_cmn_stats.o \ - nss_dtls_cmn_strings.o -endif - -ifneq "$(NSS_DRV_QVPN_ENABLE)" "n" -ccflags-y += -DNSS_DRV_QVPN_ENABLE -qca-nss-drv-objs += \ - nss_qvpn.o \ - nss_qvpn_log.o \ - nss_qvpn_stats.o \ - nss_qvpn_strings.o -endif -ifneq "$(NSS_DRV_TLS_ENABLE)" "n" -ccflags-y += -DNSS_DRV_TLS_ENABLE -qca-nss-drv-objs += \ - nss_tls.o \ - nss_tls_log.o \ - nss_tls_stats.o \ - nss_tls_strings.o -endif -endif - -ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64)) -qca-nss-drv-objs += nss_hal/ipq807x/nss_hal_pvt.o \ - nss_data_plane/hal/nss_ipq807x.o -ifneq "$(NSS_DRV_C2C_ENABLE)" "n" -ccflags-y += -DNSS_DRV_C2C_ENABLE -qca-nss-drv-objs += \ - nss_c2c_tx.o \ - nss_c2c_tx_log.o \ - nss_c2c_tx_stats.o \ - nss_c2c_tx_strings.o \ - nss_c2c_rx.o \ - nss_c2c_rx_stats.o \ - nss_c2c_rx_strings.o -endif -ccflags-y += -I$(obj)/nss_hal/ipq807x -DNSS_HAL_IPQ807x_SUPPORT -DNSS_MULTI_H2N_DATA_RING_SUPPORT -endif - -ifeq ($(SoC),$(filter $(SoC),ipq60xx ipq60xx_64)) -qca-nss-drv-objs += nss_hal/ipq60xx/nss_hal_pvt.o \ - nss_data_plane/hal/nss_ipq60xx.o -ccflags-y += -I$(obj)/nss_hal/ipq60xx -DNSS_HAL_IPQ60XX_SUPPORT -DNSS_MULTI_H2N_DATA_RING_SUPPORT -endif - -ifeq ($(SoC),$(filter $(SoC),ipq50xx ipq50xx_64)) -qca-nss-drv-objs += nss_data_plane/nss_data_plane.o \ - nss_hal/ipq50xx/nss_hal_pvt.o \ - nss_data_plane/hal/nss_ipq50xx.o - -ifneq "$(NSS_DRV_IPSEC_ENABLE)" "n" -ccflags-y += -DNSS_DRV_IPSEC_ENABLE -qca-nss-drv-objs += \ - nss_ipsec_cmn_log.o \ - nss_ipsec_cmn.o \ - nss_ipsec_cmn_stats.o \ - nss_ipsec_cmn_strings.o -endif - -ifneq "$(NSS_DRV_CRYPTO_ENABLE)" "n" -ccflags-y += -DNSS_DRV_CRYPTO_ENABLE -qca-nss-drv-objs += \ - nss_crypto_cmn.o \ - nss_crypto_cmn_log.o \ - nss_crypto_cmn_stats.o \ - nss_crypto_cmn_strings.o -endif - -ifneq "$(NSS_DRV_DTLS_ENABLE)" "n" -ccflags-y += -DNSS_DRV_DTLS_ENABLE -qca-nss-drv-objs += \ - nss_dtls_cmn.o \ - nss_dtls_cmn_log.o \ - nss_dtls_cmn_stats.o \ - nss_dtls_cmn_strings.o -endif -ccflags-y += -I$(obj)/nss_hal/ipq50xx -DNSS_HAL_IPQ50XX_SUPPORT -DNSS_MULTI_H2N_DATA_RING_SUPPORT -endif - -ccflags-y += -I$(obj)/nss_hal/include -I$(obj)/nss_data_plane/include -I$(obj)/exports -DNSS_DEBUG_LEVEL=0 -DNSS_PKT_STATS_ENABLED=1 -ccflags-y += -I$(obj)/nss_data_plane/hal/include -ccflags-y += -DNSS_PM_DEBUG_LEVEL=0 -DNSS_SKB_REUSE_SUPPORT=1 -ccflags-y += -Wall -Werror - -KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION))) - -ifneq ($(findstring 3.4, $(KERNELVERSION)),) -NSS_CCFLAGS = -DNSS_DT_SUPPORT=0 -DNSS_FW_DBG_SUPPORT=1 -DNSS_PM_SUPPORT=1 -else -NSS_CCFLAGS = -DNSS_DT_SUPPORT=1 -DNSS_FW_DBG_SUPPORT=0 -DNSS_PM_SUPPORT=0 - -ccflags-y += -I$(obj) -endif - -# Fabric scaling is supported in 3.14 and 4.4 only -ifneq ($(findstring 3.14, $(KERNELVERSION)),) -NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=1 -else ifneq ($(findstring 4.4, $(KERNELVERSION)),) -NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=1 -else -NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=0 -endif - -# Disable Frequency scaling -ifeq "$(NSS_FREQ_SCALE_DISABLE)" "y" -ccflags-y += -DNSS_FREQ_SCALE_SUPPORT=0 -else -qca-nss-drv-objs += \ - nss_freq.o \ - nss_freq_log.o \ - nss_freq_stats.o -ccflags-y += -DNSS_FREQ_SCALE_SUPPORT=1 -endif - -ccflags-y += $(NSS_CCFLAGS) - -export NSS_CCFLAGS - -obj ?= . diff --git a/feeds/ipq807x/qca-nss-drv/src/Makefile.fsm b/feeds/ipq807x/qca-nss-drv/src/Makefile.fsm deleted file mode 100644 index 93ca00725..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/Makefile.fsm +++ /dev/null @@ -1,123 +0,0 @@ -# ################################################### -# # Makefile for the NSS driver -# ################################################### -obj-m += qca-nss-drv.o - -# -# List the files that belong to the driver in alphabetical order. -# -qca-nss-drv-objs := \ - nss_bridge.o \ - nss_bridge_log.o \ - nss_capwap.o \ - nss_capwap_log.o \ - nss_capwap_stats.o \ - nss_cmn.o \ - nss_core.o \ - nss_coredump.o \ - nss_crypto.o \ - nss_crypto_log.o \ - nss_dtls.o \ - nss_dtls_log.o \ - nss_dtls_stats.o \ - nss_dynamic_interface.o \ - nss_dynamic_interface_log.o \ - nss_edma.o \ - nss_edma_stats.o \ - nss_eth_rx.o \ - nss_eth_rx_stats.o \ - nss_gre.o \ - nss_gre_log.o \ - nss_gre_stats.o \ - nss_gre_redir.o \ - nss_gre_redir_log.o \ - nss_gre_redir_stats.o \ - nss_gre_tunnel.o \ - nss_gre_tunnel_log.o \ - nss_gre_tunnel_stats.o \ - nss_if.o \ - nss_if_log.o \ - nss_init.o \ - nss_ipsec.o \ - nss_ipsec_log.o \ - nss_ipv4.o \ - nss_ipv4_stats.o \ - nss_ipv4_log.o \ - nss_ipv4_reasm.o \ - nss_ipv4_reasm_stats.o \ - nss_ipv6.o \ - nss_ipv6_stats.o \ - nss_ipv6_log.o \ - nss_ipv6_reasm.o \ - nss_ipv6_reasm_stats.o \ - nss_l2tpv2.o \ - nss_l2tpv2_log.o \ - nss_l2tpv2_stats.o \ - nss_lag.o \ - nss_lag_log.o \ - nss_log.o \ - nss_lso_rx.o \ - nss_lso_rx_stats.o \ - nss_map_t.o \ - nss_map_t_log.o \ - nss_map_t_stats.o \ - nss_n2h.o \ - nss_n2h_stats.o \ - nss_oam.o \ - nss_oam_log.o \ - nss_phys_if.o \ - nss_pm.o \ - nss_profiler.o \ - nss_portid.o \ - nss_portid_log.o \ - nss_portid_stats.o \ - nss_ppe.o \ - nss_ppe_log.o \ - nss_ppe_stats.o \ - nss_pppoe.o \ - nss_pppoe_log.o \ - nss_pppoe_stats.o \ - nss_pptp.o \ - nss_pptp_log.o \ - nss_pptp_stats.o \ - nss_rps.o \ - nss_shaper.o \ - nss_sjack.o \ - nss_sjack_log.o \ - nss_sjack_stats.o \ - nss_stats.o \ - nss_tstamp.o \ - nss_tstamp_stats.o \ - nss_tun6rd.o \ - nss_tun6rd_log.o \ - nss_trustsec_tx.o \ - nss_trustsec_tx_log.o \ - nss_trustsec_tx_stats.o \ - nss_tunipip6.o \ - nss_tunipip6_log.o \ - nss_unaligned.o \ - nss_unaligned_log.o \ - nss_unaligned_stats.o \ - nss_virt_if.o \ - nss_virt_if_stats.o \ - nss_vlan.o \ - nss_vlan_log.o \ - nss_wifi.o \ - nss_wifi_log.o \ - nss_wifi_stats.o \ - nss_wifi_if.o \ - nss_wifi_if_stats.o \ - nss_wifi_vdev.o - -qca-nss-drv-objs += nss_hal/nss_hal.o -qca-nss-drv-objs += nss_hal/fsm9010/nss_hal_pvt.o -qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o -qca-nss-drv-objs += nss_data_plane/nss_data_plane_gmac.o - -ccflags-y += -I$(obj)/nss_hal/include -ccflags-y += -I$(obj)/nss_data_plane/include -ccflags-y += -I$(obj)/exports -ccflags-y += -I$(obj)/nss_hal/fsm9010 -DNSS_HAL_FSM9010_SUPPORT -ccflags-y += -DNSS_DEBUG_LEVEL=0 -DNSS_PKT_STATS_ENABLED=1 -ccflags-y += -DNSS_DT_SUPPORT=1 -DNSS_PM_SUPPORT=0 -DNSS_FW_DBG_SUPPORT=0 -DNSS_SKB_REUSE_SUPPORT=0 -ccflags-y += -DNSS_PPP_SUPPORT=0 -DNSS_FREQ_SCALE_SUPPORT=0 -DNSS_FABRIC_SCALING_SUPPORT=0 diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_fsm9010.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_fsm9010.h deleted file mode 100644 index 7e472907c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_fsm9010.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_fsm9010.h - * Architecture dependent parameters. - */ -#ifndef __NSS_FSM9010_H -#define __NSS_FSM9010_H - -/** - * @addtogroup nss_arch_macros_fsm9010 - * @{ - */ - -#define NSS_MAX_NUM_PRI 1 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 4 /**< Number of host cores. */ - -#define NSS_N2H_RING_COUNT 3 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 4 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -#define NSS_IMEM_START 0xE4000000 /**< NSS IMEM start address. */ -#define NSS_IMEM_SIZE 0x10000 /**< NSS IMEM size. */ - -/** - * @} - */ - -#endif /** __NSS_FSM9010_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq40xx.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq40xx.h deleted file mode 100644 index d6d335132..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq40xx.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipq40xx.h - * Architecture dependent parameters. - */ -#ifndef __NSS_IPQ40XX_H -#define __NSS_IPQ40XX_H - -/** - * @addtogroup nss_arch_macros_ipq40xx - * @{ - */ - -#define NSS_MAX_NUM_PRI 1 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 4 /**< Number of host cores. */ - -#define NSS_N2H_RING_COUNT 0 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 0 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -#define NSS_IMEM_START 0x39000000 /**< NSS IMEM start address. */ -#define NSS_IMEM_SIZE 0x10000 /**< NSS IMEM size per core. */ - -/** - * @} - */ - -#endif /** __NSS_IPQ40XX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq50xx.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq50xx.h deleted file mode 100644 index e83649f81..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq50xx.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipq50xx.h - * Architecture dependent parameters. - */ -#ifndef __NSS_IPQ50XX_H -#define __NSS_IPQ50XX_H - -/** - * @addtogroup nss_arch_macros_ipq50xx - * @{ - */ - -#define NSS_MAX_NUM_PRI 4 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 2 /**< Number of host cores. */ - -#define NSS_N2H_RING_COUNT 3 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 7 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -/** - * @} - */ - -#endif /** __NSS_IPQ50XX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq50xx_64.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq50xx_64.h deleted file mode 100644 index b756c5af7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq50xx_64.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipq50xx_64.h - * Architecture dependent parameters. - */ -#ifndef __NSS_IPQ50XX_64_H -#define __NSS_IPQ50XX_64_H - -/** - * @addtogroup nss_arch_macros_ipq50xx_64 - * @{ - */ - -#define NSS_MAX_NUM_PRI 4 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 2 /**< Number of host cores. */ - -#define NSS_N2H_RING_COUNT 3 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 7 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -/** - * @} - */ - -#endif /** __NSS_IPQ50XX_64_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq60xx.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq60xx.h deleted file mode 100644 index bc0396a46..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq60xx.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipq60xx.h - * Architecture dependent parameters. - */ -#ifndef __NSS_IPQ60XX_H -#define __NSS_IPQ60XX_H - -/** - * @addtogroup nss_arch_macros_ipq60xx - * @{ - */ - -#define NSS_MAX_NUM_PRI 4 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 4 /**< Number of host cores. */ -#define NSS_PPE_SUPPORTED /**< PPE supported flag. */ - -#define NSS_N2H_RING_COUNT 5 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 11 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -/** - * @} - */ - -#endif /** __NSS_IPQ60XX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq60xx_64.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq60xx_64.h deleted file mode 100644 index a0e5e9ea8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq60xx_64.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipq60xx_64.h - * Architecture dependent parameters. - */ -#ifndef __NSS_IPQ60XX_64_H -#define __NSS_IPQ60XX_64_H - -/** - * @addtogroup nss_arch_macros_ipq60xx_64 - * @{ - */ - -#define NSS_MAX_NUM_PRI 4 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 4 /**< Number of host cores. */ -#define NSS_PPE_SUPPORTED /**< PPE supported flag. */ - -#define NSS_N2H_RING_COUNT 5 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 11 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -/** - * @} - */ - -#endif /** __NSS_IPQ60XX_64_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq806x.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq806x.h deleted file mode 100644 index 216f950ef..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq806x.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipq806x.h - * Architecture dependent parameters. - */ -#ifndef __NSS_IPQ806X_H -#define __NSS_IPQ806X_H - -/** - * @addtogroup nss_arch_macros_ipq806x - * @{ - */ - -#define NSS_MAX_NUM_PRI 4 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 2 /**< Number of host cores. */ - -#define NSS_N2H_RING_COUNT 3 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 4 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -#define NSS_IMEM_START 0x39000000 /**< NSS IMEM start address. */ -#define NSS_IMEM_SIZE 0x10000 /**< NSS IMEM size per core. */ - -/** - * @} - */ - -#endif /** __NSS_IPQ806X_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq807x.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq807x.h deleted file mode 100644 index c8fc26dc2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq807x.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipq807x.h - * Architecture dependent parameters. - */ -#ifndef __NSS_IPQ807X_H -#define __NSS_IPQ807X_H - -/** - * @addtogroup nss_arch_macros_ipq807x - * @{ - */ - -#define NSS_MAX_NUM_PRI 4 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 4 /**< Number of host cores. */ -#define NSS_PPE_SUPPORTED /**< PPE supported flag. */ - -#define NSS_N2H_RING_COUNT 5 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 11 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -#define NSS_IMEM_START 0x38000000 /**< NSS IMEM start address. */ -#define NSS_IMEM_SIZE 0x30000 /**< NSS IMEM size per core. */ - -/** - * @} - */ - -#endif /** __NSS_IPQ807X_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq807x_64.h b/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq807x_64.h deleted file mode 100644 index fec7aa538..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/arch/nss_ipq807x_64.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipq807x_64.h - * Architecture dependent parameters. - */ -#ifndef __NSS_IPQ807x_64_H -#define __NSS_IPQ807x_64_H - -/** - * @addtogroup nss_arch_macros_ipq807x_64 - * @{ - */ - -#define NSS_MAX_NUM_PRI 4 /**< Maximum number of priority queues in NSS. */ -#define NSS_HOST_CORES 4 /**< Number of host cores. */ -#define NSS_PPE_SUPPORTED /**< PPE supported flag. */ - -#define NSS_N2H_RING_COUNT 5 /**< Number of N2H rings. */ -#define NSS_H2N_RING_COUNT 11 /**< Number of H2N rings. */ -#define NSS_RING_SIZE 128 /**< Ring size. */ - -#define NSS_IMEM_START 0x38000000 /**< NSS IMEM start address. */ -#define NSS_IMEM_SIZE 0x30000 /**< NSS IMEM size per core. */ - -/** - * @} - */ - -#endif /** __NSS_IPQ807x_64_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_api_if.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_api_if.h deleted file mode 100755 index ddf6b7c68..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_api_if.h +++ /dev/null @@ -1,319 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_api_if.h - * NSS driver APIs and Declarations. - * - * This file declares all the public interfaces for NSS driver. - */ - -#ifndef __NSS_API_IF_H -#define __NSS_API_IF_H - -#ifdef __KERNEL__ /* only kernel will use. */ - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -#include -#include -#include -#include "nss_arch.h" -#include "nss_def.h" -#include "nss_cmn.h" -#include "nss_tun6rd.h" -#include "nss_l2tpv2.h" -#include "nss_pptp.h" -#include "nss_map_t.h" -#include "nss_tunipip6.h" -#include "nss_lag.h" -#include "nss_stats_public.h" -#include "nss_ipv4.h" -#include "nss_ipv6.h" -#include "nss_shaper.h" -#include "nss_if.h" -#include "nss_phy_if.h" -#include "nss_virt_if.h" -#include "nss_pppoe.h" -#include "nss_crypto.h" -#include "nss_crypto_cmn.h" -#include "nss_dma.h" - -#include "nss_profiler.h" -#include "nss_dynamic_interface.h" -#include "nss_ipsec.h" -#include "nss_ipsec_cmn.h" -#include "nss_gre.h" -#include "nss_gre_redir.h" -#include "nss_gre_redir_lag.h" -#include "nss_gre_tunnel.h" -#include "nss_sjack.h" -#include "nss_capwap.h" -#include "nss_wifi.h" -#include "nss_wifi_vdev.h" -#include "nss_n2h.h" -#include "nss_rps.h" -#include "nss_portid.h" -#include "nss_oam.h" -#include "nss_dtls.h" -#include "nss_dtls_cmn.h" -#include "nss_tls.h" -#include "nss_edma.h" -#include "nss_bridge.h" -#include "nss_ppe.h" -#include "nss_trustsec_tx.h" -#include "nss_vlan.h" -#include "nss_igs.h" -#include "nss_mirror.h" -#include "nss_wifili_if.h" -#include "nss_project.h" -#include "nss_qrfs.h" -#include "nss_c2c_tx.h" -#include "nss_qvpn.h" -#include "nss_unaligned.h" -#include "nss_pvxlan.h" -#include "nss_vxlan.h" -#include "nss_pm.h" -#include "nss_freq.h" -#include "nss_tstamp.h" -#include "nss_gre_redir_mark.h" -#include "nss_clmap.h" -#include "nss_rmnet_rx.h" -#include "nss_match.h" -#include "nss_eth_rx.h" -#include "nss_c2c_rx.h" -#include "nss_ipv6_reasm.h" -#include "nss_ipv4_reasm.h" -#include "nss_lso_rx.h" -#include "nss_wifi_mac_db_if.h" -#include "nss_wifi_ext_vdev_if.h" -#include "nss_wifili_if.h" -#include "nss_ppe_vp.h" -#include "nss_wifi_mesh.h" -#include "nss_udp_st.h" -#endif - -#endif /*__KERNEL__ */ - -/** - * @addtogroup nss_driver_subsystem - * @{ - */ - -#define NSS_MAX_CORES 2 /**< Maximum number of core interfaces. */ - -#define NSS_MAX_DEVICE_INTERFACES (NSS_MAX_PHYSICAL_INTERFACES + NSS_MAX_VIRTUAL_INTERFACES + NSS_MAX_TUNNEL_INTERFACES + NSS_MAX_DYNAMIC_INTERFACES) - /**< Maximum number of device interfaces. */ - -#define NSS_MAX_NET_INTERFACES (NSS_MAX_DEVICE_INTERFACES + NSS_MAX_SPECIAL_INTERFACES) - /**< Maximum number of network interfaces. */ - -#define NSS_MAX_PHYSICAL_INTERFACES 8 /**< Maximum number of physical interfaces. */ -#define NSS_MAX_VIRTUAL_INTERFACES 16 /**< Maximum number of virtual interfaces. */ -#define NSS_MAX_TUNNEL_INTERFACES 4 /**< Maximum number of tunnel interfaces. */ -#define NSS_MAX_SPECIAL_INTERFACES 69 /**< Maximum number of special interfaces. */ -#define NSS_MAX_WIFI_RADIO_INTERFACES 3 /**< Maximum number of radio interfaces. */ - -/* - * Start of individual interface groups - */ -#define NSS_PHYSICAL_IF_START 0 - /**< Beginning of the physical interfaces. */ - -#define NSS_VIRTUAL_IF_START (NSS_PHYSICAL_IF_START + NSS_MAX_PHYSICAL_INTERFACES) - /**< Beginning of the virtual interfaces. */ - -#define NSS_TUNNEL_IF_START (NSS_VIRTUAL_IF_START + NSS_MAX_VIRTUAL_INTERFACES) - /**< Beginning of the tunnel interfaces. */ - -#define NSS_DYNAMIC_IF_START (NSS_TUNNEL_IF_START + NSS_MAX_TUNNEL_INTERFACES) - /**< Beginning of the dynamic interfaces. */ - -#define NSS_SPECIAL_IF_START (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES) - /**< Beginning of the special interfaces. */ - -/* - * Tunnel interface numbers - */ -#define NSS_IPSEC_ENCAP_IF_NUMBER (NSS_TUNNEL_IF_START + 0) - /**< Tunnel interface number for IPsec encapsulation interfaces. */ -#define NSS_IPSEC_DECAP_IF_NUMBER (NSS_TUNNEL_IF_START + 1) - /**< Tunnel interface number for IPsec decapsulation interfaces. */ -#define NSS_TUN6RD_INTERFACE (NSS_TUNNEL_IF_START + 2) - /**< Tunnel interface number for TUN6RD interfaces. */ -#define NSS_TUNIPIP6_INTERFACE (NSS_TUNNEL_IF_START + 3) - /**< Tunnel interface number for TUNIPIP6 interfaces. */ - -/* - * Special interface numbers - */ -#define NSS_N2H_INTERFACE (NSS_SPECIAL_IF_START + 0) - /**< Special interface number for N2H. */ -#define NSS_ETH_RX_INTERFACE (NSS_SPECIAL_IF_START + 2) - /**< Special interface number for Ethernet Rx. */ -#define NSS_PPPOE_INTERFACE (NSS_SPECIAL_IF_START + 3) - /**< Special interface number for PPPoE. */ -#define NSS_IPV4_RX_INTERFACE (NSS_SPECIAL_IF_START + 5) - /**< Special interface number for IPv4. */ -#define NSS_IPV6_RX_INTERFACE (NSS_SPECIAL_IF_START + 7) - /**< Special interface number for IPv6. */ -#define NSS_PROFILER_INTERFACE (NSS_SPECIAL_IF_START + 8) - /**< Special interface number for profile. */ -#define NSS_CRYPTO_INTERFACE (NSS_SPECIAL_IF_START + 9) - /**< Special interface number for crypto CE5. */ -#define NSS_DTLS_INTERFACE (NSS_SPECIAL_IF_START + 10) - /**< Special interface number for DTLS. */ -#define NSS_CRYPTO_CMN_INTERFACE (NSS_SPECIAL_IF_START + 11) - /**< Special interface number for crypto common. */ -#define NSS_C2C_TX_INTERFACE (NSS_SPECIAL_IF_START + 12) - /**< Virtual interface number for core-to-core transmissions. */ -#define NSS_C2C_RX_INTERFACE (NSS_SPECIAL_IF_START + 13) - /**< Virtual interface number for core-to-core reception. */ -#define NSS_IPSEC_CMN_INTERFACE (NSS_SPECIAL_IF_START + 18) - /**< Virtual interface number for IPSec rule. */ -#define NSS_COREFREQ_INTERFACE (NSS_SPECIAL_IF_START + 19) - /**< Virtual interface number for core frequency. */ -#define NSS_DYNAMIC_INTERFACE (NSS_SPECIAL_IF_START + 20) - /**< Special interface number for dynamic interfaces. */ -#define NSS_GRE_REDIR_INTERFACE (NSS_SPECIAL_IF_START + 21) - /**< Special interface number for GRE redirect base interfaces. */ -#define NSS_LSO_RX_INTERFACE (NSS_SPECIAL_IF_START + 22) - /**< Special interface number for LSO. */ -#define NSS_SJACK_INTERFACE (NSS_SPECIAL_IF_START + 23) - /**< Special interface number for GRE REDIR base interfaces. */ -#define NSS_IPV4_REASM_INTERFACE (NSS_SPECIAL_IF_START + 24) - /**< Special interface number for IPv4 reassembly interfaces. */ -#define NSS_DEBUG_INTERFACE (NSS_SPECIAL_IF_START + 25) - /**< Special interface number for debug. */ -#define NSS_WIFI_INTERFACE0 (NSS_SPECIAL_IF_START + 26) - /**< Special interface number for Wi-Fi radio 0. */ -#define NSS_WIFI_INTERFACE1 (NSS_SPECIAL_IF_START + 27) - /**< Special interface number for Wi-Fi radio 1. */ -#define NSS_WIFI_INTERFACE2 (NSS_SPECIAL_IF_START + 28) - /**< Special interface number for Wi-Fi radio 2. */ -#define NSS_IPV6_REASM_INTERFACE (NSS_SPECIAL_IF_START + 29) - /**< Special interface number for IPv6 reassembly. */ -#define NSS_LAG0_INTERFACE_NUM (NSS_SPECIAL_IF_START + 30) - /**< Special interface number for LAG0. */ -#define NSS_LAG1_INTERFACE_NUM (NSS_SPECIAL_IF_START + 31) - /**< Special interface number for LAG1. */ -#define NSS_LAG2_INTERFACE_NUM (NSS_SPECIAL_IF_START + 32) - /**< Special interface number for LAG2. */ -#define NSS_LAG3_INTERFACE_NUM (NSS_SPECIAL_IF_START + 33) - /**< Special interface number for LAG3. */ -#define NSS_L2TPV2_INTERFACE (NSS_SPECIAL_IF_START + 34) - /**< Special interface number for L2TPv2 UDP encapsulation. */ -#define NSS_PPTP_INTERFACE (NSS_SPECIAL_IF_START + 36) - /**< Special interface number for PPTP-to-decapsulation. */ -#define NSS_PORTID_INTERFACE (NSS_SPECIAL_IF_START + 37) - /**< Special interface number for port ID. */ -#define NSS_OAM_INTERFACE (NSS_SPECIAL_IF_START + 38) - /**< Special interface number for OAM. */ -#define NSS_MAP_T_INTERFACE (NSS_SPECIAL_IF_START + 39) - /**< Special interface number for MAP-T. */ -#define NSS_PPE_INTERFACE (NSS_SPECIAL_IF_START + 40) - /**< Special interface number for PPE. */ -#define NSS_EDMA_INTERFACE (NSS_SPECIAL_IF_START + 41) - /**< Special interface number for EDMA. */ -#define NSS_GRE_TUNNEL_INTERFACE (NSS_SPECIAL_IF_START + 42) - /**< Special interface number for NSS GRE tunnel. */ -#define NSS_TRUSTSEC_TX_INTERFACE (NSS_SPECIAL_IF_START + 43) - /**< Special interface number for TrustSec Tx. */ -#define NSS_VAP_INTERFACE (NSS_SPECIAL_IF_START + 44) - /**< Special interface number for NSS Wi-Fi VAPs base interfaces. */ -#define NSS_VLAN_INTERFACE (NSS_SPECIAL_IF_START + 45) - /**< Special interface number for VLAN. */ -#define NSS_GRE_INTERFACE (NSS_SPECIAL_IF_START + 46) - /**< Special interface number for GRE. */ -#define NSS_WIFILI_INTERNAL_INTERFACE (NSS_SPECIAL_IF_START + 47) - /**< Special interface number for wifili internal instance. */ -#define NSS_PROJECT_INTERFACE (NSS_SPECIAL_IF_START + 48) - /**< Special interface number for project node. */ -#define NSS_PBUF_MGR_FREE_INTERFACE (NSS_SPECIAL_IF_START + 49) - /**< Special interface number for PBUF_MGR_FREE node. */ -#define NSS_REDIR_RX_INTERFACE (NSS_SPECIAL_IF_START + 50) - /**< Special interface number for 802.3 redirect node. */ -#define NSS_QRFS_INTERFACE (NSS_SPECIAL_IF_START + 51) - /**< Special interface number for QRFS. */ -#define NSS_GRE_REDIR_LAG_INTERFACE (NSS_SPECIAL_IF_START + 52) - /**< Special interface number for GRE redirect link aggregation interface. */ -#define NSS_UNALIGNED_INTERFACE (NSS_SPECIAL_IF_START + 53) - /**< Special interface number for unaligned handler. */ -#define NSS_TSTAMP_TX_INTERFACE (NSS_SPECIAL_IF_START + 54) - /**< Special interface number for timestamp transmit. */ -#define NSS_TSTAMP_RX_INTERFACE (NSS_SPECIAL_IF_START + 55) - /**< Special interface number for timestamp receive. */ -#define NSS_GRE_REDIR_MARK_INTERFACE (NSS_SPECIAL_IF_START + 56) - /**< Special interface number for GRE redirect mark. */ -#define NSS_VXLAN_INTERFACE (NSS_SPECIAL_IF_START + 57) - /**< Special interface number for VxLAN handler. */ -#define NSS_RMNET_RX_INTERFACE (NSS_SPECIAL_IF_START + 58) - /**< Special interface number for remote wireless wide area network receive handler. */ -#define NSS_WIFILI_EXTERNAL_INTERFACE0 (NSS_SPECIAL_IF_START + 59) - /**< Special interface number for first external radio instance. */ -#define NSS_WIFILI_EXTERNAL_INTERFACE1 (NSS_SPECIAL_IF_START + 60) - /**< Special interface number for second external radio instance. */ -#define NSS_TLS_INTERFACE (NSS_SPECIAL_IF_START + 61) - /**< Special interface number for TLS. */ -#define NSS_PPE_VP_INTERFACE (NSS_SPECIAL_IF_START + 62) - /**< Special interface number for the virtual port (62, 63, 64) interface. */ -#define NSS_WIFI_MAC_DB_INTERFACE (NSS_SPECIAL_IF_START + 65) - /**< Special interface number for the Wi-Fi MAC database. */ -#define NSS_DMA_INTERFACE (NSS_SPECIAL_IF_START + 66) - /**< Special interface number for the DMA interface. */ -#define NSS_WIFI_EXT_VDEV_INTERFACE (NSS_SPECIAL_IF_START + 67) - /**< Special interface number for the Wi-Fi extended virtual interface. */ -#define NSS_UDP_ST_INTERFACE (NSS_SPECIAL_IF_START + 68) - /**< Special interface number for the UDP speed test interface. */ - -#ifdef __KERNEL__ /* only kernel will use. */ - -/* - * General utilities - */ - -/** - * General callback function for all interface messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_if_rx_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_get_state - * Gets the NSS state. - * - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * NSS state. - */ -extern nss_state_t nss_get_state(void *nss_ctx); - -#endif /*__KERNEL__ */ - -/* - * Once Everything is arranged correctly, will be placed at top - */ - -/** - *@} - */ - -#endif /** __NSS_API_IF_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_bridge.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_bridge.h deleted file mode 100644 index 783696912..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_bridge.h +++ /dev/null @@ -1,362 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2018,2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_bridge.h - * NSS Bridge interface definitions. - */ - -#ifndef __NSS_BRIDGE_H -#define __NSS_BRIDGE_H - -/** - * @addtogroup nss_bridge_subsystem - * @{ - */ - -/** - * nss_bridge_msg_types - * Message types for the NSS bridge. - */ -enum nss_bridge_msg_types { - NSS_BRIDGE_MSG_JOIN = NSS_IF_MAX_MSG_TYPES + 1, - NSS_BRIDGE_MSG_LEAVE, - NSS_BRIDGE_MSG_SET_FDB_LEARN, - NSS_BRIDGE_MSG_TYPE_MAX, -}; - -/** - * nss_bridge_error_types - * Error types for the NSS bridge. - */ -enum nss_bridge_error_types { - NSS_BRIDGE_ERROR_UNKNOWN_MSG = NSS_IF_ERROR_TYPE_MAX + 1, - NSS_BRIDGE_ERROR_TYPE_MAX, -}; - -/** - * nss_bridge_fdb_learn_mode - * FDB learning mode for the NSS bridge. - */ -enum nss_bridge_fdb_learn_mode { - NSS_BRIDGE_FDB_LEARN_ENABLE, - NSS_BRIDGE_FDB_LEARN_DISABLE, - NSS_BRIDGE_FDB_LEARN_MODE_MAX, -}; - -/** - * nss_bridge_join_msg - * Information for joining the bridge. - */ -struct nss_bridge_join_msg { - uint32_t if_num; /**< NSS interface to add to a bridge. */ -}; - -/** - * nss_bridge_leave_msg - * Information for leaving the bridge. - */ -struct nss_bridge_leave_msg { - uint32_t if_num; /**< NSS interface to remove from a bridge. */ -}; - -/** - * nss_bridge_set_fdb_learn_msg - * Information for FDB learning status on bridge interface. - */ -struct nss_bridge_set_fdb_learn_msg { - uint32_t mode; /**< FDB learning mode of bridge interface. */ -}; - -/** - * nss_bridge_msg - * Data for sending and receiving bridge interface messages. - */ -struct nss_bridge_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a bridge interface message. - */ - union { - union nss_if_msgs if_msg; - /**< NSS interface base message. */ - struct nss_bridge_join_msg br_join; - /**< Join the bridge. */ - struct nss_bridge_leave_msg br_leave; - /**< Leave the bridge. */ - struct nss_bridge_set_fdb_learn_msg fdb_learn; - /**< FDB learning status of bridge. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_bridge_verify_if_num - * Verifies if the interface is type bridge. - * - * @param[in] if_num Interface number to be verified. - * - * @return - * True if if_num is of type bridge. - */ -bool nss_bridge_verify_if_num(uint32_t if_num); - -/** - * nss_bridge_tx_msg - * Sends bridge messages to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_bridge_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_bridge_msg *msg); - -/** - * nss_bridge_tx_msg_sync - * Sends bridge messages synchronously to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_bridge_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in,out] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_bridge_msg *msg); - -/** - * nss_bridge_msg_init - * Initializes a bridge message. - * - * @datatypes - * nss_bridge_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num Interface number - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -void nss_bridge_msg_init(struct nss_bridge_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_bridge_get_context - * Gets the bridge context used in nss_bridge_tx. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_bridge_get_context(void); - -/** - * Callback function for receiving bridge data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_bridge_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving bridge messages. - * - * @datatypes - * nss_bridge_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_bridge_msg_callback_t)(void *app_data, struct nss_bridge_msg *msg); - -/** - * nss_bridge_register - * Registers the bridge interface with the NSS for sending and receiving - * messages. - * - * @param[in] if_num NSS interface number. - * @param[in] netdev Pointer to the associated network device. - * @param[in] bridge_data_cb Callback for the bridge data. - * @param[in] bridge_msg_cb Callback for the bridge message. - * @param[in] features Data socket buffer types supported by this interface. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_bridge_register(uint32_t if_num, struct net_device *netdev, nss_bridge_callback_t bridge_data_cb, nss_bridge_msg_callback_t bridge_msg_cb, uint32_t features, void *app_data); - -/** - * nss_bridge_unregister - * Deregisters the bridge interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -void nss_bridge_unregister(uint32_t if_num); - -/** - * nss_bridge_notify_register - * Registers a notifier callback for bridge messages with the NSS. - * - * @datatypes - * nss_bridge_msg_callback_t - * - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_bridge_notify_register(nss_bridge_msg_callback_t cb, void *app_data); - -/** - * nss_bridge_notify_unregister - * Deregisters a bridge message notifier callback from the NSS. - * - * @return - * None. - */ -void nss_bridge_notify_unregister(void); - -/** - * nss_bridge_tx_set_mtu_msg - * Sends a message to the bridge to set the MTU. - * - * @param[in] bridge_if_num Interface number of the bridge. - * @param[in] mtu MTU value to set. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_set_mtu_msg(uint32_t bridge_if_num, uint32_t mtu); - -/** - * nss_bridge_tx_set_mac_addr_msg - * Sends a message to the bridge to set the MAC address. - * - * @param[in] bridge_if_num Interface number of the bridge. - * @param[in] addr Pointer to the MAC address. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_set_mac_addr_msg(uint32_t bridge_if_num, uint8_t *addr); - -/** - * nss_bridge_tx_join_msg - * Sends the bridge a message to join with a slave interface. - * - * @datatypes - * net_device - * - * @param[in] bridge_if_num Interface number of the bridge. - * @param[in] netdev Pointer to the associated network device (the - * slave interface). - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_join_msg(uint32_t bridge_if_num, struct net_device *netdev); - -/** - * nss_bridge_tx_leave_msg - * Sends the bridge a message that the slave interface is leaving the bridge. - * - * @datatypes - * net_device - * - * @param[in] bridge_if_num Interface number of the bridge. - * @param[in] netdev Pointer to the associated network device (the - * slave interface). - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_leave_msg(uint32_t bridge_if_num, struct net_device *netdev); - -/** - * nss_bridge_tx_vsi_assign_msg - * Sends the bridge a message to assign a VSI. - * - * @param[in] if_num Interface number of the bridge. - * @param[in] vsi VSI to assign. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_vsi_assign_msg(uint32_t if_num, uint32_t vsi); - -/** - * nss_bridge_tx_vsi_unassign_msg - * Sends the bridge a message to unassign a VSI. - * - * @param[in] if_num Interface number of the bridge. - * @param[in] vsi VSI to unassign. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_vsi_unassign_msg(uint32_t if_num, uint32_t vsi); - -/** - * nss_bridge_tx_set_fdb_learn_msg - * Sends a message to notify NSS about FDB learning enable/disable event. - * - * @datatypes - * nss_bridge_fdb_learn_mode - * - * @param[in] bridge_if_num Interface number of the bridge. - * @param[in] fdb_learn FDB learning disable/enable. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_bridge_tx_set_fdb_learn_msg(uint32_t bridge_if_num, enum nss_bridge_fdb_learn_mode fdb_learn); - -/** - * nss_bridge_init - * Initializes the bridge. - * - * @return - * None. - */ -void nss_bridge_init(void); - -/** - * @} - */ - -#endif /* __NSS_BRIDGE_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_c2c_rx.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_c2c_rx.h deleted file mode 100644 index 5605abd99..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_c2c_rx.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_c2c_rx.h - * NSS core-to-core reception interface definitions. - */ - -#ifndef __NSS_C2C_RX_H -#define __NSS_C2C_RX_H - -/** - * @addtogroup nss_c2c_rx_subsystem - * @{ - */ - -/** - * nss_c2c_rx_stats_types - * Core-to-core reception node statistics. - */ -enum nss_c2c_rx_stats_types { - NSS_C2C_RX_STATS_PBUF_SIMPLE = NSS_STATS_NODE_MAX, - /**< Number of received simple pbufs. */ - NSS_C2C_RX_STATS_PBUF_SG, /**< Number of scatter-gather pbufs received. */ - NSS_C2C_RX_STATS_PBUF_RETURNING, /**< Number of returning scatter-gather pbufs. */ - NSS_C2C_RX_STATS_INVAL_DEST, /**< Number of pbuf enqueue failures because of destination is invalid. */ - NSS_C2C_RX_STATS_MAX, /**< Maximum message type. */ -}; - -/** - * nss_c2c_rx_stats_notification - * Core-to-core reception statistics structure. - */ -struct nss_c2c_rx_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t stats[NSS_C2C_RX_STATS_MAX]; /**< Core-to-core reception statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ -/** - * nss_c2c_rx_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_c2c_rx_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_c2c_rx_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_c2c_rx_stats_unregister_notifier(struct notifier_block *nb); -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_C2C_RX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_c2c_tx.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_c2c_tx.h deleted file mode 100644 index a9ecc8ce0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_c2c_tx.h +++ /dev/null @@ -1,308 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_c2c_tx.h - * NSS core-to-core transmission interface definitions. - */ - -#ifndef __NSS_C2C_TX_H -#define __NSS_C2C_TX_H - -/** - * @addtogroup nss_c2c_tx_subsystem - * @{ - */ - -/** - * nss_c2c_tx_msg_type - * Supported message types. - */ -enum nss_c2c_tx_msg_type { - NSS_C2C_TX_MSG_TYPE_STATS, /**< Statistics synchronization. */ - NSS_C2C_TX_MSG_TYPE_TX_MAP, /**< Open engine synchronization. */ - NSS_C2C_TX_MSG_TYPE_PERFORMANCE_TEST, /**< Performance test. */ - NSS_C2C_TX_MSG_TYPE_MAX /**< Maximum message type. */ -}; - -/** - * nss_c2c_tx_msg_error - * Message error types. - */ -enum nss_c2c_tx_msg_error { - NSS_C2C_TX_MSG_ERROR_NONE, /**< No error. */ - NSS_C2C_TX_MSG_ERROR_INVAL_OP, /**< Invalid operation. */ - NSS_C2C_TX_MSG_ERROR_INVALID_TEST_ID, /**< Invalid test ID. */ - NSS_C2C_TX_MSG_ERROR_MAX /**< Maximum error type. */ -}; - -/** - * nss_c2c_tx_test_type - * Supported core-to core transmission tests. - */ -enum nss_c2c_tx_test_type { - NSS_C2C_TX_TEST_TYPE_SIMPLE = 1, - /**< Tests the performance of simple pbufs. */ - NSS_C2C_TX_TEST_TYPE_SG_CHAIN, - /**< Tests the performance of scatter-gather chain pbufs. */ - NSS_C2C_TX_TEST_TYPE_SG_REF, - /**< Tests the performance of scatter-gather pbuf that has references. */ - NSS_C2C_TX_TEST_TYPE_SG_REFED, - /**< Tests the performance of referenced pbuf. */ - NSS_C2C_TX_TEST_TYPE_MAX - /**< Maximum message type. */ -}; - -/** - * nss_c2c_tx_stats_types - * Core-to-core transmission node statistics. - */ -enum nss_c2c_tx_stats_types { - NSS_C2C_TX_STATS_PBUF_SIMPLE = NSS_STATS_NODE_MAX, - /**< Number of received simple pbuf. */ - NSS_C2C_TX_STATS_PBUF_SG, /**< Number of scatter-gather pbuf received. */ - NSS_C2C_TX_STATS_PBUF_RETURNING, /**< Number of returning scatter-gather pbuf. */ - NSS_C2C_TX_STATS_MAX, /**< Maximum message type. */ -}; - -/** - * nss_c2c_tx_stats_notification - * Core-to-core transmission statistics structure. - */ -struct nss_c2c_tx_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t stats[NSS_C2C_TX_STATS_MAX]; /**< Core-to-core transmission statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ -/** - * nss_c2c_tx_map - * Core-to-core transmission queue address and interrupt address. - */ -struct nss_c2c_tx_map { - uint32_t tx_map; /**< Peer core core-to-core receiver queue start address. */ - uint32_t c2c_intr_addr; /**< Peer core core-to-core interrupt register address. */ -}; - -/** - * nss_c2c_tx_stats - * The NSS core-to-core transmission node statistics structure. - */ -struct nss_c2c_tx_stats { - struct nss_cmn_node_stats node_stats; - /**< Common node statistics for core-to-core transmissions. */ - uint32_t pbuf_simple; /**< Number of received simple pbuf. */ - uint32_t pbuf_sg; /**< Number of scattered/gathered pbuf received. */ - uint32_t pbuf_returning; /**< Number of returning scattered/gathered pbuf. */ -}; - -/** - * nss_c2c_tx_test - * Start performance test for the given test ID. - */ -struct nss_c2c_tx_test { - uint32_t test_id; /**< ID of the core-to-core communication test. */ -}; - -/** - * nss_c2c_tx_msg - * Message structure to send/receive core-to-core transmission commands. - */ -struct nss_c2c_tx_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a NSS core-to-core transmission rule or statistics message. - */ - union { - struct nss_c2c_tx_map map; /**< Core-to-core transmissions memory map. */ - struct nss_c2c_tx_stats stats; /**< Core-to-core transmissions statistics. */ - struct nss_c2c_tx_test test; /**< Core-to-core performance test. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_c2c_tx_register_handler - * Registers the core-to-core transmissions message handler. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * None. - */ -void nss_c2c_tx_register_handler(struct nss_ctx_instance *nss_ctx); - -/** - * Callback function for receiving core-to-core transmissions messages. - * - * @datatypes - * nss_c2c_tx_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_c2c_tx_msg_callback_t)(void *app_data, struct nss_c2c_tx_msg *msg); - -/** - * nss_c2c_tx_tx_msg - * Transmits a core-to-core transmissions message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_c2c_tx_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] nctm Pointer to the message data. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_c2c_tx_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_c2c_tx_msg *nctm); - -/** - * nss_c2c_tx_msg_init - * Initializes core-to-core transmissions messages. - * - * @datatypes - * nss_c2c_tx_msg \n - * nss_c2c_tx_msg_callback_t - * - * @param[in] nct Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_c2c_tx_msg_init(struct nss_c2c_tx_msg *nct, uint16_t if_num, uint32_t type, uint32_t len, - nss_c2c_tx_msg_callback_t cb, void *app_data); - -/** - * nss_c2c_tx_notify_register - * Registers a notifier callback for core-to-core transmission messages with the NSS. - * - * @datatypes - * nss_c2c_tx_msg_callback_t - * - * @param[in] core NSS core number index to the notifier callback table. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_c2c_tx_notify_register(int core, nss_c2c_tx_msg_callback_t cb, void *app_data); - -/** - * nss_c2c_tx_notify_unregister - * Deregisters a core-to-core transmission message notifier callback from the NSS. - * - * @param[in] core NSS core number index to the notifier callback table. - * - * @return - * None. - * - * @dependencies - * The notifier callback must have been previously registered. - */ -void nss_c2c_tx_notify_unregister(int core); - -/** - * nss_c2c_tx_msg_cfg_map - * Sends core-to-core transmissions map to NSS - * - * @datatypes - * nss_ctx_instance \n - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] tx_map Peer core core-to-core receiver queue start address. - * @param[in] c2c_addr Peer core core-to-core interrupt register address. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_c2c_tx_msg_cfg_map(struct nss_ctx_instance *nss_ctx, uint32_t tx_map, uint32_t c2c_addr); - -/** - * nss_c2c_tx_register_sysctl - * Registers the core-to-core transmission sysctl entries to the sysctl tree. - * - * @return - * None. - */ -extern void nss_c2c_tx_register_sysctl(void); - -/** - * nss_c2c_tx_unregister_sysctl - * Deregisters the core-to-core transmission sysctl entries from the sysctl tree. - * - * @return - * None. - * - * @dependencies - * The system control must have been previously registered. - */ -extern void nss_c2c_tx_unregister_sysctl(void); - -/** - * nss_c2c_tx_init - * Initializes the core-to-core transmission. - * - * @return - * None. - */ -void nss_c2c_tx_init(void); - -/** - * nss_c2c_tx_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_c2c_tx_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_c2c_tx_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_c2c_tx_stats_unregister_notifier(struct notifier_block *nb); -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_C2C_TX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_capwap.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_capwap.h deleted file mode 100644 index 525fff524..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_capwap.h +++ /dev/null @@ -1,659 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * @file nss_capwap.h - * NSS CAPWAP interface definitions. - */ - -#ifndef __NSS_CAPWAP_H -#define __NSS_CAPWAP_H - -/** - * @addtogroup nss_capwap_subsystem - * @{ - */ - -/** - * Size of the headroom required for CAPWAP packets. - */ -#define NSS_CAPWAP_HEADROOM 256 - -/** - * nss_capwap_stats_encap_types - * CAPWAP encapsulation statistics. - */ -enum nss_capwap_stats_encap_types { - NSS_CAPWAP_STATS_ENCAP_TX_PKTS, - NSS_CAPWAP_STATS_ENCAP_TX_BYTES, - NSS_CAPWAP_STATS_ENCAP_TX_SEGMENTS, - NSS_CAPWAP_STATS_ENCAP_TX_DROP_SG_REF, - NSS_CAPWAP_STATS_ENCAP_TX_DROP_VER_MISMATCH, - NSS_CAPWAP_STATS_ENCAP_TX_DROP_UNALIGN, - NSS_CAPWAP_STATS_ENCAP_TX_DROP_HEADER_ROOM, - NSS_CAPWAP_STATS_ENCAP_TX_DROP_DTLS, - NSS_CAPWAP_STATS_ENCAP_TX_DROP_NWIRELESS, - NSS_CAPWAP_STATS_ENCAP_TX_DROP_QUEUE_FULL, - NSS_CAPWAP_STATS_ENCAP_TX_DROP_MEM_FAIL, - NSS_CAPWAP_STATS_ENCAP_FAST_MEM, - NSS_CAPWAP_STATS_ENCAP_MAX -}; - -/** - * nss_capwap_stats_decap_types - * CAPWAP decapsulation statistics. - */ -enum nss_capwap_stats_decap_types { - NSS_CAPWAP_STATS_DECAP_RX_PKTS, - NSS_CAPWAP_STATS_DECAP_RX_BYTES, - NSS_CAPWAP_STATS_DECAP_RX_DTLS_PKTS, - NSS_CAPWAP_STATS_DECAP_RX_SEGMENTS, - NSS_CAPWAP_STATS_DECAP_RX_DROP, - NSS_CAPWAP_STATS_DECAP_RX_DROP_OVERSIZE, - NSS_CAPWAP_STATS_DECAP_RX_DROP_FRAG_TIMEOUT, - NSS_CAPWAP_STATS_DECAP_RX_DROP_DUP_FRAG, - NSS_CAPWAP_STATS_DECAP_RX_DROP_FRAG_GAP, - NSS_CAPWAP_STATS_DECAP_RX_DROP_QUEUE_FULL, - NSS_CAPWAP_STATS_DECAP_RX_DROP_N2H_QUEUE_FULL, - NSS_CAPWAP_STATS_DECAP_RX_DROP_MEM_FAIL, - NSS_CAPWAP_STATS_DECAP_RX_DROP_CHECKSUM, - NSS_CAPWAP_STATS_DECAP_RX_MALFORMED, - NSS_CAPWAP_STATS_DECAP_FAST_MEM, - NSS_CAPWAP_STATS_DECAP_MAX -}; - -/** - * nss_capwap_msg_type - * CAPWAP message types. - */ -typedef enum nss_capwap_msg_type { - NSS_CAPWAP_MSG_TYPE_NONE, - NSS_CAPWAP_MSG_TYPE_CFG_RULE, - NSS_CAPWAP_MSG_TYPE_UNCFG_RULE, - NSS_CAPWAP_MSG_TYPE_ENABLE_TUNNEL, - NSS_CAPWAP_MSG_TYPE_DISABLE_TUNNEL, - NSS_CAPWAP_MSG_TYPE_UPDATE_PATH_MTU, - NSS_CAPWAP_MSG_TYPE_SYNC_STATS, - NSS_CAPWAP_MSG_TYPE_VERSION, /**< Default is version 1. */ - NSS_CAPWAP_MSG_TYPE_DTLS, - NSS_CAPWAP_MSG_TYPE_FLOW_RULE_ADD, - NSS_CAPWAP_MSG_TYPE_FLOW_RULE_DEL, - NSS_CAPWAP_MSG_TYPE_MAX, -} nss_capwap_msg_type_t; - -/** - * nss_capwap_msg_response - * Error types for CAPWAP responses to messages from the host. - */ -typedef enum nss_capwap_msg_response { - NSS_CAPWAP_ERROR_MSG_INVALID_REASSEMBLY_TIMEOUT, - NSS_CAPWAP_ERROR_MSG_INVALID_PATH_MTU, - NSS_CAPWAP_ERROR_MSG_INVALID_MAX_FRAGMENT, - NSS_CAPWAP_ERROR_MSG_INVALID_BUFFER_SIZE, - NSS_CAPWAP_ERROR_MSG_INVALID_L3_PROTO, - NSS_CAPWAP_ERROR_MSG_INVALID_UDP_PROTO, - NSS_CAPWAP_ERROR_MSG_INVALID_VERSION, - NSS_CAPWAP_ERROR_MSG_TUNNEL_DISABLED, - NSS_CAPWAP_ERROR_MSG_TUNNEL_ENABLED, - NSS_CAPWAP_ERROR_MSG_TUNNEL_NOT_CFG, - NSS_CAPWAP_ERROR_MSG_INVALID_IP_NODE, - NSS_CAPWAP_ERROR_MSG_INVALID_TYPE_FLAG, - NSS_CAPWAP_ERROR_MSG_INVALID_DTLS_CFG, - NSS_CAPWAP_ERROR_MSG_FLOW_TABLE_FULL, - NSS_CAPWAP_ERROR_MSG_FLOW_EXIST, - NSS_CAPWAP_ERROR_MSG_FLOW_NOT_EXIST, - NSS_CAPWAP_ERROR_MSG_MAX, -} nss_capwap_msg_response_t; - -/** - * nss_capwap_stats_msg - * Per-tunnel statistics messages from the NSS firmware. - */ -struct nss_capwap_stats_msg { - struct nss_cmn_node_stats pnode_stats; /**< Common firmware statistics. */ - uint32_t dtls_pkts; /**< Number of DTLS packets flowing through. */ - - /* - * Rx/decap stats - */ - uint32_t rx_dup_frag; /**< Number of duplicate fragments. */ - uint32_t rx_segments; /**< Number of segments or fragments. */ - - /** - * Packets dropped because they are larger than the payload size. - */ - uint32_t rx_oversize_drops; - - uint32_t rx_frag_timeout_drops; - /**< Packets dropped because of a reassembly timeout. */ - uint32_t rx_n2h_drops; - /**< Packets dropped because of error in packet processing. */ - uint32_t rx_n2h_queue_full_drops; - /**< Packets dropped because the NSS-to-host queue is full. */ - uint32_t rx_csum_drops; - /**< Packets dropped because of a checksum mismatch. */ - uint32_t rx_malformed; - /**< Packets dropped because of a malformed packet. */ - uint32_t rx_mem_failure_drops; - /**< Packets dropped because of a memory failure. */ - uint32_t rx_frag_gap_drops; - /**< Packets dropped because of a non-sequential fragment offset. */ - - /* - * Tx/encap stats - */ - uint32_t tx_segments; /**< Number of segments or fragments. */ - uint32_t tx_queue_full_drops; /**< Packets dropped because of a full queue. */ - uint32_t tx_mem_failure_drops; - /**< Packets dropped because of a memory failure. */ - uint32_t tx_dropped_sg_ref; - /**< Packets dropped because of a scatter-gather reference. */ - uint32_t tx_dropped_ver_mis; - /**< Packets dropped because of a version mismatch. */ - uint32_t Reserved; - /**< Reserved. */ - uint32_t tx_dropped_hroom; - /**< Packets dropped because of insufficent headroom. */ - uint32_t tx_dropped_dtls; - /**< Packets dropped because of a DTLS packet. */ - uint32_t tx_dropped_nwireless; - /**< Packets dropped because the nwireless field information is wrong. */ - - uint32_t fast_mem; - /**< Set to 1 when tunnel is operating in fast memory. */ -}; - -/** - * nss_capwap_ip - * IP versions. - */ -struct nss_capwap_ip { - /** - * Union of IPv4 and IPv6 IP addresses. - */ - union { - uint32_t ipv4; /**< IPv4 address. */ - uint32_t ipv6[4]; /**< IPv6 address. */ - } ip; /**< Union of IPv4 and IPv6 IP addresses. */ -}; - -/** - * nss_capwap_encap_rule - * Encapsulation information for a CAPWAP tunnel. - */ -struct nss_capwap_encap_rule { - struct nss_capwap_ip src_ip; /**< Source IP. */ - uint32_t src_port; /**< Source port. */ - struct nss_capwap_ip dest_ip; /**< Destination IP. */ - uint32_t dest_port; /**< Destination port. */ - uint32_t path_mtu; /**< MTU on the path. */ -}; - -/** - * nss_capwap_decap_rule - * Decapsulation information for a CAPWAP tunnel. - */ -struct nss_capwap_decap_rule { - uint32_t reassembly_timeout; /**< Timeout in milliseconds. */ - uint32_t max_fragments; /**< Maximum number of fragments expected. */ - uint32_t max_buffer_size; /**< Maximum size of the payload buffer. */ -}; - -/** - * nss_capwap_rule_msg - * CAPWAP rule message. - * - * The same rule structure applies for both encapsulation and decapsulation - * in a tunnel. - */ -struct nss_capwap_rule_msg { - struct nss_capwap_encap_rule encap; /**< Encapsulation portion of the rule. */ - struct nss_capwap_decap_rule decap; /**< Decapsulation portion of the rule. */ - uint32_t stats_timer; /**< Statistics interval timer in milliseconds. */ - - /** - * Core to choose for receiving packets. - * - * Set to -1 for the NSS firmware to decide. - */ - int8_t rps; - - uint8_t type_flags; /**< VLAN or PPPOE is configured. */ - uint8_t l3_proto; - /**< Prototype is NSS_CAPWAP_TUNNEL_IPV4 or NSS_CAPWAP_TUNNEL_IPV6. */ - uint8_t which_udp; /**< Tunnel uses the UDP or UDPLite protocol. */ - uint32_t mtu_adjust; /**< MTU is reserved for a DTLS process. */ - uint32_t gmac_ifnum; /**< Outgoing physical interface. */ - uint32_t enabled_features; - /**< Tunnel enabled features bit flag. */ - - /* - * Parameters for each features - */ - uint32_t dtls_inner_if_num; /**< Interface number of the associated DTLS node. */ - uint8_t bssid[ETH_ALEN]; /**< BSSID value. */ - uint16_t outer_sgt_value; - /**< Security Group Tag value configured for this tunnel. */ -}; - -/** - * nss_capwap_version_msg - * Message to set the CAPWAP version. - */ -struct nss_capwap_version_msg { - uint32_t version; /**< CAPWAP protocol version. */ -}; - -/** - * nss_capwap_path_mtu_msg - * Message information for the path MTU. - */ -struct nss_capwap_path_mtu_msg { - uint32_t path_mtu; /**< Path MTU value between the controller and access point. */ -}; - -/** - * nss_capwap_dtls_msg - * DTLS message information. - */ -struct nss_capwap_dtls_msg { - uint32_t enable; /**< Enable or disable DTLS. */ - uint32_t dtls_inner_if_num; /**< Interface number of the associated DTLS. */ - uint32_t mtu_adjust; /**< MTU adjustment reported by the DTLS node. */ - uint32_t reserved; /**< Reserved field for future use. */ -}; - -/** - * nss_capwap_flow_rule_msg - * CAPWAP flow rule message structure. - */ -struct nss_capwap_flow_rule_msg { - /* - * 5-tuple info. - */ - uint16_t ip_version; /**< IP version. */ - uint16_t protocol; /**< Layer 4 protocol. */ - uint16_t src_port; /**< Source port. */ - uint16_t dst_port; /**< Destination port. */ - uint32_t src_ip[4]; /**< Source IP address. */ - uint32_t dst_ip[4]; /**< Destination IP address. */ - - /* - * Flow attributes. - */ - uint32_t flow_id; /**< Flow identification. */ -}; - -/** - * nss_capwap_enable_tunnel_msg - * Structure to update sibling interface number. - */ -struct nss_capwap_enable_tunnel_msg { - uint32_t sibling_if_num; /**< Sibling interface Number. */ -}; - -/** - * nss_capwap_msg - * Data for sending and receiving CAPWAP messages. - */ -struct nss_capwap_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a CAPWAP common message. - */ - union { - struct nss_capwap_rule_msg rule; - /**< Rule information. */ - struct nss_capwap_path_mtu_msg mtu; - /**< New MTU information. */ - struct nss_capwap_stats_msg stats; - /**< CAPWAP statistics. */ - struct nss_capwap_version_msg version; - /**< CAPWAP version to use. */ - struct nss_capwap_dtls_msg dtls; - /**< DTLS configuration. */ - struct nss_capwap_flow_rule_msg flow_rule_add; - /**< Flow rule add message. */ - struct nss_capwap_flow_rule_msg flow_rule_del; - /**< Flow rule delete message. */ - struct nss_capwap_enable_tunnel_msg enable_tunnel; - /**< Enable tunnel message. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_capwap_pn_stats - * Pnode statistics (64-bit version). - */ -struct nss_capwap_pn_stats { - uint64_t rx_packets; /**< Number of packets received. */ - uint64_t rx_bytes; /**< Number of bytes received. */ - uint64_t rx_dropped; /**< Number of dropped Rx packets. */ - uint64_t tx_packets; /**< Number of packets transmitted. */ - uint64_t tx_bytes; /**< Number of bytes transmitted. */ -}; - -/** - * nss_capwap_tunnel_stats - * Per-tunnel statistics seen by the HLOS. - */ -struct nss_capwap_tunnel_stats { - struct nss_capwap_pn_stats pnode_stats; /**< Common firmware statistics. */ - uint64_t dtls_pkts; /**< Number of DTLS packets flowing through. */ - - /* - * Rx/decap stats - */ - uint64_t rx_dup_frag; /**< Number of duplicate fragments. */ - uint64_t rx_segments; /**< Number of segments or fragments. */ - - /** - * Packets dropped because they are larger than the payload size. - */ - uint64_t rx_oversize_drops; - - uint64_t rx_frag_timeout_drops; - /**< Packets dropped because of a reassembly timeout. */ - uint64_t rx_n2h_drops; - /**< Packets dropped because of error in processing the packet. */ - uint64_t rx_n2h_queue_full_drops; - /**< Packets dropped because the NSS-to-host queue is full. */ - uint64_t rx_csum_drops; - /**< Packets dropped because of a checksum mismatch. */ - uint64_t rx_malformed; - /**< Packets dropped because of a malformed packet. */ - uint64_t rx_mem_failure_drops; - /**< Packets dropped because of a memory failure. */ - uint64_t rx_frag_gap_drops; - /**< Packets dropped because of a non-sequential fragment offset. */ - - /* - * Tx/encap stats - */ - uint64_t tx_dropped_inner; /**id + 1) << NSS_CORE_ID_SHIFT)) - -/** - * Macro to obtain a core local interface number. - */ -#define NSS_INTERFACE_NUM_GET(interface) ((interface) & 0xffffff) - -/** - * Macro to obtain an interface core number. - */ -#define NSS_INTERFACE_NUM_GET_COREID(interface) ((interface >> NSS_CORE_ID_SHIFT) & 0xff) - -/* - * Common enumerations. - */ - -/** - * nss_tx_status_t - * Tx command failure results. - * - * Types starting with NSS_TX_FAILURE_SYNC_ are only used by synchronous messages. - */ -typedef enum { - NSS_TX_SUCCESS = 0, - NSS_TX_FAILURE, - NSS_TX_FAILURE_QUEUE, - NSS_TX_FAILURE_NOT_READY, - NSS_TX_FAILURE_TOO_LARGE, - NSS_TX_FAILURE_TOO_SHORT, - NSS_TX_FAILURE_NOT_SUPPORTED, - NSS_TX_FAILURE_BAD_PARAM, - NSS_TX_FAILURE_NOT_ENABLED, - NSS_TX_FAILURE_SYNC_BAD_PARAM, - NSS_TX_FAILURE_SYNC_TIMEOUT, - NSS_TX_FAILURE_SYNC_FW_ERR, - NSS_TX_FAILURE_MAX, -} nss_tx_status_t; - -/** - * nss_state_t - * Initialization states. - */ -typedef enum { - NSS_STATE_UNINITIALIZED = 0, - NSS_STATE_INITIALIZED -} nss_state_t; - -/** - * nss_core_id_t - * NSS core IDs. - */ -typedef enum { - NSS_CORE_0 = 0, - NSS_CORE_1, - NSS_CORE_MAX -} nss_core_id_t; - -/** - * nss_cb_register_status_t - * Callback registration states. - */ -typedef enum { - NSS_CB_REGISTER_SUCCESS = 0, - NSS_CB_REGISTER_FAILED, -} nss_cb_register_status_t; - -/** - * nss_cb_unregister_status_t - * Callback deregistration states. - */ -typedef enum { - NSS_CB_UNREGISTER_SUCCESS = 0, - NSS_CB_UNREGISTER_FAILED, -} nss_cb_unregister_status_t; - -/** - * nss_cmn_response - * Responses for a common message. - */ -enum nss_cmn_response { - NSS_CMN_RESPONSE_ACK, - NSS_CMN_RESPONSE_EVERSION, - NSS_CMN_RESPONSE_EINTERFACE, - NSS_CMN_RESPONSE_ELENGTH, - NSS_CMN_RESPONSE_EMSG, - NSS_CMN_RESPONSE_NOTIFY, - NSS_CMN_RESPONSE_LAST -}; - -/** - * Array of log messages for common NSS responses. - */ -extern int8_t *nss_cmn_response_str[NSS_CMN_RESPONSE_LAST]; - -/** - * nss_cmn_msg - * Common message information. - */ -struct nss_cmn_msg { - uint16_t version; /**< Version ID for the main message format. */ - uint16_t len; /**< Length of the message, excluding the header. */ - uint32_t interface; /**< Primary key for all messages. */ - enum nss_cmn_response response; - /**< Primary response. All messages must specify one of these responses. */ - - uint32_t type; /**< Decentralized request number used to match response numbers. */ - uint32_t error; /**< Decentralized specific error message (response == EMSG). */ - - /** - * Padding used to start the callback from a 64-bit boundary. This field can be reused. - */ - uint32_t reserved; - - nss_ptr_t cb; /**< Contains the callback pointer. */ -#ifndef __LP64__ - uint32_t padding1; /**< Padding used to fit 64 bits. Do not reuse. */ -#endif - nss_ptr_t app_data; /**< Contains the application data. */ -#ifndef __LP64__ - uint32_t padding2; /**< Padding used to fit 64 bits. Do not reuse. */ -#endif -}; - -/** - * nss_cmn_node_stats - * Common per-node statistics. - */ -struct nss_cmn_node_stats { - uint32_t rx_packets; /**< Number of packets received. */ - uint32_t rx_bytes; /**< Number of bytes received. */ - uint32_t tx_packets; /**< Number of packets transmitted. */ - uint32_t tx_bytes; /**< Number of bytes transmitted. */ - uint32_t rx_dropped[NSS_MAX_NUM_PRI]; /**< Packets dropped on receive due to queue full. */ -}; - -/** - * nss_cmn_get_msg_len - * Gets the message length of a host-to-NSS message. - * - * @datatypes - * nss_cmn_get_msg_len - * - * @param[in] ncm Pointer to the common message. - * - * @return - * Length of the message specified in the argument to this function. - */ -static inline uint32_t nss_cmn_get_msg_len(struct nss_cmn_msg *ncm) -{ - return ncm->len + sizeof(struct nss_cmn_msg); -} - -#ifdef __KERNEL__ /* only for kernel to use. */ - -/** - * nss_cmn_msg_init - * Initializes the common area of an asynchronous host-to-NSS message. - * - * @datatypes - * nss_cmn_msg - * - * @param[in,out] ncm Pointer to the common message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the callback function. - * @param[in] app_data Pointer to the application context for this message. - * - * @return - * None. - */ -extern void nss_cmn_msg_init(struct nss_cmn_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len, - void *cb, void *app_data); - -/** - * nss_cmn_msg_sync_init - * Initializes the common message of a synchronous host-to-NSS message. - * - * @datatypes - * nss_cmn_msg - * - * @param[in,out] ncm Pointer to the common message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * - * @return - * None. - */ -extern void nss_cmn_msg_sync_init(struct nss_cmn_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len); - -/** - * nss_cmn_get_interface_number - * Gets the interface number. - * - * @datatypes - * nss_ctx_instance \n - * net_device - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] dev Pointer to the OS network device pointer. - * - * @return - * Interface number. - */ -extern int32_t nss_cmn_get_interface_number(struct nss_ctx_instance *nss_ctx, struct net_device *dev); - -/** - * nss_cmn_get_interface_number_by_dev - * Gets the interface number of a device. - * - * @datatypes - * net_device - * - * @param[in] dev Pointer to the OS network device pointer. - * - * @return - * Interface number, or -1 on failure. - */ -extern int32_t nss_cmn_get_interface_number_by_dev(struct net_device *dev); - -/** - * nss_cmn_get_interface_number_by_dev_and_type - * Gets the interface number by a device and its type. - * - * @datatypes - * net_device - * - * @param[in] dev Pointer to the OS network device pointer. - * @param[in] type Type of this interface. - * - * @return - * Interface number, or -1 on failure. - */ -extern int32_t nss_cmn_get_interface_number_by_dev_and_type(struct net_device *dev, uint32_t type); - -/** - * nss_cmn_interface_is_redirect - * Determines if the interface number is a redirect interface. - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] interface_num NSS interface number. - * - * @return - * TRUE if the number is a redirect interface. Otherwise FALSE. - */ -extern bool nss_cmn_interface_is_redirect(struct nss_ctx_instance *nss_ctx, int32_t interface_num); - -/** - * nss_cmn_append_core_id - * Append core ID on NSS interface number. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * - * @return - * Interface number with core ID. - */ -extern int nss_cmn_append_core_id(struct nss_ctx_instance *nss_ctx, int if_num); - -/** - * nss_cmn_get_interface_dev - * Gets an interface device pointer. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * - * @return - * Interface device pointer. - */ -extern struct net_device *nss_cmn_get_interface_dev(struct nss_ctx_instance *nss_ctx, uint32_t if_num); - -/** - * nss_cmn_get_state - * Obtains the NSS state. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * NSS state that indicates whether the NSS core is initialized. For possible values, see nss_state_t. - */ -extern nss_state_t nss_cmn_get_state(struct nss_ctx_instance *nss_ctx); - -/** - * Callback function for queue decongestion messages. - * - * @param[in] app_data Pointer to the application context for this message. - */ -typedef void (*nss_cmn_queue_decongestion_callback_t)(void *app_data); - -/** - * nss_cmn_register_queue_decongestion - * Registers a queue for a decongestion event. - * - * The callback function is called with the spinlock held. The function should avoid deadlocks - * caused by attempting to acquire multiple spinlocks. - - * @datatypes - * nss_ctx_instance \n - * nss_cmn_queue_decongestion_callback_t - * - * @param[in,out] nss_ctx Pointer to the NSS context. - * @param[in] event_callback Callback for the message. - * @param[in] app_data Pointer to the application context to be returned in the - * callback. - * - * @return - * #NSS_CB_REGISTER_SUCCESS if registration is successful. - * @par - * Otherwise, #NSS_CB_REGISTER_FAILED. - */ -extern nss_cb_register_status_t nss_cmn_register_queue_decongestion(struct nss_ctx_instance *nss_ctx, nss_cmn_queue_decongestion_callback_t event_callback, void *app_data); - -/** - * nss_cmn_unregister_queue_decongestion - * Deregisters a queue from receiving a decongestion event. - * - * @datatypes - * nss_ctx_instance \n - * nss_cmn_queue_decongestion_callback_t - * - * @param[in,out] nss_ctx Pointer to the NSS context. - * @param[in] event_callback Callback for the message. - * - * @return - * #NSS_CB_REGISTER_SUCCESS if registration is successful. - * @par - * Otherwise, #NSS_CB_REGISTER_FAILED. - * - * @dependencies - * The callback function must have been previously registered. - */ -extern nss_cb_unregister_status_t nss_cmn_unregister_queue_decongestion(struct nss_ctx_instance *nss_ctx, nss_cmn_queue_decongestion_callback_t event_callback); - -/** - * Callback function for packets with service code. - * - * @param[in] app_data Pointer to the application context for this message. - * @param[in] nbuf Pointer to the socket buffer. - */ -typedef void (*nss_cmn_service_code_callback_t)(void *app_data, struct sk_buff *nbuf); - -/** - * nss_cmn_register_service_code - * Registers a callback for a service code. - * - * @datatypes - * nss_ctx_instance \n - * nss_cmn_service_code_callback_t - * - * @param[in,out] nss_ctx Pointer to the NSS context. - * @param[in] cb Callback for the message. - * @param[in] service_code Service code found attached to the packet. - * @param[in] app_data Pointer to the application context to be returned in the - * callback. - * - * @return - * #NSS_CB_REGISTER_SUCCESS if registration is successful. - * @par - * Otherwise, #NSS_CB_REGISTER_FAILED. - */ -extern nss_cb_register_status_t nss_cmn_register_service_code(struct nss_ctx_instance *nss_ctx, nss_cmn_service_code_callback_t cb, uint8_t service_code, void *app_data); - -/** - * nss_cmn_unregister_service_code - * Deregisters a callback for the given service code. - * - * @datatypes - * nss_ctx_instance \n - * nss_cmn_service_code_callback_t - * - * @param[in,out] nss_ctx Pointer to the NSS context. - * @param[in] cb Callback for the message. - * @param[in] service_code Service code found attached to the packet. - * - * @return - * #NSS_CB_REGISTER_SUCCESS if registration is successful. - * @par - * Otherwise, #NSS_CB_REGISTER_FAILED. - * - * @dependencies - * The callback function must have been previously registered. - */ -extern nss_cb_unregister_status_t nss_cmn_unregister_service_code(struct nss_ctx_instance *nss_ctx, nss_cmn_service_code_callback_t cb, uint8_t service_code); - -/** - * nss_cmn_get_nss_enabled - * Checks whether the NSS mode is supported on the platform. - * - * @return - * TRUE if NSS is supported. \n - * Otherwise, FALSE. - */ -extern bool nss_cmn_get_nss_enabled(void); - -/** - * nss_cmn_rx_dropped_sum - * Sums dropped packet count of all NSS pnode queues. - * - * @datatypes - * nss_cmn_node_stats \n - * - * @param[in] node_stats Pointer to node statistics. - * - * @return - * Total dropped packets count. - */ -extern uint32_t nss_cmn_rx_dropped_sum(struct nss_cmn_node_stats *node_stats); - -#endif /* __KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_CMN_MSG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_crypto.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_crypto.h deleted file mode 100644 index 5ef514d6e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_crypto.h +++ /dev/null @@ -1,392 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_crypto.h - * NSS Crypto interface definitions. - */ - -#ifndef __NSS_CRYPTO_H -#define __NSS_CRYPTO_H - -/** - * @addtogroup nss_crypto_subsystem - * @{ - */ - -#define NSS_CRYPTO_MAX_IDXS 64 /**< Maximum number of supported sessions. */ -#define NSS_CRYPTO_MAX_ENGINES 4 /**< Maximum number of engines available. */ -#define NSS_CRYPTO_BAM_PP 2 /**< Bus Access Manager pipe pairs. */ - -/** - * nss_crypto_hash - * Hash sizes supported by the hardware. - */ -enum nss_crypto_hash { - NSS_CRYPTO_HASH_SHA96 = 12, - NSS_CRYPTO_HASH_SHA128 = 16, - NSS_CRYPTO_HASH_SHA160 = 20, - NSS_CRYPTO_HASH_SHA256 = 32 -}; - -/** - * nss_crypto_cipher - * Cipher algorithms. - */ -enum nss_crypto_cipher { - NSS_CRYPTO_CIPHER_NONE = 0, - NSS_CRYPTO_CIPHER_AES_CBC, /**< AES, and CBC for 128-bit and 256-bit key sizes. */ - NSS_CRYPTO_CIPHER_DES, /**< DES, and CBC for 64-bit key size. */ - NSS_CRYPTO_CIPHER_NULL, /**< NULL and CBC. */ - NSS_CRYPTO_CIPHER_AES_CTR, /**< AES, and CTR for 128-bit and 256-bit key sizes. */ - NSS_CRYPTO_CIPHER_MAX -}; - -/** - * nss_crypto_auth - * Authentication algorithms. - */ -enum nss_crypto_auth { - NSS_CRYPTO_AUTH_NONE = 0, - NSS_CRYPTO_AUTH_SHA1_HMAC, - NSS_CRYPTO_AUTH_SHA256_HMAC, - NSS_CRYPTO_AUTH_NULL, - NSS_CRYPTO_AUTH_MAX -}; - -/** - * nss_crypto_msg_type - * Synchronization types. - */ -enum nss_crypto_msg_type { - NSS_CRYPTO_MSG_TYPE_NONE = 0, - NSS_CRYPTO_MSG_TYPE_OPEN_ENG = 1, - NSS_CRYPTO_MSG_TYPE_CLOSE_ENG = 2, - NSS_CRYPTO_MSG_TYPE_UPDATE_SESSION = 3, - NSS_CRYPTO_MSG_TYPE_STATS = 4, - NSS_CRYPTO_MSG_TYPE_MAX -}; - -/** - * nss_crypto_msg_error - * Response types. - */ -enum nss_crypto_msg_error { - NSS_CRYPTO_MSG_ERROR_NONE = 0, - NSS_CRYPTO_MSG_ERROR_INVAL_ENG = 1, - NSS_CRYPTO_MSG_ERROR_UNSUPP_OP = 2, - NSS_CRYPTO_MSG_ERROR_INVAL_OP = 3, - NSS_CRYPTO_MSG_ERROR_INVAL_IDX_RANGE = 4, - NSS_CRYPTO_MSG_ERROR_IDX_ALLOC_FAIL = 5, - NSS_CRYPTO_MSG_ERROR_MAX -}; - -/** - * nss_crypto_session_state - * Session states. - */ -enum nss_crypto_session_state { - NSS_CRYPTO_SESSION_STATE_NONE = 0, - NSS_CRYPTO_SESSION_STATE_ACTIVE = 1, - NSS_CRYPTO_SESSION_STATE_FREE = 2 -}; - -/** - * nss_crypto_buf_origin - * Origins of the crypto session. - */ -enum nss_crypto_buf_origin { - NSS_CRYPTO_BUF_ORIGIN_HOST = 0x001, - NSS_CRYPTO_BUF_ORIGIN_NSS = 0x0002, -}; - -/** - * nss_crypto_idx - * Crypto session index information. - */ -struct nss_crypto_idx { - uint16_t pp_num; /**< Pipe pair index. */ - uint16_t cmd_len; /**< Command block length to program. */ - uint32_t cblk_paddr; /**< Physical address of the command block. */ -}; - -/** - * nss_crypto_config_eng - * Engine configuration information for opening the engine from the host. - * - * This structure is called to initialize the crypto NSS engine-specific data - * structures. Ideally, the host can send a single probe for all engines, but - * the current implementation relies on probes per engine. - */ -struct nss_crypto_config_eng { - uint32_t eng_id; /**< Engine number to open. */ - uint32_t bam_pbase; /**< BAM base address (physical). */ - uint32_t crypto_pbase; /**< Crypto base address (physical). */ - uint32_t desc_paddr[NSS_CRYPTO_BAM_PP]; - /**< Pipe description address (physical). */ - struct nss_crypto_idx idx[NSS_CRYPTO_MAX_IDXS]; - /**< Allocated session indices. */ -}; - -/** - * nss_crypto_config_session - * Session-related state configuration. - */ -struct nss_crypto_config_session { - uint32_t idx; /**< Session index on which the state is reset. */ - uint32_t state; /**< Index state of the session. */ - uint32_t iv_len; /**< Length of the initialization vector. */ -}; - -/** - * nss_crypto_stats - * Crypto statistics. - */ -struct nss_crypto_stats { - uint32_t queued; /**< Number of frames waiting to be processed. */ - uint32_t completed; /**< Number of frames processed. */ - uint32_t dropped; /**< Number of frames dropped or not processed. */ -}; - -/** - * nss_crypto_sync_stats - * Statistics synchronized to the host. - */ -struct nss_crypto_sync_stats { - struct nss_crypto_stats eng_stats[NSS_CRYPTO_MAX_ENGINES]; - /**< Tx or Rx statistics captured per crypto engine. */ - struct nss_crypto_stats idx_stats[NSS_CRYPTO_MAX_IDXS]; - /**< Tx or Rx statistics captured per session. */ - struct nss_crypto_stats total; - /**< Total statistics captured in and out of the engine. */ -}; - -/** - * nss_crypto_msg - * Data for sending and receiving crypto messages. - */ -struct nss_crypto_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a crypto message. - */ - union { - struct nss_crypto_config_eng eng; - /**< Opens an engine. */ - struct nss_crypto_config_session session; - /**< Resets the statistics. */ - struct nss_crypto_sync_stats stats; - /**< Synchronized statistics for crypto. */ - } msg; /**< Message payload. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * Message notification callback. - * - * @datatypes - * nss_crypto_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_crypto_msg_callback_t)(void *app_data, struct nss_crypto_msg *msg); - -/** - * Data callback. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_crypto_buf_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Power management event callback. - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] turbo Turbo mode event. - * @param[in] auto_scale Specifies the auto scaling of the NSS clock frequency. - * - * @return - * TRUE if crypto is scaled to turbo. - */ -typedef bool (*nss_crypto_pm_event_callback_t)(void *app_data, bool turbo, bool auto_scale); - -/** - * nss_crypto_tx_msg - * Sends a crypto message. - * - * @datatypes - * nss_ctx_instance \n - * nss_crypto_msg - * - * @param[in] nss_ctx Pointer to the NSS context of the HLOS driver. - * @param[in] msg Pointer to the message data. - * - * @return - * None. - */ -extern nss_tx_status_t nss_crypto_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_crypto_msg *msg); - -/** - * nss_crypto_tx_buf - * Sends a crypto data packet. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context of the HLOS driver - * @param[in] if_num NSS interface number. - * @param[in] skb Pointer to the data socket buffer. - * - * @return - * None. - */ -extern nss_tx_status_t nss_crypto_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb); - -/** - * nss_crypto_notify_register - * Registers an event callback handler with the HLOS driver. - * - * @datatypes - * nss_crypto_msg_callback_t - * - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern struct nss_ctx_instance *nss_crypto_notify_register(nss_crypto_msg_callback_t cb, void *app_data); - -/** - * nss_crypto_data_register - * Registers a data callback handler with the HLOS driver. - * - * @datatypes - * nss_crypto_buf_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] cb Callback function for the data. - * @param[in] netdev Pointer to the network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * None. - */ -extern struct nss_ctx_instance *nss_crypto_data_register(uint32_t if_num, nss_crypto_buf_callback_t cb, - struct net_device *netdev, uint32_t features); - -/** - * nss_crypto_pm_notify_register - * Registers a power management event callback handler with the HLOS driver. - * - * @datatypes - * nss_crypto_pm_event_callback_t - * - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_crypto_pm_notify_register(nss_crypto_pm_event_callback_t cb, void *app_data); - -/** - * nss_crypto_notify_unregister - * Deregisters an event callback handler notifier from the HLOS driver. - * - * @datatypes - * nss_ctx_instance - * - * @param[in,out] ctx Pointer to the context of the HLOS driver. - * - * @return - * None. - * - * @dependencies - * The event callback handler must have been previously registered. - */ -extern void nss_crypto_notify_unregister(struct nss_ctx_instance *ctx); - -/** - * nss_crypto_data_unregister - * Deregisters a data callback handler from the HLOS driver. - * - * @datatypes - * nss_ctx_instance - * - * @param[in,out] ctx Pointer to the context of the HLOS driver. - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The callback handler must have been previously registered. - */ -extern void nss_crypto_data_unregister(struct nss_ctx_instance *ctx, uint32_t if_num); - -/** - * nss_crypto_pm_notify_unregister - * Deregisters a power management event callback handler from the HLOS driver. - * - * @return - * None. - * - * @dependencies - * The callback handler must have been previously registered. - */ -extern void nss_crypto_pm_notify_unregister(void); - -/** - * nss_crypto_msg_init - * Initializes a crypto-specific message. - * - * @datatypes - * nss_crypto_msg \n - * nss_crypto_msg_callback_t - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_crypto_msg_init(struct nss_crypto_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, - nss_crypto_msg_callback_t cb, void *app_data); - -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_CRYPTO_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_crypto_cmn.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_crypto_cmn.h deleted file mode 100644 index 61b97f1a8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_crypto_cmn.h +++ /dev/null @@ -1,460 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_crypto_cmn.h - * NSS Crypto common interface definitions. - */ -#ifndef __NSS_CRYPTO_CMN_H -#define __NSS_CRYPTO_CMN_H - -/** - * @addtogroup nss_crypto_subsystem - * @{ - */ - -/* - * Context message related array sizes - */ -#define NSS_CRYPTO_CMN_CTX_SPARE 4 /**< Context spare words size. */ -#define NSS_CRYPTO_CMN_VER_WORDS 4 /**< Firmware version words size.*/ -#define NSS_CRYPTO_CIPHER_KEYLEN_MAX 32 /**< Maximum cipher keysize. */ -#define NSS_CRYPTO_AUTH_KEYLEN_MAX 128 /**< Maximum authorization keysize. */ -#define NSS_CRYPTO_NONCE_SIZE_MAX 4 /**< Maximum authorization keysize. */ - -/** - * nss_crypto_cmn_algo - * List of crypto algorithms supported. - */ -enum nss_crypto_cmn_algo { - NSS_CRYPTO_CMN_ALGO_NULL, /**< NULL transform. */ - NSS_CRYPTO_CMN_ALGO_3DES_CBC, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES128_CBC, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES192_CBC, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES256_CBC, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES128_CTR, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES192_CTR, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES256_CTR, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES128_ECB, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES192_ECB, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES256_ECB, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES128_GCM, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES192_GCM, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_AES256_GCM, /**< Asynchronous block cipher. */ - NSS_CRYPTO_CMN_ALGO_MD5_HASH, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA160_HASH, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA224_HASH, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA256_HASH, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA384_HASH, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA512_HASH, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_MD5_HMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA160_HMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA224_HMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA256_HMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA384_HMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_SHA512_HMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_AES128_GMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_AES192_GMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_AES256_GMAC, /**< Asynchronous digest. */ - NSS_CRYPTO_CMN_ALGO_AES128_GCM_GMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CBC_MD5_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CBC_SHA160_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CBC_SHA256_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CBC_SHA384_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CBC_SHA512_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_GCM_GMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CBC_MD5_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CBC_SHA160_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CBC_SHA256_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CBC_SHA384_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CBC_SHA512_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_GCM_GMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CBC_MD5_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CBC_SHA160_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CBC_SHA256_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CBC_SHA384_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CBC_SHA512_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CTR_MD5_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CTR_SHA160_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CTR_SHA256_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CTR_SHA384_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES128_CTR_SHA512_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CTR_MD5_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CTR_SHA160_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CTR_SHA256_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CTR_SHA384_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES192_CTR_SHA512_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CTR_MD5_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CTR_SHA160_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CTR_SHA256_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CTR_SHA384_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_AES256_CTR_SHA512_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_3DES_CBC_MD5_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_3DES_CBC_SHA160_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_3DES_CBC_SHA256_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_3DES_CBC_SHA384_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_3DES_CBC_SHA512_HMAC, /**< AEAD transform. */ - NSS_CRYPTO_CMN_ALGO_MAX -}; - -/** - * nss_crypto_cmn_resp_error - * Response errors from crypto hardware - */ -enum nss_crypto_cmn_resp_error { - NSS_CRYPTO_CMN_RESP_ERROR_NONE = 0, /**< No error. */ - NSS_CRYPTO_CMN_RESP_ERROR_HDR_VERSION, /**< Header version mismatch. */ - NSS_CRYPTO_CMN_RESP_ERROR_CTX_RANGE, /**< Crypto index out-of-range. */ - NSS_CRYPTO_CMN_RESP_ERROR_CTX_NOUSE, /**< Crypto index is freed. */ - NSS_CRYPTO_CMN_RESP_ERROR_DATA_EMPTY, /**< Crypto data is empty. */ - NSS_CRYPTO_CMN_RESP_ERROR_DATA_LEN, /**< Crypto data length. */ - NSS_CRYPTO_CMN_RESP_ERROR_DATA_TIMEOUT, /**< Data timeout from hardware. */ - NSS_CRYPTO_CMN_RESP_ERROR_CIPHER_ALGO, /**< Cipher algorithm is not supported. */ - NSS_CRYPTO_CMN_RESP_ERROR_CIPHER_MODE, /**< Cipher mode is not supported. */ - NSS_CRYPTO_CMN_RESP_ERROR_CIPHER_BLK_LEN, /**< Cipher block length is not aligned. */ - NSS_CRYPTO_CMN_RESP_ERROR_HASH_CHECK, /**< Hash check failed. */ - NSS_CRYPTO_CMN_RESP_ERROR_HASH_NOSPACE, /**< No space to write hash. */ - NSS_CRYPTO_CMN_RESP_ERROR_HW_STATUS, /**< More errors in hardware status. */ - NSS_CRYPTO_CMN_RESP_ERROR_MAX -}; - -/** - * nss_crypto_cmn_msg_type - * Message types supported. - */ -enum nss_crypto_cmn_msg_type { - NSS_CRYPTO_CMN_MSG_TYPE_NONE = 0, /**< Invalid message. */ - NSS_CRYPTO_CMN_MSG_TYPE_SETUP_NODE, /**< Initialize node. */ - NSS_CRYPTO_CMN_MSG_TYPE_SETUP_ENG, /**< Initialize engine. */ - NSS_CRYPTO_CMN_MSG_TYPE_SETUP_DMA, /**< Initialize DMA pair. */ - NSS_CRYPTO_CMN_MSG_TYPE_SETUP_CTX, /**< Update context information. */ - NSS_CRYPTO_CMN_MSG_TYPE_CLEAR_CTX, /**< Clear context information. */ - NSS_CRYPTO_CMN_MSG_TYPE_VERIFY_CTX, /**< Verify if context is active. */ - NSS_CRYPTO_CMN_MSG_TYPE_SYNC_NODE_STATS, /**< Synchronous node statistics. */ - NSS_CRYPTO_CMN_MSG_TYPE_SYNC_ENG_STATS, /**< Synchronous engine statistics. */ - NSS_CRYPTO_CMN_MSG_TYPE_SYNC_CTX_STATS, /**< Synchronous context statistics. */ - NSS_CRYPTO_CMN_MSG_TYPE_MAX -}; - -/** - * nss_crypto_cmn_msg_error - * Message error types supported. - */ -enum nss_crypto_cmn_msg_error { - NSS_CRYPTO_CMN_MSG_ERROR_NONE = 0, - NSS_CRYPTO_CMN_MSG_ERROR_HDR_VERSION_NOSUPP, /**< Common header version not supported. */ - NSS_CRYPTO_CMN_MSG_ERROR_NODE_CTX_RANGE, /**< Context index out-of-range for node. */ - NSS_CRYPTO_CMN_MSG_ERROR_DMA_MASK, /**< DMA mask is out-of-range. */ - NSS_CRYPTO_CMN_MSG_ERROR_DMA_POW2, /**< DMA count is not a power-of-two. */ - NSS_CRYPTO_CMN_MSG_ERROR_DMA_MAX_TOKEN, /**< DMA count exceeds token count. */ - NSS_CRYPTO_CMN_MSG_ERROR_DMA_TOKEN_ALLOC, /**< Failed to allocate token. */ - NSS_CRYPTO_CMN_MSG_ERROR_CTX_RANGE, /**< Context index out-of-range. */ - NSS_CRYPTO_CMN_MSG_ERROR_CTX_INUSE, /**< Context has references. */ - NSS_CRYPTO_CMN_MSG_ERROR_CTX_WORDS, /**< Context size is bad. */ - NSS_CRYPTO_CMN_MSG_ERROR_CTX_ALGO, /**< Context algorithm is bad. */ - NSS_CRYPTO_CMN_MSG_ERROR_CTX_ALLOC, /**< Context alloc failed. */ - NSS_CRYPTO_CMN_MSG_ERROR_CTX_NOUSE, /**< Context has no references. */ - NSS_CRYPTO_CMN_MSG_ERROR_CTX_FLAGS, /**< Invalid context flags. */ - NSS_CRYPTO_CMN_MSG_ERROR_MAX -}; - -/** - * nss_crypto_cmn_ctx_flags - * Context message specific flags. - */ -enum nss_crypto_cmn_ctx_flags { - NSS_CRYPTO_CMN_CTX_FLAGS_NONE = 0, /**< Invalid flags. */ - NSS_CRYPTO_CMN_CTX_FLAGS_SEC_OFFSET = 0x01, /**< Secure offset is valid. */ - NSS_CRYPTO_CMN_CTX_FLAGS_SPARE0 = 0x02, /**< Spare word-0 valid. */ - NSS_CRYPTO_CMN_CTX_FLAGS_SPARE1 = 0x04, /**< Spare word-1 valid. */ - NSS_CRYPTO_CMN_CTX_FLAGS_SPARE2 = 0x08, /**< Spare word-2 valid. */ - NSS_CRYPTO_CMN_CTX_FLAGS_SPARE3 = 0x10, /**< Spare word-3 valid. */ - NSS_CRYPTO_CMN_CTX_FLAGS_MAX -}; - -/** - * nss_crypto_cmn_node - * Node message for setting up the crypto node. - * - * Note: Upon boot this is the first message sent by Host to NSS crypto. - * - It notifies the maximum number of crypto context. - * - It notifies the maximum number of DMA rings. - * - It returns the maximum size of crypto context record. - */ -struct nss_crypto_cmn_node { - uint32_t max_dma_rings; /**< Maximum DMA rings supported. */ - uint32_t max_ctx; /**< Maximum contexts. */ - uint32_t max_ctx_size; /**< Maximum context size. */ -}; - -/** - * nss_crypto_cmn_engine - * Engine message for setting up the instance of crypto engine. - * - * Note: This is sent after 'node' message for each engine to - * - Get valid DMA pairs supported by firmware. - * - Get maximum request/token count available in firmware. - */ -struct nss_crypto_cmn_engine { - uint32_t fw_ver[NSS_CRYPTO_CMN_VER_WORDS]; /**< Firmware version. */ - uint32_t dma_mask; /**< Max DMA rings. */ - uint32_t req_count; /**< Token count. */ -}; - -/** - * nss_crypto_cmn_dma - * DMA message for setting up each DMA pair per engine. - */ -struct nss_crypto_cmn_dma { - uint16_t pair_id; /**< DMA pair ID. */ -}; - -/** - * nss_crypto_cmn_ctx - * Context message for setting up a crypto context in firmware. - */ -struct nss_crypto_cmn_ctx { - uint32_t spare[NSS_CRYPTO_CMN_CTX_SPARE]; /**< Context spare words. */ - uint16_t index; /**< Crypto index. */ - uint16_t sec_offset; /**< Secure offset for copying keys. */ - - uint8_t cipher_key[NSS_CRYPTO_CIPHER_KEYLEN_MAX]; /**< Array containing cipher keys. */ - uint8_t auth_key[NSS_CRYPTO_AUTH_KEYLEN_MAX]; /**< Array containing authorization keys. */ - uint8_t nonce[NSS_CRYPTO_NONCE_SIZE_MAX]; /**< Nonce value. */ - - uint16_t auth_keylen; /**< Authorization key length. */ - uint8_t res[2]; /**< Reserved. */ - - enum nss_crypto_cmn_algo algo; /**< Crypto algorithm. */ - enum nss_crypto_cmn_ctx_flags flags; /**< Context specific flags. */ -}; - -/** - * nss_crypto_cmn_stats - * Statistics message applicable for node/engine/context. - */ -struct nss_crypto_cmn_stats { - struct nss_cmn_node_stats nstats; /**< Common node statistics. */ - uint32_t fail_version; /**< Version mismatch failures. */ - uint32_t fail_ctx; /**< Context related failures. */ - uint32_t fail_dma; /**< DMA descriptor full. */ -}; - -/** - * nss_crypto_cmn_msg - * Crypto common configuration message. - */ -struct nss_crypto_cmn_msg { - struct nss_cmn_msg cm; /**< Common header. */ - uint32_t seq_num; /**< Sequence number for messages. */ - uint32_t uid; /**< Unique ID to identify engine and context. */ - - union { - struct nss_crypto_cmn_node node; /**< Node message. */ - struct nss_crypto_cmn_engine eng; /**< Engine message. */ - struct nss_crypto_cmn_dma dma; /**< DMA message. */ - struct nss_crypto_cmn_ctx ctx; /**< Context message. */ - struct nss_crypto_cmn_stats stats; /**< Statistics message. */ - } msg; -}; - -#ifdef __KERNEL__ /* only kernel will use */ - -/** - * Callback function for receiving crypto transformation upon completion. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Networking device registered for callback. - * @param[in] skb Packet buffer. - * @param[in] napi NAPI pointer for Linux NAPI handling. - * - * @return - * None. - */ -typedef void (*nss_crypto_cmn_buf_callback_t)(struct net_device *netdev, struct sk_buff *skb, - struct napi_struct *napi); - -/** - * Callback function for receiving crypto_cmn messages. - * - * @datatypes - * nss_crypto_cmn_msg - * - * @param[in] app_data Context of the callback user. - * @param[in] msg Crypto common message. - * - * @return - * None. - */ -typedef void (*nss_crypto_cmn_msg_callback_t)(void *app_data, struct nss_crypto_cmn_msg *msg); - -/** - * nss_crypto_cmn_tx_buf - * Send crypto payload to firmware for transformation. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx NSS context per NSS core. - * @param[in] if_num Crypto interface to send the buffer. - * @param[in] skb Crypto payload. - * - * @return - * Status of the TX operation. - */ -extern nss_tx_status_t nss_crypto_cmn_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb); - -/** - * nss_crypto_cmn_tx_msg - * Send crypto message to firmware for configuration. - * - * @datatypes - * nss_ctx_instance \n - * nss_crypto_cmn_msg - * - * @param[in] nss_ctx] NSS context per NSS core. - * @param[in] msg Control message. - * - * @return - * Status of the TX operation. - */ -extern nss_tx_status_t nss_crypto_cmn_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_crypto_cmn_msg *msg); - -/** - * nss_crypto_cmn_tx_msg - * Send crypto message to firmware for configuration synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_crypto_cmn_msg - * - * @param[in] nss_ctx NSS context per NSS core. - * @param[in,out] msg Crypto message, response data is copied. - * - * @return - * Status of the TX operation. - * - * @note - * Response data for the message is copied into the 'msg'. - * The caller should read the content of the 'msg' to find out errors. - * The caller needs to invoke this from a non-atomic context. - */ -extern nss_tx_status_t nss_crypto_cmn_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_crypto_cmn_msg *msg); - -/** - * nss_crypto_cmn_notify_register - * Register a event callback handler with NSS driver - * - * @datatypes - * nss_crypto_cmn_msg_callback_t - * - * @param[in] cb Event callback function. - * @param[in] app_data Context of the callback user. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_crypto_cmn_notify_register(nss_crypto_cmn_msg_callback_t cb, void *app_data); - -/** - * nss_crypto_cmn_notify_unregister - * De-register the event callback handler with NSS driver. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] ctx Pointer to the NSS context per NSS core. - * - * @return - * None. - */ -extern void nss_crypto_cmn_notify_unregister(struct nss_ctx_instance *ctx); - -/** - * nss_crypto_cmn_data_register - * Crypto data register. - * - * @datatypes - * nss_crypto_cmn_buf_callback_t \n - * net_device - * - * @param[in] if_num Interface number. - * @param[in] cb Callback function. - * @param[in] netdev Net device. - * @param[in] features Features supported. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_crypto_cmn_data_register(uint32_t if_num, - nss_crypto_cmn_buf_callback_t cb, - struct net_device *netdev, - uint32_t features); - -/** - * nss_crypto_cmn_data_unregister - * Crypto data de-register. - * - * @param[in] ctx NSS context per NSS core. - * @param[in] if_num Interface number. - * - * @return - * None. - */ -extern void nss_crypto_cmn_data_unregister(struct nss_ctx_instance *ctx, uint32_t if_num); - -/** - * nss_crypto_cmn_get_context - * Get the per NSS core context enabled for crypto. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_crypto_cmn_get_context(void); - -/** - * nss_crypto_cmn_msg_init - * Crypto common message initialization. - * - * @datatypes - * nss_crypto_cmn_msg \n - * nss_crypto_cmn_msg_callback_t - * - * @param[in] ncm Crypto common message. - * @param[in] if_num Interface number. - * @param[in] type Message type. - * @param[in] len Common message length. - * @param[in] cb Callback function. - * @param[in] app_data Appllication data. - * - * @return - * None. - */ -extern void nss_crypto_cmn_msg_init(struct nss_crypto_cmn_msg *ncm, uint16_t if_num, - uint32_t type, uint32_t len, nss_crypto_cmn_msg_callback_t cb, - void *app_data); - -#endif /*__KERNEL__ */ - -/** - * @} - */ -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_def.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_def.h deleted file mode 100644 index 9bfab7909..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_def.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_def.h - * NSS definitions - */ - -#ifndef __NSS_DEF_H -#define __NSS_DEF_H - -/** - * @addtogroup nss_common_subsystem - * @{ - */ - -#define NSS_ETH_NORMAL_FRAME_MTU 1500 /**< MTU of a normal frame.*/ -#define NSS_ETH_MINI_JUMBO_FRAME_MTU 1978 /**< MTU of a mini-jumbo frame. */ -#define NSS_ETH_FULL_JUMBO_FRAME_MTU 9600 /**< MTU of a full jumbo frame. */ - -/** - * Number of ingress or egress VLANS supported in a connection entry. - */ -#define MAX_VLAN_DEPTH 2 - -/** - * Number of egress interfaces supported in a multicast connection entry. - */ -#define NSS_MC_IF_MAX 16 - -/** - * Real pointer size of the system. - */ -#ifdef __LP64__ -typedef uint64_t nss_ptr_t; -#else -typedef uint32_t nss_ptr_t; -#endif - -/** - * @} - */ - -#endif /** __NSS_DEF_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_dma.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_dma.h deleted file mode 100755 index d0aaa01de..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_dma.h +++ /dev/null @@ -1,333 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ -/** - * @file nss_dma.h - * NSS DMA for linearization and split interface definitions. - */ - -#ifndef __NSS_DMA_H -#define __NSS_DMA_H - -/** - * @addtogroup nss_dma_subsystem - * @{ - */ - -/** - * nss_dma_msg_type - * Supported message types. - */ -enum nss_dma_msg_type { - NSS_DMA_MSG_TYPE_NONE, /**< Invalid message type. */ - NSS_DMA_MSG_TYPE_CONFIGURE, /**< Configure DMA. */ - NSS_DMA_MSG_TYPE_SYNC_STATS, /**< Statistics synchronization. */ - NSS_DMA_MSG_TYPE_TEST_PERF, /**< Performance test. */ - NSS_DMA_MSG_TYPE_MAX /**< Maximum message type. */ -}; - -/** - * nss_dma_msg_error - * Message error types. - */ -enum nss_dma_msg_error { - NSS_DMA_MSG_ERROR_NONE, /**< No error. */ - NSS_DMA_MSG_ERROR_HW_INIT, /**< Invalid operation. */ - NSS_DMA_MSG_ERROR_UNHANDLED, /**< Invalid test ID. */ - NSS_DMA_MSG_ERROR_TEST, /**< Performance test failed. */ - NSS_DMA_MSG_ERROR_MAX /**< Maximum error type. */ -}; - -/** - * nss_dma_stats_types - * DMA node statistics. - */ -enum nss_dma_stats_types { - NSS_DMA_STATS_NO_REQ = NSS_STATS_NODE_MAX, - /**< Request descriptor not available. */ - NSS_DMA_STATS_NO_DESC, /**< DMA descriptors not available. */ - NSS_DMA_STATS_NEXTHOP, /**< Failed to retrive next hop. */ - NSS_DMA_STATS_FAIL_NEXTHOP_QUEUE, - /**< Failed to queue next hop. */ - NSS_DMA_STATS_FAIL_LINEAR_SZ, /**< Failed to get memory for linearization. */ - NSS_DMA_STATS_FAIL_LINEAR_ALLOC,/**< Failed to allocate buffer for linearization. */ - NSS_DMA_STATS_FAIL_LINEAR_NO_SG,/**< Skip linearization due to non-SG packet. */ - NSS_DMA_STATS_FAIL_SPLIT_SZ, /**< Failed to spliting buffer into multiple buffers. */ - NSS_DMA_STATS_FAIL_SPLIT_ALLOC, /**< Failed to allocate buffer for split. */ - NSS_DMA_STATS_FAIL_SYNC_ALLOC, /**< Failed to allocate buffer for sending statistics. */ - NSS_DMA_STATS_FAIL_CTX_ACTIVE, /**< Failed to queue as the node is not active. */ - NSS_DMA_STATS_FAIL_HW_E0, /**< Failed to process in hardware, error code E0. */ - NSS_DMA_STATS_FAIL_HW_E1, /**< Failed to process in hardware, error code E1. */ - NSS_DMA_STATS_FAIL_HW_E2, /**< Failed to process in hardware, error code E2. */ - NSS_DMA_STATS_FAIL_HW_E3, /**< Failed to process in hardware, error code E3. */ - NSS_DMA_STATS_FAIL_HW_E4, /**< Failed to process in hardware, error code E4. */ - NSS_DMA_STATS_FAIL_HW_E5, /**< Failed to process in hardware, error code E5. */ - NSS_DMA_STATS_FAIL_HW_E6, /**< Failed to process in hardware, error code E6. */ - NSS_DMA_STATS_FAIL_HW_E7, /**< Failed to process in hardware, error code E7. */ - NSS_DMA_STATS_FAIL_HW_E8, /**< Failed to process in hardware, error code E8. */ - NSS_DMA_STATS_FAIL_HW_E9, /**< Failed to process in hardware, error code E9. */ - NSS_DMA_STATS_FAIL_HW_E10, /**< Failed to process in hardware, error code E10. */ - NSS_DMA_STATS_FAIL_HW_E11, /**< Failed to process in hardware, error code E11. */ - NSS_DMA_STATS_FAIL_HW_E12, /**< Failed to process in hardware, error code E12. */ - NSS_DMA_STATS_FAIL_HW_E13, /**< Failed to process in hardware, error code E13. */ - NSS_DMA_STATS_FAIL_HW_E14, /**< Failed to process in hardware, error code E14. */ - NSS_DMA_STATS_FAIL_HW_E15, /**< Failed to process in hardware, error code E15. */ - NSS_DMA_STATS_MAX, /**< Maximum message type. */ -}; - -/** - * nss_dma_test_type - * DMA Test types. - */ -enum nss_dma_test_type { - NSS_DMA_TEST_TYPE_DEFAULT = 0, /**< Test default segment size. */ - NSS_DMA_TEST_TYPE_SWEEP, /**< Test sweep segment size. */ - NSS_DMA_TEST_TYPE_LARGE, /**< Test large segment size. */ - NSS_DMA_TEST_TYPE_VERIFY, /**< Verify contents at receive processing. */ - NSS_DMA_TEST_TYPE_MAX /**< Maximum test type. */ -}; - -/** - * nss_dma_stats_notification - * DMA transmission statistics structure. - */ -struct nss_dma_stats_notification { - uint64_t stats_ctx[NSS_DMA_STATS_MAX]; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ -/* - * Maximum number of HW specific statistics - */ -#define NSS_DMA_HW_ERROR_MAX 16 - -/* - * Test configuration flags - */ -#define NSS_DMA_TEST_FLAGS_LINEARIZE 0x01 /**< Linearize test. */ -#define NSS_DMA_TEST_FLAGS_SPLIT 0x02 /**< Split test. */ - -/** - * nss_dma_test_cfg - * Test configuration. - */ -struct nss_dma_test_cfg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics for DMA interface. */ - uint32_t flags; /**< Test configuration flags. */ - uint32_t time_delta; /**< Difference between start and end. */ - uint16_t packet_count; /**< Number of packets to send. */ - uint16_t type; /**< Type of test to run. */ -}; - -/** - * nss_dma_stats - * DMA statistics. - */ -struct nss_dma_stats { - struct nss_cmn_node_stats node_stats; /**< Common node statistics for DMA interface. */ - uint32_t no_req; /**< Request descriptor not available. */ - uint32_t no_desc; /**< DMA descriptors not available. */ - uint32_t fail_nexthop; /**< Failed to retrive next hop. */ - uint32_t fail_nexthop_queue; /**< Failed to queue next hop. */ - uint32_t fail_linear_sz; /**< Failed to get memory for linearization. */ - uint32_t fail_linear_alloc; /**< Failed to allocate buffer for linearization. */ - uint32_t fail_linear_no_sg; /**< Skip linearization due to non-SG packet. */ - uint32_t fail_split_sz; /**< Failed to spliting buffer into multiple buffers. */ - uint32_t fail_split_alloc; /**< Failed to allocate buffer for split. */ - uint32_t fail_sync_alloc; /**< Failed to allocate buffer for sending statistics. */ - uint32_t fail_ctx_active; /**< Failed to queue as the node is not active. */ - uint32_t fail_hw[NSS_DMA_HW_ERROR_MAX]; /**< Hardware failures. */ -}; - -/** - * nss_dma_msg - * Message structure for configuring the DMA interface. - */ -struct nss_dma_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a NSS core-to-core transmission rule or statistics message. - */ - union { - struct nss_dma_test_cfg test_cfg; - /**< DMA test configuration. */ - struct nss_dma_stats stats; /**< DMA interface statistics. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_dma_register_handler - * Registers the DMA message handler. - * - * @return - * None. - */ -void nss_dma_register_handler(void); - -/** - * Callback function for receiving DMA messages. - * - * @datatypes - * nss_c2c_tx_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_dma_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_dma_tx_msg - * Transmits a DMA message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_dma_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] ndm Pointer to the message data. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_dma_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_dma_msg *ndm); - -/** - * nss_dma_msg_init - * Initializes DMA messages. - * - * @datatypes - * nss_dma_msg \n - * nss_dma_msg_callback_t - * - * @param[in] ndm Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_dma_msg_init(struct nss_dma_msg *ndm, uint16_t if_num, uint32_t type, uint32_t len, - nss_dma_msg_callback_t cb, void *app_data); - -/** - * nss_dma_notify_register - * Registers a notifier callback for DMA messages with the NSS. - * - * @datatypes - * nss_dma_msg_callback_t - * - * @param[in] core NSS core number index to the notifier callback table. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_dma_notify_register(int core, nss_dma_msg_callback_t cb, void *app_data); - -/** - * nss_dma_notify_unregister - * Deregisters a DMA message notifier callback from the NSS. - * - * @param[in] core NSS core number index to the notifier callback table. - * - * @return - * None. - * - * @dependencies - * The notifier callback must have been previously registered. - */ -void nss_dma_notify_unregister(int core); - -/** - * nss_dma_register_sysctl - * Registers the DMA interface to Linux system control tree. - * - * @return - * None. - */ -extern void nss_dma_register_sysctl(void); - -/** - * nss_dma_unregister_sysctl - * Deregisters the DMA interface from Linux system control tree. - * - * @return - * None. - * - * @dependencies - * The system control must have been previously registered. - */ -extern void nss_dma_unregister_sysctl(void); - -/** - * nss_dma_init - * Initializes the DMA interface. - * - * @return - * None. - */ -void nss_dma_init(void); - -/** - * nss_dma_get_context - * Get the per NSS core context enabled for DMA. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_dma_get_context(void); - -/** - * nss_dma_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_dma_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_dma_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_dma_stats_register_notifier(struct notifier_block *nb); -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_C2C_TX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_dtls.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_dtls.h deleted file mode 100644 index d237bfda2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_dtls.h +++ /dev/null @@ -1,335 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_dtls.h - * NSS DTLS interface definitions. - */ - -#ifndef _NSS_DTLS_H_ -#define _NSS_DTLS_H_ - -/** - * @addtogroup nss_dtls_subsystem - * @{ - */ - -#define NSS_MAX_DTLS_SESSIONS 8 /**< Maximum number of supported DTLS sessions. */ - -/** - * nss_dtls_metadata_types - * Message types for DTLS requests and responses. - */ -enum nss_dtls_metadata_types { - NSS_DTLS_MSG_SESSION_CONFIGURE, - NSS_DTLS_MSG_SESSION_DESTROY, - NSS_DTLS_MSG_SESSION_STATS, - NSS_DTLS_MSG_REKEY_ENCAP_CIPHER_UPDATE, - NSS_DTLS_MSG_REKEY_ENCAP_CIPHER_SWITCH, - NSS_DTLS_MSG_REKEY_DECAP_CIPHER_UPDATE, - NSS_DTLS_MSG_REKEY_DECAP_CIPHER_SWITCH, - NSS_DTLS_MSG_MAX -}; - -/** - * nss_dtls_error_response_types - * Error types for DTLS responses. - */ -enum nss_dtls_error_response_types { - NSS_DTLS_ERR_UNKNOWN_MSG = 1, - NSS_DTLS_ERR_INVALID_APP_IF = 2, - NSS_DTLS_ERR_INVALID_CPARAM = 3, - NSS_DTLS_ERR_INVALID_VER = 4, - NSS_DTLS_ERR_NOMEM = 5, - NSS_DTLS_ERR_MAX, -}; - -/** - * nss_dtls_session_stats - * DTLS session statistics. - */ -struct nss_dtls_session_stats { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t tx_auth_done; /**< Tx authentication is done. */ - uint32_t rx_auth_done; /**< Rx authentication is successful. */ - uint32_t tx_cipher_done; /**< Tx cipher is complete. */ - uint32_t rx_cipher_done; /**< Rx cipher is complete. */ - uint32_t tx_cbuf_alloc_fail; /**< Tx crypto buffer allocation failure. */ - uint32_t rx_cbuf_alloc_fail; /**< Rx crypto buffer allocation failure. */ - uint32_t tx_cenqueue_fail; /**< Tx enqueue-to-crypto failure. */ - uint32_t rx_cenqueue_fail; /**< Rx enqueue-to-crypto failure. */ - uint32_t tx_dropped_hroom; - /**< Tx packets dropped because of insufficent headroom. */ - uint32_t tx_dropped_troom; - /**< Tx packets dropped because of insufficent tailroom. */ - uint32_t tx_forward_enqueue_fail; - /**< Tx enqueue failed to forward a node after encapsulation. */ - uint32_t rx_forward_enqueue_fail; - /**< Rx enqueue failed to receive a node after decapsulation. */ - uint32_t rx_invalid_version; /**< Rx invalid DTLS version. */ - uint32_t rx_invalid_epoch; /**< Rx invalid DTLS epoch. */ - uint32_t rx_malformed; /**< Rx malformed DTLS record. */ - uint32_t rx_cipher_fail; /**< Rx cipher failure. */ - uint32_t rx_auth_fail; /**< Rx authentication failure. */ - uint32_t rx_capwap_classify_fail; /**< Rx CAPWAP classification failure. */ - uint32_t rx_single_rec_dgram; /**< Rx single record datagrams processed. */ - uint32_t rx_multi_rec_dgram; /**< Rx multi-record datagrams processed. */ - uint32_t rx_replay_fail; /**< Rx anti-replay failures. */ - uint32_t rx_replay_duplicate; - /**< Rx anti-replay failed because of a duplicate record. */ - uint32_t rx_replay_out_of_window; - /**< Rx anti-replay failed because of an out-of-window record. */ - uint32_t outflow_queue_full; - /**< Tx packets dropped because the encapsulation queue is full. */ - uint32_t decap_queue_full; - /**< Rx packets dropped because the decapsulation queue is full. */ - uint32_t pbuf_alloc_fail; - /**< Packets dropped because of a buffer allocation failure. */ - uint32_t pbuf_copy_fail; - /**< Packets dropped because of a buffer copy failure. */ - uint16_t epoch; /**< Current epoch. */ - uint16_t tx_seq_high; /**< Upper 16 bits of the current sequence number. */ - uint32_t tx_seq_low; /**< Lower 32 bits of the current sequence number. */ -}; - -/** - * nss_dtls_session_cipher_update - * Information for a cipher update message in a DTLS session. - */ -struct nss_dtls_session_cipher_update { - uint32_t crypto_idx; /**< Crypto index for encapsulation. */ - uint32_t hash_len; /**< Authentication hash length for encapsulation. */ - uint32_t iv_len; /**< Crypto IV length for encapsulation. */ - uint32_t cipher_algo; /**< Encapsulation cipher. */ - uint32_t auth_algo; /**< Encapsulation authentication algorithm. */ - uint16_t epoch; /**< Epoch indicator. */ - uint16_t reserved; /**< Reserved for message alignment.*/ -}; - -/** - * nss_dtls_session_configure - * Configuration message for a DTLS session. - */ -struct nss_dtls_session_configure { - uint32_t ver; /**< DTLS version. */ - uint32_t flags; /**< DTLS flags. */ - uint32_t crypto_idx_encap; /**< Crypto index for encapsulation. */ - uint32_t crypto_idx_decap; /**< Crypto index for decapsulation. */ - uint32_t iv_len_encap; /**< Crypto IV length for encapsulation. */ - uint32_t iv_len_decap; /**< Crypto IV length for decapsulation. */ - uint32_t hash_len_encap; - /**< Authentication hash length for encapsulation. */ - uint32_t hash_len_decap; - /**< Authentication hash length for decapsulation. */ - uint32_t cipher_algo_encap; /**< Cipher algorithm for encapsulation. */ - uint32_t auth_algo_encap; /**< Authentication algorithm encapsulation. */ - uint32_t cipher_algo_decap; /**< Cipher algorithm for decapsulation. */ - uint32_t auth_algo_decap; /**< Authentication algorithm decapsulation. */ - uint32_t nss_app_if; - /**< Interface of the node that receives decapsulated packets. */ - uint16_t sport; /**< Source UDP/UDPLite port. */ - uint16_t dport; /**< Destination UDP/UDPLite port. */ - uint32_t sip[4]; /**< Source IPv4/IPv6 address. */ - uint32_t dip[4]; /**< Destination IPv4/IPv6 address. */ - uint16_t window_size; /**< Anti-replay window size. */ - uint16_t epoch; /**< Epoch indicator. */ - uint8_t oip_ttl; /**< Maximum outer IP time-to-live value. */ - uint8_t reserved1; /**< Reserved for message alignment. */ - uint16_t reserved2; /**< Reserved for message alignment. */ -}; - -/** - * nss_dtls_msg - * Data for sending and receiving DTLS messages. - */ -struct nss_dtls_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a DTLS message. - */ - union { - struct nss_dtls_session_configure cfg; - /**< Session configuration. */ - struct nss_dtls_session_cipher_update cipher_update; - /**< Cipher update information. */ - struct nss_dtls_session_stats stats; - /**< Session statistics. */ - } msg; /**< Message payload for DTLS session messages exchanged with NSS core. */ -}; - -/** - * nss_dtls_tx_buf - * Sends a DTLS data packet to the NSS. - * - * @datatypes - * sk_buff \n - * nss_ctx_instance - * - * @param[in] os_buf Pointer to the OS data buffer. - * @param[in] if_num NSS interface number. - * @param[in] nss_ctx Pointer to the NSS core context. - * - * @return - * Status of Tx buffer forwarded to NSS for DTLS operation. - */ -nss_tx_status_t nss_dtls_tx_buf(struct sk_buff *os_buf, uint32_t if_num, - struct nss_ctx_instance *nss_ctx); - -/** - * nss_dtls_tx_msg - * Sends DTLS messages. - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in,out] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_dtls_tx_msg(struct nss_ctx_instance *nss_ctx, - struct nss_dtls_msg *msg); - -/** - * nss_dtls_tx_msg_sync - * Sends DTLS messages synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_dtls_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in,out] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_dtls_tx_msg_sync(struct nss_ctx_instance *nss_ctx, - struct nss_dtls_msg *msg); - -/** - * Callback function for receiving DTLS messages. - * - * @datatypes - * nss_dtls_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_dtls_msg_callback_t)(void *app_data, - struct nss_dtls_msg *msg); - -/** - * Callback function for receiving DTLS session data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_dtls_data_callback_t)(struct net_device *netdev, - struct sk_buff *skb, - struct napi_struct *napi); - -/** - * nss_dtls_register_if - * Registers a DTLS session interface with the NSS for sending and receiving - * messages. - * - * @datatypes - * nss_dtls_data_callback_t \n - * nss_dtls_msg_callback_t - * - * @param[in] if_num NSS interface number. - * @param[in] cb Callback function for the message. - * @param[in] msg_callback Callback for DTLS tunnel message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * @param[in] app_ctx Pointer to the application context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_dtls_register_if(uint32_t if_num, - nss_dtls_data_callback_t cb, - nss_dtls_msg_callback_t msg_callback, - struct net_device *netdev, - uint32_t features, - void *app_ctx); - -/** - * nss_dtls_unregister_if - * Deregisters a DTLS session interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The DTLS session interface must have been previously registered. - */ -extern void nss_dtls_unregister_if(uint32_t if_num); - -/** - * nss_dtls_msg_init - * Initializes a DTLS message. - * - * @datatypes - * nss_dtls_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context. - * - * @return - * None. - */ -extern void nss_dtls_msg_init(struct nss_dtls_msg *ncm, uint16_t if_num, - uint32_t type, uint32_t len, void *cb, - void *app_data); - -/** - * nss_dtls_get_context - * Gets the NSS core context for the DTLS session. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_dtls_get_context(void); - -/** - * nss_dtls_get_ifnum_with_coreid - * Gets the DTLS interface number with a core ID. - * - * @param[in] if_num NSS interface number. - * - * @return - * Interface number with the core ID. - */ -extern int32_t nss_dtls_get_ifnum_with_coreid(int32_t if_num); - -/** - * @} - */ - -#endif /* _NSS_DTLS_H_. */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_dtls_cmn.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_dtls_cmn.h deleted file mode 100644 index 78b166365..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_dtls_cmn.h +++ /dev/null @@ -1,512 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_dtls_cmn.h - * NSS DTLS common interface definitions, supports inner/outer interface split. - */ - -#ifndef _NSS_DTLS_CMN_H_ -#define _NSS_DTLS_CMN_H_ - -/** - * @addtogroup nss_dtls_subsystem - * @{ - */ - -#define NSS_DTLS_CMN_CTX_HDR_IPV6 0x0001 /**< DTLS with IPv6. */ -#define NSS_DTLS_CMN_CTX_HDR_UDPLITE 0x0002 /**< DTLS with UDPLite. */ -#define NSS_DTLS_CMN_CTX_HDR_CAPWAP 0x0004 /**< DTLS with CAPWAP. */ -#define NSS_DTLS_CMN_CTX_CIPHER_MODE_GCM 0x0008 /**< DTLS with GCM cipher mode. */ -#define NSS_DTLS_CMN_CTX_ENCAP_UDPLITE_CSUM 0x10000 /**< Checksum only UDPLite header. */ -#define NSS_DTLS_CMN_CTX_ENCAP_METADATA 0x20000 /**< Valid metadata in encapsulation direction. */ -#define NSS_DTLS_CMN_CTX_DECAP_ACCEPT_ALL 0x40000 /**< Exception all error packets to host. */ - -#define NSS_DTLS_CMN_CLE_MAX 32 /**< Max classification error. */ - -/** - * nss_dtls_cmn_metadata_types - * Message types for DTLS requests and responses. - */ -enum nss_dtls_cmn_msg_type { - NSS_DTLS_CMN_MSG_TYPE_CONFIGURE_NODE, /**< Configure DTLS firmware node. */ - NSS_DTLS_CMN_MSG_TYPE_CONFIGURE_HDR, /**< Configure the base context parameter. */ - NSS_DTLS_CMN_MSG_TYPE_CONFIGURE_DTLS, /**< Configure DTLS parameters. */ - NSS_DTLS_CMN_MSG_TYPE_SWITCH_DTLS, /**< Switch to new DTLS transform. */ - NSS_DTLS_CMN_MSG_TYPE_DECONFIGURE, /**< Deconfigure context. */ - NSS_DTLS_CMN_MSG_TYPE_SYNC_STATS, /**< Synchronize statistics. */ - NSS_DTLS_CMN_MSG_TYPE_NODE_STATS, /**< Node statistics. */ - NSS_DTLS_CMN_MSG_MAX -}; - -/** - * nss_dtls_cmn_error_response_types - * Error types for DTLS responses. - */ -enum nss_dtls_cmn_error { - NSS_DTLS_CMN_ERROR_NONE = 0, - NSS_DTLS_CMN_ERROR_UNKNOWN_MSG, - NSS_DTLS_CMN_ERROR_INVALID_DESTIF, - NSS_DTLS_CMN_ERROR_INVALID_SRCIF, - NSS_DTLS_CMN_ERROR_INVALID_CRYPTO, - NSS_DTLS_CMN_ERROR_INVALID_VER, - NSS_DTLS_CMN_ERROR_INVALID_CTX_TYPE, - NSS_DTLS_CMN_ERROR_INVALID_CTX_WORDS, - NSS_DTLS_CMN_ERROR_FAIL_ALLOC_HWCTX, - NSS_DTLS_CMN_ERROR_FAIL_COPY_CTX, - NSS_DTLS_CMN_ERROR_FAIL_SWITCH_HWCTX, - NSS_DTLS_CMN_ERROR_ALREADY_CONFIGURED, - NSS_DTLS_CMN_ERROR_FAIL_NOMEM, - NSS_DTLS_CMN_ERROR_FAIL_COPY_NONCE, - NSS_DTLS_CMN_ERROR_MAX, -}; - -/** - * nss_dtls_cmn_ctx_stats_types - * DTLS common context statistics types. - */ -enum nss_dtls_cmn_ctx_stats_types { - NSS_DTLS_CMN_STATS_RX_SINGLE_REC = NSS_STATS_NODE_MAX, - /**< Received single DTLS record datagrams. */ - NSS_DTLS_CMN_STATS_RX_MULTI_REC, /**< Received multiple DTLS record datagrams. */ - NSS_DTLS_CMN_STATS_FAIL_CRYPTO_RESOURCE,/**< Failure in crypto resource allocation. */ - NSS_DTLS_CMN_STATS_FAIL_CRYPTO_ENQUEUE, /**< Failure due to full queue in crypto or hardware. */ - NSS_DTLS_CMN_STATS_FAIL_HEADROOM, /**< Failure in headroom check. */ - NSS_DTLS_CMN_STATS_FAIL_TAILROOM, /**< Failure in tailroom check. */ - NSS_DTLS_CMN_STATS_FAIL_VER, /**< Failure in DTLS version check. */ - NSS_DTLS_CMN_STATS_FAIL_EPOCH, /**< Failure in DTLS epoch check. */ - NSS_DTLS_CMN_STATS_FAIL_DTLS_RECORD, /**< Failure in reading DTLS record. */ - NSS_DTLS_CMN_STATS_FAIL_CAPWAP, /**< Failure in CAPWAP classification. */ - NSS_DTLS_CMN_STATS_FAIL_REPLAY, /**< Failure in anti-replay check. */ - NSS_DTLS_CMN_STATS_FAIL_REPLAY_DUP, /**< Failure in anti-replay; duplicate records. */ - NSS_DTLS_CMN_STATS_FAIL_REPLAY_WIN, /**< Failure in anti-replay; packet outside the window. */ - NSS_DTLS_CMN_STATS_FAIL_QUEUE, /**< Failure due to full queue in DTLS. */ - NSS_DTLS_CMN_STATS_FAIL_QUEUE_NEXTHOP, /**< Failure due to full queue in next hop. */ - NSS_DTLS_CMN_STATS_FAIL_PBUF_ALLOC, /**< Failure in pbuf allocation. */ - NSS_DTLS_CMN_STATS_FAIL_PBUF_LINEAR, /**< Failure in pbuf linearization. */ - NSS_DTLS_CMN_STATS_FAIL_PBUF_STATS, /**< Failure in pbuf allocation for statistics. */ - NSS_DTLS_CMN_STATS_FAIL_PBUF_ALIGN, /**< Failure in pbuf alignment. */ - NSS_DTLS_CMN_STATS_FAIL_CTX_ACTIVE, /**< Failure in enqueue due to inactive context. */ - NSS_DTLS_CMN_STATS_FAIL_HWCTX_ACTIVE, /**< Failure in enqueue due to inactive hardware context. */ - NSS_DTLS_CMN_STATS_FAIL_CIPHER, /**< Failure in decrypting the data. */ - NSS_DTLS_CMN_STATS_FAIL_AUTH, /**< Failure in authenticating the data. */ - NSS_DTLS_CMN_STATS_FAIL_SEQ_OVF, /**< Failure due to sequence number overflow. */ - NSS_DTLS_CMN_STATS_FAIL_BLK_LEN, /**< Failure in decapsulation due to bad cipher length. */ - NSS_DTLS_CMN_STATS_FAIL_HASH_LEN, /**< Failure in decapsulation due to bad hash length. */ - NSS_DTLS_CMN_STATS_LEN_ERROR, /**< Length error. */ - NSS_DTLS_CMN_STATS_TOKEN_ERROR, /**< Token error, unknown token command or instruction. */ - NSS_DTLS_CMN_STATS_BYPASS_ERROR, /**< Token contains too much bypass data. */ - NSS_DTLS_CMN_STATS_CONFIG_ERROR, /**< Invalid command, algorithm, or mode combination. */ - NSS_DTLS_CMN_STATS_ALGO_ERROR, /**< Unsupported algorithm. */ - NSS_DTLS_CMN_STATS_HASH_OVF_ERROR, /**< Hash input overflow. */ - NSS_DTLS_CMN_STATS_TTL_ERROR, /**< TTL or HOP-Limit underflow. */ - NSS_DTLS_CMN_STATS_CSUM_ERROR, /**< Checksum error. */ - NSS_DTLS_CMN_STATS_TIMEOUT_ERROR, /**< Data timed out. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_0, /**< Classification failure 0. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_1, /**< Classification failure 1. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_2, /**< Classification failure 2. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_3, /**< Classification failure 3. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_4, /**< Classification failure 4. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_5, /**< Classification failure 5. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_6, /**< Classification failure 6. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_7, /**< Classification failure 7. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_8, /**< Classification failure 8. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_9, /**< Classification failure 9. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_10, /**< Classification failure 10. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_11, /**< Classification failure 11. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_12, /**< Classification failure 12. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_13, /**< Classification failure 13. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_14, /**< Classification failure 14. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_15, /**< Classification failure 15. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_16, /**< Classification failure 16. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_17, /**< Classification failure 17. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_18, /**< Classification failure 18. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_19, /**< Classification failure 19. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_20, /**< Classification failure 20. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_21, /**< Classification failure 21. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_22, /**< Classification failure 22. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_23, /**< Classification failure 23. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_24, /**< Classification failure 24. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_25, /**< Classification failure 25. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_26, /**< Classification failure 26. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_27, /**< Classification failure 27. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_28, /**< Classification failure 28. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_29, /**< Classification failure 29. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_30, /**< Classification failure 30. */ - NSS_DTLS_CMN_STATS_CLE_ERROR_31, /**< Classification failure 31. */ - NSS_DTLS_CMN_STATS_SEQ_LOW, /**< Lower 32 bits of current transmit sequence number. */ - NSS_DTLS_CMN_STATS_SEQ_HIGH, /**< Upper 16 bits of current transmit sequence number. */ - NSS_DTLS_CMN_STATS_EPOCH, /**< Current epoch value. */ - NSS_DTLS_CMN_CTX_STATS_MAX, /**< Maximum message type. */ -}; - -/** - * nss_dtls_cmn_node_stats - * DTLS node statistics. - */ -struct nss_dtls_cmn_node_stats { - uint32_t fail_ctx_alloc; /**< Failure in allocating a context. */ - uint32_t fail_ctx_free; /**< Failure in freeing up the context. */ - uint32_t fail_pbuf_stats; /**< Failure in pbuf allocation for statistics. */ -}; - -/** - * nss_dtls_cmn_hw_stats - * DTLS hardware statistics. - */ -struct nss_dtls_cmn_hw_stats { - uint32_t len_error; /**< Length error. */ - uint32_t token_error; /**< Token error, unknown token command/instruction. */ - uint32_t bypass_error; /**< Token contains too much bypass data. */ - uint32_t config_error; /**< Invalid command/algorithm/mode/combination. */ - uint32_t algo_error; /**< Unsupported algorithm. */ - uint32_t hash_ovf_error; /**< Hash input overflow. */ - uint32_t ttl_error; /**< TTL or HOP-Limit underflow. */ - uint32_t csum_error; /**< Checksum error. */ - uint32_t timeout_error; /**< Data timed-out. */ -}; - -/** - * nss_dtls_cmn_ctx_stats - * DTLS session statistics. - */ -struct nss_dtls_cmn_ctx_stats { - struct nss_cmn_node_stats pkt; /**< Common node statistics. */ - uint32_t rx_single_rec; /**< Received single DTLS record datagrams. */ - uint32_t rx_multi_rec; /**< Received multiple DTLS record datagrams. */ - uint32_t fail_crypto_resource; /**< Failure in allocation of crypto resource. */ - uint32_t fail_crypto_enqueue; /**< Failure due to queue full in crypto or hardware. */ - uint32_t fail_headroom; /**< Failure in headroom check. */ - uint32_t fail_tailroom; /**< Failure in tailroom check. */ - uint32_t fail_ver; /**< Failure in DTLS version check. */ - uint32_t fail_epoch; /**< Failure in DTLS epoch check. */ - uint32_t fail_dtls_record; /**< Failure in reading DTLS record. */ - uint32_t fail_capwap; /**< Failure in CAPWAP classification. */ - uint32_t fail_replay; /**< Failure in anti-replay check. */ - uint32_t fail_replay_dup; /**< Failure in anti-replay; duplicate records. */ - uint32_t fail_replay_win; /**< Failure in anti-replay; packet outside the window. */ - uint32_t fail_queue; /**< Failure due to queue full in DTLS. */ - uint32_t fail_queue_nexthop; /**< Failure due to queue full in next_hop. */ - uint32_t fail_pbuf_alloc; /**< Failure in pbuf allocation. */ - uint32_t fail_pbuf_linear; /**< Failure in pbuf linearization. */ - uint32_t fail_pbuf_stats; /**< Failure in pbuf allocation for statistics. */ - uint32_t fail_pbuf_align; /**< Failure in pbuf alignment. */ - uint32_t fail_ctx_active; /**< Failure in enqueue due to inactive context. */ - uint32_t fail_hwctx_active; /**< Failure in enqueue due to inactive hardware context. */ - uint32_t fail_cipher; /**< Failure in decrypting the data. */ - uint32_t fail_auth; /**< Failure in authenticating the data. */ - uint32_t fail_seq_ovf; /**< Failure due to sequence number overflow. */ - uint32_t fail_blk_len; /**< Failure in decapsulation due to bad cipher block length. */ - uint32_t fail_hash_len; /**< Failure in decapsulation due to bad hash block length. */ - - struct nss_dtls_cmn_hw_stats fail_hw; /**< Hardware failure statistics. */ - - uint32_t fail_cle[NSS_DTLS_CMN_CLE_MAX];/**< Classification errors. */ - - uint32_t seq_low; /**< Lower 32 bits of current Tx sequence number. */ - uint32_t seq_high; /**< Upper 16 bits of current Tx sequence number. */ - - uint16_t epoch; /**< Current epoch value. */ - uint8_t res1[2]; /**< Reserved for future use. */ - - uint8_t res2[16]; /**< Reserved for future use. */ -}; - -/** - * nss_dtls_cmn_ctx_config_hdr - * Parameters for outer header transform. - */ -struct nss_dtls_cmn_ctx_config_hdr { - uint32_t flags; /**< Context flags. */ - uint32_t dest_ifnum; /**< Destination interface for packets. */ - uint32_t src_ifnum; /**< Source interface of packets. */ - uint32_t sip[4]; /**< Source IPv4/v6 address. */ - uint32_t dip[4]; /**< Destination IPv4/v6 address. */ - - uint16_t sport; /**< Source UDP/UDPLite port. */ - uint16_t dport; /**< Destination UDP/UDPLite port. */ - - uint8_t hop_limit_ttl; /**< IP header TTL field. */ - uint8_t dscp; /**< DSCP value. */ - uint8_t dscp_copy; /**< Copy DSCP value. */ - uint8_t df; /**< Do not fragment DTLS over IPv4. */ -}; - -/** - * nss_dtls_cmn_ctx_config_dtls - * Parameters for DTLS transform. - */ -struct nss_dtls_cmn_ctx_config_dtls { - uint32_t ver; /**< Version (enum dtls_cmn_ver). */ - uint32_t crypto_idx; /**< Crypto index for cipher context. */ - - uint16_t window_size; /**< Anti-replay window size. */ - uint16_t epoch; /**< Initial epoch value. */ - - uint8_t iv_len; /**< Crypto IV length for encapsulation. */ - uint8_t hash_len; /**< Auth hash length for encapsulation. */ - uint8_t blk_len; /**< Cipher block length. */ - uint8_t res1; /**< Reserved for alignment. */ -}; - -/** - * nss_dtls_cmn_stats_notification - * DTLS common transmission statistics structure. - */ -struct nss_dtls_cmn_stats_notification { - uint64_t stats_ctx[NSS_DTLS_CMN_CTX_STATS_MAX]; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_dtls_cmn_msg - * Data for sending and receiving DTLS messages. - */ -struct nss_dtls_cmn_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a DTLS message. - */ - union { - struct nss_dtls_cmn_ctx_config_hdr hdr_cfg; /**< Session configuration. */ - struct nss_dtls_cmn_ctx_config_dtls dtls_cfg; /**< Cipher update information. */ - struct nss_dtls_cmn_ctx_stats stats; /**< Session statistics. */ - struct nss_dtls_cmn_node_stats node_stats; /**< Node statistics. */ - } msg; /**< Message payload for DTLS session messages exchanged with NSS core. */ -}; - -#ifdef __KERNEL__ /* only for kernel use. */ -/** - * Callback function for receiving DTLS messages. - * - * @datatypes - * nss_dtls_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_dtls_cmn_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * Callback function for receiving DTLS session data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_dtls_cmn_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_dtls_cmn_tx_buf - * Sends a DTLS data packet to the NSS. - * - * @datatypes - * sk_buff \n - * nss_ctx_instance - * - * @param[in] os_buf Pointer to the OS data buffer. - * @param[in] if_num NSS interface number. - * @param[in] nss_ctx Pointer to the NSS core context. - * - * @return - * Status of Tx buffer forwarded to NSS for DTLS operation. - */ -nss_tx_status_t nss_dtls_cmn_tx_buf(struct sk_buff *os_buf, uint32_t if_num, struct nss_ctx_instance *nss_ctx); - -/** - * nss_dtls_cmn_tx_msg - * Sends DTLS messages. - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in,out] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_dtls_cmn_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_dtls_cmn_msg *msg); - -/** - * nss_dtls_cmn_tx_msg_sync - * Sends DTLS messages synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_dtls_cmn_msg_type \n - * nss_dtls_cmn_msg \n - * nss_dtls_cmn_error - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] ndcm Pointer to the message data. - * @param[in,out] resp Response for the configuration. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_dtls_cmn_tx_msg_sync(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - enum nss_dtls_cmn_msg_type type, uint16_t len, - struct nss_dtls_cmn_msg *ndcm, enum nss_dtls_cmn_error *resp); - -/** - * nss_dtls_cmn_unregister_if - * Deregisters a DTLS session interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The DTLS session interface must have been previously registered. - */ -extern void nss_dtls_cmn_unregister_if(uint32_t if_num); - -/** - * nss_dtls_cmn_register_if - * Registers a DTLS session interface with the NSS for sending and receiving - * messages. - * - * @datatypes - * nss_dtls_cmn_data_callback_t \n - * nss_dtls_cmn_msg_callback_t - * - * @param[in] if_num NSS interface number. - * @param[in] data_cb Callback function for the message. - * @param[in] msg_cb Callback for DTLS tunnel message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * @param[in] type Type of message. - * @param[in] app_ctx Pointer to the application context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_dtls_cmn_register_if(uint32_t if_num, - nss_dtls_cmn_data_callback_t data_cb, - nss_dtls_cmn_msg_callback_t msg_cb, - struct net_device *netdev, - uint32_t features, - uint32_t type, - void *app_ctx); - -/** - * nss_dtls_cmn_notify_unregister - * Deregisters an event callback. - * - * @param[in] ifnum NSS interface number. - * - * @return - * None. - */ -extern void nss_dtls_cmn_notify_unregister(uint32_t ifnum); - -/** - * nss_dtls_cmn_notify_register - * Registers an event callback to handle notification from DTLS firmware package. - * - * @param[in] ifnum NSS interface number. - * @param[in] ev_cb Callback for DTLS tunnel message. - * @param[in] app_data Pointer to the application context. - * - * @return - * Pointer to NSS core context. - */ -extern struct nss_ctx_instance *nss_dtls_cmn_notify_register(uint32_t ifnum, nss_dtls_cmn_msg_callback_t ev_cb, - void *app_data); - -/** - * nss_dtls_cmn_msg_init - * Initializes a DTLS message. - * - * @datatypes - * nss_dtls_cmn_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context. - * - * @return - * None. - */ -extern void nss_dtls_cmn_msg_init(struct nss_dtls_cmn_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len, void *cb, - void *app_data); - -/** - * nss_dtls_cmn_get_context - * Gets the NSS core context for the DTLS session. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_dtls_cmn_get_context(void); - -/** - * nss_dtls_cmn_get_ifnum - * Gets the DTLS interface number with a core ID. - * - * @param[in] if_num NSS interface number. - * - * @return - * Interface number with the core ID. - */ -extern int32_t nss_dtls_cmn_get_ifnum(int32_t if_num); - -/** - * nss_dtls_cmn_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_dtls_cmn_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_dtls_cmn_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_dtls_cmn_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* __KERNEL__ */ -#endif /* _NSS_DTLS_CMN_H_. */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_dynamic_interface.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_dynamic_interface.h deleted file mode 100644 index 7595af151..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_dynamic_interface.h +++ /dev/null @@ -1,343 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * @file nss_dynamic_interface.h - * NSS Dynamic interface definitions. - */ - -#ifndef __NSS_DYNAMIC_INTERFACE_H -#define __NSS_DYNAMIC_INTERFACE_H - -/** - * @addtogroup nss_dynamic_interface_subsystem - * @{ - */ - -#define NSS_MAX_DYNAMIC_INTERFACES 128 /**< Maximum number of dynamic interfaces. */ - -/** - * nss_dynamic_interface_type - * Dynamic interface types. - * - * @note - * Every time a new dynamic interface type is added to an enumeration in the following list, - * a corresponding type name string should be added in the dynamic interface type string array. - */ -enum nss_dynamic_interface_type { - NSS_DYNAMIC_INTERFACE_TYPE_NONE, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR, - NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_5, - NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_RESERVED, - NSS_DYNAMIC_INTERFACE_TYPE_VAP, - NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_0, - NSS_DYNAMIC_INTERFACE_TYPE_PPPOE, - NSS_DYNAMIC_INTERFACE_TYPE_VIRTIF_DEPRECATED, - NSS_DYNAMIC_INTERFACE_TYPE_L2TPV2, - NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_4, - NSS_DYNAMIC_INTERFACE_TYPE_PORTID, - NSS_DYNAMIC_INTERFACE_TYPE_DTLS, - NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE, - NSS_DYNAMIC_INTERFACE_TYPE_VLAN, - NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_3, - NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_INTERNAL, - NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H, - NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N, - NSS_DYNAMIC_INTERFACE_TYPE_TUN6RD_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_TUN6RD_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER_EXCEPTION, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_US, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_GRE_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_PPTP_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_PPTP_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_PPTP_HOST_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_REDIRECT, - NSS_DYNAMIC_INTERFACE_TYPE_PVXLAN_HOST_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_PVXLAN_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_IGS, - NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_US, - NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_DS, - NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_MATCH, - NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H, - NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N, - NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0, - NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1, - NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_MIRROR, - NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS, - NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_VLAN, - NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER, - NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER, - NSS_DYNAMIC_INTERFACE_TYPE_MAX -}; - -typedef enum nss_dynamic_interface_type nss_dynamic_interface_assigned; - -/** - * nss_dynamic_interface_message_types - * Message types for dynamic interface requests. - */ -enum nss_dynamic_interface_message_types { - NSS_DYNAMIC_INTERFACE_ALLOC_NODE, - NSS_DYNAMIC_INTERFACE_DEALLOC_NODE, - NSS_DYNAMIC_INTERFACE_MAX, -}; - -/** - * nss_dynamic_interface_error_types - * Error types for dynamic interface requests. - */ -enum nss_dynamic_interface_error_types { - NSS_DYNAMIC_INTERFACE_ERR_EUNKNOWN = 1, - NSS_DYNAMIC_INTERFACE_ERR_EUNAVAIL, - NSS_DYNAMIC_INTERFACE_ERR_INVALID_TYPE, - NSS_DYNAMIC_INTERFACE_ERR_INVALID_INTERFACE_NUM, - NSS_DYNAMIC_INTERFACE_ERR_ALLOC_FUNC_UNAVAILABLE, - NSS_DYNAMIC_INTERFACE_ERR_DEALLOC_FUNC_UNAVAILABLE, - NSS_DYNAMIC_INTERFACE_ERR_EALLOC, - NSS_DYNAMIC_INTERFACE_ERR_IFNUM_TYPE_MISMATCH, - NSS_DYNAMIC_INTERFACE_ERR_MAX, -}; - -/** - * nss_dynamic_interface_stats_notification - * Dynamic interface statistics structure. - */ -struct nss_dynamic_interface_notification { - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Dynamic interface number. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ -/** - * nss_dynamic_interface_alloc_node_msg - * Message information for a dynamic interface allocation node. - */ -struct nss_dynamic_interface_alloc_node_msg { - enum nss_dynamic_interface_type type; /**< Type of dynamic interface. */ - - /* - * Response. - */ - int if_num; /**< Dynamic interface number. */ -}; - -/** - * nss_dynamic_interface_dealloc_node_msg - * Message information for dynamic interface deallocation node. - */ -struct nss_dynamic_interface_dealloc_node_msg { - enum nss_dynamic_interface_type type; - /**< Type of dynamic interface. */ - int if_num; /**< Dynamic interface number. */ -}; - -/** - * nss_dynamic_interface_msg - * Data for sending and receiving dynamic interface messages. - */ -struct nss_dynamic_interface_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a dynamic interface message. - */ - union { - struct nss_dynamic_interface_alloc_node_msg alloc_node; - /**< Allocates a dynamic node. */ - struct nss_dynamic_interface_dealloc_node_msg dealloc_node; - /**< Deallocates a dynamic node. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_dynamic_interface_alloc_node - * Allocates a node for a dynamic interface. - * - * @datatypes - * nss_dynamic_interface_type - * - * @param[in] type Type of dynamic interface. - * - * @return - * Number for the dynamic interface created. - * @par - * Otherwise, -1 for a failure. - */ -extern int nss_dynamic_interface_alloc_node(enum nss_dynamic_interface_type type); - -/** - * nss_dynamic_interface_dealloc_node - * Deallocates a node created for a dynamic interface on the NSS. - * - * @datatypes - * nss_dynamic_interface_type - * - * @param[in] if_num Dynamic interface number. - * @param[in] type Type of dynamic interface. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_dynamic_interface_dealloc_node(int if_num, enum nss_dynamic_interface_type type); - -/** - * nss_is_dynamic_interface - * Specifies whether the interface number belongs to the dynamic interface. - * - * @param[in] if_num Dynamic interface number. - * - * @return - * TRUE or FALSE - */ -extern bool nss_is_dynamic_interface(int if_num); - -/** - * nss_dynamic_interface_get_nss_ctx_by_type - * Returns NSS context corresponding to the dynamic interface type. - * - * @datatypes - * nss_dynamic_interface_type - * - * @param[in] type Type of dynamic interface. - * - * @return - * Pointer to the NSS context. - */ -extern struct nss_ctx_instance *nss_dynamic_interface_get_nss_ctx_by_type(enum nss_dynamic_interface_type type); - -/** - * nss_dynamic_interface_get_type - * Returns the type of dynamic interface. - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num Interface number of dynamic interface. - * - * @return - * Type of dynamic interface per the dynamic interface number. - */ -extern enum nss_dynamic_interface_type nss_dynamic_interface_get_type(struct nss_ctx_instance *nss_ctx, int if_num); - -/** - * nss_dynamic_interface_tx - * Transmits an asynchronous message to the firmware. - * - * @datatypes - * nss_ctx_instance \n - * nss_dynamic_interface_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_dynamic_interface_tx(struct nss_ctx_instance *nss_ctx, struct nss_dynamic_interface_msg *msg); - -/** - * Callback function for dynamic interface messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_dynamic_interface_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_dynamic_interface_msg_init - * Initializes a dynamic interface message. - * - * @datatypes - * nss_dynamic_interface_msg - * - * @param[in] ndm Pointer to the dynamic interface message. - * @param[in] if_num Dynamic interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context that is passed to the callback function. - * - * @return - * None. - */ -void nss_dynamic_interface_msg_init(struct nss_dynamic_interface_msg *ndm, uint16_t if_num, uint32_t type, uint32_t len, - void *cb, void *app_data); - -/** - * nss_dynamic_interface_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_dynamic_interface_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_dynamic_interface_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_dynamic_interface_stats_unregister_notifier(struct notifier_block *nb); -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_DYNAMIC_INTERFACE_H*/ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_edma.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_edma.h deleted file mode 100644 index d5cecf79a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_edma.h +++ /dev/null @@ -1,375 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_edma.h - * NSS EDMA interface definitions. - */ - -#ifndef __NSS_EDMA_H -#define __NSS_EDMA_H - -/** - * @addtogroup nss_edma_subsystem - * @{ - */ - -/* - * NSS EDMA port and ring defines - */ -#define NSS_EDMA_NUM_PORTS_MAX 256 - /**< Maximum number of EDMA ports. */ -#define NSS_EDMA_NUM_RX_RING_MAX 16 - /**< Maximum number of physical EDMA Rx rings. */ -#define NSS_EDMA_NUM_RXFILL_RING_MAX 8 - /**< Maximum number of physical EDMA Rx fill rings. */ -#define NSS_EDMA_NUM_TX_RING_MAX 24 - /**< Maximum number of physical EDMA Tx rings. */ -#define NSS_EDMA_NUM_TXCMPL_RING_MAX 8 - /**< Maximum number of physical EDMA Tx complete rings. */ -#define NSS_EDMA_STATS_MSG_MAX_PORTS 16 - /**< Maximum ports processed per statistics message. */ - -/** - * nss_edma_metadata_types - * Message types for EDMA requests and responses. - */ -enum nss_edma_metadata_types { - NSS_METADATA_TYPE_EDMA_PORT_STATS_SYNC, - NSS_METADATA_TYPE_EDMA_RING_STATS_SYNC, - NSS_METADATA_TYPE_EDMA_ERR_STATS_SYNC, - NSS_METADATA_TYPE_EDMA_MAX -}; - -/** - * nss_edma_port_t - * EDMA port types. - */ -enum nss_edma_port_t { - NSS_EDMA_PORT_PHYSICAL, - NSS_EDMA_PORT_VIRTUAL, - NSS_EDMA_PORT_TYPE_MAX -}; - -/** - * nss_edma_stats_tx_t - * Types of EDMA Tx ring statistics. - */ -enum nss_edma_stats_tx_t { - NSS_EDMA_STATS_TX_ERR, - NSS_EDMA_STATS_TX_DROPPED, - NSS_EDMA_STATS_TX_DESC, - NSS_EDMA_STATS_TX_MAX -}; - -/** - * nss_edma_stats_rx_t - * Types of EDMA Rx ring statistics. - */ -enum nss_edma_stats_rx_t { - NSS_EDMA_STATS_RX_CSUM_ERR, - NSS_EDMA_STATS_RX_DESC, - NSS_EDMA_STATS_RX_QOS_ERR, - NSS_EDMA_STATS_RX_SRC_PORT_INVALID, - NSS_EDMA_STATS_RX_SRC_IF_INVALID, - NSS_EDMA_STATS_RX_MAX -}; - -/** - * nss_edma_stats_txcmpl_t - * Types of EDMA Tx complete statistics. - */ -enum nss_edma_stats_txcmpl_t { - NSS_EDMA_STATS_TXCMPL_DESC, - NSS_EDMA_STATS_TXCMPL_MAX -}; - -/** - * nss_edma_stats_rxfill_t - * Types of EDMA Rx fill statistics. - */ -enum nss_edma_stats_rxfill_t { - NSS_EDMA_STATS_RXFILL_DESC, - NSS_EDMA_STATS_RXFILL_MAX -}; - -/** - * nss_edma_port_ring_map_t - * Port to EDMA ring map. - */ -enum nss_edma_port_ring_map_t { - NSS_EDMA_PORT_RX_RING, - NSS_EDMA_PORT_TX_RING, - NSS_EDMA_PORT_RING_MAP_MAX -}; - -/** - * nss_edma_err_t - * Types of EDMA error statistics. - */ -enum nss_edma_err_t { - NSS_EDMA_AXI_RD_ERR, - NSS_EDMA_AXI_WR_ERR, - NSS_EDMA_RX_DESC_FIFO_FULL_ERR, - NSS_EDMA_RX_BUF_SIZE_ERR, - NSS_EDMA_TX_SRAM_FULL_ERR, - NSS_EDMA_TX_CMPL_BUF_FULL_ERR, - NSS_EDMA_PKT_LEN_LA64K_ERR, - NSS_EDMA_PKT_LEN_LE33_ERR, - NSS_EDMA_DATA_LEN_ERR, - NSS_EDMA_ALLOC_FAIL_CNT, - NSS_EDMA_QOS_INVAL_DST_DROPS, - NSS_EDMA_ERR_STATS_MAX -}; - -/** - * nss_edma_rx_ring_stats - * EDMA Rx ring statistics. - */ -struct nss_edma_rx_ring_stats { - uint32_t rx_csum_err; /**< Number of Rx checksum errors. */ - uint32_t desc_cnt; /**< Number of descriptors processed. */ - uint32_t qos_err; /**< Number of QoS errors. */ - uint32_t rx_src_port_invalid; /**< Number of source port invalid errors. */ - uint32_t rx_src_if_invalid; /**< Number of source interface invalid errors. */ -}; - -/** - * nss_edma_tx_ring_stats - * EDMA Tx ring statistics. - */ -struct nss_edma_tx_ring_stats { - uint32_t tx_err; /**< Number of Tx errors. */ - uint32_t tx_dropped; /**< Number of Tx dropped packets. */ - uint32_t desc_cnt; /**< Number of descriptors processed. */ -}; - -/** - * nss_edma_rxfill_ring_stats - * EDMA Rx fill ring statistics. - */ -struct nss_edma_rxfill_ring_stats { - uint32_t desc_cnt; /**< Number of descriptors processed. */ -}; - -/** - * nss_edma_txcmpl_ring_stats - * EDMA Tx complete ring statistics. - */ -struct nss_edma_txcmpl_ring_stats { - uint32_t desc_cnt; /**< Number of descriptors processed. */ -}; - -/** - * nss_edma_port_stats - * Statistics for each EDMA port. - */ -struct nss_edma_port_stats { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - enum nss_edma_port_t port_type; /**< Type of port. */ - uint16_t edma_rx_ring; /**< Rx ring statistics. */ - uint16_t edma_tx_ring; /**< Tx ring statistics. */ -}; - -/** - * nss_edma_port_stats_sync - * Statistics for a group of EDMA ports. - */ -struct nss_edma_port_stats_sync { - uint16_t start_port; /**< Starting index of the subset. */ - uint16_t end_port; /**< Ending index of the subset. */ - struct nss_edma_port_stats port_stats[]; - /**< Subset of EDMA port statistics. */ -}; - -/** - * nss_edma_ring_stats_sync - * EDMA ring statistics. - */ -struct nss_edma_ring_stats_sync { - struct nss_edma_tx_ring_stats tx_ring[NSS_EDMA_NUM_TX_RING_MAX]; - /**< EDMA Tx ring statistics. */ - struct nss_edma_rx_ring_stats rx_ring[NSS_EDMA_NUM_RX_RING_MAX]; - /**< EDMA Rx ring statistics. */ - struct nss_edma_txcmpl_ring_stats txcmpl_ring[NSS_EDMA_NUM_TXCMPL_RING_MAX]; - /**< EDMA Tx complete ring statistics. */ - struct nss_edma_rxfill_ring_stats rxfill_ring[NSS_EDMA_NUM_RXFILL_RING_MAX]; - /**< EDMA Rx fill ring statistics. */ -}; - -/** - * nss_edma_misc_err_stats - * EDMA error statistics. - */ -struct nss_edma_misc_err_stats { - uint32_t axi_rd_err; /**< EDMA AXI read error. */ - uint32_t axi_wr_err; /**< EDMA AXI write error. */ - uint32_t rx_desc_fifo_full_err; /**< EDMA receive descriptor FIFO full error. */ - uint32_t rx_buf_size_err; /**< EDMA receive buffer size error. */ - uint32_t tx_sram_full_err; /**< EDMA transmit SRAM full error. */ - uint32_t tx_cmpl_buf_full_err; /**< EDMA transmit completion buffer full error. */ - uint32_t pkt_len_la64k_err; /**< EDMA packet length greater than 64k error. */ - uint32_t pkt_len_le33_err; /**< EDMA packet length smaller than 33b error. */ - uint32_t data_len_err; /**< EDMA data length error. */ - uint32_t alloc_fail_cnt; /**< EDMA number of times the allocation of pbuf for statistics failed. */ - uint32_t qos_inval_dst_drops; /**< EDMA number of QoS packet dropped due to invalid destination. */ -}; - -/** - * nss_edma_err_stats_sync - * Message for error statistics. - */ -struct nss_edma_err_stats_sync { - struct nss_edma_misc_err_stats msg_err_stats; /**< Message for error statistics. */ -}; - -/** - * nss_edma_msg - * Data for sending and receiving EDMA messages (to synchronize with - * the firmware EDMA). - */ -struct nss_edma_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of an EDMA message. - */ - union { - struct nss_edma_port_stats_sync port_stats; - /**< EDMA port statistics message payload. */ - struct nss_edma_ring_stats_sync ring_stats; - /**< EDMA ring statistics message payload. */ - struct nss_edma_err_stats_sync err_stats; - /**< EDMA error statistics message payload. */ - } msg; /**< EDMA message payload. */ -}; - -/** - * nss_edma_port_info - * NSS EDMA port statistics. - */ -struct nss_edma_port_info { - uint64_t port_stats[NSS_STATS_NODE_MAX]; /**< EDMA port statistics. */ - uint64_t port_type; /**< EDMA port type. */ - uint64_t port_ring_map[NSS_EDMA_PORT_RING_MAP_MAX]; /**< EDMA ring statistics. */ -}; - -/** - * nss_edma_stats - * NSS EDMA node statistics. - */ -struct nss_edma_stats { - struct nss_edma_port_info port[NSS_EDMA_NUM_PORTS_MAX]; - /**< EDMA port statistics. */ - uint64_t tx_stats[NSS_EDMA_NUM_TX_RING_MAX][NSS_EDMA_STATS_TX_MAX]; - /**< Physical EDMA Tx ring statistics. */ - uint64_t rx_stats[NSS_EDMA_NUM_RX_RING_MAX][NSS_EDMA_STATS_RX_MAX]; - /**< Physical EDMA Rx ring statistics. */ - uint64_t txcmpl_stats[NSS_EDMA_NUM_TXCMPL_RING_MAX][NSS_EDMA_STATS_TXCMPL_MAX]; - /**< Physical EDMA Tx complete statistics. */ - uint64_t rxfill_stats[NSS_EDMA_NUM_RXFILL_RING_MAX][NSS_EDMA_STATS_RXFILL_MAX]; - /**< Physical EDMA Rx fill statistics. */ - uint64_t misc_err[NSS_EDMA_ERR_STATS_MAX]; - /**< EDMA error complete statistics. */ -}; - -#ifdef __KERNEL__ - -/** - * Callback function for receiving EDMA messages. - * - * @datatypes - * nss_edma_msg - * - * @param[in] app_data Pointer to the application context for this message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_edma_msg_callback_t)(void *app_data, struct nss_edma_msg *msg); - -/** - * nss_edma_notify_register - * Registers a callback notifier with the NSS for sending and receiving messages. - * - * @datatypes - * nss_edma_msg_callback_t - * - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context for this message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_edma_notify_register(nss_edma_msg_callback_t cb, void *app_data); - -/** - * nss_edma_notify_unregister - * Deregisters a callback notifier from the NSS. - * - * @return - * None. - * - * @dependencies - * The callback notifier must have been previously registered. - */ -extern void nss_edma_notify_unregister(void); - -/** - * nss_edma_get_stats - * Sends EDMA statistics to NSS clients. - * - * @param[in] stats EDMA statistics to be sent to Netlink. - * @param[in] port_id EDMA port ID. - * - * @return - * None. - */ -void nss_edma_get_stats(uint64_t *stats, int port_id); - -/** - * nss_edma_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_edma_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_edma_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_edma_stats_unregister_notifier(struct notifier_block *nb); - -#endif /* __KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_EDMA_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_eth_rx.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_eth_rx.h deleted file mode 100644 index 90f5a5381..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_eth_rx.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_eth_rx.h - * NSS Ethernet interface definitions. - */ - -#ifndef __NSS_ETH_RX_H -#define __NSS_ETH_RX_H - -/** - * @addtogroup nss_eth_rx_subsystem - * @{ - */ - -/** - * nss_eth_rx_stats - * Ethernet node statistics. - */ -enum nss_eth_rx_stats { - NSS_ETH_RX_STATS_TOTAL_TICKS, /**< Total clock ticks spent inside the Ethernet package. */ - NSS_ETH_RX_STATS_WORST_CASE_TICKS, /**< Worst case iteration of the Ethernet in ticks. */ - NSS_ETH_RX_STATS_ITERATIONS, /**< Number of iterations around Ethernet. */ - NSS_ETH_RX_STATS_MAX, /**< Maximum message type. */ -}; - -/** - * nss_eth_rx_exception_events - * Exception events from bridge or route handler. - */ -enum nss_eth_rx_exception_events { - NSS_ETH_RX_EXCEPTION_EVENT_UNKNOWN_L3_PROTOCOL, - NSS_ETH_RX_EXCEPTION_EVENT_ETH_HDR_MISSING, - NSS_ETH_RX_EXCEPTION_EVENT_VLAN_MISSING, - NSS_ETH_RX_EXCEPTION_EVENT_TRUSTSEC_HDR_MISSING, - NSS_ETH_RX_EXCEPTION_EVENT_MAX, -}; - -/** - * nss_eth_rx_stats_notification - * Data for sending Ethernet statistics. - */ -struct nss_eth_rx_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t cmn_node_stats[NSS_STATS_NODE_MAX]; /**< Node statistics. */ - uint64_t special_stats[NSS_ETH_RX_STATS_MAX]; /**< Special statistics. */ - uint64_t exception_stats[NSS_ETH_RX_EXCEPTION_EVENT_MAX]; /**< Exception statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ -/** - * nss_eth_rx_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_eth_rx_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_eth_rx_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_eth_rx_stats_unregister_notifier(struct notifier_block *nb); -#endif /*__KERNEL__ */ - -/** - *@} - */ - -#endif /* __NSS_ETH_RX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_freq.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_freq.h deleted file mode 100644 index 6ce11b1b8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_freq.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * @file nss_freq.h - * NSS frequency definitions. - */ - -#ifndef __NSS_FREQ_H -#define __NSS_FREQ_H - -/** - * @addtogroup nss_freq_subsystem - * @{ - */ - -/** - * nss_freq_change - * Changes the frequency of the NSS cores. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] eng Frequency value in Hz. - * @param[in] stats_enable Enable NSS to send scaling statistics. - * @param[in] start_or_end Start or end of the frequency change. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_freq_change(struct nss_ctx_instance *nss_ctx, uint32_t eng, uint32_t stats_enable, uint32_t start_or_end); - -/** - * nss_freq_get_cpu_usage - * Returns the CPU usage value in percentage at any instance for a required core. Range of usage is 0-100. - * - * @param[in] core_id NSS Core ID. - * - * @return - * CPU usage value in percentage averaged over 1 second. -1 in case of error. - * @note - * This API does not support gathering CPU usage data for core 1. - */ -extern int8_t nss_freq_get_cpu_usage(uint32_t core_id); - -/** - * @} - */ - -#endif /* __NSS_FREQ_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre.h deleted file mode 100644 index 986166835..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre.h +++ /dev/null @@ -1,494 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -/** - * @file nss_gre.h - * NSS GRE interface definitions. - */ -#ifndef _NSS_GRE_H_ -#define _NSS_GRE_H_ - -#include -#include - -/** - * @addtogroup nss_gre_subsystem - * @{ - */ - -/** - * Maximum number of session debug statistics - */ -#define NSS_GRE_MAX_DEBUG_SESSION_STATS 16 - -/** - * GRE flags - */ -#define NSS_GRE_CONFIG_IKEY_VALID 0x00000001 /**< Incoming key of GRE header. */ -#define NSS_GRE_CONFIG_OKEY_VALID 0x00000002 /**< Key for outgoing GRE header. */ -#define NSS_GRE_CONFIG_ISEQ_VALID 0x00000004 /**< Enable sequence checking for incoming GRE traffic. */ -#define NSS_GRE_CONFIG_OSEQ_VALID 0x00000008 /**< Add sequence number for out going GRE packets. */ -#define NSS_GRE_CONFIG_ICSUM_VALID 0x00000010 /**< Validate incoming GRE header checksum. */ -#define NSS_GRE_CONFIG_OCSUM_VALID 0x00000020 /**< Add checksum header to GRE header. */ -#define NSS_GRE_CONFIG_TOS_INHERIT 0x00000040 /**< Inherit inner IP TOS to tunnel header, if not set configure provided TOS. */ -#define NSS_GRE_CONFIG_TTL_INHERIT 0x00000080 /**< Inherit inner IP TTL to tunnel header, if not set configure provided TTL. */ -#define NSS_GRE_CONFIG_SET_DF 0x00000100 /**< Enable DF bit on tunnel IP header. */ -#define NSS_GRE_CONFIG_SET_MAC 0x00000200 /**< Add MAC header to GRE+IP tunnel header. */ -#define NSS_GRE_CONFIG_SET_PADDING 0x00000400 /**< Add PADDING to align tunnel IP/GRE header. */ -#define NSS_GRE_CONFIG_NEXT_NODE_AVAILABLE 0x00000800 /**< Use provided next node instead of existing next node. */ -#define NSS_GRE_CONFIG_COPY_METADATA 0x00001000 /**< Enable metadata copy in NSS during alignment. */ -#define NSS_GRE_CONFIG_USE_UNALIGNED 0x00002000 /**< Use unaligned infrastructure in NSS. */ -#define NSS_GRE_CONFIG_DSCP_VALID 0x00004000 /**< Add DSCP per packet. */ - -/** - * nss_gre_error_types. - * Error types for GRE configuration messages. - */ -enum nss_gre_error_types { - NSS_GRE_ERR_UNKNOWN_MSG = 1, /**< Unknown message. */ - NSS_GRE_ERR_IF_INVALID = 2, /**< Invalid interface. */ - NSS_GRE_ERR_MODE_INVALID = 3, /**< Invalid mode type. */ - NSS_GRE_ERR_IP_INVALID = 4, /**< Invalid IP type. */ - NSS_GRE_ERR_GRE_SESSION_PARAMS_INVALID = 5, /**< Invalid GRE session parameters provided. */ - NSS_GRE_ERR_DSCP_CFG_INVALID = 6, /**< Both TOS and DSCP flags are enabled. */ - NSS_GRE_ERR_MAX, /**< Maximum GRE error. */ -}; - -/** - * nss_gre_info - * GRE private information. - */ -struct nss_gre_info { - /** - * Union of IPv4/IPv6 tunnel. - */ - union { - struct ip_tunnel t4; /**< IPv4 tunnel. */ - struct ip6_tnl t6; /**< IPv6 tunnel. */ - } t; /**< IPv4 and IPv6 tunnel. */ - int nss_if_number_inner; /**< NSS interface number for GRE inner. */ - struct net_device *next_dev_inner; /**< Next network device for inner flow. */ - struct net_device *next_dev_outer; /**< Next network device for outer flow. */ - uint8_t gre_hlen; /**< GRE header length. */ - uint8_t pad_len; /**< Pad length. */ -}; - -/** - * nss_gre_msg_types - * Message types for GRE requests and responses. - */ -enum nss_gre_msg_types { - NSS_GRE_MSG_ENCAP_CONFIGURE = NSS_IF_MAX_MSG_TYPES + 1, - NSS_GRE_MSG_DECAP_CONFIGURE, - NSS_GRE_MSG_ENCAP_DECONFIGURE, - NSS_GRE_MSG_DECAP_DECONFIGURE, - NSS_GRE_MSG_SESSION_STATS, - NSS_GRE_MSG_BASE_STATS, - NSS_GRE_MSG_MAX -}; - -/** - * GRE Mode Types - */ -enum nss_gre_mode { - NSS_GRE_MODE_TUN, /**< GRE Tunnel interface. */ - NSS_GRE_MODE_TAP, /**< GRE Tap interface. */ - NSS_GRE_MODE_MAX /**< Maxmum GRE mode. */ -}; - -/** - * GRE IP Types - */ -enum nss_gre_ip_types { - NSS_GRE_IP_IPV4, /**< Outer Tunnel is IPV4. */ - NSS_GRE_IP_IPV6, /**< Outer Tunnel is IPV6. */ - NSS_GRE_IP_MAX, /**< Maximum IP Types. */ -}; - -/** - * nss_gre_base_types - * GRE base debug statistics. - */ -enum nss_gre_base_types { - NSS_GRE_BASE_RX_PACKETS, /**< Receive packet count. */ - NSS_GRE_BASE_RX_DROPPED, /**< Number of packet dropped at receive. */ - NSS_GRE_BASE_EXP_ETH_HDR_MISSING, /**< Ethernet header missing. */ - NSS_GRE_BASE_EXP_ETH_TYPE_NON_IP, /**< Packet is not IPV4 or IPV6. */ - NSS_GRE_BASE_EXP_IP_UNKNOWN_PROTOCOL, /**< Packet protocol is unknown. */ - NSS_GRE_BASE_EXP_IP_HEADER_INCOMPLETE, /**< Bad IP header. */ - NSS_GRE_BASE_EXP_IP_BAD_TOTAL_LENGTH, /**< IP total length is invalid. */ - NSS_GRE_BASE_EXP_IP_BAD_CHECKSUM, /**< IP checksum is bad. */ - NSS_GRE_BASE_EXP_IP_DATAGRAM_INCOMPLETE,/**< Bad packet. */ - NSS_GRE_BASE_EXP_IP_FRAGMENT, /**< IP packet is a fragment. */ - NSS_GRE_BASE_EXP_IP_OPTIONS_INCOMPLETE, /**< IP option is invalid. */ - NSS_GRE_BASE_EXP_IP_WITH_OPTIONS, /**< IP packet with options. */ - NSS_GRE_BASE_EXP_IPV6_UNKNOWN_PROTOCOL, /**< Protocol is unknown. */ - NSS_GRE_BASE_EXP_IPV6_HEADER_INCOMPLETE,/**< Incomplete ipv6 header. */ - NSS_GRE_BASE_EXP_GRE_UNKNOWN_SESSION, /**< Unknown GRE session. */ - NSS_GRE_BASE_EXP_GRE_NODE_INACTIVE, /**< GRE node is inactive. */ - NSS_GRE_BASE_DEBUG_MAX, /**< GRE base debug maximum. */ -}; - -/** - * nss_gre_session_types - * GRE session packet drop and exception events. - */ -enum nss_gre_session_types { - NSS_GRE_SESSION_PBUF_ALLOC_FAIL, /**< Pbuf allocation failure. */ - NSS_GRE_SESSION_DECAP_FORWARD_ENQUEUE_FAIL, /**< Receive forward enqueue failure. */ - NSS_GRE_SESSION_ENCAP_FORWARD_ENQUEUE_FAIL, /**< Transmit forward enqueue failure. */ - NSS_GRE_SESSION_DECAP_TX_FORWARDED, /**< Number of packets forwarded after decapsulation. */ - NSS_GRE_SESSION_ENCAP_RX_RECEIVED, /**< Number of packets received for encapsulation. */ - NSS_GRE_SESSION_ENCAP_RX_DROPPED, /**< Packets dropped while enqueuing for encapsulation. */ - NSS_GRE_SESSION_ENCAP_RX_LINEAR_FAIL, /**< Packets dropped during encapsulation linearization. */ - NSS_GRE_SESSION_EXP_RX_KEY_ERROR, /**< Receive key error. */ - NSS_GRE_SESSION_EXP_RX_SEQ_ERROR, /**< Receive Sequence number error. */ - NSS_GRE_SESSION_EXP_RX_CS_ERROR, /**< Receive checksum error */ - NSS_GRE_SESSION_EXP_RX_FLAG_MISMATCH, /**< Receive flag mismatch. */ - NSS_GRE_SESSION_EXP_RX_MALFORMED, /**< Receive packet is malformed. */ - NSS_GRE_SESSION_EXP_RX_INVALID_PROTOCOL, /**< Receive packet protocol is invalid. */ - NSS_GRE_SESSION_EXP_RX_NO_HEADROOM, /**< Packet does not have enough headroom. */ - NSS_GRE_SESSION_DEBUG_MAX, /**< Session debug maximum. */ -}; - -/** - * GRE create message structure. - */ -struct nss_gre_config_msg { - uint32_t src_ip[4]; /**< Source IPv4 or IPv6 Adddress. */ - uint32_t dest_ip[4]; /**< Destination IPv4 or IPv6 Adddress. */ - uint32_t flags; /**< GRE Flags. */ - uint32_t ikey; /**< GRE rx KEY.*/ - uint32_t okey; /**< GRE tx KEY. */ - uint32_t mode; /**< GRE TUN or TAP. */ - uint32_t ip_type; /**< IPv4 or IPv6 type. */ - uint32_t next_node_if_num; /**< To whom to forward packets. */ - uint32_t sibling_if_num; /**< Sibling interface number. */ - uint16_t src_mac[3]; /**< Source MAC address. */ - uint16_t dest_mac[3]; /**< Destination MAC address. */ - uint8_t ttl; /**< TTL or HOPLIMIT. */ - uint8_t tos; /**< Type of service. */ - uint16_t metadata_size; /**< Metadata copy size. */ -}; - -/** - * GRE link up message structure - */ -struct nss_gre_linkup_msg { - int if_number; /**< Interface number. */ -}; - -/** - * GRE link down message structure - */ -struct nss_gre_linkdown_msg { - int if_number; /**< Interface number. */ -}; - -/** - * GRE deconfig message structure - */ -struct nss_gre_deconfig_msg { - int if_number; /**< Interface number */ -}; - -/** - * GRE session statistics message - */ -struct nss_gre_session_stats_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t stats[NSS_GRE_SESSION_DEBUG_MAX]; /**< Session debug statistics. */ -}; - -/** - * GRE base statistics message - */ -struct nss_gre_base_stats_msg { - uint32_t stats[NSS_GRE_BASE_DEBUG_MAX]; /**< Base debug statistics. */ -}; - -/** - * nss_gre_base_stats_notification - * GRE transmission statistics structure. - */ -struct nss_gre_base_stats_notification { - uint64_t stats_base_ctx[NSS_GRE_BASE_DEBUG_MAX]; /**< Base debug transmission statistics. */ - uint32_t core_id; /**< Core ID. */ -}; - -/** - * nss_gre_session_stats_notification - * GRE transmission statistics structure. - */ -struct nss_gre_session_stats_notification { - uint64_t stats_session_ctx[NSS_GRE_SESSION_DEBUG_MAX]; /**< Session debug transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_gre_msg - * Message structure to send/receive GRE messages - */ -struct nss_gre_msg { - struct nss_cmn_msg cm; /**< Common message header */ - - /** - * Payload of a GRE message. - */ - union { - struct nss_gre_config_msg cmsg; /**< GRE session config message. */ - struct nss_gre_deconfig_msg dmsg; /**< GRE session deconfig message. */ - struct nss_gre_linkup_msg linkup; /**< GRE link up message. */ - struct nss_gre_linkdown_msg linkdown; /**< GRE link down message. */ - struct nss_gre_session_stats_msg sstats; /**< GRE session statistics message. */ - struct nss_gre_base_stats_msg bstats; /**< Base statistics message. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function to receive GRE messages - * - * @datatypes - * nss_gre_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_gre_msg_callback_t)(void *app_data, struct nss_gre_msg *msg); - -/** - * nss_gre_tx_msg - * Sends GRE messages to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_msg *msg); - -/** - * nss_gre_tx_msg_sync - * Sends GRE messages to the NSS synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_msg *msg); - -/** - * nss_gre_tx_buf - * Sends packet to the NSS - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num Nss interface number. - * @param[in] skb Pointer to sk_buff. - * - * @return Tx status - */ -extern nss_tx_status_t nss_gre_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb); - -/** - * nss_gre_get_context. - * Gets the GRE context used in nss_gre_tx. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_gre_get_context(void); - -/** - * - * nss_gre_ifnum_with_core_id - * Append core ID on GRE interface. - * - * @param[in] if_num NSS interface number. - * - * @return - * GRE interface number with core ID. - */ -extern int nss_gre_ifnum_with_core_id(int if_num); - -/** - * Callback function for receiving GRE session data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_gre_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_gre_register_if - * Registers the GRE interface with the NSS for sending and - * receiving messages. - * - * @datatypes - * nss_gre_data_callback_t \n - * nss_gre_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] type NSS interface type. - * @param[in] gre_callback Callback for the data. - * @param[in] msg_callback Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_gre_register_if(uint32_t if_num, uint32_t type, nss_gre_data_callback_t gre_callback, - nss_gre_msg_callback_t msg_callback, struct net_device *netdev, uint32_t features); - -/** - * nss_gre_unregister_if - * Deregisters the GRE interface from the NSS. - * - * @param[in] if_num NSS interface number. -. * - * @return - * None. - * - * @dependencies - * The tunnel interface must have been previously registered. - */ -extern void nss_gre_unregister_if(uint32_t if_num); - -/** - * nss_gre_msg_init - * Initializes a GRE message. - * - * @datatypes - * nss_gre_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num Interface number - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_gre_msg_init(struct nss_gre_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_gre_register_handler - * Registers the GRE interface with the NSS debug statistics handler. - * - * @return - * None. - */ -extern void nss_gre_register_handler(void); - -/** - * Callback function for updating stats. - * - * @datatypes - * net_device \n - * sk_buff \n - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * - * @return - * None. - */ -typedef void (*nss_gre_pkt_callback_t)(struct net_device *netdev, struct sk_buff *skb); - -/** - * nss_gre_register_pkt_callback - * Register for rx packet call back. - * - * @datatypes - * nss_gre_pkt_callback_t - * - * @param[in] cb Call back function which needs to be registered. - * - * @return - * None. - */ -extern void nss_gre_register_pkt_callback(nss_gre_pkt_callback_t cb); - -/** - * nss_gre_unregister_pkt_callback - * Unregister for rx packet call back. - * - * @datatypes - * nss_gre_pkt_callback_t - * - * @return - * None. - */ -extern void nss_gre_unregister_pkt_callback(void); - -/** - * nss_gre_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_gre_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* _NSS_GRE_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir.h deleted file mode 100644 index 5d3150bf3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir.h +++ /dev/null @@ -1,712 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2015, 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_gre_redir.h - * NSS GRE Redirect interface definitions. - */ - -#ifndef __NSS_GRE_REDIR_H -#define __NSS_GRE_REDIR_H - -/** - * @addtogroup nss_gre_redirect_subsystem - * @{ - */ - -#define NSS_GRE_REDIR_MAX_INTERFACES 24 /**< Maximum number of redirect interfaces. */ -#define NSS_GRE_REDIR_IP_DF_OVERRIDE_FLAG 0x80 /**< Override Do not Fragment bit in IPv4 flags. */ -#define NSS_GRE_REDIR_PER_PACKET_METADATA_OFFSET 4 /**< Offset of per packet metadata from start of packet. */ -#define NSS_GRE_REDIR_MAX_RADIO 5 /**< Maximum number of radios. */ -#define NSS_GRE_REDIR_HEADER_VERSION 0 /**< Version for GRE header. */ - -/** - * nss_gre_redir_ip_hdr_type - * IP header types. - */ -enum nss_gre_redir_ip_hdr_type { - NSS_GRE_REDIR_IP_HDR_TYPE_IPV4 = 1, - NSS_GRE_REDIR_IP_HDR_TYPE_IPV6 = 2, -}; - -/** - * nss_gre_redir_message_types - * Message types for GRE redirect requests and responses. - */ -enum nss_gre_redir_message_types { - NSS_GRE_REDIR_TX_TUNNEL_INNER_CONFIGURE_MSG, /**< Configure message for inner node. */ - NSS_GRE_REDIR_TX_TUNNEL_OUTER_CONFIGURE_MSG, /**< Configure message for outer node. */ - NSS_GRE_REDIR_TX_INTERFACE_MAP_MSG, /**< Interface map message. */ - NSS_GRE_REDIR_TX_INTERFACE_UNMAP_MSG, /**< Interface unmap message. */ - NSS_GRE_REDIR_TX_SJACK_MAP_MSG, /**< SJACK map message. */ - NSS_GRE_REDIR_TX_SJACK_UNMAP_MSG, /**< SJACK unmap message. */ - NSS_GRE_REDIR_RX_STATS_SYNC_MSG, /**< Statistics synchronization message. */ - NSS_GRE_REDIR_EXCEPTION_DS_REG_CB_MSG, /**< Configure message to register callback. */ - NSS_GRE_REDIR_MAX_MSG_TYPES, /**< Maximum message type. */ -}; - -/** - * nss_gre_redir_error_types - * Error types for GRE redirect configuration messages. - */ -enum nss_gre_redir_error_types { - NSS_GRE_REDIR_ERROR_NONE, /**< Configuration successful. */ - NSS_GRE_REDIR_ERROR_UNKNOWN_MSG_TYPE, /**< Unknown configuration message type error. */ - NSS_GRE_REDIR_ERROR_INVALID_IP_HDR_TYPE, /**< Invalid IP header type error. */ - NSS_GRE_REDIR_ERROR_MAP_TABLE_FULL, /**< Map table full error. */ - NSS_GRE_REDIR_ERROR_MAP_INVALID_PARAM, /**< Invalid parameter with map message error. */ - NSS_GRE_REDIR_ERROR_UNMAP_INVALID_PARAM, /**< Invalid parameter with unmap message error. */ - NSS_GRE_REDIR_ERROR_ENCAP_MAP_EXIST, /**< Encapsulation map entry already exist. */ - NSS_GRE_REDIR_ERROR_DECAP_MAP_EXIST, /**< Decapsulation map entry already exist. */ - NSS_GRE_REDIR_ERROR_ENCAP_MAP_ALLOC_FAIL, /**< Encapsulation map entry allocation failure error. */ - NSS_GRE_REDIR_ERROR_DECAP_MAP_ALLOC_FAIL, /**< Decapsulation map entry allocation failure error. */ - NSS_GRE_REDIR_ERROR_ENCAP_ENTRY_UNMAPPED, /**< Encapsulation map entry already unmapped. */ - NSS_GRE_REDIR_ERROR_DECAP_ENTRY_UNMAPPED, /**< Decapsulation map entry already unmapped. */ - NSS_GRE_REDIR_ERROR_INVALID_ETH_IF, /**< Invalid Ethernet NSS interface. */ - NSS_GRE_REDIR_ERROR_INVALID_VAP_NEXTHOP_IF, /**< Invalid nexthop NSS interface. */ - NSS_GRE_REDIR_ERROR_INVALID_PEER_INTERFACE, /**< Invalid peer interface during tunnel configuration. */ -}; - -/** - * nss_gre_redir_tunnel_types - * GRE tunnel types. - */ -enum nss_gre_redir_tunnel_types { - NSS_GRE_REDIR_TUNNEL_TYPE_UNKNOWN, /**< Reserved. */ - NSS_GRE_REDIR_TUNNEL_TYPE_TUN, /**< Tunnel mode. */ - NSS_GRE_REDIR_TUNNEL_TYPE_DTUN, /**< D-tunnel mode. */ - NSS_GRE_REDIR_TUNNEL_TYPE_SPLIT, /**< Split mode. */ - NSS_GRE_REDIR_TUNNEL_TYPE_MAX, /**< Maximum tunnel type. */ -}; - -/** - * nss_gre_redir_stats_types - * GRE redirect statistics types. - */ -enum nss_gre_redir_stats_types { - NSS_GRE_REDIR_STATS_TX_DROPS = NSS_STATS_NODE_MAX, - /**< Dropped transmit packets. */ - NSS_GRE_REDIR_STATS_SJACK_RX_PKTS, /**< SJACK receive packet counter. */ - NSS_GRE_REDIR_STATS_SJACK_TX_PKTS, /**< SJACK transmit packet counter. */ - NSS_GRE_REDIR_STATS_OFFLOAD_RX_PKTS_0, /**< Offload receive packet counter 0. */ - NSS_GRE_REDIR_STATS_OFFLOAD_RX_PKTS_1, /**< Offload receive packet counter 1. */ - NSS_GRE_REDIR_STATS_OFFLOAD_RX_PKTS_2, /**< Offload receive packet counter 2. */ - NSS_GRE_REDIR_STATS_OFFLOAD_RX_PKTS_3, /**< Offload receive packet counter 3. */ - NSS_GRE_REDIR_STATS_OFFLOAD_RX_PKTS_4, /**< Offload receive packet counter 4. */ - NSS_GRE_REDIR_STATS_OFFLOAD_TX_PKTS_0, /**< Offload transmit packet counter 0. */ - NSS_GRE_REDIR_STATS_OFFLOAD_TX_PKTS_1, /**< Offload transmit packet counter 1. */ - NSS_GRE_REDIR_STATS_OFFLOAD_TX_PKTS_2, /**< Offload transmit packet counter 2. */ - NSS_GRE_REDIR_STATS_OFFLOAD_TX_PKTS_3, /**< Offload transmit packet counter 3. */ - NSS_GRE_REDIR_STATS_OFFLOAD_TX_PKTS_4, /**< Offload transmit packet counter 4. */ - NSS_GRE_REDIR_STATS_EXCEPTION_US_RX_PKTS, - /**< Upstream exception receive packet counter. */ - NSS_GRE_REDIR_STATS_EXCEPTION_US_TX_PKTS, - /**< Upstream exception transmit packet counter. */ - NSS_GRE_REDIR_STATS_EXCEPTION_DS_RX_PKTS, - /**< Downstream exception receive packet counter. */ - NSS_GRE_REDIR_STATS_EXCEPTION_DS_TX_PKTS, - /**< Downstream exception transmit packet counter. */ - NSS_GRE_REDIR_STATS_ENCAP_SG_ALLOC_DROP, - /**< Encapsulation drop counters due to scatter gather buffer allocation failure. */ - NSS_GRE_REDIR_STATS_DECAP_FAIL_DROP, - /**< Decapsulation drop counters due to invalid IP header. */ - NSS_GRE_REDIR_STATS_DECAP_SPLIT_DROP, - /**< Decapsulation drop counters due to split flow processing. */ - NSS_GRE_REDIR_STATS_SPLIT_SG_ALLOC_FAIL, - /**< Split processing fail counter due to scatter gather buffer allocation failure. */ - NSS_GRE_REDIR_STATS_SPLIT_LINEAR_COPY_FAIL, - /**< Split processing fail counter due to linear copy fail. */ - NSS_GRE_REDIR_STATS_SPLIT_NOT_ENOUGH_TAILROOM, - /**< Split processing fail counter due to insufficient tailroom. */ - NSS_GRE_REDIR_STATS_EXCEPTION_DS_INVALID_DST_DROP, - /**< Downstream exception handling fail counter due to invalid destination. */ - NSS_GRE_REDIR_STATS_DECAP_EAPOL_FRAMES, - /**< Decapsulation EAPoL frame counters. */ - NSS_GRE_REDIR_STATS_EXCEPTION_DS_INV_APPID, - /**< Invalid application ID for the transmit completion packets on exception downstream node. */ - NSS_GRE_REDIR_STATS_HEADROOM_UNAVAILABLE, - /**< Packet headroom unavailable to write metadata. */ - NSS_GRE_REDIR_STATS_TX_COMPLETION_SUCCESS, - /**< Host enqueue success count for the transmit completion packets. */ - NSS_GRE_REDIR_STATS_TX_COMPLETION_DROP, - /**< Host enqueue drop count for the transmit completion packets. */ - NSS_GRE_REDIR_STATS_MAX /**< Maximum statistics type. */ -}; - -/** - * nss_gre_redir_inner_configure_msg - * Message information for configuring GRE inner node. - */ -struct nss_gre_redir_inner_configure_msg { - uint32_t ip_hdr_type; /**< IP header type (IPv4 or IPv6). */ - - /** - * IPv4 or IPv6 source address (lower 4 bytes are applicable for IPv4). - */ - uint32_t ip_src_addr[4]; - - /** - * IPv4 or IPv6 destination address (lower 4 bytes are applicable for IPv4). - */ - uint32_t ip_dest_addr[4]; - - /** - * The host outer-interface which handles post-encapsulation exception packets - * originating from this inner interface. - */ - uint32_t except_outerif; - - uint8_t ip_df_policy; /**< Default Do Not Fragment policy for the IP header. */ - uint8_t ip_ttl; /**< Time-to-live value for the IP header. */ - uint8_t gre_version; /**< Header version. */ -}; - -/** - * nss_gre_redir_outer_configure_msg - * Message information for configuring GRE outer node. - */ -struct nss_gre_redir_outer_configure_msg { - uint32_t ip_hdr_type; /**< IP header type (IPv4 or IPv6). */ - - /** - * The host inner-interface which handles post-decapsulation exception packets - * originating from this outer interface, for flows destined to a VAP handled - * by host. - */ - uint32_t except_hostif; - - /** - * The host inner-interface which handles post-decapsulation exception packets - * originating from this outer interface, for flows destined to a VAP handled - * by NSS. - */ - uint32_t except_offlif; - - /** - * The host inner-interface which handles post-decapsulation exception packets - * originating from this outer interface, for flows destined to SJACK. - */ - uint32_t except_sjackif; - - /** - * CPU core to which these packets should be steered. - * - 0 -- Use core 0 - * - 1 -- Use core 1 - * - 2 -- Use core 2 - * - 3 -- Use core 3 - */ - uint8_t rps_hint; - - /** - * Flag to indicate validity of RPS hint. - */ - uint8_t rps_hint_valid; - -}; - -/** - * nss_gre_redir_exception_ds_reg_cb_msg - * Message information to register callback on VAP for GRE exception downstream. - */ -struct nss_gre_redir_exception_ds_reg_cb_msg { - uint32_t dst_vap_nssif; /**< NSS VAP interface on which the callback is registered. */ -}; - -/** - * nss_gre_redir_interface_map_msg - * Message information for adding a VAP interface-to-tunnel ID mapping. - */ -struct nss_gre_redir_interface_map_msg { - uint32_t vap_nssif; /**< NSS VAP interface. */ - uint32_t nexthop_nssif; /**< Next hop NSS interface number. */ - uint16_t radio_id; /**< Radio ID to derive tunnel ID. */ - uint16_t vap_id; /**< VAP ID to derive tunnel ID. */ - uint16_t lag_en; /**< Flag for LAG mode. */ - uint16_t tunnel_type; /**< Type of tunnel. */ - - /** - * IPsec security association pattern. Pattern - * 0x5A is supported only. - */ - uint8_t ipsec_pattern; -}; - -/** - * nss_gre_redir_interface_unmap_msg - * Message information for deleting a VAP interface-to-tunnel ID mapping. - */ -struct nss_gre_redir_interface_unmap_msg { - uint32_t vap_nssif; /**< NSS VAP interface. */ - uint16_t radio_id; /**< Radio ID to derive tunnel ID. */ - uint16_t vap_id; /**< VAP ID to derive tunnel ID. */ -}; - -/** - * nss_gre_redir_sjack_map_msg - * Message information for adding an Ethernet interface-to-tunnel ID mapping. - */ -struct nss_gre_redir_sjack_map_msg { - uint32_t eth_nssif; /**< NSS Ethernet interface number. */ - uint32_t eth_id; /**< Ethernet interface ID. */ - - /** - * IPsec security association pattern. Pattern - * 0x5A is supported only. - */ - uint8_t ipsec_pattern; -}; - -/** - * nss_gre_redir_sjack_unmap_msg - * Message information for deleting an Ethernet interface-to-tunnel ID mapping. - */ -struct nss_gre_redir_sjack_unmap_msg { - uint32_t eth_nssif; /**< NSS Ethernet interface number. */ - uint32_t eth_id; /**< Ethernet interface ID. */ -}; - -/** - * nss_gre_redir_stats_sync_msg - * Message information for synchronized GRE redirect statistics. - */ -struct nss_gre_redir_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t sjack_rx_packets; /**< SJACK packet counter. */ - uint32_t offl_rx_pkts[NSS_GRE_REDIR_MAX_RADIO]; /**< Offload packet counter. */ - uint32_t encap_sg_alloc_drop; /**< Encapsulation drop counters due to scatter gather buffer allocation failure. */ - uint32_t decap_fail_drop; /**< Decapsulation drop counters due to invalid IP header. */ - uint32_t decap_split_drop; /**< Decapsulation drop counters due to split flow processing. */ - uint32_t split_sg_alloc_fail; /**< Split processing fail counter due to scatter gather buffer allocation failure. */ - uint32_t split_linear_copy_fail; /**< Split processing fail counter due to linear copy fail. */ - uint32_t split_not_enough_tailroom; /**< Split processing fail counter due to insufficient tailroom. */ - uint32_t exception_ds_invalid_dst_drop; /**< Downstream exception handling fail counter due to invalid destination. */ - uint32_t decap_eapol_frames; /**< Decapsulation EAPoL frame counters. */ - uint32_t exception_ds_inv_appid; /**< Invalid application ID for the Tx completion packets on exception downstream node. */ - uint32_t headroom_unavail; /**< Packet headroom unavailable to write metadata. */ - uint32_t tx_completion_success; /**< Host enqueue success count for the Tx completion packets. */ - uint32_t tx_completion_drop; /**< Host enqueue drop count for the Tx completion packets. */ -}; - -/** - * nss_gre_redir_tun_stats - * GRE redirect statistics to accumulate all the stats values. - */ -struct nss_gre_redir_tun_stats { - uint64_t rx_packets; /**< Number of packets received. */ - uint64_t rx_bytes; /**< Number of bytes received. */ - uint64_t tx_packets; /**< Number of packets transmitted. */ - uint64_t tx_bytes; /**< Number of bytes transmitted. */ - uint64_t rx_dropped[NSS_MAX_NUM_PRI]; - /**< Packets dropped on receive due to queue full. */ - uint64_t tx_dropped; /**< Dropped transmit packets. */ - uint64_t sjack_rx_packets; /**< SJACK receive packet counter. */ - uint64_t sjack_tx_packets; /**< SJACK transmit packet counter. */ - uint64_t offl_rx_pkts[NSS_GRE_REDIR_MAX_RADIO]; /**< Offload receive packet counter per radio. */ - uint64_t offl_tx_pkts[NSS_GRE_REDIR_MAX_RADIO]; /**< Offload transmit packet counter per radio. */ - uint64_t exception_us_rx; /**< Upstream exception receive packet counter. */ - uint64_t exception_us_tx; /**< Upstream exception transmit packet counter. */ - uint64_t exception_ds_rx; /**< Downstream exception receive packet counter. */ - uint64_t exception_ds_tx; /**< Downstream exception transmit packet counter. */ - uint64_t encap_sg_alloc_drop; - /**< Encapsulation drop counters due to scatter gather buffer allocation failure. */ - uint64_t decap_fail_drop; /**< Decapsulation drop counters due to invalid IP header. */ - uint64_t decap_split_drop; /**< Decapsulation drop counters due to split flow processing. */ - uint64_t split_sg_alloc_fail; - /**< Split processing fail counter due to scatter gather buffer allocation failure. */ - uint64_t split_linear_copy_fail; - /**< Split processing fail counter due to linear copy fail. */ - uint64_t split_not_enough_tailroom; - /**< Split processing fail counter due to insufficient tailroom. */ - uint64_t exception_ds_invalid_dst_drop; - /**< Downstream exception handling fail counter due to invalid destination. */ - uint64_t decap_eapol_frames; /**< Decapsulation EAPoL frame counters. */ - uint64_t exception_ds_inv_appid; - /**< Invalid application ID for the transmit completion packets on exception downstream node. */ - uint64_t headroom_unavail; /**< Packet headroom unavailable to write metadata. */ - uint64_t tx_completion_success; /**< Host enqueue success count for the transmit completion packets. */ - uint64_t tx_completion_drop; /**< Host enqueue drop count for the transmit completion packets. */ -}; - -/** - * nss_gre_redir_tunnel_stats - * GRE redirect statistics as seen by the HLOS. - */ -struct nss_gre_redir_tunnel_stats { - struct net_device *dev; /**< Net device. */ - struct nss_gre_redir_tun_stats tstats; /**< Structure to accumulate all the statistics. */ - uint32_t ref_count; /**< Reference count for statistics. */ -}; - -/** - * nss_gre_redir_stats_notification - * GRE redirect transmission statistics structure. - */ -struct nss_gre_redir_stats_notification { - struct nss_gre_redir_tunnel_stats stats_ctx; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_gre_redir_msg - * Data for sending and receiving GRE tunnel redirect messages. - */ -struct nss_gre_redir_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a GRE tunnel redirect message. - */ - union { - struct nss_gre_redir_inner_configure_msg inner_configure; - /**< Configure a GRE inner node. */ - struct nss_gre_redir_outer_configure_msg outer_configure; - /**< Configure a GRE outer node. */ - struct nss_gre_redir_interface_map_msg interface_map; - /**< Add a VAP interface-to-tunnel ID mapping. */ - struct nss_gre_redir_interface_unmap_msg interface_unmap; - /**< Delete a VAP interafce-to-tunnel ID mapping. */ - struct nss_gre_redir_sjack_map_msg sjack_map; - /**< Add an Ethernet interface-to-tunnel ID mapping for SJACK. */ - struct nss_gre_redir_sjack_unmap_msg sjack_unmap; - /**< Delete an Ethernet interface-to-tunnel ID mapping for SJACK. */ - struct nss_gre_redir_stats_sync_msg stats_sync; - /**< Synchronized tunnel statistics. */ - struct nss_gre_redir_exception_ds_reg_cb_msg exception_ds_configure; - /**< Registering callback on VAP for the GRE downstream flows. */ - } msg; /**< Message payload for GRE redirect messages exchanged with NSS core. */ - -}; - -/** - * nss_gre_redir_encap_per_pkt_metadata - * Metadata information for an HLOS-to-NSS packet. - */ -struct nss_gre_redir_encap_per_pkt_metadata { - uint16_t gre_tunnel_id; /**< ID of the tunnel. */ - uint8_t gre_flags; /**< Flags field from GRE header. */ - uint8_t gre_prio; /**< Priority field from GRE header. */ - uint8_t gre_seq; /**< Sequence number. */ - uint8_t ip_dscp; /**< DSCP values. */ - - /** - * Override the default DF policy for the packet by setting bit 8. - * The lower 7 bits provide the DF value to be used for this packet. - */ - uint8_t ip_df_override; - - /** - * IPsec security association pattern. Pattern - * 0x5A is supported only. - */ - uint8_t ipsec_pattern; -}; - -/** - * nss_gre_redir_decap_per_pkt_metadata - * Metadata information for an NSS-to-HLOS packet. - */ -struct nss_gre_redir_decap_per_pkt_metadata { - uint32_t src_if_num; /**< Number of the source Ethernet interface. */ - uint16_t gre_tunnel_id; /**< ID of the tunnel. */ - uint8_t gre_flags; /**< Flags from GRE header. */ - uint8_t gre_prio; /**< Priority from GRE header. */ - uint8_t gre_seq; /**< Sequence number. */ -}; - -/** - * nss_gre_redir_exception_us_metadata - * Metadata information for upstream exception packet. - * - * Note: Additional fields need to be added by customer as required. - */ -struct nss_gre_redir_exception_us_metadata { - uint8_t tid; /**< TID value. */ -}; - -/** - * nss_gre_redir_exception_ds_metadata - * Metadata information for downstream exception packet. - * - * Note: Additional fields need to be added by customer as required. - */ -struct nss_gre_redir_exception_ds_metadata { - uint32_t dst_vap_nssif; /**< Destination VAP interface number. */ - uint8_t tid; /**< TID value. */ - uint8_t app_id; /**< Application ID. */ - uint16_t hw_hash_idx; /**< Hardware AST hash index value. */ - uint32_t tx_status; /**< Tx status. */ -}; - -/** - * Callback function for receiving GRE tunnel data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_gre_redir_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving GRE tunnel messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_gre_redir_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_gre_redir_unregister_if - * Deregisters a GRE tunnel interface from the NSS. - * - * @param[in] if_num NSS interface number. -. * - * @return - * None. - * - * @dependencies - * The tunnel interface must have been previously registered. - * - * @return - * True if successful, else false. - */ -extern bool nss_gre_redir_unregister_if(uint32_t if_num); - -/** - * nss_gre_redir_tx_msg - * Sends GRE redirect tunnel messages. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_redir_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_msg *msg); - -/** - * nss_gre_redir_tx_buf - * Sends GRE redirect tunnel packets. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] os_buf Pointer to the OS buffer (e.g., skbuff). - * @param[in] if_num Tunnel interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, - uint32_t if_num); - -/** - * nss_gre_redir_tx_buf_noreuse - * Sends GRE redirect tunnel packets. - * - * Note: The buffers will be not be reused or - * kept in the accelerator. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] os_buf Pointer to the OS buffer (e.g., skbuff). - * @param[in] if_num Tunnel interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_tx_buf_noreuse(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, - uint32_t if_num); - -/** - * nss_gre_redir_stats_get - * Gets GRE redirect tunnel statistics. - * - * @datatypes - * nss_gre_redir_tunnel_stats - * - * @param[in] index Index in the tunnel statistics array. - * @param[out] stats Pointer to the tunnel statistics. - * - * @return - * TRUE or FALSE. - */ -extern bool nss_gre_redir_stats_get(int index, struct nss_gre_redir_tunnel_stats *stats); - -/** - * nss_gre_redir_alloc_and_register_node - * Allocates and registers GRE redirect dynamic node with NSS. - * - * @datatypes - * net_device \n - * nss_gre_redir_data_callback_t \n - * nss_gre_redir_msg_callback_t \n - * - * @param[in] dev Pointer to the associated network device. - * @param[in] data_cb Callback for the data. - * @param[in] msg_cb Callback for the message. - * @param[in] type Type of dynamic node. - * @param[in] app_ctx Application context for notify callback. - * - * @return - * NSS interface number allocated. - */ -extern int nss_gre_redir_alloc_and_register_node(struct net_device *dev, - nss_gre_redir_data_callback_t data_cb, - nss_gre_redir_msg_callback_t msg_cb, - uint32_t type, void *app_ctx); - -/** - * nss_gre_redir_configure_inner_node - * Configures inner GRE redirect node. - * - * @datatypes - * nss_gre_redir_inner_configure_msg - * - * @param[in] ifnum NSS interface number. - * @param[in] ngrcm Inner node configuration message. - * - * @return - * Status of Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_configure_inner_node(int ifnum, - struct nss_gre_redir_inner_configure_msg *ngrcm); - -/** - * nss_gre_redir_configure_outer_node - * Configures outer GRE redirect node. - * - * @datatypes - * nss_gre_redir_outer_configure_msg - * - * @param[in] ifnum NSS interface number. - * @param[in] ngrcm Outer node configuration message. - * - * @return - * Status of Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_configure_outer_node(int ifnum, - struct nss_gre_redir_outer_configure_msg *ngrcm); - -/** - * nss_gre_redir_exception_ds_reg_cb - * Configure a callback on VAP for downstream GRE exception flows. - * - * @datatypes - * nss_gre_redir_exception_ds_reg_cb_msg - * - * @param[in] ifnum NSS interface number. - * @param[in] ngrcm Downstream exception callback registration message. - * - * @return - * Status of Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_exception_ds_reg_cb(int ifnum, - struct nss_gre_redir_exception_ds_reg_cb_msg *ngrcm); - -/** - * nss_gre_redir_tx_msg_sync - * Sends messages to NSS firmware synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_redir_msg - * - * @param[in] nss_ctx NSS core context. - * @param[in] ngrm Pointer to GRE redirect message data. - * - * @return - * Status of Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_msg *ngrm); - -/** - * nss_gre_redir_get_context - * Gets the GRE redirect context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_gre_redir_get_context(void); - -/** - * nss_gre_redir_get_dentry - * Returns directory entry created in debugfs for statistics. - * - * @return - * Pointer to created directory entry for GRE redirect. - */ -extern struct dentry *nss_gre_redir_get_dentry(void); - -/** - * nss_gre_redir_get_device - * Gets the original device from probe. - * - * @return - * Pointer to the device. - */ -extern struct device *nss_gre_redir_get_device(void); - -/** - * nss_gre_redir_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_redir_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_gre_redir_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_redir_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* __NSS_GRE_REDIR_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir_lag.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir_lag.h deleted file mode 100644 index b10264dcf..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir_lag.h +++ /dev/null @@ -1,732 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_gre_redir_lag.h - * NSS GRE redirect LAG interface definitions. - */ - -#ifndef __NSS_GRE_REDIR_LAG_H -#define __NSS_GRE_REDIR_LAG_H - -/** - * @addtogroup nss_gre_redirect_subsystem - * @{ - */ - -#define NSS_GRE_REDIR_LAG_MAX_NODE 12 /**< Maximum number of LAG nodes. */ -#define NSS_GRE_REDIR_LAG_MAX_SLAVE 8 /**< Maximum number of GRE redirect nodes per LAG node. */ -#define NSS_GRE_REDIR_LAG_MIN_SLAVE 2 /**< Minimum required GRE redirect nodes per LAG node. */ -#define NSS_GRE_REDIR_LAG_US_STATS_SYNC_RETRY 3 /**< Number of retries for sending query hash messages. */ -#define NSS_GRE_REDIR_LAG_US_MAX_HASH_PER_MSG 80 /**< Maximum hash entries per message. */ - -/* - * nss_gre_redir_lag_err_types - * GRE redirect LAG error types. - */ -enum nss_gre_redir_lag_err_types { - NSS_GRE_REDIR_LAG_SUCCESS, - NSS_GRE_REDIR_LAG_ERR_INCORRECT_IFNUM, - NSS_GRE_REDIR_LAG_ERR_CORE_UNREGISTER_FAILED, - NSS_GRE_REDIR_LAG_ERR_STATS_INDEX_NOT_FOUND, - NSS_GRE_REDIR_LAG_ERR_DEALLOC_FAILED, - NSS_GRE_REDIR_LAG_ERR_MAX, -}; - -/** - * nss_gre_redir_lag_us_message_types - * GRE redirect LAG upstream message types. - */ -enum nss_gre_redir_lag_us_message_types { - NSS_GRE_REDIR_LAG_US_CONFIG_MSG, - NSS_GRE_REDIR_LAG_US_ADD_HASH_NODE_MSG, - NSS_GRE_REDIR_LAG_US_DEL_HASH_NODE_MSG, - NSS_GRE_REDIR_LAG_US_QUERY_HASH_NODE_MSG, - NSS_GRE_REDIR_LAG_US_CMN_STATS_SYNC_MSG, - NSS_GRE_REDIR_LAG_US_DB_HASH_NODE_MSG, - NSS_GRE_REDIR_LAG_US_MAX_MSG_TYPES, -}; - -/** - * nss_gre_redir_lag_ds_message_types - * GRE redirect LAG downstream message types. - */ -enum nss_gre_redir_lag_ds_message_types { - NSS_GRE_REDIR_LAG_DS_ADD_STA_MSG, - NSS_GRE_REDIR_LAG_DS_DEL_STA_MSG, - NSS_GRE_REDIR_LAG_DS_UPDATE_STA_MSG, - NSS_GRE_REDIR_LAG_DS_STATS_SYNC_MSG, - NSS_GRE_REDIR_LAG_DS_MAX_MSG_TYPES, -}; - -/** - * nss_gre_redir_lag_ds_stats_types - * GRE redirect LAG downstream statistics. - */ -enum nss_gre_redir_lag_ds_stats_types { - NSS_GRE_REDIR_LAG_DS_STATS_DST_INVALID = NSS_STATS_NODE_MAX, - /**< Packets that do not have a valid destination. */ - NSS_GRE_REDIR_LAG_DS_STATS_EXCEPTION_PKT, /**< Packets that are exceptioned to host. */ - NSS_GRE_REDIR_LAG_DS_STATS_MAX, /**< Maximum statistics type. */ -}; - -/** - * nss_gre_redir_lag_us_stats_types - * GRE redirect LAG upstream statistics. - */ -enum nss_gre_redir_lag_us_stats_types { - NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS = NSS_STATS_NODE_MAX, - /**< Number of AMSDU packets seen. */ - NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS_ENQUEUED, /**< Number of AMSDU packets enqueued. */ - NSS_GRE_REDIR_LAG_US_STATS_AMSDU_PKTS_EXCEPTIONED, - /**< Number of AMSDU packets exceptioned. */ - NSS_GRE_REDIR_LAG_US_STATS_EXCEPTIONED, /**< Number of exceptioned packets. */ - NSS_GRE_REDIR_LAG_US_STATS_FREED, /**< Freed packets when equeue to NSS to host fails. */ - NSS_GRE_REDIR_LAG_US_STATS_ADD_ATTEMPT, /**< Add hash attempts. */ - NSS_GRE_REDIR_LAG_US_STATS_ADD_SUCCESS, /**< Add hash success. */ - NSS_GRE_REDIR_LAG_US_STATS_ADD_FAIL_TABLE_FULL, /**< Add hash failed due to full table. */ - NSS_GRE_REDIR_LAG_US_STATS_ADD_FAIL_EXISTS, /**< Add hash failed as entry already exists. */ - NSS_GRE_REDIR_LAG_US_STATS_DEL_ATTEMPT, /**< Delete hash attempts. */ - NSS_GRE_REDIR_LAG_US_STATS_DEL_SUCCESS, /**< Delete hash success. */ - NSS_GRE_REDIR_LAG_US_STATS_DEL_FAIL_NOT_FOUND, /**< Delete hash failed as entry not found in hash table. */ - NSS_GRE_REDIR_LAG_US_STATS_MAX, /**< Maximum statistics type. */ -}; - -/** - * nss_gre_redir_lag_us_hash_mode - * GRE redirect LAG upstream hash modes. - */ -enum nss_gre_redir_lag_us_hash_mode { - NSS_GRE_REDIR_LAG_US_HASH_MODE_SRC_AND_DEST, - NSS_GRE_REDIR_LAG_US_HASH_MODE_SRC, - NSS_GRE_REDIR_LAG_US_HASH_MODE_DEST, - NSS_GRE_REDIR_LAG_US_HASH_MODE_MAX, -}; - -/** - * nss_gre_redir_lag_us_config_msg - * Upstream configure message. - */ -struct nss_gre_redir_lag_us_config_msg { - uint32_t hash_mode; /**< Hash operating mode. */ - uint32_t num_slaves; /**< Number of slaves. */ - uint32_t if_num[NSS_GRE_REDIR_LAG_MAX_SLAVE]; /**< NSS interface numbers of GRE redirect tunnels. */ -}; - -/** - * nss_gre_redir_lag_us_add_hash_node_msg - * Message to add hash entry. - */ -struct nss_gre_redir_lag_us_add_hash_node_msg { - uint32_t if_num; /**< NSS interface number of GRE redirect. */ - uint16_t src_mac[ETH_ALEN / 2]; /**< Source MAC address. */ - uint16_t dest_mac[ETH_ALEN / 2]; /**< Destination MAC address. */ -}; - -/** - * nss_gre_redir_lag_us_del_hash_node_msg - * Message to delete hash entry. - */ -struct nss_gre_redir_lag_us_del_hash_node_msg { - uint16_t src_mac[ETH_ALEN / 2]; /**< Source MAC address. */ - uint16_t dest_mac[ETH_ALEN / 2]; /**< Destination MAC address. */ -}; - -/** - * nss_gre_redir_lag_us_query_hash_node_msg - * Message to query if a hash entry is present. - */ -struct nss_gre_redir_lag_us_query_hash_node_msg { - uint16_t src_mac[ETH_ALEN / 2]; /**< Source MAC address. */ - uint16_t dest_mac[ETH_ALEN / 2]; /**< Destination MAC address. */ - uint32_t ifnum; /**< NSS interface number of GRE redirect. */ -}; - -/** - * nss_gre_redir_lag_us_cmn_sync_stats - * GRE redirect LAG upstream statistics. - */ -struct nss_gre_redir_lag_us_cmn_sync_stats { - uint32_t amsdu_pkts; /**< Number of AMSDU packets seen. */ - uint32_t amsdu_pkts_enqueued; /**< Number of AMSDU packets enqueued. */ - uint32_t amsdu_pkts_exceptioned; /**< Number of AMSDU packets exceptioned. */ - uint32_t exceptioned; /**< Number of exceptioned packets. */ - uint32_t freed; /**< Number of freed packets. */ -}; - -/** - * nss_gre_redir_lag_us_cmn_db_sync_stats - * Upstream database statistics. - */ -struct nss_gre_redir_lag_us_cmn_db_sync_stats { - uint32_t add_attempt; /**< Add hash attempts. */ - uint32_t add_success; /**< Add hash success. */ - uint32_t add_fail_table_full; /**< Add hash failed due to full table. */ - uint32_t add_fail_exists; /**< Add hash failed as entry already exists. */ - uint32_t del_attempt; /**< Delete hash attempts. */ - uint32_t del_success; /**< Delete hash success. */ - uint32_t del_fail_not_found; /**< Delete hash failed as entry not found in hash table. */ -}; - -/** - * nss_gre_redir_lag_us_tunnel_hash_node_stats - * Hash statistics for GRE redirect LAG. - */ -struct nss_gre_redir_lag_us_tunnel_hash_node_stats { - uint64_t hits; /**< Number of hits on this hash entry. */ - uint32_t if_num; /**< GRE redirect interface number. */ - uint16_t src_mac[ETH_ALEN / 2]; /**< Source MAC address. */ - uint16_t dest_mac[ETH_ALEN / 2]; /**< Destination MAC address. */ -}; - -/** - * nss_gre_redir_lag_us_hash_stats_query_msg - * Hash statistics synchronization message. - */ -struct nss_gre_redir_lag_us_hash_stats_query_msg { - /* - * Request. - * Hash stats request has starting index of hash entry. - * Request is initiated by driver periodically. - */ - uint16_t db_entry_idx; /**< Starting index of request. */ - - /* - * Response. - * Response contains count of hash entries. It also has next field - * which used as the request index in subsequent request by caller. - */ - uint16_t db_entry_next; /**< Next index to be requested. */ - uint16_t count; /**< Number of hash entries in the message. */ - uint16_t reserved; /**< Reserved. */ - struct nss_gre_redir_lag_us_tunnel_hash_node_stats hstats[NSS_GRE_REDIR_LAG_US_MAX_HASH_PER_MSG]; - /**< Array of hash table entries. */ -}; - -/** - * nss_gre_redir_lag_us_cmn_sync_stats_msg - * Upstream statistics synchronization message. - */ -struct nss_gre_redir_lag_us_cmn_sync_stats_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - struct nss_gre_redir_lag_us_cmn_sync_stats us_stats; /**< Upstream statistics. */ - struct nss_gre_redir_lag_us_cmn_db_sync_stats db_stats; /**< Common hash statistics. */ -}; - -/** - *nss_gre_redir_lag_us_msg - * GRE redirect LAG upstream messages. - */ -struct nss_gre_redir_lag_us_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /* - * Payload of a GRE redirect LAG message. - */ - union { - struct nss_gre_redir_lag_us_config_msg config_us; /**< Upstream configuration message. */ - struct nss_gre_redir_lag_us_add_hash_node_msg add_hash; /**< Add hash entry. */ - struct nss_gre_redir_lag_us_del_hash_node_msg del_hash; /**< Delete hash entry. */ - struct nss_gre_redir_lag_us_query_hash_node_msg query_hash; /**< Hash entry query message. */ - struct nss_gre_redir_lag_us_cmn_sync_stats_msg us_sync_stats; /**< Upstream statistics. */ - struct nss_gre_redir_lag_us_hash_stats_query_msg hash_stats; /**< Hash statistics message. */ - } msg; /**< GRE redirect LAG upstream message payload. */ -}; - -/** - * nss_gre_redir_lag_us_cmn_stats - * GRE redirect LAG upstream statistics. - */ -struct nss_gre_redir_lag_us_cmn_stats { - uint64_t amsdu_pkts; /**< Number of AMSDU packets seen. */ - uint64_t amsdu_pkts_enqueued; /**< Number of AMSDU packets enqueued. */ - uint64_t amsdu_pkts_exceptioned; /**< Number of AMSDU packets exceptioned. */ - uint64_t exceptioned; /**< Number of exceptioned packets. */ - uint64_t freed; /**< Freed packets when equeue to NSS to host fails. */ -}; - -/** - * nss_gre_redir_lag_us_cmn_db_stats - * Upstream database statistics. - */ -struct nss_gre_redir_lag_us_cmn_db_stats { - uint64_t add_attempt; /**< Add hash attempts. */ - uint64_t add_success; /**< Add hash success. */ - uint64_t add_fail_table_full; /**< Add hash failed due to full table. */ - uint64_t add_fail_exists; /**< Add hash failed as entry already exists. */ - uint64_t del_attempt; /**< Delete hash attempts. */ - uint64_t del_success; /**< Delete hash success. */ - uint64_t del_fail_not_found; /**< Delete hash failed as entry not found in hash table. */ -}; - -/** - * nss_gre_redir_lag_us_tunnel_stats - * Upstream tunnel node statistics. - */ -struct nss_gre_redir_lag_us_tunnel_stats { - uint64_t rx_packets; /**< Received packets. */ - uint64_t rx_bytes; /**< Received bytes. */ - uint64_t tx_packets; /**< Transmit packets. */ - uint64_t tx_bytes; /**< Transmit bytes. */ - uint64_t rx_dropped[NSS_MAX_NUM_PRI]; /**< Packets dropped on receive due to queue full. */ - struct nss_gre_redir_lag_us_cmn_stats us_stats; /**< Common node statistics. */ - struct nss_gre_redir_lag_us_cmn_db_stats db_stats; /**< Common hash statistics. */ -}; - -/** - * nss_gre_redir_lag_us_stats_notification - * GRE redirect LAG upstream transmission statistics structure. - */ -struct nss_gre_redir_lag_us_stats_notification { - struct nss_gre_redir_lag_us_tunnel_stats stats_ctx; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_gre_redir_lag_ds_add_sta_msg - * Message to add station in LAG deployment. - */ -struct nss_gre_redir_lag_ds_add_sta_msg { - uint16_t mac[ETH_ALEN / 2]; /**< Station MAC address. */ - uint8_t reorder_type; /**< Reorder type for downstream. */ -}; - -/** - * nss_gre_redir_lag_ds_delete_sta_msg - * Message to delete station in LAG deployment. - */ -struct nss_gre_redir_lag_ds_delete_sta_msg { - uint16_t mac[ETH_ALEN / 2]; /**< Station MAC address. */ -}; - -/** - * nss_gre_redir_lag_ds_update_sta_msg - * Message to update station. - */ -struct nss_gre_redir_lag_ds_update_sta_msg { - uint16_t mac[ETH_ALEN / 2]; /**< Station MAC address. */ - uint8_t reorder_type; /**< Reorder type for downstream. */ -}; - -/** - * nss_gre_redir_lag_ds_stats - * GRE redirect link aggregation downstream statistics structure. - */ -struct nss_gre_redir_lag_ds_stats { - uint32_t dst_invalid; /**< Invalid destination packets. */ - uint32_t exception_cnt; /**< Exception count. */ -}; - -/** - * nss_gre_redir_lag_ds_sync_stats_msg - * Downstream statistics synchronization message. - */ -struct nss_gre_redir_lag_ds_sync_stats_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - struct nss_gre_redir_lag_ds_stats ds_stats; /**< GRE redirect LAG downstream statistics. */ -}; - -/** - *nss_gre_redir_lag_ds_msg - * GRE redirect LAG downstream messages. - */ -struct nss_gre_redir_lag_ds_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a GRE redirect LAG downstream message. - */ - union { - struct nss_gre_redir_lag_ds_add_sta_msg add_sta; /**< Add station entry. */ - struct nss_gre_redir_lag_ds_delete_sta_msg del_sta; /**< Delete station entry. */ - struct nss_gre_redir_lag_ds_update_sta_msg update_sta; /**< Station entry update message. */ - struct nss_gre_redir_lag_ds_sync_stats_msg ds_sync_stats; /**< Downstream statistics. */ - } msg; /**< GRE redirect LAG downstream message payload. */ -}; - -/** - * nss_gre_redir_lag_ds_tun_stats - * Downstream statistics. - */ -struct nss_gre_redir_lag_ds_tun_stats { - uint64_t rx_packets; /**< Received packets. */ - uint64_t rx_bytes; /**< Received bytes. */ - uint64_t tx_packets; /**< Transmit packets. */ - uint64_t tx_bytes; /**< Transmit bytes. */ - uint64_t rx_dropped[NSS_MAX_NUM_PRI]; - /**< Packets dropped on receive due to queue full. */ - uint64_t dst_invalid; /**< Packets that do not have a valid destination. */ - uint64_t exception_cnt; /**< Packets that are exceptioned to host. */ - uint32_t ifnum; /**< NSS interface number. */ - bool valid; /**< Valid flag. */ -}; - -/** - * nss_gre_redir_lag_ds_stats_notification - * GRE redirect LAG downstream transmission statistics structure. - */ -struct nss_gre_redir_lag_ds_stats_notification { - struct nss_gre_redir_lag_ds_tun_stats stats_ctx; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * Callback function for receiving GRE redirect LAG upstream data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_gre_redir_lag_us_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving GRE redirect LAG downstream data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_gre_redir_lag_ds_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - - /** - * Callback function for receiving GRE redirect LAG upstream messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_gre_redir_lag_us_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - - /** - * Callback function for receiving GRE redirect LAG downstream messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_gre_redir_lag_ds_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_gre_redir_lag_us_alloc_and_register_node - * Allocates and registers GRE redirect upstream LAG node. - * - * @datatypes - * net_device \n - * nss_gre_redir_lag_us_data_callback_t \n - * nss_gre_redir_lag_us_msg_callback_t - * - * @param[in] dev Net device pointer. - * @param[in] cb_func_data Data callback function. - * @param[in] cb_func_msg Message callback function. - * @param[in] app_ctx Application context for notify callback. - * - * @return - * Interface number if allocation and registration is succesful, else -1. - */ -extern int nss_gre_redir_lag_us_alloc_and_register_node(struct net_device *dev, - nss_gre_redir_lag_us_data_callback_t cb_func_data, - nss_gre_redir_lag_us_msg_callback_t cb_func_msg, void *app_ctx); - -/** - * nss_gre_redir_lag_ds_alloc_and_register_node - * Allocates and registers GRE redirect downstream LAG node. - * - * @datatypes - * net_device \n - * nss_gre_redir_lag_ds_data_callback_t \n - * nss_gre_redir_lag_ds_msg_callback_t - * - * @param[in] dev Net device pointer. - * @param[in] cb_func_data Data callback function. - * @param[in] cb_func_msg Message callback function. - * @param[in] app_ctx Application context for notify callback. - * - * @return - * Interface number if allocation and registration is succesful, else -1. - */ -extern int nss_gre_redir_lag_ds_alloc_and_register_node(struct net_device *dev, - nss_gre_redir_lag_ds_data_callback_t cb_func_data, - nss_gre_redir_lag_ds_msg_callback_t cb_func_msg, void *app_data); - -/** - * nss_gre_redir_lag_us_configure_node - * Configures LAG upstream node. - * - * @datatypes - * nss_gre_redir_lag_us_config_msg - * - * @param[in] ifnum NSS interface number. - * @param[in] ngluc Pointer to LAG upstream node configuration message. - * - * @return - * True if successful, else false. - */ -extern bool nss_gre_redir_lag_us_configure_node(uint32_t ifnum, - struct nss_gre_redir_lag_us_config_msg *ngluc); - -/** - * nss_gre_redir_lag_us_unregister_and_dealloc - * Deregister and deallocate GRE redirect upstream node. - * - * @param[in] if_num NSS interface number. - * - * @return - * Error code. - * - * @dependencies - * The GRE redirect LAG interface must have been previously registered. - */ -extern enum nss_gre_redir_lag_err_types nss_gre_redir_lag_us_unregister_and_dealloc(uint32_t if_num); - -/** - * nss_gre_redir_lag_ds_unregister_and_dealloc - * Deregisters and dealloc GRE redirect LAG downstream interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * Error code. - * - * @dependencies - * The GRE redirect LAG interface must have been previously registered. - */ -extern enum nss_gre_redir_lag_err_types nss_gre_redir_lag_ds_unregister_and_dealloc(uint32_t if_num); - -/** - * nss_gre_redir_lag_us_tx_msg - * Sends GRE redirect upstream LAG messages asynchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_redir_lag_us_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_lag_us_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_us_msg *msg); - -/** - * nss_gre_redir_lag_ds_tx_msg - * Sends GRE redirect downstream LAG messages asynchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_redir_lag_ds_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_lag_ds_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_ds_msg *msg); - -/** - * nss_gre_redir_lag_us_tx_buf - * Sends packets to GRE Redirect LAG upstream node. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] os_buf Pointer to the OS buffer (e.g., skbuff). - * @param[in] if_num Tunnel interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_lag_us_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, - uint32_t if_num); - -/** - * nss_gre_redir_lag_ds_tx_buf - * Sends packets to GRE Redirect LAG downstream node. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] os_buf Pointer to the OS buffer (e.g., skbuff). - * @param[in] if_num Tunnel interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_lag_ds_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, - uint32_t if_num); - -/** - * nss_gre_redir_lag_us_tx_msg_sync - * Sends upstream LAG messages to NSS firmware synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_redir_lag_us_msg - * - * @param[in] nss_ctx NSS core context. - * @param[in] ngrm Pointer to GRE redirect upstream LAG message data. - * - * @return - * Status of Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_lag_us_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_us_msg *ngrm); - -/** - * nss_gre_redir_lag_ds_tx_msg_sync - * Sends downstream LAG messages to NSS firmware synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_redir_lag_ds_msg - * - * @param[in] nss_ctx NSS core context. - * @param[in] ngrm Pointer to GRE redirect downstream LAG message data. - * - * @return - * Status of Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_lag_ds_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_ds_msg *ngrm); - -/** - * nss_gre_redir_lag_us_stats_get - * Fetches common node statistics for upstream GRE Redir LAG. - * - * @datatypes - * nss_gre_redir_lag_us_tunnel_stats - * - * @param[out] cmn_stats Pointer to common node statistics structure. - * @param[in] index Index to fetch statistics from. - * - * @return - * True if successful, else false. - */ -extern bool nss_gre_redir_lag_us_stats_get(struct nss_gre_redir_lag_us_tunnel_stats *cmn_stats, uint32_t index); - -/** - * nss_gre_redir_lag_ds_stats_get - * Fetches common node statistics for downstream GRE Redir LAG. - * - * @datatypes - * nss_gre_redir_lag_ds_tun_stats - * - * @param[out] cmn_stats Pointer to common node statistics structure. - * @param[in] index Index to fetch statistics from. - * - * @return - * True if successful, else false. - */ -extern bool nss_gre_redir_lag_ds_stats_get(struct nss_gre_redir_lag_ds_tun_stats *cmn_stats, uint32_t index); - -/** - * nss_gre_redir_lag_us_get_context - * Gets the GRE redirect LAG upstream context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_gre_redir_lag_us_get_context(void); - -/** - * nss_gre_redir_lag_ds_get_context - * Gets the GRE redirect LAG downstream context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_gre_redir_lag_ds_get_context(void); - -/** - * nss_gre_redir_lag_ds_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_redir_lag_ds_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_gre_redir_lag_ds_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_redir_lag_ds_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_gre_redir_lag_us_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_redir_lag_us_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_gre_redir_lag_us_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_redir_lag_us_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* __NSS_GRE_REDIR_LAG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir_mark.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir_mark.h deleted file mode 100644 index 39e024bfb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_redir_mark.h +++ /dev/null @@ -1,338 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_gre_redir_mark.h - * NSS GRE Redirect mark interface definitions. - */ - -#ifndef __NSS_GRE_REDIR_MARK_H -#define __NSS_GRE_REDIR_MARK_H - -#define NSS_GRE_REDIR_MARK_HLOS_MAGIC 0xaade /**< Metadata magic set by HLOS. */ -#define NSS_GRE_REDIR_MARK_NSS_MAGIC 0xaadf /**< Metadata magic set by NSS. */ - -extern struct nss_gre_redir_mark_stats gre_mark_stats; - -/** - * nss_gre_redir_mark messages - * Message types for GRE redirect mark requests and responses. - */ -enum nss_gre_redir_mark_msg_types { - NSS_GRE_REDIR_MARK_REG_CB_MSG, /**< Register callback configuration message. */ - NSS_GRE_REDIR_MARK_STATS_SYNC_MSG, /**< Statistics synchronization message. */ - NSS_GRE_REDIR_MARK_MSG_MAX, /**< Maximum message type. */ -}; - -/** - * nss_gre_redir_mark errors - * Error codes for GRE redirect mark configuration message. - */ -enum nss_gre_redir_mark_error_types { - NSS_GRE_REDIR_MARK_ERROR_NONE, /**< Configuration successful. */ - NSS_GRE_REDIR_MARK_ERROR_INV_IF_NUM, /**< Invalid interface number for callback registration. */ - NSS_GRE_REDIR_MARK_ERROR_INV_ETH_TYPE, /**< Invalid Ethernet type for the destination interface. */ - NSS_GRE_REDIR_MARK_ERROR_TYPE_MAX -}; - -/** - * nss_gre_redir_mark_stats_types - * GRE redirect mark statistics types. - */ -enum nss_gre_redir_mark_stats_types { - NSS_GRE_REDIR_MARK_STATS_HLOS_MAGIC_FAILED = NSS_STATS_NODE_MAX, - /**< HLOS magic fail count. */ - NSS_GRE_REDIR_MARK_STATS_INV_DST_IF_DROPS, /**< Invalid transmit interface drop count. */ - NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE, /**< Next egress interface enqueue success count. */ - NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE_DROPS, /**< Next egress interface enqueue drop count. */ - NSS_GRE_REDIR_MARK_STATS_INV_APPID, /**< Invalid application ID for the transmit completion packets. */ - NSS_GRE_REDIR_MARK_STATS_HEADROOM_UNAVAILABLE, /**< Packet headroom unavailable to write metadata. */ - NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_SUCCESS, /**< Transmit completion host enqueue success count. */ - NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_DROPS, /**< Transmit completion host enqueue drop count. */ - NSS_GRE_REDIR_MARK_STATS_MAX /**< Maximum statistics type. */ -}; - -/** - * nss_gre_redir_mark_metadata - * HLOS to NSS per packet downstream metadata. - */ -struct nss_gre_redir_mark_metadata { - uint32_t dst_ifnum; /**< Destination Tx interface number. */ - uint8_t wifi_tid; /**< TID value. */ - uint8_t app_id; /**< Application ID. */ - uint16_t hw_hash_idx; /**< Hardware AST hash index value. */ - uint32_t tx_status; /**< Transmit status. */ - uint16_t offset; /**< Buffer offset from the metadata. */ - uint16_t magic; /**< Metadata magic. */ -}; - -/** - * nss_gre_redir_mark_stats - * GRE redirect mark statistics. - */ -struct nss_gre_redir_mark_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t hlos_magic_fail; /**< HLOS magic fail count. */ - uint32_t invalid_dst_drop; /**< Invalid transmit interface drop count. */ - uint32_t dst_enqueue_success; /**< Next egress interface enqueue success count. */ - uint32_t dst_enqueue_drop; /**< Next egress interface enqueue drop count. */ - uint32_t inv_appid; /**< Invalid application ID for the transmit completion packets. */ - uint32_t headroom_unavail; /**< Packet headroom unavailable to write metadata. */ - uint32_t tx_completion_success; /**< Transmit completion host enqueue success count. */ - uint32_t tx_completion_drop; /**< Transmit completion host enqueue drop count. */ -}; - -/** - * nss_gre_redir_mark_register_cb_msg - * Transmit completion function register configuration message. - */ -struct nss_gre_redir_mark_register_cb_msg { - uint32_t nss_if_num; /**< NSS transmit interface number on which callback needs to be registered. */ -}; - -/** - * nss_gre_redir_mark_stats_notification - * GRE redirect mark transmission statistics structure. - */ -struct nss_gre_redir_mark_stats_notification { - uint64_t stats_ctx[NSS_GRE_REDIR_MARK_STATS_MAX]; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_gre_redir_mark_msg - * Structure that describes the interface message. - */ -struct nss_gre_redir_mark_msg { - struct nss_cmn_msg cm; /**< Common message. */ - - /** - * Payload of a GRE redirect mark message. - */ - union { - struct nss_gre_redir_mark_register_cb_msg reg_cb_msg; - /**< Configuration message to register for callback on completion. */ - struct nss_gre_redir_mark_stats_sync_msg stats_sync; - /**< Mark node statistics synchronization. */ - } msg; /**< Message payload for GRE redirect mark messages exchanged with NSS core. */ -}; - -/** - * Callback function for receiving GRE redirect mark data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_gre_redir_mark_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving GRE redirect mark messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_gre_redir_mark_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_gre_redir_mark_unregister_if - * Deregisters a GRE redirect mark interface from the NSS. - * - * @param[in] if_num GRE redirect mark interface number. - * - * @return - * None. - * - * @dependencies - * The GRE redirect mark interface must have been previously registered. - * - * @return - * True if successful, else false. - */ -extern bool nss_gre_redir_mark_unregister_if(uint32_t if_num); - -/** - * nss_gre_redir_mark_tx_buf - * Sends data buffers to NSS firmware asynchronously. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] os_buf Pointer to the OS buffer (e.g. skbuff). - * @param[in] if_num GRE redirect mark interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_mark_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, - uint32_t if_num); - -/** - * nss_gre_redir_mark_reg_cb - * Configure a callback on VAP for downstream application flows. - * - * @datatypes - * nss_gre_redir_mark_register_cb_msg - * - * @param[in] ifnum NSS interface number. - * @param[in] ngrcm Downstream application callback registration message. - * - * @return - * Status of Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_mark_reg_cb(int ifnum, - struct nss_gre_redir_mark_register_cb_msg *ngrcm); - -/** - * nss_gre_redir_mark_tx_msg - * Sends GRE redirect mark messages. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_redir_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_mark_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_mark_msg *msg); - -/** - * nss_gre_redir_mark_tx_msg_sync - * Sends messages to NSS firmware synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_redir_mark_msg - * - * @param[in] nss_ctx NSS core context. - * @param[in] ngrm Pointer to GRE redirect mark message data. - * - * @return - * Status of Tx operation. - */ -extern nss_tx_status_t nss_gre_redir_mark_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_mark_msg *ngrm); - -/** - * nss_gre_redir_mark_stats_get - * Gets GRE redirect mark statistics. - * - * @datatypes - * nss_gre_redir_mark_stats - * - * @param[out] stats Pointer to the memory address, which must be large enough to - * hold all the statistics. - * - * @return - * TRUE or FALSE. - */ -extern bool nss_gre_redir_mark_stats_get(struct nss_gre_redir_mark_stats *stats); - -/** - * nss_gre_redir_alloc_and_register_node - * Registers GRE redirect mark static node with NSS. - * - * @datatypes - * net_device \n - * nss_gre_redir_mark_data_callback_t \n - * nss_gre_redir_mark_msg_callback_t - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] if_num NSS interface number. - * @param[in] cb_func_data Callback for the data. - * @param[in] cb_func_msg Callback for the message. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * NSS interface number allocated. - */ -extern struct nss_ctx_instance *nss_gre_redir_mark_register_if(struct net_device *netdev, uint32_t if_num, - nss_gre_redir_mark_data_callback_t cb_func_data, nss_gre_redir_mark_msg_callback_t cb_func_msg, - uint32_t features); - -/** - * nss_gre_redir_mark_get_context - * Gets the GRE redirect mark context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_gre_redir_mark_get_context(void); - -/** - * nss_gre_redir_mark_get_dentry - * Returns directory entry created in debug filesystem for statistics. - * - * @return - * Pointer to created directory entry for GRE redirect mark. - */ -extern struct dentry *nss_gre_redir_mark_get_dentry(void); - -/* - * nss_gre_redir_mark_get_device - * Gets the original device from probe. - * - * @return - * Pointer to the device. - */ -extern struct device *nss_gre_redir_mark_get_device(void); - -/** - * nss_gre_redir_mark_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_redir_mark_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_gre_redir_mark_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_redir_mark_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* __NSS_GRE_REDIR_MARK_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_tunnel.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_tunnel.h deleted file mode 100644 index 53f76ed1e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_gre_tunnel.h +++ /dev/null @@ -1,428 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2016-2018, 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -/** - * @file nss_gre_tunnel.h - * NSS GRE Tunnel interface definitions. - */ - -#ifndef __NSS_GRE_TUNNEL_H -#define __NSS_GRE_TUNNEL_H - -/** - * @addtogroup nss_gre_tunnel_subsystem - * @{ - */ - -/** - * Maximum number of supported GRE tunnel sessions. - */ -#define NSS_MAX_GRE_TUNNEL_SESSIONS 16 - -/** - * nss_gre_tunnel_message_types - * Message types for a GRE tunnel rule. - */ -enum nss_gre_tunnel_message_types { - NSS_GRE_TUNNEL_MSG_CONFIGURE, - NSS_GRE_TUNNEL_MSG_SESSION_DESTROY, - NSS_GRE_TUNNEL_MSG_STATS, - NSS_GRE_TUNNEL_MSG_CONFIGURE_DI_TO_WLAN_ID, - NSS_GRE_TUNNEL_MSG_INQUIRY, - NSS_GRE_TUNNEL_MSG_MAX, -}; - -/** - * nss_gre_tunnel_encrypt_types - * Encryption types for a GRE tunnel. - */ -enum nss_gre_tunnel_encrypt_types { - NSS_GRE_TUNNEL_ENCRYPT_NONE, - NSS_GRE_TUNNEL_ENCRYPT_AES128_CBC, - NSS_GRE_TUNNEL_ENCRYPT_AES256_CBC, - NSS_GRE_TUNNEL_ENCRYPT_MAX, -}; - -/** - * nss_gre_tunnel_mode_types - * Mode types for a GRE tunnel. - */ -enum nss_gre_tunnel_mode_types { - NSS_GRE_TUNNEL_MODE_GRE, - NSS_GRE_TUNNEL_MODE_GRE_UDP, - NSS_GRE_TUNNEL_MODE_MAX, -}; - -/** - * nss_gre_tunnel_ip_types - * IP types for a GRE tunnel. - */ -enum nss_gre_tunnel_ip_types { - NSS_GRE_TUNNEL_IP_IPV4, - NSS_GRE_TUNNEL_IP_IPV6, - NSS_GRE_TUNNEL_IP_MAX, -}; - -/** - * nss_gre_tunnel_error_types - * Error types for a GRE tunnel. - */ -enum nss_gre_tunnel_error_types { - NSS_GRE_TUNNEL_ERR_UNKNOWN_MSG = 1, - NSS_GRE_TUNNEL_ERR_IF_INVALID = 2, - NSS_GRE_TUNNEL_ERR_CPARAM_INVALID = 3, - NSS_GRE_TUNNEL_ERR_MODE_INVALID = 4, - NSS_GRE_TUNNEL_ERR_ENCRYPT_INVALID = 5, - NSS_GRE_TUNNEL_ERR_IP_INVALID = 6, - NSS_GRE_TUNNEL_ERR_ENCRYPT_IDX_INVALID = 7, - NSS_GRE_TUNNEL_ERR_NOMEM = 8, - NSS_GRE_TUNNEL_ERR_PROTO_TEB_INVALID = 9, - NSS_GRE_TUNNEL_ERR_SIBLING_IF = 10, - NSS_GRE_TUNNEL_ERR_CRYPTO_NODE_ID = 11, - NSS_GRE_TUNNEL_ERR_RPS = 12, - NSS_GRE_TUNNEL_ERR_DI_INVALID = 13, - NSS_GRE_TUNNEL_ERR_MAX, -}; - -/** - * nss_gre_tunnel_stats_type - * GRE tunnel session debug statistic counters. - */ -enum nss_gre_tunnel_stats_type { - NSS_GRE_TUNNEL_STATS_SESSION_RX_PKTS, /**< Number of packets received. */ - NSS_GRE_TUNNEL_STATS_SESSION_TX_PKTS, /**< Number of packets transmitted. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_0_DROPPED, /**< Dropped receive packets 0. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_1_DROPPED, /**< Dropped receive packets 1. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_2_DROPPED, /**< Dropped receive packets 2. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_3_DROPPED, /**< Dropped receive packets 3. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_MALFORMED, /**< Malformed packet was received. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_INVALID_PROT, /**< Invalid protocol was received. */ - NSS_GRE_TUNNEL_STATS_SESSION_DECAP_QUEUE_FULL, /**< Decapsulation queue is full. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_SINGLE_REC_DGRAM, /**< Single fragment was received. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_INVALID_REC_DGRAM, /**< Invalid fragment was received. */ - NSS_GRE_TUNNEL_STATS_SESSION_BUFFER_ALLOC_FAIL, /**< Buffer memory allocation failed. */ - NSS_GRE_TUNNEL_STATS_SESSION_BUFFER_COPY_FAIL, /**< Buffer memory copy failed. */ - NSS_GRE_TUNNEL_STATS_SESSION_OUTFLOW_QUEUE_FULL, /**< Outflow queue is full. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_HROOM, /**< Packets dropped because of insufficent headroom. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_CBUFFER_ALLOC_FAIL, /**< Receive crypto buffer allocation failed. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_CENQUEUE_FAIL, /**< Receive enqueue-to-crypto failed. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_DECRYPT_DONE, /**< Receive decryption is complete. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_FORWARD_ENQUEUE_FAIL, /**< Receive forward enqueue failed. */ - NSS_GRE_TUNNEL_STATS_SESSION_TX_CBUFFER_ALLOC_FAIL, /**< Receive crypto buffer allocation failed. */ - NSS_GRE_TUNNEL_STATS_SESSION_TX_CENQUEUE_FAIL, /**< Transmit enqueue-to-crypto failed. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_TROOM, /**< Packets dropped because of insufficent tailroom. */ - NSS_GRE_TUNNEL_STATS_SESSION_TX_FORWARD_ENQUEUE_FAIL, /**< Transmit forward enqueue failed. */ - NSS_GRE_TUNNEL_STATS_SESSION_TX_CIPHER_DONE, /**< Transmit cipher is complete. */ - NSS_GRE_TUNNEL_STATS_SESSION_CRYPTO_NOSUPP, /**< Error count for non-supported crypto packets. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_MH_VERSION, /**< Receive drop: bad meta header. */ - NSS_GRE_TUNNEL_STATS_SESSION_RX_UNALIGNED_PKT, /**< Counter for unaligned packets. */ - NSS_GRE_TUNNEL_STATS_SESSION_MAX, /**< Maximum statistics type. */ -}; - -/** - * nss_gre_tunnel_di_to_wlan_id - * Dynamic interface to WLAN ID message structure. - */ -struct nss_gre_tunnel_di_to_wlan_id { - uint32_t dynamic_interface_num; /**< Dynamic interface number. */ - uint16_t wlan_id; /**< WLAN ID number. */ - uint16_t fwd_policy; /**< Forward policy bits. */ -}; - -/** - * nss_gre_tunnel_configure - * Message information for configuring a GRE tunnel. - */ -struct nss_gre_tunnel_configure { - uint32_t mh_version; /**< Meta header version. */ - uint8_t gre_mode; /**< GRE or GRE plus UDP. */ - uint8_t ip_type; /**< IPv4 or IPv6. */ - uint16_t encrypt_type; /**< Encryption type. */ - uint32_t src_ip[4]; /**< Source IPv4 or IPv6 address. */ - uint32_t dest_ip[4]; /**< Destination IPv4 or IPv6 address. */ - uint16_t src_port; /**< GRE plus UDP only for the source. */ - uint16_t dest_port; /**< GRE plus UDP only for the destination. */ - uint32_t crypto_node_id; /**< Cryto node identifier. */ - uint32_t crypto_idx_encrypt; /**< Crypto index for encryption. */ - uint32_t crypto_idx_decrypt; /**< Crypto index for decryption. */ - uint32_t word0; /**< Word0 header. */ - uint8_t iv_val[16]; /**< Initialization vector value. */ - uint32_t sibling_if; /**< Sibling interface number. */ - uint8_t ttl; /**< Time-to-live value of the IP header. */ - int8_t rps; /**< Steer packets to host core. */ - uint16_t reserved; /**< Reserved space. */ - uint32_t word1; /**< Word1 header. */ - uint32_t word2; /**< Word2 header. */ - uint32_t word3; /**< Word3 header. */ -}; - -/** - * nss_gre_tunnel_stats - * Message statistics for a GRE tunnel. - */ -struct nss_gre_tunnel_stats { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t rx_malformed; /**< Malformed packet was received. */ - uint32_t rx_invalid_prot; /**< Invalid protocol was received. */ - uint32_t decap_queue_full; /**< Decapsulation queue is full. */ - uint32_t rx_single_rec_dgram; /**< Single fragment was received. */ - uint32_t rx_invalid_rec_dgram; /**< Invalid fragment was received. */ - uint32_t buffer_alloc_fail; /**< Buffer memory allocation failed. */ - uint32_t buffer_copy_fail; /**< Buffer memory copy failed. */ - uint32_t outflow_queue_full; /**< Outflow queue is full. */ - uint32_t rx_dropped_hroom; - /**< Packets dropped because of insufficent headroom. */ - uint32_t rx_cbuf_alloc_fail; - /**< Receive crypto buffer allocation failed. */ - uint32_t rx_cenqueue_fail; /**< Receive enqueue-to-crypto failed. */ - uint32_t rx_decrypt_done; /**< Receive decryption is complete. */ - uint32_t rx_forward_enqueue_fail; /**< Receive forward enqueue failed. */ - uint32_t tx_cbuf_alloc_fail; - /**< Receive crypto buffer allocation failed. */ - uint32_t tx_cenqueue_fail; /**< Transmit enqueue-to-crypto failed. */ - uint32_t rx_dropped_troom; - /**< Packets dropped because of insufficent tailroom. */ - uint32_t tx_forward_enqueue_fail; /**< Transmit forward enqueue failed. */ - uint32_t tx_cipher_done; /**< Transmit cipher is complete. */ - uint32_t crypto_nosupp; - /**< Error count for non-supported crypto packets. */ - uint32_t rx_dropped_mh_ver; /**< Receive drop: bad meta header. */ - uint32_t rx_unaligned_pkt; /**< Counter for unaligned packets. */ -#if defined(NSS_HAL_IPQ807x_SUPPORT) - uint32_t crypto_resp_error[NSS_CRYPTO_CMN_RESP_ERROR_MAX]; - /** Crypto response errors. */ -#endif -}; - -/** - * nss_gre_tunnel_stats_notification - * GRE tunnel transmission statistics structure. - */ -struct nss_gre_tunnel_stats_notification { - uint64_t stats_ctx[NSS_GRE_TUNNEL_STATS_SESSION_MAX + NSS_CRYPTO_CMN_RESP_ERROR_MAX]; - /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_gre_tunnel_msg - * Data for sending and receiving GRE tunnel messages. - */ -struct nss_gre_tunnel_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a GRE tunnel message. - */ - union { - struct nss_gre_tunnel_configure configure; /**< Tunnel configuration data. */ - struct nss_gre_tunnel_stats stats; /**< Tunnel statistics. */ - struct nss_gre_tunnel_di_to_wlan_id dtwi; /**< Tunnel dynamic interface number to WLAN ID mapping. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving GRE tunnel messages. - * - * @datatypes - * nss_gre_tunnel_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_gre_tunnel_msg_callback_t)(void *app_data, struct nss_gre_tunnel_msg *msg); - -/** - * Callback function for receiving GRE tunnel session data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_gre_tunnel_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_gre_tunnel_tx_buf - * Sends a GRE tunnel packet. - * - * @datatypes - * sk_buff \n - * nss_ctx_instance - * - * @param[in] skb Pointer to the data socket buffer. - * @param[in] if_num Tunnel interface number. - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_tunnel_tx_buf(struct sk_buff *skb, uint32_t if_num, struct nss_ctx_instance *nss_ctx); - -/** - * nss_gre_tunnel_tx_msg - * Sends a GRE tunnel message. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_tunnel_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_tunnel_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_tunnel_msg *msg); - -/** - * nss_gre_tunnel_tx_msg_sync - * Sends a GRE tunnel message synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_gre_tunnel_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_gre_tunnel_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_tunnel_msg *msg); - -/** - * nss_gre_tunnel_msg_init - * Initalizes a GRE tunnel message. - * - * @datatypes - * nss_gre_tunnel_msg - * - * @param[in] ngtm Pointer to the tunnel message. - * @param[in] if_num Tunnel interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_gre_tunnel_msg_init(struct nss_gre_tunnel_msg *ngtm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_gre_tunnel_get_ctx - * Returns the NSS context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_gre_tunnel_get_ctx(void); - -/** - * nss_gre_tunnel_register_if - * Registers a network device with the NSS for sending and receiving tunnel - * messages. - * - * @datatypes - * nss_gre_tunnel_data_callback_t \n - * nss_gre_tunnel_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] cb Callback function for the message. - * @param[in] ev_cb Callback for the GRE tunnel message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * @param[in] app_ctx Pointer to the application context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_gre_tunnel_register_if(uint32_t if_num, - nss_gre_tunnel_data_callback_t cb, - nss_gre_tunnel_msg_callback_t ev_cb, - struct net_device *netdev, - uint32_t features, - void *app_ctx); - -/** - * nss_gre_tunnel_unregister_if - * Deregisters a network device from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The network device must have been previously registered. - */ -extern void nss_gre_tunnel_unregister_if(uint32_t if_num); - -/** - * nss_gre_tunnel_inquiry() - * Inquiry if a GRE tunnel has been established in NSS FW. - * - * @param[in] inquiry_info Query parameters similar to creation parameters. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Status of the Tx operation - */ -extern nss_tx_status_t nss_gre_tunnel_inquiry( - struct nss_gre_tunnel_configure *inquiry_info, - nss_gre_tunnel_msg_callback_t cb, void *app_data); - -/** - * nss_gre_tunnel_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_tunnel_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_gre_tunnel_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_gre_tunnel_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* __NSS_GRE_TUNNEL_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_if.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_if.h deleted file mode 100644 index abda94189..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_if.h +++ /dev/null @@ -1,454 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_if.h - * NSS interface definitions. - */ - -#ifndef __NSS_IF_H -#define __NSS_IF_H - -#define NSS_IF_TX_TIMEOUT 3000 /* 3 Seconds */ - -/** - * @addtogroup nss_driver_subsystem - * @{ - */ - -/** - * nss_if_message_types - * Message types for the NSS interface. - */ -enum nss_if_message_types { - NSS_IF_OPEN, - NSS_IF_CLOSE, - NSS_IF_LINK_STATE_NOTIFY, - NSS_IF_MTU_CHANGE, - NSS_IF_MAC_ADDR_SET, - NSS_IF_STATS, - NSS_IF_ISHAPER_ASSIGN, - NSS_IF_BSHAPER_ASSIGN, - NSS_IF_ISHAPER_UNASSIGN, - NSS_IF_BSHAPER_UNASSIGN, - NSS_IF_ISHAPER_CONFIG, - NSS_IF_BSHAPER_CONFIG, - NSS_IF_PAUSE_ON_OFF, - NSS_IF_VSI_ASSIGN, - NSS_IF_VSI_UNASSIGN, - NSS_IF_SET_NEXTHOP, - NSS_IF_SET_IGS_NODE, - NSS_IF_CLEAR_IGS_NODE, - NSS_IF_RESET_NEXTHOP, - NSS_IF_PPE_PORT_CREATE, - NSS_IF_PPE_PORT_DESTROY, - NSS_IF_MAX_MSG_TYPES = 9999, -}; - -/** - * nss_if_error_types - * Error types for the NSS interface. - */ -enum nss_if_error_types { - NSS_IF_ERROR_NO_ISHAPERS, - NSS_IF_ERROR_NO_BSHAPERS, - NSS_IF_ERROR_NO_ISHAPER, - NSS_IF_ERROR_NO_BSHAPER, - NSS_IF_ERROR_ISHAPER_OLD, - NSS_IF_ERROR_BSHAPER_OLD, - NSS_IF_ERROR_ISHAPER_CONFIG_FAILED, - NSS_IF_ERROR_BSHAPER_CONFIG_FAILED, - NSS_IF_ERROR_TYPE_UNKNOWN, - NSS_IF_ERROR_TYPE_EOPEN, - NSS_IF_ERROR_TYPE_INVALID_MTU, - NSS_IF_ERROR_TYPE_INVALID_MAC_ADDR, - NSS_IF_ERROR_TYPE_VSI_NOT_MATCH, - NSS_IF_ERROR_TYPE_VSI_REASSIGN, - NSS_IF_ERROR_TYPE_VSI_INVALID, - NSS_IF_ERROR_TYPE_MAX = 9999, -}; - -/** - * nss_if_data_align - * Data alignment modes for the NSS interface. - */ -enum nss_if_data_align { - NSS_IF_DATA_ALIGN_2BYTE = 0, - NSS_IF_DATA_ALIGN_4BYTE = 2, -}; - -/** - * nss_if_open - * Message information for opening the NSS interface. - */ -struct nss_if_open { - uint32_t tx_desc_ring; /**< Tx descriptor ring address. */ - uint32_t rx_desc_ring; /**< Rx descriptor ring address. */ - uint32_t rx_forward_if; /**< Forward received packets to this interface. */ - uint32_t alignment_mode;/**< Header alignment mode. */ -}; - -/** - * nss_if_close - * Message information for closing the NSS interface. - */ -struct nss_if_close { - uint32_t reserved; /**< Placeholder for the structure. */ -}; - -/** - * nss_if_link_state_notify - * Link state notification sent to the NSS interface. - */ -struct nss_if_link_state_notify { - uint32_t state; - /**< Link state UP is bit 0 set. Other bits are as defined by Linux to indicate speed and duplex. */ -}; - -/** - * nss_if_mtu_change - * MTU change for the NSS interface. - */ -struct nss_if_mtu_change { - uint16_t min_buf_size; /**< Changed value for the minimum buffer size. */ -}; - -/** - * nss_if_pause_on_off - * Enables or disables a pause frame for the NSS interface. - */ -struct nss_if_pause_on_off { - uint32_t pause_on; /**< Turn the pause frame ON or OFF. */ -}; - -/** - * nss_if_mac_address_set - * MAC address setting. - */ -struct nss_if_mac_address_set { - uint8_t mac_addr[ETH_ALEN]; /**< MAC address. */ -}; - -/** - * nss_if_shaper_assign - * Shaper assignment message. - */ -struct nss_if_shaper_assign { - uint32_t shaper_id; /**< ID of the request. */ - uint32_t new_shaper_id; /**< ID of the response. */ -}; - -/** - * nss_if_shaper_unassign - * Shaper unassign message. - */ -struct nss_if_shaper_unassign { - uint32_t shaper_id; /**< ID of the request. */ -}; - -/** - * nss_if_shaper_configure - * Shaper configuration message. - */ -struct nss_if_shaper_configure { - struct nss_shaper_configure config; /**< Specific shaper message for a particular interface. */ -}; - -/** - * nss_if_vsi_assign - * VSI assignment message. - */ -struct nss_if_vsi_assign { - uint32_t vsi; /**< Virtual interface number. */ -}; - -/** - * nss_if_vsi_unassign - * VSI unassign message. - */ -struct nss_if_vsi_unassign { - uint32_t vsi; /**< Virtual interface number. */ -}; - -/** - * nss_if_set_nexthop - * Message to set nexthop for an interface. - */ -struct nss_if_set_nexthop { - uint32_t nexthop; /**< Nexthop interface number. */ -}; - -/** - * nss_if_igs_config - * Ingress shaper set/clear configure message structure. - */ -struct nss_if_igs_config { - int32_t igs_num; /**< Ingress shaper interface number. */ -}; - -/** - * nss_if_ppe_port_create - * Message to create PPE port. - */ -struct nss_if_ppe_port_create { - int32_t ppe_port_num; /**< PPE port number returned by NSS. */ -}; - -/** - * nss_if_msgs - * Information for physical NSS interface command messages. - */ -union nss_if_msgs { - struct nss_if_link_state_notify link_state_notify; - /**< Link status notification. */ - struct nss_if_open open; - /**< Open the NSS interface. */ - struct nss_if_close close; - /**< Close the NSS interface. */ - struct nss_if_mtu_change mtu_change; - /**< MTU change notification. */ - struct nss_if_mac_address_set mac_address_set; - /**< MAC address setting. */ - struct nss_cmn_node_stats stats; - /**< Synchronize the satistics. */ - struct nss_if_shaper_assign shaper_assign; - /**< Assign the shaper. */ - struct nss_if_shaper_unassign shaper_unassign; - /**< Unassign the shaper. */ - struct nss_if_shaper_configure shaper_configure; - /**< Configure the shaper. */ - struct nss_if_pause_on_off pause_on_off; - /**< ON or OFF notification for a Pause frame. */ - struct nss_if_vsi_assign vsi_assign; - /**< Assign the VSI. */ - struct nss_if_vsi_unassign vsi_unassign; - /**< Remove the VSI assignment. */ - struct nss_if_set_nexthop set_nexthop; - /**< Set nexthop of interface. */ - struct nss_if_igs_config config_igs; - /**< Configure an ingress shaper interface. */ - struct nss_if_ppe_port_create ppe_port_create; - /**< Create a PPE port. */ -}; - -/** - * nss_if_msg - * Data for sending and receiving base class messages for all interface types. - */ -struct nss_if_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - union nss_if_msgs msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving NSS interface messages. - * - * @datatypes - * nss_if_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_if_msg_callback_t)(void *app_data, struct nss_if_msg *msg); - -/** - * Callback function for receiving NSS interface data. - * - * TODO: Adjust to pass app_data as unknown to the - * list layer and netdev/sk as known. - * - * @datatypes - * net_device \n - * sk_buff - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - */ -typedef void (*nss_if_rx_callback_t)(struct net_device *netdev, struct sk_buff *skb); - -/** - * nss_if_register - * Registers the NSS interface for sending and receiving GMAC packets and messages. - * - * @datatypes - * nss_if_rx_callback_t \n - * nss_if_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] rx_callback Receive callback for the packet. - * @param[in] msg_callback Receive callback for message. - * @param[in] if_ctx Pointer to the interface context provided in the - callback. This context must be the OS network - device context pointer (net_device in Linux). - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_if_register(uint32_t if_num, - nss_if_rx_callback_t rx_callback, - nss_if_msg_callback_t msg_callback, - struct net_device *if_ctx); - -/** - * nss_if_tx_buf - * Sends GMAC packets to a specific physical or virtual network interface. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] os_buf Pointer to the OS buffer (e.g., skbuff). - * @param[in] if_num Network physical or virtual interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_if_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num); - -/** - * nss_if_tx_msg - * Sends a message to the NSS interface. - * - * @datatypes - * nss_ctx_instance \n - * nss_if_msg - * - * @param[in,out] nss_ctx Pointer to the NSS context. - * @param[in] nim Pointer to the NSS interface message. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_if_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_if_msg *nim); - -/** - * nss_if_msg_sync - * Sends a message to the NSS interface and wait for the response. - * - * @datatypes - * nss_ctx_instance \n - * nss_if_msg - * - * @param[in,out] nss_ctx Pointer to the NSS context. - * @param[in] nim Pointer to the NSS interface message. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_if_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_if_msg *nim); - -/** - * nss_if_set_nexthop - * Configure the next hop for an interface. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * @param[in] nexthop NSS interface number for next hop node. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_if_set_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint32_t nexthop); - -/** - * nss_if_reset_nexthop - * De-configure the next hop for an interface. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_if_reset_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num); - -/** - * nss_if_change_mtu - * Change the MTU of the interface. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * @param[in] mtu New MTU. - * - * @return - * Status of the transmit operation. - */ -nss_tx_status_t nss_if_change_mtu(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint16_t mtu); - -/** - * nss_if_change_mac_addr - * Change the MAC address of the interface. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * @param[in] mac_addr New MAC address. - * - * @return - * Status of the transmit operation. - */ -nss_tx_status_t nss_if_change_mac_addr(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint8_t *mac_addr); - -/** - * nss_if_vsi_unassign - * Detach the VSI ID from the given interface. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * @param[in] vsi VSI ID. - * - * @return - * Status of the transmit operation. - */ -nss_tx_status_t nss_if_vsi_unassign(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint32_t vsi); - -/** - * nss_if_vsi_assign - * Attach the VSI ID to the given interface. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * @param[in] vsi VSI ID. - * - * @return - * Status of the transmit operation. - */ -nss_tx_status_t nss_if_vsi_assign(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint32_t vsi); - -/** - * @} - */ - -#endif /* __NSS_IF_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_igs.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_igs.h deleted file mode 100644 index 651fea4e9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_igs.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_igs.h - * NSS ingress shaper interface definitions. - */ - -#ifndef _NSS_IGS_H_ -#define _NSS_IGS_H_ - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -#ifdef CONFIG_NET_CLS_ACT -#include -#endif -#endif - -/** - * @addtogroup nss_ingress_shaper_subsystem - * @{ - */ - -/** - * Maximum number of supported ingress shaping interfaces. - */ -#define NSS_MAX_IGS_DYNAMIC_INTERFACES 8 - -/** - * nss_igs_msg_types - * Message types for ingress shaper requests and responses. - */ -enum nss_igs_msg_types { - NSS_IGS_MSG_SYNC_STATS = NSS_IF_MAX_MSG_TYPES + 1, - NSS_IGS_MSG_MAX -}; - -/** - * nss_igs_node_stats - * Ingress shaping node debug statistics structure. - */ -struct nss_igs_node_stats { - uint32_t tx_dropped; /**< Dropped post shaping. */ - uint32_t shaper_drop; /**< Dropped during shaper enqueue. */ - uint32_t ipv4_parse_fail; /**< IPv4 parse fail. */ - uint32_t ipv4_unknown_gre_type; /**< IPv4 unknown GRE type. */ - uint32_t ipv4_unknown_l4; /**< IPv4 unknown L4 type. */ - uint32_t ipv4_no_cme; /**< IPv4 connection match entry not found. */ - uint32_t ipv4_frag_initial; /**< IPv4 initial fragment. */ - uint32_t ipv4_frag_non_initial; /**< Ipv4 subsequent fragment. */ - uint32_t ipv4_malformed_udp; /**< Incomplete IPv4 UDP packet. */ - uint32_t ipv4_malformed_tcp; /**< Incomplete IPv4 TCP packet. */ - uint32_t ipv4_malformed_udpl; /**< Incomplete IPv4 UDP-Lite packet. */ - uint32_t ipv4_malformed_gre; /**< Incomplete IPv4 GRE packet. */ - uint32_t ipv6_parse_fail; /**< IPv6 parse fail. */ - uint32_t ipv6_unknown_l4; /**< IPv6 unknown L4 type. */ - uint32_t ipv6_no_cme; /**< IPv6 connection match entry not found. */ - uint32_t ipv6_frag_initial; /**< IPv6 initial fragment. */ - uint32_t ipv6_frag_non_initial; /**< Ipv6 subsequent fragment. */ - uint32_t ipv6_malformed_udp; /**< Incomplete IPv6 UDP packet. */ - uint32_t ipv6_malformed_tcp; /**< Incomplete IPv6 TCP packet. */ - uint32_t ipv6_malformed_udpl; /**< Incomplete IPv6 UDP-Lite packet. */ - uint32_t ipv6_malformed_frag; /**< Incomplete IPv6 fragment. */ - uint32_t event_no_si; /**< No shaper configured. */ - uint32_t eth_parse_fail; /**< Ethernet header parse failed. */ - uint32_t eth_unknown_type; /**< Non-IP/PPPoE ether type. */ - uint32_t pppoe_non_ip; /**< Non-IP PPPoE packet. */ - uint32_t pppoe_malformed; /**< Incomplete PPPoE packet. */ -}; - -/** - * nss_igs_stats_sync_msg - * Message information for ingress shaping synchronization statistics. - */ -struct nss_igs_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - struct nss_igs_node_stats igs_stats; /**< Debug statistics for ingress shaping. */ -}; - -/** - * nss_igs_msg - * Data for sending and receiving ingress shaper messages. - */ -struct nss_igs_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a ingress shaper message. - */ - union { - union nss_if_msgs if_msg; - /**< NSS interface base message. */ - struct nss_igs_stats_sync_msg stats; - /**< Statistics message to host. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving ingress shaper messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_igs_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_igs_get_context - * Gets the ingress shaper context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_igs_get_context(void); - -/** - * nss_igs_register_if - * Registers a ingress shaper interface with the NSS for sending and receiving messages. - * - * @datatypes - * nss_igs_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] type NSS interface type. - * @param[in] msg_callback Callback for the ingress shaper message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_igs_register_if(uint32_t if_num, uint32_t type, - nss_igs_msg_callback_t msg_callback, struct net_device *netdev, uint32_t features); - -/** - * nss_igs_unregister_if - * Deregisters a ingress shaper interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -extern void nss_igs_unregister_if(uint32_t if_num); - -/** - * nss_igs_verify_if_num - * Verify whether interface is an ingress shaper interface or not. - * - * @param[in] if_num NSS interface number. - * - * @return - * True if interface is an ingress shaper interface. - */ -extern bool nss_igs_verify_if_num(uint32_t if_num); - - -#ifdef CONFIG_NET_CLS_ACT -/* - * nss_igs_module_save() - * Save the ingress shaping module reference. - * - * @datatypes - * tc_action_ops \n - * module - * - * @param[in] act Operation structure for ingress shaping action. - * @param[in] module Module structure of ingress shaping module. - * - * @return - * None. - */ -extern void nss_igs_module_save(struct tc_action_ops *act, struct module *module); -#endif - -/* - * nss_igs_module_get() - * Get the ingress shaping module reference. - * - * @return - * False if not able to take the ingress shaping module reference, otherwise true. - * - */ -extern bool nss_igs_module_get(void); - -/* - * nss_igs_module_put() - * Release the ingress shaping module reference. - * - * @return - * None. - */ -extern void nss_igs_module_put(void); - -/** - * @} - */ -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsec.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsec.h deleted file mode 100644 index 3a9de9339..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsec.h +++ /dev/null @@ -1,550 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipsec.h - * NSS IPSec interface definitions. - */ - -#ifndef __NSS_IPSEC_H -#define __NSS_IPSEC_H - -/* - * For some reason Linux doesn't define this in if_arp.h, - * refer http://www.iana.org/assignments/arp-parameters/arp-parameters.xhtml - * for the full list - */ - -/** - * @addtogroup nss_ipsec_subsystem - * @{ - */ - -#define NSS_IPSEC_ARPHRD_IPSEC 31 - /**< ARP (iana.org) hardware type for an IPsec tunnel. */ -#define NSS_IPSEC_MAX_RULES 256 - /**< Maximum number of rules supported. */ -#define NSS_IPSEC_MAX_SA NSS_CRYPTO_MAX_IDXS - /**< Maximum number of SAs supported. */ - -#if (~(NSS_IPSEC_MAX_RULES - 1) & (NSS_IPSEC_MAX_RULES >> 1)) -#error "NSS Max SA should be a power of 2" -#endif - -/** - * Size of an IPsec message. - */ -#define NSS_IPSEC_MSG_LEN (sizeof(struct nss_ipsec_msg) - sizeof(struct nss_cmn_msg)) - -/** - * nss_ipsec_msg_type - * Rules for the IPsec interface. - */ -enum nss_ipsec_msg_type { - NSS_IPSEC_MSG_TYPE_NONE = 0, - NSS_IPSEC_MSG_TYPE_ADD_RULE = 1, - NSS_IPSEC_MSG_TYPE_DEL_RULE = 2, - NSS_IPSEC_MSG_TYPE_FLUSH_TUN = 3, - NSS_IPSEC_MSG_TYPE_SYNC_SA_STATS = 4, - NSS_IPSEC_MSG_TYPE_SYNC_FLOW_STATS = 5, - NSS_IPSEC_MSG_TYPE_SYNC_NODE_STATS = 6, - NSS_IPSEC_MSG_TYPE_CONFIGURE_NODE = 7, - NSS_IPSEC_MSG_TYPE_MAX -}; - -/** - * nss_ipsec_status - * Status types for the IPsec interface. - */ -typedef enum nss_ipsec_status { - NSS_IPSEC_STATUS_OK = 0, - NSS_IPSEC_STATUS_ENOMEM = 1, - NSS_IPSEC_STATUS_ENOENT = 2, - NSS_IPSEC_STATUS_MAX -} nss_ipsec_status_t; - -/** - * nss_ipsec_error_type - * Error types for the IPsec interface. - */ -enum nss_ipsec_error_type { - NSS_IPSEC_ERROR_TYPE_NONE = 0, - NSS_IPSEC_ERROR_TYPE_HASH_DUPLICATE = 1, - NSS_IPSEC_ERROR_TYPE_HASH_COLLISION = 2, - NSS_IPSEC_ERROR_TYPE_UNHANDLED_MSG = 3, - NSS_IPSEC_ERROR_TYPE_INVALID_RULE = 4, - NSS_IPSEC_ERROR_TYPE_MAX_SA = 5, - NSS_IPSEC_ERROR_TYPE_MAX_FLOW = 6, - NSS_IPSEC_ERROR_TYPE_INVALID_CINDEX = 7, - NSS_IPSEC_ERROR_TYPE_INVALID_IPVER = 8, - NSS_IPSEC_ERROR_TYPE_MAX -}; - -/** - * nss_ipsec_type - * Operation types for the IPsec interface. - */ -enum nss_ipsec_type { - NSS_IPSEC_TYPE_NONE = 0, - NSS_IPSEC_TYPE_ENCAP = 1, - NSS_IPSEC_TYPE_DECAP = 2, - NSS_IPSEC_TYPE_MAX -}; - -/** - * nss_ipsec_tuple - * Common IPsec rule selector tuple for encapsulation and decapsulation. - * - * This selector is used for preparing a lookup tuple for incoming packets. - * The tuple is used to derive the index into the rule table. - * - * Choosing the selector fields depends on the IPsec encapsulation or decapsulation - * package. The host has no understanding of the index derived from the selector fields, - * and thus it provides information for all entries in the structure. - * - * The encapsulation and decapsulation packages return the index in their respective - * tables to the host. The host stores the rule for future reference purposes. - */ -struct nss_ipsec_tuple { - uint32_t dst_addr[4]; /**< Destination IP address. */ - uint32_t src_addr[4]; /**< Source IP address. */ - - uint32_t esp_spi; /**< SPI index. */ - - uint16_t dst_port; /**< Destination port (UDP or TCP). */ - uint16_t src_port; /**< Source port (UDP or TCP). */ - - uint8_t proto_next_hdr; /**< IP header type. */ - uint8_t ip_ver; /**< IP version. */ - uint8_t res[2]; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_ipsec_rule_oip - * Common information about the IPsec rule outer IP header. - */ -struct nss_ipsec_rule_oip { - uint32_t dst_addr[4]; /**< IPv4 destination address to apply. */ - uint32_t src_addr[4]; /**< IPv4 source address to apply. */ - - uint32_t esp_spi; /**< ESP SPI index to apply. */ - - uint16_t dst_port; /**< Destination port (UDP or TCP). */ - uint16_t src_port; /**< Source port (UDP or TCP). */ - - uint8_t ttl_hop_limit; /**< IPv4 time-to-live value to apply. */ - uint8_t ip_ver; /**< IP version. */ - uint8_t proto_next_hdr; /**< IP header type. */ - uint8_t res; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_ipsec_rule_data - * IPsec rule data used for per-packet transformation. - */ -struct nss_ipsec_rule_data { - - uint16_t crypto_index; /**< Crypto index for the security association. */ - uint16_t window_size; /**< ESP sequence number window. */ - - uint8_t cipher_blk_len; /**< Size of the cipher block. */ - uint8_t iv_len; /**< Size of the initialization vector. */ - uint8_t nat_t_req; /**< NAT-T required. */ - uint8_t esp_icv_len; /**< Size of the ICV to be produced as a result of authentication. */ - - uint8_t esp_seq_skip; /**< Skip an ESP sequence number. */ - uint8_t esp_tail_skip; /**< Skip an ESP trailer. */ - uint8_t use_pattern; /**< Use random pattern in a hash calculation. */ - uint8_t enable_esn; /**< Enable extended sequence number. */ - - uint8_t dscp; /**< Default DSCP value of the SA. */ - uint8_t df; /**< Default dont fragment value of the SA. */ - uint8_t copy_dscp; /**< The flag tells whether to copy DSCP from inner header. */ - uint8_t copy_df; /**< The flag tells Whether to copy DF from inner header. */ - - uint32_t res2[4]; /**< Reserved 16 bytes for future use. */ -}; - -/** - * nss_ipsec_rule - * Push message for IPsec rules. - * - * This message is sent from the host to the NSS for performing an operation - * on NSS rule tables. - */ -struct nss_ipsec_rule { - struct nss_ipsec_rule_oip oip; /**< Per rule outer IP information. */ - struct nss_ipsec_rule_data data;/**< Per rule data. */ - - uint32_t index; /**< Index provided by the NSS. */ - uint32_t sa_idx; /**< Rule index for the security association table. */ -}; - -/** - * nss_ipsec_configure_node - * Push message for setting IPsec inline mode and initializing DMA rings. - */ -struct nss_ipsec_configure_node { - bool dma_redirect; /**< Program redirect DMA ring. */ - bool dma_lookaside; /**< Program lookaside DMA ring. */ -}; - -/** - * nss_ipsec_sa_stats - * Packet statistics per security association. - */ -struct nss_ipsec_sa_stats { - uint32_t count; /**< Packets processed. */ - uint32_t bytes; /**< Bytes processed. */ - uint32_t no_headroom; /**< Insufficient headroom. */ - uint32_t no_tailroom; /**< Insufficient tailroom. */ - uint32_t no_resource; /**< No crypto buffer. */ - uint32_t fail_queue; /**< Failed to enqueue. */ - uint32_t fail_hash; /**< Hash mismatch. */ - uint32_t fail_replay; /**< Replay check failure. */ - uint64_t seq_num; /**< Current sequence number. */ - uint64_t window_max; /**< Maximum size of the window. */ - uint32_t window_size; /**< Current window size. */ - uint32_t fail_hash_cont; /**< Consecutive hash fail count. */ - uint8_t esn_enabled; /**< Indicates whether ESN is enabled. */ - uint8_t res[3]; /**< Reserved for future use. */ -} /** @cond */ __attribute__((packed))/** @endcond */; - -/** - * nss_ipsec_flow_stats - * Per-flow statistics. - */ -struct nss_ipsec_flow_stats { - uint32_t processed; /**< Packets processed for this flow. */ - - uint8_t use_pattern; /**< Use random pattern. */ - uint8_t res[3]; /**< Reserved for 4-byte alignment padding. */ -}; - -/** - * nss_ipsec_node_stats - * Per-node statistics. - */ -struct nss_ipsec_node_stats { - uint32_t enqueued; /**< Packets enqueued to the node. */ - uint32_t completed; /**< Packets processed by the node. */ - uint32_t linearized; /**< Packet is linear. */ - uint32_t exceptioned; /**< Packets exception from the NSS. */ - uint32_t fail_enqueue; /**< Packets failed to enqueue. */ - uint32_t redir_rx; /**< Packets received in redirect ring. */ - uint32_t fail_redir; /**< Packets dropped in redirect ring. */ -}; - -/** - * nss_ipsec_stats - * Common statistics structure. - */ -union nss_ipsec_stats { - struct nss_ipsec_sa_stats sa; /**< Security association statistics. */ - struct nss_ipsec_flow_stats flow; /**< Flow statistics. */ - struct nss_ipsec_node_stats node; /**< Node statistics. */ -}; - -/** - * nss_ipsec_msg - * Data for sending and receiving IPsec messages. - */ -struct nss_ipsec_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - uint32_t tunnel_id; /**< ID of the tunnel associated with the message. */ - struct nss_ipsec_tuple tuple; - /**< Tuple to look up the SA table for encapsulation or decapsulation. */ - enum nss_ipsec_type type; /**< Encapsulation or decapsulation operation. */ - - /** - * Payload of an IPsec message. - */ - union { - struct nss_ipsec_rule rule; - /**< IPsec rule message. */ - struct nss_ipsec_configure_node node; - /**< IPsec node message. */ - union nss_ipsec_stats stats; - /**< Retrieve statistics for the tunnel. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving message notifications. - * - * @datatypes - * nss_ipsec_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_ipsec_msg_callback_t)(void *app_data, struct nss_ipsec_msg *msg); - -/** - * Callback function for receiving data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the message data. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_ipsec_buf_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_ipsec_tx_msg - * Sends an IPsec message to the NSS HLOS driver. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipsec_msg - * - * @param[in] nss_ctx Pointer to the NSS HLOS driver context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipsec_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_ipsec_msg *msg); - -/** - * nss_ipsec_tx_msg_sync - * Sends IPsec messages synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipsec_msg_type \n - * nss_ipsec_msg \n - * nss_ipsec_error_type - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num Configuration interface number. - * @param[in] type Type of the message. - * @param[in] len Size of the payload. - * @param[in] nim Pointer to the message data. - * @param[in,out] resp Response for the configuration. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipsec_tx_msg_sync(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - enum nss_ipsec_msg_type type, uint16_t len, - struct nss_ipsec_msg *nim, enum nss_ipsec_error_type *resp); - -/** - * nss_ipsec_tx_buf - * Sends a plain text packet to NSS for IPsec encapsulation or decapsulation. - * - * @datatypes - * sk_buff - * - * @param[in] skb Pointer to the message data. - * @param[in] if_num Pointer to the NSS interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipsec_tx_buf(struct sk_buff *skb, uint32_t if_num); - -/** - * nss_ipsec_notify_register - * Registers an event callback handler with the HLOS driver. - * - * When registered, the message callback is called when the NSS - * sends a response to the message sent by the host. - * - * @datatypes - * nss_ipsec_msg_callback_t - * - * @param[in] if_num NSS interface number. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the context of the message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipsec_notify_register(uint32_t if_num, nss_ipsec_msg_callback_t cb, void *app_data); - -/** - * nss_ipsec_data_register - * Registers a data callback handler with the HLOS driver. - * - * The HLOS driver calls the registered data callback to return - * the packet to the OS. - * - * @datatypes - * nss_ipsec_buf_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] cb Callback function for the data. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipsec_data_register(uint32_t if_num, nss_ipsec_buf_callback_t cb, struct net_device *netdev, uint32_t features); - -/** - * nss_ipsec_notify_unregister - * Deregisters the message notifier from the HLOS driver. - * - * @datatypes - * nss_ctx_instance - * - * @param[in,out] ctx Pointer to the context of the HLOS driver. - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The message notifier must have been previously registered. - */ -extern void nss_ipsec_notify_unregister(struct nss_ctx_instance *ctx, uint32_t if_num); - -/** - * nss_ipsec_data_unregister - * Deregisters the data notifier from the HLOS driver. - * - * @datatypes - * nss_ctx_instance - * - * @param[in,out] ctx Pointer to the context of the HLOS driver. - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The data notifier must have been previously registered. - */ -extern void nss_ipsec_data_unregister(struct nss_ctx_instance *ctx, uint32_t if_num); - -/** - * nss_ipsec_get_context - * Gets the NSS context for the IPsec handle. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipsec_get_context(void); - -/** - * nss_ipsec_get_ifnum - * Gets the IPsec interface number with a core ID. - * - * @param[in] if_num NSS interface number. - * - * @return - * Interface number with the core ID. - */ -extern int32_t nss_ipsec_get_ifnum(int32_t if_num); - -/** - * nss_ipsec_msg_init - * Initializes an IPsec message. - * - * @datatypes - * nss_ipsec_msg \n - * nss_ipsec_msg_callback_t - * - * @param[in,out] nim Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_ipsec_msg_init(struct nss_ipsec_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, - nss_ipsec_msg_callback_t cb, void *app_data); - -/** - * nss_ipsec_get_encap_interface - * Gets the NSS interface number to be used for IPsec encapsulation message. - * - * @return - * Encapsulation interface number. - */ -extern int32_t nss_ipsec_get_encap_interface(void); - -/** - * nss_ipsec_get_decap_interface - * Gets the NSS interface number to be used for an IPsec decapsulation message. - * - * @return - * Decapsulation interface number. - */ -extern int32_t nss_ipsec_get_decap_interface(void); - -/** - * nss_ipsec_get_data_interface - * Gets the NSS interface number to be used for an IPsec data transfer. - * - * @return - * NSS interface number. - */ -extern int32_t nss_ipsec_get_data_interface(void); - -/** - * nss_ipsec_ppe_port_config - * Configure Packet Processing Engine IPsec port. - * - * @datatypes - * nss_ctx_instance \n - * net_device - * - * @param[in] ctx Pointer to the context of the HLOS driver. - * @param[in] netdev Pointer to the associated network device. - * @param[in] if_num Data interface number. - * @param[in] vsi_num Virtual switch instance number. - * - * @return - * True if successful, else false. - */ -extern bool nss_ipsec_ppe_port_config(struct nss_ctx_instance *ctx, struct net_device *netdev, - uint32_t if_num, uint32_t vsi_num); - -/** - * nss_ipsec_ppe_mtu_update() - * Configure Packet Processing Engine MTU for IPsec in-line. - * - * @datatypes - * nss_ctx_instance \n - * - * @param[in] ctx Pointer to the context of the HLOS driver. - * @param[in] if_num Data interface number. - * @param[in] mtu Maximum transmission unit of Interface number. - * @param[in] mru Maximum Receive unit of Interface number. - * - * @return - * True if successful, else false. - */ -bool nss_ipsec_ppe_mtu_update(struct nss_ctx_instance *ctx, uint32_t if_num, uint16_t mtu, uint16_t mru); - -/** - * @} - */ - -#endif /* __NSS_IPSEC_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsec_cmn.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsec_cmn.h deleted file mode 100644 index f9f4c78c5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsec_cmn.h +++ /dev/null @@ -1,691 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipsec_cmn.h - * NSS IPsec interface definitions. - */ - -#ifndef __NSS_IPSEC_CMN_H_ -#define __NSS_IPSEC_CMN_H_ - -/** - * @addtogroup nss_ipsec_subsystem - * @{ - */ - -#define NSS_IPSEC_CMN_ARPHRD_IPSEC 31 /**< ARP (iana.org) hardware type for an IPsec tunnel. */ - -/** - * Flags for SA configuration. - */ -#define NSS_IPSEC_CMN_FLAG_IPV6 (0x1 << 0) /**< IPv6 header. */ -#define NSS_IPSEC_CMN_FLAG_IPV4_NATT (0x1 << 1) /**< IPv4 NAT traversal. */ -#define NSS_IPSEC_CMN_FLAG_IPV4_UDP (0x1 << 2) /**< IPv4 UDP traversal. */ -#define NSS_IPSEC_CMN_FLAG_ESP_ESN (0x1 << 3) /**< Enable ESP extended sequence number. */ -#define NSS_IPSEC_CMN_FLAG_ESP_SKIP (0x1 << 4) /**< Skip ESP sequence number and ICV. */ -#define NSS_IPSEC_CMN_FLAG_ESP_REPLAY (0x1 << 5) /**< Check ESP replay counter. */ -#define NSS_IPSEC_CMN_FLAG_CIPHER_NULL (0x1 << 6) /**< NULL cipher mode. */ -#define NSS_IPSEC_CMN_FLAG_CIPHER_GCM (0x1 << 7) /**< Galios counter mode. */ -#define NSS_IPSEC_CMN_FLAG_COPY_DSCP (0x1 << 8) /**< Copy DSCP from inner to outer header. */ -#define NSS_IPSEC_CMN_FLAG_COPY_DF (0x1 << 9) /**< Copy DF from inner node to outer node. */ -#define NSS_IPSEC_CMN_FLAG_MODE_TRANS (0x1 << 10) /**< Encapsulate or decapsulate in transport mode (default is tunnel mode). */ - -#define NSS_IPSEC_CMN_FLAG_HDR_MASK \ - (NSS_IPSEC_CMN_FLAG_IPV6 | NSS_IPSEC_CMN_FLAG_IPV4_NATT | NSS_IPSEC_CMN_FLAG_IPV4_UDP) - /**< Flag header mask. */ - -#define NSS_IPSEC_CMN_FEATURE_INLINE_ACCEL 0x1 /**< Interface enabled for inline exception. */ - -#define NSS_IPSEC_CMN_MDATA_VERSION 0x01 /**< Metadata version. */ -#define NSS_IPSEC_CMN_MDATA_MAGIC 0x8893 /**< Metadata magic. */ -#define NSS_IPSEC_CMN_MDATA_ORIGIN_HOST 0x01 /**< Metadata originates at the host. */ -#define NSS_IPSEC_CMN_MDATA_ALIGN_SZ sizeof(uint32_t) /**< Metadata alignment size. */ -/** - * nss_ipsec_cmn_msg_type - * IPsec message types. - */ -enum nss_ipsec_cmn_msg_type { - NSS_IPSEC_CMN_MSG_TYPE_NONE = 0, /**< Nothing to do. */ - NSS_IPSEC_CMN_MSG_TYPE_NODE_CONFIG = 1, /**< Configure IPsec node. */ - NSS_IPSEC_CMN_MSG_TYPE_CTX_CONFIG = 2, /**< Configure IPsec dynamic node. */ - NSS_IPSEC_CMN_MSG_TYPE_CTX_SYNC = 3, /**< Synchronize context statistics to host. */ - NSS_IPSEC_CMN_MSG_TYPE_SA_CREATE = 4, /**< Create SA. */ - NSS_IPSEC_CMN_MSG_TYPE_SA_DESTROY = 5, /**< Destroy SA. */ - NSS_IPSEC_CMN_MSG_TYPE_SA_SYNC = 6, /**< Synchronize SA statistics to host. */ - NSS_IPSEC_CMN_MSG_TYPE_FLOW_CREATE = 7, /**< Create flow. */ - NSS_IPSEC_CMN_MSG_TYPE_FLOW_DESTROY = 8, /**< Delete flow. */ - NSS_IPSEC_CMN_MSG_TYPE_MAX -}; - -/** - * nss_ipsec_cmn_msg_error - * IPsec message error types. - */ -enum nss_ipsec_cmn_msg_error { - NSS_IPSEC_CMN_MSG_ERROR_NONE = 0, /**< No error. */ - NSS_IPSEC_CMN_MSG_ERROR_CTX_INVAL = 1, /**< Invalid context. */ - NSS_IPSEC_CMN_MSG_ERROR_SA_ALLOC = 2, /**< Failed to allocate SA. */ - NSS_IPSEC_CMN_MSG_ERROR_SA_INVAL = 3, /**< Invalid SA. */ - NSS_IPSEC_CMN_MSG_ERROR_SA_DUP = 4, /**< SA exists. */ - NSS_IPSEC_CMN_MSG_ERROR_SA_INUSE = 5, /**< SA is in use. */ - NSS_IPSEC_CMN_MSG_ERROR_FLOW_ALLOC = 6, /**< Failed to allocate flow. */ - NSS_IPSEC_CMN_MSG_ERROR_FLOW_INVAL = 7, /**< Flow not found. */ - NSS_IPSEC_CMN_MSG_ERROR_FLOW_DUP = 8, /**< Duplicate flow. */ - NSS_IPSEC_CMN_MSG_ERROR_FLOW_SA = 9, /**< Failed to find SA for the flow. */ - NSS_IPSEC_CMN_MSG_ERROR_NODE_REG_DYNIF = 10, - /**< Error registering dynamic interface. */ - NSS_IPSEC_CMN_MSG_ERROR_UNHANDLED_MSG= 11, /**< Unhandled message type. */ - NSS_IPSEC_CMN_MSG_ERROR_MAX /**< Maximum error message. */ -}; - -/** - * nss_ipsec_cmn_ctx_type - * IPsec context type. - */ -enum nss_ipsec_cmn_ctx_type { - NSS_IPSEC_CMN_CTX_TYPE_NONE = 0, /**< Invalid direction. */ - NSS_IPSEC_CMN_CTX_TYPE_INNER, /**< Encapsulation. */ - NSS_IPSEC_CMN_CTX_TYPE_MDATA_INNER, /**< Metadata for encapsulation. */ - NSS_IPSEC_CMN_CTX_TYPE_OUTER, /**< Decapsulation. */ - NSS_IPSEC_CMN_CTX_TYPE_MDATA_OUTER, /**< Metadata for decapsulation. */ - NSS_IPSEC_CMN_CTX_TYPE_REDIR, /**< Redirect. */ - NSS_IPSEC_CMN_CTX_TYPE_MAX -}; - -/** - * nss_ipsec_cmn_stats_types - * IPsec common statistics types. - */ -enum nss_ipsec_cmn_stats_types { - NSS_IPSEC_CMN_STATS_FAIL_HEADROOM = NSS_STATS_NODE_MAX, - /**< Failure in headroom check. */ - NSS_IPSEC_CMN_STATS_FAIL_TAILROOM, /**< Failure in tailroom check. */ - NSS_IPSEC_CMN_STATS_FAIL_REPLAY, /**< Failure in anti-replay check. */ - NSS_IPSEC_CMN_STATS_FAIL_REPLAY_DUP, /**< Failure in anti-replay; duplicate records. */ - NSS_IPSEC_CMN_STATS_FAIL_REPLAY_WIN, /**< Failure in anti-replay; packet outside the window. */ - NSS_IPSEC_CMN_STATS_FAIL_PBUF_CRYPTO, /**< Failure in crypto pbuf allocation. */ - NSS_IPSEC_CMN_STATS_FAIL_QUEUE, /**< Failure due to queue full in IPsec. */ - NSS_IPSEC_CMN_STATS_FAIL_QUEUE_CRYPTO, /**< Failure due to queue full in crypto. */ - NSS_IPSEC_CMN_STATS_FAIL_QUEUE_NEXTHOP, /**< Failure due to queue full in next hop. */ - NSS_IPSEC_CMN_STATS_FAIL_PBUF_ALLOC, /**< Failure in pbuf allocation. */ - NSS_IPSEC_CMN_STATS_FAIL_PBUF_LINEAR, /**< Failure in pbuf linearization. */ - NSS_IPSEC_CMN_STATS_FAIL_PBUF_STATS, /**< Failure in pbuf allocation for statistics. */ - NSS_IPSEC_CMN_STATS_FAIL_PBUF_ALIGN, /**< Failure in pbuf access due to non-word alignmnt */ - NSS_IPSEC_CMN_STATS_FAIL_CIPHER, /**< Failure in decrypting the data. */ - NSS_IPSEC_CMN_STATS_FAIL_AUTH, /**< Failure in authenticating the data. */ - NSS_IPSEC_CMN_STATS_FAIL_SEQ_OVF, /**< Failure due to sequence number rollover. */ - NSS_IPSEC_CMN_STATS_FAIL_BLK_LEN, /**< Failure in decapsulation due to bad cipher block length. */ - NSS_IPSEC_CMN_STATS_FAIL_HASH_LEN, /**< Failure in decapsulation due to bad hash block length. */ - NSS_IPSEC_CMN_STATS_FAIL_TRANSFORM, /**< Failure in transformation; general error. */ - NSS_IPSEC_CMN_STATS_FAIL_CRYPTO, /**< Failure in crypto transformation. */ - NSS_IPSEC_CMN_STATS_FAIL_CLE, /**< Failure in classification; general failure. */ - NSS_IPSEC_CMN_STATS_IS_STOPPED, /**< Indicates if SA is stopped; for example: sequence overflow. */ - NSS_IPSEC_CMN_STATS_MAX, /**< Maximum statistics type. */ -}; - -/** - * nss_ipsec_cmn_flow_tuple - * IPsec tuple for creating flow entries. - * - * Note: This is a common selector which is used for preparing - * a lookup tuple for incoming packets. The tuple is used - * for computing the hash index in the flow table. There are multiple - * fields in the tuple and the recipient node decides which fields - * it must use from the tuple to calculate the hash index. The host - * has no view of the hash index and hence must compute its own index - * based on the tuple. - */ -struct nss_ipsec_cmn_flow_tuple { - uint32_t dest_ip[4]; /**< Destination IP. */ - uint32_t src_ip[4]; /**< Source IP. */ - uint32_t spi_index; /**< ESP SPI index. */ - - uint16_t dst_port; /**< Destination L4 port. */ - uint16_t src_port; /**< Source L4 port. */ - - uint8_t user_pattern; /**< User defined field. */ - uint8_t protocol; /**< IP protocol types. */ - uint8_t ip_ver; /**< IP version. */ -}; - -/** - *nss_ipsec_cmn_sa_tuple - * IPsec outer header configuration. - */ -struct nss_ipsec_cmn_sa_tuple { - uint32_t dest_ip[4]; /**< Destination IP. */ - uint32_t src_ip[4]; /**< Source IP. */ - uint32_t spi_index; /**< ESP SPI index. */ - - uint16_t dest_port; /* Destination L4 port. */ - uint16_t src_port; /* Source L4 port. */ - - uint16_t crypto_index; /**< Crypto index for the SA. */ - uint8_t protocol; /**< Outer protocol. */ - uint8_t ip_ver; /**< IP version. */ - - uint8_t hop_limit; /**< Time-to-Live or next hop limit. */ - uint8_t res[3]; /**< Reserved. */ -}; - -/** - *nss_ipsec_cmn_sa_data - * IPsec SA data used for transformation. - */ -struct nss_ipsec_cmn_sa_data { - uint32_t seq_start; /**< Starting sequence number. */ - uint32_t flags; /**< Configuration flags. */ - - uint16_t window_size; /**< ESP sequence number window. */ - uint8_t dscp; /**< Default DSCP value of the SA. */ - uint8_t df; /**< Default do not fragment value of the SA. */ - - uint8_t blk_len; /**< Cipher block length. */ - uint8_t iv_len; /**< IV length. */ - uint8_t icv_len; /**< ESP trailers ICV length to apply. */ - uint8_t res1; /**< Reserved. */ - - uint32_t res2[4]; /**< Reserved for future use. */ -}; - -/** - * nss_ipsec_cmn_flow - * IPsec flow configuration message. - */ -struct nss_ipsec_cmn_flow { - struct nss_ipsec_cmn_flow_tuple flow_tuple; /**< Flow tuple. */ - struct nss_ipsec_cmn_sa_tuple sa_tuple; /**< SA tuple. */ -}; - -/** - * nss_ipsec_cmn_sa - * IPsec SA configuration message. - */ -struct nss_ipsec_cmn_sa { - struct nss_ipsec_cmn_sa_tuple sa_tuple; /**< SA tuple. */ - struct nss_ipsec_cmn_sa_data sa_data; /**< SA data. */ -}; - -/** - * nss_ipsec_cmn_ctx - * IPsec context configuration. - */ -struct nss_ipsec_cmn_ctx { - enum nss_ipsec_cmn_ctx_type type; /**< Node type. */ - uint32_t except_ifnum; /**< Exception interface for egress. */ - uint32_t sibling_ifnum; /**< Sibling interface. */ -}; - -/** - * nss_ipsec_cmn_node - * IPsec node configuration. - */ -struct nss_ipsec_cmn_node { - bool dma_redirect; /**< Enable redirect DMA ring. */ - bool dma_lookaside; /**< Enable lookaside DMA ring. */ - uint16_t max_sa; /**< Maximum number of SA(s) supported. */ -}; - -/** - * nss_ipsec_cmn_sa_replay - * IPsec replay statistics - */ -struct nss_ipsec_cmn_sa_replay { - uint64_t seq_start; /**< Start of replay window. */ - uint64_t seq_cur; /**< Current sequence number. */ - uint16_t window_size; /**< Window size. */ - uint8_t res[6]; /**< Reserved for future use. */ -}; - -/** - * nss_ipsec_cmn_sa_stats - * IPsec SA statistics. - */ -struct nss_ipsec_cmn_sa_stats { - struct nss_cmn_node_stats cmn_stats; /**< Packet statistics. */ - uint32_t fail_headroom; /**< Failed headroom check. */ - uint32_t fail_tailroom; /**< Failed tailroom check. */ - uint32_t fail_replay; /**< Failure in anti-replay check. */ - uint32_t fail_replay_dup; /**< Failure in anti-replay; duplicate records. */ - uint32_t fail_replay_win; /**< Failure in anti-replay; packet outside the window. */ - uint32_t fail_pbuf_crypto; /**< Failed to allocate crypto pbuf. */ - uint32_t fail_queue; /**< Failure due to queue full in IPsec. */ - uint32_t fail_queue_crypto; /**< Failure due to queue full in crypto. */ - uint32_t fail_queue_nexthop; /**< Failure due to queue full in next hop. */ - uint32_t fail_pbuf_alloc; /**< Failure in pbuf allocation. */ - uint32_t fail_pbuf_linear; /**< Failure in pbuf linearization. */ - uint32_t fail_pbuf_stats; /**< Failure in pbuf allocation for statistics. */ - uint32_t fail_pbuf_align; /**< Failure in pbuf access due to non-word alignment. */ - uint32_t fail_cipher; /**< Failure in decrypting the data. */ - uint32_t fail_auth; /**< Failure in authenticating the data. */ - uint32_t fail_seq_ovf; /**< Failure due to sequence number rollover. */ - uint32_t fail_blk_len; /**< Failure in decapsulation due to bad cipher block length. */ - uint32_t fail_hash_len; /**< Failure in decapsulation due to bad hash block length. */ - uint32_t fail_transform; /**< Failure in transformation; general error. */ - uint32_t fail_crypto; /**< Failure in crypto transformation. */ - uint32_t fail_cle; /**< Failure in classification; general failure. */ - uint32_t is_stopped; /**< Indicates if SA is stopped; for example, seq overflow. */ -}; - -/** - * nss_ipsec_cmn_sa_sync - * IPsec SA sync message. - */ -struct nss_ipsec_cmn_sa_sync { - struct nss_ipsec_cmn_sa_replay replay; /**< Replay statistics. */ - struct nss_ipsec_cmn_sa_tuple sa_tuple; /**< SA tuple. */ - struct nss_ipsec_cmn_sa_stats stats; /**< Packet and failure statistics. */ -}; - -/** - * nss_ipsec_cmn_ctx_stats - * IPsec context statistics. - */ -struct nss_ipsec_cmn_ctx_stats { - struct nss_cmn_node_stats cmn_stats; - /**< Packet statistics. */ - uint32_t exceptioned; /**< Exceptioned to host. */ - uint32_t linearized; /**< Linearized packets. */ - uint32_t redirected; /**< Redirected from inline. */ - uint32_t dropped; /**< Total dropped packets. */ - uint32_t fail_sa; /**< Failed to find SA. */ - uint32_t fail_flow; /**< Failed to find flow. */ - uint32_t fail_stats; /**< Failed to send statistics. */ - uint32_t fail_exception; /**< Failed to exception. */ - uint32_t fail_transform; /**< Failed to produce output. */ - uint32_t fail_linearized; /**< Failed to linearize. */ - uint32_t fail_mdata_ver; /**< Invalid metadata version. */ - uint32_t fail_ctx_active; /**< Failed to queue as context is not active. */ - uint32_t fail_pbuf_crypto; /**< Failed to allocate pbuf for crypto operation. */ - uint32_t fail_queue_crypto; /**< Failed to queue pbuf to crypto pnode. */ -}; - -/** - * nss_ipsec_cmn_ctx_sync - * IPsec context synchronous message. - */ -struct nss_ipsec_cmn_ctx_sync { - enum nss_ipsec_cmn_ctx_type type; /**< IPsec context type. */ - struct nss_ipsec_cmn_ctx_stats stats; /**< Context statistics. */ -}; - -/** - * nss_ipsec_cmn_mdata_cmn - * IPsec common metadata information. - */ -struct nss_ipsec_cmn_mdata_cmn { - uint8_t version; /**< Metadata version. */ - uint8_t origin; /**< Metadata origin (host or NSS). */ - uint16_t len; /**< Metadata length including extra bytes. */ - uint8_t res[2]; /**< Reserved for future. */ - uint16_t magic; /**< Metadata magic. */ -}; - -/** - * nss_ipsec_cmn_mdata_encap - * IPsec encapsulation metadata information. - */ -struct nss_ipsec_cmn_mdata_encap { - struct nss_ipsec_cmn_sa_tuple sa; /**< SA tuple. */ - uint32_t seq_num; /**< Sequence number for encapsulation (zero disables it). */ - uint16_t data_len; /**< Length of data to encapsulate. */ - uint16_t flags; /**< Encapsulation metadata flags. */ -}; - -/** - * nss_ipsec_cmn_mdata_decap - * IPsec decapsulation metadata information. - */ -struct nss_ipsec_cmn_mdata_decap { - struct nss_ipsec_cmn_sa_tuple sa; /**< SA tuple. */ -}; - -/** - * nss_ipsec_cmn_mdata - * IPsec metadata for host originated packets. - */ -struct nss_ipsec_cmn_mdata { - struct nss_ipsec_cmn_mdata_cmn cm; /**< Common metadata. */ - - union { - struct nss_ipsec_cmn_mdata_encap encap; /**< Encapsulation metadata. */ - struct nss_ipsec_cmn_mdata_decap decap; /**< Decapsulation metadata. */ - } data; /**< Metadata payload. */ -}; - -/** - * nss_ipsec_cmn_stats_notification - * IPsec common transmission statistics structure. - */ -struct nss_ipsec_cmn_stats_notification { - uint64_t stats_ctx[NSS_IPSEC_CMN_STATS_MAX]; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_ipsec_cmn_msg - * Message structure for NSS IPsec messages. - */ -struct nss_ipsec_cmn_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of IPsec interface message. - */ - union { - struct nss_ipsec_cmn_node node; /**< Node configuration message. */ - struct nss_ipsec_cmn_ctx ctx; /**< Context configuration message. */ - struct nss_ipsec_cmn_sa sa; /**< SA configuration message. */ - struct nss_ipsec_cmn_flow flow; /**< Flow configuration message. */ - struct nss_ipsec_cmn_sa_sync sa_sync; /**< SA statistics message. */ - struct nss_ipsec_cmn_ctx_sync ctx_sync; /**< Context statistics message. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_ipsec_cmn_mdata_init - * Initialize the metadata common fields. - * - * @datatypes - * nss_ipsec_cmn_mdata - * - * @param[in] mdata Metadata pointer. - * @param[in] len Metadata length including extra bytes. - * - * @return - * Pointer to metadata payload. - */ -static inline void *nss_ipsec_cmn_mdata_init(struct nss_ipsec_cmn_mdata *mdata, uint16_t len) -{ - mdata->cm.len = len; - mdata->cm.magic = NSS_IPSEC_CMN_MDATA_MAGIC; - mdata->cm.version = NSS_IPSEC_CMN_MDATA_VERSION; - mdata->cm.origin = NSS_IPSEC_CMN_MDATA_ORIGIN_HOST; - - return &mdata->data; -} - -/** - * Callback function for receiving message notifications. - * - * @datatypes - * nss_ipsec_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_ipsec_cmn_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * Callback function for receiving data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the message data. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_ipsec_cmn_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_ipsec_cmn_get_context - * Gets the NSS context for the IPsec handle. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipsec_cmn_get_context(void); - -/** - * nss_ipsec_cmn_get_ifnum_with_coreid - * Gets the IPsec interface number with a core ID. - * - * @param[in] ifnum NSS interface number. - * - * @return - * Interface number with the core ID. - */ -extern uint32_t nss_ipsec_cmn_get_ifnum_with_coreid(int32_t ifnum); - -/** - * nss_ipsec_cmn_unregister_if - * Deregisters an IPSEC tunnel interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The tunnel interface must have been previously registered. - * - * @return - * True if successful, else false. - */ -extern bool nss_ipsec_cmn_unregister_if(uint32_t if_num); - -/** - * nss_ipsec_cmn_register_if - * Registers the IPsec interface with the NSS for sending and - * receiving messages. - * - * @datatypes - * nss_ipsec_cmn_data_callback_t \n - * nss_ipsec_cmn_msg_callback_t \n - * nss_dynamic_interface_type \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] netdev Pointer to the associated network device. - * @param[in] cb_data Callback for the data. - * @param[in] cb_msg Callback for the message. - * @param[in] features Socket buffer types supported by this interface. - * @param[in] type Dynamic interface type. - * @param[in] app_data Application context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipsec_cmn_register_if(uint32_t if_num, struct net_device *netdev, - nss_ipsec_cmn_data_callback_t cb_data, - nss_ipsec_cmn_msg_callback_t cb_msg, - uint32_t features, enum nss_dynamic_interface_type type, void *app_data); - -/** - * nss_ipsec_cmn_notify_unregister - * Deregisters the message notifier from the HLOS driver. - * - * @datatypes - * nss_ctx_instance - * - * @param[in,out] ctx Pointer to the context of the HLOS driver. - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The message notifier must have been previously registered. - */ -extern void nss_ipsec_cmn_notify_unregister(struct nss_ctx_instance *ctx, uint32_t if_num); - -/** - * nss_ipsec_cmn_notify_register - * Registers an event callback to handle notifications from the IPsec firmware package. - * - * @datatypes - * nss_ipsec_cmn_msg_callback_t \n - * - * @param[in] ifnum NSS interface number. - * @param[in] cb Callback for IPsec message. - * @param[in] app_data Pointer to the application context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipsec_cmn_notify_register(uint32_t ifnum, nss_ipsec_cmn_msg_callback_t cb, void *app_data); - -/** - * nss_ipsec_cmn_msg_init - * Initializes an IPsec message. - * - * @datatypes - * nss_ipsec_cmn_msg \n - * nss_ipsec_cmn_msg_type \n - * nss_ipsec_cmn_msg_callback_t - * - * @param[in,out] nim Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_ipsec_cmn_msg_init(struct nss_ipsec_cmn_msg *nim, uint16_t if_num, enum nss_ipsec_cmn_msg_type type, - uint16_t len, nss_ipsec_cmn_msg_callback_t cb, void *app_data); - -/** - * nss_ipsec_cmn_tx_msg - * Sends an asynchronous IPsec message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipsec_cmn_msg - * - * @param[in] nss_ctx Pointer to the NSS HLOS driver context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipsec_cmn_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_ipsec_cmn_msg *msg); - -/** - * nss_ipsec_cmn_tx_msg_sync - * Sends a synchronous IPsec message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipsec_cmn_msg_type \n - * nss_ipsec_cmn_msg - * - * @param[in] nss_ctx Pointer to the NSS HLOS driver context. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] nicm Pointer to the NSS IPsec message. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipsec_cmn_tx_msg_sync(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - enum nss_ipsec_cmn_msg_type type, uint16_t len, - struct nss_ipsec_cmn_msg *nicm); - -/** - * nss_ipsec_cmn_tx_buf - * Sends a buffer to NSS for IPsec encapsulation or de-capsulation. - * - * @datatypes - * sk_buff \n - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS HLOS driver context. - * @param[in] skb Pointer to the message data. - * @param[in] if_num Pointer to the NSS interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipsec_cmn_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *skb, uint32_t if_num); - -/** - * nss_ipsec_cmn_ppe_port_config - * Configure Packet Processing Engine IPsec port. - * - * @datatypes - * nss_ctx_instance \n - * net_device - * - * @param[in] ctx Pointer to the context of the HLOS driver. - * @param[in] netdev Pointer to the associated network device. - * @param[in] if_num Data interface number. - * @param[in] vsi_num Virtual switch instance number. - * - * @return - * True if successful, else false. - */ -extern bool nss_ipsec_cmn_ppe_port_config(struct nss_ctx_instance *ctx, struct net_device *netdev, - uint32_t if_num, uint32_t vsi_num); - -/** - * nss_ipsec_cmn_ppe_mtu_update() - * Configure Packet Processing Engine MTU for IPsec inline. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] ctx Pointer to the context of the HLOS driver. - * @param[in] if_num Data interface number. - * @param[in] mtu Maximum transmission unit of interface number. - * @param[in] mru Maximum receive unit of interface number. - * - * @return - * True if successful, else false. - */ -bool nss_ipsec_cmn_ppe_mtu_update(struct nss_ctx_instance *ctx, uint32_t if_num, uint16_t mtu, uint16_t mru); - -/** - * nss_ipsec_cmn_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_ipsec_cmn_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_ipsec_cmn_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_ipsec_cmn_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* !__NSS_IPSEC_CMN_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsecmgr.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsecmgr.h deleted file mode 100644 index 3fe3460f9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipsecmgr.h +++ /dev/null @@ -1,443 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipsecmgr.h - * NSS IPSec Manager interface definitions. - */ - -#ifndef __NSS_IPSECMGR_H -#define __NSS_IPSECMGR_H - -/** - * @addtogroup nss_ipsec_subsystem - * @{ - */ - -#define NSS_IPSECMGR_DEBUG_LVL_ERROR 1 /**< Turn on debug for an error. */ -#define NSS_IPSECMGR_DEBUG_LVL_WARN 2 /**< Turn on debug for a warning. */ -#define NSS_IPSECMGR_DEBUG_LVL_INFO 3 /**< Turn on debug for information. */ -#define NSS_IPSECMGR_DEBUG_LVL_TRACE 4 /**< Turn on debug for trace. */ - -#define NSS_IPSECMGR_TUN_NAME "ipsectun%d" - /**< IPsec tunnel name. */ -#define NSS_IPSECMGR_MAX_TUNNELS (NSS_CRYPTO_MAX_IDXS/2) - /**< Maximum number of IPsec tunnels. */ - -/** - * Length of the header added after encapsulation. - * - * This estimate must be accurate but large enough to accomodate most use cases. - */ -#define NSS_IPSECMGR_TUN_MAX_HDR_LEN 96 - -/* - * Space required in the head and tail of the buffer - */ -#define NSS_IPSECMGR_TUN_HEADROOM 128 /**< Size of the buffer headroom. */ -#define NSS_IPSECMGR_TUN_TAILROOM 192 /**< Size of the buffer tailroom. */ - -#define NSS_IPSECMGR_TUN_MTU(x) (x - NSS_IPSECMGR_TUN_MAX_HDR_LEN) - /**< MTU of the IPsec tunnel. */ - -#define NSS_IPSECMGR_NATT_PORT_DATA 4500 /**< Number of the NATT port. */ - -#define NSS_IPSECMGR_MIN_REPLAY_WIN 32 /**< Minimum size of the replay window. */ -#define NSS_IPSECMGR_MAX_REPLAY_WIN 1024 /**< Maximum size of the replay window. */ -#define NSS_IPSECMGR_MAX_ICV_LEN 32 /**< Maximum size of the ICV. */ -#define NSS_IPSECMGR_MAX_DSCP 63 /**< Maximum size of the descriptor. */ - -/** - * nss_ipsecmgr_flow_type - * Flow types for the IPsec manager. - */ -enum nss_ipsecmgr_flow_type { - NSS_IPSECMGR_FLOW_TYPE_NONE = 0, - NSS_IPSECMGR_FLOW_TYPE_V4_TUPLE = 1, - NSS_IPSECMGR_FLOW_TYPE_V6_TUPLE = 2, - NSS_IPSECMGR_FLOW_TYPE_V4_SUBNET = 3, - NSS_IPSECMGR_FLOW_TYPE_V6_SUBNET = 4, - NSS_IPSECMGR_FLOW_TYPE_MAX -}; - -/** - * nss_ipsecmgr_sa_type - * Security association types for the IPsec manager. - */ -enum nss_ipsecmgr_sa_type { - NSS_IPSECMGR_SA_TYPE_NONE = 0, - NSS_IPSECMGR_SA_TYPE_V4 = 1, - NSS_IPSECMGR_SA_TYPE_V6 = 2, - NSS_IPSECMGR_SA_TYPE_MAX -}; - -/** - * nss_ipsecmgr_event_type - * Event types for the IPsec manager. - */ -enum nss_ipsecmgr_event_type { - NSS_IPSECMGR_EVENT_NONE = 0, - NSS_IPSECMGR_EVENT_SA_STATS, - NSS_IPSECMGR_EVENT_MAX -}; - -/** - * nss_ipsecmgr_sa_v4 - * IPv4 security associations for the IPsec manager. - */ -struct nss_ipsecmgr_sa_v4 { - uint32_t src_ip; /**< IPv4 source IP. */ - uint32_t dst_ip; /**< IPv4 destination IP. */ - uint32_t ttl; /**< IPv4 time-to-live. */ - uint32_t spi_index; /**< ESP SPI index. */ -}; - -/** - * nss_ipsecmgr_sa_v6 - * IPv6 security associations for the IPsec manager. - */ -struct nss_ipsecmgr_sa_v6 { - uint32_t src_ip[4]; /**< IPv6 source IP. */ - uint32_t dst_ip[4]; /**< IPv6 destination IP. */ - uint32_t hop_limit; /**< IPv6 hop limit. */ - uint32_t spi_index; /**< SPI index of the encapsulating security payload (ESP). */ -}; - -/** - * nss_ipsecmgr_sa_data - * Security association data for the IPsec manager. - * - * For DSCP marking, use the following settings: - * - Copy inner header to outer header: - * - dscp_copy = 1 - * - dscp = 0 - * - Fixed mark on outer header: - * - dscp_copy = 0 - * - dscp = <0 to 63> - */ -struct nss_ipsecmgr_sa_data { - uint32_t crypto_index; /**< Crypto session index returned by the driver. */ - - /** - * Security association data for the IPsec manager. - */ - struct { - uint16_t replay_win; - /**< Sequence number window size for anti-replay. */ - uint8_t icv_len; - /**< Hash length. */ - uint8_t dscp; - /**< Default DSCP value of the security association. */ - - bool dscp_copy; - /**< Copy DSCP from the inner header to the outer header. */ - bool nat_t_req; - /**< NAT-T is required. */ - bool seq_skip; - /**< Skip the ESP sequence for encapsulation. */ - bool trailer_skip; - /**< Skip the ESP trailer for encapsulation. */ - bool df_copy; - /**< Copy DF from the inner header to the outer header. */ - uint8_t df; - /**< DF value for the outer header, if nocopy is selected. */ - } esp; /**< Payload of security association data. */ - - bool enable_esn; /**< Enable the extended sequence number. */ - bool use_pattern; /**< Use a random pattern in a hash calculation. */ - uint32_t fail_hash_thresh; /**< Threshold for consecutive hash failure. */ -}; - -/** - * nss_ipsecmgr_encap_v4_tuple - * IPv4 encapsulation flow tuple for the IPsec manager. - */ -struct nss_ipsecmgr_encap_v4_tuple { - uint32_t src_ip; /**< Source IP. */ - uint32_t dst_ip; /**< Destination IP. */ - uint32_t protocol; /**< Protocol. */ -}; - -/** - * nss_ipsecmgr_encap_v6_tuple - * IPv6 encapsulation flow tuple for the IPsec manager. - */ -struct nss_ipsecmgr_encap_v6_tuple { - uint32_t src_ip[4]; /**< Source IP. */ - uint32_t dst_ip[4]; /**< Destination IP. */ - uint32_t next_hdr; /**< Transport layer protocol. */ -}; - -/** - * nss_ipsecmgr_encap_v4_subnet - * IPv4 encapsulation flow subnet for the IPsec manager. - */ -struct nss_ipsecmgr_encap_v4_subnet { - uint32_t dst_subnet; /**< Destination subnet. */ - uint32_t dst_mask; /**< Destination subnet mask. */ - uint32_t protocol; /**< IPv4 or IPv6 protocol. */ -}; - -/** - * nss_ipsecmgr_encap_v6_subnet - * IPv6 encapsulation flow subnet for the IPsec manager. - * - * Store least significant word in dst_subnet[0] and the most significant word - * in dst_subnet[3]. - */ -struct nss_ipsecmgr_encap_v6_subnet { - uint32_t dst_subnet[4]; /**< Destination subnet. */ - uint32_t dst_mask[4]; /**< Destination subnet mask. */ - uint32_t next_hdr; /**< Transport layer protocol. */ -}; - -/** - * nss_ipsecmgr_sa - * Security association information for the IPsec manager. - */ -struct nss_ipsecmgr_sa { - enum nss_ipsecmgr_sa_type type; /**< Security association type. */ - - /** - * IPsec manager security association data. - */ - union { - struct nss_ipsecmgr_sa_v4 v4; /**< IPv4 security association. */ - struct nss_ipsecmgr_sa_v6 v6; /**< IPv6 security association. */ - } data; /**< IPsec manager security association data. */ -}; - -/** - * nss_ipsecmgr_sa_stats - * Security association statistics exported by the IPsec manager. - */ -struct nss_ipsecmgr_sa_stats { - struct nss_ipsecmgr_sa sa; /**< Security association information. */ - uint32_t crypto_index; /**< Crypto session index. */ - - /** - * Security association statistics used by the IPsec manager. - */ - struct { - uint32_t bytes; /**< Number of bytes processed. */ - uint32_t count; /**< Number of packets processed. */ - } pkts; /**< Processing statistics. */ - - uint64_t seq_num; /**< Current sequence number. */ - uint64_t window_max; /**< Maximum size of the window. */ - uint32_t window_size; /**< Current size of the window. */ - - bool fail_hash_alarm; - /**< Alarm for consecutive hash fail. */ - bool esn_enabled; - /**< Specifies whether ESN is enabled. */ -}; - -/** - * nss_ipsecmgr_event - * Event information for the IPsec manager. - */ -struct nss_ipsecmgr_event { - enum nss_ipsecmgr_event_type type; /**< Event type. */ - - /** - * Event information statistics for the IPsec manager. - */ - union { - struct nss_ipsecmgr_sa_stats stats; - /**< Security association statistics. */ - } data; /**< Event information. */ -}; - -/** - * nss_ipsecmgr_encap_flow - * Encapsulation flow information for the IPsec manager. - */ -struct nss_ipsecmgr_encap_flow { - enum nss_ipsecmgr_flow_type type; /**< Flow type. */ - - /** - * Payload of encapsulation flow data for the IPsec manager. - */ - union { - struct nss_ipsecmgr_encap_v4_tuple v4_tuple; - /**< IPv4 tuple. */ - struct nss_ipsecmgr_encap_v4_subnet v4_subnet; - /**< IPv4 subnet. */ - struct nss_ipsecmgr_encap_v6_tuple v6_tuple; - /**< IPv6 tuple. */ - struct nss_ipsecmgr_encap_v6_subnet v6_subnet; - /**< IPv6 subnet. */ - } data; /**< Encapsulation flow information. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * Callback function for receiving IPsec data. - * - * @datatypes - * sk_buff - * - * @param[in] ctx Pointer to the context of the data. - * @param[in] skb Pointer to the data socket buffer. - */ -typedef void (*nss_ipsecmgr_data_cb_t) (void *ctx, struct sk_buff *skb); - -/** - * Callback function for receiving IPsec events. - * - * @datatypes - * nss_ipsecmgr_event - * - * @param[in] ctx Pointer to the context of the event. - * @param[in] ev Pointer to the event. - */ -typedef void (*nss_ipsecmgr_event_cb_t) (void *ctx, struct nss_ipsecmgr_event *ev); - -/** - * nss_ipsecmgr_callback - * Callback information. - */ -struct nss_ipsecmgr_callback { - void *ctx; /**< Context of the caller. */ - nss_ipsecmgr_data_cb_t data_fn; /**< Data callback function. */ - nss_ipsecmgr_event_cb_t event_fn; /**< Event callback function. */ -}; - -/** - * nss_ipsecmgr_tunnel_add - * Adds a new IPsec tunnel. - * - * @datatypes - * nss_ipsecmgr_callback - * - * @param[in] cb Pointer to the message callback. - * - * @return - * Linux NETDEVICE or NULL. - */ -struct net_device *nss_ipsecmgr_tunnel_add(struct nss_ipsecmgr_callback *cb); - -/** - * nss_ipsecmgr_tunnel_del - * Deletes an existing IPsec tunnel. - * - * @datatypes - * net_device - * - * @param[in] tun Pointer to the network device associated with the tunnel. - * - * @return - * Success or failure. - */ -bool nss_ipsecmgr_tunnel_del(struct net_device *tun); - -/** - * nss_ipsecmgr_tunnel_update_callback - * Updates the binding of netdevice and callback. - * - * @datatypes - * net_device - * - * @param[in] tun Pointer to IPsec tunnel. - * @param[in] cur Pointer to Linux netdevice. - * - * @return - * None. - */ -void nss_ipsecmgr_tunnel_update_callback(struct net_device *tun, struct net_device *cur); - -/** - * nss_ipsecmgr_encap_add - * Adds an encapsulation flow rule to the IPsec offload database. - * - * @datatypes - * net_device \n - * nss_ipsecmgr_encap_flow \n - * nss_ipsecmgr_sa \n - * nss_ipsecmgr_sa_data - * - * @param[in] tun Pointer to the network device associated with the tunnel. - * @param[in] flow Pointer to the flow or subnet to add. - * @param[in] sa Pointer to the security association for the flow. - * @param[in] data Pointer to additional security association data. - * - * @return - * Success or failure. - */ -bool nss_ipsecmgr_encap_add(struct net_device *tun, struct nss_ipsecmgr_encap_flow *flow, struct nss_ipsecmgr_sa *sa, - struct nss_ipsecmgr_sa_data *data); - -/** - * nss_ipsecmgr_encap_del - * Deletes an encapsulation flow rule from the IPsec offload database. - * - * @datatypes - * net_device \n - * nss_ipsecmgr_encap_flow \n - * nss_ipsecmgr_sa - * - * @param[in] tun Pointer to the network device associated with the tunnel. - * @param[in] flow Pointer to the flow or subnet to delete. - * @param[in] sa Pointer to the security association for the flow. - * - * @return - * Success or failure. - */ -bool nss_ipsecmgr_encap_del(struct net_device *tun, struct nss_ipsecmgr_encap_flow *flow, struct nss_ipsecmgr_sa *sa); - -/** - * nss_ipsecmgr_decap_add - * Adds a decapsulation security association to the offload database. - * - * @datatypes - * net_device \n - * nss_ipsecmgr_sa \n - * nss_ipsenss_ipsecmgr_sa_datacmgr_sa - * - * @param[in] tun Pointer to the network device associated with the tunnel. - * @param[in] sa Pointer to the security association for the decapsulation. - * @param[in] data Pointer to additional security association data. - * - * @return - * Success or failure. - */ -bool nss_ipsecmgr_decap_add(struct net_device *tun, struct nss_ipsecmgr_sa *sa, struct nss_ipsecmgr_sa_data *data); - -/** - * nss_ipsecmgr_sa_flush - * Flushes the security association and all associated flows and subnets. - * - * @datatypes - * net_device \n - * nss_ipsecmgr_sa - * - * @param[in] tun Pointer to the network device associated with the tunnel. - * @param[in] sa Pointer to the security association to flush. - * - * @return - * Success or failure. - */ -bool nss_ipsecmgr_sa_flush(struct net_device *tun, struct nss_ipsecmgr_sa *sa); - -#endif /* __KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_IPSECMGR_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv4.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv4.h deleted file mode 100644 index ee3a552eb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv4.h +++ /dev/null @@ -1,1310 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipv4.h - * NSS IPv4 interface definitions. - */ - -#ifndef __NSS_IPV4_H -#define __NSS_IPV4_H - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -#include "nss_stats_public.h" -#endif - -/** - * @addtogroup nss_ipv4_subsystem - * @{ - */ - -/* - * IPv4 connection flags (to be used with nss_ipv4_create::flags). - */ -#define NSS_IPV4_CREATE_FLAG_NO_SEQ_CHECK 0x01 - /**< Rule for not checking sequence numbers. */ -#define NSS_IPV4_CREATE_FLAG_BRIDGE_FLOW 0x02 - /**< Rule that indicates pure bridge flow (no routing is involved). */ -#define NSS_IPV4_CREATE_FLAG_ROUTED 0x04 /**< Rule for a routed connection. */ - -#define NSS_IPV4_CREATE_FLAG_DSCP_MARKING 0x08 /**< Rule for DSCP marking. */ -#define NSS_IPV4_CREATE_FLAG_VLAN_MARKING 0x10 /**< Rule for VLAN marking. */ -#define NSS_IPV4_CREATE_FLAG_QOS_VALID 0x20 /**< Rule for QoS is valid. */ - -/** - * nss_ipv4_create - * Information for an IPv4 flow or connection create rule. - * - * All fields must be passed in host-endian order. - */ -struct nss_ipv4_create { - int32_t src_interface_num; - /**< Source interface number (virtual or physical). */ - int32_t dest_interface_num; - /**< Destination interface number (virtual or physical). */ - int32_t protocol; /**< L4 protocol (e.g., TCP or UDP). */ - uint32_t flags; /**< Flags (if any) associated with this rule. */ - uint32_t from_mtu; /**< MTU of the incoming interface. */ - uint32_t to_mtu; /**< MTU of the outgoing interface. */ - uint32_t src_ip; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t src_ip_xlate; /**< Translated source IP address (used with SNAT). */ - int32_t src_port_xlate; /**< Translated source L4 port (used with SNAT). */ - uint32_t dest_ip; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip_xlate; - /**< Translated destination IP address (used with DNAT). */ - int32_t dest_port_xlate; - /**< Translated destination L4 port (used with DNAT). */ - uint8_t src_mac[ETH_ALEN]; - /**< Source MAC address. */ - uint8_t dest_mac[ETH_ALEN]; - /**< Destination MAC address. */ - uint8_t src_mac_xlate[ETH_ALEN]; - /**< Translated source MAC address (post-routing). */ - uint8_t dest_mac_xlate[ETH_ALEN]; - /**< Translated destination MAC address (post-routing). */ - uint8_t flow_window_scale; /**< Window scaling factor (TCP). */ - uint32_t flow_max_window; /**< Maximum window size (TCP). */ - uint32_t flow_end; /**< TCP window end. */ - uint32_t flow_max_end; /**< TCP window maximum end. */ - uint32_t flow_pppoe_if_exist; - /**< Flow direction: PPPoE interface exist flag. */ - int32_t flow_pppoe_if_num; - /**< Flow direction: PPPoE interface number. */ - uint16_t ingress_vlan_tag; /**< Ingress VLAN tag expected for this flow. */ - uint8_t return_window_scale; - /**< Window scaling factor of the return direction (TCP). */ - uint32_t return_max_window; - /**< Maximum window size of the return direction. */ - uint32_t return_end; - /**< Flow end for the return direction. */ - uint32_t return_max_end; - /**< Flow maximum end for the return direction. */ - uint32_t return_pppoe_if_exist; - /**< Return direction: PPPoE interface existence flag. */ - int32_t return_pppoe_if_num; - /**< Return direction: PPPoE interface number. */ - uint16_t egress_vlan_tag; /**< Egress VLAN tag expected for this flow. */ - uint8_t spo_needed; /**< Indicates whether SPO is required. */ - uint32_t param_a0; /**< Custom parameter 0. */ - uint32_t param_a1; /**< Custom parameter 1. */ - uint32_t param_a2; /**< Custom parameter 2. */ - uint32_t param_a3; /**< Custom parameter 3. */ - uint32_t param_a4; /**< Custom parameter 4. */ - uint32_t qos_tag; /**< Deprecated, will be removed soon. */ - uint32_t flow_qos_tag; /**< QoS tag value for the flow direction. */ - uint32_t return_qos_tag; /**< QoS tag value for the return direction. */ - uint8_t dscp_itag; /**< DSCP marking tag. */ - uint8_t dscp_imask; /**< DSCP marking input mask. */ - uint8_t dscp_omask; /**< DSCP marking output mask. */ - uint8_t dscp_oval; /**< DSCP marking output value. */ - uint16_t vlan_itag; /**< VLAN marking tag. */ - uint16_t vlan_imask; /**< VLAN marking input mask. */ - uint16_t vlan_omask; /**< VLAN marking output mask. */ - uint16_t vlan_oval; /**< VLAN marking output value. */ - uint32_t in_vlan_tag[MAX_VLAN_DEPTH]; - /**< Ingress VLAN tag expected for this flow. */ - uint32_t out_vlan_tag[MAX_VLAN_DEPTH]; - /**< Egress VLAN tag expected for this flow. */ - uint8_t flow_dscp; /**< IP DSCP value for the flow direction. */ - uint8_t return_dscp; /**< IP DSCP value for the return direction. */ -}; - -/** - * nss_ipv4_destroy - * Information for an IPv4 flow or connection destroy rule. - */ -struct nss_ipv4_destroy { - int32_t protocol; /**< L4 protocol ID. */ - uint32_t src_ip; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ -}; - -/** - * nss_ipv4_message_types - * IPv4 bridge and routing rule message types. - * - * NSS_IPV4_RX_DEPRECATED0 is a deprecated type. It is kept for backward compatibility. - */ -enum nss_ipv4_message_types { - NSS_IPV4_TX_CREATE_RULE_MSG, - NSS_IPV4_TX_DESTROY_RULE_MSG, - NSS_IPV4_RX_DEPRECATED0, - NSS_IPV4_RX_CONN_STATS_SYNC_MSG, - NSS_IPV4_RX_NODE_STATS_SYNC_MSG, - NSS_IPV4_TX_CONN_CFG_RULE_MSG, - NSS_IPV4_TX_CREATE_MC_RULE_MSG, - NSS_IPV4_TX_CONN_STATS_SYNC_MANY_MSG, - NSS_IPV4_TX_ACCEL_MODE_CFG_MSG, - NSS_IPV4_TX_CONN_CFG_INQUIRY_MSG, - NSS_IPV4_TX_CONN_TABLE_SIZE_MSG, - NSS_IPV4_TX_DSCP2PRI_CFG_MSG, - NSS_IPV4_TX_RPS_HASH_BITMAP_CFG_MSG, - NSS_IPV4_MAX_MSG_TYPES, -}; - -/** - * nss_ipv4_dscp_map_actions - * Action types mapped to DSCP values. - */ -enum nss_ipv4_dscp_map_actions { - NSS_IPV4_DSCP_MAP_ACTION_ACCEL, - NSS_IPV4_DSCP_MAP_ACTION_DONT_ACCEL, - NSS_IPV4_DSCP_MAP_ACTION_MAX, -}; - -/** - * nss_ipv4_stats_types - * IPv4 node statistics. - */ -enum nss_ipv4_stats_types { - NSS_IPV4_STATS_ACCELERATED_RX_PKTS = 0, - /**< Accelerated IPv4 Rx packets. */ - NSS_IPV4_STATS_ACCELERATED_RX_BYTES, - /**< Accelerated IPv4 Rx bytes. */ - NSS_IPV4_STATS_ACCELERATED_TX_PKTS, - /**< Accelerated IPv4 Tx packets. */ - NSS_IPV4_STATS_ACCELERATED_TX_BYTES, - /**< Accelerated IPv4 Tx bytes. */ - NSS_IPV4_STATS_CONNECTION_CREATE_REQUESTS, - /**< Number of IPv4 connection create requests. */ - NSS_IPV4_STATS_CONNECTION_CREATE_COLLISIONS, - /**< Number of IPv4 connection create requests that collided with existing entries. */ - NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_INTERFACE, - /**< Number of IPv4 connection create requests that had invalid interface. */ - NSS_IPV4_STATS_CONNECTION_DESTROY_REQUESTS, - /**< Number of IPv4 connection destroy requests. */ - NSS_IPV4_STATS_CONNECTION_DESTROY_MISSES, - /**< Number of IPv4 connection destroy requests that missed the cache. */ - NSS_IPV4_STATS_CONNECTION_HASH_HITS, - /**< Number of IPv4 connection hash hits. */ - NSS_IPV4_STATS_CONNECTION_HASH_REORDERS, - /**< Number of IPv4 connection hash reorders. */ - NSS_IPV4_STATS_CONNECTION_FLUSHES, - /**< Number of IPv4 connection flushes. */ - NSS_IPV4_STATS_CONNECTION_EVICTIONS, - /**< Number of IPv4 connection evictions. */ - NSS_IPV4_STATS_FRAGMENTATIONS, - /**< Number of successful IPv4 fragmentations performed. */ - NSS_IPV4_STATS_DROPPED_BY_RULE, - /**< Number of IPv4 packets dropped because of a drop rule.*/ - NSS_IPV4_STATS_MC_CONNECTION_CREATE_REQUESTS, - /**< Number of successful IPv4 multicast create requests. */ - NSS_IPV4_STATS_MC_CONNECTION_UPDATE_REQUESTS, - /**< Number of successful IPv4 multicast update requests. */ - NSS_IPV4_STATS_MC_CONNECTION_CREATE_INVALID_INTERFACE, - /**< Number of IPv4 multicast connection create requests that had invalid interface. */ - NSS_IPV4_STATS_MC_CONNECTION_DESTROY_REQUESTS, - /**< Number of IPv4 multicast connection destroy requests. */ - NSS_IPV4_STATS_MC_CONNECTION_DESTROY_MISSES, - /**< Number of IPv4 multicast connection destroy requests that missed the cache. */ - NSS_IPV4_STATS_MC_CONNECTION_FLUSHES, - /**< Number of IPv4 multicast connection flushes. */ - NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM, - /**< Number of IPv4 mirror connection requests with an invalid interface number. */ - NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE, - /**< Number of IPv4 mirror connection requests with an invalid interface type. */ - NSS_IPV4_STATS_MIRROR_FAILURES, - /**< Number of IPv4 mirror failures. */ - NSS_IPV4_STATS_MAX, - /**< Maximum message type. */ -}; - -/* - * NSS IPv4 rule creation & rule update flags. - */ -#define NSS_IPV4_RULE_CREATE_FLAG_NO_SEQ_CHECK 0x01 - /**< Do not perform TCP sequence number checks. */ -#define NSS_IPV4_RULE_CREATE_FLAG_BRIDGE_FLOW 0x02 - /**< Pure bridge forwarding flow. */ -#define NSS_IPV4_RULE_CREATE_FLAG_ROUTED 0x04 - /**< Rule for a routed connection. */ -#define NSS_IPV4_RULE_CREATE_FLAG_DSCP_MARKING 0x08 - /**< Rule for configuring DSCP marking. */ -#define NSS_IPV4_RULE_CREATE_FLAG_VLAN_MARKING 0x10 - /**< Rule for configuring VLAN marking. */ -#define NSS_IPV4_RULE_UPDATE_FLAG_CHANGE_MTU 0x20 - /**< Update MTU of the connection interfaces. */ -#define NSS_IPV4_RULE_CREATE_FLAG_ICMP_NO_CME_FLUSH 0x40 - /**< Rule for not flushing connection match entry on an ICMP packet. */ - -/** - * L2 payload is not IPv4, but it consists of an encapsulating protocol that - * carries an IPv4 payload within it. - */ -#define NSS_IPV4_RULE_CREATE_FLAG_L2_ENCAP 0x80 -#define NSS_IPV4_RULE_CREATE_FLAG_DROP 0x100 - /**< Rule to drop packets. */ -#define NSS_IPV4_RULE_CREATE_FLAG_EXCEPTION 0x200 - /**< Rule to except packets. */ -#define NSS_IPV4_RULE_CREATE_FLAG_SRC_INTERFACE_CHECK 0x400 - /**< Check the source interface for the rule. */ -#define NSS_IPV4_RULE_CREATE_FLAG_NO_SRC_IDENT 0x800 - /**< Zero out the source identifier for the rule. */ -#define NSS_IPV4_RULE_CREATE_FLAG_NO_MAC 0x1000 - /**< Flag to bypass writing MAC addresses. */ -#define NSS_IPV4_RULE_CREATE_FLAG_EMESH_SP 0x2000 - /**< Mark rule as E-MESH Service Prioritization valid. */ - -/* - * Validity flags for rule creation. - */ -#define NSS_IPV4_RULE_CREATE_CONN_VALID 0x01 /**< Connection is valid. */ -#define NSS_IPV4_RULE_CREATE_TCP_VALID 0x02 /**< TCP protocol fields are valid. */ -#define NSS_IPV4_RULE_CREATE_PPPOE_VALID 0x04 /**< PPPoE fields are valid. */ -#define NSS_IPV4_RULE_CREATE_QOS_VALID 0x08 /**< QoS fields are valid. */ -#define NSS_IPV4_RULE_CREATE_VLAN_VALID 0x10 /**< VLAN fields are valid. */ -#define NSS_IPV4_RULE_CREATE_DSCP_MARKING_VALID 0x20 - /**< DSCP marking fields are valid. */ -#define NSS_IPV4_RULE_CREATE_VLAN_MARKING_VALID 0x40 - /**< VLAN marking fields are valid. */ -#define NSS_IPV4_RULE_CREATE_SRC_MAC_VALID 0x80 - /**< Source MAC address fields are valid. */ -#define NSS_IPV4_RULE_CREATE_NEXTHOP_VALID 0x100 - /**< Next hop interface number fields are valid. */ -#define NSS_IPV4_RULE_CREATE_RPS_VALID 0x200 - /**< RPS for core selection is valid. */ -#define NSS_IPV4_RULE_CREATE_DEST_MAC_VALID 0x400 - /**< Destination MAC address fields are valid. */ -#define NSS_IPV4_RULE_CREATE_IGS_VALID 0x800 - /**< Ingress shaping fields are valid. */ -#define NSS_IPV4_RULE_CREATE_IDENTIFIER_VALID 0x1000 - /**< Identifier is valid. */ -#define NSS_IPV4_RULE_CREATE_MIRROR_VALID 0x2000 /**< Mirror fields are valid. */ - -/* - * Multicast command rule flags - */ -#define NSS_IPV4_MC_RULE_CREATE_FLAG_MC_UPDATE 0x01 /**< Multicast rule update. */ -#define NSS_IPV4_MC_RULE_CREATE_FLAG_MC_EMESH_SP 0x02 - /**< Mark multicast rule as E-MESH Service Prioritization valid. */ - -/* - * Multicast command validity flags - */ -#define NSS_IPV4_MC_RULE_CREATE_FLAG_QOS_VALID 0x01 - /**< QoS fields are valid. */ -#define NSS_IPV4_MC_RULE_CREATE_FLAG_DSCP_MARKING_VALID 0x02 - /**< DSCP fields are valid. */ -#define NSS_IPV4_MC_RULE_CREATE_FLAG_INGRESS_VLAN_VALID 0x04 - /**< Ingress VLAN fields are valid. */ -#define NSS_IPV4_MC_RULE_CREATE_FLAG_INGRESS_PPPOE 0x08 - /**< Ingress PPPoE fields are valid. */ -#define NSS_IPV4_MC_RULE_CREATE_FLAG_IGS_VALID 0x10 - /**< Ingress shaping fields are valid. */ - -/* - * Per-interface rule flags for a multicast connection (to be used with the rule_flags - * field of nss_ipv4_mc_if_rule structure). - */ -#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_BRIDGE_FLOW 0x01 - /**< Multicast connection rule is created for a bridge flow. */ -#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_ROUTED_FLOW 0x02 - /**< Multicast connection rule is created for a routed flow. */ -#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_JOIN 0x04 - /**< Interface has joined the flow. */ -#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_LEAVE 0x08 - /**< Interface has left the flow. */ - -/* - * Per-interface valid flags for a multicast connection (to be used with the valid_flags - * field of nss_ipv4_mc_if_rule structure). - */ -#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_VLAN_VALID 0x01 - /**< VLAN fields are valid. */ -#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_PPPOE_VALID 0x02 - /**< PPPoE fields are valid. */ -#define NSS_IPV4_MC_RULE_CREATE_IF_FLAG_NAT_VALID 0x4 - /**< Interface is configured with the source NAT. */ - -/* - * Source MAC address valid flags (to be used with mac_valid_flags field of nss_ipv4_src_mac_rule structure) - */ -#define NSS_IPV4_SRC_MAC_FLOW_VALID 0x01 - /**< MAC address for the flow interface is valid. */ -#define NSS_IPV4_SRC_MAC_RETURN_VALID 0x02 - /**< MAC address for the return interface is valid. */ - -/* - * Identifier valid flags (to be used with identifier_valid_flags field of nss_ipv4_identifier_rule structure) - */ -#define NSS_IPV4_FLOW_IDENTIFIER_VALID 0x01 - /**< Identifier for flow direction is valid. */ -#define NSS_IPV4_RETURN_IDENTIFIER_VALID 0x02 - /**< Identifier for return direction is valid. */ - -/* - * Mirror valid flags (to be used with the valid field of nss_ipv4_mirror_rule structure) - */ -#define NSS_IPV4_MIRROR_FLOW_VALID 0x01 - /**< Mirror interface number for the flow direction is valid. */ -#define NSS_IPV4_MIRROR_RETURN_VALID 0x02 - /**< Mirror interface number for the return direction is valid. */ - - -/** - * nss_ipv4_5tuple - * Common 5-tuple information. - */ -struct nss_ipv4_5tuple { - uint32_t flow_ip; /**< Flow IP address. */ - uint32_t flow_ident; /**< Flow identifier (e.g., TCP or UDP port). */ - uint32_t return_ip; /**< Return IP address. */ - uint32_t return_ident; /**< Return identier (e.g., TCP or UDP port). */ - uint8_t protocol; /**< Protocol number. */ - uint8_t reserved[3]; /**< Padded for alignment. */ -}; - -/** - * nss_ipv4_connection_rule - * Information for creating a connection. - */ -struct nss_ipv4_connection_rule { - uint16_t flow_mac[3]; /**< Flow MAC address. */ - uint16_t return_mac[3]; /**< Return MAC address. */ - int32_t flow_interface_num; /**< Flow interface number. */ - int32_t return_interface_num; /**< Return interface number. */ - uint32_t flow_mtu; /**< MTU for the flow interface. */ - uint32_t return_mtu; /**< MTU for the return interface. */ - uint32_t flow_ip_xlate; /**< Translated flow IP address. */ - uint32_t return_ip_xlate; /**< Translated return IP address. */ - uint32_t flow_ident_xlate; /**< Translated flow identifier (e.g., port). */ - uint32_t return_ident_xlate; /**< Translated return identifier (e.g., port). */ -}; - -/** - * nss_ipv4_pppoe_rule - * Information for PPPoE connection rules. - */ -struct nss_ipv4_pppoe_rule { - uint32_t flow_if_exist; - /**< PPPoE interface existence flag for the flow direction. */ - int32_t flow_if_num; - /**< PPPoE interface number for the flow direction. */ - uint32_t return_if_exist; - /**< PPPoE interface existence flag for the return direction. */ - int32_t return_if_num; - /**< PPPoE interface number for the return direction. */ -}; - -/** - * nss_ipv4_dscp_rule - * Information for DSCP connection rules. - */ -struct nss_ipv4_dscp_rule { - uint8_t flow_dscp; /**< Egress DSCP value for the flow direction. */ - uint8_t return_dscp; /**< Egress DSCP value for the return direction. */ - uint8_t reserved[2]; /**< Padded for alignment. */ -}; - -/** - * nss_ipv4_vlan_rule - * Information for VLAN connection rules. - */ -struct nss_ipv4_vlan_rule { - uint32_t ingress_vlan_tag; /**< VLAN tag for the ingress packets. */ - uint32_t egress_vlan_tag; /**< VLAN tag for egress packets. */ -}; - -/** - * nss_ipv4_nexthop - * Information for next hop interface numbers. - * - * A next hop is the next interface that will receive the packet (as opposed to - * the final interface when the packet leaves the device. - */ -struct nss_ipv4_nexthop { - /** - * Next hop interface number of the flow direction (from which the connection - * originated). - */ - int32_t flow_nexthop; - /** - * Next hop interface number of the return direction (to which the connection - * is destined). - */ - int32_t return_nexthop; -}; - -/** - * nss_ipv4_protocol_tcp_rule - * Information for TCP connection rules. - */ -struct nss_ipv4_protocol_tcp_rule { - uint32_t flow_max_window; - /**< Largest seen window for the flow direction. */ - uint32_t return_max_window; - /**< Largest seen window for the return direction. */ - - /** - * Largest seen sequence + segment length for the flow direction. - */ - uint32_t flow_end; - - /** - * Largest seen sequence + segment length for the return direction. - */ - uint32_t return_end; - - uint32_t flow_max_end; - /**< Largest seen ack + max(1, win) for the flow direction. */ - uint32_t return_max_end; - /**< Largest seen ack + max(1, win) for the return direction. */ - uint8_t flow_window_scale; - /**< Window scaling factor for the flow direction. */ - uint8_t return_window_scale; - /**< Window scaling factor for the return direction. */ - uint16_t reserved; /**< Alignment padding. */ -}; - -/** - * nss_ipv4_igs_rule - * Information for ingress shaping connection rules. - */ -struct nss_ipv4_igs_rule { - uint16_t igs_flow_qos_tag; - /**< Ingress shaping QoS tag associated with this rule for the flow direction. */ - uint16_t igs_return_qos_tag; - /**< Ingress shaping QoS tag associated with this rule for the return direction. */ -}; - -/** - * nss_ipv4_qos_rule - * Information for QoS connection rules. - */ -struct nss_ipv4_qos_rule { - uint32_t flow_qos_tag; - /**< QoS tag associated with this rule for the flow direction. */ - uint32_t return_qos_tag; - /**< QoS tag associated with this rule for the return direction. */ -}; - -/** - * nss_ipv4_src_mac_rule - * Information for source MAC address rules. - */ -struct nss_ipv4_src_mac_rule { - uint32_t mac_valid_flags; /**< MAC address validity flags. */ - uint16_t flow_src_mac[3]; /**< Source MAC address for the flow direction. */ - uint16_t return_src_mac[3]; /**< Source MAC address for the return direction. */ -}; - -/** - * nss_ipv4_rps_rule - * RPS rule structure. - */ -struct nss_ipv4_rps_rule { - uint8_t flow_rps; - /**< RPS for core selection for flow direction. */ - uint8_t return_rps; - /**< RPS for core selection for return direction. */ - uint8_t reserved[2]; - /**< Padded for alignment. */ -}; - -/** - * nss_ipv4_identifier_rule - * Identifier rule structure. - */ -struct nss_ipv4_identifier_rule { - uint32_t identifier_valid_flags; - /**< Identifier validity flags. */ - uint32_t flow_identifier; - /**< Identifier for flow direction. */ - uint32_t return_identifier; - /**< Identifier for return direction. */ -}; - -/** - * nss_ipv4_mirror_rule - * Mirror rule structure. - */ -struct nss_ipv4_mirror_rule { - uint32_t valid; /**< Mirror validity flags. */ - nss_if_num_t flow_ifnum; /**< Flow mirror interface number. */ - nss_if_num_t return_ifnum; /**< Return mirror interface number. */ -}; - -/** - * nss_ipv4_error_response_types - * Error types for IPv4 messages. - */ -enum nss_ipv4_error_response_types { - NSS_IPV4_UNKNOWN_MSG_TYPE = 1, - NSS_IPV4_CR_INVALID_PNODE_ERROR, - NSS_IPV4_CR_MISSING_CONNECTION_RULE_ERROR, - NSS_IPV4_CR_BUFFER_ALLOC_FAIL_ERROR, - NSS_IPV4_DR_NO_CONNECTION_ENTRY_ERROR, - NSS_IPV4_CR_CONN_CFG_ALREADY_CONFIGURED_ERROR, - NSS_IPV4_CR_CONN_CFG_NOT_MULTIPLE_OF_QUANTA_ERROR, - NSS_IPV4_CR_CONN_CFG_EXCEEDS_LIMIT_ERROR, - NSS_IPV4_CR_CONN_CFG_MEM_ALLOC_FAIL_ERROR, - NSS_IPV4_CR_MULTICAST_INVALID_PROTOCOL, - NSS_IPV4_CR_MULTICAST_UPDATE_INVALID_FLAGS, - NSS_IPV4_CR_MULTICAST_UPDATE_INVALID_IF, - NSS_IPV4_CR_ACCEL_MODE_CONFIG_INVALID, - NSS_IPV4_CR_INVALID_MSG_ERROR, - NSS_IPV4_CR_DSCP2PRI_PRI_INVALID, - NSS_IPV4_CR_DSCP2PRI_CONFIG_INVALID, - NSS_IPV4_CR_INVALID_RPS, - NSS_IPV4_CR_HASH_BITMAP_INVALID, - NSS_IPV4_DR_HW_DECEL_FAIL_ERROR, - NSS_IPV4_CR_RETURN_EXIST_ERROR, - NSS_IPV4_CR_INVALID_IDENTIFIER, - NSS_IPV4_CR_EMESH_SP_CONFIG_INVALID, - NSS_IPV4_LAST -}; - -/** - * nss_ipv4_rule_create_msg - * IPv4 rule for creating sub-messages. - */ -struct nss_ipv4_rule_create_msg { - /* - * Request - */ - uint16_t valid_flags; - /**< Bit flags associated with the validity of parameters. */ - uint16_t rule_flags; - /**< Bit flags associated with the rule. */ - struct nss_ipv4_5tuple tuple; - /**< Holds values of the 5 tuple. */ - struct nss_ipv4_connection_rule conn_rule; - /**< Basic connection-specific data. */ - struct nss_ipv4_protocol_tcp_rule tcp_rule; - /**< TCP-related accleration parameters. */ - struct nss_ipv4_pppoe_rule pppoe_rule; - /**< PPPoE-related accleration parameters. */ - struct nss_ipv4_qos_rule qos_rule; - /**< QoS-related accleration parameters. */ - struct nss_ipv4_dscp_rule dscp_rule; - /**< DSCP-related accleration parameters. */ - struct nss_ipv4_vlan_rule vlan_primary_rule; - /**< Primary VLAN-related accleration parameters. */ - struct nss_ipv4_vlan_rule vlan_secondary_rule; - /**< Secondary VLAN-related accleration parameters. */ - struct nss_ipv4_src_mac_rule src_mac_rule; - /**< Source MAC address-related acceleration parameters. */ - struct nss_ipv4_nexthop nexthop_rule; - /**< Parameters related to the next hop. */ - struct nss_ipv4_rps_rule rps_rule; - /**< RPS parameter. */ - struct nss_ipv4_igs_rule igs_rule; - /**< Ingress shaping related accleration parameters. */ - struct nss_ipv4_identifier_rule identifier; - /**< Rule for adding identifier. */ - struct nss_ipv4_mirror_rule mirror_rule; - /**< Mirror rule parameter. */ -}; - -/** - * nss_ipv4_inquiry_msg - * IPv4 connection inquiry naming structure. - */ -struct nss_ipv4_inquiry_msg { - /** - * Request by its 5-tuple and get response for other items. - */ - struct nss_ipv4_rule_create_msg rr; -}; - -/** - * nss_ipv4_mc_if_rule - * IPv4 multicast rule for creating per-interface information. - */ -struct nss_ipv4_mc_if_rule { - uint16_t rule_flags; /**< Bit flags associated with the rule. */ - uint16_t valid_flags; - /**< Bit flags associated with the validity of parameters. */ - uint32_t xlate_src_ip; /**< Translated flow IP address. */ - uint32_t xlate_src_ident; /**< Translated flow identifier (e.g., port). */ - uint32_t egress_vlan_tag[MAX_VLAN_DEPTH]; - /**< VLAN tag stack for the egress packets. */ - int32_t pppoe_if_num; /**< PPPoE interface number. */ - uint32_t if_num; /**< Interface number. */ - uint32_t if_mtu; /**< Interface MTU. */ - uint16_t if_mac[3]; /**< Interface MAC address. */ - uint8_t reserved[2]; /**< Reserved 2 bytes for alignment. */ -}; - -/** - * nss_ipv4_mc_rule_create_msg - * IPv4 multicast rule for creating sub-messages. - */ -struct nss_ipv4_mc_rule_create_msg { - struct nss_ipv4_5tuple tuple; /**< Holds values of the 5 tuple. */ - - uint32_t rule_flags; /**< Multicast command rule flags. */ - uint32_t valid_flags; /**< Multicast command validity flags. */ - uint32_t src_interface_num; - /**< Source interface number (virtual or physical). */ - uint32_t ingress_vlan_tag[MAX_VLAN_DEPTH]; - /**< VLAN tag stack for the ingress packets. */ - uint32_t qos_tag; /**< QoS tag for the rule. */ - uint16_t dest_mac[3]; /**< Destination multicast MAC address. */ - uint16_t if_count; /**< Number of destination interfaces. */ - uint8_t egress_dscp; /**< Egress DSCP value for the flow. */ - uint8_t reserved[1]; /**< Reserved 1 byte for alignment. */ - uint16_t igs_qos_tag; /**< Ingress shaping QoS tag for the rule. */ - - struct nss_ipv4_mc_if_rule if_rule[NSS_MC_IF_MAX]; - /**< Per-interface information. */ -}; - -/** - * nss_ipv4_rule_destroy_msg - * IPv4 rule for destroying sub-messages. - */ -struct nss_ipv4_rule_destroy_msg { - struct nss_ipv4_5tuple tuple; /**< Holds values of the 5 tuple. */ -}; - -/** - * nss_ipv4_rule_conn_get_table_size_msg - * IPv4 rule for fetching connection tables size. - */ -struct nss_ipv4_rule_conn_get_table_size_msg { - uint32_t num_conn; /**< Number of supported IPv4 connections. */ - uint32_t ce_table_size; /**< Size of the connection entry table in NSS firmware. */ - uint32_t cme_table_size; /**< Size of the connection match entry table in NSS firmware. */ -}; - -/** - * nss_ipv4_rule_conn_cfg_msg - * IPv4 rule for connection configuration sub-messages. - */ -struct nss_ipv4_rule_conn_cfg_msg { - uint32_t num_conn; /**< Number of supported IPv4 connections. */ - uint32_t ce_mem; /**< Memory allocated by host for connection entries table. */ - uint32_t cme_mem; /**< Memory allocated by host for connection match entries table. */ -}; - -/* - * IPv4 rule synchronization reasons. - */ -#define NSS_IPV4_RULE_SYNC_REASON_STATS 0 - /**< Rule for synchronizing statistics. */ -#define NSS_IPV4_RULE_SYNC_REASON_FLUSH 1 - /**< Rule for flushing a cache entry. */ -#define NSS_IPV4_RULE_SYNC_REASON_EVICT 2 - /**< Rule for evicting a cache entry. */ -#define NSS_IPV4_RULE_SYNC_REASON_DESTROY 3 - /**< Rule for destroying a cache entry (requested by the host OS). */ - -/** - * nss_ipv4_conn_sync - * IPv4 connection synchronization message. - */ -struct nss_ipv4_conn_sync { - uint32_t reserved; /**< Reserved field for backward compatibility. */ - uint8_t protocol; /**< Protocol number. */ - uint32_t flow_ip; /**< Flow IP address. */ - uint32_t flow_ip_xlate; /**< Translated flow IP address. */ - uint32_t flow_ident; /**< Flow identifier (e.g., port). */ - uint32_t flow_ident_xlate; /**< Translated flow identifier (e.g., port). */ - uint32_t flow_max_window; /**< Largest seen window for the flow direction. */ - - /** - * Largest seen sequence + segment length for the flow direction. - */ - uint32_t flow_end; - - uint32_t flow_max_end; - /**< Largest seen ack + max(1, win) for the flow direction. */ - uint32_t flow_rx_packet_count; - /**< Rx packet count for the flow interface. */ - uint32_t flow_rx_byte_count; - /**< Rx byte count for the flow interface. */ - uint32_t flow_tx_packet_count; - /**< Tx packet count for the flow interface. */ - uint32_t flow_tx_byte_count; - /**< Tx byte count for the flow interface. */ - uint32_t return_ip; /**< Return IP address. */ - uint32_t return_ip_xlate; /**< Translated return IP address. */ - uint32_t return_ident; /**< Return identier (e.g., port). */ - uint32_t return_ident_xlate; /**< Translated return identifier (e.g., port). */ - uint32_t return_max_window; - /**< Largest seen window for the return direction. */ - - /** - * Largest seen sequence + segment length for the return direction. - */ - uint32_t return_end; - - uint32_t return_max_end; - /**< Largest seen ack + max(1, win) for the return direction. */ - uint32_t return_rx_packet_count; - /**< Rx packet count for the return interface. */ - uint32_t return_rx_byte_count; - /**< Rx byte count for the return interface. */ - uint32_t return_tx_packet_count; - /**< Tx packet count for the return interface. */ - uint32_t return_tx_byte_count; - /**< Tx byte count for the return interface. */ - uint32_t inc_ticks; /**< Number of ticks since the last synchronization. */ - uint32_t reason; /**< Reason for the synchronization. */ - - uint8_t flags; /**< Bit flags associated with the rule. */ - uint32_t qos_tag; /**< QoS tag. */ - uint32_t cause; /**< Flush cause associated with the rule. */ -}; - -/** - * nss_ipv4_conn_sync_many_msg - * Information for a multiple IPv4 connection statistics synchronization message. - */ -struct nss_ipv4_conn_sync_many_msg { - /* - * Request - */ - uint16_t index; /**< Request connection statistics from the index. */ - uint16_t size; /**< Buffer size of this message. */ - - /* - * Response - */ - uint16_t next; /**< Firmware response for the next connection to be requested. */ - uint16_t count; /**< Number of synchronized connections included in this message. */ - struct nss_ipv4_conn_sync conn_sync[]; /**< Array for the statistics. */ -}; - -/** - * nss_ipv4_accel_mode_cfg_msg - * IPv4 acceleration mode configuration. - */ -struct nss_ipv4_accel_mode_cfg_msg { - uint32_t mode; /**< Type of acceleration mode. */ -}; - -/** - * nss_ipv4_dscp2pri_cfg_msg - * IPv4 dscp2pri configuration msg. - */ -struct nss_ipv4_dscp2pri_cfg_msg { - uint8_t dscp; /**< Value of DSCP. */ - uint8_t priority; /**< Corresponding priority. */ -}; - -/** - * nss_ipv4_rps_hash_bitmap_cfg_msg - * RPS hash mask configuration. - * - * The bitmap represents the host cores to which NSS firmware can steer - * packets based on packet hash. The least significant bit represents core0. - */ -struct nss_ipv4_rps_hash_bitmap_cfg_msg { - uint32_t hash_bitmap; /**< Hash mask. */ -}; - -/** - * nss_ipv4_exception_events - * Exception events from the bridge or route handler. - */ -enum nss_ipv4_exception_events { - NSS_IPV4_EXCEPTION_EVENT_ICMP_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_ICMP_UNHANDLED_TYPE, - NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_UDP_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_TCP_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_UNKNOWN_PROTOCOL, - NSS_IPV4_EXCEPTION_EVENT_ICMP_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_ICMP_FLUSH_TO_HOST, - NSS_IPV4_EXCEPTION_EVENT_TCP_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_TCP_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_TCP_IP_OPTION, - NSS_IPV4_EXCEPTION_EVENT_TCP_IP_FRAGMENT, - NSS_IPV4_EXCEPTION_EVENT_TCP_SMALL_TTL, - NSS_IPV4_EXCEPTION_EVENT_TCP_NEEDS_FRAGMENTATION, - NSS_IPV4_EXCEPTION_EVENT_TCP_FLAGS, - NSS_IPV4_EXCEPTION_EVENT_TCP_SEQ_EXCEEDS_RIGHT_EDGE, - NSS_IPV4_EXCEPTION_EVENT_TCP_SMALL_DATA_OFFS, - NSS_IPV4_EXCEPTION_EVENT_TCP_BAD_SACK, - NSS_IPV4_EXCEPTION_EVENT_TCP_BIG_DATA_OFFS, - NSS_IPV4_EXCEPTION_EVENT_TCP_SEQ_BEFORE_LEFT_EDGE, - NSS_IPV4_EXCEPTION_EVENT_TCP_ACK_EXCEEDS_RIGHT_EDGE, - NSS_IPV4_EXCEPTION_EVENT_TCP_ACK_BEFORE_LEFT_EDGE, - NSS_IPV4_EXCEPTION_EVENT_UDP_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_UDP_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_UDP_IP_OPTION, - NSS_IPV4_EXCEPTION_EVENT_UDP_IP_FRAGMENT, - NSS_IPV4_EXCEPTION_EVENT_UDP_SMALL_TTL, - NSS_IPV4_EXCEPTION_EVENT_UDP_NEEDS_FRAGMENTATION, - NSS_IPV4_EXCEPTION_EVENT_WRONG_TARGET_MAC, - NSS_IPV4_EXCEPTION_EVENT_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_BAD_TOTAL_LENGTH, - NSS_IPV4_EXCEPTION_EVENT_BAD_CHECKSUM, - NSS_IPV4_EXCEPTION_EVENT_NON_INITIAL_FRAGMENT, - NSS_IPV4_EXCEPTION_EVENT_DATAGRAM_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_OPTIONS_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_UNKNOWN_PROTOCOL, - NSS_IPV4_EXCEPTION_EVENT_ESP_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_ESP_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_ESP_IP_OPTION, - NSS_IPV4_EXCEPTION_EVENT_ESP_IP_FRAGMENT, - NSS_IPV4_EXCEPTION_EVENT_ESP_SMALL_TTL, - NSS_IPV4_EXCEPTION_EVENT_ESP_NEEDS_FRAGMENTATION, - NSS_IPV4_EXCEPTION_EVENT_IVID_MISMATCH, - NSS_IPV4_EXCEPTION_EVENT_IVID_MISSING, - NSS_IPV4_EXCEPTION_EVENT_6RD_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_6RD_IP_OPTION, - NSS_IPV4_EXCEPTION_EVENT_6RD_IP_FRAGMENT, - NSS_IPV4_EXCEPTION_EVENT_6RD_NEEDS_FRAGMENTATION, - NSS_IPV4_EXCEPTION_EVENT_DSCP_MARKING_MISMATCH, - NSS_IPV4_EXCEPTION_EVENT_VLAN_MARKING_MISMATCH, - NSS_IPV4_EXCEPTION_EVENT_INTERFACE_MISMATCH, - NSS_IPV4_EXCEPTION_EVENT_GRE_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_GRE_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_GRE_IP_OPTION, - NSS_IPV4_EXCEPTION_EVENT_GRE_IP_FRAGMENT, - NSS_IPV4_EXCEPTION_EVENT_GRE_SMALL_TTL, - NSS_IPV4_EXCEPTION_EVENT_GRE_NEEDS_FRAGMENTATION, - NSS_IPV4_EXCEPTION_EVENT_PPTP_GRE_SESSION_MATCH_FAIL, - NSS_IPV4_EXCEPTION_EVENT_PPTP_GRE_INVALID_PROTO, - NSS_IPV4_EXCEPTION_EVENT_PPTP_GRE_NO_CME, - NSS_IPV4_EXCEPTION_EVENT_PPTP_GRE_IP_OPTION, - NSS_IPV4_EXCEPTION_EVENT_PPTP_GRE_IP_FRAGMENT, - NSS_IPV4_EXCEPTION_EVENT_PPTP_GRE_SMALL_TTL, - NSS_IPV4_EXCEPTION_EVENT_PPTP_GRE_NEEDS_FRAGMENTATION, - NSS_IPV4_EXCEPTION_EVENT_DESTROY, - NSS_IPV4_EXCEPTION_EVENT_FRAG_DF_SET, - NSS_IPV4_EXCEPTION_EVENT_FRAG_FAIL, - NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_UDPLITE_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_UDPLITE_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_UDPLITE_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_UDPLITE_IP_OPTION, - NSS_IPV4_EXCEPTION_EVENT_UDPLITE_IP_FRAGMENT, - NSS_IPV4_EXCEPTION_EVENT_UDPLITE_SMALL_TTL, - NSS_IPV4_EXCEPTION_EVENT_UDPLITE_NEEDS_FRAGMENTATION, - NSS_IPV4_EXCEPTION_EVENT_MC_UDP_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_MC_MEM_ALLOC_FAILURE, - NSS_IPV4_EXCEPTION_EVENT_MC_UPDATE_FAILURE, - NSS_IPV4_EXCEPTION_EVENT_MC_PBUF_ALLOC_FAILURE, - NSS_IPV4_EXCEPTION_EVENT_PPPOE_BRIDGE_NO_ICME, - NSS_IPV4_EXCEPTION_EVENT_PPPOE_NO_SESSION, - NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_GRE_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_ESP_HEADER_INCOMPLETE, - NSS_IPV4_EXCEPTION_EVENT_EMESH_PRIO_MISMATCH, - NSS_IPV4_EXCEPTION_EVENT_MAX -}; - -/** - * nss_ipv4_node_sync - * IPv4 node synchronization statistics. - */ -struct nss_ipv4_node_sync { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t ipv4_connection_create_requests; - /**< Number of connection create requests. */ - - /** - * Number of connection create requests that collided with existing entries. - */ - uint32_t ipv4_connection_create_collisions; - - /** - * Number of connection create requests that had invalid interfaces. - */ - uint32_t ipv4_connection_create_invalid_interface; - - uint32_t ipv4_connection_destroy_requests; - /**< Number of connection destroy requests. */ - uint32_t ipv4_connection_destroy_misses; - /**< Number of connection destroy requests that missed the cache. */ - uint32_t ipv4_connection_hash_hits; /**< Number of connection hash hits. */ - uint32_t ipv4_connection_hash_reorders; /**< Number of connection hash reorders. */ - uint32_t ipv4_connection_flushes; /**< Number of connection flushes. */ - uint32_t ipv4_connection_evictions; /**< Number of connection evictions. */ - uint32_t ipv4_fragmentations; - /**< Number of successful IPv4 fragmentations performed. */ - uint32_t ipv4_dropped_by_rule; - /**< Number of IPv4 packets dropped because of a drop rule. */ - uint32_t ipv4_mc_connection_create_requests; - /**< Number of multicast connection create requests. */ - uint32_t ipv4_mc_connection_update_requests; - /**< Number of multicast connection update requests. */ - - /** - * Number of multicast connection create requests that had invalid interfaces. - */ - uint32_t ipv4_mc_connection_create_invalid_interface; - - uint32_t ipv4_mc_connection_destroy_requests; - /**< Number of multicast connection destroy requests. */ - - /** - * Number of multicast connection destroy requests that missed the cache. - */ - uint32_t ipv4_mc_connection_destroy_misses; - - uint32_t ipv4_mc_connection_flushes; - /**< Number of multicast connection flushes. */ - - uint32_t ipv4_connection_create_invalid_mirror_ifnum; - /**< Number of create request failed with an invalid mirror interface number. */ - - uint32_t ipv4_connection_create_invalid_mirror_iftype; - /**< Number of create request failed with an invalid mirror interface type. */ - - uint32_t ipv4_mirror_failures; - /**< Mirror packet failed. */ - - uint32_t exception_events[NSS_IPV4_EXCEPTION_EVENT_MAX]; - /**< Number of exception events. */ -}; - -/** - * nss_ipv4_msg - * Data for sending and receiving IPv4 bridge or routing messages. - */ -struct nss_ipv4_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of an IPv4 bridge or routing message. - */ - union { - struct nss_ipv4_rule_create_msg rule_create; - /**< Create a rule. */ - struct nss_ipv4_rule_destroy_msg rule_destroy; - /**< Destroy a rule. */ - struct nss_ipv4_conn_sync conn_stats; - /**< Synchronize connection statistics. */ - struct nss_ipv4_node_sync node_stats; - /**< Synchronize node statistics. */ - struct nss_ipv4_rule_conn_get_table_size_msg size; - /**< Get the size for connection tables. */ - struct nss_ipv4_rule_conn_cfg_msg rule_conn_cfg; - /**< Configure a rule connection. */ - struct nss_ipv4_mc_rule_create_msg mc_rule_create; - /**< Create a multicast rule. */ - struct nss_ipv4_conn_sync_many_msg conn_stats_many; - /**< Synchronize multiple connection statistics. */ - struct nss_ipv4_accel_mode_cfg_msg accel_mode_cfg; - /**< Acceleration mode. */ - struct nss_ipv4_inquiry_msg inquiry; - /**< Inquiry if a connection has created. */ - struct nss_ipv4_dscp2pri_cfg_msg dscp2pri_cfg; - /**< Configure dscp2pri mapping. */ - struct nss_ipv4_rps_hash_bitmap_cfg_msg rps_hash_bitmap; - /**< Configure rps_hash_bitmap. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_ipv4_stats_notification - * Data for sending IPv4 statistics. - */ -struct nss_ipv4_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t cmn_node_stats[NSS_STATS_NODE_MAX]; /**< Node statistics. */ - uint64_t special_stats[NSS_IPV4_STATS_MAX]; /**< IPv4 special statistics. */ - uint64_t exception_stats[NSS_IPV4_EXCEPTION_EVENT_MAX]; /**< IPv4 exception statistics. */ -}; - -/** - * Configured IPv4 connection number to use for calculating the total number of - * connections. - */ -extern int nss_ipv4_conn_cfg; - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * nss_ipv4_max_conn_count - * Returns the maximum number of IPv4 connections that the NSS acceleration - * engine supports. - * - * @return - * Number of connections that can be accelerated. - */ -int nss_ipv4_max_conn_count(void); - -/** - * Callback function for receiving IPv4 messages. - * - * @datatypes - * nss_ipv4_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_ipv4_msg_callback_t)(void *app_data, struct nss_ipv4_msg *msg); - -/** - * nss_ipv4_tx - * Transmits an IPv4 message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipv4_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipv4_tx(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_msg *msg); - -/** - * nss_ipv4_tx_sync - * Transmits a synchronous IPv4 message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipv4_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipv4_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_msg *msg); - -/** - * nss_ipv4_tx_with_size - * Transmits an IPv4 message with a specified size to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipv4_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * @param[in] size Actual size of this message. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipv4_tx_with_size(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_msg *msg, uint32_t size); - -/** - * nss_ipv4_notify_register - * Registers a notifier callback to forward the IPv4 messages received from the NSS - * firmware to the registered subsystem. - * - * @datatypes - * nss_ipv4_msg_callback_t - * - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipv4_notify_register(nss_ipv4_msg_callback_t cb, void *app_data); - -/** - * nss_ipv4_notify_unregister - * Degisters an IPv4 message notifier callback from the NSS. - * - * @return - * None. - * - * @dependencies - * The notifier callback must have been previously registered. - */ -extern void nss_ipv4_notify_unregister(void); - -/** - * nss_ipv4_conn_sync_many_notify_register - * Registers a notifier callback with the NSS for connection synchronization - * message responses. - * - * @datatypes - * nss_ipv4_msg_callback_t - * - * @param[in] cb Callback function for the message. - * - * @return - * None. - */ -extern void nss_ipv4_conn_sync_many_notify_register(nss_ipv4_msg_callback_t cb); - -/** - * nss_ipv4_conn_sync_many_notify_unregister - * Degisters a connection synchronization notifier callback from the NSS. - * - * @return - * None. - * - * @dependencies - * The notifier callback must have been previously registered. - */ -extern void nss_ipv4_conn_sync_many_notify_unregister(void); - -/** - * nss_ipv4_get_mgr - * Gets the NSS context that is managing IPv4 processes. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipv4_get_mgr(void); - -/** - * nss_ipv4_register_handler - * Registers the IPv4 message handler. - * - * @return - * None. - */ -void nss_ipv4_register_handler(void); - -/** - * nss_ipv4_register_sysctl - * Registers the IPv4 system control table. - * - * @return - * None. - */ -void nss_ipv4_register_sysctl(void); - -/** - * nss_ipv4_unregister_sysctl - * Deregisters the IPv4 system control table. - * - * @return - * None. - * - * @dependencies - * The system control table must have been previously registered. - */ -void nss_ipv4_unregister_sysctl(void); - -/** - * nss_ipv4_msg_init - * Initializes IPv4 messages. - * - * @datatypes - * nss_ipv4_msg \n - * nss_ipv4_msg_callback_t - * - * @param[in,out] nim Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_ipv4_msg_init(struct nss_ipv4_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, - nss_ipv4_msg_callback_t cb, void *app_data); - -/** - * nss_ipv4_update_conn_count - * Sets the maximum number of IPv4 connections. - * - * @param[in] ipv4_max_conn Maximum number. - * - * @return - * 0 -- Success - */ -int nss_ipv4_update_conn_count(int ipv4_max_conn); - -/** - * nss_ipv4_free_conn_tables - * Frees memory allocated for connection tables. - * - * @return - * None. - */ -extern void nss_ipv4_free_conn_tables(void); - -/** - * nss_ipv4_dscp_action_get - * Gets the action value of the DSCP. - * - * @param[in] dscp Value of the DSCP field. - * - * @return - * Action value of the DSCP field. - */ -enum nss_ipv4_dscp_map_actions nss_ipv4_dscp_action_get(uint8_t dscp); - -/* - * Logger APIs - */ - -/** - * nss_ipv4_log_tx_msg - * Logs an IPv4 message that is sent to the NSS firmware. - * - * @datatypes - * nss_ipv4_msg - * - * @param[in] nim Pointer to the NSS interface message. - * - * @return - * None. - */ -void nss_ipv4_log_tx_msg(struct nss_ipv4_msg *nim); - -/** - * nss_ipv4_log_rx_msg - * Logs an IPv4 message that is received from the NSS firmware. - * - * @datatypes - * nss_ipv4_msg - * - * @param[in] nim Pointer to the NSS interface message. - * - * @return - * None. - */ -void nss_ipv4_log_rx_msg(struct nss_ipv4_msg *nim); - -/** - * nss_ipv4_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_ipv4_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_ipv4_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_ipv4_stats_unregister_notifier(struct notifier_block *nb); - -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_IPV4_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv4_reasm.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv4_reasm.h deleted file mode 100644 index f7785cfe1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv4_reasm.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipv4_reasm.h - * NSS IPv4 reassembly interface definitions. - */ - -#ifndef __NSS_IPV4_REASM_H -#define __NSS_IPV4_REASM_H - -/** - * @addtogroup nss_ipv4_reasm_subsystem - * @{ - */ - -/* - * nss_ipv4_reasm_stats_types - * IPv4 reassembly node statistics. - */ -enum nss_ipv4_reasm_stats_types { - NSS_IPV4_REASM_STATS_EVICTIONS, /**< Number of evicted fragment queues due to set memory threshold. */ - NSS_IPV4_REASM_STATS_ALLOC_FAILS, /**< Number of fragment queue allocation failures. */ - NSS_IPV4_REASM_STATS_TIMEOUTS, /**< Number of expired fragment queues. */ - NSS_IPV4_REASM_STATS_MAX, /**< Maximum message type. */ -}; - -/** - * nss_ipv4_reasm_stats_notification - * Data for sending IPv4 reassembly statistics. - */ -struct nss_ipv4_reasm_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t cmn_node_stats[NSS_STATS_NODE_MAX]; /**< Common node statistics. */ - uint64_t ipv4_reasm_stats[NSS_IPV4_REASM_STATS_MAX]; /**< IPv4 reassembly statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * nss_ipv4_reasm_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_ipv4_reasm_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_ipv4_reasm_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_ipv4_reasm_stats_unregister_notifier(struct notifier_block *nb); - -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_IPV4_REASM_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv6.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv6.h deleted file mode 100644 index 930e74cba..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv6.h +++ /dev/null @@ -1,1304 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipv6.h - * NSS IPv6 interface definitions. - */ - -#ifndef __NSS_IPV6_H -#define __NSS_IPV6_H - -/** - * @addtogroup nss_ipv6_subsystem - * @{ - */ - -/** - * Converts the format of an IPv6 address from Linux to NSS. @hideinitializer - */ -#define IN6_ADDR_TO_IPV6_ADDR(ipv6, in6) \ - { \ - ((uint32_t *)ipv6)[0] = in6.in6_u.u6_addr32[0]; \ - ((uint32_t *)ipv6)[1] = in6.in6_u.u6_addr32[1]; \ - ((uint32_t *)ipv6)[2] = in6.in6_u.u6_addr32[2]; \ - ((uint32_t *)ipv6)[3] = in6.in6_u.u6_addr32[3]; \ - } - -/** - * Converts the format of an IPv6 address from NSS to Linux. @hideinitializer - */ -#define IPV6_ADDR_TO_IN6_ADDR(in6, ipv6) \ - { \ - in6.in6_u.u6_addr32[0] = ((uint32_t *)ipv6)[0]; \ - in6.in6_u.u6_addr32[1] = ((uint32_t *)ipv6)[1]; \ - in6.in6_u.u6_addr32[2] = ((uint32_t *)ipv6)[2]; \ - in6.in6_u.u6_addr32[3] = ((uint32_t *)ipv6)[3]; \ - } - -/** - * Format of an IPv6 address (16 * 8 bits). - */ -#define IPV6_ADDR_OCTAL_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" - -/** - * Prints an IPv6 address (16 * 8 bits). - */ -#define IPV6_ADDR_TO_OCTAL(ipv6) ((uint16_t *)ipv6)[0], ((uint16_t *)ipv6)[1], ((uint16_t *)ipv6)[2], ((uint16_t *)ipv6)[3], ((uint16_t *)ipv6)[4], ((uint16_t *)ipv6)[5], ((uint16_t *)ipv6)[6], ((uint16_t *)ipv6)[7] - -/* - * IPv6 connection flags (to be used with nss_ipv6_create::flags. - */ -#define NSS_IPV6_CREATE_FLAG_NO_SEQ_CHECK 0x1 - /**< Indicates that sequence numbers are not to be checked. */ -#define NSS_IPV6_CREATE_FLAG_BRIDGE_FLOW 0x02 - /**< Indicates that this is a pure bridge flow (no routing is involved). */ -#define NSS_IPV6_CREATE_FLAG_ROUTED 0x04 /**< Rule is for a routed connection. */ -#define NSS_IPV6_CREATE_FLAG_DSCP_MARKING 0x08 /**< Rule for DSCP marking. */ -#define NSS_IPV6_CREATE_FLAG_VLAN_MARKING 0x10 /**< Rule for VLAN marking. */ -#define NSS_IPV6_CREATE_FLAG_QOS_VALID 0x20 /**< Rule for Valid QoS. */ - -/** - * nss_ipv6_create - * Information for an IPv6 flow or connection create rule. - * - * All fields must be passed in host-endian order. - */ -struct nss_ipv6_create { - int32_t src_interface_num; - /**< Source interface number (virtual or physical). */ - int32_t dest_interface_num; - /**< Destination interface number (virtual or physical). */ - int32_t protocol; /**< L4 protocol (e.g., TCP or UDP). */ - uint32_t flags; /**< Flags (if any) associated with this rule. */ - uint32_t from_mtu; /**< MTU of the incoming interface. */ - uint32_t to_mtu; /**< MTU of the outgoing interface. */ - uint32_t src_ip[4]; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip[4]; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ - uint8_t src_mac[ETH_ALEN]; /**< Source MAC address. */ - uint8_t dest_mac[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t flow_window_scale; /**< Window scaling factor (TCP). */ - uint32_t flow_max_window; /**< Maximum window size (TCP). */ - uint32_t flow_end; /**< TCP window end. */ - uint32_t flow_max_end; /**< TCP window maximum end. */ - uint32_t flow_pppoe_if_exist; - /**< Flow direction: PPPoE interface existence flag. */ - int32_t flow_pppoe_if_num; - /**< Flow direction: PPPoE interface number. */ - uint16_t ingress_vlan_tag; - /**< Ingress VLAN tag expected for this flow. */ - uint8_t return_window_scale; - /**< Window scaling factor (TCP) for the return direction. */ - uint32_t return_max_window; - /**< Maximum window size (TCP) for the return direction. */ - uint32_t return_end; - /**< End for the return direction. */ - uint32_t return_max_end; - /**< Maximum end for the return direction. */ - uint32_t return_pppoe_if_exist; - /**< Return direction: PPPoE interface exist flag. */ - int32_t return_pppoe_if_num; - /**< Return direction: PPPoE interface number. */ - uint16_t egress_vlan_tag; /**< Egress VLAN tag expected for this flow. */ - uint32_t qos_tag; /**< Deprecated; will be removed soon. */ - uint32_t flow_qos_tag; /**< QoS tag value for flow direction. */ - uint32_t return_qos_tag; /**< QoS tag value for the return direction. */ - uint8_t dscp_itag; /**< DSCP marking tag. */ - uint8_t dscp_imask; /**< DSCP marking input mask. */ - uint8_t dscp_omask; /**< DSCP marking output mask. */ - uint8_t dscp_oval; /**< DSCP marking output value. */ - uint16_t vlan_itag; /**< VLAN marking tag. */ - uint16_t vlan_imask; /**< VLAN marking input mask. */ - uint16_t vlan_omask; /**< VLAN marking output mask. */ - uint16_t vlan_oval; /**< VLAN marking output value. */ - uint32_t in_vlan_tag[MAX_VLAN_DEPTH]; - /**< Ingress VLAN tag expected for this flow. */ - uint32_t out_vlan_tag[MAX_VLAN_DEPTH]; - /**< Egress VLAN tag expected for this flow. */ - uint8_t flow_dscp; /**< IP DSCP value for flow direction. */ - uint8_t return_dscp; /**< IP DSCP value for the return direction. */ -}; - -/** - * nss_ipv6_destroy - * Information for an IPv6 flow or connection destroy rule. - */ -struct nss_ipv6_destroy { - int32_t protocol; /**< L4 protocol (e.g., TCP or UDP). */ - uint32_t src_ip[4]; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port (e.g., TCP or UDP port). */ - uint32_t dest_ip[4]; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port (e.g., TCP or UDP port). */ -}; - -/** - * nss_ipv6_stats_types - * IPv6 node statistics. - */ -enum nss_ipv6_stats_types { - NSS_IPV6_STATS_ACCELERATED_RX_PKTS, - /**< Accelerated IPv6 Rx packets. */ - NSS_IPV6_STATS_ACCELERATED_RX_BYTES, - /**< Accelerated IPv6 Rx bytes. */ - NSS_IPV6_STATS_ACCELERATED_TX_PKTS, - /**< Accelerated IPv6 Tx packets. */ - NSS_IPV6_STATS_ACCELERATED_TX_BYTES, - /**< Accelerated IPv6 Tx bytes. */ - NSS_IPV6_STATS_CONNECTION_CREATE_REQUESTS, - /**< Number of IPv6 connection create requests. */ - NSS_IPV6_STATS_CONNECTION_CREATE_COLLISIONS, - /**< Number of IPv6 connection create requests that collided with existing entries. */ - NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_INTERFACE, - /**< Number of IPv6 connection create requests that had invalid interface. */ - NSS_IPV6_STATS_CONNECTION_DESTROY_REQUESTS, - /**< Number of IPv6 connection destroy requests. */ - NSS_IPV6_STATS_CONNECTION_DESTROY_MISSES, - /**< Number of IPv6 connection destroy requests that missed the cache. */ - NSS_IPV6_STATS_CONNECTION_HASH_HITS, - /**< Number of IPv6 connection hash hits. */ - NSS_IPV6_STATS_CONNECTION_HASH_REORDERS, - /**< Number of IPv6 connection hash reorders. */ - NSS_IPV6_STATS_CONNECTION_FLUSHES, - /**< Number of IPv6 connection flushes. */ - NSS_IPV6_STATS_CONNECTION_EVICTIONS, - /**< Number of IPv6 connection evictions. */ - NSS_IPV6_STATS_FRAGMENTATIONS, - /**< Number of successful IPv6 fragmentations performed. */ - NSS_IPV6_STATS_FRAG_FAILS, - /**< Number of IPv6 fragmentation fails. */ - NSS_IPV6_STATS_DROPPED_BY_RULE, - /**< Number of IPv6 packets dropped by a drop rule. */ - NSS_IPV6_STATS_MC_CONNECTION_CREATE_REQUESTS, - /**< Number of successful IPv6 multicast create requests. */ - NSS_IPV6_STATS_MC_CONNECTION_UPDATE_REQUESTS, - /**< Number of successful IPv6 multicast update requests. */ - NSS_IPV6_STATS_MC_CONNECTION_CREATE_INVALID_INTERFACE, - /**< Number of IPv6 multicast connection create requests that had invalid interface. */ - NSS_IPV6_STATS_MC_CONNECTION_DESTROY_REQUESTS, - /**< Number of IPv6 multicast connection destroy requests. */ - NSS_IPV6_STATS_MC_CONNECTION_DESTROY_MISSES, - /**< Number of IPv6 multicast connection destroy requests that missed the cache. */ - NSS_IPV6_STATS_MC_CONNECTION_FLUSHES, - /**< Number of IPv6 multicast connection flushes. */ - NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM, - /**< Number of IPv6 mirror connection requests with an invalid interface number. */ - NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE, - /**< Number of IPv6 mirror connection requests with an invalid interface type. */ - - NSS_IPV6_STATS_MIRROR_FAILURES, - /**< Number of IPv6 mirror failures. */ - - NSS_IPV6_STATS_MAX, - /**< Maximum message type. */ -}; - -/** - * nss_ipv6_message_types - * IPv6 bridge and routing rule message types. - * - * NSS_IPV6_RX_DEPRECATED0 is a deprecated type. It is kept for backward compatibility. - */ -enum nss_ipv6_message_types { - NSS_IPV6_TX_CREATE_RULE_MSG, - NSS_IPV6_TX_DESTROY_RULE_MSG, - NSS_IPV6_RX_DEPRECATED0, - NSS_IPV6_RX_CONN_STATS_SYNC_MSG, - NSS_IPV6_RX_NODE_STATS_SYNC_MSG, - NSS_IPV6_TX_CONN_CFG_RULE_MSG, - NSS_IPV6_TX_CREATE_MC_RULE_MSG, - NSS_IPV6_TX_CONN_STATS_SYNC_MANY_MSG, - NSS_IPV6_TX_ACCEL_MODE_CFG_MSG, - NSS_IPV6_TX_CONN_CFG_INQUIRY_MSG, - NSS_IPV6_TX_CONN_TABLE_SIZE_MSG, - NSS_IPV6_TX_DSCP2PRI_CFG_MSG, - NSS_IPV6_TX_RPS_HASH_BITMAP_CFG_MSG, - NSS_IPV6_MAX_MSG_TYPES, -}; - -/** - * nss_ipv6_dscp_map_actions - * Action types mapped to DSCP values. - */ -enum nss_ipv6_dscp_map_actions { - NSS_IPV6_DSCP_MAP_ACTION_ACCEL, - NSS_IPV6_DSCP_MAP_ACTION_DONT_ACCEL, - NSS_IPV6_DSCP_MAP_ACTION_MAX, -}; - -/* - * NSS IPv6 rule creation flags. - */ -#define NSS_IPV6_RULE_CREATE_FLAG_NO_SEQ_CHECK 0x01 - /**< Do not perform TCP sequence number checks. */ -#define NSS_IPV6_RULE_CREATE_FLAG_BRIDGE_FLOW 0x02 - /**< This is a pure bridge forwarding flow. */ -#define NSS_IPV6_RULE_CREATE_FLAG_ROUTED 0x04 - /**< Rule is for a routed connection. */ -#define NSS_IPV6_RULE_CREATE_FLAG_DSCP_MARKING 0x08 - /**< Rule has for a DSCP marking configured. */ -#define NSS_IPV6_RULE_CREATE_FLAG_VLAN_MARKING 0x10 - /**< Rule has for a VLAN marking configured. */ -#define NSS_IPV6_RULE_CREATE_FLAG_ICMP_NO_CME_FLUSH 0x20 - /**< Rule for not flushing connection match entry on ICMP packet. */ -#define NSS_IPV6_RULE_UPDATE_FLAG_CHANGE_MTU 0x40 - /**< Rule updation for MTU change. */ - -/** The L2 payload is not IPv6 but consists of an encapsulating protocol that carries an IPv6 payload within it. - */ -#define NSS_IPV6_RULE_CREATE_FLAG_L2_ENCAP 0x80 - -#define NSS_IPV6_RULE_CREATE_FLAG_DROP 0x100 - /**< Drop packets. */ -#define NSS_IPV6_RULE_CREATE_FLAG_EXCEPTION 0x200 - /**< Rule to except packets. */ -#define NSS_IPV6_RULE_CREATE_FLAG_SRC_INTERFACE_CHECK 0x400 - /**< Check the source interface for the rule. */ -#define NSS_IPV6_RULE_CREATE_FLAG_NO_SRC_IDENT 0x800 - /**< Flag to indicate NSS to ignore src_ident and use value 0 for it during rule addition. */ -#define NSS_IPV6_RULE_CREATE_FLAG_NO_MAC 0x1000 - /**< Flag to bypass writing MAC addresses. */ -#define NSS_IPV6_RULE_CREATE_FLAG_EMESH_SP 0x2000 - /**< Mark rule as E-MESH Service Prioritization valid. */ - -/* - * IPv6 rule creation validity flags. - */ -#define NSS_IPV6_RULE_CREATE_CONN_VALID 0x01 /**< Connection is valid. */ -#define NSS_IPV6_RULE_CREATE_TCP_VALID 0x02 /**< TCP protocol fields are valid. */ -#define NSS_IPV6_RULE_CREATE_PPPOE_VALID 0x04 /**< PPPoE fields are valid. */ -#define NSS_IPV6_RULE_CREATE_QOS_VALID 0x08 /**< QoS fields are valid. */ -#define NSS_IPV6_RULE_CREATE_VLAN_VALID 0x10 /**< VLAN fields are valid. */ -#define NSS_IPV6_RULE_CREATE_DSCP_MARKING_VALID 0x20 - /**< DSCP marking fields are valid. */ -#define NSS_IPV6_RULE_CREATE_VLAN_MARKING_VALID 0x40 - /**< VLAN marking fields are valid. */ -#define NSS_IPV6_RULE_CREATE_SRC_MAC_VALID 0x80 - /**< Source MAC address fields are valid. */ -#define NSS_IPV6_RULE_CREATE_NEXTHOP_VALID 0x100 - /**< Next hop interface number fields are valid. */ -#define NSS_IPV6_RULE_CREATE_RPS_VALID 0x200 /**< RPS for core selection is valid. */ -#define NSS_IPV6_RULE_CREATE_DEST_MAC_VALID 0x400 - /**< Destination MAC address fields are valid. */ -#define NSS_IPV6_RULE_CREATE_IGS_VALID 0x800 /**< Ingress shaping fields are valid. */ -#define NSS_IPV6_RULE_CREATE_IDENTIFIER_VALID 0x1000 /**< Identifier is valid. */ -#define NSS_IPV6_RULE_CREATE_MIRROR_VALID 0x2000 /**< Mirror fields are valid. */ - -/* - * Multicast command rule flags - */ -#define NSS_IPV6_MC_RULE_CREATE_FLAG_MC_UPDATE 0x01 /**< Multicast rule update. */ -#define NSS_IPV6_MC_RULE_CREATE_FLAG_MC_EMESH_SP 0x02 - /**< Mark multicast rule as E-MESH Service Prioritization valid. */ - -/* - * Multicast command validity flags - */ -#define NSS_IPV6_MC_RULE_CREATE_FLAG_QOS_VALID 0x01 - /**< QoS fields are valid. */ -#define NSS_IPV6_MC_RULE_CREATE_FLAG_DSCP_MARKING_VALID 0x02 - /**< DSCP fields are valid. */ -#define NSS_IPV6_MC_RULE_CREATE_FLAG_INGRESS_VLAN_VALID 0x04 - /**< Ingress VLAN fields are valid. */ -#define NSS_IPV6_MC_RULE_CREATE_FLAG_INGRESS_PPPOE 0x08 - /**< Ingress PPPoE fields are valid. */ -#define NSS_IPV6_MC_RULE_CREATE_FLAG_IGS_VALID 0x10 - /**< Ingress shaping fields are valid. */ - -/* - * Per-interface rule flags for a multicast connection (to be used with the rule_flags - * field of nss_ipv6_mc_if_rule structure). - */ -#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_BRIDGE_FLOW 0x01 - /**< Bridge flow. */ -#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_ROUTED_FLOW 0x02 - /**< Routed flow. */ -#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_JOIN 0x04 - /**< Interface has joined the flow. */ -#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_LEAVE 0x08 - /**< Interface has left the flow. */ - -/* - * Per-interface valid flags for a multicast connection (to be used with the valid_flags - * field of nss_ipv6_mc_if_rule structure). - */ -#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_VLAN_VALID 0x01 - /**< VLAN fields are valid. */ -#define NSS_IPV6_MC_RULE_CREATE_IF_FLAG_PPPOE_VALID 0x02 - /**< PPPoE fields are valid. */ - -/* - * Source MAC address valid flags (to be used with mac_valid_flags field of nss_ipv6_src_mac_rule structure) - */ -#define NSS_IPV6_SRC_MAC_FLOW_VALID 0x01 - /**< MAC address for the flow interface is valid. */ -#define NSS_IPV6_SRC_MAC_RETURN_VALID 0x02 - /**< MAC address for the return interface is valid. */ - -/* - * Identifier valid flags (to be used with identifier_valid_flags field of nss_ipv6_identifier_rule structure) - */ -#define NSS_IPV6_FLOW_IDENTIFIER_VALID 0x01 - /**< Identifier for flow direction is valid. */ -#define NSS_IPV6_RETURN_IDENTIFIER_VALID 0x02 - /**< Identifier for return direction is valid. */ - -/* - * Mirror valid flags (to be used with the valid field of nss_ipv6_mirror_rule structure) - */ -#define NSS_IPV6_MIRROR_FLOW_VALID 0x01 - /**< Mirror interface number for the flow direction is valid. */ -#define NSS_IPV6_MIRROR_RETURN_VALID 0x02 - /**< Mirror interface number for the return direction is valid. */ - -/** - * nss_ipv6_exception_events - * Exception events from an IPv6 bridge or route handler. - */ -enum nss_ipv6_exception_events { - NSS_IPV6_EXCEPTION_EVENT_ICMP_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_ICMP_UNHANDLED_TYPE, - NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_UDP_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_TCP_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_UNKNOWN_PROTOCOL, - NSS_IPV6_EXCEPTION_EVENT_ICMP_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_ICMP_FLUSH_TO_HOST, - NSS_IPV6_EXCEPTION_EVENT_TCP_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_TCP_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_TCP_SMALL_HOP_LIMIT, - NSS_IPV6_EXCEPTION_EVENT_TCP_NEEDS_FRAGMENTATION, - NSS_IPV6_EXCEPTION_EVENT_TCP_FLAGS, - NSS_IPV6_EXCEPTION_EVENT_TCP_SEQ_EXCEEDS_RIGHT_EDGE, - NSS_IPV6_EXCEPTION_EVENT_TCP_SMALL_DATA_OFFS, - NSS_IPV6_EXCEPTION_EVENT_TCP_BAD_SACK, - NSS_IPV6_EXCEPTION_EVENT_TCP_BIG_DATA_OFFS, - NSS_IPV6_EXCEPTION_EVENT_TCP_SEQ_BEFORE_LEFT_EDGE, - NSS_IPV6_EXCEPTION_EVENT_TCP_ACK_EXCEEDS_RIGHT_EDGE, - NSS_IPV6_EXCEPTION_EVENT_TCP_ACK_BEFORE_LEFT_EDGE, - NSS_IPV6_EXCEPTION_EVENT_UDP_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_UDP_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_UDP_SMALL_HOP_LIMIT, - NSS_IPV6_EXCEPTION_EVENT_UDP_NEEDS_FRAGMENTATION, - NSS_IPV6_EXCEPTION_EVENT_WRONG_TARGET_MAC, - NSS_IPV6_EXCEPTION_EVENT_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_UNKNOWN_PROTOCOL, - NSS_IPV6_EXCEPTION_EVENT_IVID_MISMATCH, - NSS_IPV6_EXCEPTION_EVENT_IVID_MISSING, - NSS_IPV6_EXCEPTION_EVENT_DSCP_MARKING_MISMATCH, - NSS_IPV6_EXCEPTION_EVENT_VLAN_MARKING_MISMATCH, - NSS_IPV6_EXCEPTION_EVENT_INTERFACE_MISMATCH, - NSS_IPV6_EXCEPTION_EVENT_GRE_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_GRE_NEEDS_FRAGMENTATION, - NSS_IPV6_EXCEPTION_EVENT_GRE_SMALL_HOP_LIMIT, - NSS_IPV6_EXCEPTION_EVENT_DESTROY, - NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_UDPLITE_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_UDPLITE_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_UDPLITE_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_UDPLITE_SMALL_HOP_LIMIT, - NSS_IPV6_EXCEPTION_EVENT_UDPLITE_NEEDS_FRAGMENTATION, - NSS_IPV6_EXCEPTION_EVENT_MC_UDP_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_MC_MEM_ALLOC_FAILURE, - NSS_IPV6_EXCEPTION_EVENT_MC_UPDATE_FAILURE, - NSS_IPV6_EXCEPTION_EVENT_MC_PBUF_ALLOC_FAILURE, - NSS_IPV6_EXCEPTION_EVENT_ESP_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_ESP_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_ESP_IP_FRAGMENT, - NSS_IPV6_EXCEPTION_EVENT_ESP_SMALL_HOP_LIMIT, - NSS_IPV6_EXCEPTION_EVENT_ESP_NEEDS_FRAGMENTATION, - NSS_IPV6_EXCEPTION_EVENT_TUNIPIP6_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_TUNIPIP6_SMALL_HOP_LIMIT, - NSS_IPV6_EXCEPTION_EVENT_TUNIPIP6_NEEDS_FRAGMENTATION, - NSS_IPV6_EXCEPTION_EVENT_PPPOE_BRIDGE_NO_ICME, - NSS_IPV6_EXCEPTION_EVENT_DONT_FRAG_SET, - NSS_IPV6_EXCEPTION_EVENT_REASSEMBLY_NOT_SUPPORTED, - NSS_IPV6_EXCEPTION_EVENT_PPPOE_NO_SESSION, - NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_GRE_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_ESP_HEADER_INCOMPLETE, - NSS_IPV6_EXCEPTION_EVENT_EMESH_PRIO_MISMATCH, - NSS_IPV6_EXCEPTION_EVENT_MAX -}; - -/** - * nss_ipv6_5tuple - * Common 5-tuple information. - */ -struct nss_ipv6_5tuple { - uint32_t flow_ip[4]; /**< Flow IP address. */ - uint32_t flow_ident; /**< Flow identifier (e.g., TCP or UDP port). */ - uint32_t return_ip[4]; /**< Return IP address. */ - uint32_t return_ident; /**< Return identier (e.g., TCP or UDP port). */ - uint8_t protocol; /**< Protocol number. */ - uint8_t reserved[3]; /**< Padded for alignment. */ -}; - -/** - * nss_ipv6_connection_rule - * Information for creating a connection. - */ -struct nss_ipv6_connection_rule { - uint16_t flow_mac[3]; /**< Flow MAC address. */ - uint16_t return_mac[3]; /**< Return MAC address. */ - int32_t flow_interface_num; /**< Flow interface number. */ - int32_t return_interface_num; /**< Return interface number. */ - uint32_t flow_mtu; /**< MTU for the flow interface. */ - uint32_t return_mtu; /**< MTU for the return interface. */ -}; - -/** - * nss_ipv6_pppoe_rule - * Information for PPPoE connection rules. - */ -struct nss_ipv6_pppoe_rule { - uint32_t flow_if_exist; - /**< PPPoE interface existence flag for the flow direction. */ - int32_t flow_if_num; - /**< PPPoE interface number for the flow direction. */ - uint32_t return_if_exist; - /**< PPPoE interface existence flag for the return direction. */ - int32_t return_if_num; - /**< PPPoE interface number for the return direction. */ -}; - -/** - * nss_ipv6_dscp_rule - * Information for DSCP connection rules. - */ -struct nss_ipv6_dscp_rule { - uint8_t flow_dscp; /**< Egress DSCP value for the flow direction. */ - uint8_t return_dscp; /**< Egress DSCP value for the return direction. */ - uint8_t reserved[2]; /**< Padded for alignment. */ -}; - -/** - * nss_ipv6_vlan_rule - * Information for VLAN connection rules. - */ -struct nss_ipv6_vlan_rule { - uint32_t ingress_vlan_tag; /**< VLAN tag for the ingress packets. */ - uint32_t egress_vlan_tag; /**< VLAN tag for egress packets. */ -}; - -/** - * nss_ipv6_nexthop - * Information for the next hop interface numbers. - * - * A next hop is the next interface that will receive the packet as opposed to - * the final interface when the packet leaves the device. - */ -struct nss_ipv6_nexthop { - /** - * Next hop interface number of the flow direction (from which the connection - * originated). - */ - int32_t flow_nexthop; - /** - * Next hop interface number of the return direction (to which the connection - * is destined). - */ - int32_t return_nexthop; -}; - -/** - * nss_ipv6_protocol_tcp_rule - * Information for TCP connection rules. - */ -struct nss_ipv6_protocol_tcp_rule { - uint32_t flow_max_window; - /**< Largest seen window for the flow direction. */ - uint32_t flow_end; - /**< Largest seen sequence + segment length for the flow direction. */ - uint32_t flow_max_end; - /**< Largest seen ack + max(1, win) for the flow direction. */ - uint32_t return_max_window; - /**< Largest seen window for the return direction. */ - uint32_t return_end; - /**< Largest seen sequence + segment length for the return direction. */ - uint32_t return_max_end; - /**< Largest seen ack + max(1, win) for the return direction. */ - uint8_t flow_window_scale; - /**< Window scaling factor for the flow direction. */ - uint8_t return_window_scale; - /**< Window scaling factor for the return direction. */ - uint16_t reserved; - /**< Alignment padding. */ -}; - -/** - * nss_ipv6_igs_rule - * Information for ingress shaping connection rules. - */ -struct nss_ipv6_igs_rule { - uint16_t igs_flow_qos_tag; - /**< Ingress shaping QoS tag associated with this rule for the flow direction. */ - uint16_t igs_return_qos_tag; - /**< Ingress shaping QoS tag associated with this rule for the return direction. */ -}; - -/** - * nss_ipv6_qos_rule - * Information for QoS connection rules. - */ -struct nss_ipv6_qos_rule { - uint32_t flow_qos_tag; - /**< QoS tag associated with this rule for the flow direction. */ - uint32_t return_qos_tag; - /**< QoS tag associated with this rule for the return direction. */ -}; - -/** - * nss_ipv6_src_mac_rule - * Information for source MAC address rules. - */ -struct nss_ipv6_src_mac_rule { - uint32_t mac_valid_flags; /**< MAC address validity flags. */ - uint16_t flow_src_mac[3]; /**< Source MAC address for the flow direction. */ - uint16_t return_src_mac[3]; /**< Source MAC address for the return direction. */ -}; - -/** - * nss_ipv6_rps_rule - * RPS rule structure. - */ -struct nss_ipv6_rps_rule { - uint8_t flow_rps; - /**< RPS for core selection for flow direction. */ - uint8_t return_rps; - /**< RPS for core selection for return direction. */ - uint8_t reserved[2]; - /**< Padded for alignment. */ -}; - -/** - * nss_ipv6_identifier_rule - * Identifier rule structure. - */ -struct nss_ipv6_identifier_rule { - uint32_t identifier_valid_flags; - /**< Identifier validity flags. */ - uint32_t flow_identifier; - /**< Identifier for flow direction. */ - uint32_t return_identifier; - /**< Identifier for return direction. */ -}; - -/** - * nss_ipv6_mirror_rule - * Mirror rule structure. - */ -struct nss_ipv6_mirror_rule { - uint32_t valid; /**< Mirror validity flags. */ - nss_if_num_t flow_ifnum; /**< Flow mirror interface number. */ - nss_if_num_t return_ifnum; /**< Return mirror interface number. */ -}; - -/** - * nss_ipv6_error_response_types - * Error types for IPv6 messages. - */ -enum nss_ipv6_error_response_types { - NSS_IPV6_UNKNOWN_MSG_TYPE = 1, /**< Unknown error. */ - NSS_IPV6_CR_INVALID_PNODE_ERROR, /**< Invalid interface number. */ - NSS_IPV6_CR_MISSING_CONNECTION_RULE_ERROR, /**< Missing connection rule. */ - NSS_IPV6_CR_BUFFER_ALLOC_FAIL_ERROR, /**< Buffer allocation failed. */ - NSS_IPV6_DR_NO_CONNECTION_ENTRY_ERROR, - /**< No connection was found to delete. */ - NSS_IPV6_CR_CONN_CFG_ALREADY_CONFIGURED_ERROR, - /**< Connection configuration was already done once. */ - - NSS_IPV6_CR_CONN_CFG_NOT_MULTIPLE_OF_QUANTA_ERROR, - /**< Input for connection configuration is not a multiple of quanta. */ - - /** - * Input for connection configuration exceeds the maximum number of supported - * connections. - */ - NSS_IPV6_CR_CONN_CFG_EXCEEDS_LIMIT_ERROR, - - /** - * Memory allocation for connection configuration failed at the NSS firmware. - */ - NSS_IPV6_CR_CONN_CFG_MEM_ALLOC_FAIL_ERROR, - - NSS_IPV6_CR_MULTICAST_INVALID_PROTOCOL, - /**< Invalid L4 protocol for creating a multicast rule. */ - NSS_IPV6_CR_MULTICAST_UPDATE_INVALID_FLAGS, - /**< Invalid multicast flags for updating multicast. */ - NSS_IPV6_CR_MULTICAST_UPDATE_INVALID_IF, - /**< Invalid interface for updating multicast. */ - NSS_IPV6_CR_ACCEL_MODE_CONFIG_INVALID, - /**< Invalid config value for acceleration mode. */ - NSS_IPV6_CR_INVALID_MSG_ERROR, - /**< Invalid message size error. */ - NSS_IPV6_CR_DSCP2PRI_PRI_INVALID, - /**< Priority value out of range error. */ - NSS_IPV6_CR_DSCP2PRI_CONFIG_INVALID, - /**< Invalid DSCP value. */ - NSS_IPV6_CR_INVALID_RPS, - /**< Invalid RPS Value. */ - NSS_IPV6_HASH_BITMAP_INVALID, - /**< Invalid hash bitmap. */ - NSS_IPV6_DR_HW_DECEL_FAIL_ERROR, - /**< Hardware deceleration fail error. */ - NSS_IPV6_CR_RETURN_EXIST_ERROR, - /**< Rule creation failed because a 5-tuple return already exists. */ - NSS_IPV6_CR_INVALID_IDENTIFIER, - /**< Invalid identifier value. */ - NSS_IPV6_CR_EMESH_SP_CONFIG_INVALID, - /**< Rule creation failed because Qos tag was not set for a Emesh SP rule. */ - NSS_IPV6_LAST - /**< Maximum number of error responses. */ -}; - -/** - * nss_ipv6_rule_create_msg - * IPv6 rule for creating sub-messages. - */ -struct nss_ipv6_rule_create_msg { - /* - * Request - */ - uint16_t valid_flags; - /**< Bit flags associated with the validity of parameters. */ - uint16_t rule_flags; - /**< Bit flags associated with the rule. */ - struct nss_ipv6_5tuple tuple; - /**< Holds values of the 5 tuple. */ - struct nss_ipv6_connection_rule conn_rule; - /**< Basic connection-specific data. */ - struct nss_ipv6_protocol_tcp_rule tcp_rule; - /**< Protocol-related accleration parameters. */ - struct nss_ipv6_pppoe_rule pppoe_rule; - /**< PPPoE-related accleration parameters. */ - struct nss_ipv6_qos_rule qos_rule; - /**< QoS-related accleration parameters. */ - struct nss_ipv6_dscp_rule dscp_rule; - /**< DSCP-related accleration parameters. */ - struct nss_ipv6_vlan_rule vlan_primary_rule; - /**< VLAN-related accleration parameters. */ - struct nss_ipv6_vlan_rule vlan_secondary_rule; - /**< VLAN-related accleration parameters. */ - struct nss_ipv6_src_mac_rule src_mac_rule; - /**< Source MAC address-related acceleration parameters. */ - struct nss_ipv6_nexthop nexthop_rule; - /**< Parameters related to the next hop. */ - struct nss_ipv6_rps_rule rps_rule; - /**< RPS parameter. */ - struct nss_ipv6_igs_rule igs_rule; - /**< Ingress shaping related accleration parameters. */ - struct nss_ipv6_identifier_rule identifier; - /**< Rule for adding identifier. */ - struct nss_ipv6_mirror_rule mirror_rule; - /**< Mirror rule parameter. */ -}; - -/** - * nss_ipv6_inquiry_msg - * IPv6 connection inquiry sub-messages. - */ -struct nss_ipv6_inquiry_msg { - /** - * Request by 5-tuple and response in other items. - */ - struct nss_ipv6_rule_create_msg rr; -}; - -/** - * nss_ipv6_mc_if_rule - * IPv6 multicast rule for creating a per-interface payload. - */ -struct nss_ipv6_mc_if_rule { - uint16_t rule_flags; - /**< Bit flags associated with the rule for this interface. */ - - /** - * Bit flags associated with the validity of parameters for this interface. - */ - uint16_t valid_flags; - - uint32_t egress_vlan_tag[MAX_VLAN_DEPTH]; - /**< VLAN tag stack for the egress packets. */ - int32_t pppoe_if_num; /**< PPPoE interface number. */ - uint32_t if_num; /**< Interface number. */ - uint32_t if_mtu; /**< MTU of the interface. */ - uint16_t if_mac[3]; /**< Interface MAC address. */ - uint8_t reserved[2]; /**< Reserved 2 bytes for alignment. */ -}; - -/** - * nss_ipv6_mc_rule_create_msg - * IPv6 multicast rule for creating sub-messages. - */ -struct nss_ipv6_mc_rule_create_msg { - struct nss_ipv6_5tuple tuple; /**< Holds values of the 5 tuple. */ - - uint32_t rule_flags; /**< Multicast command rule flags. */ - uint32_t valid_flags; /**< Multicast command validity flags. */ - uint32_t src_interface_num; - /**< Source interface number (virtual or physical). */ - uint32_t ingress_vlan_tag[MAX_VLAN_DEPTH]; - /**< VLAN tag stack for the ingress packets. */ - uint32_t qos_tag; /**< QoS tag for the flow. */ - uint16_t dest_mac[3]; /**< Destination multicast MAC address. */ - uint16_t if_count; /**< Number of destination interfaces. */ - uint8_t egress_dscp; /**< Egress DSCP value for the flow. */ - uint8_t reserved[1]; /**< Reserved 1 byte for alignment. */ - uint16_t igs_qos_tag; /**< Ingress shaping QoS tag for the flow. */ - - struct nss_ipv6_mc_if_rule if_rule[NSS_MC_IF_MAX]; - /**< Per-interface information. */ -}; - -/** - * nss_ipv6_rule_destroy_msg - * IPv6 rule for deleting sub-messages. - */ -struct nss_ipv6_rule_destroy_msg { - struct nss_ipv6_5tuple tuple; /**< Holds values of the 5 tuple. */ -}; - -/** - * nss_ipv6_rule_conn_get_table_size_msg - * IPv6 rule for fetching connection tables size. - */ -struct nss_ipv6_rule_conn_get_table_size_msg { - uint32_t num_conn; - /**< Number of supported IPv6 connections. */ - uint32_t ce_table_size; - /**< Size of the connection entry table in NSS firmware. */ - uint32_t cme_table_size; - /**< Size of the connection match entry table in NSS firmware. */ -}; - -/** - * nss_ipv6_rule_conn_cfg_msg - * IPv6 rule for connection configuration sub-messages. - */ -struct nss_ipv6_rule_conn_cfg_msg { - uint32_t num_conn; /**< Number of supported IPv6 connections. */ - uint32_t ce_mem; /**< Memory allocated by host for connection entries table. */ - uint32_t cme_mem; /**< Memory allocated by host for connection match entries table. */ -}; - -/* - * IPv6 rule synchronization reasons. - */ -#define NSS_IPV6_RULE_SYNC_REASON_STATS 0 - /**< Rule for synchronizing statistics. */ -#define NSS_IPV6_RULE_SYNC_REASON_FLUSH 1 - /**< Rule for flushing a cache entry. */ -#define NSS_IPV6_RULE_SYNC_REASON_EVICT 2 - /**< Rule for evicting a cache entry. */ -#define NSS_IPV6_RULE_SYNC_REASON_DESTROY 3 - /**< Rule for destroying a cache entry (requested by the host OS). */ - -/** - * nss_ipv6_conn_sync - * IPv6 connection synchronization message. - */ -struct nss_ipv6_conn_sync { - uint32_t reserved; /**< Reserved field for backward compatibility. */ - uint8_t protocol; /**< Protocol number. */ - uint32_t flow_ip[4]; /**< Flow IP address. */ - uint32_t flow_ident; /**< Flow identifier (e.g., port). */ - uint32_t flow_max_window; /**< Largest seen window for the flow direction. */ - - /** - * Largest seen sequence + segment length for the flow direction. - */ - uint32_t flow_end; - - uint32_t flow_max_end; - /**< Largest seen ack + max(1, win) for the flow direction. */ - uint32_t flow_rx_packet_count; /**< Rx packet count for the flow interface. */ - uint32_t flow_rx_byte_count; /**< Rx byte count for the flow interface. */ - uint32_t flow_tx_packet_count; /**< Tx packet count for the flow interface. */ - uint32_t flow_tx_byte_count; /**< Tx byte count for the flow interface. */ - uint32_t return_ip[4]; /**< Return IP address. */ - uint32_t return_ident; /**< Return identier (e.g., port). */ - uint32_t return_max_window; - /**< Largest seen window for the return direction. */ - - /** - * Largest seen sequence + segment length for the return direction. - */ - uint32_t return_end; - - uint32_t return_max_end; - /**< Largest seen ack + max(1, win) for the return direction. */ - uint32_t return_rx_packet_count; - /**< Rx packet count for the return interface. */ - uint32_t return_rx_byte_count; - /**< Rx byte count for the return interface. */ - uint32_t return_tx_packet_count; - /**< Tx packet count for the return interface. */ - uint32_t return_tx_byte_count; - /**< Tx byte count for the return interface. */ - uint32_t inc_ticks; /**< Number of ticks since the last synchronization. */ - uint32_t reason; /**< Reason for the synchronization. */ - uint8_t flags; /**< Bit flags associated with the rule. */ - uint32_t qos_tag; /**< QoS tag. */ - uint32_t cause; /**< Flush cause associated with the rule. */ -}; - -/** - * nss_ipv6_conn_sync_many_msg - * Information for a multiple IPv6 connection statistics synchronization message. - */ -struct nss_ipv6_conn_sync_many_msg { - /* Request. */ - uint16_t index; /**< Request connection statistics from the index. */ - uint16_t size; /**< Buffer size of this message. */ - - /* Response. */ - uint16_t next; /**< Firmware response for the next connection to be requested. */ - uint16_t count; /**< Number of synchronized connections included in this message. */ - - struct nss_ipv6_conn_sync conn_sync[]; /**< Array for the statistics. */ -}; - -/** - * nss_ipv6_accel_mode_cfg_msg - * IPv6 acceleration mode configuration. - */ -struct nss_ipv6_accel_mode_cfg_msg { - uint32_t mode; /**< Type of acceleration mode. */ -}; - -/** - * nss_ipv6_dscp2pri_cfg_msg - * IPv6 dscp2pri configuration msg. - */ -struct nss_ipv6_dscp2pri_cfg_msg { - uint8_t dscp; /**< Value of DSCP. */ - uint8_t priority; /**< Corresponding priority. */ -}; - -/** - * nss_ipv6_rps_hash_bitmap_cfg_msg - * RPS hash mask configuration. - * - * The bitmap represents the host cores to which NSS firmware can steer - * packets based on packet hash. The least significant bit represents core0. - */ -struct nss_ipv6_rps_hash_bitmap_cfg_msg { - uint32_t hash_bitmap; /**< Hash mask. */ -}; - -/** - * nss_ipv6_node_sync - * IPv6 node synchronization statistics. - */ -struct nss_ipv6_node_sync { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t ipv6_connection_create_requests; - /**< Number of connection create requests. */ - - /** - * Number of connection create requests that collided with the existing entries. - */ - uint32_t ipv6_connection_create_collisions; - - /** - * Number of connection create requests that had invalid interfaces. - */ - uint32_t ipv6_connection_create_invalid_interface; - - uint32_t ipv6_connection_destroy_requests; - /**< Number of connection destroy requests. */ - uint32_t ipv6_connection_destroy_misses; - /**< Number of connection destroy requests that missed the cache. */ - uint32_t ipv6_connection_hash_hits; /**< Number of connection hash hits. */ - uint32_t ipv6_connection_hash_reorders; /**< Number of connection hash reorders. */ - uint32_t ipv6_connection_flushes; /**< Number of connection flushes. */ - uint32_t ipv6_connection_evictions; /**< Number of connection evictions. */ - uint32_t ipv6_fragmentations; /**< Number of successful fragmentations. */ - uint32_t ipv6_frag_fails; /**< Number of fragmentation fails. */ - uint32_t ipv6_dropped_by_rule; /**< Number of packets dropped by a drop rule.*/ - uint32_t ipv6_mc_connection_create_requests; - /**< Number of multicast connection create requests. */ - uint32_t ipv6_mc_connection_update_requests; - /**< Number of multicast connection update requests. */ - - /** - * Number of multicast connection create requests that had invalid interfaces. - */ - uint32_t ipv6_mc_connection_create_invalid_interface; - - uint32_t ipv6_mc_connection_destroy_requests; - /**< Number of multicast connection destroy requests. */ - - /** - * Number of multicast connection destroy requests that missed the cache. - */ - uint32_t ipv6_mc_connection_destroy_misses; - - uint32_t ipv6_mc_connection_flushes; - /**< Number of multicast connection flushes. */ - - uint32_t ipv6_connection_create_invalid_mirror_ifnum; - /**< Number of create request failed with an invalid mirror interface number. */ - - uint32_t ipv6_connection_create_invalid_mirror_iftype; - /**< Number of create request failed with an invalid mirror interface type. */ - - uint32_t ipv6_mirror_failures; - /**< Mirror packet failed. */ - - uint32_t exception_events[NSS_IPV6_EXCEPTION_EVENT_MAX]; - /**< Number of exception events. */ -}; - -/** - * nss_ipv6_msg - * Data for sending and receiving IPv6 bridge or routing messages. - */ -struct nss_ipv6_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of an IPv6 bridge or routing message. - */ - union { - struct nss_ipv6_rule_create_msg rule_create; - /**< Create a rule. */ - struct nss_ipv6_rule_destroy_msg rule_destroy; - /**< Destroy a rule. */ - struct nss_ipv6_conn_sync conn_stats; - /**< Synchronize statistics. */ - struct nss_ipv6_node_sync node_stats; - /**< Synchronize node statistics. */ - struct nss_ipv6_rule_conn_get_table_size_msg size; - /**< Get the size for connection tables. */ - struct nss_ipv6_rule_conn_cfg_msg rule_conn_cfg; - /**< Configure a rule connection. */ - struct nss_ipv6_mc_rule_create_msg mc_rule_create; - /**< Create a multicast rule. */ - struct nss_ipv6_conn_sync_many_msg conn_stats_many; - /**< Synchronize multiple connection statistics. */ - struct nss_ipv6_accel_mode_cfg_msg accel_mode_cfg; - /**< Configure acceleration mode. */ - struct nss_ipv6_inquiry_msg inquiry; - /**< Inquiry if a connection has been created. */ - struct nss_ipv6_dscp2pri_cfg_msg dscp2pri_cfg; - /**< Configure DSCP-to-priority mapping. */ - struct nss_ipv6_rps_hash_bitmap_cfg_msg rps_hash_bitmap; - /**< Configure rps_hash_bitmap. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_ipv6_stats_notification - * Data for sending IPv6 statistics. - */ -struct nss_ipv6_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t cmn_node_stats[NSS_STATS_NODE_MAX]; /**< Common node statistics. */ - uint64_t special_stats[NSS_IPV6_STATS_MAX]; /**< IPv6 special statistics. */ - uint64_t exception_stats[NSS_IPV6_EXCEPTION_EVENT_MAX]; /**< IPv6 exception statistics. */ -}; - -/** - * Configured IPv6 connection number to use for calculating the total number of - * connections. - */ -extern int nss_ipv6_conn_cfg; - -#ifdef __KERNEL__ - -/** - * nss_ipv6_max_conn_count - * Returns the maximum number of IPv6 connections that the NSS acceleration - * engine supports. - * - * @return - * Number of connections that can be accelerated. - */ -extern int nss_ipv6_max_conn_count(void); - -/** - * Callback function for receiving IPv6 messages. - * - * @datatypes - * nss_ipv6_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_ipv6_msg_callback_t)(void *app_data, struct nss_ipv6_msg *msg); - -/** - * nss_ipv6_tx - * Transmits an IPv6 message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipv6_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipv6_tx(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_msg *msg); - -/** - * nss_ipv6_tx_sync - * Transmits a synchronous IPv6 message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipv6_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipv6_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_msg *msg); - -/** - * nss_ipv6_tx_with_size - * Transmits an IPv6 message with a specified size to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ipv6_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * @param[in] size Actual size of this message. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_ipv6_tx_with_size(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_msg *msg, uint32_t size); - -/** - * nss_ipv6_notify_register - * Registers a notifier callback to forward the IPv6 messages received from the NSS - * firmware to the registered subsystem. - * - * @datatypes - * nss_ipv6_msg_callback_t - * - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipv6_notify_register(nss_ipv6_msg_callback_t cb, void *app_data); - -/** - * nss_ipv6_notify_unregister - * Deregisters a notifier callback from the NSS. - * - * @return - * None. - * - * @dependencies - * The notifier callback must have been previously registered. - */ -extern void nss_ipv6_notify_unregister(void); - -/** - * nss_ipv6_conn_sync_many_notify_register - * Registers a notifier callback with the NSS for connection synchronization - * message responses. - * - * @datatypes - * nss_ipv6_msg_callback_t - * - * @param[in] cb Callback function for the message. - * - * @return - * None. - */ -extern void nss_ipv6_conn_sync_many_notify_register(nss_ipv6_msg_callback_t cb); - -/** - * nss_ipv6_conn_sync_many_notify_unregister - * Degisters a notifier callback from the NSS. - * - * @return - * None. - * - * @dependencies - * The notifier callback must have been previously registered. - */ -extern void nss_ipv6_conn_sync_many_notify_unregister(void); - -/** - * nss_ipv6_get_mgr - * Gets the NSS context that is managing the IPv6 processes. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_ipv6_get_mgr(void); - -/** - * nss_ipv6_msg_init - * Initializes IPv6-specific messages. - * - * @datatypes - * nss_ipv6_msg \n - * nss_ipv6_msg_callback_t - * - * @param[in,out] nim Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_ipv6_msg_init(struct nss_ipv6_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, - nss_ipv6_msg_callback_t cb, void *app_data); - -/** - * nss_ipv6_register_handler - * Registers the IPv6 message handler. - * - * @return - * None. - */ -void nss_ipv6_register_handler(void); - -/** - * nss_ipv6_register_sysctl - * Registers the IPv6 system control table. - * - * @return - * None. - */ -void nss_ipv6_register_sysctl(void); - -/** - * nss_ipv6_unregister_sysctl - * Deregisters the IPv6 system control table. - * - * @return - * None. - * - * @dependencies - * The system control table must have been previously registered. - */ -void nss_ipv6_unregister_sysctl(void); - -/** - * nss_ipv6_update_conn_count - * Sets the maximum number of IPv6 connections. - * - * @param[in] ipv6_num_conn Maximum number. - * - * @return - * 0 -- Success - */ -int nss_ipv6_update_conn_count(int ipv6_num_conn); - -/** - * nss_ipv6_free_conn_tables - * Frees memory allocated for connection tables. - * - * @return - * None. - */ -void nss_ipv6_free_conn_tables(void); - -/** - * nss_ipv6_dscp_action_get - * Gets the action value of the DSCP. - * - * @param[in] dscp Value of the DSCP field. - * - * @return - * Action value of the DSCP field. - */ -enum nss_ipv6_dscp_map_actions nss_ipv6_dscp_action_get(uint8_t dscp); - -/* - * Logger APIs - */ - -/** - * nss_ipv6_log_tx_msg - * Logs an IPv6 message that is sent to the NSS firmware. - * - * @datatypes - * nss_ipv6_msg - * - * @param[in] nim Pointer to the NSS interface message. - * - * @return - * None. - */ -void nss_ipv6_log_tx_msg(struct nss_ipv6_msg *nim); - -/** - * nss_ipv6_log_rx_msg - * Logs an IPv6 message that is received from the NSS firmware. - * - * @datatypes - * nss_ipv6_msg - * - * @param[in] nim Pointer to the NSS interface message. - * - * @return - * None. - */ -void nss_ipv6_log_rx_msg(struct nss_ipv6_msg *nim); - -/** - * nss_ipv6_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_ipv6_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_ipv6_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_ipv6_stats_unregister_notifier(struct notifier_block *nb); -#endif - -/** - * @} - */ - -#endif /* __NSS_IPV6_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv6_reasm.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv6_reasm.h deleted file mode 100644 index 806bf0041..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ipv6_reasm.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ipv6_reasm.h - * NSS IPv6 reassembly interface definitions. - */ - -#ifndef __NSS_IPV6_REASM_H -#define __NSS_IPV6_REASM_H - -/** - * @addtogroup nss_ipv6_reasm_subsystem - * @{ - */ - -/** - * nss_ipv6_reasm_stats - * IPv6 reassembly node statistics. - */ -enum nss_ipv6_reasm_stats { - NSS_IPV6_REASM_STATS_ALLOC_FAILS, - /**< Number of fragment queue allocation failures. */ - NSS_IPV6_REASM_STATS_TIMEOUTS, - /**< Number of expired fragment queues. */ - NSS_IPV6_REASM_STATS_DISCARDS, - /**< Number of fragment queues discarded due to malformed fragments. */ - NSS_IPV6_REASM_STATS_MAX, - /**< Maximum message type. */ -}; - -/** - * nss_ipv6_reasm_stats_notification - * Data for sending IPv6 reassembly statistics. - */ -struct nss_ipv6_reasm_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t cmn_node_stats[NSS_STATS_NODE_MAX]; /**< Common node statistics. */ - uint64_t ipv6_reasm_stats[NSS_IPV6_REASM_STATS_MAX]; /**< IPv6 reassembly statistics. */ -}; - -#ifdef __KERNEL__ - -/** - * nss_ipv6_reasm_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_ipv6_reasm_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_ipv6_reasm_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_ipv6_reasm_stats_unregister_notifier(struct notifier_block *nb); -#endif - -/** - * @} - */ - -#endif /* __NSS_IPV6_REASM_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_l2tpv2.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_l2tpv2.h deleted file mode 100644 index e36c8504f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_l2tpv2.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015, 2017-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_l2tpv2.h - * NSS L2TPv2 interface definitions. - */ - -#ifndef _NSS_L2TP_V2_H_ -#define _NSS_L2TP_V2_H_ - -/** - * @addtogroup nss_l2tpv2_subsystem - * @{ - */ - -/** - * Maximum number of supported L2TPv2 sessions. - */ -#define NSS_MAX_L2TPV2_DYNAMIC_INTERFACES 4 - -/** - * nss_l2tpv2_metadata_types - * Message types for L2TPv2 requests and responses. - */ -enum nss_l2tpv2_metadata_types { - NSS_L2TPV2_MSG_SESSION_CREATE, - NSS_L2TPV2_MSG_SESSION_DESTROY, - NSS_L2TPV2_MSG_SYNC_STATS, - NSS_L2TPV2_MSG_BIND_IPSEC_IF, - NSS_L2TPV2_MSG_MAX -}; - -/** - * nss_l2tpv2_stats_session - * L2TPv2 debug statistics. - */ -enum nss_l2tpv2_stats_session { - NSS_L2TPV2_STATS_SESSION_RX_PPP_LCP_PKTS, /**< Number of PPP LCP packets received. */ - NSS_L2TPV2_STATS_SESSION_RX_EXP_DATA_PKTS, /**< Number of Rx exceptioned packets. */ - NSS_L2TPV2_STATS_SESSION_ENCAP_PBUF_ALLOC_FAIL_PKTS, /**< Number of times packet buffer allocation failed during encapsulation. */ - NSS_L2TPV2_STATS_SESSION_DECAP_PBUF_ALLOC_FAIL_PKTS, /*< Number of times packet buffer allocation failed during decapsulation. */ - NSS_L2TPV2_STATS_SESSION_DECAP_L2TPOIPSEC_SRC_ERR, - /**< Number of packets dropped due to source error in L2TP over IPsec flow in decapsulation. */ - NSS_L2TPV2_STATS_SESSION_MAX /**< Maximum message type. */ -}; - -/** - * nss_l2tpv2_stats_notification - * L2TPv2 statistics structure. - */ -struct nss_l2tpv2_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ - uint64_t stats[NSS_L2TPV2_STATS_SESSION_MAX]; /**< L2TPv2 statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ -/** - * nss_l2tpv2_session_create_msg - * Payload for creating an L2TPv2 session. - */ -struct nss_l2tpv2_session_create_msg { - uint16_t local_tunnel_id; /**< Local identifier for the control connection. */ - uint16_t local_session_id; /**< Local identifier of session inside a tunnel. */ - uint16_t peer_tunnel_id; /**< Remote identifier for the control connection. */ - uint16_t peer_session_id; /**< Remote identifier of session inside a tunnel. */ - - uint32_t sip; /**< Local tunnel endpoint IP address. */ - uint32_t dip; /**< Remote tunnel endpoint IP address. */ - uint32_t reorder_timeout; /**< Reorder timeout for out of order packets */ - - uint16_t sport; /**< Local source port. */ - uint16_t dport; /**< Remote source port. */ - - uint8_t recv_seq; /**< Sequence number received. */ - uint8_t oip_ttl; /**< Maximum time-to-live value for outer IP packet. */ - uint8_t udp_csum; /**< UDP checksum. */ - uint8_t reserved; /**< Alignment padding. */ -}; - -/** - * nss_l2tpv2_session_destroy_msg - * Payload for deletion an L2TPv2 session. - */ -struct nss_l2tpv2_session_destroy_msg { - uint16_t local_tunnel_id; /**< ID of the local tunnel. */ - uint16_t local_session_id; /**< ID of the local session. */ -}; - -/** - * nss_l2tpv2_bind_ipsec_if_msg - * Message for binding the IPsec interface with L2TP. - * - * Message for configuring the L2TP session with an - * IPsec inner interface number. This is used when - * L2TP tunnel is enabled with IPsec. - */ -struct nss_l2tpv2_bind_ipsec_if_msg { - uint32_t ipsec_ifnum; /**< Inner IPSec interface number. */ -}; - -/** - * nss_l2tpv2_sync_session_stats_msg - * Message information for L2TPv2 synchronization statistics. - */ -struct nss_l2tpv2_sync_session_stats_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t rx_errors; /**< Not used. Reserved for backward compatibility. */ - uint32_t rx_seq_discards; - /**< Rx packets discarded because of a sequence number check. */ - uint32_t rx_oos_packets; /**< Number of out of sequence packets received. */ - uint32_t tx_errors; /**< Not used. Reserved for backward compatibility. */ - uint32_t tx_dropped; /**< Tx packets dropped because of encapsulation failure or next node's queue is full. */ - - /** - * Debug statistics for L2tp v2. - */ - struct { - uint32_t rx_ppp_lcp_pkts; - /**< Number of PPP LCP packets received. */ - uint32_t rx_exception_data_pkts; - /**< Data packet exceptions sent to the host. */ - uint32_t encap_pbuf_alloc_fail; - /**< Buffer allocation failure during encapsulation. */ - uint32_t decap_pbuf_alloc_fail; - /**< Buffer allocation failure during decapsulation. */ - uint32_t decap_l2tpoipsec_src_error; - /**< Packets dropped due to the wrong source for the L2TPoIPsec flow. */ - } debug_stats; /**< Debug statistics object for l2tp v2. */ -}; - -/** - * nss_l2tpv2_msg - * Data for sending and receiving L2TPv2 messages. - */ -struct nss_l2tpv2_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of an L2TPv2 message. - */ - union { - struct nss_l2tpv2_session_create_msg session_create_msg; - /**< Session create message. */ - struct nss_l2tpv2_session_destroy_msg session_destroy_msg; - /**< Session delete message. */ - struct nss_l2tpv2_sync_session_stats_msg stats; - /**< Session statistics. */ - struct nss_l2tpv2_bind_ipsec_if_msg bind_ipsec_if_msg; - /**< Bind IPsec interface message. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving L2TPv2 messages. - * - * @datatypes - * nss_l2tpv2_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_l2tpv2_msg_callback_t)(void *app_data, struct nss_l2tpv2_msg *msg); - -/** - * nss_l2tpv2_tx - * Sends L2TPv2 messages to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_l2tpv2_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_l2tpv2_tx(struct nss_ctx_instance *nss_ctx, struct nss_l2tpv2_msg *msg); - -/** - * nss_l2tpv2_get_context. - * Gets the L2TPv2 context used in L2TPv2 messages sent to the NSS. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_l2tpv2_get_context(void); - -/** - * Callback function for receiving L2TPv2 tunnel data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_l2tpv2_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_register_l2tpv2_if - * Registers the L2TPv2 tunnel interface with the NSS for sending and - * receiving messages. - * - * @datatypes - * nss_l2tpv2_callback_t \n - * nss_l2tpv2_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] l2tpv2_callback Callback for the L2TP tunnel data. - * @param[in] msg_callback Callback for the L2TP tunnel message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features SKB types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_register_l2tpv2_if(uint32_t if_num, nss_l2tpv2_callback_t l2tpv2_callback, - nss_l2tpv2_msg_callback_t msg_callback, struct net_device *netdev, uint32_t features); - -/** - * nss_unregister_l2tpv2_if - * Deregisters the L2TPv2 tunnel interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The tunnel interface must have been previously registered. - */ -extern void nss_unregister_l2tpv2_if(uint32_t if_num); - -/** - * nss_l2tpv2_msg_init - * Initializes an L2TPv2 message. - * - * @datatypes - * nss_l2tpv2_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num Interface number - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_l2tpv2_msg_init(struct nss_l2tpv2_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_l2tpv2_register_handler - * Registers the L2TPv2 interface with the NSS debug statistics handler. - * - * @return - * None. - */ -extern void nss_l2tpv2_register_handler(void); - -/** - * nss_l2tpv2_session_debug_stats_get - * Gets L2TPv2 NSS session debug statistics. - * - * @param[out] stats_mem Pointer to the memory address, which must be large - * enough to hold all the statistics. - * - * @return - * None. - */ -extern void nss_l2tpv2_session_debug_stats_get(void *stats_mem); - -/** - * nss_l2tpv2_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_l2tpv2_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_l2tpv2_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_l2tpv2_stats_unregister_notifier(struct notifier_block *nb); -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* _NSS_L2TP_V2_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_lag.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_lag.h deleted file mode 100644 index 4e7e7ea25..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_lag.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014, 2015, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_lag.h - * NSS LAG APIs - */ - -/** - * @addtogroup nss_lag_subsystem - * @{ - */ - -/** - * nss_lag_metadata_types - * Types of LAG metadata. - */ -enum nss_lag_metadata_types { - NSS_TX_METADATA_LAG_STATE_CHANGE = 0, - NSS_TX_METADATA_LAG_MAX, -}; - -/** - * nss_lag_state_change_ev - * LAG change events. - */ -enum nss_lag_state_change_ev { - NSS_LAG_RELEASE = 0, - NSS_LAG_ENSLAVE = 1, -}; - -/** - * nss_lag_error_types - * LAG return values. - */ -enum nss_lag_error_types { - NSS_LAG_ERROR_EINTERFACE = 1, - NSS_LAG_ERROR_EMSG = 2, -}; - -/** - * nss_lag_state_change - * Link aggregation (LAG) state changes. - */ -struct nss_lag_state_change { - uint32_t lagid; /**< ID of the link aggregation group. */ - uint32_t interface; - /**< Physical interface on which the state change occurred. */ - enum nss_lag_state_change_ev event; /**< Type of state change event. */ -}; - -/** - * nss_lag_msg - * Data for sending and receiving LAG messages. - */ -struct nss_lag_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a LAG message. - */ - union { - struct nss_lag_state_change state; - /**< State change message. */ - } msg; /**< Message payload for LAG configuration messages exchanged with NSS core. */ -}; - -/** - * nss_lag_tx - * Sends a LAG message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_lag_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_lag_tx(struct nss_ctx_instance *nss_ctx, struct nss_lag_msg *msg); - -/** - * Callback function for receiving LAG data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] dev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_lag_callback_t)(struct net_device *dev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving a LAG message. - * - * @datatypes - * nss_lag_msg - * - * @param[in] ctx Pointer to the application context for this message. - * @param[in] nm Pointer to the message data. - */ -typedef void (*nss_lag_msg_callback_t)(void *ctx, struct nss_lag_msg *nm); - -/** - * Callback function for receiving a LAG event. - * - * @datatypes - * nss_lag_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_lag_event_callback_t)(void *app_data, struct nss_lag_msg *msg); - -/** - * nss_register_lag_if - * Registers the LAG interface with the NSS for sending and receiving data - * and messages. - * - * @datatypes - * nss_lag_callback_t \n - * nss_lag_event_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] lag_cb Callback to receive LAG data. - * @param[in] lag_ev_cb Callback to receive LAG events. - * @param[in] netdev Pointer to the associated network device. - * - * @return - * Pointer to the NSS core context. - */ -extern void *nss_register_lag_if(uint32_t if_num, - nss_lag_callback_t lag_cb, - nss_lag_event_callback_t lag_ev_cb, - struct net_device *netdev); - -/** - * nss_unregister_lag_if - * Deregisters the LAG interface from the NSS. - * - * @param[in] if_num LAG interface number - * - * @return - * None. - * - * @dependencies - * The LAG interface must have been previously registered. - */ -extern void nss_unregister_lag_if(uint32_t if_num); - -/** - * nss_lag_msg_init - * Initializes a LAG message. - * - * @datatypes - * nss_lag_msg \n - * nss_lag_msg_callback_t - * - * @param[in,out] nlm Pointer to the message. - * @param[in] lag_num LAG interface number. - * @param[in] type Type of buffer. - * @param[in] len Length of the buffer. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_lag_msg_init(struct nss_lag_msg *nlm, uint16_t lag_num, uint32_t type, uint32_t len, - nss_lag_msg_callback_t cb, void *app_data); - -/** - * nss_lag_tx_slave_state - * Sends LAG slave state. - * - * @datatypes - * nss_lag_state_change_ev - * - * @param[in] lagid LAG Group ID. - * @param[in] slave_ifnum Slave interface number. - * @param[in] slave_state Slave state. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_lag_tx_slave_state(uint16_t lagid, - int32_t slave_ifnum, - enum nss_lag_state_change_ev slave_state); - -/** - * @} - */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_lso_rx.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_lso_rx.h deleted file mode 100644 index e8f4babae..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_lso_rx.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_lso_rx.h - * NSS driver LSO (Large Send Offload) Rx header file. - */ - -#ifndef __NSS_LSO_RX_H -#define __NSS_LSO_RX_H - -/** - * @addtogroup nss_lso_rx_subsystem - * @{ - */ - -/** - * nss_lso_rx_stats_types - * LSO Rx driver statistics. - */ -enum nss_lso_rx_stats_types { - NSS_LSO_RX_STATS_TX_DROPPED, /**< Number of packets dropped because transmit queue is full. */ - NSS_LSO_RX_STATS_DROPPED, /**< Number of packets dropped because of node internal errors. */ - NSS_LSO_RX_STATS_PBUF_ALLOC_FAIL, /**< Number of pbuf allocation failures. */ - NSS_LSO_RX_STATS_PBUF_REFERENCE_FAIL, /**< Number of pbuf reference failures. */ - NSS_LSO_RX_STATS_MAX, /**< Maximum message type. */ -}; - -/** - * nss_lso_rx_stats_notification - * Data for sending LSO Rx statistics. - */ -struct nss_lso_rx_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t cmn_node_stats[NSS_STATS_NODE_MAX]; /**< Common node statistics. */ - uint64_t node_stats[NSS_LSO_RX_STATS_MAX]; /**< LSO Rx special statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ -/** - * nss_lso_rx_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_lso_rx_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_lso_rx_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_lso_rx_stats_unregister_notifier(struct notifier_block *nb); -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_LSO_RX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_map_t.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_map_t.h deleted file mode 100644 index ebfd62f4f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_map_t.h +++ /dev/null @@ -1,382 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_map_t.h - * NSS MAP-T interface definitions. - */ - -#ifndef _NSS_MAP_T_H_ -#define _NSS_MAP_T_H_ - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -#include "nss_dynamic_interface.h" -#endif - -/** - * @addtogroup nss_map_t_subsystem - * @{ - */ - -/** - * Maximum number of supported MAP-T instances. - */ -#define NSS_MAX_MAP_T_DYNAMIC_INTERFACES 4 - -#define NSS_MAPT_MDATA_FLAG_DF_BIT (1 << 0) - -/* - * mapt meta data - */ -struct nss_map_t_mdata { - uint16_t flags; - uint16_t res[6]; -}; - -/** - * nss_map_t_msg_types - * Message types for MAP-T requests and responses. - */ -enum nss_map_t_msg_types { - NSS_MAP_T_MSG_INSTANCE_RULE_CONFIGURE, - NSS_MAP_T_MSG_INSTANCE_RULE_DECONFIGURE, - NSS_MAP_T_MSG_SYNC_STATS, - NSS_MAP_T_MSG_MAX -}; - -/** - * nss_map_t_stats_instance - * MAP-T debug error types. - */ -enum nss_map_t_stats_instance { - NSS_MAP_T_STATS_V4_TO_V6_PBUF_EXCEPTION, - NSS_MAP_T_STATS_V4_TO_V6_PBUF_NO_MATCHING_RULE, - NSS_MAP_T_STATS_V4_TO_V6_PBUF_NOT_TCP_OR_UDP, - NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_LOCAL_PSID, - NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_LOCAL_IPV6, - NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_REMOTE_PSID, - NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_REMOTE_EA_BITS, - NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_REMOTE_IPV6, - NSS_MAP_T_STATS_V6_TO_V4_PBUF_EXCEPTION, - NSS_MAP_T_STATS_V6_TO_V4_PBUF_NO_MATCHING_RULE, - NSS_MAP_T_STATS_V6_TO_V4_PBUF_NOT_TCP_OR_UDP, - NSS_MAP_T_STATS_V6_TO_V4_RULE_ERR_LOCAL_IPV4, - NSS_MAP_T_STATS_V6_TO_V4_RULE_ERR_REMOTE_IPV4, - NSS_MAP_T_STATS_MAX -}; - -/** - * nss_map_t_stats_notification - * MAP-T statistics structure. - */ -struct nss_map_t_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ - enum nss_dynamic_interface_type if_type; /**< Dynamic interface type. */ - uint64_t stats[NSS_MAP_T_STATS_MAX]; /**< MAP-T statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ -/** - * nss_map_t_instance_rule_config_msg - * Message information for configuring a MAP-T instance. - */ -struct nss_map_t_instance_rule_config_msg { - uint32_t rule_num; /**< Rule sequence number */ - uint32_t total_rules; /**< Total number of NAT64 rules configured. */ - uint32_t local_ipv6_prefix_len; /**< Local IPv6 prefix length. */ - uint32_t local_ipv4_prefix; /**< Local IPv4 prefix. */ - uint32_t local_ipv4_prefix_len; /**< Local IPv4 prefix length. */ - uint32_t local_ea_len; /**< Local EA bits length. */ - uint32_t local_psid_offset; /**< Local PSID offset. */ - - uint32_t reserve_a; /**< Reserved for backward compatibility. */ - - uint32_t remote_ipv6_prefix_len; /**< Remote IPv6 prefix length. */ - uint32_t remote_ipv4_prefix; /**< Remote IPv4 prefix. */ - uint32_t remote_ipv4_prefix_len; /**< Remote IPv4 prefix length. */ - uint32_t remote_ea_len; /**< Remote EA bits length. */ - uint32_t remote_psid_offset; /**< Remote PSID offset. */ - - uint32_t local_map_style; /**< Local MAP style. */ - uint32_t remote_map_style; /**< Remote MAP style. */ - - uint32_t sibling_if; /**< Sibling interface number. */ - - uint8_t local_ipv6_prefix[16]; /**< Local IPv6 prefix. */ - uint8_t reserve_b[16]; /**< Reserved for backward compatibility. */ - uint8_t remote_ipv6_prefix[16]; /**< Remote IPv6 prefix. */ - - uint8_t valid_rule; /**< MAP-T rule validity. */ - uint8_t flags; /**< MAP-T flags. */ - uint8_t reserved[2]; /**< Reserved for byte alignment. */ -}; - -/** - * nss_map_t_instance_rule_deconfig_msg - * Message information for deleting a MAP-T instance. - */ -struct nss_map_t_instance_rule_deconfig_msg { - int32_t if_number; /**< Interface number. */ -}; - -/** - * nss_map_t_sync_stats_msg - * Message information for MAP-T synchronization statistics. - */ -struct nss_map_t_sync_stats_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t tx_dropped; /**< Dropped Tx packets. */ - - /** - * Debug statistics for MAP-T. - */ - union { - - /** - * IPv4 to IPv6 path debug statistics. - */ - struct { - uint32_t exception_pkts; - /**< Number of packets exceptioned to host in IPv4 to IPv6 fast path. */ - uint32_t no_matching_rule; - /**< No matching of any rule. */ - uint32_t not_tcp_or_udp; - /**< Number of packets which are neither UDP nor TCP. */ - uint32_t rule_err_local_psid; - /**< Calculate the local PSID error. */ - uint32_t rule_err_local_ipv6; - /**< Calculate local IPv6 error. */ - uint32_t rule_err_remote_psid; - /**< Calculate remote PSID error. */ - uint32_t rule_err_remote_ea_bits; - /**< Calculate remote EA bits error. */ - uint32_t rule_err_remote_ipv6; - /**< Calculate remote IPv6 error. */ - } v4_to_v6; /**< IPv4 to IPv6 debug statistics object. */ - - /** - * IPv6 to IPv4 path debug statistics. - */ - struct { - uint32_t exception_pkts; - /**< Number of packets exception to host in IPv6 to IPv4 fast path. */ - uint32_t no_matching_rule; - /**< No matching of any rule. */ - uint32_t not_tcp_or_udp; - /**< Number of packets which are neither UDP nor TCP. */ - uint32_t rule_err_local_ipv4; - /**< Calculate local IPv4 error. */ - uint32_t rule_err_remote_ipv4; - /**< Calculate remote IPv4 error. */ - } v6_to_v4; /**< IPv6 to IPv4 debug statistics object */ - - } debug_stats; /**< Payload of debug statistics. */ -}; - -/** - * nss_map_t_msg - * Data for sending and receiving MAP-T messages. - */ -struct nss_map_t_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a MAP-T message. - */ - union { - struct nss_map_t_instance_rule_config_msg create_msg; - /**< Create message. */ - struct nss_map_t_instance_rule_deconfig_msg destroy_msg; - /**< Destroy message. */ - struct nss_map_t_sync_stats_msg stats; - /**< Statistics message to host. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving MAP-T messages. - * - * @datatypes - * nss_map_t_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_map_t_msg_callback_t)(void *app_data, struct nss_map_t_msg *msg); - -/** - * nss_map_t_tx - * Sends a MAP-T message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_map_t_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_map_t_tx(struct nss_ctx_instance *nss_ctx, struct nss_map_t_msg *msg); - -/** - * nss_map_t_tx_sync - * Sends a MAP-T message synchronously to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_map_t_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_map_t_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_map_t_msg *msg); - -/** - * nss_map_t_get_context - * Gets the MAP-T context used in nss_map_t_tx. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_map_t_get_context(void); - -/** - * Callback function for receiving MAP-T tunnel data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_map_t_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_map_t_register_if - * Registers a MAP-T interface with the NSS for sending and receiving tunnel messages. - * - * @datatypes - * nss_map_t_callback_t \n - * nss_map_t_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] type NSS interface type. - * @param[in] map_t_callback Callback for the MAP-T data. - * @param[in] msg_callback Callback for the MAP-T message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_map_t_register_if(uint32_t if_num, uint32_t type, nss_map_t_callback_t map_t_callback, - nss_map_t_msg_callback_t msg_callback, struct net_device *netdev, uint32_t features); - -/** - * nss_map_t_unregister_if - * Deregisters a MAP-T tunnel interface from the NSS. - * - * @param[in] if_num NSS interface number - * - * @return - * None. - */ -extern void nss_map_t_unregister_if(uint32_t if_num); - -/** - * nss_map_t_msg_init - * Initializes a MAP-T message. - * - * @datatypes - * nss_map_t_msg_init - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num Interface number - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_map_t_msg_init(struct nss_map_t_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_map_t_register_handler - * Registers the MAP-T debug statistics handler with the NSS. - * - * @return - * None. - */ -extern void nss_map_t_register_handler(void); - -/** - * nss_map_t_instance_debug_stats_get - * Gets debug statistics for a MAP-T instance. - * - * @param[out] stats_mem Pointer to the memory address, which must be large enough to - hold all the statistics. - * - * @return - * None. - */ -extern void nss_map_t_instance_debug_stats_get(void *stats_mem); - -/** - * nss_map_t_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_map_t_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_map_t_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_map_t_stats_unregister_notifier(struct notifier_block *nb); -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* _NSS_MAP_T_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_match.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_match.h deleted file mode 100644 index ae1e30855..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_match.h +++ /dev/null @@ -1,296 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_match.h - * NSS match interface definitions. - */ - -#ifndef _NSS_MATCH_H_ -#define _NSS_MATCH_H_ - - -/** - * @addtogroup nss_match_subsystem - * @{ - */ - -/** - * Maximum number of supported match instances. - */ -#define NSS_MATCH_INSTANCE_MAX 4 - -/** - * Maximum number of rules supported per instance. - */ -#define NSS_MATCH_INSTANCE_RULE_MAX 32 - -/** - * Maximum number of masksets. - */ -#define NSS_MATCH_MASK_MAX 2 - -/** - * Maximum number of words per maskset. - */ -#define NSS_MATCH_MASK_WORDS_MAX 4 - -/** - * nss_match_error_type - * Match message error types. - */ -typedef enum nss_match_error_type { - NSS_MATCH_SUCCESS, /**< No error. */ - NSS_MATCH_ERROR_UNKNOWN_MSG, /**< Message unknown. */ - NSS_MATCH_ERROR_DSCP_OUTOFBOUND, /**< DSCP out of bound. */ - NSS_MATCH_ERROR_OUTER_8021P_OUTOFBOUND, /**< Outer 802.1p out of bound. */ - NSS_MATCH_ERROR_INNER_8021P_OUTOFBOUND, /**< Inner 802.1p out of bound. */ - NSS_MATCH_ERROR_RULE_ID_OUTOFBOUND, /**< Rule ID is out of bound. */ - NSS_MATCH_ERROR_ACTION_TYPE_INVALID, /**< Invalid action type. */ - NSS_MATCH_ERROR_RULE_EXISTS, /**< Rule ID already in use. */ - NSS_MATCH_ERROR_RULE_DOES_NOT_EXIST, /**< Rule does not exist. */ - NSS_MATCH_ERROR_INSTANCE_CONFIGURED, /**< Error in instance configuration. */ - NSS_MATCH_ERROR_PROFILE_CONFIG_INVALID, /**< Invalid profile configuration message. */ - NSS_MATCH_ERROR_DB_INIT_FAILED, /**< Database initialization failed. */ - NSS_MATCH_ERROR_TABLE_ID_OUTOFBOUND, /**< Table ID is out of bound. */ - NSS_MATCH_ERROR_RULE_ADD, /**< Error in adding rule. */ - NSS_MATCH_ERROR_RULE_DELETE, /**< Error in deleting rule. */ - NSS_MATCH_ERROR_TABLE_ADD, /**< Error in adding table. */ - NSS_MATCH_ERROR_TABLE_DELETE, /**< Error in deleting table. */ - NSS_MATCH_ERROR_MASK_ID_OUTOFBOUND, /**< Mask ID is out of bound. */ - NSS_MATCH_ERROR_IFNUM_INVALID, /**< Next node interface number is invalid. */ - NSS_MATCH_ERROR_MAX, /**< Maximum error. */ -} nss_match_status_t; - -/** - * nss_match_action_type - * Bit positions for possible actions that can be taken. - */ -enum nss_match_action_type { - NSS_MATCH_ACTION_NONE, /**< No action. */ - NSS_MATCH_ACTION_SETPRIO = 1, /**< Set given priority to the packet. */ - NSS_MATCH_ACTION_FORWARD = 2, /**< Forward the packet to a given node. */ - NSS_MATCH_ACTION_DROP = 4, /**< Drop the packet. */ - NSS_MATCH_ACTION_MAX, /**< Maximum action type. */ -}; - -/** - * nss_match_profile_type - * Different profile types. - */ -enum nss_match_profile_type { - NSS_MATCH_PROFILE_TYPE_NONE, - NSS_MATCH_PROFILE_TYPE_VOW, /**< Matches on interface number/DSCP/802.1P. */ - NSS_MATCH_PROFILE_TYPE_L2, /**< Matches on interface number/destination MAC/source MAC/Ether type. */ - NSS_MATCH_PROFILE_TYPE_MAX, /**< Maximum profile type. */ -}; - -/** - * nss_match_msg_types. - * Message types for match requests and responses. - */ -enum nss_match_msg_types { - NSS_MATCH_INSTANCE_NONE, /**< Invalid message. */ - NSS_MATCH_TABLE_CONFIGURE_MSG, /**< Instance configure. */ - NSS_MATCH_ADD_VOW_RULE_MSG, /**< Insert VoW rule. */ - NSS_MATCH_ADD_L2_RULE_MSG, /**< Insert l2 rule. */ - NSS_MATCH_DELETE_VOW_RULE_MSG, /**< Delete VoW rule. */ - NSS_MATCH_DELETE_L2_RULE_MSG, /**< Delete l2 rule. */ - NSS_MATCH_STATS_SYNC, /**< Instance statistics. */ - NSS_MATCH_MSG_MAX, /**< Maximum instance messages. */ -}; - -/** - * nss_match_stats_sync - * Synchronization message structure. - */ -struct nss_match_stats_sync { - struct nss_cmn_node_stats p_stats; /**< Pnode statistics. */ - uint32_t hit_count[NSS_MATCH_INSTANCE_RULE_MAX]; /**< Exception events. */ -}; - -/** - * nss_match_profile_configure_msg - * Message for configuring the profile for a match instance. - */ -struct nss_match_profile_configure_msg { - uint32_t profile_type; /**< Profile type. */ - uint32_t valid_mask_flag; /**< Valid maskset flag. */ - uint32_t maskset[NSS_MATCH_MASK_MAX][NSS_MATCH_MASK_WORDS_MAX]; /**< Maskset. */ -}; - -/* - * nss_match_rule_action - * Message information for action. - */ -struct nss_match_rule_action { - uint32_t action_flag; /**< Action bit map. */ - uint32_t forward_ifnum; /**< Next node interface number. */ - uint16_t setprio; /**< Priority number to be set in packet. */ - uint16_t reserved; /**< Reserved 2 bytes. */ -}; - -/** - * nss_match_rule_vow_msg - * Rule message for VoW profile. - */ -struct nss_match_rule_vow_msg { - uint16_t rule_id; /**< Rule ID for the rule. */ - uint16_t mask_id; /**< Mask number used for the rule. */ - struct nss_match_rule_action action; /**< Action related with the rule. */ - uint32_t if_num; /**< Interface number. */ - uint8_t dscp; /**< DSCP. */ - uint8_t outer_8021p; /**< Outer 802.1p. */ - uint8_t inner_8021p; /**< Inner 802.1p. */ - uint8_t reserved; /**< Reserved byte. */ -}; - -/** - * nss_match_rule_l2_msg - * Rule message for L2 profile. - */ -struct nss_match_rule_l2_msg { - uint16_t rule_id; /**< Rule ID for the rule. */ - uint16_t mask_id; /**< Mask number used for the rule. */ - struct nss_match_rule_action action; /**< Action related with the rule. */ - uint32_t if_num; /**< Interface number. */ - uint16_t dmac[3]; /**< Destination MAC address. */ - uint16_t smac[3]; /**< Source MAC address. */ - uint16_t ethertype; /**< Ethernet type. */ -}; - -/** - * nss_match_msg - * Data for sending and receiving match messages. - */ -struct nss_match_msg { - struct nss_cmn_msg cm; /**< Message header. */ - - /** - * Payload of a match message. - */ - union { - struct nss_match_profile_configure_msg configure_msg; /**< Configure message. */ - struct nss_match_rule_vow_msg vow_rule; /**< Insertion or deletion message for VoW profile. */ - struct nss_match_rule_l2_msg l2_rule; /**< Insertion or deletion message for l2 profile. */ - struct nss_match_stats_sync stats; /**< Instance synchronization statistics. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_match_msg_tx_sync - * Sends proxy match messages to the NSS. - * - * Do not call this function from a softirq or interrupt because it - * might sleep if the NSS firmware is busy serving another host thread. - * - * @datatypes - * nss_ctx_instance \n - * nss_match_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_match_msg_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_match_msg *msg); - -/** - * Callback function for receiving match messages. - * - * @datatypes - * nss_match_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_match_msg_sync_callback_t)(void *app_data, struct nss_match_msg *msg); - -/** - * nss_match_get_context - * Returns NSS context of match. - * - * @datatypes - * nss_ctx_instance - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_match_get_context(void); - -/** - * nss_match_register_instance - * Registers match dynamic node to NSS. - * - * @datatypes - * nss_match_msg_sync_callback_t - * - * @param[in] if_num Interface number of match instance. - * @param[in] notify_cb Notify callback function for the message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_match_register_instance(int if_num, nss_match_msg_sync_callback_t notify_cb); - -/** - * nss_match_unregister_instance - * Unregisters match dynamic node to NSS. - * - * @param[in] if_num Interface number of match instance. - * - * @return - * True if successful, else false. - */ -extern bool nss_match_unregister_instance(int if_num); - -/** - * nss_match_msg_init - * Initializes a match message. - * - * @datatypes - * nss_match_msg \n - * nss_match_msg_sync_callback_t - * - * @param[in,out] nmm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_match_msg_init(struct nss_match_msg *nmm, uint16_t if_num, uint32_t type, uint32_t len, - nss_match_msg_sync_callback_t cb, void *app_data); - -/** - * nss_match_init - * Initializes match. - * - * @return - * None. - */ -extern void nss_match_init(void); -/** - * @} - */ - -#endif /* _NSS_MATCH_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_mirror.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_mirror.h deleted file mode 100644 index 39853e5ce..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_mirror.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_mirror.h - * NSS mirror interface definitions. - */ - -#ifndef _NSS_MIRROR_H_ -#define _NSS_MIRROR_H_ - -/** - * @addtogroup nss_mirror_subsystem - * @{ - */ - -/** - * Maximum number of supported mirror interfaces. - */ -#define NSS_MAX_MIRROR_DYNAMIC_INTERFACES 8 - -/** - * nss_mirror_msg_types - * Message types for mirror interface requests and responses. - */ -enum nss_mirror_msg_types { - NSS_MIRROR_MSG_CONFIGURE, /**< Configure message type. */ - NSS_MIRROR_MSG_ENABLE, /**< Enable message type. */ - NSS_MIRROR_MSG_DISABLE, /**< Disable message type. */ - NSS_MIRROR_MSG_SET_NEXTHOP, /**< Set nexthop message type. */ - NSS_MIRROR_MSG_RESET_NEXTHOP, /**< Reset nexthop message type. */ - NSS_MIRROR_MSG_SYNC_STATS, /**< Statistics synchronization message type. */ - NSS_MIRROR_MSG_MAX /**< Maximum message type. */ -}; - -/** - * nss_mirror_pkt_clone_point - * Clone point to use for mirroring the packet. - */ -enum nss_mirror_pkt_clone_point { - NSS_MIRROR_PKT_CLONE_POINT_DEFAULT = 1, /**< Clone the packet from the start. */ - NSS_MIRROR_PKT_CLONE_POINT_BEFORE_PACKET_START, /**< Clone n-bytes before packet start. */ - NSS_MIRROR_PKT_CLONE_POINT_AFTER_PACKET_START, /**< Clone n-bytes after packet start. */ - NSS_MIRROR_PKT_CLONE_POINT_MAX -}; - -/** - * nss_mirror_error_type - * Error types for mirror responses to messages from the host. - */ -enum nss_mirror_error_type { - NSS_MIRROR_ERROR_TYPE_NONE, /**< No error. */ - NSS_MIRROR_ERROR_TYPE_NO_MEMORY, /**< No memory to copy. */ - NSS_MIRROR_ERROR_TYPE_TX_FAILURE, /**< Transmit failure. */ - NSS_MIRROR_ERROR_TYPE_BAD_PARAM, /**< Bad parameter. */ - NSS_MIRROR_ERROR_TYPE_BAD_CLONE_POINT, /**< Bad packet clone point. */ - NSS_MIRROR_ERROR_TYPE_INSTANCE_CONFIGURED, /**< Instance already active. */ - NSS_MIRROR_ERROR_TYPE_INSTANCE_DISABLED, /**< Instance already disabled. */ - NSS_MIRROR_ERROR_TYPE_BAD_NEXTHOP, /**< Incorrect nexthop interface. */ - NSS_MIRROR_ERROR_TYPE_NEXTHOP_CONFIGURED, /**< Nexthop already interface. */ - NSS_MIRROR_ERROR_TYPE_NEXTHOP_RESET, /**< Nexthop already reset. */ - NSS_MIRROR_ERROR_TYPE_UNKNOWN_MSG, /**< Unknown message. */ - NSS_MIRROR_ERROR_TYPE_MAX, /**< Maximum message type. */ -}; - -/** - * nss_mirror_stats - * Mirror interface debug statistics. - */ -enum nss_mirror_stats { - NSS_MIRROR_STATS_PKTS, /**< Number of packets exceptioned to host. */ - NSS_MIRROR_STATS_BYTES, /**< Number of bytes exceptioned to host. */ - NSS_MIRROR_STATS_TX_SEND_FAIL, /**< Transmit send failures. */ - NSS_MIRROR_STATS_DEST_LOOKUP_FAIL, /**< Destination lookup failures. */ - NSS_MIRROR_STATS_MEM_ALLOC_FAIL, /**< Memory allocation failures. */ - NSS_MIRROR_STATS_COPY_FAIL, /**< Copy failures. */ - NSS_MIRROR_STATS_MAX /**< Maximum statistics count. */ -}; - -/** - * nss_mirror_configure_msg - * Mirror interface configuration information. - */ -struct nss_mirror_configure_msg { - uint32_t pkt_clone_point; /**< Point in the packet to copy from. */ - uint16_t pkt_clone_size; /**< Number of bytes to copy. */ - uint16_t pkt_clone_offset; /**< Copy offset. */ -}; - -/** - * nss_mirror_set_nexthop_msg - * Mirror interface set nexthop information. - */ -struct nss_mirror_set_nexthop_msg { - uint32_t if_num; /**< Nexthop interface number. */ -}; - -/** - * nss_mirror_node_stats - * Mirror interface debug statistics structure. - */ -struct nss_mirror_node_stats { - uint32_t mirror_pkts; /**< Number of packets exceptioned to host. */ - uint32_t mirror_bytes; /**< Number of bytes exceptioned to host. */ - uint32_t tx_send_fail; /**< Transmit send failures. */ - uint32_t dest_lookup_fail; /**< Destination lookup failures. */ - uint32_t mem_alloc_fail; /**< Memory allocation failures. */ - uint32_t copy_fail; /**< Copy failures. */ - uint32_t bad_param; /**< Bad parameter. */ -}; - -/** - * nss_mirror_stats_sync_msg - * Message information for mirror interface synchronization statistics. - */ -struct nss_mirror_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - struct nss_mirror_node_stats mirror_stats; /**< Debug statistics for mirror. */ -}; - -/** - * nss_mirror_stats_notification - * Mirror transmission statistics structure. - */ -struct nss_mirror_stats_notification { - uint64_t stats_ctx[NSS_MIRROR_STATS_MAX]; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_mirror_msg - * Data for sending and receiving mirror interface messages. - */ -struct nss_mirror_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a mirror interface message. - */ - union { - struct nss_mirror_configure_msg config; - /**< Mirror interface configure message. */ - struct nss_mirror_set_nexthop_msg nexthop; - /**< Mirror interface set nexthop message. */ - struct nss_mirror_stats_sync_msg stats; - /**< Statistics message to host. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving mirror instance data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_mirror_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving mirror interface messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_mirror_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_mirror_get_context - * Gets the mirror interface context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_mirror_get_context(void); - -/** - * nss_mirror_tx_msg - * Sends mirror interface messages to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_mirror_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_mirror_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_mirror_msg *msg); - -/** - * nss_mirror_tx_msg_sync - * Sends a mirror interface message to the NSS synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_mirror_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_mirror_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_mirror_msg *msg); - -/** - * nss_mirror_unregister_if - * Deregisters a mirror interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -extern void nss_mirror_unregister_if(uint32_t if_num); - -/** - * nss_mirror_register_if - * Registers a mirror interface with the NSS for sending and receiving messages. - * - * @datatypes - * nss_mirror_data_callback_t \n - * nss_mirror_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] data_callback Callback for the mirror interface data. - * @param[in] event_callback Callback for the mirror interface message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_mirror_register_if(uint32_t if_num, - nss_mirror_data_callback_t data_callback, - nss_mirror_msg_callback_t event_callback, - struct net_device *netdev, uint32_t features); - -/** - * nss_mirror_verify_if_num - * Verify whether the interface is an mirror interface or not. - * - * @param[in] if_num NSS interface number. - * - * @return - * True if the interface is an mirror interface. - */ -extern bool nss_mirror_verify_if_num(uint32_t if_num); - -/** - * nss_mirror_register_handler - * Registers the mirror interface debug statistics handler with the NSS. - * - * @return - * None. - */ -extern void nss_mirror_register_handler(void); - -/** - * nss_mirror_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_mirror_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_mirror_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_mirror_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_n2h.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_n2h.h deleted file mode 100644 index 1613f41c0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_n2h.h +++ /dev/null @@ -1,572 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_n2h.h - * NSS to HLOS interface definitions. - */ - -#ifndef __NSS_N2H_H -#define __NSS_N2H_H - -/** - * @addtogroup nss_n2h_subsystem - * @{ - */ - -#define MAX_PAGES_PER_MSG 32 /**< Maximum number of pages per message. */ -#define NSS_N2H_RPS_PRI_DEFAULT -1 /**< Default RPS priority mapping. */ - -/** - * nss_n2h_payload_info - * Payload configuration based on the watermark. - */ -struct nss_n2h_payload_info { - uint32_t pool_size; /**< Empty buffer pool size. */ - - /** - * Low watermark. - * Set this field to 0 for the system to automatically determine the watermark. - */ - uint32_t low_water; - - /** - * High watermark. - * Set this field to 0 for the system to automatically determine the watermark. - */ - uint32_t high_water; -}; - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * nss_n2h_cfg_pvt - * N2H private data configuration. - */ -struct nss_n2h_cfg_pvt { - struct semaphore sem; /**< Semaphore for SMP synchronization. */ - struct completion complete; /**< Waits for the NSS to process the message. */ - struct nss_n2h_payload_info empty_buf_pool_info; /**< Empty buffer pool information. */ - struct nss_n2h_payload_info empty_paged_buf_pool_info; /**< Paged buffer pool information. */ - int wifi_pool; /**< Size of the empty Wi-Fi buffer pool. */ - int response; /**< Response from the firmware. */ -}; - -#endif /*__KERNEL__ */ - -/** - * nss_n2h_stats_types - * N2H node statistics. - */ -enum nss_n2h_stats_types { - NSS_N2H_STATS_QUEUE_DROPPED = NSS_STATS_NODE_MAX, - /**< Number of packets dropped because the exception queue is too full. */ - NSS_N2H_STATS_TOTAL_TICKS, /**< Total clock ticks spend inside the N2H. */ - NSS_N2H_STATS_WORST_CASE_TICKS, /**< Worst case iteration of the exception path in ticks. */ - NSS_N2H_STATS_ITERATIONS, /**< Number of iterations around the N2H. */ - NSS_N2H_STATS_PBUF_OCM_TOTAL_COUNT, /**< Number of pbuf OCM total count. */ - NSS_N2H_STATS_PBUF_OCM_FREE_COUNT, /**< Number of pbuf OCM free count. */ - NSS_N2H_STATS_PBUF_OCM_ALLOC_FAILS_WITH_PAYLOAD, - /**< Number of pbuf OCM allocations that have failed with payload. */ - NSS_N2H_STATS_PBUF_OCM_ALLOC_FAILS_NO_PAYLOAD, - /**< Number of pbuf OCM allocations that have failed without payload. */ - NSS_N2H_STATS_PBUF_DEFAULT_TOTAL_COUNT, /**< Number of pbuf default total count. */ - NSS_N2H_STATS_PBUF_DEFAULT_FREE_COUNT, /**< Number of pbuf default free count. */ - NSS_N2H_STATS_PBUF_DEFAULT_ALLOC_FAILS_WITH_PAYLOAD, - /**< Number of pbuf default allocations that have failed with payload. */ - NSS_N2H_STATS_PBUF_DEFAULT_ALLOC_FAILS_NO_PAYLOAD, - /**< Number of pbuf default allocations that have failed without payload. */ - - NSS_N2H_STATS_PAYLOAD_ALLOC_FAILS, /**< Number of pbuf allocations that have failed because there were no free payloads. */ - NSS_N2H_STATS_PAYLOAD_FREE_COUNT, /**< Number of free payloads that exist. */ - - NSS_N2H_STATS_H2N_CONTROL_PACKETS, /**< Control packets received from HLOS. */ - NSS_N2H_STATS_H2N_CONTROL_BYTES, /**< Control bytes received from HLOS. */ - NSS_N2H_STATS_N2H_CONTROL_PACKETS, /**< Control packets sent to HLOS. */ - NSS_N2H_STATS_N2H_CONTROL_BYTES, /**< Control bytes sent to HLOS. */ - - NSS_N2H_STATS_H2N_DATA_PACKETS, /**< Data packets received from HLOS. */ - NSS_N2H_STATS_H2N_DATA_BYTES, /**< Data bytes received from HLOS. */ - NSS_N2H_STATS_N2H_DATA_PACKETS, /**< Data packets sent to HLOS. */ - NSS_N2H_STATS_N2H_DATA_BYTES, /**< Data bytes sent to HLOS. */ - NSS_N2H_STATS_N2H_TOT_PAYLOADS, /**< Number of payloads in NSS. */ - NSS_N2H_STATS_N2H_INTERFACE_INVALID, /**< Number of bad interface access. */ - NSS_N2H_STATS_ENQUEUE_RETRIES, /**< Number of enqueue retries by N2H. */ - - NSS_N2H_STATS_MAX, /**< Maximum message type. */ -}; - -/** - * nss_n2h_metadata_types - * Message types for N2H requests and responses. - */ -enum nss_n2h_metadata_types { - NSS_RX_METADATA_TYPE_N2H_STATS_SYNC = 0, - NSS_TX_METADATA_TYPE_N2H_RPS_CFG, - NSS_TX_METADATA_TYPE_N2H_EMPTY_POOL_BUF_CFG, - NSS_TX_METADATA_TYPE_N2H_FLUSH_PAYLOADS, - NSS_TX_METADATA_TYPE_N2H_MITIGATION_CFG, - NSS_METADATA_TYPE_N2H_ADD_BUF_POOL, - NSS_TX_METADATA_TYPE_SET_WATER_MARK, - NSS_TX_METADATA_TYPE_GET_WATER_MARK, - NSS_TX_METADATA_TYPE_N2H_WIFI_POOL_BUF_CFG, - NSS_TX_DDR_INFO_VIA_N2H_CFG, - NSS_TX_METADATA_TYPE_N2H_SET_PNODE_QUEUE_CFG, - NSS_TX_METADATA_TYPE_N2H_EMPTY_PAGED_POOL_BUF_CFG, - NSS_TX_METADATA_TYPE_SET_PAGED_WATER_MARK, - NSS_TX_METADATA_TYPE_GET_PAGED_WATER_MARK, - NSS_TX_METADATA_TYPE_N2H_RPS_PRI_MAP_CFG, - NSS_TX_METADATA_TYPE_N2H_QUEUE_LIMIT_CFG, - NSS_TX_METADATA_TYPE_N2H_PAGED_BUFFER_POOL_INIT, - NSS_TX_METADATA_TYPE_N2H_HOST_BACK_PRESSURE_CFG, - NSS_METADATA_TYPE_N2H_MAX, -}; - -/* - * nss_n2h_error_types - * N2H error types. - */ -enum nss_n2h_error_types { - N2H_EUNKNOWN = 1, - N2H_ALREADY_CFG, - N2H_LOW_WATER_MIN_INVALID, - N2H_HIGH_WATER_LESS_THAN_LOW, - N2H_HIGH_WATER_LIMIT_INVALID, - N2H_LOW_WATER_LIMIT_INVALID, - N2H_WATER_MARK_INVALID, - N2H_EMPTY_BUFFER_TOO_HIGH, - N2H_EMPTY_BUFFER_TOO_LOW, - N2H_MMU_ENTRY_IS_INVALID, - N2H_PN_QUEUE_SET_FAILED, - N2H_PAGES_PER_MSG_EXCEEDED, - N2H_RPS_PRI_MAP_TOO_HIGH, -}; - -/** - * nss_n2h_stats_notification - * N2H statistics structure. - */ -struct nss_n2h_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint64_t n2h_stats[NSS_N2H_STATS_MAX]; /**< N2H statistics. */ - uint64_t drv_stats[NSS_STATS_DRV_MAX]; /**< Driver statistics. */ -}; - -/** - * nss_n2h_rps - * N2H RPS configuration. - */ -struct nss_n2h_rps { - uint32_t enable; /**< Enable RPS. */ -}; - -/** - * nss_n2h_rps_pri_map - * N2H priority configuration. - * - * This is used to direct packets with a given priority to a specific host CPU. - * A value of -1 in pri_map[pri] is treated as invalid and will not override - * RPS for that priority. - */ -struct nss_n2h_rps_pri_map { - int32_t pri_map[NSS_MAX_NUM_PRI]; /**< Priority to RPS map. */ -}; - -/** - * nss_n2h_mitigation - * N2H mitigation configuration. - */ -struct nss_n2h_mitigation { - uint32_t enable; /**< Enable NSS mitigation. */ -}; - -/** - * nss_n2h_buf_pool - * N2H buffer pool configuration. - */ -struct nss_n2h_buf_pool { - uint32_t nss_buf_page_size; /**< Size of the buffer page. */ - uint32_t nss_buf_num_pages; /**< Number of buffer pages. */ - - uint32_t nss_buf_pool_addr[MAX_PAGES_PER_MSG]; - /**< Buffer addresses. */ - nss_ptr_t nss_buf_pool_vaddr[MAX_PAGES_PER_MSG]; - /**< Virtual addresses of the buffers. */ -#ifndef __LP64__ - uint32_t padding[MAX_PAGES_PER_MSG]; - /**< Pad to fit 64 bits, do not reuse. */ -#endif -}; - -/** - * nss_n2h_pnode_queue_config - * Queue configuration command for pnodes in NSS. - */ -struct nss_n2h_pnode_queue_config { - uint8_t mq_en; /**< Enable multiple queues. */ - uint8_t reserved[3]; /**< Reserved for alignment. */ - uint16_t qlimits[NSS_MAX_NUM_PRI]; - /**< Limits of each queue. */ -#if (NSS_MAX_NUM_PRI & 1) - uint16_t reserved2; -#endif -}; - -/** - * nss_n2h_empty_pool_buf - * Old way of setting the number of empty pool buffers (payloads). - * - * The NSS firmware sets the low watermark to n -- ring_size, and the high - * watermark to n + ring_size. - */ -struct nss_n2h_empty_pool_buf { - uint32_t pool_size; /**< Size of the empty buffer pool. */ -}; - -/** - * nss_n2h_water_mark - * New way of setting the low and high watermarks in the NSS firmware. - */ -struct nss_n2h_water_mark { - /** - * Low watermark. - * Lower threshold for the number of payloads that can be held by NSS firmware. - * Setting this value to 0 gets the system to automatically determine the watermark. - */ - uint32_t low_water; - - /** - * High watermark. - * Upper threshold for the number of paylods that be held by the NSS firmware. - * Setting this value to 0 gets the system to automatically determine the watermark. - */ - uint32_t high_water; -}; - -/** - * nss_n2h_flush_payloads - * Flush payload configuration. - */ -struct nss_n2h_flush_payloads { - uint32_t reserved; /**< Reserved for future use. */ -}; - -/** - * nss_n2h_wifi_payloads - * Payloads required for Wi-Fi offloading. - */ -struct nss_n2h_wifi_payloads { - uint32_t payloads; /**< Number of payloads for Wi-Fi use. */ -}; - -/** - * nss_n2h_pbuf_mgr_stats - * Payload buffer manager statistics. - */ -struct nss_n2h_pbuf_mgr_stats { - uint32_t pbuf_total_count; /**< Total number of buffers, free or in use. */ - uint32_t pbuf_free_count; /**< Number of currently free buffers. */ - uint32_t pbuf_alloc_fails_with_payload; - /**< Number of buffer allocation failures. */ - uint32_t pbuf_alloc_fails_no_payload; - /**< Number of buffer allocation failures without payload. */ -}; - -/** - * nss_n2h_paged_buffer_pool_init - * Paged buffer configuration initialization. - */ -struct nss_n2h_paged_buffer_pool_init { - uint32_t reserved; /**< Reserved for future use. */ -}; - -/** - * nss_n2h_stats_sync - * N2H synchronization statistics. - */ -struct nss_n2h_stats_sync { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t queue_dropped; - /**< Number of packets dropped because the N2H queue is too full. */ - uint32_t total_ticks; /**< Total clock ticks spent inside the N2H handler. */ - uint32_t worst_case_ticks; /**< Worst case iteration of the N2H handler in ticks. */ - uint32_t iterations; /**< Number of iterations around the N2H handler. */ - - struct nss_n2h_pbuf_mgr_stats pbuf_ocm_stats; - /**< Statistics for on-chip memory payload buffers. */ - struct nss_n2h_pbuf_mgr_stats pbuf_default_stats; - /**< Statistics for DDR memory payload buffers. */ - - uint32_t payload_alloc_fails; /**< Number of payload allocation failures. */ - uint32_t payload_free_count; /**< Number of free payloads. */ - - uint32_t h2n_ctrl_pkts; /**< Control packets received from the HLOS. */ - uint32_t h2n_ctrl_bytes; /**< Control bytes received from the HLOS. */ - uint32_t n2h_ctrl_pkts; /**< Control packets sent to the HLOS. */ - uint32_t n2h_ctrl_bytes; /**< Control bytes sent to the HLOS. */ - - uint32_t h2n_data_pkts; /**< Data packets received from the HLOS. */ - uint32_t h2n_data_bytes; /**< Data bytes received from the HLOS. */ - uint32_t n2h_data_pkts; /**< Data packets sent to the HLOS. */ - uint32_t n2h_data_bytes; /**< Data bytes sent to the HLOS. */ - uint32_t tot_payloads; /**< Total number of payloads in the NSS firmware. */ - - /** - * Number of data packets with invalid interface received from the host. - */ - uint32_t data_interface_invalid; - uint32_t enqueue_retries; /**< Number of times N2H retried enqueue to next node. */ -}; - -/** - * nss_mmu_ddr_info - * System DDR memory information required by the firmware MMU to set range guards. - */ -struct nss_mmu_ddr_info { - uint32_t ddr_size; /**< Total size of the DDR. */ - uint32_t start_address; /**< System start address. */ - uint32_t num_active_cores; - /**< Number of active cores. */ - uint32_t nss_ddr_size; /**< Total memory for NSS SoC. */ -}; - -/** - * nss_n2h_queue_limit_config - * Queue length limit for N2H node. - */ -struct nss_n2h_queue_limit_config { - uint32_t qlimit; /**< Queue length size. */ -}; - -/** - * nss_n2h_host_back_pressure - * Host back pressure configuration. - */ -struct nss_n2h_host_back_pressure { - uint32_t enable; /**< Enable host back pressure. */ -}; - -/** - * nss_n2h_msg - * Data for sending and receiving N2H messages. - */ -struct nss_n2h_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of an N2H message. - */ - union { - struct nss_n2h_stats_sync stats_sync; - /**< N2H statistics synchronization. */ - struct nss_n2h_rps rps_cfg; - /**< RPS configuration. */ - struct nss_n2h_rps_pri_map rps_pri_map; - /**< RPS priority map. */ - struct nss_n2h_empty_pool_buf empty_pool_buf_cfg; - /**< Empty pool buffer configuration. */ - struct nss_n2h_empty_pool_buf empty_paged_pool_buf_cfg; - /**< Empty paged pool buffer configuration. */ - struct nss_n2h_flush_payloads flush_payloads; - /**< Flush payloads present in the NSS. */ - struct nss_n2h_mitigation mitigation_cfg; - /**< Mitigation configuration. */ - struct nss_n2h_buf_pool buf_pool; - /**< Pool buffer coniguration. */ - struct nss_n2h_water_mark wm; - /**< Sets low and high watermarks. */ - struct nss_n2h_water_mark wm_paged; - /**< Sets low and high watermarks for paged pool. */ - struct nss_n2h_payload_info payload_info; - /**< Gets the payload information. */ - struct nss_n2h_payload_info paged_payload_info; - /**< Gets the paged payload information. */ - struct nss_n2h_wifi_payloads wp; - /**< Sets the number of Wi-Fi payloads. */ - struct nss_mmu_ddr_info mmu; - /**< Gets the DDR size and start address to configure the MMU. */ - struct nss_n2h_pnode_queue_config pn_q_cfg; - /**< Pnode queueing configuration. */ - struct nss_n2h_queue_limit_config ql_cfg; - /**< Queue limit configuration. */ - struct nss_n2h_paged_buffer_pool_init paged_buffer_pool_init; - /**< Paged buffer pool initialization. */ - struct nss_n2h_host_back_pressure host_bp_cfg; - /**< Host back pressure configuration. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving N2H messages. - * - * @datatypes - * nss_n2h_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the N2H message. - */ -typedef void (*nss_n2h_msg_callback_t)(void *app_data, struct nss_n2h_msg *msg); - -/** - * nss_n2h_tx_msg - * Sends messages to the N2H package. - * - * @datatypes - * nss_ctx_instance \n - * nss_n2h_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] nnm Pointer to the N2H message. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_n2h_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_n2h_msg *nnm); - -/** - * nss_n2h_single_core_register_sysctl - * Registers the N2H sysctl entry to the sysctl tree for a single-core system. - * - * @return - * None. - */ -extern void nss_n2h_single_core_register_sysctl(void); - -/** - * nss_n2h_multi_core_register_sysctl - * Registers the N2H sysctl entry to the sysctl tree for a multi-core system. - * - * @return - * None. - */ -extern void nss_n2h_multi_core_register_sysctl(void); - -/** - * nss_n2h_unregister_sysctl - * Deregisters the N2H sysctl entry from the sysctl tree. - * - * @return - * None. - * - * @dependencies - * The system control must have been previously registered. - */ -extern void nss_n2h_unregister_sysctl(void); - -/** - * nss_n2h_flush_payloads - * Sends flush payloads message to NSS - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_n2h_flush_payloads(struct nss_ctx_instance *nss_ctx); - -/** - * nss_n2h_msg_init - * Initializes messages from the host to the NSS. - * - * @datatypes - * nss_n2h_msg \n - * nss_n2h_msg_callback_t - * - * @param[in,out] nim Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_n2h_msg_init(struct nss_n2h_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, - nss_n2h_msg_callback_t cb, void *app_data); - -/** - * nss_n2h_update_queue_config_sync - * Synchrounous method to update pnode queue configuration to NSS. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] mq_en Enable multiple pnode queues. - * @param[in] qlimits Maximum number of packets in each queues. - * - * @return - * Status of the configuration update operation. - */ -extern nss_tx_status_t nss_n2h_update_queue_config_sync(struct nss_ctx_instance *nss_ctx, bool mq_en, uint16_t *qlimits); - -/** - * nss_n2h_update_queue_config_async - * Asynchrounous method to update pnode queue configuration to NSS. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] mq_en Enable multiple pnode queues. - * @param[in] qlimits Maximum number of packets in each queues. - * - * @return - * Status of the configuration update operation. - */ -extern nss_tx_status_t nss_n2h_update_queue_config_async(struct nss_ctx_instance *nss_ctx, bool mq_en, uint16_t *qlimits); - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * nss_n2h_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_n2h_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_n2h_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_n2h_stats_unregister_notifier(struct notifier_block *nb); - -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_N2H_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_oam.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_oam.h deleted file mode 100644 index af25e3703..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_oam.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_oam.h - * NSS OAM - Operations, Administration and Maintenance Service - */ - -#ifndef __NSS_OAM_H -#define __NSS_OAM_H - -/** - * @addtogroup nss_oam_subsystem - * @{ - */ - -#define NSS_OAM_FW_VERSION_LEN 132 /**< Size of the OAM firmware version. */ - -/** - * nss_oam_msg_types - * OAM command types. - * - * The OAM proxy sends these command messages to the NSS OAM server via the OAM adapter. - */ -enum nss_oam_msg_types { - NSS_OAM_MSG_TYPE_NONE, - NSS_OAM_MSG_TYPE_GET_FW_VER, - NSS_OAM_MSG_TYPE_MAX, -}; - -/** - * nss_oam_error - * OAM error responses. - */ -enum nss_oam_error { - NSS_OAM_ERROR_NONE, - NSS_OAM_ERROR_INVAL_MSG_TYPE, - NSS_OAM_ERROR_INVAL_MSG_LEN, - NSS_OAM_ERROR_MAX, -}; - -/** - * nss_oam_fw_ver - * OAM firmware version. - */ -struct nss_oam_fw_ver { - uint8_t string[NSS_OAM_FW_VERSION_LEN]; /**< OAM firmware version. */ -}; - -/** - * nss_oam_msg - * Data for sending and receiving OAM messages. - */ -struct nss_oam_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of an OAM message. - */ - union { - struct nss_oam_fw_ver fw_ver; - /**< Firmware version. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving OAM messages. - * - * @datatypes - * nss_oam_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_oam_msg_callback_t)(void *app_data, struct nss_oam_msg *msg); - -/** - * nss_oam_tx_msg - * Transmits an OAM message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_oam_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation - */ -extern nss_tx_status_t nss_oam_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_oam_msg *msg); - -/** - * nss_oam_notify_register - * Registers a notifier callback with the NSS for sending and receiving OAM messages. - * - * @datatypes - * nss_oam_msg_callback_t - * - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_oam_notify_register(nss_oam_msg_callback_t cb, void *app_data); - -/** - * nss_oam_notify_unregister - * Deregisters an OAM message notifier callback from the NSS. - * - * @return - * None. - */ -extern void nss_oam_notify_unregister(void); - -/** - * nss_register_oam_if - * Registers the OAM interface handler with the NSS. - * - * @param[in] if_number Interface number of the OAM interface. - * - * @return - * Boolean status of handler registration - */ -extern bool nss_register_oam_if(uint16_t if_number); - -/** - * @} - */ - -#endif /* __NSS_OAM_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_phy_if.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_phy_if.h deleted file mode 100644 index cc52d86f0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_phy_if.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_phy_if.h.h - * NSS physical interface definitions. - */ - -#ifndef __NSS_PHY_IF_H -#define __NSS_PHY_IF_H - -/** - * @addtogroup nss_driver_subsystem - * @{ - */ - -/** - * nss_phys_if_reset_nexthop - * De-configure nexthop for an interface. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num Network physical interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_phys_if_reset_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num); - -/** - * nss_phys_if_set_nexthop - * Configure nexthop for an interface. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num Network physical interface number. - * @param[in] nexthop Network physical or virtual interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_phys_if_set_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint32_t nexthop); - -/** - * @} - */ - -#endif /* __NSS_PHY_IF_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_pm.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_pm.h deleted file mode 100644 index 8e0cce88d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_pm.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * @file nss_pm.h - * NSS power management definitions. - */ - -#ifndef __NSS_PM_H -#define __NSS_PM_H - -/** - * @addtogroup nss_pm_subsystem - * @{ - */ - -/** - * nss_pm_client - * Power management (PM) clients. - * - * These clients can query for bus or clock performance levels. - */ -typedef enum nss_pm_client { - NSS_PM_CLIENT_GMAC, - NSS_PM_CLIENT_CRYPTO, - NSS_PM_CLIENT_NETAP, - NSS_PM_MAX_CLIENTS, -} nss_pm_client_t; - -/** - * nss_pm_perf_level - * Performance levels. - * - * This enumeration is passed as a parameter to NSS PM performance-level - * requests. - */ -typedef enum nss_pm_perf_level { - NSS_PM_PERF_LEVEL_SUSPEND = 0, - NSS_PM_PERF_LEVEL_IDLE, - NSS_PM_PERF_LEVEL_NOMINAL, - NSS_PM_PERF_LEVEL_TURBO, - NSS_PM_PERF_MAX_LEVELS, -} nss_pm_perf_level_t; - -/** - * nss_pm_interface_status_t - * Status of the PM client interface. - */ -typedef enum { - NSS_PM_API_SUCCESS = 0, - NSS_PM_API_FAILED, -} nss_pm_interface_status_t; - -/** - * nss_pm_client_register - * Registers a power management driver client. - * - * @datatypes - * nss_pm_client_t - * - * @param[in] client_id ID of the client driver. - * - * @return - * None. - */ -extern void *nss_pm_client_register(nss_pm_client_t client_id); - -/** - * nss_pm_client_unregister - * Deregisters a power management driver client. - * - * @datatypes - * nss_pm_client_t - * - * @param[in] client_id ID of the client driver. - * - * @return - * None. - */ -int nss_pm_client_unregister(nss_pm_client_t client_id); - -/** - * nss_pm_set_perf_level - * Updates the bus bandwidth level for a client. - * - * @datatypes - * nss_pm_perf_level_t - * - * @param[in,out] handle Handle of the client. - * @param[in,out] lvl Performance level. - * - * @return - * None. - */ -extern nss_pm_interface_status_t nss_pm_set_perf_level(void *handle, nss_pm_perf_level_t lvl); - -/** - * @} - */ - -#endif /* __NSS_PM_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_portid.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_portid.h deleted file mode 100644 index 61e8ac6d8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_portid.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_portid.h - * NSS Port ID interface definitions. - */ - -#ifndef __NSS_PORTID_H -#define __NSS_PORTID_H - -/** - * @addtogroup nss_portid_subsystem - * @{ - */ - -/** - * Maximum number of ports on the S17c switch chip. - * - * If a new switch has more ports than S17c, this value must be updated. - */ -#define NSS_PORTID_MAX_SWITCH_PORT 7 - -/** - * nss_portid_msg_types - * Message types for port ID requests and responses. - */ -enum nss_portid_msg_types { - NSS_PORTID_CONFIGURE_MSG, - NSS_PORTID_UNCONFIGURE_MSG, - NSS_PORTID_STATS_SYNC_MSG, - NSS_PORTID_MAX_MSG_TYPE -}; - -/** - * nss_portid_configure_msg - * Message information for configuring a port ID. - */ -struct nss_portid_configure_msg { - uint32_t port_if_num; - /**< Interface number corresponding to the port ID of the device. */ - uint8_t port_id; /**< ID of the mapped switch port. */ - uint8_t gmac_id; /**< ID of the mapped GMAC interface. */ - uint8_t reserved[2]; /**< Reserved for word alignment. */ -}; - -/** - * nss_portid_unconfigure_msg - * Message information for deleting a port ID. - */ -struct nss_portid_unconfigure_msg { - uint32_t port_if_num; - /**< Interface number corresponding to the port ID of the device. */ - uint8_t port_id; /**< ID of the mapped switch port. */ - uint8_t reserved[3]; /**< Reserved for word alignment. */ -}; - -/** - * nss_portid_stats_sync_msg - * Message information for port ID synchronization statistics. - */ -struct nss_portid_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t rx_invalid_header; /**< Rx with an invalid header. */ - uint8_t port_id; /**< ID of the mapped switch port. */ - uint8_t reserved[3]; /**< Reserved for word alignment. */ -}; - -/** - * nss_portid_msg - * Data for sending and receiving port ID messages. - */ -struct nss_portid_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a port ID message. - */ - union { - struct nss_portid_configure_msg configure; - /**< Port ID configuration information. */ - struct nss_portid_unconfigure_msg unconfigure; - /**< Port ID de-configuration information. */ - struct nss_portid_stats_sync_msg stats_sync; - /**< Synchronization statistics for the port ID. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving port ID messages. - * - * @datatypes - * nss_portid_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] npm Pointer to the NSS Profiler message. - */ -typedef void (*nss_portid_msg_callback_t)(void *app_data, struct nss_portid_msg *npm); - -/** - * Callback function for receiving port ID interface data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_portid_buf_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_portid_get_stats - * Gets statistics from a port interface. - * - * @datatypes - * rtnl_link_stats64 - * - * @param[in] if_num NSS interface number. - * @param[out] stats Container for the statistic counters. - * - * @return - * TRUE or FALSE. - */ -bool nss_portid_get_stats(uint32_t if_num, struct rtnl_link_stats64 *stats); - -/** - * nss_portid_msg_init - * Initializes a port ID message. - * - * @datatypes - * nss_portid_msg \n - * nss_portid_msg_callback_t - * - * @param[in,out] npm Pointer to the NSS port ID message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_portid_msg_init(struct nss_portid_msg *npm, uint16_t if_num, uint32_t type, uint32_t len, - nss_portid_msg_callback_t cb, void *app_data); - -/** - * nss_portid_if_tx_data - * Transmits a data packet to the NSS port ID interface. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] os_buf Pointer to the OS data buffer. - * @param[in] if_num NSS interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_portid_if_tx_data(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num); - -/** - * nss_portid_tx_msg - * Sends a port ID message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_portid_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_portid_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_portid_msg *msg); - -/** - * nss_portid_tx_msg_sync - * Sends a port ID message to the NSS and waits for a response. - * - * @datatypes - * nss_ctx_instance \n - * nss_portid_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in,out] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_portid_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_portid_msg *msg); - -/** - * nss_portid_register_port_if - * Registers the port interface with the NSS. - * - * @datatypes - * net_device \n - * nss_portid_buf_callback_t - * - * @param[in] if_num NSS interface number. - * @param[in] port_id Physical port ID of this interface. - * @param[in] ndev Pointer to the associated network device. - * @param[in] buf_cb Callback for the data. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_portid_register_port_if(uint32_t if_num, uint32_t port_id, struct net_device *ndev, nss_portid_buf_callback_t buf_cb); - -/** - * nss_portid_unregister_port_if - * Deregisters the port interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * TRUE or FALSE. - * - * @dependencies - * The interface must have been previously registered. - */ -extern bool nss_portid_unregister_port_if(uint32_t if_num); - -/** - * nss_portid_tx_configure_port_if_msg - * Sends a port interface configuration message to the NSS. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] port_if_num Interface number of the port node. - * @param[in] port_id ID of the mapped switch port. - * @param[in] gmac_id ID of the mapped GMAC interface. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_portid_tx_configure_port_if_msg(struct nss_ctx_instance *nss_ctx, uint32_t port_if_num, uint8_t port_id, uint8_t gmac_id); - -/** - * nss_portid_tx_unconfigure_port_if_msg - * Sends a port interface de-configuration message to the NSS. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] port_if_num Interface number of the port node. - * @param[in] port_id ID of the mapped switch port. - * - * @return - * Status of the Tx operation. - * - * @dependencies - * The interface must have been previously configured. - */ -extern nss_tx_status_t nss_portid_tx_unconfigure_port_if_msg(struct nss_ctx_instance *nss_ctx, uint32_t port_if_num, uint8_t port_id); - -/** - * @} - */ - -#endif /* __NSS_PORTID_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ppe.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ppe.h deleted file mode 100644 index 648bb6638..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ppe.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2018, 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ppe.h - * NSS PPE interface definitions. - */ - -#ifndef _NSS_PPE_H_ -#define _NSS_PPE_H_ - -typedef int32_t nss_ppe_port_t; - -/** - * @addtogroup nss_ppe_subsystem - * @{ - */ - -/* - * NSS PORT defines - */ -#define NSS_PPE_NUM_PHY_PORTS_MAX 8 - /**< Maximum number of PPE physical ports. */ -#define NSS_PPE_PORT_IPSEC 7 - /**< Port number of PPE inline IPsec port. */ - -/** - * nss_ppe_sc_type - * PPE service code types. - */ -enum nss_ppe_sc_type { - NSS_PPE_SC_NONE, /**< Normal PPE processing. */ - NSS_PPE_SC_BYPASS_ALL, /**< Bypasses all stages in PPE. */ - NSS_PPE_SC_ADV_QOS_BRIDGED, /**< Advance QoS redirection for bridged flow. */ - NSS_PPE_SC_BR_QOS, /**< Bridge QoS redirection. */ - NSS_PPE_SC_BNC_0, /**< QoS bounce. */ - NSS_PPE_SC_BNC_CMPL_0, /**< QoS bounce complete. */ - NSS_PPE_SC_ADV_QOS_ROUTED, /**< Advance QoS redirection for routed flow. */ - NSS_PPE_SC_IPSEC_PPE2EIP, /**< Inline IPsec redirection from PPE-to-EIP. */ - NSS_PPE_SC_IPSEC_EIP2PPE, /**< Inline IPsec redirection from EIP-to-PPE. */ - NSS_PPE_SC_PTP, /**< Service code for PTP packets. */ - NSS_PPE_SC_VLAN_FILTER_BYPASS, /**< VLAN filter bypass for bridge flows between 2 different VSIs. */ - NSS_PPE_SC_L3_EXCEPT, /**< Indicate exception post tunnel/TAP operation. */ - NSS_PPE_SC_SPF_BYPASS, /**< Source port filtering bypass in PPE. */ - NSS_PPE_SC_MAX, /**< Maximum service code. */ -}; - -/** - * nss_ppe_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_ppe_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_ppe_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_ppe_stats_register_notifier(struct notifier_block *nb); - -/** @} */ /* end_addtogroup nss_ppe_subsystem */ - -#endif /* _NSS_PPE_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ppe_vp.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_ppe_vp.h deleted file mode 100644 index 64e1f5ecf..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_ppe_vp.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_ppe_vp.h - * NSS PPE Virtual Port definitions. - */ - -#ifndef _NSS_PPE_VP_H_ -#define _NSS_PPE_VP_H_ - -/** - * nss_if_ppe_vp_destroy - * Destroy the PPE VP for a given NSS interface number. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_ppe_vp_destroy(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num); - -/** - * nss_ppe_vp_create - * Create the PPE VP for a given NSS interface number. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_ppe_vp_create(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num); - -/** - * nss_ppe_vp_get_ppe_port_by_nssif - * Returns the PPE VP number for a given NSS interface number. - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] nss_if NSS interface number. - * - * @return - * Returns the PPE VP number corresponding to the NSS interface number. - */ -nss_ppe_port_t nss_ppe_vp_get_ppe_port_by_nssif(struct nss_ctx_instance *nss_ctx, nss_if_num_t nss_if); - -/** - * nss_ppe_vp_get_context - * Return the NSS context of PPE VP. - * - * @datatypes - * nss_ctx_instance - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_ppe_vp_get_context(void); - -#endif /* _NSS_PPE_VP_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_pppoe.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_pppoe.h deleted file mode 100644 index f082d3067..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_pppoe.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_pppoe.h - * NSS PPPoE interface definitions. - */ - -#ifndef __NSS_PPPOE_H -#define __NSS_PPPOE_H - -/** - * @addtogroup nss_pppoe_subsystem - * @{ - */ - -/** - * Maximum number of supported PPPoE sessions. - */ -#define NSS_MAX_PPPOE_DYNAMIC_INTERFACES 8 - -/** - * nss_pppoe_metadata_types - * Message types for PPPoE requests and responses. - */ -enum nss_pppoe_metadata_types { - NSS_PPPOE_MSG_SESSION_CREATE, - NSS_PPPOE_MSG_SESSION_DESTROY, - NSS_PPPOE_MSG_SYNC_STATS, - NSS_PPPOE_MSG_BR_ACCEL_CFG, - NSS_PPPOE_MSG_MAX -}; - -/** - * nss_pppoe_session_exception_events - * Session exception events from the PPPoE handler. - */ -enum nss_pppoe_session_exception_events { - NSS_PPPOE_SESSION_EXCEPTION_EVENT_WRONG_VERSION_OR_TYPE, - NSS_PPPOE_SESSION_EXCEPTION_EVENT_WRONG_CODE, - NSS_PPPOE_SESSION_EXCEPTION_EVENT_UNSUPPORTED_PPP_PROTOCOL, - NSS_PPPOE_SESSION_EXCEPTION_EVENT_MAX -}; - -/** - * pppoe_base_exception_events - * Base node exception events from the PPPoE handler. - */ -enum nss_pppoe_base_exception_events { - NSS_PPPOE_BASE_EXCEPTION_EVENT_SHORT_PPPOE_HDR_LENGTH, - NSS_PPPOE_BASE_EXCEPTION_EVENT_SHORT_PACKET_LENGTH, - NSS_PPPOE_BASE_EXCEPTION_EVENT_WRONG_VERSION_OR_TYPE, - NSS_PPPOE_BASE_EXCEPTION_EVENT_WRONG_CODE, - NSS_PPPOE_BASE_EXCEPTION_EVENT_UNSUPPORTED_PPP_PROTOCOL, - NSS_PPPOE_BASE_EXCEPTION_EVENT_DISABLED_BRIDGE_PACKET, - NSS_PPPOE_BASE_EXCEPTION_EVENT_MAX -}; - -/** - * nss_pppoe_br_accel_mode - * PPPoE bridge acceleration modes. - */ -enum nss_pppoe_br_accel_modes { - NSS_PPPOE_BR_ACCEL_MODE_DIS, - NSS_PPPOE_BR_ACCEL_MODE_EN_5T, - NSS_PPPOE_BR_ACCEL_MODE_EN_3T, - NSS_PPPOE_BR_ACCEL_MODE_MAX -}; - -/** - * nss_pppoe_base_stats - * PPPoE base node synchronization statistics. - */ -struct nss_pppoe_base_stats { - struct nss_cmn_node_stats node; /**< Common node statistics. */ - uint32_t exception[NSS_PPPOE_BASE_EXCEPTION_EVENT_MAX]; - /**< PPPoE base node exception events. */ -}; - -/** - * nss_pppoe_session_stats - * PPPoE synchronization statistics per session. - */ -struct nss_pppoe_session_stats { - struct nss_cmn_node_stats node; /**< Common node statistics. */ - uint32_t exception[NSS_PPPOE_SESSION_EXCEPTION_EVENT_MAX]; - /**< PPPoE session exception events. */ -}; - -/** - * nss_pppoe_stats_session - * PPPoE session statistics. - */ -enum nss_pppoe_stats_session { - NSS_PPPOE_STATS_SESSION_RX_PACKETS, - NSS_PPPOE_STATS_SESSION_RX_BYTES, - NSS_PPPOE_STATS_SESSION_TX_PACKETS, - NSS_PPPOE_STATS_SESSION_TX_BYTES, - NSS_PPPOE_STATS_SESSION_WRONG_VERSION_OR_TYPE, - NSS_PPPOE_STATS_SESSION_WRONG_CODE, - NSS_PPPOE_STATS_SESSION_UNSUPPORTED_PPP_PROTOCOL, - NSS_PPPOE_STATS_SESSION_MAX -}; - -/** - * nss_pppoe_stats_base - * PPPoE base node statistics. - */ -enum nss_pppoe_stats_base { - NSS_PPPOE_STATS_BASE_RX_PACKETS, - NSS_PPPOE_STATS_BASE_RX_BYTES, - NSS_PPPOE_STATS_BASE_TX_PACKETS, - NSS_PPPOE_STATS_BASE_TX_BYTES, - NSS_PPPOE_STATS_BASE_RX_QUEUE_0_DROPPED, - NSS_PPPOE_STATS_BASE_RX_QUEUE_1_DROPPED, - NSS_PPPOE_STATS_BASE_RX_QUEUE_2_DROPPED, - NSS_PPPOE_STATS_BASE_RX_QUEUE_3_DROPPED, - NSS_PPPOE_STATS_BASE_SHORT_PPPOE_HDR_LENGTH, - NSS_PPPOE_STATS_BASE_SHORT_PACKET_LENGTH, - NSS_PPPOE_STATS_BASE_WRONG_VERSION_OR_TYPE, - NSS_PPPOE_STATS_BASE_WRONG_CODE, - NSS_PPPOE_STATS_BASE_UNSUPPORTED_PPP_PROTOCOL, - NSS_PPPOE_STATS_BASE_DISABLED_BRIDGE_PACKET, - NSS_PPPOE_STATS_BASE_MAX -}; - -/** - * nss_pppoe_stats_notification - * PPPoE statistics structure. - */ -struct nss_pppoe_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ - uint64_t session_stats[NSS_PPPOE_STATS_SESSION_MAX]; /**< PPPoE statistics. */ - uint64_t base_stats[NSS_PPPOE_STATS_BASE_MAX]; /**< PPPoE base node statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * nss_pppoe_sync_stats_msg - * PPPoE synchronization statistics. - */ -struct nss_pppoe_sync_stats_msg { - struct nss_pppoe_session_stats session_stats; /**< Session statistics. */ - struct nss_pppoe_base_stats base_stats; /**< Base node statistics. */ -}; - -/** - * nss_pppoe_destroy_msg - * PPPoE session destroy message. - */ -struct nss_pppoe_destroy_msg { - uint16_t session_id; /**< PPPoE session identification number. */ - uint8_t server_mac[ETH_ALEN]; /**< PPPoE server MAC address. */ - uint8_t local_mac[ETH_ALEN]; /**< Local physical interface MAC address. */ -}; - -/** - * nss_pppoe_create_msg - * PPPoE session create message. - */ -struct nss_pppoe_create_msg { - int32_t base_if_num; /**< Base NSS interface number which PPPoE session created on. */ - uint32_t mtu; /**< PPPoE interface MTU value. */ - uint8_t server_mac[ETH_ALEN]; /**< PPPoE server MAC address. */ - uint8_t local_mac[ETH_ALEN]; /**< Local physical interface MAC address. */ - uint16_t session_id; /**< PPPoE session identification number. */ -}; - -/** - * nss_pppoe_br_accel_cfg_msg - * PPPoE bridge acceleration configuration message. - */ -struct nss_pppoe_br_accel_cfg_msg { - uint32_t br_accel_cfg; /**< PPPoE bridge acceleration configuration. */ -}; - -/** - * nss_pppoe_msg - * Data for sending and receiving PPPoE messages. - */ -struct nss_pppoe_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a PPPoE message. - */ - union { - struct nss_pppoe_create_msg create; - /**< Session create message. */ - struct nss_pppoe_destroy_msg destroy; - /**< Session destroy message. */ - struct nss_pppoe_sync_stats_msg sync_stats; - /**< Session statistics message. */ - struct nss_pppoe_br_accel_cfg_msg br_accel; - /**< PPPoE bridge acceleration configuration message. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving PPPoE messages. - * - * @datatypes - * nss_pppoe_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_pppoe_msg_callback_t)(void *app_data, struct nss_pppoe_msg *msg); - -/** - * nss_pppoe_tx_msg_sync - * Sends a PPPoE message synchronously to NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_pppoe_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_pppoe_tx_msg_sync(struct nss_ctx_instance *nss_ctx, - struct nss_pppoe_msg *msg); - -/** - * nss_register_pppoe_session_if - * Registers the PPPoE session interface with the NSS for sending and - * receiving messages. - * - * @datatypes - * nss_pppoe_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] notification_callback Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Socket buffer types supported by this interface. - * @param[in] app_ctx Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_register_pppoe_session_if(uint32_t if_num, - nss_pppoe_msg_callback_t notification_callback, - struct net_device *netdev, uint32_t features, void *app_ctx); - -/** - * nss_unregister_pppoe_session_if - * Deregisters the PPPoE session interface from the NSS. - * - * @param[in] if_num NSS interface number. -. * - * @return - * None. - * - * @dependencies - * The tunnel interface must have been previously registered. - */ -extern void nss_unregister_pppoe_session_if(uint32_t if_num); - -/** - * nss_pppoe_get_context - * Gets the PPPoE context used in PPPoE transmit message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_pppoe_get_context(void); - -/** - * nss_pppoe_debug_stats_get - * Gets NSS session debug statistics. - * - * @param[out] stats_mem Pointer to the memory address, which must be large - * enough to hold all the statistics. - * - * @return - * None. - */ -extern void nss_pppoe_debug_stats_get(void *stats_mem); - -/** - * nss_pppoe_get_bridge_accel_mode - * Gets the PPPoE bridge acceleration mode. - * - * @return - * Current PPPoE bridge acceleration mode. - */ -extern enum nss_pppoe_br_accel_modes nss_pppoe_get_br_accel_mode(void); - -/** - * nss_pppoe_register_sysctl - * Registers the PPPoE system control table. - * - * @return - * None. - */ -void nss_pppoe_register_sysctl(void); - -/** - * nss_pppoe_unregister_sysctl - * Deregisters the PPPoE system control table. - * - * @return - * None. - * - * @dependencies - * The system control table must have been previously registered. - */ -void nss_pppoe_unregister_sysctl(void); - -/** - * nss_pppoe_msg_init - * Initializes a PPPoE message. - * - * @datatypes - * nss_pppoe_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num Interface number - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_pppoe_msg_init(struct nss_pppoe_msg *ncm, - uint16_t if_num, uint32_t type, uint32_t len, - void *cb, void *app_data); - -/** - * nss_pppoe_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_pppoe_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_pppoe_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_pppoe_stats_unregister_notifier(struct notifier_block *nb); - -#endif /*__KERNEL__ */ - -/** - * @} - */ - -#endif /* __NSS_PPPOE_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_pptp.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_pptp.h deleted file mode 100644 index 6478684b9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_pptp.h +++ /dev/null @@ -1,345 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_pptp.h - * NSS PPTP interface definitions. - */ - -#ifndef _NSS_PPTP_H_ -#define _NSS_PPTP_H_ - -#include "nss_dynamic_interface.h" - -/** - * @addtogroup nss_pptp_subsystem - * @{ - */ - -/** - * Maximum number of supported PPTP sessions is 4. - * Number of dynamic intefaces per session is 3. - * Total 4 * 3 = 12 - */ -#define NSS_MAX_PPTP_DYNAMIC_INTERFACES 12 - -/** - * nss_pptp_metadata_types - * Message types for PPTP requests and responses. - */ -enum nss_pptp_metadata_types { - NSS_PPTP_MSG_SESSION_CONFIGURE, - NSS_PPTP_MSG_SESSION_DECONFIGURE, - NSS_PPTP_MSG_SYNC_STATS, - NSS_PPTP_MSG_MAX -}; - -/** - * nss_pptp_exception_events - * Exception events for PPTP encapsulation and decapsulation packets. - */ -enum nss_pptp_exception_events { - PPTP_EXCEPTION_EVENT_ENCAP_HEADROOM_ERR, - PPTP_EXCEPTION_EVENT_ENCAP_SMALL_SIZE, - PPTP_EXCEPTION_EVENT_ENCAP_PNODE_ENQUEUE_FAIL, - PPTP_EXCEPTION_EVENT_DECAP_NO_SEQ_NOR_ACK, - PPTP_EXCEPTION_EVENT_DECAP_INVAL_GRE_FLAGS, - PPTP_EXCEPTION_EVENT_DECAP_INVAL_GRE_PROTO, - PPTP_EXCEPTION_EVENT_DECAP_WRONG_SEQ, - PPTP_EXCEPTION_EVENT_DECAP_INVAL_PPP_HDR, - PPTP_EXCEPTION_EVENT_DECAP_PPP_LCP, - PPTP_EXCEPTION_EVENT_DECAP_UNSUPPORTED_PPP_PROTO, - PPTP_EXCEPTION_EVENT_DECAP_PNODE_ENQUEUE_FAIL, - PPTP_EXCEPTION_EVENT_MAX, -}; - -/** - * nss_pptp_stats_session - * PPTP debug statistics. - */ -enum nss_pptp_stats_session { - NSS_PPTP_STATS_ENCAP_RX_PACKETS, - NSS_PPTP_STATS_ENCAP_RX_BYTES, - NSS_PPTP_STATS_ENCAP_TX_PACKETS, - NSS_PPTP_STATS_ENCAP_TX_BYTES, - NSS_PPTP_STATS_ENCAP_RX_QUEUE_0_DROP, - NSS_PPTP_STATS_ENCAP_RX_QUEUE_1_DROP, - NSS_PPTP_STATS_ENCAP_RX_QUEUE_2_DROP, - NSS_PPTP_STATS_ENCAP_RX_QUEUE_3_DROP, - NSS_PPTP_STATS_DECAP_RX_PACKETS, - NSS_PPTP_STATS_DECAP_RX_BYTES, - NSS_PPTP_STATS_DECAP_TX_PACKETS, - NSS_PPTP_STATS_DECAP_TX_BYTES, - NSS_PPTP_STATS_DECAP_RX_QUEUE_0_DROP, - NSS_PPTP_STATS_DECAP_RX_QUEUE_1_DROP, - NSS_PPTP_STATS_DECAP_RX_QUEUE_2_DROP, - NSS_PPTP_STATS_DECAP_RX_QUEUE_3_DROP, - NSS_PPTP_STATS_SESSION_ENCAP_HEADROOM_ERR, - NSS_PPTP_STATS_SESSION_ENCAP_SMALL_SIZE, - NSS_PPTP_STATS_SESSION_ENCAP_PNODE_ENQUEUE_FAIL, - NSS_PPTP_STATS_SESSION_DECAP_NO_SEQ_NOR_ACK, - NSS_PPTP_STATS_SESSION_DECAP_INVAL_GRE_FLAGS, - NSS_PPTP_STATS_SESSION_DECAP_INVAL_GRE_PROTO, - NSS_PPTP_STATS_SESSION_DECAP_WRONG_SEQ, - NSS_PPTP_STATS_SESSION_DECAP_INVAL_PPP_HDR, - NSS_PPTP_STATS_SESSION_DECAP_PPP_LCP, - NSS_PPTP_STATS_SESSION_DECAP_UNSUPPORTED_PPP_PROTO, - NSS_PPTP_STATS_SESSION_DECAP_PNODE_ENQUEUE_FAIL, - NSS_PPTP_STATS_SESSION_MAX -}; - -/** - * nss_pptp_stats_notification - * PPTP statistics structure. - */ -struct nss_pptp_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ - enum nss_dynamic_interface_type if_type; /**< Dynamic interface type. */ - uint64_t stats[NSS_PPTP_STATS_SESSION_MAX]; /**< PPTP statistics. */ -}; - -/** - * nss_pptp_session_configure_msg - * Message information for configuring a PPTP session. - */ -struct nss_pptp_session_configure_msg { - uint16_t src_call_id; /**< Local call ID for caller or callee. */ - uint16_t dst_call_id; /**< Peer call ID for caller or callee. */ - uint32_t sip; /**< Local tunnel endpoint. */ - uint32_t dip; /**< Remote tunnel endpoint. */ - uint32_t sibling_ifnum_pri; /**< Primary sibling interface. */ - uint32_t sibling_ifnum_aux; /**< Auxiliary sibling interface. */ -}; - -/** - * nss_pptp_session_deconfigure_msg - * Message information for deleting a PPTP session. - */ -struct nss_pptp_session_deconfigure_msg { - uint16_t src_call_id; /**< Local call ID */ -}; - -/** - * nss_pptp_sync_session_stats_msg - * Message information for PPTP synchronization statistics. - */ -struct nss_pptp_sync_session_stats_msg { - struct nss_cmn_node_stats node_stats; - /**< Common node statistics for the encapsulation direction. */ - uint32_t exception_events[PPTP_EXCEPTION_EVENT_MAX]; - /**< Statistics of events which casued packets to exception to host. */ -}; - -/** - * nss_pptp_msg - * Data for sending and receiving PPTP messages. - */ -struct nss_pptp_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a PPTP message. - */ - union { - struct nss_pptp_session_configure_msg session_configure_msg; - /**< Session configuration message. */ - struct nss_pptp_session_deconfigure_msg session_deconfigure_msg; - /**< Session de-configuration message. */ - struct nss_pptp_sync_session_stats_msg stats; - /**< Session statistics message. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving PPTP messages. - * - * @datatypes - * nss_pptp_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_pptp_msg_callback_t)(void *app_data, struct nss_pptp_msg *msg); - -/** - * nss_pptp_tx_msg_sync - * Sends a PPTP message synchronously to NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_pptp_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_pptp_tx_msg_sync(struct nss_ctx_instance *nss_ctx, - struct nss_pptp_msg *msg); - -/** - * nss_pptp_tx_buf - * Sends a data packet to the firmware. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * @param[in] skb Pointer to the data socket buffer. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_pptp_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb); - -/** - * nss_pptp_get_context - * Gets the PPTP context used in nss_pptp_tx. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_pptp_get_context(void); - -/** - * Callback function for receiving PPTP tunnel data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_pptp_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_register_pptp_if - * Registers the PPTP tunnel interface with the NSS for sending and - * receiving messages. - * - * @datatypes - * nss_pptp_callback_t \n - * nss_pptp_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] type Dynamic interface type. - * @param[in] pptp_data_callback Callback for the data. - * @param[in] notification_callback Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Socket buffer types supported by this interface. - * @param[in] app_ctx Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_register_pptp_if(uint32_t if_num, uint32_t type, nss_pptp_callback_t pptp_data_callback, - nss_pptp_msg_callback_t notification_callback, struct net_device *netdev, uint32_t features, void *app_ctx); - -/** - * nss_unregister_pptp_if - * Deregisters the PPTP tunnel interface from the NSS. - * - * @param[in] if_num NSS interface number. -. * - * @return - * None. - * - * @dependencies - * The tunnel interface must have been previously registered. - */ -extern void nss_unregister_pptp_if(uint32_t if_num); - -/** - * nss_pptp_msg_init - * Initializes a PPTP message. - * - * @datatypes - * nss_pptp_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num Interface number - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_pptp_msg_init(struct nss_pptp_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_pptp_register_handler - * Registers the PPTP interface with the NSS debug statistics handler. - * - * @return - * None. - */ -extern void nss_pptp_register_handler(void); - -/** - * nss_pptp_session_debug_stats_get - * Gets NSS session debug statistics. - * - * @param[out] stats_mem Pointer to the memory address, which must be large - * enough to hold all the statistics. - * - * @return - * None. - */ -extern void nss_pptp_session_debug_stats_get(void *stats_mem); - -/** - * nss_pptp_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_pptp_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_pptp_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_pptp_stats_unregister_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* _NSS_PPTP_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_profiler.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_profiler.h deleted file mode 100644 index 89ddf6586..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_profiler.h +++ /dev/null @@ -1,406 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2015, 2017, 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_profiler.h - * NSS Profiler APIs - */ - -#ifndef __NSS_PROFILER_H -#define __NSS_PROFILER_H - -/** - * @addtogroup nss_profiler_subsystem - * @{ - */ - -/** - * Length of the counter name. - * - * This value allows all counter values to fit in a single 1400-byte UDP packet. - */ -#define PROFILE_COUNTER_NAME_LENGTH 20 - -#define PROFILE_MAX_APP_COUNTERS 24 /**< Maximum number of application counters. */ - -/** - * nss_profile_counter - * Counter statistics. - */ -struct nss_profile_counter { - char name[PROFILE_COUNTER_NAME_LENGTH]; /**< Counter name. */ - uint32_t value; /**< Current value. */ -}; - -/** - * nss_profiler_message_types - * Message types for the Profiler. - * - * Do not alter this enumeration. However, adding more types is allowed. - */ -enum nss_profiler_message_types { - NSS_PROFILER_CHANGE_SAMPLING_RATE_MSG, /**< Host-to-NSS: ask to do a rate change. */ - NSS_PROFILER_START_MSG, /**< Host-to-NSS: start the NSS Profiler. */ - NSS_PROFILER_STOP_MSG, /**< Host-to-NSS: stop the NSS Profiler. */ - NSS_PROFILER_FLOWCTRL_MSG, /**< Host-to-NSS: do flow control on sampling. */ - NSS_PROFILER_DEBUG_RD_MSG, /**< Host-to-NSS: debug the output. */ - NSS_PROFILER_DEBUG_WR_MSG, /**< Host-to-NSS: debug the input. */ - NSS_PROFILER_DEBUG_REPLY_MSG, /**< NSS-to-host: debug response. */ - NSS_PROFILER_REPLY_MSG, /**< Check the response. */ - NSS_PROFILER_FIXED_INFO_MSG, /**< NSS-to-host: constant data. */ - NSS_PROFILER_COUNTERS_MSG, /**< NSS-to-host: counter information. */ - NSS_PROFILER_SAMPLES_MSG, /**< NSS-to-host: main sample data. */ - NSS_PROFILER_START_CAL, /**< Not for the host to use. */ - NSS_PROFILER_GET_SYS_STAT_EVENT, /**< Get the system status event. */ - NSS_PROFILER_SET_SYS_STAT_EVENT, /**< Set the system status event. */ - NSS_PROFILER_MAX_MSG_TYPES, /**< Maximum number of message types. */ -}; - -/** - * nss_profile_errors - * Profiler error types returned from the NSS. - */ -enum nss_profile_errors { - PROFILE_ERROR_NO_PROF_INIT = 1, - PROFILE_ERROR_EMEM, - PROFILE_ERROR_BAD_PKT, - PROFILE_ERROR_UNKNOWN_CMD, - PROFILE_ERROR_NO_DMA, - PROFILE_ERROR_MAX -}; - -/** - * nss_profiler_cmd_param - * Parameter information for the Profiler. - * - * Use this structure for per-session commands: START, STOP, FLOWCTRL, RATE. - */ -struct nss_profiler_cmd_param { - uint32_t hd_magic; /**< Common overlay in all headers. */ - uint32_t num_counters; - /**< Number of registered performance (application) counters. */ - uint32_t ocm_size; /**< Size of the on-chip-memory. */ - uint32_t sram_start; /**< DDR starting address. */ - uint32_t rate; /**< Sampling rate. */ - uint32_t cpu_id; /**< ID of the chip register. */ - uint32_t cpu_freq; /**< Chip clock frequency. */ - uint32_t ddr_freq; /**< DDR memory speed. */ - - struct nss_profile_counter counters[PROFILE_MAX_APP_COUNTERS]; - /**< Application profiling counters. */ -}; - -/** - * nss_profiler_data_msg - * Message information for the Profiler. - */ -struct nss_profiler_data_msg { - uint32_t hd_magic; /**< Magic header for verification. */ - uint32_t msg_data[1]; /**< Variable length private data. */ -}; - -/** - * nss_profiler_debug_msg - * Message information for Profiler debugging. - */ -struct nss_profiler_debug_msg { - uint32_t hd_magic; /**< Magic header for verification. */ - uint32_t debug_data[256]; /**< Fixed length debug data. */ -}; - -/** - * nss_profiler_msg - * Data for sending and receiving Profiler messages. - */ -struct nss_profiler_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a Profiler message. - */ - union npm_body { - struct nss_profiler_cmd_param pcmdp; /**< Command parameters. */ - struct nss_profiler_debug_msg pdm; /**< Debug packet. */ - struct nss_profiler_data_msg msg; /**< Sampling data. */ - } payload; /**< Message payload. The data length is set in common message header. */ -}; - -/** - * nss_profile_sdma_producer - * DMA descriptor of producer. - */ -struct nss_profile_sdma_producer { - uint32_t intr_num; /**< Interrupt number. */ - uint32_t pkg_id; /**< Package ID that registered this entry. */ - uint32_t buf_size; /**< DMA buffer size. */ - uint32_t num_bufs; /**< Number of ring buffers. */ - uint32_t desc_ring; /**< Ring address (physical 32-bit). */ - uint32_t pad3w[3]; /**< Pad 32-byte alignment. */ -}; - -/** - * nss_u64_32_data - * 64-bit union for both 32/64 bits data aligned at 64-bit boundary. - */ -union nss_u64_32_data { - uint64_t d64; /**< 64-bit space holder: may not be used. */ - uint32_t d32; /**< 32-bit direct data. */ - void *kp; /**< Kernel data pointer either 32 or 64 bits. */ -}; - -/** - * nss_u64_32_func - * 64-bit union for both 32/64 bits function aligned at 64-bit boundary. - */ -union nss_u64_32_func { - uint64_t f64; /**< 64-bit space holder: do not use. */ - void (*fp)(void*); /**< Function pointer: either 32 or 64 bits. */ -}; - -/** - * nss_profile_sdma_consumer - * DMA descriptor of consumer. - */ -struct nss_profile_sdma_consumer { - union nss_u64_32_data arg; /**< Dispatch function argument. */ - union nss_u64_32_func dispatch; /**< Dispatch function pointer. */ - union nss_u64_32_data ring; /**< DMA descriptor ring kernel address. */ - int64_t unused_lw; /**< Extra room in a Ubi32 cache line. */ -}; - -#define ARM_CACHE_LINE_SIZE 128 /**< ARM CPU cache line size in bytes. */ -#define NSS_CACHE_LINE_WORDS 8 /**< Ubi32 CPU cache line size in words. */ - -/** - * Number of DMA per control block. - */ -#define NSS_PROFILE_MAX_DMA_DESCRIPTORS (ARM_CACHE_LINE_SIZE / sizeof(struct nss_profile_sdma_producer) - 1) - -/** - * nss_profile_sdma_ctrl - * Soft DMA control block. - */ -struct nss_profile_sdma_ctrl { - int32_t num_rings; /**< Number of descriptor rings allocated, maximum is 3. */ - int32_t cur_ring; /**< Which ring is in use: Default 0. */ - int32_t pidx[NSS_PROFILE_MAX_DMA_DESCRIPTORS]; /**< Producer index. */ - - /** - * Pad for the first Ubi32 cache line in the first ARM cache line: Unused. - */ - int32_t pad_for_1st_cl_in_1st_arm_cl[NSS_CACHE_LINE_WORDS - 2 - NSS_PROFILE_MAX_DMA_DESCRIPTORS]; - struct nss_profile_sdma_producer producer[NSS_PROFILE_MAX_DMA_DESCRIPTORS]; /**< DMA producer structure. */ - - int32_t cidx[NSS_PROFILE_MAX_DMA_DESCRIPTORS]; /**< Consumer index. */ - - /** - * Pad for the first Ubi32 cache line in the second ARM cache line: Unused. - */ - int32_t pad_for_1st_cl_in_2nd_arm_cl[NSS_CACHE_LINE_WORDS - NSS_PROFILE_MAX_DMA_DESCRIPTORS]; - struct nss_profile_sdma_consumer consumer[NSS_PROFILE_MAX_DMA_DESCRIPTORS]; /**< DMA consumer structure. */ -}; - -/** - * Callback function for receiving Profiler messages. - * - * @note: Memory (buffer) pointed by npm is owned by caller, that is, NSS driver. - * - * @datatypes - * nss_profiler_msg - * - * @param[in] ctx Pointer to the context of the NSS process (core). - * @param[in] npm Pointer to the NSS Profiler message. - */ -typedef void (*nss_profiler_callback_t)(void *ctx, struct nss_profiler_msg *npm); - -/** - * nss_profiler_notify_register - * Registers the Profiler interface with the NSS driver for sending and receiving messages. - * - * This function must be called once for each core. - * - * @datatypes - * nss_core_id_t \n - * nss_profiler_callback_t - * - * @param[in] profiler_callback Callback for the data. - * @param[in] core_id NSS core ID. - * @param[in] ctx Pointer to the context of the NSS core. The context is - provided to caller in the registered callback function. - * - * @return - * Pointer to the NSS core context. - * - * @dependencies - * The caller must provide the valid core ID that is being profiled. - */ -extern void *nss_profiler_notify_register(nss_core_id_t core_id, nss_profiler_callback_t profiler_callback, void *ctx); - -/** - * nss_profiler_notify_unregister - * Deregisters the Profiler interface from the NSS driver. - * - * @datatypes - * nss_core_id_t - * - * @param[in] core_id NSS core ID. - * - * @return - * None. - * - * @dependencies - * The interface must have been previously registered. - */ -extern void nss_profiler_notify_unregister(nss_core_id_t core_id); - -/** - * nss_profiler_if_tx_buf - * Sends a Profiler command to the NSS firmware. - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] buf Buffer to send to NSS firmware. - * @param[in] len Length of the buffer. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Status of the Tx operation. - * - * @dependencies - * A valid context must be provided (for the right core). - * This context was returned during registration. - */ -extern nss_tx_status_t nss_profiler_if_tx_buf(void *nss_ctx, - void *buf, uint32_t len, void *cb, void *app_data); - -/** - * nss_profiler_alloc_dma - * Allocate profiler DMA for transmitting samples. - * - * @datatypes - * nss_ctx_instance \n - * nss_profile_sdma_producer - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] dma_p Pointer to return DMA control. - * - * @return - * Buffer adddress. - */ -extern void *nss_profiler_alloc_dma(struct nss_ctx_instance *nss_ctx, struct nss_profile_sdma_producer **dma_p); - -/** - * nss_profiler_release_dma() - * Free profiler DMA. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * None. - */ -extern void nss_profiler_release_dma(struct nss_ctx_instance *nss_ctx); - -/* - * nss_profile_dma_register_cb - * Register a handler for profile DMA. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] id DMA ID; typical value is 0. - * @param[in] cb Callback function pointer. - * @param[in] arg Callback function argument pointer. - * - * @return - * True on success; or false on failure. - */ -extern bool nss_profile_dma_register_cb(struct nss_ctx_instance *nss_ctx, int id, - void (*cb)(void*), void *arg); - -/** - * nss_profile_dma_deregister_cb() - * Deregister callback for profile DMA. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] id DMA ID; typical value is 0. - * - * @return - * True on success; or false on failure. - */ -extern bool nss_profile_dma_deregister_cb(struct nss_ctx_instance *nss_ctx, int id); - -/** - * nss_profile_dma_get_ctrl() - * API to get profile DMA control. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * DMA controller. - */ -extern struct nss_profile_sdma_ctrl *nss_profile_dma_get_ctrl(struct nss_ctx_instance *nss_ctx); - -/** - * profile_register_performance_counter - * Registers a Linux counter with the profiler for any variables. - * - * @param[in] counter Pointer to the variable address. - * @param[in] name Pointer to the variable name: if name is longer than - 23 characters, then only the first 23 bytes are used. - * - * @return - * 0 if counter array is full -- too many registered counters. - * 1 on success - */ -extern int profile_register_performance_counter(volatile unsigned int *counter, char *name); - -/** - * nss_profiler_msg_init - * Initializes a Profiler-specific message. - * - * @datatypes - * nss_profiler_msg \n - * nss_profiler_callback_t - * - * @param[in,out] npm Pointer to the NSS Profiler message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the message. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_profiler_msg_init(struct nss_profiler_msg *npm, uint16_t if_num, - uint32_t type, uint32_t len, - nss_profiler_callback_t cb, void *app_data); - -/** - * @} - */ - -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_project.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_project.h deleted file mode 100644 index 4b1b7119b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_project.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * @file nss_project.h - * NSS project interface definitions. - */ - -#ifndef __NSS_PROJECT_H -#define __NSS_PROJECT_H - -/** - * @addtogroup nss_project_subsystem - * @{ - */ - - /** - * Maximum number of IRQs for which a message will have statistics. - * - * Must be defined on firmware and host such that NSS_PROJECT_IRQS_PER_MESSAGE * - * sizeof(struct nss_project_irq_stats) + 8 + sizeof(struct nss_cmn_msg) is smaller - * than the maximum payload size of an sk_buff (1792), 8 being the number of - * bytes needed to store the thread number and number of statistics written. - */ -#define NSS_PROJECT_IRQS_PER_MESSAGE 32 - -/** - * nss_project_message_types - * Project message types. - */ -enum nss_project_message_types { - NSS_PROJECT_MSG_WT_STATS_ENABLE, - /**< Message to enable or disable worker thread statistics. */ - NSS_PROJECT_MSG_WT_STATS_NOTIFY, - /**< NSS to HLOS message containing worker thread statistics. */ - NSS_PROJECT_MSG_MAX, -}; - -/** - * nss_project_error_types - * Project error types. - */ -enum nss_project_error_types { - NSS_PROJECT_ERROR_UNKNOWN_MSG, - /**< Unrecognized message type. */ - NSS_PROJECT_ERROR_WT_STATS_UNSUPPORTED, - /**< The firmware does not support worker thread statistics. */ - NSS_PROJECT_ERROR_WT_STATS_REDUNDANT_ENABLE, - /**< The firmware received a redundant request to enable worker thread statistics. */ - NSS_PROJECT_ERROR_MAX, -}; - -/** - * nss_project_msg_wt_stats_enable - * Enables or disables worker thread statistics collection. - */ -struct nss_project_msg_wt_stats_enable { - - /* - * NSS to HLOS - */ - uint32_t worker_thread_count; - /**< Number of worker threads supported by this core. */ - uint32_t irq_count; - /**< Number of IRQs supported by this core. */ - - /* - * HLOS to NSS - */ - bool enable; /**< True to enable, false to disable. */ -}; - -/** - * nss_project_irq_stats - * Statistics for an individual IRQ on a worker thread. - */ -struct nss_project_irq_stats { - uint64_t count; /**< Number of times callback has been executed */ - uint32_t callback; /**< Address of the callback function */ - uint32_t irq; /**< IRQ number to which callback function is bound */ - uint32_t ticks_min; /**< Fewest ticks taken in callback function */ - uint32_t ticks_avg; /**< Exponential moving average of ticks */ - uint32_t ticks_max; /**< Maximum ticks */ - uint32_t insn_min; /**< Fewest instructions executed in callback function */ - uint32_t insn_avg; /**< Exponential moving average of instruction count */ - uint32_t insn_max; /**< Maximum instructions */ -}; - -/** - * nss_project_msg_wt_stats_notify - * Message containing statistics for active worker_thread IRQs. - */ -struct nss_project_msg_wt_stats_notify { - uint32_t threadno; /**< The thread whose stats are contained. */ - uint32_t stats_written; /**< The number of statistics written to the array. */ - struct nss_project_irq_stats stats[NSS_PROJECT_IRQS_PER_MESSAGE]; - /**< The per-IRQ statistics for the worker thread */ -}; - -/** - * nss_project_msg - * General message structure for project messages. - */ -struct nss_project_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a message to or from the project code. - */ - union { - struct nss_project_msg_wt_stats_enable wt_stats_enable; - /**< Enable or disable worker thread statistics. */ - struct nss_project_msg_wt_stats_notify wt_stats_notify; - /**< One-way worker thread statistics message. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving project messages. - * - * @datatypes - * nss_project_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the project message. - */ -typedef void (*nss_project_msg_callback_t)(void *app_data, struct nss_project_msg *msg); - -/** - * nss_project_register_sysctl - * Registers the project sysctl table to the sysctl tree. - * - * @return - * None. - */ -void nss_project_register_sysctl(void); - -/** - * nss_project_unregister_sysctl - * De-registers the project sysctl table from the sysctl tree. - * - * @return - * None. - * - * @dependencies - * The system control must have been previously registered. - */ -void nss_project_unregister_sysctl(void); - -/** - * nss_project_register_handler - * Registers the project message handler. - * - * @return - * None. - */ -void nss_project_register_handler(struct nss_ctx_instance *nss_ctx); - -/** - * @} - */ - -#endif /* __NSS_PROJECT_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_pvxlan.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_pvxlan.h deleted file mode 100644 index 2de0da2b5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_pvxlan.h +++ /dev/null @@ -1,371 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * @file nss_pvxlan.h - * NSS proxy VxLAN interface definitions. - */ - -#ifndef __NSS_PVXLAN_H -#define __NSS_PVXLAN_H - -/** - * @addtogroup nss_pvxlan_subsystem - * @{ - */ - -/** - * Size of the headroom required for proxy VxLAN packets. - */ -#define NSS_PVXLAN_HEADROOM 256 - -/** - * Maximum number of supported proxy VxLAN tunnel sessions. - */ -#define NSS_PVXLAN_MAX_INTERFACES 32 - -/* - * Proxy VxLAN Rule configure message flags - */ -#define NSS_PVXLAN_TUNNEL_IPV4 0x0001 /**< IPv4 tunnel. */ -#define NSS_PVXLAN_TUNNEL_IPV6 0x0002 /**< IPv6 tunnel. */ -#define NSS_PVXLAN_TUNNEL_UDP 0x0010 /**< UDP tunnel. */ -#define NSS_PVXLAN_TUNNEL_UDPLite 0x0020 /**< UDPLite tunnel. */ -#define NSS_PVXLAN_TUNNEL_ENCAP_UDPLITE_HDR_CSUM 0x0100 - /**< Generate only UDPLite header checksum. Otherwise whole UDPLite payload. */ - -/** - * nss_pvxlan_msg_type - * Proxy VxLAN message types. - */ -typedef enum nss_pvxlan_msg_type { - NSS_PVXLAN_MSG_TYPE_SYNC_STATS, /**< Statistics synchronization message. */ - NSS_PVXLAN_MSG_TYPE_TUNNEL_CREATE_RULE, /**< Creating tunnel rule. */ - NSS_PVXLAN_MSG_TYPE_TUNNEL_DESTROY_RULE, - /**< Destroying tunnel rule. */ - NSS_PVXLAN_MSG_TYPE_TUNNEL_ENABLE, /**< Enable the tunnel. */ - NSS_PVXLAN_MSG_TYPE_TUNNEL_DISABLE, /**< Disable the tunnel. */ - NSS_PVXLAN_MSG_TYPE_MAC_ADD, /**< Add MAC rule to the database. */ - NSS_PVXLAN_MSG_TYPE_MAC_DEL, /**< Remove MAC rule from the database. */ - NSS_PVXLAN_MSG_TYPE_MAX, /**< Maximum message type. */ -} nss_pvxlan_msg_type_t; - -/** - * nss_pvxlan_error_response_types - * Error types for proxy VxLAN responses to messages from the host. - */ -typedef enum nss_pvxlan_error_response_types { - NSS_PVXLAN_ERROR_UNKNOWN_TYPE = 1, /**< Unknown type error. */ - NSS_PVXLAN_ERROR_INVALID_L3_PROTO, /**< L3 Protocol is invalid error. */ - NSS_PVXLAN_ERROR_INVALID_UDP_PROTO, /**< UDP Protocol is invalid error. */ - NSS_PVXLAN_ERROR_TUNNEL_DISABLED, /**< Tunnel is already disabled error. */ - NSS_PVXLAN_ERROR_TUNNEL_ENABLED, /**< Tunnel is already enabled error. */ - NSS_PVXLAN_ERROR_TUNNEL_ENTRY_EXIST, - /**< Tunnel is already exist error. */ - NSS_PVXLAN_ERROR_TUNNEL_TABLE_FULL, - /**< Tunnel table is full error. */ - NSS_PVXLAN_ERROR_INVALID_TUNNEL_ID, /**< Tunnel ID is invalid error. */ - NSS_PVXLAN_ERROR_MAC_TABLE_FULL, /**< MAC table is full error. */ - NSS_PVXLAN_ERROR_MAC_EXIST, /**< MAC does already exist in the table error. */ - NSS_PVXLAN_ERROR_MAC_NOT_EXIST, /**< MAC does not exist in the table error. */ - NSS_PVXLAN_ERROR_MAC_ENTRY_UNHASHED, - /**< MAC entry is not hashed in table. */ - NSS_PVXLAN_ERROR_MAC_ENTRY_INSERT_FAILED, - /**< Insertion to MAC table is failed. */ - NSS_PVXLAN_ERROR_UDP_ENCAP_TUNNEL_ID_IN_USE, - /**< Given tunnel ID is currently used. */ - PVXLAN_ERROR_MSG_TUNNEL_ADD_FAILED, /**< Tunnel add information failed. */ - PVXLAN_ERROR_MSG_MAC_ENTRY_ALLOC_FAILED, - /**< MAC entry allocation failed. */ - PVXLAN_ERROR_MSG_MAC_ENTRY_DELETE_FAILED, - /**< MAC entry deletion failed. */ - NSS_PVXLAN_ERROR_MAX, /**< Maximum error type. */ -} nss_pvxlan_error_response_t; - -/** - * nss_pvxlan_stats_msg - * Per-tunnel statistics messages from the NSS firmware. - */ -struct nss_pvxlan_stats_msg { - struct nss_cmn_node_stats node_stats; /**< Common firmware statistics. */ - uint32_t mac_db_lookup_failed; /**< MAC Database look up failed. */ - uint32_t udp_encap_lookup_failed; /**< MAC Database look up failed. */ - uint32_t dropped_malformed; /**< Packet is malformed. */ - uint32_t dropped_next_node_queue_full; /**< Next node dropped the packet. */ - uint32_t dropped_hroom; /**< Transmit dropped due to insufficent headroom. */ - uint32_t dropped_ver_mis; /**< Transmit dropped due to version mismatch. */ - uint32_t dropped_zero_sized_packet; /**< Transmit dropped due to zero sized packet. */ - uint32_t dropped_pbuf_alloc_failed; /**< Receive side pbuf allocation failed. */ - uint32_t dropped_linear_failed; /**< Receive side linearization failed. */ -}; - -/** - * nss_pvxlan_ip - * IP versions. - */ -struct nss_pvxlan_ip { - /** - * Union of IPv4 and IPv6 IP addresses. - */ - union { - uint32_t ipv4; /**< IPv4 address. */ - uint32_t ipv6[4]; /**< IPv6 address. */ - } ip; /**< Union of IPv4 and IPv6 IP addresses. */ -}; - -/** - * nss_pvxlan_encap_rule - * Encapsulation information for a proxy VxLAN tunnel. - */ -struct nss_pvxlan_encap_rule { - struct nss_pvxlan_ip src; /**< Source IP. */ - uint32_t src_port; /**< Source port. */ - struct nss_pvxlan_ip dest; /**< Destination IP. */ - uint32_t dest_port; /**< Destination port. */ -}; - -/** - * nss_pvxlan_rule_msg - * Proxy VxLAN rule message. - * - * The same rule structure applies for both encapsulation and decapsulation - * in a tunnel. - */ -struct nss_pvxlan_rule_msg { - struct nss_pvxlan_encap_rule encap; /**< Encapsulation portion of the rule. */ - uint32_t tunnel_id; /**< Tunnel ID. */ - uint16_t flags; /**< Tunnel type flags. */ - int8_t rps; - /**< Receive packet steering number. Set -1 to let NSS firmware decide. */ -}; - -/** - * nss_pvxlan_tunnel_state_msg - * To enable/disable the tunnel. - */ -struct nss_pvxlan_tunnel_state_msg { - uint32_t sibling_if_num; /**< Sibling interface number. */ -}; - -/** - * nss_pvxlan_mac_msg - * Proxy VxLAN MAC message structure. - */ -struct nss_pvxlan_mac_msg { - uint16_t mac_addr[3]; /**< MAC address. */ - uint16_t flags; /**< Flags. */ - uint32_t vnet_id; /**< Virtual net ID. */ - uint32_t tunnel_id; /**< Tunnel ID. */ - uint16_t policy_id; /**< Policy ID. */ -}; - -/** - * nss_pvxlan_msg - * Data for sending and receiving proxy VxLAN messages. - */ -struct nss_pvxlan_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a proxy VxLAN common message. - */ - union { - struct nss_pvxlan_stats_msg stats; - /**< Proxy VxLAN statistics. */ - struct nss_pvxlan_rule_msg rule_cfg; - /**< Rule information. */ - struct nss_pvxlan_rule_msg rule_uncfg; - /**< Rule information. */ - struct nss_pvxlan_tunnel_state_msg enable; - /**< Enable the tunnel. */ - struct nss_pvxlan_mac_msg mac_add; - /**< MAC rule add message. */ - struct nss_pvxlan_mac_msg mac_del; - /**< MAC rule delete message. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving proxy VxLAN tunnel data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_pvxlan_buf_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving proxy VxLAN tunnel messages. - * - * @datatypes - * nss_pvxlan_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_pvxlan_msg_callback_t)(void *app_data, struct nss_pvxlan_msg *msg); - -/** - * nss_pvxlan_tx_msg - * Sends proxy VxLAN tunnel messages to the NSS. - * - * Do not call this function from a softirq or interrupt because it - * might sleep if the NSS firmware is busy serving another host thread. - * - * @datatypes - * nss_ctx_instance \n - * nss_pvxlan_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in,out] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_pvxlan_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_pvxlan_msg *msg); - -/** - * nss_pvxlan_tx_msg_sync - * Sends proxy VxLAN tunnel messages to the NSS. - * - * Do not call this function from a softirq or interrupt because it - * might sleep if the NSS firmware is busy serving another host thread. - * - * @datatypes - * nss_ctx_instance \n - * nss_pvxlan_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in,out] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_pvxlan_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_pvxlan_msg *msg); - -/** - * nss_pvxlan_tx_buf - * Sends a proxy VXLAN tunnel data buffer to the NSS interface. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] buf Pointer to the data buffer. - * @param[in] if_num NSS interface number. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_pvxlan_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *buf, uint32_t if_num); - -/** - * nss_pvxlan_unregister - * Deregisters the proxy VxLAN tunnel interface from the NSS interface. - * - * @param[in] if_num NSS interface number. - * - * @return - * TRUE or FALSE - * - * @dependencies - * The tunnel interface must have been previously registered. - */ -extern bool nss_pvxlan_unregister(uint32_t if_num); - -/** - * nss_pvxlan_register - * Registers the proxy VxLAN tunnel interface with the NSS for sending and - * receiving tunnel messages. - * - * @datatypes - * nss_pvxlan_msg_callback_t \n - * nss_pvxlan_buf_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] data_cb Data callback for the proxy VXLAN tunnel data. - * @param[in] notify_cb Notify callback for the proxy VXLAN tunnel data. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_pvxlan_register(uint32_t if_num, nss_pvxlan_buf_callback_t data_cb, - nss_pvxlan_msg_callback_t notify_cb, struct net_device *netdev, uint32_t features); - -/** - * nss_pvxlan_get_ctx - * Gets the NSS context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_pvxlan_get_ctx(void); - -/** - * nss_pvxlan_ifnum_with_core_id - * Gets the proxy VxLAN interface number with the core ID. - * - * @param[in] if_num NSS interface number. - * - * @return - * Interface number with the core ID. - */ -extern int nss_pvxlan_ifnum_with_core_id(int if_num); - -/** - * nss_pvxlan_init - * Initializes the proxy VXLAN interface. - * - * @return - * None. - */ -extern void nss_pvxlan_init(void); - -/** - * nss_pvxlan_msg_init - * Initializes a proxy VxLAN message. - * - * @datatypes - * nss_pvxlan_msg \n - * nss_pvxlan_msg_callback_t - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_pvxlan_msg_init(struct nss_pvxlan_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, - nss_pvxlan_msg_callback_t cb, void *app_data); - -/** - * @} - */ - -#endif /* __NSS_PVXLAN_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_qrfs.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_qrfs.h deleted file mode 100644 index 486baf9d4..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_qrfs.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * @file nss_qrfs.h - * NSS QRFS interface definitions. - */ - -#ifndef __NSS_QRFS_H -#define __NSS_QRFS_H - -/** - * @addtogroup nss_qrfs_subsystem - * @{ - */ - -/** - * nss_qrfs_msg_types - * Message types for the NSS QRFS. - */ -enum nss_qrfs_msg_types { - NSS_QRFS_MSG_FLOW_ADD, - NSS_QRFS_MSG_FLOW_DELETE, - NSS_QRFS_MSG_MAC_ADD, - NSS_QRFS_MSG_MAC_DELETE, - NSS_QRFS_MSG_STATS_SYNC, - NSS_QRFS_MSG_MAX, -}; - -/** - * nss_qrfs_error_types - * Error types for the NSS QRFS. - */ -enum nss_qrfs_error_types { - NSS_QRFS_ERROR_INVALID_MSG_TYPE, - NSS_QRFS_ERROR_INVALID_MSG_SIZE, - NSS_QRFS_ERROR_INVALID_IP_VERSION, - NSS_QRFS_ERROR_V4_FLOW_TABLE_FULL, - NSS_QRFS_ERROR_V6_FLOW_TABLE_FULL, - NSS_QRFS_ERROR_MAC_TABLE_FULL, - NSS_QRFS_ERROR_MAX, -}; - -/** - * nss_qrfs_flow_rule_msg - * Information for the NSS QRFS flow rule message. - */ -struct nss_qrfs_flow_rule_msg { - uint16_t src_port; /**< Source port. */ - uint16_t dst_port; /**< Destination port. */ - uint32_t ip_version; /**< IPv4:4 IPv6:6. */ - uint32_t src_addr[4]; /**< Source IP address. */ - uint32_t dst_addr[4]; /**< Destination IP address. */ - uint16_t protocol; /**< IP protocol. */ - uint16_t cpu; /**< CPU core ID. */ - uint32_t if_num; /**< Physical interface number. */ -}; - -/** - * nss_qrfs_mac_rule_msg - * Information for the NSS QRFS MAC rule message. - */ -struct nss_qrfs_mac_rule_msg { - uint8_t mac[ETH_ALEN]; /**< Ethernet address. */ - uint16_t cpu; /**< CPU core ID. */ - uint32_t if_num; /**< Physical interface number. */ -}; - -/** - * nss_qrfs_stats_sync_msg - * Information for the NSS QRFS statistics message. - */ -struct nss_qrfs_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common pnode statistics. */ - uint32_t invalid_offset; /**< Packets with invalid offset. */ - uint32_t unknown_protocol; /**< Protocol other than TCP, UDP. */ - uint32_t ipv4_flow_rule_hits; /**< Number of IPv4 flow rule hits. */ - uint32_t ipv6_flow_rule_hits; /**< Number of IPv6 flow rule hits. */ -}; - -/** - * nss_qrfs_msg - * Data for sending and receiving NSS QRFS rule or statistics messages. - */ -struct nss_qrfs_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a NSS QRFS rule or statistics message. - */ - union { - struct nss_qrfs_flow_rule_msg flow_add; /**< Add flow rule. */ - struct nss_qrfs_flow_rule_msg flow_delete; /**< Delete flow rule. */ - struct nss_qrfs_mac_rule_msg mac_add; /**< Add MAC rule. */ - struct nss_qrfs_mac_rule_msg mac_delete; /**< Delete MAC rule. */ - struct nss_qrfs_stats_sync_msg stats_sync; /**< Synchronize statistics. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving QRFS messages. - * - * @datatypes - * nss_qrfs_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_qrfs_msg_callback_t)(void *app_data, struct nss_qrfs_msg *msg); - -/** - * nss_qrfs_register_handler - * Registers the QRFS interface with the NSS for sending and receiving - * messages. - * - * @datatypes - * nss_ctx_instance - * - * @return - * None. - */ -void nss_qrfs_register_handler(struct nss_ctx_instance *nss_ctx); - -/** - * nss_qrfs_notify_register - * Registers a notifier callback for QRFS messages with the NSS. - * - * @datatypes - * nss_qrfs_msg_callback_t - * - * @param[in] core NSS core number index to the notifier callback table. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_qrfs_notify_register(int core, nss_qrfs_msg_callback_t cb, void *app_data); - -/** - * nss_qrfs_notify_unregister - * Deregisters a QRFS message notifier callback from the NSS. - * - * @param[in] core NSS core number index to the notifier callback table. - * - * @return - * None. - */ -void nss_qrfs_notify_unregister(int core); - -/** - * nss_qrfs_set_flow_rule - * Sends a QRFS message to the NSS core to set the flow rule. - * - * @datatypes - * sk_buff - * - * @param[in] skb Pointer to the SKB buffer. - * @param[in] cpu CPU number to set in the flow table. - * @param[in] action Action to perform on the flow table. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_qrfs_set_flow_rule(struct sk_buff *skb, uint32_t cpu, uint32_t action); - -/** - * nss_qrfs_init - * Initializes the QRFS. - * - * @return - * None. - */ -void nss_qrfs_init(void); - -/** - * @} - */ - -#endif /* __NSS_QRFS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_qvpn.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_qvpn.h deleted file mode 100644 index 931da43dc..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_qvpn.h +++ /dev/null @@ -1,522 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_qvpn.h - * NSS QVPN interface definitions. - */ - -#ifndef _NSS_QVPN_H_ -#define _NSS_QVPN_H_ - -/** - * @addtogroup nss_qvpn_subsystem - * @{ - */ - -#define NSS_QVPN_CMDS_MAX 10 /**< Maximum number of QVPN commands supported. */ -#define NSS_QVPN_VPN_HDR_HEAD_SIZE_MAX 64 /**< Maximum size of QVPN header. */ -#define NSS_QVPN_VPN_HDR_TAIL_SIZE_MAX 32 /**< Maximum size of QVPN tail. */ -#define NSS_QVPN_IV_SIZE_MAX 16 /**< Maximum size of IV supported. */ -#define NSS_QVPN_SESS_ID_SIZE_MAX 8 /**< Maximum size of session ID. */ - -/* - * QVPN L3/L4 header flags. - */ -#define NSS_QVPN_HDR_FLAG_IPV6 0x0001 /**< Outer L3 header is IPv6. */ -#define NSS_QVPN_HDR_FLAG_L4_UDP 0x0002 /**< L4 is UDP. */ - -/** - * nss_qvpn_msg_type - * Message types for QVPN NSS firmware. - */ -enum nss_qvpn_msg_type { - NSS_QVPN_MSG_TYPE_TUNNEL_CONFIGURE, /**< Configure QVPN tunnel instance. */ - NSS_QVPN_MSG_TYPE_TUNNEL_DECONFIGURE, /**< Deconfigure QVPN tunnel instance. */ - NSS_QVPN_MSG_TYPE_CRYPTO_KEY_ADD, /**< Add a new crypto key. */ - NSS_QVPN_MSG_TYPE_CRYPTO_KEY_DEL, /**< Delete crypto key. */ - NSS_QVPN_MSG_TYPE_CRYPTO_KEY_ACTIVATE, /**< Activate crypto key. */ - NSS_QVPN_MSG_TYPE_CRYPTO_KEY_DEACTIVATE,/**< Deactivate crypto key. */ - NSS_QVPN_MSG_TYPE_SYNC_STATS, /**< Statistics synchronization. */ - NSS_QVPN_MSG_TYPE_MAX /**< Maximum QVPN message type. */ -}; - -/** - * nss_qvpn_cmds_type - * Processing commands for QVPN. - */ -enum nss_qvpn_cmds_type { - NSS_QVPN_CMDS_TYPE_NONE, /**< Add VPN header to packet. */ - NSS_QVPN_CMDS_TYPE_ADD_VPN_HDR, /**< Add VPN header to packet. */ - NSS_QVPN_CMDS_TYPE_REMOVE_VPN_HDR, /**< Remove VPN header from packet. */ - NSS_QVPN_CMDS_TYPE_ADD_L3_L4_HDR, /**< Add L3/L4 header to packet. */ - NSS_QVPN_CMDS_TYPE_REMOVE_L3_L4_HDR, /**< Remove L3/L4 header from packet. */ - NSS_QVPN_CMDS_TYPE_ENCRYPT, /**< Send packet for encryption. */ - NSS_QVPN_CMDS_TYPE_DECRYPT, /**< Send packet for decryption. */ - NSS_QVPN_CMDS_TYPE_ANTI_REPLAY, /**< Sequence number processing. */ - NSS_QVPN_CMDS_TYPE_MAX /**< Maximum command supported. */ -}; - -/** - * nss_qvpn_profile - * QVPN profiles supported. - */ -enum nss_qvpn_profile { - NSS_QVPN_PROFILE_NONE, /**< No profile supported. */ - NSS_QVPN_PROFILE_CRYPTO_ENCAP, /**< Encapsulation profile with crypto enabled. */ - NSS_QVPN_PROFILE_CRYPTO_DECAP, /**< Decapsulation profile with crypto enabled. */ - NSS_QVPN_PROFILE_ENCAP, /**< Encapsulation Profile with crypto disabled. */ - NSS_QVPN_PROFILE_DECAP, /**< Decapsulation Profile with crypto disabled. */ - NSS_QVPN_PROFILE_MAX, /**< Maximum profile. */ -}; - -/** - * nss_qvpn_pkt_drop_event - * Packets drop statistics from QVPN node. - */ -enum nss_qvpn_pkt_drop_event { - NSS_QVPN_PKT_DROP_EVENT_NO_TAILROOM, /**< Packet tail room not enough to copy HMAC to tail. */ - NSS_QVPN_PKT_DROP_EVENT_NO_HEADROOM, /**< Packet head room not enough to add QVPN headers. */ - NSS_QVPN_PKT_DROP_EVENT_CBUF_ALLOC_FAIL, /**< Received packet dropped as crypto buffer allocation failed. */ - NSS_QVPN_PKT_DROP_EVENT_PBUF_ALLOC_FAIL, /**< Received packet dropped as associated pbuf allocation failed. */ - NSS_QVPN_PKT_DROP_EVENT_SYNC_ALLOC_FAIL, /**< Pbuf dropped while doing statistics synchronization. */ - NSS_QVPN_PKT_DROP_EVENT_PBUF_UNALIGN, /**< Received packet dropped as unaligned buffer. */ - NSS_QVPN_PKT_DROP_EVENT_CRYPTO_ENQ_FAIL, /**< Received packet dropped as crypto enqueue failed. */ - NSS_QVPN_PKT_DROP_EVENT_LINEAR_COPY_FAIL, /**< Received packet dropped as scatter-gather linear copy failed. */ - NSS_QVPN_PKT_DROP_EVENT_FWD_ENQ_FAIL, /**< Received packet dropped as enqueue to next node failed. */ - NSS_QVPN_PKT_DROP_EVENT_POST_CRYPTO_Q_FULL, /**< Post crypto queue is full dropping pbuf. */ - NSS_QVPN_PKT_DROP_EVENT_NODE_INACTIVE, /**< Node is inactive dropping crypto processed packet. */ - NSS_QVPN_PKT_DROP_EVENT_NON_CRYPTO_PB, /**< Non crypto processed packet enqueued to post crypto queue. */ - NSS_QVPN_PKT_DROP_EVENT_PAD_INVALID, /**< Packet received with invalid padding. */ - NSS_QVPN_PKT_DROP_EVENT_BLK_UNALIGNED, /**< Received pbuf length is not cipher block aligned. */ - NSS_QVPN_PKT_DROP_EVENT_MAX /**< End of packet drop event list. */ -}; - -/** - * nss_qvpn_exception_event - * Exception events from QVPN node. - */ -enum nss_qvpn_exception_event { - NSS_QVPN_EXCEPTION_EVENT_RX_CONTROL_PKT, /**< QVPN control packet received. */ - NSS_QVPN_EXCEPTION_EVENT_RX_TAIL_NOSUPP, /**< Protocol with tail not supported. */ - QVPN_TUN_EXCEPTION_EVENT_RX__HR_INSUFF, /**< Insufficient headroom. */ - NSS_QVPN_EXCEPTION_EVENT_RX_SESS_ID_INVALID, /**< Invalid session ID. */ - NSS_QVPN_EXCEPTION_EVENT_RX_DATA_PKT, /**< Data packets exceptioned to host. */ - NSS_QVPN_EXCEPTION_EVENT_RX_MALFORMED, /**< Malformed packet received. */ - NSS_QVPN_EXCEPTION_EVENT_MAX /**< End of exception event list. */ -}; - -/** - * nss_qvpn_error_type - * Error types for the QVPN interface. - */ -enum nss_qvpn_error_type { - NSS_QVPN_ERROR_TYPE_NONE, /**< No error. */ - NSS_QVPN_ERROR_TYPE_UNKNOWN_MSG, /**< Unknown message. */ - NSS_QVPN_ERROR_TUN_ALREADY_CONFIGURED, /**< Tunnel already configured. */ - NSS_QVPN_ERROR_TYPE_IF_INVALID, /**< Invalid interface. */ - NSS_QVPN_ERROR_TYPE_SIBLING_IF, /**< Invalid sibling interface number. */ - NSS_QVPN_ERROR_TYPE_IV_SIZE_INVALID, /**< Invalid IV size. */ - NSS_QVPN_ERROR_TYPE_HMAC_SIZE_INVALID, /**< Invalid HMAC size. */ - NSS_QVPN_ERROR_TYPE_CRYPTO_BLK_SIZE_INVALID, /**< Invalid crypto block size. */ - NSS_QVPN_ERROR_TYPE_SESSION_IDX_SIZE_INVALID, /**< Invalid session index size. */ - NSS_QVPN_ERROR_TYPE_CMD_NOT_SUPPORTED, /**< Command not supported. */ - NSS_QVPN_ERROR_TYPE_L4_PROTO_INVALID, /**< L4 protocol encapsulation is not supported. */ - NSS_QVPN_ERROR_TYPE_SIBLING_IF_TYPE, /**< Invalid sibling interface type. */ - NSS_QVPN_ERROR_TYPE_CMDS_COUNT_INVALID, /**< Total number of commands is invalid. */ - NSS_QVPN_ERROR_TYPE_ENTRY_NOT_FOUND, /**< Entry not found. */ - NSS_QVPN_ERROR_TYPE_ENTRY_NOT_ACTIVE, /**< Entry not active. */ - NSS_QVPN_ERROR_TYPE_ENTRY_ALREADY_ACTIVE, /**< Entry already active. */ - NSS_QVPN_ERROR_TYPE_CRYPTO_IDX_MISMATCH, /**< Invalid crypto index. */ - NSS_QVPN_ERROR_TYPE_KI_ALLOC_FAIL, /**< Key information allocation failure. */ - NSS_QVPN_ERROR_TYPE_PROFILE_INVALID, /**< Invalid command profile. */ - NSS_QVPN_ERROR_TYPE_RX_TAIL_NOSUPP, /**< VPN with tail not supported. */ - NSS_QVPN_ERROR_TYPE_MAX /**< End of error list. */ -}; - -/** - * nss_qvpn_iv_type - * IV type for generating and copying in packet. - */ -enum nss_qvpn_iv_type { - NSS_QVPN_IV_TYPE_NONE, /**< No IV. */ - NSS_QVPN_IV_TYPE_STATIC, /**< Use static IV configured. */ - NSS_QVPN_IV_TYPE_DYNAMIC_RAND, /**< Generate IV randomly. */ - NSS_QVPN_IV_TYPE_MAX /**< End of IV type list. */ -}; - -/** - * nss_qvpn_pad_type - * Pad type for generating and copying in packet. - */ -enum nss_qvpn_pad_type { - NSS_QVPN_PAD_TYPE_NONE, /**< No padding. */ - NSS_QVPN_PAD_TYPE_PKCS7, /**< Generate pad buffer using PKCS7. */ - NSS_QVPN_PAD_TYPE_INC, /**< Generate pad buffer monotonically increasing sequence. */ - NSS_QVPN_PAD_TYPE_MAX /**< End of pad type. */ -}; - -/** - * nss_qvpn_anti_replay_alg - * Anti-replay algorithms supported. - */ -enum nss_qvpn_anti_replay_alg { - NSS_QVPN_ANTI_REPLAY_ALG_NONE, /**< No anti-replay. */ - NSS_QVPN_ANTI_REPLAY_ALG_REPLAY_WINDOW, /**< Generate pad buffer monotonically increasing sequence. */ - NSS_QVPN_ANTI_REPLAY_ALG_MAX /**< End of anti-replay algorithm. */ -}; - -/** - * nss_qvpn_crypto_mode - * Crypto modes supported. - */ -enum nss_qvpn_crypto_mode { - NSS_QVPN_CRYPTO_MODE_NONE, /**< NULL cipher and NULL authentication. */ - NSS_QVPN_CRYPTO_MODE_ENC, /**< Encryption only. */ - NSS_QVPN_CRYPTO_MODE_DEC, /**< Decryption only. */ - NSS_QVPN_CRYPTO_MODE_AUTH, /**< Authentication only. */ - NSS_QVPN_CRYPTO_MODE_ENC_AUTH, /**< Encryption and then authentication. */ - NSS_QVPN_CRYPTO_MODE_AUTH_DEC, /**< Authentication and then decryption. */ - NSS_QVPN_CRYPTO_MODE_AUTH_ENC, /**< Authentication and then encryption. */ - NSS_QVPN_CRYPTO_MODE_DEC_AUTH, /**< Decryption and then authentication. */ - NSS_QVPN_CRYPTO_MODE_MAX /**< End of crypto mode. */ -}; - -/** - * nss_qvpn_hdr_configure_msg - * QVPN header configuration. - */ -struct nss_qvpn_hdr_configure_msg { - uint32_t src_ip[4]; /**< Source IP address. */ - uint32_t dst_ip[4]; /**< Destination IP address. */ - uint16_t src_port; /**< Source port. */ - uint16_t dst_port; /**< Destination port. */ - uint16_t hdr_flags; /**< Header flags. */ - uint16_t seqnum_size; /**< Size of sequence number. */ - uint16_t seqnum_offset; /**< Sequence number offset. */ - uint16_t anti_replay_alg; /**< Anti-replay algorithm. */ - uint16_t session_id_size; /**< Session ID size. */ - uint16_t session_id_offset; /**< Session ID offset. */ - uint16_t vpn_hdr_head_size; /**< VPN header size. */ - uint16_t vpn_hdr_head_offset; /**< VPN header offset. */ - uint16_t vpn_hdr_tail_size; /**< Size of tail. */ - uint16_t res; /**< Reserved for alignment. */ - uint8_t vpn_hdr_head[NSS_QVPN_VPN_HDR_HEAD_SIZE_MAX]; /**< Content of VPN header. */ - uint8_t vpn_hdr_tail[NSS_QVPN_VPN_HDR_TAIL_SIZE_MAX]; /**< VPN header tail content. */ - uint8_t hop_limit; /**< TTL or hop limit. */ - uint8_t res1[3]; /**< Reserved for alignment. */ -}; - -/** - * nss_qvpn_crypto_configure_msg - * QVPN crypto configuration message. - */ -struct nss_qvpn_crypto_configure_msg { - uint16_t hmac_len; /**< Length of HMAC to copy. */ - uint16_t hmac_offset; /**< Offset to copy HMAC. */ - uint16_t auth_offset; /**< Data offset to start authentication. */ - uint16_t cipher_op_offset; /**< Start of cipher data. */ - uint16_t cipher_blk_size; /**< Cipher block size. */ - uint16_t pad_type; /**< Pad algorithm. */ - uint16_t crypto_mode; /**< Crypto mode. */ - uint16_t iv_len; /**< Length of IV. */ - uint16_t iv_offset; /**< IV offset. */ - uint16_t iv_type; /**< IV generation algorithm. */ - uint8_t iv_val[NSS_QVPN_IV_SIZE_MAX]; /**< IV to be used. */ -}; - -/** - * nss_qvpn_crypto_key_add_msg - * QVPN key add message. - */ -struct nss_qvpn_crypto_key_add_msg { - uint32_t crypto_idx; /**< Crypto session ID. */ - uint8_t session_id[NSS_QVPN_SESS_ID_SIZE_MAX]; /**< Session ID. */ -}; - -/** - * nss_qvpn_crypto_key_del_msg - * Delete/Deactivate key message. - */ -struct nss_qvpn_crypto_key_del_msg { - uint32_t crypto_idx; /**< Crypto index to delete/deactivate. */ -}; - -/** - * nss_qvpn_tunnel_config_msg - * QVPN tunnel configure message. - */ -struct nss_qvpn_tunnel_config_msg { - uint32_t sibling_if; /**< Sibling interface number. */ - uint16_t total_cmds; /**< Total number of commands. */ - uint16_t cmd_profile; /**< Command processing profile. */ - uint16_t cmd[NSS_QVPN_CMDS_MAX]; /**< Commands to execute. */ - struct nss_qvpn_crypto_key_add_msg crypto_key; /**< Initial crypto key. */ - struct nss_qvpn_hdr_configure_msg hdr_cfg; /**< VPN header configuration. */ - struct nss_qvpn_crypto_configure_msg crypto_cfg; /**< Crypto configuration. */ -}; - -/** - * nss_qvpn_crypto_key_activate_msg - * Activate key message. - */ -struct nss_qvpn_crypto_key_activate_msg { - uint32_t crypto_idx; /**< Crypto session ID. */ - uint8_t vpn_hdr_head[NSS_QVPN_VPN_HDR_HEAD_SIZE_MAX]; /**< Content of VPN header. */ -}; - -/** - * nss_qvpn_stats_sync_msg - * Message information for QVPN synchronization statistics. - */ -struct nss_qvpn_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t crypto_resp_error[NSS_CRYPTO_CMN_RESP_ERROR_MAX]; /**< Crypto response errors. */ - uint32_t pkt_drop_event[NSS_QVPN_PKT_DROP_EVENT_MAX]; /**< Packet drop events. */ - uint32_t exception_event[NSS_QVPN_EXCEPTION_EVENT_MAX]; /**< QVPN exception events. */ -}; - -/** - * nss_qvpn_stats_notification - * QVPN transmission statistics structure. - */ -struct nss_qvpn_stats_notification { - uint64_t stats_ctx[NSS_STATS_NODE_MAX]; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_qvpn_msg - * QVPN message structure for configuration and statistics. - */ -struct nss_qvpn_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /**< QVPN configuration messages. */ - union { - struct nss_qvpn_tunnel_config_msg tunnel_config; /**< QVPN tunnel configure message. */ - struct nss_qvpn_crypto_key_add_msg key_add; /**< Crypto key add message. */ - struct nss_qvpn_crypto_key_del_msg key_del; /**< Crypto key delete message. */ - struct nss_qvpn_crypto_key_activate_msg key_activate; /**< Crypto key active message. */ - struct nss_qvpn_stats_sync_msg stats; /**< QVPN statistics synchronization message. */ - } msg; /**< QVPN configuration message. */ -}; - -/** - * nss_qvpn_tx_msg - * Sends an QVPN message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_qvpn_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_qvpn_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_qvpn_msg *msg); - -/** - * nss_qvpn_tx_msg_sync - * Sends an QVPN message to the NSS synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_qvpn_msg \n - * nss_qvpn_msg_type \n - * nss_qvpn_error_type - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] nvm Pointer to the message data. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in,out] resp Response for the configuration. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_qvpn_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_qvpn_msg *nvm, - uint32_t if_num, enum nss_qvpn_msg_type type, uint16_t len, - enum nss_qvpn_error_type *resp); - -/** - * nss_qvpn_tx_buf - * Sends data packet for QVPN encapsulation/decapsulation. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] if_num NSS interface number. - * @param[in] skb Pointer to sk_buff. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_qvpn_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb); - -/** - * nss_qvpn_msg_init - * Initializes an QVPN message. - * - * @datatypes - * nss_qvpn_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -void nss_qvpn_msg_init(struct nss_qvpn_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_qvpn_get_context - * Gets the QVPN context used in nss_qvpn_tx. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_qvpn_get_context(void); - -/** - * Callback when QVPN data is received. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_qvpn_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback to receive QVPN messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_qvpn_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_qvpn_unregister_if - * Deregisters the QVPN interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -void nss_qvpn_unregister_if(uint32_t if_num); - -/** - * nss_qvpn_register_if - * Register to send/receive QVPN messages to NSS. - * - * @datatypes - * nss_qvpn_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] qvpn_data_callback Callback for the data. - * @param[in] qvpn_event_callback Callback for receiving events. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * @param[in] app_ctx Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_qvpn_register_if(uint32_t if_num, nss_qvpn_callback_t qvpn_data_callback, - nss_qvpn_msg_callback_t qvpn_event_callback, struct net_device *netdev, - uint32_t features, void *app_ctx); - -/** - * nss_qvpn_ifnum_with_core_id - * Gets the QVPN interface number with the core ID. - * - * @param[in] if_num NSS interface number. - * - * @return - * Interface number with the core ID. - */ -int nss_qvpn_ifnum_with_core_id(int if_num); - -/** - * nss_qvpn_register_handler - * Registers the QVPN handler with the NSS. - * - * @return - * None. - */ -void nss_qvpn_register_handler(void); - -/** - * nss_qvpn_ifmap_get - * Returns active QVPN interfaces. - * - * @return - * Pointer to interface map. - */ -unsigned long *nss_qvpn_ifmap_get(void); - -/** - * nss_qvpn_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_qvpn_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_qvpn_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_qvpn_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* _NSS_QVPN_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_rmnet_rx.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_rmnet_rx.h deleted file mode 100644 index 2b7e7156e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_rmnet_rx.h +++ /dev/null @@ -1,392 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * @file nss_rmnet_rx.h - * NSS RMNET interface message Structure and APIs - */ - -#ifndef __NSS_RMNET_RX_H -#define __NSS_RMNET_RX_H - -#include "nss_if.h" - -/** - * @addtogroup nss_rmnet_subsystem - * @{ - */ - -/** - * Maximum number of DMA channel. - */ -#define NSS_RMNET_RX_CHANNEL_MAX 12 - -/** - * nss_rmnet_rx_dp_type - * Interface datapath types. NSS-to-host path will be seen by ECM for rules. - */ -enum nss_rmnet_rx_dp_type { - NSS_RMNET_RX_DP_N2H, /**< Interface on NSS-to-host path has zero value. */ - NSS_RMNET_RX_DP_H2N, /**< Interface on host-to-NSS path has non-zero value. */ -}; - -/** - * nss_rmnet_rx_msg_types - * Message types for interface requests and responses. - */ -enum nss_rmnet_rx_msg_types { - NSS_RMNET_RX_TX_CONFIG_MSG = NSS_IF_MAX_MSG_TYPES + 1, - /**< Configuration message. */ - NSS_RMNET_RX_STATS_SYNC_MSG, /**< Statistic synchronization message. */ - NSS_RMNET_RX_MAX_MSG_TYPES, /**< Maximum message type. */ -}; - -/** - * nss_rmnet_rx_error_types - * Error types for the RMNET interface. - */ -enum nss_rmnet_rx_error_types { - NSS_RMNET_RX_SUCCESS, /**< No error. */ - NSS_RMNET_RX_ERROR_TYPE_MSG_UNKNOWN, /**< Unknown message type. */ - NSS_RMNET_RX_ERROR_TYPE_ALREADY_CONFIGURED, /**< Tunnel is already configured. */ - NSS_RMNET_RX_ERROR_TYPE_SIBLING_NOTFOUND, /**< Sibling interface is not found. */ - NSS_RMNET_RX_ERROR_TYPE_NEXTHOP_NOTFOUND, /**< Next hop is not found. */ - NSS_RMNET_RX_ERROR_TYPE_SIBLING_MISMATCH, /**< Sibling interface type mismatches. */ - NSS_RMNET_RX_ERROR_TYPE_DMA_CHANNEL_FAIL, /**< DMA Channel allocation failed. */ - NSS_RMNET_RX_ERROR_TYPE_RMNET_INVALID, /**< Interface type is invalid. */ - NSS_RMNET_RX_ERROR_TYPE_SHAPER_INVALID, /**< Shaper is invalid. */ - NSS_RMNET_RX_REG_FAILURE, /**< Registration failed. */ - NSS_RMNET_RX_ALLOC_FAILURE, /**< Memory allocation failed. */ - NSS_RMNET_RX_ERROR_MAX, /**< Maximum error type. */ -}; - -/** - * nss_rmnet_rx_pvt - * Private data information for the interface. - */ -struct nss_rmnet_rx_pvt { - struct semaphore sem; - /**< Semaphore to ensure that only one instance of a message is sent to the NSS. */ - struct completion complete; - /**< Waits for message completion or time out. */ - int response; /**< Message process response from the NSS firmware. */ - int sem_init_done; /**< Semaphore initialization is done. */ -}; - -/** - * nss_rmnet_rx_config_msg - * Message information for configuring the interface. - */ -struct nss_rmnet_rx_config_msg { - uint32_t flags; /**< Interface flags. */ - uint32_t sibling; /**< Sibling interface number. */ - uint32_t nexthop; /**< Next hop interface number. */ - uint32_t no_channel; /**< Number of channels. */ -}; - -/** - * nss_rmnet_rx_stats - * Interface statistics received from the NSS. - */ -struct nss_rmnet_rx_stats { - struct nss_cmn_node_stats node_stats; - /**< Common statistics. */ - uint32_t enqueue_failed; /**< Enqueue to next node is failed. */ - uint32_t no_avail_channel; /**< No available DMA channel. */ - uint32_t num_linear_pbuf; /**< Number of linear pbufs. */ - uint32_t no_pbuf_to_linear; /**< No pbuf to linearize. */ - uint32_t no_enough_room; /**< Not enough headroom to linearize the pbuf. */ - uint32_t using_channel[NSS_RMNET_RX_CHANNEL_MAX]; - /**< How many times a channel is used. */ - uint32_t dma_failed; /**< DMA copy call failed. */ -}; - - -/** - * nss_rmnet_rx_msg - * Data for sending and receiving interface messages. - */ -struct nss_rmnet_rx_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of an RMNET interface message. - */ - union { - struct nss_rmnet_rx_config_msg if_config; - /**< Rule for creating an RMNET interface. */ - struct nss_rmnet_rx_stats stats; - /**< RMNET interface statistics. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback to transmit interface data received from NSS - * to the transmit path of the RMNET interface. - * - * @datatypes - * net_device \n - * sk_buff - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - */ -typedef void (*nss_rmnet_rx_xmit_callback_t)(struct net_device *netdev, struct sk_buff *skb); - -/** - * Callback function for interface data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_rmnet_rx_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for interface messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_rmnet_rx_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_rmnet_rx_handle - * Context information for NSS communication. - */ -struct nss_rmnet_rx_handle { - struct nss_ctx_instance *nss_ctx; /**< NSS context. */ - int32_t if_num_n2h; /**< Redirect interface number on NSS-to-host path. */ - int32_t if_num_h2n; /**< Redirect interface number on host-to-NSS path. */ - struct net_device *ndev; /**< Associated network device. */ - struct nss_rmnet_rx_pvt *pvt; /**< Private data structure. */ - uint64_t *stats_n2h; /**< RMNET interface statistics from NSS-to-host. */ - uint64_t *stats_h2n; /**< RMNET interface statistics from host-to-NSS. */ - atomic_t refcnt; /**< Reference count. */ - nss_rmnet_rx_msg_callback_t cb; /**< Message callback. */ - void *app_data; /**< Application data to be passed to the callback. */ -}; - -/** - * nss_rmnet_rx_destroy_sync - * Destroys the RMNET interface synchronously. - * - * @datatypes - * nss_rmnet_rx_handle - * - * @param[in,out] handle Pointer to the RMNET interface handle (provided during - * dynamic interface allocation). - * - * @return - * Status of the Tx operation. - * - * @dependencies - * The interface must have been previously created. - */ -extern nss_tx_status_t nss_rmnet_rx_destroy_sync(struct nss_rmnet_rx_handle *handle); - -/** - * nss_rmnet_rx_create_sync_nexthop - * Creates an RMNET interface synchronously with specified nexthops. - * - * @datatypes - * net_device - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] nexthop_n2h Nexthop interface number of NSS-to-host dynamic interface. - * @param[in] nexthop_h2n Nexthop interface number of host-to-NSS dynamic interface. - * - * @return - * Pointer to the NSS RMNET interface handle. - */ -extern struct nss_rmnet_rx_handle *nss_rmnet_rx_create_sync_nexthop(struct net_device *netdev, uint32_t nexthop_n2h, uint32_t nexthop_h2n); - -/** - * nss_rmnet_rx_create - * Creates an RMNET interface synchronously with generic nexthops. - * - * @datatypes - * net_device - * - * @param[in] netdev Pointer to the associated network device. - * - * @return - * Pointer to the NSS RMNET interface handle. - */ -extern struct nss_rmnet_rx_handle *nss_rmnet_rx_create(struct net_device *netdev); - -/** - * nss_rmnet_rx_tx_buf - * Forwards RMNET interface packets to the NSS. - * - * @datatypes - * nss_rmnet_rx_handle \n - * sk_buff - * - * @param[in,out] handle Pointer to the RMNET interface handle (provided during - * registration). - * @param[in] skb Pointer to the data socket buffer. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_rmnet_rx_tx_buf(struct nss_rmnet_rx_handle *handle, - struct sk_buff *skb); - -/** - * nss_rmnet_rx_tx_msg - * Sends a message to the RMNET interface. - * - * @datatypes - * nss_ctx_instance \n - * nss_rmnet_rx_msg - * - * @param[in] nss_ctx Pointer to the NSS context (provided during registration). - * @param[in] nvim Pointer to the RMNET interface message. - * - * @return - * Command Tx status. - */ -extern nss_tx_status_t nss_rmnet_rx_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_rmnet_rx_msg *nvim); - -/** - * nss_rmnet_rx_xmit_callback_unregister - * Deregisters the transmit callback from the RMNET interface. - * - * @datatypes - * nss_rmnet_rx_handle - * - * @param[in,out] handle Pointer to the RMNET interface handle. - * - * @return - * None. - */ -extern void nss_rmnet_rx_xmit_callback_unregister(struct nss_rmnet_rx_handle *handle); - -/** - * nss_rmnet_rx_xmit_callback_register - * Registers a transmit callback to an RMNET interface. - * - * @datatypes - * nss_rmnet_rx_handle \n - * nss_rmnet_rx_xmit_callback_t - * - * @param[in,out] handle Pointer to the RMNET interface handle (provided during - * dynamic interface allocation). - * @param[in] cb Callback handler for RMNET data packets. - * - * @return - * None. - */ -extern void nss_rmnet_rx_xmit_callback_register(struct nss_rmnet_rx_handle *handle, - nss_rmnet_rx_xmit_callback_t cb); - -/** - * nss_rmnet_rx_unregister - * Deregisters an RMNET interface from the NSS driver. - * - * @datatypes - * nss_rmnet_rx_handle - * - * @param[in,out] handle Pointer to the RMNET interface handle. - * - * @return - * None. - */ -extern void nss_rmnet_rx_unregister(struct nss_rmnet_rx_handle *handle); - -/** - * nss_rmnet_rx_register - * Registers an RMNET Interface with NSS driver. - * - * @datatypes - * nss_rmnet_rx_handle \n - * nss_rmnet_rx_data_callback_t \n - * net_device - * - * @param[in,out] handle Pointer to the RMNET interface handle (provided during - * dynamic interface allocation). - * @param[in] data_callback Callback handler for RMNET data packets. - * @param[in] netdev Pointer to the associated network device. - * - * @return - * Status of the Tx operation. - */ -extern void nss_rmnet_rx_register(struct nss_rmnet_rx_handle *handle, - nss_rmnet_rx_data_callback_t data_callback, - struct net_device *netdev); - -/** - * nss_rmnet_rx_get_ifnum_with_coreid - * Returns the interface number with the core ID. - * - * @param[in] if_num NSS interface number - * - * @return - * Interface number with the core ID. - */ -extern int32_t nss_rmnet_rx_get_ifnum_with_core_id(int32_t if_num); - -/** - * nss_rmnet_rx_get_ifnum - * Returns the interface number with appending core ID. - * - * @param[in] dev Net device - * - * @return - * Interface number with the core ID. - */ -extern int32_t nss_rmnet_rx_get_ifnum(struct net_device *dev); - -/** - * nss_rmnet_rx_get_interface_num - * Returns the RMNET interface number associated with the handle. - * - * @datatypes - * nss_rmnet_rx_handle - * - * @param[in] handle Pointer to the RMNET interface handle (provided during - dynamic interface allocation). - * - * @return - * RMNET interface number. - */ -extern int32_t nss_rmnet_rx_get_interface_num(struct nss_rmnet_rx_handle *handle); - -/** - * nss_rmnet_rx_get_context - * Gets the RMNET interface context. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_rmnet_rx_get_context(void); - -/** - * @} - */ - -#endif /* __NSS_RMNET_RX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_rps.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_rps.h deleted file mode 100644 index 213604ea3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_rps.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_rps.h - * RPS related definitions. - */ - -#ifndef __NSS_RPS_H -#define __NSS_RPS_H - -/** - * @addtogroup nss_rps_subsystem - * @{ - */ - -/** - * nss_rps_register_sysctl - * Registers the RPS sysctl entries to the sysctl tree. - * - * @return - * None. - */ -extern void nss_rps_register_sysctl(void); - -/** - * nss_rps_unregister_sysctl - * Deregisters the RPS sysctl entries from the sysctl tree. - * - * @return - * None. - * - * @dependencies - * The system control must have been previously registered. - */ -extern void nss_rps_unregister_sysctl(void); - -/** - * @} - */ - -#endif /* __NSS_RPS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_shaper.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_shaper.h deleted file mode 100644 index fbb0415ae..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_shaper.h +++ /dev/null @@ -1,901 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014, 2017-2018 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_shaper.h - * NSS Shaper definitions - */ - -#ifndef __NSS_SHAPER_H -#define __NSS_SHAPER_H - -/** - * @addtogroup nss_shaper_subsystem - * @{ - */ - -/** - * nss_shaper_node_types - * Types of shaper nodes that are exported to the HLOS. - */ -enum nss_shaper_node_types { - NSS_SHAPER_NODE_TYPE_CODEL = 1, - NSS_SHAPER_NODE_TYPE_PRIO = 3, - NSS_SHAPER_NODE_TYPE_FIFO = 4, - NSS_SHAPER_NODE_TYPE_TBL = 5, - NSS_SHAPER_NODE_TYPE_BF = 6, - NSS_SHAPER_NODE_TYPE_BF_GROUP = 7, - NSS_SHAPER_NODE_TYPE_WRR = 9, - NSS_SHAPER_NODE_TYPE_WRR_GROUP = 10, - NSS_SHAPER_NODE_TYPE_HTB = 11, - NSS_SHAPER_NODE_TYPE_HTB_GROUP = 12, - NSS_SHAPER_NODE_TYPE_WRED = 13, - NSS_SHAPER_NODE_TYPE_PPE_SN = 14, - NSS_SHAPER_NODE_TYPE_MAX, -}; - -typedef enum nss_shaper_node_types nss_shaper_node_type_t; - /**< Types of shaper nodes that are exported to the HLOS. */ - -/** - * nss_shaper_config_types - * Types of shaper configuration messages. - */ -enum nss_shaper_config_types { - NSS_SHAPER_CONFIG_TYPE_ALLOC_SHAPER_NODE, - NSS_SHAPER_CONFIG_TYPE_FREE_SHAPER_NODE, - NSS_SHAPER_CONFIG_TYPE_SET_DEFAULT, - NSS_SHAPER_CONFIG_TYPE_SET_ROOT, - NSS_SHAPER_CONFIG_TYPE_SHAPER_NODE_BASIC_STATS_GET, - NSS_SHAPER_CONFIG_TYPE_SHAPER_NODE_ATTACH, - NSS_SHAPER_CONFIG_TYPE_SHAPER_NODE_DETACH, - NSS_SHAPER_CONFIG_TYPE_SHAPER_NODE_CHANGE_PARAM, - NSS_SHAPER_CONFIG_TYPE_HYBRID_MODE_ENABLE, - NSS_SHAPER_CONFIG_TYPE_HYBRID_MODE_DISABLE, - NSS_SHAPER_CONFIG_TYPE_SHAPER_NODE_MEM_REQ, -}; - -typedef enum nss_shaper_config_types nss_shaper_config_type_t; - /**< Types of shaper configuration messages. */ - -/** - * nss_shaper_response_types - * Types of shaper configuration responses. - */ -enum nss_shaper_response_types { - NSS_SHAPER_RESPONSE_TYPE_SUCCESS, - NSS_SHAPER_RESPONSE_TYPE_NO_SHAPER_NODE, - NSS_SHAPER_RESPONSE_TYPE_NO_SHAPER_NODES, - NSS_SHAPER_RESPONSE_TYPE_OLD, - NSS_SHAPER_RESPONSE_TYPE_UNRECOGNISED, - NSS_SHAPER_RESPONSE_TYPE_BAD_DEFAULT_CHOICE, - NSS_SHAPER_RESPONSE_TYPE_DUPLICATE_QOS_TAG, - NSS_SHAPER_RESPONSE_TYPE_TBL_CIR_RATE_AND_BURST_REQUIRED, - NSS_SHAPER_RESPONSE_TYPE_TBL_CIR_BURST_LESS_THAN_MTU, - NSS_SHAPER_RESPONSE_TYPE_CODEL_ALL_PARAMS_REQUIRED, - NSS_SHAPER_RESPONSE_TYPE_BF_GROUP_RATE_AND_BURST_REQUIRED, - NSS_SHAPER_RESPONSE_TYPE_BF_GROUP_BURST_LESS_THAN_MTU, - NSS_SHAPER_RESPONSE_TYPE_CHILD_NOT_BF_GROUP, - NSS_SHAPER_RESPONSE_TYPE_WRR_GROUP_INVALID_QUANTUM, - NSS_SHAPER_RESPONSE_TYPE_CHILD_NOT_WRR_GROUP, - NSS_SHAPER_RESPONSE_TYPE_WRR_INVALID_OPERATION_MODE, - NSS_SHAPER_RESPONSE_TYPE_HTB_GROUP_BURST_LESS_THAN_MTU, - NSS_SHAPER_RESPONSE_TYPE_HTB_GROUP_PRIORITY_OUT_OF_RANGE, - NSS_SHAPER_RESPONSE_TYPE_CHILDREN_BELONG_TO_MIXED_TYPES, - NSS_SHAPER_RESPONSE_TYPE_CHILD_ALREADY_PRESENT, - NSS_SHAPER_RESPONSE_TYPE_CHILD_MISMATCH, - NSS_SHAPER_RESPONSE_TYPE_CHILD_UNSUPPORTED, - NSS_SHAPER_RESPONSE_TYPE_CHILD_NOT_FOUND, - NSS_SHAPER_RESPONSE_TYPE_ATTACH_FAIL, - NSS_SHAPER_RESPONSE_TYPE_WRED_WEIGHT_MODE_INVALID, - NSS_SHAPER_RESPONSE_TYPE_PPE_SN_UCAST_BASE_OFFSET_INVALID, - NSS_SHAPER_RESPONSE_TYPE_PPE_SN_MCAST_BASE_OFFSET_INVALID, - NSS_SHAPER_RESPONSE_TYPE_PPE_SN_UCAST_QUEUE_ALLOC_FAILED, - NSS_SHAPER_RESPONSE_TYPE_PPE_SN_MCAST_QUEUE_ALLOC_FAILED, - NSS_SHAPER_RESPONSE_TYPE_PPE_SN_INVALID_LIMIT, - NSS_SHAPER_RESPONSE_TYPE_PPE_SN_UCAST_QUEUE_CHANGED, - NSS_SHAPER_RESPONSE_TYPE_PPE_SN_MCAST_QUEUE_CHANGED, - NSS_SHAPER_RESPONSE_TYPE_CODEL_FQ_MEM_INSUFFICIENT, - NSS_SHAPER_RESPONSE_TYPE_CODEL_FQ_COUNT_CHANGE_NOT_ALLOWED, - NSS_SHAPER_RESPONSE_TYPE_CODEL_FQ_COUNT_INVALID, - NSS_SHAPER_RESPONSE_TYPE_CODEL_MODE_CHANGE_NOT_ALLOWED, -}; - -typedef enum nss_shaper_response_types nss_shaper_response_type_t; - /**< Types of shaper configuration responses. */ - -/** - * nss_shaper_config_alloc_shaper_node - * Message information for allocating a shaper node for a NSS interface. - */ -struct nss_shaper_config_alloc_shaper_node { - nss_shaper_node_type_t node_type; /**< Type of shaper node. */ - uint32_t qos_tag; /**< QoS tag of the node. */ -}; - -/** - * nss_shaper_config_free_shaper_node - * Message information for freeing a shaper node from a NSS interface. - */ -struct nss_shaper_config_free_shaper_node { - uint32_t qos_tag; /**< QoS tag of the node. */ -}; - -/** - * nss_shaper_config_set_root_node - * Message information for setting a shaper node as the root. - */ -struct nss_shaper_config_set_root_node { - uint32_t qos_tag; /**< QoS tag of the node. */ -}; - -/** - * nss_shaper_config_set_default_node - * Message information for setting a shaper node as the default node for enqueueing. - */ -struct nss_shaper_config_set_default_node { - uint32_t qos_tag; /**< QoS tag of the node. */ -}; - -/** - * nss_shaper_config_set_hybrid_mode - * Message information for setting a shaper to operate in hybrid mode. - */ -struct nss_shaper_config_set_hybrid_mode { - uint32_t offset; /**< Queue offset for packets sent to the hardware. */ -}; - -/** - * nss_shaper_config_prio_attach - * Message information for attaching a shaper node to a PRIO shaper node. - */ -struct nss_shaper_config_prio_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ - uint32_t priority; /**< Priority of the child shaper node. */ -}; - -/** - * nss_shaper_config_prio_detach - * Message information for detaching a shaper node from a PRIO shaper node. - */ -struct nss_shaper_config_prio_detach { - uint32_t priority; /**< Priority of the child shaper node. */ -}; - -/** - * nss_shaper_config_codel_alg_param - * Message information for configuring a CoDel algorithm. - */ -struct nss_shaper_config_codel_alg_param { - uint16_t interval; /**< Buffer time to smooth a state transition. */ - uint16_t target; /**< Acceptable delay associated with a queue. */ - uint16_t mtu; /**< MTU for the associated interface. */ - uint16_t reserved; /**< Alignment padding. */ -}; - -/** - * nss_shaper_config_codel_param - * Message information for configuring a CoDel shaper node. - */ -struct nss_shaper_config_codel_param { - int32_t qlen_max; /**< Maximum number of packets that can be enqueued. */ - struct nss_shaper_config_codel_alg_param cap; - /**< Configuration for the CoDel algorithm. */ - uint32_t flows; /**< Number of flow hash buckets. */ - uint32_t flows_mem; /**< Host allocated memory for flow queues. */ - uint32_t flows_mem_sz; /**< Memory size allocated for flow queues. */ - uint32_t quantum; /**< Quantum (in bytes) to round-robin the flow buckets. */ - uint32_t ecn; /**< 0 - ECN disabled, 1 - ECN enabled. */ -}; - -/** - * nss_shaper_config_codel_mem_req - * Message to get CoDel memory requirement per flow queue (needed for fq_codel). - */ -struct nss_shaper_config_codel_mem_req { - uint32_t mem_req; /**< Memory needed per flow queue (in bytes). */ -}; - -/** - * nss_shaper_config_rate_param - * Message information for configuring the rate limiter algorithm. - */ -struct nss_shaper_config_rate_param { - uint32_t rate; - /**< Allowed traffic rate measured in bytes per second. */ - uint32_t burst; - /**< Maximum bytes that can be sent in a burst. */ - uint32_t max_size; - /**< Maximum size of the supported packets (in bytes). */ - - /** - * Specifies whether the rate limiter will be bypassed (short circuited). - */ - bool short_circuit; -}; - -/** - * nss_shaper_configure_tbl_attach - * Message information for attaching a shaper node to a TBL shaper node. - */ -struct nss_shaper_config_tbl_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_configure_tbl_param - * Message information for detaching a shaper node from a TBL shaper node. - */ -struct nss_shaper_config_tbl_param { - struct nss_shaper_config_rate_param lap_cir; - /**< Configuration parameters for the committed information rate. */ - struct nss_shaper_config_rate_param lap_pir; - /**< Configuration parameters for the peak information rate. */ -}; - -/** - * nss_shaper_config_bf_attach - * Message information for attaching a shaper node to a BF shaper node. - */ -struct nss_shaper_config_bf_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_bf_detach - * Message information for detaching a shaper node from a BF shaper node. - */ -struct nss_shaper_config_bf_detach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_bf_group_attach - * Message information for attaching a shaper node to a BF group shaper node. - */ -struct nss_shaper_config_bf_group_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_bf_group_param - * Configuration parameters for a BF group shaper node. - */ -struct nss_shaper_config_bf_group_param { - uint32_t quantum; - /**< Smallest increment value for the DRRs. */ - struct nss_shaper_config_rate_param lap; - /**< Configuration of the rate control algorithm. */ -}; - -/** - * nss_shaper_config_fifo_limit_set - * Drop modes for the FIFO shaper in the NSS interface. - */ -enum nss_shaper_config_fifo_drop_modes { - NSS_SHAPER_FIFO_DROP_MODE_HEAD = 0, - NSS_SHAPER_FIFO_DROP_MODE_TAIL, - NSS_SHAPER_FIFO_DROP_MODES, -}; - -typedef enum nss_shaper_config_fifo_drop_modes nss_shaper_config_fifo_drop_mode_t; - /**< Drop modes for the FIFO shaper in the NSS interface. */ - -/** - * nss_shaper_config_fifo_param - * Message information for configuring a FIFO shaper node. - */ -struct nss_shaper_config_fifo_param { - uint32_t limit; /**< Queue limit in packets. */ - nss_shaper_config_fifo_drop_mode_t drop_mode; - /**< FIFO drop mode when a queue is full. */ -}; - -/** - * nss_shaper_config_wred_weight_modes - * Supported weight modes. - */ -enum nss_shaper_config_wred_weight_modes { - NSS_SHAPER_WRED_WEIGHT_MODE_DSCP = 0, - NSS_SHAPER_WRED_WEIGHT_MODES, -}; - -typedef enum nss_shaper_config_wred_weight_modes nss_shaper_config_wred_weight_mode_t; - /**< Supported weight modes. */ - -/** - * nss_shaper_red_alg_param - * Message information for configuring the RED algorithm. - */ -struct nss_shaper_red_alg_param { - uint32_t min; /**< Minimum size of the queue. */ - uint32_t max; /**< Maximum size of the queue. */ - - /** - * Probability of dropped packets when the average queue size (qlen_avg) = max. - */ - uint32_t probability; - - /** - * Exponential weight factor to calculate the average queue size. - */ - uint32_t exp_weight_factor; -}; - -/** - * nss_shaper_config_wred_param - * Message information for configuring the WRED algorithm. - */ -struct nss_shaper_config_wred_param { - uint32_t limit; /**< Queue limit in bytes. */ - nss_shaper_config_wred_weight_mode_t weight_mode; - /**< WRED weight mode. */ - uint32_t traffic_classes; /**< Number of traffic classes (drop probability). */ - uint32_t def_traffic_class; /**< Default traffic class used when there is no match. */ - uint32_t traffic_id; /**< Traffic class to configure. */ - uint32_t weight_mode_value; /**< Value to match the selected header field against. */ - struct nss_shaper_red_alg_param rap; - /**< Configuration parameters for the RED algorithm. */ - uint8_t ecn; /**< Mark an ECN bit or drop packet. */ -}; - -/** - * nss_shaper_config_wrr_attach - * Message information for attaching a shaper node to a WRR shaper node. - */ -struct nss_shaper_config_wrr_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_wrr_detach - * Message information for detaching a child node from a WRR shaper node. - */ -struct nss_shaper_config_wrr_detach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_wrr_group_attach - * Message information for attaching a shaper node to a WRR group. - */ -struct nss_shaper_config_wrr_group_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_wrr_operation_modes - * Modes of WRR operation. - */ -enum nss_shaper_wrr_operation_modes { - NSS_SHAPER_WRR_MODE_ROUND_ROBIN = 0, - NSS_SHAPER_WRR_MODE_FAIR_QUEUEING = 1, - NSS_SHAPER_WRR_MODE_TYPE_MAX, -}; - -/** - * nss_shaper_config_wrr_param - * Message information for configuring the operation mode of a WRR shaper node. - */ -struct nss_shaper_config_wrr_param { - uint32_t operation_mode; /**< Mode in which to operate. */ -}; - -/** - * nss_shaper_config_wrr_group_param - * Message information for configuring a quantum value of a WRR group shaper node. - */ -struct nss_shaper_config_wrr_group_param { - uint32_t quantum; /**< Smallest increment value for the DRRs. */ -}; - -/** - * nss_shaper_config_htb_attach - * Message information for attaching a shaper node to an HTB shaper node. - */ -struct nss_shaper_config_htb_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_htb_group_attach - * Message information for attaching a shaper node to an HTB group. - */ -struct nss_shaper_config_htb_group_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_htb_group_detach - * Message information for detaching a shaper node from an HTB group. - */ -struct nss_shaper_config_htb_group_detach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_htb_group_param - * Message information for configuring an HTB group shaper node. - */ -struct nss_shaper_config_htb_group_param { - uint32_t quantum; /**< Smallest increment value for the DRRs. */ - uint32_t priority; /**< Value of the priority for this group. */ - uint32_t overhead; /**< Overhead in bytes to be added per packet. */ - struct nss_shaper_config_rate_param rate_police; - /**< Configuration parameters for the policing rate. */ - struct nss_shaper_config_rate_param rate_ceil; - /**< Configuration parameters for the ceiling rate. */ -}; - -/** - * nss_shaper_config_ppe_sn_attach - * Message information for attaching a shaper node to a PPE shaper node. - */ -struct nss_shaper_config_ppe_sn_attach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_ppe_sn_detach - * Message information for detaching a shaper node from a PPE shaper node. - */ -struct nss_shaper_config_ppe_sn_detach { - uint32_t child_qos_tag; /**< QoS tag of the child shaper node. */ -}; - -/** - * nss_shaper_config_ppe_sn_type - * Types of PPE shaper nodes. - */ -enum nss_shaper_config_ppe_sn_type { - /* - * Scheduler types. - */ - NSS_SHAPER_CONFIG_PPE_SN_TYPE_HTB, - NSS_SHAPER_CONFIG_PPE_SN_TYPE_HTB_GROUP, - NSS_SHAPER_CONFIG_PPE_SN_TYPE_TBL, - NSS_SHAPER_CONFIG_PPE_SN_TYPE_WRR, - NSS_SHAPER_CONFIG_PPE_SN_TYPE_WRR_GROUP, - NSS_SHAPER_CONFIG_PPE_SN_TYPE_PRIO, - NSS_SHAPER_CONFIG_PPE_SN_SCH_MAX = 0xFF, - - /* - * Queue types. - */ - NSS_SHAPER_CONFIG_PPE_SN_TYPE_FIFO, - NSS_SHAPER_CONFIG_PPE_SN_TYPE_RED, - NSS_SHAPER_CONFIG_PPE_SN_TYPE_MAX, -}; - -/** - * nss_shaper_config_ppe_sn_param - * Message information for configuring a PPE shaper node. - */ -struct nss_shaper_config_ppe_sn_param { - enum nss_shaper_config_ppe_sn_type type; - /**< Type of PPE shaper node. */ - uint16_t ucast_base; /**< Resource ID of the base hardware for unicast queue. */ - uint16_t ucast_offset; /**< Offset from the base resource ID for unicast queue. */ - uint16_t mcast_base; /**< Resource ID of the base hardware for multicast queue. */ - uint16_t mcast_offset; /**< Offset from the base resource ID for multicast queue. */ - uint8_t port; /**< PPE port on which this shaper node is configured. */ - uint8_t reserved; /**< Reserved for padding. */ - uint16_t limit; /**< Limit of the queue. */ -}; - -/* - * nss_shaper_node_config - * Configuration messages for all types of shaper nodes. - */ -struct nss_shaper_node_config { - uint32_t qos_tag; /**< ID of the shaper node to be configured. */ - - /** - * Configuration messages for all types of shaper nodes. - */ - union { - struct nss_shaper_config_prio_attach prio_attach; - /**< Attach a shaper node to a PRIO shaper node. */ - struct nss_shaper_config_prio_detach prio_detach; - /**< Detach a shaper node from a PRIO shaper node. */ - - struct nss_shaper_config_codel_param codel_param; - /**< Configure a CoDel shaper node. */ - - struct nss_shaper_config_codel_mem_req codel_mem_req; - /**< Get CoDel memory requirement. */ - - struct nss_shaper_config_tbl_attach tbl_attach; - /**< Attach a shaper node to a TBL shaper node. */ - struct nss_shaper_config_tbl_param tbl_param; - /**< Configuration parameters for a TBL shaper node. */ - - struct nss_shaper_config_bf_attach bf_attach; - /**< Attach a shaper node to a BF shaper node. */ - struct nss_shaper_config_bf_detach bf_detach; - /**< Detach a child shaper node from BF shaper node. */ - struct nss_shaper_config_bf_group_attach bf_group_attach; - /**< Attach a shaper node to a BF group shaper node. */ - struct nss_shaper_config_bf_group_param bf_group_param; - /**< Configure parameters for a BF group shaper node. */ - - struct nss_shaper_config_fifo_param fifo_param; - /**< Configure a FIFO shaper node. */ - - struct nss_shaper_config_wrr_attach wrr_attach; - /**< Attach a shaper node to a WRR shaper node. */ - struct nss_shaper_config_wrr_detach wrr_detach; - /**< Detach a shaper node from a WRR shaper node. */ - struct nss_shaper_config_wrr_param wrr_param; - /**< Configuration parameters for a WRR shaper node . */ - struct nss_shaper_config_wrr_group_attach wrr_group_attach; - /**< Attach a shaper node to a WRR group shaper node. */ - struct nss_shaper_config_wrr_group_param wrr_group_param; - /**< Configure a WRR group shaper node with a quantum value. */ - struct nss_shaper_config_htb_attach htb_attach; - /**< Attach a shaper node to an HTB shaper node. */ - struct nss_shaper_config_htb_group_attach htb_group_attach; - /**< Attach a shaper node to an HTB group shaper node. */ - struct nss_shaper_config_htb_group_detach htb_group_detach; - /**< Detach a shaper node from an HTB group shaper node. */ - struct nss_shaper_config_htb_group_param htb_group_param; - /**< Configuration parameters for an HTB group shaper node. */ - struct nss_shaper_config_wred_param wred_param; - /**< Configuration parameters for a WRED shaper node. */ - struct nss_shaper_config_ppe_sn_attach ppe_sn_attach; - /**< Attach a shaper node to a PPE shaper node. */ - struct nss_shaper_config_ppe_sn_detach ppe_sn_detach; - /**< Detach a shaper node from a PPE shaper node. */ - struct nss_shaper_config_ppe_sn_param ppe_sn_param; - /**< Configuration parameters for a PPE shaper node. */ - } snc; /**< Types of shaper node configuration messages. */ -}; - -/** - * nss_shaper_node_codel_fq_stats_delta - * CoDel flow queue mode statistics sent as deltas. - */ -struct nss_shaper_node_codel_fq_stats_delta { - uint32_t new_flow_cnt; /**< Total number of new flows seen. */ - uint32_t ecn_mark_cnt; /**< Number of packets marked with ECN. */ -}; - -/** - * nss_shaper_node_codel_fq_stats - * CoDel flow queue mode statistics. - */ -struct nss_shaper_node_codel_fq_stats { - struct nss_shaper_node_codel_fq_stats_delta delta; - /**< CoDel flow queue statistics sent as deltas. */ - uint32_t new_flows_len; /**< Current number of new flows. */ - uint32_t old_flows_len; /**< Current number of old flows. */ - uint32_t maxpacket; /**< Largest packet seen so far. */ -}; - -/** - * nss_shaper_node_codel_sq_stats - * CoDel single queue mode statistics. - */ -struct nss_shaper_node_codel_sq_stats { - /** - * Maximum amount of time (in milliseconds) that a packet was in this shaper - * node before being dequeued. - */ - uint32_t packet_latency_peak_msec_dequeued; - - /** - * Maximum amount of time (in milliseconds) that a packet was in this shaper - * node before being dropped. - */ - uint32_t packet_latency_peak_msec_dropped; -}; - -/** - * nss_shaper_node_codel_stats - * CoDel shaper node statistics. - */ -struct nss_shaper_node_codel_stats { - struct nss_shaper_node_codel_sq_stats sq; /**< Single queue mode statistics. */ - struct nss_shaper_node_codel_fq_stats fq; /**< Flow queue mode statistics. */ -}; - -/** - * nss_shaper_node_stats_delta - * Statistics that are sent as deltas. - */ -struct nss_shaper_node_stats_delta { - uint32_t enqueued_bytes; /**< Bytes enqueued successfully. */ - uint32_t enqueued_packets; /**< Packets enqueued successfully. */ - - /** - * Bytes dropped during an enqueue operation because of node limits. - */ - uint32_t enqueued_bytes_dropped; - - /** - * Packets dropped during an enqueue operation because of node limits. - */ - uint32_t enqueued_packets_dropped; - - uint32_t dequeued_bytes; - /**< Bytes dequeued successfully from a shaper node. */ - uint32_t dequeued_packets; - /**< Packets dequeued successfully from a shaper node. */ - - /** - * Bytes dropped by this node during dequeuing (some nodes drop packets during - * dequeuing rather than enqueuing). - */ - uint32_t dequeued_bytes_dropped; - - /** - * Packets dropped by this node during dequeuing (some nodes drop packets during - * dequeuing rather than enqueuing). - */ - uint32_t dequeued_packets_dropped; - - /** - * Number of times any queue limit was overrun, leading to packet drops. - */ - uint32_t queue_overrun; - - uint32_t unused[4]; /**< Reserved for future statistics expansion. */ -}; - -/** - * nss_shaper_node_stats - * Common shaper node statistics. - */ -struct nss_shaper_node_stats { - uint32_t qlen_bytes; /**< Total size of packets waiting in the queue. */ - uint32_t qlen_packets; /**< Number of packets waiting in the queue. */ - uint32_t unused[4]; /**< Reserved for future statistics expansion. */ - struct nss_shaper_node_stats_delta delta; - /**< Statistics that are sent as deltas. */ -}; - -/** - * nss_shaper_node_stats_response - * Statistics response for shaper nodes. - */ -struct nss_shaper_node_stats_response { - struct nss_shaper_node_stats sn_stats; /**< Common shaper node statistics. */ - - /** - * All shaper nodes that need to maintain unique statistics need - * to add their statistics structure here. - */ - union { - struct nss_shaper_node_codel_stats codel; - /**< CoDel specific statistics. */ - } per_sn_stats; /**< Shaper specific statistics. */ -}; - -/** - * nss_shaper_node_stats_get - * Statistics of a shaper node. - */ -struct nss_shaper_node_stats_get { - - /* - * Request - */ - uint32_t qos_tag; /**< QoS tag of the shaper node. */ - - /* - * Response - */ - struct nss_shaper_node_stats_response response; - /**< Shaper node statistics response */ -}; - -/** - * nss_shaper_configure - * Configuration message for a shaper node. - */ -struct nss_shaper_configure { - nss_shaper_config_type_t request_type; /**< Message is a request. */ - nss_shaper_response_type_t response_type; /**< Message is a response. */ - - /** - * Types of configuration messages for a shaper node. - */ - union { - struct nss_shaper_config_alloc_shaper_node alloc_shaper_node; - /**< Allocate a shaper node in the NSS interface. */ - struct nss_shaper_config_free_shaper_node free_shaper_node; - /**< Free a shaper node from the NSS interface. */ - struct nss_shaper_config_set_default_node set_default_node; - /**< Set a shaper node as the default node for a queue. */ - struct nss_shaper_config_set_root_node set_root_node; - /**< Set a shaper node as the root shaper nod. */ - struct nss_shaper_config_set_hybrid_mode set_hybrid_mode; - /**< Set a shaper to operate in Hybrid mode. */ - struct nss_shaper_node_config shaper_node_config; - /**< Configuration message for any type of shaper node. */ - struct nss_shaper_node_stats_get shaper_node_stats_get; - /**< Statistics for a shaper node. */ - } msg; /**< Types of configuration messages. */ -}; - -/** - * Registrant callback to receive shaper bounced packets - * - * @datatypes - * sk_buff - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] skb Pointer to the data socket buffer. - */ -typedef void (*nss_shaper_bounced_callback_t)(void *app_data, struct sk_buff *skb); - -/** - * nss_shaper_register_shaping - * Registers a shaper node with the NSS interface for basic shaping operations. - * - * @return - * Pointer to the NSS core context. - */ -extern void *nss_shaper_register_shaping(void); - -/** - * nss_shaper_unregister_shaping - * Deregisters a shaper node from the NSS interface. - * - * @param[in] ctx Pointer to the NSS context. - * - * @dependencies - * The shaper node must have been previously registered. - */ -extern void nss_shaper_unregister_shaping(void *ctx); - -/** - * nss_shaper_register_shaper_bounce_interface - * Registers a shaper bounce interface with the NSS interface for receiving - * shaper-bounced packets. - * - * @datatypes - * nss_shaper_bounced_callback_t \n - * module - * - * @param[in] if_num NSS interface number. - * @param[in] cb Callback function for the message. This callback is - * invoked when the NSS returns a sk_buff after shaping. - * @param[in] app_data Pointer to the application context of the message. - * This context is passed to the callback together with the - * sk_buff to provide context to the registrant (state). - * @param[in] owner Pointer to the kernel module. The module is held until it deregisters. - * - * @return - * Pointer to the NSS core context. - */ -extern void *nss_shaper_register_shaper_bounce_interface(uint32_t if_num, nss_shaper_bounced_callback_t cb, void *app_data, struct module *owner); - -/** - * nss_shaper_unregister_shaper_bounce_interface - * Deregisters a shaper bounce interface from the NSS interface. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The shaper bounce interface must have been previously registered. - */ -extern void nss_shaper_unregister_shaper_bounce_interface(uint32_t if_num); - -/** - * nss_shaper_register_shaper_bounce_bridge - * Registers a shaper bounce bridge with the NSS interface for receiving - * shaper-bounced packets. - * - * @datatypes - * nss_shaper_bounced_callback_t \n - * module - * - * @param[in] if_num NSS interface number. - * @param[in] cb Callback function for the message. This callback is - * invoked when the NSS returns a sk_buff after shaping. - * @param[in] app_data Pointer to the application context of the message. - * This context is passed to the callback together with the - * sk_buff to provide context to the registrant (state). - * @param[in] owner Pointer to the kernel module. - * - * @return - * Pointer to the NSS core context. - */ -extern void *nss_shaper_register_shaper_bounce_bridge(uint32_t if_num, nss_shaper_bounced_callback_t cb, void *app_data, struct module *owner); - -/** - * nss_shaper_unregister_shaper_bounce_bridge - * Deregisters a shaper bounce bridge from the NSS interface. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The shaper bounce bridge must have been previously registered. - */ -extern void nss_shaper_unregister_shaper_bounce_bridge(uint32_t if_num); - -/** - * nss_shaper_bounce_interface_packet - * Issues a packet for shaping via a bounce operation. - * - * @datatypes - * sk_buff - * - * @param[in] ctx Pointer to the NSS context provided during registration. - * @param[in] if_num NSS interface number. - * @param[in] skb Pointer to the data socket buffer. - * - * @return - * Success or failure. - */ -extern nss_tx_status_t nss_shaper_bounce_interface_packet(void *ctx, uint32_t if_num, struct sk_buff *skb); - -/** - * nss_shaper_bounce_bridge_packet - * Issues a packet for shaping via a bounce bridge. - * - * @datatypes - * sk_buff - * - * @param[in] ctx Pointer to the NSS context provided during registration. - * @param[in] if_num NSS interface number. - * @param[in] skb Pointer to the data socket buffer. - * - * @return - * Success or failure. - */ -extern nss_tx_status_t nss_shaper_bounce_bridge_packet(void *ctx, uint32_t if_num, struct sk_buff *skb); - -/** - * nss_shaper_config_send - * Sends a shaping configuration message. - * - * @datatypes - * nss_shaper_configure - * - * @param[in] ctx Pointer to the NSS context. - * @param[in] config Pointer to the configuration message. - * - * @return - * Indication if the configuration message was issued. - * @par - * This indication does not mean the configuration message was successfully - * processed. Success or failure is provided in the response issued to the - * given callback function as specified in nss_shaper_configure. - */ -nss_tx_status_t nss_shaper_config_send(void *ctx, struct nss_shaper_configure *config); - -/** - * nss_shaper_get_device - * Gets the original device from probe. - * - * @return - * Pointer to the device. - */ -extern struct device *nss_shaper_get_dev(void); - -/** - * @} - */ - -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_sjack.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_sjack.h deleted file mode 100644 index 32ef356b0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_sjack.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_sjack.h - * NSS SJACK interface definitions. - */ - -#ifndef __NSS_SJACK_H -#define __NSS_SJACK_H - -/** - * @addtogroup nss_sjack_subsystem - * @{ - */ - -/** - * nss_sjack_msg_types - * Message types for SJACK requests and responses. - */ -enum nss_sjack_msg_types { - NSS_SJACK_CONFIGURE_MSG, - NSS_SJACK_UNCONFIGURE_MSG, - NSS_SJACK_STATS_SYNC_MSG, - NSS_SJACK_MAX_MSG_TYPE -}; - -/** - * nss_sjack_configure_msg - * Message information for configuring the SJACK interface. - */ -struct nss_sjack_configure_msg { - uint32_t ingress_if_num; - /**< Ingress interface number corresponding to the SJACK device. */ - uint32_t egress_if_num; - /**< Egress interface number corresponding to the SJACK device. */ - uint16_t tunnel_id; /**< SJACK tunnel ID. */ - uint8_t ip_dscp; /**< Differentiated services code point value. */ - uint8_t gre_prio; /**< GRE priority information. */ - uint8_t gre_flags; /**< GRE flags. */ - uint8_t use_ipsec_sa_pattern; /**< IPsec security association pattern flag. */ -}; - -/** - * nss_sjack_unconfigure_msg - * Message information for de-configuring the SJACK interface. - */ -struct nss_sjack_unconfigure_msg { - uint32_t ingress_if_num; - /**< Ingress interface number corresponding to the SJACK device. */ -}; - -/** - * nss_sjack_stats_sync_msg - * Message information for SJACK synchronization statistics. - */ -struct nss_sjack_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ -}; - -/** - * nss_sjack_msg - * Data for sending and receiving SJACK messages. - */ -struct nss_sjack_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of an SJACK message. - */ - union { - struct nss_sjack_configure_msg configure; - /**< Configure SJACK. */ - struct nss_sjack_unconfigure_msg unconfigure; - /**< De-configure SJACK. */ - struct nss_sjack_stats_sync_msg stats_sync; - /**< Synchronized statistics for SJACK. */ - } msg; /**< Message payload for SJACK interface messages exchanged with NSS core. */ -}; - -/** - * Callback function for receiving SJACK messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_sjack_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_sjack_register_if - * Registers with the NSS for sending and receiving SJACK messages. - * - * @datatypes - * net_device \n - * nss_sjack_msg_callback_t - * - * @param[in] dev Pointer to the associated network device. - * @param[in] if_num NSS interface number. - * @param[in] event_callback Callback for the message. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_sjack_register_if(uint32_t if_num, struct net_device *dev, nss_sjack_msg_callback_t event_callback); - -/** - * nss_sjack_unregister_if - * Deregisters the SJACK interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The interface must have been previously registered. - */ -extern void nss_sjack_unregister_if(uint32_t if_num); - -/** - * nss_sjack_tx_msg - * Send SJACK messages to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_sjack_msg - * - * @param[in,out] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_sjack_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_sjack_msg *msg); - -/** @} */ /* end_addtogroup nss_sjack_subsystem */ - -#endif /* __NSS_SJACK_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_stats_public.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_stats_public.h deleted file mode 100644 index f282ffdf3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_stats_public.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_stats_public.h - * NSS statistics Structure and APIs - */ - -#ifndef __NSS_STATS_PUBLIC_H -#define __NSS_STATS_PUBLIC_H - -/** - * @addtogroup nss_stats_public_subsystem - * @{ - */ - -/** - * Maximum string length. - * - * This should be equal to maximum string size of any statistics - * inclusive of statistics value. - */ -#define NSS_STATS_MAX_STR_LENGTH 96 - -/** - * nss_stats_node - * Node statistics. - */ -enum nss_stats_node { - NSS_STATS_NODE_RX_PKTS, /**< Accelerated node Rx packets. */ - NSS_STATS_NODE_RX_BYTES, /**< Accelerated node Rx bytes. */ - NSS_STATS_NODE_TX_PKTS, /**< Accelerated node Tx packets. */ - NSS_STATS_NODE_TX_BYTES, /**< Accelerated node Tx bytes. */ - NSS_STATS_NODE_RX_QUEUE_0_DROPPED, /**< Accelerated node Rx Queue 0 dropped. */ - NSS_STATS_NODE_RX_QUEUE_1_DROPPED, /**< Accelerated node Rx Queue 1 dropped. */ - NSS_STATS_NODE_RX_QUEUE_2_DROPPED, /**< Accelerated node Rx Queue 2 dropped. */ - NSS_STATS_NODE_RX_QUEUE_3_DROPPED, /**< Accelerated node Rx Queue 3 dropped. */ - NSS_STATS_NODE_MAX, /**< Maximum message type. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_stats_drv and corresponding - * statistics string array in nss_drv_strings.c. - */ -/** - * nss_stats_drv - * HLOS driver statistics. - */ -enum nss_stats_drv { - NSS_STATS_DRV_NBUF_ALLOC_FAILS = 0, /**< Networking buffer allocation errors. */ - NSS_STATS_DRV_PAGED_BUF_ALLOC_FAILS, /**< Paged buffer allocation errors. */ - NSS_STATS_DRV_TX_QUEUE_FULL_0, /**< Tx queue full for Core 0. */ - NSS_STATS_DRV_TX_QUEUE_FULL_1, /**< Tx queue full for Core 1. */ - NSS_STATS_DRV_TX_EMPTY, /**< Host-to-network empty buffers. */ - NSS_STATS_DRV_PAGED_TX_EMPTY, /**< Host-to-network paged empty buffers. */ - NSS_STATS_DRV_TX_PACKET, /**< Host-to-network data packets. */ - NSS_STATS_DRV_TX_CMD_REQ, /**< Host-to-network control packets. */ - NSS_STATS_DRV_TX_CRYPTO_REQ, /**< Host-to-network crypto requests. */ - NSS_STATS_DRV_TX_BUFFER_REUSE, /**< Host-to-network reuse buffer count. */ - NSS_STATS_DRV_RX_EMPTY, /**< Network-to-host empty buffers. */ - NSS_STATS_DRV_RX_PACKET, /**< Network-to-host data packets. */ - NSS_STATS_DRV_RX_CMD_RESP, /**< Network-to-host command responses. */ - NSS_STATS_DRV_RX_STATUS, /**< Network-to-host status packets. */ - NSS_STATS_DRV_RX_CRYPTO_RESP, /**< Network-to-host crypto responses. */ - NSS_STATS_DRV_RX_VIRTUAL, /**< Network-to-host virtual packets. */ - NSS_STATS_DRV_TX_SIMPLE, /**< Host-to-network simple SKB packets. */ - NSS_STATS_DRV_TX_NR_FRAGS, /**< Host-to-network number of fragmented SKB packets. */ - NSS_STATS_DRV_TX_FRAGLIST, /**< Host-to-network fragmentation list of SKB packets. */ - NSS_STATS_DRV_RX_SIMPLE, /**< Network-to-host simple SKB packets. */ - NSS_STATS_DRV_RX_NR_FRAGS, /**< Network-to-host number of fragmented SKB packets. */ - NSS_STATS_DRV_RX_SKB_FRAGLIST, /**< Network-to-host fragmentation list of SKB packets. */ - NSS_STATS_DRV_RX_BAD_DESCRIPTOR, /**< Network-to-host bad descriptor reads. */ - NSS_STATS_DRV_NSS_SKB_COUNT, /**< NSS SKB pool count. */ - NSS_STATS_DRV_CHAIN_SEG_PROCESSED, /**< Network-to-host SKB chain processed count. */ - NSS_STATS_DRV_FRAG_SEG_PROCESSED, /**< Network-to-host fragments processed count. */ - NSS_STATS_DRV_TX_CMD_QUEUE_FULL, /**< Tx host-to-network control packets fail due to queue full. */ -#ifdef NSS_MULTI_H2N_DATA_RING_SUPPORT - NSS_STATS_DRV_TX_PACKET_QUEUE_0, /**< Host-to-network data packets on queue0. */ - NSS_STATS_DRV_TX_PACKET_QUEUE_1, /**< Host-to-network data packets on queue1. */ - NSS_STATS_DRV_TX_PACKET_QUEUE_2, /**< Host-to-network data packets on queue2. */ - NSS_STATS_DRV_TX_PACKET_QUEUE_3, /**< Host-to-network data packets on queue3. */ - NSS_STATS_DRV_TX_PACKET_QUEUE_4, /**< Host-to-network data packets on queue4. */ - NSS_STATS_DRV_TX_PACKET_QUEUE_5, /**< Host-to-network data packets on queue5. */ - NSS_STATS_DRV_TX_PACKET_QUEUE_6, /**< Host-to-network data packets on queue6. */ - NSS_STATS_DRV_TX_PACKET_QUEUE_7, /**< Host-to-network data packets on queue7. */ -#endif - NSS_STATS_DRV_MAX, /**< Maximum message type. */ -}; - -/** - * nss_stats_types - * List of statistics categories. - */ -enum nss_stats_types { - NSS_STATS_TYPE_COMMON, /**< Common pnode statistics. */ - NSS_STATS_TYPE_DROP, /**< Packet drop statistics. */ - NSS_STATS_TYPE_ERROR, /**< Hardware or software errors different from drop or exception statistics. */ - NSS_STATS_TYPE_EXCEPTION, /**< Packet exception (to host) statistics. */ - NSS_STATS_TYPE_SPECIAL, /**< Statistics that do not fall into the above types. */ - NSS_STATS_TYPE_MAX /**< Maximum message type. */ -}; - -/** - * nss_stats_notifier_action - * Statistics notification types. - */ -enum nss_stats_notifier_action { - NSS_STATS_EVENT_NOTIFY, - NSS_STATS_EVENT_MAX -}; - -/** - * @} - */ - -#endif /* __NSS_STATS_PUBLIC_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_tls.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_tls.h deleted file mode 100644 index b23268e58..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_tls.h +++ /dev/null @@ -1,469 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE - ************************************************************************** - */ - -/** - * @file nss_tls.h - * NSS TLS common interface definitions, supports inner/outer interface split. - */ - -#ifndef _NSS_TLS_H_ -#define _NSS_TLS_H_ - -/** - * @addtogroup nss_tls_subsystem - * @{ - */ -#define NSS_TLS_VER_TLS_1_1 0x0301 /**< TLS version 1.1, major and minor version. */ -#define NSS_TLS_VER_TLS_1_2 0x0302 /**< TLS version 1.2, major and minor version. */ -#define NSS_TLS_CLE_MAX 32 /**< Maximum classification error. */ - -/** - * tls_msg_types - * Message types for TLS requests and responses. - */ -enum nss_tls_msg_type { - NSS_TLS_MSG_TYPE_NODE_CONFIG, /**< Configure TLS firmware node. */ - NSS_TLS_MSG_TYPE_NODE_SYNC, /**< Node statistics. */ - NSS_TLS_MSG_TYPE_CTX_CONFIG, /**< Send exception interface number. */ - NSS_TLS_MSG_TYPE_CTX_DECONFIG, /**< Context deconfigure message. */ - NSS_TLS_MSG_TYPE_CTX_SYNC, /**< Synchronize statistics. */ - NSS_TLS_MSG_TYPE_CIPHER_UPDATE, /**< Context session update. */ - NSS_TLS_MSG_MAX, /**< Maximum message. */ -}; - -/** - * nss_tls_error - * TLS error. - */ -enum nss_tls_error { - NSS_TLS_ERROR_NONE = 0, /**< No error. */ - NSS_TLS_ERROR_UNKNOWN_MSG, /**< Unknown message. */ - NSS_TLS_ERROR_ALREADY_CONFIGURE, /**< Node already configured. */ - NSS_TLS_ERROR_FAIL_REG_INNER_CTX, /**< Register inner context error. */ - NSS_TLS_ERROR_FAIL_REG_OUTER_CTX, /**< Register outer context error. */ - NSS_TLS_ERROR_FAIL_REQ_POOL_ALLOC, /**< Request pool allocation failed. */ - NSS_TLS_ERROR_INVALID_BLK_LEN, /**< Invalid block length. */ - NSS_TLS_ERROR_INVALID_HASH_LEN, /**< Invalid hash length. */ - NSS_TLS_ERROR_INVALID_VER, /**< Invalid TLS version. */ - NSS_TLS_ERROR_INVALID_CTX_WORDS, /**< Context words size mismatch with TLS. */ - NSS_TLS_ERROR_FAIL_ALLOC_HWCTX, /**< Failed to allocate hardware context. */ - NSS_TLS_ERROR_FAIL_COPY_CTX, /**< Failed to copy context. */ - NSS_TLS_ERROR_FAIL_NOMEM, /**< Failed memory allocation. */ - NSS_TLS_ERROR_FAIL_INVAL_ALGO, /**< Invalid algorithm. */ - NSS_TLS_ERROR_MAX, /**< Maximum TLS error. */ -}; - -/** - * nss_tls_stats_types - * TLS statistics types. - */ -enum nss_tls_stats_types { - NSS_TLS_STATS_SINGLE_REC = NSS_STATS_NODE_MAX, - /**< Number of transmit single record datagrams. */ - NSS_TLS_STATS_MULTI_REC, /**< Number of multiple transmit record datagrams. */ - NSS_TLS_STATS_TX_INVAL_REQS, /**< Number of transmit invalidations successfully requested. */ - NSS_TLS_STATS_RX_CCS_REC, /**< Number of change cipher specification records received. */ - NSS_TLS_STATS_FAIL_CCS, /**< Failure to switch to new crypto. */ - NSS_TLS_STATS_ETH_NODE_DEACTIVE, /**< Ethernet node deactivated because no crypto was available. */ - NSS_TLS_STATS_CRYPTO_ALLOC_SUCCESS, /**< Number of successful crypto allocations. */ - NSS_TLS_STATS_CRYPTO_FREE_REQ, /**< Number of crypto-free requests. */ - NSS_TLS_STATS_CRYPTO_FREE_SUCCESS, /**< Number of crypto-free successes. */ - NSS_TLS_STATS_FAIL_CRYPTO_ALLOC, /**< Number of failed crypto allocations. */ - NSS_TLS_STATS_FAIL_CRYPTO_LOOKUP, /**< Failure to find an active crypto session. */ - NSS_TLS_STATS_FAIL_REQ_ALLOC, /**< Failure to allocate request memory pool. */ - NSS_TLS_STATS_FAIL_PBUF_STATS, /**< Failure in pbuf allocation for statistics. */ - NSS_TLS_STATS_FAIL_CTX_ACTIVE, /**< Failure in enqueue due to inactive context. */ - NSS_TLS_STATS_HW_LEN_ERROR, /**< Length error. */ - NSS_TLS_STATS_HW_TOKEN_ERROR, /**< Token error; unknown token command or instruction. */ - NSS_TLS_STATS_HW_BYPASS_ERROR, /**< Token contains too much bypass data. */ - NSS_TLS_STATS_HW_CRYPTO_ERROR, /**< Cryptographic block size error. */ - NSS_TLS_STATS_HW_HASH_ERROR, /**< Hash block size error. */ - NSS_TLS_STATS_HW_CONFIG_ERROR, /**< Invalid command, algorithm, or mode combination. */ - NSS_TLS_STATS_HW_ALGO_ERROR, /**< Unsupported algorithm. */ - NSS_TLS_STATS_HW_HASH_OVF_ERROR, /**< Hash input overflow. */ - NSS_TLS_STATS_HW_AUTH_ERROR, /**< Hash input overflow. */ - NSS_TLS_STATS_HW_PAD_VERIFY_ERROR, /**< Pad verification error. */ - NSS_TLS_STATS_HW_TIMEOUT_ERROR, /**< Data timed out. */ - NSS_TLS_STATS_NO_DESC_IN, /**< Ingress DMA descriptor not available. */ - NSS_TLS_STATS_NO_DESC_OUT, /**< Egress DMA descriptor not available. */ - NSS_TLS_STATS_NO_REQS, /**< Not enough requests available for records. */ - NSS_TLS_STATS_MAX, /**< Maximum statistics type. */ -}; - -/** - * nss_tls_hw_stats - * TLS HW statistics. - */ -struct nss_tls_hw_stats { - /* - * Dont change the order below - */ - uint32_t hw_len_error; /**< Length error. */ - uint32_t hw_token_error; /**< Token error, unknown token command/instruction. */ - uint32_t hw_bypass_error; /**< Token contains too much bypass data. */ - uint32_t hw_crypto_error; /**< Cryptograhic block size error. */ - uint32_t hw_hash_error; /**< Hash block size error. */ - uint32_t hw_config_error; /**< Invalid command/algorithm/mode/combination. */ - uint32_t hw_algo_error; /**< Unsupported algorithm. */ - uint32_t hw_hash_ovf_error; /**< Hash input overflow. */ - uint32_t hw_auth_error; /**< Hash input overflow. */ - uint32_t hw_pad_verify_error; /**< Pad verification error. */ - uint32_t hw_timeout_error; /**< Data timed out. */ -}; - -/** - * nss_tls_ctx_perf_stats - * TLS performance statistics. - */ -struct nss_tls_ctx_perf_stats { - uint32_t no_desc_in; /**< Ingress DMA descriptor not available. */ - uint32_t no_desc_out; /**< Egress DMA descriptor not available. */ - uint32_t no_reqs; /**< Not enough requests available for records. */ -}; - -/** - * nss_tls_ctx_stats - * TLS session statistics. - */ -struct nss_tls_ctx_stats { - struct nss_cmn_node_stats pkt; /**< Common node statistics. */ - uint32_t single_rec; /**< Number of Tx single record datagrams. */ - uint32_t multi_rec; /**< Number of multiple Tx record datagrams. */ - uint32_t tx_inval_reqs; /**< Number of Tx invalidation successfully requested. */ - uint32_t rx_ccs_rec; /**< Number of change cipher spec records received. */ - uint32_t fail_ccs; /**< Failed to switch to new crypto. */ - uint32_t eth_node_deactive; /**< Ethernet node deactivated as no crypto available. */ - uint32_t crypto_alloc_success; /**< Number of crypto allocation succeeded. */ - uint32_t crypto_free_req; /**< Number of crypto free request. */ - uint32_t crypto_free_success; /**< Number of crypto free succeeded. */ - uint32_t fail_crypto_alloc; /**< Number of crypto allocation failed. */ - uint32_t fail_crypto_lookup; /**< Failed to find active crypto session. */ - uint32_t fail_req_alloc; /**< Failure to allocate request memory pool. */ - uint32_t fail_pbuf_stats; /**< Failure in pbuf allocation for statistics. */ - uint32_t fail_ctx_active; /**< Failure in enqueue due to inactive context. */ - - struct nss_tls_hw_stats fail_hw; /**< Hardware failure. */ - struct nss_tls_ctx_perf_stats perf; /**< Performance related statistics. */ -}; - -/** - * nss_tls_node_stats - * TLS node statistics. - */ -struct nss_tls_node_stats { - uint32_t fail_ctx_alloc; /**< Failure in allocating a context. */ - uint32_t fail_ctx_free; /**< Failure in freeing up the context. */ - uint32_t fail_pbuf_stats; /**< Failure in pbuf allocation for statistics. */ -}; - -/** - * nss_tls_ctx_config - * TLS context configuration. - */ -struct nss_tls_ctx_config { - uint32_t except_ifnum; /**< Exception interface number. */ - uint32_t headroom; /**< Headroom required for encapsulation. */ - uint32_t tailroom; /**< Tailroom required for encapsulation. */ -}; - -/** - * nss_tls_cipher_update - * TLS cipher update message. - * - */ -struct nss_tls_cipher_update { - uint32_t crypto_idx; /**< Crypto index for cipher context. */ - uint16_t ver; /**< Version (TLS minor and major versions). */ - uint8_t skip; /**< Skip hardware processing. */ - uint8_t reserved; /**< Reserved for future use. */ -}; - -/** - * nss_tls_stats_notification - * TLS transmission statistics structure. - */ -struct nss_tls_stats_notification { - uint64_t stats_ctx[NSS_TLS_STATS_MAX]; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_tls_msg - * Data for sending and receiving TLS messages. - */ -struct nss_tls_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a TLS message. - */ - union { - struct nss_tls_cipher_update cipher_update; /**< Crypto configuration. */ - struct nss_tls_ctx_config ctx_cfg; /**< Context configuration. */ - struct nss_tls_ctx_stats stats; /**< Context statistics. */ - struct nss_tls_node_stats node_stats; /**< Node statistics. */ - } msg; /**< Message payload for TLS session messages exchanged with NSS core. */ -}; - -/** - * Callback function for receiving TLS messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_tls_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * Callback function for receiving TLS session data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_tls_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_tls_tx_buf - * Sends a TLS data packet to the NSS. - * - * @datatypes - * sk_buff \n - * nss_ctx_instance - * - * @param[in] os_buf Pointer to the OS data buffer. - * @param[in] if_num NSS interface number. - * @param[in] nss_ctx Pointer to the NSS core context. - * - * @return - * Status of Tx buffer forwarded to NSS for TLS operation. - */ -nss_tx_status_t nss_tls_tx_buf(struct sk_buff *os_buf, uint32_t if_num, struct nss_ctx_instance *nss_ctx); - -/** - * nss_tls_tx_msg - * Sends an asynchronous IPsec message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_tls_msg - * - * @param[in] nss_ctx Pointer to the NSS HLOS driver context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_tls_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_tls_msg *msg); - -/** - * nss_tls_tx_msg_sync - * Sends a synchronous IPsec message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_tls_msg_type \n - * nss_tls_msg - * - * @param[in] nss_ctx Pointer to the NSS HLOS driver context. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] ntcm Pointer to the NSS IPsec message. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_tls_tx_msg_sync(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - enum nss_tls_msg_type type, uint16_t len, - struct nss_tls_msg *ntcm); - -/** - * nss_tls_unregister_if - * Deregisters a TLS session interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - * - * @dependencies - * The TLS session interface must have been previously registered. - */ -extern void nss_tls_unregister_if(uint32_t if_num); - -/** - * nss_tls_register_if - * Registers a TLS session interface with the NSS for sending and receiving - * messages. - * - * @datatypes - * nss_tls_data_callback_t \n - * nss_tls_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] data_cb Callback function for the message. - * @param[in] msg_cb Callback for TLS tunnel message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * @param[in] type Type of message. - * @param[in] app_ctx Pointer to the application context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_tls_register_if(uint32_t if_num, - nss_tls_data_callback_t data_cb, - nss_tls_msg_callback_t msg_cb, - struct net_device *netdev, - uint32_t features, - uint32_t type, - void *app_ctx); - -/** - * nss_tls_notify_unregister - * Deregisters an event callback. - * - * @param[in] ifnum NSS interface number. - * - * @return - * None. - */ -extern void nss_tls_notify_unregister(uint32_t ifnum); - -/** - * nss_tls_notify_register - * Registers an event callback to handle notification from TLS firmware package. - * - * @datatypes - * nss_tls_msg_callback_t - * - * @param[in] ifnum NSS interface number. - * @param[in] ev_cb Callback for TLS tunnel message. - * @param[in] app_data Pointer to the application context. - * - * @return - * Pointer to NSS core context. - */ -extern struct nss_ctx_instance *nss_tls_notify_register(uint32_t ifnum, nss_tls_msg_callback_t ev_cb, void *app_data); - -/** - * nss_tls_msg_init - * Initializes a TLS message sent asynchronously. - * - * @datatypes - * nss_tls_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context. - * - * @return - * None. - */ -extern void nss_tls_msg_init(struct nss_tls_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_tls_msg_sync_init - * Initializes a TLS message. - * - * @datatypes - * nss_tls_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * - * @return - * None. - */ -extern void nss_tls_msg_sync_init(struct nss_tls_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len); - -/** - * nss_tls_get_context - * Gets the NSS core context for the TLS session. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_tls_get_context(void); - -/** - * nss_tls_get_device - * Gets the original device from probe. - * - * @return - * Pointer to the device. - */ -extern struct device *nss_tls_get_dev(struct nss_ctx_instance *nss_ctx); - -/** - * nss_tls_ifmap_get - * Returns active TLS interfaces. - * - * @return - * Pointer to the interface map. - */ -unsigned long *nss_tls_ifmap_get(void); - -/** - * nss_tls_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_tls_stats_unregister_notifier(struct notifier_block *nb); - -/** - * nss_tls_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_tls_stats_register_notifier(struct notifier_block *nb); - -/** - * @} - */ - -#endif /* _NSS_TLS_H_. */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_trustsec_tx.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_trustsec_tx.h deleted file mode 100644 index b71fac54d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_trustsec_tx.h +++ /dev/null @@ -1,234 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_trustsec_tx.h - * NSS TrustSec interface definitions. - */ - -#ifndef __NSS_TRUSTSEC_TX_H -#define __NSS_TRUSTSEC_TX_H - -/** - * @addtogroup nss_trustsec_tx_subsystem - * @{ - */ - -/** - * nss_trustsec_tx_msg_types - * Message types for TrustSec Tx requests and responses. - */ -enum nss_trustsec_tx_msg_types { - NSS_TRUSTSEC_TX_MSG_CONFIGURE, /** Configure the TrustSec node. */ - NSS_TRUSTSEC_TX_MSG_UNCONFIGURE, /** Unconfigure the TrustSec node. */ - NSS_TRUSTSEC_TX_MSG_STATS_SYNC, /** Statistics sychronization. */ - NSS_TRUSTSEC_TX_MSG_UPDATE_NEXTHOP, /** Update next hop. */ - NSS_TRUSTSEC_TX_MSG_MAX /** Maximum message type. */ -}; - -/** - * nss_trustsec_tx_error_types - * Error types for the TrustSec Tx interface. - */ -enum nss_trustsec_tx_error_types { - NSS_TRUSTSEC_TX_ERR_NONE, /** No error */ - NSS_TRUSTSEC_TX_ERR_INVAL_SRC_IF, /** Source interface is invalid. */ - NSS_TRUSTSEC_TX_ERR_RECONFIGURE_SRC_IF, /** Source interface is already configured. */ - NSS_TRUSTSEC_TX_ERR_DEST_IF_NOT_FOUND, /** Destination interface is not found. */ - NSS_TRUSTSEC_TX_ERR_NOT_CONFIGURED, /** Source interface is not configured. */ - NSS_TRUSTSEC_TX_ERR_SGT_MISMATCH, /** SGT mismatches. */ - NSS_TRUSTSEC_TX_ERR_UNKNOWN, /** Error is unknown. */ - NSS_TRUSTSEC_TX_ERR_MAX, /** Maximum error message. */ -}; - -/** - * nss_trustsec_tx_configure_msg - * Message information for configuring a TrustSec Tx interface. - */ -struct nss_trustsec_tx_configure_msg { - uint32_t src; /**< Interface number of the source tunnel. */ - uint32_t dest; /**< Outgoing interface number. */ - uint16_t sgt; /**< Security Group Tag value to embed in the TrustSec header. */ - uint8_t reserved[2]; /**< Reserved for word alignment. */ -}; - -/** - * nss_trustsec_tx_unconfigure_msg - * Message information for de-configuring a TrustSec Tx interface. - */ -struct nss_trustsec_tx_unconfigure_msg { - uint32_t src; /**< Interface number of the source tunnel. */ - uint16_t sgt; /**< Security Group Tag value configured for this interface. */ - uint8_t reserved[2]; /**< Reserved for word alignment. */ -}; - -/** - * nss_trustsec_tx_stats_sync_msg - * Statistics synchronization message for the TrustSec Tx interface. - */ -struct nss_trustsec_tx_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t invalid_src; /**< Received packets with an invalid source interface. */ - uint32_t unconfigured_src; /**< Received packets with a de-configured source interface. */ - uint32_t headroom_not_enough; /**< Not enough headroom to insert a TrustSec header. */ -}; - -/** - * nss_trustsec_tx_update_nexthop_msg - * Message information for updating the next hop for a TrustSec Tx interface. - */ -struct nss_trustsec_tx_update_nexthop_msg { - uint32_t src; /**< Interface number of the source tunnel. */ - uint32_t dest; /**< Outgoing interface number. */ - uint16_t sgt; /**< Security Group Tag value to embed in the TrustSec header. */ - uint8_t reserved[2]; /**< Reserved for word alignment. */ -}; - -/** - * nss_trustsec_tx_msg - * Data for sending and receiving TrustSec Tx messages. - */ -struct nss_trustsec_tx_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a TrustSec Tx message. - */ - union { - struct nss_trustsec_tx_configure_msg configure; - /**< Configure TrustSec Tx. */ - struct nss_trustsec_tx_unconfigure_msg unconfigure; - /**< De-configure TrustSec Tx. */ - struct nss_trustsec_tx_stats_sync_msg stats_sync; - /**< Synchronize TrustSec Tx statistics. */ - struct nss_trustsec_tx_update_nexthop_msg upd_nexthop; - /**< Update next hop of TrustSec Tx. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving TrustSec Tx messages. - * - * @datatypes - * nss_trustsec_tx_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_trustsec_tx_msg_callback_t)(void *app_data, struct nss_trustsec_tx_msg *npm); - -/** - * nss_trustsec_tx_msg_init - * Initializes a TrustSec Tx message. - * - * @datatypes - * nss_trustsec_tx_msg - * - * @param[in,out] npm Pointer to the NSS Profiler message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the message. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * TRUE or FALSE. - */ -extern void nss_trustsec_tx_msg_init(struct nss_trustsec_tx_msg *npm, uint16_t if_num, uint32_t type, uint32_t len, - nss_trustsec_tx_msg_callback_t cb, void *app_data); - -/** - * nss_trustsec_tx_msg - * Sends a TrustSec Tx message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_trustsec_tx_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_trustsec_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_trustsec_tx_msg *msg); - -/** - * nss_trustsec_tx_msg_sync - * Sends a TrustSec Tx message to the NSS and waits for a response. - * - * @datatypes - * nss_ctx_instance \n - * nss_trustsec_tx_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_trustsec_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_trustsec_tx_msg *msg); - -/** - * nss_trustsec_tx_update_nexthop - * Updates the next hop of the TrustSec. - * - * @param[in] src Source interface number. - * @param[in] dest Destination interface number. - * @param[in] sgt Security Group Tag value. - * - * @return - * Pointer to the NSS core context. - */ -extern nss_tx_status_t nss_trustsec_tx_update_nexthop(uint32_t src, uint32_t dest, uint16_t sgt); - -/** - * nss_trustsec_tx_get_ctx - * Gets the NSS context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_trustsec_tx_get_ctx(void); - -/** - * nss_trustsec_tx_configure_sgt - * Configures the Security Group Tag value for a source interface. - * - * @param[in] src Source interface number. - * @param[in] dest Destination interface number. - * @param[in] sgt Security Group Tag value. - * - * @return - * Pointer to the NSS core context. - */ -extern nss_tx_status_t nss_trustsec_tx_configure_sgt(uint32_t src, uint32_t dest, uint16_t sgt); - -/** - * nss_trustsec_tx_unconfigure_sgt - * De-configures the Security Group Tag value for a source interface. - * - * @param[in] src Source interface number. - * @param[in] sgt Security Group Tag value. - * - * @return - * Pointer to the NSS core context. - */ -extern nss_tx_status_t nss_trustsec_tx_unconfigure_sgt(uint32_t src, uint16_t sgt); - -/** @} */ /* end_addtogroup nss_trustsec_tx_subsystem */ - -#endif /* __NSS_TRUSTSEC_TX_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_tstamp.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_tstamp.h deleted file mode 100644 index 3c23e4eed..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_tstamp.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_tstamp.h - * NSS to HLOS Tstamp interface definitions. - */ - -#ifndef __NSS_TSTAMP_H -#define __NSS_TSTAMP_H - -/** - * nss_tstamp_msg_type - * Time stamp message types. - */ -enum nss_tstamp_msg_type { - NSS_TSTAMP_MSG_TYPE_SYNC_STATS, /**< Statistic synchronization message. */ - NSS_TSTAMP_MSG_TYPE_MAX, /**< Maximum message type. */ -}; - -/** - * nss_tstamp_h2n_pre_hdr - * Metadata added by the time stamp HLOS driver. - * - * It is used while sending the packet to the NSS time stamp module. - */ -struct nss_tstamp_h2n_pre_hdr { - uint32_t ts_ifnum; /**< Time stamp interface number. */ - uint32_t ts_tx_hdr_sz; /**< Total header size. */ -}; - -/* - * nss_tstamp_n2h_pre_hdr - * Metadata added by the NSS time stamp module. - * - * It is added before sending the packet to host. - */ -struct nss_tstamp_n2h_pre_hdr { - uint32_t ts_ifnum; /**< Time stamp interface number. */ - uint32_t ts_data_lo; /**< Time stamp lower order bits. */ - uint32_t ts_data_hi; /**< Time stamp higher order bits. */ - - uint32_t ts_tx; /**< Time stamp direction. */ - uint32_t ts_hdr_sz; /**< Size of the header including the skb data alignment padding. */ - uint32_t reserved; /**< Reserved for cache alignment. */ -}; - -/** - * nss_tstamp_stats_msg - * Statistics messages from the NSS firmware. - */ -struct nss_tstamp_stats_msg { - struct nss_cmn_node_stats node_stats; - /**< Common node statistics for time stamp. */ - uint32_t boomeranged; /**< Boomeranged packets. */ - uint32_t dropped_fail_enqueue; /**< Enqueue failed. */ - uint32_t dropped_fail_alloc; /**< Allocation for copy failed. */ - uint32_t dropped_fail_copy; /**< Copy failed. */ - uint32_t dropped_no_interface; /**< Next interface not found. */ - uint32_t dropped_no_headroom; /**< Packet does not have enough headroom. */ -}; - -/** - * nss_tstamp_msg - * Data for sending and receiving time stamp messages. - */ -struct nss_tstamp_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a time stamp common message. - */ - union { - struct nss_tstamp_stats_msg stats; - /**< Time stamp statistics. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving core-to-core transmissions messages. - * - * @datatypes - * nss_tstamp_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_tstamp_msg_callback_t)(void *app_data, struct nss_tstamp_msg *msg); - -/** - * nss_tstamp_notify_register - * Registers a notifier callback for time stamp messages with the NSS. - * - * @datatypes - * nss_tstamp_msg_callback_t - * - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_tstamp_notify_register(nss_tstamp_msg_callback_t cb, void *app_data); - -/** - * @brief Transfer the packet to time stamp NSS module. - * - * @return nss_tx_status - */ -nss_tx_status_t nss_tstamp_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *skb, uint32_t if_num); - -#endif /* __NSS_TSTAMP_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_tun6rd.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_tun6rd.h deleted file mode 100644 index b0675e86d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_tun6rd.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014, 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_tun6rd.h - * NSS TUN6RD interface definitions. - */ - -#ifndef __NSS_TUN6RD_H -#define __NSS_TUN6RD_H - -/** - * @addtogroup nss_tun6rd_subsystem - * @{ - */ - -/** - * nss_tun6rd_metadata_types - * Message types for 6RD (IPv6 in IPv4) tunnel requests and responses. - */ -enum nss_tun6rd_metadata_types { - NSS_TUN6RD_ATTACH_PNODE, - NSS_TUN6RD_RX_STATS_SYNC, - NSS_TUN6RD_ADD_UPDATE_PEER, - NSS_TUN6RD_MAX, -}; - -/** - * nss_tun6rd_attach_tunnel_msg - * Message information for configuring the 6RD tunnel. - */ -struct nss_tun6rd_attach_tunnel_msg { - uint32_t saddr; /**< Source address of the tunnel. */ - uint32_t daddr; /**< Destination address of the tunnel. */ - uint8_t tos; /**< Type Of Service field added to the outer header. */ - uint8_t ttl; /**< Time-to-live value for the tunnel. */ - uint32_t sibling_if_num; /**< Sibling interface number. */ - uint16_t reserved; /**< Reserved field added for alignment. */ -}; - -/** - * nss_tun6rd_sync_stats_msg - * Message information for 6RD tunnel synchronization statistics. - */ -struct nss_tun6rd_sync_stats_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ -}; - -/** - * nss_tun6rd_set_peer_msg - * Message information for the 6RD tunnel peer address. - */ -struct nss_tun6rd_set_peer_msg { - uint32_t ipv6_address[4]; /**< IPv6 address. */ - uint32_t dest; /**< IPv4 address. */ -}; - -/** - * nss_tun6rd_msg - * Data for sending and receiving 6RD tunnel messages. - */ -struct nss_tun6rd_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a 6RD tunnel message. - */ - union { - struct nss_tun6rd_attach_tunnel_msg tunnel; - /**< Attach a 6RD tunnel. */ - struct nss_tun6rd_sync_stats_msg stats; - /**< Synchronized statistics for the interface. */ - struct nss_tun6rd_set_peer_msg peer; - /**< Add or update the peer. */ - } msg; /**< Message payload for 6RD tunnel messages exchanged with NSS core. */ -}; - -/** - * Callback function for receiving 6RD tunnel messages. - * - * @datatypes - * nss_tun6rd_msg - * - * @param[in] app_data Pointer to the application context of the message - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_tun6rd_msg_callback_t)(void *app_data, struct nss_tun6rd_msg *msg); - -/** - * nss_tun6rd_tx - * Sends a 6RD tunnel message. - * - * @datatypes - * nss_ctx_instance \n - * nss_tun6rd_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_tun6rd_tx(struct nss_ctx_instance *nss_ctx, struct nss_tun6rd_msg *msg); - -/** - * nss_tun6rd_get_context - * Gets the TUN6RD context used in nss_tun6rd_tx(). - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_tun6rd_get_context(void); - -/** - * Callback function for receiving 6RD tunnel data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_tun6rd_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_register_tun6rd_if - * Registers the TUN6RD interface with the NSS for sending and receiving messages. - * - * @datatypes - * nss_tun6rd_callback_t \n - * nss_tun6rd_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] type NSS interface type. - * @param[in] tun6rd_callback Callback for the data. - * @param[in] msg_callback Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_register_tun6rd_if(uint32_t if_num, uint32_t type, nss_tun6rd_callback_t tun6rd_callback, - nss_tun6rd_msg_callback_t msg_callback, struct net_device *netdev, uint32_t features); - -/** - * nss_unregister_tun6rd_if - * Deregisters the TUN6RD interface from the NSS. - * - * @param[in] if_num NSS interface number. -. * - * @return - * None. - * - * @dependencies - * The 6RD tunnel interface must have been previously registered. - */ -extern void nss_unregister_tun6rd_if(uint32_t if_num); - -/** - * nss_tun6rd_msg_init - * Initializes a TUN6RD message. - * - * @datatypes - * nss_tun6rd_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_tun6rd_msg_init(struct nss_tun6rd_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** @} */ /* end_addtogroup nss_tun6rd_subsystem */ - -#endif /* __NSS_TUN6RD_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_tunipip6.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_tunipip6.h deleted file mode 100644 index 6edc73ba7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_tunipip6.h +++ /dev/null @@ -1,293 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014, 2017-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_tunipip6.h - * NSS TUNIPIP6 interface definitions. - */ - -#ifndef __NSS_TUNIPIP6_H -#define __NSS_TUNIPIP6_H - -/** - * Maximum number of supported TUNIPIP6 tunnels. - */ -#define NSS_TUNIPIP6_TUNNEL_MAX 32 - -/** - * @addtogroup nss_tunipip6_subsystem - * @{ - */ - -/** - * nss_tunipip6_map_rule - * Mapping rule (FMR/BMR) for forwarding traffic to the node in the same domain. - */ -struct nss_tunipip6_map_rule { - uint32_t ip6_prefix[4]; /**< An IPv6 prefix assigned by a mapping rule. */ - uint32_t ip4_prefix; /**< An IPv4 prefix assigned by a mapping rule. */ - uint32_t ip6_prefix_len; /**< IPv6 prefix length. */ - uint32_t ip4_prefix_len; /**< IPv4 prefix length. */ - uint32_t ip6_suffix[4]; /**< IPv6 suffix. */ - uint32_t ip6_suffix_len; /**< IPv6 suffix length. */ - uint32_t ea_len; /**< Embedded Address (EA) bits. */ - uint32_t psid_offset; /**< PSID offset default 6. */ -}; - -/* - * nss_tunipip6_err_types - * Error types for response to messages from the host. - */ -enum nss_tunipip6_err_types { - NSS_TUNIPIP6_ERR_TYPE_MAX_TUNNELS, /**< Maximum number of tunnel reached. */ - NSS_TUNIPIP6_ERR_TYPE_TUNNEL_EXIST, /**< Tunnel already exists. */ - NSS_TUNIPIP6_ERR_TYPE_ENCAP_BAD_PARAM, /**< Bad configuration. */ - NSS_TUNIPIP6_ERR_TYPE_ENCAP_FMR_EXIST, /**< FMR already exists. */ - NSS_TUNIPIP6_ERR_TYPE_ENCAP_NO_FMR, /**< No FMR configured.*/ - NSS_TUNIPIP6_ERR_TYPE_ENCAP_FMR_FULL, /**< FMR table is full. */ - NSS_TUNIPIP6_ERR_TYPE_ENCAP_INVALID_FMR, /**< Invalid FMR configured.*/ - NSS_TUNIPIP6_ERR_TYPE_ENCAP_BMR_EXIST, /**< BMR already exists. */ - NSS_TUNIPIP6_ERR_TYPE_ENCAP_NO_BMR, /**< No BMR configured. */ - NSS_TUNIPIP6_ERR_TYPE_ENCAP_FMR_MEM_ALLOC_FAILED, /**< Pool allocation for FMR failed. */ - NSS_TUNIPIP6_ERR_TYPE_UNKNOWN, /**< Unknown message type. */ - NSS_TUNIPIP6_ERROR_MAX, /**< Maximum number of errors. */ -}; - -/** - * nss_tunipip6_metadata_types - * Message types for TUNIPIP6 (IPv4 in IPv6) tunnel requests and responses. - */ -enum nss_tunipip6_metadata_types { - NSS_TUNIPIP6_TX_ENCAP_IF_CREATE, - NSS_TUNIPIP6_TX_DECAP_IF_CREATE, - NSS_TUNIPIP6_STATS_SYNC, - NSS_TUNIPIP6_FMR_RULE_ADD, - NSS_TUNIPIP6_FMR_RULE_DEL, - NSS_TUNIPIP6_FMR_RULE_FLUSH, - NSS_TUNIPIP6_BMR_RULE_ADD, - NSS_TUNIPIP6_BMR_RULE_DEL, - NSS_TUNIPIP6_MAX, -}; - -/** - * nss_tunipip6_create_msg - * Payload for configuring the TUNIPIP6 interface. - */ -struct nss_tunipip6_create_msg { - uint32_t saddr[4]; /**< Tunnel source address. */ - uint32_t daddr[4]; /**< Tunnel destination address. */ - uint32_t flowlabel; /**< Tunnel IPv6 flow label. */ - uint32_t flags; /**< Tunnel additional flags. */ - uint32_t sibling_if_num; /**< Sibling interface number. */ - uint8_t hop_limit; /**< Tunnel IPv6 hop limit. */ - uint8_t draft03; /**< Use MAP-E draft03 specification. */ - uint8_t ttl_inherit; /**< Inherit IPv4 TTL to hoplimit. */ - uint8_t tos_inherit; /**< Inherit IPv4 ToS. */ - uint8_t frag_id_update; /**< Enable update of fragment identifier of IPv4. */ - uint8_t reserved[3]; /**< Reserved bytes. */ - uint32_t fmr_max; /**< Maximum number of FMRs that can be configured. */ -}; - -/** - * nss_tunipip6_debug_stats - * TUNIPIP6 debug statistics. - */ -struct nss_tunipip6_debug_stats { - struct { - struct { - uint32_t low_headroom; /**< Low headroom for encapsulation. */ - uint32_t unhandled_proto; /**< Unhandled protocol for encapsulation. */ - } exp; - - struct { - uint32_t enqueue_fail; /**< Encapsulation enqueue fail. */ - } drop; - - struct { - uint32_t err_tunnel_cfg; /**< Tunnel configuration error. */ - uint32_t total_fmr; /**< Total number of existing FMRs. */ - uint32_t fmr_add_req; /**< FMR add requests. */ - uint32_t fmr_del_req; /**< FMR delete requests. */ - uint32_t fmr_flush_req; /**< FMR flush requests. */ - uint32_t fmr_update_req; /**< FMR update requests. */ - uint32_t fmr_add_fail; /**< FMR addition failed. */ - uint32_t fmr_del_fail; /**< FMR deletion failed. */ - uint32_t err_no_fmr; /**< No FMR configured. */ - uint32_t bmr_add_req; /**< BMR add requests. */ - uint32_t bmr_del_req; /**< BMR delete requests. */ - uint32_t err_bmr_exist; /**< BMR already configured. */ - uint32_t err_no_bmr; /**< No BMR configured. */ - } cfg; - } encap; - - struct { - struct { - uint32_t enqueue_fail; /**< Decapsulation enqueue fail. */ - } drop; - } decap; -}; - -/** - * nss_tunipip6_stats_sync_msg - * Message information for TUNIPIP6 synchronization statistics. - */ -struct nss_tunipip6_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - struct nss_tunipip6_debug_stats tun_stats; /**< TUNIPIP6 debug statistics. */ -}; - -/** - * nss_tunipip6_msg - * Data for sending and receiving TUNIPIP6 messages. - */ -struct nss_tunipip6_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a TUNIPIP6 message. - */ - union { - struct nss_tunipip6_create_msg tunipip6_create; - /**< Create a TUNIPIP6 tunnel. */ - struct nss_tunipip6_stats_sync_msg stats; - /**< Synchronized statistics for the TUNIPIP6 interface. */ - struct nss_tunipip6_map_rule map_rule; - /**< BMR/FMR rule to add/delete, new or existing rules. */ - } msg; /**< Message payload for TUNIPIP6 messages exchanged with NSS core. */ -}; - -/** - * Callback function for receiving TUNIPIP6 messages. - * - * @datatypes - * nss_tunipip6_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_tunipip6_msg_callback_t)(void *app_data, struct nss_tunipip6_msg *msg); - -/** - * nss_tunipip6_tx - * Sends a TUNIPIP6 message to NSS core. - * - * @datatypes - * nss_ctx_instance \n - * nss_tunipip6_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_tunipip6_tx(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *msg); - -/** - * nss_tunipip6_tx_sync - * Sends a TUNIPIP6 message to NSS core synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_tunipip6_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_tunipip6_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *msg); - -/** - * Callback function for receiving TUNIPIP6 data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_tunipip6_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_register_tunipip6_if - * Registers the TUNIPIP6 interface with the NSS for sending and receiving - * TUNIPIP6 messages. - * - * @datatypes - * nss_tunipip6_callback_t \n - * nss_tunipip6_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] type Dynamic interface type. - * @param[in] tunipip6_callback Callback for the data. - * @param[in] event_callback Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_register_tunipip6_if(uint32_t if_num, uint32_t type, nss_tunipip6_callback_t tunipip6_callback, - nss_tunipip6_msg_callback_t event_callback, struct net_device *netdev, uint32_t features); - -/** - * nss_unregister_tunipip6_if - * Deregisters the TUNIPIP6 interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -extern void nss_unregister_tunipip6_if(uint32_t if_num); - -/** - * nss_tunipip6_msg_init - * Initializes a TUNIPIP6 message. - * - * @datatypes - * nss_tunipip6_msg - * - * @param[in,out] ntm Pointer to the IPIP6 tunnel message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the message. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_tunipip6_msg_init(struct nss_tunipip6_msg *ntm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_tunipip6_get_context() - * Get TUNIPIP6 context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_tunipip6_get_context(void); - -/** @} */ /* end_addtogroup nss_tunipip6_subsystem */ - -#endif /* __NSS_TUN6RD_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_udp_st.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_udp_st.h deleted file mode 100755 index d6f3aa4dd..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_udp_st.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_udp_st.h - * NSS Ethernet interface definitions. - */ - -#ifndef __NSS_UDP_ST_H -#define __NSS_UDP_ST_H - -/** - * @addtogroup nss_udp_st_subsystem - * @{ - */ - -#define NSS_UDP_ST_TX_CONN_MAX 16 -#define NSS_UDP_ST_FLAG_IPV4 4 /**< L3 Protocol - IPv4. */ -#define NSS_UDP_ST_FLAG_IPV6 6 /**< L3 Protocol - IPv6. */ - -/** - * nss_udp_st_message_types - * UDP speed test message types. - */ -enum nss_udp_st_message_types { - NSS_UDP_ST_START_MSG, /**< Start message. */ - NSS_UDP_ST_STOP_MSG, /**< Stop message. */ - NSS_UDP_ST_CFG_RULE_MSG, /**< Configure IPv4/IPv6 rule. */ - NSS_UDP_ST_UNCFG_RULE_MSG, /**< Unconfigure IPv4/IPv6 rule. */ - NSS_UDP_ST_STATS_SYNC_MSG, /**< Statistic syncronization. */ - NSS_UDP_ST_TX_CREATE_MSG, /**< Create transmit node. */ - NSS_UDP_ST_TX_DESTROY_MSG, /**< Destroy transmit node. */ - NSS_UDP_ST_RESET_STATS_MSG, /**< Reset existing statistics. */ - NSS_UDP_ST_MAX_MSG_TYPES, /**< Maximum message type. */ -}; - -/** - * nss_udp_st_test_types - * Test types of the UDP speed test. - */ -enum nss_udp_st_test_types { - NSS_UDP_ST_TEST_RX, /**< Test type is receive. */ - NSS_UDP_ST_TEST_TX, /**< Test type is transmit. */ - NSS_UDP_ST_TEST_MAX /**< Maximum test type. */ -}; - -/** - * nss_udp_st_error - * UDP speed test error types. - */ -enum nss_udp_st_error { - NSS_UDP_ST_ERROR_NONE, /**< No error. */ - NSS_UDP_ST_ERROR_INCORRECT_RATE, /**< Incorrect Tx rate. */ - NSS_UDP_ST_ERROR_INCORRECT_BUFFER_SIZE, /**< Incorrect buffer size. */ - NSS_UDP_ST_ERROR_MEMORY_FAILURE, /**< Memory allocation failed. */ - NSS_UDP_ST_ERROR_INCORRECT_STATE, /**< Trying to configure during incorrect state. */ - NSS_UDP_ST_ERROR_INCORRECT_FLAGS, /**< Incorrect flag configuration. */ - NSS_UDP_ST_ERROR_ENTRY_EXIST, /**< Given tunnel entry already exists. */ - NSS_UDP_ST_ERROR_ENTRY_ADD_FAILED, /**< UDP ST Encap entry addition failed. */ - NSS_UDP_ST_ERROR_ENTRY_NOT_EXIST, /**< Given tunnel entry does not exists. */ - NSS_UDP_ST_ERROR_WRONG_START_MSG_TYPE, /**< Start message type error. */ - NSS_UDP_ST_ERROR_WRONG_STOP_MSG_TYPE, /**< Stop message type error. */ - NSS_UDP_ST_ERROR_TOO_MANY_USERS, /**< Too many users tried to be added. */ - NSS_UDP_ST_ERROR_UNKNOWN_MSG_TYPE, /**< Unknown message type failure. */ - NSS_UDP_ST_ERROR_PB_ALLOC, /**< Pbuf allocation failed. */ - NSS_UDP_ST_ERROR_PB_SIZE, /**< Pbuf size is too small to fit buffer. */ - NSS_UDP_ST_ERROR_DROP_QUEUE, /**< Packet dropped enqueue next node. */ - UDP_ST_ERROR_TIMER_MISSED, /**< Timer call is missed. */ - NSS_UDP_ST_ERROR_MAX, /**< Maximum error type. */ -}; - -/** - * nss_udp_st_stats_time - * UDP speed test time statistics types. - */ -enum nss_udp_st_stats_time { - NSS_UDP_ST_STATS_TIME_START, /**< Start time of the test. */ - NSS_UDP_ST_STATS_TIME_CURRENT, /**< Current time of the running test. */ - NSS_UDP_ST_STATS_TIME_ELAPSED, /**< Elapsed time of the current test. */ - NSS_UDP_ST_STATS_TIME_MAX /**< Maximum time statistics. */ -}; - -/** - * Create TX node to start pushing rules. - */ -struct nss_udp_st_tx_create { - uint32_t rate; /**< Rate in Mbps. */ - uint32_t buffer_size; /**< UDP buffer size. */ - uint8_t dscp; /**< DSCP value. */ -}; - -/** - * Destroy Tx node. - */ -struct nss_udp_st_tx_destroy { - uint32_t flag; /**< Tx destroy flag. */ -}; - -/** - * NSS UDP speed test start structure. - */ -struct nss_udp_st_start { - uint32_t type; /**< Started test type (for example, receive or transmit). */ - -}; - -/** - * NSS UDP speed test stop structure. - */ -struct nss_udp_st_stop { - uint32_t type; /**< Stopped test type (for example, receive or transmit). */ -}; - -/** - * NSS UDP speed test ip structure - */ -struct nss_udp_st_ip { - union { - uint32_t ipv4; /**< IPv4 address. */ - uint32_t ipv6[4]; /**< IPv6 address. */ - } ip; -}; - -/** - * NSS UDP speed test IPv4/IPv6 configuration structure. - */ -struct nss_udp_st_cfg { - struct nss_udp_st_ip src_ip; /**< Source IP address. */ - int32_t src_port; /**< Source L4 port. */ - struct nss_udp_st_ip dest_ip; /**< Destination IP address. */ - int32_t dest_port; /**< Destination L4 port. */ - uint32_t type; /**< Started test type (for example, receive or transmit). */ - uint16_t ip_version; /**< IP version to indicate IPv4 or IPv6. */ -}; - -/** - * NSS UDP speed test node statistics structure. - */ -struct nss_udp_st_node_stats { - struct nss_cmn_node_stats node_stats; /**< Common node statistics for the UDP speed test. */ - uint32_t errors[NSS_UDP_ST_ERROR_MAX]; /**< Error statistics. */ -}; - -/** - * NSS UDP speed test statistics structure. - */ -struct nss_udp_st_stats { - struct nss_udp_st_node_stats nstats; /**< Node statistics for the UDP speed test. */ - uint32_t time_stats[NSS_UDP_ST_TEST_MAX][NSS_UDP_ST_STATS_TIME_MAX]; - /**< Time statistics. */ -}; - -/** - * NSS UDP speed test reset statistics structure. - */ -struct nss_udp_st_reset_stats { - uint32_t flag; /**< Reset statistics flag. */ -}; - -/** - * Message structure of the UDP speed test commands. - */ -struct nss_udp_st_msg { - struct nss_cmn_msg cm; /**< Message header. */ - union { - struct nss_udp_st_tx_create create; /**< Prepare transmit message. */ - struct nss_udp_st_tx_destroy destroy; /**< Destroy transmit message. */ - struct nss_udp_st_start start; /**< Start message. */ - struct nss_udp_st_stop stop; /**< Stop message. */ - struct nss_udp_st_cfg cfg; /**< IPv4/IPv6 configuration message. */ - struct nss_udp_st_cfg uncfg; /**< IPv4/IPv6 unconfiguration message. */ - struct nss_udp_st_stats stats; /**< Statistics synchronization message. */ - struct nss_udp_st_reset_stats reset_stats; - /**< Reset statistics message. */ - } msg; -}; - -/** - * Callback function for receiving UDP speed test messages. - * - * @datatypes - * nss_udp_st_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_udp_st_msg_callback_t)(void *app_data, struct nss_udp_st_msg *msg); - -/** - * nss_udp_st_register_handler - * Registers the UDP speed test message handler. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * None. - */ -extern void nss_udp_st_register_handler(struct nss_ctx_instance *nss_ctx); - -/** - * nss_udp_st_tx - * Transmits a UDP speed test message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_udp_st_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] num Pointer to the message data. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_udp_st_tx(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_msg *num); - -/** - * nss_udp_st_tx_sync - * Transmits a synchronous UDP speed test message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_udp_st_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] num Pointer to the message data. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_udp_st_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_msg *num); - -/** - * nss_udp_st_msg_init - * Initializes UDP speed test messages. - * - * @datatypes - * nss_udp_st_msg \n - * nss_udp_st_msg_callback_t - * - * @param[in,out] num Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_udp_st_msg_init(struct nss_udp_st_msg *num, uint16_t if_num, uint32_t type, uint32_t len, - nss_udp_st_msg_callback_t cb, void *app_data); - -/** - * nss_udp_st_get_mgr - * Gets the NSS context that is managing UDP speed sest processes. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_udp_st_get_mgr(void); - -/** - *@} - */ - -#endif /* __NSS_UDP_ST_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_unaligned.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_unaligned.h deleted file mode 100644 index 2eb6e1a4a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_unaligned.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_unaligned.h - * NSS unaligned interface definitions. - */ - -#ifndef __NSS_UNALIGNED_H -#define __NSS_UNALIGNED_H - -/** - * @addtogroup nss_unaligned_subsystem - * @{ - */ - -#define NSS_UNALIGNED_OPS_PER_MSG 54 - /**< The number of operations whose statistics are included in a message. */ -#define NSS_UNALIGNED_EMULATED_OPS 64 - /**< The number of operations that are emulated. */ - -/** - * nss_unaligned_msg_types - * Unaligned message types. - */ -enum nss_unaligned_msg_types { - NSS_UNALIGNED_MSG_STATS, /**< Performance statistics message. */ - NSS_UNALIGNED_MSG_MAX, /**< Maximum unaligned message type. */ -}; - -/** - * nss_unaligned_stats_op - * Performance statistics for emulating a single operation. - */ -struct nss_unaligned_stats_op { - uint32_t opcode_primary; - /**< Primary operation code. */ - uint32_t opcode_extension; - /**< Extension operation code, if applicable. */ - uint64_t count; - /**< Number of times operation was emulated. */ - uint32_t ticks_min; - /**< Minimum number of ticks spent emulating operation. */ - uint32_t ticks_avg; - /**< Average number of ticks spent emulating operation. */ - uint32_t ticks_max; - /**< Maximum number of ticks spent emulating operation. */ - uint32_t padding; - /**< Used for consistent alignment, can be re-used. */ -}; - -/** - * nss_unaligned_stats - * Message containing all non-zero operation statistics. - */ -struct nss_unaligned_stats { - uint64_t trap_count; - /**< Number of unaligned traps encountered. */ - struct nss_unaligned_stats_op ops[NSS_UNALIGNED_EMULATED_OPS]; - /**< Statistics for each operation. */ -}; - -/** - * nss_unaligned_stats_msg - * Message containing all non-zero operation statistics. - */ -struct nss_unaligned_stats_msg { - uint64_t trap_count; /**< Number of unaligned traps encountered. */ - struct nss_unaligned_stats_op ops[NSS_UNALIGNED_OPS_PER_MSG]; - /**< Statistics for each operation. */ - uint32_t current_iteration; /**< Number of full statistics messages sent without reaching the end. */ -}; - -/** - * nss_unaligned_msg - * Message from unaligned handler node. - */ -struct nss_unaligned_msg { - struct nss_cmn_msg cm; /**< Message header. */ - - /** - * Unaligned message payload. - */ - union { - struct nss_unaligned_stats_msg stats_msg; - /**< Message containing statistics. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_unaligned_register_handler() - * Registers message handler on the NSS unaligned interface and - * statistics dentry. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS context. - * - * @return - * None. - */ -void nss_unaligned_register_handler(struct nss_ctx_instance *nss_ctx); - -/** - * @} - */ -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_virt_if.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_virt_if.h deleted file mode 100644 index 443e6cf86..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_virt_if.h +++ /dev/null @@ -1,436 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2017, 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * @file nss_virt_if.h - * NSS Virtual interface message Structure and APIs - */ - -#ifndef __NSS_VIRT_IF_H -#define __NSS_VIRT_IF_H - -#include "nss_if.h" - -/** - * @addtogroup nss_virtual_if_subsystem - * @{ - */ - -/** - * nss_virt_if_msg_types - * Message types for virtual interface requests and responses. - */ -enum nss_virt_if_msg_types { - NSS_VIRT_IF_OPEN = NSS_IF_OPEN, - NSS_VIRT_IF_CLOSE = NSS_IF_CLOSE, - NSS_VIRT_IF_LINK_STATE_NOTIFY = NSS_IF_LINK_STATE_NOTIFY, - NSS_VIRT_IF_MTU_CHANGE = NSS_IF_MTU_CHANGE, - NSS_VIRT_IF_MAC_ADDR_SET = NSS_IF_MAC_ADDR_SET, - NSS_VIRT_IF_STATS_SYNC = NSS_IF_STATS, - NSS_VIRT_IF_ISHAPER_ASSIGN = NSS_IF_ISHAPER_ASSIGN, - NSS_VIRT_IF_BSHAPER_ASSIGN = NSS_IF_BSHAPER_ASSIGN, - NSS_VIRT_IF_ISHAPER_UNASSIGN = NSS_IF_ISHAPER_UNASSIGN, - NSS_VIRT_IF_BSHAPER_UNASSIGN = NSS_IF_BSHAPER_UNASSIGN, - NSS_VIRT_IF_ISHAPER_CONFIG = NSS_IF_ISHAPER_CONFIG, - NSS_VIRT_IF_BSHAPER_CONFIG = NSS_IF_BSHAPER_CONFIG, - NSS_VIRT_IF_VSI_ASSIGN = NSS_IF_VSI_ASSIGN, - NSS_VIRT_IF_VSI_UNASSIGN = NSS_IF_VSI_UNASSIGN, - NSS_VIRT_IF_TX_CONFIG_MSG = NSS_IF_MAX_MSG_TYPES + 1, - NSS_VIRT_IF_STATS_SYNC_MSG, - NSS_VIRT_IF_MAX_MSG_TYPES, -}; - -/** - * nss_virt_if_error_types - * Error types for the virtual interface. - */ -enum nss_virt_if_error_types { - NSS_VIRT_IF_SUCCESS, - NSS_VIRT_IF_CORE_FAILURE, - NSS_VIRT_IF_ALLOC_FAILURE, - NSS_VIRT_IF_DYNAMIC_IF_FAILURE, - NSS_VIRT_IF_MSG_TX_FAILURE, - NSS_VIRT_IF_REG_FAILURE, - NSS_VIRT_IF_CORE_NOT_INITIALIZED, -}; - -/** - * nss_virt_if_base_node_stats - * Virtual interface statistics of NSS base node. - */ -struct nss_virt_if_base_node_stats { - uint32_t active_interfaces; /**< Number of active virtual interfaces. */ - uint32_t ocm_alloc_failed; /**< Number of interface allocation failure on OCM. */ - uint32_t ddr_alloc_failed; /**< Number of interface allocation failure on DDR. */ -}; - -/** - * nss_virt_if_interface_stats - * Virtual interface statistics of each pair of interfaces. - */ -struct nss_virt_if_interface_stats { - struct nss_cmn_node_stats node_stats; /**< Common statistics. */ - uint32_t tx_enqueue_failed; /**< Tx enqueue failures in the firmware. */ - uint32_t shaper_enqueue_failed; /**< Shaper enqueue failures in the firmware. */ - uint32_t ocm_alloc_failed; /**< Number of allocation failure on OCM. */ -}; - -/** - * nss_virt_if_stats - * Virtual interface statistics received from the NSS. - */ -struct nss_virt_if_stats { - struct nss_virt_if_base_node_stats base_stats; - struct nss_virt_if_interface_stats if_stats; -}; - -/** - * nss_virt_if_config_msg - * Message information for configuring the virtual interface. - */ -struct nss_virt_if_config_msg { - uint32_t flags; /**< Interface flags. */ - uint32_t sibling; /**< Sibling interface number. */ - uint32_t nexthop; /**< Next hop interface number. */ - uint8_t mac_addr[ETH_ALEN]; /**< MAC address. */ -}; - -/** - * nss_virt_if_msg - * Data for sending and receiving virtual interface messages. - */ -struct nss_virt_if_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a virtual interface message. - */ - union { - union nss_if_msgs if_msgs; - /**< NSS interface base message. */ - struct nss_virt_if_config_msg if_config; - /**< Rule for creating a virtual interface. */ - struct nss_virt_if_stats stats; - /**< Virtual interface statistics. */ - } msg; /**< Message payload. */ -}; - -/* - * nss_virt_if_pvt - * Private data information for the virtual interface. - */ -struct nss_virt_if_pvt { - struct semaphore sem; - /**< Semaphore to ensure that only one instance of a message is sent to the NSS. */ - struct completion complete; - /**< Waits for message completion or time out. */ - int response; /**< Message process response from the NSS firmware. */ - int sem_init_done; /**< Semaphore initialization is done. */ -}; - -/** - * Callback to transmit virtual interface data received from NSS - * to the transmit path of the virtual interface. - * - * @datatypes - * net_device \n - * sk_buff - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - */ -typedef void (*nss_virt_if_xmit_callback_t)(struct net_device *netdev, struct sk_buff *skb); - -/** - * Callback function for virtual interface data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_virt_if_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for virtual interface messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_virt_if_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_virt_if_handle - * Context information for WLAN-to-NSS communication. - */ -struct nss_virt_if_handle { - struct nss_ctx_instance *nss_ctx; /**< NSS context. */ - int32_t if_num_n2h; /**< Redirect interface number on NSS-to-host path. */ - int32_t if_num_h2n; /**< Redirect interface number on host-to-NSS path. */ - struct net_device *ndev; /**< Associated network device. */ - struct nss_virt_if_pvt *pvt; /**< Private data structure. */ - struct nss_virt_if_stats stats; /**< Virtual interface statistics. */ - atomic_t refcnt; /**< Reference count. */ - nss_virt_if_msg_callback_t cb; /**< Message callback. */ - void *app_data; /**< Application data to be passed to the callback. */ -}; - -/** - * nss_virt_if_dp_type - * Virtual interface datapath types. Redirect interface on NSS-to-host path will be seen by ECM for rules. - */ -enum nss_virt_if_dp_type { - NSS_VIRT_IF_DP_REDIR_N2H, /**< Redirect interface on NSS-to-host path has zero value. */ - NSS_VIRT_IF_DP_REDIR_H2N, /**< Redirect interface on host-to-NSS path has non-zero value. */ -}; - -/** - * nss_virt_if_create - * Creates a virtual interface asynchronously. - * - * @datatypes - * net_device \n - * nss_virt_if_msg_callback_t - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] cb Callback function for the message. This callback is - invoked when the response from the firmware is received. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Status of the Tx operation. - */ -extern int nss_virt_if_create(struct net_device *netdev, nss_virt_if_msg_callback_t cb, void *app_data); - -/** - * nss_virt_if_create_sync - * Creates a virtual interface synchronously with the default nexthop values - * NSS_N2H_INTERFACE and NSS_ETH_RX_INTERFACE. - * - * @datatypes - * net_device - * - * @param[in] netdev Pointer to the associated network device. - * - * @return - * Pointer to nss_virt_if_handle. - */ -extern struct nss_virt_if_handle *nss_virt_if_create_sync(struct net_device *netdev); - -/** - * nss_virt_if_create_sync_nexthop - * Creates a virtual interface synchronously with specified nexthops. - * - * @datatypes - * net_device - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] nexthop_n2h Nexthop interface number of network-to-host dynamic interface. - * @param[in] nexthop_h2n Nexthop interface number of host-to-network dynamic interface. - * - * @return - * Pointer to NSS virtual interface handle. - */ -extern struct nss_virt_if_handle *nss_virt_if_create_sync_nexthop(struct net_device *netdev, uint32_t nexthop_n2h, uint32_t nexthop_h2n); - -/** - * nss_virt_if_destroy - * Destroys the virtual interface asynchronously. - * - * @datatypes - * nss_virt_if_handle \n - * nss_virt_if_msg_callback_t - * - * @param[in,out] handle Pointer to the virtual interface handle (provided during - * dynamic interface allocation). - * @param[in] cb Callback function for the message. This callback is - * invoked when the response from the firmware is received. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * Status of the Tx operation. - * - * @dependencies - * The interface must have been previously created. - */ -extern nss_tx_status_t nss_virt_if_destroy(struct nss_virt_if_handle *handle, nss_virt_if_msg_callback_t cb, void *app_data); - -/** - * nss_virt_if_destroy_sync - * Destroys the virtual interface synchronously. - * - * @datatypes - * nss_virt_if_handle - * - * @param[in,out] handle Pointer to the virtual interface handle (provided during - * dynamic interface allocation). - * - * @return - * Status of the Tx operation. - * - * @dependencies - * The interface must have been previously created. - */ -extern nss_tx_status_t nss_virt_if_destroy_sync(struct nss_virt_if_handle *handle); - -/** - * nss_virt_if_tx_msg - * Sends a message to the virtual interface. - * - * @datatypes - * nss_ctx_instance \n - * nss_virt_if_msg - * - * @param[in] nss_ctx Pointer to the NSS context (provided during registration). - * @param[in] nvim Pointer to the virtual interface message. - * - * @return - * Command Tx status. - */ -extern nss_tx_status_t nss_virt_if_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_virt_if_msg *nvim); - -/** - * nss_virt_if_tx_buf - * Forwards virtual interface packets to the NSS. - * - * @datatypes - * nss_virt_if_handle \n - * sk_buff - * - * @param[in,out] handle Pointer to the virtual interface handle (provided during - * registration). - * @param[in] skb Pointer to the data socket buffer. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_virt_if_tx_buf(struct nss_virt_if_handle *handle, - struct sk_buff *skb); - -/** - * nss_virt_if_xmit_callback_register - * Registers a transmit callback to a virtual interface. - * - * @datatypes - * nss_virt_if_handle \n - * nss_virt_if_xmit_callback_t - * - * @param[in,out] handle Pointer to the virtual interface handle (provided during - * dynamic interface allocation). - * @param[in] cb Callback handler for virtual data packets. - * - * @return - * None. - */ -extern void nss_virt_if_xmit_callback_register(struct nss_virt_if_handle *handle, - nss_virt_if_xmit_callback_t cb); - -/** - * nss_virt_if_xmit_callback_unregister - * Deregisters the transmit callback from the virtual interface. - * - * @datatypes - * nss_virt_if_handle - * - * @param[in,out] handle Pointer to the virtual interface handle. - * - * @return - * None. - */ -extern void nss_virt_if_xmit_callback_unregister(struct nss_virt_if_handle *handle); - -/** - * nss_virt_if_register - * Registers a virtual Interface with NSS driver. - * - * @datatypes - * nss_virt_if_handle \n - * nss_virt_if_data_callback_t \n - * net_device - * - * @param[in,out] handle Pointer to the virtual interface handle(provided during - * dynamic interface allocation). - * @param[in] data_callback Callback handler for virtual data packets - * @param[in] netdev Pointer to the associated network device. - * - * @return - * Status of the Tx operation. - */ -extern void nss_virt_if_register(struct nss_virt_if_handle *handle, - nss_virt_if_data_callback_t data_callback, - struct net_device *netdev); - -/** - * nss_virt_if_unregister - * Deregisters a virtual interface from the NSS driver. - * - * @datatypes - * nss_virt_if_handle - * - * @param[in,out] handle Pointer to the virtual interface handle. - * - * @return - * None. - */ -extern void nss_virt_if_unregister(struct nss_virt_if_handle *handle); - -/** - * nss_virt_if_get_interface_num - * Returns the virtual interface number associated with the handle. - * - * @datatypes - * nss_virt_if_handle - * - * @param[in] handle Pointer to the virtual interface handle(provided during - dynamic interface allocation). - * - * @return - * Virtual interface number. - */ -extern int32_t nss_virt_if_get_interface_num(struct nss_virt_if_handle *handle); - -/** - * nss_virt_if_verify_if_num - * Verifies if the interface is 802.3 redirect type. - * - * @param[in] if_num Interface number to be verified. - * - * @return - * True if if_num is 802.3 redirect type. - */ -bool nss_virt_if_verify_if_num(uint32_t if_num); - -/** - * nss_virt_if_get_context - * Gets the virtual interface context. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_virt_if_get_context(void); - -/** - * @} - */ - -#endif /* __NSS_VIRT_IF_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_vlan.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_vlan.h deleted file mode 100644 index 872d2e042..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_vlan.h +++ /dev/null @@ -1,265 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_vlan.h - * NSS VLAN interface definitions. - */ - -#ifndef __NSS_VLAN_H -#define __NSS_VLAN_H - -/** - * @addtogroup nss_vlan_subsystem - * @{ - */ - -/** - * nss_vlan_msg_types - * VLAN message types. - */ -enum nss_vlan_msg_types { - NSS_VLAN_MSG_ADD_TAG = NSS_IF_MAX_MSG_TYPES + 1, - NSS_VLAN_MSG_TYPE_MAX, -}; - -/** - * nss_vlan_error_types - * VLAN error types - */ -enum nss_vlan_error_types { - NSS_VLAN_ERROR_UNKNOWN_MSG = NSS_IF_ERROR_TYPE_MAX + 1, - NSS_VLAN_ERROR_TYPE_MAX, -}; - -#define NSS_VLAN_TYPE_SINGLE 0 /**< Single VLAN tag in message. */ -#define NSS_VLAN_TYPE_DOUBLE 1 /**< Double VLAN tag in message. */ - -/** - * nss_vlan_msg_add_tag - * VLAN message data for adding a VLAN tag. - */ -struct nss_vlan_msg_add_tag { - uint32_t vlan_tag; /**< VLAN tag information. */ - uint32_t next_hop; /**< Parent interface. */ - uint32_t if_num; /**< Actual physical interface. */ -}; - -/** - * nss_vlan_msg - * Data for sending and receiving VLAN messages. - */ -struct nss_vlan_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a VLAN message. - */ - union { - union nss_if_msgs if_msg; - /**< NSS interface base messages. */ - struct nss_vlan_msg_add_tag add_tag; - /**< VLAN add-a-tag message. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_vlan_tx_msg - * Sends a VLAN message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_vlan_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_vlan_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_vlan_msg *msg); - -/** - * nss_vlan_tx_msg_sync - * Sends a VLAN message to the NSS synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_vlan_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_vlan_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_vlan_msg *msg); - -/** - * Initializes a VLAN message. - * - * @datatypes - * nss_vlan_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -void nss_vlan_msg_init(struct nss_vlan_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_vlan_get_context - * Gets the VLAN context used in nss_vlan_tx. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_vlan_get_context(void); - -/** - * Callback when VLAN data is received - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_vlan_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback to receive VLAN messages - * - * @datatypes - * nss_vlan_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_vlan_msg_callback_t)(void *app_data, struct nss_vlan_msg *msg); - -/** - * nss_register_vlan_if - * Register to send/receive VLAN messages to NSS - * - * @datatypes - * nss_vlan_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] vlan_data_callback Callback for the data. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * @param[in] app_ctx Pointer to the application context of the message. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_register_vlan_if(uint32_t if_num, nss_vlan_callback_t vlan_data_callback, - struct net_device *netdev, uint32_t features, void *app_ctx); - -/** - * Deregisters the VLAN interface from the NSS. - * - * @return - * None. - */ -void nss_unregister_vlan_if(uint32_t if_num); - -/** - * nss_vlan_tx_set_mtu_msg - * Sends a VLAN message to set the MTU. - * - * @param[in] vlan_if_num VLAN interface number. - * @param[in] mtu MTU value to set. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_vlan_tx_set_mtu_msg(uint32_t vlan_if_num, uint32_t mtu); - -/** - * nss_vlan_tx_set_mac_addr_msg - * Sends a VLAN message to set the MAC address. - * - * @param[in] vlan_if_num VLAN interface number. - * @param[in] addr Pointer to the MAC address. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_vlan_tx_set_mac_addr_msg(uint32_t vlan_if_num, uint8_t *addr); - -/** - * nss_vlan_tx_vsi_attach_msg - * Send a VLAN message to attach a VSI. - * - * @param[in] vlan_if_num VLAN interface number. - * @param[in] vsi PPE VSI to attach. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_vlan_tx_vsi_attach_msg(uint32_t vlan_if_num, uint32_t vsi); - -/** - * nss_vlan_tx_vsi_detach_msg - * Sends a VLAN message to detach VSI. - * - * @param[in] vlan_if_num VLAN interface number. - * @param[in] vsi VSI to detach. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_vlan_tx_vsi_detach_msg(uint32_t vlan_if_num, uint32_t vsi); - -/** - * nss_vlan_tx_add_tag_msg - * Sends a VLAN add tag message. - * - * @param[in] vlan_if_num VLAN interface number. - * @param[in] vlan_tag VLAN tag information. - * @param[in] next_hop Parent interface. - * @param[in] physical_dev Physical port to which to add the VLAN tag. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_vlan_tx_add_tag_msg(uint32_t vlan_if_num, uint32_t vlan_tag, uint32_t next_hop, uint32_t physical_dev); - -/** - * Registers the VLAN handler with the NSS. - * - * @return - * None. - */ -void nss_vlan_register_handler(void); - -/** - * @} - */ - -#endif /* __NSS_VLAN_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_vxlan.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_vxlan.h deleted file mode 100644 index 254f4bee1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_vxlan.h +++ /dev/null @@ -1,350 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, 2021 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_vxlan.h - * NSS VxLAN interface definitions. - */ - -#ifndef __NSS_VXLAN_H -#define __NSS_VXLAN_H - -/** - * @addtogroup nss_vxlan_subsystem - * @{ - */ - -/** - * Maximum number of supported VxLAN tunnel sessions. - */ -#define NSS_VXLAN_MAX_TUNNELS 64 - -/** - * Maximum number of supported VxLAN FDB entries. - */ -#define NSS_VXLAN_MACDB_ENTRIES_MAX 1024 - -/** - * MAC database entries per message. - */ -#define NSS_VXLAN_MACDB_ENTRIES_PER_MSG 20 - -/* - * VxLAN Rule configure message flags - */ -#define NSS_VXLAN_RULE_FLAG_GBP_ENABLED 0x0001 /**< Group Policy ID is eanbled. */ -#define NSS_VXLAN_RULE_FLAG_INHERIT_TOS 0x0002 /**< Use inner TOS for encapsulation. */ -#define NSS_VXLAN_RULE_FLAG_ENCAP_L4_CSUM_REQUIRED 0x0004 /**< Generate transmit checksum. */ -#define NSS_VXLAN_RULE_FLAG_IPV4 0x0010 /**< IPv4 tunnel. */ -#define NSS_VXLAN_RULE_FLAG_IPV6 0x0020 /**< IPv6 tunnel. */ -#define NSS_VXLAN_RULE_FLAG_UDP 0x0100 /**< UDP tunnel. */ - -/** - * nss_vxlan_msg_type - * Message types for VxLAN tunnel. - */ -enum nss_vxlan_msg_type { - NSS_VXLAN_MSG_TYPE_STATS_SYNC, /**< Statistics synchronization message. */ - NSS_VXLAN_MSG_TYPE_TUN_CONFIGURE, /**< Creating tunnel rule. */ - NSS_VXLAN_MSG_TYPE_TUN_UNCONFIGURE, /**< Destroying tunnel rule. */ - NSS_VXLAN_MSG_TYPE_TUN_ENABLE, /**< Enable the tunnel. */ - NSS_VXLAN_MSG_TYPE_TUN_DISABLE, /**< Disable the tunnel. */ - NSS_VXLAN_MSG_TYPE_MAC_ADD, /**< Add MAC rule to the database. */ - NSS_VXLAN_MSG_TYPE_MAC_DEL, /**< Remove MAC rule from the database. */ - NSS_VXLAN_MSG_TYPE_MACDB_STATS, /**< MAC database statistics synchronization message. */ - NSS_VXLAN_MSG_TYPE_MAX, /**< Maximum message type. */ -}; - -/** - * nss_vxlan_error_response_types - * Error types for VxLAN responses to messages from the host. - */ -enum nss_vxlan_error_type { - NSS_VXLAN_ERROR_TYPE_NONE = 1, /**< Unknown type error. */ - NSS_VXLAN_ERROR_TYPE_DECAP_REGISTER_FAIL, /**< Decapsulation node registration failed. */ - NSS_VXLAN_ERROR_TYPE_DEST_IP_MISMATCH, /**< Destination IP address mismatch. */ - NSS_VXLAN_ERROR_TYPE_INVALID_VNI, /**< Invalid virtual network ID. */ - NSS_VXLAN_ERROR_TYPE_INVALID_L3_PROTO, /**< L3 Protocol is invalid error. */ - NSS_VXLAN_ERROR_TYPE_INVALID_UDP_PROTO, /**< UDP Protocol is invalid error. */ - NSS_VXLAN_ERROR_TYPE_INVALID_SRC_PORT, /**< Source port range is invalid. */ - NSS_VXLAN_ERROR_TYPE_MAC_BAD_ENTRY, /**< MAC table has a bad entry. */ - NSS_VXLAN_ERROR_TYPE_MAC_EXISTS, /**< MAC entry exists in the table error. */ - NSS_VXLAN_ERROR_TYPE_MAC_NOT_EXIST, /**< MAC does not exist in the table error. */ - NSS_VXLAN_ERROR_TYPE_MAC_ENTRY_UNHASHED, /**< MAC entry is not hashed in table. */ - NSS_VXLAN_ERROR_TYPE_MAC_ENTRY_ALLOC_FAILED, /**< MAC entry allocation failed. */ - NSS_VXLAN_ERROR_TYPE_MAC_ENTRY_DELETE_FAILED, /**< MAC entry deletion failed. */ - NSS_VXLAN_ERROR_TYPE_MAC_TABLE_FULL, /**< MAC table is full error. */ - NSS_VXLAN_ERROR_TYPE_SIBLING_NODE_NOT_EXIST, /**< Sibling node does not exist. */ - NSS_VXLAN_ERROR_TYPE_TUNNEL_CONFIGURED, /**< Tunnel is already configured. */ - NSS_VXLAN_ERROR_TYPE_TUNNEL_UNCONFIGURED, /**< Tunnel is not configured. */ - NSS_VXLAN_ERROR_TYPE_TUNNEL_ADD_FAILED, /**< Adding tunnel information failed. */ - NSS_VXLAN_ERROR_TYPE_TUNNEL_DISABLED, /**< Tunnel is already disabled error. */ - NSS_VXLAN_ERROR_TYPE_TUNNEL_ENABLED, /**< Tunnel is already enabled error. */ - NSS_VXLAN_ERROR_TYPE_TUNNEL_ENTRY_EXISTS, /**< Tunnel already exists. */ - NSS_VXLAN_ERROR_TYPE_MAX, /**< Maximum error type. */ -}; - -/** - * nss_vxlan_stats_msg - * Per-tunnel statistics messages from the NSS firmware. - */ -struct nss_vxlan_stats_msg { - struct nss_cmn_node_stats node_stats; /**< Common firmware statistics. */ - uint32_t except_mac_db_lookup_failed; /**< MAC database look up failed. */ - uint32_t except_mac_move; /**< User is moved. */ - uint32_t except_low_hroom; /**< Transmit exception due to insufficient headroom. */ - uint32_t except_no_policy_id; /**< Policy ID does not exist. */ - uint32_t except_extra_vxlan_hdr_flags; /**< More flags are set than NSS can process. */ - uint32_t except_vni_lookup_failed; /**< Virtual network ID look up failed. */ - uint32_t dropped_malformed; /**< Packet is malformed. */ - uint32_t dropped_next_node_queue_full; /**< Next node dropped the packet. */ - uint32_t except_inner_hash; /**< Inner hash calculation failed. */ -}; - -/** - * nss_vxlan_rule_msg - * VxLAN rule message. - * - * The same rule structure applies for both encapsulation and decapsulation - * in a tunnel. - */ -struct nss_vxlan_rule_msg { - /* - * VxLAN Rules - */ - uint32_t sibling_if_num; /**< Sibling node interface number. */ - uint32_t vni; /**< Virtual network ID. */ - uint16_t tunnel_flags; /**< VxLAN tunnel flags. */ - - /* - * IP rules - */ - uint16_t flow_label; /**< Flow label. */ - uint8_t tos; /**< Type of service/traffic class. */ - uint8_t ttl; /**< TTL/Hop Limit. */ - - /* - * L4 rules - */ - uint16_t src_port_min; /**< Minimum permissible port number. */ - uint16_t src_port_max; /**< Maximum permissible port number. */ - uint16_t dest_port; /**< UDP destination port. */ -}; - -/** - * nss_vxlan_encap_rule - * Encapsulation information for a VxLAN tunnel. - */ -struct nss_vxlan_encap_rule { - uint32_t src_ip[4]; /**< Source IP. */ - uint32_t dest_ip[4]; /**< Destination IP. */ -}; - -/** - * nss_vxlan_mac_msg - * VxLAN MAC message structure. - */ -struct nss_vxlan_mac_msg { - struct nss_vxlan_encap_rule encap; - /**< Tunnel encapsulation header. */ - uint32_t vni; /**< VxLAN network identifier. */ - uint16_t mac_addr[3]; /**< MAC address. */ -}; - -/** - * nss_vxlan_macdb_stats_entry - * MAC database statistics entry. - */ -struct nss_vxlan_macdb_stats_entry { - uint32_t hits; /**< Total hash hits on this hash entry. */ - uint16_t mac[3]; /**< MAC address. */ -}; - -/** - * nss_vxlan_macdb_stats_msg - * VxLAN MAC database statistics. - */ -struct nss_vxlan_macdb_stats_msg { - uint16_t cnt; /**< Number of MAC database entries copied. */ - uint16_t reserved; /**< Reserved for future use. */ - struct nss_vxlan_macdb_stats_entry entry[NSS_VXLAN_MACDB_ENTRIES_PER_MSG]; - /**< MAC database entries. */ -}; - -/** - * nss_vxlan_msg - * Data structure for sending and receiving VxLAN messages. - */ -struct nss_vxlan_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a VxLAN message. - */ - union { - struct nss_vxlan_stats_msg stats; - /**< Synchronized statistics for the VxLAN interface. */ - struct nss_vxlan_rule_msg vxlan_create; - /**< Allocate VxLAN tunnel node. */ - struct nss_vxlan_rule_msg vxlan_destroy; - /**< Destroy VxLAN tunnel node. */ - struct nss_vxlan_mac_msg mac_add; - /**< MAC add message for UDP encapsulation. */ - struct nss_vxlan_mac_msg mac_del; - /**< MAC delete message. */ - struct nss_vxlan_macdb_stats_msg db_stats; - /**< MAC database statistics. */ - } msg; /**< Payload for VxLAN tunnel messages exchanged with the NSS core. */ -}; - -/** - * Callback function for receiving VxLAN tunnel data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_vxlan_buf_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving VxLAN messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_vxlan_msg_callback_t)(void *app_data, struct nss_cmn_msg *msg); - -/** - * nss_vxlan_tx_msg - * Sends VxLAN tunnel messages to the NSS. - * - * Do not call this function from a softirq or interrupt because it - * might sleep if the NSS firmware is busy serving another host thread. - * - * @datatypes - * nss_ctx_instance \n - * nss_vxlan_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] nvm Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_vxlan_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_vxlan_msg *nvm); - -/** - * nss_vxlan_tx_msg_sync - * Sends a VxLAN message to the NSS synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_vxlan_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] nvm Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_vxlan_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_vxlan_msg *nvm); - -/** - * nss_vxlan_unregister_if - * Deregisters the VxLAN interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -extern bool nss_vxlan_unregister_if(uint32_t if_num); - -/** - * nss_vxlan_register_if - * Registers the VxLAN interface with the NSS. - * - * @datatypes - * nss_vxlan_buf_callback_t \n - * nss_vxlan_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] type Dynamic interface type. - * @param[in] data_cb Callback for the data. - * @param[in] notify_cb Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_vxlan_register_if(uint32_t if_num, uint32_t type, nss_vxlan_buf_callback_t data_cb, - nss_vxlan_msg_callback_t notify_cb, struct net_device *netdev, uint32_t features); - -/** - * nss_vxlan_register_handler - * Initializes VxLAN module in NSS - * - * @return - * None. - */ -extern void nss_vxlan_init(void); - -/** - * nss_vxlan_msg_init - * Initializes a VxLAN message. - * - * @datatypes - * nss_vxlan_msg \n - * nss_vxlan_msg_callback_t - * - * @param[in,out] nvm Pointer to the VxLAN tunnel message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Size of the message. - * @param[in] cb Pointer to the message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -extern void nss_vxlan_msg_init(struct nss_vxlan_msg *nvm, uint16_t if_num, uint32_t type, uint32_t len, - nss_vxlan_msg_callback_t cb, void *app_data); - -/** - * nss_vxlan_get_ctx() - * Get VxLAN context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_vxlan_get_ctx(void); - -/** - * @} - */ - -#endif -/* __NSS_VXLAN_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi.h deleted file mode 100644 index 4b82904ee..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi.h +++ /dev/null @@ -1,1015 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2018, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_wifi.h - * NSS TO HLOS Wi-Fi interface definitions. - */ - -#ifndef __NSS_WIFI_H -#define __NSS_WIFI_H - -/** - * @addtogroup nss_wifi_subsystem - * @{ - */ - -#define NSS_WIFI_MGMT_DATA_LEN 128 /**< Size of the Wi-Fi management data. */ -#define NSS_WIFI_FW_STATS_DATA_LEN 480 /**< Size of the firmware statictics data. */ -#define NSS_WIFI_RAWDATA_MAX_LEN 64 /**< Maximum size of the raw Wi-Fi data. */ -#define NSS_WIFI_TX_NUM_TOS_TIDS 8 /**< Number of TIDs. */ -#define NSS_WIFI_PEER_STATS_DATA_LEN 232 /**< Size of the peer statistics data. */ -#define NSS_WIFI_IPV6_ADDR_LEN 16 /**< Size of the IPv6 address. */ -#define NSS_WIFI_MAX_RSSI_CHAINS 4 /**< Maximum number of RSSI chains. */ -#define NSS_WIFI_WME_NUM_AC 4 /**< Number of ACs. */ - -/** - * Maximum number of Wi-Fi peers per radio as a sum of - * maximum number of station peers (513), - * maximum numbero of AP VAP peers (16), and - * maximum number of monitor VAP peers (1). - */ -#define NSS_WIFI_MAX_PEER 530 - -/** - * nss_wifi_metadata_types - * Wi-Fi interface request and response message types. - */ -enum nss_wifi_metadata_types { - NSS_WIFI_INIT_MSG, - NSS_WIFI_POST_RECV_MSG, - NSS_WIFI_HTT_INIT_MSG, - NSS_WIFI_TX_INIT_MSG, - NSS_WIFI_RAW_SEND_MSG, - NSS_WIFI_MGMT_SEND_MSG, - NSS_WIFI_WDS_PEER_ADD_MSG, - NSS_WIFI_WDS_PEER_DEL_MSG, - NSS_WIFI_STOP_MSG, - NSS_WIFI_RESET_MSG, - NSS_WIFI_STATS_MSG, - NSS_WIFI_PEER_FREELIST_APPEND_MSG, - NSS_WIFI_RX_REORDER_ARRAY_FREELIST_APPEND_MSG, - NSS_WIFI_SEND_PEER_MEMORY_REQUEST_MSG, - NSS_WIFI_SEND_RRA_MEMORY_REQUEST_MSG, - NSS_WIFI_FW_STATS_MSG, - NSS_WIFI_MONITOR_FILTER_SET_MSG, - NSS_WIFI_PEER_BS_STATE_MSG, - NSS_WIFI_MSDU_TTL_SET_MSG, - NSS_WIFI_RX_VOW_EXTSTATS_SET_MSG, - NSS_WIFI_PKTLOG_CFG_MSG, - NSS_WIFI_ENABLE_PERPKT_TXSTATS_MSG, - NSS_WIFI_IGMP_MLD_TOS_OVERRIDE_MSG, - NSS_WIFI_OL_STATS_CFG_MSG, - NSS_WIFI_OL_STATS_MSG, - NSS_WIFI_TX_QUEUE_CFG_MSG, - NSS_WIFI_TX_MIN_THRESHOLD_CFG_MSG, - NSS_WIFI_DBDC_PROCESS_ENABLE_MSG, - NSS_WIFI_PRIMARY_RADIO_SET_MSG, - NSS_WIFI_FORCE_CLIENT_MCAST_TRAFFIC_SET_MSG, - NSS_WIFI_STORE_OTHER_PDEV_STAVAP_MSG, - NSS_WIFI_STA_KICKOUT_MSG, - NSS_WIFI_WNM_PEER_RX_ACTIVITY_MSG, - NSS_WIFI_PEER_STATS_MSG, - NSS_WIFI_WDS_VENDOR_MSG, - NSS_WIFI_TX_CAPTURE_SET_MSG, - NSS_WIFI_ALWAYS_PRIMARY_SET_MSG, - NSS_WIFI_FLUSH_HTT_CMD_MSG, - NSS_WIFI_CMD_MSG, - NSS_WIFI_ENABLE_OL_STATSV2_MSG, - NSS_WIFI_OL_PEER_TIME_MSG, - NSS_WIFI_PEER_SET_VLAN_ID_MSG, - NSS_WIFI_PEER_ISOLATION_MSG, - NSS_WIFI_MAX_MSG -}; - -/* - * wifi_error_types - * Wi-Fi error types. - */ -enum wifi_error_types { - NSS_WIFI_EMSG_NONE = 0, - NSS_WIFI_EMSG_UNKNOWN, - NSS_WIFI_EMSG_MGMT_DLEN, - NSS_WIFI_EMSG_MGMT_SEND, - NSS_WIFI_EMSG_CE_INIT_FAIL, - NSS_WIFI_EMSG_PDEV_INIT_FAIL, - NSS_WIFI_EMSG_HTT_INIT_FAIL, - NSS_WIFI_EMSG_PEER_ADD, - NSS_WIFI_EMSG_WIFI_START_FAIL, - NSS_WIFI_EMSG_STATE_NOT_RESET, - NSS_WIFI_EMSG_STATE_NOT_INIT_DONE, - NSS_WIFI_EMSG_STATE_NULL_CE_HANDLE, - NSS_WIFI_EMSG_STATE_NOT_CE_READY, - NSS_WIFI_EMSG_STATE_NOT_HTT_READY, - NSS_WIFI_EMSG_FW_STATS_DLEN, - NSS_WIFI_EMSG_FW_STATS_SEND, - NSS_WIFI_EMSG_STATE_TX_INIT_FAILED, - NSS_WIFI_EMSG_IGMP_MLD_TOS_OVERRIDE_CFG, - NSS_WIFI_EMSG_PDEV_INVALID, - NSS_WIFI_EMSG_OTHER_PDEV_STAVAP_INVALID, - NSS_WIFI_EMSG_HTT_SEND_FAIL, - NSS_WIFI_EMSG_CE_RING_INIT, - NSS_WIFI_EMSG_NOTIFY_CB, - NSS_WIFI_EMSG_PEERID_INVALID, - NSS_WIFI_EMSG_PEER_INVALID, - NSS_WIFI_EMSG_UNKNOWN_CMD, - NSS_WIFI_EMSG_MAX, -}; - -/** - * nss_wifi_ext_data_pkt_type - * Exception types for Wi-Fi extended data. - */ -enum nss_wifi_ext_data_pkt_type { - NSS_WIFI_RX_EXT_INV_PEER_TYPE, - NSS_WIFI_RX_EXT_PKTLOG_TYPE, - NSS_WIFI_RX_STATS_V2_EXCEPTION, - NSS_WIFI_RX_MGMT_NULL_TYPE, - NSS_WIFI_RX_EXT_MAX_TYPE, -}; - -/** - * nss_wifi_cmd - * Wi-Fi commands. - */ -enum nss_wifi_cmd { - NSS_WIFI_FILTER_NEIGH_PEERS_CMD, - NSS_WIFI_MAX_CMD -}; - -/** - * nss_wifi_ce_ring_state_msg - * Internal state information for the copy engine ring. - */ -struct nss_wifi_ce_ring_state_msg { - uint32_t nentries; /**< Number of entries in the copy engine ring. */ - uint32_t nentries_mask; /**< Number of entry masks. */ - uint32_t sw_index; /**< Initial software index. */ - uint32_t write_index; /**< Initial write index. */ - uint32_t hw_index; /**< Initial hardware index. */ - uint32_t base_addr_CE_space; - /**< Physical address of the copy engine hardware ring. */ - uint32_t base_addr_owner_space; - /**< Virtual address of the copy engine hardware ring. */ -}; - -/** - * nss_wifi_ce_state_msg - * Internal state information for the copy engine. - */ -struct nss_wifi_ce_state_msg { - struct nss_wifi_ce_ring_state_msg src_ring; - /**< Source ring information. */ - struct nss_wifi_ce_ring_state_msg dest_ring; - /**< Destination ring information. */ - uint32_t ctrl_addr; - /**< Control address relative to PCIe BAR. */ -}; - -/** - * nss_wifi_init_msg - * Wi-Fi initialization data. - */ -struct nss_wifi_init_msg { - uint32_t radio_id ; /**< Radio index. */ - uint32_t pci_mem; /**< PCI memory address. */ - uint32_t target_type; /**< Wi-Fi target type. */ - uint32_t mu_mimo_enhancement_en; - /**< Enable MU-MIMO enhancement. */ - struct nss_wifi_ce_state_msg ce_tx_state; - /**< Transmit copy engine information. */ - struct nss_wifi_ce_state_msg ce_rx_state; - /**< Receive copy engine information. */ - - /** - * Indicates whether network processing is bypassed for this radio. - */ - uint32_t bypass_nw_process; -}; - -/** - * nss_wifi_htt_init_msg - * Wi-Fi Host-to-Target (HTT) initialization data. - */ -struct nss_wifi_htt_init_msg { - uint32_t radio_id; /**< Radio index. */ - uint32_t ringsize; /**< WLAN hardware MAC ring size. */ - uint32_t fill_level; /**< Initial fill level. */ - uint32_t paddrs_ringptr; - /**< Physical address of the WLAN MAC hardware ring. */ - uint32_t paddrs_ringpaddr; - /**< Virtual address of the WLAN MAC hardware ring. */ - uint32_t alloc_idx_vaddr; - /**< Virtual address of the hardware ring index. */ - uint32_t alloc_idx_paddr; - /**< Physical address of the hardware ring index. */ -}; - -/** - * nss_wifi_tx_init_msg - * Wi-Fi Tx initialization data. - */ -struct nss_wifi_tx_init_msg { - uint32_t radio_id; /**< Radio index. */ - uint32_t desc_pool_size; /**< Number of descriptor pools allocated. */ - uint32_t tx_desc_array; - /**< Host-initialized software WLAN descriptor pool memory. */ - uint32_t wlanextdesc_addr; - /**< Starting address of the WLAN MAC extenstion descriptor pool. */ - uint32_t wlanextdesc_size; - /**< Descriptor size of the WLAN MAC extenstion. */ - - /** - * Starting virtual address, as shared by the Wi-Fi firmware, for HTT Tx descriptor memory. - */ - uint32_t htt_tx_desc_base_vaddr; - - /** - * HTT Tx descriptor memory start physical address as shared by Wi-Fi firmware. - */ - uint32_t htt_tx_desc_base_paddr; - - uint32_t htt_tx_desc_offset; - /**< Descriptor size of the firmware shared HTT Tx. */ - uint32_t pmap_addr; - /**< Firmware shared peer or TID map. */ -}; - -/** - * nss_wifi_tx_queue_cfg_msg - * Wi-Fi Tx queue configuration. - */ -struct nss_wifi_tx_queue_cfg_msg { - uint32_t size; /**< Size of the Tx queue. */ - uint32_t range; /**< Peer range. */ -}; - -/** - * nss_wifi_tx_min_threshold_cfg_msg - * Minimum threshold configuration data for the Wi-Fi Tx queue. - */ -struct nss_wifi_tx_min_threshold_cfg_msg { - uint32_t min_threshold; /**< Minimum threshold value of Tx queue. */ -}; - -/** - * nss_wifi_rawsend_msg - * Information for Wi-Fi raw data. - */ -struct nss_wifi_rawsend_msg { - uint32_t radio_id ; /**< Radio index. */ - uint32_t len; /**< Size of the raw data. */ - uint32_t array[NSS_WIFI_RAWDATA_MAX_LEN]; - /**< Array of raw data. */ -}; - -/** - * nss_wifi_mgmtsend_msg - * Information for Wi-Fi management data. - */ -struct nss_wifi_mgmtsend_msg { - uint32_t desc_id; /**< Descriptor index. */ - uint32_t len; /**< Size of the management data. */ - uint8_t array[NSS_WIFI_MGMT_DATA_LEN]; - /**< Array of management data. */ -}; - -/** - * nss_wifi_fw_stats_msg - * Information for Wi-Fi firmware statistics. - */ -struct nss_wifi_fw_stats_msg { - uint32_t len; /**< Size of the statistics data. */ - uint8_t array[NSS_WIFI_FW_STATS_DATA_LEN]; - /**< Array of statistics data. */ -}; - -/** - * nss_wifi_monitor_set_filter_msg - * Wi-Fi Monitor mode for setting filter messages. - */ -struct nss_wifi_monitor_set_filter_msg { - uint32_t filter_type; /**< Type of Monitor mode filter. */ -}; - -/** - * nss_wifi_wds_peer_msg - * Wi-Fi WDS peer-specific message. - */ -struct nss_wifi_wds_peer_msg { - uint8_t dest_mac[ETH_ALEN]; /**< MAC address of the destination. */ - uint8_t reserved[2]; /**< Reserved for 4-byte alignment padding. */ - uint8_t peer_mac[ETH_ALEN]; /**< MAC address of the base peer. */ - uint8_t reserved1[2]; /**< Reserved for 4-byte alignment padding. */ -}; - -/** - * nss_wifi_tx_capture_msg - * Wi-Fi Tx data capture configuration. - */ -struct nss_wifi_tx_capture_msg { - uint32_t tx_capture_enable; /**< Enable or disable Tx data capture. */ -}; - -/** - * nss_wifi_reset_msg - * Message to reset the Wi-Fi Radio. - */ -struct nss_wifi_reset_msg { - uint32_t radio_id; /**< Radio index. */ -}; - -/** - * nss_wifi_stop_msg - * Message to stop the Wi-Fi Radio. - */ -struct nss_wifi_stop_msg { - uint32_t radio_id; /**< Radio index. */ -}; - -/** - * nss_wifi_pktlog_cfg_msg - * Configuration information for a Wi-Fi packet log. - */ -struct nss_wifi_pktlog_cfg_msg { - uint32_t enable; /**< Enables or disables a packet log. */ - uint32_t bufsize; /**< Size of the packet log buffer. */ - uint32_t hdrsize; /**< Size of the packet log header. */ - uint32_t msdu_id_offset; /**< Offset for the MSDU ID in the message. */ -}; - -/** - * nss_wifi_ol_stats_cfg_msg - * Wi-Fi offload statistics configuration. - */ -struct nss_wifi_ol_stats_cfg_msg { - uint32_t stats_cfg; /**< Enable or disable offload statistics configuration. */ -}; - -/** - * nss_wifi_enable_perpkt_txstats_msg - * Wi-Fi per-packet Tx statistics configuration. - */ -struct nss_wifi_enable_perpkt_txstats_msg { - uint32_t perpkt_txstats_flag; /**< Enable or disable Tx statistics. */ -}; - -/** - * nss_wifi_peer_txtime_stats - * Peer Tx timestamp statistics per TID. - */ -struct nss_wifi_peer_txtime_stats { - uint32_t sum_tx; /**< Sum of sojourn for each packet. */ - uint32_t sum_msdus; /**< Number of MSDU per peer per TID. */ -}; - -/** - * nss_wifi_peer_tstamp_stats - * Peer ID and timestamp statistics per TID. - */ -struct nss_wifi_peer_tstamp_stats { - uint32_t peer_id; /**< TID value. */ - struct nss_wifi_peer_txtime_stats sum[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Timestamps. */ - uint32_t avg[NSS_WIFI_TX_NUM_TOS_TIDS]; /**< Exponential weighted average. */ -}; - -/** - * nss_wifi_ol_peer_time_msg - * NSS Wi-Fi Tx timestamp message for n number of peers. - */ -struct nss_wifi_ol_peer_time_msg { - uint32_t npeers; /**< Number of peers. */ - struct nss_wifi_peer_tstamp_stats tstats[1]; - /**< One instance of struct. */ -}; - -/** - * nss_wifi_enable_ol_statsv2 - * Wi-Fi enable/disable send packet to host. - */ -struct nss_wifi_enable_ol_statsv2 { - uint32_t enable_ol_statsv2; /**< Flag to send packet to host. */ -}; - -/** - * nss_wifi_dbdc_process_enable_msg - * Wi-Fi DBDC repeater process configuration. - */ -struct nss_wifi_dbdc_process_enable_msg { - uint32_t dbdc_process_enable; /**< Enable or disable the DBDC process. */ -}; - -/** - * nss_wifi_primary_radio_set_msg - * Wi-Fi primary radio configuration message. - */ -struct nss_wifi_primary_radio_set_msg { - /** - * Enable/Disable Flag to set the current radio as primary. - */ - uint32_t flag; -}; - -/** - * nss_wifi_always_primary_set_msg - * Always set the Wi-Fi primary radio. - * - * The primary radio is set using the nss_wifi_primary_radio_set_msg flag. - * When the nss_wifi_always_primary_set_msg flag is set: - * - Tx -- Do not drop a unicast packet on the secondary station the VAP. Instead, give that - * packet to the primary station the VAP. - * - Rx -- Do not drop a received unicast packet on the secondary station the VAP. Instead, - * give that packet to the bridge by changing the SKB device as the primary station - * VAP. - * - * Primary usage of this feature is to avoid a loopback. - */ -struct nss_wifi_always_primary_set_msg { - /** - * Always use the primary radio for Tx and Rx in the DBDC repeater process. - */ - uint32_t flag; -}; - -/** - * nss_wifi_force_client_mcast_traffic_set_msg - * Wi-Fi message to set the client multi-cast traffic for a radio. - */ -struct nss_wifi_force_client_mcast_traffic_set_msg { - uint32_t flag; /**< Flag to force set the multi-cast traffic in a radio. */ -}; - -/** - * wifi_store_other_pdev_stavap_msg - * Store the other radio's station vap. - */ -struct nss_wifi_store_other_pdev_stavap_msg { - int stavap_ifnum; /**< Station VAP interface number of the other radio. */ -}; - -/** - * nss_wifi_pl_metadata - * Wi-Fi packet log metadata. - */ -struct nss_wifi_pl_metadata { - uint32_t len; /**< Length of single buffer in MSDU. */ - uint32_t msdu_len; /**< Total MSDU length. */ - uint16_t da_tail; /**< Destination address tail bytes. */ - uint16_t sa_tail; /**< Source address tail bytes. */ - uint8_t vdev_id; /**< Virtual device ID. */ - uint8_t res1; /**< Reserved for alignment. */ - uint16_t res2; /**< Reserved for alignment. */ -}; - -/** - * nss_wifi_rx_ext_metadata - * Wi-Fi Rx extended data plane metadata. - */ -struct nss_wifi_rx_ext_metadata{ - uint16_t peer_id; /**< ID of associated Peer. */ - uint8_t htt_rx_status; /**< Rx status of the HTT. */ - uint8_t type; /**< Reserved for 4 byte alignment. */ -}; - -/** - * nss_wifi_mc_enhance_stats - * Wi-Fi multicast enhancement statistics. - */ -struct nss_wifi_mc_enhance_stats { - uint32_t rcvd; /**< Number of multicast frames received for conversion. */ - - /** - * Number of unicast frames sent as part of multicast enhancement conversion. - */ - uint32_t ucast_converted; - - /** - * Number of multicast enhancement frames dropped because of an allocation - * failure. - */ - uint32_t alloc_fail; - - /** - * Number of multicast enhancement frames dropped because of an enqueue failure. - */ - uint32_t enqueue_fail; - - /** - * Number of multicast enhancement frames dropped because of a copy failure. - */ - uint32_t copy_fail; - - /** - * Number of multicast enhancement frames dropped because of a peer flow control - * send failure. - */ - uint32_t peer_flow_ctrl_send_fail; - - /** - * Number of multicast enhancement frames dropped when the destination MAC - * address is the same as the source MAC address. - */ - uint32_t loopback_err; - - /** - * Number of multicast enhancement buffer frames dropped because of an empty - * destination MAC address. - */ - uint32_t dst_addr_err; -}; - -/** - * nss_wifi_stats_sync_msg - * Wi-Fi synchronization statistics. - */ -struct nss_wifi_stats_sync_msg { - struct nss_cmn_node_stats node_stats; /**< Common node statistics. */ - uint32_t tx_transmit_dropped; - /**< Number of packets dropped during transmission. */ - uint32_t tx_transmit_completions; - /**< Number of packets for which Tx completions are received. */ - uint32_t tx_mgmt_rcv_cnt; - /**< Number of management packets received from the host for Tx. */ - uint32_t tx_mgmt_pkts; - /**< Number of management packets transmitted over Wi-Fi. */ - - /** - * Number of management packets dropped because of a Tx failure. - */ - uint32_t tx_mgmt_dropped; - - /** - * Number of management packets for which Tx completions are received. - */ - uint32_t tx_mgmt_completions; - - /** - * Number of packets for which an Tx enqueue failed because of an invalid peer. - */ - uint32_t tx_inv_peer_enq_cnt; - - /** - * Number of packets with an invalid peer ID received from Wi-Fi. - */ - uint32_t rx_inv_peer_rcv_cnt; - - uint32_t rx_pn_check_failed; - /**< Number of Rx packets that failed a packet number check. */ - - /** - * Number of Rx packets that the Wi-Fi driver successfully processed. - */ - uint32_t rx_pkts_deliverd; - - /** - * Number of Rx bytes that the Wi-Fi driver successfully processed. - */ - uint32_t rx_bytes_deliverd; - - uint32_t tx_bytes_transmit_completions; - /**< Number of bytes for which Tx completions are received. */ - - /** - * Number of unaligned data packets that were received from Wi-Fi and dropped. - */ - uint32_t rx_deliver_unaligned_drop_cnt; - - uint32_t tidq_enqueue_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of packets enqueued to TID Queue (TIDQ). */ - uint32_t tidq_dequeue_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of packets dequeued from TIDQ. */ - uint32_t tidq_enqueue_fail_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of enqueue failures. */ - uint32_t tidq_ttl_expire_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of packets expired from TIDQ. */ - uint32_t tidq_dequeue_req_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of dequeue requests from the Wi-Fi firmware. */ - uint32_t total_tidq_depth; - /**< Current queue Depth. */ - - /** - * Total number of HTT fetch messages received from the Wi-Fi firmware. - */ - uint32_t rx_htt_fetch_cnt; - - /** - * Total number of packets that bypassed TIDQ and are sent to the Wi-Fi - * firmware. - */ - uint32_t total_tidq_bypass_cnt; - - /** - * Total number of packets dropped because of a global queue full condition. - */ - uint32_t global_q_full_cnt; - - /** - * Total number of packets dropped because of a TID queue full condition. - */ - uint32_t tidq_full_cnt; - - struct nss_wifi_mc_enhance_stats mc_enhance_stats; - /**< Multicast enhancement statistics. */ - - /** - * Number of times a group entry was not present for multicast enhancement. - */ - uint32_t mc_enhance_group_entry_miss; - - /** - * Number of times a deny list was hit during multicast enhancement. - */ - uint32_t mc_enhance_denylist_hit; -}; - -/** - * nss_wifi_peer_freelist_append_msg - * Information for creating a Wi-Fi peer freelist. - */ -struct nss_wifi_peer_freelist_append_msg { - uint32_t addr; /**< Starting address of peer freelist pool. */ - uint32_t length; /**< Size of peer freelist pool. */ - uint32_t num_peers; /**< Maximum peer entries supported in the pool. */ -}; - -/** - * nss_wifi_rx_reorder_array_freelist_append_msg - * Information for creating a Wi-Fi TIDQ peer freelist array. - */ -struct nss_wifi_rx_reorder_array_freelist_append_msg { - uint32_t addr; /**< Starting address of the TIDQ freelist pool. */ - uint32_t length; /**< Size of the TIDQ freelist pool. */ - - /** - * Maximum number of Rx reorder array entries supported in the freelist pool. - */ - uint32_t num_rra; -}; - -/** - * wifi_bs_peer_inactivity - * Active state information of the peer. - */ -struct nss_wifi_bs_peer_activity { - uint16_t nentries; /**< Number of entries in the peer ID array. */ - uint16_t peer_id[1]; /**< Array holding the peer IDs. */ -}; - -/** - * nss_wifi_msdu_ttl_set_msg - * Information for setting the Wi-Fi MSDU time-to-live value. - */ -struct nss_wifi_msdu_ttl_set_msg { - uint32_t msdu_ttl; /**< TTL value to be set. */ -}; - -/** - * nss_wifi_rx_vow_extstats_set_msg - * VoW extended statitics set. - */ -struct nss_wifi_rx_vow_extstats_set_msg { - uint32_t vow_extstats_en; /**< VoW extended statistics enable. */ -}; - -/** - * nss_wifi_igmp_mld_override_tos_msg - * Information for overriding TOS. - */ -struct nss_wifi_igmp_mld_override_tos_msg { - uint8_t igmp_mld_ovride_tid_en; - /**< Flag to enable TID override feature for IGMP/MLD configuration. */ - uint8_t igmp_mld_ovride_tid_val; - /**< Value of TID to be overriden for IGMP/MLD. */ - uint8_t res[2]; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_wifi_peer_ol_stats - * Wi-Fi offload statistics. - */ -struct nss_wifi_peer_ol_stats { - uint32_t peer_id; /**< ID of associated peer. */ - uint32_t seq_num; /**< Sequence number of the PPDU. */ - uint32_t tx_unaggr; /**< Number of unaggregated packets transmitted. */ - uint32_t tx_aggr; /**< Number of aggregated packets transmitted. */ - uint32_t tx_mcast; /**< Number of multicast packets sent. */ - uint32_t tx_ucast; /**< Number of unicast packets sent. */ - uint32_t tx_data; /**< Number data packets sent. */ - uint32_t tx_bytes; /**< Number of bytes sent. */ - uint32_t tx_fail; /**< Number of failed Tx packets. */ - uint32_t thrup_bytes; /**< Number of throughput bytes. */ - uint32_t tx_bcast_pkts; /**< Number of broadcast packets sent. */ - uint32_t tx_bcast_bytes;/**< Number of broadcast bytes sent. */ - uint32_t tx_mgmt; /**< Number of Tx management frames. */ - uint32_t tx_wme[NSS_WIFI_WME_NUM_AC]; - /**< Data frames transmitted per AC. */ - uint32_t rx_wme[NSS_WIFI_WME_NUM_AC]; - /**< Data frames received per AC. */ - uint32_t ppdu_retries; /**< Number of PPDU retries. */ - uint32_t rssi_chains[NSS_WIFI_MAX_RSSI_CHAINS]; - /**< Acknowledgment RSSI per chain. */ - uint32_t rx_msdus; /**< Number of MSDUs received. */ - uint32_t rx_bytes; /**< Number of bytes received. */ - uint32_t rx_mpdus; /**< Number of MPDUs received. */ - uint32_t rx_retries; /**< Number of MPDU retries. */ -}; - -/** - * nss_wifi_ol_stats_msg - * Wi-Fi offload statistics. - */ -struct nss_wifi_ol_stats_msg { - uint32_t bawadv_cnt; /**< Number of block-acknowledgment window advancements. */ - uint32_t bcn_cnt; /**< Number of beacons. */ - uint32_t npeers; /**< Number of peer statistics entries. */ - struct nss_wifi_peer_ol_stats peer_ol_stats[1]; - /**< Array to hold the peer statistics. */ -}; - -/** - * nss_wifi_sta_kickout_msg - * Station kickout message from NSS Firmware - */ -struct nss_wifi_sta_kickout_msg { - uint32_t peer_id; /**< Peer ID. */ -}; - -/** - * nss_wifi_peer_isolation_msg - * Peer isolation message - */ -struct nss_wifi_peer_isolation_msg { - uint16_t peer_id; /**< Peer ID. */ - uint16_t isolation; /**< Isolation enabled/disabled. */ -}; - -/** - * nss_wifi_wnm_peer_rx_activity_msg - * Rx active state information for the peer. - */ -struct nss_wifi_wnm_peer_rx_activity_msg { - uint16_t nentries; /**< Number of entries. */ - - /** - * Array to hold the peer IDs for which the activity is reported. - */ - uint16_t peer_id[NSS_WIFI_MAX_PEER]; -}; - -/** - * nss_wifi_append_metaheader - * Append metaheader after pbuf->data for stats_v2. - */ -struct nss_wifi_append_statsv2_metahdr { - uint32_t rxstatsmagic; /**< Magic to be verified on host. */ - uint32_t seq_number; /**< Sequence number of packets sent from NSS. */ - uint16_t peer_id; /**< Peer ID of peer. */ - uint16_t num_msdus; /**< Number of MSDU in PPDU. */ - uint16_t num_retries; /**< Number of retries in PPDU. */ - uint16_t num_mpdus; /**< Number of MPDU in PPDU. */ - uint32_t num_bytes; /**< Number of bytes in PPDU. */ -}; - -/** - * nss_wifi_peer_stats_msg - * Wi-Fi peer statistics. - */ -struct nss_wifi_peer_stats_msg { - uint32_t peer_id; /**< Peer ID. */ - uint32_t tidq_byte_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of bytes in each TIDQ. */ - uint32_t tidq_queue_max[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Maximum depth for the TID queue. */ - uint32_t tidq_enqueue_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of packets enqueued to the TIDQ. */ - uint32_t tidq_dequeue_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of packets dequeued from the TIDQ. */ - uint32_t tidq_ttl_expire_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of expired packets from the TIDQ. */ - uint32_t tidq_dequeue_req_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; - /**< Number of dequeue requests from the Wi-Fi firmware. */ - - /** - * Total number of packets dropped because the TID queue is full. - */ - uint32_t tidq_full_cnt[NSS_WIFI_TX_NUM_TOS_TIDS]; -}; - -/** - * nss_wifi_wds_extn_peer_cfg_msg - * Configuration information when the WDS extension is enabled. - */ -struct nss_wifi_wds_extn_peer_cfg_msg { - uint8_t mac_addr[ETH_ALEN]; /**< Mac address of the peer. */ - uint8_t wds_flags; /**< WDS flags populated from the host. */ - uint8_t reserved; /**< Alignment padding. */ - uint16_t peer_id; /**< ID of the peer. */ -}; - -/** - * nss_wifi_cmd_msg - * Wi-Fi radio specific special commands to NSS Firmware - */ -struct nss_wifi_cmd_msg { - uint32_t cmd; /**< Type of command message. */ - uint32_t value; /**< Value of the command. */ -}; - -/** - * nss_wifi_msg - * Data for sending and receiving Wi-Fi messages. - */ -struct nss_wifi_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Message Payload. - */ - union { - struct nss_wifi_init_msg initmsg; - /**< Wi-Fi Radio initialization message. */ - struct nss_wifi_stop_msg stopmsg; - /**< Wi-Fi Radio stop message. */ - struct nss_wifi_reset_msg resetmsg; - /**< Wi-Fi Radio reset message. */ - struct nss_wifi_htt_init_msg httinitmsg; - /**< HTT initialization message. */ - struct nss_wifi_tx_init_msg pdevtxinitmsg; - /**< Tx initialization message. */ - struct nss_wifi_rawsend_msg rawmsg; - /**< Wi-Fi raw data send message. */ - struct nss_wifi_mgmtsend_msg mgmtmsg; - /**< Wi-Fi management data send message. */ - struct nss_wifi_wds_peer_msg pdevwdspeermsg; - /**< WDS peer-specific message. */ - struct nss_wifi_stats_sync_msg statsmsg; - /**< Synchronization statistics. */ - struct nss_wifi_peer_freelist_append_msg peer_freelist_append; - /**< Message for creating/appending peer freelist memory. */ - - /** - * Message for creating/appending a reorder array for Wi-Fi Receive Defragmentation. - */ - struct nss_wifi_rx_reorder_array_freelist_append_msg rx_reorder_array_freelist_append; - - struct nss_wifi_fw_stats_msg fwstatsmsg; - /**< Wi-Fi firmware statistics information message. */ - struct nss_wifi_monitor_set_filter_msg monitor_filter_msg; - /**< Set the filter message for Monitor mode. */ - struct nss_wifi_bs_peer_activity peer_activity; - /**< Message to get the active peer for a radio. */ - struct nss_wifi_msdu_ttl_set_msg msdu_ttl_set_msg; - /**< Set MSDU time-to-live. */ - struct nss_wifi_rx_vow_extstats_set_msg vow_extstats_msg; - /**< Enable VoW extended statistics message. */ - struct nss_wifi_pktlog_cfg_msg pcm_msg; - /**< Packet log configuration message. */ - struct nss_wifi_enable_perpkt_txstats_msg ept_msg; - /**< Enable or disable per-packet Tx statistics. */ - struct nss_wifi_igmp_mld_override_tos_msg wigmpmldtm_msg; - /**< Message to enable TID override for IGMP/MLD. */ - struct nss_wifi_ol_stats_cfg_msg scm_msg; - /**< Enable or disable offload statistics configuration. */ - struct nss_wifi_ol_stats_msg ol_stats_msg; - /**< Offload statistics. */ - struct nss_wifi_tx_queue_cfg_msg wtxqcm; - /**< Tx queue configuration. */ - - /** - * Minimum threshold configuration data for the Tx queue. - */ - struct nss_wifi_tx_min_threshold_cfg_msg wtx_min_threshold_cm; - - struct nss_wifi_dbdc_process_enable_msg dbdcpe_msg; - /**< Enable or disable the DBDC repeater process. */ - struct nss_wifi_primary_radio_set_msg wprs_msg; - /**< Set the current radio as the primary radio. */ - struct nss_wifi_force_client_mcast_traffic_set_msg wfcmts_msg; - /**< Message to force multicast traffic for a radio. */ - struct nss_wifi_store_other_pdev_stavap_msg wsops_msg; - /**< Message to store the other radio's station vap. */ - struct nss_wifi_sta_kickout_msg sta_kickout_msg; - /**< Station kickout message from NSS firmware. */ - struct nss_wifi_wnm_peer_rx_activity_msg wprm; - /**< Rx activity for the peer. */ - struct nss_wifi_peer_stats_msg peer_stats_msg; - /**< Peer statistics message. */ - struct nss_wifi_wds_extn_peer_cfg_msg wpeercfg; - /**< Configuartion information message when the WDS extension is enabled. */ - struct nss_wifi_tx_capture_msg tx_capture_msg; - /**< Enable or disable Tx data capture. */ - struct nss_wifi_always_primary_set_msg waps_msg; - /**< Message to always set the current radio as primary radio. */ - struct nss_wifi_cmd_msg wcmdm; - /**< Pdev command information. */ - struct nss_wifi_enable_ol_statsv2 wesh_msg; - /**< Enable version 2 tx/rx stats. */ - struct nss_wifi_ol_peer_time_msg wopt_msg; - /**< Send per peer/TID timestamp statistics to host. */ - struct nss_wifi_peer_isolation_msg isolation_msg; - /**< Enable or disable peer isolation. */ - } msg; /**< Message Payload. */ -}; - -/** - * nss_wifi_get_context - * Gets the Wi-Fi context used in nss_gre_tx. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_wifi_get_context(void); - -/** - * nss_wifi_tx_msg - * Sends a Wi-Fi message to the NSS firmware. - * - * @datatypes - * nss_ctx_instance \n - * nss_wifi_if_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -extern nss_tx_status_t nss_wifi_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_msg *msg); - -/** - * Callback function for receiving Wi-Fi messages. - * - * @datatypes - * nss_wifi_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_wifi_msg_callback_t)(void *app_data, struct nss_wifi_msg *msg); - -/** - * Callback function for receiving Wi-Fi data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_wifi_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_register_wifi_if - * Registers the Wi-Fi interface with the NSS for sending and receiving messages. - * - * @datatypes - * nss_wifi_callback_t \n - * nss_wifi_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] wifi_callback Callback for the data. - * @param[in] wifi_ext_callback Callback for the extended data. - * @param[in] event_callback Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this interface. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_register_wifi_if(uint32_t if_num, nss_wifi_callback_t wifi_callback, - nss_wifi_callback_t wifi_ext_callback, nss_wifi_msg_callback_t event_callback, struct net_device *netdev, uint32_t features); - -/** - * nss_unregister_wifi_if - * Deregisters the Wi-Fi interface from the NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -void nss_unregister_wifi_if(uint32_t if_num); - -/** - * @} - */ - -#endif /* __NSS_WIFI_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_ext_vdev_if.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_ext_vdev_if.h deleted file mode 100644 index df48a5848..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_ext_vdev_if.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_wifi_ext_vdev_if.h - * NSS Wi-Fi extended virtual device interface definitions. - */ - -#ifndef __NSS_WIFI_EXT_VDEV_IF_H -#define __NSS_WIFI_EXT_VDEV_IF_H - -#define NSS_WIFI_EXT_VDEV_MAX 16 - -/* - * nss_wifi_ext_vdev_msg_types - * WiFi extension virtual device mesage types. - */ -enum nss_wifi_ext_vdev_msg_types { - NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_IF = NSS_IF_MAX_MSG_TYPES + 1, - NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_WDS, - NSS_WIFI_EXT_VDEV_SET_NEXT_HOP, - NSS_WIFI_EXT_VDEV_MSG_STATS_SYNC, - NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_VLAN, - NSS_WIFI_EXT_VDEV_MSG_MAX -}; - -/** - * nss_wifi_ext_vdev_error_tyes - * WiFi extension error types. - */ -enum nss_wifi_ext_vdev_error_types { - NSS_WIFI_EXT_VDEV_ERROR_NONE = NSS_IF_ERROR_TYPE_MAX + 1, - /** Configuration successful. */ - NSS_WIFI_EXT_VDEV_ERROR_NULL_MAC, /**< NULL MAC received. */ - NSS_WIFI_EXT_VDEV_ERROR_INV_RADIO_ID, /**< Invalid radio interface number. */ - NSS_WIFI_EXT_VDEV_ERROR_INV_PVAP_ID, /**< Invalid parent virtual device interface number. */ - NSS_WIFI_EXT_VDEV_ERROR_RADIO_NOT_PRESENT, /**< Radio node is not present. */ - NSS_WIFI_EXT_VDEV_ERROR_INV_IF, /**< Message sent on invalid interface number. */ - NSS_WIFI_EXT_VDEV_ERROR_INV_VLAN_ID, /**< Invalid VLAN ID. */ - NSS_WIFI_EXT_VDEV_ERROR_INV_CMD, /**< Invalid command. */ - NSS_WIFI_EXT_VDEV_ERROR_PEERID_ALREADY_CONFIGURED, - /**< Peer ID is already configured. */ - NSS_WIFI_EXT_VDEV_ERROR_MAX /**< Maxiumum error types. */ -}; - -/** - * nss_wifi_ext_vdev_wds_msg - * Extended WDS configuration message. - */ -struct nss_wifi_ext_vdev_wds_msg { - uint16_t wds_peer_id; /**< WDS station peer ID. */ - uint16_t mac_addr[3]; /**< Remote MAC address. */ -}; - -/** - * nss_wifi_ext_vdev_stats - * Statistics message structure. - */ -struct nss_wifi_ext_vdev_stats { - struct nss_cmn_node_stats node_stats; /**< Ethernet node statistics. */ - uint32_t mc_count; /**< Number of mulitcast counts. */ - uint32_t nxt_hop_drp; /**< Next hop drop. */ -}; - -/** - * nss_wifi_vdev_config_msg - * NSS Wi-Fi virtual device configuration message. - */ -struct nss_wifi_ext_vdev_configure_if_msg { - uint8_t mac_addr[ETH_ALEN]; /**< MAC address. */ - uint16_t radio_ifnum; /**< Radio interface corresponding to virtual AP. */ - uint16_t pvap_ifnum; /**< Parent virtual device interface number. */ -}; - -/** - * nss_wifi_ext_vdev_set_next_hop_msg - * Message to set the next hop. - */ -struct nss_wifi_ext_vdev_set_next_hop_msg { - uint32_t if_num; /**< Interface number. */ -}; - -/** - * nss_wifi_ext_vdev_vlan_msg - * Extended VLAN configuration message. - */ -struct nss_wifi_ext_vdev_vlan_msg { - uint16_t vlan_id; /**< VLAN ID. */ -}; - -/** - * nss_wifi_ext_vdev_msg - * Message structure to Send/Receive commands. - */ -struct nss_wifi_ext_vdev_msg { - struct nss_cmn_msg cm; /**< Cnode message. */ - union { - union nss_if_msgs if_msg; /**< NSS interface base message. */ - struct nss_wifi_ext_vdev_configure_if_msg cmsg; /**< Interface configuration message. */ - struct nss_wifi_ext_vdev_wds_msg wmsg; /**< WDS configure message. */ - struct nss_wifi_ext_vdev_set_next_hop_msg wnhm; /**< Next hop set message. */ - struct nss_wifi_ext_vdev_stats stats; /**< Statistics messasge. */ - struct nss_wifi_ext_vdev_vlan_msg vmsg; /**< VLAN message. */ - } msg; -}; - -/** - * Callback function for receiving Wi-Fi extended virtual device data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_wifi_ext_vdev_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving Wi-Fi extended virtual device messages. - * - * @datatypes - * nss_wifi_ext_vdev_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] wevm Pointer to the message data. - */ -typedef void (*nss_wifi_ext_vdev_msg_callback_t)(void *app_data, struct nss_cmn_msg *ncm); - -/** - * Callback function for receiving extended data from the Wi-Fi extended virtual device interface. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - * @param[in] netdev Pointer to the associated network device. - */ -typedef void (*nss_wifi_ext_vdev_ext_data_callback_t)(struct net_device *netdev, - struct sk_buff *skb, struct napi_struct *napi); -/** - * nss_wifi_ext_vdev_msg_init - * Initializes a Wi-Fi extended virtual device message. - * - * @datatypes - * nss_wifi_vdev_msg \n - * nss_wifi_vdev_msg_callback_t - * - * @param[in] nim Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Length of message. - * @param[in] cb Message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -void nss_wifi_ext_vdev_msg_init(struct nss_wifi_ext_vdev_msg *nim, uint32_t if_num, uint32_t type, uint32_t len, - nss_wifi_ext_vdev_msg_callback_t cb, void *app_data); - -/** - * nss_wifi_ext_vdev_unregister_if - * Deregisters a Wi-Fi extended virtual interface from the NSS. - * - * @param[in] if_num Wi-Fi extended virtual interface number. - * - * @return - * None. - * - * @dependencies - * The Wi-Fi extended virtual interface must have been previously registered. - * - * @return - * True if successful, else false. - */ -extern bool nss_wifi_ext_vdev_unregister_if(uint32_t if_num); - -/** - * nss_wifi_ext_vdev_tx_buf - * Sends data buffers to NSS firmware asynchronously. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] os_buf Pointer to the OS buffer (e.g. skbuff). - * @param[in] if_num Wi-Fi extended virtual interface number. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_wifi_ext_vdev_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, - uint32_t if_num); - -/** - * nss_wifi_ext_vdev_tx_msg - * Sends Wi-Fi extended virtual interface messages. - * - * @datatypes - * nss_ctx_instance \n - * nss_wifi_ext_vdev_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] wevm Pointer to the message data. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_wifi_ext_vdev_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_ext_vdev_msg *wevm); - -/** - * nss_wifi_ext_vdev_tx_msg_sync - * Sends messages to NSS firmware synchronously. - * - * @datatypes - * nss_ctx_instance \n - * nss_wifi_ext_vdev_msg - * - * @param[in] nss_ctx NSS core context. - * @param[in] nwevm Pointer to Wi-Fi extended virtual interface message data. - * - * @return - * Status of the transmit operation. - */ -extern nss_tx_status_t nss_wifi_ext_vdev_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_wifi_ext_vdev_msg *nwevm); - -/** - * nss_wifi_ext_vdev_set_next_hop - * Sets the extended virtual interface next hop. - * - * @datatypes - * nss_ctx_instance \n - * - * @param[in] ctx NSS core context. - * @param[in] if_num NSS interface number. - * @param[in] next_hop Next hop interface number. - */ -extern nss_tx_status_t nss_wifi_ext_vdev_set_next_hop(struct nss_ctx_instance *ctx, int if_num, int next_hop); - -/** - * nss_wifi_ext_vdev_get_ctx - * Gets the NSS Wi-Fi extended virtual interface context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_wifi_ext_vdev_get_ctx(void); - -/** - * nss_wifi_ext_vdev_register_if - * Registers Wi-Fi extended virtual interface with NSS. - * - * @datatypes - * net_device \n - * nss_wifi_ext_vdev_data_callback_t \n - * nss_wifi_ext_vdev_ext_data_callback_t \n - * nss_wifi_ext_vdev_msg_callback_t - * - * @param[in] if_num NSS interface number. - * @param[in] cb_func_data Callback for the data. - * @param[in] cb_func_ext Callback for the message. - * @param[in] cb_func_msg Callback for the event message. - * @param[in] features Data socket buffer types supported by this interface. - * @param[in] netdev Pointer to the associated network device. - * @param[in] app_ctx Pointer to the application context. - * - * @return - * NSS interface number allocated. - */ -extern struct nss_ctx_instance *nss_wifi_ext_vdev_register_if(uint32_t if_num, - nss_wifi_ext_vdev_data_callback_t cb_func_data, nss_wifi_ext_vdev_ext_data_callback_t cb_func_ext, - nss_wifi_ext_vdev_msg_callback_t cb_func_msg, struct net_device *netdev, uint32_t features, - void *app_ctx); -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_mac_db_if.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_mac_db_if.h deleted file mode 100644 index 05b942553..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_mac_db_if.h +++ /dev/null @@ -1,277 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - - /** - * @file nss_wifi_mac_db_if.h - * NSS-to-HLOS interface definitions. - */ -#ifndef __NSS_WIFI_MAC_DB_H -#define __NSS_WIFI_MAC_DB_H - -#define NSS_WIFI_MAC_DB_ENTRY_IF_LOCAL 0x1 - -/* - * MAX Wi-Fi MAC database entries sent in group - * is chosen considering the entry size and - * maximum entries a smallest buffer could accomodate. - */ -#define NSS_WIFI_MAC_DB_GROUP_ENTRIES_MAX 48 - -/** - * nss_wifi_mac_db_msg_types - * Wi-Fi MAC database messages. - */ -enum nss_wifi_mac_db_msg_types { - NSS_WIFI_MAC_DB_INIT_MSG, /**< Wi-Fi MAC database initialization message. */ - NSS_WIFI_MAC_DB_ADD_ENTRY_MSG, /**< Wi-Fi MAC database add entry message. */ - NSS_WIFI_MAC_DB_DEL_ENTRY_MSG, /**< Wi-Fi MAC database delete entry message. */ - NSS_WIFI_MAC_DB_UPDATE_ENTRY_MSG, /**< Wi-Fi MAC database update entry message. */ - NSS_WIFI_MAC_DB_DEINIT_MSG, /**< Wi-Fi MAC database deinitialization message. */ - NSS_WIFI_MAC_DB_GROUP_ENTRIES_ADD_MSG, /**< Wi-Fi MAC database group entries add message. */ - NSS_WIFI_MAC_DB_ENTRY_ACTIVITY_MSG, /**< Wi-Fi MAC database entry activity message. */ - NSS_WIFI_MAC_DB_CREATE_ENTRY_MSG, /**< Wi-Fi MAC database entry create message. */ - NSS_WIFI_MAC_DB_MAX_MSG -}; - -/** - * nss_wifi_mac_db_iftype - * Wi-Fi MAC database interface type. - */ -enum nss_wifi_mac_db_iftype { - NSS_WIFI_MAC_DB_ENTRY_IFTYPE_NONE, - NSS_WIFI_MAC_DB_ENTRY_IFTYPE_VAP, /**< Wi-Fi MAC database VAP entry interface. */ - NSS_WIFI_MAC_DB_ENTRY_IFTYPE_NON_VAP, /**< Wi-Fi MAC database non-VAP entry interface. */ - NSS_WIFI_MAC_DB_ENTRY_IFTYPE_MAX /**< Wi-Fi MAC database maximum interface. */ -}; - -/** - * nss_wifi_mac_db_if_opmode - * Wi-Fi MAC database interface operation mode. - */ -enum nss_wifi_mac_db_if_opmode { - NSS_WIFI_MAC_DB_ENTRY_IF_OPMODE_NONE, /**< No entry database interface operation mode. */ - NSS_WIFI_MAC_DB_ENTRY_IF_OPMODE_ETH, /**< Ethernet entry database interface operation mode. */ - NSS_WIFI_MAC_DB_ENTRY_IF_OPMODE_WIFI_AP, /**< Wi-Fi AP entry database interface operation mode. */ - NSS_WIFI_MAC_DB_ENTRY_IF_OPMODE_WIFI_STA, /**< Wi-Fi station entry database interface operation mode. */ - NSS_WIFI_MAC_DB_ENTRY_IF_OPMODE_MAX /**< Maximum entry database interface operation mode. */ -}; - -/** - * Wi-Fi MAC database errors. - */ -enum nss_wifi_mac_db_err_types { - NSS_WIFI_MAC_DB_ERROR_NONE, - /**< Wi-Fi MAC database error none. */ - NSS_WIFI_MAC_DB_ERROR_ENTRY_ALLOC_FAIL, - /**< Error used to report a Wi-Fi MAC database entry pool allocation failure. */ - NSS_WIFI_MAC_DB_ERROR_MAC_EXISTS, - /**< Error used to report that a Wi-Fi MAC database entry already exists. */ - NSS_WIFI_MAC_DB_ERROR_MAC_TABLE_FULL, - /**< Error used to report that a Wi-Fi MAC table is full. */ - NSS_WIFI_MAC_DB_ERROR_MAC_ENTRY_ALLOC_FAILED, - /**< Error used to report a Wi-Fi MAC database entry allocation failure. */ - NSS_WIFI_MAC_DB_ERROR_ENTRY_NOT_FOUND, - /**< Error used to report that a Wi-Fi MAC database entry is not present. */ - NSS_WIFI_MAC_DB_ERROR_MAC_ENTRY_UNHASHED, - /**< Error used to report that a Wi-Fi MAC database entry is unhashed. */ - NSS_WIFI_MAC_DB_ERROR_MAC_ENTRY_DELETE_FAILED, - /**< Error used to report a Wi-Fi MAC database entry delete failure. */ - NSS_WIFI_MAC_DB_ERROR_INVALID_NUM_ENTRIES_FAIL, - /**< Error used to report the number of invalid Wi-Fi MAC database entries. */ - NSS_WIFI_MAC_DB_ERROR_NOT_ALLOCATED_FAIL, - /**< Error used to report that a Wi-Fi MAC database is not allocated. */ - NSS_WIFI_MAC_DB_ERROR_INV_IF_RECVD_FAIL, - /**< Error used to report that a Wi-Fi MAC database entry interface is invalid. */ - NSS_WIFI_MAC_DB_ERROR_INVALID_EVENT, - /**< Error used to report that a Wi-Fi MAC database event is invalid. */ - NSS_WIFI_MAC_DB_ERROR_PN_INVALID, - /**< Error used to report that a Wi-Fi MAC database entry pnode is invalid. */ - NSS_WIFI_MAC_DB_ERROR_PHY_PN_INVALID, - /**< Error used to report that a Wi-Fi MAC database entry radio pnode is invalid. */ - NSS_WIFI_MAC_DB_ERROR_ENTRY_POOL_INVALID, - /**< Error used to report that a Wi-Fi MAC database entry pool is invalid. */ - NSS_WIFI_MAC_DB_ERROR_ENTRY_POOL_ALREADY_ALLOCATED, - /**< Error used to report that a Wi-Fi MAC database entry pool exists. */ - NSS_WIFI_MAC_DB_ERROR_GROUP_ENTRY_ADD_FAIL, - /**< Error used to report that a Wi-Fi MAC database group entry add failure. */ - NSS_WIFI_MAC_DB_ERROR_MAX, - /**< Wi-Fi MAC database error maximum. */ -}; - -/** - * nss_wifi_mac_db_entry_create_msg - * Wi-Fi MAC database entry create message. - */ -struct nss_wifi_mac_db_entry_create_msg { - uint8_t mac_addr[ETH_ALEN]; /**< MAC address. */ - uint16_t reserved; /**< Reserved bytes. */ - int32_t nss_if; /**< NSS interface number. */ -}; - -/** - * nss_wifi_mac_db_entry_activity_info - * Wi-Fi MAC database entry activity information. - */ -struct nss_wifi_mac_db_entry_activity_info { - uint8_t mac_addr[ETH_ALEN]; /**< MAC address. */ - uint16_t reserved; /**< Reserved bytes. */ - int32_t nss_if; /**< NSS interface number. */ -}; - -/** - * nss_wifi_mac_db_entry_activity_info_msg - * Wi-Fi MAC database entry activity information message. - */ -struct nss_wifi_mac_db_entry_activity_info_msg { - uint32_t nentries; /**< Number of entries. */ - struct nss_wifi_mac_db_entry_activity_info info[1]; - /**< Wi-Fi MAC database entry activity information. */ -}; - -/** - * nss_wifi_mac_db_entry_info_msg - * Wi-Fi MAC database entry information. - */ -struct nss_wifi_mac_db_entry_info_msg { - uint8_t mac_addr[ETH_ALEN]; /**< MAC address. */ - uint16_t flag; /**< Flag information about NSS interface. */ - int32_t nss_if; /**< NSS interface number. */ - uint32_t iftype; /**< NSS interface type. */ - uint32_t opmode; /**< NSS interface operation mode. */ - uint32_t wiphy_ifnum; /**< NSS interface for wireless physical device. */ -}; - -/** - * nss_wifi_mac_db_entry_group_info_msg - * Wi-Fi MAC database group of entries information. - */ -struct nss_wifi_mac_db_entry_group_info_msg { - uint32_t num_entries; - /**< Number of entries in group information message. */ - struct nss_wifi_mac_db_entry_info_msg entry[NSS_WIFI_MAC_DB_GROUP_ENTRIES_MAX]; - /**< Wi-Fi MAC database information specific message. */ -}; - -/** - * nss_wifi_mac_db_msg - * Structure that describes Wi-Fi MAC database messages. - */ -struct nss_wifi_mac_db_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of Wi-Fi MAC database message. - */ - union { - struct nss_wifi_mac_db_entry_info_msg nmfdbeimsg; - /**< Wi-Fi MAC database information specific message. */ - struct nss_wifi_mac_db_entry_group_info_msg nmfdbegimsg; - /**< Wi-Fi MAC database information specific message. */ - struct nss_wifi_mac_db_entry_activity_info_msg nmfdbeact_imsg; - /**< Wi-Fi MAC database entry activity information message. */ - struct nss_wifi_mac_db_entry_create_msg nmfdbecmsg; - /**< Wi-Fi MAC database entry create message. */ - } msg; /**< Message payload. */ -}; - -/** - * nss_wifi_mac_db_msg_callback_t - * Callback to receive Wi-Fi MAC database messages. - * - * @datatypes - * nss_wifi_mac_db_msg - * - * @param[in] app_data Application context of the message. - * @param[in] msg Message data. - * - * @return - * void - */ -typedef void (*nss_wifi_mac_db_msg_callback_t)(void *app_data, struct nss_wifi_mac_db_msg *msg); - -/** - * nss_wifi_mac_db_callback_t - * Callback to receive Wi-Fi MAC database messages. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - * - * @return - * void - */ -typedef void (*nss_wifi_mac_db_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - - -/** - * nss_wifi_mac_db_tx_msg - * Send Wi-Fi MAC database messages. - * - * @datatypes - * nss_ctx_instance \n - * nss_wifi_mac_db_msg - * - * @param[in] nss_ctx NSS context. - * @param[in] msg NSS Wi-Fi MAC database message. - * - * @return - * nss_tx_status_t Tx status - */ -extern nss_tx_status_t nss_wifi_mac_db_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_mac_db_msg *msg); - -/** - * nss_register_wifi_mac_db_if - * Register to send/receive Wi-Fi MAC database messages to NSS. - * - * @datatypes - * nss_wifi_mac_db_callback_t \n - * nss_wifi_mac_db_msg_callback_t \n - * net_device - * - * @param[in] if_num NSS interface number. - * @param[in] mfdb_callback Callback for the Wi-Fi MAC database device data. - * @param[in] mfdb_ext_callback Callback for the extended data. - * @param[in] event_callback Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this - * interface. - * - * @return - * nss_ctx_instance* NSS context - */ -struct nss_ctx_instance *nss_register_wifi_mac_db_if(uint32_t if_num, nss_wifi_mac_db_callback_t wifi_mac_db_callback, - nss_wifi_mac_db_callback_t wifi_mac_db_ext_callback, nss_wifi_mac_db_msg_callback_t event_callback, struct net_device *netdev, uint32_t features); - -/** - * nss_unregister_wifi_mac_db_if - * Deregister Wi-Fi MAC database SoC interface with NSS. - * - * @param[in] if_num NSS interface number. - * - * @return - * void - */ -void nss_unregister_wifi_mac_db_if(uint32_t if_num); -struct nss_ctx_instance *nss_wifi_mac_db_get_context(void); -#endif /* __NSS_WIFI_MAC_DB_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_mesh.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_mesh.h deleted file mode 100644 index 986170a43..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_mesh.h +++ /dev/null @@ -1,1000 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_wifi_mesh.h - * NSS TO HLOS Wi-Fi mesh device interface definitions. - */ - -#ifndef __NSS_WIFI_MESH_H -#define __NSS_WIFI_MESH_H - -/** - * @addtogroup nss_wifi_mesh_subsystem - * @{ - */ -#define NSS_WIFI_MESH_WIFI_HDRLEN_MAX 48 -/* - * Wi-Fi mesh maximum dynamic interface. - */ -#define NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE 32 - -/** - * Mesh path update flags. - */ -#define NSS_WIFI_MESH_PATH_UPDATE_FLAG_NEXTHOP 0x01 -#define NSS_WIFI_MESH_PATH_UPDATE_FLAG_HOPCOUNT 0x02 -#define NSS_WIFI_MESH_PATH_UPDATE_FLAG_METRIC 0x04 -#define NSS_WIFI_MESH_PATH_UPDATE_FLAG_MESH_FLAGS 0x08 -#define NSS_WIFI_MESH_PATH_UPDATE_FLAG_EXPIRY_TIME 0x10 -#define NSS_WIFI_MESH_PATH_UPDATE_FLAG_MESH_GATE 0x20 -#define NSS_WIFI_MESH_PATH_UPDATE_FLAG_BLOCK_MESH_FWD 0x40 -#define NSS_WIFI_MESH_PATH_UPDATE_FLAG_METADATA_ENABLE_VALID 0x80 - -/** - * Mesh proxy path update flags. - */ -#define NSS_WIFI_MESH_PROXY_PATH_UPDATE_FLAG_MDA 0x1 -#define NSS_WIFI_MESH_PROXY_PATH_UPDATE_FLAG_MESH 0x2 - -/** - * Mesh path update flags. - */ -#define NSS_WIFI_MESH_PATH_FLAG_REFRESH_SENT 0x1 - -/** - * Mesh path maximum entries. - */ -#define NSS_WIFI_MESH_PATH_MAX_ENTRIES 10 - -/** - * Mesh proxy path maximum entries. - */ -#define NSS_WIFI_MESH_PROXY_PATH_MAX_ENTRIES 10 - -/** - * Mesh configuration flags. - */ -#define NSS_WIFI_MESH_CONFIG_FLAG_TTL_VALID 0x01 -#define NSS_WIFI_MESH_CONFIG_FLAG_MPATH_REFRESH_VALID 0x02 -#define NSS_WIFI_MESH_CONFIG_FLAG_BLOCK_MESH_FORWARDING_VALID 0x04 -#define NSS_WIFI_MESH_CONFIG_FLAG_LOCAL_MAC_VALID 0x08 -#define NSS_WIFI_MESH_CONFIG_FLAG_MPP_LEARNING_MODE_VALID 0x10 -#define NSS_WIFI_MESH_CONFIG_FLAG_SIBLING_IF_NUM_VALID 0x20 -#define NSS_WIFI_MESH_CONFIG_FLAG_BLOCK_MESH_FWD_VALID 0x40 -#define NSS_WIFI_MESH_CONFIG_FLAG_METADATA_ENABLE_VALID 0x80 - -/** - * nss_wifi_mesh_path_flags - * Wi-Fi mesh path flags. - */ -#define NSS_WIFI_MESH_PATH_FLAG_ACTIVE 0x01 -#define NSS_WIFI_MESH_PATH_FLAG_RESOLVING 0x02 -#define NSS_WIFI_MESH_PATH_FLAG_RESOLVED 0x04 -#define NSS_WIFI_MESH_PATH_FLAG_FIXED 0x08 - -#define NSS_WIFI_MESH_ENCAP_METADATA_OFFSET_TYPE 4 - -/* - * nss_wifi_mesh_pre_header_type { - * Wi-Fi pre header types. - */ -enum nss_wifi_mesh_pre_header_type { - NSS_WIFI_MESH_PRE_HEADER_NONE = 0xdcb, /**< No preheader. */ - NSS_WIFI_MESH_PRE_HEADER_80211 = 0xabc, /**< 802.11 preheader. */ - NSS_WIFI_MESH_PRE_HEADER_MAX = 0xdea /**< Max preheader. */ -}; - -/* - * nss_wifi_mesh_extended_data_pkt_types - * Wi-Fi mesh extended data pkt types. - */ -enum nss_wifi_mesh_extended_data_pkt_types { - WIFI_MESH_EXT_DATA_PKT_TYPE_NONE, /**< No packet type. */ - WIFI_MESH_EXT_DATA_PKT_TYPE_EXCEPTION /**< Exception packet type. */ -}; - -/* - * nss_wifi_mesh_ieee80211_hdr - * Wi-Fi header - */ -struct nss_wifi_mesh_ieee80211_hdr { - uint16_t frame_ctl; /* Frame control. */ - uint16_t duration_id; /* Duration ID. */ - uint8_t addr1[ETH_ALEN]; /* Address 1. */ - uint8_t addr2[ETH_ALEN]; /* Address 2. */ - uint8_t addr3[ETH_ALEN]; /* Address 3. */ - uint16_t seq_ctrl; /* Sequence control. */ - uint8_t addr4[ETH_ALEN]; /* Address 4. */ -}__packed; - -/* - * nss_wifi_mesh_ieee80211s_hdr - * Wi-Fi mesh header - */ -struct nss_wifi_mesh_ieee80211s_hdr { - uint8_t flags; /* Mesh flags. */ - uint8_t ttl; /* TTL. */ - uint32_t seq_num; /* Sequence number. */ - uint8_t eaddr1[ETH_ALEN]; /* Mesh Address1. */ - uint8_t eaddr2[ETH_ALEN]; /* Mesh Address2. */ -}__packed; - -/* - * nss_wifi_mesh_per_packet_metadata - * Wi-Fi mesh per packet metadata structure. - */ -struct nss_wifi_mesh_per_packet_metadata { - uint16_t pkt_type; /* Packet type of the metadata. */ - uint8_t wifi_hdr_bytes[NSS_WIFI_MESH_WIFI_HDRLEN_MAX]; /* Wi-Fi header byte stream. */ -}; - -/** - * nss_wifi_mesh_dp_type - * Interface datapath types. - * NSS-to-host path will be seen by ECM for rules. - */ -enum nss_wifi_mesh_dp_type { - NSS_WIFI_MESH_DP_INNER, /**< Inner/Encapsulation Interface. */ - NSS_WIFI_MESH_DP_OUTER, /**< Outer/Decapsulation Interface. */ -}; - -/** - * nss_wifi_mesh_msg_types - * Wi-Fi mesh messages. - */ -enum nss_wifi_mesh_msg_types { - NSS_WIFI_MESH_MSG_INTERFACE_CONFIGURE = NSS_IF_MAX_MSG_TYPES + 1, /**< Wi-Fi mesh interface configure message. */ - NSS_WIFI_MESH_MSG_MPATH_ADD, /**< Wi-Fi mesh path add message. */ - NSS_WIFI_MESH_MSG_MPATH_DELETE, /**< Wi-Fi mesh path delete message. */ - NSS_WIFI_MESH_MSG_MPATH_UPDATE, /**< Wi-Fi mesh path update. */ - NSS_WIFI_MESH_MSG_PROXY_PATH_LEARN, /**< Wi-Fi mesh proxy path learn. */ - NSS_WIFI_MESH_MSG_PROXY_PATH_ADD, /**< Wi-Fi mesh proxy path add. */ - NSS_WIFI_MESH_MSG_PROXY_PATH_DELETE, /**< Wi-Fi mesh proxy path delete. */ - NSS_WIFI_MESH_MSG_PROXY_PATH_UPDATE, /**< Wi-Fi mesh proxy path update. */ - NSS_WIFI_MESH_MSG_PATH_NOT_FOUND, /**< Wi-Fi mesh path not found message. */ - NSS_WIFI_MESH_MSG_PATH_REFRESH, /**< Wi-Fi mesh path refresh message. */ - NSS_WIFI_MESH_MSG_PATH_EXPIRY, /**< Wi-Fi mesh path expiry message. */ - NSS_WIFI_MESH_MSG_PATH_TABLE_DUMP, /**< Wi-Fi mesh path table dump. */ - NSS_WIFI_MESH_MSG_PROXY_PATH_TABLE_DUMP, /**< Wi-Fi mesh proxy path table dump. */ - NSS_WIFI_MESH_MSG_STATS_SYNC, /**< Wi-Fi mesh statistics sync messgae. */ - NSS_WIFI_MESH_MSG_EXCEPTION_FLAG, /**< Wi-Fi mesh exception Flag. */ - NSS_WIFI_MESH_CONFIG_EXCEPTION, /**< Wi-Fi mesh configuration exception. */ - NSS_WIFI_MESH_MSG_MAX /**< Wi-Fi mesh maximum message. */ -}; - -/* - * nss_wifi_mesh_error_types - * Wi-Fi mesh error types. - */ -enum nss_wifi_mesh_error_types { - NSS_WIFI_MESH_ERROR_NONE = NSS_IF_ERROR_TYPE_MAX + 1, /**< Wi-Fi mesh no error type. */ - NSS_WIFI_MESH_ERROR_UNKNOWN_MSG, /**< Wi-Fi mesh unknown message error. */ - NSS_WIFI_MESH_ERROR_TTL_CONFIG, /**< Wi-Fi mesh invalid ttl error. */ - NSS_WIFI_MESH_ERROR_REFRESH_TIME_CONFIG, /**< Wi-Fi mesh invalid refresh time. */ - NSS_WIFI_MESH_ERROR_MPP_LEARNING_MODE_CONFIG, /**< Wi-Fi mesh invalid mpp learning mode. */ - NSS_WIFI_MESH_ERROR_PATH_ADD_MAX_RADIO_CNT, /**< Wi-Fi mesh path add error due to maximum radio count. */ - NSS_WIFI_MESH_ERROR_PATH_ADD_INVALID_INTERFACE_NUM, /**< Wi-Fi mesh path invalid interface number. */ - NSS_WIFI_MESH_ERROR_PATH_ADD_INTERFACE_NUM_NOT_FOUND, /**< Wi-Fi mesh path interface number not found. */ - NSS_WIFI_MESH_ERROR_PATH_TABLE_FULL, /**< Wi-Fi mesh path table full error. */ - NSS_WIFI_MESH_ERROR_PATH_ALLOC_FAIL, /**< Wi-Fi mesh path alloc error. */ - NSS_WIFI_MESH_ERROR_PATH_INSERT_FAIL, /**< Wi-Fi mesh path insert fail. */ - NSS_WIFI_MESH_ERROR_PATH_NOT_FOUND, /**< Wi-Fi mesh path not found error. */ - NSS_WIFI_MESH_ERROR_PATH_UNHASHED, /**< Wi-Fi mesh proxy path unhashed error. */ - NSS_WIFI_MESH_ERROR_PATH_DELETE_FAIL, /**< Wi-Fi mesh proxy path delete error. */ - NSS_WIFI_MESH_ERROR_PROXY_PATH_NOT_FOUND, /**< Wi-Fi mesh proxy path not found error. */ - NSS_WIFI_MESH_ERROR_PROXY_PATH_UNHASHED, /**< Wi-Fi mesh proxy path unhashed error. */ - NSS_WIFI_MESH_ERROR_PROXY_PATH_DELETE_FAIL, /**< Wi-Fi mesh proxy path delete error. */ - NSS_WIFI_MESH_ERROR_PROXY_PATH_EXISTS, /**< Wi-Fi mesh proxy path exists error. */ - NSS_WIFI_MESH_ERROR_PROXY_PATH_ALLOC_FAIL, /**< Wi-Fi mesh proxy path alloc error. */ - NSS_WIFI_MESH_ERROR_PROXY_PATH_INSERT_FAIL, /**< Wi-Fi mesh proxy path insert error. */ - NSS_WIFI_MESH_ERROR_PROXY_PATH_TABLE_FULL, /**< Wi-Fi mesh proxy path table full error. */ - NSS_WIFI_MESH_ERROR_PB_ALLOC_FAIL, /**< Wi-Fi mesh pbuf allocation failures. */ - NSS_WIFI_MESH_ERROR_ENQUEUE_TO_HOST_FAIL, /**< Wi-Fi mesh enqueue to host failures. */ - NSS_WIFI_MESH_ERROR_ENABLE_INTERFACE_FAIL, /**< Wi-Fi mesh enabling interface failures. */ - NSS_WIFI_MESH_ERROR_DISABLE_INTERFACE_FAIL, /**< Wi-Fi mesh disabling interface failures. */ - NSS_WIFI_MESH_ERROR_INVALID_EXCEPTION_NUM, /**< Wi-Fi mesh invalid exception number. */ - NSS_WIFI_MESH_ERROR_ONESHOT_ALREADY_ATTACHED, /**< Wi-Fi mesh oneshot already attached error. */ -}; - -/** - * nss_wifi_mesh_mpp_learning_mode - * Mesh device proxy path learning types. - */ -enum nss_wifi_mesh_mpp_learning_mode { - NSS_WIFI_MESH_MPP_LEARNING_MODE_INDEPENDENT_NSS, /**< Independent NSS learning. */ - NSS_WIFI_MESH_MPP_LEARNING_MODE_NSS_ASSISTED_HOST, /**< NSS assisted host learning. */ - NSS_WIFI_MESH_MPP_LEARNING_MODE_MAX /**< Mesh maximum learning type. */ -}; - -/** - * nss_wifi_mesh_configurable_exceptions - * Mesh configurable exceptions. - */ -enum nss_wifi_mesh_configurable_exceptions { - NSS_WIFI_MESH_DS_MESH_PATH_NOT_FOUND = 1, /**< Downstream (Eth - Wi-Fi) mesh path not found exception. */ - NSS_WIFI_MESH_US_MESH_PROXY_NOT_FOUND = 2, /**< Upstream (Wi-Fi - Eth) mesh proxy path not found exception. */ - NSS_WIFI_MESH_US_MESH_PATH_NOT_FOUND = 3, /**< Upstream (Wi-Fi - Eth) mesh path not found exception. */ - NSS_WIFI_MESH_EXCEPTION_MAX = 4 -}; - -/* - * nss_wifi_mesh_encap_ext_data_pkt_type - * Mesh encap extended data packet type. - */ -enum nss_wifi_mesh_encap_ext_data_pkt_type { - NSS_WIFI_MESH_ENCAP_EXT_DATA_PKT_TYPE_NONE, /**< No packet type. */ - NSS_WIFI_MESH_ENCAP_EXT_DATA_PKT_TYPE_MPATH_NOT_FOUND_EXC, /**< Packet when mesh path is not found. */ - NSS_WIFI_MESH_ENCAP_EXT_DATA_PKT_TYPE_MAX, /**< Maximum packet type. */ -}; - -/** - * nss_wifi_mesh_config_msg - * Mesh device configuration. - */ -struct nss_wifi_mesh_config_msg { - uint8_t local_mac_addr[ETH_ALEN]; /**< Local MAC address. */ - uint16_t reserved; /**< Reserved field. */ - uint32_t ttl; /**< TTL for packet. */ - uint32_t mesh_path_refresh_time; /**< Mesh path refresh time. */ - uint32_t config_flags; /**< Flags indicating which fields are valid. */ - uint32_t sibling_ifnum; /**< Sibling interface number. */ - uint8_t mpp_learning_mode; /**< Mesh proxy path learning mode. */ - uint8_t block_mesh_forwarding; /**< If enabled, blocks packet forwarding. */ - uint8_t reserved_2[2]; /**< Reserved bytes. */ - uint32_t metadata_type; /**< Indicates if metadata should be enabled when block_mesh_forwarding is true. */ -}; - -/** - * nss_wifi_mesh_mpath_add_msg - * Add a mesh path message for a mesh device. - */ -struct nss_wifi_mesh_mpath_add_msg { - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t next_hop_mac_addr[ETH_ALEN]; /**< Next hop MAC address. */ - uint32_t metric; /**< Metric for a mesh path. */ - uint32_t link_vap_id; /**< Radio ID of the mesh path. */ - uint32_t expiry_time; /**< Expiry time in order of ms. */ - uint8_t hop_count; /**< Hop count. */ - uint8_t path_flags; /**< Mesh path flags. */ - uint8_t is_mesh_gate; /**< Destination of this path is a mesh gate. */ - uint8_t block_mesh_fwd; /**< Block intra mesh forward. */ - uint32_t metadata_type; /**< Indicates if metadata should be enabled when block_mesh_forwarding is true. */ -}; - -/** - * nss_wifi_mesh_mpath_delete_msg - * Delete a mesh path message for a mesh device. - */ -struct nss_wifi_mesh_mpath_del_msg { - uint32_t link_vap_id; /**< Radio ID of the mesh path. */ - uint8_t mesh_dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t next_hop_mac_addr[ETH_ALEN]; /**< Next hop MAC address. */ -}; - -/** - * nss_wifi_mesh_mpath_update_msg - * Update a mesh path message for a mesh device. - */ -struct nss_wifi_mesh_mpath_update_msg { - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t next_hop_mac_addr[ETH_ALEN]; /**< Next hop MAC address. */ - uint8_t old_next_hop_mac_addr[ETH_ALEN];/**< Old next hop MAC address. */ - uint32_t metric; /**< Metric for a mesh path. */ - uint32_t link_vap_id; /**< Radio ID of the mesh path. */ - uint32_t expiry_time; /**< Expiration time of mesh path. */ - uint8_t hop_count; /**< Hop count. */ - uint8_t path_flags; /**< Mesh path flags. */ - uint8_t is_mesh_gate; /**< Indicates if the mesh path is a mesh gate. */ - uint8_t update_flags; /**< Update flags. */ - uint8_t block_mesh_fwd; /**< Block intra mesh forward. */ - uint8_t reserved[3]; /**< Reserved bytes. */ - uint8_t metadata_type; /**< Indicates if metadata should be enabled when block_mesh_forwarding is true. */ -}; - -/** - * nss_wifi_mesh_proxy_path_learn_msg - * Learn a mesh proxy path message for a mesh device. - */ -struct nss_wifi_mesh_proxy_path_learn_msg { - uint8_t mesh_dest_mac[ETH_ALEN]; /**< Mesh destination MAC address. */ - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t path_flags; /**< Mesh path flags. */ - uint8_t is_update; /**< Indicates if the learn is an update. */ -}; - -/** - * nss_wifi_mesh_proxy_path_add_msg - * Add a mesh proxy path message for a mesh device. - */ -struct nss_wifi_mesh_proxy_path_add_msg { - uint8_t mesh_dest_mac[ETH_ALEN]; /**< Mesh destination MAC address. */ - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t path_flags; /**< Mesh path flags. */ -}; - -/** - * nss_wifi_mesh_proxy_path_update_msg - * Update a mesh proxy path message for a mesh device. - */ -struct nss_wifi_mesh_proxy_path_update_msg { - uint8_t mesh_dest_mac[ETH_ALEN]; /**< Mesh destination MAC address. */ - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t path_flags; /**< Mesh path flags. */ - uint8_t bitmap; /**< Bitmap indicating valid fields in the update msg. */ -}; - -/** - * nss_wifi_mesh_proxy_path_del_msg - * Delete a mesh proxy path message for a mesh device. - */ -struct nss_wifi_mesh_proxy_path_del_msg { - uint8_t mesh_dest_mac_addr[ETH_ALEN]; /**< Mesh destination MAC. */ - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ -}; - -/** - * nss_wifi_mesh_mpath_not_found_msg - * Wi-Fi mesh path not found meesage. - */ -struct nss_wifi_mesh_mpath_not_found_msg { - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t transmitter_mac_addr[ETH_ALEN]; /**< Transmitter address. */ - uint32_t link_vap_id; /**< NSS interface number of the link vap if received from WiFi. */ - uint8_t is_mesh_forward_path; /**< Indicates if the message is from a forward path. */ -}; - -/** - * nss_wifi_mesh_path_refresh_msg - * Refresh mesh path message. - */ -struct nss_wifi_mesh_path_refresh_msg { - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t next_hop_mac_addr[ETH_ALEN]; /**< Next hop MAC address. */ - uint32_t link_vap_id; /**< Link VAP of the mesh path. */ - uint8_t path_flags; /**< Mesh path flags. */ -}; - -/** - * nss_wifi_mesh_path_expiry_msg - * Mesh path expiration message. - */ -struct nss_wifi_mesh_path_expiry_msg { - uint8_t mesh_dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t next_hop_mac_addr[ETH_ALEN]; /**< Next hop MAC address. */ - uint32_t link_vap_id; /**< Link VAP of the mesh path. */ - uint8_t path_flags; /**< Mesh path flags. */ -}; - -/* - * nss_wifi_mesh_encap_stats - * Encapsulation statistics. - */ -struct nss_wifi_mesh_encap_stats { - uint32_t expiry_notify_sent; /* Number of times expiry notification sent to host. */ - uint32_t mc_count; /* Number of multicast packets. */ - uint32_t mp_not_found; /* Number of times mesh path is not found. */ - uint32_t mp_active; /* Number of times mesh path is active. */ - uint32_t mpp_not_found; /* Number of times proxy path is not found. */ - uint32_t mpp_found; /* Number of times proxy path is found. */ - uint32_t encap_hdr_fail; /* Number of times encapsulating mesh header failed. */ - uint32_t mp_del_notify_fail; /* Number of times notifying mesh path delete failed. */ - uint32_t link_enqueue; /* Number of packets enqueued to the link VAP. */ - uint32_t link_enq_fail; /* Number of times enqueue to link vap failed. */ - uint32_t ra_lup_fail; /* Number of times receiver address look up is failed. */ - uint32_t dummy_add_count; /* Number of times dummy path is added. */ - uint32_t encap_mp_add_notify_fail; /* Number of times add notification failed. */ - uint32_t dummy_add_fail; /* Number of times dummy addition failed. */ - uint32_t dummy_lup_fail; /* Number of times dummy lookup failed. */ - uint32_t send_to_host_failed; /* Number of packets failed to be sent to host. */ - uint32_t sent_to_host; /* Number of packets sent to host. */ - uint32_t expiry_notify_fail; /* Number of times expiry notification to host failed. */ - uint32_t no_headroom; /* Number of packets dropped because there is no headroom. */ - uint32_t path_refresh_sent; /* Number of times path refresh is sent to host. */ - uint32_t linearise_failed; /* Number of packets dropped because pb_linearise. */ -}; - -/* - * nss_wifi_mesh_decap_stats - * Mesh decapsulation statistics. - */ -struct nss_wifi_mesh_decap_stats { - uint32_t path_refresh_sent; /**< Number of times path refresh is sent to host. */ - uint32_t reserved; /**< Reserved field. */ - uint32_t mc_drop; /**< Number of MC drop counts. */ - uint32_t ttl_0; /**< Number of TTL0 counts. */ - uint32_t mpp_lup_fail; /**< Number of mpp lookup failures. */ - uint32_t decap_hdr_fail; /**< Number of decap HDR failures. */ - uint32_t rx_fwd_fail; /**< Number of receive forward failures. */ - uint32_t rx_fwd_success; /**< Number of receive forward success counts. */ - uint32_t mp_fwd_lookup_fail; /**< Number of mpath forward lookup failures. */ - uint32_t mp_fwd_inactive; /**< Number of mpath forward inactive. */ - uint32_t nxt_mnode_fwd_success; /**< Number of next mnode forward successes. */ - uint32_t nxt_mnode_fwd_fail; /**< Number of next mnode forward failures. */ - uint32_t mpp_add_fail; /**< Number of MPP add failures. */ - uint32_t mpp_add_event2host_fail; /**< Number of MPP add event-to-host failures. */ - uint32_t mpp_upate_fail; /**< Number of MPP update failures. */ - uint32_t mpp_update_even2host_fail; /**< Number of MPP update event-to-host failure counts. */ - uint32_t mpp_learn2host_fail; /**< Number of MPP learn-to-host failure counts. */ - uint32_t block_mesh_fwd_packets; /**< Number of packets that are blocked for intra mesh forward. */ - uint32_t no_headroon; /**< Number of packets dropped due to insufficient headroom.. */ - uint32_t linearise_failed; /**< Number of packets dropped due to linear copy failure. */ - uint32_t mpp_learn_events_rate_limited; /**< Number of mesh proxy path learn events dropped due to rate limiting */ - uint32_t mp_missing_events_rate_limited;/**< Number of path missing notifications dropped due to rate limiting */ -}; - -/** - * nss_wifi_mesh_path_dump_entry - * Wi-Fi mesh path dump entry. - */ -struct nss_wifi_mesh_path_dump_entry { - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t next_hop_mac_addr[ETH_ALEN]; /**< Next hop MAC address. */ - uint32_t metric; /**< Mesh path metric. */ - uint32_t expiry_time[2]; /**< Mesh path expiration time. */ - uint8_t hop_count; /**< Number of hop counts. */ - uint8_t flags; /**< Mesh path flags. */ - uint8_t is_mesh_gate; /**< Determines whether gateway capability is enabled. */ - uint8_t reserved[1]; /**< Reserved field. */ - uint32_t link_vap_id; /**< Link interface number. */ -}; - -/** - * nss_wifi_mesh_proxy_path_dump_entry - * Wi-Fi mesh proxy path dump entry. - */ -struct nss_wifi_mesh_proxy_path_dump_entry { - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t mesh_dest_mac[ETH_ALEN]; /**< Mesh destination address. */ - uint8_t flags; /**< Mesh path flags. */ - uint8_t reserved[3]; /**< Reserved field. */ - uint32_t time_diff; /**< Difference of current time and active time. */ -}; - -/** - * nss_wifi_mesh_path_table_dump - * Wi-Fi mesh path table dump. - */ -struct nss_wifi_mesh_path_table_dump { - uint32_t num_entries; /**< Number of entries. */ - uint32_t more_events; /**< Determines whether more events are pending. */ - struct nss_wifi_mesh_path_dump_entry path_entry[0]; /**< Mesh path entries. */ -}; - -/** - * nss_wifi_mesh_proxy_path_table_dump - * Wi-Fi mesh proxy path table dump. - */ -struct nss_wifi_mesh_proxy_path_table_dump { - uint32_t num_entries; /**< Number of entries. */ - uint32_t more_events; /**< More events are pending. */ - struct nss_wifi_mesh_proxy_path_dump_entry path_entry[0]; /**< Mesh proxy path entry. */ -}; - -/** - * nss_wifi_mesh_assoc_link_vap - * Associate a link VAP to mesh. - */ -struct nss_wifi_mesh_assoc_link_vap { - uint32_t link_vap_id; /**< Link interface number. */ -}; - -/** - * nss_wifi_mesh_path_stats - * Wi-Fi mesh path statistics. - */ -struct nss_wifi_mesh_path_stats { - uint32_t alloc_failures; /**< Mesh path allocation failures. */ - uint32_t error_max_radio_count; /**< Mesh path error maximum radio count. */ - uint32_t invalid_interface_failures; /**< Mesh path invalid interface number failures count. */ - uint32_t add_success; /**< Mesh path add success count. */ - uint32_t table_full_errors; /**< Mesh path table full error count. */ - uint32_t insert_failures; /**< Mesh path insert failure count. */ - uint32_t not_found; /**< Mesh path not found failure count. */ - uint32_t delete_success; /**< Mesh path delete success count. */ - uint32_t update_success; /**< Mesh path update success count. */ - uint32_t mesh_path_expired; /**< Mesh path expired. */ - uint32_t mesh_path_refresh_needed; /**< Mesh path refresh needed. */ - uint32_t add_requests; /**< Mesh path add request. */ - uint32_t del_requests; /**< Mesh path delete request. */ - uint32_t update_requests; /**< Mesh path update requests. */ - uint32_t next_hop_updations; /**< Mesh path next hop updations. */ - uint32_t hop_count_updations; /**< Mesh path hop count updations. */ - uint32_t flag_updations; /**< Mesh path mesh flag updations. */ - uint32_t metric_updations; /**< Mesh path metric updations. */ - uint32_t block_mesh_fwd_updations; /**< Mesh path block mesh forward updations. */ - uint32_t delete_failures; /**< Mesh path delete failures. */ -}; - -/** - * nss_wifi_mesh_proxy_path_stats - * Wi-Fi mesh proxy path statistics. - */ -struct nss_wifi_mesh_proxy_path_stats { - uint32_t alloc_failures; /**< Mesh proxy path alloc failure count. */ - uint32_t entry_exist_failures; /**< Mesh proxy path entry already exists. */ - uint32_t add_success; /**< Mesh proxy path add success count. */ - uint32_t table_full_errors; /**< Mesh proxy path table full count. */ - uint32_t insert_failures; /**< Mesh proxy path insert failure count. */ - uint32_t not_found; /**< Mesh proxy path not found count. */ - uint32_t unhashed_errors; /**< Mesh proxy path unhased erorr count. */ - uint32_t delete_failures; /**< Mesh proxy path delete failure count. */ - uint32_t delete_success; /**< Mesh proxy path delete success count. */ - uint32_t update_success; /**< Mesh proxy path update success count. */ - uint32_t lookup_success; /**< Mesh proxy path lookup success count. */ - uint32_t add_requests; /**< Mesh proxy path addition requests. */ - uint32_t del_requests; /**< Mesh proxy path deletion requests. */ - uint32_t update_requests; /**< Mesh proxy path updation requests. */ - uint32_t mda_updations; /**< Mesh proxy path mda updations. */ - uint32_t flag_updations; /**< Mesh proxy path flags updations. */ -}; - -/** - * nss_wifi_mesh_exception_stats - * Wi-Fi mesh exception statistics. - */ -struct nss_wifi_mesh_exception_stats { - uint32_t packets_success; /**< Mesh exception successful packets count. */ - uint32_t packets_dropped; /**< Mesh exception dropped packets count. */ -}; - -/** - * nss_wifi_mesh_stats_sync_msg - * Message to get mesh device statistics from NSS firmware to the host. - */ -struct nss_wifi_mesh_stats_sync_msg { - struct nss_cmn_node_stats pnode_stats; /**< Common firmware statistics. */ - struct nss_wifi_mesh_encap_stats mesh_encap_stats; /**< Encapsulation statistics. */ - struct nss_wifi_mesh_decap_stats mesh_decap_stats; /**< Decapsulation statistics. */ - struct nss_wifi_mesh_path_stats mesh_path_stats; /**< Mesh path statistics. */ - struct nss_wifi_mesh_proxy_path_stats mesh_proxy_path_stats; /**< Mesh proxy path statistics. */ - struct nss_wifi_mesh_exception_stats mesh_except_stats; /**< Mesh exception statistics. */ -}; - -/* nss_wifi_mesh_exception_flag_msg - * Messsage to send exception packets to host. - */ -struct nss_wifi_mesh_exception_flag_msg { - uint8_t dest_mac_addr[ETH_ALEN]; /**< Destination MAC address. */ - uint8_t exception; /**< Exception flag bit. */ - uint8_t reserved[2]; /**< Reserved field. */ -}; - -/** - * nss_wifi_mesh_rate_limit_config - * Message to configure exceptions - */ -struct nss_wifi_mesh_rate_limit_config { - uint32_t exception_num; /**< Indicates the exception - enum wifi_mesh_configurable_exceptions. */ - uint32_t enable; /**< Indicates if exception is enabled. */ - uint32_t rate_limit; /**< Rate limit value in us. */ -}; - -/** - * nss_wifi_mesh_encap_ext_pkt_metadata - * Metadata to extended data callback - */ -struct nss_wifi_mesh_encap_ext_pkt_metadata { - uint16_t pkt_type; /**< Packet type of the exception packet. */ -}; - -/** - * nss_wifi_mesh_msg - * Data sent and received in mesh device-specific messages. - */ -struct nss_wifi_mesh_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a virtual device specific message. - */ - union { - union nss_if_msgs if_msg; - /**< NSS interface base message. */ - struct nss_wifi_mesh_config_msg mesh_config; - /**< Mesh device configuration. */ - struct nss_wifi_mesh_mpath_add_msg mpath_add; - /**< Add a message for a mesh path addition. */ - struct nss_wifi_mesh_mpath_del_msg mpath_del; - /**< Add a message for a mesh path deletion. */ - struct nss_wifi_mesh_mpath_update_msg mpath_update; - /**< Add a message for a mesh path update. */ - struct nss_wifi_mesh_proxy_path_learn_msg proxy_learn_msg; - /**< Add a message for a mesh proxy path learning. */ - struct nss_wifi_mesh_proxy_path_add_msg proxy_add_msg; - /**< Add a message for a mesh proxy path addition. */ - struct nss_wifi_mesh_proxy_path_update_msg proxy_update_msg; - /**< Add a message for a mesh proxy path update. */ - struct nss_wifi_mesh_proxy_path_del_msg proxy_del_msg; - /**< Add a message for a mesh proxy path deletion. */ - struct nss_wifi_mesh_mpath_not_found_msg mpath_not_found_msg; - /**< Mesh path not found message. */ - struct nss_wifi_mesh_path_refresh_msg path_refresh_msg; - /**< Add a message for a mesh path refresh. */ - struct nss_wifi_mesh_path_expiry_msg path_expiry_msg; - /**< Add a message for a mesh path expiration. */ - struct nss_wifi_mesh_path_table_dump mpath_table_dump; - /**< Add a message to dump mesh path table. */ - struct nss_wifi_mesh_proxy_path_table_dump proxy_path_table_dump; - /**< Add a message to dump mesh proxy path table. */ - struct nss_wifi_mesh_stats_sync_msg stats_sync_msg; - /**< Statistics synchronization message. */ - struct nss_wifi_mesh_exception_flag_msg exception_msg; - /**< Exception to host message. */ - struct nss_wifi_mesh_rate_limit_config exc_cfg; - /**< Add a message to configure the rate limit for exception events. */ - } msg; /**< Virtual device message payload. */ -}; - -/** - * nss_wifi_mesh_encap_stats_type - * Wi-Fi mesh encapsulation statistics types. - */ -enum nss_wifi_mesh_encap_stats_type { - NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_PACKETS, /**< Wi-Fi mesh common node receive packets. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_BYTES, /**< Wi-Fi mesh common node receive bytes. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_TX_PACKETS, /**< Wi-Fi mesh common node transmit packets. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_TX_BYTES, /**< Wi-Fi mesh common node transmit bytes. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_DROPPED, /**< Wi-Fi mesh common node receive dropped. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_EXPIRY_NOTIFY_SENT, /**< Wi-Fi mesh encapsulation statistics expiry notify sent. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_MC_COUNT, /**< Wi-Fi mesh encapsulation statistics mc count. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_MP_NOT_FOUND, /**< Wi-Fi mesh encapsulation statistics mpath not found. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_MP_ACTIVE, /**< Wi-Fi mesh encapsulation statistics mpath active */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_MPP_NOT_FOUND, /**< Wi-Fi mesh encapsulation statistics mpp not found. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_MPP_FOUND, /**< Wi-Fi mesh encapsulation statistics mpp found. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_HDR_FAIL, /**< Wi-Fi mesh encapsulation statistics header failed. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_MP_DEL_NOTIFY_FAIL, /**< Wi-Fi mesh encapsulation statistics mpath delete notify. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_LINK_ENQUEUE, /**< Wi-Fi mesh encapsulation statistics link enqueue. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_LINK_ENQUEUE_FAIL, /**< Wi-Fi mesh encapsulation statistics link enqueue failed. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_RA_LOOKUP_FAIL, /**< Wi-Fi mesh encapsulation statistics receiver lookup failed. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_DUMMY_ADD_COUNT, /**< Wi-Fi mesh encapsulation statistics dummy add count. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_MP_ADD_NOTIFY_FAIL, /**< Wi-Fi mesh encapsulation statistics mpath add notify failed. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_DUMMY_ADD_FAIL, /**< Wi-Fi mesh encapsulation statistics dummy add failed. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_DUMMY_LOOKUP_FAIL, /**< Wi-Fi mesh encapsulation statistics dummy look-up failed. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_SEND_TO_HOST_FAILED, /**< Wi-Fi mesh encapsulation statistics when a packet fails to send to host. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_SENT_TO_HOST, /**< Wi-Fi mesh encapsulation statistics when packet is sent to host. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_EXPIRY_NOTIFY_FAIL, /**< Wi-Fi mesh encapsulation statistics expiry notified fail. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_NO_HEADROOM, /**< Wi-Fi mesh encapsulation statistics no headroom. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_PATH_REFRESH_SENT, /**< Wi-Fi mesh encapsulation statistics path refresh sent. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_LINEARISE_FAILED, /**< Wi-Fi mesh encapsulation statistics when linearisation failed. */ - NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX /**< Wi-Fi mesh encapsulation statistics maximum. */ -}; - -/** - * nss_wifi_mesh_decap_stats_type - * Wi-Fi mesh decapsulation statistics types. - */ -enum nss_wifi_mesh_decap_stats_type { - NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_PACKETS, /**< Wi-Fi mesh common node receive packets. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_BYTES, /**< Wi-Fi mesh common node receive bytes. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_TX_PACKETS, /**< Wi-Fi mesh common node transmit packets. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_TX_BYTES, /**< Wi-Fi mesh common node transmit bytes. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_DROPPED, /**< Wi-Fi mesh common node receive dropped. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_PATH_REFRESH_SENT, /**< Wi-Fi mesh decapsulation statistics path refresh sent. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_RESERVED, /**< Wi-Fi mesh decapsulation statistics reserved field. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MC_DROP, /**< Wi-Fi mesh decapsulation statistics MAC dropped count. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_TTL0, /**< Wi-Fi mesh decapsulation statistics ttl0. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MPP_LOOKUP_FAIL, /**< Wi-Fi mesh decapsulation statistics mpp lookup failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_HDR_FAIL, /**< Wi-Fi mesh decapsulation statistics header failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_RX_FWD_FAIL, /**< Wi-Fi mesh decapsulation statistics receive forward failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_RX_FWD_SUCCESS, /**< Wi-Fi mesh decapsulation statistics receive forward successful. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MP_FWD_LOOKUP_FAIL, /**< Wi-Fi mesh decapsulation statistics mpath forward lookup failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MP_FWD_INACTIVE, /**< Wi-Fi mesh decapsulation statistics mpath forward inactive. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MNODE_FWD_SUCCESS, /**< Wi-Fi mesh decapsulation statistics mnode forward successful. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MNODE_FWD_FAIL, /**< Wi-Fi mesh decapsulation statistics mnode forward failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MPP_ADD_FAIL, /**< Wi-Fi mesh decapsulation statistics mpp add failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MPP_ADD_EVENT_TO_HOST_FAIL, /**< Wi-Fi mesh decapsulation statistics mpp add event to host failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MPP_UPDATE_FAIL, /**< Wi-Fi mesh decapsulation statistics mpp update failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MPP_UPDATE_EVENT_TO_HOST_FAIL, /**< Wi-Fi mesh decapsulation statistics mpp update event to host failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MPP_LEARN_TO_HOST_FAIL, /**< Wi-Fi mesh decapsulation statistics mpp learn to host failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_BLOCK_MESH_FWD_PACKETS, /**< Wi-Fi mesh decapsulation statistics block mesh fwd packets. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_NO_HEADROOM, /**< Wi-Fi mesh decapsulation statistics no headroom. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_LINEARISE_FAILED, /**< Wi-Fi mesh decapsulation statistics linearise failed. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MPP_LEARN_EVENT_RL_DROPPED, /**< Wi-Fi mesh decapsulation statistics mpp learn event rl dropped. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MP_MISSING_EVENT_RL_DROPPED, /**< Wi-Fi mesh decapsulation statistics mp missing event rl dropped. */ - NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX /**< Wi-Fi mesh decapsulation statistics maximum. */ -}; - -/** - * nss_wifi_mesh_path_stats_type - * Wi-Fi mesh path statistics types. - */ -enum nss_wifi_mesh_path_stats_type { - NSS_WIFI_MESH_PATH_STATS_TYPE_ALLOC_FAILURES, /**< Wi-Fi mesh path statistics allocation failures. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_ERROR_MAX_RADIO_COUNT, /**< Wi-Fi mesh path statistics maximum radio error count. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_INVALID_INTERFACE_FAILURES, /**< Wi-Fi mesh path statistics invalid interface failures. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_ADD_SUCCESS, /**< Wi-Fi mesh path statistics add success. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_TABLE_FULL_ERRORS, /**< Wi-Fi mesh path statistics table full errors. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_INSERT_FAILURES, /**< Wi-Fi mesh path statistics insertion failures. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_NOT_FOUND, /**< Wi-Fi mesh path statistics not found. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_DELETE_SUCCESS, /**< Wi-Fi mesh path statistics successful deletion. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_UPDATE_SUCCESS, /**< Wi-Fi mesh path statistics successful updation. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_EXPIRED, /**< Wi-Fi mesh path statistics expired. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_REFRESH_NEEDED, /**< Wi-Fi mesh path statistics refresh needed. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_ADD_REQUESTS, /**< Wi-Fi mesh path statistics add requests. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_DELETE_REQUESTS, /**< Wi-Fi mesh path statistics delete requests. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_UPDATE_REQUESTS, /**< Wi-Fi mesh path statistics update requests. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_NEXT_HOP_UPDATIONS, /**< Wi-Fi mesh path statistics next hop updations. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_HOP_COUNT_UPDATIONS, /**< Wi-Fi mesh path statistics hop count updations. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_MESH_FLAG_UPDATIONS, /**< Wi-Fi mesh path statistics mesh flag updations. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_METRIC_UPDATIONS, /**< Wi-Fi mesh path statistics metric updations. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_BLOCK_MESH_FWD_UPDATIONS, /**< Wi-Fi mesh path statistics block mesh forward updations. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_MESH_PATH_DELETE_FAILURES, /**< Wi-Fi mesh path statistics mesh path delete failures. */ - NSS_WIFI_MESH_PATH_STATS_TYPE_MAX /**< Wi-Fi mesh path statistics maximum. */ -}; - -/** - * nss_wifi_mesh_proxy_path_stats_type - * Wi-Fi mesh proxy path statistics types. - */ -enum nss_wifi_mesh_proxy_path_stats_type { - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_ALLOC_FAILURES, /**< Wi-Fi mesh proxy path statistics allocation failures. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_ENTRY_EXIST_FAILURES, /**< Wi-Fi mesh proxy path statistics entry exist failures. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_ADD_SUCCESS, /**< Wi-Fi mesh proxy path statistics add success. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_TABLE_FULL_ERRORS, /**< Wi-Fi mesh proxy path statistics table full errors. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_INSERT_FAILURES, /**< Wi-Fi mesh proxy path statistics insert failures. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_NOT_FOUND, /**< Wi-Fi mesh proxy path statistics not found. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_UNHASHED_ERRORS, /**< Wi-Fi mesh proxy path statistics unhashed errors. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_DELTE_FAILURES, /**< Wi-Fi mesh proxy path statistics delete failures */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_DELETE_SUCCESS, /**< Wi-Fi mesh proxy path statistics delete success. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_UPDATE_SUCCESS, /**< Wi-Fi mesh proxy path statistics update_success. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_LOOKUP_SUCCESS, /**< Wi-Fi mesh proxy path statistics lookup sccesss. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_ADD_REQUESTS, /**< Wi-Fi mesh proxy path statistics add requests. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_DELETE_REQUESTS, /**< Wi-Fi mesh proxy path statistics delete requests. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_UPDATE_REQUESTS, /**< Wi-Fi mesh proxy path statistics update request. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MDA_UPDATIONS, /**< Wi-Fi mesh proxy path statistics mda updations. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_FLAGS_UPDATIONS, /**< Wi-Fi mesh proxy path statistics flags updations. */ - NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX /**< Wi-Fi mesh proxy path statistics maximum. */ -}; - -/** - * nss_wifi_mesh_exception_stats_type - * Wi-Fi mesh exception statistics types. - */ -enum nss_wifi_mesh_exception_stats_type { - NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_PACKETS_SUCCESS, /**< Wi-Fi mesh exception statistics packets success. */ - NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_PACKETS_DROPPED, /**< Wi-Fi mesh exception statistics packets dropped. */ - NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX /**< Wi-Fi mesh exception statistics maximum. */ -}; - -/** - * nss_wifi_mesh_hdl_stats_sync_msg - * Message to get mesh device statistics from NSS firmware to the host. - */ -struct nss_wifi_mesh_hdl_stats_sync_msg { - uint64_t encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX]; /**< Encap statistics. */ - uint64_t decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX]; /**< Decap statistics. */ - uint64_t path_stats[NSS_WIFI_MESH_PATH_STATS_TYPE_MAX]; /**< Path statistics. */ - uint64_t proxy_path_stats[NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX]; /**< Proxy path statistics. */ - uint64_t except_stats[NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX]; /**< Exception statistics. */ -}; - -/** - * nss_wifi_mesh_stats_notification - * Wi-Fi mesh statistics structure. - */ -struct nss_wifi_mesh_stats_notification { - uint32_t core_id; /**< Core ID. */ - nss_if_num_t if_num; /**< Interface number. */ - struct nss_wifi_mesh_hdl_stats_sync_msg stats; /**< Encapsulation-decapsulation statistics. */ -}; - -/** - * nss_wifi_mesh_tx_msg - * Sends a Wi-Fi mesh message to the NSS interface. - * - * @datatypes - * nss_ctx_instance \n - * nss_wifi_mesh_msg - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the transmit operation. - */ -nss_tx_status_t nss_wifi_mesh_tx_msg(struct nss_ctx_instance *nss_ctx, - struct nss_wifi_mesh_msg *msg); - -/** - * nss_wifi_mesh_tx_buf - * Sends a Wi-Fi mesh data packet to the NSS interface. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] os_buf Pointer to the OS data buffer. - * @param[in] if_num NSS interface number. - * - * @return - * Status of the transmit operation. - */ -nss_tx_status_t nss_wifi_mesh_tx_buf(struct nss_ctx_instance *nss_ctx, - struct sk_buff *os_buf, nss_if_num_t if_num); - -/** - * Callback function for receiving Wi-Fi virtual device messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_wifi_mesh_msg_callback_t)(void *app_data, - struct nss_cmn_msg *msg); - -/** - * Callback function for receiving Wi-Fi virtual device data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_wifi_mesh_data_callback_t)(struct net_device *netdev, - struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving extended data plane Wi-Fi virtual device data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - * @param[in] netdev Pointer to the associated network device. - */ -typedef void (*nss_wifi_mesh_ext_data_callback_t)(struct net_device *netdev, - struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_wifi_mesh_msg_init - * Initializes a Wi-Fi mesh device message. - * - * @datatypes - * nss_wifi_mesh_msg \n - * nss_wifi_mesh_msg_callback_t - * - * @param[in] nim Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Length of message. - * @param[in] cb Message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -void nss_wifi_mesh_msg_init(struct nss_wifi_mesh_msg *nim, nss_if_num_t if_num, uint32_t type, uint32_t len, - nss_wifi_mesh_msg_callback_t cb, void *app_data); - -/** - * nss_wifi_mesh_get_context - * Gets the NSS Wi-Fi extended virtual interface context. - * - * @return - * Pointer to the NSS core context. - */ -extern struct nss_ctx_instance *nss_wifi_mesh_get_context(void); - -/** - * nss_register_wifi_mesh_if - * Registers a Wi-Fi mesh device interface with the NSS interface. - * - * @datatypes - * nss_if_num_t \n - * nss_wifi_mesh_data_callback_t \n - * nss_wifi_mesh_ext_data_callback_t \n - * nss_wifi_mesh_msg_callback_t \n - * net_device - * @param[in] if_num NSS interface number. - * @param[in] mesh_data_callback Callback for the Wi-Fi virtual device data. - * @param[in] mesh_ext_data_callback Callback for the extended data. - * @param[in] mesh_event_callback Callback for the message. - * @param[in] dp_type Datapath type. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this - * interface. - * - * @return - * NSS_CORE_STATUS_SUCCESS in case of success. - * NSS_CORE_STATUS_FAILURE in case of failure. - */ -uint32_t nss_register_wifi_mesh_if(nss_if_num_t if_num, nss_wifi_mesh_data_callback_t mesh_data_callback, - nss_wifi_mesh_ext_data_callback_t mesh_ext_data_callback, nss_wifi_mesh_msg_callback_t mesh_event_callback, - uint32_t dp_type, struct net_device *netdev, uint32_t features); - -/** - * nss_unregister_wifi_mesh_if - * Deregisters a Wi-Fi mesh device interface from the NSS interface. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -void nss_unregister_wifi_mesh_if(nss_if_num_t if_num); - -/** - * nss_wifi_mesh_tx_msg_ext - * Sends Wi-Fi mesh data packet along with metadata as a message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in,out] nss_ctx Pointer to the NSS core context. - * @param[in] os_buf Pointer to the OS data buffer. - * - * @return - * Status of the transmit operation. - */ -nss_tx_status_t nss_wifi_mesh_tx_msg_ext(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf); - -/** - * nss_wifi_mesh_verify_if_num - * Verify Wi-Fi mesh interface number. - * - * @datatypes - * interface number \n - * - * @param[in] nss_if_num_t NSS interface number. - * - * @return - * TRUE or FALSE. - */ -extern bool nss_wifi_mesh_verify_if_num(nss_if_num_t if_num); - -/** - * nss_wifi_mesh_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_wifi_mesh_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_wifi_mesh_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or non-zero on failure. - */ -extern int nss_wifi_mesh_stats_unregister_notifier(struct notifier_block *nb); -#endif /* __NSS_WIFI_MESH_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_vdev.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_vdev.h deleted file mode 100644 index 1b52f66d0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifi_vdev.h +++ /dev/null @@ -1,1358 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * @file nss_wifi_vdev.h - * NSS-to-HLOS Wi-Fi virtual device interface definitions. - */ - -#ifndef __NSS_WIFI_VDEV_H -#define __NSS_WIFI_VDEV_H - -/** - * @addtogroup nss_wifi_vdev_subsystem - * @{ - */ -#define NSS_WIFI_HTT_TRANSFER_HDRSIZE_WORD 6 /**< Size of the Host-To-Target (HTT) message transfer header. */ -#define NSS_WIFI_VDEV_PER_PACKET_METADATA_OFFSET 4 -/**< Offset of the metadata in a virtual device message. */ -#define NSS_WIFI_VDEV_DSCP_MAP_LEN 64 /**< Length of the DSCP MAP field. */ -#define NSS_WIFI_VDEV_IPV6_ADDR_LENGTH 16 /**< Size of the IPv6 address field. */ -#define NSS_WIFI_MAX_SRCS 4 /**< Maximum number of multicast sources. */ -#define NSS_WIFI_VDEV_MAX_ME_ENTRIES 32 /**< Maximum number of multicast enhancement entries. */ - -/** - * nss_wifi_vdev_msg_types - * Wi-Fi virtual device messages. - */ -enum nss_wifi_vdev_msg_types { - NSS_WIFI_VDEV_INTERFACE_CONFIGURE_MSG = NSS_IF_MAX_MSG_TYPES + 1, - NSS_WIFI_VDEV_INTERFACE_UP_MSG, - NSS_WIFI_VDEV_INTERFACE_DOWN_MSG, - NSS_WIFI_VDEV_INTERFACE_CMD_MSG, - NSS_WIFI_VDEV_SNOOPLIST_GRP_LIST_CREATE_MSG, - NSS_WIFI_VDEV_SNOOPLIST_GRP_LIST_DELETE_MSG, - NSS_WIFI_VDEV_SNOOPLIST_GRP_MEMBER_ADD_MSG, - NSS_WIFI_VDEV_SNOOPLIST_GRP_MEMBER_REMOVE_MSG, - NSS_WIFI_VDEV_SNOOPLIST_GRP_MEMBER_UPDATE_MSG, - NSS_WIFI_VDEV_SNOOPLIST_DENY_MEMBER_ADD_MSG, - NSS_WIFI_VDEV_SNOOPLIST_DENY_LIST_DELETE_MSG, - NSS_WIFI_VDEV_SNOOPLIST_DENY_LIST_DUMP_MSG, - NSS_WIFI_VDEV_SNOOPLIST_DUMP_MSG, - NSS_WIFI_VDEV_SNOOPLIST_RESET_MSG, - NSS_WIFI_VDEV_SPECIAL_DATA_TX_MSG, - NSS_WIFI_VDEV_VOW_DBG_CFG_MSG, - NSS_WIFI_VDEV_VOW_DBG_STATS_REQ_MSG, - NSS_WIFI_VDEV_DSCP_TID_MAP_MSG, - NSS_WIFI_VDEV_SNOOPLIST_TOGGLE_MSG, - NSS_WIFI_VDEV_UPDATECHDR_MSG, - NSS_WIFI_VDEV_ME_SYNC_MSG, - NSS_WIFI_VDEV_STATS_MSG, - NSS_WIFI_VDEV_SET_NEXT_HOP, - NSS_WIFI_VDEV_DSCP_TID_MAP_ID_MSG, - NSS_WIFI_VDEV_EXTAP_ADD_ENTRY, - NSS_WIFI_VDEV_EXTAP_REMOVE_ENTRY, - NSS_WIFI_VDEV_QWRAP_PSTA_DELETE_ENTRY, - NSS_WIFI_VDEV_QWRAP_PSTA_ADD_ENTRY, - NSS_WIFI_VDEV_QWRAP_ISOLATION_ENABLE, - NSS_WIFI_VDEV_SET_PEER_NEXT_HOP, - NSS_WIFI_VDEV_CONFIG_VLAN_ID_MSG, - NSS_WIFI_VDEV_CONFIG_VLAN_MODE_MSG, - NSS_WIFI_VDEV_INTERFACE_RECOVERY_RESET_MSG, - NSS_WIFI_VDEV_INTERFACE_RECOVERY_RECONF_MSG, - NSS_WIFI_VDEV_SET_GROUP_KEY, - NSS_WIFI_VDEV_HMMC_MEMBER_ADD_MSG, - NSS_WIFI_VDEV_HMMC_MEMBER_DEL_MSG, - NSS_WIFI_VDEV_MAX_MSG -}; - -/** - * nss_wifi_vdev_err_types - * Error types for a Wi-Fi virtual device. - */ -enum nss_wifi_vdev_err_types { - NSS_WIFI_VDEV_ENONE, - NSS_WIFI_VDEV_EUNKNOWN_MSG, - NSS_WIFI_VDEV_EINV_VID_CONFIG, - NSS_WIFI_VDEV_EINV_EPID_CONFIG, - NSS_WIFI_VDEV_EINV_DL_CONFIG, - NSS_WIFI_VDEV_EINV_CMD, - NSS_WIFI_VDEV_EINV_ENCAP, - NSS_WIFI_VDEV_EINV_DECAP, - NSS_WIFI_VDEV_EINV_RX_NXTN, - NSS_WIFI_VDEV_EINV_VID_INDEX, - NSS_WIFI_VDEV_EINV_MC_CFG, - NSS_WIFI_VDEV_SNOOPTABLE_FULL, - NSS_WIFI_VDEV_SNOOPTABLE_ENOMEM, - NSS_WIFI_VDEV_SNOOPTABLE_GRP_LIST_UNAVAILABLE, - NSS_WIFI_VDEV_SNOOPTABLE_GRP_MEMBER_UNAVAILABLE, - NSS_WIFI_VDEV_SNOOPTABLE_PEER_UNAVAILABLE, - NSS_WIFI_VDEV_SNOOPTABLE_GRP_LIST_ENOMEM, - NSS_WIFI_VDEV_SNOOPTABLE_GRP_LIST_EXIST, - NSS_WIFI_VDEV_ME_ENOMEM, - NSS_WIFI_VDEV_EINV_NAWDS_CFG, - NSS_WIFI_VDEV_EINV_EXTAP_CFG, - NSS_WIFI_VDEV_EINV_VOW_DBG_CFG, - NSS_WIFI_VDEV_EINV_DSCP_TID_MAP, - NSS_WIFI_VDEV_INVALID_ETHER_TYPE, - NSS_WIFI_VDEV_SNOOPTABLE_GRP_MEMBER_EXIST, - NSS_WIFI_VDEV_ME_INVALID_NSRCS, - NSS_WIFI_VDEV_EINV_RADIO_ID, - NSS_WIFI_VDEV_RADIO_NOT_PRESENT, - NSS_WIFI_VDEV_CHDRUPD_FAIL, - NSS_WIFI_VDEV_ME_DENY_GRP_MAX_RCHD, - NSS_WIFI_VDEV_EINV_NEXT_HOP, - NSS_WIFI_VDEV_EINV_DSCP_TID_MAP_ID, - NSS_WIFI_VDEV_EINV_TID_VALUE, - NSS_WIFI_VDEV_EINV_EXTAP_TABLE, - NSS_WIFI_VDEV_EXTAP_ENTRY_UPDATE_FAIL, - NSS_WIFI_VDEV_QWRAP_PSTA_ADD_FAIL, - NSS_WIFI_VDEV_QWRAP_PSTA_DEL_FAIL, - NSS_WIFI_VDEV_QWRAP_ISOLATION_EN_FAIL, - NSS_WIFI_VDEV_QWRAP_ALLOC_FAIL, - NSS_WIFI_VDEV_PEER_NOT_FOUND_BY_MAC, - NSS_WIFI_VDEV_PEER_NEXT_HOP_NOT_FOUND, - NSS_VDEV_EUNKNOWN_NEXT_HOP, - NSS_WIFI_VDEV_VLAN_ID_CONFIG_FAIL, - NSS_WIFI_VDEV_VLAN_MODE_CONFIG_FAIL, - NSS_WIFI_VDEV_RECOVERY_RESET_FAIL, - NSS_WIFI_VDEV_RECOVERY_RECONF_FAIL, - NSS_WIFI_VDEV_CONFIG_GROUP_KEY_FAIL, - NSS_WIFI_VDEV_MULTIPASS_NOT_ENABLED, - NSS_WIFI_VDEV_ALLOC_VLAN_MAP_FAILED, - NSS_WIFI_VDEV_MTU_CHANGE_FAIL, - NSS_WIFI_VDEV_MAC_ADDR_CHANGE_FAIL, - NSS_WIFI_VDEV_PPE_PORT_CREATE_FAIL, - NSS_WIFI_VDEV_PPE_PORT_DESTROY_FAIL, - NSS_WIFI_VDEV_PPE_VSI_ASSIGN_FAIL, - NSS_WIFI_VDEV_PPE_VSI_UNASSIGN_FAIL, - NSS_WIFI_VDEV_EINV_MAX_CFG -}; - -/** - * nss_wifi_vdev_ext_data_pkt_type - * Types of extended data plane packets sent from the NSS to the host. - */ -enum nss_wifi_vdev_ext_data_pkt_type { - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_NONE = 0, - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_IGMP = 1, /**< IGMP packets. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MESH = 2, /**< MESH packets. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_INSPECT = 3, /**< Host inspect packets. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_TXINFO = 4, /**< Tx completion information packets. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MPSTA_TX = 5, /**< MP station Tx metadata. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MPSTA_RX = 6, /**< MP station Rx metadata. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_RX_ERR = 7, /**< Rx error packets metadata. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_EXTAP_TX = 8, /**< ExtAP Tx metadata. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_EXTAP_RX = 9, /**< ExtAP Rx metadata. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_WNM_TFS = 10, /**< WNM TFS related metadata. */ - NSS_WIFI_VDEV_EXT_TX_COMPL_PKT_TYPE = 11, /**< Tx completion. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_WDS_LEARN = 12, /**< WDS source port learning command. */ - NSS_WIFI_VDEV_EXT_DATA_PPDU_INFO = 13, /**< PPDU metadata information. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MCBC_RX = 14, /**< Multicast/broadcast packet received. */ - NSS_WIFI_VDEV_MESH_EXT_DATA_PKT_TYPE_RX_SPL_PACKET = 15, - /**< Mesh link VAP special packet. */ - NSS_WIFI_VDEV_MESH_EXT_DATA_PKT_TYPE_RX_MCAST_EXC = 16, - /**< Mesh link VAP multicast packet. */ - NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MAX -}; - -/** - * nss_wifi_vdev_cmd - * Commands for the Wi-Fi virtual device. - */ -enum nss_wifi_vdev_cmd { - NSS_WIFI_VDEV_DROP_UNENC_CMD, /**< Configuration to drop unencrypted frames on VAP. */ - NSS_WIFI_VDEV_ENCAP_TYPE_CMD, /**< Configuration to set encapsulation type on VAP. */ - NSS_WIFI_VDEV_DECAP_TYPE_CMD, /**< Configuration to set decapsulation type on VAP. */ - NSS_WIFI_VDEV_ENABLE_ME_CMD, /**< Configuration to set multicast enhancement on VAP. */ - NSS_WIFI_VDEV_NAWDS_MODE_CMD, /**< Configuration to set NAWDS mode on VAP. */ - NSS_WIFI_VDEV_EXTAP_CONFIG_CMD, /**< Configuration to set extended AP mode on VAP. */ - NSS_WIFI_VDEV_CFG_BSTEER_CMD, /**< Configuration to set bandsteering on VAP. */ - NSS_WIFI_VDEV_VOW_DBG_MODE_CMD, /**< Configuration to set video over wireless (VOW) debug mode on VAP. */ - NSS_WIFI_VDEV_VOW_DBG_RST_STATS_CMD, - /**< Configuration to reset video over wireless (VOW) debug mode on VAP. */ - NSS_WIFI_VDEV_CFG_DSCP_OVERRIDE_CMD, - /**< Configuration to set DSCP/TID value override on VAP. */ - NSS_WIFI_VDEV_CFG_WNM_CAP_CMD, /**< Configuration to set wireless network management (WNM) capability on VAP. */ - NSS_WIFI_VDEV_CFG_WNM_TFS_CMD, /**< Configuration to set WNM traffic filtering and sleep mode (TFS) capability on VAP. */ - NSS_WIFI_VDEV_CFG_WDS_EXT_ENABLE_CMD, - /**< Configuration to set WDS extention capability on VAP. */ - NSS_WIFI_VDEV_CFG_WDS_CMD, /**< Configuration to set WDS on VAP. */ - NSS_WIFI_VDEV_CFG_AP_BRIDGE_CMD, /**< Configuration to enable/disable client isolation. */ - NSS_WIFI_VDEV_SECURITY_TYPE_CMD, /**< Configuration to set security type per VAP. */ - NSS_WIFI_VDEV_CFG_AST_OVERRIDE_CMD, /**< Configuration to set AST (Address Search Table) override on VAP. */ - NSS_WIFI_VDEV_CFG_SON_CAP_CMD, /**< Configuration to set software defined network capability on VAP. */ - NSS_WIFI_VDEV_CFG_MULTIPASS_CMD, /**< Configuration to enable multipass phrase capability on VAP. */ - NSS_WIFI_VDEV_CFG_HLOS_TID_OVERRIDE_CMD, - /**< Configuration to enable HLOS TID override on VAP. */ - NSS_WIFI_VDEV_ENABLE_IGMP_ME_CMD, /**< Configuration to set IGMP multicast enhancement on VAP. */ - NSS_WIFI_VDEV_CFG_WDS_BACKHAUL_CMD, - /**< Configuration to set WDS backhaul extension on VAP. */ - NSS_WIFI_VDEV_CFG_MCBC_EXC_TO_HOST_CMD, /**< Configuration to set multicast/broadcast exception to host on VAP. */ - NSS_WIFI_VDEV_CFG_PEER_AUTHORIZE_CMD, - /**< Configuration to enable peer authorization on VAP. */ - NSS_WIFI_VDEV_MAX_CMD -}; - -/** - * nss_wifi_vdev_dp_type - * Virtual device datapath types. - */ -enum nss_wifi_vdev_dp_type { - NSS_WIFI_VDEV_DP_ACCELERATED, /**< Wi-Fi accelerated VAP type. */ - NSS_WIFI_VDEV_DP_NON_ACCELERATED, /**< Wi-Fi non-acclerated VAP type. */ - NSS_WIFI_VDEV_DP_TYPE_MAX /**< Wi-Fi maximum VAP type. */ -}; - -/** - * nss_wifi_vdev_vlan_tagging_mode - * Supported VLAN tagging modes. - */ -enum nss_wifi_vdev_vlan_tagging_mode { - NSS_WIFI_VDEV_VLAN_NONE, /**< VLAN support disabled. */ - - /** - * Default VLAN mode to add VLAN tag in Rx path and - * remove VLAN tag only when matching with configured - * VLAN tag in Tx path. - */ - NSS_WIFI_VDEV_VLAN_INGRESS_ADD_EGRESS_STRIP_ON_ID_MATCH, - - /** - * Port-based VLAN mode to add VLAN tag in Rx path - * and remove any VLAN tag in Tx path. - */ - NSS_WIFI_VDEV_VLAN_INGRESS_ADD_EGRESS_STRIP_ALWAYS, - NSS_WIFI_VDEV_VLAN_MAX /**< Wi-Fi maximum VLAN support type. */ -}; - -enum vap_ext_mode { - WIFI_VDEV_EXT_MODE_MESH_LINK = 1, /* Wi-Fi mesh VAP mode */ - WIFI_VDEV_EXT_MODE_MAX, /* Wi-Fi maximum VAP mode */ -}; - -/** - * nss_wifi_vdev_config_msg - * Virtual device configuration. - */ -struct nss_wifi_vdev_config_msg { - uint8_t mac_addr[ETH_ALEN]; /**< MAC address. */ - uint16_t radio_ifnum; /**< Corresponding radio interface number. */ - uint32_t vdev_id; /**< Virtual device ID. */ - uint32_t epid; /**< Endpoint ID of the copy engine. */ - uint32_t downloadlen; /**< Size of the header download length. */ - uint32_t hdrcachelen; /**< Size of the header cache. */ - uint32_t hdrcache[NSS_WIFI_HTT_TRANSFER_HDRSIZE_WORD]; - /**< Cached per descriptor metedata shared with NSS Firmware. */ - uint32_t opmode; /**< VAP operating mode: Access-Point (AP) or Station (STA). */ - uint32_t mesh_mode_en; /**< Mesh mode is enabled. */ - uint8_t is_mpsta; - /**< Specifies whether the station is a VAP Master-Proxy (MP) station. */ - uint8_t is_psta; - /**< Specifies whether the station is a proxy station. */ - uint8_t special_vap_mode; - /**< Special VAP for monitoring received management packets. */ - uint8_t smartmesh_mode_en; - /**< VAP is configured as a smart monitor VAP. */ - uint8_t is_wrap; /**< Specifies whether the VAP is a WRAP-AP. */ - uint8_t is_nss_qwrap_en; /**< VAP is configured for NSS firmware QWRAP logic. */ - uint8_t tx_per_pkt_vdev_id_check; /**< Transmit per-packet virtual device ID check. */ - uint8_t align_pad; /**< Reserved field. */ - uint32_t vap_ext_mode; /**< Different VAP extended modes. */ -}; - -/** - * nss_wifi_vdev_enable_msg - * Enable a message for a virtual device. - */ -struct nss_wifi_vdev_enable_msg { - uint8_t mac_addr[ETH_ALEN]; /**< MAC address. */ - uint8_t reserved[2]; /**< Reserved for 4-byte alignment padding. */ -}; - -/** - * nss_wifi_vdev_disable_msg - * Disable message for a virtual device. - */ -struct nss_wifi_vdev_disable_msg { - uint32_t reserved; /**< Placeholder for future enhancement. */ -}; - -/** - * nss_wifi_vdev_recovery_msg - * Recovery message for a virtual device. - */ -struct nss_wifi_vdev_recovery_msg { - uint32_t reserved; /**< Placeholder for future enhancement. */ -}; - -/** - * nss_wifi_vdev_set_next_hop_msg - * Set next hop for Wi-Fi virtual device. - */ -struct nss_wifi_vdev_set_next_hop_msg { - uint32_t ifnumber; /**< Next hop interface number. */ -}; - -/** - * nss_wifi_vdev_extap_map - * Wi-Fi EXTAP map for IPv4/IPv6 addresses. - */ -struct nss_wifi_vdev_extap_map { - uint16_t ip_version; /**< IPv4 or IPv6 address. */ - uint8_t h_dest[ETH_ALEN]; /**< MAC address of original backend. */ - union { - uint8_t IPv4[4]; /**< IPv4 address of the backend. */ - uint8_t IPv6[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; /**< IPv6 group IP address. */ - } u; -}; - -/** - * nss_wifi_vdev_cmd_msg - * Virtual device commands. - */ -struct nss_wifi_vdev_cmd_msg { - uint32_t cmd; /**< Command type. */ - uint32_t value; /**< Command value. */ -}; - -/** - * nss_wifi_vdev_me_snptbl_grp_create_msg - * Information for creating the snooptable group of a virtual device. - */ -struct nss_wifi_vdev_me_snptbl_grp_create_msg { - uint32_t ether_type; /**< Ether type of the multicast group. */ - - /** - * IP address of a multicast group. - */ - union { - uint32_t grpaddr_ip4; - /**< IPv4 address. */ - uint8_t grpaddr_ip6[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 address. */ - } u; /**< IP address of the multicast group. */ - - uint8_t grp_addr[ETH_ALEN]; - /**< MAC address of the multicast group. */ -}; - -/** - * nss_wifi_vdev_me_snptbl_grp_delete_msg - * Information for deleting a snooplist group list. - */ -struct nss_wifi_vdev_me_snptbl_grp_delete_msg { - uint32_t ether_type; /**< Ether type of the multicast group. */ - - /** - * IP address of the multicast group. - */ - union { - uint32_t grpaddr_ip4; - /**< IPv4 address. */ - uint8_t grpaddr_ip6[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 address. */ - } u; /**< IP address of the multicast group. */ - - uint8_t grp_addr[ETH_ALEN]; /**< MAC address of the multicast group. */ -}; - -/** - * struct nss_wifi_vdev_me_mbr_ra_info - * Address details of receiver members. - */ -struct nss_wifi_vdev_me_mbr_ra_info { - bool dup; - /**< Duplicate bit to identify if next hop address is present. */ - uint8_t ramac[ETH_ALEN]; - /**< MAC address of receiver. */ -}; - -/** - * nss_wifi_vdev_me_snptbl_grp_mbr_add_msg - * Information for adding a snooplist group member. - */ -struct nss_wifi_vdev_me_snptbl_grp_mbr_add_msg { - uint32_t ether_type; /**< Ether type of the multicast group. */ - - /** - * IP address of the multicast group. - */ - union { - uint32_t grpaddr_ip4; - /**< IPv4 address. */ - uint8_t grpaddr_ip6[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 address. */ - } u; /**< IP address of the multicast group. */ - - uint32_t peer_id; /**< Peer ID. */ - uint8_t grp_addr[ETH_ALEN]; - /**< MAC address of the multicast group. */ - uint8_t grp_member_addr[ETH_ALEN]; - /**< MAC address of the multicast group member. */ - uint8_t mode; /**< Multicast enhancement mode - mode 2 and mode 5. */ - uint8_t nsrcs; /**< Number of source IP addresses for selective source multicast. */ - uint8_t src_ip_addr[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH * NSS_WIFI_MAX_SRCS]; - /**< Source IP address. */ - struct nss_wifi_vdev_me_mbr_ra_info ra_entry; - /**< Receiver address entry corresponding to the member. */ -}; - -/** - * nss_wifi_vdev_me_snptbl_grp_mbr_delete_msg - * Information for removing a snooplist group member. - */ -struct nss_wifi_vdev_me_snptbl_grp_mbr_delete_msg { - uint32_t ether_type; /**< Ether type of the multicast group. */ - - /** - * IP address of the multicast group. - */ - union { - uint32_t grpaddr_ip4; - /**< IPv4 address. */ - uint8_t grpaddr_ip6[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 address. */ - }u; /**< IP address of the multicast group. */ - uint8_t grp_addr[ETH_ALEN]; - /**< MAC address of the multicast group. */ - uint8_t grp_member_addr[ETH_ALEN]; - /**< MAC address of the multicast group member. */ -}; - -/** - * nss_wifi_vdev_me_snptbl_grp_mbr_update_msg - * Information for updating a snooplist group member. - */ -struct nss_wifi_vdev_me_snptbl_grp_mbr_update_msg { - uint32_t ether_type; /**< Ether type of the multicast group. */ - - /** - * IP address of the multicast group. - */ - union { - uint32_t grpaddr_ip4; - /**< IPv4 address. */ - uint8_t grpaddr_ip6[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 address. */ - }u; /**< IP address of the multicast group. */ - - uint8_t grp_addr[ETH_ALEN]; - /**< MAC address of the multicast group. */ - uint8_t grp_member_addr[ETH_ALEN]; - /**< MAC address of the multicast group member. */ - uint8_t mode; /**< Multicast enhancement mode - mode 2 and mode 5. */ - uint8_t nsrcs; /**< Number of source IP addresses for selective source multicast. */ - uint8_t src_ip_addr[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH * NSS_WIFI_MAX_SRCS]; - /**< Source IP address. */ -}; - -/** - * nss_wifi_vdev_me_hmmc_add_msg - * Information for adding an entry into the host-managed multicast list. - */ -struct nss_wifi_vdev_me_hmmc_add_msg { - uint32_t ether_type; /**< IPv4 or IPv6. */ - union { - uint32_t ipv4_addr; - /**< IPv4 multicast group address. */ - uint8_t ipv6_addr[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 multicast group address. */ - } u; /**< Type of group addresses. */ - uint32_t netmask; /**< IP subnet netmask. */ -}; - -/** - * nss_wifi_vdev_me_hmmc_del_msg - * Information for deleting an entry from the host-managed multicast list. - */ -struct nss_wifi_vdev_me_hmmc_del_msg { - uint32_t ether_type; /**< IPv4 or IPv6. */ - union { - uint32_t ipv4_addr; - /**< IPv4 multicast group address. */ - uint8_t ipv6_addr[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 multicast group address. */ - } u; /**< Type of group addresses. */ - uint32_t netmask; /**< IP subnet netmask. */ -}; - -/** - * nss_wifi_vdev_me_deny_ip_add_msg - * Information for adding an entry into the deny list. - */ -struct nss_wifi_vdev_me_deny_ip_add_msg { - uint32_t ether_type; /**< IPv4 or IPv6. */ - union { - uint32_t ipv4_addr; - /**< IPv4 multicast group address. */ - uint8_t ipv6_addr[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 multicast group address. */ - } u; /**< Type of group addresses. */ - uint32_t netmask; /**< IP subnet netmask. */ -}; - -/** - * nss_wifi_vdev_me_deny_ip_del_msg - * Information for deleting an entry from the deny list. - */ -struct nss_wifi_vdev_me_deny_ip_del_msg { - uint32_t ether_type; /**< IPv4 or IPv6. */ - union { - uint32_t ipv4_addr; - /**< IPv4 multicast group address. */ - uint8_t ipv6_addr[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 multicast group address. */ - } u; /**< Type of group addresses. */ - uint32_t netmask; /**< IP subnet netmask. */ -}; - -/** - * nss_wifi_vdev_me_snptbl_deny_grp_add_msg - * Information for adding a snooplist member to a deny list. - */ -struct nss_wifi_vdev_me_snptbl_deny_grp_add_msg { - uint32_t grpaddr; /**< IP address of the multicast group. */ -}; - -/** - * nss_wifi_vdev_txmsg - * Information for transmitting special data. - */ -struct nss_wifi_vdev_txmsg { - uint16_t peer_id; /**< Peer ID. */ - uint16_t tid; /**< Traffic ID. */ -}; - -/** - * nss_wifi_vdev_vow_dbg_stats - * Types of VoW debug statistics. - */ -struct nss_wifi_vdev_vow_dbg_stats { - uint32_t rx_vow_dbg_counters; /**< VoW Rx debug counter. */ - uint32_t tx_vow_dbg_counters[8]; /**< VoW Tx debug counter. */ -}; - -/** - * nss_wifi_vdev_vow_dbg_cfg_msg - * Information for configuring VoW debug statistics. - */ -struct nss_wifi_vdev_vow_dbg_cfg_msg { - uint8_t vow_peer_list_idx; /**< Index of the peer list. */ - uint8_t tx_dbg_vow_peer_mac4; /**< MAC address 4 for the peer. */ - uint8_t tx_dbg_vow_peer_mac5; /**< MAC address 5 for the peer. */ -}; - -/** - * nss_wifi_vdev_dscp_tid_map - * DSCP-to-TID mapping. - */ -struct nss_wifi_vdev_dscp_tid_map { - uint32_t dscp_tid_map[NSS_WIFI_VDEV_DSCP_MAP_LEN]; - /**< Array holding the DSCP-to-TID mapping. */ -}; - -/** - * nss_wifi_vdev_dscptid_map_id - * DSCP-to-TID map ID. - */ -struct nss_wifi_vdev_dscptid_map_id { - uint8_t dscp_tid_map_id; - /**< DSCP-to-TID mapping ID to be used. */ -}; - -/** - * nss_wifi_vdev_set_peer_next_hop - * Set per peer next hop. - */ -struct nss_wifi_vdev_set_peer_next_hop_msg { - uint8_t peer_mac_addr[ETH_ALEN]; /**< MAC peer address. */ - uint16_t reserved; /**< Reserved. */ - uint32_t if_num; /**< Next hop interface number. */ -}; - -/** - * nss_wifi_vdev_qwrap_psta_msg - * PSTA VAP entry map in QWRAP mode. - */ -struct nss_wifi_vdev_qwrap_psta_msg { - uint8_t oma[ETH_ALEN]; /**< Original MAC address of PSTA VAP. */ - uint8_t vma[ETH_ALEN]; /**< Virtual MAC address of PSTA VAP. */ - uint8_t vdev_id; /**< ID of PSTA VAP. */ - uint8_t is_wired; /**< Is the entry for wired PSTA VAP. */ - uint8_t reserved[2]; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_wifi_vdev_qwrap_isolation_en_msg - * Qwrap isolation mode enable. - */ -struct nss_wifi_vdev_qwrap_isolation_en_msg { - uint8_t isolation_enable; /**< QWRAP isolation mode enable. */ - uint8_t reserved[3]; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_wifi_vdev_igmp_per_packet_metadata - * Per-packet metadata for IGMP packets. - */ -struct nss_wifi_vdev_igmp_per_packet_metadata { - uint32_t tid; /**< TID. */ - uint32_t tsf32; /**< TSF value. */ - uint8_t peer_mac_addr[ETH_ALEN]; - /**< Peer MAC address. */ - uint8_t reserved[2]; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_wifi_vdev_mesh_per_packet_metadata - * Per-packet metadata for Mesh packets. - */ -struct nss_wifi_vdev_mesh_per_packet_metadata { - uint32_t status; /**< Meshmode Status. */ - uint32_t rssi; /**< Received signal strength indication. */ - uint32_t tsf; /**< Tx expiry time. */ - uint16_t tx_retries; /**< Retry count. */ -}; - -/** - * nss_wifi_vdev_vlan_config_msg - * Enable special handling on this VAP where VLAN tagging is added in Rx and removed in Tx. - */ -struct nss_wifi_vdev_vlan_config_msg { - uint16_t vlan_id; /**< VLAN ID configured. */ - uint8_t reserved[2]; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_wifi_vdev_vlan_enable_msg - * Enable VLAN tagging mode on this VAP. - */ -struct nss_wifi_vdev_vlan_enable_msg { - uint8_t vlan_tagging_mode; /**< Flag to enable default or port-based VLAN tagging mode. */ - uint8_t reserved[3]; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_wifi_vdev_set_vlan_group_key - * Set VLAN ID for special peer. - */ -struct nss_wifi_vdev_set_vlan_group_key { - uint16_t vlan_id; /**< VLAN ID. */ - uint16_t group_key; /**< Group key. */ -}; - -/** - * nss_wifi_vdev_txinfo_per_packet_metadata - * Per-packet metadata for Tx completion information packets. - */ -struct nss_wifi_vdev_txinfo_per_packet_metadata { - uint32_t status; /**< Tx completion status. */ - uint16_t msdu_count; /**< Count of MSDUs in the MSDU list. */ - uint16_t num_msdu; /**< Sequence Number of MSDU in the MSDU list. */ - uint32_t msdu_q_time; /**< Time spent by an MSDU in the Wi-Fi firmware. */ - uint32_t ppdu_rate; /**< PPDU rate in code rate. */ - uint8_t ppdu_num_mpdus_success; - /**< Number of successful MPDUs. */ - uint8_t ppdu_num_mpdus_fail; - /**< Number of failed MPDUs. */ - uint16_t ppdu_num_msdus_success; - /**< Number of successful MSDUs. */ - uint32_t ppdu_bytes_success; - /**< Number of successful bytes. */ - uint32_t ppdu_duration; /**< Estimated air time. */ - uint8_t ppdu_retries; /**< Number of times a PPDU is retried. */ - uint8_t ppdu_is_aggregate; - /**< Flag to check whether a PPDU is aggregated. */ - uint16_t start_seq_num; /**< Starting MSDU ID for this PPDU. */ - uint16_t version; /**< PPDU statistics version. */ - uint32_t ppdu_ack_timestamp; - /**< Timestamp (in ms) when an acknowledgement was received. */ - uint32_t ppdu_bmap_enqueued_lo; - /**< Bitmap of packets enqueued to the hardware (LSB). */ - uint32_t ppdu_bmap_enqueued_hi; - /**< Bitmap of packets enqueued to the hardware (MSB). */ - uint32_t ppdu_bmap_tried_lo; - /**< Bitmap of packets sent over the air (LSB). */ - uint32_t ppdu_bmap_tried_hi; - /**< Bitmap of packets sent over the air (MSB). */ - uint32_t ppdu_bmap_failed_lo; - /**< Bitmap of packets that failed to be acknowledged (LSB). */ - uint32_t ppdu_bmap_failed_hi; - /**< Bitmap of packets that failed to be acknowledged (MSB). */ -}; - -/** - * nss_wifi_vdev_qwrap_tx_metadata_types - * Per-packet metadata types for Qwrap Tx packets. - */ -enum nss_wifi_vdev_qwrap_tx_metadata_types { - NSS_WIFI_VDEV_QWRAP_TYPE_NONE = 0, - NSS_WIFI_VDEV_QWRAP_TYPE_TX = 1, - NSS_WIFI_VDEV_QWRAP_TYPE_RX_TO_TX = 2 -}; - -/** - * nss_wifi_vdev_extap_pkt_types - * Per-packet metadata types for ExtAP Tx packets. - */ -enum nss_wifi_vdev_extap_pkt_types { - NSS_WIFI_VDEV_EXTAP_PKT_TYPE_NONE = 0, - NSS_WIFI_VDEV_EXTAP_PKT_TYPE_TX = 1, - NSS_WIFI_VDEV_EXTAP_PKT_TYPE_RX_TO_TX = 2 -}; - -/** - * nss_wifi_vdev_mpsta_per_packet_tx_metadata - * Per-packet metadata for transmitting packets to an MP station. - */ -struct nss_wifi_vdev_mpsta_per_packet_tx_metadata { - uint16_t vdev_id; /**< Virtual device ID. */ - uint16_t metadata_type; /**< Tx metadata type. */ -}; - -/** - * nss_wifi_vdev_mpsta_per_packet_rx_metadata - * Per-packet metadata for receiving packets from an MP station. - */ -struct nss_wifi_vdev_mpsta_per_packet_rx_metadata { - uint16_t vdev_id; /**< Virtual device ID. */ - uint16_t peer_id; /**< Peer ID. */ -}; - -/** - * nss_wifi_vdev_rx_err_per_packet_metadata - * Per-packet metadata for error packets received. - */ -struct nss_wifi_vdev_rx_err_per_packet_metadata { - uint8_t peer_mac_addr[ETH_ALEN]; - /**< Peer MAC address. */ - uint8_t tid; /**< TID. */ - uint8_t vdev_id; /**< Virtual device ID. */ - uint8_t err_type; /**< Error type. */ - uint8_t rsvd[3]; /**< Reserved for future enhancement. */ -}; - -/** - * nss_wifi_vdev_extap_per_packet_metadata - * Per-packet metadata for ExtAP. - */ -struct nss_wifi_vdev_extap_per_packet_metadata { - uint16_t pkt_type; /**< ExtAP packet type. */ - uint8_t res[2]; /**< Reserved for 4-byte alignment. */ -}; - -/** - * nss_wifi_vdev_tx_compl_metadata - * Per-packet metadata for Tx completion message. - */ -struct nss_wifi_vdev_tx_compl_metadata { - uint8_t ta[ETH_ALEN]; /**< Transmitter MAC address. */ - uint8_t ra[ETH_ALEN]; /**< Receiver MAC address. */ - uint16_t ppdu_id; /**< PPDU ID. */ - uint16_t peer_id; /**< Peer ID. */ -}; - -/** - * nss_wifi_vdev_wds_info_type - * Specifies the type of WDS notification information. - */ -enum wifi_vdev_ext_wds_info_type { - NSS_WIFI_VDEV_WDS_TYPE_NONE = 0, - NSS_WIFI_VDEV_WDS_TYPE_RX, /**< Rx WDS entry. */ - NSS_WIFI_VDEV_WDS_TYPE_MEC, /**< Multicast Tx WDS entry. */ - NSS_WIFI_VDEV_WDS_TYPE_DA /**< Rx WDS entry for destination address. */ -}; - -/** - * nss_wifi_vdev_per_packet_metadata - * Payload of per-packet metadata. - */ -struct nss_wifi_vdev_wds_per_packet_metadata { - uint16_t peer_id; /**< Peer ID. */ - uint8_t is_sa_valid; /**< Specifies whether source address is valid. */ - uint8_t reserved; /**< Reserve bytes for alignment. */ - enum wifi_vdev_ext_wds_info_type wds_type; - /**< WDS message type. */ - uint8_t addr4_valid; /**< 802.11 4th address valid flag. */ - uint8_t rsvd; /**< Reserve bytes for alignment. */ - uint16_t sa_idx; /**< Source address index. */ - uint16_t sa_sw_peer_id; /**< Software/Address-Search-Table peer ID. */ -}; - -/** - * nss_wifi_vdev_ppdu_mdata_dir - * Physical layer protocol data unit (PPDU) metadata direction. - */ -enum nss_wifi_vdev_ppdu_mdata_dir { - WIFI_VDEV_PPDU_MDATA_TX, /**< PPDU metadata for transmit direction. */ - WIFI_VDEV_PPDU_MDATA_RX /**< PPDU metadata for receive direction. */ -}; - -/** - * nss_wifi_vdev_ppdu_metadata - * PPDU metadata. - */ -struct nss_wifi_vdev_ppdu_metadata { - uint32_t dir; /**< Data direction for metadata. */ - uint32_t ppdu_id; /**< PPDU ID. */ - uint16_t peer_id; /**< Peer ID. */ - uint8_t first_msdu; /**< First MSDU. */ - uint8_t last_msdu; /**< Last MSDU. */ -}; - -/** - * nss_wifi_vdev_per_packet_metadata - * Wi-Fi per packet metadata content. - */ -struct nss_wifi_vdev_per_packet_metadata { - uint32_t pkt_type; /**< Type of packet. */ - - /** - * Metadata payload for special data receive messages. - */ - union { - struct nss_wifi_vdev_igmp_per_packet_metadata igmp_metadata; - /**< Per packet metadata structure for IGMP. */ - struct nss_wifi_vdev_mesh_per_packet_metadata mesh_metadata; - /**< Per packet metadata structure for mesh mode. */ - struct nss_wifi_vdev_txinfo_per_packet_metadata txinfo_metadata; - /**< Per packet metadata structure for Tx information. */ - struct nss_wifi_vdev_mpsta_per_packet_tx_metadata mpsta_tx_metadata; - /**< Per packet Tx metadata structure for master-proxy station. */ - struct nss_wifi_vdev_mpsta_per_packet_rx_metadata mpsta_rx_metadata; - /**< Per packet Rx metadata structure for master-proxy station. */ - struct nss_wifi_vdev_rx_err_per_packet_metadata rx_err_metadata; - /**< Per packet metadata structure for Rx error. */ - struct nss_wifi_vdev_tx_compl_metadata tx_compl_metadata; - /**< Per packet Tx metadata structure for Tx completion. */ - struct nss_wifi_vdev_wds_per_packet_metadata wds_metadata; - /**< Per packet Tx metadata structure for wireless distribution system mode. */ - struct nss_wifi_vdev_ppdu_metadata ppdu_metadata; - /**< Per packet PPDU metadata needed for per PPDU copy mode. */ - } metadata; - /**< Metadata payload for special data receive message. */ -}; - -/** - * nss_wifi_vdev_meshmode_rx_metadata - * Metadata payload for Mesh mode receive. - */ -struct nss_wifi_vdev_meshmode_rx_metadata { - uint16_t rs_ratephy_lo; /**< PHY rate lower order bytes. */ - uint16_t rs_ratephy_hi; /**< PHY rate higher order bytes. */ - uint16_t cntr_chan_freq; /** Center channel frequency. */ - uint16_t vdev_id; /**< Virtual device ID. */ - uint16_t peer_id; /**< Peer ID. */ - uint16_t rs_rssi; /**< Received signal strength indication (noise floor adjusted). */ - uint8_t rs_flags; /**< First/last MSDU flags. */ - uint8_t rs_channel; /**< Operational channel. */ - uint8_t rs_keyix; /**< Key index. */ - uint8_t padd; /**< Padding to ensure alignment. */ -}; - -/** - * nss_wifi_vdev_rawmode_rx_metadata - * Metadata payload for Raw Mode receive. - */ -struct nss_wifi_vdev_rawmode_rx_metadata { - uint16_t vdev_id; /**< Virtual device ID. */ - uint16_t peer_id; /**< Peer ID. */ -}; - -/** - * nss_wifi_vdev_updchdr_msg - * Information for updating a cache header. - */ -struct nss_wifi_vdev_updchdr_msg { - uint32_t hdrcache[NSS_WIFI_HTT_TRANSFER_HDRSIZE_WORD]; - /**< Updated header cache. */ - uint32_t vdev_id; /**< Virtual device ID. */ -}; - -/** - * nss_wifi_vdev_me_host_sync_grp_entry - * Multicast enhancement host synchronization group table. - */ -struct nss_wifi_vdev_me_host_sync_grp_entry { - uint8_t group_addr[ETH_ALEN]; /**< Group address for this list. */ - uint8_t grp_member_addr[ETH_ALEN]; /**< MAC address of the multicast group member. */ - - /** - * Type of group addresses. - */ - union { - uint32_t grpaddr_ip4; - /**< IPv4 group address. */ - uint8_t grpaddr_ip6[NSS_WIFI_VDEV_IPV6_ADDR_LENGTH]; - /**< IPv6 group address. */ - } u; /**< Type of group addresses. */ - - uint32_t src_ip_addr; - /**< Source IP address. */ -}; - -/** - * wifi_vdev_me_host_sync_msg - * Synchronization message for a multicast enhancement host group. - */ -struct nss_wifi_vdev_me_host_sync_msg { - uint16_t vdev_id; /**< Virtual device ID. */ - uint8_t nentries; /**< Number of group entries carried by this message. */ - uint8_t radio_ifnum; /**< Interface number of the Wi-Fi radio. */ - struct nss_wifi_vdev_me_host_sync_grp_entry grp_entry[NSS_WIFI_VDEV_MAX_ME_ENTRIES]; - /**< Array for multicast group entries. */ -}; - -/** - * nss_wifi_vdev_mcast_enhance_stats - * Multicast enhancement-related statistics. - */ -struct nss_wifi_vdev_mcast_enhance_stats { - - /** - * Number of multicast packets recieved for multicast enhancement conversion. - */ - uint32_t mcast_rcvd; - - /** - * Number of unicast packets sent as part of multicast enhancement conversion. - */ - uint32_t mcast_ucast_converted; - - /** - * Number of multicast enhancement frames dropped because of a - * buffer allocation failure. - */ - uint32_t mcast_alloc_fail; - - /** - * Number of multicast enhancement frames dropped because of a - * buffer enqueue failure. - */ - uint32_t mcast_pbuf_enq_fail; - - /** - * Number of multicast enhancement frames dropped because of a - * buffer copy failure. - */ - uint32_t mcast_pbuf_copy_fail; - - /** - * Number of multicast enhancement frames dropped because of a - * failure in sending flow control to a peer. - */ - uint32_t mcast_peer_flow_ctrl_send_fail; - - /** - * Number of multicast enhancement buffer frames dropped when - * destination MAC is the same as source MAC. - */ - uint32_t mcast_loopback_err; - - /** - * Number of multicast enhancement buffer frames dropped - * because of an empty destination MAC. - */ - uint32_t mcast_dst_address_err; - - /** - * Number of multicast enhancement buffer frames dropped - * because no member is listening on the group. - */ - uint32_t mcast_no_enhance_drop_cnt; - - /** - * Number of multicast bytes received for multicast enhancement. - */ - uint32_t mcast_rcvd_bytes; - - /** - * Number of IGMP packets received for conversion to unicast. - */ - uint32_t igmp_rcvd; - - /** - * Number of IGMP packets converted to unicast as a part of - * VoW IGMP improvements. - */ - uint32_t igmp_ucast_converted; -}; - -/** - * nss_wifi_vdev_stats_sync_msg - * Message to get virtual device statistics from NSS Firmware to Host. - */ -struct nss_wifi_vdev_stats_sync_msg { - uint32_t dropped; /**< Number of dropped packets. */ - uint32_t tx_enqueue_cnt; /**< Transmit pnode enqueue count. */ - uint32_t tx_enqueue_fail_cnt; /**< Transmit pnode enqueue count. */ - uint32_t tx_intra_bss_enqueue_cnt; /**< Intra BSS enqueue count. */ - uint32_t tx_intra_bss_enqueue_fail_cnt; - /**< Intra BSS enqueue fail count. */ - uint32_t tx_intra_bss_mcast_send_cnt; - /**< Virual device multicast/broadcast packet count in AP mode. */ - uint32_t tx_intra_bss_mcast_send_fail_cnt; - /**< Virtual device multicast/broadcast packet count in AP mode. */ - uint32_t tx_enqueue_bytes; /**< Transmit enqueue bytes count. */ - uint32_t rx_enqueue_cnt; /**< Ethernet node enqueue count. */ - uint32_t rx_enqueue_fail_cnt; /**< Ethernet node enqueue fail count. */ - uint32_t rx_except_enqueue_cnt; /**< N2H (NSS to Host) node enqueue count. */ - uint32_t rx_except_enqueue_fail_cnt; /**< N2H (NSS to Host) node enqueue fail count. */ - uint32_t rx_enqueue_bytes; /**< Receive enqueue bytes count. */ - uint32_t rx_wds_learn_send_cnt; /**< Virtual device WDS source port learn count. */ - uint32_t rx_wds_learn_send_fail_cnt; /**< Virtual device WDS source count fail. */ - struct nss_wifi_vdev_mcast_enhance_stats wvmes; - /**< Multicast enhancement statistics. */ - uint32_t num_tx_exception; /**< Number of Tx exception to firmware. */ - uint32_t tx_dma_map_fail; /**< DMA map failure. */ - uint32_t tx_desc_alloc_fail; /**< Descriptor allocation failure. */ - uint32_t tx_hw_ring_full; /**< Hardware ring is full. */ - uint32_t tx_tso_pkt; /**< Number of TSO packets. */ - uint32_t tx_num_seg; /**< Number of segments in TSO packets. */ - uint32_t tx_rcvd; /**< Number of packets received from host. */ - uint32_t tx_rcvd_bytes; /**< Number of bytes received from host. */ - uint32_t cce_classified; - /**< Number of packets that are classified and sent to firmware as an exception. */ - uint32_t cce_classified_raw; - /**< Number of raw packets that are classified and sent to firmware as an exception. */ - uint32_t tx_eapol_cnt; /**< Number of EAPoL frames in transmit direction. */ - uint32_t nawds_tx_mcast_cnt; /**< Number of NAWDS packets sent. */ - uint32_t nawds_tx_mcast_bytes; /**< Number of NAWDS bytes sent. */ - uint32_t per_pkt_vdev_check_fail; /**< Number of packets that failed vdev id check in Tx. */ - uint32_t rx_mcast_cnt; /**< Receive multicast packet count. */ - uint32_t rx_mcast_bytes; /**< Receive multicast bytes count. */ - uint32_t rx_decrypt_err; /**< Receive decryption error */ - uint32_t rx_mic_err; /**< Receive MIC error */ - uint32_t mcbc_exc_host_fail_cnt; - /**< Number of multicast/broadcast packets failed to send to host through exception path. */ -}; - -/** - * nss_wifi_vdev_msg - * Data for sending and receiving virtual device specific messages. - */ -struct nss_wifi_vdev_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a virtual device specific message. - */ - union { - struct nss_wifi_vdev_config_msg vdev_config; - /**< Virtual device configuration. */ - struct nss_wifi_vdev_enable_msg vdev_enable; - /**< Enable a message for a virtual device. */ - struct nss_wifi_vdev_cmd_msg vdev_cmd; - /**< Command message for a virtual device. */ - struct nss_wifi_vdev_me_snptbl_grp_create_msg vdev_grp_list_create; - /**< Creates the snooptable group of a virtual device. */ - struct nss_wifi_vdev_me_snptbl_grp_delete_msg vdev_grp_list_delete; - /**< Deletes a snooplist group list. */ - struct nss_wifi_vdev_me_snptbl_grp_mbr_add_msg vdev_grp_member_add; - /**< Adds a snooplist group member. */ - struct nss_wifi_vdev_me_snptbl_grp_mbr_delete_msg vdev_grp_member_remove; - /**< Removes a snooplist group member. */ - struct nss_wifi_vdev_me_snptbl_grp_mbr_update_msg vdev_grp_member_update; - /**< Updates a snooplist group member. */ - struct nss_wifi_vdev_me_snptbl_deny_grp_add_msg vdev_deny_member_add; - /**< Add a snooplist member to the deny list. */ - struct nss_wifi_vdev_me_hmmc_add_msg vdev_hmmc_member_add; - /**< Adds a new member into the HMMC list. */ - struct nss_wifi_vdev_me_hmmc_del_msg vdev_hmmc_member_del; - /**< Delete a member from the HMMC list. */ - struct nss_wifi_vdev_me_deny_ip_add_msg vdev_deny_list_member_add; - /**< Adds a new member into the deny list. */ - struct nss_wifi_vdev_me_deny_ip_del_msg vdev_deny_list_member_del; - /**< Delete a member from the deny list. */ - struct nss_wifi_vdev_txmsg vdev_txmsgext; - /**< Transmits special data. */ - struct nss_wifi_vdev_vow_dbg_cfg_msg vdev_vow_dbg_cfg; - /**< Configures VoW debug statistics. */ - struct nss_wifi_vdev_vow_dbg_stats vdev_vow_dbg_stats; - /**< Types of VoW debug statistics. */ - struct nss_wifi_vdev_dscp_tid_map vdev_dscp_tid_map; - /**< DSCP-to-TID mapping. */ - struct nss_wifi_vdev_updchdr_msg vdev_updchdr; - /**< Updates a cache header. */ - struct nss_wifi_vdev_me_host_sync_msg vdev_me_sync; - /**< Message for a multicast enhancement host group table synchronization. */ - struct nss_wifi_vdev_stats_sync_msg vdev_stats; - /**< Message to get virtual device statistics from NSS firmware to host. */ - struct nss_wifi_vdev_set_next_hop_msg next_hop; - /**< Next hop message for virtual device. */ - struct nss_wifi_vdev_dscptid_map_id vdev_dscp_tid_map_id; - /**< Message to get DSCP-to-TID mapping id to be used on virtual device. */ - struct nss_wifi_vdev_extap_map vdev_extap_map; - /**< Message to add entry in EXTAP table on virtual device. */ - struct nss_wifi_vdev_qwrap_psta_msg vdev_qwrap_psta_map; - /**< Message to get PSTA VAP details in QWRAP mode. */ - struct nss_wifi_vdev_qwrap_isolation_en_msg vdev_qwrap_isolation_en; - /**< Message to enable QWRAP isolation mode. */ - struct nss_wifi_vdev_set_peer_next_hop_msg vdev_set_peer_next_hp; - /**< Message to set next hop per peer. */ - struct nss_wifi_vdev_vlan_config_msg vdev_vlan_config; - /**< Message to set VLAN configured on a particular virtual device. */ - struct nss_wifi_vdev_vlan_enable_msg vdev_vlan_enable; - /**< Message to enable VLAN tagging support on a particular virtual device. */ - struct nss_wifi_vdev_set_vlan_group_key vlan_group_key; - /**< Message to set group key for peer. */ - } msg; /**< Virtual device message payload. */ -}; - -/** - * nss_wifi_vdev_tx_msg - * Sends a Wi-Fi message to the NSS interface. - * - * @datatypes - * nss_ctx_instance \n - * nss_wifi_vdev_msg - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_wifi_vdev_tx_msg(struct nss_ctx_instance *nss_ctx, - struct nss_wifi_vdev_msg *msg); - -/** - * nss_wifi_vdev_base_tx_msg - * Sends a Wi-Fi message to the NSS VAP interface. - * - * @datatypes - * nss_ctx_instance \n - * nss_wifi_vdev_msg - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_wifi_vdev_base_tx_msg(struct nss_ctx_instance *nss_ctx, - struct nss_wifi_vdev_msg *msg); - -/** - * nss_wifi_vdev_tx_buf - * Sends a Wi-Fi data packet to the NSS interface. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] os_buf Pointer to the OS data buffer. - * @param[in] if_num NSS interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_wifi_vdev_tx_buf(struct nss_ctx_instance *nss_ctx, - struct sk_buff *os_buf, uint32_t if_num); - -/** - * Callback function for receiving Wi-Fi virtual device messages. - * - * @datatypes - * nss_cmn_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_wifi_vdev_msg_callback_t)(void *app_data, - struct nss_cmn_msg *msg); - -/** - * Callback function for receiving Wi-Fi virtual device data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - */ -typedef void (*nss_wifi_vdev_callback_t)(struct net_device *netdev, - struct sk_buff *skb, struct napi_struct *napi); - -/** - * Callback function for receiving extended data plane Wi-Fi virtual device data. - * - * @datatypes - * net_device \n - * sk_buff \n - * napi_struct - * - * @param[in] netdev Pointer to the associated network device. - * @param[in] skb Pointer to the data socket buffer. - * @param[in] napi Pointer to the NAPI structure. - * @param[in] netdev Pointer to the associated network device. - */ -typedef void (*nss_wifi_vdev_ext_data_callback_t)(struct net_device *netdev, - struct sk_buff *skb, struct napi_struct *napi); - -/** - * nss_wifi_vdev_msg_init - * Initializes a Wi-Fi virtual device message. - * - * @datatypes - * nss_wifi_vdev_msg \n - * nss_wifi_vdev_msg_callback_t - * - * @param[in] nim Pointer to the NSS interface message. - * @param[in] if_num NSS interface number. - * @param[in] type Type of message. - * @param[in] len Length of message. - * @param[in] cb Message callback. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -void nss_wifi_vdev_msg_init(struct nss_wifi_vdev_msg *nim, uint32_t if_num, uint32_t type, uint32_t len, - nss_wifi_vdev_msg_callback_t *cb, void *app_data); - -/** - * nss_register_wifi_vdev_if - * Registers a Wi-Fi virtual device interface with the NSS interface. - * - * @datatypes - * nss_ctx_instance \n - * nss_wifi_vdev_callback_t \n - * nss_wifi_vdev_ext_data_callback_t \n - * nss_wifi_vdev_msg_callback_t \n - * net_device - * - * @param[in,out] nss_ctx Pointer to the NSS core context. - * @param[in] if_num NSS interface number. - * @param[in] wifi_data_callback Callback for the Wi-Fi virtual device data. - * @param[in] vdev_ext_data_callback Callback for the extended data. - * @param[in] wifi_event_callback Callback for the message. - * @param[in] netdev Pointer to the associated network device. - * @param[in] features Data socket buffer types supported by this - * interface. - * - * @return - * None. - */ -uint32_t nss_register_wifi_vdev_if(struct nss_ctx_instance *nss_ctx, int32_t if_num, nss_wifi_vdev_callback_t wifi_data_callback, - nss_wifi_vdev_ext_data_callback_t vdev_ext_data_callback, nss_wifi_vdev_msg_callback_t wifi_event_callback, - struct net_device *netdev, uint32_t features); - -/** - * nss_unregister_wifi_vdev_if - * Deregisters a Wi-Fi virtual device interface from the NSS interface. - * - * @param[in] if_num NSS interface number. - * - * @return - * None. - */ -void nss_unregister_wifi_vdev_if(uint32_t if_num); - -/** - * nss_wifi_vdev_tx_msg_ext - * Sends Wi-Fi data packet along with metadata as message to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * sk_buff - * - * @param[in,out] nss_ctx Pointer to the NSS core context. - * @param[in] os_buf Pointer to the OS data buffer. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_wifi_vdev_tx_msg_ext(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf); - -/** - * nss_wifi_vdev_set_next_hop - * Send next hop message to Wi-Fi virtual device. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] if_num NSS interface number. - * @param[in] next_hop Next hop interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_wifi_vdev_set_next_hop(struct nss_ctx_instance *nss_ctx, int if_num, int next_hop); - -/** - * nss_wifi_vdev_base_set_next_hop - * Sends the next hop message to Wi-Fi virtual access point. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] next_hop Next hop interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_wifi_vdev_base_set_next_hop(struct nss_ctx_instance *nss_ctx, int next_hop); - -/** - * nss_wifi_vdev_set_peer_next_hop - * Sends the peer next hop message to Wi-Fi virtual device. - * - * @datatypes - * nss_ctx_instance - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] nss_if NSS interface number. - * @param[in] addr Peer MAC address. - * @param[in] next_hop_if Next hop interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_wifi_vdev_set_peer_next_hop(struct nss_ctx_instance *nss_ctx, uint32_t nss_if, uint8_t *addr, uint32_t next_hop_if); - -/* - * nss_wifi_vdev_set_dp_type - * Sets the datapath type for virtual device. - * - * @datatypes - * nss_ctx_instance \n - * net_device \n - * uint32_t \n - * enum nss_wifi_vdev_dp_type - * - * @param[in] nss_ctx Pointer to the NSS core context. - * @param[in] netdev Pointer to the associated network device. - * @param[in] if_num Interface number of the VAP. - * @param[in] dp_type Datapath type of the VAP. - * - * @return - * True if a success, or false if a failure. - */ -bool nss_wifi_vdev_set_dp_type(struct nss_ctx_instance *nss_ctx, struct net_device *netdev, - uint32_t if_num, enum nss_wifi_vdev_dp_type dp_type); -/** - * @} - */ - -#endif /* __NSS_WIFI_VDEV_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifili_if.h b/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifili_if.h deleted file mode 100644 index 7d5954267..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/exports/nss_wifili_if.h +++ /dev/null @@ -1,2057 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - - /** - * @file nss_wifili_if.h - * NSS TO HLOS interface definitions. - * NOTE: Here we will use wifili as a reference to - * the IPQ807x Wi-Fi object. - */ -#ifndef __NSS_WIFILI_H -#define __NSS_WIFILI_H - - /** - * @addtogroup nss_wifili_subsystem - * @{ - */ - -#define NSS_WIFILI_MAX_SRNG_REG_GROUPS_MSG 2 - /**< Maximum srng (ring) register groups. */ -#define NSS_WIFILI_MAX_NUMBER_OF_PAGE_MSG 32 - /**< Maximum number of pages allocated from host. */ -#define NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG 4 - /**< Maximum number of Transmit Classifier data ring for NSS. */ -#define NSS_WIFILI_MAX_REO_DATA_RINGS_MSG 4 - /**< Maximum number of Rx reorder data ring for NSS. */ -#define NSS_WIFILI_SOC_PER_PACKET_METADATA_OFFSET 4 - /**< Metadata area for storing Rx statistics. */ -#define NSS_WIFILI_MAX_TXDESC_POOLS_MSG 4 - /**< Maximum number of Tx Descriptor software pools. */ -#define NSS_WIFILI_MAX_TX_EXT_DESC_POOLS_MSG 4 - /**< Maximum number of Tx Descriptor Extended software pools. */ -#define NSS_WIFILI_MAX_SOC_NUM 3 - /**< Maximum number of SoC devices. */ -#define NSS_WIFILI_MAX_PDEV_NUM_MSG 3 - /**< Maximum number of pdev devices. */ -#define NSS_WIFILI_MAX_MCS 12 - /**< Maximum Modulaton And Coding Scheme (MCS) count. */ -#define NSS_WIFILI_MAX_MCS_11A 8 - /**< Maximum MCS for 11a mode. */ -#define NSS_WIFILI_MAX_MCS_11B 7 - /**< Maximum MCS for 11b mode. */ -#define NSS_WIFILI_MAX_MCS_11AC 10 - /**< Maximum MCS for 11ac mode. */ -#define NSS_WIFILI_MAX_MCS_11AX 10 - /**< Maximum MCS for 11ax mode. */ -#define NSS_WIFILI_SS_COUNT 8 - /**< Maximum spatial streams count. */ -#define NSS_WIFILI_SUPPORTED_BW 4 - /**< Maximum number of bandwidth supported. */ -#define NSS_WIFILI_REPT_MU_MIMO 1 -#define NSS_WIFILI_REPT_MU_OFDMA_MIMO 3 -#define NSS_WIFILI_MAX_RESERVED_TYPE 2 - /**< Maximum reserved type. */ -#define NSS_WIFILI_SOC_PER_PACKET_METADATA_SIZE 60 - /**< Metadata area total size. */ -#define NSS_WIFILI_MEC_PEER_ID 0xDEAD - /**< MEC (Multicast echo check) peer ID. */ -#define NSS_WIFILI_DA_PEER_ID 0xDAAD - /**< Destination address peer ID. */ -#define NSS_WIFILI_MIC_KEY_LEN 8 - /**< MIC (Message integrity code) key length. */ -#define NSS_WIFILI_TQM_RR_MAX 7 - /**< Maximum transmit queue release reasons. */ -#define NSS_WIFILI_HTT_STATUS_MAX 7 - /**< Maximum HTT completion status. */ -#define NSS_WIFILI_TQM_STATUS_MAX 9 - /**< Maximum TQM completion status. */ -#define NSS_WIFILI_REO_CODE_MAX 15 - /**< Maximum Rx reorder error codes. */ -#define NSS_WIFILI_DMA_CODE_MAX 14 - /**< Maximum DMA error codes. */ -#define NSS_WIFILI_MAX_TID 8 - /**< Maximum TID values. */ -#define NSS_WIFILI_DELAY_INDEX_MAX 10 - /**< Maximum software enqueue delay buckets. */ -#define NSS_WIFILI_MAX_NUMBER_OF_ADDTNL_SEG 64 - /**< Maximum number of additional pages allocated from host. */ -#define NSS_WIFILI_SOC_ATTACHED_MAX_PDEV_NUM 1 - /**< Maximum number of physical devices on the external SoC. */ -#define NSS_WIFILI_PEER_AST_FLOWQ_MAX 4 - /**< Maximum number of flow queues. */ -#define NSS_WIFILI_WBM_INTERNAL_ERR_MAX 5 - /**< WBM internal maximum errors. */ - -/* - * Peer Size in Bytes - */ -#define NSS_WIFILI_PEER_SIZE 1600 - -/* - * Radio specific flags - */ -#define NSS_WIFILI_PDEV_FLAG_V3_STATS_ENABLED 0x00000008 - /**< Flag to enable version 3 statistics. */ -/** - * Peer message flags. - */ -#define NSS_WIFILI_PEER_MSG_DISABLE_4ADDR 0x01 - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * Wireless Multimedia Extention Access Category to TID. @hideinitializer - */ -#define NSS_WIFILI_WME_AC_TO_TID(_ac) ( \ - ((_ac) == NSS_WIFILI_WME_AC_VO) ? 6 : \ - (((_ac) == NSS_WIFILI_WME_AC_VI) ? 5 : \ - (((_ac) == NSS_WIFILI_WME_AC_BK) ? 1 : \ - 0))) - -/** - * Wireless TID to Wireless Extension Multimedia Access Category. @hideinitializer - */ -#define NSS_WIFILI_TID_TO_WME_AC(_tid) ( \ - (((_tid) == 0) || ((_tid) == 3)) ? NSS_WIFILI_WME_AC_BE : \ - ((((_tid) == 1) || ((_tid) == 2)) ? NSS_WIFILI_WME_AC_BK : \ - ((((_tid) == 4) || ((_tid) == 5)) ? NSS_WIFILI_WME_AC_VI : \ - NSS_WIFILI_WME_AC_VO))) -#endif /* __KERNEL */ - -/** - * nss_wifili_thread_scheme_id - * List of thread scheme IDs. - */ -enum nss_wifili_thread_scheme_id { - NSS_WIFILI_THREAD_SCHEME_ID_0, /**< High priority scheme index. */ - NSS_WIFILI_THREAD_SCHEME_ID_1, /**< Low priority scheme index. */ - NSS_WIFILI_THREAD_SCHEME_ID_2, /**< High priority scheme index. */ - NSS_WIFILI_THREAD_SCHEME_ID_MAX /**< Maximum value of scheme index. */ -}; - -/* - * nss_wifili_thread_scheme_priority - * List of wifili thread scheme priority. - */ -enum nss_wifili_thread_scheme_priority { - NSS_WIFILI_LOW_PRIORITY_SCHEME, /**< Low priority scheme. */ - NSS_WIFILI_HIGH_PRIORITY_SCHEME, /**< High priority scheme. */ -}; - -/** - * nss_wifili_wme_stream_classes - * WME stream classes. - */ -enum nss_wifili_wme_stream_classes { - NSS_WIFILI_WME_AC_BE, /**< Best effort. */ - NSS_WIFILI_WME_AC_BK, /**< Background. */ - NSS_WIFILI_WME_AC_VI, /**< Video. */ - NSS_WIFILI_WME_AC_VO, /**< Voice. */ - NSS_WIFILI_WME_AC_MAX /**< Maximum AC Value. */ -}; - -/** - * nss_wifili_packet_type - * Different Packet Types. - */ -enum nss_wifili_packet_type { - NSS_WIFILI_DOT11_A, /**< 802.11a packet type. */ - NSS_WIFILI_DOT11_B, /**< 802.11b packet type. */ - NSS_WIFILI_DOT11_N, /**< 802.11n packet type. */ - NSS_WIFILI_DOT11_AC, /**< 802.11ac packet type. */ - NSS_WIFILI_DOT11_AX , /**< 802.11ax packet type. */ - NSS_WIFILI_DOT11_MAX /**< Maximum 802.11 packet types. */ -}; - -/* - * nss_wifili_decap_pkt_type - * Different Decapsulation packet types - */ -enum wifili_decap_pkt_type { - NSS_WIFILI_DECAP_TYPE_RAW, /**< Raw packet type. */ - NSS_WIFILI_DECAP_TYPE_NATIVE_WIFI, /**< Native Wi-Fi packet type. */ - NSS_WIFILI_DECAP_TYPE_ETHERNET, /**< Ethernet packet type. */ - NSS_WIFILI_DECAP_TYPE_MAX, /**< Maximum packet type. */ -}; - -/** - * nss_wifili_msg_types - * NSS wifili messages. - */ -enum nss_wifili_msg_types { - NSS_WIFILI_INIT_MSG, - NSS_WIFILI_SOC_RESET_MSG, - NSS_WIFILI_PDEV_INIT_MSG, - NSS_WIFILI_PDEV_DEINIT_MSG, - NSS_WIFILI_START_MSG, - NSS_WIFILI_STOP_MSG, - NSS_WIFILI_PEER_CREATE_MSG, - NSS_WIFILI_PEER_DELETE_MSG, - NSS_WIFILI_SEND_PEER_MEMORY_REQUEST_MSG, - NSS_WIFILI_PEER_FREELIST_APPEND_MSG, - NSS_WIFILI_STATS_MSG, - NSS_WIFILI_WDS_VENDOR_MSG, - NSS_WIFILI_PEER_STATS_MSG, - NSS_WIFILI_WDS_PEER_ADD_MSG, - NSS_WIFILI_WDS_PEER_DEL_MSG, - NSS_WIFILI_WDS_PEER_MAP_MSG, - NSS_WIFILI_WDS_ACTIVE_INFO_MSG, - NSS_WIFILI_STATS_CFG_MSG, - NSS_WIFILI_TID_REOQ_SETUP_MSG, - NSS_WIFILI_RADIO_CMD_MSG, - NSS_WIFILI_LINK_DESC_INFO_MSG, - NSS_WIFILI_PEER_SECURITY_TYPE_MSG, - NSS_WIFILI_PEER_NAWDS_ENABLE_MSG, - NSS_WIFILI_RADIO_BUF_CFG, - NSS_WIFILI_DBDC_REPEATER_SET_MSG, - NSS_DBDC_REPEATER_AST_FLUSH_MSG, - NSS_WIFILI_SET_HMMC_DSCP_OVERRIDE_MSG, - NSS_WIFILI_SET_HMMC_DSCP_TID_MSG, - NSS_WIFILI_PDEV_STATS_V3_TXRX_SYNC_MSG, - NSS_WIFILI_PDEV_STATS_V3_DELAY_SYNC_MSG, - NSS_WIFILI_ENABLE_V3_STATS_MSG, - NSS_WIFILI_WDS_PEER_UPDATE_MSG, - NSS_WIFILI_STATS_V2_CFG_MSG, - NSS_WIFILI_SOJOURN_STATS_MSG, - NSS_WIFILI_PEER_SET_VLAN_ID, - NSS_WIFILI_UPDATE_PDEV_LMAC_ID_MSG, - NSS_WIFILI_PEER_AST_FLOWID_MAP_MSG, - NSS_WIFILI_PEER_MEC_AGEOUT_MSG, - NSS_WIFILI_JITTER_STATS_MSG, - NSS_WIFILI_ISOLATION_MSG, - NSS_WIFILI_PEER_EXT_STATS_MSG, - NSS_WIFILI_CLR_STATS, - NSS_WIFILI_PEER_4ADDR_EVENT_MSG, - NSS_WIFILI_DBDC_REPEATER_LOOP_DETECTION_MSG, - NSS_WIFILI_PEER_UPDATE_AUTH_FLAG, - NSS_WIFILI_SEND_MESH_CAPABILITY_INFO, - NSS_WIFILI_MAX_MSG -}; - -/** - * nss_wifili_error_types - * Wifili error message types for functions. - */ -enum nss_wifili_error_types { - NSS_WIFILI_EMSG_NONE, - /**< No error. */ - NSS_WIFILI_EMSG_INIT_FAIL_IMPROPER_STATE, - /**< Device initialization failure due to improper state of device. */ - NSS_WIFILI_EMSG_RINGS_INIT_FAIL, - /**< Device ring initialization failure. */ - NSS_WIFILI_EMSG_PDEV_INIT_IMPROPER_STATE_FAIL, - /**< Radio initialization failure due to improper state of device. */ - NSS_WIFILI_EMSG_PDEV_INIT_INVALID_RADIOID_FAIL, - /**< Radio initialization failed due to invalid radio ID. */ - WIFILI_EMSG_PDEV_INIT_INVALID_TARGETPDEVID_FAIL, - /**< Radio initialization failed due to invalid target physical device ID. */ - NSS_WIFILI_EMSG_PDEV_TX_IRQ_ALLOC_FAIL, - /**< IRQ line allocation for radio transmission failed. */ - NSS_WIFILI_EMSG_PDEV_RESET_INVALID_RADIOID_FAIL, - /**< Radio reset failed due to invalid radio ID. */ - NSS_WIFILI_EMSG_PDEV_RESET_PDEV_NULL_FAIL, - /**< Radio reset failed due to NULL physical device. */ - NSS_WIFILI_EMSG_PDEV_RESET_IMPROPER_STATE_FAIL, - /**< Radio reset failed due to improper state of pdev. */ - NSS_WIFILI_EMSG_START_IMPROPER_STATE_FAIL, - /**< Device start fail due to improper state */ - NSS_WIFILI_EMSG_PEER_CREATE_FAIL, - /**< Peer creation failed. */ - NSS_WIFILI_EMSG_PEER_DELETE_FAIL, - /**< Peer deletion failed. */ - NSS_WIFILI_EMSG_HASHMEM_INIT_FAIL, - /**< Peer hash memory allocation failed. */ - NSS_WIFILI_EMSG_PEER_FREELIST_APPEND_FAIL, - /**< Appending peer to freelist failed. */ - NSS_WIFILI_EMSG_PEER_CREATE_INVALID_VDEVID_FAIL, - /**< Peer creation failure due to invalid virtual device ID. */ - NSS_WIFILI_EMSG_PEER_CREATE_INVALID_PEER_ID_FAIL, - /**< Peer creation failure due to invalid peer ID. */ - NSS_WIFILI_EMSG_PEER_CREATE_VDEV_NULL_FAIL, - /**< Peer creation failure due to NULL virtual device. */ - NSS_WIFILI_EMSG_PEER_CREATE_PDEV_NULL_FAIL, - /**< Peer creation failure due to NULL physical device. */ - NSS_WIFILI_EMSG_PEER_CREATE_ALLOC_FAIL, - /**< Peer creation failure due to memory allocation failure. */ - NSS_WIFILI_EMSG_PEER_DELETE_VAPID_INVALID_FAIL, - /**< Peer deletion failure due to invalid virtual device ID. */ - NSS_WIFILI_EMSG_PEER_DELETE_INVALID_PEERID_FAIL, - /**< Peer deletion failed due to invalid peer ID. */ - NSS_WIFILI_EMSG_PEER_DELETE_VDEV_NULL_FAIL, - /**< Peer deletion failure due to NULL virtual device. */ - NSS_WIFILI_EMSG_PEER_DELETE_PDEV_NULL_FAIL, - /**< Peer deletion failure due to NULL physical device. */ - NSS_WIFILI_EMSG_PEER_DELETE_PEER_NULL_FAIL, - /**< Peer deletion failure due to NULL peer. */ - NSS_WIFILI_EMSG_PEER_DELETE_PEER_CORRUPTED_FAIL, - /**< Peer creation failure due to corrupted peer. */ - NSS_WIFILI_EMSG_PEER_DUPLICATE_AST_INDEX_PEER_ID_FAIL, - /**< AST index provided is duplicate. */ - NSS_WIFILI_EMSG_GROUP0_TIMER_ALLOC_FAIL, - /**< Timer allocation failure. */ - NSS_WIFILI_EMSG_INSUFFICIENT_WT_FAIL, - /**< Insufficient worker thread error. */ - NSS_WIFILI_EMSG_INVALID_NUM_TCL_RING_FAIL, - /**< Invalid number of Transmit Classifier rings provided in initialization message. */ - NSS_WIFILI_EMSG_INVALID_NUM_REO_DST_RING_FAIL, - /**< Invalid number of Rx reorder destination ring in initialization message. */ - NSS_WIFILI_EMSG_HAL_SRNG_SOC_ALLOC_FAIL, - /**< Srng SoC memory allocation failure. */ - NSS_WIFILI_EMSG_HAL_SRNG_INVALID_RING_INFO_FAIL, - /**< Device ring information is invalid. */ - NSS_WIFILI_EMSG_HAL_SRNG_TCL_ALLOC_FAIL, - /**< Transmit Classifier srng ring allocation failure. */ - NSS_WIFILI_EMSG_HAL_SRNG_TXCOMP_ALLOC_FAIL, - /**< Txcomp srng ring allocation failure. */ - NSS_WIFILI_EMSG_HAL_SRNG_REODST_ALLOC_FAIL, - /**< Rx reorder destination srng ring allocation failure. */ - NSS_WIFILI_EMSG_HAL_SRNG_REOREINJECT_ALLOC_FAIL, - /**< Rx reorder reinject srng ring allocation failure. */ - NSS_WIFILI_EMSG_HAL_SRNG_RXRELEASE_ALLOC_FAIL, - /**< Rx release srng ring allocation failure. */ - NSS_WIFILI_EMSG_HAL_SRNG_RXEXCP_ALLOC_FAIL, - /**< Rx exception srng ring allocation failure. */ - NSS_WIFILI_EMSG_HAL_TX_MEMALLOC_FAIL, - /**< Tx HAL (hardware abstraction layer) srng ring allocation failure. */ - NSS_WIFILI_EMSG_HAL_TX_INVLID_POOL_NUM_FAIL, - /**< Invalid pool number in initialization message. */ - NSS_WIFILI_EMSG_HAL_TX_INVALID_PAGE_NUM_FAIL, - /**< Invalid page numner in initialization message. */ - NSS_WIFILI_EMSG_HAL_TX_DESC_MEM_ALLOC_FAIL, - /**< Tx descriptor memory allocation failure. */ - NSS_WIFILI_EMSG_HAL_RX_MEMALLOC_FAIL, - /**< Rx memory allocation failure. */ - NSS_WIFILI_EMSG_PDEV_RXDMA_RING_ALLOC_FAIL, - /**< Rx DMA ring allocation failed. */ - NSS_WIFILI_EMSG_NAWDSEN_PEERID_INVALID, - /**< Peer NAWDS enable failure due to invalid peer ID. */ - NSS_WIFILI_EMSG_NAWDSEN_PEER_NULL, - /**< Peer NAWDS enable failure due to peer being NULL. */ - NSS_WIFILI_EMSG_NAWDSEN_PEER_CORRUPTED, - /**< Peer NAWDS enable failure due to corrupted peer. */ - NSS_WIFILI_EMSG_WDS_PEER_CFG_FAIL, - /**< WDS peer configuration failure. */ - NSS_WIFILI_EMSG_RESET_NO_STOP, - /**< Reset issued without stopping the device. */ - NSS_WIFILI_EMSG_HAL_SRNG_INVALID_RING_BASE_FAIL, - /**< Ring base address is invalid. */ - NSS_WIFILI_EMSG_PDEV_RX_INIT_FAIL, - /**< Pdev Rx initialization failure. */ - NSS_WIFILI_EMESG_AST_ADD_FAIL, - /**< AST entry addition failure for connected peer. */ - NSS_WIFILI_EMESG_AST_REMOVE_FAIL, - /**< AST entry removal failure for connected peer. */ - NSS_WIFILI_EMESG_WDS_ADD_FAIL, - /**< WDS peer AST entry addition failure. */ - NSS_WIFILI_EMESG_WDS_REMOVE_FAIL, - /**< WDS peer AST entry removal failure. */ - NSS_WIFILI_EMESG_WDS_MAP_FAIL, - /**< WDS peer AST entry hardware index mapping failure. */ - NSS_WIFILI_EMSG_WDS_INVALID_PEERID_FAIL, - /**< Invalid peer id passed in WDS messages. */ - NSS_WIFILI_EMSG_WDS_DUPLICATE_AST_INDEX_PEER_ID_FAIL, - /**< AST entry index is already filled. */ - NSS_WIFILI_EMSG_INVALID_RADIO_CMD, - /**< Radio command is invalid. */ - NSS_WIFILI_EMSG_INVALID_RADIO_IFNUM, - /**< Radio interface number is invalid. */ - NSS_WIFILI_EMSG_PEER_SECURITY_PEER_NULL_FAIL, - /**< Security message failed as peer is NULL for a peer ID. */ - NSS_WIFILI_EMSG_PEER_SECURITY_PEER_CORRUPTED_FAIL, - /**< Security message failed as peer is corrupted. */ - NSS_WIFILI_EMSG_RADIO_INVALID_BUF_CFG, - /**< Buffer configuration message failed as invalid range value is provided. */ - NSS_WIFILI_EMSG_INIT_FAIL_INVALID_TARGET, - /**< Invalid target SoC type from host. */ - NSS_WIFILI_EMSG_PDEV_INIT_FAIL_INVALID_LMAC_ID, - /**< Invalid lower MAC ID from host. */ - NSS_WIFILI_EMSG_STATE_PDEV_NOT_INITIALIZED, - /**< Configured message issued when radio is not initialized. */ - NSS_WIFILI_EMESG_RX_TLV_INVALID, - /**< Invalid TLV length. */ - NSS_WIFILI_EMESG_RX_BUF_LEN_INVALID, - /**< Invalid Rx buffer length. */ - NSS_WIFILI_EMSG_UNKNOWN - /**< Unknown error message. */ -}; - -/** - * nss_wifili_soc_extended_data_types - * Enumeration of extended data type to host. - */ -enum nss_wifili_soc_extended_data_types { - NSS_WIFILI_SOC_EXT_DATA_PKT_TYPE_NONE, /**< Packet type is none. */ - NSS_WIFILI_SOC_EXT_DATA_PKT_MSDU_LINK_DESC, /**< Packet type is MSDU link descriptor. */ - NSS_WIFILI_SOC_EXT_DATA_PKT_INVALID_PEER, /**< Packet type is invalid peer. */ - NSS_WIFILI_SOC_EXT_DATA_PKT_MIC_ERROR, /**< Packet received with MIC error. */ - NSS_WIFILI_SOC_EXT_DATA_PKT_2K_JUMP_ERROR, /**< Packet received with 2K jump in sequence number. */ - NSS_WIFILI_SOC_EXT_DATA_PKT_WIFI_PARSE_ERROR, /**< Packet received with Wi-Fi parse error. */ - NSS_WIFILI_SOC_EXT_DATA_PKT_TYPE_MAX /**< Maximum extended data types. */ -}; - -/** - * nss_wifili_radio_cmd - * Wi-Fi radio commands for wifili. - */ -enum nss_wifili_radio_cmd { - NSS_WIFILI_RADIO_TX_CAPTURE_CMD, /**< Enable Tx capture. */ - NSS_WIFILI_SET_PRIMARY_RADIO, /**< Set current radio as primary. */ - NSS_WIFILI_SET_ALWAYS_PRIMARY, /**< Set always primary flag. */ - NSS_WIFILI_SET_FORCE_CLIENT_MCAST_TRAFFIC, /**< Flag to force multicast traffic for a radio. */ - NSS_WIFILI_SET_DROP_SECONDARY_MCAST, /**< Flag to drop multicast traffic on secondary radio. */ - NSS_WIFILI_SET_DBDC_FASTLANE, /**< Flag to set DBDC fast-lane mode. */ - NSS_WIFILI_SET_DBDC_NOBACKHAUL_RADIO, /**< Flag to set DBDC to no backhaul radio. */ - NSS_WIFILI_RADIO_MAX_CMD /**< Maximum radio command index. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_txrx and corresponding - * statistics string array in nss_stats.c. - */ - -/** - * nss_wifili_stats_txrx - * Wifili Tx or Rx statistics. - */ -enum nss_wifili_stats_txrx { - NSS_WIFILI_STATS_RX_MSDU_ERROR, - /**< Number of Rx packets received from ring with MSDU error. */ - NSS_WIFILI_STATS_RX_INV_PEER_RCV, - /**< Number of Rx packets with invalid peer ID. */ - NSS_WIFILI_STATS_RX_WDS_SRCPORT_EXCEPTION, - /**< Number of Rx packets exceptioned to host because of source port learn fail. */ - NSS_WIFILI_STATS_RX_WDS_SRCPORT_EXCEPTION_FAIL, - /**< Number of Rx source port learn fail packets failed to get enqueued to host. */ - NSS_WIFILI_STATS_RX_DELIVERD, - /**< Number of packets wifili has given to next node. */ - NSS_WIFILI_STATS_RX_DELIVER_DROPPED, - /**< Number of packets which wifili failed to enqueue to next node. */ - NSS_WIFILI_STATS_RX_INTRA_BSS_UCAST, - /**< Number of packets that wifili sent for intra-BSS unicast packet. */ - NSS_WIFILI_STATS_RX_INTRA_BSS_UCAST_FAIL, - /**< Number of packets that wifili sent for intra-BSS unicast packet failed. */ - NSS_WIFILI_STATS_RX_INTRA_BSS_MCAST, - /**< Number of packets that wifili sent for intra-BSS multicast packet. */ - NSS_WIFILI_STATS_RX_INTRA_BSS_MCAST_FAIL, - /**< Number of packets that wifili sent for intra-BSS multicast packet failed. */ - NSS_WIFILI_STATS_RX_SG_RCV_SEND, - /**< Number of packets scatter-gather sent. */ - NSS_WIFILI_STATS_RX_SG_RCV_FAIL, - /**< Number of packets scatter-gather received failure. */ - NSS_STATS_WIFILI_RX_MCAST_ECHO, - /**< Number of multicast echo packets received. */ - NSS_STATS_WIFILI_RX_INV_TID, - /**< Number of invalid TID. */ - - /* - * TODO: Move per TID based - */ - NSS_WIFILI_STATS_RX_FRAG_INV_SC, - /**< Number of fragments with invalid sequence control. */ - NSS_WIFILI_STATS_RX_FRAG_INV_FC, - /**< Number of fragments with invalid frame control. */ - NSS_WIFILI_STATS_RX_FRAG_NON_FRAG, - /**< Number of non-fragments received in fragments. */ - NSS_WIFILI_STATS_RX_FRAG_RETRY, - /**< Number of retries for fragments. */ - NSS_WIFILI_STATS_RX_FRAG_OOO, - /**< Number of out-of-order fragments. */ - NSS_WIFILI_STATS_RX_FRAG_OOO_SEQ, - /**< Number of out-of-order sequence. */ - NSS_WIFILI_STATS_RX_FRAG_ALL_FRAG_RCV, - /**< Number of times all fragments for a sequence has been received. */ - NSS_WIFILI_STATS_RX_FRAG_DELIVER, - /**< Number of fragments delivered to host. */ - NSS_WIFILI_STATS_TX_ENQUEUE, - /**< Number of packets that got enqueued to wifili. */ - NSS_WIFILI_STATS_TX_ENQUEUE_DROP, - /**< Number of packets that dropped during enqueue to wifili. */ - NSS_WIFILI_STATS_TX_DEQUEUE, - /**< Number of packets that are dequeued by wifili. */ - NSS_WIFILI_STATS_TX_HW_ENQUEUE_FAIL, - /**< Number of Rx packets that NSS Wi-Fi offload path could successfully process. */ - NSS_WIFILI_STATS_TX_SENT_COUNT, - /**< Number of Tx packets sent to hardware. */ - NSS_WIFILI_STATS_TXRX_MAX, - /**< Number of maximum Tx or Rx statistics. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_tcl and corresponding - * statistics string array in nss_stats.c. - */ - -/** - * nss_wifili_stats_tcl - * Wifili transmit classifier statistics. - */ -enum nss_wifili_stats_tcl { - NSS_WIFILI_STATS_TCL_NO_HW_DESC, /**< Number of transmit classifier hardware descriptor. */ - NSS_WIFILI_STATS_TCL_RING_FULL, /**< Number of times transmit classifier ring was full. */ - NSS_WIFILI_STATS_TCL_RING_SENT, /**< Number of times transmit classifier descriptor sent. */ - NSS_WIFILI_STATS_TCL_MAX, /**< Number of maximum transmit classifier statistics. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_tx_comp and corresponding - * statistics string array in nss_stats.c. - */ - -/** - * nss_wifili_stats_tx_comp - * Wifili Tx completion statistics. - */ -enum nss_wifili_stats_tx_comp { - NSS_WIFILI_STATS_TX_DESC_FREE_INV_BUFSRC, /**< Number of invalid buffer source packets. */ - NSS_WIFILI_STATS_TX_DESC_FREE_INV_COOKIE, /**< Number of invalid cookie packets. */ - NSS_WIFILI_STATS_TX_DESC_FREE_HW_RING_EMPTY, /**< Number of times hardware ring empty found. */ - NSS_WIFILI_STATS_TX_DESC_FREE_REAPED, /**< Number of Tx packets that are reaped out of the Tx completion ring. */ - NSS_WIFILI_STATS_TX_DESC_FREE_MAX, /**< Number of Tx completion statistics. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_reo and corresponding - * statistics string array in nss_stats.c. - */ - -/** - * nss_wifili_stats_reo - * Wifili Rx reorder statistics. - */ -enum nss_wifili_stats_reo { - NSS_WIFILI_STATS_REO_ERROR, /**< Number of reorder error. */ - NSS_WIFILI_STATS_REO_REAPED, /**< Number of reorder reaped. */ - NSS_WIFILI_STATS_REO_INV_COOKIE, /**< Number of invalid cookie. */ - NSS_WIFILI_STATS_REO_FRAG_RCV, /**< Number of fragmented packets received. */ - NSS_WIFILI_STATS_REO_MAX, /**< Number of reorder statistics. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_txsw_pool and corresponding - * statistics string array in nss_stats.c. - */ - -/** - * nss_wifili_stats_txsw_pool - * Wifili Tx descriptor statistics. - */ -enum nss_wifili_stats_txsw_pool { - NSS_WIFILI_STATS_TX_DESC_IN_USE, /**< Number of Tx packets that are currently in flight. */ - NSS_WIFILI_STATS_TX_DESC_ALLOC_FAIL, /**< Number of Tx software descriptor allocation failures. */ - NSS_WIFILI_STATS_TX_DESC_ALREADY_ALLOCATED, /**< Number of Tx software descriptor already allocated. */ - NSS_WIFILI_STATS_TX_DESC_INVALID_FREE, /**< Number of Tx software descriptor invalid free. */ - NSS_WIFILI_STATS_TX_DESC_FREE_SRC_FW, /**< Number of Tx descriptor for which release source is firmware. */ - NSS_WIFILI_STATS_TX_DESC_FREE_COMPLETION, /**< Number of Tx descriptor completion. */ - NSS_WIFILI_STATS_TX_DESC_NO_PB, /**< Number of Tx descriptor pbuf is NULL. */ - NSS_WIFILI_STATS_TX_QUEUELIMIT_DROP, /**< Number of Tx dropped because of queue limit. */ - NSS_WIFILI_STATS_TX_DESC_MAX, /**< Number of Tx descriptor statistics. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_ext_txsw_pool and corresponding - * statistics string array in nss_stats.c - */ - -/** - * nss_wifili_stats_ext_txsw_pool - * Wifili Rx extended descriptor statistics. - */ -enum nss_wifili_stats_ext_txsw_pool { - NSS_WIFILI_STATS_EXT_TX_DESC_IN_USE, /**< Number of extended Tx packets that are currently in flight. */ - NSS_WIFILI_STATS_EXT_TX_DESC_ALLOC_FAIL, /**< Number of extended Tx software descriptor allocation failures. */ - NSS_WIFILI_STATS_EXT_TX_DESC_ALREADY_ALLOCATED, /**< Number of extended Tx software descriptor already allocated. */ - NSS_WIFILI_STATS_EXT_TX_DESC_INVALID_FREE, /**< Number of extended Tx software descriptor invalid free. */ - NSS_WIFILI_STATS_EXT_TX_DESC_MAX, /**< Number of extended Tx descriptor statistics. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_rxdma_pool and corresponding - * statistics string array in nss_stats.c - */ - -/** - * nss_wifili_stats_rxdma_pool - * Wifili Rx descriptor statistics. - */ -enum nss_wifili_stats_rxdma_pool { - NSS_WIFILI_STATS_RX_DESC_NO_PB, /**< Number of Rx descriptors that have no pbufs. */ - NSS_WIFILI_STATS_RX_DESC_ALLOC_FAIL, /**< Number of Rx descriptor allocation failures. */ - NSS_WIFILI_STATS_RX_DESC_IN_USE, /**< Number of Rx descriptor allocations in use. */ - NSS_WIFILI_STATS_RX_DESC_MAX, /**< Maximum number of Rx descriptor statistics. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_rxdma_ring and corresponding - * statistics string array in nss_stats.c. - */ - -/** - * nss_wifili_stats_rxdma_ring - * Wifili Rx DMA(Direct Memory Access) ring statistics. - */ -enum nss_wifili_stats_rxdma_ring { - NSS_WIFILI_STATS_RXDMA_DESC_UNAVAILABLE, /**< Number of Rx DMA descriptor unavailable. */ - NSS_WIFILI_STATS_RXDMA_BUF_REPLENISHED, /**< Number of Rx DMA buffer replenished. */ - NSS_WIFILI_STATS_RXDMA_DESC_MAX, /**< Number of Rx DMA descriptor statistics. */ -}; - -/* - * WARNING: There is a 1:1 mapping between values of enum nss_wifili_stats_wbm and corresponding - * statistics string array in nss_stats.c. - */ - -/** - * nss_wifili_stats_wbm - * Wifili WBM(Wireless Buffer Manager) ring statistics. - */ -enum nss_wifili_stats_wbm { - NSS_WIFILI_STATS_WBM_IE_LOCAL_ALLOC_FAIL, /**< Number of Wireless Buffer Manager internal local allocation failures. */ - NSS_WIFILI_STATS_WBM_SRC_DMA, /**< Number of receive invalid source DMA. */ - NSS_WIFILI_STATS_WBM_SRC_DMA_CODE_INV, /**< Number of receive invalid source DMA. */ - NSS_WIFILI_STATS_WBM_SRC_REO, /**< Number of receive invalid source reorder. */ - NSS_WIFILI_STATS_WBM_SRC_REO_CODE_NULLQ, /**< Number of receive invalid reorder error with NULL queue. */ - NSS_WIFILI_STATS_WBM_SRC_REO_CODE_INV, /**< Number of receive invalid reorder code invalid. */ - NSS_WIFILI_STATS_WBM_SRC_INV, /**< Number of receive invalid source invalid. */ - NSS_WIFILI_STATS_WBM_MAX, /**< Number of receive Wireless Buffer Manager statistics. */ -}; - -/** - * nss_wifili_stats - * NSS wifili statistics. - */ -struct nss_wifili_stats { - uint64_t stats_txrx[NSS_WIFILI_MAX_PDEV_NUM_MSG][NSS_WIFILI_STATS_TXRX_MAX]; - /**< Number of Tx or Rx statistics. */ - uint64_t stats_tcl_ring[NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG][NSS_WIFILI_STATS_TCL_MAX]; - /**< TCL statistics for each ring. */ - uint64_t stats_tx_comp[NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG][NSS_WIFILI_STATS_TX_DESC_FREE_MAX]; - /**< Tx completion ring statistics. */ - uint64_t stats_tx_desc[NSS_WIFILI_MAX_TXDESC_POOLS_MSG][NSS_WIFILI_STATS_TX_DESC_MAX]; - /**< Tx descriptor pool statistics. */ - uint64_t stats_ext_tx_desc[NSS_WIFILI_MAX_TX_EXT_DESC_POOLS_MSG][NSS_WIFILI_STATS_EXT_TX_DESC_MAX]; - /**< Tx extended descriptor pool statistics. */ - uint64_t stats_reo[NSS_WIFILI_MAX_REO_DATA_RINGS_MSG][NSS_WIFILI_STATS_REO_MAX]; - /**< Rx reorder ring statistics. */ - uint64_t stats_rx_desc[NSS_WIFILI_MAX_PDEV_NUM_MSG][NSS_WIFILI_STATS_RX_DESC_MAX]; - /**< Rx software pool statistics. */ - uint64_t stats_rxdma[NSS_WIFILI_MAX_PDEV_NUM_MSG][NSS_WIFILI_STATS_RXDMA_DESC_MAX]; - /**< Rx DMA ring statistics. */ - uint64_t stats_wbm[NSS_WIFILI_STATS_WBM_MAX]; - /**< Wireless Buffer Manager error ring statistics. */ -}; - -/* - * NSS wifili soc stats - */ -struct nss_wifili_soc_stats { - uint32_t soc_maxpdev; /**< Maximum number of radios per SoC. */ - struct nss_wifili_stats stats_wifili; - /**< Per-SoC statistics. */ -}; - -/** - * nss_wifili_stats_notification - * Data for sending wifili statistics. - */ -struct nss_wifili_stats_notification { - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number for this wifili. */ - struct nss_wifili_stats stats; /**< Wifili statistics. */ -}; - -#ifdef __KERNEL__ /* only kernel will use. */ - -/** - * nss_wifili_hal_srng_info - * Wifili HAL srng information. - */ -struct nss_wifili_hal_srng_info{ - uint8_t ring_id; - /**< Ring ID. */ - uint8_t mac_id; - /**< Pdev ID. */ - uint8_t resv[2]; - uint32_t ring_base_paddr; - /**< Physical base address of the ring. */ - uint32_t num_entries; - /**< Number of entries in ring. */ - uint32_t flags; /**< Miscellaneous flags. */ - uint32_t ring_dir; - /**< Ring direction: source or destination. */ - uint32_t entry_size; - /**< Ring entry size. */ - uint32_t low_threshold; - /**< Low threshold – in number of ring entries (valid for source rings only). */ - uint32_t hwreg_base[NSS_WIFILI_MAX_SRNG_REG_GROUPS_MSG]; - /**< Hardware ring base address. */ -}; - -/** - * nss_wifili_hal_srng_soc_msg - * Wifili hal srng message. - */ -struct nss_wifili_hal_srng_soc_msg { - uint32_t dev_base_addr; - /**< Base address of WLAN device. */ - uint32_t shadow_rdptr_mem_addr; - /**< Shadow read pointer address. */ - uint32_t shadow_wrptr_mem_addr; - /**< Shadow write pointer address. */ - uint32_t lmac_rings_start_id; - /**< start id of LMAC rings. */ -}; - -/** - * struct wifili_tx_desc_addtnl_mem_msg - * Wifili additional host memory message for increeased descriptors - */ -struct nss_wifili_tx_desc_addtnl_mem_msg { - uint32_t num_addtnl_addr; - /**< Number of additional memory pages provided. */ - uint32_t addtnl_memory_addr[NSS_WIFILI_MAX_NUMBER_OF_ADDTNL_SEG]; - /**< Physical memory addresse of each additional page. */ - uint32_t addtnl_memory_size[NSS_WIFILI_MAX_NUMBER_OF_ADDTNL_SEG]; - /**< Size of each additional page. */ -}; - -/** - * nss_wifili_tx_desc_init_msg - * Wifili software descriptor pool initialization message. - */ -struct nss_wifili_tx_desc_init_msg { - uint32_t num_tx_desc; - /**< Count of the software descriptors. */ - uint32_t num_tx_desc_ext; - /**< Count of software extented descriptors. */ - uint32_t num_pool; - /**< Number of descriptor pools. */ - uint32_t memory_addr[NSS_WIFILI_MAX_NUMBER_OF_PAGE_MSG]; - /**< Memory start address of each page. */ - uint32_t memory_size[NSS_WIFILI_MAX_NUMBER_OF_PAGE_MSG]; - /**< Memory size. */ - uint32_t num_memaddr; - /**< Number of memory address. */ - uint32_t ext_desc_page_num; - /**< Extended descriptor page number. */ - uint32_t num_tx_desc_2; - /**< Count of the software descriptors for second radio. */ - uint32_t num_tx_desc_ext_2; - /**< Count of software extended descriptors for second radio. */ - uint32_t num_tx_desc_3; - /**< Count of the software descriptors for third radio. */ - uint32_t num_tx_desc_ext_3; - /**< Count of software extended descriptors for third radio. */ - uint32_t num_tx_device_limit; - /**< Count of software Tx descriptors for the device. */ -}; - -/** - * nss_wifili_rx_init_param - * Rx initialization parameters. - */ -struct nss_wifili_rx_init_param { - uint16_t tlv_size; /**< Size of Rx TLV structure. */ - uint16_t rx_buf_len; /**< Rx buffer length programmed to hardware. */ -}; - -/** - * nss_wifili_init_msg - * Wifili SoC initialization message. - */ -struct nss_wifili_init_msg { - struct nss_wifili_hal_srng_soc_msg hssm; - uint8_t num_tcl_data_rings; - /**< Number of Transmit Classifier data rings. */ - uint8_t num_reo_dest_rings; - /**< Number of Rx reorder rings. */ - uint8_t flags; - /**< Flags for SoC initialization */ - uint8_t soc_mem_profile; - /**< SoC memory profile (256M/512M/1G). */ - struct nss_wifili_hal_srng_info tcl_ring_info[NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG]; - /**< Transmit Classifier data ring configuration information. */ - struct nss_wifili_hal_srng_info tx_comp_ring[NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG]; - /**< Tx completion ring configuration information. */ - struct nss_wifili_hal_srng_info reo_dest_ring[NSS_WIFILI_MAX_REO_DATA_RINGS_MSG]; - /**< Rx reorder destination ring configuration information. */ - struct nss_wifili_hal_srng_info reo_exception_ring; - /**< Rx reorder exception ring configuration information. */ - struct nss_wifili_hal_srng_info rx_rel_ring; - /**< Wireless Buffer Manager release ring configuration information. */ - struct nss_wifili_hal_srng_info reo_reinject_ring; - /**< Reinject ring configuration information. */ - struct nss_wifili_tx_desc_init_msg wtdim; - /**< Tx descriptor initialization message. */ - uint32_t target_type; - /**< Target type based on SoC. */ - struct nss_wifili_rx_init_param wrip; - /**< Rx parameters to initialize Rx context. */ - struct nss_wifili_tx_desc_addtnl_mem_msg wtdam; - /**< Tx descriptor additional memory message. */ - uint32_t tx_sw_internode_queue_size; - /**< Tx software internode queue size. */ -}; - -/** - * nss_wifili_pdev_deinit_msg - * Wifili pdev deinit message. - */ -struct nss_wifili_pdev_deinit_msg { - uint32_t ifnum; /**< NSS interface number of pdev. */ -}; - -/** - * nss_wifili_pdev_init_msg - * Wifili pdev initialization message. - */ -struct nss_wifili_pdev_init_msg { - struct nss_wifili_hal_srng_info rxdma_ring; - /**< MAC (Media Access Control) ring configuration. */ - uint32_t radio_id; - /**< MAC radio ID. */ - uint32_t hwmode; - /**< MAC hardware mode. */ - uint32_t lmac_id; - /**< Lower MAC ID. */ - uint32_t num_rx_swdesc; - /**< Number of descriptors per Rx pool. */ - uint32_t target_pdev_id; - /**< Target physical device ID. */ - uint8_t scheme_id; - /**< Radio scheme ID. */ - uint8_t reserved[3]; - /**< Padding for alignment. */ -}; - -/** - * nss_wifili_peer_ast_flowid_map_msg - * Wifili peer AST flow ID map message. - */ -struct nss_wifili_peer_ast_flowid_map_msg { - uint8_t peer_mac_addr[ETH_ALEN]; - /**< Peer MAC address. */ - uint16_t vdev_id; - /**< VAP ID. */ - uint16_t ast_idx[NSS_WIFILI_PEER_AST_FLOWQ_MAX]; - /**< Address search table index. */ - uint8_t tid_valid_mask[NSS_WIFILI_PEER_AST_FLOWQ_MAX]; - /**< TID valid mask for a flow. */ - uint8_t is_valid[NSS_WIFILI_PEER_AST_FLOWQ_MAX]; - /**< Valid bit. */ - uint8_t flowQ[NSS_WIFILI_PEER_AST_FLOWQ_MAX]; - /**< Flow queue. */ - uint16_t peer_id; - /**< Peer ID. */ - uint8_t reserved[2]; - /**< Padding for alignment. */ -}; - -/** - * nss_wifili_peer_ast - * Wifili peer creation message. - */ -struct nss_wifili_peer_msg { - uint8_t peer_mac_addr[6]; - /**< Peer MAC address. */ - uint16_t vdev_id; - /**< VAP ID. */ - uint16_t peer_id; - /**< Peer ID. */ - uint16_t hw_ast_idx; - /**< Hardware address search table index. */ - uint8_t is_nawds; - /**< NAWDS enabled for peer. */ - uint8_t pext_stats_valid; - /**< Peer extended statistics valid. */ - uint16_t psta_vdev_id; - /**< Proxy station VAP ID. */ - uint32_t nss_peer_mem; - /**< Holds peer memory adderss for NSS. */ - uint32_t tx_ast_hash; - /**< AST hash to be used during packet transmission. */ - uint32_t pext_stats_mem; - /**< Peer extended statistics memory. */ - uint32_t flags; - /**< Peer flags. */ -}; - -/** - * nss_wifili_peer_freelist_append_msg - * Peer memory request. - */ -struct nss_wifili_peer_freelist_append_msg { - uint32_t addr; - /**< Starting address of peer_freelist pool. */ - uint32_t length; - /**< Length of peer freelist pool. */ - uint32_t num_peers; - /**< Maximum number of peer entries supported in pool. */ -}; - -/** - * nss_wifili_wds_extn_peer_cfg_msg - * Configuration information when the WDS vendor extension is enabled. - */ -struct nss_wifili_wds_extn_peer_cfg_msg { - uint8_t peer_mac_addr[ETH_ALEN]; /**< Peer MAC address. */ - uint8_t wds_flags; /**< WDS flags populated from the host. */ - uint8_t reserved; /**< Alignment padding. */ - uint16_t peer_id; /**< Peer ID. */ -}; - -/** - * nss_wifili_tx_stats - * Tx statistics. - */ -struct nss_wifili_tx_stats { - uint32_t tx_enqueue_dropped; - /**< Tx enqueue drop count. */ - uint32_t tx_enqueue_cnt; - /**< Tx enqueue succesful count. */ - uint32_t tx_dequeue_cnt; - /**< Tx dequeue count. */ - uint32_t tx_send_fail_cnt; - /**< Hardware send failure count. */ - uint32_t inv_peer; - /**< Invalid peer enqueue count. */ - uint32_t inv_peer_drop_byte_cnt; - /**< Invalid peer drop byte count. */ - uint32_t tx_input_pkt; - /**< Tx packets ready to sent. */ - uint32_t tx_processed_pkt; - /**< Tx numner of packets sent. */ - uint32_t tx_processed_bytes; - /**< Tx number of bytes processed. */ -}; - -/** - * nss_wifili_rx_stats - * Rx statistics. - */ -struct nss_wifili_rx_stats { - uint32_t rx_msdu_err; - /**< Rx msdu error count. */ - uint32_t rx_inv_peer; - /**< Rx invalid peer count. */ - uint32_t rx_scatter_inv_peer; - /**< Rx scatter invalid peer count. */ - uint32_t rx_wds_learn_send; - /**< WDS source port learn packet. */ - uint32_t rx_wds_learn_send_fail; - /**< WDS source port learn exception send failure count. */ - uint32_t rx_send_dropped; - /**< Rx send dropped count. */ - uint32_t rx_deliver_cnt; - /**< Rx deliver count to next node. */ - uint32_t rx_deliver_cnt_fail; - /**< Rx deliver count failure. */ - uint32_t rx_intra_bss_ucast_send; - /**< Intra-BSS unicast sent count. */ - uint32_t rx_intra_bss_ucast_send_fail; - /**< Intra-BSS unicast send failure count. */ - uint32_t rx_intra_bss_mcast_send; - /**< Intra-BSS multicast send count. */ - uint32_t rx_intra_bss_mcast_send_fail; - /**< Intra-BSS multicast send failure count. */ - uint32_t rx_sg_recv_send; - /**< Rx scatter-gather receive send count. */ - uint32_t rx_sg_recv_fail; - /**< Rx scatter-gather receive failure count. */ - uint32_t rx_me_pkts; /**< Rx multicast echo packets count. */ - uint32_t rx_inv_tid; /**< Rx invalid TID. */ - - /* - * TODO: Move per tid based. - */ - uint32_t rx_frag_inv_sc; /**< Rx invalid frame sequence control. */ - uint32_t rx_frag_inv_fc; /**< Rx invalid frame control count. */ - uint32_t rx_non_frag_err; /**< Rx non-fragment received in fragmention. */ - uint32_t rx_repeat_fragno; /**< Rx fragment retry counters. */ - uint32_t rx_ooo_frag; /**< Rx out-of-order fragments count. */ - uint32_t rx_ooo_frag_seq; /**< Rx out-of-order sequence count. */ - uint32_t rx_all_frag_rcv; /**< Rx all fragments received count. */ - uint32_t rx_frag_deliver; /**< Rx fragment deliver counters. */ -}; - -/** - * nss_wifili_tx_tcl_ring_stats - * Transmit Classifier ring specific statistics. - */ -struct nss_wifili_tx_tcl_ring_stats { - uint32_t tcl_no_hw_desc; /**< Number of Transmit Classifier hardware descriptors. */ - uint32_t tcl_ring_full; /**< Number of times Transmit Classifier ring full. */ - uint32_t tcl_ring_sent; /**< Total number of ring sent. */ -}; - -/** - * nss_wifili_tx_comp_ring_stats - * Tx completion ring statistics. - */ -struct nss_wifili_tx_comp_ring_stats { - uint32_t invalid_bufsrc; /**< Tx comp (Completion) ring descriptor invalid buffer source. */ - uint32_t invalid_cookie; /**< Tx comletion ring descriptor has invalid cookies. */ - uint32_t hw_ring_empty; /**< Tx completion hardware ring empty. */ - uint32_t ring_reaped; /**< Tx completion successfull ring reaped. */ -}; - -/** - * nss_wifili_tx_sw_pool_stats - * Tx completion sw statistics. - */ -struct nss_wifili_tx_sw_pool_stats { - uint32_t desc_alloc; /**< Tx descriptor software pool descriptor in use. */ - uint32_t desc_alloc_fail; /**< Tx descriptor software pool allocation failure . */ - uint32_t desc_already_allocated; /**< Tx descriptor re-allocation for allocated descriptor. */ - uint32_t desc_invalid_free; /**< Tx descriptor freeing of allocated descriptor. */ - uint32_t tx_rel_src_fw; /**< Tx descriptor source is firmware. */ - uint32_t tx_rel_ext_desc; /**< Tx descriptor scatter-gather. */ - uint32_t tx_rel_tx_desc; /**< Tx descriptor source is hardware*/ - uint32_t tx_rel_no_pb; /**< Tx descriptor has pbuf present. */ - uint32_t tx_queue_limit_drop; /**< Tx number of packets dropped because of queueing limits. */ -}; - -/** - * wifili_tx_ext_sw_pool_stats - * Tx extended descriptor pool. - */ -struct nss_wifili_tx_ext_sw_pool_stats { - uint32_t desc_alloc; /**< Tx extend (scatter gather) descriptor in use. */ - uint32_t desc_alloc_fail; /**< Tx extend descriptor allocation failure. */ - uint32_t desc_already_allocated; /**< Tx extend descriptor already allocated. */ - uint32_t desc_invalid_free; /**< Tx descriptor invalid source. */ - -}; - -/** - * nss_wifili_rx_wbm_ring_stats - * WBM (Wireless Buffer Manager) release ring statistics. - */ -struct nss_wifili_rx_wbm_ring_stats { - uint32_t invalid_buf_mgr; /**< Invalid buffer manager. */ - uint32_t err_src_rxdma; /**< Wireless Buffer Manager source is Rx DMA ring. */ - uint32_t err_src_rxdma_code_inv; /**< Wireless Buffer Manager source DMA reason unknown. */ - uint32_t err_src_reo; /**< Wireless Buffer Manager source is receive reorder ring. */ - uint32_t err_src_reo_code_nullq; /**< Wireless Buffer Manager source receive reorder ring because of NULL TLV. */ - uint32_t err_src_reo_code_inv; /**< Wireless Buffer Manager source receive reorder ring reason unknown. */ - uint32_t err_src_invalid; /**< Wireless Buffer Manager source is unknown. */ - uint32_t err_reo_codes[NSS_WIFILI_REO_CODE_MAX]; - /**< Receive reoder error codes. */ - uint32_t err_dma_codes[NSS_WIFILI_DMA_CODE_MAX]; - /**< DMA error codes. */ - uint32_t err_internal_codes[NSS_WIFILI_WBM_INTERNAL_ERR_MAX]; - /**< Wireless Buffer Manager error codes. */ -}; - -/** - * nss_wifili_rx_reo_ring_stats - * Rx reorder error statistics. - */ -struct nss_wifili_rx_reo_ring_stats { - uint32_t ring_error; /**< Rx reorder ring error. */ - uint32_t ring_reaped; /**< Number of ring descriptor reaped. */ - uint32_t invalid_cookie; /**< Number of invalid cookie. */ - uint32_t defrag_reaped; /**< Rx defragment receive count. */ -}; - -/** - * nss_wifili_rx sw_pool_stats - * Wifili DMA sw pool statistics. - */ -struct nss_wifili_rx_sw_pool_stats { - uint32_t rx_no_pb; /**< Rx software descriptor number of buffer available. */ - uint32_t desc_alloc; /**< Number of descriptor in use. */ - uint32_t desc_alloc_fail; /**< Number of descriptor allocation failure. */ -}; - -/** - * nss_wifili_rx_dma_ring_stats - * Wifili Rx DMA ring statistics. - */ -struct nss_wifili_rx_dma_ring_stats { - uint32_t rx_hw_desc_unavailable; /**< Number of times hardware descriptor is unavailable. */ - uint32_t rx_buf_replenished; /**< Number of buffers replenished. */ -}; - -/** - * nss_wifili_dbdc_mode_stats - * Wifili DBDC mode statistics. - */ -struct nss_wifili_dbdc_mode_stats { - uint32_t dbdc_flush_ast_failed; - /**< Number of times DBDC AST flush message send has failed. */ - uint32_t dbdc_drop_rx_secmcast; - /**< Number of packets dropped in DBDC Rx for secondary multicast. */ - uint32_t dbdc_drop_tx_secmcast; - /**< Number of packets dropped in DBDC Tx for secondary multicast. */ - uint32_t dbdc_drop_rx_alwaysprimary; - /**< Number of packets dropped in DBDC Rx for always primary. */ - uint32_t dbdc_drop_tx_alwaysprimary; - /**< Number of packets dropped in DBDC Tx for always primary. */ - uint32_t dbdc_drop_loop_rx; - /**< Number of packets dropped in DBDC Rx for DBDC loop. */ - uint32_t dbdc_drop_loop_tx; - /**< Number of packets dropped in DBDC Tx for DBDC loop. */ -}; - -/** - * nss_wifili_delay_stats - * Wifili delay statistics. - */ -struct nss_wifili_delay_stats { - uint32_t delay_bucket[NSS_WIFILI_DELAY_INDEX_MAX]; - /**< Delay buckets for histogram. */ - uint32_t min_delay; - /**< Minimum delay. */ - uint32_t avg_delay; - /**< Average delay. */ - uint32_t max_delay; - /**< Maximum delay. */ -}; - -/** - * nss_wifili_v3_delay_per_tid_stats - * Wifili version 3 delay per TID statistics. - */ -struct nss_wifili_v3_delay_per_tid_stats { - struct nss_wifili_delay_stats swq_delay; - /**< Software enqueue delay. */ - struct nss_wifili_delay_stats hwtx_delay; - /**< Hardware transmit delay. */ - struct nss_wifili_delay_stats tx_intfrm_delay; - /**< Transmit interframe delay at radio entry. */ - struct nss_wifili_delay_stats rx_intfrm_delay; - /**< Receive interframe delay. */ -}; - -/** - * nss_wifili_v3_per_tid_tx_rx_stats - * Wifili version 3 Tx and Rx statistics per TID. - */ -struct nss_wifili_v3_tx_rx_per_tid_stats { - uint32_t radio_ingress_enq_drop_cnt; - /**< Ingress enqueue drop count. */ - uint32_t transmit_succes_cnt; - /**< Total successful transmit count. */ - uint32_t transmit_fwdrop_cnt; - /**< Firmware drop count. */ - uint32_t transmit_hwdrop_cnt; - /**< Hardware drop count. */ - uint32_t transmit_desc_fail_cnt; - /**< Transmit descriptor fail count. */ - uint32_t transmit_complete_cnt; - /**< Total transmit count. */ - uint32_t rx_delivered_cnt; - /**< Total Rx packets delivered to next node. */ - uint32_t rx_deliver_fail_cnt; - /**< Rx deliver fail count. */ - uint32_t rx_intrabss_cnt; - /**< Intra-BSS Rx count. */ - uint32_t rx_intrabss_fail_cnt; - /**< Intra-BSS Rx fail count. */ - uint32_t num_msdu_recived; - /**< Number of MSDU received from hardware. */ - uint32_t num_mcast_msdu_recived; - /**< Number of broadcast MSDU received. */ - uint32_t num_bcast_msdu_recived; - /**< Number of multicast MSDU received. */ - uint32_t transmit_tqm_status_cnt[NSS_WIFILI_TQM_STATUS_MAX]; - /**< Number of frames with this TQM completion status. */ - uint32_t transmit_htt_status_cnt[NSS_WIFILI_HTT_STATUS_MAX]; - /**< Number of frames with this HTT completion status. */ -}; - -/** - * nss_wifili_v3_tx_rx_per_ac_stats - * Wifili version 3 Tx and Rx statistics per AC. - */ -struct nss_wifili_v3_tx_rx_per_ac_stats { - uint32_t radio_ingress_enq_cnt; - /**< Ingress enqueue packet count. */ - uint32_t radio_ingress_deq_cnt; - /**< Ingress dequeue count. */ - uint32_t transmit_enq_cnt; - /**< Transmit enqueue count. */ -}; - -/** - * nss_wifili_radio_tx_rx_stats_v3 - * Wifili version 3 radio Tx and Rx statistics. - */ -struct nss_wifili_radio_tx_rx_stats_v3 { - struct nss_wifili_v3_tx_rx_per_tid_stats tid_stats[NSS_WIFILI_MAX_TID]; - /**< Per-TID Tx and Rx statistics. */ - struct nss_wifili_v3_tx_rx_per_ac_stats ac_stats[NSS_WIFILI_WME_AC_MAX]; - /**< Per-Access Category Tx and Rx statistics. */ -}; - -/** - * nss_wifili_radio_delay_stats_v3 - * Wifili version 3 radio delay statistics. - */ -struct nss_wifili_radio_delay_stats_v3 { - struct nss_wifili_v3_delay_per_tid_stats v3_delay_stats[NSS_WIFILI_MAX_TID]; - /**< Per-TID delay statistics. */ -}; - -/** - * nss_wifili_pdev_v3_tx_rx_stats_sync_msg - * Wifili message to synchronize version 3 Tx and Rx statistics to HLOS. - */ -struct nss_wifili_pdev_v3_tx_rx_stats_sync_msg { - uint32_t radio_id; - /**< Radio ID. */ - struct nss_wifili_radio_tx_rx_stats_v3 wlpv3_txrx_stats; - /**< Wifli version 3 Tx and Rx statistics. */ -}; - -/** - * nss_wifili_pdev_v3_delay_stats_sync_msg - * Wifili message to synchronize version 3 delay statistics to HLOS. - */ -struct nss_wifili_pdev_v3_delay_stats_sync_msg { - uint32_t radio_id; - /**< Radio ID. */ - struct nss_wifili_radio_delay_stats_v3 wlpv3_delay_stats; - /**< Wifli version 3 delay statistics. */ -}; - -/** - * nss_wifili_device_stats - * Wifili specific statistics. - */ -struct nss_wifili_device_stats { - struct nss_wifili_tx_tcl_ring_stats tcl_stats[NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG]; - /**< Transmit Classifier ring statistics. */ - struct nss_wifili_tx_comp_ring_stats txcomp_stats[NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG]; - /**< Tx completion ring statistics. */ - struct nss_wifili_tx_sw_pool_stats tx_sw_pool_stats[NSS_WIFILI_MAX_TXDESC_POOLS_MSG]; - /**< Tx software pool statistics. */ - struct nss_wifili_tx_ext_sw_pool_stats tx_ext_sw_pool_stats[NSS_WIFILI_MAX_TX_EXT_DESC_POOLS_MSG]; - /**< Tx extended software pool statistics. */ - struct nss_wifili_tx_stats tx_data_stats[NSS_WIFILI_MAX_PDEV_NUM_MSG]; - /**< Tx data statistics for each pdev. */ - struct nss_wifili_rx_reo_ring_stats rxreo_stats[NSS_WIFILI_MAX_REO_DATA_RINGS_MSG]; - /**< Rx reorder ring statistics. */ - struct nss_wifili_rx_sw_pool_stats rx_sw_pool_stats[NSS_WIFILI_MAX_PDEV_NUM_MSG]; - /**< Rx DMA software pool statistics. */ - struct nss_wifili_rx_stats rx_data_stats[NSS_WIFILI_MAX_PDEV_NUM_MSG]; - /**< Rx data statistics for each pdev. */ - struct nss_wifili_rx_dma_ring_stats rxdma_stats[NSS_WIFILI_MAX_PDEV_NUM_MSG]; - /**< Rx DMA ring statistics. */ - struct nss_wifili_rx_wbm_ring_stats rxwbm_stats; - /**< Wireless Buffer Manager ring statistics. */ - struct nss_wifili_dbdc_mode_stats dbdc_stats; - /**< DBDC mode statistics. */ -}; - -/** - * nss_wifili_stats_sync_msg - * Wifili SoC statistics synchronization message. - */ -struct nss_wifili_stats_sync_msg { - struct nss_wifili_device_stats stats; - /**< Device statistics. */ -}; - -/** - * nss_wifili_soc_linkdesc_per_packet_metadata - * Link descriptor per packet metadata. - */ -struct nss_wifili_soc_linkdesc_per_packet_metadata -{ - uint32_t desc_addr; /**< Link descriptor address. */ -}; - -/** - * nss_wifili_soc_per_packet_metadata - * Per packet special data that has to be sent to host. - */ -struct nss_wifili_soc_per_packet_metadata { - uint16_t pkt_type; /**< Packet type. */ - uint8_t pool_id; /**< Pool ID of invalid peer packets. */ - uint8_t reserved; /**< Alignment padding. */ - - /** - * Link descriptor per packet metadata. - */ - union { - struct nss_wifili_soc_linkdesc_per_packet_metadata linkdesc_metadata; - } metadata; /**< Per packet link descriptor metadata. */ -}; - -/** - * nss_wifili_tx_dropped - * Tx peer dropped packets. - */ -struct nss_wifili_tx_dropped { - uint32_t drop_stats[NSS_WIFILI_TQM_RR_MAX]; /**< Discarded by firmware. */ - uint32_t tx_nawds_mcast_drop_cnt; /**< Total number of NAWDS multicast packets dropped. */ -}; - -/** - * nss_wifili_tx_ctrl_stats - * Tx peer statistics. - */ -struct nss_wifili_tx_ctrl_stats { - uint32_t ofdma; /**< Number of orthogonal frequency-division multiple - access packets. */ - uint32_t non_amsdu_cnt; /**< Number of MSDUs with no MSDU level aggregation. */ - uint32_t amsdu_cnt; /**< Number of MSDUs part of AMSDU. */ - uint32_t tx_mcast_cnt; /**< Total number of multicast packets sent. */ - uint32_t tx_mcast_bytes; /**< Total number of multicast bytes sent. */ - uint32_t tx_ucast_cnt; /**< Total number of unicast packets sent. */ - uint32_t tx_ucast_bytes; /**< Total number of unicast bytes sent. */ - uint32_t tx_bcast_bytes; /**< Total number of broadcast bytes sent. */ - uint32_t tx_bcast_cnt; /**< Total number of broadcast packets sent. */ - struct nss_wifili_tx_dropped dropped; /**< Tx peer dropped. */ - uint32_t tx_success_cnt; /**< Total number of packets sent successfully. */ - uint32_t tx_success_bytes; /**< Total number of bytes sent successfully. */ - uint32_t tx_nawds_mcast_cnt; /**< Total number of NAWDS multicast packets sent. */ - uint32_t tx_nawds_mcast_bytes; /**< Total number of NAWDS multicast bytes sent. */ - uint32_t retries; /**< Total number of retries. */ -}; - -/** - * nss_wifili_peer_rx_err - * Rx peer errors. - */ -struct nss_wifili_rx_err { - uint32_t mic_err; /**< Rx MIC errors. */ - uint32_t decrypt_err; /**< Rx Decryption errors. */ -}; - -/** - * nss_wifili_rx_ctrl_stats - * Peer Rx statistics. - */ -struct nss_wifili_rx_ctrl_stats { - struct nss_wifili_rx_err err; /**< Rx peer errors. */ - uint32_t multipass_rx_pkt_drop; /**< Total number of multipass packets without a VLAN header. */ - uint32_t peer_unauth_rx_pkt_drop; /**< Number of receive packets dropped due to an authorized peer. */ - uint32_t reserved_type[NSS_WIFILI_MAX_RESERVED_TYPE]; /**< Reserved type for future use. */ - uint32_t non_amsdu_cnt; /**< Number of MSDUs with no MSDU level aggregation. */ - uint32_t amsdu_cnt; /**< Number of MSDUs part of AMSDU. */ - uint32_t mcast_rcv_cnt; /**< Total number of multicast packets received. */ - uint32_t mcast_rcv_bytes; /**< Total number of multicast bytes received. */ - uint32_t rx_recvd; /**< Total Rx received count. */ - uint32_t rx_recvd_bytes; /**< Total Rx received count. */ - uint32_t nawds_mcast_drop; /**< Total NAWDS drop count. */ - uint32_t nawds_mcast_drop_bytes; /**< Total NAWDS drop count. */ - uint32_t rx_intra_bss_pkts_num; /**< Total Intra-BSS packets received. */ - uint32_t rx_intra_bss_pkts_bytes; /**< Total Intra-BSS bytes received. */ - uint32_t rx_intra_bss_fail_num; /**< Total Intra-BSS packets failed. */ - uint32_t rx_intra_bss_fail_bytes; /**< Total Intra-BSS bytes received. */ - uint32_t bcast_rcv_cnt; /**< Total number of broadcast packets received. */ - uint32_t bcast_rcv_bytes; /**< Total number of broadcast bytes received. */ -}; - -/** - * nss_wifili_peer_ctrl_stats - * Wifili peer control statistics. - */ -struct nss_wifili_peer_ctrl_stats { - uint32_t peer_id; /**< Peer ID. */ - struct nss_wifili_tx_ctrl_stats tx; - /**< Peer Tx control statistics. */ - struct nss_wifili_rx_ctrl_stats rx; - /**< Peer Rx control statistics. */ -}; - -/** - * nss_wifili peer_stats - * Wifili peer statistics. - */ -struct nss_wifili_peer_stats { - uint32_t npeers; /**< Number of entries of peer statistics. */ - struct nss_wifili_peer_ctrl_stats wpcs[1]; - /**< Wifili peer control statistics. */ -}; - -/** - * nss_wifili_peer_stats_msg - * Wifili peer statistics message. - */ -struct nss_wifili_peer_stats_msg { - struct nss_wifili_peer_stats stats; - /**< Wifili peer statistics. */ -}; - -/** - * nss_wifili_sojourn_per_tid_stats - * Wifili sojourn per TID statistics. - */ -struct nss_wifili_sojourn_per_tid_stats { - uint32_t avg_sojourn_msdu; /**< Average per-TID of all time difference. */ - uint32_t sum_sojourn_msdu; /**< Sum per-TID of all time difference. */ - uint32_t num_msdus; /**< MSDUs per TID. */ -}; - -/** - * nss_wifili_sojourn_peer_stats - * Wifili sojourn peer statistics. - */ -struct nss_wifili_sojourn_peer_stats { - uint32_t peer_id; /**< Peer ID. **/ - struct nss_wifili_sojourn_per_tid_stats stats[NSS_WIFILI_MAX_TID]; /**< Statistics per TID. **/ -}; - -/** - * nss_wifili_sojourn_stats_msg - * Wifili sojourn statistics message. - */ -struct nss_wifili_sojourn_stats_msg { - uint32_t npeers; /**< Number of peers. */ - struct nss_wifili_sojourn_peer_stats sj_peer_stats[1]; /**< Per-peer sojourn statistics. */ -}; - -/* - * nss_wifili_jitter_tid_stats - * Per TID jitter statistics. - */ -struct nss_wifili_jitter_tid_stats { - uint32_t avg_jitter; /**< Average jitter. */ - uint32_t avg_delay; /**< Average delay. */ - uint32_t avg_err; /**< Average count error. */ - uint32_t success; /**< Transmit success count. */ - uint32_t drop; /**< Transmit drop count. */ -}; - -/* - * nss_wifili_jitter_stats - * Wifili jitter statistics. - */ -struct nss_wifili_jitter_stats { - uint32_t peer_id; /**< Peer ID. */ - struct nss_wifili_jitter_tid_stats stats[NSS_WIFILI_MAX_TID]; /**< Per-TID jitter statistics. */ -}; - -/* - * nss_wifili_jitter_stats_msg - * Wifili jitter message. - */ -struct nss_wifili_jitter_stats_msg { - uint32_t npeers; /**< Number of peers. */ - struct nss_wifili_jitter_stats jitter_stats[1]; /**< Jitter statistics. */ -}; - -/** - * nss_wifili_wds_peer_msg - * Wi-Fi Wireless distribution system (WDS) peer-specific message. - */ -struct nss_wifili_wds_peer_msg { - uint8_t dest_mac[ETH_ALEN]; /**< MAC address of the destination. */ - uint8_t peer_mac[ETH_ALEN]; /**< MAC address of the base peer. */ - uint8_t ast_type; /**< AST (Address Search Table) type for this peer. */ - uint8_t pdev_id; /**< Radio ID for next hop peer. */ - uint16_t peer_id; /**< Peer ID of next hop peer. */ -}; - -/** - * nss_wifili_peer_delay_stats - * Per-peer delay statistics. - */ -struct nss_wifili_peer_delay_stats { - struct nss_wifili_delay_stats swq_delay; /**< Software enqueue delay. */ - struct nss_wifili_delay_stats hwtx_delay; /**< Hardware transmit delay. */ -}; - -/** - * nss_wifili_peer_ext_stats - * Peer extended statistics. - */ -struct nss_wifili_peer_ext_stats { - uint32_t peer_id; /**< Peer ID. */ - struct nss_wifili_peer_delay_stats delay_stats[NSS_WIFILI_MAX_TID]; - /**< Delay statistics. */ -}; - -/** - * nss_wifili_peer_ext_stats_msg - * Peer extended statistics message. - */ -struct nss_wifili_peer_ext_stats_msg { - uint32_t npeers; /**< Number of peers. */ - struct nss_wifili_peer_ext_stats ext_stats[1]; /**< Extended statistics. */ -}; - -/** - * nss_wifili_stats_cfg_msg - * Wifili stats enable/disable configuration message. - */ -struct nss_wifili_stats_cfg_msg { - uint32_t cfg; /**< Enable or disable configuration. */ -}; - -/** - * nss_wifili_wds_peer_map_msg - * Wi-Fi Wireless distribution system(WDS) peer-specific message. - */ -struct nss_wifili_wds_peer_map_msg { - uint8_t dest_mac[ETH_ALEN]; /**< MAC address of the destination. */ - uint16_t peer_id; /**< Connected peer ID for this WDS peer. */ - uint16_t ast_idx; /**< AST (address search table) index for this peer in host. */ - uint16_t vdev_id;; /**< VAP ID. */ -}; - -/** - * nss_wifili_wds_active_info - * Wi-Fi WDS active information. - */ -struct nss_wifili_wds_active_info { - uint16_t ast_idx; /**< Hardware AST index. */ -}; - -/** - * nss_wifili_wds_active_info_msg - * Wi-Fi Wireless distribution system active information message. - */ -struct nss_wifili_wds_active_info_msg { - uint16_t nentries; /**< Number of WDS entries. */ - struct nss_wifili_wds_active_info info[1]; - /**< WDS active information. */ -}; - -/** - * nss_wifili_mec_ageout_info - * Wi-Fi multicast echo check ageout information. - */ -struct nss_wifili_mec_ageout_info { - uint8_t mac_addr[6]; /**< MAC address. */ - uint8_t radio_id; /**< Radio ID. */ - uint8_t pad; /**< Pad for word align structure. */ - -}; - -/** - * nss_wifili_mec_ageout_info_msg - * Wi-Fi multicast echo check ageout information message. - */ -struct nss_wifili_mec_ageout_info_msg { - uint16_t nentries; /**< Number of entries. */ - struct nss_wifili_mec_ageout_info info[1]; - /**< Multicast echo check active information. */ -}; - -/** - * nss_wifili_soc_linkdesc_buf_info_msg - * Link descriptor buffer addresss information. - */ -struct nss_wifili_soc_linkdesc_buf_info_msg { - uint32_t buffer_addr_low; /**< Link descriptor low address. */ - uint32_t buffer_addr_high; /**< Link descriptor high address. */ -}; - -/** - * nss_wifili_peer_security_type_msg - * Wifili security type message. - */ -struct nss_wifili_peer_security_type_msg { - uint16_t peer_id; /**< Peer ID. */ - uint8_t pkt_type; /**< Unicast or broadcast packet type. */ - uint8_t security_type; /**< Security type. */ - uint8_t mic_key[NSS_WIFILI_MIC_KEY_LEN]; - /**< MIC key. */ -}; - -/** - * nss_wifili_peer_nawds_enable_msg - * Wifili NAWDS enable for this peer. - */ -struct nss_wifili_peer_nawds_enable_msg { - uint16_t peer_id; /**< Peer ID. */ - uint16_t is_nawds; /**< Enable NAWDS on this peer. */ -}; - -/** - * nss_wifili_peer_vlan_id_msg - * Wifili peer VLAN ID message. - */ -struct nss_wifili_peer_vlan_id_msg { - uint16_t peer_id; /**< Peer ID. */ - uint16_t vlan_id; /**< VLAN ID. */ -}; - -/** - * nss_wifili_peer_isolation_msg - * Wifili peer isolation message. - */ -struct nss_wifili_peer_isolation_msg { - uint16_t peer_id; /**< Peer ID. */ - uint16_t isolation; /**< Isolation enabled/disabled. */ -}; - -/** - * nss_wifili_dbdc_repeater_loop_detection_msg - * Wifili DBDC repeater loop detection message. - */ -struct nss_wifili_dbdc_repeater_loop_detection_msg { - bool dbdc_loop_detected; /**< DBDC repeater loop detection flag. */ -}; - -/** - * nss_wifili_dbdc_repeater_set_msg - * Wifili DBDC repeater set message. - */ -struct nss_wifili_dbdc_repeater_set_msg { - uint32_t is_dbdc_en; /**< DBDC enable flag. */ -}; - -/** - * nss_wifili_hmmc_dscp_tid_set_msg - * Wifili Hy-Fi managed multicast DSCP TID set message. - */ -struct nss_wifili_hmmc_dscp_tid_set_msg { - uint16_t radio_id; /**< Radio ID. */ - uint16_t value; /**< Hy-Fi managed multicast TID value. */ -}; - -/** - * nss_wifili_hmmc_dscp_override_set_msg - * Wifili Hy-Fi managed multicast DSCP override set message. - */ -struct nss_wifili_hmmc_dscp_override_set_msg { - uint16_t radio_id; /**< Radio ID. */ - uint16_t value; /**< Hy-Fi managed multicast DSCP override value. */ -}; - -/** - * nss_wifili_reo_tidq_msg - * Rx reorder TID queue setup message. - */ -struct nss_wifili_reo_tidq_msg { - uint32_t tid; /**< TID (traffic identification) value. */ - uint16_t peer_id; /**< Peer ID. */ -}; - -/** - * nss_wifili_enable_v3_stats_msg - * Version 3 statistics enable message. - */ -struct nss_wifili_enable_v3_stats_msg { - uint32_t radio_id; /**< Radio ID. */ - uint32_t flag; /**< Flag to enable version 3 statistics. */ -}; - -/** - * nss_wifili_clr_stats_msg - * NSS firmware statistics clear message. - */ -struct nss_wifili_clr_stats_msg { - uint8_t vdev_id;; /**< VAP ID. */ -}; - -/** - * nss_wifili_update_auth_flag - * Peer authentication flag message. - */ -struct nss_wifili_peer_update_auth_flag { - uint16_t peer_id; /**< Peer ID. */ - uint8_t auth_flag; /**< Peer authentication flag. */ - uint8_t reserved; /**< Alignment padding. */ -}; - -/** - * nss_wifili_update_pdev_lmac_id_msg - * Physical device ID and lower MAC ID update message. - */ -struct nss_wifili_update_pdev_lmac_id_msg { - uint32_t pdev_id; /**< Physical device ID. */ - uint32_t lmac_id; /**< Lower MAC ID. */ - uint32_t target_pdev_id; /**< Target physical device ID. */ -}; - -/** - * nss_wifili_radio_cmd_msg - * Wi-Fi radio specific special commands. - */ -struct nss_wifili_radio_cmd_msg { - enum nss_wifili_radio_cmd cmd; - /**< Type of command message. */ - uint32_t value; /**< Value of the command. */ -}; - -/** - * nss_wifili_radio_buf_cfg_msg - * Wi-Fi Radio buffer requirement configuration. - * - * Number of payloads needed in NSS for multi-client scenarios are configured - * from Wi-Fi driver as per following ranges: - * 0-64 peers range 1. - * 64-128 peers range 2. - * 128-256 peers range 3. - * >256 peers range 4. - * Number of payloads needed in for each peer range is configured by Wi-Fi driver - * for flexibility. - */ -struct nss_wifili_radio_buf_cfg_msg { - uint32_t buf_cnt; /**< Number of buffers required. */ - uint32_t range; /**< Peer range. */ -}; - -/** - * nss_wifili_radio_cfg_msg - * Wi-Fi radio specific special configurations. - */ -struct nss_wifili_radio_cfg_msg { - uint32_t radio_if_num; /**< NSS assigned interface number for radio. */ - - /** - * Wi-Fi radio specific special command message. - */ - union { - struct nss_wifili_radio_cmd_msg radiocmdmsg; - /**< Radio specific commands. */ - struct nss_wifili_radio_buf_cfg_msg radiobufcfgmsg; - /**< Radio specific buffer configurations. */ - } radiomsg; /**< Wi-Fi radio command message. */ -}; - -/** - * struct wifili_peer_wds_4addr_allow_msg - * Per-peer four address configuration message. - */ -struct nss_wifili_peer_wds_4addr_allow_msg { - uint32_t peer_id; /**< Peer ID. */ - uint32_t if_num; /**< Associate virtual interface number. */ - bool enable; /**< Boolean flag to enable/disable four address frames. */ -}; - -/** - * struct nss_wifili_mesh_capability_info - * Wi-Fi mesh capability flag. - */ -struct nss_wifili_mesh_capability_info { - bool mesh_enable; /**< Wi-Fi mesh capability flag. */ -}; - -/** - * nss_wifili_msg - * Structure that describes wifili messages. - */ -struct nss_wifili_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of wifili message. - */ - union { - struct nss_wifili_init_msg init; - /**< Wi-Fi initialization data. */ - struct nss_wifili_pdev_init_msg pdevmsg; - /**< Tx initialization data. */ - struct nss_wifili_pdev_deinit_msg pdevdeinit; - /**< Tx de-initialization data. */ - struct nss_wifili_peer_msg peermsg; - /**< Peer-specific data for the physical device. */ - struct nss_wifili_peer_freelist_append_msg peer_freelist_append; - /**< Information for creating a peer freelist. */ - struct nss_wifili_stats_sync_msg wlsoc_stats; - /**< Synchronization statistics. */ - struct nss_wifili_peer_stats_msg peer_stats; - /**< Wifili peer statistics. */ - struct nss_wifili_wds_peer_msg wdspeermsg; - /**< WDS peer-specific message. */ - struct nss_wifili_wds_peer_map_msg wdspeermapmsg; - /**< WDS peer-mapping specific message. */ - struct nss_wifili_wds_active_info_msg wdsinfomsg; - /**< WDS active information specific message. */ - struct nss_wifili_stats_cfg_msg scm; - /**< Wifili peer statistics configuration message. */ - struct nss_wifili_reo_tidq_msg reotidqmsg; - /**< Rx reorder TID queue setup message. */ - struct nss_wifili_radio_cfg_msg radiocfgmsg; - /**< Radio command message. */ - struct nss_wifili_wds_extn_peer_cfg_msg wpeercfg; - /**< WDS vendor configuration message. */ - struct nss_wifili_soc_linkdesc_buf_info_msg linkdescinfomsg; - /**< Link descriptor buffer address information. */ - struct nss_wifili_peer_security_type_msg securitymsg; - /**< Wifili peer security message. */ - struct nss_wifili_peer_nawds_enable_msg nawdsmsg; - /**< Wifili peer enable NAWDS message. */ - struct nss_wifili_dbdc_repeater_set_msg dbdcrptrmsg; - /**< Wifili DBDC repeater enable message. */ - struct nss_wifili_hmmc_dscp_override_set_msg shmmcdscpmsg; - /**< Wifili Hy-Fi managed multicast DSCP override set message. */ - struct nss_wifili_hmmc_dscp_tid_set_msg shmmcdcptidmsg; - /**< Wifili Hy-Fi managed multicast DSCP TID map set message. */ - struct nss_wifili_pdev_v3_tx_rx_stats_sync_msg v3_txrx_stats_msg; - /**< Wifili version 3 Tx and Rx statistics message. */ - struct nss_wifili_pdev_v3_delay_stats_sync_msg v3_delay_stats_msg; - /**< Wifili version 3 delay statistics message. */ - struct nss_wifili_enable_v3_stats_msg enablev3statsmsg; - /**< Wifili version 3 statistics enable message. */ - struct nss_wifili_sojourn_stats_msg sj_stats_msg; - /**< Wifili sojourn statistics message. */ - struct nss_wifili_peer_vlan_id_msg peervlan; - /**< Wifili peer VLAN ID message. */ - struct nss_wifili_update_pdev_lmac_id_msg update_pdev_lmac_id_msg; - /**< Wifili peer update lower MAC ID message. */ - struct nss_wifili_peer_ast_flowid_map_msg peer_ast_flowid_msg; - /**< Wifili peer AST index flow ID map message. */ - struct nss_wifili_mec_ageout_info_msg mecagemsg; - /**< Multicast echo check active information specific message. */ - struct nss_wifili_jitter_stats_msg jt_stats_msg; - /** HLOS messages for bridge - */ -static void nss_bridge_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) -{ - struct nss_bridge_msg *nbm = (struct nss_bridge_msg *)ncm; - nss_bridge_msg_callback_t cb; - - BUG_ON(!nss_is_dynamic_interface(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_BRIDGE_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for bridge interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_bridge_msg)) { - nss_warning("%px: length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Trace Messages - */ - nss_bridge_log_rx_msg(nbm); - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Update the callback and app_data for NOTIFY messages, IPv4 sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->bridge_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->nss_top->bridge_ctx; - } - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_bridge_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nbm); -} - -/* - * nss_bridge_get_context() - */ -struct nss_ctx_instance *nss_bridge_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.bridge_handler_id]; -} -EXPORT_SYMBOL(nss_bridge_get_context); - -/* - * nss_bridge_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_bridge_callback(void *app_data, struct nss_bridge_msg *nbm) -{ - nss_bridge_msg_callback_t callback = (nss_bridge_msg_callback_t)bridge_pvt.cb; - void *data = bridge_pvt.app_data; - - bridge_pvt.response = NSS_TX_SUCCESS; - bridge_pvt.cb = NULL; - bridge_pvt.app_data = NULL; - - if (nbm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("bridge error response %d\n", nbm->cm.response); - bridge_pvt.response = nbm->cm.response; - } - - if (callback) { - callback(data, nbm); - } - complete(&bridge_pvt.complete); -} - -/* - * nss_bridge_verify_if_num() - * Verify if_num passed to us. - */ -bool nss_bridge_verify_if_num(uint32_t if_num) -{ - if (nss_is_dynamic_interface(if_num) == false) { - return false; - } - - if (nss_dynamic_interface_get_type(nss_bridge_get_context(), if_num) != NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE) { - return false; - } - - return true; -} -EXPORT_SYMBOL(nss_bridge_verify_if_num); - -/* - * nss_bridge_tx_msg() - * Transmit a bridge message to NSSFW - */ -nss_tx_status_t nss_bridge_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_bridge_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Sanity check the message - */ - if (!nss_is_dynamic_interface(ncm->interface)) { - nss_warning("%px: tx request for interface that is not a bridge: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_BRIDGE_MSG_TYPE_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace Messages - */ - nss_bridge_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_bridge_tx_msg); - -/* - * nss_bridge_tx_msg_sync() - * Transmit a bridge message to NSS firmware synchronously. - */ -nss_tx_status_t nss_bridge_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_bridge_msg *nbm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&bridge_pvt.sem); - bridge_pvt.cb = (void *)nbm->cm.cb; - bridge_pvt.app_data = (void *)nbm->cm.app_data; - - nbm->cm.cb = (nss_ptr_t)nss_bridge_callback; - nbm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_bridge_tx_msg(nss_ctx, nbm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: bridge_tx_msg failed\n", nss_ctx); - up(&bridge_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&bridge_pvt.complete, msecs_to_jiffies(NSS_BRIDGE_TX_TIMEOUT)); - - if (!ret) { - nss_warning("%px: bridge msg tx failed due to timeout\n", nss_ctx); - bridge_pvt.response = NSS_TX_FAILURE; - } - - status = bridge_pvt.response; - up(&bridge_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_bridge_tx_msg_sync); - -/* - * nss_bridge_msg_init() - * Initialize nss_bridge_msg. - */ -void nss_bridge_msg_init(struct nss_bridge_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_bridge_msg_init); - -/* - * nss_bridge_tx_vsi_assign_msg - * API to send vsi assign message to NSS FW - */ -nss_tx_status_t nss_bridge_tx_vsi_assign_msg(uint32_t if_num, uint32_t vsi) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - struct nss_bridge_msg nbm; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_bridge_verify_if_num(if_num) == false) { - nss_warning("%px: invalid interface %d", nss_ctx, if_num); - return NSS_TX_FAILURE; - } - - nss_bridge_msg_init(&nbm, if_num, NSS_IF_VSI_ASSIGN, - sizeof(struct nss_if_vsi_assign), NULL, NULL); - - nbm.msg.if_msg.vsi_assign.vsi = vsi; - - return nss_bridge_tx_msg_sync(nss_ctx, &nbm); -} -EXPORT_SYMBOL(nss_bridge_tx_vsi_assign_msg); - -/* - * nss_bridge_tx_vsi_unassign_msg - * API to send vsi unassign message to NSS FW - */ -nss_tx_status_t nss_bridge_tx_vsi_unassign_msg(uint32_t if_num, uint32_t vsi) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - struct nss_bridge_msg nbm; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_bridge_verify_if_num(if_num) == false) { - nss_warning("%px: invalid interface %d", nss_ctx, if_num); - return NSS_TX_FAILURE; - } - - nss_bridge_msg_init(&nbm, if_num, NSS_IF_VSI_UNASSIGN, - sizeof(struct nss_if_vsi_unassign), NULL, NULL); - - nbm.msg.if_msg.vsi_unassign.vsi = vsi; - - return nss_bridge_tx_msg_sync(nss_ctx, &nbm); -} -EXPORT_SYMBOL(nss_bridge_tx_vsi_unassign_msg); - -/* - * nss_bridge_tx_change_mtu_msg - * API to send change mtu message to NSS FW - */ -nss_tx_status_t nss_bridge_tx_set_mtu_msg(uint32_t bridge_if_num, uint32_t mtu) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - struct nss_bridge_msg nbm; - struct nss_if_mtu_change *nimc; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_bridge_verify_if_num(bridge_if_num) == false) { - nss_warning("%px: received invalid interface %d", nss_ctx, bridge_if_num); - return NSS_TX_FAILURE; - } - - nss_bridge_msg_init(&nbm, bridge_if_num, NSS_IF_MTU_CHANGE, - sizeof(struct nss_if_mtu_change), NULL, NULL); - - nimc = &nbm.msg.if_msg.mtu_change; - nimc->min_buf_size = (uint16_t)mtu; - - return nss_bridge_tx_msg_sync(nss_ctx, &nbm); -} -EXPORT_SYMBOL(nss_bridge_tx_set_mtu_msg); - -/* - * nss_bridge_tx_set_mac_addr_msg - * API to send change mac addr message to NSS FW - */ -nss_tx_status_t nss_bridge_tx_set_mac_addr_msg(uint32_t bridge_if_num, uint8_t *addr) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - struct nss_bridge_msg nbm; - struct nss_if_mac_address_set *nmas; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_bridge_verify_if_num(bridge_if_num) == false) { - nss_warning("%px: received invalid interface %d", nss_ctx, bridge_if_num); - return NSS_TX_FAILURE; - } - - nss_bridge_msg_init(&nbm, bridge_if_num, NSS_IF_MAC_ADDR_SET, - sizeof(struct nss_if_mac_address_set), NULL, NULL); - - nmas = &nbm.msg.if_msg.mac_address_set; - memcpy(nmas->mac_addr, addr, ETH_ALEN); - return nss_bridge_tx_msg_sync(nss_ctx, &nbm); -} -EXPORT_SYMBOL(nss_bridge_tx_set_mac_addr_msg); - -/* - * nss_bridge_tx_join_msg - * API to send slave join message to NSS FW - */ -nss_tx_status_t nss_bridge_tx_join_msg(uint32_t bridge_if_num, struct net_device *netdev) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - struct nss_bridge_msg nbm; - uint32_t slave_if_num; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_bridge_verify_if_num(bridge_if_num) == false) { - nss_warning("%px: received invalid interface %d\n", nss_ctx, bridge_if_num); - return NSS_TX_FAILURE; - } - - slave_if_num = nss_cmn_get_interface_number_by_dev(netdev); - if (slave_if_num < 0) { - nss_warning("%px: invalid slave device %px\n", nss_ctx, netdev); - return NSS_TX_FAILURE; - } - - nbm.msg.br_join.if_num = slave_if_num; - nss_bridge_msg_init(&nbm, bridge_if_num, NSS_BRIDGE_MSG_JOIN, - sizeof(struct nss_bridge_join_msg), NULL, NULL); - - return nss_bridge_tx_msg_sync(nss_ctx, &nbm); -} -EXPORT_SYMBOL(nss_bridge_tx_join_msg); - -/* - * nss_bridge_tx_leave_msg - * API to send slave leave message to NSS FW - */ -nss_tx_status_t nss_bridge_tx_leave_msg(uint32_t bridge_if_num, struct net_device *netdev) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - struct nss_bridge_msg nbm; - uint32_t slave_if_num; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_bridge_verify_if_num(bridge_if_num) == false) { - nss_warning("%px: received invalid interface %d\n", nss_ctx, bridge_if_num); - return NSS_TX_FAILURE; - } - - slave_if_num = nss_cmn_get_interface_number_by_dev(netdev); - if (slave_if_num < 0) { - nss_warning("%px: invalid slave device %px\n", nss_ctx, netdev); - return NSS_TX_FAILURE; - } - - nbm.msg.br_leave.if_num = slave_if_num; - nss_bridge_msg_init(&nbm, bridge_if_num, NSS_BRIDGE_MSG_LEAVE, - sizeof(struct nss_bridge_leave_msg), NULL, NULL); - - return nss_bridge_tx_msg_sync(nss_ctx, &nbm); -} -EXPORT_SYMBOL(nss_bridge_tx_leave_msg); - -/* - * nss_bridge_tx_set_fdb_learn_msg - * API to send FDB learn message to NSS FW - */ -nss_tx_status_t nss_bridge_tx_set_fdb_learn_msg(uint32_t bridge_if_num, enum nss_bridge_fdb_learn_mode fdb_learn) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - struct nss_bridge_msg nbm; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_bridge_verify_if_num(bridge_if_num) == false) { - nss_warning("%px: received invalid interface %d\n", nss_ctx, bridge_if_num); - return NSS_TX_FAILURE; - } - - if (fdb_learn >= NSS_BRIDGE_FDB_LEARN_MODE_MAX) { - nss_warning("%px: received invalid fdb learn mode %d\n", nss_ctx, fdb_learn); - return NSS_TX_FAILURE; - } - - nss_bridge_msg_init(&nbm, bridge_if_num, NSS_BRIDGE_MSG_SET_FDB_LEARN, - sizeof(struct nss_bridge_set_fdb_learn_msg), NULL, NULL); - - nbm.msg.fdb_learn.mode = fdb_learn; - - return nss_bridge_tx_msg_sync(nss_ctx, &nbm); -} -EXPORT_SYMBOL(nss_bridge_tx_set_fdb_learn_msg); - -/* - * nss_bridge_init() - */ -void nss_bridge_init(void) -{ - sema_init(&bridge_pvt.sem, 1); - init_completion(&bridge_pvt.complete); -} - -/* - * nss_bridge_unregister() - */ -void nss_bridge_unregister(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - - nss_assert(nss_bridge_verify_if_num(if_num)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.bridge_callback = NULL; - - nss_core_unregister_handler(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_bridge_unregister); - -/* - * nss_bridge_register() - */ -struct nss_ctx_instance *nss_bridge_register(uint32_t if_num, struct net_device *netdev, - nss_bridge_callback_t bridge_data_cb, - nss_bridge_msg_callback_t bridge_msg_cb, - uint32_t features, - void *app_data) -{ - struct nss_ctx_instance *nss_ctx = nss_bridge_get_context(); - - nss_assert(nss_bridge_verify_if_num(if_num)); - - nss_core_register_subsys_dp(nss_ctx, if_num, bridge_data_cb, NULL, app_data, netdev, features); - - nss_top_main.bridge_callback = bridge_msg_cb; - - nss_core_register_handler(nss_ctx, if_num, nss_bridge_handler, app_data); - return nss_ctx; -} -EXPORT_SYMBOL(nss_bridge_register); - -/* - * nss_bridge_notify_register() - * Register to receive bridge notify messages. - */ -struct nss_ctx_instance *nss_bridge_notify_register(nss_bridge_msg_callback_t cb, void *app_data) -{ - nss_top_main.bridge_callback = cb; - nss_top_main.bridge_ctx = app_data; - return nss_bridge_get_context(); -} -EXPORT_SYMBOL(nss_bridge_notify_register); - -/* - * nss_bridge_notify_unregister() - * Unregister to receive bridge notify messages. - */ -void nss_bridge_notify_unregister(void) -{ - nss_top_main.bridge_callback = NULL; -} -EXPORT_SYMBOL(nss_bridge_notify_unregister); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_bridge_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_bridge_log.c deleted file mode 100644 index 3b0cf1e39..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_bridge_log.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_bridge_log.c - * NSS Bridge logger file. - */ - -#include "nss_core.h" - -/* - * nss_bridge_log_message_types_str - * NSS Bridge message strings - */ -static int8_t *nss_bridge_log_message_types_str[NSS_BRIDGE_MSG_TYPE_MAX] __maybe_unused = { - "Bridge Join message", - "Bridge Leave message", - "Bridge Set FDB Learn message" -}; - -/* - * nss_bridge_join_msg() - * Log NSS Bridge Join message. - */ -static void nss_bridge_join_msg(struct nss_bridge_msg *nbm) -{ - struct nss_bridge_join_msg *nbjm __maybe_unused = &nbm->msg.br_join; - nss_trace("%px: NSS Bridge Join message \n" - "Interface Number: %d\n", - nbm, nbjm->if_num); -} - -/* - * nss_bridge_leave_msg() - * Log NSS Bridge Leave message. - */ -static void nss_bridge_leave_msg(struct nss_bridge_msg *nbm) -{ - struct nss_bridge_leave_msg *nblm __maybe_unused = &nbm->msg.br_leave; - nss_trace("%px: NSS Bridge Leave message: \n" - "Interface Number: %d\n", - nbm, nblm->if_num); -} - -/* - * nss_bridge_fdb_learn_msg() - * Log NSS Set Bridge FDB Learn message. - */ -static void nss_bridge_fdb_learn_msg(struct nss_bridge_msg *nbm) -{ - struct nss_bridge_set_fdb_learn_msg *nbflm __maybe_unused = - &nbm->msg.fdb_learn; - nss_trace("%px: NSS Bridge Set FDB Learn message: \n" - "Mode: %d\n", - nbm, nbflm->mode); -} - -/* - * nss_bridge_log_verbose() - * Log message contents. - */ -static void nss_bridge_log_verbose(struct nss_bridge_msg *nbm) -{ - switch (nbm->cm.type) { - case NSS_BRIDGE_MSG_JOIN: - nss_bridge_join_msg(nbm); - break; - - case NSS_BRIDGE_MSG_LEAVE: - nss_bridge_leave_msg(nbm); - break; - - case NSS_BRIDGE_MSG_SET_FDB_LEARN: - nss_bridge_fdb_learn_msg(nbm); - break; - - default: - nss_trace("%px: Invalid message type\n", nbm); - break; - } -} - -/* - * nss_bridge_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_bridge_log_tx_msg(struct nss_bridge_msg *nbm) -{ - if (nbm->cm.type >= NSS_BRIDGE_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", nbm); - return; - } - - nss_info("%px: type[%d]:%s\n", nbm, nbm->cm.type, nss_bridge_log_message_types_str[nbm->cm.type - NSS_IF_MAX_MSG_TYPES - 1]); - nss_bridge_log_verbose(nbm); -} - -/* - * nss_bridge_log_rx_msg() - * Log messages received from FW. - */ -void nss_bridge_log_rx_msg(struct nss_bridge_msg *nbm) -{ - if (nbm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nbm); - return; - } - - if (nbm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nbm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nbm, nbm->cm.type, - nss_bridge_log_message_types_str[nbm->cm.type - NSS_IF_MAX_MSG_TYPES - 1], - nbm->cm.response, nss_cmn_response_str[nbm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - nbm, nbm->cm.type, nss_bridge_log_message_types_str[nbm->cm.type - NSS_IF_MAX_MSG_TYPES - 1], - nbm->cm.response, nss_cmn_response_str[nbm->cm.response]); - -verbose: - nss_bridge_log_verbose(nbm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_bridge_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_bridge_log.h deleted file mode 100644 index af9a5f787..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_bridge_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_BRIDGE_LOG_H -#define __NSS_BRIDGE_LOG_H - -/* - * nss_bridge.h - * NSS Bridge header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_bridge_log_tx_msg - * Logs a bridge message that is sent to the NSS firmware. - */ -void nss_bridge_log_tx_msg(struct nss_bridge_msg *nbm); - -/* - * nss_bridge_log_rx_msg - * Logs a bridge message that is received from the NSS firmware. - */ -void nss_bridge_log_rx_msg(struct nss_bridge_msg *nbm); - -#endif /* __NSS_BRIDGE_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx.c b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx.c deleted file mode 100644 index 4a1d5f8c2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_c2c_rx.c - * NSS C2C_RX APIs - */ - -#include -#include "nss_c2c_rx_stats.h" -#include "nss_c2c_rx_strings.h" - -/* - * nss_c2c_rx_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_c2c_rx_verify_if_num(uint32_t if_num) -{ - return if_num == NSS_C2C_RX_INTERFACE; -} - -/* - * nss_c2c_rx_interface_handler() - * Handle NSS -> HLOS messages for C2C_RX Statistics - */ -static void nss_c2c_rx_interface_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_c2c_rx_msg *ncrm = (struct nss_c2c_rx_msg *)ncm; - nss_c2c_rx_msg_callback_t cb; - - if (!nss_c2c_rx_verify_if_num(ncm->interface)) { - nss_warning("%px: invalid interface %d for c2c_tx\n", nss_ctx, ncm->interface); - return; - } - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_C2C_RX_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for c2c_rx", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_c2c_rx_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ncrm->cm.type) { - case NSS_C2C_RX_MSG_TYPE_STATS: - /* - * Update driver statistics and send statistics notifications to the registered modules. - */ - nss_c2c_rx_stats_sync(nss_ctx, &ncrm->msg.stats); - nss_c2c_rx_stats_notify(nss_ctx); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages - * TODO: Add notify callbacks for c2c_rx - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - return; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_c2c_rx_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ncrm); -} - -/* - * nss_c2c_rx_register_handler() - * Register handler for messaging - */ -void nss_c2c_rx_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_core_register_handler(nss_ctx, NSS_C2C_RX_INTERFACE, nss_c2c_rx_interface_handler, NULL); - - if (nss_ctx->id == NSS_CORE_0) { - nss_c2c_rx_stats_dentry_create(); - } - nss_c2c_rx_strings_dentry_create(); -} -EXPORT_SYMBOL(nss_c2c_rx_register_handler); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_stats.c deleted file mode 100644 index d9ea31656..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_stats.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_c2c_rx_stats.h" -#include "nss_c2c_rx_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_c2c_rx_stats_notifier); - -/* - * Spinlock to protect C2C_RX statistics update/read - */ -DEFINE_SPINLOCK(nss_c2c_rx_stats_lock); - -/* - * nss_c2c_rx_stats - * c2c_rx statistics - */ -uint64_t nss_c2c_rx_stats[NSS_MAX_CORES][NSS_C2C_RX_STATS_MAX]; - -/* - * nss_c2c_rx_stats_read() - * Read C2C_RX statistics - */ -static ssize_t nss_c2c_rx_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i, core; - - /* - * Max output lines = #stats * NSS_MAX_CORES + - * few blank lines for banner printing + Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_C2C_RX_STATS_MAX * NSS_MAX_CORES + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = kzalloc(NSS_C2C_RX_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return -ENOMEM; - } - - /* - * C2C_RX statistics - */ - for (core = 0; core < NSS_MAX_CORES; core++) { - spin_lock_bh(&nss_c2c_rx_stats_lock); - for (i = 0; i < NSS_C2C_RX_STATS_MAX; i++) { - stats_shadow[i] = nss_c2c_rx_stats[core][i]; - } - spin_unlock_bh(&nss_c2c_rx_stats_lock); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "c2c_rx", core); - size_wr += nss_stats_print("c2c_rx", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_c2c_rx_strings_stats - , stats_shadow - , NSS_C2C_RX_STATS_MAX - , lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_c2c_rx_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(c2c_rx); - -/* - * nss_c2c_rx_stats_dentry_create() - * Create C2C_RX statistics debug entry. - */ -void nss_c2c_rx_stats_dentry_create(void) -{ - nss_stats_create_dentry("c2c_rx", &nss_c2c_rx_stats_ops); -} - -/* - * nss_c2c_rx_stats_sync() - * Handle the syncing of NSS C2C_RX statistics. - */ -void nss_c2c_rx_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_c2c_rx_stats *ncrs) -{ - int id = nss_ctx->id; - int j; - - spin_lock_bh(&nss_c2c_rx_stats_lock); - - /* - * Common node stats - */ - nss_c2c_rx_stats[id][NSS_STATS_NODE_RX_PKTS] += (ncrs->pbuf_simple + ncrs->pbuf_sg + ncrs->pbuf_returning); - nss_c2c_rx_stats[id][NSS_STATS_NODE_RX_BYTES] += ncrs->node_stats.rx_bytes; - nss_c2c_rx_stats[id][NSS_STATS_NODE_TX_PKTS] += ncrs->node_stats.tx_packets; - nss_c2c_rx_stats[id][NSS_STATS_NODE_TX_BYTES] += ncrs->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_c2c_rx_stats[id][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += ncrs->node_stats.rx_dropped[j]; - } - - /* - * C2C_RX statistics - */ - nss_c2c_rx_stats[id][NSS_C2C_RX_STATS_PBUF_SIMPLE] += ncrs->pbuf_simple; - nss_c2c_rx_stats[id][NSS_C2C_RX_STATS_PBUF_SG] += ncrs->pbuf_sg; - nss_c2c_rx_stats[id][NSS_C2C_RX_STATS_PBUF_RETURNING] += ncrs->pbuf_returning; - nss_c2c_rx_stats[id][NSS_C2C_RX_STATS_INVAL_DEST] += ncrs->inval_dest; - - spin_unlock_bh(&nss_c2c_rx_stats_lock); -} - -/* - * nss_c2c_rx_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_c2c_rx_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_c2c_rx_stats_notification c2c_rx_stats; - - c2c_rx_stats.core_id = nss_ctx->id; - memcpy(c2c_rx_stats.stats, nss_c2c_rx_stats[c2c_rx_stats.core_id], sizeof(c2c_rx_stats.stats)); - atomic_notifier_call_chain(&nss_c2c_rx_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&c2c_rx_stats); -} - -/* - * nss_c2c_rx_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_c2c_rx_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_c2c_rx_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_c2c_rx_stats_register_notifier); - -/* - * nss_c2c_rx_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_c2c_rx_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_c2c_rx_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_c2c_rx_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_stats.h deleted file mode 100644 index c53d08071..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_stats.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_C2C_RX_STATS_H -#define __NSS_C2C_RX_STATS_H - -#include - -/* - * c2c_rx_msg_type - * Message types supported - */ -enum c2c_rx_msg_type { - NSS_C2C_RX_MSG_TYPE_STATS, /* Statistics synchronization */ - NSS_C2C_RX_MSG_TYPE_MAX -}; - -/* - * nss_c2c_rx_stats - * The NSS c2c_rx node stats structure. - */ -struct nss_c2c_rx_stats { - struct nss_cmn_node_stats node_stats; - /* Common node stats for core-to-core reception. */ - uint32_t pbuf_simple; /* Number of received simple pbuf. */ - uint32_t pbuf_sg; /* Number of S/G pbuf received. */ - uint32_t pbuf_returning; /* Number of returning S/G pbuf. */ - uint32_t inval_dest; /* Number of pbuf enqueue failure because of dest is invalid. */ -}; - -/* - * nss_c2c_rx_msg - * Message structure to send/receive c2c_rx commands - */ -struct nss_c2c_rx_msg { - struct nss_cmn_msg cm; /* Message Header */ - union { - struct nss_c2c_rx_stats stats; /* c2c_rx statistics */ - } msg; -}; - -/* - * C2C_RX statistics APIs - */ -extern void nss_c2c_rx_stats_notify(struct nss_ctx_instance *nss_ctx); -typedef void (*nss_c2c_rx_msg_callback_t)(void *app_data, struct nss_c2c_rx_msg *msg); -extern void nss_c2c_rx_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_c2c_rx_stats *ncrs); -extern void nss_c2c_rx_stats_dentry_create(void); - -#endif /* __NSS_C2C_RX_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_strings.c deleted file mode 100644 index c20754d12..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_strings.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" - -/* - * nss_c2c_rx_strings_stats - * Core-to-core Rx statistics strings. - */ -struct nss_stats_info nss_c2c_rx_strings_stats[NSS_C2C_RX_STATS_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_byts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_byts" , NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops" , NSS_STATS_TYPE_DROP}, - {"pbuf_simple" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_sg" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_returning" , NSS_STATS_TYPE_SPECIAL}, - {"inval_dest" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_c2c_rx_strings_read() - * Read C2C Rx node statistics names. - */ -static ssize_t nss_c2c_rx_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_c2c_rx_strings_stats, NSS_C2C_RX_STATS_MAX); -} - -/* - * nss_c2c_rx_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(c2c_rx); - -/* - * nss_c2c_rx_strings_dentry_create() - * Create C2C Rx statistics strings debug entry. - */ -void nss_c2c_rx_strings_dentry_create(void) -{ - nss_strings_create_dentry("c2c_rx", &nss_c2c_rx_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_strings.h deleted file mode 100644 index 3810f11fa..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_rx_strings.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_C2C_RX_STRINGS_H -#define __NSS_C2C_RX_STRINGS_H - -extern struct nss_stats_info nss_c2c_rx_strings_stats[NSS_C2C_RX_STATS_MAX]; -extern void nss_c2c_rx_strings_dentry_create(void); - -#endif /* __NSS_C2C_RX_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx.c b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx.c deleted file mode 100644 index 244f4598a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx.c +++ /dev/null @@ -1,439 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_c2c_tx.c - * NSS C2C_TX APIs - */ - -#include -#include "nss_c2c_tx_stats.h" -#include "nss_c2c_tx_log.h" -#include "nss_c2c_tx_strings.h" - -int nss_c2c_tx_test_id = -1; - -/* - * Private data structure. - */ -struct nss_c2c_tx_pvt { - struct semaphore sem; /* Semaphore structure. */ - struct completion complete; /* Completion structure. */ - int response; /* Response from FW. */ - void *cb; /* Original cb for sync msgs. */ - void *app_data; /* Original app_data for sync msgs. */ -}; - -/* - * Notify data structure - */ -struct nss_c2c_tx_notify_data { - nss_c2c_tx_msg_callback_t c2c_tx_callback; - void *app_data; -}; - -static struct nss_c2c_tx_notify_data nss_c2c_tx_notify[NSS_CORE_MAX]; -static struct nss_c2c_tx_pvt nss_c2c_tx_cfg_pvt; - -/* - * nss_c2c_tx_verify_if_num() - * Verify if_num passed to us. - */ -static inline bool nss_c2c_tx_verify_if_num(uint32_t if_num) -{ - return if_num == NSS_C2C_TX_INTERFACE; -} - -/* - * nss_c2c_tx_interface_handler() - * Handle NSS -> HLOS messages for C2C_TX Statistics - */ -static void nss_c2c_tx_msg_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_c2c_tx_msg *nctm = (struct nss_c2c_tx_msg *)ncm; - nss_c2c_tx_msg_callback_t cb; - - if (!nss_c2c_tx_verify_if_num(ncm->interface)) { - nss_warning("%px: invalid interface %d for c2c_tx\n", nss_ctx, ncm->interface); - return; - } - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_C2C_TX_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for c2c_tx", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_c2c_tx_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Trace messages. - */ - nss_c2c_tx_log_rx_msg(nctm); - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (nctm->cm.type) { - case NSS_C2C_TX_MSG_TYPE_TX_MAP: - case NSS_C2C_TX_MSG_TYPE_PERFORMANCE_TEST: - break; - - case NSS_C2C_TX_MSG_TYPE_STATS: - /* - * Update driver statistics and send statistics notifications to the registered modules. - */ - nss_c2c_tx_stats_sync(nss_ctx, &nctm->msg.stats); - nss_c2c_tx_stats_notify(nss_ctx); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_c2c_tx_notify[nss_ctx->id].c2c_tx_callback; - ncm->app_data = (nss_ptr_t)nss_c2c_tx_notify[nss_ctx->id].app_data; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_c2c_tx_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nctm); -} - -/* - * nss_c2c_tx_register_handler() - * Register handler for messaging - */ -void nss_c2c_tx_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_info("%px: nss_c2c_tx_register_handler", nss_ctx); - nss_core_register_handler(nss_ctx, NSS_C2C_TX_INTERFACE, nss_c2c_tx_msg_handler, NULL); - - if (nss_ctx->id == NSS_CORE_0) { - nss_c2c_tx_stats_dentry_create(); - } - nss_c2c_tx_strings_dentry_create(); -} -EXPORT_SYMBOL(nss_c2c_tx_register_handler); - -/* - * nss_c2c_tx_tx_msg() - * Transmit an c2c_tx message to the FW with a specified size. - */ -nss_tx_status_t nss_c2c_tx_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_c2c_tx_msg *nctm) -{ - struct nss_cmn_msg *ncm = &nctm->cm; - - /* - * Sanity check the message - */ - if (!nss_c2c_tx_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_C2C_TX_MSG_TYPE_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_c2c_tx_log_tx_msg(nctm); - - return nss_core_send_cmd(nss_ctx, nctm, sizeof(*nctm), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_c2c_tx_tx_msg); - -/* - * nss_c2c_tx_msg_cfg_map_callback() - * Callback function for tx_map configuration - */ -static void nss_c2c_tx_msg_cfg_map_callback(void *app_data, struct nss_c2c_tx_msg *nctm) -{ - struct nss_ctx_instance *nss_ctx __attribute__((unused)) = (struct nss_ctx_instance *)app_data; - if (nctm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: nss c2c_tx_map configuration failed: %d for NSS core %d\n", - nss_ctx, nctm->cm.error, nss_ctx->id); - } - - nss_info("%px: nss c2c_tx_map configuration succeeded for NSS core %d\n", - nss_ctx, nss_ctx->id); -} - -/* - * nss_c2c_tx_msg_performance_test_start_callback() - * Callback function for c2c_tx test start configuration - */ -static void nss_c2c_tx_msg_performance_test_callback(void *app_data, struct nss_c2c_tx_msg *nctm) -{ - struct nss_ctx_instance *nss_ctx __attribute__((unused)) = (struct nss_ctx_instance *)app_data; - - /* - * Test start has been failed. Restore the value to initial state. - */ - if (nctm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: nss c2c_tx test start failed: %d for NSS core %d\n", - nss_ctx, nctm->cm.error, nss_ctx->id); - nss_c2c_tx_test_id = -1; - return; - } - - nss_info("%px: nss c2c_tx test successfully initialized for NSS core %d\n", - nss_ctx, nss_ctx->id); -} - -/* - * nss_c2c_tx_msg_cfg_map() - * Send NSS to c2c_map - */ -nss_tx_status_t nss_c2c_tx_msg_cfg_map(struct nss_ctx_instance *nss_ctx, uint32_t tx_map, uint32_t c2c_intr_addr) -{ - int32_t status; - struct nss_c2c_tx_msg nctm; - struct nss_c2c_tx_map *cfg_map; - - nss_info("%px: C2C map:%x\n", nss_ctx, tx_map); - nss_c2c_tx_msg_init(&nctm, NSS_C2C_TX_INTERFACE, NSS_C2C_TX_MSG_TYPE_TX_MAP, - sizeof(struct nss_c2c_tx_map), nss_c2c_tx_msg_cfg_map_callback, (void *)nss_ctx); - - cfg_map = &nctm.msg.map; - cfg_map->tx_map = tx_map; - cfg_map->c2c_intr_addr = c2c_intr_addr; - - status = nss_c2c_tx_tx_msg(nss_ctx, &nctm); - if (unlikely(status != NSS_TX_SUCCESS)) { - return status; - } - - return NSS_TX_SUCCESS; -} - -/* - * nss_c2c_tx_msg_performance_test() - * Send NSS c2c peformance test start message. - */ -nss_tx_status_t nss_c2c_tx_msg_performance_test(struct nss_ctx_instance *nss_ctx, uint32_t test_id) -{ - int32_t status; - struct nss_c2c_tx_msg nctm; - struct nss_c2c_tx_test *test; - - nss_info("%px: C2C test message:%x\n", nss_ctx, test_id); - nss_c2c_tx_msg_init(&nctm, NSS_C2C_TX_INTERFACE, NSS_C2C_TX_MSG_TYPE_PERFORMANCE_TEST, - sizeof(struct nss_c2c_tx_test), nss_c2c_tx_msg_performance_test_callback, (void *)nss_ctx); - - test = &nctm.msg.test; - test->test_id = test_id; - - status = nss_c2c_tx_tx_msg(nss_ctx, &nctm); - if (unlikely(status != NSS_TX_SUCCESS)) { - return status; - } - - return NSS_TX_SUCCESS; -} - -/* - * nss_c2c_tx_msg_init() - * Initialize C2C_TX message. - */ -void nss_c2c_tx_msg_init(struct nss_c2c_tx_msg *nctm, uint16_t if_num, uint32_t type, uint32_t len, - nss_c2c_tx_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nctm->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_c2c_tx_msg_init); - -/* - * nss_c2c_tx_performance_test_handler() - * Handles the performance test. - */ -static int nss_c2c_tx_performance_test_handler(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - int ret, ret_c2c_tx, current_state; - current_state = nss_c2c_tx_test_id; - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - if (ret != NSS_SUCCESS) { - return ret; - } - - if (!write) { - return ret; - } - - if (current_state != -1) { - nss_warning("%px: Another test is running.\n", nss_ctx); - return -EINVAL; - } - - if (nss_c2c_tx_test_id >= NSS_C2C_TX_TEST_TYPE_MAX || nss_c2c_tx_test_id <= 0) { - nss_warning("%px: Invalid test ID.\n", nss_ctx); - nss_c2c_tx_test_id = current_state; - return -EINVAL; - } - - nss_info("Starting the c2c_tx performance test\n"); - ret_c2c_tx = nss_c2c_tx_msg_performance_test(nss_ctx, nss_c2c_tx_test_id); - - if (ret_c2c_tx != NSS_SUCCESS) { - nss_warning("%px: Starting the test has failed.\n", nss_ctx); - nss_c2c_tx_test_id = -1; - } - - return ret_c2c_tx; -} - -static struct ctl_table nss_c2c_tx_table[] = { - { - .procname = "test_code", - .data = &nss_c2c_tx_test_id, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_c2c_tx_performance_test_handler, - }, - { } -}; - -static struct ctl_table nss_c2c_tx_dir[] = { - { - .procname = "c2c_tx", - .mode = 0555, - .child = nss_c2c_tx_table, - }, - { } -}; - -static struct ctl_table nss_c2c_tx_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_c2c_tx_dir, - }, - { } -}; - -static struct ctl_table nss_c2c_tx_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_c2c_tx_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_c2c_tx_header; - -/* - * nss_c2c_tx_register_sysctl() - */ -void nss_c2c_tx_register_sysctl(void) -{ - - /* - * c2c_tx sema init. - */ - sema_init(&nss_c2c_tx_cfg_pvt.sem, 1); - init_completion(&nss_c2c_tx_cfg_pvt.complete); - - /* - * Register sysctl table. - */ - nss_c2c_tx_header = register_sysctl_table(nss_c2c_tx_root); -} - -/* - * nss_c2c_tx_unregister_sysctl() - * Unregister sysctl specific to c2c_tx - */ -void nss_c2c_tx_unregister_sysctl(void) -{ - /* - * Unregister sysctl table. - */ - if (nss_c2c_tx_header) { - unregister_sysctl_table(nss_c2c_tx_header); - } -} - -/* - * nss_c2c_tx_notify_register() - * Register to receive c2c_tx notify messages. - */ -struct nss_ctx_instance *nss_c2c_tx_notify_register(int core, nss_c2c_tx_msg_callback_t cb, void *app_data) -{ - if (core >= NSS_CORE_MAX) { - nss_warning("Input core number %d is wrong\n", core); - return NULL; - } - - nss_c2c_tx_notify[core].c2c_tx_callback = cb; - nss_c2c_tx_notify[core].app_data = app_data; - - return (struct nss_ctx_instance *)&nss_top_main.nss[core]; -} -EXPORT_SYMBOL(nss_c2c_tx_notify_register); - -/* - * nss_c2c_tx_notify_unregister() - * Unregister to receive c2c_tx notify messages. - */ -void nss_c2c_tx_notify_unregister(int core) -{ - if (core >= NSS_CORE_MAX) { - nss_warning("Input core number %d is wrong\n", core); - return; - } - - nss_c2c_tx_notify[core].c2c_tx_callback = NULL; - nss_c2c_tx_notify[core].app_data = NULL; -} -EXPORT_SYMBOL(nss_c2c_tx_notify_unregister); - -/* - * nss_c2c_tx_init() - */ -void nss_c2c_tx_init(void) -{ - int core; - - for (core = 0; core < NSS_CORE_MAX; core++) { - nss_c2c_tx_notify_register(core, NULL, NULL); - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_log.c deleted file mode 100644 index 088cef353..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_log.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_c2c_tx_log.c - * NSS C2C TX logger file. - */ - -#include "nss_core.h" - -/* - * nss_c2c_tx_log_message_types_str - * C2C TX message strings - */ -static int8_t *nss_c2c_tx_log_message_types_str[NSS_C2C_TX_MSG_TYPE_MAX] __maybe_unused = { - "C2C TX Stats message", - "C2C TX Map Message", -}; - -/* - * nss_c2c_tx_log_error_response_types_str - * Strings for error types for c2c_tx messages - */ -static int8_t *nss_c2c_tx_log_error_response_types_str[NSS_C2C_TX_MSG_ERROR_MAX] __maybe_unused = { - "No error", - "Invalid Operation" -}; - -/* - * nss_c2c_tx_map_msg()() - * Log NSS C2C TX Map message. - */ -static void nss_c2c_tx_map_msg(struct nss_c2c_tx_msg *nctm) -{ - struct nss_c2c_tx_map *nctmm __maybe_unused = &nctm->msg.map; - nss_trace("%px: NSS C2C TX Map message: \n" - "C2C Receiver Queue Start Address: %d\n" - "C2C Interrupt Register Address: %d\n", - nctm, - nctmm->tx_map, nctmm->c2c_intr_addr); -} - -/* - * nss_c2c_tx_log_verbose() - * Log message contents. - */ -static void nss_c2c_tx_log_verbose(struct nss_c2c_tx_msg *nctm) -{ - switch (nctm->cm.type) { - case NSS_C2C_TX_MSG_TYPE_TX_MAP: - nss_c2c_tx_map_msg(nctm); - break; - - default: - nss_trace("%px: Invalid message type\n", nctm); - break; - } -} - -/* - * nss_c2c_tx_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_c2c_tx_log_tx_msg(struct nss_c2c_tx_msg *nctm) -{ - if (nctm->cm.type >= NSS_C2C_TX_MSG_TYPE_MAX) { - nss_info("%px: Invalid message type\n", nctm); - return; - } - - nss_info("%px: type[%d]:%s\n", nctm, nctm->cm.type, nss_c2c_tx_log_message_types_str[nctm->cm.type]); - nss_c2c_tx_log_verbose(nctm); -} - -/* - * nss_c2c_tx_log_rx_msg() - * Log messages received from FW. - */ -void nss_c2c_tx_log_rx_msg(struct nss_c2c_tx_msg *nctm) -{ - if (nctm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nctm); - return; - } - - if (nctm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nctm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nctm, nctm->cm.type, - nss_c2c_tx_log_message_types_str[nctm->cm.type], - nctm->cm.response, nss_cmn_response_str[nctm->cm.response]); - goto verbose; - } - - if (nctm->cm.error >= NSS_C2C_TX_MSG_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nctm, nctm->cm.type, nss_c2c_tx_log_message_types_str[nctm->cm.type], - nctm->cm.response, nss_cmn_response_str[nctm->cm.response], - nctm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nctm, nctm->cm.type, nss_c2c_tx_log_message_types_str[nctm->cm.type], - nctm->cm.response, nss_cmn_response_str[nctm->cm.response], - nctm->cm.error, nss_c2c_tx_log_error_response_types_str[nctm->cm.error]); - -verbose: - nss_c2c_tx_log_verbose(nctm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_log.h deleted file mode 100644 index e6ec47e77..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_log.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_C2C_TX_LOG_H -#define __NSS_C2C_TX_LOG_H -/* - * nss_c2c_tx_log.h - * NSS C2C TX Log Header File - */ - -/* - * nss_c2c_tx_log_tx_msg - * Logs an C2C TX message that is sent to the NSS firmware. - */ -void nss_c2c_tx_log_tx_msg(struct nss_c2c_tx_msg *nctm); - -/* - * nss_c2c_tx_log_rx_msg - * Logs an IPv4 message that is received from the NSS firmware. - */ -void nss_c2c_tx_log_rx_msg(struct nss_c2c_tx_msg *nctm); - -#endif /* __NSS_C2C_TX_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_stats.c deleted file mode 100644 index 7983f3f8c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_stats.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_c2c_tx_stats.h" -#include "nss_c2c_tx_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_c2c_tx_stats_notifier); - -/* - * Spinlock to protect C2C_TX statistics update/read - */ -DEFINE_SPINLOCK(nss_c2c_tx_stats_lock); - -/* - * nss_c2c_tx_stats - * c2c_tx statistics - */ -uint64_t nss_c2c_tx_stats[NSS_MAX_CORES][NSS_C2C_TX_STATS_MAX]; - -/* - * nss_c2c_tx_stats_read() - * Read c2c_tx statistics - */ -static ssize_t nss_c2c_tx_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i, core; - - /* - * Max output lines = #stats * NSS_MAX_CORES + - * few blank lines for banner printing + Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_C2C_TX_STATS_MAX * NSS_MAX_CORES + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = kzalloc(NSS_C2C_TX_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return -ENOMEM; - } - - /* - * C2C_TX statistics - */ - for (core = 0; core < NSS_MAX_CORES; core++) { - spin_lock_bh(&nss_c2c_tx_stats_lock); - for (i = 0; i < NSS_C2C_TX_STATS_MAX; i++) { - stats_shadow[i] = nss_c2c_tx_stats[core][i]; - } - spin_unlock_bh(&nss_c2c_tx_stats_lock); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "c2c_tx", core); - size_wr += nss_stats_print("c2c_tx", NULL, NSS_STATS_SINGLE_INSTANCE, nss_c2c_tx_strings_stats, stats_shadow, NSS_C2C_TX_STATS_MAX, lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_c2c_tx_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(c2c_tx); - -/* - * nss_c2c_tx_stats_dentry_create() - * Create c2c_tx statistics debug entry. - */ -void nss_c2c_tx_stats_dentry_create(void) -{ - nss_stats_create_dentry("c2c_tx", &nss_c2c_tx_stats_ops); -} - -/* - * nss_c2c_tx_stats_sync() - * Handle the syncing of NSS C2C_TX statistics. - */ -void nss_c2c_tx_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_c2c_tx_stats *nct) -{ - int id = nss_ctx->id; - int j; - - spin_lock_bh(&nss_c2c_tx_stats_lock); - - /* - * Common node stats - */ - nss_c2c_tx_stats[id][NSS_STATS_NODE_RX_PKTS] += (nct->pbuf_simple + nct->pbuf_sg + nct->pbuf_returning); - nss_c2c_tx_stats[id][NSS_STATS_NODE_RX_BYTES] += nct->node_stats.rx_bytes; - nss_c2c_tx_stats[id][NSS_STATS_NODE_TX_PKTS] += nct->node_stats.tx_packets; - nss_c2c_tx_stats[id][NSS_STATS_NODE_TX_BYTES] += nct->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_c2c_tx_stats[id][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nct->node_stats.rx_dropped[j]; - } - - /* - * C2C_TX statistics - */ - nss_c2c_tx_stats[id][NSS_C2C_TX_STATS_PBUF_SIMPLE] += nct->pbuf_simple; - nss_c2c_tx_stats[id][NSS_C2C_TX_STATS_PBUF_SG] += nct->pbuf_sg; - nss_c2c_tx_stats[id][NSS_C2C_TX_STATS_PBUF_RETURNING] += nct->pbuf_returning; - - spin_unlock_bh(&nss_c2c_tx_stats_lock); -} - -/* - * nss_c2c_tx_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_c2c_tx_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_c2c_tx_stats_notification c2c_tx_stats; - - c2c_tx_stats.core_id = nss_ctx->id; - memcpy(c2c_tx_stats.stats, nss_c2c_tx_stats[c2c_tx_stats.core_id], sizeof(c2c_tx_stats.stats)); - atomic_notifier_call_chain(&nss_c2c_tx_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&c2c_tx_stats); -} - -/* - * nss_c2c_tx_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_c2c_tx_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_c2c_tx_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_c2c_tx_stats_register_notifier); - -/* - * nss_c2c_tx_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_c2c_tx_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_c2c_tx_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_c2c_tx_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_stats.h deleted file mode 100644 index f77a3b4d6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_stats.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_C2C_TX_STATS_H -#define __NSS_C2C_TX_STATS_H - -#include - -/* - * C2C Tx statistics APIs - */ -extern void nss_c2c_tx_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_c2c_tx_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_c2c_tx_stats *nct); -extern void nss_c2c_tx_stats_dentry_create(void); - -#endif /* __NSS_C2C_TX_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_strings.c deleted file mode 100644 index 8272e8466..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_strings.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" - -/* - * nss_c2c_tx_strings_stats - * C2C Tx statistics strings. - */ -struct nss_stats_info nss_c2c_tx_strings_stats[NSS_C2C_TX_STATS_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_byts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_byts" , NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops" , NSS_STATS_TYPE_DROP}, - {"pbuf_simple" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_sg" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_returning" , NSS_STATS_TYPE_SPECIAL} -}; - - -/* - * nss_c2c_tx_strings_read() - * Read c2c Tx node statistics names - */ -static ssize_t nss_c2c_tx_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_c2c_tx_strings_stats, NSS_C2C_TX_STATS_MAX); -} - -/* - * nss_c2c_tx_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(c2c_tx); - -/* - * nss_c2c_tx_strings_dentry_create() - * Create C2C Tx statistics strings debug entry. - */ -void nss_c2c_tx_strings_dentry_create(void) -{ - nss_strings_create_dentry("c2c_tx", &nss_c2c_tx_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_strings.h deleted file mode 100644 index 483177de5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_c2c_tx_strings.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_C2C_TX_STRINGS_H -#define __NSS_C2C_TX_STRINGS_H - -extern struct nss_stats_info nss_c2c_tx_strings_stats[NSS_C2C_TX_STATS_MAX]; -extern void nss_c2c_tx_strings_dentry_create(void); - -#endif /* __NSS_C2C_TX_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap.c b/feeds/ipq807x/qca-nss-drv/src/nss_capwap.c deleted file mode 100644 index 597c31814..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap.c +++ /dev/null @@ -1,606 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - - /* - * nss_capwap.c - * NSS CAPWAP driver interface APIs - */ -#include "nss_core.h" -#include "nss_capwap.h" -#include "nss_cmn.h" -#include "nss_tx_rx_common.h" -#include "nss_capwap_stats.h" -#include "nss_capwap_log.h" -#include "nss_capwap_strings.h" - -/* - * Spinlock for protecting tunnel operations colliding with a tunnel destroy - */ -DEFINE_SPINLOCK(nss_capwap_spinlock); - -/* - * Array of pointer for NSS CAPWAP handles. Each handle has per-tunnel - * stats based on the if_num which is an index. - * - * Per CAPWAP tunnel/interface number instance. - */ -struct nss_capwap_handle { - atomic_t refcnt; /**< Reference count on the tunnel */ - uint32_t if_num; /**< Interface number */ - uint32_t tunnel_status; /**< 0=disable, 1=enabled */ - struct nss_ctx_instance *ctx; /**< Pointer to context */ - nss_capwap_msg_callback_t msg_callback; /**< Msg callback */ - void *app_data; /**< App data (argument) */ - struct nss_capwap_tunnel_stats stats; /**< Stats per-interface number */ -}; -static struct nss_capwap_handle *nss_capwap_hdl[NSS_MAX_DYNAMIC_INTERFACES]; - -/* - * nss_capwap_get_interface_type() - * Function to get the type of dynamic interface. - */ -static enum nss_dynamic_interface_type nss_capwap_get_interface_type(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx; - nss_ctx = &nss_top_main.nss[nss_top_main.capwap_handler_id]; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - return nss_dynamic_interface_get_type(nss_ctx, if_num); -} - -/* - * nss_capwap_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_capwap_verify_if_num(uint32_t if_num) -{ - enum nss_dynamic_interface_type type; - - if (nss_is_dynamic_interface(if_num) == false) { - return false; - } - - type = nss_capwap_get_interface_type(if_num); - if ((type != NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER) && (type != NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER) ) { - return false; - } - - return true; -} - -/* - * nss_capwap_refcnt_inc() - * Increments refcnt on the tunnel. - */ -static void nss_capwap_refcnt_inc(int32_t if_num) -{ - if_num = if_num - NSS_DYNAMIC_IF_START; - atomic_inc(&nss_capwap_hdl[if_num]->refcnt); - nss_assert(atomic_read(&nss_capwap_hdl[if_num]->refcnt) > 0); -} - -/* - * nss_capwap_refcnt_dec() - * Decrements refcnt on the tunnel. - */ -static void nss_capwap_refcnt_dec(int32_t if_num) -{ - if_num = if_num - NSS_DYNAMIC_IF_START; - nss_assert(atomic_read(&nss_capwap_hdl[if_num]->refcnt) > 0); - atomic_dec(&nss_capwap_hdl[if_num]->refcnt); -} - -/* - * nss_capwap_refcnt_get() - * Get refcnt on the tunnel. - */ -static uint32_t nss_capwap_refcnt_get(int32_t if_num) -{ - if_num = if_num - NSS_DYNAMIC_IF_START; - return atomic_read(&nss_capwap_hdl[if_num]->refcnt); -} - -/* - * nss_capwap_set_msg_callback() - * This sets the message callback handler and its associated context - */ -static void nss_capwap_set_msg_callback(int32_t if_num, nss_capwap_msg_callback_t cb, void *app_data) -{ - struct nss_capwap_handle *h; - - h = nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START]; - if (!h) { - return; - } - - h->app_data = app_data; - h->msg_callback = cb; -} - -/* - * nss_capwap_get_msg_callback() - * This gets the message callback handler and its associated context - */ -static nss_capwap_msg_callback_t nss_capwap_get_msg_callback(int32_t if_num, void **app_data) -{ - struct nss_capwap_handle *h; - - h = nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START]; - if (!h) { - *app_data = NULL; - return NULL; - } - - *app_data = h->app_data; - return h->msg_callback; -} - -/* - * nss_capwap_update_stats() - * Update per-tunnel stats for each CAPWAP interface. - */ -static void nss_capwap_update_stats(struct nss_capwap_handle *handle, struct nss_capwap_stats_msg *fstats) -{ - struct nss_capwap_tunnel_stats *stats; - enum nss_dynamic_interface_type type; - - stats = &handle->stats; - type = nss_capwap_get_interface_type(handle->if_num); - - switch(type) { - case NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER: - stats->rx_segments += fstats->rx_segments; - stats->dtls_pkts += fstats->dtls_pkts; - stats->rx_dup_frag += fstats->rx_dup_frag; - stats->rx_oversize_drops += fstats->rx_oversize_drops; - stats->rx_frag_timeout_drops += fstats->rx_frag_timeout_drops; - stats->rx_n2h_drops += fstats->rx_n2h_drops; - stats->rx_n2h_queue_full_drops += fstats->rx_n2h_queue_full_drops; - stats->rx_mem_failure_drops += fstats->rx_mem_failure_drops; - stats->rx_csum_drops += fstats->rx_csum_drops; - stats->rx_malformed += fstats->rx_malformed; - stats->rx_frag_gap_drops += fstats->rx_frag_gap_drops; - - /* - * Update pnode rx stats for OUTER node. - */ - stats->pnode_stats.rx_packets += fstats->pnode_stats.rx_packets; - stats->pnode_stats.rx_bytes += fstats->pnode_stats.rx_bytes; - stats->pnode_stats.rx_dropped += nss_cmn_rx_dropped_sum(&fstats->pnode_stats); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER: - stats->tx_segments += fstats->tx_segments; - stats->tx_queue_full_drops += fstats->tx_queue_full_drops; - stats->tx_mem_failure_drops += fstats->tx_mem_failure_drops; - stats->tx_dropped_sg_ref += fstats->tx_dropped_sg_ref; - stats->tx_dropped_ver_mis += fstats->tx_dropped_ver_mis; - stats->tx_dropped_hroom += fstats->tx_dropped_hroom; - stats->tx_dropped_dtls += fstats->tx_dropped_dtls; - stats->tx_dropped_nwireless += fstats->tx_dropped_nwireless; - - /* - * Update pnode tx stats for INNER node. - */ - stats->pnode_stats.tx_packets += fstats->pnode_stats.tx_packets; - stats->pnode_stats.tx_bytes += fstats->pnode_stats.tx_bytes; - stats->tx_dropped_inner += nss_cmn_rx_dropped_sum(&fstats->pnode_stats); - break; - - default: - nss_warning("%px: Received invalid dynamic interface type: %d", handle, type); - nss_assert(0); - return; - } - - /* - * Set to 1 when the tunnel is operating in fast memory. - */ - stats->fast_mem = fstats->fast_mem; -} - -/* - * nss_capwap_handler() - * Handle NSS -> HLOS messages for CAPWAP - */ -static void nss_capwap_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_capwap_msg *ntm = (struct nss_capwap_msg *)ncm; - nss_capwap_msg_callback_t cb; - - /* - * Is this a valid request/response packet? - */ - if (ncm->type > NSS_CAPWAP_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for CAPWAP interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_capwap_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_capwap_log_rx_msg(ntm); - - switch (ntm->cm.type) { - case NSS_CAPWAP_MSG_TYPE_SYNC_STATS: { - uint32_t if_num; - - if_num = ncm->interface - NSS_DYNAMIC_IF_START; - if (nss_capwap_hdl[if_num] != NULL) { - /* - * Update driver statistics and send statistics notifications to the registered modules. - */ - nss_capwap_update_stats(nss_capwap_hdl[if_num], &ntm->msg.stats); - nss_capwap_stats_notify(ncm->interface, nss_ctx->id); - } - } - } - - /* - * Update the callback and app_data for NOTIFY messages. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_capwap_get_msg_callback(ncm->interface, (void **)&ncm->app_data); - } - - /* - * Do we have a callback - */ - if (!ncm->cb) { - nss_trace("%px: cb is null for interface %d", nss_ctx, ncm->interface); - return; - } - - cb = (nss_capwap_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ntm); -} - -/* - * nss_capwap_instance_alloc() - * Allocate CAPWAP tunnel instance - */ -static bool nss_capwap_instance_alloc(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_capwap_handle *h; - - /* - * Allocate a handle - */ - h = kmalloc(sizeof(struct nss_capwap_handle), GFP_ATOMIC); - if (h == NULL) { - nss_warning("%px: no memory for allocating CAPWAP instance for interface : %d", nss_ctx, if_num); - return false; - } - - memset(h, 0, sizeof(struct nss_capwap_handle)); - h->if_num = if_num; - - spin_lock_bh(&nss_capwap_spinlock); - if (nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START] != NULL) { - spin_unlock_bh(&nss_capwap_spinlock); - kfree(h); - nss_warning("%px: Another thread is already allocated instance for :%d", nss_ctx, if_num); - return false; - } - - nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START] = h; - spin_unlock_bh(&nss_capwap_spinlock); - - return true; -} - -/* - * nss_capwap_tx_msg() - * Transmit a CAPWAP message to NSS FW. Don't call this from softirq/interrupts. - */ -nss_tx_status_t nss_capwap_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_capwap_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - int32_t status; - int32_t if_num; - - BUG_ON(in_interrupt()); - BUG_ON(in_softirq()); - BUG_ON(in_serving_softirq()); - - if (nss_capwap_verify_if_num(msg->cm.interface) == false) { - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ncm->type >= NSS_CAPWAP_MSG_TYPE_MAX) { - return NSS_TX_FAILURE_BAD_PARAM; - } - - if_num = msg->cm.interface - NSS_DYNAMIC_IF_START; - spin_lock_bh(&nss_capwap_spinlock); - if (!nss_capwap_hdl[if_num]) { - spin_unlock_bh(&nss_capwap_spinlock); - nss_warning("%px: capwap tunnel if_num is not there: %d", nss_ctx, msg->cm.interface); - return NSS_TX_FAILURE_BAD_PARAM; - } - nss_capwap_refcnt_inc(msg->cm.interface); - spin_unlock_bh(&nss_capwap_spinlock); - - /* - * Trace messages. - */ - nss_capwap_log_tx_msg(msg); - - status = nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); - nss_capwap_refcnt_dec(msg->cm.interface); - return status; -} -EXPORT_SYMBOL(nss_capwap_tx_msg); - -/* - * nss_capwap_tx_buf() - * Transmit data buffer (skb) to a NSS interface number - */ -nss_tx_status_t nss_capwap_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - BUG_ON(!nss_capwap_verify_if_num(if_num)); - - return nss_core_send_packet(nss_ctx, os_buf, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER | H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_capwap_tx_buf); - -/* - *********************************** - * Register/Unregister/Miscellaneous APIs - *********************************** - */ - -/* - * nss_capwap_get_stats() - * API for getting stats from a CAPWAP tunnel interface stats - */ -bool nss_capwap_get_stats(uint32_t if_num, struct nss_capwap_tunnel_stats *stats) -{ - if (nss_capwap_verify_if_num(if_num) == false) { - return false; - } - - if_num = if_num - NSS_DYNAMIC_IF_START; - spin_lock_bh(&nss_capwap_spinlock); - if (nss_capwap_hdl[if_num] == NULL) { - spin_unlock_bh(&nss_capwap_spinlock); - return false; - } - - memcpy(stats, &nss_capwap_hdl[if_num]->stats, sizeof(struct nss_capwap_tunnel_stats)); - spin_unlock_bh(&nss_capwap_spinlock); - return true; -} -EXPORT_SYMBOL(nss_capwap_get_stats); - -/* - * nss_capwap_notify_register() - * Registers a message notifier with NSS FW. It should not be called from - * softirq or interrupts. - */ -struct nss_ctx_instance *nss_capwap_notify_register(uint32_t if_num, nss_capwap_msg_callback_t cb, void *app_data) -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.capwap_handler_id]; - - if (nss_capwap_verify_if_num(if_num) == false) { - nss_warning("%px: notfiy register received for invalid interface %d", nss_ctx, if_num); - return NULL; - } - - spin_lock_bh(&nss_capwap_spinlock); - if (nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START] != NULL) { - spin_unlock_bh(&nss_capwap_spinlock); - nss_warning("%px: notfiy register tunnel already exists for interface %d", nss_ctx, if_num); - return NULL; - } - spin_unlock_bh(&nss_capwap_spinlock); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_capwap_notify_register); - -/* - * nss_capwap_notify_unregister() - * unregister the CAPWAP notifier for the given interface number (if_num). - * It shouldn't be called from softirq or interrupts. - */ -nss_tx_status_t nss_capwap_notify_unregister(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_top_instance *nss_top; - int index; - - if (nss_capwap_verify_if_num(if_num) == false) { - nss_warning("%px: notify unregister received for invalid interface %d", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nss_top = nss_ctx->nss_top; - if (nss_top == NULL) { - nss_warning("%px: notify unregister received for invalid nss_top %d", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - index = if_num - NSS_DYNAMIC_IF_START; - spin_lock_bh(&nss_capwap_spinlock); - if (nss_capwap_hdl[index] == NULL) { - spin_unlock_bh(&nss_capwap_spinlock); - nss_warning("%px: notify unregister received for unallocated if_num: %d", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * It's the responsibility of caller to wait and call us again. We return failure saying - * that we can't remove msg handler now. - */ - if (nss_capwap_refcnt_get(if_num) != 0) { - spin_unlock_bh(&nss_capwap_spinlock); - nss_warning("%px: notify unregister tunnel %d: has reference", nss_ctx, if_num); - return NSS_TX_FAILURE_QUEUE; - } - - nss_capwap_set_msg_callback(if_num, NULL, NULL); - spin_unlock_bh(&nss_capwap_spinlock); - - return NSS_TX_SUCCESS; -} -EXPORT_SYMBOL(nss_capwap_notify_unregister); - -/* - * nss_capwap_data_register() - * Registers a data packet notifier with NSS FW. - */ -struct nss_ctx_instance *nss_capwap_data_register(uint32_t if_num, nss_capwap_buf_callback_t cb, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx; - int core_status; - - nss_ctx = nss_capwap_get_ctx(); - if (nss_capwap_verify_if_num(if_num) == false) { - nss_warning("%px: data register received for invalid interface %d", nss_ctx, if_num); - return NULL; - } - - spin_lock_bh(&nss_capwap_spinlock); - if (nss_ctx->subsys_dp_register[if_num].ndev != NULL) { - spin_unlock_bh(&nss_capwap_spinlock); - return NULL; - } - spin_unlock_bh(&nss_capwap_spinlock); - - core_status = nss_core_register_handler(nss_ctx, if_num, nss_capwap_msg_handler, NULL); - if (core_status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: nss core register handler failed for if_num:%d with error :%d", nss_ctx, if_num, core_status); - return NULL; - } - - if (nss_capwap_instance_alloc(nss_ctx, if_num) == false) { - nss_warning("%px: couldn't allocate tunnel instance for if_num:%d", nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, cb, NULL, NULL, netdev, features); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_capwap_data_register); - -/* - * nss_capwap_data_unregister() - * Unregister a data packet notifier with NSS FW - */ -bool nss_capwap_data_unregister(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx; - struct nss_capwap_handle *h; - - nss_ctx = nss_capwap_get_ctx(); - if (nss_capwap_verify_if_num(if_num) == false) { - nss_warning("%px: data unregister received for invalid interface %d", nss_ctx, if_num); - return false; - } - - spin_lock_bh(&nss_capwap_spinlock); - /* - * It's the responsibility of caller to wait and call us again. - */ - if (nss_capwap_refcnt_get(if_num) != 0) { - spin_unlock_bh(&nss_capwap_spinlock); - nss_warning("%px: notify unregister tunnel %d: has reference", nss_ctx, if_num); - return false; - } - h = nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START]; - nss_capwap_hdl[if_num - NSS_DYNAMIC_IF_START] = NULL; - spin_unlock_bh(&nss_capwap_spinlock); - - (void) nss_core_unregister_handler(nss_ctx, if_num); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - kfree(h); - return true; -} -EXPORT_SYMBOL(nss_capwap_data_unregister); - -/* - * nss_capwap_get_ctx() - * Return a CAPWAP NSS context. - */ -struct nss_ctx_instance *nss_capwap_get_ctx() -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.capwap_handler_id]; - return nss_ctx; -} -EXPORT_SYMBOL(nss_capwap_get_ctx); - -/* - * nss_capwap_ifnum_with_core_id() - * Append core id to capwap interface num - */ -int nss_capwap_ifnum_with_core_id(int if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_capwap_get_ctx(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (nss_is_dynamic_interface(if_num) == false) { - nss_info("%px: Invalid if_num: %d, must be a dynamic interface\n", nss_ctx, if_num); - return 0; - } - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_capwap_ifnum_with_core_id); - -/* - * nss_capwap_get_max_buf_size() - * Return a CAPWAP NSS max_buf_size. - */ -uint32_t nss_capwap_get_max_buf_size(struct nss_ctx_instance *nss_ctx) -{ - return nss_core_get_max_buf_size(nss_ctx); -} -EXPORT_SYMBOL(nss_capwap_get_max_buf_size); - -/* - * nss_capwap_init() - * Initializes CAPWAP. Gets called from nss_init.c - */ -void nss_capwap_init() -{ - memset(&nss_capwap_hdl, 0, sizeof(nss_capwap_hdl)); - nss_capwap_stats_dentry_create(); - nss_capwap_strings_dentry_create(); -} - -/* - * nss_capwap_msg_init() - * Initialize capwap message. - */ -void nss_capwap_msg_init(struct nss_capwap_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, - nss_capwap_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, (void*)cb, app_data); -} -EXPORT_SYMBOL(nss_capwap_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_log.c deleted file mode 100644 index b0b8564ac..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_log.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_capwap_log.c - * NSS CAPWAP logger file. - */ - -#include "nss_core.h" - -/* - * nss_capwap_log_message_types_str - * CAPWAP message strings - */ -static int8_t *nss_capwap_log_message_types_str[NSS_CAPWAP_MSG_TYPE_MAX] __maybe_unused = { - "No Message", - "CAPWAP config Rule", - "CAPWAP unconfig Rule", - "CAPWAP Enable Tunnel", - "CAPWAP Disable Tunnel", - "CAPWAP Update Path MTU", - "CAPWAP Sync Stats", - "CAPWAP Version", - "CAPWAP DTLS", - "CAPWAP Add Flow Rule", - "CAPWAP Delete Flow Rule" -}; - -/* - * nss_capwap_log_error_response_types_str - * Strings for error types for CAPWAP messages - */ -static int8_t *nss_capwap_log_error_response_types_str[NSS_CAPWAP_ERROR_MSG_MAX] __maybe_unused = { - "CAPWAP Invalid Reassembly Timeout", - "CAPWAP Invalid PAth MTU", - "CAPWAP Invalid Max Fragment", - "CAPWAP Invalid Buffer Size", - "CAPWAP Invalid L3 Protocool", - "CAPWAP Invalid UDP Protocol", - "CAPWAP Invalid Version", - "CAPWAP Tunnel Disabled", - "CAPWAP Tunnel Enabled", - "CAPWAP Tunnel Not Configured", - "CAPWAP Invalid IP Node", - "CAPWAP Invalid Type Flag", - "CAPWAP Inavlid DTLS Config", - "CAPWAP Flow Table Full", - "CAPWAP Flow Exists", - "CAPWAP Flow Does Not Exist" -}; - -/* - * nss_capwap_rule_msg() - * Log NSS CAPWAP stats message. - */ -static void nss_capwap_rule_msg(struct nss_capwap_msg *ncm) -{ - struct nss_capwap_rule_msg *ncrm __maybe_unused = &ncm->msg.rule; - nss_trace("%px: NSS CAPWAP Rule message \n" - "Encap Rule Src IP: %px\n" - "Encap Rule Src Port: %d\n" - "Encap Rule Dst Ip: %px\n" - "Encap Rule Dst Port: %d\n" - "Encap Rule Path MTU: %d\n" - "Decap Rule Reassembly Timeout: %d\n" - "Decap Rule Max Fragments: %d\n" - "Decap Rule Max Buffer Size: %d\n" - "Stats Timer: %d\n" - "RPS: %d\n" - "Type Flags: %x\n" - "L3 Protocol: %d\n" - "UDP Protocol: %d\n" - "MTU: %d\n" - "GMAC Interface Number: %d\n" - "Enabled Features: %x\n" - "DTLS Interface Number: %d\n" - "BSSID: %px\n" - "Outer Segment Value: %x\n", - ncrm, - &ncrm->encap.src_ip.ip, - ncrm->encap.src_port, - &ncrm->encap.dest_ip.ip, - ncrm->encap.dest_port, - ncrm->encap.path_mtu, - ncrm->decap.reassembly_timeout, - ncrm->decap.max_fragments, - ncrm->decap.max_buffer_size, - ncrm->stats_timer, - ncrm->rps, ncrm->type_flags, - ncrm->l3_proto, ncrm->which_udp, - ncrm->mtu_adjust, ncrm->gmac_ifnum, - ncrm->enabled_features, - ncrm->dtls_inner_if_num, - &ncrm->bssid, ncrm->outer_sgt_value); -} - -/* - * nss_capwap_path_mtu_msg() - * Log NSS CAPWAP path MTU message. - */ -static void nss_capwap_path_mtu_msg(struct nss_capwap_msg *ncm) -{ - struct nss_capwap_path_mtu_msg *ncpmm __maybe_unused = &ncm->msg.mtu; - nss_trace("%px: NSS CAPWAP Path MTU message \n" - "CAPWAP Path MTU: %d\n", - ncpmm, - ncpmm->path_mtu); -} - -/* - * nss_capwap_version_msg() - * Log NSS CAPWAP version message. - */ -static void nss_capwap_version_msg(struct nss_capwap_msg *ncm) -{ - struct nss_capwap_version_msg *ncvm __maybe_unused = &ncm->msg.version; - nss_trace("%px: NSS CAPWAP Version message \n" - "CAPWAP Version: %d\n", - ncvm, - ncvm->version); -} - -/* - * nss_capwap_dtls_msg() - * Log NSS CAPWAP dtls message. - */ -static void nss_capwap_dtls_msg(struct nss_capwap_msg *ncm) -{ - struct nss_capwap_dtls_msg *ncdm __maybe_unused = &ncm->msg.dtls; - nss_trace("%px: NSS CAPWAP dtls message \n" - "CAPWAP DTLS Enable: %d\n" - "CAPWAP DTLS Inner Interface Number: %d\n" - "CAPWAP MTU Adjust: %d\n" - "CAPWAP Reserved: %x\n", - ncdm, - ncdm->enable, ncdm->dtls_inner_if_num, - ncdm->mtu_adjust, ncdm->reserved); -} - -/* - * nss_capwap_flow_rule_msg() - * Log NSS CAPWAP flow rule message. - */ -static void nss_capwap_flow_rule_msg(struct nss_capwap_flow_rule_msg *ncfrm) -{ - nss_trace("%px: NSS CAPWAP Flow Rule message \n" - "CAPWAP IP Version: %d\n" - "CAPWAP Layer 4 Protocol: %d\n" - "CAPWAP Source Port: %d\n" - "CAPWAP Destination Port: %d\n" - "CAPWAP Source IP: %x %x %x %x\n" - "CAPWAP Destination IP: %x %x %x %x" - "CAPWAP Flow ID: %d", - ncfrm, - ncfrm->ip_version, ncfrm->protocol, - ncfrm->src_port, ncfrm->dst_port, - ncfrm->src_ip[0], ncfrm->src_ip[1], - ncfrm->src_ip[2], ncfrm->src_ip[3], - ncfrm->dst_ip[0], ncfrm->dst_ip[1], - ncfrm->dst_ip[2], ncfrm->dst_ip[3], - ncfrm->flow_id); -} - -/* - * nss_capwap_flow_rule_add_msg() - * Log NSS CAPWAP flow rule add message. - */ -static void nss_capwap_flow_rule_add_msg(struct nss_capwap_msg *ncm) -{ - struct nss_capwap_flow_rule_msg *ncfrm __maybe_unused = &ncm->msg.flow_rule_add; - nss_capwap_flow_rule_msg(ncfrm); -} - -/* - * nss_capwap_flow_rule_del_msg() - * Log NSS CAPWAP flow rule del message. - */ -static void nss_capwap_flow_rule_del_msg(struct nss_capwap_msg *ncm) -{ - struct nss_capwap_flow_rule_msg *ncfrm __maybe_unused = &ncm->msg.flow_rule_del; - nss_capwap_flow_rule_msg(ncfrm); -} - -/* - * nss_capwap_log_verbose() - * Log message contents. - */ -static void nss_capwap_log_verbose(struct nss_capwap_msg *ncm) -{ - switch (ncm->cm.type) { - case NSS_CAPWAP_MSG_TYPE_CFG_RULE: - nss_capwap_rule_msg(ncm); - break; - - case NSS_CAPWAP_MSG_TYPE_UPDATE_PATH_MTU: - nss_capwap_path_mtu_msg(ncm); - break; - - case NSS_CAPWAP_MSG_TYPE_VERSION: - nss_capwap_version_msg(ncm); - break; - - case NSS_CAPWAP_MSG_TYPE_DTLS: - nss_capwap_dtls_msg(ncm); - break; - - case NSS_CAPWAP_MSG_TYPE_FLOW_RULE_ADD: - nss_capwap_flow_rule_add_msg(ncm); - break; - - case NSS_CAPWAP_MSG_TYPE_FLOW_RULE_DEL: - nss_capwap_flow_rule_del_msg(ncm); - break; - - default: - nss_trace("%px: Invalid message type\n", ncm); - break; - } -} - -/* - * nss_capwap_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_capwap_log_tx_msg(struct nss_capwap_msg *ncm) -{ - if (ncm->cm.type >= NSS_CAPWAP_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", ncm); - return; - } - - nss_info("%px: type[%d]:%s\n", ncm, ncm->cm.type, nss_capwap_log_message_types_str[ncm->cm.type]); - nss_capwap_log_verbose(ncm); -} - -/* - * nss_capwap_log_rx_msg() - * Log messages received from FW. - */ -void nss_capwap_log_rx_msg(struct nss_capwap_msg *ncm) -{ - if (ncm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ncm); - return; - } - - if (ncm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ncm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ncm, ncm->cm.type, - nss_capwap_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response]); - goto verbose; - } - - if (ncm->cm.error >= NSS_CAPWAP_ERROR_MSG_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ncm, ncm->cm.type, nss_capwap_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ncm, ncm->cm.type, nss_capwap_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error, nss_capwap_log_error_response_types_str[ncm->cm.error]); - -verbose: - nss_capwap_log_verbose(ncm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_log.h deleted file mode 100644 index f62098979..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_CAPWAP_LOG_H__ -#define __NSS_CAPWAP_LOG_H__ - -/* - * nss_capwap_log.h - * NSS CAPWAP Log Header File. - */ - -/* - * nss_capwap_log_tx_msg - * Logs a CAPWAP message that is sent to the NSS firmware. - */ -void nss_capwap_log_tx_msg(struct nss_capwap_msg *ncm); - -/* - * nss_capwap_log_rx_msg - * Logs a CAPWAP message that is received from the NSS firmware. - */ -void nss_capwap_log_rx_msg(struct nss_capwap_msg *ncm); - -#endif /* __NSS_CAPWAP_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.c deleted file mode 100644 index 1d4387808..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_drv_stats.h" -#include "nss_core.h" -#include "nss_capwap.h" -#include "nss_capwap_stats.h" -#include "nss_capwap_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_capwap_stats_notifier); - -/* - * nss_capwap_stats_encap() - * Make a row for CAPWAP encap stats. - */ -static ssize_t nss_capwap_stats_encap(char *line, int len, int i, struct nss_capwap_tunnel_stats *s) -{ - uint64_t tcnt = 0; - - switch (i) { - case 0: - tcnt = s->pnode_stats.tx_packets; - break; - case 1: - tcnt = s->pnode_stats.tx_bytes; - break; - case 2: - tcnt = s->tx_segments; - break; - case 3: - tcnt = s->tx_dropped_sg_ref; - break; - case 4: - tcnt = s->tx_dropped_ver_mis; - break; - case 5: - tcnt = s->tx_dropped_inner; - break; - case 6: - tcnt = s->tx_dropped_hroom; - break; - case 7: - tcnt = s->tx_dropped_dtls; - break; - case 8: - tcnt = s->tx_dropped_nwireless; - break; - case 9: - tcnt = s->tx_queue_full_drops; - break; - case 10: - tcnt = s->tx_mem_failure_drops; - break; - case 11: - tcnt = s->fast_mem; - break; - default: - return 0; - } - - return snprintf(line, len, "%s = %llu\n", nss_capwap_strings_encap_stats[i].stats_name, tcnt); -} - -/* - * nss_capwap_stats_decap() - * Make a row for CAPWAP decap stats. - */ -static ssize_t nss_capwap_stats_decap(char *line, int len, int i, struct nss_capwap_tunnel_stats *s) -{ - uint64_t tcnt = 0; - - switch (i) { - case 0: - tcnt = s->pnode_stats.rx_packets; - break; - case 1: - tcnt = s->pnode_stats.rx_bytes; - break; - case 2: - tcnt = s->dtls_pkts; - break; - case 3: - tcnt = s->rx_segments; - break; - case 4: - tcnt = s->pnode_stats.rx_dropped; - break; - case 5: - tcnt = s->rx_oversize_drops; - break; - case 6: - tcnt = s->rx_frag_timeout_drops; - break; - case 7: - tcnt = s->rx_dup_frag; - break; - case 8: - tcnt = s->rx_frag_gap_drops; - break; - case 9: - tcnt = s->rx_n2h_drops; - return snprintf(line, len, "%s = %llu (n2h = %llu)\n", nss_capwap_strings_decap_stats[i].stats_name, tcnt, s->rx_n2h_queue_full_drops); - case 10: - tcnt = s->rx_n2h_queue_full_drops; - break; - case 11: - tcnt = s->rx_mem_failure_drops; - break; - case 12: - tcnt = s->rx_csum_drops; - break; - case 13: - tcnt = s->rx_malformed; - break; - case 14: - tcnt = s->fast_mem; - break; - default: - return 0; - } - - return snprintf(line, len, "%s = %llu\n", nss_capwap_strings_decap_stats[i].stats_name, tcnt); -} - -/* - * nss_capwap_stats_read() - * Read CAPWAP stats - */ -static ssize_t nss_capwap_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos, uint16_t type) -{ - struct nss_stats_data *data = fp->private_data; - ssize_t bytes_read = 0; - struct nss_capwap_tunnel_stats stats; - size_t bytes; - char line[80]; - int start; - uint32_t if_num = NSS_DYNAMIC_IF_START; - uint32_t max_if_num = NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES; - - if (data) { - if_num = data->if_num; - } - - /* - * If we are done accomodating all the CAPWAP tunnels. - */ - if (if_num > max_if_num) { - return 0; - } - - for (; if_num <= max_if_num; if_num++) { - bool isthere; - enum nss_dynamic_interface_type dtype; - - if (nss_is_dynamic_interface(if_num) == false) { - continue; - } - - dtype = nss_dynamic_interface_get_type(nss_capwap_get_ctx(), if_num); - - /* - * Read encap stats from inner node and decap stats from outer node. - */ - if ((type == 1) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER)) { - continue; - } - - if ((type == 0) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER)) { - continue; - } - - /* - * If CAPWAP tunnel does not exists, then isthere will be false. - */ - isthere = nss_capwap_get_stats(if_num, &stats); - if (!isthere) { - continue; - } - - bytes = snprintf(line, sizeof(line), "----if_num : %2d----\n", if_num); - if ((bytes_read + bytes) > sz) { - break; - } - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - bytes_read = -EFAULT; - goto fail; - } - bytes_read += bytes; - start = 0; - while (bytes_read < sz) { - if (type == 1) { - bytes = nss_capwap_stats_encap(line, sizeof(line), start, &stats); - } else { - bytes = nss_capwap_stats_decap(line, sizeof(line), start, &stats); - } - - /* - * If we don't have any more lines in decap/encap. - */ - if (bytes == 0) { - break; - } - - if ((bytes_read + bytes) > sz) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) { - bytes_read = -EFAULT; - goto fail; - } - - bytes_read += bytes; - start++; - } - } - - if (bytes_read > 0) { - *ppos = bytes_read; - } - - if (data) { - data->if_num = if_num; - } -fail: - return bytes_read; -} - -/* - * nss_capwap_decap_stats_read() - * Read CAPWAP decap stats - */ -static ssize_t nss_capwap_decap_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_capwap_stats_read(fp, ubuf, sz, ppos, 0); -} - -/* - * nss_capwap_encap_stats_read() - * Read CAPWAP encap stats - */ -static ssize_t nss_capwap_encap_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_capwap_stats_read(fp, ubuf, sz, ppos, 1); -} - -/* - * nss_capwap_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(capwap_encap); -NSS_STATS_DECLARE_FILE_OPERATIONS(capwap_decap); - -/* - * nss_capwap_stats_dentry_create() - * Create CAPWAP statistics debug entry - */ -void nss_capwap_stats_dentry_create(void) -{ - nss_stats_create_dentry("capwap_encap", &nss_capwap_encap_stats_ops); - nss_stats_create_dentry("capwap_decap", &nss_capwap_decap_stats_ops); -} - -/* - * nss_capwap_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_capwap_stats_notify(uint32_t if_num, uint32_t core_id) -{ - struct nss_capwap_stats_notification capwap_stats; - - capwap_stats.core_id = core_id; - capwap_stats.if_num = if_num; - nss_capwap_get_stats(if_num, &capwap_stats.stats); - atomic_notifier_call_chain(&nss_capwap_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&capwap_stats); -} - -/* - * nss_capwap_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_capwap_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_capwap_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_capwap_stats_register_notifier); - -/* - * nss_capwap_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_capwap_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_capwap_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_capwap_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.h deleted file mode 100644 index c1033ec15..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_stats.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017,2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_CAPWAP_STATS_H__ -#define __NSS_CAPWAP_STATS_H__ - -/* - * CAPWAP statistics APIs - */ -extern void nss_capwap_stats_notify(uint32_t if_num, uint32_t core_id); -extern void nss_capwap_stats_dentry_create(void); - -#endif /* __NSS_CAPWAP_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.c deleted file mode 100644 index 266cd50b8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" -#include "nss_capwap_strings.h" - -/* - * nss_capwap_strings_encap_stats - * CAPWAP encap statistics string. - */ -struct nss_stats_info nss_capwap_strings_encap_stats[NSS_CAPWAP_STATS_ENCAP_MAX] = { - {"tx_packets", NSS_STATS_TYPE_COMMON}, - {"tx_bytes", NSS_STATS_TYPE_COMMON}, - {"tx_segments", NSS_STATS_TYPE_SPECIAL}, - {"tx_drop_seg_ref", NSS_STATS_TYPE_DROP}, - {"tx_drop_ver_mismatch",NSS_STATS_TYPE_DROP}, - {"tx_dropped_inner", NSS_STATS_TYPE_DROP}, - {"tx_drop_hroom", NSS_STATS_TYPE_DROP}, - {"tx_drop_DTLS", NSS_STATS_TYPE_DROP}, - {"tx_drop_nwireless", NSS_STATS_TYPE_DROP}, - {"tx_drop_qfull", NSS_STATS_TYPE_DROP}, - {"tx_drop_mem_fail", NSS_STATS_TYPE_DROP}, - {"fast_mem", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_capwap_encap_strings_read() - * Read CAPWAP encap statistics names. - */ -static ssize_t nss_capwap_encap_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_capwap_strings_encap_stats, NSS_CAPWAP_STATS_ENCAP_MAX); -} - -/* - * nss_capwap_encap_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(capwap_encap); - -/* - * nss_capwap_strings_decap_stats - * CAPWAP decap statistics string. - */ -struct nss_stats_info nss_capwap_strings_decap_stats[NSS_CAPWAP_STATS_DECAP_MAX] = { - {"rx_packets", NSS_STATS_TYPE_COMMON}, - {"rx_bytes", NSS_STATS_TYPE_COMMON}, - {"rx_DTLS_pkts", NSS_STATS_TYPE_SPECIAL}, - {"rx_segments", NSS_STATS_TYPE_SPECIAL}, - {"rx_dropped", NSS_STATS_TYPE_DROP}, - {"rx_drop_oversize", NSS_STATS_TYPE_DROP}, - {"rx_drop_frag_timeout",NSS_STATS_TYPE_DROP}, - {"rx_drop_frag_dup", NSS_STATS_TYPE_DROP}, - {"rx_drop_frag_gap", NSS_STATS_TYPE_DROP}, - {"rx_drop_n2h", NSS_STATS_TYPE_DROP}, - {"rx_drop_n2h_qfull", NSS_STATS_TYPE_DROP}, - {"rx_drop_mem_fail", NSS_STATS_TYPE_DROP}, - {"rx_drop_csum", NSS_STATS_TYPE_DROP}, - {"rx_drop_malformed", NSS_STATS_TYPE_DROP}, - {"fast_mem", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_capwap_decap_strings_read() - * Read CAPWAP decap statistics names. - */ -static ssize_t nss_capwap_decap_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_capwap_strings_decap_stats, NSS_CAPWAP_STATS_DECAP_MAX); -} - -/* - * nss_capwap_decap_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(capwap_decap); - -/* - * nss_capwap_strings_dentry_create() - * Create CAPWAP statistics strings debug entry. - */ -void nss_capwap_strings_dentry_create(void) -{ - nss_strings_create_dentry("capwap_encap", &nss_capwap_encap_strings_ops); - nss_strings_create_dentry("capwap_decap", &nss_capwap_decap_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.h deleted file mode 100644 index 96f89cdce..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_capwap_strings.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_CAPWAP_STRINGS_H -#define __NSS_CAPWAP_STRINGS_H - -#include "nss_capwap_stats.h" - -extern struct nss_stats_info nss_capwap_strings_encap_stats[NSS_CAPWAP_STATS_ENCAP_MAX]; -extern struct nss_stats_info nss_capwap_strings_decap_stats[NSS_CAPWAP_STATS_DECAP_MAX]; -extern void nss_capwap_strings_dentry_create(void); - -#endif /* __NSS_CAPWAP_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap.c b/feeds/ipq807x/qca-nss-drv/src/nss_clmap.c deleted file mode 100644 index 777b71936..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap.c +++ /dev/null @@ -1,346 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - - /* - * nss_clmap.c - * NSS clmap driver interface APIs - */ -#include "nss_core.h" -#include "nss_clmap.h" -#include "nss_cmn.h" -#include "nss_tx_rx_common.h" -#include "nss_clmap_stats.h" -#include "nss_clmap_strings.h" -#include "nss_clmap_log.h" - -#define NSS_CLMAP_TX_TIMEOUT 3000 - -/* - * Private data structure - */ -static struct nss_clmap_pvt { - struct semaphore sem; /* Semaphore structure. */ - struct completion complete; /* Completion structure. */ - int response; /* Response from FW. */ - void *cb; /* Original cb for msgs. */ - void *app_data; /* Original app_data for msgs. */ -} clmap_pvt; - -/* - * nss_clmap_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_clmap_verify_if_num(uint32_t if_num) -{ - uint32_t type = nss_dynamic_interface_get_type(nss_clmap_get_ctx(), if_num); - - return ((type == NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_US) || - (type == NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_DS)); -} - -/* - * nss_clmap_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_clmap_callback(void *app_data, struct nss_clmap_msg *nclm) -{ - clmap_pvt.response = NSS_TX_SUCCESS; - clmap_pvt.cb = NULL; - clmap_pvt.app_data = NULL; - - if (nclm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("clmap Error response %d\n", nclm->cm.response); - clmap_pvt.response = nclm->cm.response; - } - - /* - * Write memory barrier. - */ - smp_wmb(); - complete(&clmap_pvt.complete); -} - -/* - * nss_clmap_handler() - * Handle NSS -> HLOS messages for clmap. - */ -static void nss_clmap_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_clmap_msg *nclm = (struct nss_clmap_msg *)ncm; - nss_clmap_msg_callback_t cb; - - BUG_ON(!nss_clmap_verify_if_num(ncm->interface)); - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_CLMAP_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for clmap interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_clmap_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Trace messages. - */ - nss_core_log_msg_failures(nss_ctx, ncm); - nss_clmap_log_rx_msg(nclm); - - switch (nclm->cm.type) { - case NSS_CLMAP_MSG_TYPE_SYNC_STATS: - nss_clmap_stats_sync(nss_ctx, &nclm->msg.stats, ncm->interface); - nss_clmap_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Do we have a callback - */ - cb = (nss_clmap_msg_callback_t)ncm->cb; - if (!cb) { - nss_trace("%px: cb is null for interface %d", nss_ctx, ncm->interface); - return; - } - - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_clmap_tx_msg() - * Transmit a clmap message to NSS FW. Don't call this from softirq/interrupts. - */ -nss_tx_status_t nss_clmap_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_clmap_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - if (!nss_clmap_verify_if_num(msg->cm.interface)) { - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ncm->type >= NSS_CLMAP_MSG_TYPE_MAX) { - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * Trace messages. - */ - nss_clmap_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_clmap_tx_msg); - -/* - * nss_clmap_tx_msg_sync() - * Transmit a clmap message to NSS firmware synchronously. - */ -nss_tx_status_t nss_clmap_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_clmap_msg *nclm) -{ - nss_tx_status_t status; - int ret; - - down(&clmap_pvt.sem); - nclm->cm.cb = (nss_ptr_t)nss_clmap_callback; - nclm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_clmap_tx_msg(nss_ctx, nclm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: clmap_tx_msg failed\n", nss_ctx); - up(&clmap_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&clmap_pvt.complete, msecs_to_jiffies(NSS_CLMAP_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: clmap tx sync failed due to timeout\n", nss_ctx); - clmap_pvt.response = NSS_TX_FAILURE; - } - - status = clmap_pvt.response; - up(&clmap_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_clmap_tx_msg_sync); - -/* - * nss_clmap_tx_buf() - * Transmit data buffer (skb) to a NSS interface number - */ -nss_tx_status_t nss_clmap_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *buf, uint32_t if_num) -{ - BUG_ON(!nss_clmap_verify_if_num(if_num)); - - return nss_core_send_packet(nss_ctx, buf, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER); -} -EXPORT_SYMBOL(nss_clmap_tx_buf); - -/* - * nss_clmap_unregister() - * Un-register a clmap interface from NSS. - */ -bool nss_clmap_unregister(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx; - int status; - - nss_ctx = nss_clmap_get_ctx(); - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_clmap_verify_if_num(if_num)) { - nss_warning("%px: clmap unregister request received for invalid interface %d", nss_ctx, if_num); - return false; - } - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Failed to unregister handler for clmap NSS I/F:%u\n", nss_ctx, if_num); - return false; - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - nss_core_unregister_handler(nss_ctx, if_num); - nss_clmap_stats_session_unregister(if_num); - - return true; -} -EXPORT_SYMBOL(nss_clmap_unregister); - -/* - * nss_clmap_register() - * Registers a clmap interface with the NSS. - */ -struct nss_ctx_instance *nss_clmap_register(uint32_t if_num, - uint32_t di_type, - nss_clmap_buf_callback_t data_cb, - nss_clmap_msg_callback_t notify_cb, - struct net_device *netdev, - uint32_t features) -{ - struct nss_ctx_instance *nss_ctx; - int core_status; - bool stats_status = false; - - nss_ctx = nss_clmap_get_ctx(); - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_clmap_verify_if_num(if_num)) { - nss_warning("%px: clmap register request received for invalid interface %d", nss_ctx, if_num); - goto fail; - } - - if (di_type == NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_US) { - stats_status = nss_clmap_stats_session_register(if_num, NSS_CLMAP_INTERFACE_TYPE_US, netdev); - } else { - stats_status = nss_clmap_stats_session_register(if_num, NSS_CLMAP_INTERFACE_TYPE_DS, netdev); - } - - if (!stats_status) { - nss_warning("%px: statistics registration failed for interface: %d\n", nss_ctx, if_num); - goto fail; - } - - core_status = nss_core_register_handler(nss_ctx, if_num, nss_clmap_msg_handler, (void *)netdev); - if (core_status != NSS_CORE_STATUS_SUCCESS) { - goto core_reg_fail; - } - - core_status = nss_core_register_msg_handler(nss_ctx, if_num, notify_cb); - if (core_status != NSS_CORE_STATUS_SUCCESS) { - goto msg_reg_fail; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, data_cb, NULL, (void *)netdev, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, di_type); - - return nss_ctx; - -msg_reg_fail: - nss_core_unregister_handler(nss_ctx, if_num); -core_reg_fail: - nss_clmap_stats_session_unregister(if_num); - nss_warning("%px: NSS core register handler failed for if_num:%d with error :%d", nss_ctx, if_num, core_status); -fail: - return NULL; - -} -EXPORT_SYMBOL(nss_clmap_register); - -/* - * nss_clmap_ifnum_with_core_id() - * Append core ID to clmap interface num. - */ -int nss_clmap_ifnum_with_core_id(int if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_clmap_get_ctx(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (!nss_is_dynamic_interface(if_num)) { - nss_warning("%px: Invalid if_num: %d, must be a dynamic interface\n", nss_ctx, if_num); - return 0; - } - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_clmap_ifnum_with_core_id); - -/* - * nss_clmap_msg_init() - * Initialize clmap message. - */ -void nss_clmap_msg_init(struct nss_clmap_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, - nss_clmap_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, (void*)cb, app_data); -} -EXPORT_SYMBOL(nss_clmap_msg_init); - -/* - * nss_clmap_get_ctx() - * Return a clmap NSS context. - */ -struct nss_ctx_instance *nss_clmap_get_ctx() -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.clmap_handler_id]; - return nss_ctx; -} -EXPORT_SYMBOL(nss_clmap_get_ctx); - -/* - * nss_clmap_init() - * Initializes clmap. Gets called from nss_init.c. - */ -void nss_clmap_init() -{ - sema_init(&clmap_pvt.sem, 1); - init_completion(&clmap_pvt.complete); - - nss_clmap_stats_dentry_create(); - nss_clmap_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_log.c deleted file mode 100644 index 45cb0a734..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_log.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_clmap_log.c - * NSS clmap logger file. - */ - -#include "nss_core.h" - -/* - * nss_clmap_log_message_types_str - * clmap message strings - */ -static char *nss_clmap_log_message_types_str[NSS_CLMAP_MSG_TYPE_MAX] __maybe_unused = { - "Clmap sync stats", - "Clmap enable interface", - "Clmap disable interface", - "Clmap add MAC rule", - "Clmap delete MAC rule", - "Clmap flush MAC rule" -}; - -/* - * nss_clmap_log_error_types_str - * Strings for error types for clmap messages - */ -static char *nss_clmap_log_error_types_str[NSS_CLMAP_ERROR_MAX] __maybe_unused = { - "Clmap unknown error", - "Clmap interface disabled", - "Clmap interface enabled", - "Clmap invalid VLAN", - "Clmap invalid tunnel ID", - "Clmap MAC table full", - "Clmap MAC exists", - "Clmap MAC does not exist", - "Clmap MAC entry unhashed", - "Clmap MAC entry insert failed", - "Clmap MAC entry alloc failed", - "Clmap MAC entry delete failed" -}; - -/* - * nss_clmap_log_mac_msg() - * Log NSS clmap MAC rule message. - */ -static void nss_clmap_log_mac_msg(struct nss_clmap_mac_msg *npvcm) -{ - nss_trace("%px: NSS clmap MAC message \n" - "Clmap Mac Addr: %x : %x : %x" - "Clmap Flags: %u\n" - "Clmap VLAN ID: %u\n" - "Clmap Next-hop Interface Number: %d\n", - npvcm, - npvcm->mac_addr[0], npvcm->mac_addr[1], - npvcm->mac_addr[2], npvcm->flags, - npvcm->vlan_id, npvcm->nexthop_ifnum); -} - -/* - * nss_clmap_log_interface_enable_msg() - * Log NSS clmap rule enable message. - */ -static void nss_clmap_log_interface_enable_msg(struct nss_clmap_msg *npvm) -{ - nss_trace("%px: NSS clmap interface state message: Enable \n", npvm); -} - -/* - * nss_clmap_log_interface_disable_msg() - * Log NSS clmap rule disable message. - */ -static void nss_clmap_log_interface_disable_msg(struct nss_clmap_msg *npvm) -{ - nss_trace("%px: NSS clmap interface state message: Disable \n", npvm); -} - -/* - * nss_clmap_log_mac_add_msg() - * Log NSS clmap mac rule add message. - */ -static void nss_clmap_log_mac_add_msg(struct nss_clmap_msg *npvm) -{ - struct nss_clmap_mac_msg *npvcm __maybe_unused = &npvm->msg.mac_add; - nss_clmap_log_mac_msg(npvcm); -} - -/* - * nss_clmap_log_mac_del_msg() - * Log NSS clmap mac rule del message. - */ -static void nss_clmap_log_mac_del_msg(struct nss_clmap_msg *npvm) -{ - struct nss_clmap_mac_msg *npvcm __maybe_unused = &npvm->msg.mac_del; - nss_clmap_log_mac_msg(npvcm); -} - -/* - * nss_clmap_log_mac_flush_msg() - * Log NSS clmap mac rule flush message. - */ -static void nss_clmap_log_mac_flush_msg(struct nss_clmap_msg *npvm) -{ - struct nss_clmap_flush_mac_msg *npvcm __maybe_unused = &npvm->msg.mac_flush; - nss_trace("%px: NSS clmap MAC flush message \n" - "Clmap Next-hop Interface Number: %d\n", - npvcm, npvcm->nexthop_ifnum); -} - -/* - * nss_clmap_log_verbose() - * Log message contents. - */ -static void nss_clmap_log_verbose(struct nss_clmap_msg *npvm) -{ - switch (npvm->cm.type) { - case NSS_CLMAP_MSG_TYPE_INTERFACE_ENABLE: - nss_clmap_log_interface_enable_msg(npvm); - break; - - case NSS_CLMAP_MSG_TYPE_INTERFACE_DISABLE: - nss_clmap_log_interface_disable_msg(npvm); - break; - - case NSS_CLMAP_MSG_TYPE_MAC_ADD: - nss_clmap_log_mac_add_msg(npvm); - break; - - case NSS_CLMAP_MSG_TYPE_MAC_DEL: - nss_clmap_log_mac_del_msg(npvm); - break; - - case NSS_CLMAP_MSG_TYPE_MAC_FLUSH: - nss_clmap_log_mac_flush_msg(npvm); - break; - - case NSS_CLMAP_MSG_TYPE_SYNC_STATS: - break; - - default: - nss_trace("%px: Invalid message type\n", npvm); - break; - } -} - -/* - * nss_clmap_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_clmap_log_tx_msg(struct nss_clmap_msg *npvm) -{ - if (npvm->cm.type >= NSS_CLMAP_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", npvm); - return; - } - - nss_info("%px: type[%d]:%s\n", npvm, npvm->cm.type, nss_clmap_log_message_types_str[npvm->cm.type]); - nss_clmap_log_verbose(npvm); -} - -/* - * nss_clmap_log_rx_msg() - * Log messages received from FW. - */ -void nss_clmap_log_rx_msg(struct nss_clmap_msg *npvm) -{ - if (npvm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", npvm); - return; - } - - if (npvm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npvm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", npvm, npvm->cm.type, - nss_clmap_log_message_types_str[npvm->cm.type], - npvm->cm.response, nss_cmn_response_str[npvm->cm.response]); - goto verbose; - } - - if (npvm->cm.error >= NSS_CLMAP_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - npvm, npvm->cm.type, nss_clmap_log_message_types_str[npvm->cm.type], - npvm->cm.response, nss_cmn_response_str[npvm->cm.response], - npvm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - npvm, npvm->cm.type, nss_clmap_log_message_types_str[npvm->cm.type], - npvm->cm.response, nss_cmn_response_str[npvm->cm.response], - npvm->cm.error, nss_clmap_log_error_types_str[npvm->cm.error]); - -verbose: - nss_clmap_log_verbose(npvm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_log.h deleted file mode 100644 index 6d193d315..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_CLMAP_LOG_H__ -#define __NSS_CLMAP_LOG_H__ - -/* - * nss_clmap_log.h - * NSS clmap Log Header File. - */ - -/* - * nss_clmap_log_tx_msg - * Logs a clmap message that is sent to the NSS firmware. - */ -void nss_clmap_log_tx_msg(struct nss_clmap_msg *ncm); - -/* - * nss_clmap_log_rx_msg - * Logs a clmap message that is received from the NSS firmware. - */ -void nss_clmap_log_rx_msg(struct nss_clmap_msg *ncm); - -#endif /* __NSS_CLMAP_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.c deleted file mode 100644 index a75bffffe..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.c +++ /dev/null @@ -1,296 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_clmap.h" -#include "nss_clmap_stats.h" -#include "nss_clmap_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_clmap_stats_notifier); - -/* - * Spinlock to protect clmap statistics update/read - */ -DEFINE_SPINLOCK(nss_clmap_stats_lock); - -struct nss_clmap_stats *stats_db[NSS_CLMAP_MAX_DEBUG_INTERFACES] = {NULL}; - -/* - * nss_clmap_interface_type_str - * Clmap interface type string. - */ -static char *nss_clmap_interface_type_str[NSS_CLMAP_INTERFACE_TYPE_MAX] = { - "Upstream", - "Downstream" -}; - -/* - * nss_clmap_stats_session_unregister - * Unregister debug statistic for clmap session. - */ -void nss_clmap_stats_session_unregister(uint32_t if_num) -{ - uint32_t i; - - spin_lock_bh(&nss_clmap_stats_lock); - for (i = 0; i < NSS_CLMAP_MAX_DEBUG_INTERFACES; i++) { - if (stats_db[i] && (stats_db[i]->nss_if_num == if_num)) { - kfree(stats_db[i]); - stats_db[i] = NULL; - break; - } - } - spin_unlock_bh(&nss_clmap_stats_lock); -} - -/* - * nss_clmap_stats_session_register - * Register debug statistic for clmap session. - */ -bool nss_clmap_stats_session_register(uint32_t if_num, uint32_t if_type, struct net_device *netdev) -{ - uint32_t i; - bool stats_status = false; - - if (!netdev) { - nss_warning("Could not allocate statistics memory as the net device is NULL!\n"); - return stats_status; - } - - spin_lock_bh(&nss_clmap_stats_lock); - for (i = 0; i < NSS_CLMAP_MAX_DEBUG_INTERFACES; i++) { - if (!stats_db[i]) { - stats_db[i] = (struct nss_clmap_stats *)kzalloc(sizeof(struct nss_clmap_stats), GFP_KERNEL); - if (!stats_db[i]) { - nss_warning("%px: could not allocate memory for statistics database for interface id: %d\n", netdev, if_num); - break; - } - stats_db[i]->valid = true; - stats_db[i]->nss_if_num = if_num; - stats_db[i]->nss_if_type = if_type; - stats_db[i]->if_index = netdev->ifindex; - stats_status = true; - break; - } - } - spin_unlock_bh(&nss_clmap_stats_lock); - return stats_status; -} - -/* - * nss_clmap_get_debug_stats() - * Get clmap debug statistics. - */ -static int nss_clmap_get_debug_stats(struct nss_clmap_stats *stats) -{ - uint32_t i; - int interface_cnt = 0; - - spin_lock_bh(&nss_clmap_stats_lock); - for (i = 0; i < NSS_CLMAP_MAX_DEBUG_INTERFACES; i++) { - if (stats_db[i]) { - memcpy(stats, stats_db[i], sizeof(struct nss_clmap_stats)); - stats++; - interface_cnt++; - } - } - spin_unlock_bh(&nss_clmap_stats_lock); - - return interface_cnt; -} - -/* - * nss_clmap_stats_read() - * Read clmap statistics - */ -static ssize_t nss_clmap_stats_read(struct file *fp, char __user *ubuf, - size_t sz, loff_t *ppos) -{ - uint32_t max_output_lines = (NSS_CLMAP_INTERFACE_STATS_MAX * NSS_CLMAP_MAX_DEBUG_INTERFACES) + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - uint32_t id; - struct nss_clmap_stats *clmap_stats = NULL; - int interface_cnt; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Allocate statistics memory only for all interfaces. - */ - clmap_stats = kzalloc((NSS_CLMAP_MAX_DEBUG_INTERFACES * sizeof(struct nss_clmap_stats)), GFP_KERNEL); - if (unlikely(!clmap_stats)) { - nss_warning("Could not allocate memory for populating clmap statistics\n"); - kfree(lbuf); - return 0; - } - - /* - * Get clmap statistics. - */ - interface_cnt = nss_clmap_get_debug_stats(clmap_stats); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "clmap stats", NSS_STATS_SINGLE_CORE); - for (id = 0; id < interface_cnt; id++) { - struct nss_clmap_stats *clmsp = clmap_stats + id; - - if (unlikely(!clmsp->valid)) { - continue; - } - - dev = dev_get_by_index(&init_net, clmsp->if_index); - if (unlikely(!dev)) { - nss_warning("No netdev available for nss interface id:%d\n", clmsp->nss_if_num); - continue; - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d, interface type=%s, netdevice=%s\n", id, - clmsp->nss_if_num, nss_clmap_interface_type_str[clmsp->nss_if_type], dev->name); - dev_put(dev); - - size_wr += nss_stats_print("clmap", NULL, NSS_STATS_SINGLE_INSTANCE, nss_clmap_strings_stats, - clmsp->stats, NSS_CLMAP_INTERFACE_STATS_MAX, lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(clmap_stats); - kfree(lbuf); - return bytes_read; -} - -/* - * nss_clmap_stats_sync() - * Sync function for clmap statistics - */ -void nss_clmap_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_clmap_stats_msg *stats_msg, uint32_t if_num) -{ - uint32_t i; - struct nss_clmap_stats *s = NULL; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - spin_lock_bh(&nss_clmap_stats_lock); - for (i = 0; i < NSS_CLMAP_MAX_DEBUG_INTERFACES; i++) { - if (stats_db[i] && (stats_db[i]->nss_if_num == if_num)) { - s = stats_db[i]; - break; - } - } - - if (!s) { - spin_unlock_bh(&nss_clmap_stats_lock); - nss_warning("%px: Interface not found: %u", nss_ctx, if_num); - return; - } - - s->stats[NSS_CLMAP_INTERFACE_STATS_RX_PKTS] += stats_msg->node_stats.rx_packets; - s->stats[NSS_CLMAP_INTERFACE_STATS_RX_BYTES] += stats_msg->node_stats.rx_bytes; - s->stats[NSS_CLMAP_INTERFACE_STATS_TX_PKTS] += stats_msg->node_stats.tx_packets; - s->stats[NSS_CLMAP_INTERFACE_STATS_TX_BYTES] += stats_msg->node_stats.tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - s->stats[NSS_CLMAP_INTERFACE_STATS_RX_QUEUE_0_DROPPED + i] += stats_msg->node_stats.rx_dropped[i]; - } - - s->stats[NSS_CLMAP_INTERFACE_STATS_DROPPED_MACDB_LOOKUP_FAILED] += stats_msg->dropped_macdb_lookup_failed; - s->stats[NSS_CLMAP_INTERFACE_STATS_DROPPED_INVALID_PACKET_SIZE] += stats_msg->dropped_invalid_packet_size; - s->stats[NSS_CLMAP_INTERFACE_STATS_DROPPED_LOW_HEADROOM] += stats_msg->dropped_low_hroom; - s->stats[NSS_CLMAP_INTERFACE_STATS_DROPPED_NEXT_NODE_QUEUE_FULL] += stats_msg->dropped_next_node_queue_full; - s->stats[NSS_CLMAP_INTERFACE_STATS_DROPPED_PBUF_ALLOC_FAILED] += stats_msg->dropped_pbuf_alloc_failed; - s->stats[NSS_CLMAP_INTERFACE_STATS_DROPPED_LINEAR_FAILED] += stats_msg->dropped_linear_failed; - s->stats[NSS_CLMAP_INTERFACE_STATS_SHARED_PACKET_CNT] += stats_msg->shared_packet_count; - s->stats[NSS_CLMAP_INTERFACE_STATS_ETHERNET_FRAME_ERROR] += stats_msg->ethernet_frame_error; - s->stats[NSS_CLMAP_INTERFACE_STATS_MACDB_CREATE_REQUESTS_CNT] += stats_msg->macdb_create_requests; - s->stats[NSS_CLMAP_INTERFACE_STATS_MACDB_CREATE_MAC_EXISTS_CNT] += stats_msg->macdb_create_mac_exists; - s->stats[NSS_CLMAP_INTERFACE_STATS_MACDB_CREATE_MAC_TABLE_FULL_CNT] += stats_msg->macdb_create_table_full; - s->stats[NSS_CLMAP_INTERFACE_STATS_MACDB_DESTROY_REQUESTS_CNT] += stats_msg->macdb_destroy_requests; - s->stats[NSS_CLMAP_INTERFACE_STATS_MACDB_DESTROY_MAC_NOT_FOUND_CNT] += stats_msg->macdb_destroy_mac_notfound; - s->stats[NSS_CLMAP_INTERFACE_STATS_MACDB_DESTROY_MAC_UNHASHED_CNT] += stats_msg->macdb_destroy_mac_unhashed; - s->stats[NSS_CLMAP_INTERFACE_STATS_MACDB_FLUSH_REQUESTS_CNT] += stats_msg->macdb_flush_requests; - spin_unlock_bh(&nss_clmap_stats_lock); -} - -/* - * nss_clmap_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(clmap) - -/* - * nss_clmap_stats_dentry_create() - * Create client map statistics debug entry. - */ -void nss_clmap_stats_dentry_create(void) -{ - nss_stats_create_dentry("clmap", &nss_clmap_stats_ops); -} - -/* - * nss_clmap_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_clmap_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_clmap_stats_notification clmap_stats; - struct nss_clmap_stats *s = NULL; - int i; - - spin_lock_bh(&nss_clmap_stats_lock); - for (i = 0; i < NSS_CLMAP_MAX_DEBUG_INTERFACES; i++) { - if (!stats_db[i] || (stats_db[i]->nss_if_num != if_num)) { - continue; - } - - s = stats_db[i]; - clmap_stats.core_id = nss_ctx->id; - clmap_stats.if_num = if_num; - memcpy(clmap_stats.stats_ctx, s->stats, sizeof(clmap_stats.stats_ctx)); - spin_unlock_bh(&nss_clmap_stats_lock); - atomic_notifier_call_chain(&nss_clmap_stats_notifier, NSS_STATS_EVENT_NOTIFY, &clmap_stats); - return; - } - spin_unlock_bh(&nss_clmap_stats_lock); -} - -/* - * nss_clmap_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_clmap_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_clmap_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_clmap_stats_unregister_notifier); - -/* - * nss_clmap_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_clmap_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_clmap_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_clmap_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.h deleted file mode 100644 index 89f687dab..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_stats.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_CLMAP_STATS_H -#define __NSS_CLMAP_STATS_H - -#define NSS_CLMAP_MAX_DEBUG_INTERFACES 2 * NSS_CLMAP_MAX_INTERFACES - -/* - * Clmap session debug statistics. - */ -struct nss_clmap_stats { - uint64_t stats[NSS_CLMAP_INTERFACE_STATS_MAX]; /* Clmap statistics. */ - int32_t if_index; /* Interface index. */ - uint32_t nss_if_num; /* NSS interface number. */ - enum nss_clmap_interface_type nss_if_type; /* NSS interface type. */ - bool valid; -}; - -/* - * Clmap statistics APIs. - */ -extern void nss_clmap_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern bool nss_clmap_stats_session_register(uint32_t if_num, enum nss_clmap_interface_type if_type, struct net_device *netdev); -extern void nss_clmap_stats_session_unregister(uint32_t if_num); -extern void nss_clmap_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_clmap_stats_msg *stats_msg, uint32_t if_num); -extern void nss_clmap_stats_dentry_create(void); - -#endif /* __NSS_CLMAP_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.c deleted file mode 100644 index 4a52b489a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_clmap_strings.h" - -/* - * nss_clmap_strings_stats - * Clmap statistics strings for nss tunnel stats - */ -struct nss_stats_info nss_clmap_strings_stats[NSS_CLMAP_INTERFACE_STATS_MAX] = { - {"rx_pkts", NSS_STATS_TYPE_COMMON}, - {"rx_bytes", NSS_STATS_TYPE_COMMON}, - {"tx_pkts", NSS_STATS_TYPE_COMMON}, - {"tx_bytes", NSS_STATS_TYPE_COMMON}, - {"rx_queue_0_dropped", NSS_STATS_TYPE_DROP}, - {"rx_queue_1_dropped", NSS_STATS_TYPE_DROP}, - {"rx_queue_2_dropped", NSS_STATS_TYPE_DROP}, - {"rx_queue_3_dropped", NSS_STATS_TYPE_DROP}, - {"MAC DB look up failed", NSS_STATS_TYPE_SPECIAL}, - {"Invalid packet count", NSS_STATS_TYPE_SPECIAL}, - {"Headroom drop", NSS_STATS_TYPE_SPECIAL}, - {"Next node queue full drop", NSS_STATS_TYPE_SPECIAL}, - {"Pbuf alloc failed drop", NSS_STATS_TYPE_SPECIAL}, - {"Linear failed drop", NSS_STATS_TYPE_SPECIAL}, - {"Shared packet count", NSS_STATS_TYPE_SPECIAL}, - {"Ethernet frame error", NSS_STATS_TYPE_SPECIAL}, - {"Macdb create requests count", NSS_STATS_TYPE_SPECIAL}, - {"Macdb create failures MAC exists count", NSS_STATS_TYPE_SPECIAL}, - {"Macdb create failures MAC table full count", NSS_STATS_TYPE_SPECIAL}, - {"Macdb destroy requests count", NSS_STATS_TYPE_SPECIAL}, - {"Macdb destroy failures MAC not found count", NSS_STATS_TYPE_SPECIAL}, - {"Macdb destroy failures MAC unhashed count", NSS_STATS_TYPE_SPECIAL}, - {"Macdb flush requests count", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_clmap_strings_read() - * Read clmap statistics names - */ -static ssize_t nss_clmap_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_clmap_strings_stats, NSS_CLMAP_INTERFACE_STATS_MAX); -} - -/* - * nss_clmap_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(clmap); - -/* - * nss_clmap_strings_dentry_create() - * Create clmap statistics strings debug entry. - */ -void nss_clmap_strings_dentry_create(void) -{ - nss_strings_create_dentry("clmap", &nss_clmap_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.h deleted file mode 100644 index dbdffba98..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_clmap_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_CLMAP_STRINGS_H -#define __NSS_CLMAP_STRINGS_H - -#include "nss_clmap_stats.h" - -extern struct nss_stats_info nss_clmap_strings_stats[NSS_CLMAP_INTERFACE_STATS_MAX]; -extern void nss_clmap_strings_dentry_create(void); - -#endif /* __NSS_CLMAP_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_cmn.c b/feeds/ipq807x/qca-nss-drv/src/nss_cmn.c deleted file mode 100644 index 258994f1d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_cmn.c +++ /dev/null @@ -1,345 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_cmn.c - * NSS generic APIs - */ - -#if (NSS_DT_SUPPORT == 1) -#include -#endif - -#include "nss_tx_rx_common.h" - -/* - * nss_cmn_response_str - * Common response structure string - */ -int8_t *nss_cmn_response_str[NSS_CMN_RESPONSE_LAST] = { - "Message Acknowledge without errors", - "Common message version not supported", - "Unknown Interface", - "Length Error", - "Message Error", - "FW Notification Message", -}; - -/* - * nss_cmn_msg_init() - * Initialize the common message of an ASYNC message. - */ -void nss_cmn_msg_init(struct nss_cmn_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - ncm->interface = if_num; - ncm->version = NSS_HLOS_MESSAGE_VERSION; - ncm->type = type; - ncm->len = len; - ncm->cb = (nss_ptr_t)cb; - ncm->app_data = (nss_ptr_t)app_data; -} -EXPORT_SYMBOL(nss_cmn_msg_init); - -/* - * nss_cmn_msg_sync_init() - * Initialize the common message of a SYNC message. - */ -void nss_cmn_msg_sync_init(struct nss_cmn_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len) -{ - nss_cmn_msg_init(ncm, if_num, type, len, NULL, NULL); -} -EXPORT_SYMBOL(nss_cmn_msg_sync_init); - -/* - * nss_cmn_get_interface_number() - * Return the interface number of the NSS net_device. - * - * Returns -1 on failure or the interface number of dev is an NSS net_device. - */ -int32_t nss_cmn_get_interface_number(struct nss_ctx_instance *nss_ctx, struct net_device *dev) -{ - int i; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Interface number could not be found as core not ready\n", nss_ctx); - return -1; - } - - nss_assert(dev != 0); - - /* - * Check physical interface table - */ - for (i = 0; i < NSS_MAX_NET_INTERFACES; i++) { - if (dev == nss_ctx->subsys_dp_register[i].ndev) { - return i; - } - } - - nss_warning("%px: Interface number could not be found as interface has not registered yet\n", nss_ctx); - return -1; -} -EXPORT_SYMBOL(nss_cmn_get_interface_number); - -/* - * nss_cmn_append_core_id() - * Return the NSS interface number with core ID. - */ -int nss_cmn_append_core_id(struct nss_ctx_instance *nss_ctx, int if_num) -{ - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_cmn_append_core_id); - -/* - * nss_cmn_get_interface_dev() - * Return the net_device for NSS interface id. - * - * Returns NULL on failure or the net_device for NSS interface id. - */ -struct net_device *nss_cmn_get_interface_dev(struct nss_ctx_instance *ctx, uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)ctx; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Interface device could not be found as core not ready\n", nss_ctx); - return NULL; - } - - if (unlikely(if_num >= NSS_MAX_NET_INTERFACES)) { - return NULL; - } - - return nss_ctx->subsys_dp_register[if_num].ndev; -} -EXPORT_SYMBOL(nss_cmn_get_interface_dev); - -/* - * nss_cmn_get_interface_number_by_dev_and_type() - * Return the NSS interface id for the net_device. - * - * Returns < 0 on failure or the NSS interface id for the given device and type. - */ -int32_t nss_cmn_get_interface_number_by_dev_and_type(struct net_device *dev, uint32_t type) -{ - int i, core; - struct nss_subsystem_dataplane_register *nsdr; - - nss_assert(dev != 0); - for (core = 0; core < nss_top_main.num_nss; core++) { - for (i = 0; i < NSS_MAX_NET_INTERFACES; i++) { - nsdr = &nss_top_main.nss[core].subsys_dp_register[i]; - if (dev == nsdr->ndev && type == nsdr->type) { - return i; - } - } - } - - nss_warning("Interface number could not be found for %px (%s) as interface has not registered yet\n", dev, dev->name); - return -1; -} -EXPORT_SYMBOL(nss_cmn_get_interface_number_by_dev_and_type); - -/* - * nss_cmn_get_interface_number_by_dev() - * Return the NSS interface id for the net_device. - * - * Returns < 0 on failure or the NSS interface id for the given device. - */ -int32_t nss_cmn_get_interface_number_by_dev(struct net_device *dev) -{ - return nss_cmn_get_interface_number_by_dev_and_type(dev, 0); -} -EXPORT_SYMBOL(nss_cmn_get_interface_number_by_dev); - -/* - * nss_cmn_get_state() - * return the NSS initialization state - */ -nss_state_t nss_cmn_get_state(struct nss_ctx_instance *ctx) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)ctx; - nss_state_t state = NSS_STATE_UNINITIALIZED; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - spin_lock_bh(&nss_top_main.lock); - if (nss_ctx->state == NSS_CORE_STATE_INITIALIZED) { - state = NSS_STATE_INITIALIZED; - } - spin_unlock_bh(&nss_top_main.lock); - - return state; -} -EXPORT_SYMBOL(nss_cmn_get_state); - -/* - * nss_cmn_interface_is_redirect() - * Return true if the interface is a redirect interface. - */ -bool nss_cmn_interface_is_redirect(struct nss_ctx_instance *nss_ctx, int32_t interface_num) -{ - enum nss_dynamic_interface_type type = nss_dynamic_interface_get_type(nss_ctx, interface_num); - - return type == NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H - || type == NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N - || type == NSS_DYNAMIC_INTERFACE_TYPE_VIRTIF_DEPRECATED; -} -EXPORT_SYMBOL(nss_cmn_interface_is_redirect); - -/* - * nss_cmn_rx_dropped_sum() - * Sum rx_dropped count. - */ -uint32_t nss_cmn_rx_dropped_sum(struct nss_cmn_node_stats *node_stats) -{ - uint32_t sum = 0; - int i; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - sum += node_stats->rx_dropped[i]; - } - return sum; -} -EXPORT_SYMBOL(nss_cmn_rx_dropped_sum); - -/* - * nss_cmn_register_queue_decongestion() - * Register for queue decongestion event - */ -nss_cb_register_status_t nss_cmn_register_queue_decongestion(struct nss_ctx_instance *nss_ctx, nss_cmn_queue_decongestion_callback_t event_callback, void *app_ctx) -{ - uint32_t i; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - spin_lock_bh(&nss_ctx->decongest_cb_lock); - - /* - * Find vacant location in callback table - */ - for (i = 0; i< NSS_MAX_CLIENTS; i++) { - if (nss_ctx->queue_decongestion_callback[i] == NULL) { - nss_ctx->queue_decongestion_callback[i] = event_callback; - nss_ctx->queue_decongestion_ctx[i] = app_ctx; - spin_unlock_bh(&nss_ctx->decongest_cb_lock); - return NSS_CB_REGISTER_SUCCESS; - } - } - - spin_unlock_bh(&nss_ctx->decongest_cb_lock); - return NSS_CB_REGISTER_FAILED; -} -EXPORT_SYMBOL(nss_cmn_register_queue_decongestion); - -/* - * nss_cmn_unregister_queue_decongestion() - * Unregister for queue decongestion event - */ -nss_cb_unregister_status_t nss_cmn_unregister_queue_decongestion(struct nss_ctx_instance *nss_ctx, nss_cmn_queue_decongestion_callback_t event_callback) -{ - uint32_t i; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - spin_lock_bh(&nss_ctx->decongest_cb_lock); - - /* - * Find actual location in callback table - */ - for (i = 0; i< NSS_MAX_CLIENTS; i++) { - if (nss_ctx->queue_decongestion_callback[i] == event_callback) { - nss_ctx->queue_decongestion_callback[i] = NULL; - nss_ctx->queue_decongestion_ctx[i] = NULL; - spin_unlock_bh(&nss_ctx->decongest_cb_lock); - return NSS_CB_UNREGISTER_SUCCESS; - } - } - - spin_unlock_bh(&nss_ctx->decongest_cb_lock); - return NSS_CB_UNREGISTER_FAILED; -} -EXPORT_SYMBOL(nss_cmn_unregister_queue_decongestion); - -/* - * nss_cmn_register_service_code() - * Register for service code event - */ -nss_cb_register_status_t nss_cmn_register_service_code(struct nss_ctx_instance *nss_ctx, nss_cmn_service_code_callback_t cb, uint8_t service_code, void *app_data) -{ - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (nss_ctx->service_code_callback[service_code]) { - /* - * We already have a callback registered for this service code. - */ - nss_warning("%px: a callback is registered already for this service code %d\n", nss_ctx, service_code); - - return NSS_CB_REGISTER_FAILED; - } - - nss_ctx->service_code_callback[service_code] = cb; - nss_ctx->service_code_ctx[service_code] = app_data; - return NSS_CB_REGISTER_SUCCESS; -} -EXPORT_SYMBOL(nss_cmn_register_service_code); - -/* - * nss_cmn_unregister_service_code() - * Unregister for service code event - */ -nss_cb_unregister_status_t nss_cmn_unregister_service_code(struct nss_ctx_instance *nss_ctx, nss_cmn_service_code_callback_t cb, uint8_t service_code) -{ - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_ctx->service_code_callback[service_code]) { - /* - * No callback was registered for this service code. - */ - nss_warning("%px: no callback is registered for this service code %d\n", nss_ctx, service_code); - return NSS_CB_UNREGISTER_FAILED; - } - - nss_ctx->service_code_callback[service_code] = NULL; - nss_ctx->service_code_ctx[service_code] = NULL; - return NSS_CB_UNREGISTER_SUCCESS; -} -EXPORT_SYMBOL(nss_cmn_unregister_service_code); - -/* - * nss_cmn_get_nss_enabled() - * Check if NSS mode is supported on platform - * - * This API checks the device tree parameter to decide on whether - * NSS mode is enabled. On older kernels this will always return true - */ -bool nss_cmn_get_nss_enabled(void) -{ -#if (NSS_DT_SUPPORT == 1) - struct device_node *cmn = NULL; - - /* - * Get reference to NSS common device node - */ - cmn = of_find_node_by_name(NULL, "nss-common"); - if (!cmn) { - nss_info_always("nss is not enabled on this platform\n"); - return false; - } -#endif - return true; -} -EXPORT_SYMBOL(nss_cmn_get_nss_enabled); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_core.c b/feeds/ipq807x/qca-nss-drv/src/nss_core.c deleted file mode 100644 index eaea9ec15..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_core.c +++ /dev/null @@ -1,3251 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_core.c - * NSS driver core APIs source file. - */ - -#include "nss_core.h" -#include -#include -#include -#include -#include -#ifdef CONFIG_BRIDGE_NETFILTER -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 0, 0)) -#include -#else -#include -#endif -#endif -#include -#include "nss_tx_rx_common.h" -#include "nss_data_plane.h" - -#define NSS_CORE_JUMBO_LINEAR_BUF_SIZE 128 - -#if (NSS_SKB_REUSE_SUPPORT == 1) -/* - * We have validated the skb recycling code within the NSS for the - * following kernel versions. Before enabling the driver in new kernels, - * the skb recycle code must be checked against Linux skb handling. - * - * Tested on: 3.4, 3.10, 3.14, 3.18, 4.4 and 5.4 - */ -#if (!( \ -(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)))) || \ -(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)))) || \ -(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)))) || \ -(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)))) || \ -(((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)))) || \ -(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)))))) -#error "Check skb recycle code in this file to match Linux version" -#endif - -static atomic_t max_reuse = ATOMIC_INIT(PAGE_SIZE); - -#endif /* NSS_SKB_REUSE_SUPPORT */ - -static int max_ipv4_conn = NSS_DEFAULT_NUM_CONN; -module_param(max_ipv4_conn, int, S_IRUGO); -MODULE_PARM_DESC(max_ipv4_conn, "Max number of IPv4 connections"); - -static int max_ipv6_conn = NSS_DEFAULT_NUM_CONN; -module_param(max_ipv6_conn, int, S_IRUGO); -MODULE_PARM_DESC(max_ipv6_conn, "Max number of IPv6 connections"); - -bool pn_mq_en = false; -module_param(pn_mq_en, bool, S_IRUGO); -MODULE_PARM_DESC(pn_mq_en, "Enable pnode ingress QoS"); - -uint16_t pn_qlimits[NSS_MAX_NUM_PRI] = {[0 ... NSS_MAX_NUM_PRI - 1] = NSS_DEFAULT_QUEUE_LIMIT}; -module_param_array(pn_qlimits, short, NULL, 0); -MODULE_PARM_DESC(pn_qlimits, "Queue limit per queue"); - -/* - * Atomic variables to control jumbo_mru & paged_mode - */ -static atomic_t jumbo_mru; -static atomic_t paged_mode; - -/* - * nss_core_update_max_ipv4_conn() - * Update the maximum number of configured IPv4 connections - */ -void nss_core_update_max_ipv4_conn(int conn) -{ - max_ipv4_conn = conn; -} - -/* - * nss_core_update_max_ipv6_conn() - * Update the maximum number of configured IPv6 connections - */ -void nss_core_update_max_ipv6_conn(int conn) -{ - max_ipv6_conn = conn; -} - -#if (NSS_SKB_REUSE_SUPPORT == 1) -/* - * nss_core_set_max_reuse() - * Set the max_reuse to the specified value - */ -void nss_core_set_max_reuse(int max) -{ - atomic_set(&max_reuse, max); -} - -/* - * nss_core_get_max_reuse() - * Does an atomic read of max_reuse - */ -int nss_core_get_max_reuse(void) -{ - return atomic_read(&max_reuse); -} - -/* - * nss_core_get_min_reuse() - * Return min reuse size - */ -uint32_t nss_core_get_min_reuse(struct nss_ctx_instance *nss_ctx) -{ - NSS_VERIFY_CTX_MAGIC(nss_ctx); - return nss_ctx->max_buf_size; -} -#endif /* NSS_SKB_REUSE_SUPPORT */ - -/* - * nss_core_set_jumbo_mru() - * Set the jumbo_mru to the specified value - */ -void nss_core_set_jumbo_mru(int jumbo) -{ - atomic_set(&jumbo_mru, jumbo); - -#if (NSS_SKB_REUSE_SUPPORT == 1) - if (jumbo > nss_core_get_max_reuse()) - nss_core_set_max_reuse(ALIGN(jumbo * 2, PAGE_SIZE)); -#endif -} - -/* - * nss_core_get_jumbo_mru() - * Does an atomic read of jumbo_mru - */ -int nss_core_get_jumbo_mru(void) -{ - return atomic_read(&jumbo_mru); -} - -/* - * nss_core_set_paged_mode() - * Set the paged_mode to the specified value - */ -void nss_core_set_paged_mode(int mode) -{ - atomic_set(&paged_mode, mode); -} - -/* - * nss_core_get_paged_mode() - * Does an atomic read of paged_mode - */ -int nss_core_get_paged_mode(void) -{ - return atomic_read(&paged_mode); -} - -/* - * nss_core_register_msg_handler() - * Register a msg callback per interface number. One per interface. - */ -uint32_t nss_core_register_msg_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface, nss_if_rx_msg_callback_t msg_cb) -{ - nss_assert(msg_cb != NULL); - - /* - * Validate interface id - */ - if (interface >= NSS_MAX_NET_INTERFACES) { - nss_warning("Error - Interface %d not Supported\n", interface); - return NSS_CORE_STATUS_FAILURE; - } - - /* - * Check if already registered - */ - if (nss_ctx->nss_rx_interface_handlers[interface].msg_cb) { - nss_warning("Error - Duplicate Interface CB Registered for interface %d\n", interface); - return NSS_CORE_STATUS_FAILURE; - } - - nss_ctx->nss_rx_interface_handlers[interface].msg_cb = msg_cb; - - return NSS_CORE_STATUS_SUCCESS; -} - -/* - * nss_core_unregister_msg_handler() - * Unregister a msg callback per interface number. - */ -uint32_t nss_core_unregister_msg_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface) -{ - /* - * Validate interface id - */ - if (interface >= NSS_MAX_NET_INTERFACES) { - nss_warning("Error - Interface %d not Supported\n", interface); - return NSS_CORE_STATUS_FAILURE; - } - - nss_ctx->nss_rx_interface_handlers[interface].msg_cb = NULL; - - return NSS_CORE_STATUS_SUCCESS; -} - -/* - * nss_core_register_handler() - --- Register a callback per interface code. Only one per interface. - */ -uint32_t nss_core_register_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface, nss_core_rx_callback_t cb, void *app_data) -{ - nss_assert(cb != NULL); - - /* - * Validate interface id - */ - if (interface >= NSS_MAX_NET_INTERFACES) { - nss_warning("Error - Interface %d not Supported\n", interface); - return NSS_CORE_STATUS_FAILURE; - } - - /* - * Check if already registered - */ - if (nss_ctx->nss_rx_interface_handlers[interface].cb != NULL) { - nss_warning("Error - Duplicate Interface CB Registered for interface %d\n", interface); - return NSS_CORE_STATUS_FAILURE; - } - - nss_ctx->nss_rx_interface_handlers[interface].cb = cb; - nss_ctx->nss_rx_interface_handlers[interface].app_data = app_data; - - return NSS_CORE_STATUS_SUCCESS; -} - -/* - * nss_core_unregister_handler() - * Unegister a callback per interface code. - */ -uint32_t nss_core_unregister_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface) -{ - /* - * Validate interface id - */ - if (interface >= NSS_MAX_NET_INTERFACES) { - nss_warning("Error - Interface %d not Supported\n", interface); - return NSS_CORE_STATUS_FAILURE; - } - - nss_ctx->nss_rx_interface_handlers[interface].cb = NULL; - nss_ctx->nss_rx_interface_handlers[interface].app_data = NULL; - - return NSS_CORE_STATUS_SUCCESS; -} - -/* - * nss_core_set_subsys_dp_type() - * Set the type for the datapath subsystem - */ -void nss_core_set_subsys_dp_type(struct nss_ctx_instance *nss_ctx, struct net_device *ndev, uint32_t if_num, uint32_t type) -{ - struct nss_subsystem_dataplane_register *reg; - - /* - * Check that interface number is in range. - */ - BUG_ON(if_num >= NSS_MAX_NET_INTERFACES); - - reg = &nss_ctx->subsys_dp_register[if_num]; - - /* - * Check if there is already a subsystem registered at this interface number. - */ - BUG_ON(reg->ndev && reg->ndev != ndev); - - reg->type = type; -} - -/* - * nss_core_register_subsys_dp() - * Registers a netdevice and associated information at a given interface. - * - * Can also be used to update an existing registry if the provided net_device - * is equal to the one already registered. Will fail if there is already - * a net_device registered to the interface not equal to the one provided, - * or if the interface number is out of range. - */ -void nss_core_register_subsys_dp(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - nss_phys_if_rx_callback_t cb, - nss_phys_if_rx_ext_data_callback_t ext_cb, - void *app_data, struct net_device *ndev, - uint32_t features) -{ - struct nss_subsystem_dataplane_register *reg; - - /* - * Check that interface number is in range. - */ - BUG_ON(if_num >= NSS_MAX_NET_INTERFACES); - - reg = &nss_ctx->subsys_dp_register[if_num]; - - /* - * Check if there is already a subsystem registered at this interface number. - */ - BUG_ON(reg->ndev && reg->ndev != ndev); - - reg->cb = cb; - reg->ext_cb = ext_cb; - reg->app_data = app_data; - reg->ndev = ndev; - reg->features = features; -} - -/* - * nss_core_unregister_subsys_dp() - * Unregisters the netdevice at the given interface. - * - * Fails if the interface number is not valid. - */ -void nss_core_unregister_subsys_dp(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_subsystem_dataplane_register *reg; - - /* - * Check that interface number is in range. - */ - BUG_ON(if_num >= NSS_MAX_NET_INTERFACES); - - reg = &nss_ctx->subsys_dp_register[if_num]; - - reg->cb = NULL; - reg->ext_cb = NULL; - reg->app_data = NULL; - reg->ndev = NULL; - reg->features = 0; - reg->type = 0; -} - -/* - * nss_core_handle_nss_status_pkt() - * Handle the metadata/status packet. - */ -void nss_core_handle_nss_status_pkt(struct nss_ctx_instance *nss_ctx, struct sk_buff *nbuf) -{ - struct nss_cmn_msg *ncm; - uint32_t expected_version = NSS_HLOS_MESSAGE_VERSION; - nss_core_rx_callback_t cb; - void *app_data; - uint16_t nss_if; - - if (skb_shinfo(nbuf)->nr_frags > 0) { - ncm = (struct nss_cmn_msg *)skb_frag_address(&skb_shinfo(nbuf)->frags[0]); - } else { - ncm = (struct nss_cmn_msg *)nbuf->data; - } - - /* - * Save NSS interface number in local variable - */ - nss_if = ncm->interface; - - /* - * Check for version number - */ - if (ncm->version != expected_version) { - nss_warning("%px: Message %d for interface %d received with invalid version %d, expected version %d", - nss_ctx, ncm->type, nss_if, ncm->version, expected_version); - return; - } - - /* - * Validate message size - */ - if (ncm->len > nbuf->len) { - nss_warning("%px: Message %d for interface %d received with invalid length %d, expected length %d", - nss_ctx, ncm->type, nss_if, nbuf->len, ncm->len); - return; - } - - /* - * Check for validity of interface number - */ - if (nss_if >= NSS_MAX_NET_INTERFACES) { - nss_warning("%px: Message %d received with invalid interface number %d", nss_ctx, ncm->type, nss_if); - return; - } - - cb = nss_ctx->nss_rx_interface_handlers[nss_if].cb; - app_data = nss_ctx->nss_rx_interface_handlers[nss_if].app_data; - - if (!cb) { - nss_warning("%px: Callback not registered for interface %d", nss_ctx, nss_if); - return; - } - - cb(nss_ctx, ncm, app_data); - - if (ncm->interface != nss_if) { - nss_warning("%px: Invalid NSS I/F %d expected %d", nss_ctx, ncm->interface, nss_if); - } - - return; -} - -/* - * nss_core_handle_nss_crypto_pkt() - * Handles crypto packet. - */ -static void nss_core_handle_crypto_pkt(struct nss_ctx_instance *nss_ctx, unsigned int interface_num, - struct sk_buff *nbuf, struct napi_struct *napi) -{ - struct nss_subsystem_dataplane_register *subsys_dp_reg = &nss_ctx->subsys_dp_register[interface_num]; - nss_phys_if_rx_callback_t cb; - struct net_device *ndev; - - ndev = subsys_dp_reg->ndev; - cb = subsys_dp_reg->cb; - if (likely(cb)) { - cb(ndev, nbuf, napi); - return; - } - - dev_kfree_skb_any(nbuf); - return; -} - -/* - * nss_soc_mem_info() - * Getting DDR information for NSS SoC - */ -static uint32_t nss_soc_mem_info(void) -{ - struct device_node *node; - struct device_node *snode; - int addr_cells; - int size_cells; - int n_items; - uint32_t nss_msize = 8 << 20; /* default: 8MB */ - const __be32 *ppp; - - node = of_find_node_by_name(NULL, "reserved-memory"); - if (!node) { - nss_info_always("reserved-memory not found\n"); - return nss_msize; - } - - ppp = (__be32 *)of_get_property(node, "#address-cells", NULL); - addr_cells = ppp ? be32_to_cpup(ppp) : 2; - nss_info("%px addr cells %d\n", ppp, addr_cells); - ppp = (__be32 *)of_get_property(node, "#size-cells", NULL); - size_cells = ppp ? be32_to_cpup(ppp) : 2; - nss_info("%px size cells %d\n", ppp, size_cells); - - for_each_child_of_node(node, snode) { - /* - * compare (snode->full_name, "/reserved-memory/nss@40000000") may be safer - */ - nss_info("%px snode %s fn %s\n", snode, snode->name, snode->full_name); - if (strcmp(snode->name, "nss") == 0) - break; - } - of_node_put(node); - if (!snode) { - nss_info_always("nss@node not found: needed to determine NSS reserved DDR\n"); - return nss_msize; - } - - ppp = (__be32 *)of_get_property(snode, "reg", &n_items); - if (ppp) { - n_items /= sizeof(ppp[0]); - nss_msize = be32_to_cpup(ppp + addr_cells + size_cells - 1); - nss_info_always("addr/size storage words %d %d # words %d in DTS, ddr size %x\n", - addr_cells, size_cells, n_items, nss_msize); - } - of_node_put(snode); - return nss_msize; -} - -/* - * nss_get_ddr_info() - * get DDR start address and size from device tree. - */ -static void nss_get_ddr_info(struct nss_mmu_ddr_info *mmu, char *name) -{ - __be32 avail_ddr; - long cached; - struct sysinfo vals; - struct device_node *node; - - si_meminfo(&vals); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) - cached = global_page_state(NR_FILE_PAGES); -#else - cached = global_node_page_state(NR_FILE_PAGES); -#endif - - avail_ddr = (vals.totalram + cached + vals.sharedram) * vals.mem_unit; - mmu->num_active_cores = nss_top_main.num_nss; - - /* - * Since "memory" has not been used by anyone, the format is not final. - * Three (3) possible formats available: one of 1 or 2 will be final. - * 1) item_size stating_address DDR_size : odd # items - * 2) stating_address DDR_size # 32-bit each; total 2 words - * 3) stating_address DDR_size # 64-bit each; total 4 words - */ - node = of_find_node_by_name(NULL, name); - if (node) { - int isize = 0; - int n_items; - const __be32 *ppp = (__be32 *)of_get_property(node, "reg", &n_items); - - n_items /= sizeof(ppp[0]); - nss_info_always("node size %d # items %d\n", - of_n_size_cells(node), n_items); - if (ppp) { - if (n_items & 1) { /* case 1 */ - isize = be32_to_cpup(ppp); - if (isize == 1) - goto case2; - if (isize == 2) - goto case3; - n_items = 0; - } else if (n_items == 2) { -case2: - mmu->start_address = be32_to_cpup(ppp + isize); - mmu->ddr_size = be32_to_cpup(&ppp[isize + 1]); - } else if (n_items == 4) { -case3: - if (!ppp[isize] && !ppp[isize * 2]) { - if (isize) - isize = 1; - mmu->start_address = be32_to_cpup(ppp + isize + 1); - mmu->ddr_size = be32_to_cpup(ppp + isize + 3); - } else - n_items = 0; - } else - n_items = 0; - if (n_items) { - of_node_put(node); - nss_info_always("%s: %x %u (avl %u) items %d active_cores %d\n", - name, mmu->start_address, mmu->ddr_size, - avail_ddr, n_items, mmu->num_active_cores); - /* - * if DTS mechanism goes wrong, use available - * DDR and round it up to 64MB for maximum DDR. - */ - if (avail_ddr > mmu->ddr_size) - mmu->ddr_size = (avail_ddr + (63 << 20)) - & (~63 << 20); - return; - } - } - of_node_put(node); - nss_info_always("incorrect memory info %px items %d\n", - ppp, n_items); - } - - /* - * boilerplate for setting customer values; - * start_address = 0 will not change default start address - * set in NSS FW (likely 0x4000_0000) - * total available RAM + 16 MB NSS FW DDR + ~31 MB kernel mem - * we round it up by 128MB to cover potential NSS DDR increase - * and a slightly large holes. - * The size can be changed to a fixed value as DTS, but simplier. - * mmu->ddr_size = 1024 << 20 - */ - mmu->start_address = 0; - mmu->ddr_size = (avail_ddr + (127 << 20)) & (~127 << 20); - nss_info_always("RAM pages fr %lu buf %lu cached %lu %lu : %lu %u\n", - vals.freeram, vals.bufferram, cached, vals.sharedram, - vals.totalram, mmu->ddr_size); -} - -/* - * nss_send_ddr_info() - * Send DDR info to NSS - */ -static void nss_send_ddr_info(struct nss_ctx_instance *nss_own) -{ - struct nss_n2h_msg nnm; - struct nss_cmn_msg *ncm = &nnm.cm; - uint32_t ret; - nss_info("%px: send DDR info\n", nss_own); - - nss_cmn_msg_init(ncm, NSS_N2H_INTERFACE, NSS_TX_DDR_INFO_VIA_N2H_CFG, - sizeof(struct nss_mmu_ddr_info), NULL, NULL); - - nss_get_ddr_info(&nnm.msg.mmu, "memory"); - nnm.msg.mmu.nss_ddr_size = nss_soc_mem_info(); - - ret = nss_core_send_cmd(nss_own, &nnm, sizeof(nnm), NSS_NBUF_PAYLOAD_SIZE); - if (ret != NSS_TX_SUCCESS) { - nss_info_always("%px: Failed to send DDR info for core %d\n", nss_own, nss_own->id); - } -} - -/* - * nss_core_cause_to_queue() - * Map interrupt cause to queue id - */ -static inline uint16_t nss_core_cause_to_queue(uint16_t cause) -{ - if (likely(cause == NSS_N2H_INTR_DATA_QUEUE_0)) { - return NSS_IF_N2H_DATA_QUEUE_0; - } - - if (likely(cause == NSS_N2H_INTR_DATA_QUEUE_1)) { - return NSS_IF_N2H_DATA_QUEUE_1; - } - - if (likely(cause == NSS_N2H_INTR_DATA_QUEUE_2)) { - return NSS_IF_N2H_DATA_QUEUE_2; - } - - if (likely(cause == NSS_N2H_INTR_DATA_QUEUE_3)) { - return NSS_IF_N2H_DATA_QUEUE_3; - } - - if (likely(cause == NSS_N2H_INTR_EMPTY_BUFFER_QUEUE)) { - return NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE; - } - - /* - * There is no way we can reach here as cause was already identified to be related to valid queue - */ - nss_assert(0); - return 0; -} - -/* - * nss_dump_desc() - * Prints descriptor data - */ -static inline void nss_dump_desc(struct nss_ctx_instance *nss_ctx, struct n2h_descriptor *desc) -{ - printk("bad descriptor dump for nss core = %d\n", nss_ctx->id); - printk("\topaque = %px\n", (void *)desc->opaque); - printk("\tinterface = %d\n", desc->interface_num); - printk("\tbuffer_type = %d\n", desc->buffer_type); - printk("\tbit_flags = %x\n", desc->bit_flags); - printk("\tbuffer_addr = %x\n", desc->buffer); - printk("\tbuffer_len = %d\n", desc->buffer_len); - printk("\tpayload_offs = %d\n", desc->payload_offs); - printk("\tpayload_len = %d\n", desc->payload_len); - printk("\tpri = %d\n", desc->pri); -} - -/* - * nss_core_skb_needs_linearize() - * Looks at if this skb needs to be linearized or not. - */ -static inline int nss_core_skb_needs_linearize(struct sk_buff *skb, uint32_t features) -{ - return ((skb_has_frag_list(skb) && - !(features & NETIF_F_FRAGLIST)) || - (skb_shinfo(skb)->nr_frags && - !(features & NETIF_F_SG))); -} - -/* - * nss_core_handle_bounced_pkt() - * Bounced packet is returned from an interface/bridge bounce operation. - * - * Return the skb to the registrant. - */ -static inline void nss_core_handle_bounced_pkt(struct nss_ctx_instance *nss_ctx, - struct nss_shaper_bounce_registrant *reg, - struct sk_buff *nbuf) -{ - void *app_data; - struct module *owner; - nss_shaper_bounced_callback_t bounced_callback; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - spin_lock_bh(&nss_top->lock); - - /* - * Do we have a registrant? - */ - if (!reg->registered) { - spin_unlock_bh(&nss_top->lock); - dev_kfree_skb_any(nbuf); - return; - } - - /* - * Get handle to the owning registrant - */ - bounced_callback = reg->bounced_callback; - app_data = reg->app_data; - owner = reg->owner; - - /* - * Callback is active, unregistration is not permitted while this is in progress - */ - reg->callback_active = true; - spin_unlock_bh(&nss_top->lock); - if (!try_module_get(owner)) { - spin_lock_bh(&nss_top->lock); - reg->callback_active = false; - spin_unlock_bh(&nss_top->lock); - dev_kfree_skb_any(nbuf); - return; - } - - /* - * Pass bounced packet back to registrant - */ - bounced_callback(app_data, nbuf); - spin_lock_bh(&nss_top->lock); - reg->callback_active = false; - spin_unlock_bh(&nss_top->lock); - module_put(owner); -} - -/* - * nss_core_handle_virt_if_pkt() - * Handle packet destined to virtual interface. - */ -static inline void nss_core_handle_virt_if_pkt(struct nss_ctx_instance *nss_ctx, - unsigned int interface_num, - struct sk_buff *nbuf) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_subsystem_dataplane_register *subsys_dp_reg = &nss_ctx->subsys_dp_register[interface_num]; - struct net_device *ndev = NULL; - - uint32_t xmit_ret; - uint16_t queue_offset = 0; - - NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_RX_VIRTUAL]); - - /* - * Checksum is already done by NSS for packets forwarded to virtual interfaces - */ - nbuf->ip_summed = CHECKSUM_NONE; - - /* - * Obtain net_device pointer - */ - ndev = subsys_dp_reg->ndev; - if (unlikely(!ndev)) { - nss_warning("%px: Received packet for unregistered virtual interface %d", - nss_ctx, interface_num); - - /* - * NOTE: The assumption is that gather support is not - * implemented in fast path and hence we can not receive - * fragmented packets and so we do not need to take care - * of freeing a fragmented packet - */ - dev_kfree_skb_any(nbuf); - return; - } - - /* - * TODO: Need to ensure the ndev is not removed before we take dev_hold(). - */ - dev_hold(ndev); - nbuf->dev = ndev; - - /* - * Linearize the skb if needed - * - * Mixing up non linear check with in nss_core_skb_needs_linearize causes - * unencessary performance impact because of netif_skb_features() API call unconditionally - * Hence moved skb_is_nonlinear call outside. - */ - if (unlikely(skb_is_nonlinear(nbuf))) { - if (nss_core_skb_needs_linearize(nbuf, (uint32_t)netif_skb_features(nbuf)) && - __skb_linearize(nbuf)) { - /* - * We needed to linearize, but __skb_linearize() failed. Therefore - * we free the nbuf. - */ - dev_put(ndev); - dev_kfree_skb_any(nbuf); - return; - } - } - - /* - * Check to see if there is a xmit callback is registered - * in this path. The callback will decide the queue mapping. - */ - if (unlikely((subsys_dp_reg->xmit_cb))) { - skb_set_queue_mapping(nbuf, 0); - subsys_dp_reg->xmit_cb(ndev, nbuf); - dev_put(ndev); - return; - } - - /* - * Mimic Linux behavior to allow multi-queue netdev choose which queue to use - */ - if (ndev->netdev_ops->ndo_select_queue) { -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) - queue_offset = ndev->netdev_ops->ndo_select_queue(ndev, nbuf, NULL, NULL); -#else - queue_offset = ndev->netdev_ops->ndo_select_queue(ndev, nbuf, NULL); -#endif - } - - skb_set_queue_mapping(nbuf, queue_offset); - - /* - * Send the packet to virtual interface - * NOTE: Invoking this will BYPASS any assigned QDisc - this is OKAY - * as TX packets out of the NSS will have been shaped inside the NSS. - */ - xmit_ret = ndev->netdev_ops->ndo_start_xmit(nbuf, ndev); - if (unlikely(xmit_ret == NETDEV_TX_BUSY)) { - dev_kfree_skb_any(nbuf); - nss_info("%px: Congestion at virtual interface %d, %px", nss_ctx, interface_num, ndev); - } - dev_put(ndev); -} - -/* - * nss_core_handle_buffer_pkt() - * Handle data packet received on physical or virtual interface. - */ -static inline void nss_core_handle_buffer_pkt(struct nss_ctx_instance *nss_ctx, - unsigned int interface_num, - struct sk_buff *nbuf, - struct napi_struct *napi, - uint16_t flags, uint16_t qid, uint8_t service_code) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_subsystem_dataplane_register *subsys_dp_reg = &nss_ctx->subsys_dp_register[interface_num]; - struct net_device *ndev = NULL; - nss_phys_if_rx_callback_t cb; - uint16_t queue_offset = qid - NSS_IF_N2H_DATA_QUEUE_0; - - NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_RX_PACKET]); - - /* - * Check if NSS was able to obtain checksum - */ - nbuf->ip_summed = CHECKSUM_UNNECESSARY; - if (unlikely(!(flags & N2H_BIT_FLAG_IP_TRANSPORT_CHECKSUM_VALID))) { - nbuf->ip_summed = CHECKSUM_NONE; - } - - ndev = subsys_dp_reg->ndev; - if (!ndev) { - dev_kfree_skb_any(nbuf); - return; - } - - /* - * If we have a non-zero service code, call the corresponding service code - * callback. The callback will consume the skb. - * For service code, we provide the raw packet as it was received. - */ - if (unlikely(service_code)) { - nss_cmn_service_code_callback_t cb = nss_ctx->service_code_callback[service_code]; - if (likely(cb)) { - dev_hold(ndev); - nbuf->dev = ndev; - nbuf->protocol = eth_type_trans(nbuf, ndev); - cb(nss_ctx->service_code_ctx[service_code], nbuf); - dev_put(ndev); - return; - } - } - - /* - * Deliver nbuf to the interface through callback if there is one. - */ - cb = subsys_dp_reg->cb; - if (likely(cb)) { - /* - * linearize or free if requested. - */ - if (unlikely(skb_is_nonlinear(nbuf))) { - if (nss_core_skb_needs_linearize(nbuf, ndev->features) && __skb_linearize(nbuf)) { - dev_kfree_skb_any(nbuf); - return; - } - } - - /* - * Record RX queue if the netdev has that many RX queues - */ - if (queue_offset < ndev->real_num_rx_queues) { - skb_record_rx_queue(nbuf, queue_offset); - } - - cb(ndev, (void *)nbuf, napi); - return; - } - - /* - * Deliver to the stack directly. Ex. there is no rule matched for - * redirect interface. - */ - dev_hold(ndev); - nbuf->dev = ndev; - nbuf->protocol = eth_type_trans(nbuf, ndev); - netif_receive_skb(nbuf); - dev_put(ndev); -} - -/* - * nss_core_handle_ext_buffer_pkt() - * Handle Extended data plane packet received on physical or virtual interface. - */ -static inline void nss_core_handle_ext_buffer_pkt(struct nss_ctx_instance *nss_ctx, - unsigned int interface_num, - struct sk_buff *nbuf, - struct napi_struct *napi, - uint16_t flags) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_subsystem_dataplane_register *subsys_dp_reg = &nss_ctx->subsys_dp_register[interface_num]; - struct net_device *ndev = NULL; - nss_phys_if_rx_ext_data_callback_t ext_cb; - - NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_RX_EXT_PACKET]); - - /* - * Check if NSS was able to obtain checksum - */ - nbuf->ip_summed = CHECKSUM_UNNECESSARY; - if (unlikely(!(flags & N2H_BIT_FLAG_IP_TRANSPORT_CHECKSUM_VALID))) { - nbuf->ip_summed = CHECKSUM_NONE; - } - - ndev = subsys_dp_reg->ndev; - ext_cb = subsys_dp_reg->ext_cb; - if (likely(ext_cb) && likely(ndev)) { - - if (unlikely(skb_is_nonlinear(nbuf))) { - if (nss_core_skb_needs_linearize(nbuf, ndev->features) && __skb_linearize(nbuf)) { - /* - * We needed to linearize, but __skb_linearize() failed. So free the nbuf. - */ - dev_kfree_skb_any(nbuf); - return; - } - } - - ext_cb(ndev, (void *)nbuf, napi); - } else { - dev_kfree_skb_any(nbuf); - } -} - -/* - * nss_core_rx_pbuf() - * Receive a pbuf from the NSS into Linux. - */ -static inline void nss_core_rx_pbuf(struct nss_ctx_instance *nss_ctx, struct n2h_descriptor *desc, struct napi_struct *napi, - uint8_t buffer_type, struct sk_buff *nbuf, uint16_t qid) -{ - unsigned int interface_num = NSS_INTERFACE_NUM_GET(desc->interface_num); - unsigned int core_id = NSS_INTERFACE_NUM_GET_COREID(desc->interface_num); - struct nss_shaper_bounce_registrant *reg = NULL; - int32_t status; - - NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - - if (interface_num >= NSS_MAX_NET_INTERFACES) { - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_INVALID_INTERFACE]); - nss_warning("%px: Invalid interface_num: %d", nss_ctx, interface_num); - dev_kfree_skb_any(nbuf); - return; - } - - /* - * Check if core_id value is valid. - */ - if (core_id > nss_top_main.num_nss) { - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_INVALID_CORE_ID]); - nss_warning("%px: Invalid core id: %d", nss_ctx, core_id); - dev_kfree_skb_any(nbuf); - return; - } - - /* - * Check if need to convert to local core value. - */ - if (core_id) { - nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[core_id - 1]; - } - - switch (buffer_type) { - case N2H_BUFFER_PACKET: - nss_core_handle_buffer_pkt(nss_ctx, interface_num, nbuf, napi, desc->bit_flags, qid, desc->service_code); - break; - - case N2H_BUFFER_PACKET_VIRTUAL: - nss_core_handle_virt_if_pkt(nss_ctx, interface_num, nbuf); - break; - - case N2H_BUFFER_SHAPER_BOUNCED_INTERFACE: - reg = &nss_ctx->nss_top->bounce_interface_registrants[interface_num]; - nss_core_handle_bounced_pkt(nss_ctx, reg, nbuf); - break; - - case N2H_BUFFER_SHAPER_BOUNCED_BRIDGE: - reg = &nss_ctx->nss_top->bounce_bridge_registrants[interface_num]; - nss_core_handle_bounced_pkt(nss_ctx, reg, nbuf); - break; - - case N2H_BUFFER_PACKET_EXT: - nss_core_handle_ext_buffer_pkt(nss_ctx, interface_num, nbuf, napi, desc->bit_flags); - break; - - case N2H_BUFFER_STATUS: - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_STATUS]); - nss_core_handle_nss_status_pkt(nss_ctx, nbuf); - dev_kfree_skb_any(nbuf); - break; - - case N2H_BUFFER_CRYPTO_RESP: - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_CRYPTO_RESP]); - nss_core_handle_crypto_pkt(nss_ctx, interface_num, nbuf, napi); - break; - - case N2H_BUFFER_RATE_TEST: - - /* - * This is a packet NSS sent for packet rate testing. The test measures the - * maximum PPS we can achieve between the host and NSS. After we process - * the descriptor, we directly send these test packets back to NSS without further process. - * They are again marked with H2N_BUFFER_RATE_TEST buffer type so NSS can process - * and count the test packets properly. - */ - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_STATUS]); - status = nss_core_send_buffer(nss_ctx, 0, nbuf, NSS_IF_H2N_DATA_QUEUE, H2N_BUFFER_RATE_TEST, H2N_BIT_FLAG_BUFFER_REUSABLE); - if (unlikely(status != NSS_CORE_STATUS_SUCCESS)) { - dev_kfree_skb_any(nbuf); - nss_warning("%px: Unable to enqueue\n", nss_ctx); - } - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - break; - - default: - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_INVALID_BUFFER_TYPE]); - nss_warning("%px: Invalid buffer type %d received from NSS", nss_ctx, buffer_type); - dev_kfree_skb_any(nbuf); - } -} - -/* - * nss_core_set_skb_classify() - * Set skb field to avoid ingress shaping. - */ -static inline void nss_core_set_skb_classify(struct sk_buff *nbuf) -{ -#ifdef CONFIG_NET_CLS_ACT -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) - nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd); -#else - skb_set_tc_classify_offload(nbuf); -#endif -#endif -} - -/* - * nss_core_handle_nrfrag_skb() - * Handled the processing of fragmented skb's - */ -static inline bool nss_core_handle_nr_frag_skb(struct nss_ctx_instance *nss_ctx, struct sk_buff **nbuf_ptr, struct sk_buff **jumbo_start_ptr, struct n2h_descriptor *desc, unsigned int buffer_type) -{ - struct sk_buff *nbuf = *nbuf_ptr; - struct sk_buff *jumbo_start = *jumbo_start_ptr; - - uint16_t payload_len = desc->payload_len; - uint16_t payload_offs = desc->payload_offs; - uint16_t bit_flags = desc->bit_flags; - - nss_assert(desc->payload_offs + desc->payload_len <= PAGE_SIZE); - - dma_unmap_page(nss_ctx->dev, (desc->buffer + desc->payload_offs), desc->payload_len, DMA_FROM_DEVICE); - - /* - * The first and last bits are both set. Hence the received frame can't have - * chains (or it's not a scattered one). - */ - if (likely(bit_flags & N2H_BIT_FLAG_FIRST_SEGMENT) && likely(bit_flags & N2H_BIT_FLAG_LAST_SEGMENT)) { - - /* - * We have received another head before we saw the last segment. - * Free the old head as the frag list is corrupt. - */ - if (unlikely(jumbo_start)) { - nss_warning("%px: received a full frame before a last", jumbo_start); - dev_kfree_skb_any(jumbo_start); - *jumbo_start_ptr = NULL; - } - - /* - * NOTE: Need to use __skb_fill since we do not want to - * increment nr_frags again. We just want to adjust the offset - * and the length. - */ - __skb_fill_page_desc(nbuf, 0, skb_frag_page(&skb_shinfo(nbuf)->frags[0]), payload_offs, payload_len); - - /* - * We do not update truesize. We just keep the initial set value. - */ - nbuf->data_len = payload_len; - nbuf->len = payload_len; - nbuf->priority = desc->pri; - -#ifdef CONFIG_NET_CLS_ACT - /* - * Skip the ingress QoS for the packet if the descriptor has - * ingress shaped flag set. - */ - if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) { - nss_core_set_skb_classify(nbuf); - } -#endif - - goto pull; - } - - /* - * Track Number of Fragments processed. First && Last is not true fragment - */ - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_FRAG_SEG_PROCESSED]); - - /* - * NSS sent us an SG chain. - * Build a frags[] out of segments. - */ - if (unlikely((bit_flags & N2H_BIT_FLAG_FIRST_SEGMENT))) { - - /* - * We have received another head before we saw the last segment. - * Free the old head as the frag list is corrupt. - */ - if (unlikely(jumbo_start)) { - nss_warning("%px: received the second head before a last", jumbo_start); - dev_kfree_skb_any(jumbo_start); - } - - /* - * We do not update truesize. We just keep the initial set value. - */ - __skb_fill_page_desc(nbuf, 0, skb_frag_page(&skb_shinfo(nbuf)->frags[0]), payload_offs, payload_len); - nbuf->data_len = payload_len; - nbuf->len = payload_len; - nbuf->priority = desc->pri; - -#ifdef CONFIG_NET_CLS_ACT - /* - * Skip the ingress QoS for the packet if the descriptor has - * ingress shaped flag set. - */ - if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) { - nss_core_set_skb_classify(nbuf); - } -#endif - - /* - * Set jumbo pointer to nbuf - */ - *jumbo_start_ptr = nbuf; - - /* - * Skip sending until last is received. - */ - return false; - } - - NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - - /* - * We've received a middle or a last segment. - * Check that we have received a head first to avoid null deferencing. - */ - if (unlikely(jumbo_start == NULL)) { - /* - * Middle before first! Free the middle. - */ - nss_warning("%px: saw a middle skb before head", nbuf); - dev_kfree_skb_any(nbuf); - return false; - } - - /* - * Free the skb after attaching the frag to the head skb. - * Our page is safe although we are freeing it because we - * just took a reference to it. - */ - skb_add_rx_frag(jumbo_start, skb_shinfo(jumbo_start)->nr_frags, skb_frag_page(&skb_shinfo(nbuf)->frags[0]), payload_offs, payload_len, PAGE_SIZE); - skb_frag_ref(jumbo_start, skb_shinfo(jumbo_start)->nr_frags - 1); - dev_kfree_skb_any(nbuf); - - if (!(bit_flags & N2H_BIT_FLAG_LAST_SEGMENT)) { - /* - * Skip sending until last is received. - */ - return false; - } - - /* - * Last is received. Set nbuf pointer to point to - * the jumbo skb so that it continues to get processed. - */ - nbuf = jumbo_start; - *nbuf_ptr = nbuf; - *jumbo_start_ptr = NULL; - prefetch((void *)(nbuf->data)); - -pull: - /* - * We need eth hdr to be in the linear part of the skb - * for data packets. Otherwise eth_type_trans fails. - */ - if (buffer_type != N2H_BUFFER_STATUS) { - if (!pskb_may_pull(nbuf, ETH_HLEN)) { - dev_kfree_skb(nbuf); - nss_warning("%px: could not pull eth header", nbuf); - return false; - } - } - - return true; -} - -/* - * nss_core_handle_linear_skb() - * Handler for processing linear skbs. - */ -static inline bool nss_core_handle_linear_skb(struct nss_ctx_instance *nss_ctx, struct sk_buff **nbuf_ptr, struct sk_buff **head_ptr, - struct sk_buff **tail_ptr, struct n2h_descriptor *desc) -{ - uint16_t bit_flags = desc->bit_flags; - struct sk_buff *nbuf = *nbuf_ptr; - struct sk_buff *head = *head_ptr; - struct sk_buff *tail = *tail_ptr; - - /* - * We are in linear SKB mode. - */ - nbuf->data = nbuf->head + desc->payload_offs; - nbuf->len = desc->payload_len; - skb_set_tail_pointer(nbuf, nbuf->len); - - dma_unmap_single(nss_ctx->dev, (desc->buffer + desc->payload_offs), desc->payload_len, - DMA_FROM_DEVICE); - - prefetch((void *)(nbuf->data)); - - if (likely(bit_flags & N2H_BIT_FLAG_FIRST_SEGMENT) && likely(bit_flags & N2H_BIT_FLAG_LAST_SEGMENT)) { - - /* - * We have received another head before we saw the last segment. - * Free the old head as the frag list is corrupt. - */ - if (unlikely(head)) { - nss_warning("%px: received a full frame before a last", head); - dev_kfree_skb_any(head); - *head_ptr = NULL; - } - - nbuf->priority = desc->pri; - -#ifdef CONFIG_NET_CLS_ACT - /* - * Skip the ingress QoS for the packet if the descriptor has - * ingress shaped flag set. - */ - if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) { - nss_core_set_skb_classify(nbuf); - } -#endif - - /* - * TODO: Check if there is any issue wrt map and unmap, - * NSS should playaround with data area and should not - * touch HEADROOM area - */ - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_SIMPLE]); - return true; - } - - /* - * Track number of skb chain processed. First && Last is not true segment. - */ - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_CHAIN_SEG_PROCESSED]); - - /* - * NSS sent us an SG chain. - * Build a frag list out of segments. - */ - if (unlikely((bit_flags & N2H_BIT_FLAG_FIRST_SEGMENT))) { - - /* - * We have received another head before we saw the last segment. - * Free the old head as the frag list is corrupt. - */ - if (unlikely(head)) { - nss_warning("%px: received the second head before a last", head); - NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - dev_kfree_skb_any(head); - } - - /* - * Found head. - */ - if (unlikely(skb_has_frag_list(nbuf))) { - /* - * We don't support chain in a chain. - */ - nss_warning("%px: skb already has a fraglist", nbuf); - NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - dev_kfree_skb_any(nbuf); - return false; - } - - skb_frag_list_init(nbuf); - nbuf->data_len = 0; - nbuf->truesize = desc->payload_len; - nbuf->priority = desc->pri; - -#ifdef CONFIG_NET_CLS_ACT - /* - * Skip the ingress QoS for the packet if the descriptor has - * ingress shaped flag set. - */ - if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) { - nss_core_set_skb_classify(nbuf); - } -#endif - - *head_ptr = nbuf; - - /* - * Skip sending until last is received. - */ - return false; - } - - NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - - /* - * We've received a middle segment. - * Check that we have received a head first to avoid null deferencing. - */ - if (unlikely(head == NULL)) { - - /* - * Middle before first! Free the middle. - */ - nss_warning("%px: saw a middle skb before head", nbuf); - dev_kfree_skb_any(nbuf); - - return false; - } - - if (!skb_has_frag_list(head)) { - /* - * 2nd skb in the chain. head's frag_list should point to him. - */ - nbuf->next = skb_shinfo(head)->frag_list; - skb_shinfo(head)->frag_list = nbuf; - } else { - /* - * 3rd, 4th... skb in the chain. The chain's previous tail's - * next should point to him. - */ - tail->next = nbuf; - nbuf->next = NULL; - } - *tail_ptr = nbuf; - - /* - * Now we've added a new nbuf to the chain. - * Update the chain length. - */ - head->data_len += desc->payload_len; - head->len += desc->payload_len; - head->truesize += desc->payload_len; - - if (!(bit_flags & N2H_BIT_FLAG_LAST_SEGMENT)) { - /* - * Skip sending until last is received. - */ - return false; - } - - /* - * Last is received. Send the frag_list. - */ - *nbuf_ptr = head; - *head_ptr = NULL; - *tail_ptr = NULL; - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_SKB_FRAGLIST]); - return true; -} - -/* - * nss_core_handle_empty_buffers() - * Handle empty buffer returns. - */ -static inline void nss_core_handle_empty_buffers(struct nss_ctx_instance *nss_ctx, - struct nss_if_mem_map *if_map, - struct hlos_n2h_desc_ring *n2h_desc_ring, - struct n2h_descriptor *desc_ring, - struct n2h_descriptor *desc, - uint32_t count, uint32_t hlos_index, - uint16_t mask) -{ - while (count) { - /* - * Since we only return the primary skb, we have no way to unmap - * properly. Simple skb's are properly mapped but page data skbs - * have the payload mapped (and not the skb->data slab payload). - * - * Warning: On non-Krait HW, we need to unmap fragments. - * - * This only unmaps the first segment either slab payload or - * skb page data. Eventually, we need to unmap all of a frag_list - * or all of page_data however this is not a big concern as of now - * since on Kriats dma_map_single() does not allocate any resource - * and hence dma_unmap_single() is sort off a nop. - * - * No need to invalidate for Tx Completions, so set dma direction = DMA_TO_DEVICE; - * Similarly prefetch is not needed for an empty buffer. - */ - struct sk_buff *nbuf; - - /* - * Prefetch the next cache line of descriptors. - */ - if (((hlos_index & 1) == 0) && likely(count > 2)) { - struct n2h_descriptor *next_cache_desc = &desc_ring[(hlos_index + 2) & mask]; - prefetch(next_cache_desc); - } - - nbuf = (struct sk_buff *)desc->opaque; - - if (unlikely(nbuf < (struct sk_buff *)PAGE_OFFSET)) { - /* - * Invalid opaque pointer - */ - nss_dump_desc(nss_ctx, desc); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_BAD_DESCRIPTOR]); - goto next; - } - - dma_unmap_single(nss_ctx->dev, (desc->buffer + desc->payload_offs), desc->payload_len, DMA_TO_DEVICE); - dev_kfree_skb_any(nbuf); - - NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_EMPTY]); - -next: - hlos_index = (hlos_index + 1) & (mask); - desc = &desc_ring[hlos_index]; - count--; - } - - n2h_desc_ring->hlos_index = hlos_index; - if_map->n2h_hlos_index[NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE] = hlos_index; - - NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->n2h_hlos_index[NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE); - NSS_CORE_DSB(); -} - -/* - * nss_core_handle_cause_queue() - * Handle interrupt cause related to N2H/H2N queues - */ -static int32_t nss_core_handle_cause_queue(struct int_ctx_instance *int_ctx, uint16_t cause, int16_t weight) -{ - int16_t count, count_temp; - uint16_t size, mask, qid; - uint32_t nss_index, hlos_index, start, end; - struct sk_buff *nbuf; - struct hlos_n2h_desc_ring *n2h_desc_ring; - struct n2h_desc_if_instance *desc_if; - struct n2h_descriptor *desc_ring; - struct n2h_descriptor *desc; - struct n2h_descriptor *next_cache_desc; - struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx; - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - struct nss_if_mem_map *if_map = mem_ctx->if_map; - - qid = nss_core_cause_to_queue(cause); - - /* - * Make sure qid < num_rings - */ - nss_assert(qid < if_map->n2h_rings); - - n2h_desc_ring = &nss_ctx->n2h_desc_ring[qid]; - desc_if = &n2h_desc_ring->desc_ring; - desc_ring = desc_if->desc; - NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->n2h_nss_index[qid], sizeof(uint32_t), DMA_FROM_DEVICE); - NSS_CORE_DSB(); - nss_index = if_map->n2h_nss_index[qid]; - - hlos_index = n2h_desc_ring->hlos_index; - size = desc_if->size; - mask = size - 1; - - /* - * Check if there is work to be done for this queue - */ - count = ((nss_index - hlos_index) + size) & (mask); - if (unlikely(count == 0)) { - return 0; - } - - /* - * Restrict ourselves to suggested weight - */ - if (count > weight) { - count = weight; - } - - /* - * Invalidate all the descriptors we are going to read - */ - start = hlos_index; - end = (hlos_index + count) & mask; - if (end > start) { - dmac_inv_range((void *)&desc_ring[start], (void *)&desc_ring[end] + sizeof(struct n2h_descriptor)); - } else { - /* - * We have wrapped around - */ - dmac_inv_range((void *)&desc_ring[start], (void *)&desc_ring[mask] + sizeof(struct n2h_descriptor)); - dmac_inv_range((void *)&desc_ring[0], (void *)&desc_ring[end] + sizeof(struct n2h_descriptor)); - } - - /* - * Prefetch the first descriptor - */ - desc = &desc_ring[hlos_index]; - prefetch(desc); - - /* - * Prefetch the next cache line of descriptors if we are starting with - * the second descriptor in the cache line. If it is the first in the cache line, - * this will be done inside the loop. - */ - if (((hlos_index & 1) == 1) && likely((count > 1))) { - next_cache_desc = &desc_ring[(hlos_index + 2) & mask]; - prefetch(next_cache_desc); - } - - if (qid == NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE) { - nss_core_handle_empty_buffers(nss_ctx, if_map, n2h_desc_ring, desc_ring, desc, count, hlos_index, mask); - return count; - } - - count_temp = count; - while (count_temp) { - unsigned int buffer_type; - nss_ptr_t opaque; - - /* - * Prefetch the next cache line of descriptors. - */ - if (((hlos_index & 1) == 0) && likely(count_temp > 2)) { - next_cache_desc = &desc_ring[(hlos_index + 2) & mask]; - prefetch(next_cache_desc); - } - - buffer_type = desc->buffer_type; - opaque = desc->opaque; - - /* - * Obtain nbuf - */ - nbuf = (struct sk_buff *)opaque; - if (unlikely(nbuf < (struct sk_buff *)PAGE_OFFSET)) { - /* - * Invalid opaque pointer - */ - nss_dump_desc(nss_ctx, desc); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_BAD_DESCRIPTOR]); - goto next; - } - - /* - * Shaping uses the singleton approach as well. No need to unmap all the segments since only - * one of them is actually looked at. - */ - if ((unlikely(buffer_type == N2H_BUFFER_SHAPER_BOUNCED_INTERFACE)) || (unlikely(buffer_type == N2H_BUFFER_SHAPER_BOUNCED_BRIDGE))) { - dma_unmap_page(nss_ctx->dev, (desc->buffer + desc->payload_offs), desc->payload_len, DMA_TO_DEVICE); - goto consume; - } - - /* - * crypto buffer - * - */ - if (unlikely((buffer_type == N2H_BUFFER_CRYPTO_RESP))) { - dma_unmap_single(NULL, (desc->buffer + desc->payload_offs), desc->payload_len, DMA_FROM_DEVICE); - goto consume; - } - - /* - * Check if we received a paged skb. - */ - if (skb_shinfo(nbuf)->nr_frags > 0) { - /* - * Check if we received paged skb while constructing - * a linear skb chain. If so we need to free. - */ - if (unlikely(n2h_desc_ring->head)) { - nss_warning("%px: we should not have an incomplete paged skb while" - " constructing a linear skb %px", nbuf, n2h_desc_ring->head); - - NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - dev_kfree_skb_any(n2h_desc_ring->head); - n2h_desc_ring->head = NULL; - } - - if (!nss_core_handle_nr_frag_skb(nss_ctx, &nbuf, &n2h_desc_ring->jumbo_start, desc, buffer_type)) { - goto next; - } - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_NR_FRAGS]); - goto consume; - } - - /* - * Check if we received a linear skb while constructing - * a paged skb. If so we need to free the paged_skb and handle the linear skb. - */ - if (unlikely(n2h_desc_ring->jumbo_start)) { - nss_warning("%px: we should not have an incomplete linear skb while" - " constructing a paged skb %px", nbuf, n2h_desc_ring->jumbo_start); - - NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - dev_kfree_skb_any(n2h_desc_ring->jumbo_start); - n2h_desc_ring->jumbo_start = NULL; - } - - /* - * This is a simple linear skb. Use the the linear skb - * handler to process it. - */ - if (!nss_core_handle_linear_skb(nss_ctx, &nbuf, &n2h_desc_ring->head, &n2h_desc_ring->tail, desc)) { - goto next; - } - -consume: - nss_core_rx_pbuf(nss_ctx, desc, &(int_ctx->napi), buffer_type, nbuf, qid); - -next: - - hlos_index = (hlos_index + 1) & (mask); - desc = &desc_ring[hlos_index]; - count_temp--; - } - - n2h_desc_ring->hlos_index = hlos_index; - if_map->n2h_hlos_index[qid] = hlos_index; - - NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->n2h_hlos_index[qid], sizeof(uint32_t), DMA_TO_DEVICE); - NSS_CORE_DSB(); - - return count; -} - -/* - * nss_core_init_nss() - * Initialize NSS core state - */ -static void nss_core_init_nss(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map) -{ - struct nss_top_instance *nss_top; - int ret; - - NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(*if_map), DMA_FROM_DEVICE); - NSS_CORE_DSB(); - - /* - * NOTE: A commonly found error is that sizes and start address of per core - * virtual register map do not match in NSS and HLOS builds. This will lead - * to some hard to trace issues such as spinlock magic check failure etc. - * Following checks verify that proper virtual map has been initialized - */ - nss_assert(if_map->magic == DEV_MAGIC); - -#ifdef NSS_DRV_C2C_ENABLE - nss_ctx->c2c_start = nss_ctx->meminfo_ctx.c2c_start_dma; -#endif - - nss_top = nss_ctx->nss_top; - spin_lock_bh(&nss_top->lock); - nss_ctx->state = NSS_CORE_STATE_INITIALIZED; - spin_unlock_bh(&nss_top->lock); - - if (nss_ctx->id) { - ret = nss_n2h_update_queue_config_async(nss_ctx, pn_mq_en, pn_qlimits); - if (ret != NSS_TX_SUCCESS) { - nss_warning("Failed to send pnode queue config to core 1\n"); - } - return; - } - - /* - * If nss core0 is up, then we are ready to hook to nss-gmac - */ - if (nss_data_plane_schedule_registration()) { - - /* - * Configure the maximum number of IPv4/IPv6 - * connections supported by the accelerator. - */ - nss_ipv4_conn_cfg = max_ipv4_conn; -#ifdef NSS_DRV_IPV6_ENABLE - nss_ipv6_conn_cfg = max_ipv6_conn; - nss_ipv6_update_conn_count(max_ipv6_conn); -#endif - nss_ipv4_update_conn_count(max_ipv4_conn); - -#ifdef NSS_MEM_PROFILE_LOW - /* - * For low memory profiles, restrict the number of empty buffer pool - * size to NSS_LOW_MEM_EMPTY_POOL_BUF_SZ. Overwrite the default number - * of empty buffer pool size configured during NSS initialization. - */ - ret = nss_n2h_cfg_empty_pool_size(nss_ctx, NSS_LOW_MEM_EMPTY_POOL_BUF_SZ); - if (ret != NSS_TX_SUCCESS) { - nss_warning("%px: Failed to update empty buffer pool config\n", nss_ctx); - } -#endif - } else { - spin_lock_bh(&nss_top->lock); - nss_ctx->state = NSS_CORE_STATE_UNINITIALIZED; - spin_unlock_bh(&nss_top->lock); - } -} - -/* - * nss_core_alloc_paged_buffers() - * Allocate paged buffers for SOS. - */ -static void nss_core_alloc_paged_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map, - uint16_t count, int16_t mask, int32_t hlos_index, uint32_t alloc_fail_count, - uint32_t buffer_type, uint32_t buffer_queue, uint32_t stats_index) -{ - struct sk_buff *nbuf; - struct page *npage; - struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[buffer_queue]; - struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring; - struct h2n_descriptor *desc_ring = desc_if->desc; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - while (count) { - struct h2n_descriptor *desc = &desc_ring[hlos_index]; - dma_addr_t buffer; - - /* - * Alloc an skb AND a page. - */ - nbuf = dev_alloc_skb(NSS_CORE_JUMBO_LINEAR_BUF_SIZE); - if (unlikely(!nbuf)) { - /* - * ERR: - */ - NSS_PKT_STATS_INC(&nss_top->stats_drv[alloc_fail_count]); - nss_warning("%px: Could not obtain empty paged buffer", nss_ctx); - break; - } - - npage = alloc_page(GFP_ATOMIC); - if (unlikely(!npage)) { - /* - * ERR: - */ - dev_kfree_skb_any(nbuf); - NSS_PKT_STATS_INC(&nss_top->stats_drv[alloc_fail_count]); - nss_warning("%px: Could not obtain empty page", nss_ctx); - break; - } - - /* - * When we alloc an skb, initially head = data = tail and len = 0. - * So nobody will try to read the linear part of the skb. - */ - skb_fill_page_desc(nbuf, 0, npage, 0, PAGE_SIZE); - nbuf->data_len += PAGE_SIZE; - nbuf->len += PAGE_SIZE; - nbuf->truesize += PAGE_SIZE; - - /* Map the page for jumbo */ - buffer = dma_map_page(nss_ctx->dev, npage, 0, PAGE_SIZE, DMA_FROM_DEVICE); - desc->buffer_len = PAGE_SIZE; - desc->payload_offs = 0; - - if (unlikely(dma_mapping_error(nss_ctx->dev, buffer))) { - /* - * ERR: - */ - dev_kfree_skb_any(nbuf); - nss_warning("%px: DMA mapping failed for empty buffer", nss_ctx); - break; - } - /* - * We are holding this skb in NSS FW, let kmemleak know about it - */ - kmemleak_not_leak(nbuf); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - desc->opaque = (nss_ptr_t)nbuf; - desc->buffer = buffer; - desc->buffer_type = buffer_type; - - /* - * Flush the descriptor - */ - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - hlos_index = (hlos_index + 1) & (mask); - count--; - } - - /* - * Wait for the flushes to be synced before writing the index - */ - NSS_CORE_DSB(); - - h2n_desc_ring->hlos_index = hlos_index; - if_map->h2n_hlos_index[buffer_queue] = hlos_index; - - NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[buffer_queue], sizeof(uint32_t), DMA_TO_DEVICE); - NSS_CORE_DSB(); - - NSS_PKT_STATS_INC(&nss_top->stats_drv[stats_index]); -} - -/* - * nss_core_alloc_jumbo_mru_buffers() - * Allocate jumbo mru buffers. - */ -static void nss_core_alloc_jumbo_mru_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map, - int jumbo_mru, uint16_t count, int16_t mask, int32_t hlos_index) -{ - - struct sk_buff *nbuf; - struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE]; - struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring; - struct h2n_descriptor *desc_ring = desc_if->desc; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - while (count) { - struct h2n_descriptor *desc = &desc_ring[hlos_index]; - dma_addr_t buffer; - nbuf = dev_alloc_skb(jumbo_mru); - if (unlikely(!nbuf)) { - /* - * ERR: - */ - NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_NBUF_ALLOC_FAILS]); - nss_warning("%px: Could not obtain empty jumbo mru buffer", nss_ctx); - break; - } - - /* - * Map the skb - */ - buffer = dma_map_single(nss_ctx->dev, nbuf->head, jumbo_mru, DMA_FROM_DEVICE); - desc->buffer_len = jumbo_mru; - desc->payload_offs = (uint16_t) (nbuf->data - nbuf->head); - if (unlikely(dma_mapping_error(nss_ctx->dev, buffer))) { - /* - * ERR: - */ - dev_kfree_skb_any(nbuf); - nss_warning("%px: DMA mapping failed for empty buffer", nss_ctx); - break; - } - - /* - * We are holding this skb in NSS FW, let kmemleak know about it - */ - kmemleak_not_leak(nbuf); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - desc->opaque = (nss_ptr_t)nbuf; - desc->buffer = buffer; - desc->buffer_type = H2N_BUFFER_EMPTY; - - /* - * Flush the descriptor - */ - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - hlos_index = (hlos_index + 1) & (mask); - count--; - } - - /* - * Wait for the flushes to be synced before writing the index - */ - NSS_CORE_DSB(); - - h2n_desc_ring->hlos_index = hlos_index; - if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE] = hlos_index; - - NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE); - NSS_CORE_DSB(); - - NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_TX_EMPTY]); -} - -/* - * nss_core_alloc_max_avail_size_buffers() - * Allocate maximum available sized buffers. - */ -static void nss_core_alloc_max_avail_size_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map, - uint16_t max_buf_size, uint16_t count, int16_t mask, int32_t hlos_index) -{ - struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE]; - struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring; - struct h2n_descriptor *desc_ring = desc_if->desc; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - uint16_t payload_len = max_buf_size + NET_SKB_PAD; - uint16_t start = hlos_index; - uint16_t prev_hlos_index; - - while (count) { - dma_addr_t buffer; - struct h2n_descriptor *desc = &desc_ring[hlos_index]; - - struct sk_buff *nbuf = dev_alloc_skb(max_buf_size); - if (unlikely(!nbuf)) { - /* - * ERR: - */ - NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_NBUF_ALLOC_FAILS]); - nss_warning("%px: Could not obtain empty buffer", nss_ctx); - break; - } - - /* - * Map the skb - */ - buffer = dma_map_single(nss_ctx->dev, nbuf->head, payload_len, DMA_FROM_DEVICE); - - if (unlikely(dma_mapping_error(nss_ctx->dev, buffer))) { - /* - * ERR: - */ - dev_kfree_skb_any(nbuf); - nss_warning("%px: DMA mapping failed for empty buffer", nss_ctx); - break; - } - - /* - * We are holding this skb in NSS FW, let kmemleak know about it - */ - kmemleak_not_leak(nbuf); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - - desc->opaque = (nss_ptr_t)nbuf; - desc->buffer = buffer; - desc->buffer_len = payload_len; - - hlos_index = (hlos_index + 1) & (mask); - count--; - } - - /* - * Find the last descriptor we need to flush. - */ - prev_hlos_index = (hlos_index - 1) & mask; - - /* - * Flush the descriptors, including the descriptor at prev_hlos_index. - */ - if (prev_hlos_index > start) { - dmac_clean_range((void *)&desc_ring[start], (void *)&desc_ring[prev_hlos_index] + sizeof(struct h2n_descriptor)); - } else { - /* - * We have wrapped around - */ - dmac_clean_range((void *)&desc_ring[start], (void *)&desc_ring[mask] + sizeof(struct h2n_descriptor)); - dmac_clean_range((void *)&desc_ring[0], (void *)&desc_ring[prev_hlos_index] + sizeof(struct h2n_descriptor)); - } - - /* - * Wait for the flushes to be synced before writing the index - */ - NSS_CORE_DSB(); - - h2n_desc_ring->hlos_index = hlos_index; - if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE] = hlos_index; - - NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE); - NSS_CORE_DSB(); - - NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_TX_EMPTY]); -} - -/* - * nss_core_handle_empty_buffer_sos() - * Handle empty buffer SOS interrupt. - */ -static inline void nss_core_handle_empty_buffer_sos(struct nss_ctx_instance *nss_ctx, - struct nss_if_mem_map *if_map, uint16_t max_buf_size) -{ - uint16_t count, size, mask; - int32_t nss_index, hlos_index; - struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE]; - - int paged_mode = nss_core_get_paged_mode(); - int jumbo_mru = nss_core_get_jumbo_mru(); - - /* - * Check how many empty buffers could be filled in queue - */ - NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE], sizeof(uint32_t), DMA_FROM_DEVICE); - NSS_CORE_DSB(); - nss_index = if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE]; - - hlos_index = h2n_desc_ring->hlos_index; - size = h2n_desc_ring->desc_ring.size; - - mask = size - 1; - count = ((nss_index - hlos_index - 1) + size) & (mask); - - nss_trace("%px: Adding %d buffers to empty queue\n", nss_ctx, count); - - /* - * Fill empty buffer queue with buffers leaving one empty descriptor - * Note that total number of descriptors in queue cannot be more than (size - 1) - */ - if (!count) { - return; - } - - if (paged_mode) { - nss_core_alloc_paged_buffers(nss_ctx, if_map, count, mask, hlos_index, - NSS_DRV_STATS_NBUF_ALLOC_FAILS, H2N_BUFFER_EMPTY, - NSS_IF_H2N_EMPTY_BUFFER_QUEUE, NSS_DRV_STATS_TX_EMPTY); - } else if (jumbo_mru) { - nss_core_alloc_jumbo_mru_buffers(nss_ctx, if_map, jumbo_mru, count, - mask, hlos_index); - } else { - nss_core_alloc_max_avail_size_buffers(nss_ctx, if_map, max_buf_size, - count, mask, hlos_index); - } - - /* - * Inform NSS that new buffers are available - */ - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_EMPTY_BUFFER_QUEUE); -} - -/* - * nss_core_handle_paged_empty_buffer_sos() - * Handle paged empty buffer SOS. - */ -static inline void nss_core_handle_paged_empty_buffer_sos(struct nss_ctx_instance *nss_ctx, - struct nss_if_mem_map *if_map, uint16_t max_buf_size) -{ - uint16_t count, size, mask; - int32_t nss_index, hlos_index; - struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE]; - - /* - * Check how many empty buffers could be filled in queue - */ - NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE], sizeof(uint32_t), DMA_FROM_DEVICE); - NSS_CORE_DSB(); - nss_index = if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE]; - - hlos_index = h2n_desc_ring->hlos_index; - size = h2n_desc_ring->desc_ring.size; - - mask = size - 1; - count = ((nss_index - hlos_index - 1) + size) & (mask); - nss_trace("%px: Adding %d buffers to paged buffer queue", nss_ctx, count); - - /* - * Fill empty buffer queue with buffers leaving one empty descriptor - * Note that total number of descriptors in queue cannot be more than (size - 1) - */ - if (!count) { - return; - } - - nss_core_alloc_paged_buffers(nss_ctx, if_map, count, mask, hlos_index, - NSS_DRV_STATS_PAGED_BUF_ALLOC_FAILS, H2N_PAGED_BUFFER_EMPTY, - NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE, NSS_DRV_STATS_PAGED_TX_EMPTY); - - /* - * Inform NSS that new buffers are available - */ - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_EMPTY_PAGED_BUFFER_QUEUE); -} - -/* - * nss_core_handle_tx_unblocked() - * Handle TX Unblocked. - */ -static inline void nss_core_handle_tx_unblocked(struct nss_ctx_instance *nss_ctx) -{ - int32_t i; - nss_trace("%px: Data queue unblocked", nss_ctx); - - /* - * Call callback functions of drivers that have registered with us - */ - spin_lock_bh(&nss_ctx->decongest_cb_lock); - - for (i = 0; i < NSS_MAX_CLIENTS; i++) { - if (nss_ctx->queue_decongestion_callback[i]) { - nss_ctx->queue_decongestion_callback[i](nss_ctx->queue_decongestion_ctx[i]); - } - } - - spin_unlock_bh(&nss_ctx->decongest_cb_lock); - nss_ctx->h2n_desc_rings[NSS_IF_H2N_DATA_QUEUE].flags &= ~NSS_H2N_DESC_RING_FLAGS_TX_STOPPED; - - /* - * Mask Tx unblocked interrupt and unmask it again when queue full condition is reached - */ - nss_hal_disable_interrupt(nss_ctx, nss_ctx->int_ctx[0].shift_factor, NSS_N2H_INTR_TX_UNBLOCKED); -} - -/* - * nss_core_handle_cause_nonqueue() - * Handle non-queue interrupt causes (e.g. empty buffer SOS, Tx unblocked) - */ -static void nss_core_handle_cause_nonqueue(struct int_ctx_instance *int_ctx, uint32_t cause, int16_t weight) -{ - struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx; - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - struct nss_if_mem_map *if_map = mem_ctx->if_map; - uint16_t max_buf_size = (uint16_t) nss_ctx->max_buf_size; -#ifdef NSS_DRV_C2C_ENABLE - uint32_t c2c_intr_addr1, c2c_intr_addr2; - int32_t i; -#endif - - nss_assert((cause == NSS_N2H_INTR_EMPTY_BUFFERS_SOS) - || (cause == NSS_N2H_INTR_TX_UNBLOCKED) - || cause == NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS); - - /* - * If this is the first time we are receiving this interrupt then - * we need to initialize local state of NSS core. This helps us save an - * interrupt cause bit. Hopefully, unlikley and branch prediction algorithm - * of processor will prevent any excessive penalties. - */ - if (unlikely(nss_ctx->state == NSS_CORE_STATE_UNINITIALIZED)) { - struct nss_top_instance *nss_top = NULL; - nss_core_init_nss(nss_ctx, if_map); - nss_send_ddr_info(nss_ctx); - - nss_info_always("%px: nss core %d booted successfully\n", nss_ctx, nss_ctx->id); - nss_top = nss_ctx->nss_top; - -#ifdef NSS_DRV_C2C_ENABLE -#if (NSS_MAX_CORES > 1) - /* - * Pass C2C addresses of already brought up cores to the recently brought - * up core. No NSS core knows the state of other other cores in system so - * NSS driver needs to mediate and kick start C2C between them - */ - for (i = 0; i < nss_top_main.num_nss; i++) { - /* - * Loop through all NSS cores and send exchange C2C addresses - * TODO: Current implementation utilizes the fact that there are - * only two cores in current design. And ofcourse ignore - * the core that we are trying to initialize. - */ - if (&nss_top->nss[i] != nss_ctx) { - /* - * Block initialization routine of any other NSS cores running on other - * processors. We do not want them to mess around with their initialization - * state and C2C addresses while we check their state. - */ - spin_lock_bh(&nss_top->lock); - if (nss_top->nss[i].state == NSS_CORE_STATE_INITIALIZED) { - spin_unlock_bh(&nss_top->lock); - c2c_intr_addr1 = (uint32_t)(nss_ctx->nphys) + NSS_REGS_C2C_INTR_SET_OFFSET; - nss_c2c_tx_msg_cfg_map(&nss_top->nss[i], nss_ctx->c2c_start, c2c_intr_addr1); - c2c_intr_addr2 = (uint32_t)(nss_top->nss[i].nphys) + NSS_REGS_C2C_INTR_SET_OFFSET; - nss_c2c_tx_msg_cfg_map(nss_ctx, nss_top->nss[i].c2c_start, c2c_intr_addr2); - continue; - } - spin_unlock_bh(&nss_top->lock); - } - } -#endif -#endif - } - - /* - * TODO: find better mechanism to handle empty buffers - */ - if (likely(cause == NSS_N2H_INTR_EMPTY_BUFFERS_SOS)) { - nss_core_handle_empty_buffer_sos(nss_ctx, if_map, max_buf_size); - } else if (cause == NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS) { - nss_core_handle_paged_empty_buffer_sos(nss_ctx, if_map, max_buf_size); - } else if (cause == NSS_N2H_INTR_TX_UNBLOCKED) { - nss_core_handle_tx_unblocked(nss_ctx); - } -} - -/* - * nss_core_get_prioritized_cause() - * Obtain proritized cause (from multiple interrupt causes) that - * must be handled by NSS driver before other causes - */ -static uint32_t nss_core_get_prioritized_cause(uint32_t cause, uint32_t *type, int16_t *weight) -{ - *type = NSS_INTR_CAUSE_INVALID; - *weight = 0; - - /* - * NOTE: This is a very simple algorithm with fixed weight and strict priority - * - * TODO: Modify the algorithm later with proper weights and Round Robin - */ - - if (cause & NSS_N2H_INTR_EMPTY_BUFFERS_SOS) { - *type = NSS_INTR_CAUSE_NON_QUEUE; - *weight = NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT; - return NSS_N2H_INTR_EMPTY_BUFFERS_SOS; - } - - if (cause & NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS) { - *type = NSS_INTR_CAUSE_NON_QUEUE; - *weight = NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT; - return NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS; - } - - if (cause & NSS_N2H_INTR_EMPTY_BUFFER_QUEUE) { - *type = NSS_INTR_CAUSE_QUEUE; - *weight = NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT; - return NSS_N2H_INTR_EMPTY_BUFFER_QUEUE; - } - - if (cause & NSS_N2H_INTR_TX_UNBLOCKED) { - *type = NSS_INTR_CAUSE_NON_QUEUE; - *weight = NSS_TX_UNBLOCKED_PROCESSING_WEIGHT; - return NSS_N2H_INTR_TX_UNBLOCKED; - } - - if (cause & NSS_N2H_INTR_DATA_QUEUE_0) { - *type = NSS_INTR_CAUSE_QUEUE; - *weight = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT; - return NSS_N2H_INTR_DATA_QUEUE_0; - } - - if (cause & NSS_N2H_INTR_DATA_QUEUE_1) { - *type = NSS_INTR_CAUSE_QUEUE; - *weight = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT; - return NSS_N2H_INTR_DATA_QUEUE_1; - } - - if (cause & NSS_N2H_INTR_DATA_QUEUE_2) { - *type = NSS_INTR_CAUSE_QUEUE; - *weight = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT; - return NSS_N2H_INTR_DATA_QUEUE_2; - } - - if (cause & NSS_N2H_INTR_DATA_QUEUE_3) { - *type = NSS_INTR_CAUSE_QUEUE; - *weight = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT; - return NSS_N2H_INTR_DATA_QUEUE_3; - } - - if (cause & NSS_N2H_INTR_COREDUMP_COMPLETE) { - *type = NSS_INTR_CAUSE_EMERGENCY; - return NSS_N2H_INTR_COREDUMP_COMPLETE; - } - - if (cause & NSS_N2H_INTR_PROFILE_DMA) { - *type = NSS_INTR_CAUSE_SDMA; - return NSS_N2H_INTR_PROFILE_DMA; - } - - return 0; -} - -/* - * nss_core_handle_napi() - * NAPI handler for NSS - */ -int nss_core_handle_napi(struct napi_struct *napi, int budget) -{ - int16_t processed, weight, count = 0; - uint32_t prio_cause, int_cause = 0, cause_type; - struct int_ctx_instance *int_ctx = container_of(napi, struct int_ctx_instance, napi); - struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx; - - /* - * Read cause of interrupt - */ - nss_hal_read_interrupt_cause(nss_ctx, int_ctx->shift_factor, &int_cause); - nss_hal_clear_interrupt_cause(nss_ctx, int_ctx->shift_factor, int_cause); - int_ctx->cause |= int_cause; - - do { - while ((int_ctx->cause) && (budget)) { - - /* - * Obtain the cause as per priority. Also obtain the weight - * - * NOTE: The idea is that all causes are processed as per priority and weight - * so that no single cause can overwhelm the system. - */ - prio_cause = nss_core_get_prioritized_cause(int_ctx->cause, &cause_type, &weight); - if (budget < weight) { - weight = budget; - } - - processed = 0; - switch (cause_type) { - case NSS_INTR_CAUSE_QUEUE: - processed = nss_core_handle_cause_queue(int_ctx, prio_cause, weight); - - count += processed; - budget -= processed; - - /* - * If #packets processed were lesser than weight then processing for this queue/cause is - * complete and we can clear this interrupt cause from interrupt context structure - */ - if (processed < weight) { - int_ctx->cause &= ~prio_cause; - } - break; - - case NSS_INTR_CAUSE_NON_QUEUE: - nss_core_handle_cause_nonqueue(int_ctx, prio_cause, weight); - int_ctx->cause &= ~prio_cause; - break; - - case NSS_INTR_CAUSE_SDMA: - nss_core_handle_napi_sdma(napi, budget); - int_ctx->cause &= ~prio_cause; - break; - - case NSS_INTR_CAUSE_EMERGENCY: - nss_info_always("NSS core %d signal COREDUMP COMPLETE %x\n", - nss_ctx->id, int_ctx->cause); - nss_fw_coredump_notify(nss_ctx, prio_cause); - int_ctx->cause &= ~prio_cause; - break; - - default: - nss_warning("%px: Invalid cause %x received from nss", nss_ctx, int_cause); - nss_assert(0); - break; - } - } - - nss_hal_read_interrupt_cause(nss_ctx, int_ctx->shift_factor, &int_cause); - nss_hal_clear_interrupt_cause(nss_ctx, int_ctx->shift_factor, int_cause); - int_ctx->cause |= int_cause; - } while ((int_ctx->cause) && (budget)); - - if (int_ctx->cause == 0) { - napi_complete(napi); - - /* - * Re-enable any further interrupt from this IRQ - */ - nss_hal_enable_interrupt(nss_ctx, int_ctx->shift_factor, NSS_HAL_SUPPORTED_INTERRUPTS); - } - - return count; -} - -/* - * nss_core_handle_napi_emergency() - * NAPI handler for NSS crash - */ -int nss_core_handle_napi_emergency(struct napi_struct *napi, int budget) -{ - struct int_ctx_instance *int_ctx = container_of(napi, struct int_ctx_instance, napi); - - nss_info_always("NSS core %d signal COREDUMP COMPLETE %x\n", - int_ctx->nss_ctx->id, int_ctx->cause); - nss_fw_coredump_notify(int_ctx->nss_ctx, 0); - - return 0; -} - -/* - * nss_core_handle_napi_sdma() - * NAPI handler for NSS soft DMA - */ -int nss_core_handle_napi_sdma(struct napi_struct *napi, int budget) -{ - struct int_ctx_instance *int_ctx = container_of(napi, struct int_ctx_instance, napi); - struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx; - struct nss_profile_sdma_ctrl *ctrl = (struct nss_profile_sdma_ctrl *)nss_ctx->meminfo_ctx.sdma_ctrl; - - if (ctrl->consumer[0].dispatch.fp) - ctrl->consumer[0].dispatch.fp(ctrl->consumer[0].arg.kp); - -#if !defined(NSS_HAL_IPQ806X_SUPPORT) - napi_complete(napi); - enable_irq(int_ctx->irq); -#endif - return 0; -} - -/* - * nss_core_handle_napi_queue() - * NAPI handler for NSS queue cause - */ -int nss_core_handle_napi_queue(struct napi_struct *napi, int budget) -{ - int processed; - struct int_ctx_instance *int_ctx = container_of(napi, struct int_ctx_instance, napi); - - processed = nss_core_handle_cause_queue(int_ctx, int_ctx->cause, budget); - if (processed < budget) { - napi_complete(napi); - enable_irq(int_ctx->irq); - } - - return processed; -} - -/* - * nss_core_handle_napi_non_queue() - * NAPI handler for NSS non queue cause - */ -int nss_core_handle_napi_non_queue(struct napi_struct *napi, int budget) -{ - struct int_ctx_instance *int_ctx = container_of(napi, struct int_ctx_instance, napi); - - nss_core_handle_cause_nonqueue(int_ctx, int_ctx->cause, 0); - napi_complete(napi); - enable_irq(int_ctx->irq); - return 0; -} - -/* - * nss_core_write_one_descriptor() - * Fills-up a descriptor with required fields. - */ -static inline void nss_core_write_one_descriptor(struct h2n_descriptor *desc, - uint16_t buffer_type, uint32_t buffer, uint32_t if_num, - nss_ptr_t opaque, uint16_t payload_off, uint16_t payload_len, uint16_t buffer_len, - uint32_t qos_tag, uint16_t mss, uint16_t bit_flags) -{ - desc->buffer_type = buffer_type; - desc->buffer = buffer; - desc->interface_num = if_num; - desc->opaque = opaque; - desc->payload_offs = payload_off; - desc->payload_len = payload_len; - desc->buffer_len = buffer_len; - desc->qos_tag = qos_tag; - desc->mss = mss; - desc->bit_flags = bit_flags; -} - -/* -* nss_core_send_unwind_dma() -* It unwinds (or unmap) DMA from descriptors -*/ -static inline void nss_core_send_unwind_dma(struct device *dev, struct h2n_desc_if_instance *desc_if, - uint16_t hlos_index, int16_t count, bool is_fraglist) -{ - struct h2n_descriptor *desc_ring = desc_if->desc; - struct h2n_descriptor *desc; - int16_t i, mask; - - mask = desc_if->size - 1; - for (i = 0; i < count; i++) { - desc = &desc_ring[hlos_index]; - if (is_fraglist) { - dma_unmap_single(dev, desc->buffer, desc->buffer_len, DMA_TO_DEVICE); - } else { - dma_unmap_page(dev, desc->buffer, desc->buffer_len, DMA_TO_DEVICE); - } - hlos_index = (hlos_index - 1) & mask; - } -} - -/* - * nss_core_skb_tail_offset() - */ -static inline uint32_t nss_core_skb_tail_offset(struct sk_buff *skb) -{ -#ifdef NET_SKBUFF_DATA_USES_OFFSET - return skb->tail; -#else - return skb->tail - skb->head; -#endif -} - -/* - * nss_core_dma_map_single() - */ -static inline uint32_t nss_core_dma_map_single(struct device *dev, struct sk_buff *skb) -{ - return (uint32_t)dma_map_single(dev, skb->head, nss_core_skb_tail_offset(skb), DMA_TO_DEVICE); -} - -#if (NSS_SKB_REUSE_SUPPORT == 1) -/* - * nss_core_skb_can_reuse - * check if skb can be reuse - */ -static inline bool nss_core_skb_can_reuse(struct nss_ctx_instance *nss_ctx, - uint32_t if_num, struct sk_buff *nbuf, int min_skb_size) -{ - /* - * If we have to call a destructor, we can't re-use the buffer? - */ - if (unlikely(nbuf->destructor != NULL)) { - return false; - } - - /* - * Check if skb has more than single user. - */ - if (unlikely(skb_shared(nbuf))) { - return false; - } - -#if IS_ENABLED(CONFIG_NF_CONNTRACK) - /* - * This check is added to avoid deadlock from nf_conntrack - * when ecm is trying to flush a rule. - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) - if (unlikely(nbuf->nfct)) { - return false; - } -#else - if (unlikely(nbuf->_nfct)) { - return false; - } -#endif -#endif - -#ifdef CONFIG_BRIDGE_NETFILTER - /* - * This check is added to avoid deadlock from nf_bridge - * when ecm is trying to flush a rule. - */ - if (unlikely(nf_bridge_info_get(nbuf))) { - return false; - } -#endif - - /* - * If skb has security parameters set do not reuse - */ - if (unlikely(skb_sec_path(nbuf))) { - return false; - } - - if (unlikely(irqs_disabled())) - return false; - - if (unlikely(skb_shinfo(nbuf)->tx_flags & SKBTX_DEV_ZEROCOPY)) - return false; - - if (unlikely(skb_is_nonlinear(nbuf))) - return false; - - if (unlikely(skb_has_frag_list(nbuf))) - return false; - - if (unlikely(skb_shinfo(nbuf)->nr_frags)) - return false; - - if (unlikely(nbuf->fclone != SKB_FCLONE_UNAVAILABLE)) - return false; - - min_skb_size = SKB_DATA_ALIGN(min_skb_size + NET_SKB_PAD); - if (unlikely(skb_end_pointer(nbuf) - nbuf->head < min_skb_size)) - return false; - - if (unlikely(skb_end_pointer(nbuf) - nbuf->head >= nss_core_get_max_reuse())) - return false; - - if (unlikely(skb_cloned(nbuf))) - return false; - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) - if (unlikely(skb_pfmemalloc(nbuf))) - return false; -#endif - - return true; -} - -/* - * nss_skb_reuse - clean up an skb - * Clears the skb to be reused as a receive buffer. - * - * NOTE: This function does any necessary reference count dropping, and - * cleans up the skbuff as if its allocated fresh. - */ -void nss_skb_reuse(struct sk_buff *nbuf) -{ - struct skb_shared_info *shinfo; - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) - u8 head_frag = nbuf->head_frag; -#endif - - /* - * Reset all the necessary head state information from skb which - * we found can be recycled for NSS. - */ - skb_dst_drop(nbuf); - - shinfo = skb_shinfo(nbuf); - memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); - atomic_set(&shinfo->dataref, 1); - - memset(nbuf, 0, offsetof(struct sk_buff, tail)); - nbuf->data = nbuf->head + NET_SKB_PAD; - skb_reset_tail_pointer(nbuf); - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) - nbuf->head_frag = head_frag; -#endif -} -#endif - -/* - * nss_core_send_buffer_simple_skb() - * Sends one skb to NSS FW - */ -static inline int32_t nss_core_send_buffer_simple_skb(struct nss_ctx_instance *nss_ctx, - struct h2n_desc_if_instance *desc_if, uint32_t if_num, - struct sk_buff *nbuf, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss) -{ - struct h2n_descriptor *desc_ring = desc_if->desc; - struct h2n_descriptor *desc; - uint16_t bit_flags; - uint16_t mask; - uint32_t frag0phyaddr; - -#if (NSS_SKB_REUSE_SUPPORT == 1) - uint16_t sz; -#endif - - bit_flags = flags | H2N_BIT_FLAG_FIRST_SEGMENT | H2N_BIT_FLAG_LAST_SEGMENT; - if (likely(nbuf->ip_summed == CHECKSUM_PARTIAL)) { - bit_flags |= H2N_BIT_FLAG_GEN_IP_TRANSPORT_CHECKSUM; - bit_flags |= H2N_BIT_FLAG_GEN_IPV4_IP_CHECKSUM; - } else if (nbuf->ip_summed == CHECKSUM_UNNECESSARY) { - bit_flags |= H2N_BIT_FLAG_GEN_IP_TRANSPORT_CHECKSUM_NONE; - } - - mask = desc_if->size - 1; - desc = &desc_ring[hlos_index]; - -#if (NSS_SKB_REUSE_SUPPORT == 1) - /* - * Check if the caller indicates that the buffer is not to be re-used (kept in the accelerator). - */ - if (unlikely(!(bit_flags & H2N_BIT_FLAG_BUFFER_REUSABLE))) { - goto no_reuse; - } - - /* - * Since the caller is allowing re-use, we now check if the skb meets the criteria. - */ - if (unlikely(!nss_core_skb_can_reuse(nss_ctx, if_num, nbuf, nss_ctx->max_buf_size))) { - goto no_reuse; - } - - /* - * We are going to do both Tx and then Rx on this buffer, unmap the Tx - * and then map Rx over the entire buffer. - */ - sz = max((uint16_t)nss_core_skb_tail_offset(nbuf), (uint16_t)(nss_ctx->max_buf_size + NET_SKB_PAD)); - frag0phyaddr = (uint32_t)dma_map_single(nss_ctx->dev, nbuf->head, sz, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, frag0phyaddr))) { - goto no_reuse; - } - - /* - * We are allowed to re-use the packet - */ - nss_core_write_one_descriptor(desc, buffer_type, frag0phyaddr, if_num, - (nss_ptr_t)nbuf, (uint16_t)(nbuf->data - nbuf->head), nbuf->len, - sz, (uint32_t)nbuf->priority, mss, bit_flags); - - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - /* - * We are done using the skb fields and can reuse it now - */ - nss_skb_reuse(nbuf); - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_BUFFER_REUSE]); - return 1; - -no_reuse: -#endif - - bit_flags &= ~H2N_BIT_FLAG_BUFFER_REUSABLE; - frag0phyaddr = nss_core_dma_map_single(nss_ctx->dev, nbuf); - if (unlikely(dma_mapping_error(nss_ctx->dev, frag0phyaddr))) { - nss_warning("%px: DMA mapping failed for virtual address = %px", nss_ctx, nbuf->head); - return 0; - } - - nss_core_write_one_descriptor(desc, buffer_type, frag0phyaddr, if_num, - (nss_ptr_t)nbuf, (uint16_t)(nbuf->data - nbuf->head), nbuf->len, - (uint16_t)skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags); - - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_SIMPLE]); - return 1; -} - -/* - * nss_core_send_buffer_nr_frags() - * Sends frags array (NETIF_F_SG) to NSS FW - * - * Note - Opaque is set only on LAST fragment, and DISCARD is set for the rest of segments - * Used to differentiate from FRAGLIST - */ -static inline int32_t nss_core_send_buffer_nr_frags(struct nss_ctx_instance *nss_ctx, - struct h2n_desc_if_instance *desc_if, uint32_t if_num, - struct sk_buff *nbuf, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss) -{ - struct h2n_descriptor *desc_ring = desc_if->desc; - struct h2n_descriptor *desc; - const skb_frag_t *frag; - dma_addr_t buffer; - uint32_t nr_frags; - uint16_t bit_flags; - int16_t i; - uint16_t mask; - - uint32_t frag0phyaddr = nss_core_dma_map_single(nss_ctx->dev, nbuf); - if (unlikely(dma_mapping_error(nss_ctx->dev, frag0phyaddr))) { - nss_warning("%px: DMA mapping failed for virtual address = %px", nss_ctx, nbuf->head); - return 0; - } - - /* - * Set the appropriate flags. - */ - bit_flags = (flags | H2N_BIT_FLAG_DISCARD); - - /* - * Reset the reuse flag for non-linear buffers. - */ - bit_flags &= ~H2N_BIT_FLAG_BUFFER_REUSABLE; - if (likely(nbuf->ip_summed == CHECKSUM_PARTIAL)) { - bit_flags |= H2N_BIT_FLAG_GEN_IP_TRANSPORT_CHECKSUM; - bit_flags |= H2N_BIT_FLAG_GEN_IPV4_IP_CHECKSUM; - } - - mask = desc_if->size - 1; - desc = &desc_ring[hlos_index]; - - /* - * First fragment/descriptor is special - */ - nss_core_write_one_descriptor(desc, buffer_type, frag0phyaddr, if_num, - (nss_ptr_t)NULL, nbuf->data - nbuf->head, nbuf->len - nbuf->data_len, - skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags | H2N_BIT_FLAG_FIRST_SEGMENT); - - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - /* - * Now handle rest of the fragments. - */ - nr_frags = skb_shinfo(nbuf)->nr_frags; - BUG_ON(nr_frags > MAX_SKB_FRAGS); - for (i = 0; i < nr_frags; i++) { - frag = &skb_shinfo(nbuf)->frags[i]; - - buffer = skb_frag_dma_map(nss_ctx->dev, frag, 0, skb_frag_size(frag), DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, buffer))) { - nss_warning("%px: DMA mapping failed for fragment", nss_ctx); - nss_core_send_unwind_dma(nss_ctx->dev, desc_if, hlos_index, i + 1, false); - return -(i + 1); - } - - hlos_index = (hlos_index + 1) & (mask); - desc = &(desc_if->desc[hlos_index]); - - nss_core_write_one_descriptor(desc, buffer_type, buffer, if_num, - (nss_ptr_t)NULL, 0, skb_frag_size(frag), skb_frag_size(frag), - nbuf->priority, mss, bit_flags); - - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - } - - /* - * Update bit flag for last descriptor. - * The discard flag shall be set for all fragments except the - * the last one.The NSS returns the last fragment to HLOS - * after the packet processing is done.We do need to send the - * packet buffer address (skb) in the descriptor of last segment - * when the decriptor returns from NSS the HLOS uses the - * opaque field to free the memory allocated. - */ - desc->bit_flags |= H2N_BIT_FLAG_LAST_SEGMENT; - desc->bit_flags &= ~(H2N_BIT_FLAG_DISCARD); - desc->opaque = (nss_ptr_t)nbuf; - - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_NR_FRAGS]); - return i+1; -} - -/* - * nss_core_send_buffer_fraglist() - * Sends fraglist (NETIF_F_FRAGLIST) to NSS FW - * - * Note - Opaque will be set on all fragments, and DISCARD is set for the rest of segments - * Used to differentiate from FRAGS - */ -static inline int32_t nss_core_send_buffer_fraglist(struct nss_ctx_instance *nss_ctx, - struct h2n_desc_if_instance *desc_if, uint32_t if_num, - struct sk_buff *nbuf, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss) -{ - struct h2n_descriptor *desc_ring = desc_if->desc; - struct h2n_descriptor *desc; - dma_addr_t buffer; - uint16_t mask; - struct sk_buff *iter; - uint16_t bit_flags; - int16_t i; - - uint32_t frag0phyaddr = nss_core_dma_map_single(nss_ctx->dev, nbuf); - if (unlikely(dma_mapping_error(nss_ctx->dev, frag0phyaddr))) { - nss_warning("%px: DMA mapping failed for virtual address = %px", nss_ctx, nbuf->head); - return 0; - } - - /* - * Copy and Set bit flags - */ - bit_flags = flags; - - /* - * Reset the reuse flag for non-linear buffers. - */ - bit_flags &= ~H2N_BIT_FLAG_BUFFER_REUSABLE; - if (likely(nbuf->ip_summed == CHECKSUM_PARTIAL)) { - bit_flags |= H2N_BIT_FLAG_GEN_IP_TRANSPORT_CHECKSUM; - bit_flags |= H2N_BIT_FLAG_GEN_IPV4_IP_CHECKSUM; - } - - mask = desc_if->size - 1; - desc = &desc_ring[hlos_index]; - - /* - * First fragment/descriptor is special. Will hold the Opaque - */ - nss_core_write_one_descriptor(desc, buffer_type, frag0phyaddr, if_num, - (nss_ptr_t)nbuf, nbuf->data - nbuf->head, nbuf->len - nbuf->data_len, - skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags | H2N_BIT_FLAG_FIRST_SEGMENT); - - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - /* - * Walk the frag_list in nbuf - */ - i = 0; - skb_walk_frags(nbuf, iter) { - uint32_t nr_frags; - - buffer = nss_core_dma_map_single(nss_ctx->dev, iter); - if (unlikely(dma_mapping_error(nss_ctx->dev, buffer))) { - nss_warning("%px: DMA mapping failed for virtual address = %px", nss_ctx, iter->head); - nss_core_send_unwind_dma(nss_ctx->dev, desc_if, hlos_index, i + 1, true); - return -(i+1); - } - - /* - * We currently don't support frags[] array inside a - * fraglist. - */ - nr_frags = skb_shinfo(iter)->nr_frags; - if (unlikely(nr_frags > 0)) { - nss_warning("%px: fraglist with page data are not supported: %px\n", nss_ctx, iter); - nss_core_send_unwind_dma(nss_ctx->dev, desc_if, hlos_index, i + 1, true); - return -(i+1); - } - - /* - * Update index. - */ - hlos_index = (hlos_index + 1) & (mask); - desc = &(desc_if->desc[hlos_index]); - -#ifdef CONFIG_DEBUG_KMEMLEAK - /* - * We are holding this skb in NSS FW, let kmemleak know about it. - * - * If the skb is a fast clone (FCLONE), then nbuf is pointing to the - * cloned skb which is at the middle of the allocated block and kmemleak API - * would backtrace if passed such a pointer. We will need to get to the original - * skb pointer which kmemleak is aware of. - */ - if (iter->fclone == SKB_FCLONE_CLONE) { - kmemleak_not_leak(iter - 1); - } else { - kmemleak_not_leak(iter); - } -#endif - - nss_core_write_one_descriptor(desc, buffer_type, buffer, if_num, - (nss_ptr_t)iter, iter->data - iter->head, iter->len - iter->data_len, - skb_end_offset(iter), iter->priority, mss, bit_flags); - - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - i++; - } - - /* - * We need to defrag the frag_list, otherwise, if this structure is - * received back we don't know how we can reconstruct the frag_list. - * Therefore, we are clearing skb_has_fraglist. This is safe because all - * information about the segments are already sent to NSS-FW. - * So, the information will be in the NSS-FW. - */ - skb_shinfo(nbuf)->frag_list = NULL; - NSS_PKT_STATS_ADD(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT], i); - - /* - * Update bit flag for last descriptor. - */ - desc->bit_flags |= H2N_BIT_FLAG_LAST_SEGMENT; - NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE); - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_FRAGLIST]); - return i+1; -} - -/* - * nss_core_init_handlers() - * Initialize the handlers for all interfaces associated with core - */ -void nss_core_init_handlers(struct nss_ctx_instance *nss_ctx) -{ - struct nss_rx_cb_list *cb_list = nss_ctx->nss_rx_interface_handlers; - memset(cb_list, 0, sizeof(*cb_list) * NSS_MAX_NET_INTERFACES); -} - -/* - * nss_core_send_buffer() - * Send network buffer to NSS - */ -int32_t nss_core_send_buffer(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - struct sk_buff *nbuf, uint16_t qid, - uint8_t buffer_type, uint16_t flags) -{ - int16_t count, hlos_index, nss_index, size, mask; - uint32_t segments; - struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[qid]; - struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring; - struct h2n_descriptor *desc_ring; - struct h2n_descriptor *desc; - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - struct nss_if_mem_map *if_map = mem_ctx->if_map; - uint16_t mss = 0; - bool is_bounce = ((buffer_type == H2N_BUFFER_SHAPER_BOUNCE_INTERFACE) || (buffer_type == H2N_BUFFER_SHAPER_BOUNCE_BRIDGE)); - - desc_ring = desc_if->desc; - size = desc_if->size; - mask = size - 1; - - /* - * If nbuf does not have fraglist, then update nr_frags - * from frags[] array. Otherwise walk the frag_list. - */ - if (!skb_has_frag_list(nbuf)) { - segments = skb_shinfo(nbuf)->nr_frags; - BUG_ON(segments > MAX_SKB_FRAGS); - } else { - struct sk_buff *iter; - segments = 0; - skb_walk_frags(nbuf, iter) { - segments++; - } - - /* - * Check that segments do not overflow the number of descriptors - */ - if (unlikely(segments > size)) { - nss_warning("%px: Unable to fit in skb - %d segments in our descriptors", nss_ctx, segments); - return NSS_CORE_STATUS_FAILURE; - } - } - - /* - * Take a lock for queue - */ - spin_lock_bh(&h2n_desc_ring->lock); - - /* - * We need to work out if there's sufficent space in our transmit descriptor - * ring to place all the segments of a nbuf. - */ - NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->h2n_nss_index[qid], sizeof(uint32_t), DMA_FROM_DEVICE); - NSS_CORE_DSB(); - nss_index = if_map->h2n_nss_index[qid]; - - hlos_index = h2n_desc_ring->hlos_index; - - count = ((nss_index - hlos_index - 1) + size) & (mask); - - if (unlikely(count < (segments + 1))) { - /* - * NOTE: tx_q_full_cnt and TX_STOPPED flags will be used - * when we will add support for DESC Q congestion management - * in future - */ - h2n_desc_ring->tx_q_full_cnt++; - h2n_desc_ring->flags |= NSS_H2N_DESC_RING_FLAGS_TX_STOPPED; - spin_unlock_bh(&h2n_desc_ring->lock); - nss_warning("%px: Data/Command Queue full reached", nss_ctx); - -#if (NSS_PKT_STATS_ENABLED == 1) - if (nss_ctx->id == NSS_CORE_0) { - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_QUEUE_FULL_0]); - } else if (nss_ctx->id == NSS_CORE_1) { - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_QUEUE_FULL_1]); - } else { - nss_warning("%px: Invalid nss core: %d\n", nss_ctx, nss_ctx->id); - } -#endif - - /* - * Enable de-congestion interrupt from NSS - */ - nss_hal_enable_interrupt(nss_ctx, nss_ctx->int_ctx[0].shift_factor, NSS_N2H_INTR_TX_UNBLOCKED); - - return NSS_CORE_STATUS_FAILURE_QUEUE; - } - - desc = &desc_ring[hlos_index]; - - /* - * Check if segmentation enabled. - * Configure descriptor bit flags accordingly - */ - - /* - * When CONFIG_HIGHMEM is enabled OS is giving a single big chunk buffer without - * any scattered frames. - * - * NOTE: We dont have to perform segmentation offload for packets that are being - * bounced. These packets WILL return to the HLOS for freeing or further processing. - * They will NOT be transmitted by the NSS. - */ - if (skb_is_gso(nbuf) && !is_bounce) { - mss = skb_shinfo(nbuf)->gso_size; - flags |= H2N_BIT_FLAG_SEGMENTATION_ENABLE; - } - - /* - * WARNING! : The following "is_bounce" check has a potential to cause corruption - * if things change in the NSS. This check allows fragmented packets to be sent down - * with incomplete payload information since NSS does not care about the payload content - * when packets are bounced for shaping. If it starts caring in future, then this code - * will have to change. - * - * WHY WE ARE DOING THIS - Skipping S/G processing helps with performance. - * - */ - count = 0; - if (likely((segments == 0) || is_bounce)) { - count = nss_core_send_buffer_simple_skb(nss_ctx, desc_if, if_num, - nbuf, hlos_index, flags, buffer_type, mss); - } else if (skb_has_frag_list(nbuf)) { - count = nss_core_send_buffer_fraglist(nss_ctx, desc_if, if_num, - nbuf, hlos_index, flags, buffer_type, mss); - } else { - count = nss_core_send_buffer_nr_frags(nss_ctx, desc_if, if_num, - nbuf, hlos_index, flags, buffer_type, mss); - } - - if (unlikely(count <= 0)) { - /* - * We failed and hence we need to unmap dma regions - */ - nss_warning("%px: failed to map DMA regions:%d", nss_ctx, -count); - spin_unlock_bh(&h2n_desc_ring->lock); - return NSS_CORE_STATUS_FAILURE; - } - - /* - * Sync to ensure all flushing of the descriptors are complete - */ - NSS_CORE_DSB(); - - /* - * Update our host index so the NSS sees we've written a new descriptor. - */ - hlos_index = (hlos_index + count) & mask; - h2n_desc_ring->hlos_index = hlos_index; - if_map->h2n_hlos_index[qid] = hlos_index; - - NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[qid], sizeof(uint32_t), DMA_TO_DEVICE); - NSS_CORE_DSB(); - -#ifdef CONFIG_DEBUG_KMEMLEAK - /* - * We are holding this skb in NSS FW, let kmemleak know about it. - * - * If the skb is a fast clone (FCLONE), then nbuf is pointing to the - * cloned skb which is at the middle of the allocated block and kmemleak API - * would backtrace if passed such a pointer. We will need to get to the original - * skb pointer which kmemleak is aware of. - */ - if (nbuf->fclone == SKB_FCLONE_CLONE) { - kmemleak_not_leak(nbuf - 1); - } else { - kmemleak_not_leak(nbuf); - } -#endif - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]); - - spin_unlock_bh(&h2n_desc_ring->lock); - return NSS_CORE_STATUS_SUCCESS; -} - -/* - * nss_core_send_cmd() - * Send command message to NSS - */ -int32_t nss_core_send_cmd(struct nss_ctx_instance *nss_ctx, void *msg, int size, int buf_size) -{ - struct nss_cmn_msg *ncm = (struct nss_cmn_msg *)msg; - int32_t status; - struct sk_buff *nbuf; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: interface: %d type: %d message dropped as core not ready\n", nss_ctx, ncm->interface, ncm->type); - return NSS_TX_FAILURE_NOT_READY; - } - - if (nss_cmn_get_msg_len(ncm) > size) { - nss_warning("%px: interface: %d type: %d message length %d is invalid, size = %d\n", - nss_ctx, ncm->interface, ncm->type, nss_cmn_get_msg_len(ncm), size); - return NSS_TX_FAILURE_TOO_LARGE; - } - - if (buf_size > PAGE_SIZE) { - nss_warning("%px: interface: %d type: %d tx request size too large: %u", - nss_ctx, ncm->interface, ncm->type, buf_size); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nbuf = dev_alloc_skb(buf_size); - if (unlikely(!nbuf)) { - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NBUF_ALLOC_FAILS]); - nss_warning("%px: interface: %d type: %d msg dropped as command allocation failed", nss_ctx, ncm->interface, ncm->type); - return NSS_TX_FAILURE; - } - - memcpy(skb_put(nbuf, buf_size), (void *)ncm, size); - - status = nss_core_send_buffer(nss_ctx, 0, nbuf, NSS_IF_H2N_CMD_QUEUE, H2N_BUFFER_CTRL, H2N_BIT_FLAG_BUFFER_REUSABLE); - if (status != NSS_CORE_STATUS_SUCCESS) { - dev_kfree_skb_any(nbuf); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_CMD_QUEUE_FULL]); - nss_warning("%px: interface: %d type: %d unable to enqueue message status %d\n", nss_ctx, ncm->interface, ncm->type, status); - return status; - } - - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_CMD_REQ]); - return status; -} - -/* - * nss_core_send_packet() - * Send data packet to NSS - */ -int32_t nss_core_send_packet(struct nss_ctx_instance *nss_ctx, struct sk_buff *nbuf, uint32_t if_num, uint32_t flag) -{ - int32_t status; - int32_t queue_id = 0; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: interface: %d packet dropped as core not ready\n", nss_ctx, if_num); - return NSS_TX_FAILURE_NOT_READY; - } - -#ifdef NSS_MULTI_H2N_DATA_RING_SUPPORT - queue_id = (skb_get_queue_mapping(nbuf) & (NSS_HOST_CORES - 1)) << 1; - if (nbuf->priority) { - queue_id++; - } -#endif - status = nss_core_send_buffer(nss_ctx, if_num, nbuf, NSS_IF_H2N_DATA_QUEUE + queue_id, H2N_BUFFER_PACKET, flag); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: interface: %d unable to enqueue packet status %d\n", nss_ctx, if_num, status); - return status; - } - - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - -#ifdef NSS_MULTI_H2N_DATA_RING_SUPPORT - /* - * Count per queue and aggregate packet count - */ - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_PACKET_QUEUE_0 + queue_id]); -#endif - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_PACKET]); - return status; -} - -/* - * nss_core_ddr_info() - * Getting DDR information for NSS core - */ -uint32_t nss_core_ddr_info(struct nss_mmu_ddr_info *mmu) -{ - nss_get_ddr_info(mmu, "memory"); - return nss_soc_mem_info(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_core.h b/feeds/ipq807x/qca-nss-drv/src/nss_core.h deleted file mode 100644 index d7f62feff..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_core.h +++ /dev/null @@ -1,1038 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * na_core.h - * NSS driver core header file. - */ - -#ifndef __NSS_CORE_H -#define __NSS_CORE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "nss_phys_if.h" -#include "nss_hlos_if.h" -#include "nss_oam.h" -#include "nss_data_plane.h" -#include "nss_gmac_stats.h" -#include "nss_meminfo.h" -#include "nss_stats.h" - -/* - * NSS debug macros - */ -#define nss_info_always(s, ...) pr_alert(s, ##__VA_ARGS__) - -#if (NSS_DEBUG_LEVEL < 1) -#define nss_assert(fmt, args...) -#else -#define nss_assert(c) if (!(c)) { BUG_ON(!(c)); } -#endif - -#if defined(CONFIG_DYNAMIC_DEBUG) -/* - * Compile messages for dynamic enable/disable - */ -#define nss_warning(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define nss_info(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define nss_trace(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#else - -/* - * Statically compile messages at different levels - */ -#if (NSS_DEBUG_LEVEL < 2) -#define nss_warning(s, ...) -#else -#define nss_warning(s, ...) pr_warn("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#endif - -#if (NSS_DEBUG_LEVEL < 3) -#define nss_info(s, ...) -#else -#define nss_info(s, ...) pr_notice("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#endif - -#if (NSS_DEBUG_LEVEL < 4) -#define nss_trace(s, ...) -#else -#define nss_trace(s, ...) pr_info("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#endif -#endif - -#if (NSS_PKT_STATS_ENABLED == 1) -#define NSS_PKT_STATS_INC(x) nss_pkt_stats_inc((x)) -#define NSS_PKT_STATS_DEC(x) nss_pkt_stats_dec((x)) -#define NSS_PKT_STATS_ADD(x, i) nss_pkt_stats_add((x), (i)) -#define NSS_PKT_STATS_SUB(x, i) nss_pkt_stats_sub((x), (i)) -#define NSS_PKT_STATS_READ(x) nss_pkt_stats_read(x) -#else -#define NSS_PKT_STATS_INC(x) -#define NSS_PKT_STATS_DEC(x) -#define NSS_PKT_STATS_ADD(x, i) -#define NSS_PKT_STATS_SUB(x, i) -#define NSS_PKT_STATS_READ(x) -#endif - -/* - * Cache operation - */ -#define NSS_CORE_DSB() dsb(sy) -#define NSS_CORE_DMA_CACHE_MAINT(start, size, dir) nss_core_dma_cache_maint(start, size, dir) - -/* - * nss_core_dma_cache_maint() - * Perform the appropriate cache op based on direction - */ -static inline void nss_core_dma_cache_maint(void *start, uint32_t size, int direction) -{ - switch (direction) { - case DMA_FROM_DEVICE:/* invalidate only */ - dmac_inv_range(start, start + size); - break; - case DMA_TO_DEVICE:/* writeback only */ - dmac_clean_range(start, start + size); - break; - case DMA_BIDIRECTIONAL:/* writeback and invalidate */ - dmac_flush_range(start, start + size); - break; - default: - BUG(); - } -} - -#define NSS_DEVICE_IF_START NSS_PHYSICAL_IF_START - -#define NSS_IS_IF_TYPE(type, if_num) ((if_num >= NSS_##type##_IF_START) && (if_num < (NSS_##type##_IF_START + NSS_MAX_##type##_INTERFACES))) - -/* - * Default payload size for NSS buffers - */ -#define NSS_NBUF_PAYLOAD_SIZE NSS_EMPTY_BUFFER_SIZE -#define NSS_NBUF_PAD_EXTRA 256 -#define NSS_NBUF_ETH_EXTRA 192 - -/* - * N2H/H2N Queue IDs - */ -#define NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE 0 -#define NSS_IF_N2H_DATA_QUEUE_0 1 -#define NSS_IF_N2H_DATA_QUEUE_1 2 -#define NSS_IF_N2H_DATA_QUEUE_2 3 -#define NSS_IF_N2H_DATA_QUEUE_3 4 - -#define NSS_IF_H2N_EMPTY_BUFFER_QUEUE 0 -#define NSS_IF_H2N_CMD_QUEUE 1 -#define NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE 2 -#define NSS_IF_H2N_DATA_QUEUE 3 - -/* - * NSS Interrupt Causes - */ -#define NSS_INTR_CAUSE_INVALID 0 -#define NSS_INTR_CAUSE_QUEUE 1 -#define NSS_INTR_CAUSE_NON_QUEUE 2 -#define NSS_INTR_CAUSE_EMERGENCY 3 -#define NSS_INTR_CAUSE_SDMA 4 - -/* - * NSS Core Status - */ -#define NSS_CORE_STATUS_SUCCESS 0 -#define NSS_CORE_STATUS_FAILURE 1 -#define NSS_CORE_STATUS_FAILURE_QUEUE 2 - -/* - * NSS context magic - */ -#define NSS_CTX_MAGIC 0xDEDEDEDE - -/* - * Number of n2h descriptor rings - */ -#define NSS_N2H_DESC_RING_NUM 15 -#define NSS_H2N_DESC_RING_NUM 16 - -/* - * NSS maximum data queue per core - */ -#define NSS_MAX_DATA_QUEUE 4 - -/* - * NSS maximum IRQ per interrupt instance/core - */ -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) -#define NSS_MAX_IRQ_PER_INSTANCE 6 -#define NSS_MAX_IRQ_PER_CORE 10 /* must match with NSS_HAL_N2H_INTR_PURPOSE_MAX */ -#elif defined(NSS_HAL_IPQ50XX_SUPPORT) -#define NSS_MAX_IRQ_PER_CORE 8 -#else -#define NSS_MAX_IRQ_PER_INSTANCE 1 -#define NSS_MAX_IRQ_PER_CORE 2 -#endif - -/* - * NSS maximum clients - */ -#define NSS_MAX_CLIENTS 12 - -/* - * Maximum number of service code NSS supports - */ -#define NSS_MAX_SERVICE_CODE 256 - -/* - * Interrupt cause processing weights - */ -#define NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT 64 -#define NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT 64 -#define NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT 64 -#define NSS_TX_UNBLOCKED_PROCESSING_WEIGHT 1 - -/* - * Cache line size of the NSS. - */ -#define NSS_CACHE_LINE_SIZE 32 - -/* - * Statistics struct - * - * INFO: These numbers are based on previous generation chip - * These may change in future - */ - -/* - * NSS Frequency Defines and Values - * - * INFO: The LOW and MAX value together describe the "performance" band that we should operate the frequency at. - * - */ -#define NSS_FREQ_SCALE_NA 0xFAADFAAD /* Frequency scale not supported */ -#define NSS_FREQ_NA 0x0 /* Instructions Per ms Min */ - -#define NSS_FREQ_110 110000000 /* Frequency in hz */ -#define NSS_FREQ_110_MIN 0x03000 /* Instructions Per ms Min */ -#define NSS_FREQ_110_MAX 0x07000 /* Instructions Per ms Max */ - -#define NSS_FREQ_187 187200000 /* Frequency in hz */ -#if defined(NSS_HAL_IPQ60XX_SUPPORT) -#define NSS_FREQ_187_MIN 0x03000 /* Instructions Per ms Min */ -#define NSS_FREQ_187_MAX 0x10000 /* Instructions Per ms Max */ -#else -#define NSS_FREQ_187_MIN 0x03000 /* Instructions Per ms Min */ -#define NSS_FREQ_187_MAX 0x07000 /* Instructions Per ms Max */ -#endif - -#define NSS_FREQ_275 275000000 /* Frequency in hz */ -#define NSS_FREQ_275_MIN 0x03000 /* Instructions Per ms Min */ -#define NSS_FREQ_275_MAX 0x07000 /* Instructions Per ms Max */ - -#define NSS_FREQ_550 550000000 /* Frequency in hz */ -#define NSS_FREQ_550_MIN 0x07000 /* Instructions Per ms Min */ -#define NSS_FREQ_550_MAX 0x08000 /* Instructions Per ms Max */ - -#define NSS_FREQ_600 600000000 /* Frequency in hz */ -#define NSS_FREQ_600_MIN 0x07000 /* Instructions Per ms Min */ -#define NSS_FREQ_600_MAX 0x08000 /* Instructions Per ms Max */ - -#define NSS_FREQ_733 733000000 /* Frequency in hz */ -#define NSS_FREQ_733_MIN 0x07000 /* Instructions Per ms Min */ -#define NSS_FREQ_733_MAX 0x25000 /* Instructions Per ms Max */ - -#define NSS_FREQ_748 748800000 /* Frequency in hz */ -#if defined(NSS_HAL_IPQ60XX_SUPPORT) -#define NSS_FREQ_748_MIN 0x10000 /* Instructions Per ms Min */ -#define NSS_FREQ_748_MAX 0x18000 /* Instructions Per ms Max */ -#else -#define NSS_FREQ_748_MIN 0x07000 /* Instructions Per ms Min */ -#define NSS_FREQ_748_MAX 0x14000 /* Instructions Per ms Max */ -#endif - -#define NSS_FREQ_800 800000000 /* Frequency in hz */ -#define NSS_FREQ_800_MIN 0x07000 /* Instructions Per ms Min */ -#define NSS_FREQ_800_MAX 0x25000 /* Instructions Per ms Max */ - -#define NSS_FREQ_850 850000000 /* Frequency in hz */ -#define NSS_FREQ_850_MIN 0x07000 /* Instructions Per ms Min */ -#define NSS_FREQ_850_MAX 0x0c000 /* Instructions Per ms Max */ - -#define NSS_FREQ_1000 1000000000 /* Frequency in hz */ -#define NSS_FREQ_1000_MIN 0x0c000 /* Instructions Per ms Min */ -#define NSS_FREQ_1000_MAX 0x25000 /* Instructions Per ms Max */ - -#define NSS_FREQ_1497 1497600000 /* Frequency in hz */ -#if defined(NSS_HAL_IPQ60XX_SUPPORT) -#define NSS_FREQ_1497_MIN 0x18000 /* Instructions Per ms Min */ -#define NSS_FREQ_1497_MAX 0x25000 /* Instructions Per ms Max */ -#else -#define NSS_FREQ_1497_MIN 0x14000 /* Instructions Per ms Min */ -#define NSS_FREQ_1497_MAX 0x25000 /* Instructions Per ms Max */ -#endif - -#define NSS_FREQ_1689 1689600000 /* Frequency in hz */ -#define NSS_FREQ_1689_MIN 0x14000 /* Instructions Per ms Min */ -#define NSS_FREQ_1689_MAX 0x25000 /* Instructions Per ms Max */ - -#if (NSS_DT_SUPPORT == 1) -#define NSSTCM_FREQ 400000000 /* NSS TCM Frequency in Hz */ - -/* - * NSS Clock names - */ -#define NSS_CORE_CLK "nss-core-clk" -#define NSS_TCM_SRC_CLK "nss-tcm-src" -#define NSS_TCM_CLK "nss-tcm-clk" -#define NSS_FABRIC0_CLK "nss-fab0-clk" -#define NSS_FABRIC1_CLK "nss-fab1-clk" - -/* - * NSS Fabric speeds - */ -#define NSS_FABRIC0_TURBO 533000000 -#define NSS_FABRIC1_TURBO 266500000 -#define NSS_FABRIC0_NOMINAL 400000000 -#define NSS_FABRIC1_NOMINAL 200000000 -#define NSS_FABRIC0_IDLE 133333000 -#define NSS_FABRIC1_IDLE 133333000 -#endif - -/* Default NSS packet queue limit. */ -#define NSS_DEFAULT_QUEUE_LIMIT 256 - -/* - * Gives us important data from NSS platform data - */ -extern struct nss_top_instance nss_top_main; - -/* - * NSS core state - */ -enum nss_core_state { - NSS_CORE_STATE_UNINITIALIZED = 0, - NSS_CORE_STATE_INITIALIZED, - /* - * in following cases, only interrupts work - */ - NSS_CORE_STATE_FW_DEAD = 2, - NSS_CORE_STATE_FW_DUMP = 4, - NSS_CORE_STATE_PANIC = 8, -}; - -/* - * Forward declarations - */ -struct nss_top_instance; -struct nss_ctx_instance; -struct int_ctx_instance; -struct net_dev_priv_instance; - -/* - * Network device private data instance - */ -struct netdev_priv_instance { - struct int_ctx_instance *int_ctx; /* Back pointer to interrupt context */ -}; - -/* - * Interrupt context instance (one per queue per NSS core) - */ -struct int_ctx_instance { - struct nss_ctx_instance *nss_ctx; - /* Back pointer to NSS context of core that - owns this interrupt */ - uint32_t irq; /* HLOS IRQ numbers bind to this instance */ - uint32_t shift_factor; /* Shift factor for this IRQ queue */ - uint32_t cause; /* Interrupt cause carried forward to BH */ - struct napi_struct napi;/* NAPI handler */ -}; - -/* - * N2H descriptor ring information - */ -struct hlos_n2h_desc_ring { - struct n2h_desc_if_instance desc_ring; - /* Descriptor ring */ - uint32_t hlos_index; /* Current HLOS index for this ring */ - struct sk_buff *head; /* First segment of an skb fraglist */ - struct sk_buff *tail; /* Last segment received of an skb fraglist */ - struct sk_buff *jumbo_start; /* First segment of an skb with frags[] */ -}; - -/* - * H2N descriptor ring information - */ -struct hlos_h2n_desc_rings { - struct h2n_desc_if_instance desc_ring; /* Descriptor ring */ - uint32_t hlos_index; - spinlock_t lock; /* Lock to save from simultaneous access */ - uint32_t flags; /* Flags */ - uint64_t tx_q_full_cnt; /* Descriptor queue full count */ -}; - -#define NSS_H2N_DESC_RING_FLAGS_TX_STOPPED 0x1 /* Tx has been stopped for this queue */ - -/* - * struct nss_shaper_bounce_registrant - * Registrant detail for shaper bounce operations - */ -struct nss_shaper_bounce_registrant { - nss_shaper_bounced_callback_t bounced_callback; /* Invoked for each shaper bounced packet returned from the NSS */ - void *app_data; /* Argument given to the callback */ - struct module *owner; /* Owning module of the callback + arg */ - bool registered; - volatile bool callback_active; /* true when the bounce callback is being called */ -}; - -/* - * CB function declarations - */ -typedef void (*nss_core_rx_callback_t)(struct nss_ctx_instance *, struct nss_cmn_msg *, void *); - -/* - * NSS Rx per interface callback structure - */ -struct nss_rx_cb_list { - nss_if_rx_msg_callback_t msg_cb; - nss_core_rx_callback_t cb; - void *app_data; -}; - -/* - * NSS core <-> subsystem data plane registration related paramaters. - * This struct is filled with if_register/data_plane register APIs and - * retrieved when handling a data packet/skb destined to that subsystem. - */ -struct nss_subsystem_dataplane_register { - nss_phys_if_rx_callback_t cb; /* callback to be invoked */ - nss_phys_if_xmit_callback_t xmit_cb; - /* Callback to be invoked for sending the packets to the transmit path */ - nss_phys_if_rx_ext_data_callback_t ext_cb; - /* Extended data plane callback to be invoked. - This is needed if driver needs extended handling - of data packet before giving to stack */ - void *app_data; /* additional info passed during callback(for future use) */ - struct net_device *ndev; /* Netdevice associated with the interface */ - uint32_t features; /* skb types supported by this subsystem */ - uint32_t type; /* Indicates the type of this data plane */ -}; - -/* - * Holds statistics for every worker thread on a core - */ -struct nss_worker_thread_stats { - struct nss_project_irq_stats *irq_stats; -}; - -/* - * NSS context instance (one per NSS core) - */ -struct nss_ctx_instance { - struct nss_top_instance *nss_top; - /* Back pointer to NSS Top */ - struct device *dev; /* Pointer to the original device from probe */ - struct net_device napi_ndev; /* Dummy_netdev for NAPI */ - uint32_t id; /* Core ID for this instance */ - void __iomem *nmap; /* Pointer to NSS CSM registers */ - void __iomem *vmap; /* Virt mem pointer to virtual register map */ - void __iomem *qgic_map; /* Virt mem pointer to QGIC register */ - uint32_t nphys; /* Phys mem pointer to CSM register map */ - uint32_t vphys; /* Phys mem pointer to virtual register map */ - uint32_t qgic_phys; /* Phys mem pointer to QGIC register map */ - uint32_t load; /* Load address for this core */ - struct nss_meminfo_ctx meminfo_ctx; /* Meminfo context */ - enum nss_core_state state; /* State of NSS core */ - uint32_t c2c_start; /* C2C start address */ - uint32_t num_irq; /* IRQ numbers per queue */ - struct int_ctx_instance int_ctx[NSS_MAX_IRQ_PER_CORE]; - /* Interrupt context instances for each queue */ - struct hlos_h2n_desc_rings h2n_desc_rings[NSS_H2N_DESC_RING_NUM]; - /* Host to NSS descriptor rings */ - struct hlos_n2h_desc_ring n2h_desc_ring[NSS_N2H_DESC_RING_NUM]; - /* NSS to Host descriptor rings */ - uint16_t rps_en; /* N2H Enable Multiple queues for Data Packets */ - uint16_t n2h_mitigate_en; /* N2H mitigation */ - uint32_t max_buf_size; /* Maximum buffer size */ - uint32_t buf_sz_allocated; /* size of bufs allocated from host */ - nss_cmn_queue_decongestion_callback_t queue_decongestion_callback[NSS_MAX_CLIENTS]; - /* Queue decongestion callbacks */ - void *queue_decongestion_ctx[NSS_MAX_CLIENTS]; - /* Queue decongestion callback contexts */ - nss_cmn_service_code_callback_t service_code_callback[NSS_MAX_SERVICE_CODE]; - /* Service code callbacks */ - void *service_code_ctx[NSS_MAX_SERVICE_CODE]; - /* Service code callback contexts */ - spinlock_t decongest_cb_lock; /* Lock to protect queue decongestion cb table */ - uint16_t phys_if_mtu[NSS_MAX_PHYSICAL_INTERFACES]; - /* Current MTU value of physical interface */ - uint32_t worker_thread_count; /* Number of NSS core worker threads for statistics */ - uint32_t irq_count; /* Number of NSS core IRQs for statistics */ - struct nss_worker_thread_stats *wt_stats; - /* Worker thread statistics */ - struct nss_unaligned_stats unaligned_stats; - /* Unaligned emulation performance statistics */ - struct nss_rx_cb_list nss_rx_interface_handlers[NSS_MAX_NET_INTERFACES]; - /* NSS interface callback handlers */ - struct nss_subsystem_dataplane_register subsys_dp_register[NSS_MAX_NET_INTERFACES]; - /* Subsystem registration data */ - uint32_t magic; - /* Magic protection */ -}; - -/* - * Main NSS context structure (singleton) - */ -struct nss_top_instance { - uint8_t num_nss; /* Number of NSS cores supported */ - uint8_t num_phys_ports; /* Number of physical ports supported */ - uint32_t clk_src; /* Clock source: default/alternate */ - spinlock_t lock; /* Big lock for NSS driver */ - spinlock_t stats_lock; /* Statistics lock */ - struct mutex wq_lock; /* Mutex for NSS Work queue function */ - struct dentry *top_dentry; /* Top dentry for nss */ - struct dentry *stats_dentry; /* Top dentry for nss stats */ - struct dentry *strings_dentry; /* Top dentry for nss stats strings */ - struct dentry *project_dentry; /* per-project stats dentry */ - struct nss_ctx_instance nss[NSS_MAX_CORES]; - /* NSS contexts */ - /* - * Network processing handler core ids (CORE0/CORE1) for various interfaces - */ - uint8_t phys_if_handler_id[NSS_MAX_PHYSICAL_INTERFACES]; - uint8_t virt_if_handler_id; - uint8_t gre_redir_handler_id; - uint8_t gre_redir_lag_us_handler_id; - uint8_t gre_redir_lag_ds_handler_id; - uint8_t gre_tunnel_handler_id; - uint8_t shaping_handler_id; - uint8_t ipv4_handler_id; - uint8_t ipv4_reasm_handler_id; - uint8_t ipv6_handler_id; - uint8_t ipv6_reasm_handler_id; - uint8_t crypto_handler_id; - uint8_t ipsec_handler_id; - uint8_t wlan_handler_id; - uint8_t tun6rd_handler_id; - uint8_t wifi_handler_id; - uint8_t ppe_handler_id; - uint8_t pptp_handler_id; - uint8_t pppoe_handler_id; - uint8_t l2tpv2_handler_id; - uint8_t dtls_handler_id; - uint8_t gre_handler_id; - uint8_t map_t_handler_id; - uint8_t tunipip6_handler_id; - uint8_t frequency_handler_id; - uint8_t sjack_handler_id; - uint8_t capwap_handler_id; - uint8_t tstamp_handler_id; - uint8_t portid_handler_id; - uint8_t oam_handler_id; - uint8_t edma_handler_id; - uint8_t bridge_handler_id; - uint8_t trustsec_tx_handler_id; - uint8_t vlan_handler_id; - uint8_t qvpn_handler_id; - uint8_t pvxlan_handler_id; - uint8_t igs_handler_id; - uint8_t gre_redir_mark_handler_id; - uint8_t clmap_handler_id; - uint8_t vxlan_handler_id; - uint8_t rmnet_rx_handler_id; - uint8_t match_handler_id; - uint8_t tls_handler_id; - uint8_t mirror_handler_id; - uint8_t wmdb_handler_id; - uint8_t dma_handler_id; - uint8_t udp_st_handler_id; - - /* - * Data/Message callbacks for various interfaces - */ - nss_phys_if_msg_callback_t phys_if_msg_callback[NSS_MAX_PHYSICAL_INTERFACES]; - /* Physical interface event callback functions */ - nss_virt_if_msg_callback_t virt_if_msg_callback[NSS_MAX_VIRTUAL_INTERFACES]; - /* Virtual interface messsage callback functions */ - nss_ipv4_msg_callback_t ipv4_callback; - /* IPv4 sync/establish callback function */ - nss_ipv6_msg_callback_t ipv6_callback; - /* IPv6 sync/establish callback function */ - nss_ipsec_msg_callback_t ipsec_encap_callback; - nss_ipsec_msg_callback_t ipsec_decap_callback; - /* IPsec event callback function */ - nss_crypto_msg_callback_t crypto_msg_callback; - nss_crypto_cmn_msg_callback_t crypto_cmn_msg_callback; - nss_crypto_buf_callback_t crypto_buf_callback; - nss_crypto_pm_event_callback_t crypto_pm_callback; - /* crypto interface callback functions */ - nss_profiler_callback_t profiler_callback[NSS_MAX_CORES]; - /* Profiler interface callback function */ - nss_tun6rd_msg_callback_t tun6rd_msg_callback; - /* 6rd tunnel interface event callback function */ - nss_wifi_msg_callback_t wifi_msg_callback; - /* wifi interface event callback function */ - nss_l2tpv2_msg_callback_t l2tpv2_msg_callback; - /* l2tP tunnel interface event callback function */ - nss_dtls_msg_callback_t dtls_msg_callback; /* dtls interface event callback */ - - nss_gre_tunnel_msg_callback_t gre_tunnel_msg_callback; /* gre tunnel interface event callback */ - - nss_map_t_msg_callback_t map_t_msg_callback; - /* map-t interface event callback function */ - nss_gre_msg_callback_t gre_msg_callback; - /* gre interface event callback function */ - nss_gre_data_callback_t gre_inner_data_callback; - /* gre inner data callback function */ - nss_gre_data_callback_t gre_outer_data_callback; - /* gre outer data callback function */ - nss_tunipip6_msg_callback_t tunipip6_msg_callback; - /* ipip6 tunnel interface event callback function */ - nss_pptp_msg_callback_t pptp_msg_callback; - /* PPTP tunnel interface event callback function */ - nss_pppoe_msg_callback_t pppoe_msg_callback; - /* PPPoE interface event callback function */ - struct nss_shaper_bounce_registrant bounce_interface_registrants[NSS_MAX_NET_INTERFACES]; - /* Registrants for interface shaper bounce operations */ - struct nss_shaper_bounce_registrant bounce_bridge_registrants[NSS_MAX_NET_INTERFACES]; - /* Registrants for bridge shaper bounce operations */ - nss_lag_event_callback_t lag_event_callback; - /* Registrants for lag operations */ - nss_oam_msg_callback_t oam_callback; - /* OAM call back */ - nss_edma_msg_callback_t edma_callback; - /* EDMA callback */ - nss_bridge_msg_callback_t bridge_callback; - /* Bridge callback */ - nss_vlan_msg_callback_t vlan_callback; - /* Vlan callback */ - nss_wifili_msg_callback_t wifili_msg_callback; - /* wifili interface event callback function */ - nss_ipsec_cmn_msg_callback_t ipsec_cmn_msg_callback; - /* IPSEC common interface event callback function */ - nss_qvpn_msg_callback_t qvpn_msg_callback; - /* QVPN interface event callback function */ - nss_rmnet_rx_msg_callback_t rmnet_rx_msg_callback[NSS_MAX_VIRTUAL_INTERFACES]; - /* Virtual interface messsage callback functions */ - nss_wifi_mac_db_msg_callback_t wifi_mac_db_msg_callback; - /* wifi mac database event callback function */ - - uint32_t dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_MAX]; - - /* - * Interface contexts (non network device) - */ - void *ipv4_ctx; /* IPv4 connection manager context */ - void *ipv6_ctx; /* IPv6 connection manager context */ - void *crypto_ctx; /* Crypto interface context */ - void *crypto_pm_ctx; /* Crypto PM context */ - void *profiler_ctx[NSS_MAX_CORES]; - /* Profiler interface context */ - void *ipsec_encap_ctx; /* IPsec encap context */ - void *ipsec_decap_ctx; /* IPsec decap context */ - void *oam_ctx; /* oam context */ - void *edma_ctx; /* edma context */ - void *bridge_ctx; /* Bridge context */ - void *vlan_ctx; /* Vlan context */ - - /* - * Statistics for various interfaces - */ - atomic64_t stats_drv[NSS_DRV_STATS_MAX]; - /* Hlos driver statistics */ - uint64_t stats_gmac[NSS_MAX_PHYSICAL_INTERFACES][NSS_GMAC_STATS_MAX]; - /* GMAC statistics */ - uint64_t stats_node[NSS_MAX_NET_INTERFACES][NSS_STATS_NODE_MAX]; - /* IPv4 statistics per interface */ - bool nss_hal_common_init_done; - - uint16_t prev_mtu_sz; /* mtu sz needed as of now */ - uint16_t crypto_enabled; /* check if crypto is enabled on the platform */ - - /* - * TODO: Review and update following fields - */ - uint64_t last_rx_jiffies; /* Time of the last RX message from the NA in jiffies */ - struct nss_hal_ops *hal_ops; /* nss_hal ops for this target platform */ - struct nss_data_plane_ops *data_plane_ops; - /* nss_data_plane ops for this target platform */ -}; - -#if (NSS_PKT_STATS_ENABLED == 1) -/* - * nss_pkt_stats_inc() - */ -static inline void nss_pkt_stats_inc(atomic64_t *stat) -{ - atomic64_inc(stat); -} - -/* - * nss_pkt_stats_dec() - */ -static inline void nss_pkt_stats_dec(atomic64_t *stat) -{ - atomic64_dec(stat); -} - -/* - * nss_pkt_stats_add() - */ -static inline void nss_pkt_stats_add(atomic64_t *stat, uint32_t pkt) -{ - atomic64_add(pkt, stat); -} - -/* - * nss_pkt_stats_sub() - */ -static inline void nss_pkt_stats_sub(atomic64_t *stat, uint32_t pkt) -{ - atomic64_sub(pkt, stat); -} - -/* - * nss_pkt_stats_read() - */ -static inline uint64_t nss_pkt_stats_read(atomic64_t *stat) -{ - return atomic64_read(stat); -} - -#endif - -/* - * NSS Statistics and Data for User Space - */ -struct nss_cmd_buffer { - uint32_t current_freq; /* Current Running Freq of NSS */ - int32_t auto_scale; /* Enable or Disable auto_scale */ - int32_t max_freq; /* Maximum supported frequency index value */ - uint32_t register_addr; /* register addr buffer */ - uint32_t register_data; /* register data buffer */ - uint32_t average_inst; /* average of inst for nss core */ - uint32_t coredump; /* cmd coredump buffer */ -}; -extern struct nss_cmd_buffer nss_cmd_buf; - -/* - * The scales for NSS - */ -typedef enum nss_freq_scales { - NSS_FREQ_LOW_SCALE = 0, - NSS_FREQ_MID_SCALE = 1, - NSS_FREQ_HIGH_SCALE = 2, - NSS_FREQ_MAX_SCALE = 3, -} nss_freq_scales_t; - -/* - * NSS Core Statistics and Frequencies - */ -#define NSS_SAMPLE_BUFFER_SIZE 4 /* Ring Buffer should be a Size of two */ -#define NSS_SAMPLE_BUFFER_MASK (NSS_SAMPLE_BUFFER_SIZE - 1) -#define NSS_FREQUENCY_SCALE_RATE_LIMIT_UP 2 /* Adjust the Rate of Frequency Switching Up */ -#define NSS_FREQUENCY_SCALE_RATE_LIMIT_DOWN 60000 /* Adjust the Rate of Frequency Switching Down */ -#define NSS_MESSAGE_RATE_LIMIT 15000 /* Adjust the Rate of Displaying Statistic Messages */ - -/* - * NSS Frequency Scale Info - * - * INFO: Contains the Scale information per Frequency - * Per Scale information needed to Program PLL and make switching decisions - */ -struct nss_scale_info { - uint32_t frequency; /* Frequency in Mhz */ - uint32_t minimum; /* Minimum INST_CNT per Sec */ - uint32_t maximum; /* Maximum INST_CNT per Sec */ -}; - -/* - * NSS Runtime Sample Structure - * - * INFO: Contains the runtime statistic of the NSS core - * Also contains the per frequency scale array - */ -struct nss_runtime_sampling { - struct nss_scale_info freq_scale[NSS_FREQ_MAX_SCALE]; /* NSS Max Scale Per Freq */ - nss_freq_scales_t freq_scale_index; /* Current Freq Index */ - uint32_t freq_scale_ready; /* Allow Freq Scaling */ - uint32_t freq_scale_rate_limit_up; /* Scaling Change Rate Limit */ - uint32_t freq_scale_rate_limit_down; /* Scaling Change Rate Limit */ - uint32_t buffer[NSS_SAMPLE_BUFFER_SIZE]; /* Sample Ring Buffer */ - uint32_t buffer_index; /* Running Buffer Index */ - uint32_t sum; /* Total INST_CNT SUM */ - uint32_t sample_count; /* Number of Samples stored in Ring Buffer */ - uint32_t average; /* Average of INST_CNT */ - uint32_t message_rate_limit; /* Debug Message Rate Limit */ - uint32_t initialized; /* Flag to check for adequate initial samples */ -}; - -/* - * cpu_utilization - */ -struct nss_freq_cpu_usage { - uint32_t used; /* CPU utilization at a certain frequency percentage */ - uint32_t max_ins; /* Maximum instructions that can be executed in 1ms at the current frequency - This value is calculated by diving frequency by 1000. */ - uint32_t total; /* Total usage added over a time of NSS_FREQ_USG_AVG_FREQUENCY milliseconds*/ - uint32_t max; /* Maximum CPU usage since the boot (%) */ - uint32_t min; /* Minimum CPU usage since the boot (%) */ - uint32_t avg_up; /* Actual upper bound of the CPU USAGE (%)*/ - uint16_t avg_ctr; /* Averaging counter */ -}; - -#if (NSS_DT_SUPPORT == 1) -/* - * nss_feature_enabled - */ -enum nss_feature_enabled { - NSS_FEATURE_NOT_ENABLED = 0, /* Feature is not enabled on this core */ - NSS_FEATURE_ENABLED, /* Feature is enabled on this core */ -}; - -/* - * nss_platform_data - * Platform data per core - */ -struct nss_platform_data { - uint32_t id; /* NSS core ID */ - uint32_t num_queue; /* No. of queues supported per core */ - uint32_t num_irq; /* No. of irq binded per queue */ - uint32_t irq[NSS_MAX_IRQ_PER_CORE]; /* IRQ numbers per queue */ - void __iomem *nmap; /* Virtual addr of NSS CSM space */ - void __iomem *vmap; /* Virtual addr of NSS virtual register map */ - void __iomem *qgic_map; /* Virtual addr of QGIC interrupt register */ - uint32_t nphys; /* Physical addr of NSS CSM space */ - uint32_t vphys; /* Physical addr of NSS virtual register map */ - uint32_t qgic_phys; /* Physical addr of QGIC virtual register map */ - uint32_t load_addr; /* Load address of NSS firmware */ - - enum nss_feature_enabled capwap_enabled; - /* Does this core handle capwap? */ - enum nss_feature_enabled crypto_enabled; - /* Does this core handle crypto? */ - enum nss_feature_enabled dtls_enabled; - /* Does this core handle DTLS sessions ? */ - enum nss_feature_enabled gre_redir_enabled; - /* Does this core handle gre_redir Tunnel ? */ - enum nss_feature_enabled gre_tunnel_enabled; - /* Does this core handle gre_tunnel Tunnel ? */ - enum nss_feature_enabled ipsec_enabled; - /* Does this core handle IPsec? */ - enum nss_feature_enabled ipv4_enabled; - /* Does this core handle IPv4? */ - enum nss_feature_enabled ipv4_reasm_enabled; - /* Does this core handle IPv4 reassembly? */ - enum nss_feature_enabled ipv6_enabled; - /* Does this core handle IPv6? */ - enum nss_feature_enabled ipv6_reasm_enabled; - /* Does this core handle IPv6 reassembly? */ - enum nss_feature_enabled l2tpv2_enabled; - /* Does this core handle l2tpv2 Tunnel ? */ - enum nss_feature_enabled map_t_enabled; - /* Does this core handle map-t */ - enum nss_feature_enabled gre_enabled; - /* Does this core handle GRE */ - enum nss_feature_enabled oam_enabled; - /* Does this core handle oam? */ - enum nss_feature_enabled ppe_enabled; - /* Does this core handle ppe ? */ - enum nss_feature_enabled pppoe_enabled; - /* Does this core handle pppoe? */ - enum nss_feature_enabled pptp_enabled; - /* Does this core handle pptp Tunnel ? */ - enum nss_feature_enabled portid_enabled; - /* Does this core handle portid? */ - enum nss_feature_enabled shaping_enabled; - /* Does this core handle shaping ? */ - enum nss_feature_enabled tstamp_enabled; - /* Does this core handle timestamping? */ - enum nss_feature_enabled turbo_frequency; - /* Does this core support turbo frequencies */ - enum nss_feature_enabled tun6rd_enabled; - /* Does this core handle 6rd Tunnel ? */ - enum nss_feature_enabled tunipip6_enabled; - /* Does this core handle ipip6 Tunnel ? */ - enum nss_feature_enabled wlanredirect_enabled; - /* Does this core handle WLAN redirect? */ - enum nss_feature_enabled wifioffload_enabled; - /* Does this core handle WIFI OFFLOAD? */ - enum nss_feature_enabled bridge_enabled; - /* Does this core handle bridge configuration */ - enum nss_feature_enabled vlan_enabled; - /* Does this core handle vlan configuration */ - enum nss_feature_enabled qvpn_enabled; - /* Does this core handle QVPN Tunnel ? */ - enum nss_feature_enabled pvxlan_enabled; - /* Does this core handle pvxlan? */ - enum nss_feature_enabled igs_enabled; - /* Does this core handle igs? */ - enum nss_feature_enabled gre_redir_mark_enabled; - /* Does this core handle GRE redir mark? */ - enum nss_feature_enabled clmap_enabled; - /* Does this core handle clmap? */ - enum nss_feature_enabled vxlan_enabled; - /* Does this core handle vxlan tunnel? */ - enum nss_feature_enabled rmnet_rx_enabled; - /* Does this core handle rmnet rx? */ - enum nss_feature_enabled match_enabled; - /* Does this core handle match node? */ - enum nss_feature_enabled tls_enabled; - /* Does this core handle TLS Tunnel ? */ - enum nss_feature_enabled mirror_enabled; - /* Does this core handle mirror? */ - enum nss_feature_enabled udp_st_enabled; - /* Does this core handle udp st? */ -}; -#endif - -/* - * nss_core_log_msg_failures() - * Driver function for logging failed messages. - */ -static inline void nss_core_log_msg_failures(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - if ((ncm->response == NSS_CMN_RESPONSE_ACK) || (ncm->response == NSS_CMN_RESPONSE_NOTIFY)) { - return; - } - - /* - * TODO: Is it worth doing value to name on these values? - */ - nss_warning("%px: msg failure - interface: %d, type: %d, response: %d, error: %d", - nss_ctx, ncm->interface, ncm->type, ncm->response, ncm->error); -} - -/* - * NSS workqueue to change frequencies - */ -typedef struct { - struct work_struct my_work; /* Work Structure */ - uint32_t frequency; /* Frequency To Change */ - uint32_t stats_enable; /* Auto scale on/off */ -} nss_work_t; - -/* - * APIs provided by nss_core.c - */ -extern int nss_core_handle_napi(struct napi_struct *napi, int budget); -extern int nss_core_handle_napi_queue(struct napi_struct *napi, int budget); -extern int nss_core_handle_napi_non_queue(struct napi_struct *napi, int budget); -extern int nss_core_handle_napi_emergency(struct napi_struct *napi, int budget); -extern int nss_core_handle_napi_sdma(struct napi_struct *napi, int budget); -extern int32_t nss_core_send_buffer(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - struct sk_buff *nbuf, uint16_t qid, - uint8_t buffer_type, uint16_t flags); -extern int32_t nss_core_send_cmd(struct nss_ctx_instance *nss_ctx, void *msg, int size, int buf_size); -extern int32_t nss_core_send_packet(struct nss_ctx_instance *nss_ctx, struct sk_buff *nbuf, uint32_t if_num, uint32_t flag); -extern uint32_t nss_core_ddr_info(struct nss_mmu_ddr_info *coreinfo); -extern uint32_t nss_core_register_msg_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface, nss_if_rx_msg_callback_t msg_cb); -extern uint32_t nss_core_unregister_msg_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface); -extern uint32_t nss_core_register_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface, nss_core_rx_callback_t cb, void *app_data); -extern uint32_t nss_core_unregister_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface); -extern void nss_core_init_handlers(struct nss_ctx_instance *nss_ctx); -void nss_core_update_max_ipv4_conn(int conn); -void nss_core_update_max_ipv6_conn(int conn); -extern void nss_core_register_subsys_dp(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - nss_phys_if_rx_callback_t cb, - nss_phys_if_rx_ext_data_callback_t ext_cb, - void *app_data, struct net_device *ndev, - uint32_t features); -extern void nss_core_unregister_subsys_dp(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -void nss_core_set_subsys_dp_type(struct nss_ctx_instance *nss_ctx, struct net_device *ndev, uint32_t if_num, uint32_t type); - -static inline nss_if_rx_msg_callback_t nss_core_get_msg_handler(struct nss_ctx_instance *nss_ctx, uint32_t interface) -{ - return nss_ctx->nss_rx_interface_handlers[interface].msg_cb; -} - -static inline uint32_t nss_core_get_max_buf_size(struct nss_ctx_instance *nss_ctx) -{ - return nss_ctx->max_buf_size; -} - -/* - * APIs provided by nss_tx_rx.c - */ -extern void nss_rx_handle_status_pkt(struct nss_ctx_instance *nss_ctx, struct sk_buff *nbuf); - -/* - * APIs provided by nss_stats.c - */ -extern void nss_stats_init(void); -extern void nss_stats_clean(void); - -/* - * APIs provided by nss_log.c - */ -extern void nss_log_init(void); -extern bool nss_debug_log_buffer_alloc(uint8_t nss_id, uint32_t nentry); -extern int nss_logbuffer_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos); - -/* - * APIs to set jumbo_mru & paged_mode - */ -extern void nss_core_set_jumbo_mru(int jumbo_mru); -extern int nss_core_get_jumbo_mru(void); -extern void nss_core_set_paged_mode(int mode); -extern int nss_core_get_paged_mode(void); -#if (NSS_SKB_REUSE_SUPPORT == 1) -extern void nss_core_set_max_reuse(int max); -extern int nss_core_get_max_reuse(void); -extern uint32_t nss_core_get_min_reuse(struct nss_ctx_instance *nss_ctx); -#endif - -/* - * APIs for coredump - */ -extern void nss_coredump_notify_register(void); -extern void nss_fw_coredump_notify(struct nss_ctx_instance *nss_own, int intr); -extern int nss_coredump_init_delay_work(void); - -/* - * APIs provided by nss_freq.c - */ -extern bool nss_freq_sched_change(nss_freq_scales_t index, bool auto_scale); - -/* - * nss_freq_init_cpu_usage - * Initializes the cpu usage computation. - */ -extern void nss_freq_init_cpu_usage(void); - -/* - * APIs for PPE - */ -extern void nss_ppe_init(void); -extern void nss_ppe_free(void); - -/* - * APIs for N2H - */ -extern nss_tx_status_t nss_n2h_cfg_empty_pool_size(struct nss_ctx_instance *nss_ctx, uint32_t pool_sz); -extern nss_tx_status_t nss_n2h_paged_buf_pool_init(struct nss_ctx_instance *nss_ctx); - -#endif /* __NSS_CORE_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_coredump.c b/feeds/ipq807x/qca-nss-drv/src/nss_coredump.c deleted file mode 100644 index 691a9a712..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_coredump.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_core.c - * NSS driver core APIs source file. - */ - -#include "nss_core.h" -#include "nss_hal.h" -#include "nss_log.h" -#include -#include /* for panic_notifier_list */ -#include /* for time */ -#include "nss_tx_rx_common.h" - -#if NSS_MAX_CORES > 2 /* see comment in nss_fw_coredump_notify */ -#error too many NSS Cores: should be 1 or 2 -#endif - -static struct delayed_work coredump_queuewait; -static struct workqueue_struct *coredump_workqueue; - -/* - * nss_coredump_wait() - * reboot (panic) if all finished coredump interrupts will not come. - * N2H (C2C) interrupt may get lost during trap, as well NSS may start - * only one core; so timeout if less than desird core sends back finished - * coredump interrupt. - */ -static void nss_coredump_wait(struct work_struct *work) -{ - panic("did not get all coredump finished signals\n"); -} - -/* - * nss_coredump_init_delay_work() - * set a wait function in case coredump finish interrupt lost or - * only one NSS core is up. - */ -int nss_coredump_init_delay_work(void) -{ - coredump_workqueue = create_singlethread_workqueue("coredump_wait"); - if (!coredump_workqueue) { - nss_warning("can't set wait: hopefully all int will come\n"); - return -ENOMEM; - } - - INIT_DELAYED_WORK(&coredump_queuewait, nss_coredump_wait); - return 0; -} - -/* - * nss_panic_handler() - * notification callback register to panic chain - */ -static int nss_panic_handler(struct notifier_block *nb, - unsigned long action, void *data) -{ - int dumped, timed; - int i; - - for (i = 0; i < nss_top_main.num_nss; i++) { - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[i]; - if (nss_ctx->state & NSS_CORE_STATE_FW_DEAD || !nss_ctx->nmap) - continue; - nss_ctx->state |= NSS_CORE_STATE_PANIC; - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_TRIGGER_COREDUMP); - nss_warning("panic call NSS FW %px to dump %x\n", - nss_ctx->nmap, nss_ctx->state); - } - - /* - * wait for FW coredump done: maximum 2 rounds for each core - * 200ms per round -- 16MB * 10 over 200MHz 32-bit memory bus - * panic will take another 3-5 seconds to reboot, so longer enough. - */ - dumped = timed = 0; - do { - mdelay(200); - for (i = 0; i < nss_top_main.num_nss; i++) { - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[i]; - if ((nss_ctx->state & NSS_CORE_STATE_FW_DEAD || - !nss_ctx->nmap) && - !(nss_ctx->state & NSS_CORE_STATE_FW_DUMP)) { - nss_ctx->state |= NSS_CORE_STATE_FW_DUMP; - dumped++; - } - } - if (dumped >= nss_top_main.num_nss) { - nss_warning("NSS FW dump completed\n"); - break; - } - } while (timed++ < nss_top_main.num_nss * 2); - - if (timed >= nss_top_main.num_nss * 2) - nss_warning("might get %d FW dumped", dumped); - - return NOTIFY_DONE; -} - -static struct notifier_block nss_panic_nb = { - .notifier_call = nss_panic_handler, -}; - -/* - * nss_coredump_notify_register() - * API for nss_init to register coredump notifier to panic chain - */ -void nss_coredump_notify_register(void) -{ - atomic_notifier_chain_register(&panic_notifier_list, &nss_panic_nb); -} - -/* - * nss_fw_coredump_notify() - * handler for coredump notification from NSS FW - */ -void nss_fw_coredump_notify(struct nss_ctx_instance *nss_own, - int intr __attribute__ ((unused))) -{ - int i, j, curr_index, useful_entries, num_cores_wait; - struct nss_log_descriptor *nld; - struct nss_log_entry *nle_init, *nle_print; - dma_addr_t dma_addr; - uint32_t offset, index; - - nss_warning("%px: COREDUMP %x Baddr %px stat %x", - nss_own, intr, nss_own->nmap, nss_own->state); - nss_own->state |= NSS_CORE_STATE_FW_DEAD; - queue_delayed_work(coredump_workqueue, &coredump_queuewait, - msecs_to_jiffies(3456)); - - /* - * If external log buffer is not set, use the nss initial log buffer. - */ - nld = (struct nss_log_descriptor *)(nss_rbe[nss_own->id].addr); - dma_addr = nss_rbe[nss_own->id].dma_addr; - if (!nld) { - nld = nss_own->meminfo_ctx.logbuffer; - dma_addr = nss_own->meminfo_ctx.logbuffer_dma; - } - - dma_sync_single_for_cpu(NULL, dma_addr, sizeof(struct nss_log_descriptor), DMA_FROM_DEVICE); - - /* - * If the current entry is smaller than or equal to the number of NSS_LOG_COREDUMP_LINE_NUM, - * only print whatever is in the buffer. Otherwise, dump last NSS_LOG_COREDUMP_LINE_NUM - * to the dmessage. - */ - nss_info_always("%px: Starting NSS-FW logbuffer dump for core %u\n", - nss_own, nss_own->id); - nle_init = nld->log_ring_buffer; - if (nld->current_entry <= NSS_LOG_COREDUMP_LINE_NUM) { - curr_index = 0; - useful_entries = nld->current_entry; - } else { - curr_index = ((nld->current_entry - NSS_LOG_COREDUMP_LINE_NUM) % nld->log_nentries); - useful_entries = NSS_LOG_COREDUMP_LINE_NUM; - } - - nle_print = nle_init + curr_index; - for (j = index = curr_index; j < (curr_index + useful_entries); j++, index++) { - if (j == nld->log_nentries) { - nle_print = nle_init; - index = 0; - } - - offset = (index * sizeof(struct nss_log_entry)) - + offsetof(struct nss_log_descriptor, log_ring_buffer); - dma_sync_single_for_cpu(NULL, dma_addr + offset, - sizeof(struct nss_log_entry), DMA_FROM_DEVICE); - nss_info_always("%px: %s\n", nss_own, nle_print->message); - nle_print++; - } - - if (nss_own->state & NSS_CORE_STATE_PANIC) - return; - - /* - * We need to wait until all other cores finish their dump. - */ - num_cores_wait = (nss_top_main.num_nss - 1); - if (!num_cores_wait) { - /* - * nss_cmd_buf.coredump values: - * 0 == normal coredump and panic - * non-zero value is for debug purpose: - * 1 == force coredump and panic - * otherwise coredump but do not panic. - */ - if (!(nss_cmd_buf.coredump & 0xFFFFFFFE)) { - panic("NSS FW coredump: bringing system down\n"); - } - nss_info_always("NSS core dump completed & use mdump to collect dump to debug\n"); - return; - } - - for (i = 0; i < nss_top_main.num_nss; i++) { - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[i]; - - /* - * Skip waiting for ourselves to coredump, we already have. - */ - if (nss_ctx == nss_own) { - continue; - } - - /* - * Notify any live core to dump. - */ - if (!(nss_ctx->state & NSS_CORE_STATE_FW_DEAD) && nss_ctx->nmap) { - nss_warning("notify NSS FW %px for coredump\n", nss_ctx->nmap); - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_TRIGGER_COREDUMP); - continue; - } - - /* - * bit 1 is used for testing coredump. Any other - * bit(s) (value other than 0/1) disable panic - * in order to use mdump utility: see mdump/src/README - * for more info. - */ - if (nss_cmd_buf.coredump & 0xFFFFFFFE) { - nss_info_always("NSS core dump completed and please use mdump to collect dump data\n"); - continue; - } - - /* - * Ideally we need to unregister ourselves from the panic - * notifier list before calling the panic to prevent infinite calling. - * However, When we tried, we couldn't make it work. Therefore, We just leave the corresponding call here - * if it will be needed in the future. - * - * atomic_notifier_chain_unregister(&panic_notifier_list, &nss_panic_nb); - */ - num_cores_wait--; - if (!num_cores_wait) { - panic("NSS FW coredump: bringing system down\n"); - return; - } - - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto.c deleted file mode 100644 index 96d8c5b2c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto.c +++ /dev/null @@ -1,302 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013,2015-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_crypto.c - * NSS Crypto APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_crypto.h" -#include "nss_crypto_log.h" - -/* - ********************************** - General APIs - ********************************** - */ - -/* - * nss_crypto_set_msg_callback() - * this sets the message callback handler and its associated context - */ -static inline void nss_crypto_set_msg_callback(struct nss_ctx_instance *nss_ctx, nss_crypto_msg_callback_t cb, void *crypto_ctx) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - nss_top->crypto_ctx = crypto_ctx; - nss_top->crypto_msg_callback = cb; -} - -/* - * nss_crypto_get_msg_callback() - * this gets the message callback handler and its associated context - */ -static inline nss_crypto_msg_callback_t nss_crypto_get_msg_callback(struct nss_ctx_instance *nss_ctx, void **crypto_ctx) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - *crypto_ctx = nss_top->crypto_ctx; - return nss_top->crypto_msg_callback; -} - -/* - * nss_crypto_msg_handler() - * this handles all the IPsec events and responses - */ -static void nss_crypto_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data __attribute((unused))) -{ - struct nss_crypto_msg *nim = (struct nss_crypto_msg *)ncm; - nss_crypto_msg_callback_t cb = NULL; - void *crypto_ctx = NULL; - - /* - * Sanity check the message type - */ - if (ncm->type > NSS_CRYPTO_MSG_TYPE_MAX) { - nss_warning("%px: rx message type out of range: %d", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_crypto_msg)) { - nss_warning("%px: rx message length is invalid: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - if (ncm->interface != NSS_CRYPTO_INTERFACE) { - nss_warning("%px: rx message request for another interface: %d", nss_ctx, ncm->interface); - return; - } - - if (ncm->response == NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: rx message response for if %d, type %d, is invalid: %d", nss_ctx, ncm->interface, - ncm->type, ncm->response); - return; - } - - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_crypto_get_msg_callback(nss_ctx, &crypto_ctx); - ncm->app_data = (nss_ptr_t)crypto_ctx; - } - - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_crypto_log_rx_msg(nim); - - /* - * Load, Test & call - */ - cb = (nss_crypto_msg_callback_t)ncm->cb; - if (unlikely(!cb)) { - nss_trace("%px: rx handler has been unregistered for i/f: %d", nss_ctx, ncm->interface); - return; - } - cb((void *)ncm->app_data, nim); -} -/* - ********************************** - Tx APIs - ********************************** - */ - -/* - * nss_crypto_tx_msg - * Send crypto config to NSS. - */ -nss_tx_status_t nss_crypto_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_crypto_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - nss_info("%px: tx message %d for if %d\n", nss_ctx, ncm->type, ncm->interface); - - BUILD_BUG_ON(NSS_NBUF_PAYLOAD_SIZE < sizeof(struct nss_crypto_msg)); - - if (ncm->interface != NSS_CRYPTO_INTERFACE) { - nss_warning("%px: tx message request for another interface: %d", nss_ctx, ncm->interface); - } - - if (ncm->type > NSS_CRYPTO_MSG_TYPE_MAX) { - nss_warning("%px: tx message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - nss_info("msg params version:%d, interface:%d, type:%d, cb:%px, app_data:%px, len:%d\n", - ncm->version, ncm->interface, ncm->type, (void *)ncm->cb, (void *)ncm->app_data, ncm->len); - - /* - * Trace messages. - */ - nss_crypto_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_crypto_tx_data() - * NSS crypto TX data API. Sends a crypto buffer to NSS. - */ -nss_tx_status_t nss_crypto_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb) -{ - int32_t status; - - nss_trace("%px: tx_data buf=%px", nss_ctx, skb); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: tx_data packet dropped as core not ready", nss_ctx); - return NSS_TX_FAILURE_NOT_READY; - } - - status = nss_core_send_buffer(nss_ctx, if_num, skb, NSS_IF_H2N_DATA_QUEUE, H2N_BUFFER_PACKET, H2N_BIT_FLAG_BUFFER_REUSABLE); - if (unlikely(status != NSS_CORE_STATUS_SUCCESS)) { - nss_warning("%px: tx_data Unable to enqueue packet", nss_ctx); - if (status == NSS_CORE_STATUS_FAILURE_QUEUE) { - return NSS_TX_FAILURE_QUEUE; - } - - return NSS_TX_FAILURE; - } - - /* - * Kick the NSS awake so it can process our new entry. - */ - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_CRYPTO_REQ]); - - return NSS_TX_SUCCESS; -} - -/* - ********************************** - Register APIs - ********************************** - */ - -/* - * nss_crypto_notify_register() - * register message notifier for crypto interface - */ -struct nss_ctx_instance *nss_crypto_notify_register(nss_crypto_msg_callback_t cb, void *app_data) -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.crypto_handler_id]; - - nss_crypto_set_msg_callback(nss_ctx, cb, app_data); - - return nss_ctx; -} - -/* - * nss_crypto_notify_unregister() - * unregister message notifier for crypto interface - */ -void nss_crypto_notify_unregister(struct nss_ctx_instance *nss_ctx) -{ - nss_crypto_set_msg_callback(nss_ctx, NULL, NULL); -} - -/* - * nss_crypto_data_register() - * register a data callback routine - */ -struct nss_ctx_instance *nss_crypto_data_register(uint32_t if_num, nss_crypto_buf_callback_t cb, - struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.crypto_handler_id]; - - if ((if_num >= NSS_MAX_NET_INTERFACES) && (if_num < NSS_MAX_PHYSICAL_INTERFACES)) { - nss_warning("%px: data register received for invalid interface %d", nss_ctx, if_num); - return NULL; - } - - /* - * Register subsystem, ensuring that no duplicate registrations occur. - */ - nss_core_register_subsys_dp(nss_ctx, if_num, cb, NULL, NULL, netdev, features); - - return nss_ctx; -} - -/* - * nss_crypto_data_unregister() - * unregister a data callback routine - */ -void nss_crypto_data_unregister(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - if ((if_num >= NSS_MAX_NET_INTERFACES) && (if_num < NSS_MAX_PHYSICAL_INTERFACES)) { - nss_warning("%px: data unregister received for invalid interface %d", nss_ctx, if_num); - return; - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} - -/* - * nss_crypto_pm_notify_register() - * register a PM notify callback routine - */ -void nss_crypto_pm_notify_register(nss_crypto_pm_event_callback_t cb, void *app_data) -{ - nss_top_main.crypto_pm_ctx = app_data; - nss_top_main.crypto_pm_callback = cb; -} - -/* - * nss_crypto_pm_notify_unregister() - * unregister a PM notify callback routine - */ -void nss_crypto_pm_notify_unregister(void) -{ - nss_top_main.crypto_pm_ctx = NULL; - nss_top_main.crypto_pm_callback = NULL; -} - -/* - * nss_crypto_register_handler() - */ -void nss_crypto_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.crypto_handler_id]; - - nss_core_register_handler(nss_ctx, NSS_CRYPTO_INTERFACE, nss_crypto_msg_handler, NULL); -} - -/* - * nss_crypto_msg_init() - * Initialize crypto message - */ -void nss_crypto_msg_init(struct nss_crypto_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, - nss_crypto_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, (void *)cb, app_data); -} - -EXPORT_SYMBOL(nss_crypto_notify_register); -EXPORT_SYMBOL(nss_crypto_notify_unregister); -EXPORT_SYMBOL(nss_crypto_data_register); -EXPORT_SYMBOL(nss_crypto_data_unregister); -EXPORT_SYMBOL(nss_crypto_pm_notify_register); -EXPORT_SYMBOL(nss_crypto_pm_notify_unregister); -EXPORT_SYMBOL(nss_crypto_tx_msg); -EXPORT_SYMBOL(nss_crypto_tx_buf); -EXPORT_SYMBOL(nss_crypto_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn.c deleted file mode 100644 index 35c4c8c86..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn.c +++ /dev/null @@ -1,388 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013,2015-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_crypto_cmn.c - * NSS Crypto common API implementation - */ - -#include "nss_tx_rx_common.h" -#include "nss_crypto_cmn.h" -#include "nss_crypto_cmn_strings.h" -#include "nss_crypto_cmn_stats.h" -#include "nss_crypto_cmn_log.h" - -/* - * Amount time the synchronous message should wait for response from - * NSS before the timeout happens. After the timeout the message - * response even if it arrives has to be discarded. Typically, the - * time needs to be selected based on the worst case time in case of - * peak throughput between host & NSS. - */ -#define NSS_CRYPTO_CMN_TX_TIMEO_TICKS msecs_to_jiffies(3000) /* milliseconds */ - -/* - * Private data structure to hold state for - * the crypto specific NSS interaction - */ -struct nss_crypto_cmn_pvt { - struct semaphore sem; /* used for synchronizing 'tx_msg_sync' */ - struct completion complete; /* completion callback */ - atomic_t seq_no; /* used for tracking tx_msg_sync requests */ -}; - -/* - * This is a single instance applicable for all crypto synchronous - * messaging interaction with NSS. - */ -static struct nss_crypto_cmn_pvt g_nss_crypto_cmn; - -/* - * nss_crypto_cmn_msg_handler() - * this handles all the IPsec events and responses - */ -static void nss_crypto_cmn_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - void *app_data __attribute((unused))) -{ - struct nss_crypto_cmn_msg *nim = (struct nss_crypto_cmn_msg *)ncm; - nss_crypto_cmn_msg_callback_t cb = NULL; - - /* - * Sanity check the message type - */ - if (ncm->type > NSS_CRYPTO_CMN_MSG_TYPE_MAX) { - nss_warning("%px: rx message type out of range: %d", nss_ctx, ncm->type); - return; - } - - /* - * Check if the message structure length matches that of Host side. In case - * of failure this indicates ether the structure is different or this is not - * the intended interface. - */ - if (nss_cmn_get_msg_len(ncm) > sizeof(*nim)) { - nss_warning("%px: rx message length is invalid: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - if (ncm->response == NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: rx message response for if %d, type %d, is invalid: %d", nss_ctx, - ncm->interface, ncm->type, ncm->response); - return; - } - - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->crypto_cmn_msg_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->nss_top->crypto_ctx; - } - - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_crypto_cmn_log_rx_msg(nim); - - switch (nim->cm.type) { - case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_NODE_STATS: - case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_ENG_STATS: - case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_CTX_STATS: - /* - * Update driver statistics and send statistics - * notification to the registered modules. - */ - nss_crypto_cmn_stats_sync(nss_ctx, &nim->msg.stats); - nss_crypto_cmn_stats_notify(nss_ctx); - break; - } - /* - * Load, Test & call - */ - cb = (nss_crypto_cmn_msg_callback_t)ncm->cb; - if (unlikely(!cb)) { - nss_warning("%px: rx handler has been unregistered for i/f: %d", nss_ctx, ncm->interface); - return; - } - - cb((void *)ncm->app_data, nim); -} - -/* - * nss_crypto_cmn_tx_msg - * Send crypto config to NSS. - */ -nss_tx_status_t nss_crypto_cmn_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_crypto_cmn_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - uint16_t msg_len = nss_cmn_get_msg_len(ncm); - - nss_info("%px: tx message %d for if %d", nss_ctx, ncm->type, ncm->interface); - - BUILD_BUG_ON(NSS_NBUF_PAYLOAD_SIZE < sizeof(*msg)); - - if (ncm->type > NSS_CRYPTO_CMN_MSG_TYPE_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Check if the message structure length matches the structure length. Otherwise - * the sender accidentally programmed a incorrect length into the message. - */ - if (msg_len != sizeof(*msg)) { - nss_warning("%px: message request len bad: %d", nss_ctx, msg_len); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nss_trace("%px: msg params version:%d, interface:%d, type:%d, cb:%px, app_data:%px, len:%d", - nss_ctx, ncm->version, ncm->interface, ncm->type, - (void *)ncm->cb, (void *)ncm->app_data, ncm->len); - - /* - * Trace messages. - */ - nss_crypto_cmn_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_crypto_cmn_tx_msg); - -/* - * nss_crypto_cmn_tx_msg_cb() - * Callback to handle the synchronous completion of messages. - */ -static void nss_crypto_cmn_tx_msg_cb(void *app_data, struct nss_crypto_cmn_msg *nim) -{ - struct nss_crypto_cmn_pvt *pvt = &g_nss_crypto_cmn; - struct nss_crypto_cmn_msg *resp = (struct nss_crypto_cmn_msg *)nim->cm.app_data; - - /* - * Only update the message structure if the sequence no. matches - * Otherwise, a timeout might have happened in between and we - * are probably receiving the completion for an older message - */ - if (atomic_read(&pvt->seq_no) == nim->seq_num) { - memcpy(resp, nim, sizeof(struct nss_crypto_cmn_msg)); - complete(&pvt->complete); - } -} - -/* - * nss_crypto_cmn_tx_msg_sync() - * Transmit a crypto message to NSS firmware synchronously. - */ -nss_tx_status_t nss_crypto_cmn_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_crypto_cmn_msg *msg) -{ - struct nss_crypto_cmn_pvt *pvt = &g_nss_crypto_cmn; - nss_tx_status_t status; - int ret = 0; - - down(&pvt->sem); - atomic_inc(&pvt->seq_no); - - /* - * this is a synchronous message; overload the callback - * and app_data - */ - msg->cm.cb = (nss_ptr_t)nss_crypto_cmn_tx_msg_cb; - msg->cm.app_data = (nss_ptr_t)msg; - msg->seq_num = atomic_read(&pvt->seq_no); - - status = nss_crypto_cmn_tx_msg(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: tx_msg failed", nss_ctx); - up(&pvt->sem); - return status; - } - - /* - * Note: This cannot be called in atomic context - */ - ret = wait_for_completion_timeout(&pvt->complete, NSS_CRYPTO_CMN_TX_TIMEO_TICKS); - if (!ret) { - atomic_inc(&pvt->seq_no); - nss_warning("%px: tx_msg_sync timed out", nss_ctx); - up(&pvt->sem); - return NSS_TX_FAILURE; - } - - /* - * This ensures that the even if the response arrives on a different - * CPU core the data copied by the response callback will be visible - * to the caller which is sleeping for it on a different core. For - * further details read Linux/Documentation/memory-barrier.txt - */ - smp_rmb(); - up(&pvt->sem); - - return NSS_TX_SUCCESS; -} -EXPORT_SYMBOL(nss_crypto_cmn_tx_msg_sync); - -/* - * nss_crypto_cmn_tx_buf() - * NSS crypto TX data API. Sends a crypto buffer to NSS. - */ -nss_tx_status_t nss_crypto_cmn_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - struct sk_buff *skb) -{ - int32_t status; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: tx_data packet dropped as core not ready", nss_ctx); - return NSS_TX_FAILURE_NOT_READY; - } - - status = nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); - switch (status) { - case NSS_CORE_STATUS_SUCCESS: - break; - - case NSS_CORE_STATUS_FAILURE_QUEUE: /* queue full condition */ - nss_warning("%px: H2N queue full for tx_buf", nss_ctx); - return NSS_TX_FAILURE_QUEUE; - - default: - nss_warning("%px: general failure for tx_buf", nss_ctx); - return NSS_TX_FAILURE; - } - - /* - * Kick the NSS awake so it can process our new entry. - */ - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_CRYPTO_REQ]); - - return NSS_TX_SUCCESS; -} -EXPORT_SYMBOL(nss_crypto_cmn_tx_buf); - -/* - * nss_crypto_cmn_notify_register() - * register message notifier for crypto interface - */ -struct nss_ctx_instance *nss_crypto_cmn_notify_register(nss_crypto_cmn_msg_callback_t cb, void *app_data) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[nss_top->crypto_handler_id]; - - nss_top->crypto_ctx = app_data; - nss_top->crypto_cmn_msg_callback = cb; - - return nss_ctx; -} -EXPORT_SYMBOL(nss_crypto_cmn_notify_register); - -/* - * nss_crypto_cmn_notify_unregister() - * De-register the message notifier for crypto interface - */ -void nss_crypto_cmn_notify_unregister(struct nss_ctx_instance *nss_ctx) -{ - struct nss_top_instance *nss_top = &nss_top_main; - - nss_top->crypto_ctx = NULL; - nss_top->crypto_cmn_msg_callback = NULL; -} -EXPORT_SYMBOL(nss_crypto_cmn_notify_unregister); - -/* - * nss_crypto_cmn_data_register() - * Register the data callback routine - */ -struct nss_ctx_instance *nss_crypto_cmn_data_register(uint32_t if_num, nss_crypto_cmn_buf_callback_t cb, - struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.crypto_handler_id]; - - if (if_num < NSS_SPECIAL_IF_START) { - nss_warning("%px: interface number is not special interface %d", nss_ctx, if_num); - return NULL; - } - - /* - * avoid multiple registration for same interface number - */ - if (nss_ctx->subsys_dp_register[if_num].cb) - return nss_ctx; - - /* - * Note: no locking is required for updating this as - * the registration is only a module load time operation. - */ - nss_core_register_subsys_dp(nss_ctx, if_num, cb, NULL, NULL, netdev, features); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_crypto_cmn_data_register); - -/* - * nss_crypto_cmn_data_unregister() - * De-register the data callback routine - */ -void nss_crypto_cmn_data_unregister(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - if (if_num < NSS_SPECIAL_IF_START) { - nss_warning("%px: interface number is not special interface %d", nss_ctx, if_num); - return; - } - - /* - * Note: no locking is required for updating this as - * the registration is only a module load time operation. - */ - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_crypto_cmn_data_unregister); - -/* - * nss_crypto_cmn_get_context() - * get NSS context instance for crypto handle - */ -struct nss_ctx_instance *nss_crypto_cmn_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.crypto_handler_id]; -} -EXPORT_SYMBOL(nss_crypto_cmn_get_context); - -/* - * nss_crypto_cmn_register_handler() - */ -void nss_crypto_cmn_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_crypto_cmn_get_context(); - - sema_init(&g_nss_crypto_cmn.sem, 1); - init_completion(&g_nss_crypto_cmn.complete); - nss_core_register_handler(nss_ctx, NSS_CRYPTO_CMN_INTERFACE, nss_crypto_cmn_msg_handler, NULL); - - nss_crypto_cmn_stats_dentry_create(); - nss_crypto_cmn_strings_dentry_create(); -} - -/* - * nss_crypto_cmn_msg_init() - * Initialize crypto message - */ -void nss_crypto_cmn_msg_init(struct nss_crypto_cmn_msg *ncm, uint16_t if_num, uint32_t type, - uint32_t len, nss_crypto_cmn_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_crypto_cmn_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_log.c deleted file mode 100644 index 04cd66c47..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_log.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_crypto_cmn_log.c - * NSS Crypto Common logger file. - */ - -#include "nss_core.h" - -/* - * nss_crypto_cmn_log_message_types_str - * Crypto Common message strings - */ -static int8_t *nss_crypto_cmn_log_message_types_str[NSS_CRYPTO_CMN_MSG_TYPE_MAX] __maybe_unused = { - "Crypto Common Invalid Message", - "Crypto Common CRYPTO CMN Initialize Node", - "Crypto Common Initialize Engine", - "Crypto Common Initialize DMA Pair", - "Crypto Common Update Context Information", - "Crypto Common Clear Context Information", - "Crypto Common Verify Context Active", - "Crypto Common Synchronous Node Statistics" - "Crypto Common Synchronouts Engine Statistics", - "Crypto Common Synchronous Context Statistics" -}; - -/* - * nss_crypto_cmn_log_error_response_types_str - * Strings for error types for crypto common messages - */ -static int8_t *nss_crypto_cmn_log_error_response_types_str[NSS_CRYPTO_CMN_MSG_ERROR_MAX] __maybe_unused = { - "Crypto Common No Error", - "Crypto Common Header Version Not Supported", - "Crypto Common Context Index out-of-range for node", - "Crypto Common DMA mask out-of-range", - "Crypto Common DMA count exceeds Token", - "Crypto Common Token Allocation failed", - "Crypto Common Context Index out-of-range", - "Crypto Common Context has references", - "Crypto Common Bad Context Size", - "Crypto Common Bad Algorithm", - "Crypto Common Context Allocation failed", - "Crypto Common Context has no references", - "Crypto Common Invalid Context Flags" -}; - -/* - * nss_crypto_cmn_node_msg() - * Log NSS crypto common node message. - */ -static void nss_crypto_cmn_node_msg(struct nss_crypto_cmn_msg *ncm) -{ - struct nss_crypto_cmn_node *ncnm __maybe_unused = &ncm->msg.node; - nss_trace("%px: NSS crypto common node message:\n" - "Crypto Common Max DMA Rings: %d\n" - "Crypto Common Max Contex: %d\n" - "Crypto Common Max Context Size: %d\n", - ncnm, ncnm->max_dma_rings, - ncnm->max_ctx, ncnm->max_ctx_size); -} - -/* - * nss_crypto_cmn_engine_msg() - * Log NSS crypto cmn engine message. - */ -static void nss_crypto_cmn_engine_msg(struct nss_crypto_cmn_msg *ncm) -{ - struct nss_crypto_cmn_engine *ncem __maybe_unused = &ncm->msg.eng; - nss_trace("%px: NSS crypto common engine message \n" - "Crypto Common Firmware Version: %px\n" - "Crypto Common DMA Mask: %x\n" - "Crypto Common Token Count: %d\n", - ncem, &ncem->fw_ver, - ncem->dma_mask, ncem->req_count); -} - -/* - * nss_crypto_cmn_dma_msg() - * Log NSS crypto cmn dma message. - */ -static void nss_crypto_cmn_dma_msg(struct nss_crypto_cmn_msg *ncm) -{ - struct nss_crypto_cmn_dma *ncdm __maybe_unused = &ncm->msg.dma; - nss_trace("%px: NSS crypto common dma message \n" - "Crypto Common DMA Pair ID: %d\n", - ncdm, ncdm->pair_id); -} - -/* - * nss_crypto_cmn_ctx_msg() - * Log NSS crypto cmn context message. - */ -static void nss_crypto_cmn_ctx_msg(struct nss_crypto_cmn_msg *ncm) -{ - struct nss_crypto_cmn_ctx *nccm __maybe_unused = &ncm->msg.ctx; - nss_trace("%px: NSS crypto common context message \n" - "Crypto Common Context Spare Words: %px\n" - "Crypto Common Index: %d\n" - "Crypto Common Secure Offset: %d\n" - "Crypto Common Cipher Key: %px\n" - "Crypto Common Authorization Key: %px\n" - "Crypto Common Nonce Value: %px\n" - "Crypto Common Algorithm: %x\n" - "Crypto Common Context Specific Flags: %x\n", - nccm, &nccm->spare, - nccm->index, nccm->sec_offset, - &nccm->cipher_key, &nccm->auth_key, - &nccm->nonce, nccm->algo, nccm->flags); -} - -/* - * nss_crypto_cmn_log_verbose() - * Log message contents. - */ -static void nss_crypto_cmn_log_verbose(struct nss_crypto_cmn_msg *ncm) -{ - switch (ncm->cm.type) { - case NSS_CRYPTO_CMN_MSG_TYPE_SETUP_NODE: - nss_crypto_cmn_node_msg(ncm); - break; - - case NSS_CRYPTO_CMN_MSG_TYPE_SETUP_ENG: - nss_crypto_cmn_engine_msg(ncm); - break; - - case NSS_CRYPTO_CMN_MSG_TYPE_SETUP_DMA: - nss_crypto_cmn_dma_msg(ncm); - break; - - case NSS_CRYPTO_CMN_MSG_TYPE_SETUP_CTX: - case NSS_CRYPTO_CMN_MSG_TYPE_CLEAR_CTX: - case NSS_CRYPTO_CMN_MSG_TYPE_VERIFY_CTX: - nss_crypto_cmn_ctx_msg(ncm); - break; - - case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_NODE_STATS: - case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_ENG_STATS: - case NSS_CRYPTO_CMN_MSG_TYPE_SYNC_CTX_STATS: - /* Getting logged in stats */ - break; - - default: - nss_warning("%px: Invalid message type\n", ncm); - break; - } -} - -/* - * nss_crypto_cmn_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_crypto_cmn_log_tx_msg(struct nss_crypto_cmn_msg *ncm) -{ - if (ncm->cm.type >= NSS_CRYPTO_CMN_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", ncm); - return; - } - - nss_info("%px: type[%d]:%s\n", ncm, ncm->cm.type, nss_crypto_cmn_log_message_types_str[ncm->cm.type]); - nss_crypto_cmn_log_verbose(ncm); -} - -/* - * nss_crypto_cmn_log_rx_msg() - * Log messages received from FW. - */ -void nss_crypto_cmn_log_rx_msg(struct nss_crypto_cmn_msg *ncm) -{ - if (ncm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ncm); - return; - } - - if (ncm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ncm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ncm, ncm->cm.type, - nss_crypto_cmn_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response]); - goto verbose; - } - - if (ncm->cm.error >= NSS_CRYPTO_CMN_MSG_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ncm, ncm->cm.type, nss_crypto_cmn_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ncm, ncm->cm.type, nss_crypto_cmn_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error, nss_crypto_cmn_log_error_response_types_str[ncm->cm.error]); - -verbose: - nss_crypto_cmn_log_verbose(ncm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_log.h deleted file mode 100644 index f78a8ecf7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_CRYPTO_CMN_LOG_H__ -#define __NSS_CRYPTO_CMN_LOG_H__ - -/* - * nss_crypto_cmn_log.h - * NSS Crypto Common Log header file. - */ - -/* - * nss_crypto_cmn_log_tx_msg - * Logs a crypto common message that is sent to the NSS firmware. - */ -void nss_crypto_cmn_log_tx_msg(struct nss_crypto_cmn_msg *ncm); - -/* - * nss_crypto_cmn_log_rx_msg - * Logs a crypto common message that is received from the NSS firmware. - */ -void nss_crypto_cmn_log_rx_msg(struct nss_crypto_cmn_msg *ncm); - -#endif /* __NSS_CRYPTO_CMN_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.c deleted file mode 100644 index c30416634..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_crypto_cmn_stats.h" -#include "nss_crypto_cmn_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_crypto_cmn_stats_notifier); - -/* - * Spinlock to protect CRYPTO_CMN statistics update/read - */ -DEFINE_SPINLOCK(nss_crypto_cmn_stats_lock); - -/* - * nss_crypto_cmn_stats - * crypto common statistics - */ -uint64_t nss_crypto_cmn_stats[NSS_CRYPTO_CMN_STATS_MAX]; - -/* - * nss_crypto_cmn_stats_read() - * Read crypto common statistics - */ -static ssize_t nss_crypto_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_CRYPTO_CMN_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = vzalloc(size_al); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = vzalloc(NSS_CRYPTO_CMN_STATS_MAX * 8); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - vfree(lbuf); - return -ENOMEM; - } - - /* - * crypto common statistics - */ - spin_lock_bh(&nss_crypto_cmn_stats_lock); - for (i = 0; i < NSS_CRYPTO_CMN_STATS_MAX; i++) - stats_shadow[i] = nss_crypto_cmn_stats[i]; - - spin_unlock_bh(&nss_crypto_cmn_stats_lock); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "crypto_cmn", NSS_STATS_SINGLE_CORE); - size_wr += nss_stats_print("crypto_cmn", NULL, NSS_STATS_SINGLE_INSTANCE, nss_crypto_cmn_strings_stats, - stats_shadow, NSS_CRYPTO_CMN_STATS_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - vfree(lbuf); - vfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_crypto_cmn_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(crypto_cmn); - -/* - * nss_crypto_cmn_stats_dentry_create() - * Create crypto common statistics debug entry. - */ -void nss_crypto_cmn_stats_dentry_create(void) -{ - nss_stats_create_dentry("crypto_cmn", &nss_crypto_cmn_stats_ops); -} - -/* - * nss_crypto_cmn_stats_sync() - * Handle the syncing of NSS crypto common statistics. - */ -void nss_crypto_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_crypto_cmn_stats *nct) -{ - int j; - - spin_lock_bh(&nss_crypto_cmn_stats_lock); - - /* - * Common node stats - */ - nss_crypto_cmn_stats[NSS_STATS_NODE_RX_PKTS] += nct->nstats.rx_packets; - nss_crypto_cmn_stats[NSS_STATS_NODE_RX_BYTES] += nct->nstats.rx_bytes; - nss_crypto_cmn_stats[NSS_STATS_NODE_TX_PKTS] += nct->nstats.tx_packets; - nss_crypto_cmn_stats[NSS_STATS_NODE_TX_BYTES] += nct->nstats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) - nss_crypto_cmn_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nct->nstats.rx_dropped[j]; - - /* - * crypto common statistics - */ - nss_crypto_cmn_stats[NSS_CRYPTO_CMN_STATS_FAIL_VERSION] += nct->fail_version; - nss_crypto_cmn_stats[NSS_CRYPTO_CMN_STATS_FAIL_CTX] += nct->fail_ctx; - nss_crypto_cmn_stats[NSS_CRYPTO_CMN_STATS_FAIL_DMA] += nct->fail_dma; - - spin_unlock_bh(&nss_crypto_cmn_stats_lock); -} - -/* - * nss_crypto_cmn_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_crypto_cmn_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_crypto_cmn_stats_notification crypto_cmn_stats; - - crypto_cmn_stats.core_id = nss_ctx->id; - memcpy(crypto_cmn_stats.stats, nss_crypto_cmn_stats, sizeof(crypto_cmn_stats.stats)); - atomic_notifier_call_chain(&nss_crypto_cmn_stats_notifier, NSS_STATS_EVENT_NOTIFY, &crypto_cmn_stats); -} - -/* - * nss_crypto_cmn_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_crypto_cmn_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_crypto_cmn_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_crypto_cmn_stats_register_notifier); - -/* - * nss_crypto_cmn_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_crypto_cmn_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_crypto_cmn_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_crypto_cmn_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.h deleted file mode 100644 index 6319c2cbb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_stats.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_CRYPTO_CMN_STATS_H -#define __NSS_CRYPTO_CMN_STATS_H - -#include - -/** - * nss_crypto_cmn_stats_types - * crypto common transmission node statistics - */ -enum nss_crypto_cmn_stats_types { - NSS_CRYPTO_CMN_STATS_FAIL_VERSION = NSS_STATS_NODE_MAX, /* version mismatch failures */ - NSS_CRYPTO_CMN_STATS_FAIL_CTX, /* context related failures */ - NSS_CRYPTO_CMN_STATS_FAIL_DMA, /* dma descriptor full */ - NSS_CRYPTO_CMN_STATS_MAX, /* Maximum message type */ -}; - -/** - * nss_crypto_cmn_stats_notification - * crypto common transmission statistics structure - */ -struct nss_crypto_cmn_stats_notification { - uint32_t core_id; /* core ID */ - uint64_t stats[NSS_CRYPTO_CMN_STATS_MAX]; /* transmission statistics */ -}; - -/* - * crypto common statistics APIs - */ -extern void nss_crypto_cmn_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_crypto_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_crypto_cmn_stats *nct); -extern void nss_crypto_cmn_stats_dentry_create(void); - -/** - * nss_crypto_cmn_stats_register_notifier - * Registers a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_crypto_cmn_stats_register_notifier(struct notifier_block *nb); - -/** - * nss_crypto_cmn_stats_unregister_notifier - * Deregisters a statistics notifier. - * - * @datatypes - * notifier_block - * - * @param[in] nb Notifier block. - * - * @return - * 0 on success or -2 on failure. - */ -extern int nss_crypto_cmn_stats_unregister_notifier(struct notifier_block *nb); - -#endif /* __NSS_CRYPTO_CMN_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.c deleted file mode 100644 index 42e8d8b85..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_crypto_cmn_strings.h" - -/* - * nss_crypto_cmn_strings_stats - * crypto common statistics strings. - */ -struct nss_stats_info nss_crypto_cmn_strings_stats[NSS_CRYPTO_CMN_STATS_MAX] = { - {"rx_pkts", NSS_STATS_TYPE_COMMON}, - {"rx_byts", NSS_STATS_TYPE_COMMON}, - {"tx_pkts", NSS_STATS_TYPE_COMMON}, - {"tx_byts", NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, - {"fail_version", NSS_STATS_TYPE_SPECIAL}, - {"fail_ctx", NSS_STATS_TYPE_SPECIAL}, - {"fail_dma", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_crypto_cmn_strings_read() - * Read crypto common node statistics names - */ -static ssize_t nss_crypto_cmn_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_crypto_cmn_strings_stats, NSS_CRYPTO_CMN_STATS_MAX); -} - -/* - * nss_crypto_cmn_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(crypto_cmn); - -/* - * nss_crypto_cmn_strings_dentry_create() - * Create crypto common statistics strings debug entry. - */ -void nss_crypto_cmn_strings_dentry_create(void) -{ - nss_strings_create_dentry("crypto_cmn", &nss_crypto_cmn_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.h deleted file mode 100644 index aae067764..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_cmn_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_CRYPTO_CMN_STRINGS_H -#define __NSS_CRYPTO_CMN_STRINGS_H - -#include "nss_crypto_cmn_stats.h" - -extern struct nss_stats_info nss_crypto_cmn_strings_stats[NSS_CRYPTO_CMN_STATS_MAX]; -extern void nss_crypto_cmn_strings_dentry_create(void); - -#endif /* __NSS_CRYPTO_CMN_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_log.c deleted file mode 100644 index b5569973b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_log.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_crypto_log.c - * NSS Crypto logger file. - */ - -#include "nss_core.h" - -/* - * nss_crypto_log_message_types_str - * Crypto message strings - */ -static int8_t *nss_crypto_log_message_types_str[NSS_CRYPTO_MSG_TYPE_MAX] __maybe_unused = { - "Crypto Invalid Message", - "Crypto Open Engine Message", - "Crypto Close Engine Message", - "Crypto Update Session", - "Crypto Stats Sync", -}; - -/* - * nss_crypto_log_error_response_types_str - * Strings for error types for CRYPTO messages - */ -static int8_t *nss_crypto_log_error_response_types_str[NSS_CRYPTO_MSG_ERROR_MAX] __maybe_unused = { - "Crypto No Error", - "Crypto Invalid Engine", - "Crypto Unsupported Operation", - "Crypto Invalid Operation", - "Crypto Invalid Index Range", - "Crypto Index Alloc Failure", -}; - -/* - * nss_crypto_config_eng_msg() - * Log NSS Crypto config engine message. - */ -static void nss_crypto_config_eng_msg(struct nss_crypto_msg *ncm) -{ - struct nss_crypto_config_eng *nccem __maybe_unused = &ncm->msg.eng; - nss_trace("%px: NSS Crypto Config Engine Message:\n" - "Crypto Engine Number: %d\n" - "Crypto BAM Physical Base Address: %x\n" - "Crypto Physical Base Address: %x\n" - "Crypto Pipe Description Address: %px\n" - "Crypto Session Indices: %px\n", - nccem, nccem->eng_id, - nccem->bam_pbase, nccem->crypto_pbase, - &nccem->desc_paddr, &nccem->idx); -} - -/* - * nss_crypto_config_session_msg() - * Log NSS Crypto config session message. - */ -static void nss_crypto_config_session_msg(struct nss_crypto_msg *ncm) -{ - struct nss_crypto_config_session *nccsm __maybe_unused = &ncm->msg.session; - nss_trace("%px: NSS Crypto Config Session message \n" - "Crypto Session Index: %d\n" - "Crypto Session State: %d\n" - "Crypto Session Initialization Vector Length: %d\n", - nccsm, nccsm->idx, - nccsm->state, nccsm->iv_len); -} - -/* - * nss_crypto_log_verbose() - * Log message contents. - */ -static void nss_crypto_log_verbose(struct nss_crypto_msg *ncm) -{ - switch (ncm->cm.type) { - case NSS_CRYPTO_MSG_TYPE_OPEN_ENG: - nss_crypto_config_eng_msg(ncm); - break; - - case NSS_CRYPTO_MSG_TYPE_UPDATE_SESSION: - nss_crypto_config_session_msg(ncm); - break; - - default: - nss_warning("%px: Invalid message type\n", ncm); - break; - } -} - -/* - * nss_crypto_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_crypto_log_tx_msg(struct nss_crypto_msg *ncm) -{ - if (ncm->cm.type >= NSS_CRYPTO_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", ncm); - return; - } - - nss_info("%px: type[%d]:%s\n", ncm, ncm->cm.type, nss_crypto_log_message_types_str[ncm->cm.type]); - nss_crypto_log_verbose(ncm); -} - -/* - * nss_crypto_log_rx_msg() - * Log messages received from FW. - */ -void nss_crypto_log_rx_msg(struct nss_crypto_msg *ncm) -{ - if (ncm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ncm); - return; - } - - if (ncm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ncm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ncm, ncm->cm.type, - nss_crypto_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response]); - goto verbose; - } - - if (ncm->cm.error >= NSS_CRYPTO_MSG_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ncm, ncm->cm.type, nss_crypto_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ncm, ncm->cm.type, nss_crypto_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error, nss_crypto_log_error_response_types_str[ncm->cm.error]); - -verbose: - nss_crypto_log_verbose(ncm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_crypto_log.h deleted file mode 100644 index c0d53ddae..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_crypto_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_CRYPTO_LOG_H__ -#define __NSS_CRYPTO_LOG_H__ - -/* - * nss_crypto_log.h - * NSS Crypto Log Header File - */ - -/* - * nss_crypto_log_tx_msg - * Logs a crypto message that is sent to the NSS firmware. - */ -void nss_crypto_log_tx_msg(struct nss_crypto_msg *ncm); - -/* - * nss_crypto_log_rx_msg - * Logs a crypto message that is received from the NSS firmware. - */ -void nss_crypto_log_rx_msg(struct nss_crypto_msg *ncm); - -#endif /* __NSS_CRYPTO_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/include/nss_data_plane_hal.h b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/include/nss_data_plane_hal.h deleted file mode 100644 index aa46eadc7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/include/nss_data_plane_hal.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "nss_phys_if.h" -#include - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) -#define NSS_DATA_PLANE_SUPPORTED_FEATURES (NETIF_F_HIGHDMA \ - | NETIF_F_HW_CSUM \ - | NETIF_F_RXCSUM \ - | NETIF_F_SG \ - | NETIF_F_FRAGLIST \ - | (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_UFO)) -#else -#define NSS_DATA_PLANE_SUPPORTED_FEATURES (NETIF_F_HIGHDMA \ - | NETIF_F_HW_CSUM \ - | NETIF_F_RXCSUM \ - | NETIF_F_SG \ - | NETIF_F_FRAGLIST \ - | (NETIF_F_TSO | NETIF_F_TSO6)) -#endif - -/* - * nss_data_plane_param - */ -struct nss_data_plane_param { - struct nss_dp_data_plane_ctx dpc; /* data plane ctx base class */ - int if_num; /* physical interface number */ - struct nss_ctx_instance *nss_ctx; /* which nss core */ - struct nss_dp_gmac_stats gmac_stats; /* SoC specific stats for GMAC */ - int notify_open; /* This data plane interface has been opened or not */ - uint32_t features; /* skb types supported by this interface */ - uint32_t bypass_nw_process; /* Do we want to bypass NW processing in NSS for this data plane? */ -}; - -void nss_data_plane_hal_add_dp_ops(struct nss_dp_data_plane_ops *dp_ops); -void nss_data_plane_hal_register(struct nss_ctx_instance *nss_ctx); -void nss_data_plane_hal_unregister(struct nss_ctx_instance *nss_ctx); -void nss_data_plane_hal_set_features(struct nss_dp_data_plane_ctx *dpc); -uint16_t nss_data_plane_hal_get_mtu_sz(uint16_t mtu); -void nss_data_plane_hal_stats_sync(struct nss_data_plane_param *ndpp, struct nss_phys_if_stats *stats); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq50xx.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq50xx.c deleted file mode 100644 index 980a06b62..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq50xx.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "nss_core.h" -#include "nss_data_plane_hal.h" - -static DEFINE_SPINLOCK(nss_data_plane_hal_gmac_stats_lock); - -/* - * nss_data_plane_hal_get_stats() - * Called by nss-dp to get GMAC stats - */ -static void nss_data_plane_hal_get_stats(struct nss_dp_data_plane_ctx *dpc, - struct nss_dp_gmac_stats *stats) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - spin_lock_bh(&nss_data_plane_hal_gmac_stats_lock); - memcpy(stats, &dp->gmac_stats, sizeof(*stats)); - spin_unlock_bh(&nss_data_plane_hal_gmac_stats_lock); -} - -/* - * nss_data_plane_hal_add_dp_ops() - */ -void nss_data_plane_hal_add_dp_ops(struct nss_dp_data_plane_ops *dp_ops) -{ - dp_ops->get_stats = nss_data_plane_hal_get_stats; -} - -/* - * nss_data_plane_hal_register() - */ -void nss_data_plane_hal_register(struct nss_ctx_instance *nss_ctx) -{ -} - -/* - * nss_data_plane_hal_unregister() - */ -void nss_data_plane_hal_unregister(struct nss_ctx_instance *nss_ctx) -{ -} - -/* - * nss_data_plane_hal_set_features - */ -void nss_data_plane_hal_set_features(struct nss_dp_data_plane_ctx *dpc) -{ - dpc->dev->features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->hw_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->wanted_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - - /* - * Synopsys GMAC does not support checksum offload for QinQ VLANs. - * Hence, we do not advertise checksum offload support for VLANs. - */ - dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES & - (~(NETIF_F_RXCSUM | NETIF_F_HW_CSUM)); -} - -/* - * nss_data_plane_hal_stats_sync() - */ -void nss_data_plane_hal_stats_sync(struct nss_data_plane_param *ndpp, - struct nss_phys_if_stats *stats) -{ - struct nss_dp_hal_gmac_stats *gmac_stats = &ndpp->gmac_stats.stats; - - spin_lock_bh(&nss_data_plane_hal_gmac_stats_lock); - - gmac_stats->rx_bytes += stats->if_stats.rx_bytes; - gmac_stats->rx_packets += stats->if_stats.rx_packets; - gmac_stats->rx_errors += stats->estats.rx_errors; - gmac_stats->rx_receive_errors += stats->estats.rx_receive_errors; - gmac_stats->rx_descriptor_errors += stats->estats.rx_descriptor_errors; - gmac_stats->rx_late_collision_errors += stats->estats.rx_late_collision_errors; - gmac_stats->rx_dribble_bit_errors += stats->estats.rx_dribble_bit_errors; - gmac_stats->rx_length_errors += stats->estats.rx_length_errors; - gmac_stats->rx_ip_header_errors += stats->estats.rx_ip_header_errors; - gmac_stats->rx_ip_payload_errors += stats->estats.rx_ip_payload_errors; - gmac_stats->rx_no_buffer_errors += stats->estats.rx_no_buffer_errors; - gmac_stats->rx_transport_csum_bypassed += stats->estats.rx_transport_csum_bypassed; - - gmac_stats->tx_bytes += stats->if_stats.tx_bytes; - gmac_stats->tx_packets += stats->if_stats.tx_packets; - gmac_stats->tx_collisions += stats->estats.tx_collisions; - gmac_stats->tx_errors += stats->estats.tx_errors; - gmac_stats->tx_jabber_timeout_errors += stats->estats.tx_jabber_timeout_errors; - gmac_stats->tx_frame_flushed_errors += stats->estats.tx_frame_flushed_errors; - gmac_stats->tx_loss_of_carrier_errors += stats->estats.tx_loss_of_carrier_errors; - gmac_stats->tx_no_carrier_errors += stats->estats.tx_no_carrier_errors; - gmac_stats->tx_late_collision_errors += stats->estats.tx_late_collision_errors; - gmac_stats->tx_excessive_collision_errors += stats->estats.tx_excessive_collision_errors; - gmac_stats->tx_excessive_deferral_errors += stats->estats.tx_excessive_deferral_errors; - gmac_stats->tx_underflow_errors += stats->estats.tx_underflow_errors; - gmac_stats->tx_ip_header_errors += stats->estats.tx_ip_header_errors; - gmac_stats->tx_ip_payload_errors += stats->estats.tx_ip_payload_errors; - gmac_stats->tx_dropped += stats->estats.tx_dropped; - - gmac_stats->hw_errs[0] += stats->estats.hw_errs[0]; - gmac_stats->hw_errs[1] += stats->estats.hw_errs[1]; - gmac_stats->hw_errs[2] += stats->estats.hw_errs[2]; - gmac_stats->hw_errs[3] += stats->estats.hw_errs[3]; - gmac_stats->hw_errs[4] += stats->estats.hw_errs[4]; - gmac_stats->hw_errs[5] += stats->estats.hw_errs[5]; - gmac_stats->hw_errs[6] += stats->estats.hw_errs[6]; - gmac_stats->hw_errs[7] += stats->estats.hw_errs[7]; - gmac_stats->hw_errs[8] += stats->estats.hw_errs[8]; - gmac_stats->hw_errs[9] += stats->estats.hw_errs[9]; - gmac_stats->rx_missed += stats->estats.rx_missed; - - gmac_stats->fifo_overflows += stats->estats.fifo_overflows; - gmac_stats->rx_scatter_errors += stats->estats.rx_scatter_errors; - gmac_stats->tx_ts_create_errors += stats->estats.tx_ts_create_errors; - gmac_stats->gmac_total_ticks += stats->estats.gmac_total_ticks; - gmac_stats->gmac_worst_case_ticks += stats->estats.gmac_worst_case_ticks; - gmac_stats->gmac_iterations += stats->estats.gmac_iterations; - gmac_stats->tx_pause_frames += stats->estats.tx_pause_frames; - gmac_stats->mmc_rx_overflow_errors += stats->estats.mmc_rx_overflow_errors; - gmac_stats->mmc_rx_watchdog_timeout_errors += stats->estats.mmc_rx_watchdog_timeout_errors; - gmac_stats->mmc_rx_crc_errors += stats->estats.mmc_rx_crc_errors; - gmac_stats->mmc_rx_ip_header_errors += stats->estats.mmc_rx_ip_header_errors; - gmac_stats->mmc_rx_octets_g += stats->estats.mmc_rx_octets_g; - gmac_stats->mmc_rx_ucast_frames += stats->estats.mmc_rx_ucast_frames; - gmac_stats->mmc_rx_bcast_frames += stats->estats.mmc_rx_bcast_frames; - gmac_stats->mmc_rx_mcast_frames += stats->estats.mmc_rx_mcast_frames; - gmac_stats->mmc_rx_undersize += stats->estats.mmc_rx_undersize; - gmac_stats->mmc_rx_oversize += stats->estats.mmc_rx_oversize; - gmac_stats->mmc_rx_jabber += stats->estats.mmc_rx_jabber; - gmac_stats->mmc_rx_octets_gb += stats->estats.mmc_rx_octets_gb; - gmac_stats->mmc_rx_frag_frames_g += stats->estats.mmc_rx_frag_frames_g; - gmac_stats->mmc_tx_octets_g += stats->estats.mmc_tx_octets_g; - gmac_stats->mmc_tx_ucast_frames += stats->estats.mmc_tx_ucast_frames; - gmac_stats->mmc_tx_bcast_frames += stats->estats.mmc_tx_bcast_frames; - gmac_stats->mmc_tx_mcast_frames += stats->estats.mmc_tx_mcast_frames; - gmac_stats->mmc_tx_deferred += stats->estats.mmc_tx_deferred; - gmac_stats->mmc_tx_single_col += stats->estats.mmc_tx_single_col; - gmac_stats->mmc_tx_multiple_col += stats->estats.mmc_tx_multiple_col; - gmac_stats->mmc_tx_octets_gb += stats->estats.mmc_tx_octets_gb; - - spin_unlock_bh(&nss_data_plane_hal_gmac_stats_lock); -} - -/* - * nss_data_plane_hal_get_mtu_sz() - */ -uint16_t nss_data_plane_hal_get_mtu_sz(uint16_t mtu) -{ - /* - * GMACs support 3 Modes - * Normal Mode Payloads upto 1522 Bytes ( 1500 + 14 + 4(Vlan) + 4(CRC)) - * Mini Jumbo Mode Payloads upto 2000 Bytes (1978 + 14 + 4(Vlan) + 4 (CRC)) - * Full Jumbo Mode payloads upto 9022 Bytes (9000 + 14 + 4(Vlan) + 4 (CRC)) - */ - - /* - * The configured MTU value on a GMAC interface should be one of these - * cases. Finding the Needed MTU size that is required for GMAC to - * successfully receive the frame. - */ - if (mtu <= NSS_DP_GMAC_NORMAL_FRAME_MTU) { - return NSS_DP_GMAC_NORMAL_FRAME_MTU; - } - if (mtu <= NSS_DP_GMAC_MINI_JUMBO_FRAME_MTU) { - return NSS_DP_GMAC_MINI_JUMBO_FRAME_MTU; - } - if (mtu <= NSS_DP_GMAC_FULL_JUMBO_FRAME_MTU) { - return NSS_DP_GMAC_FULL_JUMBO_FRAME_MTU; - } - return 0; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq60xx.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq60xx.c deleted file mode 100644 index d74df4cf8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq60xx.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "nss_core.h" -#include "nss_data_plane_hal.h" - -/* - * nss_data_plane_hal_vsi_assign() - * Called by nss-dp to assign vsi of a data plane - */ -static int nss_data_plane_hal_vsi_assign(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - return nss_phys_if_vsi_assign(dp->nss_ctx, vsi, dp->if_num); -} - -/* - * nss_data_plane_hal_vsi_unassign() - * Called by nss-dp to unassign vsi of a data plane - */ -static int nss_data_plane_hal_vsi_unassign(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - return nss_phys_if_vsi_unassign(dp->nss_ctx, vsi, dp->if_num); -} - -/* - * nss_data_plane_hal_get_stats() - * Called by nss-dp to get GMAC stats - */ -static void nss_data_plane_hal_get_stats(struct nss_dp_data_plane_ctx *dpc, - struct nss_dp_gmac_stats *stats) -{ - /* - * EDMA doesn't send extended statistics. - */ -} - -/* - * nss_data_plane_hal_add_dp_ops() - */ -void nss_data_plane_hal_add_dp_ops(struct nss_dp_data_plane_ops *dp_ops) -{ - dp_ops->vsi_assign = nss_data_plane_hal_vsi_assign; - dp_ops->vsi_unassign = nss_data_plane_hal_vsi_unassign; - dp_ops->get_stats = nss_data_plane_hal_get_stats; -} - -/* - * nss_data_plane_hal_register() - */ -void nss_data_plane_hal_register(struct nss_ctx_instance *nss_ctx) -{ - /* - * Packets with the ptp service code should be delivered to - * PHY driver for timestamping. - */ - nss_cmn_register_service_code(nss_ctx, nss_phy_tstamp_rx_buf, - NSS_PTP_EVENT_SERVICE_CODE, nss_ctx); -} - -/* - * nss_data_plane_hal_unregister() - */ -void nss_data_plane_hal_unregister(struct nss_ctx_instance *nss_ctx) -{ - nss_cmn_unregister_service_code(nss_ctx, nss_phy_tstamp_rx_buf, - NSS_PTP_EVENT_SERVICE_CODE); -} - -/* - * nss_data_plane_hal_set_features - */ -void nss_data_plane_hal_set_features(struct nss_dp_data_plane_ctx *dpc) -{ - dpc->dev->features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->hw_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->wanted_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; -} - -/* - * nss_data_plane_hal_stats_sync() - */ -void nss_data_plane_hal_stats_sync(struct nss_data_plane_param *ndpp, - struct nss_phys_if_stats *stats) -{ - /* - * EDMA does not pass sync interface stats through phys_if_stats - */ -} - -/* - * nss_data_plane_hal_get_mtu_sz() - */ -uint16_t nss_data_plane_hal_get_mtu_sz(uint16_t mtu) -{ - /* - * Reserve space for preheader - */ - return mtu + NSS_DP_PREHEADER_SIZE; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq807x.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq807x.c deleted file mode 100644 index 82fe2b0a1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/hal/nss_ipq807x.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "nss_core.h" -#include "nss_data_plane_hal.h" - -/* - * nss_data_plane_hal_vsi_assign() - * Called by nss-dp to assign vsi of a data plane - */ -static int nss_data_plane_hal_vsi_assign(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - return nss_phys_if_vsi_assign(dp->nss_ctx, vsi, dp->if_num); -} - -/* - * nss_data_plane_hal_vsi_unassign() - * Called by nss-dp to unassign vsi of a data plane - */ -static int nss_data_plane_hal_vsi_unassign(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - return nss_phys_if_vsi_unassign(dp->nss_ctx, vsi, dp->if_num); -} - -/* - * nss_data_plane_hal_get_stats() - * Called by nss-dp to get GMAC stats - */ -static void nss_data_plane_hal_get_stats(struct nss_dp_data_plane_ctx *dpc, - struct nss_dp_gmac_stats *stats) -{ - /* - * EDMA doesn't send extended statistics. - */ -} - -/* - * nss_data_plane_hal_add_dp_ops() - */ -void nss_data_plane_hal_add_dp_ops(struct nss_dp_data_plane_ops *dp_ops) -{ - dp_ops->vsi_assign = nss_data_plane_hal_vsi_assign; - dp_ops->vsi_unassign = nss_data_plane_hal_vsi_unassign; - dp_ops->get_stats = nss_data_plane_hal_get_stats; -} - -/* - * nss_data_plane_hal_register() - */ -void nss_data_plane_hal_register(struct nss_ctx_instance *nss_ctx) -{ - /* - * Packets with the ptp service code should be delivered to - * PHY driver for timestamping. - */ - nss_cmn_register_service_code(nss_ctx, nss_phy_tstamp_rx_buf, - NSS_PTP_EVENT_SERVICE_CODE, nss_ctx); -} - -/* - * nss_data_plane_hal_unregister() - */ -void nss_data_plane_hal_unregister(struct nss_ctx_instance *nss_ctx) -{ - nss_cmn_unregister_service_code(nss_ctx, nss_phy_tstamp_rx_buf, - NSS_PTP_EVENT_SERVICE_CODE); -} - -/* - * nss_data_plane_hal_set_features - */ -void nss_data_plane_hal_set_features(struct nss_dp_data_plane_ctx *dpc) -{ - dpc->dev->features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->hw_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->vlan_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; - dpc->dev->wanted_features |= NSS_DATA_PLANE_SUPPORTED_FEATURES; -} - -/* - * nss_data_plane_hal_stats_sync() - */ -void nss_data_plane_hal_stats_sync(struct nss_data_plane_param *ndpp, - struct nss_phys_if_stats *stats) -{ - /* - * EDMA does not pass sync interface stats through phys_if_stats - */ -} - -/* - * nss_data_plane_hal_get_mtu_sz() - */ -uint16_t nss_data_plane_hal_get_mtu_sz(uint16_t mtu) -{ - /* - * Reserve space for preheader - */ - return mtu + NSS_DP_PREHEADER_SIZE; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/include/nss_data_plane.h b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/include/nss_data_plane.h deleted file mode 100644 index 503a20a40..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/include/nss_data_plane.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2017,2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_data_plane - * Data plane used for communication between qca-nss-drv & data plane host - */ - -#ifndef __NSS_DATA_PLANE_H -#define __NSS_DATA_PLANE_H - -#include -#include "nss_phys_if.h" - -/* - * nss_data_plane_schedule_registration() - * Called from nss_init to schedule a work to do data_plane register to data plane host driver - */ -bool nss_data_plane_schedule_registration(void); - -/* - * nss_data_plane_init_delay_work() - * Initialize data_plane workqueue - */ -int nss_data_plane_init_delay_work(void); - -/* - * nss_data_plane_destroy_delay_work() - * Destroy data_plane workqueue - */ -void nss_data_plane_destroy_delay_work(void); - -/* - * nss_data_plane_ops defines the API required to support multiple data plane targets - */ -struct nss_data_plane_ops { - void (*data_plane_register)(struct nss_ctx_instance *nss_ctx); - void (*data_plane_unregister)(void); - void (*data_plane_stats_sync)(struct nss_phys_if_stats *stats, uint16_t interface); - uint16_t (*data_plane_get_mtu_sz)(uint16_t max_mtu); -}; - -extern struct nss_data_plane_ops nss_data_plane_gmac_ops; -extern struct nss_data_plane_ops nss_data_plane_ops; - -extern int nss_skip_nw_process; -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane.c deleted file mode 100644 index 16b7cbbc6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane.c +++ /dev/null @@ -1,386 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_data_plane.h" -#include "nss_core.h" -#include "nss_tx_rx_common.h" -#include "nss_data_plane_hal.h" - -/* - * nss_data_plane_param - */ -struct nss_data_plane_param nss_data_plane_params[NSS_DP_MAX_INTERFACES]; - -/* - * __nss_data_plane_init() - */ -static int __nss_data_plane_init(struct nss_dp_data_plane_ctx *dpc) -{ - struct net_device *netdev = dpc->dev; - netdev->needed_headroom += 32; - return NSS_DP_SUCCESS; -} - -/* - * __nss_data_plane_open() - * Called by nss-dp to notify open to nss-fw - */ -static int __nss_data_plane_open(struct nss_dp_data_plane_ctx *dpc, uint32_t tx_desc_ring, uint32_t rx_desc_ring, uint32_t mode) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - if (dp->notify_open) { - return NSS_DP_SUCCESS; - } - - if (nss_phys_if_open(dp->nss_ctx, tx_desc_ring, rx_desc_ring, mode, dp->if_num, dp->bypass_nw_process) == NSS_TX_SUCCESS) { - dp->notify_open = 1; - return NSS_DP_SUCCESS; - } - return NSS_DP_FAILURE; -} - -/* - * __nss_data_plane_close() - * Called by nss-dp to notify close to nss-fw - */ -static int __nss_data_plane_close(struct nss_dp_data_plane_ctx *dpc) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - if (!dp->notify_open) { - return NSS_DP_SUCCESS; - } - - if (nss_phys_if_close(dp->nss_ctx, dp->if_num) == NSS_TX_SUCCESS) { - dp->notify_open = 0; - return NSS_DP_SUCCESS; - } - return NSS_DP_FAILURE; -} - -/* - * __nss_data_plane_link_state() - * Called by nss-dp to notify link state change to nss-fw - */ -static int __nss_data_plane_link_state(struct nss_dp_data_plane_ctx *dpc, uint32_t link_state) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - return nss_phys_if_link_state(dp->nss_ctx, link_state, dp->if_num); -} - -/* - * __nss_data_plane_mac_addr() - * Called by nss-dp to set mac address - */ -static int __nss_data_plane_mac_addr(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - return nss_phys_if_mac_addr(dp->nss_ctx, addr, dp->if_num); -} - -/* - * __nss_data_plane_change_mtu() - * Called by nss-dp to change mtu of a data plane - */ -static int __nss_data_plane_change_mtu(struct nss_dp_data_plane_ctx *dpc, uint32_t mtu) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - if (mtu > NSS_DP_MAX_MTU_SIZE) { - nss_warning("%px: MTU exceeds MAX size %d\n", dp, mtu); - return NSS_DP_FAILURE; - } - - return nss_phys_if_change_mtu(dp->nss_ctx, mtu, dp->if_num); -} - -/* - * __nss_data_plane_pause_on_off() - * Called by nss-dp to enable/disable pause frames - */ -static int __nss_data_plane_pause_on_off(struct nss_dp_data_plane_ctx *dpc, uint32_t pause_on) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - - return nss_phys_if_pause_on_off(dp->nss_ctx, pause_on, dp->if_num); -} - -#ifdef NSS_DRV_QRFS_ENABLE -/* - * __nss_data_plane_rx_flow_steer() - * Called by nss-dp to set flow rule of a data plane - */ -static int __nss_data_plane_rx_flow_steer(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *skb, - uint32_t cpu, bool is_add) -{ - if (is_add) { - return nss_qrfs_set_flow_rule(skb, cpu, NSS_QRFS_MSG_FLOW_ADD); - } - - return nss_qrfs_set_flow_rule(skb, cpu, NSS_QRFS_MSG_FLOW_DELETE); -} -#endif - -/* - * __nss_data_plane_deinit() - * Place holder for nss-dp ops to free NSS data plane resources - */ -static int __nss_data_plane_deinit(struct nss_dp_data_plane_ctx *dpc) -{ - /* - * TODO: Implement free up of NSS data plane resources - */ - return NSS_TX_SUCCESS; -} - -/* - * __nss_data_plane_buf() - * Called by nss-dp to pass a sk_buff for xmit - */ -static netdev_tx_t __nss_data_plane_buf(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *skb) -{ - struct nss_data_plane_param *dp = (struct nss_data_plane_param *)dpc; - int extra_head = dpc->dev->needed_headroom - skb_headroom(skb); - int extra_tail = 0; - nss_tx_status_t status; - struct net_device *dev = dpc->dev; - - if (skb->len < ETH_HLEN) { - nss_warning("skb->len ( %u ) < ETH_HLEN ( %u ) \n", skb->len, ETH_HLEN); - goto drop; - } - - if (skb->len > NSS_DP_MAX_PACKET_LEN) { - nss_warning("skb->len ( %u ) > Maximum packet length ( %u ) \n", skb->len, NSS_DP_MAX_PACKET_LEN); - goto drop; - } - - if (skb_cloned(skb) || extra_head > 0) { - /* - * If it is a clone and headroom is already enough, - * We just make a copy and clear the clone flag. - */ - if (extra_head <= 0) - extra_head = extra_tail = 0; - /* - * If tailroom is enough to accommodate the added headroom, - * then allocate a buffer of same size and do relocations. - * It might help kmalloc_reserve() not double the size. - */ - if (skb->end - skb->tail >= extra_head) - extra_tail = -extra_head; - - if (pskb_expand_head(skb, extra_head, extra_tail, GFP_ATOMIC)) { - nss_warning("%px: Unable to expand skb for headroom\n", dp); - goto drop; - } - } - - status = nss_phys_if_buf(dp->nss_ctx, skb, dp->if_num); - if (likely(status == NSS_TX_SUCCESS)) { - return NETDEV_TX_OK; - } else if (status == NSS_TX_FAILURE_QUEUE) { - return NETDEV_TX_BUSY; - } - -drop: - dev_kfree_skb_any(skb); - dev->stats.tx_dropped++; - - return NETDEV_TX_OK; -} - -/* - * __nss_data_plane_set_features() - * Called by nss-dp to allow data plane to modify the set of features it supports - */ -static void __nss_data_plane_set_features(struct nss_dp_data_plane_ctx *dpc) -{ - nss_data_plane_hal_set_features(dpc); -} - -/* - * nss offload data plane ops - */ -static struct nss_dp_data_plane_ops dp_ops = { - .init = __nss_data_plane_init, - .open = __nss_data_plane_open, - .close = __nss_data_plane_close, - .link_state = __nss_data_plane_link_state, - .mac_addr = __nss_data_plane_mac_addr, - .change_mtu = __nss_data_plane_change_mtu, - .xmit = __nss_data_plane_buf, - .set_features = __nss_data_plane_set_features, - .pause_on_off = __nss_data_plane_pause_on_off, -#ifdef NSS_DRV_QRFS_ENABLE - .rx_flow_steer = __nss_data_plane_rx_flow_steer, -#endif - .deinit = __nss_data_plane_deinit, -}; - -/* - * nss_data_plane_register_to_nss_dp() - */ -static bool nss_data_plane_register_to_nss_dp(struct nss_ctx_instance *nss_ctx, int if_num) -{ - struct nss_data_plane_param *ndpp = &nss_data_plane_params[if_num]; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct net_device *netdev; - bool is_open; - int core; - - netdev = nss_dp_get_netdev_by_nss_if_num(if_num); - if (!netdev) { - nss_info("%px: Platform don't have data plane%d enabled, \ - don't bring up nss_phys_if and don't register to nss-dp\n", - nss_ctx, if_num); - return false; - } - - is_open = nss_dp_is_in_open_state(netdev); - ndpp->dpc.dev = netdev; - ndpp->nss_ctx = nss_ctx; - ndpp->if_num = if_num; - ndpp->notify_open = 0; - ndpp->features = 0; - - /* - * Add data plane ops applicable to this SoC. - */ - nss_data_plane_hal_add_dp_ops(&dp_ops); - - /* - * Check if NSS NW processing to be bypassed for this data plane - */ - if (nss_skip_nw_process) { - ndpp->bypass_nw_process = 1; - } else { - ndpp->bypass_nw_process = 0; - } - - if (nss_dp_override_data_plane(netdev, &dp_ops, (struct nss_dp_data_plane_ctx *)ndpp) != NSS_DP_SUCCESS) { - nss_info("%px: Override nss-dp data plane for port %dfailed\n", nss_ctx, if_num); - return false; - } - - /* - * Setup the receive callback so that data pkts received form NSS-FW will - * be redirected to the nss-dp driver as we are overriding the data plane - */ - nss_top->phys_if_handler_id[if_num] = nss_ctx->id; - nss_phys_if_register_handler(nss_ctx, if_num); - - /* - * Packets recieved on physical interface can be exceptioned to HLOS - * from any NSS core so we need to register data plane for all - */ - for (core = 0; core < nss_top->num_nss; core++) { - nss_core_register_subsys_dp(&nss_top->nss[core], if_num, nss_dp_receive, NULL, NULL, netdev, ndpp->features); - } - - /* - * Now we are registered and our side is ready, if the data plane was opened, ask it to start again - */ - if (is_open) { - nss_dp_start_data_plane(netdev, (struct nss_dp_data_plane_ctx *)ndpp); - } - return true; -} - -/* - * nss_data_plane_unregister_from_nss_dp() - */ -static void nss_data_plane_unregister_from_nss_dp(int if_num) -{ - /* - * Do any SoC specific un-registrations. - */ - nss_data_plane_hal_unregister(nss_data_plane_params[if_num].nss_ctx); - - nss_dp_restore_data_plane(nss_data_plane_params[if_num].dpc.dev); - nss_data_plane_params[if_num].dpc.dev = NULL; - nss_data_plane_params[if_num].nss_ctx = NULL; - nss_data_plane_params[if_num].if_num = 0; - nss_data_plane_params[if_num].notify_open = 0; - nss_data_plane_params[if_num].bypass_nw_process = 0; -} - -/* - * __nss_data_plane_register() - */ -static void __nss_data_plane_register(struct nss_ctx_instance *nss_ctx) -{ - int i; - - for (i = NSS_DP_START_IFNUM; i < NSS_DP_MAX_INTERFACES; i++) { - if (!nss_data_plane_register_to_nss_dp(nss_ctx, i)) { - nss_warning("%px: Register data plane failed for data plane %d\n", nss_ctx, i); - } else { - nss_info("%px: Register data plan to data plane %d success\n", nss_ctx, i); - } - } - - /* - * Do any SoC specific registrations. - */ - nss_data_plane_hal_register(nss_ctx); -} - -/* - * __nss_data_plane_unregister() - */ -static void __nss_data_plane_unregister(void) -{ - int i, core; - - for (core = 0; core < nss_top_main.num_nss; core++) { - for (i = NSS_DP_START_IFNUM; i < NSS_DP_MAX_INTERFACES; i++) { - if (nss_top_main.nss[core].subsys_dp_register[i].ndev) { - nss_data_plane_unregister_from_nss_dp(i); - nss_core_unregister_subsys_dp(&nss_top_main.nss[core], i); - } - } - } -} - -/* - * __nss_data_plane_stats_sync() - */ -static void __nss_data_plane_stats_sync(struct nss_phys_if_stats *stats, uint16_t interface) -{ - nss_data_plane_hal_stats_sync(&nss_data_plane_params[interface], stats); -} - -/* - * __nss_data_plane_get_mtu_sz() - */ -static uint16_t __nss_data_plane_get_mtu_sz(uint16_t mtu) -{ - return nss_data_plane_hal_get_mtu_sz(mtu); -} - -/* - * nss_data_plane_ops - */ -struct nss_data_plane_ops nss_data_plane_ops = { - .data_plane_register = &__nss_data_plane_register, - .data_plane_unregister = &__nss_data_plane_unregister, - .data_plane_stats_sync = &__nss_data_plane_stats_sync, - .data_plane_get_mtu_sz = &__nss_data_plane_get_mtu_sz, -}; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane_common.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane_common.c deleted file mode 100644 index 4ffaa9ce4..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane_common.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2016,2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_data_plane.h" -#include "nss_core.h" - -static struct delayed_work nss_data_plane_work; -static struct workqueue_struct *nss_data_plane_workqueue; - -extern bool pn_mq_en; -extern uint16_t pn_qlimits[NSS_MAX_NUM_PRI]; - -/* - * nss_data_plane_work_function() - * Work function that gets queued to "install" the data plane overlays - */ -static void nss_data_plane_work_function(struct work_struct *work) -{ - int ret; - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[NSS_CORE_0]; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - /* - * The queue config command is a synchronous command and needs to be issued - * in process context, before NSS data plane switch. - */ - ret = nss_n2h_update_queue_config_sync(nss_ctx, pn_mq_en, pn_qlimits); - if (ret != NSS_TX_SUCCESS) { - nss_warning("Failed to send pnode queue config to core 0\n"); - } - - nss_top->data_plane_ops->data_plane_register(nss_ctx); -} - -/* - * nss_data_plane_schedule_registration() - * Called from nss_init to schedule a work to do data_plane register to data plane host - */ -bool nss_data_plane_schedule_registration(void) -{ - if (!queue_work_on(1, nss_data_plane_workqueue, &nss_data_plane_work.work)) { - nss_warning("Failed to register data plane workqueue on core 1\n"); - return false; - } - - nss_info("Register data plane workqueue on core 1\n"); - return true; -} - -/* - * nss_data_plane_init_delay_work() - */ -int nss_data_plane_init_delay_work(void) -{ - nss_data_plane_workqueue = create_singlethread_workqueue("nss_data_plane_workqueue"); - if (!nss_data_plane_workqueue) { - nss_warning("Can't allocate workqueue\n"); - return -ENOMEM; - } - - INIT_DELAYED_WORK(&nss_data_plane_work, nss_data_plane_work_function); - return 0; -} - -/* - * nss_data_plane_destroy_delay_work() - */ -void nss_data_plane_destroy_delay_work(void) -{ - destroy_workqueue(nss_data_plane_workqueue); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane_gmac.c b/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane_gmac.c deleted file mode 100644 index 42e10a91c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_data_plane/nss_data_plane_gmac.c +++ /dev/null @@ -1,396 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_data_plane.h" -#include "nss_phys_if.h" -#include "nss_core.h" -#include "nss_tx_rx_common.h" -#include - -#define NSS_DP_GMAC_SUPPORTED_FEATURES (NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_FRAGLIST | (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_UFO)) -#define NSS_DATA_PLANE_GMAC_MAX_INTERFACES 4 - -static DEFINE_SPINLOCK(nss_data_plane_gmac_stats_lock); - -/* - * nss_data_plane_gmac_param - * Holds the information that is going to pass to data plane host as a cookie - */ -struct nss_data_plane_gmac_param { - int if_num; /* physical interface number */ - struct net_device *dev; /* net_device instance of this data plane */ - struct nss_ctx_instance *nss_ctx; /* which nss core */ - struct nss_gmac_stats gmac_stats; /* gmac stats */ - int notify_open; /* This data plane interface has been opened or not */ - uint32_t features; /* skb types supported by this interface */ - uint32_t bypass_nw_process; /* Do we want to bypass NW processing in NSS for this data plane? */ -} nss_data_plane_gmac_params[NSS_DATA_PLANE_GMAC_MAX_INTERFACES]; - -/* - * __nss_data_plane_open() - * Called by gmac to notify open to nss-fw - */ -static int __nss_data_plane_open(void *arg, uint32_t tx_desc_ring, uint32_t rx_desc_ring, uint32_t mode) -{ - struct nss_data_plane_gmac_param *dp = (struct nss_data_plane_gmac_param *)arg; - - if (dp->notify_open) { - return NSS_GMAC_SUCCESS; - } - if (nss_phys_if_open(dp->nss_ctx, tx_desc_ring, rx_desc_ring, mode, dp->if_num, dp->bypass_nw_process) == NSS_TX_SUCCESS) { - dp->notify_open = 1; - return NSS_GMAC_SUCCESS; - } - return NSS_GMAC_FAILURE; -} - -/* - * __nss_data_plane_close() - * Called by gmac to notify close to nss-fw - */ -static int __nss_data_plane_close(void *arg) -{ - /* - * We don't actually do synopsys gmac close in fw, just return success - */ - return NSS_GMAC_SUCCESS; -} - -/* - * __nss_data_plane_link_state() - * Called by gmac to notify link state change to nss-fw - */ -static int __nss_data_plane_link_state(void *arg, uint32_t link_state) -{ - struct nss_data_plane_gmac_param *dp = (struct nss_data_plane_gmac_param *)arg; - - return nss_phys_if_link_state(dp->nss_ctx, link_state, dp->if_num); -} - -/* - * __nss_data_plane_mac_addr() - * Called by gmac to set mac address - */ -static int __nss_data_plane_mac_addr(void *arg, uint8_t *addr) -{ - struct nss_data_plane_gmac_param *dp = (struct nss_data_plane_gmac_param *)arg; - - return nss_phys_if_mac_addr(dp->nss_ctx, addr, dp->if_num); -} - -/* - * __nss_data_plane_change_mtu() - * Called by gmac to change mtu of a gmac - */ -static int __nss_data_plane_change_mtu(void *arg, uint32_t mtu) -{ - struct nss_data_plane_gmac_param *dp = (struct nss_data_plane_gmac_param *)arg; - - /* - * MTU size check is already done in nss-gmac driver, just pass to phys_if - */ - return nss_phys_if_change_mtu(dp->nss_ctx, mtu, dp->if_num); -} - -/* - * __nss_data_plane_pause_on_off() - * Called by gmac to enable/disable pause frames - */ -static int __nss_data_plane_pause_on_off(void *arg, uint32_t pause_on) -{ - struct nss_data_plane_gmac_param *dp = (struct nss_data_plane_gmac_param *)arg; - - return nss_phys_if_pause_on_off(dp->nss_ctx, pause_on, dp->if_num); -} - -/* - * __nss_data_plane_buf() - * Called by gmac to pass a sk_buff for xmit - */ -static int __nss_data_plane_buf(void *arg, struct sk_buff *os_buf) -{ - struct nss_data_plane_gmac_param *dp = (struct nss_data_plane_gmac_param *)arg; - - return nss_phys_if_buf(dp->nss_ctx, os_buf, dp->if_num); -} - -/* - * __nss_data_plane_set_features() - * Called by gmac to allow data plane to modify the set of features it supports - */ -static void __nss_data_plane_set_features(struct net_device *netdev) -{ - netdev->features |= NSS_DP_GMAC_SUPPORTED_FEATURES; - netdev->hw_features |= NSS_DP_GMAC_SUPPORTED_FEATURES; - netdev->vlan_features |= NSS_DP_GMAC_SUPPORTED_FEATURES; - netdev->wanted_features |= NSS_DP_GMAC_SUPPORTED_FEATURES; -} - -/* - * __nss_data_plane_get_stats() - */ -static void __nss_data_plane_get_stats(void *arg, struct nss_gmac_stats *stats) -{ - struct nss_data_plane_gmac_param *dp = (struct nss_data_plane_gmac_param *)arg; - - spin_lock_bh(&nss_data_plane_gmac_stats_lock); - memcpy(stats, &dp->gmac_stats, sizeof(*stats)); - spin_unlock_bh(&nss_data_plane_gmac_stats_lock); -} - -/* - * nss offload data plane ops - */ -static struct nss_gmac_data_plane_ops dp_ops = { - .open = __nss_data_plane_open, - .close = __nss_data_plane_close, - .link_state = __nss_data_plane_link_state, - .mac_addr = __nss_data_plane_mac_addr, - .change_mtu = __nss_data_plane_change_mtu, - .xmit = __nss_data_plane_buf, - .set_features = __nss_data_plane_set_features, - .pause_on_off = __nss_data_plane_pause_on_off, - .get_stats = __nss_data_plane_get_stats, -}; - -/* - * nss_data_plane_register_to_nss_gmac() - */ -static bool nss_data_plane_register_to_nss_gmac(struct nss_ctx_instance *nss_ctx, int if_num) -{ - struct nss_data_plane_gmac_param *ndpp = &nss_data_plane_gmac_params[if_num]; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct net_device *netdev; - bool is_open; - int core; - - netdev = nss_gmac_get_netdev_by_macid(if_num); - if (!netdev) { - nss_info("Platform don't have gmac%d enabled, don't bring up nss_phys_if and don't register to nss-gmac", if_num); - return false; - } - - is_open = nss_gmac_is_in_open_state(netdev); - ndpp->dev = netdev; - ndpp->nss_ctx = nss_ctx; - ndpp->if_num = if_num; - ndpp->notify_open = 0; - ndpp->features = 0; - - /* - * Check if NSS NW processing to be bypassed for this GMAC - */ - if (nss_skip_nw_process) { - ndpp->bypass_nw_process = 1; - } else { - ndpp->bypass_nw_process = 0; - } - - if (nss_gmac_override_data_plane(netdev, &dp_ops, ndpp) != NSS_GMAC_SUCCESS) { - nss_info("Override nss-gmac data plane failed\n"); - return false; - } - - /* - * Setup the receive callback so that data pkts received form NSS-FW will - * be redirected to the gmac driver as we are overriding the data plane - */ - nss_top->phys_if_handler_id[if_num] = nss_ctx->id; - nss_phys_if_register_handler(nss_ctx, if_num); - - /* - * Packets recieved on physical interface can be exceptioned to HLOS - * from any NSS core so we need to register data plane for all - */ - for (core = 0; core < nss_top->num_nss; core++) { - nss_core_register_subsys_dp(&nss_top->nss[core], if_num, nss_gmac_receive, NULL, NULL, netdev, ndpp->features); - } - - /* - * Now we are registered and our side is ready, if the gmac was opened, ask it to start again - */ - if (is_open) { - nss_gmac_start_data_plane(netdev, ndpp); - } - return true; -} - -/* - * nss_data_plane_unregister_from_nss_gmac() - */ -static void nss_data_plane_unregister_from_nss_gmac(int if_num) -{ - nss_gmac_restore_data_plane(nss_data_plane_gmac_params[if_num].dev); - nss_data_plane_gmac_params[if_num].dev = NULL; - nss_data_plane_gmac_params[if_num].nss_ctx = NULL; - nss_data_plane_gmac_params[if_num].if_num = 0; - nss_data_plane_gmac_params[if_num].notify_open = 0; - nss_data_plane_gmac_params[if_num].bypass_nw_process = 0; -} - -/* - * __nss_data_plane_register() - */ -static void __nss_data_plane_register(struct nss_ctx_instance *nss_ctx) -{ - int i; - - for (i = 0; i < NSS_DATA_PLANE_GMAC_MAX_INTERFACES; i++) { - if (!nss_data_plane_register_to_nss_gmac(nss_ctx, i)) { - nss_warning("%px: Register data plane failed for gmac:%d\n", nss_ctx, i); - } else { - nss_info("%px: Register data plan to gmac:%d success\n", nss_ctx, i); - } - } -} - -/* - * __nss_data_plane_unregister() - */ -static void __nss_data_plane_unregister(void) -{ - int i, core; - - for (core = 0; core < nss_top_main.num_nss; core++) { - for (i = 0; i < NSS_DATA_PLANE_GMAC_MAX_INTERFACES; i++) { - if (nss_top_main.nss[core].subsys_dp_register[i].ndev) { - nss_data_plane_unregister_from_nss_gmac(i); - nss_core_unregister_subsys_dp(&nss_top_main.nss[core], i); - } - } - } -} - -/* - * __nss_data_plane_stats_sync() - * Handle the syncing of gmac data plane stats. - */ -static void __nss_data_plane_stats_sync(struct nss_phys_if_stats *stats, uint16_t interface) -{ - struct nss_gmac_stats *gmac_stats = &nss_data_plane_gmac_params[interface].gmac_stats; - - spin_lock_bh(&nss_data_plane_gmac_stats_lock); - gmac_stats->rx_bytes += stats->if_stats.rx_bytes; - gmac_stats->rx_packets += stats->if_stats.rx_packets; - gmac_stats->rx_errors += stats->estats.rx_errors; - gmac_stats->rx_receive_errors += stats->estats.rx_receive_errors; - gmac_stats->rx_descriptor_errors += stats->estats.rx_descriptor_errors; - gmac_stats->rx_late_collision_errors += stats->estats.rx_late_collision_errors; - gmac_stats->rx_dribble_bit_errors += stats->estats.rx_dribble_bit_errors; - gmac_stats->rx_length_errors += stats->estats.rx_length_errors; - gmac_stats->rx_ip_header_errors += stats->estats.rx_ip_header_errors; - gmac_stats->rx_ip_payload_errors += stats->estats.rx_ip_payload_errors; - gmac_stats->rx_no_buffer_errors += stats->estats.rx_no_buffer_errors; - gmac_stats->rx_transport_csum_bypassed += stats->estats.rx_transport_csum_bypassed; - - gmac_stats->tx_bytes += stats->if_stats.tx_bytes; - gmac_stats->tx_packets += stats->if_stats.tx_packets; - gmac_stats->tx_collisions += stats->estats.tx_collisions; - gmac_stats->tx_errors += stats->estats.tx_errors; - gmac_stats->tx_jabber_timeout_errors += stats->estats.tx_jabber_timeout_errors; - gmac_stats->tx_frame_flushed_errors += stats->estats.tx_frame_flushed_errors; - gmac_stats->tx_loss_of_carrier_errors += stats->estats.tx_loss_of_carrier_errors; - gmac_stats->tx_no_carrier_errors += stats->estats.tx_no_carrier_errors; - gmac_stats->tx_late_collision_errors += stats->estats.tx_late_collision_errors; - gmac_stats->tx_excessive_collision_errors += stats->estats.tx_excessive_collision_errors; - gmac_stats->tx_excessive_deferral_errors += stats->estats.tx_excessive_deferral_errors; - gmac_stats->tx_underflow_errors += stats->estats.tx_underflow_errors; - gmac_stats->tx_ip_header_errors += stats->estats.tx_ip_header_errors; - gmac_stats->tx_ip_payload_errors += stats->estats.tx_ip_payload_errors; - gmac_stats->tx_dropped += stats->estats.tx_dropped; - - gmac_stats->hw_errs[0] += stats->estats.hw_errs[0]; - gmac_stats->hw_errs[1] += stats->estats.hw_errs[1]; - gmac_stats->hw_errs[2] += stats->estats.hw_errs[2]; - gmac_stats->hw_errs[3] += stats->estats.hw_errs[3]; - gmac_stats->hw_errs[4] += stats->estats.hw_errs[4]; - gmac_stats->hw_errs[5] += stats->estats.hw_errs[5]; - gmac_stats->hw_errs[6] += stats->estats.hw_errs[6]; - gmac_stats->hw_errs[7] += stats->estats.hw_errs[7]; - gmac_stats->hw_errs[8] += stats->estats.hw_errs[8]; - gmac_stats->hw_errs[9] += stats->estats.hw_errs[9]; - gmac_stats->rx_missed += stats->estats.rx_missed; - - gmac_stats->fifo_overflows += stats->estats.fifo_overflows; - gmac_stats->rx_scatter_errors += stats->estats.rx_scatter_errors; - gmac_stats->tx_ts_create_errors += stats->estats.tx_ts_create_errors; - gmac_stats->gmac_total_ticks += stats->estats.gmac_total_ticks; - gmac_stats->gmac_worst_case_ticks += stats->estats.gmac_worst_case_ticks; - gmac_stats->gmac_iterations += stats->estats.gmac_iterations; - gmac_stats->tx_pause_frames += stats->estats.tx_pause_frames; - gmac_stats->mmc_rx_overflow_errors += stats->estats.mmc_rx_overflow_errors; - gmac_stats->mmc_rx_watchdog_timeout_errors += stats->estats.mmc_rx_watchdog_timeout_errors; - gmac_stats->mmc_rx_crc_errors += stats->estats.mmc_rx_crc_errors; - gmac_stats->mmc_rx_ip_header_errors += stats->estats.mmc_rx_ip_header_errors; - gmac_stats->mmc_rx_octets_g += stats->estats.mmc_rx_octets_g; - gmac_stats->mmc_rx_ucast_frames += stats->estats.mmc_rx_ucast_frames; - gmac_stats->mmc_rx_bcast_frames += stats->estats.mmc_rx_bcast_frames; - gmac_stats->mmc_rx_mcast_frames += stats->estats.mmc_rx_mcast_frames; - gmac_stats->mmc_rx_undersize += stats->estats.mmc_rx_undersize; - gmac_stats->mmc_rx_oversize += stats->estats.mmc_rx_oversize; - gmac_stats->mmc_rx_jabber += stats->estats.mmc_rx_jabber; - gmac_stats->mmc_rx_octets_gb += stats->estats.mmc_rx_octets_gb; - gmac_stats->mmc_rx_frag_frames_g += stats->estats.mmc_rx_frag_frames_g; - gmac_stats->mmc_tx_octets_g += stats->estats.mmc_tx_octets_g; - gmac_stats->mmc_tx_ucast_frames += stats->estats.mmc_tx_ucast_frames; - gmac_stats->mmc_tx_bcast_frames += stats->estats.mmc_tx_bcast_frames; - gmac_stats->mmc_tx_mcast_frames += stats->estats.mmc_tx_mcast_frames; - gmac_stats->mmc_tx_deferred += stats->estats.mmc_tx_deferred; - gmac_stats->mmc_tx_single_col += stats->estats.mmc_tx_single_col; - gmac_stats->mmc_tx_multiple_col += stats->estats.mmc_tx_multiple_col; - gmac_stats->mmc_tx_octets_gb += stats->estats.mmc_tx_octets_gb; - - spin_unlock_bh(&nss_data_plane_gmac_stats_lock); -} - -/* - * __nss_data_plane_get_mtu_sz() - */ -static uint16_t __nss_data_plane_get_mtu_sz(uint16_t max_mtu) -{ - /* - * GMACs support 3 Modes - * Normal Mode Payloads upto 1522 Bytes ( 1500 + 14 + 4(Vlan) + 4(CRC)) - * Mini Jumbo Mode Payloads upto 2000 Bytes (1978 + 14 + 4(Vlan) + 4 (CRC)) - * Full Jumbo Mode payloads upto 9622 Bytes (9600 + 14 + 4(Vlan) + 4 (CRC)) - */ - - /* - * The configured MTU value on a gmac interface should be one of these - * cases. Finding the Needed MTU size that is required for GMAC to - * successfully receive the frame. - */ - if (max_mtu <= NSS_GMAC_NORMAL_FRAME_MTU) { - return NSS_GMAC_NORMAL_FRAME_MTU; - } - if (max_mtu <= NSS_GMAC_MINI_JUMBO_FRAME_MTU) { - return NSS_GMAC_MINI_JUMBO_FRAME_MTU; - } - if (max_mtu <= NSS_GMAC_FULL_JUMBO_FRAME_MTU) { - return NSS_GMAC_FULL_JUMBO_FRAME_MTU; - } - return 0; -} - -/* - * nss_data_plane_gmac_ops - */ -struct nss_data_plane_ops nss_data_plane_gmac_ops = { - .data_plane_register = &__nss_data_plane_register, - .data_plane_unregister = &__nss_data_plane_unregister, - .data_plane_stats_sync = &__nss_data_plane_stats_sync, - .data_plane_get_mtu_sz = &__nss_data_plane_get_mtu_sz, -}; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma.c b/feeds/ipq807x/qca-nss-drv/src/nss_dma.c deleted file mode 100755 index e88e7c668..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma.c +++ /dev/null @@ -1,501 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_dma.c - * NSS DMA APIs - */ - -#include -#include "nss_dma_stats.h" -#include "nss_dma_log.h" -#include "nss_dma_strings.h" - -/* - * Test configuration value - */ -struct nss_dma_test_cfg_val { - int val; /* field value */ - int min; /* Minimum value */ - int max; /* Maximum value */ -}; - -/* - * Test configuration for user - */ -struct nss_dma_test_cfg_user { - struct nss_dma_test_cfg_val run; /* test run state */ - struct nss_dma_test_cfg_val code; /* test run code */ - struct nss_dma_test_cfg_val type; /* test type code */ - struct nss_dma_test_cfg_val packets; /* packet count per loop */ - int result_tx_packets; /* test results TX packets */ - int result_rx_packets; /* test result RX packets */ - int result_time; /* test time */ -}; - -static struct nss_dma_test_cfg_user test_cfg = { - .run = {.val = 0, .min = 0 /* stopped */, .max = 1 /* running */}, - .code = {.val = 1, .min = 1 /* linearize */, .max = 2 /* split */}, - .type = {.val = NSS_DMA_TEST_TYPE_DEFAULT, .min = NSS_DMA_TEST_TYPE_DEFAULT, .max = NSS_DMA_TEST_TYPE_MAX}, - .packets = {.val = 1, .min = 1, .max = 65536}, -}; - -/* - * Private data structure. - */ -struct nss_dma_pvt { - struct semaphore sem; /* Semaphore structure. */ - struct completion complete; /* Completion structure. */ - int response; /* Response from FW. */ - void *cb; /* Original cb for sync msgs. */ - void *app_data; /* Original app_data for sync msgs. */ -}; - -static struct nss_dma_pvt nss_dma_cfg_pvt; - -/* - * nss_dma_verify_if_num() - * Verify if_num passed to us. - */ -static inline bool nss_dma_verify_if_num(uint32_t if_num) -{ - return if_num == NSS_DMA_INTERFACE; -} - -/* - * nss_dma_interface_handler() - * Handle NSS -> HLOS messages for DMA Statistics - */ -static void nss_dma_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data) -{ - struct nss_dma_msg *ndm = (struct nss_dma_msg *)ncm; - nss_dma_msg_callback_t cb; - - if (!nss_dma_verify_if_num(ncm->interface)) { - nss_warning("%px: invalid interface %d for dma\n", nss_ctx, ncm->interface); - return; - } - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_DMA_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for dma", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_dma_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Trace messages. - */ - nss_dma_log_rx_msg(ndm); - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Update driver statistics and send statistics notifications to the registered modules. - */ - if (ndm->cm.type == NSS_DMA_MSG_TYPE_SYNC_STATS) { - nss_dma_stats_sync(nss_ctx, &ndm->msg.stats); - nss_dma_stats_notify(nss_ctx); - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_dma_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_dma_register_handler() - * Register handler for messaging - */ -void nss_dma_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_dma_get_context(); - - nss_info("%px: nss_dma_register_handler", nss_ctx); - nss_core_register_handler(nss_ctx, NSS_DMA_INTERFACE, nss_dma_msg_handler, NULL); - - nss_dma_stats_dentry_create(); - nss_dma_strings_dentry_create(); -} -EXPORT_SYMBOL(nss_dma_register_handler); - -/* - * nss_dma_tx_msg() - * Transmit an dma message to the FW with a specified size. - */ -nss_tx_status_t nss_dma_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_dma_msg *ndm) -{ - struct nss_cmn_msg *ncm = &ndm->cm; - - /* - * Sanity check the message - */ - if (!nss_dma_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_DMA_MSG_TYPE_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_dma_log_tx_msg(ndm); - - return nss_core_send_cmd(nss_ctx, ndm, sizeof(*ndm), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_dma_tx_msg); - -/* - * nss_dma_msg_test_callback() - * Callback function for dma test start configuration - */ -static void nss_dma_msg_test_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - struct nss_ctx_instance *nss_ctx __attribute__((unused)) = (struct nss_ctx_instance *)app_data; - struct nss_dma_msg *ndm = (struct nss_dma_msg *)ncm; - struct nss_dma_test_cfg *ndtc = &ndm->msg.test_cfg; - struct nss_cmn_node_stats *ncns = &ndtc->node_stats; - - test_cfg.run.val = 0; /* test completed */ - - /* - * Test start has been failed. Restore the value to initial state. - */ - if (ndm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: nss dma test failed: %d \n", nss_ctx, ndm->cm.error); - test_cfg.result_tx_packets = 0; - test_cfg.result_rx_packets = 0; - test_cfg.result_time = 0; - return; - } - - test_cfg.result_tx_packets = ncns->tx_packets; - test_cfg.result_rx_packets = ncns->rx_packets; - test_cfg.result_time = ndtc->time_delta; - - nss_info("%px: nss dma test complete\n", nss_ctx); - nss_info("%px: results tx=%u, rx=%u, time=%u\n", ndm, ncns->tx_packets, ncns->rx_packets, ndtc->time_delta); -} - -/* - * nss_dma_msg_test() - * Send NSS DMA test start message. - */ -static nss_tx_status_t nss_dma_msg_test(struct nss_ctx_instance *nss_ctx) -{ - struct nss_dma_msg ndm; - uint32_t flags = 0; - int32_t status; - size_t len; - - len = sizeof(struct nss_cmn_msg) + sizeof(struct nss_dma_test_cfg); - - nss_info("%px: DMA test message:%x\n", nss_ctx, test_cfg.run.val); - if (test_cfg.code.val == 1) { - flags = NSS_DMA_TEST_FLAGS_LINEARIZE; - } - - nss_dma_msg_init(&ndm, NSS_DMA_INTERFACE, NSS_DMA_MSG_TYPE_TEST_PERF, len, nss_dma_msg_test_callback, nss_ctx); - - ndm.msg.test_cfg.packet_count = test_cfg.packets.val; - ndm.msg.test_cfg.type = test_cfg.type.val; - ndm.msg.test_cfg.flags = flags; - - status = nss_dma_tx_msg(nss_ctx, &ndm); - if (unlikely(status != NSS_TX_SUCCESS)) { - return status; - } - - /* - * Test is now running - */ - test_cfg.run.val = 1; - return NSS_TX_SUCCESS; -} - -/* - * nss_dma_msg_init() - * Initialize DMA message. - */ -void nss_dma_msg_init(struct nss_dma_msg *ndm, uint16_t if_num, uint32_t type, uint32_t len, nss_dma_msg_callback_t cb, - void *app_data) -{ - nss_cmn_msg_init(&ndm->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_dma_msg_init); - -/* - * nss_crypto_cmn_get_context() - * get NSS context instance for crypto handle - */ -struct nss_ctx_instance *nss_dma_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.dma_handler_id]; -} -EXPORT_SYMBOL(nss_dma_get_context); - -/* - * nss_dma_test_handler() - * Handles the performance test. - */ -static int nss_dma_test_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = nss_dma_get_context(); - int cur_state = test_cfg.run.val; - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret != NSS_SUCCESS) { - return ret; - } - - if (!write) { - return ret; - } - - /* - * Check any tests are already scheduled - */ - if (cur_state > 0) { - nss_info("%px: Test is already running, stopping it.\n", nss_ctx); - } else { - nss_info("%px: Test is not running, starting it.\n", nss_ctx); - } - - ret = nss_dma_msg_test(nss_ctx); - if (ret != NSS_SUCCESS) { - nss_warning("%px: Test configuration has failed.\n", nss_ctx); - test_cfg.run.val = 0; - } - - return ret; -} - -static struct ctl_table nss_dma_table[] = { - { - .procname = "test_run", - .data = &test_cfg.run.val, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = nss_dma_test_handler, - .extra1 = &test_cfg.run.min, - .extra2 = &test_cfg.run.max, - }, - { - .procname = "test_code", - .data = &test_cfg.code.val, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec_minmax, - .extra1 = &test_cfg.code.min, - .extra2 = &test_cfg.code.max, - }, - { - .procname = "test_type", - .data = &test_cfg.type.val, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec_minmax, - .extra1 = &test_cfg.type.min, - .extra2 = &test_cfg.type.max, - }, - { - .procname = "test_packets", - .data = &test_cfg.packets.val, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec_minmax, - .extra1 = &test_cfg.packets.min, - .extra2 = &test_cfg.packets.max, - }, - { - .procname = "result_tx", - .data = &test_cfg.result_tx_packets, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec, - }, - { - .procname = "result_rx", - .data = &test_cfg.result_rx_packets, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec, - }, - { - .procname = "result_time", - .data = &test_cfg.result_time, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec, - }, - { } -}; - -static struct ctl_table nss_dma_dir[] = { - { - .procname = "dma", - .mode = 0555, - .child = nss_dma_table, - }, - { } -}; - -static struct ctl_table nss_dma_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_dma_dir, - }, - { } -}; - -static struct ctl_table nss_dma_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_dma_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_dma_header; - -/* - * nss_dma_register_sysctl() - */ -void nss_dma_register_sysctl(void) -{ - - /* - * dma sema init. - */ - sema_init(&nss_dma_cfg_pvt.sem, 1); - init_completion(&nss_dma_cfg_pvt.complete); - - /* - * Register sysctl table. - */ - nss_dma_header = register_sysctl_table(nss_dma_root); -} - -/* - * nss_dma_unregister_sysctl() - * Unregister sysctl specific to dma - */ -void nss_dma_unregister_sysctl(void) -{ - /* - * Unregister sysctl table. - */ - if (nss_dma_header) { - unregister_sysctl_table(nss_dma_header); - } -} - -/* - * nss_dma_notify_register() - * Register to receive dma notify messages. - */ -struct nss_ctx_instance *nss_dma_notify_register(int core, nss_dma_msg_callback_t cb, void *app_data) -{ - struct nss_ctx_instance *nss_ctx = nss_dma_get_context(); - uint32_t ret; - - ret = nss_core_register_handler(nss_ctx, NSS_DMA_INTERFACE, nss_dma_msg_handler, app_data); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to register event handler for DMA interface", nss_ctx); - return NULL; - } - - ret = nss_core_register_msg_handler(nss_ctx, NSS_DMA_INTERFACE, cb); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, NSS_DMA_INTERFACE); - nss_warning("%px: unable to register event handler for DMA interface", nss_ctx); - return NULL; - } - - return nss_ctx; -} -EXPORT_SYMBOL(nss_dma_notify_register); - -/* - * nss_dma_notify_unregister() - * Unregister to receive dma notify messages. - */ -void nss_dma_notify_unregister(int core) -{ - struct nss_ctx_instance *nss_ctx = nss_dma_get_context(); - uint32_t ret; - - BUG_ON(!nss_ctx); - - ret = nss_core_unregister_msg_handler(nss_ctx, NSS_DMA_INTERFACE); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for DMA interface", nss_ctx); - return; - } - - ret = nss_core_unregister_handler(nss_ctx, NSS_DMA_INTERFACE); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for DMA interface", nss_ctx); - return; - } - - return; -} -EXPORT_SYMBOL(nss_dma_notify_unregister); - -/* - * nss_dma_init() - */ -void nss_dma_init(void) -{ - nss_dma_register_sysctl(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_dma_log.c deleted file mode 100755 index 7f367c8ca..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma_log.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_dma_log.c - * NSS DMA logger file. - */ - -#include "nss_core.h" - -/* - * nss_dma_log_message_types_str - * DMA message strings - */ -static int8_t *nss_dma_log_message_types_str[NSS_DMA_MSG_TYPE_MAX] __maybe_unused = { - "DMA invalid message", - "DMA Configure message", - "DMA Statistics sync message", - "DMA Test linearization performance", -}; - -/* - * nss_dma_log_error_response_types_str - * Strings for error types for DMA messages - */ -static int8_t *nss_dma_log_error_response_types_str[NSS_DMA_MSG_ERROR_MAX] __maybe_unused = { - "No error", - "HW initialization failed", - "Unhandled message type for node", - "Error performing the test", -}; - -/* - * nss_dma_map_msg() - * Log NSS DMA configure message. - */ -static void nss_dma_configure_msg(struct nss_dma_msg *ndm) -{ - nss_trace("%px: NSS DMA configure message: \n",ndm); -} - -/* - * nss_dma_test_perf_msg() - * Log NSS DMA performace test message. - */ -static void nss_dma_test_perf_msg(struct nss_dma_msg *ndm) -{ - struct nss_dma_test_cfg *ndtc = &ndm->msg.test_cfg; - struct nss_cmn_node_stats *ncns = &ndtc->node_stats; - - nss_trace("%px: NSS DMA test perf message: \n",ndm); - nss_trace("%px: processed (TX: %u, RX:%u, time:%u)\n", ndm, ncns->tx_packets, ncns->rx_packets, ndtc->time_delta); - nss_trace("%px: test parameters (type:%u, packet_cnt:%u)\n", ndm, ndtc->type, ndtc->packet_count); -} - -/* - * nss_dma_log_verbose() - * Log message contents. - */ -static void nss_dma_log_verbose(struct nss_dma_msg *ndm) -{ - switch (ndm->cm.type) { - case NSS_DMA_MSG_TYPE_CONFIGURE: - nss_dma_configure_msg(ndm); - break; - - case NSS_DMA_MSG_TYPE_TEST_PERF: - nss_dma_test_perf_msg(ndm); - break; - - default: - nss_trace("%px: Invalid message type\n", ndm); - break; - } -} - -/* - * nss_dma_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_dma_log_tx_msg(struct nss_dma_msg *ndm) -{ - if (ndm->cm.type >= NSS_DMA_MSG_TYPE_MAX) { - nss_info("%px: Invalid message type\n", ndm); - return; - } - - nss_info("%px: type[%d]:%s\n", ndm, ndm->cm.type, nss_dma_log_message_types_str[ndm->cm.type]); - nss_dma_log_verbose(ndm); -} - -/* - * nss_dma_log_rx_msg() - * Log messages received from FW. - */ -void nss_dma_log_rx_msg(struct nss_dma_msg *ndm) -{ - if (ndm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ndm); - return; - } - - if (ndm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ndm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ndm, ndm->cm.type, - nss_dma_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response]); - goto verbose; - } - - if (ndm->cm.error >= NSS_DMA_MSG_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ndm, ndm->cm.type, nss_dma_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response], - ndm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ndm, ndm->cm.type, nss_dma_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response], - ndm->cm.error, nss_dma_log_error_response_types_str[ndm->cm.error]); - -verbose: - nss_dma_log_verbose(ndm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_dma_log.h deleted file mode 100755 index 4a9b9c3ad..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma_log.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_DMA_LOG_H -#define __NSS_DMA_LOG_H -/* - * nss_dma_log.h - * NSS DMA Log Header File - */ - -/* - * nss_dma_log_tx_msg - * Logs an DMA message that is sent to the NSS firmware. - */ -void nss_dma_log_tx_msg(struct nss_dma_msg *ndm); - -/* - * nss_dma_log_rx_msg - * Logs an DMA message that is received from the NSS firmware. - */ -void nss_dma_log_rx_msg(struct nss_dma_msg *ndm); - -#endif /* __NSS_DMA_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.c deleted file mode 100755 index 12812e4e5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_dma.h" -#include "nss_dma_stats.h" -#include "nss_dma_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_dma_stats_notifier); - -/* - * Spinlock to protect DMA statistics update/read - */ -DEFINE_SPINLOCK(nss_dma_stats_lock); - -/* - * nss_dma_stats - * DMA statistics - */ -uint64_t nss_dma_stats[NSS_DMA_STATS_MAX]; - -/* - * nss_dma_stats_read() - * Read DMA statistics - */ -static ssize_t nss_dma_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats * NSS_MAX_CORES + - * few blank lines for banner printing + Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_DMA_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - uint64_t *stats_shadow; - ssize_t bytes_read = 0; - size_t size_wr = 0; - char *lbuf; - int32_t i; - - lbuf = vzalloc(size_al); - if (!lbuf) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = vzalloc(NSS_DMA_STATS_MAX * 8); - if (!stats_shadow) { - nss_warning("Could not allocate memory for local shadow buffer"); - vfree(lbuf); - return -ENOMEM; - } - - /* - * DMA statistics - */ - spin_lock_bh(&nss_dma_stats_lock); - for (i = 0; i < NSS_DMA_STATS_MAX; i++) { - stats_shadow[i] = nss_dma_stats[i]; - } - spin_unlock_bh(&nss_dma_stats_lock); - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "dma", nss_top_main.dma_handler_id); - size_wr += nss_stats_print("dma", NULL, NSS_STATS_SINGLE_INSTANCE, nss_dma_strings_stats, - stats_shadow, NSS_DMA_STATS_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - - vfree(lbuf); - vfree(stats_shadow); - return bytes_read; -} - -/* - * nss_dma_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(dma); - -/* - * nss_dma_stats_dentry_create() - * Create DMA statistics debug entry. - */ -void nss_dma_stats_dentry_create(void) -{ - nss_stats_create_dentry("dma", &nss_dma_stats_ops); -} - -/* - * nss_dma_stats_sync() - * Handle the syncing of NSS DMA statistics. - */ -void nss_dma_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_dma_stats *nds) -{ - uint64_t *dma_stats; - uint32_t *msg_stats; - uint16_t i = 0; - - spin_lock_bh(&nss_dma_stats_lock); - - msg_stats = (uint32_t *)nds; - dma_stats = nss_dma_stats; - - for (i = 0; i < NSS_DMA_STATS_MAX; i++, dma_stats++, msg_stats++) { - *dma_stats += *msg_stats; - } - - spin_unlock_bh(&nss_dma_stats_lock); -} - -/* - * nss_dma_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_dma_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_dma_stats_notification dma_stats; - - spin_lock_bh(&nss_dma_stats_lock); - dma_stats.core_id = nss_ctx->id; - memcpy(dma_stats.stats_ctx, nss_dma_stats, sizeof(dma_stats.stats_ctx)); - spin_unlock_bh(&nss_dma_stats_lock); - - atomic_notifier_call_chain(&nss_dma_stats_notifier, NSS_STATS_EVENT_NOTIFY, &dma_stats); -} - -/* - * nss_dma_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_dma_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_dma_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_dma_stats_unregister_notifier); - -/* - * nss_dma_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_dma_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_dma_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_dma_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.h deleted file mode 100755 index a7fc1d859..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma_stats.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_DMA_STATS_H -#define __NSS_DMA_STATS_H - -#include - -/* - * DMA statistics APIs - */ -extern void nss_dma_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_dma_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_dma_stats *nds); -extern void nss_dma_stats_dentry_create(void); - -#endif /* __NSS_DMA_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_dma_strings.c deleted file mode 100755 index 402afc7be..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma_strings.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_dma_stats.h" - -/* - * nss_dma_strings_stats - * DMA statistics strings. - */ -struct nss_stats_info nss_dma_strings_stats[NSS_DMA_STATS_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_byts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_byts" , NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops" , NSS_STATS_TYPE_DROP}, - {"no_req" , NSS_STATS_TYPE_SPECIAL}, - {"no_desc" , NSS_STATS_TYPE_SPECIAL}, - {"fail_nexthop" , NSS_STATS_TYPE_SPECIAL}, - {"fail_nexthop_queue" , NSS_STATS_TYPE_SPECIAL}, - {"fail_linear_sz" , NSS_STATS_TYPE_SPECIAL}, - {"fail_linear_alloc" , NSS_STATS_TYPE_SPECIAL}, - {"fail_linear_no_sg" , NSS_STATS_TYPE_SPECIAL}, - {"fail_split_sz" , NSS_STATS_TYPE_SPECIAL}, - {"fail_split_alloc" , NSS_STATS_TYPE_SPECIAL}, - {"fail_sync_alloc" , NSS_STATS_TYPE_SPECIAL}, - {"fail_ctx_active" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[0]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[1]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[2]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[3]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[4]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[5]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[6]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[7]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[8]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[9]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[10]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[11]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[12]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[13]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[14]" , NSS_STATS_TYPE_SPECIAL}, - {"fail_hw[15]" , NSS_STATS_TYPE_SPECIAL}, -}; - - -/* - * nss_dma_strings_read() - * Read DMA node statistics names - */ -static ssize_t nss_dma_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_dma_strings_stats, NSS_DMA_STATS_MAX); -} - -/* - * nss_dma_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(dma); - -/* - * nss_dma_strings_dentry_create() - * Create DMA statistics strings debug entry. - */ -void nss_dma_strings_dentry_create(void) -{ - nss_strings_create_dentry("dma", &nss_dma_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dma_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_dma_strings.h deleted file mode 100755 index 145021627..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dma_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_DMA_STRINGS_H -#define __NSS_DMA_STRINGS_H - -extern struct nss_stats_info nss_dma_strings_stats[NSS_DMA_STATS_MAX]; -extern void nss_dma_strings_dentry_create(void); - -#endif /* __NSS_DMA_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_drv_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_drv_stats.c deleted file mode 100644 index 30b8cb5f7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_drv_stats.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_drv_strings.h" -#include "nss_drv_stats.h" - -/* - * nss_drv_stats_read() - * Read HLOS driver stats. - */ -static ssize_t nss_drv_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * Max output lines = #stats * NSS_MAX_CORES + - * few blank lines for banner printing + Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_DRV_STATS_MAX * NSS_MAX_CORES + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_DRV_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "drv", NSS_STATS_SINGLE_CORE); - for (i = 0; (i < NSS_DRV_STATS_MAX); i++) { - stats_shadow[i] = NSS_PKT_STATS_READ(&nss_top_main.stats_drv[i]); - } - - size_wr += nss_stats_print("drv", NULL, NSS_STATS_SINGLE_INSTANCE, nss_drv_strings_stats, stats_shadow, NSS_DRV_STATS_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * drv_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(drv); - -/* - * nss_drv_stats_dentry_create() - * Create DRV statistics debug entry. - */ -void nss_drv_stats_dentry_create(void) -{ - nss_stats_create_dentry("drv", &nss_drv_stats_ops); -} - -/* - * TODO: Move this (nss_wt_stats_read) function to new file (nss_wt_stats.c) - */ - -/* - * nss_wt_stats_read() - * Reads and formats worker thread statistics and outputs them to ubuf - */ -ssize_t nss_wt_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_stats_data *data = fp->private_data; - struct nss_ctx_instance *nss_ctx = data->nss_ctx; - struct nss_project_irq_stats *shadow; - uint32_t thread_count = nss_ctx->worker_thread_count; - uint32_t irq_count = nss_ctx->irq_count; - - /* - * Three lines for each IRQ - */ - uint32_t max_output_lines = thread_count * 3 * irq_count; - size_t size_al = max_output_lines * NSS_STATS_MAX_STR_LENGTH; - size_t size_wr = 0; - ssize_t bytes_read = 0; - char *lbuf; - int i; - int j; - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer\n"); - return 0; - } - - shadow = kzalloc(thread_count * irq_count * sizeof(struct nss_project_irq_stats), GFP_KERNEL); - if (unlikely(!shadow)) { - nss_warning("Could not allocate memory for stats shadow\n"); - kfree(lbuf); - return 0; - } - - spin_lock_bh(&nss_top_main.stats_lock); - if (unlikely(!nss_ctx->wt_stats)) { - spin_unlock_bh(&nss_top_main.stats_lock); - nss_warning("Worker thread statistics not allocated\n"); - kfree(lbuf); - kfree(shadow); - return 0; - } - for (i = 0; i < thread_count; ++i) { - - /* - * The statistics shadow is an array with thread_count * irq_count - * items in it. Each item is located at the index: - * (thread number) * (irq_count) + (irq number) - * thus simulating a two-dimensional array. - */ - for (j = 0; j < irq_count; ++j) { - shadow[i * irq_count + j] = nss_ctx->wt_stats[i].irq_stats[j]; - } - } - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "worker thread", NSS_STATS_SINGLE_CORE); - for (i = 0; i < thread_count; ++i) { - for (j = 0; j < irq_count; ++j) { - struct nss_project_irq_stats *is = &(shadow[i * irq_count + j]); - if (!(is->count)) { - continue; - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "t-%d:irq-%d callback: 0x%x, count: %llu\n", - i, j, is->callback, is->count); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "t-%d:irq-%d tick min: %10u avg: %10u max:%10u\n", - i, j, is->ticks_min, is->ticks_avg, is->ticks_max); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "t-%d:irq-%d insn min: %10u avg: %10u max:%10u\n\n", - i, j, is->insn_min, is->insn_avg, is->insn_max); - } - } - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(shadow); - - return bytes_read; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_drv_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_drv_stats.h deleted file mode 100644 index 543dd5c89..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_drv_stats.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_drv_stats.h - * NSS driver stats header file. - */ - -#ifndef __NSS_DRV_STATS_H -#define __NSS_DRV_STATS_H - -#include - -/* - * HLOS driver statistics - * - * WARNING: There is a 1:1 mapping between values below and corresponding - * stats string array in nss_stats.c. - */ -enum NSS_DRV_STATS { - NSS_DRV_STATS_NBUF_ALLOC_FAILS = 0, /* NBUF allocation errors */ - NSS_DRV_STATS_PAGED_BUF_ALLOC_FAILS, /* Paged buf allocation errors */ - NSS_DRV_STATS_TX_QUEUE_FULL_0, /* Tx queue full for Core 0*/ - NSS_DRV_STATS_TX_QUEUE_FULL_1, /* Tx queue full for Core 1*/ - NSS_DRV_STATS_TX_EMPTY, /* H2N Empty buffers */ - NSS_DRV_STATS_PAGED_TX_EMPTY, /* H2N Paged Empty buffers */ - NSS_DRV_STATS_TX_PACKET, /* H2N Data packets */ - NSS_DRV_STATS_TX_CMD_REQ, /* H2N Control packets */ - NSS_DRV_STATS_TX_CRYPTO_REQ, /* H2N Crypto requests */ - NSS_DRV_STATS_TX_BUFFER_REUSE, /* H2N Reuse buffer count */ - NSS_DRV_STATS_RX_EMPTY, /* N2H Empty buffers */ - NSS_DRV_STATS_RX_PACKET, /* N2H Data packets */ - NSS_DRV_STATS_RX_EXT_PACKET, /* N2H EXT type packets */ - NSS_DRV_STATS_RX_CMD_RESP, /* N2H Command responses */ - NSS_DRV_STATS_RX_STATUS, /* N2H Status packets */ - NSS_DRV_STATS_RX_CRYPTO_RESP, /* N2H Crypto responses */ - NSS_DRV_STATS_RX_VIRTUAL, /* N2H Virtual packets */ - NSS_DRV_STATS_TX_SIMPLE, /* H2N Simple SKB Packets */ - NSS_DRV_STATS_TX_NR_FRAGS, /* H2N NR Frags SKB Packets */ - NSS_DRV_STATS_TX_FRAGLIST, /* H2N Fraglist SKB Packets */ - NSS_DRV_STATS_RX_SIMPLE, /* N2H Simple SKB Packets */ - NSS_DRV_STATS_RX_NR_FRAGS, /* N2H NR Frags SKB Packets */ - NSS_DRV_STATS_RX_SKB_FRAGLIST, /* N2H Fraglist SKB Packets */ - NSS_DRV_STATS_RX_BAD_DESCRIPTOR, /* N2H Bad descriptor reads */ - NSS_DRV_STATS_RX_INVALID_INTERFACE, /* N2H Received descriptor for invalid interface */ - NSS_DRV_STATS_RX_INVALID_CORE_ID, /* N2H Received packet for invalid core_id */ - NSS_DRV_STATS_RX_INVALID_BUFFER_TYPE, /* N2H Received packet for invalid buffer type */ - NSS_DRV_STATS_NSS_SKB_COUNT, /* NSS SKB Pool Count */ - NSS_DRV_STATS_CHAIN_SEG_PROCESSED, /* N2H SKB Chain Processed Count */ - NSS_DRV_STATS_FRAG_SEG_PROCESSED, /* N2H Frag Processed Count */ - NSS_DRV_STATS_TX_CMD_QUEUE_FULL, /* Tx H2N Control packets fail due to queue full */ -#ifdef NSS_MULTI_H2N_DATA_RING_SUPPORT - NSS_DRV_STATS_TX_PACKET_QUEUE_0, /* H2N Data packets on queue0 */ - NSS_DRV_STATS_TX_PACKET_QUEUE_1, /* H2N Data packets on queue1 */ - NSS_DRV_STATS_TX_PACKET_QUEUE_2, /* H2N Data packets on queue2 */ - NSS_DRV_STATS_TX_PACKET_QUEUE_3, /* H2N Data packets on queue3 */ - NSS_DRV_STATS_TX_PACKET_QUEUE_4, /* H2N Data packets on queue4 */ - NSS_DRV_STATS_TX_PACKET_QUEUE_5, /* H2N Data packets on queue5 */ - NSS_DRV_STATS_TX_PACKET_QUEUE_6, /* H2N Data packets on queue6 */ - NSS_DRV_STATS_TX_PACKET_QUEUE_7, /* H2N Data packets on queue7 */ -#endif - NSS_DRV_STATS_MAX, -}; - -extern void nss_drv_stats_dentry_create(void); -extern ssize_t nss_wt_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos); -#endif /* __NSS_DRV_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_drv_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_drv_strings.c deleted file mode 100644 index 259561525..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_drv_strings.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" - -/* - * nss_drv_strings_stats - * Host driver stats names. - */ -struct nss_stats_info nss_drv_strings_stats[NSS_DRV_STATS_MAX] = { - {"nbuf_alloc_errors" , NSS_STATS_TYPE_ERROR}, - {"paged_buf_alloc_errors" , NSS_STATS_TYPE_ERROR}, - {"tx_queue_full[0]" , NSS_STATS_TYPE_ERROR}, - {"tx_queue_full[1]" , NSS_STATS_TYPE_ERROR}, - {"tx_buffers_empty" , NSS_STATS_TYPE_SPECIAL}, - {"tx_paged_buffers_empty" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffer_pkt" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_cmd" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_crypto" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_reuse" , NSS_STATS_TYPE_SPECIAL}, - {"rx_buffers_empty" , NSS_STATS_TYPE_SPECIAL}, - {"rx_buffers_pkt" , NSS_STATS_TYPE_SPECIAL}, - {"rx_buffers_ext_pkt" , NSS_STATS_TYPE_SPECIAL}, - {"rx_buffers_cmd_resp" , NSS_STATS_TYPE_SPECIAL}, - {"rx_buffers_status_sync" , NSS_STATS_TYPE_SPECIAL}, - {"rx_buffers_crypto" , NSS_STATS_TYPE_SPECIAL}, - {"rx_buffers_virtual" , NSS_STATS_TYPE_SPECIAL}, - {"tx_skb_simple" , NSS_STATS_TYPE_SPECIAL}, - {"tx_skb_nr_frags" , NSS_STATS_TYPE_SPECIAL}, - {"tx_skb_fraglist" , NSS_STATS_TYPE_SPECIAL}, - {"rx_skb_simple" , NSS_STATS_TYPE_SPECIAL}, - {"rx_skb_nr_frags" , NSS_STATS_TYPE_SPECIAL}, - {"rx_skb_fraglist" , NSS_STATS_TYPE_SPECIAL}, - {"rx_bad_desciptor" , NSS_STATS_TYPE_ERROR}, - {"invalid_interface" , NSS_STATS_TYPE_ERROR}, - {"invalid_core_id" , NSS_STATS_TYPE_ERROR}, - {"invalid_buffer_type" , NSS_STATS_TYPE_ERROR}, - {"nss_skb_count" , NSS_STATS_TYPE_SPECIAL}, - {"rx_chain_seg_processed" , NSS_STATS_TYPE_SPECIAL}, - {"rx_frag_seg_processed" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_cmd_queue_full" , NSS_STATS_TYPE_ERROR}, -#ifdef NSS_MULTI_H2N_DATA_RING_SUPPORT - {"tx_buffers_data_queue[0]" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_data_queue[1]" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_data_queue[2]" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_data_queue[3]" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_data_queue[4]" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_data_queue[5]" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_data_queue[6]" , NSS_STATS_TYPE_SPECIAL}, - {"tx_buffers_data_queue[7]" , NSS_STATS_TYPE_SPECIAL}, -#endif -}; - -/* - * nss_drv_strings_read() - * Read drv node statistics names. - */ -static ssize_t nss_drv_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_drv_strings_stats, NSS_DRV_STATS_MAX); -} - -/* - * nss_drv_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(drv); - -/* - * nss_drv_strings_dentry_create() - * Create drv statistics strings debug entry. - */ -void nss_drv_strings_dentry_create(void) -{ - nss_strings_create_dentry("drv", &nss_drv_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_drv_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_drv_strings.h deleted file mode 100644 index 72a1fd7a0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_drv_strings.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_DRV_STRINGS_H -#define __NSS_DRV_STRINGS_H - -extern struct nss_stats_info nss_drv_strings_stats[NSS_DRV_STATS_MAX]; - -extern void nss_drv_strings_dentry_create(void); - -#endif /* __NSS_DRV_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dscp_map.h b/feeds/ipq807x/qca-nss-drv/src/nss_dscp_map.h deleted file mode 100644 index 441dc11ac..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dscp_map.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_dscp_map.h - * NSS dscp map parse APIs - */ - -#include "nss_tx_rx_common.h" - -#define NSS_DSCP_MAP_PARAM_FIELD_COUNT 3 -#define NSS_DSCP_MAP_ARRAY_SIZE 64 -#define NSS_DSCP_MAP_PRIORITY_MAX NSS_MAX_NUM_PRI - -/* - * nss dscp map entry structure. - */ -struct nss_dscp_map_entry { - uint8_t action; /* Action associated with the DSCP value.*/ - uint8_t priority; /* Priority associated with the DSCP value. */ -}; - -/* - * nss dscp map parse output. - */ -struct nss_dscp_map_parse { - uint8_t dscp; /* Parsed dscp value */ - uint8_t action; /* Parsed action value */ - uint8_t priority; /* Parsed priority value */ -}; - -/* - * nss_dscp_map_print() - * Sysctl handler for printing dscp/pri mapping. - */ -static int nss_dscp_map_print(struct ctl_table *ctl, void __user *buffer, size_t *lenp, - loff_t *ppos, struct nss_dscp_map_entry *mapping) -{ - char *r_buf; - int i, len; - size_t cp_bytes = 0; - - /* - * (64 * 8) + 22 bytes for the buffer size is sufficient to write - * the table including the spaces and new line characters. - */ - r_buf = kzalloc(((NSS_DSCP_MAP_ARRAY_SIZE * 8) + 22) * sizeof(char), GFP_KERNEL); - if (!r_buf) { - nss_warning("Failed to alloc buffer to print dscp map table\n"); - return -EFAULT; - } - - /* - * Write the priority values to the first line of the output. - */ - len = scnprintf(r_buf + cp_bytes, 11, "%s: ", "priority"); - cp_bytes += len; - for (i = 0; i < NSS_DSCP_MAP_ARRAY_SIZE; i++) { - len = scnprintf(r_buf + cp_bytes, 4, "%d ", mapping[i].priority); - if (!len) { - nss_warning("failed to read from buffer %d\n", mapping[i].priority); - kfree(r_buf); - return -EFAULT; - } - cp_bytes += len; - } - - /* - * Add new line character at the end. - */ - len = scnprintf(r_buf + cp_bytes, 4, "\n"); - cp_bytes += len; - - /* - * Write the action values to the second line of the output. - */ - len = scnprintf(r_buf + cp_bytes, 11, "%s: ", "action"); - cp_bytes += len; - for (i = 0; i < NSS_DSCP_MAP_ARRAY_SIZE; i++) { - len = scnprintf(r_buf + cp_bytes, 4, "%d ", mapping[i].action); - if (!len) { - nss_warning("failed to read from buffer %d\n", mapping[i].action); - kfree(r_buf); - return -EFAULT; - } - cp_bytes += len; - } - - /* - * Add new line character at the end. - */ - len = scnprintf(r_buf + cp_bytes, 4, "\n"); - cp_bytes += len; - - cp_bytes = simple_read_from_buffer(buffer, *lenp, ppos, r_buf, cp_bytes); - *lenp = cp_bytes; - kfree(r_buf); - return 0; -} - -/* - * nss_dscp_map_parse() - * Sysctl handler for dscp/pri mappings. - */ -static int nss_dscp_map_parse(struct ctl_table *ctl, void __user *buffer, size_t *lenp, - loff_t *ppos, struct nss_dscp_map_parse *out) -{ - int count; - size_t cp_bytes = 0; - char w_buf[7]; - loff_t w_offset = 0; - char *str; - char *tokens[NSS_DSCP_MAP_PARAM_FIELD_COUNT]; - unsigned int dscp, priority, action; - int ret; - - /* - * Buffer length cannot be more than 7 and less than 6. - */ - if (*lenp < 6 || *lenp > 7) { - nss_warning("Buffer is not correct. Invalid lenght: %d\n", (int)*lenp); - return -EINVAL; - } - - /* - * It's a write operation - */ - cp_bytes = simple_write_to_buffer(w_buf, *lenp, &w_offset, buffer, 7); - if (cp_bytes != *lenp) { - nss_warning("failed to write to buffer\n"); - return -EFAULT; - } - - count = 0; - str = w_buf; - tokens[count] = strsep(&str, " "); - while (tokens[count] != NULL) { - count++; - if (count == NSS_DSCP_MAP_PARAM_FIELD_COUNT) { - nss_warning("maximum allowed field count is %d\n", NSS_DSCP_MAP_PARAM_FIELD_COUNT); - break; - } - tokens[count] = strsep(&str, " "); - } - - /* - * Did we read enough number of parameters from the command line. - * There must be 2 parameters. - */ - if (count != NSS_DSCP_MAP_PARAM_FIELD_COUNT) { - nss_warning("param fields are less than expected: %d\n", count); - return -EINVAL; - } - - /* - * Write the tokens to integers. - */ - ret = sscanf(tokens[0], "%u", &dscp); - if (ret != 1) { - nss_warning("failed to write the dscp token to integer\n"); - return -EFAULT; - } - - ret = sscanf(tokens[1], "%u", &action); - if (ret != 1) { - nss_warning("failed to write the action token to integer\n"); - return -EFAULT; - } - - ret = sscanf(tokens[2], "%u", &priority); - if (ret != 1) { - nss_warning("failed to write the priority token to integer\n"); - return -EFAULT; - } - - /* - * dscp value cannot be higher than 63. - */ - if (dscp >= NSS_DSCP_MAP_ARRAY_SIZE) { - nss_warning("invalid dscp value: %d\n", dscp); - return -EINVAL; - } - - /* - * Priority must be less than NSS_DSCP_MAP_PRIORITY_MAX which is 4. - */ - if (priority >= NSS_DSCP_MAP_PRIORITY_MAX) { - nss_warning("invalid priority value: %d\n", priority); - return -EINVAL; - } - - nss_info("dscp: %d action: %d priority: %d\n", dscp, action, priority); - - out->dscp = dscp; - out->action = action; - out->priority = priority; - - return 0; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls.c deleted file mode 100644 index 6d7c1a1ce..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls.c +++ /dev/null @@ -1,468 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_dtls_stats.h" -#include "nss_dtls_log.h" - -#define NSS_DTLS_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Data structures to store DTLS nss debug stats - */ -static DEFINE_SPINLOCK(nss_dtls_session_stats_lock); -static struct nss_dtls_stats_session session_stats[NSS_MAX_DTLS_SESSIONS]; - -/* - * Private data structure - */ -static struct nss_dtls_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} dtls_pvt; - -/* - * nss_dtls_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_dtls_verify_if_num(uint32_t if_num) -{ - if (nss_is_dynamic_interface(if_num) == false) - return false; - - if (nss_dynamic_interface_get_type(nss_dtls_get_context(), if_num) - != NSS_DYNAMIC_INTERFACE_TYPE_DTLS) - return false; - - return true; -} - -/* - * nss_dtls_session_stats_sync - * Per DTLS session debug stats - */ -static void nss_dtls_session_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_dtls_session_stats *stats_msg, - uint16_t if_num) -{ - int i; - struct nss_dtls_stats_session *s = NULL; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - spin_lock_bh(&nss_dtls_session_stats_lock); - for (i = 0; i < NSS_MAX_DTLS_SESSIONS; i++) { - if (session_stats[i].if_num != if_num) { - continue; - } - - s = &session_stats[i]; - break; - } - - if (!s) { - spin_unlock_bh(&nss_dtls_session_stats_lock); - return; - } - - s->stats[NSS_DTLS_STATS_SESSION_RX_PKTS] += stats_msg->node_stats.rx_packets; - s->stats[NSS_DTLS_STATS_SESSION_TX_PKTS] += stats_msg->node_stats.tx_packets; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - s->stats[NSS_DTLS_STATS_SESSION_RX_QUEUE_0_DROPPED + i] += stats_msg->node_stats.rx_dropped[i]; - } - s->stats[NSS_DTLS_STATS_SESSION_RX_AUTH_DONE] += stats_msg->rx_auth_done; - s->stats[NSS_DTLS_STATS_SESSION_TX_AUTH_DONE] += stats_msg->tx_auth_done; - s->stats[NSS_DTLS_STATS_SESSION_RX_CIPHER_DONE] += stats_msg->rx_cipher_done; - s->stats[NSS_DTLS_STATS_SESSION_TX_CIPHER_DONE] += stats_msg->tx_cipher_done; - s->stats[NSS_DTLS_STATS_SESSION_RX_CBUF_ALLOC_FAIL] += stats_msg->rx_cbuf_alloc_fail; - s->stats[NSS_DTLS_STATS_SESSION_TX_CBUF_ALLOC_FAIL] += stats_msg->tx_cbuf_alloc_fail; - s->stats[NSS_DTLS_STATS_SESSION_TX_CENQUEUE_FAIL] += stats_msg->tx_cenqueue_fail; - s->stats[NSS_DTLS_STATS_SESSION_RX_CENQUEUE_FAIL] += stats_msg->rx_cenqueue_fail; - s->stats[NSS_DTLS_STATS_SESSION_TX_DROPPED_HROOM] += stats_msg->tx_dropped_hroom; - s->stats[NSS_DTLS_STATS_SESSION_TX_DROPPED_TROOM] += stats_msg->tx_dropped_troom; - s->stats[NSS_DTLS_STATS_SESSION_TX_FORWARD_ENQUEUE_FAIL] += stats_msg->tx_forward_enqueue_fail; - s->stats[NSS_DTLS_STATS_SESSION_RX_FORWARD_ENQUEUE_FAIL] += stats_msg->rx_forward_enqueue_fail; - s->stats[NSS_DTLS_STATS_SESSION_RX_INVALID_VERSION] += stats_msg->rx_invalid_version; - s->stats[NSS_DTLS_STATS_SESSION_RX_INVALID_EPOCH] += stats_msg->rx_invalid_epoch; - s->stats[NSS_DTLS_STATS_SESSION_RX_MALFORMED] += stats_msg->rx_malformed; - s->stats[NSS_DTLS_STATS_SESSION_RX_CIPHER_FAIL] += stats_msg->rx_cipher_fail; - s->stats[NSS_DTLS_STATS_SESSION_RX_AUTH_FAIL] += stats_msg->rx_auth_fail; - s->stats[NSS_DTLS_STATS_SESSION_RX_CAPWAP_CLASSIFY_FAIL] += stats_msg->rx_capwap_classify_fail; - s->stats[NSS_DTLS_STATS_SESSION_RX_SINGLE_REC_DGRAM] += stats_msg->rx_single_rec_dgram; - s->stats[NSS_DTLS_STATS_SESSION_RX_MULTI_REC_DGRAM] += stats_msg->rx_multi_rec_dgram; - s->stats[NSS_DTLS_STATS_SESSION_RX_REPLAY_FAIL] += stats_msg->rx_replay_fail; - s->stats[NSS_DTLS_STATS_SESSION_RX_REPLAY_DUPLICATE] += stats_msg->rx_replay_duplicate; - s->stats[NSS_DTLS_STATS_SESSION_RX_REPLAY_OUT_OF_WINDOW] += stats_msg->rx_replay_out_of_window; - s->stats[NSS_DTLS_STATS_SESSION_OUTFLOW_QUEUE_FULL] += stats_msg->outflow_queue_full; - s->stats[NSS_DTLS_STATS_SESSION_DECAP_QUEUE_FULL] += stats_msg->decap_queue_full; - s->stats[NSS_DTLS_STATS_SESSION_PBUF_ALLOC_FAIL] += stats_msg->pbuf_alloc_fail; - s->stats[NSS_DTLS_STATS_SESSION_PBUF_COPY_FAIL] += stats_msg->pbuf_copy_fail; - s->stats[NSS_DTLS_STATS_SESSION_EPOCH] = stats_msg->epoch; - s->stats[NSS_DTLS_STATS_SESSION_TX_SEQ_HIGH] = stats_msg->tx_seq_high; - s->stats[NSS_DTLS_STATS_SESSION_TX_SEQ_LOW] = stats_msg->tx_seq_low; - spin_unlock_bh(&nss_dtls_session_stats_lock); -} - -/* - * nss_dtls_session_stats_get() - * Get session DTLS statitics. - */ -void nss_dtls_session_stats_get(struct nss_dtls_stats_session *stats) -{ - int i; - - if (!stats) { - nss_warning("No memory to copy dtls session stats"); - return; - } - - spin_lock_bh(&nss_dtls_session_stats_lock); - for (i = 0; i < NSS_MAX_DTLS_SESSIONS; i++) { - if (session_stats[i].valid) { - memcpy(stats, &session_stats[i], - sizeof(struct nss_dtls_stats_session)); - stats++; - } - } - spin_unlock_bh(&nss_dtls_session_stats_lock); -} - -/* - * nss_dtls_handler() - * Handle NSS -> HLOS messages for dtls tunnel - */ -static void nss_dtls_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data) -{ - struct nss_dtls_msg *ntm = (struct nss_dtls_msg *)ncm; - void *ctx; - - nss_dtls_msg_callback_t cb; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - BUG_ON(!nss_dtls_verify_if_num(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_DTLS_MSG_MAX) { - nss_warning("%px: received invalid message %d " - "for DTLS interface %d", - nss_ctx, ncm->type, ncm->interface); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_dtls_msg)) { - nss_warning("%px: dtls message length is invalid: %d", - nss_ctx, ncm->len); - return; - } - - switch (ntm->cm.type) { - case NSS_DTLS_MSG_SESSION_STATS: - nss_dtls_session_stats_sync(nss_ctx, - &ntm->msg.stats, - ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->dtls_msg_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_dtls_log_rx_msg(ntm); - - /* - * callback - */ - cb = (nss_dtls_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call dtls session callback - */ - if (!cb) { - nss_warning("%px: No callback for dtls session interface %d", - nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_dtls_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_dtls_callback(void *app_data, struct nss_dtls_msg *nim) -{ - nss_dtls_msg_callback_t callback = (nss_dtls_msg_callback_t)dtls_pvt.cb; - void *data = dtls_pvt.app_data; - - dtls_pvt.cb = NULL; - dtls_pvt.app_data = NULL; - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("dtls Error response %d\n", nim->cm.response); - - dtls_pvt.response = NSS_TX_FAILURE; - if (callback) { - callback(data, nim); - } - - complete(&dtls_pvt.complete); - return; - } - - dtls_pvt.response = NSS_TX_SUCCESS; - if (callback) { - callback(data, nim); - } - - complete(&dtls_pvt.complete); -} - -/* - * nss_dtls_tx_buf() - * Transmit buffer over DTLS interface - */ -nss_tx_status_t nss_dtls_tx_buf(struct sk_buff *skb, uint32_t if_num, - struct nss_ctx_instance *nss_ctx) -{ - BUG_ON(!nss_dtls_verify_if_num(if_num)); - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER | H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_dtls_tx_buf); - -/* - * nss_dtls_tx_msg() - * Transmit a DTLS message to NSS firmware - */ -nss_tx_status_t nss_dtls_tx_msg(struct nss_ctx_instance *nss_ctx, - struct nss_dtls_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Sanity check the message - */ - BUG_ON(!nss_dtls_verify_if_num(ncm->interface)); - - if (ncm->type > NSS_DTLS_MSG_MAX) { - nss_warning("%px: dtls message type out of range: %d", - nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_dtls_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_dtls_tx_msg); - -/* - * nss_dtls_tx_msg() - * Transmit a DTLS message to NSS firmware synchronously. - */ -nss_tx_status_t nss_dtls_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_dtls_msg *msg) -{ - - nss_tx_status_t status; - int ret = 0; - - down(&dtls_pvt.sem); - dtls_pvt.cb = (void *)msg->cm.cb; - dtls_pvt.app_data = (void *)msg->cm.app_data; - - msg->cm.cb = (nss_ptr_t)nss_dtls_callback; - msg->cm.app_data = (nss_ptr_t)NULL; - - status = nss_dtls_tx_msg(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: dtls_tx_msg failed\n", nss_ctx); - up(&dtls_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&dtls_pvt.complete, msecs_to_jiffies(NSS_DTLS_TX_TIMEOUT)); - - if (!ret) { - nss_warning("%px: DTLS msg tx failed due to timeout\n", nss_ctx); - dtls_pvt.response = NSS_TX_FAILURE; - } - - status = dtls_pvt.response; - up(&dtls_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_dtls_tx_msg_sync); - -/* - *********************************** - * Register/Unregister/Miscellaneous APIs - *********************************** - */ - -/* - * nss_dtls_register_if() - */ -struct nss_ctx_instance *nss_dtls_register_if(uint32_t if_num, - nss_dtls_data_callback_t cb, - nss_dtls_msg_callback_t ev_cb, - struct net_device *netdev, - uint32_t features, - void *app_ctx) -{ - int32_t i; - - struct nss_ctx_instance *nss_ctx = nss_dtls_get_context(); - - BUG_ON(!nss_dtls_verify_if_num(if_num)); - - spin_lock_bh(&nss_dtls_session_stats_lock); - for (i = 0; i < NSS_MAX_DTLS_SESSIONS; i++) { - if (!session_stats[i].valid) { - session_stats[i].valid = true; - session_stats[i].if_num = if_num; - session_stats[i].if_index = netdev->ifindex; - break; - } - } - spin_unlock_bh(&nss_dtls_session_stats_lock); - - if (i == NSS_MAX_DTLS_SESSIONS) { - nss_warning("%px: Cannot find free slot for " - "DTLS session stats, I/F:%u\n", nss_ctx, if_num); - return NULL; - } - - if (nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Cannot find free slot for " - "DTLS NSS I/F:%u\n", nss_ctx, if_num); - - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, cb, NULL, app_ctx, netdev, features); - nss_ctx->subsys_dp_register[if_num].type = NSS_DYNAMIC_INTERFACE_TYPE_DTLS; - - nss_top_main.dtls_msg_callback = ev_cb; - nss_core_register_handler(nss_ctx, if_num, nss_dtls_handler, app_ctx); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_dtls_register_if); - -/* - * nss_dtls_unregister_if() - */ -void nss_dtls_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_dtls_get_context(); - int32_t i; - - BUG_ON(!nss_dtls_verify_if_num(if_num)); - - spin_lock_bh(&nss_dtls_session_stats_lock); - for (i = 0; i < NSS_MAX_DTLS_SESSIONS; i++) { - if (session_stats[i].if_num == if_num) { - memset(&session_stats[i], 0, - sizeof(struct nss_dtls_stats_session)); - break; - } - } - spin_unlock_bh(&nss_dtls_session_stats_lock); - - if (i == NSS_MAX_DTLS_SESSIONS) { - nss_warning("%px: Cannot find debug stats for DTLS session %d\n", nss_ctx, if_num); - return; - } - - if (!nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Cannot find registered netdev for DTLS NSS I/F:%u\n", nss_ctx, if_num); - - return; - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.dtls_msg_callback = NULL; - nss_core_unregister_handler(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_dtls_unregister_if); - -/* - * nss_get_dtls_context() - */ -struct nss_ctx_instance *nss_dtls_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.dtls_handler_id]; -} -EXPORT_SYMBOL(nss_dtls_get_context); - -/* - * nss_dtls_msg_init() - * Initialize nss_dtls msg. - */ -void nss_dtls_msg_init(struct nss_dtls_msg *ncm, uint16_t if_num, - uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_dtls_msg_init); - -/* - * nss_dtls_get_ifnum_with_coreid() - */ -int32_t nss_dtls_get_ifnum_with_coreid(int32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_dtls_get_context(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_dtls_get_ifnum_with_coreid); - -/* - * nss_dtls_register_handler() - */ -void nss_dtls_register_handler(void) -{ - sema_init(&dtls_pvt.sem, 1); - init_completion(&dtls_pvt.complete); - - nss_dtls_stats_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn.c deleted file mode 100644 index 024d217d5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn.c +++ /dev/null @@ -1,451 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_dtls_cmn_log.h" -#include "nss_dtls_cmn_stats.h" -#include "nss_dtls_cmn_strings.h" - -#define NSS_DTLS_CMN_TX_TIMEOUT 3000 /* 3 Seconds */ -#define NSS_DTLS_CMN_INTERFACE_MAX_LONG BITS_TO_LONGS(NSS_MAX_NET_INTERFACES) - -/* - * Private data structure. - */ -static struct nss_dtls_cmn_pvt { - struct semaphore sem; - struct completion complete; - enum nss_dtls_cmn_error resp; - unsigned long if_map[NSS_DTLS_CMN_INTERFACE_MAX_LONG]; -} dtls_cmn_pvt; - -/* - * nss_dtls_cmn_verify_ifnum() - * Verify if the interface number is a DTLS interface. - */ -static bool nss_dtls_cmn_verify_ifnum(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - enum nss_dynamic_interface_type type = nss_dynamic_interface_get_type(nss_ctx, if_num); - - if (type == NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER) - return true; - - if (type == NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER) - return true; - - if (if_num == NSS_DTLS_INTERFACE) - return true; - - return false; -} - -/* - * nss_dtls_cmn_handler() - * Handle NSS -> HLOS messages for dtls tunnel. - */ -static void nss_dtls_cmn_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *data) -{ - nss_dtls_cmn_msg_callback_t cb; - void *app_data; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_trace("%px: handle event for interface num :%u", nss_ctx, ncm->interface); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_DTLS_CMN_MSG_MAX) { - nss_warning("%px:Bad message type(%d) for DTLS interface %d", nss_ctx, ncm->type, ncm->interface); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_dtls_cmn_msg)) { - nss_warning("%px:Bad message length(%d)", nss_ctx, ncm->len); - return; - } - - if (ncm->type == NSS_DTLS_CMN_MSG_TYPE_SYNC_STATS) { - nss_dtls_cmn_stats_sync(nss_ctx, ncm); - nss_dtls_cmn_stats_notify(nss_ctx, ncm->interface); - } - - /* - * Update the callback and app_data for NOTIFY messages. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Log failures. - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_dtls_cmn_log_rx_msg((struct nss_dtls_cmn_msg *)ncm); - - /* - * Callback. - */ - cb = (nss_dtls_cmn_msg_callback_t)ncm->cb; - app_data = (void *)ncm->app_data; - - /* - * Call DTLS session callback. - */ - if (!cb) { - nss_warning("%px: No callback for dtls session interface %d", nss_ctx, ncm->interface); - return; - } - - nss_trace("%px: calling dtlsmgr event handler(%u)", nss_ctx, ncm->interface); - cb(app_data, ncm); -} - -/* - * nss_dtls_cmn_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_dtls_cmn_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - /* - * This callback is for synchronous operation. The caller sends its - * response pointer which needs to be loaded with the response - * data arriving from the NSS. - */ - enum nss_dtls_cmn_error *resp = (enum nss_dtls_cmn_error *)app_data; - - *resp = (ncm->response == NSS_CMN_RESPONSE_ACK) ? NSS_DTLS_CMN_ERROR_NONE : ncm->error; - complete(&dtls_cmn_pvt.complete); - - return; -} - -/* - * nss_dtls_cmn_ifmap_get() - * Return DTLS common active interfaces map. - */ -unsigned long *nss_dtls_cmn_ifmap_get(void) -{ - return dtls_cmn_pvt.if_map; -} - -/* - * nss_dtls_cmn_tx_buf() - * Transmit buffer over DTLS interface. - */ -nss_tx_status_t nss_dtls_cmn_tx_buf(struct sk_buff *skb, uint32_t if_num, struct nss_ctx_instance *nss_ctx) -{ - if (!nss_dtls_cmn_verify_ifnum(nss_ctx, if_num)) - return NSS_TX_FAILURE; - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER | H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_dtls_cmn_tx_buf); - -/* - * nss_dtls_cmn_tx_msg() - * Transmit a DTLS message to NSS firmware. - */ -nss_tx_status_t nss_dtls_cmn_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_dtls_cmn_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - if (ncm->type >= NSS_DTLS_CMN_MSG_MAX) { - nss_warning("%px: dtls message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - if (!nss_dtls_cmn_verify_ifnum(nss_ctx, ncm->interface)) { - nss_warning("%px: dtls message interface is bad: %u", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_dtls_cmn_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_dtls_cmn_tx_msg); - -/* - * nss_dtls_cmn_tx_msg_sync() - * Transmit a DTLS message to NSS firmware synchronously. - */ -nss_tx_status_t nss_dtls_cmn_tx_msg_sync(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - enum nss_dtls_cmn_msg_type type, uint16_t len, - struct nss_dtls_cmn_msg *ndcm, enum nss_dtls_cmn_error *resp) -{ - struct nss_dtls_cmn_msg ndcm_local; - nss_tx_status_t status; - int ret; - - /* - * Length of the message should be the based on type. - */ - if (len > sizeof(ndcm_local.msg)) { - nss_warning("%px: (%u)Bad message length(%u) for type (%d)", nss_ctx, if_num, len, type); - return NSS_TX_FAILURE_TOO_LARGE; - } - - /* - * Response buffer is a required for copying the response for message. - */ - if (!resp) { - nss_warning("%px: (%u)Response buffer is empty, type(%d)", nss_ctx, if_num, type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * TODO: this can be removed in future as we need to ensure that the response - * memory is only updated when the current outstanding request is waiting. - * This can be solved by introducing sequence no. in messages and only completing - * the message if the sequence no. matches. For now this is solved by passing - * a known memory dtls_cmn_pvt.resp. - */ - down(&dtls_cmn_pvt.sem); - - /* - * We need to copy the message content into the actual message - * to be sent to NSS. - */ - nss_dtls_cmn_msg_init(&ndcm_local, if_num, type, len, nss_dtls_cmn_callback, &dtls_cmn_pvt.resp); - memcpy(&ndcm_local.msg, &ndcm->msg, len); - - status = nss_dtls_cmn_tx_msg(nss_ctx, &ndcm_local); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: dtls_tx_msg failed", nss_ctx); - goto done; - } - - ret = wait_for_completion_timeout(&dtls_cmn_pvt.complete, msecs_to_jiffies(NSS_DTLS_CMN_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: DTLS msg tx failed due to timeout", nss_ctx); - status = NSS_TX_FAILURE_NOT_READY; - goto done; - } - - /* - * Read memory barrier. - */ - smp_rmb(); - - /* - * Copy the response received. - */ - *resp = dtls_cmn_pvt.resp; - - /* - * Only in case of non-error response we will - * indicate success. - */ - if (dtls_cmn_pvt.resp != NSS_DTLS_CMN_ERROR_NONE) - status = NSS_TX_FAILURE; - -done: - up(&dtls_cmn_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_dtls_cmn_tx_msg_sync); - -/* - * nss_dtls_cmn_notify_register() - * Register a handler for notification from NSS firmware. - */ -struct nss_ctx_instance *nss_dtls_cmn_notify_register(uint32_t if_num, nss_dtls_cmn_msg_callback_t ev_cb, - void *app_data) -{ - struct nss_ctx_instance *nss_ctx = nss_dtls_cmn_get_context(); - uint32_t ret; - - BUG_ON(!nss_ctx); - - ret = nss_core_register_handler(nss_ctx, if_num, nss_dtls_cmn_handler, app_data); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return NULL; - } - - ret = nss_core_register_msg_handler(nss_ctx, if_num, ev_cb); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return NULL; - } - - return nss_ctx; -} -EXPORT_SYMBOL(nss_dtls_cmn_notify_register); - -/* - * nss_dtls_cmn_notify_unregister() - * Unregister notification callback handler. - */ -void nss_dtls_cmn_notify_unregister(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_dtls_cmn_get_context(); - uint32_t ret; - - BUG_ON(!nss_ctx); - - ret = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for interface(%u)", nss_ctx, if_num); - return; - } - - ret = nss_core_unregister_handler(nss_ctx, if_num); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for interface(%u)", nss_ctx, if_num); - return; - } - - return; -} -EXPORT_SYMBOL(nss_dtls_cmn_notify_unregister); - -/* - * nss_dtls_cmn_register_if() - * Register data and event callback handlers for dynamic interface. - */ -struct nss_ctx_instance *nss_dtls_cmn_register_if(uint32_t if_num, - nss_dtls_cmn_data_callback_t data_cb, - nss_dtls_cmn_msg_callback_t ev_cb, - struct net_device *netdev, - uint32_t features, - uint32_t type, - void *app_data) -{ - struct nss_ctx_instance *nss_ctx = nss_dtls_cmn_get_context(); - uint32_t ret; - - if (!nss_dtls_cmn_verify_ifnum(nss_ctx, if_num)) { - nss_warning("%px: DTLS Interface is not dynamic:%u", nss_ctx, if_num); - return NULL; - } - - if (nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Cannot find free slot for DTLS NSS I/F:%u", nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, data_cb, NULL, app_data, netdev, features); - nss_ctx->subsys_dp_register[if_num].type = type; - - ret = nss_core_register_handler(nss_ctx, if_num, nss_dtls_cmn_handler, app_data); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return NULL; - } - - ret = nss_core_register_msg_handler(nss_ctx, if_num, ev_cb); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return NULL; - } - - /* - * Atomically set the bitmap for the interface number. - */ - set_bit(if_num, dtls_cmn_pvt.if_map); - return nss_ctx; -} -EXPORT_SYMBOL(nss_dtls_cmn_register_if); - -/* - * nss_dtls_cmn_unregister_if() - * Unregister data and event callback handlers for the interface. - */ -void nss_dtls_cmn_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_dtls_cmn_get_context(); - uint32_t ret; - - if (!nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Cannot find registered netdev for DTLS NSS I/F:%u", nss_ctx, if_num); - return; - } - - /* - * Atomically clear the bitmap for the interface number. - */ - clear_bit(if_num, dtls_cmn_pvt.if_map); - - ret = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for interface(%u)", nss_ctx, if_num); - return; - } - - nss_core_unregister_handler(nss_ctx, if_num); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - nss_ctx->subsys_dp_register[if_num].type = 0; -} -EXPORT_SYMBOL(nss_dtls_cmn_unregister_if); - -/* - * nss_dtls_get_context() - * Return DTLS NSS context. - */ -struct nss_ctx_instance *nss_dtls_cmn_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.dtls_handler_id]; -} -EXPORT_SYMBOL(nss_dtls_cmn_get_context); - -/* - * nss_dtls_cmn_msg_init() - * Initialize nss_dtls_cmn msg. - */ -void nss_dtls_cmn_msg_init(struct nss_dtls_cmn_msg *ncm, uint32_t if_num, - uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_dtls_cmn_msg_init); - -/* - * nss_dtls_cmn_get_ifnum() - * Return DTLS interface number with coreid. - */ -int32_t nss_dtls_cmn_get_ifnum(int32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_dtls_cmn_get_context(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_dtls_cmn_get_ifnum); - -/* - * nss_dtls_cmn_register_handler() - * DTLS initialization. - */ -void nss_dtls_cmn_register_handler(void) -{ - sema_init(&dtls_cmn_pvt.sem, 1); - init_completion(&dtls_cmn_pvt.complete); - nss_dtls_cmn_stats_dentry_create(); - nss_dtls_cmn_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_log.c deleted file mode 100644 index 41ad37c44..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_log.c +++ /dev/null @@ -1,178 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_dtls_cmn_log.c - * NSS DTLS common logger file. - */ - -#include "nss_core.h" - -/* - * nss_dtls_cmn_log_message_types_str - * DTLS common message strings - */ -static int8_t *nss_dtls_cmn_log_message_types_str[NSS_DTLS_CMN_MSG_MAX] __maybe_unused = { - "DTLS_CMN Configure Node", - "DTLS_CMN Configure Base Context Parameter", - "DTLS_CMN Configure DTLS Parameters", - "DTLS_CMN Switch DTLS Transform", - "DTLS_CMN Deconfigure Context", - "DTLS_CMN Synchronize Stats", - "DTLS_CMN Node Statistics" -}; - -/* - * nss_dtls_cmn_log_error_response_types_str - * Strings for error types for DTLS common messages - */ -static int8_t *nss_dtls_cmn_log_error_response_types_str[NSS_DTLS_CMN_ERROR_MAX] __maybe_unused = { - "DTLS_CMN No Error", - "DTLS_CMN Unknown MEssage", - "DTLS_CMN Invalid Destination Interface", - "DTLS_CMN Invalid Source Interface", - "DTLS_CMN Invalid Crypto", - "DTLS_CMN Invalid Version", - "DTLS_CMN Invalid Context Type", - "DTLS_CMN Invalid Context Words", - "DTLS_CMN Hardware Context Alloc Fail", - "DTLS_CMN Copy Context Failure", - "DTLS_CMN Switch Hardware Context Fail", - "DTLS_CMN Already Configured", - "DTLS_CMN No Memory", - "DTLS_CMN Copy Nonce Failure" -}; - -/* - * nss_dtls_cmn_hdr_config_msg() - * Log DTLS common header configure message. - */ -static void nss_dtls_cmn_hdr_config_msg(struct nss_dtls_cmn_msg *ndm) -{ - struct nss_dtls_cmn_ctx_config_hdr *ndchm __maybe_unused = &ndm->msg.hdr_cfg; - nss_trace("%px: NSS DTLS_CMN Header Configure Message:\n" - "DTLS_CMN flags: %x\n" - "DTLS_CMN destination interface number: %d\n" - "DTLS_CMN source interface number: %d\n" - "DTLS_CMN source ip: %px\n" - "DTLS_CMN destination ip: %px\n" - "DTLS_CMN source port: %d\n" - "DTLS_CMN destination port: %d\n" - "DTLS_CMN time to live: %d\n" - "DTLS_CMN dscp value: %x\n" - "DTLS_CMN dscp copy value: %x\n" - "DTLS_CMN DF flag: %x\n", - ndchm, ndchm->flags, - ndchm->dest_ifnum, ndchm->src_ifnum, - &ndchm->sip, &ndchm->dip, - ndchm->sport, ndchm->dport, - ndchm->hop_limit_ttl, ndchm->dscp, - ndchm->dscp_copy, ndchm->df); -}; - -/* - * nss_dtls_cmn_dtls_config_msg() - * Log DTLS common dtls configure message. - */ -static void nss_dtls_cmn_dtls_config_msg(struct nss_dtls_cmn_msg *ndm) -{ - struct nss_dtls_cmn_ctx_config_dtls *ndcdm __maybe_unused = &ndm->msg.dtls_cfg; - nss_trace("%px: NSS DTLS_CMN DTLS Configure Message:\n" - "DTLS_CMN version: %d\n" - "DTLS_CMN crypto Index: %d\n" - "DTLS_CMN window size: %d\n" - "DTLS_CMN initial epoch: %d\n" - "DTLS_CMN IV length for encapsulation: %d\n" - "DTLS_CMN authentication hash length for encapsulation: %d\n" - "DTLS_CMN cipher block length: %d\n" - "DTLS_CMN reserved: %x\n", - ndcdm, ndcdm->ver, - ndcdm->crypto_idx, ndcdm->window_size, - ndcdm->epoch, ndcdm->iv_len, - ndcdm->hash_len, ndcdm->blk_len, - ndcdm->res1); -}; - -/* - * nss_dtls_cmn_log_verbose() - * Log message contents. - */ -static void nss_dtls_cmn_log_verbose(struct nss_dtls_cmn_msg *ndm) -{ - switch (ndm->cm.type) { - case NSS_DTLS_CMN_MSG_TYPE_CONFIGURE_HDR: - nss_dtls_cmn_hdr_config_msg(ndm); - break; - - case NSS_DTLS_CMN_MSG_TYPE_CONFIGURE_DTLS: - nss_dtls_cmn_dtls_config_msg(ndm); - break; - - default: - nss_warning("%px: Invalid message type\n", ndm); - break; - } -} - -/* - * nss_dtls_cmn_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_dtls_cmn_log_tx_msg(struct nss_dtls_cmn_msg *ndm) -{ - if (ndm->cm.type >= NSS_DTLS_CMN_MSG_MAX) { - nss_warning("%px: Invalid message type\n", ndm); - return; - } - - nss_info("%px: type[%d]:%s\n", ndm, ndm->cm.type, nss_dtls_cmn_log_message_types_str[ndm->cm.type]); - nss_dtls_cmn_log_verbose(ndm); -} - -/* - * nss_dtls_cmn_log_rx_msg() - * Log messages received from FW. - */ -void nss_dtls_cmn_log_rx_msg(struct nss_dtls_cmn_msg *ndm) -{ - if (ndm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ndm); - return; - } - - if (ndm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ndm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ndm, ndm->cm.type, - nss_dtls_cmn_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response]); - goto verbose; - } - - if (ndm->cm.error >= NSS_DTLS_CMN_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ndm, ndm->cm.type, nss_dtls_cmn_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response], - ndm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ndm, ndm->cm.type, nss_dtls_cmn_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response], - ndm->cm.error, nss_dtls_cmn_log_error_response_types_str[ndm->cm.error]); - -verbose: - nss_dtls_cmn_log_verbose(ndm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_log.h deleted file mode 100644 index 3a5f75566..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_DTLS_CMN_LOG_H -#define __NSS_DTLS_CMN_LOG_H - -/* - * nss_dtls_cmn_log.h - * NSS DTLS Commn Log Header File. - */ - -/* - * nss_dtls_cmn_log_tx_msg - * Logs a DTLS common message that is sent to the NSS firmware. - */ -void nss_dtls_cmn_log_tx_msg(struct nss_dtls_cmn_msg *ndm); - -/* - * nss_dtls_cmn_log_rx_msg - * Logs a DTLS common message that is received from the NSS firmware. - */ -void nss_dtls_cmn_log_rx_msg(struct nss_dtls_cmn_msg *ndm); - -#endif /* __NSS_DTLS_CMN_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.c deleted file mode 100644 index 2908b28e3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_core.h" -#include "nss_dtls_cmn.h" -#include "nss_dtls_cmn_stats.h" -#include "nss_dtls_cmn_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_dtls_cmn_stats_notifier); - -/* - * Spinlock to protect dtls common statistics update/read - */ -DEFINE_SPINLOCK(nss_dtls_cmn_stats_lock); - -unsigned long *nss_dtls_cmn_ifmap_get(void); - -/* - * nss_dtls_cmn_ctx_stats - * dtls common ctx statistics - */ -uint64_t nss_dtls_cmn_ctx_stats[NSS_MAX_NET_INTERFACES][NSS_DTLS_CMN_CTX_STATS_MAX]; - -/* - * nss_dtls_cmn_stats_iface_type() - * Return a string for each interface type. - */ -static const char *nss_dtls_cmn_stats_iface_type(enum nss_dynamic_interface_type type) -{ - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER: - return "dtls_cmn_inner"; - - case NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER: - return "dtls_cmn_outer"; - - default: - return "invalid_interface"; - - } -} - -/* - * nss_dtls_cmn_stats_read() - * Read dtls common node statistics. - */ -static ssize_t nss_dtls_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_DTLS_CMN_CTX_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - struct nss_ctx_instance *nss_ctx = nss_dtls_cmn_get_context(); - enum nss_dynamic_interface_type type; - unsigned long *ifmap; - uint64_t *stats_shadow; - ssize_t bytes_read = 0; - size_t size_wr = 0; - uint32_t if_num; - int32_t i; - int count; - char *lbuf; - - ifmap = nss_dtls_cmn_ifmap_get(); - count = bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); - if (count) { - size_al = size_al * count; - } - - lbuf = vzalloc(size_al); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = vzalloc(NSS_DTLS_CMN_CTX_STATS_MAX * 8); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - vfree(lbuf); - return -ENOMEM; - } - - /* - * Common node stats for each DTLS dynamic interface. - */ - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "dtls_cmn stats", NSS_STATS_SINGLE_CORE); - for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) { - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - if ((type != NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER) && - (type != NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER)) { - continue; - } - - spin_lock_bh(&nss_dtls_cmn_stats_lock); - for (i = 0; i < NSS_DTLS_CMN_CTX_STATS_MAX; i++) { - stats_shadow[i] = nss_dtls_cmn_ctx_stats[if_num][i]; - } - spin_unlock_bh(&nss_dtls_cmn_stats_lock); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", - nss_dtls_cmn_stats_iface_type(type), if_num); - size_wr += nss_stats_print("dtls_cmn", NULL, NSS_STATS_SINGLE_INSTANCE, nss_dtls_cmn_ctx_stats_str, - stats_shadow, NSS_DTLS_CMN_CTX_STATS_MAX, lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - vfree(lbuf); - vfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_dtls_cmn_stats_ops. - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(dtls_cmn); - -/* - * nss_dtls_cmn_stats_dentry_create() - * Create dtls common statistics debug entry. - */ -void nss_dtls_cmn_stats_dentry_create(void) -{ - nss_stats_create_dentry("dtls_cmn", &nss_dtls_cmn_stats_ops); -} - -/* - * nss_dtls_cmn_stats_sync() - * Update dtls common node statistics. - */ -void nss_dtls_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - struct nss_dtls_cmn_msg *ndcm = (struct nss_dtls_cmn_msg *)ncm; - struct nss_dtls_cmn_ctx_stats *ndccs = &ndcm->msg.stats; - uint64_t *ctx_stats; - uint32_t *msg_stats; - uint16_t i = 0; - - spin_lock_bh(&nss_dtls_cmn_stats_lock); - - msg_stats = (uint32_t *)ndccs; - ctx_stats = nss_dtls_cmn_ctx_stats[ncm->interface]; - - for (i = 0; i < NSS_DTLS_CMN_CTX_STATS_MAX; i++, ctx_stats++, msg_stats++) { - *ctx_stats += *msg_stats; - } - - spin_unlock_bh(&nss_dtls_cmn_stats_lock); -} - -/* - * nss_dtls_cmn_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_dtls_cmn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_dtls_cmn_stats_notification *dtls_cmn_stats; - - dtls_cmn_stats = kmalloc(sizeof(struct nss_dtls_cmn_stats_notification), GFP_ATOMIC); - if (!dtls_cmn_stats) { - nss_warning("Unable to allocate memory for stats notification\n"); - return; - } - - spin_lock_bh(&nss_dtls_cmn_stats_lock); - dtls_cmn_stats->core_id = nss_ctx->id; - dtls_cmn_stats->if_num = if_num; - memcpy(dtls_cmn_stats->stats_ctx, nss_dtls_cmn_ctx_stats[if_num], sizeof(dtls_cmn_stats->stats_ctx)); - spin_unlock_bh(&nss_dtls_cmn_stats_lock); - - atomic_notifier_call_chain(&nss_dtls_cmn_stats_notifier, NSS_STATS_EVENT_NOTIFY, dtls_cmn_stats); - kfree(dtls_cmn_stats); -} - -/* - * nss_dtls_cmn_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_dtls_cmn_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_dtls_cmn_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_dtls_cmn_stats_unregister_notifier); - -/* - * nss_dtls_cmn_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_dtls_cmn_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_dtls_cmn_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_dtls_cmn_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.h deleted file mode 100644 index 80e6edfa4..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_stats.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#ifndef __NSS_DTLS_CMN_STATS_H -#define __NSS_DTLS_CMN_STATS_H - -#include - -extern void nss_dtls_cmn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_dtls_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); -extern void nss_dtls_cmn_stats_dentry_create(void); - -#endif /* __NSS_DTLS_CMN_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.c deleted file mode 100644 index 8fc91976a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_dtls_cmn_strings.h" - -/* - * nss_dtls_cmn_ctx_stats_str - * dtls common ctx statistics strings. - */ -struct nss_stats_info nss_dtls_cmn_ctx_stats_str[NSS_DTLS_CMN_CTX_STATS_MAX] = { - {"rx_pkts", NSS_STATS_TYPE_COMMON}, - {"rx_byts", NSS_STATS_TYPE_COMMON}, - {"tx_pkts", NSS_STATS_TYPE_COMMON}, - {"tx_byts", NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, - {"rx_single_rec", NSS_STATS_TYPE_SPECIAL}, - {"rx_multi_rec", NSS_STATS_TYPE_SPECIAL}, - {"fail_crypto_resource", NSS_STATS_TYPE_DROP}, - {"fail_crypto_enqueue", NSS_STATS_TYPE_DROP}, - {"fail_headroom", NSS_STATS_TYPE_DROP}, - {"fail_tailroom", NSS_STATS_TYPE_DROP}, - {"fail_ver", NSS_STATS_TYPE_DROP}, - {"fail_epoch", NSS_STATS_TYPE_DROP}, - {"fail_dtls_record", NSS_STATS_TYPE_DROP}, - {"fail_capwap", NSS_STATS_TYPE_DROP}, - {"fail_replay", NSS_STATS_TYPE_DROP}, - {"fail_replay_dup", NSS_STATS_TYPE_DROP}, - {"fail_replay_win", NSS_STATS_TYPE_DROP}, - {"fail_queue", NSS_STATS_TYPE_DROP}, - {"fail_queue_nexthop", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_alloc", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_linear", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_stats", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_align", NSS_STATS_TYPE_DROP}, - {"fail_ctx_active", NSS_STATS_TYPE_DROP}, - {"fail_hwctx_active", NSS_STATS_TYPE_DROP}, - {"fail_cipher", NSS_STATS_TYPE_EXCEPTION}, - {"fail_auth", NSS_STATS_TYPE_EXCEPTION}, - {"fail_seq_ovf", NSS_STATS_TYPE_DROP}, - {"fail_blk_len", NSS_STATS_TYPE_DROP}, - {"fail_hash_len", NSS_STATS_TYPE_DROP}, - {"len_error", NSS_STATS_TYPE_DROP}, - {"token_error", NSS_STATS_TYPE_DROP}, - {"bypass_error", NSS_STATS_TYPE_DROP}, - {"config_error", NSS_STATS_TYPE_DROP}, - {"algo_error", NSS_STATS_TYPE_DROP}, - {"hash_ovf_error", NSS_STATS_TYPE_DROP}, - {"ttl_error", NSS_STATS_TYPE_DROP}, - {"csum_error", NSS_STATS_TYPE_DROP}, - {"timeout_error", NSS_STATS_TYPE_DROP}, - {"fail_cle_[0]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[1]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[2]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[3]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[4]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[5]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[6]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[7]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[8]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[9]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[10]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[11]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[12]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[13]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[14]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[15]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[16]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[17]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[18]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[19]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[20]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[21]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[22]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[23]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[24]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[25]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[26]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[27]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[28]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[29]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[30]", NSS_STATS_TYPE_DROP}, - {"fail_cle_[31]", NSS_STATS_TYPE_DROP}, - {"seq_low", NSS_STATS_TYPE_SPECIAL}, - {"seq_high", NSS_STATS_TYPE_SPECIAL}, - {"epoch", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_dtls_cmn_ctx_stats_str_strings_read() - * Read dtls common ctx statistics names - */ -static ssize_t nss_dtls_cmn_ctx_stats_str_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_dtls_cmn_ctx_stats_str, NSS_DTLS_CMN_CTX_STATS_MAX); -} - -/* - * nss_dtls_cmn_ctx_stats_str_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(dtls_cmn_ctx_stats_str); - -/* - * nss_dtls_cmn_strings_dentry_create() - * Create dtls common statistics strings debug entry. - */ -void nss_dtls_cmn_strings_dentry_create(void) -{ - nss_strings_create_dentry("dtls_cmn_ctx_stats_str", &nss_dtls_cmn_ctx_stats_str_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.h deleted file mode 100644 index 0c0bc448d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_cmn_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#ifndef __NSS_DTLS_CMN_STRINGS_H -#define __NSS_DTLS_CMN_STRINGS_H - -#include "nss_dtls_cmn_stats.h" - -extern struct nss_stats_info nss_dtls_cmn_ctx_stats_str[NSS_DTLS_CMN_CTX_STATS_MAX]; -extern void nss_dtls_cmn_strings_dentry_create(void); - -#endif /* __NSS_DTLS_CMN_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_log.c deleted file mode 100644 index 5e1e33e7a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_log.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_dtls_log.c - * NSS DTLS logger file. - */ - -#include "nss_core.h" - -/* - * nss_dtls_log_message_types_str - * DTLS message strings - */ -static int8_t *nss_dtls_log_message_types_str[NSS_DTLS_MSG_MAX] __maybe_unused = { - "DTLS Session Configure", - "DTLS Session Destroy", - "DTLS Session Stats", - "DTLS Encap Cipher Update", - "DTLS Encap Cipher Switch", - "DTLS Decap Cipher Update", - "DTLS Decap Cipher Switch" -}; - -/* - * nss_dtls_log_error_response_types_str - * Strings for error types for DTLS messages - */ -static int8_t *nss_dtls_log_error_response_types_str[NSS_DTLS_ERR_MAX] __maybe_unused = { - "DTLS Unknown Message", - "DTLS Invalid APP Interface", - "DTLS Invalid Parameter", - "DTLS Invalid Version", - "DTLS No Memory" -}; - -/* - * nss_dtls_session_config_msg() - * Log DTLS session configure message. - */ -static void nss_dtls_session_config_msg(struct nss_dtls_msg *ndm) -{ - struct nss_dtls_session_configure *ndscm __maybe_unused = &ndm->msg.cfg; - nss_trace("%px: NSS DTLS Session Configure Message:\n" - "DTLS Version: %d\n" - "DTLS Flags: %x\n" - "DTLS crypto index encap: %d\n" - "DTLS crypto index decap: %d\n" - "DTLS IV length for encapsulation: %d\n" - "DTLS IV length for decapsulation: %d\n" - "DTLS authentication hash length for encapsulation: %d\n" - "DTLS authentication hash length for decapsulation: %d\n" - "DTLS cipher algorithm for encapsulation: %x\n" - "DTLS authentication algorithm for encapsulation: %x\n" - "DTLS cipher algorithm for decapsulation: %x\n" - "DTLS authentication algorithm for decapsulation: %x\n" - "DTLS NSS interface: %x\n" - "DTLS source port: %d\n" - "DTLS destination port: %d\n" - "DTLS source ip: %px\n" - "DTLS destination ip: %px\n" - "DTLS window size: %d\n" - "DTLS epoch: %d\n" - "DTLS outer IP TTL: %d\n" - "DTLS reserved1 padding: %x\n" - "DTLS reserved2 padding: %x\n", - ndscm, ndscm->ver, - ndscm->flags, ndscm->crypto_idx_encap, - ndscm->crypto_idx_decap, ndscm->iv_len_encap, - ndscm->iv_len_decap, ndscm->hash_len_encap, - ndscm->hash_len_decap, ndscm->cipher_algo_encap, - ndscm->auth_algo_encap, ndscm->cipher_algo_decap, - ndscm->auth_algo_decap, ndscm->nss_app_if, - ndscm->sport, ndscm->dport, - &ndscm->sip, &ndscm->dip, - ndscm->window_size, ndscm->epoch, - ndscm->oip_ttl, ndscm->reserved1, - ndscm->reserved2); -} - -/* - * nss_dtls_session_cipher_upddate_msg() - * Log DTLS Session Cipher Update message. - */ -static void nss_dtls_session_cipher_update_msg(struct nss_dtls_msg *ndm) -{ - struct nss_dtls_session_cipher_update *ndscum __maybe_unused = &ndm->msg.cipher_update; - nss_trace("%px: NSS DTLS Session Cipher Update message\n" - "DTLS crypto index: %d\n" - "DTLS hash length: %d\n" - "DTLS crypto IV length for encapsulation: %d\n" - "DTLS encapsulation cipher: %x\n" - "DTLS encapsulation authentication algorigthm: %x\n" - "DTLS epoch: %d\n" - "DTLS reserved: %x\n", - ndscum, ndscum->crypto_idx, - ndscum->hash_len, ndscum->iv_len, - ndscum->cipher_algo, ndscum->auth_algo, - ndscum->epoch, ndscum->reserved); -} - -/* - * nss_dtls_log_verbose() - * Log message contents. - */ -static void nss_dtls_log_verbose(struct nss_dtls_msg *ndm) -{ - switch (ndm->cm.type) { - case NSS_DTLS_MSG_REKEY_DECAP_CIPHER_UPDATE: - case NSS_DTLS_MSG_REKEY_ENCAP_CIPHER_UPDATE: - nss_dtls_session_cipher_update_msg(ndm); - break; - - case NSS_DTLS_MSG_SESSION_CONFIGURE: - nss_dtls_session_config_msg(ndm); - break; - - default: - nss_warning("%px: Invalid message type\n", ndm); - break; - } -} - -/* - * nss_dtls_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_dtls_log_tx_msg(struct nss_dtls_msg *ndm) -{ - if (ndm->cm.type >= NSS_DTLS_MSG_MAX) { - nss_warning("%px: Invalid message type\n", ndm); - return; - } - - nss_info("%px: type[%d]:%s\n", ndm, ndm->cm.type, nss_dtls_log_message_types_str[ndm->cm.type]); - nss_dtls_log_verbose(ndm); -} - -/* - * nss_dtls_log_rx_msg() - * Log messages received from FW. - */ -void nss_dtls_log_rx_msg(struct nss_dtls_msg *ndm) -{ - if (ndm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ndm); - return; - } - - if (ndm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ndm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ndm, ndm->cm.type, - nss_dtls_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response]); - goto verbose; - } - - if (ndm->cm.error >= NSS_DTLS_ERR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ndm, ndm->cm.type, nss_dtls_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response], - ndm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ndm, ndm->cm.type, nss_dtls_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response], - ndm->cm.error, nss_dtls_log_error_response_types_str[ndm->cm.error]); - -verbose: - nss_dtls_log_verbose(ndm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_log.h deleted file mode 100644 index 99fca71a8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_DTLS_LOG_H -#define __NSS_DTLS_LOG_H - -/* - * nss_dtls_log.h - * NSS DTLS Log Header File - */ - -/* - * nss_dtls_log_tx_msg - * Logs a DTLS message that is sent to the NSS firmware. - */ -void nss_dtls_log_tx_msg(struct nss_dtls_msg *ndm); - -/* - * nss_dtls_log_rx_msg - * Logs a DTLS message that is received from the NSS firmware. - */ -void nss_dtls_log_rx_msg(struct nss_dtls_msg *ndm); - -#endif /* __NSS_DTLS_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_stats.c deleted file mode 100644 index 0aeff87b0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_stats.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_dtls_stats.h" - -/* - * nss_dtls_stats_session_str - * DTLS statistics strings for nss session stats. - */ -struct nss_stats_info nss_dtls_stats_session_str[NSS_DTLS_STATS_SESSION_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_drops[0]" , NSS_STATS_TYPE_DROP}, - {"rx_drops[1]" , NSS_STATS_TYPE_DROP}, - {"rx_drops[2]" , NSS_STATS_TYPE_DROP}, - {"rx_drops[3]" , NSS_STATS_TYPE_DROP}, - {"rx_auth_done" , NSS_STATS_TYPE_SPECIAL}, - {"tx_auth_done" , NSS_STATS_TYPE_SPECIAL}, - {"rx_cipher_done" , NSS_STATS_TYPE_SPECIAL}, - {"tx_cipher_done" , NSS_STATS_TYPE_SPECIAL}, - {"rx_cbuf_alloc_fail" , NSS_STATS_TYPE_DROP}, - {"tx_cbuf_alloc_fail" , NSS_STATS_TYPE_DROP}, - {"tx_cenqueue_fail" , NSS_STATS_TYPE_DROP}, - {"rx_cenqueue_fail" , NSS_STATS_TYPE_DROP}, - {"tx_drops_hroom" , NSS_STATS_TYPE_DROP}, - {"tx_drops_troom" , NSS_STATS_TYPE_DROP}, - {"tx_forward_enqueue_fail" , NSS_STATS_TYPE_DROP}, - {"rx_forward_enqueue_fail" , NSS_STATS_TYPE_DROP}, - {"rx_invalid_version" , NSS_STATS_TYPE_DROP}, - {"rx_invalid_epoch" , NSS_STATS_TYPE_DROP}, - {"rx_malformed" , NSS_STATS_TYPE_DROP}, - {"rx_cipher_fail" , NSS_STATS_TYPE_EXCEPTION}, - {"rx_auth_fail" , NSS_STATS_TYPE_EXCEPTION}, - {"rx_capwap_classify_fail" , NSS_STATS_TYPE_DROP}, - {"rx_single_rec_dgram" , NSS_STATS_TYPE_SPECIAL}, - {"rx_multi_rec_dgram" , NSS_STATS_TYPE_SPECIAL}, - {"rx_replay_fail" , NSS_STATS_TYPE_DROP}, - {"rx_replay_duplicate" , NSS_STATS_TYPE_SPECIAL}, - {"rx_replay_out_of_window" , NSS_STATS_TYPE_SPECIAL}, - {"outflow_queue_full" , NSS_STATS_TYPE_DROP}, - {"decap_queue_full" , NSS_STATS_TYPE_DROP}, - {"pbuf_alloc_fail" , NSS_STATS_TYPE_DROP}, - {"pbuf_copy_fail" , NSS_STATS_TYPE_DROP}, - {"epoch" , NSS_STATS_TYPE_DROP}, - {"tx_seq_high" , NSS_STATS_TYPE_SPECIAL}, - {"tx_seq_low" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_dtls_stats_read() - * Read DTLS session statistics. - */ -static ssize_t nss_dtls_stats_read(struct file *fp, char __user *ubuf, - size_t sz, loff_t *ppos) -{ - uint32_t max_output_lines = 2 + (NSS_MAX_DTLS_SESSIONS - * (NSS_DTLS_STATS_SESSION_MAX + 2)) + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - int id; - struct nss_dtls_stats_session *dtls_session_stats = NULL; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - dtls_session_stats = kzalloc((sizeof(struct nss_dtls_stats_session) - * NSS_MAX_DTLS_SESSIONS), GFP_KERNEL); - if (unlikely(dtls_session_stats == NULL)) { - nss_warning("Could not allocate memory for populating DTLS stats"); - kfree(lbuf); - return 0; - } - - /* - * Get all stats. - */ - nss_dtls_session_stats_get(dtls_session_stats); - - /* - * Session stats. - */ - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "dtls", NSS_STATS_SINGLE_CORE); - - for (id = 0; id < NSS_MAX_DTLS_SESSIONS; id++) { - if (!dtls_session_stats[id].valid) - break; - - dev = dev_get_by_index(&init_net, dtls_session_stats[id].if_index); - if (likely(dev)) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "%d. nss interface id=%d, netdevice=%s\n", - id, dtls_session_stats[id].if_num, - dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "%d. nss interface id=%d\n", id, - dtls_session_stats[id].if_num); - } - - size_wr += nss_stats_print("dtls_cmn", NULL, id, nss_dtls_stats_session_str, dtls_session_stats[id].stats, NSS_DTLS_STATS_SESSION_MAX, lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(dtls_session_stats); - kfree(lbuf); - return bytes_read; -} - -/* - * nss_dtls_stats_ops. - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(dtls) - -/* - * nss_dtls_stats_dentry_create() - * Create DTLS statistics debug entry. - */ -void nss_dtls_stats_dentry_create(void) -{ - nss_stats_create_dentry("dtls", &nss_dtls_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_dtls_stats.h deleted file mode 100644 index bf6a148b7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dtls_stats.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_DTLS_STATS_H -#define __NSS_DTLS_STATS_H - -/* - * DTLS session debug statistic counters - */ -enum nss_dtls_stats_session_types { - NSS_DTLS_STATS_SESSION_RX_PKTS, - /* Rx packets */ - NSS_DTLS_STATS_SESSION_TX_PKTS, - /* Tx packets */ - NSS_DTLS_STATS_SESSION_RX_QUEUE_0_DROPPED, - NSS_DTLS_STATS_SESSION_RX_QUEUE_1_DROPPED, - NSS_DTLS_STATS_SESSION_RX_QUEUE_2_DROPPED, - NSS_DTLS_STATS_SESSION_RX_QUEUE_3_DROPPED, - NSS_DTLS_STATS_SESSION_RX_AUTH_DONE, - /* Rx successful authentication */ - NSS_DTLS_STATS_SESSION_TX_AUTH_DONE, - /* Tx authentication done */ - NSS_DTLS_STATS_SESSION_RX_CIPHER_DONE, - /* Rx cipher done */ - NSS_DTLS_STATS_SESSION_TX_CIPHER_DONE, - /* Tx cipher done */ - NSS_DTLS_STATS_SESSION_RX_CBUF_ALLOC_FAIL, - /* Rx crypto buffer alloc fail */ - NSS_DTLS_STATS_SESSION_TX_CBUF_ALLOC_FAIL, - /* Tx crypto buffer alloc fail */ - NSS_DTLS_STATS_SESSION_TX_CENQUEUE_FAIL, - /* Tx enqueue to crypto fail */ - NSS_DTLS_STATS_SESSION_RX_CENQUEUE_FAIL, - /* Rx enqueue to crypto fail */ - NSS_DTLS_STATS_SESSION_TX_DROPPED_HROOM, - /* Tx drop due to insufficient headroom */ - NSS_DTLS_STATS_SESSION_TX_DROPPED_TROOM, - /* Tx drop due to insufficient tailroom */ - NSS_DTLS_STATS_SESSION_TX_FORWARD_ENQUEUE_FAIL, - /* Enqueue failed to Tx node after encap */ - NSS_DTLS_STATS_SESSION_RX_FORWARD_ENQUEUE_FAIL, - /* Enqueue failed to Rx node after decap */ - NSS_DTLS_STATS_SESSION_RX_INVALID_VERSION, - /* Rx invalid DTLS version */ - NSS_DTLS_STATS_SESSION_RX_INVALID_EPOCH, - /* Rx invalid DTLS epoch */ - NSS_DTLS_STATS_SESSION_RX_MALFORMED, - /* Rx malformed DTLS record */ - NSS_DTLS_STATS_SESSION_RX_CIPHER_FAIL, - /* Rx cipher fail */ - NSS_DTLS_STATS_SESSION_RX_AUTH_FAIL, - /* Rx authentication fail */ - NSS_DTLS_STATS_SESSION_RX_CAPWAP_CLASSIFY_FAIL, - /* Rx CAPWAP classification fail */ - NSS_DTLS_STATS_SESSION_RX_SINGLE_REC_DGRAM, - /* Rx single record datagrams processed */ - NSS_DTLS_STATS_SESSION_RX_MULTI_REC_DGRAM, - /* Rx multi record datagrams processed */ - NSS_DTLS_STATS_SESSION_RX_REPLAY_FAIL, - /* Rx anti-replay failures */ - NSS_DTLS_STATS_SESSION_RX_REPLAY_DUPLICATE, - /* Rx anti-replay fail due to duplicate record */ - NSS_DTLS_STATS_SESSION_RX_REPLAY_OUT_OF_WINDOW, - /* Rx anti-replay fail due to out of window record */ - NSS_DTLS_STATS_SESSION_OUTFLOW_QUEUE_FULL, - /* Tx drop due to encap queue full */ - NSS_DTLS_STATS_SESSION_DECAP_QUEUE_FULL, - /* Rx drop due to decap queue full */ - NSS_DTLS_STATS_SESSION_PBUF_ALLOC_FAIL, - /* Drops due to buffer allocation failure */ - NSS_DTLS_STATS_SESSION_PBUF_COPY_FAIL, - /* Drops due to buffer copy failure */ - NSS_DTLS_STATS_SESSION_EPOCH, - /* Current Epoch */ - NSS_DTLS_STATS_SESSION_TX_SEQ_HIGH, - /* Upper 16-bits of current sequence number */ - NSS_DTLS_STATS_SESSION_TX_SEQ_LOW, - /* Lower 32-bits of current sequence number */ - NSS_DTLS_STATS_SESSION_MAX, -}; - -/* - * DTLS session statistics - */ -struct nss_dtls_stats_session { - uint64_t stats[NSS_DTLS_STATS_SESSION_MAX]; - int32_t if_index; - uint32_t if_num; /* nss interface number */ - bool valid; -}; - -/* - * Stats APIs provided by nss_dtls.c - */ -extern void nss_dtls_session_stats_get(struct nss_dtls_stats_session *s); - -/* - * DTLS statistics APIs - */ -extern void nss_dtls_stats_dentry_create(void); - -#endif /* __NSS_DTLS_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface.c b/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface.c deleted file mode 100644 index a7286bfd0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface.c +++ /dev/null @@ -1,420 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_dynamic_interface_log.h" -#include "nss_dynamic_interface_stats.h" - -#define NSS_DYNAMIC_INTERFACE_COMP_TIMEOUT 60000 /* 60 Sec */ - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_dynamic_interface_stats_notifier); - -void nss_dynamic_interface_stats_notify(uint32_t if_num, uint32_t core_id); - -/* - * Message data structure to store the message result - */ -struct nss_dynamic_interface_msg_data { - struct completion complete; /* completion structure */ - int if_num; /* Interface number */ - enum nss_cmn_response response; /* Message response */ -}; - -static nss_dynamic_interface_assigned nss_dynamic_interface_assigned_types[NSS_CORE_MAX][NSS_MAX_DYNAMIC_INTERFACES]; /* Array of assigned interface types */ - -/* - * nss_dynamic_interface_handler() - * Handle NSS -> HLOS messages for dynamic interfaces - */ -static void nss_dynamic_interface_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - nss_dynamic_interface_msg_callback_t cb; - struct nss_dynamic_interface_msg *ndim = (struct nss_dynamic_interface_msg *)ncm; - int32_t if_num; - - BUG_ON(ncm->interface != NSS_DYNAMIC_INTERFACE); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_DYNAMIC_INTERFACE_MAX) { - nss_warning("%px: received invalid message %d for dynamic interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_dynamic_interface_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_dynamic_interface_log_rx_msg(ndim); - - /* - * Handling dynamic interface messages coming from NSS fw. - */ - switch (ndim->cm.type) { - case NSS_DYNAMIC_INTERFACE_ALLOC_NODE: - if (ncm->response == NSS_CMN_RESPONSE_ACK) { - nss_info("%px alloc_node response ack if_num %d\n", nss_ctx, ndim->msg.alloc_node.if_num); - if_num = ndim->msg.alloc_node.if_num; - if (if_num > 0) { - nss_dynamic_interface_assigned_types[nss_ctx->id][if_num - NSS_DYNAMIC_IF_START] = ndim->msg.alloc_node.type; - } else { - nss_warning("%px: if_num < 0\n", nss_ctx); - } - } - - break; - - case NSS_DYNAMIC_INTERFACE_DEALLOC_NODE: - if (ncm->response == NSS_CMN_RESPONSE_ACK) { - nss_info("%px dealloc_node response ack if_num %d\n", nss_ctx, ndim->msg.dealloc_node.if_num); - if_num = ndim->msg.dealloc_node.if_num; - nss_dynamic_interface_assigned_types[nss_ctx->id][if_num - NSS_DYNAMIC_IF_START] = NSS_DYNAMIC_INTERFACE_TYPE_NONE; - /* - * Send dynamic interface dealloc notifications to the registered modules. - */ - nss_dynamic_interface_stats_notify(ndim->msg.dealloc_node.if_num, nss_ctx->id); - } - - break; - - default: - nss_warning("%px: Received response %d for type %d, interface %d", - nss_ctx, ncm->response, ncm->type, ncm->interface); - return; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - nss_warning("%px: nss_dynamic_interface_handler cb is NULL\n", nss_ctx); - return; - } - - /* - * Callback - */ - cb = (nss_dynamic_interface_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_dynamic_interface_callback - * Callback to handle the message response from NSS FW. - */ -static void nss_dynamic_interface_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - struct nss_dynamic_interface_msg_data *di_data = (struct nss_dynamic_interface_msg_data *)app_data; - struct nss_dynamic_interface_msg *ndim = (struct nss_dynamic_interface_msg *)ncm; - - di_data->response = ncm->response; - di_data->if_num = ndim->msg.alloc_node.if_num; - - /* - * Unblock the sleeping function. - */ - complete(&di_data->complete); -} - -/* - * nss_dynamic_interface_tx() - * Transmit a dynamic interface message to NSSFW, asynchronously. - */ -nss_tx_status_t nss_dynamic_interface_tx(struct nss_ctx_instance *nss_ctx, struct nss_dynamic_interface_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_DYNAMIC_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_DYNAMIC_INTERFACE_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_dynamic_interface_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_dynamic_interface_tx_sync() - * Send the message to NSS and wait till we get an ACK or NACK for this msg. - */ -static nss_tx_status_t nss_dynamic_interface_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_dynamic_interface_msg_data *di_data, - struct nss_dynamic_interface_msg *ndim) -{ - nss_tx_status_t status; - int ret; - - status = nss_dynamic_interface_tx(nss_ctx, ndim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: not able to transmit msg successfully\n", nss_ctx); - return status; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&di_data->complete, msecs_to_jiffies(NSS_DYNAMIC_INTERFACE_COMP_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: Waiting for ack timed out\n", nss_ctx); - return NSS_TX_FAILURE; - } - - return status; -} - -/* - * nss_dynamic_interface_alloc_node() - * Allocates node of perticular type on NSS and returns interface_num for this node or -1 in case of failure. - * - * Note: This function should not be called from soft_irq or interrupt context because it blocks till ACK/NACK is - * received for the message sent to NSS. - */ -int nss_dynamic_interface_alloc_node(enum nss_dynamic_interface_type type) -{ - struct nss_ctx_instance *nss_ctx = NULL; - struct nss_dynamic_interface_msg ndim; - struct nss_dynamic_interface_alloc_node_msg *ndia; - struct nss_dynamic_interface_msg_data di_data; - uint32_t core_id; - nss_tx_status_t status; - - if (type >= NSS_DYNAMIC_INTERFACE_TYPE_MAX) { - nss_warning("Dynamic if msg drooped as type is wrong %d\n", type); - return -1; - } - - core_id = nss_top_main.dynamic_interface_table[type]; - nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[core_id]; - di_data.if_num = -1; - di_data.response = false; - init_completion(&di_data.complete); - - nss_dynamic_interface_msg_init(&ndim, NSS_DYNAMIC_INTERFACE, NSS_DYNAMIC_INTERFACE_ALLOC_NODE, - sizeof(struct nss_dynamic_interface_alloc_node_msg), nss_dynamic_interface_callback, (void *)&di_data); - - ndia = &ndim.msg.alloc_node; - ndia->type = type; - - /* - * Initialize if_num to -1. The allocated if_num is returned by the firmware - * in the response message. - */ - ndia->if_num = -1; - - /* - * Calling synchronous transmit function. - */ - status = nss_dynamic_interface_tx_sync(nss_ctx, &di_data, &ndim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px not able to transmit alloc node msg\n", nss_ctx); - return -1; - } - - /* - * Check response and return -1 if its a NACK else proceed. - */ - if (di_data.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px Received NACK from NSS - Response:%d\n", nss_ctx, di_data.response); - return -1; - } - - return di_data.if_num; -} - -/* - * nss_dynamic_interface_dealloc_node() - * Deallocate node of particular type and if_num in NSS. - * - * Note: This will just mark the state of node as not active, actual memory will be freed when reference count of that node becomes 0. - * This function should not be called from soft_irq or interrupt context because it blocks till ACK/NACK is received for the message - * sent to NSS. - */ -nss_tx_status_t nss_dynamic_interface_dealloc_node(int if_num, enum nss_dynamic_interface_type type) -{ - struct nss_ctx_instance *nss_ctx = NULL; - struct nss_dynamic_interface_msg ndim; - struct nss_dynamic_interface_dealloc_node_msg *ndid; - struct nss_dynamic_interface_msg_data di_data; - uint32_t core_id; - nss_tx_status_t status; - - if (type >= NSS_DYNAMIC_INTERFACE_TYPE_MAX) { - nss_warning("Dynamic if msg dropped as type is wrong type %d if_num %d\n", type, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - core_id = nss_top_main.dynamic_interface_table[type]; - nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[core_id]; - di_data.response = false; - init_completion(&di_data.complete); - - if (nss_is_dynamic_interface(if_num) == false) { - nss_warning("%px: nss_dynamic_interface if_num is not in range %d\n", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nss_dynamic_interface_msg_init(&ndim, NSS_DYNAMIC_INTERFACE, NSS_DYNAMIC_INTERFACE_DEALLOC_NODE, - sizeof(struct nss_dynamic_interface_dealloc_node_msg), nss_dynamic_interface_callback, (void *)&di_data); - - ndid = &ndim.msg.dealloc_node; - ndid->type = type; - ndid->if_num = if_num; - - /* - * Calling synchronous transmit function. - */ - status = nss_dynamic_interface_tx_sync(nss_ctx, &di_data, &ndim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px not able to transmit alloc node msg\n", nss_ctx); - return status; - } - - if (di_data.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px Received NACK from NSS\n", nss_ctx); - return -1; - } - - return status; -} - -/* - * nss_dynamic_interface_register_handler() - */ -void nss_dynamic_interface_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_core_register_handler(nss_ctx, NSS_DYNAMIC_INTERFACE, nss_dynamic_interface_handler, NULL); - nss_dynamic_interface_stats_dentry_create(); -} - -/* - * nss_is_dynamic_interface() - * Judge it is a valid dynamic interface - */ -bool nss_is_dynamic_interface(int if_num) -{ - return (if_num >= NSS_DYNAMIC_IF_START && if_num < NSS_SPECIAL_IF_START); -} - -/* - * nss_dynamic_interface_get_nss_ctx_by_type() - * Gets the NSS context using NSS dynamic interface type. - */ -struct nss_ctx_instance *nss_dynamic_interface_get_nss_ctx_by_type(enum nss_dynamic_interface_type type) -{ - struct nss_ctx_instance *nss_ctx = NULL; - uint32_t core_id; - - if (type >= NSS_DYNAMIC_INTERFACE_TYPE_MAX) { - nss_warning("Invalid param: Type is wrong %d\n", type); - return NULL; - } - - core_id = nss_top_main.dynamic_interface_table[type]; - nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[core_id]; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - return nss_ctx; -} - -/* - * nss_dynamic_interface_get_type() - * Gets the type of dynamic interface - */ -enum nss_dynamic_interface_type nss_dynamic_interface_get_type(struct nss_ctx_instance *nss_ctx, int if_num) -{ - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (nss_is_dynamic_interface(if_num) == false) { - return NSS_DYNAMIC_INTERFACE_TYPE_NONE; - } - - return nss_dynamic_interface_assigned_types[nss_ctx->id][if_num - NSS_DYNAMIC_IF_START]; -} - -/* - * nss_dynamic_interface_msg_init() - * Initialize dynamic interface message. - */ -void nss_dynamic_interface_msg_init(struct nss_dynamic_interface_msg *ndm, uint16_t if_num, uint32_t type, uint32_t len, - void *cb, void *app_data) -{ - nss_cmn_msg_init(&ndm->cm, if_num, type, len, cb, app_data); -} - -/* - * nss_dynamic_interface_stats_notify() - * Sends notifications to all the registered modules. - */ -void nss_dynamic_interface_stats_notify(uint32_t if_num, uint32_t core_id) -{ - struct nss_dynamic_interface_notification stats; - - stats.core_id = core_id; - stats.if_num = if_num; - atomic_notifier_call_chain(&nss_dynamic_interface_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&stats); -} -EXPORT_SYMBOL(nss_dynamic_interface_stats_notify); - -/* - * nss_dynamic_interface_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_dynamic_interface_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_dynamic_interface_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_dynamic_interface_stats_register_notifier); - -/* - * nss_dynamic_interface_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_dynamic_interface_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_dynamic_interface_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_dynamic_interface_stats_unregister_notifier); - -EXPORT_SYMBOL(nss_dynamic_interface_alloc_node); -EXPORT_SYMBOL(nss_dynamic_interface_dealloc_node); -EXPORT_SYMBOL(nss_is_dynamic_interface); -EXPORT_SYMBOL(nss_dynamic_interface_get_type); -EXPORT_SYMBOL(nss_dynamic_interface_get_nss_ctx_by_type); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_log.c deleted file mode 100644 index 0c49aeb7e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_log.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_dynamic_interface_log.c - * NSS Dynamic Interface logger file. - */ - -#include "nss_core.h" - -/* - * nss_dynamic_interface_log_message_types_str - * Dynamic Interface message strings - */ -static int8_t *nss_dynamic_interface_log_message_types_str[NSS_DYNAMIC_INTERFACE_MAX] __maybe_unused = { - "Dynamic Interface Alloc Node", - "Dynamic Interface Dealloc Node" -}; - -/* - * nss_dynamic_interface_log_error_response_types_str - * Strings for error types for dynamic interface messages - */ -static int8_t *nss_dynamic_interface_log_error_response_types_str[NSS_DYNAMIC_INTERFACE_ERR_MAX] __maybe_unused = { - "Dynamic Interface Error Unknown Interface", - "Dynamic Interface Error Unavailable Interface", - "Dynamic Interface Error Invalid Interface Type", - "Dynamic Interface Error Invalid Interface Number", - "Dynamic Interface Error Alloc Function Unavailable", - "Dynamic Interface Error Dealloc Funciton Unavailable", - "Dynamic Interface Error Allocation Error", - "Dynamic Interface Error Interface Number Mismatch" -}; - -/* - * nss_dynamic_interface_alloc_node_msg() - * Log Dynamic Interface alloc node message. - */ -static void nss_dynamic_interface_alloc_node_log_msg(struct nss_dynamic_interface_msg *ndm) -{ - struct nss_dynamic_interface_alloc_node_msg *ndanm __maybe_unused = &ndm->msg.alloc_node; - nss_trace("%px: NSS Dynamic Interface Alloc Node Message:\n" - "Dynamic Interface Type: %d\n" - "Dynamic Interface Number: %d\n", - ndanm, ndanm->type, - ndanm->if_num); -} - -/* - * nss_dynamic_interface_dealloc_node_msg() - * Log Dynamic Interface dealloc node message. - */ -static void nss_dynamic_interface_dealloc_node_log_msg(struct nss_dynamic_interface_msg *ndm) -{ - struct nss_dynamic_interface_dealloc_node_msg *nddnm __maybe_unused = &ndm->msg.dealloc_node; - nss_trace("%px: NSS Dynamic Interface Alloc Node Message:\n" - "Dynamic Interface Type: %d\n" - "Dynamic Interface Number: %d\n", - nddnm, nddnm->type, - nddnm->if_num); -} - -/* - * nss_dynamic_interface_log_verbose() - * Log message contents. - */ -static void nss_dynamic_interface_log_verbose(struct nss_dynamic_interface_msg *ndm) -{ - switch (ndm->cm.type) { - case NSS_DYNAMIC_INTERFACE_ALLOC_NODE: - nss_dynamic_interface_alloc_node_log_msg(ndm); - break; - - case NSS_DYNAMIC_INTERFACE_DEALLOC_NODE: - nss_dynamic_interface_dealloc_node_log_msg(ndm); - break; - - default: - nss_warning("%px: Invalid message type\n", ndm); - break; - } -} - -/* - * nss_dynamic_interface_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_dynamic_interface_log_tx_msg(struct nss_dynamic_interface_msg *ndm) -{ - if (ndm->cm.type >= NSS_DYNAMIC_INTERFACE_MAX) { - nss_warning("%px: Invalid message type\n", ndm); - return; - } - - nss_info("%px: type[%d]:%s\n", ndm, ndm->cm.type, nss_dynamic_interface_log_message_types_str[ndm->cm.type]); - nss_dynamic_interface_log_verbose(ndm); -} - -/* - * nss_dynamic_interface_log_rx_msg() - * Log messages received from FW. - */ -void nss_dynamic_interface_log_rx_msg(struct nss_dynamic_interface_msg *ndm) -{ - if (ndm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ndm); - return; - } - - if (ndm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ndm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ndm, ndm->cm.type, - nss_dynamic_interface_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response]); - goto verbose; - } - - if (ndm->cm.error >= NSS_DYNAMIC_INTERFACE_ERR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ndm, ndm->cm.type, nss_dynamic_interface_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response], - ndm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n, error[%d]:%s\n", - ndm, ndm->cm.type, nss_dynamic_interface_log_message_types_str[ndm->cm.type], - ndm->cm.response, nss_cmn_response_str[ndm->cm.response], - ndm->cm.error, nss_dynamic_interface_log_error_response_types_str[ndm->cm.error]); - -verbose: - nss_dynamic_interface_log_verbose(ndm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_log.h deleted file mode 100644 index 266b909c9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_DYNAMIC_INTERFACE_LOG_H -#define __NSS_DYNAMIC_INTERFACE_LOG_H - -/* - * nss_dynamic_interface.h - * NSS Dynamic Interface private header file. - */ - -/* - * nss_dynamic_interface_log_tx_msg - * Logs a dynamic interface message that is sent to the NSS firmware. - */ -void nss_dynamic_interface_log_tx_msg(struct nss_dynamic_interface_msg *ndm); - -/* - * nss_dynamic_interface_log_rx_msg - * Logs a dynamic interface message that is received from the NSS firmware. - */ -void nss_dynamic_interface_log_rx_msg(struct nss_dynamic_interface_msg *ndm); - -#endif /* __NSS_DYNAMIC_INTERFACE_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.c deleted file mode 100644 index 1f190b645..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_dynamic_interface.h" - -/* - * nss_dynamic_interface_type_names - * Name strings for dynamic interface types - */ -const char *nss_dynamic_interface_type_names[NSS_DYNAMIC_INTERFACE_TYPE_MAX] = { - "NSS_DYNAMIC_INTERFACE_TYPE_NONE", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR", - "NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_5", - "NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_RESERVED", - "NSS_DYNAMIC_INTERFACE_TYPE_VAP", - "NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_0", - "NSS_DYNAMIC_INTERFACE_TYPE_PPPOE", - "NSS_DYNAMIC_INTERFACE_TYPE_VIRTIF_DEPRECATED", - "NSS_DYNAMIC_INTERFACE_TYPE_L2TPV2", - "NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_4", - "NSS_DYNAMIC_INTERFACE_TYPE_PORTID", - "NSS_DYNAMIC_INTERFACE_TYPE_DTLS", - "NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE", - "NSS_DYNAMIC_INTERFACE_TYPE_VLAN", - "NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_3", - "NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_INTERNAL", - "NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H", - "NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N", - "NSS_DYNAMIC_INTERFACE_TYPE_TUN6RD_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_TUN6RD_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER_EXCEPTION", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_US", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_GRE_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_PPTP_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_PPTP_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_PPTP_HOST_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_REDIRECT", - "NSS_DYNAMIC_INTERFACE_TYPE_PVXLAN_HOST_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_PVXLAN_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_IGS", - "NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_US", - "NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_DS", - "NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_OUTER", - "NSS_DYNAMIC_INTERFACE_TYPE_MATCH", - "NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H", - "NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N", - "NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0", - "NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1", - "NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER", - "NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER", -}; - -/* - * nss_dynamic_interface_type_names_stats_read() - * Read and display dynamic interface types names - */ -static ssize_t nss_dynamic_interface_type_names_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int i; - char *lbuf = NULL; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint32_t max_output_lines = 2 /* header & footer for stats */ - + NSS_DYNAMIC_INTERFACE_TYPE_MAX /* maximum number of dynamic interface types */ - + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * name strings - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n dynamic interface type names start:\n\n"); - - for (i = 0; i < NSS_DYNAMIC_INTERFACE_TYPE_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%u : %s\n", i, nss_dynamic_interface_type_names[i]); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n dynamic interface type names end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(lbuf); - return bytes_read; -} - -/* - * nss_dynamic_interface_type_names_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(dynamic_interface_type_names) - -/* - * nss_dynamic_interface_stats_dentry_create() - * Create dynamic-interface statistics debug entry. - */ -void nss_dynamic_interface_stats_dentry_create(void) -{ - struct dentry *di_dentry = NULL; - struct dentry *di_type_name_d = NULL; - - di_dentry = debugfs_create_dir("dynamic_if", nss_top_main.stats_dentry); - if (unlikely(di_dentry == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/dynamic_if directory"); - return; - } - - di_type_name_d = debugfs_create_file("type_names", 0400, di_dentry, - &nss_top_main, &nss_dynamic_interface_type_names_stats_ops); - if (unlikely(di_type_name_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/dynamic_if/type_names file"); - return; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.h deleted file mode 100644 index ef16162bc..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_dynamic_interface_stats.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_DYNAMIC_INTERFACE_STATS_H -#define __NSS_DYNAMIC_INTERFACE_STATS_H - -/* - * nss_dynamic_interface.h - * NSS Dynamic Interface private header file. - */ - -/* - * nss_dynamic_interface_stats_dentry_create - * Create dynamic interface debugfs entry. - */ -void nss_dynamic_interface_stats_dentry_create(void); - -#endif /* __NSS_DYNAMIC_INTERFACE_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_edma.c b/feeds/ipq807x/qca-nss-drv/src/nss_edma.c deleted file mode 100644 index f03772689..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_edma.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_edma.c - * NSS EDMA APIs - */ -#include "nss_edma_stats.h" -#include "nss_edma_strings.h" - -/* - ********************************** - Rx APIs - ********************************** - */ - -/* - * nss_edma_interface_handler() - * Handle NSS -> HLOS messages for EDMA node - */ -static void nss_edma_interface_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_edma_msg *nem = (struct nss_edma_msg *)ncm; - nss_edma_msg_callback_t cb; - - /* - * Is this a valid request/response packet? - */ - if (nem->cm.type >= NSS_METADATA_TYPE_EDMA_MAX) { - nss_warning("%px: received invalid message %d for edma interface", nss_ctx, nem->cm.type); - return; - } - - /* - * Handle different types of messages - */ - switch (nem->cm.type) { - case NSS_METADATA_TYPE_EDMA_PORT_STATS_SYNC: - /* - * Update driver statistics and send statistics notifications to the registered modules. - */ - nss_edma_metadata_port_stats_sync(nss_ctx, &nem->msg.port_stats); - nss_edma_stats_notify(nss_ctx); - - break; - case NSS_METADATA_TYPE_EDMA_RING_STATS_SYNC: - nss_edma_metadata_ring_stats_sync(nss_ctx, &nem->msg.ring_stats); - break; - case NSS_METADATA_TYPE_EDMA_ERR_STATS_SYNC: - nss_edma_metadata_err_stats_sync(nss_ctx, &nem->msg.err_stats); - break; - default: - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - /* - * Check response - */ - nss_info("%px: Received response %d for type %d, interface %d", - nss_ctx, ncm->response, ncm->type, ncm->interface); - } - } - /* - * Update the callback and app_data for NOTIFY messages, edma sends all notify messages - * to the same callback/app_data. - */ - if (nem->cm.response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->edma_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->nss_top->edma_ctx; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_edma_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nem); -} - -/* - * nss_edma_notify_register() - * Register to received EDMA events. - */ -struct nss_ctx_instance *nss_edma_notify_register(nss_edma_msg_callback_t cb, void *app_data) -{ - nss_top_main.edma_callback = cb; - nss_top_main.edma_ctx = app_data; - return &nss_top_main.nss[nss_top_main.edma_handler_id]; -} -EXPORT_SYMBOL(nss_edma_notify_register); - -/* - * nss_edma_notify_unregister() - * Unregister to received EDMA events. - */ -void nss_edma_notify_unregister(void) -{ - nss_top_main.edma_callback = NULL; -} -EXPORT_SYMBOL(nss_edma_notify_unregister); - -/* - * nss_get_edma_context() - */ -struct nss_ctx_instance *nss_edma_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.edma_handler_id]; -} -EXPORT_SYMBOL(nss_edma_get_context); - -/* - * nss_edma_register_handler() - */ -void nss_edma_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_edma_get_context(); - - nss_core_register_handler(nss_ctx, NSS_EDMA_INTERFACE, nss_edma_interface_handler, NULL); - - nss_edma_stats_dentry_create(); - nss_edma_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.c deleted file mode 100644 index abb338e2a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.c +++ /dev/null @@ -1,822 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_edma_stats.c - * NSS EDMA statistics APIs - */ - -#include "nss_edma_stats.h" -#include "nss_edma_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_edma_stats_notifier); - -struct nss_edma_stats edma_stats; - -/* - ********************************** - EDMA statistics APIs - ********************************** - */ - -/* - * nss_edma_port_stats_read() - * Read EDMA port statistics - */ -static ssize_t nss_edma_port_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * Max output lines = #stats * NSS_MAX_CORES + - * few blank lines for banner printing + Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - struct nss_stats_data *data = fp->private_data; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_STATS_NODE_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "edma", NSS_STATS_SINGLE_CORE); - - /* - * Common node stats - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "edma port %d stats:\n\n", data->edma_id); - - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_STATS_NODE_MAX); i++) { - stats_shadow[i] = edma_stats.port[data->edma_id].port_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("edma_port", NULL, data->edma_id - , nss_edma_strings_stats_node - , stats_shadow - , NSS_STATS_NODE_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_edma_port_type_stats_read() - * Read EDMA port type - */ -static ssize_t nss_edma_port_type_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * max output lines = #stats + start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = (1 + 2) + 3; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t port_type; - struct nss_stats_data *data = fp->private_data; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - size_wr = scnprintf(lbuf, size_al, "edma port type start:\n\n"); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "edma port %d type:\n\n", data->edma_id); - - /* - * Port type - */ - spin_lock_bh(&nss_top_main.stats_lock); - port_type = edma_stats.port[data->edma_id].port_type; - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "port_type = %s\n", nss_edma_strings_stats_port_type[port_type].stats_name); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nedma stats end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - - return bytes_read; -} - -/* - * nss_edma_port_ring_map_stats_read() - * Read EDMA port ring map - */ -static ssize_t nss_edma_port_ring_map_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = (4 + 2) + 3; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - struct nss_stats_data *data = fp->private_data; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_EDMA_PORT_RING_MAP_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr = scnprintf(lbuf, size_al, "edma port ring map start:\n\n"); - - /* - * Port ring map - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "edma port %d ring map:\n\n", data->edma_id); - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_EDMA_PORT_RING_MAP_MAX; i++) { - stats_shadow[i] = edma_stats.port[data->edma_id].port_ring_map[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_print("edma_port_ring", NULL, data->edma_id - , nss_edma_strings_stats_port_ring_map - , stats_shadow - , NSS_EDMA_PORT_RING_MAP_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_edma_txring_stats_read() - * Read EDMA Tx ring stats - */ -static ssize_t nss_edma_txring_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = (NSS_EDMA_STATS_TX_MAX + 2) + 3; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - struct nss_stats_data *data = fp->private_data; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_EDMA_STATS_TX_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr = scnprintf(lbuf, size_al, "edma Tx ring stats start:\n\n"); - - /* - * Tx ring stats - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "Tx ring %d stats:\n\n", data->edma_id); - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_EDMA_STATS_TX_MAX; i++) { - stats_shadow[i] = edma_stats.tx_stats[data->edma_id][i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_print("edma_tx_ring", NULL, data->edma_id - , nss_edma_strings_stats_tx - , stats_shadow - , NSS_EDMA_STATS_TX_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_edma_rxring_stats_read() - * Read EDMA rxring stats - */ -static ssize_t nss_edma_rxring_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = (NSS_EDMA_STATS_RX_MAX + 2) + 3; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - struct nss_stats_data *data = fp->private_data; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_EDMA_STATS_RX_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - /* - * RX ring stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_EDMA_STATS_RX_MAX; i++) { - stats_shadow[i] = edma_stats.rx_stats[data->edma_id][i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("edma_rx_ring", NULL, data->edma_id - , nss_edma_strings_stats_rx - , stats_shadow - , NSS_EDMA_STATS_RX_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_edma_txcmplring_stats_read() - * Read EDMA txcmplring stats - */ -static ssize_t nss_edma_txcmplring_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = (NSS_EDMA_STATS_TXCMPL_MAX + 2) + 3; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - struct nss_stats_data *data = fp->private_data; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_EDMA_STATS_TXCMPL_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr = scnprintf(lbuf, size_al, "edma Tx cmpl ring stats start:\n\n"); - - /* - * Tx cmpl ring stats - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "Tx cmpl ring %d stats:\n\n", data->edma_id); - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_EDMA_STATS_TXCMPL_MAX; i++) { - stats_shadow[i] = edma_stats.txcmpl_stats[data->edma_id][i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("edma_tx_cmpl_ring", NULL, data->edma_id - , nss_edma_strings_stats_txcmpl - , stats_shadow - , NSS_EDMA_STATS_TXCMPL_MAX - , lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nedma Tx cmpl ring stats end\n\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_edma_rxfillring_stats_read() - * Read EDMA rxfillring stats - */ -static ssize_t nss_edma_rxfillring_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = (NSS_EDMA_STATS_RXFILL_MAX + 2) + 3; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - struct nss_stats_data *data = fp->private_data; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_EDMA_STATS_RXFILL_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr = scnprintf(lbuf, size_al, "edma Rx fill ring stats start:\n\n"); - - /* - * Rx fill ring stats - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "Rx fill ring %d stats:\n\n", data->edma_id); - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_EDMA_STATS_RXFILL_MAX; i++) { - stats_shadow[i] = edma_stats.rxfill_stats[data->edma_id][i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("edma_rx_fill_ring", NULL - , NSS_STATS_SINGLE_INSTANCE - , nss_edma_strings_stats_rxfill - , stats_shadow - , NSS_EDMA_STATS_RXFILL_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_edma_err_stats_read() - * Read EDMA err stats - */ -static ssize_t nss_edma_err_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = (NSS_EDMA_ERR_STATS_MAX + 2) + 3; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_EDMA_ERR_STATS_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr = scnprintf(lbuf, size_al, "edma error stats start:\n\n"); - - /* - * Common node stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - - for (i = 0; (i < NSS_EDMA_ERR_STATS_MAX); i++) - stats_shadow[i] = edma_stats.misc_err[i]; - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("edma_err", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_edma_strings_stats_err_map - , stats_shadow - , NSS_EDMA_ERR_STATS_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * edma_port_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(edma_port); - -/* - * edma_port_type_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(edma_port_type); - -/* - * edma_port_ring_map_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(edma_port_ring_map); - -/* - * edma_txring_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(edma_txring); - -/* - * edma_rxring_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(edma_rxring); - -/* - * edma_txcmplring_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(edma_txcmplring); - -/* - * edma_rxfillring_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(edma_rxfillring); - -/* - * edma_err_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(edma_err); - -/* - * nss_edma_stats_dentry_create() - * Create edma statistics debug entry. - */ -void nss_edma_stats_dentry_create(void) -{ - int i; - struct dentry *edma_d = NULL; - struct dentry *edma_port_dir_d = NULL; - struct dentry *edma_port_d = NULL; - struct dentry *edma_port_type_d = NULL; - struct dentry *edma_port_stats_d = NULL; - struct dentry *edma_port_ring_map_d = NULL; - struct dentry *edma_rings_dir_d = NULL; - struct dentry *edma_tx_dir_d = NULL; - struct dentry *edma_tx_d = NULL; - struct dentry *edma_rx_dir_d = NULL; - struct dentry *edma_rx_d = NULL; - struct dentry *edma_txcmpl_dir_d = NULL; - struct dentry *edma_txcmpl_d = NULL; - struct dentry *edma_rxfill_dir_d = NULL; - struct dentry *edma_rxfill_d = NULL; - struct dentry *edma_err_stats_d = NULL; - char file_name[10]; - - edma_d = debugfs_create_dir("edma", nss_top_main.stats_dentry); - if (unlikely(edma_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma directory"); - return; - } - - /* - * edma port stats - */ - edma_port_dir_d = debugfs_create_dir("ports", edma_d); - if (unlikely(edma_port_dir_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/ports directory"); - return; - } - - for (i = 0; i < NSS_EDMA_NUM_PORTS_MAX; i++) { - memset(file_name, 0, sizeof(file_name)); - snprintf(file_name, sizeof(file_name), "%d", i); - - edma_port_d = debugfs_create_dir(file_name, edma_port_dir_d); - if (unlikely(edma_port_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/ports/%d directory", i); - return; - } - - edma_port_stats_d = debugfs_create_file("stats", 0400, edma_port_d, (void *)(nss_ptr_t)i, &nss_edma_port_stats_ops); - if (unlikely(edma_port_stats_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/ports/%d/stats file", i); - return; - } - - edma_port_type_d = debugfs_create_file("type", 0400, edma_port_d, (void *)(nss_ptr_t)i, &nss_edma_port_type_stats_ops); - if (unlikely(edma_port_type_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/ports/%d/type file", i); - return; - } - - edma_port_ring_map_d = debugfs_create_file("ring_map", 0400, edma_port_d, (void *)(nss_ptr_t)i, &nss_edma_port_ring_map_stats_ops); - if (unlikely(edma_port_ring_map_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/ports/%d/ring_map file", i); - return; - } - } - - /* - * edma error stats - */ - edma_err_stats_d = NULL; - edma_err_stats_d = debugfs_create_file("err_stats", 0400, edma_d, &nss_top_main, &nss_edma_err_stats_ops); - if (unlikely(edma_port_stats_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/%d/err_stats file", 0); - return; - } - - /* - * edma ring stats - */ - edma_rings_dir_d = debugfs_create_dir("rings", edma_d); - if (unlikely(edma_rings_dir_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings directory"); - return; - } - - /* - * edma tx ring stats - */ - edma_tx_dir_d = debugfs_create_dir("tx", edma_rings_dir_d); - if (unlikely(edma_tx_dir_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings/tx directory"); - return; - } - - for (i = 0; i < NSS_EDMA_NUM_TX_RING_MAX; i++) { - memset(file_name, 0, sizeof(file_name)); - scnprintf(file_name, sizeof(file_name), "%d", i); - edma_tx_d = debugfs_create_file(file_name, 0400, edma_tx_dir_d, (void *)(nss_ptr_t)i, &nss_edma_txring_stats_ops); - if (unlikely(edma_tx_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings/tx/%d file", i); - return; - } - } - - /* - * edma rx ring stats - */ - edma_rx_dir_d = debugfs_create_dir("rx", edma_rings_dir_d); - if (unlikely(edma_rx_dir_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings/rx directory"); - return; - } - - for (i = 0; i < NSS_EDMA_NUM_RX_RING_MAX; i++) { - memset(file_name, 0, sizeof(file_name)); - scnprintf(file_name, sizeof(file_name), "%d", i); - edma_rx_d = debugfs_create_file(file_name, 0400, edma_rx_dir_d, (void *)(nss_ptr_t)i, &nss_edma_rxring_stats_ops); - if (unlikely(edma_rx_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings/rx/%d file", i); - return; - } - } - - /* - * edma tx cmpl ring stats - */ - edma_txcmpl_dir_d = debugfs_create_dir("txcmpl", edma_rings_dir_d); - if (unlikely(edma_txcmpl_dir_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings/txcmpl directory"); - return; - } - - for (i = 0; i < NSS_EDMA_NUM_TXCMPL_RING_MAX; i++) { - memset(file_name, 0, sizeof(file_name)); - scnprintf(file_name, sizeof(file_name), "%d", i); - edma_txcmpl_d = debugfs_create_file(file_name, 0400, edma_txcmpl_dir_d, (void *)(nss_ptr_t)i, &nss_edma_txcmplring_stats_ops); - if (unlikely(edma_txcmpl_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings/txcmpl/%d file", i); - return; - } - } - - /* - * edma rx fill ring stats - */ - edma_rxfill_dir_d = debugfs_create_dir("rxfill", edma_rings_dir_d); - if (unlikely(edma_rxfill_dir_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings/rxfill directory"); - return; - } - - for (i = 0; i < NSS_EDMA_NUM_RXFILL_RING_MAX; i++) { - memset(file_name, 0, sizeof(file_name)); - scnprintf(file_name, sizeof(file_name), "%d", i); - edma_rxfill_d = debugfs_create_file(file_name, 0400, edma_rxfill_dir_d, (void *)(nss_ptr_t)i, &nss_edma_rxfillring_stats_ops); - if (unlikely(edma_rxfill_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/edma/rings/rxfill/%d file", i); - return; - } - } -} - -/* - * nss_edma_metadata_port_stats_sync() - * Handle the syncing of EDMA port statistics. - */ -void nss_edma_metadata_port_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_edma_port_stats_sync *nepss) -{ - uint16_t i, j = 0; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * edma port stats - * We process a subset of port stats since msg payload is not enough to hold all ports at once. - */ - for (i = nepss->start_port; i < nepss->end_port; i++) { - int k; - - edma_stats.port[i].port_stats[NSS_STATS_NODE_RX_PKTS] += nepss->port_stats[j].node_stats.rx_packets; - edma_stats.port[i].port_stats[NSS_STATS_NODE_RX_BYTES] += nepss->port_stats[j].node_stats.rx_bytes; - edma_stats.port[i].port_stats[NSS_STATS_NODE_TX_PKTS] += nepss->port_stats[j].node_stats.tx_packets; - edma_stats.port[i].port_stats[NSS_STATS_NODE_TX_BYTES] += nepss->port_stats[j].node_stats.tx_bytes; - - for (k = 0; k < NSS_MAX_NUM_PRI; k++) { - edma_stats.port[i].port_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + k] += nepss->port_stats[j].node_stats.rx_dropped[k]; - } - - edma_stats.port[i].port_type = nepss->port_stats[j].port_type; - edma_stats.port[i].port_ring_map[NSS_EDMA_PORT_RX_RING] = nepss->port_stats[j].edma_rx_ring; - edma_stats.port[i].port_ring_map[NSS_EDMA_PORT_TX_RING] = nepss->port_stats[j].edma_tx_ring; - j++; - } - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_edma_metadata_ring_stats_sync() - * Handle the syncing of EDMA ring statistics. - */ -void nss_edma_metadata_ring_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_edma_ring_stats_sync *nerss) -{ - int32_t i; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * edma tx ring stats - */ - for (i = 0; i < NSS_EDMA_NUM_TX_RING_MAX; i++) { - edma_stats.tx_stats[i][NSS_EDMA_STATS_TX_ERR] += nerss->tx_ring[i].tx_err; - edma_stats.tx_stats[i][NSS_EDMA_STATS_TX_DROPPED] += nerss->tx_ring[i].tx_dropped; - edma_stats.tx_stats[i][NSS_EDMA_STATS_TX_DESC] += nerss->tx_ring[i].desc_cnt; - } - - /* - * edma rx ring stats - */ - for (i = 0; i < NSS_EDMA_NUM_RX_RING_MAX; i++) { - edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_CSUM_ERR] += nerss->rx_ring[i].rx_csum_err; - edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_DESC] += nerss->rx_ring[i].desc_cnt; - edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_QOS_ERR] += nerss->rx_ring[i].qos_err; - edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_SRC_PORT_INVALID] += nerss->rx_ring[i].rx_src_port_invalid; - edma_stats.rx_stats[i][NSS_EDMA_STATS_RX_SRC_IF_INVALID] += nerss->rx_ring[i].rx_src_if_invalid; - } - - /* - * edma tx cmpl ring stats - */ - for (i = 0; i < NSS_EDMA_NUM_TXCMPL_RING_MAX; i++) { - edma_stats.txcmpl_stats[i][NSS_EDMA_STATS_TXCMPL_DESC] += nerss->txcmpl_ring[i].desc_cnt; - } - - /* - * edma rx fill ring stats - */ - for (i = 0; i < NSS_EDMA_NUM_RXFILL_RING_MAX; i++) { - edma_stats.rxfill_stats[i][NSS_EDMA_STATS_RXFILL_DESC] += nerss->rxfill_ring[i].desc_cnt; - } - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_edma_metadata_err_stats_sync() - * Handle the syncing of EDMA error statistics. - */ -void nss_edma_metadata_err_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_edma_err_stats_sync *nerss) -{ - - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - spin_lock_bh(&nss_top->stats_lock); - - edma_stats.misc_err[NSS_EDMA_AXI_RD_ERR] += nerss->msg_err_stats.axi_rd_err; - edma_stats.misc_err[NSS_EDMA_AXI_WR_ERR] += nerss->msg_err_stats.axi_wr_err; - edma_stats.misc_err[NSS_EDMA_RX_DESC_FIFO_FULL_ERR] += nerss->msg_err_stats.rx_desc_fifo_full_err; - edma_stats.misc_err[NSS_EDMA_RX_BUF_SIZE_ERR] += nerss->msg_err_stats.rx_buf_size_err; - edma_stats.misc_err[NSS_EDMA_TX_SRAM_FULL_ERR] += nerss->msg_err_stats.tx_sram_full_err; - edma_stats.misc_err[NSS_EDMA_TX_CMPL_BUF_FULL_ERR] += nerss->msg_err_stats.tx_cmpl_buf_full_err; - edma_stats.misc_err[NSS_EDMA_PKT_LEN_LA64K_ERR] += nerss->msg_err_stats.pkt_len_la64k_err; - edma_stats.misc_err[NSS_EDMA_PKT_LEN_LE33_ERR] += nerss->msg_err_stats.pkt_len_le33_err; - edma_stats.misc_err[NSS_EDMA_DATA_LEN_ERR] += nerss->msg_err_stats.data_len_err; - edma_stats.misc_err[NSS_EDMA_ALLOC_FAIL_CNT] += nerss->msg_err_stats.alloc_fail_cnt; - edma_stats.misc_err[NSS_EDMA_QOS_INVAL_DST_DROPS] += nerss->msg_err_stats.qos_inval_dst_drops; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_edma_stats_notify() - * Calls statistics notifier. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_edma_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - uint32_t core_id = nss_ctx->id; - - atomic_notifier_call_chain(&nss_edma_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&core_id); -} - -/* - * nss_edma_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_edma_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_edma_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_edma_stats_register_notifier); - -/* - * nss_edma_stats_unregister_notifier() - * Deregisters stats notifier. - */ -int nss_edma_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_edma_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_edma_stats_unregister_notifier); - -/* - * nss_edma_get_stats - * Sends EDMA statistics to NSS clients. - */ -void nss_edma_get_stats(uint64_t *stats, int port_id) -{ - memcpy(stats, edma_stats.port[port_id].port_stats, sizeof(uint64_t) * NSS_STATS_NODE_MAX); -} -EXPORT_SYMBOL(nss_edma_get_stats); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.h deleted file mode 100644 index 305582b84..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_edma_stats.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -/* - * nss_edma_stats.h - * NSS EDMA statistics header file. - */ - -#ifndef __NSS_EDMA_STATS_H -#define __NSS_EDMA_STATS_H - -#include "nss_core.h" - -/* - * NSS EDMA statistics APIs - */ -extern void nss_edma_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_edma_metadata_port_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_edma_port_stats_sync *nepss); -extern void nss_edma_metadata_ring_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_edma_ring_stats_sync *nerss); -extern void nss_edma_metadata_err_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_edma_err_stats_sync *nerss); -extern void nss_edma_stats_dentry_create(void); - -#endif /* __NSS_EDMA_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.c deleted file mode 100644 index 3d9c23352..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_edma_strings_stats_node - * EDMA statistics strings. - */ -struct nss_stats_info nss_edma_strings_stats_node[NSS_STATS_NODE_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_byts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_byts" , NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_edma_common_stats_strings_read() - * Read EDMA common node statistics names. - */ -static ssize_t nss_edma_common_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_edma_strings_stats_node, NSS_STATS_NODE_MAX); -} - -/* - * nss_edma_common_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(edma_common_stats); - -/* - * nss_edma_strings_stats_tx - */ -struct nss_stats_info nss_edma_strings_stats_tx[NSS_EDMA_STATS_TX_MAX] = { - {"tx_err" , NSS_STATS_TYPE_ERROR}, - {"tx_drops" , NSS_STATS_TYPE_DROP}, - {"desc_cnt" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_edma_txring_strings_read() - * Read EDMA txring names. - */ -static ssize_t nss_edma_txring_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_edma_strings_stats_tx, NSS_EDMA_STATS_TX_MAX); -} - -/* - * edma_txring_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(edma_txring); - -/* - * nss_edma_strings_stats_rx - */ -struct nss_stats_info nss_edma_strings_stats_rx[NSS_EDMA_STATS_RX_MAX] = { - {"rx_csum_err" , NSS_STATS_TYPE_ERROR}, - {"desc_cnt" , NSS_STATS_TYPE_SPECIAL}, - {"qos_err" , NSS_STATS_TYPE_DROP}, - {"rx_src_port_invalid" , NSS_STATS_TYPE_DROP}, - {"rx_src_interface_invalid" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_edma_rxring_strings_read() - * Read EDMA rxring names. - */ -static ssize_t nss_edma_rxring_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_edma_strings_stats_rx, NSS_EDMA_STATS_RX_MAX); -} - -/* - * edma_rxring_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(edma_rxring); - -/* - * nss_edma_strings_stats_txcmpl - */ -struct nss_stats_info nss_edma_strings_stats_txcmpl[NSS_EDMA_STATS_TXCMPL_MAX] = { - {"desc_cnt" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_edma_txcmplring_strings_read() - * Read EDMA txcmplring names. - */ -static ssize_t nss_edma_txcmplring_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_edma_strings_stats_txcmpl, NSS_EDMA_STATS_TXCMPL_MAX); -} - -/* - * edma_txcmplring_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(edma_txcmplring); - -/* - * nss_edma_strings_stats_rxfill - */ -struct nss_stats_info nss_edma_strings_stats_rxfill[NSS_EDMA_STATS_RXFILL_MAX] = { - {"desc_cnt" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_edma_rxfillring_strings_read() - * Read EDMA rxfillring names. - */ -static ssize_t nss_edma_rxfillring_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_edma_strings_stats_rxfill, NSS_EDMA_STATS_RXFILL_MAX); -} - -/* - * edma_rxfillring_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(edma_rxfillring); - -/* - * nss_edma_strings_stats_port_type - */ -struct nss_stats_info nss_edma_strings_stats_port_type[NSS_EDMA_PORT_TYPE_MAX] = { - {"physical_port", NSS_STATS_TYPE_SPECIAL}, - {"virtual_port" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_edma_port_type_strings_read() - * Read EDMA port type names. - */ -static ssize_t nss_edma_port_type_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_edma_strings_stats_port_type, NSS_EDMA_PORT_TYPE_MAX); -} - -/* - * edma_port_type_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(edma_port_type); - -/* - * nss_edma_strings_stats_port_ring_map - */ -struct nss_stats_info nss_edma_strings_stats_port_ring_map[NSS_EDMA_PORT_RING_MAP_MAX] = { - {"rx_ring" , NSS_STATS_TYPE_SPECIAL}, - {"tx_ring" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_edma_port_ring_map_strings_read() - * Read EDMA port ring map names. - */ -static ssize_t nss_edma_port_ring_map_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_edma_strings_stats_port_ring_map, NSS_EDMA_PORT_RING_MAP_MAX); -} - -/* - * edma_port_ring_map_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(edma_port_ring_map); - -/* - * nss_edma_strings_stats_err_map - */ -struct nss_stats_info nss_edma_strings_stats_err_map[NSS_EDMA_ERR_STATS_MAX] = { - {"axi_rd_err" , NSS_STATS_TYPE_ERROR}, - {"axi_wr_err" , NSS_STATS_TYPE_ERROR}, - {"rx_desc_fifo_full_err", NSS_STATS_TYPE_ERROR}, - {"rx_buf_size_err" , NSS_STATS_TYPE_ERROR}, - {"tx_sram_full_err" , NSS_STATS_TYPE_ERROR}, - {"tx_cmpl_buf_full_err" , NSS_STATS_TYPE_ERROR}, - {"pkt_len_la64k_err" , NSS_STATS_TYPE_ERROR}, - {"pkt_len_le33_err" , NSS_STATS_TYPE_ERROR}, - {"data_len_err" , NSS_STATS_TYPE_ERROR}, - {"alloc_fail_cnt" , NSS_STATS_TYPE_ERROR}, - {"qos_inval_dst_drops" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_edma_err_strings_read() - * Read EDMA error names. - */ -static ssize_t nss_edma_err_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_edma_strings_stats_err_map, NSS_EDMA_ERR_STATS_MAX); -} - -/* - * edma_err_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(edma_err); - -/* - * nss_edma_strings_dentry_create() - * Create EDMA statistics strings debug entry. - */ -void nss_edma_strings_dentry_create(void) -{ - struct dentry *edma_d; - struct dentry *edma_port_dir_d; - struct dentry *edma_rings_dir_d; - struct dentry *edma_rx_dir_d; - struct dentry *edma_tx_dir_d; - struct dentry *edma_rxfill_dir_d; - struct dentry *edma_txcmpl_dir_d; - struct dentry *file_d; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - edma_d = debugfs_create_dir("edma", nss_top_main.strings_dentry); - if (!edma_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma directory"); - return; - } - - /* - * EDMA port stats. - */ - edma_port_dir_d = debugfs_create_dir("ports", edma_d); - if (!edma_port_dir_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/ports directory"); - goto fail; - } - - file_d = debugfs_create_file("common_stats_str", 0400, edma_port_dir_d, &nss_top_main, &nss_edma_common_stats_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/ports/common_stats_str file"); - goto fail; - } - - file_d = debugfs_create_file("type", 0400, edma_port_dir_d, &nss_top_main, &nss_edma_port_type_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/ports/type file"); - goto fail; - } - - file_d = debugfs_create_file("ring_map", 0400, edma_port_dir_d, &nss_top_main, &nss_edma_port_ring_map_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/ports/ring_map file"); - goto fail; - } - - /* - * edma error stats - */ - file_d = debugfs_create_file("err_stats", 0400, edma_d, &nss_top_main, &nss_edma_err_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/err_stats file"); - goto fail; - } - - /* - * edma ring stats - */ - edma_rings_dir_d = debugfs_create_dir("rings", edma_d); - if (!edma_rings_dir_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings directory"); - goto fail; - } - - /* - * edma tx ring stats - */ - edma_tx_dir_d = debugfs_create_dir("tx", edma_rings_dir_d); - if (!edma_tx_dir_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings/tx directory"); - goto fail; - } - - file_d = debugfs_create_file("tx_str", 0400, edma_tx_dir_d, &nss_top_main, &nss_edma_txring_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings/tx file"); - goto fail; - } - - /* - * edma rx ring stats - */ - edma_rx_dir_d = debugfs_create_dir("rx", edma_rings_dir_d); - if (!edma_rx_dir_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings/rx directory"); - goto fail; - } - - file_d = debugfs_create_file("rx_str", 0400, edma_rx_dir_d, &nss_top_main, &nss_edma_rxring_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings/rx file"); - goto fail; - } - - /* - * edma tx cmpl ring stats - */ - edma_txcmpl_dir_d = debugfs_create_dir("txcmpl", edma_rings_dir_d); - if (!edma_txcmpl_dir_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings/txcmpl directory"); - goto fail; - } - - file_d = debugfs_create_file("txcmpl_str", 0400, edma_txcmpl_dir_d, &nss_top_main, &nss_edma_txcmplring_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings/txcmpl file"); - goto fail; - } - - /* - * edma rx fill ring stats - */ - edma_rxfill_dir_d = debugfs_create_dir("rxfill", edma_rings_dir_d); - if (!edma_rxfill_dir_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings/rxfill directory"); - goto fail; - } - - file_d = debugfs_create_file("rxfill_str", 0400, edma_rxfill_dir_d, &nss_top_main, &nss_edma_rxfillring_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/strings/edma/rings/rxfill file"); - goto fail; - } - - return; -fail: - debugfs_remove_recursive(edma_d); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.h deleted file mode 100644 index b211975ff..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_edma_strings.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_EDMA_STRINGS_H -#define __NSS_EDMA_STRINGS_H - -extern struct nss_stats_info nss_edma_strings_stats_node[NSS_STATS_NODE_MAX]; -extern struct nss_stats_info nss_edma_strings_stats_tx[NSS_EDMA_STATS_TX_MAX]; -extern struct nss_stats_info nss_edma_strings_stats_rx[NSS_EDMA_STATS_RX_MAX]; -extern struct nss_stats_info nss_edma_strings_stats_txcmpl[NSS_EDMA_STATS_TXCMPL_MAX]; -extern struct nss_stats_info nss_edma_strings_stats_rxfill[NSS_EDMA_STATS_RXFILL_MAX]; -extern struct nss_stats_info nss_edma_strings_stats_port_type[NSS_EDMA_PORT_TYPE_MAX]; -extern struct nss_stats_info nss_edma_strings_stats_port_ring_map[NSS_EDMA_PORT_RING_MAP_MAX]; -extern struct nss_stats_info nss_edma_strings_stats_err_map[NSS_EDMA_ERR_STATS_MAX]; -extern void nss_edma_strings_dentry_create(void); - -#endif /* __NSS_EDMA_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx.c b/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx.c deleted file mode 100644 index eba62afae..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2017, 2019-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_eth_rx.c - * NSS ETH_RX APIs - */ - -#include -#include "nss_eth_rx_stats.h" -#include "nss_eth_rx_strings.h" - -/* - ********************************** - Rx APIs - ********************************** - */ - -/* - * nss_eth_rx_interface_handler() - * Handle NSS -> HLOS messages for ETH_RX node - */ -static void nss_eth_rx_interface_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_eth_rx_msg *nem = (struct nss_eth_rx_msg *)ncm; - - /* - * Is this a valid request/response packet? - */ - if (nem->cm.type >= NSS_METADATA_TYPE_ETH_RX_MAX) { - nss_warning("%px: received invalid message %d for eth_rx interface", nss_ctx, nem->cm.type); - return; - } - - switch (nem->cm.type) { - case NSS_RX_METADATA_TYPE_ETH_RX_STATS_SYNC: - /* - * Update driver statistics and send stats notifications to the registered modules. - */ - nss_eth_rx_metadata_stats_sync(nss_ctx, &nem->msg.node_sync); - nss_eth_rx_stats_notify(nss_ctx); - break; - - default: - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - /* - * Check response - */ - nss_info("%px: Received response %d for type %d, interface %d", - nss_ctx, ncm->response, ncm->type, ncm->interface); - } - } -} - -/* - * nss_eth_rx_register_handler() - */ -void nss_eth_rx_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_core_register_handler(nss_ctx, NSS_ETH_RX_INTERFACE, nss_eth_rx_interface_handler, NULL); - - nss_eth_rx_stats_dentry_create(); - nss_eth_rx_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_stats.c deleted file mode 100644 index cfc705773..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_stats.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, 2019-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_eth_rx_stats.h" -#include "nss_eth_rx_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_eth_rx_stats_notifier); - -uint64_t nss_eth_rx_stats[NSS_ETH_RX_STATS_MAX]; /* ETH_RX statistics */ -uint64_t nss_eth_rx_exception_stats[NSS_ETH_RX_EXCEPTION_EVENT_MAX]; /* Unknown protocol exception events per interface */ - -/* - * nss_eth_rx_stats_read() - * Read ETH_RX stats. - */ -static ssize_t nss_eth_rx_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * Max output lines = #stats * NSS_MAX_CORES + - * few blank lines for banner printing + Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_ETH_RX_STATS_MAX + NSS_ETH_RX_EXCEPTION_EVENT_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Note: The assumption here is that we do not have more than 64 stats. - */ - stats_shadow = kzalloc(64 * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "eth_rx", NSS_STATS_SINGLE_CORE); - - size_wr += nss_stats_fill_common_stats(NSS_ETH_RX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "eth_rx"); - - /* - * eth_rx node stats. - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_ETH_RX_STATS_MAX); i++) { - stats_shadow[i] = nss_eth_rx_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_print("eth_rx", "eth_rx node stats" - , NSS_STATS_SINGLE_INSTANCE - , nss_eth_rx_strings_stats - , stats_shadow - , NSS_ETH_RX_STATS_MAX - , lbuf, size_wr, size_al); - - /* - * Exception stats. - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_ETH_RX_EXCEPTION_EVENT_MAX); i++) { - stats_shadow[i] = nss_eth_rx_exception_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_print("eth_rx", "eth_rx exception stats" - , NSS_STATS_SINGLE_INSTANCE - , nss_eth_rx_strings_exception_stats - , stats_shadow - , NSS_ETH_RX_EXCEPTION_EVENT_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_eth_rx_stats_ops. - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(eth_rx); - -/* - * nss_eth_rx_stats_dentry_create() - * Create eth_rx statistics debug entry. - */ -void nss_eth_rx_stats_dentry_create(void) -{ - nss_stats_create_dentry("eth_rx", &nss_eth_rx_stats_ops); -} - -/* - * nss_eth_rx_metadata_stats_sync() - * Handle the syncing of ETH_RX node statistics. - */ -void nss_eth_rx_metadata_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_eth_rx_node_sync *nens) -{ - int32_t i; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - spin_lock_bh(&nss_top->stats_lock); - - nss_top->stats_node[NSS_ETH_RX_INTERFACE][NSS_STATS_NODE_RX_PKTS] += nens->node_stats.rx_packets; - nss_top->stats_node[NSS_ETH_RX_INTERFACE][NSS_STATS_NODE_RX_BYTES] += nens->node_stats.rx_bytes; - nss_top->stats_node[NSS_ETH_RX_INTERFACE][NSS_STATS_NODE_TX_PKTS] += nens->node_stats.tx_packets; - nss_top->stats_node[NSS_ETH_RX_INTERFACE][NSS_STATS_NODE_TX_BYTES] += nens->node_stats.tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_top->stats_node[NSS_ETH_RX_INTERFACE][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += nens->node_stats.rx_dropped[i]; - } - - nss_eth_rx_stats[NSS_ETH_RX_STATS_TOTAL_TICKS] += nens->total_ticks; - nss_eth_rx_stats[NSS_ETH_RX_STATS_WORST_CASE_TICKS] += nens->worst_case_ticks; - nss_eth_rx_stats[NSS_ETH_RX_STATS_ITERATIONS] += nens->iterations; - - for (i = 0; i < NSS_ETH_RX_EXCEPTION_EVENT_MAX; i++) { - nss_eth_rx_exception_stats[i] += nens->exception_events[i]; - } - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_eth_rx_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_eth_rx_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_eth_rx_stats_notification eth_rx_stats; - - eth_rx_stats.core_id = nss_ctx->id; - memcpy(eth_rx_stats.cmn_node_stats, nss_top_main.stats_node[NSS_ETH_RX_INTERFACE], sizeof(eth_rx_stats.cmn_node_stats)); - memcpy(eth_rx_stats.special_stats, nss_eth_rx_stats, sizeof(eth_rx_stats.special_stats)); - memcpy(eth_rx_stats.exception_stats, nss_eth_rx_exception_stats, sizeof(eth_rx_stats.exception_stats)); - atomic_notifier_call_chain(&nss_eth_rx_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)ð_rx_stats); -} - -/* - * nss_eth_rx_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_eth_rx_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_eth_rx_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_eth_rx_stats_register_notifier); - -/* - * nss_eth_rx_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_eth_rx_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_eth_rx_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_eth_rx_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_stats.h deleted file mode 100644 index c5470ba9c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_stats.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_ETH_RX_STATS_H -#define __NSS_ETH_RX_STATS_H - -#include - -/* - * nss_eth_rx_stats.h - * NSS driver ETH_RX statistics header file. - */ - -/* - * Request/Response types - */ -enum nss_eth_rx_metadata_types { - NSS_RX_METADATA_TYPE_ETH_RX_STATS_SYNC, - NSS_METADATA_TYPE_ETH_RX_MAX, -}; - -/* - * The NSS eth_rx node stats structure. - */ -struct nss_eth_rx_node_sync { - struct nss_cmn_node_stats node_stats; - /* Common node stats for ETH_RX */ - uint32_t total_ticks; /* Total clock ticks spend inside the eth_rx */ - uint32_t worst_case_ticks; /* Worst case iteration of the eth_rx in ticks */ - uint32_t iterations; /* Number of iterations around the eth_rx */ - uint32_t exception_events[NSS_ETH_RX_EXCEPTION_EVENT_MAX]; - /* Number of ETH_RX exception events */ -}; - -/* - * Message structure to send/receive eth_rx commands - */ -struct nss_eth_rx_msg { - struct nss_cmn_msg cm; /* Message Header */ - union { - struct nss_eth_rx_node_sync node_sync; /* Message: node statistics sync */ - } msg; -}; - -/* - * eth_rx statistics APIs - */ -extern void nss_eth_rx_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_eth_rx_metadata_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_eth_rx_node_sync *nens); -extern void nss_eth_rx_stats_dentry_create(void); - -#endif /* __NSS_ETH_RX_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_strings.c deleted file mode 100644 index 8412b444d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_strings.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" - -/* - * nss_eth_rx_strings_stats - * Ethernet Rx statistics strings. - */ -struct nss_stats_info nss_eth_rx_strings_stats[NSS_ETH_RX_STATS_MAX] = { - {"ticks" , NSS_STATS_TYPE_SPECIAL}, - {"worst_ticks" , NSS_STATS_TYPE_SPECIAL}, - {"iterations" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_eth_rx_strings_exception_stats - * Interface statistics strings for unknown exceptions. - */ -struct nss_stats_info nss_eth_rx_strings_exception_stats[NSS_ETH_RX_EXCEPTION_EVENT_MAX] = { - {"unknown_l3_protocol" , NSS_STATS_TYPE_EXCEPTION}, - {"eth_hdr_missing" , NSS_STATS_TYPE_EXCEPTION}, - {"vlan_missing" , NSS_STATS_TYPE_EXCEPTION}, - {"trustsec_hdr_missing" , NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_eth_rx_special_stats_strings_read() - * Read Ethernet Rx special node statistics names. - */ -static ssize_t nss_eth_rx_special_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_eth_rx_strings_stats, NSS_ETH_RX_STATS_MAX); -} - -/* - * nss_eth_rx_exception_stats_strings_read() - * Read Ethernet Rx exception statistics names. - */ -static ssize_t nss_eth_rx_exception_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_eth_rx_strings_exception_stats, NSS_ETH_RX_EXCEPTION_EVENT_MAX); -} - -/* - * nss_eth_rx_special_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(eth_rx_special_stats); - -/* - * nss_eth_rx_exception_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(eth_rx_exception_stats); - -/* - * nss_eth_rx_strings_dentry_create() - * Create Ethernet Rx statistics strings debug entry. - */ -void nss_eth_rx_strings_dentry_create(void) -{ - struct dentry *eth_rx_d = NULL; - struct dentry *eth_rx_spcl_stats_d = NULL; - struct dentry *eth_rx_excp_stats_d = NULL; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - eth_rx_d = debugfs_create_dir("eth_rx", nss_top_main.strings_dentry); - if (!eth_rx_d) { - nss_warning("Failed to create qca-nss-drv/strings/eth_rx directory"); - return; - } - - eth_rx_spcl_stats_d = debugfs_create_file("special_stats_str", 0400, eth_rx_d, &nss_top_main, &nss_eth_rx_special_stats_strings_ops); - if (!eth_rx_spcl_stats_d) { - nss_warning("Failed to create qca-nss-drv/stats/eth_rx/special_stats_str file"); - debugfs_remove_recursive(eth_rx_d); - return; - } - - eth_rx_excp_stats_d = debugfs_create_file("exception_stats_str", 0400, eth_rx_d, &nss_top_main, &nss_eth_rx_exception_stats_strings_ops); - if (!eth_rx_excp_stats_d) { - nss_warning("Failed to create qca-nss-drv/stats/eth_rx/exception_stats_str file"); - debugfs_remove_recursive(eth_rx_d); - return; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_strings.h deleted file mode 100644 index 2f40440f3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_eth_rx_strings.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_ETH_RX_STRINGS_H -#define __NSS_ETH_RX_STRINGS_H - -extern struct nss_stats_info nss_eth_rx_strings_stats[NSS_ETH_RX_STATS_MAX]; -extern struct nss_stats_info nss_eth_rx_strings_exception_stats[NSS_ETH_RX_EXCEPTION_EVENT_MAX]; -extern void nss_eth_rx_strings_dentry_create(void); - -#endif /* __NSS_ETH_RX_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_freq.c b/feeds/ipq807x/qca-nss-drv/src/nss_freq.c deleted file mode 100644 index d55bd63b6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_freq.c +++ /dev/null @@ -1,467 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013, 2015-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_freq.c - * NSS frequency change APIs - */ - -#include "nss_stats.h" -#include "nss_tx_rx_common.h" -#include "nss_freq_log.h" -#include "nss_freq_stats.h" - -#define NSS_ACK_STARTED 0 -#define NSS_ACK_FINISHED 1 - -#define NSS_FREQ_USG_AVG_FREQUENCY 1000 /* Time in ms over which CPU Usage is averaged */ -#define NSS_FREQ_CPU_USAGE_MAX_BOUND 75 /* MAX CPU usage equivalent to running max instructions excluding all the hazards */ -#define NSS_FREQ_CPU_USAGE_MAX 100 /* MAX CPU usage equivalent to running max instructions including all the hazards. - This is also the ideal maximum usage value. */ - -/* - * Spinlock to protect the global data structure nss_freq_cpu_status - */ -DEFINE_SPINLOCK(nss_freq_cpu_usage_lock); - -/* - * At any point, this object has the latest data about CPU utilization. - */ -struct nss_freq_cpu_usage nss_freq_cpu_status; - -extern struct nss_runtime_sampling nss_runtime_samples; -extern struct workqueue_struct *nss_wq; -extern nss_work_t *nss_work; - -/* - * nss_freq_msg_init() - * Initialize the freq message - */ -static void nss_freq_msg_init(struct nss_corefreq_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, - void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} - -/* - * nss_freq_handle_ack() - * Handle the nss ack of frequency change. - */ -static void nss_freq_handle_ack(struct nss_ctx_instance *nss_ctx, struct nss_freq_msg *nfa) -{ - if (nfa->ack == NSS_ACK_STARTED) { - /* - * NSS finished start noficiation - HW change clocks and send end notification - */ - nss_info("%px: NSS ACK Received: %d - Change HW CLK/Send Finish to NSS\n", nss_ctx, nfa->ack); - - return; - } - - if (nfa->ack == NSS_ACK_FINISHED) { - /* - * NSS finished end notification - Done - */ - nss_info("%px: NSS ACK Received: %d - End Notification ACK - Running: %dmhz\n", nss_ctx, nfa->ack, nfa->freq_current); - nss_runtime_samples.freq_scale_ready = 1; - return; - } - - nss_info("%px: NSS had an error - Running: %dmhz\n", nss_ctx, nfa->freq_current); -} - -/* - * nss_freq_queue_work() - * Queue Work to the NSS Workqueue based on Current index. - */ -static bool nss_freq_queue_work(void) -{ - nss_freq_scales_t index = nss_runtime_samples.freq_scale_index; - - BUG_ON(!nss_wq); - - nss_info("frequency:%d index:%d sample count:%x\n", nss_runtime_samples.freq_scale[index].frequency, - index, nss_runtime_samples.average); - - /* - * schedule freq change with autoscale ON - */ - return nss_freq_sched_change(index, true); -} - -/* - * nss_freq_get_cpu_usage() - * Returns the CPU usage value in percentage at any instance for a required core. Returns -1 in case of an error. - * - * Calculation frequency is 1 second. Range of usage is 0-100. This API returns -1 if CPU usage is requested for core 1. - * TODO: Extend this API to get CPU usage for core 1. - */ -int8_t nss_freq_get_cpu_usage(uint32_t core_id) -{ - int8_t usage; - - if (core_id == 0) { - spin_lock_bh(&nss_freq_cpu_usage_lock); - usage = nss_freq_cpu_status.used; - spin_unlock_bh(&nss_freq_cpu_usage_lock); - - return usage; - } - - nss_warning("CPU usage functionality is not supported for core %u\n", core_id); - return -1; -} - -/* - * nss_freq_compute_cpu_usage() - * Computes the CPU utilization and maximum-minumun cpu utilization since boot. - */ -static void nss_freq_compute_cpu_usage(struct nss_ctx_instance *nss_ctx, uint32_t inst_cnt) -{ - uint32_t estimated_ins_capacity; - uint8_t actual_usage; - uint8_t usage; - - spin_lock_bh(&nss_freq_cpu_usage_lock); - - /* - * If actual CPU usage turns up higher than 100, there is something wrong with the received data. - * Upper bound average varies between 80% usage to 100% usage. - * - * TODO: To improve estimation algorithm for calculating how many actual instructions are executed. - */ - actual_usage = (inst_cnt * 100) / nss_freq_cpu_status.max_ins; - if ((actual_usage > NSS_FREQ_CPU_USAGE_MAX) || (actual_usage == 0)) { - spin_unlock_bh(&nss_freq_cpu_usage_lock); - return; - } - - /* - * Simpler version of below math: This is calculating the reduced number of maximum instructions - * estimated_ins_capacity = nss_freq_cpu_status.avg_up% of nss_freq_cpu_status.max_ins - * Calculating usage percentage: usage = (inst_cnt/estimated_ins_capacity) * 100 - */ - estimated_ins_capacity = ((NSS_FREQ_CPU_USAGE_MAX_BOUND * nss_freq_cpu_status.max_ins) / 100); - if (estimated_ins_capacity == 0) { - spin_unlock_bh(&nss_freq_cpu_usage_lock); - return; - } - usage = (inst_cnt * 100) / estimated_ins_capacity; - - /* - * Average the instructions over NSS_FREQ_USG_AVG_FREQUENCY ms - */ - if (nss_freq_cpu_status.avg_ctr == NSS_FREQ_USG_AVG_FREQUENCY) { - nss_freq_cpu_status.used = nss_freq_cpu_status.total / NSS_FREQ_USG_AVG_FREQUENCY; - - /* - * Due to our estimation, this could go beyond the end limit of 100% - */ - if (nss_freq_cpu_status.used > NSS_FREQ_CPU_USAGE_MAX) { - nss_freq_cpu_status.used = NSS_FREQ_CPU_USAGE_MAX; - } - - /* - * Getting the all time max and min usage - */ - if (nss_freq_cpu_status.used > nss_freq_cpu_status.max) { - nss_freq_cpu_status.max = nss_freq_cpu_status.used; - } - - if (nss_freq_cpu_status.used < nss_freq_cpu_status.min) { - nss_freq_cpu_status.min = nss_freq_cpu_status.used; - } - - nss_trace("%px: max_instructions:%d cpu_usage:%d max_usage:%d min_usage:%d\n", nss_ctx, - nss_freq_cpu_status.max_ins, nss_freq_cpu_status.used, nss_freq_cpu_status.max, nss_freq_cpu_status.min); - - nss_freq_cpu_status.total = 0; - nss_freq_cpu_status.avg_ctr = 0; - } - - nss_freq_cpu_status.total += usage; - nss_freq_cpu_status.avg_ctr++; - - spin_unlock_bh(&nss_freq_cpu_usage_lock); -} - -/* - * nss_freq_scale_frequency() - * Frequency scaling algorithm to scale frequency. - */ -void nss_freq_scale_frequency(struct nss_ctx_instance *nss_ctx, uint32_t inst_cnt) -{ - uint32_t b_index; - uint32_t minimum; - uint32_t maximum; - uint32_t index = nss_runtime_samples.freq_scale_index; - - /* - * We do not accept any statistics if auto scaling is off, - * we start with a fresh sample set when scaling is - * eventually turned on. - */ - if (!nss_cmd_buf.auto_scale && nss_runtime_samples.initialized) { - return; - } - - /* - * Delete Current Index Value, Add New Value, Recalculate new Sum, Shift Index - */ - b_index = nss_runtime_samples.buffer_index; - - nss_runtime_samples.sum = nss_runtime_samples.sum - nss_runtime_samples.buffer[b_index]; - nss_runtime_samples.buffer[b_index] = inst_cnt; - nss_runtime_samples.sum = nss_runtime_samples.sum + nss_runtime_samples.buffer[b_index]; - nss_runtime_samples.buffer_index = (b_index + 1) & NSS_SAMPLE_BUFFER_MASK; - - if (nss_runtime_samples.sample_count < NSS_SAMPLE_BUFFER_SIZE) { - nss_runtime_samples.sample_count++; - - /* - * Samples Are All Ready, Start Auto Scale - */ - if (nss_runtime_samples.sample_count == NSS_SAMPLE_BUFFER_SIZE ) { - nss_cmd_buf.auto_scale = 1; - nss_runtime_samples.freq_scale_ready = 1; - nss_runtime_samples.initialized = 1; - } - - return; - } - - nss_runtime_samples.average = nss_runtime_samples.sum / nss_runtime_samples.sample_count; - - /* - * Print out statistics every 10 samples - */ - if (nss_runtime_samples.message_rate_limit++ >= NSS_MESSAGE_RATE_LIMIT) { - nss_trace("%px: Running AVG:%x Sample:%x Divider:%d\n", nss_ctx, nss_runtime_samples.average, inst_cnt, nss_runtime_samples.sample_count); - nss_trace("%px: Current Frequency Index:%d\n", nss_ctx, index); - nss_trace("%px: Auto Scale Ready:%d Auto Scale:%d\n", nss_ctx, nss_runtime_samples.freq_scale_ready, nss_cmd_buf.auto_scale); - nss_trace("%px: Current Rate:%x\n", nss_ctx, nss_runtime_samples.average); - - nss_runtime_samples.message_rate_limit = 0; - } - - /* - * Don't scale if we are not ready or auto scale is disabled. - */ - if ((nss_runtime_samples.freq_scale_ready != 1) || (nss_cmd_buf.auto_scale != 1)) { - return; - } - - /* - * Scale Algorithmn - * Algorithmn will limit how fast it will transition each scale, by the number of samples seen. - * If any sample is out of scale during the idle count, the rate_limit will reset to 0. - * Scales are limited to the max number of cpu scales we support. - */ - if (nss_runtime_samples.freq_scale_rate_limit_up++ >= NSS_FREQUENCY_SCALE_RATE_LIMIT_UP) { - maximum = nss_runtime_samples.freq_scale[index].maximum; - if ((nss_runtime_samples.average > maximum) && (index < (NSS_FREQ_MAX_SCALE - 1))) { - nss_runtime_samples.freq_scale_index++; - nss_runtime_samples.freq_scale_ready = 0; - - /* - * If fail to increase frequency, decrease index - */ - nss_trace("frequency increase to %d inst:%x > maximum:%x\n", nss_runtime_samples.freq_scale[nss_runtime_samples.freq_scale_index].frequency, inst_cnt, maximum); - if (!nss_freq_queue_work()) { - nss_runtime_samples.freq_scale_index--; - } - } - - /* - * Reset the down scale counter based on running average, so can idle properly - */ - if (nss_runtime_samples.average > maximum) { - nss_trace("down scale timeout reset running average:%x\n", nss_runtime_samples.average); - nss_runtime_samples.freq_scale_rate_limit_down = 0; - } - - nss_runtime_samples.freq_scale_rate_limit_up = 0; - return; - } - - if (nss_runtime_samples.freq_scale_rate_limit_down++ >= NSS_FREQUENCY_SCALE_RATE_LIMIT_DOWN) { - minimum = nss_runtime_samples.freq_scale[index].minimum; - - /* - * Check if we need to lower the frequency. For some SoC like IPQ50xx, low frequency - * is not supported. So check if the next lower frequency is configured before shifting down - */ - if ((nss_runtime_samples.average < minimum) && (index > 0) && nss_runtime_samples.freq_scale[index - 1].maximum) { - nss_runtime_samples.freq_scale_index--; - nss_runtime_samples.freq_scale_ready = 0; - - /* - * If fail to decrease frequency, increase index - */ - nss_trace("frequency decrease to %d inst:%x < minumum:%x\n", nss_runtime_samples.freq_scale[nss_runtime_samples.freq_scale_index].frequency, nss_runtime_samples.average, minimum); - if (!nss_freq_queue_work()) { - nss_runtime_samples.freq_scale_index++; - } - } - nss_runtime_samples.freq_scale_rate_limit_down = 0; - return; - } -} - -/* - * nss_freq_handle_core_stats() - * Handle the core stats. - */ -static void nss_freq_handle_core_stats(struct nss_ctx_instance *nss_ctx, struct nss_core_stats *core_stats) -{ - uint32_t inst_cnt = core_stats->inst_cnt_total; - - /* - * compute CPU utilization by using the instruction count - */ - nss_freq_compute_cpu_usage(nss_ctx, inst_cnt); - - /* - * Perform frequency scaling - */ - nss_freq_scale_frequency(nss_ctx, inst_cnt); -} - -/* - * nss_freq_interface_handler() - * Handle NSS -> HLOS messages for Frequency Changes and Statistics. - */ -static void nss_freq_interface_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) { - - struct nss_corefreq_msg *ncfm = (struct nss_corefreq_msg *)ncm; - - /* - * Trace Messages - */ - nss_freq_log_rx_msg(ncfm); - - switch (ncfm->cm.type) { - case COREFREQ_METADATA_TYPE_TX_FREQ_ACK: - nss_freq_handle_ack(nss_ctx, &ncfm->msg.nfc); - break; - case COREFREQ_METADATA_TYPE_TX_CORE_STATS: - nss_freq_handle_core_stats(nss_ctx, &ncfm->msg.ncs); - break; - - default: - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - /* - * Check response - */ - nss_info("%px: Received response %d for type %d, interface %d", nss_ctx, ncm->response, ncm->type, ncm->interface); - } - } -} - -/* - * nss_freq_change() - * NSS frequency change API. - */ -nss_tx_status_t nss_freq_change(struct nss_ctx_instance *nss_ctx, uint32_t eng, uint32_t stats_enable, uint32_t start_or_end) -{ - struct nss_corefreq_msg ncm; - struct nss_freq_msg *nfc; - - nss_info("%px: frequency changing to: %d\n", nss_ctx, eng); - - /* - * Update the max instruction count for a frequency during down scaling. - * Better to update this as late as possible in the frequency update call. - */ - spin_lock_bh(&nss_freq_cpu_usage_lock); - nss_freq_cpu_status.max_ins = eng / 1000; - spin_unlock_bh(&nss_freq_cpu_usage_lock); - - nss_freq_msg_init(&ncm, NSS_COREFREQ_INTERFACE, NSS_TX_METADATA_TYPE_NSS_FREQ_CHANGE, - sizeof(struct nss_freq_msg), NULL, NULL); - nfc = &ncm.msg.nfc; - nfc->frequency = eng; - nfc->start_or_end = start_or_end; - nfc->stats_enable = stats_enable; - - return nss_core_send_cmd(nss_ctx, &ncm, sizeof(ncm), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_freq_sched_change() - * Schedule a frequency work. - */ -bool nss_freq_sched_change(nss_freq_scales_t index, bool auto_scale) -{ - if (index >= NSS_FREQ_MAX_SCALE) { - nss_info("NSS freq scale beyond limit\n"); - return false; - } - - nss_work = (nss_work_t *)kmalloc(sizeof(nss_work_t), GFP_ATOMIC); - if (!nss_work) { - nss_info("NSS Freq WQ kmalloc fail"); - return false; - } - - INIT_WORK((struct work_struct *)nss_work, nss_hal_wq_function); - - nss_work->frequency = nss_runtime_samples.freq_scale[index].frequency; - - nss_work->stats_enable = auto_scale; - nss_cmd_buf.current_freq = nss_work->frequency; - queue_work(nss_wq, (struct work_struct *)nss_work); - - return true; -} - -/* - * nss_freq_get_context() - * Get NSS context instance for frequency. - */ -struct nss_ctx_instance *nss_freq_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.frequency_handler_id]; -} -EXPORT_SYMBOL(nss_freq_get_context); - -/* - * nss_freq_register_handler() - */ -void nss_freq_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_freq_get_context(); - nss_core_register_handler(nss_ctx, NSS_COREFREQ_INTERFACE, nss_freq_interface_handler, NULL); -} - -/* - * nss_freq_cpu_usage_init() - * Initialize cpu usage computing. - * - * TODO: Add support to retrieve CPU usage even if frequency scaling is disabled. - */ -void nss_freq_init_cpu_usage(void) -{ - nss_freq_cpu_status.used = 0; - nss_freq_cpu_status.max_ins = nss_runtime_samples.freq_scale[nss_runtime_samples.freq_scale_index].frequency / 1000; - nss_freq_cpu_status.total = 0; - nss_freq_cpu_status.max = 0; /* Initial value is 0 to capture the highest most value during the run */ - nss_freq_cpu_status.min = NSS_FREQ_CPU_USAGE_MAX; /* Initial value is 100 to capture the lowest most value during the run */ - nss_freq_cpu_status.avg_up = NSS_FREQ_CPU_USAGE_MAX_BOUND; - nss_freq_cpu_status.avg_ctr = 0; - - nss_freq_stats_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_freq_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_freq_log.c deleted file mode 100644 index 9b96184cd..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_freq_log.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_freq_log.c - * NSS Freq logger file. - */ - -#include "nss_core.h" - -/* - * nss_freq_log_message_types_str - * Freq message strings - */ -static int8_t *nss_freq_log_message_types_str[COREFREQ_METADATA_TYPE_MAX] __maybe_unused = { - "Freq Error Message", - "Freq Change", - "Freq ACK", - "TX Core Stats", -}; - -/* - * nss_freq_log_msg() - * Log NSS Freq message. - */ -static void nss_freq_log_msg(struct nss_corefreq_msg *ncm) -{ - struct nss_freq_msg *nfm __maybe_unused = &ncm->msg.nfc; - nss_trace("%px: NSS Freq Message:\n" - "Frequency request: %d\n" - "Frequency start/end: %d\n" - "Frequency stats enable: %d\n" - "Current Frequency: %d\n" - "Frequency ACK: %d\n", - nfm, nfm->frequency, nfm->start_or_end, - nfm->stats_enable, nfm->freq_current, - nfm->ack); -} - -/* - * nss_freq_log_verbose() - * Log message contents. - */ -static void nss_freq_log_verbose(struct nss_corefreq_msg *ncm) -{ - switch (ncm->cm.type) { - case COREFREQ_METADATA_TYPE_RX_FREQ_CHANGE: - case COREFREQ_METADATA_TYPE_TX_FREQ_ACK: - nss_freq_log_msg(ncm); - break; - - case COREFREQ_METADATA_TYPE_TX_CORE_STATS: - /* - * No log for a valid stats message. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", ncm); - break; - } -} - -/* - * nss_freq_log_rx_msg() - * Log messages received from FW. - */ -void nss_freq_log_rx_msg(struct nss_corefreq_msg *ncm) -{ - if (ncm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ncm); - return; - } - - if (ncm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ncm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d], response[%d]:%s\n", ncm, ncm->cm.type, - ncm->cm.response, nss_cmn_response_str[ncm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - ncm, ncm->cm.type, nss_freq_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response]); - -verbose: - nss_freq_log_verbose(ncm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_freq_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_freq_log.h deleted file mode 100644 index ab7d7d4f6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_freq_log.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_FREQ_LOG_H -#define __NSS_FREQ_LOG_H - -/* - * nss_freq_log.h - * NSS frequency log header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_freq_log_rx_msg - * Logs a frequency message that is received from the NSS firmware. - */ -void nss_freq_log_rx_msg(struct nss_corefreq_msg *nbm); - -#endif /* __NSS_FREQ_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_freq_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_freq_stats.c deleted file mode 100644 index 32e62c3c6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_freq_stats.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_freq_stats.c - * NSS Frequency statistics APIs. - */ - -#include "nss_stats.h" -#include "nss_tx_rx_common.h" - -/* - * At any point, this object has the latest data about CPU utilization. - */ -extern struct nss_freq_cpu_usage nss_freq_cpu_status; - -/* - * Spinlock to protect the global data structure nss_freq_cpu_status - */ -extern spinlock_t nss_freq_cpu_usage_lock; - -/* - * nss_freq_stats_read() - * Read frequency stats and display CPU information. - */ -static ssize_t nss_freq_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * max output lines = Should change in case of number of lines below. - */ - uint32_t max_output_lines = (2 + 3) + 5; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint32_t avg, max, min; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - size_wr = scnprintf(lbuf, size_al, "CPU Utilization:\n"); - - spin_lock_bh(&nss_freq_cpu_usage_lock); - avg = nss_freq_cpu_status.used; - max = nss_freq_cpu_status.max; - min = nss_freq_cpu_status.min; - spin_unlock_bh(&nss_freq_cpu_usage_lock); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "Note: Averaged over 1 second\n\n"); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "Core 0:\n"); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "Min\tAvg\tMax\n"); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " %u%%\t %u%%\t %u%%\n\n", min, avg, max); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - - return bytes_read; -} - -/* - * nss_freq_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(freq) - -/* - * nss_freq_dentry_create() - */ -void nss_freq_stats_dentry_create(void) -{ - nss_stats_create_dentry("cpu_load_ubi", &nss_freq_stats_ops); -} \ No newline at end of file diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_freq_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_freq_stats.h deleted file mode 100644 index 72e00cc86..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_freq_stats.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -/* - * nss_freq_stats.h - * NSS Frequency statistics header file. - */ - -#ifndef __NSS_FREQ_STATS_H -#define __NSS_FREQ_STATS_H - -#include "nss_core.h" - -extern void nss_freq_stats_dentry_create(void); - -#endif /* __NSS_FREQ_STATS_H */ \ No newline at end of file diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gmac_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gmac_stats.c deleted file mode 100644 index 23f5924e2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gmac_stats.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_gmac_stats.h" - -/* - * nss_gmac_stats_str - * GMAC stats strings. - */ -struct nss_stats_info nss_gmac_stats_str[NSS_GMAC_STATS_MAX] = { - {"ticks" , NSS_STATS_TYPE_SPECIAL}, - {"worst_ticks" , NSS_STATS_TYPE_SPECIAL}, - {"iterations" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_gmac_stats_read() - * Read GMAC stats. - */ -ssize_t nss_gmac_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - uint32_t i, id; - - /* - * max output lines = ((#stats + start tag + one blank) * #GMACs) Number of Extra outputlines for future - * reference to add new stats + start/end tag + 3 blank - */ - uint32_t max_output_lines = NSS_GMAC_STATS_MAX * NSS_MAX_PHYSICAL_INTERFACES + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_GMAC_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gmac", NSS_STATS_SINGLE_CORE); - - for (id = 0; id < NSS_MAX_PHYSICAL_INTERFACES; id++) { - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_GMAC_STATS_MAX); i++) { - stats_shadow[i] = nss_top_main.stats_gmac[id][i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("gmac", "gmac stats", id - , nss_gmac_stats_str - , stats_shadow - , NSS_GMAC_STATS_MAX - , lbuf, size_wr, size_al); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\ngmac stats end\n\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gmac_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gmac_stats.h deleted file mode 100644 index 646143ed0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gmac_stats.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_GMAC_STATS_H -#define __NSS_GMAC_STATS_H - -#include - -/* - * GMAC node statistics - */ -enum nss_stats_gmac { - NSS_GMAC_STATS_TOTAL_TICKS, /* Total clock ticks spend inside the GMAC */ - NSS_GMAC_STATS_WORST_CASE_TICKS, /* Worst case iteration of the GMAC in ticks */ - NSS_GMAC_STATS_ITERATIONS, /* Number of iterations around the GMAC */ - NSS_GMAC_STATS_MAX, -}; - -extern ssize_t nss_gmac_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos); -#endif /* __NSS_GMAC_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre.c deleted file mode 100644 index 46cd72c71..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre.c +++ /dev/null @@ -1,411 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_gre_stats.h" -#include "nss_gre_log.h" -#include "nss_gre_strings.h" - -#define NSS_GRE_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Private data structure - */ -static struct { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} nss_gre_pvt; - -/* - * TODO: Register separate callbacks for inner and outer GRE nodes. - */ -static atomic64_t pkt_cb_addr = ATOMIC64_INIT(0); - -/* - * nss_gre_inner_rx_handler() - * GRE inner rx handler. - */ -static void nss_gre_inner_rx_handler(struct net_device *dev, struct sk_buff *skb, - __attribute__((unused)) struct napi_struct *napi) -{ - nss_gre_data_callback_t cb; - - nss_gre_pkt_callback_t scb = (nss_gre_pkt_callback_t)(unsigned long)atomic64_read(&pkt_cb_addr); - if (unlikely(scb)) { - struct nss_gre_info *info = (struct nss_gre_info *)netdev_priv(dev); - if (likely(info->next_dev_inner)) { - scb(info->next_dev_inner, skb); - } - } - - cb = nss_top_main.gre_inner_data_callback; - cb(dev, skb, 0); -} - -/* - * nss_gre_outer_rx_handler() - * GRE outer rx handler. - */ -static void nss_gre_outer_rx_handler(struct net_device *dev, struct sk_buff *skb, - __attribute__((unused)) struct napi_struct *napi) -{ - nss_gre_data_callback_t cb; - - nss_gre_pkt_callback_t scb = (nss_gre_pkt_callback_t)(unsigned long)atomic64_read(&pkt_cb_addr); - if (unlikely(scb)) { - struct nss_gre_info *info = (struct nss_gre_info *)netdev_priv(dev); - if (likely(info->next_dev_outer)) { - scb(info->next_dev_outer, skb); - } - } - - cb = nss_top_main.gre_outer_data_callback; - cb(dev, skb, 0); -} - -/* - * nss_gre_msg_handler() - * Handle NSS -> HLOS messages for GRE - */ -static void nss_gre_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_gre_msg *ntm = (struct nss_gre_msg *)ncm; - void *ctx; - - nss_gre_msg_callback_t cb; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - BUG_ON(!(nss_is_dynamic_interface(ncm->interface) || ncm->interface == NSS_GRE_INTERFACE)); - - /* - * Trace Messages - */ - nss_gre_log_rx_msg(ntm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_GRE_MSG_MAX) { - nss_warning("%px: received invalid message %d for GRE STD interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_gre_msg)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return; - } - - switch (ntm->cm.type) { - case NSS_GRE_MSG_SESSION_STATS: - /* - * debug stats embedded in stats msg - */ - nss_gre_stats_session_sync(nss_ctx, &ntm->msg.sstats, ncm->interface); - nss_gre_stats_session_notify(nss_ctx, ncm->interface); - break; - - case NSS_GRE_MSG_BASE_STATS: - nss_gre_stats_base_sync(nss_ctx, &ntm->msg.bstats); - nss_gre_stats_base_notify(nss_ctx); - break; - - default: - break; - - } - - /* - * Update the callback and app_data for NOTIFY messages, gre sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->gre_msg_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * callback - */ - cb = (nss_gre_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call gre-std callback - */ - if (!cb) { - nss_warning("%px: No callback for gre-std interface %d", - nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_gre_callback() - * Callback to handle the completion of HLOS-->NSS messages. - */ -static void nss_gre_callback(void *app_data, struct nss_gre_msg *nim) -{ - nss_gre_msg_callback_t callback = (nss_gre_msg_callback_t)nss_gre_pvt.cb; - void *data = nss_gre_pvt.app_data; - - nss_gre_pvt.cb = NULL; - nss_gre_pvt.app_data = NULL; - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("gre Error response %d\n", nim->cm.response); - nss_gre_pvt.response = NSS_TX_FAILURE; - } else { - nss_gre_pvt.response = NSS_TX_SUCCESS; - } - - if (callback) { - callback(data, nim); - } - - complete(&nss_gre_pvt.complete); -} - -/* - * nss_gre_register_pkt_callback() - * Register for data callback. - */ -void nss_gre_register_pkt_callback(nss_gre_pkt_callback_t cb) -{ - atomic64_set(&pkt_cb_addr, (unsigned long)cb); -} -EXPORT_SYMBOL(nss_gre_register_pkt_callback); - -/* - * nss_gre_unregister_pkt_callback() - * Unregister for data callback. - */ -void nss_gre_unregister_pkt_callback() -{ - atomic64_set(&pkt_cb_addr, 0); -} -EXPORT_SYMBOL(nss_gre_unregister_pkt_callback); - -/* - * nss_gre_tx_msg() - * Transmit a GRE message to NSS firmware - */ -nss_tx_status_t nss_gre_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Sanity check the message - */ - if (!nss_is_dynamic_interface(ncm->interface)) { - nss_warning("%px: tx request for non dynamic interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_GRE_MSG_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace Messages - */ - nss_gre_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_gre_tx_msg); - -/* - * nss_gre_tx_msg_sync() - * Transmit a GRE message to NSS firmware synchronously. - */ -nss_tx_status_t nss_gre_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_msg *msg) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_gre_pvt.sem); - nss_gre_pvt.cb = (void *)msg->cm.cb; - nss_gre_pvt.app_data = (void *)msg->cm.app_data; - - msg->cm.cb = (nss_ptr_t)nss_gre_callback; - msg->cm.app_data = (nss_ptr_t)NULL; - - status = nss_gre_tx_msg(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: gre_tx_msg failed\n", nss_ctx); - up(&nss_gre_pvt.sem); - return status; - } - ret = wait_for_completion_timeout(&nss_gre_pvt.complete, msecs_to_jiffies(NSS_GRE_TX_TIMEOUT)); - - if (!ret) { - nss_warning("%px: GRE STD tx sync failed due to timeout\n", nss_ctx); - nss_gre_pvt.response = NSS_TX_FAILURE; - } - - status = nss_gre_pvt.response; - up(&nss_gre_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_gre_tx_msg_sync); - -/* - * nss_gre_tx_buf() - * Send packet to GRE interface owned by NSS - */ -nss_tx_status_t nss_gre_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb) -{ - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER | H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_gre_tx_buf); - -/* - *********************************** - * Register/Unregister/Miscellaneous APIs - *********************************** - */ - -/* - * nss_gre_register_if() - * Register data and message handlers for GRE. - */ -struct nss_ctx_instance *nss_gre_register_if(uint32_t if_num, uint32_t type, nss_gre_data_callback_t data_callback, - nss_gre_msg_callback_t event_callback, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_handler_id]; - - nss_assert(nss_ctx); - nss_assert(nss_is_dynamic_interface(if_num)); - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_INNER: - nss_core_register_subsys_dp(nss_ctx, if_num, nss_gre_inner_rx_handler, NULL, netdev, netdev, features); - nss_top_main.gre_inner_data_callback = data_callback; - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_OUTER: - nss_core_register_subsys_dp(nss_ctx, if_num, nss_gre_outer_rx_handler, NULL, netdev, netdev, features); - nss_top_main.gre_outer_data_callback = data_callback; - break; - - default: - nss_warning("%px: Unable to register. Wrong interface type %d\n", nss_ctx, type); - return NULL; - } - - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); - - nss_top_main.gre_msg_callback = event_callback; - - nss_core_register_handler(nss_ctx, if_num, nss_gre_msg_handler, NULL); - - nss_gre_stats_session_register(if_num, netdev); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_gre_register_if); - -/* - * nss_gre_unregister_if() - * Unregister data and message handler. - */ -void nss_gre_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_handler_id]; - struct net_device *dev; - - nss_assert(nss_ctx); - nss_assert(nss_is_dynamic_interface(if_num)); - - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!dev) { - nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); - return; - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - nss_core_set_subsys_dp_type(nss_ctx, dev, if_num, NSS_DYNAMIC_INTERFACE_TYPE_NONE); - nss_top_main.gre_msg_callback = NULL; - - nss_core_unregister_handler(nss_ctx, if_num); - - nss_gre_stats_session_unregister(if_num); -} -EXPORT_SYMBOL(nss_gre_unregister_if); - -/* - * nss_get_gre_context() - */ -struct nss_ctx_instance *nss_gre_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_handler_id]; -} -EXPORT_SYMBOL(nss_gre_get_context); - -/* - * nss_gre_ifnum_with_core_id() - * Append core id to GRE interface num. - */ -int nss_gre_ifnum_with_core_id(int if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_gre_get_context(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (!nss_is_dynamic_interface(if_num)) { - nss_warning("%px: Invalid if_num: %d, must be a dynamic interface\n", nss_ctx, if_num); - return 0; - } - - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_gre_ifnum_with_core_id); - -/* - * nss_gre_msg_init() - * Initialize nss_gre msg. - */ -void nss_gre_msg_init(struct nss_gre_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_gre_msg_init); - -/* - * nss_gre_register_handler() - * debugfs stats msg handler received on static gre interface - */ -void nss_gre_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_gre_get_context(); - - nss_info("nss_gre_register_handler"); - sema_init(&nss_gre_pvt.sem, 1); - init_completion(&nss_gre_pvt.complete); - nss_core_register_handler(nss_ctx, NSS_GRE_INTERFACE, nss_gre_msg_handler, NULL); - nss_gre_stats_dentry_create(); - nss_gre_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_log.c deleted file mode 100644 index c2f752ba5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_log.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_gre_log.c - * NSS GRE logger file. - */ - -#include "nss_core.h" - -#define NSS_GRE_LOG_MESSAGE_TYPE_INDEX(type) ((type) - NSS_IF_MAX_MSG_TYPES - 1) - -/* - * nss_gre_log_message_types_str - * NSS GRE message strings - */ -static int8_t *nss_gre_log_message_types_str[NSS_GRE_MSG_MAX] __maybe_unused = { - "GRE Message Configure", - "GRE Message Deconfigure", - "GRE Session Stats", - "GRE Base Stats" -}; - -/* - * nss_gre_log_config_msg() - * Log NSS GRE Config message. - */ -static void nss_gre_log_config_msg(struct nss_gre_msg *ngm) -{ - struct nss_gre_config_msg *ngcm __maybe_unused = &ngm->msg.cmsg; - nss_trace("%px: NSS GRE Config message\n" - "GRE flags: %d\n" - "GRE ikey: %d\n" - "GRE okey: %d\n" - "GRE mode: %d\n" - "GRE ip type: %d\n" - "GRE interface number: %d\n" - "GRE Src MAC: %pM\n" - "GRE Dst MAC: %pM\n" - "GRE ttl: %d\n" - "GRE tos: %d\n" - "GRE metadata size: %d\n", - ngcm, ngcm->flags, ngcm->ikey, ngcm->okey, - ngcm->mode, ngcm->ip_type, ngcm->next_node_if_num, - ngcm->src_mac, ngcm->dest_mac, ngcm->ttl, ngcm->tos, - ngcm->metadata_size); - /* - * Continuation of the log message. Different identifiers based on IP type. - */ - if (ngcm->ip_type == NSS_GRE_IP_IPV6) { - nss_trace("GRE Source IP: %pI6\n" - "GRE Dest IP: %pI6\n", - ngcm->src_ip, ngcm->dest_ip); - } else { - nss_trace("GRE Source IP: %pI4\n" - "GRE Dest IP: %pI4\n", - ngcm->src_ip, ngcm->dest_ip); - } -} - -/* - * nss_gre_log_deconfig_msg() - * Log NSS GRE deconfig message. - */ -static void nss_gre_log_deconfig_msg(struct nss_gre_msg *ngm) -{ - struct nss_gre_deconfig_msg *ngdm __maybe_unused = &ngm->msg.dmsg; - nss_trace("%px: NSS GRE deconfig message\n" - "GRE interface number: %d\n", - ngdm, ngdm->if_number); -} - -/* - * nss_gre_log_linkup_msg() - * Log NSS GRE linkup message. - */ -static void nss_gre_log_linkup_msg(struct nss_gre_msg *ngm) -{ - struct nss_gre_linkup_msg *nglm __maybe_unused = &ngm->msg.linkup; - nss_trace("%px: NSS GRE linkup message\n" - "GRE interface number: %d\n", - nglm, nglm->if_number); -} - -/* - * nss_gre_log_linkdown_msg() - * Log NSS GRE linkdown message. - */ -static void nss_gre_log_linkdown_msg(struct nss_gre_msg *ngm) -{ - struct nss_gre_linkdown_msg *ngdm __maybe_unused = &ngm->msg.linkdown; - nss_trace("%px: NSS GRE linkdown message\n" - "GRE interface number: %d\n", - ngdm, ngdm->if_number); -} - -/* - * nss_gre_log_verbose() - * Log message contents. - */ -static void nss_gre_log_verbose(struct nss_gre_msg *ngm) -{ - switch (ngm->cm.type) { - case NSS_GRE_MSG_ENCAP_CONFIGURE: - case NSS_GRE_MSG_DECAP_CONFIGURE: - nss_gre_log_config_msg(ngm); - break; - - case NSS_GRE_MSG_ENCAP_DECONFIGURE: - case NSS_GRE_MSG_DECAP_DECONFIGURE: - nss_gre_log_deconfig_msg(ngm); - break; - - case NSS_IF_OPEN: - nss_gre_log_linkup_msg(ngm); - break; - - case NSS_IF_CLOSE: - nss_gre_log_linkdown_msg(ngm); - break; - - case NSS_GRE_MSG_SESSION_STATS: - case NSS_GRE_MSG_BASE_STATS: - /* - * No log for valid stats messages. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", ngm); - break; - } -} - -/* - * nss_gre_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_gre_log_tx_msg(struct nss_gre_msg *ngm) -{ - if (ngm->cm.type >= NSS_GRE_MSG_MAX) { - nss_warning("%px: Invalid message type\n", ngm); - return; - } - - nss_info("%px: type[%d]:%s\n", ngm, ngm->cm.type, nss_gre_log_message_types_str[NSS_GRE_LOG_MESSAGE_TYPE_INDEX(ngm->cm.type)]); - nss_gre_log_verbose(ngm); -} - -/* - * nss_gre_log_rx_msg() - * Log messages received from FW. - */ -void nss_gre_log_rx_msg(struct nss_gre_msg *ngm) -{ - if (ngm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ngm); - return; - } - - if (ngm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ngm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ngm, ngm->cm.type, - nss_gre_log_message_types_str[NSS_GRE_LOG_MESSAGE_TYPE_INDEX(ngm->cm.type)], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - ngm, ngm->cm.type, nss_gre_log_message_types_str[NSS_GRE_LOG_MESSAGE_TYPE_INDEX(ngm->cm.type)], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response]); - -verbose: - nss_gre_log_verbose(ngm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_log.h deleted file mode 100644 index 2a2111785..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_GRE_LOG_H -#define __NSS_GRE_LOG_H - -/* - * nss_gre_log.h - * NSS GRE header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_gre_log_tx_msg - * Logs a gre message that is sent to the NSS firmware. - */ -void nss_gre_log_tx_msg(struct nss_gre_msg *ngm); - -/* - * nss_gre_log_rx_msg - * Logs a gre message that is received from the NSS firmware. - */ -void nss_gre_log_rx_msg(struct nss_gre_msg *ngm); - -#endif /* __NSS_GRE_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir.c deleted file mode 100644 index 73e7c9fc3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir.c +++ /dev/null @@ -1,673 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_gre_redir_stats.h" -#include "nss_gre_redir_strings.h" -#include "nss_gre_redir_log.h" -#define NSS_GRE_REDIR_TX_TIMEOUT 3000 /* 3 Seconds */ - -static struct dentry *gre_redir_dentry; - -/* - * Private data structure for handling synchronous messaging. - */ -static struct { - struct semaphore sem; - struct completion complete; - int response; -} nss_gre_redir_pvt; - -/* - * Array to hold tunnel stats along with if_num - */ -struct nss_gre_redir_tunnel_stats tun_stats[NSS_GRE_REDIR_MAX_INTERFACES]; - -/* - * nss_gre_callback() - * Callback to handle the completion of HLOS-->NSS messages. - */ -static void nss_gre_redir_msg_sync_callback(void *app_data, struct nss_gre_redir_msg *nim) -{ - nss_gre_redir_pvt.response = NSS_TX_SUCCESS; - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("gre Error response %d\n", nim->cm.response); - nss_gre_redir_pvt.response = NSS_TX_FAILURE; - } - - complete(&nss_gre_redir_pvt.complete); -} - -/* - * nss_gre_redir_verify_ifnum() - * Verify interface type. - */ -bool nss_gre_redir_verify_ifnum(uint32_t if_num) -{ - uint32_t type; - - type = nss_dynamic_interface_get_type(nss_gre_redir_get_context(), if_num); - return type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER || - type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER || - type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER || - type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER || - type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_US || - type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS; -} - -/* - * nss_gre_redir_handler() - * Handle NSS -> HLOS messages for GRE tunnel. - */ -static void nss_gre_redir_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_gre_redir_msg *ngrm = (struct nss_gre_redir_msg *)ncm; - void *ctx; - nss_gre_redir_msg_callback_t cb; - - /* - * interface should either be dynamic interface for receiving tunnel msg or GRE_REDIR interface for - * receiving base node messages. - */ - BUG_ON(((ncm->interface < NSS_DYNAMIC_IF_START) || (ncm->interface >= (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))) && - ncm->interface != NSS_GRE_REDIR_INTERFACE); - - /* - * Trace Messages - */ - nss_gre_redir_log_rx_msg(ngrm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_GRE_REDIR_MAX_MSG_TYPES) { - nss_warning("%px: Received invalid message %d for gre interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_gre_redir_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Update the callback and app_data for NOTIFY messages, gre sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ncm->type) { - case NSS_GRE_REDIR_RX_STATS_SYNC_MSG: - nss_gre_redir_stats_sync(nss_ctx, ncm->interface, &ngrm->msg.stats_sync); - nss_gre_redir_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_gre_redir_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call gre tunnel callback - */ - cb(ctx, ncm); -} - -/* - * nss_gre_redir_register_if() - * Register dynamic node for GRE redir. - */ -static struct nss_ctx_instance *nss_gre_redir_register_if(uint32_t if_num, struct net_device *netdev, - nss_gre_redir_data_callback_t cb_func_data, nss_gre_redir_msg_callback_t cb_func_msg, uint32_t features, - uint32_t type, void *app_ctx) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_redir_handler_id]; - uint32_t status; - int i, idx = -1; - - nss_assert(nss_ctx); - nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); - - spin_lock_bh(&nss_gre_redir_stats_lock); - for (i = 0; i < NSS_GRE_REDIR_MAX_INTERFACES; i++) { - if (tun_stats[i].dev == netdev) { - idx = i; - break; - } - - if ((idx == -1) && (tun_stats[i].ref_count == 0)) { - idx = i; - } - } - - if (idx == -1) { - spin_unlock_bh(&nss_gre_redir_stats_lock); - nss_warning("%px: Maximum number of gre_redir tunnel_stats instances are already allocated\n", nss_ctx); - return NULL; - } - - if (!tun_stats[idx].ref_count) { - tun_stats[idx].dev = netdev; - } - tun_stats[idx].ref_count++; - - spin_unlock_bh(&nss_gre_redir_stats_lock); - - /* - * Registering handler for sending tunnel interface msgs to NSS. - */ - status = nss_core_register_handler(nss_ctx, if_num, nss_gre_redir_msg_handler, app_ctx); - if (status != NSS_CORE_STATUS_SUCCESS) { - spin_lock_bh(&nss_gre_redir_stats_lock); - tun_stats[idx].ref_count--; - if (!tun_stats[idx].ref_count) { - tun_stats[idx].dev = NULL; - } - spin_unlock_bh(&nss_gre_redir_stats_lock); - - nss_warning("%px: Not able to register handler for gre_redir interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - /* - * Registering handler for sending tunnel interface msgs to NSS. - */ - status = nss_core_register_msg_handler(nss_ctx, if_num, cb_func_msg); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - spin_lock_bh(&nss_gre_redir_stats_lock); - tun_stats[idx].ref_count--; - if (!tun_stats[idx].ref_count) { - tun_stats[idx].dev = NULL; - } - spin_unlock_bh(&nss_gre_redir_stats_lock); - - nss_warning("%px: Not able to register handler for gre_redir interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, cb_func_data, NULL, NULL, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); - return nss_ctx; -} - -/* - * nss_gre_redir_get_context() - * Retrieve context for GRE redir. - */ -struct nss_ctx_instance *nss_gre_redir_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_redir_handler_id]; -} -EXPORT_SYMBOL(nss_gre_redir_get_context); - -/* - * nss_gre_redir_alloc_and_register_node() - * Allocates and registers GRE Inner/Outer type dynamic nodes with NSS. - */ -int nss_gre_redir_alloc_and_register_node(struct net_device *dev, - nss_gre_redir_data_callback_t data_cb, - nss_gre_redir_msg_callback_t msg_cb, - uint32_t type, void *app_ctx) -{ - int ifnum; - nss_tx_status_t status; - struct nss_ctx_instance *nss_ctx; - - if ((type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER) && - (type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER) && - (type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER) && - (type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER) && - (type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_US) && - (type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS)) { - - nss_warning("%px: Unknown type %u\n", dev, type); - return -1; - } - - ifnum = nss_dynamic_interface_alloc_node(type); - if (ifnum == -1) { - nss_warning("%px: Unable to allocate GRE_REDIR node of type = %u\n", dev, type); - return -1; - } - - nss_ctx = nss_gre_redir_register_if(ifnum, dev, data_cb, - msg_cb, 0, type, app_ctx); - if (!nss_ctx) { - nss_warning("Unable to register GRE_REDIR node of type = %u\n", type); - status = nss_dynamic_interface_dealloc_node(ifnum, type); - if (status != NSS_TX_SUCCESS) { - nss_warning("Unable to deallocate node.\n"); - } - - return -1; - } - - return ifnum; -} -EXPORT_SYMBOL(nss_gre_redir_alloc_and_register_node); - -/* - * nss_gre_redir_configure_inner_node() - * Configure an inner type gre_redir dynamic node. - */ -nss_tx_status_t nss_gre_redir_configure_inner_node(int ifnum, - struct nss_gre_redir_inner_configure_msg *ngrcm) -{ - struct nss_gre_redir_msg config; - uint32_t len, iftype, outerif_type; - nss_tx_status_t status; - - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_get_context(); - if (!nss_ctx) { - nss_warning("Unable to retrieve NSS context.\n"); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ngrcm->ip_hdr_type != NSS_GRE_REDIR_IP_HDR_TYPE_IPV4 && - ngrcm->ip_hdr_type != NSS_GRE_REDIR_IP_HDR_TYPE_IPV6) { - nss_warning("%px: Unknown IP header type %u\n", nss_ctx, ngrcm->ip_hdr_type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ngrcm->gre_version != NSS_GRE_REDIR_HEADER_VERSION) { - nss_warning("%px: Incorrect header version %u\n", nss_ctx, ngrcm->gre_version); - return NSS_TX_FAILURE_BAD_PARAM; - } - - iftype = nss_dynamic_interface_get_type(nss_ctx, ifnum); - if (!((iftype == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER) || - (iftype == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER) || - (iftype == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER))) { - - nss_warning("%px: Incorrect interface type %u\n", nss_ctx, iftype); - return NSS_TX_FAILURE_BAD_PARAM; - } - - outerif_type = nss_dynamic_interface_get_type(nss_ctx, ngrcm->except_outerif); - if (outerif_type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER) { - nss_warning("%px: Incorrect type for exception interface %u\n", nss_ctx, outerif_type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - len = sizeof(struct nss_gre_redir_inner_configure_msg); - - /* - * Configure the node - */ - nss_cmn_msg_init(&config.cm, ifnum, NSS_GRE_REDIR_TX_TUNNEL_INNER_CONFIGURE_MSG, len, NULL, NULL); - config.msg.inner_configure.ip_hdr_type = ngrcm->ip_hdr_type; - config.msg.inner_configure.ip_df_policy = ngrcm->ip_df_policy; - config.msg.inner_configure.gre_version = ngrcm->gre_version; - config.msg.inner_configure.ip_ttl = ngrcm->ip_ttl; - config.msg.inner_configure.except_outerif = ngrcm->except_outerif; - memcpy((void *)config.msg.inner_configure.ip_src_addr, (void *)(ngrcm->ip_src_addr), sizeof(ngrcm->ip_src_addr)); - memcpy((void *)config.msg.inner_configure.ip_dest_addr, (void *)(ngrcm->ip_dest_addr), sizeof(ngrcm->ip_dest_addr)); - - status = nss_gre_redir_tx_msg_sync(nss_ctx, &config); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to configure inner node %d.\n", nss_ctx, ifnum); - } - - return status; -} -EXPORT_SYMBOL(nss_gre_redir_configure_inner_node); - -/* - * nss_gre_redir_exception_ds_reg_cb() - * Configure a callback on VAP for downstream exception tunnel flows. - */ -nss_tx_status_t nss_gre_redir_exception_ds_reg_cb(int ifnum, - struct nss_gre_redir_exception_ds_reg_cb_msg *ngrcm) -{ - struct nss_gre_redir_msg config; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_get_context(); - nss_tx_status_t status; - uint32_t vap_type, iftype; - uint32_t len = sizeof(struct nss_gre_redir_exception_ds_reg_cb_msg); - - if (!nss_ctx) { - nss_warning("Unable to retrieve NSS context.\n"); - return NSS_TX_FAILURE_BAD_PARAM; - } - - iftype = nss_dynamic_interface_get_type(nss_ctx, ifnum); - if (iftype != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS) { - nss_warning("%px: Incorrect interface type %u\n", nss_ctx, iftype); - return NSS_TX_FAILURE_BAD_PARAM; - } - - vap_type = nss_dynamic_interface_get_type(nss_ctx, ngrcm->dst_vap_nssif); - if ((vap_type != NSS_DYNAMIC_INTERFACE_TYPE_VAP)) { - nss_warning("%px: Incorrect type for vap interface type = %u", nss_ctx, vap_type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * Configure the node - */ - nss_cmn_msg_init(&config.cm, ifnum, NSS_GRE_REDIR_EXCEPTION_DS_REG_CB_MSG, len, NULL, NULL); - config.msg.exception_ds_configure.dst_vap_nssif = ngrcm->dst_vap_nssif; - - status = nss_gre_redir_tx_msg_sync(nss_ctx, &config); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to register callback from gre redir exception ds %d\n", nss_ctx, ifnum); - } - - return status; -} -EXPORT_SYMBOL(nss_gre_redir_exception_ds_reg_cb); - -/* - * nss_gre_redir_configure_outer_node() - * Configure an outer type gre_redir dynamic node. - */ -nss_tx_status_t nss_gre_redir_configure_outer_node(int ifnum, - struct nss_gre_redir_outer_configure_msg *ngrcm) -{ - struct nss_gre_redir_msg config; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_get_context(); - nss_tx_status_t status; - uint32_t hostif_type, offlif_type, sjackif_type, iftype; - uint32_t len = sizeof(struct nss_gre_redir_outer_configure_msg); - - if (!nss_ctx) { - nss_warning("Unable to retrieve NSS context.\n"); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ngrcm->ip_hdr_type != NSS_GRE_REDIR_IP_HDR_TYPE_IPV4 && - ngrcm->ip_hdr_type != NSS_GRE_REDIR_IP_HDR_TYPE_IPV6) { - nss_warning("%px: Unknown IP header type %u\n", nss_ctx, ngrcm->ip_hdr_type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - iftype = nss_dynamic_interface_get_type(nss_ctx, ifnum); - if (iftype != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER) { - nss_warning("%px: Incorrect interface type %u\n", nss_ctx, iftype); - return NSS_TX_FAILURE_BAD_PARAM; - } - - hostif_type = nss_dynamic_interface_get_type(nss_ctx, ngrcm->except_hostif); - offlif_type = nss_dynamic_interface_get_type(nss_ctx, ngrcm->except_offlif); - sjackif_type = nss_dynamic_interface_get_type(nss_ctx, ngrcm->except_sjackif); - if ((hostif_type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER) || - (offlif_type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER) || - (ngrcm->except_sjackif - && sjackif_type != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER)) { - - nss_warning("%px: Incorrect type for exception interface hostif_type = %u" - "offlif_type = %u sjackif_type = %u\n", nss_ctx, hostif_type, - offlif_type, sjackif_type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * Configure the node - */ - nss_cmn_msg_init(&config.cm, ifnum, NSS_GRE_REDIR_TX_TUNNEL_OUTER_CONFIGURE_MSG, len, NULL, NULL); - config.msg.outer_configure.ip_hdr_type = ngrcm->ip_hdr_type; - config.msg.outer_configure.rps_hint = ngrcm->rps_hint; - config.msg.outer_configure.except_hostif = ngrcm->except_hostif; - config.msg.outer_configure.except_offlif = ngrcm->except_offlif; - config.msg.outer_configure.except_sjackif = ngrcm->except_sjackif; - - status = nss_gre_redir_tx_msg_sync(nss_ctx, &config); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to configure outer node %d\n", nss_ctx, ifnum); - } - - return status; -} -EXPORT_SYMBOL(nss_gre_redir_configure_outer_node); - -/* - * nss_gre_redir_tx_msg() - * Transmit a GRE message to NSS FW. - */ -nss_tx_status_t nss_gre_redir_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_gre_redir_log_tx_msg(msg); - - /* - * Sanity check the message - */ - - /* - * interface should either be dynamic interface to transmit tunnel msg or GRE_REDIR interface to transmit - * base node messages. - */ - if (((ncm->interface < NSS_DYNAMIC_IF_START) || (ncm->interface >= (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))) && - ncm->interface != NSS_GRE_REDIR_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_GRE_REDIR_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_gre_redir_tx_msg); - -/* - * nss_gre_redir_tx_msg_sync() - * Transmit a GRE redir message to NSS firmware synchronously. - */ -nss_tx_status_t nss_gre_redir_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_msg *ngrm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_gre_redir_pvt.sem); - ngrm->cm.cb = (nss_ptr_t)nss_gre_redir_msg_sync_callback; - ngrm->cm.app_data = (nss_ptr_t)NULL; - status = nss_gre_redir_tx_msg(nss_ctx, ngrm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: gre_tx_msg failed\n", nss_ctx); - up(&nss_gre_redir_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_gre_redir_pvt.complete, msecs_to_jiffies(NSS_GRE_REDIR_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: GRE tx sync failed due to timeout\n", nss_ctx); - nss_gre_redir_pvt.response = NSS_TX_FAILURE; - } - - status = nss_gre_redir_pvt.response; - up(&nss_gre_redir_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_gre_redir_tx_msg_sync); - -/* - * nss_gre_redir_tx_buf() - * Send packet to gre_redir interface owned by NSS. - */ -nss_tx_status_t nss_gre_redir_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - uint32_t type; - - nss_trace("%px: gre_redir If Tx packet, id:%d, data=%px", nss_ctx, if_num, os_buf->data); - - /* - * We expect Tx packets to the tunnel only from an interface of - * type GRE_REDIR_WIFI_HOST_INNER. - */ - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - if (!((type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER) - || (type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS))) { - nss_warning("%px: Unknown type for interface %u\n", nss_ctx, type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return nss_core_send_packet(nss_ctx, os_buf, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_gre_redir_tx_buf); - -/* - * nss_gre_redir_tx_buf_noreuse() - * Send packet to gre_redir interface owned by NSS. - */ -nss_tx_status_t nss_gre_redir_tx_buf_noreuse(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - uint32_t type; - - nss_trace("%px: gre_redir If Tx packet, id:%d, data=%px", nss_ctx, if_num, os_buf->data); - - /* - * We expect Tx packets to the tunnel only from an interface of - * type GRE_REDIR_WIFI_HOST_INNER. - */ - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - if (!((type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER) - || (type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS))) { - nss_warning("%px: Unknown type for interface %u\n", nss_ctx, type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return nss_core_send_packet(nss_ctx, os_buf, if_num, 0); -} -EXPORT_SYMBOL(nss_gre_redir_tx_buf_noreuse); - -/* - * nss_gre_redir_unregister_if() - * Unregister dynamic node for GRE redir. - */ -bool nss_gre_redir_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_redir_handler_id]; - uint32_t status; - struct net_device *dev; - int i; - - nss_assert(nss_ctx); - nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); - - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!dev) { - nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); - return false; - } - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for gre_redir interface %d with NSS core\n", nss_ctx, if_num); - return false; - } - - status = nss_core_unregister_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for gre_redir interface %d with NSS core\n", nss_ctx, if_num); - return false; - } - - nss_core_set_subsys_dp_type(nss_ctx, dev, if_num, NSS_DYNAMIC_INTERFACE_TYPE_NONE); - nss_core_unregister_subsys_dp(nss_ctx, if_num); - spin_lock_bh(&nss_gre_redir_stats_lock); - - /* - * Update/Clear the tunnel stats entry for this tunnel. - */ - for (i = 0; i < NSS_GRE_REDIR_MAX_INTERFACES; i++) { - if (tun_stats[i].dev == dev) { - tun_stats[i].ref_count--; - if (!tun_stats[i].ref_count) { - tun_stats[i].dev = NULL; - } - - break; - } - } - - spin_unlock_bh(&nss_gre_redir_stats_lock); - return true; -} -EXPORT_SYMBOL(nss_gre_redir_unregister_if); - -/* - * nss_gre_redir_get_device() - * Gets the original device from probe. - */ -struct device *nss_gre_redir_get_device(void) -{ - struct nss_ctx_instance *nss_ctx = nss_gre_redir_get_context(); - return nss_ctx->dev; -} -EXPORT_SYMBOL(nss_gre_redir_get_device); - -/* - * nss_gre_redir_get_dentry() - * Returns directory entry created in debugfs for statistics. - */ -struct dentry *nss_gre_redir_get_dentry(void) -{ - return gre_redir_dentry; -} - -/* - * nss_gre_redir_register_handler() - * Registering handler for sending msg to base gre_redir node on NSS. - */ -void nss_gre_redir_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_get_context(); - uint32_t status; - - gre_redir_dentry = nss_gre_redir_stats_dentry_create(); - if (!gre_redir_dentry) { - nss_warning("%px: Not able to create debugfs entry\n", nss_ctx); - return; - } - - sema_init(&nss_gre_redir_pvt.sem, 1); - init_completion(&nss_gre_redir_pvt.complete); - memset(tun_stats, 0, sizeof(struct nss_gre_redir_tunnel_stats) * NSS_GRE_REDIR_MAX_INTERFACES); - status = nss_core_register_handler(nss_ctx, NSS_GRE_REDIR_INTERFACE, nss_gre_redir_msg_handler, NULL); - if (status != NSS_CORE_STATUS_SUCCESS) { - debugfs_remove_recursive(gre_redir_dentry); - gre_redir_dentry = NULL; - nss_warning("%px: Not able to register handler for gre_redir base interface with NSS core\n", nss_ctx); - return; - } - - nss_gre_redir_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds.c deleted file mode 100644 index ea4132013..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds.c +++ /dev/null @@ -1,404 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2018, 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_gre_redir_lag.h" -#include "nss_gre_redir_lag_ds_stats.h" -#include "nss_gre_redir_lag_ds_log.h" -#include "nss_gre_redir_lag_ds_strings.h" - -#define NSS_GRE_REDIR_LAG_DS_TX_TIMEOUT 3000 /* 3 Seconds */ - -struct nss_gre_redir_lag_ds_tun_stats tun_ds_stats[NSS_GRE_REDIR_LAG_MAX_NODE]; - -/* - * Private data structure - */ -static struct { - struct semaphore sem; - struct completion complete; - int response; - nss_gre_redir_lag_ds_msg_callback_t *cb; - void *app_data; -} nss_gre_redir_lag_ds_pvt; - -/* - * nss_gre_redir_lag_ds_callback() - * Callback to handle the completion of HLOS-->NSS messages. - */ -static void nss_gre_redir_lag_ds_callback(void *app_data, struct nss_gre_redir_lag_ds_msg *nim) -{ - nss_gre_redir_lag_ds_msg_callback_t callback = (nss_gre_redir_lag_ds_msg_callback_t)nss_gre_redir_lag_ds_pvt.cb; - void *data = nss_gre_redir_lag_ds_pvt.app_data; - - nss_gre_redir_lag_ds_pvt.cb = NULL; - nss_gre_redir_lag_ds_pvt.app_data = NULL; - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("GRE LAG DS: error response %d\n", nim->cm.response); - nss_gre_redir_lag_ds_pvt.response = NSS_TX_FAILURE; - } else { - nss_gre_redir_lag_ds_pvt.response = NSS_TX_SUCCESS; - } - - if (callback) { - callback(data, &nim->cm); - } - - complete(&nss_gre_redir_lag_ds_pvt.complete); -} - -/* - * nss_gre_redir_lag_ds_get_node_idx() - * Returns index of statistics context. - */ -bool nss_gre_redir_lag_ds_get_node_idx(uint32_t ifnum, uint32_t *idx) -{ - uint32_t node_idx; - for (node_idx = 0; node_idx < NSS_GRE_REDIR_LAG_MAX_NODE; node_idx++) { - if ((tun_ds_stats[node_idx].valid) && (tun_ds_stats[node_idx].ifnum == ifnum)) { - *idx = node_idx; - return true; - } - } - - return false; -} - -/* - * nss_gre_redir_lag_ds_verify_ifnum() - * Verify interface type. - */ -bool nss_gre_redir_lag_ds_verify_ifnum(uint32_t if_num) -{ - return nss_dynamic_interface_get_type(nss_gre_redir_lag_ds_get_context(), if_num) == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS; -} - -/* - * nss_gre_redir_lag_ds_handler() - * Handle NSS -> HLOS messages for gre tunnel - */ -static void nss_gre_redir_lag_ds_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - void *ctx; - struct nss_gre_redir_lag_ds_msg *ngrm = (struct nss_gre_redir_lag_ds_msg *)ncm; - nss_gre_redir_lag_ds_msg_callback_t cb; - - /* - * Interface should be a dynamic interface of type NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS. - */ - BUG_ON(!nss_gre_redir_lag_ds_verify_ifnum(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_GRE_REDIR_LAG_DS_MAX_MSG_TYPES) { - nss_warning("%px: received invalid message %d for gre interface\n", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_gre_redir_lag_ds_msg)) { - nss_warning("%px: Length of message is greater than required: %d\n", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Update the callback and app_data for NOTIFY messages, gre sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Trace messages. - */ - nss_gre_redir_lag_ds_log_rx_msg(ngrm); - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ncm->type) { - case NSS_GRE_REDIR_LAG_DS_STATS_SYNC_MSG: - nss_gre_redir_lag_ds_stats_sync(nss_ctx, &ngrm->msg.ds_sync_stats, ncm->interface); - nss_gre_redir_lag_ds_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_gre_redir_lag_ds_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call gre tunnel callback - */ - cb(ctx, ncm); -} - -/* - * nss_gre_redir_lag_ds_unregister_if() - * Unregister GRE redirect LAG downstream node. - */ -static enum nss_gre_redir_lag_err_types nss_gre_redir_lag_ds_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_lag_ds_get_context(); - uint32_t idx, status; - - nss_assert(nss_ctx); - nss_assert(!nss_gre_redir_lag_ds_verify_ifnum(if_num)); - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for gre_lag interface %d with NSS core\n", nss_ctx, if_num); - return NSS_GRE_REDIR_LAG_ERR_CORE_UNREGISTER_FAILED; - } - - status = nss_core_unregister_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for gre_lag interface %d with NSS core\n", nss_ctx, if_num); - return NSS_GRE_REDIR_LAG_ERR_CORE_UNREGISTER_FAILED; - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); - if (!nss_gre_redir_lag_ds_get_node_idx(if_num, &idx)) { - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - nss_warning("%px: Stats context not found.\n", nss_ctx); - return NSS_GRE_REDIR_LAG_ERR_STATS_INDEX_NOT_FOUND; - } - - tun_ds_stats[idx].valid = false; - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - return NSS_GRE_REDIR_LAG_SUCCESS; -} - -/* - * nss_gre_redir_lag_ds_register_if() - * Register GRE redirect LAG downstream node. - */ -static struct nss_ctx_instance *nss_gre_redir_lag_ds_register_if(uint32_t if_num, struct net_device *netdev, - nss_gre_redir_lag_ds_data_callback_t cb_func_data, - nss_gre_redir_lag_ds_msg_callback_t cb_func_msg, uint32_t features, uint32_t type, void *app_ctx) -{ - struct nss_ctx_instance *nss_ctx = nss_gre_redir_lag_ds_get_context(); - uint32_t status, i; - nss_assert(nss_ctx); - nss_assert(!nss_gre_redir_lag_ds_verify_ifnum(if_num)); - - /* - * Registering handler for sending tunnel interface msgs to NSS. - */ - status = nss_core_register_handler(nss_ctx, if_num, nss_gre_redir_lag_ds_msg_handler, app_ctx); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to register handler for gre_lag interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - /* - * Registering handler for sending tunnel interface msgs to NSS. - */ - status = nss_core_register_msg_handler(nss_ctx, if_num, cb_func_msg); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: Not able to register handler for gre_lag interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, cb_func_data, NULL, NULL, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); - spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); - for (i = 0; i < NSS_GRE_REDIR_LAG_MAX_NODE; i++) { - if (!tun_ds_stats[i].valid) { - tun_ds_stats[i].ifnum = if_num; - tun_ds_stats[i].valid = true; - break; - } - } - - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - - return nss_ctx; -} - -/* - * nss_gre_redir_lag_ds_get_context() - * Retrieves context GRE redirect LAG downstream node. - */ -struct nss_ctx_instance *nss_gre_redir_lag_ds_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_redir_lag_ds_handler_id]; -} -EXPORT_SYMBOL(nss_gre_redir_lag_ds_get_context); - -/* - * nss_gre_redir_lag_ds_tx_msg() - * Transmit a gre message to NSS. - */ -nss_tx_status_t nss_gre_redir_lag_ds_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_ds_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace messages. - */ - nss_gre_redir_lag_ds_log_tx_msg(msg); - - /* - * Sanity check the message. Interface should be a dynamic interface - * of type NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS. - */ - if (!nss_gre_redir_lag_ds_verify_ifnum(ncm->interface)) { - nss_warning("%px: tx request for another interface: %d\n", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_GRE_REDIR_LAG_DS_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_gre_redir_lag_ds_tx_msg); - -/* - * nss_gre_redir_lag_ds_tx_msg_sync() - * Transmit a GRE lag message to NSS firmware synchronously. - */ -nss_tx_status_t nss_gre_redir_lag_ds_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_ds_msg *ngrm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_gre_redir_lag_ds_pvt.sem); - nss_gre_redir_lag_ds_pvt.cb = (void *)ngrm->cm.cb; - nss_gre_redir_lag_ds_pvt.app_data = (void *)ngrm->cm.app_data; - ngrm->cm.cb = (nss_ptr_t)nss_gre_redir_lag_ds_callback; - ngrm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_gre_redir_lag_ds_tx_msg(nss_ctx, ngrm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: GRE LAG DS msg tx failed\n", nss_ctx); - up(&nss_gre_redir_lag_ds_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_gre_redir_lag_ds_pvt.complete, msecs_to_jiffies(NSS_GRE_REDIR_LAG_DS_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: GRE LAG DS tx sync failed due to timeout\n", nss_ctx); - nss_gre_redir_lag_ds_pvt.response = NSS_TX_FAILURE; - } - - status = nss_gre_redir_lag_ds_pvt.response; - up(&nss_gre_redir_lag_ds_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_gre_redir_lag_ds_tx_msg_sync); - -/* - * nss_gre_redir_lag_ds_unregister_and_dealloc() - * Unregister and deallocate nss gre redirect LAG DS node. - */ -enum nss_gre_redir_lag_err_types nss_gre_redir_lag_ds_unregister_and_dealloc(uint32_t ifnum) -{ - uint32_t ret; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_lag_ds_get_context(); - nss_tx_status_t status; - - if (!nss_gre_redir_lag_ds_verify_ifnum(ifnum)) { - nss_warning("%px: Unknown interface type %u.\n", nss_ctx, ifnum); - return NSS_GRE_REDIR_LAG_ERR_INCORRECT_IFNUM; - } - - ret = nss_gre_redir_lag_ds_unregister_if(ifnum); - if (ret) { - nss_warning("%px: Unable to unregister interface %u.\n", nss_ctx, ifnum); - return ret; - } - - status = nss_dynamic_interface_dealloc_node(ifnum, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to deallocate node %u\n", nss_ctx, ifnum); - return NSS_GRE_REDIR_LAG_ERR_DEALLOC_FAILED; - } - - return NSS_GRE_REDIR_LAG_SUCCESS; -} -EXPORT_SYMBOL(nss_gre_redir_lag_ds_unregister_and_dealloc); - -/* - * nss_gre_redir_lag_ds_alloc_and_register_node() - * Allocates and registers GRE downstream type dynamic nodes with NSS. - */ -int nss_gre_redir_lag_ds_alloc_and_register_node(struct net_device *dev, - nss_gre_redir_lag_ds_data_callback_t cb_func_data, - nss_gre_redir_lag_ds_msg_callback_t cb_func_msg, void *app_ctx) -{ - int ifnum; - nss_tx_status_t status; - struct nss_ctx_instance *nss_ctx; - - ifnum = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS); - if (ifnum == -1) { - nss_warning("%px: Unable to allocate GRE_LAG node of type = %u\n", dev, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS); - return -1; - } - - nss_ctx = nss_gre_redir_lag_ds_register_if(ifnum, dev, cb_func_data, - cb_func_msg, 0, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS, app_ctx); - if (!nss_ctx) { - nss_warning("%px: Unable to register GRE_LAG node of type = %u\n", dev, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS); - status = nss_dynamic_interface_dealloc_node(ifnum, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to deallocate node of type = %u.\n", dev, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_DS); - } - - return -1; - } - - return ifnum; -} -EXPORT_SYMBOL(nss_gre_redir_lag_ds_alloc_and_register_node); - -/* - * nss_gre_redir_lag_ds_register_handler() - * Registering handler for sending msg to base gre_lag node on NSS. - */ -void nss_gre_redir_lag_ds_register_handler(void) -{ - if (!nss_gre_redir_lag_ds_stats_dentry_create()) { - nss_warning(" Unable to create debugfs entry for LAG DS node.\n"); - return; - } - - nss_gre_redir_lag_ds_strings_dentry_create(); - nss_gre_redir_lag_ds_pvt.cb = NULL; - nss_gre_redir_lag_ds_pvt.app_data = NULL; - sema_init(&nss_gre_redir_lag_ds_pvt.sem, 1); - init_completion(&nss_gre_redir_lag_ds_pvt.complete); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_log.c deleted file mode 100644 index 158cb9d44..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_log.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_gre_redir_lag_ds_log.c - * NSS GRE REDIR LAG DS logger file. - */ - -#include "nss_core.h" - -/* - * nss_gre_redir_lag_ds_log_message_types_str - * GRE REDIR LAG DS message strings - */ -static int8_t *nss_gre_redir_lag_ds_log_message_types_str[NSS_GRE_REDIR_LAG_DS_MAX_MSG_TYPES] __maybe_unused = { - "GRE REDIR LAG DS add station Message", - "GRE REDIR LAG DS delete station message", - "GRE REDIR LAG DS update station message", - "GRE REDIR LAG DS stats sync message", -}; - -/* - * nss_gre_redir_lag_ds_log_error_response_types_str - * Strings for error types for GRE REDIR LAG DS messages - */ -static int8_t *nss_gre_redir_lag_ds_log_error_response_types_str[NSS_GRE_REDIR_LAG_ERR_MAX] __maybe_unused = { - "GRE REDIR LAG Success", - "GRE REDIR LAG Incorrect Interface", - "GRE REDIR LAG DS Core Unregister Failed", - "GRE REDIR LAG DS STats Index Not Found", - "GRE REDIR LAG Dealloc Failed", -}; - -/* - * nss_gre_redir_lag_ds_log_add_sta_msg() - * Log NSS GRE REDIR LAG DS add STA message. - */ -static void nss_gre_redir_lag_ds_log_add_sta_msg(struct nss_gre_redir_lag_ds_msg *ngm) -{ - struct nss_gre_redir_lag_ds_add_sta_msg *ngasm __maybe_unused = &ngm->msg.add_sta; - nss_trace("%px: NSS GRE REDIR LAG DS Add STA Message:\n" - "GRE REDIR LAG DS Station MAC Address: %px\n" - "GRE REDIR LAG DS Reorder Type: %d\n", - ngasm, ngasm->mac, ngasm->reorder_type); -} - -/* - * nss_gre_redir_lag_ds_log_del_sta_msg() - * Log NSS GRE REDIR LAG DS del STA message. - */ -static void nss_gre_redir_lag_ds_log_del_sta_msg(struct nss_gre_redir_lag_ds_msg *ngm) -{ - struct nss_gre_redir_lag_ds_delete_sta_msg *ngdsm __maybe_unused = &ngm->msg.del_sta; - nss_trace("%px: NSS GRE REDIR LAG DS Del STA Message:\n" - "GRE REDIR LAG DS Station MAC Address: %px\n", - ngdsm, ngdsm->mac); -} - -/* - * nss_gre_redir_lag_ds_log_add_sta_msg() - * Log NSS GRE REDIR LAG DS add STA message. - */ -static void nss_gre_redir_lag_ds_log_update_sta_msg(struct nss_gre_redir_lag_ds_msg *ngm) -{ - struct nss_gre_redir_lag_ds_update_sta_msg *ngusm __maybe_unused = &ngm->msg.update_sta; - nss_trace("%px: NSS GRE REDIR LAG DS Update STA Message:\n" - "GRE REDIR LAG DS Station MAC Address: %px\n" - "GRE REDIR LAG DS Reorder Type: %d\n", - ngusm, ngusm->mac, ngusm->reorder_type); -} - -/* - * nss_gre_redir_lag_ds_log_verbose() - * Log message contents. - */ -static void nss_gre_redir_lag_ds_log_verbose(struct nss_gre_redir_lag_ds_msg *ngm) -{ - switch (ngm->cm.type) { - case NSS_GRE_REDIR_LAG_DS_ADD_STA_MSG: - nss_gre_redir_lag_ds_log_add_sta_msg(ngm); - break; - - case NSS_GRE_REDIR_LAG_DS_DEL_STA_MSG: - nss_gre_redir_lag_ds_log_del_sta_msg(ngm); - break; - - case NSS_GRE_REDIR_LAG_DS_UPDATE_STA_MSG: - nss_gre_redir_lag_ds_log_update_sta_msg(ngm); - break; - - case NSS_GRE_REDIR_LAG_DS_STATS_SYNC_MSG: - /* - * No log for valid stats message. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", ngm); - break; - } -} - -/* - * nss_gre_redir_lag_ds_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_gre_redir_lag_ds_log_tx_msg(struct nss_gre_redir_lag_ds_msg *ngm) -{ - if (ngm->cm.type >= NSS_GRE_REDIR_LAG_DS_MAX_MSG_TYPES) { - nss_warning("%px: Invalid message type\n", ngm); - return; - } - - nss_info("%px: type[%d]:%s\n", ngm, ngm->cm.type, nss_gre_redir_lag_ds_log_message_types_str[ngm->cm.type]); - nss_gre_redir_lag_ds_log_verbose(ngm); -} - -/* - * nss_gre_redir_lag_ds_log_rx_msg() - * Log messages received from FW. - */ -void nss_gre_redir_lag_ds_log_rx_msg(struct nss_gre_redir_lag_ds_msg *ngm) -{ - if (ngm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ngm); - return; - } - - if (ngm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ngm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ngm, ngm->cm.type, - nss_gre_redir_lag_ds_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response]); - goto verbose; - } - - if (ngm->cm.error >= NSS_GRE_REDIR_LAG_ERR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ngm, ngm->cm.type, nss_gre_redir_lag_ds_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response], - ngm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ngm, ngm->cm.type, nss_gre_redir_lag_ds_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response], - ngm->cm.error, nss_gre_redir_lag_ds_log_error_response_types_str[ngm->cm.error]); - -verbose: - nss_gre_redir_lag_ds_log_verbose(ngm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_log.h deleted file mode 100644 index b0918760e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_LAG_DS_LOG_H__ -#define __NSS_GRE_REDIR_LAG_DS_LOG_H__ - -/* - * nss_gre_redir_lag_ds_log.h - * NSS GRE REDIR LAG DS Log Header File - */ - -/* - * nss_gre_redir_lag_ds_log_tx_msg - * Logs a gre redir lag ds message that is sent to the NSS firmware. - */ -void nss_gre_redir_lag_ds_log_tx_msg(struct nss_gre_redir_lag_ds_msg *ngm); - -/* - * nss_gre_redir_lag_ds_log_rx_msg - * Logs a gre redir lag ds message that is received from the NSS firmware. - */ -void nss_gre_redir_lag_ds_log_rx_msg(struct nss_gre_redir_lag_ds_msg *ngm); - -#endif /* __NSS_GRE_REDIR_LAG_DS_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.c deleted file mode 100644 index 76b3d7f83..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_gre_redir_lag.h" -#include "nss_gre_redir_lag_ds_stats.h" -#include "nss_gre_redir_lag_ds_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_gre_redir_lag_ds_stats_notifier); - -/* - * Spinlock to protect GRE redirect lag ds statistics update/read - */ -DEFINE_SPINLOCK(nss_gre_redir_lag_ds_stats_lock); - -extern struct nss_gre_redir_lag_ds_tun_stats tun_ds_stats[NSS_GRE_REDIR_LAG_MAX_NODE]; - -/* - * nss_gre_redir_lag_ds_stats_get() - * Get statistics for downstream LAG node. - */ -bool nss_gre_redir_lag_ds_stats_get(struct nss_gre_redir_lag_ds_tun_stats *cmn_stats, uint32_t index) -{ - if (index >= NSS_GRE_REDIR_LAG_MAX_NODE) - return false; - - spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); - if (!tun_ds_stats[index].valid) { - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - return false; - } - - memcpy((void *)cmn_stats, (void *)&tun_ds_stats[index], sizeof(*cmn_stats)); - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - return true; -} - -/* - * nss_gre_redir_lag_ds_stats_read() - * Read gre_redir_lag_ds tunnel stats. - */ -static ssize_t nss_gre_redir_lag_ds_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_GRE_REDIR_LAG_DS_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - struct nss_stats_data *data = fp->private_data; - struct nss_gre_redir_lag_ds_tun_stats stats; - ssize_t bytes_read = 0; - size_t size_wr = 0; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - while (data->index < NSS_GRE_REDIR_LAG_MAX_NODE) { - if (nss_gre_redir_lag_ds_stats_get(&stats, data->index)) { - break; - } - - data->index++; - } - - if (data->index >= NSS_GRE_REDIR_LAG_MAX_NODE) { - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre_redir_lag_ds stats", NSS_STATS_SINGLE_CORE); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nTunnel stats for %03u\n", stats.ifnum); - size_wr += nss_stats_print("gre_redir_lag_ds", NULL, NSS_STATS_SINGLE_INSTANCE, nss_gre_redir_lag_ds_strings_stats, - &stats.rx_packets, NSS_GRE_REDIR_LAG_DS_STATS_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - data->index++; - kfree(lbuf); - return bytes_read; -} - -/* - * nss_gre_redir_lag_ds_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(gre_redir_lag_ds_cmn) - -/* - * nss_gre_redir_lag_ds_stats_dentry_create() - * Create debugfs directory entry. - */ -struct dentry *nss_gre_redir_lag_ds_stats_dentry_create(void) -{ - struct dentry *gre_redir; - struct dentry *cmn_stats; - - gre_redir = nss_gre_redir_get_dentry(); - if (unlikely(!gre_redir)) { - nss_warning("Failed to retrieve directory entry qca-nss-drv/stats/gre_redir/\n"); - return NULL; - } - - cmn_stats = debugfs_create_file("lag_ds_cmn_stats", 0400, gre_redir, - &nss_top_main, &nss_gre_redir_lag_ds_cmn_stats_ops); - if (unlikely(!cmn_stats)) { - nss_warning("Failed to create qca-nss-drv/stats/gre_redir/lag_ds_cmn_stats file\n"); - return NULL; - } - - return cmn_stats; -} - -/* - * nss_gre_redir_lag_ds_stats_sync() - * Update synchonized statistics. - */ -void nss_gre_redir_lag_ds_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_ds_sync_stats_msg *ngss, uint32_t ifnum) -{ - int idx, j; - - spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); - if (!nss_gre_redir_lag_ds_get_node_idx(ifnum, &idx)) { - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); - return; - } - - tun_ds_stats[idx].tx_packets += ngss->node_stats.tx_packets; - tun_ds_stats[idx].tx_bytes += ngss->node_stats.tx_bytes; - tun_ds_stats[idx].rx_packets += ngss->node_stats.rx_packets; - tun_ds_stats[idx].rx_bytes += ngss->node_stats.rx_bytes; - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - tun_ds_stats[idx].rx_dropped[j] += ngss->node_stats.rx_dropped[j]; - } - - tun_ds_stats[idx].dst_invalid += ngss->ds_stats.dst_invalid; - tun_ds_stats[idx].exception_cnt += ngss->ds_stats.exception_cnt; - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); -} - -/* - * nss_gre_redir_lag_ds_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_gre_redir_lag_ds_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_gre_redir_lag_ds_stats_notification *stats_notify; - int idx; - - stats_notify = kzalloc(sizeof(struct nss_gre_redir_lag_ds_stats_notification), GFP_ATOMIC); - if (!stats_notify) { - nss_warning("Unable to allocate memory for stats notification\n"); - return; - } - - spin_lock_bh(&nss_gre_redir_lag_ds_stats_lock); - if (!nss_gre_redir_lag_ds_get_node_idx(if_num, &idx)) { - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); - kfree(stats_notify); - return; - } - - stats_notify->core_id = nss_ctx->id; - stats_notify->if_num = if_num; - memcpy(&(stats_notify->stats_ctx), &(tun_ds_stats[idx]), sizeof(stats_notify->stats_ctx)); - spin_unlock_bh(&nss_gre_redir_lag_ds_stats_lock); - atomic_notifier_call_chain(&nss_gre_redir_lag_ds_stats_notifier, NSS_STATS_EVENT_NOTIFY, stats_notify); - kfree(stats_notify); -} - -/* - * nss_gre_redir_lag_ds_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_gre_redir_lag_ds_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_gre_redir_lag_ds_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_redir_lag_ds_stats_unregister_notifier); - -/* - * nss_gre_redir_lag_ds_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_gre_redir_lag_ds_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_gre_redir_lag_ds_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_redir_lag_ds_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.h deleted file mode 100644 index 127f0082a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_stats.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * ************************************************************************ - */ - -#ifndef __NSS_GRE_REDIR_LAG_DS_STATS_H__ -#define __NSS_GRE_REDIR_LAG_DS_STATS_H__ - -extern spinlock_t nss_gre_redir_lag_ds_stats_lock; -extern void nss_gre_redir_lag_ds_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern bool nss_gre_redir_lag_ds_verify_ifnum(uint32_t if_num); -extern bool nss_gre_redir_lag_ds_get_node_idx(uint32_t ifnum, uint32_t *idx); -extern void nss_gre_redir_lag_ds_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_gre_redir_lag_ds_sync_stats_msg *ngss, uint32_t ifnum); -extern struct dentry *nss_gre_redir_lag_ds_stats_dentry_create(void); - -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.c deleted file mode 100644 index 185189996..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_gre_redir_lag_ds_strings.h" - -/* - * nss_gre_redir_lag_ds_strings_stats - * GRE REDIR LAG DS common statistics strings. - */ -struct nss_stats_info nss_gre_redir_lag_ds_strings_stats[NSS_GRE_REDIR_LAG_DS_STATS_MAX] = { - {"rx_packets", NSS_STATS_TYPE_COMMON}, - {"rx_bytes", NSS_STATS_TYPE_COMMON}, - {"tx_packets", NSS_STATS_TYPE_COMMON}, - {"tx_bytes", NSS_STATS_TYPE_COMMON}, - {"rx_dropped_0", NSS_STATS_TYPE_DROP}, - {"rx_dropped_1", NSS_STATS_TYPE_DROP}, - {"rx_dropped_2", NSS_STATS_TYPE_DROP}, - {"rx_dropped_3", NSS_STATS_TYPE_DROP}, - {"dst_invalid", NSS_STATS_TYPE_EXCEPTION}, - {"exception_packets", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_gre_redir_lag_ds_strings_read() - * Read gre_redir_lag_ds statistics names - */ -static ssize_t nss_gre_redir_lag_ds_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_gre_redir_lag_ds_strings_stats, NSS_GRE_REDIR_LAG_DS_STATS_MAX); -} - -/* - * nss_gre_redir_lag_ds_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_redir_lag_ds); - -/* - * nss_gre_redir_lag_ds_strings_dentry_create() - * Create gre_redir_lag_ds statistics strings debug entry. - */ -void nss_gre_redir_lag_ds_strings_dentry_create(void) -{ - nss_strings_create_dentry("gre_redir_lag_ds", &nss_gre_redir_lag_ds_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.h deleted file mode 100644 index c85bc7721..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_ds_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_LAG_DS_STRINGS_H -#define __NSS_GRE_REDIR_LAG_DS_STRINGS_H - -#include "nss_gre_redir_lag_ds_stats.h" - -extern struct nss_stats_info nss_gre_redir_lag_ds_strings_stats[NSS_GRE_REDIR_LAG_DS_STATS_MAX]; -extern void nss_gre_redir_lag_ds_strings_dentry_create(void); - -#endif /* __NSS_GRE_REDIR_LAG_DS_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us.c deleted file mode 100644 index 8e1b7588e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us.c +++ /dev/null @@ -1,665 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2018, 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_gre_redir_lag_us_stats.h" -#include "nss_gre_redir_lag_us_log.h" -#include "nss_gre_redir_lag_us_strings.h" - -#define NSS_GRE_REDIR_LAG_US_TX_TIMEOUT 3000 /* 3 Seconds */ -#define NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD msecs_to_jiffies(4000) -#define NSS_GRE_REDIR_LAG_US_STATS_SYNC_UDELAY 4000 - -struct nss_gre_redir_lag_us_cmn_ctx cmn_ctx; - -/* - * Sync response context. - */ -static struct { - struct semaphore sem; - struct completion complete; - int response; - nss_gre_redir_lag_us_msg_callback_t *cb; - void *app_data; -} nss_gre_redir_lag_us_sync_ctx; - -/* - * nss_gre_redir_lag_us_callback() - * Callback to handle the completion of HLOS-->NSS messages. - */ -static void nss_gre_redir_lag_us_callback(void *app_data, struct nss_gre_redir_lag_us_msg *nim) -{ - nss_gre_redir_lag_us_msg_callback_t callback = (nss_gre_redir_lag_us_msg_callback_t)nss_gre_redir_lag_us_sync_ctx.cb; - void *data = nss_gre_redir_lag_us_sync_ctx.app_data; - - nss_gre_redir_lag_us_sync_ctx.cb = NULL; - nss_gre_redir_lag_us_sync_ctx.app_data = NULL; - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("GRE redir LAG US Error response %d\n", nim->cm.response); - nss_gre_redir_lag_us_sync_ctx.response = NSS_TX_FAILURE; - } else { - nss_gre_redir_lag_us_sync_ctx.response = NSS_TX_SUCCESS; - } - - if (callback) { - callback(data, &nim->cm); - } - - complete(&nss_gre_redir_lag_us_sync_ctx.complete); -} - -/* - * nss_gre_redir_lag_us_hash_update_stats_req() - * Update query hash message's index for next request. - */ -static void nss_gre_redir_lag_us_hash_update_stats_req(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_us_msg *ngrm) -{ - uint32_t ifnum = ngrm->cm.interface; - uint32_t idx, sync_delay = NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD; - struct nss_gre_redir_lag_us_hash_stats_query_msg *nim = &ngrm->msg.hash_stats; - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (!nss_gre_redir_lag_us_get_node_idx(ifnum, &idx)) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); - return; - } - - /* - * Update start index for next iteration of the query. - */ - if (ngrm->cm.response == NSS_CMN_RESPONSE_ACK) { - cmn_ctx.stats_ctx[idx].db_sync_msg.msg.hash_stats.db_entry_idx = nim->db_entry_next; - } else { - cmn_ctx.stats_ctx[idx].db_sync_msg.msg.hash_stats.db_entry_idx = 0; - } - - /* - * If more hash entries are to be fetched from FW, queue work with delay of one eighth of - * the polling period. Else, schedule work with a delay of polling period. - */ - if (cmn_ctx.stats_ctx[idx].db_sync_msg.msg.hash_stats.db_entry_idx) - sync_delay = NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD / 8; - - queue_delayed_work(cmn_ctx.nss_gre_redir_lag_us_wq, &(cmn_ctx.stats_ctx[idx].nss_gre_redir_lag_us_work), sync_delay); - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); -} - -/* - * nss_gre_redir_lag_us_handler() - * Handle NSS -> HLOS messages for gre tunnel - */ -static void nss_gre_redir_lag_us_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - void *ctx; - struct nss_gre_redir_lag_us_msg *ngrm = (struct nss_gre_redir_lag_us_msg *)ncm; - nss_gre_redir_lag_us_msg_callback_t cb; - - /* - * Interface should be a dynamic interface of type NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US. - */ - BUG_ON(!nss_gre_redir_lag_us_verify_ifnum(ncm->interface)); - - /* - * Trace messages. - */ - nss_gre_redir_lag_us_log_rx_msg(ngrm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_GRE_REDIR_LAG_US_MAX_MSG_TYPES) { - nss_warning("%px: received invalid message %d for gre interface\n", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_gre_redir_lag_us_msg)) { - nss_warning("%px: Length of message is greater than required: %d\n", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Update the callback and app_data for NOTIFY messages, GRE sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ncm->type) { - case NSS_GRE_REDIR_LAG_US_CMN_STATS_SYNC_MSG: - nss_gre_redir_lag_us_stats_sync(nss_ctx, &ngrm->msg.us_sync_stats, ncm->interface); - nss_gre_redir_lag_us_stats_notify(nss_ctx, ncm->interface); - break; - - case NSS_GRE_REDIR_LAG_US_DB_HASH_NODE_MSG: - nss_gre_redir_lag_us_hash_update_stats_req(nss_ctx, ngrm); - break; - } - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_gre_redir_lag_us_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call gre tunnel callback - */ - cb(ctx, ncm); -} - -/* - * nss_gre_redir_lag_us_tx_msg_with_size() - * Transmit a GRE message to NSSFW with size. - */ -static nss_tx_status_t nss_gre_redir_lag_us_tx_msg_with_size(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_us_msg *msg, uint32_t size) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Sanity check the message. Interface should be a dynamic - * interface of type NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US. - */ - if (!nss_gre_redir_lag_us_verify_ifnum(ncm->interface)) { - nss_warning("%px: tx request for another interface: %d\n", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_GRE_REDIR_LAG_US_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), size); -} - -/* - * nss_gre_redir_lag_us_tx_msg_sync_with_size() - * Transmit a GRE LAG message to NSS firmware synchronously with size. - */ -static nss_tx_status_t nss_gre_redir_lag_us_tx_msg_sync_with_size(struct nss_ctx_instance *nss_ctx, - struct nss_gre_redir_lag_us_msg *ngrm, uint32_t size) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_gre_redir_lag_us_sync_ctx.sem); - - /* - * Save the client's callback, and initialize the message - * with the callback which releases the semaphore after message - * response is received, This callback will inturn call the client's - * callback. - */ - nss_gre_redir_lag_us_sync_ctx.cb = (void *)ngrm->cm.cb; - nss_gre_redir_lag_us_sync_ctx.app_data = (void *)ngrm->cm.app_data; - ngrm->cm.cb = (nss_ptr_t)nss_gre_redir_lag_us_callback; - ngrm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_gre_redir_lag_us_tx_msg_with_size(nss_ctx, ngrm, size); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: gre_tx_msg failed\n", nss_ctx); - up(&nss_gre_redir_lag_us_sync_ctx.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_gre_redir_lag_us_sync_ctx.complete, msecs_to_jiffies(NSS_GRE_REDIR_LAG_US_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: GRE LAG US tx sync failed due to timeout\n", nss_ctx); - nss_gre_redir_lag_us_sync_ctx.response = NSS_TX_FAILURE; - } - - status = nss_gre_redir_lag_us_sync_ctx.response; - up(&nss_gre_redir_lag_us_sync_ctx.sem); - return status; -} - -/* - * nss_gre_redir_lag_us_stats_sync_req_work() - * Work function for hash statistics synchronization. - */ -static void nss_gre_redir_lag_us_stats_sync_req_work(struct work_struct *work) -{ - struct delayed_work *d_work = container_of(work, struct delayed_work, work); - struct nss_gre_redir_lag_us_pvt_sync_stats *sync_ctx = container_of(d_work, struct nss_gre_redir_lag_us_pvt_sync_stats, - nss_gre_redir_lag_us_work); - struct nss_gre_redir_lag_us_hash_stats_query_msg *nicsm_req = &(sync_ctx->db_sync_msg.msg.hash_stats); - nss_tx_status_t nss_tx_status; - nss_gre_redir_lag_us_msg_callback_t cb; - void *app_data; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_lag_us_get_context(); - int retry = NSS_GRE_REDIR_LAG_US_STATS_SYNC_RETRY; - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - cb = sync_ctx->cb; - app_data = sync_ctx->app_data; - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - - nss_cmn_msg_init(&(sync_ctx->db_sync_msg.cm), sync_ctx->ifnum, - NSS_GRE_REDIR_LAG_US_DB_HASH_NODE_MSG, sizeof(struct nss_gre_redir_lag_us_hash_stats_query_msg), - cb, app_data); - while (retry) { - nss_tx_status = nss_gre_redir_lag_us_tx_msg_sync_with_size(nss_ctx, &(sync_ctx->db_sync_msg), PAGE_SIZE); - if (nss_tx_status == NSS_TX_SUCCESS) { - return; - } - - retry--; - nss_warning("%px: TX_NOT_OKAY, try again later\n", nss_ctx); - usleep_range(100, 200); - } - - /* - * TX failed after retries, take fresh start. - */ - nicsm_req->count = 0; - nicsm_req->db_entry_idx = 0; - queue_delayed_work(cmn_ctx.nss_gre_redir_lag_us_wq, &(sync_ctx->nss_gre_redir_lag_us_work), NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD); -} - -/* - * nss_gre_redir_lag_us_sync_work_init() - * Initialize work. - */ -static bool nss_gre_redir_lag_us_sync_work_init(uint32_t ifnum) -{ - struct nss_gre_redir_lag_us_hash_stats_query_msg *hash_stats_msg; - struct nss_ctx_instance __maybe_unused *nss_ctx = nss_gre_redir_lag_us_get_context(); - int ret, idx; - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (!nss_gre_redir_lag_us_get_node_idx(ifnum, &idx)) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("%px: Unable to init work. Stats context not found.\n", nss_ctx); - return false; - } - - hash_stats_msg = &(cmn_ctx.stats_ctx[idx].db_sync_msg.msg.hash_stats); - hash_stats_msg->db_entry_idx = 0; - INIT_DELAYED_WORK(&(cmn_ctx.stats_ctx[idx].nss_gre_redir_lag_us_work), nss_gre_redir_lag_us_stats_sync_req_work); - ret = queue_delayed_work(cmn_ctx.nss_gre_redir_lag_us_wq, - &(cmn_ctx.stats_ctx[idx].nss_gre_redir_lag_us_work), NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD); - if (!ret) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("%px: Unable to queue work function to work queue\n", nss_ctx); - return false; - } - - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - return true; -} - -/* - * nss_gre_redir_lag_us_unregister_if() - * Unregister GRE redirect LAG upstream node. - */ -static enum nss_gre_redir_lag_err_types nss_gre_redir_lag_us_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_lag_us_get_context(); - uint32_t status; - int idx; - - nss_assert(nss_ctx); - nss_assert(!nss_gre_redir_lag_us_verify_ifnum(if_num)); - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for gre_lag interface %d with NSS core\n", nss_ctx, if_num); - return NSS_GRE_REDIR_LAG_ERR_CORE_UNREGISTER_FAILED; - } - - status = nss_core_unregister_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for gre_lag interface %d with NSS core\n", nss_ctx, if_num); - return NSS_GRE_REDIR_LAG_ERR_CORE_UNREGISTER_FAILED; - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (!nss_gre_redir_lag_us_get_node_idx(if_num, &idx)) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("Stats context not found.\n"); - return NSS_GRE_REDIR_LAG_ERR_STATS_INDEX_NOT_FOUND; - } - - cmn_ctx.stats_ctx[idx].cb = NULL; - cmn_ctx.stats_ctx[idx].app_data = NULL; - cmn_ctx.stats_ctx[idx].valid = false; - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - - /* - * Work is per LAG US node. Cancel works for this node. - */ - cancel_delayed_work_sync(&(cmn_ctx.stats_ctx[idx].nss_gre_redir_lag_us_work)); - return NSS_GRE_REDIR_LAG_SUCCESS; -} - -/* - * nss_gre_redir_lag_us_register_if() - * Register GRE redirect LAG upstream node. - */ -static struct nss_ctx_instance *nss_gre_redir_lag_us_register_if(uint32_t if_num, struct net_device *netdev, - nss_gre_redir_lag_us_data_callback_t cb_func_data, - nss_gre_redir_lag_us_msg_callback_t cb_func_msg, uint32_t features, uint32_t type, void *app_ctx) -{ - struct nss_ctx_instance *nss_ctx = nss_gre_redir_lag_us_get_context(); - uint32_t status; - int i; - nss_assert(nss_ctx); - nss_assert(!nss_gre_redir_lag_us_verify_ifnum(if_num)); - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - for (i = 0; i < NSS_GRE_REDIR_LAG_MAX_NODE; i++) { - if (!cmn_ctx.stats_ctx[i].valid) { - cmn_ctx.stats_ctx[i].ifnum = if_num; - cmn_ctx.stats_ctx[i].valid = true; - cmn_ctx.stats_ctx[i].cb = cb_func_msg; - cmn_ctx.stats_ctx[i].app_data = app_ctx; - break; - } - } - - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (i == NSS_GRE_REDIR_LAG_MAX_NODE) { - nss_warning("Maximum number of LAG nodes are already present.\n"); - return NULL; - } - - /* - * Registering handler for sending tunnel interface msgs to NSS. - */ - status = nss_core_register_handler(nss_ctx, if_num, nss_gre_redir_lag_us_msg_handler, app_ctx); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to register handler for gre_lag interface %d with NSS core\n", nss_ctx, if_num); - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - cmn_ctx.stats_ctx[i].valid = false; - cmn_ctx.stats_ctx[i].cb = NULL; - cmn_ctx.stats_ctx[i].app_data = NULL; - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - return NULL; - } - - /* - * Registering handler for sending tunnel interface msgs to NSS. - */ - status = nss_core_register_msg_handler(nss_ctx, if_num, cb_func_msg); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: Not able to register handler for gre_lag interface %d with NSS core\n", nss_ctx, if_num); - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - cmn_ctx.stats_ctx[i].valid = false; - cmn_ctx.stats_ctx[i].cb = NULL; - cmn_ctx.stats_ctx[i].app_data = NULL; - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, cb_func_data, NULL, NULL, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); - return nss_ctx; -} - -/* - * nss_gre_redir_lag_us_get_node_idx() - * Returns index of statistics context. - */ -bool nss_gre_redir_lag_us_get_node_idx(uint32_t ifnum, uint32_t *idx) -{ - uint32_t node_idx; - for (node_idx = 0; node_idx < NSS_GRE_REDIR_LAG_MAX_NODE; node_idx++) { - if ((cmn_ctx.stats_ctx[node_idx].valid) && (cmn_ctx.stats_ctx[node_idx].ifnum == ifnum)) { - *idx = node_idx; - return true; - } - } - - return false; -} - -/* - * nss_gre_redir_lag_us_verify_ifnum() - * Verify interface type. - */ -bool nss_gre_redir_lag_us_verify_ifnum(uint32_t if_num) -{ - return nss_dynamic_interface_get_type(nss_gre_redir_lag_us_get_context(), if_num) == NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US; -} - -/* - * nss_gre_redir_lag_us_get_context() - * Retrieve context for GRE redirect LAG upstream node. - */ -struct nss_ctx_instance *nss_gre_redir_lag_us_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_redir_lag_us_handler_id]; -} -EXPORT_SYMBOL(nss_gre_redir_lag_us_get_context); - -/* - * nss_gre_redir_lag_us_configure_node() - * Configure upstream lag node. - */ -bool nss_gre_redir_lag_us_configure_node(uint32_t ifnum, - struct nss_gre_redir_lag_us_config_msg *ngluc) -{ - struct nss_gre_redir_lag_us_msg *config; - uint32_t len, iftype, idx = 0, i; - bool ret; - nss_tx_status_t status; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_ctx = nss_gre_redir_lag_us_get_context(); - - if (!nss_ctx) { - nss_warning("Unable to retrieve NSS context.\n"); - return false; - } - - config = (struct nss_gre_redir_lag_us_msg *) kzalloc(sizeof(struct nss_gre_redir_lag_us_msg), GFP_KERNEL); - if (!config) { - nss_warning("%px: Unable to allocate memory to send configure message.\n", nss_ctx); - return false; - } - - iftype = nss_dynamic_interface_get_type(nss_ctx, ifnum); - if (iftype != NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US) { - nss_warning("%px: Incorrect interface type %u\n", nss_ctx, iftype); - kfree(config); - return false; - } - - if (!ngluc) { - nss_warning("%px: Pointer to GRE redir LAG US message is NULL.\n", nss_ctx); - kfree(config); - return false; - } - - if ((ngluc->num_slaves < NSS_GRE_REDIR_LAG_MIN_SLAVE) || (ngluc->num_slaves > NSS_GRE_REDIR_LAG_MAX_SLAVE)) { - nss_warning("%px: Number of slaves is not in reange\n", nss_ctx); - kfree(config); - return false; - } - - ret = nss_gre_redir_lag_us_sync_work_init(ifnum); - if (!ret) { - nss_warning("%px: Unable to initialize work queue\n", nss_ctx); - kfree(config); - return false; - } - - len = sizeof(struct nss_gre_redir_lag_us_msg) - sizeof(struct nss_cmn_msg); - nss_cmn_msg_init(&config->cm, ifnum, NSS_GRE_REDIR_LAG_US_CONFIG_MSG, len, NULL, NULL); - config->msg.config_us.hash_mode = ngluc->hash_mode; - config->msg.config_us.num_slaves = ngluc->num_slaves; - for (i = 0; i < ngluc->num_slaves; i++) { - config->msg.config_us.if_num[i] = ngluc->if_num[i]; - } - - status = nss_gre_redir_lag_us_tx_msg_sync(nss_ctx, config); - kfree(config); - if (status == NSS_TX_SUCCESS) { - return true; - } - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (nss_gre_redir_lag_us_get_node_idx(ifnum, &idx)) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("%px: Stats context not found.\n", nss_ctx); - return false; - } - - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - - /* - * Work is per LAG US node. Cancel work as configuration failed. - */ - cancel_delayed_work_sync(&(cmn_ctx.stats_ctx[idx].nss_gre_redir_lag_us_work)); - nss_warning("%px: Unable to configure upstream lag node %d.\n", nss_ctx, ifnum); - return false; -} -EXPORT_SYMBOL(nss_gre_redir_lag_us_configure_node); - -/* - * nss_gre_redir_lag_us_tx_msg() - * Transmit a GRE LAG message to NSS firmware asynchronously. - */ -nss_tx_status_t nss_gre_redir_lag_us_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_us_msg *ngrm) -{ - /* - * Trace messages. - */ - nss_gre_redir_lag_us_log_tx_msg(ngrm); - - return nss_gre_redir_lag_us_tx_msg_with_size(nss_ctx, ngrm, NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_gre_redir_lag_us_tx_msg); - -/* - * nss_gre_redir_lag_us_tx_msg_sync() - * Transmit a GRE lag message to NSS firmware synchronously. - */ -nss_tx_status_t nss_gre_redir_lag_us_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_lag_us_msg *ngrm) -{ - return nss_gre_redir_lag_us_tx_msg_sync_with_size(nss_ctx, ngrm, NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_gre_redir_lag_us_tx_msg_sync); - -/* - * nss_gre_redir_lag_us_unregister_and_dealloc() - * Unregister and deallocate nss gre redirect LAG US node. - */ -enum nss_gre_redir_lag_err_types nss_gre_redir_lag_us_unregister_and_dealloc(uint32_t ifnum) -{ - uint32_t ret; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_lag_us_get_context(); - nss_tx_status_t status; - - if (!nss_gre_redir_lag_us_verify_ifnum(ifnum)) { - nss_warning("%px: Unknown interface type %u.\n", nss_ctx, ifnum); - return NSS_GRE_REDIR_LAG_ERR_INCORRECT_IFNUM; - } - - ret = nss_gre_redir_lag_us_unregister_if(ifnum); - if (ret) { - nss_warning("%px: Unable to unregister interface %u.\n", nss_ctx, ifnum); - return ret; - } - - status = nss_dynamic_interface_dealloc_node(ifnum, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to deallocate node %u\n", nss_ctx, ifnum); - return NSS_GRE_REDIR_LAG_ERR_DEALLOC_FAILED; - } - - return NSS_GRE_REDIR_LAG_SUCCESS; -} -EXPORT_SYMBOL(nss_gre_redir_lag_us_unregister_and_dealloc); - -/* - * nss_gre_redir_lag_us_alloc_and_register_node() - * Allocates and registers GRE upstream type dynamic nodes with NSS. - */ -int nss_gre_redir_lag_us_alloc_and_register_node(struct net_device *dev, - nss_gre_redir_lag_us_data_callback_t cb_func_data, - nss_gre_redir_lag_us_msg_callback_t cb_func_msg, void *app_ctx) -{ - int ifnum; - nss_tx_status_t status; - struct nss_ctx_instance *nss_ctx; - - ifnum = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US); - if (ifnum == -1) { - nss_warning("%px: Unable to allocate GRE_LAG node of type = %u\n", dev, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US); - return -1; - } - - nss_ctx = nss_gre_redir_lag_us_register_if(ifnum, dev, cb_func_data, - cb_func_msg, 0, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US, app_ctx); - if (!nss_ctx) { - nss_warning("%px: Unable to register GRE_LAG node of type = %u\n", dev, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US); - status = nss_dynamic_interface_dealloc_node(ifnum, NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_LAG_US); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to deallocate node.\n", dev); - } - - return -1; - } - - return ifnum; -} -EXPORT_SYMBOL(nss_gre_redir_lag_us_alloc_and_register_node); - -/* - * nss_gre_redir_lag_us_register_handler() - * Registering handler for sending msg to base gre_lag node on NSS. - */ -void nss_gre_redir_lag_us_register_handler(void) -{ - struct dentry *d_entry = nss_gre_redir_lag_us_stats_dentry_create(); - - if (!d_entry) { - nss_warning(" Unable to create debugfs entry for LAG US node.\n"); - return; - } - - cmn_ctx.nss_gre_redir_lag_us_wq = create_singlethread_workqueue("nss_gre_redir_lag_us_workqueue"); - if (!cmn_ctx.nss_gre_redir_lag_us_wq) { - debugfs_remove_recursive(d_entry); - nss_warning("Unable to create workqueue for LAG US node.\n"); - return; - } - - nss_gre_redir_lag_us_strings_dentry_create(); - nss_gre_redir_lag_us_sync_ctx.cb = NULL; - nss_gre_redir_lag_us_sync_ctx.app_data = NULL; - sema_init(&nss_gre_redir_lag_us_sync_ctx.sem, 1); - init_completion(&nss_gre_redir_lag_us_sync_ctx.complete); - spin_lock_init(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_log.c deleted file mode 100644 index 8601979d4..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_log.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_gre_redir_lag_us_log.c - * NSS GRE REDIR LAG US logger file. - */ - -#include "nss_core.h" - -/* - * nss_gre_redir_lag_us_log_message_types_str - * GRE REDIR LAG US message strings - */ -static int8_t *nss_gre_redir_lag_us_log_message_types_str[NSS_GRE_REDIR_LAG_US_MAX_MSG_TYPES] __maybe_unused = { - "GRE REDIR LAG US config Message", - "GRE REDIR LAG US add hash node message", - "GRE REDIR LAG US delete hash node message", - "GRE REDIR LAG US query hash node message", - "GRE REDIR LAG US stats sync message", - "GRE REDIR LAG US DB hash node message", -}; - -/* - * nss_gre_redir_lag_us_log_error_response_types_str - * Strings for error types for GRE REDIR LAG US messages - */ -static int8_t *nss_gre_redir_lag_us_log_error_response_types_str[NSS_GRE_REDIR_LAG_ERR_MAX] __maybe_unused = { - "GRE REDIR LAG Success", - "GRE REDIR LAG Incorrect Interface", - "GRE REDIR LAG US Core Unregister Failed", - "GRE REDIR LAG US STats Index Not Found", - "GRE REDIR LAG Dealloc Failed", -}; - -/* - * nss_gre_redir_lag_us_log_config_msg() - * Log NSS GRE REDIR LAG US config message. - */ -static void nss_gre_redir_lag_us_log_config_msg(struct nss_gre_redir_lag_us_msg *ngm) -{ - struct nss_gre_redir_lag_us_config_msg *ngcm __maybe_unused = &ngm->msg.config_us; - nss_trace("%px: NSS GRE REDIR LAG Config Message:\n" - "GRE REDIR LAG US Hash Mode: %d\n" - "GRE REDIR LAG US Number of Slaves: %d\n" - "GRE REDIR LAG US Interface Number: %px\n", - ngcm, ngcm->hash_mode, ngcm->num_slaves, - ngcm->if_num); -} - -/* - * nss_gre_redir_lag_us_log_add_hash_node_msg() - * Log NSS GRE REDIR LAG US add hash node message. - */ -static void nss_gre_redir_lag_us_log_add_hash_node_msg(struct nss_gre_redir_lag_us_msg *ngm) -{ - struct nss_gre_redir_lag_us_add_hash_node_msg *ngam __maybe_unused = &ngm->msg.add_hash; - nss_trace("%px: NSS GRE REDIR LAG Add Hash Node Message:\n" - "GRE REDIR LAG US Interface Number: %d\n" - "GRE REDIR LAG US Source MAC: %px\n" - "GRE REDIR LAG US Destination MAC: %px\n", - ngam, ngam->if_num, ngam->src_mac, - ngam->dest_mac); -} - -/* - * nss_gre_redir_lag_us_log_del_hash_node_msg() - * Log NSS GRE REDIR LAG US del hash node message. - */ -static void nss_gre_redir_lag_us_log_del_hash_node_msg(struct nss_gre_redir_lag_us_msg *ngm) -{ - struct nss_gre_redir_lag_us_del_hash_node_msg *ngdm __maybe_unused = &ngm->msg.del_hash; - nss_trace("%px: NSS GRE REDIR LAG Del Hash Node Message:\n" - "GRE REDIR LAG US Source MAC: %px\n" - "GRE REDIR LAG US Destination MAC: %px\n", - ngdm, ngdm->src_mac,ngdm->dest_mac); -} - -/* - * nss_gre_redir_lag_us_log_query_hash_node_msg() - * Log NSS GRE REDIR LAG US query hash node message. - */ -static void nss_gre_redir_lag_us_log_query_hash_node_msg(struct nss_gre_redir_lag_us_msg *ngm) -{ - struct nss_gre_redir_lag_us_query_hash_node_msg *ngqm __maybe_unused = &ngm->msg.query_hash; - nss_trace("%px: NSS GRE REDIR LAG Query Hash Node Message:\n" - "GRE REDIR LAG US Source MAC: %px\n" - "GRE REDIR LAG US Destination MAC: %px\n" - "GRE REDIR LAG US Interface Number: %d\n", - ngqm, ngqm->src_mac, ngqm->dest_mac, - ngqm->ifnum); -} - -/* - * nss_gre_redir_lag_us_log_verbose() - * Log message contents. - */ -static void nss_gre_redir_lag_us_log_verbose(struct nss_gre_redir_lag_us_msg *ngm) -{ - switch (ngm->cm.type) { - case NSS_GRE_REDIR_LAG_US_CONFIG_MSG: - nss_gre_redir_lag_us_log_config_msg(ngm); - break; - - case NSS_GRE_REDIR_LAG_US_ADD_HASH_NODE_MSG: - nss_gre_redir_lag_us_log_add_hash_node_msg(ngm); - break; - - case NSS_GRE_REDIR_LAG_US_DEL_HASH_NODE_MSG: - nss_gre_redir_lag_us_log_del_hash_node_msg(ngm); - break; - - case NSS_GRE_REDIR_LAG_US_QUERY_HASH_NODE_MSG: - nss_gre_redir_lag_us_log_query_hash_node_msg(ngm); - break; - - case NSS_GRE_REDIR_LAG_US_CMN_STATS_SYNC_MSG: - case NSS_GRE_REDIR_LAG_US_DB_HASH_NODE_MSG: - /* - * No log for valid stats message. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", ngm); - break; - } -} - -/* - * nss_gre_redir_lag_us_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_gre_redir_lag_us_log_tx_msg(struct nss_gre_redir_lag_us_msg *ngm) -{ - if (ngm->cm.type >= NSS_GRE_REDIR_LAG_US_MAX_MSG_TYPES) { - nss_warning("%px: Invalid message type\n", ngm); - return; - } - - nss_info("%px: type[%d]:%s\n", ngm, ngm->cm.type, nss_gre_redir_lag_us_log_message_types_str[ngm->cm.type]); - nss_gre_redir_lag_us_log_verbose(ngm); -} - -/* - * nss_gre_redir_lag_us_log_rx_msg() - * Log messages received from FW. - */ -void nss_gre_redir_lag_us_log_rx_msg(struct nss_gre_redir_lag_us_msg *ngm) -{ - if (ngm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ngm); - return; - } - - if (ngm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ngm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ngm, ngm->cm.type, - nss_gre_redir_lag_us_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response]); - goto verbose; - } - - if (ngm->cm.error >= NSS_GRE_REDIR_LAG_ERR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ngm, ngm->cm.type, nss_gre_redir_lag_us_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response], - ngm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ngm, ngm->cm.type, nss_gre_redir_lag_us_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response], - ngm->cm.error, nss_gre_redir_lag_us_log_error_response_types_str[ngm->cm.error]); - -verbose: - nss_gre_redir_lag_us_log_verbose(ngm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_log.h deleted file mode 100644 index cbda8d93a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_LAG_US_LOG_H__ -#define __NSS_GRE_REDIR_LAG_US_LOG_H__ - -/* - * nss_gre_redir_lag_us_log.h - * NSS GRE REDIR LAG US Log Header File - */ - -/* - * nss_gre_redir_lag_us_log_tx_msg - * Logs a gre redir lag us message that is sent to the NSS firmware. - */ -void nss_gre_redir_lag_us_log_tx_msg(struct nss_gre_redir_lag_us_msg *ngm); - -/* - * nss_gre_redir_lag_us_log_rx_msg - * Logs a gre redir lag us message that is received from the NSS firmware. - */ -void nss_gre_redir_lag_us_log_rx_msg(struct nss_gre_redir_lag_us_msg *ngm); - -#endif /* __NSS_GRE_REDIR_LAG_US_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.c deleted file mode 100644 index 2b291bfd3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_gre_redir_lag.h" -#include "nss_gre_redir_lag_us_stats.h" -#include "nss_gre_redir_lag_us_strings.h" - -#define NSS_GRE_REDIR_LAG_US_STATS_SYNC_PERIOD msecs_to_jiffies(4000) -#define NSS_GRE_REDIR_LAG_US_STATS_SYNC_UDELAY 4000 - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_gre_redir_lag_us_stats_notifier); - -extern struct nss_gre_redir_lag_us_cmn_ctx cmn_ctx; - -/* - * nss_gre_redir_lag_us_stats_get - * Get the common upstream statistics. - */ -bool nss_gre_redir_lag_us_stats_get(struct nss_gre_redir_lag_us_tunnel_stats *cmn_stats, uint32_t index) -{ - if (index >= NSS_GRE_REDIR_LAG_MAX_NODE) { - nss_warning("Index is out of valid range %u\n", index); - return false; - } - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (!cmn_ctx.stats_ctx[index].valid) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("Common context not found for the index %u\n", index); - return false; - } - - memcpy((void *)cmn_stats, (void *)&(cmn_ctx.stats_ctx[index].tun_stats), sizeof(*cmn_stats)); - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - return true; -} - -/* - * nss_gre_redir_lag_us_cmn_stats_read() - * Read and copy stats to user buffer. - */ -static ssize_t nss_gre_redir_lag_us_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_GRE_REDIR_LAG_US_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - struct nss_stats_data *data = fp->private_data; - struct nss_gre_redir_lag_us_tunnel_stats stats; - ssize_t bytes_read = 0; - size_t size_wr = 0; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - while (data->index < NSS_GRE_REDIR_LAG_MAX_NODE) { - if (nss_gre_redir_lag_us_stats_get(&stats, data->index)) { - break; - } - - data->index++; - } - - if (data->index == NSS_GRE_REDIR_LAG_MAX_NODE) { - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre_redir_lag_us stats", NSS_STATS_SINGLE_CORE); - size_wr += nss_stats_print("gre_redir_lag_us", NULL, NSS_STATS_SINGLE_INSTANCE, nss_gre_redir_lag_us_strings_stats, - &stats.rx_packets, NSS_GRE_REDIR_LAG_US_STATS_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - data->index++; - kfree(lbuf); - return bytes_read; -} - -/* - * nss_gre_redir_lag_us_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(gre_redir_lag_us_cmn) - -/* - * nss_gre_redir_lag_us_stats_dentry_create() - * Create debugfs directory for stats. - */ -struct dentry *nss_gre_redir_lag_us_stats_dentry_create(void) -{ - struct dentry *gre_redir; - struct dentry *cmn_stats; - - gre_redir = nss_gre_redir_get_dentry(); - if (unlikely(!gre_redir)) { - nss_warning("Failed to retrieve directory entry qca-nss-drv/stats/gre_redir/\n"); - return NULL; - } - - cmn_stats = debugfs_create_file("lag_us_cmn_stats", 0400, gre_redir, - &nss_top_main, &nss_gre_redir_lag_us_cmn_stats_ops); - if (unlikely(!cmn_stats)) { - nss_warning("Failed to create qca-nss-drv/stats/gre_redir/lag_us_cmn_stats file\n"); - return NULL; - } - - return cmn_stats; -} - -/* - * nss_gre_redir_lag_us_stats_sync() - * Update synchonized statistics. - */ -void nss_gre_redir_lag_us_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_gre_redir_lag_us_cmn_sync_stats_msg *ngss, uint32_t ifnum) -{ - int idx, j; - struct nss_gre_redir_lag_us_tunnel_stats *node_stats; - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (!nss_gre_redir_lag_us_get_node_idx(ifnum, &idx)) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); - return; - } - - node_stats = &cmn_ctx.stats_ctx[idx].tun_stats; - - node_stats->tx_packets += ngss->node_stats.tx_packets; - node_stats->tx_bytes += ngss->node_stats.tx_bytes; - node_stats->rx_packets += ngss->node_stats.rx_packets; - node_stats->rx_bytes += ngss->node_stats.rx_bytes; - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - node_stats->rx_dropped[j] += ngss->node_stats.rx_dropped[j]; - } - - node_stats->us_stats.amsdu_pkts += ngss->us_stats.amsdu_pkts; - node_stats->us_stats.amsdu_pkts_enqueued += ngss->us_stats.amsdu_pkts_enqueued; - node_stats->us_stats.amsdu_pkts_exceptioned += ngss->us_stats.amsdu_pkts_exceptioned; - node_stats->us_stats.exceptioned += ngss->us_stats.exceptioned; - node_stats->us_stats.freed += ngss->us_stats.freed; - node_stats->db_stats.add_attempt += ngss->db_stats.add_attempt; - node_stats->db_stats.add_success += ngss->db_stats.add_success; - node_stats->db_stats.add_fail_table_full += ngss->db_stats.add_fail_table_full; - node_stats->db_stats.add_fail_exists += ngss->db_stats.add_fail_exists; - node_stats->db_stats.del_attempt += ngss->db_stats.del_attempt; - node_stats->db_stats.del_success += ngss->db_stats.del_success; - node_stats->db_stats.del_fail_not_found += ngss->db_stats.del_fail_not_found; - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); -} - -/* - * nss_gre_redir_lag_us_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_gre_redir_lag_us_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_gre_redir_lag_us_stats_notification *stats_notify; - int idx; - - stats_notify = kzalloc(sizeof(struct nss_gre_redir_lag_us_stats_notification), GFP_ATOMIC); - if (!stats_notify) { - nss_warning("Unable to allocate memory for stats notification\n"); - return; - } - - spin_lock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - if (!nss_gre_redir_lag_us_get_node_idx(if_num, &idx)) { - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - nss_warning("%px: Unable to update hash stats msg. Stats context not found.\n", nss_ctx); - kfree(stats_notify); - return; - } - - stats_notify->core_id = nss_ctx->id; - stats_notify->if_num = if_num; - memcpy(&(stats_notify->stats_ctx), &(cmn_ctx.stats_ctx[idx].tun_stats), sizeof(stats_notify->stats_ctx)); - spin_unlock_bh(&cmn_ctx.nss_gre_redir_lag_us_stats_lock); - atomic_notifier_call_chain(&nss_gre_redir_lag_us_stats_notifier, NSS_STATS_EVENT_NOTIFY, stats_notify); - kfree(stats_notify); -} - -/* - * nss_gre_redir_lag_us_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_gre_redir_lag_us_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_gre_redir_lag_us_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_redir_lag_us_stats_unregister_notifier); - -/* - * nss_gre_redir_lag_us_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_gre_redir_lag_us_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_gre_redir_lag_us_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_redir_lag_us_stats_register_notifier); - diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.h deleted file mode 100644 index 9f223122d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_stats.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_LAG_US_STATS_H__ -#define __NSS_GRE_REDIR_LAG_US_STATS_H__ - -/* - * nss_gre_redir_lag_us_pvt_sync_stats - * Hash statistics synchronization context. - */ -struct nss_gre_redir_lag_us_pvt_sync_stats { - struct delayed_work nss_gre_redir_lag_us_work; /**< Delayed work per LAG US node. */ - struct nss_gre_redir_lag_us_msg db_sync_msg; /**< Hash statistics message. */ - struct nss_gre_redir_lag_us_tunnel_stats tun_stats; /**< GRE redirect LAG common statistics. */ - nss_gre_redir_lag_us_msg_callback_t cb; /**< Callback for hash query message. */ - void *app_data; /**< app_data for hash query message. */ - uint32_t ifnum; /**< NSS interface number. */ - bool valid; /**< Valid flag. */ -}; - -/* - * Common context for stats update. - */ -struct nss_gre_redir_lag_us_cmn_ctx { - struct workqueue_struct *nss_gre_redir_lag_us_wq; /**< Work queue. */ - spinlock_t nss_gre_redir_lag_us_stats_lock; /**< Spin lock. */ - struct nss_gre_redir_lag_us_pvt_sync_stats stats_ctx[NSS_GRE_REDIR_LAG_MAX_NODE]; -}; - -extern void nss_gre_redir_lag_us_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern bool nss_gre_redir_lag_us_get_node_idx(uint32_t ifnum, uint32_t *idx); -extern bool nss_gre_redir_lag_us_verify_ifnum(uint32_t if_num); -extern void nss_gre_redir_lag_us_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_gre_redir_lag_us_cmn_sync_stats_msg *ngss, uint32_t ifnum); -extern struct dentry *nss_gre_redir_lag_us_stats_dentry_create(void); - -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.c deleted file mode 100644 index c1dca2bad..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_gre_redir_lag_us_strings.h" - -/* - * nss_gre_redir_lag_us_strings_stats - * GRE REDIR LAG US common statistics strings. - */ -struct nss_stats_info nss_gre_redir_lag_us_strings_stats[NSS_GRE_REDIR_LAG_US_STATS_MAX] = { - {"rx_packets", NSS_STATS_TYPE_COMMON}, - {"rx_bytes", NSS_STATS_TYPE_COMMON}, - {"tx_packets", NSS_STATS_TYPE_COMMON}, - {"tx_bytes", NSS_STATS_TYPE_COMMON}, - {"rx_dropped_0", NSS_STATS_TYPE_DROP}, - {"rx_dropped_1", NSS_STATS_TYPE_DROP}, - {"rx_dropped_2", NSS_STATS_TYPE_DROP}, - {"rx_dropped_3", NSS_STATS_TYPE_DROP}, - {"Amsdu pkts", NSS_STATS_TYPE_SPECIAL}, - {"Amsdu pkts enqueued", NSS_STATS_TYPE_SPECIAL}, - {"Amsdu pkts exceptioned", NSS_STATS_TYPE_EXCEPTION}, - {"Exceptioned", NSS_STATS_TYPE_EXCEPTION}, - {"Freed", NSS_STATS_TYPE_SPECIAL}, - {"add attempt", NSS_STATS_TYPE_SPECIAL}, - {"add success", NSS_STATS_TYPE_SPECIAL}, - {"add fail table full", NSS_STATS_TYPE_SPECIAL}, - {"add fail exists", NSS_STATS_TYPE_SPECIAL}, - {"del attempt", NSS_STATS_TYPE_SPECIAL}, - {"del success", NSS_STATS_TYPE_SPECIAL}, - {"del fail not found", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_gre_redir_lag_us_strings_read() - * Read gre_redir_lag_us statistics names - */ -static ssize_t nss_gre_redir_lag_us_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_gre_redir_lag_us_strings_stats, NSS_GRE_REDIR_LAG_US_STATS_MAX); -} - -/* - * nss_gre_redir_lag_us_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_redir_lag_us); - -/* - * nss_gre_redir_lag_us_strings_dentry_create() - * Create gre_redir_lag_us statistics strings debug entry. - */ -void nss_gre_redir_lag_us_strings_dentry_create(void) -{ - nss_strings_create_dentry("gre_redir_lag_us", &nss_gre_redir_lag_us_strings_ops); -} - diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.h deleted file mode 100644 index 74c1054de..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_lag_us_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_LAG_US_STRINGS_H -#define __NSS_GRE_REDIR_LAG_US_STRINGS_H - -#include "nss_gre_redir_lag_us_stats.h" - -extern struct nss_stats_info nss_gre_redir_lag_us_strings_stats[NSS_GRE_REDIR_LAG_US_STATS_MAX]; -extern void nss_gre_redir_lag_us_strings_dentry_create(void); - -#endif /* __NSS_GRE_REDIR_LAG_US_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_log.c deleted file mode 100644 index 1ac6afbd2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_log.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_gre_redir_log.c - * NSS GRE REDIR logger file. - */ - -#include "nss_core.h" - -/* - * nss_gre_redir_log_message_types_str - * NSS GRE REDIR message strings - */ -static int8_t *nss_gre_redir_log_message_types_str[NSS_GRE_REDIR_MAX_MSG_TYPES] __maybe_unused = { - "GRE REDIR Tunnel Inner Configure", - "GRE REDIR Tunnel Outer Configure", - "GRE REDIR Interface Map", - "GRE REDIR Interface Unmap", - "GRE REDIR SJACK Map", - "GRE REDIR SJACK Unmap", - "GRE REDIR Stats Sync", - "GRE REDIR Exception DS register cb" -}; - -/* - * nss_gre_redir_log_inner_configure_msg() - * Log NSS GRE Redir inner configure message. - */ -static void nss_gre_redir_log_inner_configure_msg(struct nss_gre_redir_msg *ngm) -{ - struct nss_gre_redir_inner_configure_msg *ngicm __maybe_unused = &ngm->msg.inner_configure; - nss_trace("%px: NSS GRE Redir Inner Configure message" - "GRE REDIR IP Header Type: %d\n" - "GRE REDIR Source IP: %px\n" - "GRE REDIR Destination IP: %px\n" - "GRE REDIR Outer Interface: %d\n" - "GRE REDIR Do not Fragment: %d\n" - "GRE REDIR IP TTL: %d\n" - "GRE REDIR Version: %d\n", - ngicm, ngicm->ip_hdr_type, - ngicm->ip_src_addr, ngicm->ip_dest_addr, - ngicm->except_outerif, ngicm->ip_df_policy, - ngicm->ip_ttl, ngicm->gre_version); -} - -/* - * nss_gre_redir_log_interface_map_msg() - * Log NSS GRE Redir interface map message. - */ -static void nss_gre_redir_log_interface_map_msg(struct nss_gre_redir_msg *ngm) -{ - struct nss_gre_redir_interface_map_msg *ngicm __maybe_unused = &ngm->msg.interface_map; - nss_trace("%px: NSS GRE Redir Interface Map message" - "GRE REDIR NSS VAP Interface: %d\n" - "GRE REDIR Next Hop NSS Interface: %d\n" - "GRE REDIR Radio ID: %d\n" - "GRE REDIR VAP ID: %d\n" - "GRE REDIR LAG Flags: %x\n" - "GRE REDIR Tunnel Type: %d\n" - "GRE REDIR IPsec pattern: %d\n", - ngicm, ngicm->vap_nssif, - ngicm->nexthop_nssif, ngicm->radio_id, - ngicm->vap_id, ngicm->lag_en, - ngicm->tunnel_type, ngicm->ipsec_pattern); -} - -/* - * nss_gre_redir_log_interface_unmap_msg() - * Log NSS GRE Redir interface unmap message. - */ -static void nss_gre_redir_log_interface_unmap_msg(struct nss_gre_redir_msg *ngm) -{ - struct nss_gre_redir_interface_unmap_msg *ngicm __maybe_unused = &ngm->msg.interface_unmap; - nss_trace("%px: NSS GRE Redir Interface Map message" - "GRE REDIR NSS VAP Interface: %d\n" - "GRE REDIR Radio ID: %d\n" - "GRE REDIR VAP ID: %d\n", - ngicm, ngicm->vap_nssif, - ngicm->radio_id, ngicm->vap_id); -} - -/* - * nss_gre_redir_log_sjack_map_msg() - * Log NSS GRE Redir interface map message. - */ -static void nss_gre_redir_log_sjack_map_msg(struct nss_gre_redir_msg *ngm) -{ - struct nss_gre_redir_sjack_map_msg *ngscm __maybe_unused = &ngm->msg.sjack_map; - nss_trace("%px: NSS GRE Redir SJACK Map message" - "GRE REDIR Eth NSS Interface: %d\n" - "GRE REDIR Eth Interface ID: %d\n" - "GRE REDIR IPSec pattern: %x\n", - ngscm, ngscm->eth_nssif, - ngscm->eth_id, ngscm->ipsec_pattern); -} - -/* - * nss_gre_redir_log_sjack_unmap_msg() - * Log NSS GRE Redir interface unmap message. - */ -static void nss_gre_redir_log_sjack_unmap_msg(struct nss_gre_redir_msg *ngm) -{ - struct nss_gre_redir_sjack_unmap_msg *ngscm __maybe_unused = &ngm->msg.sjack_unmap; - nss_trace("%px: NSS GRE Redir SJACK Map message" - "GRE REDIR Eth NSS Interface: %d\n" - "GRE REDIR Eth Interface ID: %d\n", - ngscm, ngscm->eth_nssif, - ngscm->eth_id); -} - -/* - * nss_gre_redir_log_outer_configure_msg() - * Log NSS GRE Redir outer configure message. - */ -static void nss_gre_redir_log_outer_configure_msg(struct nss_gre_redir_msg *ngm) -{ - struct nss_gre_redir_outer_configure_msg *ngocm __maybe_unused = &ngm->msg.outer_configure; - nss_trace("%px: NSS GRE Redir Outer Configure message" - "GRE REDIR IP Header Type: %d\n" - "GRE REDIR Host Inner Interface: %d\n" - "GRE REDIR NSS Inner Interface: %d\n" - "GRE REDIR SJACK Inner Interface: %d\n" - "GRE REDIR RPS: %d\n" - "GRE REDIR RPS Valid: %d\n", - ngocm, ngocm->ip_hdr_type, - ngocm->except_hostif, ngocm->except_offlif, - ngocm->except_sjackif, ngocm->rps_hint, - ngocm->rps_hint_valid); -} - -/* - * nss_gre_redir_log_exception_ds_reg_cb_msg() - * Log GRE exception downstream callback registration message. - */ -static void nss_gre_redir_log_exception_ds_reg_cb_msg(struct nss_gre_redir_msg *ngm) -{ - struct nss_gre_redir_exception_ds_reg_cb_msg *exception_ds_configure __maybe_unused = &ngm->msg.exception_ds_configure; - nss_trace("%px: NSS GRE redir exception completion callback registration message\n" - "vap_if_num: %d\n", ngm, exception_ds_configure->dst_vap_nssif); -} - -/* - * nss_gre_redir_log_verbose() - * Log message contents. - */ -static void nss_gre_redir_log_verbose(struct nss_gre_redir_msg *ngm) -{ - switch (ngm->cm.type) { - case NSS_GRE_REDIR_TX_TUNNEL_INNER_CONFIGURE_MSG: - nss_gre_redir_log_inner_configure_msg(ngm); - break; - - case NSS_GRE_REDIR_TX_TUNNEL_OUTER_CONFIGURE_MSG: - nss_gre_redir_log_outer_configure_msg(ngm); - break; - - case NSS_GRE_REDIR_TX_INTERFACE_MAP_MSG: - nss_gre_redir_log_interface_map_msg(ngm); - break; - - case NSS_GRE_REDIR_TX_INTERFACE_UNMAP_MSG: - nss_gre_redir_log_interface_unmap_msg(ngm); - break; - - case NSS_GRE_REDIR_TX_SJACK_MAP_MSG: - nss_gre_redir_log_sjack_map_msg(ngm); - break; - - case NSS_GRE_REDIR_TX_SJACK_UNMAP_MSG: - nss_gre_redir_log_sjack_unmap_msg(ngm); - break; - - case NSS_GRE_REDIR_RX_STATS_SYNC_MSG: - /* - * No log for valid stats message. - */ - break; - - case NSS_GRE_REDIR_EXCEPTION_DS_REG_CB_MSG: - nss_gre_redir_log_exception_ds_reg_cb_msg(ngm); - break; - - default: - nss_warning("%px: Invalid message type\n", ngm); - break; - } -} - -/* - * nss_gre_redir_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_gre_redir_log_tx_msg(struct nss_gre_redir_msg *ngm) -{ - if (ngm->cm.type >= NSS_GRE_REDIR_MAX_MSG_TYPES) { - nss_warning("%px: Invalid message type\n", ngm); - return; - } - - nss_info("%px: type[%d]:%s\n", ngm, ngm->cm.type, nss_gre_redir_log_message_types_str[ngm->cm.type]); - nss_gre_redir_log_verbose(ngm); -} - -/* - * nss_gre_redir_log_rx_msg() - * Log messages received from FW. - */ -void nss_gre_redir_log_rx_msg(struct nss_gre_redir_msg *ngm) -{ - if (ngm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ngm); - return; - } - - if (ngm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ngm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ngm, ngm->cm.type, - nss_gre_redir_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - ngm, ngm->cm.type, nss_gre_redir_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response]); - -verbose: - nss_gre_redir_log_verbose(ngm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_log.h deleted file mode 100644 index 7e1fb793e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_LOG_H -#define __NSS_GRE_REDIR_LOG_H - -/* - * nss_gre_redir_log.h - * NSS GRE REDIR Log header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_gre_redir_log_tx_msg - * Logs a gre_redir message that is sent to the NSS firmware. - */ -void nss_gre_redir_log_tx_msg(struct nss_gre_redir_msg *ngm); - -/* - * nss_gre_redir_log_rx_msg - * Logs a gre_redir message that is received from the NSS firmware. - */ -void nss_gre_redir_log_rx_msg(struct nss_gre_redir_msg *ngm); - -#endif /* __NSS_GRE_REDIR_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark.c deleted file mode 100644 index 0b8524f7c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_gre_redir_mark_strings.h" -#include "nss_gre_redir_mark_stats.h" -#include "nss_gre_redir_mark_log.h" -#define NSS_GRE_REDIR_MARK_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Private data structure for handling synchronous messaging. - */ -static struct { - struct semaphore sem; - struct completion complete; - int response; -} nss_gre_redir_mark_pvt; - -/* - * nss_gre_redir_mark_msg_sync_callback() - * Callback to handle the completion of HLOS-->NSS messages. - */ -static void nss_gre_redir_mark_msg_sync_callback(void *app_data, struct nss_gre_redir_mark_msg *nim) -{ - nss_gre_redir_mark_pvt.response = NSS_TX_SUCCESS; - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("GRE mark Error response %d\n", nim->cm.response); - nss_gre_redir_mark_pvt.response = NSS_TX_FAILURE; - } - - complete(&nss_gre_redir_mark_pvt.complete); -} - -/* - * nss_gre_redir_mark_handler() - * Handle NSS to HLOS messages for GRE redir mark - */ -static void nss_gre_redir_mark_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) -{ - struct nss_gre_redir_mark_msg *ngrm = (struct nss_gre_redir_mark_msg *)ncm; - nss_gre_redir_mark_msg_callback_t cb; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_GRE_REDIR_MARK_MSG_MAX) { - nss_warning("%px: received invalid message %d for GRE redir mark interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_gre_redir_mark_msg)) { - nss_warning("%px: length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_gre_redir_mark_log_rx_msg((struct nss_gre_redir_mark_msg *)ncm); - - if (ncm->type == NSS_GRE_REDIR_MARK_STATS_SYNC_MSG) { - nss_gre_redir_mark_stats_sync(nss_ctx, ncm->interface, &ngrm->msg.stats_sync); - nss_gre_redir_mark_stats_notify(nss_ctx, ncm->interface); - } - - /* - * Update the callback and app_data for NOTIFY messages, GRE redir mark sends all notify messages - * to the same callback/app_data. The app data here represent the netdevice of the GRE redir mark - * interface. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].ndev; - } - - /* - * load and call the registered synchronous message callback. - */ - cb = (nss_gre_redir_mark_msg_callback_t)ncm->cb; - if (unlikely(!cb)) { - return; - } - - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_gre_redir_mark_reg_cb() - * Configure a callback on VAP. - */ -nss_tx_status_t nss_gre_redir_mark_reg_cb(int ifnum, - struct nss_gre_redir_mark_register_cb_msg *ngrcm) -{ - struct nss_gre_redir_mark_msg config; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_gre_redir_mark_get_context(); - nss_tx_status_t status; - uint32_t vap_type; - uint32_t len = sizeof(struct nss_gre_redir_mark_register_cb_msg); - - if (!nss_ctx) { - nss_warning("Unable to retrieve NSS context.\n"); - return NSS_TX_FAILURE_BAD_PARAM; - } - - vap_type = nss_dynamic_interface_get_type(nss_ctx, ngrcm->nss_if_num); - if ((vap_type != NSS_DYNAMIC_INTERFACE_TYPE_VAP)) { - nss_warning("%px: Incorrect type for vap interface type = %u", nss_ctx, vap_type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * Configure the node - */ - nss_cmn_msg_init(&config.cm, NSS_GRE_REDIR_MARK_INTERFACE, NSS_GRE_REDIR_MARK_REG_CB_MSG, len, NULL, NULL); - config.msg.reg_cb_msg.nss_if_num = ngrcm->nss_if_num; - - status = nss_gre_redir_mark_tx_msg_sync(nss_ctx, &config); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to register callback from GRE redir mark interface %d\n", nss_ctx, ifnum); - } - - return status; -} -EXPORT_SYMBOL(nss_gre_redir_mark_reg_cb); - -/* - * nss_gre_redir_mark_tx_msg() - * Transmit a GRE MARK configuration message to NSS FW. - */ -nss_tx_status_t nss_gre_redir_mark_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_mark_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_gre_redir_mark_log_tx_msg(msg); - - /* - * interface should be of type of redir mark - */ - if (ncm->interface != NSS_GRE_REDIR_MARK_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_GRE_REDIR_MARK_MSG_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_gre_redir_mark_tx_msg); - -/* - * nss_gre_redir_mark_tx_msg_sync() - * Transmit a GRE redir mark message to NSS firmware synchronously. - */ -nss_tx_status_t nss_gre_redir_mark_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_redir_mark_msg *ngrm) -{ - nss_tx_status_t status; - int ret = 0; - - /* - * Decrease the semaphore count to send the message exclusively. - */ - down(&nss_gre_redir_mark_pvt.sem); - ngrm->cm.cb = (nss_ptr_t)nss_gre_redir_mark_msg_sync_callback; - ngrm->cm.app_data = (nss_ptr_t)NULL; - status = nss_gre_redir_mark_tx_msg(nss_ctx, ngrm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: GRE redir mark tx_msg failed\n", nss_ctx); - up(&nss_gre_redir_mark_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_gre_redir_mark_pvt.complete, msecs_to_jiffies(NSS_GRE_REDIR_MARK_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: GRE redir mark message tx sync failed due to timeout\n", nss_ctx); - nss_gre_redir_mark_pvt.response = NSS_TX_FAILURE; - } - - status = nss_gre_redir_mark_pvt.response; - up(&nss_gre_redir_mark_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_gre_redir_mark_tx_msg_sync); - -/* - * nss_gre_redir_mark_tx_buf() - * Send packet to GRE redir mark interface owned by NSS. - */ -nss_tx_status_t nss_gre_redir_mark_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - nss_trace("%px: GRE redir mark If Tx packet, interface id:%d, data=%px", nss_ctx, if_num, os_buf->data); - - /* - * We expect Tx packets to the GRE redir mark interface only. - */ - if (if_num != NSS_GRE_REDIR_MARK_INTERFACE) { - nss_warning("%px: Invalid interface:%d for GRE redir mark packets\n", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return nss_core_send_packet(nss_ctx, os_buf, if_num, 0); -} -EXPORT_SYMBOL(nss_gre_redir_mark_tx_buf); - -/* - * nss_gre_redir_mark_get_context() - * Return NSS GRE redir mark context. - */ -struct nss_ctx_instance *nss_gre_redir_mark_get_context(void) -{ - return &nss_top_main.nss[nss_top_main.gre_redir_mark_handler_id]; -} -EXPORT_SYMBOL(nss_gre_redir_mark_get_context); - -/* - * nss_gre_redir_mark_unregister_if() - * Unregister dynamic node for GRE_REDIR_MARK redir. - */ -bool nss_gre_redir_mark_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_redir_handler_id]; - struct net_device *dev; - uint32_t status; - - nss_assert(nss_ctx); - nss_assert(if_num == NSS_GRE_REDIR_MARK_INTERFACE); - - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - - BUG_ON(!dev); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for gre_redir_mark interface %d with NSS core\n", - nss_ctx, if_num); - return false; - } - - nss_ctx->nss_rx_interface_handlers[if_num].msg_cb = NULL; - return true; -} -EXPORT_SYMBOL(nss_gre_redir_mark_unregister_if); - -/* - * nss_gre_redir_mark_register_if() - * Register staticr GRE redir mark interface with data-plane. - */ -struct nss_ctx_instance *nss_gre_redir_mark_register_if(struct net_device *netdev, uint32_t if_num, - nss_gre_redir_mark_data_callback_t cb_func_data, nss_gre_redir_mark_msg_callback_t cb_func_msg, - uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_redir_handler_id]; - uint32_t status; - - nss_assert(nss_ctx); - nss_assert(if_num == NSS_GRE_REDIR_MARK_INTERFACE); - - /* - * Registering the interface with network data path. - */ - nss_core_register_subsys_dp(nss_ctx, if_num, cb_func_data, NULL, NULL, netdev, features); - status = nss_core_register_msg_handler(nss_ctx, NSS_GRE_REDIR_MARK_INTERFACE, cb_func_msg); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to register handler for gre_redir_mark interface %d with NSS core\n", - nss_ctx, if_num); - return NULL; - } - - return nss_ctx; -} -EXPORT_SYMBOL(nss_gre_redir_mark_register_if); - -/* - * nss_gre_redir_mark_get_device() - * Gets the original device from probe. - */ -struct device *nss_gre_redir_mark_get_device(void) -{ - struct nss_ctx_instance *nss_ctx = nss_gre_redir_mark_get_context(); - return nss_ctx->dev; -} -EXPORT_SYMBOL(nss_gre_redir_mark_get_device); - -/* - * nss_gre_redir_mark_register_handler() - * Register GRE redir mark and register handler - */ -void nss_gre_redir_mark_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_gre_redir_mark_get_context(); - struct dentry *gre_redir_mark_dentry = NULL; - uint32_t status = NSS_CORE_STATUS_FAILURE; - - /* - * Create the debug fs entry for the stats. - */ - gre_redir_mark_dentry = nss_gre_redir_mark_stats_dentry_create(); - if (!gre_redir_mark_dentry) { - nss_warning("%px: Not able to create debugfs entry\n", nss_ctx); - return; - } - - nss_gre_redir_mark_strings_dentry_create(); - sema_init(&nss_gre_redir_mark_pvt.sem, 1); - init_completion(&nss_gre_redir_mark_pvt.complete); - - nss_info("nss_gre_redir_mark_register_handler\n"); - status = nss_core_register_handler(nss_ctx, NSS_GRE_REDIR_MARK_INTERFACE, nss_gre_redir_mark_handler, NULL); - if (status != NSS_CORE_STATUS_SUCCESS) { - debugfs_remove_recursive(gre_redir_mark_dentry); - gre_redir_mark_dentry = NULL; - nss_warning("%px: Not able to register handler for GRE redir mark with NSS core\n", nss_ctx); - return; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_log.c deleted file mode 100644 index 580c5a851..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_log.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" - -/* - * nss_gre_redir_mark_log_message_types_str - * GRE redir mark message strings - */ -static int8_t *nss_gre_redir_mark_log_message_types_str[NSS_GRE_REDIR_MARK_MSG_MAX] __maybe_unused = { - "GRE redir mark register callback message", - "GRE redir mark statistics synchronization" -}; - -/* - * nss_gre_redir_mark_log_error_response_types_str - * Strings for error types for GRE redir mark messages - */ -static int8_t *nss_gre_redir_mark_log_error_response_types_str[NSS_GRE_REDIR_MARK_ERROR_TYPE_MAX] __maybe_unused = { - "GRE redir mark No error", - "GRE redir mark Invalid interface for callback registration", - "GRE redir mark Invalid ethertype for Tx interface" -}; - -/* - * nss_gre_redir_mark_log_reg_cb_msg() - * Log NSS GRE redir mark configuration message - */ -static void nss_gre_redir_mark_log_reg_cb_msg(struct nss_gre_redir_mark_msg *ncm) -{ - struct nss_gre_redir_mark_register_cb_msg *reg_cb_msg __maybe_unused = &ncm->msg.reg_cb_msg; - nss_trace("%px: NSS GRE redir mark callback registration message \n" - "nss_if_num: %d\n", ncm, reg_cb_msg->nss_if_num); -} - -/* - * nss_gre_redir_mark_log_verbose() - * Log message contents. - */ -static void nss_gre_redir_mark_log_verbose(struct nss_gre_redir_mark_msg *ncm) -{ - switch (ncm->cm.type) { - case NSS_GRE_REDIR_MARK_REG_CB_MSG: - nss_gre_redir_mark_log_reg_cb_msg(ncm); - break; - - case NSS_GRE_REDIR_MARK_STATS_SYNC_MSG: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", ncm); - break; - } -} - -/* - * nss_gre_redir_mark_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_gre_redir_mark_log_tx_msg(struct nss_gre_redir_mark_msg *ngm) -{ - if (ngm->cm.type >= NSS_GRE_REDIR_MARK_MSG_MAX) { - nss_warning("%px: Invalid message type\n", ngm); - return; - } - - nss_info("%px: type[%d]:%s\n", ngm, ngm->cm.type, nss_gre_redir_mark_log_message_types_str[ngm->cm.type]); - nss_gre_redir_mark_log_verbose(ngm); -} -/* - * nss_gre_redir_mark_log_rx_msg() - * Log messages received from FW. - */ -void nss_gre_redir_mark_log_rx_msg(struct nss_gre_redir_mark_msg *ncm) -{ - if (ncm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ncm); - return; - } - - if (ncm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ncm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ncm, ncm->cm.type, - nss_gre_redir_mark_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response]); - goto verbose; - } - - if (ncm->cm.error >= NSS_GRE_REDIR_MARK_ERROR_TYPE_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ncm, ncm->cm.type, nss_gre_redir_mark_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ncm, ncm->cm.type, nss_gre_redir_mark_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error, nss_gre_redir_mark_log_error_response_types_str[ncm->cm.error]); - -verbose: - nss_gre_redir_mark_log_verbose(ncm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_log.h deleted file mode 100644 index 27e2ffb16..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_MARK_LOG_H__ -#define __NSS_GRE_REDIR_MARK_LOG_H__ - -/* - * nss_gre_redir_mark_log.h - * NSS GRE_REDIR_MARK Log Header File. - */ - -/* - * nss_gre_redir_mark_log_tx_msg - * Logs GRE_REDIR_MARK message that is sent to the NSS firmware. - */ -void nss_gre_redir_mark_log_tx_msg(struct nss_gre_redir_mark_msg *ncm); - -/* - * nss_gre_redir_mark_log_rx_msg - * Logs GRE_REDIR_MARK message that is received from the NSS firmware. - */ -void nss_gre_redir_mark_log_rx_msg(struct nss_gre_redir_mark_msg *ncm); - -#endif /* __NSS_GRE_REDIR_MARK_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.c deleted file mode 100644 index da0f64621..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_stats.h" -#include "nss_gre_redir_mark.h" -#include "nss_gre_redir_mark_stats.h" -#include "nss_gre_redir_mark_strings.h" - -#define NSS_GRE_REDIR_MARK_STATS_STR_LEN 50 -#define NSS_GRE_REDIR_MARK_STATS_LEN ((NSS_GRE_REDIR_MARK_STATS_MAX + 7 ) * NSS_GRE_REDIR_MARK_STATS_STR_LEN) - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_gre_redir_mark_stats_notifier); - -/* - * Spinlock to protect GRE redirect mark statistics update/read - */ -DEFINE_SPINLOCK(nss_gre_redir_mark_stats_lock); - -/* - * Global GRE redirect mark stats structure. - */ -struct nss_gre_redir_mark_stats gre_mark_stats; - -/* - * nss_gre_redir_mark_stats_get() - * Get gre_redir tunnel stats. - */ -bool nss_gre_redir_mark_stats_get(struct nss_gre_redir_mark_stats *stats_mem) -{ - if (!stats_mem) { - nss_warning("No memory to copy GRE redir mark stats"); - return false; - } - - /* - * Copy the GRE redir mark stats in the memory. - */ - spin_lock_bh(&nss_gre_redir_mark_stats_lock); - memcpy(stats_mem, &gre_mark_stats, sizeof(struct nss_gre_redir_mark_stats)); - spin_unlock_bh(&nss_gre_redir_mark_stats_lock); - return true; -} -EXPORT_SYMBOL(nss_gre_redir_mark_stats_get); - -/** - * nss_gre_redir_mark_stats_read() - * READ GRE redir mark stats. - */ -static ssize_t nss_gre_redir_mark_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_GRE_REDIR_MARK_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - struct nss_gre_redir_mark_stats stats; - size_t size_wr = 0; - ssize_t bytes_read = 0; - bool isthere; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * If GRE redir mark does not exists, then (isthere) will be false. - */ - isthere = nss_gre_redir_mark_stats_get(&stats); - if (!isthere) { - nss_warning("Could not get GRE redirect stats"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre_redir_mark stats", NSS_STATS_SINGLE_CORE); - size_wr += nss_stats_print("gre_redir_mark", NULL, NSS_STATS_SINGLE_INSTANCE, nss_gre_redir_mark_strings_stats, - stats.stats, NSS_GRE_REDIR_MARK_STATS_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(lbuf); - return bytes_read; -} - -/* - * nss_gre_redir_mark_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(gre_redir_mark) - -/* - * nss_gre_redir_mark_stats_dentry_create() - * Create debugfs directory entry for stats. - */ -struct dentry *nss_gre_redir_mark_stats_dentry_create(void) -{ - struct dentry *gre_redir_mark; - - gre_redir_mark = debugfs_create_file("gre_redir_mark", 0400, nss_top_main.stats_dentry, - &nss_top_main, &nss_gre_redir_mark_stats_ops); - if (unlikely(!gre_redir_mark)) { - nss_warning("Failed to create file entry qca-nss-drv/stats/gre_redir_mark/\n"); - return NULL; - } - - return gre_redir_mark; -} - -/* - * nss_gre_redir_mark_stats_sync() - * Update GRE redir mark stats. - */ -void nss_gre_redir_mark_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, struct nss_gre_redir_mark_stats_sync_msg *ngss) -{ - int i; - struct net_device *dev; - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!dev) { - nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); - return; - } - - if (if_num != NSS_GRE_REDIR_MARK_INTERFACE) { - nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); - return; - } - - /* - * Update the stats in exclusive mode to prevent the read from the process - * context through debug fs. - */ - spin_lock_bh(&nss_gre_redir_mark_stats_lock); - - /* - * Update the common node stats - */ - gre_mark_stats.stats[NSS_STATS_NODE_TX_PKTS] += ngss->node_stats.tx_packets; - gre_mark_stats.stats[NSS_STATS_NODE_TX_BYTES] += ngss->node_stats.tx_bytes; - gre_mark_stats.stats[NSS_STATS_NODE_RX_PKTS] += ngss->node_stats.rx_packets; - gre_mark_stats.stats[NSS_STATS_NODE_RX_BYTES] += ngss->node_stats.rx_bytes; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - gre_mark_stats.stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += ngss->node_stats.rx_dropped[i]; - } - - /* - * Update the GRE redir mark specific stats - */ - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_HLOS_MAGIC_FAILED] += ngss->hlos_magic_fail; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_INV_DST_IF_DROPS] += ngss->invalid_dst_drop; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE] += ngss->dst_enqueue_success; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_DST_IF_ENQUEUE_DROPS] += ngss->dst_enqueue_drop; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_INV_APPID] += ngss->inv_appid; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_HEADROOM_UNAVAILABLE] += ngss->headroom_unavail; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_SUCCESS] += ngss->tx_completion_success; - gre_mark_stats.stats[NSS_GRE_REDIR_MARK_STATS_TX_COMPLETION_DROPS] += ngss->tx_completion_drop; - - spin_unlock_bh(&nss_gre_redir_mark_stats_lock); -} - -/* - * nss_gre_redir_mark_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_gre_redir_mark_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_gre_redir_mark_stats_notification *stats_notify; - - stats_notify = kzalloc(sizeof(struct nss_gre_redir_mark_stats_notification), GFP_ATOMIC); - if (!stats_notify) { - nss_warning("Unable to allocate memory for stats notification\n"); - return; - } - - if (if_num != NSS_GRE_REDIR_MARK_INTERFACE) { - nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); - kfree(stats_notify); - return; - } - - spin_lock_bh(&nss_gre_redir_mark_stats_lock); - stats_notify->core_id = nss_ctx->id; - stats_notify->if_num = if_num; - memcpy(stats_notify->stats_ctx, gre_mark_stats.stats, sizeof(stats_notify->stats_ctx)); - spin_unlock_bh(&nss_gre_redir_mark_stats_lock); - - atomic_notifier_call_chain(&nss_gre_redir_mark_stats_notifier, NSS_STATS_EVENT_NOTIFY, stats_notify); - kfree(stats_notify); -} - -/* - * nss_gre_redir_mark_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_gre_redir_mark_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_gre_redir_mark_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_redir_mark_stats_unregister_notifier); - -/* - * nss_gre_redir_mark_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_gre_redir_mark_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_gre_redir_mark_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_redir_mark_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.h deleted file mode 100644 index cacb3d218..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_stats.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_MARK_STATS_H__ -#define __NSS_GRE_REDIR_MARK_STATS_H__ - -/* - * NSS core stats -- for H2N/N2H gre_redir_mark debug stats - */ -struct nss_gre_redir_mark_stats { - uint64_t stats[NSS_GRE_REDIR_MARK_STATS_MAX]; -}; - -/* - * NSS GRE REDIR Mark statistics APIs - */ -extern void nss_gre_redir_mark_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_gre_redir_mark_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, - struct nss_gre_redir_mark_stats_sync_msg *ngss); -extern struct dentry *nss_gre_redir_mark_stats_dentry_create(void); - -#endif /* __NSS_GRE_REDIR_MARK_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.c deleted file mode 100644 index a8d5a9859..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_gre_redir_mark_strings.h" - -/* - * nss_gre_redir_mark_strings_stats - * GRE redir mark statistics string - */ -struct nss_stats_info nss_gre_redir_mark_strings_stats[NSS_GRE_REDIR_MARK_STATS_MAX] = { - {"rx Packets", NSS_STATS_TYPE_COMMON}, - {"rx Bytes", NSS_STATS_TYPE_COMMON}, - {"tx Packets", NSS_STATS_TYPE_COMMON}, - {"tx Bytes", NSS_STATS_TYPE_COMMON}, - {"rx_dropped_0", NSS_STATS_TYPE_DROP}, - {"rx_dropped_1", NSS_STATS_TYPE_DROP}, - {"rx_dropped_2", NSS_STATS_TYPE_DROP}, - {"rx_dropped_3", NSS_STATS_TYPE_DROP}, - {"HLOS Magic Failed", NSS_STATS_TYPE_SPECIAL}, - {"tx Inv_dst_if Drops", NSS_STATS_TYPE_DROP}, - {"tx Dst_if Enqueue", NSS_STATS_TYPE_SPECIAL}, - {"tx Dst_if Enqueue Drops", NSS_STATS_TYPE_DROP}, - {"Invalid Appid", NSS_STATS_TYPE_SPECIAL}, - {"Headroom Unavailable", NSS_STATS_TYPE_EXCEPTION}, - {"tx Completion Host Enqueue Success", NSS_STATS_TYPE_SPECIAL}, - {"tx Completion Host Enqueue Drops", NSS_STATS_TYPE_DROP} -}; - -/* - * nss_gre_redir_mark_strings_read() - * Read gre_redir_mark statistics names - */ -static ssize_t nss_gre_redir_mark_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_gre_redir_mark_strings_stats, NSS_GRE_REDIR_MARK_STATS_MAX); -} - -/* - * nss_gre_redir_mark_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_redir_mark); - -/* - * nss_gre_redir_mark_strings_dentry_create() - * Create gre_redir_mark statistics strings debug entry. - */ -void nss_gre_redir_mark_strings_dentry_create(void) -{ - nss_strings_create_dentry("gre_redir_mark", &nss_gre_redir_mark_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.h deleted file mode 100644 index 98ed33204..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_mark_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_MARK_STRINGS_H -#define __NSS_GRE_REDIR_MARK_STRINGS_H - -#include "nss_gre_redir_mark_stats.h" - -extern struct nss_stats_info nss_gre_redir_mark_strings_stats[NSS_GRE_REDIR_MARK_STATS_MAX]; -extern void nss_gre_redir_mark_strings_dentry_create(void); - -#endif /* __NSS_GRE_REDIR_MARK_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.c deleted file mode 100644 index 6adb3534c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#include "nss_core.h" -#include "nss_gre_redir.h" -#include "nss_gre_redir_stats.h" -#include "nss_gre_redir_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_gre_redir_stats_notifier); - -/* - * Spinlock to protect GRE redirect statistics update/read - */ -DEFINE_SPINLOCK(nss_gre_redir_stats_lock); - -/* - * Array to hold tunnel stats along with if_num - */ -extern struct nss_gre_redir_tunnel_stats tun_stats[NSS_GRE_REDIR_MAX_INTERFACES]; - -/* - * nss_gre_redir_stats_get() - * Get GRE redirect tunnel stats. - */ -bool nss_gre_redir_stats_get(int index, struct nss_gre_redir_tunnel_stats *stats) -{ - spin_lock_bh(&nss_gre_redir_stats_lock); - if (tun_stats[index].ref_count == 0) { - spin_unlock_bh(&nss_gre_redir_stats_lock); - return false; - } - - memcpy(stats, &tun_stats[index], sizeof(struct nss_gre_redir_tunnel_stats)); - spin_unlock_bh(&nss_gre_redir_stats_lock); - return true; -} -EXPORT_SYMBOL(nss_gre_redir_stats_get); - -/* - * nss_gre_redir_stats_read() - * READ gre_redir tunnel stats. - */ -static ssize_t nss_gre_redir_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_GRE_REDIR_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines * NSS_GRE_REDIR_MAX_INTERFACES; - struct nss_stats_data *data = fp->private_data; - struct nss_gre_redir_tunnel_stats stats; - ssize_t bytes_read = 0; - size_t size_wr = 0; - int index = 0; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - if (data) { - index = data->index; - } - - /* - * If we are done accomodating all the GRE_REDIR tunnels. - */ - if (index >= NSS_GRE_REDIR_MAX_INTERFACES) { - kfree(lbuf); - return 0; - } - - for (; index < NSS_GRE_REDIR_MAX_INTERFACES; index++) { - bool isthere; - - /* - * If gre_redir tunnel does not exists, then isthere will be false. - */ - isthere = nss_gre_redir_stats_get(index, &stats); - if (!isthere) { - continue; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre_redir stats", NSS_STATS_SINGLE_CORE); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nTunnel stats for %s\n", stats.dev->name); - size_wr += nss_stats_print("gre_redir", NULL, NSS_STATS_SINGLE_INSTANCE, nss_gre_redir_strings_stats, - &stats.tstats.rx_packets, NSS_GRE_REDIR_STATS_MAX, lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - if (data) { - data->index = index; - } - - kfree(lbuf); - return bytes_read; -} - -/* - * nss_gre_redir_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(gre_redir) - -/* - * nss_gre_redir_stats_dentry_create() - * Create debugfs directory entry for stats. - */ -struct dentry *nss_gre_redir_stats_dentry_create(void) -{ - struct dentry *gre_redir; - struct dentry *tun_stats; - - gre_redir = debugfs_create_dir("gre_redir", nss_top_main.stats_dentry); - if (unlikely(!gre_redir)) { - nss_warning("Failed to create directory entry qca-nss-drv/stats/gre_redir/\n"); - return NULL; - } - - tun_stats = debugfs_create_file("tun_stats", 0400, gre_redir, - &nss_top_main, &nss_gre_redir_stats_ops); - if (unlikely(!tun_stats)) { - debugfs_remove_recursive(gre_redir); - nss_warning("Failed to create file entry qca-nss-drv/stats/gre_redir/tun_stats\n"); - return NULL; - } - - return gre_redir; -} - -/* - * nss_gre_redir_stats_sync() - * Update gre_redir tunnel stats. - */ -void nss_gre_redir_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, struct nss_gre_redir_stats_sync_msg *ngss) -{ - int i, j; - uint32_t type; - struct net_device *dev; - struct nss_gre_redir_tun_stats *node_stats; - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!dev) { - nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); - return; - } - - if (!nss_gre_redir_verify_ifnum(if_num)) { - nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); - return; - } - - spin_lock_bh(&nss_gre_redir_stats_lock); - for (i = 0; i < NSS_GRE_REDIR_MAX_INTERFACES; i++) { - if (tun_stats[i].dev == dev) { - break; - } - } - - if (i == NSS_GRE_REDIR_MAX_INTERFACES) { - nss_warning("%px: Unable to find tunnel stats instance for interface %d\n", nss_ctx, if_num); - spin_unlock_bh(&nss_gre_redir_stats_lock); - return; - } - - nss_assert(tun_stats[i].ref_count); - node_stats = &tun_stats[i].tstats; - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER: - node_stats->tx_packets += ngss->node_stats.tx_packets; - node_stats->tx_bytes += ngss->node_stats.tx_bytes; - node_stats->sjack_tx_packets += ngss->sjack_rx_packets; - node_stats->encap_sg_alloc_drop += ngss->encap_sg_alloc_drop; - node_stats->tx_dropped += nss_cmn_rx_dropped_sum(&(ngss->node_stats)); - for (j = 0; j < NSS_GRE_REDIR_MAX_RADIO; j++) { - node_stats->offl_tx_pkts[j] += ngss->offl_rx_pkts[j]; - } - - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER: - node_stats->rx_packets += ngss->node_stats.rx_packets; - node_stats->rx_bytes += ngss->node_stats.rx_bytes; - node_stats->sjack_rx_packets += ngss->sjack_rx_packets; - node_stats->decap_fail_drop += ngss->decap_fail_drop; - node_stats->decap_split_drop += ngss->decap_split_drop; - node_stats->split_sg_alloc_fail += ngss->split_sg_alloc_fail; - node_stats->split_linear_copy_fail += ngss->split_linear_copy_fail; - node_stats->split_not_enough_tailroom += ngss->split_not_enough_tailroom; - node_stats->decap_eapol_frames += ngss->decap_eapol_frames; - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - node_stats->rx_dropped[j] += ngss->node_stats.rx_dropped[j]; - } - - for (j = 0; j < NSS_GRE_REDIR_MAX_RADIO; j++) { - node_stats->offl_rx_pkts[j] += ngss->offl_rx_pkts[j]; - } - - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_US: - node_stats->exception_us_rx += ngss->node_stats.rx_packets; - node_stats->exception_us_tx += ngss->node_stats.tx_packets; - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_EXCEPTION_DS: - node_stats->exception_ds_rx += ngss->node_stats.rx_packets; - node_stats->exception_ds_tx += ngss->node_stats.tx_packets; - node_stats->exception_ds_invalid_dst_drop += ngss->exception_ds_invalid_dst_drop; - node_stats->exception_ds_inv_appid += ngss->exception_ds_inv_appid; - node_stats->headroom_unavail += ngss->headroom_unavail; - node_stats->tx_completion_success += ngss->tx_completion_success; - node_stats->tx_completion_drop += ngss->tx_completion_drop; - break; - } - - spin_unlock_bh(&nss_gre_redir_stats_lock); -} - -/* - * nss_gre_redir_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_gre_redir_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_gre_redir_stats_notification *stats_notify; - struct net_device *dev; - int i; - - stats_notify = kzalloc(sizeof(struct nss_gre_redir_stats_notification), GFP_ATOMIC); - if (!stats_notify) { - nss_warning("Unable to allocate memory for stats notification\n"); - return; - } - - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!dev) { - nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); - kfree(stats_notify); - return; - } - - if (!nss_gre_redir_verify_ifnum(if_num)) { - nss_warning("%px: Unknown type for interface %d\n", nss_ctx, if_num); - kfree(stats_notify); - return; - } - - spin_lock_bh(&nss_gre_redir_stats_lock); - for (i = 0; i < NSS_GRE_REDIR_MAX_INTERFACES; i++) { - if (tun_stats[i].dev == dev) { - break; - } - } - - if (i == NSS_GRE_REDIR_MAX_INTERFACES) { - nss_warning("%px: Unable to find tunnel stats instance for interface %d\n", nss_ctx, if_num); - spin_unlock_bh(&nss_gre_redir_stats_lock); - kfree(stats_notify); - return; - } - - stats_notify->core_id = nss_ctx->id; - stats_notify->if_num = if_num; - memcpy(&(stats_notify->stats_ctx), &(tun_stats[i]), sizeof(stats_notify->stats_ctx)); - spin_unlock_bh(&nss_gre_redir_stats_lock); - atomic_notifier_call_chain(&nss_gre_redir_stats_notifier, NSS_STATS_EVENT_NOTIFY, stats_notify); - kfree(stats_notify); -} - -/* - * nss_gre_redir_stats_unregister_notifier() - * Degisters statistics notifier. - */ -int nss_gre_redir_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_gre_redir_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_redir_stats_unregister_notifier); - -/* - * nss_gre_redir_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_gre_redir_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_gre_redir_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_redir_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.h deleted file mode 100644 index 28f8fae3e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_stats.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_STATS_H__ -#define __NSS_GRE_REDIR_STATS_H__ - -/* - * NSS GRE REDIR statistics APIs - */ -extern spinlock_t nss_gre_redir_stats_lock; -extern bool nss_gre_redir_verify_ifnum(uint32_t if_num); -extern void nss_gre_redir_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_gre_redir_stats_sync(struct nss_ctx_instance *nss_ctx, int if_num, - struct nss_gre_redir_stats_sync_msg *ngss); -extern struct dentry *nss_gre_redir_stats_dentry_create(void); - -#endif /* __NSS_GRE_REDIR_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.c deleted file mode 100644 index 319be274e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_gre_redir_strings.h" - -/* - * nss_gre_redir_strings_stats - * GRE redirect statistics string. - */ -struct nss_stats_info nss_gre_redir_strings_stats[NSS_GRE_REDIR_STATS_MAX] = { - {"RX Packets", NSS_STATS_TYPE_COMMON}, - {"RX Bytes", NSS_STATS_TYPE_COMMON}, - {"TX Packets", NSS_STATS_TYPE_COMMON}, - {"TX Bytes", NSS_STATS_TYPE_COMMON}, - {"RX Drops_[0]", NSS_STATS_TYPE_DROP}, - {"RX Drops_[1]", NSS_STATS_TYPE_DROP}, - {"RX Drops_[2]", NSS_STATS_TYPE_DROP}, - {"RX Drops_[3]", NSS_STATS_TYPE_DROP}, - {"TX Drops", NSS_STATS_TYPE_DROP}, - {"RX Sjack Packets", NSS_STATS_TYPE_SPECIAL}, - {"TX Sjack packets", NSS_STATS_TYPE_SPECIAL}, - {"RX Offload Packets_[0]", NSS_STATS_TYPE_SPECIAL}, - {"RX Offload Packets_[1]", NSS_STATS_TYPE_SPECIAL}, - {"RX Offload Packets_[2]", NSS_STATS_TYPE_SPECIAL}, - {"RX Offload Packets_[3]", NSS_STATS_TYPE_SPECIAL}, - {"RX Offload Packets_[4]", NSS_STATS_TYPE_SPECIAL}, - {"TX Offload Packets_[0]", NSS_STATS_TYPE_SPECIAL}, - {"TX Offload Packets_[1]", NSS_STATS_TYPE_SPECIAL}, - {"TX Offload Packets_[2]", NSS_STATS_TYPE_SPECIAL}, - {"TX Offload Packets_[3]", NSS_STATS_TYPE_SPECIAL}, - {"TX Offload Packets_[4]", NSS_STATS_TYPE_SPECIAL}, - {"US exception RX Packets", NSS_STATS_TYPE_EXCEPTION}, - {"US exception TX Packets", NSS_STATS_TYPE_EXCEPTION}, - {"DS exception RX Packets", NSS_STATS_TYPE_EXCEPTION}, - {"DS exception TX Packets", NSS_STATS_TYPE_EXCEPTION}, - {"Encap SG alloc drop", NSS_STATS_TYPE_DROP}, - {"Decap fail drop", NSS_STATS_TYPE_DROP}, - {"Decap split drop", NSS_STATS_TYPE_SPECIAL}, - {"Split SG alloc fail", NSS_STATS_TYPE_SPECIAL}, - {"Split linear copy fail", NSS_STATS_TYPE_SPECIAL}, - {"Split not enough tailroom", NSS_STATS_TYPE_EXCEPTION}, - {"Exception ds invalid dst", NSS_STATS_TYPE_SPECIAL}, - {"Decap eapol frames", NSS_STATS_TYPE_SPECIAL}, - {"Exception ds invalid appid", NSS_STATS_TYPE_EXCEPTION}, - {"Headroom Unavailable", NSS_STATS_TYPE_EXCEPTION}, - {"Exception ds Tx completion Success", NSS_STATS_TYPE_SPECIAL}, - {"Exception ds Tx completion drop", NSS_STATS_TYPE_DROP} -}; - -/* - * nss_gre_redir_strings_read() - * Read GRE redirect statistics names. - */ -static ssize_t nss_gre_redir_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_gre_redir_strings_stats, NSS_GRE_REDIR_STATS_MAX); -} - -/* - * nss_gre_redir_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_redir); - -/* - * nss_gre_redir_strings_dentry_create() - * Create GRE redirect statistics strings debug entry. - */ -void nss_gre_redir_strings_dentry_create(void) -{ - nss_strings_create_dentry("gre_redir", &nss_gre_redir_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.h deleted file mode 100644 index b0f0ba340..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_redir_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_GRE_REDIR_STRINGS_H -#define __NSS_GRE_REDIR_STRINGS_H - -#include "nss_gre_redir_stats.h" - -extern struct nss_stats_info nss_gre_redir_strings_stats[NSS_GRE_REDIR_STATS_MAX]; -extern void nss_gre_redir_strings_dentry_create(void); - -#endif /* __NSS_GRE_REDIR_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.c deleted file mode 100644 index 3808e5e93..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.c +++ /dev/null @@ -1,338 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_gre_stats.c - * NSS GRE statistics APIs - * - */ - -#include "nss_tx_rx_common.h" -#include "nss_gre.h" -#include "nss_gre_stats.h" -#include "nss_gre_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_gre_stats_notifier); - -/* - * Data structures to store GRE nss debug stats - */ -static DEFINE_SPINLOCK(nss_gre_stats_lock); -static struct nss_gre_stats_session session_stats[NSS_GRE_MAX_DEBUG_SESSION_STATS]; -static struct nss_gre_stats_base base_stats; - -/* - * GRE statistics APIs - */ - -/* - * nss_gre_stats_session_unregister() - * Unregister debug statistic for GRE session. - */ -void nss_gre_stats_session_unregister(uint32_t if_num) -{ - int i; - - spin_lock_bh(&nss_gre_stats_lock); - for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (session_stats[i].if_num == if_num) { - memset(&session_stats[i], 0, sizeof(struct nss_gre_stats_session)); - break; - } - } - spin_unlock_bh(&nss_gre_stats_lock); -} - -/* - * nss_gre_stats_session_register() - * Register debug statistic for GRE session. - */ -void nss_gre_stats_session_register(uint32_t if_num, struct net_device *netdev) -{ - int i; - - spin_lock_bh(&nss_gre_stats_lock); - for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (!session_stats[i].valid) { - session_stats[i].valid = true; - session_stats[i].if_num = if_num; - session_stats[i].if_index = netdev->ifindex; - break; - } - } - spin_unlock_bh(&nss_gre_stats_lock); -} - -/* - * nss_gre_stats_session_sync() - * debug statistics sync for GRE session. - */ -void nss_gre_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_session_stats_msg *sstats, uint16_t if_num) -{ - int i, j; - enum nss_dynamic_interface_type interface_type = nss_dynamic_interface_get_type(nss_ctx, if_num); - - spin_lock_bh(&nss_gre_stats_lock); - for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (session_stats[i].if_num == if_num) { - for (j = 0; j < NSS_GRE_SESSION_DEBUG_MAX; j++) { - session_stats[i].stats[j] += sstats->stats[j]; - } - - if (interface_type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_INNER) { - session_stats[i].stats[NSS_GRE_SESSION_ENCAP_RX_RECEIVED] += sstats->node_stats.rx_packets; - } else if (interface_type == NSS_DYNAMIC_INTERFACE_TYPE_GRE_OUTER) { - session_stats[i].stats[NSS_GRE_SESSION_DECAP_TX_FORWARDED] += sstats->node_stats.tx_packets; - } - break; - } - } - spin_unlock_bh(&nss_gre_stats_lock); -} - -/* - * nss_gre_stats_base_sync() - * Debug statistics sync for GRE base node. - */ -void nss_gre_stats_base_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_base_stats_msg *bstats) -{ - int i; - - spin_lock_bh(&nss_gre_stats_lock); - for (i = 0; i < NSS_GRE_BASE_DEBUG_MAX; i++) { - base_stats.stats[i] += bstats->stats[i]; - } - spin_unlock_bh(&nss_gre_stats_lock); -} - -/* - * nss_gre_stats_session_get() - * Get GRE session debug statistics. - */ -static void nss_gre_stats_session_get(void *stats_mem, int size) -{ - struct nss_gre_stats_session *stats = (struct nss_gre_stats_session *)stats_mem; - int i; - - if (!stats || (size < (sizeof(struct nss_gre_stats_session) * NSS_GRE_MAX_DEBUG_SESSION_STATS))) { - nss_warning("No memory to copy gre stats"); - return; - } - - spin_lock_bh(&nss_gre_stats_lock); - for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (session_stats[i].valid) { - memcpy(stats, &session_stats[i], sizeof(struct nss_gre_stats_session)); - stats++; - } - } - spin_unlock_bh(&nss_gre_stats_lock); -} - -/* - * nss_gre_stats_base_get() - * Get GRE debug base statistics. - */ -static void nss_gre_stats_base_get(void *stats_mem, int size) -{ - struct nss_gre_stats_base *stats = (struct nss_gre_stats_base *)stats_mem; - - if (!stats) { - nss_warning("No memory to copy GRE base stats\n"); - return; - } - - if (size < sizeof(struct nss_gre_stats_base)) { - nss_warning("Not enough memory to copy GRE base stats\n"); - return; - } - - spin_lock_bh(&nss_gre_stats_lock); - memcpy(stats, &base_stats, sizeof(struct nss_gre_stats_base)); - spin_unlock_bh(&nss_gre_stats_lock); -} - -/* - * nss_gre_stats_read() - * Read GRE statistics - */ -static ssize_t nss_gre_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - uint32_t max_output_lines = 2 /* header & footer for base debug stats */ - + 2 /* header & footer for session debug stats */ - + NSS_GRE_BASE_DEBUG_MAX /* Base debug */ - + NSS_GRE_MAX_DEBUG_SESSION_STATS * (NSS_GRE_SESSION_DEBUG_MAX + 2) /*session stats */ - + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - struct nss_gre_stats_session *sstats; - struct nss_gre_stats_base *bstats; - int id; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - bstats = kzalloc(sizeof(struct nss_gre_stats_base), GFP_KERNEL); - if (unlikely(!bstats)) { - nss_warning("Could not allocate memory for base debug statistics buffer"); - kfree(lbuf); - return 0; - } - - sstats = kzalloc(sizeof(struct nss_gre_stats_session) * NSS_GRE_MAX_DEBUG_SESSION_STATS, GFP_KERNEL); - if (unlikely(!sstats)) { - nss_warning("Could not allocate memory for base debug statistics buffer"); - kfree(lbuf); - kfree(bstats); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre", NSS_STATS_SINGLE_CORE); - - /* - * Get all base stats - */ - nss_gre_stats_base_get((void *)bstats, sizeof(struct nss_gre_stats_base)); - - size_wr += nss_stats_print("gre", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_gre_strings_base_stats - , bstats->stats - , NSS_GRE_BASE_DEBUG_MAX - , lbuf, size_wr, size_al); - - /* - * Get all session stats - */ - nss_gre_stats_session_get(sstats, sizeof(struct nss_gre_stats_session) * NSS_GRE_MAX_DEBUG_SESSION_STATS); - - for (id = 0; id < NSS_GRE_MAX_DEBUG_SESSION_STATS; id++) { - - if (!((sstats + id)->valid)) { - continue; - } - - dev = dev_get_by_index(&init_net, (sstats + id)->if_index); - if (likely(dev)) { - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d, netdevice=%s\n", id, - (sstats + id)->if_num, dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d\n", id, - (sstats + id)->if_num); - } - size_wr += nss_stats_print("gre_session", NULL, id - , nss_gre_strings_session_stats - , (sstats + id)->stats - , NSS_GRE_SESSION_DEBUG_MAX - , lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(sstats); - kfree(bstats); - kfree(lbuf); - return bytes_read; -} - -/* - * nss_gre_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(gre) - -/* - * nss_gre_stats_dentry_create() - * Create gre statistics debug entry. - */ -void nss_gre_stats_dentry_create(void) -{ - nss_stats_create_dentry("gre", &nss_gre_stats_ops); -} - -/* - * nss_gre_stats_base_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_gre_stats_base_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_gre_base_stats_notification gre_stats; - - spin_lock_bh(&nss_gre_stats_lock); - gre_stats.core_id = nss_ctx->id; - memcpy(gre_stats.stats_base_ctx, base_stats.stats, sizeof(gre_stats.stats_base_ctx)); - spin_unlock_bh(&nss_gre_stats_lock); - - atomic_notifier_call_chain(&nss_gre_stats_notifier, NSS_STATS_EVENT_NOTIFY, &gre_stats); -} - -/* - * nss_gre_stats_session_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_gre_stats_session_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_gre_session_stats_notification gre_stats; - int i; - - spin_lock_bh(&nss_gre_stats_lock); - for (i = 0; i < NSS_GRE_MAX_DEBUG_SESSION_STATS; i++) { - if (session_stats[i].if_num != if_num) { - continue; - } - - memcpy(gre_stats.stats_session_ctx, session_stats[i].stats, sizeof(gre_stats.stats_session_ctx)); - gre_stats.core_id = nss_ctx->id; - gre_stats.if_num = if_num; - spin_unlock_bh(&nss_gre_stats_lock); - atomic_notifier_call_chain(&nss_gre_stats_notifier, NSS_STATS_EVENT_NOTIFY, &gre_stats); - return; - } - spin_unlock_bh(&nss_gre_stats_lock); -} - -/* - * nss_gre_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_gre_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_gre_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_stats_unregister_notifier); - -/* - * nss_gre_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_gre_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_gre_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.h deleted file mode 100644 index 7feb1d679..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_stats.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_gre_stats.h - * NSS GRE statistics header file. - */ - -#ifndef __NSS_GRE_STATS_H -#define __NSS_GRE_STATS_H - -#include - -/* - * GRE base debug statistics - */ -struct nss_gre_stats_base { - uint64_t stats[NSS_GRE_BASE_DEBUG_MAX]; /**< GRE debug statistics. */ -}; - -/* - * GRE session debug statistics - */ -struct nss_gre_stats_session { - uint64_t stats[NSS_GRE_SESSION_DEBUG_MAX]; /**< Session debug statistics. */ - int32_t if_index; /**< Netdevice's ifindex. */ - uint32_t if_num; /**< NSS interface number. */ - bool valid; /**< Is node valid ? */ -}; - -/* - * GRE statistics APIs - */ -extern void nss_gre_stats_base_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_gre_stats_session_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_gre_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_session_stats_msg *sstats, uint16_t if_num); -extern void nss_gre_stats_base_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_base_stats_msg *bstats); -extern void nss_gre_stats_session_register(uint32_t if_num, struct net_device *netdev); -extern void nss_gre_stats_session_unregister(uint32_t if_num); -extern void nss_gre_stats_dentry_create(void); - -#endif /* __NSS_GRE_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.c deleted file mode 100644 index 26c652d75..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_gre_strings.h" - -/* - * nss_gre_strings_base_stats - * GRE debug statistics strings for base types - */ -struct nss_stats_info nss_gre_strings_base_stats[NSS_GRE_BASE_DEBUG_MAX] = { - {"base_rx_pkts", NSS_STATS_TYPE_COMMON}, - {"base_rx_drops", NSS_STATS_TYPE_DROP}, - {"base_exp_eth_hdr_missing", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_eth_type_non_ip", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_unknown_protocol", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_header_incomplete", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_bad_total_length", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_bad_checksum", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_datagram_incomplete", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_fragment", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_options_incomplete", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ip_with_options", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ipv6_unknown_protocol", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_ipv6_header_incomplete", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_unknown_session", NSS_STATS_TYPE_EXCEPTION}, - {"base_exp_node_inactive", NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_gre_base_strings_read() - * Read GRE base debug statistics names - */ -static ssize_t nss_gre_base_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_gre_strings_base_stats, NSS_GRE_BASE_DEBUG_MAX); -} - -/* - * nss_gre_base_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_base); - -/* - * nss_gre_strings_session_stats - * GRE debug statistics strings for sessions - */ -struct nss_stats_info nss_gre_strings_session_stats[NSS_GRE_SESSION_DEBUG_MAX] = { - {"session_pbuf_alloc_fail", NSS_STATS_TYPE_ERROR}, - {"session_decap_forward_enqueue_fail", NSS_STATS_TYPE_DROP}, - {"session_encap_forward_enqueue_fail", NSS_STATS_TYPE_DROP}, - {"session_decap_tx_forwarded", NSS_STATS_TYPE_SPECIAL}, - {"session_encap_rx_received", NSS_STATS_TYPE_SPECIAL}, - {"session_encap_rx_drops", NSS_STATS_TYPE_DROP}, - {"session_encap_rx_linear_fail", NSS_STATS_TYPE_DROP}, - {"session_exp_rx_key_error", NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_seq_error", NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_cs_error", NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_flag_mismatch", NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_malformed", NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_invalid_protocol", NSS_STATS_TYPE_EXCEPTION}, - {"session_exp_rx_no_headroom", NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_gre_session_strings_read() - * Read GRE session debug statistics names - */ -static ssize_t nss_gre_session_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_gre_strings_session_stats, NSS_GRE_SESSION_DEBUG_MAX); -} - -/* - * nss_gre_session_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_session); - -/* - * nss_gre_strings_dentry_create() - * Create gre statistics strings debug entry. - */ -void nss_gre_strings_dentry_create(void) -{ - struct dentry *gre_d = NULL; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - gre_d = debugfs_create_dir("gre", nss_top_main.strings_dentry); - if (!gre_d) { - nss_warning("Failed to create qca-nss-drv/strings/gre directory"); - return; - } - - if (!debugfs_create_file("gre_base", 0400, gre_d, &nss_top_main, &nss_gre_base_strings_ops)) { - nss_warning("Failed to create qca-nss-drv/strings/gre/gre_base file"); - debugfs_remove_recursive(gre_d); - return; - } - - if (!debugfs_create_file("gre_session", 0400, gre_d, &nss_top_main, &nss_gre_session_strings_ops)) { - nss_warning("Failed to create qca-nss-drv/strings/gre/gre_session file"); - debugfs_remove_recursive(gre_d); - return; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.h deleted file mode 100644 index e8a421fce..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_strings.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#ifndef __NSS_GRE_STRINGS_H -#define __NSS_GRE_STRINGS_H - -#include "nss_gre_stats.h" - -extern struct nss_stats_info nss_gre_strings_base_stats[NSS_GRE_BASE_DEBUG_MAX]; -extern struct nss_stats_info nss_gre_strings_session_stats[NSS_GRE_SESSION_DEBUG_MAX]; -extern void nss_gre_strings_dentry_create(void); - -#endif /* __NSS_GRE_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel.c deleted file mode 100644 index 1e9a22a72..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel.c +++ /dev/null @@ -1,395 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_gre_tunnel_stats.h" -#include "nss_gre_tunnel_log.h" -#include "nss_gre_tunnel_strings.h" - -#define NSS_GRE_TUNNEL_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Private data structure - */ -static struct nss_gre_tunnel_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} gre_tunnel_pvt; - -/* - * nss_gre_tunnel_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_gre_tunnel_verify_if_num(uint32_t if_num) -{ - uint32_t type = nss_dynamic_interface_get_type(nss_gre_tunnel_get_ctx(), if_num); - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_OUTER: - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_OUTER: - case NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER_EXCEPTION: - return true; - default: - return false; - } -} - -/* - * nss_gre_tunnel_handler() - * Handle NSS to HLOS messages for gre_tunnel - */ -static void nss_gre_tunnel_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_gre_tunnel_msg *ngtm = (struct nss_gre_tunnel_msg *)ncm; - void *ctx; - - nss_gre_tunnel_msg_callback_t cb; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - BUG_ON(!nss_gre_tunnel_verify_if_num(ncm->interface)); - - /* - * Trace Messages - */ - nss_gre_tunnel_log_rx_msg(ngtm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_GRE_TUNNEL_MSG_MAX) { - nss_warning("%px: received invalid message %d for GRE_TUNNEL interface %d", nss_ctx, ncm->type, ncm->interface); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_gre_tunnel_msg)) { - nss_warning("%px: gre_tunnel message length is invalid: %d", nss_ctx, ncm->len); - return; - } - - /* - * Check messages - */ - switch (ngtm->cm.type) { - case NSS_GRE_TUNNEL_MSG_STATS: - nss_gre_tunnel_stats_session_sync(nss_ctx, &ngtm->msg.stats, ncm->interface); - nss_gre_tunnel_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->gre_tunnel_msg_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data; - } - - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * callback - */ - cb = (nss_gre_tunnel_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call GRE Tunnel session callback - */ - if (!cb) { - return; - } - - cb(ctx, ngtm); -} - -/* - * nss_gre_tunnel_inquiry() - * Inquiry if a GRE tunnel has been established in NSS FW. - * - * Input parameters: - * inquiry_info->ip_type - * inquiry_info->src_ip - * inquiry_info->dest_ip - * inquiry_info->gre_mode - * if (gre_mode == NSS_GRE_TUNNEL_MODE_GRE_UDP) - * inquiry_info->src_port - * inquiry_info->dest_port - * inquiry_info->encrypt_type -- currently not checked in FW, - */ -nss_tx_status_t nss_gre_tunnel_inquiry( - struct nss_gre_tunnel_configure *inquiry_info, - nss_gre_tunnel_msg_callback_t cb, void *app_data) -{ - nss_tx_status_t nss_tx_status; - struct nss_gre_tunnel_msg nim; - struct nss_ctx_instance *nss_ctx = nss_gre_tunnel_get_ctx(); - - /* - * Initialize inquiry message structure. - * This is async message and the result will be returned - * to the caller by the msg_callback passed in. - */ - memset(&nim, 0, sizeof(nim)); - nss_gre_tunnel_msg_init(&nim, NSS_GRE_TUNNEL_INTERFACE, - NSS_GRE_TUNNEL_MSG_INQUIRY, - sizeof(struct nss_gre_tunnel_configure), - cb, app_data); - nim.msg.configure = *inquiry_info; - nss_tx_status = nss_gre_tunnel_tx_msg(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Send GT inquiry message failed\n", inquiry_info); - } - - return nss_tx_status; -} -EXPORT_SYMBOL(nss_gre_tunnel_inquiry); - -/* - * nss_get_gre_tunnel_context() - * Return the core ctx which the feature is on - */ -struct nss_ctx_instance *nss_gre_tunnel_get_ctx(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.gre_tunnel_handler_id]; -} -EXPORT_SYMBOL(nss_gre_tunnel_get_ctx); - -/* - * nss_gre_tunnel_ifnum_with_core_id() - * Append core id to GRE tunnel interface num - */ -int nss_gre_tunnel_ifnum_with_core_id(int if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_gre_tunnel_get_ctx(); - BUG_ON(!nss_gre_tunnel_verify_if_num(if_num)); - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (nss_is_dynamic_interface(if_num) == false) { - nss_info("%px: Invalid if_num: %d, must be a dynamic interface\n", nss_ctx, if_num); - return 0; - } - - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_gre_tunnel_ifnum_with_core_id); - -/* - * nss_gre_tunnel_tx_buf() - * Transmit buffer over GRE Tunnel interface - */ -nss_tx_status_t nss_gre_tunnel_tx_buf(struct sk_buff *skb, uint32_t if_num, - struct nss_ctx_instance *nss_ctx) -{ - BUG_ON(!nss_gre_tunnel_verify_if_num(if_num)); - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER | H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_gre_tunnel_tx_buf); - -/* - * nss_gre_tunnel_tx_msg() - * Transmit a gre_tunnel message to NSS firmware - */ -nss_tx_status_t nss_gre_tunnel_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_gre_tunnel_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_gre_tunnel_log_tx_msg(msg); - - /* - * Sanity check message - */ - if (ncm->type >= NSS_GRE_TUNNEL_MSG_MAX) { - nss_warning("%px: gre_tunnel message type out of range: %d", - nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - BUG_ON(!nss_gre_tunnel_verify_if_num(ncm->interface)); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_gre_tunnel_tx_msg); - -/* - * nss_gre_tunnel_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_gre_tunnel_callback(void *app_data, struct nss_gre_tunnel_msg *ngtm) -{ - nss_gre_tunnel_msg_callback_t callback = (nss_gre_tunnel_msg_callback_t)gre_tunnel_pvt.cb; - void *data = gre_tunnel_pvt.app_data; - - gre_tunnel_pvt.response = NSS_TX_SUCCESS; - gre_tunnel_pvt.cb = NULL; - gre_tunnel_pvt.app_data = NULL; - - if (ngtm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("gre tunnel Error response %d\n", ngtm->cm.response); - gre_tunnel_pvt.response = ngtm->cm.response; - } - - if (callback) { - callback(data, ngtm); - } - complete(&gre_tunnel_pvt.complete); -} - -/* - * nss_gre_tunnel_tx_msg() - * Transmit a GRE Tunnel message to NSS firmware synchronously. - */ -nss_tx_status_t nss_gre_tunnel_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_tunnel_msg *ngtm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&gre_tunnel_pvt.sem); - gre_tunnel_pvt.cb = (void *)ngtm->cm.cb; - gre_tunnel_pvt.app_data = (void *)ngtm->cm.app_data; - - ngtm->cm.cb = (nss_ptr_t)nss_gre_tunnel_callback; - ngtm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_gre_tunnel_tx_msg(nss_ctx, ngtm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: gre_tunnel_tx_msg failed\n", nss_ctx); - up(&gre_tunnel_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&gre_tunnel_pvt.complete, msecs_to_jiffies(NSS_GRE_TUNNEL_TX_TIMEOUT)); - - if (!ret) { - nss_warning("%px: GRE Tunnel msg tx failed due to timeout\n", nss_ctx); - gre_tunnel_pvt.response = NSS_TX_FAILURE; - } - - status = gre_tunnel_pvt.response; - up(&gre_tunnel_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_gre_tunnel_tx_msg_sync); - -/* - * nss_gre_tunnel_msg_init() - * Initialize gre_tunnel msg. - */ -void nss_gre_tunnel_msg_init(struct nss_gre_tunnel_msg *ngtm, uint16_t if_num, - uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ngtm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_gre_tunnel_msg_init); - -/* - * nss_gre_tunnel_register_if() - * Register netdev - */ -struct nss_ctx_instance *nss_gre_tunnel_register_if(uint32_t if_num, - nss_gre_tunnel_data_callback_t cb, - nss_gre_tunnel_msg_callback_t ev_cb, - struct net_device *netdev, - uint32_t features, - void *app_ctx) -{ - int32_t i; - - struct nss_ctx_instance *nss_ctx = nss_gre_tunnel_get_ctx(); - - BUG_ON(!nss_gre_tunnel_verify_if_num(if_num)); - - spin_lock_bh(&nss_gre_tunnel_stats_lock); - for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (!session_stats[i].valid) { - session_stats[i].valid = true; - session_stats[i].if_num = if_num; - session_stats[i].if_index = netdev->ifindex; - break; - } - } - spin_unlock_bh(&nss_gre_tunnel_stats_lock); - - if (i == NSS_MAX_GRE_TUNNEL_SESSIONS) { - nss_warning("%px: Cannot find free slot for GRE Tunnel session stats, I/F:%u\n", nss_ctx, if_num); - return NULL; - } - - if (nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Cannot find free slot for GRE Tunnel NSS I/F:%u\n", nss_ctx, if_num); - session_stats[i].valid = false; - session_stats[i].if_num = 0; - session_stats[i].if_index = 0; - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, cb, NULL, app_ctx, netdev, features); - - nss_top_main.gre_tunnel_msg_callback = ev_cb; - nss_core_register_handler(nss_ctx, if_num, nss_gre_tunnel_handler, app_ctx); - nss_gre_tunnel_stats_dentry_create(); - nss_gre_tunnel_strings_dentry_create(); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_gre_tunnel_register_if); - -/* - * nss_gre_tunnel_unregister_if() - * Unregister netdev - */ -void nss_gre_tunnel_unregister_if(uint32_t if_num) -{ - int32_t i; - struct nss_ctx_instance *nss_ctx = nss_gre_tunnel_get_ctx(); - - BUG_ON(!nss_gre_tunnel_verify_if_num(if_num)); - - spin_lock_bh(&nss_gre_tunnel_stats_lock); - for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (session_stats[i].if_num == if_num) { - memset(&session_stats[i], 0, - sizeof(struct nss_gre_tunnel_stats_session)); - break; - } - } - spin_unlock_bh(&nss_gre_tunnel_stats_lock); - - if (i == NSS_MAX_GRE_TUNNEL_SESSIONS) { - nss_warning("%px: Cannot find debug stats for GRE Tunnel session: %d\n", nss_ctx, if_num); - return; - } - - if (!nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Cannot find registered netdev for GRE Tunnel NSS I/F: %d\n", nss_ctx, if_num); - - return; - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.gre_tunnel_msg_callback = NULL; - nss_core_unregister_handler(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_gre_tunnel_unregister_if); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_log.c deleted file mode 100644 index 6af7b56b9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_log.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_gre_tunnel_log.c - * NSS GRE Tunnel logger file. - */ - -#include "nss_core.h" - -/* - * nss_gre_tunnel_log_message_types_str - * NSS GRE Tunnel message strings - */ -static int8_t *nss_gre_tunnel_log_message_types_str[NSS_GRE_TUNNEL_MSG_MAX] __maybe_unused = { - "GRE Tunnel configure", - "GRE Tunnel session destroy", - "GRE Tunnel stats", - "GRE Tunnel configure DI to WLAN ID", - "GRE Tunnel message inquiry" -}; - -/* - * nss_gre_tunnel_log_configure_msg() - * Log NSS GRE Tunnel configure message. - */ -static void nss_gre_tunnel_log_configure_msg(struct nss_gre_tunnel_msg *ngm) -{ - struct nss_gre_tunnel_configure *ngcm __maybe_unused = &ngm->msg.configure; - nss_trace("%px: NSS GRE Tunnel configure message \n" - "Meta Header Version: %d\n" - "GRE Mode: %x\n" - "IP Type: %x\n" - "Encryption Type: %d\n" - "Source Port: %d\n" - "Destination Port: %d\n" - "Crypto Node Identifier: %d\n" - "Encryption Crypto Index: %d\n" - "Decryption Crypto Index: %d\n" - "Word0 header: %d\n" - "Initialization Vector: %px\n" - "Sibling Interface Number: %d\n" - "TTL: %d\n" - "RPS: %d\n" - "Reserved: %x\n" - "Word1 Header: %x\n" - "Word2 Header: %x\n" - "Word3 Header: %x\n", - ngcm, ngcm->mh_version, ngcm->gre_mode, - ngcm->ip_type, ngcm->encrypt_type, - ngcm->src_port, ngcm->dest_port, - ngcm->crypto_node_id, ngcm->crypto_idx_encrypt, - ngcm->crypto_idx_decrypt, ngcm->word0, - ngcm->iv_val, ngcm->sibling_if, - ngcm->ttl, ngcm->rps, - ngcm->reserved, ngcm->word1, - ngcm->word2, ngcm->word3); - - /* - * Continuation of log message. Different identifiers based on ip_type - */ - if (ngcm->ip_type == NSS_GRE_TUNNEL_IP_IPV6) { - nss_trace("Source IP: %pI6\n" - "Destination IP: %pI6\n", - ngcm->src_ip, ngcm->dest_ip); - } else if (ngcm->ip_type == NSS_GRE_TUNNEL_IP_IPV4) { - nss_trace("Source IP: %pI4\n" - "Destination IP: %pI4\n", - ngcm->src_ip, ngcm->dest_ip); - } -} - -/* - * nss_gre_tunnel_log_di_to_wlan_id_msg() - * Log NSS GRE Tunnel Dynamic Interface to WLAN ID message. - */ -static void nss_gre_tunnel_log_di_to_wlan_id_msg(struct nss_gre_tunnel_msg *ngm) -{ - struct nss_gre_tunnel_di_to_wlan_id *ngdm __maybe_unused = &ngm->msg.dtwi; - nss_trace("%px: NSS GRE Dynamic Interface to WLAN ID message: \n" - "Dynamic Interface Number: %d\n" - "WLAN ID: %x\n", - ngdm, ngdm->dynamic_interface_num, - ngdm->wlan_id); -} - -/* - * nss_gre_tunnel_log_verbose() - * Log message contents. - */ -static void nss_gre_tunnel_log_verbose(struct nss_gre_tunnel_msg *ngm) -{ - switch (ngm->cm.type) { - case NSS_GRE_TUNNEL_MSG_CONFIGURE: - case NSS_GRE_TUNNEL_MSG_INQUIRY: - nss_gre_tunnel_log_configure_msg(ngm); - break; - - case NSS_GRE_TUNNEL_MSG_CONFIGURE_DI_TO_WLAN_ID: - nss_gre_tunnel_log_di_to_wlan_id_msg(ngm); - break; - - case NSS_GRE_TUNNEL_MSG_SESSION_DESTROY: - case NSS_GRE_TUNNEL_MSG_STATS: - /* - * No log for these valid messages. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", ngm); - break; - } -} - -/* - * nss_gre_tunnel_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_gre_tunnel_log_tx_msg(struct nss_gre_tunnel_msg *ngm) -{ - if (ngm->cm.type >= NSS_GRE_TUNNEL_MSG_MAX) { - nss_warning("%px: Invalid message type\n", ngm); - return; - } - - nss_info("%px: type[%d]:%s\n", ngm, ngm->cm.type, nss_gre_tunnel_log_message_types_str[ngm->cm.type]); - nss_gre_tunnel_log_verbose(ngm); -} - -/* - * nss_gre_tunnel_log_rx_msg() - * Log messages received from FW. - */ -void nss_gre_tunnel_log_rx_msg(struct nss_gre_tunnel_msg *ngm) -{ - if (ngm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ngm); - return; - } - - if (ngm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ngm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ngm, ngm->cm.type, - nss_gre_tunnel_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - ngm, ngm->cm.type, nss_gre_tunnel_log_message_types_str[ngm->cm.type], - ngm->cm.response, nss_cmn_response_str[ngm->cm.response]); - -verbose: - nss_gre_tunnel_log_verbose(ngm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_log.h deleted file mode 100644 index be0751301..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_GRE_TUNNEL_LOG_H -#define __NSS_GRE_TUNNEL_LOG_H - -/* - * nss_gre_tunnel.h - * NSS GRE Tunnel header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_gre_tunnel_log_tx_msg - * Logs a gre_tunnel message that is sent to the NSS firmware. - */ -void nss_gre_tunnel_log_tx_msg(struct nss_gre_tunnel_msg *ngm); - -/* - * nss_gre_tunnel_log_rx_msg - * Logs a gre_tunnel message that is received from the NSS firmware. - */ -void nss_gre_tunnel_log_rx_msg(struct nss_gre_tunnel_msg *ngm); - -#endif /* __NSS_GRE_TUNNEL_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.c deleted file mode 100644 index c3e53bf85..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2017, 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_gre_tunnel.h" -#include "nss_gre_tunnel_stats.h" -#include "nss_gre_tunnel_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_gre_tunnel_stats_notifier); - -/* - * Spinlock to protect gre tunnel statistics update/read - */ -DEFINE_SPINLOCK(nss_gre_tunnel_stats_lock); - -struct nss_gre_tunnel_stats_session session_stats[NSS_MAX_GRE_TUNNEL_SESSIONS]; - -/* - * nss_gre_tunnel_stats_session_sync() - * Sync function for GRE Tunnel statistics - */ -void nss_gre_tunnel_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_tunnel_stats *stats_msg, - uint16_t if_num) -{ - int i; - struct nss_gre_tunnel_stats_session *s = NULL; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - spin_lock_bh(&nss_gre_tunnel_stats_lock); - for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (session_stats[i].if_num == if_num) { - s = &session_stats[i]; - break; - } - } - - if (!s) { - spin_unlock_bh(&nss_gre_tunnel_stats_lock); - nss_warning("%px: Session not found: %u", nss_ctx, if_num); - return; - } - - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_PKTS] += stats_msg->node_stats.rx_packets; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_TX_PKTS] += stats_msg->node_stats.tx_packets; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_QUEUE_0_DROPPED + i] += stats_msg->node_stats.rx_dropped[i]; - } - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_MALFORMED] += stats_msg->rx_malformed; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_INVALID_PROT] += stats_msg->rx_invalid_prot; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_DECAP_QUEUE_FULL] += stats_msg->decap_queue_full; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_SINGLE_REC_DGRAM] += stats_msg->rx_single_rec_dgram; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_INVALID_REC_DGRAM] += stats_msg->rx_invalid_rec_dgram; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_BUFFER_ALLOC_FAIL] += stats_msg->buffer_alloc_fail; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_BUFFER_COPY_FAIL] += stats_msg->buffer_copy_fail; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_OUTFLOW_QUEUE_FULL] += stats_msg->outflow_queue_full; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_HROOM] += stats_msg->rx_dropped_hroom; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_CBUFFER_ALLOC_FAIL] += stats_msg->rx_cbuf_alloc_fail; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_CENQUEUE_FAIL] += stats_msg->rx_cenqueue_fail; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_DECRYPT_DONE] += stats_msg->rx_decrypt_done; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_FORWARD_ENQUEUE_FAIL] += stats_msg->rx_forward_enqueue_fail; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_TX_CBUFFER_ALLOC_FAIL] += stats_msg->tx_cbuf_alloc_fail; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_TX_CENQUEUE_FAIL] += stats_msg->tx_cenqueue_fail; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_TROOM] += stats_msg->rx_dropped_troom; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_TX_FORWARD_ENQUEUE_FAIL] += stats_msg->tx_forward_enqueue_fail; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_TX_CIPHER_DONE] += stats_msg->tx_cipher_done; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_CRYPTO_NOSUPP] += stats_msg->crypto_nosupp; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_DROPPED_MH_VERSION] += stats_msg->rx_dropped_mh_ver; - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_RX_UNALIGNED_PKT] += stats_msg->rx_unaligned_pkt; - - /* - * Copy crypto resp err stats. - */ - for (i = 0; i < NSS_CRYPTO_CMN_RESP_ERROR_MAX; i++) { -#if defined(NSS_HAL_IPQ807x_SUPPORT) - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX + i] += stats_msg->crypto_resp_error[i]; -#else - s->stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX + i] = 0; -#endif - } - - spin_unlock_bh(&nss_gre_tunnel_stats_lock); -} - -/* - * nss_gre_tunnel_stats_session_get() - * Get session GRE Tunnel statitics. - */ -static void nss_gre_tunnel_stats_session_get(struct nss_gre_tunnel_stats_session *stats) -{ - int i; - - if (!stats) { - nss_warning("No memory to copy gre_tunnel session stats"); - return; - } - - spin_lock_bh(&nss_gre_tunnel_stats_lock); - for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (session_stats[i].valid) { - memcpy(stats, &session_stats[i], - sizeof(struct nss_gre_tunnel_stats_session)); - stats++; - } - } - spin_unlock_bh(&nss_gre_tunnel_stats_lock); -} - -/* - * nss_gre_tunnel_stats_read() - * Read GRE Tunnel session statistics - */ -static ssize_t nss_gre_tunnel_stats_read(struct file *fp, char __user *ubuf, - size_t sz, loff_t *ppos) -{ - uint32_t max_output_lines = 2 + (NSS_MAX_GRE_TUNNEL_SESSIONS - * (NSS_GRE_TUNNEL_STATS_SESSION_MAX + 2)) + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - struct net_device *dev; - int id, i; - struct nss_gre_tunnel_stats_session *gre_tunnel_session_stats = NULL; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_CRYPTO_CMN_RESP_ERROR_MAX * 8, GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - gre_tunnel_session_stats = kzalloc((sizeof(struct nss_gre_tunnel_stats_session) - * NSS_MAX_GRE_TUNNEL_SESSIONS), GFP_KERNEL); - if (unlikely(gre_tunnel_session_stats == NULL)) { - nss_warning("Could not allocate memory for populating GRE Tunnel stats"); - kfree(lbuf); - kfree(stats_shadow); - return 0; - } - - /* - * Get all stats - */ - nss_gre_tunnel_stats_session_get(gre_tunnel_session_stats); - - /* - * Session stats - */ - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "GRE tunnel stats", NSS_STATS_SINGLE_CORE); - - for (id = 0; id < NSS_MAX_GRE_TUNNEL_SESSIONS; id++) { - if (!gre_tunnel_session_stats[id].valid) - break; - - dev = dev_get_by_index(&init_net, gre_tunnel_session_stats[id].if_index); - if (likely(dev)) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "%d. nss interface id=%d, netdevice=%s\n", - id, gre_tunnel_session_stats[id].if_num, - dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "%d. nss interface id=%d\n", id, - gre_tunnel_session_stats[id].if_num); - } - - size_wr += nss_stats_print("gre_tunnel", NULL, NSS_STATS_SINGLE_INSTANCE, - nss_gre_tunnel_strings_stats, gre_tunnel_session_stats[id].stats, - NSS_GRE_TUNNEL_STATS_SESSION_MAX, lbuf, size_wr, size_al); - - /* - * Print crypto resp err stats. - * TODO: We are not printing with the right enum string for crypto. This - * is intentional since we atleast want to see some stats for now. - */ - spin_lock_bh(&nss_gre_tunnel_stats_lock); - for (i = 0; i < NSS_CRYPTO_CMN_RESP_ERROR_MAX; i++) { - stats_shadow[i] = gre_tunnel_session_stats[id].stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX + i]; - } - - spin_unlock_bh(&nss_gre_tunnel_stats_lock); - size_wr += nss_stats_print("gre_tunnel", NULL, NSS_STATS_SINGLE_INSTANCE, - nss_gre_tunnel_strings_stats, stats_shadow, - NSS_CRYPTO_CMN_RESP_ERROR_MAX, lbuf, size_wr, size_al); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(gre_tunnel_session_stats); - kfree(lbuf); - kfree(stats_shadow); - return bytes_read; -} - -/* - * nss_gre_tunnel_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(gre_tunnel) - -/* - * nss_gre_tunnel_stats_dentry_create() - * Create gre tunnel statistics debug entry. - */ -void nss_gre_tunnel_stats_dentry_create(void) -{ - nss_stats_create_dentry("gre_tunnel", &nss_gre_tunnel_stats_ops); -} - -/* - * nss_gre_tunnel_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_gre_tunnel_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_gre_tunnel_stats_notification gre_tunnel_stats; - struct nss_gre_tunnel_stats_session *s = NULL; - int i; - - spin_lock_bh(&nss_gre_tunnel_stats_lock); - for (i = 0; i < NSS_MAX_GRE_TUNNEL_SESSIONS; i++) { - if (session_stats[i].if_num != if_num) { - continue; - } - - s = &session_stats[i]; - gre_tunnel_stats.core_id = nss_ctx->id; - gre_tunnel_stats.if_num = if_num; - memcpy(gre_tunnel_stats.stats_ctx, s->stats, sizeof(gre_tunnel_stats.stats_ctx)); - spin_unlock_bh(&nss_gre_tunnel_stats_lock); - atomic_notifier_call_chain(&nss_gre_tunnel_stats_notifier, NSS_STATS_EVENT_NOTIFY, &gre_tunnel_stats); - return; - } - spin_unlock_bh(&nss_gre_tunnel_stats_lock); -} - -/* - * nss_gre_tunnel_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_gre_tunnel_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_gre_tunnel_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_tunnel_stats_unregister_notifier); - -/* - * nss_gre_tunnel_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_gre_tunnel_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_gre_tunnel_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_gre_tunnel_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.h deleted file mode 100644 index cdee4788d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_stats.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2016-2017, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_GRE_TUNNEL_STATS_H -#define __NSS_GRE_TUNNEL_STATS_H - -/* - * GRE Tunnel session debug statistics - */ -struct nss_gre_tunnel_stats_session { - uint64_t stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX + NSS_CRYPTO_CMN_RESP_ERROR_MAX]; - /* GRE tunnel statistics */ - int32_t if_index; /* Interface index */ - uint32_t if_num; /* NSS interface number */ - bool valid; -}; - -/* - * Data structures to store GRE Tunnel nss debug stats - */ -extern spinlock_t nss_gre_tunnel_stats_lock; -extern struct nss_gre_tunnel_stats_session session_stats[NSS_MAX_GRE_TUNNEL_SESSIONS]; - -/* - * GRE Tunnel statistics APIs - */ -extern void nss_gre_tunnel_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_gre_tunnel_stats_session_sync(struct nss_ctx_instance *nss_ctx, struct nss_gre_tunnel_stats *stats_msg, uint16_t if_num); -extern void nss_gre_tunnel_stats_dentry_create(void); - -#endif /* __NSS_GRE_TUNNEL_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.c deleted file mode 100644 index 402182e61..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_gre_tunnel_strings.h" - -/* - * nss_gre_tunnel_strings_stats - * GRE Tunnel statistics strings for nss session stats - */ -struct nss_stats_info nss_gre_tunnel_strings_stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX] = { - {"rx_pkts", NSS_STATS_TYPE_COMMON}, - {"tx_pkts", NSS_STATS_TYPE_COMMON}, - {"rx_queue_0_dropped", NSS_STATS_TYPE_DROP}, - {"rx_queue_1_dropped", NSS_STATS_TYPE_DROP}, - {"rx_queue_2_dropped", NSS_STATS_TYPE_DROP}, - {"rx_queue_3_dropped", NSS_STATS_TYPE_DROP}, - {"rx_malformed", NSS_STATS_TYPE_SPECIAL}, - {"rx_invalid_prot", NSS_STATS_TYPE_SPECIAL}, - {"decap_queue_full", NSS_STATS_TYPE_SPECIAL}, - {"rx_single_rec_dgram", NSS_STATS_TYPE_SPECIAL}, - {"rx_invalid_rec_dgram", NSS_STATS_TYPE_SPECIAL}, - {"buffer_alloc_fail", NSS_STATS_TYPE_SPECIAL}, - {"buffer_copy_fail", NSS_STATS_TYPE_SPECIAL}, - {"outflow_queue_full", NSS_STATS_TYPE_SPECIAL}, - {"tx_dropped_hroom", NSS_STATS_TYPE_DROP}, - {"rx_cbuffer_alloc_fail", NSS_STATS_TYPE_SPECIAL}, - {"rx_cenqueue_fail", NSS_STATS_TYPE_SPECIAL}, - {"rx_decrypt_done", NSS_STATS_TYPE_SPECIAL}, - {"rx_forward_enqueue_fail", NSS_STATS_TYPE_SPECIAL}, - {"tx_cbuffer_alloc_fail", NSS_STATS_TYPE_SPECIAL}, - {"tx_cenqueue_fail", NSS_STATS_TYPE_SPECIAL}, - {"rx_dropped_troom", NSS_STATS_TYPE_DROP}, - {"tx_forward_enqueue_fail", NSS_STATS_TYPE_SPECIAL}, - {"tx_cipher_done", NSS_STATS_TYPE_SPECIAL}, - {"crypto_nosupp", NSS_STATS_TYPE_SPECIAL}, - {"rx_dropped_mh_version", NSS_STATS_TYPE_SPECIAL}, - {"rx_unaligned_pkt", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_gre_tunnel_strings_read() - * Read gre_tunnel session debug statistics names - */ -static ssize_t nss_gre_tunnel_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_gre_tunnel_strings_stats, NSS_GRE_TUNNEL_STATS_SESSION_MAX); -} - -/* - * nss_gre_tunnel_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(gre_tunnel); - -/* - * nss_gre_tunnel_strings_dentry_create() - * Create gre_tunnel statistics strings debug entry. - */ -void nss_gre_tunnel_strings_dentry_create(void) -{ - nss_strings_create_dentry("gre_tunnel", &nss_gre_tunnel_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.h deleted file mode 100644 index 829469492..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_gre_tunnel_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#ifndef __NSS_GRE_TUNNEL_STRINGS_H -#define __NSS_GRE_TUNNEL_STRINGS_H - -#include "nss_gre_tunnel_stats.h" - -extern struct nss_stats_info nss_gre_tunnel_strings_stats[NSS_GRE_TUNNEL_STATS_SESSION_MAX]; -extern void nss_gre_tunnel_strings_dentry_create(void); - -#endif /* __NSS_GRE_TUNNEL_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/fsm9010/nss_hal_pvt.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/fsm9010/nss_hal_pvt.c deleted file mode 100644 index 4a72d3d82..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/fsm9010/nss_hal_pvt.c +++ /dev/null @@ -1,342 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_hal_pvt.c - * NSS HAL private APIs. - */ - -#include -#include -#include -#include -#include -#include "nss_hal.h" -#include "nss_core.h" - -#define NSS_H2N_INTR_EMPTY_BUFFER_QUEUE_BIT 0 -#define NSS_H2N_INTR_DATA_COMMAND_QUEUE_BIT 1 -#define NSS_H2N_INTR_TX_UNBLOCKED_BIT 11 -#define NSS_H2N_INTR_TRIGGER_COREDUMP_BIT 15 - -/* - * Interrupt type to cause vector. - */ -static uint32_t intr_cause[] = {(1 << NSS_H2N_INTR_EMPTY_BUFFER_QUEUE_BIT), - (1 << NSS_H2N_INTR_DATA_COMMAND_QUEUE_BIT), - (1 << NSS_H2N_INTR_TX_UNBLOCKED_BIT), - (1 << NSS_H2N_INTR_TRIGGER_COREDUMP_BIT)}; - -/* - * nss_hal_wq_function() - * Added to Handle BH requests to kernel - */ -void nss_hal_wq_function(struct work_struct *work) -{ - /* - * Not supported in FSM9010 - */ - kfree((void *)work); -} - -/* - * nss_hal_get_num_irqs() - * get number of irqs from interrupt resource of device tree - */ -static inline int nss_hal_get_num_irqs(struct device_node *np) -{ - int num_irqs = 0; - - while (of_irq_to_resource(np, num_irqs, NULL)) { - num_irqs++; - } - - return num_irqs; -} - -/* - * nss_hal_handle_irq() - * HLOS interrupt handler for nss interrupts - */ -static irqreturn_t nss_hal_handle_irq(int irq, void *ctx) -{ - struct int_ctx_instance *int_ctx = (struct int_ctx_instance *) ctx; - struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx; - - /* - * Mask interrupt until our bottom half re-enables it - */ - nss_hal_disable_interrupt(nss_ctx, int_ctx->shift_factor, NSS_HAL_SUPPORTED_INTERRUPTS); - - /* - * Schedule tasklet to process interrupt cause - */ - napi_schedule(&int_ctx->napi); - return IRQ_HANDLED; -} - -/* - * nss_hal_of_get_pdata() - * Retrieve platform data from device node. - */ -static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *pdev) -{ - struct device_node *np = of_node_get(pdev->dev.of_node); - struct nss_platform_data *npd = NULL; - struct nss_ctx_instance *nss_ctx = NULL; - struct nss_top_instance *nss_top = &nss_top_main; - struct resource res_nphys, res_vphys; - int32_t i; - - npd = devm_kzalloc(&pdev->dev, sizeof(struct nss_platform_data), GFP_KERNEL); - if (!npd) { - return NULL; - } - - if (of_property_read_u32(np, "qcom,id", &npd->id) - || of_property_read_u32(np, "qcom,num-queue", &npd->num_queue)) { - pr_err("%s: error reading critical device node properties\n", np->name); - goto out; - } - - if (of_property_read_u32(np, "qcom,num-irq", &npd->num_irq)) { - npd->num_irq = nss_hal_get_num_irqs(np); - } - - if (npd->num_irq < npd->num_queue) { - pr_err("%s: not enough interrupts configured for all the queues\n", np->name); - goto out; - } - - if (npd->num_irq > NSS_MAX_IRQ_PER_CORE) { - pr_err("%s: exceeds maximum interrupt numbers per core\n", np->name); - goto out; - } - - nss_ctx = &nss_top->nss[npd->id]; - nss_ctx->id = npd->id; - - if (of_address_to_resource(np, 0, &res_nphys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - if (of_address_to_resource(np, 1, &res_vphys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for vphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - /* - * Save physical addresses - */ - npd->nphys = res_nphys.start; - npd->vphys = res_vphys.start; - - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); - if (!npd->nmap) { - nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - nss_assert(npd->vphys); - npd->vmap = ioremap_cache(npd->vphys, resource_size(&res_vphys)); - if (!npd->vmap) { - nss_info_always("%px: nss%d: ioremap() fail for vphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - /* - * Get IRQ numbers - */ - for (i = 0 ; i < npd->num_irq; i++) { - npd->irq[i] = irq_of_parse_and_map(np, i); - if (!npd->irq[i]) { - nss_info_always("%px: nss%d: irq_of_parse_and_map() fail for irq %d\n", nss_ctx, nss_ctx->id, i); - goto out; - } - } - - nss_hal_dt_parse_features(np, npd); - - of_node_put(np); - return npd; - -out: - if (npd->nmap) { - iounmap((void *)npd->nmap); - } - - if (npd->vmap) { - iounmap((void *)npd->vmap); - } - - devm_kfree(&pdev->dev, npd); - of_node_put(np); - return NULL; -} - -/* - * __nss_hal_debug_enable() - * Enable NSS debug - */ -static void __nss_hal_debug_enable(void) -{ - return; -} - -/* - * __nss_hal_common_reset() - */ -static int __nss_hal_common_reset(struct platform_device *nss_dev) -{ - return 0; -} - -/* - * __nss_hal_core_reset() - */ -static int __nss_hal_core_reset(struct platform_device *nss_dev, void __iomem *map, uint32_t addr, uint32_t clk_src) -{ - return 0; -} - -/* - * __nss_hal_firmware_load() - */ -static int __nss_hal_firmware_load(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd) -{ - return 0; -} - -/* - * __nss_hal_clock_configure() - */ -static int __nss_hal_clock_configure(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd) -{ - return 0; -} - -/* - * __nss_hal_read_interrupt_cause() - */ -static void __nss_hal_read_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t *cause) -{ - uint32_t value = nss_read_32(nss_ctx->nmap, NSS_REGS_N2H_INTR_STATUS_OFFSET); - *cause = (((value) >> shift_factor) & 0x7FFF); -} - -/* - * __nss_hal_clear_interrupt_cause() - */ -static void __nss_hal_clear_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_write_32(nss_ctx->nmap, NSS_REGS_N2H_INTR_CLR_OFFSET, (cause << shift_factor)); -} - -/* - * __nss_hal_disable_interrupt() - */ -static void __nss_hal_disable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_write_32(nss_ctx->nmap, NSS_REGS_N2H_INTR_MASK_CLR_OFFSET, (cause << shift_factor)); -} - -/* - * __nss_hal_enable_interrupt() - */ -static void __nss_hal_enable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_write_32(nss_ctx->nmap, NSS_REGS_N2H_INTR_MASK_SET_OFFSET, (cause << shift_factor)); -} - -/* - * __nss_hal_send_interrupt() - */ -static void __nss_hal_send_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t type) -{ - nss_write_32(nss_ctx->nmap, NSS_REGS_C2C_INTR_SET_OFFSET, intr_cause[type]); -} - -/* - * __nss_hal_request_irq() - */ -static int __nss_hal_request_irq(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, int irq_num) -{ - struct int_ctx_instance *int_ctx = &nss_ctx->int_ctx[irq_num]; - int err; - - if (irq_num == 1) { - int_ctx->shift_factor = 15; - err = request_irq(npd->irq[irq_num], nss_hal_handle_irq, 0, "nss_queue1", int_ctx); - } else { - int_ctx->shift_factor = 0; - err = request_irq(npd->irq[irq_num], nss_hal_handle_irq, 0, "nss", int_ctx); - } - if (err) { - nss_warning("%px: IRQ%d request failed", nss_ctx, npd->irq[irq_num]); - return err; - } - - int_ctx->irq = npd->irq[irq_num]; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64); - return 0; -} - -/* - * __nss_hal_init_imem - */ -void __nss_hal_init_imem(struct nss_ctx_instance *nss_ctx) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - - mem_ctx->imem_head = NSS_IMEM_START + NSS_IMEM_SIZE * nss_ctx->id; - mem_ctx->imem_end = mem_ctx->imem_head + NSS_IMEM_SIZE; - mem_ctx->imem_tail = mem_ctx->imem_head; - - nss_info("%px: IMEM init: head: 0x%x end: 0x%x tail: 0x%x\n", nss_ctx, - mem_ctx->imem_head, mem_ctx->imem_end, mem_ctx->imem_tail); -} - -/* - * __nss_hal_init_utcm_shared - */ -bool __nss_hal_init_utcm_shared(struct nss_ctx_instance *nss_ctx, uint32_t *meminfo_start) -{ - /* - * Nothing to be done as there are no UTCM_SHARED defined for fsm9010 - */ - return true; -} - -/* - * nss_hal_fsm9010_ops - */ -struct nss_hal_ops nss_hal_fsm9010_ops = { - .common_reset = __nss_hal_common_reset, - .core_reset = __nss_hal_core_reset, - .clock_configure = __nss_hal_clock_configure, - .firmware_load = __nss_hal_firmware_load, - .debug_enable = __nss_hal_debug_enable, - .of_get_pdata = __nss_hal_of_get_pdata, - .request_irq = __nss_hal_request_irq, - .send_interrupt = __nss_hal_send_interrupt, - .enable_interrupt = __nss_hal_enable_interrupt, - .disable_interrupt = __nss_hal_disable_interrupt, - .clear_interrupt_cause = __nss_hal_clear_interrupt_cause, - .read_interrupt_cause = __nss_hal_read_interrupt_cause, - .init_imem = __nss_hal_init_imem, - .init_utcm_shared = __nss_hal_init_utcm_shared, -}; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_hal.h b/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_hal.h deleted file mode 100644 index d9591a781..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_hal.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013, 2016-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_hal.h - * NSS HAL public declarations. - */ - -#ifndef __NSS_HAL_H -#define __NSS_HAL_H - -#include -#include -#include -#include - -extern struct clk *nss_core0_clk; -extern struct clk *nss_core1_clk; -extern struct nss_runtime_sampling nss_runtime_samples; -extern struct clk *nss_fab0_clk; -extern struct clk *nss_fab1_clk; -extern void nss_hal_wq_function(struct work_struct *work); - -#if defined(NSS_HAL_IPQ806X_SUPPORT) -extern struct nss_hal_ops nss_hal_ipq806x_ops; -#endif -#if defined(NSS_HAL_IPQ807x_SUPPORT) -extern struct nss_hal_ops nss_hal_ipq807x_ops; -#endif -#if defined(NSS_HAL_IPQ60XX_SUPPORT) -extern struct nss_hal_ops nss_hal_ipq60xx_ops; -#endif -#if defined(NSS_HAL_IPQ50XX_SUPPORT) -extern struct nss_hal_ops nss_hal_ipq50xx_ops; -#endif -#if defined(NSS_HAL_FSM9010_SUPPORT) -extern struct nss_hal_ops nss_hal_fsm9010_ops; -#endif - -#define NSS_HAL_SUPPORTED_INTERRUPTS (NSS_N2H_INTR_EMPTY_BUFFER_QUEUE | \ - NSS_N2H_INTR_DATA_QUEUE_0 | \ - NSS_N2H_INTR_DATA_QUEUE_1 | \ - NSS_N2H_INTR_EMPTY_BUFFERS_SOS | \ - NSS_N2H_INTR_TX_UNBLOCKED | \ - NSS_N2H_INTR_COREDUMP_COMPLETE | \ - NSS_N2H_INTR_PROFILE_DMA | \ - NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS) - -/* - * nss_hal_read_interrupt_cause() - */ -static inline void nss_hal_read_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t *cause) -{ - nss_top_main.hal_ops->read_interrupt_cause(nss_ctx, shift_factor, cause); -} - -/* - * nss_hal_clear_interrupt_cause() - */ -static inline void nss_hal_clear_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_top_main.hal_ops->clear_interrupt_cause(nss_ctx, shift_factor, cause); -} - -/* - * nss_hal_disable_interrupt() - */ -static inline void nss_hal_disable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_top_main.hal_ops->disable_interrupt(nss_ctx, shift_factor, cause); -} - -/* - * nss_hal_enable_interrupt() - */ -static inline void nss_hal_enable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_top_main.hal_ops->enable_interrupt(nss_ctx, shift_factor, cause); -} - -/* - * nss_hal_send_interrupt() - */ -static inline void nss_hal_send_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t cause) -{ - nss_top_main.hal_ops->send_interrupt(nss_ctx, cause); -} - -/* - * nss_hal_debug_enable() - */ -static inline void nss_hal_debug_enable(void) -{ - nss_top_main.hal_ops->debug_enable(); -} - -/* - * nss_hal_probe() - */ -int nss_hal_probe(struct platform_device *nss_dev); - -/* - * nss_hal_remove() - */ -int nss_hal_remove(struct platform_device *nss_dev); - -/* - * nss_hal_firmware_load() - */ -int nss_hal_firmware_load(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd); - -/* - * nss_hal_dt_parse_features() - */ -void nss_hal_dt_parse_features(struct device_node *np, struct nss_platform_data *npd); -#endif /* __NSS_HAL_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_hal_ops.h b/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_hal_ops.h deleted file mode 100644 index 736d37e6c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_hal_ops.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_hal_ops.h - * NSS HAL ops structure declaration. - */ - -#ifndef __NSS_HAL_OPS_H -#define __NSS_HAL_OPS_H - -#if (NSS_DT_SUPPORT != 1) -#include -#include -#endif - -/* - * nss_hal_ops defines the HAL layer API required to support multiple targets - */ -struct nss_hal_ops { - int (*common_reset)(struct platform_device *pdev); - int (*core_reset)(struct platform_device *nss_dev, void __iomem *map, uint32_t addr, uint32_t clk_src); - int (*clock_configure)(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd); - void (*debug_enable)(void); - struct nss_platform_data * (*of_get_pdata)(struct platform_device *pdev); - int (*firmware_load)(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd); - void (*read_interrupt_cause)(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t *cause); - int (*request_irq)(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, int irq_num); - void (*clear_interrupt_cause)(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause); - void (*send_interrupt)(struct nss_ctx_instance *nss_ctx, uint32_t type); - void (*enable_interrupt)(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause); - void (*disable_interrupt)(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause); - void (*init_imem)(struct nss_ctx_instance *nss_ctx); - bool (*init_utcm_shared)(struct nss_ctx_instance *nss_ctx, uint32_t *meminfo_start); -}; -#endif /* __NSS_HAL_OPS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_regs.h b/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_regs.h deleted file mode 100644 index 765e8a197..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/include/nss_regs.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013, 2015-2017, 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_regs.h - * NSS register definitions. - */ - -#ifndef __NSS_REGS_H -#define __NSS_REGS_H - -#include -#include - -/* - * CSM register offsets - */ -#define NSS_REGS_CORE_ID_OFFSET 0x0000 -#define NSS_REGS_RESET_CTRL_OFFSET 0x0004 -#define NSS_REGS_CORE_BAR_OFFSET 0x0008 -#define NSS_REGS_CORE_AMC_OFFSET 0x000c -#define NSS_REGS_CORE_BOOT_ADDR_OFFSET 0x0010 -#define NSS_REGS_C2C_INTR_STATUS_OFFSET 0x0014 -#define NSS_REGS_C2C_INTR_SET_OFFSET 0x0018 -#define NSS_REGS_C2C_INTR_CLR_OFFSET 0x001c -#define NSS_REGS_N2H_INTR_STATUS_OFFSET 0x0020 -#define NSS_REGS_N2H_INTR_SET_OFFSET 0x0024 -#define NSS_REGS_N2H_INTR_CLR_OFFSET 0x0028 -#define NSS_REGS_N2H_INTR_MASK_OFFSET 0x002c -#define NSS_REGS_N2H_INTR_MASK_SET_OFFSET 0x0030 -#define NSS_REGS_N2H_INTR_MASK_CLR_OFFSET 0x0034 -#define NSS_REGS_CORE_INT_STAT0_TYPE_OFFSET 0x0038 -#define NSS_REGS_CORE_INT_STAT1_TYPE_OFFSET 0x003c -#define NSS_REGS_CORE_INT_STAT2_TYPE_OFFSET 0x0040 -#define NSS_REGS_CORE_INT_STAT3_TYPE_OFFSET 0x0044 -#define NSS_REGS_CORE_IFETCH_RANGE_OFFSET 0x0048 - -/* - * FPB register offsets - */ -#define NSS_REGS_FPB_CSR_CFG_OFFSET 0x0004 - -/* - * Defines for N2H interrupts - */ -#define NSS_N2H_INTR_EMPTY_BUFFER_QUEUE (1 << 0) -#define NSS_N2H_INTR_DATA_QUEUE_0 (1 << 1) -#define NSS_N2H_INTR_DATA_QUEUE_1 (1 << 2) -#define NSS_N2H_INTR_DATA_QUEUE_2 (1 << 3) -#define NSS_N2H_INTR_DATA_QUEUE_3 (1 << 4) -#define NSS_N2H_INTR_EMPTY_BUFFERS_SOS (1 << 10) -#define NSS_N2H_INTR_TX_UNBLOCKED (1 << 11) -#define NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS (1 << 12) -#define NSS_N2H_INTR_PROFILE_DMA (1 << 13) -#define NSS_N2H_INTR_COREDUMP_COMPLETE (1 << 14) - -/* - * Types of H2N interrupts - */ -enum nss_h2n_intr_type { - NSS_H2N_INTR_EMPTY_BUFFER_QUEUE = 0, - NSS_H2N_INTR_DATA_COMMAND_QUEUE = 1, - NSS_H2N_INTR_TX_UNBLOCKED = 2, - NSS_H2N_INTR_TRIGGER_COREDUMP = 3, - NSS_H2N_INTR_EMPTY_PAGED_BUFFER_QUEUE = 4, - NSS_H2N_INTR_TYPE_MAX = 5, -}; - -/* - * clock source for NSS cores - */ -enum nss_regs_clk_src_select { - NSS_REGS_CLK_SRC_DEFAULT, - NSS_REGS_CLK_SRC_ALTERNATE -}; - -/* - * nss_read_32() - * Read NSS register - */ -static inline uint32_t nss_read_32(void __iomem *addr, uint32_t offs) -{ - return readl(addr + offs); -} - -/* - * nss_write_32() - * Write NSS register - */ -static inline void nss_write_32(void __iomem *addr, uint32_t offs, uint32_t val) -{ - writel(val, addr + offs); -} - -#endif /* __NSS_REGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq50xx/nss_hal_pvt.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq50xx/nss_hal_pvt.c deleted file mode 100644 index 3d6dfd02d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq50xx/nss_hal_pvt.c +++ /dev/null @@ -1,667 +0,0 @@ -/* - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/** - * nss_hal_pvt.c - * NSS HAL private APIs. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "nss_hal.h" -#include "nss_core.h" - -#define NSS_QGIC_IPC_REG_OFFSET 0x8 - -#define NSS0_H2N_INTR_BASE 13 - -/* - * N2H interrupts - */ -#define NSS_IRQ_NAME_EMPTY_BUF_SOS "nss_empty_buf_sos" -#define NSS_IRQ_NAME_EMPTY_BUF_QUEUE "nss_empty_buf_queue" -#define NSS_IRQ_NAME_TX_UNBLOCK "nss-tx-unblock" -#define NSS_IRQ_NAME_QUEUE0 "nss_queue0" -#define NSS_IRQ_NAME_QUEUE1 "nss_queue1" -#define NSS_IRQ_NAME_COREDUMP_COMPLETE "nss_coredump_complete" -#define NSS_IRQ_NAME_PAGED_EMPTY_BUF_SOS "nss_paged_empty_buf_sos" -#define NSS_IRQ_NAME_PROFILE_DMA "nss_profile_dma" - -/* - * CLKs - */ -#define NSS_CFG_CLK "nss-cfg-clk" -#define NSS_DBG_CLK "nss-dbg-clk" -#define NSS_CORE_CLK "nss-core-clk" -#define NSS_AXI_CLK "nss-axi-clk" -#define NSS_SNOC_AXI_CLK "nss-snoc-axi-clk" -#define NSS_NC_AXI_CLK "nss-nc-axi-clk" -#define NSS_UTCM_CLK "nss-utcm-clk" - -/* - * Core GCC reset - */ -#define NSS_CORE_GCC_RESET 0x00000007 - -/* - * GCC reset - */ -void __iomem *nss_misc_reset; -void __iomem *nss_misc_reset_flag; - -/* - * Purpose of each interrupt index: This should match the order defined in the NSS firmware - */ -enum nss_hal_n2h_intr_purpose { - NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS = 0, - NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE = 1, - NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED = 2, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0 = 3, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1 = 4, - NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE = 5, - NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS = 6, - NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA = 7, - NSS_HAL_N2H_INTR_PURPOSE_MAX -}; - -/* - * Interrupt type to cause vector. - */ -static uint32_t intr_cause[NSS_MAX_CORES][NSS_H2N_INTR_TYPE_MAX] = { - /* core0 */ - {(1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_EMPTY_BUFFER_QUEUE)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_DATA_COMMAND_QUEUE)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_TX_UNBLOCKED)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_TRIGGER_COREDUMP)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_EMPTY_PAGED_BUFFER_QUEUE))} -}; - -/* - * nss_hal_wq_function() - * Added to Handle BH requests to kernel - */ -void nss_hal_wq_function(struct work_struct *work) -{ - nss_work_t *my_work = (nss_work_t *)work; - - mutex_lock(&nss_top_main.wq_lock); - - nss_freq_change(&nss_top_main.nss[NSS_CORE_0], my_work->frequency, my_work->stats_enable, 0); - clk_set_rate(nss_core0_clk, my_work->frequency); - - nss_freq_change(&nss_top_main.nss[NSS_CORE_0], my_work->frequency, my_work->stats_enable, 1); - - mutex_unlock(&nss_top_main.wq_lock); - kfree((void *)work); -} - -/* - * nss_hal_handle_irq() - */ -static irqreturn_t nss_hal_handle_irq(int irq, void *ctx) -{ - struct int_ctx_instance *int_ctx = (struct int_ctx_instance *) ctx; - - disable_irq_nosync(irq); - napi_schedule(&int_ctx->napi); - - return IRQ_HANDLED; -} - -/* - * __nss_hal_of_get_pdata() - * Retrieve platform data from device node. - */ -static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *pdev) -{ - struct device_node *np = of_node_get(pdev->dev.of_node); - struct nss_platform_data *npd; - struct nss_ctx_instance *nss_ctx = NULL; - struct nss_top_instance *nss_top = &nss_top_main; - struct resource res_nphys, res_qgic_phys; - int32_t i; - - npd = devm_kzalloc(&pdev->dev, sizeof(struct nss_platform_data), GFP_KERNEL); - if (!npd) { - return NULL; - } - - if (of_property_read_u32(np, "qcom,id", &npd->id) - || of_property_read_u32(np, "qcom,load-addr", &npd->load_addr) - || of_property_read_u32(np, "qcom,num-queue", &npd->num_queue) - || of_property_read_u32(np, "qcom,num-irq", &npd->num_irq)) { - pr_err("%s: error reading critical device node properties\n", np->name); - goto out; - } - - /* - * Read frequencies. If failure, load default values. - */ - of_property_read_u32(np, "qcom,mid-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency); - of_property_read_u32(np, "qcom,max-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency); - - if (npd->num_irq > NSS_MAX_IRQ_PER_CORE) { - pr_err("%s: exceeds maximum interrupt numbers per core\n", np->name); - goto out; - } - - nss_ctx = &nss_top->nss[npd->id]; - nss_ctx->id = npd->id; - - if (of_address_to_resource(np, 0, &res_nphys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - if (of_address_to_resource(np, 1, &res_qgic_phys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for qgic_phys\n", nss_ctx, nss_ctx->id); - goto out; - } - - /* - * Save physical addresses - */ - npd->nphys = res_nphys.start; - npd->qgic_phys = res_qgic_phys.start; - - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); - if (!npd->nmap) { - nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys)); - if (!npd->qgic_map) { - nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id); - goto out; - } - - NSS_CORE_DSB(); - - /* - * Get IRQ numbers - */ - for (i = 0 ; i < npd->num_irq; i++) { - npd->irq[i] = irq_of_parse_and_map(np, i); - if (!npd->irq[i]) { - nss_info_always("%px: nss%d: irq_of_parse_and_map() fail for irq %d\n", nss_ctx, nss_ctx->id, i); - goto out; - } - } - - nss_hal_dt_parse_features(np, npd); - - of_node_put(np); - return npd; - -out: - if (npd->nmap) { - iounmap(npd->nmap); - } - - if (npd->vmap) { - iounmap(npd->vmap); - } - - devm_kfree(&pdev->dev, npd); - of_node_put(np); - return NULL; -} - -/* - * nss_hal_clock_set_and_enable() - */ -static int nss_hal_clock_set_and_enable(struct device *dev, const char *id, unsigned long rate) -{ - struct clk *nss_clk = NULL; - int err; - - nss_clk = devm_clk_get(dev, id); - if (IS_ERR(nss_clk)) { - pr_err("%px: cannot get clock: %s\n", dev, id); - return -EFAULT; - } - - if (rate) { - err = clk_set_rate(nss_clk, rate); - if (err) { - pr_err("%px: cannot set %s freq\n", dev, id); - return -EFAULT; - } - } - - err = clk_prepare_enable(nss_clk); - if (err) { - pr_err("%px: cannot enable clock: %s\n", dev, id); - return -EFAULT; - } - - return 0; -} - -/* - * __nss_hal_core_reset() - */ -static int __nss_hal_core_reset(struct platform_device *nss_dev, void __iomem *map, uint32_t addr, uint32_t clk_src) -{ - uint32_t value; - - /* - * Apply ubi32 core reset - */ - nss_write_32(map, NSS_REGS_RESET_CTRL_OFFSET, 0x1); - - /* - * De-assert reset - */ - value = nss_read_32(nss_misc_reset, 0x0); - value &= ~NSS_CORE_GCC_RESET; - nss_write_32(nss_misc_reset, 0x0, value); - - /* - * Program address configuration - */ - nss_write_32(map, NSS_REGS_CORE_AMC_OFFSET, 0x1); - nss_write_32(map, NSS_REGS_CORE_BAR_OFFSET, 0x3C000000); - nss_write_32(map, NSS_REGS_CORE_BOOT_ADDR_OFFSET, addr); - - /* - * Set crypto interrupt as level sensitive - */ - nss_write_32(map, NSS_REGS_CORE_INT_STAT2_TYPE_OFFSET, 0x80000000); - nss_write_32(map, NSS_REGS_CORE_INT_STAT3_TYPE_OFFSET, 0x00200000); - - /* - * Enable Instruction Fetch range checking between 0x4000 0000 to 0xBFFF FFFF. - */ - nss_write_32(map, NSS_REGS_CORE_IFETCH_RANGE_OFFSET, 0xBF004001); - - /* - * De-assert ubi32 core reset - */ - nss_write_32(map, NSS_REGS_RESET_CTRL_OFFSET, 0x0); - - /* - * Set values only once for core0. Grab the proper clock. - */ - nss_core0_clk = clk_get(&nss_dev->dev, NSS_CORE_CLK); - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency)) { - return -EFAULT; - } - - return 0; -} - -/* - * __nss_hal_debug_enable() - * Enable NSS debug - */ -static void __nss_hal_debug_enable(void) -{ - -} - -/* - * __nss_hal_common_reset - * Do reset/clock configuration common to all cores - */ -static int __nss_hal_common_reset(struct platform_device *nss_dev) -{ - struct device_node *cmn = NULL; - struct resource res_nss_misc_reset; - - /* - * Get reference to NSS common device node - */ - cmn = of_find_node_by_name(NULL, "nss-common"); - if (!cmn) { - pr_err("%px: Unable to find nss-common node\n", nss_dev); - return -EFAULT; - } - - if (of_address_to_resource(cmn, 0, &res_nss_misc_reset) != 0) { - pr_err("%px: of_address_to_resource() return error for nss_misc_reset\n", nss_dev); - of_node_put(cmn); - return -EFAULT; - } - - of_node_put(cmn); - - nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); - if (!nss_misc_reset) { - pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev); - return -EFAULT; - } - - nss_top_main.nss_hal_common_init_done = true; - nss_info("nss_hal_common_reset Done\n"); - - return 0; -} - -/* - * __nss_hal_clock_configure() - */ -static int __nss_hal_clock_configure(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd) -{ - int32_t i; - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_DBG_CLK, 150000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CFG_CLK, 100000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_AXI_CLK, 400000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_SNOC_AXI_CLK, 400000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NC_AXI_CLK, 266670000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_UTCM_CLK, 266670000)) { - return -EFAULT; - } - - /* - * No entries, then just load default - */ - if ((nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency == 0) || - (nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency == 0)) { - nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency = NSS_FREQ_SCALE_NA; - nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_850; - nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_1000; - nss_info_always("%px: Running default frequencies\n", nss_ctx); - } - - /* - * Maple low frequency not applicable, set it accordingly - */ - nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency = NSS_FREQ_SCALE_NA; - - /* - * Test frequency from dtsi, if fail, try to set default frequency. - */ - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency)) { - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, NSS_FREQ_1000)) { - return -EFAULT; - } - } - - /* - * Setup ranges, test frequency, and display. - */ - for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) { - switch (nss_runtime_samples.freq_scale[i].frequency) { - case NSS_FREQ_850: - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_850_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_850_MAX; - break; - - case NSS_FREQ_1000: - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_1000_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_1000_MAX; - break; - - case NSS_FREQ_SCALE_NA: - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_NA; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_NA; - continue; - - default: - nss_info_always("%px: Frequency not found %d\n", nss_ctx, nss_runtime_samples.freq_scale[i].frequency); - return -EFAULT; - } - - /* - * Test the frequency, if fail, then default to safe frequency and abort - */ - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[i].frequency)) { - return -EFAULT; - } - } - - nss_info_always("Supported Frequencies - "); - for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) { - switch (nss_runtime_samples.freq_scale[i].frequency) { - case NSS_FREQ_850: - nss_info_always("850 MHz "); - break; - - case NSS_FREQ_1000: - nss_info_always("1 GHz "); - break; - - case NSS_FREQ_SCALE_NA: - continue; - - default: - nss_info_always("%px: Error\nNo Table/Invalid Frequency Found\n", nss_ctx); - return -EFAULT; - } - } - nss_info_always("\n"); - - /* - * Set values only once for core0. Grab the proper clock. - */ - nss_core0_clk = clk_get(&nss_dev->dev, NSS_CORE_CLK); - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency)) { - return -EFAULT; - } - return 0; -} - -/* - * __nss_hal_read_interrupt_cause() - */ -static void __nss_hal_read_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t *cause) -{ -} - -/* - * __nss_hal_clear_interrupt_cause() - */ -static void __nss_hal_clear_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_disable_interrupt() - */ -static void __nss_hal_disable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_enable_interrupt() - */ -static void __nss_hal_enable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_send_interrupt() - */ -static void __nss_hal_send_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t type) -{ - /* - * Check if core and type is Valid - */ - nss_assert(nss_ctx->id < nss_top_main.num_nss); - nss_assert(type < NSS_H2N_INTR_TYPE_MAX); - - nss_write_32(nss_ctx->qgic_map, NSS_QGIC_IPC_REG_OFFSET, intr_cause[nss_ctx->id][type]); -} - -/* - * __nss_hal_request_irq() - */ -static int __nss_hal_request_irq(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, int irq_num) -{ - struct int_ctx_instance *int_ctx = &nss_ctx->int_ctx[irq_num]; - uint32_t cause, napi_wgt; - int err = -1, irq = npd->irq[irq_num]; - int (*napi_poll_cb)(struct napi_struct *, int) = NULL; - const char *irq_name; - - irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY); - - switch (irq_num) { - case NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS: - napi_poll_cb = nss_core_handle_napi_non_queue; - napi_wgt = NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT; - cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS; - irq_name = NSS_IRQ_NAME_EMPTY_BUF_SOS; - break; - - case NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE: - napi_poll_cb = nss_core_handle_napi_queue; - napi_wgt = NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT; - cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE; - irq_name = NSS_IRQ_NAME_EMPTY_BUF_QUEUE; - break; - - case NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED: - napi_poll_cb = nss_core_handle_napi_non_queue; - napi_wgt = NSS_TX_UNBLOCKED_PROCESSING_WEIGHT; - cause = NSS_N2H_INTR_TX_UNBLOCKED; - irq_name = NSS_IRQ_NAME_TX_UNBLOCK; - break; - - case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0: - napi_poll_cb = nss_core_handle_napi_queue; - napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT; - cause = NSS_N2H_INTR_DATA_QUEUE_0; - irq_name = NSS_IRQ_NAME_QUEUE0; - break; - - case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1: - napi_poll_cb = nss_core_handle_napi_queue; - napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT; - cause = NSS_N2H_INTR_DATA_QUEUE_1; - irq_name = NSS_IRQ_NAME_QUEUE1; - break; - - case NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE: - napi_poll_cb = nss_core_handle_napi_emergency; - napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT; - cause = NSS_N2H_INTR_COREDUMP_COMPLETE; - irq_name = NSS_IRQ_NAME_COREDUMP_COMPLETE; - break; - - case NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS: - napi_poll_cb = nss_core_handle_napi_non_queue; - napi_wgt = NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT; - cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS; - irq_name = NSS_IRQ_NAME_PAGED_EMPTY_BUF_SOS; - break; - - case NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA: - napi_poll_cb = nss_core_handle_napi_sdma; - napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT; - cause = NSS_N2H_INTR_PROFILE_DMA; - irq_name = NSS_IRQ_NAME_PROFILE_DMA; - break; - - default: - nss_warning("%px: nss%d: unsupported irq# %d\n", nss_ctx, nss_ctx->id, irq_num); - return err; - } - - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt); - int_ctx->cause = cause; - err = request_irq(irq, nss_hal_handle_irq, 0, irq_name, int_ctx); - if (err) { - nss_warning("%px: nss%d: request_irq failed for irq# %d\n", nss_ctx, nss_ctx->id, irq_num); - return err; - } - int_ctx->irq = irq; - return 0; -} - -/* - * __nss_hal_init_imem - */ -void __nss_hal_init_imem(struct nss_ctx_instance *nss_ctx) -{ - /* - * Nothing to be done as there are no TCM in ipq50xx - */ -} - -/* - * __nss_hal_init_utcm_shared - */ -bool __nss_hal_init_utcm_shared(struct nss_ctx_instance *nss_ctx, uint32_t *meminfo_start) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - uint32_t utcm_shared_map_magic = meminfo_start[2]; - uint32_t utcm_shared_start = meminfo_start[3]; - uint32_t utcm_shared_size = meminfo_start[4]; - - /* - * Check meminfo utcm_shared map magic - */ - if ((uint16_t)utcm_shared_map_magic != NSS_MEMINFO_RESERVE_AREA_UTCM_SHARED_MAP_MAGIC) { - nss_info_always("%px: failed to verify UTCM_SHARED map magic\n", nss_ctx); - return false; - } - - mem_ctx->utcm_shared_head = utcm_shared_start; - mem_ctx->utcm_shared_end = mem_ctx->utcm_shared_head + utcm_shared_size; - mem_ctx->utcm_shared_tail = mem_ctx->utcm_shared_head; - - nss_info("%px: UTCM_SHARED init: head: 0x%x end: 0x%x tail: 0x%x\n", nss_ctx, - mem_ctx->utcm_shared_head, mem_ctx->utcm_shared_end, mem_ctx->utcm_shared_tail); - return true; -} - -/* - * nss_hal_ipq50xx_ops - */ -struct nss_hal_ops nss_hal_ipq50xx_ops = { - .common_reset = __nss_hal_common_reset, - .core_reset = __nss_hal_core_reset, - .clock_configure = __nss_hal_clock_configure, - .firmware_load = nss_hal_firmware_load, - .debug_enable = __nss_hal_debug_enable, - .of_get_pdata = __nss_hal_of_get_pdata, - .request_irq = __nss_hal_request_irq, - .send_interrupt = __nss_hal_send_interrupt, - .enable_interrupt = __nss_hal_enable_interrupt, - .disable_interrupt = __nss_hal_disable_interrupt, - .clear_interrupt_cause = __nss_hal_clear_interrupt_cause, - .read_interrupt_cause = __nss_hal_read_interrupt_cause, - .init_imem = __nss_hal_init_imem, - .init_utcm_shared = __nss_hal_init_utcm_shared, -}; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq60xx/nss_hal_pvt.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq60xx/nss_hal_pvt.c deleted file mode 100644 index 4c84cb958..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq60xx/nss_hal_pvt.c +++ /dev/null @@ -1,739 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/** - * nss_hal_pvt.c - * NSS HAL private APIs. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "nss_hal.h" -#include "nss_core.h" - -#define NSS_QGIC_IPC_REG_OFFSET 0x8 - -#define NSS0_H2N_INTR_BASE 13 - -/* - * Common CLKs - */ -#define NSS_NOC_CLK "nss-noc-clk" -#define NSS_PTP_REF_CLK "nss-ptp-ref-clk" -#define NSS_CSR_CLK "nss-csr-clk" -#define NSS_CFG_CLK "nss-cfg-clk" -#define NSS_NSSNOC_QOSGEN_REF_CLK "nss-nssnoc-qosgen-ref-clk" -#define NSS_NSSNOC_SNOC_CLK "nss-nssnoc-snoc-clk" -#define NSS_NSSNOC_TIMEOUT_REF_CLK "nss-nssnoc-timeout-ref-clk" -#define NSS_CE_AXI_CLK "nss-ce-axi-clk" -#define NSS_CE_APB_CLK "nss-ce-apb-clk" -#define NSS_NSSNOC_CE_AXI_CLK "nss-nssnoc-ce-axi-clk" -#define NSS_NSSNOC_CE_APB_CLK "nss-nssnoc-ce-apb-clk" -#define NSS_MEM_NOC_UBI32_CLK "nss-mem-noc-ubi32-clk" -#define NSS_SNOC_NSSNOC_CLK "nss-snoc-nssnoc-clk" - -/* - * Per-core CLKS - */ -#define NSS_NSSNOC_AHB_CLK "nss-nssnoc-ahb-clk" -#define NSS_CORE_CLK "nss-core-clk" -#define NSS_AHB_CLK "nss-ahb-clk" -#define NSS_AXI_CLK "nss-axi-clk" -#define NSS_NC_AXI_CLK "nss-nc-axi-clk" -#define NSS_UTCM_CLK "nss-utcm-clk" - -/* - * Voltage values - */ -#define NOMINAL_VOLTAGE 1 -#define TURBO_VOLTAGE 2 - -/* - * Core reset part 1 - */ -#define NSS_CORE_GCC_RESET_1 0x00000020 - -/* - * Core reset part 2 - */ -#define NSS_CORE_GCC_RESET_2 0x00000017 - -/* - * Voltage regulator - */ -struct regulator *npu_reg; - -/* - * GCC reset - */ -void __iomem *nss_misc_reset; -void __iomem *nss_misc_reset_flag; - -/* - * Purpose of each interrupt index: This should match the order defined in the NSS firmware - */ -enum nss_hal_n2h_intr_purpose { - NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS = 0, - NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE = 1, - NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED = 2, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0 = 3, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1 = 4, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2 = 5, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3 = 6, - NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE = 7, - NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS = 8, - NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA = 9, - NSS_HAL_N2H_INTR_PURPOSE_MAX -}; - -/* - * Interrupt type to cause vector. - */ -static uint32_t intr_cause[NSS_MAX_CORES][NSS_H2N_INTR_TYPE_MAX] = { - /* core0 */ - {(1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_EMPTY_BUFFER_QUEUE)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_DATA_COMMAND_QUEUE)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_TX_UNBLOCKED)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_TRIGGER_COREDUMP)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_EMPTY_PAGED_BUFFER_QUEUE))} -}; - -/* - * nss_hal_wq_function() - * Added to Handle BH requests to kernel - */ -void nss_hal_wq_function(struct work_struct *work) -{ - nss_work_t *my_work = (nss_work_t *)work; - - mutex_lock(&nss_top_main.wq_lock); - - nss_freq_change(&nss_top_main.nss[NSS_CORE_0], my_work->frequency, my_work->stats_enable, 0); - clk_set_rate(nss_core0_clk, my_work->frequency); - - nss_freq_change(&nss_top_main.nss[NSS_CORE_0], my_work->frequency, my_work->stats_enable, 1); - - mutex_unlock(&nss_top_main.wq_lock); - kfree((void *)work); -} - -/* - * nss_hal_handle_irq() - */ -static irqreturn_t nss_hal_handle_irq(int irq, void *ctx) -{ - struct int_ctx_instance *int_ctx = (struct int_ctx_instance *) ctx; - - disable_irq_nosync(irq); - napi_schedule(&int_ctx->napi); - - return IRQ_HANDLED; -} - -/* - * __nss_hal_of_get_pdata() - * Retrieve platform data from device node. - */ -static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *pdev) -{ - struct device_node *np = of_node_get(pdev->dev.of_node); - struct nss_platform_data *npd; - struct nss_ctx_instance *nss_ctx = NULL; - struct nss_top_instance *nss_top = &nss_top_main; - struct resource res_nphys, res_qgic_phys; - int32_t i; - - npd = devm_kzalloc(&pdev->dev, sizeof(struct nss_platform_data), GFP_KERNEL); - if (!npd) { - return NULL; - } - - if (of_property_read_u32(np, "qcom,id", &npd->id) - || of_property_read_u32(np, "qcom,load-addr", &npd->load_addr) - || of_property_read_u32(np, "qcom,num-queue", &npd->num_queue) - || of_property_read_u32(np, "qcom,num-irq", &npd->num_irq)) { - pr_err("%s: error reading critical device node properties\n", np->name); - goto out; - } - - /* - * Read frequencies. If failure, load default values. - */ - of_property_read_u32(np, "qcom,low-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency); - of_property_read_u32(np, "qcom,mid-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency); - of_property_read_u32(np, "qcom,max-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency); - - if (npd->num_irq > NSS_MAX_IRQ_PER_CORE) { - pr_err("%s: exceeds maximum interrupt numbers per core\n", np->name); - goto out; - } - - nss_ctx = &nss_top->nss[npd->id]; - nss_ctx->id = npd->id; - - if (of_address_to_resource(np, 0, &res_nphys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - if (of_address_to_resource(np, 1, &res_qgic_phys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for qgic_phys\n", nss_ctx, nss_ctx->id); - goto out; - } - - /* - * Save physical addresses - */ - npd->nphys = res_nphys.start; - npd->qgic_phys = res_qgic_phys.start; - - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); - if (!npd->nmap) { - nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys)); - if (!npd->qgic_map) { - nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id); - goto out; - } - - NSS_CORE_DSB(); - - /* - * Get IRQ numbers - */ - for (i = 0 ; i < npd->num_irq; i++) { - npd->irq[i] = irq_of_parse_and_map(np, i); - if (!npd->irq[i]) { - nss_info_always("%px: nss%d: irq_of_parse_and_map() fail for irq %d\n", nss_ctx, nss_ctx->id, i); - goto out; - } - } - - nss_hal_dt_parse_features(np, npd); - - of_node_put(np); - return npd; - -out: - if (npd->nmap) { - iounmap(npd->nmap); - } - - if (npd->vmap) { - iounmap(npd->vmap); - } - - devm_kfree(&pdev->dev, npd); - of_node_put(np); - return NULL; -} - -/* - * nss_hal_clock_set_and_enable() - */ -static int nss_hal_clock_set_and_enable(struct device *dev, const char *id, unsigned long rate) -{ - struct clk *nss_clk = NULL; - int err; - - nss_clk = devm_clk_get(dev, id); - if (IS_ERR(nss_clk)) { - pr_err("%px: cannot get clock: %s\n", dev, id); - return -EFAULT; - } - - if (rate) { - err = clk_set_rate(nss_clk, rate); - if (err) { - pr_err("%px: cannot set %s freq\n", dev, id); - return -EFAULT; - } - } - - err = clk_prepare_enable(nss_clk); - if (err) { - pr_err("%px: cannot enable clock: %s\n", dev, id); - return -EFAULT; - } - - return 0; -} - -/* - * __nss_hal_core_reset() - */ -static int __nss_hal_core_reset(struct platform_device *nss_dev, void __iomem *map, uint32_t addr, uint32_t clk_src) -{ - uint32_t value; - - /* - * Apply ubi32 core reset - */ - nss_write_32(map, NSS_REGS_RESET_CTRL_OFFSET, 0x1); - - /* - * De-assert reset for first set - */ - value = nss_read_32(nss_misc_reset, 0x0); - value &= ~NSS_CORE_GCC_RESET_1; - nss_write_32(nss_misc_reset, 0x0, value); - - /* - * Minimum 10 - 20 cycles delay is required after - * de-asserting NSS reset clamp - */ - usleep_range(10, 20); - - /* - * De-assert reset for second set - */ - value &= ~NSS_CORE_GCC_RESET_2; - nss_write_32(nss_misc_reset, 0x0, value); - - /* - * Program address configuration - */ - nss_write_32(map, NSS_REGS_CORE_AMC_OFFSET, 0x1); - nss_write_32(map, NSS_REGS_CORE_BAR_OFFSET, 0x3C000000); - nss_write_32(map, NSS_REGS_CORE_BOOT_ADDR_OFFSET, addr); - - /* - * Enable Instruction Fetch range checking between 0x4000 0000 to 0xBFFF FFFF. - */ - nss_write_32(map, NSS_REGS_CORE_IFETCH_RANGE_OFFSET, 0xBF004001); - - /* - * De-assert ubi32 core reset - */ - nss_write_32(map, NSS_REGS_RESET_CTRL_OFFSET, 0x0); - - /* - * Set values only once for core0. Grab the proper clock. - */ - nss_core0_clk = clk_get(&nss_dev->dev, NSS_CORE_CLK); - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency)) { - return -EFAULT; - } - - return 0; -} - -/* - * __nss_hal_debug_enable() - * Enable NSS debug - */ -static void __nss_hal_debug_enable(void) -{ - -} - -/* - * __nss_hal_common_reset - * Do reset/clock configuration common to all cores - */ -static int __nss_hal_common_reset(struct platform_device *nss_dev) -{ - - struct device_node *cmn = NULL; - struct resource res_nss_misc_reset; - struct resource res_nss_misc_reset_flag; - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NOC_CLK, 266670000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_PTP_REF_CLK, 150000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CSR_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CFG_CLK, 100000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_QOSGEN_REF_CLK, 24000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_SNOC_CLK, 266600000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_SNOC_NSSNOC_CLK, 266670000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_TIMEOUT_REF_CLK, 6000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CE_AXI_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CE_APB_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_CE_AXI_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_CE_APB_CLK, 200000000)) { - return -EFAULT; - } - - /* - * Get reference to NSS common device node - */ - cmn = of_find_node_by_name(NULL, "nss-common"); - if (!cmn) { - pr_err("%px: Unable to find nss-common node\n", nss_dev); - return -EFAULT; - } - - if (of_address_to_resource(cmn, 0, &res_nss_misc_reset) != 0) { - pr_err("%px: of_address_to_resource() return error for nss_misc_reset\n", nss_dev); - of_node_put(cmn); - return -EFAULT; - } - - if (of_address_to_resource(cmn, 1, &res_nss_misc_reset_flag) != 0) { - pr_err("%px: of_address_to_resource() return error for nss_misc_reset_flag\n", nss_dev); - of_node_put(cmn); - return -EFAULT; - } - - of_node_put(cmn); - - nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); - if (!nss_misc_reset) { - pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev); - return -EFAULT; - } - - nss_misc_reset_flag = ioremap_nocache(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag)); - if (!nss_misc_reset_flag) { - pr_err("%px: ioremap fail for nss_misc_reset_flag\n", nss_dev); - return -EFAULT; - } - - nss_top_main.nss_hal_common_init_done = true; - nss_info("nss_hal_common_reset Done\n"); - - return 0; -} - -/* - * __nss_hal_clock_configure() - */ -static int __nss_hal_clock_configure(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd) -{ - uint32_t i; - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_AHB_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_AHB_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_AXI_CLK, 533330000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NC_AXI_CLK, 266670000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_UTCM_CLK, 266670000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_MEM_NOC_UBI32_CLK, 533330000)) { - return -EFAULT; - } - - /* - * No entries, then just load default - */ - if ((nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency == 0) || - (nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency == 0) || - (nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency == 0)) { - nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency = NSS_FREQ_187; - nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_748; - nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_1497; - nss_info_always("Running default frequencies\n"); - } - - /* - * Test frequency from dtsi, if fail, try to set default frequency. - */ - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency)) { - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, NSS_FREQ_1497)) { - return -EFAULT; - } - } - - /* - * Setup ranges, test frequency, and display. - */ - for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) { - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_187) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_187_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_187_MAX; - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_748) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_748_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_748_MAX; - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1497) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_1497_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_1497_MAX; - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1689) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_1689_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_1689_MAX; - } else { - nss_info_always("Frequency not found %d\n", nss_runtime_samples.freq_scale[i].frequency); - return -EFAULT; - } - - /* - * Test the frequency, if fail, then default to safe frequency and abort - */ - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[i].frequency)) { - return -EFAULT; - } - } - - nss_info_always("Supported Frequencies - "); - for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) { - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_187) { - nss_info_always("187.2 MHz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_748) { - nss_info_always("748.8 MHz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1497) { - nss_info_always("1.4976 GHz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1689) { - nss_info_always("1.6896 GHz "); - } else { - nss_info_always("Error\nNo Table/Invalid Frequency Found\n"); - return -EFAULT; - } - } - nss_info_always("\n"); - - /* - * Set values only once for core0. Grab the proper clock. - */ - nss_core0_clk = clk_get(&nss_dev->dev, NSS_CORE_CLK); - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency)) { - return -EFAULT; - } - - return 0; -} - -/* - * __nss_hal_read_interrupt_cause() - */ -static void __nss_hal_read_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t *cause) -{ -} - -/* - * __nss_hal_clear_interrupt_cause() - */ -static void __nss_hal_clear_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_disable_interrupt() - */ -static void __nss_hal_disable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_enable_interrupt() - */ -static void __nss_hal_enable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_send_interrupt() - */ -static void __nss_hal_send_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t type) -{ - /* - * Check if core and type is Valid - */ - nss_assert(nss_ctx->id < nss_top_main.num_nss); - nss_assert(type < NSS_H2N_INTR_TYPE_MAX); - - nss_write_32(nss_ctx->qgic_map, NSS_QGIC_IPC_REG_OFFSET, intr_cause[nss_ctx->id][type]); -} - -/* - * __nss_hal_request_irq() - */ -static int __nss_hal_request_irq(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, int irq_num) -{ - struct int_ctx_instance *int_ctx = &nss_ctx->int_ctx[irq_num]; - int err = -1, irq = npd->irq[irq_num]; - - irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY); - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_sos", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_queue", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_TX_UNBLOCKED; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss-tx-unblock", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_0; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue0", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1) { - int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_1; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue1", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2) { - int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_2; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue2", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3) { - int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_3; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue3", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE) { - int_ctx->cause = NSS_N2H_INTR_COREDUMP_COMPLETE; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_coredump_complete", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_paged_empty_buf_sos", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA) { - int_ctx->cause = NSS_N2H_INTR_PROFILE_DMA; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_profile_dma", int_ctx); - } - - if (err) { - return err; - } - - int_ctx->irq = irq; - return 0; -} - -/* - * __nss_hal_init_imem - */ -void __nss_hal_init_imem(struct nss_ctx_instance *nss_ctx) -{ - /* - * Nothing to be done as there are no TCM in ipq60xx - */ -} - -/* - * __nss_hal_init_utcm_shared - */ -bool __nss_hal_init_utcm_shared(struct nss_ctx_instance *nss_ctx, uint32_t *meminfo_start) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - uint32_t utcm_shared_map_magic = meminfo_start[2]; - uint32_t utcm_shared_start = meminfo_start[3]; - uint32_t utcm_shared_size = meminfo_start[4]; - - /* - * Check meminfo utcm_shared map magic - */ - if ((uint16_t)utcm_shared_map_magic != NSS_MEMINFO_RESERVE_AREA_UTCM_SHARED_MAP_MAGIC) { - nss_info_always("%px: failed to verify UTCM_SHARED map magic\n", nss_ctx); - return false; - } - - mem_ctx->utcm_shared_head = utcm_shared_start; - mem_ctx->utcm_shared_end = mem_ctx->utcm_shared_head + utcm_shared_size; - mem_ctx->utcm_shared_tail = mem_ctx->utcm_shared_head; - - nss_info("%px: UTCM_SHARED init: head: 0x%x end: 0x%x tail: 0x%x\n", nss_ctx, - mem_ctx->utcm_shared_head, mem_ctx->utcm_shared_end, mem_ctx->utcm_shared_tail); - return true; -} - -/* - * nss_hal_ipq60xx_ops - */ -struct nss_hal_ops nss_hal_ipq60xx_ops = { - .common_reset = __nss_hal_common_reset, - .core_reset = __nss_hal_core_reset, - .clock_configure = __nss_hal_clock_configure, - .firmware_load = nss_hal_firmware_load, - .debug_enable = __nss_hal_debug_enable, - .of_get_pdata = __nss_hal_of_get_pdata, - .request_irq = __nss_hal_request_irq, - .send_interrupt = __nss_hal_send_interrupt, - .enable_interrupt = __nss_hal_enable_interrupt, - .disable_interrupt = __nss_hal_disable_interrupt, - .clear_interrupt_cause = __nss_hal_clear_interrupt_cause, - .read_interrupt_cause = __nss_hal_read_interrupt_cause, - .init_imem = __nss_hal_init_imem, - .init_utcm_shared = __nss_hal_init_utcm_shared, -}; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_clocks.h b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_clocks.h deleted file mode 100644 index 1e7af1a4d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_clocks.h +++ /dev/null @@ -1,131 +0,0 @@ -/* * Copyright (c) 2013 The Linux Foundation. All rights reserved.* */ -/* - * Copyright (c) 2013 The Linux Foundation. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __NSS_CLOCKS_H -#define __NSS_CLOCKS_H - -#if (NSS_DT_SUPPORT != 1) -#include -#include - -#define REG(off) (MSM_CLK_CTL_BASE + (off)) -#define REG_GCC(off) (MSM_APCS_GCC_BASE + (off)) - -/* Peripheral clock registers. */ -#define PLL18_ACR REG(0x1234) -#define PLL18_MODE REG(0x31A0) -#define PLL18_L_VAL REG(0x31A4) -#define PLL18_M_VAL REG(0x31A8) -#define PLL18_N_VAL REG(0x31AC) -#define PLL18_TEST_CTL REG(0x31B0) -#define PLL18_CONFIG REG(0x31B4) -#define PLL18_STATUS REG(0x31B8) -#define PLL_LOCK_DET_STATUS REG(0x3420) -#define PLL_LOCK_DET_MASK REG(0x3424) -#define CE5_CORE_CLK_SRC_CTL REG(0x36C0) -#define CE5_CORE_CLK_SRC0_NS REG(0x36C4) -#define NSS_ACC_REG REG(0x28EC) -#define NSS_RESET_SPARE REG(0x3B60) -#define NSSFB0_CLK_SRC_CTL REG(0x3B80) -#define NSSFB0_CLK_SRC0_NS REG(0x3B84) -#define NSSFB0_CLK_SRC1_NS REG(0x3B88) -#define NSSFB0_CLK_CTL REG(0x3BA0) -#define NSSFAB_GLOBAL_BUS_NS REG(0x3BC0) -#define NSSFB1_CLK_SRC_CTL REG(0x3BE0) -#define NSSFB1_CLK_SRC0_NS REG(0x3BE4) -#define NSSFB1_CLK_SRC1_NS REG(0x3BE8) -#define NSSFB1_CLK_CTL REG(0x3C00) -#define CLK_HALT_NSSFAB0_NSSFAB1_STATEA REG(0x3C20) -#define UBI32_MPT0_CLK_CTL REG(0x3C40) -#define UBI32_MPT1_CLK_CTL REG(0x3C44) -#define CE5_HCLK_SRC_CTL REG(0x3C60) -#define CE5_HCLK_SRC0_NS REG(0x3C64) -#define CE5_HCLK_SRC1_NS REG(0x3C68) -#define CE5_HCLK_CTL REG(0x3C6C) -#define NSSFPB_CLK_CTL REG(0x3C80) -#define NSSFPB_CLK_SRC_CTL REG(0x3C84) -#define NSSFPB_CLK_SRC0_NS REG(0x3C88) -#define NSSFPB_CLK_SRC1_NS REG(0x3C8C) -#define GMAC_COREn_CLK_SRC_CTL(n) REG(0x3CA0+32*(n)) -#define GMAC_CORE1_CLK_SRC_CTL REG(0x3CA0) -#define GMAC_COREn_CLK_SRC0_MD(n) REG(0x3CA4+32*(n)) -#define GMAC_CORE1_CLK_SRC0_MD REG(0x3CA4) -#define GMAC_COREn_CLK_SRC1_MD(n) REG(0x3CA8+32*(n)) -#define GMAC_CORE1_CLK_SRC1_MD REG(0x3CA8) -#define GMAC_COREn_CLK_SRC0_NS(n) REG(0x3CAC+32*(n)) -#define GMAC_CORE1_CLK_SRC0_NS REG(0x3CAC) -#define GMAC_COREn_CLK_SRC1_NS(n) REG(0x3CB0+32*(n)) -#define GMAC_CORE1_CLK_SRC1_NS REG(0x3CB0) -#define GMAC_COREn_CLK_CTL(n) REG(0x3CB4+32*(n)) -#define GMAC_CORE1_CLK_CTL REG(0x3CB4) -#define GMAC_COREn_CLK_FS(n) REG(0x3CB8+32*(n)) -#define GMAC_CORE1_CLK_FS REG(0x3CB8) -#define GMAC_COREn_RESET(n) REG(0x3CBC+32*(n)) -#define GMAC_CORE1_RESET REG(0x3CBC) -#define UBI32_COREn_CLK_SRC_CTL(n) REG(0x3D20+32*(n)) -#define UBI32_CORE1_CLK_SRC_CTL REG(0x3D20) -#define UBI32_COREn_CLK_SRC0_MD(n) REG(0x3D24+32*(n)) -#define UBI32_CORE1_CLK_SRC0_MD REG(0x3D24) -#define UBI32_COREn_CLK_SRC1_MD(n) REG(0x3D28+32*(n)) -#define UBI32_CORE1_CLK_SRC1_MD REG(0x3D28) -#define UBI32_COREn_CLK_SRC0_NS(n) REG(0x3D2C+32*(n)) -#define UBI32_CORE1_CLK_SRC0_NS REG(0x3D2C) -#define UBI32_COREn_CLK_SRC1_NS(n) REG(0x3D30+32*(n)) -#define UBI32_CORE1_CLK_SRC1_NS REG(0x3D30) -#define UBI32_COREn_CLK_CTL(n) REG(0x3D34+32*(n)) -#define UBI32_CORE1_CLK_CTL REG(0x3D34) -#define UBI32_COREn_CLK_FS(n) REG(0x3D38+32*(n)) -#define UBI32_CORE1_CLK_FS REG(0x3D38) -#define UBI32_COREn_RESET_CLAMP(n) REG(0x3D3C+32*(n)) -#define UBI32_CORE1_RESET_CLAMP REG(0x3D3C) -#define NSS_250MHZ_CLK_SRC_CTL REG(0x3D60) -#define NSS_250MHZ_CLK_SRC0_NS REG(0x3D64) -#define NSS_250MHZ_CLK_SRC1_NS REG(0x3D68) -#define NSS_250MHZ_CLK_SRC0_MD REG(0x3D6C) -#define NSS_250MHZ_CLK_SRC1_MD REG(0x3D70) -#define NSS_250MHZ_CLK_CTL REG(0x3D74) -#define CE5_ACLK_SRC_CTL REG(0x3D80) -#define CE5_ACLK_SRC0_NS REG(0x3D84) -#define CE5_ACLK_SRC1_NS REG(0x3D88) -#define CE5_ACLK_CTL REG(0x3D8C) -#define PLL_ENA_NSS REG(0x3DA0) -#define NSSTCM_CLK_SRC_CTL REG(0x3DC0) -#define NSSTCM_CLK_SRC0_NS REG(0x3DC4) -#define NSSTCM_CLK_SRC1_NS REG(0x3DC8) -#define NSSTCM_CLK_FS REG(0x3DCC) -#define NSSTCM_CLK_CTL REG(0x3DD0) -#define CE5_CORE_0_RESET REG(0x3E00) -#define CE5_CORE_1_RESET REG(0x3E04) -#define CE5_CORE_2_RESET REG(0x3E08) -#define CE5_CORE_3_RESET REG(0x3E0C) -#define CE5_AHB_RESET REG(0x3E10) -#define NSS_RESET REG(0x3E20) -#define GMAC_AHB_RESET REG(0x3E24) -#define MACSEC_CORE1_RESET REG(0x3E28) -#define MACSEC_CORE2_RESET REG(0x3E2C) -#define MACSEC_CORE3_RESET REG(0x3E30) -#define NSS_TCM_RESET REG(0x3E40) - -enum nss_hal_pvt_pll_status { - PLL_NOT_LOCKED, - PLL_LOCKED -}; - -#endif -#endif /* __NSS_CLOCKS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_hal_pvt.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_hal_pvt.c deleted file mode 100644 index b8733e04b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq806x/nss_hal_pvt.c +++ /dev/null @@ -1,1237 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013, 2015-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_hal_pvt.c - * NSS HAL private APIs. - */ - -#include -#include -#include -#include -#include -#if (NSS_DT_SUPPORT != 1) -#include -#include -#else -#include -#include -#include -#include -#include -#endif -#include "nss_hal.h" -#include "nss_clocks.h" -#include "nss_core.h" -#if (NSS_PM_SUPPORT == 1) -#include "nss_pm.h" -#endif -#if (NSS_FABRIC_SCALING_SUPPORT == 1) -#include -#endif - -#define NSS_H2N_INTR_EMPTY_BUFFER_QUEUE_BIT 0 -#define NSS_H2N_INTR_DATA_COMMAND_QUEUE_BIT 1 -#define NSS_H2N_INTR_TX_UNBLOCKED_BIT 11 -#define NSS_H2N_INTR_EMPTY_PAGED_BUFFER_QUEUE_BIT 12 -#define NSS_H2N_INTR_TRIGGER_COREDUMP_BIT 15 - -/* - * Interrupt type to cause vector. - */ -static uint32_t intr_cause[] = {(1 << NSS_H2N_INTR_EMPTY_BUFFER_QUEUE_BIT), - (1 << NSS_H2N_INTR_DATA_COMMAND_QUEUE_BIT), - (1 << NSS_H2N_INTR_TX_UNBLOCKED_BIT), - (1 << NSS_H2N_INTR_TRIGGER_COREDUMP_BIT), - (1 << NSS_H2N_INTR_EMPTY_PAGED_BUFFER_QUEUE_BIT)}; - -#if (NSS_DT_SUPPORT == 1) -bool nss_crypto_is_scaled = false; -#endif - -#if (NSS_FW_DBG_SUPPORT == 1) -/* - * NSS debug pins configuration - */ - -/* - * Core 0, Data - * No pull up, Function 2 - */ -static struct gpiomux_setting nss_spi_data_0 = { - .func = GPIOMUX_FUNC_2, - .drv = GPIOMUX_DRV_8MA, - .pull = GPIOMUX_PULL_NONE, - .dir = GPIOMUX_IN, -}; - -/* - * Core 0, CLK, CS - * Pull up high, Function 2 - */ -static struct gpiomux_setting nss_spi_cs_clk_0 = { - .func = GPIOMUX_FUNC_2, - .drv = GPIOMUX_DRV_8MA, - .pull = GPIOMUX_PULL_UP, - .dir = GPIOMUX_IN, -}; - -/* - * Core 1, CS - * Pull up high, Function 4 - */ -static struct gpiomux_setting nss_spi_cs_1 = { - .func = GPIOMUX_FUNC_4, - .drv = GPIOMUX_DRV_8MA, - .pull = GPIOMUX_PULL_UP, - .dir = GPIOMUX_IN, -}; - -/* - * Core 1, CLK - * Pull up high, Function 5 - */ -static struct gpiomux_setting nss_spi_clk_1 = { - .func = GPIOMUX_FUNC_5, - .drv = GPIOMUX_DRV_8MA, - .pull = GPIOMUX_PULL_UP, - .dir = GPIOMUX_IN, -}; - -/* - * Core 1, Data - * Pull up none, Function 5 - */ -static struct gpiomux_setting nss_spi_data_1 = { - .func = GPIOMUX_FUNC_5, - .drv = GPIOMUX_DRV_8MA, - .pull = GPIOMUX_PULL_NONE, - .dir = GPIOMUX_IN, -}; - -static struct msm_gpiomux_config nss_spi_gpiomux[] = { - { - .gpio = 14, - .settings = { - [GPIOMUX_ACTIVE] = &nss_spi_data_0, - [GPIOMUX_SUSPENDED] = &nss_spi_data_0, - }, - }, - { - .gpio = 15, - .settings = { - [GPIOMUX_ACTIVE] = &nss_spi_data_0, - [GPIOMUX_SUSPENDED] = &nss_spi_data_0, - }, - }, - { - .gpio = 16, - .settings = { - [GPIOMUX_ACTIVE] = &nss_spi_cs_clk_0, - [GPIOMUX_SUSPENDED] = &nss_spi_cs_clk_0, - }, - }, - { - .gpio = 17, - .settings = { - [GPIOMUX_ACTIVE] = &nss_spi_cs_clk_0, - [GPIOMUX_SUSPENDED] = &nss_spi_cs_clk_0, - }, - }, - { - .gpio = 55, - .settings = { - [GPIOMUX_ACTIVE] = &nss_spi_data_1, - [GPIOMUX_SUSPENDED] = &nss_spi_data_1, - }, - }, - { - .gpio = 56, - .settings = { - [GPIOMUX_ACTIVE] = &nss_spi_data_1, - [GPIOMUX_SUSPENDED] = &nss_spi_data_1, - }, - }, - { - .gpio = 57, - .settings = { - [GPIOMUX_ACTIVE] = &nss_spi_cs_1, - [GPIOMUX_SUSPENDED] = &nss_spi_cs_1, - }, - }, - { - .gpio = 58, - .settings = { - [GPIOMUX_ACTIVE] = &nss_spi_clk_1, - [GPIOMUX_SUSPENDED] = &nss_spi_clk_1, - }, - }, -}; -#endif /* NSS_FW_DBG_SUPPORT */ - -/* - * nss_hal_scale_fabric() - * DT supported fabric scaling - */ -void nss_hal_scale_fabric(uint32_t work_frequency) -{ -#if (NSS_DT_SUPPORT == 1) - nss_crypto_pm_event_callback_t crypto_pm_cb; - bool auto_scale; - bool turbo; - -#if (NSS_FABRIC_SCALING_SUPPORT == 1) - /* - * PM framework - */ - scale_fabrics(); -#endif - if ((nss_fab0_clk != NULL) && (nss_fab1_clk != NULL)) { - if (work_frequency >= NSS_FREQ_733) { - clk_set_rate(nss_fab0_clk, NSS_FABRIC0_TURBO); - clk_set_rate(nss_fab1_clk, NSS_FABRIC1_TURBO); - } else if (work_frequency > NSS_FREQ_110) { - clk_set_rate(nss_fab0_clk, NSS_FABRIC0_NOMINAL); - clk_set_rate(nss_fab1_clk, NSS_FABRIC1_NOMINAL); - } else { - clk_set_rate(nss_fab0_clk, NSS_FABRIC0_IDLE); - clk_set_rate(nss_fab1_clk, NSS_FABRIC1_IDLE); - } - - /* - * notify crypto about the clock change - */ - crypto_pm_cb = nss_top_main.crypto_pm_callback; - if (crypto_pm_cb) { - turbo = (work_frequency >= NSS_FREQ_733); - auto_scale = nss_cmd_buf.auto_scale; - nss_crypto_is_scaled = crypto_pm_cb(nss_top_main.crypto_pm_ctx, turbo, auto_scale); - } - } -#endif -} - -/* - * nss_hal_pm_support() - * Supported in 3.4 - */ -void nss_hal_pm_support(uint32_t work_frequency) -{ -#if (NSS_PM_SUPPORT == 1) - if (!pm_client) { - return; - } - - if (work_frequency >= NSS_FREQ_733) { - nss_pm_set_perf_level(pm_client, NSS_PM_PERF_LEVEL_TURBO); - } else if (work_frequency > NSS_FREQ_110) { - nss_pm_set_perf_level(pm_client, NSS_PM_PERF_LEVEL_NOMINAL); - } else { - nss_pm_set_perf_level(pm_client, NSS_PM_PERF_LEVEL_IDLE); - } -#endif -} - -/* - * nss_hal_freq_change() - * Send frequency change message, and clock adjustment - */ -void nss_hal_freq_change(nss_work_t *my_work) -{ - nss_freq_change(&nss_top_main.nss[NSS_CORE_0], my_work->frequency, my_work->stats_enable, 0); - if (nss_top_main.nss[NSS_CORE_1].state == NSS_CORE_STATE_INITIALIZED) { - nss_freq_change(&nss_top_main.nss[NSS_CORE_1], my_work->frequency, my_work->stats_enable, 0); - } - clk_set_rate(nss_core0_clk, my_work->frequency); - - nss_freq_change(&nss_top_main.nss[NSS_CORE_0], my_work->frequency, my_work->stats_enable, 1); - if (nss_top_main.nss[NSS_CORE_1].state == NSS_CORE_STATE_INITIALIZED) { - nss_freq_change(&nss_top_main.nss[NSS_CORE_1], my_work->frequency, my_work->stats_enable, 1); - } -} - -/* - * nss_hal_wq_function() - * Added to Handle BH requests to kernel - */ -void nss_hal_wq_function(struct work_struct *work) -{ - nss_work_t *my_work = (nss_work_t *)work; - - mutex_lock(&nss_top_main.wq_lock); -#if (NSS_DT_SUPPORT == 1) - /* - * If crypto clock is in Turbo, disable scaling for other - * NSS subsystem components and retain them at turbo - */ - if (nss_crypto_is_scaled) { - nss_cmd_buf.current_freq = nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency; - mutex_unlock(&nss_top_main.wq_lock); - return; - } -#endif - - nss_hal_freq_change(my_work); - - /* - * Supported in 3.4 - */ - nss_hal_pm_support(my_work->frequency); - - nss_hal_scale_fabric(my_work->frequency); - - mutex_unlock(&nss_top_main.wq_lock); - kfree((void *)work); -} - -/* - * nss_hal_handle_irq() - * HLOS interrupt handler for nss interrupts - */ -static irqreturn_t nss_hal_handle_irq(int irq, void *ctx) -{ - struct int_ctx_instance *int_ctx = (struct int_ctx_instance *) ctx; - struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx; - - /* - * Mask interrupt until our bottom half re-enables it - */ - nss_hal_disable_interrupt(nss_ctx, int_ctx->shift_factor, NSS_HAL_SUPPORTED_INTERRUPTS); - - /* - * Schedule tasklet to process interrupt cause - */ - napi_schedule(&int_ctx->napi); - return IRQ_HANDLED; -} - -#if (NSS_DT_SUPPORT != 1) -#if defined(NSS_ENABLE_CLK) -/* - * nss_hal_pvt_enable_pll18() - * Enable PLL18 - */ -static uint32_t nss_hal_pvt_enable_pll18(uint32_t speed) -{ - uint32_t retries = 100; - - /* - * Prevent Compiler from commenting out the loop. - */ - uint32_t value; - uint32_t mask = (1 << 2); - - /* - * Start with clean slate - */ - writel(0, PLL18_MODE); - - /* - * Effective VCO Frequency = 1100 MHz Post Divide 2 - */ - if (speed == 1100) { - writel(0x4000042C, PLL18_L_VAL); - writel(0x0, PLL18_M_VAL); - writel(0x1, PLL18_N_VAL); - - /* - * PLL configuration (as provided by HW team) - */ - writel(0x01495625, PLL18_CONFIG); - writel(0x00003080, PLL18_TEST_CTL); - } else if (speed == 1466) { - /* - * Effective VCO Frequency = 1466 MHz Post Divide 2 - */ - - writel(0x4000043A, PLL18_L_VAL); - writel(0x10, PLL18_M_VAL); - writel(0x19, PLL18_N_VAL); - - /* - * PLL configuration (as provided by HW team) - */ - writel(0x014B5625, PLL18_CONFIG); - writel(0x00003080, PLL18_TEST_CTL); - } else { - BUG_ON(1); - } - - /* - * Enable PLL18 output (sequence provided by HW team) - */ - writel(0x2, PLL18_MODE); - mdelay(1); - writel(0x6, PLL18_MODE); - writel(0x7, PLL18_MODE); - - /* - * Enable NSS Vote for PLL18. - */ - writel(mask, PLL_ENA_NSS); - do { - value = readl(PLL_LOCK_DET_STATUS); - if (value & mask) { - return PLL_LOCKED; - } - - mdelay(1); - } while (retries-- > 0); - - return PLL_NOT_LOCKED; -} -#endif -#else -/* - * __nss_hal_of_get_pdata() - * Retrieve platform data from device node. - */ -static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *pdev) -{ - struct device_node *np = of_node_get(pdev->dev.of_node); - struct nss_platform_data *npd; - struct nss_ctx_instance *nss_ctx = NULL; - struct nss_top_instance *nss_top = &nss_top_main; - struct resource res_nphys, res_vphys; - int32_t i; - - npd = devm_kzalloc(&pdev->dev, sizeof(struct nss_platform_data), GFP_KERNEL); - if (!npd) { - return NULL; - } - - if (of_property_read_u32(np, "qcom,id", &npd->id) - || of_property_read_u32(np, "qcom,load-addr", &npd->load_addr) - || of_property_read_u32(np, "qcom,num-queue", &npd->num_queue) - || of_property_read_u32(np, "qcom,num-irq", &npd->num_irq)) { - pr_err("%s: error reading critical device node properties\n", np->name); - goto out; - } - - /* - * Read frequencies. If failure, load default values. - */ - of_property_read_u32(np, "qcom,low-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency); - of_property_read_u32(np, "qcom,mid-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency); - of_property_read_u32(np, "qcom,max-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency); - - if (npd->num_irq < npd->num_queue) { - pr_err("%s: not enough interrupts configured for all the queues\n", np->name); - goto out; - } - - if (npd->num_irq > NSS_MAX_IRQ_PER_CORE) { - pr_err("%s: exceeds maximum interrupt numbers per core\n", np->name); - goto out; - } - - nss_ctx = &nss_top->nss[npd->id]; - nss_ctx->id = npd->id; - - if (of_address_to_resource(np, 0, &res_nphys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - if (of_address_to_resource(np, 1, &res_vphys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for vphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - /* - * Save physical addresses - */ - npd->nphys = res_nphys.start; - npd->vphys = res_vphys.start; - - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); - if (!npd->nmap) { - nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - nss_assert(npd->vphys); - npd->vmap = ioremap_cache(npd->vphys, resource_size(&res_vphys)); - if (!npd->vmap) { - nss_info_always("%px: nss%d: ioremap() fail for vphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - /* - * Clear TCM memory used by this core - */ - for (i = 0; i < resource_size(&res_vphys) ; i += 4) { - nss_write_32(npd->vmap, i, 0); - NSS_CORE_DMA_CACHE_MAINT((npd->vmap + i), 4, DMA_TO_DEVICE); - } - NSS_CORE_DSB(); - - /* - * Get IRQ numbers - */ - for (i = 0 ; i < npd->num_irq; i++) { - npd->irq[i] = irq_of_parse_and_map(np, i); - if (!npd->irq[i]) { - nss_info_always("%px: nss%d: irq_of_parse_and_map() fail for irq %d\n", nss_ctx, nss_ctx->id, i); - goto out; - } - } - - nss_hal_dt_parse_features(np, npd); - - of_node_put(np); - return npd; - -out: - if (npd->nmap) { - iounmap(npd->nmap); - } - - if (npd->vmap) { - iounmap(npd->vmap); - } - - devm_kfree(&pdev->dev, npd); - of_node_put(np); - return NULL; -} -#endif - -/* - * __nss_hal_core_reset() - */ -static int __nss_hal_core_reset(struct platform_device *nss_dev, void __iomem *map, uint32_t addr, uint32_t clk_src) -{ -#if (NSS_DT_SUPPORT == 1) - struct reset_control *rstctl = NULL; - - /* - * Remove UBI32 reset clamp - */ - rstctl = devm_reset_control_get(&nss_dev->dev, "clkrst-clamp"); - if (IS_ERR(rstctl)) { - nss_info_always("%px: Deassert UBI32 core%d reset clamp failed", nss_dev, nss_dev->id); - return -EFAULT; - } - reset_control_deassert(rstctl); - - /* - * Remove UBI32 core clamp - */ - rstctl = devm_reset_control_get(&nss_dev->dev, "clamp"); - if (IS_ERR(rstctl)) { - nss_info_always("%px: Deassert UBI32 core%d clamp failed", nss_dev, nss_dev->id); - return -EFAULT; - } - reset_control_deassert(rstctl); - - /* - * Remove UBI32 AHB reset - */ - rstctl = devm_reset_control_get(&nss_dev->dev, "ahb"); - if (IS_ERR(rstctl)) { - nss_info_always("%px: Deassert AHB core%d reset failed", nss_dev, nss_dev->id); - return -EFAULT; - } - reset_control_deassert(rstctl); - - /* - * Remove UBI32 AXI reset - */ - rstctl = devm_reset_control_get(&nss_dev->dev, "axi"); - if (IS_ERR(rstctl)) { - nss_info_always("%px: Deassert core%d AXI reset failed", nss_dev, nss_dev->id); - return -EFAULT; - } - reset_control_deassert(rstctl); -#else -#if defined(NSS_ENABLE_CLOCK) - /* - * Enable mpt clock - */ - writel(0x10, UBI32_MPT0_CLK_CTL); - - /* - * UBI coren clock root enable - */ - if (clk_src == NSS_REGS_CLK_SRC_DEFAULT) { - /* select Src0 */ - writel(0x02, UBI32_COREn_CLK_SRC_CTL(nss_dev->id)); - } else { - /* select Src1 */ - writel(0x03, UBI32_COREn_CLK_SRC_CTL(nss_dev->id)); - } - - /* - * Src0: Bypass M value configuration. - */ - - /* - * Src1: M val is 0x01 and NOT_2D value is 0xfd, 400 MHz with PLL0. - */ - writel(0x100fd, UBI32_COREn_CLK_SRC1_MD(nss_dev->id)); - - /* - * Bypass, pll18 - * Effective frequency = 550 MHz - */ - writel(0x00000001, UBI32_COREn_CLK_SRC0_NS(nss_dev->id)); - - /* - * Dual edge, pll0, NOT(N_M) = 0xfe. - * Effective frequency = 400 MHz - */ - writel(0x00fe0142, UBI32_COREn_CLK_SRC1_NS(nss_dev->id)); - - /* - * UBI32 coren clock control branch. - */ - writel(0x4f, UBI32_COREn_CLK_FS(nss_dev->id)); - - /* - * UBI32 coren clock control branch. - */ - writel(0x10, UBI32_COREn_CLK_CTL(nss_dev->id)); -#endif - /* - * Remove UBI32 reset clamp - */ - writel(0xB, UBI32_COREn_RESET_CLAMP(nss_dev->id)); - - /* - * Busy wait for few cycles - */ - mdelay(1); - - /* - * Remove UBI32 core clamp - */ - writel(0x3, UBI32_COREn_RESET_CLAMP(nss_dev->id)); - - mdelay(1); - - /* - * Remove UBI32 AHB reset - */ - writel(0x1, UBI32_COREn_RESET_CLAMP(nss_dev->id)); - - mdelay(1); - - /* - * Remove UBI32 AXI reset - */ - writel(0x0, UBI32_COREn_RESET_CLAMP(nss_dev->id)); - - mdelay(1); -#endif /* NSS_DT_SUPPORT */ - - /* - * Apply ubi32 core reset - */ - nss_write_32(map, NSS_REGS_RESET_CTRL_OFFSET, 1); - - /* - * Program address configuration - */ - nss_write_32(map, NSS_REGS_CORE_AMC_OFFSET, 1); - nss_write_32(map, NSS_REGS_CORE_BAR_OFFSET, 0x3c000000); - nss_write_32(map, NSS_REGS_CORE_BOOT_ADDR_OFFSET, addr); - - /* - * C2C interrupts are level sensitive - */ - nss_write_32(map, NSS_REGS_CORE_INT_STAT2_TYPE_OFFSET, 0xFFFF); - - /* - * Enable Instruction Fetch range checking between 0x4000 0000 to 0xBFFF FFFF. - */ - nss_write_32(map, NSS_REGS_CORE_IFETCH_RANGE_OFFSET, 0xBF004001); - - /* - * De-assert ubi32 core reset - */ - nss_write_32(map, NSS_REGS_RESET_CTRL_OFFSET, 0); - - return 0; -} - -/* - * __nss_hal_debug_enable() - * Enable NSS debug - */ -static void __nss_hal_debug_enable(void) -{ -#if (NSS_FW_DBG_SUPPORT == 1) - msm_gpiomux_install(nss_spi_gpiomux, - ARRAY_SIZE(nss_spi_gpiomux)); -#endif -} - -/* - * __nss_hal_common_reset - * Do reset/clock configuration common to all cores - */ -static int __nss_hal_common_reset(struct platform_device *nss_dev) -{ -#if (NSS_DT_SUPPORT == 1) - struct device_node *cmn = NULL; - struct resource res_nss_fpb_base; - struct clk *nss_tcm_src = NULL; - struct clk *nss_tcm_clk = NULL; - void __iomem *fpb_base; - int err; - - /* - * Get reference to NSS common device node - */ - cmn = of_find_node_by_name(NULL, "nss-common"); - if (!cmn) { - pr_err("%px: Unable to find nss-common node\n", nss_dev); - return -EFAULT; - } - - if (of_address_to_resource(cmn, 0, &res_nss_fpb_base) != 0) { - pr_err("%px: of_address_to_resource() return error for nss_fpb_base\n", nss_dev); - of_node_put(cmn); - return -EFAULT; - } - of_node_put(cmn); - - fpb_base = ioremap_nocache(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base)); - if (!fpb_base) { - pr_err("%px: ioremap fail for nss_fpb_base\n", nss_dev); - return -EFAULT; - } - - /* - * Attach debug interface to TLMM - */ - nss_write_32(fpb_base, NSS_REGS_FPB_CSR_CFG_OFFSET, 0x360); - - /* - * NSS TCM CLOCK - */ - nss_tcm_src = clk_get(&nss_dev->dev, NSS_TCM_SRC_CLK); - if (IS_ERR(nss_tcm_src)) { - pr_err("%px: cannot get clock: %s\n", nss_dev, NSS_TCM_SRC_CLK); - return -EFAULT; - } - - err = clk_set_rate(nss_tcm_src, NSSTCM_FREQ); - if (err) { - pr_err("%px: cannot set NSSTCM freq\n", nss_dev); - return -EFAULT; - } - - err = clk_prepare_enable(nss_tcm_src); - if (err) { - pr_err("%px: cannot enable NSSTCM clock source\n", nss_dev); - return -EFAULT; - } - - nss_tcm_clk = clk_get(&nss_dev->dev, NSS_TCM_CLK); - if (IS_ERR(nss_tcm_clk)) { - pr_err("%px: cannot get clock: %s\n", nss_dev, NSS_TCM_CLK); - return -EFAULT; - } - - err = clk_prepare_enable(nss_tcm_clk); - if (err) { - pr_err("%px: cannot enable NSSTCM clock\n", nss_dev); - return -EFAULT; - } - - /* - * NSS Fabric Clocks. - */ - nss_fab0_clk = clk_get(&nss_dev->dev, NSS_FABRIC0_CLK); - if (IS_ERR(nss_fab0_clk)) { - pr_err("%px: cannot get clock: %s\n", nss_dev, NSS_FABRIC0_CLK); - nss_fab0_clk = NULL; - } else { - err = clk_prepare_enable(nss_fab0_clk); - if (err) { - pr_err("%px: cannot enable clock: %s\n", nss_dev, NSS_FABRIC0_CLK); - return -EFAULT; - } - } - - nss_fab1_clk = clk_get(&nss_dev->dev, NSS_FABRIC1_CLK); - if (IS_ERR(nss_fab1_clk)) { - pr_err("%px: cannot get clock: %s\n", nss_dev, NSS_FABRIC1_CLK); - nss_fab1_clk = NULL; - } else { - err = clk_prepare_enable(nss_fab1_clk); - if (err) { - pr_err("%px: cannot enable clock: %s\n", nss_dev, NSS_FABRIC1_CLK); - return -EFAULT; - } - } - - nss_top_main.nss_hal_common_init_done = true; - nss_info("nss_hal_common_reset Done\n"); - return 0; -} -#else - uint32_t i; - uint32_t value; - uint32_t status_mask = 0x1; - uint32_t wait_cycles = 100; - -#if defined(NSS_ENABLE_CLK) - /* - * NSS FPB CLOCK - */ - - /* - * Enable clock root and Divider 0 - * NOTE: Default value is good so no work here - */ - - /* - * PLL0 (800 MHZ). SRC_SEL is 2 (3'b010) - * src_div selected is Div-6 (4'b0101). - * - * Effective frequency (Divider 0) = 133 MHz - */ - writel(0x2a, NSSFPB_CLK_SRC0_NS); - - /* - * Enable clock branch - */ - writel(0x50, NSSFPB_CLK_CTL); - - /* - * NSS FABRIC0 CLOCK - */ - - /* - * Enable clock root and Divider 0 - * NOTE: Default value is good so no work here - */ - - /* - * PLL0 (800 MHZ) and div is set to 2. - * Effective frequency = 400 MHZ. - */ - writel(0x0a, NSSFB0_CLK_SRC0_NS); - - /* - * NSS Fabric0 Branch and dynamic clock gating enabled. - */ - writel(0x50, NSSFB0_CLK_CTL); - - /* - * Enable clock root and Divider 0 - * NOTE: Default value is good so no work here - */ - - /* - * PLL0 (800 MHZ) and div is set to 4. - * Effective frequency = 200 MHZ. - */ - writel(0x1a, NSSFB1_CLK_SRC0_NS); - - /* - * NSS Fabric1 Branch enable and fabric clock gating enabled. - */ - writel(0x50, NSSFB1_CLK_CTL); - - /* - * NSS TCM CLOCK - */ - - /* - * Enable NSS TCM clock root source and select divider 0. - * - * NOTE: Default value is not good here - */ - writel(0x2, NSSTCM_CLK_SRC_CTL); - - /* - * PLL0 (800 MHZ) and div is set to 2. - * Effective frequency = 400 MHZ - */ - writel(0xa, NSSTCM_CLK_SRC0_NS); - - /* - * NSS TCM Branch enable and fabric clock gating enabled. - */ - writel(0x50, NSSTCM_CLK_CTL); - - /* - * Enable global NSS clock branches. - * NSS global Fab Branch enable and fabric clock gating enabled. - */ - writel(0xf, NSSFAB_GLOBAL_BUS_NS); - - /* - * Send reset interrupt to NSS - */ - writel(0x0, NSS_RESET); - - /* - * Enable PLL18 - */ - pll18_status = nss_hal_pvt_enable_pll18(); - if (!pll18_status) { - /* - * Select alternate good source (Src1/pll0) - */ - nss_top->clk_src = NSS_REGS_CLK_SRC_ALTERNATE; - return; - } - - /* - * Select default source (Src0/pll18) - */ - nss_top->clk_src = NSS_REGS_CLK_SRC_DEFAULT; -#endif - - /* - * Attach debug interface to TLMM - */ - nss_write_32((uint32_t)MSM_NSS_FPB_BASE, NSS_REGS_FPB_CSR_CFG_OFFSET, 0x360); - - /* - * NSS TCM CLOCK - */ - - /* - * Enable NSS TCM clock root source - SRC1. - * - */ - writel(0x3, NSSTCM_CLK_SRC_CTL); - - /* Enable PLL Voting for 0 */ - writel((readl(PLL_ENA_NSS) | 0x1), PLL_ENA_NSS); - do { - value = readl(PLL_LOCK_DET_STATUS); - if (value & status_mask) { - break; - } - mdelay(1); - } while (wait_cycles-- > 0); - - /* - * PLL0 (800 MHZ) and div is set to 3/4. - * Effective frequency = 266/400 Mhz for SRC0/1 - */ - writel(0x12, NSSTCM_CLK_SRC0_NS); - writel(0xa, NSSTCM_CLK_SRC1_NS); - - /* - * NSS TCM Branch enable and fabric clock gating enabled. - */ - writel(0x50, NSSTCM_CLK_CTL); - - /* - * Clear TCM memory - */ - for (i = 0; i < IPQ806X_NSS_TCM_SIZE; i += 4) { - nss_write_32((uint32_t)MSM_NSS_TCM_BASE, i, 0); - } - - return 0; -} -#endif /* NSS_DT_SUPPORT */ - -/* - * __nss_hal_clock_configure() - */ -static int __nss_hal_clock_configure(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd) -{ -#if (NSS_FABRIC_SCALING_SUPPORT == 1) - struct fab_scaling_info fab_data; -#endif - int i, err; - - /* - * Both ubi core on ipq806x attach to the same clock, configure just the core0 - */ - if (nss_ctx->id) { - return 0; - } - - nss_core0_clk = clk_get(&nss_dev->dev, NSS_CORE_CLK); - if (IS_ERR(nss_core0_clk)) { - err = PTR_ERR(nss_core0_clk); - nss_info_always("%px: Regulator %s get failed, err=%d\n", nss_ctx, dev_name(&nss_dev->dev), err); - return err; - } - - /* - * Check if turbo is supported - */ - if (npd->turbo_frequency) { - nss_info_always("nss_driver - Turbo Support %d\n", npd->turbo_frequency); -#if (NSS_PM_SUPPORT == 1) - nss_pm_set_turbo(); -#endif - } else { - nss_info_always("nss_driver - Turbo No Support %d\n", npd->turbo_frequency); - } - - /* - * If valid entries - from dtsi - then just init clks. - * Otherwise query for clocks. - */ - if ((nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency != 0) && - (nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency != 0) && - (nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency != 0)) { - goto clk_complete; - } - - /* - * Load default scales, then query for higher. - * If basic set cannot be set, then go to error, and abort - * Two set of defaults, 110, 550, 733 or 110, 275 and 550 - */ - if (clk_set_rate(nss_core0_clk, NSS_FREQ_110) != 0) { - return -EFAULT; - } - nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency = NSS_FREQ_110; - - if (npd->turbo_frequency) { - /* - * Figure out the middle scale - */ - if (clk_set_rate(nss_core0_clk, NSS_FREQ_600) == 0) { - nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_600; - } else if (clk_set_rate(nss_core0_clk, NSS_FREQ_550) == 0) { - nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_550; - } else { - return -EFAULT; - } - - /* - * Figure out the max scale - */ - if (clk_set_rate(nss_core0_clk, NSS_FREQ_800) == 0) { - nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_800; - } else if (clk_set_rate(nss_core0_clk, NSS_FREQ_733) == 0) { - nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_733; - } else { - return -EFAULT; - } - - } else { - if (clk_set_rate(nss_core0_clk, NSS_FREQ_275) != 0) { - return -EFAULT; - } - nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_275; - - if (clk_set_rate(nss_core0_clk, NSS_FREQ_550) != 0) { - return -EFAULT; - } - nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_550; - } - -clk_complete: -#if (NSS_FABRIC_SCALING_SUPPORT == 1) - if (npd->turbo_frequency) { - fab_data.idle_freq = nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency; - } else { - fab_data.idle_freq = nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency; - } - fab_data.clk = nss_core0_clk; - fab_scaling_register(&fab_data); -#endif - - /* - * Setup Ranges - */ - for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) { - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_110) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_110_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_110_MAX; - } - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_275) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_275_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_275_MAX; - } - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_550) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_550_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_550_MAX; - } - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_600) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_600_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_600_MAX; - } - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_733) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_733_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_733_MAX; - } - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_800) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_800_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_800_MAX; - } - } - - nss_info_always("Supported Frequencies - "); - for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) { - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_110) { - nss_info_always("110Mhz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_275) { - nss_info_always("275Mhz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_550) { - nss_info_always("550Mhz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_600) { - nss_info_always("600Mhz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_733) { - nss_info_always("733Mhz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_800) { - nss_info_always("800Mhz "); - } else { - nss_info_always("Error\nNo Table/Invalid Frequency Found - Loading Old Tables -"); - return -EFAULT; - } - } - nss_info_always("\n"); - - /* - * Set default frequency - */ - err = clk_set_rate(nss_core0_clk, nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency); - if (err) { - nss_info_always("%px: cannot set nss core0 clock\n", nss_ctx); - return -EFAULT; - } - - err = clk_prepare_enable(nss_core0_clk); - if (err) { - nss_info_always("%px: cannot enable nss core0 clock\n", nss_ctx); - return -EFAULT; - } - - return 0; -} - -/* - * __nss_hal_read_interrupt_cause() - */ -static void __nss_hal_read_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t *cause) -{ - uint32_t value = nss_read_32(nss_ctx->nmap, NSS_REGS_N2H_INTR_STATUS_OFFSET); - *cause = (((value) >> shift_factor) & 0x7FFF); -} - -/* - * __nss_hal_clear_interrupt_cause() - */ -static void __nss_hal_clear_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_write_32(nss_ctx->nmap, NSS_REGS_N2H_INTR_CLR_OFFSET, (cause << shift_factor)); -} - -/* - * __nss_hal_disable_interrupt() - */ -static void __nss_hal_disable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_write_32(nss_ctx->nmap, NSS_REGS_N2H_INTR_MASK_CLR_OFFSET, (cause << shift_factor)); -} - -/* - * __nss_hal_enable_interrupt() - */ -static void __nss_hal_enable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ - nss_write_32(nss_ctx->nmap, NSS_REGS_N2H_INTR_MASK_SET_OFFSET, (cause << shift_factor)); -} - -/* - * __nss_hal_send_interrupt() - */ -static void __nss_hal_send_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t type) -{ - nss_write_32(nss_ctx->nmap, NSS_REGS_C2C_INTR_SET_OFFSET, intr_cause[type]); -} - -/* - * __nss_hal_request_irq() - */ -static int __nss_hal_request_irq(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, int irq_num) -{ - struct int_ctx_instance *int_ctx = &nss_ctx->int_ctx[irq_num]; - int err; - - if (irq_num == 1) { - int_ctx->shift_factor = 15; - err = request_irq(npd->irq[irq_num], nss_hal_handle_irq, 0, "nss_queue1", int_ctx); - } else { - int_ctx->shift_factor = 0; - err = request_irq(npd->irq[irq_num], nss_hal_handle_irq, 0, "nss", int_ctx); - } - if (err) { - nss_info_always("%px: IRQ%d request failed", nss_ctx, npd->irq[irq_num]); - return err; - } - - int_ctx->irq = npd->irq[irq_num]; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64); - - return 0; -} - -/* - * __nss_hal_init_imem - */ -void __nss_hal_init_imem(struct nss_ctx_instance *nss_ctx) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - - mem_ctx->imem_head = NSS_IMEM_START + NSS_IMEM_SIZE * nss_ctx->id; - mem_ctx->imem_end = mem_ctx->imem_head + NSS_IMEM_SIZE; - mem_ctx->imem_tail = mem_ctx->imem_head; - - nss_info("%px: IMEM init: head: 0x%x end: 0x%x tail: 0x%x\n", nss_ctx, - mem_ctx->imem_head, mem_ctx->imem_end, mem_ctx->imem_tail); -} - -/* - * __nss_hal_init_utcm_shared - */ -bool __nss_hal_init_utcm_shared(struct nss_ctx_instance *nss_ctx, uint32_t *meminfo_start) -{ - /* - * Nothing to be done as there are no UTCM_SHARED defined for ipq806x - */ - return true; -} - -/* - * nss_hal_ipq806x_ops - */ -struct nss_hal_ops nss_hal_ipq806x_ops = { - .common_reset = __nss_hal_common_reset, - .core_reset = __nss_hal_core_reset, - .clock_configure = __nss_hal_clock_configure, - .firmware_load = nss_hal_firmware_load, - .debug_enable = __nss_hal_debug_enable, -#if (NSS_DT_SUPPORT == 1) - .of_get_pdata = __nss_hal_of_get_pdata, -#endif - .request_irq = __nss_hal_request_irq, - .send_interrupt = __nss_hal_send_interrupt, - .enable_interrupt = __nss_hal_enable_interrupt, - .disable_interrupt = __nss_hal_disable_interrupt, - .clear_interrupt_cause = __nss_hal_clear_interrupt_cause, - .read_interrupt_cause = __nss_hal_read_interrupt_cause, - .init_imem = __nss_hal_init_imem, - .init_utcm_shared = __nss_hal_init_utcm_shared, -}; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq807x/nss_hal_pvt.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq807x/nss_hal_pvt.c deleted file mode 100644 index b95a23c4b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/ipq807x/nss_hal_pvt.c +++ /dev/null @@ -1,771 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_hal_pvt.c - * NSS HAL private APIs. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "nss_hal.h" -#include "nss_core.h" - -#define NSS_QGIC_IPC_REG_OFFSET 0x8 - -#define NSS0_H2N_INTR_BASE 13 -#define NSS1_H2N_INTR_BASE 19 - -/* - * Common CLKs - */ -#define NSS_NOC_CLK "nss-noc-clk" -#define NSS_PTP_REF_CLK "nss-ptp-ref-clk" -#define NSS_CSR_CLK "nss-csr-clk" -#define NSS_CFG_CLK "nss-cfg-clk" -#define NSS_IMEM_CLK "nss-imem-clk" -#define NSS_NSSNOC_QOSGEN_REF_CLK "nss-nssnoc-qosgen-ref-clk" -#define NSS_MEM_NOC_NSS_AXI_CLK "nss-mem-noc-nss-axi-clk" -#define NSS_NSSNOC_SNOC_CLK "nss-nssnoc-snoc-clk" -#define NSS_NSSNOC_TIMEOUT_REF_CLK "nss-nssnoc-timeout-ref-clk" -#define NSS_CE_AXI_CLK "nss-ce-axi-clk" -#define NSS_CE_APB_CLK "nss-ce-apb-clk" -#define NSS_NSSNOC_CE_AXI_CLK "nss-nssnoc-ce-axi-clk" -#define NSS_NSSNOC_CE_APB_CLK "nss-nssnoc-ce-apb-clk" - -/* - * Per-core CLKS - */ -#define NSS_NSSNOC_AHB_CLK "nss-nssnoc-ahb-clk" -#define NSS_CORE_CLK "nss-core-clk" -#define NSS_AHB_CLK "nss-ahb-clk" -#define NSS_AXI_CLK "nss-axi-clk" -#define NSS_MPT_CLK "nss-mpt-clk" -#define NSS_NC_AXI_CLK "nss-nc-axi-clk" - -/* - * Voltage values - */ -#define NOMINAL_VOLTAGE 1 -#define TURBO_VOLTAGE 2 - -/* - * Core reset part 1 - */ -#define NSS_CORE_GCC_RESET_1 0x00000020 - -/* - * Core reset part 2 - */ -#define NSS_CORE_GCC_RESET_2 0x00000017 - -/* - * Voltage regulator - */ -struct regulator *npu_reg; - -/* - * GCC reset - */ -void __iomem *nss_misc_reset; - -/* - * Purpose of each interrupt index: This should match the order defined in the NSS firmware - */ -enum nss_hal_n2h_intr_purpose { - NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS = 0, - NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE = 1, - NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED = 2, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0 = 3, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1 = 4, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2 = 5, - NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3 = 6, - NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE = 7, - NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS = 8, - NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA = 9, - NSS_HAL_N2H_INTR_PURPOSE_MAX -}; - -/* - * Interrupt type to cause vector. - */ -static uint32_t intr_cause[NSS_MAX_CORES][NSS_H2N_INTR_TYPE_MAX] = { - /* core0 */ - {(1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_EMPTY_BUFFER_QUEUE)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_DATA_COMMAND_QUEUE)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_TX_UNBLOCKED)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_TRIGGER_COREDUMP)), - (1 << (NSS0_H2N_INTR_BASE + NSS_H2N_INTR_EMPTY_PAGED_BUFFER_QUEUE))}, - /* core 1 */ - {(1 << (NSS1_H2N_INTR_BASE + NSS_H2N_INTR_EMPTY_BUFFER_QUEUE)), - (1 << (NSS1_H2N_INTR_BASE + NSS_H2N_INTR_DATA_COMMAND_QUEUE)), - (1 << (NSS1_H2N_INTR_BASE + NSS_H2N_INTR_TX_UNBLOCKED)), - (1 << (NSS1_H2N_INTR_BASE + NSS_H2N_INTR_TRIGGER_COREDUMP)), - (1 << (NSS1_H2N_INTR_BASE + NSS_H2N_INTR_EMPTY_PAGED_BUFFER_QUEUE))} -}; - -/* - * nss_hal_wq_function() - * Added to Handle BH requests to kernel - */ -void nss_hal_wq_function(struct work_struct *work) -{ - nss_work_t *my_work = (nss_work_t *)work; - - mutex_lock(&nss_top_main.wq_lock); - - if (my_work->frequency > NSS_FREQ_1497) { - regulator_set_voltage(npu_reg, TURBO_VOLTAGE, TURBO_VOLTAGE); - } - - nss_freq_change(&nss_top_main.nss[NSS_CORE_0], my_work->frequency, my_work->stats_enable, 0); - if (nss_top_main.nss[NSS_CORE_1].state == NSS_CORE_STATE_INITIALIZED) { - nss_freq_change(&nss_top_main.nss[NSS_CORE_1], my_work->frequency, my_work->stats_enable, 0); - } - clk_set_rate(nss_core0_clk, my_work->frequency); - - nss_freq_change(&nss_top_main.nss[NSS_CORE_0], my_work->frequency, my_work->stats_enable, 1); - if (nss_top_main.nss[NSS_CORE_1].state == NSS_CORE_STATE_INITIALIZED) { - nss_freq_change(&nss_top_main.nss[NSS_CORE_1], my_work->frequency, my_work->stats_enable, 1); - } - - clk_set_rate(nss_core1_clk, my_work->frequency); - if (my_work->frequency <= NSS_FREQ_1497) { - regulator_set_voltage(npu_reg, NOMINAL_VOLTAGE, NOMINAL_VOLTAGE); - } - - mutex_unlock(&nss_top_main.wq_lock); - kfree((void *)work); -} - -/* - * nss_hal_handle_irq() - */ -static irqreturn_t nss_hal_handle_irq(int irq, void *ctx) -{ - struct int_ctx_instance *int_ctx = (struct int_ctx_instance *) ctx; - - disable_irq_nosync(irq); - napi_schedule(&int_ctx->napi); - - return IRQ_HANDLED; -} - -/* - * __nss_hal_of_get_pdata() - * Retrieve platform data from device node. - */ -static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *pdev) -{ - struct device_node *np = of_node_get(pdev->dev.of_node); - struct nss_platform_data *npd; - struct nss_ctx_instance *nss_ctx = NULL; - struct nss_top_instance *nss_top = &nss_top_main; - struct resource res_nphys, res_vphys, res_qgic_phys; - int32_t i; - - npd = devm_kzalloc(&pdev->dev, sizeof(struct nss_platform_data), GFP_KERNEL); - if (!npd) { - return NULL; - } - - if (of_property_read_u32(np, "qcom,id", &npd->id) - || of_property_read_u32(np, "qcom,load-addr", &npd->load_addr) - || of_property_read_u32(np, "qcom,num-queue", &npd->num_queue) - || of_property_read_u32(np, "qcom,num-irq", &npd->num_irq)) { - pr_err("%s: error reading critical device node properties\n", np->name); - goto out; - } - - /* - * Read frequencies. If failure, load default values. - */ - of_property_read_u32(np, "qcom,low-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency); - of_property_read_u32(np, "qcom,mid-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency); - of_property_read_u32(np, "qcom,max-frequency", &nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency); - - if (npd->num_irq > NSS_MAX_IRQ_PER_CORE) { - pr_err("%s: exceeds maximum interrupt numbers per core\n", np->name); - goto out; - } - - nss_ctx = &nss_top->nss[npd->id]; - nss_ctx->id = npd->id; - - if (of_address_to_resource(np, 0, &res_nphys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - if (of_address_to_resource(np, 1, &res_vphys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for vphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - if (of_address_to_resource(np, 2, &res_qgic_phys) != 0) { - nss_info_always("%px: nss%d: of_address_to_resource() fail for qgic_phys\n", nss_ctx, nss_ctx->id); - goto out; - } - - /* - * Save physical addresses - */ - npd->nphys = res_nphys.start; - npd->vphys = res_vphys.start; - npd->qgic_phys = res_qgic_phys.start; - - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); - if (!npd->nmap) { - nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - nss_assert(npd->vphys); - npd->vmap = ioremap_cache(npd->vphys, resource_size(&res_vphys)); - if (!npd->vmap) { - nss_info_always("%px: nss%d: ioremap() fail for vphys\n", nss_ctx, nss_ctx->id); - goto out; - } - - npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys)); - if (!npd->qgic_map) { - nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id); - goto out; - } - - /* - * Clear TCM memory used by this core - */ - for (i = 0; i < resource_size(&res_vphys) ; i += 4) { - nss_write_32(npd->vmap, i, 0); - NSS_CORE_DMA_CACHE_MAINT((npd->vmap + i), 4, DMA_TO_DEVICE); - } - NSS_CORE_DSB(); - - /* - * Get IRQ numbers - */ - for (i = 0 ; i < npd->num_irq; i++) { - npd->irq[i] = irq_of_parse_and_map(np, i); - if (!npd->irq[i]) { - nss_info_always("%px: nss%d: irq_of_parse_and_map() fail for irq %d\n", nss_ctx, nss_ctx->id, i); - goto out; - } - } - - nss_hal_dt_parse_features(np, npd); - - of_node_put(np); - return npd; - -out: - if (npd->nmap) { - iounmap(npd->nmap); - } - - if (npd->vmap) { - iounmap(npd->vmap); - } - - devm_kfree(&pdev->dev, npd); - of_node_put(np); - return NULL; -} - -/* - * __nss_hal_core_reset() - */ -static int __nss_hal_core_reset(struct platform_device *nss_dev, void __iomem *map, uint32_t addr, uint32_t clk_src) -{ - uint32_t value; - - /* - * De-assert reset for first set - */ - value = nss_read_32(nss_misc_reset, 0x0); - value &= ~(NSS_CORE_GCC_RESET_1 << (nss_dev->id << 3)); - nss_write_32(nss_misc_reset, 0x0, value); - - /* - * Minimum 10 - 20 cycles delay is required after - * de-asserting UBI reset clamp - */ - usleep_range(10, 20); - - /* - * De-assert reset for second set - */ - value &= ~(NSS_CORE_GCC_RESET_2 << (nss_dev->id << 3)); - nss_write_32(nss_misc_reset, 0x0, value); - - /* - * Apply ubi32 core reset - */ - nss_write_32(map, NSS_REGS_RESET_CTRL_OFFSET, 1); - - /* - * Program address configuration - */ - nss_write_32(map, NSS_REGS_CORE_AMC_OFFSET, 1); - nss_write_32(map, NSS_REGS_CORE_BAR_OFFSET, 0x3c000000); - nss_write_32(map, NSS_REGS_CORE_BOOT_ADDR_OFFSET, addr); - - /* - * C2C interrupts are level sensitive - * Copy engine interrupts are level sensitive - */ - nss_write_32(map, NSS_REGS_CORE_INT_STAT2_TYPE_OFFSET, 0xFFFF); - nss_write_32(map, NSS_REGS_CORE_INT_STAT3_TYPE_OFFSET, 0xFF); - - /* - * Enable Instruction Fetch range checking between 0x4000 0000 to 0xBFFF FFFF. - */ - nss_write_32(map, NSS_REGS_CORE_IFETCH_RANGE_OFFSET, 0xBF004001); - - /* - * De-assert ubi32 core reset - */ - nss_write_32(map, NSS_REGS_RESET_CTRL_OFFSET, 0); - - return 0; -} - -/* - * __nss_hal_debug_enable() - * Enable NSS debug - */ -static void __nss_hal_debug_enable(void) -{ - -} - -/* - * nss_hal_clock_set_and_enable() - */ -static int nss_hal_clock_set_and_enable(struct device *dev, const char *id, unsigned long rate) -{ - struct clk *nss_clk = NULL; - int err; - - nss_clk = devm_clk_get(dev, id); - if (IS_ERR(nss_clk)) { - pr_err("%px: cannot get clock: %s\n", dev, id); - return -EFAULT; - } - - if (rate) { - err = clk_set_rate(nss_clk, rate); - if (err) { - pr_err("%px: cannot set %s freq\n", dev, id); - return -EFAULT; - } - } - - err = clk_prepare_enable(nss_clk); - if (err) { - pr_err("%px: cannot enable clock: %s\n", dev, id); - return -EFAULT; - } - - return 0; -} - -/* - * __nss_hal_common_reset - * Do reset/clock configuration common to all cores - */ -static int __nss_hal_common_reset(struct platform_device *nss_dev) -{ - struct device_node *cmn = NULL; - struct resource res_nss_misc_reset; - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NOC_CLK, 461500000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_PTP_REF_CLK, 150000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CSR_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CFG_CLK, 100000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_IMEM_CLK, 400000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_QOSGEN_REF_CLK, 19200000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_MEM_NOC_NSS_AXI_CLK, 461500000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_SNOC_CLK, 266600000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_TIMEOUT_REF_CLK, 4800000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CE_AXI_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CE_APB_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_CE_AXI_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_CE_APB_CLK, 200000000)) { - return -EFAULT; - } - - /* - * Get reference to NSS common device node - */ - cmn = of_find_node_by_name(NULL, "nss-common"); - if (!cmn) { - pr_err("%px: Unable to find nss-common node\n", nss_dev); - return -EFAULT; - } - - if (of_address_to_resource(cmn, 0, &res_nss_misc_reset) != 0) { - pr_err("%px: of_address_to_resource() return error for nss_misc_reset\n", nss_dev); - of_node_put(cmn); - return -EFAULT; - } - of_node_put(cmn); - - nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); - if (!nss_misc_reset) { - pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev); - return -EFAULT; - } - - nss_top_main.nss_hal_common_init_done = true; - nss_info("nss_hal_common_reset Done\n"); - return 0; -} - -/* - * __nss_hal_clock_configure() - */ -static int __nss_hal_clock_configure(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd) -{ - uint32_t i; - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NSSNOC_AHB_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_AHB_CLK, 200000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_AXI_CLK, 461500000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_MPT_CLK, 25000000)) { - return -EFAULT; - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NC_AXI_CLK, 461500000)) { - return -EFAULT; - } - - /* - * For IPQ807x, any rate above 1497 is Turbo Voltage - * Temporary set the voltage to turbo till we start scaling frequenices. - * This is to ensure probing is safe and autoscaling will correct the voltage. - */ - if (!nss_ctx->id) { - npu_reg = devm_regulator_get(&nss_dev->dev, "npu"); - if (IS_ERR(npu_reg)) { - return PTR_ERR(npu_reg); - } - if (regulator_enable(npu_reg)) { - return -EFAULT; - } - regulator_set_voltage(npu_reg, TURBO_VOLTAGE, TURBO_VOLTAGE); - } - - /* - * No entries, then just load default - */ - if ((nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency == 0) || - (nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency == 0) || - (nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency == 0)) { - nss_runtime_samples.freq_scale[NSS_FREQ_LOW_SCALE].frequency = NSS_FREQ_187; - nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency = NSS_FREQ_748; - nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency = NSS_FREQ_1497; - nss_info_always("Running default frequencies\n"); - } - - /* - * Test frequency from dtsi, if fail, try to set default frequency. - */ - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[NSS_FREQ_HIGH_SCALE].frequency)) { - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, NSS_FREQ_1497)) { - return -EFAULT; - } - } - - /* - * Setup ranges, test frequency, and display. - */ - for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) { - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_187) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_187_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_187_MAX; - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_748) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_748_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_748_MAX; - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1497) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_1497_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_1497_MAX; - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1689) { - nss_runtime_samples.freq_scale[i].minimum = NSS_FREQ_1689_MIN; - nss_runtime_samples.freq_scale[i].maximum = NSS_FREQ_1689_MAX; - } else { - nss_info_always("Frequency not found %d\n", nss_runtime_samples.freq_scale[i].frequency); - return -EFAULT; - } - - /* - * Test the frequency, if fail, then default to safe frequency and abort - */ - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[i].frequency)) { - return -EFAULT; - } - } - - nss_info_always("Supported Frequencies - "); - for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) { - if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_187) { - nss_info_always("187.2 MHz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_748) { - nss_info_always("748.8 MHz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1497) { - nss_info_always("1.4976 GHz "); - } else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1689) { - nss_info_always("1.6896 GHz "); - } else { - nss_info_always("Error\nNo Table/Invalid Frequency Found\n"); - return -EFAULT; - } - } - nss_info_always("\n"); - - /* - * Set values only once for core0. Grab the proper clock. - */ - if (nss_ctx->id) { - nss_core1_clk = clk_get(&nss_dev->dev, NSS_CORE_CLK); - } else { - nss_core0_clk = clk_get(&nss_dev->dev, NSS_CORE_CLK); - } - - if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_CORE_CLK, nss_runtime_samples.freq_scale[NSS_FREQ_MID_SCALE].frequency)) { - return -EFAULT; - } - - return 0; -} - -/* - * __nss_hal_read_interrupt_cause() - */ -static void __nss_hal_read_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t *cause) -{ -} - -/* - * __nss_hal_clear_interrupt_cause() - */ -static void __nss_hal_clear_interrupt_cause(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_disable_interrupt() - */ -static void __nss_hal_disable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_enable_interrupt() - */ -static void __nss_hal_enable_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t shift_factor, uint32_t cause) -{ -} - -/* - * __nss_hal_send_interrupt() - */ -static void __nss_hal_send_interrupt(struct nss_ctx_instance *nss_ctx, uint32_t type) -{ - /* - * Check if core and type is Valid - */ - nss_assert(nss_ctx->id < nss_top_main.num_nss); - nss_assert(type < NSS_H2N_INTR_TYPE_MAX); - - nss_write_32(nss_ctx->qgic_map, NSS_QGIC_IPC_REG_OFFSET, intr_cause[nss_ctx->id][type]); -} - -/* - * __nss_hal_request_irq() - */ -static int __nss_hal_request_irq(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, int irq_num) -{ - struct int_ctx_instance *int_ctx = &nss_ctx->int_ctx[irq_num]; - int err = -1, irq = npd->irq[irq_num]; - - irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY); - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_sos", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_queue", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_TX_UNBLOCKED; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss-tx-unblock", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_0; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue0", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1) { - int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_1; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue1", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2) { - int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_2; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue2", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3) { - int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_3; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue3", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE) { - int_ctx->cause = NSS_N2H_INTR_COREDUMP_COMPLETE; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_coredump_complete", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS) { - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT); - int_ctx->cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS; - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_paged_empty_buf_sos", int_ctx); - } - - if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA) { - int_ctx->cause = NSS_N2H_INTR_PROFILE_DMA; - netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT); - err = request_irq(irq, nss_hal_handle_irq, 0, "nss_profile_dma", int_ctx); - } - - if (err) { - return err; - } - - int_ctx->irq = irq; - return 0; -} - -/* - * __nss_hal_init_imem - */ -void __nss_hal_init_imem(struct nss_ctx_instance *nss_ctx) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - - mem_ctx->imem_head = NSS_IMEM_START + NSS_IMEM_SIZE * nss_ctx->id; - mem_ctx->imem_end = mem_ctx->imem_head + NSS_IMEM_SIZE; - mem_ctx->imem_tail = mem_ctx->imem_head; - - nss_info("%px: IMEM init: head: 0x%x end: 0x%x tail: 0x%x\n", nss_ctx, - mem_ctx->imem_head, mem_ctx->imem_end, mem_ctx->imem_tail); -} - -/* - * __nss_hal_init_utcm_shared - */ -bool __nss_hal_init_utcm_shared(struct nss_ctx_instance *nss_ctx, uint32_t *meminfo_start) -{ - /* - * Nothing to be done as there are no TCM in ipq807x - */ - return true; -} - -/* - * nss_hal_ipq807x_ops - */ -struct nss_hal_ops nss_hal_ipq807x_ops = { - .common_reset = __nss_hal_common_reset, - .core_reset = __nss_hal_core_reset, - .clock_configure = __nss_hal_clock_configure, - .firmware_load = nss_hal_firmware_load, - .debug_enable = __nss_hal_debug_enable, - .of_get_pdata = __nss_hal_of_get_pdata, - .request_irq = __nss_hal_request_irq, - .send_interrupt = __nss_hal_send_interrupt, - .enable_interrupt = __nss_hal_enable_interrupt, - .disable_interrupt = __nss_hal_disable_interrupt, - .clear_interrupt_cause = __nss_hal_clear_interrupt_cause, - .read_interrupt_cause = __nss_hal_read_interrupt_cause, - .init_imem = __nss_hal_init_imem, - .init_utcm_shared = __nss_hal_init_utcm_shared, -}; diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hal/nss_hal.c b/feeds/ipq807x/qca-nss-drv/src/nss_hal/nss_hal.c deleted file mode 100644 index 30085e010..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hal/nss_hal.c +++ /dev/null @@ -1,834 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_hal.c - * NSS HAL general APIs. - */ - -#include -#include -#include -#include -#include - -#include "nss_hal.h" -#include "nss_arch.h" -#include "nss_core.h" -#include "nss_tx_rx_common.h" -#include "nss_data_plane.h" -#if (NSS_PM_SUPPORT == 1) -#include "nss_pm.h" -#endif -#if (NSS_FABRIC_SCALING_SUPPORT == 1) -#include -#endif - -/* - * Macros - */ -#define MIN_IMG_SIZE (64*1024) -#define NSS_AP0_IMAGE "qca-nss0.bin" -#define NSS_AP1_IMAGE "qca-nss1.bin" - -/* - * File local/Static variables/functions - */ -static const struct net_device_ops nss_netdev_ops; -static const struct ethtool_ops nss_ethtool_ops; - -int nss_hal_firmware_load(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd) -{ - const struct firmware *nss_fw; - void __iomem *load_mem; - int rc; - - if (nss_ctx->id == 0) { - rc = request_firmware(&nss_fw, NSS_AP0_IMAGE, &(nss_dev->dev)); - } else if (nss_ctx->id == 1) { - rc = request_firmware(&nss_fw, NSS_AP1_IMAGE, &(nss_dev->dev)); - } else { - nss_warning("%px: Invalid nss dev: %d\n", nss_ctx, nss_ctx->id); - return -EINVAL; - } - - /* - * Check if the file read is successful - */ - if (rc) { - nss_info_always("%px: request_firmware failed with err code: %d", nss_ctx, rc); - return rc; - } - - if (nss_fw->size < MIN_IMG_SIZE) { - nss_info_always("%px: nss firmware is truncated, size:%d", nss_ctx, (int)nss_fw->size); - return rc; - } - - load_mem = ioremap_nocache(npd->load_addr, nss_fw->size); - if (!load_mem) { - nss_info_always("%px: ioremap_nocache failed: %x", nss_ctx, npd->load_addr); - release_firmware(nss_fw); - return rc; - } - - nss_info_always("nss_driver - fw of size %d bytes copied to load addr: %x, nss_id : %d\n", (int)nss_fw->size, npd->load_addr, nss_dev->id); - memcpy_toio(load_mem, nss_fw->data, nss_fw->size); - release_firmware(nss_fw); - iounmap(load_mem); - return 0; -} - -/* - * nss_hal_dt_parse_features() - */ -void nss_hal_dt_parse_features(struct device_node *np, struct nss_platform_data *npd) -{ - /* - * Read the features in - */ - npd->bridge_enabled = of_property_read_bool(np, "qcom,bridge-enabled"); - npd->capwap_enabled = of_property_read_bool(np, "qcom,capwap-enabled"); - npd->clmap_enabled = of_property_read_bool(np, "qcom,clmap-enabled"); - npd->crypto_enabled = of_property_read_bool(np, "qcom,crypto-enabled"); - npd->dtls_enabled = of_property_read_bool(np, "qcom,dtls-enabled"); - npd->gre_enabled = of_property_read_bool(np, "qcom,gre-enabled"); - npd->gre_redir_enabled = of_property_read_bool(np, "qcom,gre-redir-enabled"); - npd->gre_tunnel_enabled = of_property_read_bool(np, "qcom,gre_tunnel_enabled"); - npd->gre_redir_mark_enabled = of_property_read_bool(np, "qcom,gre-redir-mark-enabled"); - npd->igs_enabled = of_property_read_bool(np, "qcom,igs-enabled"); - npd->ipsec_enabled = of_property_read_bool(np, "qcom,ipsec-enabled"); - npd->ipv4_enabled = of_property_read_bool(np, "qcom,ipv4-enabled"); - npd->ipv4_reasm_enabled = of_property_read_bool(np, "qcom,ipv4-reasm-enabled"); - npd->ipv6_enabled = of_property_read_bool(np, "qcom,ipv6-enabled"); - npd->ipv6_reasm_enabled = of_property_read_bool(np, "qcom,ipv6-reasm-enabled"); - npd->l2tpv2_enabled = of_property_read_bool(np, "qcom,l2tpv2-enabled"); - npd->map_t_enabled = of_property_read_bool(np, "qcom,map-t-enabled"); - npd->oam_enabled = of_property_read_bool(np, "qcom,oam-enabled"); - npd->ppe_enabled = of_property_read_bool(np, "qcom,ppe-enabled"); - npd->pppoe_enabled = of_property_read_bool(np, "qcom,pppoe-enabled"); - npd->pptp_enabled = of_property_read_bool(np, "qcom,pptp-enabled"); - npd->portid_enabled = of_property_read_bool(np, "qcom,portid-enabled"); - npd->pvxlan_enabled = of_property_read_bool(np, "qcom,pvxlan-enabled"); - npd->qvpn_enabled = of_property_read_bool(np, "qcom,qvpn-enabled"); - npd->rmnet_rx_enabled = of_property_read_bool(np, "qcom,rmnet_rx-enabled"); - npd->shaping_enabled = of_property_read_bool(np, "qcom,shaping-enabled"); - npd->tls_enabled = of_property_read_bool(np, "qcom,tls-enabled"); - npd->tstamp_enabled = of_property_read_bool(np, "qcom,tstamp-enabled"); - npd->turbo_frequency = of_property_read_bool(np, "qcom,turbo-frequency"); - npd->tun6rd_enabled = of_property_read_bool(np, "qcom,tun6rd-enabled"); - npd->tunipip6_enabled = of_property_read_bool(np, "qcom,tunipip6-enabled"); - npd->vlan_enabled = of_property_read_bool(np, "qcom,vlan-enabled"); - npd->vxlan_enabled = of_property_read_bool(np, "qcom,vxlan-enabled"); - npd->wlanredirect_enabled = of_property_read_bool(np, "qcom,wlanredirect-enabled"); - npd->wifioffload_enabled = of_property_read_bool(np, "qcom,wlan-dataplane-offload-enabled"); - npd->match_enabled = of_property_read_bool(np, "qcom,match-enabled"); - npd->mirror_enabled = of_property_read_bool(np, "qcom,mirror-enabled"); - npd->udp_st_enabled = of_property_read_bool(np, "qcom,udp-st-enabled"); -} -/* - * nss_hal_clean_up_irq() - */ -static void nss_hal_clean_up_irq(struct int_ctx_instance *int_ctx) -{ - if (!int_ctx->irq) { - return; - } - - /* - * Wait here till the poll is complete. - */ - napi_disable(&int_ctx->napi); - - /* - * Interrupt can be raised here before free_irq() but as napi is - * already disabled, it will be never sheduled from hard_irq - * context. - */ - irq_clear_status_flags(int_ctx->irq, IRQ_DISABLE_UNLAZY); - free_irq(int_ctx->irq, int_ctx); - int_ctx->irq = 0; - - netif_napi_del(&int_ctx->napi); -} - -/* - * nss_hal_register_irq() - */ -static int nss_hal_register_irq(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, - struct net_device *netdev, int irq_num) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct int_ctx_instance *int_ctx = &nss_ctx->int_ctx[irq_num]; - int err = 0; - - /* - * request for IRQs - */ - int_ctx->nss_ctx = nss_ctx; - err = nss_top->hal_ops->request_irq(nss_ctx, npd, irq_num); - if (err) { - nss_warning("%px: IRQ request for queue %d failed", nss_ctx, irq_num); - return err; - } - - /* - * Register NAPI for NSS core interrupt - */ - napi_enable(&int_ctx->napi); - return 0; -} - -/* - * nss_hal_probe() - * HLOS device probe callback - */ -int nss_hal_probe(struct platform_device *nss_dev) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = NULL; - struct nss_platform_data *npd = NULL; - int i, err = 0; -#ifdef NSS_DRV_TSTAMP_ENABLE - struct net_device *tstamp_ndev = NULL; -#endif - - if (nss_top_main.nss_hal_common_init_done == false) { - err = nss_top->hal_ops->common_reset(nss_dev); - if (err) { - nss_info_always("NSS HAL common init failed\n"); - return -EFAULT; - } - } - -#if (NSS_DT_SUPPORT == 1) - if (!nss_dev->dev.of_node) { - pr_err("nss-driver: Device tree not available\n"); - return -ENODEV; - } - - npd = nss_top->hal_ops->of_get_pdata(nss_dev); - if (!npd) { - return -EFAULT; - } - - nss_ctx = &nss_top->nss[npd->id]; - nss_ctx->id = npd->id; - nss_dev->id = nss_ctx->id; -#else - npd = (struct nss_platform_data *) nss_dev->dev.platform_data; - nss_ctx = &nss_top->nss[nss_dev->id]; - nss_ctx->id = nss_dev->id; -#endif - nss_ctx->num_irq = npd->num_irq; - nss_ctx->nss_top = nss_top; - - /* - * dev is required for dma map/unmap - */ - nss_ctx->dev = &nss_dev->dev; - - nss_info("%px: NSS_DEV_ID %s\n", nss_ctx, dev_name(&nss_dev->dev)); - - /* - * Do firmware load from nss-drv if required - */ - err = nss_top->hal_ops->firmware_load(nss_ctx, nss_dev, npd); - if (err) { - nss_info_always("%px: firmware load from driver failed\n", nss_ctx); - goto err_init; - } - - err = nss_top->hal_ops->clock_configure(nss_ctx, nss_dev, npd); - if (err) { - nss_info_always("%px: clock configure failed\n", nss_ctx); - goto err_init; - } - - /* - * Get load address of NSS firmware - */ - nss_info("%px: Setting NSS%d Firmware load address to %x\n", nss_ctx, nss_ctx->id, npd->load_addr); - nss_top->nss[nss_ctx->id].load = npd->load_addr; - - /* - * Get virtual and physical memory addresses for nss logical/hardware address maps - */ - - /* - * Virtual address of CSM space - */ - nss_ctx->nmap = npd->nmap; - - /* - * Physical address of CSM space - */ - nss_ctx->nphys = npd->nphys; - nss_assert(nss_ctx->nphys); - - /* - * Virtual address of logical registers space - */ - nss_ctx->vmap = npd->vmap; - - /* - * Virtual address of QGIC interrupt space - */ - nss_ctx->qgic_map = npd->qgic_map; - - /* - * Physical address of logical registers space - */ - nss_ctx->vphys = npd->vphys; - nss_info("%d:ctx=%px, vphys=%x, vmap=%px, nphys=%x, nmap=%px", nss_ctx->id, - nss_ctx, nss_ctx->vphys, nss_ctx->vmap, nss_ctx->nphys, nss_ctx->nmap); - - if (!nss_meminfo_init(nss_ctx)) { - nss_info_always("%px: meminfo init failed\n", nss_ctx); - err = -EFAULT; - goto err_init; - } - - /* - * Initialize the dummy netdevice. - */ - init_dummy_netdev(&nss_ctx->napi_ndev); - - for (i = 0; i < npd->num_irq; i++) { - err = nss_hal_register_irq(nss_ctx, npd, &nss_ctx->napi_ndev, i); - if (err) { - goto err_register_irq; - } - } - -#ifdef NSS_DRV_TSTAMP_ENABLE - /* - * Allocate tstamp net_device and register the net_device - */ - if (npd->tstamp_enabled == NSS_FEATURE_ENABLED) { - tstamp_ndev = nss_tstamp_register_netdev(); - if (!tstamp_ndev) { - nss_warning("%px: Unable to register the TSTAMP net_device", nss_ctx); - npd->tstamp_enabled = NSS_FEATURE_NOT_ENABLED; - } - nss_top->tstamp_handler_id = nss_dev->id; - nss_tstamp_register_handler(tstamp_ndev); - } -#endif - /* - * Initialize the handlers for all interfaces associated with core - */ - nss_core_init_handlers(nss_ctx); - - /* - * Features that will always be enabled on both cores - */ - nss_dynamic_interface_register_handler(nss_ctx); - nss_n2h_register_handler(nss_ctx); - nss_project_register_handler(nss_ctx); -#ifdef NSS_DRV_QRFS_ENABLE - nss_qrfs_register_handler(nss_ctx); -#endif - -#ifdef NSS_DRV_C2C_ENABLE - nss_c2c_tx_register_handler(nss_ctx); - nss_c2c_rx_register_handler(nss_ctx); -#endif - nss_unaligned_register_handler(nss_ctx); - - /* - * Check functionalities are supported by this NSS core - */ -#ifdef NSS_DRV_SHAPER_ENABLE - if (npd->shaping_enabled == NSS_FEATURE_ENABLED) { - nss_top->shaping_handler_id = nss_dev->id; - nss_info("%d: NSS shaping is enabled", nss_dev->id); - } -#endif - - if (npd->ipv4_enabled == NSS_FEATURE_ENABLED) { - nss_top->ipv4_handler_id = nss_dev->id; - nss_ipv4_register_handler(); - -#ifdef NSS_DRV_EDMA_ENABLE - nss_top->edma_handler_id = nss_dev->id; - nss_edma_register_handler(); -#endif - nss_eth_rx_register_handler(nss_ctx); -#ifdef NSS_DRV_LAG_ENABLE - nss_lag_register_handler(); -#endif -#ifdef NSS_DRV_TRUSTSEC_ENABLE - nss_top->trustsec_tx_handler_id = nss_dev->id; - nss_trustsec_tx_register_handler(); -#endif - - nss_top->virt_if_handler_id = nss_dev->id; - - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N] = nss_dev->id; - } - -#ifdef NSS_DRV_CAPWAP_ENABLE - if (npd->capwap_enabled == NSS_FEATURE_ENABLED) { - nss_top->capwap_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER] = nss_dev->id; - } -#endif - -#ifdef NSS_DRV_IPV4_REASM_ENABLE - if (npd->ipv4_reasm_enabled == NSS_FEATURE_ENABLED) { - nss_top->ipv4_reasm_handler_id = nss_dev->id; - nss_ipv4_reasm_register_handler(); - } -#endif - -#ifdef NSS_DRV_IPV6_ENABLE - if (npd->ipv6_enabled == NSS_FEATURE_ENABLED) { - nss_top->ipv6_handler_id = nss_dev->id; - nss_ipv6_register_handler(); - } - -#ifdef NSS_DRV_IPV6_REASM_ENABLE - if (npd->ipv6_reasm_enabled == NSS_FEATURE_ENABLED) { - nss_top->ipv6_reasm_handler_id = nss_dev->id; - nss_ipv6_reasm_register_handler(); - } -#endif -#endif - -#ifdef NSS_DRV_CRYPTO_ENABLE - /* - * TODO: when Crypto is moved to Core-1 it needs to - * flush based on nss_top->crypto_enabled - */ - if (npd->crypto_enabled == NSS_FEATURE_ENABLED) { - nss_top->crypto_handler_id = nss_dev->id; -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) || defined(NSS_HAL_IPQ50XX_SUPPORT) - nss_crypto_cmn_register_handler(); -#else - nss_top->crypto_enabled = 1; - nss_crypto_register_handler(); -#endif - -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) - nss_top->dma_handler_id = nss_dev->id; - nss_dma_register_handler(); -#endif - } -#endif - -#ifdef NSS_DRV_IPSEC_ENABLE - if (npd->ipsec_enabled == NSS_FEATURE_ENABLED) { - nss_top->ipsec_handler_id = nss_dev->id; -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) || defined(NSS_HAL_IPQ50XX_SUPPORT) - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_OUTER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_OUTER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_REDIRECT] = nss_dev->id; - nss_ipsec_cmn_register_handler(); -#else - nss_ipsec_register_handler(); -#endif - } -#endif - - if (npd->wlanredirect_enabled == NSS_FEATURE_ENABLED) { - nss_top->wlan_handler_id = nss_dev->id; - } - -#ifdef NSS_DRV_TUN6RD_ENABLE - if (npd->tun6rd_enabled == NSS_FEATURE_ENABLED) { - nss_top->tun6rd_handler_id = nss_dev->id; - } -#endif - -#ifdef NSS_DRV_PPTP_ENABLE - if (npd->pptp_enabled == NSS_FEATURE_ENABLED) { - nss_top->pptp_handler_id = nss_dev->id; - nss_pptp_register_handler(); - } -#endif - - if (npd->pppoe_enabled == NSS_FEATURE_ENABLED) { - nss_top->pppoe_handler_id = nss_dev->id; - nss_pppoe_register_handler(); - } - -#ifdef NSS_DRV_PPE_ENABLE - if (npd->ppe_enabled == NSS_FEATURE_ENABLED) { - nss_top->ppe_handler_id = nss_dev->id; - nss_ppe_register_handler(); - nss_ppe_vp_register_handler(); - } -#endif - -#ifdef NSS_DRV_L2TP_ENABLE - if (npd->l2tpv2_enabled == NSS_FEATURE_ENABLED) { - nss_top->l2tpv2_handler_id = nss_dev->id; - nss_l2tpv2_register_handler(); - } -#endif - -#ifdef NSS_DRV_DTLS_ENABLE - if (npd->dtls_enabled == NSS_FEATURE_ENABLED) { - nss_top->dtls_handler_id = nss_dev->id; -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) || defined(NSS_HAL_IPQ50XX_SUPPORT) - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_DTLS_CMN_OUTER] = nss_dev->id; - nss_dtls_cmn_register_handler(); -#else - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_DTLS] = nss_dev->id; - nss_dtls_register_handler(); -#endif - } -#endif - -#ifdef NSS_DRV_MAPT_ENABLE - if (npd->map_t_enabled == NSS_FEATURE_ENABLED) { - nss_top->map_t_handler_id = nss_dev->id; - nss_map_t_register_handler(); - } -#endif - -#ifdef NSS_DRV_TUNIPIP6_ENABLE - if (npd->tunipip6_enabled == NSS_FEATURE_ENABLED) { - nss_top->tunipip6_handler_id = nss_dev->id; - nss_tunipip6_register_handler(); - } -#endif - -#ifdef NSS_DRV_GRE_ENABLE - if (npd->gre_enabled == NSS_FEATURE_ENABLED) { - nss_top->gre_handler_id = nss_dev->id; - nss_gre_register_handler(); - } -#endif - -#ifdef NSS_DRV_GRE_REDIR_ENABLE - if (npd->gre_redir_enabled == NSS_FEATURE_ENABLED) { - nss_top->gre_redir_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_HOST_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_WIFI_OFFL_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_SJACK_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_REDIR_OUTER] = nss_dev->id; - nss_gre_redir_register_handler(); - nss_gre_redir_lag_us_register_handler(); - nss_gre_redir_lag_ds_register_handler(); -#ifdef NSS_DRV_SJACK_ENABLE - nss_top->sjack_handler_id = nss_dev->id; - nss_sjack_register_handler(); -#endif - - } - - if (npd->gre_redir_mark_enabled == NSS_FEATURE_ENABLED) { - nss_top->gre_redir_mark_handler_id = nss_dev->id; - nss_gre_redir_mark_register_handler(); - } -#endif - -#ifdef NSS_DRV_GRE_TUNNEL_ENABLE - if (npd->gre_tunnel_enabled == NSS_FEATURE_ENABLED) { - nss_top->gre_tunnel_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_OUTER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INLINE_OUTER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER_EXCEPTION] = nss_dev->id; - } -#endif - -#ifdef NSS_DRV_PORTID_ENABLE - if (npd->portid_enabled == NSS_FEATURE_ENABLED) { - nss_top->portid_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_PORTID] = nss_dev->id; - nss_portid_register_handler(); - } -#endif - - if (npd->wifioffload_enabled == NSS_FEATURE_ENABLED) { - nss_top->wifi_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VAP] = nss_dev->id; - nss_wifi_register_handler(); - nss_wifili_register_handler(); -#ifdef NSS_DRV_WIFI_EXT_VDEV_ENABLE - nss_wifi_ext_vdev_register_handler(); -#endif - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_INTERNAL] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_VLAN] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER] = nss_dev->id; - - /* - * Register wifi mac database when offload enabled - */ - nss_top->wmdb_handler_id = nss_dev->id; - nss_wifi_mac_db_register_handler(); - - /* - * Initialize wifili thread scheme database - */ - nss_wifili_thread_scheme_db_init(nss_dev->id); - } - -#ifdef NSS_DRV_OAM_ENABLE - if (npd->oam_enabled == NSS_FEATURE_ENABLED) { - nss_top->oam_handler_id = nss_dev->id; - nss_oam_register_handler(); - } -#endif - -#ifdef NSS_DRV_BRIDGE_ENABLE - if (npd->bridge_enabled == NSS_FEATURE_ENABLED) { - nss_top->bridge_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE] = nss_dev->id; - nss_bridge_init(); - } -#endif - - if (npd->vlan_enabled == NSS_FEATURE_ENABLED) { - nss_top->vlan_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VLAN] = nss_dev->id; - nss_vlan_register_handler(); - } - -#ifdef NSS_DRV_QVPN_ENABLE -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) - if (npd->qvpn_enabled == NSS_FEATURE_ENABLED) { - nss_top->qvpn_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER] = nss_dev->id; - nss_qvpn_register_handler(); - } -#endif -#endif - -#ifdef NSS_DRV_PVXLAN_ENABLE - if (npd->pvxlan_enabled == NSS_FEATURE_ENABLED) { - nss_top->pvxlan_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_PVXLAN_HOST_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_PVXLAN_OUTER] = nss_dev->id; - } -#endif - -#ifdef NSS_DRV_RMNET_ENABLE - if (npd->rmnet_rx_enabled == NSS_FEATURE_ENABLED) { - nss_top->rmnet_rx_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N] = nss_dev->id; - } -#endif - -#ifdef NSS_DRV_IGS_ENABLE - if (npd->igs_enabled == NSS_FEATURE_ENABLED) { - nss_top->igs_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_IGS] = nss_dev->id; - nss_info("%d: NSS IGS is enabled", nss_dev->id); - } -#endif - -#ifdef NSS_DRV_CLMAP_ENABLE - if (npd->clmap_enabled == NSS_FEATURE_ENABLED) { - nss_top->clmap_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_US] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_DS] = nss_dev->id; - } -#endif - -#ifdef NSS_DRV_VXLAN_ENABLE - if (npd->vxlan_enabled == NSS_FEATURE_ENABLED) { - nss_top->vxlan_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_OUTER] = nss_dev->id; - nss_vxlan_init(); - } -#endif - -#ifdef NSS_DRV_MATCH_ENABLE - if (npd->match_enabled == NSS_FEATURE_ENABLED) { - nss_top->match_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_MATCH] = nss_dev->id; - nss_match_init(); - } -#endif - -#ifdef NSS_DRV_TLS_ENABLE -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) - if (npd->tls_enabled == NSS_FEATURE_ENABLED) { - nss_top->tls_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER] = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER] = nss_dev->id; - nss_tls_register_handler(); - } -#endif -#endif - -#ifdef NSS_DRV_MIRROR_ENABLE - if (npd->mirror_enabled == NSS_FEATURE_ENABLED) { - nss_top->mirror_handler_id = nss_dev->id; - nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_MIRROR] = nss_dev->id; - nss_mirror_register_handler(); - nss_info("%d: NSS mirror is enabled", nss_dev->id); - } - -#endif - -#ifdef NSS_DRV_UDP_ST_ENABLE - if (npd->udp_st_enabled == NSS_FEATURE_ENABLED) { - nss_top->udp_st_handler_id = nss_dev->id; - nss_udp_st_register_handler(nss_ctx); - } -#endif - - if (nss_ctx->id == 0) { -#if (NSS_FREQ_SCALE_SUPPORT == 1) - nss_freq_register_handler(); - - /* - * Init CPU usage detail - * Note: As of now, ubi cpu usage is supported only for core0 - */ - nss_freq_init_cpu_usage(); -#endif - - nss_lso_rx_register_handler(nss_ctx); - } - - nss_top->frequency_handler_id = nss_dev->id; - - /* - * Initialize decongestion callbacks to NULL - */ - for (i = 0; i < NSS_MAX_CLIENTS; i++) { - nss_ctx->queue_decongestion_callback[i] = 0; - nss_ctx->queue_decongestion_ctx[i] = 0; - } - - spin_lock_init(&(nss_ctx->decongest_cb_lock)); - nss_ctx->magic = NSS_CTX_MAGIC; - - nss_info("%px: Reseting NSS core %d now", nss_ctx, nss_ctx->id); - - /* - * Enable clocks and bring NSS core out of reset - */ - err = nss_top->hal_ops->core_reset(nss_dev, nss_ctx->nmap, nss_ctx->load, nss_top->clk_src); - if (err) { - goto err_register_irq; - } - - /* - * Initialize max buffer size for NSS core - */ - nss_ctx->max_buf_size = NSS_NBUF_PAYLOAD_SIZE; - - /* - * Initialize S/G status pointers to NULL - */ - for (i = 0; i < NSS_N2H_DESC_RING_NUM; i++) { - nss_ctx->n2h_desc_ring[i].head = NULL; - nss_ctx->n2h_desc_ring[i].tail = NULL; - nss_ctx->n2h_desc_ring[i].jumbo_start = NULL; - } - - /* - * Enable interrupts for NSS core. - */ - for (i = 0; i < npd->num_irq; i++) { - nss_hal_enable_interrupt(nss_ctx, nss_ctx->int_ctx[i].shift_factor, NSS_HAL_SUPPORTED_INTERRUPTS); - } - - nss_info("%px: All resources initialized and nss core%d has been brought out of reset", nss_ctx, nss_dev->id); - goto out; - -err_register_irq: - for (i = 0; i < npd->num_irq; i++) { - nss_hal_clean_up_irq(&nss_ctx->int_ctx[i]); - } - -err_init: - if (nss_dev->dev.of_node) { - if (npd->nmap) { - iounmap(npd->nmap); - } - - if (npd->vmap) { - iounmap(npd->vmap); - } - } - -out: - if (nss_dev->dev.of_node) { - devm_kfree(&nss_dev->dev, npd); - } - return err; -} - -/* - * nss_hal_remove() - * HLOS device remove callback - */ -int nss_hal_remove(struct platform_device *nss_dev) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[nss_dev->id]; - int i; - - /* - * Clean up debugfs - */ - nss_stats_clean(); - - /* - * Clear up the resources associated with the interrupt - */ - for (i = 0; i < nss_ctx->num_irq; i++) { - nss_hal_disable_interrupt(nss_ctx, nss_ctx->int_ctx[i].shift_factor, - NSS_HAL_SUPPORTED_INTERRUPTS); - nss_hal_clean_up_irq(&nss_ctx->int_ctx[i]); - } - - /* - * nss-drv is exiting, unregister and restore host data plane - */ - nss_top->data_plane_ops->data_plane_unregister(); - -#if (NSS_FABRIC_SCALING_SUPPORT == 1) - fab_scaling_unregister(nss_core0_clk); -#endif - - if (nss_dev->dev.of_node) { - if (nss_ctx->nmap) { - iounmap(nss_ctx->nmap); - nss_ctx->nmap = 0; - } - - if (nss_ctx->vmap) { - iounmap(nss_ctx->vmap); - nss_ctx->vmap = 0; - } - } - - nss_info("%px: All resources freed for nss core%d", nss_ctx, nss_dev->id); - return 0; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_hlos_if.h b/feeds/ipq807x/qca-nss-drv/src/nss_hlos_if.h deleted file mode 100644 index fdcf21b8c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_hlos_if.h +++ /dev/null @@ -1,381 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_hlos_if.h - * NSS to HLOS interface definitions. - */ - -#ifndef __NSS_HLOS_IF_H -#define __NSS_HLOS_IF_H - -#define NSS_MIN_NUM_CONN 256 /* MIN Connection shared between IPv4 and IPv6 */ -#define NSS_FW_DEFAULT_NUM_CONN 1024 /* Firmware default number of connections for IPv4 and IPv6 */ -#define NSS_NUM_CONN_QUANTA_MASK (1024 - 1) /* Quanta of number of connections 1024 */ -#define NSS_CONN_CFG_TIMEOUT 6000 /* 6 sec timeout for connection cfg message */ - -/* - * The following definitions sets the maximum number of connections - * based on the type of memory profile that the system is operating with - */ -#if defined (NSS_MEM_PROFILE_LOW) -#define NSS_DEFAULT_NUM_CONN 512 /* Default number of connections for IPv4 and IPv6 each, for low memory profile */ -#if defined (NSS_DRV_IPV6_ENABLE) -#define NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6 1024 /* MAX Connection shared between IPv4 and IPv6 for low memory profile */ -#else -#define NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6 512 /* MAX Connection for IPv4 for low memory profile */ -#endif -#define NSS_LOW_MEM_EMPTY_POOL_BUF_SZ 4096 /* Default empty buffer pool size for low profile */ -#elif defined (NSS_MEM_PROFILE_MEDIUM) -#define NSS_DEFAULT_NUM_CONN 2048 /* Default number of connections for IPv4 and IPv6 each, for medium memory profile */ -#define NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6 4096 /* MAX Connection shared between IPv4 and IPv6 for medium memory profile */ -#else -#define NSS_DEFAULT_NUM_CONN 4096 /* Default number of connections for each IPv4 and IPv6 */ -#define NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6 8192 /* MAX Connection shared between IPv4 and IPv6 */ -#endif - -#if defined(NSS_SKB_FIXED_SIZE_2K) && !defined(__LP64__) -#define NSS_EMPTY_BUFFER_SIZE 1792 /* Default buffer size for reduced memory profiles. */ -#define NSS_FIXED_BUFFER_SIZE /* For low memory profiles, maximum buffer size/MTU is fixed */ -#else -#define NSS_EMPTY_BUFFER_SIZE 1984 /* Default buffer size for regular memory profiles. */ -#undef NSS_FIXED_BUFFER_SIZE -#endif - -enum { - NSS_SUCCESS = 0, - NSS_FAILURE = 1, -}; - -/* - * Request/Response types - */ -enum nss_if_metadata_types { - NSS_TX_METADATA_TYPE_INTERFACE_OPEN, - NSS_TX_METADATA_TYPE_INTERFACE_CLOSE, - NSS_TX_METADATA_TYPE_INTERFACE_LINK_STATE_NOTIFY, - NSS_TX_METADATA_TYPE_INTERFACE_MTU_CHANGE, - NSS_TX_METADATA_TYPE_INTERFACE_MAC_ADDR_SET, - NSS_TX_METADATA_TYPE_INTERFACE_MSS_SET, - NSS_RX_METADATA_TYPE_INTERFACE_STATS_SYNC, - NSS_METADATA_TYPE_INTERFACE_MAX, -}; - -/* - * General statistics messages - */ - -/* - * IPv4 reasm node stats - */ -struct nss_ipv4_reasm_stats_sync { - struct nss_cmn_node_stats node_stats; - /* Common node stats for ipv4_reasm */ - uint32_t ipv4_reasm_evictions; - uint32_t ipv4_reasm_alloc_fails; - uint32_t ipv4_reasm_timeouts; -}; - -/* - * IPv4 reasm message types - */ -enum nss_ipv4_reasm_message_types { - NSS_IPV4_REASM_STATS_SYNC_MSG, -}; - -/* - * IPv4 reassembly message structure - */ -struct nss_ipv4_reasm_msg { - struct nss_cmn_msg cm; - union { - struct nss_ipv4_reasm_stats_sync stats_sync; - } msg; -}; - -/* - * IPv6 reasm node stats - */ -struct nss_ipv6_reasm_stats_sync { - struct nss_cmn_node_stats node_stats; - /* Common node stats for ipv6_reasm */ - uint32_t ipv6_reasm_alloc_fails; - uint32_t ipv6_reasm_timeouts; - uint32_t ipv6_reasm_discards; -}; - -/* - * IPv6 reasm message types - */ -enum nss_ipv6_reasm_message_types { - NSS_IPV6_REASM_STATS_SYNC_MSG, -}; - -/* - * IPv6 reassembly message structure - */ -struct nss_ipv6_reasm_msg { - struct nss_cmn_msg cm; - union { - struct nss_ipv6_reasm_stats_sync stats_sync; - } msg; -}; - -/* - * Generic interface messages - */ -enum nss_generic_metadata_types { - NSS_TX_METADATA_TYPE_GENERIC_IF_PARAMS, - NSS_METADATA_TYPE_GENERIC_IF_MAX -}; - -/* - * Interface params command - */ -struct nss_generic_if_params { - uint8_t buf[1]; /* Buffer */ -}; - -/* - * Message structure to send/receive ipsec messages - */ -struct nss_generic_msg { - struct nss_cmn_msg cm; /* Message Header */ - union { - struct nss_generic_if_params rule; /* Message: generic rule */ - } msg; -}; - -/* - * NSS frequency scaling messages - */ -enum nss_freq_stats_metadata_types { - COREFREQ_METADATA_TYPE_ERROR, - COREFREQ_METADATA_TYPE_RX_FREQ_CHANGE, - COREFREQ_METADATA_TYPE_TX_FREQ_ACK, - COREFREQ_METADATA_TYPE_TX_CORE_STATS, - COREFREQ_METADATA_TYPE_MAX, -}; - - /* - * Types of TX metadata -- legacy code needs to be removed - */ -enum nss_tx_metadata_types { - NSS_TX_METADATA_TYPE_LEGACY_0, - NSS_TX_METADATA_TYPE_NSS_FREQ_CHANGE, - NSS_TX_METADATA_TYPE_SHAPER_CONFIGURE, -}; - -/* - * The NSS freq start or stop strcture - */ -struct nss_freq_msg { - /* Request */ - uint32_t frequency; - uint32_t start_or_end; - uint32_t stats_enable; - - /* Response */ - uint32_t freq_current; - int32_t ack; -}; - -/* - * NSS core stats - */ -struct nss_core_stats { - uint32_t inst_cnt_total; -}; - -/* - * Message structure to send/receive NSS Freq commands - */ -struct nss_corefreq_msg { - struct nss_cmn_msg cm; /* Message Header */ - union { - struct nss_freq_msg nfc; /* Message: freq stats */ - struct nss_core_stats ncs; /* Message: NSS stats sync */ - } msg; -}; - -/* - * H2N Buffer Types - */ -#define H2N_BUFFER_EMPTY 0 -#define H2N_PAGED_BUFFER_EMPTY 1 -#define H2N_BUFFER_PACKET 2 -#define H2N_BUFFER_CTRL 4 -#define H2N_BUFFER_NATIVE_WIFI 8 -#define H2N_BUFFER_SHAPER_BOUNCE_INTERFACE 9 -#define H2N_BUFFER_SHAPER_BOUNCE_BRIDGE 10 -#define H2N_BUFFER_RATE_TEST 14 -#define H2N_BUFFER_MAX 16 - -/* - * H2N Bit Flag Definitions - */ -#define H2N_BIT_FLAG_GEN_IPV4_IP_CHECKSUM 0x0001 -#define H2N_BIT_FLAG_GEN_IP_TRANSPORT_CHECKSUM 0x0002 -#define H2N_BIT_FLAG_FIRST_SEGMENT 0x0004 -#define H2N_BIT_FLAG_LAST_SEGMENT 0x0008 - -#define H2N_BIT_FLAG_GEN_IP_TRANSPORT_CHECKSUM_NONE 0x0010 -#define H2N_BIT_FLAG_TX_TS_REQUIRED 0x0040 -#define H2N_BIT_FLAG_DISCARD 0x0080 -#define H2N_BIT_FLAG_SEGMENTATION_ENABLE 0x0100 - -#define H2N_BIT_FLAG_VIRTUAL_BUFFER 0x2000 -#define H2N_BIT_FLAG_BUFFER_REUSABLE 0x8000 - -/* - * HLOS to NSS descriptor structure. - */ -struct h2n_descriptor { - uint32_t interface_num; /* Interface number to which the buffer is to be sent (where appropriate) */ - uint32_t buffer; /* Physical buffer address. This is the address of the start of the usable buffer being provided by the HLOS */ - uint32_t qos_tag; /* QoS tag information of the buffer (where appropriate) */ - uint16_t buffer_len; /* Length of the buffer (in bytes) */ - uint16_t payload_len; /* Length of the active payload of the buffer (in bytes) */ - uint16_t mss; /* MSS to be used with TSO/UFO */ - uint16_t payload_offs; /* Offset from the start of the buffer to the start of the payload (in bytes) */ - uint16_t bit_flags; /* Bit flags associated with the buffer */ - uint8_t buffer_type; /* Type of buffer */ - uint8_t reserved; /* Reserved for future use */ - nss_ptr_t opaque; /* 32 or 64-bit value provided by the HLOS to associate with the buffer. The cookie has no meaning to the NSS */ -#ifndef __LP64__ - uint32_t padding; /* Pad to fit 64bits, do not reuse */ -#endif -}; - -/* - * N2H Buffer Types - */ -#define N2H_BUFFER_EMPTY 1 -#define N2H_BUFFER_PACKET 3 -#define N2H_BUFFER_COMMAND_RESP 5 -#define N2H_BUFFER_STATUS 6 -#define N2H_BUFFER_CRYPTO_RESP 8 -#define N2H_BUFFER_PACKET_VIRTUAL 10 -#define N2H_BUFFER_SHAPER_BOUNCED_INTERFACE 11 -#define N2H_BUFFER_SHAPER_BOUNCED_BRIDGE 12 -#define N2H_BUFFER_PACKET_EXT 13 -#define N2H_BUFFER_RATE_TEST 14 -#define N2H_BUFFER_MAX 16 - -/* - * Command Response Types - */ -#define N2H_COMMAND_RESP_OK 0 -#define N2H_COMMAND_RESP_BUFFER_TOO_SMALL 1 -#define N2H_COMMAND_RESP_BUFFER_NOT_WRITEABLE 2 -#define N2H_COMMAND_RESP_UNSUPPORTED_COMMAND 3 -#define N2H_COMMAND_RESP_INVALID_PARAMETERS 4 -#define N2H_COMMAND_RESP_INACTIVE_SUBSYSTEM 5 - -/* - * N2H Bit Flag Definitions - */ -#define N2H_BIT_FLAG_IPV4_IP_CHECKSUM_VALID 0x0001 -#define N2H_BIT_FLAG_IP_TRANSPORT_CHECKSUM_VALID 0x0002 -#define N2H_BIT_FLAG_FIRST_SEGMENT 0x0004 -#define N2H_BIT_FLAG_LAST_SEGMENT 0x0008 -#define N2H_BIT_FLAG_INGRESS_SHAPED 0x0010 - -/* - * NSS to HLOS descriptor structure - */ -struct n2h_descriptor { - uint32_t interface_num; /* Interface number to which the buffer is to be sent (where appropriate) */ - uint32_t buffer; /* Physical buffer address. This is the address of the start of the usable buffer being provided by the HLOS */ - uint16_t buffer_len; /* Length of the buffer (in bytes) */ - uint16_t payload_len; /* Length of the active payload of the buffer (in bytes) */ - uint16_t payload_offs; /* Offset from the start of the buffer to the start of the payload (in bytes) */ - uint16_t bit_flags; /* Bit flags associated with the buffer */ - uint8_t buffer_type; /* Type of buffer */ - uint8_t response_type; /* Response type if the buffer is a command response */ - uint8_t pri; /* Packet priority */ - uint8_t service_code; /* Service code */ - uint32_t reserved; /* Reserved for future use */ - nss_ptr_t opaque; /* 32 or 64-bit value provided by the HLOS to associate with the buffer. The cookie has no meaning to the NSS */ -#ifndef __LP64__ - uint32_t padding; /* Pad to fit 64 bits, do not reuse */ -#endif -}; - -/* - * Device Memory Map Definitions - */ -#define DEV_MAGIC 0x4e52522e -#define DEV_INTERFACE_VERSION 1 -#define DEV_DESCRIPTORS 256 /* Do we need it here? */ - -/** - * H2N descriptor METADATA - */ -struct h2n_desc_if_meta { - uint32_t desc_addr; - uint16_t size; - uint16_t padding; -}; - -/** - * H2N descriptor ring - */ -struct h2n_desc_if_instance { - struct h2n_descriptor *desc; - uint16_t size; /* Size in entries of the H2N0 descriptor ring */ -}; - -/** - * N2H descriptor METADATA - */ -struct n2h_desc_if_meta { - uint32_t desc_addr; - uint16_t size; - uint16_t padding; -}; - -/** - * N2H descriptor ring - */ -struct n2h_desc_if_instance { - struct n2h_descriptor *desc; - uint16_t size; /* Size in entries of the H2N0 descriptor ring */ -}; - -/** - * NSS virtual interface map - */ -struct nss_if_mem_map { - struct h2n_desc_if_meta h2n_desc_if[16];/* Base address of H2N0 descriptor ring */ - struct n2h_desc_if_meta n2h_desc_if[15];/* Base address of N2H0 descriptor ring */ - uint32_t magic; /* Magic value used to identify NSS implementations (must be 0x4e52522e) */ - uint16_t if_version; /* Interface version number (must be 1 for this version) */ - uint8_t h2n_rings; /* Number of descriptor rings in the H2N direction */ - uint8_t n2h_rings; /* Number of descriptor rings in the N2H direction */ - uint32_t h2n_nss_index[16]; - /* Index number for the next descriptor that will be read by the NSS in the H2N0 descriptor ring (NSS owned) */ - volatile uint32_t n2h_nss_index[15]; - /* Index number for the next descriptor that will be written by the NSS in the N2H0 descriptor ring (NSS owned) */ - uint8_t num_phys_ports; - uint8_t reserved1[3]; /* Reserved for future use */ - uint32_t h2n_hlos_index[16]; - /* Index number for the next descriptor that will be written by the HLOS in the H2N0 descriptor ring (HLOS owned) */ - volatile uint32_t n2h_hlos_index[15]; - /* Index number for the next descriptor that will be read by the HLOS in the N2H0 descriptor ring (HLOS owned) */ - uint32_t reserved; /* Reserved for future use */ -}; -#endif /* __NSS_HLOS_IF_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_if.c b/feeds/ipq807x/qca-nss-drv/src/nss_if.c deleted file mode 100644 index 0c370b119..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_if.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2016, 2018-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_if.c - * NSS base interfaces - */ - -#include "nss_tx_rx_common.h" -#include "nss_if_log.h" - -/* - * nss_if_pvt - * NSS private structure to handle the completion of NSS -> HLOS messages. - */ -static struct nss_if_pvt { - struct semaphore sem; - struct completion complete; - int response; -} nss_if; - -static bool nss_if_sem_init_done; - -/* - * nss_if_callback - * Callback to handle the completion of NSS ->HLOS messages. - */ -static void nss_if_callback(void *app_data, struct nss_if_msg *nim) -{ - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("nss_if Error response %d\n", nim->cm.response); - nss_if.response = NSS_TX_FAILURE; - complete(&nss_if.complete); - return; - } - - nss_if.response = NSS_TX_SUCCESS; - complete(&nss_if.complete); -} - -/* - * nss_if_msg_sync() - * Send a message to an interface and wait for the response. - */ -nss_tx_status_t nss_if_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_if_msg *nim) -{ - nss_tx_status_t status; - int ret = 0; - - if (!nss_if_sem_init_done) { - sema_init(&nss_if.sem, 1); - init_completion(&nss_if.complete); - nss_if_sem_init_done = 1; - } - - down(&nss_if.sem); - - status = nss_if_tx_msg(nss_ctx, nim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_if_msg failed\n", nss_ctx); - up(&nss_if.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_if.complete, msecs_to_jiffies(NSS_IF_TX_TIMEOUT)); - - if (!ret) { - nss_warning("%px: nss_if tx failed due to timeout\n", nss_ctx); - nss_if.response = NSS_TX_FAILURE; - } - - status = nss_if.response; - up(&nss_if.sem); - - return status; -} -EXPORT_SYMBOL(nss_if_msg_sync); - -/* - * nss_if_msg_handler() - * Handle NSS -> HLOS messages for base class interfaces - */ -void nss_if_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data) -{ - struct nss_if_msg *nim = (struct nss_if_msg *)ncm; - nss_if_msg_callback_t cb; - - /* - * We only support base class messages with this interface - */ - if (ncm->type > NSS_IF_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return; - } - - if (!nss_is_dynamic_interface(ncm->interface) && - !((ncm->interface >= NSS_PHYSICAL_IF_START) && (ncm->interface < NSS_VIRTUAL_IF_START))) { - nss_warning("%px: interface %d not in physical or dynamic if range\n", nss_ctx, ncm->interface); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_if_msg)) { - nss_warning("%px: message length too big: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_if_log_rx_msg(nim); - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_if_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nim); -} - -/* - * nss_if_tx_buf() - * Send packet to interface owned by NSS - */ -nss_tx_status_t nss_if_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - nss_trace("%px: If Tx packet, id:%d, data=%px", nss_ctx, if_num, os_buf->data); - - if (!nss_is_dynamic_interface(if_num) && - !((if_num >= NSS_PHYSICAL_IF_START) && (if_num < NSS_VIRTUAL_IF_START))) { - nss_warning("%px: interface %d not in physical or dynamic if range\n", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return nss_core_send_packet(nss_ctx, os_buf, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} - -/* - * nss_if_tx_msg() - * Transmit a message to the specific interface on this core. - */ -nss_tx_status_t nss_if_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_if_msg *nim) -{ - struct nss_cmn_msg *ncm = &nim->cm; - struct net_device *dev; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Sanity check the message - */ - if (ncm->type >= NSS_IF_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Sanity check the message for valid interfaces. - */ - if (ncm->interface < NSS_PHYSICAL_IF_START || - ncm->interface >= NSS_MAX_NET_INTERFACES ) { - nss_warning("%px: Tx request for invalid interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * Trace messages. - */ - nss_if_log_tx_msg(nim); - - dev = nss_ctx->subsys_dp_register[ncm->interface].ndev; - if (!dev) { - nss_warning("%px: Unregister interface %d: no context", nss_ctx, ncm->interface); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return nss_core_send_cmd(nss_ctx, nim, sizeof(*nim), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_if_register() - * Primary registration for receiving data and msgs from an interface. - */ -struct nss_ctx_instance *nss_if_register(uint32_t if_num, - nss_if_rx_callback_t rx_callback, - nss_if_msg_callback_t msg_callback, - struct net_device *if_ctx) -{ - return NULL; -} - -/* - * nss_if_unregister() - * Unregisteer the callback for this interface - */ -void nss_if_unregister(uint32_t if_num) -{ -} - -/* - * nss_if_reset_nexthop() - * De-configures the nexthop for an interface - */ -nss_tx_status_t nss_if_reset_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_trace("Resetting Nexthop. nss_ctx: %px ifnum: %u", nss_ctx, if_num); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_RESET_NEXTHOP, 0, nss_if_callback, NULL); - - return nss_if_msg_sync(nss_ctx, &nim); -} -EXPORT_SYMBOL(nss_if_reset_nexthop); - -/* - * nss_if_set_nexthop() - * Configures the nexthop for an interface - */ -nss_tx_status_t nss_if_set_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint32_t nexthop) -{ - struct nss_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (nexthop >= NSS_MAX_NET_INTERFACES) { - nss_warning("%px: Invalid nexthop interface number: %d", nss_ctx, nexthop); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nss_trace("%px: NSS If nexthop will be set to %d, id:%d\n", nss_ctx, nexthop, if_num); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_SET_NEXTHOP, - sizeof(struct nss_if_set_nexthop), nss_if_callback, NULL); - - nim.msg.set_nexthop.nexthop = nexthop; - - return nss_if_msg_sync(nss_ctx, &nim); -} -EXPORT_SYMBOL(nss_if_set_nexthop); - -/* - * nss_if_change_mtu() - * Change the MTU of the interface. - */ -nss_tx_status_t nss_if_change_mtu(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint16_t mtu) -{ - struct nss_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_trace("%px: NSS If MTU will be changed to %u, of NSS if num: %u\n", nss_ctx, mtu, if_num); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_MTU_CHANGE, - sizeof(struct nss_if_mtu_change), nss_if_callback, NULL); - - nim.msg.mtu_change.min_buf_size = mtu; - - return nss_if_msg_sync(nss_ctx, &nim); -} -EXPORT_SYMBOL(nss_if_change_mtu); - -/* - * nss_if_change_mac_addr() - * Change the MAC address of the interface. - */ -nss_tx_status_t nss_if_change_mac_addr(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint8_t *mac_addr) -{ - struct nss_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_trace("%px: NSS If MAC address will be changed to %s, of NSS if num: %u\n", nss_ctx, mac_addr, if_num); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_MAC_ADDR_SET, - sizeof(struct nss_if_mac_address_set), nss_if_callback, NULL); - - memcpy(nim.msg.mac_address_set.mac_addr, mac_addr, ETH_ALEN); - - return nss_if_msg_sync(nss_ctx, &nim); -} -EXPORT_SYMBOL(nss_if_change_mac_addr); - -/* - * nss_if_vsi_unassign() - * API to send VSI detach message to NSS FW. - */ -nss_tx_status_t nss_if_vsi_unassign(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint32_t vsi) -{ - struct nss_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_trace("%px: VSI to be unassigned is %u\n", nss_ctx, vsi); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_VSI_UNASSIGN, - sizeof(struct nss_if_vsi_unassign), nss_if_callback, NULL); - - nim.msg.vsi_unassign.vsi = vsi; - - return nss_if_msg_sync(nss_ctx, &nim); -} -EXPORT_SYMBOL(nss_if_vsi_unassign); - -/* - * nss_if_vsi_assign() - * API to send VSI attach message to NSS FW. - */ -nss_tx_status_t nss_if_vsi_assign(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num, uint32_t vsi) -{ - struct nss_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_trace("%px: VSI to be assigned is %u\n", nss_ctx, vsi); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_IF_VSI_ASSIGN, - sizeof(struct nss_if_vsi_assign), nss_if_callback, NULL); - - nim.msg.vsi_assign.vsi = vsi; - - return nss_if_msg_sync(nss_ctx, &nim); -} -EXPORT_SYMBOL(nss_if_vsi_assign); - -EXPORT_SYMBOL(nss_if_tx_msg); -EXPORT_SYMBOL(nss_if_register); -EXPORT_SYMBOL(nss_if_unregister); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_if_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_if_log.c deleted file mode 100644 index a551a4205..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_if_log.c +++ /dev/null @@ -1,429 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_if_log.c - * NSS Interface logger file. - */ - -#include "nss_core.h" - -/* - * nss_if_log_message_types_str - * NSS interface rule message strings - */ -static int8_t *nss_if_log_message_types_str[NSS_IF_MAX_MSG_TYPES] __maybe_unused = { - "NSS interface Open message", - "NSS interface close message", - "NSS interface link state notify message", - "NSS interface MTU change message", - "NSS interface MAC address set message", - "NSS interface stats message", - "NSS interface ishaper assign message", - "NSS interface bshaper assign message", - "NSS interface ishaper unassign message", - "NSS interface bshaper unassign message", - "NSS interface ishaper config message", - "NSS interface bshaper config message", - "NSS interface pause on off message", - "NSS interface VSI assign message", - "NSS interface VSI unassign message", - "NSS interface set next hop message", - "NSS interface set IGS node message", - "NSS interface clear IGS node message", - "NSS interface reset next hop message", -}; - -/* - * nss_if_log_error_response_types_str - * Strings for error types for NSS interface messages - */ -static int8_t *nss_if_log_error_response_types_str[NSS_IF_ERROR_TYPE_MAX] __maybe_unused = { - "No Ishapers", - "No Bshapers", - "No Ishaper", - "No Bshaper", - "No Old Ishaper", - "No Old Bshaper", - "Ishaper config failed", - "Bshaper config failed", - "Unknown error", - "Interface open error", - "Interface invalid MTU error", - "Invalid MAC address error", - "VSI no match error", - "VSI reassign error", - "Invalid VSI error", - "Max error", -}; - -/* - * nss_if_log_rule_open() - * Log NSS open interface message. - */ -static void nss_if_log_rule_open(struct nss_if_msg *nim) -{ - struct nss_if_open *niom __maybe_unused = &nim->msg.open; - nss_trace("%px: NSS open interface message \n" - "tx_desc_ring: %X\n" - "rx_desc_ring: %X\n" - "rx_forward_if: %u\n" - "alignment_mode: %u\n", - nim, - niom->tx_desc_ring, - niom->rx_desc_ring, - niom->rx_forward_if, - niom->alignment_mode); -} - -/* - * nss_if_log_rule_close() - * Log NSS close interface message. - */ -static void nss_if_log_rule_close(struct nss_if_msg *nim) -{ - nss_trace("%px: NSS close interface message \n", nim); -} - -/* - * nss_if_log_rule_link_state_notify() - * Log NSS interface link state notify message. - */ -static void nss_if_log_rule_link_state_notify(struct nss_if_msg *nim) -{ - struct nss_if_link_state_notify *nilstm __maybe_unused = &nim->msg.link_state_notify; - nss_trace("%px: NSS interface link state notify interface message \n" - "state: %u\n", - nim, - nilstm->state); -} - -/* - * nss_if_log_rule_mtu_change() - * Log NSS interface MTU change message. - */ -static void nss_if_log_rule_mtu_change(struct nss_if_msg *nim) -{ - struct nss_if_mtu_change *nimcm __maybe_unused = &nim->msg.mtu_change; - nss_trace("%px: NSS interface MTU change message \n" - "min_buf_size: %u\n", - nim, - nimcm->min_buf_size); -} - -/* - * nss_if_log_rule_mac_addr_set() - * Log NSS interface MAC address set message. - */ -static void nss_if_log_rule_mac_addr_set(struct nss_if_msg *nim) -{ - struct nss_if_mac_address_set *nimasm __maybe_unused = &nim->msg.mac_address_set; - nss_trace("%px: NSS interface MAC address set message \n" - "MAC address: %X:%X:%X:%X:%X:%X\n", - nim, - nimasm->mac_addr[0], nimasm->mac_addr[1], nimasm->mac_addr[2], - nimasm->mac_addr[3], nimasm->mac_addr[4], nimasm->mac_addr[5]); -} - -/* - * nss_if_log_rule_stats() - * Log NSS interface stats message. - */ -static void nss_if_log_rule_stats(struct nss_if_msg *nim) -{ - uint16_t i; - struct nss_cmn_node_stats *nism __maybe_unused = &nim->msg.stats; - - nss_trace("%px: NSS interface stats message \n" - "rx_packets: %u\n" - "rx_bytes: %u\n" - "tx_packets: %u\n" - "tx_bytes: %u\n", - nim, - nism->rx_packets, - nism->rx_bytes, - nism->tx_packets, - nism->tx_bytes); - - for(i=0; i < NSS_MAX_NUM_PRI; i++) - { - nss_trace("rx_dropped[%u]: %u\n", i, nism->rx_dropped[i]); - } -} - -/* - * nss_if_log_rule_shaper_assign() - * Log NSS interface shaper assignment message. - */ -static void nss_if_log_rule_shaper_assign(struct nss_if_msg *nim) -{ - struct nss_if_shaper_assign *shaper_assign_msg __maybe_unused = &nim->msg.shaper_assign; - nss_trace("%px: NSS interface shaper assign message \n" - "shaper_id: %u\n" - "new_shaper_id: %u\n", - nim, - shaper_assign_msg->shaper_id, - shaper_assign_msg->new_shaper_id); -} - -/* - * nss_if_log_rule_shaper_unassign() - * Log NSS interface shaper unassignment message. - */ -static void nss_if_log_rule_shaper_unassign(struct nss_if_msg *nim) -{ - struct nss_if_shaper_unassign *shaper_unassign_msg __maybe_unused = &nim->msg.shaper_unassign; - nss_trace("%px: NSS interface shaper unassign message \n" - "shaper_id: %u\n", - nim, - shaper_unassign_msg->shaper_id); -} - -/* - * nss_if_log_rule_shaper_config() - * Log NSS interface shaper configuration message. - */ -static void nss_if_log_rule_shaper_config(struct nss_if_msg *nim) -{ - struct nss_if_shaper_configure *shaper_configure_msg __maybe_unused = &nim->msg.shaper_configure; - nss_trace("%px: NSS interface shaper configuration message \n" - "request_type: %u\n" - "response_type: %u\n", - nim, - shaper_configure_msg->config.request_type, - shaper_configure_msg->config.response_type); -} - -/* - * nss_if_log_rule_pause_on_off() - * Log NSS interface pause on off message. - */ -static void nss_if_log_rule_pause_on_off(struct nss_if_msg *nim) -{ - struct nss_if_pause_on_off *pause_on_off_msg __maybe_unused = &nim->msg.pause_on_off; - nss_trace("%px: NSS interface pause ON/OFF message \n" - "pause_on: %u\n", - nim, - pause_on_off_msg->pause_on); -} - -/* - * nss_if_log_rule_vsi_assign() - * Log NSS interface VSI assignment message. - */ -static void nss_if_log_rule_vsi_assign(struct nss_if_msg *nim) -{ - struct nss_if_vsi_assign *vsi_assign_msg __maybe_unused = &nim->msg.vsi_assign; - nss_trace("%px: NSS interface VSI assignment message \n" - "VSI: %u\n", - nim, - vsi_assign_msg->vsi); -} - -/* - * nss_if_log_rule_vsi_unassign() - * Log NSS interface VSI unassignment message. - */ -static void nss_if_log_rule_vsi_unassign(struct nss_if_msg *nim) -{ - struct nss_if_vsi_unassign *vsi_unassign_msg __maybe_unused = &nim->msg.vsi_unassign; - nss_trace("%px: NSS interface VSI unassignment message \n" - "VSI: %u\n", - nim, - vsi_unassign_msg->vsi); -} - -/* - * nss_if_log_rule_set_nexthop() - * Log NSS interface set nexthop message. - */ -static void nss_if_log_rule_set_nexthop(struct nss_if_msg *nim) -{ - struct nss_if_set_nexthop *nisn __maybe_unused = &nim->msg.set_nexthop; - nss_trace("%px: NSS interface set nethop message \n" - "Nexthop: %u\n", - nim, - nisn->nexthop); -} - -/* - * nss_if_log_rule_set_igs_node() - * Log NSS interface set IGS node message. - */ -static void nss_if_log_rule_set_igs_node(struct nss_if_msg *nim) -{ - struct nss_if_igs_config *igs_config_msg __maybe_unused = &nim->msg.config_igs; - nss_trace("%px: NSS interface set IGS node message \n" - "igs_num: %d\n", - nim, - igs_config_msg->igs_num); -} - -/* - * nss_if_log_rule_clear_igs_node() - * Log NSS interface clear IGS node message. - */ -static void nss_if_log_rule_clear_igs_node(struct nss_if_msg *nim) -{ - struct nss_if_igs_config *igs_config_msg __maybe_unused = &nim->msg.config_igs; - nss_trace("%px: NSS interface clear IGS node message \n" - "igs_num: %d\n", - nim, - igs_config_msg->igs_num); -} - -/* - * nss_if_log_rule_reset_nexthop() - * Log NSS interface reset nexthop message. - */ -static void nss_if_log_rule_reset_nexthop(struct nss_if_msg *nim) -{ - nss_trace("%px: NSS interface reset nexthop message \n", nim); -} - -/* - * nss_if_log_verbose() - * Log message contents. - */ -static void nss_if_log_verbose(struct nss_if_msg *nim) -{ - nss_trace("NSS interface number: %u\n", nim->cm.interface); - - switch (nim->cm.type) { - case NSS_IF_OPEN: - nss_if_log_rule_open(nim); - break; - - case NSS_IF_CLOSE: - nss_if_log_rule_close(nim); - break; - - case NSS_IF_LINK_STATE_NOTIFY: - nss_if_log_rule_link_state_notify(nim); - break; - - case NSS_IF_MTU_CHANGE: - nss_if_log_rule_mtu_change(nim); - break; - - case NSS_IF_MAC_ADDR_SET: - nss_if_log_rule_mac_addr_set(nim); - break; - - case NSS_IF_STATS: - nss_if_log_rule_stats(nim); - break; - - case NSS_IF_ISHAPER_ASSIGN: - case NSS_IF_BSHAPER_ASSIGN: - nss_if_log_rule_shaper_assign(nim); - break; - - case NSS_IF_ISHAPER_UNASSIGN: - case NSS_IF_BSHAPER_UNASSIGN: - nss_if_log_rule_shaper_unassign(nim); - break; - - case NSS_IF_ISHAPER_CONFIG: - case NSS_IF_BSHAPER_CONFIG: - nss_if_log_rule_shaper_config(nim); - break; - - case NSS_IF_PAUSE_ON_OFF: - nss_if_log_rule_pause_on_off(nim); - break; - - case NSS_IF_VSI_ASSIGN: - nss_if_log_rule_vsi_assign(nim); - break; - - case NSS_IF_VSI_UNASSIGN: - nss_if_log_rule_vsi_unassign(nim); - break; - - case NSS_IF_SET_NEXTHOP: - nss_if_log_rule_set_nexthop(nim); - break; - - case NSS_IF_SET_IGS_NODE: - nss_if_log_rule_set_igs_node(nim); - break; - - case NSS_IF_CLEAR_IGS_NODE: - nss_if_log_rule_clear_igs_node(nim); - break; - - case NSS_IF_RESET_NEXTHOP: - nss_if_log_rule_reset_nexthop(nim); - break; - - default: - nss_trace("%px: Invalid message type\n", nim); - break; - } -} - -/* - * nss_if_log_rx_msg() - * Log messages received from FW. - */ -void nss_if_log_rx_msg(struct nss_if_msg *nim) -{ - if (nim->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_info("%px: Invalid response\n", nim); - return; - } - - if (nim->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nim->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nim, nim->cm.type, - nss_if_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response]); - goto verbose; - } - - if (nim->cm.error >= NSS_IF_ERROR_TYPE_MAX) { - nss_info("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nim, nim->cm.type, nss_if_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error); - goto verbose; - } - - nss_info("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nim, nim->cm.type, nss_if_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error, nss_if_log_error_response_types_str[nim->cm.error]); - -verbose: - nss_if_log_verbose(nim); -} - -/* - * nss_if_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_if_log_tx_msg(struct nss_if_msg *nim) -{ - if (nim->cm.type >= NSS_IF_MAX_MSG_TYPES) { - nss_info("%px: Invalid message type\n", nim); - return; - } - - nss_info("%px: type[%d]:%s\n", nim, nim->cm.type, nss_if_log_message_types_str[nim->cm.type]); - nss_if_log_verbose(nim); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_if_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_if_log.h deleted file mode 100644 index 0f2a7d27b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_if_log.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IF_LOG_H -#define __NSS_IF_LOG_H - -/* - * nss_if_log.h - * NSS Interface header file. - */ - -/* - * nss_if_log_tx_msg - * Logs an NSS interface message that is sent to the NSS firmware. - */ -void nss_if_log_tx_msg(struct nss_if_msg *nim); - -/* - * nss_if_log_rx_msg - * Logs an NSS interface message that is received from the NSS firmware. - */ -void nss_if_log_rx_msg(struct nss_if_msg *nim); - - -#endif /* __NSS_IF_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_igs.c b/feeds/ipq807x/qca-nss-drv/src/nss_igs.c deleted file mode 100644 index 8153a4653..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_igs.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_igs_stats.h" - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) -#ifdef CONFIG_NET_CLS_ACT -#include -#endif -#endif - -static struct module *nss_igs_module; - -/* - * nss_igs_verify_if_num() - * Verify interface number passed to us. - */ -bool nss_igs_verify_if_num(uint32_t if_num) -{ - enum nss_dynamic_interface_type if_type; - - if_type = nss_dynamic_interface_get_type(nss_igs_get_context(), if_num); - - if (if_type == NSS_DYNAMIC_INTERFACE_TYPE_IGS) { - return true; - } - return false; -} -EXPORT_SYMBOL(nss_igs_verify_if_num); - -/* - * nss_igs_handler() - * Handle NSS -> HLOS messages for igs device - */ -static void nss_igs_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - void *app_data) -{ - void *ctx; - nss_igs_msg_callback_t cb; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - BUG_ON(!nss_igs_verify_if_num(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_IGS_MSG_MAX) { - nss_warning("%px: received invalid message %d for IGS interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_igs_msg)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return; - } - - switch (ncm->type) { - case NSS_IGS_MSG_SYNC_STATS: - /* - * Debug stats embedded in stats msg. - */ - nss_igs_stats_sync(nss_ctx, ncm, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)app_data; - } - - /* - * callback - */ - cb = (nss_igs_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call igs callback - */ - if (!cb) { - nss_warning("%px: No callback for igs interface %d", - nss_ctx, ncm->interface); - return; - } - - cb(ctx, ncm); -} - -/* - * nss_igs_unregister_if() - * Un-registers IGS interface from the NSS firmware. - */ -void nss_igs_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.igs_handler_id]; - uint32_t status; - - nss_assert(nss_ctx); - nss_assert(nss_igs_verify_if_num(if_num)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_core_unregister_handler(nss_ctx, if_num); - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for interface %d with NSS core\n", nss_ctx, if_num); - } - - nss_igs_stats_reset(if_num); -} -EXPORT_SYMBOL(nss_igs_unregister_if); - -/* - * nss_igs_register_if() - * Registers the IGS interface with NSS FW. - */ -struct nss_ctx_instance *nss_igs_register_if(uint32_t if_num, uint32_t type, - nss_igs_msg_callback_t event_callback, struct net_device *netdev, - uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.igs_handler_id]; - uint32_t status; - - nss_assert(nss_ctx); - nss_assert(nss_igs_verify_if_num(if_num)); - - nss_core_register_handler(nss_ctx, if_num, nss_igs_handler, netdev); - status = nss_core_register_msg_handler(nss_ctx, if_num, event_callback); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: Not able to register handler for interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, NULL, 0, netdev, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); - - nss_igs_stats_dentry_create(); - nss_igs_stats_init(if_num, netdev); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_igs_register_if); - -/* - * nss_igs_get_context() - * Get the IGS context. - */ -struct nss_ctx_instance *nss_igs_get_context() -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.igs_handler_id]; -} -EXPORT_SYMBOL(nss_igs_get_context); - -#ifdef CONFIG_NET_CLS_ACT -/* - * nss_igs_module_save() - * Save the ingress shaping module reference. - */ -void nss_igs_module_save(struct tc_action_ops *act, struct module *module) -{ - nss_assert(act); - nss_assert(act->type == TCA_ACT_MIRRED_NSS); - - nss_igs_module = module; -} -EXPORT_SYMBOL(nss_igs_module_save); -#endif - -/* - * nss_igs_module_get() - * Get the ingress shaping module reference. - */ -bool nss_igs_module_get() -{ - nss_assert(nss_igs_module); - return try_module_get(nss_igs_module); -} -EXPORT_SYMBOL(nss_igs_module_get); - -/* - * nss_igs_module_put() - * Release the ingress shaping module reference. - */ -void nss_igs_module_put() -{ - nss_assert(nss_igs_module); - module_put(nss_igs_module); -} -EXPORT_SYMBOL(nss_igs_module_put); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_igs_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_igs_stats.c deleted file mode 100644 index a6b511a28..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_igs_stats.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_igs_stats.h" - -/* - * nss_igs_stats - * IGS debug statistics. - */ -enum nss_igs_stats { - NSS_IGS_STATS_TX_DROP, - NSS_IGS_STATS_SHAPER_DROP, - NSS_IGS_STATS_IPV4_PARSE_FAIL, - NSS_IGS_STATS_IPV4_UNKNOWN_GRE_TYPE, - NSS_IGS_STATS_IPV4_UNKNOWN_L4, - NSS_IGS_STATS_IPV4_NO_CME, - NSS_IGS_STATS_IPV4_FRAG_INITIAL, - NSS_IGS_STATS_IPV4_FRAG_NON_INITIAL, - NSS_IGS_STATS_IPV4_MALFORMED_UDP, - NSS_IGS_STATS_IPV4_MALFORMED_TCP, - NSS_IGS_STATS_IPV4_MALFORMED_UDPL, - NSS_IGS_STATS_IPV4_MALFORMED_GRE, - NSS_IGS_STATS_IPV6_PARSE_FAIL, - NSS_IGS_STATS_IPV6_UNKNOWN_L4, - NSS_IGS_STATS_IPV6_NO_CME, - NSS_IGS_STATS_IPV6_FRAG_INITIAL, - NSS_IGS_STATS_IPV6_FRAG_NON_INITIAL, - NSS_IGS_STATS_IPV6_MALFORMED_UDP, - NSS_IGS_STATS_IPV6_MALFORMED_TCP, - NSS_IGS_STATS_IPV6_MALFORMED_UDPL, - NSS_IGS_STATS_IPV6_MALFORMED_FRAG, - NSS_IGS_STATS_EVENT_NO_SI, - NSS_IGS_STATS_ETH_PARSE_FAIL, - NSS_IGS_STATS_ETH_UNKNOWN_TYPE, - NSS_IGS_STATS_PPPOE_NON_IP, - NSS_IGS_STATS_PPPOE_MALFORMED, - NSS_IGS_STATS_MAX -}; - -/* - * nss_igs_stats_debug_instance - * Stucture for H2N/N2H IGS debug stats - */ -static struct nss_igs_stats_debug_instance { - uint64_t stats[NSS_IGS_STATS_MAX]; /* IGS statistics for each instance. */ - int32_t if_index; /* IFB instance netdev index. */ - uint32_t if_num; /* IFB instance NSS interface number */ - bool valid; /* IFB statistics valid bit. */ -} nss_igs_stats_debug[NSS_MAX_IGS_DYNAMIC_INTERFACES]; - -/* - * Data structures to store IGS interface stats. - */ -static DEFINE_SPINLOCK(nss_igs_stats_debug_lock); - -/* - * nss_igs_stats_str - * IGS statistics strings for nss session stats - */ -struct nss_stats_info nss_igs_stats_str[NSS_IGS_STATS_MAX] = { - {"IGS_SHAPER_TX_DROP" , NSS_STATS_TYPE_DROP}, - {"IGS_SHAPER_DROP" , NSS_STATS_TYPE_DROP}, - {"IGS_EXCEPTION_IPV4_PARSE_FAIL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_UNKNOWN_GRE_TYPE" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_UNKNOWN_L4" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_NO_CME" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_FRAG_INITIAL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_FRAG_NON_INITIAL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_MALFORMED_UDP" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_MALFORMED_TCP" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_MALFORMED_UDPL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV4_MALFORMED_GRE" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_PARSE_FAIL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_UNKNOWN_L4" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_NO_CME" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_FRAG_INITIAL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_FRAG_NON_INITIAL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_MALFORMED_UDP" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_MALFORMED_TCP" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_MALFORMED_UDPL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_IPV6_MALFORMED_FRAG" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_EVENT_NO_SI" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_ETH_PARSE_FAIL" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_ETH_UNKNOWN_TYPE" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_PPPOE_NON_IP" , NSS_STATS_TYPE_EXCEPTION}, - {"IGS_EXCEPTION_PPPOE_MALFORMED" , NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_igs_stats_get() - * Get IGS statistics. - */ -static void nss_igs_stats_get(void *stats_mem) -{ - struct nss_igs_stats_debug_instance *stats = (struct nss_igs_stats_debug_instance *)stats_mem; - int i; - - if (!stats) { - nss_warning("No memory to copy IGS stats"); - return; - } - - spin_lock_bh(&nss_igs_stats_debug_lock); - for (i = 0; i < NSS_MAX_IGS_DYNAMIC_INTERFACES; i++) { - if (nss_igs_stats_debug[i].valid) { - memcpy(stats, &nss_igs_stats_debug[i], sizeof(struct nss_igs_stats_debug_instance)); - stats++; - } - } - spin_unlock_bh(&nss_igs_stats_debug_lock); -} - -/* - * nss_igs_stats_read() - * Read IGS statistics - */ -static ssize_t nss_igs_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - - uint32_t max_output_lines = 2 /* header & footer for instance stats */ - + NSS_MAX_IGS_DYNAMIC_INTERFACES * - ((NSS_STATS_NODE_MAX + 3 ) + (NSS_IGS_STATS_MAX + 3)) /*instance stats */ - + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - struct nss_igs_stats_debug_instance *igs_shadow_stats; - int id; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - igs_shadow_stats = kzalloc(sizeof(struct nss_igs_stats_debug_instance) * - NSS_MAX_IGS_DYNAMIC_INTERFACES, GFP_KERNEL); - if (unlikely(!igs_shadow_stats)) { - nss_warning("Could not allocate memory for base debug statistics buffer"); - kfree(lbuf); - return 0; - } - - /* - * Get all stats - */ - nss_igs_stats_get((void *)igs_shadow_stats); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "igs", NSS_STATS_SINGLE_CORE); - - /* - * Session stats - */ - for (id = 0; id < NSS_MAX_IGS_DYNAMIC_INTERFACES; id++) { - - if (!igs_shadow_stats[id].valid) { - continue; - } - - dev = dev_get_by_index(&init_net, igs_shadow_stats[id].if_index); - if (likely(dev)) { - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d, netdevice=%s\n", id, - igs_shadow_stats[id].if_num, dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d\n", id, - igs_shadow_stats[id].if_num); - } - size_wr += nss_stats_fill_common_stats(igs_shadow_stats[id].if_num, id, lbuf, size_wr, size_al, "igs"); - - /* - * IGS exception stats. - */ - size_wr += nss_stats_print("igs", "igs exception stats start" - , id - , nss_igs_stats_str - , igs_shadow_stats[id].stats - , NSS_IGS_STATS_MAX - , lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(igs_shadow_stats); - kfree(lbuf); - return bytes_read; -} - -/* - * nss_igs_stats_sync - * API to sync statistics for IGS - */ -void nss_igs_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, uint16_t if_num) -{ - uint8_t i, j; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_igs_msg *nim = (struct nss_igs_msg *)ncm; - struct nss_igs_stats_sync_msg *stats_msg = &nim->msg.stats; - struct nss_cmn_node_stats *node_stats_ptr = &stats_msg->node_stats; - uint32_t *igs_stats_ptr = (uint32_t *)&stats_msg->igs_stats; - - spin_lock_bh(&nss_igs_stats_debug_lock); - for (i = 0; i < NSS_MAX_IGS_DYNAMIC_INTERFACES; i++) { - if (nss_igs_stats_debug[i].if_num != if_num) { - continue; - } - - for (j = 0; j < NSS_IGS_STATS_MAX; j++) { - /* - * sync stats. - */ - nss_igs_stats_debug[i].stats[j] += igs_stats_ptr[j]; - } - spin_unlock_bh(&nss_igs_stats_debug_lock); - goto sync_cmn_stats; - } - - spin_unlock_bh(&nss_igs_stats_debug_lock); - return; - -sync_cmn_stats: - spin_lock_bh(&nss_top->stats_lock); - - /* - * sync common stats. - */ - nss_top->stats_node[if_num][NSS_STATS_NODE_RX_PKTS] += node_stats_ptr->rx_packets; - nss_top->stats_node[if_num][NSS_STATS_NODE_RX_BYTES] += node_stats_ptr->rx_bytes; - nss_top->stats_node[if_num][NSS_STATS_NODE_TX_PKTS] += node_stats_ptr->tx_packets; - nss_top->stats_node[if_num][NSS_STATS_NODE_TX_BYTES] += node_stats_ptr->tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_top->stats_node[if_num][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += - node_stats_ptr->rx_dropped[i]; - } - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_igs_stats_reset() - * API to reset the IGS stats. - */ -void nss_igs_stats_reset(uint32_t if_num) -{ - uint8_t i; - - spin_lock_bh(&nss_igs_stats_debug_lock); - for (i = 0; i < NSS_MAX_IGS_DYNAMIC_INTERFACES; i++) { - if (nss_igs_stats_debug[i].if_num == if_num) { - memset(&nss_igs_stats_debug[i], 0, sizeof(struct nss_igs_stats_debug_instance)); - break; - } - } - spin_unlock_bh(&nss_igs_stats_debug_lock); -} - -/* - * nss_igs_stats_init() - * API to initialize IGS debug instance statistics. - */ -void nss_igs_stats_init(uint32_t if_num, struct net_device *netdev) -{ - uint8_t i; - - spin_lock_bh(&nss_igs_stats_debug_lock); - for (i = 0; i < NSS_MAX_IGS_DYNAMIC_INTERFACES; i++) { - if (!nss_igs_stats_debug[i].valid) { - nss_igs_stats_debug[i].valid = true; - nss_igs_stats_debug[i].if_num = if_num; - nss_igs_stats_debug[i].if_index = netdev->ifindex; - break; - } - } - spin_unlock_bh(&nss_igs_stats_debug_lock); -} - -/* - * nss_igs_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(igs) - -/* - * nss_igs_stats_dentry_create() - * Create igs statistics debug entry. - */ -void nss_igs_stats_dentry_create(void) -{ - nss_stats_create_dentry("igs", &nss_igs_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_igs_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_igs_stats.h deleted file mode 100644 index 08f9c79f7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_igs_stats.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_IGS_STATS_H -#define __NSS_IGS_STATS_H - -/* - * nss_igs_stats_sync - * API to sync statistics for IGS - */ -extern void nss_igs_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, uint16_t if_num); - -/* - * nss_igs_stats_reset() - * API to reset the IGS stats. - */ -extern void nss_igs_stats_reset(uint32_t if_num); - -/* - * nss_igs_stats_init() - * API to initialize IGS debug instance statistics. - */ -extern void nss_igs_stats_init(uint32_t if_num, struct net_device *netdev); - - -/* - * IGS statistics APIs - */ -extern void nss_igs_stats_dentry_create(void); - -#endif /* __NSS_IGS_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_init.c b/feeds/ipq807x/qca-nss-drv/src/nss_init.c deleted file mode 100644 index ebd2a12fb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_init.c +++ /dev/null @@ -1,950 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_init.c - * NSS init APIs - * - */ -#include "nss_core.h" -#if (NSS_PM_SUPPORT == 1) -#include "nss_pm.h" -#endif -#include "nss_tx_rx_common.h" -#include "nss_data_plane.h" -#include "nss_capwap.h" -#include "nss_strings.h" - -#include - -#include -#include -#include -#include - -#if (NSS_DT_SUPPORT == 1) -#if (NSS_FABRIC_SCALING_SUPPORT == 1) -#include -#endif -#include -#include -#include -#include -#include -#else -#include -#endif - -#include -#include -#include - -/* - * Global declarations - */ -int nss_ctl_redirect __read_mostly = 0; -int nss_ctl_debug __read_mostly = 0; -int nss_ctl_logbuf __read_mostly = 0; -int nss_jumbo_mru __read_mostly = 0; -int nss_paged_mode __read_mostly = 0; -#if (NSS_SKB_REUSE_SUPPORT == 1) -int nss_max_reuse __read_mostly = PAGE_SIZE; -#endif -int nss_skip_nw_process = 0x0; -module_param(nss_skip_nw_process, int, S_IRUGO); - -/* - * PM client handle - */ -#if (NSS_PM_SUPPORT == 1) -static void *pm_client; -#endif - -/* - * Handler to send NSS messages - */ -struct clk *nss_core0_clk; -struct clk *nss_core1_clk; - -/* - * Handle fabric requests - only on new kernel - */ -#if (NSS_DT_SUPPORT == 1) -struct clk *nss_fab0_clk; -struct clk *nss_fab1_clk; -#endif - -/* - * Top level nss context structure - */ -struct nss_top_instance nss_top_main; -struct nss_cmd_buffer nss_cmd_buf; -struct nss_runtime_sampling nss_runtime_samples; -struct workqueue_struct *nss_wq; - -/* - * Work Queue to handle messages to Kernel - */ -nss_work_t *nss_work; - -extern struct of_device_id nss_dt_ids[]; - -/* - * nss_probe() - * HLOS device probe callback - */ -static inline int nss_probe(struct platform_device *nss_dev) -{ - return nss_hal_probe(nss_dev); -} - -/* - * nss_remove() - * HLOS device remove callback - */ -static inline int nss_remove(struct platform_device *nss_dev) -{ - return nss_hal_remove(nss_dev); -} - -#if (NSS_DT_SUPPORT == 1) -/* - * Platform Device ID for NSS core. - */ -struct of_device_id nss_dt_ids[] = { - { .compatible = "qcom,nss" }, - { .compatible = "qcom,nss0" }, - { .compatible = "qcom,nss1" }, - {}, -}; -MODULE_DEVICE_TABLE(of, nss_dt_ids); -#endif - -/* - * nss_driver - * Platform driver structure for NSS - */ -struct platform_driver nss_driver = { - .probe = nss_probe, - .remove = nss_remove, - .driver = { - .name = "qca-nss", - .owner = THIS_MODULE, -#if (NSS_DT_SUPPORT == 1) - .of_match_table = of_match_ptr(nss_dt_ids), -#endif - }, -}; - -#if (NSS_FREQ_SCALE_SUPPORT == 1) -/* - * nss_reset_frequency_stats_samples() - * Reset all frequency sampling state when auto scaling is turned off. - */ -static void nss_reset_frequency_stats_samples(void) -{ - nss_runtime_samples.buffer_index = 0; - nss_runtime_samples.sum = 0; - nss_runtime_samples.average = 0; - nss_runtime_samples.sample_count = 0; - nss_runtime_samples.message_rate_limit = 0; - nss_runtime_samples.freq_scale_rate_limit_down = 0; -} - -/* - * nss_current_freq_handler() - * Handle Userspace Frequency Change Requests - */ -static int nss_current_freq_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret, i; - - BUG_ON(!nss_wq); - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - if (!*lenp || (*ppos && !write)) { - printk("Frequency Set to %d\n", nss_cmd_buf.current_freq); - *lenp = 0; - return ret; - } - - /* - * Check if frequency exists in frequency Table - */ - i = 0; - while (i < NSS_FREQ_MAX_SCALE) { - if (nss_runtime_samples.freq_scale[i].frequency == nss_cmd_buf.current_freq) { - break; - } - i++; - } - if (i == NSS_FREQ_MAX_SCALE) { - printk("Frequency not found. Please check Frequency Table\n"); - nss_cmd_buf.current_freq = nss_runtime_samples.freq_scale[nss_runtime_samples.freq_scale_index].frequency; - return ret; - } - - /* - * Turn off Auto Scale - */ - nss_cmd_buf.auto_scale = 0; - nss_runtime_samples.freq_scale_ready = 0; - nss_runtime_samples.freq_scale_index = i; - - nss_work = (nss_work_t *)kmalloc(sizeof(nss_work_t), GFP_ATOMIC); - if (!nss_work) { - nss_info("NSS Freq WQ kmalloc fail"); - return ret; - } - INIT_WORK((struct work_struct *)nss_work, nss_hal_wq_function); - nss_work->frequency = nss_cmd_buf.current_freq; - nss_work->stats_enable = 0; - - /* - * Ensure we start with a fresh set of samples later - */ - nss_reset_frequency_stats_samples(); - - queue_work(nss_wq, (struct work_struct *)nss_work); - - return ret; -} - -/* - * nss_auto_scale_handler() - * Enables or Disable Auto Scaling - */ -static int nss_auto_scale_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - if (!*lenp || (*ppos && !write)) { - return ret; - } - - if (nss_cmd_buf.auto_scale != 1) { - /* - * Is auto scaling currently enabled? If so, send the command to - * disable stats reporting to NSS - */ - if (nss_runtime_samples.freq_scale_ready != 0) { - nss_cmd_buf.current_freq = nss_runtime_samples.freq_scale[nss_runtime_samples.freq_scale_index].frequency; - nss_work = (nss_work_t *)kmalloc(sizeof(nss_work_t), GFP_ATOMIC); - if (!nss_work) { - nss_info("NSS Freq WQ kmalloc fail"); - return ret; - } - INIT_WORK((struct work_struct *)nss_work, nss_hal_wq_function); - nss_work->frequency = nss_cmd_buf.current_freq; - nss_work->stats_enable = 0; - queue_work(nss_wq, (struct work_struct *)nss_work); - nss_runtime_samples.freq_scale_ready = 0; - - /* - * The current samples would be stale later when scaling is - * enabled again, hence reset them - */ - nss_reset_frequency_stats_samples(); - } - return ret; - } - - /* - * Setup default values - Middle of Freq Scale Band - */ - nss_runtime_samples.freq_scale_index = 1; - nss_runtime_samples.sample_count = 0; - nss_runtime_samples.initialized = 0; - nss_cmd_buf.current_freq = nss_runtime_samples.freq_scale[nss_runtime_samples.freq_scale_index].frequency; - - nss_work = (nss_work_t *)kmalloc(sizeof(nss_work_t), GFP_ATOMIC); - if (!nss_work) { - nss_info("NSS Freq WQ kmalloc fail"); - return ret; - } - INIT_WORK((struct work_struct *)nss_work, nss_hal_wq_function); - nss_work->frequency = nss_cmd_buf.current_freq; - nss_work->stats_enable = 1; - queue_work(nss_wq, (struct work_struct *)nss_work); - - nss_cmd_buf.auto_scale = 0; - nss_runtime_samples.freq_scale_ready = 1; - - return ret; -} - -/* - * nss_get_freq_table_handler() - * Display Support Freq and Ex how to Change. - */ -static int nss_get_freq_table_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret, i; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - if (write) { - return ret; - } - - printk("Frequency Supported - "); - - i = 0; - while (i < NSS_FREQ_MAX_SCALE) { - if (nss_runtime_samples.freq_scale[i].frequency != NSS_FREQ_SCALE_NA) { - printk("%d Hz ", nss_runtime_samples.freq_scale[i].frequency); - } - i++; - } - printk("\n"); - - *lenp = 0; - return ret; -} - -/* - * nss_get_average_inst_handler() - * Display AVG Inst Per Ms. - */ -static int nss_get_average_inst_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - if (write) { - return ret; - } - - printk("Current Inst Per Ms %x\n", nss_runtime_samples.average); - - *lenp = 0; - return ret; -} -#endif - -#if (NSS_FW_DBG_SUPPORT == 1) -/* - * nss_debug_handler() - * Enable NSS debug output - */ -static int nss_debug_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (!ret) { - if ((write) && (nss_ctl_debug != 0)) { - printk("Enabling NSS SPI Debug\n"); - nss_hal_debug_enable(); - } - } - - return ret; -} -#endif - -/* - * nss_coredump_handler() - * Send Signal To Coredump NSS Cores - */ -static int nss_coredump_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[NSS_CORE_0]; - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (!ret) { - /* - * if nss_cmd_buf.coredump is not 0 or 1, panic will be disabled - * when NSS FW crashes, so OEM/ODM have a chance to use mdump - * to dump crash dump (coredump) and send dump to us for analysis. - */ - if ((write) && (nss_ctl_debug != 0) && nss_cmd_buf.coredump == 1) { - printk("Coredumping to DDR\n"); - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_TRIGGER_COREDUMP); - } - } - - return ret; -} - -/* - * nss_jumbo_mru_handler() - * Sysctl to modify nss_jumbo_mru - */ -static int nss_jumbo_mru_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - if (write) { - nss_core_set_jumbo_mru(nss_jumbo_mru); - nss_info("jumbo_mru set to %d\n", nss_jumbo_mru); - } - - return ret; -} - -/* nss_paged_mode_handler() - * Sysctl to modify nss_paged_mode. - */ - -static int nss_paged_mode_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - if (write) { - nss_core_set_paged_mode(nss_paged_mode); - nss_info("paged_mode set to %d\n", nss_paged_mode); - } - - return ret; -} - -#if (NSS_SKB_REUSE_SUPPORT == 1) -/* - * nss_get_min_reuse_handler() - * Sysctl to get min reuse sizes - */ -static int nss_get_min_reuse_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - struct nss_ctx_instance *nss_ctx = NULL; - uint32_t core_id; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - printk("Min SKB reuse sizes - "); - - for (core_id = 0; core_id < NSS_CORE_MAX; core_id++) { - nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[core_id]; - printk("core %d: %d ", core_id, nss_core_get_min_reuse(nss_ctx)); - } - - printk("\n"); - *lenp = 0; - return ret; -} - -/* - * nss_max_reuse_handler() - * Sysctl to modify nss_max_reuse - */ -static int nss_max_reuse_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - - nss_max_reuse = nss_core_get_max_reuse(); - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - if (write) { - nss_core_set_max_reuse(nss_max_reuse); - nss_info("max_reuse set to %d\n", nss_max_reuse); - } - - return ret; -} - -/* - * sysctl-tuning for NSS driver SKB reuse - */ -static struct ctl_table nss_skb_reuse_table[] = { - { - .procname = "min_sizes", - .data = NULL, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_get_min_reuse_handler, - }, - { - .procname = "max_size", - .data = &nss_max_reuse, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_max_reuse_handler, - }, - { } -}; -#endif - -#if (NSS_FREQ_SCALE_SUPPORT == 1) -/* - * sysctl-tuning infrastructure. - */ -static struct ctl_table nss_freq_table[] = { - { - .procname = "current_freq", - .data = &nss_cmd_buf.current_freq, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_current_freq_handler, - }, - { - .procname = "freq_table", - .data = &nss_cmd_buf.max_freq, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_get_freq_table_handler, - }, - { - .procname = "auto_scale", - .data = &nss_cmd_buf.auto_scale, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_auto_scale_handler, - }, - { - .procname = "inst_per_sec", - .data = &nss_cmd_buf.average_inst, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_get_average_inst_handler, - }, - { } -}; -#endif - -static struct ctl_table nss_general_table[] = { - { - .procname = "redirect", - .data = &nss_ctl_redirect, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec, - }, -#if (NSS_FW_DBG_SUPPORT == 1) - { - .procname = "debug", - .data = &nss_ctl_debug, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_debug_handler, - }, -#endif - { - .procname = "coredump", - .data = &nss_cmd_buf.coredump, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_coredump_handler, - }, - { - .procname = "logbuf", - .data = &nss_ctl_logbuf, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_logbuffer_handler, - }, - { - .procname = "jumbo_mru", - .data = &nss_jumbo_mru, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_jumbo_mru_handler, - }, - { - .procname = "paged_mode", - .data = &nss_paged_mode, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_paged_mode_handler, - }, - { } -}; - -static struct ctl_table nss_init_dir[] = { -#if (NSS_FREQ_SCALE_SUPPORT == 1) - { - .procname = "clock", - .mode = 0555, - .child = nss_freq_table, - }, -#endif - { - .procname = "general", - .mode = 0555, - .child = nss_general_table, - }, -#if (NSS_SKB_REUSE_SUPPORT == 1) - { - .procname = "skb_reuse", - .mode = 0555, - .child = nss_skb_reuse_table, - }, -#endif - { } -}; - -static struct ctl_table nss_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_init_dir, - }, - { } -}; - -static struct ctl_table nss_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_dev_header; - -/* - * nss_init() - * Registers nss driver - */ -static int __init nss_init(void) -{ -#if (NSS_DT_SUPPORT == 1) - struct device_node *cmn = NULL; -#endif - nss_info("Init NSS driver"); - -#if (NSS_DT_SUPPORT == 1) - /* - * Get reference to NSS common device node - */ - cmn = of_find_node_by_name(NULL, "nss-common"); - if (!cmn) { - nss_info_always("qca-nss-drv.ko is loaded for symbol link\n"); - return 0; - } - of_node_put(cmn); - - /* - * Pick up HAL by target information - */ -#if defined(NSS_HAL_IPQ806X_SUPPORT) - if (of_machine_is_compatible("qcom,ipq8064") || of_machine_is_compatible("qcom,ipq8062")) { - nss_top_main.hal_ops = &nss_hal_ipq806x_ops; - nss_top_main.data_plane_ops = &nss_data_plane_gmac_ops; - nss_top_main.num_nss = 2; - } -#endif -#if defined(NSS_HAL_IPQ807x_SUPPORT) - if (of_machine_is_compatible("qcom,ipq807x") || of_machine_is_compatible("qcom,ipq8074")) { - nss_top_main.hal_ops = &nss_hal_ipq807x_ops; - nss_top_main.data_plane_ops = &nss_data_plane_ops; -#if defined(NSS_MEM_PROFILE_LOW) - nss_top_main.num_nss = 1; -#else - nss_top_main.num_nss = 2; -#endif - } -#endif -#if defined(NSS_HAL_IPQ60XX_SUPPORT) - if (of_machine_is_compatible("qcom,ipq6018")) { - nss_top_main.hal_ops = &nss_hal_ipq60xx_ops; - nss_top_main.data_plane_ops = &nss_data_plane_ops; - nss_top_main.num_nss = 1; - } -#endif -#if defined(NSS_HAL_IPQ50XX_SUPPORT) - if (of_machine_is_compatible("qcom,ipq5018")) { - nss_top_main.hal_ops = &nss_hal_ipq50xx_ops; - nss_top_main.data_plane_ops = &nss_data_plane_ops; - nss_top_main.num_nss = 1; - } -#endif -#if defined(NSS_HAL_FSM9010_SUPPORT) - if (of_machine_is_compatible("qcom,fsm9010")) { - nss_top_main.hal_ops = &nss_hal_fsm9010_ops; - nss_top_main.data_plane_ops = &nss_data_plane_gmac_ops; - nss_top_main.num_nss = 1; - } -#endif - if (!nss_top_main.hal_ops) { - nss_info_always("No supported HAL compiled on this platform\n"); - return -EFAULT; - } -#else - /* - * For banana, only ipq806x is supported - */ - nss_top_main.hal_ops = &nss_hal_ipq806x_ops; - nss_top_main.data_plane_ops = &nss_data_plane_gmac_ops; - nss_top_main.num_nss = 2; - -#endif /* NSS_DT_SUPPORT */ - nss_top_main.nss_hal_common_init_done = false; - - /* - * Initialize data_plane workqueue - */ - if (nss_data_plane_init_delay_work()) { - nss_warning("Error initializing nss_data_plane_workqueue\n"); - return -EFAULT; - } - - /* - * Enable spin locks - */ - spin_lock_init(&(nss_top_main.lock)); - spin_lock_init(&(nss_top_main.stats_lock)); - mutex_init(&(nss_top_main.wq_lock)); - - /* - * Enable NSS statistics - */ - nss_stats_init(); - - /* - * Enable NSS statistics names. - */ - nss_strings_init(); - - /* - * Register sysctl table. - */ - nss_dev_header = register_sysctl_table(nss_root); - - /* - * Registering sysctl for ipv4/6 specific config. - */ - nss_ipv4_register_sysctl(); -#ifdef NSS_DRV_IPV6_ENABLE - nss_ipv6_register_sysctl(); -#endif - - /* - * Registering sysctl for n2h specific config. - */ - if (nss_top_main.num_nss == 1) { - nss_n2h_single_core_register_sysctl(); - } else { - nss_n2h_multi_core_register_sysctl(); - } - - /* - * Registering sysctl for rps specific config. - */ - nss_rps_register_sysctl(); - -#ifdef NSS_DRV_C2C_ENABLE - /* - * Registering sysctl for c2c_tx specific config. - */ - nss_c2c_tx_register_sysctl(); -#endif - - /* - * Registering sysctl for for printing non zero stats. - */ - nss_stats_register_sysctl(); - - /* - * Register sysctl for project config - */ - nss_project_register_sysctl(); - - /* - * Registering sysctl for pppoe specific config. - */ - nss_pppoe_register_sysctl(); - - /* - * Setup Runtime Sample values - */ - nss_runtime_samples.freq_scale_index = 1; - nss_runtime_samples.freq_scale_ready = 0; - nss_runtime_samples.freq_scale_rate_limit_down = 0; - nss_runtime_samples.buffer_index = 0; - nss_runtime_samples.sum = 0; - nss_runtime_samples.sample_count = 0; - nss_runtime_samples.average = 0; - nss_runtime_samples.message_rate_limit = 0; - nss_runtime_samples.initialized = 0; - - nss_cmd_buf.current_freq = nss_runtime_samples.freq_scale[nss_runtime_samples.freq_scale_index].frequency; - - /* - * Initial Workqueue - */ - nss_wq = create_workqueue("nss_freq_queue"); - -#if (NSS_PM_SUPPORT == 1) - /* - * Initialize NSS Bus PM module - */ - nss_pm_init(); - - /* - * Register with Bus driver - */ - pm_client = nss_pm_client_register(NSS_PM_CLIENT_NETAP); - if (!pm_client) { - nss_warning("Error registering with PM driver"); - } -#endif - - /* - * Initialize mtu size needed as start - */ - nss_top_main.prev_mtu_sz = ETH_DATA_LEN; - - /* - * register panic handler and timeout control - */ - nss_coredump_notify_register(); - nss_coredump_init_delay_work(); - -#ifdef NSS_DRV_CAPWAP_ENABLE - /* - * Init capwap - */ - nss_capwap_init(); -#endif - -#ifdef NSS_DRV_QRFS_ENABLE - /* - * Init QRFS - */ - nss_qrfs_init(); -#endif - -#ifdef NSS_DRV_C2C_ENABLE - /* - * Init c2c_tx - */ - nss_c2c_tx_init(); -#endif - -#ifdef NSS_DRV_PVXLAN_ENABLE - /* - * Init pvxlan - */ - nss_pvxlan_init(); -#endif - -#ifdef NSS_DRV_CLMAP_ENABLE - /* - * Init clmap - */ - nss_clmap_init(); -#endif - - /* - * INIT ppe on supported platform - */ -#ifdef NSS_DRV_PPE_ENABLE - nss_ppe_init(); -#endif - -#ifdef NSS_DRV_DMA_ENABLE - nss_dma_init(); -#endif - - /* - * Init Wi-Fi mesh - */ -#ifdef NSS_DRV_WIFI_MESH_ENABLE - nss_wifi_mesh_init(); -#endif - - /* - * Register platform_driver - */ - return platform_driver_register(&nss_driver); -} - -/* - * nss_cleanup() - * Unregisters nss driver - */ -static void __exit nss_cleanup(void) -{ - nss_info("Exit NSS driver"); - - if (nss_dev_header) - unregister_sysctl_table(nss_dev_header); - - /* - * Unregister n2h specific sysctl - */ - nss_n2h_unregister_sysctl(); - - /* - * Unregister rps specific sysctl - */ - nss_rps_unregister_sysctl(); - -#ifdef NSS_DRV_C2C_ENABLE - /* - * Unregister c2c_tx specific sysctl - */ - nss_c2c_tx_unregister_sysctl(); -#endif - - /* - * Unregister pppoe specific sysctl - */ - nss_pppoe_unregister_sysctl(); - - /* - * Unregister ipv4/6 specific sysctl and free allocated to connection tables - */ - nss_ipv4_unregister_sysctl(); - nss_ipv4_free_conn_tables(); - -#ifdef NSS_DRV_IPV6_ENABLE - nss_ipv6_unregister_sysctl(); - nss_ipv6_free_conn_tables(); -#endif - - nss_project_unregister_sysctl(); - nss_data_plane_destroy_delay_work(); - - /* - * cleanup ppe on supported platform - */ -#ifdef NSS_DRV_PPE_ENABLE - nss_ppe_free(); -#endif - - platform_driver_unregister(&nss_driver); -} - -module_init(nss_init); -module_exit(nss_cleanup); - -MODULE_DESCRIPTION("QCA NSS Driver"); -MODULE_AUTHOR("Qualcomm Atheros Inc"); -MODULE_LICENSE("Dual BSD/GPL"); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec.c deleted file mode 100644 index 49c7805f3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec.c +++ /dev/null @@ -1,597 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipsec.c - * NSS IPsec APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_ipsec.h" -#include "nss_ppe.h" -#include "nss_ipsec_log.h" - -#if defined(NSS_HAL_IPQ806X_SUPPORT) -#define NSS_IPSEC_ENCAP_INTERFACE_NUM NSS_IPSEC_ENCAP_IF_NUMBER -#define NSS_IPSEC_DECAP_INTERFACE_NUM NSS_IPSEC_DECAP_IF_NUMBER -#define NSS_IPSEC_DATA_INTERFACE_NUM NSS_C2C_TX_INTERFACE - -#elif defined(NSS_HAL_FSM9010_SUPPORT) -#define NSS_IPSEC_ENCAP_INTERFACE_NUM NSS_IPSEC_ENCAP_IF_NUMBER -#define NSS_IPSEC_DECAP_INTERFACE_NUM NSS_IPSEC_DECAP_IF_NUMBER -#define NSS_IPSEC_DATA_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE - -#elif defined(NSS_HAL_IPQ807x_SUPPORT) -#define NSS_IPSEC_ENCAP_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE -#define NSS_IPSEC_DECAP_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE -#define NSS_IPSEC_DATA_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE - -#elif defined(NSS_HAL_IPQ60XX_SUPPORT) -#define NSS_IPSEC_ENCAP_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE -#define NSS_IPSEC_DECAP_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE -#define NSS_IPSEC_DATA_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE - -#elif defined(NSS_HAL_IPQ50XX_SUPPORT) -#define NSS_IPSEC_ENCAP_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE -#define NSS_IPSEC_DECAP_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE -#define NSS_IPSEC_DATA_INTERFACE_NUM NSS_IPSEC_CMN_INTERFACE - -#else -#define NSS_IPSEC_ENCAP_INTERFACE_NUM -1 -#define NSS_IPSEC_DECAP_INTERFACE_NUM -1 -#define NSS_IPSEC_DATA_INTERFACE_NUM -1 - -#endif - -/* - * Amount time the synchronous message should wait for response from - * NSS before the timeout happens. After the timeout the message - * response even if it arrives has to be discarded. Typically, the - * time needs to be selected based on the worst case time in case of - * peak throughput between host & NSS. - */ -#define NSS_IPSEC_TX_TIMEO_TICKS msecs_to_jiffies(3000) /* 3 Seconds */ - -/* - * Private data structure to hold state for - * the ipsec specific NSS interaction - */ -struct nss_ipsec_pvt { - struct semaphore sem; /* used for synchronizing 'tx_msg_sync' */ - struct completion complete; /* completion callback */ - atomic_t resp; /* Response error type */ -} nss_ipsec; - -/* - * nss_ipsec_get_msg_ctx() - * return ipsec message context assoicated with the callback - * - * Note: certain SOC the decap interface specially programmed - */ -static inline nss_ptr_t nss_ipsec_get_msg_ctx(struct nss_ctx_instance *nss_ctx, uint32_t interface_num) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - /* - * the encap is primary interface - */ - if (interface_num == NSS_IPSEC_ENCAP_INTERFACE_NUM) - return (nss_ptr_t)nss_top->ipsec_encap_ctx; - - return (nss_ptr_t)nss_top->ipsec_decap_ctx; -} - -/* - * nss_ipsec_get_msg_callback() - * this gets the message callback handler - */ -static inline nss_ptr_t nss_ipsec_get_msg_callback(struct nss_ctx_instance *nss_ctx, uint32_t interface_num) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - /* - * the encap is primary interface - */ - if (interface_num == NSS_IPSEC_ENCAP_INTERFACE_NUM) - return (nss_ptr_t)nss_top->ipsec_encap_callback; - - return (nss_ptr_t)nss_top->ipsec_decap_callback; -} - -/* - ********************************** - Rx APIs - ********************************** - */ - -/* - * nss_ipsec_msg_handler() - * this handles all the IPsec events and responses - */ -static void nss_ipsec_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data __attribute((unused))) -{ - struct nss_ipsec_msg *nim = (struct nss_ipsec_msg *)ncm; - nss_ipsec_msg_callback_t cb = NULL; - uint32_t if_num = ncm->interface; - - /* - * Trace messages. - */ - nss_ipsec_log_rx_msg(nim); - - /* - * Sanity check the message type - */ - if (ncm->type > NSS_IPSEC_MSG_TYPE_MAX) { - nss_warning("%px: rx message type out of range: %d", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_ipsec_msg)) { - nss_warning("%px: rx message length is invalid: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - BUG_ON((if_num != NSS_IPSEC_ENCAP_INTERFACE_NUM) && (if_num != NSS_IPSEC_DECAP_INTERFACE_NUM)); - - if (ncm->response == NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: rx message response for if %d, type %d, is invalid: %d", nss_ctx, ncm->interface, - ncm->type, ncm->response); - return; - } - - /* - * Is this a notification? if, yes then fill up the callback and app_data from - * locally stored state - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = nss_ipsec_get_msg_callback(nss_ctx, if_num); - ncm->app_data = nss_ipsec_get_msg_ctx(nss_ctx, if_num); - } - - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * load, test & call - */ - cb = (nss_ipsec_msg_callback_t)ncm->cb; - if (unlikely(!cb)) { - nss_trace("%px: rx handler has been unregistered for i/f: %d", nss_ctx, ncm->interface); - return; - } - - cb((void *)ncm->app_data, nim); -} - -/* - ********************************** - Tx APIs - ********************************** - */ - -/* - * nss_ipsec_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_ipsec_callback(void *app_data, struct nss_ipsec_msg *nim) -{ - struct nss_cmn_msg *ncm = &nim->cm; - - /* - * This callback is for synchronous operation. The caller sends its - * response pointer which needs to be loaded with the response - * data arriving from the NSS - */ - atomic_t *resp = (atomic_t *)app_data; - - if (ncm->response == NSS_CMN_RESPONSE_ACK) { - atomic_set(resp, NSS_IPSEC_ERROR_TYPE_NONE); - complete(&nss_ipsec.complete); - return; - } - - atomic_set(resp, ncm->error); - complete(&nss_ipsec.complete); -} - -/* - * nss_ipsec_tx_msg - * Send ipsec rule to NSS. - */ -nss_tx_status_t nss_ipsec_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_ipsec_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - nss_info("%px: message %d for if %d\n", nss_ctx, ncm->type, ncm->interface); - - BUILD_BUG_ON(NSS_NBUF_PAYLOAD_SIZE < sizeof(struct nss_ipsec_msg)); - - /* - * Trace messages. - */ - nss_ipsec_log_tx_msg(msg); - - if ((ncm->interface != NSS_IPSEC_ENCAP_INTERFACE_NUM) && (ncm->interface != NSS_IPSEC_DECAP_INTERFACE_NUM)) { - nss_warning("%px: tx message request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_IPSEC_MSG_TYPE_MAX) { - nss_warning("%px: tx message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - nss_info("msg params version:%d, interface:%d, type:%d, cb:%px, app_data:%px, len:%d\n", - ncm->version, ncm->interface, ncm->type, (void *)ncm->cb, (void *)ncm->app_data, ncm->len); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_ipsec_tx_msg); - -/* - * nss_ipsec_tx_msg_sync() - * Transmit a ipsec message to NSS firmware synchronously. - */ -nss_tx_status_t nss_ipsec_tx_msg_sync(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - enum nss_ipsec_msg_type type, uint16_t len, - struct nss_ipsec_msg *nim, enum nss_ipsec_error_type *resp) -{ - struct nss_ipsec_msg nim_local = { {0} }; - nss_tx_status_t status; - int ret; - - /* - * Length of the message should be the based on type - */ - if (len > sizeof(nim_local.msg)) { - nss_warning("%px: (%u)Bad message length(%u) for type (%d)", nss_ctx, if_num, len, type); - return NSS_TX_FAILURE_TOO_LARGE; - } - - /* - * Response buffer is a required for copying the response for message - */ - if (!resp) { - nss_warning("%px: (%u)Response buffer is empty, type(%d)", nss_ctx, if_num, type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * TODO: this can be removed in future as we need to ensure that the response - * memory is only updated when the current outstanding request is waiting. - * This can be solved by introducing sequence no. in messages and only completing - * the message if the sequence no. matches. For now this is solved by passing - * a known memory nss_ipsec.resp - */ - down(&nss_ipsec.sem); - - /* - * Initializing it to a fail error type - */ - atomic_set(&nss_ipsec.resp, NSS_IPSEC_ERROR_TYPE_UNHANDLED_MSG); - - /* - * We need to copy the message content into the actual message - * to be sent to NSS - * - * Note: Here pass the nss_ipsec.resp as the pointer. Since, the caller - * provided pointer is not allocated by us and may go away when this function - * returns with failure. The callback is not aware of this and may try to - * access the pointer incorrectly potentially resulting in a crash. - */ - nss_ipsec_msg_init(&nim_local, if_num, type, len, nss_ipsec_callback, &nss_ipsec.resp); - memcpy(&nim_local.msg, &nim->msg, len); - - status = nss_ipsec_tx_msg(nss_ctx, &nim_local); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: ipsec_tx_msg failed", nss_ctx); - goto done; - } - - ret = wait_for_completion_timeout(&nss_ipsec.complete, NSS_IPSEC_TX_TIMEO_TICKS); - if (!ret) { - nss_warning("%px: IPsec msg tx failed due to timeout", nss_ctx); - status = NSS_TX_FAILURE_NOT_ENABLED; - goto done; - } - - /* - * Read memory barrier - */ - smp_rmb(); - - /* - * Copy the response received - */ - *resp = atomic_read(&nss_ipsec.resp); - - /* - * Only in case of non-error response we will - * indicate success - */ - if (*resp != NSS_IPSEC_ERROR_TYPE_NONE) - status = NSS_TX_FAILURE; - -done: - up(&nss_ipsec.sem); - return status; -} -EXPORT_SYMBOL(nss_ipsec_tx_msg_sync); - -/* - * nss_ipsec_tx_buf - * Send data packet for ipsec processing - */ -nss_tx_status_t nss_ipsec_tx_buf(struct sk_buff *skb, uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.ipsec_handler_id]; - - nss_trace("%px: IPsec If Tx packet, id:%d, data=%px", nss_ctx, if_num, skb->data); - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_ipsec_tx_buf); - -/* - ********************************** - Register APIs - ********************************** - */ - -/* - * nss_ipsec_notify_register() - * register message notifier for the given interface (if_num) - */ -struct nss_ctx_instance *nss_ipsec_notify_register(uint32_t if_num, nss_ipsec_msg_callback_t cb, void *app_data) -{ - struct nss_top_instance *nss_top = &nss_top_main; - uint8_t core_id = nss_top->ipsec_handler_id; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_id]; - - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("%px: notfiy register received for invalid interface %d", nss_ctx, if_num); - return NULL; - } - - /* - * the encap is primary interface - */ - if (if_num == NSS_IPSEC_ENCAP_INTERFACE_NUM) { - nss_top->ipsec_encap_callback = cb; - nss_top->ipsec_encap_ctx = app_data; - return nss_ctx; - } - - nss_top->ipsec_decap_callback = cb; - nss_top->ipsec_decap_ctx = app_data; - return nss_ctx; -} -EXPORT_SYMBOL(nss_ipsec_notify_register); - -/* - * nss_ipsec_notify_unregister() - * unregister the IPsec notifier for the given interface number (if_num) - */ -void nss_ipsec_notify_unregister(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("%px: notify unregister received for invalid interface %d", nss_ctx, if_num); - return; - } - - /* - * the encap is primary interface - */ - if (if_num == NSS_IPSEC_ENCAP_INTERFACE_NUM) { - nss_top->ipsec_encap_callback = NULL; - nss_top->ipsec_encap_ctx = NULL; - return; - } - - nss_top->ipsec_decap_callback = NULL; - nss_top->ipsec_decap_ctx = NULL; -} -EXPORT_SYMBOL(nss_ipsec_notify_unregister); - -/* - * nss_ipsec_data_register() - * register a data callback routine - */ -struct nss_ctx_instance *nss_ipsec_data_register(uint32_t if_num, nss_ipsec_buf_callback_t cb, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx, *nss_ctx0; - - nss_ctx = &nss_top_main.nss[nss_top_main.ipsec_handler_id]; - - if ((if_num >= NSS_MAX_NET_INTERFACES) && (if_num < NSS_MAX_PHYSICAL_INTERFACES)){ - nss_warning("%px: data register received for invalid interface %d", nss_ctx, if_num); - return NULL; - } - - /* - * avoid multiple registeration for multiple tunnels - */ - if (nss_ctx->subsys_dp_register[if_num].cb) { - return nss_ctx; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, cb, NULL, NULL, netdev, features); - - if (nss_top_main.ipsec_handler_id == 1) { - nss_ctx0 = &nss_top_main.nss[0]; - - nss_core_register_subsys_dp(nss_ctx0, if_num, cb, NULL, NULL, netdev, features); - } - - return nss_ctx; -} -EXPORT_SYMBOL(nss_ipsec_data_register); - -/* - * nss_ipsec_data_unregister() - * unregister a data callback routine - */ -void nss_ipsec_data_unregister(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx0; - - if ((if_num >= NSS_MAX_NET_INTERFACES) && (if_num < NSS_MAX_PHYSICAL_INTERFACES)){ - nss_warning("%px: data unregister received for invalid interface %d", nss_ctx, if_num); - return; - } - - if (nss_top_main.ipsec_handler_id == 1) { - nss_ctx0 = &nss_top_main.nss[0]; - - nss_core_unregister_subsys_dp(nss_ctx0, if_num); - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_ipsec_data_unregister); - -/* - * nss_ipsec_get_encap_interface() - * Get the NSS interface number for encap message - */ -int32_t nss_ipsec_get_encap_interface(void) -{ - return NSS_IPSEC_ENCAP_INTERFACE_NUM; -} -EXPORT_SYMBOL(nss_ipsec_get_encap_interface); - -/* - * nss_ipsec_get_decap_interface() - * Get the NSS interface number for decap message - */ -int32_t nss_ipsec_get_decap_interface(void) -{ - return NSS_IPSEC_DECAP_INTERFACE_NUM; -} -EXPORT_SYMBOL(nss_ipsec_get_decap_interface); - -/* - * nss_ipsec_get_data_interface() - * Get the NSS interface number used for data path - */ -int32_t nss_ipsec_get_data_interface(void) -{ - return NSS_IPSEC_DATA_INTERFACE_NUM; -} -EXPORT_SYMBOL(nss_ipsec_get_data_interface); - -/* - * nss_ipsec_get_context() - * Get NSS context instance for IPsec handle - */ -struct nss_ctx_instance *nss_ipsec_get_context(void) -{ - return &nss_top_main.nss[nss_top_main.ipsec_handler_id]; -} -EXPORT_SYMBOL(nss_ipsec_get_context); - -/* - * nss_ipsec_get_ifnum() - * Return IPsec interface number with coreid. - */ -int32_t nss_ipsec_get_ifnum(int32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_ipsec_get_context(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_ipsec_get_ifnum); - -/* - * nss_ipsec_ppe_port_config() - * Configure PPE port for IPsec inline - */ -bool nss_ipsec_ppe_port_config(struct nss_ctx_instance *nss_ctx, struct net_device *netdev, - uint32_t if_num, uint32_t vsi_num) -{ -#ifdef NSS_PPE_SUPPORTED - if_num = NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); - - if (nss_ppe_tx_ipsec_config_msg(if_num, vsi_num, netdev->mtu, netdev->mtu) != NSS_TX_SUCCESS) { - nss_warning("%px: Failed to configure PPE IPsec port", nss_ctx); - return false; - } - - return true; -#else - return false; -#endif -} -EXPORT_SYMBOL(nss_ipsec_ppe_port_config); - -/* - * nss_ipsec_ppe_mtu_update() - * Update PPE MTU for IPsec inline - */ -bool nss_ipsec_ppe_mtu_update(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint16_t mtu, uint16_t mru) -{ -#ifdef NSS_PPE_SUPPORTED - if_num = NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); - - if (nss_ppe_tx_ipsec_mtu_msg(if_num, mtu, mru) != NSS_TX_SUCCESS) { - nss_warning("%px: Failed to update PPE MTU for IPsec port", nss_ctx); - return false; - } - - return true; -#else - return false; -#endif -} -EXPORT_SYMBOL(nss_ipsec_ppe_mtu_update); - -/* - * nss_ipsec_register_handler() - */ -void nss_ipsec_register_handler() -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.ipsec_handler_id]; - - BUILD_BUG_ON(NSS_IPSEC_ENCAP_INTERFACE_NUM < 0); - BUILD_BUG_ON(NSS_IPSEC_DECAP_INTERFACE_NUM < 0); - - sema_init(&nss_ipsec.sem, 1); - init_completion(&nss_ipsec.complete); - atomic_set(&nss_ipsec.resp, NSS_IPSEC_ERROR_TYPE_NONE); - - nss_ctx->nss_top->ipsec_encap_callback = NULL; - nss_ctx->nss_top->ipsec_decap_callback = NULL; - - nss_ctx->nss_top->ipsec_encap_ctx = NULL; - nss_ctx->nss_top->ipsec_decap_ctx = NULL; - - nss_core_register_handler(nss_ctx, NSS_IPSEC_ENCAP_INTERFACE_NUM, nss_ipsec_msg_handler, NULL); - nss_core_register_handler(nss_ctx, NSS_IPSEC_DECAP_INTERFACE_NUM, nss_ipsec_msg_handler, NULL); -} - -/* - * nss_ipsec_msg_init() - * Initialize ipsec message. - */ -void nss_ipsec_msg_init(struct nss_ipsec_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, - nss_ipsec_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nim->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_ipsec_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn.c deleted file mode 100644 index c5f520da1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn.c +++ /dev/null @@ -1,525 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_dynamic_interface.h" -#include "nss_ipsec_cmn.h" -#include "nss_ppe.h" -#include "nss_ipsec_cmn_log.h" -#include "nss_ipsec_cmn_stats.h" -#include "nss_ipsec_cmn_strings.h" - -#define NSS_IPSEC_CMN_TX_TIMEOUT 3000 /* 3 Seconds */ -#define NSS_IPSEC_CMN_INTERFACE_MAX_LONG BITS_TO_LONGS(NSS_MAX_NET_INTERFACES) - -/* - * Private data structure for handling synchronous messaging. - */ -static struct nss_ipsec_cmn_pvt { - struct semaphore sem; - struct completion complete; - struct nss_ipsec_cmn_msg nicm; - unsigned long if_map[NSS_IPSEC_CMN_INTERFACE_MAX_LONG]; -} ipsec_cmn_pvt; - -/* - * nss_ipsec_cmn_verify_ifnum() - * Verify if the interface number is a IPsec interface. - */ -static bool nss_ipsec_cmn_verify_ifnum(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - enum nss_dynamic_interface_type type = nss_dynamic_interface_get_type(nss_ctx, if_num); - - if (if_num == NSS_IPSEC_CMN_INTERFACE) - return true; - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_OUTER: - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_OUTER: - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_REDIRECT: - return true; - - default: - return false; - } - - return false; -} - -/* - * nss_ipsec_cmn_msg_handler() - * Handle NSS -> HLOS messages for IPSEC tunnel. - */ -static void nss_ipsec_cmn_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) -{ - nss_ipsec_cmn_msg_callback_t cb; - struct nss_ipsec_cmn_msg *nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Trace messages. - */ - nim = (struct nss_ipsec_cmn_msg *)ncm; - nss_ipsec_cmn_log_rx_msg(nim); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_IPSEC_CMN_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type(%u) for interface(%u)\n", nss_ctx, ncm->type, ncm->interface); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_ipsec_cmn_msg)) { - nss_warning("%px: Invalid message length(%d)\n", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - if (ncm->type == NSS_IPSEC_CMN_MSG_TYPE_CTX_SYNC) { - nss_ipsec_cmn_stats_sync(nss_ctx, ncm); - nss_ipsec_cmn_stats_notify(nss_ctx, ncm->interface); - } - - /* - * Update the callback and app_data for NOTIFY messages, ipsec_cmn sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Callback - */ - cb = (nss_ipsec_cmn_msg_callback_t)ncm->cb; - app_data = (void *)ncm->app_data; - - /* - * Call IPsec message callback - */ - if (!cb) { - nss_warning("%px: No callback for IPsec interface %d\n", nss_ctx, ncm->interface); - return; - } - - nss_trace("%px: calling ipsecsmgr message handler(%u)\n", nss_ctx, ncm->interface); - cb(app_data, ncm); -} - -/* - * nss_ipsec_cmn_sync_resp() - * Callback to handle the completion of HLOS-->NSS messages. - */ -static void nss_ipsec_cmn_sync_resp(void *app_data, struct nss_cmn_msg *ncm) -{ - struct nss_ipsec_cmn_msg *pvt_msg = app_data; - struct nss_ipsec_cmn_msg *resp_msg = container_of(ncm, struct nss_ipsec_cmn_msg, cm); - - /* - * Copy response message to pvt message - */ - memcpy(pvt_msg, resp_msg, sizeof(*resp_msg)); - - /* - * Write memory barrier - */ - smp_wmb(); - - complete(&ipsec_cmn_pvt.complete); -} - -/* - * nss_ipsec_cmn_ifmap_get() - * Return IPsec common active interfaces map. - */ -unsigned long *nss_ipsec_cmn_ifmap_get(void) -{ - return ipsec_cmn_pvt.if_map; -} - -/* - * nss_ipsec_cmn_get_context() - * Retrieve context for IPSEC redir. - */ -struct nss_ctx_instance *nss_ipsec_cmn_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.ipsec_handler_id]; -} -EXPORT_SYMBOL(nss_ipsec_cmn_get_context); - -/* - * nss_ipsec_cmn_get_ifnum_with_coreid() - * Return IPsec interface number with coreid. - */ -uint32_t nss_ipsec_cmn_get_ifnum_with_coreid(int32_t ifnum) -{ - struct nss_ctx_instance *nss_ctx = nss_ipsec_cmn_get_context(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, ifnum); -} -EXPORT_SYMBOL(nss_ipsec_cmn_get_ifnum_with_coreid); - -/* - * nss_ipsec_cmn_msg_init() - * Initialize message - */ -void nss_ipsec_cmn_msg_init(struct nss_ipsec_cmn_msg *nim, uint16_t if_num, enum nss_ipsec_cmn_msg_type type, - uint16_t len, nss_ipsec_cmn_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nim->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_ipsec_cmn_msg_init); - -/* - * nss_ipsec_cmn_tx_msg() - * Transmit a IPSEC message to NSS FW. - */ -nss_tx_status_t nss_ipsec_cmn_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_ipsec_cmn_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace messages. - */ - nss_ipsec_cmn_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (ncm->type >= NSS_IPSEC_CMN_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type(%u)\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - if (!nss_ipsec_cmn_verify_ifnum(nss_ctx, ncm->interface)) { - nss_warning("%px: Invalid message interface(%u)\n", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_ipsec_cmn_msg)) { - nss_warning("%px: Invalid message length(%u)\n", nss_ctx, nss_cmn_get_msg_len(ncm)); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_ipsec_cmn_tx_msg); - -/* - * nss_ipsec_cmn_tx_msg_sync() - * Transmit a IPSEC redir message to NSS firmware synchronously. - */ -nss_tx_status_t nss_ipsec_cmn_tx_msg_sync(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - enum nss_ipsec_cmn_msg_type type, uint16_t len, - struct nss_ipsec_cmn_msg *nicm) -{ - struct nss_ipsec_cmn_msg *local_nicm = &ipsec_cmn_pvt.nicm; - nss_tx_status_t status; - int ret = 0; - - /* - * Length of the message should be the based on type - */ - if (len > sizeof(struct nss_ipsec_cmn_msg)) { - nss_warning("%px: Invalid message length(%u), type (%d), I/F(%u)\n", nss_ctx, len, type, if_num); - return NSS_TX_FAILURE; - } - - down(&ipsec_cmn_pvt.sem); - - /* - * We need to copy the message content into the actual message - * to be sent to NSS - */ - memset(local_nicm, 0, sizeof(*local_nicm)); - - nss_ipsec_cmn_msg_init(local_nicm, if_num, type, len, nss_ipsec_cmn_sync_resp, local_nicm); - memcpy(&local_nicm->msg, &nicm->msg, len); - - status = nss_ipsec_cmn_tx_msg(nss_ctx, local_nicm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Failed to send message\n", nss_ctx); - goto done; - } - - ret = wait_for_completion_timeout(&ipsec_cmn_pvt.complete, msecs_to_jiffies(NSS_IPSEC_CMN_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: Failed to receive response, timeout(%d)\n", nss_ctx, ret); - status = NSS_TX_FAILURE_NOT_READY; - goto done; - } - - /* - * Read memory barrier - */ - smp_rmb(); - - if (local_nicm->cm.response != NSS_CMN_RESPONSE_ACK) { - status = NSS_TX_FAILURE; - nicm->cm.response = local_nicm->cm.response; - nicm->cm.error = local_nicm->cm.error; - goto done; - } - - /* - * Copy the message received - */ - memcpy(&nicm->msg, &local_nicm->msg, len); - -done: - up(&ipsec_cmn_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_ipsec_cmn_tx_msg_sync); - -/* - * nss_ipsec_cmn_tx_buf() - * Send packet to IPsec interface in NSS. - */ -nss_tx_status_t nss_ipsec_cmn_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - nss_trace("%px: Send to IPsec I/F(%u), skb(%px)\n", nss_ctx, if_num, os_buf); - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_ipsec_cmn_verify_ifnum(nss_ctx, if_num)) { - nss_warning("%px: Interface number(%d) is not IPSec type\n", nss_ctx, if_num); - return NSS_TX_FAILURE; - } - - return nss_core_send_packet(nss_ctx, os_buf, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_ipsec_cmn_tx_buf); - -/* - * nss_ipsec_cmn_register_if() - * Register dynamic node for IPSEC redir. - */ -struct nss_ctx_instance *nss_ipsec_cmn_register_if(uint32_t if_num, struct net_device *netdev, - nss_ipsec_cmn_data_callback_t cb_data, - nss_ipsec_cmn_msg_callback_t cb_msg, - uint32_t features, enum nss_dynamic_interface_type type, void *app_ctx) -{ - struct nss_ctx_instance *nss_ctx = nss_ipsec_cmn_get_context(); - uint32_t status; - - if (!nss_ipsec_cmn_verify_ifnum(nss_ctx, if_num)) { - nss_warning("%px: Invalid IPsec interface(%u)\n", nss_ctx, if_num); - return NULL; - } - - if (nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Failed find free slot for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return NULL; - } - -#ifdef NSS_DRV_PPE_ENABLE - if (features & NSS_IPSEC_CMN_FEATURE_INLINE_ACCEL) - nss_ppe_tx_ipsec_add_intf_msg(nss_ipsec_cmn_get_ifnum_with_coreid(if_num)); -#endif - - /* - * Registering handler for sending tunnel interface msgs to NSS. - */ - status = nss_core_register_handler(nss_ctx, if_num, nss_ipsec_cmn_msg_handler, app_ctx); - if (status != NSS_CORE_STATUS_SUCCESS){ - nss_warning("%px: Failed to register message handler for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return NULL; - } - - status = nss_core_register_msg_handler(nss_ctx, if_num, cb_msg); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: Failed to register message handler for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, cb_data, NULL, app_ctx, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); - - /* - * Atomically set the bitmap for the interface number - */ - set_bit(if_num, ipsec_cmn_pvt.if_map); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_ipsec_cmn_register_if); - -/* - * nss_ipsec_cmn_unregister_if() - * Unregister dynamic node for IPSEC redir. - */ -bool nss_ipsec_cmn_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_ipsec_cmn_get_context(); - struct net_device *dev; - uint32_t status; - - nss_assert(nss_ctx); - - if (!nss_ipsec_cmn_verify_ifnum(nss_ctx, if_num)) { - nss_warning("%px: Invalid IPsec interface(%u)\n", nss_ctx, if_num); - return false; - } - - dev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!dev) { - nss_warning("%px: Failed to find registered netdev for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return false; - } - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - /* - * Atomically clear the bitmap for the interface number - */ - clear_bit(if_num, ipsec_cmn_pvt.if_map); - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Failed to unregister handler for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return false; - } - - status = nss_core_unregister_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Failed to unregister handler for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return false; - } - - return true; -} -EXPORT_SYMBOL(nss_ipsec_cmn_unregister_if); - -/* - * nss_ipsec_cmn_notify_register() - * Register a handler for notification from NSS firmware. - */ -struct nss_ctx_instance *nss_ipsec_cmn_notify_register(uint32_t if_num, nss_ipsec_cmn_msg_callback_t cb, void *app_data) -{ - struct nss_ctx_instance *nss_ctx = nss_ipsec_cmn_get_context(); - uint32_t ret; - - BUG_ON(!nss_ctx); - - ret = nss_core_register_handler(nss_ctx, if_num, nss_ipsec_cmn_msg_handler, app_data); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to register event handler for interface(%u)\n", nss_ctx, if_num); - return NULL; - } - - ret = nss_core_register_msg_handler(nss_ctx, if_num, cb); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: Failed to register message handler for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return NULL; - } - - return nss_ctx; -} -EXPORT_SYMBOL(nss_ipsec_cmn_notify_register); - -/* - * nss_ipsec_cmn_notify_unregister() - * unregister the IPsec notifier for the given interface number (if_num) - */ -void nss_ipsec_cmn_notify_unregister(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - uint32_t ret; - - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("%px: notify unregister received for invalid interface %d\n", nss_ctx, if_num); - return; - } - - ret = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for interface(%u)\n", nss_ctx, if_num); - return; - } - - ret = nss_core_unregister_handler(nss_ctx, if_num); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for interface(%u)\n", nss_ctx, if_num); - return; - } -} -EXPORT_SYMBOL(nss_ipsec_cmn_notify_unregister); - -/* - * nss_ipsec_cmn_ppe_port_config() - * Configure PPE port for IPsec inline - */ -bool nss_ipsec_cmn_ppe_port_config(struct nss_ctx_instance *nss_ctx, struct net_device *netdev, - uint32_t if_num, uint32_t vsi_num) -{ -#ifdef NSS_PPE_SUPPORTED - if_num = NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); - - if (nss_ppe_tx_ipsec_config_msg(if_num, vsi_num, netdev->mtu, netdev->mtu) != NSS_TX_SUCCESS) { - nss_warning("%px: Failed to configure PPE IPsec port\n", nss_ctx); - return false; - } - - return true; -#else - return false; -#endif -} -EXPORT_SYMBOL(nss_ipsec_cmn_ppe_port_config); - -/* - * nss_ipsec_cmn_ppe_mtu_update() - * Update PPE MTU for IPsec inline - */ -bool nss_ipsec_cmn_ppe_mtu_update(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint16_t mtu, uint16_t mru) -{ -#ifdef NSS_PPE_SUPPORTED - if_num = NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); - - if (nss_ppe_tx_ipsec_mtu_msg(if_num, mtu, mru) != NSS_TX_SUCCESS) { - nss_warning("%px: Failed to update PPE MTU for IPsec port\n", nss_ctx); - return false; - } - - return true; -#else - return false; -#endif -} -EXPORT_SYMBOL(nss_ipsec_cmn_ppe_mtu_update); - -/* - * nss_ipsec_cmn_register_handler() - * Registering handler for sending msg to base ipsec_cmn node on NSS. - */ -void nss_ipsec_cmn_register_handler(void) -{ - sema_init(&ipsec_cmn_pvt.sem, 1); - init_completion(&ipsec_cmn_pvt.complete); - nss_ipsec_cmn_stats_dentry_create(); - nss_ipsec_cmn_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_log.c deleted file mode 100644 index 8ae7928f9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_log.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipsec_cmn_log.c - * NSS IPSEC logger file. - */ - -#include "nss_core.h" - -#define NSS_IPSEC_LOG_IPV4 4 -#define NSS_IPSEC_LOG_IPV6 6 - -/* - * nss_ipsec_cmn_log_msg_types_str - * IPSEC message strings - */ -static int8_t *nss_ipsec_cmn_log_msg_types_str[NSS_IPSEC_CMN_MSG_TYPE_MAX] __maybe_unused = { - "IPSEC CMN Msg None", - "IPSEC CMN Node Config", - "IPSEC CMN CTX Config", - "IPSEC CMN CTX Sync", - "IPSEC CMN SA Create", - "IPSEC CMN SA Destroy", - "IPSEC CMN SA Sync", - "IPSEC CMN Flow Create", - "IPSEC CMN Flow Destroy", -}; - -/* - * nss_ipsec_cmn_log_node_msg_types_str - * IPSEC cmn node message strings - */ -static int8_t *nss_ipsec_cmn_log_node_str[] __maybe_unused = { - "IPSEC CMN Node DMA Redirect", - "IPSEC CMN Node DMA Lookaside", - "IPSEC CMN Node Maximum SA", -}; - -/* - * nss_ipsec_cmn_log_ctx_msg_types_str - * IPSEC cmn ctx message strings - */ -static int8_t *nss_ipsec_cmn_log_ctx_str[] __maybe_unused = { - "IPSEC CMN CTX Type", - "IPSEC CMN CTX Exception Interface", -}; - -/* - * nss_ipsec_cmn_log_ctx_types_str - * IPSEC cmn context strings - */ -static int8_t *nss_ipsec_cmn_ctx_types_str[] __maybe_unused = { - "IPSEC CMN CTX NONE", - "IPSEC CMN CTX INNER", - "IPSEC CMN CTX INNER BOUNCE", - "IPSEC CMN CTX OUTER", - "IPSEC CMN CTX OUTER BOUNCE", - "IPSEC CMN CTX REDIRECT", -}; - -/* - * nss_ipsec_cmn_log_flow_tuple_str - * IPSEC cmn flow tuple strings - */ -static int8_t *nss_ipsec_cmn_log_flow_tuple_str[] __maybe_unused = { - "Dest IP", - "Src IP", - "Spi Index", - "Dest Port", - "Src Port", - "User Pattern", - "User Protocol", - "IP Version", -}; - -/* - * nss_ipsec_cmn_log_sa_tuple_str - * IPSEC cmn SA tuple strings - */ -static int8_t *nss_ipsec_cmn_log_sa_tuple_str[] __maybe_unused = { - "Dest IP", - "Src IP", - "Spi Index", - "Dest Port", - "Src Port", - "Crypto Index", - "Protocol", - "IP Version", - "Hop Limit", -}; - -/* - * nss_ipsec_cmn_log_sa_data_str - * IPSEC cmn SA tuple strings - */ -static int8_t *nss_ipsec_cmn_log_sa_data_str[] __maybe_unused = { - "Sequence Start", - "Flags", - "Window Size", - "DSCP", - "DF", - "Block Length", - "IV length", - "ICV length", -}; - -/* - * nss_ipsec_cmn_log_error_str - * Strings for error types for IPSEC messages - */ -static int8_t *nss_ipsec_cmn_log_error_str[NSS_IPSEC_CMN_MSG_ERROR_MAX] __maybe_unused = { - "IPSEC No Error", - "IPSEC Invalid Context", - "IPSEC SA allocation Error", - "IPSEC Invalid SA", - "IPSEC Duplicate SA", - "IPSEC SA is in Use", - "IPSEC Error in Flow Allocation", - "IPSEC Invalid Flow", - "IPSEC Duplicate Flow", - "IPSEC Failure to find SA for Flow", - "IPSEC Failed to Register Dynamic Interface", - "IPSEC Unhandled Message", -}; - -/* - * nss_ipsec_cmn_log_node_msg() - * Log NSS IPSEC node message. - */ -static void nss_ipsec_cmn_log_node_msg(struct nss_ipsec_cmn_msg *nim) -{ - struct nss_ipsec_cmn_node *node_msg __maybe_unused = &nim->msg.node; - - nss_trace("%px: NSS IPSEC Node Message:\n" - "%s: %d\n" - "%s: %d\n" - "%s: %d\n", nim, - nss_ipsec_cmn_log_node_str[0], node_msg->dma_redirect, - nss_ipsec_cmn_log_node_str[1], node_msg->dma_lookaside, - nss_ipsec_cmn_log_node_str[2], node_msg->max_sa); -} - -/* - * nss_ipsec_cmn_log_ctx_msg() - * Log NSS IPSEC ctx message. - */ -static void nss_ipsec_cmn_log_ctx_msg(struct nss_ipsec_cmn_msg *nim) -{ - struct nss_ipsec_cmn_ctx *ctx_msg __maybe_unused = &nim->msg.ctx; - - nss_trace("%px: NSS IPSEC CTX Message:\n" - "%s: %s\n" - "%s: %d\n", nim, - nss_ipsec_cmn_log_ctx_str[0], nss_ipsec_cmn_ctx_types_str[ctx_msg->type], - nss_ipsec_cmn_log_ctx_str[1], ctx_msg->except_ifnum); -} - -/* - * nss_ipsec_cmn_log_sa_msg() - * Log NSS IPSEC SA message. - */ -static void nss_ipsec_cmn_log_sa_msg(struct nss_ipsec_cmn_msg *nim) -{ - struct nss_ipsec_cmn_sa *sa_msg __maybe_unused = &nim->msg.sa; - struct nss_ipsec_cmn_sa_tuple *tuple = &sa_msg->sa_tuple; - struct nss_ipsec_cmn_sa_data *data __maybe_unused = &sa_msg->sa_data; - - nss_trace("%px: NSS IPSEC SA Message:\n", nim); - - if (tuple->ip_ver == 4) { - nss_trace("%s: %pI4\n%s: %pI4\n", - nss_ipsec_cmn_log_sa_tuple_str[0], tuple->dest_ip, - nss_ipsec_cmn_log_sa_tuple_str[1], tuple->src_ip); - } else { - nss_trace("%s: %pI6\n%s: %pI6\n", - nss_ipsec_cmn_log_sa_tuple_str[0], tuple->dest_ip, - nss_ipsec_cmn_log_sa_tuple_str[1], tuple->src_ip); - } - - nss_trace( "%s: %x\n%s: %d\n%s: %d\n%s: %d\n" - "%s: %d\n%s: %d\n%s: %d\n" - "%s: %d\n%s: %x\n%s: %d\n%s: %d\n" - "%s: %d\n%s: %d\n%s: %d\n%s: %d\n", - nss_ipsec_cmn_log_sa_tuple_str[2], tuple->spi_index, - nss_ipsec_cmn_log_sa_tuple_str[3], tuple->dest_port, - nss_ipsec_cmn_log_sa_tuple_str[4], tuple->src_port, - nss_ipsec_cmn_log_sa_tuple_str[5], tuple->crypto_index, - nss_ipsec_cmn_log_sa_tuple_str[6], tuple->protocol, - nss_ipsec_cmn_log_sa_tuple_str[7], tuple->ip_ver, - nss_ipsec_cmn_log_sa_tuple_str[8], tuple->hop_limit, - - nss_ipsec_cmn_log_sa_data_str[0], data->seq_start, - nss_ipsec_cmn_log_sa_data_str[1], data->flags, - nss_ipsec_cmn_log_sa_data_str[2], data->window_size, - nss_ipsec_cmn_log_sa_data_str[3], data->dscp, - nss_ipsec_cmn_log_sa_data_str[4], data->df, - nss_ipsec_cmn_log_sa_data_str[5], data->blk_len, - nss_ipsec_cmn_log_sa_data_str[6], data->iv_len, - nss_ipsec_cmn_log_sa_data_str[7], data->icv_len); - -} - -/* - * nss_ipsec_cmn_log_flow_msg() - * Log NSS IPSEC Flow message. - */ -static void nss_ipsec_cmn_log_flow_msg(struct nss_ipsec_cmn_msg *nim) -{ - struct nss_ipsec_cmn_flow *flow_msg __maybe_unused = &nim->msg.flow; - struct nss_ipsec_cmn_flow_tuple *flow = &flow_msg->flow_tuple; - struct nss_ipsec_cmn_sa_tuple *sa = &flow_msg->sa_tuple; - - nss_trace("%px: NSS IPSEC Flow Message:\n", nim); - - if (sa->ip_ver == 4) { - nss_trace("%s: %pI4\n%s: %pI4\n", - nss_ipsec_cmn_log_sa_tuple_str[0], sa->dest_ip, - nss_ipsec_cmn_log_sa_tuple_str[1], sa->src_ip); - } else { - nss_trace("%s: %pI6\n%s: %pI6\n", - nss_ipsec_cmn_log_sa_tuple_str[0], sa->dest_ip, - nss_ipsec_cmn_log_sa_tuple_str[1], sa->src_ip); - } - - if (flow->ip_ver == 4) { - nss_trace("%s: %pI4\n%s: %pI4\n", - nss_ipsec_cmn_log_sa_tuple_str[0], flow->dest_ip, - nss_ipsec_cmn_log_sa_tuple_str[1], flow->src_ip); - } else { - nss_trace("%s: %pI6\n%s: %pI6\n", - nss_ipsec_cmn_log_sa_tuple_str[0], flow->dest_ip, - nss_ipsec_cmn_log_sa_tuple_str[1], flow->src_ip); - } - - nss_trace( "%s: %x\n%s: %d\n%s: %d\n%s: %d\n" - "%s: %d\n", - nss_ipsec_cmn_log_flow_tuple_str[2], flow->spi_index, - nss_ipsec_cmn_log_flow_tuple_str[3], flow->dst_port, - nss_ipsec_cmn_log_flow_tuple_str[4], flow->src_port, - nss_ipsec_cmn_log_flow_tuple_str[5], flow->user_pattern, - nss_ipsec_cmn_log_flow_tuple_str[6], flow->protocol); - - nss_trace( "%s: %x\n%s: %d\n%s: %d\n%s: %d\n" - "%s: %d\n%s: %d\n%s: %d\n", - nss_ipsec_cmn_log_sa_tuple_str[2], sa->spi_index, - nss_ipsec_cmn_log_sa_tuple_str[3], sa->dest_port, - nss_ipsec_cmn_log_sa_tuple_str[4], sa->src_port, - nss_ipsec_cmn_log_sa_tuple_str[5], sa->crypto_index, - nss_ipsec_cmn_log_sa_tuple_str[6], sa->protocol, - nss_ipsec_cmn_log_sa_tuple_str[7], sa->ip_ver, - nss_ipsec_cmn_log_sa_tuple_str[8], sa->hop_limit); -} - -/* - * nss_ipsec_cmn_log_verbose() - * Log message contents. - */ -static void nss_ipsec_cmn_log_verbose(struct nss_ipsec_cmn_msg *nim) -{ - switch (nim->cm.type) { - case NSS_IPSEC_CMN_MSG_TYPE_NODE_CONFIG: - nss_ipsec_cmn_log_node_msg(nim); - break; - - case NSS_IPSEC_CMN_MSG_TYPE_CTX_CONFIG: - nss_ipsec_cmn_log_ctx_msg(nim); - break; - - case NSS_IPSEC_CMN_MSG_TYPE_SA_CREATE: - case NSS_IPSEC_CMN_MSG_TYPE_SA_DESTROY: - nss_ipsec_cmn_log_sa_msg(nim); - break; - - case NSS_IPSEC_CMN_MSG_TYPE_FLOW_CREATE: - case NSS_IPSEC_CMN_MSG_TYPE_FLOW_DESTROY: - nss_ipsec_cmn_log_flow_msg(nim); - break; - - case NSS_IPSEC_CMN_MSG_TYPE_CTX_SYNC: - case NSS_IPSEC_CMN_MSG_TYPE_SA_SYNC: - /* - * No log for these valid messages. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", nim); - break; - } -} - -/* - * nss_ipsec_cmn_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_ipsec_cmn_log_tx_msg(struct nss_ipsec_cmn_msg *nim) -{ - if (nim->cm.type >= NSS_IPSEC_CMN_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", nim); - return; - } - - nss_info("%px: type[%d]:%s\n", nim, nim->cm.type, nss_ipsec_cmn_log_msg_types_str[nim->cm.type]); - nss_ipsec_cmn_log_verbose(nim); -} - -/* - * nss_ipsec_cmn_log_rx_msg() - * Log messages received from FW. - */ -void nss_ipsec_cmn_log_rx_msg(struct nss_ipsec_cmn_msg *nim) -{ - if (nim->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nim); - return; - } - - if (nim->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nim->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nim, nim->cm.type, - nss_ipsec_cmn_log_msg_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response]); - goto verbose; - } - - if (nim->cm.error >= NSS_IPSEC_CMN_MSG_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nim, nim->cm.type, nss_ipsec_cmn_log_msg_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nim, nim->cm.type, nss_ipsec_cmn_log_msg_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error, nss_ipsec_cmn_log_error_str[nim->cm.error]); - -verbose: - nss_ipsec_cmn_log_verbose(nim); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_log.h deleted file mode 100644 index d99c8be4c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_IPSEC_CMN_LOG_H__ -#define __NSS_IPSEC_CMN_LOG_H__ - -/* - * nss_ipsec_cmn_log.h - * NSS Crypto Log Header File - */ - -/* - * nss_ipsec_cmn_log_tx_msg - * Logs a ipsec message that is sent to the NSS firmware. - */ -void nss_ipsec_cmn_log_tx_msg(struct nss_ipsec_cmn_msg *nim); - -/* - * nss_ipsec_cmn_log_rx_msg - * Logs a ipsec message that is received from the NSS firmware. - */ -void nss_ipsec_cmn_log_rx_msg(struct nss_ipsec_cmn_msg *nim); - -#endif /* __NSS_IPSEC_CMN_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.c deleted file mode 100644 index 192f2291a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_core.h" -#include "nss_ipsec_cmn.h" -#include "nss_ipsec_cmn_stats.h" -#include "nss_ipsec_cmn_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_ipsec_cmn_stats_notifier); - -/* - * Spinlock to protect IPsec common statistics update/read - */ -DEFINE_SPINLOCK(nss_ipsec_cmn_stats_lock); - -unsigned long *nss_ipsec_cmn_ifmap_get(void); -const char *nss_ipsec_cmn_stats_iface_type(enum nss_dynamic_interface_type type); - -/* - * nss_ipsec_cmn_stats - * ipsec common statistics - */ -uint64_t nss_ipsec_cmn_stats[NSS_MAX_NET_INTERFACES][NSS_IPSEC_CMN_STATS_MAX]; - -/* - * nss_ipsec_cmn_stats_read() - * Read ipsec_cmn node statistics. - */ -static ssize_t nss_ipsec_cmn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_IPSEC_CMN_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - struct nss_ctx_instance *nss_ctx = nss_ipsec_cmn_get_context(); - enum nss_dynamic_interface_type type; - unsigned long *ifmap; - uint64_t *stats_shadow; - ssize_t bytes_read = 0; - size_t size_wr = 0; - uint32_t if_num; - int32_t i; - int count; - char *lbuf; - - ifmap = nss_ipsec_cmn_ifmap_get(); - count = bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); - if (count) { - size_al = size_al * count; - } - - lbuf = vzalloc(size_al); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = vzalloc(NSS_IPSEC_CMN_STATS_MAX * 8); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - vfree(lbuf); - return -ENOMEM; - } - - /* - * Common node stats for each IPSEC dynamic interface. - */ - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipsec_cmn stats", NSS_STATS_SINGLE_CORE); - for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) { - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - if ((type < NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER) || - (type > NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_REDIRECT)) { - continue; - } - - spin_lock_bh(&nss_ipsec_cmn_stats_lock); - for (i = 0; i < NSS_IPSEC_CMN_STATS_MAX; i++) { - stats_shadow[i] = nss_ipsec_cmn_stats[if_num][i]; - } - spin_unlock_bh(&nss_ipsec_cmn_stats_lock); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", - nss_ipsec_cmn_stats_iface_type(type), if_num); - size_wr += nss_stats_print("ipsec_cmn", NULL, NSS_STATS_SINGLE_INSTANCE, nss_ipsec_cmn_strings_stats, - stats_shadow, NSS_IPSEC_CMN_STATS_MAX, lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - vfree(lbuf); - vfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_ipsec_cmn_stats_ops. - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ipsec_cmn); - -/* - * nss_ipsec_cmn_stats_sync() - * Update ipsec_cmn node statistics. - */ -void nss_ipsec_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - struct nss_ipsec_cmn_msg *nicm = (struct nss_ipsec_cmn_msg *)ncm; - struct nss_ipsec_cmn_ctx_stats *ndccs = &nicm->msg.ctx_sync.stats; - uint64_t *ctx_stats; - uint32_t *msg_stats; - uint16_t i = 0; - - spin_lock_bh(&nss_ipsec_cmn_stats_lock); - - msg_stats = (uint32_t *)ndccs; - ctx_stats = nss_ipsec_cmn_stats[ncm->interface]; - - for (i = 0; i < NSS_IPSEC_CMN_STATS_MAX; i++, ctx_stats++, msg_stats++) { - *ctx_stats += *msg_stats; - } - - spin_unlock_bh(&nss_ipsec_cmn_stats_lock); -} - -/* - * nss_ipsec_cmn_stats_iface_type() - * Return a string for each interface type. - */ -const char *nss_ipsec_cmn_stats_iface_type(enum nss_dynamic_interface_type type) -{ - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_INNER: - return "ipsec_cmn_inner"; - - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_INNER: - return "ipsec_cmn_mdata_inner"; - - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_OUTER: - return "ipsec_cmn_outer"; - - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_MDATA_OUTER: - return "ipsec_cmn_mdata_outer"; - - case NSS_DYNAMIC_INTERFACE_TYPE_IPSEC_CMN_REDIRECT: - return "ipsec_cmn_redirect"; - - default: - return "invalid_interface"; - } -} - -/* - * nss_ipsec_cmn_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_ipsec_cmn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_ipsec_cmn_stats_notification ipsec_cmn_stats; - - spin_lock_bh(&nss_ipsec_cmn_stats_lock); - ipsec_cmn_stats.core_id = nss_ctx->id; - ipsec_cmn_stats.if_num = if_num; - memcpy(ipsec_cmn_stats.stats_ctx, nss_ipsec_cmn_stats[if_num], sizeof(ipsec_cmn_stats.stats_ctx)); - spin_unlock_bh(&nss_ipsec_cmn_stats_lock); - - atomic_notifier_call_chain(&nss_ipsec_cmn_stats_notifier, NSS_STATS_EVENT_NOTIFY, &ipsec_cmn_stats); -} - -/* - * nss_ipsec_cmn_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_ipsec_cmn_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_ipsec_cmn_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipsec_cmn_stats_unregister_notifier); - -/* - * nss_ipsec_cmn_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_ipsec_cmn_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_ipsec_cmn_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipsec_cmn_stats_register_notifier); - -/* - * nss_ipsec_cmn_stats_dentry_create() - * Create ipsec common statistics debug entry. - */ -void nss_ipsec_cmn_stats_dentry_create(void) -{ - nss_stats_create_dentry("ipsec_cmn", &nss_ipsec_cmn_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.h deleted file mode 100644 index 511056802..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_stats.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_IPSEC_CMN_STATS_H -#define __NSS_IPSEC_CMN_STATS_H - -#include - -extern void nss_ipsec_cmn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_ipsec_cmn_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); -extern void nss_ipsec_cmn_stats_dentry_create(void); - -#endif /* __NSS_IPSEC_CMN_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.c deleted file mode 100644 index bf2cff6c5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_ipsec_cmn_strings.h" - -/* - * nss_ipsec_cmn_strings_stats - * ipsec common statistics strings. - */ -struct nss_stats_info nss_ipsec_cmn_strings_stats[NSS_IPSEC_CMN_STATS_MAX] = { - {"rx_pkts", NSS_STATS_TYPE_COMMON}, - {"rx_byts", NSS_STATS_TYPE_COMMON}, - {"tx_pkts", NSS_STATS_TYPE_COMMON}, - {"tx_byts", NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, - {"fail_headroom", NSS_STATS_TYPE_DROP}, - {"fail_tailroom", NSS_STATS_TYPE_DROP}, - {"fail_replay", NSS_STATS_TYPE_DROP}, - {"fail_replay_dup", NSS_STATS_TYPE_DROP}, - {"fail_replay_win", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_crypto", NSS_STATS_TYPE_DROP}, - {"fail_queue", NSS_STATS_TYPE_DROP}, - {"fail_queue_crypto", NSS_STATS_TYPE_DROP}, - {"fail_queue_nexthop", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_alloc", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_linear", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_stats", NSS_STATS_TYPE_DROP}, - {"fail_pbuf_align", NSS_STATS_TYPE_DROP}, - {"fail_cipher", NSS_STATS_TYPE_EXCEPTION}, - {"fail_auth", NSS_STATS_TYPE_EXCEPTION}, - {"fail_seq_ovf", NSS_STATS_TYPE_DROP}, - {"fail_blk_len", NSS_STATS_TYPE_DROP}, - {"fail_hash_len", NSS_STATS_TYPE_DROP}, - {"fail_transform", NSS_STATS_TYPE_DROP}, - {"fail_crypto", NSS_STATS_TYPE_DROP}, - {"fail_cle", NSS_STATS_TYPE_DROP}, - {"is_stopped", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_ipsec_cmn_strings_read() - * Read ipsec common statistics names - */ -static ssize_t nss_ipsec_cmn_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ipsec_cmn_strings_stats, NSS_IPSEC_CMN_STATS_MAX); -} - -/* - * nss_ipsec_cmn_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ipsec_cmn); - -/* - * nss_ipsec_cmn_strings_dentry_create() - * Create ipsec common statistics strings debug entry. - */ -void nss_ipsec_cmn_strings_dentry_create(void) -{ - nss_strings_create_dentry("ipsec_cmn", &nss_ipsec_cmn_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.h deleted file mode 100644 index c22f4c0f1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_cmn_strings.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_IPSEC_CMN_STRINGS_H -#define __NSS_IPSEC_CMN_STRINGS_H - -#include "nss_ipsec_cmn_stats.h" - -extern struct nss_stats_info nss_ipsec_cmn_strings_stats[NSS_IPSEC_CMN_STATS_MAX]; -extern void nss_ipsec_cmn_strings_dentry_create(void); - -#endif /* __NSS_IPSEC_CMN_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_log.c deleted file mode 100644 index 2f1570efb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_log.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipsec_log.c - * NSS IPSEC logger file. - */ - -#include "nss_core.h" - -#define NSS_IPSEC_LOG_IPV4 4 -#define NSS_IPSEC_LOG_IPV6 6 - -/* - * nss_ipsec_log_message_types_str - * IPSEC message strings - */ -static int8_t *nss_ipsec_log_message_types_str[NSS_IPSEC_MSG_TYPE_MAX] __maybe_unused = { - "IPSEC Msg None", - "IPSEC ADD Rule", - "IPSEC DEL Rule", - "IPSEC Flush Tunnel", - "IPSEC SA Stats", - "IPSEC Flow Stats", - "IPSEC Node Stats", - "IPSEC Configure Node", -}; - -/* - * nss_ipsec_log_error_response_types_str - * Strings for error types for IPSEC messages - */ -static int8_t *nss_ipsec_log_error_response_types_str[NSS_IPSEC_ERROR_TYPE_MAX] __maybe_unused = { - "IPSEC No Error", - "IPSEC Hash Duplicate", - "IPSEC Hash Collision", - "IPSEC Unhandled Message", - "IPSEC Invalid Rule", - "IPSEC MAX SA", - "IPSEC MAX Flow", - "IPSEC Invalid CINDEX", - "IPSEC Invalid IP Version", -}; - -/* - * nss_ipsec_log_rule_msg() - * Log NSS IPSEC rule message. - */ -static void nss_ipsec_log_rule_msg(struct nss_ipsec_msg *nim) -{ - struct nss_ipsec_rule *nir __maybe_unused = &nim->msg.rule; - - nss_trace("%px: NSS IPSEC Rule Message:\n" - "IPSEC ESP SPI Index: %dn" - "IPSEC TTL Hop Limit: %dn" - "IPSEC IP Version: %x\n" - "IPSEC Crypto Index: %d\n" - "IPSEC Window Size: %d\n" - "IPSEC Cipher Block Len: %d\n" - "IPSEC Initialization Vector Length: %d\n" - "IPSEC NAT-T Required: %d\n" - "IPSEC ICV Length: %d\n" - "IPSEC Skip Seq Number: %d\n" - "IPSEC Skip ESP Trailer: %d\n" - "IPSEC Use Pattern: %d\n" - "IPSEC Enable Extended Sequence Number: %d\n" - "IPSEC DSCP Value: %d\n" - "IPSEC Don't Fragment Flag: %d\n" - "IPSEC DSCP Copy %d\n" - "IPSEC DF Copy: %d\n" - "IPSEC NSS Index: %d\n" - "IPSEC SA Index: %d\n", - nir, nir->oip.esp_spi, - nir->oip.ttl_hop_limit, nir->oip.ip_ver, - nir->data.crypto_index, nir->data.window_size, - nir->data.cipher_blk_len, nir->data.iv_len, - nir->data.nat_t_req, nir->data.esp_icv_len, - nir->data.esp_seq_skip, nir->data.esp_tail_skip, - nir->data.use_pattern, nir->data.enable_esn, - nir->data.dscp, nir->data.df, - nir->data.copy_dscp, nir->data.copy_df, - nir->index, nir->sa_idx); - - /* - * Continuation of previous log. Different identifiers based on ip_ver - */ - if (nir->oip.ip_ver == NSS_IPSEC_LOG_IPV6) { - nss_trace("IPSEC Destination Address: %pI6\n" - "IPSEC Source Address: %pI6\n", - nir->oip.dst_addr, nir->oip.src_addr); - } else if (nir->oip.ip_ver == NSS_IPSEC_LOG_IPV4) { - nss_trace("IPSEC Destination Address: %pI4\n" - "IPSEC Source Address: %pI4\n", - nir->oip.dst_addr, nir->oip.src_addr); - } -} - -/* - * nss_ipsec_log_configure_node_msg() - * Log NSS IPSEC configure node message. - */ -static void nss_ipsec_log_configure_node_msg(struct nss_ipsec_msg *nim) -{ - struct nss_ipsec_configure_node *nicn __maybe_unused = &nim->msg.node; - nss_trace("%px: NSS IPSEC Configure Node\n" - "IPSEC DMA Redirect: %d\n" - "IPSEC DMA Lookaside: %d\n", - nicn, nicn->dma_redirect, - nicn->dma_lookaside); -} - -/* - * nss_ipsec_log_verbose() - * Log message contents. - */ -static void nss_ipsec_log_verbose(struct nss_ipsec_msg *nim) -{ - switch (nim->cm.type) { - case NSS_IPSEC_MSG_TYPE_ADD_RULE: - case NSS_IPSEC_MSG_TYPE_DEL_RULE: - nss_ipsec_log_rule_msg(nim); - break; - - case NSS_IPSEC_MSG_TYPE_CONFIGURE_NODE: - nss_ipsec_log_configure_node_msg(nim); - break; - - case NSS_IPSEC_MSG_TYPE_NONE: - case NSS_IPSEC_MSG_TYPE_FLUSH_TUN: - case NSS_IPSEC_MSG_TYPE_SYNC_SA_STATS: - case NSS_IPSEC_MSG_TYPE_SYNC_FLOW_STATS: - case NSS_IPSEC_MSG_TYPE_SYNC_NODE_STATS: - /* - * No log for these valid messages. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", nim); - break; - } -} - -/* - * nss_ipsec_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_ipsec_log_tx_msg(struct nss_ipsec_msg *nim) -{ - if (nim->cm.type >= NSS_IPSEC_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", nim); - return; - } - - nss_info("%px: type[%d]:%s\n", nim, nim->cm.type, nss_ipsec_log_message_types_str[nim->cm.type]); - nss_ipsec_log_verbose(nim); -} - -/* - * nss_ipsec_log_rx_msg() - * Log messages received from FW. - */ -void nss_ipsec_log_rx_msg(struct nss_ipsec_msg *nim) -{ - if (nim->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nim); - return; - } - - if (nim->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nim->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nim, nim->cm.type, - nss_ipsec_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response]); - goto verbose; - } - - if (nim->cm.error >= NSS_IPSEC_ERROR_TYPE_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nim, nim->cm.type, nss_ipsec_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nim, nim->cm.type, nss_ipsec_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error, nss_ipsec_log_error_response_types_str[nim->cm.error]); - -verbose: - nss_ipsec_log_verbose(nim); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_log.h deleted file mode 100644 index 5342c208f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipsec_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_IPSEC_LOG_H__ -#define __NSS_IPSEC_LOG_H__ - -/* - * nss_ipsec_log.h - * NSS Crypto Log Header File - */ - -/* - * nss_ipsec_log_tx_msg - * Logs a ipsec message that is sent to the NSS firmware. - */ -void nss_ipsec_log_tx_msg(struct nss_ipsec_msg *nim); - -/* - * nss_ipsec_log_rx_msg - * Logs a ipsec message that is received from the NSS firmware. - */ -void nss_ipsec_log_rx_msg(struct nss_ipsec_msg *nim); - -#endif /* __NSS_IPSEC_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4.c deleted file mode 100644 index e1e045206..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4.c +++ /dev/null @@ -1,782 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipv4.c - * NSS IPv4 APIs - */ -#include -#include "nss_dscp_map.h" -#include "nss_ipv4_stats.h" -#include "nss_ipv4_strings.h" - -#define NSS_IPV4_TX_MSG_TIMEOUT 1000 /* 1 sec timeout for IPv4 messages */ - -/* - * Private data structure for ipv4 configuration - */ -struct nss_ipv4_pvt { - struct semaphore sem; /* Semaphore structure */ - struct completion complete; /* completion structure */ - int response; /* Response from FW */ - void *cb; /* Original cb for sync msgs */ - void *app_data; /* Original app_data for sync msgs */ -} nss_ipv4_pvt; - -/* - * Private data structure for ipv4 connection information. - */ -struct nss_ipv4_conn_table_info { - uint32_t ce_table_size; /* Size of connection table entry in NSS FW */ - uint32_t cme_table_size; /* Size of connection match table entry in NSS FW */ - unsigned long ce_mem; /* Start address for connection entry table */ - unsigned long cme_mem; /* Start address for connection match entry table */ -} nss_ipv4_ct_info; - -int nss_ipv4_conn_cfg = NSS_DEFAULT_NUM_CONN; -int nss_ipv4_accel_mode_cfg __read_mostly = 1; - -static struct nss_dscp_map_entry mapping[NSS_DSCP_MAP_ARRAY_SIZE]; - -/* - * Callback for conn_sync_many request message. - */ -nss_ipv4_msg_callback_t nss_ipv4_conn_sync_many_msg_cb = NULL; - -/* - * nss_ipv4_dscp_map_usage() - * Help function shows the usage of the command. - */ -static inline void nss_ipv4_dscp_map_usage(void) -{ - nss_info_always("\nUsage:\n"); - nss_info_always("echo > /proc/sys/dev/nss/ipv4cfg/ipv4_dscp_map\n\n"); - nss_info_always("dscp[0-63] action[0-%u] prio[0-%u]:\n\n", - NSS_IPV4_DSCP_MAP_ACTION_MAX - 1, - NSS_DSCP_MAP_PRIORITY_MAX - 1); -} - -/* - * nss_ipv4_get_total_conn_count() - * Returns the sum of IPv4 and IPv6 connections. - */ -static uint32_t nss_ipv4_get_total_conn_count(int ipv4_num_conn) -{ - -#ifdef NSS_DRV_IPV6_ENABLE - return ipv4_num_conn + nss_ipv6_conn_cfg; -#else - return ipv4_num_conn; -#endif -} - -/* - * nss_ipv4_rx_msg_handler() - * Handle NSS -> HLOS messages for IPv4 bridge/route - */ -static void nss_ipv4_rx_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_ipv4_msg *nim = (struct nss_ipv4_msg *)ncm; - nss_ipv4_msg_callback_t cb; - - BUG_ON(ncm->interface != NSS_IPV4_RX_INTERFACE); - - /* - * Sanity check the message type - */ - if (ncm->type >= NSS_IPV4_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_ipv4_msg)) { - nss_warning("%px: message length is invalid: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Trace messages. - */ - nss_ipv4_log_rx_msg(nim); - - switch (nim->cm.type) { - case NSS_IPV4_RX_NODE_STATS_SYNC_MSG: - /* - * Update driver statistics on node sync and send statistics notifications to the registered modules. - */ - nss_ipv4_stats_node_sync(nss_ctx, &nim->msg.node_stats); - nss_ipv4_stats_notify(nss_ctx); - break; - - case NSS_IPV4_RX_CONN_STATS_SYNC_MSG: - /* - * Update driver statistics on connection sync. - */ - nss_ipv4_stats_conn_sync(nss_ctx, &nim->msg.conn_stats); - break; - - case NSS_IPV4_TX_CONN_STATS_SYNC_MANY_MSG: - /* - * Update driver statistics on connection sync many. - */ - nss_ipv4_stats_conn_sync_many(nss_ctx, &nim->msg.conn_stats_many); - ncm->cb = (nss_ptr_t)nss_ipv4_conn_sync_many_msg_cb; - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, IPv4 sends all notify messages - * to the same callback/app_data. - */ - if (nim->cm.response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->ipv4_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->nss_top->ipv4_ctx; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_ipv4_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nim); -} - -/* - * nss_ipv4_tx_sync_callback() - * Callback to handle the completion of synchronous tx messages. - */ -static void nss_ipv4_tx_sync_callback(void *app_data, struct nss_ipv4_msg *nim) -{ - nss_ipv4_msg_callback_t callback = (nss_ipv4_msg_callback_t)nss_ipv4_pvt.cb; - void *data = nss_ipv4_pvt.app_data; - - nss_ipv4_pvt.cb = NULL; - nss_ipv4_pvt.app_data = NULL; - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("ipv4 error response %d\n", nim->cm.response); - nss_ipv4_pvt.response = NSS_TX_FAILURE; - } else { - nss_ipv4_pvt.response = NSS_TX_SUCCESS; - } - - if (callback) { - callback(data, nim); - } - - complete(&nss_ipv4_pvt.complete); -} - -/* - * nss_ipv4_dscp_action_get() - * Gets the action mapped to dscp. - */ -enum nss_ipv4_dscp_map_actions nss_ipv4_dscp_action_get(uint8_t dscp) -{ - if (dscp >= NSS_DSCP_MAP_ARRAY_SIZE) { - nss_warning("dscp:%u invalid\n", dscp); - return NSS_IPV4_DSCP_MAP_ACTION_MAX; - } - - return mapping[dscp].action; -} -EXPORT_SYMBOL(nss_ipv4_dscp_action_get); - -/* - * nss_ipv4_max_conn_count() - * Return the maximum number of IPv4 connections that the NSS acceleration engine supports. - */ -int nss_ipv4_max_conn_count(void) -{ - return nss_ipv4_conn_cfg; -} -EXPORT_SYMBOL(nss_ipv4_max_conn_count); - -/* - * nss_ipv4_conn_inquiry() - * Inquiry if a connection has been established in NSS FW - */ -nss_tx_status_t nss_ipv4_conn_inquiry(struct nss_ipv4_5tuple *ipv4_5t_p, - nss_ipv4_msg_callback_t cb) -{ - nss_tx_status_t nss_tx_status; - struct nss_ipv4_msg nim; - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[0]; - - /* - * Initialize inquiry message structure. - * This is async message and the result will be returned - * to the caller by the msg_callback passed in. - */ - memset(&nim, 0, sizeof(nim)); - nss_ipv4_msg_init(&nim, NSS_IPV4_RX_INTERFACE, - NSS_IPV4_TX_CONN_CFG_INQUIRY_MSG, - sizeof(struct nss_ipv4_inquiry_msg), - cb, NULL); - nim.msg.inquiry.rr.tuple = *ipv4_5t_p; - nss_tx_status = nss_ipv4_tx(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Send inquiry message failed\n", ipv4_5t_p); - } - - return nss_tx_status; -} -EXPORT_SYMBOL(nss_ipv4_conn_inquiry); - -/* - * nss_ipv4_tx_with_size() - * Transmit an ipv4 message to the FW with a specified size. - */ -nss_tx_status_t nss_ipv4_tx_with_size(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_msg *nim, uint32_t size) -{ - struct nss_cmn_msg *ncm = &nim->cm; - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_IPV4_RX_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_IPV4_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_ipv4_log_tx_msg(nim); - - return nss_core_send_cmd(nss_ctx, nim, sizeof(*nim), size); -} -EXPORT_SYMBOL(nss_ipv4_tx_with_size); - -/* - * nss_ipv4_tx() - * Transmit an ipv4 message to the FW. - */ -nss_tx_status_t nss_ipv4_tx(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_msg *nim) -{ - return nss_ipv4_tx_with_size(nss_ctx, nim, NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_ipv4_tx); - -/* - * nss_ipv4_tx_sync() - * Transmit a synchronous ipv4 message to the FW. - */ -nss_tx_status_t nss_ipv4_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_msg *nim) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_ipv4_pvt.sem); - nss_ipv4_pvt.cb = (void *)nim->cm.cb; - nss_ipv4_pvt.app_data = (void *)nim->cm.app_data; - - nim->cm.cb = (nss_ptr_t)nss_ipv4_tx_sync_callback; - nim->cm.app_data = (nss_ptr_t)NULL; - - status = nss_ipv4_tx(nss_ctx, nim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss ipv4 msg tx failed\n", nss_ctx); - up(&nss_ipv4_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_ipv4_pvt.complete, msecs_to_jiffies(NSS_IPV4_TX_MSG_TIMEOUT)); - if (!ret) { - nss_warning("%px: IPv4 tx sync failed due to timeout\n", nss_ctx); - nss_ipv4_pvt.response = NSS_TX_FAILURE; - } - - status = nss_ipv4_pvt.response; - up(&nss_ipv4_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_ipv4_tx_sync); - -/* - ********************************** - Register/Unregister/Miscellaneous APIs - ********************************** - */ - -/* - * nss_ipv4_notify_register() - * Register to received IPv4 events. - * - * NOTE: Do we want to pass an nss_ctx here so that we can register for ipv4 on any core? - */ -struct nss_ctx_instance *nss_ipv4_notify_register(nss_ipv4_msg_callback_t cb, void *app_data) -{ - /* - * TODO: We need to have a new array in support of the new API - * TODO: If we use a per-context array, we would move the array into nss_ctx based. - */ - nss_top_main.ipv4_callback = cb; - nss_top_main.ipv4_ctx = app_data; - return &nss_top_main.nss[nss_top_main.ipv4_handler_id]; -} -EXPORT_SYMBOL(nss_ipv4_notify_register); - -/* - * nss_ipv4_notify_unregister() - * Unregister to received IPv4 events. - * - * NOTE: Do we want to pass an nss_ctx here so that we can register for ipv4 on any core? - */ -void nss_ipv4_notify_unregister(void) -{ - nss_top_main.ipv4_callback = NULL; -} -EXPORT_SYMBOL(nss_ipv4_notify_unregister); - -/* - * nss_ipv4_conn_sync_many_notify_register() - * Register to receive IPv4 conn_sync_many message response. - */ -void nss_ipv4_conn_sync_many_notify_register(nss_ipv4_msg_callback_t cb) -{ - nss_ipv4_conn_sync_many_msg_cb = cb; -} -EXPORT_SYMBOL(nss_ipv4_conn_sync_many_notify_register); - -/* - * nss_ipv4_conn_sync_many_notify_unregister() - * Unregister to receive IPv4 conn_sync_many message response. - */ -void nss_ipv4_conn_sync_many_notify_unregister(void) -{ - nss_ipv4_conn_sync_many_msg_cb = NULL; -} -EXPORT_SYMBOL(nss_ipv4_conn_sync_many_notify_unregister); - -/* - * nss_ipv4_get_mgr() - * - * TODO: This only suppports a single ipv4, do we ever want to support more? - */ -struct nss_ctx_instance *nss_ipv4_get_mgr(void) -{ - return (void *)&nss_top_main.nss[nss_top_main.ipv4_handler_id]; -} -EXPORT_SYMBOL(nss_ipv4_get_mgr); - -/* - * nss_ipv4_register_handler() - * Register our handler to receive messages for this interface - */ -void nss_ipv4_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_ipv4_get_mgr(); - - if (nss_core_register_handler(nss_ctx, NSS_IPV4_RX_INTERFACE, nss_ipv4_rx_msg_handler, NULL) != NSS_CORE_STATUS_SUCCESS) { - nss_warning("IPv4 handler failed to register"); - } - - nss_ipv4_stats_dentry_create(); - nss_ipv4_strings_dentry_create(); -} - -/* - * nss_ipv4_conn_cfg_process_callback() - * Call back function for the ipv4 connection configure process - */ -static void nss_ipv4_conn_cfg_process_callback(void *app_data, struct nss_ipv4_msg *nim) -{ - struct nss_ipv4_rule_conn_cfg_msg *nirccm = &nim->msg.rule_conn_cfg; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_ipv4_get_mgr(); - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: IPv4 connection configuration failed with error: %d\n", nss_ctx, nim->cm.error); - nss_core_update_max_ipv4_conn(NSS_FW_DEFAULT_NUM_CONN); - nss_ipv4_free_conn_tables(); - return; - } - - nss_ipv4_conn_cfg = ntohl(nirccm->num_conn); - nss_info("%px: IPv4 connection configuration success: %d\n", nss_ctx, nim->cm.error); -} - -/* - * nss_ipv4_conn_cfg_process() - * Process request to configure number of ipv4 connections - */ -static int nss_ipv4_conn_cfg_process(struct nss_ctx_instance *nss_ctx, int conn) -{ - struct nss_ipv4_msg nim; - struct nss_ipv4_rule_conn_cfg_msg *nirccm; - nss_tx_status_t nss_tx_status; - - if ((!nss_ipv4_ct_info.ce_table_size) || (!nss_ipv4_ct_info.cme_table_size)) { - nss_warning("%px: connection entry or connection match entry table size not available\n", - nss_ctx); - return -EINVAL; - } - - nss_info("%px: IPv4 supported connections: %d\n", nss_ctx, conn); - - nss_ipv4_ct_info.ce_mem = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO, - get_order(nss_ipv4_ct_info.ce_table_size)); - if (!nss_ipv4_ct_info.ce_mem) { - nss_warning("%px: Memory allocation failed for IPv4 Connections: %d\n", - nss_ctx, - conn); - goto fail; - } - - nss_ipv4_ct_info.cme_mem = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO, - get_order(nss_ipv4_ct_info.cme_table_size)); - if (!nss_ipv4_ct_info.ce_mem) { - nss_warning("%px: Memory allocation failed for IPv4 Connections: %d\n", - nss_ctx, - conn); - goto fail; - } - - memset(&nim, 0, sizeof(struct nss_ipv4_msg)); - nss_ipv4_msg_init(&nim, NSS_IPV4_RX_INTERFACE, NSS_IPV4_TX_CONN_CFG_RULE_MSG, - sizeof(struct nss_ipv4_rule_conn_cfg_msg), nss_ipv4_conn_cfg_process_callback, NULL); - - nirccm = &nim.msg.rule_conn_cfg; - nirccm->num_conn = htonl(conn); - nirccm->ce_mem = dma_map_single(nss_ctx->dev, (void *)nss_ipv4_ct_info.ce_mem, nss_ipv4_ct_info.ce_table_size, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, nirccm->ce_mem))) { - nss_warning("%px: DMA mapping failed for virtual address = %px", nss_ctx, (void *)nss_ipv4_ct_info.ce_mem); - goto fail; - } - - nirccm->cme_mem = dma_map_single(nss_ctx->dev, (void *)nss_ipv4_ct_info.cme_mem, nss_ipv4_ct_info.cme_table_size, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, nirccm->cme_mem))) { - nss_warning("%px: DMA mapping failed for virtual address = %px", nss_ctx, (void *)nss_ipv4_ct_info.cme_mem); - goto fail; - } - - nss_tx_status = nss_ipv4_tx(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error setting IPv4 Connections: %d\n", - nss_ctx, - conn); - goto fail; - } - - return 0; - -fail: - nss_ipv4_free_conn_tables(); - return -EINVAL;; -} - -/* - * nss_ipv4_update_conn_count_callback() - * Callback function for the ipv4 get connection info message. - */ -static void nss_ipv4_update_conn_count_callback(void *app_data, struct nss_ipv4_msg *nim) -{ - struct nss_ipv4_rule_conn_get_table_size_msg *nircgts = &nim->msg.size; - struct nss_ctx_instance *nss_ctx = nss_ipv4_get_mgr(); - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: IPv4 fetch connection info failed with error: %d\n", nss_ctx, nim->cm.error); - nss_core_update_max_ipv4_conn(NSS_FW_DEFAULT_NUM_CONN); - return; - } - - nss_info("IPv4 get connection info success\n"); - - nss_ipv4_ct_info.ce_table_size = ntohl(nircgts->ce_table_size); - nss_ipv4_ct_info.cme_table_size = ntohl(nircgts->cme_table_size); - - if (nss_ipv4_conn_cfg_process(nss_ctx, ntohl(nircgts->num_conn)) != 0) { - nss_warning("%px: IPv4 connection entry or connection match entry table size\ - not available\n", nss_ctx); - } - - return; -} - -/* - * nss_ipv4_update_conn_count() - * Sets the maximum number of IPv4 connections. - * - * It first gets the connection tables size information from NSS FW - * and then configures the connections in NSS FW. - */ -int nss_ipv4_update_conn_count(int ipv4_num_conn) -{ - struct nss_ctx_instance *nss_ctx = nss_ipv4_get_mgr(); - struct nss_ipv4_msg nim; - struct nss_ipv4_rule_conn_get_table_size_msg *nircgts; - nss_tx_status_t nss_tx_status; - uint32_t sum_of_conn; - - /* - * By default, NSS FW is configured with default number of connections. - */ - if (ipv4_num_conn == NSS_FW_DEFAULT_NUM_CONN) { - nss_info("%px: Default number of connections (%d) already configured\n", nss_ctx, ipv4_num_conn); - return 0; - } - - /* - * The input should be multiple of 1024. - * Input for ipv4 and ipv6 sum together should not exceed 8k - * Min. value should be at least 256 connections. This is the - * minimum connections we will support for each of them. - */ - sum_of_conn = nss_ipv4_get_total_conn_count(ipv4_num_conn); - - if ((ipv4_num_conn & NSS_NUM_CONN_QUANTA_MASK) || - (sum_of_conn > NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6) || - (ipv4_num_conn < NSS_MIN_NUM_CONN)) { - nss_warning("%px: input supported connections (%d) does not adhere\ - specifications\n1) not multiple of 1024,\n2) is less than \ - min val: %d, OR\n IPv4/6 total exceeds %d\n", - nss_ctx, - ipv4_num_conn, - NSS_MIN_NUM_CONN, - NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6); - return -EINVAL; - } - - memset(&nim, 0, sizeof(struct nss_ipv4_msg)); - nss_ipv4_msg_init(&nim, NSS_IPV4_RX_INTERFACE, NSS_IPV4_TX_CONN_TABLE_SIZE_MSG, - sizeof(struct nss_ipv4_rule_conn_get_table_size_msg), nss_ipv4_update_conn_count_callback, NULL); - - nircgts = &nim.msg.size; - nircgts->num_conn = htonl(ipv4_num_conn); - nss_tx_status = nss_ipv4_tx(nss_ctx, &nim); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Send fetch connection info message failed\n", nss_ctx); - return -EINVAL; - } - - return 0; -} - -/* - * nss_ipv4_free_conn_tables() - * Frees memory allocated for connection tables - */ -void nss_ipv4_free_conn_tables(void) -{ - if (nss_ipv4_ct_info.ce_mem) { - free_pages(nss_ipv4_ct_info.ce_mem, get_order(nss_ipv4_ct_info.ce_table_size)); - } - - if (nss_ipv4_ct_info.cme_mem) { - free_pages(nss_ipv4_ct_info.cme_mem, get_order(nss_ipv4_ct_info.cme_table_size)); - } - - memset(&nss_ipv4_ct_info, 0, sizeof(struct nss_ipv4_conn_table_info)); - return; -} - -/* - * nss_ipv4_accel_mode_cfg_handler() - * Configure acceleration mode for IPv4 - */ -static int nss_ipv4_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - struct nss_ipv4_msg nim; - struct nss_ipv4_accel_mode_cfg_msg *nipcm; - nss_tx_status_t nss_tx_status; - int ret = NSS_FAILURE; - int current_value; - - /* - * Take snap shot of current value - */ - current_value = nss_ipv4_accel_mode_cfg; - - /* - * Write the variable with user input - */ - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret || (!write)) { - return ret; - } - - memset(&nim, 0, sizeof(struct nss_ipv4_msg)); - nss_ipv4_msg_init(&nim, NSS_IPV4_RX_INTERFACE, NSS_IPV4_TX_ACCEL_MODE_CFG_MSG, - sizeof(struct nss_ipv4_accel_mode_cfg_msg), NULL, NULL); - - nipcm = &nim.msg.accel_mode_cfg; - nipcm->mode = htonl(nss_ipv4_accel_mode_cfg); - - nss_tx_status = nss_ipv4_tx_sync(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Send acceleration mode message failed\n", nss_ctx); - nss_ipv4_accel_mode_cfg = current_value; - return -EIO; - } - - return 0; -} - -/* - * nss_ipv4_dscp_map_cfg_handler() - * Sysctl handler for dscp/pri mappings. - */ -static int nss_ipv4_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - struct nss_dscp_map_parse out; - struct nss_ipv4_msg nim; - struct nss_ipv4_dscp2pri_cfg_msg *nipd2p; - nss_tx_status_t status; - int ret; - - if (!write) { - return nss_dscp_map_print(ctl, buffer, lenp, ppos, mapping); - } - - ret = nss_dscp_map_parse(ctl, buffer, lenp, ppos, &out); - if (ret) { - nss_warning("failed to parse dscp mapping:%d\n", ret); - nss_ipv4_dscp_map_usage(); - return ret; - } - - if (out.action >= NSS_IPV4_DSCP_MAP_ACTION_MAX) { - nss_warning("invalid action value: %d\n", out.action); - nss_ipv4_dscp_map_usage(); - return -EINVAL; - } - - memset(&nim, 0, sizeof(struct nss_ipv4_msg)); - nss_ipv4_msg_init(&nim, NSS_IPV4_RX_INTERFACE, NSS_IPV4_TX_DSCP2PRI_CFG_MSG, - sizeof(struct nss_ipv4_dscp2pri_cfg_msg), NULL, NULL); - - nipd2p = &nim.msg.dscp2pri_cfg; - nipd2p->dscp = out.dscp; - nipd2p->priority = out.priority; - - status = nss_ipv4_tx_sync(nss_ctx, &nim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: ipv4 dscp2pri config message failed\n", nss_ctx); - return -EFAULT; - } - - /* - * NSS firmware acknowleged the configuration, so update the mapping - * table on HOST side as well. - */ - mapping[out.dscp].action = out.action; - mapping[out.dscp].priority = out.priority; - - return 0; -} - -static struct ctl_table nss_ipv4_table[] = { - { - .procname = "ipv4_accel_mode", - .data = &nss_ipv4_accel_mode_cfg, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_ipv4_accel_mode_cfg_handler, - }, - { - .procname = "ipv4_dscp_map", - .data = &mapping[NSS_DSCP_MAP_ARRAY_SIZE], - .maxlen = sizeof(struct nss_dscp_map_entry), - .mode = 0644, - .proc_handler = &nss_ipv4_dscp_map_cfg_handler, - }, - { } -}; - -static struct ctl_table nss_ipv4_dir[] = { - { - .procname = "ipv4cfg", - .mode = 0555, - .child = nss_ipv4_table, - }, - { } -}; - -static struct ctl_table nss_ipv4_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_ipv4_dir, - }, - { } -}; - -static struct ctl_table nss_ipv4_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_ipv4_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_ipv4_header; - -/* - * nss_ipv4_register_sysctl() - * Register sysctl specific to ipv4 - */ -void nss_ipv4_register_sysctl(void) -{ - sema_init(&nss_ipv4_pvt.sem, 1); - init_completion(&nss_ipv4_pvt.complete); - - /* - * Register sysctl table. - */ - nss_ipv4_header = register_sysctl_table(nss_ipv4_root); -} - -/* - * nss_ipv4_unregister_sysctl() - * Unregister sysctl specific to ipv4 - */ -void nss_ipv4_unregister_sysctl(void) -{ - /* - * Unregister sysctl table. - */ - if (nss_ipv4_header) { - unregister_sysctl_table(nss_ipv4_header); - } -} - -/* - * nss_ipv4_msg_init() - * Initialize IPv4 message. - */ -void nss_ipv4_msg_init(struct nss_ipv4_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, - nss_ipv4_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nim->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_ipv4_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_log.c deleted file mode 100644 index 08414051d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_log.c +++ /dev/null @@ -1,355 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016, 2018, 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipv4_log.c - * NSS IPv4 logger file. - */ - -#include "nss_core.h" - -/* - * nss_ipv4_log_message_types_str - * IPv4 bridge/route rule message strings - */ -static int8_t *nss_ipv4_log_message_types_str[NSS_IPV4_MAX_MSG_TYPES] __maybe_unused = { - "IPv4 create rule message", - "IPv4 destroy rule message", - "Deprecated: NSS_IPV4_RX_ESTABLISH_RULE_MSG", - "IPv4 connection stats sync message", - "IPv4 generic statistics sync message", - "IPv4 number of connections supported rule message", - "IPv4 multicast create rule message", - "IPv4 request FW to send many conn sync message", -}; - -/* - * nss_ipv4_log_error_response_types_str - * Strings for error types for ipv4 messages - */ -static int8_t *nss_ipv4_log_error_response_types_str[NSS_IPV4_LAST] __maybe_unused = { - "No error", - "Unknown error", - "Invalid interface number", - "Missing connection rule", - "Buffer allocation failure", - "No connection found to delete", - "Conn cfg already done once", - "Conn cfg input is not multiple of quanta", - "Conn cfg input exceeds max supported connections", - "Conn cfg mem alloc fail at NSS FW", - "Invalid L4 protocol for multicast rule create", - "Invalid multicast flags for multicast update", - "Invalid interface for multicast update", -}; - -/* - * nss_ipv4_log_rule_create_msg() - * Log IPv4 create rule message. - */ -static void nss_ipv4_log_rule_create_msg(struct nss_ipv4_msg *nim) -{ - struct nss_ipv4_rule_create_msg *nircm __maybe_unused = &nim->msg.rule_create; - nss_trace("%px: IPv4 create rule message \n" - "Protocol: %d\n" - "from_mtu: %u\n" - "to_mtu: %u\n" - "from_ip: %pI4h:%d\n" - "to_ip: %pI4h:%d\n" - "from_ip_xlate: %pI4h:%d\n" - "to_ip_xlate: %pI4h:%d\n" - "from_mac: %pM\n" - "to_mac: %pM\n" - "src_iface_num: %u\n" - "dest_iface_num: %u\n" - "ingress_inner_vlan_tag: %u\n" - "egress_inner_vlan_tag: %u\n" - "ingress_outer_vlan_tag: %u\n" - "egress_outer_vlan_tag: %u\n" - "rule_flags: %x\n" - "valid_flags: %x\n" - "return_pppoe_if_exist: %u\n" - "return_pppoe_if_num: %u\n" - "flow_pppoe_if_exist: %u\n" - "flow_pppoe_if_num: %u\n" - "flow_qos_tag: %x (%u)\n" - "return_qos_tag: %x (%u)\n" - "flow_dscp: %x\n" - "return_dscp: %x\n" - "flow_mirror_ifnum: %u\n" - "return_mirror_ifnum: %u\n", - nim, - nircm->tuple.protocol, - nircm->conn_rule.flow_mtu, - nircm->conn_rule.return_mtu, - &nircm->tuple.flow_ip, nircm->tuple.flow_ident, - &nircm->tuple.return_ip, nircm->tuple.return_ident, - &nircm->conn_rule.flow_ip_xlate, nircm->conn_rule.flow_ident_xlate, - &nircm->conn_rule.return_ip_xlate, nircm->conn_rule.return_ident_xlate, - nircm->conn_rule.flow_mac, - nircm->conn_rule.return_mac, - nircm->conn_rule.flow_interface_num, - nircm->conn_rule.return_interface_num, - nircm->vlan_primary_rule.ingress_vlan_tag, - nircm->vlan_primary_rule.egress_vlan_tag, - nircm->vlan_secondary_rule.ingress_vlan_tag, - nircm->vlan_secondary_rule.egress_vlan_tag, - nircm->rule_flags, - nircm->valid_flags, - nircm->pppoe_rule.return_if_exist, - nircm->pppoe_rule.return_if_num, - nircm->pppoe_rule.flow_if_exist, - nircm->pppoe_rule.flow_if_num, - nircm->qos_rule.flow_qos_tag, nircm->qos_rule.flow_qos_tag, - nircm->qos_rule.return_qos_tag, nircm->qos_rule.return_qos_tag, - nircm->dscp_rule.flow_dscp, - nircm->dscp_rule.return_dscp, - nircm->mirror_rule.flow_ifnum, - nircm->mirror_rule.return_ifnum); -} - -/* - * nss_ipv4_log_destroy_rule_msg() - * Log IPv4 destroy rule message. - */ -static void nss_ipv4_log_destroy_rule_msg(struct nss_ipv4_msg *nim) -{ - struct nss_ipv4_rule_destroy_msg *nirdm __maybe_unused = &nim->msg.rule_destroy; - nss_trace("%px: IPv4 destroy rule message: \n" - "flow_ip: %pI4h:%d\n" - "return_ip: %pI4h:%d\n" - "protocol: %d\n", - nim, - &nirdm->tuple.flow_ip, nirdm->tuple.flow_ident, - &nirdm->tuple.return_ip, nirdm->tuple.return_ident, - nirdm->tuple.protocol); -} - -/* - * nss_ipv4_log_conn_sync() - * Log IPv4 connection stats sync message. - */ -static void nss_ipv4_log_conn_sync(struct nss_ipv4_msg *nim) -{ - struct nss_ipv4_conn_sync *sync = &nim->msg.conn_stats; - if (sync->flow_tx_packet_count || sync->return_tx_packet_count) { - nss_trace("%px: IPv4 connection stats sync message: \n" - "Protocol: %d\n" - "src_addr: %pI4h:%d\n" - "dest_addr: %pI4h:%d\n" - "flow_rx_packet_count: %u\n" - "flow_rx_byte_count: %u\n" - "return_rx_packet_count: %u\n" - "return_rx_byte_count: %u\n" - "flow_tx_packet_count: %u\n" - "flow_tx_byte_count: %u\n" - "return_tx_packet_count: %u\n" - "return_tx_byte_count: %u\n", - nim, - (int)sync->protocol, - &sync->flow_ip, (int)sync->flow_ident, - &sync->return_ip_xlate, (int)sync->return_ident_xlate, - sync->flow_rx_packet_count, - sync->flow_rx_byte_count, - sync->return_rx_packet_count, - sync->return_rx_byte_count, - sync->flow_tx_packet_count, - sync->flow_tx_byte_count, - sync->return_tx_packet_count, - sync->return_tx_byte_count); - } -} - -/* - * nss_ipv4_log_conn_cfg_msg() - * Log IPv4 number of connections supported rule message. - */ -static void nss_ipv4_log_conn_cfg_msg(struct nss_ipv4_msg *nim) -{ - struct nss_ipv4_rule_conn_cfg_msg *nirccm __maybe_unused = &nim->msg.rule_conn_cfg; - nss_trace("%px: IPv4 number of connections supported rule message: \n" - "num_conn: %d\n", - nim, - nirccm->num_conn); -} - -/* - * nss_ipv4_log_mc_rule_create_msg() - * Log IPv4 multicast create rule message. - */ -static void nss_ipv4_log_mc_rule_create_msg(struct nss_ipv4_msg *nim) -{ - uint16_t vif; - struct nss_ipv4_mc_rule_create_msg *nimrcm = &nim->msg.mc_rule_create; - for (vif = 0; vif < nimrcm->if_count ; vif++) { - nss_trace("%px: IPv4 multicast create rule message \n" - "Rule flag: %x\n" - "Vif: %d\n" - "Protocol: %d\n" - "to_mtu: %u\n" - "from_ip: %pI4h:%d\n" - "to_ip: %pI4h:%d\n" - "to_mac: %pM\n" - "dest_iface_num: %u\n" - "out_vlan[0] %x\n" - "out_vlan[1] %x\n", - nim, - nimrcm->if_rule[vif].rule_flags, - vif, - nimrcm->tuple.protocol, - nimrcm->if_rule[vif].if_mtu, - &nimrcm->tuple.flow_ip, nimrcm->tuple.flow_ident, - &nimrcm->tuple.return_ip, nimrcm->tuple.return_ident, - nimrcm->if_rule[vif].if_mac, - nimrcm->if_rule[vif].if_num, - nimrcm->if_rule[vif].egress_vlan_tag[0], - nimrcm->if_rule[vif].egress_vlan_tag[1]); - } -} - -/* - * nss_ipv4_log_conn_sync_many_msg() - * Log IPv4 many conn sync message. - */ -static void nss_ipv4_log_conn_sync_many_msg(struct nss_ipv4_msg *nim) -{ - uint16_t i; - struct nss_ipv4_conn_sync_many_msg *nicsm = &nim->msg.conn_stats_many; - for (i = 0; i < nicsm->count; i++) { - struct nss_ipv4_conn_sync *sync = &nicsm->conn_sync[i]; - if (sync->flow_tx_packet_count || sync->return_tx_packet_count) { - nss_trace("%px: IPv4 many conn sync message \n" - "count: %d\n" - "i: %d\n" - "Protocol: %d\n" - "src_addr: %pI4h:%d\n" - "dest_addr: %pI4h:%d\n" - "flow_rx_packet_count: %u\n" - "flow_rx_byte_count: %u\n" - "return_rx_packet_count: %u\n" - "return_rx_byte_count: %u\n" - "flow_tx_packet_count: %u\n" - "flow_tx_byte_count: %u\n" - "return_tx_packet_count: %u\n" - "return_tx_byte_count: %u\n", - nim, - nicsm->count, - i, - (int)sync->protocol, - &sync->flow_ip, (int)sync->flow_ident, - &sync->return_ip_xlate, (int)sync->return_ident_xlate, - sync->flow_rx_packet_count, - sync->flow_rx_byte_count, - sync->return_rx_packet_count, - sync->return_rx_byte_count, - sync->flow_tx_packet_count, - sync->flow_tx_byte_count, - sync->return_tx_packet_count, - sync->return_tx_byte_count); - } - } -} - -/* - * nss_ipv4_log_verbose() - * Log message contents. - */ -static void nss_ipv4_log_verbose(struct nss_ipv4_msg *nim) -{ - switch (nim->cm.type) { - case NSS_IPV4_TX_CREATE_RULE_MSG: - nss_ipv4_log_rule_create_msg(nim); - break; - - case NSS_IPV4_TX_DESTROY_RULE_MSG: - nss_ipv4_log_destroy_rule_msg(nim); - break; - - case NSS_IPV4_RX_CONN_STATS_SYNC_MSG: - nss_ipv4_log_conn_sync(nim); - break; - - case NSS_IPV4_RX_NODE_STATS_SYNC_MSG: - /* Getting logged in stats */ - break; - - case NSS_IPV4_TX_CONN_CFG_RULE_MSG: - nss_ipv4_log_conn_cfg_msg(nim); - break; - - case NSS_IPV4_TX_CREATE_MC_RULE_MSG: - nss_ipv4_log_mc_rule_create_msg(nim); - break; - - case NSS_IPV4_TX_CONN_STATS_SYNC_MANY_MSG: - nss_ipv4_log_conn_sync_many_msg(nim); - break; - - default: - nss_trace("%px: Invalid message type\n", nim); - break; - } -} - -/* - * nss_ipv4_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_ipv4_log_tx_msg(struct nss_ipv4_msg *nim) -{ - if (nim->cm.type >= NSS_IPV4_MAX_MSG_TYPES) { - nss_info("%px: Invalid message type\n", nim); - return; - } - - nss_info("%px: type[%d]:%s\n", nim, nim->cm.type, nss_ipv4_log_message_types_str[nim->cm.type]); - nss_ipv4_log_verbose(nim); -} - -/* - * nss_ipv4_log_rx_msg() - * Log messages received from FW. - */ -void nss_ipv4_log_rx_msg(struct nss_ipv4_msg *nim) -{ - if (nim->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_info("%px: Invalid response\n", nim); - return; - } - - if (nim->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nim->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nim, nim->cm.type, - nss_ipv4_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response]); - goto verbose; - } - - if (nim->cm.error >= NSS_IPV4_LAST) { - nss_info("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nim, nim->cm.type, nss_ipv4_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error); - goto verbose; - } - - nss_info("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nim, nim->cm.type, nss_ipv4_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error, nss_ipv4_log_error_response_types_str[nim->cm.error]); - -verbose: - nss_ipv4_log_verbose(nim); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm.c deleted file mode 100644 index 402a46c4a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014,2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipv4_reasm.c - * NSS IPv4 Reassembly APIs - */ -#include -#include "nss_ipv4_reasm_stats.h" -#include "nss_ipv4_reasm_strings.h" - -/* - * nss_ipv4_reasm_msg_handler() - * Handle NSS -> HLOS messages for IPv4 reasm - */ -static void nss_ipv4_reasm_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_ipv4_reasm_msg *nim = (struct nss_ipv4_reasm_msg *)ncm; - - BUG_ON(ncm->interface != NSS_IPV4_REASM_INTERFACE); - - /* - * Handle deprecated messages. Eventually these messages should be removed. - */ - switch (nim->cm.type) { - case NSS_IPV4_REASM_STATS_SYNC_MSG: - /* - * Update Ipv4 reasm driver statistics and send statistics notifications to the registered modules. - */ - nss_ipv4_reasm_stats_sync(nss_ctx, &nim->msg.stats_sync); - nss_ipv4_reasm_stats_notify(nss_ctx); - - break; - default: - nss_warning("IPv4 reasm received an unknown message type"); - } -} - -/* - * nss_ipv4_reasm_get_context() - * get NSS context instance for ipv4 reassembly - */ -struct nss_ctx_instance *nss_ipv4_reasm_get_context(void) -{ - return &nss_top_main.nss[nss_top_main.ipv4_reasm_handler_id]; -} -EXPORT_SYMBOL(nss_ipv4_reasm_get_context); - -/* - * nss_ipv4_reasm_register_handler() - * Register our handler to receive messages for this interface - */ -void nss_ipv4_reasm_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_ipv4_reasm_get_context(); - - if (nss_core_register_handler(nss_ctx, NSS_IPV4_REASM_INTERFACE, nss_ipv4_reasm_msg_handler, NULL) != NSS_CORE_STATUS_SUCCESS) { - nss_warning("IPv4 reasm handler failed to register"); - } - - nss_ipv4_reasm_stats_dentry_create(); - nss_ipv4_reasm_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_stats.c deleted file mode 100644 index 350e61962..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_stats.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_ipv4_reasm_stats.h" -#include "nss_ipv4_reasm.h" -#include "nss_ipv4_reasm_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_ipv4_reasm_stats_notifier); - -uint64_t nss_ipv4_reasm_stats[NSS_IPV4_REASM_STATS_MAX]; /* IPv4 reasm statistics */ - -/* - * nss_ipv4_reasm_stats_read() - * Read IPV4 reassembly stats - */ -static ssize_t nss_ipv4_reasm_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * Max output lines = #stats + few blank lines for banner printing + - * Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_IPV4_REASM_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_IPV4_REASM_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipv4_reasm", NSS_STATS_SINGLE_CORE); - - size_wr += nss_stats_fill_common_stats(NSS_IPV4_REASM_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "ipv4_reasm"); - - /* - * IPv4 reasm node stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_IPV4_REASM_STATS_MAX); i++) { - stats_shadow[i] = nss_ipv4_reasm_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("ipv4_reasm", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_ipv4_reasm_strings_stats - , stats_shadow - , NSS_IPV4_REASM_STATS_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_ipv4_reasm_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ipv4_reasm); - -/* - * nss_ipv4_reasm_stats_dentry_create() - * Create the IPv4 reasm statistics debug entry - */ -void nss_ipv4_reasm_stats_dentry_create(void) -{ - nss_stats_create_dentry("ipv4_reasm", &nss_ipv4_reasm_stats_ops); -} - -/* - * nss_ipv4_reasm_stats_sync() - * Update driver specific information from the messsage. - */ -void nss_ipv4_reasm_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_reasm_stats_sync *nirs) -{ - int i; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Common node stats - */ - nss_top->stats_node[NSS_IPV4_REASM_INTERFACE][NSS_STATS_NODE_RX_PKTS] += nirs->node_stats.rx_packets; - nss_top->stats_node[NSS_IPV4_REASM_INTERFACE][NSS_STATS_NODE_RX_BYTES] += nirs->node_stats.rx_bytes; - nss_top->stats_node[NSS_IPV4_REASM_INTERFACE][NSS_STATS_NODE_TX_PKTS] += nirs->node_stats.tx_packets; - nss_top->stats_node[NSS_IPV4_REASM_INTERFACE][NSS_STATS_NODE_TX_BYTES] += nirs->node_stats.tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_top->stats_node[NSS_IPV4_REASM_INTERFACE][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += nirs->node_stats.rx_dropped[i]; - } - - /* - * IPv4 reasm node stats - */ - nss_ipv4_reasm_stats[NSS_IPV4_REASM_STATS_EVICTIONS] += nirs->ipv4_reasm_evictions; - nss_ipv4_reasm_stats[NSS_IPV4_REASM_STATS_ALLOC_FAILS] += nirs->ipv4_reasm_alloc_fails; - nss_ipv4_reasm_stats[NSS_IPV4_REASM_STATS_TIMEOUTS] += nirs->ipv4_reasm_timeouts; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_ipv4_reasm_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_ipv4_reasm_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_ipv4_reasm_stats_notification ipv4_reasm_stats; - - ipv4_reasm_stats.core_id = nss_ctx->id; - memcpy(ipv4_reasm_stats.cmn_node_stats, nss_top_main.stats_node[NSS_IPV4_REASM_INTERFACE], sizeof(ipv4_reasm_stats.cmn_node_stats)); - memcpy(ipv4_reasm_stats.ipv4_reasm_stats, nss_ipv4_reasm_stats, sizeof(ipv4_reasm_stats.ipv4_reasm_stats)); - atomic_notifier_call_chain(&nss_ipv4_reasm_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&ipv4_reasm_stats); -} - -/* - * nss_ipv4_reasm_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_ipv4_reasm_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_ipv4_reasm_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipv4_reasm_stats_register_notifier); - -/* - * nss_ipv4_reasm_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_ipv4_reasm_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_ipv4_reasm_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipv4_reasm_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_stats.h deleted file mode 100644 index f8c5f39f3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_stats.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IPV4_REASM_STATS_H -#define __NSS_IPV4_REASM_STATS_H - -/* - * IPV4 reasm statistics APIs - */ -extern void nss_ipv4_reasm_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_ipv4_reasm_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_reasm_stats_sync *nirs); -extern void nss_ipv4_reasm_stats_dentry_create(void); - -#endif /* __NSS_IPV4_REASM_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_strings.c deleted file mode 100644 index 445d1349d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_strings.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_ipv4_reasm_strings_stats - * IPv4 reassembly statistics strings. - */ -struct nss_stats_info nss_ipv4_reasm_strings_stats[NSS_IPV4_REASM_STATS_MAX] = { - {"evictions" , NSS_STATS_TYPE_DROP}, - {"alloc_fails" , NSS_STATS_TYPE_DROP}, - {"timeouts" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_ipv4_reasm_strings_read() - * Read IPv4 reassembly node statistics names. - */ -static ssize_t nss_ipv4_reasm_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ipv4_reasm_strings_stats, NSS_IPV4_REASM_STATS_MAX); -} - -/* - * nss_ipv4_reasm_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ipv4_reasm); - -/* - * nss_ipv4_reasm_strings_dentry_create() - * Create IPv4 reassembly statistics strings debug entry. - */ -void nss_ipv4_reasm_strings_dentry_create(void) -{ - nss_strings_create_dentry("ipv4_reasm", &nss_ipv4_reasm_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_strings.h deleted file mode 100644 index 9a0b362c2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_reasm_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IPV4_REASM_STRINGS_H -#define __NSS_IPV4_REASM_STRINGS_H - -extern struct nss_stats_info nss_ipv4_reasm_strings_stats[NSS_IPV4_REASM_STATS_MAX]; -extern void nss_ipv4_reasm_strings_dentry_create(void); - -#endif /* __NSS_IPV4_REASM_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.c deleted file mode 100644 index 39b162c7e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include -#include "nss_ipv4_stats.h" -#include "nss_ipv4_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_ipv4_stats_notifier); - -uint64_t nss_ipv4_stats[NSS_IPV4_STATS_MAX]; -uint64_t nss_ipv4_exception_stats[NSS_IPV4_EXCEPTION_EVENT_MAX]; - -/* - * nss_ipv4_stats_read() - * Read IPV4 stats - */ -static ssize_t nss_ipv4_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + Number of Extra outputlines for future reference to add new stats + - * start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_IPV4_STATS_MAX + NSS_IPV4_EXCEPTION_EVENT_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Note: The assumption here is that exception event count is larger than other statistics count for IPv4 - */ - stats_shadow = kzalloc(NSS_IPV4_EXCEPTION_EVENT_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipv4", NSS_STATS_SINGLE_CORE); - size_wr += nss_stats_fill_common_stats(NSS_IPV4_RX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "ipv4"); - - /* - * IPv4 node stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_IPV4_STATS_MAX; i++) { - stats_shadow[i] = nss_ipv4_stats[i]; - } - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("ipv4", "ipv4 special stats" - , NSS_STATS_SINGLE_INSTANCE - , nss_ipv4_strings_stats - , stats_shadow - , NSS_IPV4_STATS_MAX - , lbuf, size_wr, size_al); - - /* - * Exception stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_IPV4_EXCEPTION_EVENT_MAX); i++) { - stats_shadow[i] = nss_ipv4_exception_stats[i]; - } - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("ipv4", "ipv4 exception stats" - , NSS_STATS_SINGLE_INSTANCE - , nss_ipv4_strings_exception_stats - , stats_shadow - , NSS_IPV4_EXCEPTION_EVENT_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_ipv4_stats_conn_sync() - * Update driver specific information from the messsage. - */ -void nss_ipv4_stats_conn_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_conn_sync *nirs) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - /* - * Update statistics maintained by NSS driver - */ - spin_lock_bh(&nss_top->stats_lock); - nss_ipv4_stats[NSS_IPV4_STATS_ACCELERATED_RX_PKTS] += nirs->flow_rx_packet_count + nirs->return_rx_packet_count; - nss_ipv4_stats[NSS_IPV4_STATS_ACCELERATED_RX_BYTES] += nirs->flow_rx_byte_count + nirs->return_rx_byte_count; - nss_ipv4_stats[NSS_IPV4_STATS_ACCELERATED_TX_PKTS] += nirs->flow_tx_packet_count + nirs->return_tx_packet_count; - nss_ipv4_stats[NSS_IPV4_STATS_ACCELERATED_TX_BYTES] += nirs->flow_tx_byte_count + nirs->return_tx_byte_count; - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_ipv4_stats_conn_sync_many() - * Update driver specific information from the conn_sync_many messsage. - */ -void nss_ipv4_stats_conn_sync_many(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_conn_sync_many_msg *nicsm) -{ - int i; - - /* - * Sanity check for the stats count - */ - if (nicsm->count * sizeof(struct nss_ipv4_conn_sync) >= nicsm->size) { - nss_warning("%px: stats sync count %u exceeds the size of this msg %u", nss_ctx, nicsm->count, nicsm->size); - return; - } - - for (i = 0; i < nicsm->count; i++) { - nss_ipv4_stats_conn_sync(nss_ctx, &nicsm->conn_sync[i]); - } -} - -/* - * nss_ipv4_stats_node_sync() - * Update driver specific information from the messsage. - */ -void nss_ipv4_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_node_sync *nins) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - uint32_t i; - - /* - * Update statistics maintained by NSS driver - */ - spin_lock_bh(&nss_top->stats_lock); - nss_top->stats_node[NSS_IPV4_RX_INTERFACE][NSS_STATS_NODE_RX_PKTS] += nins->node_stats.rx_packets; - nss_top->stats_node[NSS_IPV4_RX_INTERFACE][NSS_STATS_NODE_RX_BYTES] += nins->node_stats.rx_bytes; - nss_top->stats_node[NSS_IPV4_RX_INTERFACE][NSS_STATS_NODE_TX_PKTS] += nins->node_stats.tx_packets; - nss_top->stats_node[NSS_IPV4_RX_INTERFACE][NSS_STATS_NODE_TX_BYTES] += nins->node_stats.tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_top->stats_node[NSS_IPV4_RX_INTERFACE][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += nins->node_stats.rx_dropped[i]; - } - - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_REQUESTS] += nins->ipv4_connection_create_requests; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_COLLISIONS] += nins->ipv4_connection_create_collisions; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_INTERFACE] += nins->ipv4_connection_create_invalid_interface; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_DESTROY_REQUESTS] += nins->ipv4_connection_destroy_requests; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_DESTROY_MISSES] += nins->ipv4_connection_destroy_misses; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_HASH_HITS] += nins->ipv4_connection_hash_hits; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_HASH_REORDERS] += nins->ipv4_connection_hash_reorders; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_FLUSHES] += nins->ipv4_connection_flushes; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_EVICTIONS] += nins->ipv4_connection_evictions; - nss_ipv4_stats[NSS_IPV4_STATS_FRAGMENTATIONS] += nins->ipv4_fragmentations; - nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_CREATE_REQUESTS] += nins->ipv4_mc_connection_create_requests; - nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_UPDATE_REQUESTS] += nins->ipv4_mc_connection_update_requests; - nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_CREATE_INVALID_INTERFACE] += nins->ipv4_mc_connection_create_invalid_interface; - nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv4_mc_connection_destroy_requests; - nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_DESTROY_MISSES] += nins->ipv4_mc_connection_destroy_misses; - nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_FLUSHES] += nins->ipv4_mc_connection_flushes; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM] += nins->ipv4_connection_create_invalid_mirror_ifnum; - nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE] += nins->ipv4_connection_create_invalid_mirror_iftype; - nss_ipv4_stats[NSS_IPV4_STATS_MIRROR_FAILURES] += nins->ipv4_mirror_failures; - - for (i = 0; i < NSS_IPV4_EXCEPTION_EVENT_MAX; i++) { - nss_ipv4_exception_stats[i] += nins->exception_events[i]; - } - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_ipv4_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ipv4); - -/* - * nss_ipv4_stats_dentry_create() - * Create IPv4 statistics debug entry. - */ -void nss_ipv4_stats_dentry_create(void) -{ - nss_stats_create_dentry("ipv4", &nss_ipv4_stats_ops); -} - -/* - * nss_ipv4_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_ipv4_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_ipv4_stats_notification ipv4_stats; - - ipv4_stats.core_id = nss_ctx->id; - memcpy(ipv4_stats.cmn_node_stats, nss_top_main.stats_node[NSS_IPV4_RX_INTERFACE], sizeof(ipv4_stats.cmn_node_stats)); - memcpy(ipv4_stats.special_stats, nss_ipv4_stats, sizeof(ipv4_stats.special_stats)); - memcpy(ipv4_stats.exception_stats, nss_ipv4_exception_stats, sizeof(ipv4_stats.exception_stats)); - atomic_notifier_call_chain(&nss_ipv4_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&ipv4_stats); -} - -/* - * nss_ipv4_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_ipv4_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_ipv4_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipv4_stats_register_notifier); - -/* - * nss_ipv4_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_ipv4_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_ipv4_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipv4_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.h deleted file mode 100644 index ad85c35a2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_stats.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IPV4_STATS_H -#define __NSS_IPV4_STATS_H - -/* - * NSS IPV4 statistics APIs - */ -extern void nss_ipv4_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_ipv4_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_node_sync *nins); -extern void nss_ipv4_stats_conn_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_conn_sync *nirs); -extern void nss_ipv4_stats_conn_sync_many(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_conn_sync_many_msg *nicsm); -extern void nss_ipv4_stats_dentry_create(void); - -#endif /* __NSS_IPV4_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.c deleted file mode 100644 index 77ff3520b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_ipv4_strings_exception_stats - * Interface statistics strings for ipv4 exceptions. - */ -struct nss_stats_info nss_ipv4_strings_exception_stats[NSS_IPV4_EXCEPTION_EVENT_MAX] = { - {"icmp_hdr_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_unhandled_type" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_ipv4_hdr_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_ipv4_udp_hdr_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_ipv4_tcp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_sipv4_unknown_protocol" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_flush_to_host" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_ip_option" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_ip_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_small_ttl" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_flags" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_seq_exceeds_right_edge" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_small_data_offs" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_bad_sack" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_big_data_offs" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_seq_before_left_edge" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_ack_exceeds_right_edge" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_ack_before_left_edge" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_ip_option" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_ip_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_small_ttl" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"wrong_target_mac" , NSS_STATS_TYPE_EXCEPTION}, - {"header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"bad_total_length" , NSS_STATS_TYPE_EXCEPTION}, - {"bad_checksum" , NSS_STATS_TYPE_EXCEPTION}, - {"non_initial_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"datagram_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"options_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"unknown_protocol" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_ip_option" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_ip_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_small_ttl" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"ingress_vid_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"ingress_vid_missing" , NSS_STATS_TYPE_EXCEPTION}, - {"6rd_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"6rd_ip_option" , NSS_STATS_TYPE_EXCEPTION}, - {"6rd_ip_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"6rd_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"dscp_marking_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"vlan_marking_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"interface_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_ip_option" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_ip_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_small_ttl" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"pptp_gre_session_match_fail" , NSS_STATS_TYPE_EXCEPTION}, - {"pptp_gre_invalid_proto" , NSS_STATS_TYPE_EXCEPTION}, - {"pptp_gre_no_cme" , NSS_STATS_TYPE_EXCEPTION}, - {"pptp_gre_ip_option" , NSS_STATS_TYPE_EXCEPTION}, - {"pptp_gre_ip_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"pptp_gre_small_ttl" , NSS_STATS_TYPE_EXCEPTION}, - {"pptp_gre_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"destroy" , NSS_STATS_TYPE_EXCEPTION}, - {"frag_df_set" , NSS_STATS_TYPE_EXCEPTION}, - {"frag_fail" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_ipv4_udplite_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_ip_option" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_ip_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_small_ttl" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"mc_udp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"mc_mem_alloc_failure" , NSS_STATS_TYPE_EXCEPTION}, - {"mc_update_failure" , NSS_STATS_TYPE_EXCEPTION}, - {"mc_pbuf_alloc_failure" , NSS_STATS_TYPE_EXCEPTION}, - {"pppoe_bridge_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"pppoe_no_session" , NSS_STATS_TYPE_DROP}, - {"icmp_ipv4_gre_hdr_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_ipv4_esp_hdr_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"emesh_prio_mismatch" , NSS_STATS_TYPE_EXCEPTION}, -}; - -/* - * nss_ipv4_strings_stats - * IPv4 statistics strings. - */ -struct nss_stats_info nss_ipv4_strings_stats[NSS_IPV4_STATS_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_SPECIAL}, - {"rx_bytes" , NSS_STATS_TYPE_SPECIAL}, - {"tx_pkts" , NSS_STATS_TYPE_SPECIAL}, - {"tx_bytes" , NSS_STATS_TYPE_SPECIAL}, - {"create_requests" , NSS_STATS_TYPE_SPECIAL}, - {"create_collisions" , NSS_STATS_TYPE_SPECIAL}, - {"create_invalid_interface" , NSS_STATS_TYPE_SPECIAL}, - {"destroy_requests" , NSS_STATS_TYPE_SPECIAL}, - {"destroy_misses" , NSS_STATS_TYPE_SPECIAL}, - {"hash_hits" , NSS_STATS_TYPE_SPECIAL}, - {"hash_reorders" , NSS_STATS_TYPE_SPECIAL}, - {"flushes" , NSS_STATS_TYPE_SPECIAL}, - {"evictions" , NSS_STATS_TYPE_SPECIAL}, - {"fragmentations" , NSS_STATS_TYPE_SPECIAL}, - {"by_rule_drops" , NSS_STATS_TYPE_DROP}, - {"mc_create_requests" , NSS_STATS_TYPE_SPECIAL}, - {"mc_update_requests" , NSS_STATS_TYPE_SPECIAL}, - {"mc_create_invalid_interface" , NSS_STATS_TYPE_SPECIAL}, - {"mc_destroy_requests" , NSS_STATS_TYPE_SPECIAL}, - {"mc_destroy_misses" , NSS_STATS_TYPE_SPECIAL}, - {"mc_flushes" , NSS_STATS_TYPE_SPECIAL}, - {"mirror_invalid_ifnum_conn_create_req" , NSS_STATS_TYPE_SPECIAL}, - {"mirror_invalid_iftype_conn_create_req" , NSS_STATS_TYPE_SPECIAL}, - {"mirror_failures" , NSS_STATS_TYPE_SPECIAL}, -}; - -/* - * nss_ipv4_special_stats_strings_read() - * Read IPV4 special node statistics names. - */ -static ssize_t nss_ipv4_special_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ipv4_strings_stats, NSS_IPV4_STATS_MAX); -} - -/* - * nss_ipv4_exception_stats_strings_read() - * Read IPV4 exception statistics names. - */ -static ssize_t nss_ipv4_exception_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ipv4_strings_exception_stats, NSS_IPV4_EXCEPTION_EVENT_MAX); -} - -/* - * nss_ipv4_special_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ipv4_special_stats); - -/* - * nss_ipv4_exception_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ipv4_exception_stats); - -/* - * nss_ipv4_strings_dentry_create() - * Create IPv4 statistics strings debug entry. - */ -void nss_ipv4_strings_dentry_create(void) -{ - struct dentry *dir_d; - struct dentry *file_d; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - dir_d = debugfs_create_dir("ipv4", nss_top_main.strings_dentry); - if (!dir_d) { - nss_warning("Failed to create qca-nss-drv/strings/ipv4 directory"); - return; - } - - file_d = debugfs_create_file("special_stats_str", 0400, dir_d, &nss_top_main, &nss_ipv4_special_stats_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/stats/ipv4/special_stats_str file"); - goto fail; - } - - file_d = debugfs_create_file("exception_stats_str", 0400, dir_d, &nss_top_main, &nss_ipv4_exception_stats_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/stats/ipv4/exception_stats_str file"); - goto fail; - } - - return; -fail: - debugfs_remove_recursive(dir_d); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.h deleted file mode 100644 index fd819c769..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv4_strings.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IPV4_STRINGS_H -#define __NSS_IPV4_STRINGS_H - -extern struct nss_stats_info nss_ipv4_strings_stats[NSS_IPV4_STATS_MAX]; -extern struct nss_stats_info nss_ipv4_strings_exception_stats[NSS_IPV4_EXCEPTION_EVENT_MAX]; -extern void nss_ipv4_strings_dentry_create(void); - -#endif /* __NSS_IPV4_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6.c deleted file mode 100644 index 2f9f14b9a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6.c +++ /dev/null @@ -1,776 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipv6.c - * NSS IPv6 APIs - */ -#include -#include "nss_dscp_map.h" -#include "nss_ipv6_stats.h" -#include "nss_ipv6_strings.h" - -#define NSS_IPV6_TX_MSG_TIMEOUT 1000 /* 1 sec timeout for IPv6 messages */ - -/* - * Private data structure for ipv6 configure messages - */ -struct nss_ipv6_cfg_pvt { - struct semaphore sem; /* Semaphore structure */ - struct completion complete; /* Completion structure */ - int response; /* Response from FW */ - void *cb; /* Original cb for sync msgs */ - void *app_data; /* Original app_data for sync msgs */ -} nss_ipv6_pvt; - -/* - * Private data structure for ipv6 connection information. - */ -struct nss_ipv6_conn_table_info { - uint32_t ce_table_size; /* Size of connection entry table in NSS FW */ - uint32_t cme_table_size; /* Size of connection match entry table in NSS FW */ - unsigned long ce_mem; /* Start address for connection entry table */ - unsigned long cme_mem; /* Start address for connection match entry table */ -} nss_ipv6_ct_info; - -int nss_ipv6_conn_cfg = NSS_DEFAULT_NUM_CONN; -int nss_ipv6_accel_mode_cfg __read_mostly = 1; - -static struct nss_dscp_map_entry mapping[NSS_DSCP_MAP_ARRAY_SIZE]; - -/* - * Callback for conn_sync_many request message. - */ -nss_ipv6_msg_callback_t nss_ipv6_conn_sync_many_msg_cb = NULL; - -/* - * nss_ipv6_dscp_map_usage() - * Help function shows the usage of the command. - */ -static inline void nss_ipv6_dscp_map_usage(void) -{ - nss_info_always("\nUsage:\n"); - nss_info_always("echo > /proc/sys/dev/nss/ipv6cfg/ipv6_dscp_map\n\n"); - nss_info_always("dscp[0-63] action[0-%u] prio[0-%u]:\n\n", - NSS_IPV6_DSCP_MAP_ACTION_MAX - 1, - NSS_DSCP_MAP_PRIORITY_MAX - 1); -} - -/* - * nss_ipv6_rx_msg_handler() - * Handle NSS -> HLOS messages for IPv6 bridge/route - */ -static void nss_ipv6_rx_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_ipv6_msg *nim = (struct nss_ipv6_msg *)ncm; - nss_ipv6_msg_callback_t cb; - - BUG_ON(ncm->interface != NSS_IPV6_RX_INTERFACE); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_IPV6_MAX_MSG_TYPES) { - nss_warning("%px: received invalid message %d for IPv6 interface", nss_ctx, nim->cm.type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_ipv6_msg)) { - nss_warning("%px: message length is invalid: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Trace messages. - */ - nss_ipv6_log_rx_msg(nim); - - /* - * Handle deprecated messages. Eventually these messages should be removed. - */ - switch (nim->cm.type) { - case NSS_IPV6_RX_NODE_STATS_SYNC_MSG: - /* - * Update driver statistics on node sync and send statistics notifications to the registered modules. - */ - nss_ipv6_stats_node_sync(nss_ctx, &nim->msg.node_stats); - nss_ipv6_stats_notify(nss_ctx); - break; - - case NSS_IPV6_RX_CONN_STATS_SYNC_MSG: - /* - * Update driver statistics on connection sync. - */ - nss_ipv6_stats_conn_sync(nss_ctx, &nim->msg.conn_stats); - break; - - case NSS_IPV6_TX_CONN_STATS_SYNC_MANY_MSG: - /* - * Update driver statistics on connection sync many. - */ - nss_ipv6_stats_conn_sync_many(nss_ctx, &nim->msg.conn_stats_many); - ncm->cb = (nss_ptr_t)nss_ipv6_conn_sync_many_msg_cb; - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, IPv6 sends all notify messages - * to the same callback/app_data. - */ - if (nim->cm.response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->ipv6_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->nss_top->ipv6_ctx; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_ipv6_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nim); -} - -/* - * nss_ipv6_tx_sync_callback() - * Callback to handle the completion of synchronous tx messages. - */ -static void nss_ipv6_tx_sync_callback(void *app_data, struct nss_ipv6_msg *nim) -{ - nss_ipv6_msg_callback_t callback = (nss_ipv6_msg_callback_t)nss_ipv6_pvt.cb; - void *data = nss_ipv6_pvt.app_data; - - nss_ipv6_pvt.cb = NULL; - nss_ipv6_pvt.app_data = NULL; - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("ipv6 error response %d\n", nim->cm.response); - nss_ipv6_pvt.response = NSS_TX_FAILURE; - } else { - nss_ipv6_pvt.response = NSS_TX_SUCCESS; - } - - if (callback) { - callback(data, nim); - } - - complete(&nss_ipv6_pvt.complete); -} - -/* - * nss_ipv6_dscp_action_get() - * Gets the action mapped to dscp. - */ -enum nss_ipv6_dscp_map_actions nss_ipv6_dscp_action_get(uint8_t dscp) -{ - if (dscp >= NSS_DSCP_MAP_ARRAY_SIZE) { - nss_warning("dscp:%u invalid\n", dscp); - return NSS_IPV6_DSCP_MAP_ACTION_MAX; - } - - return mapping[dscp].action; -} -EXPORT_SYMBOL(nss_ipv6_dscp_action_get); - -/* - * nss_ipv6_max_conn_count() - * Return the maximum number of IPv6 connections that the NSS acceleration engine supports. - */ -int nss_ipv6_max_conn_count(void) -{ - return nss_ipv6_conn_cfg; -} -EXPORT_SYMBOL(nss_ipv6_max_conn_count); - -/* - * nss_ipv6_conn_inquiry() - * Inquiry if a connection has been established in NSS FW - */ -nss_tx_status_t nss_ipv6_conn_inquiry(struct nss_ipv6_5tuple *ipv6_5t_p, - nss_ipv6_msg_callback_t cb) -{ - nss_tx_status_t nss_tx_status; - struct nss_ipv6_msg nim; - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[0]; - - /* - * Initialize inquiry message structure. - * This is async message and the result will be returned - * to the caller by the msg_callback passed in. - */ - memset(&nim, 0, sizeof(nim)); - nss_ipv6_msg_init(&nim, NSS_IPV6_RX_INTERFACE, - NSS_IPV6_TX_CONN_CFG_INQUIRY_MSG, - sizeof(struct nss_ipv6_inquiry_msg), - cb, NULL); - nim.msg.inquiry.rr.tuple = *ipv6_5t_p; - nss_tx_status = nss_ipv6_tx(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Send inquiry message failed\n", ipv6_5t_p); - } - - return nss_tx_status; -} -EXPORT_SYMBOL(nss_ipv6_conn_inquiry); - -/* - * nss_ipv6_tx_with_size() - * Transmit an ipv6 message to the FW with a specified size. - */ -nss_tx_status_t nss_ipv6_tx_with_size(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_msg *nim, uint32_t size) -{ - struct nss_cmn_msg *ncm = &nim->cm; - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_IPV6_RX_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_IPV6_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_ipv6_log_tx_msg(nim); - - return nss_core_send_cmd(nss_ctx, nim, sizeof(*nim), size); -} -EXPORT_SYMBOL(nss_ipv6_tx_with_size); - -/* - * nss_ipv6_tx() - * Transmit an ipv6 message to the FW. - */ -nss_tx_status_t nss_ipv6_tx(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_msg *nim) -{ - return nss_ipv6_tx_with_size(nss_ctx, nim, NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_ipv6_tx); - -/* - * nss_ipv6_tx_sync() - * Transmit a synchronous ipv6 message to the FW. - */ -nss_tx_status_t nss_ipv6_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_msg *nim) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_ipv6_pvt.sem); - nss_ipv6_pvt.cb = (void *)nim->cm.cb; - nss_ipv6_pvt.app_data = (void *)nim->cm.app_data; - - nim->cm.cb = (nss_ptr_t)nss_ipv6_tx_sync_callback; - nim->cm.app_data = (nss_ptr_t)NULL; - - status = nss_ipv6_tx(nss_ctx, nim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss ipv6 msg tx failed\n", nss_ctx); - up(&nss_ipv6_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_ipv6_pvt.complete, msecs_to_jiffies(NSS_IPV6_TX_MSG_TIMEOUT)); - if (!ret) { - nss_warning("%px: IPv6 tx sync failed due to timeout\n", nss_ctx); - nss_ipv6_pvt.response = NSS_TX_FAILURE; - } - - status = nss_ipv6_pvt.response; - up(&nss_ipv6_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_ipv6_tx_sync); - -/* - ********************************** - Register/Unregister/Miscellaneous APIs - ********************************** - */ - -/* - * nss_ipv6_notify_register() - * Register to received IPv6 events. - * - * NOTE: Do we want to pass an nss_ctx here so that we can register for ipv6 on any core? - */ -struct nss_ctx_instance *nss_ipv6_notify_register(nss_ipv6_msg_callback_t cb, void *app_data) -{ - /* - * TODO: We need to have a new array in support of the new API - * TODO: If we use a per-context array, we would move the array into nss_ctx based. - */ - nss_top_main.ipv6_callback = cb; - nss_top_main.ipv6_ctx = app_data; - return &nss_top_main.nss[nss_top_main.ipv6_handler_id]; -} -EXPORT_SYMBOL(nss_ipv6_notify_register); - -/* - * nss_ipv6_notify_unregister() - * Unregister to received IPv6 events. - * - * NOTE: Do we want to pass an nss_ctx here so that we can register for ipv6 on any core? - */ -void nss_ipv6_notify_unregister(void) -{ - nss_top_main.ipv6_callback = NULL; -} -EXPORT_SYMBOL(nss_ipv6_notify_unregister); - -/* - * nss_ipv6_conn_sync_many_notify_register() - * Register to receive IPv6 conn_sync_many message response. - */ -void nss_ipv6_conn_sync_many_notify_register(nss_ipv6_msg_callback_t cb) -{ - nss_ipv6_conn_sync_many_msg_cb = cb; -} -EXPORT_SYMBOL(nss_ipv6_conn_sync_many_notify_register); - -/* - * nss_ipv6_conn_sync_many_notify_unregister() - * Unregister to receive IPv6 conn_sync_many message response. - */ -void nss_ipv6_conn_sync_many_notify_unregister(void) -{ - nss_ipv6_conn_sync_many_msg_cb = NULL; -} -EXPORT_SYMBOL(nss_ipv6_conn_sync_many_notify_unregister); - -/* - * nss_ipv6_get_mgr() - * - * TODO: This only suppports a single ipv6, do we ever want to support more? - */ -struct nss_ctx_instance *nss_ipv6_get_mgr(void) -{ - return (void *)&nss_top_main.nss[nss_top_main.ipv6_handler_id]; -} -EXPORT_SYMBOL(nss_ipv6_get_mgr); - -/* - * nss_ipv6_register_handler() - * Register our handler to receive messages for this interface - */ -void nss_ipv6_register_handler() -{ - struct nss_ctx_instance *nss_ctx = nss_ipv6_get_mgr(); - - if (nss_core_register_handler(nss_ctx, NSS_IPV6_RX_INTERFACE, nss_ipv6_rx_msg_handler, NULL) != NSS_CORE_STATUS_SUCCESS) { - nss_warning("IPv6 handler failed to register"); - } - - nss_ipv6_stats_dentry_create(); - nss_ipv6_strings_dentry_create(); -} - -/* - * nss_ipv6_conn_cfg_process_callback() - * Call back function for the ipv6 connection configuration process. - */ -static void nss_ipv6_conn_cfg_process_callback(void *app_data, struct nss_ipv6_msg *nim) -{ - struct nss_ipv6_rule_conn_cfg_msg *nirccm = &nim->msg.rule_conn_cfg; - struct nss_ctx_instance *nss_ctx __maybe_unused = nss_ipv6_get_mgr(); - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: IPv6 connection configuration failed with error: %d\n", nss_ctx, nim->cm.error); - nss_core_update_max_ipv6_conn(NSS_FW_DEFAULT_NUM_CONN); - nss_ipv6_free_conn_tables(); - return; - } - - nss_ipv6_conn_cfg = ntohl(nirccm->num_conn); - - nss_info("%px: IPv6 connection configuration success: %d\n", nss_ctx, nim->cm.error); -} - -/* - * nss_ipv6_conn_cfg_process() - * Process request to configure number of ipv6 connections - */ -static int nss_ipv6_conn_cfg_process(struct nss_ctx_instance *nss_ctx, int conn) -{ - struct nss_ipv6_msg nim; - struct nss_ipv6_rule_conn_cfg_msg *nirccm; - nss_tx_status_t nss_tx_status; - - if ((!nss_ipv6_ct_info.ce_table_size) || (!nss_ipv6_ct_info.cme_table_size)) { - nss_warning("%px: connection entry or connection match entry table size not available\n", - nss_ctx); - return -EINVAL; - } - - nss_info("%px: IPv6 supported connections: %d\n", nss_ctx, conn); - - nss_ipv6_ct_info.ce_mem = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO, - get_order(nss_ipv6_ct_info.ce_table_size)); - if (!nss_ipv6_ct_info.ce_mem) { - nss_warning("%px: Memory allocation failed for IPv6 Connections: %d\n", - nss_ctx, - conn); - goto fail; - } - nss_info("%px: CE Memory allocated for IPv6 Connections: %d\n", - nss_ctx, - conn); - - nss_ipv6_ct_info.cme_mem = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO, - get_order(nss_ipv6_ct_info.cme_table_size)); - if (!nss_ipv6_ct_info.cme_mem) { - nss_warning("%px: Memory allocation failed for IPv6 Connections: %d\n", - nss_ctx, - conn); - goto fail; - } - nss_info("%px: CME Memory allocated for IPv6 Connections: %d\n", - nss_ctx, - conn); - - memset(&nim, 0, sizeof(struct nss_ipv6_msg)); - nss_ipv6_msg_init(&nim, NSS_IPV6_RX_INTERFACE, NSS_IPV6_TX_CONN_CFG_RULE_MSG, - sizeof(struct nss_ipv6_rule_conn_cfg_msg), nss_ipv6_conn_cfg_process_callback, NULL); - - nirccm = &nim.msg.rule_conn_cfg; - nirccm->num_conn = htonl(conn); - nirccm->ce_mem = dma_map_single(nss_ctx->dev, (void *)nss_ipv6_ct_info.ce_mem, nss_ipv6_ct_info.ce_table_size, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, nirccm->ce_mem))) { - nss_warning("%px: DMA mapping failed for virtual address = %px", nss_ctx, (void *)nss_ipv6_ct_info.ce_mem); - goto fail; - } - - nirccm->cme_mem = dma_map_single(nss_ctx->dev, (void *)nss_ipv6_ct_info.cme_mem, nss_ipv6_ct_info.cme_table_size, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, nirccm->cme_mem))) { - nss_warning("%px: DMA mapping failed for virtual address = %px", nss_ctx, (void *)nss_ipv6_ct_info.cme_mem); - goto fail; - } - - nss_tx_status = nss_ipv6_tx(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error setting IPv6 Connections: %d\n", - nss_ctx, - conn); - goto fail; - } - - return 0; - -fail: - nss_ipv6_free_conn_tables(); - return -EINVAL; -} - -/* - * nss_ipv6_update_conn_count_callback() - * Call back function for the ipv6 get connection info message. - */ -static void nss_ipv6_update_conn_count_callback(void *app_data, struct nss_ipv6_msg *nim) -{ - struct nss_ipv6_rule_conn_get_table_size_msg *nircgts = &nim->msg.size; - struct nss_ctx_instance *nss_ctx = nss_ipv6_get_mgr(); - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: IPv6 fetch connection info failed with error: %d\n", nss_ctx, nim->cm.error); - nss_core_update_max_ipv6_conn(NSS_FW_DEFAULT_NUM_CONN); - return; - } - - nss_info("IPv6 get connection info success\n"); - - nss_ipv6_ct_info.ce_table_size = ntohl(nircgts->ce_table_size); - nss_ipv6_ct_info.cme_table_size = ntohl(nircgts->cme_table_size); - - if (nss_ipv6_conn_cfg_process(nss_ctx, ntohl(nircgts->num_conn)) != 0) { - nss_warning("%px: IPv6 connection entry or connection match entry table size\ - not available\n", nss_ctx); - } - - return; -} - -/* - * nss_ipv6_update_conn_count() - * Sets the maximum number of IPv6 connections. - * - * It first gets the connection tables size information from NSS FW - * and then configures the connections in NSS FW. - */ -int nss_ipv6_update_conn_count(int ipv6_num_conn) -{ - struct nss_ctx_instance *nss_ctx = nss_ipv6_get_mgr(); - struct nss_ipv6_msg nim; - struct nss_ipv6_rule_conn_get_table_size_msg *nircgts; - nss_tx_status_t nss_tx_status; - uint32_t sum_of_conn; - - /* - * By default, NSS FW is configured with default number of connections. - */ - if (ipv6_num_conn == NSS_FW_DEFAULT_NUM_CONN) { - nss_info("%px: Default number of connections (%d) already configured\n", nss_ctx, ipv6_num_conn); - return 0; - } - - /* - * Specifications for input - * 1) The input should be power of 2. - * 2) Input for ipv4 and ipv6 sum togther should not exceed 8k - * 3) Min. value should be at leat 256 connections. This is the - * minimum connections we will support for each of them. - */ - sum_of_conn = nss_ipv4_conn_cfg + ipv6_num_conn; - if ((ipv6_num_conn & NSS_NUM_CONN_QUANTA_MASK) || - (sum_of_conn > NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6) || - (ipv6_num_conn < NSS_MIN_NUM_CONN)) { - nss_warning("%px: input supported connections (%d) does not adhere\ - specifications\n1) not power of 2,\n2) is less than \ - min val: %d, OR\n IPv4/6 total exceeds %d\n", - nss_ctx, - ipv6_num_conn, - NSS_MIN_NUM_CONN, - NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6); - return -EINVAL; - } - - memset(&nim, 0, sizeof(struct nss_ipv6_msg)); - nss_ipv6_msg_init(&nim, NSS_IPV6_RX_INTERFACE, NSS_IPV6_TX_CONN_TABLE_SIZE_MSG, - sizeof(struct nss_ipv6_rule_conn_get_table_size_msg), nss_ipv6_update_conn_count_callback, NULL); - - nircgts = &nim.msg.size; - nircgts->num_conn = htonl(ipv6_num_conn); - nss_tx_status = nss_ipv6_tx(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Send acceleration mode message failed\n", nss_ctx); - return -EINVAL; - } - - return 0; -} - -/* - * nss_ipv6_free_conn_tables() - * Frees memory allocated for connection tables - */ -void nss_ipv6_free_conn_tables(void) -{ - if (nss_ipv6_ct_info.ce_mem) { - free_pages(nss_ipv6_ct_info.ce_mem, get_order(nss_ipv6_ct_info.ce_table_size)); - } - - if (nss_ipv6_ct_info.cme_mem) { - free_pages(nss_ipv6_ct_info.cme_mem, get_order(nss_ipv6_ct_info.cme_table_size)); - } - - memset(&nss_ipv6_ct_info, 0, sizeof(struct nss_ipv6_conn_table_info)); - return; -} - -/* - * nss_ipv6_accel_mode_cfg_handler() - * Configure acceleration mode for IPv6 - */ -static int nss_ipv6_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - struct nss_ipv6_msg nim; - struct nss_ipv6_accel_mode_cfg_msg *nipcm; - nss_tx_status_t nss_tx_status; - int ret = NSS_FAILURE; - int current_value; - - /* - * Take snap shot of current value - */ - current_value = nss_ipv6_accel_mode_cfg; - - /* - * Write the variable with user input - */ - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret || (!write)) { - return ret; - } - - memset(&nim, 0, sizeof(struct nss_ipv6_msg)); - nss_ipv6_msg_init(&nim, NSS_IPV6_RX_INTERFACE, NSS_IPV6_TX_ACCEL_MODE_CFG_MSG, - sizeof(struct nss_ipv6_accel_mode_cfg_msg), NULL, NULL); - - nipcm = &nim.msg.accel_mode_cfg; - nipcm->mode = htonl(nss_ipv6_accel_mode_cfg); - - nss_tx_status = nss_ipv6_tx_sync(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Send acceleration mode message failed\n", nss_ctx); - nss_ipv6_accel_mode_cfg = current_value; - return -EIO; - } - - return 0; -} - -/* - * nss_ipv6_dscp_map_cfg_handler() - * Sysctl handler for dscp/pri mappings. - */ -static int nss_ipv6_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - struct nss_dscp_map_parse out; - struct nss_ipv6_msg nim; - struct nss_ipv6_dscp2pri_cfg_msg *nipd2p; - nss_tx_status_t status; - int ret; - - if (!write) { - return nss_dscp_map_print(ctl, buffer, lenp, ppos, mapping); - } - - ret = nss_dscp_map_parse(ctl, buffer, lenp, ppos, &out); - if (ret) { - nss_warning("failed to parse dscp mapping:%d\n", ret); - return ret; - } - - if (out.action >= NSS_IPV6_DSCP_MAP_ACTION_MAX) { - nss_warning("invalid action value: %d\n", out.action); - nss_ipv6_dscp_map_usage(); - return -EINVAL; - } - - memset(&nim, 0, sizeof(struct nss_ipv6_msg)); - nss_ipv6_msg_init(&nim, NSS_IPV6_RX_INTERFACE, NSS_IPV6_TX_DSCP2PRI_CFG_MSG, - sizeof(struct nss_ipv6_dscp2pri_cfg_msg), NULL, NULL); - - nipd2p = &nim.msg.dscp2pri_cfg; - nipd2p->dscp = out.dscp; - nipd2p->priority = out.priority; - - status = nss_ipv6_tx_sync(nss_ctx, &nim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: ipv6 dscp2pri config message failed\n", nss_ctx); - return -EFAULT; - } - - /* - * NSS firmware acknowleged the configuration, so update the mapping - * table on HOST side as well. - */ - mapping[out.dscp].action = out.action; - mapping[out.dscp].priority = out.priority; - - return 0; -} - -static struct ctl_table nss_ipv6_table[] = { - { - .procname = "ipv6_accel_mode", - .data = &nss_ipv6_accel_mode_cfg, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_ipv6_accel_mode_cfg_handler, - }, - { - .procname = "ipv6_dscp_map", - .data = &mapping[NSS_DSCP_MAP_ARRAY_SIZE], - .maxlen = sizeof(struct nss_dscp_map_entry), - .mode = 0644, - .proc_handler = &nss_ipv6_dscp_map_cfg_handler, - }, - { } -}; - -static struct ctl_table nss_ipv6_dir[] = { - { - .procname = "ipv6cfg", - .mode = 0555, - .child = nss_ipv6_table, - }, - { } -}; - -static struct ctl_table nss_ipv6_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_ipv6_dir, - }, - { } -}; - -static struct ctl_table nss_ipv6_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_ipv6_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_ipv6_header; - -/* - * nss_ipv6_register_sysctl() - * Register sysctl specific to ipv6 - */ -void nss_ipv6_register_sysctl(void) -{ - sema_init(&nss_ipv6_pvt.sem, 1); - init_completion(&nss_ipv6_pvt.complete); - - /* - * Register sysctl table. - */ - nss_ipv6_header = register_sysctl_table(nss_ipv6_root); -} - -/* - * nss_ipv6_unregister_sysctl() - * Unregister sysctl specific to ipv6 - */ -void nss_ipv6_unregister_sysctl(void) -{ - /* - * Unregister sysctl table. - */ - if (nss_ipv6_header) { - unregister_sysctl_table(nss_ipv6_header); - } -} - -/* - * nss_ipv6_msg_init() - * Initialize IPv6 message. - */ -void nss_ipv6_msg_init(struct nss_ipv6_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, - nss_ipv6_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nim->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_ipv6_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_log.c deleted file mode 100644 index ed606104e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_log.c +++ /dev/null @@ -1,387 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016, 2018, 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipv6_log.c - * NSS IPv6 logger file. - */ - -#include "nss_core.h" - -/* - * This macro converts IPv6 address to network format - */ -#define NSS_IPV6_ADDR_TO_NW(nss6, nw) \ - { \ - nw[0] = htonl(nss6[0]); \ - nw[1] = htonl(nss6[1]); \ - nw[2] = htonl(nss6[2]); \ - nw[3] = htonl(nss6[3]); \ - } - -/* - * nss_ipv6_log_message_types_str - * IPv6 bridge/route rule messages strings - */ -static int8_t *nss_ipv6_log_message_types_str[NSS_IPV6_MAX_MSG_TYPES] __maybe_unused = { - "IPv6 create rule message", - "IPv6 destroy rule message", - "Deprecated: NSS_IPV4_RX_ESTABLISH_RULE_MSG", - "IPv6 connection stats sync message", - "IPv6 generic statistics sync message", - "IPv6 number of connections supported rule message", - "IPv6 multicast create rule message", - "IPv6 request FW to send many conn sync message", -}; - -/* - * nss_ipv6_log_error_response_types_str - * Strings for error types for ipv6 messages - */ -static int8_t *nss_ipv6_log_error_response_types_str[] __maybe_unused = { - "No error", - "Unknown error", - "Invalid interface number", - "Missing connection rule", - "Buffer allocation failure", - "No connection found to delete", - "Conn cfg already done once", - "Conn cfg input is not multiple of quanta", - "Conn cfg input exceeds max supported connections", - "Conn cfg mem alloc fail at NSS FW", - "Invalid L4 protocol for multicast rule create", - "Invalid multicast flags for multicast update", - "Invalid interface for multicast update", -}; - -/* - * nss_ipv6_log_rule_create_msg() - * Log IPv6 create rule message. - */ -static void nss_ipv6_log_rule_create_msg(struct nss_ipv6_msg *nim) -{ - uint32_t src_ip[4]; - uint32_t dest_ip[4]; - struct nss_ipv6_rule_create_msg *nircm = &nim->msg.rule_create; - - NSS_IPV6_ADDR_TO_NW(nircm->tuple.flow_ip, src_ip); - NSS_IPV6_ADDR_TO_NW(nircm->tuple.return_ip, dest_ip); - - nss_trace("%px: IPv6 create rule message \n" - "Protocol: %d\n" - "from_mtu: %u\n" - "to_mtu: %u\n" - "from_ip: %pI6:%d\n" - "to_ip: %pI6:%d\n" - "from_mac: %pM\n" - "to_mac: %pM\n" - "src_iface_num: %u\n" - "dest_iface_num: %u\n" - "ingress_inner_vlan_tag: %u\n" - "egress_inner_vlan_tag: %u\n" - "ingress_outer_vlan_tag: %u\n" - "egress_outer_vlan_tag: %u\n" - "rule_flags: %x\n" - "valid_flags: %x\n" - "return_pppoe_if_exist: %u\n" - "return_pppoe_if_num: %u\n" - "flow_pppoe_if_exist: %u\n" - "flow_pppoe_if_num: %u\n" - "flow_qos_tag: %x (%u)\n" - "return_qos_tag: %x (%u)\n" - "flow_dscp: %x\n" - "return_dscp: %x\n" - "flow_mirror_ifnum: %u\n" - "return_mirror_ifnum: %u\n", - nim, - nircm->tuple.protocol, - nircm->conn_rule.flow_mtu, - nircm->conn_rule.return_mtu, - src_ip, nircm->tuple.flow_ident, - dest_ip, nircm->tuple.return_ident, - nircm->conn_rule.flow_mac, - nircm->conn_rule.return_mac, - nircm->conn_rule.flow_interface_num, - nircm->conn_rule.return_interface_num, - nircm->vlan_primary_rule.ingress_vlan_tag, - nircm->vlan_primary_rule.egress_vlan_tag, - nircm->vlan_secondary_rule.ingress_vlan_tag, - nircm->vlan_secondary_rule.egress_vlan_tag, - nircm->rule_flags, - nircm->valid_flags, - nircm->pppoe_rule.return_if_exist, - nircm->pppoe_rule.return_if_num, - nircm->pppoe_rule.flow_if_exist, - nircm->pppoe_rule.flow_if_num, - nircm->qos_rule.flow_qos_tag, nircm->qos_rule.flow_qos_tag, - nircm->qos_rule.return_qos_tag, nircm->qos_rule.return_qos_tag, - nircm->dscp_rule.flow_dscp, - nircm->dscp_rule.return_dscp, - nircm->mirror_rule.flow_ifnum, - nircm->mirror_rule.return_ifnum); -} - -/* - * nss_ipv6_log_destroy_rule_msg() - * Log IPv6 destroy rule message. - */ -static void nss_ipv6_log_destroy_rule_msg(struct nss_ipv6_msg *nim) -{ - uint32_t src_ip[4]; - uint32_t dest_ip[4]; - struct nss_ipv6_rule_destroy_msg *nirdm = &nim->msg.rule_destroy; - - NSS_IPV6_ADDR_TO_NW(nirdm->tuple.flow_ip, src_ip); - NSS_IPV6_ADDR_TO_NW(nirdm->tuple.return_ip, dest_ip); - - nss_trace("%px: IPv6 destroy rule message: \n" - "flow_ip: %pI6:%d\n" - "return_ip: %pI6:%d\n" - "protocol: %d\n", - nim, - src_ip, nirdm->tuple.flow_ident, - dest_ip, nirdm->tuple.return_ident, - nirdm->tuple.protocol); -} - -/* - * nss_ipv6_log_conn_sync() - * Log IPv6 connection stats sync message. - */ -static void nss_ipv6_log_conn_sync(struct nss_ipv6_msg *nim) -{ - struct nss_ipv6_conn_sync *sync = &nim->msg.conn_stats; - if (sync->flow_tx_packet_count || sync->return_tx_packet_count) { - uint32_t src_ip[4]; - uint32_t dest_ip[4]; - - NSS_IPV6_ADDR_TO_NW(sync->flow_ip, src_ip); - NSS_IPV6_ADDR_TO_NW(sync->return_ip, dest_ip); - - nss_trace("%px: IPv6 connection stats sync message: \n" - "Protocol: %d\n" - "src_addr: %pI6:%d\n" - "dest_addr: %pI6:%d\n" - "flow_rx_packet_count: %u\n" - "flow_rx_byte_count: %u\n" - "return_rx_packet_count: %u\n" - "return_rx_byte_count: %u\n" - "flow_tx_packet_count: %u\n" - "flow_tx_byte_count: %u\n" - "return_tx_packet_count: %u\n" - "return_tx_byte_count: %u\n", - nim, - (int)sync->protocol, - src_ip, (int)sync->flow_ident, - dest_ip, (int)sync->return_ident, - sync->flow_rx_packet_count, - sync->flow_rx_byte_count, - sync->return_rx_packet_count, - sync->return_rx_byte_count, - sync->flow_tx_packet_count, - sync->flow_tx_byte_count, - sync->return_tx_packet_count, - sync->return_tx_byte_count); - } -} - -/* - * nss_ipv6_log_conn_cfg_msg() - * Log IPv6 number of connections supported rule message. - */ -static void nss_ipv6_log_conn_cfg_msg(struct nss_ipv6_msg *nim) -{ - struct nss_ipv6_rule_conn_cfg_msg *nirccm __maybe_unused = &nim->msg.rule_conn_cfg; - nss_trace("%px: IPv6 number of connections supported rule message: \n" - "num_conn: %d\n", - nim, - nirccm->num_conn); -} - -/* - * nss_ipv6_log_mc_rule_create_msg() - * Log IPv6 multicast create rule message. - */ -static void nss_ipv6_log_mc_rule_create_msg(struct nss_ipv6_msg *nim) -{ - uint16_t vif; - uint32_t src_ip[4]; - uint32_t dest_ip[4]; - struct nss_ipv6_mc_rule_create_msg *nimrcm = &nim->msg.mc_rule_create; - - NSS_IPV6_ADDR_TO_NW(nimrcm->tuple.flow_ip, src_ip); - NSS_IPV6_ADDR_TO_NW(nimrcm->tuple.return_ip, dest_ip); - - for (vif = 0; vif < nimrcm->if_count ; vif++) { - nss_trace("%px: IPv6 multicast create rule message \n" - "Rule flag: %x\n" - "Vif: %d\n" - "Protocol: %d\n" - "to_mtu: %u\n" - "from_ip: %pI6:%d\n" - "to_ip: %pI6:%d\n" - "to_mac: %pM\n" - "dest_iface_num: %u\n" - "out_vlan[0] %x\n" - "out_vlan[1] %x\n", - nim, - nimrcm->if_rule[vif].rule_flags, - vif, - nimrcm->tuple.protocol, - nimrcm->if_rule[vif].if_mtu, - src_ip, nimrcm->tuple.flow_ident, - dest_ip, nimrcm->tuple.return_ident, - nimrcm->if_rule[vif].if_mac, - nimrcm->if_rule[vif].if_num, - nimrcm->if_rule[vif].egress_vlan_tag[0], - nimrcm->if_rule[vif].egress_vlan_tag[1]); - } -} - -/* - * nss_ipv6_log_conn_sync_many_msg() - * Log IPv6 many conn sync message. - */ -static void nss_ipv6_log_conn_sync_many_msg(struct nss_ipv6_msg *nim) -{ - uint16_t i; - struct nss_ipv6_conn_sync_many_msg *nicsm = &nim->msg.conn_stats_many; - for (i = 0; i < nicsm->count; i++) { - struct nss_ipv6_conn_sync *sync = &nicsm->conn_sync[i]; - if (sync->flow_tx_packet_count || sync->return_tx_packet_count) { - uint32_t src_ip[4]; - uint32_t dest_ip[4]; - - NSS_IPV6_ADDR_TO_NW(sync->flow_ip, src_ip); - NSS_IPV6_ADDR_TO_NW(sync->return_ip, dest_ip); - - nss_trace("%px: IPv6 many conn sync message \n" - "count: %d\n" - "i: %d\n" - "Protocol: %d\n" - "src_addr: %pI6:%d\n" - "dest_addr: %pI6:%d\n" - "flow_rx_packet_count: %u\n" - "flow_rx_byte_count: %u\n" - "return_rx_packet_count: %u\n" - "return_rx_byte_count: %u\n" - "flow_tx_packet_count: %u\n" - "flow_tx_byte_count: %u\n" - "return_tx_packet_count: %u\n" - "return_tx_byte_count: %u\n", - nim, - nicsm->count, - i, - (int)sync->protocol, - src_ip, (int)sync->flow_ident, - dest_ip, (int)sync->return_ident, - sync->flow_rx_packet_count, - sync->flow_rx_byte_count, - sync->return_rx_packet_count, - sync->return_rx_byte_count, - sync->flow_tx_packet_count, - sync->flow_tx_byte_count, - sync->return_tx_packet_count, - sync->return_tx_byte_count); - } - } -} - -/* - * nss_ipv6_log_verbose() - * Log message contents. - */ -static void nss_ipv6_log_verbose(struct nss_ipv6_msg *nim) -{ - switch (nim->cm.type) { - case NSS_IPV6_TX_CREATE_RULE_MSG: - nss_ipv6_log_rule_create_msg(nim); - break; - - case NSS_IPV6_TX_DESTROY_RULE_MSG: - nss_ipv6_log_destroy_rule_msg(nim); - break; - - case NSS_IPV6_RX_CONN_STATS_SYNC_MSG: - nss_ipv6_log_conn_sync(nim); - break; - - case NSS_IPV6_RX_NODE_STATS_SYNC_MSG: - /* Getting logged in stats */ - break; - - case NSS_IPV6_TX_CONN_CFG_RULE_MSG: - nss_ipv6_log_conn_cfg_msg(nim); - break; - - case NSS_IPV6_TX_CREATE_MC_RULE_MSG: - nss_ipv6_log_mc_rule_create_msg(nim); - break; - - case NSS_IPV6_TX_CONN_STATS_SYNC_MANY_MSG: - nss_ipv6_log_conn_sync_many_msg(nim); - break; - - default: - nss_trace("%px: Invalid message type\n", nim); - break; - } -} - -/* - * nss_ipv6_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_ipv6_log_tx_msg(struct nss_ipv6_msg *nim) -{ - nss_info("%px: type[%d]: %s\n", nim, nim->cm.type, nss_ipv6_log_message_types_str[nim->cm.type]); - nss_ipv6_log_verbose(nim); -} - -/* - * nss_ipv6_log_rx_msg() - * Log messages received from FW. - */ -void nss_ipv6_log_rx_msg(struct nss_ipv6_msg *nim) -{ - if (nim->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_info("%px: Invalid response\n", nim); - return; - } - - if (nim->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nim->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]: %s, response[%d]: %s\n", nim, nim->cm.type, - nss_ipv6_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response]); - goto verbose; - } - - if (nim->cm.error > NSS_IPV6_CR_MULTICAST_UPDATE_INVALID_IF) { - nss_info("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nim, nim->cm.type, nss_ipv6_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error); - goto verbose; - } - - nss_info("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nim, nim->cm.type, nss_ipv6_log_message_types_str[nim->cm.type], - nim->cm.response, nss_cmn_response_str[nim->cm.response], - nim->cm.error, nss_ipv6_log_error_response_types_str[nim->cm.error]); - -verbose: - nss_ipv6_log_verbose(nim); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm.c deleted file mode 100644 index 4ad8a7c24..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ipv6_reasm.c - * NSS IPv6 Reassembly APIs - */ -#include -#include "nss_ipv6_reasm_stats.h" -#include "nss_ipv6_reasm_strings.h" - -/* - * nss_ipv6_reasm_msg_handler() - * Handle NSS -> HLOS messages for IPv6 reasm - */ -static void nss_ipv6_reasm_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_ipv6_reasm_msg *nim = (struct nss_ipv6_reasm_msg *)ncm; - - BUG_ON(ncm->interface != NSS_IPV6_REASM_INTERFACE); - - switch (nim->cm.type) { - case NSS_IPV6_REASM_STATS_SYNC_MSG: - /* - * Update driver statistics on node sync and send statistics notifications to the registered modules. - */ - nss_ipv6_reasm_stats_sync(nss_ctx, &nim->msg.stats_sync); - nss_ipv6_reasm_stats_notify(nss_ctx); - break; - default: - nss_warning("IPv6 reasm received an unknown message type"); - } -} - -/* - * nss_ipv6_reasm_get_context() - * get NSS context instance for ipv6 reassembly - */ -struct nss_ctx_instance *nss_ipv6_reasm_get_context(void) -{ - return &nss_top_main.nss[nss_top_main.ipv6_reasm_handler_id]; -} -EXPORT_SYMBOL(nss_ipv6_reasm_get_context); - -/* - * nss_ipv6_reasm_register_handler() - * Register our handler to receive messages for this interface - */ -void nss_ipv6_reasm_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_ipv6_reasm_get_context(); - - if (nss_core_register_handler(nss_ctx, NSS_IPV6_REASM_INTERFACE, nss_ipv6_reasm_msg_handler, NULL) != NSS_CORE_STATUS_SUCCESS) { - nss_warning("IPv6 reasm handler failed to register"); - } - - nss_ipv6_reasm_stats_dentry_create(); - nss_ipv6_reasm_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_stats.c deleted file mode 100644 index d376f5af9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_stats.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_ipv6_reasm_stats.h" -#include "nss_ipv6_reasm.h" -#include "nss_ipv6_reasm_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_ipv6_reasm_stats_notifier); - -uint64_t nss_ipv6_reasm_stats[NSS_IPV6_REASM_STATS_MAX]; /* IPv6 reasm statistics */ - -/* - * nss_ipv6_reasm_stats_read() - * Read IPV6 reassembly stats - */ -static ssize_t nss_ipv6_reasm_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - /* - * Max output lines = #stats + few blank lines for banner printing + - * Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_IPV6_REASM_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_IPV6_REASM_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipv6_reasm", NSS_STATS_SINGLE_CORE); - - size_wr += nss_stats_fill_common_stats(NSS_IPV6_REASM_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "ipv6_reasm"); - - /* - * Ipv6 reasm node stats - */ - - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_IPV6_REASM_STATS_MAX); i++) { - stats_shadow[i] = nss_ipv6_reasm_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_print("ipv6_reasm", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_ipv6_reasm_strings_stats - , stats_shadow - , NSS_IPV6_REASM_STATS_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_ipv6_reasm_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ipv6_reasm); - -/* - * nss_ipv6_reasm_stats_dentry_create() - * Create IPv6 reasm statistics debug entry. - */ -void nss_ipv6_reasm_stats_dentry_create(void) -{ - nss_stats_create_dentry("ipv6_reasm", &nss_ipv6_reasm_stats_ops); -} - -/* - * nss_ipv6_reasm_stats_sync() - * Update driver specific information from the messsage. - */ -void nss_ipv6_reasm_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_reasm_stats_sync *nirs) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - int j; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Common node stats - */ - nss_top->stats_node[NSS_IPV6_REASM_INTERFACE][NSS_STATS_NODE_RX_PKTS] += nirs->node_stats.rx_packets; - nss_top->stats_node[NSS_IPV6_REASM_INTERFACE][NSS_STATS_NODE_RX_BYTES] += nirs->node_stats.rx_bytes; - nss_top->stats_node[NSS_IPV6_REASM_INTERFACE][NSS_STATS_NODE_TX_PKTS] += nirs->node_stats.tx_packets; - nss_top->stats_node[NSS_IPV6_REASM_INTERFACE][NSS_STATS_NODE_TX_BYTES] += nirs->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_top->stats_node[NSS_IPV6_REASM_INTERFACE][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nirs->node_stats.rx_dropped[j]; - } - - /* - * IPv6 reasm node stats - */ - nss_ipv6_reasm_stats[NSS_IPV6_REASM_STATS_ALLOC_FAILS] += nirs->ipv6_reasm_alloc_fails; - nss_ipv6_reasm_stats[NSS_IPV6_REASM_STATS_TIMEOUTS] += nirs->ipv6_reasm_timeouts; - nss_ipv6_reasm_stats[NSS_IPV6_REASM_STATS_DISCARDS] += nirs->ipv6_reasm_discards; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_ipv6_reasm_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_ipv6_reasm_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_ipv6_reasm_stats_notification ipv6_reasm_stats; - - ipv6_reasm_stats.core_id = nss_ctx->id; - memcpy(ipv6_reasm_stats.cmn_node_stats, nss_top_main.stats_node[NSS_IPV6_REASM_INTERFACE], sizeof(ipv6_reasm_stats.cmn_node_stats)); - memcpy(ipv6_reasm_stats.ipv6_reasm_stats, nss_ipv6_reasm_stats, sizeof(ipv6_reasm_stats.ipv6_reasm_stats)); - atomic_notifier_call_chain(&nss_ipv6_reasm_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&ipv6_reasm_stats); -} - -/* - * nss_ipv6_reasm_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_ipv6_reasm_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_ipv6_reasm_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipv6_reasm_stats_register_notifier); - -/* - * nss_ipv6_reasm_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_ipv6_reasm_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_ipv6_reasm_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipv6_reasm_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_stats.h deleted file mode 100644 index cdae31405..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_stats.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IPV6_REASM_STATS_H -#define __NSS_IPV6_REASM_STATS_H - -/* - * NSS IPv6 reasm statistics APIs - */ -extern void nss_ipv6_reasm_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_ipv6_reasm_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_reasm_stats_sync *nirs); -extern void nss_ipv6_reasm_stats_dentry_create(void); - -#endif /* __NSS_IPV6_REASM_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_strings.c deleted file mode 100644 index 7b6436ab5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_strings.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_ipv6_reasm_strings_stats - * IPv6 reassembly statistics strings. - */ -struct nss_stats_info nss_ipv6_reasm_strings_stats[NSS_IPV6_REASM_STATS_MAX] = { - {"alloc_fails" , NSS_STATS_TYPE_DROP}, - {"timeouts" , NSS_STATS_TYPE_DROP}, - {"discards" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_ipv6_reasm_strings_read() - * Read IPv6 reassembly node statistics names. - */ -static ssize_t nss_ipv6_reasm_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ipv6_reasm_strings_stats, NSS_IPV6_REASM_STATS_MAX); -} - -/* - * nss_ipv6_reasm_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ipv6_reasm); - -/* - * nss_ipv6_reasm_strings_dentry_create() - * Create IPv6 reassembly statistics strings debug entry. - */ -void nss_ipv6_reasm_strings_dentry_create(void) -{ - nss_strings_create_dentry("ipv6_reasm", &nss_ipv6_reasm_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_strings.h deleted file mode 100644 index 6cac544d0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_reasm_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IPV6_REASM_STRINGS_H -#define __NSS_IPV6_REASM_STRINGS_H - -extern struct nss_stats_info nss_ipv6_reasm_strings_stats[NSS_IPV6_REASM_STATS_MAX]; -extern void nss_ipv6_reasm_strings_dentry_create(void); - -#endif /* __NSS_IPV6_REASM_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.c deleted file mode 100644 index 617f55b73..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include -#include "nss_ipv6_stats.h" -#include "nss_ipv6_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_ipv6_stats_notifier); - -uint64_t nss_ipv6_stats[NSS_IPV6_STATS_MAX]; -uint64_t nss_ipv6_exception_stats[NSS_IPV6_EXCEPTION_EVENT_MAX]; - -/* - * nss_ipv6_stats_read() - * Read IPV6 stats. - */ -static ssize_t nss_ipv6_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + Number of Extra outputlines for future reference to add new stats + - * start tag line + end tag line + three blank lines. - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_IPV6_STATS_MAX + NSS_IPV6_EXCEPTION_EVENT_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Note: The assumption here is that exception event count is larger than other statistics count for IPv6. - */ - stats_shadow = kzalloc(NSS_IPV6_EXCEPTION_EVENT_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipv6", NSS_STATS_SINGLE_CORE); - size_wr += nss_stats_fill_common_stats(NSS_IPV6_RX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "ipv6"); - - /* - * IPv6 node stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_IPV6_STATS_MAX); i++) { - stats_shadow[i] = nss_ipv6_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_print("ipv6", "ipv6 node stats", NSS_STATS_SINGLE_INSTANCE - , nss_ipv6_strings_stats - , stats_shadow - , NSS_IPV6_STATS_MAX - , lbuf, size_wr, size_al); - - /* - * Exception stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_IPV6_EXCEPTION_EVENT_MAX); i++) { - stats_shadow[i] = nss_ipv6_exception_stats[i]; - } - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_print("ipv6", "ipv6 exception stats", NSS_STATS_SINGLE_INSTANCE - , nss_ipv6_strings_exception_stats - , stats_shadow - , NSS_IPV6_EXCEPTION_EVENT_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_ipv6_stats_conn_sync() - * Update driver specific information from the messsage. - */ -void nss_ipv6_stats_conn_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_conn_sync *nics) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - - /* - * Update statistics maintained by NSS driver - */ - spin_lock_bh(&nss_top->stats_lock); - nss_ipv6_stats[NSS_IPV6_STATS_ACCELERATED_RX_PKTS] += nics->flow_rx_packet_count + nics->return_rx_packet_count; - nss_ipv6_stats[NSS_IPV6_STATS_ACCELERATED_RX_BYTES] += nics->flow_rx_byte_count + nics->return_rx_byte_count; - nss_ipv6_stats[NSS_IPV6_STATS_ACCELERATED_TX_PKTS] += nics->flow_tx_packet_count + nics->return_tx_packet_count; - nss_ipv6_stats[NSS_IPV6_STATS_ACCELERATED_TX_BYTES] += nics->flow_tx_byte_count + nics->return_tx_byte_count; - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_ipv6_stats_conn_sync_many() - * Update driver specific information from the conn_sync_many messsage. - */ -void nss_ipv6_stats_conn_sync_many(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_conn_sync_many_msg *nicsm) -{ - uint32_t i; - - /* - * Sanity check for the stats count - */ - if (nicsm->count * sizeof(struct nss_ipv6_conn_sync) >= nicsm->size) { - nss_warning("%px: stats sync count %u exceeds the size of this msg %u", nss_ctx, nicsm->count, nicsm->size); - return; - } - - for (i = 0; i < nicsm->count; i++) { - nss_ipv6_stats_conn_sync(nss_ctx, &nicsm->conn_sync[i]); - } -} - -/* - * nss_ipv6_stats_node_sync() - * Update driver specific information from the messsage. - */ -void nss_ipv6_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_node_sync *nins) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - uint32_t i; - - /* - * Update statistics maintained by NSS driver - */ - spin_lock_bh(&nss_top->stats_lock); - nss_top->stats_node[NSS_IPV6_RX_INTERFACE][NSS_STATS_NODE_RX_PKTS] += nins->node_stats.rx_packets; - nss_top->stats_node[NSS_IPV6_RX_INTERFACE][NSS_STATS_NODE_RX_BYTES] += nins->node_stats.rx_bytes; - nss_top->stats_node[NSS_IPV6_RX_INTERFACE][NSS_STATS_NODE_TX_PKTS] += nins->node_stats.tx_packets; - nss_top->stats_node[NSS_IPV6_RX_INTERFACE][NSS_STATS_NODE_TX_BYTES] += nins->node_stats.tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_top->stats_node[NSS_IPV6_RX_INTERFACE][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += nins->node_stats.rx_dropped[i]; - } - - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_REQUESTS] += nins->ipv6_connection_create_requests; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_COLLISIONS] += nins->ipv6_connection_create_collisions; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_INTERFACE] += nins->ipv6_connection_create_invalid_interface; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_DESTROY_REQUESTS] += nins->ipv6_connection_destroy_requests; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_DESTROY_MISSES] += nins->ipv6_connection_destroy_misses; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_HASH_HITS] += nins->ipv6_connection_hash_hits; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_HASH_REORDERS] += nins->ipv6_connection_hash_reorders; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_FLUSHES] += nins->ipv6_connection_flushes; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_EVICTIONS] += nins->ipv6_connection_evictions; - nss_ipv6_stats[NSS_IPV6_STATS_FRAGMENTATIONS] += nins->ipv6_fragmentations; - nss_ipv6_stats[NSS_IPV6_STATS_FRAG_FAILS] += nins->ipv6_frag_fails; - nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_CREATE_REQUESTS] += nins->ipv6_mc_connection_create_requests; - nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_UPDATE_REQUESTS] += nins->ipv6_mc_connection_update_requests; - nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_CREATE_INVALID_INTERFACE] += nins->ipv6_mc_connection_create_invalid_interface; - nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv6_mc_connection_destroy_requests; - nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_DESTROY_MISSES] += nins->ipv6_mc_connection_destroy_misses; - nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_FLUSHES] += nins->ipv6_mc_connection_flushes; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM] += nins->ipv6_connection_create_invalid_mirror_ifnum; - nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE] += nins->ipv6_connection_create_invalid_mirror_iftype; - nss_ipv6_stats[NSS_IPV6_STATS_MIRROR_FAILURES] += nins->ipv6_mirror_failures; - - for (i = 0; i < NSS_IPV6_EXCEPTION_EVENT_MAX; i++) { - nss_ipv6_exception_stats[i] += nins->exception_events[i]; - } - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_ipv6_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ipv6); - -/* - * nss_ipv6_stats_dentry_create() - * Create IPv6 statistics debug entry. - */ -void nss_ipv6_stats_dentry_create(void) -{ - nss_stats_create_dentry("ipv6", &nss_ipv6_stats_ops); -} - -/* - * nss_ipv6_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_ipv6_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_ipv6_stats_notification ipv6_stats; - - ipv6_stats.core_id = nss_ctx->id; - memcpy(ipv6_stats.cmn_node_stats, nss_top_main.stats_node[NSS_IPV6_RX_INTERFACE], sizeof(ipv6_stats.cmn_node_stats)); - memcpy(ipv6_stats.special_stats, nss_ipv6_stats, sizeof(ipv6_stats.special_stats)); - memcpy(ipv6_stats.exception_stats, nss_ipv6_exception_stats, sizeof(ipv6_stats.exception_stats)); - - atomic_notifier_call_chain(&nss_ipv6_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&ipv6_stats); -} - -/* - * nss_ipv6_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_ipv6_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_ipv6_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipv6_stats_register_notifier); - -/* - * nss_ipv6_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_ipv6_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_ipv6_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ipv6_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.h deleted file mode 100644 index 1eaff5e2b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_stats.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IPV6_STATS_H -#define __NSS_IPV6_STATS_H - -/* - * IPV6 statistics APIs - */ -extern void nss_ipv6_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_ipv6_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_node_sync *nins); -extern void nss_ipv6_stats_conn_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_conn_sync *nics); -extern void nss_ipv6_stats_conn_sync_many(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_conn_sync_many_msg *nicsm); -extern void nss_ipv6_stats_dentry_create(void); - -#endif /* __NSS_IPV6_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.c deleted file mode 100644 index 57b100f7b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_ipv6_strings_exception_stats - * Interface statistics strings for IPv6 exceptions. - */ -struct nss_stats_info nss_ipv6_strings_exception_stats[NSS_IPV6_EXCEPTION_EVENT_MAX] = { - {"icmp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_unhandled_type" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_udp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_tcp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_unknown_protocol" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_flush_to_host" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_small_hop_limit" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_flags" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_seq_exceeds_right_edge" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_small_data_offs" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_bad_sack" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_big_data_offs" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_seq_before_left_edge" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_ack_exceeds_right_edge" , NSS_STATS_TYPE_EXCEPTION}, - {"tcp_ack_before_left_edge" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_small_hop_limit" , NSS_STATS_TYPE_EXCEPTION}, - {"udp_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"wrong_target_mac" , NSS_STATS_TYPE_EXCEPTION}, - {"header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"unknown_protocol" , NSS_STATS_TYPE_EXCEPTION}, - {"ingress_vid_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"ingress_vid_missing" , NSS_STATS_TYPE_EXCEPTION}, - {"dscp_marking_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"vlan_marking_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"interface_mismatch" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"gre_small_hop_limit" , NSS_STATS_TYPE_EXCEPTION}, - {"destroy" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_udplite_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_small_hop_limit" , NSS_STATS_TYPE_EXCEPTION}, - {"udplite_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"mc_udp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"mc_mem_alloc_failure" , NSS_STATS_TYPE_EXCEPTION}, - {"mc_update_failure" , NSS_STATS_TYPE_EXCEPTION}, - {"mc_pbuf_alloc_failure" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_ip_fragment" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_small_hop_limit" , NSS_STATS_TYPE_EXCEPTION}, - {"esp_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"tunipip6_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"tunipip6_small_hop_limit" , NSS_STATS_TYPE_EXCEPTION}, - {"tunipip6_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION}, - {"pppoe_bridge_no_icme" , NSS_STATS_TYPE_EXCEPTION}, - {"dont_frag_set" , NSS_STATS_TYPE_EXCEPTION}, - {"reassembly_not_supported" , NSS_STATS_TYPE_EXCEPTION}, - {"pppoe_no_session" , NSS_STATS_TYPE_DROP}, - {"icmp_gre_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"icmp_esp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION}, - {"emesh_prio_mismatch" , NSS_STATS_TYPE_EXCEPTION}, -}; - -/* - * nss_ipv6_strings_stats - * IPv6 stats strings. - */ -struct nss_stats_info nss_ipv6_strings_stats[NSS_IPV6_STATS_MAX] = { - {"rx_pkts" ,NSS_STATS_TYPE_SPECIAL}, - {"rx_bytes" ,NSS_STATS_TYPE_SPECIAL}, - {"tx_pkts" ,NSS_STATS_TYPE_SPECIAL}, - {"tx_bytes" ,NSS_STATS_TYPE_SPECIAL}, - {"create_requests" ,NSS_STATS_TYPE_SPECIAL}, - {"create_collisions" ,NSS_STATS_TYPE_SPECIAL}, - {"create_invalid_interface" ,NSS_STATS_TYPE_SPECIAL}, - {"destroy_requests" ,NSS_STATS_TYPE_SPECIAL}, - {"destroy_misses" ,NSS_STATS_TYPE_SPECIAL}, - {"hash_hits" ,NSS_STATS_TYPE_SPECIAL}, - {"hash_reorders" ,NSS_STATS_TYPE_SPECIAL}, - {"flushes" ,NSS_STATS_TYPE_SPECIAL}, - {"evictions" ,NSS_STATS_TYPE_SPECIAL}, - {"fragmentations" ,NSS_STATS_TYPE_SPECIAL}, - {"frag_fails" ,NSS_STATS_TYPE_SPECIAL}, - {"by_rule_drops" ,NSS_STATS_TYPE_DROP}, - {"mc_create_requests" ,NSS_STATS_TYPE_SPECIAL}, - {"mc_update_requests" ,NSS_STATS_TYPE_SPECIAL}, - {"mc_create_invalid_interface" ,NSS_STATS_TYPE_SPECIAL}, - {"mc_destroy_requests" ,NSS_STATS_TYPE_SPECIAL}, - {"mc_destroy_misses" ,NSS_STATS_TYPE_SPECIAL}, - {"mc_flushes" ,NSS_STATS_TYPE_SPECIAL}, - {"mirror_invalid_ifnum_conn_create_req" ,NSS_STATS_TYPE_SPECIAL}, - {"mirror_invalid_iftype_conn_create_req" ,NSS_STATS_TYPE_SPECIAL}, - {"mirror_failures" ,NSS_STATS_TYPE_SPECIAL}, -}; - -/* - * nss_ipv6_special_stats_strings_read() - * Read IPv6 special node statistics names. - */ -static ssize_t nss_ipv6_special_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ipv6_strings_stats, NSS_IPV6_STATS_MAX); -} - -/* - * nss_ipv6_exception_stats_strings_read() - * Read IPv6 exception statistics names. - */ -static ssize_t nss_ipv6_exception_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ipv6_strings_exception_stats, NSS_IPV6_EXCEPTION_EVENT_MAX); -} - -/* - * nss_ipv6_special_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ipv6_special_stats); - -/* - * nss_ipv6_exception_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ipv6_exception_stats); - -/* - * nss_ipv6_strings_dentry_create() - * Create IPv6 statistics strings debug entry. - */ -void nss_ipv6_strings_dentry_create(void) -{ - struct dentry *ipv6_d = NULL; - struct dentry *ipv6_spcl_stats_d = NULL; - struct dentry *ipv6_excp_stats_d = NULL; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - ipv6_d = debugfs_create_dir("ipv6", nss_top_main.strings_dentry); - if (!ipv6_d) { - nss_warning("Failed to create qca-nss-drv/strings/ipv6 directory"); - return; - } - - ipv6_spcl_stats_d = debugfs_create_file("special_stats_str", 0400, ipv6_d, &nss_top_main, &nss_ipv6_special_stats_strings_ops); - if (!ipv6_spcl_stats_d) { - nss_warning("Failed to create qca-nss-drv/stats/ipv6/special_stats_str file"); - debugfs_remove_recursive(ipv6_d); - return; - } - - ipv6_excp_stats_d = debugfs_create_file("exception_stats_str", 0400, ipv6_d, &nss_top_main, &nss_ipv6_exception_stats_strings_ops); - if (!ipv6_excp_stats_d) { - nss_warning("Failed to create qca-nss-drv/stats/ipv6/exception_stats_str file"); - debugfs_remove_recursive(ipv6_d); - return; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.h deleted file mode 100644 index 4f582e581..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ipv6_strings.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_IPV6_STRINGS_H -#define __NSS_IPV6_STRINGS_H - -extern struct nss_stats_info nss_ipv6_strings_stats[NSS_IPV6_STATS_MAX]; -extern struct nss_stats_info nss_ipv6_strings_exception_stats[NSS_IPV6_EXCEPTION_EVENT_MAX]; -extern void nss_ipv6_strings_dentry_create(void); - -#endif /* __NSS_IPV6_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2.c b/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2.c deleted file mode 100644 index 2c73b4860..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include -#include -#include "nss_tx_rx_common.h" -#include "nss_l2tpv2_stats.h" -#include "nss_l2tpv2_log.h" -#include "nss_l2tpv2_strings.h" - -/* - * Data structures to store l2tpv2 nss debug stats - */ -static DEFINE_SPINLOCK(nss_l2tpv2_session_debug_stats_lock); -static struct nss_l2tpv2_stats_session_debug nss_l2tpv2_session_debug_stats[NSS_MAX_L2TPV2_DYNAMIC_INTERFACES]; - -/* - * nss_l2tpv2_session_debug_stats_sync - * Per session debug stats for l2tpv2 - */ -void nss_l2tpv2_session_debug_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_l2tpv2_sync_session_stats_msg *stats_msg, uint16_t if_num) -{ - int i; - spin_lock_bh(&nss_l2tpv2_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_L2TPV2_DYNAMIC_INTERFACES; i++) { - if (nss_l2tpv2_session_debug_stats[i].if_num == if_num) { - nss_l2tpv2_session_debug_stats[i].stats[NSS_L2TPV2_STATS_SESSION_RX_PPP_LCP_PKTS] += stats_msg->debug_stats.rx_ppp_lcp_pkts; - nss_l2tpv2_session_debug_stats[i].stats[NSS_L2TPV2_STATS_SESSION_RX_EXP_DATA_PKTS] += stats_msg->debug_stats.rx_exception_data_pkts; - nss_l2tpv2_session_debug_stats[i].stats[NSS_L2TPV2_STATS_SESSION_ENCAP_PBUF_ALLOC_FAIL_PKTS] += stats_msg->debug_stats.encap_pbuf_alloc_fail; - nss_l2tpv2_session_debug_stats[i].stats[NSS_L2TPV2_STATS_SESSION_DECAP_PBUF_ALLOC_FAIL_PKTS] += stats_msg->debug_stats.decap_pbuf_alloc_fail; - nss_l2tpv2_session_debug_stats[i].stats[NSS_L2TPV2_STATS_SESSION_DECAP_L2TPOIPSEC_SRC_ERR] += stats_msg->debug_stats.decap_l2tpoipsec_src_error; - break; - } - } - spin_unlock_bh(&nss_l2tpv2_session_debug_stats_lock); -} - -/* - * nss_l2tpv2_global_session_stats_get() - * Get session l2tpv2 statitics. - */ -void nss_l2tpv2_session_debug_stats_get(void *stats_mem) -{ - struct nss_l2tpv2_stats_session_debug *stats = (struct nss_l2tpv2_stats_session_debug *)stats_mem; - int i; - - if (!stats) { - nss_warning("No memory to copy l2tpv2 session stats"); - return; - } - - spin_lock_bh(&nss_l2tpv2_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_L2TPV2_DYNAMIC_INTERFACES; i++) { - if (nss_l2tpv2_session_debug_stats[i].valid) { - memcpy(stats, &nss_l2tpv2_session_debug_stats[i], sizeof(struct nss_l2tpv2_stats_session_debug)); - stats++; - } - } - spin_unlock_bh(&nss_l2tpv2_session_debug_stats_lock); -} - -/* - * nss_l2tpv2_handler() - * Handle NSS -> HLOS messages for l2tpv2 tunnel - */ - -static void nss_l2tpv2_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_l2tpv2_msg *ntm = (struct nss_l2tpv2_msg *)ncm; - void *ctx; - - nss_l2tpv2_msg_callback_t cb; - - BUG_ON(!(nss_is_dynamic_interface(ncm->interface) || ncm->interface == NSS_L2TPV2_INTERFACE)); - - /* - * Trace Messages - */ - nss_l2tpv2_log_rx_msg(ntm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_L2TPV2_MSG_MAX) { - nss_warning("%px: received invalid message %d for L2TP interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_l2tpv2_msg)) { - nss_warning("%px: message length is invalid: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - switch (ntm->cm.type) { - - case NSS_L2TPV2_MSG_SYNC_STATS: - /* - * Update session debug stats in session stats msg and send statistics notifications to the registered modules - */ - nss_l2tpv2_session_debug_stats_sync(nss_ctx, &ntm->msg.stats, ncm->interface); - nss_l2tpv2_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, l2tpv2 sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->l2tpv2_msg_callback; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_l2tpv2_msg_callback_t)ncm->cb; - ctx = nss_ctx->subsys_dp_register[ncm->interface].ndev; - - /* - * call l2tpv2 tunnel callback - */ - if (!ctx) { - nss_warning("%px: Event received for l2tpv2 tunnel interface %d before registration", nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_l2tpv2_tx() - * Transmit a l2tpv2 message to NSS firmware - */ -nss_tx_status_t nss_l2tpv2_tx(struct nss_ctx_instance *nss_ctx, struct nss_l2tpv2_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_l2tpv2_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (!nss_is_dynamic_interface(ncm->interface)) { - nss_warning("%px: tx request for non dynamic interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_L2TPV2_MSG_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - *********************************** - * Register/Unregister/Miscellaneous APIs - *********************************** - */ - -/* - * nss_register_l2tpv2_if() - */ -struct nss_ctx_instance *nss_register_l2tpv2_if(uint32_t if_num, nss_l2tpv2_callback_t l2tpv2_callback, - nss_l2tpv2_msg_callback_t event_callback, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.l2tpv2_handler_id]; - int i = 0; - - nss_assert(nss_ctx); - nss_assert(nss_is_dynamic_interface(if_num)); - - nss_core_register_subsys_dp(nss_ctx, if_num, l2tpv2_callback, NULL, NULL, netdev, features); - - nss_top_main.l2tpv2_msg_callback = event_callback; - - nss_core_register_handler(nss_ctx, if_num, nss_l2tpv2_handler, NULL); - - spin_lock_bh(&nss_l2tpv2_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_L2TPV2_DYNAMIC_INTERFACES; i++) { - if (!nss_l2tpv2_session_debug_stats[i].valid) { - nss_l2tpv2_session_debug_stats[i].valid = true; - nss_l2tpv2_session_debug_stats[i].if_num = if_num; - nss_l2tpv2_session_debug_stats[i].if_index = netdev->ifindex; - break; - } - } - spin_unlock_bh(&nss_l2tpv2_session_debug_stats_lock); - - return nss_ctx; -} - -/* - * nss_unregister_l2tpv2_if() - */ -void nss_unregister_l2tpv2_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.l2tpv2_handler_id]; - int i; - - nss_assert(nss_ctx); - nss_assert(nss_is_dynamic_interface(if_num)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.l2tpv2_msg_callback = NULL; - - nss_core_unregister_handler(nss_ctx, if_num); - - spin_lock_bh(&nss_l2tpv2_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_L2TPV2_DYNAMIC_INTERFACES; i++) { - if (nss_l2tpv2_session_debug_stats[i].if_num == if_num) { - memset(&nss_l2tpv2_session_debug_stats[i], 0, sizeof(struct nss_l2tpv2_stats_session_debug)); - break; - } - } - spin_unlock_bh(&nss_l2tpv2_session_debug_stats_lock); -} - -/* - * nss_get_l2tpv2_context() - */ -struct nss_ctx_instance *nss_l2tpv2_get_context() -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.l2tpv2_handler_id]; -} - -/* - * nss_l2tpv2_msg_init() - * Initialize nss_l2tpv2 msg. - */ -void nss_l2tpv2_msg_init(struct nss_l2tpv2_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} - -/* nss_l2tpv2_register_handler() - * debugfs stats msg handler received on static l2tpv2 interface - */ -void nss_l2tpv2_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_l2tpv2_get_context(); - - nss_info("nss_l2tpv2_register_handler"); - nss_core_register_handler(nss_ctx, NSS_L2TPV2_INTERFACE, nss_l2tpv2_handler, NULL); - - nss_l2tpv2_stats_dentry_create(); - nss_l2tpv2_strings_dentry_create(); -} - -EXPORT_SYMBOL(nss_l2tpv2_get_context); -EXPORT_SYMBOL(nss_l2tpv2_tx); -EXPORT_SYMBOL(nss_unregister_l2tpv2_if); -EXPORT_SYMBOL(nss_l2tpv2_msg_init); -EXPORT_SYMBOL(nss_register_l2tpv2_if); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_log.c deleted file mode 100644 index fc1b31fc5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_log.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_l2tpv2_log.c - * NSS L2TPV2 logger file. - */ - -#include "nss_core.h" - -/* - * nss_l2tpv2_log_message_types_str - * NSS L2TPV2 message strings - */ -static int8_t *nss_l2tpv2_log_message_types_str[NSS_L2TPV2_MSG_MAX] __maybe_unused = { - "L2TPV2 Sesstion Create", - "L2TPV2 Session Destroy", - "L2TPV2 Stats", -}; - -/* - * nss_l2tpv2_log_session_create_msg() - * Log NSS L2TPV2 Session Create. - */ -static void nss_l2tpv2_log_session_create_msg(struct nss_l2tpv2_msg *nlm) -{ - struct nss_l2tpv2_session_create_msg *nlcm __maybe_unused = &nlm->msg.session_create_msg; - nss_trace("%px: NSS L2TPV2 Session Create message \n" - "L2TPV2 Local Tunnel ID: %x\n" - "L2TPV2 Local Session ID: %x\n" - "L2TPV2 Peer Tunnel ID: %x\n" - "L2TPV2 Peer Session ID: %x\n" - "L2TPV2 Source IP: %x\n" - "L2TPV2 Destnation IP: %x\n" - "L2TPV2 Reorder Timeout: %d\n" - "L2TPV2 Source Port: %d\n" - "L2TPV2 Destination Port: %d\n" - "L2TPV2 Received Sequence Number: %d\n" - "L2TPV2 Outer IP Packet TTL: %d\n" - "L2TPV2 UDP Checksum: %d\n", - nlcm, nlcm->local_tunnel_id, - nlcm->local_session_id, nlcm->peer_tunnel_id, - nlcm->peer_session_id, nlcm->sip, - nlcm->dip, nlcm->reorder_timeout, - nlcm->sport, nlcm->dport, - nlcm->recv_seq, nlcm->oip_ttl, - nlcm->udp_csum); -} - -/* - * nss_l2tpv2_log_session_destroy_msg() - * Log NSS L2TPV2 Session Create. - */ -static void nss_l2tpv2_log_session_destroy_msg(struct nss_l2tpv2_msg *nlm) -{ - struct nss_l2tpv2_session_destroy_msg *nldm __maybe_unused = &nlm->msg.session_destroy_msg; - nss_trace("%px: NSS L2TPV2 Session Destroy message \n" - "L2TPV2 Local Tunnel ID: %x\n" - "L2TPV2 Local Session ID: %x\n", - nldm, nldm->local_tunnel_id, - nldm->local_session_id); -} - -/* - * nss_l2tpv2_log_verbose() - * Log message contents. - */ -static void nss_l2tpv2_log_verbose(struct nss_l2tpv2_msg *nlm) -{ - switch (nlm->cm.type) { - case NSS_L2TPV2_MSG_SESSION_CREATE: - nss_l2tpv2_log_session_create_msg(nlm); - break; - - case NSS_L2TPV2_MSG_SESSION_DESTROY: - nss_l2tpv2_log_session_destroy_msg(nlm); - break; - - case NSS_L2TPV2_MSG_SYNC_STATS: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", nlm); - break; - } -} - -/* - * nss_l2tpv2_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_l2tpv2_log_tx_msg(struct nss_l2tpv2_msg *nlm) -{ - if (nlm->cm.type >= NSS_L2TPV2_MSG_MAX) { - nss_warning("%px: Invalid message type\n", nlm); - return; - } - - nss_info("%px: type[%d]:%s\n", nlm, nlm->cm.type, nss_l2tpv2_log_message_types_str[nlm->cm.type]); - nss_l2tpv2_log_verbose(nlm); -} - -/* - * nss_l2tpv2_log_rx_msg() - * Log messages received from FW. - */ -void nss_l2tpv2_log_rx_msg(struct nss_l2tpv2_msg *nlm) -{ - if (nlm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nlm); - return; - } - - if (nlm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nlm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nlm, nlm->cm.type, - nss_l2tpv2_log_message_types_str[nlm->cm.type], - nlm->cm.response, nss_cmn_response_str[nlm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - nlm, nlm->cm.type, nss_l2tpv2_log_message_types_str[nlm->cm.type], - nlm->cm.response, nss_cmn_response_str[nlm->cm.response]); - -verbose: - nss_l2tpv2_log_verbose(nlm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_log.h deleted file mode 100644 index 56cc9dee3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_L2TPV2_LOG_H -#define __NSS_L2TPV2_LOG_H - -/* - * nss_l2tpv2.h - * NSS L2TPV2 header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_l2tpv2_log_tx_msg - * Logs a l2tpv2 message that is sent to the NSS firmware. - */ -void nss_l2tpv2_log_tx_msg(struct nss_l2tpv2_msg *ntm); - -/* - * nss_l2tpv2_log_rx_msg - * Logs a l2tpv2 message that is received from the NSS firmware. - */ -void nss_l2tpv2_log_rx_msg(struct nss_l2tpv2_msg *ntm); - -#endif /* __NSS_L2TPV2_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_stats.c deleted file mode 100644 index 0784b54b8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_stats.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_l2tpv2_stats.h" -#include "nss_l2tpv2_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_l2tpv2_stats_notifier); - -/* - * nss_l2tpv2_stats_read() - * Read l2tpv2 statistics. - */ -static ssize_t nss_l2tpv2_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats * NSS_MAX_CORES + - * Few output lines for banner printing + Number of Extra outputlines for future reference to add new stats. - */ - uint32_t max_output_lines = NSS_MAX_L2TPV2_DYNAMIC_INTERFACES * (NSS_L2TPV2_STATS_SESSION_MAX + 2) /*session stats */ - + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines ; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - struct nss_l2tpv2_stats_session_debug l2tpv2_session_stats[NSS_MAX_L2TPV2_DYNAMIC_INTERFACES]; - int id; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - memset(&l2tpv2_session_stats, 0, sizeof(struct nss_l2tpv2_stats_session_debug) * NSS_MAX_L2TPV2_DYNAMIC_INTERFACES); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "l2tpv2", NSS_STATS_SINGLE_CORE); - - /* - * Get all stats - */ - nss_l2tpv2_session_debug_stats_get((void *)&l2tpv2_session_stats); - - /* - * Session stats - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nl2tp v2 session stats start:\n\n"); - for (id = 0; id < NSS_MAX_L2TPV2_DYNAMIC_INTERFACES; id++) { - - if (!l2tpv2_session_stats[id].valid) { - break; - } - - dev = dev_get_by_index(&init_net, l2tpv2_session_stats[id].if_index); - if (likely(dev)) { - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d, netdevice=%s\n", id, - l2tpv2_session_stats[id].if_num, dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d\n", id, - l2tpv2_session_stats[id].if_num); - } - - size_wr += nss_stats_print("l2tpv2", "l2tp v2 session stats" - , id - , nss_l2tpv2_strings_session_stats - , l2tpv2_session_stats[id].stats - , NSS_L2TPV2_STATS_SESSION_MAX - , lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(lbuf); - return bytes_read; -} - -/* - * nss_l2tpv2_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(l2tpv2); - -/* - * nss_l2tpv2_stats_dentry_create() - * Create l2tpv2 statistics debug entry. - */ -void nss_l2tpv2_stats_dentry_create(void) -{ - nss_stats_create_dentry("l2tpv2", &nss_l2tpv2_stats_ops); -} - -/* - * nss_l2tpv2_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_l2tpv2_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_l2tpv2_stats_notification l2tpv2_stats; - struct nss_l2tpv2_stats_session_debug l2tpv2_session_stats[NSS_MAX_L2TPV2_DYNAMIC_INTERFACES]; - int id; - - memset(&l2tpv2_session_stats, 0, sizeof(l2tpv2_session_stats)); - - /* - * Get all stats - */ - nss_l2tpv2_session_debug_stats_get((void *)&l2tpv2_session_stats); - - for (id = 0; id < NSS_MAX_L2TPV2_DYNAMIC_INTERFACES; id++) { - if (l2tpv2_session_stats[id].if_num == if_num) { - memcpy(&l2tpv2_stats.stats, &l2tpv2_session_stats[id].stats, sizeof(l2tpv2_stats.stats)); - } - } - l2tpv2_stats.core_id = nss_ctx->id; - l2tpv2_stats.if_num = if_num; - atomic_notifier_call_chain(&nss_l2tpv2_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&l2tpv2_stats); -} - -/* - * nss_l2tpv2_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_l2tpv2_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_l2tpv2_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_l2tpv2_stats_register_notifier); - -/* - * nss_l2tpv2_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_l2tpv2_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_l2tpv2_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_l2tpv2_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_stats.h deleted file mode 100644 index 0c8ecda4d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_stats.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_L2TPV2_STATS_H -#define __NSS_L2TPV2_STATS_H - -struct nss_l2tpv2_stats_session_debug { - uint64_t stats[NSS_L2TPV2_STATS_SESSION_MAX]; - int32_t if_index; - uint32_t if_num; /* nss interface number */ - bool valid; -}; - -/* - * l2tpv2 statistics APIs - */ -extern void nss_l2tpv2_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_l2tpv2_stats_dentry_create(void); - -#endif /* __NSS_L2TPV2_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_strings.c deleted file mode 100644 index d5db00c0b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_strings.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_l2tpv2_strings_session_stats - * L2TPv2 statistics strings for NSS session statistics. - */ -struct nss_stats_info nss_l2tpv2_strings_session_stats[NSS_L2TPV2_STATS_SESSION_MAX] = { - {"rx_ppp_lcp_pkts" , NSS_STATS_TYPE_EXCEPTION}, - {"rx_exp_pkts" , NSS_STATS_TYPE_EXCEPTION}, - {"encap_pbuf_alloc_fails" , NSS_STATS_TYPE_SPECIAL}, - {"decap_pbuf_alloc_fails" , NSS_STATS_TYPE_SPECIAL}, - {"decap_l2tpoipsec_src_err" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_l2tpv2_strings_read() - * Read L2TPv2 node statistics names. - */ -static ssize_t nss_l2tpv2_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_l2tpv2_strings_session_stats, NSS_L2TPV2_STATS_SESSION_MAX); -} - -/* - * nss_l2tpv2_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(l2tpv2); - -/* - * nss_l2tpv2_strings_dentry_create() - * Create L2TPv2 statistics strings debug entry. - */ -void nss_l2tpv2_strings_dentry_create(void) -{ - nss_strings_create_dentry("l2tpv2", &nss_l2tpv2_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_strings.h deleted file mode 100644 index 2e8f871c1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_l2tpv2_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_L2TPV2_STRINGS_H -#define __NSS_L2TPV2_STRINGS_H - -extern struct nss_stats_info nss_l2tpv2_strings_session_stats[NSS_L2TPV2_STATS_SESSION_MAX]; -extern void nss_l2tpv2_strings_dentry_create(void); - -#endif /* __NSS_L2TPV2_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_lag.c b/feeds/ipq807x/qca-nss-drv/src/nss_lag.c deleted file mode 100644 index 02362e173..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_lag.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_tx_rx_lag.c - * NSS LAG Tx APIs - */ - -#include - -#include "nss_tx_rx_common.h" -#include "nss_lag_log.h" - -#define NSS_LAG_RESP_TIMEOUT 60000 /* 60 Sec */ - -/* - * Private data structure of dynamic interface - */ -struct nss_lag_pvt { - struct completion complete; /* completion structure */ - enum nss_cmn_response response; /* Message response */ -}; - -/* - * nss_lag_state_callback() - * Call back function for nss LAG State - */ -void nss_lag_state_callback(void *arg, struct nss_lag_msg *nm) -{ - struct nss_lag_pvt *lag_msg_state = arg; - - /* - * Unblock the sleeping function. - */ - lag_msg_state->response = nm->cm.response; - complete(&lag_msg_state->complete); -} - -/* - * nss_lag_verify_ifnum() - * - */ -static void nss_lag_verify_ifnum(uint32_t if_num) -{ - nss_assert((if_num == NSS_LAG0_INTERFACE_NUM) || - (if_num == NSS_LAG1_INTERFACE_NUM) || - (if_num == NSS_LAG2_INTERFACE_NUM) || - (if_num == NSS_LAG3_INTERFACE_NUM)); -} - -/* - * nss_lag_get_context() - */ -static struct nss_ctx_instance *nss_lag_get_context(void) -{ - uint8_t ipv4_handler_id = nss_top_main.ipv4_handler_id; - - return (struct nss_ctx_instance *)&nss_top_main.nss[ipv4_handler_id]; -} - -/* - * nss_lag_tx() - * Transmit a LAG msg to the firmware. - */ -nss_tx_status_t nss_lag_tx(struct nss_ctx_instance *nss_ctx, struct nss_lag_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_lag_log_tx_msg(msg); - - /* - * Sanity check the message - */ - nss_lag_verify_ifnum(ncm->interface); - - if (ncm->type > NSS_TX_METADATA_LAG_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_lag_tx); - -/** - * nss_register_lag_if() - */ -void *nss_register_lag_if(uint32_t if_num, - nss_lag_callback_t lag_cb, - nss_lag_event_callback_t lag_ev_cb, - struct net_device *netdev) -{ - struct nss_ctx_instance *nss_ctx = nss_lag_get_context(); - uint32_t features = 0; - - nss_assert(nss_ctx); - nss_lag_verify_ifnum(if_num); - - nss_core_register_subsys_dp(nss_ctx, if_num, lag_cb, NULL, NULL, netdev, features); - - nss_top_main.lag_event_callback = lag_ev_cb; - - /* - * Return the NSS driver context for LAG (same as for ipv4 functions) - */ - return (void *)nss_ctx; -} -EXPORT_SYMBOL(nss_register_lag_if); - -/** - * nss_unregister_lag_if() - */ -void nss_unregister_lag_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_lag_get_context(); - - nss_assert(nss_ctx); - nss_lag_verify_ifnum(if_num); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.lag_event_callback = NULL; -} -EXPORT_SYMBOL(nss_unregister_lag_if); - -/** - * nss_lag_handler() - */ -void nss_lag_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, - void *app_data) -{ - struct nss_lag_msg *lm = (struct nss_lag_msg *)ncm; - void *ctx = NULL; - nss_lag_event_callback_t cb; - - BUG_ON(ncm->interface != NSS_LAG0_INTERFACE_NUM - && ncm->interface != NSS_LAG1_INTERFACE_NUM - && ncm->interface != NSS_LAG2_INTERFACE_NUM - && ncm->interface != NSS_LAG3_INTERFACE_NUM); - - /* - * Trace Messages - */ - nss_lag_log_rx_msg(lm); - - if (ncm->type >= NSS_TX_METADATA_LAG_MAX) { - nss_warning("%px: received invalid message %d for LAG interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_lag_msg)) { - nss_warning("%px: invalid length for LAG message: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /** - * Update the callback and app_data for NOTIFY messages. - * LAG sends all notify messages to the same callback. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->lag_event_callback; - } - - /** - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /** - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /** - * callback - */ - cb = (nss_lag_event_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - cb(ctx, lm); -} - -/** - * nss_lag_register_handler() - */ -void nss_lag_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_lag_get_context(); - - nss_core_register_handler(nss_ctx, NSS_LAG0_INTERFACE_NUM, nss_lag_handler, NULL); - nss_core_register_handler(nss_ctx, NSS_LAG1_INTERFACE_NUM, nss_lag_handler, NULL); - nss_core_register_handler(nss_ctx, NSS_LAG2_INTERFACE_NUM, nss_lag_handler, NULL); - nss_core_register_handler(nss_ctx, NSS_LAG3_INTERFACE_NUM, nss_lag_handler, NULL); -} - -/** - * nss_lag_msg_init() - * Initialize lag message - */ -void nss_lag_msg_init(struct nss_lag_msg *nlm, uint16_t lag_num, uint32_t type, uint32_t len, - nss_lag_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nlm->cm, lag_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_lag_msg_init); - -/** - * nss_lag_tx_slave_state() - */ -nss_tx_status_t nss_lag_tx_slave_state(uint16_t lagid, int32_t slave_ifnum, - enum nss_lag_state_change_ev slave_state) -{ - struct nss_lag_msg nm; - struct nss_lag_state_change *nlsc = NULL; - nss_tx_status_t status; - int ret; - struct nss_ctx_instance *nss_ctx = nss_lag_get_context(); - struct nss_lag_pvt lag_msg_state; - - init_completion(&lag_msg_state.complete); - lag_msg_state.response = false; - - /* - * Construct a message to the NSS to update it - */ - nss_lag_msg_init(&nm, lagid, - NSS_TX_METADATA_LAG_STATE_CHANGE, - sizeof(struct nss_lag_state_change), - nss_lag_state_callback, &lag_msg_state); - - nlsc = &nm.msg.state; - nlsc->event = slave_state; - nlsc->interface = slave_ifnum; - - status = nss_lag_tx(nss_ctx, &nm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Send LAG update failed, status: %d\n", nss_ctx, - status); - return NSS_TX_FAILURE; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&lag_msg_state.complete, - msecs_to_jiffies(NSS_LAG_RESP_TIMEOUT)); - if (!ret) { - nss_warning("%px: Waiting for ack timed out\n", nss_ctx); - return NSS_TX_FAILURE; - } - - return lag_msg_state.response; -} -EXPORT_SYMBOL(nss_lag_tx_slave_state); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_lag_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_lag_log.c deleted file mode 100644 index da83df0c6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_lag_log.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_lag_log.c - * NSS LAG logger file. - */ - -#include "nss_core.h" - -/* - * nss_lag_log_message_types_str - * NSS LAG message strings - */ -static int8_t *nss_lag_log_message_types_str[NSS_TX_METADATA_LAG_MAX] __maybe_unused = { - "LAG State Change", -}; - -/* - * nss_lag_log_state_change_msg() - * Log NSS LAG State Change. - */ -static void nss_lag_log_state_change_msg(struct nss_lag_msg *nlm) -{ - struct nss_lag_state_change *nlcm __maybe_unused = &nlm->msg.state; - nss_trace("%px: NSS LAG State Change message \n" - "LAG ID: %x\n" - "LAG Interface: %x\n" - "LAG Event: %d\n", - nlcm, nlcm->lagid, - nlcm->interface, nlcm->event); -} - -/* - * nss_lag_log_verbose() - * Log message contents. - */ -static void nss_lag_log_verbose(struct nss_lag_msg *nlm) -{ - switch (nlm->cm.type) { - case NSS_TX_METADATA_LAG_STATE_CHANGE: - nss_lag_log_state_change_msg(nlm); - break; - - default: - nss_trace("%px: Invalid message type\n", nlm); - break; - } -} - -/* - * nss_lag_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_lag_log_tx_msg(struct nss_lag_msg *nlm) -{ - if (nlm->cm.type >= NSS_TX_METADATA_LAG_MAX) { - nss_warning("%px: Invalid message type\n", nlm); - return; - } - - nss_info("%px: type[%d]:%s\n", nlm, nlm->cm.type, nss_lag_log_message_types_str[nlm->cm.type]); - nss_lag_log_verbose(nlm); -} - -/* - * nss_lag_log_rx_msg() - * Log messages received from FW. - */ -void nss_lag_log_rx_msg(struct nss_lag_msg *nlm) -{ - if (nlm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nlm); - return; - } - - if (nlm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nlm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nlm, nlm->cm.type, - nss_lag_log_message_types_str[nlm->cm.type], - nlm->cm.response, nss_cmn_response_str[nlm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - nlm, nlm->cm.type, nss_lag_log_message_types_str[nlm->cm.type], - nlm->cm.response, nss_cmn_response_str[nlm->cm.response]); - -verbose: - nss_lag_log_verbose(nlm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_lag_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_lag_log.h deleted file mode 100644 index 4efe393fc..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_lag_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_LAG_LOG_H -#define __NSS_LAG_LOG_H - -/* - * nss_lag.h - * NSS LAG header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_lag_log_tx_msg - * Logs a lag message that is sent to the NSS firmware. - */ -void nss_lag_log_tx_msg(struct nss_lag_msg *nlm); - -/* - * nss_lag_log_rx_msg - * Logs a lag message that is received from the NSS firmware. - */ -void nss_lag_log_rx_msg(struct nss_lag_msg *nlm); - -#endif /* __NSS_LAG_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_log.c deleted file mode 100644 index bfdca6575..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_log.c +++ /dev/null @@ -1,602 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ -/* - * nss_log.c - * NSS FW debug logger retrieval from DDR (memory) - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "nss_core.h" -#include "nss_log.h" - -/* - * Private data for each device file open instance - */ -struct nss_log_data { - void *load_mem; /* Pointer to struct nss_log_descriptor - descriptor data */ - dma_addr_t dma_addr; /* Handle to DMA */ - uint32_t last_entry; /* Last known sampled entry (or index) */ - uint32_t nentries; /* Caches the total number of entries of log buffer */ - int nss_id; /* NSS Core id being used */ - struct nss_ctx_instance *nss_ctx; - /* NSS ctx instance */ -}; - -struct nss_log_ring_buffer_addr nss_rbe[NSS_MAX_CORES]; - -static DEFINE_MUTEX(nss_log_mutex); -static wait_queue_head_t nss_log_wq; -static nss_log_msg_callback_t nss_debug_interface_cb; -static void *nss_debug_interface_app_data = NULL; - -static wait_queue_head_t msg_wq; -enum nss_cmn_response msg_response; -static bool msg_event; - -/* - * nss_log_llseek() - * Seek operation. - */ -static loff_t nss_log_llseek(struct file *file, loff_t offset, int origin) -{ - struct nss_log_data *data = file->private_data; - - switch (origin) { - case SEEK_SET: - break; - case SEEK_CUR: - offset += file->f_pos; - break; - case SEEK_END: - offset = ((data->nentries * sizeof(struct nss_log_entry)) + sizeof(struct nss_log_descriptor)) - offset; - break; - default: - return -EINVAL; - } - - return (offset >= 0) ? (file->f_pos = offset) : -EINVAL; -} - -/* - * nss_log_open() - * Open operation for our device. We let as many instance run together - */ -static int nss_log_open(struct inode *inode, struct file *filp) -{ - struct nss_log_data *data = NULL; - struct nss_top_instance *nss_top; - struct nss_ctx_instance *nss_ctx; - int nss_id; - - /* - * i_private is passed to us by debug_fs_create() - */ - nss_id = (int)(nss_ptr_t)inode->i_private; - if (nss_id < 0 || nss_id >= nss_top_main.num_nss) { - nss_warning("nss_id is not valid :%d\n", nss_id); - return -ENODEV; - } - - nss_top = &nss_top_main; - nss_ctx = &nss_top->nss[nss_id]; - - data = kzalloc(sizeof(struct nss_log_data), GFP_KERNEL); - if (!data) { - nss_warning("%px: Failed to allocate memory for log_data", nss_ctx); - return -ENOMEM; - } - - mutex_lock(&nss_log_mutex); - if (!nss_rbe[nss_id].addr) { - mutex_unlock(&nss_log_mutex); - kfree(data); - nss_warning("%px: Ring buffer not configured yet for nss_id:%d", nss_ctx, nss_id); - return -EIO; - } - - /* - * Actual ring buffer. - */ - data->load_mem = nss_rbe[nss_id].addr; - data->last_entry = 0; - data->nentries = nss_rbe[nss_id].nentries; - data->dma_addr = nss_rbe[nss_id].dma_addr; - data->nss_ctx = nss_ctx; - - /* - * Increment the reference count so that we don't free - * the memory - */ - nss_rbe[nss_id].ref_cnt++; - data->nss_id = nss_id; - filp->private_data = data; - mutex_unlock(&nss_log_mutex); - - return 0; -} - -/* - * nss_log_release() - * release gets called when close() is called on the file - * descriptor. We unmap the IO region. - */ -static int nss_log_release(struct inode *inode, struct file *filp) -{ - struct nss_log_data *data = filp->private_data; - - if (!data) { - return -EINVAL; - } - - mutex_lock(&nss_log_mutex); - nss_rbe[data->nss_id].ref_cnt--; - BUG_ON(nss_rbe[data->nss_id].ref_cnt < 0); - if (!nss_rbe[data->nss_id].ref_cnt) { - wake_up(&nss_log_wq); - } - mutex_unlock(&nss_log_mutex); - kfree(data); - return 0; -} - -/* - * nss_log_current_entry() - * Reads current entry index from NSS log descriptor. - */ -static uint32_t nss_log_current_entry(struct nss_log_descriptor *desc) -{ - rmb(); - return desc->current_entry; -} - -/* - * nss_log_read() - * Read operation lets command like cat and tail read our memory log buffer data. - */ -static ssize_t nss_log_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos) -{ - struct nss_log_data *data = filp->private_data; - struct nss_log_descriptor *desc; - size_t bytes = 0; - size_t b; - struct nss_log_entry *rb; - uint32_t entry; - uint32_t offset, index; - char msg[NSS_LOG_OUTPUT_LINE_SIZE]; - - if (!data) { - return -EINVAL; - } - - desc = data->load_mem; - if (!desc) { - nss_warning("%px: load_mem is NULL", data); - return -EINVAL; - } - - /* - * If buffer is too small to fit even one entry. - */ - if (size < NSS_LOG_OUTPUT_LINE_SIZE) { - return 0; - } - - /* - * Get the current index - */ - dma_sync_single_for_cpu(data->nss_ctx->dev, data->dma_addr, sizeof(struct nss_log_descriptor), DMA_FROM_DEVICE); - - entry = nss_log_current_entry(desc); - - /* - * If the current and last sampled indexes are same then bail out. - */ - if (unlikely(data->last_entry == entry)) { - return 0; - } - - /* - * If this is the first read (after open) on our device file. - */ - if (unlikely(!(*ppos))) { - /* - * If log buffer has rolled over. Almost all the time - * it will be true. - */ - if (likely(entry > data->nentries)) { - /* - * Determine how much we can stuff in one - * buffer passed to us and accordingly - * reduce our index. - */ - data->last_entry = entry - data->nentries; - } else { - data->last_entry = 0; - } - } else if (unlikely(entry > data->nentries && ((entry - data->nentries) > data->last_entry))) { - /* - * If FW is producing debug buffer at a pace faster than - * we can consume, then we restrict our iteration. - */ - data->last_entry = entry - data->nentries; - } - - /* - * Iterate over indexes. - */ - while (entry > data->last_entry) { - index = offset = (data->last_entry % data->nentries); - offset = (offset * sizeof(struct nss_log_entry)) - + offsetof(struct nss_log_descriptor, log_ring_buffer); - - dma_sync_single_for_cpu(data->nss_ctx->dev, data->dma_addr + offset, - sizeof(struct nss_log_entry), DMA_FROM_DEVICE); - rb = &desc->log_ring_buffer[index]; - - b = scnprintf(msg, sizeof(msg), NSS_LOG_LINE_FORMAT, - rb->thread_num, rb->timestamp, rb->message); - - data->last_entry++; - - /* - * Copy to user buffer and if we fail then we return - * failure. - */ - if (copy_to_user(buf + bytes, msg, b)) { - return -EFAULT; - } - - bytes += b; - - /* - * If we ran out of space in the buffer. - */ - if ((bytes + NSS_LOG_OUTPUT_LINE_SIZE) >= size) - break; - } - - if (bytes > 0) - *ppos = bytes; - - return bytes; -} - -struct file_operations nss_logs_core_ops = { - .owner = THIS_MODULE, - .open = nss_log_open, - .read = nss_log_read, - .release = nss_log_release, - .llseek = nss_log_llseek, -}; - -/* - * nss_debug_interface_set_callback() - * Sets the callback - */ -void nss_debug_interface_set_callback(nss_log_msg_callback_t cb, void *app_data) -{ - nss_debug_interface_cb = cb; - nss_debug_interface_app_data = app_data; -} - -/* - * nss_debug_interface_event() - * Received an event from NSS FW - */ -static void nss_debug_interface_event(void *app_data, struct nss_log_debug_interface_msg *nim) -{ - struct nss_cmn_msg *ncm = (struct nss_cmn_msg *)nim; - - msg_response = ncm->response; - msg_event = true; - wake_up(&msg_wq); -} - -/* - * nss_debug_interface_handler() - * handle NSS -> HLOS messages for debug interfaces - */ -static void nss_debug_interface_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_log_debug_interface_msg *ntm = (struct nss_log_debug_interface_msg *)ncm; - nss_log_msg_callback_t cb; - - BUG_ON(ncm->interface != NSS_DEBUG_INTERFACE); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type > NSS_DEBUG_INTERFACE_TYPE_MAX) { - nss_warning("%px: received invalid message %d for CAPWAP interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_log_debug_interface_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Update the callback and app_data for NOTIFY messages. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_debug_interface_cb; - ncm->app_data = (nss_ptr_t)nss_debug_interface_app_data; - } - - /* - * Do we have a callback - */ - if (!ncm->cb) { - nss_trace("%px: cb is null for interface %d", nss_ctx, ncm->interface); - return; - } - - cb = (nss_log_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ntm); -} - -/* - * nss_debug_interface_tx() - * Transmit a debug interface message to NSS FW - */ -static nss_tx_status_t nss_debug_interface_tx(struct nss_ctx_instance *nss_ctx, struct nss_log_debug_interface_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_DEBUG_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_DEBUG_INTERFACE_TYPE_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_debug_log_buffer_alloc() - * Allocates and Initializes log buffer for the use in NSS FW (logging) - */ -bool nss_debug_log_buffer_alloc(uint8_t nss_id, uint32_t nentry) -{ - struct nss_log_debug_interface_msg msg; - struct nss_log_debug_memory_msg *dbg; - struct nss_top_instance *nss_top; - struct nss_ctx_instance *nss_ctx; - dma_addr_t dma_addr; - uint32_t size; - void *addr = NULL; - nss_tx_status_t status; - - if (nss_id >= nss_top_main.num_nss) { - return false; - } - - nss_top = &nss_top_main; - nss_ctx = &nss_top->nss[nss_id]; - - if (nss_ctx->state != NSS_CORE_STATE_INITIALIZED) { - nss_warning("%px: NSS Core:%d is not initialized yet\n", nss_ctx, nss_id); - return false; - } - - size = sizeof(struct nss_log_descriptor) + (sizeof(struct nss_log_entry) * nentry); - addr = kmalloc(size, GFP_ATOMIC); - if (!addr) { - nss_warning("%px: Failed to allocate memory for logging (size:%d)\n", nss_ctx, size); - return false; - } - - memset(addr, 0, size); - dma_addr = (uint32_t)dma_map_single(nss_ctx->dev, addr, size, DMA_FROM_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, dma_addr))) { - nss_warning("%px: Failed to map address in DMA", nss_ctx); - kfree(addr); - return false; - } - - /* - * If we already have ring buffer associated with nss_id, then - * we must wait before we attach a new ring buffer. - */ - mutex_lock(&nss_log_mutex); - if (nss_rbe[nss_id].addr) { - mutex_unlock(&nss_log_mutex); - - /* - * Someone is using the current logbuffer. Wait until ref count become 0. - * We have to return mutex here, because the current user requires it to - * release the reference. - */ - if (!wait_event_timeout(nss_log_wq, !nss_rbe[nss_id].ref_cnt, 5 * HZ)) { - nss_warning("%px: Timeout waiting for refcnt to become 0\n", nss_ctx); - goto fail; - } - - mutex_lock(&nss_log_mutex); - if (!nss_rbe[nss_id].addr) { - mutex_unlock(&nss_log_mutex); - goto fail; - } - if (nss_rbe[nss_id].ref_cnt > 0) { - mutex_unlock(&nss_log_mutex); - nss_warning("%px: Some other thread is contending..opting out\n", nss_ctx); - goto fail; - } - } - - memset(&msg, 0, sizeof(struct nss_log_debug_interface_msg)); - nss_cmn_msg_init(&msg.cm, NSS_DEBUG_INTERFACE, NSS_DEBUG_INTERFACE_TYPE_LOG_BUF_INIT, - sizeof(struct nss_log_debug_memory_msg), nss_debug_interface_event, NULL); - - dbg = &msg.msg.addr; - dbg->nentry = nentry; - dbg->version = NSS_DEBUG_LOG_VERSION; - dbg->phy_addr = dma_addr; - - msg_event = false; - status = nss_debug_interface_tx(nss_ctx, &msg); - if (status != NSS_TX_SUCCESS) { - mutex_unlock(&nss_log_mutex); - nss_warning("%px: Failed to send message to debug interface:%d\n", nss_ctx, status); - goto fail; - } - - /* - * Wait for 5 seconds since this is a critical operation. - * Mutex is not unlocked here because we do not want someone to acquire the mutex and use the logbuffer - * while we are waiting message from NSS. - */ - if (!wait_event_timeout(msg_wq, msg_event, 5 * HZ)) { - mutex_unlock(&nss_log_mutex); - nss_warning("%px: Timeout send message to debug interface\n", nss_ctx); - goto fail; - } - - if (msg_response != NSS_CMN_RESPONSE_ACK) { - mutex_unlock(&nss_log_mutex); - nss_warning("%px: Response error for send message to debug interface:%d\n", nss_ctx, msg_response); - goto fail; - } - - /* - * If we had to free the previous allocation for ring buffer. - */ - if (nss_rbe[nss_id].addr) { - uint32_t old_size; - old_size = sizeof(struct nss_log_descriptor) + - (sizeof(struct nss_log_entry) * nss_rbe[nss_id].nentries); - dma_unmap_single(nss_ctx->dev, nss_rbe[nss_id].dma_addr, old_size, DMA_FROM_DEVICE); - kfree(nss_rbe[nss_id].addr); - } - - nss_rbe[nss_id].addr = addr; - nss_rbe[nss_id].nentries = nentry; - nss_rbe[nss_id].ref_cnt = 0; - nss_rbe[nss_id].dma_addr = dma_addr; - mutex_unlock(&nss_log_mutex); - wake_up(&nss_log_wq); - return true; - -fail: - dma_unmap_single(nss_ctx->dev, dma_addr, size, DMA_FROM_DEVICE); - kfree(addr); - wake_up(&nss_log_wq); - return false; -} - -/* - * nss_logbuffer_handler() - * Enable NSS debug output - */ -int nss_logbuffer_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - int core_status; - int i; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - if (!write) { - return ret; - } - - if (nss_ctl_logbuf < 32) { - nss_warning("Invalid NSS FW logbuffer size:%d (must be > 32)\n", nss_ctl_logbuf); - nss_ctl_logbuf = 0; - return ret; - } - - for (i = 0; i < nss_top_main.num_nss; i++) { - /* - * Register the callback handler and allocate the debug log buffers - */ - core_status = nss_core_register_handler(&nss_top_main.nss[i], NSS_DEBUG_INTERFACE, nss_debug_interface_handler, NULL); - if (core_status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("NSS logbuffer init failed with register handler:%d\n", core_status); - } - - if (!nss_debug_log_buffer_alloc(i, nss_ctl_logbuf)) { - nss_warning("%d: Failed to set debug log buffer on NSS core", i); - } - } - - return ret; -} - -/* - * nss_log_init() - * Initializes NSS FW logs retrieval logic from /sys - */ -void nss_log_init(void) -{ - int i; - struct dentry *logs_dentry; - struct dentry *core_log_dentry; - - memset(nss_rbe, 0, sizeof(nss_rbe)); - init_waitqueue_head(&nss_log_wq); - init_waitqueue_head(&msg_wq); - - /* - * Create directory for obtaining NSS FW logs from each core - */ - logs_dentry = debugfs_create_dir("logs", nss_top_main.top_dentry); - if (unlikely(!logs_dentry)) { - nss_warning("Failed to create qca-nss-drv/logs directory in debugfs"); - return; - } - - for (i = 0; i < nss_top_main.num_nss; i++) { - char file[16]; - extern struct file_operations nss_logs_core_ops; - - snprintf(file, sizeof(file), "core%d", i); - core_log_dentry = debugfs_create_file(file, 0400, - logs_dentry, (void *)(nss_ptr_t)i, &nss_logs_core_ops); - if (unlikely(!core_log_dentry)) { - nss_warning("Failed to create qca-nss-drv/logs/%s file in debugfs", file); - return; - } - } - - nss_debug_interface_set_callback(nss_debug_interface_event, NULL); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_log.h deleted file mode 100644 index 1d27e9498..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_log.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2015, 2018, 2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ -/* - * nss_log.h - * NSS FW debug log memory header file - */ - -#ifndef __NSS_LOG_H -#define __NSS_LOG_H - -#define NSS_DEBUG_LOG_VERSION 0x1 - -/** - * Dynamic Interface types - */ -enum nss_debug_interface_msg_type { - NSS_DEBUG_INTERFACE_TYPE_NONE = 0, - NSS_DEBUG_INTERFACE_TYPE_LOG_BUF_INIT = 1, - NSS_DEBUG_INTERFACE_TYPE_MAX, -}; - -/* - * The size of each log entry to be displayed. - */ -#define NSS_LOG_OUTPUT_LINE_SIZE 151 /* 5 + 12 + 132 + '\n' + '\0' (see below) */ -#define NSS_LOG_LINE_FORMAT "%3d: %010u: %s\n" -#define NSS_LOG_LINE_WIDTH 132 -#define NSS_LOG_COOKIE 0xFF785634 - -/* - * Dump last N entry during the coredump. - * This number should be lower than the minimum size of the logbuf - * which 32 right now. - */ -#define NSS_LOG_COREDUMP_LINE_NUM 25 - -/* - * Saves the ring buffer address for logging per NSS core - */ -struct nss_log_ring_buffer_addr { - void *addr; /* Pointer to struct nss_log_descriptor */ - dma_addr_t dma_addr; /* DMA Handle */ - uint32_t nentries; /* Number of entries in the ring buffer */ - int ref_cnt; /* Reference count */ -}; - -/* - * nss_log_entry is shared between Host and NSS FW - */ -struct nss_log_entry { - uint64_t sequence_num; /* Sequence number */ - uint32_t cookie; /* Magic for verification */ - uint32_t thread_num; /* thread-id */ - uint32_t timestamp; /* timestamp in ticks */ - char message[NSS_LOG_LINE_WIDTH]; /* actual debug message */ -} __attribute__((aligned(NSS_CACHE_LINE_SIZE))); - -/* - * The NSS log descripts holds ring-buffer along with other variables and - * it is shared between NSS FW and Host. - * - * NSS FW writes to ring buffer and current_entry but read by only Host. - */ -struct nss_log_descriptor { - uint32_t cookie; /* Magic for verification */ - uint32_t log_nentries; /* No.of log entries */ - uint32_t current_entry; /* pointer to current log entry */ - uint8_t pad[20]; /* pad to align ring buffer at cacheline boundary */ - struct nss_log_entry log_ring_buffer[0]; /* The actual log entry ring buffer */ -} __attribute__((aligned(NSS_CACHE_LINE_SIZE))); - -struct nss_log_debug_memory_msg { - uint32_t version; - uint32_t nentry; - uint32_t phy_addr; -}; - -struct nss_log_debug_interface_msg { - struct nss_cmn_msg cm; - union { - struct nss_log_debug_memory_msg addr; - } msg; -}; - -/** - * @brief Callback to receive debug interface messages - * - * @param app_data Application context of the message - * @param msg Message data - * - * @return void - */ -typedef void (*nss_log_msg_callback_t)(void *app_data, struct nss_log_debug_interface_msg *msg); - -/* - * Exported by nss_init.c and used in nss_log.c - */ -extern int nss_ctl_logbuf; - -extern struct nss_log_ring_buffer_addr nss_rbe[NSS_MAX_CORES]; - -#endif /* __NSS_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx.c b/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx.c deleted file mode 100644 index 3abda0101..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014,2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_lso_rx.c - * NSS LSO_RX APIs - */ - -#include -#include "nss_lso_rx_stats.h" -#include "nss_lso_rx_strings.h" - -/* - * nss_rx_lso_rx_interface_handler() - * Handle NSS -> HLOS messages for LSO_RX Changes and Statistics - */ -static void nss_rx_lso_rx_interface_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) { - - struct nss_lso_rx_msg *nlrm = (struct nss_lso_rx_msg *)ncm; - - switch (nlrm->cm.type) { - case NSS_LSO_RX_STATS_SYNC_MSG: - /* - * Update LSO_RX driver statistics and send statistics notifications to the registered modules - */ - nss_lso_rx_stats_sync(nss_ctx, &nlrm->msg.stats_sync); - nss_lso_rx_stats_notify(nss_ctx); - break; - - default: - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - /* - * Check response - */ - nss_info("%px: Received response %d for type %d, interface %d", nss_ctx, ncm->response, ncm->type, ncm->interface); - } - } -} - -/* - * nss_lso_rx_register_handler() - * Register handler for messaging - */ -void nss_lso_rx_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_core_register_handler(nss_ctx, NSS_LSO_RX_INTERFACE, nss_rx_lso_rx_interface_handler, NULL); - nss_lso_rx_stats_dentry_create(); - nss_lso_rx_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_stats.c deleted file mode 100644 index 2763a2a8c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_stats.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_lso_rx_stats.h" -#include "nss_lso_rx_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_lso_rx_stats_notifier); - -uint64_t nss_lso_rx_stats[NSS_LSO_RX_STATS_MAX]; /* LSO_RX statistics */ - -/* - * nss_lso_rx_stats_read() - * Read LSO_RX stats - */ -static ssize_t nss_lso_rx_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * Max output lines = #stats + few blank lines for banner printing + - * Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_LSO_RX_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_LSO_RX_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "lso_rx", NSS_STATS_SINGLE_CORE); - size_wr += nss_stats_fill_common_stats(NSS_LSO_RX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "lso_rx"); - - /* - * lso_rx node stats - */ - - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_LSO_RX_STATS_MAX); i++) { - stats_shadow[i] = nss_lso_rx_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("lso_rx", "lso_rx node stats" - , NSS_STATS_SINGLE_INSTANCE - , nss_lso_rx_strings_stats - , stats_shadow - , NSS_LSO_RX_STATS_MAX - , lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_lso_rx_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(lso_rx); - -/* - * nss_lso_rx_stats_dentry_create() - * Create lso_rx statistics debug entry. - */ -void nss_lso_rx_stats_dentry_create(void) -{ - nss_stats_create_dentry("lso_rx", &nss_lso_rx_stats_ops); -} - -/* - * nss_lso_rx_stats_sync() - * Handle the syncing of lso_rx node statistics. - */ -void nss_lso_rx_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_lso_rx_stats_sync *nlrss) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - int j; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * common node stats - */ - nss_top->stats_node[NSS_LSO_RX_INTERFACE][NSS_STATS_NODE_RX_PKTS] += nlrss->node_stats.rx_packets; - nss_top->stats_node[NSS_LSO_RX_INTERFACE][NSS_STATS_NODE_RX_BYTES] += nlrss->node_stats.rx_bytes; - nss_top->stats_node[NSS_LSO_RX_INTERFACE][NSS_STATS_NODE_TX_PKTS] += nlrss->node_stats.tx_packets; - nss_top->stats_node[NSS_LSO_RX_INTERFACE][NSS_STATS_NODE_TX_BYTES] += nlrss->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_top->stats_node[NSS_LSO_RX_INTERFACE][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nlrss->node_stats.rx_dropped[j]; - } - - /* - * General LSO_RX stats - */ - nss_lso_rx_stats[NSS_LSO_RX_STATS_TX_DROPPED] += nlrss->tx_dropped; - nss_lso_rx_stats[NSS_LSO_RX_STATS_DROPPED] += nlrss->dropped; - - /* - * pbuf - */ - nss_lso_rx_stats[NSS_LSO_RX_STATS_PBUF_ALLOC_FAIL] += nlrss->pbuf_alloc_fail; - nss_lso_rx_stats[NSS_LSO_RX_STATS_PBUF_REFERENCE_FAIL] += nlrss->pbuf_reference_fail; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_lso_rx_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_lso_rx_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - struct nss_lso_rx_stats_notification lso_rx_stats; - - lso_rx_stats.core_id = nss_ctx->id; - memcpy(lso_rx_stats.cmn_node_stats, nss_top_main.stats_node[NSS_LSO_RX_INTERFACE], sizeof(lso_rx_stats.cmn_node_stats)); - memcpy(lso_rx_stats.node_stats, nss_lso_rx_stats, sizeof(lso_rx_stats.node_stats)); - atomic_notifier_call_chain(&nss_lso_rx_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&lso_rx_stats); -} - -/* - * nss_lso_rx_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_lso_rx_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_lso_rx_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_lso_rx_stats_register_notifier); - -/* - * nss_lso_rx_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_lso_rx_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_lso_rx_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_lso_rx_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_stats.h deleted file mode 100644 index 54ab6dc51..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_stats.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_LSO_RX_STATS_H -#define __NSS_LSO_RX_STATS_H - -#include - -/* - * lso_rx_node statistics. - */ -struct nss_lso_rx_stats_sync { - struct nss_cmn_node_stats node_stats; - - uint32_t tx_dropped; /* Number of packets dropped because lso_rx transmit queue is full */ - uint32_t dropped; /* Total of packets dropped by the node internally */ - uint32_t pbuf_alloc_fail; /* Count number of pbuf alloc fails */ - uint32_t pbuf_reference_fail; /* Count number of pbuf ref fails */ - - /* - * If we're generating per-packet statistics then we count total lso_rx processing ticks - * worst-case ticks and the number of iterations around the lso_rx handler that we take. - */ - uint32_t total_ticks; /* Total clock ticks spend inside the lso_rx handler */ - uint32_t worst_case_ticks; - /* Worst case iteration of the lso_rx handler in ticks */ - uint32_t iterations; /* Number of iterations around the lso_rx handler */ -}; - -/* - * Message types for lso_rx - */ -enum nss_lso_rx_metadata_types { - NSS_LSO_RX_STATS_SYNC_MSG, /* Message type - stats sync message */ -}; - -/* - * Message structure to send receive LSO_RX commands - */ -struct nss_lso_rx_msg { - struct nss_cmn_msg cm; /* Message header */ - union { - struct nss_lso_rx_stats_sync stats_sync; /* Stats sub-message */ - } msg; -}; - -/* - * lso_rx statistics APIs - */ -extern void nss_lso_rx_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_lso_rx_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_lso_rx_stats_sync *nlrss); -extern void nss_lso_rx_stats_dentry_create(void); - -#endif /* __NSS_LSO_RX_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_strings.c deleted file mode 100644 index 627f1de08..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_strings.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" -#include "nss_lso_rx_strings.h" - -/* - * nss_lso_rx_strings_stats - * LSO Rx statistics strings. - */ -struct nss_stats_info nss_lso_rx_strings_stats[NSS_LSO_RX_STATS_MAX] = { - {"tx_drops" ,NSS_STATS_TYPE_DROP}, - {"drops" ,NSS_STATS_TYPE_DROP}, - {"pbuf_alloc_fail" ,NSS_STATS_TYPE_ERROR}, - {"pbuf_reference_fail" ,NSS_STATS_TYPE_ERROR} -}; - -/* - * nss_lso_rx_strings_read() - * Read LSO Rx node statistics names. - */ -static ssize_t nss_lso_rx_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_lso_rx_strings_stats, NSS_LSO_RX_STATS_MAX); -} - -/* - * nss_lso_rx_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(lso_rx); - -/* - * nss_lso_rx_strings_dentry_create() - * Create LSO Rx statistics strings debug entry. - */ -void nss_lso_rx_strings_dentry_create(void) -{ - nss_strings_create_dentry("lso_rx", &nss_lso_rx_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_strings.h deleted file mode 100644 index 901ed3073..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_lso_rx_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_LSO_RX_STRINGS_H -#define __NSS_LSO_RX_STRINGS_H - -extern struct nss_stats_info nss_lso_rx_strings_stats[NSS_LSO_RX_STATS_MAX]; -extern void nss_lso_rx_strings_dentry_create(void); - -#endif /* __NSS_LSO_RX_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_map_t.c b/feeds/ipq807x/qca-nss-drv/src/nss_map_t.c deleted file mode 100644 index cfa7ab967..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_map_t.c +++ /dev/null @@ -1,412 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_map_t_stats.h" -#include "nss_map_t_log.h" -#include "nss_map_t_strings.h" - -#define NSS_MAP_T_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Private data structure - */ -static struct { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} nss_map_t_pvt; - -/* - * Data structures to store map_t nss debug stats - */ -static DEFINE_SPINLOCK(nss_map_t_debug_stats_lock); -static struct nss_map_t_stats_instance_debug nss_map_t_debug_stats[NSS_MAX_MAP_T_DYNAMIC_INTERFACES]; - -/* - * nss_map_t_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_map_t_verify_if_num(uint32_t if_num) -{ - enum nss_dynamic_interface_type if_type; - - if (nss_is_dynamic_interface(if_num) == false) { - return false; - } - - if_type = nss_dynamic_interface_get_type(nss_map_t_get_context(), if_num); - switch (if_type) { - case NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_OUTER: - return true; - - default: - return false; - } -} - -/* - * nss_map_t_instance_debug_stats_sync - * debug stats for map_t - */ -void nss_map_t_instance_debug_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_map_t_sync_stats_msg *stats_msg, uint16_t if_num) -{ - int i; - enum nss_dynamic_interface_type if_type; - - if_type = nss_dynamic_interface_get_type(nss_ctx, if_num); - - spin_lock_bh(&nss_map_t_debug_stats_lock); - for (i = 0; i < NSS_MAX_MAP_T_DYNAMIC_INTERFACES; i++) { - if (nss_map_t_debug_stats[i].if_num != if_num) { - continue; - } - switch (if_type) { - case NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_INNER: - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V4_TO_V6_PBUF_EXCEPTION] += - stats_msg->debug_stats.v4_to_v6.exception_pkts; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V4_TO_V6_PBUF_NO_MATCHING_RULE] += - stats_msg->debug_stats.v4_to_v6.no_matching_rule; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V4_TO_V6_PBUF_NOT_TCP_OR_UDP] += - stats_msg->debug_stats.v4_to_v6.not_tcp_or_udp; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_LOCAL_PSID] += - stats_msg->debug_stats.v4_to_v6.rule_err_local_psid; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_LOCAL_IPV6] += - stats_msg->debug_stats.v4_to_v6.rule_err_local_ipv6; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_REMOTE_PSID] += - stats_msg->debug_stats.v4_to_v6.rule_err_remote_psid; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_REMOTE_EA_BITS] += - stats_msg->debug_stats.v4_to_v6.rule_err_remote_ea_bits; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V4_TO_V6_RULE_ERR_REMOTE_IPV6] += - stats_msg->debug_stats.v4_to_v6.rule_err_remote_ipv6; - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_OUTER: - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V6_TO_V4_PBUF_EXCEPTION] += - stats_msg->debug_stats.v6_to_v4.exception_pkts; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V6_TO_V4_PBUF_NO_MATCHING_RULE] += - stats_msg->debug_stats.v6_to_v4.no_matching_rule; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V6_TO_V4_PBUF_NOT_TCP_OR_UDP] += - stats_msg->debug_stats.v6_to_v4.not_tcp_or_udp; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V6_TO_V4_RULE_ERR_LOCAL_IPV4] += - stats_msg->debug_stats.v6_to_v4.rule_err_local_ipv4; - nss_map_t_debug_stats[i].stats[NSS_MAP_T_STATS_V6_TO_V4_RULE_ERR_REMOTE_IPV4] += - stats_msg->debug_stats.v6_to_v4.rule_err_remote_ipv4; - break; - - default: - nss_warning("Invalid MAP-T interface encountered: %u\n", if_type); - break; - } - } - spin_unlock_bh(&nss_map_t_debug_stats_lock); -} - -/* - * nss_map_t_instance_debug_stats_get() - * Get map_t statitics. - */ -void nss_map_t_instance_debug_stats_get(void *stats_mem) -{ - struct nss_map_t_stats_instance_debug *stats = (struct nss_map_t_stats_instance_debug *)stats_mem; - int i; - - if (!stats) { - nss_warning("No memory to copy map_t stats"); - return; - } - - spin_lock_bh(&nss_map_t_debug_stats_lock); - for (i = 0; i < NSS_MAX_MAP_T_DYNAMIC_INTERFACES; i++) { - if (nss_map_t_debug_stats[i].valid) { - memcpy(stats, &nss_map_t_debug_stats[i], sizeof(struct nss_map_t_stats_instance_debug)); - stats++; - } - } - spin_unlock_bh(&nss_map_t_debug_stats_lock); -} - -/* - * nss_map_t_handler() - * Handle NSS -> HLOS messages for map_t tunnel - */ -static void nss_map_t_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_map_t_msg *ntm = (struct nss_map_t_msg *)ncm; - void *ctx; - - nss_map_t_msg_callback_t cb; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - BUG_ON(!nss_map_t_verify_if_num(ncm->interface)); - - /* - * Trace Messages - */ - nss_map_t_log_rx_msg(ntm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_MAP_T_MSG_MAX) { - nss_warning("%px: received invalid message %d for MAP-T interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_map_t_msg)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return; - } - - switch (ntm->cm.type) { - case NSS_MAP_T_MSG_SYNC_STATS: - /* - * Update debug stats in stats msg and send statistics notifications to the registered modules - */ - nss_map_t_instance_debug_stats_sync(nss_ctx, &ntm->msg.stats, ncm->interface); - nss_map_t_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, map_t sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->map_t_msg_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * callback - */ - cb = (nss_map_t_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call map-t callback - */ - if (!cb) { - nss_warning("%px: No callback for map-t interface %d", - nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_map_t_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_map_t_callback(void *app_data, struct nss_map_t_msg *nim) -{ - nss_map_t_msg_callback_t callback = (nss_map_t_msg_callback_t)nss_map_t_pvt.cb; - void *data = nss_map_t_pvt.app_data; - - nss_map_t_pvt.cb = NULL; - nss_map_t_pvt.app_data = NULL; - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("map_t Error response %d\n", nim->cm.response); - nss_map_t_pvt.response = NSS_TX_FAILURE; - } else { - nss_map_t_pvt.response = NSS_TX_SUCCESS; - } - - if (callback) { - callback(data, nim); - } - - complete(&nss_map_t_pvt.complete); -} - -/* - * nss_map_t_tx() - * Transmit a map_t message to NSS firmware - */ -nss_tx_status_t nss_map_t_tx(struct nss_ctx_instance *nss_ctx, struct nss_map_t_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_map_t_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (!nss_map_t_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request is not for a MAP-T dynamic interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_MAP_T_MSG_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_map_t_tx); - -/* - * nss_map_t_tx_sync() - * Transmit a MAP-T message to NSS firmware synchronously. - */ -nss_tx_status_t nss_map_t_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_map_t_msg *msg) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_map_t_pvt.sem); - nss_map_t_pvt.cb = (void *)msg->cm.cb; - nss_map_t_pvt.app_data = (void *)msg->cm.app_data; - - msg->cm.cb = (nss_ptr_t)nss_map_t_callback; - msg->cm.app_data = (nss_ptr_t)NULL; - - status = nss_map_t_tx(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: map_t_tx_msg failed\n", nss_ctx); - up(&nss_map_t_pvt.sem); - return status; - } - ret = wait_for_completion_timeout(&nss_map_t_pvt.complete, msecs_to_jiffies(NSS_MAP_T_TX_TIMEOUT)); - - if (!ret) { - nss_warning("%px: MAP-T tx sync failed due to timeout\n", nss_ctx); - nss_map_t_pvt.response = NSS_TX_FAILURE; - } - - status = nss_map_t_pvt.response; - up(&nss_map_t_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_map_t_tx_sync); - -/* - *********************************** - * Register/Unregister/Miscellaneous APIs - *********************************** - */ - -/* - * nss_map_t_register_if() - */ -struct nss_ctx_instance *nss_map_t_register_if(uint32_t if_num, uint32_t type, nss_map_t_callback_t map_t_callback, - nss_map_t_msg_callback_t event_callback, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.map_t_handler_id]; - int i = 0; - - nss_assert(nss_ctx); - nss_assert(nss_map_t_verify_if_num(if_num)); - - nss_core_register_subsys_dp(nss_ctx, if_num, map_t_callback, 0, netdev, netdev, features); - nss_ctx->subsys_dp_register[if_num].type = type; - - nss_top_main.map_t_msg_callback = event_callback; - - nss_core_register_handler(nss_ctx, if_num, nss_map_t_handler, NULL); - - spin_lock_bh(&nss_map_t_debug_stats_lock); - for (i = 0; i < NSS_MAX_MAP_T_DYNAMIC_INTERFACES; i++) { - if (!nss_map_t_debug_stats[i].valid) { - nss_map_t_debug_stats[i].valid = true; - nss_map_t_debug_stats[i].if_num = if_num; - nss_map_t_debug_stats[i].if_index = netdev->ifindex; - break; - } - } - spin_unlock_bh(&nss_map_t_debug_stats_lock); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_map_t_register_if); - -/* - * nss_map_t_unregister_if() - */ -void nss_map_t_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.map_t_handler_id]; - int i; - - nss_assert(nss_ctx); - nss_assert(nss_map_t_verify_if_num(if_num)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.map_t_msg_callback = NULL; - - nss_core_unregister_handler(nss_ctx, if_num); - - spin_lock_bh(&nss_map_t_debug_stats_lock); - for (i = 0; i < NSS_MAX_MAP_T_DYNAMIC_INTERFACES; i++) { - if (nss_map_t_debug_stats[i].if_num == if_num) { - memset(&nss_map_t_debug_stats[i], 0, sizeof(struct nss_map_t_stats_instance_debug)); - break; - } - } - spin_unlock_bh(&nss_map_t_debug_stats_lock); -} -EXPORT_SYMBOL(nss_map_t_unregister_if); - -/* - * nss_get_map_t_context() - */ -struct nss_ctx_instance *nss_map_t_get_context() -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.map_t_handler_id]; -} -EXPORT_SYMBOL(nss_map_t_get_context); - -/* - * nss_map_t_msg_init() - * Initialize nss_map_t msg. - */ -void nss_map_t_msg_init(struct nss_map_t_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_map_t_msg_init); - -/* - * nss_map_t_register_handler() - * debugfs stats msg handler received on static map_t interface - */ -void nss_map_t_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_map_t_get_context(); - - nss_info("nss_map_t_register_handler"); - sema_init(&nss_map_t_pvt.sem, 1); - init_completion(&nss_map_t_pvt.complete); - nss_core_register_handler(nss_ctx, NSS_MAP_T_INTERFACE, nss_map_t_handler, NULL); - - nss_map_t_stats_dentry_create(); - nss_map_t_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_map_t_log.c deleted file mode 100644 index 5f1ef397b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_log.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_map_t_log.c - * NSS MAP_T logger file. - */ - -#include "nss_core.h" - -/* - * nss_map_t_log_message_types_str - * NSS MAP_T message strings - */ -static int8_t *nss_map_t_log_message_types_str[NSS_MAP_T_MSG_MAX] __maybe_unused = { - "MAP_T Rule Configure", - "MAP_T Rule Deconfigure", - "MAP_T Stats", -}; - -/* - * nss_map_t_log_rule_configure_msg() - * Log NSS MAP_T Rule Configure. - */ -static void nss_map_t_log_rule_configure_msg(struct nss_map_t_msg *ntm) -{ - struct nss_map_t_instance_rule_config_msg *ntcm __maybe_unused = &ntm->msg.create_msg; - nss_trace("%px: NSS MAP_T Rule Configure message \n" - "MAP_T Rule Seq Number: %d\n" - "MAP_T Total Number of Rules: %d\n" - "MAP_T Local IPv6 Prefix Length: %d\n" - "MAP_T Local IPv4 Prefix: %d\n" - "MAP_T Local IPv4 Prefix Length: %d\n" - "MAP_T Local EA Bits Length: %d\n" - "MAP_T Local PSID Offset: %d\n" - "MAP_T Reserved A: %d\n" - "MAP_T Remote IPv6 Prefix Length: %d\n" - "MAP_T Remote IPv4 Prefix: %d\n" - "MAP_T Remote IPv4 Prefix Length: %d\n" - "MAP_T Remote EA Bits Length: %d\n" - "MAP_T Remote PSID Offset: %d\n" - "MAP_T Local MAP Style: %d\n" - "MAP_T Remote Map Style: %d\n" - "MAP_T Local IPv6 Prefix: %px\n" - "MAP_T Reserved B: %px\n" - "MAP_T Remote IPv6 Prefix: %px\n" - "MAP_T Valid Rule: %d\n", - ntcm, ntcm->rule_num, ntcm->total_rules, - ntcm->local_ipv6_prefix_len, ntcm->local_ipv4_prefix, - ntcm->local_ipv4_prefix_len, ntcm->local_ea_len, - ntcm->local_psid_offset, ntcm->reserve_a, - ntcm->remote_ipv6_prefix_len, - ntcm->remote_ipv4_prefix, ntcm->remote_ipv4_prefix_len, - ntcm->remote_ea_len, ntcm->remote_psid_offset, - ntcm->local_map_style, ntcm->remote_map_style, - ntcm->local_ipv6_prefix, ntcm->reserve_b, - ntcm->remote_ipv6_prefix, ntcm->valid_rule); -} - -/* - * nss_map_t_log_rule_deconfig_msg() - * Log NSS MAP_T Rule Deconfigure. - */ -static void nss_map_t_log_rule_deconfig_msg(struct nss_map_t_msg *ntm) -{ - struct nss_map_t_instance_rule_deconfig_msg *ntdm __maybe_unused = &ntm->msg.destroy_msg; - nss_trace("%px: NSS MAP_T Rule Deconfigure message \n" - "MAP_T Interface Number: %d\n", - ntdm, ntdm->if_number); -} - -/* - * nss_map_t_log_verbose() - * Log message contents. - */ -static void nss_map_t_log_verbose(struct nss_map_t_msg *ntm) -{ - switch (ntm->cm.type) { - case NSS_MAP_T_MSG_INSTANCE_RULE_CONFIGURE: - nss_map_t_log_rule_configure_msg(ntm); - break; - - case NSS_MAP_T_MSG_INSTANCE_RULE_DECONFIGURE: - nss_map_t_log_rule_deconfig_msg(ntm); - break; - - case NSS_MAP_T_MSG_SYNC_STATS: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", ntm); - break; - } -} - -/* - * nss_map_t_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_map_t_log_tx_msg(struct nss_map_t_msg *ntm) -{ - if (ntm->cm.type >= NSS_MAP_T_MSG_MAX) { - nss_warning("%px: Invalid message type\n", ntm); - return; - } - - nss_info("%px: type[%d]:%s\n", ntm, ntm->cm.type, nss_map_t_log_message_types_str[ntm->cm.type]); - nss_map_t_log_verbose(ntm); -} - -/* - * nss_map_t_log_rx_msg() - * Log messages received from FW. - */ -void nss_map_t_log_rx_msg(struct nss_map_t_msg *ntm) -{ - if (ntm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ntm); - return; - } - - if (ntm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ntm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type, - nss_map_t_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - ntm, ntm->cm.type, nss_map_t_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response]); - -verbose: - nss_map_t_log_verbose(ntm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_map_t_log.h deleted file mode 100644 index 39448898d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_MAP_T_LOG_H -#define __NSS_MAP_T_LOG_H - -/* - * nss_map_t.h - * NSS MAP_T header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_map_t_log_tx_msg - * Logs a map_t message that is sent to the NSS firmware. - */ -void nss_map_t_log_tx_msg(struct nss_map_t_msg *ntm); - -/* - * nss_map_t_log_rx_msg - * Logs a map_t message that is received from the NSS firmware. - */ -void nss_map_t_log_rx_msg(struct nss_map_t_msg *ntm); - -#endif /* __NSS_MAP_T_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.c deleted file mode 100644 index 2dc4d9fa6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017,2019-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_map_t_stats.h" -#include "nss_map_t_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_map_t_stats_notifier); - -/* - * nss_map_t_stats_read() - * Read map_t statistics - */ -static ssize_t nss_map_t_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - - uint32_t max_output_lines = 2 /* header & footer for instance stats */ - + NSS_MAX_MAP_T_DYNAMIC_INTERFACES * (NSS_MAP_T_STATS_MAX + 2) /*instance stats */ - + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - struct nss_map_t_stats_instance_debug map_t_instance_stats[NSS_MAX_MAP_T_DYNAMIC_INTERFACES]; - int id, i; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - memset(&map_t_instance_stats, 0, sizeof(struct nss_map_t_stats_instance_debug) * NSS_MAX_MAP_T_DYNAMIC_INTERFACES); - - /* - * Get all stats - */ - nss_map_t_instance_debug_stats_get((void *)&map_t_instance_stats); - - /* - * Session stats - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nmap_t instance stats start:\n\n"); - for (id = 0; id < NSS_MAX_MAP_T_DYNAMIC_INTERFACES; id++) { - - if (!map_t_instance_stats[id].valid) { - continue; - } - - dev = dev_get_by_index(&init_net, map_t_instance_stats[id].if_index); - if (likely(dev)) { - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d, netdevice=%s\n", id, - map_t_instance_stats[id].if_num, dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d\n", id, - map_t_instance_stats[id].if_num); - } - - for (i = 0; i < NSS_MAP_T_STATS_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %llu\n", nss_map_t_strings_instance_stats[i].stats_name, - map_t_instance_stats[id].stats[i]); - } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nmap_t instance stats end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(lbuf); - return bytes_read; -} - -/* - * nss_map_t_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(map_t); - -/* - * nss_map_t_stats_dentry_create() - * Create map_t statistics debug entry. - */ -void nss_map_t_stats_dentry_create(void) -{ - nss_stats_create_dentry("map_t", &nss_map_t_stats_ops); -} - -/* - * nss_map_t_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_map_t_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_map_t_stats_notification map_t_stats; - struct nss_map_t_stats_instance_debug map_t_instance_stats[NSS_MAX_MAP_T_DYNAMIC_INTERFACES]; - int id; - - memset(&map_t_instance_stats, 0, sizeof(map_t_instance_stats)); - - /* - * Get all stats - */ - nss_map_t_instance_debug_stats_get((void *)&map_t_instance_stats); - - for (id = 0; id < NSS_MAX_MAP_T_DYNAMIC_INTERFACES; id++) { - if (map_t_instance_stats[id].if_num == if_num) { - memcpy(&map_t_stats.stats, &map_t_instance_stats[id].stats, sizeof(map_t_stats.stats)); - } - } - map_t_stats.if_type = nss_dynamic_interface_get_type(nss_ctx, if_num); - map_t_stats.core_id = nss_ctx->id; - map_t_stats.if_num = if_num; - atomic_notifier_call_chain(&nss_map_t_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&map_t_stats); -} - -/* - * nss_map_t_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_map_t_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_map_t_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_map_t_stats_register_notifier); - -/* - * nss_map_t_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_map_t_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_map_t_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_map_t_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.h deleted file mode 100644 index 8fa623afc..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_stats.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017,2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_MAP_T_STATS_H -#define __NSS_MAP_T_STATS_H - -/* - * NSS core stats -- for H2N/N2H map_t debug stats - */ -struct nss_map_t_stats_instance_debug { - uint64_t stats[NSS_MAP_T_STATS_MAX]; - int32_t if_index; - uint32_t if_num; /* nss interface number */ - bool valid; -}; - -/* - * MAP-T statistics APIs - */ -extern void nss_map_t_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_map_t_stats_dentry_create(void); - -#endif /* __NSS_MAP_T_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_map_t_strings.c deleted file mode 100644 index 90fbf7ec3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_strings.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_map_t_strings_instance_stats - * MAP-T statistics strings for NSS session statistics. - */ -struct nss_stats_info nss_map_t_strings_instance_stats[NSS_MAP_T_STATS_MAX] = { - {"V4_TO_V6_PBUF_EXCEPTION_PKTS", NSS_STATS_TYPE_EXCEPTION}, - {"V4_TO_V6_PBUF_NO_MATCHING_RULE", NSS_STATS_TYPE_SPECIAL}, - {"V4_TO_V6_PBUF_NOT_TCP_OR_UDP", NSS_STATS_TYPE_SPECIAL}, - {"V4_TO_V6_RULE_ERR_LOCAL_PSID", NSS_STATS_TYPE_ERROR}, - {"V4_TO_V6_RULE_ERR_LOCAL_IPV6", NSS_STATS_TYPE_ERROR}, - {"V4_TO_V6_RULE_ERR_REMOTE_PSID", NSS_STATS_TYPE_ERROR}, - {"V4_TO_V6_RULE_ERR_REMOTE_EA_BITS", NSS_STATS_TYPE_ERROR}, - {"V4_TO_V6_RULE_ERR_REMOTE_IPV6", NSS_STATS_TYPE_ERROR}, - {"V6_TO_V4_PBUF_EXCEPTION_PKTS", NSS_STATS_TYPE_EXCEPTION}, - {"V6_TO_V4_PBUF_NO_MATCHING_RULE", NSS_STATS_TYPE_SPECIAL}, - {"V6_TO_V4_PBUF_NOT_TCP_OR_UDP", NSS_STATS_TYPE_SPECIAL}, - {"V6_TO_V4_RULE_ERR_LOCAL_IPV4", NSS_STATS_TYPE_ERROR}, - {"V6_TO_V4_RULE_ERR_REMOTE_IPV4", NSS_STATS_TYPE_ERROR} -}; - -/* - * nss_map_t_strings_read() - * Read MAP-T node statistics names. - */ -static ssize_t nss_map_t_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_map_t_strings_instance_stats, NSS_MAP_T_STATS_MAX); -} - -/* - * nss_map_t_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(map_t); - -/* - * nss_map_t_strings_dentry_create() - * Create MAP-T statistics strings debug entry. - */ -void nss_map_t_strings_dentry_create(void) -{ - nss_strings_create_dentry("map_t", &nss_map_t_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_map_t_strings.h deleted file mode 100644 index acf2cd0b2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_map_t_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_MAP_T_STRINGS_H -#define __NSS_MAP_T_STRINGS_H - -extern struct nss_stats_info nss_map_t_strings_instance_stats[NSS_MAP_T_STATS_MAX]; -extern void nss_map_t_strings_dentry_create(void); - -#endif /* __NSS_MAP_T_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match.c b/feeds/ipq807x/qca-nss-drv/src/nss_match.c deleted file mode 100644 index dcdfa6cba..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match.c +++ /dev/null @@ -1,299 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -/* - * nss_match.c - */ - -#include "nss_tx_rx_common.h" -#include "nss_match_log.h" -#include "nss_match_stats.h" -#include "nss_match_strings.h" - -#define NSS_MATCH_TX_TIMEOUT 1000 /* 1 Seconds */ - -/* - * Private data structure for match interface - */ -static struct nss_match_pvt { - struct semaphore sem; - struct completion complete; - int32_t response; -} match_pvt; - -/* - * nss_get_match_context() - */ -struct nss_ctx_instance *nss_match_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.match_handler_id]; -} -EXPORT_SYMBOL(nss_match_get_context); - -/* - * nss_match_verify_if_num() - */ -static bool nss_match_verify_if_num(uint32_t if_num) -{ - if (nss_is_dynamic_interface(if_num) == false) { - return false; - } - - if (nss_dynamic_interface_get_type(nss_match_get_context(), if_num) - != NSS_DYNAMIC_INTERFACE_TYPE_MATCH) { - return false; - } - - return true; -} - -/* - * nss_match_msg_sync_callback - * Callback to handle the completion of NSS to HLOS messages. - */ -static void nss_match_msg_sync_callback(void *app_data, struct nss_match_msg *matchm) -{ - match_pvt.response = NSS_TX_SUCCESS; - - if (matchm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("Match Error response %d\n", matchm->cm.response); - match_pvt.response = NSS_TX_FAILURE; - } - - complete(&match_pvt.complete); -} - -/* - * nss_match_msg_tx() - * Sends message to NSS. - */ -static nss_tx_status_t nss_match_msg_tx(struct nss_ctx_instance *nss_ctx, struct nss_match_msg *matchm) -{ - struct nss_cmn_msg *ncm = &matchm->cm; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Trace Messages - */ - nss_match_log_tx_msg(matchm); - - /* - * Sanity check the message - */ - if (!nss_match_verify_if_num(ncm->interface)) { - nss_warning("%px: Tx request for non dynamic interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_MATCH_MSG_MAX) { - nss_warning("%px: Message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, matchm, sizeof(*matchm), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_match_handler() - * Handle NSS to HLOS messages for Match node - */ -static void nss_match_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_match_msg *nem = (struct nss_match_msg *)ncm; - - nss_match_msg_sync_callback_t cb; - void *ctx; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - BUG_ON(!nss_match_verify_if_num(ncm->interface)); - - /* - * Trace Messages - */ - nss_match_log_rx_msg(nem); - - /* - * Is this a valid request/response packet? - */ - if (nem->cm.type >= NSS_MATCH_MSG_MAX) { - nss_warning("%px: Received invalid message %d for MATCH interface", nss_ctx, nem->cm.type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_match_msg)) { - nss_warning("%px: Unexpected message length: %d, on interface: %d", - nss_ctx, nss_cmn_get_msg_len(ncm), ncm->interface); - return; - } - - switch (nem->cm.type) { - case NSS_MATCH_STATS_SYNC: - - /* - * Update common node statistics - */ - nss_match_stats_sync(nss_ctx, nem); - nss_match_stats_notify(nss_ctx, nem->cm.interface); - } - - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_match_msg_sync_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - cb(ctx, nem); -} - -/* - * nss_match_msg_tx_sync() - * Send a message to match node and wait for the response. - */ -nss_tx_status_t nss_match_msg_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_match_msg *matchm) -{ - nss_tx_status_t status; - int ret = 0; - down(&match_pvt.sem); - - matchm->cm.cb = (nss_ptr_t)nss_match_msg_sync_callback; - matchm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_match_msg_tx(nss_ctx, matchm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_match_msg_tx failed\n", nss_ctx); - up(&match_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&match_pvt.complete, msecs_to_jiffies(NSS_MATCH_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: MATCH tx failed due to timeout\n", nss_ctx); - match_pvt.response = NSS_TX_FAILURE; - } - - status = match_pvt.response; - up(&match_pvt.sem); - - return status; -} -EXPORT_SYMBOL(nss_match_msg_tx_sync); - -/* - * nss_match_unregister_instance() - * Unregisters match instance. - */ -bool nss_match_unregister_instance(int if_num) -{ - struct nss_ctx_instance *nss_ctx; - uint32_t status; - - nss_ctx = nss_match_get_context(); - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_match_verify_if_num(if_num)) { - nss_warning("%px: Incorrect interface number: %d", nss_ctx, if_num); - return false; - } - - nss_core_unregister_handler(nss_ctx, if_num); - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for interface %d with NSS core\n", nss_ctx, if_num); - return false; - } - - nss_match_ifnum_delete(if_num); - - return true; -} -EXPORT_SYMBOL(nss_match_unregister_instance); - -/* - * nss_match_register_instance() - * Registers match instance. - */ -struct nss_ctx_instance *nss_match_register_instance(int if_num, nss_match_msg_sync_callback_t notify_cb) -{ - struct nss_ctx_instance *nss_ctx; - uint32_t status; - - nss_ctx = nss_match_get_context(); - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_match_verify_if_num(if_num)) { - nss_warning("%px: Incorrect interface number: %d", nss_ctx, if_num); - return NULL; - } - - nss_core_register_handler(nss_ctx, if_num, nss_match_handler, NULL); - status = nss_core_register_msg_handler(nss_ctx, if_num, (nss_if_rx_msg_callback_t)notify_cb); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to register handler for interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - if (!nss_match_ifnum_add(if_num)) { - nss_warning("%px: Unable to add match inteface : %u\n", nss_ctx, if_num); - nss_core_unregister_handler(nss_ctx, if_num); - nss_core_unregister_msg_handler(nss_ctx, if_num); - return NULL; - } - - return nss_ctx; -} -EXPORT_SYMBOL(nss_match_register_instance); - -/* - * nss_match_msg_init() - * Initialize match message. - */ -void nss_match_msg_init(struct nss_match_msg *nmm, uint16_t if_num, uint32_t type, uint32_t len, - nss_match_msg_sync_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nmm->cm, if_num, type, len, (void*)cb, app_data); -} -EXPORT_SYMBOL(nss_match_msg_init); - -/* - * nss_match_init() - * Initialize match. - */ -void nss_match_init() -{ - nss_match_stats_dentry_create(); - nss_match_strings_dentry_create(); - sema_init(&match_pvt.sem, 1); - init_completion(&match_pvt.complete); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_match_log.c deleted file mode 100644 index 2afdf6425..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match_log.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -/* - * nss_match_log.c - * NSS match logger file. - */ - -#include "nss_core.h" - -/* - * nss_match_log_message_types_str - * Match message strings. - */ -static char *nss_match_log_message_types_str[NSS_MATCH_MSG_MAX] __maybe_unused = { - "Match no message", - "Match profile configure", - "Match add VoW rule", - "Match add L2 rule", - "Match delete VoW rule", - "Match delete L2 rule", - "Match sync stats" -}; - -/* - * nss_match_log_error_types_str - * Strings for error types for match messages - */ -static char *nss_match_log_error_types_str[NSS_MATCH_ERROR_MAX] __maybe_unused = { - "Match success", - "Match unknown message", - "Match DSCP is not in the range", - "Match 802.1p outer is not in the range", - "Match 802.1p inner is not in the range", - "Match rule ID is not in the range", - "Match action type is not in the range", - "Match rule ID already exists", - "Match rule ID doesn't exists", - "Match instance already configured", - "Match profile configuration message is invalid", - "Match database initialzation failed", - "Match table ID is not in the range", - "Match error in adding rule", - "Match error in deleting rule", - "Match error in adding table", - "Match error in deleting table", - "Match error mask ID is not in the range", - "Match error next node interface number is invalid", -}; - -/* - * nss_match_log_profile_configure_msg() - * Log NSS match profile configuration message. - */ -static void nss_match_log_profile_configure_msg(struct nss_match_msg *nmm) -{ - struct nss_match_profile_configure_msg *nmcm __maybe_unused = &nmm->msg.configure_msg; - int mask_num, mask_word; - - nss_trace("%px: NSS match configuration message \n" - "Match profile type: %u \n" - "Match mask flag: %u \n", - nmcm, - nmcm->profile_type, - nmcm->valid_mask_flag); - - for (mask_num = 0; mask_num < NSS_MATCH_MASK_MAX; mask_num++) { - nss_trace("Match mask number %d\n", mask_num + 1); - for (mask_word = 0; mask_word < NSS_MATCH_MASK_WORDS_MAX; mask_word++) { - nss_trace("%x ", nmcm->maskset[mask_num][mask_word]); - } - } -} - -/* - * nss_match_log_vow_rule_msg() - * Log NSS match VoW rule message. - */ -static void nss_match_log_vow_rule_msg(struct nss_match_msg *nmm) -{ - struct nss_match_rule_vow_msg *nmvrm __maybe_unused = &nmm->msg.vow_rule; - nss_trace("%px: NSS match VoW rule message \n" - "Match rule id: %hu \n" - "Match mask id: %hu \n" - "Match action: action flag = %u, next node = %u, priority = %hu \n" - "Match interface number: %u \n" - "Match DSCP: %hu \n" - "Match outer_8021p: %hu \n" - "Match inner_8021p: %hu \n", - nmvrm, - nmvrm->rule_id, - nmvrm->mask_id, - nmvrm->action.action_flag, nmvrm->action.forward_ifnum, nmvrm->action.setprio, - nmvrm->if_num, - nmvrm->dscp, - nmvrm->outer_8021p, - nmvrm->inner_8021p); -} - -/* - * nss_match_log_l2_rule_msg() - * Log NSS match L2 rule message. - */ -static void nss_match_log_l2_rule_msg(struct nss_match_msg *nmm) -{ - struct nss_match_rule_l2_msg *nmlrm __maybe_unused = &nmm->msg.l2_rule; - nss_trace("%px: NSS match L2 rule message \n" - "Match rule id: %hu \n" - "Match mask id: %hu \n" - "Match action: action flag = %u, next node = %u, priority = %hu \n" - "Match interface number: %u \n" - "Match destination mac address: %x :%x :%x \n" - "Match source mac address: %x :%x :%x \n" - "Match ether type: %x \n", - nmlrm, - nmlrm->rule_id, - nmlrm->mask_id, - nmlrm->action.action_flag, nmlrm->action.forward_ifnum, nmlrm->action.setprio, - nmlrm->if_num, - nmlrm->dmac[0], nmlrm->dmac[1], nmlrm->dmac[2], - nmlrm->smac[0], nmlrm->smac[1], nmlrm->smac[2], - nmlrm->ethertype); - -} - -/* - * nss_clmap_log_verbose() - * Log message contents. - */ -static void nss_match_log_verbose(struct nss_match_msg *nmm) -{ - switch (nmm->cm.type) { - case NSS_MATCH_TABLE_CONFIGURE_MSG: - nss_match_log_profile_configure_msg(nmm); - break; - - case NSS_MATCH_ADD_VOW_RULE_MSG: - nss_match_log_vow_rule_msg(nmm); - break; - - case NSS_MATCH_ADD_L2_RULE_MSG: - nss_match_log_l2_rule_msg(nmm); - break; - - case NSS_MATCH_DELETE_VOW_RULE_MSG: - nss_match_log_vow_rule_msg(nmm); - break; - - case NSS_MATCH_DELETE_L2_RULE_MSG: - nss_match_log_l2_rule_msg(nmm); - break; - - case NSS_MATCH_STATS_SYNC: - break; - - default: - nss_trace("%px: Invalid message type\n", nmm); - break; - } -} - -/* - * nss_match_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_match_log_tx_msg(struct nss_match_msg *nmm) -{ - if (nmm->cm.type >= NSS_MATCH_MSG_MAX) { - nss_warning("%px: Invalid message type\n", nmm); - return; - } - - nss_info("%px: type[%d]:%s\n", nmm, nmm->cm.type, nss_match_log_message_types_str[nmm->cm.type]); - nss_match_log_verbose(nmm); -} - -/* - * nss_match_log_rx_msg() - * Log messages received from FW. - */ -void nss_match_log_rx_msg(struct nss_match_msg *nmm) -{ - if (nmm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nmm); - return; - } - - if (nmm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nmm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nmm, nmm->cm.type, - nss_match_log_message_types_str[nmm->cm.type], - nmm->cm.response, nss_cmn_response_str[nmm->cm.response]); - goto verbose; - } - - if (nmm->cm.error >= NSS_MATCH_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nmm, nmm->cm.type, nss_match_log_message_types_str[nmm->cm.type], - nmm->cm.response, nss_cmn_response_str[nmm->cm.response], - nmm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nmm, nmm->cm.type, nss_match_log_message_types_str[nmm->cm.type], - nmm->cm.response, nss_cmn_response_str[nmm->cm.response], - nmm->cm.error, nss_match_log_error_types_str[nmm->cm.error]); - -verbose: - nss_match_log_verbose(nmm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_match_log.h deleted file mode 100644 index df5b8a9e3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match_log.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_MATCH_LOG_H__ -#define __NSS_MATCH_LOG_H__ - -/** - * nss_match_log.h - * NSS match Log Header File. - */ - -/* - * nss_match_log_tx_msg - * Logs a match message that is sent to the NSS firmware. - */ -void nss_match_log_tx_msg(struct nss_match_msg *nmm); - -/* - * nss_match_log_rx_msg - * Logs a match message that is received from the NSS firmware. - */ -void nss_match_log_rx_msg(struct nss_match_msg *nmm); - -#endif /* __NSS_MATCH_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.c deleted file mode 100644 index 29782342f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -/* - * nss_match_stats.c - */ -#include "nss_core.h" -#include "nss_stats.h" -#include -#include "nss_match_stats.h" -#include "nss_match_strings.h" - -#define NSS_MATCH_STATS_SIZE_PER_IF (NSS_STATS_MAX_STR_LENGTH * NSS_STATS_NODE_MAX) - /* Total number of statistics per match interface. */ - -int match_ifnum[NSS_MATCH_INSTANCE_MAX] = {0}; -uint64_t nss_match_stats[NSS_MATCH_INSTANCE_MAX][NSS_MATCH_STATS_MAX]; -static DEFINE_SPINLOCK(nss_match_stats_lock); - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_match_stats_notifier); - -/* - * nss_match_stats_read() - * Read match node statiistics. - */ -static ssize_t nss_match_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_MATCH_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines * NSS_MATCH_INSTANCE_MAX; - ssize_t bytes_read = 0; - size_t size_wr = 0; - uint32_t if_num; - int index; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "match stats", NSS_STATS_SINGLE_CORE); - - /* - * Common node stats for each match dynamic interface. - */ - for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { - - spin_lock_bh(&nss_match_stats_lock); - if_num = match_ifnum[index]; - spin_unlock_bh(&nss_match_stats_lock); - - if (if_num) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nMatch node if_num:%03u", if_num); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n ---------------------- \n"); - size_wr += nss_stats_print("match", NULL, NSS_STATS_SINGLE_INSTANCE, nss_match_strings_stats, - nss_match_stats[index], NSS_MATCH_STATS_MAX, lbuf, size_wr, size_al); - continue; - } - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - return bytes_read; -} - - -/* - * nss_match_stats_sync() - * Update match common node statistics. - */ -void nss_match_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_match_msg *nmm) -{ - struct nss_match_stats_sync *ndccs = &nmm->msg.stats; - uint64_t *ctx_stats; - uint32_t *msg_stats; - uint32_t if_num; - uint16_t i = 0; - int index; - - for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { - spin_lock_bh(&nss_match_stats_lock); - if_num = match_ifnum[index]; - spin_unlock_bh(&nss_match_stats_lock); - - if (if_num == nmm->cm.interface) { - break; - } - } - - if (index == NSS_MATCH_INSTANCE_MAX) { - nss_warning("Invalid Match index\n"); - return; - } - - spin_lock_bh(&nss_match_stats_lock); - msg_stats = (uint32_t *)ndccs; - ctx_stats = nss_match_stats[index]; - - for (i = 0; i < NSS_MATCH_STATS_MAX; i++, ctx_stats++, msg_stats++) { - *ctx_stats += *msg_stats; - } - - spin_unlock_bh(&nss_match_stats_lock); -} - -/* - * nss_match_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(match) - -/* - * nss_match_ifnum_add() - * Add match node interface ID. - */ -bool nss_match_ifnum_add(int if_num) -{ - int index = 0; - - spin_lock_bh(&nss_match_stats_lock); - - for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { - if (match_ifnum[index]) { - continue; - } - - match_ifnum[index] = if_num; - - spin_unlock_bh(&nss_match_stats_lock); - return true; - } - - spin_unlock_bh(&nss_match_stats_lock); - return false; -} - -/* - * nss_match_ifnum_delete() - * Delete match node interface ID. - */ -bool nss_match_ifnum_delete(int if_num) -{ - int index = 0; - - spin_lock_bh(&nss_match_stats_lock); - - for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { - if (match_ifnum[index] != if_num) { - continue; - } - - match_ifnum[index] = 0; - - spin_unlock_bh(&nss_match_stats_lock); - return true; - } - - spin_unlock_bh(&nss_match_stats_lock); - return false; -} - -/* - * nss_match_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_match_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_match_stats_notification match_stats; - uint32_t interface; - int index; - - match_stats.core_id = nss_ctx->id; - match_stats.if_num = if_num; - - for (index = 0; index < NSS_MATCH_INSTANCE_MAX; index++) { - spin_lock_bh(&nss_match_stats_lock); - interface = match_ifnum[index]; - spin_unlock_bh(&nss_match_stats_lock); - - if (interface == if_num) { - break; - } - } - - if (index == NSS_MATCH_INSTANCE_MAX) { - nss_warning("Invalid Match index\n"); - return; - } - - spin_lock_bh(&nss_match_stats_lock); - memcpy(match_stats.stats_ctx, nss_match_stats[index], sizeof(match_stats.stats_ctx)); - spin_unlock_bh(&nss_match_stats_lock); - atomic_notifier_call_chain(&nss_match_stats_notifier, NSS_STATS_EVENT_NOTIFY, &match_stats); -} - -/* - * nss_match_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_match_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_match_stats_notifier, nb); -} - -/* - * nss_match_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_match_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_match_stats_notifier, nb); -} - -/* - * nss_match_stats_dentry_create() - * Create match statistics debug entry. - */ -void nss_match_stats_dentry_create(void) -{ - nss_stats_create_dentry("match", &nss_match_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.h deleted file mode 100644 index 3cbc74629..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match_stats.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_MATCH_STATS_H__ -#define __NSS_MATCH_STATS_H__ - -/** - * nss_match_stats_types - * Match statistics types. - */ -enum nss_match_stats_types { - NSS_MATCH_STATS_HIT_COUNT_0 = NSS_STATS_NODE_MAX, - /**< Hit count of rule ID 1. */ - NSS_MATCH_STATS_HIT_COUNT_1, /**< Hit count of rule ID 2. */ - NSS_MATCH_STATS_HIT_COUNT_2, /**< Hit count of rule ID 3. */ - NSS_MATCH_STATS_HIT_COUNT_3, /**< Hit count of rule ID 4. */ - NSS_MATCH_STATS_HIT_COUNT_4, /**< Hit count of rule ID 5. */ - NSS_MATCH_STATS_HIT_COUNT_5, /**< Hit count of rule ID 6. */ - NSS_MATCH_STATS_HIT_COUNT_6, /**< Hit count of rule ID 7. */ - NSS_MATCH_STATS_HIT_COUNT_7, /**< Hit count of rule ID 8. */ - NSS_MATCH_STATS_HIT_COUNT_8, /**< Hit count of rule ID 9. */ - NSS_MATCH_STATS_HIT_COUNT_9, /**< Hit count of rule ID 10. */ - NSS_MATCH_STATS_HIT_COUNT_10, /**< Hit count of rule ID 11. */ - NSS_MATCH_STATS_HIT_COUNT_11, /**< Hit count of rule ID 12. */ - NSS_MATCH_STATS_HIT_COUNT_12, /**< Hit count of rule ID 13. */ - NSS_MATCH_STATS_HIT_COUNT_13, /**< Hit count of rule ID 14. */ - NSS_MATCH_STATS_HIT_COUNT_14, /**< Hit count of rule ID 15. */ - NSS_MATCH_STATS_HIT_COUNT_15, /**< Hit count of rule ID 16. */ - NSS_MATCH_STATS_HIT_COUNT_16, /**< Hit count of rule ID 17. */ - NSS_MATCH_STATS_HIT_COUNT_17, /**< Hit count of rule ID 18. */ - NSS_MATCH_STATS_HIT_COUNT_18, /**< Hit count of rule ID 19. */ - NSS_MATCH_STATS_HIT_COUNT_19, /**< Hit count of rule ID 20. */ - NSS_MATCH_STATS_HIT_COUNT_20, /**< Hit count of rule ID 21. */ - NSS_MATCH_STATS_HIT_COUNT_21, /**< Hit count of rule ID 22. */ - NSS_MATCH_STATS_HIT_COUNT_22, /**< Hit count of rule ID 23. */ - NSS_MATCH_STATS_HIT_COUNT_23, /**< Hit count of rule ID 24. */ - NSS_MATCH_STATS_HIT_COUNT_24, /**< Hit count of rule ID 25. */ - NSS_MATCH_STATS_HIT_COUNT_25, /**< Hit count of rule ID 26. */ - NSS_MATCH_STATS_HIT_COUNT_26, /**< Hit count of rule ID 27. */ - NSS_MATCH_STATS_HIT_COUNT_27, /**< Hit count of rule ID 28. */ - NSS_MATCH_STATS_HIT_COUNT_28, /**< Hit count of rule ID 29. */ - NSS_MATCH_STATS_HIT_COUNT_29, /**< Hit count of rule ID 30. */ - NSS_MATCH_STATS_HIT_COUNT_30, /**< Hit count of rule ID 31. */ - NSS_MATCH_STATS_HIT_COUNT_31, /**< Hit count of rule ID 32. */ - NSS_MATCH_STATS_MAX, /**< Maximum statistics type. */ -}; - -/** - * nss_match_stats_notification - * Match transmission statistics structure. - */ -struct nss_match_stats_notification { - uint64_t stats_ctx[NSS_MATCH_STATS_MAX]; /**< Context transmission statistics. */ - uint32_t core_id; /**< Core ID. */ - uint32_t if_num; /**< Interface number. */ -}; - -extern bool nss_match_ifnum_add(int if_num); -extern bool nss_match_ifnum_delete(int if_num); -extern void nss_match_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_match_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_match_msg *nmm); -extern void nss_match_stats_dentry_create(void); -extern int nss_match_stats_unregister_notifier(struct notifier_block *nb); -extern int nss_match_stats_register_notifier(struct notifier_block *nb); - -#endif /* __NSS_MATCH_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.c deleted file mode 100644 index 67d8451dd..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_match_strings.h" - -/* - * nss_match_strings_stats - * match statistics strings. - */ -struct nss_stats_info nss_match_strings_stats[NSS_MATCH_STATS_MAX] = { - {"rx_pkts", NSS_STATS_TYPE_COMMON}, - {"rx_byts", NSS_STATS_TYPE_COMMON}, - {"tx_pkts", NSS_STATS_TYPE_COMMON}, - {"tx_byts", NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, - {"hit_count[0]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[1]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[2]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[3]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[4]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[5]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[6]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[7]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[8]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[9]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[10]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[11]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[12]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[13]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[14]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[15]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[16]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[17]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[18]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[19]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[20]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[21]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[22]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[23]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[24]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[25]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[26]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[27]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[28]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[29]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[30]", NSS_STATS_TYPE_SPECIAL}, - {"hit_count[31]", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_match_stats_strings_read() - * Read match statistics names - */ -static ssize_t nss_match_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_match_strings_stats, NSS_MATCH_STATS_MAX); -} - -/* - * nss_match_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(match); - -/* - * nss_match_strings_dentry_create() - * Create match statistics strings debug entry. - */ -void nss_match_strings_dentry_create(void) -{ - nss_strings_create_dentry("match", &nss_match_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.h deleted file mode 100644 index 9eb9f621a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_match_strings.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_MATCH_STRINGS_H -#define __NSS_MATCH_STRINGS_H - -#include "nss_match_stats.h" - -extern struct nss_stats_info nss_match_strings_stats[NSS_MATCH_STATS_MAX]; -extern void nss_match_strings_dentry_create(void); - -#endif /* __NSS_MATCH_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.c b/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.c deleted file mode 100644 index e24e6be4e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.c +++ /dev/null @@ -1,798 +0,0 @@ -/* - * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * nss_meminfo.c - * NSS meminfo subsystem - */ - -#include -#include "nss_tx_rx_common.h" -#include "nss_core.h" -#include "nss_arch.h" -#include "nss_meminfo.h" - -/* - * Store user configuration - */ -static char nss_meminfo_user_config[NSS_MEMINFO_USER_CONFIG_MAXLEN]; -module_param_string(meminfo_user_config, nss_meminfo_user_config, - NSS_MEMINFO_USER_CONFIG_MAXLEN, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); -MODULE_PARM_DESC(nss_meminfo_user_config, "meminfo user configuration"); - -static bool nss_meminfo_debugfs_exist; - -/* - * Name table of memory type presented to user. - */ -char *nss_meminfo_memtype_table[NSS_MEMINFO_MEMTYPE_MAX] = {"IMEM", "SDRAM", "UTCM_SHARED"}; - -/* - * nss_meminfo_alloc_sdram() - * Allocate a SDRAM block. - */ -static void *nss_meminfo_alloc_sdram(struct nss_ctx_instance *nss_ctx, uint32_t size) -{ - void *addr = 0; - - /* - * kmalloc() return cache line aligned buffer. - */ - addr = kmalloc(size, GFP_KERNEL | __GFP_ZERO); - if (!addr) - nss_info_always("%px: failed to alloc a sdram block of size %u\n", nss_ctx, size); - - kmemleak_not_leak((void *)addr); - return addr; -} - -/* - * nss_meminfo_free_sdram() - * Free SDRAM memory. - */ -static inline void nss_meminfo_free_sdram(struct nss_ctx_instance *nss_ctx, uint32_t dma_addr, - void *kern_addr, uint32_t size) -{ - /* - * Unmap it since every SDRAM memory had been mapped. - */ - dma_unmap_single(nss_ctx->dev, dma_addr, size, DMA_FROM_DEVICE); - kfree(kern_addr); -} - -/* - * nss_meminfo_alloc_imem() - * Allocate an IMEM block in a sequential way. - */ -static uint32_t nss_meminfo_alloc_imem(struct nss_ctx_instance *nss_ctx, uint32_t size, int alignment) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - uint32_t new_tail; - uint32_t addr = 0; - int mask; - - mask = alignment - 1; - - /* - * Alignment has to be a power of 2. - */ - nss_assert(!(alignment & mask)); - - new_tail = mem_ctx->imem_tail; - - /* - * Align up the address if it not aligned. - */ - if (new_tail & mask) - new_tail = (new_tail + mask) & ~mask; - - if (size > (mem_ctx->imem_end - new_tail)) { - nss_info_always("%px: failed to alloc an IMEM block of size %u\n", nss_ctx, size); - return addr; - } - - addr = new_tail; - mem_ctx->imem_tail = new_tail + size; - - return addr; -} - -/* - * nss_meminfo_free_imem() - * Free an IMEM block. Ignore the padding bytes for alignment requirement. - */ -static void nss_meminfo_free_imem(struct nss_ctx_instance *nss_ctx, uint32_t addr, uint32_t size) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - mem_ctx->imem_tail -= size; -} - -/* - * nss_meminfo_alloc_utcm_shared() - * Allocate an UTCM_SHARED block in a sequential way. - */ -static uint32_t nss_meminfo_alloc_utcm_shared(struct nss_ctx_instance *nss_ctx, uint32_t size, int alignment) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - uint32_t new_tail; - uint32_t addr = 0; - int mask; - - mask = alignment - 1; - - /* - * Alignment has to be a power of 2. - */ - nss_assert(!(alignment & mask)); - - new_tail = mem_ctx->utcm_shared_tail; - - /* - * Align up the address if it not aligned. - */ - if (new_tail & mask) - new_tail = (new_tail + mask) & ~mask; - - if (size > (mem_ctx->utcm_shared_end - new_tail)) { - nss_info_always("%px: failed to alloc an UTCM_SHARED block of size %u\n", nss_ctx, size); - return addr; - } - - addr = new_tail; - mem_ctx->utcm_shared_tail = new_tail + size; - - return addr; -} - -/* - * nss_meminfo_free_utcm_shared() - * Free an UTCM_SHARED block. Ignore the padding bytes for alignment requirement. - */ -static void nss_meminfo_free_utcm_shared(struct nss_ctx_instance *nss_ctx, uint32_t addr, uint32_t size) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - mem_ctx->utcm_shared_tail -= size; -} - -/* - * nss_meminfo_if_user_overwrite() - * Return user configured memory type. Otherwise, return -1. - */ -static int nss_meminfo_if_user_overwrite(struct nss_ctx_instance *nss_ctx, const char *name) -{ - char *user_config; - char **mtype_table; - char needle[NSS_MEMINFO_BLOCK_NAME_MAXLEN + 6]; - char user_choice[NSS_MEMINFO_MEMTYPE_NAME_MAXLEN]; - int i; - char *p; - - user_config = nss_meminfo_user_config; - mtype_table = nss_meminfo_memtype_table; - - snprintf(needle, sizeof(needle), "<%1d, %s, ", nss_ctx->id, name); - - p = strstr(user_config, needle); - if (!p) - return -1; - - p += strlen(needle); - - for (i = 0; i < NSS_MEMINFO_MEMTYPE_NAME_MAXLEN - 1; i++) { - /* - * Each user config is like , - * it starts with '<' and ends with '>'. - */ - if (*p == '>' || *p == '\0') - break; - user_choice[i] = *p; - p++; - } - - user_choice[i] = '\0'; - - for (i = 0; i < NSS_MEMINFO_MEMTYPE_MAX; i++) - if (!strcmp(mtype_table[i], user_choice)) - return i; - - return -1; -} - -/* - * nss_meminfo_free_block_lists() - * Free block node and memory associated with each each memory object. - */ -static void nss_meminfo_free_block_lists(struct nss_ctx_instance *nss_ctx) -{ - struct nss_meminfo_ctx *mem_ctx; - struct nss_meminfo_block_list *l; - int i; - - mem_ctx = &nss_ctx->meminfo_ctx; - for (i = 0; i < NSS_MEMINFO_MEMTYPE_MAX; i++) { - struct nss_meminfo_block *b; - l = &mem_ctx->block_lists[i]; - b = l->head; - while (b) { - struct nss_meminfo_block *tmp; - /* - * Free IMEM/SDRAM/UTCM_SHARED memory. - */ - switch (i) { - case NSS_MEMINFO_MEMTYPE_IMEM: - nss_meminfo_free_imem(nss_ctx, b->dma_addr, b->size); - break; - case NSS_MEMINFO_MEMTYPE_SDRAM: - nss_meminfo_free_sdram(nss_ctx, b->dma_addr, b->kern_addr, b->size); - break; - case NSS_MEMINFO_MEMTYPE_UTCM_SHARED: - nss_meminfo_free_utcm_shared(nss_ctx, b->dma_addr, b->size); - break; - } - - /* - * Free the struct nss_meminfo_block itself. - */ - tmp = b; - b = b->next; - kfree(tmp); - } - } -} - -/* - * nss_meminfo_init_block_lists() - * Initialize block lists and allocate memory for each block. - */ -static bool nss_meminfo_init_block_lists(struct nss_ctx_instance *nss_ctx) -{ - /* - * There is no corresponding mapped address in kernel for UTCM_SHARED. - * UTCM_SHARED access from kernel is not allowed. Mem Objects requesting - * UTCM_SHARED are not expected to use any kernel mapped address. - * Was for UTCM_SHARED, but move to here as default especially for KW scan. - * Thus, NSS_MEMINFO_POISON is the default value for non-mappable memory request. - */ - void *kern_addr = (void *)NSS_MEMINFO_POISON; - uint32_t dma_addr = 0; - struct nss_meminfo_ctx *mem_ctx; - struct nss_meminfo_block_list *l; - struct nss_meminfo_request *r; - struct nss_meminfo_map *map; - int mtype; - int i; - - mem_ctx = &nss_ctx->meminfo_ctx; - - /* - * Fill memory type for each block list. - */ - for (i = 0; i < NSS_MEMINFO_MEMTYPE_MAX; i++) - mem_ctx->block_lists[i].memtype = i; - - map = &mem_ctx->meminfo_map; - - /* - * Loop through all meminfo requests by checking the per-request magic. - */ - for (r = map->requests; r->magic == NSS_MEMINFO_REQUEST_MAGIC; r++) { - struct nss_meminfo_block *b = (struct nss_meminfo_block *) - kmalloc(sizeof(struct nss_meminfo_block), GFP_KERNEL); - if (!b) { - nss_info_always("%px: failed to allocate meminfo block\n", nss_ctx); - goto cleanup; - } - - b->index = map->num_requests++; - b->size = r->size; - - /* - * Look up the user-defined memory type. - * Return user-defined memory type if exists. Otherwise, return -1. - */ - mtype = nss_meminfo_if_user_overwrite(nss_ctx, r->name); - if (mtype == -1) - mtype = r->memtype_default; - r->memtype_user = mtype; - - switch (mtype) { - case NSS_MEMINFO_MEMTYPE_IMEM: - /* - * For SOC's where TCM is not present - */ - if (!nss_ctx->vphys) { - nss_info_always("%px:IMEM requested but TCM not defined " - "for this SOC\n", nss_ctx); - goto cleanup; - } - - /* - * Return SoC real address for IMEM as DMA address. - */ - dma_addr = nss_meminfo_alloc_imem(nss_ctx, r->size, r->alignment); - if (!dma_addr) { - nss_info_always("%px: failed to alloc IMEM block\n", nss_ctx); - goto cleanup; - } - - /* - * Calulate offset to the kernel address (vmap) where the - * whole IMEM is mapped onto instead of calling ioremap(). - */ - kern_addr = nss_ctx->vmap + dma_addr - nss_ctx->vphys; - break; - case NSS_MEMINFO_MEMTYPE_SDRAM: - kern_addr = nss_meminfo_alloc_sdram(nss_ctx, r->size); - if (!kern_addr) { - nss_info_always("%px: failed to alloc SDRAM block\n", nss_ctx); - goto cleanup; - } - - dma_addr = dma_map_single(nss_ctx->dev, kern_addr, r->size, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, dma_addr))) { - nss_info_always("%px: failed to map SDRAM block\n", nss_ctx); - goto cleanup; - } - break; - case NSS_MEMINFO_MEMTYPE_UTCM_SHARED: - /* - * Return SoC real address for UTCM_SHARED as DMA address. - */ - dma_addr = nss_meminfo_alloc_utcm_shared(nss_ctx, r->size, r->alignment); - if (!dma_addr) { - nss_info_always("%px: failed to alloc UTCM_SHARED block\n", nss_ctx); - goto cleanup; - } - break; - case NSS_MEMINFO_MEMTYPE_INFO: - /* - * if FW request heap_ddr_size, fill it in from DTS values. - */ - if (!strcmp(r->name, "heap_ddr_size")) { - struct nss_mmu_ddr_info coreinfo; - r->size = nss_core_ddr_info(&coreinfo); - - /* - * split memory among the number of cores - */ - r->size /= coreinfo.num_active_cores; - dma_addr = coreinfo.start_address + nss_ctx->id * r->size; - nss_info_always("%px: NSS core %d DDR from %x to %x\n", nss_ctx, - nss_ctx->id, dma_addr, dma_addr + r->size); - } - break; - default: - nss_info_always("%px: %d unsupported memory type\n", nss_ctx, mtype); - goto cleanup; - } - - /* - * Update the request with DMA address for the memory that only be used by FW. - */ - r->addr = dma_addr; - - /* - * nss_if_mem_map settings - */ - if (!strcmp(r->name, "nss_if_mem_map_inst")) { - BUG_ON(mtype == NSS_MEMINFO_MEMTYPE_UTCM_SHARED); - mem_ctx->if_map_memtype = mtype; - mem_ctx->if_map_dma = dma_addr; - mem_ctx->if_map = (struct nss_if_mem_map *)kern_addr; - } - - if (!strcmp(r->name, "debug_boot_log_desc")) { - BUG_ON(mtype == NSS_MEMINFO_MEMTYPE_UTCM_SHARED); - mem_ctx->logbuffer_memtype = mtype; - mem_ctx->logbuffer_dma = dma_addr; - mem_ctx->logbuffer = (struct nss_log_descriptor *)kern_addr; - } - - if (!strcmp(r->name, "c2c_descs_if_mem_map")) { - mem_ctx->c2c_start_memtype = mtype; - mem_ctx->c2c_start_dma = dma_addr; - } - - if (strcmp(r->name, "profile_dma_ctrl") == 0) { - mem_ctx->sdma_ctrl = kern_addr; - nss_info_always("%px: set sdma %px\n", nss_ctx, kern_addr); - } - - /* - * Flush the updated meminfo request. - */ - NSS_CORE_DMA_CACHE_MAINT(r, sizeof(struct nss_meminfo_request), DMA_TO_DEVICE); - NSS_CORE_DSB(); - - /* - * Update the list - */ - l = &mem_ctx->block_lists[mtype]; - l->num_blks++; - l->total_size += r->size; - - b->next = l->head; - l->head = b; - } - - /* - * Verify memory map end magic - */ - if (*((uint16_t *)r) != NSS_MEMINFO_MAP_END_MAGIC) - goto cleanup; - - return true; - -cleanup: - nss_meminfo_free_block_lists(nss_ctx); - return false; -} - -/* - * nss_meminfo_allocate_n2h_h2n_rings() - * Allocate N2H/H2N rings. - */ -static bool nss_meminfo_allocate_n2h_h2n_rings(struct nss_ctx_instance *nss_ctx, - struct nss_meminfo_n2h_h2n_info *info) -{ - switch (info->memtype) { - case NSS_MEMINFO_MEMTYPE_SDRAM: - info->kern_addr = nss_meminfo_alloc_sdram(nss_ctx, info->total_size); - if (!info->kern_addr) - return false; - - info->dma_addr = dma_map_single(nss_ctx->dev, (void *)info->kern_addr, - info->total_size, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(nss_ctx->dev, info->dma_addr))) { - kfree((void *)info->kern_addr); - return false; - } - break; - case NSS_MEMINFO_MEMTYPE_IMEM: - /* - * For SOC's where TCM is not present - */ - if (!nss_ctx->vphys) { - nss_info_always("%px:IMEM requested but TCM not defined " - "for this SOC\n", nss_ctx); - return false; - } - - info->dma_addr = nss_meminfo_alloc_imem(nss_ctx, info->total_size, L1_CACHE_BYTES); - if (!info->dma_addr) - return false; - - info->kern_addr = nss_ctx->vmap + info->dma_addr - nss_ctx->vphys; - break; - default: - return false; - } - - return true; -} - -/* - * nss_meminfo_configure_n2h_h2n_rings() - * Configure N2H/H2N rings and if_map. - */ -static bool nss_meminfo_configure_n2h_h2n_rings(struct nss_ctx_instance *nss_ctx) -{ - struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; - struct nss_meminfo_n2h_h2n_info *h2n_info; - struct nss_meminfo_n2h_h2n_info *n2h_info; - struct nss_if_mem_map *if_map; - int i; - int mtype; - - h2n_info = &mem_ctx->h2n_info; - n2h_info = &mem_ctx->n2h_info; - - /* - * Check memory type. SDRAM is the default option. - */ - mtype = nss_meminfo_if_user_overwrite(nss_ctx, "h2n_rings"); - if (mtype == -1) - mtype = NSS_MEMINFO_MEMTYPE_SDRAM; - - h2n_info->memtype = mtype; - - mtype = nss_meminfo_if_user_overwrite(nss_ctx, "n2h_rings"); - if (mtype == -1) - mtype = NSS_MEMINFO_MEMTYPE_SDRAM; - - n2h_info->memtype = mtype; - - n2h_info->total_size = sizeof(struct n2h_descriptor) * NSS_N2H_RING_COUNT * (NSS_RING_SIZE + 2); - h2n_info->total_size = sizeof(struct h2n_descriptor) * NSS_H2N_RING_COUNT * (NSS_RING_SIZE + 2); - - /* - * N2H ring allocations - */ - if (!(nss_meminfo_allocate_n2h_h2n_rings(nss_ctx, n2h_info))) { - nss_info_always("%px: failed to allocate/map n2h rings\n", nss_ctx); - return false; - } - - /* - * H2N ring allocations - */ - if (!(nss_meminfo_allocate_n2h_h2n_rings(nss_ctx, h2n_info))) { - nss_info_always("%px: failed to allocate/map h2n_rings\n", nss_ctx); - goto cleanup; - } - - /* - * Bring a fresh copy of if_map from memory in order to read it correctly. - */ - if_map = mem_ctx->if_map; - NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(struct nss_if_mem_map), DMA_FROM_DEVICE); - NSS_CORE_DSB(); - - if_map->n2h_rings = NSS_N2H_RING_COUNT; - if_map->h2n_rings = NSS_H2N_RING_COUNT; - - /* - * N2H ring settings - */ - for (i = 0; i < NSS_N2H_RING_COUNT; i++) { - struct hlos_n2h_desc_ring *n2h_desc_ring = &nss_ctx->n2h_desc_ring[i]; - n2h_desc_ring->desc_ring.desc = (struct n2h_descriptor *)(n2h_info->kern_addr + i * sizeof(struct n2h_descriptor) * (NSS_RING_SIZE + 2)); - n2h_desc_ring->desc_ring.size = NSS_RING_SIZE; - n2h_desc_ring->hlos_index = if_map->n2h_hlos_index[i]; - - if_map->n2h_desc_if[i].size = NSS_RING_SIZE; - if_map->n2h_desc_if[i].desc_addr = n2h_info->dma_addr + i * sizeof(struct n2h_descriptor) * (NSS_RING_SIZE + 2); - nss_info("%px: N2H ring %d, size %d, addr = %x\n", nss_ctx, i, if_map->n2h_desc_if[i].size, if_map->n2h_desc_if[i].desc_addr); - } - - /* - * H2N ring settings - */ - for (i = 0; i < NSS_H2N_RING_COUNT; i++) { - struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[i]; - h2n_desc_ring->desc_ring.desc = (struct h2n_descriptor *)(h2n_info->kern_addr + i * sizeof(struct h2n_descriptor) * (NSS_RING_SIZE + 2)); - h2n_desc_ring->desc_ring.size = NSS_RING_SIZE; - h2n_desc_ring->hlos_index = if_map->h2n_hlos_index[i]; - spin_lock_init(&h2n_desc_ring->lock); - - if_map->h2n_desc_if[i].size = NSS_RING_SIZE; - if_map->h2n_desc_if[i].desc_addr = h2n_info->dma_addr + i * sizeof(struct h2n_descriptor) * (NSS_RING_SIZE + 2); - nss_info("%px: H2N ring %d, size %d, addr = %x\n", nss_ctx, i, if_map->h2n_desc_if[i].size, if_map->h2n_desc_if[i].desc_addr); - } - - /* - * Flush the updated nss_if_mem_map. - */ - NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(struct nss_if_mem_map), DMA_TO_DEVICE); - NSS_CORE_DSB(); - - return true; - -cleanup: - if (n2h_info->memtype == NSS_MEMINFO_MEMTYPE_SDRAM) - nss_meminfo_free_sdram(nss_ctx, n2h_info->dma_addr, n2h_info->kern_addr, n2h_info->total_size); - else - nss_meminfo_free_imem(nss_ctx, n2h_info->dma_addr, n2h_info->total_size); - - nss_meminfo_free_block_lists(nss_ctx); - return false; -} - -/* - * nss_meminfo_config_show() - * function to show meinfo configuration per core. - */ -static int nss_meminfo_config_show(struct seq_file *seq, void *v) -{ - struct nss_ctx_instance *nss_ctx; - struct nss_meminfo_ctx *mem_ctx; - struct nss_meminfo_n2h_h2n_info *n2h_info; - struct nss_meminfo_n2h_h2n_info *h2n_info; - struct nss_meminfo_map *map; - struct nss_meminfo_request *r; - int nss_id; - int i; - - /* - * i_private is passed to us by debug_fs_create() - */ - nss_id = (int)(nss_ptr_t)seq->private; - if (nss_id < 0 || nss_id >= nss_top_main.num_nss) { - nss_warning("nss_id: %d is not valid\n", nss_id); - return -ENODEV; - } - - nss_ctx = &nss_top_main.nss[nss_id]; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - mem_ctx = &nss_ctx->meminfo_ctx; - map = &mem_ctx->meminfo_map; - n2h_info = &mem_ctx->n2h_info; - h2n_info = &mem_ctx->h2n_info; - - seq_printf(seq, "%-5s %-32s %-7s %-7s %-10s %-10s\n", - "Index", "Name", "Default", "User", "Size", "DMA Addr"); - seq_printf(seq, "%-5s %-32s %-7s %-7s 0x%-8x 0x%-8x\n", - "N/A", "n2h_rings", "SDRAM", - nss_meminfo_memtype_table[n2h_info->memtype], - n2h_info->total_size, n2h_info->dma_addr); - seq_printf(seq, "%-5s %-32s %-7s %-7s 0x%-8x 0x%-8x\n", - "N/A", "h2n_rings", "SDRAM", - nss_meminfo_memtype_table[h2n_info->memtype], - h2n_info->total_size, h2n_info->dma_addr); - - r = map->requests; - for (i = 0; i < map->num_requests; i++) { - seq_printf(seq, "%-5d %-32s %-7s %-7s 0x%-8x 0x%-8x\n", - i, r[i].name, - nss_meminfo_memtype_table[r[i].memtype_default], - nss_meminfo_memtype_table[r[i].memtype_user], - r[i].size, r[i].addr); - } - - seq_printf(seq, "Available IMEM: 0x%x\n", mem_ctx->imem_end - mem_ctx->imem_tail); - seq_printf(seq, "How to configure? \n"); - seq_printf(seq, "Overwrite the /etc/modules.d/32-qca-nss-drv with following contents then reboot\n\n"); - seq_printf(seq, "qca-nss-drv meminfo_user_config=\", ..\"\n\n"); - seq_printf(seq, "For example, <1, h2n_rings, IMEM> stands for: h2n_rings of core 1 is on IMEM\n"); - seq_printf(seq, "Note:UTCM_SHARED cannot be used for n2h_rings, h2n_rings and debug_log_boot_desc.\n"); - - return 0; -} - -/* - * nss_meminfo_debugfs_file_open() - * function to open meminfo debugfs. - */ -static int nss_meminfo_debugfs_file_open(struct inode *inode, struct file *file) -{ - return single_open(file, nss_meminfo_config_show, inode->i_private); -} - -static struct file_operations nss_meminfo_debugfs_ops = { - .owner = THIS_MODULE, - .open = nss_meminfo_debugfs_file_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -/* - * nss_meminfo_init_debugfs() - * Init meminfo debugfs. - */ -static void nss_meminfo_init_debugfs(struct nss_ctx_instance *nss_ctx) -{ - int i; - struct dentry *meminfo_main_dentry; - struct dentry *meminfo_core_dentries[NSS_MAX_CORES]; - - if (nss_meminfo_debugfs_exist) - return; - - /* - * Create directory for showing meminfo configuration of each core. - */ - meminfo_main_dentry = debugfs_create_dir("meminfo", nss_top_main.top_dentry); - if (unlikely(!meminfo_main_dentry)) { - nss_warning("Failed to create qca-nss-drv/meminfo directory in debugfs\n"); - return; - } - - for (i = 0; i < nss_top_main.num_nss; i++) { - char file[10]; - snprintf(file, sizeof(file), "core%d", i); - meminfo_core_dentries[i] = debugfs_create_file(file, 0400, meminfo_main_dentry, - (void *)(nss_ptr_t)i, &nss_meminfo_debugfs_ops); - if (unlikely(!meminfo_core_dentries[i])) { - int j; - for (j = 0; j < i; j++) - debugfs_remove(meminfo_core_dentries[j]); - debugfs_remove(meminfo_main_dentry); - nss_warning("Failed to create qca-nss-drv/meminfo/%s file in debugfs", file); - return; - } - } - - nss_meminfo_debugfs_exist = true; - nss_info("nss meminfo user config: %s\n", nss_meminfo_user_config); -} - -/* - * nss_meminfo_init - * Initilization - * - */ -bool nss_meminfo_init(struct nss_ctx_instance *nss_ctx) -{ - struct nss_meminfo_ctx *mem_ctx; - uint32_t *meminfo_start; - struct nss_meminfo_map *map; - struct nss_top_instance *nss_top = &nss_top_main; - - mem_ctx = &nss_ctx->meminfo_ctx; - - /* - * meminfo_start is the label where the start address of meminfo map is stored. - */ - meminfo_start = (uint32_t *)ioremap_nocache(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET, - NSS_MEMINFO_RESERVE_AREA_SIZE); - if (!meminfo_start) { - nss_info_always("%px: cannot remap meminfo start\n", nss_ctx); - return false; - } - - /* - * Check meminfo start magic - */ - if ((uint16_t)meminfo_start[0] != NSS_MEMINFO_RESERVE_AREA_MAGIC) { - nss_info_always("%px: failed to verify meminfo start magic\n", nss_ctx); - return false; - } - - map = &mem_ctx->meminfo_map; - map->start = (uint32_t *)ioremap_cache(meminfo_start[1], NSS_MEMINFO_MAP_SIZE); - if (!map->start) { - nss_info_always("%px: failed to remap meminfo map\n", nss_ctx); - return false; - } - - /* - * Check meminfo map magic - */ - if ((uint16_t)map->start[0] != NSS_MEMINFO_MAP_START_MAGIC) { - nss_info_always("%px: failed to verify meminfo map magic\n", nss_ctx); - return false; - } - - /* - * Meminfo map settings - */ - map->num_requests = 0; - map->requests = (struct nss_meminfo_request *)(map->start + 1); - - /* - * Init IMEM - */ - nss_top->hal_ops->init_imem(nss_ctx); - - /* - * Init UTCM_SHARED if supported - */ - if (!nss_top->hal_ops->init_utcm_shared(nss_ctx, meminfo_start)) { - nss_info_always("%px: failed to initialize UTCM_SHARED meminfo\n", nss_ctx); - return false; - } - - /* - * Init meminfo block lists - */ - if (!nss_meminfo_init_block_lists(nss_ctx)) { - nss_info_always("%px: failed to initialize meminfo block lists\n", nss_ctx); - return false; - } - - /* - * Configure N2H/H2N rings and nss_if_mem_map - */ - if (!nss_meminfo_configure_n2h_h2n_rings(nss_ctx)) - return false; - - nss_meminfo_init_debugfs(nss_ctx); - - nss_info_always("%px: meminfo init succeed\n", nss_ctx); - return true; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.h b/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.h deleted file mode 100644 index 5c006cc54..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_meminfo.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * nss_meminfo.h - * nss meminfo header file. - */ - -#ifndef __NSS_MEMINFO_H -#define __NSS_MEMINFO_H - -#define NSS_MEMINFO_RESERVE_AREA_SIZE 0x1000 /* Size of reserved space in firmware start code aligned to one page */ -#define NSS_MEMINFO_RESERVE_AREA_MAGIC 0x9526 /* Magic at the beginning of reserved space */ -#define NSS_MEMINFO_MAP_START_OFFSET 8 /* Offset of memory map start address in reserved space */ -#define NSS_MEMINFO_MAP_SIZE 0x1000 /* Size of memory map per core aligned to one page */ -#define NSS_MEMINFO_MAP_START_MAGIC 0x9527 -#define NSS_MEMINFO_REQUEST_MAGIC 0X9528 -#define NSS_MEMINFO_MAP_END_MAGIC 0x9529 -#define NSS_MEMINFO_RESERVE_AREA_UTCM_SHARED_MAP_MAGIC 0x9530 /* Magic at the beginning of UTCM_SHARED reserved space */ -#define NSS_MEMINFO_BLOCK_NAME_MAXLEN 48 -#define NSS_MEMINFO_MEMTYPE_NAME_MAXLEN 32 -#define NSS_MEMINFO_USER_CONFIG_MAXLEN 1024 -#define NSS_MEMINFO_POISON 0x95 /* Invalid kernel memory address assigned for non mapable mem types */ - -/* - * Memory types available - */ -enum nss_meminfo_memtype { - NSS_MEMINFO_MEMTYPE_IMEM, /* NSS-IMEM also called TCM */ - NSS_MEMINFO_MEMTYPE_SDRAM, /* SDRAM also called DDR */ - NSS_MEMINFO_MEMTYPE_UTCM_SHARED, /* UTCM memory allocated for DMA objects */ - NSS_MEMINFO_MEMTYPE_INFO, /* Exchange information during boot up */ - NSS_MEMINFO_MEMTYPE_MAX -}; - -/* - * Memory request - * Firmware package defines each request asking host to feed the request. - */ -struct nss_meminfo_request { - uint16_t magic; /* Request magic */ - char name[NSS_MEMINFO_BLOCK_NAME_MAXLEN]; /* Memory block name */ - uint16_t memtype_default; /* Memory type requested */ - uint16_t memtype_user; /* User-defined memory type */ - uint32_t alignment; /* Alignment requirement */ - uint32_t size; /* Size requested */ - uint32_t addr; /* Memory block address got from host */ -}; - -/* - * Memory map - * It starts with a magic then an array of memory request and end with a checksum. - * Firmware creates the map for host to parse. - */ -struct nss_meminfo_map { - uint32_t *start; /* Start address */ - uint32_t num_requests; /* Number of requests */ - struct nss_meminfo_request *requests; /* Start of Request array */ -}; - -/* - * Memory block - * Block node for each request. - */ -struct nss_meminfo_block { - struct nss_meminfo_block *next; /* Next block in the same list */ - uint32_t index; /* Index to request array */ - uint32_t size; /* Size of memory block */ - uint32_t dma_addr; /* DMA address */ - void *kern_addr; /* Kernel address */ -}; - -/* - * Memory block list - * List of block node of same memory type. - */ -struct nss_meminfo_block_list { - enum nss_meminfo_memtype memtype; /* memory type */ - uint32_t num_blks; /* Number of blocks */ - uint32_t total_size; /* Size of all memory blocks in this list */ - struct nss_meminfo_block *head; /* list head */ -}; - -/* - * H2N/N2H rings information - */ -struct nss_meminfo_n2h_h2n_info { - enum nss_meminfo_memtype memtype; /* Memory type */ - uint32_t total_size; /* Total size */ - uint32_t dma_addr; /* DMA address */ - void *kern_addr; /* Kernel address */ -}; - -/* - * Memory context - */ -struct nss_meminfo_ctx { - struct nss_meminfo_n2h_h2n_info n2h_info; /* N2H rings info*/ - struct nss_meminfo_n2h_h2n_info h2n_info; /* H2N rings info */ - uint32_t imem_head; /* IMEM start address */ - uint32_t imem_end; /* IMEM end address */ - uint32_t imem_tail; /* IMEM data end */ - uint32_t utcm_shared_head; /* UTCM_SHARED start address */ - uint32_t utcm_shared_end; /* UTCM_SHARED end address */ - uint32_t utcm_shared_tail; /* UTCM_SHARED data end */ - struct nss_if_mem_map *if_map; /* nss_if_mem_map_inst virtual address */ - uint32_t if_map_dma; /* nss_if_mem_map_inst physical address */ - enum nss_meminfo_memtype if_map_memtype; /* Memory type for nss_if_mem_map */ - struct nss_log_descriptor *logbuffer; /* nss_logbuffer virtual address */ - uint32_t logbuffer_dma; /* nss_logbuffer physical address */ - enum nss_meminfo_memtype logbuffer_memtype; /* Memory type for logbuffer */ - uint32_t c2c_start_dma; /* nss_c2c start physical address */ - enum nss_meminfo_memtype c2c_start_memtype; /* Memory type for c2c_start */ - void *sdma_ctrl; /* Soft DMA controller */ - - struct nss_meminfo_map meminfo_map; /* Meminfo map */ - struct nss_meminfo_block_list block_lists[NSS_MEMINFO_MEMTYPE_MAX]; - /* Block lists for each memory type */ -}; - -bool nss_meminfo_init(struct nss_ctx_instance *nss_ctx); -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror.c b/feeds/ipq807x/qca-nss-drv/src/nss_mirror.c deleted file mode 100644 index a2e506128..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror.c +++ /dev/null @@ -1,296 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_mirror_stats.h" -#include "nss_mirror_strings.h" -#include "nss_mirror_log.h" - -#define NSS_MIRROR_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Private data structure - */ -static struct { - struct semaphore sem; - struct completion complete; - int response; -} nss_mirror_pvt; - -atomic_t nss_mirror_num_instances; /* Number of active mirror stats instances. */ - -/* - * nss_mirror_verify_if_num() - * Verify interface number passed to us. - */ -bool nss_mirror_verify_if_num(uint32_t if_num) -{ - enum nss_dynamic_interface_type if_type; - - if_type = nss_dynamic_interface_get_type(nss_mirror_get_context(), if_num); - if (if_type == NSS_DYNAMIC_INTERFACE_TYPE_MIRROR) { - return true; - } - - return false; -} -EXPORT_SYMBOL(nss_mirror_verify_if_num); - -/* - * nss_mirror_handler() - * Handle NSS -> HLOS messages for mirror device. - */ -static void nss_mirror_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - void *app_data) -{ - struct nss_mirror_msg *nmm = (struct nss_mirror_msg *)ncm; - void *ctx; - nss_mirror_msg_callback_t cb; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_assert(nss_mirror_verify_if_num(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_MIRROR_MSG_MAX) { - nss_warning("%px: received invalid message %d for mirror interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_mirror_msg)) { - nss_warning("%px: Length of message is greater than expected.", nss_ctx); - return; - } - - /* - * Log messages. - */ - nss_core_log_msg_failures(nss_ctx, ncm); - nss_mirror_log_rx_msg(nmm); - - switch (ncm->type) { - case NSS_MIRROR_MSG_SYNC_STATS: - /* - * Debug stats embedded in stats msg. - */ - nss_mirror_stats_sync(nss_ctx, nmm, ncm->interface); - nss_mirror_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)app_data; - } - - /* - * Callback. - */ - cb = (nss_mirror_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * Call mirror interface callback. - */ - if (!cb) { - nss_warning("%px: No callback for mirror interface %d", - nss_ctx, ncm->interface); - return; - } - - cb(ctx, ncm); -} - -/* - * nss_mirror_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_mirror_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - nss_mirror_pvt.response = NSS_TX_SUCCESS; - - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - nss_warning("mirror interface error response %d\n", ncm->response); - nss_mirror_pvt.response = NSS_TX_FAILURE; - } - - /* - * Write memory barrier. - */ - smp_wmb(); - complete(&nss_mirror_pvt.complete); -} - -/* - * nss_mirror_tx_msg() - * Transmit a mirror interface message to NSS firmware. - */ -nss_tx_status_t nss_mirror_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_mirror_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Sanity check the message. - */ - if (!nss_mirror_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request for non mirror interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_MIRROR_MSG_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_mirror_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_mirror_tx_msg); - -/* - * nss_mirror_tx_msg_sync() - * Transmit a mirror interface message to NSS firmware synchronously. - */ -nss_tx_status_t nss_mirror_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_mirror_msg *msg) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_mirror_pvt.sem); - msg->cm.cb = (nss_ptr_t)nss_mirror_callback; - msg->cm.app_data = (nss_ptr_t)NULL; - - status = nss_mirror_tx_msg(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: mirror_tx_msg failed\n", nss_ctx); - up(&nss_mirror_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_mirror_pvt.complete, msecs_to_jiffies(NSS_MIRROR_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: Mirror interface tx sync failed due to timeout\n", nss_ctx); - nss_mirror_pvt.response = NSS_TX_FAILURE; - } - - status = nss_mirror_pvt.response; - up(&nss_mirror_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_mirror_tx_msg_sync); - -/* - * nss_mirror_unregister_if() - * Un-registers mirror interface from the NSS. - */ -void nss_mirror_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.mirror_handler_id]; - uint32_t status; - - nss_assert(nss_ctx); - nss_assert(nss_mirror_verify_if_num(if_num)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_core_unregister_handler(nss_ctx, if_num); - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for interface %d with NSS core\n", nss_ctx, if_num); - } - - atomic_dec(&nss_mirror_num_instances); - nss_mirror_stats_reset(if_num); -} -EXPORT_SYMBOL(nss_mirror_unregister_if); - -/* - * nss_mirror_register_if() - * Registers the mirror interface with NSS. - */ -struct nss_ctx_instance *nss_mirror_register_if(uint32_t if_num, - nss_mirror_data_callback_t data_callback, - nss_mirror_msg_callback_t event_callback, - struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.mirror_handler_id]; - int ret; - - nss_assert(nss_ctx); - nss_assert(netdev); - nss_assert(nss_mirror_verify_if_num(if_num)); - - if (atomic_read(&nss_mirror_num_instances) == NSS_MAX_MIRROR_DYNAMIC_INTERFACES) { - nss_warning("%px: Maximum number of mirror interfaces are already allocated\n", nss_ctx); - return NULL; - } - - ret = nss_mirror_stats_init(if_num, netdev); - if (ret < 0) { - nss_warning("%px: Error in initializaing mirror stats.\n", nss_ctx); - return NULL; - } - - nss_core_register_handler(nss_ctx, if_num, nss_mirror_handler, netdev); - ret = nss_core_register_msg_handler(nss_ctx, if_num, event_callback); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: Not able to register handler for mirror interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, data_callback, NULL, NULL, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, NSS_DYNAMIC_INTERFACE_TYPE_MIRROR); - - atomic_inc(&nss_mirror_num_instances); - return nss_ctx; -} -EXPORT_SYMBOL(nss_mirror_register_if); - -/* - * nss_mirror_get_context() - * Get the mirror instance context. - */ -struct nss_ctx_instance *nss_mirror_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.mirror_handler_id]; -} -EXPORT_SYMBOL(nss_mirror_get_context); - -/* - * nss_mirror_register_handler() - * Initialize and register mirror instance handler. - */ -void nss_mirror_register_handler(void) -{ - nss_info("nss_mirror_register_handler"); - sema_init(&nss_mirror_pvt.sem, 1); - init_completion(&nss_mirror_pvt.complete); - - nss_mirror_stats_dentry_create(); - nss_mirror_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_log.c deleted file mode 100644 index 5fb8858f3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_log.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_mirror_log.c - * NSS Mirror logger file. - */ - -#include "nss_core.h" - -/* - * nss_mirror_log_message_types_str - * MIRROR message strings - */ -static int8_t *nss_mirror_log_message_types_str[NSS_MIRROR_MSG_MAX] __maybe_unused = { - "Mirror Configure Msg", - "Mirror Enable Msg", - "Mirror Disable Msg", - "Mirror Set Nexthop Msg", - "Mirror Reset Nexthop Msg", - "Mirror Stats Sync Msg", -}; - -/* - * nss_mirror_log_error_response_types_str - * Strings for error types for Mirror messages - */ -static int8_t *nss_mirror_log_error_response_types_str[NSS_MIRROR_ERROR_TYPE_MAX] __maybe_unused = { - "Mirror no error", - "Mirror No Memory", - "Mirror Transmit Failure", - "Mirror Bad Parameter", - "Mirror Bad Clone Point", - "Mirror Intance Configured", - "Mirror Intance Disabled", - "Mirror Bad Nexthop", - "Mirror Nexthop Configured", - "Mirror Nexthop Reset", - "Mirror Unknown Message", -}; - -/* - * nss_mirror_log_configure_msg() - * Log NSS Mirror Configure message. - */ -static void nss_mirror_log_configure_msg(struct nss_mirror_msg *nmm) -{ - struct nss_mirror_configure_msg *config_msg __maybe_unused = &nmm->msg.config; - - nss_trace("%px: NSS Mirror Config message \n" - "Packet clone size: %u\n" - "Packet clone point: %hu\n", - config_msg, - config_msg->pkt_clone_size, - config_msg->pkt_clone_point); -} - -/* - * nss_mirror_log_set_nexthop_msg() - * Log NSS Mirror Set Nexthop message. - */ -static void nss_mirror_log_set_nexthop_msg(struct nss_mirror_msg *nmm) -{ - struct nss_mirror_set_nexthop_msg *nexthop_msg __maybe_unused = &nmm->msg.nexthop; - - nss_trace("%px: NSS Mirror Nexthop message \n" - "Nexthop interface number: %u\n", - nexthop_msg, - nexthop_msg->if_num); -} - -/* - * nss_mirror_log_enable_msg() - * Log NSS Mirror Enable message. - */ -static void nss_mirror_log_enable_msg(struct nss_mirror_msg *nmm) -{ - nss_trace("%px: NSS Mirror message: Enable \n", nmm); -} - -/* - * nss_mirror_log_disable_msg() - * Log NSS Mirror Disable message. - */ -static void nss_mirror_log_disable_msg(struct nss_mirror_msg *nmm) -{ - nss_trace("%px: NSS Mirror message: Disable \n", nmm); -} - -/* - * nss_mirror_log_reset_nexthop_msg() - * Log NSS Mirror Reset Nexthop message. - */ -static void nss_mirror_log_reset_nexthop_msg(struct nss_mirror_msg *nmm) -{ - nss_trace("%px: NSS Mirror message: Reset Nexthop \n", nmm); -} - -/* - * nss_mirror_log_verbose() - * Log message contents. - */ -static void nss_mirror_log_verbose(struct nss_mirror_msg *nmm) -{ - switch (nmm->cm.type) { - case NSS_MIRROR_MSG_CONFIGURE: - nss_mirror_log_configure_msg(nmm); - break; - - case NSS_MIRROR_MSG_ENABLE: - nss_mirror_log_enable_msg(nmm); - break; - - case NSS_MIRROR_MSG_DISABLE: - nss_mirror_log_disable_msg(nmm); - break; - - case NSS_MIRROR_MSG_SET_NEXTHOP: - nss_mirror_log_set_nexthop_msg(nmm); - break; - - case NSS_MIRROR_MSG_RESET_NEXTHOP: - nss_mirror_log_reset_nexthop_msg(nmm); - break; - - case NSS_MIRROR_MSG_SYNC_STATS: - break; - - default: - nss_trace("%px: Invalid message type\n", nmm); - break; - } -} - -/* - * nss_mirror_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_mirror_log_tx_msg(struct nss_mirror_msg *nmm) -{ - if (nmm->cm.type >= NSS_MIRROR_MSG_MAX) { - nss_warning("%px: Invalid message type\n", nmm); - return; - } - - nss_info("%px: type[%d]:%s\n", nmm, nmm->cm.type, nss_mirror_log_message_types_str[nmm->cm.type]); - nss_mirror_log_verbose(nmm); -} - -/* - * nss_mirror_log_rx_msg() - * Log messages received from FW. - */ -void nss_mirror_log_rx_msg(struct nss_mirror_msg *nmm) -{ - if (nmm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nmm); - return; - } - - if (nmm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nmm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nmm, nmm->cm.type, - nss_mirror_log_message_types_str[nmm->cm.type], - nmm->cm.response, nss_cmn_response_str[nmm->cm.response]); - goto verbose; - } - - if (nmm->cm.error >= NSS_MIRROR_ERROR_TYPE_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nmm, nmm->cm.type, nss_mirror_log_message_types_str[nmm->cm.type], - nmm->cm.response, nss_cmn_response_str[nmm->cm.response], - nmm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nmm, nmm->cm.type, nss_mirror_log_message_types_str[nmm->cm.type], - nmm->cm.response, nss_cmn_response_str[nmm->cm.response], - nmm->cm.error, nss_mirror_log_error_response_types_str[nmm->cm.error]); - -verbose: - nss_mirror_log_verbose(nmm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_log.h deleted file mode 100644 index a81a4a022..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_log.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_MIRROR_LOG_H__ -#define __NSS_MIRROR_LOG_H__ - -/* - * nss_mirror_log.h - * NSS Mirror Log Header File. - */ - -/* - * nss_mirror_log_tx_msg - * Logs a Mirror message that is sent to the NSS firmware. - */ -void nss_mirror_log_tx_msg(struct nss_mirror_msg *nmm); - -/* - * nss_mirror_log_rx_msg - * Logs a Mirror message that is received from the NSS firmware. - */ -void nss_mirror_log_rx_msg(struct nss_mirror_msg *nmm); - -#endif /* __NSS_MIRROR_LOG_H__*/ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.c deleted file mode 100644 index 51fa93c38..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_mirror.h" -#include "nss_mirror_stats.h" -#include "nss_mirror_strings.h" - -static struct nss_mirror_stats_debug_instance *stats_db[NSS_MAX_MIRROR_DYNAMIC_INTERFACES]; - /* Mirror stats data structure. */ - -/* - * Atomic notifier data structure for statistics - */ -ATOMIC_NOTIFIER_HEAD(nss_mirror_stats_notifier); - -static DEFINE_SPINLOCK(nss_mirror_stats_lock); - -/* - * nss_mirror_stats_get() - * Get mirror interface statistics. - */ -static void nss_mirror_stats_get(void *stats_mem, uint32_t stats_num) -{ - struct nss_mirror_stats_debug_instance *stats = (struct nss_mirror_stats_debug_instance *)stats_mem; - int i; - - if (!stats) { - nss_warning("No memory to copy mirror interface stats"); - return; - } - - spin_lock_bh(&nss_mirror_stats_lock); - for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { - - /* - * Copy maximum for given number of instances only. - */ - if (likely(stats_db[i])) { - if (likely(stats_num)) { - memcpy(stats, stats_db[i], sizeof(struct nss_mirror_stats_debug_instance)); - stats++; - stats_num--; - } else { - break; - } - } - } - spin_unlock_bh(&nss_mirror_stats_lock); -} - -/* - * nss_mirror_stats_read() - * Read mirror interface statistics. - */ -static ssize_t nss_mirror_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - - uint32_t max_output_lines = 2 /* header & footer for instance stats */ - + NSS_MAX_MIRROR_DYNAMIC_INTERFACES * - ((NSS_STATS_NODE_MAX + 3 ) + (NSS_MIRROR_STATS_MAX + 3)) /*instance stats */ - + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - struct nss_mirror_stats_debug_instance *mirror_shadow_stats; - uint32_t id, mirror_active_instances = atomic_read(&nss_mirror_num_instances); - char *lbuf; - - if (!mirror_active_instances) { - return 0; - } - - lbuf = vzalloc(size_al); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - mirror_shadow_stats = vzalloc(sizeof(struct nss_mirror_stats_debug_instance) * - mirror_active_instances); - if (unlikely(!mirror_shadow_stats)) { - nss_warning("Could not allocate memory for base debug statistics buffer"); - vfree(lbuf); - return 0; - } - - /* - * Get all stats - */ - nss_mirror_stats_get((void *)mirror_shadow_stats, mirror_active_instances); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "mirror stats", NSS_STATS_SINGLE_CORE); - - /* - * Session stats - */ - for (id = 0; id < mirror_active_instances; id++) { - dev = dev_get_by_index(&init_net, mirror_shadow_stats[id].if_index); - if (likely(dev)) { - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d, netdevice=%s\n", id, - mirror_shadow_stats[id].if_num, dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d\n", id, - mirror_shadow_stats[id].if_num); - } - - size_wr += nss_stats_fill_common_stats(mirror_shadow_stats[id].if_num, id, lbuf, size_wr, size_al, "mirror"); - - /* - * Mirror interface exception stats. - */ - size_wr += nss_stats_print("mirror", "mirror exception stats", - id, - nss_mirror_strings_stats, - mirror_shadow_stats[id].stats, - NSS_MIRROR_STATS_MAX, - lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - vfree(mirror_shadow_stats); - vfree(lbuf); - return bytes_read; -} - -/* - * nss_mirror_stats_sync() - * API to sync statistics for mirror interface. - */ -void nss_mirror_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_mirror_msg *nmm, uint16_t if_num) -{ - uint8_t i, j; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_mirror_stats_sync_msg *stats_msg = &nmm->msg.stats; - struct nss_cmn_node_stats *node_stats_ptr = &stats_msg->node_stats; - uint32_t *mirror_stats_ptr = (uint32_t *)&stats_msg->mirror_stats; - - spin_lock_bh(&nss_mirror_stats_lock); - for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { - if (!stats_db[i] || (stats_db[i]->if_num != if_num)) { - continue; - } - - for (j = 0; j < NSS_MIRROR_STATS_MAX; j++) { - /* - * Sync stats. - */ - stats_db[i]->stats[j] += mirror_stats_ptr[j]; - } - spin_unlock_bh(&nss_mirror_stats_lock); - goto sync_cmn_stats; - } - - spin_unlock_bh(&nss_mirror_stats_lock); - nss_warning("Invalid mirror stats sync message received for %d interface\n", if_num); - return; - -sync_cmn_stats: - spin_lock_bh(&nss_mirror_stats_lock); - - /* - * Sync common stats. - */ - nss_top->stats_node[if_num][NSS_STATS_NODE_RX_PKTS] += node_stats_ptr->rx_packets; - nss_top->stats_node[if_num][NSS_STATS_NODE_RX_BYTES] += node_stats_ptr->rx_bytes; - nss_top->stats_node[if_num][NSS_STATS_NODE_TX_PKTS] += node_stats_ptr->tx_packets; - nss_top->stats_node[if_num][NSS_STATS_NODE_TX_BYTES] += node_stats_ptr->tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_top->stats_node[if_num][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + i] += - node_stats_ptr->rx_dropped[i]; - } - - spin_unlock_bh(&nss_mirror_stats_lock); -} - -/* - * nss_mirror_stats_reset() - * API to reset the mirror interface stats. - */ -void nss_mirror_stats_reset(uint32_t if_num) -{ - struct nss_mirror_stats_debug_instance *mirror_debug_instance = NULL; - uint8_t i; - - /* - * Reset common node stats. - */ - nss_stats_reset_common_stats(if_num); - - /* - * Reset mirror stats. - */ - spin_lock_bh(&nss_mirror_stats_lock); - for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { - if (!stats_db[i] || (stats_db[i]->if_num != if_num)) { - continue; - } - - mirror_debug_instance = stats_db[i]; - stats_db[i] = NULL; - break; - } - spin_unlock_bh(&nss_mirror_stats_lock); - - if (mirror_debug_instance) { - vfree(mirror_debug_instance); - } -} - -/* - * nss_mirror_stats_init() - * API to initialize mirror debug instance statistics. - */ -int nss_mirror_stats_init(uint32_t if_num, struct net_device *netdev) -{ - struct nss_mirror_stats_debug_instance *mirror_debug_instance = NULL; - uint8_t i; - - mirror_debug_instance = - (struct nss_mirror_stats_debug_instance *)vzalloc(sizeof(struct nss_mirror_stats_debug_instance)); - if (!mirror_debug_instance) { - nss_warning("Memory alloc failed for mirror stats instance.\n"); - return -1; - } - - spin_lock_bh(&nss_mirror_stats_lock); - for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { - if (stats_db[i] != NULL) { - continue; - } - - stats_db[i] = mirror_debug_instance; - stats_db[i]->if_num = if_num; - stats_db[i]->if_index = netdev->ifindex; - spin_unlock_bh(&nss_mirror_stats_lock); - return 0; - } - spin_unlock_bh(&nss_mirror_stats_lock); - vfree(mirror_debug_instance); - return -1; -} - -/* - * nss_mirror_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(mirror) - -/* - * nss_mirror_stats_dentry_create() - * Create mirror interface statistics debug entry. - */ -void nss_mirror_stats_dentry_create(void) -{ - nss_stats_create_dentry("mirror", &nss_mirror_stats_ops); -} - -/* - * nss_mirror_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_mirror_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_mirror_stats_notification mirror_stats; - int i; - - spin_lock_bh(&nss_mirror_stats_lock); - for (i = 0; i < NSS_MAX_MIRROR_DYNAMIC_INTERFACES; i++) { - if (!stats_db[i] || (stats_db[i]->if_num != if_num)) { - continue; - } - - memcpy(mirror_stats.stats_ctx, stats_db[i]->stats, sizeof(mirror_stats.stats_ctx)); - mirror_stats.core_id = nss_ctx->id; - mirror_stats.if_num = if_num; - spin_unlock_bh(&nss_mirror_stats_lock); - atomic_notifier_call_chain(&nss_mirror_stats_notifier, NSS_STATS_EVENT_NOTIFY, &mirror_stats); - return; - } - spin_unlock_bh(&nss_mirror_stats_lock); -} - -/* - * nss_mirror_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_mirror_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_mirror_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_mirror_stats_unregister_notifier); - -/* - * nss_mirror_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_mirror_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_mirror_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_mirror_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.h deleted file mode 100644 index 22622a550..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_stats.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_MIRROR_STATS_H -#define __NSS_MIRROR_STATS_H - -/* - * Number of active mirror stats instances. - */ -extern atomic_t nss_mirror_num_instances; - -/* - * nss_mirror_stats_debug_instance - * Stucture for H2N/N2H mirror interface debug stats. - */ -struct nss_mirror_stats_debug_instance { - uint64_t stats[NSS_MIRROR_STATS_MAX]; /* Mirror statistics for each instance. */ - int32_t if_index; /* Mirror instance netdev index. */ - uint32_t if_num; /* Mirror instance NSS interface number */ -}; - -extern void nss_mirror_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_mirror_msg *nmm, uint16_t if_num); -extern void nss_mirror_stats_reset(uint32_t if_num); -extern int nss_mirror_stats_init(uint32_t if_num, struct net_device *netdev); -extern void nss_mirror_stats_dentry_create(void); -extern void nss_mirror_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); - -#endif /* __NSS_MIRROR_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.c deleted file mode 100644 index fb68e0461..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_mirror_strings.h" - -/* - * nss_mirror_strings_stats - * Mirror statistics strings for nss session stats. - */ -struct nss_stats_info nss_mirror_strings_stats[NSS_MIRROR_STATS_MAX] = { - {"pkts", NSS_STATS_TYPE_SPECIAL}, - {"bytes", NSS_STATS_TYPE_SPECIAL}, - {"tx_fail", NSS_STATS_TYPE_DROP}, - {"dest_lookup_fail", NSS_STATS_TYPE_DROP}, - {"mem_alloc_fail", NSS_STATS_TYPE_ERROR}, - {"copy_fail", NSS_STATS_TYPE_ERROR}, -}; - -/* - * nss_mirror_strings_read() - * Read mirror statistics names - */ -static ssize_t nss_mirror_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_mirror_strings_stats, NSS_MIRROR_STATS_MAX); -} - -/* - * nss_mirror_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(mirror); - -/* - * nss_mirror_strings_dentry_create() - * Create mirror statistics strings debug entry. - */ -void nss_mirror_strings_dentry_create(void) -{ - nss_strings_create_dentry("mirror", &nss_mirror_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.h deleted file mode 100644 index 24b73f4c9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_mirror_strings.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_MIRROR_STRINGS_H -#define __NSS_MIRROR_STRINGS_H - -#include "nss_mirror_stats.h" - -extern struct nss_stats_info nss_mirror_strings_stats[NSS_MIRROR_STATS_MAX]; -extern void nss_mirror_strings_dentry_create(void); - -#endif /* __NSS_MIRROR_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_n2h.c b/feeds/ipq807x/qca-nss-drv/src/nss_n2h.c deleted file mode 100644 index ea5c2d04b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_n2h.c +++ /dev/null @@ -1,2250 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_n2h.c - * NSS N2H node APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_n2h_stats.h" -#include "nss_n2h_strings.h" -#include "nss_drv_strings.h" - -#define NSS_N2H_MAX_BUF_POOL_SIZE (1024 * 1024 * 20) /* 20MB */ -#define NSS_N2H_MIN_EMPTY_POOL_BUF_SZ 32 -#define NSS_N2H_MAX_EMPTY_POOL_BUF_SZ 131072 -#define NSS_N2H_DEFAULT_EMPTY_POOL_BUF_SZ 8192 -#define NSS_N2H_TX_TIMEOUT 3000 /* 3 Seconds */ - -int nss_n2h_empty_pool_buf_cfg[NSS_MAX_CORES] __read_mostly = {-1, -1}; -int nss_n2h_empty_paged_pool_buf_cfg[NSS_MAX_CORES] __read_mostly = {-1, -1}; -int nss_n2h_water_mark[NSS_MAX_CORES][2] __read_mostly = {{-1, -1}, {-1, -1} }; -int nss_n2h_paged_water_mark[NSS_MAX_CORES][2] __read_mostly = {{-1, -1}, {-1, -1} }; -int nss_n2h_wifi_pool_buf_cfg __read_mostly = -1; -int nss_n2h_core0_mitigation_cfg __read_mostly = 1; -int nss_n2h_core1_mitigation_cfg __read_mostly = 1; -int nss_n2h_core0_add_buf_pool_size __read_mostly; -int nss_n2h_core1_add_buf_pool_size __read_mostly; -int nss_n2h_queue_limit[NSS_MAX_CORES] __read_mostly = {NSS_DEFAULT_QUEUE_LIMIT, NSS_DEFAULT_QUEUE_LIMIT}; -int nss_n2h_host_bp_config[NSS_MAX_CORES] __read_mostly; - -struct nss_n2h_registered_data { - nss_n2h_msg_callback_t n2h_callback; - void *app_data; -}; - -static struct nss_n2h_cfg_pvt nss_n2h_nepbcfgp[NSS_MAX_CORES]; -static struct nss_n2h_registered_data nss_n2h_rd[NSS_MAX_CORES]; -static struct nss_n2h_cfg_pvt nss_n2h_rcp; -static struct nss_n2h_cfg_pvt nss_n2h_mitigationcp[NSS_CORE_MAX]; -static struct nss_n2h_cfg_pvt nss_n2h_bufcp[NSS_CORE_MAX]; -static struct nss_n2h_cfg_pvt nss_n2h_wp; -static struct nss_n2h_cfg_pvt nss_n2h_q_cfg_pvt; -static struct nss_n2h_cfg_pvt nss_n2h_q_lim_pvt; -static struct nss_n2h_cfg_pvt nss_n2h_host_bp_cfg_pvt; - -/* - * nss_n2h_interface_handler() - * Handle NSS -> HLOS messages for N2H node - */ -static void nss_n2h_interface_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, - void *app_data) -{ - struct nss_n2h_msg *nnm = (struct nss_n2h_msg *)ncm; - nss_n2h_msg_callback_t cb; - - BUG_ON(ncm->interface != NSS_N2H_INTERFACE); - - /* - * Is this a valid request/response packet? - */ - if (nnm->cm.type >= NSS_METADATA_TYPE_N2H_MAX) { - nss_warning("%px: received invalid message %d for Offload stats interface", nss_ctx, nnm->cm.type); - return; - } - - switch (nnm->cm.type) { - case NSS_TX_METADATA_TYPE_N2H_RPS_CFG: - nss_info("NSS N2H rps_en %d \n",nnm->msg.rps_cfg.enable); - break; - - case NSS_TX_METADATA_TYPE_N2H_MITIGATION_CFG: - nss_info("NSS N2H mitigation_dis %d \n",nnm->msg.mitigation_cfg.enable); - break; - - case NSS_TX_METADATA_TYPE_N2H_EMPTY_POOL_BUF_CFG: - nss_info("%px: empty pool buf cfg response from FW", nss_ctx); - break; - - case NSS_TX_METADATA_TYPE_N2H_FLUSH_PAYLOADS: - nss_info("%px: flush payloads cmd response from FW", nss_ctx); - break; - - case NSS_RX_METADATA_TYPE_N2H_STATS_SYNC: - /* - * Update driver statistics and send statistics notifications to the registered modules. - */ - nss_n2h_stats_sync(nss_ctx, &nnm->msg.stats_sync); - nss_n2h_stats_notify(nss_ctx); - break; - - default: - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - /* - * Check response - */ - nss_info("%px: Received response %d for type %d, interface %d", - nss_ctx, ncm->response, ncm->type, ncm->interface); - } - } - - /* - * Update the callback and app_data for NOTIFY messages, n2h sends all notify messages - * to the same callback/app_data. - */ - if (nnm->cm.response == NSS_CMN_RESPONSE_NOTIFY) { - /* - * Place holder for the user to create right call - * back and app data when response is NSS_CMN_RESPONSE_NOTIFY - */ - ncm->cb = (nss_ptr_t)nss_n2h_rd[nss_ctx->id].n2h_callback; - ncm->app_data = (nss_ptr_t)nss_n2h_rd[nss_ctx->id].app_data; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_n2h_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nnm); -} - -/* - * nss_n2h_mitigation_cfg_callback() - * call back function for mitigation configuration - */ -static void nss_n2h_mitigation_cfg_callback(void *app_data, struct nss_n2h_msg *nnm) -{ - uint32_t core_num = (uint32_t)(nss_ptr_t)app_data; - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_num]; - - if (nnm->cm.response != NSS_CMN_RESPONSE_ACK) { - - /* - * Error, hence we are not updating the nss_n2h_mitigate_en - */ - nss_n2h_mitigationcp[core_num].response = NSS_FAILURE; - complete(&nss_n2h_mitigationcp[core_num].complete); - nss_warning("core%d: MITIGATION configuration failed : %d\n", core_num, nnm->cm.error); - return; - } - - nss_info("core%d: MITIGATION configuration succeeded: %d\n", core_num, nnm->cm.error); - - nss_ctx->n2h_mitigate_en = nnm->msg.mitigation_cfg.enable; - nss_n2h_mitigationcp[core_num].response = NSS_SUCCESS; - complete(&nss_n2h_mitigationcp[core_num].complete); -} - -/* - * nss_n2h_buf_cfg_callback() - * call back function for pbuf configuration - */ -static void nss_n2h_bufs_cfg_callback(void *app_data, struct nss_n2h_msg *nnm) -{ - uint32_t core_num = (uint32_t)(nss_ptr_t)app_data; - unsigned int allocated_sz; - - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_num]; - - if (nnm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_n2h_bufcp[core_num].response = NSS_FAILURE; - nss_warning("core%d: buf configuration failed : %d\n", core_num, nnm->cm.error); - goto done; - } - - nss_info("core%d: buf configuration succeeded: %d\n", core_num, nnm->cm.error); - - allocated_sz = nnm->msg.buf_pool.nss_buf_page_size * nnm->msg.buf_pool.nss_buf_num_pages; - nss_ctx->buf_sz_allocated += allocated_sz; - - nss_n2h_bufcp[core_num].response = NSS_SUCCESS; - -done: - complete(&nss_n2h_bufcp[core_num].complete); -} - -/* - * nss_n2h_payload_stats_callback() - * It gets called response to payload accounting. - */ -static void nss_n2h_payload_stats_callback(void *app_data, - struct nss_n2h_msg *nnm) -{ - uint32_t core_num = (uint32_t)(nss_ptr_t)app_data; - - if (nnm->cm.response != NSS_CMN_RESPONSE_ACK) { - struct nss_n2h_empty_pool_buf *nnepbcm; - nnepbcm = &nnm->msg.empty_pool_buf_cfg; - - nss_warning("%d: core empty pool buf set failure: %d\n", - core_num, nnm->cm.error); - nss_n2h_nepbcfgp[core_num].response = NSS_FAILURE; - complete(&nss_n2h_nepbcfgp[core_num].complete); - return; - } - - if (nnm->cm.type == NSS_TX_METADATA_TYPE_GET_WATER_MARK) { - nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.pool_size = - ntohl(nnm->msg.payload_info.pool_size); - nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.low_water = - ntohl(nnm->msg.payload_info.low_water); - nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.high_water = - ntohl(nnm->msg.payload_info.high_water); - } - - if (nnm->cm.type == NSS_TX_METADATA_TYPE_GET_PAGED_WATER_MARK) { - nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.pool_size = - ntohl(nnm->msg.paged_payload_info.pool_size); - nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.low_water = - ntohl(nnm->msg.paged_payload_info.low_water); - nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.high_water = - ntohl(nnm->msg.paged_payload_info.high_water); - } - - nss_n2h_nepbcfgp[core_num].response = NSS_SUCCESS; - complete(&nss_n2h_nepbcfgp[core_num].complete); -} - -/* - * nss_n2h_set_wifi_payloads_callback() - * call back function for response to wifi pool configuration - * - */ -static void nss_n2h_set_wifi_payloads_callback(void *app_data, - struct nss_n2h_msg *nnm) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = (struct nss_ctx_instance *)app_data; - if (nnm->cm.response != NSS_CMN_RESPONSE_ACK) { - - nss_n2h_wp.response = NSS_FAILURE; - complete(&nss_n2h_wp.complete); - nss_warning("%px: wifi pool configuration failed : %d\n", nss_ctx, - nnm->cm.error); - return; - } - - nss_info("%px: wifi payload configuration succeeded: %d\n", nss_ctx, - nnm->cm.error); - nss_n2h_wp.response = NSS_SUCCESS; - nss_n2h_wp.wifi_pool = ntohl(nnm->msg.wp.payloads); - complete(&nss_n2h_wp.complete); -} - -/* - * nss_n2h_get_payload_info() - * Gets Payload information. - */ -static int nss_n2h_get_payload_info(nss_ptr_t core_num, struct nss_n2h_msg *nnm, struct nss_n2h_payload_info *nnepbcm) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_num]; - nss_tx_status_t nss_tx_status; - int ret = NSS_FAILURE; - - /* - * Note that semaphore should be already held. - */ - - nss_tx_status = nss_n2h_tx_msg(nss_ctx, nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: core %d nss_tx error errorn", nss_ctx, (int)core_num); - return NSS_FAILURE; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_nepbcfgp[core_num].complete, - msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: core %d waiting for ack timed out\n", nss_ctx, (int)core_num); - return NSS_FAILURE; - } - - if (NSS_FAILURE == nss_n2h_nepbcfgp[core_num].response) { - nss_warning("%px: core %d response returned failure\n", nss_ctx, (int)core_num); - return NSS_FAILURE; - } - - return NSS_SUCCESS; -} - -/* - * nss_n2h_get_default_payload_info() - * Gets the default payload information. - */ -static int nss_n2h_get_default_payload_info(nss_ptr_t core_num) -{ - struct nss_n2h_msg nnm; - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_GET_WATER_MARK, - sizeof(struct nss_n2h_payload_info), - nss_n2h_payload_stats_callback, - (void *)core_num); - - return nss_n2h_get_payload_info(core_num, &nnm, - &nnm.msg.payload_info); -} - -/* - * nss_n2h_get_paged_payload_info() - * Gets the paged payload information. - */ -static int nss_n2h_get_paged_payload_info(nss_ptr_t core_num) -{ - struct nss_n2h_msg nnm; - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_GET_PAGED_WATER_MARK, - sizeof(struct nss_n2h_payload_info), - nss_n2h_payload_stats_callback, - (void *)core_num); - - return nss_n2h_get_payload_info(core_num, &nnm, - &nnm.msg.paged_payload_info); -} - -/* - * nss_n2h_set_empty_buf_pool() - * Sets empty pool buffer - */ -static int nss_n2h_set_empty_buf_pool(struct ctl_table *ctl, int write, - void __user *buffer, - size_t *lenp, loff_t *ppos, - nss_ptr_t core_num, int *new_val) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_num]; - struct nss_n2h_msg nnm; - struct nss_n2h_empty_pool_buf *nnepbcm; - nss_tx_status_t nss_tx_status; - int ret = NSS_FAILURE; - - /* - * Acquiring semaphore - */ - down(&nss_n2h_nepbcfgp[core_num].sem); - - /* - * Take snap shot of current value - */ - nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.pool_size = *new_val; - - if (!write) { - ret = nss_n2h_get_default_payload_info(core_num); - *new_val = nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.pool_size; - if (ret == NSS_FAILURE) { - up(&nss_n2h_nepbcfgp[core_num].sem); - return -EBUSY; - } - - up(&nss_n2h_nepbcfgp[core_num].sem); - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - return ret; - } - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - up(&nss_n2h_nepbcfgp[core_num].sem); - return ret; - } - - if ((*new_val < NSS_N2H_MIN_EMPTY_POOL_BUF_SZ)) { - nss_warning("%px: core %d setting %d < min number of buffer", - nss_ctx, (int)core_num, *new_val); - goto failure; - } - - nss_info("%px: core %d number of empty pool buffer is : %d\n", - nss_ctx, (int)core_num, *new_val); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_EMPTY_POOL_BUF_CFG, - sizeof(struct nss_n2h_empty_pool_buf), - nss_n2h_payload_stats_callback, - (nss_ptr_t *)core_num); - - nnepbcm = &nnm.msg.empty_pool_buf_cfg; - nnepbcm->pool_size = htonl(*new_val); - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: core %d nss_tx error empty pool buffer: %d\n", - nss_ctx, (int)core_num, *new_val); - goto failure; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_nepbcfgp[core_num].complete, - msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: core %d Waiting for ack timed out\n", nss_ctx, (int)core_num); - goto failure; - } - - /* - * ACK/NACK received from NSS FW - * If ACK: Callback function will update nss_n2h_empty_pool_buf with - * nss_n2h_nepbcfgp.num_conn_valid, which holds the user input - */ - if (NSS_FAILURE == nss_n2h_nepbcfgp[core_num].response) { - goto failure; - } - - up(&nss_n2h_nepbcfgp[core_num].sem); - return 0; - -failure: - /* - * Restore the current_value to its previous state - */ - *new_val = nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.pool_size; - up(&nss_n2h_nepbcfgp[core_num].sem); - return NSS_FAILURE; -} - -/* - * nss_n2h_set_empty_paged_pool_buf() - * Sets empty paged pool buffer - */ -static int nss_n2h_set_empty_paged_pool_buf(struct ctl_table *ctl, int write, - void __user *buffer, - size_t *lenp, loff_t *ppos, - nss_ptr_t core_num, int *new_val) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_num]; - struct nss_n2h_msg nnm; - struct nss_n2h_empty_pool_buf *nneppbcm; - nss_tx_status_t nss_tx_status; - int ret = NSS_FAILURE; - - /* - * Acquiring semaphore - */ - down(&nss_n2h_nepbcfgp[core_num].sem); - - /* - * Take snap shot of current value - */ - nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.pool_size = *new_val; - - if (!write) { - ret = nss_n2h_get_paged_payload_info(core_num); - *new_val = nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.pool_size; - if (ret == NSS_FAILURE) { - up(&nss_n2h_nepbcfgp[core_num].sem); - return -EBUSY; - } - - up(&nss_n2h_nepbcfgp[core_num].sem); - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - return ret; - } - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - up(&nss_n2h_nepbcfgp[core_num].sem); - return ret; - } - - if ((*new_val < NSS_N2H_MIN_EMPTY_POOL_BUF_SZ)) { - nss_warning("%px: core %d setting %d < min number of buffer", - nss_ctx, (int)core_num, *new_val); - goto failure; - } - - nss_info("%px: core %d number of empty paged pool buffer is : %d\n", - nss_ctx, (int)core_num, *new_val); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_EMPTY_PAGED_POOL_BUF_CFG, - sizeof(struct nss_n2h_empty_pool_buf), - nss_n2h_payload_stats_callback, - (nss_ptr_t *)core_num); - - nneppbcm = &nnm.msg.empty_pool_buf_cfg; - nneppbcm->pool_size = htonl(*new_val); - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: core %d nss_tx error empty paged pool buffer: %d\n", - nss_ctx, (int)core_num, *new_val); - goto failure; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_nepbcfgp[core_num].complete, - msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: core %d Waiting for ack timed out\n", nss_ctx, (int)core_num); - goto failure; - } - - /* - * ACK/NACK received from NSS FW - * If ACK: Callback function will update nss_n2h_empty_pool_buf with - * nss_n2h_nepbcfgp.num_conn_valid, which holds the user input - */ - if (NSS_FAILURE == nss_n2h_nepbcfgp[core_num].response) { - goto failure; - } - - up(&nss_n2h_nepbcfgp[core_num].sem); - return 0; - -failure: - /* - * Restore the current_value to its previous state - */ - *new_val = nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.pool_size; - up(&nss_n2h_nepbcfgp[core_num].sem); - return NSS_FAILURE; -} - -/* - * nss_n2h_set_water_mark() - * Sets water mark for N2H SOS - */ -static int nss_n2h_set_water_mark(struct ctl_table *ctl, int write, - void __user *buffer, - size_t *lenp, loff_t *ppos, - uint32_t core_num, int *low, int *high) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_num]; - struct nss_n2h_msg nnm; - struct nss_n2h_water_mark *wm; - nss_tx_status_t nss_tx_status; - int ret = NSS_FAILURE; - - /* - * Acquiring semaphore - */ - down(&nss_n2h_nepbcfgp[core_num].sem); - - /* - * Take snap shot of current value - */ - nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.low_water = *low; - nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.high_water = *high; - - if (!write || *low == -1 || *high == -1) { - ret = nss_n2h_get_default_payload_info(core_num); - if (ret == NSS_FAILURE) { - up(&nss_n2h_nepbcfgp[core_num].sem); - return -EBUSY; - } - - *low = nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.low_water; - *high = nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.high_water; - } - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (!write || ret) { - up(&nss_n2h_nepbcfgp[core_num].sem); - return ret; - } - - if ((*low < NSS_N2H_MIN_EMPTY_POOL_BUF_SZ) || - (*high < NSS_N2H_MIN_EMPTY_POOL_BUF_SZ)) { - nss_warning("%px: core %d setting %d, %d < min number of buffer", - nss_ctx, core_num, *low, *high); - goto failure; - } - - if ((*low > NSS_N2H_MAX_EMPTY_POOL_BUF_SZ) || - (*high > NSS_N2H_MAX_EMPTY_POOL_BUF_SZ)) { - nss_warning("%px: core %d setting %d, %d is > upper limit", - nss_ctx, core_num, *low, *high); - goto failure; - } - - if (*low > *high) { - nss_warning("%px: core %d setting low %d is more than high %d", - nss_ctx, core_num, *low, *high); - goto failure; - } - - nss_info("%px: core %d number of low : %d and high : %d\n", - nss_ctx, core_num, *low, *high); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_SET_WATER_MARK, - sizeof(struct nss_n2h_water_mark), - nss_n2h_payload_stats_callback, - (void *)(nss_ptr_t)core_num); - - wm = &nnm.msg.wm; - wm->low_water = htonl(*low); - wm->high_water = htonl(*high); - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: core %d nss_tx error setting : %d, %d\n", - nss_ctx, core_num, *low, *high); - goto failure; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_nepbcfgp[core_num].complete, - msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: core %d Waiting for ack timed out\n", nss_ctx, - core_num); - goto failure; - } - - /* - * ACK/NACK received from NSS FW - */ - if (NSS_FAILURE == nss_n2h_nepbcfgp[core_num].response) - goto failure; - - up(&nss_n2h_nepbcfgp[core_num].sem); - return NSS_SUCCESS; - -failure: - /* - * Restore the current_value to its previous state - */ - *low = nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.low_water; - *high = nss_n2h_nepbcfgp[core_num].empty_buf_pool_info.high_water; - up(&nss_n2h_nepbcfgp[core_num].sem); - return -EINVAL; -} - -/* - * nss_n2h_set_paged_water_mark() - * Sets water mark for paged pool N2H SOS - */ -static int nss_n2h_set_paged_water_mark(struct ctl_table *ctl, int write, - void __user *buffer, - size_t *lenp, loff_t *ppos, - uint32_t core_num, int *low, int *high) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_num]; - struct nss_n2h_msg nnm; - struct nss_n2h_water_mark *pwm; - nss_tx_status_t nss_tx_status; - int ret = NSS_FAILURE; - - /* - * Acquiring semaphore - */ - down(&nss_n2h_nepbcfgp[core_num].sem); - - /* - * Take snap shot of current value - */ - nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.low_water = *low; - nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.high_water = *high; - - if (!write || *low == -1 || *high == -1) { - ret = nss_n2h_get_paged_payload_info(core_num); - if (ret == NSS_FAILURE) { - up(&nss_n2h_nepbcfgp[core_num].sem); - return -EBUSY; - } - - *low = nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.low_water; - *high = nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.high_water; - } - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (!write || ret) { - up(&nss_n2h_nepbcfgp[core_num].sem); - return ret; - } - - if ((*low < NSS_N2H_MIN_EMPTY_POOL_BUF_SZ) || - (*high < NSS_N2H_MIN_EMPTY_POOL_BUF_SZ)) { - nss_warning("%px: core %d setting %d, %d < min number of buffer", - nss_ctx, core_num, *low, *high); - goto failure; - } - - if ((*low > NSS_N2H_MAX_EMPTY_POOL_BUF_SZ) || - (*high > NSS_N2H_MAX_EMPTY_POOL_BUF_SZ)) { - nss_warning("%px: core %d setting %d, %d is > upper limit", - nss_ctx, core_num, *low, *high); - goto failure; - } - - if (*low > *high) { - nss_warning("%px: core %d setting low %d is more than high %d", - nss_ctx, core_num, *low, *high); - goto failure; - } - - nss_info("%px: core %d number of low : %d and high : %d\n", - nss_ctx, core_num, *low, *high); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_SET_PAGED_WATER_MARK, - sizeof(struct nss_n2h_water_mark), - nss_n2h_payload_stats_callback, - (void *)(nss_ptr_t)core_num); - - pwm = &nnm.msg.wm_paged; - pwm->low_water = htonl(*low); - pwm->high_water = htonl(*high); - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: core %d nss_tx error setting : %d, %d\n", - nss_ctx, core_num, *low, *high); - goto failure; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_nepbcfgp[core_num].complete, - msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: core %d Waiting for ack timed out\n", nss_ctx, - core_num); - goto failure; - } - - /* - * ACK/NACK received from NSS FW - */ - if (NSS_FAILURE == nss_n2h_nepbcfgp[core_num].response) - goto failure; - - up(&nss_n2h_nepbcfgp[core_num].sem); - return NSS_SUCCESS; - -failure: - /* - * Restore the current_value to its previous state - */ - *low = nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.low_water; - *high = nss_n2h_nepbcfgp[core_num].empty_paged_buf_pool_info.high_water; - up(&nss_n2h_nepbcfgp[core_num].sem); - return -EINVAL; -} - -/* - * nss_n2h_cfg_wifi_pool() - * Sets number of wifi payloads to adjust high water mark for N2H SoS - */ -static int nss_n2h_cfg_wifi_pool(struct ctl_table *ctl, int write, - void __user *buffer, - size_t *lenp, loff_t *ppos, - int *payloads) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - struct nss_n2h_msg nnm; - struct nss_n2h_wifi_payloads *wp; - nss_tx_status_t nss_tx_status; - int ret = NSS_FAILURE; - - /* - * Acquiring semaphore - */ - down(&nss_n2h_wp.sem); - - if (!write) { - *payloads = nss_n2h_wp.wifi_pool; - - up(&nss_n2h_wp.sem); - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - return ret; - } - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - up(&nss_n2h_wp.sem); - return ret; - } - - /* - * If payloads parameter is not set, we do - * nothing. - */ - if (*payloads == -1) - goto failure; - - if ((*payloads < NSS_N2H_MIN_EMPTY_POOL_BUF_SZ)) { - nss_warning("%px: wifi setting %d < min number of buffer", - nss_ctx, *payloads); - goto failure; - } - - if ((*payloads > NSS_N2H_MAX_EMPTY_POOL_BUF_SZ)) { - nss_warning("%px: wifi setting %d > max number of buffer", - nss_ctx, *payloads); - goto failure; - } - - nss_info("%px: wifi payloads : %d\n", - nss_ctx, *payloads); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_WIFI_POOL_BUF_CFG, - sizeof(struct nss_n2h_wifi_payloads), - nss_n2h_set_wifi_payloads_callback, - (void *)nss_ctx); - - wp = &nnm.msg.wp; - wp->payloads = htonl(*payloads); - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: wifi setting %d nss_tx error", - nss_ctx, *payloads); - goto failure; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_wp.complete, - msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: Waiting for ack timed out\n", nss_ctx); - goto failure; - } - - /* - * ACK/NACK received from NSS FW - */ - if (NSS_FAILURE == nss_n2h_wp.response) - goto failure; - - up(&nss_n2h_wp.sem); - return NSS_SUCCESS; - -failure: - up(&nss_n2h_wp.sem); - return -EINVAL; -} - -/* - * nss_n2h_empty_pool_buf_core1_handler() - * Sets the number of empty buffer for core 1 - */ -static int nss_n2h_empty_pool_buf_cfg_core1_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_empty_buf_pool(ctl, write, buffer, lenp, ppos, - NSS_CORE_1, &nss_n2h_empty_pool_buf_cfg[NSS_CORE_1]); -} - -/* - * nss_n2h_empty_pool_buf_core0_handler() - * Sets the number of empty buffer for core 0 - */ -static int nss_n2h_empty_pool_buf_cfg_core0_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_empty_buf_pool(ctl, write, buffer, lenp, ppos, - NSS_CORE_0, &nss_n2h_empty_pool_buf_cfg[NSS_CORE_0]); -} - -/* - * nss_n2h_empty_paged_pool_buf_cfg_core1_handler() - * Sets the number of empty paged buffer for core 1 - */ -static int nss_n2h_empty_paged_pool_buf_cfg_core1_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_empty_paged_pool_buf(ctl, write, buffer, lenp, ppos, - NSS_CORE_1, &nss_n2h_empty_paged_pool_buf_cfg[NSS_CORE_1]); -} - -/* - * nss_n2h_empty_paged_pool_buf_cfg_core0_handler() - * Sets the number of empty paged buffer for core 0 - */ -static int nss_n2h_empty_paged_pool_buf_cfg_core0_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_empty_paged_pool_buf(ctl, write, buffer, lenp, ppos, - NSS_CORE_0, &nss_n2h_empty_paged_pool_buf_cfg[NSS_CORE_0]); -} - -/* - * nss_n2h_water_mark_core1_handler() - * Sets water mark for core 1 - */ -static int nss_n2h_water_mark_core1_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_water_mark(ctl, write, buffer, lenp, ppos, - NSS_CORE_1, &nss_n2h_water_mark[NSS_CORE_1][0], - &nss_n2h_water_mark[NSS_CORE_1][1]); -} - -/* - * nss_n2h_water_mark_core0_handler() - * Sets water mark for core 0 - */ -static int nss_n2h_water_mark_core0_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_water_mark(ctl, write, buffer, lenp, ppos, - NSS_CORE_0, &nss_n2h_water_mark[NSS_CORE_0][0], - &nss_n2h_water_mark[NSS_CORE_0][1]); -} - -/* - * nss_n2h_paged_water_mark_core1_handler() - * Sets paged water mark for core 1 - */ -static int nss_n2h_paged_water_mark_core1_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_paged_water_mark(ctl, write, buffer, lenp, ppos, - NSS_CORE_1, &nss_n2h_paged_water_mark[NSS_CORE_1][0], - &nss_n2h_paged_water_mark[NSS_CORE_1][1]); -} - -/* - * nss_n2h_paged_water_mark_core0_handler() - * Sets paged water mark for core 0 - */ -static int nss_n2h_paged_water_mark_core0_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_paged_water_mark(ctl, write, buffer, lenp, ppos, - NSS_CORE_0, &nss_n2h_paged_water_mark[NSS_CORE_0][0], - &nss_n2h_paged_water_mark[NSS_CORE_0][1]); -} - -/* - * nss_n2h_wifi_payloads_handler() - * Sets number of wifi payloads - */ -static int nss_n2h_wifi_payloads_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_cfg_wifi_pool(ctl, write, buffer, lenp, ppos, - &nss_n2h_wifi_pool_buf_cfg); -} - -/* - * nss_n2h_update_queue_config_callback() - * Callback to handle the completion of queue config command - */ -static void nss_n2h_update_queue_config_callback(void *app_data, struct nss_n2h_msg *nim) -{ - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("n2h Error response %d\n", nim->cm.response); - nss_n2h_q_cfg_pvt.response = NSS_TX_FAILURE; - } else { - nss_n2h_q_cfg_pvt.response = NSS_TX_SUCCESS; - } - - complete(&nss_n2h_q_cfg_pvt.complete); -} - -/* - * nss_n2h_update_queue_config_async() - * Asynchronous call to send pnode queue configuration. - */ -nss_tx_status_t nss_n2h_update_queue_config_async(struct nss_ctx_instance *nss_ctx, bool mq_en, uint16_t *qlimits) -{ - - struct nss_n2h_msg nnm; - struct nss_n2h_pnode_queue_config *cfg; - nss_tx_status_t status; - int i; - - if (!mq_en) { - return NSS_TX_SUCCESS; - } - - /* - * MQ mode doesnot make any sense if number of priority queues in NSS - * is 1 - */ - if (NSS_MAX_NUM_PRI <= 1) { - return NSS_TX_SUCCESS; - } - - memset(&nnm, 0, sizeof(struct nss_n2h_msg)); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_SET_PNODE_QUEUE_CFG, - sizeof(struct nss_n2h_pnode_queue_config), NULL, 0); - - cfg = &nnm.msg.pn_q_cfg; - - /* - * Update limits - */ - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - cfg->qlimits[i] = qlimits[i]; - } - cfg->mq_en = true; - - status = nss_n2h_tx_msg(nss_ctx, &nnm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error to send pnode queue config\n", nss_ctx); - return status; - } - - return NSS_TX_SUCCESS; -} -EXPORT_SYMBOL(nss_n2h_update_queue_config_async); - -/* - * nss_n2h_update_queue_config_sync() - * Synchronous call to send pnode queue configuration. - */ -nss_tx_status_t nss_n2h_update_queue_config_sync(struct nss_ctx_instance *nss_ctx, bool mq_en, uint16_t *qlimits) -{ - - struct nss_n2h_msg nnm; - struct nss_n2h_pnode_queue_config *cfg; - nss_tx_status_t status; - int ret, i; - - if (!mq_en) { - return NSS_TX_SUCCESS; - } - - /* - * MQ mode doesnot make any sense if number of priority queues in NSS - * is 1 - */ - if (NSS_MAX_NUM_PRI <= 1) { - return NSS_TX_SUCCESS; - } - - memset(&nnm, 0, sizeof(struct nss_n2h_msg)); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_SET_PNODE_QUEUE_CFG, - sizeof(struct nss_n2h_pnode_queue_config), nss_n2h_update_queue_config_callback, 0); - - cfg = &nnm.msg.pn_q_cfg; - - /* - * Update limits - */ - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - cfg->qlimits[i] = qlimits[i]; - } - cfg->mq_en = true; - - down(&nss_n2h_q_cfg_pvt.sem); - - status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: n2h_tx_msg failed\n", nss_ctx); - up(&nss_n2h_q_cfg_pvt.sem); - return status; - } - ret = wait_for_completion_timeout(&nss_n2h_q_cfg_pvt.complete, msecs_to_jiffies(NSS_N2H_TX_TIMEOUT)); - - if (!ret) { - nss_warning("%px: Timeout expired for pnode queue config sync message\n", nss_ctx); - nss_n2h_q_cfg_pvt.response = NSS_TX_FAILURE; - } - - status = nss_n2h_q_cfg_pvt.response; - up(&nss_n2h_q_cfg_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_n2h_update_queue_config_sync); - -/* - * nss_n2h_mitigation_cfg() - * Send Message to NSS to disable MITIGATION. - */ -static nss_tx_status_t nss_n2h_mitigation_cfg(struct nss_ctx_instance *nss_ctx, int enable_mitigation, nss_core_id_t core_num) -{ - struct nss_n2h_msg nnm; - struct nss_n2h_mitigation *mitigation_cfg; - nss_tx_status_t nss_tx_status; - int ret; - - nss_assert(core_num < NSS_CORE_MAX); - - down(&nss_n2h_mitigationcp[core_num].sem); - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, NSS_TX_METADATA_TYPE_N2H_MITIGATION_CFG, - sizeof(struct nss_n2h_mitigation), - nss_n2h_mitigation_cfg_callback, - (void *)core_num); - - mitigation_cfg = &nnm.msg.mitigation_cfg; - mitigation_cfg->enable = enable_mitigation; - - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error setting mitigation\n", nss_ctx); - goto failure; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_mitigationcp[core_num].complete, msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: Waiting for ack timed out\n", nss_ctx); - goto failure; - } - - /* - * ACK/NACK received from NSS FW - */ - if (NSS_FAILURE == nss_n2h_mitigationcp[core_num].response) { - goto failure; - } - - up(&nss_n2h_mitigationcp[core_num].sem); - return NSS_SUCCESS; - -failure: - up(&nss_n2h_mitigationcp[core_num].sem); - return NSS_FAILURE; -} - -static inline void nss_n2h_buf_pool_free(struct nss_n2h_buf_pool *buf_pool) -{ - int page_count; - for (page_count = 0; page_count < buf_pool->nss_buf_num_pages; page_count++) { - kfree((void *)buf_pool->nss_buf_pool_vaddr[page_count]); - } -} - -/* - * nss_n2h_buf_cfg() - * Send Message to NSS to enable pbufs. - */ -static nss_tx_status_t nss_n2h_buf_pool_cfg(struct nss_ctx_instance *nss_ctx, - int buf_pool_size, nss_core_id_t core_num) -{ - static struct nss_n2h_msg nnm; - struct nss_n2h_buf_pool *buf_pool; - nss_tx_status_t nss_tx_status; - int ret; - int page_count; - int num_pages = ALIGN(buf_pool_size, PAGE_SIZE)/PAGE_SIZE; - - nss_assert(core_num < NSS_CORE_MAX); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, NSS_METADATA_TYPE_N2H_ADD_BUF_POOL, - sizeof(struct nss_n2h_buf_pool), - nss_n2h_bufs_cfg_callback, - (void *)core_num); - - do { - - down(&nss_n2h_bufcp[core_num].sem); - - buf_pool = &nnm.msg.buf_pool; - buf_pool->nss_buf_page_size = PAGE_SIZE; - - for (page_count = 0; page_count < MAX_PAGES_PER_MSG && num_pages; page_count++, num_pages--) { - void *kern_addr = kzalloc(PAGE_SIZE, GFP_ATOMIC); - if (!kern_addr) { - BUG_ON(!page_count); - break; - } - - kmemleak_not_leak(kern_addr); - buf_pool->nss_buf_pool_vaddr[page_count] = (nss_ptr_t)kern_addr; - buf_pool->nss_buf_pool_addr[page_count] = dma_map_single(nss_ctx->dev, kern_addr, PAGE_SIZE, DMA_TO_DEVICE); - } - - buf_pool->nss_buf_num_pages = page_count; - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - if (nss_tx_status != NSS_TX_SUCCESS) { - - nss_n2h_buf_pool_free(buf_pool); - nss_warning("%px: nss_tx error setting pbuf\n", nss_ctx); - goto failure; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_bufcp[core_num].complete, msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: Waiting for ack timed out\n", nss_ctx); - goto failure; - } - - /* - * ACK/NACK received from NSS FW - */ - if (NSS_FAILURE == nss_n2h_bufcp[core_num].response) { - - nss_n2h_buf_pool_free(buf_pool); - goto failure; - } - - up(&nss_n2h_bufcp[core_num].sem); - } while(num_pages); - - return NSS_SUCCESS; -failure: - up(&nss_n2h_bufcp[core_num].sem); - return NSS_FAILURE; -} - -/* - * nss_mitigation_handler() - * Enable NSS MITIGATION - */ -static int nss_n2h_mitigationcfg_core0_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_0]; - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - /* - * It's a read operation - */ - if (!write) { - return ret; - } - - if (!nss_n2h_core0_mitigation_cfg) { - printk(KERN_INFO "Disabling NSS MITIGATION\n"); - nss_n2h_mitigation_cfg(nss_ctx, 0, NSS_CORE_0); - return 0; - } - printk(KERN_INFO "Invalid input value.Valid value is 0, Runtime re-enabling not supported\n"); - return -EINVAL; -} - -/* - * nss_mitigation_handler() - * Enable NSS MITIGATION - */ -static int nss_n2h_mitigationcfg_core1_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_1]; - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - /* - * It's a read operation - */ - if (!write) { - return ret; - } - - if (!nss_n2h_core1_mitigation_cfg) { - printk(KERN_INFO "Disabling NSS MITIGATION\n"); - nss_n2h_mitigation_cfg(nss_ctx, 0, NSS_CORE_1); - return 0; - } - printk(KERN_INFO "Invalid input value.Valid value is 0, Runtime re-enabling not supported\n"); - return -EINVAL; -} - -/* - * nss_buf_handler() - * Add extra NSS bufs from host memory - */ -static int nss_n2h_buf_cfg_core0_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_0]; - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - /* - * It's a read operation - */ - if (!write) { - return ret; - } - - if (nss_ctx->buf_sz_allocated) { - nss_n2h_core0_add_buf_pool_size = nss_ctx->buf_sz_allocated; - return -EPERM; - } - - if ((nss_n2h_core0_add_buf_pool_size >= 1) && (nss_n2h_core0_add_buf_pool_size <= NSS_N2H_MAX_BUF_POOL_SIZE)) { - printk(KERN_INFO "configuring additional NSS pbufs\n"); - ret = nss_n2h_buf_pool_cfg(nss_ctx, nss_n2h_core0_add_buf_pool_size, NSS_CORE_0); - nss_n2h_core0_add_buf_pool_size = nss_ctx->buf_sz_allocated; - printk(KERN_INFO "additional pbufs of size %d got added to NSS\n", nss_ctx->buf_sz_allocated); - return ret; - } - - printk(KERN_INFO "Invalid input value. should be greater than 1 and less than %d\n", NSS_N2H_MAX_BUF_POOL_SIZE); - return -EINVAL; -} - -/* - * nss_n2h_buf_handler() - * Add extra NSS bufs from host memory - */ -static int nss_n2h_buf_cfg_core1_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_1]; - int ret; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret) { - return ret; - } - - /* - * It's a read operation - */ - if (!write) { - return ret; - } - - if (nss_ctx->buf_sz_allocated) { - nss_n2h_core1_add_buf_pool_size = nss_ctx->buf_sz_allocated; - return -EPERM; - } - - if ((nss_n2h_core1_add_buf_pool_size >= 1) && (nss_n2h_core1_add_buf_pool_size <= NSS_N2H_MAX_BUF_POOL_SIZE)) { - printk(KERN_INFO "configuring additional NSS pbufs\n"); - ret = nss_n2h_buf_pool_cfg(nss_ctx, nss_n2h_core1_add_buf_pool_size, NSS_CORE_1); - nss_n2h_core1_add_buf_pool_size = nss_ctx->buf_sz_allocated; - printk(KERN_INFO "additional pbufs of size %d got added to NSS\n", nss_ctx->buf_sz_allocated); - return ret; - } - - printk(KERN_INFO "Invalid input value. should be greater than 1 and less than %d\n", NSS_N2H_MAX_BUF_POOL_SIZE); - return -EINVAL; -} - -/* - * nss_n2h_queue_limit_callback() - * Callback to handle the completion of queue limit command. - */ -static void nss_n2h_queue_limit_callback(void *app_data, struct nss_n2h_msg *nim) -{ - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("n2h error response %d\n", nim->cm.response); - } - - nss_n2h_q_lim_pvt.response = nim->cm.response; - complete(&nss_n2h_q_lim_pvt.complete); -} - -/* - * nss_n2h_set_queue_limit_sync() - * Sets the n2h queue size limit synchronously. - */ -static int nss_n2h_set_queue_limit_sync(struct ctl_table *ctl, int write, void __user *buffer, - size_t *lenp, loff_t *ppos, uint32_t core_id) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_id]; - struct nss_n2h_msg nim; - struct nss_n2h_queue_limit_config *nnqlc = NULL; - int ret, current_val; - nss_tx_status_t nss_tx_status; - - /* - * Take a snap shot of current value - */ - current_val = nss_n2h_queue_limit[core_id]; - - /* - * Write the variable with user input - */ - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret || (!write)) { - return ret; - } - - /* - * We dont allow shortening of the queue size at run-time - */ - if (nss_n2h_queue_limit[core_id] < current_val) { - nss_warning("%px: New queue limit %d less than previous value %d. Cant allow shortening\n", - nss_ctx, nss_n2h_queue_limit[core_id], current_val); - nss_n2h_queue_limit[core_id] = current_val; - return NSS_TX_FAILURE; - } - - memset(&nim, 0, sizeof(struct nss_n2h_msg)); - nss_n2h_msg_init(&nim, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_QUEUE_LIMIT_CFG, - sizeof(struct nss_n2h_queue_limit_config), nss_n2h_queue_limit_callback, NULL); - - nnqlc = &nim.msg.ql_cfg; - nnqlc->qlimit = nss_n2h_queue_limit[core_id]; - - /* - * Send synchronous message to firmware - */ - down(&nss_n2h_q_lim_pvt.sem); - - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nim); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: n2h queue limit message send failed\n", nss_ctx); - nss_n2h_queue_limit[core_id] = current_val; - up(&nss_n2h_q_lim_pvt.sem); - return nss_tx_status; - } - - ret = wait_for_completion_timeout(&nss_n2h_q_lim_pvt.complete, msecs_to_jiffies(NSS_N2H_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: Timeout expired for queue limit sync message\n", nss_ctx); - nss_n2h_queue_limit[core_id] = current_val; - up(&nss_n2h_q_lim_pvt.sem); - return NSS_TX_FAILURE; - } - - /* - * If setting the queue limit failed, reset the value to original value - */ - if (nss_n2h_q_lim_pvt.response != NSS_CMN_RESPONSE_ACK) { - nss_n2h_queue_limit[core_id] = current_val; - } - - up(&nss_n2h_q_lim_pvt.sem); - return NSS_TX_SUCCESS; -} - -/* - * nss_n2h_queue_limit_core0_handler() - * Sets the n2h queue size limit for core0 - */ -static int nss_n2h_queue_limit_core0_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_queue_limit_sync(ctl, write, buffer, lenp, ppos, - NSS_CORE_0); -} - -/* - * nss_n2h_queue_limit_core1_handler() - * Sets the n2h queue size limit for core1 - */ -static int nss_n2h_queue_limit_core1_handler(struct ctl_table *ctl, - int write, void __user *buffer, - size_t *lenp, loff_t *ppos) -{ - return nss_n2h_set_queue_limit_sync(ctl, write, buffer, lenp, ppos, - NSS_CORE_1); -} - -/* - * nss_n2h_host_bp_cfg_callback() - * Callback function for back pressure configuration. - */ -static void nss_n2h_host_bp_cfg_callback(void *app_data, struct nss_n2h_msg *nnm) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = (struct nss_ctx_instance *)app_data; - if (nnm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_n2h_host_bp_cfg_pvt.response = NSS_FAILURE; - complete(&nss_n2h_host_bp_cfg_pvt.complete); - nss_warning("%px: n2h back pressure configuration failed : %d\n", nss_ctx, nnm->cm.error); - return; - } - - nss_info("%px: n2h back pressure configuration succeeded: %d\n", nss_ctx, nnm->cm.error); - nss_n2h_host_bp_cfg_pvt.response = NSS_SUCCESS; - complete(&nss_n2h_host_bp_cfg_pvt.complete); -} - -/* - * nss_n2h_host_bp_cfg() - * Send Message to n2h to enable back pressure. - */ -static nss_tx_status_t nss_n2h_host_bp_cfg_sync(struct nss_ctx_instance *nss_ctx, int enable_bp) -{ - struct nss_n2h_msg nnm; - nss_tx_status_t nss_tx_status; - int ret; - - down(&nss_n2h_host_bp_cfg_pvt.sem); - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, NSS_TX_METADATA_TYPE_N2H_HOST_BACK_PRESSURE_CFG, - sizeof(struct nss_n2h_host_back_pressure), - nss_n2h_host_bp_cfg_callback, - (void *)nss_ctx); - - nnm.msg.host_bp_cfg.enable = enable_bp; - - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error setting back pressure\n", nss_ctx); - up(&nss_n2h_host_bp_cfg_pvt.sem); - return NSS_FAILURE; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_n2h_host_bp_cfg_pvt.complete, msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: Waiting for ack timed out\n", nss_ctx); - up(&nss_n2h_host_bp_cfg_pvt.sem); - return NSS_FAILURE; - } - - /* - * Response received from NSS FW - */ - if (nss_n2h_host_bp_cfg_pvt.response == NSS_FAILURE) { - up(&nss_n2h_host_bp_cfg_pvt.sem); - return NSS_FAILURE; - } - - up(&nss_n2h_host_bp_cfg_pvt.sem); - return NSS_SUCCESS; -} - -/* - * nss_n2h_host_bp_cfg_handler() - * Enable n2h back pressure. - */ -static int nss_n2h_host_bp_cfg_handler(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *ppos, uint32_t core_id) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[core_id]; - int ret, ret_bp, current_state; - current_state = nss_n2h_host_bp_config[core_id]; - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - if (ret != NSS_SUCCESS) { - return ret; - } - - if (!write) { - return ret; - } - - if ((nss_n2h_host_bp_config[core_id] != 0) && (nss_n2h_host_bp_config[core_id] != 1)) { - nss_info_always("Invalid input value. Valid values are 0 and 1\n"); - nss_n2h_host_bp_config[core_id] = current_state; - return ret; - } - - nss_info("Configuring n2h back pressure\n"); - ret_bp = nss_n2h_host_bp_cfg_sync(nss_ctx, nss_n2h_host_bp_config[core_id]); - - if (ret_bp != NSS_SUCCESS) { - nss_warning("%px: n2h back pressure config failed\n", nss_ctx); - nss_n2h_host_bp_config[core_id] = current_state; - } - - return ret_bp; -} - -/* - * nss_n2h_host_bp_cfg_core0_handler() - * Enable n2h back pressure in core 0. - */ -static int nss_n2h_host_bp_cfg_core0_handler(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - return nss_n2h_host_bp_cfg_handler(ctl, write, buffer, lenp, ppos, NSS_CORE_0); -} - -/* - * nss_n2h_host_bp_cfg_core1_handler() - * Enable n2h back pressure in core 1. - */ -static int nss_n2h_host_bp_cfg_core1_handler(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - return nss_n2h_host_bp_cfg_handler(ctl, write, buffer, lenp, ppos, NSS_CORE_1); -} - -static struct ctl_table nss_n2h_table_single_core[] = { - { - .procname = "n2h_empty_pool_buf_core0", - .data = &nss_n2h_empty_pool_buf_cfg[NSS_CORE_0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_empty_pool_buf_cfg_core0_handler, - }, - { - .procname = "n2h_empty_paged_pool_buf_core0", - .data = &nss_n2h_empty_paged_pool_buf_cfg[NSS_CORE_0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_empty_paged_pool_buf_cfg_core0_handler, - }, - { - .procname = "n2h_low_water_core0", - .data = &nss_n2h_water_mark[NSS_CORE_0][0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_water_mark_core0_handler, - }, - { - .procname = "n2h_high_water_core0", - .data = &nss_n2h_water_mark[NSS_CORE_0][1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_water_mark_core0_handler, - }, - { - .procname = "n2h_paged_low_water_core0", - .data = &nss_n2h_paged_water_mark[NSS_CORE_0][0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_paged_water_mark_core0_handler, - }, - { - .procname = "n2h_paged_high_water_core0", - .data = &nss_n2h_paged_water_mark[NSS_CORE_0][1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_paged_water_mark_core0_handler, - }, - { - .procname = "n2h_wifi_pool_buf", - .data = &nss_n2h_wifi_pool_buf_cfg, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_wifi_payloads_handler, - }, - { - .procname = "mitigation_core0", - .data = &nss_n2h_core0_mitigation_cfg, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_mitigationcfg_core0_handler, - }, - { - .procname = "extra_pbuf_core0", - .data = &nss_n2h_core0_add_buf_pool_size, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_buf_cfg_core0_handler, - }, - { - .procname = "n2h_queue_limit_core0", - .data = &nss_n2h_queue_limit[NSS_CORE_0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_queue_limit_core0_handler, - }, - { - .procname = "host_bp_enable0", - .data = &nss_n2h_host_bp_config[NSS_CORE_0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_host_bp_cfg_core0_handler, - }, - - { } -}; - -static struct ctl_table nss_n2h_table_multi_core[] = { - { - .procname = "n2h_empty_pool_buf_core0", - .data = &nss_n2h_empty_pool_buf_cfg[NSS_CORE_0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_empty_pool_buf_cfg_core0_handler, - }, - { - .procname = "n2h_empty_pool_buf_core1", - .data = &nss_n2h_empty_pool_buf_cfg[NSS_CORE_1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_empty_pool_buf_cfg_core1_handler, - }, - { - .procname = "n2h_empty_paged_pool_buf_core0", - .data = &nss_n2h_empty_paged_pool_buf_cfg[NSS_CORE_0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_empty_paged_pool_buf_cfg_core0_handler, - }, - { - .procname = "n2h_empty_paged_pool_buf_core1", - .data = &nss_n2h_empty_paged_pool_buf_cfg[NSS_CORE_1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_empty_paged_pool_buf_cfg_core1_handler, - }, - - { - .procname = "n2h_low_water_core0", - .data = &nss_n2h_water_mark[NSS_CORE_0][0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_water_mark_core0_handler, - }, - { - .procname = "n2h_low_water_core1", - .data = &nss_n2h_water_mark[NSS_CORE_1][0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_water_mark_core1_handler, - }, - { - .procname = "n2h_high_water_core0", - .data = &nss_n2h_water_mark[NSS_CORE_0][1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_water_mark_core0_handler, - }, - { - .procname = "n2h_high_water_core1", - .data = &nss_n2h_water_mark[NSS_CORE_1][1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_water_mark_core1_handler, - }, - { - .procname = "n2h_paged_low_water_core0", - .data = &nss_n2h_paged_water_mark[NSS_CORE_0][0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_paged_water_mark_core0_handler, - }, - { - .procname = "n2h_paged_low_water_core1", - .data = &nss_n2h_paged_water_mark[NSS_CORE_1][0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_paged_water_mark_core1_handler, - }, - { - .procname = "n2h_paged_high_water_core0", - .data = &nss_n2h_paged_water_mark[NSS_CORE_0][1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_paged_water_mark_core0_handler, - }, - { - .procname = "n2h_paged_high_water_core1", - .data = &nss_n2h_paged_water_mark[NSS_CORE_1][1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_paged_water_mark_core1_handler, - }, - { - .procname = "n2h_wifi_pool_buf", - .data = &nss_n2h_wifi_pool_buf_cfg, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_wifi_payloads_handler, - }, - { - .procname = "mitigation_core0", - .data = &nss_n2h_core0_mitigation_cfg, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_mitigationcfg_core0_handler, - }, - { - .procname = "mitigation_core1", - .data = &nss_n2h_core1_mitigation_cfg, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_mitigationcfg_core1_handler, - }, - { - .procname = "extra_pbuf_core0", - .data = &nss_n2h_core0_add_buf_pool_size, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_buf_cfg_core0_handler, - }, - { - .procname = "extra_pbuf_core1", - .data = &nss_n2h_core1_add_buf_pool_size, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_buf_cfg_core1_handler, - }, - { - .procname = "n2h_queue_limit_core0", - .data = &nss_n2h_queue_limit[NSS_CORE_0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_queue_limit_core0_handler, - }, - { - .procname = "n2h_queue_limit_core1", - .data = &nss_n2h_queue_limit[NSS_CORE_1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_queue_limit_core1_handler, - }, - { - .procname = "host_bp_enable0", - .data = &nss_n2h_host_bp_config[NSS_CORE_0], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_host_bp_cfg_core0_handler, - }, - { - .procname = "host_bp_enable1", - .data = &nss_n2h_host_bp_config[NSS_CORE_1], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_n2h_host_bp_cfg_core1_handler, - }, - { } -}; - -/* - * This table will be overwritten during single-core registration - */ -static struct ctl_table nss_n2h_dir[] = { - { - .procname = "n2hcfg", - .mode = 0555, - .child = nss_n2h_table_multi_core, - }, - { } -}; - -static struct ctl_table nss_n2h_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_n2h_dir, - }, - { } -}; - -static struct ctl_table nss_n2h_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_n2h_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_n2h_header; - -/* - * nss_n2h_cfg_empty_pool_size() - * Config empty buffer pool - */ -nss_tx_status_t nss_n2h_cfg_empty_pool_size(struct nss_ctx_instance *nss_ctx, uint32_t pool_sz) -{ - struct nss_n2h_msg nnm; - struct nss_n2h_empty_pool_buf *nnepbcm; - nss_tx_status_t nss_tx_status; - - if (pool_sz < NSS_N2H_MIN_EMPTY_POOL_BUF_SZ) { - nss_warning("%px: setting pool size %d < min number of buffer", - nss_ctx, pool_sz); - return NSS_TX_FAILURE; - } - - if (pool_sz > NSS_N2H_MAX_EMPTY_POOL_BUF_SZ) { - nss_warning("%px: setting pool size %d > max number of buffer", - nss_ctx, pool_sz); - return NSS_TX_FAILURE; - } - - nss_info("%px: update number of empty buffer pool size: %d\n", - nss_ctx, pool_sz); - - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_EMPTY_POOL_BUF_CFG, - sizeof(struct nss_n2h_empty_pool_buf), NULL, 0); - - nnepbcm = &nnm.msg.empty_pool_buf_cfg; - nnepbcm->pool_size = htonl(pool_sz); - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error empty buffer pool: %d\n", nss_ctx, pool_sz); - return nss_tx_status; - } - - return nss_tx_status; -} - -/* - * nss_n2h_paged_buf_pool_init() - * Sends a command down to NSS to initialize paged buffer pool - */ -nss_tx_status_t nss_n2h_paged_buf_pool_init(struct nss_ctx_instance *nss_ctx) -{ - struct nss_n2h_msg nnm; - nss_tx_status_t nss_tx_status; - - /* - * No additional information needed at this point - */ - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_PAGED_BUFFER_POOL_INIT, - sizeof(struct nss_n2h_paged_buffer_pool_init), - NULL, - NULL); - - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: failed to send paged buf configuration init command to NSS\n", - nss_ctx); - return NSS_TX_FAILURE; - } - - return NSS_TX_SUCCESS; -} - -/* - * nss_n2h_flush_payloads() - * Sends a command down to NSS for flushing all payloads - */ -nss_tx_status_t nss_n2h_flush_payloads(struct nss_ctx_instance *nss_ctx) -{ - struct nss_n2h_msg nnm; - struct nss_n2h_flush_payloads *nnflshpl; - nss_tx_status_t nss_tx_status; - - nnflshpl = &nnm.msg.flush_payloads; - - /* - * TODO: No additional information sent in message - * as of now. Need to initialize message content accordingly - * if needed. - */ - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, - NSS_TX_METADATA_TYPE_N2H_FLUSH_PAYLOADS, - sizeof(struct nss_n2h_flush_payloads), - NULL, - NULL); - - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: failed to send flush payloads command to NSS\n", - nss_ctx); - - return NSS_TX_FAILURE; - } - - return NSS_TX_SUCCESS; -} - -/* - * nss_n2h_msg_init() - * Initialize n2h message. - */ -void nss_n2h_msg_init(struct nss_n2h_msg *nim, uint16_t if_num, uint32_t type, - uint32_t len, nss_n2h_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nim->cm, if_num, type, len, (void *)cb, app_data); -} - -/* - * nss_n2h_tx_msg() - * Send messages to NSS n2h package. - */ -nss_tx_status_t nss_n2h_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_n2h_msg *nnm) -{ - struct nss_cmn_msg *ncm = &nnm->cm; - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_N2H_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_METADATA_TYPE_N2H_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, nnm, sizeof(*nnm), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_n2h_notify_register() - * Register to received N2H events. - * - * NOTE: Do we want to pass an nss_ctx here so that we can register for n2h on any core? - */ -struct nss_ctx_instance *nss_n2h_notify_register(int core, nss_n2h_msg_callback_t cb, void *app_data) -{ - if (core >= nss_top_main.num_nss) { - nss_warning("Input core number %d is wrong \n", core); - return NULL; - } - /* - * TODO: We need to have a new array in support of the new API - * TODO: If we use a per-context array, we would move the array into nss_ctx based. - */ - nss_n2h_rd[core].n2h_callback = cb; - nss_n2h_rd[core].app_data = app_data; - return &nss_top_main.nss[core]; -} - -/* - * nss_n2h_register_handler() - */ -void nss_n2h_register_handler(struct nss_ctx_instance *nss_ctx) -{ - sema_init(&nss_n2h_q_cfg_pvt.sem, 1); - init_completion(&nss_n2h_q_cfg_pvt.complete); - - nss_core_register_handler(nss_ctx, NSS_N2H_INTERFACE, nss_n2h_interface_handler, NULL); - - if (nss_ctx->id == NSS_CORE_0) { - nss_n2h_stats_dentry_create(); - } - nss_n2h_strings_dentry_create(); - - nss_drv_strings_dentry_create(); -} - -/* - * nss_n2h_single_core_register_sysctl() - */ -void nss_n2h_single_core_register_sysctl(void) -{ - /* - * RPS sema init - */ - sema_init(&nss_n2h_rcp.sem, 1); - init_completion(&nss_n2h_rcp.complete); - - /* - * MITIGATION sema init for core0 - */ - sema_init(&nss_n2h_mitigationcp[NSS_CORE_0].sem, 1); - init_completion(&nss_n2h_mitigationcp[NSS_CORE_0].complete); - - /* - * PBUF addition sema init for core0 - */ - sema_init(&nss_n2h_bufcp[NSS_CORE_0].sem, 1); - init_completion(&nss_n2h_bufcp[NSS_CORE_0].complete); - - /* - * Core0 - */ - sema_init(&nss_n2h_nepbcfgp[NSS_CORE_0].sem, 1); - init_completion(&nss_n2h_nepbcfgp[NSS_CORE_0].complete); - nss_n2h_nepbcfgp[NSS_CORE_0].empty_buf_pool_info.pool_size = - nss_n2h_empty_pool_buf_cfg[NSS_CORE_0]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_buf_pool_info.low_water = - nss_n2h_water_mark[NSS_CORE_0][0]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_buf_pool_info.high_water = - nss_n2h_water_mark[NSS_CORE_0][1]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_paged_buf_pool_info.pool_size = - nss_n2h_empty_paged_pool_buf_cfg[NSS_CORE_0]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_paged_buf_pool_info.low_water = - nss_n2h_paged_water_mark[NSS_CORE_0][0]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_paged_buf_pool_info.high_water = - nss_n2h_paged_water_mark[NSS_CORE_0][1]; - - /* - * WiFi pool buf cfg sema init - */ - sema_init(&nss_n2h_wp.sem, 1); - init_completion(&nss_n2h_wp.complete); - - /* - * N2H queue config sema init - */ - sema_init(&nss_n2h_q_lim_pvt.sem, 1); - init_completion(&nss_n2h_q_lim_pvt.complete); - - /* - * Back pressure config sema init - */ - sema_init(&nss_n2h_host_bp_cfg_pvt.sem, 1); - init_completion(&nss_n2h_host_bp_cfg_pvt.complete); - - nss_n2h_notify_register(NSS_CORE_0, NULL, NULL); - - /* - * Register sysctl table. - */ - nss_n2h_dir[0].child = nss_n2h_table_single_core; - nss_n2h_header = register_sysctl_table(nss_n2h_root); -} - -/* - * nss_n2h_multi_core_register_sysctl() - */ -void nss_n2h_multi_core_register_sysctl(void) -{ - /* - * RPS sema init - */ - sema_init(&nss_n2h_rcp.sem, 1); - init_completion(&nss_n2h_rcp.complete); - - /* - * MITIGATION sema init for core0 - */ - sema_init(&nss_n2h_mitigationcp[NSS_CORE_0].sem, 1); - init_completion(&nss_n2h_mitigationcp[NSS_CORE_0].complete); - - /* - * MITIGATION sema init for core1 - */ - sema_init(&nss_n2h_mitigationcp[NSS_CORE_1].sem, 1); - init_completion(&nss_n2h_mitigationcp[NSS_CORE_1].complete); - - /* - * PBUF addition sema init for core0 - */ - sema_init(&nss_n2h_bufcp[NSS_CORE_0].sem, 1); - init_completion(&nss_n2h_bufcp[NSS_CORE_0].complete); - - /* - * PBUF addition sema init for core1 - */ - sema_init(&nss_n2h_bufcp[NSS_CORE_1].sem, 1); - init_completion(&nss_n2h_bufcp[NSS_CORE_1].complete); - - /* - * Core0 - */ - sema_init(&nss_n2h_nepbcfgp[NSS_CORE_0].sem, 1); - init_completion(&nss_n2h_nepbcfgp[NSS_CORE_0].complete); - nss_n2h_nepbcfgp[NSS_CORE_0].empty_buf_pool_info.pool_size = - nss_n2h_empty_pool_buf_cfg[NSS_CORE_0]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_buf_pool_info.low_water = - nss_n2h_water_mark[NSS_CORE_0][0]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_buf_pool_info.high_water = - nss_n2h_water_mark[NSS_CORE_0][1]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_paged_buf_pool_info.pool_size = - nss_n2h_empty_paged_pool_buf_cfg[NSS_CORE_0]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_paged_buf_pool_info.low_water = - nss_n2h_paged_water_mark[NSS_CORE_0][0]; - nss_n2h_nepbcfgp[NSS_CORE_0].empty_paged_buf_pool_info.high_water = - nss_n2h_paged_water_mark[NSS_CORE_0][1]; - - /* - * Core1 - */ - sema_init(&nss_n2h_nepbcfgp[NSS_CORE_1].sem, 1); - init_completion(&nss_n2h_nepbcfgp[NSS_CORE_1].complete); - nss_n2h_nepbcfgp[NSS_CORE_1].empty_buf_pool_info.pool_size = - nss_n2h_empty_pool_buf_cfg[NSS_CORE_1]; - nss_n2h_nepbcfgp[NSS_CORE_1].empty_buf_pool_info.low_water = - nss_n2h_water_mark[NSS_CORE_1][0]; - nss_n2h_nepbcfgp[NSS_CORE_1].empty_buf_pool_info.high_water = - nss_n2h_water_mark[NSS_CORE_1][1]; - nss_n2h_nepbcfgp[NSS_CORE_1].empty_paged_buf_pool_info.pool_size = - nss_n2h_empty_paged_pool_buf_cfg[NSS_CORE_1]; - nss_n2h_nepbcfgp[NSS_CORE_1].empty_paged_buf_pool_info.low_water = - nss_n2h_paged_water_mark[NSS_CORE_1][0]; - nss_n2h_nepbcfgp[NSS_CORE_1].empty_paged_buf_pool_info.high_water = - nss_n2h_paged_water_mark[NSS_CORE_1][1]; - - /* - * WiFi pool buf cfg sema init - */ - sema_init(&nss_n2h_wp.sem, 1); - init_completion(&nss_n2h_wp.complete); - - /* - * N2H queue config sema init - */ - sema_init(&nss_n2h_q_lim_pvt.sem, 1); - init_completion(&nss_n2h_q_lim_pvt.complete); - - /* - * Back pressure config sema init - */ - sema_init(&nss_n2h_host_bp_cfg_pvt.sem, 1); - init_completion(&nss_n2h_host_bp_cfg_pvt.complete); - - nss_n2h_notify_register(NSS_CORE_0, NULL, NULL); - nss_n2h_notify_register(NSS_CORE_1, NULL, NULL); - - /* - * Register sysctl table. - */ - nss_n2h_header = register_sysctl_table(nss_n2h_root); -} - -/* - * nss_n2h_unregister_sysctl() - * Unregister sysctl specific to n2h - */ -void nss_n2h_unregister_sysctl(void) -{ - /* - * Unregister sysctl table. - */ - if (nss_n2h_header) { - unregister_sysctl_table(nss_n2h_header); - } -} - -EXPORT_SYMBOL(nss_n2h_notify_register); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_n2h_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_n2h_stats.c deleted file mode 100644 index 60ff88ba9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_n2h_stats.c +++ /dev/null @@ -1,214 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_n2h_stats.h" -#include "nss_n2h.h" -#include "nss_n2h_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_n2h_stats_notifier); - -uint64_t nss_n2h_stats[NSS_MAX_CORES][NSS_N2H_STATS_MAX]; - -/* - * nss_n2h_stats_read() - * Read N2H stats - */ -static ssize_t nss_n2h_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i, core; - - /* - * Max output lines = #stats + few blank lines for banner printing + - * Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = (NSS_N2H_STATS_MAX + 3) * NSS_MAX_CORES + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_N2H_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - /* - * N2H node stats - */ - for (core = 0; core < nss_top_main.num_nss; core++) { - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_N2H_STATS_MAX; i++) { - stats_shadow[i] = nss_n2h_stats[core][i]; - } - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "n2h", core); - size_wr += nss_stats_print("n2h", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_n2h_strings_stats - , stats_shadow - , NSS_N2H_STATS_MAX - , lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_n2h_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(n2h); - -/* - * nss_n2h_stats_dentry_create() - * Create N2H statistics debug entry. - */ -void nss_n2h_stats_dentry_create(void) -{ - nss_stats_create_dentry("n2h", &nss_n2h_stats_ops); -} - -/* - * nss_n2h_stats_sync() - * Handle the syncing of NSS statistics. - */ -void nss_n2h_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_n2h_stats_sync *nnss) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - int id = nss_ctx->id; - int j; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * common node stats - */ - nss_n2h_stats[id][NSS_STATS_NODE_RX_PKTS] += nnss->node_stats.rx_packets; - nss_n2h_stats[id][NSS_STATS_NODE_RX_BYTES] += nnss->node_stats.rx_bytes; - nss_n2h_stats[id][NSS_STATS_NODE_TX_PKTS] += nnss->node_stats.tx_packets; - nss_n2h_stats[id][NSS_STATS_NODE_TX_BYTES] += nnss->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_n2h_stats[id][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nnss->node_stats.rx_dropped[j]; - } - - /* - * General N2H stats - */ - nss_n2h_stats[id][NSS_N2H_STATS_QUEUE_DROPPED] += nnss->queue_dropped; - nss_n2h_stats[id][NSS_N2H_STATS_TOTAL_TICKS] += nnss->total_ticks; - nss_n2h_stats[id][NSS_N2H_STATS_WORST_CASE_TICKS] += nnss->worst_case_ticks; - nss_n2h_stats[id][NSS_N2H_STATS_ITERATIONS] += nnss->iterations; - - /* - * pbuf manager ocm and default pool stats - */ - nss_n2h_stats[id][NSS_N2H_STATS_PBUF_OCM_ALLOC_FAILS_WITH_PAYLOAD] += nnss->pbuf_ocm_stats.pbuf_alloc_fails_with_payload; - nss_n2h_stats[id][NSS_N2H_STATS_PBUF_OCM_FREE_COUNT] = nnss->pbuf_ocm_stats.pbuf_free_count; - nss_n2h_stats[id][NSS_N2H_STATS_PBUF_OCM_TOTAL_COUNT] = nnss->pbuf_ocm_stats.pbuf_total_count; - nss_n2h_stats[id][NSS_N2H_STATS_PBUF_OCM_ALLOC_FAILS_NO_PAYLOAD] += nnss->pbuf_ocm_stats.pbuf_alloc_fails_no_payload; - - nss_n2h_stats[id][NSS_N2H_STATS_PBUF_DEFAULT_ALLOC_FAILS_WITH_PAYLOAD] += nnss->pbuf_default_stats.pbuf_alloc_fails_with_payload; - nss_n2h_stats[id][NSS_N2H_STATS_PBUF_DEFAULT_FREE_COUNT] = nnss->pbuf_default_stats.pbuf_free_count; - nss_n2h_stats[id][NSS_N2H_STATS_PBUF_DEFAULT_TOTAL_COUNT] = nnss->pbuf_default_stats.pbuf_total_count; - nss_n2h_stats[id][NSS_N2H_STATS_PBUF_DEFAULT_ALLOC_FAILS_NO_PAYLOAD] += nnss->pbuf_default_stats.pbuf_alloc_fails_no_payload; - - /* - * payload mgr stats - */ - nss_n2h_stats[id][NSS_N2H_STATS_PAYLOAD_ALLOC_FAILS] += nnss->payload_alloc_fails; - nss_n2h_stats[id][NSS_N2H_STATS_PAYLOAD_FREE_COUNT] = nnss->payload_free_count; - - /* - * Host <=> NSS control traffic stats - */ - nss_n2h_stats[id][NSS_N2H_STATS_H2N_CONTROL_PACKETS] += nnss->h2n_ctrl_pkts; - nss_n2h_stats[id][NSS_N2H_STATS_H2N_CONTROL_BYTES] += nnss->h2n_ctrl_bytes; - nss_n2h_stats[id][NSS_N2H_STATS_N2H_CONTROL_PACKETS] += nnss->n2h_ctrl_pkts; - nss_n2h_stats[id][NSS_N2H_STATS_N2H_CONTROL_BYTES] += nnss->n2h_ctrl_bytes; - - /* - * Host <=> NSS control data traffic stats - */ - nss_n2h_stats[id][NSS_N2H_STATS_H2N_DATA_PACKETS] += nnss->h2n_data_pkts; - nss_n2h_stats[id][NSS_N2H_STATS_H2N_DATA_BYTES] += nnss->h2n_data_bytes; - nss_n2h_stats[id][NSS_N2H_STATS_N2H_DATA_PACKETS] += nnss->n2h_data_pkts; - nss_n2h_stats[id][NSS_N2H_STATS_N2H_DATA_BYTES] += nnss->n2h_data_bytes; - - /* - * Payloads related stats - */ - nss_n2h_stats[id][NSS_N2H_STATS_N2H_TOT_PAYLOADS] = nnss->tot_payloads; - - nss_n2h_stats[id][NSS_N2H_STATS_N2H_INTERFACE_INVALID] += nnss->data_interface_invalid; - nss_n2h_stats[id][NSS_N2H_STATS_ENQUEUE_RETRIES] += nnss->enqueue_retries; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_n2h_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_n2h_stats_notify(struct nss_ctx_instance *nss_ctx) -{ - int i; - struct nss_n2h_stats_notification stats; - - for (i = 0; (i < NSS_STATS_DRV_MAX); i++) { - stats.drv_stats[i] = NSS_PKT_STATS_READ(&nss_top_main.stats_drv[i]); - } - - stats.core_id = nss_ctx->id; - memcpy(stats.n2h_stats, nss_n2h_stats[stats.core_id], sizeof(stats.n2h_stats)); - atomic_notifier_call_chain(&nss_n2h_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&stats); -} - -/* - * nss_n2h_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_n2h_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_n2h_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_n2h_stats_register_notifier); - -/* - * nss_n2h_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_n2h_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_n2h_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_n2h_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_n2h_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_n2h_stats.h deleted file mode 100644 index 96d065eb1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_n2h_stats.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017,2019-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_N2H_STATS_H -#define __NSS_N2H_STATS_H - -/* - * N2H statistics APIs - */ -extern void nss_n2h_stats_notify(struct nss_ctx_instance *nss_ctx); -extern void nss_n2h_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_n2h_stats_sync *nnss); -extern void nss_n2h_stats_dentry_create(void); - -#endif /* __NSS_N2H_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_n2h_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_n2h_strings.c deleted file mode 100644 index c4c2ce525..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_n2h_strings.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_n2h_strings_stats - * N2H statistics strings. - */ -struct nss_stats_info nss_n2h_strings_stats[NSS_N2H_STATS_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_byts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_byts" , NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops" , NSS_STATS_TYPE_DROP}, - {"queue_drops" , NSS_STATS_TYPE_DROP}, - {"ticks" , NSS_STATS_TYPE_SPECIAL}, - {"worst_ticks" , NSS_STATS_TYPE_SPECIAL}, - {"iterations" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_ocm_total_count" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_ocm_free_count" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_ocm_alloc_fail_payload" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_ocm_alloc_fail_nopayload", NSS_STATS_TYPE_SPECIAL}, - {"pbuf_def_total_count" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_def_free_count" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_def_alloc_fail_payload" , NSS_STATS_TYPE_SPECIAL}, - {"pbuf_def_alloc_fail_nopayload", NSS_STATS_TYPE_SPECIAL}, - {"payload_alloc_fails" , NSS_STATS_TYPE_SPECIAL}, - {"payload_free_count" , NSS_STATS_TYPE_SPECIAL}, - {"h2n_control_pkts" , NSS_STATS_TYPE_SPECIAL}, - {"h2n_control_byts" , NSS_STATS_TYPE_SPECIAL}, - {"n2h_control_pkts" , NSS_STATS_TYPE_SPECIAL}, - {"n2h_control_byts" , NSS_STATS_TYPE_SPECIAL}, - {"h2n_data_pkts" , NSS_STATS_TYPE_SPECIAL}, - {"h2n_data_byts" , NSS_STATS_TYPE_SPECIAL}, - {"n2h_data_pkts" , NSS_STATS_TYPE_SPECIAL}, - {"n2h_data_byts" , NSS_STATS_TYPE_SPECIAL}, - {"n2h_tot_payloads" , NSS_STATS_TYPE_SPECIAL}, - {"n2h_data_interface_invalid" , NSS_STATS_TYPE_SPECIAL}, - {"n2h_enqueue_retries" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_n2h_strings_read() - * Read N2H node statistics names. - */ -static ssize_t nss_n2h_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_n2h_strings_stats, NSS_N2H_STATS_MAX); -} - -/* - * nss_n2h_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(n2h); - -/* - * nss_n2h_strings_dentry_create() - * Create N2H statistics strings debug entry. - */ -void nss_n2h_strings_dentry_create(void) -{ - nss_strings_create_dentry("n2h", &nss_n2h_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_n2h_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_n2h_strings.h deleted file mode 100644 index 5d8c2131c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_n2h_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_N2H_STRINGS_H -#define __NSS_N2H_STRINGS_H - -extern struct nss_stats_info nss_n2h_strings_stats[NSS_N2H_STATS_MAX]; -extern void nss_n2h_strings_dentry_create(void); - -#endif /* __NSS_N2H_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_oam.c b/feeds/ipq807x/qca-nss-drv/src/nss_oam.c deleted file mode 100644 index baf43d352..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_oam.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2018, 2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_oam.c - * OAM - Operations, Administration and Maintenance Service for NSS - * - * This adapter module is responsible for sending and - * receiving to and from NSS FW - * This file contains the API for communicating NSS FW to send/receive - * commands OAM commands. - */ - -#include "nss_tx_rx_common.h" -#include "nss_oam_log.h" - -/* - * nss_oam_rx_msg_handler() - * Message handler for OAM messages from NSS - */ -static void nss_oam_rx_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused)) void *app_data) -{ - struct nss_oam_msg *nom = (struct nss_oam_msg *)ncm; - nss_oam_msg_callback_t cb; - - /* - * Trace Messages - */ - nss_oam_log_rx_msg(nom); - - /* - * Sanity check the message type - */ - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_oam_msg)) { - nss_warning("%px: recevied with invalid msg size: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - if (ncm->type > NSS_OAM_MSG_TYPE_MAX) { - nss_warning("%px: received with invalid resp type: %d", nss_ctx, ncm->type); - return; - } - - /* - * Log the failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_top_main.oam_callback; - ncm->app_data = (nss_ptr_t)nss_top_main.oam_ctx; - } - - cb = (nss_oam_msg_callback_t)ncm->cb; - if (unlikely(!cb)) { - nss_trace("%px: rx handler has been unregistered for i/f: %d", nss_ctx, ncm->interface); - return; - } - cb((void *)ncm->app_data, nom); -} - -/* - * nss_oam_tx() - * Transmit an oam message to the FW. - */ -nss_tx_status_t nss_oam_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_oam_msg *nom) -{ - struct nss_cmn_msg *ncm = &nom->cm; - - /* - * Trace Messages - */ - nss_oam_log_tx_msg(nom); - - if (ncm->type > NSS_OAM_MSG_TYPE_MAX) { - nss_warning("%px: CMD type for oam module is invalid - %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ncm->interface != NSS_OAM_INTERFACE) { - nss_warning("%px: tx message request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, nom, sizeof(*nom), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_oam_tx_msg); - -/* - * nss_oam_notify_register() - * Register to receive OAM events. - */ -struct nss_ctx_instance *nss_oam_notify_register(nss_oam_msg_callback_t cb, void *app_data) -{ - if (nss_top_main.oam_ctx || nss_top_main.oam_callback) { - nss_warning("Failed to register notify callback - already registered\n"); - return NULL; - } - - nss_top_main.oam_ctx = app_data; - nss_top_main.oam_callback = cb; - return &nss_top_main.nss[nss_top_main.oam_handler_id]; -} -EXPORT_SYMBOL(nss_oam_notify_register); - -/* - * nss_oam_notify_unregister() - * Unregister to received OAM events. - */ -void nss_oam_notify_unregister(void) -{ - nss_top_main.oam_callback = NULL; - nss_top_main.oam_ctx = NULL; -} -EXPORT_SYMBOL(nss_oam_notify_unregister); - -/* - * nss_register_oam_handler() - * Register our handler to receive messages for this interface - */ -void nss_oam_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.oam_handler_id]; - - if (nss_core_register_handler(nss_ctx, NSS_OAM_INTERFACE, nss_oam_rx_msg_handler, NULL) != NSS_CORE_STATUS_SUCCESS) { - nss_warning("OAM handler failed to register"); - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_oam_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_oam_log.c deleted file mode 100644 index 08ffec483..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_oam_log.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_oam_log.c - * NSS OAM logger file. - */ - -#include "nss_core.h" - -/* - * nss_oam_log_message_types_str - * NSS OAM message strings - */ -static int8_t *nss_oam_log_message_types_str[NSS_OAM_MSG_TYPE_MAX] __maybe_unused = { - "OAM Message None", - "OAM Get FW Version", -}; - -/* - * nss_oam_log_get_fw_version_msg() - * Log NSS OAM GET FW Version. - */ -static void nss_oam_log_get_fw_version_msg(struct nss_oam_msg *nom) -{ - struct nss_oam_fw_ver *nofm __maybe_unused = &nom->msg.fw_ver; - nss_trace("%px: NSS OAM Get FW Version message \n" - "OAM FW Version: %px\n", - nofm, nofm->string); -} - -/* - * nss_oam_log_verbose() - * Log message contents. - */ -static void nss_oam_log_verbose(struct nss_oam_msg *nom) -{ - switch (nom->cm.type) { - case NSS_OAM_MSG_TYPE_GET_FW_VER: - nss_oam_log_get_fw_version_msg(nom); - break; - - default: - nss_trace("%px: Invalid message type\n", nom); - break; - } -} - -/* - * nss_oam_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_oam_log_tx_msg(struct nss_oam_msg *nom) -{ - if (nom->cm.type >= NSS_OAM_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", nom); - return; - } - - nss_info("%px: type[%d]:%s\n", nom, nom->cm.type, nss_oam_log_message_types_str[nom->cm.type]); - nss_oam_log_verbose(nom); -} - -/* - * nss_oam_log_rx_msg() - * Log messages received from FW. - */ -void nss_oam_log_rx_msg(struct nss_oam_msg *nom) -{ - if (nom->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nom); - return; - } - - if (nom->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nom->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nom, nom->cm.type, - nss_oam_log_message_types_str[nom->cm.type], - nom->cm.response, nss_cmn_response_str[nom->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - nom, nom->cm.type, nss_oam_log_message_types_str[nom->cm.type], - nom->cm.response, nss_cmn_response_str[nom->cm.response]); - -verbose: - nss_oam_log_verbose(nom); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_oam_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_oam_log.h deleted file mode 100644 index b02611ba2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_oam_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_OAM_LOG_H -#define __NSS_OAM_LOG_H - -/* - * nss_oam.h - * NSS OAM header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_oam_log_tx_msg - * Logs a oam message that is sent to the NSS firmware. - */ -void nss_oam_log_tx_msg(struct nss_oam_msg *nom); - -/* - * nss_oam_log_rx_msg - * Logs a oam message that is received from the NSS firmware. - */ -void nss_oam_log_rx_msg(struct nss_oam_msg *nom); - -#endif /* __NSS_OAM_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_phys_if.c b/feeds/ipq807x/qca-nss-drv/src/nss_phys_if.c deleted file mode 100644 index 4e5811a3e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_phys_if.c +++ /dev/null @@ -1,629 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_phy_if.c - * NSS physical interface functions - */ - -#include "nss_tx_rx_common.h" -#include "nss_tstamp.h" -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) -#include -#endif - -#define NSS_PHYS_IF_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * NSS phys_if modes - */ -#define NSS_PHYS_IF_MODE0 0 /* phys_if mode 0 */ -#define NSS_PHYS_IF_MODE1 1 /* phys_if mode 1 */ -#define NSS_PHYS_IF_MODE2 2 /* phys_if mode 2 */ - -/* - * Private data structure for phys_if interface - */ -static struct nss_phys_if_pvt { - struct semaphore sem; - struct completion complete; - int response; -} phif; - -static int nss_phys_if_sem_init_done; - -/* - * nss_phys_if_update_driver_stats() - * Snoop the extended message and update driver statistics. - */ -static void nss_phys_if_update_driver_stats(struct nss_ctx_instance *nss_ctx, uint32_t id, struct nss_phys_if_stats *stats) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - uint64_t *top_stats = &(nss_top->stats_gmac[id][0]); - - spin_lock_bh(&nss_top->stats_lock); - top_stats[NSS_GMAC_STATS_TOTAL_TICKS] += stats->estats.gmac_total_ticks; - if (unlikely(top_stats[NSS_GMAC_STATS_WORST_CASE_TICKS] < stats->estats.gmac_worst_case_ticks)) { - top_stats[NSS_GMAC_STATS_WORST_CASE_TICKS] = stats->estats.gmac_worst_case_ticks; - } - top_stats[NSS_GMAC_STATS_ITERATIONS] += stats->estats.gmac_iterations; - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_phys_if_msg_handler() - * Handle NSS -> HLOS messages for physical interface/gmacs - */ -static void nss_phys_if_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data) -{ - struct nss_phys_if_msg *nim = (struct nss_phys_if_msg *)ncm; - nss_phys_if_msg_callback_t cb; - - /* - * Sanity check the message type - */ - if (ncm->type > NSS_PHYS_IF_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return; - } - - if (!NSS_IS_IF_TYPE(PHYSICAL, ncm->interface)) { - nss_warning("%px: response for another interface: %d", nss_ctx, ncm->interface); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_phys_if_msg)) { - nss_warning("%px: message length too big: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Messages value that are within the base class are handled by the base class. - */ - if (ncm->type < NSS_IF_MAX_MSG_TYPES) { - return nss_if_msg_handler(nss_ctx, ncm, app_data); - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Snoop messages for local driver and handle deprecated interfaces. - */ - switch (nim->cm.type) { - case NSS_PHYS_IF_EXTENDED_STATS_SYNC: - /* - * To create the old API gmac statistics, we use the new extended GMAC stats. - */ - nss_phys_if_update_driver_stats(nss_ctx, ncm->interface, &nim->msg.stats); - nss_top_main.data_plane_ops->data_plane_stats_sync(&nim->msg.stats, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, IPv4 sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->phys_if_msg_callback[ncm->interface]; - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].ndev; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_phys_if_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nim); -} - -/* - * nss_phys_if_callback - * Callback to handle the completion of NSS ->HLOS messages. - */ -static void nss_phys_if_callback(void *app_data, struct nss_phys_if_msg *nim) -{ - if(nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("phys_if Error response %d\n", nim->cm.response); - phif.response = NSS_TX_FAILURE; - complete(&phif.complete); - return; - } - - phif.response = NSS_TX_SUCCESS; - complete(&phif.complete); -} - -/* - * nss_phys_if_buf() - * Send packet to physical interface owned by NSS - */ -nss_tx_status_t nss_phys_if_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - nss_trace("%px: Phys If Tx packet, id:%d, data=%px", nss_ctx, if_num, os_buf->data); - -#ifdef NSS_DRV_TSTAMP_ENABLE - /* - * If we need the packet to be timestamped by GMAC Hardware at Tx - * send the packet to tstamp NSS module - */ - if (unlikely(skb_shinfo(os_buf)->tx_flags & SKBTX_HW_TSTAMP)) { - /* try PHY Driver hook for transmit timestamping firstly */ -#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT) - nss_phy_tstamp_tx_buf(os_buf->dev, os_buf); -#endif - if (!(skb_shinfo(os_buf)->tx_flags & SKBTX_IN_PROGRESS)) - return nss_tstamp_tx_buf(nss_ctx, os_buf, if_num); - } -#endif - - return nss_core_send_packet(nss_ctx, os_buf, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} - -/* - * nss_phys_if_msg() - */ -nss_tx_status_t nss_phys_if_msg(struct nss_ctx_instance *nss_ctx, struct nss_phys_if_msg *nim) -{ - struct nss_cmn_msg *ncm = &nim->cm; - struct net_device *dev; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Sanity check the message - */ - if (!NSS_IS_IF_TYPE(PHYSICAL, ncm->interface)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_PHYS_IF_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - dev = nss_ctx->subsys_dp_register[ncm->interface].ndev; - if (!dev) { - nss_warning("%px: Unregister physical interface %d: no context", nss_ctx, ncm->interface); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return nss_core_send_cmd(nss_ctx, nim, sizeof(*nim), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_phys_if_tx_msg_sync() - * Send a message to physical interface & wait for the response. - */ -nss_tx_status_t nss_phys_if_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_phys_if_msg *nim) -{ - nss_tx_status_t status; - int ret = 0; - - down(&phif.sem); - - status = nss_phys_if_msg(nss_ctx, nim); - if(status != NSS_TX_SUCCESS) - { - nss_warning("%px: nss_phys_if_msg failed\n", nss_ctx); - up(&phif.sem); - return status; - } - - ret = wait_for_completion_timeout(&phif.complete, msecs_to_jiffies(NSS_PHYS_IF_TX_TIMEOUT)); - - if(!ret) - { - nss_warning("%px: phys_if tx failed due to timeout\n", nss_ctx); - phif.response = NSS_TX_FAILURE; - } - - status = phif.response; - up(&phif.sem); - - return status; -} - -/* - ********************************** - Register/Unregister/Miscellaneous APIs - ********************************** - */ - -/* - * nss_phys_if_register() - */ -struct nss_ctx_instance *nss_phys_if_register(uint32_t if_num, - nss_phys_if_rx_callback_t rx_callback, - nss_phys_if_msg_callback_t msg_callback, - struct net_device *netdev, - uint32_t features) -{ - uint8_t id = nss_top_main.phys_if_handler_id[if_num]; - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[id]; - - nss_assert(nss_ctx); - nss_assert(if_num <= NSS_MAX_PHYSICAL_INTERFACES); - - nss_core_register_subsys_dp(nss_ctx, if_num, rx_callback, NULL, NULL, netdev, features); - - nss_top_main.phys_if_msg_callback[if_num] = msg_callback; - - nss_ctx->phys_if_mtu[if_num] = ETH_DATA_LEN; - return nss_ctx; -} - -/* - * nss_phys_if_unregister() - */ -void nss_phys_if_unregister(uint32_t if_num) -{ - uint8_t id = nss_top_main.phys_if_handler_id[if_num]; - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[id]; - - nss_assert(nss_ctx); - nss_assert(if_num < NSS_MAX_PHYSICAL_INTERFACES); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.phys_if_msg_callback[if_num] = NULL; - - nss_top_main.nss[0].phys_if_mtu[if_num] = 0; - nss_top_main.nss[1].phys_if_mtu[if_num] = 0; -} - -/* - * nss_phys_if_register_handler() - */ -void nss_phys_if_register_handler(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - uint32_t ret; - - ret = nss_core_register_handler(nss_ctx, if_num, nss_phys_if_msg_handler, NULL); - - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("Message handler FAILED to be registered for interface %d", if_num); - return; - } - - if(!nss_phys_if_sem_init_done) { - sema_init(&phif.sem, 1); - init_completion(&phif.complete); - nss_phys_if_sem_init_done = 1; - } -} - -/* - * nss_phys_if_open() - * Send open command to physical interface - */ -nss_tx_status_t nss_phys_if_open(struct nss_ctx_instance *nss_ctx, uint32_t tx_desc_ring, uint32_t rx_desc_ring, uint32_t mode, uint32_t if_num, uint32_t bypass_nw_process) -{ - struct nss_phys_if_msg nim; - struct nss_if_open *nio; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_info("%px: Phys If Open, id:%d, TxDesc: %x, RxDesc: %x\n", nss_ctx, if_num, tx_desc_ring, rx_desc_ring); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_OPEN, - sizeof(struct nss_if_open), nss_phys_if_callback, NULL); - - nio = &nim.msg.if_msg.open; - nio->tx_desc_ring = tx_desc_ring; - nio->rx_desc_ring = rx_desc_ring; - - if (mode == NSS_PHYS_IF_MODE0) { - nio->rx_forward_if = NSS_ETH_RX_INTERFACE; - nio->alignment_mode = NSS_IF_DATA_ALIGN_2BYTE; - } else if (mode == NSS_PHYS_IF_MODE1) { - nio->rx_forward_if = NSS_SJACK_INTERFACE; - nio->alignment_mode = NSS_IF_DATA_ALIGN_4BYTE; - } else if (mode == NSS_PHYS_IF_MODE2) { - nio->rx_forward_if = NSS_PORTID_INTERFACE; - nio->alignment_mode = NSS_IF_DATA_ALIGN_2BYTE; - } else { - nss_info("%px: Phys If Open, unknown mode %d\n", nss_ctx, mode); - return NSS_TX_FAILURE; - } - - /* - * If Network processing in NSS is bypassed - * update next hop and alignment accordingly - */ - if (bypass_nw_process) { - nio->rx_forward_if = NSS_N2H_INTERFACE; - nio->alignment_mode = NSS_IF_DATA_ALIGN_2BYTE; - } - - return nss_phys_if_msg_sync(nss_ctx, &nim); -} - -/* - * nss_phys_if_close() - * Send close command to physical interface - */ -nss_tx_status_t nss_phys_if_close(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_phys_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_info("%px: Phys If Close, id:%d \n", nss_ctx, if_num); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_CLOSE, - sizeof(struct nss_if_close), nss_phys_if_callback, NULL); - - return nss_phys_if_msg_sync(nss_ctx, &nim); -} - -/* - * nss_phys_if_link_state() - * Send link state to physical interface - */ -nss_tx_status_t nss_phys_if_link_state(struct nss_ctx_instance *nss_ctx, uint32_t link_state, uint32_t if_num) -{ - struct nss_phys_if_msg nim; - struct nss_if_link_state_notify *nils; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_info("%px: Phys If Link State, id:%d, State: %x\n", nss_ctx, if_num, link_state); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_LINK_STATE_NOTIFY, - sizeof(struct nss_if_link_state_notify), nss_phys_if_callback, NULL); - - nils = &nim.msg.if_msg.link_state_notify; - nils->state = link_state; - return nss_phys_if_msg_sync(nss_ctx, &nim); -} - -/* - * nss_phys_if_mac_addr() - * Send a MAC address to physical interface - */ -nss_tx_status_t nss_phys_if_mac_addr(struct nss_ctx_instance *nss_ctx, uint8_t *addr, uint32_t if_num) -{ - struct nss_phys_if_msg nim; - struct nss_if_mac_address_set *nmas; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_info("%px: Phys If MAC Address, id:%d\n", nss_ctx, if_num); - nss_assert(addr != 0); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_MAC_ADDR_SET, - sizeof(struct nss_if_mac_address_set), nss_phys_if_callback, NULL); - - nmas = &nim.msg.if_msg.mac_address_set; - memcpy(nmas->mac_addr, addr, ETH_ALEN); - return nss_phys_if_msg_sync(nss_ctx, &nim); -} - -/* - * nss_phys_if_change_mtu() - * Send a MTU change command - */ -nss_tx_status_t nss_phys_if_change_mtu(struct nss_ctx_instance *nss_ctx, uint32_t mtu, uint32_t if_num) -{ - struct nss_phys_if_msg nim; - struct nss_if_mtu_change *nimc; - uint16_t mtu_sz, max_mtu; - int i; - nss_tx_status_t status; - -/* - * We disallow MTU changes for low memory profiles in order to keep the buffer size constant - */ -#ifdef NSS_FIXED_BUFFER_SIZE - if (mtu > ETH_DATA_LEN) { - nss_info_always("MTU change beyond 1500 restricted for low memory profile \n"); - return NSS_TX_FAILURE; - } -#endif - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_info("%px: Phys If Change MTU, id:%d, mtu=%d\n", nss_ctx, if_num, mtu); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_MTU_CHANGE, - sizeof(struct nss_if_mtu_change), nss_phys_if_callback, NULL); - - nimc = &nim.msg.if_msg.mtu_change; - nimc->min_buf_size = mtu; - - status = nss_phys_if_msg_sync(nss_ctx, &nim); - if (status != NSS_TX_SUCCESS) { - return status; - } - - /* - * Update the mtu and max_buf_size accordingly - */ - nss_ctx->phys_if_mtu[if_num] = (uint16_t)mtu; - - /* - * Loop through MTU values of all Physical - * interfaces and get the maximum one of all - */ - max_mtu = nss_ctx->phys_if_mtu[0]; - for (i = 1; i < NSS_MAX_PHYSICAL_INTERFACES; i++) { - if (max_mtu < nss_ctx->phys_if_mtu[i]) { - max_mtu = nss_ctx->phys_if_mtu[i]; - } - } - - mtu_sz = nss_top_main.data_plane_ops->data_plane_get_mtu_sz(max_mtu); - -/* - * We need to ensure the max_buf_size for 256MB profile stays - * constant at NSS_EMPTY_BUFFER_SIZE. We do this by disallowing changes - * to it due to MTU changes. Also, NSS_EMPTY_BUFFER_SIZE includes the - * PAD and ETH_HLEN, and is aligned to SMP_CACHE_BYTES - */ -#ifndef NSS_FIXED_BUFFER_SIZE - nss_ctx->max_buf_size = ((mtu_sz + ETH_HLEN + SMP_CACHE_BYTES - 1) & ~(SMP_CACHE_BYTES - 1)) + NSS_NBUF_ETH_EXTRA + NSS_NBUF_PAD_EXTRA; - - /* - * max_buf_size should not be lesser than NSS_NBUF_PAYLOAD_SIZE - */ - if (nss_ctx->max_buf_size < NSS_NBUF_PAYLOAD_SIZE) { - nss_ctx->max_buf_size = NSS_NBUF_PAYLOAD_SIZE; - } -#else - nss_ctx->max_buf_size = NSS_EMPTY_BUFFER_SIZE; -#endif - -#if (NSS_SKB_REUSE_SUPPORT == 1) - if (nss_ctx->max_buf_size > nss_core_get_max_reuse()) - nss_core_set_max_reuse(ALIGN(nss_ctx->max_buf_size * 2, PAGE_SIZE)); -#endif - - nss_info("Current mtu:%u mtu_sz:%u max_buf_size:%d\n", mtu, mtu_sz, nss_ctx->max_buf_size); - - if (mtu_sz > nss_ctx->nss_top->prev_mtu_sz) { - - /* If crypto is enabled on platform - * Send the flush payloads message - */ - if (nss_ctx->nss_top->crypto_enabled) { - if (nss_n2h_flush_payloads(nss_ctx) != NSS_TX_SUCCESS) { - nss_info("Unable to send flush payloads command to NSS\n"); - } - } - } - nss_ctx->nss_top->prev_mtu_sz = mtu_sz; - - return status; -} - -/* - * nss_phys_if_vsi_assign() - * Send a vsi assign to physical interface - */ -nss_tx_status_t nss_phys_if_vsi_assign(struct nss_ctx_instance *nss_ctx, uint32_t vsi, uint32_t if_num) -{ - struct nss_phys_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_info("%px: Phys If VSI Assign, id:%d\n", nss_ctx, if_num); - - memset(&nim, 0, sizeof(struct nss_phys_if_msg)); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_VSI_ASSIGN, - sizeof(struct nss_if_vsi_assign), nss_phys_if_callback, NULL); - - nim.msg.if_msg.vsi_assign.vsi = vsi; - return nss_phys_if_msg_sync(nss_ctx, &nim); -} - -/* - * nss_phys_if_vsi_unassign() - * Send a vsi unassign to physical interface - */ -nss_tx_status_t nss_phys_if_vsi_unassign(struct nss_ctx_instance *nss_ctx, uint32_t vsi, uint32_t if_num) -{ - struct nss_phys_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_info("%px: Phys If VSI Unassign, id:%d\n", nss_ctx, if_num); - - memset(&nim, 0, sizeof(struct nss_phys_if_msg)); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_VSI_UNASSIGN, - sizeof(struct nss_if_vsi_unassign), nss_phys_if_callback, NULL); - - nim.msg.if_msg.vsi_unassign.vsi = vsi; - return nss_phys_if_msg_sync(nss_ctx, &nim); -} - -/* - * nss_phys_if_pause_on_off() - * Send a pause enabled/disabled message to GMAC - */ -nss_tx_status_t nss_phys_if_pause_on_off(struct nss_ctx_instance *nss_ctx, uint32_t pause_on, uint32_t if_num) -{ - struct nss_phys_if_msg nim; - struct nss_if_pause_on_off *nipe; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_info("%px: phys if pause is set to %d, id:%d\n", nss_ctx, pause_on, if_num); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_PAUSE_ON_OFF, - sizeof(struct nss_if_pause_on_off), nss_phys_if_callback, NULL); - - nipe = &nim.msg.if_msg.pause_on_off; - nipe->pause_on = pause_on; - - return nss_phys_if_msg_sync(nss_ctx, &nim); -} - -/* - * nss_phys_if_reset_nexthop() - * De-configures nexthop for an interface - */ -nss_tx_status_t nss_phys_if_reset_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_phys_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_RESET_NEXTHOP, - 0, nss_phys_if_callback, NULL); - - return nss_phys_if_msg_sync(nss_ctx, &nim); -} -EXPORT_SYMBOL(nss_phys_if_reset_nexthop); - -/* - * nss_phys_if_set_nexthop() - * Configures nexthop for an interface - */ -nss_tx_status_t nss_phys_if_set_nexthop(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint32_t nexthop) -{ - struct nss_phys_if_msg nim; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (nexthop >= NSS_MAX_NET_INTERFACES) { - nss_warning("%px: Invalid nexthop interface number: %d", nss_ctx, nexthop); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nss_info("%px: Phys If nexthop will be set to %d, id:%d\n", nss_ctx, nexthop, if_num); - - nss_cmn_msg_init(&nim.cm, if_num, NSS_PHYS_IF_SET_NEXTHOP, - sizeof(struct nss_if_set_nexthop), nss_phys_if_callback, NULL); - nim.msg.if_msg.set_nexthop.nexthop = nexthop; - - return nss_phys_if_msg_sync(nss_ctx, &nim); -} -EXPORT_SYMBOL(nss_phys_if_set_nexthop); - -/* - * nss_get_state() - * Return the NSS initialization state - */ -nss_state_t nss_get_state(void *ctx) -{ - return nss_cmn_get_state(ctx); -} - -EXPORT_SYMBOL(nss_get_state); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_phys_if.h b/feeds/ipq807x/qca-nss-drv/src/nss_phys_if.h deleted file mode 100644 index 0df6bc32f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_phys_if.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/** - * nss_phys_if - * Physical interface message structure - */ - -#ifndef __NSS_PHYS_IF_H -#define __NSS_PHYS_IF_H - -/** - * Physical IF - */ - -/** - * The NSS per-GMAC statistics sync structure. - */ -struct nss_phys_if_estats { - uint32_t rx_errors; /**< Number of RX errors */ - uint32_t rx_receive_errors; /**< Number of RX receive errors */ - uint32_t rx_descriptor_errors; /**< Number of RX descriptor errors */ - uint32_t rx_late_collision_errors; - /**< Number of RX late collision errors */ - uint32_t rx_dribble_bit_errors; /**< Number of RX dribble bit errors */ - uint32_t rx_length_errors; /**< Number of RX length errors */ - uint32_t rx_ip_header_errors; /**< Number of RX IP header errors */ - uint32_t rx_ip_payload_errors; /**< Number of RX IP payload errors */ - uint32_t rx_no_buffer_errors; /**< Number of RX no-buffer errors */ - uint32_t rx_transport_csum_bypassed; - /**< Number of RX packets where the transport checksum was bypassed */ - uint32_t tx_collisions; /**< Number of TX collisions */ - uint32_t tx_errors; /**< Number of TX errors */ - uint32_t tx_jabber_timeout_errors; - /**< Number of TX jabber timeout errors */ - uint32_t tx_frame_flushed_errors; - /**< Number of TX frame flushed errors */ - uint32_t tx_loss_of_carrier_errors; - /**< Number of TX loss of carrier errors */ - uint32_t tx_no_carrier_errors; /**< Number of TX no carrier errors */ - uint32_t tx_late_collision_errors; - /**< Number of TX late collision errors */ - uint32_t tx_excessive_collision_errors; - /**< Number of TX excessive collision errors */ - uint32_t tx_excessive_deferral_errors; - /**< Number of TX excessive deferral errors */ - uint32_t tx_underflow_errors; /**< Number of TX underflow errors */ - uint32_t tx_ip_header_errors; /**< Number of TX IP header errors */ - uint32_t tx_ip_payload_errors; /**< Number of TX IP payload errors */ - uint32_t tx_dropped; /**< Number of TX dropped packets */ - uint32_t hw_errs[10]; /**< GMAC DMA error counters */ - uint32_t rx_missed; /**< Number of RX packets missed by the DMA */ - uint32_t fifo_overflows; /**< Number of RX FIFO overflows signalled by the DMA */ - uint32_t rx_scatter_errors; /**< Number of scattered frames received by the DMA */ - uint32_t tx_ts_create_errors; /**< Number of tx timestamp creation errors */ - uint32_t gmac_total_ticks; /**< Total clock ticks spend inside the GMAC */ - uint32_t gmac_worst_case_ticks; /**< Worst case iteration of the GMAC in ticks */ - uint32_t gmac_iterations; /**< Number of iterations around the GMAC */ - uint32_t tx_pause_frames; /**< Number of pause frames sent by the GMAC */ - uint32_t mmc_rx_overflow_errors; - /**< Number of RX overflow errors */ - uint32_t mmc_rx_watchdog_timeout_errors; - /**< Number of RX watchdog timeout errors */ - uint32_t mmc_rx_crc_errors; /**< Number of RX CRC errors */ - uint32_t mmc_rx_ip_header_errors; - /**< Number of RX IP header errors */ - uint32_t mmc_rx_octets_g; /* Number of good octets received */ - uint32_t mmc_rx_ucast_frames; /* Number of Unicast frames received */ - uint32_t mmc_rx_bcast_frames; /* Number of Bcast frames received */ - uint32_t mmc_rx_mcast_frames; /* Number of Mcast frames received */ - uint32_t mmc_rx_undersize; /* Number of RX undersize frames */ - uint32_t mmc_rx_oversize; /* Number of RX oversize frames */ - uint32_t mmc_rx_jabber; /* Number of jabber frames */ - uint32_t mmc_rx_octets_gb; /* Number of good/bad octets */ - uint32_t mmc_rx_frag_frames_g; /* Number of good ipv4 frag frames */ - uint32_t mmc_tx_octets_g; /* Number of good octets sent */ - uint32_t mmc_tx_ucast_frames; /* Number of Unicast frames sent*/ - uint32_t mmc_tx_bcast_frames; /* Number of Broadcast frames sent */ - uint32_t mmc_tx_mcast_frames; /* Number of Multicast frames sent */ - uint32_t mmc_tx_deferred; /* Number of Deferred frames sent */ - uint32_t mmc_tx_single_col; /* Number of single collisions */ - uint32_t mmc_tx_multiple_col; /* Number of multiple collisions */ - uint32_t mmc_tx_octets_gb; /* Number of good/bad octets sent*/ -}; - -/** - * The NSS GMAC statistics sync structure. - */ -struct nss_phys_if_stats { - struct nss_cmn_node_stats if_stats; /**< Generic interface stats */ - struct nss_phys_if_estats estats; /**< Extended Statistics specific to GMAC */ -}; - -/** - * @brief Request/Response types - */ -enum nss_phys_if_msg_types { - NSS_PHYS_IF_OPEN = NSS_IF_OPEN, - NSS_PHYS_IF_CLOSE = NSS_IF_CLOSE, - NSS_PHYS_IF_LINK_STATE_NOTIFY = NSS_IF_LINK_STATE_NOTIFY, - NSS_PHYS_IF_MTU_CHANGE = NSS_IF_MTU_CHANGE, - NSS_PHYS_IF_MAC_ADDR_SET = NSS_IF_MAC_ADDR_SET, - NSS_PHYS_IF_STATS = NSS_IF_STATS, - NSS_PHYS_IF_ISHAPER_ASSIGN = NSS_IF_ISHAPER_ASSIGN, - NSS_PHYS_IF_BSHAPER_ASSIGN = NSS_IF_BSHAPER_ASSIGN, - NSS_PHYS_IF_ISHAPER_UNASSIGN = NSS_IF_ISHAPER_UNASSIGN, - NSS_PHYS_IF_BSHAPER_UNASSIGN = NSS_IF_BSHAPER_UNASSIGN, - NSS_PHYS_IF_ISHAPER_CONFIG = NSS_IF_ISHAPER_CONFIG, - NSS_PHYS_IF_BSHAPER_CONFIG = NSS_IF_BSHAPER_CONFIG, - NSS_PHYS_IF_PAUSE_ON_OFF = NSS_IF_PAUSE_ON_OFF, - NSS_PHYS_IF_VSI_ASSIGN = NSS_IF_VSI_ASSIGN, - NSS_PHYS_IF_VSI_UNASSIGN = NSS_IF_VSI_UNASSIGN, - NSS_PHYS_IF_SET_NEXTHOP = NSS_IF_SET_NEXTHOP, - NSS_PHYS_IF_RESET_NEXTHOP = NSS_IF_RESET_NEXTHOP, - NSS_PHYS_IF_EXTENDED_STATS_SYNC = NSS_IF_MAX_MSG_TYPES + 1, - NSS_PHYS_IF_MAX_MSG_TYPES -}; - -/** - * Message structure to send/receive physical interface commands - * - * NOTE: Do not adjust the location of if_msg relative to new - * message types as it represents the base messages for all - * intefaces. - */ -struct nss_phys_if_msg { - struct nss_cmn_msg cm; /**< Message Header */ - union { - union nss_if_msgs if_msg; /**< Interfaces messages */ - struct nss_phys_if_stats stats; /**< Phys If Statistics */ - } msg; -}; - -/** - * @brief Callback to receive physical interface messages - * - * @param app_data Application context for this message - * @param msg NSS physical interface message - * - * @return void - */ -typedef void (*nss_phys_if_msg_callback_t)(void *app_data, struct nss_phys_if_msg *msg); - -/** - * @brief Callback to send physical interface data to the tranmsit path. - * - * @param netdev Net device - * @param skb Data buffer - * - * @return void - */ -typedef void (*nss_phys_if_xmit_callback_t)(struct net_device *netdev, struct sk_buff *skb); - -/** - * @brief Callback to receive physical interface data - * TODO: Adjust to pass app_data as unknown to the - * list layer and netdev/sk as known. - * - * @param app_data Application context for this message - * @param os_buf Data buffer - * - * @return void - */ -typedef void (*nss_phys_if_rx_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * @brief Callback to recieve extended data plane packet on interface. - * - * @param app_data Application context for this message - * @param skb Data buffer - * @param napi napi pointer - * - * @return void - */ -typedef void (*nss_phys_if_rx_ext_data_callback_t)(struct net_device *netdev, struct sk_buff *skb, struct napi_struct *napi); - -/** - * @brief Register to send/receive GMAC packets/messages - * - * @param if_num GMAC i/f number - * @param rx_callback Receive callback for packets - * @param event_callback Receive callback for events - * @param netdev netdevice associated with this interface. - * @param features denote the skb types supported by this interface - * - * @return void* NSS context - */ -struct nss_ctx_instance *nss_phys_if_register(uint32_t if_num, - nss_phys_if_rx_callback_t rx_callback, - nss_phys_if_msg_callback_t msg_callback, - struct net_device *netdev, - uint32_t features); - -/** - * @brief Send GMAC packet - * - * @param nss_ctx NSS context - * @param os_buf OS buffer (e.g. skbuff) - * @param if_num GMAC i/f number - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num); - -/** - * @brief Send message to physical interface - * - * @param nim Physical interface message - * - * @return command Tx status - */ -nss_tx_status_t nss_phys_if_msg(struct nss_ctx_instance *nss_ctx, struct nss_phys_if_msg *nim); - -/** - * @brief Send a message to physical interface & wait for the response. - * - * @param nim Physical interface message - * - * @return command Tx status - */ -nss_tx_status_t nss_phys_if_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_phys_if_msg *nim); - -/** - * @brief Open GMAC interface on NSS - * - * @param nss_ctx NSS context - * @param tx_desc_ring Tx descriptor ring address - * @param rx_desc_ring Rx descriptor ring address - * @param if_num GMAC i/f number - * @param bypass_nw_process network processing in nss is bypassed for GMAC - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_open(struct nss_ctx_instance *nss_ctx, uint32_t tx_desc_ring, uint32_t rx_desc_ring, uint32_t mode, uint32_t if_num, - uint32_t bypass_nw_process); - -/** - * @brief Close GMAC interface on NSS - * - * @param nss_ctx NSS context - * @param if_num GMAC i/f number - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_close(struct nss_ctx_instance *nss_ctx, uint32_t if_num); - -/** - * @brief Send link state message to NSS - * - * @param nss_ctx NSS context - * @param link_state Link state - * @param if_num GMAC i/f number - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_link_state(struct nss_ctx_instance *nss_ctx, uint32_t link_state, uint32_t if_num); - -/** - * @brief Send MAC address to NSS - * - * @param nss_ctx NSS context - * @param addr MAC address pointer - * @param if_num GMAC i/f number - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_mac_addr(struct nss_ctx_instance *nss_ctx, uint8_t *addr, uint32_t if_num); - -/** - * @brief Send MTU change notification to NSS - * - * @param nss_ctx NSS context - * @param mtu MTU - * @param if_num GMAC i/f number - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_change_mtu(struct nss_ctx_instance *nss_ctx, uint32_t mtu, uint32_t if_num); - -/** - * @brief Send vsi assign to NSS - * - * @param nss_ctx NSS context - * @param vsi VSI number - * @param if_num GMAC i/f number - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_vsi_assign(struct nss_ctx_instance *nss_ctx, uint32_t vsi, uint32_t if_num); - -/** - * @brief Send vsi unassign to NSS - * - * @param nss_ctx NSS context - * @param vsi VSI number - * @param if_num GMAC i/f number - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_vsi_unassign(struct nss_ctx_instance *nss_ctx, uint32_t vsi, uint32_t if_num); - -/** - * @brief Send pause frame enabled notification to NSS - * - * @param nss_ctx NSS context - * @param pause_on Pause on or off - * @param if_num GMAC i/f number - * - * @return nss_tx_status_t Tx status - */ -nss_tx_status_t nss_phys_if_pause_on_off(struct nss_ctx_instance *nss_ctx, uint32_t pause_on, uint32_t if_num); - -#endif /* __NSS_PHYS_IF_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pm.c b/feeds/ipq807x/qca-nss-drv/src/nss_pm.c deleted file mode 100644 index 75527cddb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pm.c +++ /dev/null @@ -1,447 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_pm.c - * NSS Power Management APIs - * - */ -#include -#include -#include -#include -#include - -#if (NSS_DT_SUPPORT != 1) -#include -#endif - -#if (NSS_PM_SUPPORT == 1) -#include "nss_pm.h" - -/* - * Global NSS PM structure - */ -struct nss_pm_global_ctx ctx; - -/* - * Bus vector table for GMAC driver - */ -static struct msm_bus_paths nss_gmac_bw_level_tbl[NSS_PM_PERF_MAX_LEVELS] = { - [NSS_PM_PERF_LEVEL_SUSPEND] = GMAC_BW_MBPS(0, 0), - /* 0 MHz to DDR, 0 MHz to TCM */ - [NSS_PM_PERF_LEVEL_IDLE] = GMAC_BW_MBPS(133, 5), - /* 133 MHz to DDR, 5 MHz to TCM */ - [NSS_PM_PERF_LEVEL_NOMINAL] = GMAC_BW_MBPS(200, 400), - /* 200 MHz to DDR, 10 MHz to TCM */ - [NSS_PM_PERF_LEVEL_TURBO] = GMAC_BW_MBPS(266, 533), - /* 266 MHz to DDR, 20 MHz to TCM */ -}; - -/* - * Bus vector table for Crypto driver - */ -static struct msm_bus_paths nss_crypto_bw_level_tbl[NSS_PM_PERF_MAX_LEVELS] = { - [NSS_PM_PERF_LEVEL_SUSPEND] = CRYPTO_BW_MBPS(0, 0), - /* 0 MHz to DDR, 0 MHz to TCM */ - [NSS_PM_PERF_LEVEL_IDLE] = CRYPTO_BW_MBPS(133, 5), - /* 133 MHz to DDR, 5 MHz to TCM */ - [NSS_PM_PERF_LEVEL_NOMINAL] = CRYPTO_BW_MBPS(200, 400), - /* 200 MHz to DDR, 10 MHz to TCM */ - [NSS_PM_PERF_LEVEL_TURBO] = CRYPTO_BW_MBPS(266, 533), - /* 266 MHz to DDR, 20 MHz to TCM */ -}; - -#ifdef NSS_PM_NETAP_GMAC_SCALING - -/* - * Bus vector table for NSS HLOS driver - * This requests bw for both NSS Fab0 and Fab1 on behalf of GMAC and NSS Drivers - */ -static struct msm_bus_paths nss_netap_bw_level_tbl[NSS_PM_PERF_MAX_LEVELS] = { - [NSS_PM_PERF_LEVEL_SUSPEND] = GMAC_BW_MBPS(0, 0), - /* 0 MHz to DDR, 0 MHz to TCM */ - [NSS_PM_PERF_LEVEL_IDLE] = GMAC_BW_MBPS(122, 122), - /* 133 MHz to DDR and TCM */ - [NSS_PM_PERF_LEVEL_NOMINAL] = GMAC_BW_MBPS(200, 200), - /* 400 MHz to DDR and TCM */ - [NSS_PM_PERF_LEVEL_TURBO] = GMAC_BW_MBPS(400, 400), - /* 533 MHz to DDR and TCM */ -}; - -#else - -/* - * Bus vector table for NSS HLOS driver - */ -static struct msm_bus_paths nss_netap_bw_level_tbl[NSS_PM_PERF_MAX_LEVELS] = { - [NSS_PM_PERF_LEVEL_SUSPEND] = NETAP_BW_MBPS(0, 0), - /* 0 MHz to DDR, 0 MHz to TCM */ - [NSS_PM_PERF_LEVEL_IDLE] = NETAP_BW_MBPS(133, 133), - /* 133 MHz to DDR and TCM */ - [NSS_PM_PERF_LEVEL_NOMINAL] = NETAP_BW_MBPS(400, 400), - /* 400 MHz to DDR and TCM */ - [NSS_PM_PERF_LEVEL_TURBO] = NETAP_BW_MBPS(533, 533), - /* 533 MHz to DDR and TCM */ -}; - -#endif - -/* - * Bus Driver Platform data for GMAC, Crypto and Netap clients - */ -static struct msm_bus_scale_pdata nss_bus_scale[] = { - [NSS_PM_CLIENT_GMAC] = { - .usecase = nss_gmac_bw_level_tbl, - .num_usecases = ARRAY_SIZE(nss_gmac_bw_level_tbl), - .active_only = 1, - .name = "qca-nss-gmac", - }, - - [NSS_PM_CLIENT_CRYPTO] = { - .usecase = nss_crypto_bw_level_tbl, - .num_usecases = ARRAY_SIZE(nss_crypto_bw_level_tbl), - .active_only = 1, - .name = "qca-nss-crypto", - }, - - [NSS_PM_CLIENT_NETAP] = { - .usecase = nss_netap_bw_level_tbl, - .num_usecases = ARRAY_SIZE(nss_netap_bw_level_tbl), - .active_only = 1, - .name = "qca-nss-drv", - }, -}; - -/* - * nss_pm_dbg_perf_level_get - * debugfs hook to get the current performance level - */ -static int nss_pm_dbg_perf_level_get(void *data, u64 *val) -{ - nss_pm_client_data_t *pm_client; - - pm_client = (nss_pm_client_data_t *)data; - *val = pm_client->current_perf_lvl; - - return NSS_PM_API_SUCCESS; -} - -/* - * nss_pm_dbg_autoscale_get - * debugfs hook to get the current autoscale setting - */ -static int nss_pm_dbg_autoscale_get(void *data, u64 *val) -{ - nss_pm_client_data_t *pm_client; - - pm_client = (nss_pm_client_data_t *)data; - *val = pm_client->auto_scale; - - return NSS_PM_API_SUCCESS; -} - -/* - * nss_pm_dbg_perf_level_set - * debugfs hook to set perf level for a client - */ -static int nss_pm_dbg_perf_level_set(void *data, u64 val) -{ - uint32_t perf_level; - - perf_level = (uint32_t) val; - - if (perf_level >= NSS_PM_PERF_MAX_LEVELS || - perf_level < NSS_PM_PERF_LEVEL_IDLE) { - nss_pm_warning("unsupported performance level %d \n", perf_level); - return NSS_PM_API_FAILED; - } - - nss_pm_set_perf_level(data, perf_level); - return NSS_PM_API_SUCCESS; -} - -/* - * nss_pm_dbg_autoscale_set - * debugfs hook to enable auto scaling for a client - */ -static int nss_pm_dbg_autoscale_set(void *data, u64 val) -{ - nss_pm_client_data_t *pm_client; - - if (val > 1) { - nss_pm_warning(" Invalid set value, valid values are 0/1 \n"); - return NSS_PM_API_FAILED; - } - - pm_client->auto_scale = (uint32_t)val; - return NSS_PM_API_SUCCESS; -} - -DEFINE_SIMPLE_ATTRIBUTE(perf_level_fops, nss_pm_dbg_perf_level_get, nss_pm_dbg_perf_level_set, "%llu\n"); - -DEFINE_SIMPLE_ATTRIBUTE(autoscale_fops, nss_pm_dbg_autoscale_get, nss_pm_dbg_autoscale_set, "%llu\n"); -#endif /** (NSS_PM_SUPPORT == 1) */ - -/* - * nss_pm_client_register - * Initialize GMAC specific PM parameters - * - * Creates debugfs hooks for user-space control of NSS Client PM - * Initializes Bus BW to Idle Perf level - * Returns PM handle to the caller. - * - */ -void *nss_pm_client_register(nss_pm_client_t client_id) -{ -#if (NSS_PM_SUPPORT == 1) - int ret; - struct dentry *pm_dentry; - nss_pm_client_data_t *pm_client; - - if (unlikely(client_id >= NSS_PM_MAX_CLIENTS)) { - nss_pm_warning("nss_pm_client_register invalid client id %d \n", client_id); - goto error; - } - - pm_client = &ctx.nss_pm_client[client_id]; - - pm_client->bus_perf_client = msm_bus_scale_register_client(&nss_bus_scale[client_id]); - if (!pm_client->bus_perf_client) { - nss_pm_warning("unable to register bus client \n"); - goto error; - } - - ret = msm_bus_scale_client_update_request(pm_client->bus_perf_client, NSS_PM_PERF_LEVEL_IDLE); - if (ret) { - nss_pm_warning("initial bandwidth req failed (%d)\n", ret); - msm_bus_scale_unregister_client((uint32_t) pm_client->bus_perf_client); - goto error; - } - - pm_client->current_perf_lvl = NSS_PM_PERF_LEVEL_IDLE; - - switch (client_id) { - case NSS_PM_CLIENT_GMAC: - pm_dentry = debugfs_create_dir("gmac" , ctx.pm_dentry); - break; - - case NSS_PM_CLIENT_CRYPTO: - pm_dentry = debugfs_create_dir("crypto" , ctx.pm_dentry); - break; - - case NSS_PM_CLIENT_NETAP: - pm_dentry = debugfs_create_dir("netap" , ctx.pm_dentry); - break; - - default: - nss_pm_warning("debugfs create failed invalid client id %d \n", client_id); - msm_bus_scale_unregister_client((uint32_t) pm_client->bus_perf_client); - goto error; - - } - - if (unlikely(pm_dentry == NULL)) { - nss_pm_info("debugfs not created for %d client pm \n", client_id); - goto out; - } - - pm_client->dentry = pm_dentry; - pm_client->client_id = client_id; - - if (!debugfs_create_file("perf_level", S_IRUGO | S_IWUSR, pm_dentry, pm_client, &perf_level_fops)) { - nss_pm_info("debugfs perf_level file not created for %d client pm \n", client_id); - } - - if (!debugfs_create_file("auto-scale", S_IRUGO | S_IWUSR, pm_dentry, pm_client, &autoscale_fops)) { - nss_pm_info("debugfs auto-scale file not created for %d client pm \n", client_id); - } - -out: - return (void *)pm_client; -error: -#endif - return NULL; -} -EXPORT_SYMBOL(nss_pm_client_register); - -/* - * nss_pm_client_unregister - * Unregister the client for any PM operations - */ -int nss_pm_client_unregister(nss_pm_client_t client_id) -{ -#if (NSS_PM_SUPPORT == 1) - nss_pm_client_data_t *pm_client; - - if (unlikely(client_id >= NSS_PM_MAX_CLIENTS)) { - nss_pm_warning("nss_pm_client_unregister invalid client id %d \n", client_id); - goto error; - } - - pm_client = &ctx.nss_pm_client[client_id]; - - if (unlikely(pm_client == NULL)) { - nss_pm_warning("nss_pm_client_unregister client not registered %d \n", client_id); - goto error; - } - - if (pm_client->bus_perf_client) { - msm_bus_scale_unregister_client((uint32_t) pm_client->bus_perf_client); - } else { - nss_pm_info("nss_pm_client_unregister: client not registered \n"); - } - - if (likely(pm_client->dentry != NULL)) { - debugfs_remove_recursive(pm_client->dentry); - } - - return NSS_PM_API_SUCCESS; - -error: -#endif - return NSS_PM_API_FAILED; -} - -/* - * nss_pm_set_perf_level() - * Sets the performance level of client specific Fabrics and Clocks to requested level - */ -nss_pm_interface_status_t nss_pm_set_perf_level(void *handle, nss_pm_perf_level_t lvl) -{ -#if ((NSS_DT_SUPPORT == 1) && (NSS_FREQ_SCALE_SUPPORT == 1)) - nss_freq_scales_t index; - - switch (lvl) { - case NSS_PM_PERF_LEVEL_TURBO: - index = NSS_FREQ_HIGH_SCALE; - break; - - case NSS_PM_PERF_LEVEL_NOMINAL: - index = NSS_FREQ_MID_SCALE; - break; - - default: - index = NSS_PM_PERF_LEVEL_IDLE; - } - -#if !defined(NSS_HAL_IPQ807x_SUPPORT) - nss_freq_sched_change(index, false); -#endif - -#elif (NSS_PM_SUPPORT == 1) - - int ret = 0; - nss_pm_client_data_t *pm_client; - - pm_client = (nss_pm_client_data_t *) handle; - if (pm_client->current_perf_lvl == lvl) { - nss_pm_trace("Already at perf level %d , ignoring request \n", lvl); - return NSS_PM_API_SUCCESS; - } - - if (!pm_client->bus_perf_client) { - nss_pm_warning("Bus driver client not registered.request failed \n"); - return NSS_PM_API_FAILED; - } - - /* - * Do client specific operations here - */ - if (pm_client->client_id == NSS_PM_CLIENT_NETAP) { - if ((lvl == NSS_PM_PERF_LEVEL_TURBO) && (ctx.turbo_support == true)) { - /* - * For turbo perf level, switch TCM source to - * SRC1 to set TCM clock = 400 MHz - * SRC0 and SRC1 are set to 266 and 400 MHz resp. - * in nss_hal/ipq806x/nss_hal_pvt.c - */ - writel(0x3, NSSTCM_CLK_SRC_CTL); - } else { - /* - * For Nominal and Idle perf level, switch to SRC0 to - * set TCM clock = 266 MHz - */ - writel(0x2, NSSTCM_CLK_SRC_CTL); - - if (lvl == NSS_PM_PERF_LEVEL_TURBO) { - lvl = NSS_PM_PERF_LEVEL_NOMINAL; - } - } - } - - if (pm_client->client_id == NSS_PM_CLIENT_CRYPTO) { - if ((lvl == NSS_PM_PERF_LEVEL_TURBO) && (ctx.turbo_support == true)) { - /* - * For Turbo mode, set Crypto core and - * Fabric port clocks to 213 MHz - */ - writel(0x23, CE5_ACLK_SRC0_NS); - writel(0x23, CE5_HCLK_SRC0_NS); - writel(0x23, CE5_CORE_CLK_SRC0_NS); - - writel(0x2, CE5_ACLK_SRC_CTL); - writel(0x2, CE5_HCLK_SRC_CTL); - writel(0x2, CE5_CORE_CLK_SRC_CTL); - } else { - lvl = NSS_PM_PERF_LEVEL_NOMINAL; - } - } - - /* Update bandwidth if request has changed. This may sleep. */ - ret = msm_bus_scale_client_update_request(pm_client->bus_perf_client, lvl); - if (ret) { - nss_pm_warning("bandwidth request failed (%d)\n", ret); - return NSS_PM_API_FAILED; - } - - nss_pm_info("perf level request, current: %d new: %d \n", pm_client->current_perf_lvl, lvl); - pm_client->current_perf_lvl = lvl; -#endif - - return NSS_PM_API_SUCCESS; -} -EXPORT_SYMBOL(nss_pm_set_perf_level); - -#if (NSS_PM_SUPPORT == 1) -/* - * nss_pm_set_turbo() - * Sets the turbo support flag globally for all clients - */ -void nss_pm_set_turbo() { - - nss_pm_info("NSS Bus PM - Platform supports Turbo Mode \n"); - ctx.turbo_support = true; -} - -/* - * nss_pm_init() - * Initialize NSS PM top level structures - */ -void nss_pm_init(void) { - - nss_pm_info("NSS Bus PM (platform - IPQ806x, build - %s:%s)\n", __DATE__, __TIME__); - - ctx.pm_dentry = debugfs_create_dir("qca-nss-pm", NULL); - - /* Default turbo support is set to off */ - ctx.turbo_support = false; - - if (unlikely(ctx.pm_dentry == NULL)) { - nss_pm_warning("Failed to create qca-nss-drv directory in debugfs"); - } -} -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pm.h b/feeds/ipq807x/qca-nss-drv/src/nss_pm.h deleted file mode 100644 index aaca293cb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pm.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_pm.h - * NSS PM Driver header file - */ - -#ifndef __NSS_PM_H -#define __NSS_PM_H - -#include - -#include -#include -#include -#include - -#include - -/* - * NSS PM debug macros - */ -#if (NSS_PM_DEBUG_LEVEL < 1) -#define nss_pm_assert(fmt, args...) -#else -#define nss_pm_assert(c) if (!(c)) { BUG_ON(!(c)); } -#endif - -#if (NSS_PM_DEBUG_LEVEL < 2) -#define nss_pm_warning(fmt, args...) -#else -#define nss_pm_warning(fmt, args...) printk(KERN_WARNING "nss_pm:"fmt, ##args) -#endif - -#if (NSS_PM_DEBUG_LEVEL < 3) -#define nss_pm_info(fmt, args...) -#else -#define nss_pm_info(fmt, args...) printk(KERN_INFO "nss_pm:"fmt, ##args) -#endif - -#if (NSS_PM_DEBUG_LEVEL < 4) -#define nss_pm_trace(fmt, args...) -#else -#define nss_pm_trace(fmt, args...) printk(KERN_DEBUG "nss_pm:"fmt, ##args) -#endif - -/* - * Define this to use NETAP driver also request for NSS Fab1 BW on behalf of GMAC driver - */ -#define NSS_PM_NETAP_GMAC_SCALING 1 - -/* - * PM Client data structure - */ -typedef struct { - uint32_t bus_perf_client; - uint32_t clk_handle; - uint32_t current_perf_lvl; - uint32_t auto_scale; - struct dentry *dentry; - nss_pm_client_t client_id; -} nss_pm_client_data_t; - -/* - * NSS PM driver context - */ -struct nss_pm_global_ctx { - struct dentry *pm_dentry; - bool turbo_support; - nss_pm_client_data_t nss_pm_client[NSS_PM_MAX_CLIENTS]; -}; - -/* - * Macro defining Bus vector for GMAC driver - */ -#define GMAC_BW_MBPS(_data_bw, _desc_bw) \ -{ \ - .vectors = (struct msm_bus_vectors[]){ \ - {\ - .src = MSM_BUS_MASTER_NSS_GMAC_0, \ - .dst = MSM_BUS_SLAVE_EBI_CH0, \ - .ab = (_data_bw) * 16 * 1000000ULL, \ - .ib = (_data_bw) * 16 * 1000000ULL, \ - }, \ - { \ - .src = MSM_BUS_MASTER_NSS_GMAC_0, \ - .dst = MSM_BUS_SLAVE_NSS_TCM, \ - .ab = (_desc_bw) * 8 * 1000000ULL, \ - .ib = (_desc_bw) * 8 * 1000000ULL, \ - }, \ - }, \ - .num_paths = 2, \ -} - -/* - * Macro defining Bus vector for NSS crypto driver - */ -#define CRYPTO_BW_MBPS(_data_bw, _desc_bw) \ -{ \ - .vectors = (struct msm_bus_vectors[]){ \ - {\ - .src = MSM_BUS_MASTER_NSS_CRYPTO5_0, \ - .dst = MSM_BUS_SLAVE_EBI_CH0, \ - .ab = 0, \ - .ib = 0, \ - }, \ - { \ - .src = MSM_BUS_MASTER_NSS_CRYPTO5_0, \ - .dst = MSM_BUS_SLAVE_NSS_TCM, \ - .ab = (_desc_bw) * 8 * 1000000ULL, \ - .ib = (_desc_bw) * 8 * 1000000ULL, \ - }, \ - }, \ - .num_paths = 2, \ -} - -/* - * Macro defining Bus vector for NSS driver - * - */ -#define NETAP_BW_MBPS(_data_bw, _desc_bw) \ -{ \ - .vectors = (struct msm_bus_vectors[]){ \ - {\ - .src = MSM_BUS_MASTER_UBI32_0, \ - .dst = MSM_BUS_SLAVE_EBI_CH0, \ - .ab = (_data_bw) * 16 * 1000000ULL, \ - .ib = (_data_bw) * 16 * 1000000ULL, \ - }, \ - { \ - .src = MSM_BUS_MASTER_UBI32_0, \ - .dst = MSM_BUS_SLAVE_NSS_TCM, \ - .ab = (_desc_bw) * 8 * 1000000ULL, \ - .ib = (_desc_bw) * 8 * 1000000ULL, \ - }, \ - }, \ - .num_paths = 2, \ -} - -/* - * Initialize NSS PM top level structures - */ -void nss_pm_init(void); - -/* - * Sets the turbo support flag globally for all PM clients - */ -void nss_pm_set_turbo(void); - -#endif /** __NSS_PM_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_portid.c b/feeds/ipq807x/qca-nss-drv/src/nss_portid.c deleted file mode 100644 index 65982f09a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_portid.c +++ /dev/null @@ -1,423 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_portid_stats.h" -#include "nss_portid_log.h" - -/* - * Spinlock to protect portid interface create/destroy/update - */ -DEFINE_SPINLOCK(nss_portid_spinlock); - -#define NSS_PORTID_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Private data structure for phys_if interface - */ -static struct nss_portid_pvt { - struct semaphore sem; - struct completion complete; - int response; -} pid; - -/* - * Array of portid interface handles. Indexing based on the physical port_id - */ -struct nss_portid_handle nss_portid_hdl[NSS_PORTID_MAX_SWITCH_PORT]; - -/* - * nss_portid_handler() - * Handle NSS -> HLOS messages for portid - */ -static void nss_portid_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data) -{ - nss_portid_msg_callback_t cb; - struct nss_portid_msg *npm = (struct nss_portid_msg *)ncm; - - BUG_ON(ncm->interface != NSS_PORTID_INTERFACE); - - /* - * Trace Messages - */ - nss_portid_log_rx_msg(npm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_PORTID_MAX_MSG_TYPE) { - nss_warning("%px: received invalid message %d for portid interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_portid_msg)) { - nss_warning("%px: message size incorrect: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ncm->type) { - case NSS_PORTID_STATS_SYNC_MSG: - /* - * Update portid statistics. - */ - nss_portid_stats_sync(nss_ctx, &npm->msg.stats_sync); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, portid sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].ndev; - } - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_portid_msg_callback_t)ncm->cb; - - cb((void *)ncm->app_data, npm); -} - -/* - * nss_portid_get_ctx() - * Return a portid's NSS context. - */ -struct nss_ctx_instance *nss_portid_get_ctx(void) -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.portid_handler_id]; - return nss_ctx; -} - -/* - * nss_portid_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_portid_verify_if_num(uint32_t if_num) -{ - if (nss_is_dynamic_interface(if_num) == false) { - return false; - } - - if (nss_dynamic_interface_get_type(nss_portid_get_ctx(), if_num) != NSS_DYNAMIC_INTERFACE_TYPE_PORTID) { - return false; - } - - return true; -} - -/* - * nss_portid_get_stats() - * API for getting stats from a port interface - */ -bool nss_portid_get_stats(uint32_t if_num, struct rtnl_link_stats64 *stats) -{ - int i; - - spin_lock_bh(&nss_portid_spinlock); - for (i = 0; i < NSS_PORTID_MAX_SWITCH_PORT; i++) { - if (nss_portid_hdl[i].if_num == if_num) { - memcpy(stats, &nss_portid_hdl[i].stats, sizeof(*stats)); - spin_unlock_bh(&nss_portid_spinlock); - return true; - } - } - spin_unlock_bh(&nss_portid_spinlock); - return false; -} -EXPORT_SYMBOL(nss_portid_get_stats); - -/* - * nss_portid_if_tx_data() - * Transmit data buffer (skb) to a NSS interface number - */ -nss_tx_status_t nss_portid_if_tx_data(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - return nss_if_tx_buf(nss_ctx, os_buf, if_num); -} -EXPORT_SYMBOL(nss_portid_if_tx_data); - -/* - * nss_portid_tx_msg() - * Transmit a portid message to NSSFW - */ -nss_tx_status_t nss_portid_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_portid_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_portid_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_PORTID_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_PORTID_MAX_MSG_TYPE) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_portid_tx_msg); - -/* - * nss_portid_callback - * Callback to handle the completion of NSS ->HLOS messages. - */ -static void nss_portid_callback(void *app_data, struct nss_portid_msg *npm) -{ - if(npm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("portid error response %d\n", npm->cm.response); - pid.response = NSS_TX_FAILURE; - complete(&pid.complete); - return; - } - - pid.response = NSS_TX_SUCCESS; - complete(&pid.complete); -} - -/* - * nss_portid_tx_msg_sync() - * Send a message to portid interface & wait for the response. - */ -nss_tx_status_t nss_portid_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_portid_msg *msg) -{ - nss_tx_status_t status; - int ret = 0; - - down(&pid.sem); - - status = nss_portid_tx_msg(nss_ctx, msg); - if(status != NSS_TX_SUCCESS) - { - nss_warning("%px: nss_phys_if_msg failed\n", nss_ctx); - up(&pid.sem); - return status; - } - - ret = wait_for_completion_timeout(&pid.complete, msecs_to_jiffies(NSS_PORTID_TX_TIMEOUT)); - - if(!ret) - { - nss_warning("%px: portid tx failed due to timeout\n", nss_ctx); - pid.response = NSS_TX_FAILURE; - } - - status = pid.response; - up(&pid.sem); - - return status; -} -EXPORT_SYMBOL(nss_portid_tx_msg_sync); - -/* - * nss_portid_msg_init() - * Initialize portid message. - */ -void nss_portid_msg_init(struct nss_portid_msg *npm, uint16_t if_num, uint32_t type, uint32_t len, - nss_portid_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&npm->cm, if_num, type, len, (void*)cb, app_data); -} -EXPORT_SYMBOL(nss_portid_msg_init); - -/* - * nss_portid_tx_configure_port_if_msg - * API to send configure port message to NSS FW - */ -nss_tx_status_t nss_portid_tx_configure_port_if_msg(struct nss_ctx_instance *nss_ctx, uint32_t port_if_num, uint8_t port_id, uint8_t gmac_id) -{ - struct nss_portid_msg npm; - struct nss_portid_configure_msg *npcm; - - if (nss_portid_verify_if_num(port_if_num) == false) { - nss_warning("received invalid interface %d", port_if_num); - return NSS_TX_FAILURE; - } - - if (port_id >= NSS_PORTID_MAX_SWITCH_PORT) { - nss_warning("port_id %d exceeds NSS_PORTID_MAX_SWITCH_PORT\n", port_id); - return NSS_TX_FAILURE; - } - - if (gmac_id >= NSS_MAX_PHYSICAL_INTERFACES) { - nss_warning("gmac_id %d not valid\n", gmac_id); - return NSS_TX_FAILURE; - } - - /* - * Prepare message to configure a port interface - */ - npcm = &npm.msg.configure; - npcm->port_if_num = port_if_num; - npcm->port_id = port_id; - npcm->gmac_id = gmac_id; - - nss_portid_msg_init(&npm, NSS_PORTID_INTERFACE, NSS_PORTID_CONFIGURE_MSG, - sizeof(struct nss_portid_configure_msg), nss_portid_callback, NULL); - nss_info("Dynamic interface allocated, sending message to FW with port_if_num %d port_id %d gmac_id %d\n", - npcm->port_if_num, npcm->port_id, npcm->gmac_id); - return nss_portid_tx_msg_sync(nss_ctx, &npm); -} -EXPORT_SYMBOL(nss_portid_tx_configure_port_if_msg); - -/* - * nss_portid_tx_unconfigure_port_if_msg - * API to send unconfigure port message to NSS FW - */ -nss_tx_status_t nss_portid_tx_unconfigure_port_if_msg(struct nss_ctx_instance *nss_ctx, uint32_t port_if_num, uint8_t port_id) -{ - struct nss_portid_msg npm; - struct nss_portid_unconfigure_msg *npum; - - if (nss_portid_verify_if_num(port_if_num) == false) { - nss_warning("received invalid interface %d", port_if_num); - return NSS_TX_FAILURE; - } - - if (port_id >= NSS_PORTID_MAX_SWITCH_PORT) { - nss_warning("port_id %d exceeds NSS_PORTID_MAX_SWITCH_PORT\n", port_id); - return NSS_TX_FAILURE; - } - - /* - * Prepare message to unconfigure a port interface - */ - npum = &npm.msg.unconfigure; - npum->port_if_num = port_if_num; - npum->port_id = port_id; - - nss_portid_msg_init(&npm, NSS_PORTID_INTERFACE, NSS_PORTID_UNCONFIGURE_MSG, - sizeof(struct nss_portid_configure_msg), nss_portid_callback, NULL); - - return nss_portid_tx_msg_sync(nss_ctx, &npm); -} -EXPORT_SYMBOL(nss_portid_tx_unconfigure_port_if_msg); - -/* - * nss_portid_register_port_if() - * Register with portid node and get back nss_ctx - */ -struct nss_ctx_instance *nss_portid_register_port_if(uint32_t if_num, uint32_t port_id, struct net_device *netdev, - nss_portid_buf_callback_t buf_callback) -{ - struct nss_ctx_instance *nss_ctx = nss_portid_get_ctx(); - - if (nss_portid_verify_if_num(if_num) == false) { - nss_warning("nss portid register received invalid interface %d", if_num); - return NULL; - } - - if (port_id >= NSS_PORTID_MAX_SWITCH_PORT) { - nss_warning("nss portid register received invalid port number %d", port_id); - return NULL; - } - - spin_lock(&nss_portid_spinlock); - if (nss_portid_hdl[port_id].if_num != 0) { - nss_warning("nss portid failed: port already registered %d", port_id); - spin_unlock(&nss_portid_spinlock); - return NULL; - } - nss_portid_hdl[port_id].if_num = if_num; - spin_unlock(&nss_portid_spinlock); - - nss_core_register_subsys_dp(nss_ctx, if_num, buf_callback, NULL, NULL, netdev, 0); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_portid_register_port_if); - -/* - * nss_portid_unregister_port_if() - * Unregister portid node with NSS FW - */ -bool nss_portid_unregister_port_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx; - int i; - - nss_ctx = nss_portid_get_ctx(); - if (nss_portid_verify_if_num(if_num) == false) { - nss_warning("%px: unregister received for invalid interface %d", nss_ctx, if_num); - return false; - } - - spin_lock(&nss_portid_spinlock); - for (i = 0; i < NSS_PORTID_MAX_SWITCH_PORT; i++) { - if (nss_portid_hdl[i].if_num == if_num) { - nss_portid_hdl[i].if_num = 0; - } - } - spin_unlock(&nss_portid_spinlock); - - nss_core_unregister_handler(nss_ctx, if_num); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - return true; -} -EXPORT_SYMBOL(nss_portid_unregister_port_if); - -/* - * nss_portid_init() - * Initializes portid node. Gets called from nss_init.c - */ -void nss_portid_init(void) -{ - memset(&nss_portid_hdl, 0, sizeof(struct nss_portid_handle) * NSS_PORTID_MAX_SWITCH_PORT); -} - -/* - * nss_portid_register_handler() - * Registering handler for sending msg to portid node on NSS. - */ -void nss_portid_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_portid_get_ctx(); - - nss_core_register_handler(nss_ctx, NSS_PORTID_INTERFACE, nss_portid_handler, NULL); - - nss_portid_stats_dentry_create(); - - sema_init(&pid.sem, 1); - init_completion(&pid.complete); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_portid_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_portid_log.c deleted file mode 100644 index 700e1181b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_portid_log.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_portid_log.c - * NSS PORTID logger file. - */ - -#include "nss_core.h" - -/* - * nss_portid_log_message_types_str - * NSS PORTID message strings - */ -static int8_t *nss_portid_log_message_types_str[NSS_PORTID_MAX_MSG_TYPE] __maybe_unused = { - "PORTID Configure", - "PORTID Unconfigure", - "PORTID Stats", -}; - -/* - * nss_portid_log_configure_msg() - * Log NSS PORTID Configure. - */ -static void nss_portid_log_configure_msg(struct nss_portid_msg *npm) -{ - struct nss_portid_configure_msg *npcm __maybe_unused = &npm->msg.configure; - nss_trace("%px: NSS PORTID Configure message \n" - "PORTID Interface Number: %d\n" - "PORTID Interface ID: %d\n" - "PORTID GMAC ID: %d\n", - npcm, npcm->port_if_num, - npcm->port_id, npcm->gmac_id); -} - -/* - * nss_portid_log_unconfigure_msg() - * Log NSS PORTID Unconfigure. - */ -static void nss_portid_log_unconfigure_msg(struct nss_portid_msg *npm) -{ - struct nss_portid_unconfigure_msg *npum __maybe_unused = &npm->msg.unconfigure; - nss_trace("%px: NSS PORTID Configure message \n" - "PORTID Interface Number: %d\n" - "PORTID Interface ID: %d\n", - npum, npum->port_if_num, - npum->port_id); -} - -/* - * nss_portid_log_verbose() - * Log message contents. - */ -static void nss_portid_log_verbose(struct nss_portid_msg *npm) -{ - switch (npm->cm.type) { - case NSS_PORTID_CONFIGURE_MSG: - nss_portid_log_configure_msg(npm); - break; - - case NSS_PORTID_UNCONFIGURE_MSG: - nss_portid_log_unconfigure_msg(npm); - break; - - case NSS_PORTID_STATS_SYNC_MSG: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", npm); - break; - } -} - -/* - * nss_portid_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_portid_log_tx_msg(struct nss_portid_msg *npm) -{ - if (npm->cm.type >= NSS_PORTID_MAX_MSG_TYPE) { - nss_warning("%px: Invalid message type\n", npm); - return; - } - - nss_info("%px: type[%d]:%s\n", npm, npm->cm.type, nss_portid_log_message_types_str[npm->cm.type]); - nss_portid_log_verbose(npm); -} - -/* - * nss_portid_log_rx_msg() - * Log messages received from FW. - */ -void nss_portid_log_rx_msg(struct nss_portid_msg *npm) -{ - if (npm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", npm); - return; - } - - if (npm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", npm, npm->cm.type, - nss_portid_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - npm, npm->cm.type, nss_portid_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response]); - -verbose: - nss_portid_log_verbose(npm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_portid_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_portid_log.h deleted file mode 100644 index 54d904fe9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_portid_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_PORTID_LOG_H -#define __NSS_PORTID_LOG_H - -/* - * nss_portid.h - * NSS PORTID header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_portid_log_tx_msg - * Logs a portid message that is sent to the NSS firmware. - */ -void nss_portid_log_tx_msg(struct nss_portid_msg *ntm); - -/* - * nss_portid_log_rx_msg - * Logs a portid message that is received from the NSS firmware. - */ -void nss_portid_log_rx_msg(struct nss_portid_msg *ntm); - -#endif /* __NSS_PORTID_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_portid_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_portid_stats.c deleted file mode 100644 index 8b6086dba..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_portid_stats.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_portid_stats.h" - -extern spinlock_t nss_portid_spinlock; -extern struct nss_portid_handle nss_portid_hdl[]; - -/* - * nss_portid_stats_str - * PortID statistics strings. - */ -struct nss_stats_info nss_portid_stats_str[NSS_PORTID_STATS_MAX] = { - {"rx_invalid_header" , NSS_STATS_TYPE_EXCEPTION} -}; - -uint64_t nss_portid_stats[NSS_PORTID_STATS_MAX]; - -/* - * nss_portid_stats_read() - * Read PortID stats. - */ -static ssize_t nss_portid_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - /* - * Max output lines = #stats + few output lines for banner printing + - * Number of Extra outputlines for future reference to add new stats. - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_PORTID_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_STATS_NODE_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "portid", NSS_STATS_SINGLE_CORE); - size_wr += nss_stats_fill_common_stats(NSS_PORTID_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "portid"); - - /* - * PortID node stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_PORTID_STATS_MAX); i++) { - stats_shadow[i] = nss_portid_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - - size_wr += nss_stats_print("portid", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_portid_stats_str - , stats_shadow - , NSS_PORTID_STATS_MAX - , lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_portid_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(portid) - -/* - * nss_portid_stats_dentry_create() - * Create portid node statistics debug entry. - */ -void nss_portid_stats_dentry_create(void) -{ - nss_stats_create_dentry("portid", &nss_portid_stats_ops); -} - -/* - * nss_portid_stats_sync() - * Update portid node stats. - */ -void nss_portid_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_portid_stats_sync_msg *npsm) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_portid_handle *hdl; - int j; - - if (npsm->port_id == NSS_PORTID_MAX_SWITCH_PORT) { - /* - * Update PORTID base node stats. - */ - spin_lock_bh(&nss_top->stats_lock); - nss_top->stats_node[NSS_PORTID_INTERFACE][NSS_STATS_NODE_RX_PKTS] += npsm->node_stats.rx_packets; - nss_top->stats_node[NSS_PORTID_INTERFACE][NSS_STATS_NODE_RX_BYTES] += npsm->node_stats.rx_bytes; - nss_top->stats_node[NSS_PORTID_INTERFACE][NSS_STATS_NODE_TX_PKTS] += npsm->node_stats.tx_packets; - nss_top->stats_node[NSS_PORTID_INTERFACE][NSS_STATS_NODE_TX_BYTES] += npsm->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_top->stats_node[NSS_PORTID_INTERFACE][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += npsm->node_stats.rx_dropped[j]; - } - - nss_portid_stats[NSS_PORTID_STATS_RX_INVALID_HEADER] += npsm->rx_invalid_header; - spin_unlock_bh(&nss_top->stats_lock); - return; - } - - if (npsm->port_id >= NSS_PORTID_MAX_SWITCH_PORT) { - nss_warning("port_id %d exceeds NSS_PORTID_MAX_SWITCH_PORT\n", npsm->port_id); - return; - } - - /* - * Update PORTID interface stats. - */ - spin_lock_bh(&nss_portid_spinlock); - hdl = &nss_portid_hdl[npsm->port_id]; - if (hdl->if_num == 0) { - nss_warning("%px: nss_portid recv'd stats with unconfigured port %d", nss_ctx, npsm->port_id); - spin_unlock_bh(&nss_portid_spinlock); - return; - } - hdl->stats.rx_packets += npsm->node_stats.rx_packets; - hdl->stats.rx_bytes += npsm->node_stats.rx_bytes; - hdl->stats.rx_dropped += nss_cmn_rx_dropped_sum(&npsm->node_stats); - hdl->stats.tx_packets += npsm->node_stats.tx_packets; - hdl->stats.tx_bytes += npsm->node_stats.tx_bytes; - spin_unlock_bh(&nss_portid_spinlock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_portid_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_portid_stats.h deleted file mode 100644 index b1a1ee5b7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_portid_stats.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_PORTID_STATS_H -#define __NSS_PORTID_STATS_H - -/* - * PortID statistics - */ -enum nss_portid_stats_types { - NSS_PORTID_STATS_RX_INVALID_HEADER, - NSS_PORTID_STATS_MAX, -}; - -struct nss_portid_handle { - uint32_t if_num; /**< Interface number */ - struct rtnl_link_stats64 stats; /**< statistics counters */ -}; - -/* - * PortID statistics APIs - */ -extern void nss_portid_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_portid_stats_sync_msg *npsm); -extern void nss_portid_stats_dentry_create(void); - -#endif /* __NSS_PORTID_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe.c deleted file mode 100644 index 46ce217b6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2018, 2020-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_ppe.h" -#include "nss_ppe_stats.h" -#include "nss_ppe_strings.h" - -DEFINE_SPINLOCK(nss_ppe_stats_lock); - -struct nss_ppe_stats_debug nss_ppe_debug_stats; -struct nss_ppe_pvt ppe_pvt; - -/* - * nss_ppe_verify_ifnum() - * Verify PPE interface number. - */ -static inline bool nss_ppe_verify_ifnum(int if_num) -{ - return nss_is_dynamic_interface(if_num) || (if_num == NSS_PPE_INTERFACE); -} - -/* - * nss_ppe_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_ppe_callback(void *app_data, struct nss_ppe_msg *npm) -{ - nss_ppe_msg_callback_t callback = (nss_ppe_msg_callback_t)ppe_pvt.cb; - void *data = ppe_pvt.app_data; - - ppe_pvt.response = NSS_TX_SUCCESS; - ppe_pvt.cb = NULL; - ppe_pvt.app_data = NULL; - - if (npm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("ppe error response %d\n", npm->cm.response); - ppe_pvt.response = npm->cm.response; - } - - if (callback) { - callback(data, npm); - } - complete(&ppe_pvt.complete); -} - -/* - * nss_ppe_tx_msg() - * Transmit a ppe message to NSSFW - */ -nss_tx_status_t nss_ppe_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_ppe_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace messages. - */ - nss_ppe_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (ncm->type >= NSS_PPE_MSG_MAX) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - if (!nss_ppe_verify_ifnum(ncm->interface)) { - nss_warning("%px: invalid interface %d\n", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_ppe_tx_msg_sync() - * Transmit a ppe message to NSS firmware synchronously. - */ -nss_tx_status_t nss_ppe_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_msg *npm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&ppe_pvt.sem); - ppe_pvt.cb = (void *)npm->cm.cb; - ppe_pvt.app_data = (void *)npm->cm.app_data; - - npm->cm.cb = (nss_ptr_t)nss_ppe_callback; - npm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_ppe_tx_msg(nss_ctx, npm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: ppe_tx_msg failed\n", nss_ctx); - up(&ppe_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&ppe_pvt.complete, msecs_to_jiffies(NSS_PPE_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: ppe msg tx failed due to timeout\n", nss_ctx); - ppe_pvt.response = NSS_TX_FAILURE; - } - - status = ppe_pvt.response; - up(&ppe_pvt.sem); - return status; -} - -/* - * nss_ppe_get_context() - * Get NSS context instance for ppe - */ -struct nss_ctx_instance *nss_ppe_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.ppe_handler_id]; -} - -/* - * nss_ppe_msg_init() - * Initialize nss_ppe_msg. - */ -void nss_ppe_msg_init(struct nss_ppe_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} - -/* - * nss_ppe_tx_ipsec_config_msg - * API to send inline IPsec port configure message to NSS FW - */ -nss_tx_status_t nss_ppe_tx_ipsec_config_msg(uint32_t nss_ifnum, uint32_t vsi_num, uint16_t mtu, - __attribute__((unused))uint16_t mru) -{ - struct nss_ctx_instance *nss_ctx = nss_ppe_get_context(); - struct nss_ppe_msg npm = {0}; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (vsi_num >= NSS_PPE_VSI_NUM_MAX) { - nss_warning("Invalid vsi number:%u\n", vsi_num); - return NSS_TX_FAILURE; - } - - nss_ppe_msg_init(&npm, NSS_PPE_INTERFACE, NSS_PPE_MSG_IPSEC_PORT_CONFIG, - sizeof(struct nss_ppe_ipsec_port_config_msg), NULL, NULL); - - npm.msg.ipsec_config.nss_ifnum = nss_ifnum; - npm.msg.ipsec_config.vsi_num = vsi_num; - npm.msg.ipsec_config.mtu = mtu; - - return nss_ppe_tx_msg_sync(nss_ctx, &npm); -} - -/* - * nss_ppe_tx_ipsec_mtu_msg - * API to send IPsec port MTU change message to NSS FW - */ -nss_tx_status_t nss_ppe_tx_ipsec_mtu_msg(uint32_t nss_ifnum, uint16_t mtu, __attribute__((unused))uint16_t mru) -{ - struct nss_ctx_instance *nss_ctx = nss_ppe_get_context(); - struct nss_ppe_msg npm = {0}; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - nss_ppe_msg_init(&npm, NSS_PPE_INTERFACE, NSS_PPE_MSG_IPSEC_PORT_MTU_CHANGE, - sizeof(struct nss_ppe_ipsec_port_mtu_msg), NULL, NULL); - - npm.msg.ipsec_mtu.nss_ifnum = nss_ifnum; - npm.msg.ipsec_mtu.mtu = mtu; - - return nss_ppe_tx_msg_sync(nss_ctx, &npm); -} - -/* - * nss_ppe_tx_ipsec_add_intf_msg - * API to attach NSS interface to IPsec port - */ -nss_tx_status_t nss_ppe_tx_ipsec_add_intf_msg(uint32_t nss_ifnum) -{ - struct nss_ctx_instance *nss_ctx = nss_ppe_get_context(); - struct nss_ppe_msg npm = {0}; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - nss_ppe_msg_init(&npm, NSS_PPE_INTERFACE, NSS_PPE_MSG_IPSEC_ADD_INTF, - sizeof(struct nss_ppe_ipsec_add_intf_msg), NULL, NULL); - - npm.msg.ipsec_addif.nss_ifnum = nss_ifnum; - - return nss_ppe_tx_msg_sync(nss_ctx, &npm); -} - -/* - * nss_ppe_tx_ipsec_del_intf_msg - * API to detach NSS interface to IPsec port - */ -nss_tx_status_t nss_ppe_tx_ipsec_del_intf_msg(uint32_t nss_ifnum) -{ - struct nss_ctx_instance *nss_ctx = nss_ppe_get_context(); - struct nss_ppe_msg npm = {0}; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - nss_ppe_msg_init(&npm, NSS_PPE_INTERFACE, NSS_PPE_MSG_IPSEC_DEL_INTF, - sizeof(struct nss_ppe_ipsec_del_intf_msg), NULL, NULL); - - npm.msg.ipsec_delif.nss_ifnum = nss_ifnum; - - return nss_ppe_tx_msg_sync(nss_ctx, &npm); -} - -/* - * nss_ppe_handler() - * Handle NSS -> HLOS messages for ppe - */ -static void nss_ppe_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_ppe_msg *msg = (struct nss_ppe_msg *)ncm; - void *ctx; - - nss_ppe_msg_callback_t cb; - - nss_trace("nss_ctx: %px ppe msg: %px\n", nss_ctx, msg); - BUG_ON(!nss_ppe_verify_ifnum(ncm->interface)); - - /* - * Trace messages. - */ - nss_ppe_log_rx_msg(msg); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_PPE_MSG_MAX) { - nss_warning("%px: received invalid message %d for PPE interface\n", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_ppe_msg)) { - nss_warning("%px: Length of message is greater than required: %d\n", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - switch (msg->cm.type) { - case NSS_PPE_MSG_SYNC_STATS: - /* - * session debug stats embeded in session stats msg - */ - nss_ppe_stats_sync(nss_ctx, &msg->msg.stats, ncm->interface); - nss_ppe_stats_notify(nss_ctx, ncm->interface); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_ppe_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - cb(ctx, msg); -} - -/* - * nss_ppe_register_handler() - * debugfs stats msg handler received on static ppe interface - * - * TODO: Export API so that others can also read PPE stats. - */ -void nss_ppe_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_ppe_get_context(); - - nss_core_register_handler(nss_ctx, NSS_PPE_INTERFACE, nss_ppe_handler, NULL); - - if (nss_ppe_debug_stats.valid) { - nss_ppe_stats_dentry_create(); - nss_ppe_strings_dentry_create(); - } -} - -/* - * nss_ppe_free() - * Uninitialize PPE base - */ -void nss_ppe_free(void) -{ - /* - * Check if PPE base is already uninitialized. - */ - if (!ppe_pvt.ppe_base) { - return; - } - - /* - * Unmap PPE base address - */ - iounmap(ppe_pvt.ppe_base); - ppe_pvt.ppe_base = NULL; - - spin_lock_bh(&nss_ppe_stats_lock); - nss_ppe_debug_stats.valid = false; - nss_ppe_debug_stats.if_num = 0; - nss_ppe_debug_stats.if_index = 0; - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_init() - * Initialize PPE base - */ -void nss_ppe_init(void) -{ - /* - * Check if PPE base is already initialized. - */ - if (ppe_pvt.ppe_base) { - return; - } - - /* - * Get the PPE base address - */ - ppe_pvt.ppe_base = ioremap_nocache(PPE_BASE_ADDR, PPE_REG_SIZE); - if (!ppe_pvt.ppe_base) { - nss_warning("DRV can't get PPE base address\n"); - return; - } - - spin_lock_bh(&nss_ppe_stats_lock); - nss_ppe_debug_stats.valid = true; - nss_ppe_debug_stats.if_num = 0; - nss_ppe_debug_stats.if_index = 0; - spin_unlock_bh(&nss_ppe_stats_lock); - - sema_init(&ppe_pvt.sem, 1); - init_completion(&ppe_pvt.complete); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe.h deleted file mode 100644 index d71021145..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe.h +++ /dev/null @@ -1,423 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ppe.h - * NSS PPE header file - */ - -#include -#include "nss_tx_rx_common.h" - -#define PPE_BASE_ADDR 0x3a000000 -#define PPE_REG_SIZE 0x1000000 - -#define PPE_L3_DBG_WR_OFFSET 0x200c04 -#define PPE_L3_DBG_RD_OFFSET 0x200c0c -#define PPE_L3_DBG0_OFFSET 0x10001 -#define PPE_L3_DBG1_OFFSET 0x10002 -#define PPE_L3_DBG2_OFFSET 0x10003 -#define PPE_L3_DBG3_OFFSET 0x10004 -#define PPE_L3_DBG4_OFFSET 0x10005 -#define PPE_L3_DBG_PORT_OFFSET 0x11e80 - -#define PPE_PKT_CODE_WR_OFFSET 0x100080 -#define PPE_PKT_CODE_RD_OFFSET 0x100084 -#define PPE_PKT_CODE_DROP0_OFFSET 0xf000000 -#define PPE_PKT_CODE_DROP1_OFFSET 0x10000000 -#define PPE_PKT_CODE_CPU_OFFSET 0x40000000 - -#define PPE_PKT_CODE_DROP0_GET(x) (((x) & 0xe0000000) >> 29) -#define PPE_PKT_CODE_DROP1_GET(x) (((x) & 0x7) << 3) -#define PPE_PKT_CODE_DROP_GET(d0, d1) (PPE_PKT_CODE_DROP0_GET(d0) | PPE_PKT_CODE_DROP1_GET(d1)) - -#define PPE_PKT_CODE_CPU_GET(x) (((x) >> 3) & 0xff) - -#define PPE_IPE_PC_REG 0x100000 - -/* - * NSS_SYS_REG_DROP_CPU_CNT_TBL - * Address map and access APIs for DROP_CPU_CNT table. - */ -#define PPE_DROP_CPU_CNT_TBL_OFFSET 0x60000 -#define PPE_DROP_CPU_CNT_TBL_ENTRY_SIZE 0x10 -#define PPE_DROP_CPU_CNT_TBL_BASE_OFFSET (PPE_IPE_PC_REG + PPE_DROP_CPU_CNT_TBL_OFFSET) -#define PPE_CPU_CODE_MAX_NUM 256 - -/* - * CPU code offset - */ -#define PPE_CPU_CODE_OFFSET(n) (PPE_DROP_CPU_CNT_TBL_BASE_OFFSET + ((n) * PPE_DROP_CPU_CNT_TBL_ENTRY_SIZE)) - -/* - * DROP code offset - */ -#define PPE_DROP_CODE_IDX(code, src_port) (PPE_CPU_CODE_MAX_NUM + (8 * (code)) + (src_port)) -#define PPE_DROP_CODE_OFFSET(code, src_port) (PPE_DROP_CPU_CNT_TBL_BASE_OFFSET + ((PPE_DROP_CODE_IDX(code, src_port)) * PPE_DROP_CPU_CNT_TBL_ENTRY_SIZE)) - -#define NSS_PPE_TX_TIMEOUT 1000 /* 1 Second */ - -/* - * Maximum number of VSI - */ -#define NSS_PPE_VSI_NUM_MAX 32 - -/* - * ppe nss debug stats lock - */ -extern spinlock_t nss_ppe_stats_lock; - -/* - * Private data structure - */ -struct nss_ppe_pvt { - void * __iomem ppe_base; - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -}; - -/* - * Data structure to store to PPE private context - */ -extern struct nss_ppe_pvt ppe_pvt; - -/** - * nss_ppe_message_types - * Message types for Packet Processing Engine (PPE) requests and responses. - * - * Note: PPE messages are added as short term approach, expect all - * messages below to be deprecated for more integrated approach. - */ -enum nss_ppe_message_types { - NSS_PPE_MSG_SYNC_STATS, - NSS_PPE_MSG_IPSEC_PORT_CONFIG, - NSS_PPE_MSG_IPSEC_PORT_MTU_CHANGE, - NSS_PPE_MSG_IPSEC_ADD_INTF, - NSS_PPE_MSG_IPSEC_DEL_INTF, - NSS_PPE_MSG_MAX, -}; - -/** - * nss_ppe_msg_error_type - * PPE error types. - */ -enum nss_ppe_msg_error_type { - PPE_MSG_ERROR_OK, - PPE_MSG_ERROR_UNKNOWN_TYPE, - PPE_MSG_ERROR_PORT_CREATION_FAIL, - PPE_MSG_ERROR_INVALID_PORT_VSI, - PPE_MSG_ERROR_INVALID_L3_IF, - PPE_MSG_ERROR_IPSEC_PORT_CONFIG, - PPE_MSG_ERROR_IPSEC_INTF_TABLE_FULL, - PPE_MSG_ERROR_IPSEC_INTF_ATTACHED, - PPE_MSG_ERROR_IPSEC_INTF_UNATTACHED, - PPE_ERROR_MAX -}; - -/** - * nss_ppe_stats_sc - * Message structure for per service code stats. - */ -struct nss_ppe_stats_sc { - uint32_t nss_ppe_sc_cb_unregister; /* Per service-code counter for callback not registered */ - uint32_t nss_ppe_sc_cb_success; /* Per service-code coutner for successful callback */ - uint32_t nss_ppe_sc_cb_failure; /* Per service-code counter for failure callback */ -}; - -/** - * nss_ppe_stats - * Message structure for ppe general stats - */ -struct nss_ppe_stats { - uint32_t nss_ppe_v4_l3_flows; /**< Number of IPv4 routed flows. */ - uint32_t nss_ppe_v4_l2_flows; /**< Number of IPv4 bridge flows. */ - uint32_t nss_ppe_v4_create_req; /**< Number of IPv4 create requests. */ - uint32_t nss_ppe_v4_create_fail; /**< Number of IPv4 create failures. */ - uint32_t nss_ppe_v4_destroy_req; /**< Number of IPv4 delete requests. */ - uint32_t nss_ppe_v4_destroy_fail; /**< Number of IPv4 delete failures. */ - uint32_t nss_ppe_v4_mc_create_req; /**< Number of IPv4 MC create requests. */ - uint32_t nss_ppe_v4_mc_create_fail; /**< Number of IPv4 MC create failure. */ - uint32_t nss_ppe_v4_mc_update_req; /**< Number of IPv4 MC update requests. */ - uint32_t nss_ppe_v4_mc_update_fail; /**< Number of IPv4 MC update failure. */ - uint32_t nss_ppe_v4_mc_destroy_req; /**< Number of IPv4 MC delete requests. */ - uint32_t nss_ppe_v4_mc_destroy_fail; /**< Number of IPv4 MC delete failure. */ - uint32_t nss_ppe_v4_unknown_interface; /**< Number of IPv4 create failures */ - - uint32_t nss_ppe_v6_l3_flows; /**< Number of IPv6 routed flows. */ - uint32_t nss_ppe_v6_l2_flows; /**< Number of IPv6 bridge flows. */ - uint32_t nss_ppe_v6_create_req; /**< Number of IPv6 create requests. */ - uint32_t nss_ppe_v6_create_fail; /**< Number of IPv6 create failures. */ - uint32_t nss_ppe_v6_destroy_req; /**< Number of IPv6 delete requests. */ - uint32_t nss_ppe_v6_destroy_fail; /**< Number of IPv6 delete failures. */ - uint32_t nss_ppe_v6_mc_create_req; /**< Number of IPv6 MC create requests. */ - uint32_t nss_ppe_v6_mc_create_fail; /**< Number of IPv6 MC create failure. */ - uint32_t nss_ppe_v6_mc_update_req; /**< Number of IPv6 MC update requests. */ - uint32_t nss_ppe_v6_mc_update_fail; /**< Number of IPv6 MC update failure. */ - uint32_t nss_ppe_v6_mc_destroy_req; /**< Number of IPv6 MC delete requests. */ - uint32_t nss_ppe_v6_mc_destroy_fail; /**< Number of IPv6 MC delete failure. */ - uint32_t nss_ppe_v6_unknown_interface; /**< Number of IPv6 create failures */ - - uint32_t nss_ppe_fail_vp_full; - /**< Request failed because the virtual port table is full */ - uint32_t nss_ppe_fail_nh_full; - /**< Request failed because the next hop table is full. */ - uint32_t nss_ppe_fail_flow_full; - /**< Request failed because the flow table is full. */ - uint32_t nss_ppe_fail_host_full; - /**< Request failed because the host table is full. */ - uint32_t nss_ppe_fail_pubip_full; - /**< Request failed because the public IP table is full. */ - uint32_t nss_ppe_fail_port_setup; - /**< Request failed because the PPE port is not setup. */ - uint32_t nss_ppe_fail_rw_fifo_full; - /**< Request failed because the read/write FIFO is full. */ - uint32_t nss_ppe_fail_flow_command; - /**< Request failed because the PPE flow command failed. */ - uint32_t nss_ppe_fail_unknown_proto; - /**< Request failed because of an unknown protocol. */ - uint32_t nss_ppe_fail_ppe_unresponsive; - /**< Request failed because the PPE is not responding. */ - uint32_t nss_ppe_ce_opaque_invalid; - /**< Request failed because of invalid opaque in connection entry. */ - uint32_t nss_ppe_fail_fqg_full; - /**< Request failed because the flow QoS group is full. */ -}; - - -/** - * nss_ppe_sync_stats_msg - * Message information for PPE synchronization statistics. - */ -struct nss_ppe_sync_stats_msg { - struct nss_ppe_stats stats; /**< General stats */ - struct nss_ppe_stats_sc sc_stats[NSS_PPE_SC_MAX]; - /**< Per service-code stats */ -}; - -/** - * nss_ppe_ipsec_port_config_msg - * Message structure for inline IPsec port configuration. - */ -struct nss_ppe_ipsec_port_config_msg { - uint32_t nss_ifnum; /**< NSS interface number corresponding to inline IPsec port. */ - uint16_t mtu; /**< MTU value for inline IPsec port. */ - uint8_t vsi_num; /**< Default port VSI for inline IPsec port. */ -}; - -/** - * nss_ppe_ipsec_port_mtu_msg - * Message structure for inline IPsec port MTU change. - */ -struct nss_ppe_ipsec_port_mtu_msg { - uint32_t nss_ifnum; /**< NSS interface number corresponding to inline IPsec port. */ - uint16_t mtu; /**< MTU value for inline IPsec port. */ -}; - -/** - * nss_ppe_ipsec_add_intf_msg - * Message structure for adding dynamic IPsec/DTLS interface to inline IPsec port. - */ -struct nss_ppe_ipsec_add_intf_msg { - uint32_t nss_ifnum; /**< Dynamic IPsec/DTLS interface number. */ -}; - -/** - * nss_ppe_ipsec_del_intf_msg - * Message structure for deleting dynamic IPsec/DTLS interface to inline IPsec port. - */ -struct nss_ppe_ipsec_del_intf_msg { - uint32_t nss_ifnum; /**< Dynamic IPsec/DTLS interface number. */ -}; - -/** - * nss_ppe_msg - * Data for sending and receiving PPE host-to-NSS messages. - */ -struct nss_ppe_msg { - struct nss_cmn_msg cm; /**< Common message header. */ - - /** - * Payload of a PPE host-to-NSS message. - */ - union { - struct nss_ppe_sync_stats_msg stats; - /**< Synchronization statistics. */ - struct nss_ppe_ipsec_port_config_msg ipsec_config; - /**< PPE inline IPsec port configuration message. */ - struct nss_ppe_ipsec_port_mtu_msg ipsec_mtu; - /**< Inline IPsec port MTU change message. */ - struct nss_ppe_ipsec_add_intf_msg ipsec_addif; - /**< Inline IPsec NSS interface attach message. */ - struct nss_ppe_ipsec_del_intf_msg ipsec_delif; - /**< Inline IPsec NSS interface detach message. */ - } msg; /**< Message payload. */ -}; - -/** - * Callback function for receiving PPE messages. - * - * @datatypes - * nss_ppe_msg - * - * @param[in] app_data Pointer to the application context of the message. - * @param[in] msg Pointer to the message data. - */ -typedef void (*nss_ppe_msg_callback_t)(void *app_data, struct nss_ppe_msg *msg); - -/** - * nss_ppe_tx_msg - * Sends PPE messages to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ppe_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_ppe_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_ppe_msg *msg); - -/** - * nss_ppe_tx_msg_sync - * Sends PPE messages synchronously to the NSS. - * - * @datatypes - * nss_ctx_instance \n - * nss_ppe_msg - * - * @param[in] nss_ctx Pointer to the NSS context. - * @param[in,out] msg Pointer to the message data. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_ppe_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_msg *msg); - -/** - * nss_ppe_msg_init - * Initializes a PPE message. - * - * @datatypes - * nss_ppe_msg - * - * @param[in,out] ncm Pointer to the message. - * @param[in] if_num Interface number - * @param[in] type Type of message. - * @param[in] len Size of the payload. - * @param[in] cb Callback function for the message. - * @param[in] app_data Pointer to the application context of the message. - * - * @return - * None. - */ -void nss_ppe_msg_init(struct nss_ppe_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data); - -/** - * nss_ppe_get_context - * Gets the PPE context used in nss_ppe_tx. - * - * @return - * Pointer to the NSS core context. - */ -struct nss_ctx_instance *nss_ppe_get_context(void); - -/** - * nss_ppe_tx_ipsec_config_msg - * Sends the PPE a message to configure inline IPsec port. - * - * @param[in] if_num Static IPsec interface number. - * @param[in] vsi_num Default VSI number associated with inline IPsec port. - * @param[in] mtu Default MTU of static inline IPsec port. - * @param[in] mru Default MRU of static inline IPsec port. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_ppe_tx_ipsec_config_msg(uint32_t nss_ifnum, uint32_t vsi_num, uint16_t mtu, uint16_t mru); - -/** - * nss_ppe_tx_ipsec_mtu_msg - * Sends the PPE a message to configure MTU value on IPsec port. - * - * @param[in] nss_ifnum Static IPsec interface number. - * @param[in] mtu MTU of static IPsec interface. - * @param[in] mru MRU of static IPsec interface. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_ppe_tx_ipsec_mtu_msg(uint32_t nss_ifnum, uint16_t mtu, uint16_t mru); - -/** - * nss_ppe_tx_ipsec_add_intf_msg - * Sends the PPE a message to attach a dynamic interface number to IPsec port. - * - * @param[in] if_num Dynamic IPsec/DTLS interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_ppe_tx_ipsec_add_intf_msg(uint32_t nss_ifnum); - -/** - * nss_ppe_tx_ipsec_del_intf_msg - * Sends the PPE a message to detach a dynamic interface number to IPsec port. - * - * @param[in] if_num Dynamic IPsec/DTLS interface number. - * - * @return - * Status of the Tx operation. - */ -nss_tx_status_t nss_ppe_tx_ipsec_del_intf_msg(uint32_t nss_ifnum); - -/* - * nss_ppe_reg_read() - */ -static inline void nss_ppe_reg_read(u32 reg, u32 *val) -{ - *val = readl((ppe_pvt.ppe_base + reg)); -} - -/* - * nss_ppe_reg_write() - */ -static inline void nss_ppe_reg_write(u32 reg, u32 val) -{ - writel(val, (ppe_pvt.ppe_base + reg)); -} - -/* - * nss_ppe_log.h - * NSS PPE Log Header File - */ - -/* - * nss_ppe_log_tx_msg - * Logs a ppe message that is sent to the NSS firmware. - */ -void nss_ppe_log_tx_msg(struct nss_ppe_msg *npm); - -/* - * nss_ppe_log_rx_msg - * Logs a ppe message that is received from the NSS firmware. - */ -void nss_ppe_log_rx_msg(struct nss_ppe_msg *npm); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_log.c deleted file mode 100644 index a6517322b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_log.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ppe_log.c - * NSS PPE logger file. - */ - -#include "nss_core.h" -#include "nss_ppe.h" - -/* - * nss_ppe_log_message_types_str - * PPE message strings - */ -static int8_t *nss_ppe_log_message_types_str[NSS_PPE_MSG_MAX] __maybe_unused = { - "PPE Stats", - "PPE IPSEC Port Config", - "PPE IPSEC Port MTU Change", - "PPE IPSEC Add Interface", - "PPE IPSEC Del Interface", -}; - -/* - * nss_ppe_log_error_response_types_str - * Strings for error types for PPE messages - */ -static int8_t *nss_ppe_log_error_response_types_str[PPE_ERROR_MAX] __maybe_unused = { - "PPE No Error", - "PPE Uknown Type", - "PPE Port Creation Failure", - "PPE Invalid Port VSI", - "PPE Invalid L3 Interface", - "PPE IPSEC Port Config Error", - "PPE IPSEC Interface Table Full", - "PPE IPSEC Interface Attached", - "PPE IPSEC Interface Unattached", -}; - -/* - * nss_ppe_log_port_config_msg() - * Log NSS PPE port config message. - */ -static void nss_ppe_log_port_config_msg(struct nss_ppe_msg *npm) -{ - struct nss_ppe_ipsec_port_config_msg *npcm __maybe_unused = &npm->msg.ipsec_config; - nss_trace("%px: NSS PPE Port Configure Message:\n" - "PPE NSS Interface Number: %d\n" - "PPE MTU: %d\n" - "PPE VSI Number: %d\n", - npcm, npcm->nss_ifnum, - npcm->mtu, npcm->vsi_num); -} - -/* - * nss_ppe_log_port_mtu_msg() - * Log NSS PPE port mtu message. - */ -static void nss_ppe_log_port_mtu_msg(struct nss_ppe_msg *npm) -{ - struct nss_ppe_ipsec_port_mtu_msg *npmm __maybe_unused = &npm->msg.ipsec_mtu; - nss_trace("%px: NSS PPE Port Configure Message:\n" - "PPE NSS Interface Number: %d\n" - "PPE MTU: %d\n", - npmm, npmm->nss_ifnum, - npmm->mtu); -} - -/* - * nss_ppe_log_add_intf_msg() - * Log NSS PPE IPSEC Add Interface Message. - */ -static void nss_ppe_log_add_intf_msg(struct nss_ppe_msg *npm) -{ - struct nss_ppe_ipsec_add_intf_msg *npam __maybe_unused = &npm->msg.ipsec_addif; - nss_trace("%px: NSS PPE IPSEC add Interface Message:\n" - "PPE NSS Interface Number: %d\n", - npam, npam->nss_ifnum); -} - -/* - * nss_ppe_log_del_intf_msg() - * Log NSS PPE IPSEC Delete Interface Message. - */ -static void nss_ppe_log_del_intf_msg(struct nss_ppe_msg *npm) -{ - struct nss_ppe_ipsec_del_intf_msg *npdm __maybe_unused = &npm->msg.ipsec_delif; - nss_trace("%px: NSS PPE IPSEC Delete Interface Message:\n" - "PPE NSS Interface Number: %d\n", - npdm, npdm->nss_ifnum); -} - -/* - * nss_ppe_log_verbose() - * Log message contents. - */ -static void nss_ppe_log_verbose(struct nss_ppe_msg *npm) -{ - switch (npm->cm.type) { - case NSS_PPE_MSG_IPSEC_PORT_CONFIG: - nss_ppe_log_port_config_msg(npm); - break; - - case NSS_PPE_MSG_IPSEC_PORT_MTU_CHANGE: - nss_ppe_log_port_mtu_msg(npm); - break; - - case NSS_PPE_MSG_IPSEC_ADD_INTF: - nss_ppe_log_add_intf_msg(npm); - break; - - case NSS_PPE_MSG_IPSEC_DEL_INTF: - nss_ppe_log_del_intf_msg(npm); - break; - - case NSS_PPE_MSG_SYNC_STATS: - /* - * No log for valid stats message. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", npm); - break; - } -} - -/* - * nss_ppe_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_ppe_log_tx_msg(struct nss_ppe_msg *npm) -{ - if (npm->cm.type >= NSS_PPE_MSG_MAX) { - nss_warning("%px: Invalid message type\n", npm); - return; - } - - nss_info("%px: type[%d]:%s\n", npm, npm->cm.type, nss_ppe_log_message_types_str[npm->cm.type]); - nss_ppe_log_verbose(npm); -} - -/* - * nss_ppe_log_rx_msg() - * Log messages received from FW. - */ -void nss_ppe_log_rx_msg(struct nss_ppe_msg *npm) -{ - if (npm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", npm); - return; - } - - if (npm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", npm, npm->cm.type, - nss_ppe_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response]); - goto verbose; - } - - if (npm->cm.error >= PPE_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - npm, npm->cm.type, nss_ppe_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response], - npm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - npm, npm->cm.type, nss_ppe_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response], - npm->cm.error, nss_ppe_log_error_response_types_str[npm->cm.error]); - -verbose: - nss_ppe_log_verbose(npm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.c deleted file mode 100644 index e544856ed..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.c +++ /dev/null @@ -1,925 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_ppe.h" -#include "nss_ppe_stats.h" -#include "nss_ppe_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_ppe_stats_notifier); - -static uint8_t ppe_cc_nonexception[NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX] = { - NSS_PPE_STATS_CPU_CODE_EXP_FAKE_L2_PROT_ERR, - NSS_PPE_STATS_CPU_CODE_EXP_FAKE_MAC_HEADER_ERR, - NSS_PPE_STATS_CPU_CODE_EXP_BITMAP_MAX, - NSS_PPE_STATS_CPU_CODE_L2_EXP_MRU_FAIL, - NSS_PPE_STATS_CPU_CODE_L2_EXP_MTU_FAIL, - NSS_PPE_STATS_CPU_CODE_L3_EXP_IP_PREFIX_BC, - NSS_PPE_STATS_CPU_CODE_L3_EXP_MTU_FAIL, - NSS_PPE_STATS_CPU_CODE_L3_EXP_MRU_FAIL, - NSS_PPE_STATS_CPU_CODE_L3_EXP_ICMP_RDT, - NSS_PPE_STATS_CPU_CODE_L3_EXP_IP_RT_TTL1_TO_ME, - NSS_PPE_STATS_CPU_CODE_L3_EXP_IP_RT_TTL_ZERO, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_SERVICE_CODE_LOOP, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_DE_ACCELERATE, - NSS_PPE_STATS_CPU_CODE_L3_EXP_FLOW_SRC_IF_CHK_FAIL, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH, - NSS_PPE_STATS_CPU_CODE_L3_EXP_MTU_DF_FAIL, - NSS_PPE_STATS_CPU_CODE_L3_EXP_PPPOE_MULTICAST, - NSS_PPE_STATS_CPU_CODE_MGMT_OFFSET, - NSS_PPE_STATS_CPU_CODE_MGMT_EAPOL, - NSS_PPE_STATS_CPU_CODE_MGMT_PPPOE_DIS, - NSS_PPE_STATS_CPU_CODE_MGMT_IGMP, - NSS_PPE_STATS_CPU_CODE_MGMT_ARP_REQ, - NSS_PPE_STATS_CPU_CODE_MGMT_ARP_REP, - NSS_PPE_STATS_CPU_CODE_MGMT_DHCPv4, - NSS_PPE_STATS_CPU_CODE_MGMT_MLD, - NSS_PPE_STATS_CPU_CODE_MGMT_NS, - NSS_PPE_STATS_CPU_CODE_MGMT_NA, - NSS_PPE_STATS_CPU_CODE_MGMT_DHCPv6, - NSS_PPE_STATS_CPU_CODE_PTP_OFFSET, - NSS_PPE_STATS_CPU_CODE_PTP_SYNC, - NSS_PPE_STATS_CPU_CODE_PTP_FOLLOW_UP, - NSS_PPE_STATS_CPU_CODE_PTP_DELAY_REQ, - NSS_PPE_STATS_CPU_CODE_PTP_DELAY_RESP, - NSS_PPE_STATS_CPU_CODE_PTP_PDELAY_REQ, - NSS_PPE_STATS_CPU_CODE_PTP_PDELAY_RESP, - NSS_PPE_STATS_CPU_CODE_PTP_PDELAY_RESP_FOLLOW_UP, - NSS_PPE_STATS_CPU_CODE_PTP_ANNOUNCE, - NSS_PPE_STATS_CPU_CODE_PTP_MANAGEMENT, - NSS_PPE_STATS_CPU_CODE_PTP_SIGNALING, - NSS_PPE_STATS_CPU_CODE_PTP_PKT_RSV_MSG, - NSS_PPE_STATS_CPU_CODE_IPV4_SG_UNKNOWN, - NSS_PPE_STATS_CPU_CODE_IPV6_SG_UNKNOWN, - NSS_PPE_STATS_CPU_CODE_ARP_SG_UNKNOWN, - NSS_PPE_STATS_CPU_CODE_ND_SG_UNKNOWN, - NSS_PPE_STATS_CPU_CODE_IPV4_SG_VIO, - NSS_PPE_STATS_CPU_CODE_IPV6_SG_VIO, - NSS_PPE_STATS_CPU_CODE_ARP_SG_VIO, - NSS_PPE_STATS_CPU_CODE_ND_SG_VIO, - NSS_PPE_STATS_CPU_CODE_L3_ROUTING_IP_TO_ME, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_SNAT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_DNAT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_RT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_BR_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_MC_BRIDGE_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_RT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_SNAPT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_DNAPT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_SNAT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_DNAT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_PREHEAD_NAT_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_PREHEAD_NAT_ERROR, - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_NH_INVALID_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_PREHEAD_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_BRIDGE_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_ACTION, - NSS_PPE_STATS_CPU_CODE_L3_FLOW_MISS_ACTION, - NSS_PPE_STATS_CPU_CODE_L2_NEW_MAC_ADDRESS, - NSS_PPE_STATS_CPU_CODE_L2_HASH_COLLISION, - NSS_PPE_STATS_CPU_CODE_L2_STATION_MOVE, - NSS_PPE_STATS_CPU_CODE_L2_LEARN_LIMIT, - NSS_PPE_STATS_CPU_CODE_L2_SA_LOOKUP_ACTION, - NSS_PPE_STATS_CPU_CODE_L2_DA_LOOKUP_ACTION, - NSS_PPE_STATS_CPU_CODE_APP_CTRL_ACTION, - NSS_PPE_STATS_CPU_CODE_IN_VLAN_FILTER_ACTION, - NSS_PPE_STATS_CPU_CODE_IN_VLAN_XLT_MISS, - NSS_PPE_STATS_CPU_CODE_EG_VLAN_FILTER_DROP, - NSS_PPE_STATS_CPU_CODE_ACL_PRE_ACTION, - NSS_PPE_STATS_CPU_CODE_ACL_POST_ACTION, - NSS_PPE_STATS_CPU_CODE_SERVICE_CODE_ACTION, -}; - -/* - * nss_ppe_stats_str_sc_type - * PPE service-code stats type - */ -static int8_t *nss_ppe_stats_str_sc_type[NSS_PPE_SC_MAX] = { - "SC_NONE ", - "SC_BYPASS_ALL ", - "SC_ADV_QOS_BRIDGED", - "SC_BR_QOS ", - "SC_BNC_0 ", - "SC_BNC_CMPL_0 ", - "SC_ADV_QOS_ROUTED ", - "SC_IPSEC_PPE2EIP ", - "SC_IPSEC_EIP2PPE ", - "SC_PTP ", - "SC_VLAN_FILTER ", - "SC_L3_EXCEPT ", -}; - -/* - * nss_ppe_stats_sync - * PPE connection sync statistics from NSS - */ -void nss_ppe_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_sync_stats_msg *stats_msg, uint16_t if_num) -{ - uint32_t sc; - spin_lock_bh(&nss_ppe_stats_lock); - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_L3_FLOWS] = stats_msg->stats.nss_ppe_v4_l3_flows; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_L2_FLOWS] = stats_msg->stats.nss_ppe_v4_l2_flows; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_CREATE_REQ] += stats_msg->stats.nss_ppe_v4_create_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_CREATE_FAIL] += stats_msg->stats.nss_ppe_v4_create_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_DESTROY_REQ] += stats_msg->stats.nss_ppe_v4_destroy_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_DESTROY_FAIL] += stats_msg->stats.nss_ppe_v4_destroy_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_MC_CREATE_REQ] += stats_msg->stats.nss_ppe_v4_mc_create_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_MC_CREATE_FAIL] += stats_msg->stats.nss_ppe_v4_mc_create_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_MC_UPDATE_REQ] += stats_msg->stats.nss_ppe_v4_mc_update_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_MC_UPDATE_FAIL] += stats_msg->stats.nss_ppe_v4_mc_update_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_MC_DESTROY_REQ] += stats_msg->stats.nss_ppe_v4_mc_destroy_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_MC_DESTROY_FAIL] += stats_msg->stats.nss_ppe_v4_mc_destroy_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V4_UNKNOWN_INTERFACE] += stats_msg->stats.nss_ppe_v4_unknown_interface; - - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_L3_FLOWS] = stats_msg->stats.nss_ppe_v6_l3_flows; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_L2_FLOWS] = stats_msg->stats.nss_ppe_v6_l2_flows; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_CREATE_REQ] += stats_msg->stats.nss_ppe_v6_create_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_CREATE_FAIL] += stats_msg->stats.nss_ppe_v6_create_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_DESTROY_REQ] += stats_msg->stats.nss_ppe_v6_destroy_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_DESTROY_FAIL] += stats_msg->stats.nss_ppe_v6_destroy_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_MC_CREATE_REQ] += stats_msg->stats.nss_ppe_v6_mc_create_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_MC_CREATE_FAIL] += stats_msg->stats.nss_ppe_v6_mc_create_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_MC_UPDATE_REQ] += stats_msg->stats.nss_ppe_v6_mc_update_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_MC_UPDATE_FAIL] += stats_msg->stats.nss_ppe_v6_mc_update_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_MC_DESTROY_REQ] += stats_msg->stats.nss_ppe_v6_mc_destroy_req; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_MC_DESTROY_FAIL] += stats_msg->stats.nss_ppe_v6_mc_destroy_fail; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_V6_UNKNOWN_INTERFACE] += stats_msg->stats.nss_ppe_v6_unknown_interface; - - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_VP_FULL] += stats_msg->stats.nss_ppe_fail_vp_full; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_NH_FULL] += stats_msg->stats.nss_ppe_fail_nh_full; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_FLOW_FULL] += stats_msg->stats.nss_ppe_fail_flow_full; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_HOST_FULL] += stats_msg->stats.nss_ppe_fail_host_full; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_PUBIP_FULL] += stats_msg->stats.nss_ppe_fail_pubip_full; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_PORT_SETUP] += stats_msg->stats.nss_ppe_fail_port_setup; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_RW_FIFO_FULL] += stats_msg->stats.nss_ppe_fail_rw_fifo_full; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_FLOW_COMMAND] += stats_msg->stats.nss_ppe_fail_flow_command; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_UNKNOWN_PROTO] += stats_msg->stats.nss_ppe_fail_unknown_proto; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_PPE_UNRESPONSIVE] += stats_msg->stats.nss_ppe_fail_ppe_unresponsive; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_CE_OPAQUE_INVALID] += stats_msg->stats.nss_ppe_ce_opaque_invalid; - nss_ppe_debug_stats.conn_stats[NSS_PPE_STATS_FAIL_FQG_FULL] += stats_msg->stats.nss_ppe_fail_fqg_full; - - /* - * Update service-code stats. - */ - for (sc = 0; sc < NSS_PPE_SC_MAX; sc++) { - nss_ppe_debug_stats.sc_stats[sc].nss_ppe_sc_cb_unregister += stats_msg->sc_stats[sc].nss_ppe_sc_cb_unregister; - nss_ppe_debug_stats.sc_stats[sc].nss_ppe_sc_cb_success += stats_msg->sc_stats[sc].nss_ppe_sc_cb_success; - nss_ppe_debug_stats.sc_stats[sc].nss_ppe_sc_cb_failure += stats_msg->sc_stats[sc].nss_ppe_sc_cb_failure; - } - - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_stats_conn_get() - * Get PPE connection statistics. - */ -static void nss_ppe_stats_conn_get(uint64_t *stats) -{ - if (!stats) { - nss_warning("No memory to copy ppe connection stats"); - return; - } - - /* - * Get flow stats - */ - spin_lock_bh(&nss_ppe_stats_lock); - memcpy(stats, nss_ppe_debug_stats.conn_stats, (sizeof(uint64_t) * NSS_PPE_STATS_CONN_MAX)); - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_stats_sc_get() - * Get PPE service-code statistics. - */ -static void nss_ppe_stats_sc_get(struct nss_ppe_sc_stats_debug *sc_stats) -{ - if (!sc_stats) { - nss_warning("No memory to copy ppe service code stats"); - return; - } - - /* - * Get flow stats - */ - spin_lock_bh(&nss_ppe_stats_lock); - memcpy(sc_stats, nss_ppe_debug_stats.sc_stats, (sizeof(struct nss_ppe_sc_stats_debug) * NSS_PPE_SC_MAX)); - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_stats_l3_get() - * Get PPE L3 debug statistics. - */ -static void nss_ppe_stats_l3_get(uint32_t *stats) -{ - if (!stats) { - nss_warning("No memory to copy ppe l3 dbg stats\n"); - return; - } - - spin_lock_bh(&nss_ppe_stats_lock); - nss_ppe_reg_write(PPE_L3_DBG_WR_OFFSET, PPE_L3_DBG0_OFFSET); - nss_ppe_reg_read(PPE_L3_DBG_RD_OFFSET, &stats[NSS_PPE_STATS_L3_DBG_0]); - - nss_ppe_reg_write(PPE_L3_DBG_WR_OFFSET, PPE_L3_DBG1_OFFSET); - nss_ppe_reg_read(PPE_L3_DBG_RD_OFFSET, &stats[NSS_PPE_STATS_L3_DBG_1]); - - nss_ppe_reg_write(PPE_L3_DBG_WR_OFFSET, PPE_L3_DBG2_OFFSET); - nss_ppe_reg_read(PPE_L3_DBG_RD_OFFSET, &stats[NSS_PPE_STATS_L3_DBG_2]); - - nss_ppe_reg_write(PPE_L3_DBG_WR_OFFSET, PPE_L3_DBG3_OFFSET); - nss_ppe_reg_read(PPE_L3_DBG_RD_OFFSET, &stats[NSS_PPE_STATS_L3_DBG_3]); - - nss_ppe_reg_write(PPE_L3_DBG_WR_OFFSET, PPE_L3_DBG4_OFFSET); - nss_ppe_reg_read(PPE_L3_DBG_RD_OFFSET, &stats[NSS_PPE_STATS_L3_DBG_4]); - - nss_ppe_reg_write(PPE_L3_DBG_WR_OFFSET, PPE_L3_DBG_PORT_OFFSET); - nss_ppe_reg_read(PPE_L3_DBG_RD_OFFSET, &stats[NSS_PPE_STATS_L3_DBG_PORT]); - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_stats_code_get() - * Get PPE CPU and DROP code for last packet processed. - */ -static void nss_ppe_stats_code_get(uint32_t *stats) -{ - uint32_t drop_0, drop_1, cpu_code; - - nss_trace("%s(%d) Start\n", __func__, __LINE__); - if (!stats) { - nss_warning("No memory to copy ppe code\n"); - return; - } - - spin_lock_bh(&nss_ppe_stats_lock); - nss_ppe_reg_write(PPE_PKT_CODE_WR_OFFSET, PPE_PKT_CODE_DROP0_OFFSET); - nss_ppe_reg_read(PPE_PKT_CODE_RD_OFFSET, &drop_0); - - nss_ppe_reg_write(PPE_PKT_CODE_WR_OFFSET, PPE_PKT_CODE_DROP1_OFFSET); - nss_ppe_reg_read(PPE_PKT_CODE_RD_OFFSET, &drop_1); - - stats[NSS_PPE_STATS_CODE_DROP] = PPE_PKT_CODE_DROP_GET(drop_0, drop_1); - - nss_ppe_reg_write(PPE_PKT_CODE_WR_OFFSET, PPE_PKT_CODE_CPU_OFFSET); - nss_ppe_reg_read(PPE_PKT_CODE_RD_OFFSET, &cpu_code); - - stats[NSS_PPE_STATS_CODE_CPU] = PPE_PKT_CODE_CPU_GET(cpu_code); - - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_port_drop_code_get() - * Get ppe per port drop code. - */ -static void nss_ppe_port_drop_code_get(uint32_t *stats, uint8_t port_id) -{ - uint8_t i; - nss_trace("%s(%d) Start\n", __func__, __LINE__); - if (!stats) { - nss_warning("No memory to copy ppe code\n"); - return; - } - - if (port_id > NSS_PPE_NUM_PHY_PORTS_MAX) { - nss_warning("Port id is out of range\n"); - return; - } - - spin_lock_bh(&nss_ppe_stats_lock); - - for (i = 0; i < NSS_PPE_STATS_DROP_CODE_MAX; i++) { - nss_ppe_reg_read(PPE_DROP_CODE_OFFSET(i, port_id), &stats[i]); - } - - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_cpu_code_exception_get() - * Get ppe cpu code specific for flow exceptions. - */ -static void nss_ppe_cpu_code_exception_get(uint32_t *stats) -{ - uint8_t i; - nss_trace("%s(%d) Start\n", __func__, __LINE__); - if (!stats) { - nss_warning("No memory to copy ppe code\n"); - return; - } - - spin_lock_bh(&nss_ppe_stats_lock); - - for (i = 0; i < NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX ; i++) { - nss_ppe_reg_read(PPE_CPU_CODE_OFFSET(i), &stats[i]); - } - - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_cpu_code_nonexception_get() - * Get ppe cpu code specific for flow exceptions. - */ -static void nss_ppe_cpu_code_nonexception_get(uint32_t *stats) -{ - uint8_t i; - nss_trace("%s(%d) Start\n", __func__, __LINE__); - if (!stats) { - nss_warning("No memory to copy ppe code\n"); - return; - } - - spin_lock_bh(&nss_ppe_stats_lock); - - for (i = 0; i < NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX; i++) { - nss_ppe_reg_read(PPE_CPU_CODE_OFFSET(ppe_cc_nonexception[i]), &stats[i]); - } - - spin_unlock_bh(&nss_ppe_stats_lock); -} - -/* - * nss_ppe_conn_stats_read() - * Read ppe connection statistics - */ -static ssize_t nss_ppe_conn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int i; - char *lbuf = NULL; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - uint64_t ppe_stats[NSS_PPE_STATS_CONN_MAX]; - uint32_t max_output_lines = NSS_PPE_STATS_CONN_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_PPE_STATS_CONN_MAX * 8, GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - memset(ppe_stats, 0, sizeof(uint64_t) * NSS_PPE_STATS_CONN_MAX); - - /* - * Get all stats - */ - nss_ppe_stats_conn_get(ppe_stats); - - /* - * flow stats - */ - spin_lock_bh(&nss_ppe_stats_lock); - for (i = 0; i < NSS_PPE_STATS_CONN_MAX; i++) { - stats_shadow[i] = ppe_stats[i]; - } - - spin_unlock_bh(&nss_ppe_stats_lock); - size_wr += nss_stats_print("ppe", "ppe flow counters", NSS_STATS_SINGLE_INSTANCE, nss_ppe_stats_str_conn, stats_shadow, - NSS_PPE_STATS_CONN_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - - kfree(lbuf); - kfree(stats_shadow); - return bytes_read; -} - -/* - * nss_ppe_sc_stats_read() - * Read ppe service code statistics - */ -static ssize_t nss_ppe_sc_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int i; - char *lbuf = NULL; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct nss_ppe_sc_stats_debug sc_stats[NSS_PPE_SC_MAX]; - uint32_t max_output_lines = (NSS_PPE_SC_MAX * NSS_PPE_STATS_SERVICE_CODE_MAX) + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - memset(sc_stats, 0, sizeof(sc_stats)); - - /* - * Get stats - */ - nss_ppe_stats_sc_get(sc_stats); - - /* - * service code stats - */ - - for (i = 0; i < NSS_PPE_SC_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "ppe service code type: %s\n", - nss_ppe_stats_str_sc_type[i]); - size_wr += nss_stats_print("ppe", "ppe service code counters", NSS_STATS_SINGLE_INSTANCE, - nss_ppe_stats_str_sc, &sc_stats[i].nss_ppe_sc_cb_unregister, - NSS_PPE_STATS_SERVICE_CODE_MAX, lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - return bytes_read; -} - -/* - * nss_ppe_l3_stats_read() - * Read PPE L3 debug statistics - */ -static ssize_t nss_ppe_l3_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int i; - char *lbuf = NULL; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - uint32_t ppe_stats[NSS_PPE_STATS_L3_MAX]; - uint32_t max_output_lines = NSS_PPE_STATS_L3_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_PPE_STATS_L3_MAX * 8, GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - memset(ppe_stats, 0, sizeof(uint32_t) * NSS_PPE_STATS_L3_MAX); - - /* - * Get all stats - */ - nss_ppe_stats_l3_get(ppe_stats); - - /* - * flow stats - */ - spin_lock_bh(&nss_ppe_stats_lock); - for (i = 0; i < NSS_PPE_STATS_L3_MAX; i++) { - stats_shadow[i] = ppe_stats[i]; - } - - spin_unlock_bh(&nss_ppe_stats_lock); - size_wr += nss_stats_print("ppe", "ppe l3 debug stats", NSS_STATS_SINGLE_INSTANCE, nss_ppe_stats_str_l3, - stats_shadow, NSS_PPE_STATS_L3_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - return bytes_read; -} - -/* - * nss_ppe_code_stats_read() - * Read ppe CPU & DROP code - */ -static ssize_t nss_ppe_code_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int i; - char *lbuf = NULL; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - uint32_t ppe_stats[NSS_PPE_STATS_CODE_MAX]; - uint32_t max_output_lines = NSS_PPE_STATS_CODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_PPE_STATS_CODE_MAX * 8, GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - memset(ppe_stats, 0, sizeof(uint32_t) * NSS_PPE_STATS_CODE_MAX); - - /* - * Get all stats - */ - nss_ppe_stats_code_get(ppe_stats); - - /* - * flow stats - */ - spin_lock_bh(&nss_ppe_stats_lock); - for (i = 0; i < NSS_PPE_STATS_CODE_MAX; i++) { - stats_shadow[i] = ppe_stats[i]; - } - - spin_unlock_bh(&nss_ppe_stats_lock); - size_wr += nss_stats_print("ppe", "ppe session stats", NSS_STATS_SINGLE_INSTANCE, nss_ppe_stats_str_code, stats_shadow, - NSS_PPE_STATS_CODE_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - - kfree(lbuf); - kfree(stats_shadow); - return bytes_read; -} - -/* - * nss_ppe_port_dc_stats_read() - * Read PPE per port drop code stats - */ -static ssize_t nss_ppe_port_dc_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + few blank lines for future reference to add new stats. - */ - uint32_t max_output_lines = NSS_PPE_STATS_DROP_CODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - struct nss_stats_data *data = fp->private_data; - uint32_t *ppe_stats; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - ppe_stats = kzalloc(sizeof(uint32_t) * NSS_PPE_STATS_DROP_CODE_MAX, GFP_KERNEL); - if (unlikely(ppe_stats == NULL)) { - kfree(lbuf); - nss_warning("Could not allocate memory for ppe stats buffer"); - return 0; - } - - stats_shadow = kzalloc((NSS_PPE_STATS_DROP_CODE_MAX) * 8, GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - kfree(ppe_stats); - return 0; - } - - /* - * Get drop code counters for specific port - */ - nss_ppe_port_drop_code_get(ppe_stats, data->edma_id); - - /* - * Drop code stats - */ - spin_lock_bh(&nss_ppe_stats_lock); - for (i = 0; i < NSS_PPE_STATS_DROP_CODE_MAX; i++) { - stats_shadow[i] = ppe_stats[i]; - } - - spin_unlock_bh(&nss_ppe_stats_lock); - size_wr += nss_stats_print("ppe", "ppe drop code stats", NSS_STATS_SINGLE_INSTANCE, nss_ppe_stats_str_dc, - stats_shadow, NSS_PPE_STATS_DROP_CODE_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(ppe_stats); - kfree(lbuf); - kfree(stats_shadow); - return bytes_read; -} - -/* - * nss_ppe_exception_cc_stats_read() - * Read PPE CPU code stats specific to flow exceptions - */ -static ssize_t nss_ppe_exception_cc_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + few blank lines for future reference to add new stats. - */ - uint32_t max_output_lines = NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - uint32_t *ppe_stats; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - ppe_stats = kzalloc(sizeof(uint32_t) * NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX, GFP_KERNEL); - if (unlikely(ppe_stats == NULL)) { - kfree(lbuf); - nss_warning("Could not allocate memory for ppe stats buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX * 8, GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - kfree(ppe_stats); - return 0; - } - - /* - * Get CPU code counters for flow specific exceptions - */ - nss_ppe_cpu_code_exception_get(ppe_stats); - - /* - * CPU code stats - */ - spin_lock_bh(&nss_ppe_stats_lock); - for (i = 0; i < NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX; i++) { - stats_shadow[i] = ppe_stats[i]; - } - - spin_unlock_bh(&nss_ppe_stats_lock); - size_wr += nss_stats_print("ppe", "ppe cpu code flow-exception stats", NSS_STATS_SINGLE_INSTANCE, - nss_ppe_stats_str_cc, stats_shadow, NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX, - lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(ppe_stats); - kfree(lbuf); - kfree(stats_shadow); - return bytes_read; -} - -/* - * nss_ppe_nonexception_cc_stats_read() - * Read PPE CPU code stats for other than flow exceptions - */ -static ssize_t nss_ppe_nonexception_cc_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * max output lines = #stats + few blank lines for future reference to add new stats. - */ - uint32_t max_output_lines = NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - uint32_t *ppe_stats; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - ppe_stats = kzalloc(sizeof(uint32_t) * NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX, GFP_KERNEL); - if (unlikely(ppe_stats == NULL)) { - kfree(lbuf); - nss_warning("Could not allocate memory for ppe stats buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX * 8, GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - kfree(ppe_stats); - return 0; - } - - /* - * Get CPU code counters for non flow exceptions - */ - nss_ppe_cpu_code_nonexception_get(ppe_stats); - - /* - * CPU code stats - */ - - spin_lock_bh(&nss_ppe_stats_lock); - for (i = 0; i < NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX; i++) { - stats_shadow[i] = ppe_stats[i]; - } - - spin_unlock_bh(&nss_ppe_stats_lock); - size_wr += nss_stats_print("ppe", "ppe cpu code non-flow exception stats", NSS_STATS_SINGLE_INSTANCE, - &nss_ppe_stats_str_cc[NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_START], - stats_shadow, NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX, lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(ppe_stats); - kfree(stats_shadow); - kfree(lbuf); - - return bytes_read; -} - -/* - * nss_ppe_conn_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ppe_conn) - -/* - * nss_ppe_l3_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ppe_l3) - -/* - * nss_ppe_code_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ppe_code) - -/* - * nss_ppe_port_dc_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ppe_port_dc) -/* - * nss_ppe_exception_cc_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ppe_exception_cc) - -/* - * nss_ppe_nonexception_cc_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ppe_nonexception_cc) - -/* - * nss_ppe_sc_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ppe_sc) - -/* - * nss_ppe_stats_dentry_create() - * Create PPE statistics debug entry. - */ -void nss_ppe_stats_dentry_create(void) -{ - int i; - struct dentry *ppe_dentry = NULL; - struct dentry *ppe_code_d = NULL; - struct dentry *ppe_drop_d = NULL; - struct dentry *ppe_cpu_d = NULL; - char file_name[10]; - - ppe_dentry = debugfs_create_dir("ppe", nss_top_main.stats_dentry); - if (!ppe_dentry) { - nss_warning("Failed to create qca-nss-drv/stats/ppe directory"); - return; - } - - if (!debugfs_create_file("connection", 0400, ppe_dentry, &nss_top_main, &nss_ppe_conn_stats_ops)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/connection file"); - debugfs_remove_recursive(ppe_dentry); - return; - } - - if (!debugfs_create_file("sc_stats", 0400, ppe_dentry, &nss_top_main, &nss_ppe_sc_stats_ops)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/sc_stats file"); - debugfs_remove_recursive(ppe_dentry); - return; - } - - if (!debugfs_create_file("l3", 0400, ppe_dentry, &nss_top_main, &nss_ppe_l3_stats_ops)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/l3 file"); - debugfs_remove_recursive(ppe_dentry); - return; - } - - if (!debugfs_create_file("ppe_code", 0400, ppe_dentry, &nss_top_main, &nss_ppe_code_stats_ops)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/ppe_code file"); - debugfs_remove_recursive(ppe_dentry); - return; - } - - /* - * ppe exception and drop code stats - */ - ppe_code_d = debugfs_create_dir("code", ppe_dentry); - if (!ppe_code_d) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/code directory"); - return; - } - - ppe_cpu_d = debugfs_create_dir("cpu", ppe_code_d); - if (!ppe_cpu_d) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/code/cpu directory"); - return; - } - - if (!debugfs_create_file("exception", 0400, ppe_cpu_d, &nss_top_main, &nss_ppe_exception_cc_stats_ops)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/code/exception file"); - debugfs_remove_recursive(ppe_cpu_d); - return; - } - - if (!debugfs_create_file("non-exception", 0400, ppe_cpu_d, &nss_top_main, &nss_ppe_nonexception_cc_stats_ops)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/code/non-exception file"); - debugfs_remove_recursive(ppe_cpu_d); - return; - } - - ppe_drop_d = debugfs_create_dir("drop", ppe_code_d); - if (!ppe_drop_d) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/code/drop directory"); - return; - } - - for (i = 0; i < NSS_PPE_NUM_PHY_PORTS_MAX; i++) { - if (i > 0) { - memset(file_name, 0, sizeof(file_name)); - snprintf(file_name, sizeof(file_name), "%d", i); - } - - if (!debugfs_create_file((i == 0) ? "cpu" : file_name, 0400, ppe_drop_d, - (void *)(nss_ptr_t)i, &nss_ppe_port_dc_stats_ops)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe/code/drop/%d file", i); - debugfs_remove_recursive(ppe_drop_d); - return; - } - } -} - -/* - * nss_ppe_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_ppe_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_ppe_stats_notification ppe_stats; - - spin_lock_bh(&nss_ppe_stats_lock); - ppe_stats.core_id = nss_ctx->id; - ppe_stats.if_num = if_num; - memcpy(ppe_stats.ppe_stats_conn, nss_ppe_debug_stats.conn_stats, sizeof(ppe_stats.ppe_stats_conn)); - memcpy(ppe_stats.ppe_stats_sc, nss_ppe_debug_stats.sc_stats, sizeof(ppe_stats.ppe_stats_sc)); - spin_unlock_bh(&nss_ppe_stats_lock); - - atomic_notifier_call_chain(&nss_ppe_stats_notifier, NSS_STATS_EVENT_NOTIFY, &ppe_stats); -} - -/* - * nss_ppe_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_ppe_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_ppe_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ppe_stats_unregister_notifier); - -/* - * nss_ppe_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_ppe_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_ppe_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_ppe_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.h deleted file mode 100644 index bd2cecb8d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_stats.h +++ /dev/null @@ -1,447 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ppe_stats.h - * NSS PPE statistics header file. - */ - -#ifndef __NSS_PPE_STATS_H -#define __NSS_PPE_STATS_H - -#include - -/* - * NSS PPE connection statistics - */ -enum nss_ppe_stats_conn { - NSS_PPE_STATS_V4_L3_FLOWS, /* No of v4 routed flows */ - NSS_PPE_STATS_V4_L2_FLOWS, /* No of v4 bridge flows */ - NSS_PPE_STATS_V4_CREATE_REQ, /* No of v4 create requests */ - NSS_PPE_STATS_V4_CREATE_FAIL, /* No of v4 create failure */ - NSS_PPE_STATS_V4_DESTROY_REQ, /* No of v4 delete requests */ - NSS_PPE_STATS_V4_DESTROY_FAIL, /* No of v4 delete failure */ - NSS_PPE_STATS_V4_MC_CREATE_REQ, /* No of v4 MC create requests */ - NSS_PPE_STATS_V4_MC_CREATE_FAIL, /* No of v4 MC create failure */ - NSS_PPE_STATS_V4_MC_UPDATE_REQ, /* No of v4 MC update requests */ - NSS_PPE_STATS_V4_MC_UPDATE_FAIL, /* No of v4 MC update failure */ - NSS_PPE_STATS_V4_MC_DESTROY_REQ, /* No of v4 MC delete requests */ - NSS_PPE_STATS_V4_MC_DESTROY_FAIL, /* No of v4 MC delete failure */ - NSS_PPE_STATS_V4_UNKNOWN_INTERFACE, /* No of v4 create failure due to invalid if */ - - NSS_PPE_STATS_V6_L3_FLOWS, /* No of v6 routed flows */ - NSS_PPE_STATS_V6_L2_FLOWS, /* No of v6 bridge flows */ - NSS_PPE_STATS_V6_CREATE_REQ, /* No of v6 create requests */ - NSS_PPE_STATS_V6_CREATE_FAIL, /* No of v6 create failure */ - NSS_PPE_STATS_V6_DESTROY_REQ, /* No of v6 delete requests */ - NSS_PPE_STATS_V6_DESTROY_FAIL, /* No of v6 delete failure */ - NSS_PPE_STATS_V6_MC_CREATE_REQ, /* No of v6 MC create requests */ - NSS_PPE_STATS_V6_MC_CREATE_FAIL, /* No of v6 MC create failure */ - NSS_PPE_STATS_V6_MC_UPDATE_REQ, /* No of v6 MC update requests */ - NSS_PPE_STATS_V6_MC_UPDATE_FAIL, /* No of v6 MC update failure */ - NSS_PPE_STATS_V6_MC_DESTROY_REQ, /* No of v6 MC delete requests */ - NSS_PPE_STATS_V6_MC_DESTROY_FAIL, /* No of v6 MC delete failure */ - NSS_PPE_STATS_V6_UNKNOWN_INTERFACE, /* No of v6 create failure due to invalid if */ - - NSS_PPE_STATS_FAIL_VP_FULL, /* Create req fail due to VP table full */ - NSS_PPE_STATS_FAIL_NH_FULL, /* Create req fail due to nexthop table full */ - NSS_PPE_STATS_FAIL_FLOW_FULL, /* Create req fail due to flow table full */ - NSS_PPE_STATS_FAIL_HOST_FULL, /* Create req fail due to host table full */ - NSS_PPE_STATS_FAIL_PUBIP_FULL, /* Create req fail due to pub-ip table full */ - NSS_PPE_STATS_FAIL_PORT_SETUP, /* Create req fail due to PPE port not setup */ - NSS_PPE_STATS_FAIL_RW_FIFO_FULL, /* Create req fail due to rw fifo full */ - NSS_PPE_STATS_FAIL_FLOW_COMMAND, /* Create req fail due to PPE flow command failure */ - NSS_PPE_STATS_FAIL_UNKNOWN_PROTO, /* Create req fail due to unknown protocol */ - NSS_PPE_STATS_FAIL_PPE_UNRESPONSIVE, /* Create req fail due to PPE not responding */ - NSS_PPE_STATS_CE_OPAQUE_INVALID, /* Create req fail due to invalid opaque in CE */ - NSS_PPE_STATS_FAIL_FQG_FULL, /* Create req fail due to flow qos group full */ - NSS_PPE_STATS_CONN_MAX -}; - -/* - * NSS PPE SC statistics - */ -enum nss_ppe_stats_service_code { - NSS_PPE_STATS_SERVICE_CODE_CB_UNREGISTER, - NSS_PPE_STATS_SERVICE_CODE_PROCESS_OK, - NSS_PPE_STATS_SERVICE_CODE_PROCESS_FAIL, - NSS_PPE_STATS_SERVICE_CODE_MAX -}; - -/* - * NSS PPE L3 statistics - */ -enum nss_ppe_stats_l3 { - NSS_PPE_STATS_L3_DBG_0, /* PPE L3 debug register 0 */ - NSS_PPE_STATS_L3_DBG_1, /* PPE L3 debug register 1 */ - NSS_PPE_STATS_L3_DBG_2, /* PPE L3 debug register 2 */ - NSS_PPE_STATS_L3_DBG_3, /* PPE L3 debug register 3 */ - NSS_PPE_STATS_L3_DBG_4, /* PPE L3 debug register 4 */ - NSS_PPE_STATS_L3_DBG_PORT, /* PPE L3 debug register Port */ - NSS_PPE_STATS_L3_MAX -}; - -/* - * NSS PPE_code statistics - */ -enum nss_ppe_stats_code { - NSS_PPE_STATS_CODE_CPU, /* PPE CPU code for last packet processed */ - NSS_PPE_STATS_CODE_DROP, /* PPE DROP code for last packet processed */ - NSS_PPE_STATS_CODE_MAX -}; - -/* - * PPE drop codes - */ -enum nss_ppe_stats_dc { - NSS_PPE_STATS_DROP_CODE_UNKNOWN, /* PPE drop code unknown */ - NSS_PPE_STATS_DROP_CODE_EXP_UNKNOWN_L2_PROT, /* PPE drop code exp unknown l2 prot */ - NSS_PPE_STATS_DROP_CODE_EXP_PPPOE_WRONG_VER_TYPE, /* PPE drop code exp pppoe wrong ver type */ - NSS_PPE_STATS_DROP_CODE_EXP_PPPOE_WRONG_CODE, /* PPE drop code exp pppoe wrong code */ - NSS_PPE_STATS_DROP_CODE_EXP_PPPOE_UNSUPPORTED_PPP_PROT, /* PPE drop code exp pppoe unsupported ppp prot */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_WRONG_VER, /* PPE drop code exp ipv4 wrong ver */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_SMALL_IHL, /* PPE drop code exp ipv4 small ihl */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_WITH_OPTION, /* PPE drop code exp ipv4 with option */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_HDR_INCOMPLETE, /* PPE drop code exp ipv4 hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_BAD_TOTAL_LEN, /* PPE drop code exp ipv4 bad total len */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_DATA_INCOMPLETE, /* PPE drop code exp ipv4 data incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_FRAG, /* PPE drop code exp ipv4 frag */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_PING_OF_DEATH, /* PPE drop code exp ipv4 ping of death */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_SNALL_TTL, /* PPE drop code exp ipv4 snall ttl */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_UNK_IP_PROT, /* PPE drop code exp ipv4 unk ip prot */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_CHECKSUM_ERR, /* PPE drop code exp ipv4 checksum err */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_INV_SIP, /* PPE drop code exp ipv4 inv sip */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_INV_DIP, /* PPE drop code exp ipv4 inv dip */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_LAND_ATTACK, /* PPE drop code exp ipv4 land attack */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_AH_HDR_INCOMPLETE, /* PPE drop code exp ipv4 ah hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_AH_HDR_CROSS_BORDER, /* PPE drop code exp ipv4 ah hdr cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV4_ESP_HDR_INCOMPLETE, /* PPE drop code exp ipv4 esp hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_WRONG_VER, /* PPE drop code exp ipv6 wrong ver */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_HDR_INCOMPLETE, /* PPE drop code exp ipv6 hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_BAD_PAYLOAD_LEN, /* PPE drop code exp ipv6 bad payload len */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_DATA_INCOMPLETE, /* PPE drop code exp ipv6 data incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_WITH_EXT_HDR, /* PPE drop code exp ipv6 with ext hdr */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_SMALL_HOP_LIMIT, /* PPE drop code exp ipv6 small hop limit */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_INV_SIP, /* PPE drop code exp ipv6 inv sip */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_INV_DIP, /* PPE drop code exp ipv6 inv dip */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_LAND_ATTACK, /* PPE drop code exp ipv6 land attack */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_FRAG, /* PPE drop code exp ipv6 frag */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_PING_OF_DEATH, /* PPE drop code exp ipv6 ping of death */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_WITH_MORE_EXT_HDR, /* PPE drop code exp ipv6 with more ext hdr */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_UNK_LAST_NEXT_HDR, /* PPE drop code exp ipv6 unk last next hdr */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_MOBILITY_HDR_INCOMPLETE, /* PPE drop code exp ipv6 mobility hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_MOBILITY_HDR_CROSS_BORDER, /* PPE drop code exp ipv6 mobility hdr cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_AH_HDR_INCOMPLETE, /* PPE drop code exp ipv6 ah hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_AH_HDR_CROSS_BORDER, /* PPE drop code exp ipv6 ah hdr cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_ESP_HDR_INCOMPLETE, /* PPE drop code exp ipv6 esp hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_ESP_HDR_CROSS_BORDER, /* PPE drop code exp ipv6 esp hdr cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_OTHER_EXT_HDR_INCOMPLETE, /* PPE drop code exp ipv6 other ext hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_IPV6_OTHER_EXT_HDR_CROSS_BORDER, /* PPE drop code exp ipv6 other ext hdr cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_HDR_INCOMPLETE, /* PPE drop code exp tcp hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_HDR_CROSS_BORDER, /* PPE drop code exp tcp hdr cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_SMAE_SP_DP, /* PPE drop code exp tcp smae sp dp */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_SMALL_DATA_OFFSET, /* PPE drop code exp tcp small data offset */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_FLAGS_0, /* PPE drop code exp tcp flags 0 */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_FLAGS_1, /* PPE drop code exp tcp flags 1 */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_FLAGS_2, /* PPE drop code exp tcp flags 2 */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_FLAGS_3, /* PPE drop code exp tcp flags 3 */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_FLAGS_4, /* PPE drop code exp tcp flags 4 */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_FLAGS_5, /* PPE drop code exp tcp flags 5 */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_FLAGS_6, /* PPE drop code exp tcp flags 6 */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_FLAGS_7, /* PPE drop code exp tcp flags 7 */ - NSS_PPE_STATS_DROP_CODE_EXP_TCP_CHECKSUM_ERR, /* PPE drop code exp tcp checksum err */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_HDR_INCOMPLETE, /* PPE drop code exp udp hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_HDR_CROSS_BORDER, /* PPE drop code exp udp hdr cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_SMAE_SP_DP, /* PPE drop code exp udp smae sp dp */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_BAD_LEN, /* PPE drop code exp udp bad len */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_DATA_INCOMPLETE, /* PPE drop code exp udp data incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_CHECKSUM_ERR, /* PPE drop code exp udp checksum err */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_LITE_HDR_INCOMPLETE, /* PPE drop code exp udp lite hdr incomplete */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_LITE_HDR_CROSS_BORDER, /* PPE drop code exp udp lite hdr cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_LITE_SMAE_SP_DP, /* PPE drop code exp udp lite smae sp dp */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_LITE_CSM_COV_1_TO_7, /* PPE drop code exp udp lite csm cov 1 to 7 */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_LITE_CSM_COV_TOO_LONG, /* PPE drop code exp udp lite csm cov too long */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_LITE_CSM_COV_CROSS_BORDER, /* PPE drop code exp udp lite csm cov cross border */ - NSS_PPE_STATS_DROP_CODE_EXP_UDP_LITE_CHECKSUM_ERR, /* PPE drop code exp udp lite checksum err */ - NSS_PPE_STATS_DROP_CODE_L3_MC_BRIDGE_ACTION, /* PPE drop code l3 mc bridge action */ - NSS_PPE_STATS_DROP_CODE_L3_NO_ROUTE_PREHEAD_NAT_ACTION, /* PPE drop code l3 no route prehead nat action */ - NSS_PPE_STATS_DROP_CODE_L3_NO_ROUTE_PREHEAD_NAT_ERROR, /* PPE drop code l3 no route prehead nat error */ - NSS_PPE_STATS_DROP_CODE_L3_ROUTE_ACTION, /* PPE drop code l3 route action */ - NSS_PPE_STATS_DROP_CODE_L3_NO_ROUTE_ACTION, /* PPE drop code l3 no route action */ - NSS_PPE_STATS_DROP_CODE_L3_NO_ROUTE_NH_INVALID_ACTION, /* PPE drop code l3 no route nh invalid action */ - NSS_PPE_STATS_DROP_CODE_L3_NO_ROUTE_PREHEAD_ACTION, /* PPE drop code l3 no route prehead action */ - NSS_PPE_STATS_DROP_CODE_L3_BRIDGE_ACTION, /* PPE drop code l3 bridge action */ - NSS_PPE_STATS_DROP_CODE_L3_FLOW_ACTION, /* PPE drop code l3 flow action */ - NSS_PPE_STATS_DROP_CODE_L3_FLOW_MISS_ACTION, /* PPE drop code l3 flow miss action */ - NSS_PPE_STATS_DROP_CODE_L2_EXP_MRU_FAIL, /* PPE drop code l2 exp mru fail */ - NSS_PPE_STATS_DROP_CODE_L2_EXP_MTU_FAIL, /* PPE drop code l2 exp mtu fail */ - NSS_PPE_STATS_DROP_CODE_L3_EXP_IP_PREFIX_BC, /* PPE drop code l3 exp ip prefix bc */ - NSS_PPE_STATS_DROP_CODE_L3_EXP_MTU_FAIL, /* PPE drop code l3 exp mtu fail */ - NSS_PPE_STATS_DROP_CODE_L3_EXP_MRU_FAIL, /* PPE drop code l3 exp mru fail */ - NSS_PPE_STATS_DROP_CODE_L3_EXP_ICMP_RDT, /* PPE drop code l3 exp icmp rdt */ - NSS_PPE_STATS_DROP_CODE_FAKE_MAC_HEADER_ERR, /* PPE drop code fake mac header err */ - NSS_PPE_STATS_DROP_CODE_L3_EXP_IP_RT_TTL_ZERO, /* PPE drop code l3 exp ip rt ttl zero */ - NSS_PPE_STATS_DROP_CODE_L3_FLOW_SERVICE_CODE_LOOP, /* PPE drop code l3 flow service code loop */ - NSS_PPE_STATS_DROP_CODE_L3_FLOW_DE_ACCELEARTE, /* PPE drop code l3 flow de accelearte */ - NSS_PPE_STATS_DROP_CODE_L3_EXP_FLOW_SRC_IF_CHK_FAIL, /* PPE drop code l3 exp flow src if chk fail */ - NSS_PPE_STATS_DROP_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH, /* PPE drop code l3 flow sync toggle mismatch */ - NSS_PPE_STATS_DROP_CODE_L3_EXP_MTU_DF_FAIL, /* PPE drop code l3 exp mtu df fail */ - NSS_PPE_STATS_DROP_CODE_L3_EXP_PPPOE_MULTICAST, /* PPE drop code l3 exp pppoe multicast */ - NSS_PPE_STATS_DROP_CODE_IPV4_SG_UNKNOWN, /* PPE drop code ipv4 sg unknown */ - NSS_PPE_STATS_DROP_CODE_IPV6_SG_UNKNOWN, /* PPE drop code ipv6 sg unknown */ - NSS_PPE_STATS_DROP_CODE_ARP_SG_UNKNOWN, /* PPE drop code arp sg unknown */ - NSS_PPE_STATS_DROP_CODE_ND_SG_UNKNOWN, /* PPE drop code nd sg unknown */ - NSS_PPE_STATS_DROP_CODE_IPV4_SG_VIO, /* PPE drop code ipv4 sg vio */ - NSS_PPE_STATS_DROP_CODE_IPV6_SG_VIO, /* PPE drop code ipv6 sg vio */ - NSS_PPE_STATS_DROP_CODE_ARP_SG_VIO, /* PPE drop code arp sg vio */ - NSS_PPE_STATS_DROP_CODE_ND_SG_VIO, /* PPE drop code nd sg vio */ - NSS_PPE_STATS_DROP_CODE_L2_NEW_MAC_ADDRESS, /* PPE drop code l2 new mac address */ - NSS_PPE_STATS_DROP_CODE_L2_HASH_COLLISION, /* PPE drop code l2 hash collision */ - NSS_PPE_STATS_DROP_CODE_L2_STATION_MOVE, /* PPE drop code l2 station move */ - NSS_PPE_STATS_DROP_CODE_L2_LEARN_LIMIT, /* PPE drop code l2 learn limit */ - NSS_PPE_STATS_DROP_CODE_L2_SA_LOOKUP_ACTION, /* PPE drop code l2 sa lookup action */ - NSS_PPE_STATS_DROP_CODE_L2_DA_LOOKUP_ACTION, /* PPE drop code l2 da lookup action */ - NSS_PPE_STATS_DROP_CODE_APP_CTRL_ACTION, /* PPE drop code app ctrl action */ - NSS_PPE_STATS_DROP_CODE_IN_VLAN_FILTER_ACTION, /* PPE drop code in vlan filter action */ - NSS_PPE_STATS_DROP_CODE_IN_VLAN_XLT_MISS, /* PPE drop code in vlan xlt miss */ - NSS_PPE_STATS_DROP_CODE_EG_VLAN_FILTER_DROP, /* PPE drop code eg vlan filter drop */ - NSS_PPE_STATS_DROP_CODE_ACL_PRE_ACTION, /* PPE drop code acl pre action */ - NSS_PPE_STATS_DROP_CODE_ACL_POST_ACTION, /* PPE drop code acl post action */ - NSS_PPE_STATS_DROP_CODE_MC_BC_SA, /* PPE drop code mc bc sa */ - NSS_PPE_STATS_DROP_CODE_NO_DESTINATION, /* PPE drop code no destination */ - NSS_PPE_STATS_DROP_CODE_STG_IN_FILTER, /* PPE drop code stg in filter */ - NSS_PPE_STATS_DROP_CODE_STG_EG_FILTER, /* PPE drop code stg eg filter */ - NSS_PPE_STATS_DROP_CODE_SOURCE_FILTER_FAIL, /* PPE drop code source filter fail */ - NSS_PPE_STATS_DROP_CODE_TRUNK_SEL_FAIL, /* PPE drop code trunk sel fail */ - NSS_PPE_STATS_DROP_CODE_TX_EN_FAIL, /* PPE drop code tx en fail */ - NSS_PPE_STATS_DROP_CODE_VLAN_TAG_FMT, /* PPE drop code vlan tag fmt */ - NSS_PPE_STATS_DROP_CODE_CRC_ERR, /* PPE drop code crc err */ - NSS_PPE_STATS_DROP_CODE_PAUSE_FRAME, /* PPE drop code pause frame */ - NSS_PPE_STATS_DROP_CODE_PROMISC, /* PPE drop code promisc */ - NSS_PPE_STATS_DROP_CODE_ISOLATION, /* PPE drop code isolation */ - NSS_PPE_STATS_DROP_CODE_MGMT_APP, /* PPE drop code mgmt app */ - NSS_PPE_STATS_DROP_CODE_FAKE_L2_PROT_ERR, /* PPE drop code fake l2 prot err */ - NSS_PPE_STATS_DROP_CODE_POLICER, /* PPE drop code policer */ - NSS_PPE_STATS_DROP_CODE_MAX /* PPE drop code max */ -}; - -/* - * PPE CPU codes - */ -#define NSS_PPE_STATS_CPU_CODE_MAX 150 -#define NSS_PPE_STATS_CPU_CODE_EXCEPTION_MAX 69 -#define NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_START 69 -#define NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_MAX (NSS_PPE_STATS_CPU_CODE_MAX - NSS_PPE_STATS_CPU_CODE_NONEXCEPTION_START) - -enum nss_ppe_stats_cc { - NSS_PPE_STATS_CPU_CODE_FORWARDING = 0, /* PPE cpu code forwarding */ - NSS_PPE_STATS_CPU_CODE_EXP_UNKNOWN_L2_PROT = 1, /* PPE cpu code exp unknown l2 prot */ - NSS_PPE_STATS_CPU_CODE_EXP_PPPOE_WRONG_VER_TYPE = 2, /* PPE cpu code exp pppoe wrong ver type */ - NSS_PPE_STATS_CPU_CODE_EXP_PPPOE_WRONG_CODE = 3, /* PPE cpu code exp pppoe wrong code */ - NSS_PPE_STATS_CPU_CODE_EXP_PPPOE_UNSUPPORTED_PPP_PROT = 4, /* PPE cpu code exp pppoe unsupported ppp prot */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_WRONG_VER = 5, /* PPE cpu code exp ipv4 wrong ver */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_SMALL_IHL = 6, /* PPE cpu code exp ipv4 small ihl */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_WITH_OPTION = 7, /* PPE cpu code exp ipv4 with option */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_HDR_INCOMPLETE = 8, /* PPE cpu code exp ipv4 hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_BAD_TOTAL_LEN = 9, /* PPE cpu code exp ipv4 bad total len */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_DATA_INCOMPLETE = 10, /* PPE cpu code exp ipv4 data incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_FRAG = 11, /* PPE cpu code exp ipv4 frag */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_PING_OF_DEATH = 12, /* PPE cpu code exp ipv4 ping of death */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_SNALL_TTL = 13, /* PPE cpu code exp ipv4 snall ttl */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_UNK_IP_PROT = 14, /* PPE cpu code exp ipv4 unk ip prot */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_CHECKSUM_ERR = 15, /* PPE cpu code exp ipv4 checksum err */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_INV_SIP = 16, /* PPE cpu code exp ipv4 inv sip */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_INV_DIP = 17, /* PPE cpu code exp ipv4 inv dip */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_LAND_ATTACK = 18, /* PPE cpu code exp ipv4 land attack */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_AH_HDR_INCOMPLETE = 19, /* PPE cpu code exp ipv4 ah hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_AH_HDR_CROSS_BORDER = 20, /* PPE cpu code exp ipv4 ah hdr cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV4_ESP_HDR_INCOMPLETE = 21, /* PPE cpu code exp ipv4 esp hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_WRONG_VER = 22, /* PPE cpu code exp ipv6 wrong ver */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_HDR_INCOMPLETE = 23, /* PPE cpu code exp ipv6 hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_BAD_PAYLOAD_LEN = 24, /* PPE cpu code exp ipv6 bad payload len */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_DATA_INCOMPLETE = 25, /* PPE cpu code exp ipv6 data incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_WITH_EXT_HDR = 26, /* PPE cpu code exp ipv6 with ext hdr */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_SMALL_HOP_LIMIT = 27, /* PPE cpu code exp ipv6 small hop limit */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_INV_SIP = 28, /* PPE cpu code exp ipv6 inv sip */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_INV_DIP = 29, /* PPE cpu code exp ipv6 inv dip */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_LAND_ATTACK = 30, /* PPE cpu code exp ipv6 land attack */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_FRAG = 31, /* PPE cpu code exp ipv6 frag */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_PING_OF_DEATH = 32, /* PPE cpu code exp ipv6 ping of death */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_WITH_MORE_EXT_HDR = 33, /* PPE cpu code exp ipv6 with more ext hdr */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_UNK_LAST_NEXT_HDR = 34, /* PPE cpu code exp ipv6 unk last next hdr */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_MOBILITY_HDR_INCOMPLETE = 35, /* PPE cpu code exp ipv6 mobility hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_MOBILITY_HDR_CROSS_BORDER = 36, /* PPE cpu code exp ipv6 mobility hdr cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_AH_HDR_INCOMPLETE = 37, /* PPE cpu code exp ipv6 ah hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_AH_HDR_CROSS_BORDER = 38, /* PPE cpu code exp ipv6 ah hdr cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_ESP_HDR_INCOMPLETE = 39, /* PPE cpu code exp ipv6 esp hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_ESP_HDR_CROSS_BORDER = 40, /* PPE cpu code exp ipv6 esp hdr cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_OTHER_EXT_HDR_INCOMPLETE = 41, /* PPE cpu code exp ipv6 other ext hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_IPV6_OTHER_EXT_HDR_CROSS_BORDER = 42, /* PPE cpu code exp ipv6 other ext hdr cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_HDR_INCOMPLETE = 43, /* PPE cpu code exp tcp hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_HDR_CROSS_BORDER = 44, /* PPE cpu code exp tcp hdr cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_SMAE_SP_DP = 45, /* PPE cpu code exp tcp smae sp dp */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_SMALL_DATA_OFFSET = 46, /* PPE cpu code exp tcp small data offset */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_FLAGS_0 = 47, /* PPE cpu code exp tcp flags 0 */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_FLAGS_1 = 48, /* PPE cpu code exp tcp flags 1 */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_FLAGS_2 = 49, /* PPE cpu code exp tcp flags 2 */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_FLAGS_3 = 50, /* PPE cpu code exp tcp flags 3 */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_FLAGS_4 = 51, /* PPE cpu code exp tcp flags 4 */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_FLAGS_5 = 52, /* PPE cpu code exp tcp flags 5 */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_FLAGS_6 = 53, /* PPE cpu code exp tcp flags 6 */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_FLAGS_7 = 54, /* PPE cpu code exp tcp flags 7 */ - NSS_PPE_STATS_CPU_CODE_EXP_TCP_CHECKSUM_ERR = 55, /* PPE cpu code exp tcp checksum err */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_HDR_INCOMPLETE = 56, /* PPE cpu code exp udp hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_HDR_CROSS_BORDER = 57, /* PPE cpu code exp udp hdr cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_SMAE_SP_DP = 58, /* PPE cpu code exp udp smae sp dp */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_BAD_LEN = 59, /* PPE cpu code exp udp bad len */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_DATA_INCOMPLETE = 60, /* PPE cpu code exp udp data incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_CHECKSUM_ERR = 61, /* PPE cpu code exp udp checksum err */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_LITE_HDR_INCOMPLETE = 62, /* PPE cpu code exp udp lite hdr incomplete */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_LITE_HDR_CROSS_BORDER = 63, /* PPE cpu code exp udp lite hdr cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_LITE_SMAE_SP_DP = 64, /* PPE cpu code exp udp lite smae sp dp */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_LITE_CSM_COV_1_TO_7 = 65, /* PPE cpu code exp udp lite csm cov 1 to 7 */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_LITE_CSM_COV_TOO_LONG = 66, /* PPE cpu code exp udp lite csm cov too long */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_LITE_CSM_COV_CROSS_BORDER = 67, /* PPE cpu code exp udp lite csm cov cross border */ - NSS_PPE_STATS_CPU_CODE_EXP_UDP_LITE_CHECKSUM_ERR = 68, /* PPE cpu code exp udp lite checksum err */ - NSS_PPE_STATS_CPU_CODE_EXP_FAKE_L2_PROT_ERR = 69, /* PPE cpu code exp fake l2 prot err */ - NSS_PPE_STATS_CPU_CODE_EXP_FAKE_MAC_HEADER_ERR = 70, /* PPE cpu code exp fake mac header err */ - NSS_PPE_STATS_CPU_CODE_EXP_BITMAP_MAX = 78, /* PPE cpu code exp bitmap max */ - NSS_PPE_STATS_CPU_CODE_L2_EXP_MRU_FAIL = 79, /* PPE cpu code l2 exp mru fail */ - NSS_PPE_STATS_CPU_CODE_L2_EXP_MTU_FAIL = 80, /* PPE cpu code l2 exp mtu fail */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_IP_PREFIX_BC = 81, /* PPE cpu code l3 exp ip prefix bc */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_MTU_FAIL = 82, /* PPE cpu code l3 exp mtu fail */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_MRU_FAIL = 83, /* PPE cpu code l3 exp mru fail */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_ICMP_RDT = 84, /* PPE cpu code l3 exp icmp rdt */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_IP_RT_TTL1_TO_ME = 85, /* PPE cpu code l3 exp ip rt ttl1 to me */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_IP_RT_TTL_ZERO = 86, /* PPE cpu code l3 exp ip rt ttl zero */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_SERVICE_CODE_LOOP = 87, /* PPE cpu code l3 flow service code loop */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_DE_ACCELERATE = 88, /* PPE cpu code l3 flow de accelerate */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_FLOW_SRC_IF_CHK_FAIL = 89, /* PPE cpu code l3 exp flow src if chk fail */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH = 90, /* PPE cpu code l3 flow sync toggle mismatch */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_MTU_DF_FAIL = 91, /* PPE cpu code l3 exp mtu df fail */ - NSS_PPE_STATS_CPU_CODE_L3_EXP_PPPOE_MULTICAST = 92, /* PPE cpu code l3 exp pppoe multicast */ - NSS_PPE_STATS_CPU_CODE_MGMT_OFFSET = 96, /* PPE cpu code mgmt offset */ - NSS_PPE_STATS_CPU_CODE_MGMT_EAPOL = 97, /* PPE cpu code mgmt eapol */ - NSS_PPE_STATS_CPU_CODE_MGMT_PPPOE_DIS = 98, /* PPE cpu code mgmt pppoe dis */ - NSS_PPE_STATS_CPU_CODE_MGMT_IGMP = 99, /* PPE cpu code mgmt igmp */ - NSS_PPE_STATS_CPU_CODE_MGMT_ARP_REQ = 100, /* PPE cpu code mgmt arp req */ - NSS_PPE_STATS_CPU_CODE_MGMT_ARP_REP = 101, /* PPE cpu code mgmt arp rep */ - NSS_PPE_STATS_CPU_CODE_MGMT_DHCPv4 = 102, /* PPE cpu code mgmt dhcpv4 */ - NSS_PPE_STATS_CPU_CODE_MGMT_MLD = 107, /* PPE cpu code mgmt mld */ - NSS_PPE_STATS_CPU_CODE_MGMT_NS = 108, /* PPE cpu code mgmt ns */ - NSS_PPE_STATS_CPU_CODE_MGMT_NA = 109, /* PPE cpu code mgmt na */ - NSS_PPE_STATS_CPU_CODE_MGMT_DHCPv6 = 110, /* PPE cpu code mgmt dhcpv6 */ - NSS_PPE_STATS_CPU_CODE_PTP_OFFSET = 112, /* PPE cpu code ptp offset */ - NSS_PPE_STATS_CPU_CODE_PTP_SYNC = 113, /* PPE cpu code ptp sync */ - NSS_PPE_STATS_CPU_CODE_PTP_FOLLOW_UP = 114, /* PPE cpu code ptp follow up */ - NSS_PPE_STATS_CPU_CODE_PTP_DELAY_REQ = 115, /* PPE cpu code ptp delay req */ - NSS_PPE_STATS_CPU_CODE_PTP_DELAY_RESP = 116, /* PPE cpu code ptp delay resp */ - NSS_PPE_STATS_CPU_CODE_PTP_PDELAY_REQ = 117, /* PPE cpu code ptp pdelay req */ - NSS_PPE_STATS_CPU_CODE_PTP_PDELAY_RESP = 118, /* PPE cpu code ptp pdelay resp */ - NSS_PPE_STATS_CPU_CODE_PTP_PDELAY_RESP_FOLLOW_UP = 119, /* PPE cpu code ptp pdelay resp follow up */ - NSS_PPE_STATS_CPU_CODE_PTP_ANNOUNCE = 120, /* PPE cpu code ptp announce */ - NSS_PPE_STATS_CPU_CODE_PTP_MANAGEMENT = 121, /* PPE cpu code ptp management */ - NSS_PPE_STATS_CPU_CODE_PTP_SIGNALING = 122, /* PPE cpu code ptp signaling */ - NSS_PPE_STATS_CPU_CODE_PTP_PKT_RSV_MSG = 127, /* PPE cpu code ptp pkt rsv msg */ - NSS_PPE_STATS_CPU_CODE_IPV4_SG_UNKNOWN = 136, /* PPE cpu code ipv4 sg unknown */ - NSS_PPE_STATS_CPU_CODE_IPV6_SG_UNKNOWN = 137, /* PPE cpu code ipv6 sg unknown */ - NSS_PPE_STATS_CPU_CODE_ARP_SG_UNKNOWN = 138, /* PPE cpu code arp sg unknown */ - NSS_PPE_STATS_CPU_CODE_ND_SG_UNKNOWN = 139, /* PPE cpu code nd sg unknown */ - NSS_PPE_STATS_CPU_CODE_IPV4_SG_VIO = 140, /* PPE cpu code ipv4 sg vio */ - NSS_PPE_STATS_CPU_CODE_IPV6_SG_VIO = 141, /* PPE cpu code ipv6 sg vio */ - NSS_PPE_STATS_CPU_CODE_ARP_SG_VIO = 142, /* PPE cpu code arp sg vio */ - NSS_PPE_STATS_CPU_CODE_ND_SG_VIO = 143, /* PPE cpu code nd sg vio */ - NSS_PPE_STATS_CPU_CODE_L3_ROUTING_IP_TO_ME = 148, /* PPE cpu code l3 routing ip to me */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_SNAT_ACTION = 149, /* PPE cpu code l3 flow snat action */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_DNAT_ACTION = 150, /* PPE cpu code l3 flow dnat action */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_RT_ACTION = 151, /* PPE cpu code l3 flow rt action */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_BR_ACTION = 152, /* PPE cpu code l3 flow br action */ - NSS_PPE_STATS_CPU_CODE_L3_MC_BRIDGE_ACTION = 153, /* PPE cpu code l3 mc bridge action */ - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_RT_ACTION = 154, /* PPE cpu code l3 route prehead rt action */ - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_SNAPT_ACTION = 155, /* PPE cpu code l3 route prehead snapt action */ - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_DNAPT_ACTION = 156, /* PPE cpu code l3 route prehead dnapt action */ - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_SNAT_ACTION = 157, /* PPE cpu code l3 route prehead snat action */ - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_PREHEAD_DNAT_ACTION = 158, /* PPE cpu code l3 route prehead dnat action */ - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_PREHEAD_NAT_ACTION = 159, /* PPE cpu code l3 no route prehead nat action */ - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_PREHEAD_NAT_ERROR = 160, /* PPE cpu code l3 no route prehead nat error */ - NSS_PPE_STATS_CPU_CODE_L3_ROUTE_ACTION = 161, /* PPE cpu code l3 route action */ - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_ACTION = 162, /* PPE cpu code l3 no route action */ - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_NH_INVALID_ACTION = 163, /* PPE cpu code l3 no route nh invalid action */ - NSS_PPE_STATS_CPU_CODE_L3_NO_ROUTE_PREHEAD_ACTION = 164, /* PPE cpu code l3 no route prehead action */ - NSS_PPE_STATS_CPU_CODE_L3_BRIDGE_ACTION = 165, /* PPE cpu code l3 bridge action */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_ACTION = 166, /* PPE cpu code l3 flow action */ - NSS_PPE_STATS_CPU_CODE_L3_FLOW_MISS_ACTION = 167, /* PPE cpu code l3 flow miss action */ - NSS_PPE_STATS_CPU_CODE_L2_NEW_MAC_ADDRESS = 168, /* PPE cpu code l2 new mac address */ - NSS_PPE_STATS_CPU_CODE_L2_HASH_COLLISION = 169, /* PPE cpu code l2 hash collision */ - NSS_PPE_STATS_CPU_CODE_L2_STATION_MOVE = 170, /* PPE cpu code l2 station move */ - NSS_PPE_STATS_CPU_CODE_L2_LEARN_LIMIT = 171, /* PPE cpu code l2 learn limit */ - NSS_PPE_STATS_CPU_CODE_L2_SA_LOOKUP_ACTION = 172, /* PPE cpu code l2 sa lookup action */ - NSS_PPE_STATS_CPU_CODE_L2_DA_LOOKUP_ACTION = 173, /* PPE cpu code l2 da lookup action */ - NSS_PPE_STATS_CPU_CODE_APP_CTRL_ACTION = 174, /* PPE cpu code app ctrl action */ - NSS_PPE_STATS_CPU_CODE_IN_VLAN_FILTER_ACTION = 175, /* PPE cpu code in vlan filter action */ - NSS_PPE_STATS_CPU_CODE_IN_VLAN_XLT_MISS = 176, /* PPE cpu code in vlan xlt miss */ - NSS_PPE_STATS_CPU_CODE_EG_VLAN_FILTER_DROP = 177, /* PPE cpu code eg vlan filter drop */ - NSS_PPE_STATS_CPU_CODE_ACL_PRE_ACTION = 178, /* PPE cpu code acl pre action */ - NSS_PPE_STATS_CPU_CODE_ACL_POST_ACTION = 179, /* PPE cpu code acl post action */ - NSS_PPE_STATS_CPU_CODE_SERVICE_CODE_ACTION = 180, /* PPE cpu code service code action */ -}; - -/* - * nss_ppe_sc_stats_debug - */ -struct nss_ppe_sc_stats_debug { - uint64_t nss_ppe_sc_cb_unregister; /* Per service-code counter for callback not registered */ - uint64_t nss_ppe_sc_cb_success; /* Per service-code coutner for successful callback */ - uint64_t nss_ppe_sc_cb_failure; /* Per service-code counter for failure callback */ -}; - -/* - * NSS PPE statistics - */ -struct nss_ppe_stats_debug { - uint64_t conn_stats[NSS_PPE_STATS_CONN_MAX]; - uint32_t l3_stats[NSS_PPE_STATS_L3_MAX]; - uint32_t code_stats[NSS_PPE_STATS_CODE_MAX]; - struct nss_ppe_sc_stats_debug sc_stats[NSS_PPE_SC_MAX]; - int32_t if_index; - uint32_t if_num; /* nss interface number */ - bool valid; -}; - -/* - * Data structures to store NSS PPE debug statistics - */ -extern struct nss_ppe_stats_debug nss_ppe_debug_stats; - -/** - * nss_ppe_stats_notification - * PPE transmission statistics structure. - */ -struct nss_ppe_stats_notification { - struct nss_ppe_sc_stats_debug ppe_stats_sc[NSS_PPE_SC_MAX]; /* PPE service code stats. */ - uint64_t ppe_stats_conn[NSS_PPE_STATS_CONN_MAX]; /* PPE connection statistics. */ - uint32_t core_id; /* Core ID. */ - uint32_t if_num; /* Interface number. */ -}; - -/* - * NSS PPE statistics APIs - */ -extern void nss_ppe_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_ppe_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_sync_stats_msg *stats_msg, uint16_t if_num); -extern void nss_ppe_stats_dentry_create(void); - -#endif /* __NSS_PPE_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.c deleted file mode 100644 index 294996449..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.c +++ /dev/null @@ -1,532 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_ppe.h" -#include "nss_strings.h" -#include "nss_ppe_strings.h" - -/* - * nss_ppe_stats_str_conn - * PPE statistics strings for nss flow stats - */ -struct nss_stats_info nss_ppe_stats_str_conn[NSS_PPE_STATS_CONN_MAX] = { - {"v4 routed flows", NSS_STATS_TYPE_SPECIAL}, - {"v4 bridge flows", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn create req", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn create fail", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn destroy req", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn destroy fail", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn MC create req", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn MC create fail", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn MC update req", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn MC update fail", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn MC delete req", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn MC delete fail", NSS_STATS_TYPE_SPECIAL}, - {"v4 conn unknown if", NSS_STATS_TYPE_SPECIAL}, - {"v6 routed flows", NSS_STATS_TYPE_SPECIAL}, - {"v6 bridge flows", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn create req", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn create fail", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn destroy req", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn destroy fail", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn MC create req", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn MC create fail", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn MC update req", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn MC update fail", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn MC delete req", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn MC delete fail", NSS_STATS_TYPE_SPECIAL}, - {"v6 conn unknown if", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - vp full", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - nexthop full", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - flow full", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - host full", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - pub-ip full", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - port not setup", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - rw fifo full", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - flow cmd failure", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - unknown proto", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - ppe not responding", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - CE opaque invalid", NSS_STATS_TYPE_SPECIAL}, - {"conn fail - fqg full", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_ppe_stats_str_conn_strings_read() - * Read ppe NSS flow statistics names - */ -static ssize_t nss_ppe_stats_str_conn_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_conn, NSS_PPE_STATS_CONN_MAX); -} - -/* - * nss_ppe_stats_str_conn_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_conn); - -/* - * nss_ppe_stats_str_l3 - * PPE statistics strings for nss debug stats - */ -struct nss_stats_info nss_ppe_stats_str_l3[NSS_PPE_STATS_L3_MAX] = { - {"L3 dbg reg 0", NSS_STATS_TYPE_SPECIAL}, - {"L3 dbg reg 1", NSS_STATS_TYPE_SPECIAL}, - {"L3 dbg reg 2", NSS_STATS_TYPE_SPECIAL}, - {"L3 dbg reg 3", NSS_STATS_TYPE_SPECIAL}, - {"L3 dbg reg 4", NSS_STATS_TYPE_SPECIAL}, - {"L3 dbg reg port", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_ppe_stats_str_l3_strings_read() - * Read ppe NSS debug statistics names - */ -static ssize_t nss_ppe_stats_str_l3_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_l3, NSS_PPE_STATS_L3_MAX); -} - -/* - * nss_ppe_stats_str_l3_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_l3); - -/* - * nss_ppe_stats_str_code - * PPE statistics strings for nss debug stats - */ -struct nss_stats_info nss_ppe_stats_str_code[NSS_PPE_STATS_CODE_MAX] = { - {"CPU_CODE", NSS_STATS_TYPE_SPECIAL}, - {"DROP_CODE", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_ppe_stats_str_code_strings_read() - * Read ppe NSS debug statistics names - */ -static ssize_t nss_ppe_stats_str_code_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_code, NSS_PPE_STATS_CODE_MAX); -} - -/* - * nss_ppe_stats_str_code_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_code); - -/* - * nss_ppe_stats_str_dc - * PPE statistics strings for drop code - */ -struct nss_stats_info nss_ppe_stats_str_dc[NSS_PPE_STATS_DROP_CODE_MAX] = { - {"DROP_CODE_NONE", NSS_STATS_TYPE_SPECIAL}, - {"DROP_CODE_EXP_UNKNOWN_L2_PORT", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_PPPOE_WRONG_VER_TYPE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_PPPOE_WRONG_CODE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_PPPOE_UNSUPPORTED_PPP_PROT", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_WRONG_VER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_SMALL_IHL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_WITH_OPTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_BAD_TOTAL_LEN", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_DATA_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_FRAG", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_PING_OF_DEATH", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_SNALL_TTL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_UNK_IP_PROT", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_CHECKSUM_ERR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_INV_SIP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_INV_DIP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_LAND_ATTACK", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_AH_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_AH_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV4_ESP_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_WRONG_VER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_BAD_PAYLOAD_LEN", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_DATA_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_WITH_EXT_HDR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_SMALL_HOP_LIMIT", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_INV_SIP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_INV_DIP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_LAND_ATTACK", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_FRAG", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_PING_OF_DEATH", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_WITH_MORE_EXT_HDR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_UNK_LAST_NEXT_HDR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_MOBILITY_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_MOBILITY_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_AH_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_AH_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_ESP_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_ESP_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_OTHER_EXT_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_IPV6_OTHER_EXT_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_SMAE_SP_DP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_SMALL_DATA_OFFSET", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_FLAGS_0", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_FLAGS_1", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_FLAGS_2", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_FLAGS_3", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_FLAGS_4", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_FLAGS_5", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_FLAGS_6", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_FLAGS_7", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_TCP_CHECKSUM_ERR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_SMAE_SP_DP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_BAD_LEN", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_DATA_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_CHECKSUM_ERR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_LITE_HDR_INCOMPLETE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_LITE_HDR_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_LITE_SMAE_SP_DP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_LITE_CSM_COV_1_TO_7", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_LITE_CSM_COV_TOO_LONG", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_LITE_CSM_COV_CROSS_BORDER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EXP_UDP_LITE_CHECKSUM_ERR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_MC_BRIDGE_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_NO_ROUTE_PREHEAD_NAT_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_NO_ROUTE_PREHEAD_NAT_ERROR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_ROUTE_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_NO_ROUTE_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_NO_ROUTE_NH_INVALID_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_NO_ROUTE_PREHEAD_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_BRIDGE_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_FLOW_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_FLOW_MISS_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L2_EXP_MRU_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L2_EXP_MTU_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_EXP_IP_PREFIX_BC", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_EXP_MTU_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_EXP_MRU_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_EXP_ICMP_RDT", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_FAKE_MAC_HEADER_ERR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_EXP_IP_RT_TTL_ZERO", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_FLOW_SERVICE_CODE_LOOP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_FLOW_DE_ACCELEARTE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_EXP_FLOW_SRC_IF_CHK_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_EXP_MTU_DF_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L3_EXP_PPPOE_MULTICAST", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_IPV4_SG_UNKNOWN", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_IPV6_SG_UNKNOWN", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_ARP_SG_UNKNOWN", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_ND_SG_UNKNOWN", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_IPV4_SG_VIO", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_IPV6_SG_VIO", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_ARP_SG_VIO", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_ND_SG_VIO", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L2_NEW_MAC_ADDRESS", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L2_HASH_COLLISION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L2_STATION_MOVE", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L2_LEARN_LIMIT", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L2_SA_LOOKUP_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_L2_DA_LOOKUP_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_APP_CTRL_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_IN_VLAN_FILTER_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_IN_VLAN_XLT_MISS", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_EG_VLAN_FILTER_DROP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_ACL_PRE_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_ACL_POST_ACTION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_MC_BC_SA", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_NO_DESTINATION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_STG_IN_FILTER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_STG_EG_FILTER", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_SOURCE_FILTER_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_TRUNK_SEL_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_TX_EN_FAIL", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_VLAN_TAG_FMT", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_CRC_ERR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_PAUSE_FRAME", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_PROMISC", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_ISOLATION", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_MGMT_APP", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_FAKE_L2_PROT_ERR", NSS_STATS_TYPE_DROP}, - {"DROP_CODE_POLICER", NSS_STATS_TYPE_DROP} -}; - -/* - * nss_ppe_stats_str_dc_strings_read() - * Read ppe drop code statistics names - */ -static ssize_t nss_ppe_stats_str_dc_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_dc, NSS_PPE_STATS_DROP_CODE_MAX); -} - -/* - * nss_ppe_stats_str_dc_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_dc); - -/* - * nss_ppe_stats_str_sc - * PPE statistics strings for service-code stats - */ -struct nss_stats_info nss_ppe_stats_str_sc[NSS_PPE_STATS_SERVICE_CODE_MAX] = { - {"cb_unregister", NSS_STATS_TYPE_SPECIAL}, - {"process_ok", NSS_STATS_TYPE_SPECIAL}, - {"process_fail", NSS_STATS_TYPE_ERROR} -}; - -/* - * nss_ppe_stats_str_sc_strings_read() - * Read ppe service code statistics names - */ -static ssize_t nss_ppe_stats_str_sc_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_sc, NSS_PPE_STATS_SERVICE_CODE_MAX); -} - -/* - * nss_ppe_stats_str_sc_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_sc); - -/* - * nss_ppe_stats_str_cc - * PPE statistics strings for cpu code - */ -struct nss_stats_info nss_ppe_stats_str_cc[NSS_PPE_STATS_CPU_CODE_MAX] = { - {"CPU_CODE_FORWARDING", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UNKNOWN_L2_PROT", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_PPPOE_WRONG_VER_TYPE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_WRONG_CODE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_PPPOE_UNSUPPORTED_PPP_PROT", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_WRONG_VER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_SMALL_IHL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_WITH_OPTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV4_BAD_TOTAL_LEN", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_DATA_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_IPV4_FRAG", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV4_PING_OF_DEATH", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_SNALL_TTL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV4_UNK_IP_PROT", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_CHECKSUM_ERR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_INV_SIP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_INV_DIP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_LAND_ATTACK", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV4_AH_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV4_AH_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV4_ESP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_WRONG_VER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_BAD_PAYLOAD_LEN", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_DATA_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_WITH_EXT_HDR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_SMALL_HOP_LIMIT", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_INV_SIP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_INV_DIP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_LAND_ATTACK", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_IPV6_FRAG", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_PING_OF_DEATH", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_WITH_EXT_HDR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_UNK_NEXT_HDR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_MOBILITY_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_MOBILITY_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_AH_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_AH_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_ESP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_ESP_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_OTHER_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_IPV6_OTHER_EXT_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_TCP_HDR_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_TCP_SMAE_SP_DP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_TCP_SMALL_DATA_OFFSET", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FLAGS_0", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FLAGS_1", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FLAGS_2", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FLAGS_3", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FLAGS_4", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FLAGS_5", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FLAGS_6", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FLAGS_7", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_CHECKSUM_ERR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_HDR_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_SMAE_SP_DP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_BAD_LEN", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_DATA_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_CHECKSUM_ERR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_LITE_HDR_INCOMPLETE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_LITE_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_LITE_SP_DP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_LITE_CSM_COV_TO_7", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_LITE_CSM_TOO_LONG", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_LITE_CSM_CROSS_BORDER", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_UDP_LITE_CHECKSUM_ERR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FAKE_L2_PROT_ERR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EXP_FAKE_MAC_HEADER_ERR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_BITMAP_MAX", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L2_MRU_FAIL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L2_MTU_FAIL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_EXP_IP_PREFIX_BC", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_MTU_FAIL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_MRU_FAIL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_ICMP_RDT", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_EXP_IP_RT_TO_ME", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_EXP_IP_TTL_ZERO", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_FLOW_SERVICE_CODE_LOOP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_DE_ACCELERATE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_EXP_FLOW_SRC_CHK_FAIL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_FLOW_SYNC_TOGGLE_MISMATCH", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_EXP_MTU_DF_FAIL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_PPPOE_MULTICAST", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_MGMT_OFFSET", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_MGMT_EAPOL", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PPPOE_DIS", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_MGMT_IGMP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_ARP_REQ", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_ARP_REP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_MGMT_DHCPv4", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_MGMT_MLD", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_MGMT_NS", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_MGMT_NA", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_MGMT_DHCPv6", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PTP_OFFSET", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PTP_SYNC", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_FOLLOW_UP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_DELAY_REQ", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_DELAY_RESP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PDELAY_REQ", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PDELAY_RESP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PTP_PDELAY_RESP_FOLLOW_UP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PTP_ANNOUNCE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PTP_MANAGEMENT", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PTP_SIGNALING", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PTP_RSV_MSG", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_SG_UNKNOWN", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_SG_UNKNOWN", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_SG_UNKNOWN", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_SG_UNKNOWN", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_SG_VIO", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_SG_VIO", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_SG_VIO", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_SG_VIO", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_ROUTING_IP_TO_ME", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_SNAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_DNAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_RT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_BR_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_BRIDGE_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_ROUTE_PREHEAD_RT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_ROUTE_PREHEAD_SNAPT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_ROUTE_PREHEAD_DNAPT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_ROUTE_PREHEAD_SNAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_ROUTE_PREHEAD_DNAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_NO_ROUTE_NAT_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_NO_ROUTE_NAT_ERROR", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_ROUTE_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_ROUTE_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_NO_ROUTE_INVALID_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_NO_ROUTE_PREHEAD_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_BRIDGE_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_FLOW_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L3_MISS_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L2_MAC_ADDRESS", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_HASH_COLLISION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_STATION_MOVE", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_LEARN_LIMIT", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L2_LOOKUP_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_L2_LOOKUP_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_CTRL_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_IN_FILTER_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_IN_XLT_MISS", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_EG_FILTER_DROP", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_PRE_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_POST_ACTION", NSS_STATS_TYPE_EXCEPTION}, - {"CPU_CODE_CODE_ACTION", NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_ppe_stats_str_cc_strings_read() - * Read ppe cpu code statistics names - */ -static ssize_t nss_ppe_stats_str_cc_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_ppe_stats_str_cc, NSS_PPE_STATS_CPU_CODE_MAX); -} - -/* - * nss_ppe_stats_str_cc_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(ppe_stats_str_cc); - -/* - * nss_ppe_strings_dentry_create() - * Create ppe statistics strings debug entry. - */ -void nss_ppe_strings_dentry_create(void) -{ - struct dentry *ppe_d = NULL; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - ppe_d = debugfs_create_dir("ppe", nss_top_main.strings_dentry); - if (!ppe_d) { - nss_warning("Failed to create qca-nss-drv/strings/ppe directory"); - return; - } - - if (!debugfs_create_file("stats_str_conn", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_conn_strings_ops)) { - nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_conn file"); - debugfs_remove_recursive(ppe_d); - return; - } - - if (!debugfs_create_file("stats_str_sc", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_sc_strings_ops)) { - nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_sc file"); - debugfs_remove_recursive(ppe_d); - return; - } - - if (!debugfs_create_file("stats_str_l3", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_l3_strings_ops)) { - nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_l3 file"); - debugfs_remove_recursive(ppe_d); - return; - } - - if (!debugfs_create_file("stats_str_code", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_code_strings_ops)) { - nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_code file"); - debugfs_remove_recursive(ppe_d); - return; - } - - if (!debugfs_create_file("stats_str_dc", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_dc_strings_ops)) { - nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_dc file"); - debugfs_remove_recursive(ppe_d); - return; - } - - if (!debugfs_create_file("stats_str_cc", 0400, ppe_d, &nss_top_main, &nss_ppe_stats_str_cc_strings_ops)) { - nss_warning("Failed to create qca-nss-drv/strings/ppe/stats_str_cc file"); - debugfs_remove_recursive(ppe_d); - return; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.h deleted file mode 100644 index e8fe77ec2..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_strings.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - *************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - *************************************************************************** - */ - -#ifndef __NSS_PPE_STRINGS_H -#define __NSS_PPE_STRINGS_H - -#include "nss_ppe_stats.h" - -extern struct nss_stats_info nss_ppe_stats_str_conn[NSS_PPE_STATS_CONN_MAX]; -extern struct nss_stats_info nss_ppe_stats_str_sc[NSS_PPE_STATS_SERVICE_CODE_MAX]; -extern struct nss_stats_info nss_ppe_stats_str_l3[NSS_PPE_STATS_L3_MAX]; -extern struct nss_stats_info nss_ppe_stats_str_code[NSS_PPE_STATS_CODE_MAX]; -extern struct nss_stats_info nss_ppe_stats_str_dc[NSS_PPE_STATS_DROP_CODE_MAX]; -extern struct nss_stats_info nss_ppe_stats_str_cc[NSS_PPE_STATS_CPU_CODE_MAX]; -extern void nss_ppe_strings_dentry_create(void); - -#endif /* __NSS_PPE_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.c deleted file mode 100644 index a5411cec9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.c +++ /dev/null @@ -1,864 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * Header file for qca-ssdk APIs - */ -#include - -#include "nss_ppe_vp.h" -#include "nss_ppe_vp_stats.h" - -#define NSS_PPE_VP_TX_TIMEOUT 1000 /* 1 Second */ - -static struct nss_vp_mapping *vp_map[NSS_MAX_DYNAMIC_INTERFACES] = {NULL}; -unsigned char nss_ppe_vp_cmd[NSS_PPE_VP_MAX_CMD_STR] __read_mostly; - -/* - * Private data structure - */ -static struct nss_ppe_vp_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; - nss_ppe_port_t ppe_port_num; -} ppe_vp_pvt; - -DEFINE_SPINLOCK(nss_ppe_vp_stats_lock); -DEFINE_SPINLOCK(nss_ppe_vp_map_lock); - -struct nss_ppe_vp_stats_debug nss_ppe_vp_debug_stats; -static struct dentry *nss_ppe_vp_dentry; - -/* - * nss_ppe_vp_get_map_index() - * Get the index of the NSS-VP number mapping array. - */ -static inline int32_t nss_ppe_vp_get_map_index(nss_if_num_t if_num) -{ - return (if_num - NSS_DYNAMIC_IF_START); -} - -/* - * nss_ppe_vp_verify_ifnum() - * Verify PPE VP interface number. - */ -static inline bool nss_ppe_vp_verify_ifnum(int if_num) -{ - return (if_num == NSS_PPE_VP_INTERFACE); -} - -/* - * nss_ppe_vp_map_dealloc() - * Deallocate memory for the NSS interface number and PPE VP number mapping. - */ -static inline void nss_ppe_vp_map_dealloc(struct nss_vp_mapping *map) -{ - vfree(map); -} - -/* - * nss_ppe_vp_map_alloc() - * Allocate memory for the NSS interface number and PPE VP number mapping. - */ -static inline struct nss_vp_mapping *nss_ppe_vp_map_alloc(void) -{ - struct nss_vp_mapping *nss_vp_info = vzalloc(sizeof(struct nss_vp_mapping)); - if (!nss_vp_info) { - nss_warning("No memory for allocating NSS-VP mapping instance"); - } - - return nss_vp_info; -} - -/* - * nss_ppe_vp_proc_help() - * Print usage information for ppe_vp configure sysctl. - */ -static void nss_ppe_vp_proc_help(void) -{ - nss_info_always("== for dynamic interface types read following file =="); - nss_info_always("/sys/kernel/debug/qca-nss-drv/stats/dynamic_if/type_names"); - nss_info_always("NSS PPE VP create: echo > /proc/sys/nss/ppe_vp/create"); - nss_info_always("NSS PPE VP destroy: echo > /proc/sys/nss/ppe_vp/destroy"); -} - -/* - * nss_ppe_vp_del_map() - * Delete mapping between NSS interface number and VP number. - */ -static bool nss_ppe_vp_del_map(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num) -{ - int32_t idx; - nss_ppe_port_t ppe_port_num; - struct nss_vp_mapping *nss_vp_info; - uint16_t vp_index; - - nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); - - idx = nss_ppe_vp_get_map_index(if_num); - if ((idx < 0) || (idx >= NSS_MAX_DYNAMIC_INTERFACES)) { - nss_warning("%px: Invalid index. Cannot delete the PPE VP mapping. idx:%u", nss_ctx, idx); - return false; - } - - spin_lock_bh(&nss_ppe_vp_map_lock); - nss_vp_info = vp_map[idx]; - if (!nss_vp_info) { - spin_unlock_bh(&nss_ppe_vp_map_lock); - nss_warning("%px: Could not find the vp num in the mapping. NSS if num:%u", nss_ctx, if_num); - return false; - } - - ppe_port_num = nss_vp_info->ppe_port_num; - - nss_ppe_vp_map_dealloc(nss_vp_info); - vp_map[idx] = NULL; - spin_unlock_bh(&nss_ppe_vp_map_lock); - - /* - * Clear the PPE VP stats once PPE VP is deleted - */ - vp_index = ppe_port_num - NSS_PPE_VP_START; - spin_lock_bh(&nss_ppe_vp_stats_lock); - memset(&nss_ppe_vp_debug_stats.vp_stats[vp_index], 0, sizeof(struct nss_ppe_vp_statistics_debug)); - spin_unlock_bh(&nss_ppe_vp_stats_lock); - - nss_info("%px: Deleted NSS interface number and PPE VP number mapping successfully: NSS if num:%u at index:%u", nss_ctx, if_num, idx); - - return true; -} - -/* - * nss_ppe_vp_add_map() - * Add mapping between NSS interface number and VP number. - */ -static bool nss_ppe_vp_add_map(struct nss_ctx_instance *nss_ctx ,nss_if_num_t if_num, struct nss_vp_mapping *nss_vp_info) -{ - uint32_t idx; - nss_ppe_port_t ppe_port_num; - - nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); - - if (!nss_vp_info) { - nss_warning("%px: Received invalid argument.", nss_ctx); - return false; - } - - idx = nss_ppe_vp_get_map_index(if_num); - if ((idx < 0) || (idx >= NSS_MAX_DYNAMIC_INTERFACES)) { - nss_warning("%px: Invalid index. Cannot add the PPE VP mapping. idx:%u", nss_ctx, idx); - return false; - } - - spin_lock_bh(&nss_ppe_vp_map_lock); - if (vp_map[idx]) { - spin_unlock_bh(&nss_ppe_vp_map_lock); - nss_warning("%px: Mapping exists already. NSS if num:%d index:%u, VP num:%u", nss_ctx, if_num, idx, vp_map[idx]->ppe_port_num); - return false; - } - - vp_map[idx] = nss_vp_info; - ppe_port_num = vp_map[idx]->ppe_port_num; - spin_unlock_bh(&nss_ppe_vp_map_lock); - - nss_info("%px: Mapping added successfully. NSS if num:%d index:%u, VP num:%u", nss_ctx, if_num, idx, ppe_port_num); - - return true; -} - -/* - * nss_ppe_vp_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_ppe_vp_callback(void *app_data, struct nss_ppe_vp_msg *npvm) -{ - if (npvm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("ppe_vp error response %d", npvm->cm.response); - ppe_vp_pvt.response = NSS_TX_FAILURE; - complete(&ppe_vp_pvt.complete); - return; - } - - if (npvm->cm.type == NSS_IF_PPE_PORT_CREATE) { - ppe_vp_pvt.ppe_port_num = npvm->msg.if_msg.ppe_port_create.ppe_port_num; - nss_trace("PPE VP callback success VP num: %u", npvm->msg.if_msg.ppe_port_create.ppe_port_num); - } - ppe_vp_pvt.response = NSS_TX_SUCCESS; - - complete(&ppe_vp_pvt.complete); -} - -/* - * nss_ppe_vp_parse_vp_cmd() - * Parse PPE VP create and destroy message and return the NSS interface number. - * Command usage: - * echo /proc/sys/nss/ppe_vp/create> - * echo ath0 6 > /proc/sys/nss/ppe_vp/create - * Since ath0 has only one type i.e. ath0 is NSS_DYNAMIC_INTERFACE_TYPE_VAP, the above command can be rewritten as - * echo ath0 > /proc/sys/nss/ppe_vp/create => Here 6 can be ignored. - */ -static nss_if_num_t nss_ppe_vp_parse_vp_cmd(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int32_t if_num; - struct net_device *dev; - uint32_t dynamic_if_type = (uint32_t)NSS_DYNAMIC_INTERFACE_TYPE_NONE; - struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); - char *pos; - char cmd_buf[NSS_PPE_VP_MAX_CMD_STR] = {0}, dev_name[NSS_PPE_VP_MAX_CMD_STR] = {0}; - size_t count = *lenp; - int ret = proc_dostring(ctl, write, buffer, lenp, ppos); - - if (!write) { - nss_ppe_vp_proc_help(); - return ret; - } - - if (!nss_ctx) { - nss_warning("%px: NSS Context not found.", nss_ctx); - return -ENODEV; - } - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (count >= NSS_PPE_VP_MAX_CMD_STR) { - nss_ppe_vp_proc_help(); - nss_warning("%px: Input string too big", nss_ctx); - return -E2BIG; - } - - if (copy_from_user(cmd_buf, buffer, count)) { - nss_warning("%px: Cannot copy user's entry to kernel memory", nss_ctx); - return -EFAULT; - } - - if ((pos = strrchr(cmd_buf, '\n')) != NULL) { - *pos = '\0'; - } - - if (sscanf(cmd_buf, "%s %u", dev_name, &dynamic_if_type) < 0) { - nss_warning("%px: PPE VP command parse failed", nss_ctx); - return -EFAULT; - } - - dev = dev_get_by_name(&init_net, dev_name); - if (!dev) { - nss_warning("%px: Cannot find the net device", nss_ctx); - return -ENODEV; - } - - nss_info("%px: Dynamic interface type: %u", nss_ctx, dynamic_if_type); - if ((dynamic_if_type < NSS_DYNAMIC_INTERFACE_TYPE_NONE) || (dynamic_if_type >= NSS_DYNAMIC_INTERFACE_TYPE_MAX)) { - nss_warning("%px: Invalid dynamic interface type: %d", nss_ctx, dynamic_if_type); - dev_put(dev); - return -EFAULT; - } - - if_num = nss_cmn_get_interface_number_by_dev_and_type(dev, dynamic_if_type); - if (if_num < 0) { - nss_warning("%px: Invalid interface number:%s", nss_ctx, dev_name); - dev_put(dev); - return -EFAULT; - } - - nss_info("%px: PPE VP create/destroy for, nss_if_num:%d dev_name:%s dynamic_if_type:%u", nss_ctx, if_num, dev_name, dynamic_if_type); - dev_put(dev); - - return if_num; -} - -/* - * nss_ppe_vp_tx_msg() - * Transmit a ppe_vp message to NSS FW - */ -nss_tx_status_t nss_ppe_vp_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - nss_if_num_t if_num = ncm->interface; - - /* - * Trace messages. - */ - nss_ppe_vp_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (!((ncm->type == NSS_IF_PPE_PORT_CREATE) || (ncm->type == NSS_IF_PPE_PORT_DESTROY))) { - nss_warning("%px: Invalid message type: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - if (!(if_num >= NSS_DYNAMIC_IF_START && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES)))) { - nss_warning("%px: invalid interface %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_ppe_vp_tx_msg_sync() - * Transmit a ppe_vp message to NSS firmware synchronously. - */ -nss_tx_status_t nss_ppe_vp_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_msg *npvm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&ppe_vp_pvt.sem); - - status = nss_ppe_vp_tx_msg(nss_ctx, npvm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: ppe_tx_msg failed", nss_ctx); - up(&ppe_vp_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&ppe_vp_pvt.complete, msecs_to_jiffies(NSS_PPE_VP_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: ppe_vp msg tx failed due to timeout", nss_ctx); - ppe_vp_pvt.response = NSS_TX_FAILURE; - } - - status = ppe_vp_pvt.response; - up(&ppe_vp_pvt.sem); - - return status; -} - -/* - * nss_ppe_vp_get_context() - * Get NSS context instance for ppe_vp - */ -struct nss_ctx_instance *nss_ppe_vp_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.ppe_handler_id]; -} -EXPORT_SYMBOL(nss_ppe_vp_get_context); - -/* - * nss_ppe_vp_get_ppe_port_by_nssif() - * Get vp number for a given NSS interface number. - */ -nss_ppe_port_t nss_ppe_vp_get_ppe_port_by_nssif(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num) -{ - uint32_t idx; - nss_ppe_port_t ppe_port_num; - - if (!((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES)))) { - nss_warning("%px: NSS invalid nss if num: %u", nss_ctx, if_num); - return -1; - } - - idx = nss_ppe_vp_get_map_index(if_num); - if (idx < 0 || idx >= NSS_MAX_DYNAMIC_INTERFACES) { - nss_warning("%px: NSS invalid index: %d nss if num: %u",nss_ctx, idx, if_num); - return -1; - } - - spin_lock_bh(&nss_ppe_vp_map_lock); - if (!vp_map[idx]) { - spin_unlock_bh(&nss_ppe_vp_map_lock); - nss_warning("%px: NSS interface and VP mapping is not present for nss if num: %u",nss_ctx, if_num); - return -1; - } - ppe_port_num = vp_map[idx]->ppe_port_num; - spin_unlock_bh(&nss_ppe_vp_map_lock); - - nss_info("%px: VP num %d nss_if: %d",nss_ctx, ppe_port_num, if_num); - - return ppe_port_num; -} -EXPORT_SYMBOL(nss_ppe_vp_get_ppe_port_by_nssif); - -/* - * nss_ppe_vp_destroy() - * Destroy PPE virtual port for the given nss interface number. - */ -nss_tx_status_t nss_ppe_vp_destroy(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num) -{ - nss_tx_status_t status; - struct nss_ppe_vp_msg *npvm; - uint32_t idx; - int32_t vsi_id_valid = false; - int32_t vsi_id; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - idx = nss_ppe_vp_get_map_index(if_num); - if (idx < 0 || idx >= NSS_MAX_DYNAMIC_INTERFACES) { - nss_warning("%px: Cannot destroy PPE VP. Invalid index: %d. nss_if_num: %u", nss_ctx, idx, if_num); - return -1; - } - - spin_lock_bh(&nss_ppe_vp_map_lock); - if (vp_map[idx]) { - vsi_id = vp_map[idx]->vsi_id; - vsi_id_valid = vp_map[idx]->vsi_id_valid; - } - spin_unlock_bh(&nss_ppe_vp_map_lock); - - if (vsi_id_valid) { - /* - * Send the dettach VSI message to the Firmware. - */ - if (nss_if_vsi_unassign(nss_ctx, if_num, vsi_id)) { - nss_warning("%px: PPE VP destroy failed. Failed to detach VSI to PPE VP interface %d vsi:%d", nss_ctx, if_num, vsi_id); - return NSS_TX_FAILURE; - } - - if (ppe_vsi_free(NSS_PPE_VP_SWITCH_ID, vsi_id)) { - nss_warning("%px: PPE VP destroy failed. Failed to free PPE VSI. nss_if:%d vsi:%d", nss_ctx, if_num, vsi_id); - return NSS_TX_FAILURE; - } - - nss_info("%px: PPE VP VSI detached successfully. VSI ID freed successfully. NSS if num:%u, VSI ID:%u", nss_ctx, if_num, vsi_id); - } - - npvm = kzalloc(sizeof(struct nss_ppe_vp_msg), GFP_KERNEL); - if (!npvm) { - nss_warning("%px: Unable to allocate memeory of PPE VP message", nss_ctx); - return NSS_TX_FAILURE; - } - - nss_trace("%px: PPE_VP will be destroyed for an interface: %d", nss_ctx, if_num); - - /* - * Destroy PPE VP for a dynamic interface. - */ - nss_cmn_msg_init(&npvm->cm, if_num, NSS_IF_PPE_PORT_DESTROY, 0, nss_ppe_vp_callback, NULL); - - status = nss_ppe_vp_tx_msg_sync(nss_ctx, npvm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to send PPE VP destroy message", nss_ctx); - kfree(npvm); - return NSS_TX_FAILURE; - } - - kfree(npvm); - - /* - * Delete mapping between the NSS interface number and the VP number. - */ - if (!nss_ppe_vp_del_map(nss_ctx, if_num)) { - nss_warning("%px: Failed to delete the mapping for nss_if:%d", nss_ctx, if_num); - return NSS_TX_FAILURE; - } - - return status; -} -EXPORT_SYMBOL(nss_ppe_vp_destroy); - -/* - * nss_ppe_vp_create() - * Create PPE virtual port for the given nss interface number. - */ -nss_tx_status_t nss_ppe_vp_create(struct nss_ctx_instance *nss_ctx, nss_if_num_t if_num) -{ - uint32_t vsi_id; - nss_tx_status_t status; - struct nss_ppe_vp_msg *npvm; - struct nss_vp_mapping *nss_vp_info; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * TODO: No need to create VSI for tunnel interfaces. Only for VAP interfaces VSI is needed. - * Allocate the VSI for the dynamic interface on which VP will be created. - */ - if (ppe_vsi_alloc(NSS_PPE_VP_SWITCH_ID, &vsi_id)) { - nss_warning("%px, Failed to alloc VSI ID, PPE VP create failed. nss_if:%u", nss_ctx, if_num); - return NSS_TX_FAILURE; - } - - npvm = kzalloc(sizeof(struct nss_ppe_vp_msg), GFP_KERNEL); - if (!npvm) { - nss_warning("%px: Unable to allocate memeory of PPE VP message", nss_ctx); - goto free_vsi; - } - - nss_trace("%px: PPE_VP will be created for an interface: %d", nss_ctx, if_num); - - /* - * Create PPE VP for a dynamic interface. - */ - nss_cmn_msg_init(&npvm->cm, if_num, NSS_IF_PPE_PORT_CREATE, - sizeof(struct nss_if_ppe_port_create), nss_ppe_vp_callback, NULL); - - status = nss_ppe_vp_tx_msg_sync(nss_ctx, npvm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to send ppe_vp create message", nss_ctx); - goto free_alloc; - } - - /* - * Send the attach VSI message to the Firmware. - */ - if (nss_if_vsi_assign(nss_ctx, if_num, vsi_id) != NSS_TX_SUCCESS) { - nss_warning("%px: Failed to attach VSI to PPE VP interface. nss_if:%u vsi:%u", nss_ctx, if_num, vsi_id); - goto destroy_vp; - } - - nss_vp_info = nss_ppe_vp_map_alloc(); - if (!nss_vp_info) { - nss_warning("%px: No memory for allocating NSS-VP mapping instance", nss_ctx); - goto detach_vsi; - } - - nss_vp_info->vsi_id = vsi_id; - nss_vp_info->vsi_id_valid = true; - nss_vp_info->if_num = if_num; - nss_vp_info->ppe_port_num = ppe_vp_pvt.ppe_port_num; - - nss_info("%px: PPE VP allocated VSI ID:%u NSS interface number:%u VP no from Firmware:%u", nss_ctx, vsi_id, if_num, nss_vp_info->ppe_port_num); - - /* - * Add mapping between the NSS interface number and the VP number. - */ - if (!nss_ppe_vp_add_map(nss_ctx, if_num, nss_vp_info)) { - nss_warning("%px: Failed to add mapping for NSS interface number: %d", nss_ctx, if_num); - goto free_nss_vp_info; - } - - kfree(npvm); - - return status; - -free_nss_vp_info: - nss_ppe_vp_map_dealloc(nss_vp_info); - -detach_vsi: - nss_trace("%px: Detaching VSI ID :%u NSS Interface no:%u", nss_ctx, vsi_id, if_num); - if (nss_if_vsi_unassign(nss_ctx, if_num, vsi_id)) { - nss_warning("%px: Failed to free PPE VP VSI. nss_if:%u vsi:%u", nss_ctx, if_num, vsi_id); - } - -destroy_vp: - nss_trace("%px: Destroy Vp for NSS Interface num:%u VP num:%u", nss_ctx, if_num, npvm->msg.if_msg.ppe_port_create.ppe_port_num); - if (nss_ppe_vp_destroy(nss_ctx, if_num)) { - nss_warning("%px: PPE VP destroy failed, nss_if:%u", nss_ctx, if_num); - } - -free_alloc: - kfree(npvm); - -free_vsi: - nss_trace("%px: Free VSI ID :%u NSS Interface no:%u", nss_ctx, vsi_id, if_num); - if (ppe_vsi_free(NSS_PPE_VP_SWITCH_ID, vsi_id)) { - nss_warning("%px: Failed to free PPE VP VSI. NSS if num:%u vsi:%u", nss_ctx, if_num, vsi_id); - } - - return NSS_TX_FAILURE; -} -EXPORT_SYMBOL(nss_ppe_vp_create); - -/* - * nss_ppe_vp_destroy_notify() - * Get PPE VP destroy notification from NSS - */ -static void nss_ppe_vp_destroy_notify(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_destroy_notify_msg *destroy_notify) -{ - nss_if_num_t nss_if_num; - uint32_t i; - int32_t vsi_id; - bool vsi_id_valid = false; - nss_ppe_port_t ppe_port_num = destroy_notify->ppe_port_num; - - /* - * Find NSS interface number corresponding to the VP num. - */ - spin_lock_bh(&nss_ppe_vp_map_lock); - for (i = 0; i < NSS_MAX_DYNAMIC_INTERFACES; i++) { - if (vp_map[i] && (ppe_port_num == vp_map[i]->ppe_port_num)) { - nss_if_num = vp_map[i]->if_num; - vsi_id = vp_map[i]->vsi_id; - vsi_id_valid = vp_map[i]->vsi_id_valid; - break; - } - } - spin_unlock_bh(&nss_ppe_vp_map_lock); - - if (i == NSS_MAX_DYNAMIC_INTERFACES) { - nss_warning("%px: Could not find the NSS interface number mapping for VP number: %u\n", nss_ctx, ppe_port_num); - return; - } - - /* - * Delete the nss_if_num to VP num mapping and reset the stats entry for this VP. - */ - if (!nss_ppe_vp_del_map(nss_ctx, nss_if_num)) { - nss_warning("%px: Failed to delete the mapping for nss_if: %d\n", nss_ctx, nss_if_num); - return; - } - - if (vsi_id_valid && ppe_vsi_free(NSS_PPE_VP_SWITCH_ID, vsi_id)) { - nss_warning("%px: Failed to free PPE VSI. nss_if: %d vsi: %d\n", nss_ctx, nss_if_num, vsi_id); - } -} - -/* - * nss_ppe_vp_handler() - * Handle NSS -> HLOS messages for ppe - */ -static void nss_ppe_vp_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_ppe_vp_msg *msg = (struct nss_ppe_vp_msg *)ncm; - nss_ppe_vp_msg_callback_t cb; - void *ctx; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_trace("%px ppe_vp msg: %px\n", nss_ctx, msg); - BUG_ON(!nss_ppe_vp_verify_ifnum(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_PPE_VP_MSG_MAX) { - nss_warning("%px: received invalid message %d for PPE_VP interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_ppe_vp_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Trace messages. - */ - nss_ppe_vp_log_rx_msg(msg); - - switch (msg->cm.type) { - case NSS_PPE_VP_MSG_SYNC_STATS: - /* - * Per VP stats msg - */ - nss_ppe_vp_stats_sync(nss_ctx, &msg->msg.stats, ncm->interface); - break; - - case NSS_PPE_VP_MSG_DESTROY_NOTIFY: - /* - * VP destroy notification - */ - nss_ppe_vp_destroy_notify(nss_ctx, &msg->msg.destroy_notify); - break; - } - - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_ppe_vp_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - cb(ctx, msg); -} - -/* - * nss_ppe_vp_destroy_handler() - * PPE VP destroy handler. - */ -static int nss_ppe_vp_destroy_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); - int32_t if_num; - nss_tx_status_t nss_tx_status; - - if (!nss_ctx) { - nss_warning("%px: NSS Context not found.", nss_ctx); - return -ENODEV; - } - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if_num = nss_ppe_vp_parse_vp_cmd(ctl, write, buffer, lenp, ppos); - if (if_num < 0) { - nss_warning("%px: Invalid interface number: %d", nss_ctx, if_num); - return -EFAULT; - } - - if (nss_ppe_vp_get_ppe_port_by_nssif(nss_ctx, if_num) < 0) { - nss_warning("%px: VP is not present for interface: %d", nss_ctx, if_num); - return -EEXIST; - } - - nss_tx_status = nss_ppe_vp_destroy(nss_ctx, if_num); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Sending message failed, cannot destroy PPE_VP node nss_if: %u", nss_ctx, if_num); - return -EBUSY; - } - - return 0; -} - -/* - * nss_ppe_vp_create_handler() - * PPE VP create handler. - */ -static int nss_ppe_vp_create_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int32_t if_num; - struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); - nss_tx_status_t nss_tx_status; - - if (!nss_ctx) { - nss_warning("%px: NSS Context not found.", nss_ctx); - return -ENODEV; - } - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if_num = nss_ppe_vp_parse_vp_cmd(ctl, write, buffer, lenp, ppos); - if (if_num < 0) { - nss_warning("%px: Invalid interface number: %d", nss_ctx, if_num); - return -EFAULT; - } - - nss_info("%px: NSS interface number: %d", nss_ctx, if_num); - - if (nss_ppe_vp_get_ppe_port_by_nssif(nss_ctx, if_num) > 0) { - nss_warning("%px: VP is already present for nss_if_num: %d", nss_ctx, if_num); - return -EEXIST; - } - - nss_tx_status = nss_ppe_vp_create(nss_ctx, if_num); - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: Sending message failed, cannot create PPE VP node for nss_if_num: %u", nss_ctx, if_num); - return -EBUSY; - } - - return 0; -} - -static struct ctl_table nss_ppe_vp_table[] = { - { - .procname = "create", - .data = &nss_ppe_vp_cmd, - .maxlen = sizeof(nss_ppe_vp_cmd), - .mode = 0644, - .proc_handler = &nss_ppe_vp_create_handler, - }, - { - .procname = "destroy", - .data = &nss_ppe_vp_cmd, - .maxlen = sizeof(nss_ppe_vp_cmd), - .mode = 0644, - .proc_handler = &nss_ppe_vp_destroy_handler, - }, - { } -}; - -static struct ctl_table nss_ppe_vp_dir[] = { - { - .procname = "ppe_vp", - .mode = 0555, - .child = nss_ppe_vp_table, - }, - { } -}; - -static struct ctl_table nss_ppe_vp_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_ppe_vp_dir, - }, - { } -}; - -static struct ctl_table_header *nss_ppe_vp_procfs_header; - -/* - * nss_ppe_vp_procfs_register() - * Register sysctl specific to ppe_vp - */ -void nss_ppe_vp_procfs_register(void) -{ - /* - * Register sysctl table. - */ - nss_ppe_vp_procfs_header = register_sysctl_table(nss_ppe_vp_root_dir); -} - -/* - * uss_ppe_vp_procfs_unregister() - * Unregister sysctl specific for ppe_vp - */ -void nss_ppe_vp_procfs_unregister(void) -{ - /* - * Unregister sysctl table. - */ - if (nss_ppe_vp_procfs_header) { - unregister_sysctl_table(nss_ppe_vp_procfs_header); - } -} - -/* - * nss_ppe_vp_register_handler() - * - */ -void nss_ppe_vp_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); - - nss_ppe_vp_dentry = nss_ppe_vp_stats_dentry_create(); - if (nss_ppe_vp_dentry == NULL) { - nss_warning("%px: Not able to create debugfs entry", nss_ctx); - return; - } - - nss_core_register_handler(nss_ctx, NSS_PPE_VP_INTERFACE, nss_ppe_vp_handler, NULL); - nss_ppe_vp_procfs_register(); - - sema_init(&ppe_vp_pvt.sem, 1); - init_completion(&ppe_vp_pvt.complete); -} - -/* - * nss_ppe_vp_unregister_handler() - * - */ -void nss_ppe_vp_unregister_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context(); - - debugfs_remove_recursive(nss_ppe_vp_dentry); - nss_ppe_vp_procfs_unregister(); - nss_core_unregister_handler(nss_ctx, NSS_PPE_VP_INTERFACE); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.h deleted file mode 100644 index ee656497f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ppe_vp.h - * NSS PPE virtual port header file - */ - -#include -#include "nss_tx_rx_common.h" - -/* - * Maximum number of virtual port supported by PPE hardware - */ -#define NSS_PPE_VP_MAX_NUM 192 -#define NSS_PPE_VP_START 64 -#define NSS_PPE_VP_NODE_STATS_MAX 32 -#define NSS_PPE_VP_SWITCH_ID 0 -#define NSS_PPE_VP_MAX_CMD_STR 200 - -/* - * ppe_vp nss debug stats lock - */ -extern spinlock_t nss_ppe_vp_stats_lock; - -/* - * nss_ppe_vp_msg_error_type - * ppe_vp message errors - */ -enum nss_ppe_vp_msg_error_type { - NSS_PPE_VP_MSG_ERROR_TYPE_UNKNOWN, /* Unknown message error */ - PPE_VP_MSG_ERROR_TYPE_INVALID_DI, /* Invalid dynamic interface type */ - NSS_PPE_VP_MSG_ERROR_TYPE_MAX /* Maximum error type */ -}; - -/* - * nss_ppe_vp_message_types - * Message types for Packet Processing Engine (PPE) requests and responses. - */ -enum nss_ppe_vp_message_types { - NSS_PPE_VP_MSG_SYNC_STATS, - NSS_PPE_VP_MSG_DESTROY_NOTIFY, - NSS_PPE_VP_MSG_MAX, -}; - -/* - * nss_ppe_vp_statistics - * Message structure for ppe_vp statistics - */ -struct nss_ppe_vp_statistics { - uint32_t nss_if; /* NSS interface number corresponding to VP */ - nss_ppe_port_t ppe_port_num; /* VP number */ - uint32_t rx_drop; /* Rx drops due to VP node inactive */ - uint32_t tx_drop; /* Tx drops due to VP node inactive */ - uint32_t packet_big_err; /* Number of packets not sent to PPE because packet was too large */ - struct nss_cmn_node_stats stats; /* Common node statistics */ -}; - -/* - * nss_ppe_vp_sync_stats_msg - * Message information for ppe_vp synchronization statistics. - */ -struct nss_ppe_vp_sync_stats_msg { - uint16_t count; /* Number of VP node stats with the sync message */ - uint32_t rx_dropped[NSS_MAX_NUM_PRI]; /* Rx packet dropped due to queue full */ - struct nss_ppe_vp_statistics vp_stats[NSS_PPE_VP_NODE_STATS_MAX]; - /* Per service-code stats */ -}; - -/* - * nss_ppe_vp_destroy_notify_msg - * Message received as part of destroy notification from Firmware to Host. - */ -struct nss_ppe_vp_destroy_notify_msg { - nss_ppe_port_t ppe_port_num; /* VP number */ -}; - -/* - * nss_ppe_vp_msg - * Message for receiving ppe_vp NSS to host messages. - */ -struct nss_ppe_vp_msg { - struct nss_cmn_msg cm; /* Common message header. */ - - /* - * Payload. - */ - union { - union nss_if_msgs if_msg; - /* NSS interface base messages. */ - struct nss_ppe_vp_sync_stats_msg stats; - /* Synchronization statistics. */ - struct nss_ppe_vp_destroy_notify_msg destroy_notify; - /* Information for the VP destroyed in Firmware. */ - } msg; /* Message payload. */ -}; - -/* - * nss_vp_mapping - * Structure to maintain the one-to-one mapping between the NSS interface number and VP number. - */ -struct nss_vp_mapping { - nss_if_num_t if_num; /* NSS interface number. */ - nss_ppe_port_t ppe_port_num; /* PPE port number corresponding to the NSS interface number. */ - uint32_t vsi_id; /* VSI ID allocated for NSS interface */ - bool vsi_id_valid; /* Set to true if vsi_id field has a valid VSI else set to false. */ -}; - -typedef void (*nss_ppe_vp_msg_callback_t)(void *app_data, struct nss_ppe_vp_msg *msg); - -/* - * Logging APIs. - */ -void nss_ppe_vp_log_tx_msg(struct nss_ppe_vp_msg *npvm); -void nss_ppe_vp_log_rx_msg(struct nss_ppe_vp_msg *npvm); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_log.c deleted file mode 100644 index 8c853dfcb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_log.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ppe_vp_log.c - * NSS PPE logger file. - */ - -#include "nss_core.h" -#include "nss_ppe_vp.h" - -/* - * nss_ppe_vp_log_error_response_types_str - * Strings for error types for PPE-VP messages - */ -static int8_t *nss_ppe_vp_log_error_response_types_str[NSS_PPE_VP_MSG_ERROR_TYPE_MAX] __maybe_unused = { - "PPE VP Unknown message type", - "PPE VP Invalid dynamic interface type", -}; - -/* - * nss_ppe_vp_log_destroy_notify_msg() - * Log NSS PPE VP destroy notification message. - */ -static void nss_ppe_vp_log_destroy_notify_msg(struct nss_ppe_vp_msg *npvm) -{ - struct nss_ppe_vp_destroy_notify_msg *npdnm __maybe_unused = &npvm->msg.destroy_notify; - - nss_trace("%px: NSS PPE VP destroy notification message:\n" - "VP number: %u\n", - npdnm, npdnm->ppe_port_num); -} - -/* - * nss_ppe_vp_log_verbose() - * Log message contents. - */ -static void nss_ppe_vp_log_verbose(struct nss_ppe_vp_msg *npvm) -{ - switch (npvm->cm.type) { - - case NSS_IF_PPE_PORT_CREATE: - nss_info("%px: PPE interface create message type:%d\n", npvm, npvm->cm.type); - break; - - case NSS_IF_PPE_PORT_DESTROY: - nss_info("%px: PPE interface destroy message type:%d\n", npvm, npvm->cm.type); - break; - - case NSS_IF_VSI_ASSIGN: - nss_info("%px: PPE interface VSI assign message type:%d\n", npvm, npvm->cm.type); - break; - - case NSS_IF_VSI_UNASSIGN: - nss_info("%px: PPE interface VSI unassign message type:%d\n", npvm, npvm->cm.type); - break; - - case NSS_PPE_VP_MSG_DESTROY_NOTIFY: - nss_ppe_vp_log_destroy_notify_msg(npvm); - break; - - case NSS_PPE_VP_MSG_SYNC_STATS: - /* - * No log for valid stats message. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", npvm); - break; - } -} - -/* - * nss_ppe_vp_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_ppe_vp_log_tx_msg(struct nss_ppe_vp_msg *npvm) -{ - - if (!((npvm->cm.type == NSS_IF_PPE_PORT_CREATE) || (npvm->cm.type == NSS_IF_PPE_PORT_DESTROY))) { - nss_warning("%px: Invalid message type\n", npvm); - return; - } - - nss_info("%px: type:%d\n", npvm, npvm->cm.type); - nss_ppe_vp_log_verbose(npvm); -} - -/* - * nss_ppe_vp_log_rx_msg() - * Log messages received from FW. - */ -void nss_ppe_vp_log_rx_msg(struct nss_ppe_vp_msg *npvm) -{ - if (npvm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", npvm); - return; - } - - if (npvm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npvm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type: %d, response[%d]: %s\n", npvm, npvm->cm.type, - npvm->cm.response, nss_cmn_response_str[npvm->cm.response]); - goto verbose; - } - - if (npvm->cm.error >= NSS_PPE_VP_MSG_ERROR_TYPE_MAX) { - nss_warning("%px: msg failure - type: %d, response[%d]: %s, error[%d]:Invalid error\n", - npvm, npvm->cm.type, npvm->cm.response, nss_cmn_response_str[npvm->cm.response], - npvm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type: %d, response[%d]: %s, error[%d]: %s\n", - npvm, npvm->cm.type, npvm->cm.response, nss_cmn_response_str[npvm->cm.response], - npvm->cm.error, nss_ppe_vp_log_error_response_types_str[npvm->cm.error]); - -verbose: - nss_ppe_vp_log_verbose(npvm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.c deleted file mode 100644 index 57c79953f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_ppe_vp.h" -#include "nss_ppe_vp_stats.h" - -/* - * nss_ppe_vp_stats_cntrs - * PPE VP stats counters displayed using debugfs - */ -enum nss_ppe_vp_stats_cntrs { - NSS_PPE_VP_STATS_VP_NUM, - NSS_PPE_VP_STATS_NSS_IF, - NSS_PPE_VP_STATS_RX_PKTS, - NSS_PPE_VP_STATS_RX_BYTES, - NSS_PPE_VP_STATS_TX_PKTS, - NSS_PPE_VP_STATS_TX_BYTES, - NSS_PPE_VP_STATS_RX_INACTIVE, - NSS_PPE_VP_STATS_TX_INACTIVE, - NSS_PPE_VP_STATS_PACKET_BIG, - NSS_PPE_VP_STATS_TX_Q_0_DROP, - NSS_PPE_VP_STATS_TX_Q_1_DROP, - NSS_PPE_VP_STATS_TX_Q_2_DROP, - NSS_PPE_VP_STATS_TX_Q_3_DROP, - NSS_PPE_VP_STATS_MAX -}; - -/* - * nss_ppe_vp_stats_rx_cntrs - * PPE VP RX stats counters displayed using debugfs - */ -enum nss_ppe_vp_stats_rx_cntrs { - NSS_PPE_VP_STATS_RX_Q_0_DROP, - NSS_PPE_VP_STATS_RX_Q_1_DROP, - NSS_PPE_VP_STATS_RX_Q_2_DROP, - NSS_PPE_VP_STATS_RX_Q_3_DROP, - NSS_PPE_VP_STATS_RX_MAX -}; - -/* - * nss_ppe_vp_rx_stats_str - * PPE VP Rx statistics strings - */ -struct nss_stats_info nss_ppe_vp_stats_rx_str[NSS_PPE_VP_STATS_RX_MAX] = { - {"rx_queue_0_drop" , NSS_STATS_TYPE_DROP}, - {"rx_queue_1_drop" , NSS_STATS_TYPE_DROP}, - {"rx_queue_2_drop" , NSS_STATS_TYPE_DROP}, - {"rx_queue_3_drop" , NSS_STATS_TYPE_DROP}, -}; - -/* - * nss_ppe_vp_stats_str - * PPE VP statistics strings - */ -struct nss_stats_info nss_ppe_vp_stats_str[NSS_PPE_VP_STATS_MAX] = { - {"ppe_port_num" , NSS_STATS_TYPE_SPECIAL}, - {"nss_if" , NSS_STATS_TYPE_SPECIAL}, - {"rx_packets" , NSS_STATS_TYPE_COMMON}, - {"rx_bytes" , NSS_STATS_TYPE_COMMON}, - {"tx_packets" , NSS_STATS_TYPE_COMMON}, - {"tx_bytes" , NSS_STATS_TYPE_COMMON}, - {"rx_inactive" , NSS_STATS_TYPE_DROP}, - {"tx_inactive" , NSS_STATS_TYPE_DROP}, - {"packet_large_err" , NSS_STATS_TYPE_EXCEPTION}, - {"tx_queue_0_drop" , NSS_STATS_TYPE_DROP}, - {"tx_queue_1_drop" , NSS_STATS_TYPE_DROP}, - {"tx_queue_2_drop" , NSS_STATS_TYPE_DROP}, - {"tx_queue_3_drop" , NSS_STATS_TYPE_DROP}, -}; - -/* - * nss_ppe_vp_stats_sync - * PPE VP sync statistics from NSS - */ -void nss_ppe_vp_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_sync_stats_msg *stats_msg, uint16_t if_num) -{ - uint16_t count = stats_msg->count; - uint16_t vp_index, i; - - spin_lock_bh(&nss_ppe_vp_stats_lock); - - /* - * Update general rx dropped stats. - */ - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_ppe_vp_debug_stats.rx_dropped[i] += stats_msg->rx_dropped[i]; - } - - /* - * Update per VP tx and rx stats. - */ - while (count) { - count--; - - /* - * Update stats in global array - */ - vp_index = stats_msg->vp_stats[count].ppe_port_num - NSS_PPE_VP_START; - nss_ppe_vp_debug_stats.vp_stats[vp_index].ppe_port_num = stats_msg->vp_stats[count].ppe_port_num; - nss_ppe_vp_debug_stats.vp_stats[vp_index].nss_if = stats_msg->vp_stats[count].nss_if; - nss_ppe_vp_debug_stats.vp_stats[vp_index].rx_packets += stats_msg->vp_stats[count].stats.rx_packets; - nss_ppe_vp_debug_stats.vp_stats[vp_index].rx_bytes += stats_msg->vp_stats[count].stats.rx_bytes; - nss_ppe_vp_debug_stats.vp_stats[vp_index].tx_packets += stats_msg->vp_stats[count].stats.tx_packets; - nss_ppe_vp_debug_stats.vp_stats[vp_index].tx_bytes += stats_msg->vp_stats[count].stats.tx_bytes; - nss_ppe_vp_debug_stats.vp_stats[vp_index].rx_inactive_drop += stats_msg->vp_stats[count].rx_drop; - nss_ppe_vp_debug_stats.vp_stats[vp_index].tx_inactive_drop += stats_msg->vp_stats[count].tx_drop; - nss_ppe_vp_debug_stats.vp_stats[vp_index].packet_big_err += stats_msg->vp_stats[count].packet_big_err; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_ppe_vp_debug_stats.vp_stats[vp_index].tx_dropped[i] += stats_msg->vp_stats[count].stats.rx_dropped[i]; - } - - nss_trace("sync count:%d ppe_port_num %d rx_packets %d tx_packets %d\n", - count, stats_msg->vp_stats[count].ppe_port_num, - stats_msg->vp_stats[count].stats.rx_packets, - stats_msg->vp_stats[count].stats.tx_packets); - } - spin_unlock_bh(&nss_ppe_vp_stats_lock); -} - -/* - * nss_ppe_vp_stats_read() - * Read ppe vp statistics - */ -static ssize_t nss_ppe_vp_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int i; - char *lbuf = NULL; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct nss_ppe_vp_stats_debug *ppe_vp_stats; - uint32_t max_output_lines = ((NSS_PPE_VP_STATS_RX_MAX + NSS_PPE_VP_STATS_MAX) * NSS_PPE_VP_MAX_NUM) + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t stats_sz = sizeof(struct nss_ppe_vp_stats_debug); - - ppe_vp_stats = kzalloc(stats_sz, GFP_KERNEL); - if (!ppe_vp_stats) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - kfree(ppe_vp_stats); - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Get vp stats - */ - spin_lock_bh(&nss_ppe_vp_stats_lock); - memcpy(ppe_vp_stats, &nss_ppe_vp_debug_stats, stats_sz); - spin_unlock_bh(&nss_ppe_vp_stats_lock); - - /* - * VP stats - */ - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ppe_vp", NSS_STATS_SINGLE_CORE); - - /* - * Print Rx dropped. - */ - size_wr += nss_stats_print("ppe_vp", "ppe_vp rx dropped:" - , NSS_STATS_SINGLE_INSTANCE - , nss_ppe_vp_stats_rx_str - , ppe_vp_stats->rx_dropped - , NSS_PPE_VP_STATS_RX_MAX - , lbuf, size_wr, size_al); - - /* - * Print individual VP stats - */ - for (i = 0; i < NSS_PPE_VP_MAX_NUM; i++) { - if (!ppe_vp_stats->vp_stats[i].nss_if) { - continue; - } - - size_wr += nss_stats_print("ppe_vp", "ppe_vp stats" - , NSS_STATS_SINGLE_INSTANCE - , nss_ppe_vp_stats_str - , (uint64_t *) &ppe_vp_stats->vp_stats[i] - , NSS_PPE_VP_STATS_MAX - , lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(ppe_vp_stats); - kfree(lbuf); - return bytes_read; -} - -/* - * nss_ppe_vp_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(ppe_vp) - -/* - * nss_ppe_vp_stats_dentry_create() - * Create PPE statistics debug entry. - */ -struct dentry *nss_ppe_vp_stats_dentry_create(void) -{ - struct dentry *ppe_vp_d = debugfs_create_file("ppe_vp", 0400, nss_top_main.stats_dentry, - &nss_top_main, &nss_ppe_vp_stats_ops); - if (unlikely(ppe_vp_d == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/ppe_vp file"); - return NULL; - } - - return ppe_vp_d; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.h deleted file mode 100644 index b435da5ba..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_ppe_vp_stats.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_ppe_vp_stats.h - * NSS PPE-VP statistics header file. - */ - -#ifndef __NSS_PPE_VP_STATS_H -#define __NSS_PPE_VP_STATS_H - -/* - * NSS PPE-VP statistics - */ -struct nss_ppe_vp_statistics_debug { - uint64_t ppe_port_num; /* VP number */ - uint64_t nss_if; /* NSS interface number corresponding to VP */ - uint64_t rx_packets; /* Number of packets received. */ - uint64_t rx_bytes; /* Number of bytes received. */ - uint64_t tx_packets; /* Number of packets transmitted. */ - uint64_t tx_bytes; /* Number of bytes transmitted. */ - uint64_t rx_inactive_drop; /* Number of packets dropped from PPE to VP due to VP inactive */ - uint64_t tx_inactive_drop; /* Number of packets dropped from VP to PPE due to VP inactive */ - uint64_t packet_big_err; /* Number of packets not sent to PPE because packet was too large */ - uint64_t tx_dropped[NSS_MAX_NUM_PRI]; /* Tx packets dropped on due to queue full. */ -}; - -/* - * NSS PPE-VP statistics - */ -struct nss_ppe_vp_stats_debug { - uint64_t rx_dropped[NSS_MAX_NUM_PRI]; /* Packets dropped on receive due to queue full. */ - struct nss_ppe_vp_statistics_debug vp_stats[NSS_PPE_VP_MAX_NUM]; - /* Per VP Tx and Rx stats. */ -}; - -/* - * Data structures to store NSS PPE_VP debug statistics - */ -extern struct nss_ppe_vp_stats_debug nss_ppe_vp_debug_stats; - -/* - * NSS PPE-VP statistics APIs - */ -extern void nss_ppe_vp_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_ppe_vp_sync_stats_msg *stats_msg, uint16_t if_num); -extern struct dentry *nss_ppe_vp_stats_dentry_create(void); - -#endif /* __NSS_PPE_VP_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe.c b/feeds/ipq807x/qca-nss-drv/src/nss_pppoe.c deleted file mode 100644 index df613f76a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe.c +++ /dev/null @@ -1,435 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_pppoe.c - * NSS PPPoE APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_pppoe_stats.h" -#include "nss_pppoe_log.h" -#include "nss_pppoe_strings.h" - -#define NSS_PPPOE_TX_TIMEOUT 3000 /* 3 Seconds */ - -int nss_pppoe_br_accel_mode __read_mostly = NSS_PPPOE_BR_ACCEL_MODE_EN_5T; - -/* - * Private data structure - */ -static struct nss_pppoe_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} pppoe_pvt; - -/* - * nss_pppoe_br_help() - * Usage information for pppoe bride accel mode - */ -static inline void nss_pppoe_br_help(int mode) -{ - printk("Incorrect pppoe bridge accel mode: %d\n", mode); - printk("Supported modes\n"); - printk("%d: pppoe bridge acceleration disable\n", NSS_PPPOE_BR_ACCEL_MODE_DIS); - printk("%d: pppoe bridge acceleration enable with 5-tuple\n", NSS_PPPOE_BR_ACCEL_MODE_EN_5T); - printk("%d: pppoe bridge acceleration enable with 3-tuple\n", NSS_PPPOE_BR_ACCEL_MODE_EN_3T); -} - -/* - * nss_pppoe_get_context() - */ -struct nss_ctx_instance *nss_pppoe_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.pppoe_handler_id]; -} -EXPORT_SYMBOL(nss_pppoe_get_context); - -/* - * nss_pppoe_tx_msg() - * Transmit a PPPoE message to NSS firmware - */ -static nss_tx_status_t nss_pppoe_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_pppoe_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - enum nss_dynamic_interface_type type; - - /* - * Trace Messages - */ - nss_pppoe_log_tx_msg(msg); - - /* - * Sanity check the message - */ - type = nss_dynamic_interface_get_type(nss_pppoe_get_context(), ncm->interface); - if ((ncm->interface != NSS_PPPOE_INTERFACE) && (type != NSS_DYNAMIC_INTERFACE_TYPE_PPPOE)) { - nss_warning("%px: tx request for not PPPoE interface: %d type: %d\n", - nss_ctx, ncm->interface, type); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_PPPOE_MSG_MAX) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_pppoe_sync_msg_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_pppoe_sync_msg_callback(void *app_data, struct nss_pppoe_msg *npm) -{ - nss_pppoe_msg_callback_t callback = (nss_pppoe_msg_callback_t)pppoe_pvt.cb; - void *data = pppoe_pvt.app_data; - - pppoe_pvt.cb = NULL; - pppoe_pvt.app_data = NULL; - - pppoe_pvt.response = NSS_TX_SUCCESS; - if (npm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("pppoe Error response %d\n", npm->cm.response); - pppoe_pvt.response = NSS_TX_FAILURE; - } - - if (callback) { - callback(data, npm); - } - - complete(&pppoe_pvt.complete); -} - -/* - * nss_pppoe_handler() - * Handle NSS -> HLOS messages for PPPoE - */ -static void nss_pppoe_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_pppoe_msg *npm = (struct nss_pppoe_msg *)ncm; - void *ctx; - nss_pppoe_msg_callback_t cb; - - BUG_ON(!(nss_is_dynamic_interface(ncm->interface) || ncm->interface == NSS_PPPOE_INTERFACE)); - - /* - * Trace Messages - */ - nss_pppoe_log_rx_msg(npm); - - /* - * Sanity check the message type - */ - if (ncm->type >= NSS_PPPOE_MSG_MAX) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_pppoe_msg)) { - nss_warning("%px: message length is invalid: %d\n", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Handling PPPoE messages coming from NSS fw. - */ - switch (npm->cm.type) { - case NSS_PPPOE_MSG_SYNC_STATS: - /* - * Update PPPoE debug statistics and send statistics notifications to the registered modules - */ - nss_pppoe_stats_sync(nss_ctx, &npm->msg.sync_stats, ncm->interface); - nss_pppoe_stats_notify(nss_ctx, ncm->interface); - break; - default: - nss_warning("%px: Received response %d for type %d, interface %d\n", - nss_ctx, ncm->response, ncm->type, ncm->interface); - } - - /* - * Update the callback and app_data for NOTIFY messages, pppoe sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->pppoe_msg_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_pppoe_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - cb(ctx, npm); -} - -/* - * nss_pppoe_br_accel_mode_handler() - * Enable/disable pppoe bridge acceleration in NSS - */ -int nss_pppoe_br_accel_mode_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = nss_pppoe_get_context(); - struct nss_pppoe_msg npm; - struct nss_pppoe_br_accel_cfg_msg *npbacm; - nss_tx_status_t status; - int ret; - enum nss_pppoe_br_accel_modes current_value, new_val; - - /* - * Take snap shot of current value - */ - current_value = nss_pppoe_br_accel_mode; - - /* - * Write the variable with user input - */ - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - if (ret || (!write)) { - return ret; - } - - new_val = nss_pppoe_br_accel_mode; - if ((new_val < NSS_PPPOE_BR_ACCEL_MODE_DIS) || (new_val >= NSS_PPPOE_BR_ACCEL_MODE_MAX)) { - nss_warning("%px: value out of range: %d\n", nss_ctx, new_val); - nss_pppoe_br_accel_mode = current_value; - nss_pppoe_br_help(new_val); - return -EINVAL; - } - - memset(&npm, 0, sizeof(struct nss_pppoe_msg)); - nss_pppoe_msg_init(&npm, NSS_PPPOE_INTERFACE, NSS_PPPOE_MSG_BR_ACCEL_CFG, - sizeof(struct nss_pppoe_br_accel_cfg_msg), NULL, NULL); - - npbacm = &npm.msg.br_accel; - npbacm->br_accel_cfg = new_val; - - status = nss_pppoe_tx_msg_sync(nss_ctx, &npm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Send acceleration mode message failed\n", nss_ctx); - nss_pppoe_br_accel_mode = current_value; - return -EIO; - } - - return 0; -} - -/* - * nss_pppoe_get_br_accel_mode() - * Gets PPPoE bridge acceleration mode - */ -enum nss_pppoe_br_accel_modes nss_pppoe_get_br_accel_mode(void) -{ - return nss_pppoe_br_accel_mode; -} -EXPORT_SYMBOL(nss_pppoe_get_br_accel_mode); - -/* - * nss_pppoe_tx_msg_sync() - */ -nss_tx_status_t nss_pppoe_tx_msg_sync(struct nss_ctx_instance *nss_ctx, - struct nss_pppoe_msg *msg) -{ - nss_tx_status_t status; - int ret = 0; - - down(&pppoe_pvt.sem); - pppoe_pvt.cb = (void *)msg->cm.cb; - pppoe_pvt.app_data = (void *)msg->cm.app_data; - - msg->cm.cb = (nss_ptr_t)nss_pppoe_sync_msg_callback; - msg->cm.app_data = (nss_ptr_t)NULL; - - status = nss_pppoe_tx_msg(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_pppoe_tx_msg failed\n", nss_ctx); - up(&pppoe_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&pppoe_pvt.complete, msecs_to_jiffies(NSS_PPPOE_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: PPPoE msg tx failed due to timeout\n", nss_ctx); - pppoe_pvt.response = NSS_TX_FAILURE; - } - - status = pppoe_pvt.response; - up(&pppoe_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_pppoe_tx_msg_sync); - -/* - * nss_register_pppoe_session_if() - */ -struct nss_ctx_instance *nss_register_pppoe_session_if(uint32_t if_num, - nss_pppoe_msg_callback_t notification_callback, - struct net_device *netdev, uint32_t features, void *app_ctx) -{ - struct nss_ctx_instance *nss_ctx = nss_pppoe_get_context(); - - nss_assert(nss_ctx); - nss_assert(nss_is_dynamic_interface(if_num)); - - if (!nss_pppoe_stats_pppoe_session_init(if_num, netdev)) { - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, NULL, NULL, app_ctx, netdev, features); - - nss_top_main.pppoe_msg_callback = notification_callback; - - nss_core_register_handler(nss_ctx, if_num, nss_pppoe_handler, NULL); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_register_pppoe_session_if); - -/* - * nss_unregister_pppoe_session_if() - */ -void nss_unregister_pppoe_session_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_pppoe_get_context(); - - nss_assert(nss_ctx); - nss_assert(nss_is_dynamic_interface(if_num)); - - nss_pppoe_stats_pppoe_session_deinit(if_num); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.pppoe_msg_callback = NULL; - - nss_core_unregister_handler(nss_ctx, if_num); - -} -EXPORT_SYMBOL(nss_unregister_pppoe_session_if); - -static struct ctl_table nss_pppoe_table[] = { - { - .procname = "br_accel_mode", - .data = &nss_pppoe_br_accel_mode, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_pppoe_br_accel_mode_handler, - }, - { } -}; - -static struct ctl_table nss_pppoe_dir[] = { - { - .procname = "pppoe", - .mode = 0555, - .child = nss_pppoe_table, - }, - { } -}; - -static struct ctl_table nss_pppoe_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_pppoe_dir, - }, - { } -}; - -static struct ctl_table nss_pppoe_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_pppoe_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_pppoe_header; - -/* - * nss_pppoe_register_sysctl() - * Register sysctl specific to pppoe - */ -void nss_pppoe_register_sysctl(void) -{ - /* - * Register sysctl table. - */ - nss_pppoe_header = register_sysctl_table(nss_pppoe_root); -} - -/* - * nss_pppoe_unregister_sysctl() - * Unregister sysctl specific to pppoe - */ -void nss_pppoe_unregister_sysctl(void) -{ - /* - * Unregister sysctl table. - */ - if (nss_pppoe_header) { - unregister_sysctl_table(nss_pppoe_header); - } -} - -/* - * nss_pppoe_register_handler() - */ -void nss_pppoe_register_handler(void) -{ - nss_info("nss_pppoe_register_handler\n"); - nss_core_register_handler(nss_pppoe_get_context(), NSS_PPPOE_INTERFACE, nss_pppoe_handler, NULL); - - sema_init(&pppoe_pvt.sem, 1); - init_completion(&pppoe_pvt.complete); - - nss_pppoe_stats_dentry_create(); - nss_pppoe_strings_dentry_create(); -} - -/* - * nss_pppoe_msg_init() - */ -void nss_pppoe_msg_init(struct nss_pppoe_msg *npm, uint16_t if_num, uint32_t type, uint32_t len, - void *cb, void *app_data) -{ - nss_cmn_msg_init(&npm->cm, if_num, type, len, (void *)cb, app_data); - -} -EXPORT_SYMBOL(nss_pppoe_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_log.c deleted file mode 100644 index 7ab8b1902..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_log.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_pppoe_log.c - * NSS PPPOE logger file. - */ - -#include "nss_core.h" - -/* - * nss_pppoe_log_message_types_str - * NSS PPPOE message strings - */ -static int8_t *nss_pppoe_log_message_types_str[NSS_PPPOE_MSG_MAX] __maybe_unused = { - "PPPOE Session Create", - "PPPOE Session Destroy", - "PPPOE Stats", -}; - -/* - * nss_pppoe_log_session_create_msg() - * Log NSS Session Create. - */ -static void nss_pppoe_log_session_create_msg(struct nss_pppoe_msg *npm) -{ - struct nss_pppoe_create_msg *npcm __maybe_unused = &npm->msg.create; - nss_trace("%px: NSS PPPOE Session Create message \n" - "PPPOE Base Interface Number: %d\n" - "PPPOE MTU: %d\n" - "PPPOE Server MAC: %pM\n" - "PPPOE Local MAC: %pM\n" - "PPPOE Session ID: %d\n", - npcm, npcm->base_if_num, - npcm->mtu, npcm->server_mac, - npcm->local_mac, npcm->session_id); -} - -/* - * nss_pppoe_log_session_destroy_msg() - * Log NSS Session Destroy. - */ -static void nss_pppoe_log_session_destroy_msg(struct nss_pppoe_msg *npm) -{ - struct nss_pppoe_destroy_msg *npdm __maybe_unused = &npm->msg.destroy; - nss_trace("%px: NSS PPPOE Session Destroy message \n" - "PPPOE Session ID: %d\n" - "PPPOE Server MAC: %pM\n" - "PPPOE Local MAC: %pM\n", - npdm, npdm->session_id, - npdm->server_mac, npdm->local_mac); -} - -/* - * nss_pppoe_log_verbose() - * Log message contents. - */ -static void nss_pppoe_log_verbose(struct nss_pppoe_msg *npm) -{ - switch (npm->cm.type) { - case NSS_PPPOE_MSG_SESSION_CREATE: - nss_pppoe_log_session_create_msg(npm); - break; - - case NSS_PPPOE_MSG_SESSION_DESTROY: - nss_pppoe_log_session_destroy_msg(npm); - break; - - case NSS_PPPOE_MSG_SYNC_STATS: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", npm); - break; - } -} - -/* - * nss_pppoe_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_pppoe_log_tx_msg(struct nss_pppoe_msg *npm) -{ - if (npm->cm.type >= NSS_PPPOE_MSG_MAX) { - nss_warning("%px: Invalid message type\n", npm); - return; - } - - nss_info("%px: type[%d]:%s\n", npm, npm->cm.type, nss_pppoe_log_message_types_str[npm->cm.type]); - nss_pppoe_log_verbose(npm); -} - -/* - * nss_pppoe_log_rx_msg() - * Log messages received from FW. - */ -void nss_pppoe_log_rx_msg(struct nss_pppoe_msg *npm) -{ - if (npm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", npm); - return; - } - - if (npm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", npm, npm->cm.type, - nss_pppoe_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - npm, npm->cm.type, nss_pppoe_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response]); - -verbose: - nss_pppoe_log_verbose(npm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_log.h deleted file mode 100644 index 4636b08d8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_PPPOE_LOG_H -#define __NSS_PPPOE_LOG_H - -/* - * nss_pppoe.h - * NSS PPPOE header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_pppoe_log_tx_msg - * Logs a pppoe message that is sent to the NSS firmware. - */ -void nss_pppoe_log_tx_msg(struct nss_pppoe_msg *nim); - -/* - * nss_pppoe_log_rx_msg - * Logs a pppoe message that is received from the NSS firmware. - */ -void nss_pppoe_log_rx_msg(struct nss_pppoe_msg *nim); - -#endif /* __NSS_PPPOE_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_stats.c deleted file mode 100644 index 75b24c8ed..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_stats.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include -#include "nss_pppoe_stats.h" -#include "nss_pppoe_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_pppoe_stats_notifier); - -/* - * Lock used for PPPoE statistics - */ -static DEFINE_SPINLOCK(nss_pppoe_stats_lock); - -/* - * PPPoE session stats structure for debug interface - */ -struct nss_pppoe_stats_session_stats { - uint64_t stats[NSS_PPPOE_STATS_SESSION_MAX]; - /* stats for the session */ - int32_t if_index; /* net device index for the session */ - uint32_t if_num; /* nss interface number */ - bool valid; /* dynamic interface valid flag */ -}; - -/* - * PPPoE interface stats structure for base node and sessions - */ -struct nss_pppoe_stats { - uint64_t base_stats[NSS_PPPOE_STATS_BASE_MAX]; - /* Base node stats */ - struct nss_pppoe_stats_session_stats session_stats[NSS_MAX_PPPOE_DYNAMIC_INTERFACES]; - /* Per session stats */ -}; - -/* - * Global PPPoE stats decleration. - */ -static struct nss_pppoe_stats pppoe_stats; - -/* - * nss_pppoe_stats_read() - * Read pppoe statistics - */ -static ssize_t nss_pppoe_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - - uint32_t max_output_lines = 2 /* header & footer for session stats */ - + NSS_MAX_PPPOE_DYNAMIC_INTERFACES * (NSS_PPPOE_STATS_SESSION_MAX + 2) /*session stats */ - + 2 + NSS_PPPOE_STATS_BASE_MAX + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - int id; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Base node stats - */ - size_wr += nss_stats_print("pppoe", "pppoe base node stats start" - , NSS_STATS_SINGLE_INSTANCE - , nss_pppoe_strings_base_stats - , pppoe_stats.base_stats - , NSS_PPPOE_STATS_BASE_MAX - , lbuf, size_wr, size_al); - - /* - * Session stats - */ - for (id = 0; id < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; id++) { - if (!pppoe_stats.session_stats[id].valid) { - continue; - } - - dev = dev_get_by_index(&init_net, pppoe_stats.session_stats[id].if_index); - if (unlikely(!dev)) { - continue; - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d, netdevice=%s\n", id, - pppoe_stats.session_stats[id].if_num, dev->name); - dev_put(dev); - - size_wr += nss_stats_print("pppoe", "pppoe session node stats" - , id - , nss_pppoe_strings_session_stats - , pppoe_stats.session_stats[id].stats - , NSS_PPPOE_STATS_SESSION_MAX - , lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(lbuf); - return bytes_read; -} - -/* - * nss_pppoe_stats_pppoe_session_init() - * Initialize the session statistics. - */ -bool nss_pppoe_stats_pppoe_session_init(uint32_t if_num, struct net_device *dev) -{ - int i; - - spin_lock_bh(&nss_pppoe_stats_lock); - for (i = 0; i < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; i++) { - if (!pppoe_stats.session_stats[i].valid) { - pppoe_stats.session_stats[i].valid = true; - pppoe_stats.session_stats[i].if_num = if_num; - pppoe_stats.session_stats[i].if_index = dev->ifindex; - spin_unlock_bh(&nss_pppoe_stats_lock); - return true; - } - } - spin_unlock_bh(&nss_pppoe_stats_lock); - - return false; -} - -/* - * nss_pppoe_stats_pppoe_session_deinit() - * De-initialize the session's stats. - */ -void nss_pppoe_stats_pppoe_session_deinit(uint32_t if_num) -{ - int i; - - spin_lock_bh(&nss_pppoe_stats_lock); - for (i = 0; i < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; i++) { - if (pppoe_stats.session_stats[i].if_num == if_num) { - memset(&pppoe_stats.session_stats[i], 0, sizeof(pppoe_stats.session_stats[i])); - } - } - spin_unlock_bh(&nss_pppoe_stats_lock); -} - -/* - * nss_pppoe_stats_sync - * Per session debug stats for pppoe - */ -void nss_pppoe_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_pppoe_sync_stats_msg *stats_msg, uint16_t if_num) -{ - int i; - spin_lock_bh(&nss_pppoe_stats_lock); - for (i = 0; i < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; i++) { - if (pppoe_stats.session_stats[i].if_num == if_num) { - int j; - - /* - * Sync PPPoE session stats. - */ - pppoe_stats.session_stats[i].stats[NSS_PPPOE_STATS_SESSION_RX_PACKETS] += stats_msg->session_stats.node.rx_packets; - pppoe_stats.session_stats[i].stats[NSS_PPPOE_STATS_SESSION_RX_BYTES] += stats_msg->session_stats.node.rx_bytes; - pppoe_stats.session_stats[i].stats[NSS_PPPOE_STATS_SESSION_TX_PACKETS] += stats_msg->session_stats.node.tx_packets; - pppoe_stats.session_stats[i].stats[NSS_PPPOE_STATS_SESSION_TX_BYTES] += stats_msg->session_stats.node.tx_bytes; - pppoe_stats.session_stats[i].stats[NSS_PPPOE_STATS_SESSION_WRONG_VERSION_OR_TYPE] += stats_msg->session_stats.exception[NSS_PPPOE_SESSION_EXCEPTION_EVENT_WRONG_VERSION_OR_TYPE]; - pppoe_stats.session_stats[i].stats[NSS_PPPOE_STATS_SESSION_WRONG_CODE] += stats_msg->session_stats.exception[NSS_PPPOE_SESSION_EXCEPTION_EVENT_WRONG_CODE]; - pppoe_stats.session_stats[i].stats[NSS_PPPOE_STATS_SESSION_UNSUPPORTED_PPP_PROTOCOL] += stats_msg->session_stats.exception[NSS_PPPOE_SESSION_EXCEPTION_EVENT_UNSUPPORTED_PPP_PROTOCOL]; - - /* - * Sync PPPoE base node stats coming with this session's stats. - */ - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_RX_PACKETS] += stats_msg->base_stats.node.rx_packets; - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_RX_BYTES] += stats_msg->base_stats.node.rx_bytes; - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_TX_PACKETS] += stats_msg->base_stats.node.tx_packets; - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_TX_BYTES] += stats_msg->base_stats.node.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_RX_QUEUE_0_DROPPED + j] += stats_msg->base_stats.node.rx_dropped[j]; - } - - /* - * Sync PPPoE base exception stats coming with this session's stats. - */ - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_SHORT_PPPOE_HDR_LENGTH] += stats_msg->base_stats.exception[NSS_PPPOE_BASE_EXCEPTION_EVENT_SHORT_PPPOE_HDR_LENGTH]; - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_SHORT_PACKET_LENGTH] += stats_msg->base_stats.exception[NSS_PPPOE_BASE_EXCEPTION_EVENT_SHORT_PACKET_LENGTH]; - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_WRONG_VERSION_OR_TYPE] += stats_msg->base_stats.exception[NSS_PPPOE_BASE_EXCEPTION_EVENT_WRONG_VERSION_OR_TYPE]; - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_WRONG_CODE] += stats_msg->base_stats.exception[NSS_PPPOE_BASE_EXCEPTION_EVENT_WRONG_CODE]; - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_UNSUPPORTED_PPP_PROTOCOL] += stats_msg->base_stats.exception[NSS_PPPOE_BASE_EXCEPTION_EVENT_UNSUPPORTED_PPP_PROTOCOL]; - pppoe_stats.base_stats[NSS_PPPOE_STATS_BASE_DISABLED_BRIDGE_PACKET] += stats_msg->base_stats.exception[NSS_PPPOE_BASE_EXCEPTION_EVENT_DISABLED_BRIDGE_PACKET]; - break; - } - } - spin_unlock_bh(&nss_pppoe_stats_lock); -} - -/* - * nss_pppoe_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(pppoe); - -/* - * nss_pppoe_stats_dentry_create() - * Create PPPoE node statistics debug entry. - */ -void nss_pppoe_stats_dentry_create(void) -{ - nss_stats_create_dentry("pppoe", &nss_pppoe_stats_ops); -} - -/* - * nss_pppoe_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_pppoe_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_pppoe_stats_notification nss_pppoe_stats; - int id; - - for (id = 0; id < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; id++) { - if (pppoe_stats.session_stats[id].if_num == if_num) { - memcpy(&nss_pppoe_stats.session_stats, &pppoe_stats.session_stats[id].stats, sizeof(nss_pppoe_stats.session_stats)); - } - } - memcpy(&nss_pppoe_stats.base_stats, &pppoe_stats.base_stats, sizeof(nss_pppoe_stats.base_stats)); - nss_pppoe_stats.core_id = nss_ctx->id; - nss_pppoe_stats.if_num = if_num; - atomic_notifier_call_chain(&nss_pppoe_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&nss_pppoe_stats); -} - -/* - * nss_pppoe_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_pppoe_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_pppoe_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_pppoe_stats_register_notifier); - -/* - * nss_pppoe_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_pppoe_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_pppoe_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_pppoe_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_stats.h deleted file mode 100644 index 41c726ed1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_stats.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017,2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_PPPOE_STATS_H -#define __NSS_PPPOE_STATS_H - -/* - * PPPoE statistics APIs - */ -extern void nss_pppoe_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_pppoe_stats_dentry_create(void); -extern void nss_pppoe_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_pppoe_sync_stats_msg *stats_msg, uint16_t if_num); -extern bool nss_pppoe_stats_pppoe_session_init(uint32_t if_num, struct net_device *dev); -extern void nss_pppoe_stats_pppoe_session_deinit(uint32_t if_num); -#endif /* __NSS_PPPOE_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_strings.c deleted file mode 100644 index 953945bc6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_strings.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_pppoe_strings_session_stats - * PPPoE session stats strings. - */ -struct nss_stats_info nss_pppoe_strings_session_stats[NSS_PPPOE_STATS_SESSION_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_byts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_byts" , NSS_STATS_TYPE_COMMON}, - {"wrong_version_or_type" , NSS_STATS_TYPE_EXCEPTION}, - {"wrong_code" , NSS_STATS_TYPE_EXCEPTION}, - {"unsupported_ppp_protocol" , NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_pppoe_strings_base_stats - * PPPoE base node stats strings. - */ -struct nss_stats_info nss_pppoe_strings_base_stats[NSS_PPPOE_STATS_BASE_MAX] = { - {"rx_packets" , NSS_STATS_TYPE_COMMON}, - {"rx_bytes" , NSS_STATS_TYPE_COMMON}, - {"tx_packets" , NSS_STATS_TYPE_COMMON}, - {"tx_bytes" , NSS_STATS_TYPE_COMMON}, - {"rx_dropped[0]" , NSS_STATS_TYPE_DROP}, - {"rx_dropped[1]" , NSS_STATS_TYPE_DROP}, - {"rx_dropped[2]" , NSS_STATS_TYPE_DROP}, - {"rx_dropped[3]" , NSS_STATS_TYPE_DROP}, - {"short_pppoe_hdr_length" , NSS_STATS_TYPE_EXCEPTION}, - {"short_packet_length" , NSS_STATS_TYPE_EXCEPTION}, - {"wrong_version_or_type" , NSS_STATS_TYPE_EXCEPTION}, - {"wrong_code" , NSS_STATS_TYPE_EXCEPTION}, - {"unsupported_ppp_protocol" , NSS_STATS_TYPE_EXCEPTION}, - {"disabled_bridge_packet" , NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_pppoe_isession_stats_strings_read() - * Read PPPoE session statistics names. - */ -static ssize_t nss_pppoe_session_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_pppoe_strings_session_stats, NSS_PPPOE_STATS_SESSION_MAX); -} - -/* - * nss_pppoe_base_stats_strings_read() - * Read PPPoE base statistics names. - */ -static ssize_t nss_pppoe_base_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_pppoe_strings_base_stats, NSS_PPPOE_STATS_BASE_MAX); -} - -/* - * nss_pppoe_session_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(pppoe_session_stats); - -/* - * nss_pppoe_base_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(pppoe_base_stats); - -/* - * nss_pppoe_strings_dentry_create() - * Create PPPoE statistics strings debug entry. - */ -void nss_pppoe_strings_dentry_create(void) -{ - struct dentry *pppoe_d = NULL; - struct dentry *pppoe_session_stats_d = NULL; - struct dentry *pppoe_base_stats_d = NULL; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - pppoe_d = debugfs_create_dir("pppoe", nss_top_main.strings_dentry); - if (!pppoe_d) { - nss_warning("Failed to create qca-nss-drv/strings/pppoe directory"); - return; - } - - pppoe_session_stats_d = debugfs_create_file("session_stats_str", 0400, pppoe_d, &nss_top_main, &nss_pppoe_session_stats_strings_ops); - if (!pppoe_session_stats_d) { - nss_warning("Failed to create qca-nss-drv/stats/pppoe/session_stats_str file"); - debugfs_remove_recursive(pppoe_d); - return; - } - - pppoe_base_stats_d = debugfs_create_file("base_stats_str", 0400, pppoe_d, &nss_top_main, &nss_pppoe_base_stats_strings_ops); - if (!pppoe_base_stats_d) { - nss_warning("Failed to create qca-nss-drv/stats/pppoe/base_stats_str file"); - debugfs_remove_recursive(pppoe_d); - return; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_strings.h deleted file mode 100644 index 8cf9393a1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pppoe_strings.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_PPPOE_STRINGS_H -#define __NSS_PPPOE_STRINGS_H - -extern struct nss_stats_info nss_pppoe_strings_session_stats[NSS_PPPOE_STATS_SESSION_MAX]; -extern struct nss_stats_info nss_pppoe_strings_base_stats[NSS_PPPOE_STATS_BASE_MAX]; -extern void nss_pppoe_strings_dentry_create(void); - -#endif /* __NSS_PPPOE_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pptp.c b/feeds/ipq807x/qca-nss-drv/src/nss_pptp.c deleted file mode 100644 index 73cf43460..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pptp.c +++ /dev/null @@ -1,472 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include -#include "nss_tx_rx_common.h" -#include "nss_pptp_stats.h" -#include "nss_pptp_log.h" -#include "nss_pptp_strings.h" - -#define NSS_PPTP_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Data structures to store pptp nss debug stats - */ -static DEFINE_SPINLOCK(nss_pptp_session_debug_stats_lock); -static struct nss_pptp_stats_session_debug nss_pptp_session_debug_stats[NSS_MAX_PPTP_DYNAMIC_INTERFACES]; - -/* - * Private data structure - */ -static struct nss_pptp_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} pptp_pvt; - -/* - * nss_pptp_session_debug_stats_sync - * Per session debug stats for pptp - */ -void nss_pptp_session_debug_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_pptp_sync_session_stats_msg *stats_msg, uint16_t if_num) -{ - int i, j, if_type; - - if_type = nss_dynamic_interface_get_type(nss_pptp_get_context(), if_num); - spin_lock_bh(&nss_pptp_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) { - if (nss_pptp_session_debug_stats[i].if_num == if_num) { - break; - } - } - - if (i == NSS_MAX_PPTP_DYNAMIC_INTERFACES) { - spin_unlock_bh(&nss_pptp_session_debug_stats_lock); - return; - } - - if (if_type == NSS_DYNAMIC_INTERFACE_TYPE_PPTP_OUTER) { - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_RX_PACKETS] += - stats_msg->node_stats.rx_packets; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_RX_BYTES] += - stats_msg->node_stats.rx_bytes; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_TX_PACKETS] += - stats_msg->node_stats.tx_packets; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_TX_BYTES] += - stats_msg->node_stats.tx_bytes; - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_RX_QUEUE_0_DROP + j] += - stats_msg->node_stats.rx_dropped[j]; - } - } else { - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_RX_PACKETS] += - stats_msg->node_stats.rx_packets; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_RX_BYTES] += - stats_msg->node_stats.rx_bytes; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_TX_PACKETS] += - stats_msg->node_stats.tx_packets; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_TX_BYTES] += - stats_msg->node_stats.tx_bytes; - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_RX_QUEUE_0_DROP + j] += - stats_msg->node_stats.rx_dropped[j]; - } - } - - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_ENCAP_HEADROOM_ERR] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_ENCAP_HEADROOM_ERR]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_ENCAP_SMALL_SIZE] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_ENCAP_SMALL_SIZE]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_ENCAP_PNODE_ENQUEUE_FAIL] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_ENCAP_PNODE_ENQUEUE_FAIL]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_NO_SEQ_NOR_ACK] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_NO_SEQ_NOR_ACK]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_INVAL_GRE_FLAGS] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_INVAL_GRE_FLAGS]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_INVAL_GRE_PROTO] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_INVAL_GRE_PROTO]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_WRONG_SEQ] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_WRONG_SEQ]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_INVAL_PPP_HDR] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_INVAL_PPP_HDR]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_PPP_LCP] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_PPP_LCP]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_UNSUPPORTED_PPP_PROTO] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_UNSUPPORTED_PPP_PROTO]; - nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_PNODE_ENQUEUE_FAIL] += - stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_PNODE_ENQUEUE_FAIL]; - - spin_unlock_bh(&nss_pptp_session_debug_stats_lock); -} - -/* - * nss_pptp_global_session_stats_get() - * Get session pptp statitics. - */ -void nss_pptp_session_debug_stats_get(void *stats_mem) -{ - struct nss_pptp_stats_session_debug *stats = (struct nss_pptp_stats_session_debug *)stats_mem; - int i; - - if (!stats) { - nss_warning("No memory to copy pptp session stats"); - return; - } - - spin_lock_bh(&nss_pptp_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) { - if (nss_pptp_session_debug_stats[i].valid) { - memcpy(stats, &nss_pptp_session_debug_stats[i], sizeof(struct nss_pptp_stats_session_debug)); - stats++; - } - } - spin_unlock_bh(&nss_pptp_session_debug_stats_lock); -} - -/* - * nss_pptp_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_pptp_verify_if_num(uint32_t if_num) -{ - uint32_t if_type; - - if (nss_is_dynamic_interface(if_num) == false) { - return false; - } - - if_type = nss_dynamic_interface_get_type(nss_pptp_get_context(), if_num); - switch(if_type) { - case NSS_DYNAMIC_INTERFACE_TYPE_PPTP_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_PPTP_OUTER: - case NSS_DYNAMIC_INTERFACE_TYPE_PPTP_HOST_INNER: - return true; - } - - return false; -} - -/* - * nss_pptp_handler() - * Handle NSS -> HLOS messages for pptp tunnel - */ -static void nss_pptp_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_pptp_msg *ntm = (struct nss_pptp_msg *)ncm; - void *ctx; - - nss_pptp_msg_callback_t cb; - - BUG_ON(!nss_pptp_verify_if_num(ncm->interface)); - - /* - * Trace Messages - */ - nss_pptp_log_rx_msg(ntm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_PPTP_MSG_MAX) { - nss_warning("%px: received invalid message %d for PPTP interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_pptp_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - switch (ntm->cm.type) { - - case NSS_PPTP_MSG_SYNC_STATS: - /* - * Update session debug stats in stats msg and send statistics notifications to the registered modules. - */ - nss_pptp_session_debug_stats_sync(nss_ctx, &ntm->msg.stats, ncm->interface); - nss_pptp_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, pptp sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->pptp_msg_callback; - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_pptp_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call pptp tunnel callback - */ - if (!cb) { - nss_warning("%px: Event received for pptp tunnel interface %d before registration", nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_pptp_tx_msg() - * Transmit a pptp message to NSS firmware - */ -static nss_tx_status_t nss_pptp_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_pptp_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_pptp_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (!nss_is_dynamic_interface(ncm->interface)) { - nss_warning("%px: tx request for non dynamic interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_PPTP_MSG_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_pptp_sync_msg_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_pptp_sync_msg_callback(void *app_data, struct nss_pptp_msg *nim) -{ - nss_pptp_msg_callback_t callback = (nss_pptp_msg_callback_t)pptp_pvt.cb; - void *data = pptp_pvt.app_data; - - pptp_pvt.cb = NULL; - pptp_pvt.app_data = NULL; - - if (nim->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("pptp Error response %d\n", nim->cm.response); - - pptp_pvt.response = NSS_TX_FAILURE; - if (callback) { - callback(data, nim); - } - - complete(&pptp_pvt.complete); - return; - } - - pptp_pvt.response = NSS_TX_SUCCESS; - if (callback) { - callback(data, nim); - } - - complete(&pptp_pvt.complete); -} - -/* - * nss_pptp_tx_msg() - * Transmit a pptp message to NSS firmware synchronously. - */ -nss_tx_status_t nss_pptp_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_pptp_msg *msg) -{ - - nss_tx_status_t status; - int ret = 0; - - down(&pptp_pvt.sem); - pptp_pvt.cb = (void *)msg->cm.cb; - pptp_pvt.app_data = (void *)msg->cm.app_data; - - msg->cm.cb = (nss_ptr_t)nss_pptp_sync_msg_callback; - msg->cm.app_data = (nss_ptr_t)NULL; - - status = nss_pptp_tx_msg(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: pptp_tx_msg failed\n", nss_ctx); - up(&pptp_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&pptp_pvt.complete, msecs_to_jiffies(NSS_PPTP_TX_TIMEOUT)); - - if (!ret) { - nss_warning("%px: PPTP msg tx failed due to timeout\n", nss_ctx); - pptp_pvt.response = NSS_TX_FAILURE; - } - - status = pptp_pvt.response; - up(&pptp_pvt.sem); - return status; -} - -/* - * nss_pptp_tx_buf() - * Send packet to pptp interface owned by NSS - */ -nss_tx_status_t nss_pptp_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb) -{ - nss_trace("%px: pptp If Tx packet, id:%d, data=%px", nss_ctx, if_num, skb->data); - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} - -/* - * nss_register_pptp_if() - */ -struct nss_ctx_instance *nss_register_pptp_if(uint32_t if_num, - uint32_t type, - nss_pptp_callback_t pptp_data_callback, - nss_pptp_msg_callback_t notification_callback, - struct net_device *netdev, - uint32_t features, - void *app_ctx) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.pptp_handler_id]; - int i = 0; - - nss_assert(nss_ctx); - nss_assert(nss_pptp_verify_if_num(if_num)); - - nss_ctx->subsys_dp_register[if_num].type = type; - - nss_core_register_subsys_dp(nss_ctx, if_num, pptp_data_callback, NULL, app_ctx, netdev, features); - - nss_top_main.pptp_msg_callback = notification_callback; - - nss_core_register_handler(nss_ctx, if_num, nss_pptp_handler, NULL); - - spin_lock_bh(&nss_pptp_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) { - if (!nss_pptp_session_debug_stats[i].valid) { - nss_pptp_session_debug_stats[i].valid = true; - nss_pptp_session_debug_stats[i].if_num = if_num; - nss_pptp_session_debug_stats[i].if_index = netdev->ifindex; - break; - } - } - spin_unlock_bh(&nss_pptp_session_debug_stats_lock); - - return nss_ctx; -} - -/* - * nss_unregister_pptp_if() - */ -void nss_unregister_pptp_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.pptp_handler_id]; - int i; - int j; - - nss_assert(nss_ctx); - nss_assert(nss_is_dynamic_interface(if_num)); - - spin_lock_bh(&nss_pptp_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) { - if (nss_pptp_session_debug_stats[i].valid == true && - nss_pptp_session_debug_stats[i].if_num == if_num) { - nss_pptp_session_debug_stats[i].valid = false; - nss_pptp_session_debug_stats[i].if_num = 0; - nss_pptp_session_debug_stats[i].if_index = 0; - for (j = 0; j < NSS_PPTP_STATS_SESSION_MAX; j++) - nss_pptp_session_debug_stats[i].stats[j] = 0; - break; - } - } - spin_unlock_bh(&nss_pptp_session_debug_stats_lock); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.pptp_msg_callback = NULL; - - nss_core_unregister_handler(nss_ctx, if_num); -} - -/* - * nss_get_pptp_context() - */ -struct nss_ctx_instance *nss_pptp_get_context() -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.pptp_handler_id]; -} - -/* - * nss_pptp_msg_init() - * Initialize nss_pptp msg. - */ -void nss_pptp_msg_init(struct nss_pptp_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} - -/* nss_pptp_register_handler() - * debugfs stats msg handler received on static pptp interface - */ -void nss_pptp_register_handler(void) -{ - int i; - - nss_info("nss_pptp_register_handler"); - nss_core_register_handler(nss_pptp_get_context(), NSS_PPTP_INTERFACE, nss_pptp_handler, NULL); - - spin_lock_bh(&nss_pptp_session_debug_stats_lock); - for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) { - nss_pptp_session_debug_stats[i].valid = false; - nss_pptp_session_debug_stats[i].if_num = 0; - nss_pptp_session_debug_stats[i].if_index = 0; - } - spin_unlock_bh(&nss_pptp_session_debug_stats_lock); - - sema_init(&pptp_pvt.sem, 1); - init_completion(&pptp_pvt.complete); - - nss_pptp_stats_dentry_create(); - nss_pptp_strings_dentry_create(); -} - -EXPORT_SYMBOL(nss_pptp_get_context); -EXPORT_SYMBOL(nss_pptp_tx_msg_sync); -EXPORT_SYMBOL(nss_pptp_tx_buf); -EXPORT_SYMBOL(nss_unregister_pptp_if); -EXPORT_SYMBOL(nss_pptp_msg_init); -EXPORT_SYMBOL(nss_register_pptp_if); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_pptp_log.c deleted file mode 100644 index 136a3c863..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_log.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_pptp_log.c - * NSS PPTP logger file. - */ - -#include "nss_core.h" - -/* - * nss_pptp_log_message_types_str - * NSS PPTP message strings - */ -static int8_t *nss_pptp_log_message_types_str[NSS_PPTP_MSG_MAX] __maybe_unused = { - "PPTP Session Configure", - "PPTP Session Deconfigure", - "PPTP Stats", -}; - -/* - * nss_pptp_log_configure_msg() - * Log NSS PPTP Session Configure. - */ -static void nss_pptp_log_configure_msg(struct nss_pptp_msg *npm) -{ - struct nss_pptp_session_configure_msg *npcm __maybe_unused = &npm->msg.session_configure_msg; - nss_trace("%px: NSS PPTP Session Configure message\n" - "PPTP Source Call ID: %x\n" - "PPTP Destination Call ID: %x\n" - "PPTP Source IP: %pI4\n" - "PPTP Destination IP: %pI4\n", - npcm, npcm->src_call_id, - npcm->dst_call_id, &npcm->sip, - &npcm->dip); -} - -/* - * nss_pptp_log_deconfigure_msg() - * Log NSS PPTP Session Deconfigure. - */ -static void nss_pptp_log_deconfigure_msg(struct nss_pptp_msg *npm) -{ - struct nss_pptp_session_deconfigure_msg *npdm __maybe_unused = &npm->msg.session_deconfigure_msg; - nss_trace("%px: NSS PPTP Session Configure message \n" - "PPTP Source Call ID: %x\n", - npdm, npdm->src_call_id); -} - -/* - * nss_pptp_log_verbose() - * Log message contents. - */ -static void nss_pptp_log_verbose(struct nss_pptp_msg *npm) -{ - switch (npm->cm.type) { - case NSS_PPTP_MSG_SESSION_CONFIGURE: - nss_pptp_log_configure_msg(npm); - break; - - case NSS_PPTP_MSG_SESSION_DECONFIGURE: - nss_pptp_log_deconfigure_msg(npm); - break; - - case NSS_PPTP_MSG_SYNC_STATS: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", npm); - break; - } -} - -/* - * nss_pptp_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_pptp_log_tx_msg(struct nss_pptp_msg *npm) -{ - if (npm->cm.type >= NSS_PPTP_MSG_MAX) { - nss_warning("%px: Invalid message type\n", npm); - return; - } - - nss_info("%px: type[%d]:%s\n", npm, npm->cm.type, nss_pptp_log_message_types_str[npm->cm.type]); - nss_pptp_log_verbose(npm); -} - -/* - * nss_pptp_log_rx_msg() - * Log messages received from FW. - */ -void nss_pptp_log_rx_msg(struct nss_pptp_msg *npm) -{ - if (npm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", npm); - return; - } - - if (npm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", npm, npm->cm.type, - nss_pptp_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - npm, npm->cm.type, nss_pptp_log_message_types_str[npm->cm.type], - npm->cm.response, nss_cmn_response_str[npm->cm.response]); - -verbose: - nss_pptp_log_verbose(npm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_pptp_log.h deleted file mode 100644 index bb800d5ed..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_PPTP_LOG_H -#define __NSS_PPTP_LOG_H - -/* - * nss_pptp.h - * NSS PPTP header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_pptp_log_tx_msg - * Logs a pptp message that is sent to the NSS firmware. - */ -void nss_pptp_log_tx_msg(struct nss_pptp_msg *ntm); - -/* - * nss_pptp_log_rx_msg - * Logs a pptp message that is received from the NSS firmware. - */ -void nss_pptp_log_rx_msg(struct nss_pptp_msg *ntm); - -#endif /* __NSS_PPTP_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_pptp_stats.c deleted file mode 100644 index afbe00ee0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_stats.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_pptp_stats.h" -#include "nss_pptp_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_pptp_stats_notifier); - -struct nss_pptp_stats_session_debug pptp_session_stats[NSS_MAX_PPTP_DYNAMIC_INTERFACES]; - -/* - * nss_pptp_stats_read() - * Read pptp statistics - */ -static ssize_t nss_pptp_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - - uint32_t max_output_lines = 2 /* header & footer for session stats */ - + NSS_MAX_PPTP_DYNAMIC_INTERFACES * (NSS_PPTP_STATS_SESSION_MAX + 2) /*session stats */ - + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines ; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - int id, i; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - memset(&pptp_session_stats, 0, sizeof(struct nss_pptp_stats_session_debug) * NSS_MAX_PPTP_DYNAMIC_INTERFACES); - - /* - * Get all stats - */ - nss_pptp_session_debug_stats_get((void *)&pptp_session_stats); - - /* - * Session stats - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\npptp session stats start:\n\n"); - for (id = 0; id < NSS_MAX_PPTP_DYNAMIC_INTERFACES; id++) { - - if (!pptp_session_stats[id].valid) { - break; - } - - dev = dev_get_by_index(&init_net, pptp_session_stats[id].if_index); - if (likely(dev)) { - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d, netdevice=%s\n", id, - pptp_session_stats[id].if_num, dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d\n", id, - pptp_session_stats[id].if_num); - } - - for (i = 0; i < NSS_PPTP_STATS_SESSION_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %llu\n", nss_pptp_strings_session_debug_stats[i].stats_name, - pptp_session_stats[id].stats[i]); - } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\npptp session stats end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(lbuf); - return bytes_read; -} - -/* - * nss_pptp_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(pptp); - -/* - * nss_pptp_stats_dentry_create() - * Create PPTP node statistics debug entry. - */ -void nss_pptp_stats_dentry_create(void) -{ - nss_stats_create_dentry("pptp", &nss_pptp_stats_ops); -} - -/* - * nss_pptp_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_pptp_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_pptp_stats_notification pptp_stats; - int id; - - memset(&pptp_session_stats, 0, sizeof(pptp_session_stats)); - - /* - * Get all stats - */ - nss_pptp_session_debug_stats_get((void *)&pptp_session_stats); - - for (id = 0; id < NSS_MAX_PPTP_DYNAMIC_INTERFACES; id++) { - if (pptp_session_stats[id].if_num == if_num) { - memcpy(&pptp_stats.stats, &pptp_session_stats[id].stats, sizeof(pptp_stats.stats)); - } - } - pptp_stats.if_type = nss_dynamic_interface_get_type(nss_ctx, if_num); - pptp_stats.core_id = nss_ctx->id; - pptp_stats.if_num = if_num; - atomic_notifier_call_chain(&nss_pptp_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&pptp_stats); -} - -/* - * nss_pptp_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_pptp_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_pptp_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_pptp_stats_register_notifier); - -/* - * nss_pptp_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_pptp_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_pptp_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_pptp_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_pptp_stats.h deleted file mode 100644 index 11c016617..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_stats.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2016-2017,2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_PPTP_STATS_H -#define __NSS_PPTP_STATS_H - -/* - * NSS PPTP node statistics session - */ -struct nss_pptp_stats_session_debug { - uint64_t stats[NSS_PPTP_STATS_SESSION_MAX]; - int32_t if_index; - uint32_t if_num; /* nss interface number */ - bool valid; -}; - -/* - * NSS PPTP statistics APIs - */ -extern void nss_pptp_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_pptp_stats_dentry_create(void); - -#endif /* __NSS_PPTP_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_pptp_strings.c deleted file mode 100644 index 966ec07f3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_strings.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_pptp_strings_session_debug_stats - * PPTP statistics strings for NSS session statistics. - */ -struct nss_stats_info nss_pptp_strings_session_debug_stats[NSS_PPTP_STATS_SESSION_MAX] = { - {"ENCAP_RX_PACKETS", NSS_STATS_TYPE_COMMON}, - {"ENCAP_RX_BYTES", NSS_STATS_TYPE_COMMON}, - {"ENCAP_TX_PACKETS", NSS_STATS_TYPE_COMMON}, - {"ENCAP_TX_BYTES", NSS_STATS_TYPE_COMMON}, - {"ENCAP_RX_QUEUE_0_DROP", NSS_STATS_TYPE_DROP}, - {"ENCAP_RX_QUEUE_1_DROP", NSS_STATS_TYPE_DROP}, - {"ENCAP_RX_QUEUE_2_DROP", NSS_STATS_TYPE_DROP}, - {"ENCAP_RX_QUEUE_3_DROP", NSS_STATS_TYPE_DROP}, - {"DECAP_RX_PACKETS", NSS_STATS_TYPE_COMMON}, - {"DECAP_RX_BYTES", NSS_STATS_TYPE_COMMON}, - {"DECAP_TX_PACKETS", NSS_STATS_TYPE_COMMON}, - {"DECAP_TX_BYTES", NSS_STATS_TYPE_COMMON}, - {"DECAP_RX_QUEUE_0_DROP", NSS_STATS_TYPE_DROP}, - {"DECAP_RX_QUEUE_1_DROP", NSS_STATS_TYPE_DROP}, - {"DECAP_RX_QUEUE_2_DROP", NSS_STATS_TYPE_DROP}, - {"DECAP_RX_QUEUE_3_DROP", NSS_STATS_TYPE_DROP}, - {"ENCAP_HEADROOM_ERR", NSS_STATS_TYPE_ERROR}, - {"ENCAP_SMALL_SIZE", NSS_STATS_TYPE_SPECIAL}, - {"ENCAP_PNODE_ENQUEUE_FAIL", NSS_STATS_TYPE_ERROR}, - {"DECAP_NO_SEQ_NOR_ACK", NSS_STATS_TYPE_ERROR}, - {"DECAP_INVAL_GRE_FLAGS", NSS_STATS_TYPE_ERROR}, - {"DECAP_INVAL_GRE_PROTO", NSS_STATS_TYPE_ERROR}, - {"DECAP_WRONG_SEQ", NSS_STATS_TYPE_ERROR}, - {"DECAP_INVAL_PPP_HDR", NSS_STATS_TYPE_ERROR}, - {"DECAP_PPP_LCP", NSS_STATS_TYPE_SPECIAL}, - {"DECAP_UNSUPPORTED_PPP_PROTO", NSS_STATS_TYPE_ERROR}, - {"DECAP_PNODE_ENQUEUE_FAIL", NSS_STATS_TYPE_ERROR} -}; - -/* - * nss_pptp_strings_read() - * Read PPTP node statistics names. - */ -static ssize_t nss_pptp_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_pptp_strings_session_debug_stats, NSS_PPTP_STATS_SESSION_MAX); -} - -/* - * nss_pptp_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(pptp); - -/* - * nss_pptp_strings_dentry_create() - * Create PPTP statistics strings debug entry. - */ -void nss_pptp_strings_dentry_create(void) -{ - nss_strings_create_dentry("pptp", &nss_pptp_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_pptp_strings.h deleted file mode 100644 index 788a387c6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pptp_strings.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_PPTP_STRINGS_H -#define __NSS_PPTP_STRINGS_H - -extern struct nss_stats_info nss_pptp_strings_session_debug_stats[NSS_PPTP_STATS_SESSION_MAX]; -extern void nss_pptp_strings_dentry_create(void); - -#endif /* __NSS_PPTP_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_profiler.c b/feeds/ipq807x/qca-nss-drv/src/nss_profiler.c deleted file mode 100755 index 5717ac365..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_profiler.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_profiler.c - * NSS profiler APIs - */ - -#include "nss_tx_rx_common.h" - -/* - * nss_profiler_rx_msg_handler() - * Handle profiler information. - */ -static void nss_profiler_rx_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app) -{ - struct nss_profiler_msg *pm = (struct nss_profiler_msg*)ncm; - void *ctx = nss_ctx->nss_top->profiler_ctx[nss_ctx->id]; - nss_profiler_callback_t cb = nss_ctx->nss_top->profiler_callback[nss_ctx->id]; - - if (ncm->type >= NSS_PROFILER_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return; - } - - if (ncm->type <= NSS_PROFILER_FLOWCTRL_MSG) { - if (ncm->len > sizeof(pm->payload.pcmdp)) { - nss_warning("%px: reply for cmd %d size is wrong %d : %d\n", nss_ctx, ncm->type, ncm->len, ncm->interface); - return; - } - } else if (ncm->type <= NSS_PROFILER_DEBUG_REPLY_MSG) { - if (ncm->len > sizeof(pm->payload.pdm)) { - nss_warning("%px: reply for debug %d is too big %d\n", nss_ctx, ncm->type, ncm->len); - return; - } - } else if (ncm->type <= NSS_PROFILER_COUNTERS_MSG) { - if (ncm->len < (sizeof(pm->payload.pcmdp) - (PROFILE_MAX_APP_COUNTERS - pm->payload.pcmdp.num_counters) * sizeof(pm->payload.pcmdp.counters[0])) || ncm->len > sizeof(pm->payload.pcmdp)) { - nss_warning("%px: %d params data is too big %d : %d\n", nss_ctx, ncm->type, ncm->len, ncm->interface); - return; - } - } - - /* - * status per request callback - */ - if (ncm->response != NSS_CMN_RESPONSE_NOTIFY && ncm->cb) { - nss_info("%px: reply CB %px for %d %d\n", nss_ctx, (void *)ncm->cb, ncm->type, ncm->response); - cb = (nss_profiler_callback_t)ncm->cb; - } - - /* - * sample related callback - */ - if (!cb || !ctx) { - nss_warning("%px: Event received for profiler interface before registration", nss_ctx); - return; - } - - cb(ctx, (struct nss_profiler_msg *)ncm); -} - -/* - * nss_tx_profiler_if_buf() - * NSS profiler Tx API - */ -nss_tx_status_t nss_profiler_if_tx_buf(void *ctx, void *buf, uint32_t len, - void *cb, void *app_data) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)ctx; - struct nss_profiler_msg *npm; - struct nss_profiler_data_msg *pdm = (struct nss_profiler_data_msg *)buf; - nss_tx_status_t ret; - - nss_trace("%px: Profiler If Tx, buf=%px", nss_ctx, buf); - - if (sizeof(npm->payload) < len) { - nss_warning("%px: (%u)Bad message length(%u)", nss_ctx, NSS_PROFILER_INTERFACE, len); - return NSS_TX_FAILURE_TOO_LARGE; - } - - if (NSS_NBUF_PAYLOAD_SIZE < (len + sizeof(npm->cm))) { - nss_warning("%px: (%u)Message length(%u) is larger than payload size (%u)", - nss_ctx, NSS_PROFILER_INTERFACE, (uint32_t)(len + sizeof(npm->cm)), NSS_NBUF_PAYLOAD_SIZE); - return NSS_TX_FAILURE_TOO_LARGE; - } - - npm = kzalloc(sizeof(*npm), GFP_KERNEL); - if (!npm) { - nss_warning("%px: Failed to allocate memory for message\n", nss_ctx); - return NSS_TX_FAILURE; - } - - memcpy(&npm->payload, pdm, len); - nss_profiler_msg_init(npm, NSS_PROFILER_INTERFACE, pdm->hd_magic & 0xFF, len, - cb, app_data); - - ret = nss_core_send_cmd(nss_ctx, npm, sizeof(npm->cm) + len, NSS_NBUF_PAYLOAD_SIZE); - kfree(npm); - return ret; -} -EXPORT_SYMBOL(nss_profiler_if_tx_buf); - -/* - * nss_profiler_alloc_dma() - * Allocate a DMA for profiler. - */ -void *nss_profiler_alloc_dma(struct nss_ctx_instance *nss_ctx, struct nss_profile_sdma_producer **dma_p) -{ - int size; - void *kaddr; - struct nss_profile_sdma_producer *dma; - struct nss_profile_sdma_ctrl *ctrl = (struct nss_profile_sdma_ctrl *)nss_ctx->meminfo_ctx.sdma_ctrl; - if (!ctrl) - return NULL; - - dma = ctrl->producer; - *dma_p = dma; - size = dma->num_bufs * dma->buf_size; - kaddr = kmalloc(size, GFP_KERNEL | __GFP_ZERO); - - if (kaddr) { - dma->desc_ring = dma_map_single(nss_ctx->dev, kaddr, size, DMA_FROM_DEVICE); - NSS_CORE_DSB(); - } - ctrl->consumer[0].ring.kp = kaddr; - return kaddr; -} -EXPORT_SYMBOL(nss_profiler_alloc_dma); - -/* - * nss_profiler_release_dma() - * Free profiler DMA. - */ -void nss_profiler_release_dma(struct nss_ctx_instance *nss_ctx) -{ - struct nss_profile_sdma_ctrl *ctrl; - if (!nss_ctx) - return; - - ctrl = nss_ctx->meminfo_ctx.sdma_ctrl; - - if (ctrl && ctrl->consumer[0].ring.kp) { - kfree(ctrl->consumer[0].ring.kp); - ctrl->consumer[0].ring.kp = NULL; - } -} -EXPORT_SYMBOL(nss_profiler_release_dma); - -/* - * nss_profile_dma_register_cb - * Register a handler for profile DMA. - */ -bool nss_profile_dma_register_cb(struct nss_ctx_instance *nss_ctx, int id, - void (*cb)(void*), void *arg) -{ - struct nss_profile_sdma_ctrl *ctrl = (struct nss_profile_sdma_ctrl *)nss_ctx->meminfo_ctx.sdma_ctrl; - nss_info("%px dma_register_cb %d: %px %px\n", ctrl, id, cb, arg); - if (!ctrl) - return false; - - ctrl->consumer[id].dispatch.fp = cb; - ctrl->consumer[id].arg.kp = arg; - return true; -} -EXPORT_SYMBOL(nss_profile_dma_register_cb); - -/* - * nss_profile_dma_deregister_cb - * Deregister callback for profile DMA. - */ -bool nss_profile_dma_deregister_cb(struct nss_ctx_instance *nss_ctx, int id) -{ - struct nss_profile_sdma_ctrl *ctrl = (struct nss_profile_sdma_ctrl *)nss_ctx->meminfo_ctx.sdma_ctrl; - if (!ctrl) - return false; - - ctrl->consumer[id].dispatch.fp = NULL; - return true; -} -EXPORT_SYMBOL(nss_profile_dma_deregister_cb); - -/* - * nss_profile_dma_get_ctrl - * Wrapper to get profile DMA control. - */ -struct nss_profile_sdma_ctrl *nss_profile_dma_get_ctrl(struct nss_ctx_instance *nss_ctx) -{ - struct nss_profile_sdma_ctrl *ctrl = nss_ctx->meminfo_ctx.sdma_ctrl; - if (!ctrl) { - return ctrl; - } - - dmac_inv_range(ctrl, &ctrl->cidx); - dsb(sy); - return ctrl; -} -EXPORT_SYMBOL(nss_profile_dma_get_ctrl); - -/* - * nss_profiler_notify_register() - */ -void *nss_profiler_notify_register(nss_core_id_t core_id, nss_profiler_callback_t profiler_callback, void *ctx) -{ - nss_assert(core_id < NSS_CORE_MAX); - - if (NSS_CORE_STATUS_SUCCESS != - nss_core_register_handler(&nss_top_main.nss[core_id], NSS_PROFILER_INTERFACE, nss_profiler_rx_msg_handler, NULL)) { - nss_warning("Message handler FAILED to be registered for profiler"); - return NULL; - } - - nss_top_main.profiler_ctx[core_id] = ctx; - nss_top_main.profiler_callback[core_id] = profiler_callback; - - return (void *)&nss_top_main.nss[core_id]; -} -EXPORT_SYMBOL(nss_profiler_notify_register); - -/* - * nss_profiler_notify_unregister() - */ -void nss_profiler_notify_unregister(nss_core_id_t core_id) -{ - nss_assert(core_id < NSS_CORE_MAX); - - nss_core_unregister_handler(&nss_top_main.nss[core_id], NSS_PROFILER_INTERFACE); - nss_top_main.profiler_callback[core_id] = NULL; - nss_top_main.profiler_ctx[core_id] = NULL; -} -EXPORT_SYMBOL(nss_profiler_notify_unregister); - -/* - * nss_profiler_msg_init() - * Initialize profiler message. - */ -void nss_profiler_msg_init(struct nss_profiler_msg *npm, uint16_t if_num, uint32_t type, uint32_t len, - nss_profiler_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&npm->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_profiler_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_project.c b/feeds/ipq807x/qca-nss-drv/src/nss_project.c deleted file mode 100644 index 07402fb76..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_project.c +++ /dev/null @@ -1,338 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * @file nss_project.h - * NSS project APIs. - */ -#include "nss_tx_rx_common.h" - -static int nss_project_wt_stats_enable; - -/* - * nss_project_free_wt_stats() - * Frees a number of allocated worker thread statistics. - */ -static void nss_project_free_wt_stats(struct nss_worker_thread_stats *wt_stats, int num_alloc) -{ - int i; - - if (!wt_stats) { - return; - } - - for (i = 0; i < num_alloc; i++) { - kfree(wt_stats[i].irq_stats); - } - kfree(wt_stats); -} - -/* - * nss_project_alloc_wt_stats() - * Allocates worker thread stats for a given number of threads and IRQs. - */ -static struct nss_worker_thread_stats *nss_project_alloc_wt_stats(uint32_t thread_count, uint32_t irq_count) -{ - struct nss_worker_thread_stats *wt_stats; - int i; - - wt_stats = kzalloc(thread_count * sizeof(struct nss_worker_thread_stats), GFP_ATOMIC); - if (unlikely(!wt_stats)) { - return NULL; - } - - for (i = 0; i < thread_count; i++) { - wt_stats[i].irq_stats = - kzalloc(irq_count * sizeof(struct nss_project_irq_stats), GFP_ATOMIC); - if (unlikely(!wt_stats[i].irq_stats)) { - nss_project_free_wt_stats(wt_stats, i); - return NULL; - } - } - - return wt_stats; -} - -/* - * nss_project_wt_stats_enable_callback() - * Callback function for wt stats enable messages - */ -static void nss_project_wt_stats_enable_callback(void *app_data, struct nss_project_msg *msg) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)app_data; - struct nss_project_msg_wt_stats_enable *stats_enable = &msg->msg.wt_stats_enable; - struct nss_worker_thread_stats *stats_temp; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (msg->cm.response != NSS_CMN_RESPONSE_ACK) { - return; - } - - nss_info("%px: Received response ACK for worker thread stats enable msg.\n", nss_ctx); - - /* - * If statistics have already been allocated, nothing else to do. - */ - if (nss_ctx->wt_stats) { - return; - } - - stats_temp = nss_project_alloc_wt_stats(stats_enable->worker_thread_count, - stats_enable->irq_count); - if (unlikely(!stats_temp)) { - nss_warning("%px: Unable to allocate worker thread statistics.\n", nss_ctx); - return; - } - - spin_lock_bh(&nss_ctx->nss_top->stats_lock); - nss_ctx->wt_stats = stats_temp; - nss_ctx->worker_thread_count = stats_enable->worker_thread_count; - nss_ctx->irq_count = stats_enable->irq_count; - spin_unlock_bh(&nss_ctx->nss_top->stats_lock); -} - -/* - * nss_project_wt_stats_send_enable() - * Sends message to firmware to enable or disable worker_thread statistics collection. - */ -static nss_tx_status_t nss_project_wt_stats_send_enable(struct nss_ctx_instance *nss_ctx, bool enable) -{ - struct nss_project_msg *npm; - struct nss_cmn_msg *ncm; - nss_tx_status_t ret; - - npm = kzalloc(sizeof(*npm), GFP_KERNEL); - if (!npm) { - nss_warning("%px: Failed to allocate buffer for message\n", nss_ctx); - return NSS_TX_FAILURE; - } - - /* - * Populate the message - */ - ncm = &npm->cm; - nss_cmn_msg_init(ncm, NSS_PROJECT_INTERFACE, - NSS_PROJECT_MSG_WT_STATS_ENABLE, - sizeof(struct nss_project_msg_wt_stats_enable), - (void *)nss_project_wt_stats_enable_callback, - (void *)nss_ctx); - npm->msg.wt_stats_enable.enable = enable; - - ret = nss_core_send_cmd(nss_ctx, npm, sizeof(*npm), NSS_NBUF_PAYLOAD_SIZE); - kfree(npm); - return ret; -} - -/* - * nss_project_wt_stats_update() - * Updates stored statistics with the data found in the notify. - */ -static void nss_project_wt_stats_update(struct nss_ctx_instance *nss_ctx, - struct nss_project_msg_wt_stats_notify *stats_notify) -{ - struct nss_worker_thread_stats *wt_stats; - int i; - - if (unlikely(!nss_ctx->wt_stats)) { - nss_warning("%px: Worker thread statistics not yet allocated.\n", nss_ctx); - return; - } - - if (unlikely(stats_notify->threadno >= nss_ctx->worker_thread_count)) { - nss_warning("%px: Invalid WT number %d\n", nss_ctx, stats_notify->threadno); - return; - } - - if (unlikely(stats_notify->stats_written > NSS_PROJECT_IRQS_PER_MESSAGE)) { - nss_warning("%px: Invalid worker thread stats written count %d\n", - nss_ctx, stats_notify->stats_written); - return; - } - - wt_stats = &(nss_ctx->wt_stats[stats_notify->threadno]); - - if (unlikely(!wt_stats->irq_stats)) { - nss_warning("%px: Worker thread statistics not allocated for thread %d\n", - nss_ctx, stats_notify->threadno); - return; - } - - spin_lock_bh(&nss_ctx->nss_top->stats_lock); - for (i = 0; i < stats_notify->stats_written; ++i) { - int irq = stats_notify->stats[i].irq; - if (unlikely(irq >= nss_ctx->irq_count)) { - nss_warning("%px: Invalid IRQ number %d\n", nss_ctx, irq); - continue; - } - - wt_stats->irq_stats[irq] = stats_notify->stats[i]; - } - spin_unlock_bh(&nss_ctx->nss_top->stats_lock); -} - -/* - * nss_project_msg_handler() - * Handles metadata messages on the project interface. - */ -static void nss_project_msg_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_project_msg *npm = (struct nss_project_msg *)ncm; - nss_project_msg_callback_t cb; - - /* - * Sanity checks on message - */ - if (npm->cm.type >= NSS_PROJECT_MSG_MAX) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, npm->cm.type); - return; - } - - if (nss_cmn_get_msg_len(&(npm->cm)) > sizeof(struct nss_project_msg)) { - nss_warning("%px: message length is invalid: %d\n", nss_ctx, nss_cmn_get_msg_len(&(npm->cm))); - return; - } - - switch (npm->cm.type) { - case NSS_PROJECT_MSG_WT_STATS_NOTIFY: - nss_project_wt_stats_update(nss_ctx, &(npm->msg.wt_stats_notify)); - return; - } - - nss_core_log_msg_failures(nss_ctx, ncm); - - if (!ncm->cb) { - return; - } - - cb = (nss_project_msg_callback_t)ncm->cb; - cb((void *)nss_ctx, npm); -} - -/* - * nss_project_wt_stats_handler() - * Sysctl handler for wt_stats. - * - * Uses proc_dointvec to process data. For a write operation, also sends worker - * thread stats enable messages containing the new value to each NSS core. - */ -static int nss_project_wt_stats_handler(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - int i; - - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - /* - * In case of error, stop now. - */ - if (ret) { - return ret; - } - - /* - * No additional behavior necessary for a read operation. - */ - if (!write) { - return ret; - } - - /* - * If a value was written, send a message containing that value to each - * NSS core. - */ - for (i = 0; i < nss_top_main.num_nss; ++i) { - nss_project_wt_stats_send_enable(&(nss_top_main.nss[i]), - nss_project_wt_stats_enable); - } - return ret; - -} - -/* - * Tree of ctl_tables used to put the wt_stats proc node in the correct place in - * the file system. Allows the command $ echo 1 > proc/sys/dev/nss/project/wt_stats - * to enable worker thread statistics (echoing 0 into the same target will disable). - */ -static struct ctl_table nss_project_table[] = { - { - .procname = "wt_stats", - .data = &nss_project_wt_stats_enable, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_project_wt_stats_handler, - }, - { } -}; - -static struct ctl_table nss_project_dir[] = { - { - .procname = "project", - .mode = 0555, - .child = nss_project_table, - }, - { } -}; - -static struct ctl_table nss_project_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_project_dir, - }, - { } -}; - -static struct ctl_table nss_project_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_project_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_project_header; - -/* - * nss_project_register_sysctl() - * Registers any sysctl handlers for the project. - */ -void nss_project_register_sysctl(void) -{ - nss_project_header = register_sysctl_table(nss_project_root); -} - -/* - * nss_project_unregister_sysctl() - * De-registers any sysctl handlers for the project. - */ -void nss_project_unregister_sysctl(void) -{ - if (nss_project_header) { - unregister_sysctl_table(nss_project_header); - } -} - -/* - * nss_project_register_handler() - * Registers the handler for NSS->HLOS messages - */ -void nss_project_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_core_register_handler(nss_ctx, NSS_PROJECT_INTERFACE, nss_project_msg_handler, NULL); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan.c b/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan.c deleted file mode 100644 index abe78eeb7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan.c +++ /dev/null @@ -1,446 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - - /* - * nss_pvxlan.c - * NSS PVXLAN driver interface APIs - */ -#include "nss_core.h" -#include "nss_pvxlan.h" -#include "nss_cmn.h" -#include "nss_tx_rx_common.h" -#include "nss_pvxlan_stats.h" -#include "nss_pvxlan_log.h" - -#define NSS_PVXLAN_TX_TIMEOUT 3000 - -/* - * Spinlock for protecting tunnel operations colliding with a tunnel destroy - */ -DEFINE_SPINLOCK(nss_pvxlan_spinlock); - -/* - * Private data structure - */ -static struct nss_pvxlan_pvt { - struct semaphore sem; /* Semaphore structure. */ - struct completion complete; /* Completion structure. */ - int response; /* Response from FW. */ - void *cb; /* Original cb for msgs. */ - void *app_data; /* Original app_data for msgs. */ -} pvxlan_pvt; - -/* - * Per PVxLAN tunnel/interface number instance. - */ -struct nss_pvxlan_handle { - atomic_t refcnt; /* Reference count on the tunnel */ - uint32_t if_num; /* Interface number */ - uint32_t tunnel_status; /* 0=disable, 1=enabled */ - nss_pvxlan_msg_callback_t msg_callback; /* Msg callback */ - void *app_data; /* App data (argument) */ -}; - -/* - * Array of pointer for NSS PvLAN handles. Each handle has per-tunnel - * stats based on the if_num which is an index. - */ -static struct nss_pvxlan_handle *nss_pvxlan_hdl[NSS_MAX_DYNAMIC_INTERFACES]; - -/* - * nss_pvxlan_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_pvxlan_verify_if_num(uint32_t if_num) -{ - uint32_t type = nss_dynamic_interface_get_type(nss_pvxlan_get_ctx(), if_num); - - return ((type == NSS_DYNAMIC_INTERFACE_TYPE_PVXLAN_HOST_INNER) || - (type == NSS_DYNAMIC_INTERFACE_TYPE_PVXLAN_OUTER)); -} - -/* - * nss_pvxlan_hdl_instance_free() - * Free PVxLAN tunnel handle instance. - */ -static bool nss_pvxlan_hdl_instance_free(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_pvxlan_handle *h; - - spin_lock_bh(&nss_pvxlan_spinlock); - h = nss_pvxlan_hdl[if_num - NSS_DYNAMIC_IF_START]; - if (!h) { - spin_unlock_bh(&nss_pvxlan_spinlock); - nss_warning("%px: Instance does not exist: %d", nss_ctx, if_num); - return false; - } - - if (h->if_num != if_num) { - spin_unlock_bh(&nss_pvxlan_spinlock); - nss_warning("%px: Not correct if_num: %d", nss_ctx, if_num); - return false; - } - - nss_pvxlan_hdl[if_num - NSS_DYNAMIC_IF_START] = NULL; - spin_unlock_bh(&nss_pvxlan_spinlock); - kfree(h); - return true; -} - -/* - * nss_pvxlan_hdl_instance_alloc() - * Allocate PVxLAN tunnel instance. - */ -static bool nss_pvxlan_hdl_instance_alloc(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - nss_pvxlan_msg_callback_t notify_cb, void *app_data) -{ - struct nss_pvxlan_handle *h; - - /* - * Allocate a handle - */ - h = kzalloc(sizeof(struct nss_pvxlan_handle), GFP_ATOMIC); - if (!h) { - nss_warning("%px: no memory for allocating PVxLAN handle instance for interface : %d", nss_ctx, if_num); - return false; - } - h->if_num = if_num; - - spin_lock_bh(&nss_pvxlan_spinlock); - if (nss_pvxlan_hdl[if_num - NSS_DYNAMIC_IF_START] != NULL) { - spin_unlock_bh(&nss_pvxlan_spinlock); - kfree(h); - nss_warning("%px: The handle has been taken by another thread :%d", nss_ctx, if_num); - return false; - } - - h->msg_callback = notify_cb; - h->app_data = app_data; - nss_pvxlan_hdl[if_num - NSS_DYNAMIC_IF_START] = h; - spin_unlock_bh(&nss_pvxlan_spinlock); - - return true; -} - -/* - * nss_pvxlan_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_pvxlan_callback(void *app_data, struct nss_pvxlan_msg *nvxm) -{ - nss_pvxlan_msg_callback_t callback = (nss_pvxlan_msg_callback_t)pvxlan_pvt.cb; - void *data = pvxlan_pvt.app_data; - - pvxlan_pvt.response = NSS_TX_SUCCESS; - pvxlan_pvt.cb = NULL; - pvxlan_pvt.app_data = NULL; - - if (nvxm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("Pvxlan Error response %d\n", nvxm->cm.response); - pvxlan_pvt.response = nvxm->cm.response; - } - - if (callback) { - callback(data, nvxm); - } - complete(&pvxlan_pvt.complete); -} - -/* - * nss_pvxlan_handler() - * Handle NSS -> HLOS messages for PVxLAN. - */ -static void nss_pvxlan_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_pvxlan_msg *nvxm = (struct nss_pvxlan_msg *)ncm; - nss_pvxlan_msg_callback_t cb; - struct nss_pvxlan_handle * h; - - BUG_ON(!nss_pvxlan_verify_if_num(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_PVXLAN_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for PVXLAN interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_pvxlan_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Trace messages. - */ - nss_core_log_msg_failures(nss_ctx, ncm); - nss_pvxlan_log_rx_msg(nvxm); - - switch (nvxm->cm.type) { - case NSS_PVXLAN_MSG_TYPE_SYNC_STATS: - nss_pvxlan_stats_sync(nss_ctx, &nvxm->msg.stats, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - uint32_t if_num = ncm->interface - NSS_DYNAMIC_IF_START; - spin_lock_bh(&nss_pvxlan_spinlock); - h = nss_pvxlan_hdl[if_num]; - if (h) { - ncm->cb = (nss_ptr_t)h->msg_callback; - ncm->app_data = (nss_ptr_t)h->app_data; - } - spin_unlock_bh(&nss_pvxlan_spinlock); - - } - - cb = (nss_pvxlan_msg_callback_t)ncm->cb; - - /* - * Do we have a callback - */ - if (!cb) { - nss_trace("%px: cb is null for interface %d", nss_ctx, ncm->interface); - return; - } - - cb((void *)ncm->app_data, nvxm); -} - -/* - * nss_pvxlan_tx_msg() - * Transmit a PVXLAN message to NSS FW. Don't call this from softirq/interrupts. - */ -nss_tx_status_t nss_pvxlan_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_pvxlan_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - if (!nss_pvxlan_verify_if_num(msg->cm.interface)) { - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ncm->type >= NSS_PVXLAN_MSG_TYPE_MAX) { - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * Trace messages. - */ - nss_pvxlan_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_pvxlan_tx_msg); - -/* - * nss_pvxlan_tx_msg_sync() - * Transmit a pvxlan message to NSS firmware synchronously. - */ -nss_tx_status_t nss_pvxlan_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_pvxlan_msg *nvxm) -{ - nss_tx_status_t status; - int ret; - - down(&pvxlan_pvt.sem); - nvxm->cm.cb = (nss_ptr_t)nss_pvxlan_callback; - nvxm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_pvxlan_tx_msg(nss_ctx, nvxm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: pvxlan_tx_msg failed\n", nss_ctx); - up(&pvxlan_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&pvxlan_pvt.complete, msecs_to_jiffies(NSS_PVXLAN_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: pvxlan tx sync failed due to timeout\n", nss_ctx); - pvxlan_pvt.response = NSS_TX_FAILURE; - } - - status = pvxlan_pvt.response; - up(&pvxlan_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_pvxlan_tx_msg_sync); - -/* - * nss_pvxlan_tx_buf() - * Transmit data buffer (skb) to a NSS interface number - */ -nss_tx_status_t nss_pvxlan_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *buf, uint32_t if_num) -{ - BUG_ON(!nss_pvxlan_verify_if_num(if_num)); - - return nss_core_send_packet(nss_ctx, buf, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER | H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_pvxlan_tx_buf); - -/* - *********************************** - * Register/Unregister/Miscellaneous APIs - *********************************** - */ - -/* - * nss_pvxlan_unregister() - * Unregister a data packet notifier with NSS FW. - */ -bool nss_pvxlan_unregister(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx; - int32_t i; - - nss_ctx = nss_pvxlan_get_ctx(); - if (!nss_pvxlan_verify_if_num(if_num)) { - nss_warning("%px: data unregister received for invalid interface %d", nss_ctx, if_num); - return false; - } - - spin_lock_bh(&nss_pvxlan_tunnel_stats_debug_lock); - for (i = 0; i < NSS_PVXLAN_MAX_INTERFACES; i++) { - if (nss_pvxlan_tunnel_debug_stats[i].if_num != if_num) { - continue; - } - - memset(&nss_pvxlan_tunnel_debug_stats[i], 0, - sizeof(struct nss_pvxlan_tunnel_stats_debug)); - break; - } - spin_unlock_bh(&nss_pvxlan_tunnel_stats_debug_lock); - - nss_core_unregister_handler(nss_ctx, if_num); - nss_core_unregister_subsys_dp(nss_ctx, if_num); - nss_pvxlan_hdl_instance_free(nss_ctx, if_num); - return true; -} -EXPORT_SYMBOL(nss_pvxlan_unregister); - -/* - * nss_pvxlan_register() - * Registers a data packet notifier with NSS FW. - */ -struct nss_ctx_instance *nss_pvxlan_register(uint32_t if_num, - nss_pvxlan_buf_callback_t data_cb, - nss_pvxlan_msg_callback_t notify_cb, - struct net_device *netdev, - uint32_t features) -{ - struct nss_ctx_instance *nss_ctx; - int core_status; - int32_t i; - - nss_ctx = nss_pvxlan_get_ctx(); - if (!nss_pvxlan_verify_if_num(if_num)) { - nss_warning("%px: data register received for invalid interface %d", nss_ctx, if_num); - return NULL; - } - - core_status = nss_core_register_handler(nss_ctx, if_num, nss_pvxlan_msg_handler, NULL); - if (core_status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: nss core register handler failed for if_num:%d with error :%d", nss_ctx, if_num, core_status); - return NULL; - } - - if (!nss_pvxlan_hdl_instance_alloc(nss_ctx, if_num, notify_cb, (void *)netdev)) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: couldn't allocate handle instance for if_num:%d", nss_ctx, if_num); - return NULL; - } - - spin_lock_bh(&nss_pvxlan_tunnel_stats_debug_lock); - for (i = 0; i < NSS_PVXLAN_MAX_INTERFACES; i++) { - if (nss_pvxlan_tunnel_debug_stats[i].valid) { - continue; - } - - nss_pvxlan_tunnel_debug_stats[i].valid = true; - nss_pvxlan_tunnel_debug_stats[i].if_num = if_num; - nss_pvxlan_tunnel_debug_stats[i].if_index = netdev->ifindex; - break; - } - spin_unlock_bh(&nss_pvxlan_tunnel_stats_debug_lock); - - if (i == NSS_PVXLAN_MAX_INTERFACES) { - nss_warning("%px: No available debug stats instance :%d", nss_ctx, if_num); - nss_pvxlan_hdl_instance_free(nss_ctx, if_num); - nss_core_unregister_handler(nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, data_cb, NULL, NULL, netdev, features); - return nss_ctx; -} -EXPORT_SYMBOL(nss_pvxlan_register); - -/* - * nss_pvxlan_ifnum_with_core_id() - * Append core id to pvxlan interface num. - */ -int nss_pvxlan_ifnum_with_core_id(int if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_pvxlan_get_ctx(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_is_dynamic_interface(if_num)) { - nss_warning("%px: Invalid if_num: %d, must be a dynamic interface\n", nss_ctx, if_num); - return 0; - } - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_pvxlan_ifnum_with_core_id); - -/* - * nss_pvxlan_msg_init() - * Initialize pvxlan message. - */ -void nss_pvxlan_msg_init(struct nss_pvxlan_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, - nss_pvxlan_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, (void*)cb, app_data); -} -EXPORT_SYMBOL(nss_pvxlan_msg_init); - -/* - * nss_pvxlan_get_ctx() - * Return a Pvxlan NSS context. - */ -struct nss_ctx_instance *nss_pvxlan_get_ctx() -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.pvxlan_handler_id]; - return nss_ctx; -} -EXPORT_SYMBOL(nss_pvxlan_get_ctx); - -/* - * nss_pvxlan_init() - * Initializes Pvxlan. Gets called from nss_init.c. - */ -void nss_pvxlan_init() -{ - nss_pvxlan_stats_dentry_create(); - sema_init(&pvxlan_pvt.sem, 1); - init_completion(&pvxlan_pvt.complete); - - memset(&nss_pvxlan_hdl, 0, sizeof(nss_pvxlan_hdl)); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_log.c deleted file mode 100644 index af516ab54..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_log.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_pvxlan_log.c - * NSS PVXLAN logger file. - */ - -#include "nss_core.h" - -/* - * nss_pvxlan_log_message_types_str - * PVXLAN message strings - */ -static int8_t *nss_pvxlan_log_message_types_str[NSS_PVXLAN_MSG_TYPE_MAX] __maybe_unused = { - "PVxLAN Sync Stats", - "PVxLAN Tunnel Configure Rule", - "PVxLAN Tunnel Unconfigure Rule", - "PVxLAN Enable Tunnel", - "PVxLAN Disable Tunnel", - "PVxLAN Add MAC rule", - "PVxLAN Delete MAC rule" -}; - -/* - * nss_pvxlan_log_error_response_types_str - * Strings for error types for PVXLAN messages - */ -static int8_t *nss_pvxlan_log_error_response_types_str[NSS_PVXLAN_ERROR_MAX] __maybe_unused = { - "PVXLAN Invalid L3 Protocool", - "PVXLAN Invalid UDP Protocol", - "PVXLAN Tunnel Disabled", - "PVXLAN Tunnel Enabled", - "PVXLAN Tunnel Not Configured", - "PVXLAN Invalid IP Node", - "PVXLAN Invalid Flag", - "PVXLAN MAC Table Full", - "PVXLAN MAC Exists", - "PVXLAN MAC Does Not Exist" -}; - -/* - * nss_pvxlan_log_rule_msg() - * Log NSS PVXLAN rule message. - */ -static void nss_pvxlan_log_rule_msg(struct nss_pvxlan_rule_msg *npvrm) -{ - nss_trace("%px: NSS PVXLAN Rule message \n" - "Encap Rule Src IP: %px\n" - "Encap Rule Src Port: %d\n" - "Encap Rule Dst Ip: %px\n" - "Encap Rule Dst Port: %d\n" - "RPS: %d\n" - "Flags: %x\n" - "Tunnel ID: %d\n", - npvrm, - &npvrm->encap.src.ip, - npvrm->encap.src_port, - &npvrm->encap.dest.ip, - npvrm->encap.dest_port, - npvrm->rps, npvrm->flags, - npvrm->tunnel_id); -} - -/* - * nss_pvxlan_mac_rule_msg() - * Log NSS PVxLAN MAC rule message. - */ -static void nss_pvxlan_log_mac_msg(struct nss_pvxlan_mac_msg *npvcm) -{ - nss_trace("%px: NSS PVXLAN MAC message \n" - "PVxLAN Mac Addr: %x : %x : %x" - "PVxLAN Flags: %u\n" - "PVxLAN VNet ID: %u\n" - "PVxLAN Tunnel ID: %d\n" - "PVxLAN Policy ID: %d", - npvcm, - npvcm->mac_addr[0], npvcm->mac_addr[1], - npvcm->mac_addr[2], npvcm->flags, - npvcm->vnet_id, npvcm->tunnel_id, - npvcm->policy_id); -} - -/* - * nss_pvxlan_log_rule_cfg_msg() - * Log NSS PVxLAN rule configure message. - */ -static void nss_pvxlan_log_rule_cfg_msg(struct nss_pvxlan_msg *npvm) -{ - struct nss_pvxlan_rule_msg *npvrm __maybe_unused = &npvm->msg.rule_cfg; - nss_pvxlan_log_rule_msg(npvrm); -} - -/* - * nss_pvxlan_log_rule_uncfg_msg() - * Log NSS PVxLAN rule unconfigure message. - */ -static void nss_pvxlan_log_rule_uncfg_msg(struct nss_pvxlan_msg *npvm) -{ - struct nss_pvxlan_rule_msg *npvrm __maybe_unused = &npvm->msg.rule_uncfg; - nss_pvxlan_log_rule_msg(npvrm); -} - -/* - * nss_pvxlan_log_enable_msg() - * Log NSS PVxLAN rule enable message. - */ -static void nss_pvxlan_log_enable_msg(struct nss_pvxlan_msg *npvm) -{ - struct nss_pvxlan_tunnel_state_msg *npvrm __maybe_unused = &npvm->msg.enable; - nss_trace("%px: NSS PVXLAN Tunnel state message: Enable \n", npvrm); -} - -/* - * nss_pvxlan_log_disable_msg() - * Log NSS PVxLAN rule disable message. - */ -static void nss_pvxlan_log_disable_msg(struct nss_pvxlan_msg *npvm) -{ - nss_trace("%px: NSS PVXLAN Tunnel state message: Disable \n", npvm); -} - -/* - * nss_pvxlan_log_mac_add_msg() - * Log NSS PVXLAN mac rule add message. - */ -static void nss_pvxlan_log_mac_add_msg(struct nss_pvxlan_msg *npvm) -{ - struct nss_pvxlan_mac_msg *npvcm __maybe_unused = &npvm->msg.mac_add; - nss_pvxlan_log_mac_msg(npvcm); -} - -/* - * nss_pvxlan_log_mac_del_msg() - * Log NSS PVXLAN mac rule del message. - */ -static void nss_pvxlan_log_mac_del_msg(struct nss_pvxlan_msg *npvm) -{ - struct nss_pvxlan_mac_msg *npvcm __maybe_unused = &npvm->msg.mac_del; - nss_pvxlan_log_mac_msg(npvcm); -} - -/* - * nss_pvxlan_log_verbose() - * Log message contents. - */ -static void nss_pvxlan_log_verbose(struct nss_pvxlan_msg *npvm) -{ - switch (npvm->cm.type) { - case NSS_PVXLAN_MSG_TYPE_TUNNEL_CREATE_RULE: - nss_pvxlan_log_rule_cfg_msg(npvm); - break; - - case NSS_PVXLAN_MSG_TYPE_TUNNEL_DESTROY_RULE: - nss_pvxlan_log_rule_uncfg_msg(npvm); - break; - - case NSS_PVXLAN_MSG_TYPE_TUNNEL_ENABLE: - nss_pvxlan_log_enable_msg(npvm); - break; - - case NSS_PVXLAN_MSG_TYPE_TUNNEL_DISABLE: - nss_pvxlan_log_disable_msg(npvm); - break; - - case NSS_PVXLAN_MSG_TYPE_MAC_ADD: - nss_pvxlan_log_mac_add_msg(npvm); - break; - - case NSS_PVXLAN_MSG_TYPE_MAC_DEL: - nss_pvxlan_log_mac_del_msg(npvm); - break; - - case NSS_PVXLAN_MSG_TYPE_SYNC_STATS: - break; - - default: - nss_trace("%px: Invalid message type\n", npvm); - break; - } -} - -/* - * nss_pvxlan_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_pvxlan_log_tx_msg(struct nss_pvxlan_msg *npvm) -{ - if (npvm->cm.type >= NSS_PVXLAN_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", npvm); - return; - } - - nss_info("%px: type[%d]:%s\n", npvm, npvm->cm.type, nss_pvxlan_log_message_types_str[npvm->cm.type]); - nss_pvxlan_log_verbose(npvm); -} - -/* - * nss_pvxlan_log_rx_msg() - * Log messages received from FW. - */ -void nss_pvxlan_log_rx_msg(struct nss_pvxlan_msg *npvm) -{ - if (npvm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", npvm); - return; - } - - if (npvm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (npvm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", npvm, npvm->cm.type, - nss_pvxlan_log_message_types_str[npvm->cm.type], - npvm->cm.response, nss_cmn_response_str[npvm->cm.response]); - goto verbose; - } - - if (npvm->cm.error >= NSS_PVXLAN_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - npvm, npvm->cm.type, nss_pvxlan_log_message_types_str[npvm->cm.type], - npvm->cm.response, nss_cmn_response_str[npvm->cm.response], - npvm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - npvm, npvm->cm.type, nss_pvxlan_log_message_types_str[npvm->cm.type], - npvm->cm.response, nss_cmn_response_str[npvm->cm.response], - npvm->cm.error, nss_pvxlan_log_error_response_types_str[npvm->cm.error]); - -verbose: - nss_pvxlan_log_verbose(npvm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_log.h deleted file mode 100644 index cdc0dd772..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_PVXLAN_LOG_H__ -#define __NSS_PVXLAN_LOG_H__ - -/* - * nss_pvxlan_log.h - * NSS PVXLAN Log Header File. - */ - -/* - * nss_pvxlan_log_tx_msg - * Logs a PVxLAN message that is sent to the NSS firmware. - */ -void nss_pvxlan_log_tx_msg(struct nss_pvxlan_msg *ncm); - -/* - * nss_pvxlan_log_rx_msg - * Logs a PVxLAN message that is received from the NSS firmware. - */ -void nss_pvxlan_log_rx_msg(struct nss_pvxlan_msg *ncm); - -#endif /* __NSS_PVXLAN_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_stats.c deleted file mode 100644 index 59f861604..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_stats.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_pvxlan_stats.h" - -DEFINE_SPINLOCK(nss_pvxlan_tunnel_stats_debug_lock); -struct nss_pvxlan_tunnel_stats_debug nss_pvxlan_tunnel_debug_stats[NSS_PVXLAN_MAX_INTERFACES]; - -/* - * nss_pvxlan_tunnel_stats_debug_str - * PVxLAN statistics strings for nss tunnel stats - */ -static int8_t *nss_pvxlan_tunnel_stats_debug_str[NSS_PVXLAN_MAX_INTERFACES] = { - "rx_pkts", - "rx_bytes", - "tx_pkts", - "tx_bytes", - "rx_queue_0_dropped", - "rx_queue_1_dropped", - "rx_queue_2_dropped", - "rx_queue_3_dropped", - "MAC DB look up failed", - "UDP ENCAP look up failed", - "dropped packet malformed", - "dropped next node queue is full", - "dropped headroom insufficient", - "dropped version mismatch", - "dropped zero sized packet", - "dropped pbuf alloc failed", - "dropped linearization failed" -}; - -/* - * nss_pvxlan_tunnel_stats_debug_get() - * Get PVxLAN Tunnel statitics. - */ -static void nss_pvxlan_tunnel_stats_debug_get(struct nss_pvxlan_tunnel_stats_debug *stats) -{ - uint32_t i; - - if (!stats) { - nss_warning("No memory to copy pvxlan tunnel stats"); - return; - } - - spin_lock_bh(&nss_pvxlan_tunnel_stats_debug_lock); - for (i = 0; i < NSS_PVXLAN_MAX_INTERFACES; i++) { - if (nss_pvxlan_tunnel_debug_stats[i].valid) { - memcpy(stats, &nss_pvxlan_tunnel_debug_stats[i], - sizeof(struct nss_pvxlan_tunnel_stats_debug)); - stats++; - } - } - spin_unlock_bh(&nss_pvxlan_tunnel_stats_debug_lock); -} - -/* - * nss_pvxlan_stats_read() - * Read PVxLAN Tunnel statistics - */ -static ssize_t nss_pvxlan_stats_read(struct file *fp, char __user *ubuf, - size_t sz, loff_t *ppos) -{ - uint32_t max_output_lines = 2 + (NSS_PVXLAN_MAX_INTERFACES - * (NSS_PVXLAN_TUNNEL_STATS_MAX + 2)) + 2; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct net_device *dev; - uint32_t id, i; - struct nss_pvxlan_tunnel_stats_debug *pvxlan_tunnel_stats = NULL; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - pvxlan_tunnel_stats = kzalloc((sizeof(struct nss_pvxlan_tunnel_stats_debug) - * NSS_PVXLAN_MAX_INTERFACES), GFP_KERNEL); - if (unlikely(!pvxlan_tunnel_stats)) { - nss_warning("Could not allocate memory for populating PVxLAN stats"); - kfree(lbuf); - return 0; - } - - /* - * Get all stats - */ - nss_pvxlan_tunnel_stats_debug_get(pvxlan_tunnel_stats); - - /* - * Tunnel stats - */ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\n PVxLAN Tunnel stats start:\n\n"); - - for (id = 0; id < NSS_PVXLAN_MAX_INTERFACES; id++) { - if (!pvxlan_tunnel_stats[id].valid) - break; - - dev = dev_get_by_index(&init_net, pvxlan_tunnel_stats[id].if_index); - if (likely(dev)) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "%d. nss interface id=%d, netdevice=%s\n", - id, pvxlan_tunnel_stats[id].if_num, - dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "%d. nss interface id=%d\n", id, - pvxlan_tunnel_stats[id].if_num); - } - - for (i = 0; i < NSS_PVXLAN_TUNNEL_STATS_MAX; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%s = %llu\n", - nss_pvxlan_tunnel_stats_debug_str[i], - pvxlan_tunnel_stats[id].stats[i]); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\n PVxLAN Tunnel stats end\n"); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(pvxlan_tunnel_stats); - kfree(lbuf); - return bytes_read; -} - -/* - * nss_pvxlan_stats_sync() - * Sync function for pvxlan statistics - */ -void nss_pvxlan_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_pvxlan_stats_msg *stats_msg, uint32_t if_num) -{ - uint32_t i; - struct nss_pvxlan_tunnel_stats_debug *s = NULL; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - spin_lock_bh(&nss_pvxlan_tunnel_stats_debug_lock); - for (i = 0; i < NSS_PVXLAN_MAX_INTERFACES; i++) { - if (nss_pvxlan_tunnel_debug_stats[i].if_num == if_num) { - s = &nss_pvxlan_tunnel_debug_stats[i]; - break; - } - } - - if (!s) { - spin_unlock_bh(&nss_pvxlan_tunnel_stats_debug_lock); - nss_warning("%px: Tunnel not found: %u", nss_ctx, if_num); - return; - } - - s->stats[NSS_PVXLAN_TUNNEL_STATS_RX_PKTS] += stats_msg->node_stats.rx_packets; - s->stats[NSS_PVXLAN_TUNNEL_STATS_RX_BYTES] += stats_msg->node_stats.rx_bytes; - s->stats[NSS_PVXLAN_TUNNEL_STATS_TX_PKTS] += stats_msg->node_stats.tx_packets; - s->stats[NSS_PVXLAN_TUNNEL_STATS_TX_BYTES] += stats_msg->node_stats.tx_bytes; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - s->stats[NSS_PVXLAN_TUNNEL_STATS_RX_QUEUE_0_DROPPED + i] += stats_msg->node_stats.rx_dropped[i]; - } - s->stats[NSS_PVXLAN_TUNNEL_STATS_MAC_DB_LOOKUP_FAILED] += - stats_msg->mac_db_lookup_failed; - s->stats[NSS_PVXLAN_TUNNEL_STATS_UDP_ENCAP_LOOKUP_FAILED] += - stats_msg->udp_encap_lookup_failed; - s->stats[NSS_PVXLAN_TUNNEL_STATS_DROP_MALFORMED] += - stats_msg->dropped_malformed; - s->stats[NSS_PVXLAN_TUNNEL_STATS_DROP_NEXT_NODE_QUEUE_FULL] += - stats_msg->dropped_next_node_queue_full; - s->stats[NSS_PVXLAN_TUNNEL_STATS_DROP_HEADROOM_INSUFFICIENT] += - stats_msg->dropped_hroom; - s->stats[NSS_PVXLAN_TUNNEL_STATS_DROP_VERSION_MISMATCH] += - stats_msg->dropped_ver_mis; - s->stats[NSS_PVXLAN_TUNNEL_STATS_DROP_ZERO_SIZED_PACKET] += - stats_msg->dropped_zero_sized_packet; - s->stats[NSS_PVXLAN_TUNNEL_STATS_DROP_PBUF_ALLOC_FAILED] += - stats_msg->dropped_pbuf_alloc_failed; - s->stats[NSS_PVXLAN_TUNNEL_STATS_DROP_LINEAR_FAILED] += - stats_msg->dropped_linear_failed; - spin_unlock_bh(&nss_pvxlan_tunnel_stats_debug_lock); -} - -/* - * nss_pvxlan_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(pvxlan) - -/* - * nss_pvxlan_stats_dentry_create() - * Create gre tunnel statistics debug entry. - */ -void nss_pvxlan_stats_dentry_create(void) -{ - nss_stats_create_dentry("pvxlan", &nss_pvxlan_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_stats.h deleted file mode 100644 index 874bf785e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_pvxlan_stats.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_PVXLAN_STATS_H -#define __NSS_PVXLAN_STATS_H - -/* - * pvxlan statistic counters - */ -enum nss_pvxlan_tunnel_stats { - NSS_PVXLAN_TUNNEL_STATS_RX_PKTS, - NSS_PVXLAN_TUNNEL_STATS_RX_BYTES, - NSS_PVXLAN_TUNNEL_STATS_TX_PKTS, - NSS_PVXLAN_TUNNEL_STATS_TX_BYTES, - NSS_PVXLAN_TUNNEL_STATS_RX_QUEUE_0_DROPPED, - NSS_PVXLAN_TUNNEL_STATS_RX_QUEUE_1_DROPPED, - NSS_PVXLAN_TUNNEL_STATS_RX_QUEUE_2_DROPPED, - NSS_PVXLAN_TUNNEL_STATS_RX_QUEUE_3_DROPPED, - NSS_PVXLAN_TUNNEL_STATS_MAC_DB_LOOKUP_FAILED, - NSS_PVXLAN_TUNNEL_STATS_UDP_ENCAP_LOOKUP_FAILED, - NSS_PVXLAN_TUNNEL_STATS_DROP_MALFORMED, - NSS_PVXLAN_TUNNEL_STATS_DROP_NEXT_NODE_QUEUE_FULL, - NSS_PVXLAN_TUNNEL_STATS_DROP_HEADROOM_INSUFFICIENT, - NSS_PVXLAN_TUNNEL_STATS_DROP_VERSION_MISMATCH, - NSS_PVXLAN_TUNNEL_STATS_DROP_ZERO_SIZED_PACKET, - NSS_PVXLAN_TUNNEL_STATS_DROP_PBUF_ALLOC_FAILED, - NSS_PVXLAN_TUNNEL_STATS_DROP_LINEAR_FAILED, - NSS_PVXLAN_TUNNEL_STATS_MAX, -}; - -/* - * PVxLAN session debug statistics - */ -struct nss_pvxlan_tunnel_stats_debug { - uint64_t stats[NSS_PVXLAN_TUNNEL_STATS_MAX]; - int32_t if_index; - uint32_t if_num; /* nss interface number */ - bool valid; -}; - -/* - * Data structures to store PVxLAN nss debug stats - */ -extern spinlock_t nss_pvxlan_tunnel_stats_debug_lock; -extern struct nss_pvxlan_tunnel_stats_debug nss_pvxlan_tunnel_debug_stats[NSS_PVXLAN_MAX_INTERFACES]; - -/* - * PVxLAN statistics APIs - */ -extern void nss_pvxlan_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_pvxlan_stats_msg *stats_msg, uint32_t if_num); -extern void nss_pvxlan_stats_dentry_create(void); - -#endif /* __NSS_PVXLAN_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs.c b/feeds/ipq807x/qca-nss-drv/src/nss_qrfs.c deleted file mode 100644 index cfbff597e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs.c +++ /dev/null @@ -1,472 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_qrfs_stats.h" -#include "nss_qrfs_log.h" - -/* - * Notify data structure - */ -struct nss_qrfs_notify_data { - nss_qrfs_msg_callback_t qrfs_callback; - void *app_data; -}; - -static struct nss_qrfs_notify_data nss_qrfs_notify[NSS_CORE_MAX]; - -/* - * nss_qrfs_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_qrfs_verify_if_num(uint32_t if_num) -{ - return if_num == NSS_QRFS_INTERFACE; -} - -/* - * nss_qrfs_msg_handler() - * Handle NSS -> HLOS messages for QRFS - */ -static void nss_qrfs_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) -{ - struct nss_qrfs_msg *nqm = (struct nss_qrfs_msg *)ncm; - nss_qrfs_msg_callback_t cb; - - /* - * Trace messages. - */ - nss_qrfs_log_rx_msg(nqm); - - if (!nss_qrfs_verify_if_num(ncm->interface)) { - nss_warning("%px: invalid interface %d for QRFS\n", nss_ctx, ncm->interface); - return; - } - - /* - * Is this a valid request/response? - */ - if (ncm->type >= NSS_QRFS_MSG_MAX) { - nss_warning("%px: invalid message %d for QRFS\n", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_qrfs_msg)) { - nss_warning("%px: message length is greater than required: %d\n", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ncm->type) { - case NSS_QRFS_MSG_STATS_SYNC: - /* - * Update QRFS statistics. - */ - nss_qrfs_stats_sync(nss_ctx, &nqm->msg.stats_sync); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_qrfs_notify[nss_ctx->id].qrfs_callback; - ncm->app_data = (nss_ptr_t)nss_qrfs_notify[nss_ctx->id].app_data; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_qrfs_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nqm); -} - -/* - * nss_qrfs_get_ctx() - */ -static struct nss_ctx_instance *nss_qrfs_get_ctx(int core_id) -{ - return &nss_top_main.nss[core_id]; -} - -/* - * nss_qrfs_get_flow_keys() - * Get 5 tuple information from flow keys and set in flow rule message. - */ -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3, 18, 21)) -static bool nss_qrfs_get_flow_keys(struct nss_ctx_instance *nss_ctx, struct sk_buff *skb, - struct nss_qrfs_flow_rule_msg *nqfrm) -{ - struct flow_keys keys; - uint16_t protocol = skb->protocol; - bool res; - struct ipv6hdr *ip6hdr; - - res = skb_flow_dissect(skb, &keys); - if (!res) { - nss_warning("%px: failed to get flow keys\n", nss_ctx); - return res; - } - - nqfrm->protocol = keys.ip_proto; - nqfrm->src_port = keys.port16[0]; - nqfrm->dst_port = keys.port16[1]; - - if (protocol == htons(ETH_P_IP)) { - nqfrm->ip_version = 4; - nqfrm->src_addr[0] = keys.src; - nqfrm->dst_addr[0] = keys.dst; - return true; - } - - nqfrm->ip_version = 6; - ip6hdr = (struct ipv6hdr *)skb_network_header(skb); - if (!ip6hdr) { - nss_warning("%px: failed to get IPv6 address\n", nss_ctx); - return false; - } - - memcpy(nqfrm->src_addr, &ip6hdr->saddr, sizeof(struct in6_addr)); - memcpy(nqfrm->dst_addr, &ip6hdr->daddr, sizeof(struct in6_addr)); - - return true; -} -#else -static bool nss_qrfs_get_flow_keys(struct nss_ctx_instance *nss_ctx, struct sk_buff *skb, - struct nss_qrfs_flow_rule_msg *nqfrm) -{ - struct flow_keys keys; - bool res; - - res = skb_flow_dissect_flow_keys(skb, &keys, 0); - if (!res) { - nss_warning("%px: failed to get flow keys\n", nss_ctx); - return res; - } - - nqfrm->protocol = (uint16_t)keys.basic.ip_proto; - nqfrm->src_port = keys.ports.src; - nqfrm->dst_port = keys.ports.dst; - - if (keys.basic.n_proto == htons(ETH_P_IP)) { - nqfrm->ip_version = 4; - nqfrm->src_addr[0] = keys.addrs.v4addrs.src; - nqfrm->dst_addr[0] = keys.addrs.v4addrs.dst; - return true; - } - - nqfrm->ip_version = 6; - memcpy(nqfrm->src_addr, &keys.addrs.v6addrs.src, sizeof(struct in6_addr)); - memcpy(nqfrm->dst_addr, &keys.addrs.v6addrs.dst, sizeof(struct in6_addr)); - - return true; -} -#endif - -/* - * nss_qrfs_flow_add_msg_callback() - * Callback function for receiving flow add response messages. - */ -static void nss_qrfs_flow_add_msg_callback(void *app_data, struct nss_qrfs_msg *nqm) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = (struct nss_ctx_instance *)app_data; - struct nss_qrfs_flow_rule_msg *nqfrm; - - if (nqm->cm.type != NSS_QRFS_MSG_FLOW_ADD) { - nss_warning("%px: invalid flow response message %d\n", nss_ctx, nqm->cm.type); - return; - } - - nqfrm = &nqm->msg.flow_add; - - if ((nqfrm->ip_version != 4) && (nqfrm->ip_version != 6)) { - nss_warning("%px: invalid IP version %d\n", nss_ctx, nqfrm->ip_version); - return; - } - - if (nqm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: flow add configuration error: %d for NSS core %d\n", - nss_ctx, nqm->cm.error, nss_ctx->id); - } -} - -/* - * nss_qrfs_flow_delete_msg_callback() - * Callback function for receiving flow delete response messages. - */ -static void nss_qrfs_flow_delete_msg_callback(void *app_data, struct nss_qrfs_msg *nqm) -{ - struct nss_ctx_instance *nss_ctx __maybe_unused = (struct nss_ctx_instance *)app_data; - struct nss_qrfs_flow_rule_msg *nqfrm; - - if (nqm->cm.type != NSS_QRFS_MSG_FLOW_DELETE) { - nss_warning("%px: invalid flow response message %d\n", nss_ctx, nqm->cm.type); - return; - } - - nqfrm = &nqm->msg.flow_delete; - - if ((nqfrm->ip_version != 4) && (nqfrm->ip_version != 6)) { - nss_warning("%px: invalid IP version %d\n", nss_ctx, nqfrm->ip_version); - return; - } - - if (nqm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: flow delete configuration error: %d for NSS core %d\n", - nss_ctx, nqm->cm.error, nss_ctx->id); - } -} - -/* - * nss_qrfs_msg_init() - * Initialize the common header of QRFS message - */ -static void nss_qrfs_msg_init(struct nss_qrfs_msg *nqm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&nqm->cm, if_num, type, len, cb, app_data); -} - -/* - * nss_qrfs_tx_msg() - * Transmit a QRFS message to NSS firmware - */ -static nss_tx_status_t nss_qrfs_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_qrfs_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace messages. - */ - nss_qrfs_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (!nss_qrfs_verify_if_num(ncm->interface)) { - nss_warning("%px: interface is not QRFS interface: %d\n", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_QRFS_MSG_MAX) { - nss_warning("%px: message type is out of range: %d\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_qrfs_add_flow_rule() - * Set a QRFS flow rule add message and transmit the message to NSS core. - */ -static nss_tx_status_t nss_qrfs_add_flow_rule(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - struct sk_buff *skb, uint32_t cpu, bool need_cb) -{ - struct nss_qrfs_msg nqm; - struct nss_qrfs_flow_rule_msg *nqfrm; - nss_tx_status_t status; - nss_qrfs_msg_callback_t cb = NULL; - void *app_data = NULL; - bool res; - - memset(&nqm, 0, sizeof(struct nss_qrfs_msg)); - - if (need_cb) { - cb = nss_qrfs_flow_add_msg_callback; - app_data = (void *)nss_ctx; - } - - /* - * Initialize common header of QRFS flow rule add message. - */ - nss_qrfs_msg_init(&nqm, NSS_QRFS_INTERFACE, NSS_QRFS_MSG_FLOW_ADD, - sizeof(struct nss_qrfs_flow_rule_msg), cb, app_data); - - /* - * Set flow rule of QRFS flow rule add message - */ - nqfrm = &nqm.msg.flow_add; - res = nss_qrfs_get_flow_keys(nss_ctx, skb, nqfrm); - if (!res) { - return NSS_TX_FAILURE; - } - - nqfrm->cpu = (uint16_t)cpu; - nqfrm->if_num = if_num; - - /* - * Send QRFS flow rule add message to NSS core - */ - status = nss_qrfs_tx_msg(nss_ctx, &nqm); - if (status == NSS_TX_SUCCESS) { - return status; - } - - return NSS_TX_FAILURE; -} - -/* - * nss_qrfs_delete_flow_rule() - * Set a QRFS delete flow rule message and transmit the message to all NSS core. - */ -static nss_tx_status_t nss_qrfs_delete_flow_rule(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - struct sk_buff *skb, uint32_t cpu, bool need_cb) -{ - struct nss_qrfs_msg nqm; - struct nss_qrfs_flow_rule_msg *nqfrm; - nss_tx_status_t status; - nss_qrfs_msg_callback_t cb = NULL; - void *app_data = NULL; - bool res; - - memset(&nqm, 0, sizeof(struct nss_qrfs_msg)); - - if (need_cb) { - cb = nss_qrfs_flow_delete_msg_callback; - app_data = (void *)nss_ctx; - } - - /* - * Initialize common header of QRFS flow rule delete message. - */ - nss_qrfs_msg_init(&nqm, NSS_QRFS_INTERFACE, NSS_QRFS_MSG_FLOW_DELETE, - sizeof(struct nss_qrfs_flow_rule_msg), cb, app_data); - - /* - * Set flow rule of QRFS flow rule delete message - */ - nqfrm = &nqm.msg.flow_delete; - res = nss_qrfs_get_flow_keys(nss_ctx, skb, nqfrm); - if (!res) { - return NSS_TX_FAILURE; - } - - nqfrm->cpu = (uint16_t)cpu; - nqfrm->if_num = if_num; - - /* - * Send QRFS flow rule delete message to NSS core - */ - status = nss_qrfs_tx_msg(nss_ctx, &nqm); - if (status == NSS_TX_SUCCESS) { - return status; - } - - return NSS_TX_FAILURE; -} - -/* - * nss_qrfs_set_flow_rule() - * Set a QRFS flow rule message and transmit the message to all NSS cores. - */ -nss_tx_status_t nss_qrfs_set_flow_rule(struct sk_buff *skb, uint32_t cpu, uint32_t action) -{ - struct nss_ctx_instance *nss_ctx; - nss_tx_status_t status; - int i; - - for (i = 0; i < NSS_CORE_MAX; i++) { - nss_ctx = nss_qrfs_get_ctx(i); - - /* - * Set QRFS flow rule message and transmit the message to NSS core. - * - * TODO: Remove if_num parameter from add_flow_rule() and - * delete_flow_rule(), since it is unused in firmware. - */ - if (action == NSS_QRFS_MSG_FLOW_ADD) { - status = nss_qrfs_add_flow_rule(nss_ctx, 0, skb, cpu, true); - } else { - status = nss_qrfs_delete_flow_rule(nss_ctx, 0, skb, cpu, true); - } - - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: failed to send flow rule to NSS core %d\n", nss_ctx, i); - return NSS_TX_FAILURE; - } - } - - return NSS_TX_SUCCESS; -} -EXPORT_SYMBOL(nss_qrfs_set_flow_rule); - -/* - * nss_qrfs_register_handler() - */ -void nss_qrfs_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_core_register_handler(nss_ctx, NSS_QRFS_INTERFACE, nss_qrfs_msg_handler, NULL); - - if (nss_ctx->id == NSS_CORE_0) { - nss_qrfs_stats_dentry_create(); - } -} -EXPORT_SYMBOL(nss_qrfs_register_handler); - -/* - * nss_qrfs_notify_register() - * Register to receive QRFS notify messages. - */ -struct nss_ctx_instance *nss_qrfs_notify_register(int core, nss_qrfs_msg_callback_t cb, void *app_data) -{ - if (core >= NSS_CORE_MAX) { - nss_warning("Input core number %d is wrong\n", core); - return NULL; - } - - nss_qrfs_notify[core].qrfs_callback = cb; - nss_qrfs_notify[core].app_data = app_data; - - return (struct nss_ctx_instance *)&nss_top_main.nss[core]; -} - -/* - * nss_qrfs_notify_unregister() - * Unregister to receive QRFS notify messages. - */ -void nss_qrfs_notify_unregister(int core) -{ - if (core >= NSS_CORE_MAX) { - nss_warning("Input core number %d is wrong\n", core); - return; - } - - nss_qrfs_notify[core].qrfs_callback = NULL; - nss_qrfs_notify[core].app_data = NULL; -} - -/* - * nss_qrfs_init() - */ -void nss_qrfs_init(void) -{ - int core; - - for (core = 0; core < NSS_CORE_MAX; core++) { - nss_qrfs_notify_register(core, NULL, NULL); - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_log.c deleted file mode 100644 index d481e2866..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_log.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_qrfs_log.c - * NSS QRFS logger file. - */ - -#include "nss_core.h" -#define NSS_QRFS_LOG_IPV4 4 -#define NSS_QRFS_LOG_IPV6 6 - -/* - * nss_qrfs_log_message_types_str - * QRFS message strings - */ -static int8_t *nss_qrfs_log_message_types_str[NSS_QRFS_MSG_MAX] __maybe_unused = { - "QRFS Flow Add Message", - "QRFS Flow Delete Message", - "QRFS MAC Add Message", - "QRFS MAC Delete Message", - "QRFS Stats Sync", -}; - -/* - * nss_qrfs_log_error_response_types_str - * Strings for error types for QRFS messages - */ -static int8_t *nss_qrfs_log_error_response_types_str[NSS_QRFS_ERROR_MAX] __maybe_unused = { - "QRFS Invalid Message Type", - "QRFS Invalid Message Size", - "QRFS Invalid IP Version", - "QRFS V4 Flow Table Full", - "QRFS V6 Flow Table Full", - "QRFS MAC Table Full", -}; - -/* - * nss_qrfs_log_flow_rule_msg() - * Log NSS QRFS Flow Rule Message. - */ -static void nss_qrfs_log_flow_rule_msg(struct nss_qrfs_flow_rule_msg *nqfm) -{ - nss_trace("%px: NSS QRFS Flow Rule Message:\n" - "QRFS Source Port: %d\n" - "QRFS Destination Port: %d\n" - "QRFS IP Version: %d\n" - "QRFS Protcol: %d\n" - "QRFS CPU ID: %d\n" - "QRFS Physical Interface Number: %d\n", - nqfm, nqfm->src_port, - nqfm->dst_port, nqfm->ip_version, - nqfm->protocol, nqfm->cpu, - nqfm->if_num); - - /* - * Continuation of log. Different identifiers based on ip_version - */ - if (nqfm->ip_version == NSS_QRFS_LOG_IPV6) { - nss_trace("QRFS Source Address: %pI6\n" - "QRFS Destination Address: %pI6\n", - nqfm->src_addr, nqfm->dst_addr); - } else if (nqfm->ip_version == NSS_QRFS_LOG_IPV4) { - nss_trace("QRFS Source Address: %pI4\n" - "QRFS Destination Address: %pI4\n", - nqfm->src_addr, nqfm->dst_addr); - } -} - -/* - * nss_qrfs_log_mac_rule_msg() - * Log NSS QRFS MAC Rule Message. - */ -static void nss_qrfs_log_mac_rule_msg(struct nss_qrfs_mac_rule_msg *nqmm) -{ - nss_trace("%px: NSS QRFS MAC Rule Message:\n" - "QRFS MAC: %pM\n" - "QRFS CPU ID: %d\n" - "QRFS Physical Interface Number: %d\n", - nqmm, nqmm->mac, - nqmm->cpu, nqmm->if_num); -} - -/* - * nss_qrfs_log_verbose() - * Log message contents. - */ -static void nss_qrfs_log_verbose(struct nss_qrfs_msg *nqm) -{ - switch (nqm->cm.type) { - case NSS_QRFS_MSG_FLOW_ADD: - case NSS_QRFS_MSG_FLOW_DELETE: - nss_qrfs_log_flow_rule_msg(&nqm->msg.flow_add); - break; - - case NSS_QRFS_MSG_MAC_ADD: - case NSS_QRFS_MSG_MAC_DELETE: - nss_qrfs_log_mac_rule_msg(&nqm->msg.mac_add); - break; - - case NSS_QRFS_MSG_STATS_SYNC: - /* - * No log for valid stats message. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", nqm); - break; - } -} - -/* - * nss_qrfs_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_qrfs_log_tx_msg(struct nss_qrfs_msg *nqm) -{ - if (nqm->cm.type >= NSS_QRFS_MSG_MAX) { - nss_warning("%px: Invalid message type\n", nqm); - return; - } - - nss_info("%px: type[%d]:%s\n", nqm, nqm->cm.type, nss_qrfs_log_message_types_str[nqm->cm.type]); - nss_qrfs_log_verbose(nqm); -} - -/* - * nss_qrfs_log_rx_msg() - * Log messages received from FW. - */ -void nss_qrfs_log_rx_msg(struct nss_qrfs_msg *nqm) -{ - if (nqm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nqm); - return; - } - - if (nqm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nqm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nqm, nqm->cm.type, - nss_qrfs_log_message_types_str[nqm->cm.type], - nqm->cm.response, nss_cmn_response_str[nqm->cm.response]); - goto verbose; - } - - if (nqm->cm.error >= NSS_QRFS_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nqm, nqm->cm.type, nss_qrfs_log_message_types_str[nqm->cm.type], - nqm->cm.response, nss_cmn_response_str[nqm->cm.response], - nqm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nqm, nqm->cm.type, nss_qrfs_log_message_types_str[nqm->cm.type], - nqm->cm.response, nss_cmn_response_str[nqm->cm.response], - nqm->cm.error, nss_qrfs_log_error_response_types_str[nqm->cm.error]); - -verbose: - nss_qrfs_log_verbose(nqm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_log.h deleted file mode 100644 index de9832e66..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_QRFS_LOG_H__ -#define __NSS_QRFS_LOG_H__ - -/* - * nss_qrfs_log.h - * NSS QRFS Log Header File - */ - -/* - * nss_qrfs_log_tx_msg - * Logs a qrfs message that is sent to the NSS firmware. - */ -void nss_qrfs_log_tx_msg(struct nss_qrfs_msg *nqm); - -/* - * nss_qrfs_log_rx_msg - * Logs a qrfs message that is received from the NSS firmware. - */ -void nss_qrfs_log_rx_msg(struct nss_qrfs_msg *nqm); - -#endif /* __NSS_QRFS_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_stats.c deleted file mode 100644 index 694908307..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_stats.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_qrfs_stats.h" - -/* - * Spinlock to protect QRFS statistics update/read - */ -DEFINE_SPINLOCK(nss_qrfs_stats_lock); - -/* - * nss_qrfs_stats_str - * QRFS stats strings - */ -struct nss_stats_info nss_qrfs_stats_str[NSS_QRFS_STATS_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_byts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_byts" , NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops" , NSS_STATS_TYPE_DROP}, - {"invalid_offset" , NSS_STATS_TYPE_EXCEPTION}, - {"unknown_protocol" , NSS_STATS_TYPE_EXCEPTION}, - {"ipv4_flow_rule_hits" , NSS_STATS_TYPE_SPECIAL}, - {"ipv6_flow_rule_hits" , NSS_STATS_TYPE_SPECIAL} -}; - -uint64_t nss_qrfs_stats[NSS_MAX_CORES][NSS_QRFS_STATS_MAX]; - -/* - * nss_qrfs_stats_read() - * Read QRFS statistics. - */ -static ssize_t nss_qrfs_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i, core; - - /* - * Max output lines = #stats + few blank lines for banner printing + - * Number of Extra outputlines for future reference to add new stats. - */ - uint32_t max_output_lines = (NSS_QRFS_STATS_MAX + 3) * NSS_MAX_CORES + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_QRFS_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "qrfs", NSS_STATS_SINGLE_CORE); - /* - * QRFS statistics - */ - for (core = 0; core < nss_top_main.num_nss; core++) { - spin_lock_bh(&nss_qrfs_stats_lock); - for (i = 0; i < NSS_QRFS_STATS_MAX; i++) { - stats_shadow[i] = nss_qrfs_stats[core][i]; - } - spin_unlock_bh(&nss_qrfs_stats_lock); - - size_wr += nss_stats_print("qrfs", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_qrfs_stats_str - , stats_shadow - , NSS_QRFS_STATS_MAX - , lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_qrfs_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(qrfs) - -/* - * nss_qrfs_stats_dentry_create() - * Create QRFS statistics debug entry. - */ -void nss_qrfs_stats_dentry_create(void) -{ - nss_stats_create_dentry("qrfs", &nss_qrfs_stats_ops); -} - -/* - * nss_qrfs_stats_sync() - * Handle the syncing of NSS QRFS statistics. - */ -void nss_qrfs_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_qrfs_stats_sync_msg *nqssm) -{ - int id = nss_ctx->id; - int j; - - spin_lock_bh(&nss_qrfs_stats_lock); - - /* - * Common node stats - */ - nss_qrfs_stats[id][NSS_STATS_NODE_RX_PKTS] += nqssm->node_stats.rx_packets; - nss_qrfs_stats[id][NSS_STATS_NODE_RX_BYTES] += nqssm->node_stats.rx_bytes; - nss_qrfs_stats[id][NSS_STATS_NODE_TX_PKTS] += nqssm->node_stats.tx_packets; - nss_qrfs_stats[id][NSS_STATS_NODE_TX_BYTES] += nqssm->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_qrfs_stats[id][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nqssm->node_stats.rx_dropped[j]; - } - - /* - * QRFS statistics - */ - nss_qrfs_stats[id][NSS_QRFS_STATS_INVALID_OFFSET] += nqssm->invalid_offset; - nss_qrfs_stats[id][NSS_QRFS_STATS_UNKNOWN_PROTO] += nqssm->unknown_protocol; - nss_qrfs_stats[id][NSS_QRFS_STATS_IPV4_FLOW_HITS] += nqssm->ipv4_flow_rule_hits; - nss_qrfs_stats[id][NSS_QRFS_STATS_IPV6_FLOW_HITS] += nqssm->ipv6_flow_rule_hits; - - spin_unlock_bh(&nss_qrfs_stats_lock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_stats.h deleted file mode 100644 index 7992270da..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qrfs_stats.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_QRFS_STATS_H -#define __NSS_QRFS_STATS_H - -/* - * QRFS node statistics - */ -enum nss_qrfs_stats_types { - NSS_QRFS_STATS_INVALID_OFFSET = NSS_STATS_NODE_MAX, - /* Number of packets with invalid L3, L4 offset */ - NSS_QRFS_STATS_UNKNOWN_PROTO, /* Number of packets with protocol other than TCP, UDP */ - NSS_QRFS_STATS_IPV4_FLOW_HITS, /* Number of IPv4 flow rule hits */ - NSS_QRFS_STATS_IPV6_FLOW_HITS, /* Number of IPv6 flow rule hits */ - NSS_QRFS_STATS_MAX, -}; - -/* - * QRFS statistics APIs - */ -extern void nss_qrfs_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_qrfs_stats_sync_msg *nqssm); -extern void nss_qrfs_stats_dentry_create(void); - -#endif /* __NSS_QRFS_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn.c b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn.c deleted file mode 100644 index b6068d947..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn.c +++ /dev/null @@ -1,344 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_qvpn_stats.h" -#include "nss_qvpn_strings.h" -#include "nss_qvpn_log.h" - -#define NSS_QVPN_TX_TIMEOUT 1000 /* 1 Second */ -#define NSS_QVPN_INTERFACE_MAX_LONG BITS_TO_LONGS(NSS_MAX_NET_INTERFACES) /**< QVPN interface mapping bits. */ - -/* - * Private data structure - */ -static struct nss_qvpn_pvt { - struct semaphore sem; - struct completion complete; - unsigned long if_map[NSS_QVPN_INTERFACE_MAX_LONG]; - enum nss_qvpn_error_type resp; -} qvpn_pvt; - -/* - * nss_qvpn_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_qvpn_verify_if_num(uint32_t if_num) -{ - enum nss_dynamic_interface_type if_type; - - if_type = nss_dynamic_interface_get_type(nss_qvpn_get_context(), if_num); - if ((if_type != NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER) && - (if_type != NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER)) { - nss_warning("%px: if_num = %u interface type returned is %d\n", nss_qvpn_get_context(), if_num, if_type); - return false; - } - - return true; -} - -/* - * nss_qvpn_handler() - * Handle NSS to HLOS messages for QVPN - */ -static void nss_qvpn_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) -{ - nss_qvpn_msg_callback_t cb; - - nss_assert(nss_qvpn_verify_if_num(ncm->interface)); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_QVPN_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for qvpn interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_qvpn_msg)) { - nss_warning("%px: length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - - nss_core_log_msg_failures(nss_ctx, ncm); - /* - * Trace messages. - */ - nss_qvpn_log_rx_msg((struct nss_qvpn_msg *)ncm); - - if (ncm->type == NSS_QVPN_MSG_TYPE_SYNC_STATS) { - nss_qvpn_stats_tunnel_sync(nss_ctx, ncm); - nss_qvpn_stats_notify(nss_ctx, ncm->interface); - } - - /* - * Update the callback and app_data for NOTIFY messages, qvpn sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * load, test & call - */ - cb = (nss_qvpn_msg_callback_t)ncm->cb; - if (unlikely(!cb)) { - nss_trace("%px: rx handler unregistered for i/f: %u\n", nss_ctx, ncm->interface); - return; - } - - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_qvpn_callback() - * Callback to handle the completion of NSS to HLOS messages. - */ -static void nss_qvpn_callback(void *app_data, struct nss_qvpn_msg *nvm) -{ - enum nss_qvpn_error_type *resp = (enum nss_qvpn_error_type *)app_data; - - *resp = (nvm->cm.response == NSS_CMN_RESPONSE_ACK) ? NSS_QVPN_ERROR_TYPE_NONE : nvm->cm.error; - - /* - * Write memory barrier - */ - smp_wmb(); - - complete(&qvpn_pvt.complete); -} - -/* - * nss_qvpn_ifmap_get() - * Return QVPN active interfaces map. - */ -unsigned long *nss_qvpn_ifmap_get(void) -{ - return qvpn_pvt.if_map; -} - -/* - * nss_qvpn_get_context() - * Return NSS QVPN context. - */ -struct nss_ctx_instance *nss_qvpn_get_context(void) -{ - return &nss_top_main.nss[nss_top_main.qvpn_handler_id]; -} -EXPORT_SYMBOL(nss_qvpn_get_context); - -/* - * nss_qvpn_tx_msg() - * Transmit a QVPN message to NSS firmware - */ -nss_tx_status_t nss_qvpn_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_qvpn_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Sanity check the message - */ - if (!nss_qvpn_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request for interface that is not a qvpn: %u\n", nss_ctx, ncm->interface); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ncm->type >= NSS_QVPN_MSG_TYPE_MAX) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * Trace messages. - */ - nss_qvpn_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_qvpn_tx_msg); - -/* - * nss_qvpn_tx_msg_sync() - * Transmit a QVPN message to NSS firmware synchronously. - */ -nss_tx_status_t nss_qvpn_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_qvpn_msg *nvm, - uint32_t if_num, enum nss_qvpn_msg_type type, uint16_t len, enum nss_qvpn_error_type *resp) -{ - struct nss_qvpn_msg nqm; - nss_tx_status_t status; - int ret = 0; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (len > sizeof(nqm.msg)) { - nss_warning("%px: Incorrect message length=%u for type %d and if_num=%u\n", nss_ctx, len, type, if_num); - return NSS_TX_FAILURE_TOO_LARGE; - } - - if (!resp) { - nss_warning("%px: Invalid input, resp=NULL\n", nss_ctx); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nss_qvpn_msg_init(&nqm, if_num, type, len, nss_qvpn_callback, &qvpn_pvt.resp); - memcpy(&nqm.msg, &nvm->msg, len); - - down(&qvpn_pvt.sem); - - status = nss_qvpn_tx_msg(nss_ctx, &nqm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: qvpn_tx_msg failed\n", nss_ctx); - goto done; - } - - ret = wait_for_completion_timeout(&qvpn_pvt.complete, msecs_to_jiffies(NSS_QVPN_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: qvpn msg tx failed due to timeout\n", nss_ctx); - status = NSS_TX_FAILURE_SYNC_TIMEOUT; - goto done; - } - - /* - * Read memory barrier - */ - smp_rmb(); - - *resp = qvpn_pvt.resp; - if (*resp != NSS_QVPN_ERROR_TYPE_NONE) - status = NSS_TX_FAILURE; -done: - up(&qvpn_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_qvpn_tx_msg_sync); - -/* - * nss_qvpn_tx_buf() - * Send packet to QVPN interface owned by NSS - */ -nss_tx_status_t nss_qvpn_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb) -{ - if (!nss_qvpn_verify_if_num(if_num)) { - nss_warning("%px: tx request for interface that is not a qvpn: %u\n", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_qvpn_tx_buf); - -/* - * nss_qvpn_msg_init() - * Initialize nss_qvpn_msg. - */ -void nss_qvpn_msg_init(struct nss_qvpn_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_qvpn_msg_init); - -/* - * nss_qvpn_register_if() - * Register QVPN interface. - */ -struct nss_ctx_instance *nss_qvpn_register_if(uint32_t if_num, nss_qvpn_callback_t qvpn_data_callback, - nss_qvpn_msg_callback_t qvpn_event_callback, - struct net_device *netdev, uint32_t features, void *app_ctx) -{ - struct nss_ctx_instance *nss_ctx = nss_qvpn_get_context(); - uint32_t status; - - nss_assert(nss_ctx); - nss_assert(nss_qvpn_verify_if_num(if_num)); - - nss_core_register_subsys_dp(nss_ctx, if_num, qvpn_data_callback, NULL, app_ctx, netdev, features); - nss_core_register_handler(nss_ctx, if_num, nss_qvpn_handler, app_ctx); - status = nss_core_register_msg_handler(nss_ctx, if_num, qvpn_event_callback); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to register handler for interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - set_bit(if_num, qvpn_pvt.if_map); - return nss_ctx; -} -EXPORT_SYMBOL(nss_qvpn_register_if); - -/* - * nss_unregister_qvpn_if() - * Unregister QVPN interface. - */ -void nss_qvpn_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_qvpn_get_context(); - uint32_t status; - - nss_assert(nss_qvpn_verify_if_num(if_num)); - - clear_bit(if_num, qvpn_pvt.if_map); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Failed to unregister handler for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return; - } - - status = nss_core_unregister_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Failed to unregister handler for IPsec NSS I/F:%u\n", nss_ctx, if_num); - return; - } -} -EXPORT_SYMBOL(nss_qvpn_unregister_if); - -/* - * nss_qvpn_ifnum_with_core_id() - * Append core id to QVPN interface number - */ -int nss_qvpn_ifnum_with_core_id(int if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_qvpn_get_context(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (nss_qvpn_verify_if_num(if_num) == false) { - nss_info("%px: if_num: %u is not QVPN interface\n", nss_ctx, if_num); - return 0; - } - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_qvpn_ifnum_with_core_id); - -/* - * nss_qvpn_register_handler() - * Intialize QVPN driver and register handler. - */ -void nss_qvpn_register_handler(void) -{ - nss_info("nss_qvpn_register_handler\n"); - sema_init(&qvpn_pvt.sem, 1); - init_completion(&qvpn_pvt.complete); - nss_qvpn_stats_dentry_create(); - nss_qvpn_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_log.c deleted file mode 100644 index d71c79ee1..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_log.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_qvpn_log.c - * NSS qvpn logger file. - */ - -#include "nss_core.h" - -/* - * nss_qvpn_log_message_types_str - * qvpn message strings - */ -static int8_t *nss_qvpn_log_message_types_str[NSS_QVPN_MSG_TYPE_MAX] __maybe_unused = { - "QVPN tunnel config", - "QVPN tunnel deconfig", - "QVPN crypto key add", - "QVPN crypto key delete", - "QVPN crypto crypto key activate", - "QVPN crypto key Deactivate", - "QVPN statistics synchronization" -}; - -/* - * nss_qvpn_log_error_response_types_str - * Strings for error types for qvpn messages - */ -static int8_t *nss_qvpn_log_error_response_types_str[NSS_QVPN_ERROR_TYPE_MAX] __maybe_unused = { - "QVPN No error", - "QVPN Unknown message", - "QVPN Tunnel already configured", - "QVPN Invalid interface", - "QVPN Invalid sibling interface number", - "QVPN Invalid IV size", - "QVPN Invalid HMAC size", - "QVPN Invalid crypto block size", - "QVPN Invalid session idx size", - "QVPN Supported processing command count invalid", - "QVPN L4 protocol encapsulation is not supported", - "QVPN Invalid sibling interface type", - "QVPN Total number of commands is invalid", - "QVPN Entry not found", - "QVPN Entry not active", - "QVPN Entry already active", - "QVPN Invalid crypto index", - "QVPN Key info allocation failure", - "QVPN Invalid command profile", - "QVPN VPN with tail not supported" -}; - -/* - * nss_qvpn_tun_config_msg() - * Log NSS QVPN configuration message. - */ -static void nss_qvpn_log_tun_config_msg(struct nss_qvpn_msg *ncm) -{ - struct nss_qvpn_tunnel_config_msg *nqtcm __maybe_unused = &ncm->msg.tunnel_config; - nss_trace("%px: NSS QVPN tunnel config message \n" - "Sibling interface: %d" - "Total number of commands: %d" - "Commands: %px" - "Source IP: %x:%x:%x:%x\n" - "Source Port: %d\n" - "Destination IP: %x:%x:%x:%x\n" - "Destination Port: %d\n" - "Header Flags: %x\n" - "Sequence number size: %d\n" - "Sequence number offset: %d\n" - "Anti-replay algorithm: %d\n" - "Session ID size: %d\n" - "Session ID offset: %x\n" - "VPN header head size: %d\n" - "VPN header head offset: %d\n" - "VPN header tail size: %d\n" - "VPN header head: %px\n" - "VPN header tail: %px\n", - nqtcm, - nqtcm->sibling_if, - nqtcm->total_cmds, - nqtcm->cmd, - nqtcm->hdr_cfg.src_ip[0], nqtcm->hdr_cfg.src_ip[1], nqtcm->hdr_cfg.src_ip[2], nqtcm->hdr_cfg.src_ip[3], - nqtcm->hdr_cfg.src_port, - nqtcm->hdr_cfg.dst_ip[0], nqtcm->hdr_cfg.dst_ip[1], nqtcm->hdr_cfg.dst_ip[2], nqtcm->hdr_cfg.dst_ip[3], - nqtcm->hdr_cfg.dst_port, - nqtcm->hdr_cfg.hdr_flags, - nqtcm->hdr_cfg.seqnum_size, - nqtcm->hdr_cfg.seqnum_offset, - nqtcm->hdr_cfg.anti_replay_alg, - nqtcm->hdr_cfg.session_id_size, - nqtcm->hdr_cfg.session_id_offset, - nqtcm->hdr_cfg.vpn_hdr_head_size, - nqtcm->hdr_cfg.vpn_hdr_head_offset, - nqtcm->hdr_cfg.vpn_hdr_tail_size, - nqtcm->hdr_cfg.vpn_hdr_head, - nqtcm->hdr_cfg.vpn_hdr_tail); -} - -/* - * nss_qvpn_log_tun_deconfig_msg() - * Log NSS qvpn tunnel deconfigure message. - */ -static void nss_qvpn_log_tun_deconfig_msg(struct nss_qvpn_msg *ncm) -{ - nss_trace("%px: NSS QVPN deconfigure message \n", ncm); -} - -/* - * nss_qvpn_log_crypto_key_add_msg() - * Log NSS QVPN crypto key add message. - */ -static void nss_qvpn_log_crypto_key_add_msg(struct nss_qvpn_msg *ncm) -{ - struct nss_qvpn_crypto_key_add_msg *nqckam __maybe_unused = &ncm->msg.key_add; - nss_trace("%px: NSS QVPN crypto key add message \n" - "Crypto index: %d\n" - "Crypto session ID: %px", - nqckam, - nqckam->crypto_idx, - nqckam->session_id); -} - -/* - * nss_qvpn_log_crypto_key_activate_msg() - * Log NSS QVPN crypto key activate message. - */ -static void nss_qvpn_log_crypto_key_activate_msg(struct nss_qvpn_msg *ncm) -{ - struct nss_qvpn_crypto_key_activate_msg *nqckam __maybe_unused = &ncm->msg.key_activate; - nss_trace("%px: NSS QVPN crypto key activate message \n" - "Crypto index: %d\n" - "Crypto VPN header head: %px", - nqckam, - nqckam->crypto_idx, - nqckam->vpn_hdr_head); -} - -/* - * nss_qvpn_log_crypto_key_del_msg() - * Log NSS QVPN crypto key delete message. - */ -static void nss_qvpn_log_crypto_key_del_msg(struct nss_qvpn_msg *ncm) -{ - struct nss_qvpn_crypto_key_del_msg *nqckdm __maybe_unused = &ncm->msg.key_del; - nss_trace("%px: NSS QVPN crypto key delete message \n" - "Crypto index: %d\n", - nqckdm, - nqckdm->crypto_idx); -} - -/* - * nss_qvpn_log_crypto_key_deactivate_msg() - * Log NSS QVPN crypto key deactivate message. - */ -static void nss_qvpn_log_crypto_key_deactivate_msg(struct nss_qvpn_msg *ncm) -{ - struct nss_qvpn_crypto_key_del_msg *nqckdm __maybe_unused = &ncm->msg.key_del; - nss_trace("%px: NSS QVPN crypto key deactivate message \n" - "Crypto index: %d\n", - nqckdm, - nqckdm->crypto_idx); -} - -/* - * nss_qvpn_log_verbose() - * Log message contents. - */ -static void nss_qvpn_log_verbose(struct nss_qvpn_msg *ncm) -{ - switch (ncm->cm.type) { - case NSS_QVPN_MSG_TYPE_TUNNEL_CONFIGURE: - nss_qvpn_log_tun_config_msg(ncm); - break; - - case NSS_QVPN_MSG_TYPE_TUNNEL_DECONFIGURE: - nss_qvpn_log_tun_deconfig_msg(ncm); - break; - - case NSS_QVPN_MSG_TYPE_CRYPTO_KEY_ADD: - nss_qvpn_log_crypto_key_add_msg(ncm); - break; - - case NSS_QVPN_MSG_TYPE_CRYPTO_KEY_ACTIVATE: - nss_qvpn_log_crypto_key_activate_msg(ncm); - break; - - case NSS_QVPN_MSG_TYPE_CRYPTO_KEY_DEL: - nss_qvpn_log_crypto_key_del_msg(ncm); - break; - - case NSS_QVPN_MSG_TYPE_CRYPTO_KEY_DEACTIVATE: - nss_qvpn_log_crypto_key_deactivate_msg(ncm); - break; - - default: - nss_trace("%px: Invalid message type\n", ncm); - break; - } -} - -/* - * nss_qvpn_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_qvpn_log_tx_msg(struct nss_qvpn_msg *ncm) -{ - if (ncm->cm.type >= NSS_QVPN_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", ncm); - return; - } - - nss_info("%px: type[%d]:%s\n", ncm, ncm->cm.type, nss_qvpn_log_message_types_str[ncm->cm.type]); - nss_qvpn_log_verbose(ncm); -} - -/* - * nss_qvpn_log_rx_msg() - * Log messages received from FW. - */ -void nss_qvpn_log_rx_msg(struct nss_qvpn_msg *ncm) -{ - if (ncm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ncm); - return; - } - - if (ncm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ncm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ncm, ncm->cm.type, - nss_qvpn_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response]); - goto verbose; - } - - if (ncm->cm.error >= NSS_QVPN_ERROR_TYPE_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ncm, ncm->cm.type, nss_qvpn_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ncm, ncm->cm.type, nss_qvpn_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error, nss_qvpn_log_error_response_types_str[ncm->cm.error]); - -verbose: - nss_qvpn_log_verbose(ncm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_log.h deleted file mode 100644 index e1dee898b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_QVPN_LOG_H__ -#define __NSS_QVPN_LOG_H__ - -/* - * nss_qvpn_log.h - * NSS QVPN Log Header File. - */ - -/* - * nss_qvpn_log_tx_msg - * Logs QVPN message that is sent to the NSS firmware. - */ -void nss_qvpn_log_tx_msg(struct nss_qvpn_msg *ncm); - -/* - * nss_qvpn_log_rx_msg - * Logs QVPN message that is received from the NSS firmware. - */ -void nss_qvpn_log_rx_msg(struct nss_qvpn_msg *ncm); - -#endif /* __NSS_QVPN_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.c deleted file mode 100644 index 4a9bdc116..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include -#include "nss_qvpn_stats.h" -#include "nss_qvpn_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_qvpn_stats_notifier); - -/* - * Spinlock to protect qvpn statistics update/read - */ -DEFINE_SPINLOCK(nss_qvpn_stats_lock); - -uint64_t nss_qvpn_stats[NSS_MAX_NET_INTERFACES][NSS_STATS_NODE_MAX]; /* to store the qvpn statistics */ - -/* - * nss_qvpn_stats_iface_type() - * Return a string for each interface type. - */ -static const char *nss_qvpn_stats_iface_type(enum nss_dynamic_interface_type type) -{ - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER: - return "qvpn_inner"; - - case NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER: - return "qvpn_outer"; - - default: - return "invalid_interface"; - } -} - -/* - * nss_qvpn_stats_read() - * Read qvpn node statiistics. - */ -static ssize_t nss_qvpn_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - struct nss_ctx_instance *nss_ctx = nss_qvpn_get_context(); - enum nss_dynamic_interface_type type; - unsigned long *ifmap; - uint64_t *stats_shadow; - ssize_t bytes_read = 0; - size_t size_wr = 0; - uint32_t if_num; - int32_t i; - int count; - char *lbuf; - - ifmap = nss_qvpn_ifmap_get(); - count = bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); - if (count) { - size_al = size_al * count; - } - - lbuf = vzalloc(size_al); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = vzalloc(NSS_STATS_NODE_MAX * 8); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - vfree(lbuf); - return -ENOMEM; - } - - /* - * Common node stats for each QVPN dynamic interface. - */ - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "qvpn stats", NSS_STATS_SINGLE_CORE); - for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) { - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - if ((type != NSS_DYNAMIC_INTERFACE_TYPE_QVPN_INNER) && - (type != NSS_DYNAMIC_INTERFACE_TYPE_QVPN_OUTER)) { - continue; - } - - spin_lock_bh(&nss_qvpn_stats_lock); - for (i = 0; i < NSS_STATS_NODE_MAX; i++) { - stats_shadow[i] = nss_qvpn_stats[if_num][i]; - } - spin_unlock_bh(&nss_qvpn_stats_lock); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", - nss_qvpn_stats_iface_type(type), if_num); - size_wr += nss_stats_print("qvpn", NULL, NSS_STATS_SINGLE_INSTANCE, nss_qvpn_strings_stats, - stats_shadow, NSS_STATS_NODE_MAX, lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - vfree(lbuf); - vfree(stats_shadow); - return bytes_read; -} - -/* - * nss_qvpn_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(qvpn) - -/* - * nss_qvpn_stats_tunnel_sync - * Update qvpn interface statistics. - */ -void nss_qvpn_stats_tunnel_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - struct nss_qvpn_msg *ndcm = (struct nss_qvpn_msg *)ncm; - struct nss_qvpn_stats_sync_msg *msg_stats = &ndcm->msg.stats; - - spin_lock_bh(&nss_qvpn_stats_lock); - - /* - * Update common node stats - */ - nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_PKTS] += msg_stats->node_stats.rx_packets; - nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_BYTES] += msg_stats->node_stats.rx_bytes; - nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_QUEUE_0_DROPPED] += msg_stats->node_stats.rx_dropped[0]; - nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_QUEUE_1_DROPPED] += msg_stats->node_stats.rx_dropped[1]; - nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_QUEUE_2_DROPPED] += msg_stats->node_stats.rx_dropped[2]; - nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_RX_QUEUE_3_DROPPED] += msg_stats->node_stats.rx_dropped[3]; - - nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_TX_PKTS] += msg_stats->node_stats.tx_packets; - nss_qvpn_stats[ncm->interface][NSS_STATS_NODE_TX_BYTES] += msg_stats->node_stats.tx_bytes; - - spin_unlock_bh(&nss_qvpn_stats_lock); -} - -/* - * nss_qvpn_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_qvpn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_qvpn_stats_notification qvpn_stats; - - spin_lock_bh(&nss_qvpn_stats_lock); - qvpn_stats.core_id = nss_ctx->id; - qvpn_stats.if_num = if_num; - memcpy(qvpn_stats.stats_ctx, nss_qvpn_stats[if_num], sizeof(qvpn_stats.stats_ctx)); - spin_unlock_bh(&nss_qvpn_stats_lock); - - atomic_notifier_call_chain(&nss_qvpn_stats_notifier, NSS_STATS_EVENT_NOTIFY, &qvpn_stats); -} - -/* - * nss_qvpn_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_qvpn_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_qvpn_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_qvpn_stats_unregister_notifier); - -/* - * nss_qvpn_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_qvpn_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_qvpn_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_qvpn_stats_register_notifier); - -/* - * nss_qvpn_stats_dentry_create() - * Create QVPN statistics debug entry. - */ -void nss_qvpn_stats_dentry_create(void) -{ - nss_stats_create_dentry("qvpn", &nss_qvpn_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.h deleted file mode 100644 index 74bbe11de..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_stats.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef _NSS_QVPN_STATS_H_ -#define _NSS_QVPN_STATS_H_ - -extern void nss_qvpn_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_qvpn_stats_tunnel_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); -extern void nss_qvpn_stats_dentry_create(void); - -#endif /* _NSS_QVPN_STATS_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.c deleted file mode 100644 index 2af34aad4..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - ***************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_qvpn_strings.h" - -/* - * nss_qvpn_strings_stats - * qvpn statistics strings. - */ -struct nss_stats_info nss_qvpn_strings_stats[NSS_STATS_NODE_MAX] = { - {"rx_pkts", NSS_STATS_TYPE_COMMON}, - {"rx_byts", NSS_STATS_TYPE_COMMON}, - {"tx_pkts", NSS_STATS_TYPE_COMMON}, - {"tx_byts", NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP} -}; - -/* - * nss_qvpn_strings_read() - * Read qvpn statistics names - */ -static ssize_t nss_qvpn_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_qvpn_strings_stats, NSS_STATS_NODE_MAX); -} - -/* - * nss_qvpn_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(qvpn); - -/* - * nss_qvpn_strings_dentry_create() - * Create qvpn statistics strings debug entry. - */ -void nss_qvpn_strings_dentry_create(void) -{ - nss_strings_create_dentry("qvpn", &nss_qvpn_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.h deleted file mode 100644 index 4b874d803..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_qvpn_strings.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - **************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - **************************************************************************** - */ - -#ifndef __NSS_QVPN_STRINGS_H -#define __NSS_QVPN_STRINGS_H - -#include "nss_qvpn_stats.h" - -extern struct nss_stats_info nss_qvpn_strings_stats[NSS_STATS_NODE_MAX]; -extern void nss_qvpn_strings_dentry_create(void); - -#endif /* __NSS_QVPN_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx.c b/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx.c deleted file mode 100644 index c77ef3f3e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx.c +++ /dev/null @@ -1,781 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_rmnet_rx.c - * NSS rmnet receive handler APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_rmnet_rx_stats.h" -#include - -#define NSS_RMNET_RX_TX_TIMEOUT 3000 /* 3 Seconds */ -#define NSS_RMNET_RX_GET_INDEX(if_num) (if_num - NSS_DYNAMIC_IF_START) - -/* - * Spinlock to protect the global data structure rmnet handle. - */ -DEFINE_SPINLOCK(nss_rmnet_rx_lock); - -extern int nss_ctl_redirect; - -/* - * Data structure that holds theinterface context. - */ -struct nss_rmnet_rx_handle *rmnet_rx_handle[NSS_MAX_DYNAMIC_INTERFACES]; - -/* - * nss_rmnet_rx_verify_if_num() - * Verify if_num passed to us. - */ -bool nss_rmnet_rx_verify_if_num(uint32_t if_num) -{ - enum nss_dynamic_interface_type type = nss_dynamic_interface_get_type(nss_rmnet_rx_get_context(), if_num); - - return type == NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H - || type == NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N; -} - -/* - * nss_rmnet_rx_msg_handler() - * Handle msg responses from the FW on interfaces - */ -static void nss_rmnet_rx_msg_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, - void *app_data) -{ - struct nss_rmnet_rx_msg *nvim = (struct nss_rmnet_rx_msg *)ncm; - int32_t if_num; - - nss_rmnet_rx_msg_callback_t cb; - struct nss_rmnet_rx_handle *handle = NULL; - - /* - * Sanity check the message type - */ - if (ncm->type > NSS_RMNET_RX_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return; - } - - /* - * Messages value that are within the base class are handled by the base class. - */ - if (ncm->type < NSS_IF_MAX_MSG_TYPES) { - return nss_if_msg_handler(nss_ctx, ncm, app_data); - } - - if (!nss_rmnet_rx_verify_if_num(ncm->interface)) { - nss_warning("%px: response for another interface: %d", nss_ctx, ncm->interface); - return; - } - - if_num = NSS_RMNET_RX_GET_INDEX(ncm->interface); - - spin_lock_bh(&nss_rmnet_rx_lock); - if (!rmnet_rx_handle[if_num]) { - spin_unlock_bh(&nss_rmnet_rx_lock); - nss_warning("%px: rmnet_rx handle is NULL\n", nss_ctx); - return; - } - - handle = rmnet_rx_handle[if_num]; - spin_unlock_bh(&nss_rmnet_rx_lock); - - switch (nvim->cm.type) { - case NSS_RMNET_RX_STATS_SYNC_MSG: - nss_rmnet_rx_stats_sync(handle, &nvim->msg.stats, ncm->interface); - break; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Update the callback and app_data for NOTIFY messages, IPv4 sends all notify messages - * to the same callback/app_data. - * - * TODO: RMNet driver does not provide a registration for a notifier callback. - * Since dynamic interface are allocated on both cores and since the array for - * registered callback is not core specific, we call the Wi-Fi callback - * inappropriately. Disable the callback locally until we have per-core - * callback registrations. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)NULL; - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].ndev; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_rmnet_rx_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_rmnet_rx_callback - * Callback to handle the completion of NSS ->HLOS messages. - */ -static void nss_rmnet_rx_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - struct nss_rmnet_rx_handle *handle = (struct nss_rmnet_rx_handle *)app_data; - struct nss_rmnet_rx_pvt *nvip = handle->pvt; - - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: rmnet_rx Error response %d\n", handle->nss_ctx, ncm->response); - nvip->response = NSS_TX_FAILURE; - complete(&nvip->complete); - return; - } - - nvip->response = NSS_TX_SUCCESS; - complete(&nvip->complete); -} - -/* - * nss_rmnet_rx_tx_msg_sync - * Send a message from HLOS to NSS synchronously. - */ -static nss_tx_status_t nss_rmnet_rx_tx_msg_sync(struct nss_rmnet_rx_handle *handle, - struct nss_rmnet_rx_msg *nvim) -{ - nss_tx_status_t status; - int ret = 0; - struct nss_rmnet_rx_pvt *nwip = handle->pvt; - struct nss_ctx_instance *nss_ctx = handle->nss_ctx; - - down(&nwip->sem); - - status = nss_rmnet_rx_tx_msg(nss_ctx, nvim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_rmnet_rx_msg failed\n", nss_ctx); - up(&nwip->sem); - return status; - } - - ret = wait_for_completion_timeout(&nwip->complete, - msecs_to_jiffies(NSS_RMNET_RX_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: rmnet_rx tx failed due to timeout\n", nss_ctx); - nwip->response = NSS_TX_FAILURE; - } - - status = nwip->response; - up(&nwip->sem); - - return status; -} - -/* - * nss_rmnet_rx_msg_init() - * Initialize virt specific message structure. - */ -static void nss_rmnet_rx_msg_init(struct nss_rmnet_rx_msg *nvim, - uint16_t if_num, - uint32_t type, - uint32_t len, - nss_rmnet_rx_msg_callback_t cb, - struct nss_rmnet_rx_handle *app_data) -{ - nss_cmn_msg_init(&nvim->cm, if_num, type, len, (void *)cb, (void *)app_data); -} - -/* - * nss_rmnet_rx_handle_destroy_sync() - * Destroy the virt handle either due to request from user or due to error, synchronously. - */ -static int nss_rmnet_rx_handle_destroy_sync(struct nss_rmnet_rx_handle *handle) -{ - nss_tx_status_t status; - int32_t if_num_n2h = handle->if_num_n2h; - int32_t if_num_h2n = handle->if_num_h2n; - int32_t index_n2h; - int32_t index_h2n; - - if (!nss_rmnet_rx_verify_if_num(if_num_n2h) || !nss_rmnet_rx_verify_if_num(if_num_h2n)) { - nss_warning("%px: bad interface numbers %d %d\n", handle->nss_ctx, if_num_n2h, if_num_h2n); - return NSS_TX_FAILURE_BAD_PARAM; - } - - index_n2h = NSS_RMNET_RX_GET_INDEX(if_num_n2h); - index_h2n = NSS_RMNET_RX_GET_INDEX(if_num_h2n); - - status = nss_dynamic_interface_dealloc_node(if_num_n2h, NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Dynamic interface destroy failed status %d\n", handle->nss_ctx, status); - return status; - } - - status = nss_dynamic_interface_dealloc_node(if_num_h2n, NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Dynamic interface destroy failed status %d\n", handle->nss_ctx, status); - return status; - } - - spin_lock_bh(&nss_rmnet_rx_lock); - rmnet_rx_handle[index_n2h] = NULL; - rmnet_rx_handle[index_h2n] = NULL; - spin_unlock_bh(&nss_rmnet_rx_lock); - - kfree(handle->pvt); - kfree(handle); - - return status; -} - -/* - * nss_rmnet_rx_handle_create_sync() - * Initialize virt handle which holds the if_num and stats per interface. - */ -static struct nss_rmnet_rx_handle *nss_rmnet_rx_handle_create_sync(struct nss_ctx_instance *nss_ctx, int32_t if_num_n2h, int32_t if_num_h2n, int32_t *cmd_rsp) -{ - int32_t index_n2h; - int32_t index_h2n; - struct nss_rmnet_rx_handle *handle; - - if (!nss_rmnet_rx_verify_if_num(if_num_n2h) || !nss_rmnet_rx_verify_if_num(if_num_h2n)) { - nss_warning("%px: bad interface numbers %d %d\n", nss_ctx, if_num_n2h, if_num_h2n); - return NULL; - } - - index_n2h = NSS_RMNET_RX_GET_INDEX(if_num_n2h); - index_h2n = NSS_RMNET_RX_GET_INDEX(if_num_h2n); - - handle = (struct nss_rmnet_rx_handle *)kzalloc(sizeof(struct nss_rmnet_rx_handle), - GFP_KERNEL); - if (!handle) { - nss_warning("%px: handle memory alloc failed\n", nss_ctx); - *cmd_rsp = NSS_RMNET_RX_ALLOC_FAILURE; - goto error1; - } - - handle->nss_ctx = nss_ctx; - handle->if_num_n2h = if_num_n2h; - handle->if_num_h2n = if_num_h2n; - handle->pvt = (struct nss_rmnet_rx_pvt *)kzalloc(sizeof(struct nss_rmnet_rx_pvt), - GFP_KERNEL); - if (!handle->pvt) { - nss_warning("%px: failure allocating memory for nss_rmnet_rx_pvt\n", nss_ctx); - *cmd_rsp = NSS_RMNET_RX_ALLOC_FAILURE; - goto error2; - } - - handle->stats_n2h = (uint64_t *)kzalloc(sizeof(uint64_t) * NSS_RMNET_RX_STATS_MAX, - GFP_KERNEL); - if (!handle->stats_n2h) { - nss_warning("%px: failure allocating memory for N2H stats\n", nss_ctx); - *cmd_rsp = NSS_RMNET_RX_ALLOC_FAILURE; - goto error3; - } - - handle->stats_h2n = (uint64_t *)kzalloc(sizeof(uint64_t) * NSS_RMNET_RX_STATS_MAX, - GFP_KERNEL); - if (!handle->stats_h2n) { - nss_warning("%px: failure allocating memory for H2N stats\n", nss_ctx); - *cmd_rsp = NSS_RMNET_RX_ALLOC_FAILURE; - goto error4; - } - - handle->cb = NULL; - handle->app_data = NULL; - - spin_lock_bh(&nss_rmnet_rx_lock); - rmnet_rx_handle[index_n2h] = handle; - rmnet_rx_handle[index_h2n] = handle; - spin_unlock_bh(&nss_rmnet_rx_lock); - - *cmd_rsp = NSS_RMNET_RX_SUCCESS; - - return handle; - -error4: - kfree(handle->stats_n2h); -error3: - kfree(handle->pvt); -error2: - kfree(handle); -error1: - return NULL; -} - -/* - * nss_rmnet_rx_register_handler_sync() - * register msg handler for interface and initialize semaphore and completion. - */ -static uint32_t nss_rmnet_rx_register_handler_sync(struct nss_ctx_instance *nss_ctx, struct nss_rmnet_rx_handle *handle) -{ - uint32_t ret; - struct nss_rmnet_rx_pvt *nvip = NULL; - int32_t if_num_n2h = handle->if_num_n2h; - int32_t if_num_h2n = handle->if_num_h2n; - - ret = nss_core_register_handler(nss_ctx, if_num_n2h, nss_rmnet_rx_msg_handler, NULL); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Failed to register message handler for redir_n2h interface %d\n", nss_ctx, if_num_n2h); - return NSS_RMNET_RX_REG_FAILURE; - } - - ret = nss_core_register_handler(nss_ctx, if_num_h2n, nss_rmnet_rx_msg_handler, NULL); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num_n2h); - nss_warning("%px: Failed to register message handler for redir_h2n interface %d\n", nss_ctx, if_num_h2n); - return NSS_RMNET_RX_REG_FAILURE; - } - - nvip = handle->pvt; - if (!nvip->sem_init_done) { - sema_init(&nvip->sem, 1); - init_completion(&nvip->complete); - nvip->sem_init_done = 1; - } - - nss_rmnet_rx_stats_dentry_create(); - return NSS_RMNET_RX_SUCCESS; -} - -/* - * nss_rmnet_rx_destroy_sync() - * Destroy the virt interface associated with the interface number, synchronously. - */ -nss_tx_status_t nss_rmnet_rx_destroy_sync(struct nss_rmnet_rx_handle *handle) -{ - nss_tx_status_t status; - struct net_device *dev; - int32_t if_num_n2h; - int32_t if_num_h2n; - struct nss_ctx_instance *nss_ctx; - uint32_t ret; - - if (!handle) { - nss_warning("handle is NULL\n"); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if_num_n2h = handle->if_num_n2h; - if_num_h2n = handle->if_num_h2n; - nss_ctx = handle->nss_ctx; - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Interface could not be destroyed as core not ready\n", nss_ctx); - return NSS_TX_FAILURE_NOT_READY; - } - - spin_lock_bh(&nss_top_main.lock); - if (!nss_ctx->subsys_dp_register[if_num_n2h].ndev || !nss_ctx->subsys_dp_register[if_num_h2n].ndev) { - spin_unlock_bh(&nss_top_main.lock); - nss_warning("%px: Unregister virt interface %d %d: no context\n", nss_ctx, if_num_n2h, if_num_h2n); - return NSS_TX_FAILURE_BAD_PARAM; - } - - dev = nss_ctx->subsys_dp_register[if_num_n2h].ndev; - nss_assert(dev == nss_ctx->subsys_dp_register[if_num_h2n].ndev); - nss_core_unregister_subsys_dp(nss_ctx, if_num_n2h); - nss_core_unregister_subsys_dp(nss_ctx, if_num_h2n); - spin_unlock_bh(&nss_top_main.lock); - dev_put(dev); - - status = nss_rmnet_rx_handle_destroy_sync(handle); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: handle destroy failed for if_num_n2h %d and if_num_h2n %d\n", nss_ctx, if_num_n2h, if_num_h2n); - return NSS_TX_FAILURE; - } - - ret = nss_core_unregister_handler(nss_ctx, if_num_n2h); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for redir_n2h interface %d with NSS core\n", nss_ctx, if_num_n2h); - return NSS_TX_FAILURE_BAD_PARAM; - } - - ret = nss_core_unregister_handler(nss_ctx, if_num_h2n); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for redir_h2n interface %d with NSS core\n", nss_ctx, if_num_h2n); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return status; -} -EXPORT_SYMBOL(nss_rmnet_rx_destroy_sync); - -/* - * nss_rmnet_rx_create_sync_nexthop() - * Create redir_n2h and redir_h2n interfaces, synchronously and associate it with same netdev. - */ -struct nss_rmnet_rx_handle *nss_rmnet_rx_create_sync_nexthop(struct net_device *netdev, uint32_t nexthop_n2h, uint32_t nexthop_h2n) -{ - struct nss_ctx_instance *nss_ctx = nss_rmnet_rx_get_context(); - struct nss_rmnet_rx_msg nvim; - struct nss_rmnet_rx_config_msg *nvcm; - uint32_t ret; - struct nss_rmnet_rx_handle *handle = NULL; - int32_t if_num_n2h, if_num_h2n; - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Interface could not be created as core not ready\n", nss_ctx); - return NULL; - } - - if_num_n2h = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H); - if (if_num_n2h < 0) { - nss_warning("%px: failure allocating redir_n2h\n", nss_ctx); - return NULL; - } - - if_num_h2n = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N); - if (if_num_h2n < 0) { - nss_warning("%px: failure allocating redir_h2n\n", nss_ctx); - nss_dynamic_interface_dealloc_node(if_num_n2h, NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H); - return NULL; - } - - handle = nss_rmnet_rx_handle_create_sync(nss_ctx, if_num_n2h, if_num_h2n, &ret); - if (!handle) { - nss_warning("%px: rmnet_rx handle creation failed ret %d\n", nss_ctx, ret); - nss_dynamic_interface_dealloc_node(if_num_n2h, NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H); - nss_dynamic_interface_dealloc_node(if_num_h2n, NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N); - return NULL; - } - - /* - * Initializes the semaphore and also sets the msg handler for if_num. - */ - ret = nss_rmnet_rx_register_handler_sync(nss_ctx, handle); - if (ret != NSS_RMNET_RX_SUCCESS) { - nss_warning("%px: Registration handler failed reason: %d\n", nss_ctx, ret); - goto error1; - } - - nss_rmnet_rx_msg_init(&nvim, handle->if_num_n2h, NSS_RMNET_RX_TX_CONFIG_MSG, - sizeof(struct nss_rmnet_rx_config_msg), nss_rmnet_rx_callback, handle); - - nvcm = &nvim.msg.if_config; - nvcm->flags = 0; - nvcm->sibling = if_num_h2n; - nvcm->nexthop = nexthop_n2h; - nvcm->no_channel = 0; - - ret = nss_rmnet_rx_tx_msg_sync(handle, &nvim); - if (ret != NSS_TX_SUCCESS) { - nss_warning("%px: nss_rmnet_rx_tx_msg_sync failed %u\n", nss_ctx, ret); - goto error2; - } - - nvim.cm.interface = if_num_h2n; - nvcm->sibling = if_num_n2h; - nvcm->nexthop = nexthop_h2n; - nvcm->no_channel = NSS_RMNET_RX_CHANNEL_MAX; - - ret = nss_rmnet_rx_tx_msg_sync(handle, &nvim); - if (ret != NSS_TX_SUCCESS) { - nss_warning("%px: nss_rmnet_rx_tx_msg_sync failed %u\n", nss_ctx, ret); - goto error2; - } - - nss_core_register_subsys_dp(nss_ctx, (uint32_t)if_num_n2h, NULL, NULL, NULL, netdev, 0); - nss_core_register_subsys_dp(nss_ctx, (uint32_t)if_num_h2n, NULL, NULL, NULL, netdev, 0); - - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num_n2h, NSS_RMNET_RX_DP_N2H); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num_h2n, NSS_RMNET_RX_DP_H2N); - - /* - * Hold a reference to the net_device - */ - dev_hold(netdev); - - /* - * The context returned is the handle interface # which contains all the info related to - * the interface if_num. - */ - - return handle; - -error2: - nss_core_unregister_handler(nss_ctx, if_num_n2h); - nss_core_unregister_handler(nss_ctx, if_num_h2n); - -error1: - nss_rmnet_rx_handle_destroy_sync(handle); - return NULL; -} -EXPORT_SYMBOL(nss_rmnet_rx_create_sync_nexthop); - -/* - * nss_rmnet_rx_create() - * Create rmnet_n2h and rmnet_h2n interfaces with generic next hops and associate it with same netdev. - * - * When rmnet and eth_rx is running at the same core, we directly send packets to eth_rx node. - * When they are running at different cores, the packets needs to arrive eth_rx through C2C. - */ -struct nss_rmnet_rx_handle *nss_rmnet_rx_create(struct net_device *netdev) -{ - uint32_t nexthop_n2h = NSS_N2H_INTERFACE; - uint32_t nexthop_h2n = NSS_C2C_TX_INTERFACE; - - if (nss_top_main.rmnet_rx_handler_id == 0) { - nexthop_h2n = NSS_ETH_RX_INTERFACE; - } - - - return nss_rmnet_rx_create_sync_nexthop(netdev, nexthop_n2h, nexthop_h2n); -} -EXPORT_SYMBOL(nss_rmnet_rx_create); - -/* - * nss_rmnet_rx_tx_buf() - * HLOS interface has received a packet which we redirect to the NSS, if appropriate to do so. - */ -nss_tx_status_t nss_rmnet_rx_tx_buf(struct nss_rmnet_rx_handle *handle, - struct sk_buff *skb) -{ - int32_t if_num = handle->if_num_h2n; - struct nss_ctx_instance *nss_ctx = handle->nss_ctx; - int cpu = 0; - - if (unlikely(nss_ctl_redirect == 0)) { - return NSS_TX_FAILURE_NOT_ENABLED; - } - - if (unlikely(skb->vlan_tci)) { - return NSS_TX_FAILURE_NOT_SUPPORTED; - } - - if (!nss_rmnet_rx_verify_if_num(if_num)) { - nss_warning("%px: bad interface number %d\n", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nss_trace("%px: RmnetRx packet, if_num:%d, skb:%px", nss_ctx, if_num, skb); - - /* - * Sanity check the SKB to ensure that it's suitable for us - */ - if (unlikely(skb->len <= ETH_HLEN)) { - nss_warning("%px: Rmnet Rx packet: %px too short", nss_ctx, skb); - return NSS_TX_FAILURE_TOO_SHORT; - } - - /* - * set skb queue mapping - */ - cpu = get_cpu(); - put_cpu(); - skb_set_queue_mapping(skb, cpu); - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER); -} -EXPORT_SYMBOL(nss_rmnet_rx_tx_buf); - -/* - * nss_rmnet_rx_tx_msg() - */ -nss_tx_status_t nss_rmnet_rx_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_rmnet_rx_msg *nvim) -{ - struct nss_cmn_msg *ncm = &nvim->cm; - - /* - * Sanity check the message - */ - if (!nss_rmnet_rx_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_RMNET_RX_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, nvim, sizeof(*nvim), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_rmnet_rx_tx_msg); - -/* - * nss_rmnet_rx_xmit_callback_unregister() - * Unregister interface xmit callback. - */ -void nss_rmnet_rx_xmit_callback_unregister(struct nss_rmnet_rx_handle *handle) -{ - struct nss_ctx_instance *nss_ctx; - struct nss_subsystem_dataplane_register *reg; - - if (!handle) { - nss_warning("handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_rmnet_rx_verify_if_num(handle->if_num_n2h)) { - nss_warning("if_num is invalid\n"); - return; - } - - reg = &nss_ctx->subsys_dp_register[handle->if_num_n2h]; - reg->xmit_cb = NULL; -} -EXPORT_SYMBOL(nss_rmnet_rx_xmit_callback_unregister); - -/* - * nss_rmnet_rx_xmit_callback_register() - * Register interface xmit callback. - */ -void nss_rmnet_rx_xmit_callback_register(struct nss_rmnet_rx_handle *handle, - nss_rmnet_rx_xmit_callback_t cb) -{ - struct nss_ctx_instance *nss_ctx; - struct nss_subsystem_dataplane_register *reg; - - if (!handle) { - nss_warning("handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_rmnet_rx_verify_if_num(handle->if_num_n2h)) { - nss_warning("if_num is invalid\n"); - return; - } - - reg = &nss_ctx->subsys_dp_register[handle->if_num_n2h]; - reg->xmit_cb = cb; -} -EXPORT_SYMBOL(nss_rmnet_rx_xmit_callback_register); - -/* - * nss_rmnet_rx_unregister() - */ -void nss_rmnet_rx_unregister(struct nss_rmnet_rx_handle *handle) -{ - struct nss_ctx_instance *nss_ctx; - int32_t if_num; - - if (!handle) { - nss_warning("handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_rmnet_rx_verify_if_num(handle->if_num_n2h)) { - nss_warning("if_num is invalid\n"); - return; - } - - if_num = handle->if_num_n2h; - - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_rmnet_rx_unregister); - -/* - * nss_rmnet_rx_register() - */ -void nss_rmnet_rx_register(struct nss_rmnet_rx_handle *handle, - nss_rmnet_rx_data_callback_t data_callback, - struct net_device *netdev) -{ - struct nss_ctx_instance *nss_ctx; - int32_t if_num; - - if (!handle) { - nss_warning("handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_rmnet_rx_verify_if_num(handle->if_num_n2h)) { - nss_warning("if_num is invalid\n"); - return; - } - - if_num = handle->if_num_n2h; - - nss_core_register_subsys_dp(nss_ctx, if_num, data_callback, NULL, NULL, netdev, (uint32_t)netdev->features); -} -EXPORT_SYMBOL(nss_rmnet_rx_register); - -/* - * nss_rmnet_rx_get_ifnum_with_core_id() - * Append core id to rmnet interface number - */ -int32_t nss_rmnet_rx_get_ifnum_with_core_id(int32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_rmnet_rx_get_context(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - if (nss_rmnet_rx_verify_if_num(if_num) == false) { - nss_info("%px: if_num: %u is not RMNET interface\n", nss_ctx, if_num); - return -1; - } - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_rmnet_rx_get_ifnum_with_core_id); - -/* - * nss_rmnet_rx_get_ifnum() - * Return rmnet interface number with core ID - */ -int32_t nss_rmnet_rx_get_ifnum(struct net_device *dev) -{ - int32_t ifnum = nss_cmn_get_interface_number_by_dev(dev); - return nss_rmnet_rx_get_ifnum_with_core_id(ifnum); -} -EXPORT_SYMBOL(nss_rmnet_rx_get_ifnum); - -/* - * nss_rmnet_rx_get_interface_num() - * Get interface number for an interface - */ -int32_t nss_rmnet_rx_get_interface_num(struct nss_rmnet_rx_handle *handle) -{ - if (!handle) { - nss_warning("rmnet_rx handle is NULL\n"); - return -1; - } - - /* - * Return if_num_n2h whose datapath type is 0. - */ - return handle->if_num_n2h; -} -EXPORT_SYMBOL(nss_rmnet_rx_get_interface_num); - -/* - * nss_rmnet_rx_get_context() - */ -struct nss_ctx_instance *nss_rmnet_rx_get_context(void) -{ - return &nss_top_main.nss[nss_top_main.rmnet_rx_handler_id]; -} -EXPORT_SYMBOL(nss_rmnet_rx_get_context); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx_stats.c deleted file mode 100644 index efbcaffc0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx_stats.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_rmnet_rx_stats.h" - -/* - * Data structure that holds the virtual interface context. - */ -extern struct nss_rmnet_rx_handle *rmnet_rx_handle[]; - -/* - * Spinlock to protect the global data structure virt_handle. - */ -extern spinlock_t nss_rmnet_rx_lock; - -/* - * nss_rmnet_rx_stats_str - * rmnet_rx interface stats strings - */ -struct nss_stats_info nss_rmnet_rx_stats_str[NSS_RMNET_RX_STATS_MAX] = { - {"rx_packets" , NSS_STATS_TYPE_COMMON}, - {"rx_bytes" , NSS_STATS_TYPE_COMMON}, - {"tx_packets" , NSS_STATS_TYPE_COMMON}, - {"tx_bytes" , NSS_STATS_TYPE_COMMON}, - {"rx_queue_0_dropped" , NSS_STATS_TYPE_DROP}, - {"rx_queue_1_dropped" , NSS_STATS_TYPE_DROP}, - {"rx_queue_2_dropped" , NSS_STATS_TYPE_DROP}, - {"rx_queue_3_dropped" , NSS_STATS_TYPE_DROP}, - {"enqueue failed" , NSS_STATS_TYPE_DROP}, - {"no available channel" , NSS_STATS_TYPE_SPECIAL}, - {"linear pbuf count" , NSS_STATS_TYPE_SPECIAL}, - {"no pbuf to linear" , NSS_STATS_TYPE_SPECIAL}, - {"no enough room" , NSS_STATS_TYPE_SPECIAL}, - {"channel[0]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[1]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[2]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[3]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[4]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[5]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[6]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[7]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[8]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[9]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[10]" , NSS_STATS_TYPE_SPECIAL}, - {"channel[11]" , NSS_STATS_TYPE_SPECIAL}, - {"DMA full" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_rmnet_rx_stats_get() - * Get rmnet_rx interface stats by interface number. - */ -static bool nss_rmnet_rx_stats_get(struct nss_ctx_instance *nss_ctx, uint32_t if_num, uint64_t *stats, bool is_base) -{ - int i; - uint32_t if_num_curr = if_num; - uint64_t *stats_local; - - if_num = if_num - NSS_DYNAMIC_IF_START; - - spin_lock_bh(&nss_rmnet_rx_lock); - if (!rmnet_rx_handle[if_num]) { - spin_unlock_bh(&nss_rmnet_rx_lock); - return false; - } - - if (if_num_curr == rmnet_rx_handle[if_num]->if_num_n2h) { - stats_local = rmnet_rx_handle[if_num]->stats_n2h; - } else { - stats_local = rmnet_rx_handle[if_num]->stats_h2n; - } - - for (i = 0; i < NSS_RMNET_RX_STATS_MAX; i++) { - stats[i] = stats_local[i]; - } - spin_unlock_bh(&nss_rmnet_rx_lock); - - return true; -} - -/* - * nss_rmnet_rx_stats_read() - * Read rmnet_rx statistics - */ -static ssize_t nss_rmnet_rx_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_stats_data *data = fp->private_data; - struct nss_ctx_instance *nss_ctx = nss_rmnet_rx_get_context(); - int32_t if_num = NSS_DYNAMIC_IF_START; - int32_t max_if_num = if_num + NSS_MAX_DYNAMIC_INTERFACES; - uint32_t max_output_lines = ((NSS_RMNET_RX_STATS_MAX + 3) * NSS_MAX_DYNAMIC_INTERFACES) - + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("%px: Could not allocate memory for local statistics buffer", data); - return 0; - } - - stats_shadow = kzalloc(NSS_RMNET_RX_STATS_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("%px: Could not allocate memory for local shadow buffer", data); - kfree(lbuf); - return 0; - } - - if (data) { - if_num = data->if_num; - } - - if (if_num > max_if_num) { - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "rmnet_rx", NSS_STATS_SINGLE_CORE); - - /* - * Interface statistics for all interfaces. - */ - for (; if_num < max_if_num; if_num++) { - - if (!nss_rmnet_rx_stats_get(nss_ctx, if_num, stats_shadow, false)) { - continue; - } - - size_wr += nss_stats_print("rmnet_rx", "interface", if_num, - nss_rmnet_rx_stats_str, stats_shadow, NSS_RMNET_RX_STATS_MAX, - lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_rmnet_rx_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(rmnet_rx) - -/* - * nss_rmnet_rx_stats_dentry_create() - * Create rmnet_rx statistics debug entry. - */ -void nss_rmnet_rx_stats_dentry_create(void) -{ - nss_stats_create_dentry("rmnet_rx", &nss_rmnet_rx_stats_ops); -} - -/* - * nss_rmnet_rx_stats_sync() - * Sync stats from the NSS FW - */ -void nss_rmnet_rx_stats_sync(struct nss_rmnet_rx_handle *handle, - struct nss_rmnet_rx_stats *nwis, uint32_t if_num) -{ - int i; - uint64_t *stats; - spin_lock_bh(&nss_rmnet_rx_lock); - if (if_num == handle->if_num_n2h) { - stats = handle->stats_n2h; - } else { - stats = handle->stats_h2n; - } - - stats[NSS_RMNET_RX_STATS_RX_PKTS] += nwis->node_stats.rx_packets; - stats[NSS_RMNET_RX_STATS_RX_BYTES] += nwis->node_stats.rx_bytes; - stats[NSS_RMNET_RX_STATS_TX_PKTS] += nwis->node_stats.tx_packets; - stats[NSS_RMNET_RX_STATS_TX_BYTES] += nwis->node_stats.tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - stats[NSS_RMNET_RX_STATS_QUEUE_0_DROPPED + i] += nwis->node_stats.rx_dropped[i]; - } - - stats[NSS_RMNET_RX_STATS_ENQUEUE_FAILED] += nwis->enqueue_failed; - stats[NSS_RMNET_RX_STATS_NO_AVAIL_CHANNEL] += nwis->no_avail_channel; - stats[NSS_RMNET_RX_STATS_NUM_LINEAR_PBUF] += nwis->num_linear_pbuf; - stats[NSS_RMNET_RX_STATS_NO_PBUF_TO_LINEAR] += nwis->no_pbuf_to_linear; - stats[NSS_RMNET_RX_STATS_NO_ENOUGH_ROOM] += nwis->no_enough_room; - - for (i = 0; i < NSS_RMNET_RX_CHANNEL_MAX; i++) { - stats[NSS_RMNET_RX_STATS_USING_CHANNEL0 + i] += nwis->using_channel[i]; - } - - stats[NSS_RMNET_RX_STATS_DMA_FAILED] += nwis->dma_failed; - spin_unlock_bh(&nss_rmnet_rx_lock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx_stats.h deleted file mode 100644 index 638593a6c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_rmnet_rx_stats.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_RMNET_RX_STATS_H -#define __NSS_RMNET_RX_STATS_H - -/* - * rmnet_rx interface statistics types. - */ -enum nss_rmnet_rx_stats_types { - NSS_RMNET_RX_STATS_RX_PKTS, - NSS_RMNET_RX_STATS_RX_BYTES, - NSS_RMNET_RX_STATS_TX_PKTS, - NSS_RMNET_RX_STATS_TX_BYTES, - NSS_RMNET_RX_STATS_QUEUE_0_DROPPED, - NSS_RMNET_RX_STATS_QUEUE_1_DROPPED, - NSS_RMNET_RX_STATS_QUEUE_2_DROPPED, - NSS_RMNET_RX_STATS_QUEUE_3_DROPPED, - NSS_RMNET_RX_STATS_ENQUEUE_FAILED, - NSS_RMNET_RX_STATS_NO_AVAIL_CHANNEL, - NSS_RMNET_RX_STATS_NUM_LINEAR_PBUF, - NSS_RMNET_RX_STATS_NO_PBUF_TO_LINEAR, - NSS_RMNET_RX_STATS_NO_ENOUGH_ROOM, - NSS_RMNET_RX_STATS_USING_CHANNEL0, - NSS_RMNET_RX_STATS_USING_CHANNEL1, - NSS_RMNET_RX_STATS_USING_CHANNEL2, - NSS_RMNET_RX_STATS_USING_CHANNEL3, - NSS_RMNET_RX_STATS_USING_CHANNEL4, - NSS_RMNET_RX_STATS_USING_CHANNEL5, - NSS_RMNET_RX_STATS_USING_CHANNEL6, - NSS_RMNET_RX_STATS_USING_CHANNEL7, - NSS_RMNET_RX_STATS_USING_CHANNEL8, - NSS_RMNET_RX_STATS_USING_CHANNEL9, - NSS_RMNET_RX_STATS_USING_CHANNEL10, - NSS_RMNET_RX_STATS_USING_CHANNEL11, - NSS_RMNET_RX_STATS_DMA_FAILED, - NSS_RMNET_RX_STATS_MAX, -}; - -/* - * Virtual interface statistics APIs - */ -extern void nss_rmnet_rx_stats_sync(struct nss_rmnet_rx_handle *handle, struct nss_rmnet_rx_stats *nwis, uint32_t if_num); -extern void nss_rmnet_rx_stats_dentry_create(void); - -#endif /* __NSS_RMNET_RX_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_rps.c b/feeds/ipq807x/qca-nss-drv/src/nss_rps.c deleted file mode 100644 index c2a603f2d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_rps.c +++ /dev/null @@ -1,644 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2017, 2019-2021 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_rps.c - * NSS RPS based APIs - */ - -#include "nss_tx_rx_common.h" - -#define NSS_RPS_MAX_CORE_HASH_BITMAP ((1 << (NSS_HOST_CORES)) - 1) - /**< Maximum value that when all cores are available. */ -#define NSS_RPS_PRI_MAP_PARAM_FIELD_COUNT 2 - -int nss_rps_config __read_mostly; -int nss_rps_hash_bitmap = NSS_RPS_MAX_CORE_HASH_BITMAP; -int nss_rps_pri_map[NSS_MAX_NUM_PRI]; - -/* - * It is used to parse priority and core from the input. - */ -struct nss_rps_pri_map_parse_data { - uint8_t pri; /**< Priority Index. */ - int8_t core; /**< Host core-id. */ -}; - -/* - * Private data structure. - */ -struct nss_rps_pvt { - struct semaphore sem; /* Semaphore structure. */ - struct completion complete; /* Completion structure. */ - int response; /* Response from FW. */ - void *cb; /* Original cb for sync msgs. */ - void *app_data; /* Original app_data for sync msgs. */ -}; - -static struct nss_rps_pvt nss_rps_cfg_pvt; - -/* - * nss_rps_pri_map_usage() - * Help function shows the usage of the command. - */ -static inline void nss_rps_pri_map_usage(void) -{ - nss_info_always("\nUsage:\n"); - nss_info_always("echo > /proc/sys/dev/nss/rps/pri_map\n\n"); - nss_info_always("priority[0 to %u] core[-1 to %u]:\n\n", - NSS_MAX_NUM_PRI - 1, - NSS_HOST_CORES - 1); -} - -/* - * nss_rps_pri_map_print() - * Sysctl handler for printing rps/pri mapping. - */ -static int nss_rps_pri_map_print(struct ctl_table *ctl, void __user *buffer, - size_t *lenp, loff_t *ppos, int *pri_map) -{ - char *r_buf; - int i, len; - size_t cp_bytes = 0; - - /* - * (2 * 4) + 12 bytes for the buffer size is sufficient to write - * the table including the spaces and new line characters. - */ - r_buf = kzalloc(((4 * NSS_MAX_NUM_PRI) + 12) * sizeof(char), - GFP_KERNEL); - if (!r_buf) { - nss_warning("Failed to alloc buffer to print pri map\n"); - return -EFAULT; - } - - /* - * Write the core values that corresponds to each priorities. - */ - len = scnprintf(r_buf + cp_bytes, 8, "Cores: "); - cp_bytes += len; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - len = scnprintf(r_buf + cp_bytes, 4, "%d ", pri_map[i]); - if (!len) { - nss_warning("failed to read from buffer %d\n", pri_map[i]); - kfree(r_buf); - return -EFAULT; - } - cp_bytes += len; - } - - /* - * Add new line character at the end. - */ - len = scnprintf(r_buf + cp_bytes, 4, "\n"); - cp_bytes += len; - - cp_bytes = simple_read_from_buffer(buffer, *lenp, ppos, r_buf, cp_bytes); - *lenp = cp_bytes; - kfree(r_buf); - return 0; -} - -/* - * nss_rps_pri_map_parse() - * Sysctl handler for rps/pri mappings. - */ -static int nss_rps_pri_map_parse(struct ctl_table *ctl, void __user *buffer, - size_t *lenp, loff_t *ppos, struct nss_rps_pri_map_parse_data *out) -{ - size_t cp_bytes = 0; - char w_buf[5]; - loff_t w_offset = 0; - char *str; - unsigned int pri; - int core, res; - - /* - * Buffer length cannot be different than 4 or 5. - */ - if (*lenp < 4 || *lenp > 5) { - nss_warning("Buffer is not correct. Invalid lenght: %d\n", (int)*lenp); - return -EINVAL; - } - - /* - * It's a write operation - */ - cp_bytes = simple_write_to_buffer(w_buf, *lenp, &w_offset, buffer, 5); - if (cp_bytes != *lenp) { - nss_warning("failed to write to buffer\n"); - return -EFAULT; - } - - str = w_buf; - res = sscanf(str, "%u %d", &pri, &core); - if (res != NSS_RPS_PRI_MAP_PARAM_FIELD_COUNT) { - nss_warning("failed to read the buffer\n"); - return -EFAULT; - } - /* - * pri value cannot be higher than NSS_MAX_NUM_PRI. - */ - if (pri >= NSS_MAX_NUM_PRI) { - nss_warning("invalid pri value: %d\n", pri); - return -EINVAL; - } - - /* - * Host core must be less than NSS_HOST_CORE. - */ - if (core >= NSS_HOST_CORES || core < NSS_N2H_RPS_PRI_DEFAULT) { - nss_warning("invalid priority value: %d\n", core); - return -EINVAL; - } - - nss_info("priority: %d core: %d\n", pri, core); - - out->pri = pri; - out->core = core; - return 0; -} - -/* - * nss_rps_cfg_callback() - * Callback function for rps configuration. - */ -static void nss_rps_cfg_callback(void *app_data, struct nss_n2h_msg *nnm) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)app_data; - if (nnm->cm.response != NSS_CMN_RESPONSE_ACK) { - - /* - * Error, hence we are not updating the nss_rps - * Send a FAILURE to restore the current value - * to its previous state. - */ - nss_rps_cfg_pvt.response = NSS_FAILURE; - complete(&nss_rps_cfg_pvt.complete); - nss_warning("%px: RPS configuration failed : %d\n", nss_ctx, - nnm->cm.error); - return; - } - - nss_info("%px: RPS configuration succeeded: %d\n", nss_ctx, - nnm->cm.error); - nss_ctx->rps_en = nnm->msg.rps_cfg.enable; - nss_rps_cfg_pvt.response = NSS_SUCCESS; - complete(&nss_rps_cfg_pvt.complete); -} - -/* - * nss_rps_pri_map_cfg_callback() - * Callback function for rps pri map configuration. - */ -static void nss_rps_pri_map_cfg_callback(void *app_data, struct nss_n2h_msg *nnm) -{ - if (nnm->cm.response != NSS_CMN_RESPONSE_ACK) { - - /* - * Error, hence we are not updating the nss_pri_map - * Send a failure to restore the current value - * to its previous state. - */ - nss_rps_cfg_pvt.response = NSS_FAILURE; - complete(&nss_rps_cfg_pvt.complete); - nss_warning("%px: RPS pri_map configuration failed : %d\n", - app_data, nnm->cm.error); - return; - } - - nss_info("%px: RPS pri_map configuration succeeded: %d\n", - app_data, nnm->cm.error); - - nss_rps_cfg_pvt.response = NSS_SUCCESS; - complete(&nss_rps_cfg_pvt.complete); -} - -/* - * nss_rps_cfg() - * Send Message to NSS to enable RPS. - */ -static nss_tx_status_t nss_rps_cfg(struct nss_ctx_instance *nss_ctx, int enable_rps) -{ - struct nss_n2h_msg nnm; - nss_tx_status_t nss_tx_status; - int ret; - - down(&nss_rps_cfg_pvt.sem); - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, NSS_TX_METADATA_TYPE_N2H_RPS_CFG, - sizeof(struct nss_n2h_rps), - nss_rps_cfg_callback, - (void *)nss_ctx); - - nnm.msg.rps_cfg.enable = enable_rps; - - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error setting rps\n", nss_ctx); - - up(&nss_rps_cfg_pvt.sem); - return NSS_FAILURE; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_rps_cfg_pvt.complete, msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: Waiting for ack timed out\n", nss_ctx); - up(&nss_rps_cfg_pvt.sem); - return NSS_FAILURE; - } - - /* - * ACK/NACK received from NSS FW - * If NACK: Handler function will restore nss_rps_config - * to previous state. - */ - if (NSS_FAILURE == nss_rps_cfg_pvt.response) { - up(&nss_rps_cfg_pvt.sem); - return NSS_FAILURE; - } - - up(&nss_rps_cfg_pvt.sem); - return NSS_SUCCESS; -} - -/* - * nss_rps_ipv4_hash_bitmap_cfg() - * Send Message to NSS to configure hash_bitmap. - */ -static nss_tx_status_t nss_rps_ipv4_hash_bitmap_cfg(struct nss_ctx_instance *nss_ctx, int hash_bitmap) -{ - struct nss_ipv4_msg nim; - nss_tx_status_t nss_tx_status; - - down(&nss_rps_cfg_pvt.sem); - nss_ipv4_msg_init(&nim, NSS_IPV4_RX_INTERFACE, NSS_IPV4_TX_RPS_HASH_BITMAP_CFG_MSG, - sizeof(struct nss_ipv4_rps_hash_bitmap_cfg_msg), - NULL, NULL); - - nim.msg.rps_hash_bitmap.hash_bitmap = hash_bitmap; - - nss_tx_status = nss_ipv4_tx_sync(nss_ctx, &nim); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error setting rps\n", nss_ctx); - - up(&nss_rps_cfg_pvt.sem); - return NSS_FAILURE; - } - - up(&nss_rps_cfg_pvt.sem); - return NSS_SUCCESS; -} - -#ifdef NSS_DRV_IPV6_ENABLE -/* - * nss_rps_ipv6_hash_bitmap_cfg() - * Send Message to NSS to configure hash_bitmap. - */ -static nss_tx_status_t nss_rps_ipv6_hash_bitmap_cfg(struct nss_ctx_instance *nss_ctx, int hash_bitmap) -{ - struct nss_ipv6_msg nim; - nss_tx_status_t nss_tx_status; - - down(&nss_rps_cfg_pvt.sem); - nss_ipv6_msg_init(&nim, NSS_IPV6_RX_INTERFACE, NSS_IPV6_TX_RPS_HASH_BITMAP_CFG_MSG, - sizeof(struct nss_ipv4_rps_hash_bitmap_cfg_msg), - NULL, NULL); - - nim.msg.rps_hash_bitmap.hash_bitmap = hash_bitmap; - - nss_tx_status = nss_ipv6_tx_sync(nss_ctx, &nim); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error setting rps\n", nss_ctx); - - up(&nss_rps_cfg_pvt.sem); - return NSS_FAILURE; - } - - up(&nss_rps_cfg_pvt.sem); - return NSS_SUCCESS; -} -#endif - -/* - * nss_rps_pri_map_cfg() - * Send Message to NSS to configure pri_map. - */ -static nss_tx_status_t nss_rps_pri_map_cfg(struct nss_ctx_instance *nss_ctx, int *pri_map) -{ - struct nss_n2h_msg nnm; - struct nss_n2h_rps_pri_map *rps_pri_map; - nss_tx_status_t nss_tx_status; - int ret, i; - - down(&nss_rps_cfg_pvt.sem); - nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE, NSS_TX_METADATA_TYPE_N2H_RPS_PRI_MAP_CFG, - sizeof(struct nss_n2h_rps_pri_map), - nss_rps_pri_map_cfg_callback, - (void *)nss_ctx); - - rps_pri_map = &nnm.msg.rps_pri_map; - - /* - * Fill entries at pri_map. - */ - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - rps_pri_map->pri_map[i] = pri_map[i]; - } - - nss_tx_status = nss_n2h_tx_msg(nss_ctx, &nnm); - - if (nss_tx_status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_tx error setting rps\n", nss_ctx); - - up(&nss_rps_cfg_pvt.sem); - return NSS_FAILURE; - } - - /* - * Blocking call, wait till we get ACK for this msg. - */ - ret = wait_for_completion_timeout(&nss_rps_cfg_pvt.complete, msecs_to_jiffies(NSS_CONN_CFG_TIMEOUT)); - if (ret == 0) { - nss_warning("%px: Waiting for ack timed out\n", nss_ctx); - up(&nss_rps_cfg_pvt.sem); - return NSS_FAILURE; - } - - /* - * ACK/NACK received from NSS FW - * If NACK: Handler function will restore nss_rps_config - * to previous state. - */ - if (NSS_FAILURE == nss_rps_cfg_pvt.response) { - up(&nss_rps_cfg_pvt.sem); - return NSS_FAILURE; - } - - up(&nss_rps_cfg_pvt.sem); - return NSS_SUCCESS; -} - -/* - * nss_rps_cfg_handler() - * Enable NSS RPS. - */ -static int nss_rps_cfg_handler(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx; - int ret, ret_rps, current_state, i; - current_state = nss_rps_config; - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - if (ret != NSS_SUCCESS) { - return ret; - } - - if (!write) { - return ret; - } - - if (nss_rps_config == 0) { - nss_info_always("Runtime disabling of NSS RPS not supported\n"); - return ret; - } - - if (nss_rps_config != 1) { - nss_info_always("Invalid input value. Valid values are 0 and 1\n"); - return ret; - } - - for (i = 0; i < nss_top_main.num_nss; i++) { - nss_ctx = &nss_top->nss[i]; - nss_info("Enabling NSS RPS\n"); - ret_rps = nss_rps_cfg(nss_ctx, 1); - - /* - * In here, we also need to revert the state of the previously enabled cores. - * However, runtime disabling is currently not supported since queues are not - * flushed in NSS FW. - * TODO: Flush queues in NSS FW. - */ - if (ret_rps != NSS_SUCCESS) { - nss_warning("%px: rps enabling failed\n", nss_ctx); - nss_rps_config = current_state; - return ret_rps; - } - } - return NSS_SUCCESS; -} - -/* - * nss_rps_hash_bitmap_cfg_handler() - * Configure NSS rps_hash_bitmap - */ -static int nss_rps_hash_bitmap_cfg_handler(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - int ret, ret_ipv4, current_state; - - current_state = nss_rps_hash_bitmap; - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - - if (ret != NSS_SUCCESS) { - nss_rps_hash_bitmap = current_state; - return ret; - } - - if (!write) { - return ret; - } - - if (nss_rps_hash_bitmap <= (NSS_RPS_MAX_CORE_HASH_BITMAP)) { - nss_info("Configuring NSS RPS hash_bitmap\n"); - ret_ipv4 = nss_rps_ipv4_hash_bitmap_cfg(nss_ctx, nss_rps_hash_bitmap); - - if (ret_ipv4 != NSS_SUCCESS) { - nss_warning("%px: ipv4 hash_bitmap config message failed\n", nss_ctx); - nss_rps_hash_bitmap = current_state; - return ret_ipv4; - } - -#ifdef NSS_DRV_IPV6_ENABLE - { - int ret_ipv6; - ret_ipv6 = nss_rps_ipv6_hash_bitmap_cfg(nss_ctx, nss_rps_hash_bitmap); - - if (ret_ipv6 != NSS_SUCCESS) { - nss_warning("%px: ipv6 hash_bitmap config message failed\n", nss_ctx); - nss_rps_hash_bitmap = current_state; - if (nss_rps_ipv4_hash_bitmap_cfg(nss_ctx, nss_rps_hash_bitmap != NSS_SUCCESS)) { - nss_warning("%px: ipv4 and ipv6 have different hash_bitmaps.\n", nss_ctx); - } - return ret_ipv6; - } - } -#endif - return 0; - } - - nss_info_always("Invalid input value. Valid values are less than %d\n", (NSS_RPS_MAX_CORE_HASH_BITMAP)); - return ret; -} - -/* nss_rps_pri_map_cfg_handler() - * Configure NSS rps_pri_map - */ -static int nss_rps_pri_map_cfg_handler(struct ctl_table *ctl, int write, - void __user *buffer, size_t *lenp, loff_t *ppos) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx = &nss_top->nss[0]; - - int ret, ret_pri_map; - struct nss_rps_pri_map_parse_data out, current_state; - if (!write) { - return nss_rps_pri_map_print(ctl, buffer, lenp, ppos, nss_rps_pri_map); - } - - ret = nss_rps_pri_map_parse(ctl, buffer, lenp, ppos, &out); - - if (ret != NSS_SUCCESS) { - nss_rps_pri_map_usage(); - return ret; - } - - nss_info("Configuring NSS RPS Priority Map\n"); - current_state.pri = out.pri; - current_state.core = nss_rps_pri_map[out.pri]; - nss_rps_pri_map[out.pri] = out.core; - ret_pri_map = nss_rps_pri_map_cfg(nss_ctx, nss_rps_pri_map); - if (ret_pri_map != NSS_SUCCESS) { - nss_rps_pri_map[current_state.pri] = current_state.core; - nss_warning("%px: pri_map config message failed\n", nss_ctx); - } - - return ret_pri_map; -} - -static struct ctl_table nss_rps_table[] = { - { - .procname = "enable", - .data = &nss_rps_config, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_rps_cfg_handler, - }, - { - .procname = "hash_bitmap", - .data = &nss_rps_hash_bitmap, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_rps_hash_bitmap_cfg_handler, - }, - { - .procname = "pri_map", - .data = &nss_rps_pri_map[NSS_MAX_NUM_PRI], - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_rps_pri_map_cfg_handler, - }, - { } -}; - -static struct ctl_table nss_rps_dir[] = { - { - .procname = "rps", - .mode = 0555, - .child = nss_rps_table, - }, - { } -}; - -static struct ctl_table nss_rps_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_rps_dir, - }, - { } -}; - -static struct ctl_table nss_rps_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_rps_root_dir, - }, - { } -}; - -static struct ctl_table_header *nss_rps_header; - -/* - * nss_rps_pri_map_init_handler() - * Initialize pri_map for priority based rps selection. - */ -void nss_rps_pri_map_init_handler(void) -{ - int i; - - /* - Initialize the mapping table with the default values. - */ - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_rps_pri_map[i] = NSS_N2H_RPS_PRI_DEFAULT; - } - -} - -/* - * nss_rps_register_sysctl() - */ -void nss_rps_register_sysctl(void) -{ - - /* - * rps sema init. - */ - sema_init(&nss_rps_cfg_pvt.sem, 1); - init_completion(&nss_rps_cfg_pvt.complete); - - nss_rps_pri_map_init_handler(); - - /* - * Register sysctl table. - */ - nss_rps_header = register_sysctl_table(nss_rps_root); -} - -/* - * nss_rps_unregister_sysctl() - * Unregister sysctl specific to rps - */ -void nss_rps_unregister_sysctl(void) -{ - /* - * Unregister sysctl table. - */ - if (nss_rps_header) { - unregister_sysctl_table(nss_rps_header); - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_shaper.c b/feeds/ipq807x/qca-nss-drv/src/nss_shaper.c deleted file mode 100644 index 2726b8ba5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_shaper.c +++ /dev/null @@ -1,367 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014, 2016-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" - -/* - * nss_shaper_register_shaping() - * Register to obtain an NSS context for basic shaping operations - */ -void *nss_shaper_register_shaping(void) -{ - if (nss_top_main.shaping_handler_id == (uint8_t)-1) { - nss_warning("%px: SHAPING IS NOT ENABLED", __func__); - return NULL; - } - return (void *)&nss_top_main.nss[nss_top_main.shaping_handler_id]; -} - -/* - * nss_shaper_unregister_shaping() - * Unregister an NSS shaping context - */ -void nss_shaper_unregister_shaping(void *nss_ctx) -{ -} - -/* - * nss_shaper_register_shaper_bounce_interface() - * Register for performing shaper bounce operations for interface shaper - */ -void *nss_shaper_register_shaper_bounce_interface(uint32_t if_num, nss_shaper_bounced_callback_t cb, void *app_data, struct module *owner) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_shaper_bounce_registrant *reg; - - nss_info("Shaper bounce interface register: %u, cb: %px, app_data: %px, owner: %px", - if_num, cb, app_data, owner); - - /* - * Must be valid interface number - */ - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("Invalid if_num: %u", if_num); - BUG_ON(false); - } - - /* - * Shaping enabled? - */ - if (nss_top_main.shaping_handler_id == (uint8_t)-1) { - nss_warning("%px: SHAPING IS NOT ENABLED", __func__); - return NULL; - } - - /* - * Can we hold the module? - */ - if (!try_module_get(owner)) { - nss_warning("%px: Unable to hold owner", __func__); - return NULL; - } - - spin_lock_bh(&nss_top->lock); - - /* - * Must not have existing registrant - */ - reg = &nss_top->bounce_interface_registrants[if_num]; - if (reg->registered) { - spin_unlock_bh(&nss_top->stats_lock); - module_put(owner); - nss_warning("Already registered: %u", if_num); - BUG_ON(false); - } - - /* - * Register - */ - reg->bounced_callback = cb; - reg->app_data = app_data; - reg->owner = owner; - reg->registered = true; - spin_unlock_bh(&nss_top->lock); - - return (void *)&nss_top->nss[nss_top->shaping_handler_id]; -} - -/* - * nss_shaper_unregister_shaper_bounce_interface() - * Unregister for shaper bounce operations for interface shaper - */ -void nss_shaper_unregister_shaper_bounce_interface(uint32_t if_num) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_shaper_bounce_registrant *reg; - struct module *owner; - - nss_info("Shaper bounce interface unregister: %u", if_num); - - /* - * Must be valid interface number - */ - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("Invalid if_num: %u", if_num); - BUG_ON(false); - } - - spin_lock_bh(&nss_top->lock); - - /* - * Must have existing registrant - */ - reg = &nss_top->bounce_interface_registrants[if_num]; - if (!reg->registered) { - spin_unlock_bh(&nss_top->stats_lock); - nss_warning("Already unregistered: %u", if_num); - BUG_ON(false); - } - - /* - * Unegister - */ - owner = reg->owner; - reg->owner = NULL; - reg->registered = false; - spin_unlock_bh(&nss_top->lock); - - module_put(owner); -} - -/* - * nss_shaper_register_shaper_bounce_bridge() - * Register for performing shaper bounce operations for bridge shaper - */ -void *nss_shaper_register_shaper_bounce_bridge(uint32_t if_num, nss_shaper_bounced_callback_t cb, void *app_data, struct module *owner) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_ctx_instance *nss_ctx; - struct nss_shaper_bounce_registrant *reg; - - nss_info("Shaper bounce bridge register: %u, cb: %px, app_data: %px, owner: %px", - if_num, cb, app_data, owner); - - /* - * Must be valid interface number - */ - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("Invalid if_num: %u", if_num); - BUG_ON(false); - } - - /* - * Shaping enabled? - */ - if (nss_top_main.shaping_handler_id == (uint8_t)-1) { - nss_warning("%px: SHAPING IS NOT ENABLED", __func__); - return NULL; - } - - /* - * Can we hold the module? - */ - if (!try_module_get(owner)) { - nss_warning("%px: Unable to hold owner", __func__); - return NULL; - } - - spin_lock_bh(&nss_top->lock); - - /* - * Must not have existing registrant - */ - reg = &nss_top->bounce_bridge_registrants[if_num]; - if (reg->registered) { - spin_unlock_bh(&nss_top->stats_lock); - module_put(owner); - nss_warning("Already registered: %u", if_num); - BUG_ON(false); - } - - /* - * Register - */ - reg->bounced_callback = cb; - reg->app_data = app_data; - reg->owner = owner; - reg->registered = true; - spin_unlock_bh(&nss_top->lock); - - nss_ctx = &nss_top->nss[nss_top->shaping_handler_id]; - return (void *)nss_ctx; -} - -/* - * nss_shaper_unregister_shaper_bounce_bridge() - * Unregister for shaper bounce operations for bridge shaper - */ -void nss_shaper_unregister_shaper_bounce_bridge(uint32_t if_num) -{ - struct nss_top_instance *nss_top = &nss_top_main; - struct nss_shaper_bounce_registrant *reg; - struct module *owner; - - nss_info("Shaper bounce bridge unregister: %u", if_num); - - /* - * Must be valid interface number - */ - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("Invalid if_num: %u", if_num); - BUG_ON(false); - } - - spin_lock_bh(&nss_top->lock); - - /* - * Must have existing registrant - */ - reg = &nss_top->bounce_bridge_registrants[if_num]; - if (!reg->registered) { - spin_unlock_bh(&nss_top->stats_lock); - nss_warning("Already unregistered: %u", if_num); - BUG_ON(false); - } - - /* - * Wait until any bounce callback that is active is finished - */ - while (reg->callback_active) { - spin_unlock_bh(&nss_top->stats_lock); - yield(); - spin_lock_bh(&nss_top->stats_lock); - } - - /* - * Unegister - */ - owner = reg->owner; - reg->owner = NULL; - reg->registered = false; - spin_unlock_bh(&nss_top->lock); - - module_put(owner); -} - -/* - * nss_shaper_bounce_interface_packet() - * Bounce a packet to the NSS for interface shaping. - * - * You must have registered for interface bounce shaping to call this. - */ -nss_tx_status_t nss_shaper_bounce_interface_packet(void *ctx, uint32_t if_num, struct sk_buff *skb) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)ctx; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_shaper_bounce_registrant *reg; - int32_t status; - - /* - * Must be valid interface number - */ - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("Invalid if_num: %u", if_num); - BUG_ON(false); - } - - /* - * Must have existing registrant - */ - spin_lock_bh(&nss_top->lock); - reg = &nss_top->bounce_interface_registrants[if_num]; - if (!reg->registered) { - spin_unlock_bh(&nss_top->stats_lock); - nss_warning("unregistered: %u", if_num); - return NSS_TX_FAILURE; - } - spin_unlock_bh(&nss_top->lock); - - status = nss_core_send_buffer(nss_ctx, if_num, skb, NSS_IF_H2N_DATA_QUEUE, - H2N_BUFFER_SHAPER_BOUNCE_INTERFACE, 0); - if (status != NSS_CORE_STATUS_SUCCESS) { - return NSS_TX_FAILURE; - } - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_PACKET]); - return NSS_TX_SUCCESS; -} - -/* - * nss_shaper_bounce_bridge_packet() - * Bounce a packet to the NSS for bridge shaping. - * - * You must have registered for bridge bounce shaping to call this. - */ -nss_tx_status_t nss_shaper_bounce_bridge_packet(void *ctx, uint32_t if_num, struct sk_buff *skb) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)ctx; - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_shaper_bounce_registrant *reg; - int32_t status; - - /* - * Must be valid interface number - */ - if (if_num >= NSS_MAX_NET_INTERFACES) { - nss_warning("Invalid if_num: %u", if_num); - BUG_ON(false); - } - - /* - * Must have existing registrant - */ - spin_lock_bh(&nss_top->lock); - reg = &nss_top->bounce_bridge_registrants[if_num]; - if (!reg->registered) { - spin_unlock_bh(&nss_top->stats_lock); - nss_warning("unregistered: %u", if_num); - return NSS_TX_FAILURE; - } - spin_unlock_bh(&nss_top->lock); - - nss_info("%s: Bridge bounce skb: %px, if_num: %u, ctx: %px", __func__, skb, if_num, nss_ctx); - status = nss_core_send_buffer(nss_ctx, if_num, skb, NSS_IF_H2N_DATA_QUEUE, - H2N_BUFFER_SHAPER_BOUNCE_BRIDGE, 0); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_info("%s: Bridge bounce core send rejected", __func__); - return NSS_TX_FAILURE; - } - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_PACKET]); - return NSS_TX_SUCCESS; -} - -/* - * nss_shaper_get_device() - * Gets the original device from probe. - */ -struct device *nss_shaper_get_dev(void) -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.shaping_handler_id]; - return nss_ctx->dev; -} - -EXPORT_SYMBOL(nss_shaper_bounce_bridge_packet); -EXPORT_SYMBOL(nss_shaper_bounce_interface_packet); -EXPORT_SYMBOL(nss_shaper_unregister_shaper_bounce_interface); -EXPORT_SYMBOL(nss_shaper_register_shaper_bounce_interface); -EXPORT_SYMBOL(nss_shaper_unregister_shaper_bounce_bridge); -EXPORT_SYMBOL(nss_shaper_register_shaper_bounce_bridge); -EXPORT_SYMBOL(nss_shaper_register_shaping); -EXPORT_SYMBOL(nss_shaper_unregister_shaping); -EXPORT_SYMBOL(nss_shaper_get_dev); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_sjack.c b/feeds/ipq807x/qca-nss-drv/src/nss_sjack.c deleted file mode 100644 index 086eedfea..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_sjack.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_sjack_stats.h" -#include "nss_sjack_log.h" - -/* - * nss_sjack_handler() - * Handle NSS -> HLOS messages for sjack - */ -static void nss_sjack_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data) -{ - void *ctx; - nss_sjack_msg_callback_t cb; - struct nss_sjack_msg *nsm = (struct nss_sjack_msg *)ncm; - - BUG_ON(ncm->interface != NSS_SJACK_INTERFACE); - - /* - * Trace Messages - */ - nss_sjack_log_rx_msg(nsm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_SJACK_MAX_MSG_TYPE) { - nss_warning("%px: received invalid message %d for sjack interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_sjack_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Update the callback and app_data for NOTIFY messages, sjack sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ncm->type) { - case NSS_SJACK_STATS_SYNC_MSG: - /* - * Update sjack statistics on node sync. - */ - nss_sjack_stats_node_sync(nss_ctx, &nsm->msg.stats_sync); - break; - } - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_sjack_msg_callback_t)ncm->cb; - ctx = nss_ctx->subsys_dp_register[ncm->interface].ndev; - - cb(ctx, ncm); -} - -/* - * nss_sjack_tx_msg() - * Transmit a sjack message to NSSFW - */ -nss_tx_status_t nss_sjack_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_sjack_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_sjack_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_SJACK_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_SJACK_MAX_MSG_TYPE) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - * nss_sjack_register_if() - */ -struct nss_ctx_instance *nss_sjack_register_if(uint32_t if_num, struct net_device *netdev, - nss_sjack_msg_callback_t event_callback) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.sjack_handler_id]; - uint32_t status; - - nss_assert(nss_ctx); - nss_assert(if_num == NSS_SJACK_INTERFACE); - - nss_core_register_subsys_dp(nss_ctx, if_num, NULL, NULL, NULL, netdev, 0); - - status = nss_core_register_msg_handler(nss_ctx, NSS_SJACK_INTERFACE, event_callback); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to register handler for interface %d with NSS core\n", nss_ctx, if_num); - return NULL; - } - - return nss_ctx; -} - -/* - * nss_sjack_unregister_if() - */ -void nss_sjack_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.sjack_handler_id]; - uint32_t status; - - nss_assert(nss_ctx); - nss_assert(if_num == NSS_SJACK_INTERFACE); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for interface %d with NSS core\n", nss_ctx, if_num); - return; - } - - return; -} - -/* - * nss_sjack_get_context() - * get NSS context instance for sjack - */ -struct nss_ctx_instance *nss_sjack_get_context(void) -{ - return &nss_top_main.nss[nss_top_main.sjack_handler_id]; -} -EXPORT_SYMBOL(nss_sjack_get_context); - -/* - * nss_sjack_register_handler() - * Registering handler for sending msg to sjack node on NSS. - */ -void nss_sjack_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_sjack_get_context(); - - nss_core_register_handler(nss_ctx, NSS_SJACK_INTERFACE, nss_sjack_handler, NULL); - - nss_sjack_stats_dentry_create(); -} - -EXPORT_SYMBOL(nss_sjack_register_if); -EXPORT_SYMBOL(nss_sjack_unregister_if); -EXPORT_SYMBOL(nss_sjack_tx_msg); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_sjack_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_sjack_log.c deleted file mode 100644 index c585b7483..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_sjack_log.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_sjack_log.c - * NSS SJACK logger file. - */ - -#include "nss_core.h" - -/* - * nss_sjack_log_message_types_str - * NSS SJACK message strings - */ -static int8_t *nss_sjack_log_message_types_str[NSS_SJACK_MAX_MSG_TYPE] __maybe_unused = { - "SJACK Configure", - "SJACK Unconfigure", - "SJACK Stats", -}; - -/* - * nss_sjack_log_configure_msg() - * Log NSS SJACK Configure. - */ -static void nss_sjack_log_configure_msg(struct nss_sjack_msg *nsm) -{ - struct nss_sjack_configure_msg *nscm __maybe_unused = &nsm->msg.configure; - nss_trace("%px: NSS SJACK Configure message \n" - "SJACK Ingress Interface Number: %d\n" - "SJACK Engress Interface Number: %d\n" - "SJACK Tunnel ID: %d\n" - "SJACK DSCP Value: %d\n" - "SJACK GRE Priority: %d\n" - "SJACK GRE Flags: %d\n" - "SJACK IPSEC SA Pattern Flag: %d\n", - nscm, nscm->ingress_if_num, - nscm->egress_if_num, nscm->tunnel_id, - nscm->ip_dscp, nscm->gre_prio, - nscm->gre_flags, nscm->use_ipsec_sa_pattern); -} - -/* - * nss_sjack_log_unconfigure_msg() - * Log NSS SJACK Unconfigure. - */ -static void nss_sjack_log_unconfigure_msg(struct nss_sjack_msg *nsm) -{ - struct nss_sjack_unconfigure_msg *nsum __maybe_unused = &nsm->msg.unconfigure; - nss_trace("%px: NSS SJACK UnConfigure message \n" - "SJACK Ingress Interface Number: %d\n", - nsum, nsum->ingress_if_num); -} - -/* - * nss_sjack_log_verbose() - * Log message contents. - */ -static void nss_sjack_log_verbose(struct nss_sjack_msg *nsm) -{ - switch (nsm->cm.type) { - case NSS_SJACK_CONFIGURE_MSG: - nss_sjack_log_configure_msg(nsm); - break; - - case NSS_SJACK_UNCONFIGURE_MSG: - nss_sjack_log_unconfigure_msg(nsm); - break; - - case NSS_SJACK_STATS_SYNC_MSG: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", nsm); - break; - } -} - -/* - * nss_sjack_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_sjack_log_tx_msg(struct nss_sjack_msg *nsm) -{ - if (nsm->cm.type >= NSS_SJACK_MAX_MSG_TYPE) { - nss_warning("%px: Invalid message type\n", nsm); - return; - } - - nss_info("%px: type[%d]:%s\n", nsm, nsm->cm.type, nss_sjack_log_message_types_str[nsm->cm.type]); - nss_sjack_log_verbose(nsm); -} - -/* - * nss_sjack_log_rx_msg() - * Log messages received from FW. - */ -void nss_sjack_log_rx_msg(struct nss_sjack_msg *nsm) -{ - if (nsm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nsm); - return; - } - - if (nsm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nsm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nsm, nsm->cm.type, - nss_sjack_log_message_types_str[nsm->cm.type], - nsm->cm.response, nss_cmn_response_str[nsm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - nsm, nsm->cm.type, nss_sjack_log_message_types_str[nsm->cm.type], - nsm->cm.response, nss_cmn_response_str[nsm->cm.response]); - -verbose: - nss_sjack_log_verbose(nsm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_sjack_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_sjack_log.h deleted file mode 100644 index 56435a444..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_sjack_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_SJACK_LOG_H -#define __NSS_SJACK_LOG_H - -/* - * nss_sjack.h - * NSS SJACK header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_sjack_log_tx_msg - * Logs a sjack message that is sent to the NSS firmware. - */ -void nss_sjack_log_tx_msg(struct nss_sjack_msg *nsm); - -/* - * nss_sjack_log_rx_msg - * Logs a sjack message that is received from the NSS firmware. - */ -void nss_sjack_log_rx_msg(struct nss_sjack_msg *nsm); - -#endif /* __NSS_SJACK_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_sjack_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_sjack_stats.c deleted file mode 100644 index 139a34941..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_sjack_stats.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_sjack_stats.h" - -/* - * nss_sjack_stats_read() - * Read SJACK stats - */ -static ssize_t nss_sjack_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * max output lines = #stats + start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + 5; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_STATS_NODE_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "sjack", NSS_STATS_SINGLE_CORE); - size_wr += nss_stats_fill_common_stats(NSS_SJACK_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "sjack"); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_sjack_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(sjack) - -/* - * nss_sjack_stats_dentry_create() - * Create SJACK node statistics debug entry. - */ -void nss_sjack_stats_dentry_create(void) -{ - nss_stats_create_dentry("sjack", &nss_sjack_stats_ops); -} - -/* - * nss_sjack_stats_node_sync() - * Update sjack node stats. - */ -void nss_sjack_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_sjack_stats_sync_msg *nins) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - int j; - - /* - * Update SJACK node stats. - */ - spin_lock_bh(&nss_top->stats_lock); - nss_top->stats_node[NSS_SJACK_INTERFACE][NSS_SJACK_STATS_RX_PKTS] += nins->node_stats.rx_packets; - nss_top->stats_node[NSS_SJACK_INTERFACE][NSS_SJACK_STATS_RX_BYTES] += nins->node_stats.rx_bytes; - nss_top->stats_node[NSS_SJACK_INTERFACE][NSS_SJACK_STATS_TX_PKTS] += nins->node_stats.tx_packets; - nss_top->stats_node[NSS_SJACK_INTERFACE][NSS_SJACK_STATS_TX_BYTES] += nins->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_top->stats_node[NSS_SJACK_INTERFACE][NSS_SJACK_STATS_RX_QUEUE_0_DROPPED + j] += nins->node_stats.rx_dropped[j]; - } - - spin_unlock_bh(&nss_top->stats_lock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_sjack_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_sjack_stats.h deleted file mode 100644 index cbcd60453..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_sjack_stats.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_SJACK_STATS_H -#define __NSS_SJACK_STATS_H - -/* - * SJACK statistics - */ -enum nss_sjack_stats_types { - NSS_SJACK_STATS_RX_PKTS, /* sjack node RX packets */ - NSS_SJACK_STATS_RX_BYTES, /* sjack node RX bytes */ - NSS_SJACK_STATS_TX_PKTS, /* sjack node TX packets */ - NSS_SJACK_STATS_TX_BYTES, /* sjack node TX bytes */ - NSS_SJACK_STATS_RX_QUEUE_0_DROPPED, - /* sjack node RX Queue 0 dropped */ - NSS_SJACK_STATS_RX_QUEUE_1_DROPPED, - /* sjack node RX Queue 1 dropped */ - NSS_SJACK_STATS_RX_QUEUE_2_DROPPED, - /* sjack node RX Queue 2 dropped */ - NSS_SJACK_STATS_RX_QUEUE_3_DROPPED, - /* sjack node RX Queue 3 dropped */ - NSS_SJACK_STATS_MAX, -}; - -/* - * SJACK statistics APIs - */ -extern void nss_sjack_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_sjack_stats_sync_msg *nins); -extern void nss_sjack_stats_dentry_create(void); - -#endif /* __NSS_SJACK_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_stats.c deleted file mode 100644 index 9605c372b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_stats.c +++ /dev/null @@ -1,481 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_drv_stats.h" - -/* - * Maximum banner length: - */ -#define NSS_STATS_BANNER_MAX_LENGTH 80 - -/* - * Maximum number of digits a stats value can have: - */ -#define NSS_STATS_DIGITS_MAX 16 - -/* - * Spaces to print core details inside banner - */ -#define NSS_STATS_BANNER_SPACES 12 - -/* - * Max characters for a node name. - */ -#define NSS_STATS_NODE_NAME_MAX 24 - -int nonzero_stats_print = 0; - -/* - * nss_stats_spacing() - * Framework to maintain consistent spacing between stats value and stats type. - */ -static size_t nss_stats_spacing(uint64_t stats_val, char *lbuf, size_t size_wr, size_t size_al) -{ - int i; - int digit_counter = (stats_val == 0 ? 1 : 0); - while (stats_val != 0) { - /* - * TODO: need to check for (nss_ptr_t) - */ - stats_val = (nss_ptr_t)stats_val / 10; - digit_counter++; - } - - for (i = 0; i < NSS_STATS_DIGITS_MAX - digit_counter; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " "); - } - - return size_wr; -} - -/* - * nss_stats_nonzero_handler() - * Handler to take nonzero stats print configuration. - */ -static int nss_stats_nonzero_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos) -{ - int ret; - ret = proc_dointvec(ctl, write, buffer, lenp, ppos); - return ret; -} - -static struct ctl_table nss_stats_table[] = { - { - .procname = "non_zero_stats", - .data = &nonzero_stats_print, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &nss_stats_nonzero_handler, - }, - { } -}; - -static struct ctl_table nss_stats_dir[] = { - { - .procname = "stats", - .mode = 0555, - .child = nss_stats_table, - }, - { } -}; - -static struct ctl_table nss_stats_root_dir[] = { - { - .procname = "nss", - .mode = 0555, - .child = nss_stats_dir, - }, - { } -}; - -static struct ctl_table nss_stats_root[] = { - { - .procname = "dev", - .mode = 0555, - .child = nss_stats_root_dir, - }, - { } -}; -static struct ctl_table_header *nss_stats_header; - -/* - * nss_stats_register_sysctl() - * Register a sysctl table for stats. - */ -void nss_stats_register_sysctl(void) -{ - /* - * Register sysctl table. - */ - nss_stats_header = register_sysctl_table(nss_stats_root); -} - -/* - * nss_stats_open() - * Opens stats file. - */ -int nss_stats_open(struct inode *inode, struct file *filp) -{ - struct nss_stats_data *data = NULL; - - data = kzalloc(sizeof(struct nss_stats_data), GFP_KERNEL); - if (!data) { - return -ENOMEM; - } - - memset(data, 0, sizeof (struct nss_stats_data)); - data->if_num = NSS_DYNAMIC_IF_START; - data->index = 0; - data->edma_id = (nss_ptr_t)inode->i_private; - data->nss_ctx = (struct nss_ctx_instance *)(inode->i_private); - filp->private_data = data; - - return 0; -} - -/* - * nss_stats_release() - * Releases stats file. - */ -int nss_stats_release(struct inode *inode, struct file *filp) -{ - struct nss_stats_data *data = filp->private_data; - - if (data) { - kfree(data); - } - - return 0; -} - -/* - * nss_stats_clean() - * Cleanup NSS statistics files. - */ -void nss_stats_clean(void) -{ - /* - * Remove debugfs tree - */ - if (likely(nss_top_main.top_dentry != NULL)) { - debugfs_remove_recursive(nss_top_main.top_dentry); - nss_top_main.top_dentry = NULL; - } -} - -/* - * nss_stats_reset_common_stats() - * Reset common node statistics. - */ -void nss_stats_reset_common_stats(uint32_t if_num) -{ - if (unlikely(if_num >= NSS_MAX_NET_INTERFACES)) { - return; - } - - spin_lock_bh(&nss_top_main.stats_lock); - memset(nss_top_main.stats_node[if_num], 0, NSS_STATS_NODE_MAX * sizeof(uint64_t)); - spin_unlock_bh(&nss_top_main.stats_lock); -} - -/* - * nss_stats_fill_common_stats() - * Fill common node statistics. - */ -size_t nss_stats_fill_common_stats(uint32_t if_num, int instance, char *lbuf, size_t size_wr, size_t size_al, char *node) -{ - uint64_t stats_val[NSS_STATS_NODE_MAX]; - int i; - size_t orig_size_wr = size_wr; - - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_STATS_NODE_MAX; i++) { - stats_val[i] = nss_top_main.stats_node[if_num][i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print(node, NULL, instance, nss_strings_stats_node, stats_val, NSS_STATS_NODE_MAX, lbuf, size_wr, size_al); - return size_wr - orig_size_wr; -} - -/* - * nss_stats_banner() - * Printing banner for node. - */ -size_t nss_stats_banner(char *lbuf, size_t size_wr, size_t size_al, char *node, int core) -{ - uint16_t banner_char_length, i; - size_t orig_size_wr = size_wr; - char node_upr[NSS_STATS_NODE_NAME_MAX + 1]; - - if (strlen(node) > NSS_STATS_NODE_NAME_MAX) { - nss_warning("Node name %s larger than %d characters\n", node, NSS_STATS_NODE_NAME_MAX); - return 0; - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - for (i = 0; i < NSS_STATS_BANNER_MAX_LENGTH ; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "_"); - } - if (core > NSS_STATS_SINGLE_CORE) { - banner_char_length = (uint16_t)((NSS_STATS_BANNER_MAX_LENGTH - (strlen(node) + NSS_STATS_BANNER_SPACES)) / 2); - } else { - banner_char_length = (uint16_t)((NSS_STATS_BANNER_MAX_LENGTH - (strlen(node) + 2)) / 2); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n\n"); - for (i = 0; i < banner_char_length; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "<"); - } - - strlcpy(node_upr, node, NSS_STATS_NODE_NAME_MAX); - for (i = 0; node_upr[i] != '\0' && i < NSS_STATS_NODE_NAME_MAX; i++) { - node_upr[i] = toupper(node_upr[i]); - } - - /* - * TODO: Enhance so that both core0 and core1 print the same way for a - * node that has presence in both cores. i.e. Core0 should have [CORE 0] - * and not just Core1. - */ - if (core > 1) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " %s [CORE %d] ", node_upr, core); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " %s ", node_upr); - } - for (i = 0; i < banner_char_length; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, ">"); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - for (i = 0; i < NSS_STATS_BANNER_MAX_LENGTH; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "_"); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n\n"); - return size_wr - orig_size_wr; -} - -/* - * nss_stats_print() - * Helper API to print stats. - */ -size_t nss_stats_print(char *node, char *stat_details, int instance, struct nss_stats_info *stats_info, - uint64_t *stats_val, uint16_t max, char *lbuf, size_t size_wr, size_t size_al) -{ - uint16_t i, j; - uint16_t maxlen = 0; - char stats_string[NSS_STATS_MAX_STR_LENGTH]; - size_t orig_size_wr = size_wr; - char node_lwr[NSS_STATS_NODE_NAME_MAX + 1]; - - if (strlen(node) > NSS_STATS_NODE_NAME_MAX) { - nss_warning("Node name %s (%u chars) is longer than max chars of %d\n", - node, (uint32_t)strlen(node), NSS_STATS_NODE_NAME_MAX); - return 0; - } - - /* - * Calculating the maximum of the array for indentation purposes. - */ - for (i = 0; i < max; i++){ - if (strlen(stats_info[i].stats_name) > maxlen) { - maxlen = strlen(stats_info[i].stats_name); - } - } - - if (stat_details != NULL) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n#%s\n\n", stat_details); - } - - for (i = 0; i < max; i++){ - if (nonzero_stats_print == 1 && stats_val[i] == 0) { - continue; - } - - strlcpy(stats_string, stats_info[i].stats_name, NSS_STATS_MAX_STR_LENGTH); - - /* - * Converting uppercase to lower case. - */ - for (j = 0; stats_string[j] != '\0' && j < NSS_STATS_MAX_STR_LENGTH; j++) { - stats_string[j] = tolower(stats_string[j]); - } - - strlcpy(node_lwr, node, NSS_STATS_NODE_NAME_MAX); - for (j = 0; node_lwr[j] != '\0' && j < NSS_STATS_NODE_NAME_MAX; j++) { - node_lwr[j] = tolower(node_lwr[j]); - } - - /* - * Space before %s is needed to avoid printing stat name from start of the line. - */ - if (instance < 0) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\t%s_%s", node_lwr, stats_string); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\t%s[%d]_%s", node_lwr, instance, stats_string); - } - - for (j = 0; j < (1 + maxlen - strlen(stats_string)); j++){ - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " "); - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "= %llu", stats_val[i]); - size_wr = nss_stats_spacing(stats_val[i], lbuf, size_wr, size_al); - - /* - * Switch case will take care of the indentation and spacing details. - */ - switch (stats_info[i].stats_type) { - case NSS_STATS_TYPE_COMMON: - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "common\n"); - break; - - case NSS_STATS_TYPE_SPECIAL: - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "special\n"); - break; - - case NSS_STATS_TYPE_DROP: - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "drop\n"); - break; - - case NSS_STATS_TYPE_ERROR: - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "error\n"); - break; - - case NSS_STATS_TYPE_EXCEPTION: - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "exception\n"); - break; - - default: - nss_warning("unknown statistics type"); - break; - } - } - - return size_wr - orig_size_wr; -} - -/* - * nss_stats_create_dentry() - * Create statistics debug entry for subsystem. - */ -void nss_stats_create_dentry(char *name, const struct file_operations *ops) -{ - if (!debugfs_create_file(name, 0400, nss_top_main.stats_dentry, &nss_top_main, ops)) { - nss_warning("Failed to create debug entry for subsystem %s\n", name); - } -} - -/* - * TODO: Move the rest of the code to (nss_wt_stats.c, nss_gmac_stats.c) accordingly. - */ - -/* - * gmac_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(gmac); - -/* - * wt_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(wt); - -/* - * nss_stats_init() - * Enable NSS statistics. - */ -void nss_stats_init(void) -{ - struct dentry *core_dentry = NULL; - struct dentry *wt_dentry = NULL; - char file_name[10]; - int i; - - /* - * NSS driver entry - */ - nss_top_main.top_dentry = debugfs_create_dir("qca-nss-drv", NULL); - if (unlikely(nss_top_main.top_dentry == NULL)) { - nss_warning("Failed to create qca-nss-drv directory in debugfs"); - - /* - * Non availability of debugfs directory is not a catastrophy. - * We can still go ahead with other initialization. - */ - return; - } - - nss_top_main.stats_dentry = debugfs_create_dir("stats", nss_top_main.top_dentry); - if (unlikely(nss_top_main.stats_dentry == NULL)) { - nss_warning("Failed to create qca-nss-drv directory in debugfs"); - - /* - * Non availability of debugfs directory is not a catastrophy. - * We can still go ahead with rest of initialization. - */ - return; - } - - /* - * Create files to obtain statistics. - */ - - /* - * drv_stats - */ - nss_drv_stats_dentry_create(); - - /* - * gmac_stats - */ - nss_stats_create_dentry("gmac", &nss_gmac_stats_ops); - - /* - * Per-project stats - */ - nss_top_main.project_dentry = debugfs_create_dir("project", - nss_top_main.stats_dentry); - if (unlikely(nss_top_main.project_dentry == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/project directory in debugfs"); - return; - } - - for (i = 0; i < nss_top_main.num_nss; ++i) { - memset(file_name, 0, sizeof(file_name)); - scnprintf(file_name, sizeof(file_name), "core%d", i); - core_dentry = debugfs_create_dir(file_name, - nss_top_main.project_dentry); - if (unlikely(core_dentry == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/project/core%d directory in debugfs", i); - return; - } - - wt_dentry = debugfs_create_file("worker_threads", - 0400, - core_dentry, - &(nss_top_main.nss[i]), - &nss_wt_stats_ops); - if (unlikely(wt_dentry == NULL)) { - nss_warning("Failed to create qca-nss-drv/stats/project/core%d/worker_threads file in debugfs", i); - return; - } - } - - nss_log_init(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_stats.h deleted file mode 100644 index 385c71aad..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_stats.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_stats.h - * printing stats header file - */ - -#ifndef __NSS_STATS_PRINT_H -#define __NSS_STATS_PRINT_H -#include -#include -#include -#include - -/* - * Defines to be used by single instance/core packages. -*/ -#define NSS_STATS_SINGLE_CORE -1 -#define NSS_STATS_SINGLE_INSTANCE -1 - -/* - * Number of Extra outputlines for future reference to add new stats + start tag line + end tag line + three blank lines - */ -#define NSS_STATS_EXTRA_OUTPUT_LINES 35 - -#define NSS_STATS_DECLARE_FILE_OPERATIONS(name) \ -static const struct file_operations nss_##name##_stats_ops = { \ - .open = nss_stats_open, \ - .read = nss_##name##_stats_read, \ - .llseek = generic_file_llseek, \ - .release = nss_stats_release, \ -}; - -/* - * Private data for every file descriptor - */ -struct nss_stats_data { - uint32_t if_num; /**< Interface number for stats */ - uint32_t index; /**< Index for GRE_REDIR stats */ - uint32_t edma_id; /**< EDMA port ID or ring ID */ - struct nss_ctx_instance *nss_ctx; - /**< The core for project stats */ -}; - -/* - * Structure definition carrying stats info. - */ -struct nss_stats_info { - char stats_name[NSS_STATS_MAX_STR_LENGTH]; /* stat name */ - enum nss_stats_types stats_type; /* enum that tags stat type */ -}; - -extern void nss_stats_register_sysctl(void); -void nss_stats_init(void); -extern int nss_stats_release(struct inode *inode, struct file *filp); -extern int nss_stats_open(struct inode *inode, struct file *filp); -void nss_stats_create_dentry(char *name, const struct file_operations *ops); -extern void nss_stats_reset_common_stats(uint32_t if_num); -extern size_t nss_stats_fill_common_stats(uint32_t if_num, int instance, char *lbuf, size_t size_wr, size_t size_al, char *node); -extern size_t nss_stats_banner(char *lbuf , size_t size_wr, size_t size_al, char *node, int core); -extern size_t nss_stats_print(char *node, char *stat_details, int instance, struct nss_stats_info *stats_info, uint64_t *stats_val, uint16_t max, char *lbuf, size_t size_wr, size_t size_al); -#endif /* __NSS_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_strings.c deleted file mode 100644 index 432b1546b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_strings.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_strings.c - * NSS driver strings APIs. - */ - -#include "nss_strings.h" -#include "nss_core.h" -#include "nss_drv_strings.h" - -/* - * common stats - */ -struct nss_stats_info nss_strings_stats_node[NSS_STATS_NODE_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_byts" , NSS_STATS_TYPE_COMMON}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_byts" , NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_strings_print() - * Helper API to print stats names - */ -size_t nss_strings_print(char __user *ubuf, size_t sz, loff_t *ppos, struct nss_stats_info *stats_info, uint16_t max) -{ - int32_t i; - size_t size_al = (NSS_STATS_MAX_STR_LENGTH + 12) * max; - size_t size_wr = 0; - ssize_t bytes_read = 0; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (!lbuf) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - for (i = 0; i < max; i++) { - /* - * Print what we have but don't exceed the buffer. - */ - if (size_wr >= size_al) { - nss_info_always("Buffer overflowed.\n"); - break; - } - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "\t%d , %s\n", stats_info[i].stats_type, stats_info[i].stats_name); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - - return bytes_read; -} - -/* - * nss_strings_create_dentry() - * Create strings debug entry for subsystem. - */ -void nss_strings_create_dentry(char *name, const struct file_operations *ops) -{ - if (!nss_top_main.strings_dentry || !debugfs_create_file(name, 0400, nss_top_main.strings_dentry, &nss_top_main, ops)) { - nss_warning("Failed to create debug entry for subsystem %s\n", name); - } -} - -/* - * nss_strings_open() - */ -int nss_strings_open(struct inode *inode, struct file *filp) -{ - struct nss_strings_data *data = NULL; - - data = kzalloc(sizeof(struct nss_strings_data), GFP_KERNEL); - if (!data) { - return -ENOMEM; - } - data->if_num = NSS_DYNAMIC_IF_START; - data->nss_ctx = (struct nss_ctx_instance *)(inode->i_private); - filp->private_data = data; - - return 0; -} - -/* - * nss_strings_release() - */ -int nss_strings_release(struct inode *inode, struct file *filp) -{ - struct nss_strings_data *data = filp->private_data; - - if (data) { - kfree(data); - } - - return 0; -} - -/* - * nss_common_node_stats_strings_read() - * Read common node statistics names. - */ -static ssize_t nss_common_node_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_strings_stats_node, NSS_STATS_NODE_MAX); -} - -/* - * nss_common_node_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(common_node_stats); - -/* - * nss_strings_init() - * Enable NSS statistics - */ -void nss_strings_init(void) -{ - nss_top_main.strings_dentry = debugfs_create_dir("strings", nss_top_main.top_dentry); - if (unlikely(nss_top_main.strings_dentry == NULL)) { - nss_warning("Failed to create strings directory in debugfs/qca-nss-drv"); - return; - } - - /* - * Common node statistics - */ - nss_strings_create_dentry("common_node_stats", &nss_common_node_stats_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_strings.h deleted file mode 100644 index 32bf46601..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_strings.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_strings.h - * NSS driver strings header file. - */ - -#ifndef __NSS_STRINGS_H -#define __NSS_STRINGS_H - -#include -#include "nss_stats.h" - -#define NSS_STRINGS_DECLARE_FILE_OPERATIONS(name) \ -static const struct file_operations nss_##name##_strings_ops = { \ - .open = nss_strings_open, \ - .read = nss_##name##_strings_read, \ - .llseek = generic_file_llseek, \ - .release = nss_strings_release, \ -} - -/* - * Private data for every file descriptor - */ -struct nss_strings_data { - uint32_t if_num; /**< Interface number for stats */ - struct nss_ctx_instance *nss_ctx; /**< The core for project stats */ -}; - -extern struct nss_stats_info nss_strings_stats_node[NSS_STATS_NODE_MAX]; -void nss_strings_init(void); -int nss_strings_release(struct inode *inode, struct file *filp); -int nss_strings_open(struct inode *inode, struct file *filp); -void nss_strings_create_dentry(char *name, const struct file_operations *ops); -size_t nss_strings_fill_common_stats(char __user *ubuf, size_t sz, loff_t *ppos); -size_t nss_strings_print(char __user *ubuf, size_t sz, loff_t *ppos, struct nss_stats_info *stats_info, uint16_t max); - -#endif /* __NSS_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls.c b/feeds/ipq807x/qca-nss-drv/src/nss_tls.c deleted file mode 100644 index ff5336333..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tls.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_tls_log.h" -#include "nss_tls_stats.h" -#include "nss_tls_strings.h" - -#define NSS_TLS_INTERFACE_MAX_LONG BITS_TO_LONGS(NSS_MAX_NET_INTERFACES) -#define NSS_TLS_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Private data structure for handling synchronous messaging. - */ -static struct nss_tls_pvt { - struct semaphore sem; - struct completion complete; - struct nss_tls_msg ntcm; - unsigned long if_map[NSS_TLS_INTERFACE_MAX_LONG]; -} tls_pvt; - -/* - * nss_tls_verify_ifnum() - * Verify if the interface number is a TLS interface. - */ -static bool nss_tls_verify_ifnum(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - enum nss_dynamic_interface_type type = nss_dynamic_interface_get_type(nss_ctx, if_num); - - if (type == NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER) - return true; - - if (type == NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER) - return true; - - if (if_num == NSS_TLS_INTERFACE) - return true; - - return false; -} - -/* - * nss_tls_handler() - * Handle NSS -> HLOS messages for tls tunnel - */ -static void nss_tls_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *data) -{ - nss_tls_msg_callback_t cb; - void *app_data; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_trace("%px: handle event for interface num :%u", nss_ctx, ncm->interface); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_TLS_MSG_MAX) { - nss_warning("%px:Bad message type(%d) for TLS interface %d", nss_ctx, ncm->type, ncm->interface); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_tls_msg)) { - nss_warning("%px:Bad message length(%d)", nss_ctx, ncm->len); - return; - } - - if (ncm->type == NSS_TLS_MSG_TYPE_CTX_SYNC) { - nss_tls_stats_sync(nss_ctx, ncm); - nss_tls_stats_notify(nss_ctx, ncm->interface); - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->nss_rx_interface_handlers[ncm->interface].app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace messages. - */ - nss_tls_log_rx_msg((struct nss_tls_msg *)ncm); - - /* - * Callback - */ - cb = (nss_tls_msg_callback_t)ncm->cb; - app_data = (void *)ncm->app_data; - - /* - * Call TLS session callback - */ - if (!cb) { - nss_warning("%px: No callback for tls session interface %d", nss_ctx, ncm->interface); - return; - } - - nss_trace("%px: calling tlsmgr event handler(%u)", nss_ctx, ncm->interface); - cb(app_data, ncm); -} - -/* - * nss_tls_sync_resp() - * Callback to handle the completion of HLOS-->NSS messages. - */ -static void nss_tls_sync_resp(void *app_data, struct nss_cmn_msg *ncm) -{ - struct nss_tls_msg *pvt_msg = app_data; - struct nss_tls_msg *resp_msg = container_of(ncm, struct nss_tls_msg, cm); - - /* - * Copy response message to pvt message - */ - memcpy(pvt_msg, resp_msg, sizeof(*resp_msg)); - - /* - * Write memory barrier - */ - smp_wmb(); - - complete(&tls_pvt.complete); -} - -/* - * nss_tls_ifmap_get() - * Return TLS active interfaces map. - */ -unsigned long *nss_tls_ifmap_get(void) -{ - return tls_pvt.if_map; -} - -/* - * nss_tls_tx_buf() - * Transmit buffer over TLS interface - */ -nss_tx_status_t nss_tls_tx_buf(struct sk_buff *skb, uint32_t if_num, struct nss_ctx_instance *nss_ctx) -{ - int32_t status; - - if (!nss_tls_verify_ifnum(nss_ctx, if_num)) - return NSS_TX_FAILURE; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: tx_data packet dropped as core not ready", nss_ctx); - return NSS_TX_FAILURE_NOT_READY; - } - - status = nss_core_send_buffer(nss_ctx, if_num, skb, NSS_IF_H2N_DATA_QUEUE, H2N_BUFFER_PACKET, 0); - switch (status) { - case NSS_CORE_STATUS_SUCCESS: - break; - - case NSS_CORE_STATUS_FAILURE_QUEUE: /* queue full condition */ - nss_warning("%px: H2N queue full for tx_buf", nss_ctx); - return NSS_TX_FAILURE_QUEUE; - - default: - nss_warning("%px: general failure for tx_buf", nss_ctx); - return NSS_TX_FAILURE; - } - - /* - * Kick the NSS awake so it can process our new entry. - */ - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - - return NSS_TX_SUCCESS; -} -EXPORT_SYMBOL(nss_tls_tx_buf); - -/* - * nss_tls_tx_msg() - * Transmit a TLS message to NSS firmware - */ -nss_tx_status_t nss_tls_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_tls_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - if (ncm->type >= NSS_TLS_MSG_MAX) { - nss_warning("%px: tls message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - if (!nss_tls_verify_ifnum(nss_ctx, ncm->interface)) { - nss_warning("%px: tls message interface is bad: %u", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_tls_log_tx_msg(msg); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_tls_tx_msg); - -/* - * nss_tls_tx_msg_sync() - * Transmit a TLS message to NSS firmware synchronously. - */ -nss_tx_status_t nss_tls_tx_msg_sync(struct nss_ctx_instance *nss_ctx, uint32_t if_num, - enum nss_tls_msg_type type, uint16_t len, - struct nss_tls_msg *ntcm) -{ - struct nss_tls_msg *local_ntcm = &tls_pvt.ntcm; - nss_tx_status_t status; - int ret = 0; - - /* - * Length of the message should be the based on type - */ - if (len > sizeof(struct nss_tls_msg)) { - nss_warning("%px: Invalid message length(%u), type (%d), I/F(%u)\n", nss_ctx, len, type, if_num); - return NSS_TX_FAILURE; - } - - down(&tls_pvt.sem); - - /* - * We need to copy the message content into the actual message - * to be sent to NSS - */ - memset(local_ntcm, 0, sizeof(*local_ntcm)); - - nss_tls_msg_init(local_ntcm, if_num, type, len, nss_tls_sync_resp, local_ntcm); - memcpy(&local_ntcm->msg, &ntcm->msg, len); - - status = nss_tls_tx_msg(nss_ctx, local_ntcm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Failed to send message\n", nss_ctx); - goto done; - } - - ret = wait_for_completion_timeout(&tls_pvt.complete, msecs_to_jiffies(NSS_TLS_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: Failed to receive response, timeout(%d)\n", nss_ctx, ret); - status = NSS_TX_FAILURE_NOT_READY; - goto done; - } - - /* - * Read memory barrier - */ - smp_rmb(); - - if (local_ntcm->cm.response != NSS_CMN_RESPONSE_ACK) { - status = NSS_TX_FAILURE; - ntcm->cm.response = local_ntcm->cm.response; - ntcm->cm.error = local_ntcm->cm.error; - goto done; - } - - /* - * Copy the message received - */ - memcpy(&ntcm->msg, &local_ntcm->msg, len); - -done: - up(&tls_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_tls_tx_msg_sync); - -/* - * nss_tls_notify_register() - * Register a handler for notification from NSS firmware. - */ -struct nss_ctx_instance *nss_tls_notify_register(uint32_t if_num, nss_tls_msg_callback_t ev_cb, void *app_data) -{ - struct nss_ctx_instance *nss_ctx = nss_tls_get_context(); - uint32_t ret; - - BUG_ON(!nss_ctx); - - ret = nss_core_register_handler(nss_ctx, if_num, nss_tls_handler, app_data); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return NULL; - } - - ret = nss_core_register_msg_handler(nss_ctx, if_num, ev_cb); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return NULL; - } - - return nss_ctx; -} -EXPORT_SYMBOL(nss_tls_notify_register); - -/* - * nss_tls_notify_unregister() - * Unregister notification callback handler. - */ -void nss_tls_notify_unregister(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_tls_get_context(); - uint32_t ret; - - BUG_ON(!nss_ctx); - - ret = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to un register event handler for interface(%u)", nss_ctx, if_num); - return; - } - - ret = nss_core_unregister_handler(nss_ctx, if_num); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to un register event handler for interface(%u)", nss_ctx, if_num); - return; - } - - return; -} -EXPORT_SYMBOL(nss_tls_notify_unregister); - -/* - * nss_tls_register_if() - * Register data and event callback handlers for dynamic interface. - */ -struct nss_ctx_instance *nss_tls_register_if(uint32_t if_num, - nss_tls_data_callback_t data_cb, - nss_tls_msg_callback_t ev_cb, - struct net_device *netdev, - uint32_t features, - uint32_t type, - void *app_data) -{ - struct nss_ctx_instance *nss_ctx = nss_tls_get_context(); - uint32_t ret; - - if (!nss_tls_verify_ifnum(nss_ctx, if_num)) { - nss_warning("%px: TLS Interface is not dynamic:%u", nss_ctx, if_num); - return NULL; - } - - if (nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Cannot find free slot for TLS NSS I/F:%u", nss_ctx, if_num); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, data_cb, NULL, app_data, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); - - ret = nss_core_register_handler(nss_ctx, if_num, nss_tls_handler, app_data); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return NULL; - } - - ret = nss_core_register_msg_handler(nss_ctx, if_num, ev_cb); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return NULL; - } - - /* - * Atomically set the bitmap for the interface number - */ - set_bit(if_num, tls_pvt.if_map); - return nss_ctx; -} -EXPORT_SYMBOL(nss_tls_register_if); - -/* - * nss_tls_unregister_if() - * Unregister data and event callback handlers for the interface. - */ -void nss_tls_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_tls_get_context(); - uint32_t ret; - - if (!nss_ctx->subsys_dp_register[if_num].ndev) { - nss_warning("%px: Cannot find registered netdev for TLS NSS I/F:%u", nss_ctx, if_num); - return; - } - - /* - * Atomically clear the bitmap for the interface number - */ - clear_bit(if_num, tls_pvt.if_map); - - ret = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to un register event handler for interface(%u)", nss_ctx, if_num); - return; - } - - nss_core_unregister_handler(nss_ctx, if_num); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_tls_unregister_if); - -/* - * nss_tls_get_context() - * Return TLS NSS context. - */ -struct nss_ctx_instance *nss_tls_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.tls_handler_id]; -} -EXPORT_SYMBOL(nss_tls_get_context); - -/* - * nss_tls_get_device() - * Gets the original device from probe. - */ -struct device *nss_tls_get_dev(struct nss_ctx_instance *nss_ctx) -{ - return nss_ctx->dev; -} -EXPORT_SYMBOL(nss_tls_get_dev); - -/* - * nss_tls_msg_init() - * Initialize nss_tls msg to be sent asynchronously. - */ -void nss_tls_msg_init(struct nss_tls_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_tls_msg_init); - -/* - * nss_tls_msg_sync_init() - * Initialize nss_tls_msg to be sent synchronously. - */ -void nss_tls_msg_sync_init(struct nss_tls_msg *ncm, uint32_t if_num, uint32_t type, uint32_t len) -{ - nss_cmn_msg_sync_init(&ncm->cm, if_num, type, len); -} -EXPORT_SYMBOL(nss_tls_msg_sync_init); - -/* - * nss_tls_register_handler() - * TLS initialization. - */ -void nss_tls_register_handler(void) -{ - sema_init(&tls_pvt.sem, 1); - init_completion(&tls_pvt.complete); - nss_tls_stats_dentry_create(); - nss_tls_strings_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_tls_log.c deleted file mode 100644 index 11afe45ed..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tls_log.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE - ************************************************************************** - */ - -/* - * nss_tls_log.c - * NSS TLS logger file. - */ - -#include "nss_core.h" - -/* - * nss_tls_log_message_types_str - * TLS message strings - */ -static int8_t *nss_tls_log_message_types_str[NSS_TLS_MSG_MAX] __maybe_unused = { - "TLS Node Configure", - "TLS Context Configure", - "TLS Context Deconfigure", - "TLS Cipher Update", - "TLS Context Sync", - "TLS Node Sync", -}; - -/* - * nss_tls_log_error_response_types_str - * Strings for error types for TLS messages - */ -static int8_t *nss_tls_log_error_response_types_str[NSS_TLS_ERROR_MAX] __maybe_unused = { - "TLS no_error", - "TLS unknown message", - "TLS fail node already config", - "TLS fail inner ctx", - "TLS fail outer ctx", - "TLS fail req pool", - "TLS invalid block len", - "TLS invalid hash len", - "TLS invalid version", - "TLS invalid context words", - "TLS fail alloc hwctx", - "TLS fail copy ctx", - "TLS Invalid algorithm", - "TLS fail nomem" -}; - -/* - * nss_tls_node_config_msg() - * Log TLS node configure message. - */ -static void nss_tls_node_config_msg(struct nss_tls_msg *ntm) -{ - nss_trace("%px: NSS TLS Node Configure Message:\n" - "TLS Interface: %d\n", ntm, ntm->cm.interface); -} - -/* - * nss_tls_ctx_config_msg() - * Log TLS session configure message. - */ -static void nss_tls_ctx_config_msg(struct nss_tls_msg *ntm) -{ - struct nss_tls_ctx_config *ntccm __maybe_unused = &ntm->msg.ctx_cfg; - nss_trace("%px: NSS TLS Context Configure Message:\n" - "TLS Except if_num: %d\n", - ntccm, ntccm->except_ifnum); -} - -/* - * nss_tls_cipher_upddate_msg() - * Log TLS Cipher Update message. - */ -static void nss_tls_cipher_update_msg(struct nss_tls_msg *ntm) -{ - struct nss_tls_cipher_update *ntcum __maybe_unused = &ntm->msg.cipher_update; - nss_trace("%px: NSS TLS Cipher Update message\n" - "TLS crypto index: %d\n", - ntcum, ntcum->crypto_idx); -} - -/* - * nss_tls_log_verbose() - * Log message contents. - */ -static void nss_tls_log_verbose(struct nss_tls_msg *ntm) -{ - switch (ntm->cm.type) { - case NSS_TLS_MSG_TYPE_NODE_CONFIG: - nss_tls_node_config_msg(ntm); - break; - - case NSS_TLS_MSG_TYPE_CIPHER_UPDATE: - nss_tls_cipher_update_msg(ntm); - break; - - case NSS_TLS_MSG_TYPE_CTX_CONFIG: - nss_tls_ctx_config_msg(ntm); - break; - - default: - nss_warning("%px: Invalid message type\n", ntm); - break; - } -} - -/* - * nss_tls_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_tls_log_tx_msg(struct nss_tls_msg *ntm) -{ - if (ntm->cm.type >= NSS_TLS_MSG_MAX) { - nss_warning("%px: Invalid message type\n", ntm); - return; - } - - nss_info("%px: type[%d]:%s\n", ntm, ntm->cm.type, nss_tls_log_message_types_str[ntm->cm.type]); - nss_tls_log_verbose(ntm); -} - -/* - * nss_tls_log_rx_msg() - * Log messages received from FW. - */ -void nss_tls_log_rx_msg(struct nss_tls_msg *ntm) -{ - if (ntm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ntm); - return; - } - - if (ntm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ntm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type, - nss_tls_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response]); - goto verbose; - } - - if (ntm->cm.error >= NSS_TLS_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ntm, ntm->cm.type, nss_tls_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response], - ntm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ntm, ntm->cm.type, nss_tls_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response], - ntm->cm.error, nss_tls_log_error_response_types_str[ntm->cm.error]); - -verbose: - nss_tls_log_verbose(ntm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_tls_log.h deleted file mode 100644 index 37846c2b6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tls_log.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE - ************************************************************************** - */ - -#ifndef __NSS_TLS_LOG_H -#define __NSS_TLS_LOG_H - -/* - * nss_tls_log.h - * NSS TLS Log Header File - */ - -/* - * nss_tls_log_tx_msg - * Logs a TLS message that is sent to the NSS firmware. - */ -void nss_tls_log_tx_msg(struct nss_tls_msg *ndm); - -/* - * nss_tls_log_rx_msg - * Logs a TLS message that is received from the NSS firmware. - */ -void nss_tls_log_rx_msg(struct nss_tls_msg *ndm); - -#endif /* __NSS_TLS_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.c deleted file mode 100644 index 58082708e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ****************************************************************************** - */ - -#include "nss_core.h" -#include "nss_tls.h" -#include "nss_tls_stats.h" -#include "nss_tls_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_tls_stats_notifier); - -/* - * Spinlock to protect tls statistics update/read - */ -DEFINE_SPINLOCK(nss_tls_stats_lock); - -uint64_t nss_tls_stats[NSS_MAX_NET_INTERFACES][NSS_TLS_STATS_MAX]; - -/* - * nss_tls_stats_iface_type() - * Return a string for each interface type. - */ -static const char *nss_tls_stats_iface_type(enum nss_dynamic_interface_type type) -{ - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER: - return "tls_inner"; - - case NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER: - return "tls_outer"; - - default: - return "invalid_interface"; - } -} - -/* - * nss_tls_stats_read() - * Read tls node statiistics. - */ -static ssize_t nss_tls_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats + - * few blank lines for banner printing + Number of Extra outputlines - * for future reference to add new stats - */ - uint32_t max_output_lines = NSS_TLS_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - struct nss_ctx_instance *nss_ctx = nss_tls_get_context(); - enum nss_dynamic_interface_type type; - unsigned long *ifmap; - uint64_t *stats_shadow; - ssize_t bytes_read = 0; - size_t size_wr = 0; - uint32_t if_num; - int32_t i; - int count; - char *lbuf; - - ifmap = nss_tls_ifmap_get(); - count = bitmap_weight(ifmap, NSS_MAX_NET_INTERFACES); - if (count) { - size_al = size_al * count; - } - - lbuf = vzalloc(size_al); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = vzalloc(NSS_TLS_STATS_MAX * 8); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - vfree(lbuf); - return -ENOMEM; - } - - /* - * Common node stats for each TLS dynamic interface. - */ - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "tls stats", NSS_STATS_SINGLE_CORE); - for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) { - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - if ((type != NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER) && - (type != NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER)) { - continue; - } - - spin_lock_bh(&nss_tls_stats_lock); - for (i = 0; i < NSS_TLS_STATS_MAX; i++) { - stats_shadow[i] = nss_tls_stats[if_num][i]; - } - spin_unlock_bh(&nss_tls_stats_lock); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", - nss_tls_stats_iface_type(type), if_num); - size_wr += nss_stats_print("tls", NULL, NSS_STATS_SINGLE_INSTANCE, nss_tls_strings_stats, - stats_shadow, NSS_TLS_STATS_MAX, lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - vfree(lbuf); - vfree(stats_shadow); - return bytes_read; -} - -/* - * nss_tls_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(tls); - -/* - * nss_tls_stats_dentry_create() - * Create tls statistics debug entry. - */ -void nss_tls_stats_dentry_create(void) -{ - nss_stats_create_dentry("tls", &nss_tls_stats_ops); -} - -/* - * nss_tls_stats_sync() - * Update tls node statistics. - */ -void nss_tls_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm) -{ - struct nss_tls_msg *ndcm = (struct nss_tls_msg *)ncm; - struct nss_tls_ctx_stats *ndccs = &ndcm->msg.stats; - uint64_t *ctx_stats; - uint32_t *msg_stats; - int i; - - spin_lock_bh(&nss_tls_stats_lock); - - /* - * Update common node stats, - * Note: TLS only supports a single queue for RX - */ - msg_stats = (uint32_t *)ndccs; - ctx_stats = nss_tls_stats[ncm->interface]; - - for (i = 0; i < NSS_TLS_STATS_MAX; i++, ctx_stats++, msg_stats++) { - *ctx_stats += *msg_stats; - } - - spin_unlock_bh(&nss_tls_stats_lock); -} - -/* - * nss_tls_stats_notify() - * Sends notifications to all the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_tls_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_tls_stats_notification tls_stats; - - spin_lock_bh(&nss_tls_stats_lock); - tls_stats.core_id = nss_ctx->id; - tls_stats.if_num = if_num; - memcpy(tls_stats.stats_ctx, nss_tls_stats[if_num], sizeof(tls_stats.stats_ctx)); - spin_unlock_bh(&nss_tls_stats_lock); - - atomic_notifier_call_chain(&nss_tls_stats_notifier, NSS_STATS_EVENT_NOTIFY, &tls_stats); -} - -/* - * nss_tls_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_tls_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_tls_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_tls_stats_unregister_notifier); - -/* - * nss_tls_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_tls_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_tls_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_tls_stats_register_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.h deleted file mode 100644 index 3883f6297..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tls_stats.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ****************************************************************************** - */ - -#ifndef __NSS_TLS_STATS_H -#define __NSS_TLS_STATS_H - -#include - -extern void nss_tls_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_tls_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); -extern void nss_tls_stats_dentry_create(void); - -#endif /* __NSS_TLS_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.c deleted file mode 100644 index 8c4854865..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ****************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_strings.h" -#include "nss_tls_strings.h" - -/* - * nss_tls_strings_stats - * tls statistics strings. - */ -struct nss_stats_info nss_tls_strings_stats[NSS_TLS_STATS_MAX] = { - {"rx_pkts", NSS_STATS_TYPE_COMMON}, - {"rx_byts", NSS_STATS_TYPE_COMMON}, - {"tx_pkts", NSS_STATS_TYPE_COMMON}, - {"tx_byts", NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops", NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops", NSS_STATS_TYPE_DROP}, - {"single_rec", NSS_STATS_TYPE_SPECIAL}, - {"multi_rec", NSS_STATS_TYPE_SPECIAL}, - {"tx_inval_reqs", NSS_STATS_TYPE_SPECIAL}, - {"rx_ccs_rec", NSS_STATS_TYPE_SPECIAL}, - {"fail_ccs", NSS_STATS_TYPE_ERROR}, - {"eth_node_deactive", NSS_STATS_TYPE_SPECIAL}, - {"crypto_alloc_success", NSS_STATS_TYPE_SPECIAL}, - {"crypto_free_req", NSS_STATS_TYPE_SPECIAL}, - {"crypto_free_success", NSS_STATS_TYPE_SPECIAL}, - {"fail_crypto_alloc", NSS_STATS_TYPE_EXCEPTION}, - {"fail_crypto_lookup", NSS_STATS_TYPE_EXCEPTION}, - {"fail_req_alloc", NSS_STATS_TYPE_ERROR}, - {"fail_pbuf_stats", NSS_STATS_TYPE_ERROR}, - {"fail_ctx_active", NSS_STATS_TYPE_ERROR}, - {"hw_len_error", NSS_STATS_TYPE_ERROR}, - {"hw_token_error", NSS_STATS_TYPE_ERROR}, - {"hw_bypass_error", NSS_STATS_TYPE_ERROR}, - {"hw_crypto_error", NSS_STATS_TYPE_ERROR}, - {"hw_hash_error", NSS_STATS_TYPE_ERROR}, - {"hw_config_error", NSS_STATS_TYPE_ERROR}, - {"hw_algo_error", NSS_STATS_TYPE_ERROR}, - {"hw_hash_ovf_error", NSS_STATS_TYPE_ERROR}, - {"hw_auth_error", NSS_STATS_TYPE_ERROR}, - {"hw_pad_verify_error", NSS_STATS_TYPE_ERROR}, - {"hw_timeout_error", NSS_STATS_TYPE_ERROR}, - {"no_desc_in", NSS_STATS_TYPE_EXCEPTION}, - {"no_desc_out", NSS_STATS_TYPE_EXCEPTION}, - {"no_reqs", NSS_STATS_TYPE_EXCEPTION} -}; - -/* - * nss_tls_strings_read() - * Read tls statistics names - */ -static ssize_t nss_tls_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_tls_strings_stats, NSS_TLS_STATS_MAX); -} - -/* - * nss_tls_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(tls); - -/* - * nss_tls_strings_dentry_create() - * Create tls statistics strings debug entry. - */ -void nss_tls_strings_dentry_create(void) -{ - nss_strings_create_dentry("tls", &nss_tls_strings_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.h deleted file mode 100644 index 1509722b0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tls_strings.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ****************************************************************************** - */ - -#ifndef __NSS_TLS_STRINGS_H -#define __NSS_TLS_STRINGS_H - -#include "nss_tls_stats.h" - -extern struct nss_stats_info nss_tls_strings_stats[NSS_TLS_STATS_MAX]; -extern void nss_tls_strings_dentry_create(void); - -#endif /* __NSS_TLS_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx.c b/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx.c deleted file mode 100644 index 2ba6ee64d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx.c +++ /dev/null @@ -1,299 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2018, 2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_trustsec_tx_stats.h" -#include "nss_trustsec_tx_log.h" - -#define NSS_TRUSTSEC_TX_TIMEOUT 3000 /* 3 Seconds */ - -/* - * Private data structure for trustsec_tx interface - */ -static struct nss_trustsec_tx_pvt { - struct semaphore sem; - struct completion complete; - int response; -} ttx; - -/* - * nss_trustsec_tx_handler() - * Handle NSS -> HLOS messages for trustsec_tx - */ -static void nss_trustsec_tx_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data) -{ - nss_trustsec_tx_msg_callback_t cb; - struct nss_trustsec_tx_msg *npm = (struct nss_trustsec_tx_msg *)ncm; - - BUG_ON(ncm->interface != NSS_TRUSTSEC_TX_INTERFACE); - - /* - * Trace messages. - */ - nss_trustsec_tx_log_rx_msg(npm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_TRUSTSEC_TX_MSG_MAX) { - nss_warning("%px: received invalid message %d for trustsec_tx interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_trustsec_tx_msg)) { - nss_warning("%px: message size incorrect: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ncm->type) { - case NSS_TRUSTSEC_TX_MSG_STATS_SYNC: - /* - * Update trustsec_tx statistics. - */ - nss_trustsec_tx_stats_sync(nss_ctx, &npm->msg.stats_sync); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, trustsec_tx sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].ndev; - } - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_trustsec_tx_msg_callback_t)ncm->cb; - - cb((void *)ncm->app_data, npm); -} - -/* - * nss_trustsec_tx_msg() - * Transmit a trustsec_tx message to NSSFW - */ -nss_tx_status_t nss_trustsec_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_trustsec_tx_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace messages. - */ - nss_trustsec_tx_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_TRUSTSEC_TX_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_TRUSTSEC_TX_MSG_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_trustsec_tx_msg); - -/* - * nss_trustsec_tx_callback - * Callback to handle the completion of NSS ->HLOS messages. - */ -static void nss_trustsec_tx_callback(void *app_data, struct nss_trustsec_tx_msg *npm) -{ - if (npm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("trustsec_tx error response %d\n", npm->cm.response); - ttx.response = NSS_TX_FAILURE; - complete(&ttx.complete); - return; - } - - ttx.response = NSS_TX_SUCCESS; - complete(&ttx.complete); -} - -/* - * nss_trustsec_tx_msg_sync() - * Send a message to trustsec_tx interface & wait for the response. - */ -nss_tx_status_t nss_trustsec_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_trustsec_tx_msg *msg) -{ - nss_tx_status_t status; - int ret = 0; - - down(&ttx.sem); - - msg->cm.cb = (nss_ptr_t)nss_trustsec_tx_callback; - msg->cm.app_data = (nss_ptr_t)NULL; - - status = nss_trustsec_tx_msg(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_trustsec_tx_msg failed\n", nss_ctx); - up(&ttx.sem); - return status; - } - - ret = wait_for_completion_timeout(&ttx.complete, msecs_to_jiffies(NSS_TRUSTSEC_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: trustsec_tx tx failed due to timeout\n", nss_ctx); - ttx.response = NSS_TX_FAILURE; - } - - status = ttx.response; - up(&ttx.sem); - - return status; -} -EXPORT_SYMBOL(nss_trustsec_tx_msg_sync); - -/* - * nss_trustsec_tx_get_ctx() - * Return a TrustSec TX NSS context. - */ -struct nss_ctx_instance *nss_trustsec_tx_get_ctx() -{ - return &nss_top_main.nss[nss_top_main.trustsec_tx_handler_id]; -} -EXPORT_SYMBOL(nss_trustsec_tx_get_ctx); - -/* - * nss_trustsec_tx_msg_init() - * Initialize trustsec_tx message. - */ -void nss_trustsec_tx_msg_init(struct nss_trustsec_tx_msg *npm, uint16_t if_num, uint32_t type, uint32_t len, - nss_trustsec_tx_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&npm->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_trustsec_tx_msg_init); - -/* - * nss_trustsec_tx_update_nexthop() - */ -nss_tx_status_t nss_trustsec_tx_update_nexthop(uint32_t src, uint32_t dest, uint16_t sgt) -{ - struct nss_ctx_instance *ctx = nss_trustsec_tx_get_ctx(); - struct nss_trustsec_tx_msg ttx_msg = {{0}}; - struct nss_trustsec_tx_update_nexthop_msg *ttxunh; - nss_tx_status_t status; - - ttxunh = &ttx_msg.msg.upd_nexthop; - ttxunh->src = src; - ttxunh->dest = dest; - ttxunh->sgt = sgt; - - nss_trustsec_tx_msg_init(&ttx_msg, NSS_TRUSTSEC_TX_INTERFACE, NSS_TRUSTSEC_TX_MSG_UPDATE_NEXTHOP, - sizeof(*ttxunh), NULL, NULL); - - BUG_ON(in_atomic()); - status = nss_trustsec_tx_msg_sync(ctx, &ttx_msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: configure trustsec_tx failed: %d\n", ctx, status); - } - - return status; -} -EXPORT_SYMBOL(nss_trustsec_tx_update_nexthop); - -/* - * nss_trustsec_tx_configure_sgt() - */ -nss_tx_status_t nss_trustsec_tx_configure_sgt(uint32_t src, uint32_t dest, uint16_t sgt) -{ - struct nss_ctx_instance *ctx = nss_trustsec_tx_get_ctx(); - struct nss_trustsec_tx_msg ttx_msg = {{0}}; - struct nss_trustsec_tx_configure_msg *ttxcfg; - nss_tx_status_t status; - - ttxcfg = &ttx_msg.msg.configure; - ttxcfg->src = src; - ttxcfg->dest = dest; - ttxcfg->sgt = sgt; - - nss_trustsec_tx_msg_init(&ttx_msg, NSS_TRUSTSEC_TX_INTERFACE, NSS_TRUSTSEC_TX_MSG_CONFIGURE, - sizeof(*ttxcfg), NULL, NULL); - - BUG_ON(in_atomic()); - status = nss_trustsec_tx_msg_sync(ctx, &ttx_msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: configure trustsec_tx failed: %d\n", ctx, status); - } - - return status; -} -EXPORT_SYMBOL(nss_trustsec_tx_configure_sgt); - -/* - * nss_trustsec_tx_unconfigure() - */ -nss_tx_status_t nss_trustsec_tx_unconfigure_sgt(uint32_t src, uint16_t sgt) -{ - struct nss_ctx_instance *ctx = nss_trustsec_tx_get_ctx(); - struct nss_trustsec_tx_msg ttx_msg = {{0}}; - struct nss_trustsec_tx_unconfigure_msg *ttxucfg; - nss_tx_status_t status; - - ttxucfg = &ttx_msg.msg.unconfigure; - ttxucfg->src = src; - ttxucfg->sgt = sgt; - - nss_trustsec_tx_msg_init(&ttx_msg, NSS_TRUSTSEC_TX_INTERFACE, NSS_TRUSTSEC_TX_MSG_UNCONFIGURE, - sizeof(*ttxucfg), NULL, NULL); - - BUG_ON(in_atomic()); - status = nss_trustsec_tx_msg_sync(ctx, &ttx_msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: unconfigure trustsec_tx failed: %d\n", ctx, status); - } - - return status; -} -EXPORT_SYMBOL(nss_trustsec_tx_unconfigure_sgt); - -/* - * nss_trustsec_tx_register_handler() - * Registering handler for sending msg to trustsec_tx node on NSS. - */ -void nss_trustsec_tx_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_trustsec_tx_get_ctx(); - - nss_core_register_handler(nss_ctx, NSS_TRUSTSEC_TX_INTERFACE, nss_trustsec_tx_handler, NULL); - - nss_trustsec_tx_stats_dentry_create(); - - sema_init(&ttx.sem, 1); - init_completion(&ttx.complete); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_log.c deleted file mode 100644 index 3ed5b5149..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_log.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_trustsec_tx_log.c - * NSS TRUSTSEC_TX logger file. - */ - -#include "nss_core.h" - -/* - * nss_trustsec_tx_log_message_types_str - * TRUSTSEC_TX message strings - */ -static int8_t *nss_trustsec_tx_log_message_types_str[NSS_TRUSTSEC_TX_MSG_MAX] __maybe_unused = { - "TRUSTSEC_TX Configure Message", - "TRUSTSEC_TX Unconfigure Message", - "TRUSTSEC_TX Stats Sync", - "TRUSTSEC_TX Update next Hop", -}; - -/* - * nss_trustsec_tx_log_error_response_types_str - * Strings for error types for TRUSTSEC_TX messages - */ -static int8_t *nss_trustsec_tx_log_error_response_types_str[NSS_TRUSTSEC_TX_ERR_UNKNOWN] __maybe_unused = { - "TRUSTSEC_TX Invalid Source Interface", - "TRUSTSEC_TX Reconfigure Source Interface" - "TRUSTSEC_TX Destination Interface Not Found", - "TRUSTSEC_TX Not Configured", - "TRUSTSEC_TX SGT Mismatch", - "TRUSTSEC_TX Unknown Error", -}; - -/* - * nss_trustsec_tx_log_configure_msg() - * Log NSS TRUSTSEC_TX configure message. - */ -static void nss_trustsec_tx_log_configure_msg(struct nss_trustsec_tx_msg *ntm) -{ - struct nss_trustsec_tx_configure_msg *ntcm __maybe_unused = &ntm->msg.configure; - nss_trace("%px: NSS TRUSTSEC_TX Configure Message:\n" - "TRUSTSEC_TX Source: %d\n" - "TRUSTSEC_TX Destination: %d\n" - "TRUSTSEC_TX Security Group Tag: %d\n", - ntcm, ntcm->src, - ntcm->dest, ntcm->sgt); -} - -/* - * nss_trustsec_tx_log_unconfigure_msg() - * Log NSS TRUSTSEC_TX unconfigure message. - */ -static void nss_trustsec_tx_log_unconfigure_msg(struct nss_trustsec_tx_msg *ntm) -{ - struct nss_trustsec_tx_unconfigure_msg *ntcm __maybe_unused = &ntm->msg.unconfigure; - nss_trace("%px: NSS TRUSTSEC_TX Unconfigure Message:\n" - "TRUSTSEC_TX Source: %d\n" - "TRUSTSEC_TX Security Group Tag: %d\n", - ntcm, ntcm->src, ntcm->sgt); -} - -/* - * nss_trustsec_tx_log_update_nexthop_msg() - * Log NSS TRUSTSEC_TX update nexthop message. - */ -static void nss_trustsec_tx_log_update_nexthop_msg(struct nss_trustsec_tx_msg *ntm) -{ - struct nss_trustsec_tx_update_nexthop_msg *ntunm __maybe_unused = &ntm->msg.upd_nexthop; - nss_trace("%px: NSS TRUSTSEC_TX Update Next Hop Message:\n" - "TRUSTSEC_TX Source: %d\n" - "TRUSTSEC_TX Destination: %d\n" - "TRUSTSEC_TX Security Group Tag: %d\n", - ntunm, ntunm->src, - ntunm->dest, ntunm->sgt); -} - -/* - * nss_trustsec_tx_log_verbose() - * Log message contents. - */ -static void nss_trustsec_tx_log_verbose(struct nss_trustsec_tx_msg *ntm) -{ - switch (ntm->cm.type) { - case NSS_TRUSTSEC_TX_MSG_CONFIGURE: - nss_trustsec_tx_log_configure_msg(ntm); - break; - - case NSS_TRUSTSEC_TX_MSG_UNCONFIGURE: - nss_trustsec_tx_log_unconfigure_msg(ntm); - break; - - case NSS_TRUSTSEC_TX_MSG_UPDATE_NEXTHOP: - nss_trustsec_tx_log_update_nexthop_msg(ntm); - break; - - case NSS_TRUSTSEC_TX_MSG_STATS_SYNC: - /* - * No log for valid stats message. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", ntm); - break; - } -} - -/* - * nss_trustsec_tx_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_trustsec_tx_log_tx_msg(struct nss_trustsec_tx_msg *ntm) -{ - if (ntm->cm.type >= NSS_TRUSTSEC_TX_MSG_MAX) { - nss_warning("%px: Invalid message type\n", ntm); - return; - } - - nss_info("%px: type[%d]:%s\n", ntm, ntm->cm.type, nss_trustsec_tx_log_message_types_str[ntm->cm.type]); - nss_trustsec_tx_log_verbose(ntm); -} - -/* - * nss_trustsec_tx_log_rx_msg() - * Log messages received from FW. - */ -void nss_trustsec_tx_log_rx_msg(struct nss_trustsec_tx_msg *ntm) -{ - if (ntm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ntm); - return; - } - - if (ntm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ntm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type, - nss_trustsec_tx_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response]); - goto verbose; - } - - if (ntm->cm.error >= NSS_TRUSTSEC_TX_ERR_UNKNOWN) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ntm, ntm->cm.type, nss_trustsec_tx_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response], - ntm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ntm, ntm->cm.type, nss_trustsec_tx_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response], - ntm->cm.error, nss_trustsec_tx_log_error_response_types_str[ntm->cm.error]); - -verbose: - nss_trustsec_tx_log_verbose(ntm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_log.h deleted file mode 100644 index 58633c942..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_TRUSTSEC_TX_LOG_H__ -#define __NSS_TRUSTSEC_TX_LOG_H__ - -/* - * nss_trustsec_tx_log.h - * NSS TRUSTSEC_TX Log Header File - */ - -/* - * nss_trustsec_tx_log_tx_msg - * Logs a trustsec_tx message that is sent to the NSS firmware. - */ -void nss_trustsec_tx_log_tx_msg(struct nss_trustsec_tx_msg *ncm); - -/* - * nss_trustsec_tx_log_rx_msg - * Logs a trustsec_tx message that is received from the NSS firmware. - */ -void nss_trustsec_tx_log_rx_msg(struct nss_trustsec_tx_msg *ncm); - -#endif /* __NSS_TRUSTSEC_TX_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_stats.c deleted file mode 100644 index 5302321ae..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_stats.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_trustsec_tx_stats.h" - -/* - * nss_trustsec_tx_stats_str - * Trustsec TX statistics strings. - */ - -struct nss_stats_info nss_trustsec_tx_stats_str[NSS_TRUSTSEC_TX_STATS_MAX] = { - {"INVALID_SRC" , NSS_STATS_TYPE_ERROR}, - {"UNCONFIGURED_SRC" , NSS_STATS_TYPE_ERROR}, - {"HEADROOM_NOT_ENOUGH" , NSS_STATS_TYPE_ERROR} -}; - -/* - * trustsec_tx_stats - * Trustsec TX statistics. - */ -uint64_t trustsec_tx_stats[NSS_TRUSTSEC_TX_STATS_MAX]; - -/* - * Trustsec TX statistics APIs - */ - -/* - * nss_trustsec_tx_stats_sync() - * Update trustsec_tx node statistics. - */ -void nss_trustsec_tx_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_trustsec_tx_stats_sync_msg *ntsm) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - int j; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Update common node stats - */ - nss_top->stats_node[NSS_TRUSTSEC_TX_INTERFACE][NSS_STATS_NODE_RX_PKTS] += ntsm->node_stats.rx_packets; - nss_top->stats_node[NSS_TRUSTSEC_TX_INTERFACE][NSS_STATS_NODE_RX_BYTES] += ntsm->node_stats.rx_bytes; - nss_top->stats_node[NSS_TRUSTSEC_TX_INTERFACE][NSS_STATS_NODE_TX_PKTS] += ntsm->node_stats.tx_packets; - nss_top->stats_node[NSS_TRUSTSEC_TX_INTERFACE][NSS_STATS_NODE_TX_BYTES] += ntsm->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_top->stats_node[NSS_TRUSTSEC_TX_INTERFACE][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += ntsm->node_stats.rx_dropped[j]; - } - - /* - * Update trustsec node stats - */ - trustsec_tx_stats[NSS_TRUSTSEC_TX_STATS_INVALID_SRC] += ntsm->invalid_src; - trustsec_tx_stats[NSS_TRUSTSEC_TX_STATS_UNCONFIGURED_SRC] += ntsm->unconfigured_src; - trustsec_tx_stats[NSS_TRUSTSEC_TX_STATS_HEADROOM_NOT_ENOUGH] += ntsm->headroom_not_enough; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_trustsec_tx_stats_read() - * Read trustsec_tx statiistics. - */ -static ssize_t nss_trustsec_tx_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i; - - /* - * Max output lines = #stats + few blank lines for banner printing + - * Number of Extra outputlines for future reference to add new stats. - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_TRUSTSEC_TX_STATS_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_STATS_NODE_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "trustsec_tx", NSS_STATS_SINGLE_CORE); - - /* - * Common node stats - */ - size_wr += nss_stats_fill_common_stats(NSS_TRUSTSEC_TX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "trustsec_tx"); - - /* - * TrustSec TX node stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_TRUSTSEC_TX_STATS_MAX); i++) { - stats_shadow[i] = trustsec_tx_stats[i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("trustsec_tx", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_trustsec_tx_stats_str - , stats_shadow - , NSS_TRUSTSEC_TX_STATS_MAX - , lbuf, size_wr, size_al); - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_trustsec_tx_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(trustsec_tx) - -/* - * nss_trustsec_tx_stats_dentry_create() - * Create trustsec_tx statistics debug entry. - */ -void nss_trustsec_tx_stats_dentry_create(void) -{ - nss_stats_create_dentry("trustsec_tx", &nss_trustsec_tx_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_stats.h deleted file mode 100644 index 11a4d8f56..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_trustsec_tx_stats.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_trustsec_tx_stats.h - * NSS TRUSTSEC TX statistics header file. - */ - -#ifndef __NSS_TRUSTSEC_TX_STATS_H -#define __NSS_TRUSTSEC_TX_STATS_H - -/* - * Trustsec TX statistics - */ -enum nss_trustsec_tx_stats { - NSS_TRUSTSEC_TX_STATS_INVALID_SRC, - /* Number of packets with invalid src if */ - NSS_TRUSTSEC_TX_STATS_UNCONFIGURED_SRC, - /* Number of packets with unconfigured src if */ - NSS_TRUSTSEC_TX_STATS_HEADROOM_NOT_ENOUGH, - /* Number of packets with not enough headroom */ - NSS_TRUSTSEC_TX_STATS_MAX -}; - -/* - * Trustsec TX statistics APIs - */ -extern void nss_trustsec_tx_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_trustsec_tx_stats_sync_msg *ntsm); -extern void nss_trustsec_tx_stats_dentry_create(void); - -#endif /* __NSS_TRUSTSEC_TX_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tstamp.c b/feeds/ipq807x/qca-nss-drv/src/nss_tstamp.c deleted file mode 100644 index 1984afb07..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tstamp.c +++ /dev/null @@ -1,423 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_tstamp.c - * NSS Tstamp APIs - */ - -#include -#include -#include -#include -#include -#include -#include "nss_tx_rx_common.h" -#include "nss_tstamp.h" -#include "nss_tstamp_stats.h" - -#define NSS_TSTAMP_HEADER_SIZE max(sizeof(struct nss_tstamp_h2n_pre_hdr), sizeof(struct nss_tstamp_n2h_pre_hdr)) - -/* - * Notify data structure - */ -struct nss_tstamp_notify_data { - nss_tstamp_msg_callback_t tstamp_callback; - void *app_data; -}; - -static struct nss_tstamp_notify_data nss_tstamp_notify = { - .tstamp_callback = NULL, - .app_data = NULL, -}; - -static struct net_device_stats *nss_tstamp_ndev_stats(struct net_device *ndev); - -/* - * dummy netdevice ops - */ -static const struct net_device_ops nss_tstamp_ndev_ops = { - .ndo_get_stats = nss_tstamp_ndev_stats, -}; - -/* - * nss_tstamp_ndev_setup() - * Dummy setup for net_device handler - */ -static void nss_tstamp_ndev_setup(struct net_device *ndev) -{ - return; -} - -/* - * nss_tstamp_ndev_stats() - * Return net device stats - */ -static struct net_device_stats *nss_tstamp_ndev_stats(struct net_device *ndev) -{ - return &ndev->stats; -} - -/* - * nss_tstamp_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_tstamp_verify_if_num(uint32_t if_num) -{ - return (if_num == NSS_TSTAMP_TX_INTERFACE) || (if_num == NSS_TSTAMP_RX_INTERFACE); -} - -/* - * nss_tstamp_interface_handler() - * Handle NSS -> HLOS messages for TSTAMP Statistics - */ -static void nss_tstamp_interface_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_tstamp_msg *ntm = (struct nss_tstamp_msg *)ncm; - nss_tstamp_msg_callback_t cb; - - if (!nss_tstamp_verify_if_num(ncm->interface)) { - nss_warning("%px: invalid interface %d for tstamp_tx", nss_ctx, ncm->interface); - return; - } - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_TSTAMP_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for tstamp", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_tstamp_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - switch (ntm->cm.type) { - case NSS_TSTAMP_MSG_TYPE_SYNC_STATS: - nss_tstamp_stats_sync(nss_ctx, &ntm->msg.stats, ncm->interface); - break; - default: - nss_warning("%px: Unknown message type %d", - nss_ctx, ncm->type); - return; - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_tstamp_notify.tstamp_callback; - ncm->app_data = (nss_ptr_t)nss_tstamp_notify.app_data; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_tstamp_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ntm); -} - -/* - * nss_tstamp_copy_data() - * Copy timestamps from received nss frame into skb - */ -static void nss_tstamp_copy_data(struct nss_tstamp_n2h_pre_hdr *ntm, struct sk_buff *skb) -{ - struct skb_shared_hwtstamps *tstamp; - - tstamp = skb_hwtstamps(skb); - tstamp->hwtstamp = ktime_set(ntm->ts_data_hi, ntm->ts_data_lo); -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3, 16, 0)) - tstamp->syststamp = ktime_set(ntm->ts_data_hi, ntm->ts_data_lo); -#endif -} - -/* - * nss_tstamp_get_dev() - * Get the net_device associated with the packet. - */ -static struct net_device *nss_tstamp_get_dev(struct sk_buff *skb) -{ - struct dst_entry *dst; - struct net_device *dev; - struct rtable *rt; - struct flowi6 fl6; - uint32_t ip_addr; - - /* - * It seems like the data came over IPsec, hence indicate - * it to the Linux over this interface - */ - skb_reset_network_header(skb); - skb_reset_mac_header(skb); - - skb->pkt_type = PACKET_HOST; - - switch (ip_hdr(skb)->version) { - case IPVERSION: - ip_addr = ip_hdr(skb)->saddr; - - rt = ip_route_output(&init_net, ip_addr, 0, 0, 0); - if (IS_ERR(rt)) { - return NULL; - } - - dst = (struct dst_entry *)rt; - skb->protocol = cpu_to_be16(ETH_P_IP); - break; - - case 6: - memset(&fl6, 0, sizeof(fl6)); - memcpy(&fl6.daddr, &ipv6_hdr(skb)->saddr, sizeof(fl6.daddr)); - - dst = ip6_route_output(&init_net, NULL, &fl6); - if (IS_ERR(dst)) { - return NULL; - } - - skb->protocol = cpu_to_be16(ETH_P_IPV6); - break; - - default: - nss_warning("%px:could not get dev for the skb\n", skb); - return NULL; - } - - dev = dst->dev; - dev_hold(dev); - - dst_release(dst); - return dev; -} - -/* - * nss_tstamp_buf_receive() - * Receive nss exception packets. - */ -static void nss_tstamp_buf_receive(struct net_device *ndev, struct sk_buff *skb, struct napi_struct *napi) -{ - struct nss_tstamp_n2h_pre_hdr *n2h_hdr = (struct nss_tstamp_n2h_pre_hdr *)skb->data; - struct nss_ctx_instance *nss_ctx; - struct net_device *dev; - uint32_t tstamp_sz; - - BUG_ON(!n2h_hdr); - - tstamp_sz = n2h_hdr->ts_hdr_sz; - if (tstamp_sz > (NSS_TSTAMP_HEADER_SIZE)) { - goto free; - } - - nss_ctx = &nss_top_main.nss[nss_top_main.tstamp_handler_id]; - BUG_ON(!nss_ctx); - - skb_pull_inline(skb, tstamp_sz); - - /* - * copy the time stamp and convert into ktime_t - */ - nss_tstamp_copy_data(n2h_hdr, skb); - if (unlikely(n2h_hdr->ts_tx)) { - /* - * We are in TX Path - */ - skb_tstamp_tx(skb, skb_hwtstamps(skb)); - - ndev->stats.tx_packets++; - ndev->stats.tx_bytes += skb->len; - goto free; - } - - /* - * We are in RX path. - */ - dev = nss_cmn_get_interface_dev(nss_ctx, n2h_hdr->ts_ifnum); - if (!dev) { - ndev->stats.rx_dropped++; - goto free; - } - - /* - * Hold the dev until we finish - */ - dev_hold(dev); - - switch(dev->type) { - case NSS_IPSEC_ARPHRD_IPSEC: - /* - * Release the prev dev reference - */ - dev_put(dev); - - /* - * find the actual IPsec tunnel device - */ - dev = nss_tstamp_get_dev(skb); - break; - - default: - /* - * This is a plain non-encrypted data packet. - */ - skb->protocol = eth_type_trans(skb, dev); - break; - } - - skb->skb_iif = dev->ifindex; - skb->dev = dev; - - ndev->stats.rx_packets++; - ndev->stats.rx_bytes += skb->len; - - netif_receive_skb(skb); - - /* - * release the device as we are done - */ - dev_put(dev); - return; -free: - dev_kfree_skb_any(skb); - return; -} - -/* - * nss_tstamp_tx_buf() - * Send data packet for tstamp processing - */ -nss_tx_status_t nss_tstamp_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *skb, uint32_t if_num) -{ - struct nss_tstamp_h2n_pre_hdr *h2n_hdr; - int extra_head; - int extra_tail = 0; - char *align_data; - uint32_t hdr_sz; - - nss_trace("%px: Tstamp If Tx packet, id:%d, data=%px", nss_ctx, NSS_TSTAMP_RX_INTERFACE, skb->data); - - /* - * header size + alignment size - */ - hdr_sz = NSS_TSTAMP_HEADER_SIZE; - extra_head = hdr_sz - skb_headroom(skb); - - /* - * Expand the head for h2n_hdr - */ - if (extra_head > 0) { - /* - * Try to accommodate using available tailroom. - */ - if (skb->end - skb->tail >= extra_head) - extra_tail = -extra_head; - if (pskb_expand_head(skb, extra_head, extra_tail, GFP_KERNEL)) { - nss_trace("%px: expand head room failed", nss_ctx); - return NSS_TX_FAILURE; - } - } - - align_data = PTR_ALIGN((skb->data - hdr_sz), sizeof(uint32_t)); - hdr_sz = (nss_ptr_t)skb->data - (nss_ptr_t)align_data; - - h2n_hdr = (struct nss_tstamp_h2n_pre_hdr *)skb_push(skb, hdr_sz); - h2n_hdr->ts_ifnum = if_num; - h2n_hdr->ts_tx_hdr_sz = hdr_sz; - - return nss_core_send_packet(nss_ctx, skb, NSS_TSTAMP_RX_INTERFACE, H2N_BIT_FLAG_VIRTUAL_BUFFER | H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_tstamp_tx_buf); - -/* - * nss_tstamp_register_netdev() - * register dummy netdevice for tstamp interface - */ -struct net_device *nss_tstamp_register_netdev(void) -{ - struct net_device *ndev; - uint32_t err = 0; - -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3, 16, 0)) - ndev = alloc_netdev(sizeof(struct netdev_priv_instance), "qca-nss-tstamp", nss_tstamp_ndev_setup); -#else - ndev = alloc_netdev(sizeof(struct netdev_priv_instance), "qca-nss-tstamp", NET_NAME_ENUM, nss_tstamp_ndev_setup); -#endif - if (!ndev) { - nss_warning("Tstamp: Could not allocate tstamp net_device "); - return NULL; - } - - ndev->netdev_ops = &nss_tstamp_ndev_ops; - - err = register_netdev(ndev); - if (err) { - nss_warning("Tstamp: Could not register tstamp net_device "); - free_netdev(ndev); - return NULL; - } - - return ndev; -} - -/* - * nss_tstamp_notify_register() - * Register to receive tstamp notify messages. - */ -struct nss_ctx_instance *nss_tstamp_notify_register(nss_tstamp_msg_callback_t cb, void *app_data) -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.tstamp_handler_id]; - - nss_tstamp_notify.tstamp_callback = cb; - nss_tstamp_notify.app_data = app_data; - - return nss_ctx; -} -EXPORT_SYMBOL(nss_tstamp_notify_register); - -/* - * nss_tstamp_register_handler() - */ -void nss_tstamp_register_handler(struct net_device *ndev) -{ - uint32_t features = 0; - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.tstamp_handler_id]; - - nss_core_register_subsys_dp(nss_ctx, NSS_TSTAMP_TX_INTERFACE, nss_tstamp_buf_receive, NULL, NULL, ndev, features); - - nss_core_register_handler(nss_ctx, NSS_TSTAMP_TX_INTERFACE, nss_tstamp_interface_handler, NULL); - - nss_core_register_handler(nss_ctx, NSS_TSTAMP_RX_INTERFACE, nss_tstamp_interface_handler, NULL); - - nss_tstamp_stats_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tstamp_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_tstamp_stats.c deleted file mode 100644 index 6285ad84b..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tstamp_stats.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include "nss_tstamp_stats.h" - -/* - * Spinlock to protect TSTAMP statistics update/read - */ -DEFINE_SPINLOCK(nss_tstamp_stats_lock); - -/* - * nss_tstamp_stats_str - * TSTAMP stats strings - */ -struct nss_stats_info nss_tstamp_stats_str[NSS_TSTAMP_STATS_MAX] = { - {"rx_packets" , NSS_STATS_TYPE_COMMON}, - {"rx_bytes" , NSS_STATS_TYPE_COMMON}, - {"tx_packets" , NSS_STATS_TYPE_COMMON}, - {"tx_bytes" , NSS_STATS_TYPE_COMMON}, - {"rx_queue_0_dropped" , NSS_STATS_TYPE_DROP}, - {"rx_queue_1_dropped" , NSS_STATS_TYPE_DROP}, - {"rx_queue_2_dropped" , NSS_STATS_TYPE_DROP}, - {"rx_queue_3_dropped" , NSS_STATS_TYPE_DROP}, - {"boomeranged" , NSS_STATS_TYPE_SPECIAL}, - {"dropped_fail_enqueue" , NSS_STATS_TYPE_DROP}, - {"dropped_fail_alloc" , NSS_STATS_TYPE_DROP}, - {"dropped_fail_copy" , NSS_STATS_TYPE_DROP}, - {"dropped_no_interface" , NSS_STATS_TYPE_DROP}, - {"dropped_no_headroom" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_tstamp_stats - * tstamp statistics - */ -uint64_t nss_tstamp_stats[2][NSS_TSTAMP_STATS_MAX]; - -/* - * nss_tstamp_stats_read() - * Read tstamp statistics - */ -static ssize_t nss_tstamp_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - int32_t i, num; - - /* - * Max output lines = (#stats + tx or rx tag + two blank lines) * 2(TX and RX) + - * start tag line + end tag line + three blank lines - */ - uint32_t max_output_lines = (NSS_TSTAMP_STATS_MAX + 3) * 2 + 5; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return -ENOMEM; - } - - stats_shadow = kzalloc(NSS_TSTAMP_STATS_MAX * sizeof(uint64_t), GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return -ENOMEM; - } - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "tstamp", NSS_STATS_SINGLE_CORE); - /* - * TSTAMP statistics - */ - for (num = 0; num < 2; num++) { - if (num == 0) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\ntstamp TX stats:\n\n"); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\ntstamp RX stats:\n\n"); - } - - spin_lock_bh(&nss_tstamp_stats_lock); - for (i = 0; i < NSS_TSTAMP_STATS_MAX; i++) { - stats_shadow[i] = nss_tstamp_stats[num][i]; - } - spin_unlock_bh(&nss_tstamp_stats_lock); - size_wr += nss_stats_print("tstamp", NULL, NSS_STATS_SINGLE_INSTANCE - , nss_tstamp_stats_str - , stats_shadow - , NSS_TSTAMP_STATS_MAX - , lbuf, size_wr, size_al); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_tstamp_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(tstamp) - -/* - * nss_tstamp_stats_dentry_create() - * Create tstamp statistics debug entry. - */ -void nss_tstamp_stats_dentry_create(void) -{ - nss_stats_create_dentry("tstamp", &nss_tstamp_stats_ops); -} - -/* - * nss_tstamp_stats_sync() - * Handle the syncing of NSS TSTAMP statistics. - */ -void nss_tstamp_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_tstamp_stats_msg *nts, uint32_t interface) -{ - int id, j; - - if (interface == NSS_TSTAMP_TX_INTERFACE) { - id = 0; - } else { - id = 1; - } - - spin_lock_bh(&nss_tstamp_stats_lock); - - /* - * Common node stats - */ - nss_tstamp_stats[id][NSS_STATS_NODE_RX_PKTS] += nts->node_stats.rx_packets; - nss_tstamp_stats[id][NSS_STATS_NODE_RX_BYTES] += nts->node_stats.rx_bytes; - nss_tstamp_stats[id][NSS_STATS_NODE_TX_PKTS] += nts->node_stats.tx_packets; - nss_tstamp_stats[id][NSS_STATS_NODE_TX_BYTES] += nts->node_stats.tx_bytes; - - for (j = 0; j < NSS_MAX_NUM_PRI; j++) { - nss_tstamp_stats[id][NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nts->node_stats.rx_dropped[j]; - } - - /* - * TSTAMP statistics - */ - nss_tstamp_stats[id][NSS_TSTAMP_STATS_BOOMERANGED] += nts->boomeranged; - nss_tstamp_stats[id][NSS_TSTAMP_STATS_DROPPED_FAIL_ENQUEUE] += nts->dropped_fail_enqueue; - nss_tstamp_stats[id][NSS_TSTAMP_STATS_DROPPED_FAIL_ALLOC] += nts->dropped_fail_alloc; - nss_tstamp_stats[id][NSS_TSTAMP_STATS_DROPPED_FAIL_COPY] += nts->dropped_fail_copy; - nss_tstamp_stats[id][NSS_TSTAMP_STATS_DROPPED_NO_INTERFACE] += nts->dropped_no_interface; - nss_tstamp_stats[id][NSS_TSTAMP_STATS_DROPPED_NO_HEADROOM] += nts->dropped_no_headroom; - spin_unlock_bh(&nss_tstamp_stats_lock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tstamp_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_tstamp_stats.h deleted file mode 100644 index d488ae7d7..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tstamp_stats.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_TSTAMP_STATS_H -#define __NSS_TSTAMP_STATS_H - -#include - -/** - * TSTAMP node statistics - */ -enum nss_tstamp_stats_types { - - NSS_TSTAMP_STATS_BOOMERANGED = NSS_STATS_NODE_MAX, - /**< Number of boomeranged packets. */ - NSS_TSTAMP_STATS_DROPPED_FAIL_ENQUEUE, - /**< Number of failed enqueue drops. */ - NSS_TSTAMP_STATS_DROPPED_FAIL_ALLOC, - /**< Number of failed allocation drops. */ - NSS_TSTAMP_STATS_DROPPED_FAIL_COPY, - /**< Number of failed copy drops. */ - NSS_TSTAMP_STATS_DROPPED_NO_INTERFACE, - /**< Number of failed no interface drops. */ - NSS_TSTAMP_STATS_DROPPED_NO_HEADROOM, - /**< Number of failed no headroom drops. */ - NSS_TSTAMP_STATS_MAX, -}; - -/* - * TSTAMP statistics APIs - */ -extern void nss_tstamp_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_tstamp_stats_msg *nts, uint32_t interface); -extern void nss_tstamp_stats_dentry_create(void); - -#endif /* __NSS_TSTAMP_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd.c b/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd.c deleted file mode 100644 index af1a4ac2f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_tun6rd_log.h" - -/* - * nss_tun6rd_handler() - * Handle NSS -> HLOS messages for 6rd tunnel - */ -static void nss_tun6rd_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_tun6rd_msg *ntm = (struct nss_tun6rd_msg *)ncm; - void *ctx; - - nss_tun6rd_msg_callback_t cb; - - BUG_ON(!nss_is_dynamic_interface(ncm->interface)); - - /* - * Trace Messages - */ - nss_tun6rd_log_rx_msg(ntm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_TUN6RD_MAX) { - nss_warning("%px: received invalid message %d for Tun6RD interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_tun6rd_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Update the callback and app_data for NOTIFY messages, tun6rd sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->tun6rd_msg_callback; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_tun6rd_msg_callback_t)ncm->cb; - ctx = nss_ctx->subsys_dp_register[ncm->interface].ndev; - - /* - * call 6rd tunnel callback - */ - if (!ctx) { - nss_warning("%px: Event received for 6rd tunnel interface %d before registration", nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_tun6rd_tx() - * Transmit a tun6rd message to NSSFW - */ -nss_tx_status_t nss_tun6rd_tx(struct nss_ctx_instance *nss_ctx, struct nss_tun6rd_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_tun6rd_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (!nss_is_dynamic_interface(ncm->interface)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_TUN6RD_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - *********************************** - * Register/Unregister/Miscellaneous APIs - *********************************** - */ - -/* - * nss_register_tun6rd_if() - */ -struct nss_ctx_instance *nss_register_tun6rd_if(uint32_t if_num, uint32_t type, nss_tun6rd_callback_t tun6rd_callback, - nss_tun6rd_msg_callback_t event_callback, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.tun6rd_handler_id]; - - nss_assert(nss_ctx); - nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < NSS_SPECIAL_IF_START)); - - nss_core_register_subsys_dp(nss_ctx, if_num, tun6rd_callback, NULL, NULL, netdev, features); - nss_ctx->subsys_dp_register[if_num].type = type; - - nss_top_main.tun6rd_msg_callback = event_callback; - - nss_core_register_handler(nss_ctx, if_num, nss_tun6rd_handler, NULL); - - return nss_ctx; -} - -/* - * nss_tun6rd_get_context() - */ -struct nss_ctx_instance *nss_tun6rd_get_context() -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.tun6rd_handler_id]; -} - -/* - * nss_unregister_tun6rd_if() - */ -void nss_unregister_tun6rd_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.tun6rd_handler_id]; - - nss_assert(nss_ctx); - nss_assert(nss_is_dynamic_interface(if_num)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - nss_ctx->subsys_dp_register[if_num].type = 0; - - nss_top_main.tun6rd_msg_callback = NULL; - - nss_core_unregister_handler(nss_ctx, if_num); -} - -/* - * nss_tun6rd_msg_init() - * Initialize nss_tun6rd msg. - */ -void nss_tun6rd_msg_init(struct nss_tun6rd_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} - -EXPORT_SYMBOL(nss_tun6rd_get_context); -EXPORT_SYMBOL(nss_tun6rd_tx); -EXPORT_SYMBOL(nss_register_tun6rd_if); -EXPORT_SYMBOL(nss_unregister_tun6rd_if); -EXPORT_SYMBOL(nss_tun6rd_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd_log.c deleted file mode 100644 index 121d70f82..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd_log.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_tun6rd_log.c - * NSS TUN6RD logger file. - */ - -#include "nss_core.h" - -/* - * nss_tun6rd_log_message_types_str - * NSS TUN6RD message strings - */ -static int8_t *nss_tun6rd_log_message_types_str[NSS_TUN6RD_MAX] __maybe_unused = { - "TUN6RD Attach PNODE", - "TUN6RD Stats", - "TUN6RD Update Peer", -}; - -/* - * nss_tun6rd_log_attach_pnode_msg() - * Log NSS TUN6RD Attach PNODE - */ -static void nss_tun6rd_log_attach_pnode_msg(struct nss_tun6rd_msg *ntm) -{ - struct nss_tun6rd_attach_tunnel_msg *ntam __maybe_unused = &ntm->msg.tunnel; - nss_trace("%px: NSS TUN6RD Attach Tunnel message \n" - "TUN6RD Source Address: %pI4\n" - "TUN6RD Destination Address: %pI4\n" - "TUN6RD Type of Service: %d\n" - "TUN6RD Time To Live: %d\n" - "TUN6RD Sibling Interface Number: %d\n", - ntam, &ntam->saddr, - &ntam->daddr, ntam->tos, - ntam->ttl, ntam->sibling_if_num); -} - -/* - * nss_tun6rd_log_set_peer_msg() - * Log NSS TUN6RD Set Peer Message - */ -static void nss_tun6rd_log_set_peer_msg(struct nss_tun6rd_msg *ntm) -{ - struct nss_tun6rd_set_peer_msg *ntspm __maybe_unused = &ntm->msg.peer; - nss_trace("%px: NSS TUN6RD Set Peer message \n" - "TUN6RD IPv6 Address: %pI6\n" - "TUN6RD Destination: %pI4\n", - ntspm, ntspm->ipv6_address, - &ntspm->dest); -} - -/* - * nss_tun6rd_log_verbose() - * Log message contents. - */ -static void nss_tun6rd_log_verbose(struct nss_tun6rd_msg *ntm) -{ - switch (ntm->cm.type) { - case NSS_TUN6RD_ATTACH_PNODE: - nss_tun6rd_log_attach_pnode_msg(ntm); - break; - - case NSS_TUN6RD_ADD_UPDATE_PEER: - nss_tun6rd_log_set_peer_msg(ntm); - break; - - case NSS_TUN6RD_RX_STATS_SYNC: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", ntm); - break; - } -} - -/* - * nss_tun6rd_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_tun6rd_log_tx_msg(struct nss_tun6rd_msg *ntm) -{ - if (ntm->cm.type >= NSS_TUN6RD_MAX) { - nss_warning("%px: Invalid message type\n", ntm); - return; - } - - nss_info("%px: type[%d]:%s\n", ntm, ntm->cm.type, nss_tun6rd_log_message_types_str[ntm->cm.type]); - nss_tun6rd_log_verbose(ntm); -} - -/* - * nss_tun6rd_log_rx_msg() - * Log messages received from FW. - */ -void nss_tun6rd_log_rx_msg(struct nss_tun6rd_msg *ntm) -{ - if (ntm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ntm); - return; - } - - if (ntm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ntm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type, - nss_tun6rd_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - ntm, ntm->cm.type, nss_tun6rd_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response]); - -verbose: - nss_tun6rd_log_verbose(ntm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd_log.h deleted file mode 100644 index c7c3b3a90..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tun6rd_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_TUN6RD_LOG_H -#define __NSS_TUN6RD_LOG_H - -/* - * nss_tun6rd.h - * NSS TUN6RD header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_tun6rd_log_tx_msg - * Logs a tun6rd message that is sent to the NSS firmware. - */ -void nss_tun6rd_log_tx_msg(struct nss_tun6rd_msg *ntm); - -/* - * nss_tun6rd_log_rx_msg - * Logs a tun6rd message that is received from the NSS firmware. - */ -void nss_tun6rd_log_rx_msg(struct nss_tun6rd_msg *ntm); - -#endif /* __NSS_TUN6RD_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6.c b/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6.c deleted file mode 100644 index 1801e861f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_tunipip6_log.h" -#include "nss_tunipip6_stats.h" - -#define NSS_TUNIPIP6_TX_TIMEOUT 3000 - -/* - * Data structure used to handle sync message. - */ -static struct nss_tunipip6_pvt { - struct semaphore sem; /* Semaphore structure. */ - struct completion complete; /* Completion structure. */ - int response; /* Response from FW. */ - void *cb; /* Original cb for msgs. */ - void *app_data; /* Original app_data for msgs. */ -} tunipip6_pvt; - -/* - * nss_tunipip6_verify_if_num - * Verify the interface is a valid interface - */ -static bool nss_tunipip6_verify_if_num(uint32_t if_num) -{ - enum nss_dynamic_interface_type type; - - type = nss_dynamic_interface_get_type(nss_tunipip6_get_context(), if_num); - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER: - case NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER: - return true; - default: - return false; - } -} - -/* - * nss_tunipip6_handler() - * Handle NSS -> HLOS messages for ipip6 tunnel - */ -static void nss_tunipip6_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_tunipip6_msg *ntm = (struct nss_tunipip6_msg *)ncm; - void *ctx; - nss_tunipip6_msg_callback_t cb; - - BUG_ON(!nss_tunipip6_verify_if_num(ncm->interface)); - - /* - * Trace Messages - */ - nss_tunipip6_log_rx_msg(ntm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_TUNIPIP6_MAX) { - nss_warning("%px: received invalid message %d for DS-Lite interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_tunipip6_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - switch (ntm->cm.type) { - case NSS_TUNIPIP6_STATS_SYNC: - /* - * Sync common node stats. - */ - nss_tunipip6_stats_sync(nss_ctx, ntm); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, tunipip6 sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->tunipip6_msg_callback; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_tunipip6_msg_callback_t)ncm->cb; - ctx = nss_ctx->subsys_dp_register[ncm->interface].ndev; - - /* - * call ipip6 tunnel callback - */ - if (!ctx) { - nss_warning("%px: Event received for DS-Lite tunnel interface %d before registration", nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_tunipip6_tx() - * Transmit a tunipip6 message to NSSFW - */ -nss_tx_status_t nss_tunipip6_tx(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_tunipip6_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (!nss_tunipip6_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_TUNIPIP6_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_tunipip6_tx); - -/* - * nss_tunipip6_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_tunipip6_callback(void *app_data, struct nss_tunipip6_msg *nclm) -{ - tunipip6_pvt.response = NSS_TX_SUCCESS; - tunipip6_pvt.cb = NULL; - tunipip6_pvt.app_data = NULL; - - if (nclm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: tunipip6 Error response %d Error: %d\n", app_data, nclm->cm.response, nclm->cm.error); - tunipip6_pvt.response = nclm->cm.response; - } - - /* - * Write memory barrier. - */ - smp_wmb(); - complete(&tunipip6_pvt.complete); -} - -/* - * nss_tunipip6_tx_sync() - * Transmit a tunipip6 message to NSSFW synchronously. - */ -nss_tx_status_t nss_tunipip6_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *msg) -{ - nss_tx_status_t status; - int ret; - - down(&tunipip6_pvt.sem); - msg->cm.cb = (nss_ptr_t)nss_tunipip6_callback; - msg->cm.app_data = (nss_ptr_t)NULL; - - status = nss_tunipip6_tx(nss_ctx, msg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: tunipip6_tx_msg failed\n", nss_ctx); - up(&tunipip6_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&tunipip6_pvt.complete, msecs_to_jiffies(NSS_TUNIPIP6_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: tunipip6 tx sync failed due to timeout\n", nss_ctx); - tunipip6_pvt.response = NSS_TX_FAILURE; - } - - status = tunipip6_pvt.response; - up(&tunipip6_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_tunipip6_tx_sync); - -/* - * ********************************** - * Register/Unregister/Miscellaneous APIs - * ********************************** - */ - -/* - * nss_register_tunipip6_if() - */ -struct nss_ctx_instance *nss_register_tunipip6_if(uint32_t if_num, - uint32_t dynamic_interface_type, - nss_tunipip6_callback_t tunipip6_callback, - nss_tunipip6_msg_callback_t event_callback, - struct net_device *netdev, - uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.tunipip6_handler_id]; - - nss_assert(nss_ctx); - nss_assert(nss_tunipip6_verify_if_num(if_num)); - - nss_ctx->subsys_dp_register[if_num].type = dynamic_interface_type; - nss_top_main.tunipip6_msg_callback = event_callback; - nss_core_register_subsys_dp(nss_ctx, if_num, tunipip6_callback, NULL, NULL, netdev, features); - nss_core_register_handler(nss_ctx, if_num, nss_tunipip6_handler, NULL); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_register_tunipip6_if); - -/* - * nss_unregister_tunipip6_if() - */ -void nss_unregister_tunipip6_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.tunipip6_handler_id]; - - nss_assert(nss_ctx); - nss_assert(nss_tunipip6_verify_if_num(if_num)); - - nss_stats_reset_common_stats(if_num); - nss_core_unregister_handler(nss_ctx, if_num); - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_top_main.tunipip6_msg_callback = NULL; -} -EXPORT_SYMBOL(nss_unregister_tunipip6_if); - -/* - * nss_tunipip6_get_context() - */ -struct nss_ctx_instance *nss_tunipip6_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.tunipip6_handler_id]; -} -EXPORT_SYMBOL(nss_tunipip6_get_context); - -/* - * nss_tunipip6_register_handler() - */ -void nss_tunipip6_register_handler() -{ - struct nss_ctx_instance *nss_ctx = nss_tunipip6_get_context(); - - nss_core_register_handler(nss_ctx, NSS_TUNIPIP6_INTERFACE, nss_tunipip6_handler, NULL); - nss_tunipip6_stats_dentry_create(); - sema_init(&tunipip6_pvt.sem, 1); - init_completion(&tunipip6_pvt.complete); -} - -/* - * nss_tunipip6_msg_init() - * Initialize nss_tunipip6 msg. - */ -void nss_tunipip6_msg_init(struct nss_tunipip6_msg *ntm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ntm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_tunipip6_msg_init); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_log.c deleted file mode 100644 index 1565ed87c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_log.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_tunipip6_log.c - * NSS TUNIPIP6 logger file. - */ - -#include "nss_core.h" - -/* - * nss_tunipip6_log_message_types_str - * NSS TUNIPIP6 message strings - */ -static int8_t *nss_tunipip6_log_message_types_str[NSS_TUNIPIP6_MAX] __maybe_unused = { - "TUNIPIP6 Encap Interface Create", - "TUNIPIP6 Decap Interface Create", - "TUNIPIP6 Stats", - "TUNIPIP6 FMR add", - "TUNIPIP6 FMR delete", - "TUNIPIP6 FMR flush", - "TUNIPIP6 BMR add", - "TUNIPIP6 BMR delete", -}; - -/* - * nss_tunipip6_log_error_types_str - * Strings for error types for TUNIPIP6 messages - */ -static char *nss_tunipip6_log_error_types_str[NSS_TUNIPIP6_ERROR_MAX] __maybe_unused = { - "TUNIPIP6 maximum tunnel reached", - "TUNIPIP6 tunnel already exists", - "TUNIPIP6 configuration parameters are incorrect", - "TUNIPIP6 FMR already exists ", - "TUNIPIP6 no FMR configured", - "TUNIPIP6 FMR table is full", - "TUNIPIP6 invalid FMR", - "TUNIPIP6 BMR already exists", - "TUNIPIP6 no BMR configured", - "TUNIPIP6 memory allocation for FMR failed", - "TUNIPIP6 unknown error", -}; - -/* - * nss_tunipip6_log_map_rule() - * Log NSS TUNIPIP6 map rule. - */ -static void nss_tunipip6_log_map_rule(struct nss_tunipip6_msg *ntm) -{ - struct nss_tunipip6_map_rule *nmr __maybe_unused = &ntm->msg.map_rule; - nss_trace("%px: NSS TUNIPIP6 Interface Create message \n" - "TUNIPIP6 Map Rule IPv6 prefix: %pI6\n" - "TUNIPIP6 Map Rule IPv6 prefix length: %d\n" - "TUNIPIP6 Map Rule IPv4 prefix: %pI4\n" - "TUNIPIP6 Map Rule IPv4 prefix length: %d\n" - "TUNIPIP6 Map Rule IPv6 suffix: %pI6\n" - "TUNIPIP6 Map Rule IPv6 suffix length: %d\n" - "TUNIPIP6 Map Rule EA length: %d\n" - "TUNIPIP6 Map Rule PSID offset: %d\n", - nmr, nmr->ip6_prefix, - nmr->ip6_prefix_len,&nmr->ip4_prefix, - nmr->ip4_prefix_len, nmr->ip6_suffix, - nmr->ip6_suffix_len, nmr->ea_len, - nmr->psid_offset); -} - -/* - * nss_tunipip6_log_if_create_msg() - * Log NSS TUNIPIP6 Interface Create - */ -static void nss_tunipip6_log_if_create_msg(struct nss_tunipip6_msg *ntm) -{ - struct nss_tunipip6_create_msg *ntcm __maybe_unused = &ntm->msg.tunipip6_create; - nss_trace("%px: NSS TUNIPIP6 Interface Create message \n" - "TUNIPIP6 Source Address: %pI6\n" - "TUNIPIP6 Destination Address: %pI6\n" - "TUNIPIP6 Flow Label: %d\n" - "TUNIPIP6 Flags: %d\n" - "TUNIPIP6 Hop Limit: %d\n" - "TUNIPIP6 Draft03 Specification: %d\n" - "TUNIPIP6 TTL inherit: %u\n" - "TUNIPIP6 TOS inherit: %u\n" - "TUNIPIP6 Frag ID Update: %u\n" - "TUNIPIP6 Max FMR: %u\n", - ntcm, ntcm->saddr, - ntcm->daddr, ntcm->flowlabel, - ntcm->flags, ntcm->hop_limit, - ntcm->draft03, - ntcm->ttl_inherit, - ntcm->tos_inherit, - ntcm->frag_id_update, - ntcm->fmr_max); -} - -/* - * nss_tunipip6_log_verbose() - * Log message contents. - */ -static void nss_tunipip6_log_verbose(struct nss_tunipip6_msg *ntm) -{ - switch (ntm->cm.type) { - case NSS_TUNIPIP6_TX_ENCAP_IF_CREATE: - case NSS_TUNIPIP6_TX_DECAP_IF_CREATE: - nss_tunipip6_log_if_create_msg(ntm); - break; - - case NSS_TUNIPIP6_STATS_SYNC: - /* - * No log for valid stats message. - */ - break; - - case NSS_TUNIPIP6_BMR_RULE_ADD: - case NSS_TUNIPIP6_BMR_RULE_DEL: - case NSS_TUNIPIP6_FMR_RULE_ADD: - case NSS_TUNIPIP6_FMR_RULE_DEL: - nss_tunipip6_log_map_rule(ntm); - break; - case NSS_TUNIPIP6_FMR_RULE_FLUSH: - nss_trace("%px: FMR rule flush.\n", ntm); - break; - default: - nss_trace("%px: Invalid message type\n", ntm); - break; - } -} - -/* - * nss_tunipip6_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_tunipip6_log_tx_msg(struct nss_tunipip6_msg *ntm) -{ - if (ntm->cm.type >= NSS_TUNIPIP6_MAX) { - nss_warning("%px: Invalid message type\n", ntm); - return; - } - - nss_info("%px: type[%d]:%s\n", ntm, ntm->cm.type, nss_tunipip6_log_message_types_str[ntm->cm.type]); - nss_tunipip6_log_verbose(ntm); -} - -/* - * nss_tunipip6_log_rx_msg() - * Log messages received from FW. - */ -void nss_tunipip6_log_rx_msg(struct nss_tunipip6_msg *ntm) -{ - if (ntm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ntm); - return; - } - - if (ntm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ntm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type, - nss_tunipip6_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response]); - goto verbose; - } - - if (ntm->cm.error >= NSS_TUNIPIP6_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ntm, ntm->cm.type, nss_tunipip6_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response], - ntm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ntm, ntm->cm.type, nss_tunipip6_log_message_types_str[ntm->cm.type], - ntm->cm.response, nss_cmn_response_str[ntm->cm.response], - ntm->cm.error, nss_tunipip6_log_error_types_str[ntm->cm.error]); - -verbose: - nss_tunipip6_log_verbose(ntm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_log.h deleted file mode 100644 index 2ebccee1f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_log.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_TUNIPIP6_LOG_H -#define __NSS_TUNIPIP6_LOG_H - -/* - * nss_tunipip6.h - * NSS TUNIPIP6 header file. - */ - -/* - * Logger APIs - */ - -/* - * nss_tunipip6_log_tx_msg - * Logs a tunipip6 message that is sent to the NSS firmware. - */ -void nss_tunipip6_log_tx_msg(struct nss_tunipip6_msg *ntm); - -/* - * nss_tunipip6_log_rx_msg - * Logs a tunipip6 message that is received from the NSS firmware. - */ -void nss_tunipip6_log_rx_msg(struct nss_tunipip6_msg *ntm); - -#endif /* __NSS_TUNIPIP6_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_stats.c deleted file mode 100644 index 76834d3ef..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_stats.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_tunipip6.h" -#include "nss_stats.h" -#include "nss_tunipip6_stats.h" - -#define NSS_TUNIPIP6_STATS_MAX_LINES (NSS_STATS_NODE_MAX + 32) - /**< Maximum number of lines for tunipip6 statistics dump. */ -#define NSS_TUNIPIP6_STATS_SIZE_PER_IF (NSS_STATS_MAX_STR_LENGTH * NSS_TUNIPIP6_STATS_MAX_LINES) - /**< Total number of statistics per tunipip6 interface. */ - -/* - * nss_tunipip6_stats_read() - * Read tunipip6 common node statistics - */ -static ssize_t nss_tunipip6_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = nss_tunipip6_get_context(); - enum nss_dynamic_interface_type type; - ssize_t bytes_read = 0; - size_t len = 0, size; - uint32_t if_num; - char *buf; - - /* - * Allocate memory for NSS_TUNIPIP6_TUNNEL_MAX tunnels and one - * static interface. - */ - size = NSS_TUNIPIP6_STATS_SIZE_PER_IF * (NSS_TUNIPIP6_TUNNEL_MAX << 1) + 1; - buf = vzalloc(size); - if (!buf) { - nss_warning("tunipip6: Could not allocate memory for local statistics buffer\n"); - return 0; - } - - len += nss_stats_banner(buf, len, size, "tunipip6", NSS_STATS_SINGLE_CORE); - - len += scnprintf(buf + len, size - len, "\nBase node if_num:%03u", NSS_TUNIPIP6_INTERFACE); - len += scnprintf(buf + len, size - len, "\n-------------------\n"); - len += nss_stats_fill_common_stats(NSS_TUNIPIP6_INTERFACE, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "tunipip6"); - - /* - * Common node stats for each tunipip6 dynamic interface. - */ - for (if_num = NSS_DYNAMIC_IF_START; if_num < NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES; if_num++) { - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER: - len += scnprintf(buf + len, size - len, "\nInner if_num:%03u", if_num); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER: - len += scnprintf(buf + len, size - len, "\nOuter if_num:%03u", if_num); - break; - - default: - continue; - } - - len += scnprintf(buf + len, size - len, "\n-------------------\n"); - len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "tunipip6"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len); - vfree(buf); - return bytes_read; -} - -/* - * nss_tunipip6_stats_sync() - * Update tunipip6 common node statistics. - */ -void nss_tunipip6_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *ntm) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_tunipip6_stats_sync_msg *msg_stats = &ntm->msg.stats; - uint64_t i, *dest; - uint32_t *src; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Update common node stats - */ - dest = nss_top->stats_node[ntm->cm.interface]; - src = &msg_stats->node_stats.rx_packets; - for (i = NSS_STATS_NODE_RX_PKTS; i <= NSS_STATS_NODE_RX_QUEUE_3_DROPPED; i++) { - *dest++ = *src++; - } - - spin_unlock_bh(&nss_top->stats_lock); - -} - -/* - * nss_tunipip6_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(tunipip6) - -/* - * nss_tunipip6_stats_dentry_create() - * Create tunipip6 statistics debug entry. - */ -void nss_tunipip6_stats_dentry_create(void) -{ - nss_stats_create_dentry("tunipip6", &nss_tunipip6_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_stats.h deleted file mode 100644 index 0f1748fc3..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tunipip6_stats.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_TUNIPIP6_STATS_H -#define __NSS_TUNIPIP6_STATS_H - -/* - * nss_tunipip6_stats_dentry_create() - * Creates tunipip6 interface statistics debug entry. - */ -void nss_tunipip6_stats_dentry_create(void); - -/* - * nss_tunipip6_stats_sync() - * Update tunipip6 common node statistics. - */ -void nss_tunipip6_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *ntm); - -#endif /* __NSS_TUNIPIP6_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tx_msg_sync.c b/feeds/ipq807x/qca-nss-drv/src/nss_tx_msg_sync.c deleted file mode 100644 index 9eb0c70a9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tx_msg_sync.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * nss_tx_msg_sync.c - * NSS Tx msg sync core APIs - */ - -#include "nss_tx_rx_common.h" - -/* - * nss_tx_msg_sync_callback() - * Internal callback used to handle the message response. - */ -static void nss_tx_msg_sync_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - uint32_t resp_offset; - - /* - * Per-message sync data was used as app_data. - * Retrieve the address of the original message from it. - */ - struct nss_tx_msg_sync_cmn_data *sync_data = (struct nss_tx_msg_sync_cmn_data *)app_data; - struct nss_cmn_msg *original_msg = (struct nss_cmn_msg *)sync_data->original_msg; - - /* - * Set TX status. And Copy back ncm->error and ncm->response if it is NACK. - */ - sync_data->status = NSS_TX_SUCCESS; - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - nss_warning("Tx msg sync error response %d\n", ncm->response); - sync_data->status = NSS_TX_FAILURE_SYNC_FW_ERR; - original_msg->error = ncm->error; - original_msg->response = ncm->response; - } - - /* - * ncm is the return message containing message response. - * It is different from the original message caller built. - * Because the return message is only visible in this callback context, - * we copy back message response by specifying offset and length to - * the return message. So the caller can use response in their context - * once wake up instead of calling a passed-in user callback here. - */ - resp_offset = sync_data->resp_offset + sizeof(struct nss_cmn_msg); - - if (sync_data->copy_len > 0) - memcpy((uint8_t *)((nss_ptr_t)original_msg + resp_offset), - (uint8_t *)((nss_ptr_t)ncm + resp_offset), - sync_data->copy_len); - - /* - * Wake up the caller - */ - complete(&sync_data->complete); -} - -/* - * nss_tx_msg_sync_internal() - * Internal call for sending messages to FW synchronously. - */ -static nss_tx_status_t nss_tx_msg_sync_internal(struct nss_ctx_instance *nss_ctx, - nss_tx_msg_sync_subsys_async_t tx_msg_async, - nss_tx_msg_sync_subsys_async_with_size_t tx_msg_async_with_size, - uint32_t msg_buf_size, - struct nss_tx_msg_sync_cmn_data *sync_data, - struct nss_cmn_msg *ncm, - uint32_t timeout) -{ - nss_tx_status_t status; - int ret; - - /* - * Per-msg sync data is used as app_data. - * A generic callback is used to handle the return message. - */ - ncm->cb = (nss_ptr_t)nss_tx_msg_sync_callback; - ncm->app_data = (nss_ptr_t)sync_data; - - BUG_ON(!tx_msg_async && !tx_msg_async_with_size); - - /* - * Per-subsystem asynchronous call to send down the message. - */ - if (tx_msg_async) - status = tx_msg_async(nss_ctx, ncm); - else - status = tx_msg_async_with_size(nss_ctx, ncm, msg_buf_size); - - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Tx msg async failed\n", nss_ctx); - return status; - } - - /* - * Sleep. Wake up either by notification or timeout. - */ - ret = wait_for_completion_timeout(&sync_data->complete, msecs_to_jiffies(timeout)); - if (!ret) { - nss_warning("%px: Tx msg sync timeout\n", nss_ctx); - return NSS_TX_FAILURE_SYNC_TIMEOUT; - } - - /* - * Wake up. Message response has been received within timeout. - */ - return sync_data->status; -} - -/* - * nss_tx_msg_sync() - * Send messages to FW synchronously with default message buffer size. - * - * tx_msg_async specifies the per-subsystem asynchronous call. - * timeout specifies the maximum sleep time for the completion. - * ncm is the original message the caller built. - * Since the caller cannot access the return message containing message response, - * we copy back message response from return message. - * resp_offset and copy_len specify the part of return message it'll copy. - */ -nss_tx_status_t nss_tx_msg_sync(struct nss_ctx_instance *nss_ctx, - nss_tx_msg_sync_subsys_async_t tx_msg_async, - uint32_t timeout, struct nss_cmn_msg *ncm, - uint32_t resp_offset, uint32_t copy_len) -{ - struct nss_tx_msg_sync_cmn_data sync_data; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Check Tx msg async API - */ - if (!unlikely(tx_msg_async)) { - nss_warning("%px: missing Tx msg async API\n", nss_ctx); - return NSS_TX_FAILURE_SYNC_BAD_PARAM; - } - - /* - * Initialize the per-message sync data. - */ - init_completion(&sync_data.complete); - sync_data.status = NSS_TX_FAILURE; - sync_data.original_msg = (void *)ncm; - sync_data.resp_offset = resp_offset; - sync_data.copy_len = copy_len; - - return nss_tx_msg_sync_internal(nss_ctx, tx_msg_async, NULL, 0, &sync_data, ncm, timeout); -} -EXPORT_SYMBOL(nss_tx_msg_sync); - -/* - * nss_tx_msg_sync_with_size() - * Send messages to FW synchronously with specified message buffer size. - */ -nss_tx_status_t nss_tx_msg_sync_with_size(struct nss_ctx_instance *nss_ctx, - nss_tx_msg_sync_subsys_async_with_size_t tx_msg_async_with_size, - uint32_t msg_buf_size, uint32_t timeout, - struct nss_cmn_msg *ncm, uint32_t resp_offset, uint32_t copy_len) -{ - struct nss_tx_msg_sync_cmn_data sync_data; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - /* - * Check Tx msg async API - */ - if (!unlikely(tx_msg_async_with_size)) { - nss_warning("%px: missing Tx msg async API\n", nss_ctx); - return NSS_TX_FAILURE_SYNC_BAD_PARAM; - } - - /* - * Initialize the per-message sync data. - */ - init_completion(&sync_data.complete); - sync_data.status = NSS_TX_FAILURE; - sync_data.original_msg = (void *)ncm; - sync_data.resp_offset = resp_offset; - sync_data.copy_len = copy_len; - - return nss_tx_msg_sync_internal(nss_ctx, NULL, tx_msg_async_with_size, - msg_buf_size, &sync_data, ncm, timeout); -} -EXPORT_SYMBOL(nss_tx_msg_sync_with_size); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tx_msg_sync.h b/feeds/ipq807x/qca-nss-drv/src/nss_tx_msg_sync.h deleted file mode 100644 index 248287e2e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tx_msg_sync.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * nss_tx_msg_sync.h - * NSS Tx msg sync header file - */ - -#ifndef __NSS_TX_MSG_SYNC_H -#define __NSS_TX_MSG_SYNC_H - -#include - -/* - * Amount time in msec the synchronous message should wait for response - * from NSS before the timeout happens. - */ -#define NSS_TX_MSG_SYNC_DEFAULT_TIMEOUT_MSEC (5000) - -/* - * Per-message sync data - * Used as message app_data. - */ -struct nss_tx_msg_sync_cmn_data { - struct completion complete; /* Completion structure */ - nss_tx_status_t status; /* Tx status */ - void *original_msg; /* Address of the caller-build message */ - uint32_t resp_offset; /* Response offset in message payload */ - uint32_t copy_len; /* Length in bytes copied from the return message */ -}; - -/* - * nss_tx_msg_sync_subsys_async_t() - * Tx msg asynchronous API of each subsystem. - */ -typedef nss_tx_status_t (*nss_tx_msg_sync_subsys_async_t)(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm); - -/* - * nss_tx_msg_sync_subsys_async_with_size_t() - * Tx msg asynchronous API of each subsystem with message buffer size specified. - */ -typedef nss_tx_status_t (*nss_tx_msg_sync_subsys_async_with_size_t)(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, uint32_t size); - -/* - * nss_tx_msg_sync() - * Core function to send message to FW synchronously. - * - * tx_msg_async specifies the per-subsystem asynchronous call. - * timeout specifies the maximum sleep time for the completion. - * ncm is the original message the caller built. - * Since the caller cannot access the return message containing message response, - * we copy back message response from the return message. - * resp_offset and copy_len specify the part of return message it'll copy. - */ -nss_tx_status_t nss_tx_msg_sync(struct nss_ctx_instance *nss_ctx, - nss_tx_msg_sync_subsys_async_t tx_msg_async, - uint32_t timeout, struct nss_cmn_msg *ncm, - uint32_t resp_offset, uint32_t copy_len); - -/* - * nss_tx_msg_sync_with_size() - * Send messages to FW synchronously with specified message buffer size. - */ -nss_tx_status_t nss_tx_msg_sync_with_size(struct nss_ctx_instance *nss_ctx, - nss_tx_msg_sync_subsys_async_with_size_t tx_msg_async_with_size, - uint32_t msg_buf_size, uint32_t timeout, - struct nss_cmn_msg *ncm, uint32_t resp_offset, uint32_t copy_len); - -#endif /* __NSS_TX_MSG_SYNC_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_tx_rx_common.h b/feeds/ipq807x/qca-nss-drv/src/nss_tx_rx_common.h deleted file mode 100644 index 6e148c450..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_tx_rx_common.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_tx_rx_common.h - * NSS APIs common header file - */ - -#ifndef __NSS_TX_RX_COMMON_H -#define __NSS_TX_RX_COMMON_H - -#include -#include -#include -#include -#include "nss_tx_msg_sync.h" - -/* - * Global definitions - */ -#define NSS_HLOS_MESSAGE_VERSION 1 /* Update when the common message structure changed */ - -#if (NSS_DEBUG_LEVEL > 0) -#define NSS_VERIFY_CTX_MAGIC(x) nss_verify_ctx_magic(x) -#define NSS_VERIFY_INIT_DONE(x) nss_verify_init_done(x) - -/* - * nss_verify_ctx_magic() - */ -static inline void nss_verify_ctx_magic(struct nss_ctx_instance *nss_ctx) -{ - nss_assert(nss_ctx->magic == NSS_CTX_MAGIC); -} - -static inline void nss_verify_init_done(struct nss_ctx_instance *nss_ctx) -{ - nss_assert(nss_ctx->state == NSS_CORE_STATE_INITIALIZED); -} - -#else -#define NSS_VERIFY_CTX_MAGIC(x) -#define NSS_VERIFY_INIT_DONE(x) -#endif - -/* - * CB handlers for variour interfaces - */ -void nss_phys_if_register_handler(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_c2c_tx_register_handler(struct nss_ctx_instance *nss_ctx); -extern void nss_c2c_rx_register_handler(struct nss_ctx_instance *nss_ctx); -extern void nss_crypto_register_handler(void); -extern void nss_crypto_cmn_register_handler(void); -extern void nss_ipsec_register_handler(void); -extern void nss_ipsec_cmn_register_handler(void); -extern void nss_ipv4_register_handler(void); -extern void nss_ipv4_reasm_register_handler(void); -extern void nss_ipv6_register_handler(void); -extern void nss_ipv6_reasm_register_handler(void); -extern void nss_n2h_register_handler(struct nss_ctx_instance *nss_ctx); -extern void nss_tunipip6_register_handler(void); -extern void nss_pppoe_register_handler(void); -extern void nss_freq_register_handler(void); -extern void nss_eth_rx_register_handler(struct nss_ctx_instance *nss_ctx); -extern void nss_edma_register_handler(void); -extern void nss_lag_register_handler(void); -extern void nss_dynamic_interface_register_handler(struct nss_ctx_instance *nss_ctx); -extern void nss_gre_redir_register_handler(void); -extern void nss_gre_redir_lag_us_register_handler(void); -extern void nss_gre_redir_lag_ds_register_handler(void); -extern void nss_lso_rx_register_handler(struct nss_ctx_instance *nss_ctx); -extern void nss_sjack_register_handler(void); -extern void nss_wifi_register_handler(void); -extern struct net_device *nss_tstamp_register_netdev(void); -extern void nss_tstamp_register_handler(struct net_device *ndev); -extern void nss_portid_register_handler(void); -extern void nss_oam_register_handler(void); -extern void nss_dtls_register_handler(void); -extern void nss_dtls_cmn_register_handler(void); -extern void nss_tls_register_handler(void); -extern void nss_gre_tunnel_register_handler(void); -extern void nss_trustsec_tx_register_handler(void); -extern void nss_wifili_register_handler(void); -extern void nss_ppe_register_handler(void); -extern void nss_gre_redir_mark_register_handler(void); -extern void nss_ppe_vp_register_handler(void); -extern void nss_wifi_mac_db_register_handler(void); -extern void nss_wifi_ext_vdev_register_handler(void); -extern void nss_wifili_thread_scheme_db_init(uint8_t core_id); -extern void nss_wifi_mesh_init(void); - -/* - * nss_if_msg_handler() - * External reference for internal base class handler for interface messages. - * - * This is not registered with nss_core.c as it is really a base class feature - * of the phys_if and virt_if handlers. - */ -extern void nss_if_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, - __attribute__((unused))void *app_data); - -#endif /* __NSS_TX_RX_COMMON_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st.c b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st.c deleted file mode 100755 index eeab9ad03..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_udp_st.c - * NSS UDP_ST APIs - */ - -#include "nss_core.h" -#include "nss_udp_st_stats.h" -#include "nss_udp_st_strings.h" -#include "nss_udp_st_log.h" - -#define NSS_UDP_ST_TX_MSG_TIMEOUT 1000 /* 1 sec timeout for udp_st messages */ - -/* - * Private data structure for udp_st configuration - */ -struct nss_udp_st_pvt { - struct semaphore sem; /* Semaphore structure */ - struct completion complete; /* completion structure */ - int response; /* Response from FW */ - void *cb; /* Original cb for sync msgs */ - void *app_data; /* Original app_data for sync msgs */ -} nss_udp_st_pvt; - -/* - * nss_udp_st_msg_handler() - * Handle NSS -> HLOS messages for UDP_ST node - */ -static void nss_udp_st_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_udp_st_msg *num = (struct nss_udp_st_msg *)ncm; - nss_udp_st_msg_callback_t cb; - - /* - * Is this a valid message type? - */ - if (num->cm.type >= NSS_UDP_ST_MAX_MSG_TYPES) { - nss_warning("%px: received invalid message %d for udp_st interface", nss_ctx, num->cm.type); - return; - } - - /* - * Log messages. - */ - nss_udp_st_log_rx_msg(num); - - switch (num->cm.type) { - case NSS_UDP_ST_STATS_SYNC_MSG: - /* - * Update driver statistics and send stats notifications to the registered modules. - */ - nss_udp_st_stats_sync(nss_ctx, &num->msg.stats); - break; - - case NSS_UDP_ST_RESET_STATS_MSG: - /* - * This is a response to the statistics reset message. - */ - nss_udp_st_stats_reset(NSS_UDP_ST_INTERFACE); - break; - default: - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - /* - * Check response. - */ - nss_info("%px: Received response %d for type %d, interface %d", - nss_ctx, ncm->response, ncm->type, ncm->interface); - } - } - - /* - * Return for NOTIFY messages because there is no notifier functions. - */ - if (num->cm.response == NSS_CMN_RESPONSE_NOTIFY) { - return; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_udp_st_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, num); -} - -/* - * nss_udp_st_tx_sync_callback() - * Callback to handle the completion of synchronous tx messages. - */ -static void nss_udp_st_tx_sync_callback(void *app_data, struct nss_udp_st_msg *num) -{ - nss_udp_st_msg_callback_t callback = (nss_udp_st_msg_callback_t)nss_udp_st_pvt.cb; - void *data = nss_udp_st_pvt.app_data; - - nss_udp_st_pvt.cb = NULL; - nss_udp_st_pvt.app_data = NULL; - - if (num->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("udp_st error response %d\n", num->cm.response); - nss_udp_st_pvt.response = NSS_TX_FAILURE; - } else { - nss_udp_st_pvt.response = NSS_TX_SUCCESS; - } - - if (callback) { - callback(data, num); - } - - complete(&nss_udp_st_pvt.complete); -} - -/* - * nss_udp_st_tx() - * Transmit a udp_st message to the FW. - */ -nss_tx_status_t nss_udp_st_tx(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_msg *num) -{ - struct nss_cmn_msg *ncm = &num->cm; - - /* - * Sanity check the message - */ - if (ncm->interface != NSS_UDP_ST_INTERFACE) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_UDP_ST_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Trace messages. - */ - nss_udp_st_log_tx_msg(num); - - return nss_core_send_cmd(nss_ctx, num, sizeof(*num), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_udp_st_tx); - -/* - * nss_udp_st_tx_sync() - * Transmit a synchronous udp_st message to the FW. - */ -nss_tx_status_t nss_udp_st_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_msg *num) -{ - nss_tx_status_t status; - int ret = 0; - - down(&nss_udp_st_pvt.sem); - nss_udp_st_pvt.cb = (void *)num->cm.cb; - nss_udp_st_pvt.app_data = (void *)num->cm.app_data; - - num->cm.cb = (nss_ptr_t)nss_udp_st_tx_sync_callback; - num->cm.app_data = (nss_ptr_t)NULL; - - status = nss_udp_st_tx(nss_ctx, num); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss udp_st msg tx failed\n", nss_ctx); - up(&nss_udp_st_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_udp_st_pvt.complete, msecs_to_jiffies(NSS_UDP_ST_TX_MSG_TIMEOUT)); - if (!ret) { - nss_warning("%px: udp_st tx sync failed due to timeout\n", nss_ctx); - nss_udp_st_pvt.response = NSS_TX_FAILURE; - } - - status = nss_udp_st_pvt.response; - up(&nss_udp_st_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_udp_st_tx_sync); - -/* - * nss_udp_st_msg_init() - * Initialize udp_st message. - */ -void nss_udp_st_msg_init(struct nss_udp_st_msg *num, uint16_t if_num, uint32_t type, uint32_t len, - nss_udp_st_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&num->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_udp_st_msg_init); - -/* - * nss_udp_st_register_handler() - */ -void nss_udp_st_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_core_register_handler(nss_ctx, NSS_UDP_ST_INTERFACE, nss_udp_st_msg_handler, NULL); - - nss_udp_st_stats_dentry_create(); - nss_udp_st_strings_dentry_create(); - - sema_init(&nss_udp_st_pvt.sem, 1); - init_completion(&nss_udp_st_pvt.complete); -} - -/* - * nss_udp_st_get_mgr() - * - */ -struct nss_ctx_instance *nss_udp_st_get_mgr(void) -{ - return (void *)&nss_top_main.nss[nss_top_main.udp_st_handler_id]; -} -EXPORT_SYMBOL(nss_udp_st_get_mgr); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.c deleted file mode 100644 index bd4e07b20..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_udp_st_log.c - * NSS UDP Speedtest logger file. - */ - -#include "nss_core.h" - -/* - * nss_udp_st_log_message_types_str - * udp_st message strings - */ -static int8_t *nss_udp_st_log_message_types_str[NSS_UDP_ST_MAX_MSG_TYPES] __maybe_unused = { - "UDP_ST Start Msg", - "UDP_ST Stop Msg", - "UDP_ST Configure Rule Msg", - "UDP_ST Unconfigure Rule Msg", - "UDP_ST Stats Sync Msg", - "UDP_ST TX Create Msg", - "UDP_ST TX Destroy Msg", - "UDP_ST Reset Stats Msg", -}; - -/* - * nss_udp_st_log_error_response_types_str - * Strings for error types for udp_st messages - */ -static int8_t *nss_udp_st_log_error_response_types_str[NSS_UDP_ST_ERROR_MAX] __maybe_unused = { - "UDP_ST No Error", - "UDP_ST Incorrect Rate", - "UDP_ST Incorrect Buffer Size", - "UDP_ST Memory Failure", - "UDP_ST Incorrect State", - "UDP_ST Incorrect Flags", - "UDP_ST Entry Exist", - "UDP_ST Entry Add Failed", - "UDP_ST Entry Not Exist", - "UDP_ST Wrong Start Msg Type", - "UDP_ST Wrong Stop Msg Type", - "UDP_ST Too Many Users", - "UDP_ST Unknown Msg Type", - "UDP_ST Pbuf Alloc Failure", - "UDP_ST Pbuf Size Failure", - "UDP_ST Drop Queue", - "UDP_ST Timer call missed", -}; - -/* - * nss_udp_st_log_tx_create_destroy_msg() - * Log NSS udp_st Tx create/destroy message. - */ -static void nss_udp_st_log_tx_create_destroy_msg(struct nss_udp_st_msg *num, uint8_t *msg_type) -{ - struct nss_udp_st_tx_create *create __maybe_unused = &num->msg.create; - nss_trace("%px: NSS udp_st message: %s\n" - "Rate: %u\n" - "Buffer Size: %u\n" - "DSCP: %u\n", - create, - msg_type, - create->rate, - create->buffer_size, - create->dscp); -} - -/* - * nss_udp_st_log_uncfg_rule_msg() - * Log NSS udp_st unconfig rule message. - */ -static void nss_udp_st_log_uncfg_rule_msg(struct nss_udp_st_msg *num) -{ - struct nss_udp_st_cfg *uncfg __maybe_unused = &num->msg.uncfg; - nss_trace("%px: NSS udp_st message: Unconfig\n" - "IP version: %u\n", - uncfg, - uncfg->ip_version); - - if (uncfg->ip_version == NSS_UDP_ST_FLAG_IPV4) { - nss_trace("Src IP: %pI4\n" - "Dest IP: %pI4\n", - &(uncfg->src_ip.ip.ipv4), - &(uncfg->dest_ip.ip.ipv4)); - } else { - nss_trace("Src IP: %pI6\n" - "Dest IP: %pI6\n", - &(uncfg->src_ip.ip.ipv6), - &(uncfg->dest_ip.ip.ipv6)); - } - - nss_trace("Src Port: %u\n Dest Port: %u\n Type: %u\n", - uncfg->src_port, uncfg->dest_port, uncfg->type); -} - -/* - * nss_udp_st_log_cfg_rule_msg() - * Log NSS udp_st config rule message. - */ -static void nss_udp_st_log_cfg_rule_msg(struct nss_udp_st_msg *num) -{ - struct nss_udp_st_cfg *cfg __maybe_unused = &num->msg.cfg; - nss_trace("%px: NSS udp_st message: Config\n" - "IP version: %u\n", - cfg, - cfg->ip_version); - - if (cfg->ip_version == NSS_UDP_ST_FLAG_IPV4) { - nss_trace("Src IP: %pI4\n" - "Dest IP: %pI4\n", - &(cfg->src_ip.ip.ipv4), - &(cfg->dest_ip.ip.ipv4)); - } else { - nss_trace("Src IP: %pI6\n" - "Dest IP: %pI6\n", - &(cfg->src_ip.ip.ipv6), - &(cfg->dest_ip.ip.ipv6)); - } - - nss_trace("Src Port: %u\n Dest Port: %u\n Type: %u\n", - cfg->src_port, cfg->dest_port, cfg->type); -} - -/* - * nss_udp_st_log_stop_msg() - * Log NSS udp_st stop message. - */ -static void nss_udp_st_log_stop_msg(struct nss_udp_st_msg *num) -{ - struct nss_udp_st_stop *stop __maybe_unused = &num->msg.stop; - nss_trace("%px: NSS udp_st message: Stop\n" - "Type: %u\n", - stop, - stop->type); -} - -/* - * nss_udp_st_log_start_msg() - * Log NSS udp_st start message. - */ -static void nss_udp_st_log_start_msg(struct nss_udp_st_msg *num) -{ - struct nss_udp_st_start *start __maybe_unused = &num->msg.start; - nss_trace("%px: NSS udp_st message: Start\n" - "Type: %u\n", - start, - start->type); -} - -/* - * nss_udp_st_log_verbose() - * Log message contents. - */ -static void nss_udp_st_log_verbose(struct nss_udp_st_msg *num) -{ - switch (num->cm.type) { - case NSS_UDP_ST_START_MSG: - nss_udp_st_log_start_msg(num); - break; - - case NSS_UDP_ST_STOP_MSG: - nss_udp_st_log_stop_msg(num); - break; - - case NSS_UDP_ST_CFG_RULE_MSG: - nss_udp_st_log_cfg_rule_msg(num); - break; - - case NSS_UDP_ST_UNCFG_RULE_MSG: - nss_udp_st_log_uncfg_rule_msg(num); - break; - - case NSS_UDP_ST_TX_CREATE_MSG: - nss_udp_st_log_tx_create_destroy_msg(num, "Create"); - break; - - case NSS_UDP_ST_TX_DESTROY_MSG: - nss_udp_st_log_tx_create_destroy_msg(num, "Destroy"); - break; - - case NSS_UDP_ST_RESET_STATS_MSG: - case NSS_UDP_ST_STATS_SYNC_MSG: - break; - - default: - nss_trace("%px: Invalid message type\n", num); - break; - } -} - -/* - * nss_udp_st_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_udp_st_log_tx_msg(struct nss_udp_st_msg *num) -{ - if (num->cm.type >= NSS_UDP_ST_MAX_MSG_TYPES) { - nss_warning("%px: Invalid message type\n", num); - return; - } - - nss_info("%px: type[%d]:%s\n", num, num->cm.type, nss_udp_st_log_message_types_str[num->cm.type]); - nss_udp_st_log_verbose(num); -} - -/* - * nss_udp_st_log_rx_msg() - * Log messages received from FW. - */ -void nss_udp_st_log_rx_msg(struct nss_udp_st_msg *num) -{ - if (num->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", num); - return; - } - - if (num->cm.response == NSS_CMN_RESPONSE_NOTIFY || (num->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", num, num->cm.type, - nss_udp_st_log_message_types_str[num->cm.type], - num->cm.response, nss_cmn_response_str[num->cm.response]); - goto verbose; - } - - if (num->cm.error >= NSS_UDP_ST_ERROR_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - num, num->cm.type, nss_udp_st_log_message_types_str[num->cm.type], - num->cm.response, nss_cmn_response_str[num->cm.response], - num->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - num, num->cm.type, nss_udp_st_log_message_types_str[num->cm.type], - num->cm.response, nss_cmn_response_str[num->cm.response], - num->cm.error, nss_udp_st_log_error_response_types_str[num->cm.error]); - -verbose: - nss_udp_st_log_verbose(num); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.h deleted file mode 100644 index fa2a551fb..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_log.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_UDP_ST_LOG_H__ -#define __NSS_UDP_ST_LOG_H__ - -/* - * nss_udp_st_log.h - * NSS UDP Speedtest Log Header File. - */ - -/* - * nss_udp_st_log_tx_msg - * Logs a udp_st message that is sent to the NSS firmware. - */ -void nss_udp_st_log_tx_msg(struct nss_udp_st_msg *num); - -/* - * nss_udp_st_log_rx_msg - * Logs a udp_st message that is received from the NSS firmware. - */ -void nss_udp_st_log_rx_msg(struct nss_udp_st_msg *num); - -#endif /* __NSS_UDP_ST_LOG_H__*/ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.c deleted file mode 100755 index 0fee47b2e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.c +++ /dev/null @@ -1,178 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_udp_st_stats.h" -#include "nss_udp_st_strings.h" - -uint32_t nss_udp_st_errors[NSS_UDP_ST_ERROR_MAX]; -uint32_t nss_udp_st_stats_time[NSS_UDP_ST_TEST_MAX][NSS_UDP_ST_STATS_TIME_MAX]; - -/* - * nss_udp_st_stats_read() - * Read UDP_ST stats. - */ -static ssize_t nss_udp_st_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - /* - * Max output lines = #stats * NSS_MAX_CORES + - * few blank lines for banner printing + Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_output_lines = NSS_STATS_NODE_MAX + NSS_UDP_ST_ERROR_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - uint32_t i; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - /* - * Note: The assumption here is that we do not have more than 64 stats. - */ - stats_shadow = kzalloc(64 * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "udp_st", NSS_STATS_SINGLE_CORE); - - size_wr += nss_stats_fill_common_stats(NSS_UDP_ST_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "udp_st"); - - /* - * Error stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_UDP_ST_ERROR_MAX); i++) { - stats_shadow[i] = nss_udp_st_errors[i]; - } - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("udp_st", "udp_st error stats" - , NSS_STATS_SINGLE_INSTANCE - , nss_udp_st_strings_error_stats - , stats_shadow - , NSS_UDP_ST_ERROR_MAX - , lbuf, size_wr, size_al); - - /* - * Rx time stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_UDP_ST_STATS_TIME_MAX); i++) { - stats_shadow[i] = nss_udp_st_stats_time[NSS_UDP_ST_TEST_RX][i]; - } - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("udp_st", "udp_st Rx time stats (ms)" - , NSS_STATS_SINGLE_INSTANCE - , nss_udp_st_strings_rx_time_stats - , stats_shadow - , NSS_UDP_ST_STATS_TIME_MAX - , lbuf, size_wr, size_al); - - /* - * Tx time stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_UDP_ST_STATS_TIME_MAX); i++) { - stats_shadow[i] = nss_udp_st_stats_time[NSS_UDP_ST_TEST_TX][i]; - } - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("udp_st", "udp_st Tx time stats (ms)" - , NSS_STATS_SINGLE_INSTANCE - , nss_udp_st_strings_tx_time_stats - , stats_shadow - , NSS_UDP_ST_STATS_TIME_MAX - , lbuf, size_wr, size_al); - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_udp_st_stats_ops. - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(udp_st); - -/* - * nss_udp_st_stats_dentry_create() - * Create udp_st statistics debug entry. - */ -void nss_udp_st_stats_dentry_create(void) -{ - nss_stats_create_dentry("udp_st", &nss_udp_st_stats_ops); -} - -/* - * nss_udp_st_stats_reset() - * Reset the udp_st statistics. - */ -void nss_udp_st_stats_reset(uint32_t if_num) -{ - uint32_t i; - - /* - * Reset common node stats. - */ - nss_stats_reset_common_stats(if_num); - - /* - * Reset error stats. - */ - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_UDP_ST_ERROR_MAX; i++) { - nss_udp_st_errors[i] = 0; - } - spin_unlock_bh(&nss_top_main.stats_lock); -} - -/* - * nss_udp_st_stats_sync() - * Handle the syncing of UDP_ST node statistics. - */ -void nss_udp_st_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_stats *nus) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - uint32_t i, j; - - spin_lock_bh(&nss_top->stats_lock); - - nss_top->stats_node[NSS_UDP_ST_INTERFACE][NSS_STATS_NODE_RX_PKTS] += nus->nstats.node_stats.rx_packets; - nss_top->stats_node[NSS_UDP_ST_INTERFACE][NSS_STATS_NODE_RX_BYTES] += nus->nstats.node_stats.rx_bytes; - nss_top->stats_node[NSS_UDP_ST_INTERFACE][NSS_STATS_NODE_TX_PKTS] += nus->nstats.node_stats.tx_packets; - nss_top->stats_node[NSS_UDP_ST_INTERFACE][NSS_STATS_NODE_TX_BYTES] += nus->nstats.node_stats.tx_bytes; - - for (i = 0; i < NSS_UDP_ST_ERROR_MAX; i++) { - nss_udp_st_errors[i] += nus->nstats.errors[i]; - } - - for (i = 0; i < NSS_UDP_ST_TEST_MAX; i++) { - for (j = 0; j < NSS_UDP_ST_STATS_TIME_MAX; j++) { - nss_udp_st_stats_time[i][j] = nus->time_stats[i][j]; - } - } - spin_unlock_bh(&nss_top->stats_lock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.h deleted file mode 100755 index 86b387da8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_stats.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_UDP_ST_STATS_H -#define __NSS_UDP_ST_STATS_H - -#include - -/* - * nss_udp_st_stats.h - * NSS driver UDP_ST statistics header file. - */ - -/* - * udp_st statistics APIs - */ -extern void nss_udp_st_stats_reset(uint32_t if_num); -extern void nss_udp_st_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_udp_st_stats *nus); -extern void nss_udp_st_stats_dentry_create(void); - -#endif /* __NSS_UDP_ST_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.c deleted file mode 100644 index 3b67b13b9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" - -/* - * nss_udp_st_strings_error_stats - * Statistics strings for udp_st errors. - */ -struct nss_stats_info nss_udp_st_strings_error_stats[NSS_UDP_ST_ERROR_MAX] = { - {"error_none" , NSS_STATS_TYPE_SPECIAL}, - {"incorrect_rate" , NSS_STATS_TYPE_DROP}, - {"incorrect_buffer_size" , NSS_STATS_TYPE_DROP}, - {"memory_failure" , NSS_STATS_TYPE_DROP}, - {"incorrect_state" , NSS_STATS_TYPE_DROP}, - {"incorrect_flags" , NSS_STATS_TYPE_DROP}, - {"entry_exist" , NSS_STATS_TYPE_DROP}, - {"entry_add_failed" , NSS_STATS_TYPE_DROP}, - {"entry_not_exist" , NSS_STATS_TYPE_DROP}, - {"wrong_start_msg_type" , NSS_STATS_TYPE_DROP}, - {"wrong_stop_msg_type" , NSS_STATS_TYPE_DROP}, - {"too_many_users" , NSS_STATS_TYPE_DROP}, - {"unknown_msg_type" , NSS_STATS_TYPE_DROP}, - {"pb_alloc_failure" , NSS_STATS_TYPE_DROP}, - {"pb_size_failure" , NSS_STATS_TYPE_DROP}, - {"drop_queue_failure" , NSS_STATS_TYPE_DROP}, - {"timer call is missed" , NSS_STATS_TYPE_SPECIAL}, -}; - -/* - * nss_udp_st_strings_rx_time_stats - * Statistics strings for Rx udp_st time. - */ -struct nss_stats_info nss_udp_st_strings_rx_time_stats[NSS_UDP_ST_STATS_TIME_MAX] = { - {"rx_start_time" , NSS_STATS_TYPE_SPECIAL}, - {"rx_current_time" , NSS_STATS_TYPE_SPECIAL}, - {"rx_elapsed_time" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_udp_st_strings_tx_time_stats - * Statistics strings for Tx udp_st time. - */ -struct nss_stats_info nss_udp_st_strings_tx_time_stats[NSS_UDP_ST_STATS_TIME_MAX] = { - {"tx_start_time" , NSS_STATS_TYPE_SPECIAL}, - {"tx_current_time" , NSS_STATS_TYPE_SPECIAL}, - {"tx_elapsed_time" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_udp_st_error_stats_strings_read() - * Read udp_st error statistics names. - */ -static ssize_t nss_udp_st_error_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_udp_st_strings_error_stats, NSS_UDP_ST_ERROR_MAX); -} - -/* - * nss_udp_st_rx_time_stats_strings_read() - * Read Rx udp_st time statistics names. - */ -static ssize_t nss_udp_st_rx_time_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_udp_st_strings_rx_time_stats, NSS_UDP_ST_STATS_TIME_MAX); -} - -/* - * nss_udp_st_tx_time_stats_strings_read() - * Read Tx udp_st time statistics names. - */ -static ssize_t nss_udp_st_tx_time_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_udp_st_strings_tx_time_stats, NSS_UDP_ST_STATS_TIME_MAX); -} - -/* - * nss_udp_st_error_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(udp_st_error_stats); - -/* - * nss_udp_st_rx_time_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(udp_st_rx_time_stats); - -/* - * nss_udp_st_tx_time_stats_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(udp_st_tx_time_stats); - -/* - * nss_udp_st_strings_dentry_create() - * Create udp_st statistics strings debug entry. - */ -void nss_udp_st_strings_dentry_create(void) -{ - struct dentry *dir_d; - struct dentry *file_d; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - dir_d = debugfs_create_dir("udp_st", nss_top_main.strings_dentry); - if (!dir_d) { - nss_warning("Failed to create qca-nss-drv/strings/udp_st directory"); - return; - } - - file_d = debugfs_create_file("error_stats_str", 0400, dir_d, &nss_top_main, &nss_udp_st_error_stats_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/stats/udp_st/error_stats_str file"); - goto fail; - } - - file_d = debugfs_create_file("rx_time_stats_str", 0400, dir_d, &nss_top_main, &nss_udp_st_rx_time_stats_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/stats/udp_st/rx_time_stats_str file"); - goto fail; - } - - file_d = debugfs_create_file("tx_time_stats_str", 0400, dir_d, &nss_top_main, &nss_udp_st_tx_time_stats_strings_ops); - if (!file_d) { - nss_warning("Failed to create qca-nss-drv/stats/udp_st/tx_time_stats_str file"); - goto fail; - } - - return; -fail: - debugfs_remove_recursive(dir_d); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.h deleted file mode 100644 index 6f5b513cf..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_udp_st_strings.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_UDP_ST_STRINGS_H -#define __NSS_UDP_ST_STRINGS_H - -extern struct nss_stats_info nss_udp_st_strings_error_stats[NSS_UDP_ST_ERROR_MAX]; -extern struct nss_stats_info nss_udp_st_strings_rx_time_stats[NSS_UDP_ST_STATS_TIME_MAX]; -extern struct nss_stats_info nss_udp_st_strings_tx_time_stats[NSS_UDP_ST_STATS_TIME_MAX]; - -extern void nss_udp_st_strings_dentry_create(void); - -#endif /* __NSS_UDP_ST_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned.c b/feeds/ipq807x/qca-nss-drv/src/nss_unaligned.c deleted file mode 100644 index 099abdb0a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_unaligned.c - * NSS unaligned APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_unaligned_stats.h" -#include "nss_unaligned_log.h" - -/* - * nss_unaligned_update_stats() - * Updates the statistics in the nss_ctx. - */ -static void nss_unaligned_update_stats(struct nss_ctx_instance *nss_ctx, - struct nss_unaligned_stats_msg *usm) -{ - uint32_t start_index = NSS_UNALIGNED_OPS_PER_MSG * usm->current_iteration; - uint32_t i; - spin_lock_bh(&nss_top_main.stats_lock); - nss_ctx->unaligned_stats.trap_count = usm->trap_count; - for (i = 0; i < NSS_UNALIGNED_OPS_PER_MSG; i++) { - uint32_t index = i + start_index; - if (unlikely(index >= NSS_UNALIGNED_EMULATED_OPS)) { - break; - } - nss_ctx->unaligned_stats.ops[index] = usm->ops[i]; - } - spin_unlock_bh(&nss_top_main.stats_lock); -} - -/* - * nss_unaligned_msg_handler() - * Handles metadata messages on the unaligned interface. - */ -static void nss_unaligned_msg_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_unaligned_msg *um = (struct nss_unaligned_msg *)ncm; - - /* - * Sanity checks on message - */ - if (um->cm.type >= NSS_UNALIGNED_MSG_MAX) { - nss_warning("%px: message type out of range: %d\n", nss_ctx, um->cm.type); - return; - } - - if (nss_cmn_get_msg_len(&(um->cm)) > sizeof(struct nss_unaligned_msg)) { - nss_warning("%px: message length is invalid: %d\n", nss_ctx, nss_cmn_get_msg_len(&(um->cm))); - return; - } - - nss_unaligned_log_rx_msg(um); - - switch (um->cm.type) { - case NSS_UNALIGNED_MSG_STATS: - nss_unaligned_update_stats(nss_ctx, &um->msg.stats_msg); - return; - } - - nss_core_log_msg_failures(nss_ctx, ncm); -} - -/* - * nss_unaligned_register_handler() - * Registers message handler on the NSS unaligned interface and stats dentry. - */ -void nss_unaligned_register_handler(struct nss_ctx_instance *nss_ctx) -{ - nss_core_register_handler(nss_ctx, NSS_UNALIGNED_INTERFACE, nss_unaligned_msg_handler, NULL); - - if (nss_ctx->id == NSS_CORE_0) { - nss_unaligned_stats_dentry_create(); - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_log.c deleted file mode 100644 index 079e2d76c..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_log.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_unaligned_log.c - * NSS unaligned logger file. - */ - -#include "nss_core.h" - -/* - * nss_unaligned_log_message_types_str - * NSS unaligned message strings - */ -static int8_t *nss_unaligned_log_message_types_str[NSS_UNALIGNED_MSG_MAX] __maybe_unused = { - "Unaligned Stats Message", -}; - -/* - * nss_unaligned_log_verbose() - * Log message contents. - */ -static void nss_unaligned_log_verbose(struct nss_unaligned_msg *um) -{ - switch (um->cm.type) { - case NSS_UNALIGNED_MSG_STATS: - /* - * No log for valid stats message. - */ - break; - - default: - nss_trace("%px: Invalid message type\n", um); - break; - } -} - -/* - * nss_unaligned_log_rx_msg() - * Log messages received from FW. - */ -void nss_unaligned_log_rx_msg(struct nss_unaligned_msg *um) -{ - if (um->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", um); - return; - } - - if (um->cm.response == NSS_CMN_RESPONSE_NOTIFY || (um->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", um, um->cm.type, - nss_unaligned_log_message_types_str[um->cm.type], - um->cm.response, nss_cmn_response_str[um->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - um, um->cm.type, nss_unaligned_log_message_types_str[um->cm.type], - um->cm.response, nss_cmn_response_str[um->cm.response]); - -verbose: - nss_unaligned_log_verbose(um); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_log.h deleted file mode 100644 index 98ec707de..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_log.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_UNALIGNED_LOG_H__ -#define __NSS_UNALIGNED_LOG_H__ - -/* - * nss_unaligned_log.h - * NSS Unaligned Log Header File. - */ - -/* - * nss_unaligned_log_rx_msg - * Logs an unaligned trap handler message that is received from the NSS firmware. - */ -void nss_unaligned_log_rx_msg(struct nss_unaligned_msg *um); - -#endif /* __NSS_UNALIGNED_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_stats.c deleted file mode 100644 index af0fd74be..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_stats.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_unaligned_stats.h" - -/* - * nss_unaligned_stats_read() - * Read unaligned stats - */ -static ssize_t nss_unaligned_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - uint32_t max_output_lines = NSS_MAX_CORES * NSS_UNALIGNED_OPS_PER_MSG; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - struct nss_unaligned_stats *stats_shadow; - uint32_t i, j; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(!lbuf)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_MAX_CORES * sizeof(struct nss_unaligned_stats), GFP_KERNEL); - if (unlikely(!stats_shadow)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; i < NSS_MAX_CORES; i++) { - stats_shadow[i] = nss_top_main.nss[i].unaligned_stats; - } - spin_unlock_bh(&nss_top_main.stats_lock); - - for (i = 0; i < NSS_MAX_CORES; i++) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "core: %u, total unaligned traps: %llu\n", - i, stats_shadow[i].trap_count); - for (j = 0; j < NSS_UNALIGNED_OPS_PER_MSG; j++) { - struct nss_unaligned_stats_op op = stats_shadow[i].ops[j]; - if (op.count == 0) { - break; - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "op: %2x, ext: %2x, count:%10llu, min: %10u, avg: %10u, max: %10u\n", - op.opcode_primary, op.opcode_extension, op.count, op.ticks_min, - op.ticks_avg, op.ticks_max); - } - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - - return bytes_read; -} - -/* - * nss_unaligned_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(unaligned) - -/* - * nss_unaligned_stats_dentry_create() - * Create unaligned statistics debug entry. - */ -void nss_unaligned_stats_dentry_create(void) -{ - nss_stats_create_dentry("unaligned", &nss_unaligned_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_stats.h deleted file mode 100644 index 761cda634..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_unaligned_stats.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_UNALIGNED_STATS_H -#define __NSS_UNALIGNED_STATS_H - -extern void nss_unaligned_stats_dentry_create(void); - -#endif diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_virt_if.c b/feeds/ipq807x/qca-nss-drv/src/nss_virt_if.c deleted file mode 100644 index b530517cf..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_virt_if.c +++ /dev/null @@ -1,736 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_virt_if.c - * NSS virtual/redirect handler APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_virt_if_stats.h" -#include - -#define NSS_VIRT_IF_TX_TIMEOUT 3000 /* 3 Seconds */ -#define NSS_VIRT_IF_GET_INDEX(if_num) (if_num-NSS_DYNAMIC_IF_START) - -extern int nss_ctl_redirect; - -/* - * Data structure that holds the virtual interface context. - */ -struct nss_virt_if_handle *nss_virt_if_handle_t[NSS_MAX_DYNAMIC_INTERFACES]; - -/* - * Spinlock to protect the global data structure virt_handle. - */ -DEFINE_SPINLOCK(nss_virt_if_lock); - -/* - * nss_virt_if_get_context() - */ -struct nss_ctx_instance *nss_virt_if_get_context(void) -{ - return &nss_top_main.nss[nss_top_main.virt_if_handler_id]; -} - -/* - * nss_virt_if_verify_if_num() - * Verify if_num passed to us. - */ -bool nss_virt_if_verify_if_num(uint32_t if_num) -{ - enum nss_dynamic_interface_type type = nss_dynamic_interface_get_type(nss_virt_if_get_context(), if_num); - - return type == NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H - || type == NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N; -} -EXPORT_SYMBOL(nss_virt_if_verify_if_num); - -/* - * nss_virt_if_msg_handler() - * Handle msg responses from the FW on virtual interfaces - */ -static void nss_virt_if_msg_handler(struct nss_ctx_instance *nss_ctx, - struct nss_cmn_msg *ncm, - void *app_data) -{ - struct nss_virt_if_msg *nvim = (struct nss_virt_if_msg *)ncm; - int32_t if_num; - - nss_virt_if_msg_callback_t cb; - struct nss_virt_if_handle *handle = NULL; - - /* - * Sanity check the message type - */ - if (ncm->type > NSS_VIRT_IF_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return; - } - - /* - * Messages value that are within the base class are handled by the base class. - */ - if (ncm->type < NSS_IF_MAX_MSG_TYPES) { - return nss_if_msg_handler(nss_ctx, ncm, app_data); - } - - if (!nss_virt_if_verify_if_num(ncm->interface)) { - nss_warning("%px: response for another interface: %d", nss_ctx, ncm->interface); - return; - } - - if_num = NSS_VIRT_IF_GET_INDEX(ncm->interface); - - spin_lock_bh(&nss_virt_if_lock); - if (!nss_virt_if_handle_t[if_num]) { - spin_unlock_bh(&nss_virt_if_lock); - nss_warning("%px: virt_if handle is NULL\n", nss_ctx); - return; - } - - handle = nss_virt_if_handle_t[if_num]; - spin_unlock_bh(&nss_virt_if_lock); - - switch (nvim->cm.type) { - case NSS_VIRT_IF_STATS_SYNC_MSG: - nss_virt_if_stats_sync(handle, &nvim->msg.stats); - break; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Update the callback and app_data for NOTIFY messages, IPv4 sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].ndev; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - /* - * Callback - */ - cb = (nss_virt_if_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_virt_if_callback - * Callback to handle the completion of NSS ->HLOS messages. - */ -static void nss_virt_if_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - struct nss_virt_if_handle *handle = (struct nss_virt_if_handle *)app_data; - struct nss_virt_if_pvt *nvip = handle->pvt; - - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - nss_warning("%px: virt_if Error response %d\n", handle->nss_ctx, ncm->response); - nvip->response = NSS_TX_FAILURE; - complete(&nvip->complete); - return; - } - - nvip->response = NSS_TX_SUCCESS; - complete(&nvip->complete); -} - -/* - * nss_virt_if_tx_msg_sync - * Send a message from HLOS to NSS synchronously. - */ -static nss_tx_status_t nss_virt_if_tx_msg_sync(struct nss_virt_if_handle *handle, - struct nss_virt_if_msg *nvim) -{ - nss_tx_status_t status; - int ret = 0; - struct nss_virt_if_pvt *nwip = handle->pvt; - struct nss_ctx_instance *nss_ctx = handle->nss_ctx; - - down(&nwip->sem); - - status = nss_virt_if_tx_msg(nss_ctx, nvim); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: nss_virt_if_msg failed\n", nss_ctx); - up(&nwip->sem); - return status; - } - - ret = wait_for_completion_timeout(&nwip->complete, - msecs_to_jiffies(NSS_VIRT_IF_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: virt_if tx failed due to timeout\n", nss_ctx); - nwip->response = NSS_TX_FAILURE; - } - - status = nwip->response; - up(&nwip->sem); - - return status; -} - -/* - * nss_virt_if_msg_init() - * Initialize virt specific message structure. - */ -static void nss_virt_if_msg_init(struct nss_virt_if_msg *nvim, - uint16_t if_num, - uint32_t type, - uint32_t len, - nss_virt_if_msg_callback_t cb, - struct nss_virt_if_handle *app_data) -{ - nss_cmn_msg_init(&nvim->cm, if_num, type, len, (void *)cb, (void *)app_data); -} - -/* - * nss_virt_if_handle_destroy_sync() - * Destroy the virt handle either due to request from user or due to error, synchronously. - */ -static int nss_virt_if_handle_destroy_sync(struct nss_virt_if_handle *handle) -{ - nss_tx_status_t status; - int32_t if_num_n2h = handle->if_num_n2h; - int32_t if_num_h2n = handle->if_num_h2n; - int32_t index_n2h; - int32_t index_h2n; - - if (!nss_virt_if_verify_if_num(if_num_n2h) || !nss_virt_if_verify_if_num(if_num_h2n)) { - nss_warning("%px: bad interface numbers %d %d\n", handle->nss_ctx, if_num_n2h, if_num_h2n); - return NSS_TX_FAILURE_BAD_PARAM; - } - - index_n2h = NSS_VIRT_IF_GET_INDEX(if_num_n2h); - index_h2n = NSS_VIRT_IF_GET_INDEX(if_num_h2n); - - status = nss_dynamic_interface_dealloc_node(if_num_n2h, NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Dynamic interface destroy failed status %d\n", handle->nss_ctx, status); - return status; - } - - status = nss_dynamic_interface_dealloc_node(if_num_h2n, NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Dynamic interface destroy failed status %d\n", handle->nss_ctx, status); - return status; - } - - spin_lock_bh(&nss_virt_if_lock); - nss_virt_if_handle_t[index_n2h] = NULL; - nss_virt_if_handle_t[index_h2n] = NULL; - spin_unlock_bh(&nss_virt_if_lock); - - kfree(handle->pvt); - kfree(handle); - - return status; -} - -/* - * nss_virt_if_handle_create_sync() - * Initialize virt handle which holds the if_num and stats per interface. - */ -static struct nss_virt_if_handle *nss_virt_if_handle_create_sync(struct nss_ctx_instance *nss_ctx, int32_t if_num_n2h, int32_t if_num_h2n, int32_t *cmd_rsp) -{ - int32_t index_n2h; - int32_t index_h2n; - struct nss_virt_if_handle *handle; - - if (!nss_virt_if_verify_if_num(if_num_n2h) || !nss_virt_if_verify_if_num(if_num_h2n)) { - nss_warning("%px: bad interface numbers %d %d\n", nss_ctx, if_num_n2h, if_num_h2n); - return NULL; - } - - index_n2h = NSS_VIRT_IF_GET_INDEX(if_num_n2h); - index_h2n = NSS_VIRT_IF_GET_INDEX(if_num_h2n); - - handle = (struct nss_virt_if_handle *)kzalloc(sizeof(struct nss_virt_if_handle), - GFP_KERNEL); - if (!handle) { - nss_warning("%px: handle memory alloc failed\n", nss_ctx); - *cmd_rsp = NSS_VIRT_IF_ALLOC_FAILURE; - goto error1; - } - - handle->nss_ctx = nss_ctx; - handle->if_num_n2h = if_num_n2h; - handle->if_num_h2n = if_num_h2n; - handle->pvt = (struct nss_virt_if_pvt *)kzalloc(sizeof(struct nss_virt_if_pvt), - GFP_KERNEL); - if (!handle->pvt) { - nss_warning("%px: failure allocating memory for nss_virt_if_pvt\n", nss_ctx); - *cmd_rsp = NSS_VIRT_IF_ALLOC_FAILURE; - goto error2; - } - - handle->cb = NULL; - handle->app_data = NULL; - - spin_lock_bh(&nss_virt_if_lock); - nss_virt_if_handle_t[index_n2h] = handle; - nss_virt_if_handle_t[index_h2n] = handle; - spin_unlock_bh(&nss_virt_if_lock); - - *cmd_rsp = NSS_VIRT_IF_SUCCESS; - - return handle; - -error2: - kfree(handle); -error1: - return NULL; -} - -/* - * nss_virt_if_register_handler_sync() - * register msg handler for virtual interface and initialize semaphore and completion. - */ -static uint32_t nss_virt_if_register_handler_sync(struct nss_ctx_instance *nss_ctx, struct nss_virt_if_handle *handle) -{ - uint32_t ret; - struct nss_virt_if_pvt *nvip = NULL; - int32_t if_num_n2h = handle->if_num_n2h; - int32_t if_num_h2n = handle->if_num_h2n; - - ret = nss_core_register_handler(nss_ctx, if_num_n2h, nss_virt_if_msg_handler, NULL); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Failed to register message handler for redir_n2h interface %d\n", nss_ctx, if_num_n2h); - return NSS_VIRT_IF_CORE_FAILURE; - } - - ret = nss_core_register_handler(nss_ctx, if_num_h2n, nss_virt_if_msg_handler, NULL); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num_n2h); - nss_warning("%px: Failed to register message handler for redir_h2n interface %d\n", nss_ctx, if_num_h2n); - return NSS_VIRT_IF_CORE_FAILURE; - } - - nvip = handle->pvt; - if (!nvip->sem_init_done) { - sema_init(&nvip->sem, 1); - init_completion(&nvip->complete); - nvip->sem_init_done = 1; - } - - nss_virt_if_stats_dentry_create(); - return NSS_VIRT_IF_SUCCESS; -} - -/* - * nss_virt_if_create_sync_nexthop() - * Create redir_n2h and redir_h2n interfaces, synchronously and associate it with same netdev. - */ -struct nss_virt_if_handle *nss_virt_if_create_sync_nexthop(struct net_device *netdev, uint32_t nexthop_n2h, uint32_t nexthop_h2n) -{ - struct nss_ctx_instance *nss_ctx = nss_virt_if_get_context(); - struct nss_virt_if_msg nvim; - struct nss_virt_if_config_msg *nvcm; - uint32_t ret; - struct nss_virt_if_handle *handle = NULL; - int32_t if_num_n2h, if_num_h2n; - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Interface could not be created as core not ready\n", nss_ctx); - return NULL; - } - - if_num_n2h = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H); - if (if_num_n2h < 0) { - nss_warning("%px: failure allocating redir_n2h\n", nss_ctx); - return NULL; - } - - if_num_h2n = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N); - if (if_num_h2n < 0) { - nss_warning("%px: failure allocating redir_h2n\n", nss_ctx); - nss_dynamic_interface_dealloc_node(if_num_n2h, NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H); - return NULL; - } - - handle = nss_virt_if_handle_create_sync(nss_ctx, if_num_n2h, if_num_h2n, &ret); - if (!handle) { - nss_warning("%px: virt_if handle creation failed ret %d\n", nss_ctx, ret); - nss_dynamic_interface_dealloc_node(if_num_n2h, NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_N2H); - nss_dynamic_interface_dealloc_node(if_num_h2n, NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N); - return NULL; - } - - /* - * Initializes the semaphore and also sets the msg handler for if_num. - */ - ret = nss_virt_if_register_handler_sync(nss_ctx, handle); - if (ret != NSS_VIRT_IF_SUCCESS) { - nss_warning("%px: Registration handler failed reason: %d\n", nss_ctx, ret); - goto error1; - } - - nss_virt_if_msg_init(&nvim, handle->if_num_n2h, NSS_VIRT_IF_TX_CONFIG_MSG, - sizeof(struct nss_virt_if_config_msg), nss_virt_if_callback, handle); - - nvcm = &nvim.msg.if_config; - nvcm->flags = 0; - nvcm->sibling = if_num_h2n; - nvcm->nexthop = nexthop_n2h; - memcpy(nvcm->mac_addr, netdev->dev_addr, ETH_ALEN); - - ret = nss_virt_if_tx_msg_sync(handle, &nvim); - if (ret != NSS_TX_SUCCESS) { - nss_warning("%px: nss_virt_if_tx_msg_sync failed %u\n", nss_ctx, ret); - goto error2; - } - - nvim.cm.interface = if_num_h2n; - nvcm->sibling = if_num_n2h; - nvcm->nexthop = nexthop_h2n; - - ret = nss_virt_if_tx_msg_sync(handle, &nvim); - if (ret != NSS_TX_SUCCESS) { - nss_warning("%px: nss_virt_if_tx_msg_sync failed %u\n", nss_ctx, ret); - goto error2; - } - - nss_core_register_subsys_dp(nss_ctx, handle->if_num_n2h, NULL, NULL, NULL, netdev, 0); - nss_core_register_subsys_dp(nss_ctx, handle->if_num_h2n, NULL, NULL, NULL, netdev, 0); - - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num_n2h, NSS_VIRT_IF_DP_REDIR_N2H); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num_h2n, NSS_VIRT_IF_DP_REDIR_H2N); - - /* - * Hold a reference to the net_device - */ - dev_hold(netdev); - - /* - * The context returned is the handle interface # which contains all the info related to - * the interface if_num. - */ - - return handle; - -error2: - nss_core_unregister_handler(nss_ctx, if_num_n2h); - nss_core_unregister_handler(nss_ctx, if_num_h2n); - -error1: - nss_virt_if_handle_destroy_sync(handle); - return NULL; -} -EXPORT_SYMBOL(nss_virt_if_create_sync_nexthop); - -/* - * nss_virt_if_create_sync() - * Create redir_n2h and redir_h2n interfaces, synchronously and associate it with same netdev. - * It uses the default nexthop interfaces. - * - * - */ -struct nss_virt_if_handle *nss_virt_if_create_sync(struct net_device *netdev) -{ - /* - * NSS_N2H_INTERFACE is the nexthop of the dynamic interface which is created for handling the - * n2h traffic. - * NSS_ETH_RX_INTERFACE is the nexthop of the dynamic interface which is created for handling the - * h2n traffic. - */ - return nss_virt_if_create_sync_nexthop(netdev, NSS_N2H_INTERFACE, NSS_ETH_RX_INTERFACE); -} -EXPORT_SYMBOL(nss_virt_if_create_sync); - -/* - * nss_virt_if_destroy_sync() - * Destroy the virt interface associated with the interface number, synchronously. - */ -nss_tx_status_t nss_virt_if_destroy_sync(struct nss_virt_if_handle *handle) -{ - nss_tx_status_t status; - struct net_device *dev; - int32_t if_num_n2h; - int32_t if_num_h2n; - struct nss_ctx_instance *nss_ctx; - uint32_t ret; - - if (!handle) { - nss_warning("handle is NULL\n"); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if_num_n2h = handle->if_num_n2h; - if_num_h2n = handle->if_num_h2n; - nss_ctx = handle->nss_ctx; - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Interface could not be destroyed as core not ready\n", nss_ctx); - return NSS_TX_FAILURE_NOT_READY; - } - - spin_lock_bh(&nss_top_main.lock); - if (!nss_ctx->subsys_dp_register[if_num_n2h].ndev || !nss_ctx->subsys_dp_register[if_num_h2n].ndev) { - spin_unlock_bh(&nss_top_main.lock); - nss_warning("%px: Unregister virt interface %d %d: no context\n", nss_ctx, if_num_n2h, if_num_h2n); - return NSS_TX_FAILURE_BAD_PARAM; - } - - dev = nss_ctx->subsys_dp_register[if_num_n2h].ndev; - nss_assert(dev == nss_ctx->subsys_dp_register[if_num_h2n].ndev); - nss_core_unregister_subsys_dp(nss_ctx, if_num_n2h); - nss_core_unregister_subsys_dp(nss_ctx, if_num_h2n); - spin_unlock_bh(&nss_top_main.lock); - dev_put(dev); - - status = nss_virt_if_handle_destroy_sync(handle); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: handle destroy failed for if_num_n2h %d and if_num_h2n %d\n", nss_ctx, if_num_n2h, if_num_h2n); - return NSS_TX_FAILURE; - } - - ret = nss_core_unregister_handler(nss_ctx, if_num_n2h); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for redir_n2h interface %d with NSS core\n", nss_ctx, if_num_n2h); - return NSS_TX_FAILURE_BAD_PARAM; - } - - ret = nss_core_unregister_handler(nss_ctx, if_num_h2n); - if (ret != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Not able to unregister handler for redir_h2n interface %d with NSS core\n", nss_ctx, if_num_h2n); - return NSS_TX_FAILURE_BAD_PARAM; - } - - return status; -} -EXPORT_SYMBOL(nss_virt_if_destroy_sync); - -/* - * nss_virt_if_tx_buf() - * HLOS interface has received a packet which we redirect to the NSS, if appropriate to do so. - */ -nss_tx_status_t nss_virt_if_tx_buf(struct nss_virt_if_handle *handle, - struct sk_buff *skb) -{ - int32_t if_num = handle->if_num_h2n; - struct nss_ctx_instance *nss_ctx = handle->nss_ctx; - int cpu = 0; - - if (unlikely(nss_ctl_redirect == 0)) { - return NSS_TX_FAILURE_NOT_ENABLED; - } - - if (unlikely(skb->vlan_tci)) { - return NSS_TX_FAILURE_NOT_SUPPORTED; - } - - if (!nss_virt_if_verify_if_num(if_num)) { - nss_warning("%px: bad interface number %d\n", nss_ctx, if_num); - return NSS_TX_FAILURE_BAD_PARAM; - } - - nss_trace("%px: Virtual Rx packet, if_num:%d, skb:%px", nss_ctx, if_num, skb); - - /* - * Sanity check the SKB to ensure that it's suitable for us - */ - if (unlikely(skb->len <= ETH_HLEN)) { - nss_warning("%px: Virtual Rx packet: %px too short", nss_ctx, skb); - return NSS_TX_FAILURE_TOO_SHORT; - } - - /* - * set skb queue mapping - */ - cpu = get_cpu(); - put_cpu(); - skb_set_queue_mapping(skb, cpu); - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER | - H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_virt_if_tx_buf); - -/* - * nss_virt_if_tx_msg() - */ -nss_tx_status_t nss_virt_if_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_virt_if_msg *nvim) -{ - struct nss_cmn_msg *ncm = &nvim->cm; - - /* - * Sanity check the message - */ - if (!nss_virt_if_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type > NSS_VIRT_IF_MAX_MSG_TYPES) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, nvim, sizeof(*nvim), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_virt_if_tx_msg); - -/* - * nss_virt_if_xmit_callback_register() - * Register virtual interface xmit callback. - */ -void nss_virt_if_xmit_callback_register(struct nss_virt_if_handle *handle, - nss_virt_if_xmit_callback_t cb) -{ - struct nss_ctx_instance *nss_ctx; - struct nss_subsystem_dataplane_register *reg; - - if (!handle) { - nss_warning("handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_virt_if_verify_if_num(handle->if_num_n2h)) { - nss_warning("if_num is invalid\n"); - return; - } - - reg = &nss_ctx->subsys_dp_register[handle->if_num_n2h]; - reg->xmit_cb = cb; -} -EXPORT_SYMBOL(nss_virt_if_xmit_callback_register); - -/* - * nss_virt_if_xmit_callback_unregister() - * Unregister virtual interface xmit callback. - */ -void nss_virt_if_xmit_callback_unregister(struct nss_virt_if_handle *handle) -{ - struct nss_ctx_instance *nss_ctx; - struct nss_subsystem_dataplane_register *reg; - - if (!handle) { - nss_warning("handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_virt_if_verify_if_num(handle->if_num_n2h)) { - nss_warning("if_num is invalid\n"); - return; - } - - reg = &nss_ctx->subsys_dp_register[handle->if_num_n2h]; - reg->xmit_cb = NULL; -} -EXPORT_SYMBOL(nss_virt_if_xmit_callback_unregister); - -/* - * nss_virt_if_register() - */ -void nss_virt_if_register(struct nss_virt_if_handle *handle, - nss_virt_if_data_callback_t data_callback, - struct net_device *netdev) -{ - struct nss_ctx_instance *nss_ctx; - int32_t if_num; - uint32_t status; - - if (!handle) { - nss_warning("handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_virt_if_verify_if_num(handle->if_num_n2h)) { - nss_warning("if_num is invalid\n"); - return; - } - - if_num = handle->if_num_n2h; - - nss_core_register_subsys_dp(nss_ctx, if_num, data_callback, NULL, NULL, netdev, (uint32_t)netdev->features); - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for interface(%u)", nss_ctx, if_num); - return; - } -} -EXPORT_SYMBOL(nss_virt_if_register); - -/* - * nss_virt_if_unregister() - */ -void nss_virt_if_unregister(struct nss_virt_if_handle *handle) -{ - struct nss_ctx_instance *nss_ctx; - int32_t if_num; - uint32_t status; - - if (!handle) { - nss_warning("handle is NULL\n"); - return; - } - - nss_ctx = handle->nss_ctx; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_virt_if_verify_if_num(handle->if_num_n2h)) { - nss_warning("if_num is invalid\n"); - return; - } - - if_num = handle->if_num_n2h; - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for interface(%u)", nss_ctx, if_num); - return; - } -} -EXPORT_SYMBOL(nss_virt_if_unregister); - -/* - * nss_virt_if_get_interface_num() - * Get interface number for a virtual interface - */ -int32_t nss_virt_if_get_interface_num(struct nss_virt_if_handle *handle) -{ - if (!handle) { - nss_warning("virt_if handle is NULL\n"); - return -1; - } - - /* - * Return if_num_n2h whose datapath type is 0. - */ - return handle->if_num_n2h; -} -EXPORT_SYMBOL(nss_virt_if_get_interface_num); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_virt_if_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_virt_if_stats.c deleted file mode 100644 index d43b72c3d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_virt_if_stats.c +++ /dev/null @@ -1,339 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_virt_if_stats.h" - -/* - * Data structure that holds the virtual interface context. - */ -extern struct nss_virt_if_handle *nss_virt_if_handle_t[]; - -/* - * Spinlock to protect the global data structure virt_handle. - */ -extern spinlock_t nss_virt_if_lock; - -/* - * nss_virt_if_base_node_stats_str - * virt_if base node stats strings - */ -static int8_t *nss_virt_if_base_node_stats_str[NSS_VIRT_IF_BASE_NODE_STATS_MAX] = { - "active_interfaces", - "ocm_alloc_failed", - "ddr_alloc_failed", -}; - -/* - * nss_virt_if_interface_stats_str - * virt_if interface stats strings - */ -static int8_t *nss_virt_if_interface_stats_str[NSS_VIRT_IF_INTERFACE_STATS_MAX] = { - "rx_packets", - "rx_bytes", - "rx_dropped", - "tx_packets", - "tx_bytes", - "tx_enqueue_failed", - "shaper_enqueue_failed", - "ocm_alloc_failed", -}; - -/* - * nss_virt_if_base_node_stats_fill_row() - * Fill one row of virt_if base node stats. - */ -static int32_t nss_virt_if_base_node_stats_fill_row(char *line, int len, int start, struct nss_virt_if_base_node_stats *stats) -{ - uint64_t tcnt = 0; - switch (start) { - case NSS_VIRT_IF_BASE_NODE_STATS_ACTIVE_INTERFACES: - tcnt = stats->active_interfaces; - break; - - case NSS_VIRT_IF_BASE_NODE_STATS_OCM_ALLOC_FAILED: - tcnt = stats->ocm_alloc_failed; - break; - - case NSS_VIRT_IF_BASE_NODE_STATS_DDR_ALLOC_FAILED: - tcnt = stats->ddr_alloc_failed; - break; - - default: - return 0; - } - - return scnprintf(line, len, "%s = %llu\n", nss_virt_if_base_node_stats_str[start], tcnt); -} - -/* - * nss_virt_if_interface_stats_fill_row() - * Fill one row of virt_if interface stats. - */ -static int32_t nss_virt_if_interface_stats_fill_row(char *line, int len, int start, struct nss_virt_if_interface_stats *stats) -{ - uint64_t tcnt = 0; - switch (start) { - case NSS_VIRT_IF_INTERFACE_STATS_RX_PACKETS: - tcnt = stats->node_stats.rx_packets; - break; - - case NSS_VIRT_IF_INTERFACE_STATS_RX_BYTES: - tcnt = stats->node_stats.rx_bytes; - break; - - case NSS_VIRT_IF_INTERFACE_STATS_RX_DROPPED: - tcnt = nss_cmn_rx_dropped_sum(&stats->node_stats); - break; - - case NSS_VIRT_IF_INTERFACE_STATS_TX_PACKETS: - tcnt = stats->node_stats.tx_packets; - break; - - case NSS_VIRT_IF_INTERFACE_STATS_TX_BYTES: - tcnt = stats->node_stats.tx_bytes; - break; - - case NSS_VIRT_IF_INTERFACE_STATS_TX_ENQUEUE_FAILED: - tcnt = stats->tx_enqueue_failed; - break; - - case NSS_VIRT_IF_INTERFACE_STATS_SHAPER_ENQUEUE_FAILED: - tcnt = stats->shaper_enqueue_failed; - break; - - case NSS_VIRT_IF_INTERFACE_STATS_OCM_ALLOC_FAILED: - tcnt = stats->ocm_alloc_failed; - break; - - default: - return 0; - } - - return scnprintf(line, len, "%s = %llu\n", nss_virt_if_interface_stats_str[start], tcnt); -} - -/* - * nss_virt_if_stats_get() - * Get virt_if base node stats or interface stats by interface number. - */ -bool nss_virt_if_stats_get(struct nss_ctx_instance *nss_ctx, uint32_t if_num, void *stats, bool is_base) -{ - if (nss_virt_if_verify_if_num(if_num) == false) { - return false; - } - - /* - * Statistics for redir_h2n and redir_n2h are collected on redir_h2n in NSS. - */ - if (nss_dynamic_interface_get_type(nss_ctx, if_num) != NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N) - return false; - - if_num = if_num - NSS_DYNAMIC_IF_START; - spin_lock_bh(&nss_virt_if_lock); - if (!nss_virt_if_handle_t[if_num]) { - spin_unlock_bh(&nss_virt_if_lock); - return false; - } - - /* - * Check if it is base node statistics or interface statistics. - */ - if (is_base) { - memcpy((struct nss_virt_if_base_node_stats *)stats, - &nss_virt_if_handle_t[if_num]->stats.base_stats, - sizeof(struct nss_virt_if_base_node_stats)); - } else { - memcpy((struct nss_virt_if_interface_stats *)stats, - &nss_virt_if_handle_t[if_num]->stats.if_stats, - sizeof(struct nss_virt_if_interface_stats)); - } - - spin_unlock_bh(&nss_virt_if_lock); - return true; -} - -/* - * nss_virt_if_stats_read() - * Read virt_if statistics - */ -static ssize_t nss_virt_if_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_stats_data *data = fp->private_data; - struct nss_ctx_instance *nss_ctx = nss_virt_if_get_context(); - int32_t if_num = NSS_DYNAMIC_IF_START; - int32_t max_if_num = if_num + NSS_MAX_DYNAMIC_INTERFACES; - size_t bytes = 0; - ssize_t bytes_read = 0; - char line[80]; - int start, end; - int32_t if_num_valid = NSS_DYNAMIC_IF_START - 1; - struct nss_virt_if_base_node_stats base_node_stats_local; - struct nss_virt_if_interface_stats interface_stats_local; - - if (data) { - if_num = data->if_num; - } - - if (if_num > max_if_num) { - return 0; - } - - /* - * Interface statistics for all virtual interface pairs. - */ - for (; if_num < max_if_num; if_num++) { - - if (!nss_virt_if_stats_get(nss_ctx, if_num, &interface_stats_local, false)) - continue; - - bytes = scnprintf(line, sizeof(line), "if_num %d stats start:\n\n", if_num); - if ((bytes_read + bytes) > sz) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) - return -EFAULT; - - bytes_read += bytes; - - start = NSS_VIRT_IF_INTERFACE_STATS_RX_PACKETS; - end = NSS_VIRT_IF_INTERFACE_STATS_MAX; - while (bytes_read < sz && start < end) { - bytes = nss_virt_if_interface_stats_fill_row(line, sizeof(line), start, &interface_stats_local); - if (!bytes) - break; - - if ((bytes_read + bytes) > sz) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) - return -EFAULT; - - bytes_read += bytes; - start++; - } - - /* - * Save one valid interface number for base node statistics. - */ - if_num_valid = if_num; - - bytes = scnprintf(line, sizeof(line), "if_num %d stats end:\n\n", if_num); - if (bytes_read > (sz - bytes)) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) - return -EFAULT; - - bytes_read += bytes; - } - - /* - * Base node statistics. - */ - if (!nss_virt_if_stats_get(nss_ctx, if_num_valid, &base_node_stats_local, true)) - goto done; - - bytes = scnprintf(line, sizeof(line), "base node stats begin (shown on if_num %d):\n\n", if_num_valid); - if ((bytes_read + bytes) > sz) - goto done; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) - return -EFAULT; - - bytes_read += bytes; - - start = NSS_VIRT_IF_BASE_NODE_STATS_ACTIVE_INTERFACES; - end = NSS_VIRT_IF_BASE_NODE_STATS_MAX; - while (bytes_read < sz && start < end) { - bytes = nss_virt_if_base_node_stats_fill_row(line, sizeof(line), start, &base_node_stats_local); - if (!bytes) - break; - - if ((bytes_read + bytes) > sz) - break; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) - return -EFAULT; - - bytes_read += bytes; - start++; - } - - bytes = scnprintf(line, sizeof(line), "base node stats end.\n\n"); - if ((bytes_read + bytes) > sz) - goto done; - - if (copy_to_user(ubuf + bytes_read, line, bytes) != 0) - return -EFAULT; - - bytes_read += bytes; - -done: - if (bytes_read > 0) { - *ppos = bytes_read; - } - - if (data) { - data->if_num = if_num; - } - - return bytes_read; -} - -/* - * nss_virt_if_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(virt_if) - -/* - * nss_virt_if_stats_dentry_create() - * Create virt_if statistics debug entry. - */ -void nss_virt_if_stats_dentry_create(void) -{ - nss_stats_create_dentry("virt_if", &nss_virt_if_stats_ops); -} - -/* - * nss_virt_if_stats_sync() - * Sync stats from the NSS FW - */ -void nss_virt_if_stats_sync(struct nss_virt_if_handle *handle, - struct nss_virt_if_stats *nwis) -{ - struct nss_virt_if_stats *stats = &handle->stats; - int i; - - spin_lock_bh(&nss_virt_if_lock); - stats->if_stats.node_stats.rx_packets += nwis->if_stats.node_stats.rx_packets; - stats->if_stats.node_stats.rx_bytes += nwis->if_stats.node_stats.rx_bytes; - stats->if_stats.node_stats.tx_packets += nwis->if_stats.node_stats.tx_packets; - stats->if_stats.node_stats.tx_bytes += nwis->if_stats.node_stats.tx_bytes; - - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - stats->if_stats.node_stats.rx_dropped[i] += nwis->if_stats.node_stats.rx_dropped[i]; - } - - stats->if_stats.tx_enqueue_failed += nwis->if_stats.tx_enqueue_failed; - stats->if_stats.shaper_enqueue_failed += nwis->if_stats.shaper_enqueue_failed; - stats->if_stats.ocm_alloc_failed += nwis->if_stats.ocm_alloc_failed; - - stats->base_stats.active_interfaces = nwis->base_stats.active_interfaces; - stats->base_stats.ocm_alloc_failed = nwis->base_stats.ocm_alloc_failed; - stats->base_stats.ddr_alloc_failed = nwis->base_stats.ddr_alloc_failed; - spin_unlock_bh(&nss_virt_if_lock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_virt_if_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_virt_if_stats.h deleted file mode 100644 index 0c26fac92..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_virt_if_stats.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017,2019 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_VIRT_IF_STATS_H -#define __NSS_VIRT_IF_STATS_H - -/* - * virt_if base node statistics types. - */ -enum nss_virt_if_base_node_stats_types { - NSS_VIRT_IF_BASE_NODE_STATS_ACTIVE_INTERFACES, /* Number of active virtual interfaces */ - NSS_VIRT_IF_BASE_NODE_STATS_OCM_ALLOC_FAILED, /* Number of interface allocation failure on OCM */ - NSS_VIRT_IF_BASE_NODE_STATS_DDR_ALLOC_FAILED, /* Number of interface allocation failure on DDR */ - NSS_VIRT_IF_BASE_NODE_STATS_MAX, -}; - -/* - * virt_if interface statistics types. - */ -enum nss_virt_if_interface_stats_types { - NSS_VIRT_IF_INTERFACE_STATS_RX_PACKETS, /* Rx packets */ - NSS_VIRT_IF_INTERFACE_STATS_RX_BYTES, /* Rx bytes */ - NSS_VIRT_IF_INTERFACE_STATS_RX_DROPPED, /* Rx drop count */ - NSS_VIRT_IF_INTERFACE_STATS_TX_PACKETS, /* Tx packets */ - NSS_VIRT_IF_INTERFACE_STATS_TX_BYTES, /* Tx bytes */ - NSS_VIRT_IF_INTERFACE_STATS_TX_ENQUEUE_FAILED, /* Number of Tx enqueue failure */ - NSS_VIRT_IF_INTERFACE_STATS_SHAPER_ENQUEUE_FAILED, /* Number of shaper enqueue failure */ - NSS_VIRT_IF_INTERFACE_STATS_OCM_ALLOC_FAILED, /* Number of interface allocation failure on OCM */ - NSS_VIRT_IF_INTERFACE_STATS_MAX, -}; - -/* - * Virtual interface statistics APIs - */ -extern void nss_virt_if_stats_sync(struct nss_virt_if_handle *handle, struct nss_virt_if_stats *nwis); -extern void nss_virt_if_stats_dentry_create(void); - -#endif /* __NSS_VIRT_IF_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_vlan.c b/feeds/ipq807x/qca-nss-drv/src/nss_vlan.c deleted file mode 100644 index 23b5c0ba5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_vlan.c +++ /dev/null @@ -1,411 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_vlan_log.h" - -#define NSS_VLAN_TX_TIMEOUT 1000 /* 1 Second */ - -/* - * Private data structure - */ -static struct nss_vlan_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} vlan_pvt; - -/* - * nss_vlan_get_context() - */ -struct nss_ctx_instance *nss_vlan_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.vlan_handler_id]; -} -EXPORT_SYMBOL(nss_vlan_get_context); - -/* - * nss_vlan_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_vlan_verify_if_num(uint32_t if_num) -{ - if (!nss_is_dynamic_interface(if_num)) { - return false; - } - - if (nss_dynamic_interface_get_type(nss_vlan_get_context(), if_num) != NSS_DYNAMIC_INTERFACE_TYPE_VLAN) { - return false; - } - - return true; -} - -/* - * nss_vlan_handler() - * Handle NSS -> HLOS messages for vlan - */ -static void nss_vlan_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) -{ - struct nss_vlan_msg *nvm = (struct nss_vlan_msg *)ncm; - nss_vlan_msg_callback_t cb; - - nss_assert(nss_vlan_verify_if_num(ncm->interface)); - - /* - * Trace messages. - */ - nss_vlan_log_rx_msg(nvm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_VLAN_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for vlan interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_vlan_msg)) { - nss_warning("%px: length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Update the callback and app_data for NOTIFY messages, vlan sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->vlan_callback; - ncm->app_data = (nss_ptr_t)app_data; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - return; - } - - /* - * callback - */ - cb = (nss_vlan_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, nvm); -} - -/* - * nss_vlan_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_vlan_callback(void *app_data, struct nss_vlan_msg *nvm) -{ - nss_vlan_msg_callback_t callback = (nss_vlan_msg_callback_t)vlan_pvt.cb; - void *data = vlan_pvt.app_data; - - vlan_pvt.response = NSS_TX_SUCCESS; - vlan_pvt.cb = NULL; - vlan_pvt.app_data = NULL; - - if (nvm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("vlan error response %d\n", nvm->cm.response); - vlan_pvt.response = nvm->cm.response; - } - - if (callback) { - callback(data, nvm); - } - complete(&vlan_pvt.complete); -} - -/* - * nss_vlan_tx_msg() - * Transmit a vlan message to NSSFW - */ -nss_tx_status_t nss_vlan_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_vlan_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace messages. - */ - nss_vlan_log_tx_msg(msg); - - /* - * Sanity check the message - */ - if (!nss_vlan_verify_if_num(ncm->interface)) { - nss_warning("%px: tx request for interface that is not a vlan: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_VLAN_MSG_TYPE_MAX) { - nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_vlan_tx_msg); - -/* - * nss_vlan_tx_msg_sync() - * Transmit a vlan message to NSS firmware synchronously. - */ -nss_tx_status_t nss_vlan_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_vlan_msg *nvm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&vlan_pvt.sem); - vlan_pvt.cb = (void *)nvm->cm.cb; - vlan_pvt.app_data = (void *)nvm->cm.app_data; - - nvm->cm.cb = (nss_ptr_t)nss_vlan_callback; - nvm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_vlan_tx_msg(nss_ctx, nvm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: vlan_tx_msg failed\n", nss_ctx); - up(&vlan_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&vlan_pvt.complete, msecs_to_jiffies(NSS_VLAN_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: vlan msg tx failed due to timeout\n", nss_ctx); - vlan_pvt.response = NSS_TX_FAILURE; - } - - status = vlan_pvt.response; - up(&vlan_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_vlan_tx_msg_sync); - -/* - * nss_vlan_msg_init() - * Initialize nss_vlan_msg. - */ -void nss_vlan_msg_init(struct nss_vlan_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_vlan_msg_init); - -/* - * nss_vlan_tx_change_mtu_msg - * API to send change mtu message to NSS FW - */ -nss_tx_status_t nss_vlan_tx_set_mtu_msg(uint32_t vlan_if_num, uint32_t mtu) -{ - struct nss_ctx_instance *nss_ctx = nss_vlan_get_context(); - struct nss_vlan_msg nvm; - struct nss_if_mtu_change *nimc; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_vlan_verify_if_num(vlan_if_num) == false) { - nss_warning("%px: received invalid interface %d", nss_ctx, vlan_if_num); - return NSS_TX_FAILURE; - } - - nss_vlan_msg_init(&nvm, vlan_if_num, NSS_IF_MTU_CHANGE, - sizeof(struct nss_if_mtu_change), NULL, NULL); - - nimc = &nvm.msg.if_msg.mtu_change; - nimc->min_buf_size = (uint16_t)mtu; - - return nss_vlan_tx_msg_sync(nss_ctx, &nvm); -} -EXPORT_SYMBOL(nss_vlan_tx_set_mtu_msg); - -/* - * nss_vlan_tx_set_mac_addr_msg - * API to send change mac addr message to NSS FW - */ -nss_tx_status_t nss_vlan_tx_set_mac_addr_msg(uint32_t vlan_if_num, uint8_t *addr) -{ - struct nss_ctx_instance *nss_ctx = nss_vlan_get_context(); - struct nss_vlan_msg nvm; - struct nss_if_mac_address_set *nmas; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_vlan_verify_if_num(vlan_if_num) == false) { - nss_warning("%px: received invalid interface %d", nss_ctx, vlan_if_num); - return NSS_TX_FAILURE; - } - - nss_vlan_msg_init(&nvm, vlan_if_num, NSS_IF_MAC_ADDR_SET, - sizeof(struct nss_if_mac_address_set), NULL, NULL); - - nmas = &nvm.msg.if_msg.mac_address_set; - memcpy(nmas->mac_addr, addr, ETH_ALEN); - return nss_vlan_tx_msg_sync(nss_ctx, &nvm); -} -EXPORT_SYMBOL(nss_vlan_tx_set_mac_addr_msg); - -/* - * nss_vlan_tx_vsi_attach_msg - * API to send VSI attach message to NSS FW - */ -nss_tx_status_t nss_vlan_tx_vsi_attach_msg(uint32_t vlan_if_num, uint32_t vsi) -{ - struct nss_ctx_instance *nss_ctx = nss_vlan_get_context(); - struct nss_vlan_msg nvm; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_vlan_verify_if_num(vlan_if_num) == false) { - nss_warning("%px: received invalid interface %d\n", nss_ctx, vlan_if_num); - return NSS_TX_FAILURE; - } - - nvm.msg.if_msg.vsi_assign.vsi = vsi; - nss_vlan_msg_init(&nvm, vlan_if_num, NSS_IF_VSI_ASSIGN, - sizeof(struct nss_if_vsi_assign), NULL, NULL); - - return nss_vlan_tx_msg_sync(nss_ctx, &nvm); -} -EXPORT_SYMBOL(nss_vlan_tx_vsi_attach_msg); - -/* - * nss_vlan_tx_vsi_detach_msg - * API to send VSI detach message to NSS FW - */ -nss_tx_status_t nss_vlan_tx_vsi_detach_msg(uint32_t vlan_if_num, uint32_t vsi) -{ - struct nss_ctx_instance *nss_ctx = nss_vlan_get_context(); - struct nss_vlan_msg nvm; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_vlan_verify_if_num(vlan_if_num) == false) { - nss_warning("%px: received invalid interface %d\n", nss_ctx, vlan_if_num); - return NSS_TX_FAILURE; - } - - nvm.msg.if_msg.vsi_unassign.vsi = vsi; - nss_vlan_msg_init(&nvm, vlan_if_num, NSS_IF_VSI_UNASSIGN, - sizeof(struct nss_if_vsi_unassign), NULL, NULL); - - return nss_vlan_tx_msg_sync(nss_ctx, &nvm); -} -EXPORT_SYMBOL(nss_vlan_tx_vsi_detach_msg); - -/* - * nss_vlan_tx_add_tag_msg - * API to send vlan add tag message to NSS FW - */ -nss_tx_status_t nss_vlan_tx_add_tag_msg(uint32_t vlan_if_num, uint32_t vlan_tag, uint32_t next_hop, uint32_t physical_dev) -{ - struct nss_ctx_instance *nss_ctx = nss_vlan_get_context(); - struct nss_vlan_msg nvm; - - if (!nss_ctx) { - nss_warning("Can't get nss context\n"); - return NSS_TX_FAILURE; - } - - if (nss_vlan_verify_if_num(vlan_if_num) == false) { - nss_warning("%px: received invalid interface %d\n", nss_ctx, vlan_if_num); - return NSS_TX_FAILURE; - } - - nvm.msg.add_tag.next_hop = next_hop; - nvm.msg.add_tag.if_num = physical_dev; - nvm.msg.add_tag.vlan_tag = vlan_tag; - nss_vlan_msg_init(&nvm, vlan_if_num, NSS_VLAN_MSG_ADD_TAG, - sizeof(struct nss_vlan_msg_add_tag), NULL, NULL); - - return nss_vlan_tx_msg_sync(nss_ctx, &nvm); -} -EXPORT_SYMBOL(nss_vlan_tx_add_tag_msg); - -/** - * @brief Register to send/receive vlan messages to NSS - * - * @param if_num NSS interface number - * @param vlan_data_callback Callback for vlan data - * @param netdev netdevice associated with the vlan interface - * @param features denotes the skb types supported by this interface - * - * @return nss_ctx_instance* NSS context - */ -struct nss_ctx_instance *nss_register_vlan_if(uint32_t if_num, nss_vlan_callback_t vlan_data_callback, - struct net_device *netdev, uint32_t features, void *app_ctx) -{ - struct nss_ctx_instance *nss_ctx = nss_vlan_get_context(); - - nss_assert(nss_vlan_verify_if_num(if_num)); - - nss_core_register_subsys_dp(nss_ctx, if_num, vlan_data_callback, NULL, app_ctx, netdev, features); - - nss_core_register_handler(nss_ctx, if_num, nss_vlan_handler, app_ctx); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_register_vlan_if); - -/* - * nss_unregister_vlan_if() - */ -void nss_unregister_vlan_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_vlan_get_context(); - - nss_assert(nss_vlan_verify_if_num(if_num)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_core_unregister_handler(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_unregister_vlan_if); - -/* - * nss_vlan_register_handler() - * debugfs stats msg handler received on static vlan interface - */ -void nss_vlan_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_vlan_get_context(); - - nss_info("nss_vlan_register_handler\n"); - nss_core_register_handler(nss_ctx, NSS_VLAN_INTERFACE, nss_vlan_handler, NULL); - - sema_init(&vlan_pvt.sem, 1); - init_completion(&vlan_pvt.complete); -} -EXPORT_SYMBOL(nss_vlan_register_handler); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_vlan_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_vlan_log.c deleted file mode 100644 index b9e946a74..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_vlan_log.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_vlan_log.c - * NSS VLAN logger file. - */ - -#include "nss_core.h" - -/* - * nss_vlan_log_message_types_str - * VLAN message strings - */ -static int8_t *nss_vlan_log_message_types_str[NSS_VLAN_MSG_TYPE_MAX] __maybe_unused = { - "VLAN ADD TAG", -}; - -/* - * nss_vlan_log_error_response_types_str - * Strings for error types for VLAN messages - */ -static int8_t *nss_vlan_log_error_response_types_str[NSS_VLAN_ERROR_TYPE_MAX] __maybe_unused = { - "VLAN Unknown Message", -}; - -/* - * nss_vlan_log_add_tag_msg() - * Log NSS VLAN Add Tag message. - */ -static void nss_vlan_log_add_tag_msg(struct nss_vlan_msg *nvm) -{ - struct nss_vlan_msg_add_tag *nvtm __maybe_unused = &nvm->msg.add_tag; - nss_trace("%px: NSS VLAN Add Tag Message:\n" - "VLAN Tag: %d\n" - "VLAN Next Hop: %d\n" - "VLAN Interface Number: %d\n", - nvtm, nvtm->vlan_tag, - nvtm->next_hop, nvtm->if_num); -} - -/* - * nss_vlan_log_verbose() - * Log message contents. - */ -static void nss_vlan_log_verbose(struct nss_vlan_msg *nvm) -{ - switch (nvm->cm.type) { - case NSS_VLAN_MSG_ADD_TAG: - nss_vlan_log_add_tag_msg(nvm); - break; - - default: - nss_warning("%px: Invalid message type\n", nvm); - break; - } -} - -/* - * nss_vlan_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_vlan_log_tx_msg(struct nss_vlan_msg *nvm) -{ - if (nvm->cm.type >= NSS_VLAN_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", nvm); - return; - } - - nss_info("%px: type[%d]:%s\n", nvm, nvm->cm.type, nss_vlan_log_message_types_str[nvm->cm.type]); - nss_vlan_log_verbose(nvm); -} - -/* - * nss_vlan_log_rx_msg() - * Log messages received from FW. - */ -void nss_vlan_log_rx_msg(struct nss_vlan_msg *nvm) -{ - if (nvm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nvm); - return; - } - - if (nvm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nvm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nvm, nvm->cm.type, - nss_vlan_log_message_types_str[nvm->cm.type], - nvm->cm.response, nss_cmn_response_str[nvm->cm.response]); - goto verbose; - } - - if (nvm->cm.error >= NSS_VLAN_ERROR_TYPE_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nvm, nvm->cm.type, nss_vlan_log_message_types_str[nvm->cm.type], - nvm->cm.response, nss_cmn_response_str[nvm->cm.response], - nvm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nvm, nvm->cm.type, nss_vlan_log_message_types_str[nvm->cm.type], - nvm->cm.response, nss_cmn_response_str[nvm->cm.response], - nvm->cm.error, nss_vlan_log_error_response_types_str[nvm->cm.error]); - -verbose: - nss_vlan_log_verbose(nvm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_vlan_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_vlan_log.h deleted file mode 100644 index 21b365d15..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_vlan_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_VLAN_LOG_H__ -#define __NSS_VLAN_LOG_H__ - -/* - * nss_vlan_log.h - * NSS VLAN Log Header File - */ - -/* - * nss_vlan_log_tx_msg - * Logs a vlan message that is sent to the NSS firmware. - */ -void nss_vlan_log_tx_msg(struct nss_vlan_msg *ncm); - -/* - * nss_vlan_log_rx_msg - * Logs a vlan message that is received from the NSS firmware. - */ -void nss_vlan_log_rx_msg(struct nss_vlan_msg *ncm); - -#endif /* __NSS_VLAN_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan.c b/feeds/ipq807x/qca-nss-drv/src/nss_vxlan.c deleted file mode 100644 index bde299663..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_vxlan.c - * NSS VxLAN driver interface APIs - */ -#include "nss_core.h" -#include "nss_vxlan.h" -#include "nss_cmn.h" -#include "nss_tx_rx_common.h" -#include "nss_vxlan_log.h" -#include "nss_vxlan_stats.h" - -#define NSS_VXLAN_TX_TIMEOUT 3000 - -/* - * Private data structure - */ -static struct { - struct semaphore sem; /* Semaphore structure. */ - struct completion complete; /* Completion structure. */ - int response; /* Response from FW. */ - void *cb; /* Original cb for msgs. */ - void *app_data; /* Original app_data for msgs. */ -} nss_vxlan_pvt; - -/* - * nss_vxlan_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_vxlan_verify_if_num(uint32_t if_num) -{ - uint32_t type; - - if (if_num == NSS_VXLAN_INTERFACE) { - return true; - } - - type = nss_dynamic_interface_get_type(nss_vxlan_get_ctx(), if_num); - - return ((type == NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_INNER) || - (type == NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_OUTER)); -} - -/* - * nss_vxlan_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_vxlan_callback(void *app_data, struct nss_cmn_msg *msg) -{ - nss_vxlan_msg_callback_t callback = (nss_vxlan_msg_callback_t)nss_vxlan_pvt.cb; - void *data = nss_vxlan_pvt.app_data; - - nss_vxlan_pvt.response = NSS_TX_SUCCESS; - nss_vxlan_pvt.cb = NULL; - nss_vxlan_pvt.app_data = NULL; - - if (msg->response != NSS_CMN_RESPONSE_ACK) { - nss_warning("Vxlan Error response %d\n", msg->response); - nss_vxlan_pvt.response = NSS_TX_FAILURE; - } - - if (callback) { - callback(data, msg); - } - complete(&nss_vxlan_pvt.complete); -} - -/* - * nss_vxlan_handler() - * Handle NSS -> HLOS messages for vxlan. - */ -static void nss_vxlan_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_vxlan_msg *nvm = (struct nss_vxlan_msg *)ncm; - nss_vxlan_msg_callback_t cb; - - BUG_ON(!nss_vxlan_verify_if_num(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_VXLAN_MSG_TYPE_MAX) { - nss_warning("%px: received invalid message %d for vxlan interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_vxlan_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Log messages. - */ - nss_core_log_msg_failures(nss_ctx, ncm); - nss_vxlan_log_rx_msg(nvm); - - switch (nvm->cm.type) { - case NSS_VXLAN_MSG_TYPE_STATS_SYNC: - /* - * Update common node statistics - */ - nss_vxlan_stats_sync(nss_ctx, nvm); - } - - /* - * Update the callback for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - } - - cb = (nss_vxlan_msg_callback_t)ncm->cb; - - /* - * Do we have a callback? - */ - if (!cb) { - nss_trace("%px: cb is null for interface %d\n", nss_ctx, ncm->interface); - return; - } - - cb((void *)nss_ctx->subsys_dp_register[ncm->interface].ndev, ncm); -} - -/* - * nss_vxlan_tx_msg() - * Transmit a vxlan message to NSS FW. Don't call this from softirq/interrupts. - */ -nss_tx_status_t nss_vxlan_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_vxlan_msg *nvm) -{ - struct nss_cmn_msg *ncm = &nvm->cm; - - if (!nss_vxlan_verify_if_num(ncm->interface)) { - nss_warning("%px: wrong interface number %u\n", nss_ctx, nvm->cm.interface); - return NSS_TX_FAILURE_BAD_PARAM; - } - - if (ncm->type >= NSS_VXLAN_MSG_TYPE_MAX) { - nss_warning("%px: wrong message type %u\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE_BAD_PARAM; - } - - /* - * Trace messages. - */ - nss_vxlan_log_tx_msg(nvm); - - return nss_core_send_cmd(nss_ctx, nvm, sizeof(*nvm), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_vxlan_tx_msg); - -/* - * nss_vxlan_tx_msg_sync() - * Transmit a vxlan message to NSS firmware synchronously. - */ -nss_tx_status_t nss_vxlan_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_vxlan_msg *nvm) -{ - nss_tx_status_t status; - int ret; - - down(&nss_vxlan_pvt.sem); - nss_vxlan_pvt.cb = (void *)nvm->cm.cb; - nss_vxlan_pvt.app_data = (void *)nvm->cm.app_data; - - nvm->cm.cb = (nss_ptr_t)nss_vxlan_callback; - nvm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_vxlan_tx_msg(nss_ctx, nvm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: vxlan_tx_msg failed\n", nss_ctx); - up(&nss_vxlan_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&nss_vxlan_pvt.complete, msecs_to_jiffies(NSS_VXLAN_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: vxlan tx sync failed due to timeout\n", nss_ctx); - nss_vxlan_pvt.response = NSS_TX_FAILURE; - } - - status = nss_vxlan_pvt.response; - up(&nss_vxlan_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_vxlan_tx_msg_sync); - -/* - * nss_vxlan_msg_init() - * Initialize VxLAN message. - */ -void nss_vxlan_msg_init(struct nss_vxlan_msg *nvm, uint16_t if_num, uint32_t type, uint32_t len, - nss_vxlan_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nvm->cm, if_num, type, len, (void*)cb, app_data); -} -EXPORT_SYMBOL(nss_vxlan_msg_init); - -/* - * nss_vxlan_unregister_if() - * Unregister a data packet notifier with NSS FW. - */ -bool nss_vxlan_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = nss_vxlan_get_ctx(); - if (!nss_vxlan_verify_if_num(if_num)) { - nss_warning("%px: data unregister received for invalid interface %d", nss_ctx, if_num); - return false; - } - - nss_core_unregister_handler(nss_ctx, if_num); - nss_core_unregister_subsys_dp(nss_ctx, if_num); - return true; -} -EXPORT_SYMBOL(nss_vxlan_unregister_if); - -/* - * nss_vxlan_register_if() - * Registers a data packet notifier with NSS FW. - */ -struct nss_ctx_instance *nss_vxlan_register_if(uint32_t if_num, - uint32_t type, - nss_vxlan_buf_callback_t data_cb, - nss_vxlan_msg_callback_t notify_cb, - struct net_device *netdev, - uint32_t features) -{ - struct nss_ctx_instance *nss_ctx; - int core_status; - - nss_ctx = nss_vxlan_get_ctx(); - if (!nss_vxlan_verify_if_num(if_num)) { - nss_warning("%px: data register received for invalid interface %d", nss_ctx, if_num); - return NULL; - } - - core_status = nss_core_register_handler(nss_ctx, if_num, nss_vxlan_msg_handler, NULL); - if (core_status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: nss core register handler failed for if_num:%d with error :%d", nss_ctx, if_num, core_status); - return NULL; - } - - core_status = nss_core_register_msg_handler(nss_ctx, if_num, notify_cb); - if (core_status != NSS_CORE_STATUS_SUCCESS) { - nss_core_unregister_handler(nss_ctx, if_num); - nss_warning("%px: nss core register handler failed for if_num:%d with error :%d", nss_ctx, if_num, core_status); - return NULL; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, data_cb, NULL, NULL, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, type); - return nss_ctx; -} -EXPORT_SYMBOL(nss_vxlan_register_if); - -/* - * nss_vxlan_ifnum_with_core_id() - * Append core id to vxlan interface num. - */ -int nss_vxlan_ifnum_with_core_id(int if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_vxlan_get_ctx(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (!nss_vxlan_verify_if_num(if_num)) { - nss_warning("%px: Invalid if_num: %d, must be a dynamic interface\n", nss_ctx, if_num); - return 0; - } - return NSS_INTERFACE_NUM_APPEND_COREID(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_vxlan_ifnum_with_core_id); - -/* - * nss_vxlan_get_ctx() - * Return a VxLAN NSS context. - */ -struct nss_ctx_instance *nss_vxlan_get_ctx() -{ - struct nss_ctx_instance *nss_ctx; - - nss_ctx = &nss_top_main.nss[nss_top_main.vxlan_handler_id]; - return nss_ctx; -} -EXPORT_SYMBOL(nss_vxlan_get_ctx); - -/* - * nss_vxlan_init() - * Initializes Vxlan. Gets called from nss_init.c. - */ -void nss_vxlan_init() -{ - uint32_t core_status; - struct nss_ctx_instance *nss_ctx = nss_vxlan_get_ctx(); - if (!nss_ctx) { - nss_warning("%px: VxLAN is not registered", nss_ctx); - return; - } - - nss_vxlan_stats_dentry_create(); - sema_init(&nss_vxlan_pvt.sem, 1); - init_completion(&nss_vxlan_pvt.complete); - core_status = nss_core_register_handler(nss_ctx, NSS_VXLAN_INTERFACE, nss_vxlan_msg_handler, NULL); - - if (core_status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: nss core register handler failed for if_num:%d with error :%d", nss_ctx, NSS_VXLAN_INTERFACE, core_status); - } - -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_log.c deleted file mode 100644 index 7bbfc5e87..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_log.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_vxlan_log.c - * NSS VXLAN logger file. - */ - -#include "nss_core.h" - -/* - * nss_vxlan_log_message_types_str - * VXLAN message strings - */ -static int8_t *nss_vxlan_log_message_types_str[NSS_VXLAN_MSG_TYPE_MAX] __maybe_unused = { - "VxLAN Sync Stats", - "VxLAN Tunnel Configure Rule", - "VxLAN Tunnel Unconfigure Rule", - "VxLAN Enable Tunnel", - "VxLAN Disable Tunnel", - "VxLAN Add MAC rule", - "VxLAN Delete MAC rule", - "VxLAN MAC DB Stats" -}; - -/* - * nss_vxlan_log_error_response_types_str - * Strings for error types for VXLAN messages - */ -static int8_t *nss_vxlan_log_error_response_types_str[NSS_VXLAN_ERROR_TYPE_MAX] __maybe_unused = { - "VxLAN Unknown Error", - "VXLAN Decap Register fail", - "VXLAN Dest IP mismatch", - "VXLAN Invalid VNI", - "VXLAN Invalid L3 Proto", - "VXLAN Invalid UDP Proto", - "VXLAN Invalid Src Port", - "VXLAN MAC Bad entry", - "VXLAN MAC Entry exists", - "VXLAN MAC Entry does not exist", - "VXLAN MAC Entry unhashed", - "VXLAN MAC Entry alloc failed", - "VXLAN MAC Entry delete failed", - "VXLAN MAC Table full", - "VXLAN Sibling Node does not exist", - "VXLAN Tunnel Configured", - "VXLAN Tunnel Unconfigured", - "VXLAN Tunnel addition failed", - "VXLAN Tunnel Disabled", - "VXLAN Tunnel Enabled", - "VXLAN Tunnel Entry exists" -}; - -/* - * nss_vxlan_log_rule_msg() - * Log NSS VXLAN rule message. - */ -static void nss_vxlan_log_rule_msg(struct nss_vxlan_rule_msg *nvrm) -{ - nss_trace("%px: NSS VXLAN Rule message \n" - "VxLAN Tunnel Flags: %x\n" - "VNET ID: %u\n" - "Flowlabel: %u\n" - "TOS: %u\n" - "TTL: %u\n" - "source port min: %u max: %u" - "destination port: %u", - nvrm, - nvrm->tunnel_flags, - nvrm->vni, - nvrm->flow_label, - nvrm->tos, - nvrm->ttl, - nvrm->src_port_min, - nvrm->src_port_max, - nvrm->dest_port); -} - -/* - * nss_vxlan_mac_rule_msg() - * Log NSS Vxlan MAC rule message. - */ -static void nss_vxlan_log_mac_msg(struct nss_vxlan_mac_msg *nvmm) -{ - nss_trace("%px: NSS VXLAN MAC message \n" - "Encap Rule Src IP: %px\n" - "Encap Rule Dst Ip: %px\n" - "Vxlan VNet ID: %u\n" - "Vxlan Mac Addr: %pM", - nvmm, - &nvmm->encap.src_ip, - &nvmm->encap.dest_ip, - nvmm->vni, - nvmm->mac_addr); -} - -/* - * nss_vxlan_log_rule_create_msg() - * Log NSS Vxlan rule create message. - */ -static void nss_vxlan_log_rule_create_msg(struct nss_vxlan_msg *nvm) -{ - struct nss_vxlan_rule_msg *nvrm __maybe_unused = &nvm->msg.vxlan_create; - nss_vxlan_log_rule_msg(nvrm); -} - -/* - * nss_vxlan_log_rule_destroy_msg() - * Log NSS Vxlan rule destroy message. - */ -static void nss_vxlan_log_rule_destroy_msg(struct nss_vxlan_msg *nvm) -{ - struct nss_vxlan_rule_msg *nvrm __maybe_unused = &nvm->msg.vxlan_destroy; - nss_vxlan_log_rule_msg(nvrm); -} - -/* - * nss_vxlan_log_enable_msg() - * Log NSS Vxlan rule enable message. - */ -static void nss_vxlan_log_enable_msg(struct nss_vxlan_msg *nvm) -{ - nss_trace("%px: NSS VXLAN Tunnel state message: Enable \n", nvm); -} - -/* - * nss_vxlan_log_disable_msg() - * Log NSS Vxlan rule disable message. - */ -static void nss_vxlan_log_disable_msg(struct nss_vxlan_msg *nvm) -{ - nss_trace("%px: NSS VXLAN Tunnel state message: Disable \n", nvm); -} - -/* - * nss_vxlan_log_mac_add_msg() - * Log NSS VXLAN mac rule add message. - */ -static void nss_vxlan_log_mac_add_msg(struct nss_vxlan_msg *nvm) -{ - struct nss_vxlan_mac_msg *nvmm __maybe_unused = &nvm->msg.mac_add; - nss_vxlan_log_mac_msg(nvmm); -} - -/* - * nss_vxlan_log_mac_del_msg() - * Log NSS VXLAN mac rule del message. - */ -static void nss_vxlan_log_mac_del_msg(struct nss_vxlan_msg *nvm) -{ - struct nss_vxlan_mac_msg *nvmm __maybe_unused = &nvm->msg.mac_del; - nss_vxlan_log_mac_msg(nvmm); -} - -/* - * nss_vxlan_log_verbose() - * Log message contents. - */ -static void nss_vxlan_log_verbose(struct nss_vxlan_msg *nvm) -{ - switch (nvm->cm.type) { - case NSS_VXLAN_MSG_TYPE_TUN_CONFIGURE: - nss_vxlan_log_rule_create_msg(nvm); - break; - - case NSS_VXLAN_MSG_TYPE_TUN_UNCONFIGURE: - nss_vxlan_log_rule_destroy_msg(nvm); - break; - - case NSS_VXLAN_MSG_TYPE_TUN_ENABLE: - nss_vxlan_log_enable_msg(nvm); - break; - - case NSS_VXLAN_MSG_TYPE_TUN_DISABLE: - nss_vxlan_log_disable_msg(nvm); - break; - - case NSS_VXLAN_MSG_TYPE_MAC_ADD: - nss_vxlan_log_mac_add_msg(nvm); - break; - - case NSS_VXLAN_MSG_TYPE_MAC_DEL: - nss_vxlan_log_mac_del_msg(nvm); - break; - - case NSS_VXLAN_MSG_TYPE_STATS_SYNC: - case NSS_VXLAN_MSG_TYPE_MACDB_STATS: - break; - - default: - nss_trace("%px: Invalid message type\n", nvm); - break; - } -} - -/* - * nss_vxlan_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_vxlan_log_tx_msg(struct nss_vxlan_msg *nvm) -{ - if (nvm->cm.type >= NSS_VXLAN_MSG_TYPE_MAX) { - nss_warning("%px: Invalid message type\n", nvm); - return; - } - - nss_info("%px: type[%d]:%s\n", nvm, nvm->cm.type, nss_vxlan_log_message_types_str[nvm->cm.type]); - nss_vxlan_log_verbose(nvm); -} - -/* - * nss_vxlan_log_rx_msg() - * Log messages received from FW. - */ -void nss_vxlan_log_rx_msg(struct nss_vxlan_msg *nvm) -{ - if (nvm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nvm); - return; - } - - if (nvm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nvm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nvm, nvm->cm.type, - nss_vxlan_log_message_types_str[nvm->cm.type], - nvm->cm.response, nss_cmn_response_str[nvm->cm.response]); - goto verbose; - } - - if (nvm->cm.error >= NSS_VXLAN_ERROR_TYPE_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nvm, nvm->cm.type, nss_vxlan_log_message_types_str[nvm->cm.type], - nvm->cm.response, nss_cmn_response_str[nvm->cm.response], - nvm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nvm, nvm->cm.type, nss_vxlan_log_message_types_str[nvm->cm.type], - nvm->cm.response, nss_cmn_response_str[nvm->cm.response], - nvm->cm.error, nss_vxlan_log_error_response_types_str[nvm->cm.error]); - -verbose: - nss_vxlan_log_verbose(nvm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_log.h deleted file mode 100644 index 2db12be9f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_VXLAN_LOG_H__ -#define __NSS_VXLAN_LOG_H__ - -/* - * nss_vxlan_log.h - * NSS VXLAN Log Header File. - */ - -/* - * nss_vxlan_log_tx_msg - * Logs a Vxlan message that is sent to the NSS firmware. - */ -void nss_vxlan_log_tx_msg(struct nss_vxlan_msg *nvm); - -/* - * nss_vxlan_log_rx_msg - * Logs a Vxlan message that is received from the NSS firmware. - */ -void nss_vxlan_log_rx_msg(struct nss_vxlan_msg *nvm); - -#endif /* __NSS_VXLAN_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_stats.c deleted file mode 100644 index 0559d0a2a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_stats.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_stats.h" -#include "nss_vxlan_stats.h" -#include - -#define NSS_VXLAN_STATS_MAX_LINES (NSS_STATS_NODE_MAX + 32) - /**< Maximum number of lines for VXLAN statistics dump. */ -#define NSS_VXLAN_STATS_SIZE_PER_IF (NSS_STATS_MAX_STR_LENGTH * NSS_VXLAN_STATS_MAX_LINES) - /**< Total number of statistics per VXLAN interface. */ - -/* - * nss_vxlan_stats_read() - * Read vxlan node statiistics. - */ -static ssize_t nss_vxlan_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - struct nss_ctx_instance *nss_ctx = nss_vxlan_get_ctx(); - enum nss_dynamic_interface_type type; - ssize_t bytes_read = 0; - size_t len = 0, size; - uint32_t if_num; - char *buf; - - size = NSS_VXLAN_STATS_SIZE_PER_IF; - buf = kzalloc(size, GFP_KERNEL); - if (!buf) { - nss_warning("Could not allocate memory for local statistics buffer\n"); - return 0; - } - - /* - * Common node stats for each VxLAN dynamic interface. - */ - for (if_num = 0; if_num < NSS_MAX_NET_INTERFACES; if_num++) { - if (if_num == NSS_VXLAN_INTERFACE) { - len += scnprintf(buf + len, size - len, "\nBase node if_num:%03u", if_num); - len += scnprintf(buf + len, size - len, "\n-------------------\n"); - len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "vxlan"); - continue; - } - - type = nss_dynamic_interface_get_type(nss_ctx, if_num); - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_INNER: - len += scnprintf(buf + len, size - len, "\nInner if_num:%03u", if_num); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_OUTER: - len += scnprintf(buf + len, size - len, "\nOuter if_num:%03u", if_num); - break; - - default: - continue; - } - - len += scnprintf(buf + len, size - len, "\n-------------------\n"); - len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "vxlan"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len); - kfree(buf); - return bytes_read; -} - -/* - * nss_vxlan_stats_sync() - * Update vxlan common node statistics. - */ -void nss_vxlan_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_vxlan_msg *nvm) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_vxlan_stats_msg *msg_stats = &nvm->msg.stats; - uint64_t *if_stats; - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Update common node stats - */ - if_stats = nss_top->stats_node[nvm->cm.interface]; - if_stats[NSS_STATS_NODE_RX_PKTS] += msg_stats->node_stats.rx_packets; - if_stats[NSS_STATS_NODE_RX_BYTES] += msg_stats->node_stats.rx_bytes; - if_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED] += msg_stats->node_stats.rx_dropped[0]; - if_stats[NSS_STATS_NODE_RX_QUEUE_1_DROPPED] += msg_stats->node_stats.rx_dropped[1]; - if_stats[NSS_STATS_NODE_RX_QUEUE_2_DROPPED] += msg_stats->node_stats.rx_dropped[2]; - if_stats[NSS_STATS_NODE_RX_QUEUE_3_DROPPED] += msg_stats->node_stats.rx_dropped[3]; - - if_stats[NSS_STATS_NODE_TX_PKTS] += msg_stats->node_stats.tx_packets; - if_stats[NSS_STATS_NODE_TX_BYTES] += msg_stats->node_stats.tx_bytes; - - spin_unlock_bh(&nss_top->stats_lock); -} - -/* - * nss_vxlan_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(vxlan) - -/* - * nss_vxlan_stats_dentry_create() - * Create vxlan statistics debug entry. - */ -void nss_vxlan_stats_dentry_create(void) -{ - nss_stats_create_dentry("vxlan", &nss_vxlan_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_stats.h deleted file mode 100644 index b4748f416..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_vxlan_stats.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef _NSS_VXLAN_STATS_H_ -#define _NSS_VXLAN_STATS_H_ - -/* - * nss_vxlan_stats_dentry_create - * Creates vxlan interface statistics debug entry. - */ -void nss_vxlan_stats_dentry_create(void); - -/* - * nss_vxlan_stats_sync - * Update vxlan common node statistics. - */ -void nss_vxlan_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_vxlan_msg *nvm); - -#endif /* _NSS_VXLAN_STATS_H_ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi.c deleted file mode 100644 index 559d947c8..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_wifi_stats.h" -#include "nss_wifi_log.h" - -/* - * nss_wifi_get_context() - * Get NSS context of Wifi. - */ -struct nss_ctx_instance *nss_wifi_get_context() -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; -} - -/* - * nss_wifi_handler() - * Handle NSS -> HLOS messages for wifi - */ -static void nss_wifi_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_wifi_msg *ntm = (struct nss_wifi_msg *)ncm; - void *ctx; - nss_wifi_msg_callback_t cb; - - nss_info("%px: NSS ->HLOS message for wifi\n", nss_ctx); - - BUG_ON(((ncm->interface < NSS_WIFI_INTERFACE0) || (ncm->interface > NSS_WIFI_INTERFACE2))); - - /* - * Trace messages. - */ - nss_wifi_log_rx_msg(ntm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_WIFI_MAX_MSG) { - nss_warning("%px: received invalid message %d for wifi interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_wifi_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Snoop messages for local driver and handle - */ - switch (ntm->cm.type) { - case NSS_WIFI_STATS_MSG: - /* - * To create the old API gmac statistics, we use the new extended GMAC stats. - */ - nss_wifi_stats_sync(nss_ctx, &ntm->msg.statsmsg, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages, wifi sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->wifi_msg_callback; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - nss_info("%px: cb null for wifi interface %d", nss_ctx, ncm->interface); - return; - } - - /* - * Get callback & context - */ - cb = (nss_wifi_msg_callback_t)ncm->cb; - ctx = nss_ctx->subsys_dp_register[ncm->interface].ndev; - - /* - * call wifi msg callback - */ - if (!ctx) { - nss_warning("%px: Event received for wifi interface %d before registration", nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_wifi_tx_msg - * Transmit a wifi message to NSS FW - */ -nss_tx_status_t nss_wifi_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace messages. - */ - nss_wifi_log_tx_msg(msg); - - if (ncm->type > NSS_WIFI_MAX_MSG) { - nss_warning("%px: wifi message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} - -/* - **************************************** - * Register/Unregister/Miscellaneous APIs - **************************************** - */ - -/* - * nss_register_wifi_if() - * Register Wifi with nss driver - */ -struct nss_ctx_instance *nss_register_wifi_if(uint32_t if_num, nss_wifi_callback_t wifi_callback, - nss_wifi_callback_t wifi_ext_callback, - nss_wifi_msg_callback_t event_callback, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - - nss_assert(nss_ctx); - nss_assert((if_num >= NSS_MAX_VIRTUAL_INTERFACES) && (if_num < NSS_MAX_NET_INTERFACES)); - - nss_info("%px: nss_register_wifi_if if_num %d wifictx %px", nss_ctx, if_num, netdev); - - nss_core_register_subsys_dp(nss_ctx, if_num, wifi_callback, wifi_ext_callback, NULL, netdev, features); - - nss_top_main.wifi_msg_callback = event_callback; - - return nss_ctx; -} - -/* - * nss_unregister_wifi_if() - * Unregister wifi with nss driver - */ -void nss_unregister_wifi_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - - nss_assert(nss_ctx); - nss_assert((if_num >= NSS_MAX_VIRTUAL_INTERFACES) && (if_num < NSS_MAX_NET_INTERFACES)); - - nss_ctx->nss_top->wifi_msg_callback = NULL; - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} - -/* - * nss_wifi_register_handler() - * Register handle for notfication messages received on wifi interface - */ -void nss_wifi_register_handler(void ) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - - nss_assert(nss_ctx); - - nss_info("nss_wifi_register_handler"); - - nss_core_register_handler(nss_ctx, NSS_WIFI_INTERFACE0, nss_wifi_handler, NULL); - nss_core_register_handler(nss_ctx, NSS_WIFI_INTERFACE1, nss_wifi_handler, NULL); - nss_core_register_handler(nss_ctx, NSS_WIFI_INTERFACE2, nss_wifi_handler, NULL); - - nss_wifi_stats_dentry_create(); -} - -EXPORT_SYMBOL(nss_wifi_get_context); -EXPORT_SYMBOL(nss_wifi_tx_msg); -EXPORT_SYMBOL(nss_register_wifi_if); -EXPORT_SYMBOL(nss_unregister_wifi_if); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev.c deleted file mode 100644 index bb2723906..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev.c +++ /dev/null @@ -1,338 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_wifi_ext_vdev_stats.h" -#include "nss_wifi_ext_vdev_log.h" - -#define NSS_WIFI_EXT_VDEV_TX_TIMEOUT 3000 /* 3 seconds */ - -/* - * Private data structure - */ -static struct nss_wifi_ext_vdev_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} wifi_ext_vdev_pvt; - -/* - * nss_wifi_ext_vdev_verify_if_num() - * Verify if_num passed to us. - */ -static bool nss_wifi_ext_vdev_verify_if_num(uint32_t if_num) -{ - uint32_t type = nss_dynamic_interface_get_type(nss_wifi_ext_vdev_get_ctx(), if_num); - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS: - case NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_VLAN: - return true; - default: - return false; - } -} - -/* - * nss_wifi_ext_vdev_handler() - * Handle NSS -> HLOS messages for wifi_ext_vdev - */ -static void nss_wifi_ext_vdev_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) -{ - struct nss_wifi_ext_vdev_msg *nwevm = (struct nss_wifi_ext_vdev_msg *)ncm; - void *ctx; - - nss_wifi_ext_vdev_msg_callback_t cb; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - BUG_ON(!nss_wifi_ext_vdev_verify_if_num(ncm->interface)); - - /* - * Trace Messages - */ - nss_wifi_ext_vdev_log_rx_msg(nwevm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_WIFI_EXT_VDEV_MSG_MAX) { - nss_warning("%px: received invalid message %d for WiFi extended VAP interface %d", nss_ctx, ncm->type, ncm->interface); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_wifi_ext_vdev_msg)) { - nss_warning("%px: wifi_ext_vdev message length is invalid: %d", nss_ctx, ncm->len); - return; - } - - /* - * Check messages - */ - switch (nwevm->cm.type) { - case NSS_WIFI_EXT_VDEV_MSG_STATS_SYNC: - nss_wifi_ext_vdev_stats_sync(nss_ctx, &nwevm->msg.stats, ncm->interface); - break; - } - - /* - * Update the callback and app_data for NOTIFY messages - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data; - } - - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * callback - */ - cb = (nss_wifi_ext_vdev_msg_callback_t)ncm->cb; - ctx = (void *)ncm->app_data; - - /* - * call the callback - */ - if (!cb) { - return; - } - - cb(ctx, ncm); -} - -/* - * nss_wifi_ext_vdev_msg_init() - * Initialize wifi message. - */ -void nss_wifi_ext_vdev_msg_init(struct nss_wifi_ext_vdev_msg *nim, uint32_t if_num, - uint32_t type, uint32_t len, - nss_wifi_ext_vdev_msg_callback_t cb, void *app_data) -{ - nss_cmn_msg_init(&nim->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_wifi_ext_vdev_msg_init); - -/* - * nss_wifi_ext_vdev_tx_msg() - * Transmit a wifi vdev message to NSSFW - */ -nss_tx_status_t nss_wifi_ext_vdev_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_ext_vdev_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace Messages - */ - nss_wifi_ext_vdev_log_tx_msg(msg); - - if (ncm->type >= NSS_WIFI_EXT_VDEV_MSG_MAX) { - nss_warning("%px: wifi vdev message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - BUG_ON(!nss_wifi_ext_vdev_verify_if_num(ncm->interface)); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_wifi_ext_vdev_tx_msg); - -/* - * nss_wifi_ext_vdev_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_wifi_ext_vdev_callback(void *app_data, struct nss_cmn_msg *ncm) -{ - nss_wifi_ext_vdev_msg_callback_t callback = (nss_wifi_ext_vdev_msg_callback_t)wifi_ext_vdev_pvt.cb; - void *data = wifi_ext_vdev_pvt.app_data; - - wifi_ext_vdev_pvt.response = NSS_TX_SUCCESS; - wifi_ext_vdev_pvt.cb = NULL; - wifi_ext_vdev_pvt.app_data = NULL; - - if (ncm->response != NSS_CMN_RESPONSE_ACK) { - nss_warning("WiFi extension vap Error response %d\n", ncm->response); - wifi_ext_vdev_pvt.response = NSS_TX_FAILURE; - } - - if (callback) { - callback(data, ncm); - } - complete(&wifi_ext_vdev_pvt.complete); -} - -/* - * nss_wifi_ext_vdev_tx_msg() - * Transmit a WiFi extended virtual interface to NSS firmware synchronously. - */ -nss_tx_status_t nss_wifi_ext_vdev_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_wifi_ext_vdev_msg *nwevm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&wifi_ext_vdev_pvt.sem); - wifi_ext_vdev_pvt.cb = (void *)nwevm->cm.cb; - wifi_ext_vdev_pvt.app_data = (void *)nwevm->cm.app_data; - - nwevm->cm.cb = (nss_ptr_t)nss_wifi_ext_vdev_callback; - nwevm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_wifi_ext_vdev_tx_msg(nss_ctx, nwevm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: wifi_ext_vdev_tx_msg failed\n", nss_ctx); - up(&wifi_ext_vdev_pvt.sem); - return status; - } - - /* - * Wait for the acknowledgement - */ - ret = wait_for_completion_timeout(&wifi_ext_vdev_pvt.complete, msecs_to_jiffies(NSS_WIFI_EXT_VDEV_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: WiFi extended vap msg tx failed due to timeout\n", nss_ctx); - wifi_ext_vdev_pvt.response = NSS_TX_FAILURE; - } - - status = wifi_ext_vdev_pvt.response; - up(&wifi_ext_vdev_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_wifi_ext_vdev_tx_msg_sync); - -/* - * nss_wifi_ext_vdev_tx_buf - * Send data packet for vap processing - */ -nss_tx_status_t nss_wifi_ext_vdev_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *skb, uint32_t if_num) -{ - BUG_ON(!nss_wifi_ext_vdev_verify_if_num(if_num)); - - return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_wifi_ext_vdev_tx_buf); - -/* - * nss_wifi_ext_vdev_set_next_hop() - * Set the WiFI extended vap next hop. - */ -nss_tx_status_t nss_wifi_ext_vdev_set_next_hop(struct nss_ctx_instance *ctx, int if_num, int next_hop) -{ - struct nss_wifi_ext_vdev_msg *nwevm = kzalloc(sizeof(struct nss_wifi_ext_vdev_msg), GFP_KERNEL); - struct nss_wifi_ext_vdev_set_next_hop_msg *nhm = NULL; - nss_tx_status_t status; - - if (!nwevm) { - nss_warning("%px: Unable to allocate next hop message", ctx); - return NSS_TX_FAILURE; - } - - nhm = &nwevm->msg.wnhm; - - nhm->if_num = next_hop; - nss_wifi_ext_vdev_msg_init(nwevm, if_num, NSS_WIFI_EXT_VDEV_SET_NEXT_HOP, - sizeof(struct nss_wifi_ext_vdev_set_next_hop_msg), NULL, NULL); - - status = nss_wifi_ext_vdev_tx_msg(ctx, nwevm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to send next hop message", ctx); - } - - kfree(nwevm); - return status; -} -EXPORT_SYMBOL(nss_wifi_ext_vdev_set_next_hop); - -/* - * nss_get_wifi_ext_vdev_ext_context() - * Return the core ctx which the feature is on - */ -struct nss_ctx_instance *nss_wifi_ext_vdev_get_ctx(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; -} -EXPORT_SYMBOL(nss_wifi_ext_vdev_get_ctx); - -/* - * nss_wifi_ext_vdev_register_if() - */ -struct nss_ctx_instance *nss_wifi_ext_vdev_register_if(uint32_t if_num, - nss_wifi_ext_vdev_data_callback_t data_callback, - nss_wifi_ext_vdev_ext_data_callback_t ext_callback, - nss_wifi_ext_vdev_msg_callback_t event_callback, - struct net_device *netdev, - uint32_t features, void *app_data) -{ - struct nss_ctx_instance *nss_ctx = nss_wifi_ext_vdev_get_ctx(); - - BUG_ON(!nss_wifi_ext_vdev_verify_if_num(if_num)); - - nss_core_register_subsys_dp(nss_ctx, if_num, data_callback, ext_callback, app_data, netdev, features); - - nss_core_register_msg_handler(nss_ctx, if_num, event_callback); - - nss_core_register_handler(nss_ctx, if_num, nss_wifi_ext_vdev_handler, app_data); - - nss_wifi_ext_vdev_stats_register(if_num, netdev); - - return nss_ctx; -} -EXPORT_SYMBOL(nss_wifi_ext_vdev_register_if); - -/* - * nss_wifi_ext_vdev_unregister_if() - */ -bool nss_wifi_ext_vdev_unregister_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_wifi_ext_vdev_get_ctx(); - struct net_device *netdev; - - BUG_ON(!nss_wifi_ext_vdev_verify_if_num(if_num)); - - nss_assert(nss_ctx); - - netdev = nss_cmn_get_interface_dev(nss_ctx, if_num); - if (!netdev) { - nss_warning("%px: Unable to find net device for the interface %d\n", nss_ctx, if_num); - return false; - } - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - nss_core_unregister_msg_handler(nss_ctx, if_num); - - nss_core_unregister_handler(nss_ctx, if_num); - - nss_wifi_ext_vdev_stats_unregister(if_num, netdev); - return true; -} -EXPORT_SYMBOL(nss_wifi_ext_vdev_unregister_if); - -/* - * nss_wifi_ext_vdev_register_handler() - * Register debugfs handler received on base interface - */ -void nss_wifi_ext_vdev_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = nss_wifi_ext_vdev_get_ctx(); - - nss_info("nss_wifi_ext_vdev_handler"); - sema_init(&wifi_ext_vdev_pvt.sem, 1); - init_completion(&wifi_ext_vdev_pvt.complete); - nss_core_register_handler(nss_ctx, NSS_WIFI_EXT_VDEV_INTERFACE, nss_wifi_ext_vdev_handler, NULL); - nss_wifi_ext_vdev_stats_dentry_create(); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.c deleted file mode 100644 index 7fd188860..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_wifi_ext_vdev_log.c - * NSS WiFi extended VAP logger file. - */ - -#include "nss_core.h" - -#define NSS_WIFI_EXT_VDEV_LOG_MESSAGE_TYPE_INDEX(type) ((type) - NSS_IF_MAX_MSG_TYPES) - -/* - * nss_wifi_ext_vdev_log_message_types_str - * NSS WiFi extended VAP message strings - */ -static int8_t *nss_wifi_ext_vdev_log_message_types_str[NSS_WIFI_EXT_VDEV_MSG_MAX] __maybe_unused = { - "WiFi Common I/F Message", - "WiFi Extendev VAP configure", - "WiFi Extendev VAP configure wds", - "WiFi Extendev VAP configure next hop", - "WiFi Extendev VAP stats", - "WiFi Extended VAP configure VLAN" -}; - -/* - * nss_wifi_ext_vdev_log_configure_msg() - * Log NSS WiFi extended vap configure message. - */ -static void nss_wifi_ext_vdev_log_configure_if_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - struct nss_wifi_ext_vdev_configure_if_msg *cmsg __maybe_unused = &nwevm->msg.cmsg; - nss_trace("%px: WiFi extended VAP configure message \n" - "Mac address: %pM\n" - "Radio interface num: %d\n" - "Parent VAP interface num: %d\n", - cmsg, cmsg->mac_addr, cmsg->radio_ifnum, - cmsg->pvap_ifnum); - -} - -/* - * nss_wifi_ext_vdev_log_wds_msg() - * Log NSS WiFi extended vap wds message. - */ -static void nss_wifi_ext_vdev_log_wds_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - struct nss_wifi_ext_vdev_wds_msg *wmsg __maybe_unused = &nwevm->msg.wmsg; - nss_trace("%px: NSS WiFi extended VAP wds message: \n" - "WDS sta ID: %d\n" - "WDS sta macaddr: %pM\n", - wmsg, wmsg->wds_peer_id, - wmsg->mac_addr); -} - -/* - * nss_wifi_ext_vdev_set_nxt_hop_msg() - * Set the next hop message. - */ -static void nss_wifi_ext_vdev_set_nxt_hop_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - struct nss_wifi_ext_vdev_set_next_hop_msg *wnhm __maybe_unused = &nwevm->msg.wnhm; - nss_trace("%px: NSS WiFi extended vap set next hop message: \n" - "Next hop if num: %d\n", - wnhm, wnhm->if_num); - -} - -/* - * nss_wifi_ext_vdev_linkup_msg() - * Log NSS linkup message. - */ -static void nss_wifi_ext_vdev_linkup_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - union nss_if_msgs *if_msg __maybe_unused = &nwevm->msg.if_msg; - nss_trace("%px: NSS WiFi ext linkup message\n", if_msg); -} - -/* - * nss_wifi_ext_vdev_linkdown_msg() - * Log NSS linkdown message. - */ -static void nss_wifi_ext_vdev_linkdown_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - union nss_if_msgs *if_msg __maybe_unused = &nwevm->msg.if_msg; - nss_trace("%px: NSS WiFi ext linkdown message\n", if_msg); -} - -/* - * nss_wifi_ext_vdev_macaddr_set_msg() - * Set/Change the mac address - */ -static void nss_wifi_ext_vdev_macaddr_set_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - union nss_if_msgs *if_msg = &nwevm->msg.if_msg; - struct nss_if_mac_address_set *nimas __maybe_unused = &if_msg->mac_address_set; - nss_trace("%px: NSS WiFi ext change mac addr: \n" - "mac addr %pM\n", - nimas, nimas->mac_addr); -} - -/* - * nss_wifi_ext_vdev_log_vlan_msg() - * Configure vlan message. - */ -static void nss_wifi_ext_vdev_log_vlan_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - struct nss_wifi_ext_vdev_vlan_msg *vmsg __maybe_unused = &nwevm->msg.vmsg; - nss_trace("%px: NSS WiFi extended VAP vlan message: \n" - "vlan ID %hu\n", - vmsg, vmsg->vlan_id); -} - -/* - * nss_wifi_ext_vdev_log_verbose() - * Log message contents. - */ -static void nss_wifi_ext_vdev_log_verbose(struct nss_wifi_ext_vdev_msg *nwevm) -{ - switch (nwevm->cm.type) { - case NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_IF: - nss_wifi_ext_vdev_log_configure_if_msg(nwevm); - break; - - case NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_WDS : - nss_wifi_ext_vdev_log_wds_msg(nwevm); - break; - - case NSS_WIFI_EXT_VDEV_SET_NEXT_HOP: - nss_wifi_ext_vdev_set_nxt_hop_msg(nwevm); - break; - - case NSS_WIFI_EXT_VDEV_MSG_STATS_SYNC: - break; - - case NSS_IF_OPEN: - nss_wifi_ext_vdev_linkup_msg(nwevm); - break; - - case NSS_IF_CLOSE: - nss_wifi_ext_vdev_linkdown_msg(nwevm); - break; - - case NSS_IF_MAC_ADDR_SET: - nss_wifi_ext_vdev_macaddr_set_msg(nwevm); - break; - - case NSS_WIFI_EXT_VDEV_MSG_CONFIGURE_VLAN: - nss_wifi_ext_vdev_log_vlan_msg(nwevm); - break; - - default: - nss_trace("%px: Invalid message type\n", nwevm); - break; - } -} - -/* - * nss_wifi_ext_vdev_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_wifi_ext_vdev_log_tx_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - uint32_t type_idx = 0; - if (nwevm->cm.type >= NSS_WIFI_EXT_VDEV_MSG_MAX) { - nss_warning("%px: Invalid message type\n", nwevm); - return; - } - - type_idx = (nwevm->cm.type > NSS_IF_MAX_MSG_TYPES) ? - (NSS_WIFI_EXT_VDEV_LOG_MESSAGE_TYPE_INDEX(nwevm->cm.type)) : 0; - - nss_info("%px: type[%d]:%s\n", nwevm, nwevm->cm.type, nss_wifi_ext_vdev_log_message_types_str[type_idx]); - nss_wifi_ext_vdev_log_verbose(nwevm); -} - -/* - * nss_wifi_ext_vdev_log_rx_msg() - * Log messages received from FW. - */ -void nss_wifi_ext_vdev_log_rx_msg(struct nss_wifi_ext_vdev_msg *nwevm) -{ - uint32_t type_idx = 0; - if (nwevm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nwevm); - return; - } - - type_idx = (nwevm->cm.type > NSS_IF_MAX_MSG_TYPES) ? - (NSS_WIFI_EXT_VDEV_LOG_MESSAGE_TYPE_INDEX(nwevm->cm.type)) : 0; - - if (nwevm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nwevm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nwevm, nwevm->cm.type, - nss_wifi_ext_vdev_log_message_types_str[type_idx], - nwevm->cm.response, nss_cmn_response_str[nwevm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - nwevm, nwevm->cm.type, nss_wifi_ext_vdev_log_message_types_str[type_idx], - nwevm->cm.response, nss_cmn_response_str[nwevm->cm.response]); - -verbose: - nss_wifi_ext_vdev_log_verbose(nwevm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.h deleted file mode 100644 index a5c851055..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_log.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_WIFI_EXT_VDEV_LOG_H -#define __NSS_WIFI_EXT_VDEV_LOG_H - -/* - * nss_wifi_ext_vdev_log_tx_msg - * Logs a wifi_ext_vdev message that is sent to the NSS firmware. - */ -void nss_wifi_ext_vdev_log_tx_msg(struct nss_wifi_ext_vdev_msg *nwevm); - -/* - * nss_wifi_ext_vdev_log_rx_msg - * Logs a wifi_ext_vdev message that is received from the NSS firmware. - */ -void nss_wifi_ext_vdev_log_rx_msg(struct nss_wifi_ext_vdev_msg *nwevm); - -#endif /* __NSS_WIFI_EXT_VDEV_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_stats.c deleted file mode 100644 index 493ca84b0..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_stats.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_wifi_ext_vdev_stats.h" - -DEFINE_SPINLOCK(nss_wifi_ext_vdev_debug_lock); -struct nss_wifi_ext_vdev_debug nss_wifi_ext_vdev_debug_stats[NSS_WIFI_EXT_VDEV_MAX]; - -/* - * nss_wifi_ext_vdev_debug_str - * WiFi extended VAP statistics strings. - */ -struct nss_stats_info nss_wifi_ext_vdev_debug_str[NSS_WIFI_EXT_VDEV_STATS_MAX] = { - {"node_rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"node_rx_bytes" , NSS_STATS_TYPE_COMMON}, - {"node_tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"node_tx_bytes" , NSS_STATS_TYPE_COMMON}, - {"node_rx_dropped" , NSS_STATS_TYPE_DROP}, - {"mc_count" , NSS_STATS_TYPE_SPECIAL}, - {"uc_count" , NSS_STATS_TYPE_SPECIAL}, - {"nxt_hop_drop" , NSS_STATS_TYPE_DROP}, -}; - -/* - * WiFi extended vdev statistics APIs - */ - -/* - * nss_wifi_ext_vdev_stats_register() - * Register debug statistic for WiFi extended VAP. - */ -void nss_wifi_ext_vdev_stats_register(uint32_t if_num, struct net_device *netdev) -{ - int i; - - spin_lock_bh(&nss_wifi_ext_vdev_debug_lock); - for (i = 0; i < NSS_WIFI_EXT_VDEV_MAX; i++) { - if (!nss_wifi_ext_vdev_debug_stats[i].valid) { - nss_wifi_ext_vdev_debug_stats[i].valid = true; - nss_wifi_ext_vdev_debug_stats[i].if_num = if_num; - nss_wifi_ext_vdev_debug_stats[i].if_index = netdev->ifindex; - break; - } - } - - spin_unlock_bh(&nss_wifi_ext_vdev_debug_lock); -} - -/* - * nss_wifi_ext_vdev_stats_unregister() - * Register debug statistic for WiFi extended vap. - */ -void nss_wifi_ext_vdev_stats_unregister(uint32_t if_num, struct net_device *netdev) -{ - int i; - - spin_lock_bh(&nss_wifi_ext_vdev_debug_lock); - for (i = 0; i < NSS_WIFI_EXT_VDEV_MAX; i++) { - if (nss_wifi_ext_vdev_debug_stats[i].if_num == if_num) { - memset(&nss_wifi_ext_vdev_debug_stats[i], 0, - sizeof(struct nss_wifi_ext_vdev_debug)); - break; - } - } - spin_unlock_bh(&nss_wifi_ext_vdev_debug_lock); -} - -/* - * nss_wifi_ext_vdev_stats_sync() - * Sync function for WiFi extendev vap statistics. - */ -void nss_wifi_ext_vdev_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_wifi_ext_vdev_stats *stats_msg, - uint16_t if_num) -{ - int i; - struct nss_wifi_ext_vdev_debug *s = NULL; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - spin_lock_bh(&nss_wifi_ext_vdev_debug_lock); - for (i = 0; i < NSS_WIFI_EXT_VDEV_MAX; i++) { - if (nss_wifi_ext_vdev_debug_stats[i].if_num == if_num) { - s = &nss_wifi_ext_vdev_debug_stats[i]; - break; - } - } - - if (!s) { - spin_unlock_bh(&nss_wifi_ext_vdev_debug_lock); - nss_warning("%px: Interface:%u not found", nss_ctx, if_num); - return; - } - - s->stats[NSS_WIFI_EXT_VDEV_STATS_NODE_RX_PKTS ] += stats_msg->node_stats.rx_packets; - s->stats[NSS_WIFI_EXT_VDEV_STATS_NODE_RX_BYTES] += stats_msg->node_stats.rx_bytes; - s->stats[NSS_WIFI_EXT_VDEV_STATS_NODE_TX_PKTS] += stats_msg->node_stats.tx_packets; - s->stats[NSS_WIFI_EXT_VDEV_STATS_NODE_TX_BYTES] += stats_msg->node_stats.tx_bytes; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - s->stats[NSS_WIFI_EXT_VDEV_STATS_NODE_TOTAL_DROPPED] += stats_msg->node_stats.rx_dropped[i]; - } - s->stats[NSS_WIFI_EXT_VDEV_STATS_MULTICAST_COUNT] += stats_msg->mc_count; - s->stats[NSS_WIFI_EXT_VDEV_STATS_UNICAST_COUNT] += stats_msg->node_stats.rx_packets - stats_msg->mc_count; - s->stats[NSS_WIFI_EXT_VDEV_STATS_NEXT_HOP_DROP_COUNT] += stats_msg->nxt_hop_drp; - spin_unlock_bh(&nss_wifi_ext_vdev_debug_lock); -} - -/* - * nss_wifi_ext_vdev_debug_get() - * Get WiFi extendev vap debug statitics. - */ -static void nss_wifi_ext_vdev_debug_get(struct nss_wifi_ext_vdev_debug *stats) -{ - int i; - - if (!stats) { - nss_warning("No memory to copy WiFi extended VAP stats"); - return; - } - - spin_lock_bh(&nss_wifi_ext_vdev_debug_lock); - for (i = 0; i < NSS_WIFI_EXT_VDEV_MAX; i++) { - if (nss_wifi_ext_vdev_debug_stats[i].valid) { - memcpy(stats, &nss_wifi_ext_vdev_debug_stats[i], - sizeof(struct nss_wifi_ext_vdev_debug)); - stats++; - } - } - spin_unlock_bh(&nss_wifi_ext_vdev_debug_lock); -} - -/* - * nss_wifi_ext_vdev_read() - * Read WiFi extended VAP statistics - */ -static ssize_t nss_wifi_ext_vdev_stats_read(struct file *fp, char __user *ubuf, - size_t sz, loff_t *ppos) -{ - uint32_t max_output_lines = 2 /* header and footer of the interface stats*/ - + (NSS_WIFI_EXT_VDEV_STATS_MAX * (NSS_WIFI_EXT_VDEV_MAX + 2)) /* Interface stats */ - + 2; - - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - size_t bytes_read = 0; - struct net_device *dev; - int id; - struct nss_wifi_ext_vdev_debug *wifi_ext_vdev_stats = NULL; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - wifi_ext_vdev_stats = kzalloc((sizeof(struct nss_wifi_ext_vdev_debug) * NSS_WIFI_EXT_VDEV_MAX), GFP_KERNEL); - if (unlikely(wifi_ext_vdev_stats == NULL)) { - nss_warning("Could not allocate memory for populating stats"); - kfree(lbuf); - return 0; - } - - /* - * Get all stats - */ - nss_wifi_ext_vdev_debug_get(wifi_ext_vdev_stats); - - /* - * WiFi extended vap stats. - */ - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "WiFi extended VAP stats", NSS_STATS_SINGLE_CORE); - - for (id = 0; id < NSS_WIFI_EXT_VDEV_MAX; id++) { - if (!wifi_ext_vdev_stats[id].valid) { - continue; - } - - dev = dev_get_by_index(&init_net, wifi_ext_vdev_stats[id].if_index); - if (likely(dev)) { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "%d. nss interface id=%d, netdevice=%s\n", - id, wifi_ext_vdev_stats[id].if_num, - dev->name); - dev_put(dev); - } else { - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, - "%d. nss interface id=%d\n", id, - wifi_ext_vdev_stats[id].if_num); - } - - size_wr += nss_stats_print("vdev", "debug", id - , nss_wifi_ext_vdev_debug_str - , wifi_ext_vdev_stats[id].stats - , NSS_WIFI_EXT_VDEV_STATS_MAX - , lbuf, size_wr, size_al); - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - - kfree(wifi_ext_vdev_stats); - kfree(lbuf); - return bytes_read; -} - -/* - * nss_wifi_ext_vdev_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_ext_vdev); - -/* - * nss_wifi_ext_vdev_dentry_create() - * Create wifi extension vap statistics debug entry. - */ -void nss_wifi_ext_vdev_stats_dentry_create(void) -{ - nss_stats_create_dentry("wifi_ext_vdev", &nss_wifi_ext_vdev_stats_ops); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_stats.h deleted file mode 100644 index 589e2c09e..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_ext_vdev_stats.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_WIFI_EXT_VDEV_STATS_H -#define __NSS_WIFI_EXT_VDEV_STATS_H - -/* - * WiFi extendev vap debug statistic counters. - */ -enum nss_wifi_ext_vdev_stats_types { - NSS_WIFI_EXT_VDEV_STATS_NODE_RX_PKTS, - NSS_WIFI_EXT_VDEV_STATS_NODE_RX_BYTES, - NSS_WIFI_EXT_VDEV_STATS_NODE_TX_PKTS, - NSS_WIFI_EXT_VDEV_STATS_NODE_TX_BYTES, - NSS_WIFI_EXT_VDEV_STATS_NODE_TOTAL_DROPPED, - NSS_WIFI_EXT_VDEV_STATS_MULTICAST_COUNT, - NSS_WIFI_EXT_VDEV_STATS_UNICAST_COUNT, - NSS_WIFI_EXT_VDEV_STATS_NEXT_HOP_DROP_COUNT, - NSS_WIFI_EXT_VDEV_STATS_MAX, -}; - -/* - * WiFi extendev vap debug statistics. - */ -struct nss_wifi_ext_vdev_debug { - uint64_t stats[NSS_WIFI_EXT_VDEV_STATS_MAX]; - int32_t if_index; /**< Netdevice's ifindex. */ - uint32_t if_num; /**< NSS interface number. */ - bool valid; /**< Is node valid ? */ -}; - -/* - * Data structures to store WiFi extended VAP debug stats. - */ -extern struct nss_wifi_ext_vdev_debug nss_wifi_ext_vdev_debug_stats[NSS_WIFI_EXT_VDEV_MAX]; - -/* - * WiFi extendev vap statistics APIs - */ -extern void nss_wifi_ext_vdev_stats_register(uint32_t if_num, struct net_device *netdev); -extern void nss_wifi_ext_vdev_stats_unregister(uint32_t if_num, struct net_device *netdev); -extern void nss_wifi_ext_vdev_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_wifi_ext_vdev_stats *stats_msg, uint16_t if_num); -extern void nss_wifi_ext_vdev_stats_dentry_create(void); - -#endif /* __NSS_WIFI_EXT_VDEV_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_log.c deleted file mode 100644 index 4d6b4c52d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_log.c +++ /dev/null @@ -1,806 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_wifi_log.c - * NSS WIFI logger file. - */ - -#include "nss_core.h" - -/* - * nss_wifi_log_message_types_str - * WIFI message strings - */ -static int8_t *nss_wifi_log_message_types_str[NSS_WIFI_MAX_MSG] __maybe_unused = { - "WIFI INIT MSG", - "WIFI POST RECV MSG", - "WIFI HTT INIT MSG", - "WIFI TX INIT MSG", - "WIFI RAW SEND MSG", - "WIFI MGMT SEND MSG", - "WIFI WDS PEER ADD MSG", - "WIFI WDS PEER DEL MSG", - "WIFI STOP MSG", - "WIFI RESET MSG", - "WIFI STATS MSG", - "WIFI PEER FREELIST APPEND MSG", - "WIFI RX REORDER ARRAY FREELIST APPEND MSG", - "WIFI SEND PEER MEMORY REQUEST MSG", - "WIFI SEND RRA MEMORY REQUEST MSG", - "WIFI FW STATS MSG", - "WIFI MONITOR FILTER SET MSG", - "WIFI PEER BS STATE MSG", - "WIFI MSDU TTL SET MSG", - "WIFI RX VOW EXTSTATS SET MSG", - "WIFI PKTLOG CFG MSG", - "WIFI ENABLE PERPKT TXSTATS MSG", - "WIFI IGMP MLD TOS OVERRIDE MSG", - "WIFI OL STATS CFG MSG", - "WIFI OL STATS MSG", - "WIFI TX QUEUE CFG MSG", - "WIFI TX MIN THRESHOLD CFG MSG", - "WIFI DBDC PROCESS ENABLE MSG", - "WIFI PRIMARY RADIO SET MSG", - "WIFI FORCE CLIENT MCAST TRAFFIC SET MSG", - "WIFI STORE OTHER PDEV STAVAP MSG", - "WIFI STA KICKOUT MSG", - "WIFI WNM PEER RX ACTIVITY MSG", - "WIFI PEER STATS MSG", - "WIFI WDS VENDOR MSG", - "WIFI TX CAPTURE SET MSG", - "WIFI ALWAYS PRIMARY SET MSG", - "WIFI FLUSH HTT CMD MSG", - "WIFI CMD MSG", - "WIFI ENABLE OL STATSV2 MSG", - "WIFI OL PEER TIME MSG", -}; - -/* - * nss_wifi_log_error_response_types_str - * Strings for error types for WIFI messages - */ -static int8_t *nss_wifi_log_error_response_types_str[NSS_WIFI_EMSG_MAX] __maybe_unused = { - "WIFI NO ERROR", - "WIFI UNKNOWN MSG", - "WIFI MGMT DLEN", - "WIFI MGMT SEND", - "WIFI CE INIT FAIL", - "WIFI PDEV INIT FAIL", - "WIFI HTT INIT FAIL", - "WIFI PEER ADD", - "WIFI WIFI START FAIL", - "WIFI STATE NOT RESET", - "WIFI STATE NOT INIT DONE", - "WIFI STATE NULL CE HANDLE", - "WIFI STATE NOT CE READY", - "WIFI STATE NOT HTT READY", - "WIFI FW STATS DLEN", - "WIFI FW STATS SEND", - "WIFI STATE TX INIT FAILED", - "WIFI IGMP MLD TOS OVERRIDE CFG", - "WIFI PDEV INVALID", - "WIFI OTHER PDEV STAVAP INVALID", - "WIFI HTT SEND FAIL", - "WIFI CE RING INIT", - "WIFI NOTIFY CB", - "WIFI PEERID INVALID", - "WIFI PEER INVALID", - "WIFI UNKNOWN CMD" -}; - -/* - * nss_wifi_log_init_msg() - * Log NSS WIFI Init message. - */ -static void nss_wifi_log_init_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_init_msg *nwim __maybe_unused = &ncm->msg.initmsg; - - nss_trace("%px: NSS WIFI Init Message:\n" - "WIFI Radio ID: %d\n" - "WIFI PCI Memory Address: %x\n" - "WIFI Target Type: %d\n" - "WIFI MU MIMO Enhancement Enable Flag: %d\n" - "WIFI Transmit Copy Engine Source Ring:\n" - "\tNumber of Entries: %d\n" - "\tNumber of Entries Mask: %x\n" - "\tInitial Software Index: %d\n" - "\tInitial Write Index: %d\n" - "\tInitial Hardware Index: %d\n" - "\tPhysical Address: %x\n" - "\tVirtual Address: %x\n" - "WIFI Transmit Copy Engine Dest Ring:\n" - "\tNumber of Entries: %d\n" - "\tNumber of Entries Mask: %x\n" - "\tInitial Software Index: %d\n" - "\tInitial Write Index: %d\n" - "\tInitial Hardware Index: %d\n" - "\tPhysical Address: %x\n" - "\tVirtual Address: %x\n" - "WIFI Transmit Control Address of PCIe Bar: %x\n" - "WIFI Receive Copy Engine Source Ring:\n" - "\tNumber of Entries: %d\n" - "\tNumber of Entries Mask: %x\n" - "\tInitial Software Index: %d\n" - "\tInitial Write Index: %d\n" - "\tInitial Hardware Index: %d\n" - "\tPhysical Address: %x\n" - "\tVirtual Address: %x\n" - "WIFI Receive Copy Engine Dest Ring:\n" - "\tNumber of Entries: %d\n" - "\tNumber of Entries Mask: %x\n" - "\tInitial Software Index: %d\n" - "\tInitial Write Index: %d\n" - "\tInitial Hardware Index: %d\n" - "\tPhysical Address: %x\n" - "\tVirtual Address: %x\n" - "WIFI Receive Control Address of PCIe Bar: %x\n" - "WIFI Bypass Network Process: %d", - nwim, nwim->radio_id, - nwim->pci_mem, nwim->target_type, - nwim->mu_mimo_enhancement_en, nwim->ce_tx_state.src_ring.nentries, - nwim->ce_tx_state.src_ring.nentries_mask, nwim->ce_tx_state.src_ring.sw_index, - nwim->ce_tx_state.src_ring.write_index, nwim->ce_tx_state.src_ring.hw_index, - nwim->ce_tx_state.src_ring.base_addr_CE_space, nwim->ce_tx_state.src_ring.base_addr_owner_space, - nwim->ce_tx_state.dest_ring.nentries, nwim->ce_tx_state.dest_ring.nentries_mask, - nwim->ce_tx_state.dest_ring.sw_index, nwim->ce_tx_state.dest_ring.write_index, - nwim->ce_tx_state.dest_ring.hw_index, nwim->ce_tx_state.dest_ring.base_addr_CE_space, - nwim->ce_tx_state.dest_ring.base_addr_owner_space, nwim->ce_tx_state.ctrl_addr, - nwim->ce_rx_state.src_ring.nentries, nwim->ce_rx_state.src_ring.nentries_mask, - nwim->ce_rx_state.src_ring.sw_index, nwim->ce_rx_state.src_ring.write_index, - nwim->ce_rx_state.src_ring.hw_index, nwim->ce_rx_state.src_ring.base_addr_CE_space, - nwim->ce_rx_state.src_ring.base_addr_owner_space, nwim->ce_rx_state.dest_ring.nentries, - nwim->ce_rx_state.dest_ring.nentries_mask, nwim->ce_rx_state.dest_ring.sw_index, - nwim->ce_rx_state.dest_ring.write_index, nwim->ce_rx_state.dest_ring.hw_index, - nwim->ce_rx_state.dest_ring.base_addr_CE_space, nwim->ce_rx_state.dest_ring.base_addr_owner_space, - nwim->ce_rx_state.ctrl_addr, nwim->bypass_nw_process); -} - -/* - * nss_wifi_log_stop_msg() - * Log NSS WIFI Init message. - */ -static void nss_wifi_log_stop_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_stop_msg *nwsm __maybe_unused = &ncm->msg.stopmsg; - nss_trace("%px: NSS WIFI Init Message:\n" - "WIFI Radio ID: %d\n", - nwsm, nwsm->radio_id); -} - -/* - * nss_wifi_log_reset_msg() - * Log NSS WIFI Init message. - */ -static void nss_wifi_log_reset_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_reset_msg *nwrm __maybe_unused = &ncm->msg.resetmsg; - nss_trace("%px: NSS WIFI Init Message:\n" - "WIFI Radio ID: %d\n", - nwrm, nwrm->radio_id); -} - -/* - * nss_wifi_log_htt_init_msg() - * Log NSS WIFI HTT Init message. - */ -static void nss_wifi_log_htt_init_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_htt_init_msg *nwim __maybe_unused = &ncm->msg.httinitmsg; - nss_trace("%px: NSS WIFI HTT Init Message:\n" - "WIFI Radio ID: %d\n" - "WIFI Ring Size: %d\n" - "WIFI Fill Level: %d\n" - "WIFI MAC Hardware Ring Phy Address: %x\n" - "WIFI MAC Hardware Ring Virtual Address: %x\n" - "WIFI Hardware Ring Index Phy Address: %x\n" - "WIFI Hardware Ring Index Virtual Address: %x\n", - nwim, nwim->radio_id, - nwim->ringsize, nwim->fill_level, - nwim->paddrs_ringptr, nwim->paddrs_ringpaddr, - nwim->alloc_idx_paddr, nwim->alloc_idx_vaddr); -} - -/* - * nss_wifi_log_tx_init_msg() - * Log NSS TX HTT Init message. - */ -static void nss_wifi_log_tx_init_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_tx_init_msg *nwim __maybe_unused = &ncm->msg.pdevtxinitmsg; - nss_trace("%px: NSS WIFI HTT Init Message:\n" - "WIFI Radio ID: %d\n" - "WIFI Number of Descriptor Pools Allocated: %d\n" - "WIFI TX Descriptor Array: %x\n" - "WIFI MAC extenstion descriptor Address: %x\n" - "WIFI WLAN MAC extenstion descriptor size: %d\n" - "WIFI HTT Tx descriptor memory start virtual address: %x\n" - "WIFI HTT Tx descriptor memory base virtual address: %x\n" - "WIFI HTT Tx descriptor memory offset: %x\n" - "WIFI Firmware shared TID map: %x\n", - nwim, nwim->radio_id, - nwim->desc_pool_size, nwim->tx_desc_array, - nwim->wlanextdesc_addr, nwim->wlanextdesc_size, - nwim->htt_tx_desc_base_vaddr, nwim->htt_tx_desc_base_paddr, - nwim->htt_tx_desc_offset, nwim->pmap_addr); -} - -/* - * nss_wifi_log_rawsend_msg() - * Log NSS WIFI RAW Send message. - */ -static void nss_wifi_log_rawsend_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_rawsend_msg *nwrm __maybe_unused = &ncm->msg.rawmsg; - nss_trace("%px: NSS WIFI RAW Send Message:\n" - "WIFI Radio ID: %d\n" - "WIFI Size of Raw Data: %d\n" - "WIFI Raw Data: %px", - nwrm, nwrm->radio_id, - nwrm->len, nwrm->array); -} - -/* - * nss_wifi_log_mgmtsend_msg() - * Log NSS WIFI Management Send message. - */ -static void nss_wifi_log_mgmtsend_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_mgmtsend_msg *nwmm __maybe_unused = &ncm->msg.mgmtmsg; - nss_trace("%px: NSS WIFI Management Send Message:\n" - "WIFI Descriptor ID: %d\n" - "WIFI Size of Management Data: %d\n" - "WIFI Management Data: %px", - nwmm, nwmm->desc_id, - nwmm->len, nwmm->array); -} - -/* - * nss_wifi_log_wds_peer_msg() - * Log NSS WIFI WDS Peer message. - */ -static void nss_wifi_log_wds_peer_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_wds_peer_msg *nwmm __maybe_unused = &ncm->msg.pdevwdspeermsg; - nss_trace("%px: NSS WIFI WDS Peer Message:\n" - "WIFI Dest MAC: %pM\n" - "WIFI Peer MAC: %pM\n", - nwmm, nwmm->dest_mac, - nwmm->peer_mac); -} - -/* - * nss_wifi_log_peer_freelist_append_msg() - * Log NSS WIFI Create/Append Freelist message - */ -static void nss_wifi_log_peer_freelist_append_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_peer_freelist_append_msg *nwpm __maybe_unused = &ncm->msg.peer_freelist_append; - nss_trace("%px: NSS WIFI Create/Append Freelist Message:\n" - "WIFI Starting Address of Peer Freelist Pool: %x\n" - "WIFI Length of freelist pool: %d\n" - "WIFI Number of Peers supported in freelist pool: %d\n", - nwpm, nwpm->addr, - nwpm->length, nwpm->num_peers); -} - -/* - * nss_wifi_log_rx_reorder_array_freelist_append_msg() - * Log NSS WIFI RX Reorder Array Freelist message - */ -static void nss_wifi_log_rx_reorder_array_freelist_append_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_rx_reorder_array_freelist_append_msg *nwpm __maybe_unused = &ncm->msg.rx_reorder_array_freelist_append; - nss_trace("%px: NSS WIFI RX Reorder Array Freelist Message:\n" - "WIFI Starting Address of TIDQ Freelist Pool: %x\n" - "WIFI Length of TIDQ freelist pool: %d\n" - "WIFI Number of Rx reorder array entries supported in freelist pool: %d\n", - nwpm, nwpm->addr, - nwpm->length, nwpm->num_rra); -} - -/* - * nss_wifi_log_set_filter_msg() - * Log NSS WIFI Set Filter message - */ -static void nss_wifi_log_set_filter_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_monitor_set_filter_msg *nwfm __maybe_unused = &ncm->msg.monitor_filter_msg; - nss_trace("%px: NSS WIFI Set Filter Message:\n" - "WIFI Filter Type: %dn", - nwfm, nwfm->filter_type); -} - -/* - * nss_wifi_log_peer_activity_msg() - * Log NSS WIFI Get Active Peer for Radio message - */ -static void nss_wifi_log_peer_activity_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_bs_peer_activity *nwpm __maybe_unused = &ncm->msg.peer_activity; - nss_trace("%px: NSS WIFI Get Active Peer Message:\n" - "WIFI Number of Entries in Peer ID Array: %d\n" - "WIFI PEER ID: %d\n", - nwpm, nwpm->nentries, - nwpm->peer_id[0]); -} - -/* - * nss_wifi_rx_vow_extstats_set_msg() - * Log NSS WIFI VoW Extended Statistics Set Message. - */ -static void nss_wifi_log_rx_vow_extstats_set_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_rx_vow_extstats_set_msg *nwpm __maybe_unused = &ncm->msg.vow_extstats_msg; - nss_trace("%px: NSS WIFI VoW Extended Statistics Set Message:\n" - "WIFI VoW Extended Statistics Enable:: %d\n", - nwpm, nwpm->vow_extstats_en); -} - -/* - * nss_wifi_log_pktlog_cfg_msg() - * Log NSS WIFI Packet Log Configuration Message. - */ -static void nss_wifi_log_pktlog_cfg_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_pktlog_cfg_msg *nwpm __maybe_unused = &ncm->msg.pcm_msg; - nss_trace("%px: NSS WIFI Packet Log Configuration Message:\n" - "WIFI Packet Log Enable: %d\n" - "WIFI PAcket Log buffer Size: %d\n" - "WIFI Size of packet log header: %d\n" - "WIFI Offset for the MSDU ID: %d\n", - nwpm, nwpm->enable, - nwpm->bufsize, nwpm->hdrsize, - nwpm->msdu_id_offset); -} - -/* - * nss_wifi_log_enable_perpkt_txstats_msg() - * Log NSS WIFI Enable TX Stats Message. - */ -static void nss_wifi_log_enable_perpkt_txstats_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_enable_perpkt_txstats_msg *nwpm __maybe_unused = &ncm->msg.ept_msg; - nss_trace("%px: NSS WIFI Enable TX Stats Message:\n" - "WIFI TX Stats Enable Flag: %d\n", - nwpm, nwpm->perpkt_txstats_flag); -} - -/* - * nss_wifi_log_override_tos_msg() - * Log NSS WIFI Override TOS Message. - */ -static void nss_wifi_log_override_tos_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_igmp_mld_override_tos_msg *nwpm __maybe_unused = &ncm->msg.wigmpmldtm_msg; - nss_trace("%px: NSS WIFI Override TOS Message:\n" - "WIFI enable TID override Flag: %d\n" - "WIFI Value of TID to be overriden: %d\n", - nwpm, nwpm->igmp_mld_ovride_tid_en, - nwpm->igmp_mld_ovride_tid_val); -} - -/* - * nss_wifi_log_ol_stats_cfg_msg() - * Log NSS WIFI Offload Stats Config Message. - */ -static void nss_wifi_log_ol_stats_cfg_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_ol_stats_cfg_msg *nwpm __maybe_unused = &ncm->msg.scm_msg; - nss_trace("%px: NSS WIFI Enable/Disable Offload Stats Message:\n" - "WIFI enable/disable offload stats config: %d\n", - nwpm, nwpm->stats_cfg); -} - -/* - * nss_wifi_log_tx_queue_cfg_msg() - * Log NSS WIFI TX Queue Configuration message. - */ -static void nss_wifi_log_tx_queue_cfg_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_tx_queue_cfg_msg *nwpm __maybe_unused = &ncm->msg.wtxqcm; - nss_trace("%px: NSS WIFI TX Queue Config Message:\n" - "WIFI TX Queue Size: %d\n" - "WIFI TX Queue Range: %d\n", - nwpm, nwpm->size, nwpm->range); -} - -/* - * nss_wifi_log_tx_min_threshold_cfg() - * Log NSS WIFI TX Queue Min Threshold Configuration message. - */ -static void nss_wifi_log_tx_min_threshold_cfg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_tx_min_threshold_cfg_msg *nwpm __maybe_unused = &ncm->msg.wtx_min_threshold_cm; - nss_trace("%px: NSS WIFI TX Queue Min Threshold Config Message:\n" - "WIFI TX Queue Min Threshold Value: %d\n", - nwpm, nwpm->min_threshold); -} - -/* - * nss_wifi_log_dbdc_process_enable_msg() - * Log NSS WIFI DBDC repeater process configuration. - */ -static void nss_wifi_log_dbdc_process_enable_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_dbdc_process_enable_msg *nwpm __maybe_unused = &ncm->msg.dbdcpe_msg; - nss_trace("%px: NSS WIFI DBDC repeater process configuration:\n" - "WIFI DBDC Process Enable Flag: %d\n", - nwpm, nwpm->dbdc_process_enable); -} - -/* - * nss_wifi_log_primary_radio_set_msg() - * Log NSS WIFI Primary Radio Set message. - */ -static void nss_wifi_log_primary_radio_set_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_primary_radio_set_msg *nwpm __maybe_unused = &ncm->msg.wprs_msg; - nss_trace("%px: NSS WIFI Primary Radio Set Message:\n" - "WIFI Current Radio as Primary Radio Enable/Disable Flag: %d\n", - nwpm, nwpm->flag); -} - -/* - * nss_wifi_log_force_client_mcast_traffic_set_msg() - * Log NSS WIFI Force Multicat Traffic for Radio - */ -static void nss_wifi_log_force_client_mcast_traffic_set_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_force_client_mcast_traffic_set_msg *nwpm __maybe_unused = &ncm->msg.wfcmts_msg; - nss_trace("%px: NSS WIFI Force Multicat Traffic for Radio Message:\n" - "WIFI Radio Multicast Traffic Flag: %d\n", - nwpm, nwpm->flag); -} - -/* - * nss_wifi_log_store_other_pdev_stavap_msg() - * Log NSS WIFI Store Other Radio Station VAP Message. - */ -static void nss_wifi_log_store_other_pdev_stavap_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_store_other_pdev_stavap_msg *nwpm __maybe_unused = &ncm->msg.wsops_msg; - nss_trace("%px: NSS WIFI Store Other Radio Station VAP Message:\n" - "WIFI Station VAP Interface Number: %d\n", - nwpm, nwpm->stavap_ifnum); -} - -/* - * nss_wifi_log_sta_kickout_msg() - * Log NSS WIFI Station Kickout Message. - */ -static void nss_wifi_log_sta_kickout_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_sta_kickout_msg *nwpm __maybe_unused = &ncm->msg.sta_kickout_msg; - nss_trace("%px: NSS WIFI Station Kickout Message:\n" - "WIFI PEER ID: %d\n", - nwpm, nwpm->peer_id); -} - -/* - * nss_wifi_log_wnm_peer_rx_activity() - * Log NSS WIFI RX Active State Information of Peer. - */ -static void nss_wifi_log_wnm_peer_rx_activity(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_wnm_peer_rx_activity_msg *nwpm __maybe_unused = &ncm->msg.wprm; - nss_trace("%px: NSS WIFI RX Active State Information of Peer:\n" - "WIFI Peer ID: %px\n" - "WIFI Number of Entries: %d\n", - nwpm, nwpm->peer_id, nwpm->nentries); -} - -/* - * nss_wifi_log_wds_extn_peer_cfg_msg() - * Log NSS WIFI WDS Extension Enabled Configuraion Message. - */ -static void nss_wifi_log_wds_extn_peer_cfg_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_wds_extn_peer_cfg_msg *nwpm __maybe_unused = &ncm->msg.wpeercfg; - nss_trace("%px: NSS WIFI Extension Enabled Configuraion Message:\n" - "WIFI Peer MAC Address: %pM\n" - "WIFI WDS Flags: %d\n" - "WIFI Peer ID: %d\n", - nwpm, nwpm->mac_addr, nwpm->wds_flags, - nwpm->peer_id); -} - -/* - * nss_wifi_log_tx_capture_msg() - * Log NSS WIFI Enable TX Capture Message. - */ -static void nss_wifi_log_tx_capture_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_tx_capture_msg *nwpm __maybe_unused = &ncm->msg.tx_capture_msg; - nss_trace("%px: NSS WIFI Enable TX Capture Message:\n" - "WIFI TX Capture Enable Flag: %d\n", - nwpm, nwpm->tx_capture_enable); -} - -/* - * nss_wifi_log_always_primary_set_msg() - * Log NSS WIFI Always Set Current Radio Primary Message. - */ -static void nss_wifi_log_always_primary_set_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_always_primary_set_msg *nwpm __maybe_unused = &ncm->msg.waps_msg; - nss_trace("%px: NSS WIFI Always Set Current Radio Primary Message:\n" - "WIFI Always Set Flag: %d\n", - nwpm, nwpm->flag); -} - -/* - * nss_wifi_log_cmd_msg() - * Log NSS WIFI PDEV Command Message. - */ -static void nss_wifi_log_cmd_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_cmd_msg *nwpm __maybe_unused = &ncm->msg.wcmdm; - nss_trace("%px: NSS WIFI PDEV Command Message:\n" - "WIFI Type of Command: %d\n" - "WIFI Value of Command: %d\n", - nwpm, nwpm->cmd, nwpm->value); -} - -/* - * nss_wifi_log_enable_ol_statsv2_msg() - * Log NSS WIFI Enable Version 2 of TX/RX Stats - */ -static void nss_wifi_log_enable_ol_statsv2_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_enable_ol_statsv2 *nwpm __maybe_unused = &ncm->msg.wesh_msg; - nss_trace("%px: NSS WIFI Enable Version 2 of TX/RX Stats:\n" - "WIFI Enable Version 2 Stats: %d\n", - nwpm, nwpm->enable_ol_statsv2); -} - -/* - * nss_wifi_log_enable_ol_peer_time_msg() - * Log NSS WIFI Enable Per Peer Stats to Host - */ -static void nss_wifi_log_enable_ol_peer_time_msg(struct nss_wifi_msg *ncm) -{ - struct nss_wifi_ol_peer_time_msg *nwpm __maybe_unused = &ncm->msg.wopt_msg; - int32_t i; - - nss_trace("%px: NSS WIFI Enable Per PEer Stats to Host:\n" - "WIFI Number of Peers: %d\n" - "WIFI Peed ID: %d\n", - nwpm, nwpm->npeers, - nwpm->tstats[0].peer_id); - /* - * Continuation of the log. - */ - nss_trace("WIFI TX Timestamp:\n"); - nss_trace("\tSum of sojourn for each packet:"); - for (i = 0; i < NSS_WIFI_TX_NUM_TOS_TIDS; i++) { - nss_trace("\t\t%d = %x", i, nwpm->tstats[0].sum[i].sum_tx); - } - nss_trace("\tNumber of MSDU per peer per TID:"); - for (i = 0; i < NSS_WIFI_TX_NUM_TOS_TIDS; i++) { - nss_trace("\t\t%d = %x", i, nwpm->tstats[0].sum[i].sum_msdus); - } - nss_trace("WIFI Exponential Weighted Average:"); - for (i = 0; i < NSS_WIFI_TX_NUM_TOS_TIDS; i++) { - nss_trace("\t%d = %d", i, nwpm->tstats[0].avg[i]); - } -} - -/* - * nss_wifi_log_verbose() - * Log message contents. - */ -static void nss_wifi_log_verbose(struct nss_wifi_msg *ncm) -{ - switch (ncm->cm.type) { - case NSS_WIFI_INIT_MSG: - nss_wifi_log_init_msg(ncm); - break; - - case NSS_WIFI_HTT_INIT_MSG: - nss_wifi_log_htt_init_msg(ncm); - break; - - case NSS_WIFI_TX_INIT_MSG: - nss_wifi_log_tx_init_msg(ncm); - break; - - case NSS_WIFI_RAW_SEND_MSG: - nss_wifi_log_rawsend_msg(ncm); - break; - - case NSS_WIFI_MGMT_SEND_MSG: - nss_wifi_log_mgmtsend_msg(ncm); - break; - - case NSS_WIFI_WDS_PEER_ADD_MSG: - nss_wifi_log_wds_peer_msg(ncm); - break; - - case NSS_WIFI_WDS_PEER_DEL_MSG: - nss_wifi_log_wds_peer_msg(ncm); - break; - - case NSS_WIFI_STOP_MSG: - nss_wifi_log_stop_msg(ncm); - break; - - case NSS_WIFI_RESET_MSG: - nss_wifi_log_reset_msg(ncm); - break; - - case NSS_WIFI_PEER_FREELIST_APPEND_MSG: - nss_wifi_log_peer_freelist_append_msg(ncm); - break; - - case NSS_WIFI_RX_REORDER_ARRAY_FREELIST_APPEND_MSG: - nss_wifi_log_rx_reorder_array_freelist_append_msg(ncm); - break; - - case NSS_WIFI_MONITOR_FILTER_SET_MSG: - nss_wifi_log_set_filter_msg(ncm); - break; - - case NSS_WIFI_PEER_BS_STATE_MSG: - nss_wifi_log_peer_activity_msg(ncm); - break; - - case NSS_WIFI_RX_VOW_EXTSTATS_SET_MSG: - nss_wifi_log_rx_vow_extstats_set_msg(ncm); - break; - - case NSS_WIFI_PKTLOG_CFG_MSG: - nss_wifi_log_pktlog_cfg_msg(ncm); - break; - - case NSS_WIFI_ENABLE_PERPKT_TXSTATS_MSG: - nss_wifi_log_enable_perpkt_txstats_msg(ncm); - break; - - case NSS_WIFI_IGMP_MLD_TOS_OVERRIDE_MSG: - nss_wifi_log_override_tos_msg(ncm); - break; - - case NSS_WIFI_OL_STATS_CFG_MSG: - nss_wifi_log_ol_stats_cfg_msg(ncm); - break; - - case NSS_WIFI_TX_QUEUE_CFG_MSG: - nss_wifi_log_tx_queue_cfg_msg(ncm); - break; - - case NSS_WIFI_TX_MIN_THRESHOLD_CFG_MSG: - nss_wifi_log_tx_min_threshold_cfg(ncm); - break; - - case NSS_WIFI_DBDC_PROCESS_ENABLE_MSG: - nss_wifi_log_dbdc_process_enable_msg(ncm); - break; - - case NSS_WIFI_PRIMARY_RADIO_SET_MSG: - nss_wifi_log_primary_radio_set_msg(ncm); - break; - - case NSS_WIFI_FORCE_CLIENT_MCAST_TRAFFIC_SET_MSG: - nss_wifi_log_force_client_mcast_traffic_set_msg(ncm); - break; - - case NSS_WIFI_STORE_OTHER_PDEV_STAVAP_MSG: - nss_wifi_log_store_other_pdev_stavap_msg(ncm); - break; - - case NSS_WIFI_STA_KICKOUT_MSG: - nss_wifi_log_sta_kickout_msg(ncm); - break; - - case NSS_WIFI_WNM_PEER_RX_ACTIVITY_MSG: - nss_wifi_log_wnm_peer_rx_activity(ncm); - break; - - case NSS_WIFI_WDS_VENDOR_MSG: - nss_wifi_log_wds_extn_peer_cfg_msg(ncm); - break; - - case NSS_WIFI_TX_CAPTURE_SET_MSG: - nss_wifi_log_tx_capture_msg(ncm); - break; - - case NSS_WIFI_ALWAYS_PRIMARY_SET_MSG: - nss_wifi_log_always_primary_set_msg(ncm); - break; - - case NSS_WIFI_CMD_MSG: - nss_wifi_log_cmd_msg(ncm); - break; - - case NSS_WIFI_ENABLE_OL_STATSV2_MSG: - nss_wifi_log_enable_ol_statsv2_msg(ncm); - break; - - case NSS_WIFI_OL_PEER_TIME_MSG: - nss_wifi_log_enable_ol_peer_time_msg(ncm); - break; - - case NSS_WIFI_FLUSH_HTT_CMD_MSG: - case NSS_WIFI_OL_STATS_MSG: - case NSS_WIFI_MSDU_TTL_SET_MSG: - case NSS_WIFI_PEER_STATS_MSG: - case NSS_WIFI_FW_STATS_MSG: - case NSS_WIFI_SEND_RRA_MEMORY_REQUEST_MSG: - case NSS_WIFI_STATS_MSG: - case NSS_WIFI_POST_RECV_MSG: - case NSS_WIFI_SEND_PEER_MEMORY_REQUEST_MSG: - /* - * No log for these valid messages. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", ncm); - break; - } -} - -/* - * nss_wifi_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_wifi_log_tx_msg(struct nss_wifi_msg *ncm) -{ - if (ncm->cm.type >= NSS_WIFI_MAX_MSG) { - nss_warning("%px: Invalid message type\n", ncm); - return; - } - - nss_info("%px: type[%d]:%s\n", ncm, ncm->cm.type, nss_wifi_log_message_types_str[ncm->cm.type]); - nss_wifi_log_verbose(ncm); -} - -/* - * nss_wifi_log_rx_msg() - * Log messages received from FW. - */ -void nss_wifi_log_rx_msg(struct nss_wifi_msg *ncm) -{ - if (ncm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", ncm); - return; - } - - if (ncm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ncm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", ncm, ncm->cm.type, - nss_wifi_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response]); - goto verbose; - } - - if (ncm->cm.error >= NSS_WIFI_EMSG_MAX) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - ncm, ncm->cm.type, nss_wifi_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - ncm, ncm->cm.type, nss_wifi_log_message_types_str[ncm->cm.type], - ncm->cm.response, nss_cmn_response_str[ncm->cm.response], - ncm->cm.error, nss_wifi_log_error_response_types_str[ncm->cm.error]); - -verbose: - nss_wifi_log_verbose(ncm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_log.h deleted file mode 100644 index c47a62b3a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_WIFI_LOG_H__ -#define __NSS_WIFI_LOG_H__ - -/* - * nss_WIFI_log.h - * NSS WIFI Log Header File - */ - -/* - * nss_WIFI_log_tx_msg - * Logs a WIFI message that is sent to the NSS firmware. - */ -void nss_wifi_log_tx_msg(struct nss_wifi_msg *ncm); - -/* - * nss_WIFI_log_rx_msg - * Logs a WIFI message that is received from the NSS firmware. - */ -void nss_wifi_log_rx_msg(struct nss_wifi_msg *ncm); - -#endif /* __NSS_WIFI_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mac_db.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mac_db.c deleted file mode 100644 index 5fb825a1a..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mac_db.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_wifi_mac_db_if.h" - -/* - * Compile time assertion. - */ -#define NSS_WIFI_MAC_DB_COMPILE_TIME_ASSERT(assertion_name, predicate) \ - typedef char assertion_name[(predicate) ? 1 : -1] - -#define NSS_WIFI_MAC_DB_TX_TIMEOUT 1000 /* Millisecond to jiffies*/ - -/* - * Validate the Wi-Fi MAC database message size not exceeding buffer size. - */ -NSS_WIFI_MAC_DB_COMPILE_TIME_ASSERT(NSS_WIFI_MAC_DB_MAX_BUF_MSG, - (sizeof(struct nss_wifi_mac_db_msg) < NSS_NBUF_PAYLOAD_SIZE)); - -/* - * nss_wifi_mac_db_get_context() - */ -struct nss_ctx_instance *nss_wifi_mac_db_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wmdb_handler_id]; -} -EXPORT_SYMBOL(nss_wifi_mac_db_get_context); - -/* - * nss_wifi_mac_db_pvt - * Private data structure - */ -static struct nss_wifi_mac_db_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} wifi_mac_db_pvt; - -/* - * nss_wifi_mac_db_handler() - * Handle NSS -> HLOS messages for wifi_mac_db - */ -static void nss_wifi_mac_db_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_wifi_mac_db_msg *ntm = (struct nss_wifi_mac_db_msg *)ncm; - void *ctx; - nss_wifi_mac_db_msg_callback_t cb; - - nss_info("%px: NSS->HLOS message for wifi_mac_db\n", nss_ctx); - - /* - * The interface number shall be wifi_mac_db soc interface or wifi_mac_db radio interface - */ - BUG_ON((ncm->interface != NSS_WIFI_MAC_DB_INTERFACE)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_WIFI_MAC_DB_MAX_MSG) { - nss_warning("%px: Received invalid message %d for wifi_mac_db interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_wifi_mac_db_msg)) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Update the callback and app_data for notify messages, wifi_mac_db sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->wifi_mac_db_msg_callback; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - nss_info("%px: cb null for wifi_mac_db interface %d", nss_ctx, ncm->interface); - return; - } - - /* - * Get callback & context - */ - cb = (nss_wifi_mac_db_msg_callback_t)ncm->cb; - ctx = nss_ctx->subsys_dp_register[ncm->interface].ndev; - - /* - * call wifi_mac_db msg callback - */ - if (!ctx) { - nss_warning("%px: Event received for wifi_mac_db interface %d before registration", nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_wifi_mac_db_tx_msg - * Transmit a wifi_mac_db message to NSS FW - * - * NOTE: The caller is expected to handle synchronous wait for message - * response if needed. - */ -nss_tx_status_t nss_wifi_mac_db_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_mac_db_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - if (ncm->type >= NSS_WIFI_MAC_DB_MAX_MSG) { - nss_warning("%px: wifi_mac_db message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * The interface number shall be one of the wifi_mac_db soc interfaces - */ - if ((ncm->interface != NSS_WIFI_MAC_DB_INTERFACE)) { - nss_warning("%px: tx request for interface that is not a wifi_mac_db: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_wifi_mac_db_tx_msg); - -/* - **************************************** - * Register/Unregister/Miscellaneous APIs - **************************************** - */ - -/* - * nss_register_wifi_mac_db_if() - * Register wifi_mac_db with nss driver - */ -struct nss_ctx_instance *nss_register_wifi_mac_db_if(uint32_t if_num, nss_wifi_mac_db_callback_t wifi_mac_db_callback, - nss_wifi_mac_db_callback_t wifi_mac_db_ext_callback, - nss_wifi_mac_db_msg_callback_t event_callback, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wmdb_handler_id]; - - /* - * The interface number shall be wifi_mac_db interface - */ - nss_assert(if_num == NSS_WIFI_MAC_DB_INTERFACE); - - nss_info("%px: nss_register_wifi_mac_db_if if_num:%d wifi_mac_db_dev:%px", nss_ctx, if_num, netdev); - - nss_core_register_subsys_dp(nss_ctx, if_num, wifi_mac_db_callback, NULL, NULL, netdev, features); - - nss_top_main.wifi_mac_db_msg_callback = event_callback; - - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wmdb_handler_id]; -} -EXPORT_SYMBOL(nss_register_wifi_mac_db_if); - -/* - * nss_unregister_wifi_mac_db_if() - * Unregister wifi_mac_db with nss driver - */ -void nss_unregister_wifi_mac_db_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wmdb_handler_id]; - - /* - * The interface number shall be wifi_mac_db interface - */ - nss_assert(if_num == NSS_WIFI_MAC_DB_INTERFACE); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_unregister_wifi_mac_db_if); - -/* - * nss_wifi_mac_db_register_handler() - * Register handle for notfication messages received on wifi mac db - */ -void nss_wifi_mac_db_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = - (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wmdb_handler_id]; - - nss_info("wifi_mac_db_register_handler"); - nss_core_register_handler(nss_ctx, NSS_WIFI_MAC_DB_INTERFACE, nss_wifi_mac_db_handler, NULL); - - sema_init(&wifi_mac_db_pvt.sem, 1); - init_completion(&wifi_mac_db_pvt.complete); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh.c deleted file mode 100644 index d4a6c0a1d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_core.h" -#include "nss_cmn.h" -#include "nss_wifi_mesh.h" -#include "nss_wifi_mesh_log.h" -#include "nss_wifi_mesh_strings.h" - -/* - * nss_wifi_mesh_verify_if_num() - * Verify interface number. - */ -bool nss_wifi_mesh_verify_if_num(nss_if_num_t if_num) -{ - enum nss_dynamic_interface_type if_type = nss_dynamic_interface_get_type(nss_wifi_mesh_get_context(), if_num); - - return ((if_type == NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER) || - (if_type == NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER)); -} -EXPORT_SYMBOL(nss_wifi_mesh_verify_if_num); - -/* nss_wifi_mesh_handler() - * Handles Wi-Fi mesh messages from NSS to HLOS. - */ -static void nss_wifi_mesh_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data) -{ - nss_wifi_mesh_msg_callback_t cb; - struct nss_wifi_mesh_msg *nwmm = (struct nss_wifi_mesh_msg *)ncm; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_assert(nss_is_dynamic_interface(ncm->interface)); - nss_assert(nss_wifi_mesh_verify_if_num(ncm->interface)); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_WIFI_MESH_MSG_MAX) { - nss_warning("%px: Received invalid message %d for wifi_mesh interface\n", nss_ctx, ncm->type); - return; - } - - - /* - * For variable array the size of the common length will be greater the nss_wifi_mesh_msg - * length. Add conditional checking for messages where length check will fail. - */ - if ((nss_cmn_get_msg_len(ncm) > sizeof(struct nss_wifi_mesh_msg)) && - (ncm->type != NSS_WIFI_MESH_MSG_PATH_TABLE_DUMP) && - (ncm->type != NSS_WIFI_MESH_MSG_PROXY_PATH_TABLE_DUMP)) { - nss_warning("%px: Length of message is greater than expected, type: %d, len: %d", - nss_ctx, ncm->type, ncm->len); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Trace Messages - */ - nss_wifi_mesh_log_rx_msg(nwmm); - - /* - * Update the stats and send statistics notifications to the registered modules. - */ - if (nwmm->cm.type == NSS_WIFI_MESH_MSG_STATS_SYNC) { - nss_wifi_mesh_update_stats(ncm->interface, &nwmm->msg.stats_sync_msg); - nss_wifi_mesh_stats_notify(ncm->interface, nss_ctx->id); - } - - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)app_data; - } - - if (!ncm->cb) { - return; - } - - cb = (nss_wifi_mesh_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_wifi_mesh_msg_init() - * Initiliaze a Wi-Fi mesh message. - */ -void nss_wifi_mesh_msg_init(struct nss_wifi_mesh_msg *nwm, nss_if_num_t if_num, uint32_t type, uint32_t len, - nss_wifi_mesh_msg_callback_t cb, void *app_data) -{ - nss_assert(nss_wifi_mesh_verify_if_num(if_num)); - nss_cmn_msg_init(&nwm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_wifi_mesh_msg_init); - -/* - * nss_wifi_mesh_tx_buf - * Send data packet for vap processing asynchronously. - */ -nss_tx_status_t nss_wifi_mesh_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, nss_if_num_t if_num) -{ - nss_assert(nss_is_dynamic_interface(if_num)); - return nss_core_send_packet(nss_ctx, os_buf, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_wifi_mesh_tx_buf); - -/* - * nss_wifi_mesh_tx_msg - * Transmit a Wi-Fi mesh message to the NSS firmware asynchronously. - * - * NOTE: The caller is expected to handle synchronous waiting for message - * response if needed. - */ -nss_tx_status_t nss_wifi_mesh_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_mesh_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (ncm->type >= NSS_WIFI_MESH_MSG_MAX) { - nss_warning("%px: wifi_mesh message type out of range: %d\n", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * Log messages. - */ - nss_wifi_mesh_log_tx_msg(msg); - - /* - * The interface number shall be one of the Wi-Fi mesh socket interfaces. - */ - nss_assert(nss_is_dynamic_interface(ncm->interface)); - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_wifi_mesh_tx_msg); - -/* - **************************************** - * Register/Unregister/Miscellaneous APIs - **************************************** - */ - -/* - * nss_wifi_mesh_get_context() - * Return the core ctx which the feature is on. - */ -struct nss_ctx_instance *nss_wifi_mesh_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; -} -EXPORT_SYMBOL(nss_wifi_mesh_get_context); - -/* - * nss_unregister_wifi_mesh_if() - * Unregister Wi-Fi mesh from the NSS driver. - */ -void nss_unregister_wifi_mesh_if(nss_if_num_t if_num) -{ - struct nss_ctx_instance *nss_ctx = nss_wifi_mesh_get_context(); - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - nss_core_unregister_msg_handler(nss_ctx, if_num); - nss_core_unregister_handler(nss_ctx, if_num); - nss_wifi_mesh_stats_handle_free(if_num); -} -EXPORT_SYMBOL(nss_unregister_wifi_mesh_if); - -/* - * nss_register_wifi_mesh_if() - * Register wifi_mesh with nss driver. - */ -uint32_t nss_register_wifi_mesh_if(nss_if_num_t if_num, - nss_wifi_mesh_data_callback_t mesh_data_callback, - nss_wifi_mesh_ext_data_callback_t mesh_ext_data_callback, - nss_wifi_mesh_msg_callback_t mesh_event_callback, - uint32_t dp_type, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = nss_wifi_mesh_get_context(); - uint32_t status; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - nss_assert(netdev); - nss_assert(nss_wifi_mesh_verify_if_num(if_num)); - - if (!nss_wifi_mesh_stats_handle_alloc(if_num, netdev->ifindex)) { - nss_warning("%px: couldn't allocate stats handle for device name: %s, if_num: 0x%x\n", nss_ctx, netdev->name, if_num); - return NSS_CORE_STATUS_FAILURE; - } - - nss_core_register_handler(nss_ctx, if_num, nss_wifi_mesh_handler, netdev); - - status = nss_core_register_msg_handler(nss_ctx, if_num, mesh_event_callback); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to register event handler for interface(%u)\n", nss_ctx, if_num); - nss_core_unregister_handler(nss_ctx, if_num); - nss_wifi_mesh_stats_handle_free(if_num); - return status; - } - - nss_core_register_subsys_dp(nss_ctx, if_num, mesh_data_callback, mesh_ext_data_callback, NULL, netdev, features); - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, dp_type); - return NSS_CORE_STATUS_SUCCESS; -} -EXPORT_SYMBOL(nss_register_wifi_mesh_if); - -/* - * nss_wifi_mesh_init() - * Initialize the mesh stats dentries. - */ -void nss_wifi_mesh_init(void) -{ - if (!nss_wifi_mesh_strings_dentry_create()) { - nss_warning("Unable to create dentry for Wi-Fi mesh strings\n"); - } - - if (!nss_wifi_mesh_stats_dentry_create()) { - nss_warning("Unable to create dentry for Wi-Fi mesh stats\n"); - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.c deleted file mode 100644 index bf9ddc658..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_wifi_mesh_log.c - * NSS WiFi Mesh logger file. - */ - -#include "nss_core.h" -#include "nss_wifi_mesh.h" - -#define NSS_WIFI_MESH_LOG_MESSAGE_TYPE_INDEX(type) ((type) - NSS_IF_MAX_MSG_TYPES) - -/* - * nss_wifi_mesh_log_message_types_str - * NSS Wi-Fi mesh message strings. - */ -static uint8_t *nss_wifi_mesh_log_message_types_str[NSS_WIFI_MESH_LOG_MESSAGE_TYPE_INDEX(NSS_WIFI_MESH_MSG_MAX)] __maybe_unused = { - "WiFi Mesh configure", - "WiFi Mesh configure Mpath Add", - "WiFi Mesh configure Mpath Delete", - "WiFi Mesh configure Mpath Update", - "WiFi Mesh configure Proxy Learn", - "WiFi Mesh configure Proxy Add", - "WiFi Mesh configure Proxy Update", - "WiFi Mesh configure Proxy Delete", - "WiFi Mesh configure Mpath Not Found", - "WiFi Mesh configure Refresh" - "WiFi Mesh configure Mpath Table Dump", - "WiFi Mesh configure Proxy Path Table Dump", - "WiFi Mesh configure Assoc Link Vap", - "WiFi Mesh configure Exception Message", - "WiFi Mesh configure Stats Sync" -}; - -/* - * nss_wifi_mesh_log_configure_msg() - * Log a NSS Wi-Fi mesh interface configure message. - */ -static void nss_wifi_mesh_log_configure_if_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_config_msg *cmsg __maybe_unused = &nwmm->msg.mesh_config; - nss_trace("%px: WiFi Mesh configure message\n" - "Local Mac address: %pM\n" - "TTL: %d\n" - "Mesh Path Refresh Time: %d\n" - "Mpp Learning Mode: %d\n" - "Block Mesh Forwarding: %d\n" - "Configs Flags: 0x%x\n", - cmsg, cmsg->local_mac_addr, cmsg->ttl, - cmsg->mesh_path_refresh_time, - cmsg->mpp_learning_mode, - cmsg->block_mesh_forwarding, - cmsg->config_flags); -} - -/* - * nss_wifi_mesh_log_mpath_add_msg() - * Log a NSS Wi-Fi mesh mpath add message. - */ -static void nss_wifi_mesh_log_mpath_add_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_mpath_add_msg *mamsg __maybe_unused = &nwmm->msg.mpath_add; - nss_trace("%px: NSS WiFi Mesh Mpath add message:\n" - "Dest Mac address: %pM\n" - "Next Hop Mac address: %pM\n" - "Metric: %d\n" - "Expiry Time: %d\n" - "Hop Count: %d\n" - "Flags: 0x%x\n" - "Link Vap id: %d\n" - "Is Mesh Gate: %d\n", - mamsg, mamsg->dest_mac_addr, mamsg->next_hop_mac_addr, - mamsg->metric, mamsg->expiry_time, mamsg->hop_count, - mamsg->path_flags, mamsg->link_vap_id, mamsg->is_mesh_gate); -} - -/* - * nss_wifi_mesh_log_mpath_delete_msg() - * Log a NSS Wi-Fi mesh mpath delete message. - */ -static void nss_wifi_mesh_log_mpath_delete_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_mpath_del_msg *mdmsg __maybe_unused = &nwmm->msg.mpath_del; - nss_trace("%px: NSS WiFi Mesh Mpath delete message:\n" - "Dest Mac Address: %pM\n" - "Link Vap id: %d\n" - "Next Hop Mac address: %pM\n", - mdmsg, mdmsg->mesh_dest_mac_addr, mdmsg->link_vap_id, mdmsg->next_hop_mac_addr); -} - -/* - * nss_wifi_mesh_log_mpath_update_msg() - * Log a NSS Wi-Fi mesh mpath update message. - */ -static void nss_wifi_mesh_log_mpath_update_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_mpath_update_msg *mumsg __maybe_unused = &nwmm->msg.mpath_update; - nss_trace("%px: NSS WiFi Mesh Mpath update message:\n" - "Dest Mac address: %pM\n" - "Next Hop Mac address: %pM\n" - "Metric: %d\n" - "Expiry Time: %d\n" - "Hop Count: %d\n" - "Flags: 0x%x\n" - "Link Vap id: %d\n" - "Is Mesh Gate: %d\n" - "Update Flags: %d\n", - mumsg, mumsg->dest_mac_addr, mumsg->next_hop_mac_addr, - mumsg->metric, mumsg->expiry_time, mumsg->hop_count, - mumsg->path_flags, mumsg->link_vap_id, mumsg->is_mesh_gate, - mumsg->update_flags); -} - -/* - * nss_wifi_mesh_log_proxy_path_learn_msg() - * Log a NSS Wi-Fi mesh proxy path learn message. - */ -static void nss_wifi_mesh_log_proxy_path_learn_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_proxy_path_learn_msg *pplm __maybe_unused = &nwmm->msg.proxy_learn_msg; - nss_trace("%px: NSS WiFi Mesh Proxy Path Learn message:\n" - "Mesh Dest Mac address: %pM\n" - "Destination Mac address: %pM\n" - "flags: 0x%x\n", - pplm, pplm->mesh_dest_mac, pplm->dest_mac_addr, - pplm->path_flags); -} - -/* - * nss_wifi_mesh_log_proxy_path_add_msg() - * Log a NSS Wi-Fi Mesh proxy path add message. - */ -static void nss_wifi_mesh_log_proxy_path_add_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_proxy_path_add_msg *ppam __maybe_unused = &nwmm->msg.proxy_add_msg; - nss_trace("%px: NSS WiFi Mesh Proxy Path Add message:\n" - "Mesh Dest Mac address: %pM\n" - "Destination Mac address: %pM\n" - "flags: 0x%x\n", - ppam, ppam->mesh_dest_mac, ppam->dest_mac_addr, - ppam->path_flags); -} - -/* - * nss_wifi_mesh_log_proxy_path_delete_msg() - * Log a NSS Wi-Fi proxy path delete message. - */ -static void nss_wifi_mesh_log_proxy_path_delete_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_proxy_path_del_msg *ppdm __maybe_unused = &nwmm->msg.proxy_del_msg; - nss_trace("%px: NSS WiFi Mesh Proxy Path Delete message:\n" - "Mesh Dest Mac address: %pM\n" - "Destination Mac address: %pM\n", - ppdm, ppdm->mesh_dest_mac_addr, ppdm->dest_mac_addr); -} - -/* - * nss_wifi_mesh_log_proxy_path_update_msg() - * Log a NSS Wi-Fi mesh proxy path update message. - */ -static void nss_wifi_mesh_log_proxy_path_update_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_proxy_path_update_msg *ppum __maybe_unused = &nwmm->msg.proxy_update_msg; - nss_trace("%px: NSS WiFi Mesh Proxy Path Add message:\n" - "Mesh Dest Mac address: %pM\n" - "Destination Mac address: %pM\n" - "flags: 0x%x\n" - "Bitmap: %d\n", - ppum, ppum->mesh_dest_mac, ppum->dest_mac_addr, - ppum->path_flags, ppum->bitmap); -} - -/* - * nss_wifi_mesh_log_mpath_not_found_msg() - * Log a NSS Wi-Fi mesh mpath not found message. - */ -static void nss_wifi_mesh_log_mpath_not_found_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_mpath_not_found_msg *mnfm __maybe_unused = &nwmm->msg.mpath_not_found_msg; - nss_trace("%px: NSS WiFi Mesh Mpath not found message:\n" - "Destination Mac address: %pM\n" - "Transmitter Mac address: %pM\n" - "Link Vap Id: %d\n" - "Is Mesh Forwarding Path: %d\n", - mnfm, mnfm->dest_mac_addr, mnfm->transmitter_mac_addr, - mnfm->link_vap_id, mnfm->is_mesh_forward_path); -} - -/* - * nss_wifi_mesh_log_mpath_refresh_msg() - * Log a NSS Wi-Fi mesh mpath refresh message. - */ -static void nss_wifi_mesh_log_mpath_refresh_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_path_refresh_msg *mprm __maybe_unused = &nwmm->msg.path_refresh_msg; - nss_trace("%px: NSS WiFi Mesh Mpath refresh message:\n" - "Destination Mac address: %pM\n" - "Next Hop Mac address: %pM\n" - "Flags: 0x%x\n" - "Link Vap Id: %d\n", - mprm, mprm->dest_mac_addr, mprm->next_hop_mac_addr, - mprm->path_flags, mprm->link_vap_id); -} - -/* - * nss_wifi_mesh_log_mpath_expiry_msg() - * Log a NSS Wi-Fi mesh mpath expiry message. - */ -static void nss_wifi_mesh_log_mpath_expiry_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_path_expiry_msg *mpem __maybe_unused = &nwmm->msg.path_expiry_msg; - nss_trace("%px: NSS WiFi Mesh Mpath expiry message:\n" - "Destination Mac address: %pM\n" - "Next Hop Mac address: %pM\n" - "Flags: 0x%x\n" - "Link Vap Id: %d\n", - mpem, mpem->mesh_dest_mac_addr, mpem->next_hop_mac_addr, - mpem->path_flags, mpem->link_vap_id); -} - -/* - * nss_wifi_mesh_log_exception_flag_msg() - * Log a NSS Wi-Fi mesh exception flag message. - */ -static void nss_wifi_mesh_log_exception_flag_msg(struct nss_wifi_mesh_msg *nwmm) -{ - struct nss_wifi_mesh_exception_flag_msg *efm __maybe_unused = &nwmm->msg.exception_msg; - nss_trace("%px: NSS WiFi Mesh Exception Flag message:\n" - "Destination Mac address: %pM\n", - efm, efm->dest_mac_addr); -} - -/* - * nss_wifi_mesh_log_verbose() - * Log message contents. - */ -static void nss_wifi_mesh_log_verbose(struct nss_wifi_mesh_msg *nwmm) -{ - switch (nwmm->cm.type) { - case NSS_WIFI_MESH_MSG_INTERFACE_CONFIGURE: - nss_wifi_mesh_log_configure_if_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_MPATH_ADD: - nss_wifi_mesh_log_mpath_add_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_MPATH_DELETE: - nss_wifi_mesh_log_mpath_delete_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_MPATH_UPDATE: - nss_wifi_mesh_log_mpath_update_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_PROXY_PATH_LEARN: - nss_wifi_mesh_log_proxy_path_learn_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_PROXY_PATH_ADD: - nss_wifi_mesh_log_proxy_path_add_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_PROXY_PATH_DELETE: - nss_wifi_mesh_log_proxy_path_delete_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_PROXY_PATH_UPDATE: - nss_wifi_mesh_log_proxy_path_update_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_PATH_NOT_FOUND: - nss_wifi_mesh_log_mpath_not_found_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_PATH_REFRESH: - nss_wifi_mesh_log_mpath_refresh_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_PATH_EXPIRY: - nss_wifi_mesh_log_mpath_expiry_msg(nwmm); - break; - - case NSS_WIFI_MESH_MSG_PATH_TABLE_DUMP: - break; - - case NSS_WIFI_MESH_MSG_PROXY_PATH_TABLE_DUMP: - break; - - case NSS_WIFI_MESH_MSG_STATS_SYNC: - break; - - case NSS_WIFI_MESH_MSG_EXCEPTION_FLAG: - nss_wifi_mesh_log_exception_flag_msg(nwmm); - break; - - default: - nss_trace("%px: Invalid message, type: %d\n", nwmm, nwmm->cm.type); - break; - } -} - -/* - * nss_wifi_mesh_log_tx_msg() - * Log messages transmitted to firmware. - */ -void nss_wifi_mesh_log_tx_msg(struct nss_wifi_mesh_msg *nwmm) -{ - uint32_t index; - if ((nwmm->cm.type >= NSS_WIFI_MESH_MSG_MAX) || (nwmm->cm.type <= NSS_IF_MAX_MSG_TYPES)) { - nss_warning("%px: Invalid message, type: %d\n", nwmm, nwmm->cm.type); - return; - } - - index = NSS_WIFI_MESH_LOG_MESSAGE_TYPE_INDEX(nwmm->cm.type); - - nss_info("%px: type[%d]:%s\n", nwmm, nwmm->cm.type, nss_wifi_mesh_log_message_types_str[index - 1]); - nss_wifi_mesh_log_verbose(nwmm); -} - -/* - * nss_wifi_mesh_log_rx_msg() - * Log messages received from firmware. - */ -void nss_wifi_mesh_log_rx_msg(struct nss_wifi_mesh_msg *nwmm) -{ - uint32_t index; - if (nwmm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response, message type: %d\n", nwmm, nwmm->cm.type); - return; - } - - if (nwmm->cm.type <= NSS_IF_MAX_MSG_TYPES) { - return; - } - - index = NSS_WIFI_MESH_LOG_MESSAGE_TYPE_INDEX(nwmm->cm.type); - - if (nwmm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nwmm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nwmm, nwmm->cm.type, - nss_wifi_mesh_log_message_types_str[index - 1], - nwmm->cm.response, nss_cmn_response_str[nwmm->cm.response]); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n", - nwmm, nwmm->cm.type, nss_wifi_mesh_log_message_types_str[index - 1], - nwmm->cm.response, nss_cmn_response_str[nwmm->cm.response]); - -verbose: - nss_wifi_mesh_log_verbose(nwmm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.h deleted file mode 100644 index a6c54368f..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_log.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_WIFI_MESH_LOG_H -#define __NSS_WIFI_MESH_LOG_H - -/* - * nss_wifi_mesh_log_tx_msg - * Logs a Wi-Fi mesh message that was sent to the NSS firmware. - */ -void nss_wifi_mesh_log_tx_msg(struct nss_wifi_mesh_msg *nwmm); - -/* - * nss_wifi_mesh_log_rx_msg - * Logs a Wi-Fi mesh message that was received from the NSS firmware. - */ -void nss_wifi_mesh_log_rx_msg(struct nss_wifi_mesh_msg *nwmm); - -#endif /* __NSS_WIFI_MESH_LOG_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.c deleted file mode 100644 index 4cfa96a67..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.c +++ /dev/null @@ -1,662 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_tx_rx_common.h" -#include "nss_wifi_mesh.h" -#include "nss_wifi_mesh_stats.h" -#include "nss_wifi_mesh_strings.h" - -#define NSS_WIFI_MESH_OUTER_STATS 0 -#define NSS_WIFI_MESH_INNER_STATS 1 -#define NSS_WIFI_MESH_PATH_STATS 2 -#define NSS_WIFI_MESH_PROXY_PATH_STATS 3 -#define NSS_WIFI_MESH_EXCEPTION_STATS 4 - -/* - * Wi-Fi mesh stats dentry file size. - */ -#define NSS_WIFI_MESH_DENTRY_FILE_SIZE 19 - -/* - * Spinlock for protecting tunnel operations colliding with a tunnel destroy - */ -static DEFINE_SPINLOCK(nss_wifi_mesh_stats_lock); - -/* - * Declare atomic notifier data structure for statistics. - */ -static ATOMIC_NOTIFIER_HEAD(nss_wifi_mesh_stats_notifier); - -/* - * Declare an array of Wi-Fi mesh stats handle. - */ -struct nss_wifi_mesh_stats_handle *nss_wifi_mesh_stats_hdl[NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE]; - -/* - * nss_wifi_mesh_max_statistics() - * Wi-Fi mesh maximum statistics. - */ -static uint32_t nss_wifi_mesh_max_statistics(void) -{ - uint32_t max1; - uint32_t exception_stats_max = NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX; - uint32_t encap_stats_max = NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX; - uint32_t decap_stats_max = NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX; - uint32_t path_stats_max = NSS_WIFI_MESH_PATH_STATS_TYPE_MAX; - uint32_t proxy_path_stats_max = NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX; - - max1 = max(max(encap_stats_max, decap_stats_max), max(path_stats_max, proxy_path_stats_max)); - - return (max(max1, exception_stats_max)); -} - -/* - * nss_wifi_mesh_stats_handle_alloc() - * Allocate Wi-Fi mesh tunnel instance - */ -bool nss_wifi_mesh_stats_handle_alloc(nss_if_num_t if_num, int32_t ifindex) -{ - struct nss_wifi_mesh_stats_handle *h; - uint32_t idx; - - /* - * Allocate a handle - */ - h = kzalloc(sizeof(struct nss_wifi_mesh_stats_handle), GFP_ATOMIC); - if (!h) { - nss_warning("Failed to allocate memory for Wi-Fi mesh instance for interface : 0x%x\n", if_num); - return false; - } - - spin_lock(&nss_wifi_mesh_stats_lock); - for (idx = 0; idx < NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE; idx++) { - if (nss_wifi_mesh_stats_hdl[idx] && nss_wifi_mesh_stats_hdl[idx]->if_num == if_num) { - spin_unlock(&nss_wifi_mesh_stats_lock); - nss_warning("Already a handle present for this interface number: 0x%x\n", if_num); - kfree(h); - return false; - } - } - - for (idx = 0; idx < NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE; idx++) { - if (nss_wifi_mesh_stats_hdl[idx]) { - continue; - } - - h->if_num = if_num; - h->mesh_idx = idx; - h->ifindex = ifindex; - nss_wifi_mesh_stats_hdl[idx] = h; - spin_unlock(&nss_wifi_mesh_stats_lock); - return true; - } - spin_unlock(&nss_wifi_mesh_stats_lock); - nss_warning("No free index available for handle with ifnum: 0x%x\n", if_num); - kfree(h); - return false; -} - -/* - * nss_wifi_mesh_stats_handle_free() - * Free Wi-Fi mesh tunnel handle instance. - */ -bool nss_wifi_mesh_stats_handle_free(nss_if_num_t if_num) -{ - struct nss_wifi_mesh_stats_handle *h; - - spin_lock(&nss_wifi_mesh_stats_lock); - h = nss_wifi_mesh_get_stats_handle(if_num); - if (!h) { - spin_unlock(&nss_wifi_mesh_stats_lock); - nss_warning("Unable to free Wi-Fi mesh stats handle instance for interface number: 0x%x\n", if_num); - return false; - } - - nss_wifi_mesh_stats_hdl[h->mesh_idx] = NULL; - spin_unlock(&nss_wifi_mesh_stats_lock); - kfree(h); - return true; -} - -/** - * nss_wifi_mesh_get_stats_handle() - * Get Wi-Fi mesh stats handle from interface number. - */ -struct nss_wifi_mesh_stats_handle *nss_wifi_mesh_get_stats_handle(nss_if_num_t if_num) -{ - uint32_t idx; - - assert_spin_locked(&nss_wifi_mesh_stats_lock); - - for (idx = 0; idx < NSS_WIFI_MESH_MAX_DYNAMIC_INTERFACE; idx++) { - if (nss_wifi_mesh_stats_hdl[idx]) { - if (nss_wifi_mesh_stats_hdl[idx]->if_num == if_num) { - struct nss_wifi_mesh_stats_handle *h = nss_wifi_mesh_stats_hdl[idx]; - return h; - } - } - } - return NULL; -} - -/* - * nss_wifi_mesh_get_stats() - * API for getting stats from a Wi-Fi mesh interface stats - */ -static bool nss_wifi_mesh_get_stats(nss_if_num_t if_num, struct nss_wifi_mesh_hdl_stats_sync_msg *stats) -{ - struct nss_wifi_mesh_stats_handle *h; - - if (!nss_wifi_mesh_verify_if_num(if_num)) { - return false; - } - - spin_lock(&nss_wifi_mesh_stats_lock); - h = nss_wifi_mesh_get_stats_handle(if_num); - if (!h) { - spin_unlock(&nss_wifi_mesh_stats_lock); - nss_warning("Invalid Wi-Fi mesh stats handle for interface number: %d\n", if_num); - return false; - } - - memcpy(stats, &h->stats, sizeof(*stats)); - spin_unlock(&nss_wifi_mesh_stats_lock); - return true; -} - -/* - * nss_wifi_mesh_get_valid_interface_count() - * Get count of valid Wi-Fi mesh interfaces up. - */ -static uint32_t nss_wifi_mesh_get_valid_interface_count(uint16_t type, uint32_t if_num, uint32_t max_if_num) -{ - uint32_t interface_count = 0; - enum nss_dynamic_interface_type dtype; - - for (; if_num <= max_if_num; if_num++) { - if (!nss_is_dynamic_interface(if_num)) { - continue; - } - - dtype = nss_dynamic_interface_get_type(nss_wifi_mesh_get_context(), if_num); - - if ((type == NSS_WIFI_MESH_OUTER_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER)) { - continue; - } - - if ((type == NSS_WIFI_MESH_INNER_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { - continue; - } - - if ((type == NSS_WIFI_MESH_PATH_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { - continue; - } - - if ((type == NSS_WIFI_MESH_PROXY_PATH_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { - continue; - } - interface_count++; - } - return interface_count; -} - -/** - * nss_wifi_mesh_stats_read() - * Read Wi-Fi Mesh stats. - */ -static ssize_t nss_wifi_mesh_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos, uint16_t type) -{ - uint32_t max_output_lines, max_stats; - size_t size_al, size_wr; - ssize_t bytes_read = 0; - struct nss_stats_data *data = fp->private_data; - int ifindex; - uint32_t if_num = NSS_DYNAMIC_IF_START; - uint32_t interface_count = 0; - uint32_t max_if_num = NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES; - struct nss_wifi_mesh_hdl_stats_sync_msg *stats; - struct net_device *ndev; - struct nss_wifi_mesh_stats_handle *handle; - char *lbuf; - enum nss_dynamic_interface_type dtype; - - if (data) { - if_num = data->if_num; - } - - /* - * If we are done accomodating all the Wi-Fi mesh interfaces. - */ - if (if_num > max_if_num) { - return 0; - } - - /* - * Get number of Wi-Fi mesh interfaces up. - */ - interface_count = nss_wifi_mesh_get_valid_interface_count(type, if_num, max_if_num); - if (!interface_count) { - nss_warning("%px: Invalid number of valid interface for if_num: 0x%x\n", data, if_num); - return 0; - } - - /* - * max output lines = #stats + Number of Extra outputlines for future reference to add new stats + - * Maximum node stats + Maximum of all the stats + three blank lines. - */ - max_stats = nss_wifi_mesh_max_statistics(); - max_output_lines = max_stats + NSS_STATS_NODE_MAX + NSS_STATS_EXTRA_OUTPUT_LINES; - size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines * interface_count; - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer\n"); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "wifi_mesh", NSS_STATS_SINGLE_CORE); - - stats = kzalloc(sizeof(struct nss_wifi_mesh_hdl_stats_sync_msg), GFP_KERNEL); - if (!stats) { - nss_warning("%px: Failed to allocate stats memory for if_num: 0x%x\n", data, if_num); - kfree(lbuf); - return 0; - } - - for (; if_num <= max_if_num; if_num++) { - bool ret; - - if (!nss_is_dynamic_interface(if_num)) { - continue; - } - - dtype = nss_dynamic_interface_get_type(nss_wifi_mesh_get_context(), if_num); - - if ((type == NSS_WIFI_MESH_OUTER_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER)) { - continue; - } - - if ((type == NSS_WIFI_MESH_INNER_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { - continue; - } - - if ((type == NSS_WIFI_MESH_PATH_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { - continue; - } - - if ((type == NSS_WIFI_MESH_PROXY_PATH_STATS) && (dtype != NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER)) { - continue; - } - - /* - * If Wi-Fi mesh stats handle does not exists, then ret will be false. - */ - ret = nss_wifi_mesh_get_stats(if_num, stats); - if (!ret) { - continue; - } - - spin_lock(&nss_wifi_mesh_stats_lock); - handle = nss_wifi_mesh_get_stats_handle(if_num); - if (!handle) { - spin_unlock(&nss_wifi_mesh_stats_lock); - nss_warning("Invalid Wi-Fi mesh stats handle, if_num: %d\n", if_num); - continue; - } - ifindex = handle->ifindex; - spin_unlock(&nss_wifi_mesh_stats_lock); - - ndev = dev_get_by_index(&init_net, ifindex); - if (!ndev) { - continue; - } - - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n%s if_num:%03u\n", - ndev->name, if_num); - dev_put(ndev); - - /* - * Read encap stats, path stats, proxy path stats from inner node and decap stats from outer node. - */ - switch (type) { - case NSS_WIFI_MESH_INNER_STATS: - size_wr += nss_stats_print("wifi_mesh", "encap stats", NSS_STATS_SINGLE_INSTANCE - , nss_wifi_mesh_strings_encap_stats - , stats->encap_stats - , NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX - , lbuf, size_wr, size_al); - break; - - case NSS_WIFI_MESH_PATH_STATS: - size_wr += nss_stats_print("wifi_mesh", "path stats", NSS_STATS_SINGLE_INSTANCE - , nss_wifi_mesh_strings_path_stats - , stats->path_stats - , NSS_WIFI_MESH_PATH_STATS_TYPE_MAX - , lbuf, size_wr, size_al); - break; - - case NSS_WIFI_MESH_PROXY_PATH_STATS: - size_wr += nss_stats_print("wifi_mesh", "proxy path stats", NSS_STATS_SINGLE_INSTANCE - , nss_wifi_mesh_strings_proxy_path_stats - , stats->proxy_path_stats - , NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX - , lbuf, size_wr, size_al); - break; - - case NSS_WIFI_MESH_OUTER_STATS: - size_wr += nss_stats_print("wifi_mesh", "decap stats", NSS_STATS_SINGLE_INSTANCE - , nss_wifi_mesh_strings_decap_stats - , stats->decap_stats - , NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX - , lbuf, size_wr, size_al); - break; - - case NSS_WIFI_MESH_EXCEPTION_STATS: - size_wr += nss_stats_print("wifi_mesh", "exception stats", NSS_STATS_SINGLE_INSTANCE - , nss_wifi_mesh_strings_exception_stats - , stats->except_stats - , NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX - , lbuf, size_wr, size_al); - break; - - default: - nss_warning("%px: Invalid stats type: %d\n", stats, type); - nss_assert(0); - kfree(stats); - kfree(lbuf); - return 0; - } - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, size_wr); - kfree(stats); - kfree(lbuf); - return bytes_read; -} - -/** - * nss_wifi_mesh_decap_stats_read() - * Read Wi-Fi Mesh decap stats. - */ -static ssize_t nss_wifi_mesh_decap_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_OUTER_STATS); -} - -/** - * nss_wifi_mesh_encap_stats_read() - * Read Wi-Fi Mesh encap stats - */ -static ssize_t nss_wifi_mesh_encap_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_INNER_STATS); -} - -/** - * nss_wifi_mesh_path_stats_read() - * Read Wi-Fi Mesh path stats - */ -static ssize_t nss_wifi_mesh_path_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_PATH_STATS); -} - -/** - * nss_wifi_mesh_proxy_path_stats_read() - * Read Wi-Fi Mesh proxy path stats - */ -static ssize_t nss_wifi_mesh_proxy_path_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_PROXY_PATH_STATS); -} - -/** - * nss_wifi_mesh_exception_stats_read() - * Read Wi-Fi Mesh exception stats - */ -static ssize_t nss_wifi_mesh_exception_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_wifi_mesh_stats_read(fp, ubuf, sz, ppos, NSS_WIFI_MESH_EXCEPTION_STATS); -} - -/* - * nss_wifi_mesh_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_encap); -NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_decap); -NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_path); -NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_proxy_path); -NSS_STATS_DECLARE_FILE_OPERATIONS(wifi_mesh_exception); - -/* - * nss_wifi_mesh_get_interface_type() - * Function to get the type of dynamic interface. - */ -static enum nss_dynamic_interface_type nss_wifi_mesh_get_interface_type(nss_if_num_t if_num) -{ - struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.wifi_handler_id]; - NSS_VERIFY_CTX_MAGIC(nss_ctx); - return nss_dynamic_interface_get_type(nss_ctx, if_num); -} - -/* - * nss_wifi_mesh_update_stats() - * Update stats for Wi-Fi mesh interface. - */ -void nss_wifi_mesh_update_stats(nss_if_num_t if_num, struct nss_wifi_mesh_stats_sync_msg *mstats) -{ - struct nss_wifi_mesh_stats_handle *handle; - struct nss_wifi_mesh_hdl_stats_sync_msg *stats; - enum nss_dynamic_interface_type type; - uint64_t *dst; - uint32_t *src; - int i; - - spin_lock(&nss_wifi_mesh_stats_lock); - handle = nss_wifi_mesh_get_stats_handle(if_num); - if (!handle) { - spin_unlock(&nss_wifi_mesh_stats_lock); - nss_warning("Invalid Wi-Fi mesh stats handle, if_num: %d\n", if_num); - return; - } - - type = nss_wifi_mesh_get_interface_type(handle->if_num);; - stats = &handle->stats; - - switch (type) { - case NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER: - /* - * Update pnode Rx stats. - */ - stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_PACKETS] += mstats->pnode_stats.rx_packets; - stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_BYTES] += mstats->pnode_stats.rx_bytes; - stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_RX_DROPPED] += nss_cmn_rx_dropped_sum(&mstats->pnode_stats); - - /* - * Update pnode Tx stats. - */ - stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_TX_PACKETS] += mstats->pnode_stats.tx_packets; - stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_PNODE_TX_BYTES] += mstats->pnode_stats.tx_bytes; - - /* - * Update encap stats. - */ - dst = &stats->encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_EXPIRY_NOTIFY_SENT]; - src = &mstats->mesh_encap_stats.expiry_notify_sent; - for (i = NSS_WIFI_MESH_ENCAP_STATS_TYPE_EXPIRY_NOTIFY_SENT; i < NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX; i++) { - *dst++ += *src++; - } - - /* - * Update mesh path stats. - */ - dst = &stats->path_stats[NSS_WIFI_MESH_PATH_STATS_TYPE_ALLOC_FAILURES]; - src = &mstats->mesh_path_stats.alloc_failures; - for (i = NSS_WIFI_MESH_PATH_STATS_TYPE_ALLOC_FAILURES; i < NSS_WIFI_MESH_PATH_STATS_TYPE_MAX; i++) { - *dst++ += *src++; - } - - /* - * Update mesh proxy path stats. - */ - dst = &stats->proxy_path_stats[NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_ALLOC_FAILURES]; - src = &mstats->mesh_proxy_path_stats.alloc_failures; - for (i = NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_ALLOC_FAILURES; i < NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX; i++) { - *dst++ += *src++; - } - - /* - * Update exception stats. - */ - dst = &stats->except_stats[NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_PACKETS_SUCCESS]; - src = &mstats->mesh_except_stats.packets_success; - for (i = NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_PACKETS_SUCCESS; i < NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX; i++) { - *dst++ += *src++; - } - spin_unlock(&nss_wifi_mesh_stats_lock); - break; - - case NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER: - /* - * Update pnode Rx stats. - */ - stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_PACKETS] += mstats->pnode_stats.rx_packets; - stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_BYTES] += mstats->pnode_stats.rx_bytes; - stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_RX_DROPPED] += nss_cmn_rx_dropped_sum(&mstats->pnode_stats); - - /* - * Update pnode Tx stats. - */ - stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_TX_PACKETS] += mstats->pnode_stats.tx_packets; - stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PNODE_TX_BYTES] += mstats->pnode_stats.tx_bytes; - - /* - * Update decap stats. - */ - dst = &stats->decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_PATH_REFRESH_SENT]; - src = &mstats->mesh_decap_stats.path_refresh_sent; - for (i = NSS_WIFI_MESH_DECAP_STATS_TYPE_PATH_REFRESH_SENT; i < NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX; i++) { - *dst++ += *src++; - } - spin_unlock(&nss_wifi_mesh_stats_lock); - break; - - default: - spin_unlock(&nss_wifi_mesh_stats_lock); - nss_warning("%px: Received invalid dynamic interface type: %d\n", handle, type); - nss_assert(0); - } -} - -/* - * nss_wifi_mesh_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_wifi_mesh_stats_notify(nss_if_num_t if_num, uint32_t core_id) -{ - struct nss_wifi_mesh_stats_notification wifi_mesh_stats; - - if (!nss_wifi_mesh_get_stats(if_num, &wifi_mesh_stats.stats)) { - nss_warning("No handle is present with ifnum: 0x%x\n", if_num); - return; - } - - wifi_mesh_stats.core_id = core_id; - wifi_mesh_stats.if_num = if_num; - atomic_notifier_call_chain(&nss_wifi_mesh_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)&wifi_mesh_stats); -} - -/* - * nss_wifi_mesh_stats_dentry_create() - * Create Wi-Fi Mesh statistics debug entry - */ -struct dentry *nss_wifi_mesh_stats_dentry_create(void) -{ - struct dentry *stats_dentry_dir; - struct dentry *stats_file; - char dir_name[NSS_WIFI_MESH_DENTRY_FILE_SIZE] = {0}; - - if (!nss_top_main.stats_dentry) { - nss_warning("qca-nss-drv/stats is not present\n"); - return NULL; - } - - snprintf(dir_name, sizeof(dir_name), "wifi_mesh"); - - stats_dentry_dir = debugfs_create_dir(dir_name, nss_top_main.stats_dentry); - if (!stats_dentry_dir) { - nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh directory\n"); - return NULL; - } - - stats_file = debugfs_create_file("encap_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_encap_stats_ops); - if (!stats_file) { - nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/encap_stats file\n"); - goto fail; - } - - stats_file = debugfs_create_file("decap_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_decap_stats_ops); - if (!stats_file) { - nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/decap_stats file\n"); - goto fail; - } - - stats_file = debugfs_create_file("path_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_path_stats_ops); - if (!stats_file) { - nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/path_stats file\n"); - goto fail; - } - - stats_file = debugfs_create_file("proxy_path_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_proxy_path_stats_ops); - if (!stats_file) { - nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/proxy_path_stats file\n"); - goto fail; - } - stats_file = debugfs_create_file("exception_stats", 0400, stats_dentry_dir, &nss_top_main, &nss_wifi_mesh_exception_stats_ops); - if (!stats_file) { - nss_warning("Failed to create qca-nss-drv/stats/wifi_mesh/exception_stats file\n"); - goto fail; - } - return stats_dentry_dir; -fail: - debugfs_remove_recursive(stats_dentry_dir); - return NULL; -} - -/** - * nss_wifi_mesh_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_wifi_mesh_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_wifi_mesh_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_wifi_mesh_stats_register_notifier); - -/** - * nss_wifi_mesh_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_wifi_mesh_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_wifi_mesh_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_wifi_mesh_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.h deleted file mode 100644 index 0e3a11850..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_stats.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_WIFI_MESH_STATS_H__ -#define __NSS_WIFI_MESH_STATS_H__ - -/** - * Array of pointer for NSS Wi-Fi mesh handles. - * Each handle has per-tunnel statistics based on the interface number which is an index. - */ -struct nss_wifi_mesh_stats_handle { - nss_if_num_t if_num; /**< Interface number. */ - uint32_t ifindex; /**< Netdev index. */ - uint32_t mesh_idx; /**< Mesh index. */ - struct nss_wifi_mesh_hdl_stats_sync_msg stats; /**< Stats per-interface number. */ -}; - -/* - * Wi-Fi Mesh statistics APIs - */ -extern void nss_wifi_mesh_update_stats(nss_if_num_t if_num, struct nss_wifi_mesh_stats_sync_msg *mstats); -extern void nss_wifi_mesh_stats_notify(nss_if_num_t if_num, uint32_t core_id); -extern struct dentry *nss_wifi_mesh_stats_dentry_create(void); -extern struct nss_wifi_mesh_stats_handle *nss_wifi_mesh_get_stats_handle(nss_if_num_t if_num); -extern bool nss_wifi_mesh_stats_handle_alloc(nss_if_num_t if_num, int32_t ifindex); -extern bool nss_wifi_mesh_stats_handle_free(nss_if_num_t if_num); -#endif /* __NSS_WIFI_MESH_STATS_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.c deleted file mode 100644 index 25f647323..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_wifi_mesh_stats.h" -#include "nss_strings.h" -#include "nss_wifi_mesh_strings.h" - -/* - * nss_wifi_mesh_strings_encap_stats - * Wi-Fi mesh encap statistics string. - */ -struct nss_stats_info nss_wifi_mesh_strings_encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX] = { - {"rx_packets", NSS_STATS_TYPE_COMMON}, - {"rx_bytes", NSS_STATS_TYPE_COMMON}, - {"tx_packets", NSS_STATS_TYPE_COMMON}, - {"tx_bytes", NSS_STATS_TYPE_COMMON}, - {"rx_dropped", NSS_STATS_TYPE_COMMON}, - {"expiry_notify_sent", NSS_STATS_TYPE_SPECIAL}, - {"mc_count", NSS_STATS_TYPE_SPECIAL}, - {"mp_not_found", NSS_STATS_TYPE_SPECIAL}, - {"mp_active", NSS_STATS_TYPE_SPECIAL}, - {"mpp_not_found", NSS_STATS_TYPE_SPECIAL}, - {"mpp_found", NSS_STATS_TYPE_SPECIAL}, - {"encap_hdr_fail", NSS_STATS_TYPE_SPECIAL}, - {"mp_del_notify_fail", NSS_STATS_TYPE_SPECIAL}, - {"link_enqueue", NSS_STATS_TYPE_SPECIAL}, - {"link_enq_fail", NSS_STATS_TYPE_SPECIAL}, - {"ra_lup_fail", NSS_STATS_TYPE_SPECIAL}, - {"dummy_add_count", NSS_STATS_TYPE_SPECIAL}, - {"encap_mp_add_notify_fail", NSS_STATS_TYPE_SPECIAL}, - {"dummy_add_fail", NSS_STATS_TYPE_SPECIAL}, - {"dummy_lup_fail", NSS_STATS_TYPE_SPECIAL}, - {"send_to_host_failed", NSS_STATS_TYPE_SPECIAL}, - {"sent_to_host", NSS_STATS_TYPE_SPECIAL}, - {"expiry_notify_fail", NSS_STATS_TYPE_SPECIAL}, - {"no_headroom", NSS_STATS_TYPE_SPECIAL}, - {"path_refresh_sent", NSS_STATS_TYPE_SPECIAL}, - {"linearise_failed", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifi_mesh_encap_strings_read() - * Read Wi-Fi mesh encap statistics names. - */ -static ssize_t nss_wifi_mesh_encap_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_encap_stats, NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX); -} - -/* - * nss_wifi_mesh_strings_path_stats - * Wi-Fi mesh path statistics string. - */ -struct nss_stats_info nss_wifi_mesh_strings_path_stats[NSS_WIFI_MESH_PATH_STATS_TYPE_MAX] = { - {"alloc_failures", NSS_STATS_TYPE_SPECIAL}, - {"error_max_radio_count", NSS_STATS_TYPE_SPECIAL}, - {"invalid_interface_failures", NSS_STATS_TYPE_SPECIAL}, - {"add_success", NSS_STATS_TYPE_SPECIAL}, - {"table_full_errors", NSS_STATS_TYPE_SPECIAL}, - {"insert_failures", NSS_STATS_TYPE_SPECIAL}, - {"not_found", NSS_STATS_TYPE_SPECIAL}, - {"delete_success", NSS_STATS_TYPE_SPECIAL}, - {"update_success", NSS_STATS_TYPE_SPECIAL}, - {"mesh_path_expired", NSS_STATS_TYPE_SPECIAL}, - {"mesh_path_refresh_needed", NSS_STATS_TYPE_SPECIAL}, - {"add_requests", NSS_STATS_TYPE_SPECIAL}, - {"del_requests", NSS_STATS_TYPE_SPECIAL}, - {"update_requests", NSS_STATS_TYPE_SPECIAL}, - {"next_hop_updations", NSS_STATS_TYPE_SPECIAL}, - {"hop_count_updations", NSS_STATS_TYPE_SPECIAL}, - {"flag_updations", NSS_STATS_TYPE_SPECIAL}, - {"metric_updations", NSS_STATS_TYPE_SPECIAL}, - {"block_mesh_fwd_updations", NSS_STATS_TYPE_SPECIAL}, - {"delete_failures", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifi_mesh_path_strings_read() - * Read Wi-Fi mesh path statistics names. - */ -static ssize_t nss_wifi_mesh_path_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_path_stats, NSS_WIFI_MESH_PATH_STATS_TYPE_MAX); -} - -/* - * nss_wifi_mesh_strings_proxy_path_stats - * Wi-Fi mesh proxy path statistics string. - */ -struct nss_stats_info nss_wifi_mesh_strings_proxy_path_stats[NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX] = { - {"alloc_failures", NSS_STATS_TYPE_SPECIAL}, - {"entry_exist_failures", NSS_STATS_TYPE_SPECIAL}, - {"add_success", NSS_STATS_TYPE_SPECIAL}, - {"table_full_errors", NSS_STATS_TYPE_SPECIAL}, - {"insert_failures", NSS_STATS_TYPE_SPECIAL}, - {"not_found", NSS_STATS_TYPE_SPECIAL}, - {"unhashed_errors", NSS_STATS_TYPE_SPECIAL}, - {"delete_failures", NSS_STATS_TYPE_SPECIAL}, - {"delete_success", NSS_STATS_TYPE_SPECIAL}, - {"update_success", NSS_STATS_TYPE_SPECIAL}, - {"lookup_success", NSS_STATS_TYPE_SPECIAL}, - {"add_requests", NSS_STATS_TYPE_SPECIAL}, - {"del_requests", NSS_STATS_TYPE_SPECIAL}, - {"update_requests", NSS_STATS_TYPE_SPECIAL}, - {"mda_updations", NSS_STATS_TYPE_SPECIAL}, - {"flag_updations", NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifi_mesh_proxy_path_strings_read() - * Read Wi-Fi mesh proxy path statistics names. - */ -static ssize_t nss_wifi_mesh_proxy_path_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_proxy_path_stats, NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX); -} - -/* - * nss_wifi_mesh_strings_decap_stats - * Wi-Fi mesh decap statistics string. - */ -struct nss_stats_info nss_wifi_mesh_strings_decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX] = { - {"rx_packets", NSS_STATS_TYPE_COMMON}, - {"rx_bytes", NSS_STATS_TYPE_COMMON}, - {"tx_packets", NSS_STATS_TYPE_COMMON}, - {"tx_bytes", NSS_STATS_TYPE_COMMON}, - {"rx_dropped", NSS_STATS_TYPE_COMMON}, - {"path_refresh_sent", NSS_STATS_TYPE_SPECIAL}, - {"reserved", NSS_STATS_TYPE_SPECIAL}, - {"mc_drop", NSS_STATS_TYPE_DROP}, - {"ttl_0", NSS_STATS_TYPE_SPECIAL}, - {"mpp_lup_fail", NSS_STATS_TYPE_SPECIAL}, - {"decap_hdr_fail", NSS_STATS_TYPE_SPECIAL}, - {"rx_fwd_fail", NSS_STATS_TYPE_SPECIAL}, - {"rx_fwd_success", NSS_STATS_TYPE_SPECIAL}, - {"mp_fwd_lookup_fail", NSS_STATS_TYPE_SPECIAL}, - {"mp_fwd_inactive", NSS_STATS_TYPE_SPECIAL}, - {"nxt_mnode_fwd_success", NSS_STATS_TYPE_SPECIAL}, - {"nxt_mnode_fwd_fail", NSS_STATS_TYPE_SPECIAL}, - {"mpp_add_fail", NSS_STATS_TYPE_SPECIAL}, - {"mpp_add_event2host_fail", NSS_STATS_TYPE_SPECIAL}, - {"mpp_upate_fail", NSS_STATS_TYPE_SPECIAL}, - {"mpp_update_even2host_fail", NSS_STATS_TYPE_SPECIAL}, - {"mpp_learn2host_fail", NSS_STATS_TYPE_SPECIAL}, - {"block_mesh_fwd_packets", NSS_STATS_TYPE_SPECIAL}, - {"no_headroom", NSS_STATS_TYPE_SPECIAL}, - {"linearise_failed", NSS_STATS_TYPE_SPECIAL}, - {"mpp_learn_event_rl_dropped", NSS_STATS_TYPE_DROP}, - {"mp_missging_event_rl_dropped", NSS_STATS_TYPE_DROP} -}; - -/* - * nss_wifi_mesh_decap_strings_read() - * Read Wi-Fi mesh decap statistics names. - */ -static ssize_t nss_wifi_mesh_decap_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_decap_stats, NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX); -} - -/* - * nss_wifi_mesh_strings_exception_stats - * Wi-Fi mesh exception statistics string. - */ -struct nss_stats_info nss_wifi_mesh_strings_exception_stats[NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX] = { - {"packets_success", NSS_STATS_TYPE_SPECIAL}, - {"packets_failure", NSS_STATS_TYPE_DROP} -}; - -/* - * nss_wifi_mesh_exception_strings_read() - * Read Wi-Fi mesh exception statistics names. - */ -static ssize_t nss_wifi_mesh_exception_stats_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifi_mesh_strings_exception_stats, NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX); -} - -/* - * nss_wifi_mesh_decap_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_decap_stats); - -/* - * nss_wifi_mesh_encap_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_encap_stats); - -/* - * nss_wifi_mesh_path_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_path_stats); - -/* - * nss_wifi_mesh_proxy_path_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_proxy_path_stats); - -/* - * nss_wifi_mesh_exception_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifi_mesh_exception_stats); - -/* - * nss_wifi_mesh_strings_dentry_create() - * Create Wi-Fi mesh statistics strings debug entry. - */ -struct dentry *nss_wifi_mesh_strings_dentry_create(void) -{ - struct dentry *str_dentry_dir; - struct dentry *str_file; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present\n"); - return NULL; - } - - str_dentry_dir = debugfs_create_dir("wifi_mesh", nss_top_main.strings_dentry); - if (!str_dentry_dir) { - nss_warning("Failed to create qca-nss-drv/string/wifi_mesh directory\n"); - return NULL; - } - - str_file = debugfs_create_file("encap_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_encap_stats_strings_ops); - if (!str_file) { - nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/encap_stats file\n"); - goto fail; - } - - str_file = debugfs_create_file("decap_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_decap_stats_strings_ops); - if (!str_file) { - nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/decap_stats file\n"); - goto fail; - } - - str_file = debugfs_create_file("path_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_path_stats_strings_ops); - if (!str_file) { - nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/path_stats file\n"); - goto fail; - } - - str_file = debugfs_create_file("proxy_path_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_proxy_path_stats_strings_ops); - if (!str_file) { - nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/proxy_path_stats file\n"); - goto fail; - } - - str_file = debugfs_create_file("exception_stats", 0400, str_dentry_dir, &nss_top_main, &nss_wifi_mesh_exception_stats_strings_ops); - if (!str_file) { - nss_warning("Failed to create qca-nss-drv/string/wifi_mesh/exception_stats file\n"); - goto fail; - } - - return str_dentry_dir; -fail: - debugfs_remove_recursive(str_dentry_dir); - return NULL; -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.h deleted file mode 100644 index e858cbd05..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_mesh_strings.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_WIFI_MESH_STRINGS_H -#define __NSS_WIFI_MESH_STRINGS_H - -#include "nss_wifi_mesh_stats.h" -#include "nss_strings.h" - -extern struct nss_stats_info nss_wifi_mesh_strings_encap_stats[NSS_WIFI_MESH_ENCAP_STATS_TYPE_MAX]; -extern struct nss_stats_info nss_wifi_mesh_strings_decap_stats[NSS_WIFI_MESH_DECAP_STATS_TYPE_MAX]; -extern struct nss_stats_info nss_wifi_mesh_strings_path_stats[NSS_WIFI_MESH_PATH_STATS_TYPE_MAX]; -extern struct nss_stats_info nss_wifi_mesh_strings_proxy_path_stats[NSS_WIFI_MESH_PROXY_PATH_STATS_TYPE_MAX]; -extern struct nss_stats_info nss_wifi_mesh_strings_exception_stats[NSS_WIFI_MESH_EXCEPTION_STATS_TYPE_MAX]; -extern struct dentry *nss_wifi_mesh_strings_dentry_create(void); - -#endif /* __NSS_WIFI_MESH_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_stats.c deleted file mode 100644 index 7a31b25b9..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_stats.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2016-2017, 2019-2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_core.h" -#include "nss_wifi.h" -#include "nss_wifi_stats.h" - -/* - * nss_wifi_stats_str - * Wifi statistics strings. - */ -struct nss_stats_info nss_wifi_stats_str[NSS_WIFI_STATS_MAX] = { - {"rx_pkts" , NSS_STATS_TYPE_COMMON}, - {"rx_queue[0]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[1]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[2]_drops" , NSS_STATS_TYPE_DROP}, - {"rx_queue[3]_drops" , NSS_STATS_TYPE_DROP}, - {"tx_pkts" , NSS_STATS_TYPE_COMMON}, - {"tx_drops" , NSS_STATS_TYPE_DROP}, - {"tx_transmit_completed" , NSS_STATS_TYPE_SPECIAL}, - {"tx_mgmt_received" , NSS_STATS_TYPE_SPECIAL}, - {"tx_mgmt_transmitted" , NSS_STATS_TYPE_SPECIAL}, - {"tx_mgmt_drops" , NSS_STATS_TYPE_DROP}, - {"tx_mgmt_completed" , NSS_STATS_TYPE_SPECIAL}, - {"tx_inv_peer_enq_cnt" , NSS_STATS_TYPE_SPECIAL}, - {"rx_inv_peer_rcv_cnt" , NSS_STATS_TYPE_SPECIAL}, - {"rx_pn_check_failed" , NSS_STATS_TYPE_DROP}, - {"rx_pkts_deliverd" , NSS_STATS_TYPE_SPECIAL}, - {"rx_bytes_delivered" , NSS_STATS_TYPE_SPECIAL}, - {"tx_bytes_completed" , NSS_STATS_TYPE_SPECIAL}, - {"rx_deliver_unaligned_drop_cnt" , NSS_STATS_TYPE_DROP}, - {"tidq_enqueue_cnt_0" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_enqueue_cnt_1" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_enqueue_cnt_2" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_enqueue_cnt_3" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_enqueue_cnt_4" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_enqueue_cnt_5" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_enqueue_cnt_6" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_enqueue_cnt_7" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_cnt_0" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_cnt_1" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_cnt_2" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_cnt_3" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_cnt_4" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_cnt_5" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_cnt_6" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_cnt_7" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_enqueue_fail_cnt_0" , NSS_STATS_TYPE_DROP}, - {"tidq_enqueue_fail_cnt_1" , NSS_STATS_TYPE_DROP}, - {"tidq_enqueue_fail_cnt_2" , NSS_STATS_TYPE_DROP}, - {"tidq_enqueue_fail_cnt_3" , NSS_STATS_TYPE_DROP}, - {"tidq_enqueue_fail_cnt_4" , NSS_STATS_TYPE_DROP}, - {"tidq_enqueue_fail_cnt_5" , NSS_STATS_TYPE_DROP}, - {"tidq_enqueue_fail_cnt_6" , NSS_STATS_TYPE_DROP}, - {"tidq_enqueue_fail_cnt_7" , NSS_STATS_TYPE_DROP}, - {"tidq_ttl_expire_cnt_0" , NSS_STATS_TYPE_DROP}, - {"tidq_ttl_expire_cnt_1" , NSS_STATS_TYPE_DROP}, - {"tidq_ttl_expire_cnt_2" , NSS_STATS_TYPE_DROP}, - {"tidq_ttl_expire_cnt_3" , NSS_STATS_TYPE_DROP}, - {"tidq_ttl_expire_cnt_4" , NSS_STATS_TYPE_DROP}, - {"tidq_ttl_expire_cnt_5" , NSS_STATS_TYPE_DROP}, - {"tidq_ttl_expire_cnt_6" , NSS_STATS_TYPE_DROP}, - {"tidq_ttl_expire_cnt_7" , NSS_STATS_TYPE_DROP}, - {"tidq_dequeue_req_cnt_0" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_req_cnt_1" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_req_cnt_2" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_req_cnt_3" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_req_cnt_4" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_req_cnt_5" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_req_cnt_6" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_dequeue_req_cnt_7" , NSS_STATS_TYPE_SPECIAL}, - {"total_tidq_depth" , NSS_STATS_TYPE_SPECIAL}, - {"rx_htt_fetch_cnt" , NSS_STATS_TYPE_SPECIAL}, - {"total_tidq_bypass_cnt" , NSS_STATS_TYPE_SPECIAL}, - {"global_q_full_cnt" , NSS_STATS_TYPE_SPECIAL}, - {"tidq_full_cnt" , NSS_STATS_TYPE_SPECIAL} -}; - -uint64_t nss_wifi_stats[NSS_MAX_WIFI_RADIO_INTERFACES][NSS_WIFI_STATS_MAX]; /* WIFI statistics */ - -/* - * nss_wifi_stats_read() - * Read wifi statistics. - */ -static ssize_t nss_wifi_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - uint32_t i, id; - - /* - * Max output lines = #stats * NSS_MAX_CORES + - * Few output lines for banner printing + Number of Extra outputlines for future reference to add new stats. - */ - uint32_t max_output_lines = NSS_WIFI_STATS_MAX * NSS_MAX_WIFI_RADIO_INTERFACES + NSS_STATS_EXTRA_OUTPUT_LINES; - size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - size_t size_wr = 0; - ssize_t bytes_read = 0; - uint64_t *stats_shadow; - - char *lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - stats_shadow = kzalloc(NSS_WIFI_STATS_MAX * 8, GFP_KERNEL); - if (unlikely(stats_shadow == NULL)) { - nss_warning("Could not allocate memory for local shadow buffer"); - kfree(lbuf); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "wifi", NSS_STATS_SINGLE_CORE); - - for (id = 0; id < NSS_MAX_WIFI_RADIO_INTERFACES; id++) { - spin_lock_bh(&nss_top_main.stats_lock); - for (i = 0; (i < NSS_WIFI_STATS_MAX); i++) { - stats_shadow[i] = nss_wifi_stats[id][i]; - } - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifi", NULL, id, nss_wifi_stats_str, stats_shadow, NSS_WIFI_STATS_MAX, lbuf, size_wr, size_al); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - kfree(stats_shadow); - return bytes_read; -} - -/* - * nss_wifi_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(wifi) - -/* - * nss_wifi_stats_dentry_create() - * Create wifi statistics debug entry. - */ -void nss_wifi_stats_dentry_create(void) -{ - nss_stats_create_dentry("wifi", &nss_wifi_stats_ops); -} - -/* - * nss_wifi_stats_sync() - * Handle the syncing of WIFI stats. - */ -void nss_wifi_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_wifi_stats_sync_msg *stats, uint16_t interface) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - uint32_t radio_id = interface - NSS_WIFI_INTERFACE0; - uint8_t i = 0; - - if (radio_id >= NSS_MAX_WIFI_RADIO_INTERFACES) { - nss_warning("%px: invalid interface: %d", nss_ctx, interface); - return; - } - - spin_lock_bh(&nss_top->stats_lock); - - /* - * Tx/Rx stats - */ - nss_wifi_stats[radio_id][NSS_WIFI_STATS_RX_PKTS] += stats->node_stats.rx_packets; - for (i = 0; i < NSS_MAX_NUM_PRI; i++) { - nss_wifi_stats[radio_id][NSS_WIFI_STATS_RX_QUEUE_0_DROPPED + i] += stats->node_stats.rx_dropped[i]; - } - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TX_PKTS] += stats->node_stats.tx_packets; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TX_DROPPED] += stats->tx_transmit_dropped; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TX_COMPLETED] += stats->tx_transmit_completions; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_MGMT_RCV_CNT] += stats->tx_mgmt_rcv_cnt; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_MGMT_TX_PKTS] += stats->tx_mgmt_pkts; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_MGMT_TX_DROPPED] += stats->tx_mgmt_dropped; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_MGMT_TX_COMPLETIONS] += stats->tx_mgmt_completions; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TX_INV_PEER_ENQUEUE_CNT] += stats->tx_inv_peer_enq_cnt; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_RX_INV_PEER_RCV_CNT] += stats->rx_inv_peer_rcv_cnt; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_RX_PN_CHECK_FAILED] += stats->rx_pn_check_failed; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_RX_DELIVERED] += stats->rx_pkts_deliverd; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_RX_BYTES_DELIVERED] += stats->rx_bytes_deliverd; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TX_BYTES_COMPLETED] += stats->tx_bytes_transmit_completions; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_RX_DELIVER_UNALIGNED_DROP_CNT] += stats->rx_deliver_unaligned_drop_cnt; - - for (i = 0; i < NSS_WIFI_TX_NUM_TOS_TIDS; i++) { - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TIDQ_ENQUEUE_CNT + i] += stats->tidq_enqueue_cnt[i]; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TIDQ_DEQUEUE_CNT + i] += stats->tidq_dequeue_cnt[i]; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TIDQ_ENQUEUE_FAIL_CNT + i] += stats->tidq_enqueue_fail_cnt[i]; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TIDQ_TTL_EXPIRE_CNT + i] += stats->tidq_ttl_expire_cnt[i]; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TIDQ_DEQUEUE_REQ_CNT + i] += stats->tidq_dequeue_req_cnt[i]; - } - - nss_wifi_stats[radio_id][NSS_WIFI_STATS_RX_HTT_FETCH_CNT] += stats->rx_htt_fetch_cnt; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TOTAL_TIDQ_DEPTH] = stats->total_tidq_depth; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TOTAL_TIDQ_BYPASS_CNT] += stats->total_tidq_bypass_cnt; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_GLOBAL_Q_FULL_CNT] += stats->global_q_full_cnt; - nss_wifi_stats[radio_id][NSS_WIFI_STATS_TIDQ_FULL_CNT] += stats->tidq_full_cnt; - - spin_unlock_bh(&nss_top->stats_lock); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_stats.h deleted file mode 100644 index 782777777..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_stats.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_WIFI_STATS_H -#define __NSS_WIFI_STATS_H - -/* - * wifi statistics - */ -enum nss_wifi_stats_types { - NSS_WIFI_STATS_RX_PKTS, - NSS_WIFI_STATS_RX_QUEUE_0_DROPPED, - NSS_WIFI_STATS_RX_QUEUE_1_DROPPED, - NSS_WIFI_STATS_RX_QUEUE_2_DROPPED, - NSS_WIFI_STATS_RX_QUEUE_3_DROPPED, - NSS_WIFI_STATS_TX_PKTS, - NSS_WIFI_STATS_TX_DROPPED, - NSS_WIFI_STATS_TX_COMPLETED, - NSS_WIFI_STATS_MGMT_RCV_CNT, - NSS_WIFI_STATS_MGMT_TX_PKTS, - NSS_WIFI_STATS_MGMT_TX_DROPPED, - NSS_WIFI_STATS_MGMT_TX_COMPLETIONS, - NSS_WIFI_STATS_TX_INV_PEER_ENQUEUE_CNT, - NSS_WIFI_STATS_RX_INV_PEER_RCV_CNT, - NSS_WIFI_STATS_RX_PN_CHECK_FAILED, - NSS_WIFI_STATS_RX_DELIVERED, - NSS_WIFI_STATS_RX_BYTES_DELIVERED, - NSS_WIFI_STATS_TX_BYTES_COMPLETED, - NSS_WIFI_STATS_RX_DELIVER_UNALIGNED_DROP_CNT, - NSS_WIFI_STATS_TIDQ_ENQUEUE_CNT, - NSS_WIFI_STATS_TIDQ_DEQUEUE_CNT = NSS_WIFI_STATS_TIDQ_ENQUEUE_CNT + 8, - NSS_WIFI_STATS_TIDQ_ENQUEUE_FAIL_CNT = NSS_WIFI_STATS_TIDQ_DEQUEUE_CNT + 8, - NSS_WIFI_STATS_TIDQ_TTL_EXPIRE_CNT = NSS_WIFI_STATS_TIDQ_ENQUEUE_FAIL_CNT + 8, - NSS_WIFI_STATS_TIDQ_DEQUEUE_REQ_CNT = NSS_WIFI_STATS_TIDQ_TTL_EXPIRE_CNT + 8, - NSS_WIFI_STATS_TOTAL_TIDQ_DEPTH = NSS_WIFI_STATS_TIDQ_DEQUEUE_REQ_CNT + 8, - NSS_WIFI_STATS_RX_HTT_FETCH_CNT, - NSS_WIFI_STATS_TOTAL_TIDQ_BYPASS_CNT, - NSS_WIFI_STATS_GLOBAL_Q_FULL_CNT, - NSS_WIFI_STATS_TIDQ_FULL_CNT, - NSS_WIFI_STATS_MAX, -}; - -/* - * wifi statistics APIs - */ -extern void nss_wifi_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_wifi_stats_sync_msg *stats, uint16_t interface); -extern void nss_wifi_stats_dentry_create(void); - -#endif /* __NSS_WIFI_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_vdev.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifi_vdev.c deleted file mode 100644 index 8f020b2a6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifi_vdev.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" - -/* - * nss_wifi_vdev_handler() - * Handle NSS -> HLOS messages for wifi_vdev - */ -static void nss_wifi_vdev_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - nss_wifi_vdev_msg_callback_t cb; - - nss_info("%px: NSS->HLOS message for wifi vdev on interface:%d", nss_ctx, ncm->interface); - - BUG_ON(((ncm->interface < NSS_DYNAMIC_IF_START) || (ncm->interface >= (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES)))); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_WIFI_VDEV_MAX_MSG) { - nss_warning("%px: received invalid message %d for wifi vdev interface", nss_ctx, ncm->type); - return; - } - - if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_wifi_vdev_msg)) { - nss_warning("%px: Length of message %d is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm), (int)sizeof(struct nss_wifi_vdev_msg)); - return; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * callback - */ - if (!nss_ctx->subsys_dp_register[ncm->interface].ndev) { - nss_warning("%px: Event received wifi vdev interface %d before registration", nss_ctx, ncm->interface); - return; - - } - - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_core_get_msg_handler(nss_ctx, ncm->interface); - ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].ndev; - } - - /* - * Do we have a callback? - */ - if (!ncm->cb) { - return; - } - - cb = (nss_wifi_vdev_msg_callback_t)ncm->cb; - cb((void *)ncm->app_data, ncm); -} - -/* - * nss_wifi_vdev_msg_init() - * Initialize wifi message. - */ -void nss_wifi_vdev_msg_init(struct nss_wifi_vdev_msg *nim, uint32_t if_num, uint32_t type, uint32_t len, - nss_wifi_vdev_msg_callback_t *cb, void *app_data) -{ - nss_cmn_msg_init(&nim->cm, if_num, type, len, (void *)cb, app_data); -} -EXPORT_SYMBOL(nss_wifi_vdev_msg_init); - -/* - * nss_wifi_vdev_base_tx_msg() - * Transmit a wifi vdev base message to NSSFW - */ -nss_tx_status_t nss_wifi_vdev_base_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_vdev_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - nss_trace("%px: Sending wifi vdev message on interface :%d", nss_ctx, ncm->interface); - - /* - * Sanity checks on the message - */ - - /* - * The interface number shall be wifi vdev base vap - */ - if (ncm->interface != NSS_VAP_INTERFACE) { - nss_warning("%px: wifi vdev base tx request not on wifi vdev vap: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_WIFI_VDEV_MAX_MSG) { - nss_warning("%px: wifi vdev base message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_wifi_vdev_base_tx_msg); - -/* - * nss_wifi_vdev_tx_msg() - * Transmit a wifi vdev message to NSSFW - */ -nss_tx_status_t nss_wifi_vdev_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifi_vdev_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - nss_trace("%px: Sending wifi vdev message on interface :%d", nss_ctx, ncm->interface); - - /* - * Sanity checks on the message - */ - - /* - * Interface shall be of dynamic interface type - */ - if ((ncm->interface < NSS_DYNAMIC_IF_START) || (ncm->interface >= (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))) { - nss_warning("%px: wifi vdev tx request for invalid interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_WIFI_VDEV_MAX_MSG) { - nss_warning("%px: wifi vdev message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_wifi_vdev_tx_msg); - -/* - * nss_wifi_vdev_tx_msg_ext() - * Send special data packet with metadata for vap processing - */ -nss_tx_status_t nss_wifi_vdev_tx_msg_ext(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf) -{ - struct nss_wifi_vdev_msg *nm; - struct nss_cmn_msg *ncm; - nss_tx_status_t status; - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: wifi vdev message dropped as core not ready", nss_ctx); - return NSS_TX_FAILURE_NOT_READY; - } - - nm = (struct nss_wifi_vdev_msg *) os_buf->data; - ncm = &nm->cm; - - nss_trace("%px: Sending wifi vdev message on interface :%d", nss_ctx, ncm->interface); - - /* - * Interface shall be of dynamic interface type - */ - if ((ncm->interface < NSS_DYNAMIC_IF_START) || (ncm->interface >= (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))) { - nss_warning("%px: wifi vdev tx request for invalid interface: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - if (ncm->type >= NSS_WIFI_VDEV_MAX_MSG) { - nss_warning("%px: wifi vdev message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - status = nss_core_send_buffer(nss_ctx, 0, os_buf, NSS_IF_H2N_CMD_QUEUE, H2N_BUFFER_CTRL, H2N_BIT_FLAG_BUFFER_REUSABLE); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: Unable to enqueue 'wifi vdev message'", nss_ctx); - return NSS_TX_FAILURE; - } - - nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); - - NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_CMD_REQ]); - -return status; -} -EXPORT_SYMBOL(nss_wifi_vdev_tx_msg_ext); - -/* - * nss_wifi_vdev_tx_buf - * Send data packet for vap processing - */ -nss_tx_status_t nss_wifi_vdev_tx_buf(struct nss_ctx_instance *nss_ctx, struct sk_buff *os_buf, uint32_t if_num) -{ - BUG_ON(((if_num < NSS_DYNAMIC_IF_START) || (if_num >= (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES)))); - - return nss_core_send_packet(nss_ctx, os_buf, if_num, H2N_BIT_FLAG_BUFFER_REUSABLE); -} -EXPORT_SYMBOL(nss_wifi_vdev_tx_buf); - -/* - * nss_wifi_vdev_set_next_hop() - */ -nss_tx_status_t nss_wifi_vdev_set_next_hop(struct nss_ctx_instance *ctx, int if_num, int next_hop) -{ - nss_tx_status_t status; - struct nss_wifi_vdev_msg *wifivdevmsg = kzalloc(sizeof(struct nss_wifi_vdev_msg), GFP_KERNEL); - struct nss_wifi_vdev_set_next_hop_msg *next_hop_msg = NULL; - - if (!wifivdevmsg) { - nss_warning("%px: Unable to allocate next hop message", ctx); - return NSS_TX_FAILURE; - } - - next_hop_msg = &wifivdevmsg->msg.next_hop; - - next_hop_msg->ifnumber = next_hop; - nss_wifi_vdev_msg_init(wifivdevmsg, if_num, NSS_WIFI_VDEV_SET_NEXT_HOP, sizeof(struct nss_wifi_vdev_set_next_hop_msg), NULL, NULL); - - status = nss_wifi_vdev_tx_msg(ctx, wifivdevmsg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to send next hop message", ctx); - } - - kfree(wifivdevmsg); - return status; -} -EXPORT_SYMBOL(nss_wifi_vdev_set_next_hop); - -/* - * nss_wifi_vdev_base_set_next_hop() - */ -nss_tx_status_t nss_wifi_vdev_base_set_next_hop(struct nss_ctx_instance *ctx, int next_hop) -{ - nss_tx_status_t status; - struct nss_wifi_vdev_msg *wifivdevmsg = kzalloc(sizeof(struct nss_wifi_vdev_msg), GFP_KERNEL); - struct nss_wifi_vdev_set_next_hop_msg *next_hop_msg = NULL; - - if (!wifivdevmsg) { - nss_warning("%px: Unable to allocate next hop message", ctx); - return NSS_TX_FAILURE; - } - - next_hop_msg = &wifivdevmsg->msg.next_hop; - - next_hop_msg->ifnumber = next_hop; - nss_wifi_vdev_msg_init(wifivdevmsg, NSS_VAP_INTERFACE, NSS_WIFI_VDEV_SET_NEXT_HOP, sizeof(struct nss_wifi_vdev_set_next_hop_msg), NULL, NULL); - - status = nss_wifi_vdev_base_tx_msg(ctx, wifivdevmsg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to send next hop message", ctx); - } - - kfree(wifivdevmsg); - return status; -} -EXPORT_SYMBOL(nss_wifi_vdev_base_set_next_hop); - -/* - * nss_wifi_vdev_set_peer_next_hop() - */ -nss_tx_status_t nss_wifi_vdev_set_peer_next_hop(struct nss_ctx_instance *ctx, uint32_t nss_if, uint8_t *addr, uint32_t next_hop_if) -{ - nss_tx_status_t status; - struct nss_wifi_vdev_msg *wifivdevmsg = kzalloc(sizeof(struct nss_wifi_vdev_msg), GFP_KERNEL); - struct nss_wifi_vdev_set_peer_next_hop_msg *peer_next_hop_msg = NULL; - - if (!wifivdevmsg) { - nss_warning("%px: Unable to allocate next hop message", ctx); - return NSS_TX_FAILURE; - } - - peer_next_hop_msg = &wifivdevmsg->msg.vdev_set_peer_next_hp; - memcpy(peer_next_hop_msg->peer_mac_addr, addr, ETH_ALEN); - - peer_next_hop_msg->if_num = next_hop_if; - nss_wifi_vdev_msg_init(wifivdevmsg, nss_if, NSS_WIFI_VDEV_SET_PEER_NEXT_HOP, - sizeof(struct nss_wifi_vdev_set_peer_next_hop_msg), NULL, NULL); - - status = nss_wifi_vdev_tx_msg(ctx, wifivdevmsg); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: Unable to send peer next hop message", ctx); - } - - kfree(wifivdevmsg); - return status; -} -EXPORT_SYMBOL(nss_wifi_vdev_set_peer_next_hop); - -/* - * nss_wifi_vdev_set_dp_type() - * Set the vap datapath type of the packet. - */ -bool nss_wifi_vdev_set_dp_type(struct nss_ctx_instance *nss_ctx, struct net_device *netdev, - uint32_t if_num, enum nss_wifi_vdev_dp_type dp_type) -{ - - NSS_VERIFY_CTX_MAGIC(nss_ctx); - - nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); - - if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { - nss_warning("%px: Vap interface dp type could not be set as core is not initialized\n", nss_ctx); - return false; - } - - /* - * set the subsytem dp type for the Wi-Fi vdev - */ - nss_core_set_subsys_dp_type(nss_ctx, netdev, if_num, dp_type); - - return true; -} -EXPORT_SYMBOL(nss_wifi_vdev_set_dp_type); - -/* - *********************************** - * Register/Unregister/Miscellaneous APIs - *********************************** - */ - -/* - * nss_register_wifi_vdev_if() - */ -uint32_t nss_register_wifi_vdev_if(struct nss_ctx_instance *nss_ctx, - int32_t if_num, - nss_wifi_vdev_callback_t vdev_data_callback, - nss_wifi_vdev_ext_data_callback_t vdev_ext_data_callback, - nss_wifi_vdev_msg_callback_t vdev_event_callback, - struct net_device *netdev, - uint32_t features) -{ - uint32_t status; - - nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); - - nss_core_register_subsys_dp(nss_ctx, if_num, vdev_data_callback, vdev_ext_data_callback, NULL, netdev, features); - - status = nss_core_register_msg_handler(nss_ctx, if_num, vdev_event_callback); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to register event handler for interface(%u)", nss_ctx, if_num); - return status; - } - - nss_core_register_handler(nss_ctx, if_num, nss_wifi_vdev_handler, NULL); - - return NSS_CORE_STATUS_SUCCESS; -} -EXPORT_SYMBOL(nss_register_wifi_vdev_if); - -/* - * nss_unregister_wifi_vdev_if() - */ -void nss_unregister_wifi_vdev_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - uint32_t status; - - nss_assert(nss_ctx); - nss_assert((if_num >= NSS_DYNAMIC_IF_START) && (if_num < (NSS_DYNAMIC_IF_START + NSS_MAX_DYNAMIC_INTERFACES))); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - - status = nss_core_unregister_msg_handler(nss_ctx, if_num); - if (status != NSS_CORE_STATUS_SUCCESS) { - nss_warning("%px: unable to unregister event handler for interface(%u)", nss_ctx, if_num); - return; - } - - nss_core_unregister_handler(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_unregister_wifi_vdev_if); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifili.c deleted file mode 100644 index c1904e465..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili.c +++ /dev/null @@ -1,670 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_tx_rx_common.h" -#include "nss_wifili_stats.h" -#include "nss_wifili_log.h" -#include "nss_wifili_strings.h" - -#define NSS_WIFILI_TX_TIMEOUT 1000 /* Millisecond to jiffies*/ -#define NSS_WIFILI_INVALID_SCHEME_ID -1 -#define NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX 4 /* Maximum number of thread scheme entries. */ -#define NSS_WIFILI_EXTERNAL_INTERFACE_MAX 2 /* Maximum external I/F supported */ - -/* - * NSS external interface number table - */ -nss_if_num_t nss_wifili_external_tbl[NSS_WIFILI_EXTERNAL_INTERFACE_MAX] = - {NSS_WIFILI_EXTERNAL_INTERFACE0, NSS_WIFILI_EXTERNAL_INTERFACE1}; - -/* - * nss_wifili_thread_scheme_entry - * Details of thread scheme. - */ -struct nss_wifili_thread_scheme_entry { - int32_t radio_ifnum; /* Radio interface number. */ - uint32_t radio_priority; /* Priority of radio. */ - uint32_t scheme_priority; /* Priority of scheme. */ - uint8_t scheme_index; /* Scheme index allocated to radio. */ - bool allocated; /* Flag to check if scheme is allocated. */ -}; - -/* - * nss_wifili_thread_scheme_db - * Wifili thread scheme database. - */ -struct nss_wifili_thread_scheme_db { - spinlock_t lock; /* Lock to protect from simultaneous access. */ - uint32_t radio_count; /* Radio counter. */ - struct nss_wifili_thread_scheme_entry nwtse[NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX]; - /* Metadata for each of scheme. */ -}; - -/* - * nss_wifili_external_if_state_tbl - * External interface state table - */ -struct nss_wifili_external_if_state_tbl { - nss_if_num_t ifnum; - bool in_use; -}; - -/* - * nss_wifili_external_if_info - * Wifili external interface info - */ -struct nss_wifili_external_if_info { - spinlock_t lock; - struct nss_wifili_external_if_state_tbl state_tbl[NSS_WIFILI_EXTERNAL_INTERFACE_MAX]; -} nss_wifi_eif_info; - -/* - * nss_wifili_pvt - * Private data structure - */ -static struct nss_wifili_pvt { - struct semaphore sem; - struct completion complete; - int response; - void *cb; - void *app_data; -} wifili_pvt; - -/* - * Scheme to radio mapping database - */ -static struct nss_wifili_thread_scheme_db ts_db[NSS_MAX_CORES]; - -/* - * nss_wifili_handler() - * Handle NSS -> HLOS messages for wifi - */ -static void nss_wifili_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) -{ - struct nss_wifili_msg *ntm = (struct nss_wifili_msg *)ncm; - void *ctx; - nss_wifili_msg_callback_t cb; - - nss_info("%px: NSS->HLOS message for wifili\n", nss_ctx); - - /* - * The interface number shall be wifili soc interface or wifili radio interface - */ - BUG_ON((nss_is_dynamic_interface(ncm->interface)) - || ((ncm->interface != NSS_WIFILI_INTERNAL_INTERFACE) - && (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE0) - && (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE1))); - - /* - * Trace messages. - */ - nss_wifili_log_rx_msg(ntm); - - /* - * Is this a valid request/response packet? - */ - if (ncm->type >= NSS_WIFILI_MAX_MSG) { - nss_warning("%px: Received invalid message %d for wifili interface", nss_ctx, ncm->type); - return; - } - - if ((nss_cmn_get_msg_len(ncm) > sizeof(struct nss_wifili_msg)) && - ntm->cm.type != NSS_WIFILI_PEER_EXT_STATS_MSG) { - nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); - return; - } - - /* - * Snoop messages for local driver and handle - */ - switch (ntm->cm.type) { - case NSS_WIFILI_STATS_MSG: - /* - * Update WIFI driver statistics and send statistics notifications to the registered modules - */ - nss_wifili_stats_sync(nss_ctx, &ntm->msg.wlsoc_stats, ncm->interface); - nss_wifili_stats_notify(nss_ctx, ncm->interface); - break; - } - - /* - * Update the callback and app_data for notify messages, wifili sends all notify messages - * to the same callback/app_data. - */ - if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { - ncm->cb = (nss_ptr_t)nss_ctx->nss_top->wifili_msg_callback; - } - - /* - * Log failures - */ - nss_core_log_msg_failures(nss_ctx, ncm); - - /* - * Do we have a call back - */ - if (!ncm->cb) { - nss_info("%px: cb null for wifili interface %d", nss_ctx, ncm->interface); - return; - } - - /* - * Get callback & context - */ - cb = (nss_wifili_msg_callback_t)ncm->cb; - ctx = nss_ctx->subsys_dp_register[ncm->interface].ndev; - - /* - * call wifili msg callback - */ - if (!ctx) { - nss_warning("%px: Event received for wifili interface %d before registration", nss_ctx, ncm->interface); - return; - } - - cb(ctx, ntm); -} - -/* - * nss_wifili_callback() - * Callback to handle the completion of NSS->HLOS messages. - */ -static void nss_wifili_callback(void *app_data, struct nss_wifili_msg *nvm) -{ - nss_wifili_msg_callback_t callback = (nss_wifili_msg_callback_t)wifili_pvt.cb; - void *data = wifili_pvt.app_data; - - wifili_pvt.response = NSS_TX_SUCCESS; - wifili_pvt.cb = NULL; - wifili_pvt.app_data = NULL; - - if (nvm->cm.response != NSS_CMN_RESPONSE_ACK) { - nss_warning("wifili error response %d\n", nvm->cm.response); - wifili_pvt.response = nvm->cm.response; - } - - if (callback) { - callback(data, nvm); - } - complete(&wifili_pvt.complete); -} - -/* - * nss_wifili_tx_msg - * Transmit a wifili message to NSS FW - * - * NOTE: The caller is expected to handle synchronous wait for message - * response if needed. - */ -nss_tx_status_t nss_wifili_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_wifili_msg *msg) -{ - struct nss_cmn_msg *ncm = &msg->cm; - - /* - * Trace messages. - */ - nss_wifili_log_tx_msg(msg); - - if (ncm->type >= NSS_WIFILI_MAX_MSG) { - nss_warning("%px: wifili message type out of range: %d", nss_ctx, ncm->type); - return NSS_TX_FAILURE; - } - - /* - * The interface number shall be one of the wifili soc interfaces - */ - if ((ncm->interface != NSS_WIFILI_INTERNAL_INTERFACE) - && (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE0) - && (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE1)) { - nss_warning("%px: tx request for interface that is not a wifili: %d", nss_ctx, ncm->interface); - return NSS_TX_FAILURE; - } - - return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); -} -EXPORT_SYMBOL(nss_wifili_tx_msg); - -/* - * nss_wifili_tx_msg_sync() - * Transmit a wifili message to NSS firmware synchronously. - */ -nss_tx_status_t nss_wifili_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_wifili_msg *nvm) -{ - nss_tx_status_t status; - int ret = 0; - - down(&wifili_pvt.sem); - wifili_pvt.cb = (void *)nvm->cm.cb; - wifili_pvt.app_data = (void *)nvm->cm.app_data; - - nvm->cm.cb = (nss_ptr_t)nss_wifili_callback; - nvm->cm.app_data = (nss_ptr_t)NULL; - - status = nss_wifili_tx_msg(nss_ctx, nvm); - if (status != NSS_TX_SUCCESS) { - nss_warning("%px: wifili_tx_msg failed\n", nss_ctx); - up(&wifili_pvt.sem); - return status; - } - - ret = wait_for_completion_timeout(&wifili_pvt.complete, msecs_to_jiffies(NSS_WIFILI_TX_TIMEOUT)); - if (!ret) { - nss_warning("%px: wifili msg tx failed due to timeout\n", nss_ctx); - wifili_pvt.response = NSS_TX_FAILURE; - } - - status = wifili_pvt.response; - up(&wifili_pvt.sem); - return status; -} -EXPORT_SYMBOL(nss_wifili_tx_msg_sync); - -/* - * nss_wifili_get_context() - */ -struct nss_ctx_instance *nss_wifili_get_context(void) -{ - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; -} -EXPORT_SYMBOL(nss_wifili_get_context); - -/* - * nss_wifili_release_external_if() - * Release the external interface. - */ -void nss_wifili_release_external_if(nss_if_num_t ifnum) -{ - uint32_t idx; - - spin_lock_bh(&nss_wifi_eif_info.lock); - for (idx = 0; idx < NSS_WIFILI_EXTERNAL_INTERFACE_MAX; idx++) { - if (nss_wifi_eif_info.state_tbl[idx].ifnum != ifnum) { - continue; - } - - if (!nss_wifi_eif_info.state_tbl[idx].in_use) { - spin_unlock_bh(&nss_wifi_eif_info.lock); - nss_warning("%px: I/F num:%d is not in use\n", &nss_wifi_eif_info, ifnum); - return; - } - - nss_wifi_eif_info.state_tbl[idx].in_use = false; - break; - } - - spin_unlock_bh(&nss_wifi_eif_info.lock); - - if (idx == NSS_WIFILI_EXTERNAL_INTERFACE_MAX) { - nss_warning("%px: Trying to release invalid ifnum:%d\n", &nss_wifi_eif_info, ifnum); - } -} -EXPORT_SYMBOL(nss_wifili_release_external_if); - -/* - * nss_get_available_wifili_external_if() - * Check and return the available external interface - */ -nss_if_num_t nss_get_available_wifili_external_if(void) -{ - nss_if_num_t ifnum = -1; - uint32_t idx; - - /* - * Check if the external interface is registered. - * Return the interface number if not registered. - */ - spin_lock_bh(&nss_wifi_eif_info.lock); - for (idx = 0; idx < NSS_WIFILI_EXTERNAL_INTERFACE_MAX; idx++) { - if (nss_wifi_eif_info.state_tbl[idx].in_use) { - continue; - } - - nss_wifi_eif_info.state_tbl[idx].in_use = true; - ifnum = nss_wifi_eif_info.state_tbl[idx].ifnum; - break; - } - - spin_unlock_bh(&nss_wifi_eif_info.lock); - - BUG_ON(idx == NSS_WIFILI_EXTERNAL_INTERFACE_MAX); - return ifnum; -} -EXPORT_SYMBOL(nss_get_available_wifili_external_if); - -/* - * nss_wifili_get_radio_num() - * Get NSS wifili radio count. - * - * Wi-Fi host driver needs to know the current radio count - * to extract the radio priority from ini file. - */ -uint32_t nss_wifili_get_radio_num(struct nss_ctx_instance *nss_ctx) -{ - uint8_t core_id; - uint32_t radio_count; - - nss_assert(nss_ctx); - nss_assert(nss_ctx->id < nss_top_main.num_nss); - - core_id = nss_ctx->id; - - spin_lock_bh(&ts_db[core_id].lock); - radio_count = ts_db[core_id].radio_count; - spin_unlock_bh(&ts_db[core_id].lock); - - return radio_count; -} -EXPORT_SYMBOL(nss_wifili_get_radio_num); - -/* - * nss_wifili_thread_scheme_alloc() - * Allocate NSS worker thread scheme index. - * - * API does search on scheme database and returns scheme index based on - * priority of radio and free entry available. - * Wi-Fi driver fetches radio priority from ini file and calls this API - * to get the scheme index based on radio priority. - * - */ -uint8_t nss_wifili_thread_scheme_alloc(struct nss_ctx_instance *nss_ctx, - int32_t radio_ifnum, - enum nss_wifili_thread_scheme_priority radio_priority) -{ - uint8_t i; - uint8_t scheme_idx; - uint8_t core_id; - uint8_t next_avail_entry_idx = NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX; - - nss_assert(nss_ctx); - nss_assert(nss_ctx->id < nss_top_main.num_nss); - - core_id = nss_ctx->id; - - /* - * Iterate through scheme database and allocate - * scheme_id matching the priority requested. - */ - spin_lock_bh(&ts_db[core_id].lock); - for (i = 0; i < NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX; i++) { - if (ts_db[core_id].nwtse[i].allocated) { - continue; - } - - if (radio_priority == - ts_db[core_id].nwtse[i].scheme_priority) { - ts_db[core_id].nwtse[i].radio_ifnum = radio_ifnum; - ts_db[core_id].nwtse[i].radio_priority = radio_priority; - ts_db[core_id].nwtse[i].allocated = true; - ts_db[core_id].radio_count++; - scheme_idx = ts_db[core_id].nwtse[i].scheme_index; - spin_unlock_bh(&ts_db[core_id].lock); - - nss_info("%px: Allocated scheme index:%d radio_ifnum:%d", - nss_ctx, - scheme_idx, - radio_ifnum); - - return scheme_idx; - } - - next_avail_entry_idx = i; - } - - /* - * When radio priority does not match any of scheme entry priority - * and database has unallocated entries, provide available unallocated entry. - * This prevents any catastrophic failure during attach of Wi-Fi radio. - */ - if (next_avail_entry_idx != NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX) { - - ts_db[core_id].nwtse[next_avail_entry_idx].radio_ifnum = radio_ifnum; - ts_db[core_id].nwtse[next_avail_entry_idx].radio_priority = radio_priority; - ts_db[core_id].nwtse[next_avail_entry_idx].allocated = true; - ts_db[core_id].radio_count++; - scheme_idx = ts_db[core_id].nwtse[next_avail_entry_idx].scheme_index; - spin_unlock_bh(&ts_db[core_id].lock); - - nss_info("%px: Priority did not match for radio_ifnum:%d, allocated a next available scheme:%d", - nss_ctx, - radio_ifnum, - scheme_idx); - - return scheme_idx; - } - spin_unlock_bh(&ts_db[core_id].lock); - - nss_warning("%px: Could not find scheme - radio_ifnum:%d radio_map:%d\n", - nss_ctx, - radio_ifnum, - radio_priority); - - return NSS_WIFILI_INVALID_SCHEME_ID; -} -EXPORT_SYMBOL(nss_wifili_thread_scheme_alloc); - -/* - * nss_wifili_thread_scheme_dealloc() - * Reset thread scheme metadata. - */ -void nss_wifili_thread_scheme_dealloc(struct nss_ctx_instance *nss_ctx, - int32_t radio_ifnum) -{ - uint32_t id; - uint8_t core_id; - - nss_assert(nss_ctx); - nss_assert(nss_ctx->id < nss_top_main.num_nss); - - core_id = nss_ctx->id; - - /* - * Radio count cannot be zero here. - */ - nss_assert(ts_db[core_id].radio_count); - - spin_lock_bh(&ts_db[core_id].lock); - for (id = 0; id < NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX; id++) { - if (ts_db[core_id].nwtse[id].radio_ifnum != radio_ifnum) { - continue; - } - - ts_db[core_id].nwtse[id].radio_priority = 0; - ts_db[core_id].nwtse[id].allocated = false; - ts_db[core_id].nwtse[id].radio_ifnum = 0; - ts_db[core_id].radio_count--; - break; - } - spin_unlock_bh(&ts_db[core_id].lock); - - if (id == NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX) { - nss_warning("%px: Could not find scheme database with radio_ifnum:%d", - nss_ctx, - radio_ifnum); - } -} -EXPORT_SYMBOL(nss_wifili_thread_scheme_dealloc); - -/* - * nss_wifili_thread_scheme_db_init() - * Initialize thread scheme database. - */ -void nss_wifili_thread_scheme_db_init(uint8_t core_id) -{ - uint32_t id; - - spin_lock_init(&ts_db[core_id].lock); - - /* - * Iterate through scheme database and assign - * scheme_id and priority for each entry - */ - ts_db[core_id].radio_count = 0; - for (id = 0; id < NSS_WIFILI_THREAD_SCHEME_ENTRY_MAX; id++) { - ts_db[core_id].nwtse[id].radio_priority = 0; - ts_db[core_id].nwtse[id].radio_ifnum = 0; - ts_db[core_id].nwtse[id].allocated = false; - - switch (id) { - case 0: - ts_db[core_id].nwtse[id].scheme_priority = NSS_WIFILI_HIGH_PRIORITY_SCHEME; - ts_db[core_id].nwtse[id].scheme_index = NSS_WIFILI_THREAD_SCHEME_ID_0; - break; - case 1: - ts_db[core_id].nwtse[id].scheme_priority = NSS_WIFILI_LOW_PRIORITY_SCHEME; - ts_db[core_id].nwtse[id].scheme_index = NSS_WIFILI_THREAD_SCHEME_ID_1; - break; - case 2: - case 3: - ts_db[core_id].nwtse[id].scheme_priority = NSS_WIFILI_HIGH_PRIORITY_SCHEME; - ts_db[core_id].nwtse[id].scheme_index = NSS_WIFILI_THREAD_SCHEME_ID_2; - break; - default: - nss_warning("Invalid scheme index:%d", id); - } - } -} - -/* - * nss_wifili_msg_init() - * Initialize nss_wifili_msg. - */ -void nss_wifili_msg_init(struct nss_wifili_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data) -{ - nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data); -} -EXPORT_SYMBOL(nss_wifili_msg_init); - -/* - **************************************** - * Register/Unregister/Miscellaneous APIs - **************************************** - */ - -/* - * nss_register_wifili_if() - * Register wifili with nss driver - */ -struct nss_ctx_instance *nss_register_wifili_if(uint32_t if_num, nss_wifili_callback_t wifili_callback, - nss_wifili_callback_t wifili_ext_callback, - nss_wifili_msg_callback_t event_callback, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - - /* - * The interface number shall be wifili soc interface - */ - nss_assert((if_num == NSS_WIFILI_INTERNAL_INTERFACE) - || (if_num == NSS_WIFILI_EXTERNAL_INTERFACE0) - || (if_num == NSS_WIFILI_EXTERNAL_INTERFACE1)); - - nss_info("nss_register_wifili_if if_num %d wifictx %px", if_num, netdev); - - nss_core_register_subsys_dp(nss_ctx, if_num, wifili_callback, wifili_ext_callback, NULL, netdev, features); - - nss_top_main.wifili_msg_callback = event_callback; - - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; -} -EXPORT_SYMBOL(nss_register_wifili_if); - -/* - * nss_unregister_wifili_if() - * Unregister wifili with nss driver - */ -void nss_unregister_wifili_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - - /* - * The interface number shall be wifili soc interface - */ - nss_assert((if_num == NSS_WIFILI_INTERNAL_INTERFACE) - || (if_num == NSS_WIFILI_EXTERNAL_INTERFACE0) - || (if_num == NSS_WIFILI_EXTERNAL_INTERFACE1)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); - nss_wifili_release_external_if(if_num); -} -EXPORT_SYMBOL(nss_unregister_wifili_if); - -/* - * nss_register_wifili_radio_if() - * Register wifili radio with nss driver - */ -struct nss_ctx_instance *nss_register_wifili_radio_if(uint32_t if_num, nss_wifili_callback_t wifili_callback, - nss_wifili_callback_t wifili_ext_callback, - nss_wifili_msg_callback_t event_callback, struct net_device *netdev, uint32_t features) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - - /* - * The interface number shall be wifili radio dynamic interface - */ - nss_assert(nss_is_dynamic_interface(if_num)); - nss_info("nss_register_wifili_if if_num %d wifictx %px", if_num, netdev); - - nss_core_register_subsys_dp(nss_ctx, if_num, wifili_callback, wifili_ext_callback, NULL, netdev, features); - - return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; -} -EXPORT_SYMBOL(nss_register_wifili_radio_if); - -/* - * nss_unregister_wifili_radio_if() - * Unregister wifili radio with nss driver - */ -void nss_unregister_wifili_radio_if(uint32_t if_num) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - - /* - * The interface number shall be wifili radio dynamic interface - */ - nss_assert(nss_is_dynamic_interface(if_num)); - - nss_core_unregister_subsys_dp(nss_ctx, if_num); -} -EXPORT_SYMBOL(nss_unregister_wifili_radio_if); - -/* - * nss_wifili_register_handler() - * Register handle for notfication messages received on wifi interface - */ -void nss_wifili_register_handler(void) -{ - struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id]; - uint32_t idx; - - nss_info("nss_wifili_register_handler"); - nss_core_register_handler(nss_ctx, NSS_WIFILI_INTERNAL_INTERFACE, nss_wifili_handler, NULL); - nss_core_register_handler(nss_ctx, NSS_WIFILI_EXTERNAL_INTERFACE0, nss_wifili_handler, NULL); - nss_core_register_handler(nss_ctx, NSS_WIFILI_EXTERNAL_INTERFACE1, nss_wifili_handler, NULL); - - nss_wifili_stats_dentry_create(); - nss_wifili_strings_dentry_create(); - - sema_init(&wifili_pvt.sem, 1); - init_completion(&wifili_pvt.complete); - - /* - * Intialize the external interfaces info. - */ - spin_lock_init(&nss_wifi_eif_info.lock); - for (idx = 0; idx < NSS_WIFILI_EXTERNAL_INTERFACE_MAX; idx++) { - nss_wifi_eif_info.state_tbl[idx].ifnum = nss_wifili_external_tbl[idx]; - nss_wifi_eif_info.state_tbl[idx].in_use = false; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_log.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifili_log.c deleted file mode 100644 index 7c679dfca..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_log.c +++ /dev/null @@ -1,553 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_wifili_log.c - * NSS WIFILI logger file. - */ - -#include "nss_core.h" - -/* - * nss_wifili_log_message_types_str - * WIFILI message strings - */ -static int8_t *nss_wifili_log_message_types_str[NSS_WIFILI_MAX_MSG] __maybe_unused = { - "WIFILI INIT MSG", - "WIFILI SOC RESET MSG", - "WIFILI PDEV INIT MSG", - "WIFILI PDEV DEINIT MSG", - "WIFILI START MSG", - "WIFILI STOP MSG", - "WIFILI PEER CREATE MSG", - "WIFILI PEER DELETE MSG", - "WIFILI SEND PEER MEMORY REQUEST MSG", - "WIFILI PEER FREELIST APPEND MSG", - "WIFILI STATS MSG", - "WIFILI WDS VENDOR MSG", - "WIFILI PEER STATS MSG", - "WIFILI WDS PEER ADD MSG", - "WIFILI WDS PEER DEL MSG", - "WIFILI WDS PEER MAP MSG", - "WIFILI WDS ACTIVE INFO MSG", - "WIFILI STATS CFG MSG", - "WIFILI TID REOQ SETUP MSG", - "WIFILI RADIO CMD MSG", - "WIFILI LINK DESC INFO MSG", - "WIFILI PEER SECURITY TYPE MSG", - "WIFILI PEER NAWDS ENABLE MSG", - "WIFILI RADIO BUF CFG", - "WIFILI DBDC REPEATER SET MSG", - "WIFILI DBDC REPEATER AST FLUSH MSG" -}; - -/* - * nss_wifili_log_error_response_types_str - * Strings for error types for WIFILI messages - */ -static int8_t *nss_wifili_log_error_response_types_str[NSS_WIFILI_EMSG_UNKNOWN] __maybe_unused = { - "WIFILI NO ERROR", - "WIFILI INIT FAIL IMPROPER STATE", - "WIFILI RINGS INIT FAIL", - "WIFILI PDEV INIT IMPROPER STATE FAIL", - "WIFILI PDEV INIT INVALID RADIOID FAIL", - "WIFILI PDEV TX IRQ ALLOC FAIL", - "WIFILI PDEV RESET INVALID RADIOID FAIL", - "WIFILI PDEV RESET PDEV NULL FAIL", - "WIFILI PDEV RESET IMPROPER STATE FAIL", - "WIFILI START IMPROPER STATE FAIL", - "WIFILI PEER CREATE FAIL", - "WIFILI PEER DELETE FAIL", - "WIFILI HASHMEM INIT FAIL", - "WIFILI PEER FREELIST APPEND FAIL", - "WIFILI PEER CREATE INVALID VDEVID FAIL", - "WIFILI PEER CREATE INVALID PEER ID FAIL", - "WIFILI PEER CREATE VDEV NULL FAIL", - "WIFILI PEER CREATE PDEV NULL FAIL", - "WIFILI PEER CREATE ALLOC FAIL", - "WIFILI PEER DELETE VAPID INVALID FAIL", - "WIFILI PEER DELETE INVALID PEERID FAIL", - "WIFILI PEER DELETE VDEV NULL FAIL", - "WIFILI PEER DELETE PDEV NULL FAIL", - "WIFILI PEER DELETE PEER NULL FAIL", - "WIFILI PEER DELETE PEER CORRUPTED FAIL", - "WIFILI PEER DUPLICATE AST INDEX PEER ID FAIL", - "WIFILI GROUP0 TIMER ALLOC FAIL", - "WIFILI INSUFFICIENT WT FAIL", - "WIFILI INVALID NUM TCL RING FAIL", - "WIFILI INVALID NUM REO DST RING FAIL", - "WIFILI HAL SRNG SOC ALLOC FAIL", - "WIFILI HAL SRNG INVALID RING INFO FAIL", - "WIFILI HAL SRNG TCL ALLOC FAIL", - "WIFILI HAL SRNG TXCOMP ALLOC FAIL", - "WIFILI HAL SRNG REODST ALLOC FAIL", - "WIFILI HAL SRNG REOREINJECT ALLOC FAIL", - "WIFILI HAL SRNG RXRELEASE ALLOC FAIL", - "WIFILI HAL SRNG RXEXCP ALLOC FAIL", - "WIFILI HAL TX MEMALLOC FAIL", - "WIFILI HAL TX INVLID POOL NUM FAIL", - "WIFILI HAL TX INVALID PAGE NUM FAIL", - "WIFILI HAL TX DESC MEM ALLOC FAIL", - "WIFILI HAL RX MEMALLOC FAIL", - "WIFILI PDEV RXDMA RING ALLOC FAIL", - "WIFILI NAWDSEN PEERID INVALID", - "WIFILI NAWDSEN PEER NULL", - "WIFILI NAWDSEN PEER CORRUPTED", - "WIFILI WDS PEER CFG FAIL", - "WIFILI RESET NO STOP", - "WIFILI HAL SRNG INVALID RING BASE FAIL", - "WIFILI PDEV RX INIT FAIL", - "WIFILI EMESG AST ADD FAIL", - "WIFILI EMESG AST REMOVE FAIL", - "WIFILI EMESG WDS ADD FAIL", - "WIFILI EMESG WDS REMOVE FAIL", - "WIFILI EMESG WDS MAP FAIL", - "WIFILI WDS INVALID PEERID FAIL", - "WIFILI WDS DUPLICATE AST INDEX PEER ID FAIL", - "WIFILI INVALID RADIO CMD", - "WIFILI INVALID RADIO IFNUM", - "WIFILI PEER SECURITY PEER NULL FAIL", - "WIFILI PEER SECURITY PEER CORRUPTED FAIL", - "WIFILI RADIO INVALID BUF CFG", -}; - -/* - * nss_wifili_log_wifili_hal_srng() - * Log NSS WIFILI HAL SRNG Information - */ -static void nss_wifili_log_wifili_hal_srng(struct nss_wifili_hal_srng_info *ring) -{ - int32_t i; - nss_trace("\tRing ID: %d\n" - "\tMAC ID: %d\n" - "\tRing base physical address: %x\n" - "\tNumber of entries: %d\n" - "\tFlags: %x\n" - "\tDirection: %d\n" - "\tEntry size: %d\n" - "\tLow Threshold: %d\n", - ring->ring_id, ring->mac_id, - ring->ring_base_paddr, ring->num_entries, - ring->flags, ring->ring_dir, - ring->entry_size, ring->low_threshold); - nss_trace("Ring Base Addresses:"); - for (i = 0; i < NSS_WIFILI_MAX_SRNG_REG_GROUPS_MSG; i++) { - nss_trace("\t%x", ring->hwreg_base[i]); - } -} - -/* - * nss_wifili_log_init_msg() - * Log NSS WIFILI Init message. - */ -static void nss_wifili_log_init_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_init_msg *nwim __maybe_unused = &nwm->msg.init; - int32_t i; - nss_trace("%px: NSS WIFILI Init Message:\n" - "WIFILI HAL Source Ring Base Address: %x\n" - "WIFILI HAL Source Ring Shadow Read Pointer Address: %x\n" - "WIFILI HAL Source Ring Shadow Write Pointer Address: %x\n" - "WIFILI Number of Transmit Classifier data rings: %d\n" - "WIFILI Number of reorder rings: %d\n" - "WIFILI Flags for SoC initialization: %d\n" - "WIFILI Tx descriptor initialization number of software descriptors: %d" - "WIFILI Tx descriptor initialization number of software extended descriptors: %d" - "WIFILI Tx descriptor initialization number of descriptor pools: %d" - "WIFILI Tx descriptor initialization number of memory addresses: %d" - "WIFILI Tx descriptor initialization extended descriptor page number: %d" - "WIFILI Tx descriptor initialization number of software secriptors for second radio: %d" - "WIFILI Tx descriptor initialization number of software extended descriptors for second radio: %d", - nwim, nwim->hssm.dev_base_addr, - nwim->hssm.shadow_rdptr_mem_addr, nwim->hssm.shadow_wrptr_mem_addr, - nwim->num_tcl_data_rings, nwim->num_reo_dest_rings, - nwim->flags, nwim->wtdim.num_tx_desc, - nwim->wtdim.num_tx_desc_ext, nwim->wtdim.num_pool, - nwim->wtdim.num_memaddr, nwim->wtdim.ext_desc_page_num, - nwim->wtdim.num_tx_desc_2, nwim->wtdim.num_tx_desc_ext_2); - /* - * Continuation of the log. - */ - nss_trace("WIFILI Tx descriptor initialization memory start address and size:"); - for (i = 0; i < NSS_WIFILI_MAX_NUMBER_OF_PAGE_MSG; i++) { - nss_trace("\tPage[%d]: Addr: %x Size: %d", i, nwim->wtdim.memory_addr[i], nwim->wtdim.memory_size[i]); - } - nss_trace("WIFILI Transmit Classifier data ring Information:"); - for (i = 0; i < NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG; i++) { - nss_wifili_log_wifili_hal_srng(&nwim->tcl_ring_info[i]); - } - nss_trace("WIFILI TX Completion Ring configuration information:"); - for (i = 0; i < NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG; i++) { - nss_wifili_log_wifili_hal_srng(&nwim->tx_comp_ring[i]); - } - nss_trace("WIFILI Reorder destination ring configuration information:"); - for (i = 0; i < NSS_WIFILI_MAX_REO_DATA_RINGS_MSG; i++) { - nss_wifili_log_wifili_hal_srng(&nwim->reo_dest_ring[i]); - } - nss_trace("WIFILI Reorder exception ring configuration information:"); - nss_wifili_log_wifili_hal_srng(&nwim->reo_exception_ring); - nss_trace("WIFILI Reinject ring configuration information:"); - nss_wifili_log_wifili_hal_srng(&nwim->reo_reinject_ring); -} - -/* - * nss_wifili_log_pdev_init_msg() - * Log NSS WIFILI PDEV Init message. - */ -static void nss_wifili_log_pdev_init_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_pdev_init_msg *nwim __maybe_unused = &nwm->msg.pdevmsg; - nss_trace("%px: NSS WIFILI PDEV Init Message:\n" - "WIFILI Radio ID: %x\n" - "WIFILI MAC Hardware Mode: %d\n" - "WIFILI Lower MAC ID: %x\n", - nwim, nwim->radio_id, - nwim->hwmode, nwim->lmac_id); - /* - * Continuation of the log. - */ - nss_trace("WIFILI Media Access Point ring information:"); - nss_wifili_log_wifili_hal_srng(&nwim->rxdma_ring); -} - -/* - * nss_wifili_log_pdev_init_msg() - * Log NSS WIFILI PDEV Deinit message. - */ -static void nss_wifili_log_pdev_deinit_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_pdev_deinit_msg *nwim __maybe_unused = &nwm->msg.pdevdeinit; - nss_trace("%px: NSS WIFILI PDEV Deinit Message:\n" - "WIFILI Interface Number: %d\n", - nwim, nwim->ifnum); -} - -/* - * nss_wifili_log_peer_msg() - * Log NSS WIFILI Peer message. - */ -static void nss_wifili_log_peer_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_peer_msg *nwim __maybe_unused = &nwm->msg.peermsg; - nss_trace("%px: NSS WIFILI Peer Message:\n" - "WIFILI Peer MAC Address: %pM\n" - "WIFILI VAP ID: %d\n" - "WIFILI Peed ID: %d\n" - "WIFILI Hardware address search table index: %d\n" - "WIFILI NAWDS enabled for peer: %d\n" - "WIFILI peer memory adderss for NSS: %x\n", - nwim, nwim->peer_mac_addr, - nwim->vdev_id, nwim->peer_id, - nwim->hw_ast_idx, nwim->is_nawds, - nwim->nss_peer_mem); -} - -/* - * nss_wifili_log_peer_freelist_append_msg() - * Log NSS WIFILI Peer memory request message. - */ -static void nss_wifili_log_peer_freelist_append_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_peer_freelist_append_msg *nwim __maybe_unused = &nwm->msg.peer_freelist_append; - nss_trace("%px: NSS WIFILI Peer Memory Request Message:\n" - "WIFILI Starting Address of Freelist: %x\n" - "WIFILI Length: %d\n" - "WIFILI Maximum number of peer entries supported in pool: %d\n", - nwim, nwim->addr, - nwim->length, nwim->num_peers); -} - -/* - * nss_wifili_log_wds_peer_msg() - * Log NSS WIFILI WDS Peer message. - */ -static void nss_wifili_log_wds_peer_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_wds_peer_msg *nwim __maybe_unused = &nwm->msg.wdspeermsg; - nss_trace("%px: NSS WIFILI WDS Peer Message:\n" - "WIFILI Destination MAC: %pM\n" - "WIFILI Peer MAC: %pM\n", - nwim, nwim->dest_mac, nwim->peer_mac); -} - -/* - * nss_wifili_log_wds_active_info_msg() - * Log NSS WIFILI WDS Active Info message. - */ -static void nss_wifili_log_wds_active_info_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_wds_active_info_msg *nwim __maybe_unused = &nwm->msg.wdsinfomsg; - nss_trace("%px: NSS WIFILI WDS Active Info Message:\n" - "WIFILI Number OF Entries: %d\n" - "WIFILI Hardware AST Index: %d\n", - nwim, nwim->nentries, nwim->info[0].ast_idx); -} - -/* - * nss_wifili_log_stats_cfg_msg() - * Log NSS WIFILI Stats Configuration Message. - */ -static void nss_wifili_log_stats_cfg_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_stats_cfg_msg *nwim __maybe_unused = &nwm->msg.scm; - nss_trace("%px: NSS WIFILI Stats Config Message:\n" - "WIFILI Enable/Disable Config: %d\n", - nwim, nwim->cfg); -} - -/* - * nss_wifili_log_reo_tidq_msg() - * Log NSS WIFILI REO TIDQ Setup Message. - */ -static void nss_wifili_log_reo_tidq_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_reo_tidq_msg *nwim __maybe_unused = &nwm->msg.reotidqmsg; - nss_trace("%px: NSS WIFILI reo tidq setup Message:\n" - "WIFILI Traffic Identification Value: %d\n" - "WIFILI Peer ID: %d\n", - nwim, nwim->tid, nwim->peer_id); -} - -/* - * nss_wifili_log_radio_cfg_msg() - * Log NSS WIFILI Radio Command Message. - */ -static void nss_wifili_log_radio_cfg_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_radio_cfg_msg *nwim __maybe_unused = &nwm->msg.radiocfgmsg; - nss_trace("%px: NSS WIFILI Radio Command Message:\n" - "WIFILI Radio Interface Number %d\n", - nwim, nwim->radio_if_num); -} - -/* - * nss_wifili_log_wds_extn_peer_cfg_msg() - * Log NSS WIFILI WDS vendor extension configuration message. - */ -static void nss_wifili_log_wds_extn_peer_cfg_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_wds_extn_peer_cfg_msg *nwim __maybe_unused = &nwm->msg.wpeercfg; - nss_trace("%px: NSS WIFILI WDS vendor extension configuration message:\n" - "WIFILI Peer MAC Addr: %pM\n" - "WIFILI WDS Flags: %d\n" - "WIFILI Peer ID: %d\n", - nwim, nwim->peer_mac_addr, - nwim->wds_flags, nwim->peer_id); -} - -/* - * nss_wifili_log_soc_linkdesc_buf_info_msg() - * Log NSS WIFILI Link descriptor buffer address information. - */ -static void nss_wifili_log_soc_linkdesc_buf_info_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_soc_linkdesc_buf_info_msg *nwim __maybe_unused = &nwm->msg.linkdescinfomsg; - nss_trace("%px: NSS WIFILI Link descriptor buffer address information:\n" - "WIFILI Link Descriptor Low Address: %x\n" - "WIFILI Link Descriptor High Address: %x\n", - nwim, nwim->buffer_addr_low, - nwim->buffer_addr_high); -} - -/* - * nss_wifili_log_peer_security_msg() - * Log NSS WIFILI Peer Security Message. - */ -static void nss_wifili_log_peer_security_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_peer_security_type_msg *nwim __maybe_unused = &nwm->msg.securitymsg; - int32_t i; - nss_trace("%px: NSS WIFILI Peer Security Message:\n" - "WIFILI Peer ID: %d\n" - "WIFILI Packet Type: %d\n" - "WIFILI Security Type: %d\n", - nwim, nwim->peer_id, - nwim->pkt_type, nwim->security_type); - /* - * Continuation of the log. - */ - nss_trace("WIFILI MIC KEY:"); - for (i = 0; i < NSS_WIFILI_MIC_KEY_LEN; i++) { - nss_trace("\t%x", nwim->mic_key[i]); - } -} - -/* - * nss_wifili_log_peer_nawds_enable_msg() - * Log NSS WIFILI NAWDS enable for peer. - */ -static void nss_wifili_log_peer_nawds_enable_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_peer_nawds_enable_msg *nwim __maybe_unused = &nwm->msg.nawdsmsg; - nss_trace("%px: NSS WIFILI NAWDS enable for peer:\n" - "WIFILI Peer ID: %d\n" - "WIFILI Enable NAWDS: %d\n", - nwim, nwim->peer_id, nwim->is_nawds); -} - -/* - * nss_wifili_log_dbdc_repeater_set_msg() - * Log NSS WIFILI DBDC Repeaster Enable Message - */ -static void nss_wifili_log_dbdc_repeater_set_msg(struct nss_wifili_msg *nwm) -{ - struct nss_wifili_dbdc_repeater_set_msg *nwim __maybe_unused = &nwm->msg.dbdcrptrmsg; - nss_trace("%px: NSS WIFILI DBDC Repeater Enable Message:\n" - "WIFILI DBDC Enable Flag: %d\n", - nwim, nwim->is_dbdc_en); -} - -/* - * nss_wifili_log_verbose() - * Log message contents. - */ -static void nss_wifili_log_verbose(struct nss_wifili_msg *nwm) -{ - switch (nwm->cm.type) { - case NSS_WIFILI_INIT_MSG: - nss_wifili_log_init_msg(nwm); - break; - - case NSS_WIFILI_SOC_RESET_MSG: - break; - - case NSS_WIFILI_PDEV_INIT_MSG: - nss_wifili_log_pdev_init_msg(nwm); - break; - - case NSS_WIFILI_PDEV_DEINIT_MSG: - nss_wifili_log_pdev_deinit_msg(nwm); - break; - - case NSS_WIFILI_PEER_CREATE_MSG: - case NSS_WIFILI_PEER_DELETE_MSG: - nss_wifili_log_peer_msg(nwm); - break; - - case NSS_WIFILI_PEER_FREELIST_APPEND_MSG: - nss_wifili_log_peer_freelist_append_msg(nwm); - break; - - case NSS_WIFILI_WDS_VENDOR_MSG: - nss_wifili_log_wds_extn_peer_cfg_msg(nwm); - break; - - case NSS_WIFILI_WDS_PEER_ADD_MSG: - case NSS_WIFILI_WDS_PEER_DEL_MSG: - case NSS_WIFILI_WDS_PEER_MAP_MSG: - nss_wifili_log_wds_peer_msg(nwm); - break; - - case NSS_WIFILI_WDS_ACTIVE_INFO_MSG: - nss_wifili_log_wds_active_info_msg(nwm); - break; - - case NSS_WIFILI_STATS_CFG_MSG: - nss_wifili_log_stats_cfg_msg(nwm); - break; - - case NSS_WIFILI_TID_REOQ_SETUP_MSG: - nss_wifili_log_reo_tidq_msg(nwm); - break; - - case NSS_WIFILI_RADIO_CMD_MSG: - nss_wifili_log_radio_cfg_msg(nwm); - break; - - case NSS_WIFILI_LINK_DESC_INFO_MSG: - nss_wifili_log_soc_linkdesc_buf_info_msg(nwm); - break; - - case NSS_WIFILI_PEER_SECURITY_TYPE_MSG: - nss_wifili_log_peer_security_msg(nwm); - break; - - case NSS_WIFILI_PEER_NAWDS_ENABLE_MSG: - nss_wifili_log_peer_nawds_enable_msg(nwm); - break; - - case NSS_WIFILI_DBDC_REPEATER_SET_MSG: - nss_wifili_log_dbdc_repeater_set_msg(nwm); - break; - - case NSS_WIFILI_SOJOURN_STATS_MSG: - case NSS_DBDC_REPEATER_AST_FLUSH_MSG: - case NSS_WIFILI_SEND_PEER_MEMORY_REQUEST_MSG: - case NSS_WIFILI_PEER_STATS_MSG: - case NSS_WIFILI_RADIO_BUF_CFG: - case NSS_WIFILI_STATS_MSG: - case NSS_WIFILI_START_MSG: - case NSS_WIFILI_STOP_MSG: - /* - * No log for these valid messages. - */ - break; - - default: - nss_warning("%px: Invalid message type\n", nwm); - break; - } -} - -/* - * nss_wifili_log_tx_msg() - * Log messages transmitted to FW. - */ -void nss_wifili_log_tx_msg(struct nss_wifili_msg *nwm) -{ - if (nwm->cm.type >= NSS_WIFILI_MAX_MSG) { - nss_warning("%px: Invalid message type\n", nwm); - return; - } - - nss_info("%px: type[%d]:%s\n", nwm, nwm->cm.type, nss_wifili_log_message_types_str[nwm->cm.type]); - nss_wifili_log_verbose(nwm); -} - -/* - * nss_wifili_log_rx_msg() - * Log messages received from FW. - */ -void nss_wifili_log_rx_msg(struct nss_wifili_msg *nwm) -{ - if (nwm->cm.response >= NSS_CMN_RESPONSE_LAST) { - nss_warning("%px: Invalid response\n", nwm); - return; - } - - if (nwm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (nwm->cm.response == NSS_CMN_RESPONSE_ACK)) { - nss_info("%px: type[%d]:%s, response[%d]:%s\n", nwm, nwm->cm.type, - nss_wifili_log_message_types_str[nwm->cm.type], - nwm->cm.response, nss_cmn_response_str[nwm->cm.response]); - goto verbose; - } - - if (nwm->cm.error >= NSS_WIFILI_EMSG_UNKNOWN) { - nss_warning("%px: msg failure - type[%d]:%s, response[%d]:%s, error[%d]:Invalid error\n", - nwm, nwm->cm.type, nss_wifili_log_message_types_str[nwm->cm.type], - nwm->cm.response, nss_cmn_response_str[nwm->cm.response], - nwm->cm.error); - goto verbose; - } - - nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s, error[%d]:%s\n", - nwm, nwm->cm.type, nss_wifili_log_message_types_str[nwm->cm.type], - nwm->cm.response, nss_cmn_response_str[nwm->cm.response], - nwm->cm.error, nss_wifili_log_error_response_types_str[nwm->cm.error]); - -verbose: - nss_wifili_log_verbose(nwm); -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_log.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifili_log.h deleted file mode 100644 index a381ab6cf..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_log.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ****************************************************************************** - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * **************************************************************************** - */ - -#ifndef __NSS_WIFILI_LOG_H__ -#define __NSS_WIFILI_LOG_H__ - -/* - * nss_WIFILI_log.h - * NSS WIFILI Log Header File - */ - -/* - * nss_WIFILI_log_tx_msg - * Logs a WIFILI message that is sent to the NSS firmware. - */ -void nss_wifili_log_tx_msg(struct nss_wifili_msg *ncm); - -/* - * nss_WIFILI_log_rx_msg - * Logs a WIFILI message that is received from the NSS firmware. - */ -void nss_wifili_log_rx_msg(struct nss_wifili_msg *ncm); - -#endif /* __NSS_WIFILI_LOG_H__ */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.c deleted file mode 100644 index 6f983bcf5..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.c +++ /dev/null @@ -1,512 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_wifili_stats.c - * NSS wifili statistics APIs - */ - -#include "nss_tx_rx_common.h" -#include "nss_core.h" -#include "nss_wifili_if.h" -#include "nss_wifili_stats.h" -#include "nss_wifili_strings.h" - -/* - * Declare atomic notifier data structure for statistics. - */ -ATOMIC_NOTIFIER_HEAD(nss_wifili_stats_notifier); - -/* - * Statistics structures - * The structure will hold the statistics for 3 SOCs. - */ -struct nss_wifili_soc_stats soc_stats[NSS_WIFILI_MAX_SOC_NUM]; - -/* - * nss_wifili_stats_read() - * Read wifili statistics - */ -static ssize_t nss_wifili_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - uint32_t i; - - /* - * max output lines = ((#stats + eight blank lines) * #WIFILI #STATS) + start/end tag + 3 blank - * + Number of Extra outputlines for future reference to add new stats - */ - uint32_t max_pdev = 0; - uint32_t max_output_lines; - size_t size_al = 0; - size_t size_wr = 0; - ssize_t bytes_read = 0; - char *lbuf = NULL; - uint32_t soc_idx; - struct nss_wifili_stats *stats_wifili = NULL; - - /* - * Max number of pdev depends on type of soc (Internal/Attached). - */ - for (soc_idx = 0; soc_idx < NSS_WIFILI_MAX_SOC_NUM; soc_idx++) { - max_pdev += soc_stats[soc_idx].soc_maxpdev; - } - - /* - * Max pdev cannot be null. - */ - if (unlikely(max_pdev == 0)) { - nss_warning("Cannot have max pdev zero "); - return 0; - } - - max_output_lines = (((NSS_WIFILI_STATS_MAX + 9) * max_pdev) + - NSS_WIFILI_STATS_WBM_MAX + NSS_STATS_EXTRA_OUTPUT_LINES); - - size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines; - - lbuf = kzalloc(size_al, GFP_KERNEL); - if (unlikely(lbuf == NULL)) { - nss_warning("Could not allocate memory for local statistics buffer"); - return 0; - } - - size_wr += nss_stats_banner(lbuf, size_wr, size_al, "wifili", NSS_STATS_SINGLE_CORE); - - for (soc_idx = 0; soc_idx < NSS_WIFILI_MAX_SOC_NUM; soc_idx++) { - stats_wifili = &(soc_stats[soc_idx].stats_wifili); - for (i = 0; i < soc_stats[soc_idx].soc_maxpdev; i++) { - - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "txrx", i - , nss_wifili_strings_stats_txrx - , stats_wifili->stats_txrx[i] - , NSS_WIFILI_STATS_TXRX_MAX - , lbuf, size_wr, size_al); - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr - , size_al - size_wr, "\n"); - - /* - * Filling TCL ring stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "tcl ring", i - , nss_wifili_strings_stats_tcl - , stats_wifili->stats_tcl_ring[i] - , NSS_WIFILI_STATS_TCL_MAX - , lbuf, size_wr, size_al); - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr - , size_al - size_wr, "\n"); - - /* - * Filling TCL comp stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "tcl comp", i - , nss_wifili_strings_stats_tx_comp - , stats_wifili->stats_tx_comp[i] - , NSS_WIFILI_STATS_TX_DESC_FREE_MAX - , lbuf, size_wr, size_al); - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr - , size_al - size_wr, "\n"); - - /* - * Filling reo ring stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "reo ring", i - , nss_wifili_strings_stats_reo - , stats_wifili->stats_reo[i] - , NSS_WIFILI_STATS_REO_MAX - , lbuf, size_wr, size_al); - - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr - , size_al - size_wr, "\n"); - - /* - * Filling TX SW Pool - */ - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "tx sw pool", i - , nss_wifili_strings_stats_txsw_pool - , stats_wifili->stats_tx_desc[i] - , NSS_WIFILI_STATS_TX_DESC_MAX - , lbuf, size_wr, size_al); - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr - , size_al - size_wr, "\n"); - - /* - * Filling TX EXt SW Pool - */ - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "tx ext sw pool", i - , nss_wifili_strings_stats_ext_txsw_pool - , stats_wifili->stats_ext_tx_desc[i] - , NSS_WIFILI_STATS_EXT_TX_DESC_MAX - , lbuf, size_wr, size_al); - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr - , size_al - size_wr, "\n"); - - /* - * Filling rxdma pool stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "rxdma pool", i - , nss_wifili_strings_stats_rxdma_pool - , stats_wifili->stats_rx_desc[i] - , NSS_WIFILI_STATS_RX_DESC_MAX - , lbuf, size_wr, size_al); - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr - , size_al - size_wr, "\n"); - - /* - * Filling rxdma ring stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "rxdma ring", i - , nss_wifili_strings_stats_rxdma_ring - , stats_wifili->stats_rxdma[i] - , NSS_WIFILI_STATS_RXDMA_DESC_MAX - , lbuf, size_wr, size_al); - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr - , size_al - size_wr, "\n"); - } - - /* - * Filling wbm ring stats - */ - spin_lock_bh(&nss_top_main.stats_lock); - size_wr += nss_stats_print("wifili", "wbm ring" - , NSS_STATS_SINGLE_INSTANCE - , nss_wifili_strings_stats_wbm - , stats_wifili->stats_wbm - , NSS_WIFILI_STATS_WBM_MAX - , lbuf, size_wr, size_al); - spin_unlock_bh(&nss_top_main.stats_lock); - size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n"); - } - - bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf)); - kfree(lbuf); - - return bytes_read; -} - -/* - * wifili_stats_ops - */ -NSS_STATS_DECLARE_FILE_OPERATIONS(wifili); - -/* - * nss_wifili_stats_dentry_create() - * Create wifili statistics debug entry. - */ -void nss_wifili_stats_dentry_create(void) -{ - nss_stats_create_dentry("wifili", &nss_wifili_stats_ops); -} - -/* - * nss_wifili_stats_sync() - * Handle the syncing of WIFI stats. - */ -void nss_wifili_stats_sync(struct nss_ctx_instance *nss_ctx, - struct nss_wifili_stats_sync_msg *wlsoc_stats, uint16_t interface) -{ - struct nss_top_instance *nss_top = nss_ctx->nss_top; - struct nss_wifili_soc_stats *nwss = NULL; - struct nss_wifili_stats *stats = NULL; - struct nss_wifili_device_stats *devstats = &wlsoc_stats->stats; - uint32_t index; - - /* - * Max number of pdev depends on type of soc (Internal/Attached). - */ - switch (interface) { - case NSS_WIFILI_INTERNAL_INTERFACE: - nwss = &soc_stats[0]; - nwss->soc_maxpdev = NSS_WIFILI_MAX_PDEV_NUM_MSG; - break; - - case NSS_WIFILI_EXTERNAL_INTERFACE0: - nwss = &soc_stats[1]; - nwss->soc_maxpdev = NSS_WIFILI_SOC_ATTACHED_MAX_PDEV_NUM; - break; - - case NSS_WIFILI_EXTERNAL_INTERFACE1: - nwss = &soc_stats[2]; - nwss->soc_maxpdev = NSS_WIFILI_SOC_ATTACHED_MAX_PDEV_NUM; - break; - - default: - nss_warning("%px: Invalid wifili interface\n", nss_ctx); - return; - } - - /* - * Wifili statistics structure. - */ - stats = &(nwss->stats_wifili); - - spin_lock_bh(&nss_top->stats_lock); - - for (index = 0; index < nwss->soc_maxpdev; index++) { - /* - * Rx stats - */ - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_MSDU_ERROR] += - devstats->rx_data_stats[index].rx_msdu_err; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_INV_PEER_RCV] += - (devstats->rx_data_stats[index].rx_inv_peer + - devstats->rx_data_stats[index].rx_scatter_inv_peer); - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_WDS_SRCPORT_EXCEPTION] += - devstats->rx_data_stats[index].rx_wds_learn_send; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_WDS_SRCPORT_EXCEPTION_FAIL] += - devstats->rx_data_stats[index].rx_wds_learn_send_fail; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_DELIVERD] += - devstats->rx_data_stats[index].rx_deliver_cnt; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_DELIVER_DROPPED] += - devstats->rx_data_stats[index].rx_deliver_cnt_fail; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_INTRA_BSS_UCAST] += - devstats->rx_data_stats[index].rx_intra_bss_ucast_send; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_INTRA_BSS_UCAST_FAIL] += - devstats->rx_data_stats[index].rx_intra_bss_ucast_send_fail; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_INTRA_BSS_MCAST] += - devstats->rx_data_stats[index].rx_intra_bss_mcast_send; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_INTRA_BSS_MCAST_FAIL] += - devstats->rx_data_stats[index].rx_intra_bss_mcast_send_fail; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_SG_RCV_SEND] += - devstats->rx_data_stats[index].rx_sg_recv_send; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_SG_RCV_FAIL] += - devstats->rx_data_stats[index].rx_sg_recv_fail; - stats->stats_txrx[index][NSS_STATS_WIFILI_RX_MCAST_ECHO] += - devstats->rx_data_stats[index].rx_me_pkts; - stats->stats_txrx[index][NSS_STATS_WIFILI_RX_INV_TID] += - devstats->rx_data_stats[index].rx_inv_tid; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_FRAG_INV_SC] += - devstats->rx_data_stats[index].rx_frag_inv_sc; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_FRAG_INV_FC] += - devstats->rx_data_stats[index].rx_frag_inv_fc; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_FRAG_NON_FRAG] += - devstats->rx_data_stats[index].rx_non_frag_err; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_FRAG_RETRY] += - devstats->rx_data_stats[index].rx_repeat_fragno; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_FRAG_OOO] += - devstats->rx_data_stats[index].rx_ooo_frag; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_FRAG_OOO_SEQ] += - devstats->rx_data_stats[index].rx_ooo_frag_seq; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_FRAG_ALL_FRAG_RCV] += - devstats->rx_data_stats[index].rx_all_frag_rcv; - stats->stats_txrx[index][NSS_WIFILI_STATS_RX_FRAG_DELIVER] += - devstats->rx_data_stats[index].rx_frag_deliver; - - /* - * Tx stats - */ - stats->stats_txrx[index][NSS_WIFILI_STATS_TX_ENQUEUE] += - devstats->tx_data_stats[index].tx_enqueue_cnt; - stats->stats_txrx[index][NSS_WIFILI_STATS_TX_ENQUEUE_DROP] += - devstats->tx_data_stats[index].tx_enqueue_dropped; - stats->stats_txrx[index][NSS_WIFILI_STATS_TX_DEQUEUE] += - devstats->tx_data_stats[index].tx_dequeue_cnt; - stats->stats_txrx[index][NSS_WIFILI_STATS_TX_HW_ENQUEUE_FAIL] += - devstats->tx_data_stats[index].tx_send_fail_cnt; - stats->stats_txrx[index][NSS_WIFILI_STATS_TX_SENT_COUNT] += - devstats->tx_data_stats[index].tx_processed_pkt; - } - - /* - * update the tcl ring stats - */ - for (index = 0; index < NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG; index++) { - stats->stats_tcl_ring[index][NSS_WIFILI_STATS_TCL_NO_HW_DESC] += - devstats->tcl_stats[index].tcl_no_hw_desc; - stats->stats_tcl_ring[index][NSS_WIFILI_STATS_TCL_RING_FULL] += - devstats->tcl_stats[index].tcl_ring_full; - stats->stats_tcl_ring[index][NSS_WIFILI_STATS_TCL_RING_SENT] += - devstats->tcl_stats[index].tcl_ring_sent; - } - - /* - * update the tcl comp stats - */ - for (index = 0; index < NSS_WIFILI_MAX_TCL_DATA_RINGS_MSG; index++) { - stats->stats_tx_comp[index][NSS_WIFILI_STATS_TX_DESC_FREE_INV_BUFSRC] += - devstats->txcomp_stats[index].invalid_bufsrc; - stats->stats_tx_comp[index][NSS_WIFILI_STATS_TX_DESC_FREE_INV_COOKIE] += - devstats->txcomp_stats[index].invalid_cookie; - stats->stats_tx_comp[index][NSS_WIFILI_STATS_TX_DESC_FREE_HW_RING_EMPTY] += - devstats->txcomp_stats[index].hw_ring_empty; - stats->stats_tx_comp[index][NSS_WIFILI_STATS_TX_DESC_FREE_REAPED] += - devstats->txcomp_stats[index].ring_reaped; - } - - /* - * update reo ring stats - */ - for (index = 0; index < NSS_WIFILI_MAX_REO_DATA_RINGS_MSG; index++) { - stats->stats_reo[index][NSS_WIFILI_STATS_REO_ERROR] += - devstats->rxreo_stats[index].ring_error; - stats->stats_reo[index][NSS_WIFILI_STATS_REO_REAPED] += - devstats->rxreo_stats[index].ring_reaped; - stats->stats_reo[index][NSS_WIFILI_STATS_REO_INV_COOKIE] += - devstats->rxreo_stats[index].invalid_cookie; - stats->stats_reo[index][NSS_WIFILI_STATS_REO_FRAG_RCV] += - devstats->rxreo_stats[index].defrag_reaped; - } - - /* - * update tx sw pool - */ - for (index = 0; index < NSS_WIFILI_MAX_TXDESC_POOLS_MSG; index++) { - stats->stats_tx_desc[index][NSS_WIFILI_STATS_TX_DESC_IN_USE] = - devstats->tx_sw_pool_stats[index].desc_alloc; - stats->stats_tx_desc[index][NSS_WIFILI_STATS_TX_DESC_ALLOC_FAIL] += - devstats->tx_sw_pool_stats[index].desc_alloc_fail; - stats->stats_tx_desc[index][NSS_WIFILI_STATS_TX_DESC_ALREADY_ALLOCATED] += - devstats->tx_sw_pool_stats[index].desc_already_allocated; - stats->stats_tx_desc[index][NSS_WIFILI_STATS_TX_DESC_INVALID_FREE] += - devstats->tx_sw_pool_stats[index].desc_invalid_free; - stats->stats_tx_desc[index][NSS_WIFILI_STATS_TX_DESC_FREE_SRC_FW] += - devstats->tx_sw_pool_stats[index].tx_rel_src_fw; - stats->stats_tx_desc[index][NSS_WIFILI_STATS_TX_DESC_FREE_COMPLETION] += - devstats->tx_sw_pool_stats[index].tx_rel_tx_desc; - stats->stats_tx_desc[index][NSS_WIFILI_STATS_TX_DESC_NO_PB] += - devstats->tx_sw_pool_stats[index].tx_rel_no_pb; - stats->stats_tx_desc[index][NSS_WIFILI_STATS_TX_QUEUELIMIT_DROP] += - devstats->tx_sw_pool_stats[index].tx_queue_limit_drop; - } - - /* - * update ext tx desc pool stats - */ - for (index = 0; index < NSS_WIFILI_MAX_TX_EXT_DESC_POOLS_MSG; index++) { - stats->stats_ext_tx_desc[index][NSS_WIFILI_STATS_EXT_TX_DESC_IN_USE] = - devstats->tx_ext_sw_pool_stats[index].desc_alloc; - stats->stats_ext_tx_desc[index][NSS_WIFILI_STATS_EXT_TX_DESC_ALLOC_FAIL] += - devstats->tx_ext_sw_pool_stats[index].desc_alloc_fail; - stats->stats_ext_tx_desc[index][NSS_WIFILI_STATS_EXT_TX_DESC_ALREADY_ALLOCATED] += - devstats->tx_ext_sw_pool_stats[index].desc_already_allocated; - stats->stats_ext_tx_desc[index][NSS_WIFILI_STATS_EXT_TX_DESC_INVALID_FREE] += - devstats->tx_ext_sw_pool_stats[index].desc_invalid_free; - } - - /* - * update rx desc pool stats - */ - for (index = 0; index < nwss->soc_maxpdev; index++) { - stats->stats_rx_desc[index][NSS_WIFILI_STATS_RX_DESC_NO_PB] += - devstats->rx_sw_pool_stats[index].rx_no_pb; - stats->stats_rx_desc[index][NSS_WIFILI_STATS_RX_DESC_ALLOC_FAIL] += - devstats->rx_sw_pool_stats[index].desc_alloc_fail; - stats->stats_rx_desc[index][NSS_WIFILI_STATS_RX_DESC_IN_USE] = - devstats->rx_sw_pool_stats[index].desc_alloc; - } - - /* - * update rx dma ring stats - */ - for (index = 0; index < nwss->soc_maxpdev; index++) { - stats->stats_rxdma[index][NSS_WIFILI_STATS_RXDMA_DESC_UNAVAILABLE] += - devstats->rxdma_stats[index].rx_hw_desc_unavailable; - stats->stats_rxdma[index][NSS_WIFILI_STATS_RXDMA_BUF_REPLENISHED] += - devstats->rxdma_stats[index].rx_buf_replenished; - } - - /* - * update wbm ring stats - */ - stats->stats_wbm[NSS_WIFILI_STATS_WBM_IE_LOCAL_ALLOC_FAIL] += devstats->rxwbm_stats.invalid_buf_mgr; - stats->stats_wbm[NSS_WIFILI_STATS_WBM_SRC_DMA] += devstats->rxwbm_stats.err_src_rxdma; - stats->stats_wbm[NSS_WIFILI_STATS_WBM_SRC_DMA_CODE_INV] += devstats->rxwbm_stats.err_src_rxdma_code_inv; - stats->stats_wbm[NSS_WIFILI_STATS_WBM_SRC_REO] += devstats->rxwbm_stats.err_src_reo; - stats->stats_wbm[NSS_WIFILI_STATS_WBM_SRC_REO_CODE_NULLQ] += devstats->rxwbm_stats.err_src_reo_code_nullq; - stats->stats_wbm[NSS_WIFILI_STATS_WBM_SRC_REO_CODE_INV] += devstats->rxwbm_stats.err_src_reo_code_inv; - stats->stats_wbm[NSS_WIFILI_STATS_WBM_SRC_INV] += devstats->rxwbm_stats.err_src_invalid; - spin_unlock_bh(&nss_top->stats_lock); - return; -} - -/* - * nss_wifili_stats_notify() - * Sends notifications to the registered modules. - * - * Leverage NSS-FW statistics timing to update Netlink. - */ -void nss_wifili_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num) -{ - struct nss_wifili_stats_notification *wifili_stats; - uint32_t index = 0; - - wifili_stats = kzalloc(sizeof(struct nss_wifili_stats_notification), GFP_ATOMIC); - if (!wifili_stats) { - nss_warning("%px: Failed to allocate memory for wifili stats\n", nss_ctx); - return; - } - - wifili_stats->core_id = nss_ctx->id; - switch (if_num) { - case NSS_WIFILI_INTERNAL_INTERFACE: - index = 0; - break; - - case NSS_WIFILI_EXTERNAL_INTERFACE0: - index = 1; - break; - - case NSS_WIFILI_EXTERNAL_INTERFACE1: - index = 2; - break; - - default: - nss_warning("%px: Invalid wifili interface\n", nss_ctx); - goto done; - } - wifili_stats->if_num = if_num; - memcpy(&wifili_stats->stats, &soc_stats[index].stats_wifili, sizeof(wifili_stats->stats)); - atomic_notifier_call_chain(&nss_wifili_stats_notifier, NSS_STATS_EVENT_NOTIFY, (void *)wifili_stats); - -done: - kfree(wifili_stats); - return; -} - -/* - * nss_wifili_stats_register_notifier() - * Registers statistics notifier. - */ -int nss_wifili_stats_register_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(&nss_wifili_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_wifili_stats_register_notifier); - -/* - * nss_wifili_stats_unregister_notifier() - * Deregisters statistics notifier. - */ -int nss_wifili_stats_unregister_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_unregister(&nss_wifili_stats_notifier, nb); -} -EXPORT_SYMBOL(nss_wifili_stats_unregister_notifier); diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.h deleted file mode 100644 index 9c073ce8d..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_stats.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -/* - * nss_wifili_stats.h - * NSS wifili statistics header file. - */ - -#ifndef __NSS_WIFILI_STATS_H -#define __NSS_WIFILI_STATS_H - -#include "nss_core.h" -#include "nss_wifili_if.h" - -/* - * NSS wifili statistics APIs - */ -extern void nss_wifili_stats_notify(struct nss_ctx_instance *nss_ctx, uint32_t if_num); -extern void nss_wifili_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_wifili_stats_sync_msg *wlsoc_stats, uint16_t interface); -extern void nss_wifili_stats_dentry_create(void); - -#endif /* __NSS_WIFILI_STATS_H */ diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_strings.c b/feeds/ipq807x/qca-nss-drv/src/nss_wifili_strings.c deleted file mode 100644 index 3828221bd..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_strings.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#include "nss_stats.h" -#include "nss_core.h" -#include -#include "nss_strings.h" -#include "nss_wifili_strings.h" - -/* - * nss_wifili_strings_stats_txrx - * wifili txrx statistics - */ -struct nss_stats_info nss_wifili_strings_stats_txrx[NSS_WIFILI_STATS_TXRX_MAX] = { - {"rx_msdu_error" , NSS_STATS_TYPE_ERROR}, - {"rx_inv_peer_rcv" , NSS_STATS_TYPE_SPECIAL}, - {"rx_wds_srcport_exception" , NSS_STATS_TYPE_EXCEPTION}, - {"rx_wds_srcport_exception_fail" , NSS_STATS_TYPE_DROP}, - {"rx_deliverd" , NSS_STATS_TYPE_SPECIAL}, - {"rx_deliver_drops" , NSS_STATS_TYPE_DROP}, - {"rx_intra_bss_ucast" , NSS_STATS_TYPE_SPECIAL}, - {"rx_intra_bss_ucast_fail" , NSS_STATS_TYPE_DROP}, - {"rx_intra_bss_mcast" , NSS_STATS_TYPE_SPECIAL}, - {"rx_intra_bss_mcast_fail" , NSS_STATS_TYPE_DROP}, - {"rx_sg_rcv_send" , NSS_STATS_TYPE_SPECIAL}, - {"rx_sg_rcv_fail" , NSS_STATS_TYPE_DROP}, - {"rx_mcast_echo" , NSS_STATS_TYPE_SPECIAL}, - {"rx_inv_tid" , NSS_STATS_TYPE_SPECIAL}, - {"stats_rx_frag_inv_sc" , NSS_STATS_TYPE_SPECIAL}, - {"stats_rx_frag_inv_fc" , NSS_STATS_TYPE_SPECIAL}, - {"stats_rx_frag_non_frag" , NSS_STATS_TYPE_SPECIAL}, - {"stats_rx_frag_retry" , NSS_STATS_TYPE_SPECIAL}, - {"stats_rx_frag_ooo" , NSS_STATS_TYPE_SPECIAL}, - {"stats_rx_frag_ooo_seq" , NSS_STATS_TYPE_SPECIAL}, - {"stats_rx_frag_all_frag_rcv" , NSS_STATS_TYPE_SPECIAL}, - {"stats_rx_frag_deliver" , NSS_STATS_TYPE_SPECIAL}, - {"tx_enqueue" , NSS_STATS_TYPE_SPECIAL}, - {"tx_enqueue_drop" , NSS_STATS_TYPE_DROP}, - {"tx_dequeue" , NSS_STATS_TYPE_SPECIAL}, - {"tx_hw_enqueue_fail" , NSS_STATS_TYPE_DROP}, - {"tx_sent_count" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifili_strings_stats_tcl - * wifili tcl stats - */ -struct nss_stats_info nss_wifili_strings_stats_tcl[NSS_WIFILI_STATS_TCL_MAX] = { - {"tcl_no_hw_desc" , NSS_STATS_TYPE_SPECIAL}, - {"tcl_ring_full" , NSS_STATS_TYPE_SPECIAL}, - {"tcl_ring_sent" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifili_strings_stats_tx_comp - * wifili tx comp stats - */ -struct nss_stats_info nss_wifili_strings_stats_tx_comp[NSS_WIFILI_STATS_TX_DESC_FREE_MAX] = { - {"tx_desc_free_inv_bufsrc" , NSS_STATS_TYPE_ERROR}, - {"tx_desc_free_inv_cookie" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_free_hw_ring_empty" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_free_reaped" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifili_strings_stats_reo - * wifili tx reo stats - */ -struct nss_stats_info nss_wifili_strings_stats_reo[NSS_WIFILI_STATS_REO_MAX] = { - {"reo_error" , NSS_STATS_TYPE_ERROR}, - {"reo_reaped" , NSS_STATS_TYPE_SPECIAL}, - {"reo_inv_cookie" , NSS_STATS_TYPE_SPECIAL}, - {"stats_reo_frag_rcv" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifili_strings_stats_txsw_pool - * wifili tx desc stats - */ -struct nss_stats_info nss_wifili_strings_stats_txsw_pool[NSS_WIFILI_STATS_TX_DESC_MAX] = { - {"tx_desc_in_use" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_alloc_fail" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_already_allocated" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_invalid_free" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_free_src_fw" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_free_completion" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_no_pb" , NSS_STATS_TYPE_SPECIAL}, - {"tx_desc_queuelimit_drop" , NSS_STATS_TYPE_DROP} -}; - -/* - * nss_wifili_strings_stats_ext_txsw_pool - * wifili tx ext desc stats - */ -struct nss_stats_info nss_wifili_strings_stats_ext_txsw_pool[NSS_WIFILI_STATS_EXT_TX_DESC_MAX] = { - {"ext_tx_desc_in_use" , NSS_STATS_TYPE_SPECIAL}, - {"ext_tx_desc_alloc_fail" , NSS_STATS_TYPE_SPECIAL}, - {"ext_tx_desc_already_allocated" , NSS_STATS_TYPE_SPECIAL}, - {"ext_tx_desc_invalid_free" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifili_strings_stats_rxdma_pool - * wifili rx desc stats - */ -struct nss_stats_info nss_wifili_strings_stats_rxdma_pool[NSS_WIFILI_STATS_RX_DESC_MAX] = { - {"rx_desc_no_pb" , NSS_STATS_TYPE_SPECIAL}, - {"rx_desc_alloc_fail" , NSS_STATS_TYPE_SPECIAL}, - {"rx_desc_in_use" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifili_strings_stats_rxdma_ring - * wifili rx dma ring stats - */ -struct nss_stats_info nss_wifili_strings_stats_rxdma_ring[NSS_WIFILI_STATS_RXDMA_DESC_MAX] = { - {"rxdma_hw_desc_unavailable" , NSS_STATS_TYPE_SPECIAL}, - {"rxdma_buf_replenished" , NSS_STATS_TYPE_SPECIAL} -}; - -/* - * nss_wifili_strings_stats_wbm - * wifili wbm ring stats - */ -struct nss_stats_info nss_wifili_strings_stats_wbm[NSS_WIFILI_STATS_WBM_MAX] = { - {"wbm_ie_local_alloc_fail" , NSS_STATS_TYPE_ERROR}, - {"wbm_src_dma" , NSS_STATS_TYPE_SPECIAL}, - {"wbm_src_dma_code_inv" , NSS_STATS_TYPE_SPECIAL}, - {"wbm_src_reo" , NSS_STATS_TYPE_SPECIAL}, - {"wbm_src_reo_code_nullq" , NSS_STATS_TYPE_SPECIAL}, - {"wbm_src_reo_code_inv" , NSS_STATS_TYPE_ERROR}, - {"wbm_src_inv" , NSS_STATS_TYPE_ERROR} -}; - -/* - * nss_wifili_txrx_strings_read() - * Read wifili Tx Rx statistics names. - */ -static ssize_t nss_wifili_txrx_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_txrx, NSS_WIFILI_STATS_TXRX_MAX); -} - -/* - * nss_wifili_tcl_ring_strings_read() - * Read wifili TCL ring statistics names. - */ -static ssize_t nss_wifili_tcl_ring_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_tcl, NSS_WIFILI_STATS_TCL_MAX); -} - -/* - * nss_wifili_tcl_comp_strings_read() - * Read wifili TCL comp statistics names. - */ -static ssize_t nss_wifili_tcl_comp_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_tx_comp, NSS_WIFILI_STATS_TX_DESC_FREE_MAX); -} - -/* - * nss_wifili_reo_ring_strings_read() - * Read wifili reorder ring statistics names. - */ -static ssize_t nss_wifili_reo_ring_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_reo, NSS_WIFILI_STATS_REO_MAX); -} - -/* - * nss_wifili_tx_sw_strings_read() - * Read wifili Tx sw statistics names. - */ -static ssize_t nss_wifili_tx_sw_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_txsw_pool, NSS_WIFILI_STATS_TX_DESC_MAX); -} - -/* - * nss_wifili_tx_ext_sw_strings_read() - * Read wifili Tx ext sw statistics names. - */ -static ssize_t nss_wifili_tx_ext_sw_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_ext_txsw_pool, NSS_WIFILI_STATS_EXT_TX_DESC_MAX); -} - -/* - * nss_wifili_rx_dma_pool_strings_read() - * Read wifili Rx DMA pool statistics names. - */ -static ssize_t nss_wifili_rx_dma_pool_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_rxdma_pool, NSS_WIFILI_STATS_RX_DESC_MAX); -} - -/* - * nss_wifili_rx_dma_ring_strings_read() - * Read wifili Rx DMA ring statistics names. - */ -static ssize_t nss_wifili_rx_dma_ring_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_rxdma_ring, NSS_WIFILI_STATS_RXDMA_DESC_MAX); -} - -/* - * nss_wifili_wbm_ring_strings_read() - * Read wifili WBM ring statistics names. - */ -static ssize_t nss_wifili_wbm_ring_strings_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos) -{ - return nss_strings_print(ubuf, sz, ppos, nss_wifili_strings_stats_wbm, NSS_WIFILI_STATS_WBM_MAX); -} - -/* - * nss_wifili_txrx_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_txrx); - -/* - * nss_wifili_tcl_ring_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_tcl_ring); - -/* - * nss_wifili_tcl_comp_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_tcl_comp); - -/* - * nss_wifili_reo_ring_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_reo_ring); - -/* - * nss_wifili_tx_sw_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_tx_sw); - -/* - * nss_wifili_tx_ext_sw_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_tx_ext_sw); - -/* - * nss_wifili_rx_dma_pool_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_rx_dma_pool); - -/* - * nss_wifili_rx_dma_ring_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_rx_dma_ring); - -/* - * nss_wifili_wbm_ring_strings_ops - */ -NSS_STRINGS_DECLARE_FILE_OPERATIONS(wifili_wbm_ring); - -/* - * nss_wifili_strings_dentry_create() - * Create wifili statistics strings debug entry. - */ -void nss_wifili_strings_dentry_create(void) -{ - struct dentry *wifili_d = NULL; - struct dentry *wifili_txrx_d = NULL; - struct dentry *wifili_tcl_ring_d = NULL; - struct dentry *wifili_tcl_comp_d = NULL; - struct dentry *wifili_reo_ring_d = NULL; - struct dentry *wifili_tx_sw_d = NULL; - struct dentry *wifili_tx_ext_sw_d = NULL; - struct dentry *wifili_rx_dma_pool_d = NULL; - struct dentry *wifili_rx_dma_ring_d = NULL; - struct dentry *wifili_wbm_ring_d = NULL; - - if (!nss_top_main.strings_dentry) { - nss_warning("qca-nss-drv/strings is not present"); - return; - } - - wifili_d = debugfs_create_dir("wifili", nss_top_main.strings_dentry); - if (!wifili_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili directory"); - return; - } - - wifili_txrx_d = debugfs_create_file("txrx_str", 0400, wifili_d, &nss_top_main, &nss_wifili_txrx_strings_ops); - if (!wifili_txrx_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/txrx_str file"); - debugfs_remove_recursive(wifili_d); - return; - } - - wifili_tcl_ring_d = debugfs_create_file("tcl_ring_str", 0400, wifili_d, &nss_top_main, &nss_wifili_tcl_ring_strings_ops); - if (!wifili_tcl_ring_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/tcl_ring_str file"); - debugfs_remove_recursive(wifili_d); - return; - } - - wifili_tcl_comp_d = debugfs_create_file("tcl_comp_str", 0400, wifili_d, &nss_top_main, &nss_wifili_tcl_comp_strings_ops); - if (!wifili_tcl_comp_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/tcl_comp_str file"); - debugfs_remove_recursive(wifili_d); - return; - } - - wifili_reo_ring_d = debugfs_create_file("reo_ring_str", 0400, wifili_d, &nss_top_main, &nss_wifili_reo_ring_strings_ops); - if (!wifili_reo_ring_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/reo_ring_str file"); - debugfs_remove_recursive(wifili_d); - return; - } - - wifili_tx_sw_d = debugfs_create_file("tx_sw_str", 0400, wifili_d, &nss_top_main, &nss_wifili_tx_sw_strings_ops); - if (!wifili_tx_sw_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/tx_sw_str file"); - debugfs_remove_recursive(wifili_d); - return; - } - - wifili_tx_ext_sw_d = debugfs_create_file("tx_ext_sw_str", 0400, wifili_d, &nss_top_main, &nss_wifili_tx_ext_sw_strings_ops); - if (!wifili_tx_ext_sw_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/tx_ext_sw_str file"); - debugfs_remove_recursive(wifili_d); - return; - } - - wifili_rx_dma_pool_d = debugfs_create_file("rx_dma_pool_str", 0400, wifili_d, &nss_top_main, &nss_wifili_rx_dma_pool_strings_ops); - if (!wifili_rx_dma_pool_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/rx_dma_pool_str file"); - debugfs_remove_recursive(wifili_d); - return; - } - - wifili_rx_dma_ring_d = debugfs_create_file("rx_dma_ring_str", 0400, wifili_d, &nss_top_main, &nss_wifili_rx_dma_ring_strings_ops); - if (!wifili_rx_dma_ring_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/rx_dma_ring_str file"); - debugfs_remove_recursive(wifili_d); - return; - } - - wifili_wbm_ring_d = debugfs_create_file("wbm_ring_str", 0400, wifili_d, &nss_top_main, &nss_wifili_wbm_ring_strings_ops); - if (!wifili_wbm_ring_d) { - nss_warning("Failed to create qca-nss-drv/strings/wifili/wbm_ring_str file"); - debugfs_remove_recursive(wifili_d); - return; - } -} diff --git a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_strings.h b/feeds/ipq807x/qca-nss-drv/src/nss_wifili_strings.h deleted file mode 100644 index 263d172f6..000000000 --- a/feeds/ipq807x/qca-nss-drv/src/nss_wifili_strings.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - ************************************************************************** - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ************************************************************************** - */ - -#ifndef __NSS_WIFILI_STRINGS_H -#define __NSS_WIFILI_STRINGS_H - -/* - * Maximum string length: - * This should be equal to maximum string size of any stats - * inclusive of stats value - */ -#define NSS_WIFILI_STATS_MAX (NSS_WIFILI_STATS_TXRX_MAX + NSS_WIFILI_STATS_TCL_MAX + \ - NSS_WIFILI_STATS_TX_DESC_FREE_MAX + NSS_WIFILI_STATS_REO_MAX + \ - NSS_WIFILI_STATS_TX_DESC_MAX + NSS_WIFILI_STATS_EXT_TX_DESC_MAX + \ - NSS_WIFILI_STATS_RX_DESC_MAX + NSS_WIFILI_STATS_RXDMA_DESC_MAX) - -extern struct nss_stats_info nss_wifili_strings_stats_txrx[NSS_WIFILI_STATS_TXRX_MAX]; -extern struct nss_stats_info nss_wifili_strings_stats_tcl[NSS_WIFILI_STATS_TCL_MAX]; -extern struct nss_stats_info nss_wifili_strings_stats_tx_comp[NSS_WIFILI_STATS_TX_DESC_FREE_MAX]; -extern struct nss_stats_info nss_wifili_strings_stats_reo[NSS_WIFILI_STATS_REO_MAX]; -extern struct nss_stats_info nss_wifili_strings_stats_txsw_pool[NSS_WIFILI_STATS_TX_DESC_MAX]; -extern struct nss_stats_info nss_wifili_strings_stats_ext_txsw_pool[NSS_WIFILI_STATS_EXT_TX_DESC_MAX]; -extern struct nss_stats_info nss_wifili_strings_stats_rxdma_pool[NSS_WIFILI_STATS_RX_DESC_MAX]; -extern struct nss_stats_info nss_wifili_strings_stats_rxdma_ring[NSS_WIFILI_STATS_RXDMA_DESC_MAX]; -extern struct nss_stats_info nss_wifili_strings_stats_wbm[NSS_WIFILI_STATS_WBM_MAX]; - -extern void nss_wifili_strings_dentry_create(void); - -#endif /* __NSS_WIFILI_STRINGS_H */ diff --git a/feeds/ipq807x/qca-nss-fw/Makefile b/feeds/ipq807x/qca-nss-fw/Makefile deleted file mode 100644 index bad465338..000000000 --- a/feeds/ipq807x/qca-nss-fw/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=qca-nss-fw -PKG_VERSION:=383 - -PKG_MAINTAINER:=John Crispin - -include $(INCLUDE_DIR)/package.mk - -define Package/qca-nss-fw-default - SECTION:=firmware - CATEGORY:=Firmware - URL:=$(PKG_SOURCE_URL) - DEPENDS:= -endef - -define Package/qca-nss-fw-ipq60xx -$(Package/qca-nss-fw-default) - TITLE:=NSS firmware for IPQ60xx devices - DEPENDS:=@TARGET_ipq807x_ipq60xx -endef - -define Package/qca-nss-fw-ipq807x -$(Package/qca-nss-fw-default) - TITLE:=NSS firmware for IPQ807x devices - DEPENDS:=@TARGET_ipq807x_ipq807x -endef - -define Package/qca-nss-fw-ipq50xx -$(Package/qca-nss-fw-default) - TITLE:=NSS firmware for IPQ50xx devices - DEPENDS:=@TARGET_ipq807x_ipq50xx -endef - -define Package/qca-nss-fw-ipq60xx/description -Retail NSS firmware for IPQ60xx from QCA -endef - -define Package/qca-nss-fw-ipq807x/description -Retail NSS firmware for IPQ807x from QCA -endef - -define Package/qca-nss-fw-ipq50xx/description -Retail NSS firmware for IPQ50xx from QCA -endef - -define Build/Compile - -endef - -define Package/qca-nss-fw-ipq60xx/install - $(INSTALL_DIR) $(1)/lib/firmware/ - $(INSTALL_DATA) ./files/IPQ6018/* \ - $(1)/lib/firmware/ -endef - -define Package/qca-nss-fw-ipq807x/install - $(INSTALL_DIR) $(1)/lib/firmware/ - $(INSTALL_DATA) ./files/IPQ8074/* \ - $(1)/lib/firmware/ -endef - -define Package/qca-nss-fw-ipq50xx/install - $(INSTALL_DIR) $(1)/lib/firmware/ - $(INSTALL_DATA) ./files/IPQ5018/* \ - $(1)/lib/firmware/ -endef - -$(eval $(call BuildPackage,qca-nss-fw-ipq50xx)) -$(eval $(call BuildPackage,qca-nss-fw-ipq60xx)) -$(eval $(call BuildPackage,qca-nss-fw-ipq807x)) diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ5018/qca-nss0.bin b/feeds/ipq807x/qca-nss-fw/files/IPQ5018/qca-nss0.bin deleted file mode 100755 index 52c8468a3..000000000 Binary files a/feeds/ipq807x/qca-nss-fw/files/IPQ5018/qca-nss0.bin and /dev/null differ diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ6018/Notice.txt b/feeds/ipq807x/qca-nss-fw/files/IPQ6018/Notice.txt deleted file mode 100644 index 14ae319ec..000000000 --- a/feeds/ipq807x/qca-nss-fw/files/IPQ6018/Notice.txt +++ /dev/null @@ -1,236 +0,0 @@ -============================================================================= - -This Notice.txt file contains certain notices of software components included with the software that Qualcomm Atheros, Inc. ("Qualcomm Atheros") is required to provide you. Except where prohibited by the open source license, the content of this notices file is only provided to satisfy Qualcomm Atheros's attribution and notice requirement; your use of these software components together with the Qualcomm Atheros software (Qualcomm Atheros software hereinafter referred to as "Software") is subject to the terms of your agreement from Qualcomm Atheros. Compliance with all copyright laws and software license agreements included in the notice section of this file are the responsibility of the user. Except as may be granted by separate express written agreement, this file provides no license to any patents, trademarks, copyrights, or other intellectual property of Qualcomm Incorporated or any of its subsidiaries. - -Qualcomm is a trademark of Qualcomm Incorporated, registered in the United States and other countries. All Qualcomm Incorporated trademarks are used with permission. Other products and brand names may be trademarks or registered trademarks of their respective owners. - - -NOTICES: - -============================================================================= - -/* - * doprint.c - * Formatted string print support. - * - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * This code originates with BSD Unix however it has been extensively - * modified. The original copyright is reproduced below: - * - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * Neither the name of the University nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - - -/* - * math.c - * Support for the standard C library. - * - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * Software contained within this file was originally released with the following - * copyright and license statement: - * - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - - -/* - * stdlib.c - * Routines from stdlib.h. - * - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * The code for strtol() and strtoul() are also subject to the following: - * - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -drr_alg_utils.h: -/****************************************************************************/ -/*- - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -shaper_list_utils.h: -/****************************************************************************/ -/*- - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -codel_alg_inv_sqrt.h -/****************************************************************************/ -/*- - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ6018/ReadMe.txt b/feeds/ipq807x/qca-nss-fw/files/IPQ6018/ReadMe.txt deleted file mode 100644 index 01d96758e..000000000 --- a/feeds/ipq807x/qca-nss-fw/files/IPQ6018/ReadMe.txt +++ /dev/null @@ -1,10 +0,0 @@ -Identification - -This release is: IPQ6018.ATH.11.3.0 ED1 - -The Linux Foundation hosted open-source label -(CAF_TAG) that corresponds to this release is: caf_AU_LINUX_QSDK_NHSS.QSDK.11.3.0.5.R1_TARGET_ALL.12.0.5005.031.xml - -NSS Firmware Version: NSS.CP.2.0-383-R - -This product includes software developed by the University of California, Berkeley, and its contributors. diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ6018/qca-nss0.bin b/feeds/ipq807x/qca-nss-fw/files/IPQ6018/qca-nss0.bin deleted file mode 100755 index 56b20c27d..000000000 Binary files a/feeds/ipq807x/qca-nss-fw/files/IPQ6018/qca-nss0.bin and /dev/null differ diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/Notice.txt b/feeds/ipq807x/qca-nss-fw/files/IPQ8074/Notice.txt deleted file mode 100644 index 14ae319ec..000000000 --- a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/Notice.txt +++ /dev/null @@ -1,236 +0,0 @@ -============================================================================= - -This Notice.txt file contains certain notices of software components included with the software that Qualcomm Atheros, Inc. ("Qualcomm Atheros") is required to provide you. Except where prohibited by the open source license, the content of this notices file is only provided to satisfy Qualcomm Atheros's attribution and notice requirement; your use of these software components together with the Qualcomm Atheros software (Qualcomm Atheros software hereinafter referred to as "Software") is subject to the terms of your agreement from Qualcomm Atheros. Compliance with all copyright laws and software license agreements included in the notice section of this file are the responsibility of the user. Except as may be granted by separate express written agreement, this file provides no license to any patents, trademarks, copyrights, or other intellectual property of Qualcomm Incorporated or any of its subsidiaries. - -Qualcomm is a trademark of Qualcomm Incorporated, registered in the United States and other countries. All Qualcomm Incorporated trademarks are used with permission. Other products and brand names may be trademarks or registered trademarks of their respective owners. - - -NOTICES: - -============================================================================= - -/* - * doprint.c - * Formatted string print support. - * - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * This code originates with BSD Unix however it has been extensively - * modified. The original copyright is reproduced below: - * - * Copyright (c) 1988 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted provided - * that: (1) source distributions retain this entire copyright notice and - * comment, and (2) distributions including binaries display the following - * acknowledgement: ``This product includes software developed by the - * University of California, Berkeley and its contributors'' in the - * documentation or other materials provided with the distribution and in - * all advertising materials mentioning features or use of this software. - * Neither the name of the University nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - - -/* - * math.c - * Support for the standard C library. - * - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * Software contained within this file was originally released with the following - * copyright and license statement: - * - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - - -/* - * stdlib.c - * Routines from stdlib.h. - * - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * The code for strtol() and strtoul() are also subject to the following: - * - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -drr_alg_utils.h: -/****************************************************************************/ -/*- - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -shaper_list_utils.h: -/****************************************************************************/ -/*- - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -codel_alg_inv_sqrt.h -/****************************************************************************/ -/*- - * Copyright (c) 2015 Qualcomm Atheros, Inc. - * - * All Rights Reserved. - * - * Qualcomm Atheros Confidential and Proprietary. - * - * Notifications and licenses are retained for attribution purposes only - * - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/ReadMe.txt b/feeds/ipq807x/qca-nss-fw/files/IPQ8074/ReadMe.txt deleted file mode 100644 index 389323de8..000000000 --- a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/ReadMe.txt +++ /dev/null @@ -1,10 +0,0 @@ -Identification - -This release is: IPQ8074.ATH.11.3.0 ED1 - -The Linux Foundation hosted open-source label -(CAF_TAG) that corresponds to this release is: caf_AU_LINUX_QSDK_NHSS.QSDK.11.3.0.5.R1_TARGET_ALL.12.0.5005.031.xml - -NSS Firmware Version: NSS.HK.2.0-383-R - -This product includes software developed by the University of California, Berkeley, and its contributors. diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss0.bin b/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss0.bin deleted file mode 100755 index 75e2d925b..000000000 Binary files a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss0.bin and /dev/null differ diff --git a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss1.bin b/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss1.bin deleted file mode 100755 index b191ba8f6..000000000 Binary files a/feeds/ipq807x/qca-nss-fw/files/IPQ8074/qca-nss1.bin and /dev/null differ diff --git a/feeds/ipq807x/qca-ssdk-shell/Makefile b/feeds/ipq807x/qca-ssdk-shell/Makefile deleted file mode 100755 index a06afadf5..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/Makefile +++ /dev/null @@ -1,43 +0,0 @@ - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=qca-ssdk-shell -PKG_RELEASE:=1 - -include $(INCLUDE_DIR)/package.mk - -define Package/qca-ssdk-shell - SECTION:=QCA - CATEGORY:=Utilities - TITLE:=Shell application for QCA SSDK -endef - - -define Package/qca-ssdk-shell/Description - This package contains a qca-ssdk shell application for QCA chipset -endef - -ifndef CONFIG_TOOLCHAIN_BIN_PATH -CONFIG_TOOLCHAIN_BIN_PATH=$(TOOLCHAIN_DIR)/bin -endif - -QCASSDK_CONFIG_OPTS+= TOOL_PATH=$(CONFIG_TOOLCHAIN_BIN_PATH) \ - SYS_PATH=$(LINUX_DIR) \ - TOOLPREFIX=$(TARGET_CROSS) \ - KVER=$(LINUX_VERSION) \ - CFLAGS="$(TARGET_CFLAGS)" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - ARCH=$(LINUX_KARCH) - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) $(strip $(QCASSDK_CONFIG_OPTS)) -endef - -define Package/qca-ssdk-shell/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/bin/ssdk_sh $(1)/usr/sbin/ -endef - - -$(eval $(call BuildPackage,qca-ssdk-shell)) diff --git a/feeds/ipq807x/qca-ssdk-shell/src/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/Makefile deleted file mode 100755 index adcf87282..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -include ./config - -ifndef PRJ_PATH - PRJ_PATH=$(shell pwd) -endif -export PRJ_PATH - -include ./make/config.mk -include ./make/tools.mk -include ./make/$(OS)_opt.mk - -SUB_DIR=$(patsubst %/, %, $(dir $(wildcard src/*/Makefile))) -SUB_LIB=$(subst src/, , $(SUB_DIR)) - -all: $(BIN_DIR) uslib shell - @echo "---Build [SSDK_SH-$(VERSION)] at $(BUILD_DATE) finished." - -kslib:kslib_o - $(AR) -r $(BIN_DIR)/$(KS_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/KSLIB/*.o) - -kslib_o: - $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=KSLIB -C src/$i all || exit 1;) - -uslib:uslib_o - $(AR) -r $(BIN_DIR)/$(US_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/USLIB/*.o) - -uslib_o: - $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=USLIB -C src/$i all || exit 1;) - -shell:uslib shell_o - $(CP) $(BLD_DIR)/SHELL/$(SHELLOBJ) $(BIN_DIR)/$(SHELLOBJ) - $(STRIP) $(BIN_DIR)/$(SHELLOBJ) - -shell_o: - $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=SHELL -C src/$i all || exit 1;) - -$(BIN_DIR): - $(MKDIR) -p $@ - -release: - @cd make; ./release.sh $(VER) - -clean: - $(RM) -f $(BLD_DIR)/KSLIB/* - $(RM) -f $(BLD_DIR)/USLIB/* - $(RM) -f $(BLD_DIR)/SHELL/* - $(RM) -f $(BIN_DIR)/* diff --git a/feeds/ipq807x/qca-ssdk-shell/src/config b/feeds/ipq807x/qca-ssdk-shell/src/config deleted file mode 100755 index e2d4c4405..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/config +++ /dev/null @@ -1,153 +0,0 @@ -#CPU=mips - -OS=linux - -ifeq ($(KVER), 3.4.0) -OS_VER=3_4 -endif - -ifeq ($(KVER), 3.3.8) -OS_VER=3_2 -endif - -ifeq ($(ARCH), arm) -BOARD=ipq806x -endif - -ifeq ($(ARCH), mips) -BOARD=ar71xx -endif - -ifeq ($(BOARD), ar71xx) -BOARD_NAME=BOARD_AR71XX -endif - -ifeq ($(BOARD), ipq806x) -BOARD_NAME=BOARD_IPQ806X -endif - -OS_SUB=31 -CHIP_TYPE=ISISC - -ifndef OS_VER -OS_VER=2_6 -endif -# OS subversion, 2.6.31 for WASP (db120) -#OS_SUB=31 -# GCC version, 3 or 4 -#GCC_VER=4 - -#For MIPS Linux2.6 - #pb45 - #TOOL_PATH=/disk/pb45/sw/build/gcc-3.4.4-2.16.1/build_mips_nofpu/bin - #SYS_PATH=/disk/pb45/sw/linux/kernels/mips-linux-2.6.15 - - #ap81 -# compatiable with OpenWRT -ifndef TOOL_PATH -TOOL_PATH=/disk/ap81fus/sw/build/gcc-3.4.4-2.16.1/build_mips/bin -endif -ifndef SYS_PATH -SYS_PATH=/disk/ap81fus/sw/linux/kernels/mips-linux-2.6.15 -endif -ifeq ($(ARCH), mips) - CPU_CFLAG=-Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB -D$(BOARD_NAME) -endif - - -#db120 -ifeq ($(BOARD_TYPE),db12x) -OS_SUB=31 -GCC_VER=4 -TOOL_PATH=$(TOPDIR)/build/gcc-4.3.3/build_mips/staging_dir/usr/bin -SYS_PATH=$(TOPDIR)/linux/kernels/mips-linux-2.6.31 -CPU_CFLAG=-Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB -endif - -ifeq ($(ARCH), arm) - CPU_CFLAG=-D__LINUX_ARM_ARCH__=7 -DMODULE -fno-common -DCONFIG_MMU -D$(BOARD_NAME) -endif - -ifeq ($(BOARD_TYPE), ap136) -OS_SUB=31 -GCC_VER=4 -TOOL_PATH=$(TOPDIR)/build/gcc-4.3.3/build_mips/staging_dir/usr/bin -SYS_PATH=$(TOPDIR)/linux/kernels/mips-linux-2.6.31 -CPU_CFLAG=-Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB -endif - -#For MIPS Linux2.4 - #TOOL_PATH=/home/perforce/kernel2.4/5.3.1.20/tools/gcc-3.3.3-2.4.25/toolchain_mips/bin - #SYS_PATH=/home/perforce/kernel2.4/5.3.1.20/src/kernels/mips-linux-2.4.25 - - #TOOLPREFIX=$(CPU)-$(OS)- - #CPU_CFLAG=-Wstrict-prototypes -Wundef -fomit-frame-pointer -G 0 -mno-abicalls -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fno-pic -pipe -mabi=32 -march=r4600 -Wa,-32 -Wa,-march=r4600 -Wa,--trap -DMODULE -mlong-calls -DEXPORT_SYMTAB - - -KERNEL_MODE=TRUE -#compatiable with OpenWRT -ifeq ($(SWITCH_SSDK_MODE),user) -KERNEL_MODE=FLASE -endif - -#FAL=FALSE or not define FAL, FAL will not be included in SSDK -FAL=TRUE - -#CHIP_TYPE can be defined as ATHENA, GARUDA, SHIVA, HORUS, ISIS, ISISC and ALL_CHIP(ALL_CHIP means GARUDA, SHIVA, HORUS and ISIS) -CHIP_TYPE=ISISC - -#UK_IF=FALSE or not define UK_IF, UK_IF will not be included in SSDK -#when UK_IF=TRUE one of UK_NETLINK,UK_IOCTL must be defined as TRUE -UK_IF=TRUE -#UK_IOCTL=TRUE define user-kernel space communication based on ioctl -UK_IOCTL=TRUE -UK_MINOR_DEV=254 - -#API_LOCK=FALSE or not define API_LOCK, API_LOCK will not be included in SSDK -API_LOCK=FALSE - -#REG_ACCESS_SPEEDUP=FALSE or not define REG_ACCESS_SPEEDUP, REG_ACCESS_SPEEDUP will not be enabled, now only ISIS supports -REG_ACCESS_SPEEDUP=FALSE - -#ALL supported features: -#ACL FDB IGMP LEAKY LED MIB MIRROR MISC PORTCONTROL PORTVLAN QOS RATE STP VLAN -#IN_X=FALSE or not define IN_X, X will not be included in SSDK -IN_ACL=TRUE -IN_FDB=TRUE -IN_IGMP=TRUE -IN_LEAKY=TRUE -IN_LED=TRUE -IN_MIB=TRUE -IN_MIRROR=TRUE -IN_MISC=TRUE -IN_PORTCONTROL=TRUE -IN_PORTVLAN=TRUE -IN_QOS=TRUE -IN_RATE=TRUE -IN_STP=TRUE -IN_VLAN=TRUE -IN_REDUCED_ACL=FALSE -IN_COSMAP=TRUE -IN_IP=TRUE -IN_NAT=TRUE -IN_TRUNK=TRUE -IN_QM=TRUE -IN_FLOW=TRUE -IN_SEC=TRUE -ifeq ($(HNAT_FEATURE), enable) -IN_NAT_HELPER=TRUE -else -IN_NAT_HELPER=FALSE -endif -IN_INTERFACECONTROL=TRUE -IN_MACBLOCK=FALSE -IN_VSI=TRUE -IN_CTRLPKT=TRUE -IN_SERVCODE=TRUE -IN_RSS_HASH=TRUE -IN_PPPOE=TRUE -IN_BM=TRUE -IN_SHAPER=TRUE -IN_POLICER=TRUE -IN_PTP=TRUE -IN_SFP=TRUE diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/api/api_access.h b/feeds/ipq807x/qca-ssdk-shell/src/include/api/api_access.h deleted file mode 100755 index 806c24dea..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/api/api_access.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _API_ACCESS_H -#define _API_ACCESS_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - sw_api_func_t * - sw_api_func_find(a_uint32_t api_id); - - sw_api_param_t * - sw_api_param_find(a_uint32_t api_id); - - a_uint32_t - sw_api_param_nums(a_uint32_t api_id); - - sw_error_t - sw_api_get(sw_api_t *sw_api); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _API_ACCESS_H */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/api/api_desc.h b/feeds/ipq807x/qca-ssdk-shell/src/include/api/api_desc.h deleted file mode 100755 index 009d57502..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/api/api_desc.h +++ /dev/null @@ -1,4240 +0,0 @@ -/* - * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/*qca808x_start*/ -#ifndef _API_DESC_H_ -#define _API_DESC_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define SW_API_PT_DUPLEX_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_DUPLEX_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DUPLEX_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_DUPLEX_GET, SW_DUPLEX, sizeof(fal_port_duplex_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "duplex"), - -#define SW_API_PT_DUPLEX_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_DUPLEX_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DUPLEX_SET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_DUPLEX_SET, SW_DUPLEX, sizeof(fal_port_duplex_t), SW_PARAM_IN, \ - "duplex"), - -#define SW_API_PT_SPEED_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_SPEED_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_SPEED_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_SPEED_GET, SW_SPEED, sizeof(fal_port_speed_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "speed"), - -#define SW_API_PT_SPEED_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_SPEED_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_SPEED_SET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_SPEED_SET, SW_SPEED, sizeof(fal_port_speed_t), SW_PARAM_IN, \ - "speed"), - -#define SW_API_PT_AN_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_AN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_AN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_AN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "autoneg"), - - -#define SW_API_PT_AN_ENABLE_DESC \ - SW_PARAM_DEF(SW_API_PT_AN_ENABLE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_AN_ENABLE, SW_UINT32, 4, SW_PARAM_IN, "Port No."), - - -#define SW_API_PT_AN_RESTART_DESC \ - SW_PARAM_DEF(SW_API_PT_AN_RESTART, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_AN_RESTART, SW_UINT32, 4, SW_PARAM_IN, "Port No."), - -#define SW_API_PT_AN_ADV_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_AN_ADV_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_AN_ADV_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_AN_ADV_GET, SW_CAP, 4, SW_PARAM_PTR|SW_PARAM_OUT, "autoneg"), - -#define SW_API_PT_AN_ADV_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_AN_ADV_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_AN_ADV_SET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_AN_ADV_SET, SW_CAP, 4, SW_PARAM_IN, "autoneg"), -/*qca808x_end*/ - -#define SW_API_PT_HDR_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_HDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_HDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_HDR_SET, SW_ENABLE, 4, SW_PARAM_IN, "Header"), - -#define SW_API_PT_HDR_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_HDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_HDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_HDR_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Header"), - -#define SW_API_PT_FLOWCTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_SET, SW_ENABLE, 4, SW_PARAM_IN, "Flow control"), - -#define SW_API_PT_FLOWCTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Flow control"), - -#define SW_API_PT_FLOWCTRL_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Force mode"), - -#define SW_API_PT_FLOWCTRL_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FLOWCTRL_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Force mode"), - -#define SW_API_PT_POWERSAVE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_POWERSAVE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_POWERSAVE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_POWERSAVE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Powersave Status"), - -#define SW_API_PT_POWERSAVE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_POWERSAVE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_POWERSAVE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_POWERSAVE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Powersave Status"), -/*qca808x_start*/ -#define SW_API_PT_HIBERNATE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_HIBERNATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_HIBERNATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_HIBERNATE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Hibernate status"), - -#define SW_API_PT_HIBERNATE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_HIBERNATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_HIBERNATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_HIBERNATE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Hibernate Status"), - -#define SW_API_PT_CDT_DESC \ - SW_PARAM_DEF(SW_API_PT_CDT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_CDT, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_CDT, SW_UINT32, 4, SW_PARAM_IN, "MDI Pair ID"), \ - SW_PARAM_DEF(SW_API_PT_CDT, SW_CABLESTATUS, 4, SW_PARAM_PTR|SW_PARAM_OUT, "cable status"), \ - SW_PARAM_DEF(SW_API_PT_CDT, SW_CABLELEN, 4, SW_PARAM_PTR|SW_PARAM_OUT, "cable len"), -/*qca808x_end*/ -#define SW_API_PT_TXHDR_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_TXHDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_TXHDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_TXHDR_SET, SW_HDRMODE, sizeof(fal_port_header_mode_t), \ - SW_PARAM_IN, "HdrMode"), - -#define SW_API_PT_TXHDR_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_TXHDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_TXHDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_TXHDR_GET, SW_HDRMODE, sizeof(fal_port_header_mode_t), \ - SW_PARAM_PTR|SW_PARAM_OUT, "HdrMode"), - -#define SW_API_PT_RXHDR_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_RXHDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_RXHDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_RXHDR_SET, SW_HDRMODE, sizeof(fal_port_header_mode_t), \ - SW_PARAM_IN, "HdrMode"), - -#define SW_API_PT_RXHDR_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_RXHDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_RXHDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_RXHDR_GET, SW_HDRMODE, sizeof(fal_port_header_mode_t), \ - SW_PARAM_PTR|SW_PARAM_OUT, "HdrMode"), - -#define SW_API_HEADER_TYPE_SET_DESC \ - SW_PARAM_DEF(SW_API_HEADER_TYPE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_HEADER_TYPE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), \ - SW_PARAM_DEF(SW_API_HEADER_TYPE_SET, SW_UINT32, 4, SW_PARAM_IN, "Value"), - -#define SW_API_HEADER_TYPE_GET_DESC \ - SW_PARAM_DEF(SW_API_HEADER_TYPE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_HEADER_TYPE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), \ - SW_PARAM_DEF(SW_API_HEADER_TYPE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Value"), - -#define SW_API_TXMAC_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_TXMAC_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TXMAC_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_TXMAC_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Value"), - -#define SW_API_TXMAC_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_TXMAC_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TXMAC_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_TXMAC_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Value"), - -#define SW_API_RXMAC_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_RXMAC_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RXMAC_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_RXMAC_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Value"), - -#define SW_API_RXMAC_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_RXMAC_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RXMAC_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_RXMAC_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Value"), - -#define SW_API_TXFC_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_TXFC_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TXFC_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_TXFC_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Value"), - -#define SW_API_TXFC_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_TXFC_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TXFC_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_TXFC_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Value"), - -#define SW_API_RXFC_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_RXFC_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RXFC_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_RXFC_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Value"), - -#define SW_API_RXFC_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_RXFC_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RXFC_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_RXFC_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Value"), - -#define SW_API_BP_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_BP_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BP_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_BP_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Value"), - -#define SW_API_BP_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_BP_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BP_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_BP_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Value"), - -#define SW_API_PT_LINK_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_LINK_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_LINK_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_LINK_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Value"), - -#define SW_API_PT_LINK_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_LINK_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_LINK_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_LINK_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Value"), -/*qca808x_start*/ -#define SW_API_PT_LINK_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_LINK_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_LINK_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_LINK_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), -/*qca808x_end*/ -#define SW_API_PT_MAC_LOOPBACK_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_MAC_LOOPBACK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MAC_LOOPBACK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MAC_LOOPBACK_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_PT_MAC_LOOPBACK_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MAC_LOOPBACK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MAC_LOOPBACK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MAC_LOOPBACK_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_PT_CONGESTION_DROP_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_CONGESTION_DROP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_CONGESTION_DROP_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_CONGESTION_DROP_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"), \ - SW_PARAM_DEF(SW_API_PT_CONGESTION_DROP_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_PT_CONGESTION_DROP_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_CONGESTION_DROP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_CONGESTION_DROP_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_CONGESTION_DROP_GET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"), \ - SW_PARAM_DEF(SW_API_PT_CONGESTION_DROP_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_PT_RING_FLOW_CTRL_THRES_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_SET, SW_UINT32, 4, SW_PARAM_IN, "Ring ID"), \ - SW_PARAM_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_SET, SW_UINT8, 1, SW_PARAM_IN, "On Thres"), \ - SW_PARAM_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_SET, SW_UINT8, 1, SW_PARAM_IN, "Off Thres"), - -#define SW_API_PT_RING_FLOW_CTRL_THRES_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_GET, SW_UINT32, 4, SW_PARAM_IN, "Ring ID"), \ - SW_PARAM_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "On Thres"), \ - SW_PARAM_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "Off Thres"), - -#define SW_API_PTS_LINK_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PTS_LINK_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTS_LINK_STATUS_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), -/*qca808x_start*/ -#define SW_API_PT_8023AZ_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_8023AZ_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_8023AZ_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_8023AZ_SET, SW_ENABLE, 4, SW_PARAM_IN, "8023az Status"), - -#define SW_API_PT_8023AZ_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_8023AZ_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_8023AZ_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_8023AZ_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "8023az Status"), - -#define SW_API_PT_MDIX_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_MDIX_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MDIX_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MDIX_SET, SW_CROSSOVER_MODE, sizeof(fal_port_mdix_mode_t), SW_PARAM_IN, "Crossover Mode"), - - -#define SW_API_PT_MDIX_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MDIX_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MDIX_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MDIX_GET, SW_CROSSOVER_MODE, sizeof(fal_port_mdix_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Crossover Mode"), - -#define SW_API_PT_MDIX_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MDIX_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MDIX_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MDIX_STATUS_GET, SW_CROSSOVER_STATUS, sizeof(fal_port_mdix_status_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Crossover Status"), -/*qca808x_end*/ - -#define SW_API_PT_COMBO_PREFER_MEDIUM_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_SET, SW_PREFER_MEDIUM, sizeof(fal_port_medium_t), SW_PARAM_IN, "Prefer Medium"), - - -#define SW_API_PT_COMBO_PREFER_MEDIUM_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_GET, SW_PREFER_MEDIUM, sizeof(fal_port_medium_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Prefer Medium"), - -#define SW_API_PT_COMBO_MEDIUM_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_COMBO_MEDIUM_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_MEDIUM_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_MEDIUM_STATUS_GET, SW_PREFER_MEDIUM, sizeof(fal_port_medium_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Medium Type"), - -#define SW_API_PT_COMBO_FIBER_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_COMBO_FIBER_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_FIBER_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_FIBER_MODE_SET, SW_FIBER_MODE, sizeof(fal_port_fiber_mode_t), SW_PARAM_IN, "Fbier Mode"), - - -#define SW_API_PT_COMBO_FIBER_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_COMBO_FIBER_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_FIBER_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_COMBO_FIBER_MODE_GET, SW_FIBER_MODE, sizeof(fal_port_fiber_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Fiber Mode"), -/*qca808x_start*/ -#define SW_API_PT_LOCAL_LOOPBACK_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_LOCAL_LOOPBACK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_LOCAL_LOOPBACK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_LOCAL_LOOPBACK_SET, SW_ENABLE, 4, SW_PARAM_IN, "Local Loopback Status"), - -#define SW_API_PT_LOCAL_LOOPBACK_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_LOCAL_LOOPBACK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_LOCAL_LOOPBACK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_LOCAL_LOOPBACK_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Local Loopback Status"), - -#define SW_API_PT_REMOTE_LOOPBACK_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_REMOTE_LOOPBACK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_REMOTE_LOOPBACK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_REMOTE_LOOPBACK_SET, SW_ENABLE, 4, SW_PARAM_IN, "Remote Loopback Status"), - -#define SW_API_PT_REMOTE_LOOPBACK_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_REMOTE_LOOPBACK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_REMOTE_LOOPBACK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_REMOTE_LOOPBACK_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Remote Loopback Status"), - -#define SW_API_PT_RESET_DESC \ - SW_PARAM_DEF(SW_API_PT_RESET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_RESET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_PT_POWER_OFF_DESC \ - SW_PARAM_DEF(SW_API_PT_POWER_OFF, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_POWER_OFF, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_PT_POWER_ON_DESC \ - SW_PARAM_DEF(SW_API_PT_POWER_ON, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_POWER_ON, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_PT_MAGIC_FRAME_MAC_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_SET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "[Magic mac]"), - -#define SW_API_PT_MAGIC_FRAME_MAC_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_GET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "[Magic mac]"), - -#define SW_API_PT_PHY_ID_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT16, 2, SW_PARAM_PTR|SW_PARAM_OUT, "Org ID"), \ - SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT16, 2, SW_PARAM_PTR|SW_PARAM_OUT, "Rev ID"), - -#define SW_API_PT_WOL_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_WOL_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_WOL_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_WOL_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Wol Status"), - -#define SW_API_PT_WOL_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_WOL_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_WOL_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_WOL_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Wol Status"), -/*qca808x_end*/ -#define SW_API_PT_INTERFACE_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_SET, SW_INTERFACE_MODE, sizeof(fal_port_interface_mode_t), SW_PARAM_IN, "Interface Mode"), - - -#define SW_API_PT_INTERFACE_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_GET, SW_INTERFACE_MODE, sizeof(fal_port_interface_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Interface Mode"), - -#define SW_API_PT_INTERFACE_MODE_APPLY_DESC \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_APPLY, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), -/*qca808x_start*/ -#define SW_API_PT_INTERFACE_MODE_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_MODE_STATUS_GET, SW_INTERFACE_MODE, sizeof(fal_port_interface_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Interface Status"), - -#define SW_API_DEBUG_PHYCOUNTER_SET_DESC \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_SET, SW_ENABLE, 4, SW_PARAM_IN, "Counter Status"), - -#define SW_API_DEBUG_PHYCOUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Counter Status"), - -#define SW_API_DEBUG_PHYCOUNTER_SHOW_DESC \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_SHOW, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_SHOW, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PHYCOUNTER_SHOW, SW_COUNTER_INFO, sizeof(fal_port_counter_info_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Phy Counter Statistics On port"), -/*qca808x_end*/ -#define SW_API_PT_MTU_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_MTU_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MTU_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MTU_SET, SW_MTU_ENTRY, sizeof(fal_mtu_ctrl_t), SW_PARAM_PTR|SW_PARAM_IN, "Port MTU"), - -#define SW_API_PT_MTU_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MTU_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MTU_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MTU_GET, SW_MTU_INFO, sizeof(fal_mtu_ctrl_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Port MTU"), - -#define SW_API_PT_MRU_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_MRU_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MRU_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MRU_SET, SW_MRU_ENTRY, sizeof(fal_mru_ctrl_t), SW_PARAM_PTR|SW_PARAM_IN, "Port MRU"), - -#define SW_API_PT_MRU_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MRU_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MRU_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MRU_GET, SW_MRU_INFO, sizeof(fal_mru_ctrl_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Port MRU"), - -#define SW_API_PT_SOURCE_FILTER_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_PT_SOURCE_FILTER_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_PT_FRAME_MAX_SIZE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_FRAME_MAX_SIZE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FRAME_MAX_SIZE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FRAME_MAX_SIZE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Frame Max Size"), - -#define SW_API_PT_FRAME_MAX_SIZE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_FRAME_MAX_SIZE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FRAME_MAX_SIZE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FRAME_MAX_SIZE_SET, SW_UINT32, 4, SW_PARAM_IN, "Frame Max Size"), - -#define SW_API_PT_INTERFACE_3AZ_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_SET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_IN, "Status"), - -#define SW_API_PT_INTERFACE_3AZ_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_PT_PROMISC_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_PT_PROMISC_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_PROMISC_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_PT_INTERFACE_EEE_CFG_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_EEE_CFG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_EEE_CFG_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_EEE_CFG_SET, SW_PORT_EEE_CONFIG, \ - sizeof(fal_port_eee_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "EEE"), - -#define SW_API_PT_INTERFACE_EEE_CFG_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_EEE_CFG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_EEE_CFG_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_INTERFACE_EEE_CFG_GET, SW_PORT_EEE_CONFIG,\ - sizeof(fal_port_eee_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "EEE"), - -#define SW_API_PT_SOURCE_FILTER_CONFIG_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_CONFIG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_CONFIG_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_CONFIG_GET, SW_SRC_FILTER_CONFIG, \ - sizeof(fal_src_filter_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "srcfilter config"), - -#define SW_API_PT_SOURCE_FILTER_CONFIG_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_SOURCE_FILTER_CONFIG_SET, SW_SRC_FILTER_CONFIG, \ - sizeof(fal_src_filter_config_t), SW_PARAM_PTR|SW_PARAM_IN, "srcfilter config"), - -#define SW_API_PT_SWITCH_PORT_LOOPBACK_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_SWITCH_PORT_LOOPBACK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_SWITCH_PORT_LOOPBACK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_SWITCH_PORT_LOOPBACK_SET, SW_PORT_LOOPBACK_CONFIG, \ - sizeof(fal_loopback_config_t), SW_PARAM_PTR|SW_PARAM_IN, "LOOPBACK"), - -#define SW_API_PT_SWITCH_PORT_LOOPBACK_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_SWITCH_PORT_LOOPBACK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_SWITCH_PORT_LOOPBACK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_SWITCH_PORT_LOOPBACK_GET, SW_PORT_LOOPBACK_CONFIG,\ - sizeof(fal_loopback_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "LOOPBACK"), - -#define SW_API_VLAN_ADD_DESC \ - SW_PARAM_DEF(SW_API_VLAN_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_ADD, SW_UINT32, 4, SW_PARAM_IN, "Vlan Id"), - -#define SW_API_VLAN_DEL_DESC \ - SW_PARAM_DEF(SW_API_VLAN_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_DEL, SW_UINT32, 4, SW_PARAM_IN, "Vlan Id"), - -#define SW_API_VLAN_MEM_UPDATE_DESC \ - SW_PARAM_DEF(SW_API_VLAN_MEM_UPDATE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_MEM_UPDATE, SW_UINT32, 4, SW_PARAM_IN, "Vlan Id"), \ - SW_PARAM_DEF(SW_API_VLAN_MEM_UPDATE, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_IN, \ - "Member Port Map"), \ - SW_PARAM_DEF(SW_API_VLAN_MEM_UPDATE, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_IN, \ - "U Member Port Map"), - -#define SW_API_VLAN_FIND_DESC \ - SW_PARAM_DEF(SW_API_VLAN_FIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_FIND, SW_UINT32, 4, SW_PARAM_IN, "Vlan Id"), \ - SW_PARAM_DEF(SW_API_VLAN_FIND, SW_VLAN, sizeof(fal_vlan_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Vlan Entry"), - -#define SW_API_VLAN_NEXT_DESC \ - SW_PARAM_DEF(SW_API_VLAN_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Vlan Id"), \ - SW_PARAM_DEF(SW_API_VLAN_NEXT, SW_VLAN, sizeof(fal_vlan_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Vlan Entry"), - -#define SW_API_VLAN_APPEND_DESC \ - SW_PARAM_DEF(SW_API_VLAN_APPEND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_APPEND, SW_VLAN, sizeof(fal_vlan_t), SW_PARAM_PTR|SW_PARAM_IN, "Vlan Entry"), - -#define SW_API_VLAN_FLUSH_DESC \ - SW_PARAM_DEF(SW_API_VLAN_FLUSH, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), - -#define SW_API_VLAN_FID_SET_DESC \ - SW_PARAM_DEF(SW_API_VLAN_FID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_FID_SET, SW_UINT32, 4, SW_PARAM_IN, "Vlan ID"), \ - SW_PARAM_DEF(SW_API_VLAN_FID_SET, SW_UINT32, 4, SW_PARAM_IN, "FDB ID"), - -#define SW_API_VLAN_FID_GET_DESC \ - SW_PARAM_DEF(SW_API_VLAN_FID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_FID_GET, SW_UINT32, 4, SW_PARAM_IN, "Vlan ID"), \ - SW_PARAM_DEF(SW_API_VLAN_FID_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "FDB ID"), - -#define SW_API_VLAN_MEMBER_ADD_DESC \ - SW_PARAM_DEF(SW_API_VLAN_MEMBER_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_MEMBER_ADD, SW_UINT32, 4, SW_PARAM_IN, "Vlan ID"), \ - SW_PARAM_DEF(SW_API_VLAN_MEMBER_ADD, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_VLAN_MEMBER_ADD, SW_EGMODE, sizeof(fal_pt_1q_egmode_t), \ - SW_PARAM_IN, "Port Info"), - -#define SW_API_VLAN_MEMBER_DEL_DESC \ - SW_PARAM_DEF(SW_API_VLAN_MEMBER_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_MEMBER_DEL, SW_UINT32, 4, SW_PARAM_IN, "Vlan ID"), \ - SW_PARAM_DEF(SW_API_VLAN_MEMBER_DEL, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_VLAN_LEARN_STATE_SET_DESC \ - SW_PARAM_DEF(SW_API_VLAN_LEARN_STATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_LEARN_STATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Vlan ID"), \ - SW_PARAM_DEF(SW_API_VLAN_LEARN_STATE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_VLAN_LEARN_STATE_GET_DESC \ - SW_PARAM_DEF(SW_API_VLAN_LEARN_STATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VLAN_LEARN_STATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Vlan ID"), \ - SW_PARAM_DEF(SW_API_VLAN_LEARN_STATE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_LAN_WAN_CFG_SET_DESC \ - SW_PARAM_DEF(SW_API_LAN_WAN_CFG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_LAN_WAN_CFG_SET, SW_LAN_WAN_CFG, sizeof(qca_lan_wan_cfg_t), \ - SW_PARAM_PTR|SW_PARAM_IN, "Vlan Lan Wan Configuration"), - -#define SW_API_LAN_WAN_CFG_GET_DESC \ - SW_PARAM_DEF(SW_API_LAN_WAN_CFG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_LAN_WAN_CFG_GET, SW_LAN_WAN_CFG, sizeof(qca_lan_wan_cfg_t), \ - SW_PARAM_PTR|SW_PARAM_OUT, "Vlan Lan Wan Configuration"), - -#define SW_API_PT_ING_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_ING_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_ING_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_ING_MODE_GET, SW_1QMODE, sizeof(fal_pt_1qmode_t), \ - SW_PARAM_PTR|SW_PARAM_OUT, "1qmode"), - -#define SW_API_PT_ING_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_ING_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_ING_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_ING_MODE_SET, SW_1QMODE, sizeof(fal_pt_1qmode_t), \ - SW_PARAM_IN, "1qmode"), - -#define SW_API_PT_EG_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_EG_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_EG_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_EG_MODE_GET, SW_EGMODE, sizeof(fal_pt_1q_egmode_t),\ - SW_PARAM_PTR|SW_PARAM_OUT, "egvlan"), - -#define SW_API_PT_EG_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_EG_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_EG_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_EG_MODE_SET, SW_EGMODE, sizeof(fal_pt_1q_egmode_t), \ - SW_PARAM_IN, "egvlan"), - -#define SW_API_PT_VLAN_MEM_ADD_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_ADD, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_ADD, SW_UINT32, 4, SW_PARAM_IN, "Member Port Id"), - -#define SW_API_PT_VLAN_MEM_DEL_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_DEL, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_DEL, SW_UINT32, 4, SW_PARAM_IN, "Member Port Id"), - -#define SW_API_PT_VLAN_MEM_UPDATE_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_UPDATE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_UPDATE, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_UPDATE, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_IN, \ - "Member Port Bitmap"), - -#define SW_API_PT_VLAN_MEM_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_VLAN_MEM_GET, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Member Port Bitmap"), - -#define SW_API_PT_DEF_VID_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_DEF_VID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_VID_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID."), \ - SW_PARAM_DEF(SW_API_PT_DEF_VID_SET, SW_UINT32, 4, SW_PARAM_IN, "Vlan Id"), - -#define SW_API_PT_DEF_VID_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_DEF_VID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_VID_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID."), \ - SW_PARAM_DEF(SW_API_PT_DEF_VID_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Vlan Id"), - -#define SW_API_PT_FORCE_DEF_VID_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_FORCE_DEF_VID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FORCE_DEF_VID_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FORCE_DEF_VID_SET, SW_ENABLE, 4, SW_PARAM_IN, "Force"), - -#define SW_API_PT_FORCE_DEF_VID_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_FORCE_DEF_VID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FORCE_DEF_VID_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FORCE_DEF_VID_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Force"), - -#define SW_API_PT_FORCE_PORTVLAN_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_FORCE_PORTVLAN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FORCE_PORTVLAN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FORCE_PORTVLAN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Force"), - -#define SW_API_PT_FORCE_PORTVLAN_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_FORCE_PORTVLAN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FORCE_PORTVLAN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_FORCE_PORTVLAN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Force"), - -#define SW_API_PT_NESTVLAN_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_NESTVLAN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_NESTVLAN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_NESTVLAN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Nestvlan"), - -#define SW_API_PT_NESTVLAN_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_NESTVLAN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_NESTVLAN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_NESTVLAN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Nestvlan"), - -#define SW_API_NESTVLAN_TPID_SET_DESC \ - SW_PARAM_DEF(SW_API_NESTVLAN_TPID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NESTVLAN_TPID_SET, SW_UINT32, 4, SW_PARAM_IN, "TPID"), - -#define SW_API_NESTVLAN_TPID_GET_DESC \ - SW_PARAM_DEF(SW_API_NESTVLAN_TPID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NESTVLAN_TPID_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "TPID"), - -#define SW_API_PT_IN_VLAN_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_IN_VLAN_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_IN_VLAN_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_IN_VLAN_MODE_SET, SW_INVLAN, sizeof(fal_pt_invlan_mode_t), SW_PARAM_IN, "Invlan"), - -#define SW_API_PT_IN_VLAN_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_IN_VLAN_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_IN_VLAN_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_IN_VLAN_MODE_GET, SW_INVLAN, sizeof(fal_pt_invlan_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "Invlan"), - -#define SW_API_PT_TLS_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_TLS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_TLS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_TLS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_PT_TLS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_TLS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_TLS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_TLS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_PT_PRI_PROPAGATION_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_PRI_PROPAGATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_PRI_PROPAGATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_PRI_PROPAGATION_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_PT_PRI_PROPAGATION_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_PRI_PROPAGATION_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_PRI_PROPAGATION_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_PRI_PROPAGATION_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_PT_DEF_SVID_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_DEF_SVID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_SVID_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_SVID_SET, SW_UINT32, 4, SW_PARAM_IN, "svid"), - -#define SW_API_PT_DEF_SVID_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_DEF_SVID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_SVID_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_SVID_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "svid"), - -#define SW_API_PT_DEF_CVID_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_DEF_CVID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_CVID_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_CVID_SET, SW_UINT32, 4, SW_PARAM_IN, "cvid"), - -#define SW_API_PT_DEF_CVID_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_DEF_CVID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_CVID_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_DEF_CVID_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "cvid"), - -#define SW_API_PT_VLAN_PROPAGATION_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_PROPAGATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_PROPAGATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_PROPAGATION_SET, SW_VLANPROPAGATION, sizeof(fal_vlan_propagation_mode_t), SW_PARAM_IN, "Vlan propagation"), - -#define SW_API_PT_VLAN_PROPAGATION_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_PROPAGATION_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_PROPAGATION_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_PROPAGATION_GET, SW_VLANPROPAGATION, sizeof(fal_vlan_propagation_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "Vlan propagation"), - -#define SW_API_PT_VLAN_TRANS_ADD_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADD, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADD, SW_VLANTRANSLATION, sizeof(fal_vlan_trans_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Vlan Translation"), - -#define SW_API_PT_VLAN_TRANS_DEL_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_DEL, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_DEL, SW_VLANTRANSLATION, sizeof(fal_vlan_trans_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Vlan Translation"), - -#define SW_API_PT_VLAN_TRANS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_GET, SW_VLANTRANSLATION, sizeof(fal_vlan_trans_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Vlan Translation"), - -#define SW_API_QINQ_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_QINQ_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QINQ_MODE_SET, SW_QINQMODE, sizeof(fal_qinq_mode_t), SW_PARAM_IN, "qinq mode"), - -#define SW_API_QINQ_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_QINQ_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QINQ_MODE_GET, SW_QINQMODE, sizeof(fal_qinq_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "qinq mode"), - -#define SW_API_PT_QINQ_ROLE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_QINQ_ROLE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_QINQ_ROLE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_QINQ_ROLE_SET, SW_QINQROLE, sizeof(fal_qinq_port_role_t), SW_PARAM_IN, "qinq role"), - -#define SW_API_PT_QINQ_ROLE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_QINQ_ROLE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_QINQ_ROLE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_QINQ_ROLE_GET, SW_QINQROLE, sizeof(fal_qinq_port_role_t), SW_PARAM_PTR|SW_PARAM_OUT, "qinq role"), - -#define SW_API_PT_VLAN_TRANS_ITERATE_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ITERATE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ITERATE, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ITERATE, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Iterator"),\ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ITERATE, SW_VLANTRANSLATION, sizeof(fal_vlan_trans_entry_t), SW_PARAM_PTR|SW_PARAM_OUT, "Vlan Translation"), - -#define SW_API_PT_MAC_VLAN_XLT_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_MAC_VLAN_XLT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MAC_VLAN_XLT_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MAC_VLAN_XLT_SET, SW_ENABLE, 4, SW_PARAM_IN, "Status"), - -#define SW_API_PT_MAC_VLAN_XLT_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MAC_VLAN_XLT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MAC_VLAN_XLT_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MAC_VLAN_XLT_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_NETISOLATE_SET_DESC \ - SW_PARAM_DEF(SW_API_NETISOLATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NETISOLATE_SET, SW_ENABLE, 4, SW_PARAM_IN, "enable"), - -#define SW_API_NETISOLATE_GET_DESC \ - SW_PARAM_DEF(SW_API_NETISOLATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NETISOLATE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "enable"), - -#define SW_API_EG_FLTR_BYPASS_EN_SET_DESC \ - SW_PARAM_DEF(SW_API_EG_FLTR_BYPASS_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_EG_FLTR_BYPASS_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "enable"), - -#define SW_API_EG_FLTR_BYPASS_EN_GET_DESC \ - SW_PARAM_DEF(SW_API_EG_FLTR_BYPASS_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_EG_FLTR_BYPASS_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "enable"), - -#define SW_API_PT_VRF_ID_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_VRF_ID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VRF_ID_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VRF_ID_SET, SW_UINT32, 4, SW_PARAM_IN, "vrf_id"), - -#define SW_API_PT_VRF_ID_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_VRF_ID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VRF_ID_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VRF_ID_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "vrf_id"), - -#define SW_API_GLOBAL_QINQ_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_GLOBAL_QINQ_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_GLOBAL_QINQ_MODE_SET, SW_GLOBAL_QINQMODE, sizeof(fal_global_qinq_mode_t), SW_PARAM_PTR|SW_PARAM_IN, "global qinq mode"), - -#define SW_API_GLOBAL_QINQ_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_GLOBAL_QINQ_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_GLOBAL_QINQ_MODE_GET, SW_GLOBAL_QINQMODE, sizeof(fal_global_qinq_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "global qinq mode"), - -#define SW_API_PORT_QINQ_MODE_SET_DESC \ - SW_PARAM_DEF( SW_API_PORT_QINQ_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF( SW_API_PORT_QINQ_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF( SW_API_PORT_QINQ_MODE_SET, SW_PT_QINQMODE, sizeof(fal_port_qinq_role_t), SW_PARAM_PTR|SW_PARAM_IN, "port qinq mode"), - -#define SW_API_PORT_QINQ_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PORT_QINQ_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_QINQ_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_QINQ_MODE_GET, SW_PT_QINQMODE, sizeof(fal_port_qinq_role_t), SW_PARAM_PTR|SW_PARAM_OUT, "port qinq mode"), - -#define SW_API_TPID_SET_DESC \ - SW_PARAM_DEF(SW_API_TPID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TPID_SET, SW_TPID, sizeof(fal_tpid_t), SW_PARAM_PTR|SW_PARAM_IN, "ingress tpid"), - -#define SW_API_TPID_GET_DESC \ - SW_PARAM_DEF(SW_API_TPID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TPID_GET, SW_TPID, sizeof(fal_tpid_t), SW_PARAM_PTR|SW_PARAM_OUT, "ingress tpid"), - -#define SW_API_EGRESS_TPID_SET_DESC \ - SW_PARAM_DEF(SW_API_EGRESS_TPID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_EGRESS_TPID_SET, SW_TPID, sizeof(fal_tpid_t), SW_PARAM_PTR|SW_PARAM_IN, "egress tpid"), - -#define SW_API_EGRESS_TPID_GET_DESC \ - SW_PARAM_DEF(SW_API_EGRESS_TPID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_EGRESS_TPID_GET, SW_TPID, sizeof(fal_tpid_t), SW_PARAM_PTR|SW_PARAM_OUT, "egress tpid"), - -#define SW_API_PT_INGRESS_VLAN_FILTER_SET_DESC \ - SW_PARAM_DEF( SW_API_PT_INGRESS_VLAN_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF( SW_API_PT_INGRESS_VLAN_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF( SW_API_PT_INGRESS_VLAN_FILTER_SET, SW_INGRESS_FILTER, sizeof(fal_ingress_vlan_filter_t), SW_PARAM_PTR|SW_PARAM_IN, "ingress filter mode"), - -#define SW_API_PT_INGRESS_VLAN_FILTER_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_INGRESS_VLAN_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_INGRESS_VLAN_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_INGRESS_VLAN_FILTER_GET, SW_INGRESS_FILTER, sizeof(fal_ingress_vlan_filter_t), SW_PARAM_PTR|SW_PARAM_OUT, "ingress filter mode"), - -#define SW_API_PT_DEFAULT_VLANTAG_SET_DESC \ - SW_PARAM_DEF( SW_API_PT_DEFAULT_VLANTAG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF( SW_API_PT_DEFAULT_VLANTAG_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF( SW_API_PT_DEFAULT_VLANTAG_SET, SW_PT_VLAN_DIRECTION, sizeof(fal_port_vlan_direction_t), SW_PARAM_IN, "vlan direction"), \ - SW_PARAM_DEF( SW_API_PT_DEFAULT_VLANTAG_SET, SW_PT_DEF_VID_EN, sizeof(fal_port_default_vid_enable_t), SW_PARAM_PTR|SW_PARAM_IN, "default vid en"), \ - SW_PARAM_DEF( SW_API_PT_DEFAULT_VLANTAG_SET, SW_PT_VLAN_TAG, sizeof(fal_port_vlan_tag_t), SW_PARAM_PTR|SW_PARAM_IN, "vlan tag"), - -#define SW_API_PT_DEFAULT_VLANTAG_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_DEFAULT_VLANTAG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DEFAULT_VLANTAG_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_DEFAULT_VLANTAG_GET, SW_PT_VLAN_DIRECTION, sizeof(fal_port_vlan_direction_t), SW_PARAM_IN, "vlan direction"), \ - SW_PARAM_DEF(SW_API_PT_DEFAULT_VLANTAG_GET, SW_PT_DEF_VID_EN, sizeof(fal_port_default_vid_enable_t), SW_PARAM_PTR|SW_PARAM_OUT, "default vid en"), \ - SW_PARAM_DEF(SW_API_PT_DEFAULT_VLANTAG_GET, SW_PT_VLAN_TAG, sizeof(fal_port_vlan_tag_t), SW_PARAM_PTR|SW_PARAM_OUT, "vlan tag"), - -#define SW_API_PT_TAG_PROPAGATION_SET_DESC \ - SW_PARAM_DEF( SW_API_PT_TAG_PROPAGATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF( SW_API_PT_TAG_PROPAGATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF( SW_API_PT_TAG_PROPAGATION_SET, SW_PT_VLAN_DIRECTION, sizeof(fal_port_vlan_direction_t), SW_PARAM_IN, "vlan direction"), \ - SW_PARAM_DEF( SW_API_PT_TAG_PROPAGATION_SET, SW_TAG_PROPAGATION, sizeof(fal_vlantag_propagation_t), SW_PARAM_PTR|SW_PARAM_IN, "tag propagation"), - -#define SW_API_PT_TAG_PROPAGATION_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_TAG_PROPAGATION_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_TAG_PROPAGATION_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_TAG_PROPAGATION_GET, SW_PT_VLAN_DIRECTION, sizeof(fal_port_vlan_direction_t), SW_PARAM_IN, "vlan direction"), \ - SW_PARAM_DEF(SW_API_PT_TAG_PROPAGATION_GET, SW_TAG_PROPAGATION, sizeof(fal_vlantag_propagation_t), SW_PARAM_PTR|SW_PARAM_OUT, "tag propagation"), - -#define SW_API_PT_VLANTAG_EGMODE_SET_DESC \ - SW_PARAM_DEF( SW_API_PT_VLANTAG_EGMODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF( SW_API_PT_VLANTAG_EGMODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF( SW_API_PT_VLANTAG_EGMODE_SET, SW_EGRESS_MODE, sizeof(fal_vlantag_egress_mode_t), SW_PARAM_PTR|SW_PARAM_IN, "egress mode"), - -#define SW_API_PT_VLANTAG_EGMODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_EGMODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_EGMODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_EGMODE_GET, SW_EGRESS_MODE, sizeof(fal_vlantag_egress_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "egress mode"), - -#define SW_API_PT_VLAN_XLT_MISS_CMD_SET_DESC \ - SW_PARAM_DEF( SW_API_PT_VLAN_XLT_MISS_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF( SW_API_PT_VLAN_XLT_MISS_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF( SW_API_PT_VLAN_XLT_MISS_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "translation_miss_action"), - -#define SW_API_PT_VLAN_XLT_MISS_CMD_GET_DESC \ - SW_PARAM_DEF( SW_API_PT_VLAN_XLT_MISS_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF( SW_API_PT_VLAN_XLT_MISS_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF( SW_API_PT_VLAN_XLT_MISS_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "translation_miss_action"), - -#define SW_API_PT_VSI_EGMODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_VSI_EGMODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VSI_EGMODE_SET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_PT_VSI_EGMODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VSI_EGMODE_SET, SW_EGMODE, sizeof(fal_pt_1q_egmode_t), SW_PARAM_IN, "vsi_egress_vlan_mode"), - -#define SW_API_PT_VSI_EGMODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_VSI_EGMODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VSI_EGMODE_GET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_PT_VSI_EGMODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VSI_EGMODE_GET, SW_EGMODE, sizeof(fal_pt_1q_egmode_t), SW_PARAM_PTR|SW_PARAM_OUT, "vsi_egress_vlan_mode"), - -#define SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "vsi_egress_vlan_mode_en"), - -#define SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "vsi_egress_vlan_mode_en"), - -#define SW_API_PT_VLAN_TRANS_ADV_ADD_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_ADD, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_ADD, SW_PT_VLAN_DIRECTION, sizeof(fal_port_vlan_direction_t), SW_PARAM_IN, "vlan direction"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_ADD, SW_PT_VLAN_TRANS_ADV_RULE, sizeof(fal_vlan_trans_adv_rule_t), SW_PARAM_PTR|SW_PARAM_IN, "vlan trans rule"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_ADD, SW_PT_VLAN_TRANS_ADV_ACTION, sizeof(fal_vlan_trans_adv_action_t), SW_PARAM_PTR|SW_PARAM_IN, "vlan trans action"), - -#define SW_API_PT_VLAN_TRANS_ADV_DEL_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_DEL, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_DEL, SW_PT_VLAN_DIRECTION, sizeof(fal_port_vlan_direction_t), SW_PARAM_IN, "vlan direction"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_DEL, SW_PT_VLAN_TRANS_ADV_RULE, sizeof(fal_vlan_trans_adv_rule_t), SW_PARAM_PTR|SW_PARAM_IN, "vlan trans rule"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_DEL, SW_PT_VLAN_TRANS_ADV_ACTION, sizeof(fal_vlan_trans_adv_action_t), SW_PARAM_PTR|SW_PARAM_IN, "vlan trans action"), - -#define SW_API_PT_VLAN_TRANS_ADV_GETFIRST_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETFIRST, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETFIRST, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETFIRST, SW_PT_VLAN_DIRECTION, sizeof(fal_port_vlan_direction_t), SW_PARAM_IN, "vlan direction"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETFIRST, SW_PT_VLAN_TRANS_ADV_RULE, sizeof(fal_vlan_trans_adv_rule_t), SW_PARAM_PTR|SW_PARAM_OUT, "vlan trans rule"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETFIRST, SW_PT_VLAN_TRANS_ADV_ACTION, sizeof(fal_vlan_trans_adv_action_t), SW_PARAM_PTR|SW_PARAM_OUT, "vlan trans action"), - -#define SW_API_PT_VLAN_TRANS_ADV_GETNEXT_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETNEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETNEXT, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETNEXT, SW_PT_VLAN_DIRECTION, sizeof(fal_port_vlan_direction_t), SW_PARAM_IN, "vlan direction"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETNEXT, SW_PT_VLAN_TRANS_ADV_RULE, sizeof(fal_vlan_trans_adv_rule_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "vlan trans rule"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_TRANS_ADV_GETNEXT, SW_PT_VLAN_TRANS_ADV_ACTION, sizeof(fal_vlan_trans_adv_action_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "vlan trans action"), - -#define SW_API_PT_VLAN_COUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Cnt Index"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_COUNTER_GET, SW_PT_VLAN_COUNTER, sizeof(fal_port_vlan_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, "enable"), - -#define SW_API_PT_VLAN_COUNTER_CLEANUP_DESC \ - SW_PARAM_DEF(SW_API_PT_VLAN_COUNTER_CLEANUP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_VLAN_COUNTER_CLEANUP, SW_UINT32, 4, SW_PARAM_IN, "Cnt Index"), - -#define SW_API_FDB_ADD_DESC \ - SW_PARAM_DEF(SW_API_FDB_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_ADD, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Fdb Entry"), - -#define SW_API_FDB_DELALL_DESC \ - SW_PARAM_DEF(SW_API_FDB_DELALL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_DELALL, SW_UINT32, 4, SW_PARAM_IN, "Flag"), - -#define SW_API_FDB_DELPORT_DESC \ - SW_PARAM_DEF(SW_API_FDB_DELPORT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_DELPORT, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_DELPORT, SW_UINT32, 4, SW_PARAM_IN, "Flag"), - -#define SW_API_FDB_DELMAC_DESC \ - SW_PARAM_DEF(SW_API_FDB_DELMAC, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_DELMAC, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Fdb Entry"), - -#define SW_API_FDB_FIRST_DESC \ - SW_PARAM_DEF(SW_API_FDB_FIRST, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_FIRST, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_OUT, "Fdb Entry"), - -#define SW_API_FDB_NEXT_DESC \ - SW_PARAM_DEF(SW_API_FDB_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_NEXT, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Fdb Entry"), - -#define SW_API_FDB_FIND_DESC \ - SW_PARAM_DEF(SW_API_FDB_FIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_FIND, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Fdb Entry"), - -#define SW_API_FDB_PT_LEARN_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Learn"), - -#define SW_API_FDB_PT_LEARN_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Learn"), - -#define SW_API_FDB_PT_NEWADDR_LEARN_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_NEWADDR_LEARN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FDB_PT_NEWADDR_LEARN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_NEWADDR_LEARN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Learn Ctrl"),\ - SW_PARAM_DEF(SW_API_FDB_PT_NEWADDR_LEARN_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "Action"), - -#define SW_API_FDB_PT_NEWADDR_LEARN_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_NEWADDR_LEARN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FDB_PT_NEWADDR_LEARN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_NEWADDR_LEARN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Learn Ctrl"),\ - SW_PARAM_DEF(SW_API_FDB_PT_NEWADDR_LEARN_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "Action"), - -#define SW_API_FDB_PT_STAMOVE_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_STAMOVE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FDB_PT_STAMOVE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_STAMOVE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Station Move"),\ - SW_PARAM_DEF(SW_API_FDB_PT_STAMOVE_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "Action"), - -#define SW_API_FDB_PT_STAMOVE_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_STAMOVE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FDB_PT_STAMOVE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_STAMOVE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Station Move"),\ - SW_PARAM_DEF(SW_API_FDB_PT_STAMOVE_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "Action"), - -#define SW_API_FDB_AGE_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_AGE_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_AGE_CTRL_SET, SW_ENABLE, 4, SW_PARAM_IN, "Age"), - -#define SW_API_FDB_AGE_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_AGE_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_AGE_CTRL_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Age"), - -#define SW_API_FDB_LEARN_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_LEARN_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_LEARN_CTRL_SET, SW_ENABLE, 4, SW_PARAM_IN, "Learn Ctrl"), - -#define SW_API_FDB_LEARN_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_LEARN_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_LEARN_CTRL_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Learn Ctrl"), - -#define SW_API_FDB_VLAN_IVL_SVL_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_VLAN_IVL_SVL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_VLAN_IVL_SVL_SET, SW_FDBSMODE, 4, SW_PARAM_IN, "Smode"), - -#define SW_API_FDB_VLAN_IVL_SVL_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_VLAN_IVL_SVL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_VLAN_IVL_SVL_GET, SW_FDBSMODE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Smode"), - -#define SW_API_FDB_AGE_TIME_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_AGE_TIME_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_AGE_TIME_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Time"), - -#define SW_API_FDB_AGE_TIME_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_AGE_TIME_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_AGE_TIME_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Time"), - -#define SW_API_FDB_ITERATE_DESC \ - SW_PARAM_DEF(SW_API_FDB_ITERATE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_ITERATE, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Iterator"),\ - SW_PARAM_DEF(SW_API_FDB_ITERATE, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_OUT, "Fdb Entry"), - -#define SW_API_FDB_EXTEND_NEXT_DESC \ - SW_PARAM_DEF(SW_API_FDB_EXTEND_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_EXTEND_NEXT, SW_FDBOPRATION, sizeof(fal_fdb_op_t), SW_PARAM_PTR|SW_PARAM_IN, "OperateOption"),\ - SW_PARAM_DEF(SW_API_FDB_EXTEND_NEXT, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Fdb Entry"), - -#define SW_API_FDB_EXTEND_FIRST_DESC \ - SW_PARAM_DEF(SW_API_FDB_EXTEND_FIRST, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_EXTEND_FIRST, SW_FDBOPRATION, sizeof(fal_fdb_op_t), SW_PARAM_PTR|SW_PARAM_IN, "OperateOption"),\ - SW_PARAM_DEF(SW_API_FDB_EXTEND_FIRST, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Fdb Entry"), - -#define SW_API_FDB_TRANSFER_DESC \ - SW_PARAM_DEF(SW_API_FDB_TRANSFER, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_TRANSFER, SW_UINT32, 4, SW_PARAM_IN, "Old Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_TRANSFER, SW_UINT32, 4, SW_PARAM_IN, "New Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_TRANSFER, SW_UINT32, 4, SW_PARAM_IN, "FID"),\ - SW_PARAM_DEF(SW_API_FDB_TRANSFER, SW_FDBOPRATION, sizeof(fal_fdb_op_t), SW_PARAM_PTR|SW_PARAM_IN, "OperateOption"), - -#define SW_API_PT_FDB_LEARN_COUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_COUNTER_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "LearnCnt"), - -#define SW_API_PT_FDB_LEARN_LIMIT_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_LIMIT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_LIMIT_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_LIMIT_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_LIMIT_SET, SW_UINT32, 4, SW_PARAM_IN, "LimitCnt"), - -#define SW_API_PT_FDB_LEARN_LIMIT_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_LIMIT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_LIMIT_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_LIMIT_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_LIMIT_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "LimitCnt"), - -#define SW_API_PT_FDB_LEARN_EXCEED_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "cmd"), - -#define SW_API_PT_FDB_LEARN_EXCEED_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "cmd"), - -#define SW_API_FDB_LEARN_LIMIT_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_LEARN_LIMIT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FDB_LEARN_LIMIT_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), \ - SW_PARAM_DEF(SW_API_FDB_LEARN_LIMIT_SET, SW_UINT32, 4, SW_PARAM_IN, "LimitCnt"), - -#define SW_API_FDB_LEARN_LIMIT_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_LEARN_LIMIT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_LEARN_LIMIT_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), \ - SW_PARAM_DEF(SW_API_FDB_LEARN_LIMIT_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "LimitCnt"), - -#define SW_API_FDB_LEARN_EXCEED_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_LEARN_EXCEED_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FDB_LEARN_EXCEED_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "cmd"), - -#define SW_API_FDB_LEARN_EXCEED_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_LEARN_EXCEED_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FDB_LEARN_EXCEED_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "cmd"), - -#define SW_API_FDB_RESV_ADD_DESC \ - SW_PARAM_DEF(SW_API_FDB_RESV_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_RESV_ADD, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Fdb Resv Entry"), - -#define SW_API_FDB_RESV_DEL_DESC \ - SW_PARAM_DEF(SW_API_FDB_RESV_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_RESV_DEL, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Fdb Resv Entry"), - -#define SW_API_FDB_RESV_FIND_DESC \ - SW_PARAM_DEF(SW_API_FDB_RESV_FIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_RESV_FIND, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Fdb Resv Entry"), - -#define SW_API_FDB_RESV_ITERATE_DESC \ - SW_PARAM_DEF(SW_API_FDB_RESV_ITERATE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_RESV_ITERATE, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Iterator"),\ - SW_PARAM_DEF(SW_API_FDB_RESV_ITERATE, SW_FDBENTRY, sizeof(fal_fdb_entry_t), SW_PARAM_PTR|SW_PARAM_OUT, "Fdb Resv Entry"), - -#define SW_API_FDB_PT_LEARN_STATIC_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_STATIC_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_STATIC_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_STATIC_SET, SW_ENABLE, 4, SW_PARAM_IN, "LearnStatic"), - -#define SW_API_FDB_PT_LEARN_STATIC_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_STATIC_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_STATIC_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_LEARN_STATIC_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "LearnStatic"), - -#define SW_API_FDB_PORT_ADD_DESC \ - SW_PARAM_DEF(SW_API_FDB_PORT_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_PORT_ADD, SW_UINT32, 4, SW_PARAM_IN, "FID"),\ - SW_PARAM_DEF(SW_API_FDB_PORT_ADD, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "Address"),\ - SW_PARAM_DEF(SW_API_FDB_PORT_ADD, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_FDB_PORT_DEL_DESC \ - SW_PARAM_DEF(SW_API_FDB_PORT_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_PORT_DEL, SW_UINT32, 4, SW_PARAM_IN, "FID"),\ - SW_PARAM_DEF(SW_API_FDB_PORT_DEL, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "Address"),\ - SW_PARAM_DEF(SW_API_FDB_PORT_DEL, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_FDB_RFS_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_RFS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_RFS_SET, SW_FDB_RFS, sizeof(fal_fdb_rfs_t), SW_PARAM_PTR|SW_PARAM_IN, "Fdb Rfs"), - -#define SW_API_FDB_RFS_DEL_DESC \ - SW_PARAM_DEF(SW_API_FDB_RFS_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_RFS_DEL, SW_FDB_RFS, sizeof(fal_fdb_rfs_t), SW_PARAM_PTR|SW_PARAM_IN, "Fdb Rfs"), - -#define SW_API_FDB_PT_MACLIMIT_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_MACLIMIT_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_MACLIMIT_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_MACLIMIT_CTRL_SET, SW_MACLIMIT_CTRL, sizeof(fal_maclimit_ctrl_t), SW_PARAM_PTR|SW_PARAM_IN, "MacLimit Ctrl"), - -#define SW_API_FDB_PT_MACLIMIT_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_FDB_PT_MACLIMIT_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_MACLIMIT_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_FDB_PT_MACLIMIT_CTRL_GET, SW_MACLIMIT_CTRL, sizeof(fal_maclimit_ctrl_t), SW_PARAM_PTR|SW_PARAM_OUT, "MacLimit Ctrl"), - -#define SW_API_FDB_DEL_BY_FID_DESC \ - SW_PARAM_DEF(SW_API_FDB_DEL_BY_FID, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_FDB_DEL_BY_FID, SW_UINT16, 2, SW_PARAM_IN, "FID"),\ - SW_PARAM_DEF(SW_API_FDB_DEL_BY_FID, SW_UINT32, 4, SW_PARAM_IN, "Flag"), - - -#define SW_API_ACL_LIST_CREAT_DESC \ - SW_PARAM_DEF(SW_API_ACL_LIST_CREAT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_CREAT, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_CREAT, SW_UINT32, 4, SW_PARAM_IN, "List Priority"), - -#define SW_API_ACL_LIST_DESTROY_DESC \ - SW_PARAM_DEF(SW_API_ACL_LIST_DESTROY, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_DESTROY, SW_UINT32, 4, SW_PARAM_IN, "List ID"), - -#define SW_API_ACL_RULE_ADD_DESC \ - SW_PARAM_DEF(SW_API_ACL_RULE_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_ADD, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_ADD, SW_UINT32, 4, SW_PARAM_IN, "Rule ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_ADD, SW_UINT32, 4, SW_PARAM_IN, "Rule Number"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_ADD, SW_ACLRULE, sizeof(fal_acl_rule_t), SW_PARAM_PTR|SW_PARAM_IN, "Rule"), - -#define SW_API_ACL_RULE_DELETE_DESC \ - SW_PARAM_DEF(SW_API_ACL_RULE_DELETE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_DELETE, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_DELETE, SW_UINT32, 4, SW_PARAM_IN, "Rule ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_DELETE, SW_UINT32, 4, SW_PARAM_IN, "Rule Number"), - -#define SW_API_ACL_RULE_QUERY_DESC \ - SW_PARAM_DEF(SW_API_ACL_RULE_QUERY, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_QUERY, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_QUERY, SW_UINT32, 4, SW_PARAM_IN, "Rule ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_QUERY, SW_ACLRULE, sizeof(fal_acl_rule_t), SW_PARAM_PTR|SW_PARAM_OUT, "Rule"), - -#define SW_API_ACL_LIST_BIND_DESC \ - SW_PARAM_DEF(SW_API_ACL_LIST_BIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_BIND, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_BIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_BIND, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_BIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), - -#define SW_API_ACL_LIST_UNBIND_DESC \ - SW_PARAM_DEF(SW_API_ACL_LIST_UNBIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_UNBIND, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_UNBIND, SW_UINT32, 4, SW_PARAM_IN, "Direction"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_UNBIND, SW_UINT32, 4, SW_PARAM_IN, "Object Type"),\ - SW_PARAM_DEF(SW_API_ACL_LIST_UNBIND, SW_UINT32, 4, SW_PARAM_IN, "Object Index"), - -#define SW_API_ACL_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_ACL_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Status"), - -#define SW_API_ACL_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_ACL_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_ACL_LIST_DUMP_DESC \ - SW_PARAM_DEF(SW_API_ACL_LIST_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), - -#define SW_API_ACL_RULE_DUMP_DESC \ - SW_PARAM_DEF(SW_API_ACL_RULE_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), - -#define SW_API_ACL_PT_UDF_PROFILE_SET_DESC \ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_SET, SW_ACL_UDF_TYPE, sizeof(fal_acl_udf_type_t), SW_PARAM_IN, "udf_type"),\ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "udf_offset"),\ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "udf_length"), - -#define SW_API_ACL_PT_UDF_PROFILE_GET_DESC \ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_GET, SW_ACL_UDF_TYPE, sizeof(fal_acl_udf_type_t), SW_PARAM_IN, "udf_type"),\ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "udf_offset"),\ - SW_PARAM_DEF(SW_API_ACL_PT_UDF_PROFILE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "udf_length"), - -#define SW_API_ACL_RULE_ACTIVE_DESC \ - SW_PARAM_DEF(SW_API_ACL_RULE_ACTIVE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_ACTIVE, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_ACTIVE, SW_UINT32, 4, SW_PARAM_IN, "Rule ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_ACTIVE, SW_UINT32, 4, SW_PARAM_IN, "Rule Number"), - -#define SW_API_ACL_RULE_DEACTIVE_DESC \ - SW_PARAM_DEF(SW_API_ACL_RULE_DEACTIVE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_DEACTIVE, SW_UINT32, 4, SW_PARAM_IN, "List ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_DEACTIVE, SW_UINT32, 4, SW_PARAM_IN, "Rule ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_DEACTIVE, SW_UINT32, 4, SW_PARAM_IN, "Rule Number"), - -#define SW_API_ACL_RULE_SRC_FILTER_STS_SET_DESC \ - SW_PARAM_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_SET, SW_UINT32, 4, SW_PARAM_IN, "Rule ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_ACL_RULE_SRC_FILTER_STS_GET_DESC \ - SW_PARAM_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_GET, SW_UINT32, 4, SW_PARAM_IN, "Rule ID"),\ - SW_PARAM_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_ACL_UDF_SET_DESC \ - SW_PARAM_DEF(SW_API_ACL_UDF_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_UDF_SET, SW_ACL_UDF_PKT_TYPE, sizeof(fal_acl_udf_pkt_type_t), SW_PARAM_IN, "udf_packet_type"),\ - SW_PARAM_DEF(SW_API_ACL_UDF_SET, SW_UINT32, 4, SW_PARAM_IN, "udf_index"),\ - SW_PARAM_DEF(SW_API_ACL_UDF_SET, SW_ACL_UDF_TYPE, sizeof(fal_acl_udf_type_t), SW_PARAM_IN, "udf_type"),\ - SW_PARAM_DEF(SW_API_ACL_UDF_SET, SW_UINT32, 4, SW_PARAM_IN, "udf_offset"), - -#define SW_API_ACL_UDF_GET_DESC \ - SW_PARAM_DEF(SW_API_ACL_UDF_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_ACL_UDF_GET, SW_ACL_UDF_PKT_TYPE, sizeof(fal_acl_udf_pkt_type_t), SW_PARAM_IN, "udf_packet_type"),\ - SW_PARAM_DEF(SW_API_ACL_UDF_GET, SW_UINT32, 4, SW_PARAM_IN, "udf_index"),\ - SW_PARAM_DEF(SW_API_ACL_UDF_GET, SW_ACL_UDF_TYPE, sizeof(fal_acl_udf_type_t), SW_PARAM_PTR|SW_PARAM_OUT, "udf_type"),\ - SW_PARAM_DEF(SW_API_ACL_UDF_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "udf_offset"), - -#define SW_API_QOS_SCH_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_SCH_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_SCH_MODE_SET, SW_SCH, sizeof(fal_sch_mode_t), SW_PARAM_IN, "Schedule mode"),\ - SW_PARAM_DEF(SW_API_QOS_SCH_MODE_SET, SW_UINT_A, 16, SW_PARAM_PTR|SW_PARAM_IN, "Weight"), - -#define SW_API_QOS_SCH_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_SCH_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_SCH_MODE_GET, SW_SCH, sizeof(fal_sch_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "Schedule mode"),\ - SW_PARAM_DEF(SW_API_QOS_SCH_MODE_GET, SW_UINT_A, 16, SW_PARAM_PTR|SW_PARAM_OUT, "Weight"), - -#define SW_API_QOS_QU_TX_BUF_ST_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_ST_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_ST_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_ST_SET, SW_ENABLE, 4, SW_PARAM_IN, "Buffer limit"), - -#define SW_API_QOS_QU_TX_BUF_ST_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_ST_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_ST_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_ST_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Buffer limit"), - -#define SW_API_QOS_QU_TX_BUF_NR_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Buffer Number"), - -#define SW_API_QOS_QU_TX_BUF_NR_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"),\ - SW_PARAM_DEF(SW_API_QOS_QU_TX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Buffer Number"), - -#define SW_API_QOS_PT_TX_BUF_ST_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_ST_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_ST_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_ST_SET, SW_ENABLE, 4, SW_PARAM_IN, "Buffer limit"), - -#define SW_API_QOS_PT_TX_BUF_ST_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_ST_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_ST_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_ST_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Buffer limit"), - -#define SW_API_QOS_PT_RED_EN_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_RED_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_RED_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_RED_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "enable"), - -#define SW_API_QOS_PT_RED_EN_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_RED_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_RED_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_RED_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "enable"), - -#define SW_API_QOS_PT_TX_BUF_NR_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Buffer Number"), - -#define SW_API_QOS_PT_TX_BUF_NR_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_TX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Buffer Number"), - -#define SW_API_QOS_PT_RX_BUF_NR_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_RX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_RX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_RX_BUF_NR_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Buffer Number"), - -#define SW_API_QOS_PT_RX_BUF_NR_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_RX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_RX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_RX_BUF_NR_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Buffer Number"), - -#define SW_API_COSMAP_UP_QU_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_COSMAP_UP_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"),\ - SW_PARAM_DEF(SW_API_COSMAP_UP_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue"), - -#define SW_API_COSMAP_UP_QU_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_QU_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_COSMAP_UP_QU_GET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"),\ - SW_PARAM_DEF(SW_API_COSMAP_UP_QU_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Queue"), - -#define SW_API_COSMAP_DSCP_QU_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"),\ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue"), - -#define SW_API_COSMAP_DSCP_QU_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_QU_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_QU_GET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"),\ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_QU_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Queue"), - -#define SW_API_QOS_PT_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_SET, SW_QOS, sizeof(fal_qos_mode_t), SW_PARAM_IN, "Qos mode"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_QOS_PT_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_GET, SW_QOS, sizeof(fal_qos_mode_t), SW_PARAM_IN, "Qos mode"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_QOS_PT_MODE_PRI_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_PRI_SET, SW_QOS, sizeof(fal_qos_mode_t), SW_PARAM_IN, "Qos mode"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), - -#define SW_API_QOS_PT_MODE_PRI_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_PRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_PRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_PRI_GET, SW_QOS, sizeof(fal_qos_mode_t), SW_PARAM_IN, "Qos mode"),\ - SW_PARAM_DEF(SW_API_QOS_PT_MODE_PRI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Priority"), - -#define SW_API_QOS_PORT_DEF_UP_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_DEF_UP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_DEF_UP_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_DEF_UP_SET, SW_UINT32, 4, SW_PARAM_IN, "default up"), - -#define SW_API_QOS_PORT_DEF_UP_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_DEF_UP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_DEF_UP_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_DEF_UP_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "default up"), - -#define SW_API_QOS_PORT_SCH_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_SCH_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_SCH_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_SCH_MODE_SET, SW_SCH, sizeof(fal_sch_mode_t), SW_PARAM_IN, "Schedule mode"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_SCH_MODE_SET, SW_UINT_A, 24, SW_PARAM_PTR|SW_PARAM_IN, "Weight"), - -#define SW_API_QOS_PORT_SCH_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_SCH_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_SCH_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_SCH_MODE_GET, SW_SCH, sizeof(fal_sch_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "Schedule mode"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_SCH_MODE_GET, SW_UINT_A, 24, SW_PARAM_PTR|SW_PARAM_OUT, "Weight"), - -#define SW_API_QOS_PT_DEF_SPRI_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_SPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_SPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_SPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "default spri"), - -#define SW_API_QOS_PT_DEF_SPRI_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_SPRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_SPRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_SPRI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "default spri"), - -#define SW_API_QOS_PT_DEF_CPRI_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_CPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_CPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_CPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "default cpri"), - - -#define SW_API_QOS_PT_FORCE_SPRI_ST_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_QOS_PT_FORCE_SPRI_ST_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_QOS_PT_FORCE_CPRI_ST_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_QOS_PT_FORCE_CPRI_ST_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - - - -#define SW_API_QOS_PT_DEF_CPRI_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_CPRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_CPRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PT_DEF_CPRI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "default cpri"), - - -#define SW_API_QOS_QUEUE_REMARK_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_SET, SW_UINT32, 4, SW_PARAM_IN, "Table ID"), \ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_QOS_QUEUE_REMARK_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_GET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Table ID"), \ - SW_PARAM_DEF(SW_API_QOS_QUEUE_REMARK_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_QOS_PORT_GROUP_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_GROUP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_GROUP_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_GROUP_SET, SW_PORTGROUP, sizeof(fal_qos_group_t), SW_PARAM_PTR|SW_PARAM_IN, "PortGroup"), - -#define SW_API_QOS_PORT_GROUP_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_GROUP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_GROUP_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_GROUP_GET, SW_PORTGROUP, sizeof(fal_qos_group_t), SW_PARAM_PTR|SW_PARAM_OUT, "PortGroup"), - -#define SW_API_QOS_PORT_PRI_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_PRI_SET, SW_PORTPRI, sizeof(fal_qos_pri_precedence_t), SW_PARAM_PTR|SW_PARAM_IN, "PortPri"), - -#define SW_API_QOS_PORT_PRI_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_PRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_PRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_PRI_GET, SW_PORTPRI, sizeof(fal_qos_pri_precedence_t), SW_PARAM_PTR|SW_PARAM_OUT, "PortPri"), - -#define SW_API_QOS_PORT_REMARK_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_REMARK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_REMARK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_REMARK_SET, SW_PORTREMARK, sizeof(fal_qos_remark_enable_t), SW_PARAM_PTR|SW_PARAM_IN, "PortRemark"), - -#define SW_API_QOS_PORT_REMARK_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_REMARK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_REMARK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_REMARK_GET, SW_PORTREMARK, sizeof(fal_qos_remark_enable_t), SW_PARAM_PTR|SW_PARAM_OUT, "PortRemark"), - -#define SW_API_QOS_PCP_MAP_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PCP_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PCP_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Group ID"),\ - SW_PARAM_DEF(SW_API_QOS_PCP_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "PCP"),\ - SW_PARAM_DEF(SW_API_QOS_PCP_MAP_SET, SW_COSMAP, sizeof(fal_qos_cosmap_t), SW_PARAM_PTR|SW_PARAM_IN, "Cosmap"), - -#define SW_API_QOS_PCP_MAP_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PCP_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PCP_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Group ID"),\ - SW_PARAM_DEF(SW_API_QOS_PCP_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "PCP"),\ - SW_PARAM_DEF(SW_API_QOS_PCP_MAP_GET, SW_COSMAP, sizeof(fal_qos_cosmap_t), SW_PARAM_PTR|SW_PARAM_OUT, "Cosmap"), - -#define SW_API_QOS_FLOW_MAP_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_FLOW_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_FLOW_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Group ID"),\ - SW_PARAM_DEF(SW_API_QOS_FLOW_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Flow"),\ - SW_PARAM_DEF(SW_API_QOS_FLOW_MAP_SET, SW_COSMAP, sizeof(fal_qos_cosmap_t), SW_PARAM_PTR|SW_PARAM_IN, "Cosmap"), - -#define SW_API_QOS_FLOW_MAP_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_FLOW_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_FLOW_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Group ID"),\ - SW_PARAM_DEF(SW_API_QOS_FLOW_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Flow"),\ - SW_PARAM_DEF(SW_API_QOS_FLOW_MAP_GET, SW_COSMAP, sizeof(fal_qos_cosmap_t), SW_PARAM_PTR|SW_PARAM_OUT, "Cosmap"), - -#define SW_API_QOS_DSCP_MAP_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_DSCP_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_DSCP_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Group ID"),\ - SW_PARAM_DEF(SW_API_QOS_DSCP_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dscp"),\ - SW_PARAM_DEF(SW_API_QOS_DSCP_MAP_SET, SW_COSMAP, sizeof(fal_qos_cosmap_t), SW_PARAM_PTR|SW_PARAM_IN, "Cosmap"), - -#define SW_API_QOS_DSCP_MAP_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_DSCP_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_DSCP_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Group ID"),\ - SW_PARAM_DEF(SW_API_QOS_DSCP_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dscp"),\ - SW_PARAM_DEF(SW_API_QOS_DSCP_MAP_GET, SW_COSMAP, sizeof(fal_qos_cosmap_t), SW_PARAM_PTR|SW_PARAM_OUT, "Cosmap"), - -#define SW_API_QOS_QUEUE_SCHEDULER_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_SET, SW_UINT32, 4, SW_PARAM_IN, "Node ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_SET, SW_UINT32, 4, SW_PARAM_IN, "Level"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_SET, SW_SCHEDULER, sizeof(fal_qos_scheduler_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "Scheduler"), - -#define SW_API_QOS_QUEUE_SCHEDULER_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_GET, SW_UINT32, 4, SW_PARAM_IN, "Node ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_GET, SW_UINT32, 4, SW_PARAM_IN, "Level"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_QUEUE_SCHEDULER_GET, SW_SCHEDULER, sizeof(fal_qos_scheduler_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "Scheduler"), - -#define SW_API_QOS_RING_QUEUE_MAP_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_RING_QUEUE_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_RING_QUEUE_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Ring ID"),\ - SW_PARAM_DEF(SW_API_QOS_RING_QUEUE_MAP_SET, SW_QUEUEBMP, sizeof(fal_queue_bmp_t), SW_PARAM_PTR|SW_PARAM_IN, "Queue bmp"), - -#define SW_API_QOS_RING_QUEUE_MAP_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_RING_QUEUE_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_RING_QUEUE_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Ring ID"),\ - SW_PARAM_DEF(SW_API_QOS_RING_QUEUE_MAP_GET, SW_QUEUEBMP, sizeof(fal_queue_bmp_t), SW_PARAM_PTR|SW_PARAM_OUT, "Queue bmp"), - -#define SW_API_QOS_PORT_QUEUES_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_QUEUES_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_QUEUES_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_QUEUES_GET, SW_QUEUEBMP, sizeof(fal_queue_bmp_t), SW_PARAM_PTR|SW_PARAM_OUT, "Queue bmp"), - -#define SW_API_QOS_PORT_SCHEDULER_CFG_RESET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_SCHEDULER_CFG_RESET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_QOS_PORT_SCHEDULER_CFG_RESET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "queue ID"), \ - SW_PARAM_DEF(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_IN, "dequeue en"), - -#define SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "queue ID"), \ - SW_PARAM_DEF(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "dequeue en"), - -#define SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET_DESC \ - SW_PARAM_DEF(SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET, SW_RESOURCE_SCHE, sizeof(fal_portscheduler_resource_t), SW_PARAM_PTR|SW_PARAM_OUT, "scheduler resource"), - -#define SW_API_PT_IGMPS_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_IGMPS_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PT_IGMPS_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_IGMPS_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "IGMP snooping"), - -#define SW_API_PT_IGMPS_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_IGMPS_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_IGMPS_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_IGMPS_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "IGMP snooping"), - -#define SW_API_IGMP_MLD_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_MLD_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_MLD_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "cmd"), - -#define SW_API_IGMP_MLD_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_MLD_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_MLD_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "cmd"), - -#define SW_API_IGMP_PT_JOIN_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_PT_JOIN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_PT_JOIN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IGMP_PT_JOIN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Join"), - -#define SW_API_IGMP_PT_JOIN_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_PT_JOIN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_PT_JOIN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IGMP_PT_JOIN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Join"), - -#define SW_API_IGMP_PT_LEAVE_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_PT_LEAVE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_PT_LEAVE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IGMP_PT_LEAVE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Leave"), - -#define SW_API_IGMP_PT_LEAVE_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_PT_LEAVE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_PT_LEAVE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IGMP_PT_LEAVE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Leave"), - -#define SW_API_IGMP_RP_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_RP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_RP_SET, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_IN, "Ports"), - -#define SW_API_IGMP_RP_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_RP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_RP_GET, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_PTR|SW_PARAM_OUT, "Ports"), - -#define SW_API_IGMP_ENTRY_CREAT_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_CREAT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_CREAT_SET, SW_ENABLE, 4, SW_PARAM_IN, "creat Entry"), - -#define SW_API_IGMP_ENTRY_CREAT_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_CREAT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_CREAT_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "creat Entry"), - -#define SW_API_IGMP_ENTRY_STATIC_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_STATIC_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_STATIC_SET, SW_ENABLE, 4, SW_PARAM_IN, "static"), - -#define SW_API_IGMP_ENTRY_STATIC_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_STATIC_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_STATIC_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "static"), - -#define SW_API_IGMP_ENTRY_LEAKY_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_LEAKY_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_LEAKY_SET, SW_ENABLE, 4, SW_PARAM_IN, "leaky"), - -#define SW_API_IGMP_ENTRY_LEAKY_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_LEAKY_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_LEAKY_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "leaky"), - -#define SW_API_IGMP_ENTRY_V3_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_V3_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_V3_SET, SW_ENABLE, 4, SW_PARAM_IN, "version3"), - -#define SW_API_IGMP_ENTRY_V3_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_V3_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_V3_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "version3"), - -#define SW_API_IGMP_ENTRY_QUEUE_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_QUEUE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_QUEUE_SET, SW_ENABLE, 4, SW_PARAM_IN, "queue"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_QUEUE_SET, SW_UINT32, 4, SW_PARAM_IN, "queue_id"), - -#define SW_API_IGMP_ENTRY_QUEUE_GET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_QUEUE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_QUEUE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "queue"), \ - SW_PARAM_DEF(SW_API_IGMP_ENTRY_QUEUE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "queue_id"), - -#define SW_API_PT_IGMP_LEARN_LIMIT_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_LIMIT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_LIMIT_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_LIMIT_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_LIMIT_SET, SW_UINT32, 4, SW_PARAM_IN, "LimitCnt"), - -#define SW_API_PT_IGMP_LEARN_LIMIT_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_LIMIT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_LIMIT_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_LIMIT_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_LIMIT_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "LimitCnt"), - -#define SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "cmd"), - -#define SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "cmd"), - -#define SW_API_IGMP_SG_ENTRY_SET_DESC \ - SW_PARAM_DEF(SW_API_IGMP_SG_ENTRY_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_SG_ENTRY_SET, SW_SGENTRY, sizeof(fal_igmp_sg_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "entry"), - -#define SW_API_IGMP_SG_ENTRY_CLEAR_DESC \ - SW_PARAM_DEF(SW_API_IGMP_SG_ENTRY_CLEAR, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_SG_ENTRY_CLEAR, SW_SGENTRY, sizeof(fal_igmp_sg_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "entry"), - -#define SW_API_IGMP_SG_ENTRY_SHOW_DESC \ - SW_PARAM_DEF(SW_API_IGMP_SG_ENTRY_SHOW, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), - -#define SW_API_IGMP_SG_ENTRY_QUERY_DESC \ - SW_PARAM_DEF(SW_API_IGMP_SG_ENTRY_QUERY, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IGMP_SG_ENTRY_QUERY, SW_SGINFOENTRY, sizeof(fal_igmp_sg_info_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "info"), - - -#define SW_API_UC_LEAKY_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_UC_LEAKY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UC_LEAKY_MODE_SET, SW_LEAKY, sizeof(fal_leaky_ctrl_mode_t), SW_PARAM_IN, "Uc Leaky mode"), - -#define SW_API_UC_LEAKY_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_UC_LEAKY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UC_LEAKY_MODE_GET, SW_LEAKY, sizeof(fal_leaky_ctrl_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "Uc Leaky mode"), - -#define SW_API_MC_LEAKY_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_MC_LEAKY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MC_LEAKY_MODE_SET, SW_LEAKY, sizeof(fal_leaky_ctrl_mode_t), SW_PARAM_IN, "Mc Leaky mode"), - -#define SW_API_MC_LEAKY_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_MC_LEAKY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MC_LEAKY_MODE_GET, SW_LEAKY, sizeof(fal_leaky_ctrl_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "Mc Leaky mode"), - -#define SW_API_ARP_LEAKY_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_ARP_LEAKY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_ARP_LEAKY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_ARP_LEAKY_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Arp leaky"), - -#define SW_API_ARP_LEAKY_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_ARP_LEAKY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_ARP_LEAKY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_ARP_LEAKY_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Arp leaky"), - -#define SW_API_PT_UC_LEAKY_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_UC_LEAKY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_UC_LEAKY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_UC_LEAKY_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Port Unicast leaky"), - -#define SW_API_PT_UC_LEAKY_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_UC_LEAKY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_UC_LEAKY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_UC_LEAKY_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Port Uc leaky"), - -#define SW_API_PT_MC_LEAKY_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_MC_LEAKY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MC_LEAKY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MC_LEAKY_MODE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Port Multicast leaky"), - -#define SW_API_PT_MC_LEAKY_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MC_LEAKY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MC_LEAKY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_MC_LEAKY_MODE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Port Mc leaky"), - - - -#define SW_API_MIRROR_ANALY_PT_SET_DESC \ - SW_PARAM_DEF(SW_API_MIRROR_ANALY_PT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_ANALY_PT_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_MIRROR_ANALY_PT_GET_DESC \ - SW_PARAM_DEF(SW_API_MIRROR_ANALY_PT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_ANALY_PT_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Port ID"), - -#define SW_API_MIRROR_IN_PT_SET_DESC \ - SW_PARAM_DEF(SW_API_MIRROR_IN_PT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_IN_PT_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_IN_PT_SET, SW_ENABLE, 4, SW_PARAM_IN, "Ingerss mirror"), - -#define SW_API_MIRROR_IN_PT_GET_DESC \ - SW_PARAM_DEF(SW_API_MIRROR_IN_PT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_IN_PT_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_IN_PT_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Ingeress mirror"), - -#define SW_API_MIRROR_EG_PT_SET_DESC \ - SW_PARAM_DEF(SW_API_MIRROR_EG_PT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_EG_PT_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_EG_PT_SET, SW_ENABLE, 4, SW_PARAM_IN, "Egerss mirror"), - -#define SW_API_MIRROR_EG_PT_GET_DESC \ - SW_PARAM_DEF(SW_API_MIRROR_EG_PT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_EG_PT_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_EG_PT_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Egeress mirror"), - -#define SW_API_MIRROR_ANALYSIS_CONFIG_SET_DESC \ - SW_PARAM_DEF(SW_API_MIRROR_ANALYSIS_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_ANALYSIS_CONFIG_SET, SW_MIRR_DIRECTION, sizeof(fal_mirr_direction_t), SW_PARAM_IN, "Direction"), \ - SW_PARAM_DEF(SW_API_MIRROR_ANALYSIS_CONFIG_SET, SW_MIRR_ANALYSIS_CONFIG, sizeof(fal_mirr_analysis_config_t), SW_PARAM_PTR|SW_PARAM_IN, "Config"), - -#define SW_API_MIRROR_ANALYSIS_CONFIG_GET_DESC \ - SW_PARAM_DEF(SW_API_MIRROR_ANALYSIS_CONFIG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIRROR_ANALYSIS_CONFIG_GET, SW_MIRR_DIRECTION, sizeof(fal_mirr_direction_t), SW_PARAM_IN, "Direction"), \ - SW_PARAM_DEF(SW_API_MIRROR_ANALYSIS_CONFIG_GET, SW_MIRR_ANALYSIS_CONFIG, sizeof(fal_mirr_analysis_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "Config"), - -#define SW_API_RSS_HASH_CONFIG_SET_DESC \ - SW_PARAM_DEF(SW_API_RSS_HASH_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RSS_HASH_CONFIG_SET, SW_RSS_HASH_MODE, sizeof(fal_rss_hash_mode_t), SW_PARAM_IN, "Mode"), \ - SW_PARAM_DEF(SW_API_RSS_HASH_CONFIG_SET, SW_RSS_HASH_CONFIG, sizeof(fal_rss_hash_config_t), SW_PARAM_PTR|SW_PARAM_IN, "Config"), - -#define SW_API_RSS_HASH_CONFIG_GET_DESC \ - SW_PARAM_DEF(SW_API_RSS_HASH_CONFIG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RSS_HASH_CONFIG_GET, SW_RSS_HASH_MODE, sizeof(fal_rss_hash_mode_t), SW_PARAM_IN, "Mode"), \ - SW_PARAM_DEF(SW_API_RSS_HASH_CONFIG_GET, SW_RSS_HASH_CONFIG, sizeof(fal_rss_hash_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "Config"), - - -#define SW_API_RATE_QU_EGRL_SET_DESC \ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"),\ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Speed"),\ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_SET, SW_ENABLE, 4, SW_PARAM_IN, "Rate limit"), - -#define SW_API_RATE_QU_EGRL_GET_DESC \ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"),\ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Speed"),\ - SW_PARAM_DEF(SW_API_RATE_QU_EGRL_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Rate limit"), - -#define SW_API_RATE_PT_EGRL_SET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PT_EGRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_EGRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_EGRL_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Speed"),\ - SW_PARAM_DEF(SW_API_RATE_PT_EGRL_SET, SW_ENABLE, 4, SW_PARAM_IN, "Rate limit"), - -#define SW_API_RATE_PT_EGRL_GET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PT_EGRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_EGRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_EGRL_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Speed"),\ - SW_PARAM_DEF(SW_API_RATE_PT_EGRL_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Rate limit"), - -#define SW_API_RATE_PT_INRL_SET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PT_INRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_INRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_INRL_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Speed"),\ - SW_PARAM_DEF(SW_API_RATE_PT_INRL_SET, SW_ENABLE, 4, SW_PARAM_IN, "Rate limit"), - -#define SW_API_RATE_PT_INRL_GET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PT_INRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_INRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_INRL_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Speed"),\ - SW_PARAM_DEF(SW_API_RATE_PT_INRL_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Rate limit"), - -#define SW_API_STORM_CTRL_FRAME_SET_DESC \ - SW_PARAM_DEF(SW_API_STORM_CTRL_FRAME_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_FRAME_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_FRAME_SET, SW_STORM, sizeof(fal_storm_type_t), SW_PARAM_IN, "Frame type"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_FRAME_SET, SW_ENABLE, 4, SW_PARAM_IN, "strom contrl"), - -#define SW_API_STORM_CTRL_FRAME_GET_DESC \ - SW_PARAM_DEF(SW_API_STORM_CTRL_FRAME_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_FRAME_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_FRAME_GET, SW_STORM, sizeof(fal_storm_type_t), SW_PARAM_IN, "Frame type"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_FRAME_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "strom contrl"), - -#define SW_API_STORM_CTRL_RATE_SET_DESC \ - SW_PARAM_DEF(SW_API_STORM_CTRL_RATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_RATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_RATE_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Speed"), - -#define SW_API_STORM_CTRL_RATE_GET_DESC \ - SW_PARAM_DEF(SW_API_STORM_CTRL_RATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_RATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_STORM_CTRL_RATE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Speed"), - -#define SW_API_RATE_PORT_POLICER_SET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PORT_POLICER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PORT_POLICER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PORT_POLICER_SET, SW_INGPOLICER, sizeof(fal_port_policer_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Policer"), - -#define SW_API_RATE_PORT_POLICER_GET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PORT_POLICER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PORT_POLICER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PORT_POLICER_GET, SW_INGPOLICER, sizeof(fal_port_policer_t), SW_PARAM_PTR|SW_PARAM_OUT, "Policer"), - -#define SW_API_RATE_PORT_SHAPER_SET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PORT_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PORT_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PORT_SHAPER_SET, SW_ENABLE, 4, SW_PARAM_IN, "Status"), \ - SW_PARAM_DEF(SW_API_RATE_PORT_SHAPER_SET, SW_EGSHAPER, sizeof(fal_egress_shaper_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Shaper"), - -#define SW_API_RATE_PORT_SHAPER_GET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PORT_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PORT_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PORT_SHAPER_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), \ - SW_PARAM_DEF(SW_API_RATE_PORT_SHAPER_GET, SW_EGSHAPER, sizeof(fal_egress_shaper_t), SW_PARAM_PTR|SW_PARAM_OUT, "Shaper"), - -#define SW_API_RATE_QUEUE_SHAPER_SET_DESC \ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"),\ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), \ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_SET, SW_EGSHAPER, sizeof(fal_egress_shaper_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Shaper"), - -#define SW_API_RATE_QUEUE_SHAPER_GET_DESC \ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"),\ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), \ - SW_PARAM_DEF(SW_API_RATE_QUEUE_SHAPER_GET, SW_EGSHAPER, sizeof(fal_egress_shaper_t), SW_PARAM_PTR|SW_PARAM_OUT, "Shaper"), - -#define SW_API_RATE_ACL_POLICER_SET_DESC \ - SW_PARAM_DEF(SW_API_RATE_ACL_POLICER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_ACL_POLICER_SET, SW_UINT32, 4, SW_PARAM_IN, "Policer ID"),\ - SW_PARAM_DEF(SW_API_RATE_ACL_POLICER_SET, SW_ACLPOLICER, sizeof(fal_acl_policer_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Policer"), - -#define SW_API_RATE_ACL_POLICER_GET_DESC \ - SW_PARAM_DEF(SW_API_RATE_ACL_POLICER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_ACL_POLICER_GET, SW_UINT32, 4, SW_PARAM_IN, "Policer ID"),\ - SW_PARAM_DEF(SW_API_RATE_ACL_POLICER_GET, SW_ACLPOLICER, sizeof(fal_acl_policer_t), SW_PARAM_PTR|SW_PARAM_OUT, "Policer"), - -#define SW_API_RATE_PT_ADDRATEBYTE_SET_DESC\ - SW_PARAM_DEF(SW_API_RATE_PT_ADDRATEBYTE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_ADDRATEBYTE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_ADDRATEBYTE_SET, SW_UINT32, 4, SW_PARAM_IN, "AddRateByte"), - -#define SW_API_RATE_PT_ADDRATEBYTE_GET_DESC\ - SW_PARAM_DEF(SW_API_RATE_PT_ADDRATEBYTE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_ADDRATEBYTE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_ADDRATEBYTE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "AddRateByte"), - -#define SW_API_RATE_PT_GOL_FLOW_EN_SET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PT_GOL_FLOW_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_GOL_FLOW_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_GOL_FLOW_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_RATE_PT_GOL_FLOW_EN_GET_DESC \ - SW_PARAM_DEF(SW_API_RATE_PT_GOL_FLOW_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_GOL_FLOW_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_RATE_PT_GOL_FLOW_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_STP_PT_STATE_SET_DESC \ - SW_PARAM_DEF(SW_API_STP_PT_STATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_STP_PT_STATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Spaning tree ID"),\ - SW_PARAM_DEF(SW_API_STP_PT_STATE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_STP_PT_STATE_SET, SW_STP, sizeof(fal_stp_state_t), SW_PARAM_IN, "Port State"), - -#define SW_API_STP_PT_STATE_GET_DESC \ - SW_PARAM_DEF(SW_API_STP_PT_STATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_STP_PT_STATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Spaning tree ID"),\ - SW_PARAM_DEF(SW_API_STP_PT_STATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"),\ - SW_PARAM_DEF(SW_API_STP_PT_STATE_GET, SW_STP, sizeof(fal_stp_state_t), SW_PARAM_PTR|SW_PARAM_OUT, "Port State"), - - - - -#define SW_API_PT_MIB_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MIB_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MIB_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_MIB_GET, SW_MIB, sizeof(fal_mib_info_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "MIB info"), -#define SW_API_PT_XGMIB_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_XGMIB_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_XGMIB_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_XGMIB_GET, SW_XGMIB, sizeof(fal_xgmib_info_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "XGMIB info"), - -#define SW_API_MIB_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_MIB_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIB_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "MIB status"), - -#define SW_API_MIB_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_MIB_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIB_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "MIB status"), - -#define SW_API_PT_MIB_FLUSH_COUNTERS_DESC\ - SW_PARAM_DEF(SW_API_PT_MIB_FLUSH_COUNTERS, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MIB_FLUSH_COUNTERS, SW_UINT32, 4, SW_PARAM_IN, "Port No."), - -#define SW_API_MIB_CPU_KEEP_SET_DESC \ - SW_PARAM_DEF(SW_API_MIB_CPU_KEEP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIB_CPU_KEEP_SET, SW_ENABLE, 4, SW_PARAM_IN, "CPU_KEEP Set"), - -#define SW_API_MIB_CPU_KEEP_GET_DESC \ - SW_PARAM_DEF(SW_API_MIB_CPU_KEEP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MIB_CPU_KEEP_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "CPU_KEEP Get"), - -#define SW_API_PT_MIB_COUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_MIB_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_MIB_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port No."), \ - SW_PARAM_DEF(SW_API_PT_MIB_COUNTER_GET, SW_MIB_CNTR, sizeof(fal_mib_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "MIB Counter"), - - - -#define SW_API_ARP_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_ARP_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_ARP_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "ARP acknowledge"), - -#define SW_API_ARP_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_ARP_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_ARP_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "ARP acknowledge"), - -#define SW_API_FRAME_MAX_SIZE_SET_DESC \ - SW_PARAM_DEF(SW_API_FRAME_MAX_SIZE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FRAME_MAX_SIZE_SET, SW_UINT32, 4, SW_PARAM_IN, "Frame Size"), - -#define SW_API_FRAME_MAX_SIZE_GET_DESC \ - SW_PARAM_DEF(SW_API_FRAME_MAX_SIZE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FRAME_MAX_SIZE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Frame Size"), - -#define SW_API_PT_UNK_SA_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_UNK_SA_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_SA_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_SA_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "Forwarding"), - -#define SW_API_PT_UNK_SA_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_UNK_SA_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_SA_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_SA_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "Forwarding"), - -#define SW_API_PT_UNK_UC_FILTER_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_UNK_UC_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_UC_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_UC_FILTER_SET, SW_ENABLE, 4, SW_PARAM_IN, "Filter"), - -#define SW_API_PT_UNK_UC_FILTER_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_UNK_UC_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_UC_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_UC_FILTER_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Filter"), - -#define SW_API_PT_UNK_MC_FILTER_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_UNK_MC_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_MC_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_MC_FILTER_SET, SW_ENABLE, 4, SW_PARAM_IN, "Filter"), - -#define SW_API_PT_UNK_MC_FILTER_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_UNK_MC_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_MC_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_UNK_MC_FILTER_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Filter"), - -#define SW_API_PT_BC_FILTER_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_BC_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_BC_FILTER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_BC_FILTER_SET, SW_ENABLE, 4, SW_PARAM_IN, "Filter"), - -#define SW_API_PT_BC_FILTER_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_BC_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_BC_FILTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_BC_FILTER_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Filter"), - -#define SW_API_CPU_PORT_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_CPU_PORT_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_CPU_PORT_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Cpu port"), - -#define SW_API_CPU_PORT_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_CPU_PORT_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_CPU_PORT_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Cpu port"), - -#define SW_API_BC_TO_CPU_PORT_SET_DESC \ - SW_PARAM_DEF(SW_API_BC_TO_CPU_PORT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BC_TO_CPU_PORT_SET, SW_ENABLE, 4, SW_PARAM_IN, "ToCpu"), - -#define SW_API_BC_TO_CPU_PORT_GET_DESC \ - SW_PARAM_DEF(SW_API_BC_TO_CPU_PORT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BC_TO_CPU_PORT_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "ToCpu"), - -#define SW_API_PPPOE_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "Forwarding"), - -#define SW_API_PPPOE_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "Forwarding"), - -#define SW_API_PPPOE_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "PPPOE"), - -#define SW_API_PPPOE_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "PPPOE"), - -#define SW_API_PT_DHCP_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_DHCP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DHCP_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_DHCP_SET, SW_ENABLE, 4, SW_PARAM_IN, "DHCP"), - -#define SW_API_PT_DHCP_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_DHCP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_DHCP_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_DHCP_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "DHCP"), - -#define SW_API_ARP_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_ARP_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_ARP_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "cmd"), - -#define SW_API_ARP_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_ARP_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_ARP_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "cmd"), - -#define SW_API_EAPOL_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_EAPOL_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_EAPOL_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "cmd"), - -#define SW_API_EAPOL_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_EAPOL_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_EAPOL_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "cmd"), - -#define SW_API_PPPOE_SESSION_ADD_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ADD, SW_UINT32, 4, SW_PARAM_IN, "Session ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ADD, SW_ENABLE, 4, SW_PARAM_IN, "StripHdr"), - -#define SW_API_PPPOE_SESSION_DEL_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_DEL, SW_UINT32, 4, SW_PARAM_IN, "Session ID"), - -#define SW_API_PPPOE_SESSION_GET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_GET, SW_UINT32, 4, SW_PARAM_IN, "Session ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "StripHdr"), - -#define SW_API_EAPOL_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_EAPOL_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_EAPOL_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_EAPOL_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_EAPOL_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_EAPOL_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_EAPOL_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_EAPOL_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_RIPV1_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_RIPV1_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RIPV1_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_RIPV1_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_RIPV1_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RIPV1_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_PT_ARP_REQ_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_ARP_REQ_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_ARP_REQ_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_ARP_REQ_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "ARP Req acknowledge"), - -#define SW_API_PT_ARP_REQ_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_ARP_REQ_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_ARP_REQ_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_ARP_REQ_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "ARP Req acknowledge"), - -#define SW_API_PT_ARP_ACK_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_PT_ARP_ACK_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_ARP_ACK_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_ARP_ACK_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "ARP Ack acknowledge"), - -#define SW_API_PT_ARP_ACK_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PT_ARP_ACK_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PT_ARP_ACK_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PT_ARP_ACK_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "ARP Ack acknowledge"), - -#define SW_API_PPPOE_SESSION_TABLE_ADD_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_TABLE_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_TABLE_ADD, SW_PPPOE, sizeof(fal_pppoe_session_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Session"), - -#define SW_API_PPPOE_SESSION_TABLE_DEL_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_TABLE_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_TABLE_DEL, SW_PPPOE, sizeof(fal_pppoe_session_t), SW_PARAM_PTR|SW_PARAM_IN, "Session"), - -#define SW_API_PPPOE_SESSION_TABLE_GET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_TABLE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_TABLE_GET, SW_PPPOE, sizeof(fal_pppoe_session_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Session"), - -#define SW_API_PPPOE_SESSION_ID_SET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ID_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ID_SET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ID_SET, SW_UINT32, 4, SW_PARAM_IN, "ID"), - -#define SW_API_PPPOE_SESSION_ID_GET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ID_GET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_PPPOE_SESSION_ID_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "ID"), - -#define SW_API_INTR_MASK_SET_DESC \ - SW_PARAM_DEF(SW_API_INTR_MASK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_MASK_SET, SW_UINT32, 4, SW_PARAM_IN, "Mask"), - -#define SW_API_INTR_MASK_GET_DESC \ - SW_PARAM_DEF(SW_API_INTR_MASK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_MASK_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Mask"), - -#define SW_API_INTR_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_INTR_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_STATUS_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_INTR_STATUS_CLEAR_DESC \ - SW_PARAM_DEF(SW_API_INTR_STATUS_CLEAR, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_STATUS_CLEAR, SW_UINT32, 4, SW_PARAM_IN, "Status"), - -#define SW_API_INTR_PORT_LINK_MASK_SET_DESC \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_MASK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_MASK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_MASK_SET, SW_UINT32, 4, SW_PARAM_IN, "Mask"), - -#define SW_API_INTR_PORT_LINK_MASK_GET_DESC \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_MASK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_MASK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_MASK_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Mask"), - -#define SW_API_INTR_PORT_LINK_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_INTR_PORT_LINK_STATUS_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_INTR_MASK_MAC_LINKCHG_SET_DESC \ - SW_PARAM_DEF(SW_API_INTR_MASK_MAC_LINKCHG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_MASK_MAC_LINKCHG_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_INTR_MASK_MAC_LINKCHG_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_INTR_MASK_MAC_LINKCHG_GET_DESC \ - SW_PARAM_DEF(SW_API_INTR_MASK_MAC_LINKCHG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_MASK_MAC_LINKCHG_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_INTR_MASK_MAC_LINKCHG_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_INTR_STATUS_MAC_LINKCHG_GET_DESC \ - SW_PARAM_DEF(SW_API_INTR_STATUS_MAC_LINKCHG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_INTR_STATUS_MAC_LINKCHG_GET, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_PTR|SW_PARAM_OUT, "Intr Port Bitmap"), - -#define SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR_DESC \ - SW_PARAM_DEF(SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), - -#define SW_API_CPU_VID_EN_SET_DESC \ - SW_PARAM_DEF(SW_API_CPU_VID_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_CPU_VID_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Cpu vid"), - -#define SW_API_CPU_VID_EN_GET_DESC \ - SW_PARAM_DEF(SW_API_CPU_VID_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_CPU_VID_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Cpu vid"), - -#define SW_API_RTD_PPPOE_EN_SET_DESC \ - SW_PARAM_DEF(SW_API_RTD_PPPOE_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RTD_PPPOE_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "RTD PPPoE"), - -#define SW_API_RTD_PPPOE_EN_GET_DESC \ - SW_PARAM_DEF(SW_API_RTD_PPPOE_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_RTD_PPPOE_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "RTD PPPoE"), - -#define SW_API_PPPOE_EN_SET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "L3 Interface"), \ - SW_PARAM_DEF(SW_API_PPPOE_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_PPPOE_EN_GET_DESC \ - SW_PARAM_DEF(SW_API_PPPOE_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PPPOE_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "L3 Interface"), \ - SW_PARAM_DEF(SW_API_PPPOE_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_GLOBAL_MACADDR_SET_DESC \ - SW_PARAM_DEF(SW_API_GLOBAL_MACADDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_GLOBAL_MACADDR_SET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "[Macaddr]:"), - -#define SW_API_GLOBAL_MACADDR_GET_DESC \ - SW_PARAM_DEF(SW_API_GLOBAL_MACADDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_GLOBAL_MACADDR_GET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "[Macaddr]:"), - -#define SW_API_LLDP_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_LLDP_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_LLDP_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "LLDP"), - -#define SW_API_LLDP_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_LLDP_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_LLDP_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "LLDP"), - -#define SW_API_FRAME_CRC_RESERVE_SET_DESC \ - SW_PARAM_DEF(SW_API_FRAME_CRC_RESERVE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FRAME_CRC_RESERVE_SET, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_FRAME_CRC_RESERVE_GET_DESC \ - SW_PARAM_DEF(SW_API_FRAME_CRC_RESERVE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FRAME_CRC_RESERVE_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_DEBUG_PORT_COUNTER_ENABLE_DESC \ - SW_PARAM_DEF(SW_API_DEBUG_PORT_COUNTER_ENABLE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PORT_COUNTER_ENABLE, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PORT_COUNTER_ENABLE, SW_DEBUG_COUNTER_EN, sizeof(fal_counter_en_t), SW_PARAM_PTR|SW_PARAM_IN, "enable"), - -#define SW_API_DEBUG_PORT_COUNTER_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_DEBUG_PORT_COUNTER_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PORT_COUNTER_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_DEBUG_PORT_COUNTER_STATUS_GET, SW_DEBUG_COUNTER_EN, sizeof(fal_counter_en_t), SW_PARAM_PTR|SW_PARAM_OUT, "enable"), - - -#define SW_API_LED_PATTERN_SET_DESC \ - SW_PARAM_DEF(SW_API_LED_PATTERN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_LED_PATTERN_SET, SW_UINT32, 4, SW_PARAM_IN, "Pattern Group"),\ - SW_PARAM_DEF(SW_API_LED_PATTERN_SET, SW_UINT32, 4, SW_PARAM_IN, "Pattern ID"),\ - SW_PARAM_DEF(SW_API_LED_PATTERN_SET, SW_LEDPATTERN, sizeof(led_ctrl_pattern_t), SW_PARAM_PTR|SW_PARAM_IN, "Pattern"), - -#define SW_API_LED_PATTERN_GET_DESC \ - SW_PARAM_DEF(SW_API_LED_PATTERN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_LED_PATTERN_GET, SW_UINT32, 4, SW_PARAM_IN, "Pattern Group"),\ - SW_PARAM_DEF(SW_API_LED_PATTERN_GET, SW_UINT32, 4, SW_PARAM_IN, "Pattern ID"),\ - SW_PARAM_DEF(SW_API_LED_PATTERN_GET, SW_LEDPATTERN, sizeof(led_ctrl_pattern_t), SW_PARAM_PTR|SW_PARAM_OUT, "Pattern"), - -/*qca808x_start*/ -#define SW_API_PHY_GET_DESC \ - SW_PARAM_DEF(SW_API_PHY_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PHY_GET, SW_UINT32, 4, SW_PARAM_IN, "Phy ID"),\ - SW_PARAM_DEF(SW_API_PHY_GET, SW_UINT32, 4, SW_PARAM_IN, "Reg ID"),\ - SW_PARAM_DEF(SW_API_PHY_GET, SW_UINT16, 2, SW_PARAM_PTR|SW_PARAM_OUT, "Data"), - - -#define SW_API_PHY_SET_DESC \ - SW_PARAM_DEF(SW_API_PHY_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PHY_SET, SW_UINT32, 4, SW_PARAM_IN, "Phy ID"),\ - SW_PARAM_DEF(SW_API_PHY_SET, SW_UINT32, 4, SW_PARAM_IN, "Reg ID"),\ - SW_PARAM_DEF(SW_API_PHY_SET, SW_UINT16, 2, SW_PARAM_IN, "Data"), -/*qca808x_end*/ - -#define SW_API_REG_GET_DESC \ - SW_PARAM_DEF(SW_API_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Reg Addr"),\ - SW_PARAM_DEF(SW_API_REG_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Data"),\ - SW_PARAM_DEF(SW_API_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Data Len"), - -#define SW_API_REG_SET_DESC \ - SW_PARAM_DEF(SW_API_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Reg Addr"),\ - SW_PARAM_DEF(SW_API_REG_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "Data"),\ - SW_PARAM_DEF(SW_API_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Data Len"), - -#define SW_API_PSGMII_REG_GET_DESC \ - SW_PARAM_DEF(SW_API_PSGMII_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PSGMII_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Reg Addr"),\ - SW_PARAM_DEF(SW_API_PSGMII_REG_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Data"),\ - SW_PARAM_DEF(SW_API_PSGMII_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Data Len"), - -#define SW_API_PSGMII_REG_SET_DESC \ - SW_PARAM_DEF(SW_API_PSGMII_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_PSGMII_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Reg Addr"),\ - SW_PARAM_DEF(SW_API_PSGMII_REG_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "Data"),\ - SW_PARAM_DEF(SW_API_PSGMII_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Data Len"), - -#define SW_API_REG_FIELD_GET_DESC \ - SW_PARAM_DEF(SW_API_REG_FIELD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_GET, SW_UINT32, 4, SW_PARAM_IN, "Reg Addr"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_GET, SW_UINT32, 4, SW_PARAM_IN, "Bit Offset"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_GET, SW_UINT32, 4, SW_PARAM_IN, "Field Len"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Data"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_GET, SW_UINT32, 4, SW_PARAM_IN, "Data Len"), - -#define SW_API_REG_FIELD_SET_DESC \ - SW_PARAM_DEF(SW_API_REG_FIELD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_SET, SW_UINT32, 4, SW_PARAM_IN, "Reg Addr"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_SET, SW_UINT32, 4, SW_PARAM_IN, "Bit Offset"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_SET, SW_UINT32, 4, SW_PARAM_IN, "Field Len"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "Data"),\ - SW_PARAM_DEF(SW_API_REG_FIELD_SET, SW_UINT32, 4, SW_PARAM_IN, "Data Len"), - -#define SW_API_REG_DUMP_DESC \ - SW_PARAM_DEF(SW_API_REG_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_REG_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Register group idx"), \ - SW_PARAM_DEF(SW_API_REG_DUMP, SW_REG_DUMP, sizeof(fal_reg_dump_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Register dump"), - -#define SW_API_DBG_REG_DUMP_DESC \ - SW_PARAM_DEF(SW_API_DBG_REG_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_DBG_REG_DUMP, SW_DBG_REG_DUMP, sizeof(fal_debug_reg_dump_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Debug Register dump"), - -#define SW_API_DBG_PSGMII_SELF_TEST_DESC \ - SW_PARAM_DEF(SW_API_DBG_PSGMII_SELF_TEST, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_DBG_PSGMII_SELF_TEST, SW_ENABLE, 4, SW_PARAM_IN, "enable"),\ - SW_PARAM_DEF(SW_API_DBG_PSGMII_SELF_TEST, SW_UINT32, 4, SW_PARAM_IN, "times"),\ - SW_PARAM_DEF(SW_API_DBG_PSGMII_SELF_TEST, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_PHY_DUMP_DESC \ - SW_PARAM_DEF(SW_API_PHY_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PHY_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Phy ID"),\ - SW_PARAM_DEF(SW_API_PHY_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Register group idx"), \ - SW_PARAM_DEF(SW_API_PHY_DUMP, SW_PHY_DUMP, sizeof(fal_phy_dump_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "PHY dump"), - -#define SW_API_UNIPHY_REG_GET_DESC \ - SW_PARAM_DEF(SW_API_UNIPHY_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_UNIPHY_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Reg Index"),\ - SW_PARAM_DEF(SW_API_UNIPHY_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Reg Addr"),\ - SW_PARAM_DEF(SW_API_UNIPHY_REG_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Data"),\ - SW_PARAM_DEF(SW_API_UNIPHY_REG_GET, SW_UINT32, 4, SW_PARAM_IN, "Data Len"), - -#define SW_API_UNIPHY_REG_SET_DESC \ - SW_PARAM_DEF(SW_API_UNIPHY_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_UNIPHY_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Reg Index"),\ - SW_PARAM_DEF(SW_API_UNIPHY_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Reg Addr"),\ - SW_PARAM_DEF(SW_API_UNIPHY_REG_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "Data"),\ - SW_PARAM_DEF(SW_API_UNIPHY_REG_SET, SW_UINT32, 4, SW_PARAM_IN, "Data Len"), - -#define SW_API_COSMAP_DSCP_TO_PRI_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), - -#define SW_API_COSMAP_DSCP_TO_PRI_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_PRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_PRI_GET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_PRI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Priority"), - -#define SW_API_COSMAP_DSCP_TO_DP_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_DP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_DP_SET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_DP_SET, SW_UINT32, 4, SW_PARAM_IN, "DP"), - -#define SW_API_COSMAP_DSCP_TO_DP_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_DP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_DP_GET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_DP_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "DP"), - -#define SW_API_COSMAP_UP_TO_PRI_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_PRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), - -#define SW_API_COSMAP_UP_TO_PRI_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_PRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_PRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_PRI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Priority"), - -#define SW_API_COSMAP_UP_TO_DP_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_DP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_DP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_DP_SET, SW_UINT32, 4, SW_PARAM_IN, "DP"), - -#define SW_API_COSMAP_UP_TO_DP_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_DP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_DP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_DP_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "DP"), - -#define SW_API_COSMAP_DSCP_TO_EHPRI_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), - -#define SW_API_COSMAP_DSCP_TO_EHPRI_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHPRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHPRI_GET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHPRI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Priority"), - -#define SW_API_COSMAP_DSCP_TO_EHDP_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHDP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHDP_SET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHDP_SET, SW_UINT32, 4, SW_PARAM_IN, "DP"), - -#define SW_API_COSMAP_DSCP_TO_EHDP_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHDP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHDP_GET, SW_UINT32, 4, SW_PARAM_IN, "DSCP"), \ - SW_PARAM_DEF(SW_API_COSMAP_DSCP_TO_EHDP_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "DP"), - -#define SW_API_COSMAP_UP_TO_EHPRI_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHPRI_SET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), - -#define SW_API_COSMAP_UP_TO_EHPRI_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHPRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHPRI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHPRI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Priority"), - -#define SW_API_COSMAP_UP_TO_EHDP_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHDP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHDP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHDP_SET, SW_UINT32, 4, SW_PARAM_IN, "DP"), - -#define SW_API_COSMAP_UP_TO_EHDP_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHDP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHDP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dot1p"), \ - SW_PARAM_DEF(SW_API_COSMAP_UP_TO_EHDP_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "DP"), - -#define SW_API_COSMAP_PRI_TO_QU_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_QU_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue"), - -#define SW_API_COSMAP_PRI_TO_QU_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_QU_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_QU_GET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_QU_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Queue"), - -#define SW_API_COSMAP_PRI_TO_EHQU_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_EHQU_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_EHQU_SET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_EHQU_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue"), - -#define SW_API_COSMAP_PRI_TO_EHQU_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_EHQU_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_EHQU_GET, SW_UINT32, 4, SW_PARAM_IN, "Priority"), \ - SW_PARAM_DEF(SW_API_COSMAP_PRI_TO_EHQU_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Queue"), - -#define SW_API_COSMAP_EG_REMARK_SET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_EG_REMARK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_EG_REMARK_SET, SW_UINT32, 4, SW_PARAM_IN, "Table ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_EG_REMARK_SET, SW_REMARKENTRY, sizeof(fal_egress_remark_table_t), SW_PARAM_IN|SW_PARAM_PTR, "Table Entry"), - -#define SW_API_COSMAP_EG_REMARK_GET_DESC \ - SW_PARAM_DEF(SW_API_COSMAP_EG_REMARK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_EG_REMARK_GET, SW_UINT32, 4, SW_PARAM_IN, "Table ID"), \ - SW_PARAM_DEF(SW_API_COSMAP_EG_REMARK_GET, SW_REMARKENTRY, sizeof(fal_egress_remark_table_t), SW_PARAM_OUT|SW_PARAM_PTR, "Table Entry"), - - - -#define SW_API_SEC_NORM_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_NORM_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_NORM_SET, SW_UINT32, 4, SW_PARAM_IN, "NormItem"), \ - SW_PARAM_DEF(SW_API_SEC_NORM_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_NORM_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_NORM_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_NORM_GET, SW_UINT32, 4, SW_PARAM_IN, "NormItem"), \ - SW_PARAM_DEF(SW_API_SEC_NORM_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_MAC_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_MAC_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_MAC_SET, SW_SEC_MAC, 4, SW_PARAM_IN, "MAC related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_MAC_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_MAC_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_MAC_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_MAC_GET, SW_SEC_MAC, 4, SW_PARAM_IN, "MAC related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_MAC_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_IP_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_IP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_IP_SET, SW_SEC_IP, 4, SW_PARAM_IN, "IP related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_IP_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_IP_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_IP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_IP_GET, SW_SEC_IP, 4, SW_PARAM_IN, "IP related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_IP_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_IP4_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_IP4_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_IP4_SET, SW_SEC_IP4, 4, SW_PARAM_IN, "IP4 related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_IP4_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_IP4_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_IP4_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_IP4_GET, SW_SEC_IP4, 4, SW_PARAM_IN, "IP4 related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_IP4_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_IP6_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_IP6_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_IP6_SET, SW_SEC_IP6, 4, SW_PARAM_IN, "IP6 related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_IP6_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_IP6_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_IP6_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_IP6_GET, SW_SEC_IP6, 4, SW_PARAM_IN, "IP6 related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_IP6_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_TCP_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_TCP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_TCP_SET, SW_SEC_TCP, 4, SW_PARAM_IN, "TCP related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_TCP_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_TCP_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_TCP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_TCP_GET, SW_SEC_TCP, 4, SW_PARAM_IN, "TCP related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_TCP_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_UDP_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_UDP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_UDP_SET, SW_SEC_UDP, 4, SW_PARAM_IN, "UDP related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_UDP_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_UDP_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_UDP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_UDP_GET, SW_SEC_UDP, 4, SW_PARAM_IN, "UDP related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_UDP_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_ICMP4_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_ICMP4_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_ICMP4_SET, SW_SEC_ICMP4, 4, SW_PARAM_IN, "ICMP4 related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_ICMP4_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_ICMP4_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_ICMP4_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_ICMP4_GET, SW_SEC_ICMP4, 4, SW_PARAM_IN, "ICMP4 related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_ICMP4_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_ICMP6_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_ICMP6_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_ICMP6_SET, SW_SEC_ICMP6, 4, SW_PARAM_IN, "ICMP6 related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_ICMP6_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN, "NormVal"), - -#define SW_API_SEC_ICMP6_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_ICMP6_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_ICMP6_GET, SW_SEC_ICMP6, 4, SW_PARAM_IN, "ICMP6 related normalized item"), \ - SW_PARAM_DEF(SW_API_SEC_ICMP6_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "NormVal"), - -#define SW_API_SEC_L3_PARSER_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_L3_PARSER_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_L3_PARSER_CTRL_GET, SW_L3_PARSER, sizeof(fal_l3_excep_parser_ctrl), SW_PARAM_PTR|SW_PARAM_OUT, "L3Parser"), - -#define SW_API_SEC_L3_PARSER_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_L3_PARSER_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_L3_PARSER_CTRL_SET, SW_L3_PARSER, sizeof(fal_l3_excep_parser_ctrl), SW_PARAM_PTR|SW_PARAM_IN, "L3Parser"), - -#define SW_API_SEC_L4_PARSER_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_L4_PARSER_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_L4_PARSER_CTRL_GET, SW_L4_PARSER, sizeof(fal_l4_excep_parser_ctrl), SW_PARAM_PTR|SW_PARAM_OUT, "L4Parser"), - -#define SW_API_SEC_L4_PARSER_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_L4_PARSER_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_L4_PARSER_CTRL_SET, SW_L4_PARSER, sizeof(fal_l4_excep_parser_ctrl), SW_PARAM_PTR|SW_PARAM_IN, "L4Parser"), - -#define SW_API_SEC_EXP_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_SEC_EXP_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_EXP_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "ExpType"), \ - SW_PARAM_DEF(SW_API_SEC_EXP_CTRL_GET, SW_EXP_CTRL, sizeof(fal_l3_excep_ctrl_t), SW_PARAM_PTR|SW_PARAM_OUT, "ExpCtrl"), - -#define SW_API_SEC_EXP_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_SEC_EXP_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SEC_EXP_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "ExpType"), \ - SW_PARAM_DEF(SW_API_SEC_EXP_CTRL_SET, SW_EXP_CTRL, sizeof(fal_l3_excep_ctrl_t), SW_PARAM_PTR|SW_PARAM_IN, "ExpCtrl"), - -#define SW_API_IP_HOST_ADD_DESC \ - SW_PARAM_DEF(SW_API_IP_HOST_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_ADD, SW_IP_HOSTENTRY, sizeof(fal_host_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Hostentry"), - -#define SW_API_IP_HOST_DEL_DESC \ - SW_PARAM_DEF(SW_API_IP_HOST_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_DEL, SW_UINT32, 4, SW_PARAM_IN, "DelMode"), \ - SW_PARAM_DEF(SW_API_IP_HOST_DEL, SW_IP_HOSTENTRY, sizeof(fal_host_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Hostentry"), - -#define SW_API_IP_HOST_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_HOST_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_GET, SW_UINT32, 4, SW_PARAM_IN, "GetMode"), \ - SW_PARAM_DEF(SW_API_IP_HOST_GET, SW_IP_HOSTENTRY, sizeof(fal_host_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Hostentry"), - -#define SW_API_IP_HOST_NEXT_DESC \ - SW_PARAM_DEF(SW_API_IP_HOST_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_NEXT, SW_UINT32, 4, SW_PARAM_IN, "NextMode"), \ - SW_PARAM_DEF(SW_API_IP_HOST_NEXT, SW_IP_HOSTENTRY, sizeof(fal_host_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Hostentry"), - -#define SW_API_IP_HOST_COUNTER_BIND_DESC \ - SW_PARAM_DEF(SW_API_IP_HOST_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "EntryID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "CounterID"),\ - SW_PARAM_DEF(SW_API_IP_HOST_COUNTER_BIND, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_IP_HOST_PPPOE_BIND_DESC \ - SW_PARAM_DEF(SW_API_IP_HOST_PPPOE_BIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_PPPOE_BIND, SW_UINT32, 4, SW_PARAM_IN, "EntryID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_PPPOE_BIND, SW_UINT32, 4, SW_PARAM_IN, "PPPoEID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_PPPOE_BIND, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_IP_PT_ARP_LEARN_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_PT_ARP_LEARN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PT_ARP_LEARN_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IP_PT_ARP_LEARN_SET, SW_UINT32, 4, SW_PARAM_IN, "LearnStatus"), - -#define SW_API_IP_PT_ARP_LEARN_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_PT_ARP_LEARN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PT_ARP_LEARN_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IP_PT_ARP_LEARN_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "LearnStatus"), - -#define SW_API_IP_ARP_LEARN_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_ARP_LEARN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_ARP_LEARN_SET, SW_ARP_LEARNMODE, sizeof(fal_arp_learn_mode_t), SW_PARAM_IN, "LearnMode"), - -#define SW_API_IP_ARP_LEARN_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_ARP_LEARN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_ARP_LEARN_GET, SW_ARP_LEARNMODE, sizeof(fal_arp_learn_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "LearnMode"), - -#define SW_API_IP_SOURCE_GUARD_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_SOURCE_GUARD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_SOURCE_GUARD_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IP_SOURCE_GUARD_SET, SW_IP_GUARDMODE, sizeof(fal_source_guard_mode_t), SW_PARAM_IN, "GuardMode"), - -#define SW_API_IP_SOURCE_GUARD_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_SOURCE_GUARD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_SOURCE_GUARD_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IP_SOURCE_GUARD_GET, SW_IP_GUARDMODE, sizeof(fal_source_guard_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "GuardMode"), - -#define SW_API_IP_ARP_GUARD_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_ARP_GUARD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_ARP_GUARD_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IP_ARP_GUARD_SET, SW_IP_GUARDMODE, sizeof(fal_source_guard_mode_t), SW_PARAM_IN, "GuardMode"), - -#define SW_API_IP_ARP_GUARD_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_ARP_GUARD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_ARP_GUARD_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IP_ARP_GUARD_GET, SW_IP_GUARDMODE, sizeof(fal_source_guard_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "GuardMode"), - -#define SW_API_IP_ROUTE_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_ROUTE_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_ROUTE_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Status"), - -#define SW_API_IP_ROUTE_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_ROUTE_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_ROUTE_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_IP_INTF_ENTRY_ADD_DESC \ - SW_PARAM_DEF(SW_API_IP_INTF_ENTRY_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_INTF_ENTRY_ADD, SW_INTFMACENTRY, sizeof(fal_intf_mac_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Entry"), - -#define SW_API_IP_INTF_ENTRY_DEL_DESC \ - SW_PARAM_DEF(SW_API_IP_INTF_ENTRY_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_INTF_ENTRY_DEL, SW_UINT32, 4, SW_PARAM_IN, "Del Mode"), \ - SW_PARAM_DEF(SW_API_IP_INTF_ENTRY_DEL, SW_INTFMACENTRY, sizeof(fal_intf_mac_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Entry"), - -#define SW_API_IP_INTF_ENTRY_NEXT_DESC \ - SW_PARAM_DEF(SW_API_IP_INTF_ENTRY_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_INTF_ENTRY_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Next Mode"), \ - SW_PARAM_DEF(SW_API_IP_INTF_ENTRY_NEXT, SW_INTFMACENTRY, sizeof(fal_intf_mac_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Entry"), - -#define SW_API_IP_UNK_SOURCE_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_UNK_SOURCE_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_UNK_SOURCE_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "Forwarding"), - -#define SW_API_IP_UNK_SOURCE_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_UNK_SOURCE_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_UNK_SOURCE_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "Forwarding"), - -#define SW_API_ARP_UNK_SOURCE_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_ARP_UNK_SOURCE_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_ARP_UNK_SOURCE_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "Forwarding"), - -#define SW_API_ARP_UNK_SOURCE_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_ARP_UNK_SOURCE_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_ARP_UNK_SOURCE_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "Forwarding"), - -#define SW_API_IP_AGE_TIME_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_AGE_TIME_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_AGE_TIME_SET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Time"), - -#define SW_API_IP_AGE_TIME_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_AGE_TIME_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_AGE_TIME_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Time"), - -#define SW_API_WCMP_HASH_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_WCMP_HASH_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_WCMP_HASH_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Hash Mode"), - -#define SW_API_WCMP_HASH_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_WCMP_HASH_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_WCMP_HASH_MODE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Hash Mode"), - -#define SW_API_IP_VRF_BASE_ADDR_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_ADDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_ADDR_SET, SW_UINT32, 4, SW_PARAM_IN, "VRF ID"), \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_ADDR_SET, SW_IP4ADDR, sizeof(fal_ip4_addr_t), SW_PARAM_IN, "BaseAddr"), - -#define SW_API_IP_VRF_BASE_ADDR_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_ADDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_ADDR_GET, SW_UINT32, 4, SW_PARAM_IN, "VRF ID"), \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_ADDR_GET, SW_IP4ADDR, sizeof(fal_ip4_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "BaseAddr"), - -#define SW_API_IP_VRF_BASE_MASK_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_MASK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_MASK_SET, SW_UINT32, 4, SW_PARAM_IN, "VRF ID"), \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_MASK_SET, SW_IP4ADDR, sizeof(fal_ip4_addr_t), SW_PARAM_IN, "BaseMask"), - -#define SW_API_IP_VRF_BASE_MASK_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_MASK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_MASK_GET, SW_UINT32, 4, SW_PARAM_IN, "VRF ID"), \ - SW_PARAM_DEF(SW_API_IP_VRF_BASE_MASK_GET, SW_IP4ADDR, sizeof(fal_ip4_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "BaseMask"), - -#define SW_API_IP_DEFAULT_ROUTE_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_ROUTE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_ROUTE_SET, SW_UINT32, 4, SW_PARAM_IN, "DefaultRoute ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_ROUTE_SET, SW_DEFAULT_ROUTE_ENTRY, sizeof(fal_default_route_t), SW_PARAM_PTR|SW_PARAM_IN, "DefaultRoute"), - -#define SW_API_IP_DEFAULT_ROUTE_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_ROUTE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_ROUTE_GET, SW_UINT32, 4, SW_PARAM_IN, "DefaultRoute ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_ROUTE_GET, SW_DEFAULT_ROUTE_ENTRY, sizeof(fal_default_route_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "DefaultRoute"), - -#define SW_API_IP_HOST_ROUTE_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_HOST_ROUTE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_ROUTE_SET, SW_UINT32, 4, SW_PARAM_IN, "HostRoute ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_ROUTE_SET, SW_HOST_ROUTE_ENTRY, sizeof(fal_host_route_t), SW_PARAM_PTR|SW_PARAM_IN, "HostRoute"), - -#define SW_API_IP_HOST_ROUTE_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_HOST_ROUTE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_ROUTE_GET, SW_UINT32, 4, SW_PARAM_IN, "HostRoute ID"), \ - SW_PARAM_DEF(SW_API_IP_HOST_ROUTE_GET, SW_HOST_ROUTE_ENTRY, sizeof(fal_host_route_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "HostRoute"), - -#define SW_API_IP_WCMP_ENTRY_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_WCMP_ENTRY_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_WCMP_ENTRY_SET, SW_UINT32, 4, SW_PARAM_IN, "Wcmp ID"), \ - SW_PARAM_DEF(SW_API_IP_WCMP_ENTRY_SET, SW_IP_WCMP_ENTRY, sizeof(fal_ip_wcmp_t), SW_PARAM_PTR|SW_PARAM_IN, "WcmpEntry"), - -#define SW_API_IP_WCMP_ENTRY_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_WCMP_ENTRY_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_WCMP_ENTRY_GET, SW_UINT32, 4, SW_PARAM_IN, "Wcmp ID"), \ - SW_PARAM_DEF(SW_API_IP_WCMP_ENTRY_GET, SW_IP_WCMP_ENTRY, sizeof(fal_ip_wcmp_t), SW_PARAM_PTR|SW_PARAM_OUT, "WcmpEntry"), - -#define SW_API_IP_RFS_IP4_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_RFS_IP4_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_RFS_IP4_SET, SW_IP_RFS_IP4, sizeof(fal_ip4_rfs_t), SW_PARAM_PTR|SW_PARAM_IN, "RfsIp4"), - -#define SW_API_IP_RFS_IP6_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_RFS_IP6_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_RFS_IP6_SET, SW_IP_RFS_IP6, sizeof(fal_ip6_rfs_t), SW_PARAM_PTR|SW_PARAM_IN, "RfsIp6"), - -#define SW_API_IP_RFS_IP4_DEL_DESC \ - SW_PARAM_DEF(SW_API_IP_RFS_IP4_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_RFS_IP4_DEL, SW_IP_RFS_IP4, sizeof(fal_ip4_rfs_t), SW_PARAM_PTR|SW_PARAM_IN, "RfsIp4"), - -#define SW_API_IP_RFS_IP6_DEL_DESC \ - SW_PARAM_DEF(SW_API_IP_RFS_IP6_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_RFS_IP6_DEL, SW_IP_RFS_IP6, sizeof(fal_ip6_rfs_t), SW_PARAM_PTR|SW_PARAM_IN, "RfsIp6"), - -#define SW_API_IP_DEFAULT_FLOW_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_FLOW_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_FLOW_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Vrf ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_FLOW_CMD_SET, SW_FLOWTYPE, sizeof(fal_flow_type_t), SW_PARAM_IN, "FlowType"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_FLOW_CMD_SET, SW_FLOWCMD, sizeof(fal_default_flow_cmd_t), SW_PARAM_IN, "FlowCmd"), - -#define SW_API_IP_DEFAULT_FLOW_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_FLOW_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_FLOW_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Vrf ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_FLOW_CMD_GET, SW_FLOWTYPE, sizeof(fal_flow_type_t), SW_PARAM_IN, "FlowType"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_FLOW_CMD_GET, SW_FLOWCMD, sizeof(fal_default_flow_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "FlowCmd"), - -#define SW_API_IP_DEFAULT_RT_FLOW_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Vrf ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET, SW_FLOWTYPE, sizeof(fal_flow_type_t), SW_PARAM_IN, "FlowType"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET, SW_FLOWCMD, sizeof(fal_default_flow_cmd_t), SW_PARAM_IN, "FlowCmd"), - -#define SW_API_IP_DEFAULT_RT_FLOW_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Vrf ID"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET, SW_FLOWTYPE, sizeof(fal_flow_type_t), SW_PARAM_IN, "FlowType"), \ - SW_PARAM_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET, SW_FLOWCMD, sizeof(fal_default_flow_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "FlowCmd"), - -#define SW_API_IP_VIS_ARP_SG_CFG_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_VIS_ARP_SG_CFG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VIS_ARP_SG_CFG_GET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_IP_VIS_ARP_SG_CFG_GET, SW_ARP_SG_CFG, sizeof(fal_arp_sg_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "ArpSg"), - -#define SW_API_IP_VIS_ARP_SG_CFG_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_VIS_ARP_SG_CFG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VIS_ARP_SG_CFG_SET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_IP_VIS_ARP_SG_CFG_SET, SW_ARP_SG_CFG, sizeof(fal_arp_sg_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "ArpSg"), - -#define SW_API_IP_NETWORK_ROUTE_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_GET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_GET, SW_UINT8, 1, SW_PARAM_IN, "Type"), \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_GET, SW_IP_NETWORK_ROUTE, sizeof(fal_network_route_entry_t), SW_PARAM_PTR|SW_PARAM_OUT, "NetworkRoute"), - -#define SW_API_IP_NETWORK_ROUTE_ADD_DESC \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_ADD, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_ADD, SW_IP_NETWORK_ROUTE, sizeof(fal_network_route_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "NetworkRoute"), - -#define SW_API_IP_INTF_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_INTF_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_INTF_GET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_IP_INTF_GET, SW_IP_INTF, sizeof(fal_intf_entry_t), SW_PARAM_PTR|SW_PARAM_OUT, "INTF"), - -#define SW_API_IP_INTF_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_INTF_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_INTF_SET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_IP_INTF_SET, SW_IP_INTF, sizeof(fal_intf_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "INTF"), - -#define SW_API_IP_VSI_INTF_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_VSI_INTF_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VSI_INTF_GET, SW_UINT32, 4, SW_PARAM_IN, "vSI"), \ - SW_PARAM_DEF(SW_API_IP_VSI_INTF_GET, SW_IP_VSI_INTF, sizeof(fal_intf_id_t), SW_PARAM_PTR|SW_PARAM_OUT, "VsiIntf"), - -#define SW_API_IP_VSI_INTF_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_VSI_INTF_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VSI_INTF_SET, SW_UINT32, 4, SW_PARAM_IN, "Vsi"), \ - SW_PARAM_DEF(SW_API_IP_VSI_INTF_SET, SW_IP_VSI_INTF, sizeof(fal_intf_id_t), SW_PARAM_PTR|SW_PARAM_IN, "VsiIntf"), - -#define SW_API_IP_PORT_INTF_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_PORT_INTF_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_INTF_GET, SW_UINT32, 4, SW_PARAM_IN, "port"), \ - SW_PARAM_DEF(SW_API_IP_PORT_INTF_GET, SW_IP_VSI_INTF, sizeof(fal_intf_id_t), SW_PARAM_PTR|SW_PARAM_OUT, "PortIntf"), - -#define SW_API_IP_PORT_INTF_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_PORT_INTF_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_INTF_SET, SW_UINT32, 4, SW_PARAM_IN, "Port"), \ - SW_PARAM_DEF(SW_API_IP_PORT_INTF_SET, SW_IP_VSI_INTF, sizeof(fal_intf_id_t), SW_PARAM_PTR|SW_PARAM_IN, "PortIntf"), - -#define SW_API_IP_NEXTHOP_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_NEXTHOP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_NEXTHOP_GET, SW_UINT32, 4, SW_PARAM_IN, "index"), \ - SW_PARAM_DEF(SW_API_IP_NEXTHOP_GET, SW_IP_NEXTHOP, sizeof(fal_ip_nexthop_t), SW_PARAM_PTR|SW_PARAM_OUT, "Nexthop"), - -#define SW_API_IP_NEXTHOP_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_NEXTHOP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_NEXTHOP_SET, SW_UINT32, 4, SW_PARAM_IN, "index"), \ - SW_PARAM_DEF(SW_API_IP_NEXTHOP_SET, SW_IP_NEXTHOP, sizeof(fal_ip_nexthop_t), SW_PARAM_PTR|SW_PARAM_IN, "Nexthop"), - -#define SW_API_IP_VSI_SG_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_VSI_SG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VSI_SG_SET, SW_UINT32, 4, SW_PARAM_IN, "vsi"), \ - SW_PARAM_DEF(SW_API_IP_VSI_SG_SET, SW_IP_SG, sizeof(fal_sg_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "vsisg"), - -#define SW_API_IP_VSI_SG_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_VSI_SG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VSI_SG_GET, SW_UINT32, 4, SW_PARAM_IN, "vsi"), \ - SW_PARAM_DEF(SW_API_IP_VSI_SG_GET, SW_IP_SG, sizeof(fal_sg_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "vsisg"), - -#define SW_API_IP_PORT_SG_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_PORT_SG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_SG_SET, SW_UINT32, 4, SW_PARAM_IN, "port"), \ - SW_PARAM_DEF(SW_API_IP_PORT_SG_SET, SW_IP_SG, sizeof(fal_sg_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "portsg"), - -#define SW_API_IP_PORT_SG_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_PORT_SG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_SG_GET, SW_UINT32, 4, SW_PARAM_IN, "port"), \ - SW_PARAM_DEF(SW_API_IP_PORT_SG_GET, SW_IP_SG, sizeof(fal_sg_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "portsg"), - -#define SW_API_IP_PUB_IP_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_PUB_IP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PUB_IP_SET, SW_UINT32, 4, SW_PARAM_IN, "index"), \ - SW_PARAM_DEF(SW_API_IP_PUB_IP_SET, SW_IP_PUB, sizeof(fal_ip_pub_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "PubAdd"), - -#define SW_API_IP_NETWORK_ROUTE_DEL_DESC \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_DEL, SW_UINT32, 4, SW_PARAM_IN, "index"), \ - SW_PARAM_DEF(SW_API_IP_NETWORK_ROUTE_DEL, SW_UINT8, 1, SW_PARAM_IN, "type"), - -#define SW_API_IP_PUB_IP_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_PUB_IP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PUB_IP_GET, SW_UINT32, 4, SW_PARAM_IN, "index"), \ - SW_PARAM_DEF(SW_API_IP_PUB_IP_GET, SW_IP_PUB, sizeof(fal_ip_pub_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "PubGet"), - -#define SW_API_IP_PORT_MAC_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_PORT_MAC_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_MAC_GET, SW_UINT32, 4, SW_PARAM_IN, "port"), \ - SW_PARAM_DEF(SW_API_IP_PORT_MAC_GET, SW_IP_PORTMAC, sizeof(fal_macaddr_entry_t), SW_PARAM_PTR|SW_PARAM_OUT, "portmac"), - -#define SW_API_IP_PORT_MAC_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_PORT_MAC_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_MAC_SET, SW_UINT32, 4, SW_PARAM_IN, "port"), \ - SW_PARAM_DEF(SW_API_IP_PORT_MAC_SET, SW_IP_PORTMAC, sizeof(fal_macaddr_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "portmac"), - -#define SW_API_IP_ROUTE_MISS_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_ROUTE_MISS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_ROUTE_MISS_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "cmd"), - -#define SW_API_IP_ROUTE_MISS_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_ROUTE_MISS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_ROUTE_MISS_SET, SW_UINT32, 4, SW_PARAM_IN, "cmd"), - -#define SW_API_IP_PORT_ARP_SG_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_PORT_ARP_SG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_ARP_SG_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_ARP_SG_GET, SW_ARP_SG_CFG, sizeof(fal_arp_sg_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "portArpSg"), - -#define SW_API_IP_PORT_ARP_SG_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_PORT_ARP_SG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_ARP_SG_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_IP_PORT_ARP_SG_SET, SW_ARP_SG_CFG, sizeof(fal_arp_sg_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "portArpSg"), - -#define SW_API_IP_VSI_MC_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_IP_VSI_MC_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VSI_MC_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Vsi"), \ - SW_PARAM_DEF(SW_API_IP_VSI_MC_MODE_GET, SW_IP_MCMODE, sizeof(fal_mc_mode_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "mcmode"), - -#define SW_API_IP_VSI_MC_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_IP_VSI_MC_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_IP_VSI_MC_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Vsi"), \ - SW_PARAM_DEF(SW_API_IP_VSI_MC_MODE_SET, SW_IP_MCMODE, sizeof(fal_mc_mode_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "mcmode"), - -#define SW_API_GLOBAL_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_GLOBAL_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_GLOBAL_CTRL_SET, SW_IP_GLOBAL, sizeof(fal_ip_global_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "global"), - -#define SW_API_GLOBAL_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_GLOBAL_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_GLOBAL_CTRL_GET, SW_IP_GLOBAL, sizeof(fal_ip_global_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "global"), - -#define SW_API_FLOW_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "status"), - -#define SW_API_FLOW_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_STATUS_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "status"), - -#define SW_API_FLOW_AGE_TIMER_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_AGE_TIMER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_AGE_TIMER_SET, SW_FLOW_AGE, sizeof(fal_flow_age_timer_t), SW_PARAM_PTR|SW_PARAM_IN, "age"), - -#define SW_API_FLOW_AGE_TIMER_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_AGE_TIMER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_AGE_TIMER_GET, SW_FLOW_AGE, sizeof(fal_flow_age_timer_t), SW_PARAM_PTR|SW_PARAM_OUT, "age"), - -#define SW_API_FLOW_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "type"), \ - SW_PARAM_DEF(SW_API_FLOW_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "dir"), \ - SW_PARAM_DEF(SW_API_FLOW_CTRL_SET, SW_FLOW_CTRL, sizeof(fal_flow_mgmt_t), SW_PARAM_PTR|SW_PARAM_IN, "ctrl"), - -#define SW_API_FLOW_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "type"), \ - SW_PARAM_DEF(SW_API_FLOW_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "dir"), \ - SW_PARAM_DEF(SW_API_FLOW_CTRL_GET, SW_FLOW_CTRL, sizeof(fal_flow_mgmt_t), SW_PARAM_PTR|SW_PARAM_OUT, "ctrl"), - -#define SW_API_FLOW_ENTRY_ADD_DESC \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_ADD, SW_UINT32, 4, SW_PARAM_IN, "add mode"), \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_ADD, SW_FLOW_ENTRY, sizeof(fal_flow_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowentry"), - -#define SW_API_FLOW_ENTRY_DEL_DESC \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_DEL, SW_UINT32, 4, SW_PARAM_IN, "Del mode"), \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_DEL, SW_FLOW_ENTRY, sizeof(fal_flow_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Flowentry"), - -#define SW_API_FLOW_ENTRY_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_GET, SW_UINT32, 4, SW_PARAM_IN, "get mode"), \ - SW_PARAM_DEF(SW_API_FLOW_ENTRY_GET, SW_FLOW_ENTRY, sizeof(fal_flow_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowentry"), - -#define SW_API_FLOW_HOST_ADD_DESC \ - SW_PARAM_DEF(SW_API_FLOW_HOST_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_HOST_ADD, SW_UINT32, 4, SW_PARAM_IN, "add mode"), \ - SW_PARAM_DEF(SW_API_FLOW_HOST_ADD, SW_FLOW_HOST, sizeof(fal_flow_host_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowhost"), - -#define SW_API_FLOW_HOST_DEL_DESC \ - SW_PARAM_DEF(SW_API_FLOW_HOST_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_HOST_DEL, SW_UINT32, 4, SW_PARAM_IN, "Del mode"), \ - SW_PARAM_DEF(SW_API_FLOW_HOST_DEL, SW_FLOW_HOST, sizeof(fal_flow_host_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Flowhost"), - -#define SW_API_FLOW_HOST_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_HOST_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_HOST_GET, SW_UINT32, 4, SW_PARAM_IN, "get mode"), \ - SW_PARAM_DEF(SW_API_FLOW_HOST_GET, SW_FLOW_HOST, sizeof(fal_flow_host_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowhost"), - -#define SW_API_FLOW_GLOBAL_CFG_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_GLOBAL_CFG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_GLOBAL_CFG_GET, SW_FLOW_GLOBAL, sizeof(fal_flow_global_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "Flowglobal"), - -#define SW_API_FLOW_GLOBAL_CFG_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_GLOBAL_CFG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_GLOBAL_CFG_SET, SW_FLOW_GLOBAL, sizeof(fal_flow_global_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "Flowglobal"), - -#define SW_API_FLOWENTRY_NEXT_DESC \ - SW_PARAM_DEF(SW_API_FLOWENTRY_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOWENTRY_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Next mode"), \ - SW_PARAM_DEF(SW_API_FLOWENTRY_NEXT, SW_FLOW_ENTRY, sizeof(fal_flow_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowentry"), - -#define SW_API_NAT_ADD_DESC \ - SW_PARAM_DEF(SW_API_NAT_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_ADD, SW_NATENTRY, sizeof(fal_nat_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Natentry"), - -#define SW_API_NAT_DEL_DESC \ - SW_PARAM_DEF(SW_API_NAT_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_DEL, SW_UINT32, 4, SW_PARAM_IN, "DelMode"), \ - SW_PARAM_DEF(SW_API_NAT_DEL, SW_NATENTRY, sizeof(fal_nat_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Natentry"), - -#define SW_API_NAT_GET_DESC \ - SW_PARAM_DEF(SW_API_NAT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_GET, SW_UINT32, 4, SW_PARAM_IN, "GetMode"), \ - SW_PARAM_DEF(SW_API_NAT_GET, SW_NATENTRY, sizeof(fal_nat_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Natentry"), - -#define SW_API_NAT_NEXT_DESC \ - SW_PARAM_DEF(SW_API_NAT_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_NEXT, SW_UINT32, 4, SW_PARAM_IN, "NextMode"), \ - SW_PARAM_DEF(SW_API_NAT_NEXT, SW_NATENTRY, sizeof(fal_nat_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Natentry"), - -#define SW_API_NAT_COUNTER_BIND_DESC \ - SW_PARAM_DEF(SW_API_NAT_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "EntryID"), \ - SW_PARAM_DEF(SW_API_NAT_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "CounterID"),\ - SW_PARAM_DEF(SW_API_NAT_COUNTER_BIND, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_NAPT_ADD_DESC \ - SW_PARAM_DEF(SW_API_NAPT_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_ADD, SW_NAPTENTRY, sizeof(fal_napt_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Naptentry"), - -#define SW_API_NAPT_DEL_DESC \ - SW_PARAM_DEF(SW_API_NAPT_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_DEL, SW_UINT32, 4, SW_PARAM_IN, "DelMode"), \ - SW_PARAM_DEF(SW_API_NAPT_DEL, SW_NAPTENTRY, sizeof(fal_napt_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Naptentry"), - -#define SW_API_NAPT_GET_DESC \ - SW_PARAM_DEF(SW_API_NAPT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_GET, SW_UINT32, 4, SW_PARAM_IN, "GetMode"), \ - SW_PARAM_DEF(SW_API_NAPT_GET, SW_NAPTENTRY, sizeof(fal_napt_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Naptentry"), - -#define SW_API_NAPT_NEXT_DESC \ - SW_PARAM_DEF(SW_API_NAPT_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_NEXT, SW_UINT32, 4, SW_PARAM_IN, "NextMode"), \ - SW_PARAM_DEF(SW_API_NAPT_NEXT, SW_NAPTENTRY, sizeof(fal_napt_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Naptentry"), - -#define SW_API_NAPT_COUNTER_BIND_DESC \ - SW_PARAM_DEF(SW_API_NAPT_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "EntryID"), \ - SW_PARAM_DEF(SW_API_NAPT_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "CounterID"),\ - SW_PARAM_DEF(SW_API_NAPT_COUNTER_BIND, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_FLOW_ADD_DESC \ - SW_PARAM_DEF(SW_API_FLOW_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_ADD, SW_FLOWENTRY, sizeof(fal_napt_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowentry"), - -#define SW_API_FLOW_DEL_DESC \ - SW_PARAM_DEF(SW_API_FLOW_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_DEL, SW_UINT32, 4, SW_PARAM_IN, "DelMode"), \ - SW_PARAM_DEF(SW_API_FLOW_DEL, SW_FLOWENTRY, sizeof(fal_napt_entry_t), SW_PARAM_PTR|SW_PARAM_IN, "Flowentry"), - -#define SW_API_FLOW_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_GET, SW_UINT32, 4, SW_PARAM_IN, "GetMode"), \ - SW_PARAM_DEF(SW_API_FLOW_GET, SW_FLOWENTRY, sizeof(fal_napt_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowentry"), - -#define SW_API_FLOW_COOKIE_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_COOKIE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_COOKIE_SET, SW_FLOWCOOKIE, sizeof(fal_flow_cookie_t), SW_PARAM_PTR|SW_PARAM_IN, "Flowcookieentry"), - -#define SW_API_FLOW_RFS_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_RFS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_RFS_SET, SW_UINT32, 4, SW_PARAM_IN, "action"), \ - SW_PARAM_DEF(SW_API_FLOW_RFS_SET, SW_FLOWRFS, sizeof(fal_flow_rfs_t), SW_PARAM_PTR|SW_PARAM_IN, "Flowrfs"), - - -#define SW_API_FLOW_NEXT_DESC \ - SW_PARAM_DEF(SW_API_FLOW_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_NEXT, SW_UINT32, 4, SW_PARAM_IN, "NextMode"), \ - SW_PARAM_DEF(SW_API_FLOW_NEXT, SW_FLOWENTRY, sizeof(fal_napt_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowentry"), - -#define SW_API_FLOW_COUNTER_BIND_DESC \ - SW_PARAM_DEF(SW_API_FLOW_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "EntryID"), \ - SW_PARAM_DEF(SW_API_FLOW_COUNTER_BIND, SW_UINT32, 4, SW_PARAM_IN, "CounterID"),\ - SW_PARAM_DEF(SW_API_FLOW_COUNTER_BIND, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_NAT_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_NAT_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Status"), - -#define SW_API_NAT_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_NAT_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_NAT_HASH_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_NAT_HASH_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_HASH_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Hashmode"), - -#define SW_API_NAT_HASH_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_NAT_HASH_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_HASH_MODE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Hashmode"), - -#define SW_API_NAPT_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_NAPT_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_STATUS_SET, SW_ENABLE, 4, SW_PARAM_IN, "Status"), - -#define SW_API_NAPT_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_NAPT_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_NAPT_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_NAPT_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_MODE_SET, SW_NAPTMODE, sizeof(fal_napt_mode_t), SW_PARAM_IN, "Mode"), - -#define SW_API_NAPT_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_NAPT_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAPT_MODE_GET, SW_NAPTMODE, sizeof(fal_napt_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, "Mode"), - -#define SW_API_PRV_BASE_ADDR_SET_DESC \ - SW_PARAM_DEF(SW_API_PRV_BASE_ADDR_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PRV_BASE_ADDR_SET, SW_IP4ADDR, sizeof(fal_ip4_addr_t), SW_PARAM_IN, "BaseAddr"), - -#define SW_API_PRV_BASE_ADDR_GET_DESC \ - SW_PARAM_DEF(SW_API_PRV_BASE_ADDR_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PRV_BASE_ADDR_GET, SW_IP4ADDR, sizeof(fal_ip4_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "BaseAddr"), - -#define SW_API_PRV_ADDR_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PRV_ADDR_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PRV_ADDR_MODE_SET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_IN, "Mode"), - -#define SW_API_PRV_ADDR_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PRV_ADDR_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PRV_ADDR_MODE_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "Mode"), - -#define SW_API_PUB_ADDR_ENTRY_ADD_DESC \ - SW_PARAM_DEF(SW_API_PUB_ADDR_ENTRY_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PUB_ADDR_ENTRY_ADD, SW_PUBADDRENTRY, sizeof(fal_nat_pub_addr_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "PubAddrEntry"), - -#define SW_API_PUB_ADDR_ENTRY_DEL_DESC \ - SW_PARAM_DEF(SW_API_PUB_ADDR_ENTRY_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PUB_ADDR_ENTRY_DEL, SW_UINT32, 4, SW_PARAM_IN, "DelMode"), \ - SW_PARAM_DEF(SW_API_PUB_ADDR_ENTRY_DEL, SW_PUBADDRENTRY, sizeof(fal_nat_pub_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "PubAddrEntry"), - -#define SW_API_PUB_ADDR_ENTRY_NEXT_DESC \ - SW_PARAM_DEF(SW_API_PUB_ADDR_ENTRY_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PUB_ADDR_ENTRY_NEXT, SW_UINT32, 4, SW_PARAM_IN, "NextMode"), \ - SW_PARAM_DEF(SW_API_PUB_ADDR_ENTRY_NEXT, SW_PUBADDRENTRY, sizeof(fal_nat_pub_addr_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "PubAddrEntry"), - -#define SW_API_NAT_UNK_SESSION_CMD_SET_DESC \ - SW_PARAM_DEF(SW_API_NAT_UNK_SESSION_CMD_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_UNK_SESSION_CMD_SET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_IN, "Forwarding"), - -#define SW_API_NAT_UNK_SESSION_CMD_GET_DESC \ - SW_PARAM_DEF(SW_API_NAT_UNK_SESSION_CMD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_UNK_SESSION_CMD_GET, SW_MACCMD, sizeof(fal_fwd_cmd_t), SW_PARAM_PTR|SW_PARAM_OUT, "Forwarding"), - -#define SW_API_PRV_BASE_MASK_SET_DESC \ - SW_PARAM_DEF(SW_API_PRV_BASE_MASK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PRV_BASE_MASK_SET, SW_IP4ADDR, sizeof(fal_ip4_addr_t), SW_PARAM_IN, "BaseMask"), - -#define SW_API_PRV_BASE_MASK_GET_DESC \ - SW_PARAM_DEF(SW_API_PRV_BASE_MASK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PRV_BASE_MASK_GET, SW_IP4ADDR, sizeof(fal_ip4_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "BaseMask"), - -#define SW_API_NAT_GLOBAL_SET_DESC \ - SW_PARAM_DEF(SW_API_NAT_GLOBAL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_NAT_GLOBAL_SET, SW_ENABLE, 4, SW_PARAM_IN, "Status"), \ - SW_PARAM_DEF(SW_API_NAT_GLOBAL_SET, SW_ENABLE, 4, SW_PARAM_IN, "Sync Flow Counter"), \ - SW_PARAM_DEF(SW_API_NAT_GLOBAL_SET, SW_UINT32, 4, SW_PARAM_IN, "wan portbmp"), - -#define SW_API_TRUNK_GROUP_SET_DESC \ - SW_PARAM_DEF(SW_API_TRUNK_GROUP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_GROUP_SET, SW_UINT32, 4, SW_PARAM_IN, "Trunk ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_GROUP_SET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_IN, "Status"), \ - SW_PARAM_DEF(SW_API_TRUNK_GROUP_SET, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_IN, "Member Port Bitmap"), - -#define SW_API_TRUNK_GROUP_GET_DESC \ - SW_PARAM_DEF(SW_API_TRUNK_GROUP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_GROUP_GET, SW_UINT32, 4, SW_PARAM_IN, "Trunk ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_GROUP_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "Status"), \ - SW_PARAM_DEF(SW_API_TRUNK_GROUP_GET, SW_PBMP, sizeof(fal_pbmp_t), SW_PARAM_PTR|SW_PARAM_OUT, "Member Port Bitmap"), - -#define SW_API_TRUNK_HASH_SET_DESC \ - SW_PARAM_DEF(SW_API_TRUNK_HASH_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_HASH_SET, SW_UINT32, 4, SW_PARAM_IN, "Hash Mode"), - -#define SW_API_TRUNK_HASH_GET_DESC \ - SW_PARAM_DEF(SW_API_TRUNK_HASH_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_HASH_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Hash Mode"), - -#define SW_API_TRUNK_MAN_SA_SET_DESC \ - SW_PARAM_DEF(SW_API_TRUNK_MAN_SA_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_MAN_SA_SET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "[Manipulable SA]:"), - -#define SW_API_TRUNK_MAN_SA_GET_DESC \ - SW_PARAM_DEF(SW_API_TRUNK_MAN_SA_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_MAN_SA_GET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "[Manipulable SA]:"), - -#define SW_API_TRUNK_FAILOVER_EN_SET_DESC \ - SW_PARAM_DEF(SW_API_TRUNK_FAILOVER_EN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_FAILOVER_EN_SET, SW_ENABLE, 4, SW_PARAM_IN, "failover_en"), - -#define SW_API_TRUNK_FAILOVER_EN_GET_DESC \ - SW_PARAM_DEF(SW_API_TRUNK_FAILOVER_EN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_TRUNK_FAILOVER_EN_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "failover_en"), - -#define SW_API_MAC_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_MAC_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MAC_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_MAC_MODE_SET, SW_MACCONFIG, sizeof(fal_mac_config_t), SW_PARAM_PTR|SW_PARAM_IN, "MAC config"), - -#define SW_API_MAC_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_MAC_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MAC_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_MAC_MODE_GET, SW_MACCONFIG, sizeof(fal_mac_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "MAC config"), - -#define SW_API_PORT_3AZ_STATUS_SET_DESC \ - SW_PARAM_DEF(SW_API_PORT_3AZ_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_3AZ_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_3AZ_STATUS_SET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_IN, "Status"), - -#define SW_API_PORT_3AZ_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_PORT_3AZ_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_3AZ_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_3AZ_STATUS_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_PHY_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PHY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PHY_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Phy ID"), \ - SW_PARAM_DEF(SW_API_PHY_MODE_SET, SW_PHYCONFIG, sizeof(fal_phy_config_t), SW_PARAM_PTR|SW_PARAM_IN, "PHY config"), - -#define SW_API_PHY_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PHY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PHY_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Phy ID"), \ - SW_PARAM_DEF(SW_API_PHY_MODE_GET, SW_PHYCONFIG, sizeof(fal_phy_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "PHY config"), - -#define SW_API_FX100_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_FX100_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FX100_CTRL_SET, SW_FX100CONFIG, sizeof(fal_fx100_ctrl_config_t), SW_PARAM_PTR|SW_PARAM_IN, "fx100 config"), - -#define SW_API_FX100_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_FX100_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FX100_CTRL_GET, SW_FX100CONFIG, sizeof(fal_fx100_ctrl_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "fx100 config"), - -#define SW_API_FX100_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_FX100_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FX100_STATUS_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "fx100 status"), - - -#define SW_API_MAC06_EXCH_SET_DESC \ - SW_PARAM_DEF(SW_API_MAC06_EXCH_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MAC06_EXCH_SET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_IN, "enable"), - -#define SW_API_MAC06_EXCH_GET_DESC \ - SW_PARAM_DEF(SW_API_MAC06_EXCH_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MAC06_EXCH_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "enable"), - -#define SW_API_VSI_ALLOC_DESC \ - SW_PARAM_DEF(SW_API_VSI_ALLOC, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_ALLOC, SW_UINT32, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "VSI value"), - -#define SW_API_VSI_FREE_DESC \ - SW_PARAM_DEF(SW_API_VSI_FREE, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_FREE, SW_UINT32, 4, SW_PARAM_IN, "VSI value"), \ - -#define SW_API_PORT_VSI_SET_DESC \ - SW_PARAM_DEF(SW_API_PORT_VSI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_VSI_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_VSI_SET, SW_UINT32, 4, SW_PARAM_IN, "VSI value"), - -#define SW_API_PORT_VSI_GET_DESC \ - SW_PARAM_DEF(SW_API_PORT_VSI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_VSI_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_VSI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "VSI value"), - -#define SW_API_PORT_VLAN_VSI_SET_DESC \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_SET, SW_UINT32, 4, SW_PARAM_IN, "STAG VID"), \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_SET, SW_UINT32, 4, SW_PARAM_IN, "CTAG VID"), \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_SET, SW_UINT32, 4, SW_PARAM_IN, "VSI value"), - -#define SW_API_PORT_VLAN_VSI_GET_DESC \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_GET, SW_UINT32, 4, SW_PARAM_IN, "STAG VID"), \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_GET, SW_UINT32, 4, SW_PARAM_IN, "CTAG VID"), \ - SW_PARAM_DEF(SW_API_PORT_VLAN_VSI_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "VSI value"), - -#define SW_API_VSI_TBL_DUMP_DESC \ - SW_PARAM_DEF(SW_API_VSI_TBL_DUMP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - -#define SW_API_VSI_NEWADDR_LRN_GET_DESC \ - SW_PARAM_DEF(SW_API_VSI_NEWADDR_LRN_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_NEWADDR_LRN_GET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_VSI_NEWADDR_LRN_GET, SW_VSI_NEWADDR_LRN, sizeof(fal_vsi_newaddr_lrn_t), SW_PARAM_PTR|SW_PARAM_OUT, "newaddr_lrn"), - -#define SW_API_VSI_NEWADDR_LRN_SET_DESC \ - SW_PARAM_DEF(SW_API_VSI_NEWADDR_LRN_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_NEWADDR_LRN_SET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_VSI_NEWADDR_LRN_SET, SW_VSI_NEWADDR_LRN, sizeof(fal_vsi_newaddr_lrn_t), SW_PARAM_PTR|SW_PARAM_IN, "newaddr_lrn"), - -#define SW_API_VSI_STAMOVE_SET_DESC \ - SW_PARAM_DEF(SW_API_VSI_STAMOVE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_STAMOVE_SET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_VSI_STAMOVE_SET, SW_VSI_STAMOVE, sizeof(fal_vsi_stamove_t), SW_PARAM_PTR|SW_PARAM_IN, "stamove"), - -#define SW_API_VSI_STAMOVE_GET_DESC \ - SW_PARAM_DEF(SW_API_VSI_STAMOVE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_STAMOVE_GET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_VSI_STAMOVE_GET, SW_VSI_STAMOVE, sizeof(fal_vsi_stamove_t), SW_PARAM_PTR|SW_PARAM_OUT, "stamove"), - -#define SW_API_VSI_MEMBER_SET_DESC \ - SW_PARAM_DEF(SW_API_VSI_MEMBER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_MEMBER_SET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_VSI_MEMBER_SET, SW_VSI_MEMBER, sizeof(fal_vsi_member_t), SW_PARAM_PTR|SW_PARAM_IN, "members"), - -#define SW_API_VSI_MEMBER_GET_DESC \ - SW_PARAM_DEF(SW_API_VSI_MEMBER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_MEMBER_GET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_VSI_MEMBER_GET, SW_VSI_MEMBER, sizeof(fal_vsi_member_t), SW_PARAM_PTR|SW_PARAM_OUT, "members"), - -#define SW_API_VSI_COUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_VSI_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), \ - SW_PARAM_DEF(SW_API_VSI_COUNTER_GET, SW_VSI_COUNTER, sizeof(fal_vsi_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, "counter"), - -#define SW_API_VSI_COUNTER_CLEANUP_DESC \ - SW_PARAM_DEF(SW_API_VSI_COUNTER_CLEANUP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_VSI_COUNTER_CLEANUP, SW_UINT32, 4, SW_PARAM_IN, "VSI ID"), - -#define SW_API_UCAST_QUEUE_BASE_PROFILE_SET_DESC \ - SW_PARAM_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_SET, SW_UCAST_QUEUE_MAP, sizeof(fal_ucast_queue_dest_t), SW_PARAM_PTR|SW_PARAM_IN, "queue dest"), \ - SW_PARAM_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue base"), \ - SW_PARAM_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_SET, SW_UINT8, 1, SW_PARAM_IN, "Profile"), - -#define SW_API_UCAST_QUEUE_BASE_PROFILE_GET_DESC \ - SW_PARAM_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_GET, SW_UCAST_QUEUE_MAP, sizeof(fal_ucast_queue_dest_t), SW_PARAM_PTR|SW_PARAM_IN, "queue dest"), \ - SW_PARAM_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Queue base"), \ - SW_PARAM_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "Profile"), - -#define SW_API_UCAST_PRIORITY_CLASS_SET_DESC \ - SW_PARAM_DEF(SW_API_UCAST_PRIORITY_CLASS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UCAST_PRIORITY_CLASS_SET, SW_UINT8, 1, SW_PARAM_IN, "Profile"), \ - SW_PARAM_DEF(SW_API_UCAST_PRIORITY_CLASS_SET, SW_UINT8, 1, SW_PARAM_IN, "Priority"), \ - SW_PARAM_DEF(SW_API_UCAST_PRIORITY_CLASS_SET, SW_UINT8, 1, SW_PARAM_IN, "Class"), - -#define SW_API_UCAST_PRIORITY_CLASS_GET_DESC \ - SW_PARAM_DEF(SW_API_UCAST_PRIORITY_CLASS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UCAST_PRIORITY_CLASS_GET, SW_UINT8, 1, SW_PARAM_IN, "Profile"), \ - SW_PARAM_DEF(SW_API_UCAST_PRIORITY_CLASS_GET, SW_UINT8, 1, SW_PARAM_IN, "Priority"), \ - SW_PARAM_DEF(SW_API_UCAST_PRIORITY_CLASS_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "Class"), - -#define SW_API_UCAST_HASH_MAP_SET_DESC \ - SW_PARAM_DEF(SW_API_UCAST_HASH_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UCAST_HASH_MAP_SET, SW_UINT8, 1, SW_PARAM_IN, "Profile"), \ - SW_PARAM_DEF(SW_API_UCAST_HASH_MAP_SET, SW_UINT8, 1, SW_PARAM_IN, "Rss hash"), \ - SW_PARAM_DEF(SW_API_UCAST_HASH_MAP_SET, SW_UINT8, 1, SW_PARAM_IN, "Queue hash"), - -#define SW_API_UCAST_HASH_MAP_GET_DESC \ - SW_PARAM_DEF(SW_API_UCAST_HASH_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UCAST_HASH_MAP_GET, SW_UINT8, 1, SW_PARAM_IN, "Profile"), \ - SW_PARAM_DEF(SW_API_UCAST_HASH_MAP_GET, SW_UINT8, 1, SW_PARAM_IN, "Rss hash"), \ - SW_PARAM_DEF(SW_API_UCAST_HASH_MAP_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "Queue hash"), - -#define SW_API_MCAST_CPUCODE_CLASS_SET_DESC \ - SW_PARAM_DEF(SW_API_MCAST_CPUCODE_CLASS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MCAST_CPUCODE_CLASS_SET, SW_UINT8, 1, SW_PARAM_IN, "Cpu code"), \ - SW_PARAM_DEF(SW_API_MCAST_CPUCODE_CLASS_SET, SW_UINT8, 1, SW_PARAM_IN, "Queue Class"), - -#define SW_API_MCAST_CPUCODE_CLASS_GET_DESC \ - SW_PARAM_DEF(SW_API_MCAST_CPUCODE_CLASS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MCAST_CPUCODE_CLASS_GET, SW_UINT8, 1, SW_PARAM_IN, "Cpu code"), \ - SW_PARAM_DEF(SW_API_MCAST_CPUCODE_CLASS_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "Queue Class"), - -#define SW_API_MCAST_PRIORITY_CLASS_SET_DESC \ - SW_PARAM_DEF(SW_API_MCAST_PRIORITY_CLASS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MCAST_PRIORITY_CLASS_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_MCAST_PRIORITY_CLASS_SET, SW_UINT8, 1, SW_PARAM_IN, "Priority"), \ - SW_PARAM_DEF(SW_API_MCAST_PRIORITY_CLASS_SET, SW_UINT8, 1, SW_PARAM_IN, "Queue Class"), - -#define SW_API_MCAST_PRIORITY_CLASS_GET_DESC \ - SW_PARAM_DEF(SW_API_MCAST_PRIORITY_CLASS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MCAST_PRIORITY_CLASS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_MCAST_PRIORITY_CLASS_GET, SW_UINT8, 1, SW_PARAM_IN, "Priority"), \ - SW_PARAM_DEF(SW_API_MCAST_PRIORITY_CLASS_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "Queue Class"), - -#define SW_API_QUEUE_FLUSH_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_FLUSH, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_FLUSH, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_FLUSH, SW_UINT16, 2, SW_PARAM_IN, "queue ID"), - -#define SW_API_UCAST_DFLT_HASH_MAP_SET_DESC \ - SW_PARAM_DEF(SW_API_UCAST_DFLT_HASH_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UCAST_DFLT_HASH_MAP_SET, SW_UINT8, 1, SW_PARAM_IN, "ucast dflt hash"), - -#define SW_API_UCAST_DFLT_HASH_MAP_GET_DESC \ - SW_PARAM_DEF(SW_API_UCAST_DFLT_HASH_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_UCAST_DFLT_HASH_MAP_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "ucast dflt hash"), - -#define SW_API_AC_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_AC_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_AC_CTRL_SET, SW_AC_OBJ, sizeof(fal_ac_obj_t), SW_PARAM_PTR|SW_PARAM_IN, "ac obj"), \ - SW_PARAM_DEF(SW_API_AC_CTRL_SET, SW_AC_CTRL, sizeof(fal_ac_ctrl_t), SW_PARAM_PTR|SW_PARAM_IN, "ac ctrl"), - -#define SW_API_AC_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_AC_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_AC_CTRL_GET, SW_AC_OBJ, sizeof(fal_ac_obj_t), SW_PARAM_PTR|SW_PARAM_IN, "AC obj"), \ - SW_PARAM_DEF(SW_API_AC_CTRL_GET, SW_AC_CTRL, sizeof(fal_ac_ctrl_t), SW_PARAM_PTR|SW_PARAM_OUT, "ac ctrl"), - -#define SW_API_AC_PRE_BUFFER_SET_DESC \ - SW_PARAM_DEF(SW_API_AC_PRE_BUFFER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_AC_PRE_BUFFER_SET, SW_AC_OBJ, sizeof(fal_ac_obj_t), SW_PARAM_PTR|SW_PARAM_IN, "AC obj"), \ - SW_PARAM_DEF(SW_API_AC_PRE_BUFFER_SET, SW_UINT16, 2, SW_PARAM_IN, "num"), - -#define SW_API_AC_PRE_BUFFER_GET_DESC \ - SW_PARAM_DEF(SW_API_AC_PRE_BUFFER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_AC_PRE_BUFFER_GET, SW_AC_OBJ, sizeof(fal_ac_obj_t), SW_PARAM_PTR|SW_PARAM_IN, "AC obj"), \ - SW_PARAM_DEF(SW_API_AC_PRE_BUFFER_GET, SW_UINT16, 2, SW_PARAM_PTR|SW_PARAM_OUT, "num"), - -#define SW_API_QUEUE_GROUP_SET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_GROUP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_GROUP_SET, SW_UINT32, 4, SW_PARAM_IN, "queue id"), \ - SW_PARAM_DEF(SW_API_QUEUE_GROUP_SET, SW_UINT8, 1, SW_PARAM_IN, "group id"), - -#define SW_API_QUEUE_GROUP_GET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_GROUP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_GROUP_GET, SW_UINT32, 4, SW_PARAM_IN, "queue id"), \ - SW_PARAM_DEF(SW_API_QUEUE_GROUP_GET, SW_UINT8, 1, SW_PARAM_PTR|SW_PARAM_OUT, "group id"), - -#define SW_API_STATIC_THRESH_SET_DESC \ - SW_PARAM_DEF(SW_API_STATIC_THRESH_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_STATIC_THRESH_SET, SW_AC_OBJ, sizeof(fal_ac_obj_t), SW_PARAM_PTR|SW_PARAM_IN, "AC obj"), \ - SW_PARAM_DEF(SW_API_STATIC_THRESH_SET, SW_STATIC_THRESH, sizeof(fal_ac_static_threshold_t), SW_PARAM_PTR|SW_PARAM_IN, "static thresh"), - -#define SW_API_STATIC_THRESH_GET_DESC \ - SW_PARAM_DEF(SW_API_STATIC_THRESH_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_STATIC_THRESH_GET, SW_AC_OBJ, sizeof(fal_ac_obj_t), SW_PARAM_PTR|SW_PARAM_IN, "AC obj"), \ - SW_PARAM_DEF(SW_API_STATIC_THRESH_GET, SW_STATIC_THRESH, sizeof(fal_ac_static_threshold_t), SW_PARAM_PTR|SW_PARAM_OUT, "static thresh"), - -#define SW_API_DYNAMIC_THRESH_SET_DESC \ - SW_PARAM_DEF(SW_API_DYNAMIC_THRESH_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_DYNAMIC_THRESH_SET, SW_UINT32, 4, SW_PARAM_IN, "queue id"), \ - SW_PARAM_DEF(SW_API_DYNAMIC_THRESH_SET, SW_DYNAMIC_THRESH, sizeof(fal_ac_dynamic_threshold_t), SW_PARAM_PTR|SW_PARAM_IN, "dynamic thresh"), - -#define SW_API_DYNAMIC_THRESH_GET_DESC \ - SW_PARAM_DEF(SW_API_DYNAMIC_THRESH_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_DYNAMIC_THRESH_GET, SW_UINT32, 4, SW_PARAM_IN, "queue id"), \ - SW_PARAM_DEF(SW_API_DYNAMIC_THRESH_GET, SW_DYNAMIC_THRESH, sizeof(fal_ac_dynamic_threshold_t), SW_PARAM_PTR|SW_PARAM_OUT, "dynamic thresh"), - -#define SW_API_GOURP_BUFFER_SET_DESC \ - SW_PARAM_DEF(SW_API_GOURP_BUFFER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_GOURP_BUFFER_SET, SW_UINT8, 1, SW_PARAM_IN, "group"), \ - SW_PARAM_DEF(SW_API_GOURP_BUFFER_SET, SW_GROUP_BUFFER, sizeof(fal_ac_group_buffer_t), SW_PARAM_PTR|SW_PARAM_IN, "buffer cfg"), - -#define SW_API_GOURP_BUFFER_GET_DESC \ - SW_PARAM_DEF(SW_API_GOURP_BUFFER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_GOURP_BUFFER_GET, SW_UINT8, 1, SW_PARAM_IN, "group"), \ - SW_PARAM_DEF(SW_API_GOURP_BUFFER_GET, SW_GROUP_BUFFER, sizeof(fal_ac_group_buffer_t), SW_PARAM_PTR|SW_PARAM_OUT, "buffer cfg"), - -#define SW_API_QUEUE_CNT_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_CTRL_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "queue cnt en"), - -#define SW_API_QUEUE_CNT_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_CTRL_SET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_IN, "queue cnt en"), - -#define SW_API_QUEUE_CNT_CLEANUP_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_CLEANUP, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_CLEANUP, SW_UINT32, 4, SW_PARAM_IN, "queue id"), - -#define SW_API_QUEUE_CNT_GET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_GET, SW_UINT32, 4, SW_PARAM_IN, "queue ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_CNT_GET, SW_QM_CNT, sizeof(fal_queue_stats_t), SW_PARAM_PTR|SW_PARAM_OUT, "queue cnt"), - -#define SW_API_QM_ENQUEUE_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_QM_ENQUEUE_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QM_ENQUEUE_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "queue ID"), \ - SW_PARAM_DEF(SW_API_QM_ENQUEUE_CTRL_SET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_IN, "enqueue en"), - -#define SW_API_QM_ENQUEUE_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_QM_ENQUEUE_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QM_ENQUEUE_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "queue ID"), \ - SW_PARAM_DEF(SW_API_QM_ENQUEUE_CTRL_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "enqueue en"), - -#define SW_API_QM_SOURCE_PROFILE_SET_DESC \ - SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Source profile"), - -#define SW_API_QM_SOURCE_PROFILE_GET_DESC \ - SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Source profile"), - -#define SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET_DESC \ - SW_PARAM_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Profile ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Ethernet Type"), - -#define SW_API_MGMTCTRL_ETHTYPE_PROFILE_GET_DESC \ - SW_PARAM_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Profile ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Ethernet Type"), - -#define SW_API_MGMTCTRL_RFDB_PROFILE_SET_DESC \ - SW_PARAM_DEF(SW_API_MGMTCTRL_RFDB_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_RFDB_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Profile ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_RFDB_PROFILE_SET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "Address"), - -#define SW_API_MGMTCTRL_RFDB_PROFILE_GET_DESC \ - SW_PARAM_DEF(SW_API_MGMTCTRL_RFDB_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_RFDB_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Profile ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_RFDB_PROFILE_GET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "Address"), - -#define SW_API_MGMTCTRL_CTRLPKT_PROFILE_ADD_DESC \ - SW_PARAM_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_ADD, SW_CTRLPKT_PROFILE, sizeof(fal_ctrlpkt_profile_t), SW_PARAM_PTR|SW_PARAM_IN, "app entry"), - -#define SW_API_MGMTCTRL_CTRLPKT_PROFILE_DEL_DESC \ - SW_PARAM_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_DEL, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_DEL, SW_CTRLPKT_PROFILE, sizeof(fal_ctrlpkt_profile_t), SW_PARAM_PTR|SW_PARAM_IN, "app entry"), - -#define SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETFIRST_DESC \ - SW_PARAM_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETFIRST, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETFIRST, SW_CTRLPKT_PROFILE, sizeof(fal_ctrlpkt_profile_t), SW_PARAM_PTR|SW_PARAM_OUT, "app entry"), - -#define SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETNEXT_DESC \ - SW_PARAM_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETNEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETNEXT, SW_CTRLPKT_PROFILE, sizeof(fal_ctrlpkt_profile_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "app entry"), - - -#define SW_API_SERVCODE_CONFIG_SET_DESC \ - SW_PARAM_DEF(SW_API_SERVCODE_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SERVCODE_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_SERVCODE_CONFIG_SET, SW_SERVCODE_CONFIG, sizeof(fal_servcode_config_t), SW_PARAM_PTR|SW_PARAM_IN, "Servcode Config"), - -#define SW_API_SERVCODE_CONFIG_GET_DESC \ - SW_PARAM_DEF(SW_API_SERVCODE_CONFIG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SERVCODE_CONFIG_GET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_SERVCODE_CONFIG_GET, SW_SERVCODE_CONFIG, sizeof(fal_servcode_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "Servcode Config"), - -#define SW_API_SERVCODE_LOOPCHECK_EN_DESC \ - SW_PARAM_DEF(SW_API_SERVCODE_LOOPCHECK_EN, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SERVCODE_LOOPCHECK_EN, SW_ENABLE, 4, SW_PARAM_IN, "Enable"), - -#define SW_API_SERVCODE_LOOPCHECK_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_SERVCODE_LOOPCHECK_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SERVCODE_LOOPCHECK_STATUS_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Enable"), - -#define SW_API_POLICER_TIMESLOT_SET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Time Slot"), - -#define SW_API_POLICER_TIMESLOT_GET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_TIMESLOT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_TIMESLOT_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Time Slot"), - -#define SW_API_POLICER_PORT_COUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_PORT_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_PORT_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_POLICER_PORT_COUNTER_GET, SW_POLICER_COUNTER, sizeof(fal_policer_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, "Port Statistics"), - -#define SW_API_POLICER_ACL_COUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_ACL_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_ACL_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_POLICER_ACL_COUNTER_GET, SW_POLICER_COUNTER, sizeof(fal_policer_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, "ACL Statistics"), - -#define SW_API_POLICER_COMPENSATION_SET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_COMPENSATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_COMPENSATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_POLICER_COMPENSATION_SET, SW_UINT32, 4, SW_PARAM_IN, "Number"), - -#define SW_API_POLICER_COMPENSATION_GET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_COMPENSATION_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_COMPENSATION_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_POLICER_COMPENSATION_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Number"), - -#define SW_API_POLICER_PORT_ENTRY_SET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_PORT_ENTRY_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_PORT_ENTRY_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_POLICER_PORT_ENTRY_SET, SW_POLICER_PORT_CONFIG, sizeof(fal_policer_config_t), SW_PARAM_PTR|SW_PARAM_IN, "Port Config"), \ - SW_PARAM_DEF(SW_API_POLICER_PORT_ENTRY_SET, SW_POLICER_CMD_CONFIG, sizeof(fal_policer_action_t), SW_PARAM_PTR|SW_PARAM_IN, "CMD"), - -#define SW_API_POLICER_PORT_ENTRY_GET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_PORT_ENTRY_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_PORT_ENTRY_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_POLICER_PORT_ENTRY_GET, SW_POLICER_PORT_CONFIG, sizeof(fal_policer_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "Port Config"), \ - SW_PARAM_DEF(SW_API_POLICER_PORT_ENTRY_GET, SW_POLICER_CMD_CONFIG, sizeof(fal_policer_action_t), SW_PARAM_PTR|SW_PARAM_OUT, "CMD"), - -#define SW_API_POLICER_ACL_ENTRY_SET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_ACL_ENTRY_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_ACL_ENTRY_SET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_POLICER_ACL_ENTRY_SET, SW_POLICER_ACL_CONFIG, sizeof(fal_policer_config_t), SW_PARAM_PTR|SW_PARAM_IN, "ACL Config"), \ - SW_PARAM_DEF(SW_API_POLICER_ACL_ENTRY_SET, SW_POLICER_CMD_CONFIG, sizeof(fal_policer_action_t), SW_PARAM_PTR|SW_PARAM_IN, "CMD"), - -#define SW_API_POLICER_ACL_ENTRY_GET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_ACL_ENTRY_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_ACL_ENTRY_GET, SW_UINT32, 4, SW_PARAM_IN, "Index"), \ - SW_PARAM_DEF(SW_API_POLICER_ACL_ENTRY_GET, SW_POLICER_ACL_CONFIG, sizeof(fal_policer_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "ACL Config"), \ - SW_PARAM_DEF(SW_API_POLICER_ACL_ENTRY_GET, SW_POLICER_CMD_CONFIG, sizeof(fal_policer_action_t), SW_PARAM_PTR|SW_PARAM_OUT, "CMD"), - -#define SW_API_POLICER_GLOBAL_COUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_POLICER_GLOBAL_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_POLICER_GLOBAL_COUNTER_GET, SW_POLICER_GLOBAL_COUNTER, sizeof(fal_policer_global_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, "Global Statistics"), - -#define SW_API_PORT_SHAPER_TIMESLOT_SET_DESC \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Time Slot"), - -#define SW_API_PORT_SHAPER_TIMESLOT_GET_DESC \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TIMESLOT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TIMESLOT_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Time Slot"), - -#define SW_API_FLOW_SHAPER_TIMESLOT_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Time Slot"), - -#define SW_API_FLOW_SHAPER_TIMESLOT_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TIMESLOT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TIMESLOT_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Time Slot"), - -#define SW_API_QUEUE_SHAPER_TIMESLOT_SET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Time Slot"), - -#define SW_API_QUEUE_SHAPER_TIMESLOT_GET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TIMESLOT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TIMESLOT_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Time Slot"), - -#define SW_API_PORT_SHAPER_TOKEN_NUMBER_SET_DESC \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TOKEN_NUMBER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TOKEN_NUMBER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TOKEN_NUMBER_SET, SW_PORT_SHAPER_TOKEN_CONFIG, sizeof(fal_shaper_token_number_t), SW_PARAM_PTR|SW_PARAM_IN, "CONFIG"), - -#define SW_API_PORT_SHAPER_TOKEN_NUMBER_GET_DESC \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TOKEN_NUMBER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TOKEN_NUMBER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_TOKEN_NUMBER_GET, SW_PORT_SHAPER_TOKEN_CONFIG, sizeof(fal_shaper_token_number_t), SW_PARAM_PTR|SW_PARAM_OUT, "CONFIG"), - -#define SW_API_FLOW_SHAPER_TOKEN_NUMBER_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TOKEN_NUMBER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TOKEN_NUMBER_SET, SW_UINT32, 4, SW_PARAM_IN, "Flow ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TOKEN_NUMBER_SET, SW_SHAPER_TOKEN_CONFIG, sizeof(fal_shaper_token_number_t), SW_PARAM_PTR|SW_PARAM_IN, "CONFIG"), - -#define SW_API_FLOW_SHAPER_TOKEN_NUMBER_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TOKEN_NUMBER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TOKEN_NUMBER_GET, SW_UINT32, 4, SW_PARAM_IN, "Flow ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_TOKEN_NUMBER_GET, SW_SHAPER_TOKEN_CONFIG, sizeof(fal_shaper_token_number_t), SW_PARAM_PTR|SW_PARAM_OUT, "CONFIG"), - -#define SW_API_QUEUE_SHAPER_TOKEN_NUMBER_SET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_SET, SW_SHAPER_TOKEN_CONFIG, sizeof(fal_shaper_token_number_t), SW_PARAM_PTR|SW_PARAM_IN, "CONFIG"), - -#define SW_API_QUEUE_SHAPER_TOKEN_NUMBER_GET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_GET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_GET, SW_SHAPER_TOKEN_CONFIG, sizeof(fal_shaper_token_number_t), SW_PARAM_PTR|SW_PARAM_OUT, "CONFIG"), - -#define SW_API_PORT_SHAPER_SET_DESC \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_SET, SW_PORT_SHAPER_CONFIG, sizeof(fal_shaper_config_t), SW_PARAM_PTR|SW_PARAM_IN, "CONFIG"), - -#define SW_API_PORT_SHAPER_GET_DESC \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PORT_SHAPER_GET, SW_PORT_SHAPER_CONFIG, sizeof(fal_shaper_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "CONFIG"), - -#define SW_API_FLOW_SHAPER_SET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Flow ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_SET, SW_SHAPER_CONFIG, sizeof(fal_shaper_config_t), SW_PARAM_PTR|SW_PARAM_IN, "CONFIG"), - -#define SW_API_FLOW_SHAPER_GET_DESC \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Flow ID"), \ - SW_PARAM_DEF(SW_API_FLOW_SHAPER_GET, SW_SHAPER_CONFIG, sizeof(fal_shaper_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "CONFIG"), - -#define SW_API_QUEUE_SHAPER_SET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_SET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_SET, SW_SHAPER_CONFIG, sizeof(fal_shaper_config_t), SW_PARAM_PTR|SW_PARAM_IN, "CONFIG"), - -#define SW_API_QUEUE_SHAPER_GET_DESC \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_GET, SW_UINT32, 4, SW_PARAM_IN, "Queue ID"), \ - SW_PARAM_DEF(SW_API_QUEUE_SHAPER_GET, SW_SHAPER_CONFIG, sizeof(fal_shaper_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "CONFIG"), - -#define SW_API_SHAPER_IPG_PRE_SET_DESC \ - SW_PARAM_DEF(SW_API_SHAPER_IPG_PRE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SHAPER_IPG_PRE_SET, SW_UINT32, 4, SW_PARAM_IN, "IPG and Preamble"), - -#define SW_API_SHAPER_IPG_PRE_GET_DESC \ - SW_PARAM_DEF(SW_API_SHAPER_IPG_PRE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SHAPER_IPG_PRE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "IPG and Preamble"), - -#define SW_API_BM_CTRL_SET_DESC \ - SW_PARAM_DEF(SW_API_BM_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_CTRL_SET, SW_ENABLE, 4, SW_PARAM_IN, "bm ctrl"), - -#define SW_API_BM_CTRL_GET_DESC \ - SW_PARAM_DEF(SW_API_BM_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_CTRL_GET, SW_ENABLE, 4, SW_PARAM_PTR|SW_PARAM_OUT, "bm ctrl"), - -#define SW_API_BM_PORTGROUP_MAP_SET_DESC \ - SW_PARAM_DEF(SW_API_BM_PORTGROUP_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_PORTGROUP_MAP_SET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_PORTGROUP_MAP_SET, SW_UINT8, 4, SW_PARAM_IN, "group"), - -#define SW_API_BM_PORTGROUP_MAP_GET_DESC \ - SW_PARAM_DEF(SW_API_BM_PORTGROUP_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_PORTGROUP_MAP_GET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_PORTGROUP_MAP_GET, SW_UINT8, 4, \ - SW_PARAM_PTR|SW_PARAM_OUT, "group"), - -#define SW_API_BM_GROUP_BUFFER_SET_DESC \ - SW_PARAM_DEF(SW_API_BM_GROUP_BUFFER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_GROUP_BUFFER_SET, SW_UINT8, 1, SW_PARAM_IN, "group id"), \ - SW_PARAM_DEF(SW_API_BM_GROUP_BUFFER_SET, SW_UINT16, 2, SW_PARAM_IN, "buff num"), - -#define SW_API_BM_GROUP_BUFFER_GET_DESC \ - SW_PARAM_DEF(SW_API_BM_GROUP_BUFFER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_GROUP_BUFFER_GET, SW_UINT8, 1, SW_PARAM_IN, "group id"), \ - SW_PARAM_DEF(SW_API_BM_GROUP_BUFFER_GET, SW_UINT16, 2, \ - SW_PARAM_PTR|SW_PARAM_OUT, "buff num"), - -#define SW_API_BM_PORT_RSVBUFFER_SET_DESC \ - SW_PARAM_DEF(SW_API_BM_PORT_RSVBUFFER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_PORT_RSVBUFFER_SET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_PORT_RSVBUFFER_SET, SW_UINT16, 2, SW_PARAM_IN, "prealloc buff"), \ - SW_PARAM_DEF(SW_API_BM_PORT_RSVBUFFER_SET, SW_UINT16, 2, SW_PARAM_IN, "react buff"), - -#define SW_API_BM_PORT_RSVBUFFER_GET_DESC \ - SW_PARAM_DEF(SW_API_BM_PORT_RSVBUFFER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_PORT_RSVBUFFER_GET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_PORT_RSVBUFFER_GET, SW_UINT16, 2, \ - SW_PARAM_PTR|SW_PARAM_OUT, "prealloc num"), \ - SW_PARAM_DEF(SW_API_BM_PORT_RSVBUFFER_GET, SW_UINT16, 2, \ - SW_PARAM_PTR|SW_PARAM_OUT, "react num"), - -#define SW_API_BM_STATIC_THRESH_SET_DESC \ - SW_PARAM_DEF(SW_API_BM_STATIC_THRESH_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_STATIC_THRESH_SET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_STATIC_THRESH_SET, SW_BMSTHRESH, sizeof(fal_bm_static_cfg_t), \ - SW_PARAM_PTR|SW_PARAM_IN, \ - "static thresh"), - -#define SW_API_BM_STATIC_THRESH_GET_DESC \ - SW_PARAM_DEF(SW_API_BM_STATIC_THRESH_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_STATIC_THRESH_GET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_STATIC_THRESH_GET, SW_BMSTHRESH, \ - sizeof(fal_bm_static_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "static thresh"), - -#define SW_API_BM_DYNAMIC_THRESH_SET_DESC \ - SW_PARAM_DEF(SW_API_BM_DYNAMIC_THRESH_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_DYNAMIC_THRESH_SET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_DYNAMIC_THRESH_SET, SW_BMDTHRESH, \ - sizeof(fal_bm_dynamic_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, \ - "dynamic thresh"), - -#define SW_API_BM_DYNAMIC_THRESH_GET_DESC \ - SW_PARAM_DEF(SW_API_BM_DYNAMIC_THRESH_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_DYNAMIC_THRESH_GET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_DYNAMIC_THRESH_GET, SW_BMDTHRESH, \ - sizeof(fal_bm_dynamic_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "dynamic thresh"), - -#define SW_API_BM_PORT_COUNTER_GET_DESC \ - SW_PARAM_DEF(SW_API_BM_PORT_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_BM_PORT_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \ - SW_PARAM_DEF(SW_API_BM_PORT_COUNTER_GET, SW_BMPORTCNT, \ - sizeof(fal_bm_port_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "port counter"), - - -#define SW_API_PTP_CONFIG_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_CONFIG_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_CONFIG_SET, SW_PTP_CONFIG, \ - sizeof(fal_ptp_config_t), SW_PARAM_PTR|SW_PARAM_IN, "CONFIG"), - -#define SW_API_PTP_CONFIG_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_CONFIG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_CONFIG_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_CONFIG_GET, SW_PTP_CONFIG, \ - sizeof(fal_ptp_config_t), SW_PARAM_PTR|SW_PARAM_OUT, "CONFIG"), - -#define SW_API_PTP_REFERENCE_CLOCK_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_REFERENCE_CLOCK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_REFERENCE_CLOCK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_REFERENCE_CLOCK_SET, SW_PTP_REFERENCE_CLOCK, \ - sizeof(fal_ptp_reference_clock_t), SW_PARAM_IN, "Ref Clock"), - -#define SW_API_PTP_REFERENCE_CLOCK_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_REFERENCE_CLOCK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_REFERENCE_CLOCK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_REFERENCE_CLOCK_GET, SW_PTP_REFERENCE_CLOCK, \ - sizeof(fal_ptp_reference_clock_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Ref Clock"), - -#define SW_API_PTP_RX_TIMESTAMP_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RX_TIMESTAMP_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RX_TIMESTAMP_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RX_TIMESTAMP_MODE_SET, SW_PTP_RX_TIMESTAMP_MODE, \ - sizeof(fal_ptp_rx_timestamp_mode_t), SW_PARAM_IN, "Timestamp Mode"), - -#define SW_API_PTP_RX_TIMESTAMP_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RX_TIMESTAMP_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RX_TIMESTAMP_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RX_TIMESTAMP_MODE_GET, SW_PTP_RX_TIMESTAMP_MODE, \ - sizeof(fal_ptp_rx_timestamp_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Timestamp Mode"), - -#define SW_API_PTP_TIMESTAMP_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_TIMESTAMP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_TIMESTAMP_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_TIMESTAMP_GET, SW_PTP_DIRECTION, \ - sizeof(fal_ptp_direction_t), SW_PARAM_IN, "Direction"), \ - SW_PARAM_DEF(SW_API_PTP_TIMESTAMP_GET, SW_PTP_PKT_INFO, \ - sizeof(fal_ptp_pkt_info_t), SW_PARAM_PTR|SW_PARAM_IN, "Pkt Info"), \ - SW_PARAM_DEF(SW_API_PTP_TIMESTAMP_GET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_OUT, "Time"), - -#define SW_API_PTP_PKT_TIMESTAMP_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_PKT_TIMESTAMP_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_PKT_TIMESTAMP_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_PKT_TIMESTAMP_SET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_IN, "Time"), - -#define SW_API_PTP_PKT_TIMESTAMP_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_PKT_TIMESTAMP_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_PKT_TIMESTAMP_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_PKT_TIMESTAMP_GET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_OUT, "Time"), - -#define SW_API_PTP_GRANDMASTER_MODE_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_GRANDMASTER_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_GRANDMASTER_MODE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_GRANDMASTER_MODE_SET, SW_PTP_GRANDMASTER_MODE, \ - sizeof(fal_ptp_grandmaster_mode_t), SW_PARAM_PTR|SW_PARAM_IN, \ - "Grandmaster Mode"), - -#define SW_API_PTP_GRANDMASTER_MODE_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_GRANDMASTER_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_GRANDMASTER_MODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_GRANDMASTER_MODE_GET, SW_PTP_GRANDMASTER_MODE, \ - sizeof(fal_ptp_grandmaster_mode_t), SW_PARAM_PTR|SW_PARAM_OUT, \ - "Grandmaster Mode"), - -#define SW_API_PTP_RTC_TIME_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_IN, "Time"), - -#define SW_API_PTP_RTC_TIME_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_GET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_OUT, "Time"), - -#define SW_API_PTP_RTC_TIME_CLEAR_DESC \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_CLEAR, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_CLEAR, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), - -#define SW_API_PTP_RTC_ADJTIME_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJTIME_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJTIME_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJTIME_SET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_IN, "Time"), - -#define SW_API_PTP_RTC_ADJFREQ_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJFREQ_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJFREQ_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJFREQ_SET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_IN, "Time"), - -#define SW_API_PTP_RTC_ADJFREQ_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJFREQ_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJFREQ_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_ADJFREQ_GET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_OUT, "Time"), - -#define SW_API_PTP_LINK_DELAY_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_LINK_DELAY_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_LINK_DELAY_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_LINK_DELAY_SET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_IN, "Time"), - -#define SW_API_PTP_LINK_DELAY_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_LINK_DELAY_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_LINK_DELAY_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_LINK_DELAY_GET, SW_PTP_TIME, \ - sizeof(fal_ptp_time_t), SW_PARAM_PTR|SW_PARAM_OUT, "Time"), - -#define SW_API_PTP_SECURITY_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_SECURITY_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_SECURITY_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_SECURITY_SET, SW_PTP_SECURITY, \ - sizeof(fal_ptp_security_t), SW_PARAM_PTR|SW_PARAM_IN, "Security"), - -#define SW_API_PTP_SECURITY_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_SECURITY_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_SECURITY_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_SECURITY_GET, SW_PTP_SECURITY, \ - sizeof(fal_ptp_security_t), SW_PARAM_PTR|SW_PARAM_OUT, "Security"), - -#define SW_API_PTP_PPS_SIGNAL_CONTROL_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_PPS_SIGNAL_CONTROL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_PPS_SIGNAL_CONTROL_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_PPS_SIGNAL_CONTROL_SET, SW_PTP_PPS_SIGNAL_CONTROL, \ - sizeof(fal_ptp_pps_signal_control_t), SW_PARAM_PTR|SW_PARAM_IN, "Sig Ctrl"), - -#define SW_API_PTP_PPS_SIGNAL_CONTROL_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_PPS_SIGNAL_CONTROL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_PPS_SIGNAL_CONTROL_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_PPS_SIGNAL_CONTROL_GET, SW_PTP_PPS_SIGNAL_CONTROL, \ - sizeof(fal_ptp_pps_signal_control_t), SW_PARAM_PTR|SW_PARAM_OUT, "Sig Ctrl"), - -#define SW_API_PTP_RX_CRC_RECALC_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RX_CRC_RECALC_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RX_CRC_RECALC_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RX_CRC_RECALC_SET, SW_ENABLE, \ - sizeof(a_bool_t), SW_PARAM_IN, "Status"), - -#define SW_API_PTP_RX_CRC_RECALC_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RX_CRC_RECALC_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RX_CRC_RECALC_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RX_CRC_RECALC_GET, SW_ENABLE, \ - sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_PTP_ASYM_CORRECTION_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_ASYM_CORRECTION_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_ASYM_CORRECTION_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_ASYM_CORRECTION_SET, SW_PTP_ASYM_CORRECTION, \ - sizeof(fal_ptp_asym_correction_t), SW_PARAM_PTR|SW_PARAM_IN, "Asym CF"), - -#define SW_API_PTP_ASYM_CORRECTION_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_ASYM_CORRECTION_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_ASYM_CORRECTION_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_ASYM_CORRECTION_GET, SW_PTP_ASYM_CORRECTION, \ - sizeof(fal_ptp_asym_correction_t), SW_PARAM_PTR|SW_PARAM_OUT, "Asym CF"), - -#define SW_API_PTP_OUTPUT_WAVEFORM_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_OUTPUT_WAVEFORM_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_OUTPUT_WAVEFORM_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_OUTPUT_WAVEFORM_SET, SW_PTP_OUTPUT_WAVEFORM, \ - sizeof(fal_ptp_output_waveform_t), SW_PARAM_PTR|SW_PARAM_IN, "Waveform"), - -#define SW_API_PTP_OUTPUT_WAVEFORM_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_OUTPUT_WAVEFORM_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_OUTPUT_WAVEFORM_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_OUTPUT_WAVEFORM_GET, SW_PTP_OUTPUT_WAVEFORM, \ - sizeof(fal_ptp_output_waveform_t), SW_PARAM_PTR|SW_PARAM_OUT, "Waveform"), - -#define SW_API_PTP_RTC_TIME_SNAPSHOT_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SNAPSHOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SNAPSHOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SNAPSHOT_SET, SW_ENABLE, \ - sizeof(a_bool_t), SW_PARAM_IN, "Status"), - -#define SW_API_PTP_RTC_TIME_SNAPSHOT_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SNAPSHOT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SNAPSHOT_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_RTC_TIME_SNAPSHOT_GET, SW_ENABLE, \ - sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_SET, SW_ENABLE, \ - sizeof(a_bool_t), SW_PARAM_IN, "Status"), - -#define SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_GET, SW_ENABLE, \ - sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "Status"), - -#define SW_API_PTP_TOD_UART_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_TOD_UART_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_TOD_UART_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_TOD_UART_SET, SW_PTP_TOD_UART, \ - sizeof(fal_ptp_tod_uart_t), SW_PARAM_PTR|SW_PARAM_IN, "TOD UART"), - -#define SW_API_PTP_TOD_UART_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_TOD_UART_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_TOD_UART_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_TOD_UART_GET, SW_PTP_TOD_UART, \ - sizeof(fal_ptp_tod_uart_t), SW_PARAM_PTR|SW_PARAM_OUT, "TOD UART"), - -#define SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET, SW_PTP_DIRECTION, \ - sizeof(fal_ptp_direction_t), SW_PARAM_IN, "Direction"), \ - SW_PARAM_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET, SW_PTP_ENHANCED_TS_ENGINE, \ - sizeof(fal_ptp_enhanced_ts_engine_t), SW_PARAM_PTR|SW_PARAM_IN, "TS Engine"), - -#define SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET, \ - SW_PTP_DIRECTION, sizeof(fal_ptp_direction_t), SW_PARAM_IN, "Direction"), \ - SW_PARAM_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET, SW_PTP_ENHANCED_TS_ENGINE, \ - sizeof(fal_ptp_enhanced_ts_engine_t), SW_PARAM_PTR|SW_PARAM_OUT, "TS Engine"), - -#define SW_API_PTP_TRIGGER_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_TRIGGER_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_TRIGGER_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_TRIGGER_SET, SW_UINT32, 4, SW_PARAM_IN, "Trigger ID"), \ - SW_PARAM_DEF(SW_API_PTP_TRIGGER_SET, SW_PTP_TRIGGER, \ - sizeof(fal_ptp_trigger_t), SW_PARAM_PTR|SW_PARAM_IN, "Trigger"), - -#define SW_API_PTP_TRIGGER_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_TRIGGER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_TRIGGER_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_TRIGGER_GET, SW_UINT32, 4, SW_PARAM_IN, "Trigger ID"), \ - SW_PARAM_DEF(SW_API_PTP_TRIGGER_GET, SW_PTP_TRIGGER, \ - sizeof(fal_ptp_trigger_t), SW_PARAM_PTR|SW_PARAM_OUT, "Trigger"), - -#define SW_API_PTP_CAPTURE_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_CAPTURE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_CAPTURE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_CAPTURE_SET, SW_UINT32, 4, SW_PARAM_IN, "Capture ID"), \ - SW_PARAM_DEF(SW_API_PTP_CAPTURE_SET, SW_PTP_CAPTURE, \ - sizeof(fal_ptp_capture_t), SW_PARAM_PTR|SW_PARAM_IN, "Capture"), - -#define SW_API_PTP_CAPTURE_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_CAPTURE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_CAPTURE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_CAPTURE_GET, SW_UINT32, 4, SW_PARAM_IN, "Capture ID"), \ - SW_PARAM_DEF(SW_API_PTP_CAPTURE_GET, SW_PTP_CAPTURE, \ - sizeof(fal_ptp_capture_t), SW_PARAM_PTR|SW_PARAM_OUT, "Capture"), - -#define SW_API_PTP_INTERRUPT_SET_DESC \ - SW_PARAM_DEF(SW_API_PTP_INTERRUPT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_INTERRUPT_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_INTERRUPT_SET, SW_PTP_INTERRUPT, \ - sizeof(fal_ptp_interrupt_t), SW_PARAM_PTR|SW_PARAM_IN, "Interrupt"), - -#define SW_API_PTP_INTERRUPT_GET_DESC \ - SW_PARAM_DEF(SW_API_PTP_INTERRUPT_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_PTP_INTERRUPT_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_PTP_INTERRUPT_GET, SW_PTP_INTERRUPT, \ - sizeof(fal_ptp_interrupt_t), SW_PARAM_PTR|SW_PARAM_OUT, "Interrupt"), - -#define SW_API_SFP_DATA_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_DATA_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_SFP_DATA_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_DATA_GET, SW_SFP_DATA, \ - sizeof(fal_sfp_data_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Data"), - -#define SW_API_SFP_DATA_SET_DESC \ - SW_PARAM_DEF(SW_API_SFP_DATA_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),\ - SW_PARAM_DEF(SW_API_SFP_DATA_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_DATA_SET, SW_SFP_DATA, \ - sizeof(fal_sfp_data_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Data"), - -#define SW_API_SFP_DEV_TYPE_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_DEV_TYPE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_DEV_TYPE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_DEV_TYPE_GET, SW_SFP_DEV_TYPE, \ - sizeof(fal_sfp_dev_type_t), SW_PARAM_PTR|SW_PARAM_OUT, "Device Type"), - -#define SW_API_SFP_TRANSC_CODE_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_TRANSC_CODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_TRANSC_CODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_TRANSC_CODE_GET, SW_SFP_TRANSC_CODE, \ - sizeof(fal_sfp_transc_code_t), SW_PARAM_PTR|SW_PARAM_OUT, "Transceiver Code"), - -#define SW_API_SFP_RATE_ENCODE_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_RATE_ENCODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_RATE_ENCODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_RATE_ENCODE_GET, SW_SFP_RATE_ENCODE, \ - sizeof(fal_sfp_rate_encode_t), SW_PARAM_PTR|SW_PARAM_OUT, "Rate Encode"), - -#define SW_API_SFP_LINK_LENGTH_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_LINK_LENGTH_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_LINK_LENGTH_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_LINK_LENGTH_GET, SW_SFP_LINK_LENGTH, \ - sizeof(fal_sfp_link_length_t), SW_PARAM_PTR|SW_PARAM_OUT, "Link Length"), - -#define SW_API_SFP_VENDOR_INFO_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_VENDOR_INFO_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_VENDOR_INFO_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_VENDOR_INFO_GET, SW_SFP_VENDOR_INFO, \ - sizeof(fal_sfp_vendor_info_t), SW_PARAM_PTR|SW_PARAM_OUT, "Vendor Info"), - -#define SW_API_SFP_LASER_WAVELENGTH_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_LASER_WAVELENGTH_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_LASER_WAVELENGTH_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_LASER_WAVELENGTH_GET, SW_SFP_LASER_WAVELENGTH, \ - sizeof(fal_sfp_laser_wavelength_t), SW_PARAM_PTR|SW_PARAM_OUT, "Wave Length"), - -#define SW_API_SFP_OPTION_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_OPTION_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_OPTION_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_OPTION_GET, SW_SFP_OPTION, \ - sizeof(fal_sfp_option_t), SW_PARAM_PTR|SW_PARAM_OUT, "Option"), - -#define SW_API_SFP_CTRL_RATE_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_CTRL_RATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_CTRL_RATE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_CTRL_RATE_GET, SW_SFP_CTRL_RATE, \ - sizeof(fal_sfp_rate_t), SW_PARAM_PTR|SW_PARAM_OUT, "Control Rate"), - -#define SW_API_SFP_ENHANCED_CFG_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_ENHANCED_CFG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_ENHANCED_CFG_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_ENHANCED_CFG_GET, SW_SFP_ENHANCED_CFG, \ - sizeof(fal_sfp_enhanced_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "Enhanced Config"), - -#define SW_API_SFP_DIAG_THRESHOLD_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_DIAG_THRESHOLD_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_THRESHOLD_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_THRESHOLD_GET, SW_SFP_DIAG_THRESHOLD, \ - sizeof(fal_sfp_internal_threshold_t), SW_PARAM_PTR|SW_PARAM_OUT, "Threshold"), - -#define SW_API_SFP_DIAG_CAL_CONST_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_DIAG_CAL_CONST_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_CAL_CONST_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_CAL_CONST_GET, SW_SFP_DIAG_CAL_CONST, \ - sizeof(fal_sfp_cal_const_t), SW_PARAM_PTR|SW_PARAM_OUT, "Calibration"), - -#define SW_API_SFP_DIAG_REALTIME_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_DIAG_REALTIME_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_REALTIME_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_REALTIME_GET, SW_SFP_DIAG_REALTIME, \ - sizeof(fal_sfp_realtime_diag_t), SW_PARAM_PTR|SW_PARAM_OUT, "Realtime Diag"), - -#define SW_API_SFP_DIAG_CTRL_STATUS_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_DIAG_CTRL_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_CTRL_STATUS_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_CTRL_STATUS_GET, SW_SFP_CTRL_STATUS, \ - sizeof(fal_sfp_ctrl_status_t), SW_PARAM_PTR|SW_PARAM_OUT, "Control Status"), - -#define SW_API_SFP_DIAG_ALARM_WARN_FLAG_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_DIAG_ALARM_WARN_FLAG_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_ALARM_WARN_FLAG_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_DIAG_ALARM_WARN_FLAG_GET, SW_SFP_ALARM_WARN_FLAG, \ - sizeof(fal_sfp_alarm_warn_flag_t), SW_PARAM_PTR|SW_PARAM_OUT, "A/W Flag"), - -#define SW_API_SFP_CHECKCODE_GET_DESC \ - SW_PARAM_DEF(SW_API_SFP_CHECKCODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SFP_CHECKCODE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \ - SW_PARAM_DEF(SW_API_SFP_CHECKCODE_GET, SW_SFP_CCODE_TYPE, \ - sizeof(fal_sfp_cc_type_t), SW_PARAM_IN, "Check Code Type"), \ - SW_PARAM_DEF(SW_API_SFP_CHECKCODE_GET, SW_UINT8, \ - sizeof(a_uint8_t), SW_PARAM_PTR|SW_PARAM_OUT, "Check Code"), - -/*qca808x_start*/ -#define SW_API_DESC(api_id) api_id##_DESC - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _API_DESC_H_ */ -/*qca808x_end*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/api/sw_api.h b/feeds/ipq807x/qca-ssdk-shell/src/include/api/sw_api.h deleted file mode 100755 index 4717a6f03..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/api/sw_api.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _SW_API_H -#define _SW_API_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "sw.h" -#include "sw_ioctl.h" - -#define SW_MAX_API_BUF 2048 -#define SW_MAX_API_PARAM 12 /* cmd type + return value + ten parameters */ -#define SW_MAX_PAYLOAD (SW_MAX_API_PARAM << 2) /* maximum payload size for netlink msg*/ -#define SW_PARAM_IN 0x1 -#define SW_PARAM_OUT 0x2 -#define SW_PARAM_PTR 0x4 - -#define SW_API_DEF(ioctl, name) {ioctl, name} -#if (!defined(KERNEL_MODULE)) -#define SW_PARAM_DEF(ioctl, data, size, type, name) \ - {ioctl, size, data, type, name} -#else -#define SW_PARAM_DEF(ioctl, data, size, type, name) {ioctl, size, data, type} -#endif - -typedef enum -{ - SW_UINT8 = 1, - SW_INT8, - SW_UINT16, - SW_INT16, - SW_UINT32, - SW_INT32, - SW_UINT64, - SW_INT64, - SW_ENABLE, - SW_SPEED, - SW_DUPLEX, - SW_1QMODE, - SW_EGMODE, - SW_CAP, - SW_VLAN, - SW_LAN_WAN_CFG, - SW_PBMP, - SW_MIB, - SW_MIB_CNTR, - SW_XGMIB, - SW_MACADDR, - SW_FDBENTRY, - SW_MACLIMIT_CTRL, - SW_SCH, - SW_QOS, - SW_STORM, - SW_STP, - SW_LEAKY, - SW_MACCMD, - SW_FLOWTYPE, - SW_FLOWCMD, - SW_UINT_A, - SW_ACLRULE, - SW_LEDPATTERN, - SW_INVLAN, - SW_VLANPROPAGATION, - SW_VLANTRANSLATION, - SW_QINQMODE, - SW_QINQROLE, - SW_CABLESTATUS, - SW_CABLELEN, - SW_SSDK_CFG, - SW_HDRMODE, - SW_FDBOPRATION, - SW_PPPOE, - SW_PPPOE_LESS, - SW_ACL_UDF_TYPE, - SW_IP_HOSTENTRY, - SW_ARP_LEARNMODE, - SW_IP_GUARDMODE, - SW_NATENTRY, - SW_NAPTENTRY, - SW_FLOWENTRY, - SW_NAPTMODE, - SW_IP4ADDR, - SW_IP6ADDR, - SW_INTFMACENTRY, - SW_PUBADDRENTRY, - SW_INGPOLICER, - SW_EGSHAPER, - SW_ACLPOLICER, - SW_MACCONFIG, - SW_PHYCONFIG, - SW_DATA_MAX, - SW_FDBSMODE, - SW_FDB_CTRL_MODE, - SW_FX100CONFIG, - SW_SGENTRY, - SW_SEC_MAC, - SW_SEC_IP, - SW_SEC_IP4, - SW_SEC_IP6, - SW_SEC_TCP, - SW_SEC_UDP, - SW_SEC_ICMP4, - SW_SEC_ICMP6, - SW_REMARKENTRY, - SW_SGINFOENTRY, - SW_DEFAULT_ROUTE_ENTRY, - SW_HOST_ROUTE_ENTRY, - SW_IP_WCMP_ENTRY, - SW_IP_RFS_IP4, - SW_IP_RFS_IP6, - SW_FLOWCOOKIE, - SW_FDB_RFS, - SW_FLOWRFS, - SW_CROSSOVER_MODE, - SW_CROSSOVER_STATUS, - SW_PREFER_MEDIUM, - SW_FIBER_MODE, - SW_INTERFACE_MODE, - SW_COUNTER_INFO, - SW_REG_DUMP, - SW_DBG_REG_DUMP, - SW_VSI_NEWADDR_LRN, - SW_VSI_STAMOVE, - SW_VSI_MEMBER, - SW_VSI_COUNTER, - SW_MTU_INFO, - SW_MRU_INFO, - SW_MTU_ENTRY, - SW_MRU_ENTRY, - SW_ARP_SG_CFG, - SW_IP_NETWORK_ROUTE, - SW_IP_INTF, - SW_IP_VSI_INTF, - SW_IP_NEXTHOP, - SW_UCAST_QUEUE_MAP, - SW_UCAST_PRI_CLASS, - SW_MCAST_PRI_CLASS, - SW_IP_SG, - SW_IP_PUB, - SW_IP_PORTMAC, - SW_IP_MCMODE, - SW_FLOW_AGE, - SW_FLOW_CTRL, - SW_AC_CTRL, - SW_AC_OBJ, - SW_STATIC_THRESH, - SW_DYNAMIC_THRESH, - SW_GROUP_BUFFER, - SW_FLOW_ENTRY, - SW_FLOW_HOST, - SW_IP_GLOBAL, - SW_FLOW_GLOBAL, - SW_GLOBAL_QINQMODE, - SW_PT_QINQMODE, - SW_TPID, - SW_INGRESS_FILTER, - SW_PT_DEF_VID_EN, - SW_PT_VLAN_TAG, - SW_PT_VLAN_DIRECTION, - SW_PT_VLAN_TRANS_ADV_RULE, - SW_PT_VLAN_TRANS_ADV_ACTION, - SW_PT_VLAN_COUNTER, - SW_DEBUG_COUNTER_EN, - SW_TAG_PROPAGATION, - SW_EGRESS_DEFAULT_VID, - SW_EGRESS_MODE, - SW_CTRLPKT_PROFILE, - SW_SERVCODE_CONFIG, - SW_RSS_HASH_MODE, - SW_RSS_HASH_CONFIG, - SW_PTP_CONFIG, - SW_PTP_REFERENCE_CLOCK, - SW_PTP_RX_TIMESTAMP_MODE, - SW_PTP_DIRECTION, - SW_PTP_PKT_INFO, - SW_PTP_TIME, - SW_PTP_GRANDMASTER_MODE, - SW_PTP_SECURITY, - SW_PTP_PPS_SIGNAL_CONTROL, - SW_PTP_ASYM_CORRECTION, - SW_PTP_OUTPUT_WAVEFORM, - SW_PTP_TOD_UART, - SW_PTP_ENHANCED_TS_ENGINE, - SW_PTP_TRIGGER, - SW_PTP_CAPTURE, - SW_PTP_INTERRUPT, - SW_MIRR_ANALYSIS_CONFIG, - SW_MIRR_DIRECTION, - SW_L3_PARSER, - SW_L4_PARSER, - SW_EXP_CTRL, - SW_ACL_UDF_PKT_TYPE, - SW_PORTGROUP, - SW_PORTPRI, - SW_PORTREMARK, - SW_COSMAP, - SW_SCHEDULER, - SW_QUEUEBMP, - SW_PORT_SHAPER_TOKEN_CONFIG, - SW_SHAPER_TOKEN_CONFIG, - SW_PORT_SHAPER_CONFIG, - SW_SHAPER_CONFIG, - SW_BMSTHRESH, - SW_BMDTHRESH, - SW_BMPORTCNT, - SW_MODULE, - SW_FUNC_CTRL, - SW_QM_CNT, - SW_POLICER_COUNTER, - SW_POLICER_PORT_CONFIG, - SW_POLICER_ACL_CONFIG, - SW_POLICER_CMD_CONFIG, - SW_POLICER_GLOBAL_COUNTER, - SW_PHY_DUMP, - SW_RESOURCE_SCHE, - SW_PORT_EEE_CONFIG, - SW_SRC_FILTER_CONFIG, - SW_PORT_LOOPBACK_CONFIG, - SW_SFP_DATA, - SW_SFP_DEV_TYPE, - SW_SFP_TRANSC_CODE, - SW_SFP_RATE_ENCODE, - SW_SFP_LINK_LENGTH, - SW_SFP_VENDOR_INFO, - SW_SFP_LASER_WAVELENGTH, - SW_SFP_OPTION, - SW_SFP_CTRL_RATE, - SW_SFP_ENHANCED_CFG, - SW_SFP_DIAG_THRESHOLD, - SW_SFP_DIAG_CAL_CONST, - SW_SFP_DIAG_REALTIME, - SW_SFP_CTRL_STATUS, - SW_SFP_ALARM_WARN_FLAG, - SW_SFP_CCODE_TYPE, -} sw_data_type_e; - - typedef struct - { - a_uint32_t api_id; - void *func; - } sw_api_func_t; - - typedef struct - { - a_uint32_t api_id; - a_uint16_t data_size; - a_uint8_t data_type; - a_uint8_t param_type; -#if (!defined(KERNEL_MODULE)) - a_uint8_t param_name[30]; -#endif - } sw_api_param_t; - - typedef struct - { - a_uint32_t api_id; - sw_api_func_t *api_fp; - sw_api_param_t *api_pp; - a_uint32_t api_nr; - } sw_api_t; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SW_API_H */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/api/sw_ioctl.h b/feeds/ipq807x/qca-ssdk-shell/src/include/api/sw_ioctl.h deleted file mode 100755 index 0f29504ac..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/api/sw_ioctl.h +++ /dev/null @@ -1,981 +0,0 @@ -/* - * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/*qca808x_start*/ -#ifndef _SW_IOCTL_H_ -#define _SW_IOCTL_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - /*init*/ -#define SW_API_INIT_OFFSET 10 -#define SW_API_SWITCH_INIT (0 + SW_API_INIT_OFFSET) -#define SW_API_SWITCH_RESET (1 + SW_API_INIT_OFFSET) -#define SW_API_SSDK_CFG (2 + SW_API_INIT_OFFSET) -#define SW_API_MODULE_FUNC_CTRL_SET (3 + SW_API_INIT_OFFSET) -#define SW_API_MODULE_FUNC_CTRL_GET (4 + SW_API_INIT_OFFSET) - - /*port ctrl*/ -#define SW_API_PORT_OFFSET 30 -#define SW_API_PT_DUPLEX_GET (0 + SW_API_PORT_OFFSET) -#define SW_API_PT_DUPLEX_SET (1 + SW_API_PORT_OFFSET) -#define SW_API_PT_SPEED_GET (2 + SW_API_PORT_OFFSET) -#define SW_API_PT_SPEED_SET (3 + SW_API_PORT_OFFSET) -#define SW_API_PT_AN_ADV_GET (4 + SW_API_PORT_OFFSET) -#define SW_API_PT_AN_ADV_SET (5 + SW_API_PORT_OFFSET) -#define SW_API_PT_AN_GET (6 + SW_API_PORT_OFFSET) -#define SW_API_PT_AN_ENABLE (7 + SW_API_PORT_OFFSET) -#define SW_API_PT_AN_RESTART (8 + SW_API_PORT_OFFSET) -/*qca808x_end*/ -#define SW_API_PT_HDR_SET (9 + SW_API_PORT_OFFSET) -#define SW_API_PT_HDR_GET (10 + SW_API_PORT_OFFSET) -#define SW_API_PT_FLOWCTRL_SET (11 + SW_API_PORT_OFFSET) -#define SW_API_PT_FLOWCTRL_GET (12 + SW_API_PORT_OFFSET) -#define SW_API_PT_FLOWCTRL_MODE_SET (13 + SW_API_PORT_OFFSET) -#define SW_API_PT_FLOWCTRL_MODE_GET (14 + SW_API_PORT_OFFSET) -#define SW_API_PT_POWERSAVE_SET (15 + SW_API_PORT_OFFSET) -#define SW_API_PT_POWERSAVE_GET (16 + SW_API_PORT_OFFSET) -/*qca808x_start*/ -#define SW_API_PT_HIBERNATE_SET (17 + SW_API_PORT_OFFSET) -#define SW_API_PT_HIBERNATE_GET (18 + SW_API_PORT_OFFSET) -#define SW_API_PT_CDT (19 + SW_API_PORT_OFFSET) -/*qca808x_end*/ -#define SW_API_PT_TXHDR_SET (20 + SW_API_PORT_OFFSET) -#define SW_API_PT_TXHDR_GET (21 + SW_API_PORT_OFFSET) -#define SW_API_PT_RXHDR_SET (22 + SW_API_PORT_OFFSET) -#define SW_API_PT_RXHDR_GET (23 + SW_API_PORT_OFFSET) -#define SW_API_HEADER_TYPE_SET (24 + SW_API_PORT_OFFSET) -#define SW_API_HEADER_TYPE_GET (25 + SW_API_PORT_OFFSET) -#define SW_API_TXMAC_STATUS_SET (26 + SW_API_PORT_OFFSET) -#define SW_API_TXMAC_STATUS_GET (27 + SW_API_PORT_OFFSET) -#define SW_API_RXMAC_STATUS_SET (28 + SW_API_PORT_OFFSET) -#define SW_API_RXMAC_STATUS_GET (29 + SW_API_PORT_OFFSET) -#define SW_API_TXFC_STATUS_SET (30 + SW_API_PORT_OFFSET) -#define SW_API_TXFC_STATUS_GET (31 + SW_API_PORT_OFFSET) -#define SW_API_RXFC_STATUS_SET (32 + SW_API_PORT_OFFSET) -#define SW_API_RXFC_STATUS_GET (33 + SW_API_PORT_OFFSET) -#define SW_API_BP_STATUS_SET (34 + SW_API_PORT_OFFSET) -#define SW_API_BP_STATUS_GET (35 + SW_API_PORT_OFFSET) -#define SW_API_PT_LINK_MODE_SET (36 + SW_API_PORT_OFFSET) -#define SW_API_PT_LINK_MODE_GET (37 + SW_API_PORT_OFFSET) -/*qca808x_start*/ -#define SW_API_PT_LINK_STATUS_GET (38 + SW_API_PORT_OFFSET) -/*qca808x_end*/ -#define SW_API_PT_MAC_LOOPBACK_SET (39+ SW_API_PORT_OFFSET) -#define SW_API_PT_MAC_LOOPBACK_GET (40+ SW_API_PORT_OFFSET) -#define SW_API_PTS_LINK_STATUS_GET (41 + SW_API_PORT_OFFSET) -#define SW_API_PT_CONGESTION_DROP_SET (42+ SW_API_PORT_OFFSET) -#define SW_API_PT_CONGESTION_DROP_GET (43+ SW_API_PORT_OFFSET) -#define SW_API_PT_RING_FLOW_CTRL_THRES_SET (44+ SW_API_PORT_OFFSET) -#define SW_API_PT_RING_FLOW_CTRL_THRES_GET (45+ SW_API_PORT_OFFSET) -/*qca808x_start*/ -#define SW_API_PT_8023AZ_SET (46 + SW_API_PORT_OFFSET) -#define SW_API_PT_8023AZ_GET (47 + SW_API_PORT_OFFSET) -#define SW_API_PT_MDIX_SET (48 + SW_API_PORT_OFFSET) -#define SW_API_PT_MDIX_GET (49 + SW_API_PORT_OFFSET) -#define SW_API_PT_MDIX_STATUS_GET (50 + SW_API_PORT_OFFSET) -/*qca808x_end*/ -#define SW_API_PT_COMBO_PREFER_MEDIUM_SET (51 + SW_API_PORT_OFFSET) -#define SW_API_PT_COMBO_PREFER_MEDIUM_GET (52 + SW_API_PORT_OFFSET) -#define SW_API_PT_COMBO_MEDIUM_STATUS_GET (53 + SW_API_PORT_OFFSET) -#define SW_API_PT_COMBO_FIBER_MODE_SET (54 + SW_API_PORT_OFFSET) -#define SW_API_PT_COMBO_FIBER_MODE_GET (55 + SW_API_PORT_OFFSET) -/*qca808x_start*/ -#define SW_API_PT_LOCAL_LOOPBACK_SET (56 + SW_API_PORT_OFFSET) -#define SW_API_PT_LOCAL_LOOPBACK_GET (57 + SW_API_PORT_OFFSET) -#define SW_API_PT_REMOTE_LOOPBACK_SET (58 + SW_API_PORT_OFFSET) -#define SW_API_PT_REMOTE_LOOPBACK_GET (59 + SW_API_PORT_OFFSET) -#define SW_API_PT_RESET (60 + SW_API_PORT_OFFSET) -#define SW_API_PT_POWER_OFF (61 + SW_API_PORT_OFFSET) -#define SW_API_PT_POWER_ON (62 + SW_API_PORT_OFFSET) -#define SW_API_PT_MAGIC_FRAME_MAC_SET (63 + SW_API_PORT_OFFSET) -#define SW_API_PT_MAGIC_FRAME_MAC_GET (64 + SW_API_PORT_OFFSET) -#define SW_API_PT_PHY_ID_GET (65 + SW_API_PORT_OFFSET) -#define SW_API_PT_WOL_STATUS_SET (66 + SW_API_PORT_OFFSET) -#define SW_API_PT_WOL_STATUS_GET (67 + SW_API_PORT_OFFSET) -/*qca808x_end*/ -#define SW_API_PT_INTERFACE_MODE_SET (68 + SW_API_PORT_OFFSET) -#define SW_API_PT_INTERFACE_MODE_GET (69 + SW_API_PORT_OFFSET) -/*qca808x_start*/ -#define SW_API_PT_INTERFACE_MODE_STATUS_GET (70 + SW_API_PORT_OFFSET) -#define SW_API_DEBUG_PHYCOUNTER_SET (71 + SW_API_PORT_OFFSET) -#define SW_API_DEBUG_PHYCOUNTER_GET (72 + SW_API_PORT_OFFSET) -#define SW_API_DEBUG_PHYCOUNTER_SHOW (73 + SW_API_PORT_OFFSET) -/*qca808x_end*/ -#define SW_API_PT_INTERFACE_MODE_APPLY (74 + SW_API_PORT_OFFSET) -#define SW_API_PT_INTERFACE_3AZ_STATUS_SET (75 + SW_API_PORT_OFFSET) -#define SW_API_PT_INTERFACE_3AZ_STATUS_GET (76 + SW_API_PORT_OFFSET) -#define SW_API_PT_PROMISC_MODE_SET (77 + SW_API_PORT_OFFSET) -#define SW_API_PT_PROMISC_MODE_GET (78 + SW_API_PORT_OFFSET) -#define SW_API_PT_INTERFACE_EEE_CFG_SET (79 + SW_API_PORT_OFFSET) -#define SW_API_PT_INTERFACE_EEE_CFG_GET (80 + SW_API_PORT_OFFSET) -#define SW_API_PT_SWITCH_PORT_LOOPBACK_SET (81 + SW_API_PORT_OFFSET) -#define SW_API_PT_SWITCH_PORT_LOOPBACK_GET (82 + SW_API_PORT_OFFSET) - - /*vlan*/ -#define SW_API_VLAN_OFFSET 130 -#define SW_API_VLAN_ADD (0 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_DEL (1 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_MEM_UPDATE (2 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_FIND (3 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_NEXT (4 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_APPEND (5 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_FLUSH (6 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_FID_SET (7 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_FID_GET (8 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_MEMBER_ADD (9 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_MEMBER_DEL (10 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_LEARN_STATE_SET (11 + SW_API_VLAN_OFFSET) -#define SW_API_VLAN_LEARN_STATE_GET (12 + SW_API_VLAN_OFFSET) -#define SW_API_LAN_WAN_CFG_SET (13 + SW_API_VLAN_OFFSET) -#define SW_API_LAN_WAN_CFG_GET (14 + SW_API_VLAN_OFFSET) - - /*port ctrl extend*/ -#define SW_API_PORT_EXT_OFFSET 160 -#define SW_API_PT_MTU_SET (0 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_MTU_GET (1 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_MRU_SET (2 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_MRU_GET (3 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_SOURCE_FILTER_GET (4 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_SOURCE_FILTER_SET (5 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_FRAME_MAX_SIZE_GET (6 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_FRAME_MAX_SIZE_SET (7 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_SOURCE_FILTER_CONFIG_GET (8 + SW_API_PORT_EXT_OFFSET) -#define SW_API_PT_SOURCE_FILTER_CONFIG_SET (9 + SW_API_PORT_EXT_OFFSET) - - /*portvlan*/ -#define SW_API_PORTVLAN_OFFSET 200 -#define SW_API_PT_ING_MODE_GET (0 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_ING_MODE_SET (1 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_EG_MODE_GET (2 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_EG_MODE_SET (3 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_MEM_ADD (4 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_MEM_DEL (5 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_MEM_UPDATE (6 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_MEM_GET (7 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_DEF_VID_GET (8 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_DEF_VID_SET (9 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_FORCE_DEF_VID_SET (10 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_FORCE_DEF_VID_GET (11 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_FORCE_PORTVLAN_SET (12 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_FORCE_PORTVLAN_GET (13 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_NESTVLAN_SET (14 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_NESTVLAN_GET (15 + SW_API_PORTVLAN_OFFSET) -#define SW_API_NESTVLAN_TPID_SET (16 + SW_API_PORTVLAN_OFFSET) -#define SW_API_NESTVLAN_TPID_GET (17 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_IN_VLAN_MODE_SET (18 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_IN_VLAN_MODE_GET (19 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_TLS_SET (20 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_TLS_GET (21 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_PRI_PROPAGATION_SET (22 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_PRI_PROPAGATION_GET (23 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_DEF_SVID_SET (24 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_DEF_SVID_GET (25 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_DEF_CVID_SET (26 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_DEF_CVID_GET (27 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_PROPAGATION_SET (28 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_PROPAGATION_GET (29 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_TRANS_ADD (30 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_TRANS_DEL (31 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_TRANS_GET (32 + SW_API_PORTVLAN_OFFSET) -#define SW_API_QINQ_MODE_SET (33 + SW_API_PORTVLAN_OFFSET) -#define SW_API_QINQ_MODE_GET (34 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_QINQ_ROLE_SET (35 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_QINQ_ROLE_GET (36 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_TRANS_ITERATE (37 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_MAC_VLAN_XLT_SET (38 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_MAC_VLAN_XLT_GET (39 + SW_API_PORTVLAN_OFFSET) -#define SW_API_NETISOLATE_SET (40 + SW_API_PORTVLAN_OFFSET) -#define SW_API_NETISOLATE_GET (41 + SW_API_PORTVLAN_OFFSET) -#define SW_API_EG_FLTR_BYPASS_EN_SET (42 + SW_API_PORTVLAN_OFFSET) -#define SW_API_EG_FLTR_BYPASS_EN_GET (43 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VRF_ID_SET (44 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VRF_ID_GET (45 + SW_API_PORTVLAN_OFFSET) -#define SW_API_GLOBAL_QINQ_MODE_SET (46 + SW_API_PORTVLAN_OFFSET) -#define SW_API_GLOBAL_QINQ_MODE_GET (47 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PORT_QINQ_MODE_SET (48 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PORT_QINQ_MODE_GET (49 + SW_API_PORTVLAN_OFFSET) -#define SW_API_TPID_SET (50 + SW_API_PORTVLAN_OFFSET) -#define SW_API_TPID_GET (51 + SW_API_PORTVLAN_OFFSET) -#define SW_API_EGRESS_TPID_SET (52 + SW_API_PORTVLAN_OFFSET) -#define SW_API_EGRESS_TPID_GET (53 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_INGRESS_VLAN_FILTER_SET (54 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_INGRESS_VLAN_FILTER_GET (55 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_DEFAULT_VLANTAG_SET (56 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_DEFAULT_VLANTAG_GET (57 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_TAG_PROPAGATION_SET (58 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_TAG_PROPAGATION_GET (59 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLANTAG_EGMODE_SET (60 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLANTAG_EGMODE_GET (61 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_XLT_MISS_CMD_SET (62 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_XLT_MISS_CMD_GET (63 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VSI_EGMODE_SET (64 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VSI_EGMODE_GET (65 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET (66 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET (67 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_TRANS_ADV_ADD (68 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_TRANS_ADV_DEL (69 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_TRANS_ADV_GETFIRST (70 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_TRANS_ADV_GETNEXT (71 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_COUNTER_GET (72 + SW_API_PORTVLAN_OFFSET) -#define SW_API_PT_VLAN_COUNTER_CLEANUP (73 + SW_API_PORTVLAN_OFFSET) - - - /*fdb*/ -#define SW_API_FDB_OFFSET 300 -#define SW_API_FDB_ADD (0 + SW_API_FDB_OFFSET) -#define SW_API_FDB_DELALL (1 + SW_API_FDB_OFFSET) -#define SW_API_FDB_DELPORT (2 + SW_API_FDB_OFFSET) -#define SW_API_FDB_DELMAC (3 + SW_API_FDB_OFFSET) -#define SW_API_FDB_FIRST (4 + SW_API_FDB_OFFSET) -#define SW_API_FDB_NEXT (5 + SW_API_FDB_OFFSET) -#define SW_API_FDB_FIND (6 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_LEARN_SET (7 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_LEARN_GET (8 + SW_API_FDB_OFFSET) -#define SW_API_FDB_AGE_CTRL_SET (9 + SW_API_FDB_OFFSET) -#define SW_API_FDB_AGE_CTRL_GET (10 + SW_API_FDB_OFFSET) -#define SW_API_FDB_AGE_TIME_SET (11 + SW_API_FDB_OFFSET) -#define SW_API_FDB_AGE_TIME_GET (12 + SW_API_FDB_OFFSET) -#define SW_API_FDB_ITERATE (13 + SW_API_FDB_OFFSET) -#define SW_API_FDB_EXTEND_NEXT (14 + SW_API_FDB_OFFSET) -#define SW_API_PT_FDB_LEARN_LIMIT_SET (15 + SW_API_FDB_OFFSET) -#define SW_API_PT_FDB_LEARN_LIMIT_GET (16 + SW_API_FDB_OFFSET) -#define SW_API_PT_FDB_LEARN_EXCEED_CMD_SET (17 + SW_API_FDB_OFFSET) -#define SW_API_PT_FDB_LEARN_EXCEED_CMD_GET (18 + SW_API_FDB_OFFSET) -#define SW_API_FDB_LEARN_LIMIT_SET (19 + SW_API_FDB_OFFSET) -#define SW_API_FDB_LEARN_LIMIT_GET (20 + SW_API_FDB_OFFSET) -#define SW_API_FDB_LEARN_EXCEED_CMD_SET (21 + SW_API_FDB_OFFSET) -#define SW_API_FDB_LEARN_EXCEED_CMD_GET (22 + SW_API_FDB_OFFSET) -#define SW_API_FDB_RESV_ADD (23 + SW_API_FDB_OFFSET) -#define SW_API_FDB_RESV_DEL (24 + SW_API_FDB_OFFSET) -#define SW_API_FDB_RESV_FIND (25 + SW_API_FDB_OFFSET) -#define SW_API_FDB_RESV_ITERATE (26 + SW_API_FDB_OFFSET) -#define SW_API_FDB_EXTEND_FIRST (27 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_LEARN_STATIC_SET (28 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_LEARN_STATIC_GET (29 + SW_API_FDB_OFFSET) -#define SW_API_FDB_TRANSFER (30 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PORT_ADD (31 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PORT_DEL (32 + SW_API_FDB_OFFSET) -#define SW_API_FDB_VLAN_IVL_SVL_SET (33 + SW_API_FDB_OFFSET) -#define SW_API_FDB_VLAN_IVL_SVL_GET (34 + SW_API_FDB_OFFSET) -#define SW_API_FDB_RFS_SET (35 + SW_API_FDB_OFFSET) -#define SW_API_FDB_RFS_DEL (36 + SW_API_FDB_OFFSET) -#define SW_API_FDB_LEARN_CTRL_SET (37 + SW_API_FDB_OFFSET) -#define SW_API_FDB_LEARN_CTRL_GET (38 + SW_API_FDB_OFFSET) -#define SW_API_PT_FDB_LEARN_COUNTER_GET (39 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_NEWADDR_LEARN_SET (40 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_NEWADDR_LEARN_GET (41 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_STAMOVE_SET (42 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_STAMOVE_GET (43 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_MACLIMIT_CTRL_SET (44 + SW_API_FDB_OFFSET) -#define SW_API_FDB_PT_MACLIMIT_CTRL_GET (45 + SW_API_FDB_OFFSET) -#define SW_API_FDB_DEL_BY_FID (46 + SW_API_FDB_OFFSET) - - - /*acl*/ -#define SW_API_ACL_OFFSET 400 -#define SW_API_ACL_LIST_CREAT (0 + SW_API_ACL_OFFSET) -#define SW_API_ACL_LIST_DESTROY (1 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_ADD (2 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_DELETE (3 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_QUERY (4 + SW_API_ACL_OFFSET) -#define SW_API_ACL_LIST_BIND (5 + SW_API_ACL_OFFSET) -#define SW_API_ACL_LIST_UNBIND (6 + SW_API_ACL_OFFSET) -#define SW_API_ACL_STATUS_SET (7 + SW_API_ACL_OFFSET) -#define SW_API_ACL_STATUS_GET (8 + SW_API_ACL_OFFSET) -#define SW_API_ACL_LIST_DUMP (9 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_DUMP (10 + SW_API_ACL_OFFSET) -#define SW_API_ACL_PT_UDF_PROFILE_SET (11 + SW_API_ACL_OFFSET) -#define SW_API_ACL_PT_UDF_PROFILE_GET (12 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_ACTIVE (13 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_DEACTIVE (14 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_SRC_FILTER_STS_SET (15 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_SRC_FILTER_STS_GET (16 + SW_API_ACL_OFFSET) -#define SW_API_ACL_RULE_GET_OFFSET (17 + SW_API_ACL_OFFSET) -#define SW_API_ACL_UDF_SET (18 + SW_API_ACL_OFFSET) -#define SW_API_ACL_UDF_GET (19 + SW_API_ACL_OFFSET) - - /*qos*/ -#define SW_API_QOS_OFFSET 500 -#define SW_API_QOS_SCH_MODE_SET (0 + SW_API_QOS_OFFSET) -#define SW_API_QOS_SCH_MODE_GET (1 + SW_API_QOS_OFFSET) -#define SW_API_QOS_QU_TX_BUF_ST_SET (2 + SW_API_QOS_OFFSET) -#define SW_API_QOS_QU_TX_BUF_ST_GET (3 + SW_API_QOS_OFFSET) -#define SW_API_QOS_QU_TX_BUF_NR_SET (4 + SW_API_QOS_OFFSET) -#define SW_API_QOS_QU_TX_BUF_NR_GET (5 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_TX_BUF_ST_SET (6 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_TX_BUF_ST_GET (7 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_TX_BUF_NR_SET (8 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_TX_BUF_NR_GET (9 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_RX_BUF_NR_SET (10 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_RX_BUF_NR_GET (11 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_MODE_SET (12 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_MODE_GET (13 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_MODE_PRI_SET (14 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_MODE_PRI_GET (15 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_DEF_UP_SET (16 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_DEF_UP_GET (17 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_SCH_MODE_SET (18 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_SCH_MODE_GET (19 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_DEF_SPRI_SET (20 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_DEF_SPRI_GET (21 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_DEF_CPRI_SET (22 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_DEF_CPRI_GET (23 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_FORCE_SPRI_ST_SET (24 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_FORCE_SPRI_ST_GET (25 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_FORCE_CPRI_ST_SET (26 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_FORCE_CPRI_ST_GET (27 + SW_API_QOS_OFFSET) -#define SW_API_QOS_QUEUE_REMARK_SET (28 + SW_API_QOS_OFFSET) -#define SW_API_QOS_QUEUE_REMARK_GET (29 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_RED_EN_SET (30 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PT_RED_EN_GET (31 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_GROUP_GET (32 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_GROUP_SET (33 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_PRI_GET (34 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_PRI_SET (35 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_REMARK_GET (36 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_REMARK_SET (37 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PCP_MAP_GET (38 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PCP_MAP_SET (39 + SW_API_QOS_OFFSET) -#define SW_API_QOS_FLOW_MAP_GET (40 + SW_API_QOS_OFFSET) -#define SW_API_QOS_FLOW_MAP_SET (41 + SW_API_QOS_OFFSET) -#define SW_API_QOS_DSCP_MAP_GET (42 + SW_API_QOS_OFFSET) -#define SW_API_QOS_DSCP_MAP_SET (43 + SW_API_QOS_OFFSET) -#define SW_API_QOS_QUEUE_SCHEDULER_GET (44 + SW_API_QOS_OFFSET) -#define SW_API_QOS_QUEUE_SCHEDULER_SET (45 + SW_API_QOS_OFFSET) -#define SW_API_QOS_RING_QUEUE_MAP_GET (46 + SW_API_QOS_OFFSET) -#define SW_API_QOS_RING_QUEUE_MAP_SET (47 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_QUEUES_GET (48 + SW_API_QOS_OFFSET) -#define SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET (49 + SW_API_QOS_OFFSET) -#define SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET (50 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_SCHEDULER_CFG_RESET (51 + SW_API_QOS_OFFSET) -#define SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET (52 + SW_API_QOS_OFFSET) - - - /* igmp */ -#define SW_API_IGMP_OFFSET 600 -#define SW_API_PT_IGMPS_MODE_SET (0 + SW_API_IGMP_OFFSET) -#define SW_API_PT_IGMPS_MODE_GET (1 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_MLD_CMD_SET (2 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_MLD_CMD_GET (3 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_PT_JOIN_SET (4 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_PT_JOIN_GET (5 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_PT_LEAVE_SET (6 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_PT_LEAVE_GET (7 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_RP_SET (8 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_RP_GET (9 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_CREAT_SET (10 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_CREAT_GET (11 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_STATIC_SET (12 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_STATIC_GET (13 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_LEAKY_SET (14 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_LEAKY_GET (15 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_V3_SET (16 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_V3_GET (17 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_QUEUE_SET (18 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_ENTRY_QUEUE_GET (19 + SW_API_IGMP_OFFSET) -#define SW_API_PT_IGMP_LEARN_LIMIT_SET (20 + SW_API_IGMP_OFFSET) -#define SW_API_PT_IGMP_LEARN_LIMIT_GET (21 + SW_API_IGMP_OFFSET) -#define SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET (22 + SW_API_IGMP_OFFSET) -#define SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET (23 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_SG_ENTRY_SET (24 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_SG_ENTRY_CLEAR (25 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_SG_ENTRY_SHOW (26 + SW_API_IGMP_OFFSET) -#define SW_API_IGMP_SG_ENTRY_QUERY (27 + SW_API_IGMP_OFFSET) - - /* leaky */ -#define SW_API_LEAKY_OFFSET 700 -#define SW_API_UC_LEAKY_MODE_SET (0 + SW_API_LEAKY_OFFSET) -#define SW_API_UC_LEAKY_MODE_GET (1 + SW_API_LEAKY_OFFSET) -#define SW_API_MC_LEAKY_MODE_SET (2 + SW_API_LEAKY_OFFSET) -#define SW_API_MC_LEAKY_MODE_GET (3 + SW_API_LEAKY_OFFSET) -#define SW_API_ARP_LEAKY_MODE_SET (4 + SW_API_LEAKY_OFFSET) -#define SW_API_ARP_LEAKY_MODE_GET (5 + SW_API_LEAKY_OFFSET) -#define SW_API_PT_UC_LEAKY_MODE_SET (6 + SW_API_LEAKY_OFFSET) -#define SW_API_PT_UC_LEAKY_MODE_GET (7 + SW_API_LEAKY_OFFSET) -#define SW_API_PT_MC_LEAKY_MODE_SET (8 + SW_API_LEAKY_OFFSET) -#define SW_API_PT_MC_LEAKY_MODE_GET (9 + SW_API_LEAKY_OFFSET) - - /*mirror*/ -#define SW_API_MIR_OFFSET 800 -#define SW_API_MIRROR_ANALY_PT_SET (0 + SW_API_MIR_OFFSET) -#define SW_API_MIRROR_ANALY_PT_GET (1 + SW_API_MIR_OFFSET) -#define SW_API_MIRROR_IN_PT_SET (2 + SW_API_MIR_OFFSET) -#define SW_API_MIRROR_IN_PT_GET (3 + SW_API_MIR_OFFSET) -#define SW_API_MIRROR_EG_PT_SET (4 + SW_API_MIR_OFFSET) -#define SW_API_MIRROR_EG_PT_GET (5 + SW_API_MIR_OFFSET) -#define SW_API_MIRROR_ANALYSIS_CONFIG_SET (6 + SW_API_MIR_OFFSET) -#define SW_API_MIRROR_ANALYSIS_CONFIG_GET (7 + SW_API_MIR_OFFSET) - - /*rate*/ -#define SW_API_RATE_OFFSET 900 -#define SW_API_RATE_QU_EGRL_SET (0 + SW_API_RATE_OFFSET) -#define SW_API_RATE_QU_EGRL_GET (1 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PT_EGRL_SET (2 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PT_EGRL_GET (3 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PT_INRL_SET (4 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PT_INRL_GET (5 + SW_API_RATE_OFFSET) -#define SW_API_STORM_CTRL_FRAME_SET (6 + SW_API_RATE_OFFSET) -#define SW_API_STORM_CTRL_FRAME_GET (7 + SW_API_RATE_OFFSET) -#define SW_API_STORM_CTRL_RATE_SET (8 + SW_API_RATE_OFFSET) -#define SW_API_STORM_CTRL_RATE_GET (9 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PORT_POLICER_SET (10 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PORT_POLICER_GET (11 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PORT_SHAPER_SET (12 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PORT_SHAPER_GET (13 + SW_API_RATE_OFFSET) -#define SW_API_RATE_QUEUE_SHAPER_SET (14 + SW_API_RATE_OFFSET) -#define SW_API_RATE_QUEUE_SHAPER_GET (15 + SW_API_RATE_OFFSET) -#define SW_API_RATE_ACL_POLICER_SET (16 + SW_API_RATE_OFFSET) -#define SW_API_RATE_ACL_POLICER_GET (17 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PT_ADDRATEBYTE_SET (18 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PT_ADDRATEBYTE_GET (19 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PT_GOL_FLOW_EN_SET (20 + SW_API_RATE_OFFSET) -#define SW_API_RATE_PT_GOL_FLOW_EN_GET (21 + SW_API_RATE_OFFSET) - - /*stp*/ -#define SW_API_STP_OFFSET 1000 -#define SW_API_STP_PT_STATE_SET (0 + SW_API_STP_OFFSET) -#define SW_API_STP_PT_STATE_GET (1 + SW_API_STP_OFFSET) - - /*mib*/ -#define SW_API_MIB_OFFSET 1100 -#define SW_API_PT_MIB_GET (0 + SW_API_MIB_OFFSET) -#define SW_API_MIB_STATUS_SET (1 + SW_API_MIB_OFFSET) -#define SW_API_MIB_STATUS_GET (2 + SW_API_MIB_OFFSET) -#define SW_API_PT_MIB_FLUSH_COUNTERS (3+ SW_API_MIB_OFFSET) -#define SW_API_MIB_CPU_KEEP_SET (4+ SW_API_MIB_OFFSET) -#define SW_API_MIB_CPU_KEEP_GET (5+ SW_API_MIB_OFFSET) -#define SW_API_PT_XGMIB_GET (6+ SW_API_MIB_OFFSET) -#define SW_API_PT_MIB_COUNTER_GET (7+ SW_API_MIB_OFFSET) - - /*misc*/ -#define SW_API_MISC_OFFSET 1200 -#define SW_API_ARP_STATUS_SET (0 + SW_API_MISC_OFFSET) -#define SW_API_ARP_STATUS_GET (1 + SW_API_MISC_OFFSET) -#define SW_API_FRAME_MAX_SIZE_SET (2 + SW_API_MISC_OFFSET) -#define SW_API_FRAME_MAX_SIZE_GET (3 + SW_API_MISC_OFFSET) -#define SW_API_PT_UNK_SA_CMD_SET (4 + SW_API_MISC_OFFSET) -#define SW_API_PT_UNK_SA_CMD_GET (5 + SW_API_MISC_OFFSET) -#define SW_API_PT_UNK_UC_FILTER_SET (6 + SW_API_MISC_OFFSET) -#define SW_API_PT_UNK_UC_FILTER_GET (7 + SW_API_MISC_OFFSET) -#define SW_API_PT_UNK_MC_FILTER_SET (8 + SW_API_MISC_OFFSET) -#define SW_API_PT_UNK_MC_FILTER_GET (9 + SW_API_MISC_OFFSET) -#define SW_API_PT_BC_FILTER_SET (10 + SW_API_MISC_OFFSET) -#define SW_API_PT_BC_FILTER_GET (11 + SW_API_MISC_OFFSET) -#define SW_API_CPU_PORT_STATUS_SET (12 + SW_API_MISC_OFFSET) -#define SW_API_CPU_PORT_STATUS_GET (13 + SW_API_MISC_OFFSET) -#define SW_API_BC_TO_CPU_PORT_SET (14 + SW_API_MISC_OFFSET) -#define SW_API_BC_TO_CPU_PORT_GET (15 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_CMD_SET (16 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_CMD_GET (17 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_STATUS_SET (18 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_STATUS_GET (19 + SW_API_MISC_OFFSET) -#define SW_API_PT_DHCP_SET (20 + SW_API_MISC_OFFSET) -#define SW_API_PT_DHCP_GET (21 + SW_API_MISC_OFFSET) -#define SW_API_ARP_CMD_SET (22 + SW_API_MISC_OFFSET) -#define SW_API_ARP_CMD_GET (23 + SW_API_MISC_OFFSET) -#define SW_API_EAPOL_CMD_SET (24 + SW_API_MISC_OFFSET) -#define SW_API_EAPOL_CMD_GET (25 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_SESSION_ADD (26 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_SESSION_DEL (27 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_SESSION_GET (28 + SW_API_MISC_OFFSET) -#define SW_API_EAPOL_STATUS_SET (29 + SW_API_MISC_OFFSET) -#define SW_API_EAPOL_STATUS_GET (30 + SW_API_MISC_OFFSET) -#define SW_API_RIPV1_STATUS_SET (31 + SW_API_MISC_OFFSET) -#define SW_API_RIPV1_STATUS_GET (32 + SW_API_MISC_OFFSET) -#define SW_API_PT_ARP_REQ_STATUS_SET (33 + SW_API_MISC_OFFSET) -#define SW_API_PT_ARP_REQ_STATUS_GET (34 + SW_API_MISC_OFFSET) -#define SW_API_PT_ARP_ACK_STATUS_SET (35 + SW_API_MISC_OFFSET) -#define SW_API_PT_ARP_ACK_STATUS_GET (36 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_SESSION_TABLE_ADD (37 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_SESSION_TABLE_DEL (38 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_SESSION_TABLE_GET (39 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_SESSION_ID_SET (40 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_SESSION_ID_GET (41 + SW_API_MISC_OFFSET) -#define SW_API_INTR_MASK_SET (42 + SW_API_MISC_OFFSET) -#define SW_API_INTR_MASK_GET (43 + SW_API_MISC_OFFSET) -#define SW_API_INTR_STATUS_GET (44 + SW_API_MISC_OFFSET) -#define SW_API_INTR_STATUS_CLEAR (45 + SW_API_MISC_OFFSET) -#define SW_API_INTR_PORT_LINK_MASK_SET (46 + SW_API_MISC_OFFSET) -#define SW_API_INTR_PORT_LINK_MASK_GET (47 + SW_API_MISC_OFFSET) -#define SW_API_INTR_PORT_LINK_STATUS_GET (48 + SW_API_MISC_OFFSET) -#define SW_API_INTR_MASK_MAC_LINKCHG_SET (49 + SW_API_MISC_OFFSET) -#define SW_API_INTR_MASK_MAC_LINKCHG_GET (50 + SW_API_MISC_OFFSET) -#define SW_API_INTR_STATUS_MAC_LINKCHG_GET (51 + SW_API_MISC_OFFSET) -#define SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR (52 + SW_API_MISC_OFFSET) -#define SW_API_CPU_VID_EN_SET (53 + SW_API_MISC_OFFSET) -#define SW_API_CPU_VID_EN_GET (54 + SW_API_MISC_OFFSET) -#define SW_API_RTD_PPPOE_EN_SET (55 + SW_API_MISC_OFFSET) -#define SW_API_RTD_PPPOE_EN_GET (56 + SW_API_MISC_OFFSET) -#define SW_API_GLOBAL_MACADDR_SET (57 + SW_API_MISC_OFFSET) -#define SW_API_GLOBAL_MACADDR_GET (58 + SW_API_MISC_OFFSET) -#define SW_API_LLDP_STATUS_SET (59 + SW_API_MISC_OFFSET) -#define SW_API_LLDP_STATUS_GET (60 + SW_API_MISC_OFFSET) -#define SW_API_FRAME_CRC_RESERVE_SET (61 + SW_API_MISC_OFFSET) -#define SW_API_FRAME_CRC_RESERVE_GET (62 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_EN_SET (63 + SW_API_MISC_OFFSET) -#define SW_API_PPPOE_EN_GET (64 + SW_API_MISC_OFFSET) -#define SW_API_DEBUG_PORT_COUNTER_ENABLE (65 + SW_API_MISC_OFFSET) -#define SW_API_DEBUG_PORT_COUNTER_STATUS_GET (66 + SW_API_MISC_OFFSET) - - /*led*/ -#define SW_API_LED_OFFSET 1300 -#define SW_API_LED_PATTERN_SET (0 + SW_API_LED_OFFSET) -#define SW_API_LED_PATTERN_GET (1 + SW_API_LED_OFFSET) - - /* cosmap */ -#define SW_API_COSMAP_OFFSET 1400 -#define SW_API_COSMAP_UP_QU_SET (0 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_QU_GET (1 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_QU_SET (2 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_QU_GET (3 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_TO_PRI_SET (4 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_TO_PRI_GET (5 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_TO_DP_SET (6 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_TO_DP_GET (7 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_TO_PRI_SET (8 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_TO_PRI_GET (9 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_TO_DP_SET (10 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_TO_DP_GET (11 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_PRI_TO_QU_SET (12 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_PRI_TO_QU_GET (13 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_PRI_TO_EHQU_SET (14 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_PRI_TO_EHQU_GET (15 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_EG_REMARK_SET (16 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_EG_REMARK_GET (17 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_TO_EHPRI_SET (18 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_TO_EHPRI_GET (19 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_TO_EHDP_SET (20 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_DSCP_TO_EHDP_GET (21 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_TO_EHPRI_SET (22 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_TO_EHPRI_GET (23 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_TO_EHDP_SET (24 + SW_API_COSMAP_OFFSET) -#define SW_API_COSMAP_UP_TO_EHDP_GET (25 + SW_API_COSMAP_OFFSET) - - /* sec */ -#define SW_API_SEC_OFFSET 1500 -#define SW_API_SEC_NORM_SET (0 + SW_API_SEC_OFFSET) -#define SW_API_SEC_NORM_GET (1 + SW_API_SEC_OFFSET) -#define SW_API_SEC_MAC_SET (2 + SW_API_SEC_OFFSET) -#define SW_API_SEC_MAC_GET (3 + SW_API_SEC_OFFSET) -#define SW_API_SEC_IP_SET (4 + SW_API_SEC_OFFSET) -#define SW_API_SEC_IP_GET (5 + SW_API_SEC_OFFSET) -#define SW_API_SEC_IP4_SET (6 + SW_API_SEC_OFFSET) -#define SW_API_SEC_IP4_GET (7 + SW_API_SEC_OFFSET) -#define SW_API_SEC_IP6_SET (8 + SW_API_SEC_OFFSET) -#define SW_API_SEC_IP6_GET (9 + SW_API_SEC_OFFSET) -#define SW_API_SEC_TCP_SET (10 + SW_API_SEC_OFFSET) -#define SW_API_SEC_TCP_GET (11 + SW_API_SEC_OFFSET) -#define SW_API_SEC_UDP_SET (12 + SW_API_SEC_OFFSET) -#define SW_API_SEC_UDP_GET (13 + SW_API_SEC_OFFSET) -#define SW_API_SEC_ICMP4_SET (14 + SW_API_SEC_OFFSET) -#define SW_API_SEC_ICMP4_GET (15 + SW_API_SEC_OFFSET) -#define SW_API_SEC_ICMP6_SET (16 + SW_API_SEC_OFFSET) -#define SW_API_SEC_ICMP6_GET (17 + SW_API_SEC_OFFSET) -#define SW_API_SEC_L3_PARSER_CTRL_GET (18 + SW_API_SEC_OFFSET) -#define SW_API_SEC_L3_PARSER_CTRL_SET (19 + SW_API_SEC_OFFSET) -#define SW_API_SEC_L4_PARSER_CTRL_GET (20 + SW_API_SEC_OFFSET) -#define SW_API_SEC_L4_PARSER_CTRL_SET (21 + SW_API_SEC_OFFSET) -#define SW_API_SEC_EXP_CTRL_GET (22 + SW_API_SEC_OFFSET) -#define SW_API_SEC_EXP_CTRL_SET (23 + SW_API_SEC_OFFSET) - - /* ip */ -#define SW_API_IP_OFFSET 1600 -#define SW_API_IP_HOST_ADD (0 + SW_API_IP_OFFSET) -#define SW_API_IP_HOST_DEL (1 + SW_API_IP_OFFSET) -#define SW_API_IP_HOST_GET (2 + SW_API_IP_OFFSET) -#define SW_API_IP_HOST_NEXT (3 + SW_API_IP_OFFSET) -#define SW_API_IP_HOST_COUNTER_BIND (4 + SW_API_IP_OFFSET) -#define SW_API_IP_HOST_PPPOE_BIND (5 + SW_API_IP_OFFSET) -#define SW_API_IP_PT_ARP_LEARN_SET (6 + SW_API_IP_OFFSET) -#define SW_API_IP_PT_ARP_LEARN_GET (7 + SW_API_IP_OFFSET) -#define SW_API_IP_ARP_LEARN_SET (8 + SW_API_IP_OFFSET) -#define SW_API_IP_ARP_LEARN_GET (9 + SW_API_IP_OFFSET) -#define SW_API_IP_SOURCE_GUARD_SET (10 + SW_API_IP_OFFSET) -#define SW_API_IP_SOURCE_GUARD_GET (11 + SW_API_IP_OFFSET) -#define SW_API_IP_ARP_GUARD_SET (12 + SW_API_IP_OFFSET) -#define SW_API_IP_ARP_GUARD_GET (13 + SW_API_IP_OFFSET) -#define SW_API_IP_ROUTE_STATUS_SET (14 + SW_API_IP_OFFSET) -#define SW_API_IP_ROUTE_STATUS_GET (15 + SW_API_IP_OFFSET) -#define SW_API_IP_INTF_ENTRY_ADD (16 + SW_API_IP_OFFSET) -#define SW_API_IP_INTF_ENTRY_DEL (17 + SW_API_IP_OFFSET) -#define SW_API_IP_INTF_ENTRY_NEXT (18 + SW_API_IP_OFFSET) -#define SW_API_IP_UNK_SOURCE_CMD_SET (19 + SW_API_IP_OFFSET) -#define SW_API_IP_UNK_SOURCE_CMD_GET (20 + SW_API_IP_OFFSET) -#define SW_API_ARP_UNK_SOURCE_CMD_SET (21 + SW_API_IP_OFFSET) -#define SW_API_ARP_UNK_SOURCE_CMD_GET (22 + SW_API_IP_OFFSET) -#define SW_API_IP_AGE_TIME_SET (23 + SW_API_IP_OFFSET) -#define SW_API_IP_AGE_TIME_GET (24 + SW_API_IP_OFFSET) -#define SW_API_WCMP_HASH_MODE_SET (25 + SW_API_IP_OFFSET) -#define SW_API_WCMP_HASH_MODE_GET (26 + SW_API_IP_OFFSET) -#define SW_API_IP_VRF_BASE_ADDR_SET (27 + SW_API_IP_OFFSET) -#define SW_API_IP_VRF_BASE_ADDR_GET (28 + SW_API_IP_OFFSET) -#define SW_API_IP_VRF_BASE_MASK_SET (29 + SW_API_IP_OFFSET) -#define SW_API_IP_VRF_BASE_MASK_GET (30 + SW_API_IP_OFFSET) -#define SW_API_IP_DEFAULT_ROUTE_SET (31 + SW_API_IP_OFFSET) -#define SW_API_IP_DEFAULT_ROUTE_GET (32 + SW_API_IP_OFFSET) -#define SW_API_IP_HOST_ROUTE_SET (33 + SW_API_IP_OFFSET) -#define SW_API_IP_HOST_ROUTE_GET (34 + SW_API_IP_OFFSET) -#define SW_API_IP_WCMP_ENTRY_SET (35 + SW_API_IP_OFFSET) -#define SW_API_IP_WCMP_ENTRY_GET (36 + SW_API_IP_OFFSET) -#define SW_API_IP_RFS_IP4_SET (37 + SW_API_IP_OFFSET) -#define SW_API_IP_RFS_IP6_SET (38 + SW_API_IP_OFFSET) -#define SW_API_IP_RFS_IP4_DEL (39 + SW_API_IP_OFFSET) -#define SW_API_IP_RFS_IP6_DEL (40 + SW_API_IP_OFFSET) -#define SW_API_IP_DEFAULT_FLOW_CMD_SET (41 + SW_API_IP_OFFSET) -#define SW_API_IP_DEFAULT_FLOW_CMD_GET (42 + SW_API_IP_OFFSET) -#define SW_API_IP_DEFAULT_RT_FLOW_CMD_SET (43 + SW_API_IP_OFFSET) -#define SW_API_IP_DEFAULT_RT_FLOW_CMD_GET (44 + SW_API_IP_OFFSET) -#define SW_API_IP_VIS_ARP_SG_CFG_GET (45 + SW_API_IP_OFFSET) -#define SW_API_IP_VIS_ARP_SG_CFG_SET (46 + SW_API_IP_OFFSET) -#define SW_API_IP_NETWORK_ROUTE_GET (47 + SW_API_IP_OFFSET) -#define SW_API_IP_NETWORK_ROUTE_ADD (48 + SW_API_IP_OFFSET) -#define SW_API_IP_INTF_GET (49 + SW_API_IP_OFFSET) -#define SW_API_IP_INTF_SET (50 + SW_API_IP_OFFSET) -#define SW_API_IP_VSI_INTF_GET (51 + SW_API_IP_OFFSET) -#define SW_API_IP_VSI_INTF_SET (52 + SW_API_IP_OFFSET) -#define SW_API_IP_NEXTHOP_GET (53 + SW_API_IP_OFFSET) -#define SW_API_IP_NEXTHOP_SET (54 + SW_API_IP_OFFSET) -#define SW_API_IP_VSI_SG_SET (55 + SW_API_IP_OFFSET) -#define SW_API_IP_VSI_SG_GET (56 + SW_API_IP_OFFSET) -#define SW_API_IP_PORT_SG_SET (57 + SW_API_IP_OFFSET) -#define SW_API_IP_PORT_SG_GET (58 + SW_API_IP_OFFSET) -#define SW_API_IP_PUB_IP_SET (59 + SW_API_IP_OFFSET) -#define SW_API_IP_PUB_IP_GET (60 + SW_API_IP_OFFSET) -#define SW_API_IP_NETWORK_ROUTE_DEL (61 + SW_API_IP_OFFSET) -#define SW_API_IP_PORT_INTF_GET (62 + SW_API_IP_OFFSET) -#define SW_API_IP_PORT_INTF_SET (63 + SW_API_IP_OFFSET) -#define SW_API_IP_PORT_MAC_GET (64 + SW_API_IP_OFFSET) -#define SW_API_IP_PORT_MAC_SET (65 + SW_API_IP_OFFSET) -#define SW_API_IP_ROUTE_MISS_GET (66 + SW_API_IP_OFFSET) -#define SW_API_IP_ROUTE_MISS_SET (67 + SW_API_IP_OFFSET) -#define SW_API_IP_PORT_ARP_SG_GET (68 + SW_API_IP_OFFSET) -#define SW_API_IP_PORT_ARP_SG_SET (69 + SW_API_IP_OFFSET) -#define SW_API_IP_VSI_MC_MODE_GET (70 + SW_API_IP_OFFSET) -#define SW_API_IP_VSI_MC_MODE_SET (71 + SW_API_IP_OFFSET) -#define SW_API_GLOBAL_CTRL_GET (72 + SW_API_IP_OFFSET) -#define SW_API_GLOBAL_CTRL_SET (73 + SW_API_IP_OFFSET) - - /* nat */ -#define SW_API_NAT_OFFSET 1700 -#define SW_API_NAT_ADD (0 + SW_API_NAT_OFFSET) -#define SW_API_NAT_DEL (1 + SW_API_NAT_OFFSET) -#define SW_API_NAT_GET (2 + SW_API_NAT_OFFSET) -#define SW_API_NAT_NEXT (3 + SW_API_NAT_OFFSET) -#define SW_API_NAT_COUNTER_BIND (4 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_ADD (5 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_DEL (6 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_GET (7 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_NEXT (8 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_COUNTER_BIND (9 + SW_API_NAT_OFFSET) -#define SW_API_NAT_STATUS_SET (10 + SW_API_NAT_OFFSET) -#define SW_API_NAT_STATUS_GET (11 + SW_API_NAT_OFFSET) -#define SW_API_NAT_HASH_MODE_SET (12 + SW_API_NAT_OFFSET) -#define SW_API_NAT_HASH_MODE_GET (13 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_STATUS_SET (14 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_STATUS_GET (15 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_MODE_SET (16 + SW_API_NAT_OFFSET) -#define SW_API_NAPT_MODE_GET (17 + SW_API_NAT_OFFSET) -#define SW_API_PRV_BASE_ADDR_SET (18 + SW_API_NAT_OFFSET) -#define SW_API_PRV_BASE_ADDR_GET (19 + SW_API_NAT_OFFSET) -#define SW_API_PRV_ADDR_MODE_SET (20 + SW_API_NAT_OFFSET) -#define SW_API_PRV_ADDR_MODE_GET (21 + SW_API_NAT_OFFSET) -#define SW_API_PUB_ADDR_ENTRY_ADD (22 + SW_API_NAT_OFFSET) -#define SW_API_PUB_ADDR_ENTRY_DEL (23 + SW_API_NAT_OFFSET) -#define SW_API_PUB_ADDR_ENTRY_NEXT (24 + SW_API_NAT_OFFSET) -#define SW_API_NAT_UNK_SESSION_CMD_SET (25 + SW_API_NAT_OFFSET) -#define SW_API_NAT_UNK_SESSION_CMD_GET (26 + SW_API_NAT_OFFSET) -#define SW_API_PRV_BASE_MASK_SET (27 + SW_API_NAT_OFFSET) -#define SW_API_PRV_BASE_MASK_GET (28 + SW_API_NAT_OFFSET) -#define SW_API_NAT_GLOBAL_SET (29 + SW_API_NAT_OFFSET) -#define SW_API_FLOW_ADD (30 + SW_API_NAT_OFFSET) -#define SW_API_FLOW_DEL (31 + SW_API_NAT_OFFSET) -#define SW_API_FLOW_GET (32 + SW_API_NAT_OFFSET) -#define SW_API_FLOW_NEXT (33 + SW_API_NAT_OFFSET) -#define SW_API_FLOW_COUNTER_BIND (34 + SW_API_NAT_OFFSET) -#define SW_API_FLOW_COOKIE_SET (35 + SW_API_NAT_OFFSET) -#define SW_API_FLOW_RFS_SET (36 + SW_API_NAT_OFFSET) - - - /* trunk */ -#define SW_API_TRUNK_OFFSET 1800 -#define SW_API_TRUNK_GROUP_SET (0 + SW_API_TRUNK_OFFSET) -#define SW_API_TRUNK_GROUP_GET (1 + SW_API_TRUNK_OFFSET) -#define SW_API_TRUNK_HASH_SET (2 + SW_API_TRUNK_OFFSET) -#define SW_API_TRUNK_HASH_GET (3 + SW_API_TRUNK_OFFSET) -#define SW_API_TRUNK_MAN_SA_SET (4 + SW_API_TRUNK_OFFSET) -#define SW_API_TRUNK_MAN_SA_GET (5 + SW_API_TRUNK_OFFSET) -#define SW_API_TRUNK_FAILOVER_EN_SET (6 + SW_API_TRUNK_OFFSET) -#define SW_API_TRUNK_FAILOVER_EN_GET (7 + SW_API_TRUNK_OFFSET) - - /* Interface Control */ -#define SW_API_INTERFACE_OFFSET 1900 -#define SW_API_MAC_MODE_SET (0 + SW_API_INTERFACE_OFFSET) -#define SW_API_MAC_MODE_GET (1 + SW_API_INTERFACE_OFFSET) -#define SW_API_PORT_3AZ_STATUS_SET (2 + SW_API_INTERFACE_OFFSET) -#define SW_API_PORT_3AZ_STATUS_GET (3 + SW_API_INTERFACE_OFFSET) -#define SW_API_PHY_MODE_SET (4 + SW_API_INTERFACE_OFFSET) -#define SW_API_PHY_MODE_GET (5 + SW_API_INTERFACE_OFFSET) -#define SW_API_FX100_CTRL_SET (6 + SW_API_INTERFACE_OFFSET) -#define SW_API_FX100_CTRL_GET (7 + SW_API_INTERFACE_OFFSET) -#define SW_API_FX100_STATUS_GET (8 + SW_API_INTERFACE_OFFSET) -#define SW_API_MAC06_EXCH_SET (9 + SW_API_INTERFACE_OFFSET) -#define SW_API_MAC06_EXCH_GET (10 + SW_API_INTERFACE_OFFSET) - - /* VSI */ -#define SW_API_VSI_OFFSET 2000 -#define SW_API_VSI_ALLOC (0 + SW_API_VSI_OFFSET) -#define SW_API_VSI_FREE (1 + SW_API_VSI_OFFSET) -#define SW_API_PORT_VSI_SET (2 + SW_API_VSI_OFFSET) -#define SW_API_PORT_VSI_GET (3 + SW_API_VSI_OFFSET) -#define SW_API_PORT_VLAN_VSI_SET (4 + SW_API_VSI_OFFSET) -#define SW_API_PORT_VLAN_VSI_GET (5 + SW_API_VSI_OFFSET) -#define SW_API_VSI_TBL_DUMP (6 + SW_API_VSI_OFFSET) -#define SW_API_VSI_NEWADDR_LRN_SET (7 + SW_API_VSI_OFFSET) -#define SW_API_VSI_NEWADDR_LRN_GET (8 + SW_API_VSI_OFFSET) -#define SW_API_VSI_STAMOVE_SET (9 + SW_API_VSI_OFFSET) -#define SW_API_VSI_STAMOVE_GET (10 + SW_API_VSI_OFFSET) -#define SW_API_VSI_MEMBER_SET (11 + SW_API_VSI_OFFSET) -#define SW_API_VSI_MEMBER_GET (12 + SW_API_VSI_OFFSET) -#define SW_API_VSI_COUNTER_GET (13 + SW_API_VSI_OFFSET) -#define SW_API_VSI_COUNTER_CLEANUP (14 + SW_API_VSI_OFFSET) - - /* qm */ -#define SW_API_QM_OFFSET 2100 -#define SW_API_UCAST_QUEUE_BASE_PROFILE_SET (0 + SW_API_QM_OFFSET) -#define SW_API_UCAST_QUEUE_BASE_PROFILE_GET (1 + SW_API_QM_OFFSET) -#define SW_API_UCAST_PRIORITY_CLASS_SET (2 + SW_API_QM_OFFSET) -#define SW_API_UCAST_PRIORITY_CLASS_GET (3 + SW_API_QM_OFFSET) -#define SW_API_MCAST_PRIORITY_CLASS_SET (4 + SW_API_QM_OFFSET) -#define SW_API_MCAST_PRIORITY_CLASS_GET (5 + SW_API_QM_OFFSET) -#define SW_API_UCAST_HASH_MAP_SET (6 + SW_API_QM_OFFSET) -#define SW_API_UCAST_HASH_MAP_GET (7 + SW_API_QM_OFFSET) -#define SW_API_UCAST_DFLT_HASH_MAP_SET (8 + SW_API_QM_OFFSET) -#define SW_API_UCAST_DFLT_HASH_MAP_GET (9 + SW_API_QM_OFFSET) -#define SW_API_MCAST_CPUCODE_CLASS_SET (10 + SW_API_QM_OFFSET) -#define SW_API_MCAST_CPUCODE_CLASS_GET (11 + SW_API_QM_OFFSET) -#define SW_API_QUEUE_FLUSH (12 + SW_API_QM_OFFSET) -#define SW_API_AC_CTRL_SET (13 + SW_API_QM_OFFSET) -#define SW_API_AC_CTRL_GET (14 + SW_API_QM_OFFSET) -#define SW_API_AC_PRE_BUFFER_SET (15 + SW_API_QM_OFFSET) -#define SW_API_AC_PRE_BUFFER_GET (16 + SW_API_QM_OFFSET) -#define SW_API_QUEUE_GROUP_SET (17 + SW_API_QM_OFFSET) -#define SW_API_QUEUE_GROUP_GET (18 + SW_API_QM_OFFSET) -#define SW_API_STATIC_THRESH_SET (19 + SW_API_QM_OFFSET) -#define SW_API_STATIC_THRESH_GET (20 + SW_API_QM_OFFSET) -#define SW_API_DYNAMIC_THRESH_SET (21 + SW_API_QM_OFFSET) -#define SW_API_DYNAMIC_THRESH_GET (22 + SW_API_QM_OFFSET) -#define SW_API_GOURP_BUFFER_SET (23 + SW_API_QM_OFFSET) -#define SW_API_GOURP_BUFFER_GET (24 + SW_API_QM_OFFSET) -#define SW_API_QUEUE_CNT_CTRL_GET (25 + SW_API_QM_OFFSET) -#define SW_API_QUEUE_CNT_CTRL_SET (26 + SW_API_QM_OFFSET) -#define SW_API_QUEUE_CNT_GET (27 + SW_API_QM_OFFSET) -#define SW_API_QUEUE_CNT_CLEANUP (28 + SW_API_QM_OFFSET) -#define SW_API_QM_ENQUEUE_CTRL_SET (29 + SW_API_QM_OFFSET) -#define SW_API_QM_ENQUEUE_CTRL_GET (30 + SW_API_QM_OFFSET) -#define SW_API_QM_SOURCE_PROFILE_SET (31 + SW_API_QM_OFFSET) -#define SW_API_QM_SOURCE_PROFILE_GET (32 + SW_API_QM_OFFSET) - -/* flow */ -#define SW_API_FLOW_OFFSET 2200 -#define SW_API_FLOW_STATUS_SET (0 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_STATUS_GET (1 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_AGE_TIMER_SET (2 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_AGE_TIMER_GET (3 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_CTRL_SET (4 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_CTRL_GET (5 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_ENTRY_ADD (6 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_ENTRY_DEL (7 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_ENTRY_GET (8 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_GLOBAL_CFG_GET (9 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_GLOBAL_CFG_SET (10 + SW_API_FLOW_OFFSET) -#define SW_API_FLOWENTRY_NEXT (11 + SW_API_FLOW_OFFSET) - -#define SW_API_FLOW_HOST_ADD (20 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_HOST_DEL (21 + SW_API_FLOW_OFFSET) -#define SW_API_FLOW_HOST_GET (22 + SW_API_FLOW_OFFSET) - -/* rss hash */ -#define SW_API_RSS_HASH_OFFSET 2400 -#define SW_API_RSS_HASH_CONFIG_SET (0 + SW_API_RSS_HASH_OFFSET) -#define SW_API_RSS_HASH_CONFIG_GET (1 + SW_API_RSS_HASH_OFFSET) - -/* bm */ -#define SW_API_BM_OFFSET 3000 -#define SW_API_BM_CTRL_SET (0 + SW_API_BM_OFFSET) -#define SW_API_BM_CTRL_GET (1 + SW_API_BM_OFFSET) -#define SW_API_BM_PORTGROUP_MAP_SET (2 + SW_API_BM_OFFSET) -#define SW_API_BM_PORTGROUP_MAP_GET (3 + SW_API_BM_OFFSET) -#define SW_API_BM_GROUP_BUFFER_SET (4 + SW_API_BM_OFFSET) -#define SW_API_BM_GROUP_BUFFER_GET (5 + SW_API_BM_OFFSET) -#define SW_API_BM_PORT_RSVBUFFER_SET (6 + SW_API_BM_OFFSET) -#define SW_API_BM_PORT_RSVBUFFER_GET (7 + SW_API_BM_OFFSET) -#define SW_API_BM_STATIC_THRESH_SET (8 + SW_API_BM_OFFSET) -#define SW_API_BM_STATIC_THRESH_GET (9 + SW_API_BM_OFFSET) -#define SW_API_BM_DYNAMIC_THRESH_SET (10 + SW_API_BM_OFFSET) -#define SW_API_BM_DYNAMIC_THRESH_GET (11 + SW_API_BM_OFFSET) -#define SW_API_BM_PORT_COUNTER_GET (12 + SW_API_BM_OFFSET) - -/* ptp */ -#define SW_API_PTP_OFFSET 3100 -#define SW_API_PTP_CONFIG_SET (0 + SW_API_PTP_OFFSET) -#define SW_API_PTP_CONFIG_GET (1 + SW_API_PTP_OFFSET) -#define SW_API_PTP_REFERENCE_CLOCK_SET (2 + SW_API_PTP_OFFSET) -#define SW_API_PTP_REFERENCE_CLOCK_GET (3 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RX_TIMESTAMP_MODE_SET (4 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RX_TIMESTAMP_MODE_GET (5 + SW_API_PTP_OFFSET) -#define SW_API_PTP_TIMESTAMP_GET (6 + SW_API_PTP_OFFSET) -#define SW_API_PTP_PKT_TIMESTAMP_SET (7 + SW_API_PTP_OFFSET) -#define SW_API_PTP_PKT_TIMESTAMP_GET (8 + SW_API_PTP_OFFSET) -#define SW_API_PTP_GRANDMASTER_MODE_SET (9 + SW_API_PTP_OFFSET) -#define SW_API_PTP_GRANDMASTER_MODE_GET (10 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RTC_TIME_SET (11 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RTC_TIME_GET (12 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RTC_TIME_CLEAR (13 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RTC_ADJTIME_SET (14 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RTC_ADJFREQ_SET (15 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RTC_ADJFREQ_GET (16 + SW_API_PTP_OFFSET) -#define SW_API_PTP_LINK_DELAY_SET (17 + SW_API_PTP_OFFSET) -#define SW_API_PTP_LINK_DELAY_GET (18 + SW_API_PTP_OFFSET) -#define SW_API_PTP_SECURITY_SET (19 + SW_API_PTP_OFFSET) -#define SW_API_PTP_SECURITY_GET (20 + SW_API_PTP_OFFSET) -#define SW_API_PTP_PPS_SIGNAL_CONTROL_SET (21 + SW_API_PTP_OFFSET) -#define SW_API_PTP_PPS_SIGNAL_CONTROL_GET (22 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RX_CRC_RECALC_SET (23 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RX_CRC_RECALC_GET (24 + SW_API_PTP_OFFSET) -#define SW_API_PTP_ASYM_CORRECTION_SET (25 + SW_API_PTP_OFFSET) -#define SW_API_PTP_ASYM_CORRECTION_GET (26 + SW_API_PTP_OFFSET) -#define SW_API_PTP_OUTPUT_WAVEFORM_SET (27 + SW_API_PTP_OFFSET) -#define SW_API_PTP_OUTPUT_WAVEFORM_GET (28 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RTC_TIME_SNAPSHOT_SET (29 + SW_API_PTP_OFFSET) -#define SW_API_PTP_RTC_TIME_SNAPSHOT_GET (30 + SW_API_PTP_OFFSET) -#define SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_SET (31 + SW_API_PTP_OFFSET) -#define SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_GET (32 + SW_API_PTP_OFFSET) -#define SW_API_PTP_TOD_UART_SET (33 + SW_API_PTP_OFFSET) -#define SW_API_PTP_TOD_UART_GET (34 + SW_API_PTP_OFFSET) -#define SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET (35 + SW_API_PTP_OFFSET) -#define SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET (36 + SW_API_PTP_OFFSET) -#define SW_API_PTP_TRIGGER_SET (37 + SW_API_PTP_OFFSET) -#define SW_API_PTP_TRIGGER_GET (38 + SW_API_PTP_OFFSET) -#define SW_API_PTP_CAPTURE_SET (39 + SW_API_PTP_OFFSET) -#define SW_API_PTP_CAPTURE_GET (40 + SW_API_PTP_OFFSET) -#define SW_API_PTP_INTERRUPT_SET (41 + SW_API_PTP_OFFSET) -#define SW_API_PTP_INTERRUPT_GET (42 + SW_API_PTP_OFFSET) - -/* sfp */ -#define SW_API_SFP_OFFSET 3200 -#define SW_API_SFP_DATA_GET (0 + SW_API_SFP_OFFSET) -#define SW_API_SFP_DATA_SET (1 + SW_API_SFP_OFFSET) -#define SW_API_SFP_DEV_TYPE_GET (2 + SW_API_SFP_OFFSET) -#define SW_API_SFP_TRANSC_CODE_GET (3 + SW_API_SFP_OFFSET) -#define SW_API_SFP_RATE_ENCODE_GET (4 + SW_API_SFP_OFFSET) -#define SW_API_SFP_LINK_LENGTH_GET (5 + SW_API_SFP_OFFSET) -#define SW_API_SFP_VENDOR_INFO_GET (6 + SW_API_SFP_OFFSET) -#define SW_API_SFP_LASER_WAVELENGTH_GET (7 + SW_API_SFP_OFFSET) -#define SW_API_SFP_OPTION_GET (8 + SW_API_SFP_OFFSET) -#define SW_API_SFP_CTRL_RATE_GET (9 + SW_API_SFP_OFFSET) -#define SW_API_SFP_ENHANCED_CFG_GET (10 + SW_API_SFP_OFFSET) -#define SW_API_SFP_DIAG_THRESHOLD_GET (11 + SW_API_SFP_OFFSET) -#define SW_API_SFP_DIAG_CAL_CONST_GET (12 + SW_API_SFP_OFFSET) -#define SW_API_SFP_DIAG_REALTIME_GET (13 + SW_API_SFP_OFFSET) -#define SW_API_SFP_DIAG_CTRL_STATUS_GET (14 + SW_API_SFP_OFFSET) -#define SW_API_SFP_DIAG_ALARM_WARN_FLAG_GET (15 + SW_API_SFP_OFFSET) -#define SW_API_SFP_CHECKCODE_GET (16 + SW_API_SFP_OFFSET) - -/*qca808x_start*/ - /*debug*/ -#define SW_API_DEBUG_OFFSET 10000 -#define SW_API_PHY_GET (0 + SW_API_DEBUG_OFFSET) -#define SW_API_PHY_SET (1 + SW_API_DEBUG_OFFSET) -/*qca808x_end*/ -#define SW_API_REG_GET (2 + SW_API_DEBUG_OFFSET) -#define SW_API_REG_SET (3 + SW_API_DEBUG_OFFSET) -#define SW_API_REG_ENTRY_GET (4 + SW_API_DEBUG_OFFSET) -#define SW_API_REG_ENTRY_SET (5 + SW_API_DEBUG_OFFSET) -#define SW_API_REG_FIELD_GET (6 + SW_API_DEBUG_OFFSET) -#define SW_API_REG_FIELD_SET (7 + SW_API_DEBUG_OFFSET) -#define SW_API_PSGMII_REG_GET (8 + SW_API_DEBUG_OFFSET) -#define SW_API_PSGMII_REG_SET (9 + SW_API_DEBUG_OFFSET) -#define SW_API_REG_DUMP (10 + SW_API_DEBUG_OFFSET) -#define SW_API_DBG_REG_DUMP (11 + SW_API_DEBUG_OFFSET) -#define SW_API_DBG_PSGMII_SELF_TEST (12 + SW_API_DEBUG_OFFSET) -#define SW_API_PHY_DUMP (13 + SW_API_DEBUG_OFFSET) -#define SW_API_UNIPHY_REG_GET (20 + SW_API_DEBUG_OFFSET) -#define SW_API_UNIPHY_REG_SET (21 + SW_API_DEBUG_OFFSET) - /* Ctrlpkt Control */ -#define SW_API_CTRLPKT_OFFSET 2500 -#define SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET (0 + SW_API_CTRLPKT_OFFSET) -#define SW_API_MGMTCTRL_ETHTYPE_PROFILE_GET (1 + SW_API_CTRLPKT_OFFSET) -#define SW_API_MGMTCTRL_RFDB_PROFILE_SET (2 + SW_API_CTRLPKT_OFFSET) -#define SW_API_MGMTCTRL_RFDB_PROFILE_GET (3 + SW_API_CTRLPKT_OFFSET) -#define SW_API_MGMTCTRL_CTRLPKT_PROFILE_ADD (4 + SW_API_CTRLPKT_OFFSET) -#define SW_API_MGMTCTRL_CTRLPKT_PROFILE_DEL (5 + SW_API_CTRLPKT_OFFSET) -#define SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETFIRST (6 + SW_API_CTRLPKT_OFFSET) -#define SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETNEXT (7 + SW_API_CTRLPKT_OFFSET) - - /* Service Code */ -#define SW_API_SERVCODE_OFFSET 2600 -#define SW_API_SERVCODE_CONFIG_SET (0 + SW_API_SERVCODE_OFFSET) -#define SW_API_SERVCODE_CONFIG_GET (1 + SW_API_SERVCODE_OFFSET) -#define SW_API_SERVCODE_LOOPCHECK_EN (2 + SW_API_SERVCODE_OFFSET) -#define SW_API_SERVCODE_LOOPCHECK_STATUS_GET (3 + SW_API_SERVCODE_OFFSET) - - - /* POLICER */ -#define SW_API_POLICER_OFFSET 2800 -#define SW_API_POLICER_TIMESLOT_SET (0 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_TIMESLOT_GET (1 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_PORT_COUNTER_GET (2 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_ACL_COUNTER_GET (3 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_COMPENSATION_SET (4 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_COMPENSATION_GET (5 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_PORT_ENTRY_SET (6 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_PORT_ENTRY_GET (7 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_ACL_ENTRY_SET (8 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_ACL_ENTRY_GET (9 + SW_API_POLICER_OFFSET) -#define SW_API_POLICER_GLOBAL_COUNTER_GET (10 + SW_API_POLICER_OFFSET) - - -/* SHAPER */ -#define SW_API_SHAPER_OFFSET 2900 -#define SW_API_PORT_SHAPER_TIMESLOT_SET (0 + SW_API_SHAPER_OFFSET) -#define SW_API_PORT_SHAPER_TIMESLOT_GET (1 + SW_API_SHAPER_OFFSET) -#define SW_API_FLOW_SHAPER_TIMESLOT_SET (2 + SW_API_SHAPER_OFFSET) -#define SW_API_FLOW_SHAPER_TIMESLOT_GET (3 + SW_API_SHAPER_OFFSET) -#define SW_API_QUEUE_SHAPER_TIMESLOT_SET (4 + SW_API_SHAPER_OFFSET) -#define SW_API_QUEUE_SHAPER_TIMESLOT_GET (5 + SW_API_SHAPER_OFFSET) -#define SW_API_PORT_SHAPER_TOKEN_NUMBER_SET (6 + SW_API_SHAPER_OFFSET) -#define SW_API_PORT_SHAPER_TOKEN_NUMBER_GET (7 + SW_API_SHAPER_OFFSET) -#define SW_API_FLOW_SHAPER_TOKEN_NUMBER_SET (8 + SW_API_SHAPER_OFFSET) -#define SW_API_FLOW_SHAPER_TOKEN_NUMBER_GET (9 + SW_API_SHAPER_OFFSET) -#define SW_API_QUEUE_SHAPER_TOKEN_NUMBER_SET (10 + SW_API_SHAPER_OFFSET) -#define SW_API_QUEUE_SHAPER_TOKEN_NUMBER_GET (11 + SW_API_SHAPER_OFFSET) -#define SW_API_PORT_SHAPER_SET (12 + SW_API_SHAPER_OFFSET) -#define SW_API_PORT_SHAPER_GET (13 + SW_API_SHAPER_OFFSET) -#define SW_API_FLOW_SHAPER_SET (14 + SW_API_SHAPER_OFFSET) -#define SW_API_FLOW_SHAPER_GET (15 + SW_API_SHAPER_OFFSET) -#define SW_API_QUEUE_SHAPER_SET (16 + SW_API_SHAPER_OFFSET) -#define SW_API_QUEUE_SHAPER_GET (17 + SW_API_SHAPER_OFFSET) -#define SW_API_SHAPER_IPG_PRE_SET (18 + SW_API_SHAPER_OFFSET) -#define SW_API_SHAPER_IPG_PRE_GET (19 + SW_API_SHAPER_OFFSET) -/*qca808x_start*/ -#define SW_API_MAX 0xffff -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _SW_IOCTL_H_ */ -/*qca808x_end*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/common/aos_head.h b/feeds/ipq807x/qca-ssdk-shell/src/include/common/aos_head.h deleted file mode 100755 index 3332f0ae2..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/common/aos_head.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014,2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/*qca808x_start*/ -#include "aos_mem.h" -#include "aos_types.h" -/*qca808x_end*/ -#include "aos_timer.h" -#include "aos_lock.h" diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/common/shared_func.h b/feeds/ipq807x/qca-ssdk-shell/src/include/common/shared_func.h deleted file mode 100755 index 6b0d72587..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/common/shared_func.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _SHARED_FUNC_H -#define _SHARED_FUNC_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define SW_RTN_ON_ERROR(rtn) \ - do { if (rtn != SW_OK) return(rtn); } while(0); - -#define SW_OUT_ON_ERROR(rtn) \ - do { \ - if (rtn != SW_OK) { \ - rv = rtn; \ - goto out;\ - } \ - } while(0); - -#define SW_RTN_ON_ERROR_EXCEPT_COND1(rtn, cond1) \ - do { \ - if ((rtn != SW_OK) && (rtn != cond1)) \ - return rtn; \ - }while(0); - -#define SW_RTN_ON_NULL(op) \ - do { \ - if ((op) == NULL) \ - return SW_NOT_INITIALIZED;\ - }while(0); - - /* register functions */ -#define SW_BIT_MASK_U32(nr) (~(0xFFFFFFFF << (nr))) - -#define SW_FIELD_MASK_U32(offset, len) \ - ((SW_BIT_MASK_U32(len) << (offset))) - -#define SW_FIELD_MASK_NOT_U32(offset,len) \ - (~(SW_BIT_MASK_U32(len) << (offset))) - -#define SW_FIELD_2_REG(field_val, bit_offset) \ - (field_val << (bit_offset) ) - -#define SW_REG_2_FIELD(reg_val, bit_offset, field_len) \ - (((reg_val) >> (bit_offset)) & ((1 << (field_len)) - 1)) - -#define SW_REG_SET_BY_FIELD_U32(reg_value, field_value, bit_offset, field_len)\ - do { \ - (reg_value) = \ - (((reg_value) & SW_FIELD_MASK_NOT_U32((bit_offset),(field_len))) \ - | (((field_value) & SW_BIT_MASK_U32(field_len)) << (bit_offset)));\ - } while (0) - -#define SW_FIELD_GET_BY_REG_U32(reg_value, field_value, bit_offset, field_len)\ - do { \ - (field_value) = \ - (((reg_value) >> (bit_offset)) & SW_BIT_MASK_U32(field_len)); \ - } while (0) - -#define SW_SWAP_BITS_U8(x) \ - ((((x)&0x80)>>7) | (((x)&0x40)>>5) | (((x)&0x20)>>3) | (((x)&0x10)>>1) \ - |(((x)&0x1)<<7) | (((x)&0x2)<<5) | (((x)&0x4)<<3) |(((x)&0x8)<<1) ) - - -#define SW_OFFSET_U8_2_U16(byte_offset) ((byte_offset) >> 1) - -#define SW_OFFSET_U16_2_U8(word16_offset) ((word16_offset) << 1) - -#define SW_OFFSET_BIT_2_U8_ALIGN16(bit_offset) (((bit_offset) / 16) * 2) - -#define SW_SET_REG_BY_FIELD(reg, field, field_value, reg_value) \ - SW_REG_SET_BY_FIELD_U32(reg_value, field_value, reg##_##field##_BOFFSET, \ - reg##_##field##_BLEN) - -#define SW_GET_FIELD_BY_REG(reg, field, field_value, reg_value) \ - SW_FIELD_GET_BY_REG_U32(reg_value, field_value, reg##_##field##_BOFFSET, \ - reg##_##field##_BLEN) - - /* port bitmap functions */ -#define SW_IS_PBMP_MEMBER(pbm, port) ((pbm & (1 << port)) ? A_TRUE: A_FALSE) -#define SW_IS_PBMP_EQ(pbm0, pbm1) ((pbm0 == pbm1) ? A_TRUE: A_FALSE) - -#define SW_PBMP_AND(pbm0, pbm1) ((pbm0) &= (pbm1)) -#define SW_PBMP_OR(pbm0, pbm1) ((pbm0) |= (pbm1)) -#define SW_IS_PBMP_INCLUDE(pbm0, pbm1) \ - ((pbm1 == SW_PBMP_AND(pbm0, pbm1)) ? A_TRUE: A_FALSE) - -#define SW_PBMP_CLEAR(pbm) ((pbm) = 0) -#define SW_PBMP_ADD_PORT(pbm, port) ((pbm) |= (1U << (port))) -#define SW_PBMP_DEL_PORT(pbm,port) ((pbm) &= ~(1U << (port))) - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _SHARED_FUNC_H */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw.h b/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw.h deleted file mode 100755 index 2793cd205..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2014,2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _SW_H_ -#define _SW_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "sw_config.h" -#include "aos_head.h" -#include "sw_error.h" -#include "shared_func.h" - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _SW_H_ */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw_config.h b/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw_config.h deleted file mode 100755 index 7809571fc..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw_config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _SW_CONFIG_H -#define _SW_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define SW_MAX_NR_DEV 3 -#define SW_MAX_NR_PORT 16 - -#ifdef HSL_STANDALONG -#define HSL_LOCAL -#else -#define HSL_LOCAL static -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw_error.h b/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw_error.h deleted file mode 100755 index e6cb2d20b..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/common/sw_error.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _SW_ERROR_H -#define _SW_ERROR_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - typedef enum { - SW_OK = 0, /* Operation succeeded */ - SW_FAIL = -1, /* Operation failed */ - SW_BAD_VALUE = -2, /* Illegal value */ - SW_OUT_OF_RANGE = -3, /* Value is out of range */ - SW_BAD_PARAM = -4, /* Illegal parameter(s) */ - SW_BAD_PTR = -5, /* Illegal pointer value */ - SW_BAD_LEN = -6, /* Wrong length */ - SW_BAD_STATE = -7, /* Wrong state of state machine */ - SW_READ_ERROR = -8, /* Read operation failed */ - SW_WRITE_ERROR = -9, /* Write operation failed */ - SW_CREATE_ERROR = -10, /* Fail in creating an entry */ - SW_DELETE_ERROR = -11, /* Fail in deleteing an entry */ - SW_NOT_FOUND = -12, /* Entry not found */ - SW_NO_CHANGE = -13, /* The parameter(s) is the same */ - SW_NO_MORE = -14, /* No more entry found */ - SW_NO_SUCH = -15, /* No such entry */ - SW_ALREADY_EXIST = -16, /* Tried to create existing entry */ - SW_FULL = -17, /* Table is full */ - SW_EMPTY = -18, /* Table is empty */ - SW_NOT_SUPPORTED = -19, /* This request is not support */ - SW_NOT_IMPLEMENTED = -20, /* This request is not implemented */ - SW_NOT_INITIALIZED = -21, /* The item is not initialized */ - SW_BUSY = -22, /* Operation is still running */ - SW_TIMEOUT = -23, /* Operation Time Out */ - SW_DISABLE = -24, /* Operation is disabled */ - SW_NO_RESOURCE = -25, /* Resource not available (memory ...) */ - SW_INIT_ERROR = -26, /* Error occured while INIT process */ - SW_NOT_READY = -27, /* The other side is not ready yet */ - SW_OUT_OF_MEM = -28, /* Cpu memory allocation failed. */ - SW_ABORTED = -29 /* Operation has been aborted. */ - } sw_error_t; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SW_ERROR_H */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/common/util.h b/feeds/ipq807x/qca-ssdk-shell/src/include/common/util.h deleted file mode 100755 index 94b5ab65f..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/common/util.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _UTIL_H_ -#define _UTIL_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define LL_IN_ORDER 0x1 -#define LL_FIX_NDNR 0x2 - - typedef enum { - LL_CMP_EQUAL = 0, - LL_CMP_GREATER = 1, - LL_CMP_SMALLER = 2 - } - ll_cmp_rslt_t; - - typedef ll_cmp_rslt_t(*ll_nd_cmp) (void *src, void *dest); - - typedef void (*ll_nd_dump) (void *data); - - typedef struct _sll_node_t - { - struct _sll_node_t *next; - void *data; - } sll_node_t; - - typedef struct - { - sll_node_t *fst_nd; - a_uint32_t nd_nr; - a_uint32_t flag; - ll_nd_cmp nd_cmp; - ll_nd_dump nd_dump; - sll_node_t *free_nd; - } sll_head_t; - - sll_head_t *sll_creat(ll_nd_cmp cmp_func, ll_nd_dump dump_func, - a_uint32_t flag, a_uint32_t nd_nr); - - void sll_destroy(sll_head_t * sll); - - void sll_lock(sll_head_t * sll); - - void sll_unlock(sll_head_t * sll); - - void *sll_nd_find(const sll_head_t * sll, void *data, - a_uint32_t * iterator); - - void *sll_nd_next(const sll_head_t * sll, a_uint32_t * iterator); - - sw_error_t sll_nd_insert(sll_head_t * sll, void *data); - - sw_error_t sll_nd_delete(sll_head_t * sll, void *data); - - typedef struct - { - a_uint32_t id_ptr; - a_uint32_t id_nr; - a_uint32_t id_min; - a_uint32_t id_size; - void *id_pool; - } sid_pool_t; - - sid_pool_t *sid_pool_creat(a_uint32_t id_nr, a_uint32_t min_id); - - void sid_pool_destroy(sid_pool_t * pool); - - sw_error_t sid_pool_id_alloc(sid_pool_t * pool, a_uint32_t * id); - - sw_error_t sid_pool_id_free(sid_pool_t * pool, a_uint32_t id); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _UTIL_H_ */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal.h deleted file mode 100755 index cdffadee4..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2014, 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/*qca808x_start*/ -#ifndef _FAL_H -#define _FAL_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -#include "fal_port_ctrl.h" -/*qca808x_end*/ -#include "fal_misc.h" -#include "fal_vlan.h" -#include "fal_fdb.h" -#include "fal_portvlan.h" -#include "fal_qos.h" -#include "fal_stp.h" -#include "fal_rate.h" -#include "fal_mirror.h" -#include "fal_leaky.h" -#include "fal_igmp.h" -#include "fal_mib.h" -#include "fal_acl.h" -#include "fal_led.h" -/*qca808x_start*/ -#include "fal_reg_access.h" -#include "fal_init.h" -/*qca808x_end*/ -#include "fal_cosmap.h" -#include "fal_ip.h" -#include "fal_nat.h" -#include "fal_sec.h" -#include "fal_trunk.h" -#include "fal_interface_ctrl.h" -#include "fal_fdb.h" -#include "fal_multi.h" -#include "fal_vsi.h" -#include "fal_qm.h" -#include "fal_flow.h" -#include "fal_ctrlpkt.h" -#include "fal_servcode.h" -#include "fal_rss_hash.h" -#include "fal_pppoe.h" -#include "fal_shaper.h" -#include "fal_bm.h" -#include "fal_policer.h" -#include "fal_ptp.h" -#include "fal_sfp.h" -/*qca808x_start*/ -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_H */ -/*qca808x_end*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_acl.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_acl.h deleted file mode 100755 index edb605e40..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_acl.h +++ /dev/null @@ -1,619 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_acl FAL_ACL - * @{ - */ -#ifndef _FAL_ACL_H_ -#define _FAL_ACL_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - - /** - @brief This enum defines the ACL rule type. - */ - typedef enum { - FAL_ACL_RULE_MAC = 0, /**< include MAC, udf fields*/ - FAL_ACL_RULE_IP4, /**< include MAC, IP4 and Tcp/Udp udf fields*/ - FAL_ACL_RULE_IP6, /**< include MAC, IP6 and Tcp/Udp udf fields*/ - FAL_ACL_RULE_UDF, /**< only include user defined fields*/ - FAL_ACL_RULE_BUTT, - } - fal_acl_rule_type_t; - - - /** - @brief This enum defines the ACL field operation type. - */ - typedef enum - { - FAL_ACL_FIELD_MASK = 0, /**< match operation is mask*/ - FAL_ACL_FIELD_RANGE, /**< match operation is range*/ - FAL_ACL_FIELD_LE, /**< match operation is less and equal*/ - FAL_ACL_FIELD_GE, /**< match operation is great and equal*/ - FAL_ACL_FIELD_NE, /**<- match operation is not equal*/ - FAL_ACL_FIELD_OP_BUTT, - } fal_acl_field_op_t; - - - typedef enum - { - FAL_ACL_POLICY_ROUTE = 0, - FAL_ACL_POLICY_SNAT, - FAL_ACL_POLICY_DNAT, - FAL_ACL_POLICY_RESERVE, - } fal_policy_forward_t; - - typedef enum - { - FAL_ACL_COMBINED_NONE = 0, - FAL_ACL_COMBINED_START, - FAL_ACL_COMBINED_CONTINUE, - FAL_ACL_COMBINED_END, - } fal_combined_t; - - /** - @brief This enum defines the ACL field operation type. - */ - typedef enum - { - FAL_ACL_UDF_TYPE_L2 = 0, /**< */ - FAL_ACL_UDF_TYPE_L3, /**< */ - FAL_ACL_UDF_TYPE_L4, /**< */ - FAL_ACL_UDF_TYPE_L2_SNAP, /**< */ - FAL_ACL_UDF_TYPE_L3_PLUS, /**< */ - FAL_ACL_UDF_TYPE_BUTT, - } fal_acl_udf_type_t; - - /** - @brief This enum defines the ACL rule type. - */ - typedef enum { - FAL_ACL_UDF_NON_IP = 0, - FAL_ACL_UDF_IP4, - FAL_ACL_UDF_IP6, - FAL_ACL_UDF_BUTT, - }fal_acl_udf_pkt_type_t; - - typedef enum { - FAL_ACL_DEST_PORT_BMP = 0, /*dest info is bitmap*/ - FAL_ACL_DEST_NEXTHOP, /*dest info is nexthop*/ - FAL_ACL_DEST_PORT_ID, /*dest info is port id*/ - }fal_acl_dest_type_t; - -#define FAL_ACL_DEST_OFFSET(type,value) (((type)<<24)|(value)) -#define FAL_ACL_DEST_TYPE(dest) (((dest)>>24)&0xff) -#define FAL_ACL_DEST_VALUE(dest) ((dest)&0xffffff) - -#define FAL_ACL_FIELD_MAC_DA 0 -#define FAL_ACL_FIELD_MAC_SA 1 -#define FAL_ACL_FIELD_MAC_ETHTYPE 2 -#define FAL_ACL_FIELD_MAC_TAGGED 3 -#define FAL_ACL_FIELD_MAC_UP 4 -#define FAL_ACL_FIELD_MAC_VID 5 -#define FAL_ACL_FIELD_IP4_SIP 6 -#define FAL_ACL_FIELD_IP4_DIP 7 -#define FAL_ACL_FIELD_IP6_LABEL 8 -#define FAL_ACL_FIELD_IP6_SIP 9 -#define FAL_ACL_FIELD_IP6_DIP 10 -#define FAL_ACL_FIELD_IP_PROTO 11 -#define FAL_ACL_FIELD_IP_DSCP 12 -#define FAL_ACL_FIELD_L4_SPORT 13 -#define FAL_ACL_FIELD_L4_DPORT 14 -#define FAL_ACL_FIELD_UDF 15 -#define FAL_ACL_FIELD_MAC_CFI 16 -#define FAL_ACL_FIELD_ICMP_TYPE 17 -#define FAL_ACL_FIELD_ICMP_CODE 18 -#define FAL_ACL_FIELD_TCP_FLAG 19 -#define FAL_ACL_FIELD_RIPV1 20 -#define FAL_ACL_FIELD_DHCPV4 21 -#define FAL_ACL_FIELD_DHCPV6 22 -#define FAL_ACL_FIELD_MAC_STAG_VID 23 -#define FAL_ACL_FIELD_MAC_STAG_PRI 24 -#define FAL_ACL_FIELD_MAC_STAG_DEI 25 -#define FAL_ACL_FIELD_MAC_STAGGED 26 -#define FAL_ACL_FIELD_MAC_CTAG_VID 27 -#define FAL_ACL_FIELD_MAC_CTAG_PRI 28 -#define FAL_ACL_FIELD_MAC_CTAG_CFI 29 -#define FAL_ACL_FIELD_MAC_CTAGGED 30 -#define FAL_ACL_FIELD_INVERSE_ALL 31 -/*new add for hawkeye*/ -#define FAL_ACL_FIELD_POST_ROURING_EN 32 -#define FAL_ACL_FIELD_RES_CHAIN 33 -#define FAL_ACL_FIELD_FAKE_MAC_HEADER 34 -#define FAL_ACL_FIELD_SNAP 35 -#define FAL_ACL_FIELD_ETHERNET 36 -#define FAL_ACL_FIELD_IPV6 37 -#define FAL_ACL_FIELD_IP 38 -#define FAL_ACL_FIELD_VSI 39 -#define FAL_ACL_FIELD_PPPOE_SESSIONID 40 -#define FAL_ACL_FIELD_L3_FRAGMENT 41 -#define FAL_ACL_FIELD_AH_HEADER 42 -#define FAL_ACL_FIELD_ESP_HEADER 43 -#define FAL_ACL_FIELD_MOBILITY_HEADER 44 -#define FAL_ACL_FIELD_FRAGMENT_HEADER 45 -#define FAL_ACL_FIELD_OTHER_EXT_HEADER 46 -#define FAL_ACL_FIELD_L3_TTL 47 -#define FAL_ACL_FIELD_IPV4_OPTION 48 -#define FAL_ACL_FIELD_FIRST_FRAGMENT 49 -#define FAL_ACL_FIELD_L3_LENGTH 50 -#define FAL_ACL_FIELD_VSI_VALID 51 -#define FAL_ACL_FIELD_IP_PKT_TYPE 52 - -#define FAL_ACL_FIELD_UDF0 53 -#define FAL_ACL_FIELD_UDF1 54 -#define FAL_ACL_FIELD_UDF2 55 -#define FAL_ACL_FIELD_UDF3 56 - -#define FAL_ACL_FIELD_NUM 57 - - -#define FAL_ACL_ACTION_PERMIT 0 -#define FAL_ACL_ACTION_DENY 1 -#define FAL_ACL_ACTION_REDPT 2 -#define FAL_ACL_ACTION_RDTCPU 3 -#define FAL_ACL_ACTION_CPYCPU 4 -#define FAL_ACL_ACTION_MIRROR 5 -#define FAL_ACL_ACTION_MODIFY_VLAN 6 -#define FAL_ACL_ACTION_NEST_VLAN 7 -#define FAL_ACL_ACTION_REMARK_UP 8 -#define FAL_ACL_ACTION_REMARK_QUEUE 9 -#define FAL_ACL_ACTION_REMARK_STAG_VID 10 -#define FAL_ACL_ACTION_REMARK_STAG_PRI 11 -#define FAL_ACL_ACTION_REMARK_STAG_DEI 12 -#define FAL_ACL_ACTION_REMARK_CTAG_VID 13 -#define FAL_ACL_ACTION_REMARK_CTAG_PRI 14 -#define FAL_ACL_ACTION_REMARK_CTAG_CFI 15 -#define FAL_ACL_ACTION_REMARK_LOOKUP_VID 16 -#define FAL_ACL_ACTION_REMARK_DSCP 17 -#define FAL_ACL_ACTION_POLICER_EN 18 -#define FAL_ACL_ACTION_WCMP_EN 19 -#define FAL_ACL_ACTION_ARP_EN 20 -#define FAL_ACL_ACTION_POLICY_FORWARD_EN 21 -#define FAL_ACL_ACTION_BYPASS_EGRESS_TRANS 22 -#define FAL_ACL_ACTION_MATCH_TRIGGER_INTR 23 -/*new add for hawkeye*/ -#define FAL_ACL_ACTION_ENQUEUE_PRI 25 -#define FAL_ACL_ACTION_INT_DP 26 -#define FAL_ACL_ACTION_SERVICE_CODE 27 -#define FAL_ACL_ACTION_CPU_CODE 28 -#define FAL_ACL_ACTION_SYN_TOGGLE 29 -#define FAL_ACL_ACTION_METADATA_EN 30 - - -enum{ - FAL_ACL_BYPASS_IN_VLAN_MISS = 0, - FAL_ACL_BYPASS_SOUCE_GUARD, - FAL_ACL_BYPASS_MRU_MTU_CHECK, - FAL_ACL_BYPASS_EG_VSI_MEMBER_CHECK = 8, - FAL_ACL_BYPASS_EG_VLAN_TRANSLATION, - FAL_ACL_BYPASS_EG_VLAN_TAG_CTRL = 10, - FAL_ACL_BYPASS_FDB_LEARNING, - FAL_ACL_BYPASS_FDB_REFRESH, - FAL_ACL_BYPASS_L2_SECURITY,/*new address, station move, learn limit, hash full*/ - FAL_ACL_BYPASS_MANAGEMENT_FWD, - FAL_ACL_BYPASS_L2_FWD = 15, - FAL_ACL_BYPASS_IN_STP_CHECK, - FAL_ACL_BYPASS_EG_STP_CHECK, - FAL_ACL_BYPASS_SOURCE_FILTER, - FAL_ACL_BYPASS_POLICYER, - FAL_ACL_BYPASS_L2_EDIT = 20,/*VLAN tag edit*/ - FAL_ACL_BYPASS_L3_EDIT,/*Edit MAC address, PPPoE, IP address, TTL, DSCP, L4 port*/ - FAL_ACL_BYPASS_POST_ACL_CHECK_ROUTING, - FAL_ACL_BYPASS_PORT_ISOLATION, -}; - - - /** - * @brief This type defines the action in Acl rule. - * @details Comments: - * It's a bit map type, we can access it through macro FAL_ACTION_FLG_SET, - * FAL_ACTION_FLG_CLR and FAL_ACTION_FLG_TST. - */ - typedef a_uint32_t fal_acl_action_map_t; - -#define FAL_ACTION_FLG_SET(flag, action) \ - (flag) |= (0x1UL << (action)) - -#define FAL_ACTION_FLG_CLR(flag, action) \ - (flag) &= (~(0x1UL << (action))) - -#define FAL_ACTION_FLG_TST(flag, action) \ - ((flag) & (0x1UL << (action))) ? 1 : 0 - - - /** - * @brief This type defines the field in Acl rule. - * @details Comments: - * It's a bit map type, we can access it through macro FAL_FIELD_FLG_SET, - * FAL_FIELD_FLG_CLR and FAL_FIELD_FLG_TST. - */ - typedef a_uint32_t fal_acl_field_map_t[2]; - -#define FAL_FIELD_FLG_SET(flag, field) \ - ((flag[(field) / 32]) |= (0x1UL << ((field) % 32))) - -#define FAL_FIELD_FLG_CLR(flag, field) \ - ((flag[(field) / 32]) &= (~(0x1UL << ((field) % 32)))) - -#define FAL_FIELD_FLG_TST(flag, field) \ - (((flag[(field) / 32]) & (0x1UL << ((field) % 32))) ? 1 : 0) - -#define FAL_ACL_UDF_MAX_LENGTH 16 - - /** - * @brief This structure defines the Acl rule. - * @details Fields description: - * - * - * vid_val - If vid_op equals FAL_ACL_FIELD_MASK it's vlan id field value. - * If vid_op equals FAL_ACL_FIELD_RANGE it's vlan id field low value. If - * vid_op equals other value it's the compared value. - * - * vid_mask - If vid_op equals FAL_ACL_FIELD_MASK it's vlan id field mask. - * If vid_op equals FAL_ACL_FIELD_RANGE it's vlan id field high value. If vid_op - * equals other value it's meaningless. - * - * - * ip_dscp_val - It's eight bits field we can set any value between 0 - 255. - * ip_dscp_mask - It's eight bits field we can set any value between 0 - 255. - * - * - * src_l4port_val - If src_l4port_op equals FAL_ACL_FIELD_MASK it's layer four - * source port field value. If src_l4port_op equals FAL_ACL_FIELD_RANGE it's - * layer four source port field low value. If src_l4port_op equals other value - * it's the compared value. - * - * - * src_l4port_mask - If src_l4port_op equals FAL_ACL_FIELD_MASK it's layer four - * source port field mask. If src_l4port_op equals FAL_ACL_FIELD_RANGE it's - * layer four source port field high value. If src_l4port_op equals other value - * it's meaningless. - * - * - * dest_l4port_val - If dest_l4port_op equals FAL_ACL_FIELD_MASK it's layer four - * destination port field value. If dest_l4port_op equals FAL_ACL_FIELD_RANGE it's - * layer four source port field low value. If dest_l4port_op equals other value - * it's the compared value. - * - * - * dest_l4port_mask - If dest_l4port_op equals FAL_ACL_FIELD_MASK it's layer four - * source port field mask. If dest_l4port_op equals FAL_ACL_FIELD_RANGE it's - * layer four source port field high value. If dest_l4port_op equals other value - * it's meaningless. - * - * - * ports - If FAL_ACL_ACTION_REDPT bit is setted in action_flg it's redirect - * destination ports. - * - * - * dot1p - If FAL_ACL_ACTION_REMARK_DOT1P bit is setted in action_flg it's - * the expected dot1p value. - * - * - * queue - If FAL_ACL_ACTION_REMARK_QUEUE bit is setted in action_flg it's - * the expected queue value. - * - * - * vid - If FAL_ACL_ACTION_MODIFY_VLAN or FAL_ACL_ACTION_NEST_VLAN bit is - * setted in action_flg it's the expected vlan id value. - */ - typedef struct - { - fal_acl_rule_type_t rule_type; - fal_acl_field_map_t field_flg; - - /* fields of mac rule */ - fal_mac_addr_t src_mac_val; - fal_mac_addr_t src_mac_mask; - fal_mac_addr_t dest_mac_val; - fal_mac_addr_t dest_mac_mask; - a_uint16_t ethtype_val; - a_uint16_t ethtype_mask; - a_uint16_t vid_val; - a_uint16_t vid_mask; - fal_acl_field_op_t vid_op; - a_uint8_t tagged_val; - a_uint8_t tagged_mask; - a_uint8_t up_val; - a_uint8_t up_mask; - a_uint8_t cfi_val; - a_uint8_t cfi_mask; - a_uint16_t resv0; - - /* fields of enhanced mac rule*/ - a_uint8_t stagged_val; /*for s17c : 0-untag, 1-tag, for hawkeye: 2-pritag, 3-utag+pritag, 4- untag+tag, 5-tag+pritag, 6-all*/ - a_uint8_t stagged_mask; - a_uint8_t ctagged_val; - a_uint8_t ctagged_mask; - a_uint16_t stag_vid_val; - a_uint16_t stag_vid_mask; - fal_acl_field_op_t stag_vid_op; - a_uint16_t ctag_vid_val; - a_uint16_t ctag_vid_mask; - fal_acl_field_op_t ctag_vid_op; - a_uint8_t stag_pri_val; - a_uint8_t stag_pri_mask; - a_uint8_t ctag_pri_val; - a_uint8_t ctag_pri_mask; - a_uint8_t stag_dei_val; - a_uint8_t stag_dei_mask; - a_uint8_t ctag_cfi_val; - a_uint8_t ctag_cfi_mask; - - - /* fields of ip4 rule */ - fal_ip4_addr_t src_ip4_val; - fal_ip4_addr_t src_ip4_mask; - fal_ip4_addr_t dest_ip4_val; - fal_ip4_addr_t dest_ip4_mask; - - /* fields of ip6 rule */ - a_uint32_t ip6_lable_val; - a_uint32_t ip6_lable_mask; - fal_ip6_addr_t src_ip6_val; - fal_ip6_addr_t src_ip6_mask; - fal_ip6_addr_t dest_ip6_val; - fal_ip6_addr_t dest_ip6_mask; - - /* fields of ip rule */ - a_uint8_t ip_proto_val; - a_uint8_t ip_proto_mask; - a_uint8_t ip_dscp_val; - a_uint8_t ip_dscp_mask; - - /* fields of layer four */ - a_uint16_t src_l4port_val; - a_uint16_t src_l4port_mask; - fal_acl_field_op_t src_l4port_op; - a_uint16_t dest_l4port_val; - a_uint16_t dest_l4port_mask; - fal_acl_field_op_t dest_l4port_op; - a_uint8_t icmp_type_val; - a_uint8_t icmp_type_mask; - a_uint8_t icmp_code_val; - a_uint8_t icmp_code_mask; - a_uint8_t tcp_flag_val; - a_uint8_t tcp_flag_mask; - a_uint8_t ripv1_val; - a_uint8_t ripv1_mask; - a_uint8_t dhcpv4_val; - a_uint8_t dhcpv4_mask; - a_uint8_t dhcpv6_val; - a_uint8_t dhcpv6_mask; - - /* user defined fields */ - fal_acl_udf_type_t udf_type; - a_uint8_t udf_offset; - a_uint8_t udf_len; - a_uint8_t udf_val[FAL_ACL_UDF_MAX_LENGTH]; - a_uint8_t udf_mask[FAL_ACL_UDF_MAX_LENGTH]; - - /* fields of action */ - fal_acl_action_map_t action_flg; - fal_pbmp_t ports; /*high 8bits, 00-port bitmap, 01-nexthop, 10-vp*/ - a_uint32_t match_cnt; - a_uint16_t vid; - a_uint8_t up; - a_uint8_t queue; - a_uint16_t stag_vid; - a_uint8_t stag_pri; - a_uint8_t stag_dei; - a_uint16_t ctag_vid; - a_uint8_t ctag_pri; - a_uint8_t ctag_cfi; - a_uint16_t policer_ptr; - a_uint16_t arp_ptr; - a_uint16_t wcmp_ptr; - a_uint8_t dscp; - a_uint8_t rsv; - fal_policy_forward_t policy_fwd; - fal_combined_t combined; - - /*new add match fields for hawkeye*/ - a_uint8_t pri; /*rule priority 0-7*/ - a_bool_t post_routing; - a_uint8_t acl_pool; - - a_bool_t is_ip_val; - a_uint8_t is_ip_mask; - - a_bool_t is_ipv6_val; - a_uint8_t is_ipv6_mask; - - a_bool_t is_fake_mac_header_val; - a_uint8_t is_fake_mac_header_mask; - - a_bool_t is_snap_val; - a_uint8_t is_snap_mask; - - a_bool_t is_ethernet_val; - a_uint8_t is_ethernet_mask; - - a_bool_t is_fragement_val; - a_uint8_t is_fragement_mask; - - a_bool_t is_ah_header_val; - a_uint8_t is_ah_header_mask; - - a_bool_t is_esp_header_val; - a_uint8_t is_esp_header_mask; - - a_bool_t is_mobility_header_val; - a_uint8_t is_mobility_header_mask; - - a_bool_t is_fragment_header_val; - a_uint8_t is_fragment_header_mask; - - a_bool_t is_other_header_val; - a_uint8_t is_other_header_mask; - - a_bool_t is_ipv4_option_val; - a_uint8_t is_ipv4_option_mask; - - a_bool_t is_first_frag_val; - a_uint8_t is_first_frag_mask; - - /*fields of VLAN rule*/ - a_bool_t vsi_valid; - a_uint8_t vsi_valid_mask; - a_uint8_t vsi; /*0-31*/ - a_uint8_t vsi_mask; /*0-31*/ - /*fields of L2 MISC rule*/ - a_uint16_t pppoe_sessionid; - a_uint16_t pppoe_sessionid_mask; - fal_acl_field_op_t icmp_type_code_op; - /*fields of IP MISC rule*/ - a_uint8_t l3_ttl; - a_uint8_t l3_ttl_mask; - fal_acl_field_op_t l3_length_op; - a_uint16_t l3_length; - a_uint16_t l3_length_mask; - a_uint16_t l3_pkt_type; - a_uint16_t l3_pkt_type_mask; - /*field of udf*/ - fal_acl_field_op_t udf0_op; - a_uint16_t udf0_val; - a_uint16_t udf0_mask; - fal_acl_field_op_t udf1_op; - a_uint16_t udf1_val; - a_uint16_t udf1_mask; - a_uint16_t udf2_val; - a_uint16_t udf2_mask; - a_uint16_t udf3_val; - a_uint16_t udf3_mask; - - /*new add acl action for hawkeye*/ - a_uint32_t bypass_bitmap; - a_uint8_t enqueue_pri; - a_uint8_t stag_fmt; - a_uint8_t ctag_fmt; - a_uint8_t int_dp; - a_uint8_t service_code; - a_uint8_t cpu_code; - a_uint64_t match_bytes; - /*new add acl action for IPQ60xx*/ - a_uint8_t dscp_mask; - a_uint8_t qos_res_prec; - } fal_acl_rule_t; - - - /** - @brief This enum defines the ACL will work on which derection traffic. - */ - typedef enum - { - FAL_ACL_DIREC_IN = 0, /**< Acl will work on ingressive traffic */ - FAL_ACL_DIREC_EG, /**< Acl will work on egressive traffic */ - FAL_ACL_DIREC_BOTH, /**< Acl will work on both ingressive and egressive traffic*/ - } fal_acl_direc_t; - - - /** - @brief This enum defines the ACL will work on which partiualr object. - */ - typedef enum - { - FAL_ACL_BIND_PORT = 0, /**< Acl wil work on particular port and virtual port */ - FAL_ACL_BIND_PORTBITMAP = 1, /**< Acl wil work on port bitmap */ - FAL_ACL_BIND_SERVICE_CODE = 2, /**< Acl wil work on service code */ - FAL_ACL_BIND_L3_IF = 3, /**< Acl wil work on l3 interface */ - } fal_acl_bind_obj_t; - -enum -{ - /*acl*/ - FUNC_ACL_LIST_CREAT = 0, - FUNC_ACL_LIST_DESTROY, - FUNC_ACL_RULE_ADD, - FUNC_ACL_RULE_DELETE, - FUNC_ACL_RULE_QUERY, - FUNC_ACL_RULE_DUMP, - FUNC_ACL_LIST_BIND, - FUNC_ACL_LIST_UNBIND, - FUNC_ACL_LIST_DUMP, - FUNC_ACL_UDF_PROFILE_SET, - FUNC_ACL_UDF_PROFILE_GET, -}; - - -sw_error_t -fal_acl_list_creat(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t list_pri); - -sw_error_t -fal_acl_list_destroy(a_uint32_t dev_id, a_uint32_t list_id); - -sw_error_t -fal_acl_rule_add(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t rule_id, a_uint32_t rule_nr, fal_acl_rule_t * rule); - -sw_error_t -fal_acl_rule_delete(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t rule_id, a_uint32_t rule_nr); - -sw_error_t -fal_acl_rule_query(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t rule_id, fal_acl_rule_t * rule); - -sw_error_t -fal_acl_list_bind(a_uint32_t dev_id, a_uint32_t list_id, fal_acl_direc_t direc, fal_acl_bind_obj_t obj_t, a_uint32_t obj_idx); - -sw_error_t -fal_acl_list_unbind(a_uint32_t dev_id, a_uint32_t list_id, fal_acl_direc_t direc, fal_acl_bind_obj_t obj_t, a_uint32_t obj_idx); - -sw_error_t -fal_acl_status_set(a_uint32_t dev_id, a_bool_t enable); - -sw_error_t -fal_acl_status_get(a_uint32_t dev_id, a_bool_t * enable); - -sw_error_t -fal_acl_list_dump(a_uint32_t dev_id); - -sw_error_t -fal_acl_rule_dump(a_uint32_t dev_id); - -sw_error_t -fal_acl_port_udf_profile_set(a_uint32_t dev_id, fal_port_t port_id, fal_acl_udf_type_t udf_type, a_uint32_t offset, a_uint32_t length); -sw_error_t -fal_acl_port_udf_profile_get(a_uint32_t dev_id, fal_port_t port_id, fal_acl_udf_type_t udf_type, a_uint32_t * offset, a_uint32_t * length); - -sw_error_t -fal_acl_udf_profile_set(a_uint32_t dev_id, fal_acl_udf_pkt_type_t pkt_type,a_uint32_t udf_idx, fal_acl_udf_type_t udf_type, a_uint32_t offset); - -sw_error_t -fal_acl_udf_profile_get(a_uint32_t dev_id, fal_acl_udf_pkt_type_t pkt_type,a_uint32_t udf_idx, fal_acl_udf_type_t *udf_type, a_uint32_t *offset); - -sw_error_t -fal_acl_rule_active(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t rule_id, a_uint32_t rule_nr); -sw_error_t -fal_acl_rule_deactive(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t rule_id, a_uint32_t rule_nr); -sw_error_t -fal_acl_rule_src_filter_sts_set(a_uint32_t dev_id, a_uint32_t rule_id, a_bool_t enable); -sw_error_t -fal_acl_rule_src_filter_sts_get(a_uint32_t dev_id, a_uint32_t rule_id, a_bool_t* enable); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_ACL_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_api.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_api.h deleted file mode 100755 index 2a8121db2..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_api.h +++ /dev/null @@ -1,2115 +0,0 @@ -/* - * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/*qca808x_start*/ -#ifndef _FAL_API_H_ -#define _FAL_API_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -/*qca808x_end*/ -#ifdef IN_PORTCONTROL -/*qca808x_start*/ -#define PORTCONTROL_API \ - SW_API_DEF(SW_API_PT_DUPLEX_GET, fal_port_duplex_get), \ - SW_API_DEF(SW_API_PT_DUPLEX_SET, fal_port_duplex_set), \ - SW_API_DEF(SW_API_PT_SPEED_GET, fal_port_speed_get), \ - SW_API_DEF(SW_API_PT_SPEED_SET, fal_port_speed_set), \ - SW_API_DEF(SW_API_PT_AN_GET, fal_port_autoneg_status_get), \ - SW_API_DEF(SW_API_PT_AN_ENABLE, fal_port_autoneg_enable), \ - SW_API_DEF(SW_API_PT_AN_RESTART, fal_port_autoneg_restart), \ - SW_API_DEF(SW_API_PT_AN_ADV_GET, fal_port_autoneg_adv_get), \ - SW_API_DEF(SW_API_PT_AN_ADV_SET, fal_port_autoneg_adv_set), \ -/*qca808x_end*/\ - SW_API_DEF(SW_API_PT_HDR_SET, fal_port_hdr_status_set), \ - SW_API_DEF(SW_API_PT_HDR_GET, fal_port_hdr_status_get), \ - SW_API_DEF(SW_API_PT_FLOWCTRL_SET, fal_port_flowctrl_set), \ - SW_API_DEF(SW_API_PT_FLOWCTRL_GET, fal_port_flowctrl_get), \ - SW_API_DEF(SW_API_PT_FLOWCTRL_MODE_SET, fal_port_flowctrl_forcemode_set), \ - SW_API_DEF(SW_API_PT_FLOWCTRL_MODE_GET, fal_port_flowctrl_forcemode_get), \ - SW_API_DEF(SW_API_PT_POWERSAVE_SET, fal_port_powersave_set), \ - SW_API_DEF(SW_API_PT_POWERSAVE_GET, fal_port_powersave_get), \ -/*qca808x_start*/\ - SW_API_DEF(SW_API_PT_HIBERNATE_SET, fal_port_hibernate_set), \ - SW_API_DEF(SW_API_PT_HIBERNATE_GET, fal_port_hibernate_get), \ - SW_API_DEF(SW_API_PT_CDT, fal_port_cdt), \ -/*qca808x_end*/\ - SW_API_DEF(SW_API_PT_TXHDR_SET, fal_port_txhdr_mode_set), \ - SW_API_DEF(SW_API_PT_TXHDR_GET, fal_port_txhdr_mode_get), \ - SW_API_DEF(SW_API_PT_RXHDR_SET, fal_port_rxhdr_mode_set), \ - SW_API_DEF(SW_API_PT_RXHDR_GET, fal_port_rxhdr_mode_get), \ - SW_API_DEF(SW_API_HEADER_TYPE_SET, fal_header_type_set), \ - SW_API_DEF(SW_API_HEADER_TYPE_GET, fal_header_type_get), \ - SW_API_DEF(SW_API_TXMAC_STATUS_SET, fal_port_txmac_status_set), \ - SW_API_DEF(SW_API_TXMAC_STATUS_GET, fal_port_txmac_status_get), \ - SW_API_DEF(SW_API_RXMAC_STATUS_SET, fal_port_rxmac_status_set), \ - SW_API_DEF(SW_API_RXMAC_STATUS_GET, fal_port_rxmac_status_get), \ - SW_API_DEF(SW_API_TXFC_STATUS_SET, fal_port_txfc_status_set), \ - SW_API_DEF(SW_API_TXFC_STATUS_GET, fal_port_txfc_status_get), \ - SW_API_DEF(SW_API_RXFC_STATUS_SET, fal_port_rxfc_status_set), \ - SW_API_DEF(SW_API_RXFC_STATUS_GET, fal_port_rxfc_status_get), \ - SW_API_DEF(SW_API_BP_STATUS_SET, fal_port_bp_status_set), \ - SW_API_DEF(SW_API_BP_STATUS_GET, fal_port_bp_status_get), \ - SW_API_DEF(SW_API_PT_LINK_MODE_SET, fal_port_link_forcemode_set), \ - SW_API_DEF(SW_API_PT_LINK_MODE_GET, fal_port_link_forcemode_get), \ -/*qca808x_start*/\ - SW_API_DEF(SW_API_PT_LINK_STATUS_GET, fal_port_link_status_get), \ -/*qca808x_end*/\ - SW_API_DEF(SW_API_PT_MAC_LOOPBACK_SET, fal_port_mac_loopback_set), \ - SW_API_DEF(SW_API_PT_MAC_LOOPBACK_GET, fal_port_mac_loopback_get), \ - SW_API_DEF(SW_API_PTS_LINK_STATUS_GET, fal_ports_link_status_get), \ - SW_API_DEF(SW_API_PT_CONGESTION_DROP_SET, fal_port_congestion_drop_set), \ - SW_API_DEF(SW_API_PT_CONGESTION_DROP_GET, fal_port_congestion_drop_get), \ - SW_API_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_SET, fal_ring_flow_ctrl_thres_set), \ - SW_API_DEF(SW_API_PT_RING_FLOW_CTRL_THRES_GET, fal_ring_flow_ctrl_thres_get), \ -/*qca808x_start*/\ - SW_API_DEF(SW_API_PT_8023AZ_SET, fal_port_8023az_set), \ - SW_API_DEF(SW_API_PT_8023AZ_GET, fal_port_8023az_get), \ - SW_API_DEF(SW_API_PT_MDIX_SET, fal_port_mdix_set), \ - SW_API_DEF(SW_API_PT_MDIX_GET, fal_port_mdix_get), \ - SW_API_DEF(SW_API_PT_MDIX_STATUS_GET, fal_port_mdix_status_get), \ -/*qca808x_end*/\ - SW_API_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_SET, fal_port_combo_prefer_medium_set), \ - SW_API_DEF(SW_API_PT_COMBO_PREFER_MEDIUM_GET, fal_port_combo_prefer_medium_get), \ - SW_API_DEF(SW_API_PT_COMBO_MEDIUM_STATUS_GET, fal_port_combo_medium_status_get), \ - SW_API_DEF(SW_API_PT_COMBO_FIBER_MODE_SET, fal_port_combo_fiber_mode_set), \ - SW_API_DEF(SW_API_PT_COMBO_FIBER_MODE_GET, fal_port_combo_fiber_mode_get), \ -/*qca808x_start*/\ - SW_API_DEF(SW_API_PT_LOCAL_LOOPBACK_SET, fal_port_local_loopback_set), \ - SW_API_DEF(SW_API_PT_LOCAL_LOOPBACK_GET, fal_port_local_loopback_get), \ - SW_API_DEF(SW_API_PT_REMOTE_LOOPBACK_SET, fal_port_remote_loopback_set), \ - SW_API_DEF(SW_API_PT_REMOTE_LOOPBACK_GET, fal_port_remote_loopback_get), \ - SW_API_DEF(SW_API_PT_RESET, fal_port_reset), \ - SW_API_DEF(SW_API_PT_POWER_OFF, fal_port_power_off), \ - SW_API_DEF(SW_API_PT_POWER_ON, fal_port_power_on), \ - SW_API_DEF(SW_API_PT_MAGIC_FRAME_MAC_SET, fal_port_magic_frame_mac_set), \ - SW_API_DEF(SW_API_PT_MAGIC_FRAME_MAC_GET, fal_port_magic_frame_mac_get), \ - SW_API_DEF(SW_API_PT_PHY_ID_GET, fal_port_phy_id_get), \ - SW_API_DEF(SW_API_PT_WOL_STATUS_SET, fal_port_wol_status_set), \ - SW_API_DEF(SW_API_PT_WOL_STATUS_GET, fal_port_wol_status_get), \ -/*qca808x_end*/\ - SW_API_DEF(SW_API_PT_INTERFACE_MODE_APPLY, fal_port_interface_mode_apply), \ - SW_API_DEF(SW_API_PT_INTERFACE_MODE_SET, fal_port_interface_mode_set), \ - SW_API_DEF(SW_API_PT_INTERFACE_MODE_GET, fal_port_interface_mode_get), \ -/*qca808x_start*/\ - SW_API_DEF(SW_API_PT_INTERFACE_MODE_STATUS_GET, fal_port_interface_mode_status_get), \ - SW_API_DEF(SW_API_DEBUG_PHYCOUNTER_SET, fal_debug_phycounter_set), \ - SW_API_DEF(SW_API_DEBUG_PHYCOUNTER_GET, fal_debug_phycounter_get), \ - SW_API_DEF(SW_API_DEBUG_PHYCOUNTER_SHOW, fal_debug_phycounter_show),\ -/*qca808x_end*/\ - SW_API_DEF(SW_API_PT_MTU_SET, fal_port_mtu_set), \ - SW_API_DEF(SW_API_PT_MTU_GET, fal_port_mtu_get), \ - SW_API_DEF(SW_API_PT_MRU_SET, fal_port_mru_set), \ - SW_API_DEF(SW_API_PT_MRU_GET, fal_port_mru_get), \ - SW_API_DEF(SW_API_PT_SOURCE_FILTER_GET, fal_port_source_filter_status_get), \ - SW_API_DEF(SW_API_PT_SOURCE_FILTER_SET, fal_port_source_filter_enable), \ - SW_API_DEF(SW_API_PT_FRAME_MAX_SIZE_GET, fal_port_max_frame_size_get), \ - SW_API_DEF(SW_API_PT_FRAME_MAX_SIZE_SET, fal_port_max_frame_size_set), \ - SW_API_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_SET, fal_port_interface_3az_status_set), \ - SW_API_DEF(SW_API_PT_INTERFACE_3AZ_STATUS_GET, fal_port_interface_3az_status_get), \ - SW_API_DEF(SW_API_PT_PROMISC_MODE_SET, fal_port_promisc_mode_set), \ - SW_API_DEF(SW_API_PT_PROMISC_MODE_GET, fal_port_promisc_mode_get), \ - SW_API_DEF(SW_API_PT_INTERFACE_EEE_CFG_SET, fal_port_interface_eee_cfg_set), \ - SW_API_DEF(SW_API_PT_INTERFACE_EEE_CFG_GET, fal_port_interface_eee_cfg_get), \ - SW_API_DEF(SW_API_PT_SOURCE_FILTER_CONFIG_GET, fal_port_source_filter_config_get),\ - SW_API_DEF(SW_API_PT_SOURCE_FILTER_CONFIG_SET, fal_port_source_filter_config_set), \ - SW_API_DEF(SW_API_PT_SWITCH_PORT_LOOPBACK_SET, fal_switch_port_loopback_set), \ - SW_API_DEF(SW_API_PT_SWITCH_PORT_LOOPBACK_GET, fal_switch_port_loopback_get), -/*qca808x_start*/\ -/*end of PORTCONTROL_API*/ -#define PORTCONTROL_API_PARAM \ - SW_API_DESC(SW_API_PT_DUPLEX_GET) \ - SW_API_DESC(SW_API_PT_DUPLEX_SET) \ - SW_API_DESC(SW_API_PT_SPEED_GET) \ - SW_API_DESC(SW_API_PT_SPEED_SET) \ - SW_API_DESC(SW_API_PT_AN_GET) \ - SW_API_DESC(SW_API_PT_AN_ENABLE) \ - SW_API_DESC(SW_API_PT_AN_RESTART) \ - SW_API_DESC(SW_API_PT_AN_ADV_GET) \ - SW_API_DESC(SW_API_PT_AN_ADV_SET) \ -/*qca808x_end*/\ - SW_API_DESC(SW_API_PT_HDR_SET) \ - SW_API_DESC(SW_API_PT_HDR_GET) \ - SW_API_DESC(SW_API_PT_FLOWCTRL_SET) \ - SW_API_DESC(SW_API_PT_FLOWCTRL_GET) \ - SW_API_DESC(SW_API_PT_FLOWCTRL_MODE_SET) \ - SW_API_DESC(SW_API_PT_FLOWCTRL_MODE_GET) \ - SW_API_DESC(SW_API_PT_POWERSAVE_SET) \ - SW_API_DESC(SW_API_PT_POWERSAVE_GET) \ -/*qca808x_start*/\ - SW_API_DESC(SW_API_PT_HIBERNATE_SET) \ - SW_API_DESC(SW_API_PT_HIBERNATE_GET) \ - SW_API_DESC(SW_API_PT_CDT) \ -/*qca808x_end*/\ - SW_API_DESC(SW_API_PT_TXHDR_SET) \ - SW_API_DESC(SW_API_PT_TXHDR_GET) \ - SW_API_DESC(SW_API_PT_RXHDR_SET) \ - SW_API_DESC(SW_API_PT_RXHDR_GET) \ - SW_API_DESC(SW_API_HEADER_TYPE_SET) \ - SW_API_DESC(SW_API_HEADER_TYPE_GET) \ - SW_API_DESC(SW_API_TXMAC_STATUS_SET) \ - SW_API_DESC(SW_API_TXMAC_STATUS_GET) \ - SW_API_DESC(SW_API_RXMAC_STATUS_SET) \ - SW_API_DESC(SW_API_RXMAC_STATUS_GET) \ - SW_API_DESC(SW_API_TXFC_STATUS_SET) \ - SW_API_DESC(SW_API_TXFC_STATUS_GET) \ - SW_API_DESC(SW_API_RXFC_STATUS_SET) \ - SW_API_DESC(SW_API_RXFC_STATUS_GET) \ - SW_API_DESC(SW_API_BP_STATUS_SET) \ - SW_API_DESC(SW_API_BP_STATUS_GET) \ - SW_API_DESC(SW_API_PT_LINK_MODE_SET) \ - SW_API_DESC(SW_API_PT_LINK_MODE_GET) \ -/*qca808x_start*/\ - SW_API_DESC(SW_API_PT_LINK_STATUS_GET) \ -/*qca808x_end*/\ - SW_API_DESC(SW_API_PT_MAC_LOOPBACK_SET) \ - SW_API_DESC(SW_API_PT_MAC_LOOPBACK_GET) \ - SW_API_DESC(SW_API_PTS_LINK_STATUS_GET) \ - SW_API_DESC(SW_API_PT_CONGESTION_DROP_SET) \ - SW_API_DESC(SW_API_PT_CONGESTION_DROP_GET) \ - SW_API_DESC(SW_API_PT_RING_FLOW_CTRL_THRES_SET) \ - SW_API_DESC(SW_API_PT_RING_FLOW_CTRL_THRES_GET) \ -/*qca808x_start*/\ - SW_API_DESC(SW_API_PT_8023AZ_SET) \ - SW_API_DESC(SW_API_PT_8023AZ_GET) \ - SW_API_DESC(SW_API_PT_MDIX_SET) \ - SW_API_DESC(SW_API_PT_MDIX_GET) \ - SW_API_DESC(SW_API_PT_MDIX_STATUS_GET) \ -/*qca808x_end*/\ - SW_API_DESC(SW_API_PT_COMBO_PREFER_MEDIUM_SET) \ - SW_API_DESC(SW_API_PT_COMBO_PREFER_MEDIUM_GET) \ - SW_API_DESC(SW_API_PT_COMBO_MEDIUM_STATUS_GET) \ - SW_API_DESC(SW_API_PT_COMBO_FIBER_MODE_SET) \ - SW_API_DESC(SW_API_PT_COMBO_FIBER_MODE_GET) \ -/*qca808x_start*/\ - SW_API_DESC(SW_API_PT_LOCAL_LOOPBACK_SET) \ - SW_API_DESC(SW_API_PT_LOCAL_LOOPBACK_GET) \ - SW_API_DESC(SW_API_PT_REMOTE_LOOPBACK_SET) \ - SW_API_DESC(SW_API_PT_REMOTE_LOOPBACK_GET) \ - SW_API_DESC(SW_API_PT_RESET) \ - SW_API_DESC(SW_API_PT_POWER_OFF) \ - SW_API_DESC(SW_API_PT_POWER_ON) \ - SW_API_DESC(SW_API_PT_MAGIC_FRAME_MAC_SET) \ - SW_API_DESC(SW_API_PT_MAGIC_FRAME_MAC_GET) \ - SW_API_DESC(SW_API_PT_PHY_ID_GET) \ - SW_API_DESC(SW_API_PT_WOL_STATUS_SET) \ - SW_API_DESC(SW_API_PT_WOL_STATUS_GET) \ -/*qca808x_end*/\ - SW_API_DESC(SW_API_PT_INTERFACE_MODE_SET) \ - SW_API_DESC(SW_API_PT_INTERFACE_MODE_GET) \ - SW_API_DESC(SW_API_PT_INTERFACE_MODE_APPLY) \ -/*qca808x_start*/\ - SW_API_DESC(SW_API_PT_INTERFACE_MODE_STATUS_GET) \ - SW_API_DESC(SW_API_DEBUG_PHYCOUNTER_SET) \ - SW_API_DESC(SW_API_DEBUG_PHYCOUNTER_GET) \ - SW_API_DESC(SW_API_DEBUG_PHYCOUNTER_SHOW)\ -/*qca808x_end*/\ - SW_API_DESC(SW_API_PT_MTU_SET) \ - SW_API_DESC(SW_API_PT_MTU_GET) \ - SW_API_DESC(SW_API_PT_MRU_SET) \ - SW_API_DESC(SW_API_PT_MRU_GET) \ - SW_API_DESC(SW_API_PT_SOURCE_FILTER_GET) \ - SW_API_DESC(SW_API_PT_SOURCE_FILTER_SET) \ - SW_API_DESC(SW_API_PT_FRAME_MAX_SIZE_GET) \ - SW_API_DESC(SW_API_PT_FRAME_MAX_SIZE_SET) \ - SW_API_DESC(SW_API_PT_INTERFACE_3AZ_STATUS_SET) \ - SW_API_DESC(SW_API_PT_INTERFACE_3AZ_STATUS_GET)\ - SW_API_DESC(SW_API_PT_PROMISC_MODE_SET) \ - SW_API_DESC(SW_API_PT_PROMISC_MODE_GET) \ - SW_API_DESC(SW_API_PT_INTERFACE_EEE_CFG_SET) \ - SW_API_DESC(SW_API_PT_INTERFACE_EEE_CFG_GET) \ - SW_API_DESC(SW_API_PT_SOURCE_FILTER_CONFIG_GET) \ - SW_API_DESC(SW_API_PT_SOURCE_FILTER_CONFIG_SET) \ - SW_API_DESC(SW_API_PT_SWITCH_PORT_LOOPBACK_SET) \ - SW_API_DESC(SW_API_PT_SWITCH_PORT_LOOPBACK_GET) -/*qca808x_start*/\ -/*end of PORTCONTROL_API_PARAM*/ -/*qca808x_end*/ -#else -#define PORTCONTROL_API -#define PORTCONTROL_API_PARAM -#endif - -#ifdef IN_VLAN -#define VLAN_API \ - SW_API_DEF(SW_API_VLAN_ADD, fal_vlan_create), \ - SW_API_DEF(SW_API_VLAN_DEL, fal_vlan_delete), \ - SW_API_DEF(SW_API_VLAN_MEM_UPDATE, fal_vlan_member_update), \ - SW_API_DEF(SW_API_VLAN_FIND, fal_vlan_find), \ - SW_API_DEF(SW_API_VLAN_NEXT, fal_vlan_next), \ - SW_API_DEF(SW_API_VLAN_APPEND, fal_vlan_entry_append), \ - SW_API_DEF(SW_API_VLAN_FLUSH, fal_vlan_flush), \ - SW_API_DEF(SW_API_VLAN_FID_SET, fal_vlan_fid_set), \ - SW_API_DEF(SW_API_VLAN_FID_GET, fal_vlan_fid_get), \ - SW_API_DEF(SW_API_VLAN_MEMBER_ADD, fal_vlan_member_add), \ - SW_API_DEF(SW_API_VLAN_MEMBER_DEL, fal_vlan_member_del), \ - SW_API_DEF(SW_API_VLAN_LEARN_STATE_SET, fal_vlan_learning_state_set), \ - SW_API_DEF(SW_API_VLAN_LEARN_STATE_GET, fal_vlan_learning_state_get), - -#define VLAN_API_PARAM \ - SW_API_DESC(SW_API_VLAN_ADD) \ - SW_API_DESC(SW_API_VLAN_DEL) \ - SW_API_DESC(SW_API_VLAN_MEM_UPDATE) \ - SW_API_DESC(SW_API_VLAN_FIND) \ - SW_API_DESC(SW_API_VLAN_NEXT) \ - SW_API_DESC(SW_API_VLAN_APPEND) \ - SW_API_DESC(SW_API_VLAN_FLUSH) \ - SW_API_DESC(SW_API_VLAN_FID_SET) \ - SW_API_DESC(SW_API_VLAN_FID_GET) \ - SW_API_DESC(SW_API_VLAN_MEMBER_ADD) \ - SW_API_DESC(SW_API_VLAN_MEMBER_DEL) \ - SW_API_DESC(SW_API_VLAN_LEARN_STATE_SET) \ - SW_API_DESC(SW_API_VLAN_LEARN_STATE_GET) -#else -#define VLAN_API -#define VLAN_API_PARAM -#endif - -#ifdef IN_PORTVLAN -#define PORTVLAN_API \ - SW_API_DEF(SW_API_PT_ING_MODE_GET, fal_port_1qmode_get), \ - SW_API_DEF(SW_API_PT_ING_MODE_SET, fal_port_1qmode_set), \ - SW_API_DEF(SW_API_PT_EG_MODE_GET, fal_port_egvlanmode_get), \ - SW_API_DEF(SW_API_PT_EG_MODE_SET, fal_port_egvlanmode_set), \ - SW_API_DEF(SW_API_PT_VLAN_MEM_ADD, fal_portvlan_member_add), \ - SW_API_DEF(SW_API_PT_VLAN_MEM_DEL, fal_portvlan_member_del), \ - SW_API_DEF(SW_API_PT_VLAN_MEM_UPDATE, fal_portvlan_member_update), \ - SW_API_DEF(SW_API_PT_VLAN_MEM_GET, fal_portvlan_member_get), \ - SW_API_DEF(SW_API_PT_DEF_VID_SET, fal_port_default_vid_set), \ - SW_API_DEF(SW_API_PT_DEF_VID_GET, fal_port_default_vid_get), \ - SW_API_DEF(SW_API_PT_FORCE_DEF_VID_SET, fal_port_force_default_vid_set), \ - SW_API_DEF(SW_API_PT_FORCE_DEF_VID_GET, fal_port_force_default_vid_get), \ - SW_API_DEF(SW_API_PT_FORCE_PORTVLAN_SET, fal_port_force_portvlan_set), \ - SW_API_DEF(SW_API_PT_FORCE_PORTVLAN_GET, fal_port_force_portvlan_get), \ - SW_API_DEF(SW_API_PT_NESTVLAN_SET, fal_port_nestvlan_set), \ - SW_API_DEF(SW_API_PT_NESTVLAN_GET, fal_port_nestvlan_get), \ - SW_API_DEF(SW_API_NESTVLAN_TPID_SET, fal_nestvlan_tpid_set), \ - SW_API_DEF(SW_API_NESTVLAN_TPID_GET, fal_nestvlan_tpid_get), \ - SW_API_DEF(SW_API_PT_IN_VLAN_MODE_SET, fal_port_invlan_mode_set), \ - SW_API_DEF(SW_API_PT_IN_VLAN_MODE_GET, fal_port_invlan_mode_get), \ - SW_API_DEF(SW_API_PT_TLS_SET, fal_port_tls_set), \ - SW_API_DEF(SW_API_PT_TLS_GET, fal_port_tls_get), \ - SW_API_DEF(SW_API_PT_PRI_PROPAGATION_SET, fal_port_pri_propagation_set), \ - SW_API_DEF(SW_API_PT_PRI_PROPAGATION_GET, fal_port_pri_propagation_get), \ - SW_API_DEF(SW_API_PT_DEF_SVID_SET, fal_port_default_svid_set), \ - SW_API_DEF(SW_API_PT_DEF_SVID_GET, fal_port_default_svid_get), \ - SW_API_DEF(SW_API_PT_DEF_CVID_SET, fal_port_default_cvid_set), \ - SW_API_DEF(SW_API_PT_DEF_CVID_GET, fal_port_default_cvid_get), \ - SW_API_DEF(SW_API_PT_VLAN_PROPAGATION_SET, fal_port_vlan_propagation_set), \ - SW_API_DEF(SW_API_PT_VLAN_PROPAGATION_GET, fal_port_vlan_propagation_get), \ - SW_API_DEF(SW_API_PT_VLAN_TRANS_ADD, fal_port_vlan_trans_add), \ - SW_API_DEF(SW_API_PT_VLAN_TRANS_DEL, fal_port_vlan_trans_del), \ - SW_API_DEF(SW_API_PT_VLAN_TRANS_GET, fal_port_vlan_trans_get), \ - SW_API_DEF(SW_API_QINQ_MODE_SET, fal_qinq_mode_set), \ - SW_API_DEF(SW_API_QINQ_MODE_GET, fal_qinq_mode_get), \ - SW_API_DEF(SW_API_PT_QINQ_ROLE_SET, fal_port_qinq_role_set), \ - SW_API_DEF(SW_API_PT_QINQ_ROLE_GET, fal_port_qinq_role_get), \ - SW_API_DEF(SW_API_PT_VLAN_TRANS_ITERATE, fal_port_vlan_trans_iterate), \ - SW_API_DEF(SW_API_PT_MAC_VLAN_XLT_SET, fal_port_mac_vlan_xlt_set), \ - SW_API_DEF(SW_API_PT_MAC_VLAN_XLT_GET, fal_port_mac_vlan_xlt_get), \ - SW_API_DEF(SW_API_NETISOLATE_SET, fal_netisolate_set), \ - SW_API_DEF(SW_API_NETISOLATE_GET, fal_netisolate_get), \ - SW_API_DEF(SW_API_EG_FLTR_BYPASS_EN_SET, fal_eg_trans_filter_bypass_en_set), \ - SW_API_DEF(SW_API_EG_FLTR_BYPASS_EN_GET, fal_eg_trans_filter_bypass_en_get), \ - SW_API_DEF(SW_API_PT_VRF_ID_SET, fal_port_vrf_id_set), \ - SW_API_DEF(SW_API_PT_VRF_ID_GET, fal_port_vrf_id_get), \ - SW_API_DEF(SW_API_GLOBAL_QINQ_MODE_SET, fal_global_qinq_mode_set), \ - SW_API_DEF(SW_API_GLOBAL_QINQ_MODE_GET, fal_global_qinq_mode_get), \ - SW_API_DEF(SW_API_PORT_QINQ_MODE_SET, fal_port_qinq_mode_set), \ - SW_API_DEF(SW_API_PORT_QINQ_MODE_GET, fal_port_qinq_mode_get), \ - SW_API_DEF(SW_API_TPID_SET, fal_ingress_tpid_set), \ - SW_API_DEF(SW_API_TPID_GET, fal_ingress_tpid_get), \ - SW_API_DEF(SW_API_EGRESS_TPID_SET, fal_egress_tpid_set), \ - SW_API_DEF(SW_API_EGRESS_TPID_GET, fal_egress_tpid_get), \ - SW_API_DEF(SW_API_PT_INGRESS_VLAN_FILTER_SET, fal_port_ingress_vlan_filter_set), \ - SW_API_DEF(SW_API_PT_INGRESS_VLAN_FILTER_GET, fal_port_ingress_vlan_filter_get), \ - SW_API_DEF(SW_API_PT_DEFAULT_VLANTAG_SET, fal_port_default_vlantag_set), \ - SW_API_DEF(SW_API_PT_DEFAULT_VLANTAG_GET, fal_port_default_vlantag_get), \ - SW_API_DEF(SW_API_PT_TAG_PROPAGATION_SET, fal_port_tag_propagation_set), \ - SW_API_DEF(SW_API_PT_TAG_PROPAGATION_GET, fal_port_tag_propagation_get), \ - SW_API_DEF(SW_API_PT_VLANTAG_EGMODE_SET, fal_port_vlantag_egmode_set), \ - SW_API_DEF(SW_API_PT_VLANTAG_EGMODE_GET, fal_port_vlantag_egmode_get), \ - SW_API_DEF(SW_API_PT_VLAN_XLT_MISS_CMD_SET, fal_port_vlan_xlt_miss_cmd_set), \ - SW_API_DEF(SW_API_PT_VLAN_XLT_MISS_CMD_GET, fal_port_vlan_xlt_miss_cmd_get), \ - SW_API_DEF(SW_API_PT_VSI_EGMODE_SET, fal_port_vsi_egmode_set), \ - SW_API_DEF(SW_API_PT_VSI_EGMODE_GET, fal_port_vsi_egmode_get), \ - SW_API_DEF(SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET, fal_port_vlantag_vsi_egmode_enable), \ - SW_API_DEF(SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET, fal_port_vlantag_vsi_egmode_status_get), \ - SW_API_DEF(SW_API_PT_VLAN_TRANS_ADV_ADD, fal_port_vlan_trans_adv_add), \ - SW_API_DEF(SW_API_PT_VLAN_TRANS_ADV_DEL, fal_port_vlan_trans_adv_del), \ - SW_API_DEF(SW_API_PT_VLAN_TRANS_ADV_GETFIRST, fal_port_vlan_trans_adv_getfirst), \ - SW_API_DEF(SW_API_PT_VLAN_TRANS_ADV_GETNEXT, fal_port_vlan_trans_adv_getnext), \ - SW_API_DEF(SW_API_PT_VLAN_COUNTER_GET, fal_port_vlan_counter_get), \ - SW_API_DEF(SW_API_PT_VLAN_COUNTER_CLEANUP, fal_port_vlan_counter_cleanup), - -#define PORTVLAN_API_PARAM \ - SW_API_DESC(SW_API_PT_ING_MODE_GET) \ - SW_API_DESC(SW_API_PT_ING_MODE_SET) \ - SW_API_DESC(SW_API_PT_EG_MODE_GET) \ - SW_API_DESC(SW_API_PT_EG_MODE_SET) \ - SW_API_DESC(SW_API_PT_VLAN_MEM_ADD) \ - SW_API_DESC(SW_API_PT_VLAN_MEM_DEL) \ - SW_API_DESC(SW_API_PT_VLAN_MEM_UPDATE) \ - SW_API_DESC(SW_API_PT_VLAN_MEM_GET) \ - SW_API_DESC(SW_API_PT_DEF_VID_SET) \ - SW_API_DESC(SW_API_PT_DEF_VID_GET) \ - SW_API_DESC(SW_API_PT_FORCE_DEF_VID_SET) \ - SW_API_DESC(SW_API_PT_FORCE_DEF_VID_GET) \ - SW_API_DESC(SW_API_PT_FORCE_PORTVLAN_SET) \ - SW_API_DESC(SW_API_PT_FORCE_PORTVLAN_GET) \ - SW_API_DESC(SW_API_PT_NESTVLAN_SET) \ - SW_API_DESC(SW_API_PT_NESTVLAN_GET) \ - SW_API_DESC(SW_API_NESTVLAN_TPID_SET) \ - SW_API_DESC(SW_API_NESTVLAN_TPID_GET) \ - SW_API_DESC(SW_API_PT_IN_VLAN_MODE_SET) \ - SW_API_DESC(SW_API_PT_IN_VLAN_MODE_GET) \ - SW_API_DESC(SW_API_PT_TLS_SET) \ - SW_API_DESC(SW_API_PT_TLS_GET) \ - SW_API_DESC(SW_API_PT_PRI_PROPAGATION_SET) \ - SW_API_DESC(SW_API_PT_PRI_PROPAGATION_GET) \ - SW_API_DESC(SW_API_PT_DEF_SVID_SET) \ - SW_API_DESC(SW_API_PT_DEF_SVID_GET) \ - SW_API_DESC(SW_API_PT_DEF_CVID_SET) \ - SW_API_DESC(SW_API_PT_DEF_CVID_GET) \ - SW_API_DESC(SW_API_PT_VLAN_PROPAGATION_SET) \ - SW_API_DESC(SW_API_PT_VLAN_PROPAGATION_GET) \ - SW_API_DESC(SW_API_PT_VLAN_TRANS_ADD) \ - SW_API_DESC(SW_API_PT_VLAN_TRANS_DEL) \ - SW_API_DESC(SW_API_PT_VLAN_TRANS_GET) \ - SW_API_DESC(SW_API_QINQ_MODE_SET) \ - SW_API_DESC(SW_API_QINQ_MODE_GET) \ - SW_API_DESC(SW_API_PT_QINQ_ROLE_SET) \ - SW_API_DESC(SW_API_PT_QINQ_ROLE_GET) \ - SW_API_DESC(SW_API_PT_VLAN_TRANS_ITERATE) \ - SW_API_DESC(SW_API_PT_MAC_VLAN_XLT_SET) \ - SW_API_DESC(SW_API_PT_MAC_VLAN_XLT_GET) \ - SW_API_DESC(SW_API_NETISOLATE_SET) \ - SW_API_DESC(SW_API_NETISOLATE_GET) \ - SW_API_DESC(SW_API_EG_FLTR_BYPASS_EN_SET) \ - SW_API_DESC(SW_API_EG_FLTR_BYPASS_EN_GET) \ - SW_API_DESC(SW_API_PT_VRF_ID_SET) \ - SW_API_DESC(SW_API_PT_VRF_ID_GET) \ - SW_API_DESC(SW_API_GLOBAL_QINQ_MODE_SET) \ - SW_API_DESC(SW_API_GLOBAL_QINQ_MODE_GET) \ - SW_API_DESC(SW_API_PORT_QINQ_MODE_SET) \ - SW_API_DESC(SW_API_PORT_QINQ_MODE_GET) \ - SW_API_DESC(SW_API_TPID_SET) \ - SW_API_DESC(SW_API_TPID_GET) \ - SW_API_DESC(SW_API_EGRESS_TPID_SET) \ - SW_API_DESC(SW_API_EGRESS_TPID_GET) \ - SW_API_DESC(SW_API_PT_INGRESS_VLAN_FILTER_SET) \ - SW_API_DESC(SW_API_PT_INGRESS_VLAN_FILTER_GET) \ - SW_API_DESC(SW_API_PT_DEFAULT_VLANTAG_SET) \ - SW_API_DESC(SW_API_PT_DEFAULT_VLANTAG_GET) \ - SW_API_DESC(SW_API_PT_TAG_PROPAGATION_SET) \ - SW_API_DESC(SW_API_PT_TAG_PROPAGATION_GET) \ - SW_API_DESC(SW_API_PT_VLANTAG_EGMODE_SET) \ - SW_API_DESC(SW_API_PT_VLANTAG_EGMODE_GET) \ - SW_API_DESC(SW_API_PT_VLAN_XLT_MISS_CMD_SET) \ - SW_API_DESC(SW_API_PT_VLAN_XLT_MISS_CMD_GET) \ - SW_API_DESC(SW_API_PT_VSI_EGMODE_SET) \ - SW_API_DESC(SW_API_PT_VSI_EGMODE_GET) \ - SW_API_DESC(SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET) \ - SW_API_DESC(SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET) \ - SW_API_DESC(SW_API_PT_VLAN_TRANS_ADV_ADD) \ - SW_API_DESC(SW_API_PT_VLAN_TRANS_ADV_DEL) \ - SW_API_DESC(SW_API_PT_VLAN_TRANS_ADV_GETFIRST) \ - SW_API_DESC(SW_API_PT_VLAN_TRANS_ADV_GETNEXT) \ - SW_API_DESC(SW_API_PT_VLAN_COUNTER_GET) \ - SW_API_DESC(SW_API_PT_VLAN_COUNTER_CLEANUP) - - -#else -#define PORTVLAN_API -#define PORTVLAN_API_PARAM -#endif - -#ifdef IN_FDB -#define FDB_API \ - SW_API_DEF(SW_API_FDB_ADD, fal_fdb_entry_add), \ - SW_API_DEF(SW_API_FDB_DELALL, fal_fdb_entry_flush), \ - SW_API_DEF(SW_API_FDB_DELPORT,fal_fdb_entry_del_byport), \ - SW_API_DEF(SW_API_FDB_DELMAC, fal_fdb_entry_del_bymac), \ - SW_API_DEF(SW_API_FDB_FIRST, fal_fdb_entry_getfirst), \ - SW_API_DEF(SW_API_FDB_NEXT, fal_fdb_entry_getnext), \ - SW_API_DEF(SW_API_FDB_FIND, fal_fdb_entry_search), \ - SW_API_DEF(SW_API_FDB_PT_LEARN_SET, fal_fdb_port_learn_set), \ - SW_API_DEF(SW_API_FDB_PT_LEARN_GET, fal_fdb_port_learn_get), \ - SW_API_DEF(SW_API_FDB_PT_NEWADDR_LEARN_SET, fal_fdb_port_learning_ctrl_set), \ - SW_API_DEF(SW_API_FDB_PT_NEWADDR_LEARN_GET, fal_fdb_port_learning_ctrl_get), \ - SW_API_DEF(SW_API_FDB_PT_STAMOVE_SET, fal_fdb_port_stamove_ctrl_set), \ - SW_API_DEF(SW_API_FDB_PT_STAMOVE_GET, fal_fdb_port_stamove_ctrl_get), \ - SW_API_DEF(SW_API_FDB_AGE_CTRL_SET, fal_fdb_aging_ctrl_set), \ - SW_API_DEF(SW_API_FDB_AGE_CTRL_GET, fal_fdb_aging_ctrl_get), \ - SW_API_DEF(SW_API_FDB_LEARN_CTRL_SET, fal_fdb_learning_ctrl_set), \ - SW_API_DEF(SW_API_FDB_LEARN_CTRL_GET, fal_fdb_learning_ctrl_get), \ - SW_API_DEF(SW_API_FDB_VLAN_IVL_SVL_SET, fal_fdb_vlan_ivl_svl_set),\ - SW_API_DEF(SW_API_FDB_VLAN_IVL_SVL_GET, fal_fdb_vlan_ivl_svl_get),\ - SW_API_DEF(SW_API_FDB_AGE_TIME_SET, fal_fdb_aging_time_set), \ - SW_API_DEF(SW_API_FDB_AGE_TIME_GET, fal_fdb_aging_time_get), \ - SW_API_DEF(SW_API_FDB_ITERATE, fal_fdb_entry_getnext_byindex), \ - SW_API_DEF(SW_API_FDB_EXTEND_NEXT, fal_fdb_entry_extend_getnext), \ - SW_API_DEF(SW_API_FDB_EXTEND_FIRST, fal_fdb_entry_extend_getfirst), \ - SW_API_DEF(SW_API_FDB_TRANSFER, fal_fdb_entry_update_byport), \ - SW_API_DEF(SW_API_PT_FDB_LEARN_COUNTER_GET, fal_fdb_port_learned_mac_counter_get), \ - SW_API_DEF(SW_API_PT_FDB_LEARN_LIMIT_SET, fal_port_fdb_learn_limit_set), \ - SW_API_DEF(SW_API_PT_FDB_LEARN_LIMIT_GET, fal_port_fdb_learn_limit_get), \ - SW_API_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_SET, fal_port_fdb_learn_exceed_cmd_set), \ - SW_API_DEF(SW_API_PT_FDB_LEARN_EXCEED_CMD_GET, fal_port_fdb_learn_exceed_cmd_get), \ - SW_API_DEF(SW_API_FDB_LEARN_LIMIT_SET, fal_fdb_learn_limit_set), \ - SW_API_DEF(SW_API_FDB_LEARN_LIMIT_GET, fal_fdb_learn_limit_get), \ - SW_API_DEF(SW_API_FDB_LEARN_EXCEED_CMD_SET, fal_fdb_learn_exceed_cmd_set), \ - SW_API_DEF(SW_API_FDB_LEARN_EXCEED_CMD_GET, fal_fdb_learn_exceed_cmd_get), \ - SW_API_DEF(SW_API_FDB_RESV_ADD, fal_fdb_resv_add), \ - SW_API_DEF(SW_API_FDB_RESV_DEL, fal_fdb_resv_del), \ - SW_API_DEF(SW_API_FDB_RESV_FIND, fal_fdb_resv_find), \ - SW_API_DEF(SW_API_FDB_RESV_ITERATE, fal_fdb_resv_iterate), \ - SW_API_DEF(SW_API_FDB_PT_LEARN_STATIC_SET, fal_fdb_port_learn_static_set), \ - SW_API_DEF(SW_API_FDB_PT_LEARN_STATIC_GET, fal_fdb_port_learn_static_get), \ - SW_API_DEF(SW_API_FDB_PORT_ADD, fal_fdb_port_add), \ - SW_API_DEF(SW_API_FDB_PORT_DEL, fal_fdb_port_del), \ - SW_API_DEF(SW_API_FDB_RFS_SET, fal_fdb_rfs_set), \ - SW_API_DEF(SW_API_FDB_RFS_DEL, fal_fdb_rfs_del), \ - SW_API_DEF(SW_API_FDB_PT_MACLIMIT_CTRL_SET, fal_fdb_port_maclimit_ctrl_set), \ - SW_API_DEF(SW_API_FDB_PT_MACLIMIT_CTRL_GET, fal_fdb_port_maclimit_ctrl_get), \ - SW_API_DEF(SW_API_FDB_DEL_BY_FID, fal_fdb_entry_del_byfid), - -#define FDB_API_PARAM \ - SW_API_DESC(SW_API_FDB_ADD) \ - SW_API_DESC(SW_API_FDB_DELALL) \ - SW_API_DESC(SW_API_FDB_DELPORT) \ - SW_API_DESC(SW_API_FDB_DELMAC) \ - SW_API_DESC(SW_API_FDB_FIRST) \ - SW_API_DESC(SW_API_FDB_NEXT) \ - SW_API_DESC(SW_API_FDB_FIND) \ - SW_API_DESC(SW_API_FDB_PT_LEARN_SET) \ - SW_API_DESC(SW_API_FDB_PT_LEARN_GET) \ - SW_API_DESC(SW_API_FDB_PT_NEWADDR_LEARN_SET) \ - SW_API_DESC(SW_API_FDB_PT_NEWADDR_LEARN_GET) \ - SW_API_DESC(SW_API_FDB_PT_STAMOVE_SET) \ - SW_API_DESC(SW_API_FDB_PT_STAMOVE_GET) \ - SW_API_DESC(SW_API_FDB_AGE_CTRL_SET) \ - SW_API_DESC(SW_API_FDB_AGE_CTRL_GET) \ - SW_API_DESC(SW_API_FDB_LEARN_CTRL_SET) \ - SW_API_DESC(SW_API_FDB_LEARN_CTRL_GET) \ - SW_API_DESC(SW_API_FDB_VLAN_IVL_SVL_SET) \ - SW_API_DESC(SW_API_FDB_VLAN_IVL_SVL_GET) \ - SW_API_DESC(SW_API_FDB_AGE_TIME_SET) \ - SW_API_DESC(SW_API_FDB_AGE_TIME_GET) \ - SW_API_DESC(SW_API_FDB_ITERATE) \ - SW_API_DESC(SW_API_FDB_EXTEND_NEXT) \ - SW_API_DESC(SW_API_FDB_EXTEND_FIRST) \ - SW_API_DESC(SW_API_FDB_TRANSFER) \ - SW_API_DESC(SW_API_PT_FDB_LEARN_COUNTER_GET) \ - SW_API_DESC(SW_API_PT_FDB_LEARN_LIMIT_SET) \ - SW_API_DESC(SW_API_PT_FDB_LEARN_LIMIT_GET) \ - SW_API_DESC(SW_API_PT_FDB_LEARN_EXCEED_CMD_SET) \ - SW_API_DESC(SW_API_PT_FDB_LEARN_EXCEED_CMD_GET) \ - SW_API_DESC(SW_API_FDB_LEARN_LIMIT_SET) \ - SW_API_DESC(SW_API_FDB_LEARN_LIMIT_GET) \ - SW_API_DESC(SW_API_FDB_LEARN_EXCEED_CMD_SET) \ - SW_API_DESC(SW_API_FDB_LEARN_EXCEED_CMD_GET) \ - SW_API_DESC(SW_API_FDB_RESV_ADD) \ - SW_API_DESC(SW_API_FDB_RESV_DEL) \ - SW_API_DESC(SW_API_FDB_RESV_FIND) \ - SW_API_DESC(SW_API_FDB_RESV_ITERATE) \ - SW_API_DESC(SW_API_FDB_PT_LEARN_STATIC_SET) \ - SW_API_DESC(SW_API_FDB_PT_LEARN_STATIC_GET) \ - SW_API_DESC(SW_API_FDB_PORT_ADD) \ - SW_API_DESC(SW_API_FDB_PORT_DEL) \ - SW_API_DESC(SW_API_FDB_RFS_SET) \ - SW_API_DESC(SW_API_FDB_RFS_DEL) \ - SW_API_DESC(SW_API_FDB_PT_MACLIMIT_CTRL_SET) \ - SW_API_DESC(SW_API_FDB_PT_MACLIMIT_CTRL_GET) \ - SW_API_DESC(SW_API_FDB_DEL_BY_FID) -#else -#define FDB_API -#define FDB_API_PARAM -#endif - -#ifdef IN_ACL -#define ACL_API \ - SW_API_DEF(SW_API_ACL_LIST_CREAT, fal_acl_list_creat), \ - SW_API_DEF(SW_API_ACL_LIST_DESTROY, fal_acl_list_destroy), \ - SW_API_DEF(SW_API_ACL_RULE_ADD, fal_acl_rule_add), \ - SW_API_DEF(SW_API_ACL_RULE_DELETE, fal_acl_rule_delete), \ - SW_API_DEF(SW_API_ACL_RULE_QUERY, fal_acl_rule_query), \ - SW_API_DEF(SW_API_ACL_LIST_BIND, fal_acl_list_bind), \ - SW_API_DEF(SW_API_ACL_LIST_UNBIND, fal_acl_list_unbind), \ - SW_API_DEF(SW_API_ACL_STATUS_SET, fal_acl_status_set), \ - SW_API_DEF(SW_API_ACL_STATUS_GET, fal_acl_status_get), \ - SW_API_DEF(SW_API_ACL_LIST_DUMP, fal_acl_list_dump), \ - SW_API_DEF(SW_API_ACL_RULE_DUMP, fal_acl_rule_dump), \ - SW_API_DEF(SW_API_ACL_PT_UDF_PROFILE_SET, fal_acl_port_udf_profile_set), \ - SW_API_DEF(SW_API_ACL_PT_UDF_PROFILE_GET, fal_acl_port_udf_profile_get), \ - SW_API_DEF(SW_API_ACL_RULE_ACTIVE, fal_acl_rule_active), \ - SW_API_DEF(SW_API_ACL_RULE_DEACTIVE, fal_acl_rule_deactive),\ - SW_API_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_SET, fal_acl_rule_src_filter_sts_set),\ - SW_API_DEF(SW_API_ACL_RULE_SRC_FILTER_STS_GET, fal_acl_rule_src_filter_sts_get),\ - SW_API_DEF(SW_API_ACL_UDF_SET, fal_acl_udf_profile_set),\ - SW_API_DEF(SW_API_ACL_UDF_GET, fal_acl_udf_profile_get), - -#define ACL_API_PARAM \ - SW_API_DESC(SW_API_ACL_LIST_CREAT) \ - SW_API_DESC(SW_API_ACL_LIST_DESTROY) \ - SW_API_DESC(SW_API_ACL_RULE_ADD) \ - SW_API_DESC(SW_API_ACL_RULE_DELETE) \ - SW_API_DESC(SW_API_ACL_RULE_QUERY) \ - SW_API_DESC(SW_API_ACL_LIST_BIND) \ - SW_API_DESC(SW_API_ACL_LIST_UNBIND) \ - SW_API_DESC(SW_API_ACL_STATUS_SET) \ - SW_API_DESC(SW_API_ACL_STATUS_GET) \ - SW_API_DESC(SW_API_ACL_LIST_DUMP) \ - SW_API_DESC(SW_API_ACL_RULE_DUMP) \ - SW_API_DESC(SW_API_ACL_PT_UDF_PROFILE_SET) \ - SW_API_DESC(SW_API_ACL_PT_UDF_PROFILE_GET) \ - SW_API_DESC(SW_API_ACL_RULE_ACTIVE) \ - SW_API_DESC(SW_API_ACL_RULE_DEACTIVE) \ - SW_API_DESC(SW_API_ACL_RULE_SRC_FILTER_STS_SET)\ - SW_API_DESC(SW_API_ACL_RULE_SRC_FILTER_STS_GET)\ - SW_API_DESC(SW_API_ACL_UDF_SET) \ - SW_API_DESC(SW_API_ACL_UDF_GET) -#else -#define ACL_API -#define ACL_API_PARAM -#endif - -#ifdef IN_QOS -#define QOS_API \ - SW_API_DEF(SW_API_QOS_SCH_MODE_SET, fal_qos_sch_mode_set), \ - SW_API_DEF(SW_API_QOS_SCH_MODE_GET, fal_qos_sch_mode_get), \ - SW_API_DEF(SW_API_QOS_QU_TX_BUF_ST_SET, fal_qos_queue_tx_buf_status_set), \ - SW_API_DEF(SW_API_QOS_QU_TX_BUF_ST_GET, fal_qos_queue_tx_buf_status_get), \ - SW_API_DEF(SW_API_QOS_QU_TX_BUF_NR_SET, fal_qos_queue_tx_buf_nr_set), \ - SW_API_DEF(SW_API_QOS_QU_TX_BUF_NR_GET, fal_qos_queue_tx_buf_nr_get), \ - SW_API_DEF(SW_API_QOS_PT_TX_BUF_ST_SET, fal_qos_port_tx_buf_status_set), \ - SW_API_DEF(SW_API_QOS_PT_TX_BUF_ST_GET, fal_qos_port_tx_buf_status_get), \ - SW_API_DEF(SW_API_QOS_PT_RED_EN_SET, fal_qos_port_red_en_set), \ - SW_API_DEF(SW_API_QOS_PT_RED_EN_GET, fal_qos_port_red_en_get), \ - SW_API_DEF(SW_API_QOS_PT_TX_BUF_NR_SET, fal_qos_port_tx_buf_nr_set), \ - SW_API_DEF(SW_API_QOS_PT_TX_BUF_NR_GET, fal_qos_port_tx_buf_nr_get), \ - SW_API_DEF(SW_API_QOS_PT_RX_BUF_NR_SET, fal_qos_port_rx_buf_nr_set), \ - SW_API_DEF(SW_API_QOS_PT_RX_BUF_NR_GET, fal_qos_port_rx_buf_nr_get), \ - SW_API_DEF(SW_API_COSMAP_UP_QU_SET, fal_cosmap_up_queue_set), \ - SW_API_DEF(SW_API_COSMAP_UP_QU_GET, fal_cosmap_up_queue_get), \ - SW_API_DEF(SW_API_COSMAP_DSCP_QU_SET, fal_cosmap_dscp_queue_set), \ - SW_API_DEF(SW_API_COSMAP_DSCP_QU_GET, fal_cosmap_dscp_queue_get), \ - SW_API_DEF(SW_API_QOS_PT_MODE_SET, fal_qos_port_mode_set), \ - SW_API_DEF(SW_API_QOS_PT_MODE_GET, fal_qos_port_mode_get), \ - SW_API_DEF(SW_API_QOS_PT_MODE_PRI_SET, fal_qos_port_mode_pri_set), \ - SW_API_DEF(SW_API_QOS_PT_MODE_PRI_GET, fal_qos_port_mode_pri_get), \ - SW_API_DEF(SW_API_QOS_PORT_DEF_UP_SET, fal_qos_port_default_up_set), \ - SW_API_DEF(SW_API_QOS_PORT_DEF_UP_GET, fal_qos_port_default_up_get), \ - SW_API_DEF(SW_API_QOS_PORT_SCH_MODE_SET, fal_qos_port_sch_mode_set), \ - SW_API_DEF(SW_API_QOS_PORT_SCH_MODE_GET, fal_qos_port_sch_mode_get), \ - SW_API_DEF(SW_API_QOS_PT_DEF_SPRI_SET, fal_qos_port_default_spri_set), \ - SW_API_DEF(SW_API_QOS_PT_DEF_SPRI_GET, fal_qos_port_default_spri_get), \ - SW_API_DEF(SW_API_QOS_PT_DEF_CPRI_SET, fal_qos_port_default_cpri_set), \ - SW_API_DEF(SW_API_QOS_PT_DEF_CPRI_GET, fal_qos_port_default_cpri_get), \ - SW_API_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_SET, fal_qos_port_force_spri_status_set), \ - SW_API_DEF(SW_API_QOS_PT_FORCE_SPRI_ST_GET, fal_qos_port_force_spri_status_get), \ - SW_API_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_SET, fal_qos_port_force_cpri_status_set), \ - SW_API_DEF(SW_API_QOS_PT_FORCE_CPRI_ST_GET, fal_qos_port_force_cpri_status_get), \ - SW_API_DEF(SW_API_QOS_QUEUE_REMARK_SET, fal_qos_queue_remark_table_set), \ - SW_API_DEF(SW_API_QOS_QUEUE_REMARK_GET, fal_qos_queue_remark_table_get), \ - SW_API_DEF(SW_API_QOS_PORT_GROUP_GET, fal_qos_port_group_get), \ - SW_API_DEF(SW_API_QOS_PORT_GROUP_SET, fal_qos_port_group_set), \ - SW_API_DEF(SW_API_QOS_PORT_PRI_GET, fal_qos_port_pri_precedence_get), \ - SW_API_DEF(SW_API_QOS_PORT_PRI_SET, fal_qos_port_pri_precedence_set), \ - SW_API_DEF(SW_API_QOS_PORT_REMARK_GET, fal_qos_port_remark_get), \ - SW_API_DEF(SW_API_QOS_PORT_REMARK_SET, fal_qos_port_remark_set), \ - SW_API_DEF(SW_API_QOS_PCP_MAP_GET, fal_qos_cosmap_pcp_get), \ - SW_API_DEF(SW_API_QOS_PCP_MAP_SET, fal_qos_cosmap_pcp_set), \ - SW_API_DEF(SW_API_QOS_FLOW_MAP_GET, fal_qos_cosmap_flow_get), \ - SW_API_DEF(SW_API_QOS_FLOW_MAP_SET, fal_qos_cosmap_flow_set), \ - SW_API_DEF(SW_API_QOS_DSCP_MAP_GET, fal_qos_cosmap_dscp_get), \ - SW_API_DEF(SW_API_QOS_DSCP_MAP_SET, fal_qos_cosmap_dscp_set), \ - SW_API_DEF(SW_API_QOS_QUEUE_SCHEDULER_GET, fal_queue_scheduler_get), \ - SW_API_DEF(SW_API_QOS_QUEUE_SCHEDULER_SET, fal_queue_scheduler_set), \ - SW_API_DEF(SW_API_QOS_RING_QUEUE_MAP_GET, fal_edma_ring_queue_map_get), \ - SW_API_DEF(SW_API_QOS_RING_QUEUE_MAP_SET, fal_edma_ring_queue_map_set), \ - SW_API_DEF(SW_API_QOS_PORT_QUEUES_GET, fal_port_queues_get), \ - SW_API_DEF(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET, fal_scheduler_dequeue_ctrl_get), \ - SW_API_DEF(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET, fal_scheduler_dequeue_ctrl_set), \ - SW_API_DEF(SW_API_QOS_PORT_SCHEDULER_CFG_RESET, fal_port_scheduler_cfg_reset), \ - SW_API_DEF(SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET, fal_port_scheduler_resource_get), - -#define QOS_API_PARAM \ - SW_API_DESC(SW_API_QOS_SCH_MODE_SET) \ - SW_API_DESC(SW_API_QOS_SCH_MODE_GET) \ - SW_API_DESC(SW_API_QOS_QU_TX_BUF_ST_SET) \ - SW_API_DESC(SW_API_QOS_QU_TX_BUF_ST_GET) \ - SW_API_DESC(SW_API_QOS_QU_TX_BUF_NR_SET) \ - SW_API_DESC(SW_API_QOS_QU_TX_BUF_NR_GET) \ - SW_API_DESC(SW_API_QOS_PT_TX_BUF_ST_SET) \ - SW_API_DESC(SW_API_QOS_PT_TX_BUF_ST_GET) \ - SW_API_DESC(SW_API_QOS_PT_RED_EN_SET)\ - SW_API_DESC(SW_API_QOS_PT_RED_EN_GET)\ - SW_API_DESC(SW_API_QOS_PT_TX_BUF_NR_SET) \ - SW_API_DESC(SW_API_QOS_PT_TX_BUF_NR_GET) \ - SW_API_DESC(SW_API_QOS_PT_RX_BUF_NR_SET) \ - SW_API_DESC(SW_API_QOS_PT_RX_BUF_NR_GET) \ - SW_API_DESC(SW_API_COSMAP_UP_QU_SET) \ - SW_API_DESC(SW_API_COSMAP_UP_QU_GET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_QU_SET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_QU_GET) \ - SW_API_DESC(SW_API_QOS_PT_MODE_SET) \ - SW_API_DESC(SW_API_QOS_PT_MODE_GET) \ - SW_API_DESC(SW_API_QOS_PT_MODE_PRI_SET) \ - SW_API_DESC(SW_API_QOS_PT_MODE_PRI_GET) \ - SW_API_DESC(SW_API_QOS_PORT_DEF_UP_SET) \ - SW_API_DESC(SW_API_QOS_PORT_DEF_UP_GET) \ - SW_API_DESC(SW_API_QOS_PORT_SCH_MODE_SET) \ - SW_API_DESC(SW_API_QOS_PORT_SCH_MODE_GET) \ - SW_API_DESC(SW_API_QOS_PT_DEF_SPRI_SET) \ - SW_API_DESC(SW_API_QOS_PT_DEF_SPRI_GET) \ - SW_API_DESC(SW_API_QOS_PT_DEF_CPRI_SET) \ - SW_API_DESC(SW_API_QOS_PT_DEF_CPRI_GET) \ - SW_API_DESC(SW_API_QOS_PT_FORCE_SPRI_ST_SET) \ - SW_API_DESC(SW_API_QOS_PT_FORCE_SPRI_ST_GET) \ - SW_API_DESC(SW_API_QOS_PT_FORCE_CPRI_ST_SET) \ - SW_API_DESC(SW_API_QOS_PT_FORCE_CPRI_ST_GET) \ - SW_API_DESC(SW_API_QOS_QUEUE_REMARK_SET) \ - SW_API_DESC(SW_API_QOS_QUEUE_REMARK_GET) \ - SW_API_DESC(SW_API_QOS_PORT_GROUP_GET) \ - SW_API_DESC(SW_API_QOS_PORT_GROUP_SET) \ - SW_API_DESC(SW_API_QOS_PORT_PRI_GET) \ - SW_API_DESC(SW_API_QOS_PORT_PRI_SET) \ - SW_API_DESC(SW_API_QOS_PORT_REMARK_GET) \ - SW_API_DESC(SW_API_QOS_PORT_REMARK_SET) \ - SW_API_DESC(SW_API_QOS_PCP_MAP_GET) \ - SW_API_DESC(SW_API_QOS_PCP_MAP_SET) \ - SW_API_DESC(SW_API_QOS_FLOW_MAP_GET) \ - SW_API_DESC(SW_API_QOS_FLOW_MAP_SET) \ - SW_API_DESC(SW_API_QOS_DSCP_MAP_GET) \ - SW_API_DESC(SW_API_QOS_DSCP_MAP_SET) \ - SW_API_DESC(SW_API_QOS_QUEUE_SCHEDULER_GET) \ - SW_API_DESC(SW_API_QOS_QUEUE_SCHEDULER_SET) \ - SW_API_DESC(SW_API_QOS_RING_QUEUE_MAP_GET) \ - SW_API_DESC(SW_API_QOS_RING_QUEUE_MAP_SET)\ - SW_API_DESC(SW_API_QOS_PORT_QUEUES_GET) \ - SW_API_DESC(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET) \ - SW_API_DESC(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET) \ - SW_API_DESC(SW_API_QOS_PORT_SCHEDULER_CFG_RESET) \ - SW_API_DESC(SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET) -#else -#define QOS_API -#define QOS_API_PARAM -#endif - -#ifdef IN_IGMP -#define IGMP_API \ - SW_API_DEF(SW_API_PT_IGMPS_MODE_SET, fal_port_igmps_status_set), \ - SW_API_DEF(SW_API_PT_IGMPS_MODE_GET, fal_port_igmps_status_get), \ - SW_API_DEF(SW_API_IGMP_MLD_CMD_SET, fal_igmp_mld_cmd_set), \ - SW_API_DEF(SW_API_IGMP_MLD_CMD_GET, fal_igmp_mld_cmd_get), \ - SW_API_DEF(SW_API_IGMP_PT_JOIN_SET, fal_port_igmp_mld_join_set), \ - SW_API_DEF(SW_API_IGMP_PT_JOIN_GET, fal_port_igmp_mld_join_get), \ - SW_API_DEF(SW_API_IGMP_PT_LEAVE_SET, fal_port_igmp_mld_leave_set), \ - SW_API_DEF(SW_API_IGMP_PT_LEAVE_GET, fal_port_igmp_mld_leave_get), \ - SW_API_DEF(SW_API_IGMP_RP_SET, fal_igmp_mld_rp_set), \ - SW_API_DEF(SW_API_IGMP_RP_GET, fal_igmp_mld_rp_get), \ - SW_API_DEF(SW_API_IGMP_ENTRY_CREAT_SET, fal_igmp_mld_entry_creat_set), \ - SW_API_DEF(SW_API_IGMP_ENTRY_CREAT_GET, fal_igmp_mld_entry_creat_get), \ - SW_API_DEF(SW_API_IGMP_ENTRY_STATIC_SET, fal_igmp_mld_entry_static_set), \ - SW_API_DEF(SW_API_IGMP_ENTRY_STATIC_GET, fal_igmp_mld_entry_static_get), \ - SW_API_DEF(SW_API_IGMP_ENTRY_LEAKY_SET, fal_igmp_mld_entry_leaky_set), \ - SW_API_DEF(SW_API_IGMP_ENTRY_LEAKY_GET, fal_igmp_mld_entry_leaky_get), \ - SW_API_DEF(SW_API_IGMP_ENTRY_V3_SET, fal_igmp_mld_entry_v3_set), \ - SW_API_DEF(SW_API_IGMP_ENTRY_V3_GET, fal_igmp_mld_entry_v3_get), \ - SW_API_DEF(SW_API_IGMP_ENTRY_QUEUE_SET, fal_igmp_mld_entry_queue_set), \ - SW_API_DEF(SW_API_IGMP_ENTRY_QUEUE_GET, fal_igmp_mld_entry_queue_get), \ - SW_API_DEF(SW_API_PT_IGMP_LEARN_LIMIT_SET, fal_port_igmp_mld_learn_limit_set), \ - SW_API_DEF(SW_API_PT_IGMP_LEARN_LIMIT_GET, fal_port_igmp_mld_learn_limit_get), \ - SW_API_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET, fal_port_igmp_mld_learn_exceed_cmd_set), \ - SW_API_DEF(SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET, fal_port_igmp_mld_learn_exceed_cmd_get), \ - SW_API_DEF(SW_API_IGMP_SG_ENTRY_SET, fal_igmp_sg_entry_set), \ - SW_API_DEF(SW_API_IGMP_SG_ENTRY_CLEAR, fal_igmp_sg_entry_clear), \ - SW_API_DEF(SW_API_IGMP_SG_ENTRY_SHOW, fal_igmp_sg_entry_show), \ - SW_API_DEF(SW_API_IGMP_SG_ENTRY_QUERY, fal_igmp_sg_entry_query), - -#define IGMP_API_PARAM \ - SW_API_DESC(SW_API_PT_IGMPS_MODE_SET) \ - SW_API_DESC(SW_API_PT_IGMPS_MODE_GET) \ - SW_API_DESC(SW_API_IGMP_MLD_CMD_SET) \ - SW_API_DESC(SW_API_IGMP_MLD_CMD_GET) \ - SW_API_DESC(SW_API_IGMP_PT_JOIN_SET) \ - SW_API_DESC(SW_API_IGMP_PT_JOIN_GET) \ - SW_API_DESC(SW_API_IGMP_PT_LEAVE_SET) \ - SW_API_DESC(SW_API_IGMP_PT_LEAVE_GET) \ - SW_API_DESC(SW_API_IGMP_RP_SET) \ - SW_API_DESC(SW_API_IGMP_RP_GET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_CREAT_SET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_CREAT_GET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_STATIC_SET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_STATIC_GET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_LEAKY_SET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_LEAKY_GET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_V3_SET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_V3_GET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_QUEUE_SET) \ - SW_API_DESC(SW_API_IGMP_ENTRY_QUEUE_GET) \ - SW_API_DESC(SW_API_PT_IGMP_LEARN_LIMIT_SET) \ - SW_API_DESC(SW_API_PT_IGMP_LEARN_LIMIT_GET) \ - SW_API_DESC(SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET) \ - SW_API_DESC(SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET) \ - SW_API_DESC(SW_API_IGMP_SG_ENTRY_SET) \ - SW_API_DESC(SW_API_IGMP_SG_ENTRY_CLEAR) \ - SW_API_DESC(SW_API_IGMP_SG_ENTRY_SHOW) \ - SW_API_DESC(SW_API_IGMP_SG_ENTRY_QUERY) -#else -#define IGMP_API -#define IGMP_API_PARAM -#endif - -#ifdef IN_LEAKY -#define LEAKY_API \ - SW_API_DEF(SW_API_UC_LEAKY_MODE_SET, fal_uc_leaky_mode_set), \ - SW_API_DEF(SW_API_UC_LEAKY_MODE_GET, fal_uc_leaky_mode_get), \ - SW_API_DEF(SW_API_MC_LEAKY_MODE_SET, fal_mc_leaky_mode_set), \ - SW_API_DEF(SW_API_MC_LEAKY_MODE_GET, fal_mc_leaky_mode_get), \ - SW_API_DEF(SW_API_ARP_LEAKY_MODE_SET, fal_port_arp_leaky_set), \ - SW_API_DEF(SW_API_ARP_LEAKY_MODE_GET, fal_port_arp_leaky_get), \ - SW_API_DEF(SW_API_PT_UC_LEAKY_MODE_SET, fal_port_uc_leaky_set), \ - SW_API_DEF(SW_API_PT_UC_LEAKY_MODE_GET, fal_port_uc_leaky_get), \ - SW_API_DEF(SW_API_PT_MC_LEAKY_MODE_SET, fal_port_mc_leaky_set), \ - SW_API_DEF(SW_API_PT_MC_LEAKY_MODE_GET, fal_port_mc_leaky_get), - -#define LEAKY_API_PARAM \ - SW_API_DESC(SW_API_UC_LEAKY_MODE_SET) \ - SW_API_DESC(SW_API_UC_LEAKY_MODE_GET) \ - SW_API_DESC(SW_API_MC_LEAKY_MODE_SET) \ - SW_API_DESC(SW_API_MC_LEAKY_MODE_GET) \ - SW_API_DESC(SW_API_ARP_LEAKY_MODE_SET)\ - SW_API_DESC(SW_API_ARP_LEAKY_MODE_GET) \ - SW_API_DESC(SW_API_PT_UC_LEAKY_MODE_SET) \ - SW_API_DESC(SW_API_PT_UC_LEAKY_MODE_GET) \ - SW_API_DESC(SW_API_PT_MC_LEAKY_MODE_SET) \ - SW_API_DESC(SW_API_PT_MC_LEAKY_MODE_GET) -#else -#define LEAKY_API -#define LEAKY_API_PARAM -#endif - -#ifdef IN_MIRROR -#define MIRROR_API \ - SW_API_DEF(SW_API_MIRROR_ANALY_PT_SET, fal_mirr_analysis_port_set), \ - SW_API_DEF(SW_API_MIRROR_ANALY_PT_GET, fal_mirr_analysis_port_get), \ - SW_API_DEF(SW_API_MIRROR_IN_PT_SET, fal_mirr_port_in_set), \ - SW_API_DEF(SW_API_MIRROR_IN_PT_GET, fal_mirr_port_in_get), \ - SW_API_DEF(SW_API_MIRROR_EG_PT_SET, fal_mirr_port_eg_set), \ - SW_API_DEF(SW_API_MIRROR_EG_PT_GET, fal_mirr_port_eg_get), \ - SW_API_DEF(SW_API_MIRROR_ANALYSIS_CONFIG_SET, fal_mirr_analysis_config_set), \ - SW_API_DEF(SW_API_MIRROR_ANALYSIS_CONFIG_GET, fal_mirr_analysis_config_get), - -#define MIRROR_API_PARAM \ - SW_API_DESC(SW_API_MIRROR_ANALY_PT_SET) \ - SW_API_DESC(SW_API_MIRROR_ANALY_PT_GET) \ - SW_API_DESC(SW_API_MIRROR_IN_PT_SET) \ - SW_API_DESC(SW_API_MIRROR_IN_PT_GET) \ - SW_API_DESC(SW_API_MIRROR_EG_PT_SET) \ - SW_API_DESC(SW_API_MIRROR_EG_PT_GET) \ - SW_API_DESC(SW_API_MIRROR_ANALYSIS_CONFIG_SET) \ - SW_API_DESC(SW_API_MIRROR_ANALYSIS_CONFIG_GET) -#else -#define MIRROR_API -#define MIRROR_API_PARAM -#endif - -#ifdef IN_RATE -#define RATE_API \ - SW_API_DEF(SW_API_RATE_QU_EGRL_SET, fal_rate_queue_egrl_set), \ - SW_API_DEF(SW_API_RATE_QU_EGRL_GET, fal_rate_queue_egrl_get), \ - SW_API_DEF(SW_API_RATE_PT_EGRL_SET, fal_rate_port_egrl_set), \ - SW_API_DEF(SW_API_RATE_PT_EGRL_GET, fal_rate_port_egrl_get), \ - SW_API_DEF(SW_API_RATE_PT_INRL_SET, fal_rate_port_inrl_set), \ - SW_API_DEF(SW_API_RATE_PT_INRL_GET, fal_rate_port_inrl_get), \ - SW_API_DEF(SW_API_STORM_CTRL_FRAME_SET, fal_storm_ctrl_frame_set), \ - SW_API_DEF(SW_API_STORM_CTRL_FRAME_GET, fal_storm_ctrl_frame_get), \ - SW_API_DEF(SW_API_STORM_CTRL_RATE_SET, fal_storm_ctrl_rate_set), \ - SW_API_DEF(SW_API_STORM_CTRL_RATE_GET, fal_storm_ctrl_rate_get), \ - SW_API_DEF(SW_API_RATE_PORT_POLICER_SET, fal_rate_port_policer_set), \ - SW_API_DEF(SW_API_RATE_PORT_POLICER_GET, fal_rate_port_policer_get), \ - SW_API_DEF(SW_API_RATE_PORT_SHAPER_SET, fal_rate_port_shaper_set), \ - SW_API_DEF(SW_API_RATE_PORT_SHAPER_GET, fal_rate_port_shaper_get), \ - SW_API_DEF(SW_API_RATE_QUEUE_SHAPER_SET, fal_rate_queue_shaper_set), \ - SW_API_DEF(SW_API_RATE_QUEUE_SHAPER_GET, fal_rate_queue_shaper_get), \ - SW_API_DEF(SW_API_RATE_ACL_POLICER_SET, fal_rate_acl_policer_set), \ - SW_API_DEF(SW_API_RATE_ACL_POLICER_GET, fal_rate_acl_policer_get), \ - SW_API_DEF(SW_API_RATE_PT_ADDRATEBYTE_SET, fal_rate_port_add_rate_byte_set), \ - SW_API_DEF(SW_API_RATE_PT_ADDRATEBYTE_GET, fal_rate_port_add_rate_byte_get), \ - SW_API_DEF(SW_API_RATE_PT_GOL_FLOW_EN_SET, fal_rate_port_gol_flow_en_set), \ - SW_API_DEF(SW_API_RATE_PT_GOL_FLOW_EN_GET, fal_rate_port_gol_flow_en_get), - -#define RATE_API_PARAM \ - SW_API_DESC(SW_API_RATE_QU_EGRL_SET) \ - SW_API_DESC(SW_API_RATE_QU_EGRL_GET) \ - SW_API_DESC(SW_API_RATE_PT_EGRL_SET) \ - SW_API_DESC(SW_API_RATE_PT_EGRL_GET) \ - SW_API_DESC(SW_API_RATE_PT_INRL_SET) \ - SW_API_DESC(SW_API_RATE_PT_INRL_GET) \ - SW_API_DESC(SW_API_STORM_CTRL_FRAME_SET) \ - SW_API_DESC(SW_API_STORM_CTRL_FRAME_GET) \ - SW_API_DESC(SW_API_STORM_CTRL_RATE_SET) \ - SW_API_DESC(SW_API_STORM_CTRL_RATE_GET) \ - SW_API_DESC(SW_API_RATE_PORT_POLICER_SET) \ - SW_API_DESC(SW_API_RATE_PORT_POLICER_GET) \ - SW_API_DESC(SW_API_RATE_PORT_SHAPER_SET) \ - SW_API_DESC(SW_API_RATE_PORT_SHAPER_GET) \ - SW_API_DESC(SW_API_RATE_QUEUE_SHAPER_SET) \ - SW_API_DESC(SW_API_RATE_QUEUE_SHAPER_GET) \ - SW_API_DESC(SW_API_RATE_ACL_POLICER_SET) \ - SW_API_DESC(SW_API_RATE_ACL_POLICER_GET) \ - SW_API_DESC(SW_API_RATE_PT_ADDRATEBYTE_SET) \ - SW_API_DESC(SW_API_RATE_PT_ADDRATEBYTE_GET) \ - SW_API_DESC(SW_API_RATE_PT_GOL_FLOW_EN_SET) \ - SW_API_DESC(SW_API_RATE_PT_GOL_FLOW_EN_GET) -#else -#define RATE_API -#define RATE_API_PARAM -#endif - -#ifdef IN_STP -#define STP_API \ - SW_API_DEF(SW_API_STP_PT_STATE_SET, fal_stp_port_state_set), \ - SW_API_DEF(SW_API_STP_PT_STATE_GET, fal_stp_port_state_get), - -#define STP_API_PARAM \ - SW_API_DESC(SW_API_STP_PT_STATE_SET) \ - SW_API_DESC(SW_API_STP_PT_STATE_GET) -#else -#define STP_API -#define STP_API_PARAM -#endif - -#ifdef IN_MIB -#define MIB_API \ - SW_API_DEF(SW_API_PT_MIB_GET, fal_get_mib_info), \ - SW_API_DEF(SW_API_MIB_STATUS_SET, fal_mib_status_set), \ - SW_API_DEF(SW_API_MIB_STATUS_GET, fal_mib_status_get), \ - SW_API_DEF(SW_API_PT_MIB_FLUSH_COUNTERS, fal_mib_port_flush_counters), \ - SW_API_DEF(SW_API_MIB_CPU_KEEP_SET, fal_mib_cpukeep_set), \ - SW_API_DEF(SW_API_MIB_CPU_KEEP_GET, fal_mib_cpukeep_get),\ - SW_API_DEF(SW_API_PT_XGMIB_GET, fal_get_xgmib_info),\ - SW_API_DEF(SW_API_PT_MIB_COUNTER_GET, fal_mib_counter_get), -#define MIB_API_PARAM \ - SW_API_DESC(SW_API_PT_MIB_GET) \ - SW_API_DESC(SW_API_PT_XGMIB_GET) \ - SW_API_DESC(SW_API_MIB_STATUS_SET) \ - SW_API_DESC(SW_API_MIB_STATUS_GET) \ - SW_API_DESC(SW_API_PT_MIB_FLUSH_COUNTERS) \ - SW_API_DESC(SW_API_MIB_CPU_KEEP_SET) \ - SW_API_DESC(SW_API_MIB_CPU_KEEP_GET) \ - SW_API_DESC(SW_API_PT_MIB_COUNTER_GET) -#else -#define MIB_API -#define MIB_API_PARAM -#endif - -#ifdef IN_MISC -#define MISC_API \ - SW_API_DEF(SW_API_ARP_STATUS_SET, fal_arp_status_set), \ - SW_API_DEF(SW_API_ARP_STATUS_GET, fal_arp_status_get), \ - SW_API_DEF(SW_API_FRAME_MAX_SIZE_SET, fal_frame_max_size_set), \ - SW_API_DEF(SW_API_FRAME_MAX_SIZE_GET, fal_frame_max_size_get), \ - SW_API_DEF(SW_API_PT_UNK_SA_CMD_SET, fal_port_unk_sa_cmd_set), \ - SW_API_DEF(SW_API_PT_UNK_SA_CMD_GET, fal_port_unk_sa_cmd_get), \ - SW_API_DEF(SW_API_PT_UNK_UC_FILTER_SET, fal_port_unk_uc_filter_set), \ - SW_API_DEF(SW_API_PT_UNK_UC_FILTER_GET, fal_port_unk_uc_filter_get), \ - SW_API_DEF(SW_API_PT_UNK_MC_FILTER_SET, fal_port_unk_mc_filter_set), \ - SW_API_DEF(SW_API_PT_UNK_MC_FILTER_GET, fal_port_unk_mc_filter_get), \ - SW_API_DEF(SW_API_PT_BC_FILTER_SET, fal_port_bc_filter_set), \ - SW_API_DEF(SW_API_PT_BC_FILTER_GET, fal_port_bc_filter_get), \ - SW_API_DEF(SW_API_CPU_PORT_STATUS_SET, fal_cpu_port_status_set), \ - SW_API_DEF(SW_API_CPU_PORT_STATUS_GET, fal_cpu_port_status_get), \ - SW_API_DEF(SW_API_BC_TO_CPU_PORT_SET, fal_bc_to_cpu_port_set), \ - SW_API_DEF(SW_API_BC_TO_CPU_PORT_GET, fal_bc_to_cpu_port_get), \ - SW_API_DEF(SW_API_PT_DHCP_SET, fal_port_dhcp_set), \ - SW_API_DEF(SW_API_PT_DHCP_GET, fal_port_dhcp_get), \ - SW_API_DEF(SW_API_ARP_CMD_SET, fal_arp_cmd_set), \ - SW_API_DEF(SW_API_ARP_CMD_GET, fal_arp_cmd_get), \ - SW_API_DEF(SW_API_EAPOL_CMD_SET, fal_eapol_cmd_set), \ - SW_API_DEF(SW_API_EAPOL_CMD_GET, fal_eapol_cmd_get), \ - SW_API_DEF(SW_API_EAPOL_STATUS_SET, fal_eapol_status_set), \ - SW_API_DEF(SW_API_EAPOL_STATUS_GET, fal_eapol_status_get), \ - SW_API_DEF(SW_API_RIPV1_STATUS_SET, fal_ripv1_status_set), \ - SW_API_DEF(SW_API_RIPV1_STATUS_GET, fal_ripv1_status_get), \ - SW_API_DEF(SW_API_PT_ARP_REQ_STATUS_SET, fal_port_arp_req_status_set), \ - SW_API_DEF(SW_API_PT_ARP_REQ_STATUS_GET, fal_port_arp_req_status_get), \ - SW_API_DEF(SW_API_PT_ARP_ACK_STATUS_SET, fal_port_arp_ack_status_set), \ - SW_API_DEF(SW_API_PT_ARP_ACK_STATUS_GET, fal_port_arp_ack_status_get), \ - SW_API_DEF(SW_API_INTR_MASK_SET, fal_intr_mask_set), \ - SW_API_DEF(SW_API_INTR_MASK_GET, fal_intr_mask_get), \ - SW_API_DEF(SW_API_INTR_STATUS_GET, fal_intr_status_get), \ - SW_API_DEF(SW_API_INTR_STATUS_CLEAR, fal_intr_status_clear), \ - SW_API_DEF(SW_API_INTR_PORT_LINK_MASK_SET, fal_intr_port_link_mask_set), \ - SW_API_DEF(SW_API_INTR_PORT_LINK_MASK_GET, fal_intr_port_link_mask_get), \ - SW_API_DEF(SW_API_INTR_PORT_LINK_STATUS_GET, fal_intr_port_link_status_get), \ - SW_API_DEF(SW_API_INTR_MASK_MAC_LINKCHG_SET, fal_intr_mask_mac_linkchg_set), \ - SW_API_DEF(SW_API_INTR_MASK_MAC_LINKCHG_GET, fal_intr_mask_mac_linkchg_get), \ - SW_API_DEF(SW_API_INTR_STATUS_MAC_LINKCHG_GET, fal_intr_status_mac_linkchg_get), \ - SW_API_DEF(SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR, fal_intr_status_mac_linkchg_clear), \ - SW_API_DEF(SW_API_CPU_VID_EN_SET, fal_cpu_vid_en_set), \ - SW_API_DEF(SW_API_CPU_VID_EN_GET, fal_cpu_vid_en_get), \ - SW_API_DEF(SW_API_GLOBAL_MACADDR_SET, fal_global_macaddr_set), \ - SW_API_DEF(SW_API_GLOBAL_MACADDR_GET, fal_global_macaddr_get), \ - SW_API_DEF(SW_API_LLDP_STATUS_SET, fal_lldp_status_set), \ - SW_API_DEF(SW_API_LLDP_STATUS_GET, fal_lldp_status_get), \ - SW_API_DEF(SW_API_FRAME_CRC_RESERVE_SET, fal_frame_crc_reserve_set), \ - SW_API_DEF(SW_API_FRAME_CRC_RESERVE_GET, fal_frame_crc_reserve_get), \ - SW_API_DEF(SW_API_DEBUG_PORT_COUNTER_ENABLE, fal_debug_port_counter_enable), \ - SW_API_DEF(SW_API_DEBUG_PORT_COUNTER_STATUS_GET, fal_debug_port_counter_status_get), - - - -#define MISC_API_PARAM \ - SW_API_DESC(SW_API_ARP_STATUS_SET) \ - SW_API_DESC(SW_API_ARP_STATUS_GET) \ - SW_API_DESC(SW_API_FRAME_MAX_SIZE_SET) \ - SW_API_DESC(SW_API_FRAME_MAX_SIZE_GET) \ - SW_API_DESC(SW_API_PT_UNK_SA_CMD_SET) \ - SW_API_DESC(SW_API_PT_UNK_SA_CMD_GET) \ - SW_API_DESC(SW_API_PT_UNK_UC_FILTER_SET) \ - SW_API_DESC(SW_API_PT_UNK_UC_FILTER_GET) \ - SW_API_DESC(SW_API_PT_UNK_MC_FILTER_SET) \ - SW_API_DESC(SW_API_PT_UNK_MC_FILTER_GET) \ - SW_API_DESC(SW_API_PT_BC_FILTER_SET) \ - SW_API_DESC(SW_API_PT_BC_FILTER_GET) \ - SW_API_DESC(SW_API_CPU_PORT_STATUS_SET) \ - SW_API_DESC(SW_API_CPU_PORT_STATUS_GET) \ - SW_API_DESC(SW_API_BC_TO_CPU_PORT_SET) \ - SW_API_DESC(SW_API_BC_TO_CPU_PORT_GET) \ - SW_API_DESC(SW_API_PT_DHCP_SET) \ - SW_API_DESC(SW_API_PT_DHCP_GET) \ - SW_API_DESC(SW_API_ARP_CMD_SET) \ - SW_API_DESC(SW_API_ARP_CMD_GET) \ - SW_API_DESC(SW_API_EAPOL_CMD_SET) \ - SW_API_DESC(SW_API_EAPOL_CMD_GET) \ - SW_API_DESC(SW_API_EAPOL_STATUS_SET) \ - SW_API_DESC(SW_API_EAPOL_STATUS_GET) \ - SW_API_DESC(SW_API_RIPV1_STATUS_SET) \ - SW_API_DESC(SW_API_RIPV1_STATUS_GET) \ - SW_API_DESC(SW_API_PT_ARP_REQ_STATUS_SET) \ - SW_API_DESC(SW_API_PT_ARP_REQ_STATUS_GET) \ - SW_API_DESC(SW_API_PT_ARP_ACK_STATUS_SET) \ - SW_API_DESC(SW_API_PT_ARP_ACK_STATUS_GET) \ - SW_API_DESC(SW_API_INTR_MASK_SET) \ - SW_API_DESC(SW_API_INTR_MASK_GET) \ - SW_API_DESC(SW_API_INTR_STATUS_GET) \ - SW_API_DESC(SW_API_INTR_STATUS_CLEAR) \ - SW_API_DESC(SW_API_INTR_PORT_LINK_MASK_SET) \ - SW_API_DESC(SW_API_INTR_PORT_LINK_MASK_GET) \ - SW_API_DESC(SW_API_INTR_PORT_LINK_STATUS_GET) \ - SW_API_DESC(SW_API_INTR_MASK_MAC_LINKCHG_SET) \ - SW_API_DESC(SW_API_INTR_MASK_MAC_LINKCHG_GET) \ - SW_API_DESC(SW_API_INTR_STATUS_MAC_LINKCHG_GET) \ - SW_API_DESC(SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR) \ - SW_API_DESC(SW_API_CPU_VID_EN_SET) \ - SW_API_DESC(SW_API_CPU_VID_EN_GET) \ - SW_API_DESC(SW_API_GLOBAL_MACADDR_SET) \ - SW_API_DESC(SW_API_GLOBAL_MACADDR_GET) \ - SW_API_DESC(SW_API_LLDP_STATUS_SET) \ - SW_API_DESC(SW_API_LLDP_STATUS_GET) \ - SW_API_DESC(SW_API_FRAME_CRC_RESERVE_SET) \ - SW_API_DESC(SW_API_FRAME_CRC_RESERVE_GET) \ - SW_API_DESC(SW_API_DEBUG_PORT_COUNTER_ENABLE) \ - SW_API_DESC(SW_API_DEBUG_PORT_COUNTER_STATUS_GET) - - -#else -#define MISC_API -#define MISC_API_PARAM -#endif - -#ifdef IN_LED -#define LED_API \ - SW_API_DEF(SW_API_LED_PATTERN_SET, fal_led_ctrl_pattern_set), \ - SW_API_DEF(SW_API_LED_PATTERN_GET, fal_led_ctrl_pattern_get), - -#define LED_API_PARAM \ - SW_API_DESC(SW_API_LED_PATTERN_SET) \ - SW_API_DESC(SW_API_LED_PATTERN_GET) -#else -#define LED_API -#define LED_API_PARAM -#endif - -#ifdef IN_COSMAP -#define COSMAP_API \ - SW_API_DEF(SW_API_COSMAP_DSCP_TO_PRI_SET, fal_cosmap_dscp_to_pri_set), \ - SW_API_DEF(SW_API_COSMAP_DSCP_TO_PRI_GET, fal_cosmap_dscp_to_pri_get), \ - SW_API_DEF(SW_API_COSMAP_DSCP_TO_DP_SET, fal_cosmap_dscp_to_dp_set), \ - SW_API_DEF(SW_API_COSMAP_DSCP_TO_DP_GET, fal_cosmap_dscp_to_dp_get), \ - SW_API_DEF(SW_API_COSMAP_UP_TO_PRI_SET, fal_cosmap_up_to_pri_set), \ - SW_API_DEF(SW_API_COSMAP_UP_TO_PRI_GET, fal_cosmap_up_to_pri_get), \ - SW_API_DEF(SW_API_COSMAP_UP_TO_DP_SET, fal_cosmap_up_to_dp_set), \ - SW_API_DEF(SW_API_COSMAP_UP_TO_DP_GET, fal_cosmap_up_to_dp_get), \ - SW_API_DEF(SW_API_COSMAP_PRI_TO_QU_SET, fal_cosmap_pri_to_queue_set), \ - SW_API_DEF(SW_API_COSMAP_PRI_TO_QU_GET, fal_cosmap_pri_to_queue_get), \ - SW_API_DEF(SW_API_COSMAP_PRI_TO_EHQU_SET, fal_cosmap_pri_to_ehqueue_set), \ - SW_API_DEF(SW_API_COSMAP_PRI_TO_EHQU_GET, fal_cosmap_pri_to_ehqueue_get), \ - SW_API_DEF(SW_API_COSMAP_EG_REMARK_SET, fal_cosmap_egress_remark_set), \ - SW_API_DEF(SW_API_COSMAP_EG_REMARK_GET, fal_cosmap_egress_remark_get), \ - SW_API_DEF(SW_API_COSMAP_DSCP_TO_EHPRI_SET, fal_cosmap_dscp_to_ehpri_set), \ - SW_API_DEF(SW_API_COSMAP_DSCP_TO_EHPRI_GET, fal_cosmap_dscp_to_ehpri_get), \ - SW_API_DEF(SW_API_COSMAP_DSCP_TO_EHDP_SET, fal_cosmap_dscp_to_ehdp_set), \ - SW_API_DEF(SW_API_COSMAP_DSCP_TO_EHDP_GET, fal_cosmap_dscp_to_ehdp_get), \ - SW_API_DEF(SW_API_COSMAP_UP_TO_EHPRI_SET, fal_cosmap_up_to_ehpri_set), \ - SW_API_DEF(SW_API_COSMAP_UP_TO_EHPRI_GET, fal_cosmap_up_to_ehpri_get), \ - SW_API_DEF(SW_API_COSMAP_UP_TO_EHDP_SET, fal_cosmap_up_to_ehdp_set), \ - SW_API_DEF(SW_API_COSMAP_UP_TO_EHDP_GET, fal_cosmap_up_to_ehdp_get), - -#define COSMAP_API_PARAM \ - SW_API_DESC(SW_API_COSMAP_DSCP_TO_PRI_SET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_TO_PRI_GET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_TO_DP_SET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_TO_DP_GET) \ - SW_API_DESC(SW_API_COSMAP_UP_TO_PRI_SET) \ - SW_API_DESC(SW_API_COSMAP_UP_TO_PRI_GET) \ - SW_API_DESC(SW_API_COSMAP_UP_TO_DP_SET) \ - SW_API_DESC(SW_API_COSMAP_UP_TO_DP_GET) \ - SW_API_DESC(SW_API_COSMAP_PRI_TO_QU_SET) \ - SW_API_DESC(SW_API_COSMAP_PRI_TO_QU_GET) \ - SW_API_DESC(SW_API_COSMAP_PRI_TO_EHQU_SET) \ - SW_API_DESC(SW_API_COSMAP_PRI_TO_EHQU_GET) \ - SW_API_DESC(SW_API_COSMAP_EG_REMARK_SET) \ - SW_API_DESC(SW_API_COSMAP_EG_REMARK_GET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_TO_EHPRI_SET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_TO_EHPRI_GET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_TO_EHDP_SET) \ - SW_API_DESC(SW_API_COSMAP_DSCP_TO_EHDP_GET) \ - SW_API_DESC(SW_API_COSMAP_UP_TO_EHPRI_SET) \ - SW_API_DESC(SW_API_COSMAP_UP_TO_EHPRI_GET) \ - SW_API_DESC(SW_API_COSMAP_UP_TO_EHDP_SET) \ - SW_API_DESC(SW_API_COSMAP_UP_TO_EHDP_GET) -#else -#define COSMAP_API -#define COSMAP_API_PARAM -#endif - -#ifdef IN_SEC -#define SEC_API \ - SW_API_DEF(SW_API_SEC_NORM_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_NORM_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_MAC_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_MAC_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_IP_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_IP_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_IP4_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_IP4_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_IP6_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_IP6_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_TCP_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_TCP_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_UDP_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_UDP_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_ICMP4_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_ICMP4_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_ICMP6_SET, fal_sec_norm_item_set), \ - SW_API_DEF(SW_API_SEC_ICMP6_GET, fal_sec_norm_item_get), \ - SW_API_DEF(SW_API_SEC_L3_PARSER_CTRL_GET, fal_sec_l3_excep_parser_ctrl_get), \ - SW_API_DEF(SW_API_SEC_L3_PARSER_CTRL_SET, fal_sec_l3_excep_parser_ctrl_set), \ - SW_API_DEF(SW_API_SEC_L4_PARSER_CTRL_GET, fal_sec_l4_excep_parser_ctrl_get), \ - SW_API_DEF(SW_API_SEC_L4_PARSER_CTRL_SET, fal_sec_l4_excep_parser_ctrl_set), \ - SW_API_DEF(SW_API_SEC_EXP_CTRL_GET, fal_sec_l3_excep_ctrl_get), \ - SW_API_DEF(SW_API_SEC_EXP_CTRL_SET, fal_sec_l3_excep_ctrl_set), - -#define SEC_API_PARAM \ - SW_API_DESC(SW_API_SEC_NORM_SET) \ - SW_API_DESC(SW_API_SEC_NORM_GET) \ - SW_API_DESC(SW_API_SEC_MAC_SET) \ - SW_API_DESC(SW_API_SEC_MAC_GET) \ - SW_API_DESC(SW_API_SEC_IP_SET) \ - SW_API_DESC(SW_API_SEC_IP_GET) \ - SW_API_DESC(SW_API_SEC_IP4_SET) \ - SW_API_DESC(SW_API_SEC_IP4_GET) \ - SW_API_DESC(SW_API_SEC_IP6_SET) \ - SW_API_DESC(SW_API_SEC_IP6_GET) \ - SW_API_DESC(SW_API_SEC_TCP_SET) \ - SW_API_DESC(SW_API_SEC_TCP_GET) \ - SW_API_DESC(SW_API_SEC_UDP_SET) \ - SW_API_DESC(SW_API_SEC_UDP_GET) \ - SW_API_DESC(SW_API_SEC_ICMP4_SET) \ - SW_API_DESC(SW_API_SEC_ICMP4_GET) \ - SW_API_DESC(SW_API_SEC_ICMP6_SET) \ - SW_API_DESC(SW_API_SEC_ICMP6_GET) \ - SW_API_DESC(SW_API_SEC_L3_PARSER_CTRL_GET) \ - SW_API_DESC(SW_API_SEC_L3_PARSER_CTRL_SET) \ - SW_API_DESC(SW_API_SEC_L4_PARSER_CTRL_GET) \ - SW_API_DESC(SW_API_SEC_L4_PARSER_CTRL_SET) \ - SW_API_DESC(SW_API_SEC_EXP_CTRL_GET) \ - SW_API_DESC(SW_API_SEC_EXP_CTRL_SET) -#else -#define SEC_API -#define SEC_API_PARAM -#endif - -#ifdef IN_IP -#define IP_API \ - SW_API_DEF(SW_API_IP_HOST_ADD, fal_ip_host_add), \ - SW_API_DEF(SW_API_IP_HOST_DEL, fal_ip_host_del), \ - SW_API_DEF(SW_API_IP_HOST_GET, fal_ip_host_get), \ - SW_API_DEF(SW_API_IP_HOST_NEXT, fal_ip_host_next), \ - SW_API_DEF(SW_API_IP_HOST_COUNTER_BIND, fal_ip_host_counter_bind), \ - SW_API_DEF(SW_API_IP_HOST_PPPOE_BIND, fal_ip_host_pppoe_bind), \ - SW_API_DEF(SW_API_IP_PT_ARP_LEARN_SET, fal_ip_pt_arp_learn_set), \ - SW_API_DEF(SW_API_IP_PT_ARP_LEARN_GET, fal_ip_pt_arp_learn_get), \ - SW_API_DEF(SW_API_IP_ARP_LEARN_SET, fal_ip_arp_learn_set), \ - SW_API_DEF(SW_API_IP_ARP_LEARN_GET, fal_ip_arp_learn_get), \ - SW_API_DEF(SW_API_IP_SOURCE_GUARD_SET, fal_ip_source_guard_set), \ - SW_API_DEF(SW_API_IP_SOURCE_GUARD_GET, fal_ip_source_guard_get), \ - SW_API_DEF(SW_API_IP_ARP_GUARD_SET, fal_ip_arp_guard_set), \ - SW_API_DEF(SW_API_IP_ARP_GUARD_GET, fal_ip_arp_guard_get), \ - SW_API_DEF(SW_API_IP_ROUTE_STATUS_SET, fal_ip_route_status_set), \ - SW_API_DEF(SW_API_IP_ROUTE_STATUS_GET, fal_ip_route_status_get), \ - SW_API_DEF(SW_API_IP_INTF_ENTRY_ADD, fal_ip_intf_entry_add), \ - SW_API_DEF(SW_API_IP_INTF_ENTRY_DEL, fal_ip_intf_entry_del), \ - SW_API_DEF(SW_API_IP_INTF_ENTRY_NEXT, fal_ip_intf_entry_next), \ - SW_API_DEF(SW_API_IP_UNK_SOURCE_CMD_SET, fal_ip_unk_source_cmd_set), \ - SW_API_DEF(SW_API_IP_UNK_SOURCE_CMD_GET, fal_ip_unk_source_cmd_get), \ - SW_API_DEF(SW_API_ARP_UNK_SOURCE_CMD_SET, fal_arp_unk_source_cmd_set), \ - SW_API_DEF(SW_API_ARP_UNK_SOURCE_CMD_GET, fal_arp_unk_source_cmd_get), \ - SW_API_DEF(SW_API_IP_AGE_TIME_SET, fal_ip_age_time_set), \ - SW_API_DEF(SW_API_IP_AGE_TIME_GET, fal_ip_age_time_get), \ - SW_API_DEF(SW_API_WCMP_HASH_MODE_SET, fal_ip_wcmp_hash_mode_set), \ - SW_API_DEF(SW_API_WCMP_HASH_MODE_GET, fal_ip_wcmp_hash_mode_get), \ - SW_API_DEF(SW_API_IP_VRF_BASE_ADDR_SET, fal_ip_vrf_base_addr_set), \ - SW_API_DEF(SW_API_IP_VRF_BASE_ADDR_GET, fal_ip_vrf_base_addr_get), \ - SW_API_DEF(SW_API_IP_VRF_BASE_MASK_SET, fal_ip_vrf_base_mask_set), \ - SW_API_DEF(SW_API_IP_VRF_BASE_MASK_GET, fal_ip_vrf_base_mask_get), \ - SW_API_DEF(SW_API_IP_DEFAULT_ROUTE_SET, fal_ip_default_route_set), \ - SW_API_DEF(SW_API_IP_DEFAULT_ROUTE_GET, fal_ip_default_route_get), \ - SW_API_DEF(SW_API_IP_HOST_ROUTE_SET, fal_ip_host_route_set), \ - SW_API_DEF(SW_API_IP_HOST_ROUTE_GET, fal_ip_host_route_get), \ - SW_API_DEF(SW_API_IP_WCMP_ENTRY_SET, fal_ip_wcmp_entry_set), \ - SW_API_DEF(SW_API_IP_WCMP_ENTRY_GET, fal_ip_wcmp_entry_get), \ - SW_API_DEF(SW_API_IP_RFS_IP4_SET, fal_ip_rfs_ip4_rule_set), \ - SW_API_DEF(SW_API_IP_RFS_IP6_SET, fal_ip_rfs_ip6_rule_set), \ - SW_API_DEF(SW_API_IP_RFS_IP4_DEL, fal_ip_rfs_ip4_rule_del), \ - SW_API_DEF(SW_API_IP_RFS_IP6_DEL, fal_ip_rfs_ip6_rule_del), \ - SW_API_DEF(SW_API_IP_DEFAULT_FLOW_CMD_SET, fal_default_flow_cmd_set), \ - SW_API_DEF(SW_API_IP_DEFAULT_FLOW_CMD_GET, fal_default_flow_cmd_get), \ - SW_API_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET, fal_default_rt_flow_cmd_set), \ - SW_API_DEF(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET, fal_default_rt_flow_cmd_get), \ - SW_API_DEF(SW_API_IP_VIS_ARP_SG_CFG_GET, fal_ip_vsi_arp_sg_cfg_get), \ - SW_API_DEF(SW_API_IP_VIS_ARP_SG_CFG_SET, fal_ip_vsi_arp_sg_cfg_set), \ - SW_API_DEF(SW_API_IP_NETWORK_ROUTE_GET, fal_ip_network_route_get), \ - SW_API_DEF(SW_API_IP_NETWORK_ROUTE_ADD, fal_ip_network_route_add), \ - SW_API_DEF(SW_API_IP_INTF_GET, fal_ip_intf_get), \ - SW_API_DEF(SW_API_IP_INTF_SET, fal_ip_intf_set), \ - SW_API_DEF(SW_API_IP_VSI_INTF_GET, fal_ip_vsi_intf_get), \ - SW_API_DEF(SW_API_IP_VSI_INTF_SET, fal_ip_vsi_intf_set), \ - SW_API_DEF(SW_API_IP_NEXTHOP_GET, fal_ip_nexthop_get), \ - SW_API_DEF(SW_API_IP_NEXTHOP_SET, fal_ip_nexthop_set), \ - SW_API_DEF(SW_API_IP_VSI_SG_SET, fal_ip_vsi_sg_cfg_set), \ - SW_API_DEF(SW_API_IP_VSI_SG_GET, fal_ip_vsi_sg_cfg_get), \ - SW_API_DEF(SW_API_IP_PORT_SG_SET, fal_ip_port_sg_cfg_set), \ - SW_API_DEF(SW_API_IP_PORT_SG_GET, fal_ip_port_sg_cfg_get), \ - SW_API_DEF(SW_API_IP_PUB_IP_SET, fal_ip_pub_addr_set), \ - SW_API_DEF(SW_API_IP_PUB_IP_GET, fal_ip_pub_addr_get), \ - SW_API_DEF(SW_API_IP_NETWORK_ROUTE_DEL, fal_ip_network_route_del), \ - SW_API_DEF(SW_API_IP_PORT_INTF_GET, fal_ip_port_intf_get), \ - SW_API_DEF(SW_API_IP_PORT_INTF_SET, fal_ip_port_intf_set), \ - SW_API_DEF(SW_API_IP_PORT_MAC_GET, fal_ip_port_macaddr_get), \ - SW_API_DEF(SW_API_IP_PORT_MAC_SET, fal_ip_port_macaddr_set), \ - SW_API_DEF(SW_API_IP_ROUTE_MISS_GET, fal_ip_route_mismatch_action_get), \ - SW_API_DEF(SW_API_IP_ROUTE_MISS_SET, fal_ip_route_mismatch_action_set), \ - SW_API_DEF(SW_API_IP_PORT_ARP_SG_SET, fal_ip_port_arp_sg_cfg_set), \ - SW_API_DEF(SW_API_IP_PORT_ARP_SG_GET, fal_ip_port_arp_sg_cfg_get), \ - SW_API_DEF(SW_API_IP_VSI_MC_MODE_SET, fal_ip_vsi_mc_mode_set), \ - SW_API_DEF(SW_API_IP_VSI_MC_MODE_GET, fal_ip_vsi_mc_mode_get), \ - SW_API_DEF(SW_API_GLOBAL_CTRL_GET, fal_ip_global_ctrl_get), \ - SW_API_DEF(SW_API_GLOBAL_CTRL_SET, fal_ip_global_ctrl_set), - -#define IP_API_PARAM \ - SW_API_DESC(SW_API_IP_HOST_ADD) \ - SW_API_DESC(SW_API_IP_HOST_DEL) \ - SW_API_DESC(SW_API_IP_HOST_GET) \ - SW_API_DESC(SW_API_IP_HOST_NEXT) \ - SW_API_DESC(SW_API_IP_HOST_COUNTER_BIND) \ - SW_API_DESC(SW_API_IP_HOST_PPPOE_BIND) \ - SW_API_DESC(SW_API_IP_PT_ARP_LEARN_SET) \ - SW_API_DESC(SW_API_IP_PT_ARP_LEARN_GET) \ - SW_API_DESC(SW_API_IP_ARP_LEARN_SET) \ - SW_API_DESC(SW_API_IP_ARP_LEARN_GET) \ - SW_API_DESC(SW_API_IP_SOURCE_GUARD_SET) \ - SW_API_DESC(SW_API_IP_SOURCE_GUARD_GET) \ - SW_API_DESC(SW_API_IP_ARP_GUARD_SET) \ - SW_API_DESC(SW_API_IP_ARP_GUARD_GET) \ - SW_API_DESC(SW_API_IP_ROUTE_STATUS_SET) \ - SW_API_DESC(SW_API_IP_ROUTE_STATUS_GET) \ - SW_API_DESC(SW_API_IP_INTF_ENTRY_ADD) \ - SW_API_DESC(SW_API_IP_INTF_ENTRY_DEL) \ - SW_API_DESC(SW_API_IP_INTF_ENTRY_NEXT) \ - SW_API_DESC(SW_API_IP_UNK_SOURCE_CMD_SET) \ - SW_API_DESC(SW_API_IP_UNK_SOURCE_CMD_GET) \ - SW_API_DESC(SW_API_ARP_UNK_SOURCE_CMD_SET) \ - SW_API_DESC(SW_API_ARP_UNK_SOURCE_CMD_GET) \ - SW_API_DESC(SW_API_IP_AGE_TIME_SET) \ - SW_API_DESC(SW_API_IP_AGE_TIME_GET) \ - SW_API_DESC(SW_API_WCMP_HASH_MODE_SET) \ - SW_API_DESC(SW_API_WCMP_HASH_MODE_GET) \ - SW_API_DESC(SW_API_IP_VRF_BASE_ADDR_SET) \ - SW_API_DESC(SW_API_IP_VRF_BASE_ADDR_GET) \ - SW_API_DESC(SW_API_IP_VRF_BASE_MASK_SET) \ - SW_API_DESC(SW_API_IP_VRF_BASE_MASK_GET) \ - SW_API_DESC(SW_API_IP_DEFAULT_ROUTE_SET) \ - SW_API_DESC(SW_API_IP_DEFAULT_ROUTE_GET) \ - SW_API_DESC(SW_API_IP_HOST_ROUTE_SET) \ - SW_API_DESC(SW_API_IP_HOST_ROUTE_GET) \ - SW_API_DESC(SW_API_IP_WCMP_ENTRY_SET) \ - SW_API_DESC(SW_API_IP_WCMP_ENTRY_GET) \ - SW_API_DESC(SW_API_IP_RFS_IP4_SET) \ - SW_API_DESC(SW_API_IP_RFS_IP6_SET) \ - SW_API_DESC(SW_API_IP_RFS_IP4_DEL) \ - SW_API_DESC(SW_API_IP_RFS_IP6_DEL) \ - SW_API_DESC(SW_API_IP_DEFAULT_FLOW_CMD_SET) \ - SW_API_DESC(SW_API_IP_DEFAULT_FLOW_CMD_GET) \ - SW_API_DESC(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET) \ - SW_API_DESC(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET) \ - SW_API_DESC(SW_API_IP_VIS_ARP_SG_CFG_GET) \ - SW_API_DESC(SW_API_IP_VIS_ARP_SG_CFG_SET) \ - SW_API_DESC(SW_API_IP_NETWORK_ROUTE_GET) \ - SW_API_DESC(SW_API_IP_NETWORK_ROUTE_ADD) \ - SW_API_DESC(SW_API_IP_INTF_GET) \ - SW_API_DESC(SW_API_IP_INTF_SET) \ - SW_API_DESC(SW_API_IP_VSI_INTF_GET) \ - SW_API_DESC(SW_API_IP_VSI_INTF_SET) \ - SW_API_DESC(SW_API_IP_NEXTHOP_GET) \ - SW_API_DESC(SW_API_IP_NEXTHOP_SET) \ - SW_API_DESC(SW_API_IP_VSI_SG_SET) \ - SW_API_DESC(SW_API_IP_VSI_SG_GET) \ - SW_API_DESC(SW_API_IP_PORT_SG_SET) \ - SW_API_DESC(SW_API_IP_PORT_SG_GET) \ - SW_API_DESC(SW_API_IP_PUB_IP_SET) \ - SW_API_DESC(SW_API_IP_PUB_IP_GET) \ - SW_API_DESC(SW_API_IP_NETWORK_ROUTE_DEL) \ - SW_API_DESC(SW_API_IP_PORT_INTF_GET) \ - SW_API_DESC(SW_API_IP_PORT_INTF_SET) \ - SW_API_DESC(SW_API_IP_PORT_MAC_GET) \ - SW_API_DESC(SW_API_IP_PORT_MAC_SET) \ - SW_API_DESC(SW_API_IP_ROUTE_MISS_GET) \ - SW_API_DESC(SW_API_IP_ROUTE_MISS_SET) \ - SW_API_DESC(SW_API_IP_PORT_ARP_SG_SET) \ - SW_API_DESC(SW_API_IP_PORT_ARP_SG_GET) \ - SW_API_DESC(SW_API_IP_VSI_MC_MODE_SET) \ - SW_API_DESC(SW_API_IP_VSI_MC_MODE_GET) \ - SW_API_DESC(SW_API_GLOBAL_CTRL_GET) \ - SW_API_DESC(SW_API_GLOBAL_CTRL_SET) -#else -#define IP_API -#define IP_API_PARAM -#endif - -#ifdef IN_FLOW -#define FLOW_API \ - SW_API_DEF(SW_API_FLOW_STATUS_SET, fal_flow_status_set), \ - SW_API_DEF(SW_API_FLOW_STATUS_GET, fal_flow_status_get), \ - SW_API_DEF(SW_API_FLOW_AGE_TIMER_SET, fal_flow_age_timer_set), \ - SW_API_DEF(SW_API_FLOW_AGE_TIMER_GET, fal_flow_age_timer_get), \ - SW_API_DEF(SW_API_FLOW_CTRL_SET, fal_flow_mgmt_set), \ - SW_API_DEF(SW_API_FLOW_CTRL_GET, fal_flow_mgmt_get), \ - SW_API_DEF(SW_API_FLOW_ENTRY_ADD, fal_flow_entry_add), \ - SW_API_DEF(SW_API_FLOW_ENTRY_DEL, fal_flow_entry_del), \ - SW_API_DEF(SW_API_FLOW_ENTRY_GET, fal_flow_entry_get), \ - SW_API_DEF(SW_API_FLOW_GLOBAL_CFG_GET, fal_flow_global_cfg_get), \ - SW_API_DEF(SW_API_FLOW_GLOBAL_CFG_SET, fal_flow_global_cfg_set), \ - SW_API_DEF(SW_API_FLOW_HOST_ADD, fal_flow_host_add), \ - SW_API_DEF(SW_API_FLOW_HOST_GET, fal_flow_host_get), \ - SW_API_DEF(SW_API_FLOW_HOST_DEL, fal_flow_host_del), \ - SW_API_DEF(SW_API_FLOWENTRY_NEXT, fal_flow_entry_next), - -#define FLOW_API_PARAM \ - SW_API_DESC(SW_API_FLOW_STATUS_SET) \ - SW_API_DESC(SW_API_FLOW_STATUS_GET) \ - SW_API_DESC(SW_API_FLOW_AGE_TIMER_SET) \ - SW_API_DESC(SW_API_FLOW_AGE_TIMER_GET) \ - SW_API_DESC(SW_API_FLOW_CTRL_SET) \ - SW_API_DESC(SW_API_FLOW_CTRL_GET) \ - SW_API_DESC(SW_API_FLOW_ENTRY_ADD) \ - SW_API_DESC(SW_API_FLOW_ENTRY_DEL) \ - SW_API_DESC(SW_API_FLOW_ENTRY_GET) \ - SW_API_DESC(SW_API_FLOW_GLOBAL_CFG_GET) \ - SW_API_DESC(SW_API_FLOW_GLOBAL_CFG_SET) \ - SW_API_DESC(SW_API_FLOW_HOST_ADD) \ - SW_API_DESC(SW_API_FLOW_HOST_GET) \ - SW_API_DESC(SW_API_FLOW_HOST_DEL) \ - SW_API_DESC(SW_API_FLOWENTRY_NEXT) -#else -#define FLOW_API -#define FLOW_API_PARAM -#endif - -#ifdef IN_NAT -#define NAT_API \ - SW_API_DEF(SW_API_NAT_ADD, fal_nat_add), \ - SW_API_DEF(SW_API_NAT_DEL, fal_nat_del), \ - SW_API_DEF(SW_API_NAT_GET, fal_nat_get), \ - SW_API_DEF(SW_API_NAT_NEXT, fal_nat_next), \ - SW_API_DEF(SW_API_NAT_COUNTER_BIND, fal_nat_counter_bind), \ - SW_API_DEF(SW_API_NAPT_ADD, fal_napt_add), \ - SW_API_DEF(SW_API_NAPT_DEL, fal_napt_del), \ - SW_API_DEF(SW_API_NAPT_GET, fal_napt_get), \ - SW_API_DEF(SW_API_NAPT_NEXT, fal_napt_next), \ - SW_API_DEF(SW_API_NAPT_COUNTER_BIND, fal_napt_counter_bind), \ - SW_API_DEF(SW_API_FLOW_ADD, fal_flow_add), \ - SW_API_DEF(SW_API_FLOW_DEL, fal_flow_del), \ - SW_API_DEF(SW_API_FLOW_GET, fal_flow_get), \ - SW_API_DEF(SW_API_FLOW_NEXT, fal_flow_next), \ - SW_API_DEF(SW_API_FLOW_COUNTER_BIND, fal_flow_counter_bind), \ - SW_API_DEF(SW_API_NAT_STATUS_SET, fal_nat_status_set), \ - SW_API_DEF(SW_API_NAT_STATUS_GET, fal_nat_status_get), \ - SW_API_DEF(SW_API_NAT_HASH_MODE_SET, fal_nat_hash_mode_set), \ - SW_API_DEF(SW_API_NAT_HASH_MODE_GET, fal_nat_hash_mode_get), \ - SW_API_DEF(SW_API_NAPT_STATUS_SET, fal_napt_status_set), \ - SW_API_DEF(SW_API_NAPT_STATUS_GET, fal_napt_status_get), \ - SW_API_DEF(SW_API_NAPT_MODE_SET, fal_napt_mode_set), \ - SW_API_DEF(SW_API_NAPT_MODE_GET, fal_napt_mode_get), \ - SW_API_DEF(SW_API_PRV_BASE_ADDR_SET, fal_nat_prv_base_addr_set), \ - SW_API_DEF(SW_API_PRV_BASE_ADDR_GET, fal_nat_prv_base_addr_get), \ - SW_API_DEF(SW_API_PRV_ADDR_MODE_SET, fal_nat_prv_addr_mode_set), \ - SW_API_DEF(SW_API_PRV_ADDR_MODE_GET, fal_nat_prv_addr_mode_get), \ - SW_API_DEF(SW_API_PUB_ADDR_ENTRY_ADD, fal_nat_pub_addr_add), \ - SW_API_DEF(SW_API_PUB_ADDR_ENTRY_DEL, fal_nat_pub_addr_del), \ - SW_API_DEF(SW_API_PUB_ADDR_ENTRY_NEXT, fal_nat_pub_addr_next), \ - SW_API_DEF(SW_API_NAT_UNK_SESSION_CMD_SET, fal_nat_unk_session_cmd_set), \ - SW_API_DEF(SW_API_NAT_UNK_SESSION_CMD_GET, fal_nat_unk_session_cmd_get), \ - SW_API_DEF(SW_API_PRV_BASE_MASK_SET, fal_nat_prv_base_mask_set), \ - SW_API_DEF(SW_API_PRV_BASE_MASK_GET, fal_nat_prv_base_mask_get), \ - SW_API_DEF(SW_API_NAT_GLOBAL_SET, fal_nat_global_set), \ - SW_API_DEF(SW_API_FLOW_COOKIE_SET, fal_flow_cookie_set), \ - SW_API_DEF(SW_API_FLOW_RFS_SET, fal_flow_rfs_set), - -#define NAT_API_PARAM \ - SW_API_DESC(SW_API_NAT_ADD) \ - SW_API_DESC(SW_API_NAT_DEL) \ - SW_API_DESC(SW_API_NAT_GET) \ - SW_API_DESC(SW_API_NAT_NEXT) \ - SW_API_DESC(SW_API_NAT_COUNTER_BIND) \ - SW_API_DESC(SW_API_NAPT_ADD) \ - SW_API_DESC(SW_API_NAPT_DEL) \ - SW_API_DESC(SW_API_NAPT_GET) \ - SW_API_DESC(SW_API_NAPT_NEXT) \ - SW_API_DESC(SW_API_NAPT_COUNTER_BIND) \ - SW_API_DESC(SW_API_FLOW_ADD) \ - SW_API_DESC(SW_API_FLOW_DEL) \ - SW_API_DESC(SW_API_FLOW_GET) \ - SW_API_DESC(SW_API_FLOW_NEXT) \ - SW_API_DESC(SW_API_FLOW_COUNTER_BIND) \ - SW_API_DESC(SW_API_NAT_STATUS_SET) \ - SW_API_DESC(SW_API_NAT_STATUS_GET) \ - SW_API_DESC(SW_API_NAT_HASH_MODE_SET) \ - SW_API_DESC(SW_API_NAT_HASH_MODE_GET) \ - SW_API_DESC(SW_API_NAPT_STATUS_SET) \ - SW_API_DESC(SW_API_NAPT_STATUS_GET) \ - SW_API_DESC(SW_API_NAPT_MODE_SET) \ - SW_API_DESC(SW_API_NAPT_MODE_GET) \ - SW_API_DESC(SW_API_PRV_BASE_ADDR_SET) \ - SW_API_DESC(SW_API_PRV_BASE_ADDR_GET) \ - SW_API_DESC(SW_API_PRV_ADDR_MODE_SET) \ - SW_API_DESC(SW_API_PRV_ADDR_MODE_GET) \ - SW_API_DESC(SW_API_PUB_ADDR_ENTRY_ADD) \ - SW_API_DESC(SW_API_PUB_ADDR_ENTRY_DEL) \ - SW_API_DESC(SW_API_PUB_ADDR_ENTRY_NEXT) \ - SW_API_DESC(SW_API_NAT_UNK_SESSION_CMD_SET) \ - SW_API_DESC(SW_API_NAT_UNK_SESSION_CMD_GET) \ - SW_API_DESC(SW_API_PRV_BASE_MASK_SET) \ - SW_API_DESC(SW_API_PRV_BASE_MASK_GET) \ - SW_API_DESC(SW_API_NAT_GLOBAL_SET) \ - SW_API_DESC(SW_API_FLOW_COOKIE_SET) \ - SW_API_DESC(SW_API_FLOW_RFS_SET) -#else -#define NAT_API -#define NAT_API_PARAM -#endif - -#ifdef IN_TRUNK -#define TRUNK_API \ - SW_API_DEF(SW_API_TRUNK_GROUP_SET, fal_trunk_group_set), \ - SW_API_DEF(SW_API_TRUNK_GROUP_GET, fal_trunk_group_get), \ - SW_API_DEF(SW_API_TRUNK_HASH_SET, fal_trunk_hash_mode_set), \ - SW_API_DEF(SW_API_TRUNK_HASH_GET, fal_trunk_hash_mode_get), \ - SW_API_DEF(SW_API_TRUNK_MAN_SA_SET, fal_trunk_manipulate_sa_set), \ - SW_API_DEF(SW_API_TRUNK_MAN_SA_GET, fal_trunk_manipulate_sa_get), \ - SW_API_DEF(SW_API_TRUNK_FAILOVER_EN_SET, fal_trunk_failover_enable), \ - SW_API_DEF(SW_API_TRUNK_FAILOVER_EN_GET, fal_trunk_failover_status_get), - -#define TRUNK_API_PARAM \ - SW_API_DESC(SW_API_TRUNK_GROUP_SET) \ - SW_API_DESC(SW_API_TRUNK_GROUP_GET) \ - SW_API_DESC(SW_API_TRUNK_HASH_SET) \ - SW_API_DESC(SW_API_TRUNK_HASH_GET) \ - SW_API_DESC(SW_API_TRUNK_MAN_SA_SET)\ - SW_API_DESC(SW_API_TRUNK_MAN_SA_GET)\ - SW_API_DESC(SW_API_TRUNK_FAILOVER_EN_SET)\ - SW_API_DESC(SW_API_TRUNK_FAILOVER_EN_GET) -#else -#define TRUNK_API -#define TRUNK_API_PARAM -#endif - -#ifdef IN_INTERFACECONTROL -#define INTERFACECTRL_API \ - SW_API_DEF(SW_API_MAC_MODE_SET, fal_interface_mac_mode_set), \ - SW_API_DEF(SW_API_MAC_MODE_GET, fal_interface_mac_mode_get), \ - SW_API_DEF(SW_API_PORT_3AZ_STATUS_SET, fal_port_3az_status_set), \ - SW_API_DEF(SW_API_PORT_3AZ_STATUS_GET, fal_port_3az_status_get), \ - SW_API_DEF(SW_API_PHY_MODE_SET, fal_interface_phy_mode_set), \ - SW_API_DEF(SW_API_PHY_MODE_GET, fal_interface_phy_mode_get), \ - SW_API_DEF(SW_API_FX100_CTRL_SET, fal_interface_fx100_ctrl_set), \ - SW_API_DEF(SW_API_FX100_CTRL_GET, fal_interface_fx100_ctrl_get), \ - SW_API_DEF(SW_API_FX100_STATUS_GET, fal_interface_fx100_status_get),\ - SW_API_DEF(SW_API_MAC06_EXCH_SET, fal_interface_mac06_exch_set),\ - SW_API_DEF(SW_API_MAC06_EXCH_GET, fal_interface_mac06_exch_get), - -#define INTERFACECTRL_API_PARAM \ - SW_API_DESC(SW_API_MAC_MODE_SET) \ - SW_API_DESC(SW_API_MAC_MODE_GET) \ - SW_API_DESC(SW_API_PORT_3AZ_STATUS_SET) \ - SW_API_DESC(SW_API_PORT_3AZ_STATUS_GET) \ - SW_API_DESC(SW_API_PHY_MODE_SET) \ - SW_API_DESC(SW_API_PHY_MODE_GET) \ - SW_API_DESC(SW_API_FX100_CTRL_SET) \ - SW_API_DESC(SW_API_FX100_CTRL_GET) \ - SW_API_DESC(SW_API_FX100_STATUS_GET) \ - SW_API_DESC(SW_API_MAC06_EXCH_SET) \ - SW_API_DESC(SW_API_MAC06_EXCH_GET) - -#else -#define INTERFACECTRL_API -#define INTERFACECTRL_API_PARAM -#endif - -#ifdef IN_VSI -#define VSI_API \ - SW_API_DEF(SW_API_VSI_ALLOC, fal_vsi_alloc), \ - SW_API_DEF(SW_API_VSI_FREE, fal_vsi_free), \ - SW_API_DEF(SW_API_PORT_VSI_SET, fal_port_vsi_set), \ - SW_API_DEF(SW_API_PORT_VSI_GET, fal_port_vsi_get), \ - SW_API_DEF(SW_API_PORT_VLAN_VSI_SET, fal_port_vlan_vsi_set), \ - SW_API_DEF(SW_API_PORT_VLAN_VSI_GET, fal_port_vlan_vsi_get), \ - SW_API_DEF(SW_API_VSI_TBL_DUMP, fal_vsi_tbl_dump), \ - SW_API_DEF(SW_API_VSI_NEWADDR_LRN_GET, fal_vsi_newaddr_lrn_get), \ - SW_API_DEF(SW_API_VSI_NEWADDR_LRN_SET, fal_vsi_newaddr_lrn_set), \ - SW_API_DEF(SW_API_VSI_STAMOVE_SET, fal_vsi_stamove_set), \ - SW_API_DEF(SW_API_VSI_STAMOVE_GET,fal_vsi_stamove_get), \ - SW_API_DEF(SW_API_VSI_MEMBER_SET, fal_vsi_member_set), \ - SW_API_DEF(SW_API_VSI_MEMBER_GET, fal_vsi_member_get), \ - SW_API_DEF(SW_API_VSI_COUNTER_GET,fal_vsi_counter_get), \ - SW_API_DEF(SW_API_VSI_COUNTER_CLEANUP,fal_vsi_counter_cleanup), - - -#define VSI_API_PARAM \ - SW_API_DESC(SW_API_VSI_ALLOC) \ - SW_API_DESC(SW_API_VSI_FREE) \ - SW_API_DESC(SW_API_PORT_VSI_SET) \ - SW_API_DESC(SW_API_PORT_VSI_GET) \ - SW_API_DESC(SW_API_PORT_VLAN_VSI_SET) \ - SW_API_DESC(SW_API_PORT_VLAN_VSI_GET) \ - SW_API_DESC(SW_API_VSI_TBL_DUMP) \ - SW_API_DESC(SW_API_VSI_NEWADDR_LRN_GET) \ - SW_API_DESC(SW_API_VSI_NEWADDR_LRN_SET) \ - SW_API_DESC(SW_API_VSI_STAMOVE_SET) \ - SW_API_DESC(SW_API_VSI_STAMOVE_GET) \ - SW_API_DESC(SW_API_VSI_MEMBER_SET) \ - SW_API_DESC(SW_API_VSI_MEMBER_GET) \ - SW_API_DESC(SW_API_VSI_COUNTER_GET) \ - SW_API_DESC(SW_API_VSI_COUNTER_CLEANUP) - -#else -#define VSI_API -#define VSI_API_PARAM -#endif - -#ifdef IN_QM -#define QM_API \ - SW_API_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_SET, fal_ucast_queue_base_profile_set), \ - SW_API_DEF(SW_API_UCAST_QUEUE_BASE_PROFILE_GET, fal_ucast_queue_base_profile_get), \ - SW_API_DEF(SW_API_UCAST_PRIORITY_CLASS_SET, fal_ucast_priority_class_set), \ - SW_API_DEF(SW_API_UCAST_PRIORITY_CLASS_GET, fal_ucast_priority_class_get), \ - SW_API_DEF(SW_API_MCAST_PRIORITY_CLASS_SET, fal_port_mcast_priority_class_set), \ - SW_API_DEF(SW_API_MCAST_PRIORITY_CLASS_GET, fal_port_mcast_priority_class_get), \ - SW_API_DEF(SW_API_QUEUE_FLUSH, fal_queue_flush), \ - SW_API_DEF(SW_API_UCAST_HASH_MAP_SET, fal_ucast_hash_map_set), \ - SW_API_DEF(SW_API_UCAST_HASH_MAP_GET, fal_ucast_hash_map_get), \ - SW_API_DEF(SW_API_UCAST_DFLT_HASH_MAP_SET, fal_ucast_default_hash_set), \ - SW_API_DEF(SW_API_UCAST_DFLT_HASH_MAP_GET, fal_ucast_default_hash_get), \ - SW_API_DEF(SW_API_MCAST_CPUCODE_CLASS_SET, fal_mcast_cpu_code_class_set), \ - SW_API_DEF(SW_API_MCAST_CPUCODE_CLASS_GET, fal_mcast_cpu_code_class_get), \ - SW_API_DEF(SW_API_AC_CTRL_SET, fal_ac_ctrl_set), \ - SW_API_DEF(SW_API_AC_CTRL_GET, fal_ac_ctrl_get), \ - SW_API_DEF(SW_API_AC_PRE_BUFFER_SET, fal_ac_prealloc_buffer_set), \ - SW_API_DEF(SW_API_AC_PRE_BUFFER_GET, fal_ac_prealloc_buffer_get), \ - SW_API_DEF(SW_API_QUEUE_GROUP_SET, fal_ac_queue_group_set), \ - SW_API_DEF(SW_API_QUEUE_GROUP_GET, fal_ac_queue_group_get), \ - SW_API_DEF(SW_API_STATIC_THRESH_SET, fal_ac_static_threshold_set), \ - SW_API_DEF(SW_API_STATIC_THRESH_GET, fal_ac_static_threshold_get), \ - SW_API_DEF(SW_API_DYNAMIC_THRESH_SET, fal_ac_dynamic_threshold_set), \ - SW_API_DEF(SW_API_DYNAMIC_THRESH_GET, fal_ac_dynamic_threshold_get), \ - SW_API_DEF(SW_API_GOURP_BUFFER_SET, fal_ac_group_buffer_set), \ - SW_API_DEF(SW_API_GOURP_BUFFER_GET, fal_ac_group_buffer_get), \ - SW_API_DEF(SW_API_QUEUE_CNT_CTRL_GET, fal_queue_counter_ctrl_get), \ - SW_API_DEF(SW_API_QUEUE_CNT_CTRL_SET, fal_queue_counter_ctrl_set), \ - SW_API_DEF(SW_API_QUEUE_CNT_GET, fal_queue_counter_get), \ - SW_API_DEF(SW_API_QUEUE_CNT_CLEANUP, fal_queue_counter_cleanup), \ - SW_API_DEF(SW_API_QM_ENQUEUE_CTRL_SET, fal_qm_enqueue_ctrl_set), \ - SW_API_DEF(SW_API_QM_ENQUEUE_CTRL_GET, fal_qm_enqueue_ctrl_get), \ - SW_API_DEF(SW_API_QM_SOURCE_PROFILE_SET, fal_qm_port_source_profile_set), \ - SW_API_DEF(SW_API_QM_SOURCE_PROFILE_GET, fal_qm_port_source_profile_get), - -#define QM_API_PARAM \ - SW_API_DESC(SW_API_UCAST_QUEUE_BASE_PROFILE_SET) \ - SW_API_DESC(SW_API_UCAST_QUEUE_BASE_PROFILE_GET) \ - SW_API_DESC(SW_API_UCAST_PRIORITY_CLASS_SET) \ - SW_API_DESC(SW_API_UCAST_PRIORITY_CLASS_GET) \ - SW_API_DESC(SW_API_MCAST_PRIORITY_CLASS_SET) \ - SW_API_DESC(SW_API_MCAST_PRIORITY_CLASS_GET) \ - SW_API_DESC(SW_API_QUEUE_FLUSH) \ - SW_API_DESC(SW_API_UCAST_HASH_MAP_SET) \ - SW_API_DESC(SW_API_UCAST_HASH_MAP_GET) \ - SW_API_DESC(SW_API_UCAST_DFLT_HASH_MAP_SET) \ - SW_API_DESC(SW_API_UCAST_DFLT_HASH_MAP_GET) \ - SW_API_DESC(SW_API_MCAST_CPUCODE_CLASS_SET) \ - SW_API_DESC(SW_API_MCAST_CPUCODE_CLASS_GET) \ - SW_API_DESC(SW_API_AC_CTRL_SET) \ - SW_API_DESC(SW_API_AC_CTRL_GET) \ - SW_API_DESC(SW_API_AC_PRE_BUFFER_SET) \ - SW_API_DESC(SW_API_AC_PRE_BUFFER_GET) \ - SW_API_DESC(SW_API_QUEUE_GROUP_SET) \ - SW_API_DESC(SW_API_QUEUE_GROUP_GET) \ - SW_API_DESC(SW_API_STATIC_THRESH_SET) \ - SW_API_DESC(SW_API_STATIC_THRESH_GET) \ - SW_API_DESC(SW_API_DYNAMIC_THRESH_SET) \ - SW_API_DESC(SW_API_DYNAMIC_THRESH_GET) \ - SW_API_DESC(SW_API_GOURP_BUFFER_SET) \ - SW_API_DESC(SW_API_GOURP_BUFFER_GET) \ - SW_API_DESC(SW_API_QUEUE_CNT_CTRL_GET) \ - SW_API_DESC(SW_API_QUEUE_CNT_CTRL_SET) \ - SW_API_DESC(SW_API_QUEUE_CNT_GET) \ - SW_API_DESC(SW_API_QUEUE_CNT_CLEANUP) \ - SW_API_DESC(SW_API_QM_ENQUEUE_CTRL_SET) \ - SW_API_DESC(SW_API_QM_ENQUEUE_CTRL_GET) \ - SW_API_DESC(SW_API_QM_SOURCE_PROFILE_SET) \ - SW_API_DESC(SW_API_QM_SOURCE_PROFILE_GET) - -#else -#define QM_API -#define QM_API_PARAM -#endif - - -#ifdef IN_PPPOE -#define PPPOE_API \ - SW_API_DEF(SW_API_PPPOE_CMD_SET, fal_pppoe_cmd_set), \ - SW_API_DEF(SW_API_PPPOE_CMD_GET, fal_pppoe_cmd_get), \ - SW_API_DEF(SW_API_PPPOE_STATUS_SET, fal_pppoe_status_set), \ - SW_API_DEF(SW_API_PPPOE_STATUS_GET, fal_pppoe_status_get), \ - SW_API_DEF(SW_API_PPPOE_SESSION_ADD, fal_pppoe_session_add), \ - SW_API_DEF(SW_API_PPPOE_SESSION_DEL, fal_pppoe_session_del), \ - SW_API_DEF(SW_API_PPPOE_SESSION_GET, fal_pppoe_session_get), \ - SW_API_DEF(SW_API_PPPOE_SESSION_TABLE_ADD, fal_pppoe_session_table_add), \ - SW_API_DEF(SW_API_PPPOE_SESSION_TABLE_DEL, fal_pppoe_session_table_del), \ - SW_API_DEF(SW_API_PPPOE_SESSION_TABLE_GET, fal_pppoe_session_table_get), \ - SW_API_DEF(SW_API_PPPOE_SESSION_ID_SET, fal_pppoe_session_id_set), \ - SW_API_DEF(SW_API_PPPOE_SESSION_ID_GET, fal_pppoe_session_id_get), \ - SW_API_DEF(SW_API_RTD_PPPOE_EN_SET, fal_rtd_pppoe_en_set), \ - SW_API_DEF(SW_API_RTD_PPPOE_EN_GET, fal_rtd_pppoe_en_get), \ - SW_API_DEF(SW_API_PPPOE_EN_SET, fal_pppoe_l3intf_enable), \ - SW_API_DEF(SW_API_PPPOE_EN_GET, fal_pppoe_l3intf_status_get), - -#define PPPOE_API_PARAM \ - SW_API_DESC(SW_API_PPPOE_CMD_SET) \ - SW_API_DESC(SW_API_PPPOE_CMD_GET) \ - SW_API_DESC(SW_API_PPPOE_STATUS_SET) \ - SW_API_DESC(SW_API_PPPOE_STATUS_GET) \ - SW_API_DESC(SW_API_PPPOE_SESSION_ADD) \ - SW_API_DESC(SW_API_PPPOE_SESSION_DEL) \ - SW_API_DESC(SW_API_PPPOE_SESSION_GET) \ - SW_API_DESC(SW_API_PPPOE_SESSION_TABLE_ADD) \ - SW_API_DESC(SW_API_PPPOE_SESSION_TABLE_DEL) \ - SW_API_DESC(SW_API_PPPOE_SESSION_TABLE_GET) \ - SW_API_DESC(SW_API_PPPOE_SESSION_ID_SET) \ - SW_API_DESC(SW_API_PPPOE_SESSION_ID_GET) \ - SW_API_DESC(SW_API_RTD_PPPOE_EN_SET) \ - SW_API_DESC(SW_API_RTD_PPPOE_EN_GET) \ - SW_API_DESC(SW_API_PPPOE_EN_SET) \ - SW_API_DESC(SW_API_PPPOE_EN_GET) - -#else -#define PPPOE_API -#define PPPOE_API_PARAM -#endif - -#ifdef IN_BM -#define BM_API \ - SW_API_DEF(SW_API_BM_CTRL_SET, fal_port_bm_ctrl_set), \ - SW_API_DEF(SW_API_BM_CTRL_GET, fal_port_bm_ctrl_get), \ - SW_API_DEF(SW_API_BM_PORTGROUP_MAP_SET, fal_port_bufgroup_map_set), \ - SW_API_DEF(SW_API_BM_PORTGROUP_MAP_GET, fal_port_bufgroup_map_get), \ - SW_API_DEF(SW_API_BM_GROUP_BUFFER_SET, fal_bm_bufgroup_buffer_set), \ - SW_API_DEF(SW_API_BM_GROUP_BUFFER_GET, fal_bm_bufgroup_buffer_get), \ - SW_API_DEF(SW_API_BM_PORT_RSVBUFFER_SET, fal_bm_port_reserved_buffer_set), \ - SW_API_DEF(SW_API_BM_PORT_RSVBUFFER_GET, fal_bm_port_reserved_buffer_get), \ - SW_API_DEF(SW_API_BM_STATIC_THRESH_SET, fal_bm_port_static_thresh_set), \ - SW_API_DEF(SW_API_BM_STATIC_THRESH_GET, fal_bm_port_static_thresh_get), \ - SW_API_DEF(SW_API_BM_DYNAMIC_THRESH_SET, fal_bm_port_dynamic_thresh_set), \ - SW_API_DEF(SW_API_BM_DYNAMIC_THRESH_GET, fal_bm_port_dynamic_thresh_get), \ - SW_API_DEF(SW_API_BM_PORT_COUNTER_GET, fal_bm_port_counter_get), - -#define BM_API_PARAM \ - SW_API_DESC(SW_API_BM_CTRL_SET) \ - SW_API_DESC(SW_API_BM_CTRL_GET) \ - SW_API_DESC(SW_API_BM_PORTGROUP_MAP_SET) \ - SW_API_DESC(SW_API_BM_PORTGROUP_MAP_GET) \ - SW_API_DESC(SW_API_BM_GROUP_BUFFER_SET) \ - SW_API_DESC(SW_API_BM_GROUP_BUFFER_GET) \ - SW_API_DESC(SW_API_BM_PORT_RSVBUFFER_SET) \ - SW_API_DESC(SW_API_BM_PORT_RSVBUFFER_GET) \ - SW_API_DESC(SW_API_BM_STATIC_THRESH_SET) \ - SW_API_DESC(SW_API_BM_STATIC_THRESH_GET) \ - SW_API_DESC(SW_API_BM_DYNAMIC_THRESH_SET) \ - SW_API_DESC(SW_API_BM_DYNAMIC_THRESH_GET) \ - SW_API_DESC(SW_API_BM_PORT_COUNTER_GET) - -#else -#define BM_API -#define BM_API_PARAM -#endif - -/*qca808x_start*/ -#define REG_API \ - SW_API_DEF(SW_API_PHY_GET, fal_phy_get), \ - SW_API_DEF(SW_API_PHY_SET, fal_phy_set), \ -/*qca808x_end*/\ - SW_API_DEF(SW_API_REG_GET, fal_reg_get), \ - SW_API_DEF(SW_API_REG_SET, fal_reg_set), \ - SW_API_DEF(SW_API_PSGMII_REG_GET, fal_psgmii_reg_get), \ - SW_API_DEF(SW_API_PSGMII_REG_SET, fal_psgmii_reg_set), \ - SW_API_DEF(SW_API_REG_FIELD_GET, fal_reg_field_get), \ - SW_API_DEF(SW_API_REG_FIELD_SET, fal_reg_field_set), \ - SW_API_DEF(SW_API_REG_DUMP, fal_reg_dump), \ - SW_API_DEF(SW_API_DBG_REG_DUMP, fal_dbg_reg_dump),\ - SW_API_DEF(SW_API_DBG_PSGMII_SELF_TEST, fal_debug_psgmii_self_test), \ - SW_API_DEF(SW_API_PHY_DUMP, fal_phy_dump), \ - SW_API_DEF(SW_API_UNIPHY_REG_GET, fal_uniphy_reg_get), \ - SW_API_DEF(SW_API_UNIPHY_REG_SET, fal_uniphy_reg_set),\ -/*qca808x_start*/\ - /*end of REG_API*/ -#define REG_API_PARAM \ - SW_API_DESC(SW_API_PHY_GET) \ - SW_API_DESC(SW_API_PHY_SET)\ -/*qca808x_end*/\ - SW_API_DESC(SW_API_REG_GET) \ - SW_API_DESC(SW_API_REG_SET) \ - SW_API_DESC(SW_API_PSGMII_REG_GET) \ - SW_API_DESC(SW_API_PSGMII_REG_SET) \ - SW_API_DESC(SW_API_REG_FIELD_GET) \ - SW_API_DESC(SW_API_REG_FIELD_SET) \ - SW_API_DESC(SW_API_REG_DUMP) \ - SW_API_DESC(SW_API_DBG_REG_DUMP) \ - SW_API_DESC(SW_API_DBG_PSGMII_SELF_TEST) \ - SW_API_DESC(SW_API_PHY_DUMP) \ - SW_API_DESC(SW_API_UNIPHY_REG_GET) \ - SW_API_DESC(SW_API_UNIPHY_REG_SET)\ -/*qca808x_start*/\ -/*end of REG_API_PARAM*/ -/*qca808x_end*/ -#ifdef IN_CTRLPKT -#define CTRLPKT_API \ - SW_API_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET, fal_mgmtctrl_ethtype_profile_set), \ - SW_API_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_GET, fal_mgmtctrl_ethtype_profile_get), \ - SW_API_DEF(SW_API_MGMTCTRL_RFDB_PROFILE_SET, fal_mgmtctrl_rfdb_profile_set), \ - SW_API_DEF(SW_API_MGMTCTRL_RFDB_PROFILE_GET, fal_mgmtctrl_rfdb_profile_get), \ - SW_API_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_ADD, fal_mgmtctrl_ctrlpkt_profile_add), \ - SW_API_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_DEL, fal_mgmtctrl_ctrlpkt_profile_del), \ - SW_API_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETFIRST, fal_mgmtctrl_ctrlpkt_profile_getfirst), \ - SW_API_DEF(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETNEXT, fal_mgmtctrl_ctrlpkt_profile_getnext), - -#define CTRLPKT_API_PARAM \ - SW_API_DESC(SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET) \ - SW_API_DESC(SW_API_MGMTCTRL_ETHTYPE_PROFILE_GET) \ - SW_API_DESC(SW_API_MGMTCTRL_RFDB_PROFILE_SET) \ - SW_API_DESC(SW_API_MGMTCTRL_RFDB_PROFILE_GET) \ - SW_API_DESC(SW_API_MGMTCTRL_CTRLPKT_PROFILE_ADD) \ - SW_API_DESC(SW_API_MGMTCTRL_CTRLPKT_PROFILE_DEL) \ - SW_API_DESC(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETFIRST) \ - SW_API_DESC(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETNEXT) -#else -#define CTRLPKT_API -#define CTRLPKT_API_PARAM -#endif - -#ifdef IN_SERVCODE -#define SERVCODE_API \ - SW_API_DEF(SW_API_SERVCODE_CONFIG_SET, fal_servcode_config_set), \ - SW_API_DEF(SW_API_SERVCODE_CONFIG_GET, fal_servcode_config_get), \ - SW_API_DEF(SW_API_SERVCODE_LOOPCHECK_EN, fal_servcode_loopcheck_en), \ - SW_API_DEF(SW_API_SERVCODE_LOOPCHECK_STATUS_GET, fal_servcode_loopcheck_status_get), - -#define SERVCODE_API_PARAM \ - SW_API_DESC(SW_API_SERVCODE_CONFIG_SET) \ - SW_API_DESC(SW_API_SERVCODE_CONFIG_GET) \ - SW_API_DESC(SW_API_SERVCODE_LOOPCHECK_EN) \ - SW_API_DESC(SW_API_SERVCODE_LOOPCHECK_STATUS_GET) -#else -#define SERVCODE_API -#define SERVCODE_API_PARAM -#endif - -#ifdef IN_RSS_HASH -#define RSS_HASH_API \ - SW_API_DEF(SW_API_RSS_HASH_CONFIG_SET, fal_rss_hash_config_set), \ - SW_API_DEF(SW_API_RSS_HASH_CONFIG_GET, fal_rss_hash_config_get), - -#define RSS_HASH_API_PARAM \ - SW_API_DESC(SW_API_RSS_HASH_CONFIG_SET) \ - SW_API_DESC(SW_API_RSS_HASH_CONFIG_GET) -#else -#define RSS_HASH_API -#define RSS_HASH_API_PARAM -#endif - -#ifdef IN_SHAPER -#define SHAPER_API \ - SW_API_DEF(SW_API_PORT_SHAPER_TIMESLOT_SET, fal_port_shaper_timeslot_set), \ - SW_API_DEF(SW_API_PORT_SHAPER_TIMESLOT_GET, fal_port_shaper_timeslot_get), \ - SW_API_DEF(SW_API_FLOW_SHAPER_TIMESLOT_SET, fal_flow_shaper_timeslot_set), \ - SW_API_DEF(SW_API_FLOW_SHAPER_TIMESLOT_GET, fal_flow_shaper_timeslot_get), \ - SW_API_DEF(SW_API_QUEUE_SHAPER_TIMESLOT_SET, fal_queue_shaper_timeslot_set), \ - SW_API_DEF(SW_API_QUEUE_SHAPER_TIMESLOT_GET, fal_queue_shaper_timeslot_get), \ - SW_API_DEF(SW_API_PORT_SHAPER_TOKEN_NUMBER_SET, fal_port_shaper_token_number_set), \ - SW_API_DEF(SW_API_PORT_SHAPER_TOKEN_NUMBER_GET, fal_port_shaper_token_number_get), \ - SW_API_DEF(SW_API_FLOW_SHAPER_TOKEN_NUMBER_SET, fal_flow_shaper_token_number_set), \ - SW_API_DEF(SW_API_FLOW_SHAPER_TOKEN_NUMBER_GET, fal_flow_shaper_token_number_get), \ - SW_API_DEF(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_SET, fal_queue_shaper_token_number_set), \ - SW_API_DEF(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_GET, fal_queue_shaper_token_number_get), \ - SW_API_DEF(SW_API_PORT_SHAPER_SET, fal_port_shaper_set), \ - SW_API_DEF(SW_API_PORT_SHAPER_GET,fal_port_shaper_get), \ - SW_API_DEF(SW_API_FLOW_SHAPER_SET, fal_flow_shaper_set), \ - SW_API_DEF(SW_API_FLOW_SHAPER_GET,fal_flow_shaper_get), \ - SW_API_DEF(SW_API_QUEUE_SHAPER_SET, fal_queue_shaper_set), \ - SW_API_DEF(SW_API_QUEUE_SHAPER_GET,fal_queue_shaper_get), \ - SW_API_DEF(SW_API_SHAPER_IPG_PRE_SET, fal_shaper_ipg_preamble_length_set), \ - SW_API_DEF(SW_API_SHAPER_IPG_PRE_GET,fal_shaper_ipg_preamble_length_get), - - -#define SHAPER_API_PARAM \ - SW_API_DESC(SW_API_PORT_SHAPER_TIMESLOT_SET) \ - SW_API_DESC(SW_API_PORT_SHAPER_TIMESLOT_GET) \ - SW_API_DESC(SW_API_FLOW_SHAPER_TIMESLOT_SET) \ - SW_API_DESC(SW_API_FLOW_SHAPER_TIMESLOT_GET) \ - SW_API_DESC(SW_API_QUEUE_SHAPER_TIMESLOT_SET) \ - SW_API_DESC(SW_API_QUEUE_SHAPER_TIMESLOT_GET) \ - SW_API_DESC(SW_API_PORT_SHAPER_TOKEN_NUMBER_SET) \ - SW_API_DESC(SW_API_PORT_SHAPER_TOKEN_NUMBER_GET) \ - SW_API_DESC(SW_API_FLOW_SHAPER_TOKEN_NUMBER_SET) \ - SW_API_DESC(SW_API_FLOW_SHAPER_TOKEN_NUMBER_GET) \ - SW_API_DESC(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_SET) \ - SW_API_DESC(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_GET) \ - SW_API_DESC(SW_API_PORT_SHAPER_SET) \ - SW_API_DESC(SW_API_PORT_SHAPER_GET) \ - SW_API_DESC(SW_API_FLOW_SHAPER_SET) \ - SW_API_DESC(SW_API_FLOW_SHAPER_GET) \ - SW_API_DESC(SW_API_QUEUE_SHAPER_SET) \ - SW_API_DESC(SW_API_QUEUE_SHAPER_GET) \ - SW_API_DESC(SW_API_SHAPER_IPG_PRE_SET) \ - SW_API_DESC(SW_API_SHAPER_IPG_PRE_GET) - -#else -#define SHAPER_API -#define SHAPER_API_PARAM -#endif - - -#ifdef IN_POLICER -#define POLICER_API \ - SW_API_DEF(SW_API_POLICER_TIMESLOT_SET, fal_policer_timeslot_set), \ - SW_API_DEF(SW_API_POLICER_TIMESLOT_GET, fal_policer_timeslot_get), \ - SW_API_DEF(SW_API_POLICER_PORT_COUNTER_GET, fal_port_policer_counter_get), \ - SW_API_DEF(SW_API_POLICER_ACL_COUNTER_GET, fal_acl_policer_counter_get), \ - SW_API_DEF(SW_API_POLICER_COMPENSATION_SET, fal_port_policer_compensation_byte_set), \ - SW_API_DEF(SW_API_POLICER_COMPENSATION_GET, fal_port_policer_compensation_byte_get), \ - SW_API_DEF(SW_API_POLICER_PORT_ENTRY_SET, fal_port_policer_entry_set), \ - SW_API_DEF(SW_API_POLICER_PORT_ENTRY_GET, fal_port_policer_entry_get), \ - SW_API_DEF(SW_API_POLICER_ACL_ENTRY_SET, fal_acl_policer_entry_set), \ - SW_API_DEF(SW_API_POLICER_ACL_ENTRY_GET,fal_acl_policer_entry_get), \ - SW_API_DEF(SW_API_POLICER_GLOBAL_COUNTER_GET, fal_policer_global_counter_get), - -#define POLICER_API_PARAM \ - SW_API_DESC(SW_API_POLICER_TIMESLOT_SET) \ - SW_API_DESC(SW_API_POLICER_TIMESLOT_GET) \ - SW_API_DESC(SW_API_POLICER_PORT_COUNTER_GET) \ - SW_API_DESC(SW_API_POLICER_ACL_COUNTER_GET) \ - SW_API_DESC(SW_API_POLICER_COMPENSATION_SET) \ - SW_API_DESC(SW_API_POLICER_COMPENSATION_GET) \ - SW_API_DESC(SW_API_POLICER_PORT_ENTRY_SET) \ - SW_API_DESC(SW_API_POLICER_PORT_ENTRY_GET) \ - SW_API_DESC(SW_API_POLICER_ACL_ENTRY_SET) \ - SW_API_DESC(SW_API_POLICER_ACL_ENTRY_GET) \ - SW_API_DESC(SW_API_POLICER_GLOBAL_COUNTER_GET) - -#else -#define POLICER_API -#define POLICER_API_PARAM -#endif - -#ifdef IN_PTP -#define PTP_API \ - SW_API_DEF(SW_API_PTP_CONFIG_SET, fal_ptp_config_set), \ - SW_API_DEF(SW_API_PTP_CONFIG_GET, fal_ptp_config_get), \ - SW_API_DEF(SW_API_PTP_REFERENCE_CLOCK_SET, fal_ptp_reference_clock_set), \ - SW_API_DEF(SW_API_PTP_REFERENCE_CLOCK_GET, fal_ptp_reference_clock_get), \ - SW_API_DEF(SW_API_PTP_RX_TIMESTAMP_MODE_SET, fal_ptp_rx_timestamp_mode_set), \ - SW_API_DEF(SW_API_PTP_RX_TIMESTAMP_MODE_GET, fal_ptp_rx_timestamp_mode_get), \ - SW_API_DEF(SW_API_PTP_TIMESTAMP_GET, fal_ptp_timestamp_get), \ - SW_API_DEF(SW_API_PTP_PKT_TIMESTAMP_SET, fal_ptp_pkt_timestamp_set), \ - SW_API_DEF(SW_API_PTP_PKT_TIMESTAMP_GET, fal_ptp_pkt_timestamp_get), \ - SW_API_DEF(SW_API_PTP_GRANDMASTER_MODE_SET, fal_ptp_grandmaster_mode_set), \ - SW_API_DEF(SW_API_PTP_GRANDMASTER_MODE_GET, fal_ptp_grandmaster_mode_get), \ - SW_API_DEF(SW_API_PTP_RTC_TIME_SET, fal_ptp_rtc_time_set), \ - SW_API_DEF(SW_API_PTP_RTC_TIME_GET, fal_ptp_rtc_time_get), \ - SW_API_DEF(SW_API_PTP_RTC_TIME_CLEAR, fal_ptp_rtc_time_clear), \ - SW_API_DEF(SW_API_PTP_RTC_ADJTIME_SET, fal_ptp_rtc_adjtime_set), \ - SW_API_DEF(SW_API_PTP_RTC_ADJFREQ_SET, fal_ptp_rtc_adjfreq_set), \ - SW_API_DEF(SW_API_PTP_RTC_ADJFREQ_GET, fal_ptp_rtc_adjfreq_get), \ - SW_API_DEF(SW_API_PTP_LINK_DELAY_SET, fal_ptp_link_delay_set), \ - SW_API_DEF(SW_API_PTP_LINK_DELAY_GET, fal_ptp_link_delay_get), \ - SW_API_DEF(SW_API_PTP_SECURITY_SET, fal_ptp_security_set), \ - SW_API_DEF(SW_API_PTP_SECURITY_GET, fal_ptp_security_get), \ - SW_API_DEF(SW_API_PTP_PPS_SIGNAL_CONTROL_SET, fal_ptp_pps_signal_control_set), \ - SW_API_DEF(SW_API_PTP_PPS_SIGNAL_CONTROL_GET, fal_ptp_pps_signal_control_get), \ - SW_API_DEF(SW_API_PTP_RX_CRC_RECALC_SET, fal_ptp_rx_crc_recalc_enable), \ - SW_API_DEF(SW_API_PTP_RX_CRC_RECALC_GET, fal_ptp_rx_crc_recalc_status_get), \ - SW_API_DEF(SW_API_PTP_ASYM_CORRECTION_SET, fal_ptp_asym_correction_set), \ - SW_API_DEF(SW_API_PTP_ASYM_CORRECTION_GET, fal_ptp_asym_correction_get), \ - SW_API_DEF(SW_API_PTP_OUTPUT_WAVEFORM_SET, fal_ptp_output_waveform_set), \ - SW_API_DEF(SW_API_PTP_OUTPUT_WAVEFORM_GET, fal_ptp_output_waveform_get), \ - SW_API_DEF(SW_API_PTP_RTC_TIME_SNAPSHOT_SET, fal_ptp_rtc_time_snapshot_enable), \ - SW_API_DEF(SW_API_PTP_RTC_TIME_SNAPSHOT_GET, fal_ptp_rtc_time_snapshot_status_get), \ - SW_API_DEF(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_SET, \ - fal_ptp_increment_sync_from_clock_enable), \ - SW_API_DEF(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_GET, \ - fal_ptp_increment_sync_from_clock_status_get), \ - SW_API_DEF(SW_API_PTP_TOD_UART_SET, fal_ptp_tod_uart_set), \ - SW_API_DEF(SW_API_PTP_TOD_UART_GET, fal_ptp_tod_uart_get), \ - SW_API_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET, fal_ptp_enhanced_timestamp_engine_set), \ - SW_API_DEF(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET, fal_ptp_enhanced_timestamp_engine_get), \ - SW_API_DEF(SW_API_PTP_TRIGGER_SET, fal_ptp_trigger_set), \ - SW_API_DEF(SW_API_PTP_TRIGGER_GET, fal_ptp_trigger_get), \ - SW_API_DEF(SW_API_PTP_CAPTURE_SET, fal_ptp_capture_set), \ - SW_API_DEF(SW_API_PTP_CAPTURE_GET, fal_ptp_capture_get), \ - SW_API_DEF(SW_API_PTP_INTERRUPT_SET, fal_ptp_interrupt_set), \ - SW_API_DEF(SW_API_PTP_INTERRUPT_GET, fal_ptp_interrupt_get), - -#define PTP_API_PARAM \ - SW_API_DESC(SW_API_PTP_CONFIG_SET) \ - SW_API_DESC(SW_API_PTP_CONFIG_GET) \ - SW_API_DESC(SW_API_PTP_REFERENCE_CLOCK_SET) \ - SW_API_DESC(SW_API_PTP_REFERENCE_CLOCK_GET) \ - SW_API_DESC(SW_API_PTP_RX_TIMESTAMP_MODE_SET) \ - SW_API_DESC(SW_API_PTP_RX_TIMESTAMP_MODE_GET) \ - SW_API_DESC(SW_API_PTP_TIMESTAMP_GET) \ - SW_API_DESC(SW_API_PTP_PKT_TIMESTAMP_SET) \ - SW_API_DESC(SW_API_PTP_PKT_TIMESTAMP_GET) \ - SW_API_DESC(SW_API_PTP_GRANDMASTER_MODE_SET) \ - SW_API_DESC(SW_API_PTP_GRANDMASTER_MODE_GET) \ - SW_API_DESC(SW_API_PTP_RTC_TIME_SET) \ - SW_API_DESC(SW_API_PTP_RTC_TIME_GET) \ - SW_API_DESC(SW_API_PTP_RTC_TIME_CLEAR) \ - SW_API_DESC(SW_API_PTP_RTC_ADJTIME_SET) \ - SW_API_DESC(SW_API_PTP_RTC_ADJFREQ_SET) \ - SW_API_DESC(SW_API_PTP_RTC_ADJFREQ_GET) \ - SW_API_DESC(SW_API_PTP_LINK_DELAY_SET) \ - SW_API_DESC(SW_API_PTP_LINK_DELAY_GET) \ - SW_API_DESC(SW_API_PTP_SECURITY_SET) \ - SW_API_DESC(SW_API_PTP_SECURITY_GET) \ - SW_API_DESC(SW_API_PTP_PPS_SIGNAL_CONTROL_SET) \ - SW_API_DESC(SW_API_PTP_PPS_SIGNAL_CONTROL_GET) \ - SW_API_DESC(SW_API_PTP_RX_CRC_RECALC_SET) \ - SW_API_DESC(SW_API_PTP_RX_CRC_RECALC_GET) \ - SW_API_DESC(SW_API_PTP_ASYM_CORRECTION_SET) \ - SW_API_DESC(SW_API_PTP_ASYM_CORRECTION_GET) \ - SW_API_DESC(SW_API_PTP_OUTPUT_WAVEFORM_SET) \ - SW_API_DESC(SW_API_PTP_OUTPUT_WAVEFORM_GET) \ - SW_API_DESC(SW_API_PTP_RTC_TIME_SNAPSHOT_SET) \ - SW_API_DESC(SW_API_PTP_RTC_TIME_SNAPSHOT_GET) \ - SW_API_DESC(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_SET) \ - SW_API_DESC(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_GET) \ - SW_API_DESC(SW_API_PTP_TOD_UART_SET) \ - SW_API_DESC(SW_API_PTP_TOD_UART_GET) \ - SW_API_DESC(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET) \ - SW_API_DESC(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET) \ - SW_API_DESC(SW_API_PTP_TRIGGER_SET) \ - SW_API_DESC(SW_API_PTP_TRIGGER_GET) \ - SW_API_DESC(SW_API_PTP_CAPTURE_SET) \ - SW_API_DESC(SW_API_PTP_CAPTURE_GET) \ - SW_API_DESC(SW_API_PTP_INTERRUPT_SET) \ - SW_API_DESC(SW_API_PTP_INTERRUPT_GET) -#else -#define PTP_API -#define PTP_API_PARAM -#endif - -#ifdef IN_SFP -#define SFP_API \ - SW_API_DEF(SW_API_SFP_DATA_GET, fal_sfp_eeprom_data_get), \ - SW_API_DEF(SW_API_SFP_DATA_SET, fal_sfp_eeprom_data_set), \ - SW_API_DEF(SW_API_SFP_DEV_TYPE_GET, fal_sfp_device_type_get), \ - SW_API_DEF(SW_API_SFP_TRANSC_CODE_GET, fal_sfp_transceiver_code_get), \ - SW_API_DEF(SW_API_SFP_RATE_ENCODE_GET, fal_sfp_rate_encode_get), \ - SW_API_DEF(SW_API_SFP_LINK_LENGTH_GET, fal_sfp_link_length_get), \ - SW_API_DEF(SW_API_SFP_VENDOR_INFO_GET, fal_sfp_vendor_info_get), \ - SW_API_DEF(SW_API_SFP_LASER_WAVELENGTH_GET, fal_sfp_laser_wavelength_get), \ - SW_API_DEF(SW_API_SFP_OPTION_GET, fal_sfp_option_get), \ - SW_API_DEF(SW_API_SFP_CTRL_RATE_GET, fal_sfp_ctrl_rate_get), \ - SW_API_DEF(SW_API_SFP_ENHANCED_CFG_GET, fal_sfp_enhanced_cfg_get), \ - SW_API_DEF(SW_API_SFP_DIAG_THRESHOLD_GET, fal_sfp_diag_internal_threshold_get), \ - SW_API_DEF(SW_API_SFP_DIAG_CAL_CONST_GET, fal_sfp_diag_extenal_calibration_const_get), \ - SW_API_DEF(SW_API_SFP_DIAG_REALTIME_GET, fal_sfp_diag_realtime_get), \ - SW_API_DEF(SW_API_SFP_DIAG_CTRL_STATUS_GET, fal_sfp_diag_ctrl_status_get), \ - SW_API_DEF(SW_API_SFP_DIAG_ALARM_WARN_FLAG_GET, fal_sfp_diag_alarm_warning_flag_get), \ - SW_API_DEF(SW_API_SFP_CHECKCODE_GET, fal_sfp_checkcode_get), - -#define SFP_API_PARAM \ - SW_API_DESC(SW_API_SFP_DATA_GET) \ - SW_API_DESC(SW_API_SFP_DATA_SET) \ - SW_API_DESC(SW_API_SFP_DEV_TYPE_GET) \ - SW_API_DESC(SW_API_SFP_TRANSC_CODE_GET) \ - SW_API_DESC(SW_API_SFP_RATE_ENCODE_GET) \ - SW_API_DESC(SW_API_SFP_LINK_LENGTH_GET) \ - SW_API_DESC(SW_API_SFP_VENDOR_INFO_GET) \ - SW_API_DESC(SW_API_SFP_LASER_WAVELENGTH_GET) \ - SW_API_DESC(SW_API_SFP_OPTION_GET) \ - SW_API_DESC(SW_API_SFP_CTRL_RATE_GET) \ - SW_API_DESC(SW_API_SFP_ENHANCED_CFG_GET) \ - SW_API_DESC(SW_API_SFP_DIAG_THRESHOLD_GET) \ - SW_API_DESC(SW_API_SFP_DIAG_CAL_CONST_GET) \ - SW_API_DESC(SW_API_SFP_DIAG_REALTIME_GET) \ - SW_API_DESC(SW_API_SFP_DIAG_CTRL_STATUS_GET) \ - SW_API_DESC(SW_API_SFP_DIAG_ALARM_WARN_FLAG_GET) \ - SW_API_DESC(SW_API_SFP_CHECKCODE_GET) -#else -#define SFP_API -#define SFP_API_PARAM -#endif - -/*qca808x_start*/ -#define SSDK_API \ -/*qca808x_end*/\ - SW_API_DEF(SW_API_SWITCH_RESET, fal_reset), \ - SW_API_DEF(SW_API_SSDK_CFG, fal_ssdk_cfg), \ - SW_API_DEF(SW_API_MODULE_FUNC_CTRL_SET, fal_module_func_ctrl_set), \ - SW_API_DEF(SW_API_MODULE_FUNC_CTRL_GET, fal_module_func_ctrl_get), \ - /*qca808x_start*/\ - PORTCONTROL_API \ -/*qca808x_end*/\ - VLAN_API \ - PORTVLAN_API \ - FDB_API \ - ACL_API \ - QOS_API \ - IGMP_API \ - LEAKY_API \ - MIRROR_API \ - RATE_API \ - STP_API \ - MIB_API \ - MISC_API \ - LED_API \ - COSMAP_API \ - SEC_API \ - IP_API \ - NAT_API \ - FLOW_API \ - TRUNK_API \ - INTERFACECTRL_API \ - VSI_API \ - QM_API \ - BM_API \ - PPPOE_API \ -/*qca808x_start*/\ - REG_API \ -/*qca808x_end*/\ - CTRLPKT_API \ - SERVCODE_API \ - RSS_HASH_API \ - POLICER_API \ - SHAPER_API \ - PTP_API \ - SFP_API \ -/*qca808x_start*/\ - SW_API_DEF(SW_API_MAX, NULL), - - -#define SSDK_PARAM \ -/*qca808x_end*/\ - SW_PARAM_DEF(SW_API_SWITCH_RESET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SSDK_CFG, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_SSDK_CFG, SW_SSDK_CFG, sizeof(ssdk_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "ssdk configuration"), \ - SW_PARAM_DEF(SW_API_MODULE_FUNC_CTRL_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MODULE_FUNC_CTRL_SET, SW_MODULE, 4, SW_PARAM_IN, "Module"), \ - SW_PARAM_DEF(SW_API_MODULE_FUNC_CTRL_SET, SW_FUNC_CTRL, sizeof(fal_func_ctrl_t), SW_PARAM_PTR|SW_PARAM_IN, "Function bitmap"), \ - SW_PARAM_DEF(SW_API_MODULE_FUNC_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \ - SW_PARAM_DEF(SW_API_MODULE_FUNC_CTRL_GET, SW_MODULE, 4, SW_PARAM_IN, "Module"), \ - SW_PARAM_DEF(SW_API_MODULE_FUNC_CTRL_GET, SW_FUNC_CTRL, sizeof(fal_func_ctrl_t), SW_PARAM_PTR|SW_PARAM_OUT, "Function bitmap"), \ - MIB_API_PARAM \ - LEAKY_API_PARAM \ - MISC_API_PARAM \ - IGMP_API_PARAM \ - MIRROR_API_PARAM \ -/*qca808x_start*/\ - PORTCONTROL_API_PARAM \ -/*qca808x_end*/\ - PORTVLAN_API_PARAM \ - VLAN_API_PARAM \ - FDB_API_PARAM \ - QOS_API_PARAM \ - RATE_API_PARAM \ - STP_API_PARAM \ - ACL_API_PARAM \ - LED_API_PARAM \ - COSMAP_API_PARAM \ - SEC_API_PARAM \ - IP_API_PARAM \ - NAT_API_PARAM \ - FLOW_API_PARAM \ - TRUNK_API_PARAM \ - INTERFACECTRL_API_PARAM \ - VSI_API_PARAM \ - QM_API_PARAM \ - BM_API_PARAM \ - PPPOE_API_PARAM \ -/*qca808x_start*/\ - REG_API_PARAM \ -/*qca808x_end*/\ - CTRLPKT_API_PARAM \ - SERVCODE_API_PARAM \ - RSS_HASH_API_PARAM \ - POLICER_API_PARAM \ - SHAPER_API_PARAM \ - PTP_API_PARAM \ - SFP_API_PARAM \ -/*qca808x_start*/\ - SW_PARAM_DEF(SW_API_MAX, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* _FAL_API_H_ */ -/*qca808x_end*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_bm.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_bm.h deleted file mode 100755 index b8931053e..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_bm.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_qos FAL_BM - * @{ - */ -#ifndef _FAL_BM_H_ -#define _FAL_BM_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - -typedef struct -{ - a_uint16_t max_thresh; /* Static Maximum threshold */ - a_uint16_t resume_off; /*resume offset */ -} fal_bm_static_cfg_t; - -typedef struct -{ - a_uint8_t weight; /* port weight in the shared group */ - a_uint16_t shared_ceiling; /* Maximum shared buffers */ - a_uint16_t resume_off; /*resume offset */ - a_uint16_t resume_min_thresh; /* Minumum thresh for resume */ -} fal_bm_dynamic_cfg_t; - -enum { - FUNC_PORT_BUFGROUP_MAP_GET = 0, - FUNC_BM_PORT_RESERVED_BUFFER_GET, - FUNC_BM_BUFGROUP_BUFFER_GET, - FUNC_BM_PORT_DYNAMIC_THRESH_GET, - FUNC_PORT_BM_CTRL_GET, - FUNC_BM_BUFGROUP_BUFFER_SET, - FUNC_PORT_BUFGROUP_MAP_SET, - FUNC_BM_PORT_STATIC_THRESH_GET, - FUNC_BM_PORT_RESERVED_BUFFER_SET, - FUNC_BM_PORT_STATIC_THRESH_SET, - FUNC_BM_PORT_DYNAMIC_THRESH_SET, - FUNC_PORT_BM_CTRL_SET, - FUNC_PORT_TDM_CTRL_SET, - FUNC_PORT_TDM_TICK_CFG_SET, - FUNC_BM_PORT_COUNTER_GET, -}; - -typedef struct -{ - a_uint64_t drop_byte_counter; /*drop byte due to overload*/ - a_uint32_t drop_packet_counter; /*drop packet due to overload*/ - a_uint64_t fc_drop_byte_counter; /*drop byte due to fc*/ - a_uint32_t fc_drop_packet_counter; /*drop packet due to fc*/ - a_uint32_t used_counter; /*total used buffer counter for the port*/ - a_uint32_t react_counter; /*react used buffer counter for the port*/ -} fal_bm_port_counter_t; - -sw_error_t -fal_port_bm_ctrl_set(a_uint32_t dev_id, fal_port_t port, a_bool_t enable); - -sw_error_t -fal_port_bm_ctrl_get(a_uint32_t dev_id, fal_port_t port, a_bool_t *enable); - -sw_error_t -fal_port_bufgroup_map_set(a_uint32_t dev_id, fal_port_t port, - a_uint8_t group); - -sw_error_t -fal_port_bufgroup_map_get(a_uint32_t dev_id, fal_port_t port, - a_uint8_t *group); - -sw_error_t -fal_bm_bufgroup_buffer_set(a_uint32_t dev_id, a_uint8_t group, - a_uint16_t buff_num); - -sw_error_t -fal_bm_bufgroup_buffer_get(a_uint32_t dev_id, a_uint8_t group, - a_uint16_t *buff_num); - -sw_error_t -fal_bm_port_reserved_buffer_set(a_uint32_t dev_id, fal_port_t port, - a_uint16_t prealloc_buff, a_uint16_t react_buff); - -sw_error_t -fal_bm_port_reserved_buffer_get(a_uint32_t dev_id, fal_port_t port, - a_uint16_t *prealloc_buff, a_uint16_t *react_buff); - -sw_error_t -fal_bm_port_static_thresh_set(a_uint32_t dev_id, fal_port_t port, - fal_bm_static_cfg_t *cfg); - -sw_error_t -fal_bm_port_static_thresh_get(a_uint32_t dev_id, fal_port_t port, - fal_bm_static_cfg_t *cfg); - -sw_error_t -fal_bm_port_dynamic_thresh_set(a_uint32_t dev_id, fal_port_t port, - fal_bm_dynamic_cfg_t *cfg); - -sw_error_t -fal_bm_port_dynamic_thresh_get(a_uint32_t dev_id, fal_port_t port, - fal_bm_dynamic_cfg_t *cfg); - -sw_error_t -fal_bm_port_counter_get(a_uint32_t dev_id, fal_port_t port, - fal_bm_port_counter_t *counter); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _PORT_BM_H_ */ -/** - * @} - */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_cosmap.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_cosmap.h deleted file mode 100755 index c8a9eff09..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_cosmap.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_cosmap FAL_COSMAP - * @{ - */ -#ifndef _FAL_COSMAP_H_ -#define _FAL_COSMAP_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - typedef struct - { - a_bool_t remark_dscp; - a_bool_t remark_up; - a_bool_t remark_dei; - a_uint8_t g_dscp; - a_uint8_t y_dscp; - a_uint8_t g_up; - a_uint8_t y_up; - a_uint8_t g_dei; - a_uint8_t y_dei; - } fal_egress_remark_table_t; - - sw_error_t - fal_cosmap_dscp_to_pri_set(a_uint32_t dev_id, a_uint32_t dscp, - a_uint32_t pri); - - sw_error_t - fal_cosmap_dscp_to_pri_get(a_uint32_t dev_id, a_uint32_t dscp, - a_uint32_t * pri); - - sw_error_t - fal_cosmap_dscp_to_dp_set(a_uint32_t dev_id, a_uint32_t dscp, - a_uint32_t dp); - - sw_error_t - fal_cosmap_dscp_to_dp_get(a_uint32_t dev_id, a_uint32_t dscp, - a_uint32_t * dp); - - sw_error_t - fal_cosmap_up_to_pri_set(a_uint32_t dev_id, a_uint32_t up, - a_uint32_t pri); - - sw_error_t - fal_cosmap_up_to_pri_get(a_uint32_t dev_id, a_uint32_t up, - a_uint32_t * pri); - - sw_error_t - fal_cosmap_up_to_dp_set(a_uint32_t dev_id, a_uint32_t up, - a_uint32_t dp); - - sw_error_t - fal_cosmap_up_to_dp_get(a_uint32_t dev_id, a_uint32_t up, - a_uint32_t * dp); - - sw_error_t - fal_cosmap_dscp_to_ehpri_set(a_uint32_t dev_id, a_uint32_t dscp, - a_uint32_t pri); - - sw_error_t - fal_cosmap_dscp_to_ehpri_get(a_uint32_t dev_id, a_uint32_t dscp, - a_uint32_t * pri); - - sw_error_t - fal_cosmap_dscp_to_ehdp_set(a_uint32_t dev_id, a_uint32_t dscp, - a_uint32_t dp); - - sw_error_t - fal_cosmap_dscp_to_ehdp_get(a_uint32_t dev_id, a_uint32_t dscp, - a_uint32_t * dp); - - sw_error_t - fal_cosmap_up_to_ehpri_set(a_uint32_t dev_id, a_uint32_t up, - a_uint32_t pri); - - sw_error_t - fal_cosmap_up_to_ehpri_get(a_uint32_t dev_id, a_uint32_t up, - a_uint32_t * pri); - - sw_error_t - fal_cosmap_up_to_ehdp_set(a_uint32_t dev_id, a_uint32_t up, - a_uint32_t dp); - - sw_error_t - fal_cosmap_up_to_ehdp_get(a_uint32_t dev_id, a_uint32_t up, - a_uint32_t * dp); - - sw_error_t - fal_cosmap_pri_to_queue_set(a_uint32_t dev_id, a_uint32_t pri, - a_uint32_t queue); - - sw_error_t - fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri, - a_uint32_t * queue); - - sw_error_t - fal_cosmap_pri_to_ehqueue_set(a_uint32_t dev_id, a_uint32_t pri, - a_uint32_t queue); - - sw_error_t - fal_cosmap_pri_to_ehqueue_get(a_uint32_t dev_id, a_uint32_t pri, - a_uint32_t * queue); - - sw_error_t - fal_cosmap_egress_remark_set(a_uint32_t dev_id, a_uint32_t tbl_id, - fal_egress_remark_table_t * tbl); - - sw_error_t - fal_cosmap_egress_remark_get(a_uint32_t dev_id, a_uint32_t tbl_id, - fal_egress_remark_table_t * tbl); -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_COSMAP_H_ */ - -/** - * @} - */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_ctrlpkt.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_ctrlpkt.h deleted file mode 100755 index e2419d157..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_ctrlpkt.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -/** - * @defgroup fal_ctrlpkt FAL_CTRLPKT - * @{ - */ -#ifndef _FAL_CTRLPKT_H_ -#define _FAL_CTRLPKT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - -typedef struct { - fal_fwd_cmd_t action; /* the action when condition matched */ - a_bool_t sg_bypass; /* check if sg_bypass when condition matched */ - a_bool_t l2_filter_bypass; /* check if l2_filter_bypass when condition matched */ - a_bool_t in_stp_bypass; /* check if in_stp_bypass when condition matched */ - a_bool_t in_vlan_fltr_bypass; /* check if in_vlan_fltr_bypass when condition matched */ -} fal_ctrlpkt_action_t; - -typedef struct -{ - a_bool_t mgt_eapol; /* eapol protocol management type */ - a_bool_t mgt_pppoe; /* pppoe protocol management type */ - a_bool_t mgt_igmp; /* igmp protocol management type */ - a_bool_t mgt_arp_req; /* arp request protocol management type */ - a_bool_t mgt_arp_rep; /* arp response protocol management type */ - a_bool_t mgt_dhcp4; /* dhcp4 protocol management type */ - a_bool_t mgt_mld; /* mld protocol management type */ - a_bool_t mgt_ns; /* ns protocol management type */ - a_bool_t mgt_na; /* na protocol management type */ - a_bool_t mgt_dhcp6; /* dhcp6 protocol management type */ -} fal_ctrlpkt_protocol_type_t; - -typedef struct { - fal_ctrlpkt_action_t action; /* the all action when condition matched */ - fal_pbmp_t port_map; /* the condition port bitmap */ - a_uint32_t ethtype_profile_bitmap; /* the condition ethtype_profile bitmap */ - a_uint32_t rfdb_profile_bitmap; /* the condition rfdb_profile bitmap */ - fal_ctrlpkt_protocol_type_t protocol_types; /* the condition protocol types */ -} fal_ctrlpkt_profile_t; - -enum { - FUNC_MGMTCTRL_ETHTYPE_PROFILE_SET = 0, - FUNC_MGMTCTRL_ETHTYPE_PROFILE_GET, - FUNC_MGMTCTRL_RFDB_PROFILE_SET, - FUNC_MGMTCTRL_RFDB_PROFILE_GET, - FUNC_MGMTCTRL_CTRLPKT_PROFILE_ADD, - FUNC_MGMTCTRL_CTRLPKT_PROFILE_DEL, - FUNC_MGMTCTRL_CTRLPKT_PROFILE_GETFIRST, - FUNC_MGMTCTRL_CTRLPKT_PROFILE_GETNEXT, -}; - -sw_error_t fal_mgmtctrl_ethtype_profile_set(a_uint32_t dev_id, a_uint32_t profile_id, a_uint32_t ethtype); -sw_error_t fal_mgmtctrl_ethtype_profile_get(a_uint32_t dev_id, a_uint32_t profile_id, a_uint32_t * ethtype); - -sw_error_t fal_mgmtctrl_rfdb_profile_set(a_uint32_t dev_id, a_uint32_t profile_id, fal_mac_addr_t *addr); -sw_error_t fal_mgmtctrl_rfdb_profile_get(a_uint32_t dev_id, a_uint32_t profile_id, fal_mac_addr_t *addr); - -sw_error_t fal_mgmtctrl_ctrlpkt_profile_add(a_uint32_t dev_id, fal_ctrlpkt_profile_t *ctrlpkt); -sw_error_t fal_mgmtctrl_ctrlpkt_profile_del(a_uint32_t dev_id, fal_ctrlpkt_profile_t *ctrlpkt); -sw_error_t fal_mgmtctrl_ctrlpkt_profile_getfirst(a_uint32_t dev_id, fal_ctrlpkt_profile_t *ctrlpkt); -sw_error_t fal_mgmtctrl_ctrlpkt_profile_getnext(a_uint32_t dev_id, fal_ctrlpkt_profile_t *ctrlpkt); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_CTRLPKT_H_ */ -/** - * @} - */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_fdb.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_fdb.h deleted file mode 100755 index be205d4fc..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_fdb.h +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_fdb FAL_FDB - * @{ - */ -#ifndef _FAL_FDB_H_ -#define _FAL_FDB_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - /** - @details Fields description: - - portmap_en - If value of portmap_en is A_TRUE then port.map is valid - otherwise port.id is valid. - - - leaky_en - If value of leaky_en is A_TRUE then packets which - destination address equals addr in this entry would be leaky. - - - mirror_en - If value of mirror_en is A_TRUE then packets which - destination address equals addr in this entry would be mirrored. - - - clone_en - If value of clone_en is A_TRUE which means this address is - a mac clone address. - @brief This structure defines the Fdb entry. - - */ - typedef struct - { - fal_mac_addr_t addr; /* mac address of fdb entry */ - a_uint16_t fid; /* vlan_id/vsi value of fdb entry */ - fal_fwd_cmd_t dacmd; /* source address command */ - fal_fwd_cmd_t sacmd; /* dest address command */ - union - { - fal_port_t id; /* union value is port id value */ - fal_pbmp_t map; /* union value is bitmap value */ - } port; - a_bool_t portmap_en; /* use port bitmap or not */ - a_bool_t is_multicast; /* if it is a multicast mac fdb entry */ - a_bool_t static_en; /* enable static or not */ - a_bool_t leaky_en; /* enable leaky or not */ - a_bool_t mirror_en; /* enable mirror or not */ - a_bool_t clone_en; /* enable clone or not */ - a_bool_t cross_pt_state; /* cross port state */ - a_bool_t da_pri_en; /* enable da pri or not */ - a_uint8_t da_queue; /* da queue value */ - a_bool_t white_list_en; /* enable white list or not */ - a_bool_t load_balance_en; /* enable load balance value or not */ - a_uint8_t load_balance; /* load balance value */ - a_bool_t entry_valid; /* check if entry is value */ - a_bool_t lookup_valid; /* check if entry is lookup */ - } fal_fdb_entry_t; - -#define FAL_FDB_DEL_STATIC 0x1 - - typedef struct - { - a_bool_t port_en; /* enable port value matching or not */ - a_bool_t fid_en; /* enable fid value matching or not */ - a_bool_t multicast_en; /* enable multicast value matching or not */ - } fal_fdb_op_t; - - typedef enum - { - INVALID_VLAN_SVL=0, - INVALID_VLAN_IVL - } fal_fdb_smode; - -enum { - FUNC_FDB_ENTRY_ADD = 0, - FUNC_FDB_ENTRY_FLUSH, - FUNC_FDB_ENTRY_DEL_BYPORT, - FUNC_FDB_ENTRY_DEL_BYMAC, - FUNC_FDB_ENTRY_GETFIRST, - FUNC_FDB_ENTRY_GETNEXT, - FUNC_FDB_ENTRY_SEARCH, - FUNC_FDB_PORT_LEARN_SET, - FUNC_FDB_PORT_LEARN_GET, - FUNC_FDB_PORT_LEARNING_CTRL_SET, - FUNC_FDB_PORT_LEARNING_CTRL_GET, - FUNC_FDB_PORT_STAMOVE_CTRL_SET, - FUNC_FDB_PORT_STAMOVE_CTRL_GET, - FUNC_FDB_AGING_CTRL_SET, - FUNC_FDB_AGING_CTRL_GET, - FUNC_FDB_LEARNING_CTRL_SET, - FUNC_FDB_LEARNING_CTRL_GET, - FUNC_FDB_AGING_TIME_SET, - FUNC_FDB_AGING_TIME_GET, - FUNC_FDB_ENTRY_GETNEXT_BYINDEX, - FUNC_FDB_ENTRY_EXTEND_GETNEXT, - FUNC_FDB_ENTRY_EXTEND_GETFIRST, - FUNC_FDB_ENTRY_UPDATE_BYPORT, - FUNC_PORT_FDB_LEARN_LIMIT_SET, - FUNC_PORT_FDB_LEARN_LIMIT_GET, - FUNC_PORT_FDB_LEARN_EXCEED_CMD_SET, - FUNC_PORT_FDB_LEARN_EXCEED_CMD_GET, - FUNC_FDB_PORT_LEARNED_MAC_COUNTER_GET, - FUNC_FDB_PORT_ADD, - FUNC_FDB_PORT_DEL, - FUNC_FDB_PORT_MACLIMIT_CTRL_SET, - FUNC_FDB_PORT_MACLIMIT_CTRL_GET, - FUNC_FDB_DEL_BY_FID, -}; - - typedef struct - { - fal_mac_addr_t addr; - a_uint16_t fid; - a_uint8_t load_balance; - } fal_fdb_rfs_t; - - typedef struct - { - a_bool_t enable; /* enable port learn limit or not */ - a_uint32_t limit_num; /* port learn limit number */ - fal_fwd_cmd_t action; /* the action when port learn number exceed limit*/ - } fal_maclimit_ctrl_t; - - sw_error_t - fal_fdb_rfs_set(a_uint32_t dev_id, fal_fdb_rfs_t * entry); - - sw_error_t - fal_fdb_rfs_del(a_uint32_t dev_id, fal_fdb_rfs_t * entry); - - sw_error_t - fal_fdb_entry_add(a_uint32_t dev_id, const fal_fdb_entry_t * entry); - - - - sw_error_t - fal_fdb_entry_flush(a_uint32_t dev_id, a_uint32_t flag); - - - - sw_error_t - fal_fdb_entry_del_byport(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t flag); - - - - sw_error_t - fal_fdb_entry_del_bymac(a_uint32_t dev_id, const fal_fdb_entry_t *entry); - - - - sw_error_t - fal_fdb_entry_getfirst(a_uint32_t dev_id, fal_fdb_entry_t * entry); - - - - sw_error_t - fal_fdb_entry_getnext(a_uint32_t dev_id, fal_fdb_entry_t * entry); - - - - sw_error_t - fal_fdb_entry_search(a_uint32_t dev_id, fal_fdb_entry_t * entry); - - - - sw_error_t - fal_fdb_port_learn_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - - sw_error_t - fal_fdb_port_learning_ctrl_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable, fal_fwd_cmd_t cmd); - - - sw_error_t - fal_fdb_port_learning_ctrl_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t *enable, fal_fwd_cmd_t *cmd); - - - sw_error_t - fal_fdb_port_stamove_ctrl_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable, fal_fwd_cmd_t cmd); - - - sw_error_t - fal_fdb_port_stamove_ctrl_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t *enable, fal_fwd_cmd_t *cmd); - - - sw_error_t - fal_fdb_port_learn_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable); - - - sw_error_t - fal_fdb_aging_ctrl_set(a_uint32_t dev_id, a_bool_t enable); - - - sw_error_t - fal_fdb_aging_ctrl_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_fdb_learning_ctrl_set(a_uint32_t dev_id, a_bool_t enable); - - - sw_error_t - fal_fdb_learning_ctrl_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_fdb_vlan_ivl_svl_set(a_uint32_t dev_id, fal_fdb_smode smode); - - - sw_error_t - fal_fdb_vlan_ivl_svl_get(a_uint32_t dev_id, fal_fdb_smode * smode); - - - sw_error_t - fal_fdb_aging_time_set(a_uint32_t dev_id, a_uint32_t * time); - - - - sw_error_t - fal_fdb_aging_time_get(a_uint32_t dev_id, a_uint32_t * time); - - - sw_error_t - fal_fdb_entry_getnext_byindex(a_uint32_t dev_id, a_uint32_t * iterator, fal_fdb_entry_t * entry); - - - sw_error_t - fal_fdb_entry_extend_getnext(a_uint32_t dev_id, fal_fdb_op_t * option, - fal_fdb_entry_t * entry); - - - sw_error_t - fal_fdb_entry_extend_getfirst(a_uint32_t dev_id, fal_fdb_op_t * option, - fal_fdb_entry_t * entry); - - - sw_error_t - fal_fdb_entry_update_byport(a_uint32_t dev_id, fal_port_t old_port, fal_port_t new_port, - a_uint32_t fid, fal_fdb_op_t * option); - - - sw_error_t - fal_fdb_port_learned_mac_counter_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * cnt); - - - sw_error_t - fal_port_fdb_learn_limit_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable, a_uint32_t cnt); - - - sw_error_t - fal_port_fdb_learn_limit_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable, a_uint32_t * cnt); - - - sw_error_t - fal_port_fdb_learn_exceed_cmd_set(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t cmd); - - - sw_error_t - fal_port_fdb_learn_exceed_cmd_get(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t * cmd); - - - sw_error_t - fal_fdb_learn_limit_set(a_uint32_t dev_id, a_bool_t enable, a_uint32_t cnt); - - - sw_error_t - fal_fdb_learn_limit_get(a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * cnt); - - - sw_error_t - fal_fdb_learn_exceed_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd); - - - sw_error_t - fal_fdb_learn_exceed_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd); - - - sw_error_t - fal_fdb_resv_add(a_uint32_t dev_id, fal_fdb_entry_t * entry); - - sw_error_t - fal_fdb_resv_del(a_uint32_t dev_id, fal_fdb_entry_t * entry); - - - sw_error_t - fal_fdb_resv_find(a_uint32_t dev_id, fal_fdb_entry_t * entry); - - - sw_error_t - fal_fdb_resv_iterate(a_uint32_t dev_id, a_uint32_t * iterator, fal_fdb_entry_t * entry); - - - sw_error_t - fal_fdb_port_learn_static_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - - sw_error_t - fal_fdb_port_learn_static_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); - - sw_error_t - fal_fdb_port_add(a_uint32_t dev_id, a_uint32_t fid, fal_mac_addr_t * addr, fal_port_t port_id); - - sw_error_t - fal_fdb_port_del(a_uint32_t dev_id, a_uint32_t fid, fal_mac_addr_t * addr, fal_port_t port_id); - - sw_error_t - fal_fdb_port_maclimit_ctrl_set(a_uint32_t dev_id, fal_port_t port_id, fal_maclimit_ctrl_t * maclimit_ctrl); - - sw_error_t - fal_fdb_port_maclimit_ctrl_get(a_uint32_t dev_id, fal_port_t port_id, fal_maclimit_ctrl_t * maclimit_ctrl); - - sw_error_t - fal_fdb_entry_del_byfid(a_uint32_t dev_id, a_uint16_t fid, a_uint32_t flag); - -#define fal_fdb_add fal_fdb_entry_add -#define fal_fdb_del_all fal_fdb_entry_flush -#define fal_fdb_del_by_port fal_fdb_entry_del_byport -#define fal_fdb_del_by_mac fal_fdb_entry_del_bymac -#define fal_fdb_first fal_fdb_entry_getfirst -#define fal_fdb_next fal_fdb_entry_getnext -#define fal_fdb_find fal_fdb_entry_search -#define fal_fdb_age_ctrl_set fal_fdb_aging_ctrl_set -#define fal_fdb_age_ctrl_get fal_fdb_aging_ctrl_get -#define fal_fdb_age_time_set fal_fdb_aging_time_set -#define fal_fdb_age_time_get fal_fdb_aging_time_get -#define fal_fdb_iterate fal_fdb_entry_getnext_byindex -#define fal_fdb_extend_next fal_fdb_entry_extend_getnext -#define fal_fdb_extend_first fal_fdb_entry_extend_getfirst -#define fal_fdb_transfer fal_fdb_entry_update_byport - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_FDB_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_flow.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_flow.h deleted file mode 100755 index 66070f783..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_flow.h +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_flow - * @{ - */ -#ifndef _FAL_FLOW_H_ -#define _FAL_FLOW_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" -#include "fal/fal_ip.h" - -typedef enum { - FAL_FLOW_L3_UNICAST = 0, - FAL_FLOW_L2_UNICAST, - FAL_FLOW_MCAST, -} fal_flow_pkt_type_t; - -typedef enum { - FAL_FLOW_LAN_TO_LAN_DIR = 0, - FAL_FLOW_LAN_TO_WAN_DIR, - FAL_FLOW_WAN_TO_LAN_DIR, - FAL_FLOW_WAN_TO_WAN_DIR, - FAL_FLOW_UNKOWN_DIR_DIR, -} fal_flow_direction_t; - -typedef enum { - FAL_FLOW_FORWARD = 0, - FAL_FLOW_SNAT, - FAL_FLOW_DNAT, - FAL_FLOW_ROUTE, - FAL_FLOW_BRIDGE, -} fal_flow_fwd_type_t; - -/* FLOW entry type field */ -#define FAL_FLOW_IP4_5TUPLE_ADDR 0x1 -#define FAL_FLOW_IP6_5TUPLE_ADDR 0x2 -#define FAL_FLOW_IP4_3TUPLE_ADDR 0x4 -#define FAL_FLOW_IP6_3TUPLE_ADDR 0x8 - -#define FAL_FLOW_OP_MODE_KEY 0x0 -#define FAL_FLOW_OP_MODE_INDEX 0x1 -#define FAL_FLOW_OP_MODE_FLUSH 0x2 - -typedef struct { - fal_fwd_cmd_t miss_action; /* flow mismatch action*/ - a_bool_t frag_bypass_en; /*0 for disable and 1 for enable*/ - a_bool_t tcp_spec_bypass_en; /*0 for disable and 1 for enable*/ - a_bool_t all_bypass_en; /*0 for disable and 1 for enable*/ - a_uint8_t key_sel; /*0 for source ip address and 1 for destination ip address*/ -} fal_flow_mgmt_t; - -typedef struct { - a_uint32_t entry_id; /*entry index*/ - a_uint8_t entry_type; /*1:ipv4 5 tuple, 2:ipv6 5 tuple, 4:ipv4 3 tuple, 8:ipv6 3 tuple*/ - a_uint8_t host_addr_type; /*0:souce ip index, 1:destination ip index*/ - a_uint16_t host_addr_index; /*host table entry index*/ - a_uint8_t protocol; /*1:tcp, 2:udp, 3:udp-lite, 0:other*/ - a_uint8_t age; /*aging value*/ - a_bool_t src_intf_valid; /*source interface check valid*/ - a_uint8_t src_intf_index; /*souce l3 interface*/ - a_uint8_t fwd_type; /*forward type*/ - a_uint16_t snat_nexthop; /*nexthop index for snat*/ - a_uint16_t snat_srcport; /*new source l4 port*/ - a_uint16_t dnat_nexthop; /*nexthop index for dnat*/ - a_uint16_t dnat_dstport; /*new destination l4 port*/ - a_uint16_t route_nexthop; /*nexthop index for route*/ - a_bool_t port_valid; /*route port valid*/ - fal_port_t route_port; /*port for route*/ - fal_port_t bridge_port; /*port for l2 bridge*/ - a_bool_t deacclr_en; /*0 for disable and 1 for enable*/ - a_bool_t copy_tocpu_en; /*0 for disable and 1 for enable*/ - a_uint8_t syn_toggle; /*update by host*/ - a_uint8_t pri_profile; /*flow qos index*/ - a_uint8_t sevice_code; /*service code for bypass*/ - a_uint8_t ip_type; /*0 for ipv4 and 1 for ipv6*/ - union { - fal_ip4_addr_t ipv4; - fal_ip6_addr_t ipv6; - } flow_ip; - a_uint16_t src_port; /*l4 source port*/ - a_uint16_t dst_port; /*l4 destination port*/ - a_uint32_t tree_id; /*for qos*/ - a_uint32_t pkt_counter; /*flow packet counter*/ - a_uint64_t byte_counter; /*flow byte counter*/ -} fal_flow_entry_t; - -typedef struct { - fal_fwd_cmd_t src_if_check_action; /*source inferface check fail action*/ - a_bool_t src_if_check_deacclr_en; /*0 for disable and 1 for enable*/ - a_bool_t service_loop_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t service_loop_action; /*0 for disable and 1 for enable*/ - a_bool_t service_loop_deacclr_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t flow_deacclr_action; /*flow de acceleration action*/ - fal_fwd_cmd_t sync_mismatch_action; /*sync toggle mismatch action*/ - a_bool_t sync_mismatch_deacclr_en; /*0 for disable and 1 for enable*/ - a_uint8_t hash_mode_0; /*0 crc10, 1 xor, 2 crc16*/ - a_uint8_t hash_mode_1; /*0 crc10, 1 xor, 2 crc16*/ - a_bool_t flow_mismatch_copy_escape_en; /*0 for disable and 1 for enable*/ -} fal_flow_global_cfg_t; - -typedef struct { - fal_flow_entry_t flow_entry; - fal_host_entry_t host_entry; -} fal_flow_host_entry_t; - -typedef struct { - a_uint16_t age_time; /* age value*/ - a_uint16_t unit; /*0:second 1:cycle 2:million cycle*/ -} fal_flow_age_timer_t; - -enum { - FUNC_FLOW_HOST_ADD = 0, - FUNC_FLOW_ENTRY_GET, - FUNC_FLOW_ENTRY_DEL, - FUNC_FLOW_STATUS_GET, - FUNC_FLOW_CTRL_SET, - FUNC_FLOW_AGE_TIMER_GET, - FUNC_FLOW_STATUS_SET, - FUNC_FLOW_HOST_GET, - FUNC_FLOW_HOST_DEL, - FUNC_FLOW_CTRL_GET, - FUNC_FLOW_AGE_TIMER_SET, - FUNC_FLOW_ENTRY_ADD, - FUNC_FLOW_GLOBAL_CFG_GET, - FUNC_FLOW_GLOBAL_CFG_SET, - FUNC_FLOW_ENTRY_NEXT, -}; - -sw_error_t -fal_flow_status_set(a_uint32_t dev_id, a_bool_t enable); - -sw_error_t -fal_flow_status_get(a_uint32_t dev_id, a_bool_t *enable); - -sw_error_t -fal_flow_age_timer_set(a_uint32_t dev_id, fal_flow_age_timer_t *age_timer); - -sw_error_t -fal_flow_age_timer_get(a_uint32_t dev_id, fal_flow_age_timer_t *age_timer); - -sw_error_t -fal_flow_mgmt_set( - a_uint32_t dev_id, - fal_flow_pkt_type_t type, - fal_flow_direction_t dir, - fal_flow_mgmt_t *mgmt); - -sw_error_t -fal_flow_mgmt_get( - a_uint32_t dev_id, - fal_flow_pkt_type_t type, - fal_flow_direction_t dir, - fal_flow_mgmt_t *mgmt); - -sw_error_t -fal_flow_entry_add( - a_uint32_t dev_id, - a_uint32_t add_mode, /*index or hash*/ - fal_flow_entry_t *flow_entry); - -sw_error_t -fal_flow_entry_del( - a_uint32_t dev_id, - a_uint32_t del_mode, - fal_flow_entry_t *flow_entry); - -sw_error_t -fal_flow_entry_get( - a_uint32_t dev_id, - a_uint32_t get_mode, - fal_flow_entry_t *flow_entry); - -sw_error_t -fal_flow_entry_next( - a_uint32_t dev_id, - a_uint32_t next_mode, - fal_flow_entry_t *flow_entry); - -sw_error_t -fal_flow_host_add( - a_uint32_t dev_id, - a_uint32_t add_mode, - fal_flow_host_entry_t *flow_host_entry); - -sw_error_t -fal_flow_host_del( - a_uint32_t dev_id, - a_uint32_t del_mode, - fal_flow_host_entry_t *flow_host_entry); - -sw_error_t -fal_flow_host_get( - a_uint32_t dev_id, - a_uint32_t get_mode, - fal_flow_host_entry_t *flow_host_entry); - -sw_error_t -fal_flow_global_cfg_get( - a_uint32_t dev_id, - fal_flow_global_cfg_t *cfg); - -sw_error_t -fal_flow_global_cfg_set( - a_uint32_t dev_id, - fal_flow_global_cfg_t *cfg); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_FLOW_H_ */ - -/** - * @} - */ - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_igmp.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_igmp.h deleted file mode 100755 index f41fdf781..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_igmp.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_igmp FAL_IGMP - * @{ - */ -#ifndef _FAL_IGMP_H_ -#define _FAL_IGMP_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" -#include "fal/fal_multi.h" - - - sw_error_t - fal_port_igmps_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - - - sw_error_t - fal_port_igmps_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable); - - - - sw_error_t - fal_igmp_mld_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd); - - - - sw_error_t - fal_igmp_mld_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd); - - - - sw_error_t - fal_port_igmp_mld_join_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - - - sw_error_t - fal_port_igmp_mld_join_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable); - - - - sw_error_t - fal_port_igmp_mld_leave_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - - - sw_error_t - fal_port_igmp_mld_leave_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable); - - - - sw_error_t - fal_igmp_mld_rp_set(a_uint32_t dev_id, fal_pbmp_t pts); - - - - sw_error_t - fal_igmp_mld_rp_get(a_uint32_t dev_id, fal_pbmp_t * pts); - - - - sw_error_t - fal_igmp_mld_entry_creat_set(a_uint32_t dev_id, a_bool_t enable); - - - - sw_error_t - fal_igmp_mld_entry_creat_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_igmp_mld_entry_static_set(a_uint32_t dev_id, a_bool_t static_en); - - - sw_error_t - fal_igmp_mld_entry_static_get(a_uint32_t dev_id, a_bool_t * static_en); - - - sw_error_t - fal_igmp_mld_entry_leaky_set(a_uint32_t dev_id, a_bool_t enable); - - - sw_error_t - fal_igmp_mld_entry_leaky_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_igmp_mld_entry_v3_set(a_uint32_t dev_id, a_bool_t enable); - - - sw_error_t - fal_igmp_mld_entry_v3_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_igmp_mld_entry_queue_set(a_uint32_t dev_id, a_bool_t enable, a_uint32_t queue); - - - sw_error_t - fal_igmp_mld_entry_queue_get(a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * queue); - - - sw_error_t - fal_port_igmp_mld_learn_limit_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable, a_uint32_t cnt); - - - sw_error_t - fal_port_igmp_mld_learn_limit_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable, a_uint32_t * cnt); - - - sw_error_t - fal_port_igmp_mld_learn_exceed_cmd_set(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t cmd); - - - sw_error_t - fal_port_igmp_mld_learn_exceed_cmd_get(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t * cmd); - - sw_error_t - fal_igmp_sg_entry_set(a_uint32_t dev_id, fal_igmp_sg_entry_t * entry); - - sw_error_t - fal_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * entry); - - sw_error_t - fal_igmp_sg_entry_show(a_uint32_t dev_id); - - sw_error_t - fal_igmp_sg_entry_query(a_uint32_t dev_id, fal_igmp_sg_info_t * info); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_IGMP_H_ */ - -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_init.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_init.h deleted file mode 100755 index 6510291e3..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_init.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/*qca808x_start*/ -/** - * @defgroup fal_init FAL_INIT - * @{ - */ -#ifndef _FAL_INIT_H_ -#define _FAL_INIT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "ssdk_init.h" -/*qca808x_end*/ -enum{ - FAL_MODULE_ACL, - FAL_MODULE_VSI, - FAL_MODULE_IP, - FAL_MODULE_FLOW, - FAL_MODULE_QM, - FAL_MODULE_QOS, - FAL_MODULE_BM, - FAL_MODULE_SERVCODE, - FAL_MODULE_RSS_HASH, - FAL_MODULE_PPPOE, - FAL_MODULE_SHAPER, - FAL_MODULE_PORTCTRL, - FAL_MODULE_MIB, - FAL_MODULE_MIRROR, - FAL_MODULE_FDB, - FAL_MODULE_STP, - FAL_MODULE_TRUNK, - FAL_MODULE_PORTVLAN, - FAL_MODULE_CTRLPKT, - FAL_MODULE_SEC, - FAL_MODULE_POLICER, - FAL_MODULE_PTP, - FAL_MODULE_MAX, -}; - -typedef struct -{ - a_uint32_t bitmap[3]; -}fal_func_ctrl_t; - - -sw_error_t fal_init(a_uint32_t dev_id, ssdk_init_cfg * cfg); -sw_error_t fal_reset(a_uint32_t dev_id); -/*qca808x_start*/ -sw_error_t fal_ssdk_cfg(a_uint32_t dev_id, ssdk_cfg_t *ssdk_cfg); -/*qca808x_end*/ -sw_error_t fal_cleanup(void); -sw_error_t fal_module_func_ctrl_set(a_uint32_t dev_id, - a_uint32_t module, fal_func_ctrl_t *func_ctrl); -sw_error_t fal_module_func_ctrl_get(a_uint32_t dev_id, - a_uint32_t module, fal_func_ctrl_t *func_ctrl); -/*qca808x_start*/ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _FAL_INIT_H_ */ -/** - * @} - */ - /*qca808x_end*/ \ No newline at end of file diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_interface_ctrl.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_interface_ctrl.h deleted file mode 100755 index 40ac18b5b..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_interface_ctrl.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_interface_ctrl FAL_INTERFACE_CONTROL - * @{ - */ -#ifndef _FAL_INTERFACECTRL_H_ -#define _FAL_INTERFACECTRL_H_ - -#ifdef __cplusplus -extern "c" { -#endif - -#include "common/sw.h" -#include "fal/fal_type.h" - - typedef enum { - FAL_MAC_MODE_RGMII = 0, - FAL_MAC_MODE_GMII, - FAL_MAC_MODE_MII, - FAL_MAC_MODE_SGMII, - FAL_MAC_MODE_FIBER, - FAL_MAC_MODE_RMII, - FAL_MAC_MODE_DEFAULT - } - fal_interface_mac_mode_t; - - typedef enum - { - FAL_INTERFACE_CLOCK_MAC_MODE = 0, - FAL_INTERFACE_CLOCK_PHY_MODE = 1, - } fal_interface_clock_mode_t; - - typedef struct - { - a_bool_t txclk_delay_cmd; - a_bool_t rxclk_delay_cmd; - a_uint32_t txclk_delay_sel; - a_uint32_t rxclk_delay_sel; - } fal_mac_rgmii_config_t; - - typedef struct - { - a_bool_t master_mode; - a_bool_t slave_mode; - a_bool_t clock_inverse; - a_bool_t pipe_rxclk_sel; - } fal_mac_rmii_config_t; - - typedef struct - { - fal_interface_clock_mode_t clock_mode; - a_uint32_t txclk_select; - a_uint32_t rxclk_select; - } fal_mac_gmii_config_t; - - typedef struct - { - fal_interface_clock_mode_t clock_mode; - a_uint32_t txclk_select; - a_uint32_t rxclk_select; - } fal_mac_mii_config_t; - - typedef struct - { - fal_interface_clock_mode_t clock_mode; - a_bool_t auto_neg; - a_bool_t force_speed; - a_bool_t prbs_enable; - a_bool_t rem_phy_lpbk; - } fal_mac_sgmii_config_t; - - typedef struct - { - a_bool_t auto_neg; - a_bool_t fx100_enable; - } fal_mac_fiber_config_t; - - typedef struct - { - fal_interface_mac_mode_t mac_mode; - union - { - fal_mac_rgmii_config_t rgmii; - fal_mac_gmii_config_t gmii; - fal_mac_mii_config_t mii; - fal_mac_sgmii_config_t sgmii; - fal_mac_rmii_config_t rmii; - fal_mac_fiber_config_t fiber; - } config; - } fal_mac_config_t; - - typedef struct - { - fal_interface_mac_mode_t mac_mode; - a_bool_t txclk_delay_cmd; - a_bool_t rxclk_delay_cmd; - a_uint32_t txclk_delay_sel; - a_uint32_t rxclk_delay_sel; - } fal_phy_config_t; - - typedef enum - { - Fx100BASE_MODE = 2, - Fx100BASE_BUTT = 0xffff, - } fx100_ctrl_link_mode_t; - - typedef enum - { - FX100_SERDS_MODE = 1, - Fx100_SERDS_BUTT = 0xffff, - } sgmii_fiber_mode_t; - -#define FX100_HALF_DUPLEX 0 -#define FX100_FULL_DUPLEX 1 - - typedef struct - { - fx100_ctrl_link_mode_t link_mode; - a_bool_t overshoot; - a_bool_t loopback; - a_bool_t fd_mode; - a_bool_t col_test; - sgmii_fiber_mode_t sgmii_fiber_mode; - a_bool_t crs_ctrl; - a_bool_t loopback_ctrl; - a_bool_t crs_col_100_ctrl; - a_bool_t loop_en; - } fal_fx100_ctrl_config_t; - - sw_error_t - fal_port_3az_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - sw_error_t - fal_port_3az_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable); - - sw_error_t - fal_interface_mac_mode_set(a_uint32_t dev_id, fal_port_t port_id, fal_mac_config_t * config); - - sw_error_t - fal_interface_mac_mode_get(a_uint32_t dev_id, fal_port_t port_id, fal_mac_config_t * config); - - sw_error_t - fal_interface_phy_mode_set(a_uint32_t dev_id, a_uint32_t phy_id, fal_phy_config_t * config); - - sw_error_t - fal_interface_phy_mode_get(a_uint32_t dev_id, a_uint32_t phy_id, fal_phy_config_t * config); - - sw_error_t - fal_interface_fx100_ctrl_set(a_uint32_t dev_id, fal_fx100_ctrl_config_t * config); - - sw_error_t - fal_interface_fx100_ctrl_get(a_uint32_t dev_id, fal_fx100_ctrl_config_t * config); - - sw_error_t - fal_interface_fx100_status_get(a_uint32_t dev_id, a_uint32_t* status); - - sw_error_t - fal_interface_mac06_exch_set(a_uint32_t dev_id, a_bool_t enable); - - sw_error_t - fal_interface_mac06_exch_get(a_uint32_t dev_id, a_bool_t* enable); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_INTERFACECTRL_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_ip.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_ip.h deleted file mode 100755 index 9303971a4..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_ip.h +++ /dev/null @@ -1,633 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_ip FAL_IP - * @{ - */ -#ifndef _FAL_IP_H_ -#define _FAL_IP_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" -#include "fal_multi.h" - - /* IP WCMP hash key flags */ -#define FAL_WCMP_HASH_KEY_SIP 0x1 -#define FAL_WCMP_HASH_KEY_DIP 0x2 -#define FAL_WCMP_HASH_KEY_SPORT 0x4 -#define FAL_WCMP_HASH_KEY_DPORT 0x8 - - /* IP entry operation flags */ -#define FAL_IP_ENTRY_ID_EN 0x1 -#define FAL_IP_ENTRY_INTF_EN 0x2 -#define FAL_IP_ENTRY_PORT_EN 0x4 -#define FAL_IP_ENTRY_STATUS_EN 0x8 -#define FAL_IP_ENTRY_IPADDR_EN 0x10 -#define FAL_IP_ENTRY_ALL_EN 0x20 - - /* IP host entry structure flags field */ -#define FAL_IP_IP4_ADDR 0x1 -#define FAL_IP_IP6_ADDR 0x2 -#define FAL_IP_CPU_ADDR 0x4 -#define FAL_IP_IP4_ADDR_MCAST 0x8 -#define FAL_IP_IP6_ADDR_MCAST 0x10 - -typedef struct { - a_uint8_t vsi; /*vsi value for l2 multicast*/ - fal_ip4_addr_t sip4_addr; /*source ipv4 address*/ - fal_ip6_addr_t sip6_addr; /*source ipv4 address*/ -} fal_host_mcast_t; - -typedef struct -{ - a_uint32_t rx_pkt_counter; /*rx packet counter*/ - a_uint64_t rx_byte_counter; /*rx byte counter*/ - a_uint32_t rx_drop_pkt_counter; /*rx drop packet counter*/ - a_uint64_t rx_drop_byte_counter; /*rx drop byte counter*/ - a_uint32_t tx_pkt_counter; /*tx packet counter*/ - a_uint64_t tx_byte_counter; /*tx byte counter*/ - a_uint32_t tx_drop_pkt_counter; /*tx drop packet counter*/ - a_uint64_t tx_drop_byte_counter; /*tx drop byte counter*/ -} fal_ip_counter_t; - -typedef struct -{ - a_uint32_t entry_id; /*index for host table*/ - a_uint32_t flags; /*1:ipv4 uni 2:ipv6 uni 8:ipv4 multi 0x10:ipv6 multi*/ - a_uint32_t status; /* valid status: 0 or 1*/ - fal_ip4_addr_t ip4_addr; /* ipv4 address */ - fal_ip6_addr_t ip6_addr; /* ipv6 address */ - fal_mac_addr_t mac_addr; /* unused for ppe */ - a_uint32_t intf_id; /* unused for ppe */ - a_uint32_t lb_num; /* unused for ppe */ - a_uint32_t vrf_id; /* unused for ppe */ - a_uint32_t expect_vid; /* unused for ppe */ - fal_port_t port_id; /* unused for ppe */ - a_bool_t mirror_en; /* unused for ppe */ - a_bool_t counter_en; /* unused for ppe */ - a_uint32_t counter_id; /* unused for ppe */ - a_uint32_t packet; /* unused for ppe */ - a_uint32_t byte; /* unused for ppe */ - a_bool_t pppoe_en; /* unused for ppe */ - a_uint32_t pppoe_id; /* unused for ppe */ - fal_fwd_cmd_t action; /*forward action*/ - a_uint32_t dst_info; /*bit 12:13: 1.nexthop, 2.port id, 3.port bitmap*/ - a_uint8_t syn_toggle; /* sync toggle */ - a_uint8_t lan_wan; /*0: ip over lan side ; 1: ip over wan side*/ - fal_host_mcast_t mcast_info; /* multicast information */ -} fal_host_entry_t; - - typedef enum - { - FAL_MAC_IP_GUARD = 0, - FAL_MAC_IP_PORT_GUARD, - FAL_MAC_IP_VLAN_GUARD, - FAL_MAC_IP_PORT_VLAN_GUARD, - FAL_NO_SOURCE_GUARD, - } fal_source_guard_mode_t; - - typedef enum - { - FAL_DEFAULT_FLOW_FORWARD = 0, - FAL_DEFAULT_FLOW_DROP, - FAL_DEFAULT_FLOW_RDT_TO_CPU, - FAL_DEFAULT_FLOW_ADMIT_ALL, - } fal_default_flow_cmd_t; - - typedef enum - { - FAL_FLOW_LAN_TO_LAN = 0, - FAL_FLOW_WAN_TO_LAN, - FAL_FLOW_LAN_TO_WAN, - FAL_FLOW_WAN_TO_WAN, - } fal_flow_type_t; - - typedef enum - { - FAL_ARP_LEARN_LOCAL = 0, - FAL_ARP_LEARN_ALL, - } fal_arp_learn_mode_t; - - /* IP host entry auto learn arp packets type */ -#define FAL_ARP_LEARN_REQ 0x1 -#define FAL_ARP_LEARN_ACK 0x2 - - typedef struct - { - a_uint32_t entry_id; - a_uint32_t vrf_id; - a_uint16_t vid_low; - a_uint16_t vid_high; - fal_mac_addr_t mac_addr; - a_bool_t ip4_route; - a_bool_t ip6_route; - } fal_intf_mac_entry_t; - - typedef struct - { - a_uint32_t nh_nr; - a_uint32_t nh_id[16]; - } fal_ip_wcmp_t; - - typedef struct - { - fal_mac_addr_t mac_addr; - fal_ip4_addr_t ip4_addr; - a_uint32_t vid; - a_uint8_t load_balance; - } fal_ip4_rfs_t; - - typedef struct - { - fal_mac_addr_t mac_addr; - fal_ip6_addr_t ip6_addr; - a_uint32_t vid; - a_uint8_t load_balance; - } fal_ip6_rfs_t; - - typedef struct - { - a_bool_t valid; - a_uint32_t vrf_id; - fal_addr_type_t ip_version; /*0 for IPv4 and 1 for IPv6*/ - a_uint32_t droute_type; /*0 for ARP and 1 for WCMP*/ - a_uint32_t index;/*when droute_type equals 0, means ARP entry index or means WCMP indexs*/ - } fal_default_route_t; - - typedef struct - { - a_bool_t valid; - a_uint32_t vrf_id; - a_uint32_t ip_version; /*0 for IPv4 and 1 for IPv6*/ - union { - fal_ip4_addr_t ip4_addr; - fal_ip6_addr_t ip6_addr; - }route_addr; - a_uint32_t prefix_length;/*For IPv4, up to 32 and for IPv6, up to 128*/ - } fal_host_route_t; - -typedef struct -{ - a_bool_t ipv4_arp_sg_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t ipv4_arp_sg_vio_action; /* check fail action for arp source guard */ - a_bool_t ipv4_arp_sg_port_en; /* source port based arp source guard enable */ - a_bool_t ipv4_arp_sg_svlan_en; /* source svlan based arp source guard enable */ - a_bool_t ipv4_arp_sg_cvlan_en; /* source cvlan based arp source guard enable */ - fal_fwd_cmd_t ipv4_arp_src_unk_action; /* unknown action for arp source guard */ - a_bool_t ip_nd_sg_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t ip_nd_sg_vio_action; /* check fail action for nd source guard */ - a_bool_t ip_nd_sg_port_en; /* source port based nd source guard enable */ - a_bool_t ip_nd_sg_svlan_en; /* source svlan based nd source guard enable */ - a_bool_t ip_nd_sg_cvlan_en; /* source cvlan based nd source guard enable */ - fal_fwd_cmd_t ip_nd_src_unk_action; /* unknown action for nd source guard */ -} fal_arp_sg_cfg_t; - -typedef enum -{ - FAL_MC_MODE_GV = 0, /*not support igmpv3 source filter*/ - FAL_MC_MODE_SGV /*support igmpv3 source filter*/ -} fal_mc_mode_t; - -typedef struct -{ - a_bool_t l2_ipv4_mc_en; /*0 for disable and 1 for enable*/ - fal_mc_mode_t l2_ipv4_mc_mode; /*two modes*/ - a_bool_t l2_ipv6_mc_en; /*0 for disable and 1 for enable*/ - fal_mc_mode_t l2_ipv6_mc_mode; /*same with IPv4*/ -} fal_mc_mode_cfg_t; - -typedef struct -{ - a_uint8_t type; /*0 for IPv4 and 1 for IPv6*/ - fal_fwd_cmd_t action; /* forward action */ - a_uint32_t dst_info; /*bit 12:13: 1.nexthop, 2.port id, 3.port bitmap*/ - a_uint8_t lan_wan; /* 0:ip over lan side; 1:ip over wan side */ - union { - fal_ip4_addr_t ip4_addr; /* ipv4 address */ - fal_ip6_addr_t ip6_addr; /* ipv6 address */ - } route_addr; - union { - fal_ip4_addr_t ip4_addr_mask; /* ipv4 address mask */ - fal_ip6_addr_t ip6_addr_mask; /* ipv6 address mask */ - } route_addr_mask; -} fal_network_route_entry_t; - -typedef struct { - a_uint16_t mru; /* Maximum Receive Unit*/ - a_uint16_t mtu; /* Maximum Transmission Unit*/ - a_bool_t ttl_dec_bypass_en; /* Bypass TTL Decrement enable*/ - a_bool_t ipv4_uc_route_en; /*0 for disble and 1 for enable*/ - a_bool_t ipv6_uc_route_en; /*0 for disble and 1 for enable*/ - a_bool_t icmp_trigger_en; /* ICMP trigger flag enable*/ - fal_fwd_cmd_t ttl_exceed_action; /*action for ttl 0*/ - a_bool_t ttl_exceed_deacclr_en; /*0 for disble and 1 for enable*/ - a_uint8_t mac_addr_bitmap; /* bitmap for mac address*/ - fal_mac_addr_t mac_addr; /* mac address */ - fal_ip_counter_t counter; /* interface related counter */ -} fal_intf_entry_t; - -typedef struct -{ - a_bool_t l3_if_valid; /*0 for disable and 1 for enable*/ - a_uint32_t l3_if_index; /*index for interface table*/ -} fal_intf_id_t; - -typedef enum -{ - FAL_NEXTHOP_L3 = 0, - FAL_NEXTHOP_VP, -} fal_nexthop_type_t; - -typedef struct -{ - fal_nexthop_type_t type; /* 0: L3 1:port*/ - a_uint8_t vsi; /* output vsi value if type is 0 */ - fal_port_t port; /* destination port */ - a_uint32_t if_index; /* egress interface index */ - a_bool_t ip_to_me_en; /* 0 for disable and 1 for enable*/ - a_uint8_t pub_ip_index; /*index to public ip address*/ - a_uint8_t stag_fmt; /* 0: untag 1:tagged*/ - a_uint16_t svid; /*svlan id*/ - a_int8_t ctag_fmt; /* 0: untag 1:tagged*/ - a_uint16_t cvid; /* cvlan id */ - fal_mac_addr_t mac_addr; /* mac address */ - fal_ip4_addr_t dnat_ip; /*dnat ip address*/ -} fal_ip_nexthop_t; - -typedef struct -{ - a_bool_t ipv4_sg_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t ipv4_sg_vio_action; /* check fail action for ipv4 source guard */ - a_bool_t ipv4_sg_port_en; /* source port based ipv4 source guard enable */ - a_bool_t ipv4_sg_svlan_en; /* source svlan based ipv4 source guard enable */ - a_bool_t ipv4_sg_cvlan_en; /* source cvlan based ipv4 source guard enable */ - fal_fwd_cmd_t ipv4_src_unk_action; /* unknown action for ipv4 source guard */ - a_bool_t ipv6_sg_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t ipv6_sg_vio_action; /* check fail action for ipv6 source guard */ - a_bool_t ipv6_sg_port_en; /* source port based ipv6 source guard enable */ - a_bool_t ipv6_sg_svlan_en; /* source svlan based ipv6 source guard enable */ - a_bool_t ipv6_sg_cvlan_en; /* source cvlan based ipv6 source guard enable */ - fal_fwd_cmd_t ipv6_src_unk_action; /* unknown action for ipv6 source guard */ -} fal_sg_cfg_t; - -typedef struct -{ - fal_ip4_addr_t pub_ip_addr; /*public ip address*/ -} fal_ip_pub_addr_t; - -typedef struct { - a_bool_t valid; /* valid flag */ - fal_mac_addr_t mac_addr; /* mac address */ -} fal_macaddr_entry_t; - -typedef struct -{ - fal_fwd_cmd_t mru_fail_action; /*mru check fail action*/ - a_bool_t mru_deacclr_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t mtu_fail_action; /*mtu check fail action*/ - a_bool_t mtu_deacclr_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t mtu_nonfrag_fail_action; /*mtu check fail action for non-fragment */ - a_bool_t mtu_df_deacclr_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t prefix_bc_action; /*0 forward, 1 drop, 2 copy, 3 rdt_cpu*/ - a_bool_t prefix_deacclr_en; /*0 for disable and 1 for enable*/ - fal_fwd_cmd_t icmp_rdt_action; /*0 forward, 1 drop, 2 copy, 3 rdt_cpu*/ - a_bool_t icmp_rdt_deacclr_en; /*0 for disable and 1 for enable*/ - a_uint8_t hash_mode_0; /*0 crc10, 1 xor, 2 crc16*/ - a_uint8_t hash_mode_1; /*0 crc10, 1 xor, 2 crc16*/ -} fal_ip_global_cfg_t; - -enum { - FUNC_IP_NETWORK_ROUTE_GET = 0, - FUNC_IP_HOST_ADD, - FUNC_IP_VSI_SG_CFG_GET, - FUNC_IP_PUB_ADDR_SET, - FUNC_IP_PORT_SG_CFG_SET, - FUNC_IP_PORT_INTF_GET, - FUNC_IP_VSI_ARP_SG_CFG_SET, - FUNC_IP_PUB_ADDR_GET, - FUNC_IP_PORT_INTF_SET, - FUNC_IP_VSI_SG_CFG_SET, - FUNC_IP_HOST_NEXT, - FUNC_IP_PORT_MACADDR_SET, - FUNC_IP_VSI_INTF_GET, - FUNC_IP_NETWORK_ROUTE_ADD, - FUNC_IP_PORT_SG_CFG_GET, - FUNC_IP_INTF_GET, - FUNC_IP_NETWORK_ROUTE_DEL, - FUNC_IP_HOST_DEL, - FUNC_IP_ROUTE_MISMATCH_GET, - FUNC_IP_VSI_ARP_SG_CFG_GET, - FUNC_IP_PORT_ARP_SG_CFG_SET, - FUNC_IP_VSI_MC_MODE_SET, - FUNC_IP_VSI_INTF_SET, - FUNC_IP_NEXTHOP_GET, - FUNC_IP_ROUTE_MISMATCH_SET, - FUNC_IP_HOST_GET, - FUNC_IP_INTF_SET, - FUNC_IP_VSI_MC_MODE_GET, - FUNC_IP_PORT_MACADDR_GET, - FUNC_IP_PORT_ARP_SG_CFG_GET, - FUNC_IP_NEXTHOP_SET, - FUNC_IP_GLOBAL_CTRL_GET, - FUNC_IP_GLOBAL_CTRL_SET, -}; - - sw_error_t - fal_ip_host_add(a_uint32_t dev_id, fal_host_entry_t * host_entry); - - sw_error_t - fal_ip_host_del(a_uint32_t dev_id, a_uint32_t del_mode, - fal_host_entry_t * host_entry); - - sw_error_t - fal_ip_host_get(a_uint32_t dev_id, a_uint32_t get_mode, - fal_host_entry_t * host_entry); - - sw_error_t - fal_ip_host_next(a_uint32_t dev_id, a_uint32_t next_mode, - fal_host_entry_t * host_entry); - - sw_error_t - fal_ip_host_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id, - a_uint32_t cnt_id, a_bool_t enable); - - sw_error_t - fal_ip_host_pppoe_bind(a_uint32_t dev_id, a_uint32_t entry_id, - a_uint32_t pppoe_id, a_bool_t enable); - - sw_error_t - fal_ip_pt_arp_learn_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t flags); - - sw_error_t - fal_ip_pt_arp_learn_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * flags); - - sw_error_t - fal_ip_arp_learn_set(a_uint32_t dev_id, fal_arp_learn_mode_t mode); - - sw_error_t - fal_ip_arp_learn_get(a_uint32_t dev_id, fal_arp_learn_mode_t * mode); - - sw_error_t - fal_ip_source_guard_set(a_uint32_t dev_id, fal_port_t port_id, - fal_source_guard_mode_t mode); - - sw_error_t - fal_ip_source_guard_get(a_uint32_t dev_id, fal_port_t port_id, - fal_source_guard_mode_t * mode); - - sw_error_t - fal_ip_arp_guard_set(a_uint32_t dev_id, fal_port_t port_id, - fal_source_guard_mode_t mode); - - sw_error_t - fal_ip_arp_guard_get(a_uint32_t dev_id, fal_port_t port_id, - fal_source_guard_mode_t * mode); - - sw_error_t - fal_ip_route_status_set(a_uint32_t dev_id, a_bool_t enable); - - sw_error_t - fal_ip_route_status_get(a_uint32_t dev_id, a_bool_t * enable); - - sw_error_t - fal_ip_intf_entry_add(a_uint32_t dev_id, fal_intf_mac_entry_t * entry); - - sw_error_t - fal_ip_intf_entry_del(a_uint32_t dev_id, a_uint32_t del_mode, - fal_intf_mac_entry_t * entry); - - sw_error_t - fal_ip_intf_entry_next(a_uint32_t dev_id, a_uint32_t next_mode, - fal_intf_mac_entry_t * entry); - - sw_error_t - fal_ip_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd); - - sw_error_t - fal_ip_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd); - - sw_error_t - fal_arp_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd); - - sw_error_t - fal_arp_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd); - - sw_error_t - fal_ip_age_time_set(a_uint32_t dev_id, a_uint32_t * time); - - sw_error_t - fal_ip_age_time_get(a_uint32_t dev_id, a_uint32_t * time); - - sw_error_t - fal_ip_wcmp_entry_set(a_uint32_t dev_id, a_uint32_t wcmp_id, fal_ip_wcmp_t * wcmp); - - sw_error_t - fal_ip_wcmp_entry_get(a_uint32_t dev_id, a_uint32_t wcmp_id, fal_ip_wcmp_t * wcmp); - - sw_error_t - fal_ip_wcmp_hash_mode_set(a_uint32_t dev_id, a_uint32_t hash_mode); - - sw_error_t - fal_ip_rfs_ip4_rule_set(a_uint32_t dev_id, fal_ip4_rfs_t * rfs); - - sw_error_t - fal_ip_rfs_ip6_rule_set(a_uint32_t dev_id, fal_ip6_rfs_t * rfs); - - sw_error_t - fal_ip_rfs_ip4_rule_del(a_uint32_t dev_id, fal_ip4_rfs_t * rfs); - - sw_error_t - fal_ip_rfs_ip6_rule_del(a_uint32_t dev_id, fal_ip6_rfs_t * rfs); - - sw_error_t - fal_ip_wcmp_hash_mode_get(a_uint32_t dev_id, a_uint32_t * hash_mode); - - sw_error_t - fal_ip_vrf_base_addr_set(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t addr); - - sw_error_t - fal_ip_vrf_base_addr_get(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t * addr); - - sw_error_t - fal_ip_vrf_base_mask_set(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t addr); - - sw_error_t - fal_ip_vrf_base_mask_get(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t * addr); - - sw_error_t - fal_ip_default_route_set(a_uint32_t dev_id, a_uint32_t droute_id, - fal_default_route_t * entry); - - sw_error_t - fal_ip_default_route_get(a_uint32_t dev_id, a_uint32_t droute_id, - fal_default_route_t * entry); - - sw_error_t - fal_ip_host_route_set(a_uint32_t dev_id, a_uint32_t hroute_id, - fal_host_route_t * entry); - - sw_error_t - fal_ip_host_route_get(a_uint32_t dev_id, a_uint32_t hroute_id, - fal_host_route_t * entry); - - sw_error_t - fal_ip_wcmp_entry_set(a_uint32_t dev_id, a_uint32_t wcmp_id, - fal_ip_wcmp_t * wcmp); - - sw_error_t - fal_ip_wcmp_entry_get(a_uint32_t dev_id, a_uint32_t wcmp_id, - fal_ip_wcmp_t * wcmp); - - sw_error_t - fal_default_flow_cmd_set(a_uint32_t dev_id, a_uint32_t vrf_id, - fal_flow_type_t type, fal_default_flow_cmd_t cmd); - - sw_error_t - fal_default_flow_cmd_get(a_uint32_t dev_id, a_uint32_t vrf_id, - fal_flow_type_t type, fal_default_flow_cmd_t * cmd); - - sw_error_t - fal_default_rt_flow_cmd_set(a_uint32_t dev_id, a_uint32_t vrf_id, - fal_flow_type_t type, fal_default_flow_cmd_t cmd); - - sw_error_t - fal_default_rt_flow_cmd_get(a_uint32_t dev_id, a_uint32_t vrf_id, - fal_flow_type_t type, fal_default_flow_cmd_t * cmd); - -sw_error_t -fal_ip_vsi_arp_sg_cfg_get(a_uint32_t dev_id, a_uint32_t vsi, - fal_arp_sg_cfg_t *arp_sg_cfg); - -sw_error_t -fal_ip_vsi_arp_sg_cfg_set(a_uint32_t dev_id, a_uint32_t vsi, - fal_arp_sg_cfg_t *arp_sg_cfg); - -sw_error_t -fal_ip_network_route_add(a_uint32_t dev_id, a_uint32_t index, - fal_network_route_entry_t *entry); - -sw_error_t -fal_ip_network_route_get(a_uint32_t dev_id, - a_uint32_t index, a_uint8_t type, - fal_network_route_entry_t *entry); - -sw_error_t -fal_ip_network_route_del(a_uint32_t dev_id, - a_uint32_t index, a_uint8_t type); - -sw_error_t -fal_ip_intf_set(a_uint32_t dev_id, - a_uint32_t index, - fal_intf_entry_t *entry); - -sw_error_t -fal_ip_intf_get(a_uint32_t dev_id, - a_uint32_t index, - fal_intf_entry_t *entry); - -sw_error_t -fal_ip_vsi_intf_set(a_uint32_t dev_id, a_uint32_t vsi, fal_intf_id_t *id); - -sw_error_t -fal_ip_vsi_intf_get(a_uint32_t dev_id, a_uint32_t vsi, fal_intf_id_t *id); - -sw_error_t -fal_ip_port_intf_set(a_uint32_t dev_id, fal_port_t port_id, fal_intf_id_t *id); - -sw_error_t -fal_ip_port_intf_get(a_uint32_t dev_id, fal_port_t port_id, fal_intf_id_t *id); - -sw_error_t -fal_ip_nexthop_set(a_uint32_t dev_id, a_uint32_t index, - fal_ip_nexthop_t *entry); - -sw_error_t -fal_ip_nexthop_get(a_uint32_t dev_id, a_uint32_t index, - fal_ip_nexthop_t *entry); - -sw_error_t -fal_ip_vsi_sg_cfg_get(a_uint32_t dev_id, a_uint32_t vsi, - fal_sg_cfg_t *sg_cfg); - -sw_error_t -fal_ip_vsi_sg_cfg_set(a_uint32_t dev_id, a_uint32_t vsi, - fal_sg_cfg_t *sg_cfg); - -sw_error_t -fal_ip_port_sg_cfg_set(a_uint32_t dev_id, fal_port_t port_id, - fal_sg_cfg_t *sg_cfg); - -sw_error_t -fal_ip_port_sg_cfg_get(a_uint32_t dev_id, fal_port_t port_id, - fal_sg_cfg_t *sg_cfg); - -sw_error_t -fal_ip_pub_addr_set(a_uint32_t dev_id, a_uint32_t index, - fal_ip_pub_addr_t *entry); - -sw_error_t -fal_ip_pub_addr_get(a_uint32_t dev_id, a_uint32_t index, - fal_ip_pub_addr_t *entry); - -sw_error_t -fal_ip_port_macaddr_set(a_uint32_t dev_id, fal_port_t port_id, - fal_macaddr_entry_t *macaddr); - -sw_error_t -fal_ip_port_macaddr_get(a_uint32_t dev_id, fal_port_t port_id, - fal_macaddr_entry_t *macaddr); - -sw_error_t -fal_ip_route_mismatch_action_set(a_uint32_t dev_id, fal_fwd_cmd_t action); - -sw_error_t -fal_ip_route_mismatch_action_get(a_uint32_t dev_id, fal_fwd_cmd_t *action); - -sw_error_t -fal_ip_port_arp_sg_cfg_set(a_uint32_t dev_id, fal_port_t port_id, - fal_arp_sg_cfg_t *arp_sg_cfg); - -sw_error_t -fal_ip_port_arp_sg_cfg_get(a_uint32_t dev_id, fal_port_t port_id, - fal_arp_sg_cfg_t *arp_sg_cfg); - -sw_error_t -fal_ip_vsi_mc_mode_set(a_uint32_t dev_id, a_uint32_t vsi, - fal_mc_mode_cfg_t *cfg); - -sw_error_t -fal_ip_vsi_mc_mode_get(a_uint32_t dev_id, a_uint32_t vsi, - fal_mc_mode_cfg_t *cfg); - -sw_error_t -fal_ip_global_ctrl_get(a_uint32_t dev_id, fal_ip_global_cfg_t *cfg); - -sw_error_t -fal_ip_global_ctrl_set(a_uint32_t dev_id, fal_ip_global_cfg_t *cfg); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_IP_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_leaky.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_leaky.h deleted file mode 100755 index 255eac486..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_leaky.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_leaky FAL_LEAKY - * @{ - */ -#ifndef _FAL_LEAKY_H_ -#define _FAL_LEAKY_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - /** - @brief This enum defines the leaky control mode. - */ - typedef enum { - FAL_LEAKY_PORT_CTRL = 0, /**< control leaky through port which packets received*/ - FAL_LEAKY_FDB_CTRL, /**< control leaky through fdb entry*/ - FAL_LEAKY_CTRL_MODE_BUTT - } - fal_leaky_ctrl_mode_t; - - - - sw_error_t - fal_uc_leaky_mode_set(a_uint32_t dev_id, - fal_leaky_ctrl_mode_t ctrl_mode); - - - - sw_error_t - fal_uc_leaky_mode_get(a_uint32_t dev_id, - fal_leaky_ctrl_mode_t * ctrl_mode); - - - - sw_error_t - fal_mc_leaky_mode_set(a_uint32_t dev_id, - fal_leaky_ctrl_mode_t ctrl_mode); - - - - sw_error_t - fal_mc_leaky_mode_get(a_uint32_t dev_id, - fal_leaky_ctrl_mode_t * ctrl_mode); - - - - sw_error_t - fal_port_arp_leaky_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable); - - - - sw_error_t - fal_port_arp_leaky_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); - - - - sw_error_t - fal_port_uc_leaky_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable); - - - - sw_error_t - fal_port_uc_leaky_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); - - - - sw_error_t - fal_port_mc_leaky_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable); - - - - sw_error_t - fal_port_mc_leaky_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_LEAKY_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_led.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_led.h deleted file mode 100644 index e0c78aa3d..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_led.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2014,2020 The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_led FAL_LED - * @{ - */ -#ifndef _FAL_LED_H_ -#define _FAL_LED_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - /** - @brief This enum defines the led group. - */ - typedef enum { - LED_LAN_PORT_GROUP = 0, /**< control lan ports*/ - LED_WAN_PORT_GROUP, /**< control wan ports*/ - LED_MAC_PORT_GROUP, /**< control mac ports*/ - LED_GROUP_BUTT - } - led_pattern_group_t; - - /** - @brief This enum defines the led pattern id, each ports has three led - and pattern0 relates to led0, pattern1 relates to led1, pattern2 relates to led2. - */ - typedef a_uint32_t led_pattern_id_t; - - - /** - @brief This enum defines the led control pattern mode. - */ - typedef enum - { - LED_ALWAYS_OFF = 0, - LED_ALWAYS_BLINK, - LED_ALWAYS_ON, - LED_PATTERN_MAP_EN, - LED_PATTERN_MODE_BUTT - } led_pattern_mode_t; - - -#define FULL_DUPLEX_LIGHT_EN 0 -#define HALF_DUPLEX_LIGHT_EN 1 -#define POWER_ON_LIGHT_EN 2 -#define LINK_1000M_LIGHT_EN 3 -#define LINK_100M_LIGHT_EN 4 -#define LINK_10M_LIGHT_EN 5 -#define COLLISION_BLINK_EN 6 -#define RX_TRAFFIC_BLINK_EN 7 -#define TX_TRAFFIC_BLINK_EN 8 -#define LINKUP_OVERRIDE_EN 9 -#define LED_ACTIVE_HIGH 10 -#define LINK_2500M_LIGHT_EN 11 - - - /** - @brief This enum defines the led control pattern map. - */ - typedef a_uint32_t led_pattern_map_t; - - - /** - @brief This enum defines the led control pattern mode. - */ - typedef enum - { - LED_BLINK_2HZ = 0, - LED_BLINK_4HZ, - LED_BLINK_8HZ, - LED_BLINK_TXRX, /**< Frequency relates to speed, 1000M-8HZ,100M->4HZ,10M->2HZ,Others->4HZ */ - LED_BLINK_FREQ_BUTT - } led_blink_freq_t; - - - typedef struct - { - led_pattern_mode_t mode; - led_pattern_map_t map; - led_blink_freq_t freq; - } led_ctrl_pattern_t; - - - - - - sw_error_t - fal_led_ctrl_pattern_set(a_uint32_t dev_id, led_pattern_group_t group, - led_pattern_id_t id, led_ctrl_pattern_t * pattern); - - - - sw_error_t - fal_led_ctrl_pattern_get(a_uint32_t dev_id, led_pattern_group_t group, - led_pattern_id_t id, led_ctrl_pattern_t * pattern); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_LED_H_ */ -/** - * @} - */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_mib.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_mib.h deleted file mode 100755 index aa6e354c4..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_mib.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_mib FAL_MIB - * @{ - */ -#ifndef _FAL_MIB_H -#define _FAL_MIB_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - /**@brief This structure defines the mib infomation. - */ - typedef struct - { - a_uint32_t RxBroad; - a_uint32_t RxPause; - a_uint32_t RxMulti; - a_uint32_t RxFcsErr; - a_uint32_t RxAllignErr; - a_uint32_t RxRunt; - a_uint32_t RxFragment; - a_uint32_t Rx64Byte; - a_uint32_t Rx128Byte; - a_uint32_t Rx256Byte; - a_uint32_t Rx512Byte; - a_uint32_t Rx1024Byte; - a_uint32_t Rx1518Byte; - a_uint32_t RxMaxByte; - a_uint32_t RxTooLong; - a_uint32_t RxGoodByte_lo; /**< low 32 bits of RxGoodByte statistc item */ - a_uint32_t RxGoodByte_hi; /**< high 32 bits of RxGoodByte statistc item*/ - a_uint32_t RxBadByte_lo; /**< low 32 bits of RxBadByte statistc item */ - a_uint32_t RxBadByte_hi; /**< high 32 bits of RxBadByte statistc item */ - a_uint32_t RxOverFlow; - a_uint32_t Filtered; - a_uint32_t TxBroad; - a_uint32_t TxPause; - a_uint32_t TxMulti; - a_uint32_t TxUnderRun; - a_uint32_t Tx64Byte; - a_uint32_t Tx128Byte; - a_uint32_t Tx256Byte; - a_uint32_t Tx512Byte; - a_uint32_t Tx1024Byte; - a_uint32_t Tx1518Byte; - a_uint32_t TxMaxByte; - a_uint32_t TxOverSize; - a_uint32_t TxByte_lo; /**< low 32 bits of TxByte statistc item */ - a_uint32_t TxByte_hi; /**< high 32 bits of TxByte statistc item */ - a_uint32_t TxCollision; - a_uint32_t TxAbortCol; - a_uint32_t TxMultiCol; - a_uint32_t TxSingalCol; - a_uint32_t TxExcDefer; - a_uint32_t TxDefer; - a_uint32_t TxLateCol; - a_uint32_t RxUniCast; - a_uint32_t TxUniCast; - a_uint32_t RxJumboFcsErr; /* add for Hawkeye*/ - a_uint32_t RxJumboAligenErr; /* add for Hawkeye*/ - a_uint32_t Rx14To63; /*add for ipq60xx lpbk port*/ - a_uint32_t RxTooLongByte_lo; /*add for ipq60xx lpbk port*/ - a_uint32_t RxTooLongByte_hi; /*add for ipq60xx lpbk port*/ - a_uint32_t RxRuntByte_lo; /*add for ipq60xx lpbk port*/ - a_uint32_t RxRuntByte_hi; /*add for ipq60xx lpbk port*/ - } fal_mib_info_t; - -/*define structure for software with 64bit*/ -typedef struct -{ - a_uint64_t RxBroad; - a_uint64_t RxPause; - a_uint64_t RxMulti; - a_uint64_t RxFcsErr; - a_uint64_t RxAllignErr; - a_uint64_t RxRunt; - a_uint64_t RxFragment; - a_uint64_t Rx64Byte; - a_uint64_t Rx128Byte; - a_uint64_t Rx256Byte; - a_uint64_t Rx512Byte; - a_uint64_t Rx1024Byte; - a_uint64_t Rx1518Byte; - a_uint64_t RxMaxByte; - a_uint64_t RxTooLong; - a_uint64_t RxGoodByte; - a_uint64_t RxBadByte; - a_uint64_t RxOverFlow; /* no this counter for Hawkeye*/ - a_uint64_t Filtered; /*no this counter for Hawkeye*/ - a_uint64_t TxBroad; - a_uint64_t TxPause; - a_uint64_t TxMulti; - a_uint64_t TxUnderRun; - a_uint64_t Tx64Byte; - a_uint64_t Tx128Byte; - a_uint64_t Tx256Byte; - a_uint64_t Tx512Byte; - a_uint64_t Tx1024Byte; - a_uint64_t Tx1518Byte; - a_uint64_t TxMaxByte; - a_uint64_t TxOverSize; /*no this counter for Hawkeye*/ - a_uint64_t TxByte; - a_uint64_t TxCollision; - a_uint64_t TxAbortCol; - a_uint64_t TxMultiCol; - a_uint64_t TxSingalCol; - a_uint64_t TxExcDefer; - a_uint64_t TxDefer; - a_uint64_t TxLateCol; - a_uint64_t RxUniCast; - a_uint64_t TxUniCast; - a_uint64_t RxJumboFcsErr; /* add for Hawkeye*/ - a_uint64_t RxJumboAligenErr; /* add for Hawkeye*/ - a_uint64_t Rx14To63; /*add for ipq60xx lpbk port*/ - a_uint64_t RxTooLongByte; /*add for ipq60xx lpbk port*/ - a_uint64_t RxRuntByte; /*add for ipq60xx lpbk port*/ -} fal_mib_counter_t; - -typedef struct -{ - a_uint64_t RxFrame; - a_uint64_t RxByte; - a_uint64_t RxByteGood; - a_uint64_t RxBroadGood; - a_uint64_t RxMultiGood; - a_uint64_t RxFcsErr; - a_uint64_t RxRuntErr; - a_uint64_t RxJabberError; - a_uint64_t RxUndersizeGood; - a_uint64_t RxOversizeGood; - a_uint64_t Rx64Byte; - a_uint64_t Rx128Byte; - a_uint64_t Rx256Byte; - a_uint64_t Rx512Byte; - a_uint64_t Rx1024Byte; - a_uint64_t RxMaxByte; - a_uint64_t RxUnicastGood; - a_uint64_t RxLengthError; - a_uint64_t RxOutOfRangeError; - a_uint64_t RxPause; - a_uint64_t RxOverFlow; - a_uint64_t RxVLANFrameGoodBad; - a_uint64_t RxWatchDogError; - a_uint64_t RxLPIUsec; - a_uint64_t RxLPITran; - a_uint64_t RxDropFrameGoodBad; - a_uint64_t RxDropByteGoodBad; - - a_uint64_t TxByte; - a_uint64_t TxFrame; - a_uint64_t TxBroadGood; - a_uint64_t TxMultiGood; - a_uint64_t Tx64Byte; - a_uint64_t Tx128Byte; - a_uint64_t Tx256Byte; - a_uint64_t Tx512Byte; - a_uint64_t Tx1024Byte; - a_uint64_t TxMaxByte; - a_uint64_t TxUnicast; - a_uint64_t TxMulti; - a_uint64_t TxBroad; - a_uint64_t TxUnderFlowError; - a_uint64_t TxByteGood; - a_uint64_t TxFrameGood; - a_uint64_t TxPause; - a_uint64_t TxVLANFrameGood; - a_uint64_t TxLPIUsec; - a_uint64_t TxLPITran; -} fal_xgmib_info_t; - - enum - { - /*mib*/ - FUNC_GET_MIB_INFO = 0 , - FUNC_GET_RX_MIB_INFO, - FUNC_GET_TX_MIB_INFO, - FUNC_GET_XGMIB_INFO, - FUNC_GET_TX_XGMIB_INFO, - FUNC_GET_RX_XGMIB_INFO, - FUNC_MIB_STATUS_SET, - FUNC_MIB_STATUS_GET, - FUNC_MIB_PORT_FLUSH_COUNTERS, - FUNC_MIB_CPUKEEP_SET, - FUNC_MIB_CPUKEEP_GET, - }; - - sw_error_t - fal_get_mib_info(a_uint32_t dev_id, fal_port_t port_id, - fal_mib_info_t * mib_info ); - - sw_error_t - fal_get_xgmib_info(a_uint32_t dev_id, fal_port_t port_id, - fal_xgmib_info_t * mib_Info); - - - sw_error_t - fal_mib_status_set(a_uint32_t dev_id, a_bool_t enable); - - - - sw_error_t - fal_mib_status_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_mib_port_flush_counters(a_uint32_t dev_id, fal_port_t port_id); - - - sw_error_t - fal_mib_cpukeep_set(a_uint32_t dev_id, a_bool_t enable); - - sw_error_t - fal_mib_cpukeep_get(a_uint32_t dev_id, a_bool_t * enable); - -sw_error_t -fal_mib_counter_get(a_uint32_t dev_id, fal_port_t port_id, - fal_mib_counter_t *mib_counter); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _FAL_MIB_H */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_mirror.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_mirror.h deleted file mode 100755 index 498bf86fc..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_mirror.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_mirror FAL_MIRROR - * @{ - */ -#ifndef _FAL_MIRROR_H_ -#define _FAL_MIRROR_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - -typedef struct -{ - fal_port_t port_id; - a_uint32_t priority; -} fal_mirr_analysis_config_t; - -typedef enum -{ - FAL_MIRR_INGRESS= 0, - FAL_MIRR_EGRESS, - FAL_MIRR_BOTH, -} fal_mirr_direction_t; - -enum -{ - FUNC_MIRR_ANALYSIS_PORT_SET = 0, - FUNC_MIRR_ANALYSIS_PORT_GET, - FUNC_MIRR_PORT_IN_SET, - FUNC_MIRR_PORT_IN_GET, - FUNC_MIRR_PORT_EG_SET, - FUNC_MIRR_PORT_EG_GET, - FUNC_MIRR_ANALYSIS_CONFIG_SET, - FUNC_MIRR_ANALYSIS_CONFIG_GET, -}; - -sw_error_t -fal_mirr_analysis_port_set(a_uint32_t dev_id, fal_port_t port_id); - -sw_error_t -fal_mirr_analysis_port_get(a_uint32_t dev_id, fal_port_t * port_id); - -sw_error_t -fal_mirr_port_in_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable); -sw_error_t -fal_mirr_port_in_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); -sw_error_t -fal_mirr_port_eg_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable); -sw_error_t -fal_mirr_port_eg_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); - -sw_error_t -fal_mirr_analysis_config_set(a_uint32_t dev_id, fal_mirr_direction_t direction, fal_mirr_analysis_config_t * config); - -sw_error_t -fal_mirr_analysis_config_get(a_uint32_t dev_id, fal_mirr_direction_t direction, fal_mirr_analysis_config_t * config); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _PORT_MIRROR_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_misc.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_misc.h deleted file mode 100755 index e5e40b670..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_misc.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_gen FAL_MISC - * @{ - */ -#ifndef _FAL_MISC_H_ -#define _FAL_MISC_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - - typedef enum - { - FAL_LOOP_CHECK_1MS = 0, - FAL_LOOP_CHECK_10MS, - FAL_LOOP_CHECK_100MS, - FAL_LOOP_CHECK_500MS, - } fal_loop_check_time_t; - - typedef struct - { - a_bool_t rx_counter_en; /* Enable/disable virtual port rx counter */ - a_bool_t vp_uni_tx_counter_en; /* Enable/disable virtual port unicast tx counter */ - a_bool_t port_mc_tx_counter_en; /* Enable/disable physical port multicast tx counter */ - a_bool_t port_tx_counter_en; /* Enable/disable physical port tx counter */ - } fal_counter_en_t; - - sw_error_t - fal_debug_port_counter_enable(a_uint32_t dev_id, fal_port_t port_id, fal_counter_en_t * cnt_en); - - sw_error_t - fal_debug_port_counter_status_get(a_uint32_t dev_id, fal_port_t port_id, fal_counter_en_t * cnt_en); - - /* define switch interrupt type bitmap */ -#define FAL_SWITCH_INTR_LINK_STATUS 0x1 /* up/down/speed/duplex status */ - - sw_error_t fal_arp_status_set(a_uint32_t dev_id, a_bool_t enable); - - - - sw_error_t fal_arp_status_get(a_uint32_t dev_id, a_bool_t * enable); - - - - sw_error_t fal_frame_max_size_set(a_uint32_t dev_id, a_uint32_t size); - - - - sw_error_t fal_frame_max_size_get(a_uint32_t dev_id, a_uint32_t * size); - - - - sw_error_t - fal_port_unk_sa_cmd_set(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t cmd); - - - - sw_error_t - fal_port_unk_sa_cmd_get(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t * cmd); - - - - sw_error_t - fal_port_unk_uc_filter_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable); - - - - sw_error_t - fal_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); - - - - sw_error_t - fal_port_unk_mc_filter_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable); - - - - sw_error_t - fal_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); - - - sw_error_t - fal_port_bc_filter_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable); - - - sw_error_t - fal_port_bc_filter_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable); - - - sw_error_t - fal_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable); - - - - sw_error_t - fal_cpu_port_status_get(a_uint32_t dev_id, a_bool_t * enable); - - - - sw_error_t - fal_bc_to_cpu_port_set(a_uint32_t dev_id, a_bool_t enable); - - - - sw_error_t - fal_bc_to_cpu_port_get(a_uint32_t dev_id, a_bool_t * enable); - - - - sw_error_t - fal_port_dhcp_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - - - sw_error_t - fal_port_dhcp_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable); - - - sw_error_t - fal_arp_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd); - - - sw_error_t - fal_arp_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd); - - - sw_error_t - fal_eapol_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd); - - - sw_error_t - fal_eapol_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd); - - - sw_error_t - fal_eapol_status_set(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t enable); - - sw_error_t - fal_eapol_status_get(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t * enable); - - sw_error_t - fal_ripv1_status_set(a_uint32_t dev_id, a_bool_t enable); - - sw_error_t - fal_ripv1_status_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_port_arp_req_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - - sw_error_t - fal_port_arp_req_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable); - - - sw_error_t - fal_port_arp_ack_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); - - - sw_error_t - fal_port_arp_ack_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable); - - - sw_error_t - fal_intr_mask_set(a_uint32_t dev_id, a_uint32_t intr_mask); - - - sw_error_t - fal_intr_mask_get(a_uint32_t dev_id, a_uint32_t * intr_mask); - - - sw_error_t - fal_intr_status_get(a_uint32_t dev_id, a_uint32_t * intr_status); - - - sw_error_t - fal_intr_status_clear(a_uint32_t dev_id, a_uint32_t intr_status); - - - sw_error_t - fal_intr_port_link_mask_set(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t intr_mask); - - - sw_error_t - fal_intr_port_link_mask_get(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t * intr_mask); - - - sw_error_t - fal_intr_port_link_status_get(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t * intr_mask); - - - sw_error_t - fal_intr_mask_mac_linkchg_set(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t enable); - - - sw_error_t - fal_intr_mask_mac_linkchg_get(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t * enable); - - sw_error_t - fal_intr_status_mac_linkchg_get(a_uint32_t dev_id, fal_pbmp_t *port_bitmap); - - sw_error_t - fal_cpu_vid_en_set(a_uint32_t dev_id, a_bool_t enable); - - sw_error_t - fal_cpu_vid_en_get(a_uint32_t dev_id, a_bool_t * enable); - - sw_error_t - fal_intr_status_mac_linkchg_clear(a_uint32_t dev_id); - - sw_error_t - fal_global_macaddr_set(a_uint32_t dev_id, fal_mac_addr_t * addr); - - sw_error_t - fal_global_macaddr_get(a_uint32_t dev_id, fal_mac_addr_t * addr); - - sw_error_t - fal_lldp_status_set(a_uint32_t dev_id, a_bool_t enable); - - - sw_error_t - fal_lldp_status_get(a_uint32_t dev_id, a_bool_t * enable); - - sw_error_t - fal_frame_crc_reserve_set(a_uint32_t dev_id, a_bool_t enable); - - sw_error_t - fal_frame_crc_reserve_get(a_uint32_t dev_id, a_bool_t * enable); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_MISC_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_multi.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_multi.h deleted file mode 100755 index fb651d0e8..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_multi.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifndef _FAL_MULTI_H_ -#define _FAL_MULTI_H_ - -/*supports 32 entries*/ -#define FAL_IGMP_SG_ENTRY_MAX 32 - -typedef enum -{ - FAL_ADDR_IPV4 = 0, - FAL_ADDR_IPV6 -} fal_addr_type_t; - -typedef struct -{ - fal_addr_type_t type; - union - { - fal_ip4_addr_t ip4_addr; - fal_ip6_addr_t ip6_addr; - } u; -} fal_igmp_sg_addr_t; - -typedef struct -{ - fal_igmp_sg_addr_t source; - fal_igmp_sg_addr_t group; - fal_pbmp_t port_map; - a_uint32_t vlan_id; -} fal_igmp_sg_entry_t; - -//#define MULTI_DEBUG_ -#ifdef MULTI_DEBUG_ -#define MULTI_DEBUG(x...) aos_printk(x) -#else -#define MULTI_DEBUG(x...) -#endif - -#define FAL_ACL_LIST_MULTICAST 55 -#define FAL_MULTICAST_PRI 5 - -#define MULT_ACTION_SET 0 -#define MULT_ACTION_CLEAR 1 - -// static a_uint32_t rule_nr=1; - -typedef struct -{ - a_uint8_t index; //MAX is 32 - fal_igmp_sg_entry_t entry; //Stores the specific ACL rule info -} multi_acl_info_t; - -typedef struct -{ - a_uint8_t cnt; //MAX is 32 - multi_acl_info_t acl_info[FAL_IGMP_SG_ENTRY_MAX]; //Stores the all ACL rule info -} fal_igmp_sg_info_t; - -#endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_nat.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_nat.h deleted file mode 100755 index 9c6991196..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_nat.h +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (c) 2014, 2015, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_nat FAL_NAT - * @{ - */ -#ifndef _FAL_NAT_H_ -#define _FAL_NAT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - -#define FAL_NAT_ENTRY_PROTOCOL_TCP 0x1 -#define FAL_NAT_ENTRY_PROTOCOL_UDP 0x2 -#define FAL_NAT_ENTRY_PROTOCOL_PPTP 0x4 -#define FAL_NAT_ENTRY_PROTOCOL_ANY 0x8 -#define FAL_NAT_ENTRY_TRANS_IPADDR_INDEX 0x10 -#define FAL_NAT_ENTRY_PORT_CHECK 0x20 -#define FAL_NAT_HASH_KEY_PORT 0x40 -#define FAL_NAT_HASH_KEY_IPADDR 0x80 - - - /* NAT entry operation flags */ -#define FAL_NAT_ENTRY_ID_EN 0x1 -#define FAL_NAT_ENTRY_SRC_IPADDR_EN 0x2 -#define FAL_NAT_ENTRY_TRANS_IPADDR_EN 0x4 -#define FAL_NAT_ENTRY_KEY_EN 0x8 -#define FAL_NAT_ENTRY_PUBLIC_IP_EN 0x10 -#define FAL_NAT_ENTRY_SOURCE_IP_EN 0x20 -#define FAL_NAT_ENTRY_AGE_EN 0x40 -#define FAL_NAT_ENTRY_SYNC_EN 0x80 - - - typedef struct - { - a_uint32_t entry_id; - a_uint32_t flags; - a_uint32_t status; - fal_ip4_addr_t src_addr; - fal_ip4_addr_t dst_addr; - a_uint16_t src_port; - a_uint16_t dst_port; - fal_ip4_addr_t trans_addr; - a_uint16_t trans_port; - a_uint16_t rsv; - a_bool_t mirror_en; - a_bool_t counter_en; - a_uint32_t counter_id; - a_uint32_t ingress_packet; - a_uint32_t ingress_byte; - a_uint32_t egress_packet; - a_uint32_t egress_byte; - fal_fwd_cmd_t action; - a_uint32_t load_balance; - a_uint32_t flow_cookie; - a_uint32_t vrf_id; - a_uint32_t aging_sync; - a_bool_t priority_en; - a_uint32_t priority_val; - } fal_napt_entry_t; - - typedef struct - { - a_uint32_t proto; /*1 tcp; 2 udp*/ - fal_ip4_addr_t src_addr; - fal_ip4_addr_t dst_addr; - a_uint16_t src_port; - a_uint16_t dst_port; - a_uint32_t flow_cookie; - } fal_flow_cookie_t; - - typedef struct - { - a_uint32_t proto; /*1 tcp; 2 udp*/ - fal_ip4_addr_t src_addr; - fal_ip4_addr_t dst_addr; - a_uint16_t src_port; - a_uint16_t dst_port; - a_uint8_t load_balance; - } fal_flow_rfs_t; - - typedef struct - { - a_uint32_t entry_id; - a_uint32_t flags; - a_uint32_t status; - fal_ip4_addr_t src_addr; - fal_ip4_addr_t trans_addr; - a_uint16_t port_num; - a_uint16_t port_range; - a_uint32_t slct_idx; - a_bool_t mirror_en; - a_bool_t counter_en; - a_uint32_t counter_id; - a_uint32_t ingress_packet; - a_uint32_t ingress_byte; - a_uint32_t egress_packet; - a_uint32_t egress_byte; - fal_fwd_cmd_t action; - a_uint32_t vrf_id; - } fal_nat_entry_t; - - - typedef enum - { - FAL_NAPT_FULL_CONE = 0, - FAL_NAPT_STRICT_CONE, - FAL_NAPT_PORT_STRICT, - FAL_NAPT_SYNMETRIC, - } fal_napt_mode_t; - - - typedef struct - { - a_uint32_t entry_id; - fal_ip4_addr_t pub_addr; - } fal_nat_pub_addr_t; - - - sw_error_t - fal_nat_add(a_uint32_t dev_id, fal_nat_entry_t * nat_entry); - - - sw_error_t - fal_nat_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_nat_entry_t * nat_entry); - - - sw_error_t - fal_nat_get(a_uint32_t dev_id, a_uint32_t get_mode, fal_nat_entry_t * nat_entry); - - - sw_error_t - fal_nat_next(a_uint32_t dev_id, a_uint32_t get_mode, fal_nat_entry_t * nat_entry); - - - sw_error_t - fal_nat_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id, a_uint32_t cnt_id, a_bool_t enable); - - - sw_error_t - fal_napt_add(a_uint32_t dev_id, fal_napt_entry_t * napt_entry); - - - sw_error_t - fal_napt_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_napt_entry_t * napt_entry); - - - sw_error_t - fal_napt_get(a_uint32_t dev_id, a_uint32_t get_mode, fal_napt_entry_t * napt_entry); - - - sw_error_t - fal_napt_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_napt_entry_t * napt_entry); - - - sw_error_t - fal_napt_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id, a_uint32_t cnt_id, a_bool_t enable); - - - sw_error_t - fal_flow_add(a_uint32_t dev_id, fal_napt_entry_t * napt_entry); - - - sw_error_t - fal_flow_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_napt_entry_t * napt_entry); - - - sw_error_t - fal_flow_get(a_uint32_t dev_id, a_uint32_t get_mode, fal_napt_entry_t * napt_entry); - - - sw_error_t - fal_flow_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_napt_entry_t * napt_entry); - - - sw_error_t - fal_flow_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id, a_uint32_t cnt_id, a_bool_t enable); - - - sw_error_t - fal_nat_status_set(a_uint32_t dev_id, a_bool_t enable); - - - sw_error_t - fal_nat_status_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_nat_hash_mode_set(a_uint32_t dev_id, a_uint32_t mode); - - - sw_error_t - fal_nat_hash_mode_get(a_uint32_t dev_id, a_uint32_t * mode); - - - sw_error_t - fal_napt_status_set(a_uint32_t dev_id, a_bool_t enable); - - - sw_error_t - fal_napt_status_get(a_uint32_t dev_id, a_bool_t * enable); - - - sw_error_t - fal_napt_mode_set(a_uint32_t dev_id, fal_napt_mode_t mode); - - - sw_error_t - fal_napt_mode_get(a_uint32_t dev_id, fal_napt_mode_t * mode); - - - sw_error_t - fal_napt_mode_get(a_uint32_t dev_id, fal_napt_mode_t * mode); - - - sw_error_t - fal_nat_prv_base_addr_set(a_uint32_t dev_id, fal_ip4_addr_t addr); - - - sw_error_t - fal_nat_prv_base_addr_get(a_uint32_t dev_id, fal_ip4_addr_t * addr); - - sw_error_t - fal_nat_prv_base_mask_set(a_uint32_t dev_id, fal_ip4_addr_t addr); - - sw_error_t - fal_nat_prv_base_mask_get(a_uint32_t dev_id, fal_ip4_addr_t * addr); - - - sw_error_t - fal_nat_prv_addr_mode_set(a_uint32_t dev_id, a_bool_t map_en); - - - sw_error_t - fal_nat_prv_addr_mode_get(a_uint32_t dev_id, a_bool_t * map_en); - - - sw_error_t - fal_nat_pub_addr_add(a_uint32_t dev_id, fal_nat_pub_addr_t * entry); - - - sw_error_t - fal_nat_pub_addr_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_nat_pub_addr_t * entry); - - - sw_error_t - fal_nat_pub_addr_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_nat_pub_addr_t * entry); - - - sw_error_t - fal_nat_unk_session_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd); - - - sw_error_t - fal_nat_unk_session_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd); - - sw_error_t - fal_nat_global_set(a_uint32_t dev_id, a_bool_t enable, - a_bool_t sync_cnt_enable, a_uint32_t portbmp); - - sw_error_t - fal_flow_cookie_set(a_uint32_t dev_id, fal_flow_cookie_t * flow_cookie); - - sw_error_t - fal_flow_rfs_set(a_uint32_t dev_id, a_uint8_t action, fal_flow_rfs_t * rfs); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_NAT_H_ */ - -/** - * @} - */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_policer.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_policer.h deleted file mode 100755 index 7a646348f..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_policer.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_policer FAL_POLICER - * @{ - */ -#ifndef _FAL_POLICER_H_ -#define _FAL_POLICER_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - -typedef struct -{ - a_bool_t meter_en; /* meter enable or disable */ - a_bool_t couple_en; /* two buckets coupling enable or disable*/ - a_uint32_t color_mode; /* color aware or color blind */ - a_uint32_t frame_type; /* frame type, bit0:unicast;bit1: unkown unicast;bit2:multicast;bit3: unknown multicast; bit4:broadcast */ - a_uint32_t meter_mode; - a_uint32_t meter_unit; /* 0:byte based; 1:packet based*/ - a_uint32_t cir; /* committed information rate */ - a_uint32_t cbs; /* committed burst size */ - a_uint32_t eir; /* excess information rate */ - a_uint32_t ebs; /* excess burst size */ -} fal_policer_config_t; - -typedef struct -{ - a_bool_t yellow_priority_en; /* yellow traffic internal priority change enable*/ - a_bool_t yellow_drop_priority_en; /* yellow traffic internal drop priority change enable*/ - a_bool_t yellow_pcp_en; /* yellow traffic pcp change enable*/ - a_bool_t yellow_dei_en; /* yellow traffic dei change enable*/ - a_uint32_t yellow_priority; /* yellow traffic internal priority value*/ - a_uint32_t yellow_drop_priority; /* yellow traffic internal drop priority value*/ - a_uint32_t yellow_pcp; /* yellow traffic pcp value*/ - a_uint32_t yellow_dei; /* yellow traffic dei value*/ - fal_fwd_cmd_t red_action; /* red traffic drop or forward*/ - a_bool_t red_priority_en; /* red traffic internal priority change enable*/ - a_bool_t red_drop_priority_en; /* red traffic internal drop priority change enable*/ - a_bool_t red_pcp_en; /* red traffic pcp change enable*/ - a_bool_t red_dei_en; /* red traffic dei change enable*/ - a_uint32_t red_priority; /* red traffic internal priority value*/ - a_uint32_t red_drop_priority; /* red traffic internal drop priority value*/ - a_uint32_t red_pcp; /* red traffic pcp value*/ - a_uint32_t red_dei; /* red traffic dei value*/ -}fal_policer_action_t; - -typedef struct -{ - a_uint32_t green_packet_counter; /*green packet counter */ - a_uint64_t green_byte_counter; /*green byte counter */ - a_uint32_t yellow_packet_counter; /*yellow packet counter */ - a_uint64_t yellow_byte_counter; /*yellow byte counter */ - a_uint32_t red_packet_counter; /*red packet counter */ - a_uint64_t red_byte_counter; /*red byte counter */ -} fal_policer_counter_t; - -typedef struct -{ - a_uint32_t policer_drop_packet_counter; /*drop packet counter by policer*/ - a_uint64_t policer_drop_byte_counter; /*drop byte counter by policer */ - a_uint32_t policer_forward_packet_counter; /*forward packet counter by policer*/ - a_uint64_t policer_forward_byte_counter; /*forward byte counter by policer*/ - a_uint32_t policer_bypass_packet_counter; /*bypass packet counter by policer*/ - a_uint64_t policer_bypass_byte_counter; /*bypass byte counter by policer */ -} fal_policer_global_counter_t; - -enum -{ - FUNC_ADPT_ACL_POLICER_COUNTER_GET = 0, - FUNC_ADPT_PORT_POLICER_COUNTER_GET, - FUNC_ADPT_PORT_COMPENSATION_BYTE_GET, - FUNC_ADPT_PORT_POLICER_ENTRY_GET, - FUNC_ADPT_PORT_POLICER_ENTRY_SET, - FUNC_ADPT_ACL_POLICER_ENTRY_GET, - FUNC_ADPT_ACL_POLICER_ENTRY_SET, - FUNC_ADPT_POLICER_TIME_SLOT_GET, - FUNC_ADPT_PORT_COMPENSATION_BYTE_SET, - FUNC_ADPT_POLICER_TIME_SLOT_SET, - FUNC_ADPT_POLICER_GLOBAL_COUNTER_GET, -}; - - -sw_error_t -fal_port_policer_entry_set(a_uint32_t dev_id, fal_port_t port_id, - fal_policer_config_t *policer, fal_policer_action_t *action); - -sw_error_t -fal_port_policer_entry_get(a_uint32_t dev_id, fal_port_t port_id, - fal_policer_config_t *policer, fal_policer_action_t *atcion); - -sw_error_t -fal_acl_policer_entry_set(a_uint32_t dev_id, a_uint32_t index, - fal_policer_config_t *policer, fal_policer_action_t *action); - -sw_error_t -fal_acl_policer_entry_get(a_uint32_t dev_id, a_uint32_t index, - fal_policer_config_t *policer, fal_policer_action_t *action); - -sw_error_t -fal_port_policer_counter_get(a_uint32_t dev_id, fal_port_t port_id, - fal_policer_counter_t *counter); - -sw_error_t -fal_acl_policer_counter_get(a_uint32_t dev_id, a_uint32_t index, - fal_policer_counter_t *counter); - -sw_error_t -fal_port_policer_compensation_byte_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t length); - -sw_error_t -fal_port_policer_compensation_byte_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t *length); - -sw_error_t -fal_policer_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot); - -sw_error_t -fal_policer_timeslot_get(a_uint32_t dev_id, a_uint32_t *timeslot); - -sw_error_t -fal_policer_global_counter_get(a_uint32_t dev_id, - fal_policer_global_counter_t *counter); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_POLICER_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_port_ctrl.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_port_ctrl.h deleted file mode 100755 index 2b63059df..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_port_ctrl.h +++ /dev/null @@ -1,777 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/*qca808x_start*/ -/** - * @defgroup fal_port_ctrl FAL_PORT_CONTROL - * @{ - */ -#ifndef _FAL_PORTCTRL_H_ -#define _FAL_PORTCTRL_H_ - -#ifdef __cplusplus -extern "c" { -#endif - -#include "sw.h" -#include "fal_type.h" - - typedef enum { - FAL_HALF_DUPLEX = 0, - FAL_FULL_DUPLEX, - FAL_DUPLEX_BUTT = 0xffff - } - fal_port_duplex_t; - - typedef enum - { - FAL_SPEED_10 = 10, - FAL_SPEED_100 = 100, - FAL_SPEED_1000 = 1000, - FAL_SPEED_2500 = 2500, - FAL_SPEED_5000 = 5000, - FAL_SPEED_10000 = 10000, - FAL_SPEED_BUTT = 0xffff, - } fal_port_speed_t; - - typedef enum - { - FAL_CABLE_STATUS_NORMAL = 0, - FAL_CABLE_STATUS_SHORT = 1, - FAL_CABLE_STATUS_OPENED = 2, - FAL_CABLE_STATUS_INVALID = 3, - FAL_CABLE_STATUS_CROSSOVERA = 4, - FAL_CABLE_STATUS_CROSSOVERB = 5, - FAL_CABLE_STATUS_CROSSOVERC = 6, - FAL_CABLE_STATUS_CROSSOVERD = 7, - FAL_CABLE_STATUS_LOW_MISMATCH = 8, - FAL_CABLE_STATUS_HIGH_MISMATCH = 9, - FAL_CABLE_STATUS_BUTT = 0xffff, - } fal_cable_status_t; - -#define FAL_ENABLE 1 -#define FAL_DISABLE 0 -#define FAL_MAX_PORT_NUMBER 8 - -//phy autoneg adv -#define FAL_PHY_ADV_10T_HD 0x01 -#define FAL_PHY_ADV_10T_FD 0x02 -#define FAL_PHY_ADV_100TX_HD 0x04 -#define FAL_PHY_ADV_100TX_FD 0x08 -//#define FAL_PHY_ADV_1000T_HD 0x100 -#define FAL_PHY_ADV_1000T_FD 0x200 -#define FAL_PHY_ADV_1000BX_HD 0x400 -#define FAL_PHY_ADV_1000BX_FD 0x800 -#define FAL_PHY_ADV_2500T_FD 0x1000 -#define FAL_PHY_ADV_5000T_FD 0x2000 -#define FAL_PHY_ADV_10000T_FD 0x4000 - -#define FAL_PHY_ADV_10G_R_FD 0x8000 - -#define FAL_PHY_ADV_FE_SPEED_ALL \ - (FAL_PHY_ADV_10T_HD | FAL_PHY_ADV_10T_FD | FAL_PHY_ADV_100TX_HD |\ - FAL_PHY_ADV_100TX_FD) - -#define FAL_PHY_ADV_GE_SPEED_ALL \ - (FAL_PHY_ADV_10T_HD | FAL_PHY_ADV_10T_FD | FAL_PHY_ADV_100TX_HD |\ - FAL_PHY_ADV_100TX_FD | FAL_PHY_ADV_1000T_FD) - -#define FAL_PHY_ADV_BX_SPEED_ALL \ - (FAL_PHY_ADV_1000BX_HD | FAL_PHY_ADV_1000BX_FD |FAL_PHY_ADV_10G_R_FD) - -#define FAL_PHY_ADV_XGE_SPEED_ALL \ - (FAL_PHY_ADV_2500T_FD | FAL_PHY_ADV_5000T_FD | FAL_PHY_ADV_10000T_FD) - -#define FAL_PHY_ADV_PAUSE 0x10 -#define FAL_PHY_ADV_ASY_PAUSE 0x20 -#define FAL_PHY_FE_ADV_ALL \ - (FAL_PHY_ADV_FE_SPEED_ALL | FAL_PHY_ADV_PAUSE | FAL_PHY_ADV_ASY_PAUSE) -#define FAL_PHY_GE_ADV_ALL \ - (FAL_PHY_ADV_GE_SPEED_ALL | FAL_PHY_ADV_PAUSE | FAL_PHY_ADV_ASY_PAUSE) - -#define FAL_PHY_COMBO_ADV_ALL \ - (FAL_PHY_ADV_BX_SPEED_ALL | FAL_PHY_ADV_GE_SPEED_ALL | FAL_PHY_ADV_XGE_SPEED_ALL |\ - FAL_PHY_ADV_PAUSE | FAL_PHY_ADV_ASY_PAUSE) - -//phy capablity -#define FAL_PHY_AUTONEG_CAPS 0x01 -#define FAL_PHY_100T2_HD_CAPS 0x02 -#define FAL_PHY_100T2_FD_CAPS 0x04 -#define FAL_PHY_10T_HD_CAPS 0x08 -#define FAL_PHY_10T_FD_CAPS 0x10 -#define FAL_PHY_100X_HD_CAPS 0x20 -#define FAL_PHY_100X_FD_CAPS 0x40 -#define FAL_PHY_100T4_CAPS 0x80 -//#define FAL_PHY_1000T_HD_CAPS 0x100 -#define FAL_PHY_1000T_FD_CAPS 0x200 -//#define FAL_PHY_1000X_HD_CAPS 0x400 -#define FAL_PHY_1000X_FD_CAPS 0x800 - -//phy partner capablity -#define FAL_PHY_PART_10T_HD 0x1 -#define FAL_PHY_PART_10T_FD 0x2 -#define FAL_PHY_PART_100TX_HD 0x4 -#define FAL_PHY_PART_100TX_FD 0x8 -//#define FAL_PHY_PART_1000T_HD 0x10 -#define FAL_PHY_PART_1000T_FD 0x20 - -//phy interrupt flag -#define FAL_PHY_INTR_SPEED_CHANGE 0x1 -#define FAL_PHY_INTR_DUPLEX_CHANGE 0x2 -#define FAL_PHY_INTR_STATUS_UP_CHANGE 0x4 -#define FAL_PHY_INTR_STATUS_DOWN_CHANGE 0x8 -#define FAL_PHY_INTR_BX_FX_STATUS_UP_CHANGE 0x10 -#define FAL_PHY_INTR_BX_FX_STATUS_DOWN_CHANGE 0x20 -#define FAL_PHY_INTR_MEDIA_STATUS_CHANGE 0x40 -#define FAL_PHY_INTR_WOL_STATUS 0x80 -#define FAL_PHY_INTR_POE_STATUS 0x100 - - typedef enum - { - FAL_NO_HEADER_EN = 0, - FAL_ONLY_MANAGE_FRAME_EN, - FAL_ALL_TYPE_FRAME_EN - } fal_port_header_mode_t; - - typedef struct - { - a_uint16_t pair_a_status; - a_uint16_t pair_b_status; - a_uint16_t pair_c_status; - a_uint16_t pair_d_status; - a_uint32_t pair_a_len; - a_uint32_t pair_b_len; - a_uint32_t pair_c_len; - a_uint32_t pair_d_len; - } fal_port_cdt_t; - -/*below is new add for malibu phy*/ - -/** Phy mdix mode */ -typedef enum { - PHY_MDIX_AUTO = 0, /**< Auto MDI/MDIX */ - PHY_MDIX_MDI = 1, /**< Fixed MDI */ - PHY_MDIX_MDIX = 2 /**< Fixed MDIX */ -} fal_port_mdix_mode_t; - -/** Phy mdix status */ -typedef enum { - PHY_MDIX_STATUS_MDI = 0, /**< Fixed MDI */ - PHY_MDIX_STATUS_MDIX = 1 /**< Fixed MDIX */ - -} fal_port_mdix_status_t; - -/** Phy master mode */ -typedef enum { - PHY_MASTER_MASTER = 0, /**< Phy manual MASTER configuration */ - PHY_MASTER_SLAVE = 1, /**< Phy manual SLAVE configuration */ - PHY_MASTER_AUTO = 2 /**< Phy automatic MASTER/SLAVE configuration */ -} fal_port_master_t; -/*qca808x_end*/ -/** Phy preferred medium type */ -typedef enum { - PHY_MEDIUM_COPPER = 0, /**< Copper */ - PHY_MEDIUM_FIBER = 1, /**< Fiber */ - -} fal_port_medium_t; - -/** Phy pages */ -typedef enum { - PHY_SGBX_PAGES = 0, /**< sgbx pages */ - PHY_COPPER_PAGES = 1 /**< copper pages */ - -} fal_port_reg_pages_t; - - -/** Phy preferred Fiber mode */ -typedef enum { - PHY_FIBER_100FX = 0, /**< 100FX fiber mode */ - PHY_FIBER_1000BX = 1, /**< 1000BX fiber mode */ - PHY_FIBER_10G_R = 2, /**< 10G-R fiber mode */ - -} fal_port_fiber_mode_t; - -/** Phy reset status */ -typedef enum { - PHY_RESET_DONE = 0, /**< Phy reset done */ - PHY_RESET_BUSY = 1 /**< Phy still in reset process */ -} fal_port_reset_status_t; - -/** Phy auto-negotiation status */ -typedef enum { - PHY_AUTO_NEG_STATUS_BUSY = 0, /**< Phy still in auto-negotiation process */ - PHY_AUTO_NEG_STATUS_DONE = 1 /**< Phy auto-negotiation done */ -} fal_port_auto_neg_status_t; -/*qca808x_start*/ - -/** Phy interface mode */ - typedef enum { - PHY_PSGMII_BASET = 0, - /**< PSGMII mode */ - PHY_PSGMII_BX1000 = 1, - /**< PSGMII BX1000 mode */ - PHY_PSGMII_FX100 = 2, - /**< PSGMII FX100 mode */ - PHY_PSGMII_AMDET = 3, - /**< PSGMII Auto mode */ - PHY_SGMII_BASET = 4, - /**< SGMII mode */ - PORT_QSGMII, - /**>24)&0xff) -#define FAL_PORT_ID_VALUE(port_id) ((port_id)&0xffffff) -#define FAL_PORT_ID(type, value) (((type)<<24)|(value)) - -#define FAL_IS_PPORT(port_id) (((FAL_PORT_ID_TYPE(port_id))==FAL_PORT_TYPE_PPORT)?1:0) -#define FAL_IS_TRUNK(port_id) (((FAL_PORT_ID_TYPE(port_id))==FAL_PORT_TYPE_TRUNK)?1:0) -#define FAL_IS_VPORT(port_id) (((FAL_PORT_ID_TYPE(port_id))==FAL_PORT_TYPE_VPORT)?1:0) - - -#if (SW_MAX_NR_PORT <= 32) - typedef a_uint32_t fal_pbmp_t; -#else - typedef a_uint64_t fal_pbmp_t; -#endif - - typedef struct - { - a_uint8_t uc[6]; - } fal_mac_addr_t; - - typedef a_uint32_t fal_ip4_addr_t; - - typedef struct - { - a_uint32_t ul[4]; - } fal_ip6_addr_t; - - /** - @brief This enum defines several forwarding command type. - * Field description: - FAL_MAC_FRWRD - packets are normally forwarded - FAL_MAC_DROP - packets are dropped - FAL_MAC_CPY_TO_CPU - packets are copyed to cpu - FAL_MAC_RDT_TO_CPU - packets are redirected to cpu - */ - typedef enum - { - FAL_MAC_FRWRD = 0, /**< packets are normally forwarded */ - FAL_MAC_DROP, /**< packets are dropped */ - FAL_MAC_CPY_TO_CPU, /**< packets are copyed to cpu */ - FAL_MAC_RDT_TO_CPU /**< packets are redirected to cpu */ - } fal_fwd_cmd_t; - - typedef enum - { - FAL_BYTE_BASED = 0, - FAL_FRAME_BASED, - FAL_RATE_MODE_BUTT - } fal_traffic_unit_t; - - typedef a_uint32_t fal_queue_t; - -#define FAL_SVL_FID 0xffff - - - /** - @brief This enum defines packets transmitted out vlan tagged mode. - */ - typedef enum - { - FAL_EG_UNMODIFIED = 0, /**< egress transmit packets unmodified */ - FAL_EG_UNTAGGED, /**< egress transmit packets without vlan tag*/ - FAL_EG_TAGGED, /**< egress transmit packets with vlan tag */ - FAL_EG_HYBRID, /**< egress transmit packets in hybrid tag mode */ - FAL_EG_UNTOUCHED, - FAL_EG_MODE_BUTT - } fal_pt_1q_egmode_t; - -#define FAL_NEXT_ENTRY_FIRST_ID 0xffffffff - - typedef struct{ - a_uint32_t reg_count; - a_uint32_t reg_base; - a_uint32_t reg_end; - a_uint32_t reg_value[256]; - a_int8_t reg_name[32]; - }fal_reg_dump_t; - - typedef struct{ - a_uint32_t reg_count; - a_uint32_t reg_addr[32]; - a_uint32_t reg_value[32]; - a_int8_t reg_name[32]; - }fal_debug_reg_dump_t; - - typedef struct{ - a_uint32_t phy_count; - a_uint32_t phy_base; - a_uint32_t phy_end; - a_uint16_t phy_value[256]; - a_int8_t phy_name[32]; - }fal_phy_dump_t; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_TYPE_H_ */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_uk_if.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_uk_if.h deleted file mode 100755 index 18a8bd761..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_uk_if.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014,2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _FAL_UK_IF_H_ -#define _FAL_UK_IF_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "sw.h" -#include "fal_type.h" -#include "ssdk_init.h" - - sw_error_t - sw_uk_exec(a_uint32_t api_id, ...); - - sw_error_t - ssdk_init(a_uint32_t dev_id, ssdk_init_cfg * cfg); - - sw_error_t - ssdk_cleanup(void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_UK_IF_H_ */ - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_vlan.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_vlan.h deleted file mode 100755 index a1397a592..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_vlan.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_vlan FAL_VLAN - * @{ - */ -#ifndef _FAL_VLAN_H -#define _FAL_VLAN_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - - /** - @brief This structure defines vlan entry. - */ - typedef struct - { - a_uint16_t vid; /**< vlan entry id */ - a_uint16_t fid; /**< filter data base id*/ - fal_pbmp_t mem_ports; /**< member port bit map */ - fal_pbmp_t tagged_ports; /**< bit map of tagged infomation for member port*/ - fal_pbmp_t untagged_ports; /**< bit map of untagged infomation for member port*/ - fal_pbmp_t unmodify_ports;/**< bit map of unmodified infomation for member port*/ - fal_pbmp_t u_ports; - a_bool_t learn_dis; /**< disable address learning*/ - a_bool_t vid_pri_en; /**< enable 802.1p*/ - a_uint8_t vid_pri; /**< vlaue of 802.1p when enable vid_pri_en*/ - } fal_vlan_t; - - - sw_error_t - fal_vlan_entry_append(a_uint32_t dev_id, fal_vlan_t * vlan_entry); - - - - sw_error_t - fal_vlan_create(a_uint32_t dev_id, a_uint32_t vlan_id); - - - - sw_error_t - fal_vlan_next(a_uint32_t dev_id, a_uint32_t vlan_id, fal_vlan_t * p_vlan); - - - - sw_error_t - fal_vlan_find(a_uint32_t dev_id, a_uint32_t vlan_id, fal_vlan_t * p_vlan); - - - - sw_error_t - fal_vlan_member_update(a_uint32_t dev_id, a_uint32_t vlan_id, - fal_pbmp_t member, fal_pbmp_t u_member); - - - - sw_error_t - fal_vlan_delete(a_uint32_t dev_id, a_uint32_t vlan_id); - - - - sw_error_t - fal_vlan_reset(a_uint32_t dev_id); - - - sw_error_t - fal_vlan_flush(a_uint32_t dev_id); - - - sw_error_t - fal_vlan_init(a_uint32_t dev_id); - - - sw_error_t - fal_vlan_cleanup(void); - - - sw_error_t - fal_vlan_fid_set(a_uint32_t dev_id, a_uint32_t vlan_id, a_uint32_t fid); - - - sw_error_t - fal_vlan_fid_get(a_uint32_t dev_id, a_uint32_t vlan_id, a_uint32_t * fid); - - - sw_error_t - fal_vlan_member_add(a_uint32_t dev_id, a_uint32_t vlan_id, - fal_port_t port_id, fal_pt_1q_egmode_t port_info); - - - sw_error_t - fal_vlan_member_del(a_uint32_t dev_id, a_uint32_t vlan_id, fal_port_t port_id); - - - sw_error_t - fal_vlan_learning_state_set(a_uint32_t dev_id, a_uint32_t vlan_id, - a_bool_t enable); - - - sw_error_t - fal_vlan_learning_state_get(a_uint32_t dev_id, a_uint32_t vlan_id, - a_bool_t * enable); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _FAL_VLAN_H */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_vsi.h b/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_vsi.h deleted file mode 100755 index c6543be6f..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/fal/fal_vsi.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup fal_stp FAL_VSI - * @{ - */ -#ifndef _FAL_VSI_H_ -#define _FAL_VSI_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "common/sw.h" -#include "fal/fal_type.h" - -#define FAL_VSI_INVALID 0xffff -#define FAL_VLAN_INVALID 0xffff - -typedef struct{ - a_uint32_t lrn_en; /*0: disable new address learn, 1: enable new address learn*/ - fal_fwd_cmd_t action;/*0:forward, 1:drop, 2: copy to CPU, 3: redirect to CPU*/ -}fal_vsi_newaddr_lrn_t; - -typedef struct{ - a_uint32_t stamove_en;/*0:disable station move, 1: enable station move*/ - fal_fwd_cmd_t action;/*0:forward, 1:drop, 2: copy to CPU, 3: redirect to CPU*/ -}fal_vsi_stamove_t; - -typedef struct{ - a_uint32_t member_ports;/*VSI member ports for known unicast and multicast*/ - a_uint32_t uuc_ports;/*VSI member ports for unknown unicast*/ - a_uint32_t umc_ports;/*VSI member ports for unknown multicast*/ - a_uint32_t bc_ports;/*VSI member ports for broadcast*/ -}fal_vsi_member_t; - -typedef struct -{ - a_uint32_t rx_packet_counter; - a_uint64_t rx_byte_counter; - a_uint32_t tx_packet_counter; - a_uint64_t tx_byte_counter; - a_uint32_t fwd_packet_counter; - a_uint64_t fwd_byte_counter; - a_uint32_t drop_packet_counter; - a_uint64_t drop_byte_counter; -}fal_vsi_counter_t; - - -enum{ - FUNC_PORT_VLAN_VSI_SET, - FUNC_PORT_VLAN_VSI_GET, - FUNC_PORT_VSI_SET, - FUNC_PORT_VSI_GET, - FUNC_VSI_STAMOVE_SET, - FUNC_VSI_STAMOVE_GET, - FUNC_VSI_NEWADDR_LRN_SET, - FUNC_VSI_NEWADDR_LRN_GET, - FUNC_VSI_MEMBER_SET, - FUNC_VSI_MEMBER_GET, - FUNC_VSI_COUNTER_GET, - FUNC_VSI_COUNTER_CLEANUP, -}; - -sw_error_t -fal_vsi_alloc(a_uint32_t dev_id, a_uint32_t *vsi); - -sw_error_t -fal_vsi_free(a_uint32_t dev_id, a_uint32_t vsi); - -sw_error_t -fal_port_vsi_set(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t vsi_id); - -sw_error_t -fal_port_vsi_get(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t *vsi_id); - -sw_error_t -fal_port_vlan_vsi_set(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t stag_vid, a_uint32_t ctag_vid, a_uint32_t vsi_id); - -sw_error_t -fal_port_vlan_vsi_get(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t stag_vid, a_uint32_t ctag_vid, a_uint32_t *vsi_id); - -sw_error_t -fal_vsi_tbl_dump(a_uint32_t dev_id); - -sw_error_t -fal_vsi_newaddr_lrn_set(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_newaddr_lrn_t *newaddr_lrn); - -sw_error_t -fal_vsi_newaddr_lrn_get(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_newaddr_lrn_t *newaddr_lrn); - -sw_error_t -fal_vsi_stamove_set(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_stamove_t *stamove); - -sw_error_t -fal_vsi_stamove_get(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_stamove_t *stamove); - -sw_error_t -fal_vsi_member_set(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_member_t *vsi_member); - -sw_error_t -fal_vsi_member_get(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_member_t *vsi_member); - -sw_error_t -fal_vsi_counter_get(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_counter_t *counter); - -sw_error_t -fal_vsi_counter_cleanup(a_uint32_t dev_id, a_uint32_t vsi_id); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _FAL_VSI_H_ */ - -/** - * @} - */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/init/ssdk_init.h b/feeds/ipq807x/qca-ssdk-shell/src/include/init/ssdk_init.h deleted file mode 100755 index de0e27482..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/init/ssdk_init.h +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (c) 2014, 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/*qca808x_start*/ -#ifndef _SSDK_INIT_H_ -#define _SSDK_INIT_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "sw.h" -/*qca808x_end*/ -#include "fal_led.h" - -/*qca808x_start*/ - typedef enum { - HSL_MDIO = 1, - HSL_HEADER, - } - hsl_access_mode; - - typedef enum - { - HSL_NO_CPU = 0, - HSL_CPU_1, - HSL_CPU_2, - HSL_CPU_1_PLUS, - } hsl_init_mode; - typedef sw_error_t - (*mdio_reg_set) (a_uint32_t dev_id, a_uint32_t phy_addr, a_uint32_t reg, - a_uint16_t data); - - typedef sw_error_t - (*mdio_reg_get) (a_uint32_t dev_id, a_uint32_t phy_addr, a_uint32_t reg, - a_uint16_t * data); - - typedef sw_error_t - (*i2c_reg_set) (a_uint32_t dev_id, a_uint32_t phy_addr, a_uint32_t reg, - a_uint16_t data); - - typedef sw_error_t - (*i2c_reg_get) (a_uint32_t dev_id, a_uint32_t phy_addr, a_uint32_t reg, - a_uint16_t * data); -/*qca808x_end*/ - typedef sw_error_t - (*hdr_reg_set) (a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t *reg_data, a_uint32_t len); - - typedef sw_error_t - (*hdr_reg_get) (a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t *reg_data, a_uint32_t len); - typedef sw_error_t - (*psgmii_reg_set) (a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t *reg_data, a_uint32_t len); - - typedef sw_error_t - (*psgmii_reg_get) (a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t *reg_data, a_uint32_t len); - - typedef sw_error_t - (*uniphy_reg_set) (a_uint32_t dev_id, a_uint32_t index, a_uint32_t reg_addr, a_uint8_t *reg_data, a_uint32_t len); - - typedef sw_error_t - (*uniphy_reg_get) (a_uint32_t dev_id, a_uint32_t index, a_uint32_t reg_addr, a_uint8_t *reg_data, a_uint32_t len); - - typedef void (*mii_reg_set)(a_uint32_t reg, a_uint32_t val); - - typedef a_uint32_t (*mii_reg_get)(a_uint32_t reg); -/*qca808x_start*/ - typedef struct - { - mdio_reg_set mdio_set; - mdio_reg_get mdio_get; -/*qca808x_end*/ - hdr_reg_set header_reg_set; - hdr_reg_get header_reg_get; - psgmii_reg_set psgmii_reg_set; - psgmii_reg_get psgmii_reg_get; - uniphy_reg_set uniphy_reg_set; - uniphy_reg_get uniphy_reg_get; - mii_reg_set mii_reg_set; - mii_reg_get mii_reg_get; -/*qca808x_start*/ - i2c_reg_set i2c_set; - i2c_reg_get i2c_get; - } hsl_reg_func; -/*qca808x_end*/ - - typedef struct - { - a_bool_t mac0_rgmii; - a_bool_t mac5_rgmii; - a_bool_t rx_delay_s0; - a_bool_t rx_delay_s1; - a_bool_t tx_delay_s0; - a_bool_t tx_delay_s1; - a_bool_t rgmii_rxclk_delay; - a_bool_t rgmii_txclk_delay; - a_bool_t phy4_rx_delay; - a_bool_t phy4_tx_delay; - } garuda_init_spec_cfg; -/*qca808x_start*/ - typedef enum - { - CHIP_UNSPECIFIED = 0, - CHIP_ATHENA, - CHIP_GARUDA, - CHIP_SHIVA, - CHIP_HORUS, - CHIP_ISIS, - CHIP_ISISC, - CHIP_DESS, - CHIP_HPPE, - } ssdk_chip_type; -/*qca808x_end*/ - typedef struct - { - a_uint32_t cpu_bmp; - a_uint32_t lan_bmp; - a_uint32_t wan_bmp; - a_uint32_t inner_bmp; - } ssdk_port_cfg; - - typedef struct - { - a_uint32_t led_num; - a_uint32_t led_source_id; - led_ctrl_pattern_t led_pattern; - - } led_source_cfg_t; -/*qca808x_start*/ -typedef struct -{ - hsl_init_mode cpu_mode; - hsl_access_mode reg_mode; - hsl_reg_func reg_func; - - ssdk_chip_type chip_type; - a_uint32_t chip_revision; - /* os specific parameter */ - /* when uk_if based on netlink, it's netlink protocol type*/ - /* when uk_if based on ioctl, it's minor device number, major number - is always 10(misc device) */ - a_uint32_t nl_prot; - /* chip specific parameter */ - void * chip_spec_cfg; -/*qca808x_end*/ - /* port cfg */ - ssdk_port_cfg port_cfg; - a_uint32_t mac_mode; - a_uint32_t led_source_num; - led_source_cfg_t led_source_cfg[15]; -/*qca808x_start*/ - a_uint32_t phy_id; - a_uint32_t mac_mode1; - a_uint32_t mac_mode2; -} ssdk_init_cfg; -/*qca808x_end*/ -#if defined ATHENA -#define def_init_cfg {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_2}; -#elif defined GARUDA - -#define def_init_cfg_cpu2 {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_2,}; - -#define def_init_spec_cfg_cpu2 {.mac0_rgmii = A_TRUE, .mac5_rgmii = A_TRUE, \ - .rx_delay_s0 = A_FALSE, .rx_delay_s1 = A_FALSE, \ - .tx_delay_s0 = A_TRUE, .tx_delay_s1 = A_FALSE,\ - .rgmii_rxclk_delay = A_TRUE, .rgmii_txclk_delay = A_TRUE,\ - .phy4_rx_delay = A_TRUE, .phy4_tx_delay = A_TRUE,} - -#define def_init_cfg_cpu1 {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_1,}; - -#define def_init_spec_cfg_cpu1 {.mac0_rgmii = A_TRUE, .mac5_rgmii = A_FALSE, \ - .rx_delay_s0 = A_FALSE, .rx_delay_s1 = A_FALSE, \ - .tx_delay_s0 = A_TRUE, .tx_delay_s1 = A_FALSE,\ - .rgmii_rxclk_delay = A_TRUE, .rgmii_txclk_delay = A_TRUE, \ - .phy4_rx_delay = A_TRUE, .phy4_tx_delay = A_TRUE,} - -#define def_init_cfg_cpu1plus {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_1_PLUS,}; - -#define def_init_spec_cfg_cpu1plus {.mac0_rgmii = A_TRUE, .mac5_rgmii = A_FALSE, \ - .rx_delay_s0 = A_FALSE, .rx_delay_s1 = A_FALSE, \ - .tx_delay_s0 = A_FALSE, .tx_delay_s1 = A_FALSE,\ - .rgmii_rxclk_delay = A_TRUE, .rgmii_txclk_delay = A_TRUE, \ - .phy4_rx_delay = A_TRUE, .phy4_tx_delay = A_TRUE,} - -#define def_init_cfg_nocpu {.reg_mode = HSL_MDIO, .cpu_mode = HSL_NO_CPU,}; - -#define def_init_spec_cfg_nocpu { .mac0_rgmii = A_FALSE, .mac5_rgmii = A_FALSE, \ - .rx_delay_s0 = A_FALSE, .rx_delay_s1 = A_FALSE, \ - .tx_delay_s0 = A_FALSE, .tx_delay_s1 = A_FALSE,\ - .rgmii_rxclk_delay = A_TRUE, .rgmii_txclk_delay = A_TRUE, \ - .phy4_rx_delay = A_TRUE, .phy4_tx_delay = A_TRUE,} - -#define def_init_cfg_cpu1_gmii {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_1,}; - -#define def_init_spec_cfg_cpu1_gmii {.mac0_rgmii = A_FALSE, .mac5_rgmii = A_FALSE, \ - .rx_delay_s0 = A_FALSE, .rx_delay_s1 = A_FALSE, \ - .tx_delay_s0 = A_TRUE, .tx_delay_s1 = A_FALSE,\ - .rgmii_rxclk_delay = A_TRUE, .rgmii_txclk_delay = A_TRUE, \ - .phy4_rx_delay = A_TRUE, .phy4_tx_delay = A_TRUE,} - -#define def_init_cfg def_init_cfg_cpu2 -#define def_init_spec_cfg def_init_spec_cfg_cpu2 - -#elif defined SHIVA -#define def_init_cfg {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_2}; -#elif defined HORUS -#define def_init_cfg {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_2}; -#elif defined ISIS -#define def_init_cfg {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_2}; -#elif defined ISISC -/*qca808x_start*/ -#define def_init_cfg {.reg_mode = HSL_MDIO, .cpu_mode = HSL_CPU_2}; -/*qca808x_end*/ -#endif - typedef struct - { - a_bool_t in_acl; - a_bool_t in_fdb; - a_bool_t in_igmp; - a_bool_t in_leaky; - a_bool_t in_led; - a_bool_t in_mib; - a_bool_t in_mirror; - a_bool_t in_misc; - a_bool_t in_portcontrol; - a_bool_t in_portvlan; - a_bool_t in_qos; - a_bool_t in_rate; - a_bool_t in_stp; - a_bool_t in_vlan; - a_bool_t in_reduced_acl; - a_bool_t in_ip; - a_bool_t in_nat; - a_bool_t in_cosmap; - a_bool_t in_sec; - a_bool_t in_trunk; - a_bool_t in_nathelper; - a_bool_t in_interfacectrl; - } ssdk_features; -/*qca808x_start*/ -#define CFG_STR_SIZE 20 - typedef struct - { - a_uint8_t build_ver[CFG_STR_SIZE]; - a_uint8_t build_date[CFG_STR_SIZE]; - - a_uint8_t chip_type[CFG_STR_SIZE]; //GARUDA - a_uint8_t cpu_type[CFG_STR_SIZE]; //mips - a_uint8_t os_info[CFG_STR_SIZE]; //OS=linux OS_VER=2_6 - - a_bool_t fal_mod; - a_bool_t kernel_mode; - a_bool_t uk_if; -/*qca808x_end*/ - ssdk_features features; -/*qca808x_start*/ - ssdk_init_cfg init_cfg; - } ssdk_cfg_t; - sw_error_t - ssdk_init(a_uint32_t dev_id, ssdk_init_cfg *cfg); -/*qca808x_end*/ - sw_error_t - ssdk_hsl_access_mode_set(a_uint32_t dev_id, hsl_access_mode reg_mode); -/*qca808x_start*/ -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _SSDK_INIT_H */ -/*qca808x_end*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/init/ssdk_plat.h b/feeds/ipq807x/qca-ssdk-shell/src/include/init/ssdk_plat.h deleted file mode 100755 index 7cbeaa8b3..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/init/ssdk_plat.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef __SSDK_PLAT_H -#define __SSDK_PLAT_H - -#ifndef BIT -#define BIT(_n) (1UL << (_n)) -#endif - - -#ifndef BITS -#define BITS(_s, _n) (((1UL << (_n)) - 1) << _s) -#endif - -/* Atheros specific MII registers */ -#define QCA_MII_MMD_ADDR 0x0d -#define QCA_MII_MMD_DATA 0x0e -#define QCA_MII_DBG_ADDR 0x1d -#define QCA_MII_DBG_DATA 0x1e - -#define AR8327_REG_CTRL 0x0000 -#define AR8327_CTRL_REVISION BITS(0, 8) -#define AR8327_CTRL_REVISION_S 0 -#define AR8327_CTRL_VERSION BITS(8, 8) -#define AR8327_CTRL_VERSION_S 8 -#define AR8327_CTRL_RESET BIT(31) - -#define AR8327_REG_LED_CTRL_0 0x50 -#define AR8327_REG_LED_CTRL_1 0x54 -#define AR8327_REG_LED_CTRL_2 0x58 -#define AR8327_REG_LED_CTRL_3 0x5c - -#define AR8327_REG_PORT_STATUS(_i) (0x07c + (_i) * 4) - -#define AR8327_PORT_STATUS_SPEED BITS(0,2) -#define AR8327_PORT_STATUS_SPEED_S 0 -#define AR8327_PORT_STATUS_TXMAC BIT(2) -#define AR8327_PORT_STATUS_RXMAC BIT(3) -#define AR8327_PORT_STATUS_TXFLOW BIT(4) -#define AR8327_PORT_STATUS_RXFLOW BIT(5) -#define AR8327_PORT_STATUS_DUPLEX BIT(6) -#define AR8327_PORT_STATUS_LINK_UP BIT(8) -#define AR8327_PORT_STATUS_LINK_AUTO BIT(9) -#define AR8327_PORT_STATUS_LINK_PAUSE BIT(10) - -#define AR8327_REG_PAD0_CTRL 0x4 -#define AR8327_REG_PAD5_CTRL 0x8 -#define AR8327_REG_PAD6_CTRL 0xc -#define AR8327_PAD_CTRL_MAC_MII_RXCLK_SEL BIT(0) -#define AR8327_PAD_CTRL_MAC_MII_TXCLK_SEL BIT(1) -#define AR8327_PAD_CTRL_MAC_MII_EN BIT(2) -#define AR8327_PAD_CTRL_MAC_GMII_RXCLK_SEL BIT(4) -#define AR8327_PAD_CTRL_MAC_GMII_TXCLK_SEL BIT(5) -#define AR8327_PAD_CTRL_MAC_GMII_EN BIT(6) -#define AR8327_PAD_CTRL_SGMII_EN BIT(7) -#define AR8327_PAD_CTRL_PHY_MII_RXCLK_SEL BIT(8) -#define AR8327_PAD_CTRL_PHY_MII_TXCLK_SEL BIT(9) -#define AR8327_PAD_CTRL_PHY_MII_EN BIT(10) -#define AR8327_PAD_CTRL_PHY_GMII_PIPE_RXCLK_SEL BIT(11) -#define AR8327_PAD_CTRL_PHY_GMII_RXCLK_SEL BIT(12) -#define AR8327_PAD_CTRL_PHY_GMII_TXCLK_SEL BIT(13) -#define AR8327_PAD_CTRL_PHY_GMII_EN BIT(14) -#define AR8327_PAD_CTRL_PHYX_GMII_EN BIT(16) -#define AR8327_PAD_CTRL_PHYX_RGMII_EN BIT(17) -#define AR8327_PAD_CTRL_PHYX_MII_EN BIT(18) -#define AR8327_PAD_CTRL_RGMII_RXCLK_DELAY_SEL BITS(20, 2) -#define AR8327_PAD_CTRL_RGMII_RXCLK_DELAY_SEL_S 20 -#define AR8327_PAD_CTRL_RGMII_TXCLK_DELAY_SEL BITS(22, 2) -#define AR8327_PAD_CTRL_RGMII_TXCLK_DELAY_SEL_S 22 -#define AR8327_PAD_CTRL_RGMII_RXCLK_DELAY_EN BIT(24) -#define AR8327_PAD_CTRL_RGMII_TXCLK_DELAY_EN BIT(25) -#define AR8327_PAD_CTRL_RGMII_EN BIT(26) - -#define AR8327_REG_POS 0x10 -#define AR8327_POS_POWER_ON_SEL BIT(31) -#define AR8327_POS_LED_OPEN_EN BIT(24) -#define AR8327_POS_SERDES_AEN BIT(7) - -#define AR8327_REG_PAD_SGMII_CTRL 0xe0 -#define AR8327_PAD_SGMII_CTRL_MODE_CTRL BITS(22, 2) -#define AR8327_PAD_SGMII_CTRL_MODE_CTRL_S 22 -#define AR8327_PAD_SGMII_CTRL_EN_SD BIT(4) -#define AR8327_PAD_SGMII_CTRL_EN_TX BIT(3) -#define AR8327_PAD_SGMII_CTRL_EN_RX BIT(2) -#define AR8327_PAD_SGMII_CTRL_EN_PLL BIT(1) -#define AR8327_PAD_SGMII_CTRL_EN_LCKDT BIT(0) - -#define AR8327_REG_PAD_MAC_PWR_SEL 0x0e4 -#define AR8327_PAD_MAC_PWR_RGMII0_1_8V BIT(19) -#define AR8327_PAD_MAC_PWR_RGMII1_1_8V BIT(18) - -#define AR8327_NUM_PHYS 5 -#define AR8327_PORT_CPU 0 -#define AR8327_NUM_PORTS 8 -#define AR8327_MAX_VLANS 128 - -enum { - AR8327_PORT_SPEED_10M = 0, - AR8327_PORT_SPEED_100M = 1, - AR8327_PORT_SPEED_1000M = 2, - AR8327_PORT_SPEED_NONE = 3, -}; - -enum { - QCA_VER_AR8216 = 0x01, - QCA_VER_AR8236 = 0x03, - QCA_VER_AR8316 = 0x10, - QCA_VER_AR8327 = 0x12, - QCA_VER_AR8337 = 0x13 -}; - -/*poll mib per 2secs*/ -#define QCA_PHY_MIB_WORK_DELAY 20000 -#define QCA_MIB_ITEM_NUMBER 41 - -struct qca_phy_priv { - struct phy_device *phy; - struct switch_dev sw_dev; - a_uint8_t version; - a_uint8_t revision; - a_uint32_t (*mii_read)(a_uint32_t reg); - void (*mii_write)(a_uint32_t reg, a_uint32_t val); - void (*phy_dbg_write)(a_uint32_t dev_id, a_uint32_t phy_addr, - a_uint16_t dbg_addr, a_uint16_t dbg_data); - void (*phy_mmd_write)(a_uint32_t dev_id, a_uint32_t phy_addr, - a_uint16_t addr, a_uint16_t data); - void (*phy_write)(a_uint32_t dev_id, a_uint32_t phy_addr, - a_uint32_t reg, a_uint16_t data); - - bool init; - struct mutex reg_mutex; - struct mutex mib_lock; - struct delayed_work mib_dwork; - u64 *mib_counters; - /* dump buf */ - a_uint8_t buf[2048]; - - /* VLAN database */ - bool vlan; /* True: 1q vlan mode, False: port vlan mode */ - a_uint16_t vlan_id[AR8327_MAX_VLANS]; - a_uint8_t vlan_table[AR8327_MAX_VLANS]; - a_uint8_t vlan_tagged; - a_uint16_t pvid[AR8327_NUM_PORTS]; - -}; - - -#define qca_phy_priv_get(_dev) \ - container_of(_dev, struct qca_phy_priv, sw_dev) - -static int -miibus_get(void); -uint32_t -qca_ar8216_mii_read(int reg); -void -qca_ar8216_mii_write(int reg, uint32_t val); -static sw_error_t -qca_ar8327_phy_write(a_uint32_t dev_id, a_uint32_t phy_addr, - a_uint32_t reg, a_uint16_t data); -static void -qca_ar8327_mmd_write(a_uint32_t dev_id, a_uint32_t phy_addr, - a_uint16_t addr, a_uint16_t data); -static void -qca_ar8327_phy_dbg_write(a_uint32_t dev_id, a_uint32_t phy_addr, - a_uint16_t dbg_addr, a_uint16_t dbg_data); -#endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/ref/ref_api.h b/feeds/ipq807x/qca-ssdk-shell/src/include/ref/ref_api.h deleted file mode 100755 index ec7b557b1..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/ref/ref_api.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _REF_API_H_ -#define _REF_API_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifdef IN_VLAN -#define REF_VLAN_API \ - SW_API_DEF(SW_API_LAN_WAN_CFG_SET, qca_lan_wan_cfg_set), \ - SW_API_DEF(SW_API_LAN_WAN_CFG_GET, qca_lan_wan_cfg_get), - -#define REF_VLAN_API_PARAM \ - SW_API_DESC(SW_API_LAN_WAN_CFG_SET) \ - SW_API_DESC(SW_API_LAN_WAN_CFG_GET) - -#else -#define REF_VLAN_API -#define REF_VLAN_API_PARAM -#endif - -#define SSDK_REF_API \ - REF_VLAN_API - -#define SSDK_REF_PARAM \ - REF_VLAN_API_PARAM - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _REF_API_H_ */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/ref/ref_vlan.h b/feeds/ipq807x/qca-ssdk-shell/src/include/ref/ref_vlan.h deleted file mode 100755 index d8e124ba5..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/ref/ref_vlan.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/** - * @defgroup ref_vlan REF_VLAN - * @{ - */ -#ifndef _REF_VLAN_H -#define _REF_VLAN_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "sw.h" -#include "fal_type.h" - -typedef struct { - fal_port_t port_id; /* port id */ - a_uint32_t vid; /* vlan id */ - a_bool_t is_wan_port; /* belong to wan port */ - a_bool_t valid; /* valid or not */ -} qca_lan_wan_port_info; - -typedef struct { - a_bool_t lan_only_mode; - qca_lan_wan_port_info v_port_info[SW_MAX_NR_PORT]; -} qca_lan_wan_cfg_t; - -sw_error_t -qca_lan_wan_cfg_set(a_uint32_t dev_id, qca_lan_wan_cfg_t *lan_wan_cfg); - -sw_error_t -qca_lan_wan_cfg_get(a_uint32_t dev_id, qca_lan_wan_cfg_t *lan_wan_cfg); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _REF_VLAN_H */ -/** - * @} - */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_lock.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_lock.h deleted file mode 100755 index d09f012f4..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_lock.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _AOS_LOCK_H -#define _AOS_LOCK_H - - -#ifdef KERNEL_MODULE -#include "sal/os/linux/aos_lock_pvt.h" -#else -#include "sal/os/linux_user/aos_lock_pvt.h" -#endif - - -typedef aos_lock_pvt_t aos_lock_t; - - -#define aos_lock_init(lock) __aos_lock_init(lock) - - -#define aos_lock(lock) __aos_lock(lock) - - -#define aos_unlock(lock) __aos_unlock(lock) - - -#define aos_irq_save(flags) __aos_irq_save(flags) - - -#define aos_irq_restore(flags) __aos_irq_restore(flags) - - -#define aos_default_unlock __aos_default_unlock - - -#endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_mem.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_mem.h deleted file mode 100755 index 0006bbc52..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_mem.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2014,2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _AOS_MEM_H -#define _AOS_MEM_H - -#include "aos_types.h" -#ifdef KERNEL_MODULE -#include "aos_mem_pvt.h" -#else -#include "aos_mem_pvt.h" -#endif - -/** - * @g aos_mem mem - * @{ - * - * @ig shim_ext - */ - -/** - * @brief Allocate a memory buffer. Note it's a non-blocking call. - * This call can block. - * - * @param[in] size buffer size - * - * @return Buffer pointer or NULL if there's not enough memory. - */ -static inline void * -aos_mem_alloc(aos_size_t size) -{ - return __aos_mem_alloc(size); -} - -/** - * @brief Free malloc'ed buffer - * - * @param[in] buf buffer pointer allocated by aos_alloc() - * @param[in] size buffer size - */ -static inline void -aos_mem_free(void *buf) -{ - __aos_mem_free(buf); -} - -/** - * @brief Move a memory buffer - * - * @param[in] dst destination address - * @param[in] src source address - * @param[in] size buffer size - */ -static inline void -aos_mem_copy(void *dst, void *src, aos_size_t size) -{ - __aos_mem_copy(dst, src, size); -} - -/** - * @brief Fill a memory buffer - * - * @param[in] buf buffer to be filled - * @param[in] b byte to fill - * @param[in] size buffer size - */ -static inline void -aos_mem_set(void *buf, a_uint8_t b, aos_size_t size) -{ - __aos_mem_set(buf, b, size); -} - -/** - * @brief Zero a memory buffer - * - * @param[in] buf buffer to be zeroed - * @param[in] size buffer size - */ -static inline void -aos_mem_zero(void *buf, aos_size_t size) -{ - __aos_mem_zero(buf, size); -} - -/** - * @brief Compare two memory buffers - * - * @param[in] buf1 first buffer - * @param[in] buf2 second buffer - * @param[in] size buffer size - * - * @retval 0 equal - * @retval 1 not equal - */ -static inline int -aos_mem_cmp(void *buf1, void *buf2, aos_size_t size) -{ - return __aos_mem_cmp(buf1, buf2, size); -} - -/** - * @} - */ - -#endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_timer.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_timer.h deleted file mode 100755 index 81aa0bf07..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_timer.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifndef _AOS_TIMER_H -#define _AOS_TIMER_H - -#include "sal/os/aos_types.h" -#ifdef KERNEL_MODULE -#include "sal/os/linux/aos_timer_pvt.h" -#else -#include "sal/os/linux_user/aos_timer_pvt.h" -#endif - - -typedef __aos_timer_t aos_timer_t; - - -/* - * Delay in microseconds - */ -static inline void -aos_udelay(int usecs) -{ - return __aos_udelay(usecs); -} - -/* - * Delay in milliseconds. - */ -static inline void -aos_mdelay(int msecs) -{ - return __aos_mdelay(msecs); -} - - -#endif - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_types.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_types.h deleted file mode 100755 index a80e5d057..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/aos_types.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2014,2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _AOS_TYPES_H -#define _AOS_TYPES_H - -#ifdef KERNEL_MODULE -#include "aos_types_pvt.h" -#else -#include "aos_types_pvt.h" -#endif - -#ifndef NULL -#define NULL 0 -#endif - -/** - * @g aos_types types - * @{ - * - * @ig shim_ext - */ -/* - *@ basic data types. - */ -typedef enum -{ - A_FALSE, - A_TRUE -} a_bool_t; - -typedef __a_uint8_t a_uint8_t; -typedef __a_int8_t a_int8_t; -typedef __a_uint16_t a_uint16_t; -typedef __a_int16_t a_int16_t; -typedef __a_uint32_t a_uint32_t; -typedef __a_int32_t a_int32_t; -typedef __a_uint64_t a_uint64_t; -typedef __a_int64_t a_int64_t; -typedef unsigned long a_ulong_t; -typedef char a_char_t; - -typedef void * acore_t; - -/** - * @brief Platform/bus generic handle. Used for bus specific functions. - */ -typedef __aos_device_t aos_device_t; - -/** - * @brief size of an object - */ -typedef __aos_size_t aos_size_t; - -/** - * @brief Generic status to be used by acore. - */ -typedef enum -{ - A_STATUS_OK, - A_STATUS_FAILED, - A_STATUS_ENOENT, - A_STATUS_ENOMEM, - A_STATUS_EINVAL, - A_STATUS_EINPROGRESS, - A_STATUS_ENOTSUPP, - A_STATUS_EBUSY, -} a_status_t; - -/* - * An ecore needs to provide a table of all pci device/vendor id's it - * supports - * - * This table should be terminated by a NULL entry , i.e. {0} - */ -typedef struct -{ - a_uint32_t vendor; - a_uint32_t device; - a_uint32_t subvendor; - a_uint32_t subdevice; -} aos_pci_dev_id_t; - -#define AOS_PCI_ANY_ID (~0) - -/* - * Typically core's can use this macro to create a table of various device - * ID's - */ -#define AOS_PCI_DEVICE(_vendor, _device) \ - (_vendor), (_device), AOS_PCI_ANY_ID, AOS_PCI_ANY_ID - - -typedef __aos_iomem_t aos_iomem_t; -/* - * These define the hw resources the OS has allocated for the device - * Note that start defines a mapped area. - */ -typedef enum -{ - AOS_RESOURCE_TYPE_MEM, - AOS_RESOURCE_TYPE_IO, -} aos_resource_type_t; - -typedef struct -{ - a_uint32_t start; - a_uint32_t end; - aos_resource_type_t type; -} aos_resource_t; - -#define AOS_DEV_ID_TABLE_MAX 256 - -typedef union -{ - aos_pci_dev_id_t *pci; - void *raw; -} aos_bus_reg_data_t; - -typedef void *aos_attach_data_t; - -#define AOS_REGIONS_MAX 5 - -typedef enum -{ - AOS_BUS_TYPE_PCI = 1, - AOS_BUS_TYPE_GENERIC, -} aos_bus_type_t; - -typedef enum -{ - AOS_IRQ_NONE, - AOS_IRQ_HANDLED, -} aos_irq_resp_t; - -typedef enum -{ - AOS_DMA_MASK_32BIT, - AOS_DMA_MASK_64BIT, -} aos_dma_mask_t; - - -/** - * @brief DMA directions - */ -typedef enum -{ - AOS_DMA_TO_DEVICE = 0, /**< Data is transfered from device to memory */ - AOS_DMA_FROM_DEVICE, /**< Data is transfered from memory to device */ -} aos_dma_dir_t; - -/* - * Protoypes shared between public and private headers - */ - - -/* - * work queue(kernel thread) function callback - */ -typedef void (*aos_work_func_t)(void *); - -/** - * @brief Prototype of the critical region function that is to be - * executed with spinlock held and interrupt disalbed - */ -typedef a_bool_t (*aos_irqlocked_func_t)(void *); - -/** - * @brief Prototype of timer function - */ -typedef void (*aos_timer_func_t)(void *); - -#endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_lock_pvt.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_lock_pvt.h deleted file mode 100755 index a8894761f..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_lock_pvt.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _AOS_LOCK_PVT_H -#define _AOS_LOCK_PVT_H - -#include -#include "sal/os/aos_types.h" - - -typedef pthread_mutex_t aos_lock_pvt_t; - - -#define __aos_lock_init(lock) \ - pthread_mutex_init(lock, NULL); \ - pthread_mutexattr_setpshared(lock, PTHREAD_PROCESS_SHARED) - - -#define __aos_lock(lock) pthread_mutex_lock(lock) - - -#define __aos_unlock(lock) pthread_mutex_unlock(lock) - - -#define __aos_irq_save(flags) - - -#define __aos_irq_restore(flags) - - -#define __aos_default_unlock PTHREAD_MUTEX_INITIALIZER - - -#endif /*_AOS_LOCK_PVT_H*/ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_mem_pvt.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_mem_pvt.h deleted file mode 100755 index 281e65dab..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_mem_pvt.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _AOS_MEM_PVT_H -#define _AOS_MEM_PVT_H - -#include -#include - -static inline void *__aos_mem_alloc(aos_size_t size) -{ - return (malloc(size)); -} - -static inline void __aos_mem_free(void *buf) -{ - free(buf); -} - -/* move a memory buffer */ -static inline void -__aos_mem_copy(void *dst, void *src, aos_size_t size) -{ - memcpy(dst, src, size); -} - -/* set a memory buffer */ -static inline void -__aos_mem_set(void *buf, a_uint8_t b, aos_size_t size) -{ - memset(buf, b, size); -} - -/* zero a memory buffer */ -static inline void -__aos_mem_zero(void *buf, aos_size_t size) -{ - memset(buf, 0, size); -} - -/* compare two memory buffers */ -static inline int -__aos_mem_cmp(void *buf1, void *buf2, aos_size_t size) -{ - return (memcmp(buf1, buf2, size) == 0) ? 0 : 1; -} - - - -#endif /*_AOS_MEM_PVT_H*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_timer_pvt.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_timer_pvt.h deleted file mode 100755 index 58055eb71..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_timer_pvt.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _AOS_TIMER_PVT_H -#define _AOS_TIMER_PVT_H - -#include - -typedef int __aos_timer_t; - -static inline void -__aos_udelay(int usecs) -{ - usleep(usecs); - return; -} - -static inline void -__aos_mdelay(int msecs) -{ - usleep(1000*msecs); - return; -} - -#endif /*_AOS_TIMER_PVT_H*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_types_pvt.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_types_pvt.h deleted file mode 100755 index fc71a871f..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/os/linux_user/aos_types_pvt.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _AOS_PVTTYPES_H -#define _AOS_PVTTYPES_H - -#include -#include -/* - * Private definitions of general data types - */ - -typedef void* __aos_device_t; -typedef int __aos_size_t; -typedef int __aos_iomem_t; - -typedef __u8 __a_uint8_t; -typedef __s8 __a_int8_t; -typedef __u16 __a_uint16_t; -typedef __s16 __a_int16_t; -typedef __u32 __a_uint32_t; -typedef __s32 __a_int32_t; -typedef __u64 __a_uint64_t; -typedef __s64 __a_int64_t; - - -#define aos_printk printf - - -#endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/sd/linux/uk_interface/sw_api_us.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/sd/linux/uk_interface/sw_api_us.h deleted file mode 100755 index d589d59fd..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/sd/linux/uk_interface/sw_api_us.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _SW_API_US_H -#define _SW_API_US_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "sw.h" - - sw_error_t sw_uk_init(a_uint32_t nl_prot); - - sw_error_t sw_uk_cleanup(void); - - sw_error_t sw_uk_if(unsigned long arg_val[SW_MAX_API_PARAM]); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SW_API_INTERFACE_H */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/sd/sd.h b/feeds/ipq807x/qca-ssdk-shell/src/include/sal/sd/sd.h deleted file mode 100755 index 7187f482a..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/sal/sd/sd.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#ifndef _SD_H_ -#define _SD_H_ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - sw_error_t - sd_reg_mdio_set(a_uint32_t dev_id, a_uint32_t phy, a_uint32_t reg, - a_uint16_t data); - - sw_error_t - sd_reg_mdio_get(a_uint32_t dev_id, a_uint32_t phy, a_uint32_t reg, - a_uint16_t * data); - - sw_error_t - sd_reg_hdr_set(a_uint32_t dev_id, a_uint32_t reg_addr, - a_uint8_t * reg_data, a_uint32_t len); - - sw_error_t - sd_reg_hdr_get(a_uint32_t dev_id, a_uint32_t reg_addr, - a_uint8_t * reg_data, a_uint32_t len); - sw_error_t - sd_reg_uniphy_set(a_uint32_t dev_id, a_uint32_t index, - a_uint32_t reg_addr, a_uint8_t * reg_data, a_uint32_t len); - - sw_error_t - sd_reg_uniphy_get(a_uint32_t dev_id, a_uint32_t index, - a_uint32_t reg_addr, a_uint8_t * reg_data, a_uint32_t len); - - void - sd_reg_mii_set(a_uint32_t reg, a_uint32_t val); - - a_uint32_t - sd_reg_mii_get(a_uint32_t reg); - - sw_error_t sd_init(a_uint32_t dev_id, ssdk_init_cfg * cfg); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _SD_H_ */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell.h b/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell.h deleted file mode 100755 index 1575e1b9b..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _SW_SHELL_H -#define _SW_SHELL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "sw.h" -#include "sw_api.h" -#include "ssdk_init.h" - - extern a_ulong_t *ioctl_buf; - extern ssdk_init_cfg init_cfg; - extern ssdk_cfg_t ssdk_cfg; - -#define IOCTL_BUF_SIZE 2048 -#define CMDSTR_BUF_SIZE 1024 -#define CMDSTR_ARGS_MAX 128 -#define dprintf cmd_print - extern sw_error_t cmd_exec_api(a_ulong_t *arg_val); - extern void cmd_print(char *fmt, ...); - void cmd_print_error(sw_error_t rtn); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SW_SHELL_H */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_config.h b/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_config.h deleted file mode 100755 index 8ddab7b68..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_config.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _SHELL_CONFIG_H_ -#define _SHELL_CONFIG_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "sw.h" -#include "sw_ioctl.h" -#include "sw_api.h" - -#define SW_CMD_SET_DEVID (SW_API_MAX + 1) -#define SW_CMD_VLAN_SHOW (SW_API_MAX + 2) -#define SW_CMD_FDB_SHOW (SW_API_MAX + 3) -#define SW_CMD_RESV_FDB_SHOW (SW_API_MAX + 4) -#define SW_CMD_HOST_SHOW (SW_API_MAX + 5) -#define SW_CMD_NAT_SHOW (SW_API_MAX + 6) -#define SW_CMD_NAPT_SHOW (SW_API_MAX + 7) -#define SW_CMD_INTFMAC_SHOW (SW_API_MAX + 8) -#define SW_CMD_PUBADDR_SHOW (SW_API_MAX + 9) -#define SW_CMD_FLOW_SHOW (SW_API_MAX + 10) -#define SW_CMD_HOST_IPV4_SHOW (SW_API_MAX + 11) -#define SW_CMD_HOST_IPV6_SHOW (SW_API_MAX + 12) -#define SW_CMD_HOST_IPV4M_SHOW (SW_API_MAX + 13) -#define SW_CMD_HOST_IPV6M_SHOW (SW_API_MAX + 14) -#define SW_CMD_CTRLPKT_SHOW (SW_API_MAX + 15) -#define SW_CMD_FLOW_IPV43T_SHOW (SW_API_MAX + 16) -#define SW_CMD_FLOW_IPV63T_SHOW (SW_API_MAX + 17) -#define SW_CMD_FLOW_IPV45T_SHOW (SW_API_MAX + 18) -#define SW_CMD_FLOW_IPV65T_SHOW (SW_API_MAX + 19) -#define SW_CMD_PT_VLAN_TRANS_ADV_SHOW (SW_API_MAX + 20) -#define SW_CMD_MAX (SW_API_MAX + 21) - -#define MAX_SUB_CMD_DES_NUM 120 - -#define SW_API_INVALID 0 - - struct sub_cmd_des_t - { - char *sub_name; - char *sub_act; - char *sub_memo; - char *sub_usage; - int sub_api; - sw_error_t (*sub_func) (); - }; - struct cmd_des_t - { - char *name; - char *memo; - struct sub_cmd_des_t sub_cmd_des[MAX_SUB_CMD_DES_NUM]; - }; - extern struct cmd_des_t gcmd_des[]; - -#define GCMD_DES gcmd_des - -#define GCMD_NAME(cmd_nr) GCMD_DES[cmd_nr].name -#define GCMD_MEMO(cmd_nr) GCMD_DES[cmd_nr].memo - -#define GCMD_SUB_NAME(cmd_nr, sub_cmd_nr) GCMD_DES[cmd_nr].sub_cmd_des[sub_cmd_nr].sub_name -#define GCMD_SUB_ACT(cmd_nr, sub_cmd_nr) GCMD_DES[cmd_nr].sub_cmd_des[sub_cmd_nr].sub_act -#define GCMD_SUB_MEMO(cmd_nr, sub_cmd_nr) GCMD_DES[cmd_nr].sub_cmd_des[sub_cmd_nr].sub_memo -#define GCMD_SUB_USAGE(cmd_nr, sub_cmd_nr) GCMD_DES[cmd_nr].sub_cmd_des[sub_cmd_nr].sub_usage -#define GCMD_SUB_API(cmd_nr, sub_cmd_nr) GCMD_DES[cmd_nr].sub_cmd_des[sub_cmd_nr].sub_api -#define GCMD_SUB_FUNC(cmd_nr, sub_cmd_nr) GCMD_DES[cmd_nr].sub_cmd_des[sub_cmd_nr].sub_func - -#define GCMD_DESC_VALID(cmd_nr) GCMD_NAME(cmd_nr) -#define GCMD_SUB_DESC_VALID(cmd_nr, sub_cmd_nr) GCMD_SUB_API(cmd_nr, sub_cmd_nr) - - -#define GCMD_DESC_NO_MATCH 0xffffffff - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SHELL_CONFIG_H_ */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_io.h b/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_io.h deleted file mode 100755 index 2121db881..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_io.h +++ /dev/null @@ -1,1039 +0,0 @@ -/* - * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/*qca808x_start*/ -#ifndef _SHELL_IO_H -#define _SHELL_IO_H - -#include "sw.h" -#include "sw_api.h" -#include "fal.h" -/*qca808x_end*/ -#include "ref_vlan.h" - -/*qca808x_start*/ -#define SW_TYPE_DEF(type, parser, show) {type, parser, show} -typedef struct -{ - sw_data_type_e data_type; - sw_error_t(*param_check) (); - void (*show_func) (); -} sw_data_type_t; - -void set_talk_mode(int mode); -int get_talk_mode(void); -void set_full_cmdstrp(char **cmdstrp); -int -get_jump(void); -sw_data_type_t * cmd_data_type_find(sw_data_type_e type); -void cmd_strtol(char *str, a_uint32_t * arg_val); - -sw_error_t __cmd_data_check_complex(char *info, char *defval, char *usage, - sw_error_t(*chk_func)(), void *arg_val, - a_uint32_t size); - -sw_error_t cmd_data_check_portid(char *cmdstr, fal_port_t * val, a_uint32_t size); - -sw_error_t cmd_data_check_portmap(char *cmdstr, fal_pbmp_t * val, a_uint32_t size); -sw_error_t cmd_data_check_confirm(char *cmdstr, a_bool_t def, a_bool_t * val, a_uint32_t size); - -sw_error_t cmd_data_check_uint64(char *cmd_str, a_uint64_t * arg_val, - a_uint32_t size); -sw_error_t cmd_data_check_uint32(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -sw_error_t cmd_data_check_uint16(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -sw_error_t cmd_data_check_uint8(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -sw_error_t cmd_data_check_enable(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -sw_error_t cmd_data_check_pbmp(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -sw_error_t cmd_data_check_duplex(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -sw_error_t cmd_data_check_speed(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -/*qca808x_end*/ -sw_error_t cmd_data_check_1qmode(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -sw_error_t cmd_data_check_egmode(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -/*qca808x_start*/ -sw_error_t cmd_data_check_capable(char *cmd_str, a_uint32_t * arg_val, - a_uint32_t size); -/*qca808x_end*/ -sw_error_t cmd_data_check_fdbentry(char *cmdstr, void *val, a_uint32_t size); -sw_error_t cmd_data_check_maclimit_ctrl(char *cmdstr, void *val, a_uint32_t size); -/*qca808x_start*/ -sw_error_t cmd_data_check_macaddr(char *cmdstr, void *val, a_uint32_t size); - -void cmd_data_print_uint64(a_uint8_t * param_name, a_uint64_t * buf, - a_uint32_t size); -void cmd_data_print_uint32(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); -void cmd_data_print_uint16(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); -void cmd_data_print_uint8(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -void cmd_data_print_enable(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); -void cmd_data_print_pbmp(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -void cmd_data_print_duplex(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -void cmd_data_print_speed(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -/*qca808x_end*/ -sw_error_t cmd_data_check_vlan(char *cmdstr, fal_vlan_t * val, a_uint32_t size); -void cmd_data_print_vlan(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_lan_wan_cfg(char *cmd_str, void *arg_val, a_uint32_t size); - -void cmd_data_print_lan_wan_cfg(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void cmd_data_print_mib(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -void cmd_data_print_mib_cntr(a_uint8_t * param_name, a_uint64_t * buf, - a_uint32_t size); -void cmd_data_print_xgmib(a_uint8_t * param_name, a_uint64_t * buf, - a_uint64_t size); -void cmd_data_print_1qmode(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -void cmd_data_print_egmode(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); -/*qca808x_start*/ -void cmd_data_print_capable(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -/*qca808x_end*/ -void cmd_data_print_maclimit_ctrl(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -/*qca808x_start*/ -void cmd_data_print_macaddr(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); -/*qca808x_end*/ -sw_error_t cmd_data_check_qos_sch(char *cmdstr, fal_sch_mode_t * val, - a_uint32_t size); -void cmd_data_print_qos_sch(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_qos_pt(char *cmdstr, fal_qos_mode_t * val, - a_uint32_t size); -void cmd_data_print_qos_pt(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_storm(char *cmdstr, fal_storm_type_t * val, - a_uint32_t size); -void cmd_data_print_storm(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_stp_state(char *cmdstr, fal_stp_state_t * val, - a_uint32_t size); -void cmd_data_print_stp_state(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_leaky(char *cmdstr, fal_leaky_ctrl_mode_t * val, - a_uint32_t size); -void cmd_data_print_leaky(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); - -sw_error_t cmd_data_check_uinta(char *cmdstr, a_uint32_t * val, - a_uint32_t size); -void cmd_data_print_uinta(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_maccmd(char *cmdstr, fal_fwd_cmd_t * val, - a_uint32_t size); -void cmd_data_print_maccmd(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_flowcmd(char *cmdstr, fal_default_flow_cmd_t * val, - a_uint32_t size); -void cmd_data_print_flowcmd(a_char_t *param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_flowtype(char *cmdstr, fal_flow_type_t * val, - a_uint32_t size); -void cmd_data_print_flowtype(a_char_t *param_name, a_uint32_t * buf, - a_uint32_t size); -sw_error_t cmd_data_check_aclrule(char *info, void *val, a_uint32_t size); - -void cmd_data_print_aclrule(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); - -sw_error_t -cmd_data_check_ledpattern(char *info, void * val, a_uint32_t size); - -void -cmd_data_print_ledpattern(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); - -sw_error_t -cmd_data_check_mirr_analy_cfg(char *info, void *val, a_uint32_t size); -void -cmd_data_print_mirr_analy_cfg(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_mirr_direction(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); -void -cmd_data_print_mirr_direction(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_invlan_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); -void -cmd_data_print_invlan_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_vlan_propagation(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); -void -cmd_data_print_vlan_propagation(a_char_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_vlan_translation(char *info, fal_vlan_trans_entry_t *val, a_uint32_t size); -void -cmd_data_print_vlan_translation(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_qinq_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); -void -cmd_data_print_qinq_mode(a_char_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_qinq_role(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); -void -cmd_data_print_qinq_role(a_char_t * param_name, a_uint32_t * buf, a_uint32_t size); -/*qca808x_start*/ -void -cmd_data_print_cable_status(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -void -cmd_data_print_cable_len(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -void -cmd_data_print_ssdk_cfg(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -/*qca808x_end*/ -sw_error_t -cmd_data_check_hdrmode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -void -cmd_data_print_hdrmode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_fdboperation(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_pppoe(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_pppoe_less(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_pppoe(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_udf_type(char *cmdstr, fal_acl_udf_type_t * arg_val, a_uint32_t size); - -void -cmd_data_print_udf_type(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); - -sw_error_t -cmd_data_check_udf_pkt_type(a_char_t *cmdstr, fal_acl_udf_pkt_type_t * arg_val, a_uint32_t size); - -void -cmd_data_print_udf_pkt_type(a_char_t * param_name, a_uint32_t * buf, - a_uint32_t size); - -sw_error_t -cmd_data_check_host_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_host_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_arp_learn_mode(char *cmd_str, fal_arp_learn_mode_t * arg_val, - a_uint32_t size); - -void -cmd_data_print_arp_learn_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip_guard_mode(char *cmd_str, fal_source_guard_mode_t * arg_val, a_uint32_t size); - -void -cmd_data_print_ip_guard_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_nat_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_nat_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_napt_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_napt_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_flow_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_flow_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_napt_mode(char *cmd_str, fal_napt_mode_t * arg_val, a_uint32_t size); - -void -cmd_data_print_napt_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_intf_mac_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_intf_mac_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip4addr(char *cmdstr, void * val, a_uint32_t size); - -void -cmd_data_print_ip4addr(a_char_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip6addr(char *cmdstr, void * val, a_uint32_t size); - -void -cmd_data_print_ip6addr(a_char_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_pub_addr_entry(char *cmd_str, void * val, a_uint32_t size); - - -void -cmd_data_print_pub_addr_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - - -sw_error_t -cmd_data_check_egress_shaper(char *cmd_str, void * val, a_uint32_t size); - - -void -cmd_data_print_egress_shaper(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - - -sw_error_t -cmd_data_check_acl_policer(char *cmd_str, void * val, a_uint32_t size); - - -void -cmd_data_print_acl_policer(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - - -sw_error_t -cmd_data_check_port_policer(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_port_policer(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_mac_config(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_mac_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_phy_config(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_phy_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void cmd_data_print_fdbentry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_fdb_smode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -void -cmd_data_print_fdb_smode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_fdb_ctrl_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_fx100_config(char *cmd_str, void * arg_val, a_uint32_t size); - -void -cmd_data_print_fx100_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_multi(char *info, void *val, a_uint32_t size); -void -cmd_data_print_multi(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_sec_mac(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_sec_ip(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_sec_ip4(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_sec_ip6(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_sec_tcp(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_sec_udp(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_sec_icmp4(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_sec_icmp6(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_remark_entry(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_remark_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_default_route_entry(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_u_qmap(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_default_route_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_host_route_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_host_route_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_arp_sg(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_arp_sg(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_intf(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_intf(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_flow_age(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_flow_age(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_flow_ctrl(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_flow_ctrl(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ac_static_thresh(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ac_static_thresh(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ac_dynamic_thresh(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ac_dynamic_thresh(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ac_group_buff(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ac_group_buff(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ac_ctrl(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ac_ctrl(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ac_obj(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ac_obj(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_vsi_intf(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_vsi_intf(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip_pub(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ip_pub(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip_mcmode(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ip_mcmode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip_portmac(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ip_portmac(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip_sg(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ip_sg(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_nexthop(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_nexthop(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_network_route(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_network_route(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip_wcmp_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ip_wcmp_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip4_rfs_entry(char *cmd_str, void * val, a_uint32_t size); -sw_error_t -cmd_data_check_ip6_rfs_entry(char *cmd_str, void * val, a_uint32_t size); -sw_error_t -cmd_data_check_flow_age_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_flow_age_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_flow_ctrl_entry(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_flow_ctrl_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_flow(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_flow(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_flow_host(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_flow_host(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ip_global(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ip_global(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_flow_global(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_flow_global(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_l3_parser(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_l3_parser(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_l4_parser(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_l4_parser(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_exp_ctrl(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_exp_ctrl(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_group(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_port_group(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_pri(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_port_pri(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_remark(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_port_remark(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_cosmap(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_cosmap(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_queue_scheduler(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_queue_scheduler(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ring_queue(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_ring_queue(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_bm_static_thresh(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_bm_static_thresh(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_queue_cnt(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_bm_dynamic_thresh(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_bm_dynamic_thresh(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_bm_port_counter(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_flow_cookie(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_fdb_rfs(char *cmd_str, void * val, a_uint32_t size); -sw_error_t -cmd_data_check_flow_rfs(char *cmd_str, void * val, a_uint32_t size); -/*qca808x_start*/ -sw_error_t -cmd_data_check_crossover_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_crossover_status(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); -/*qca808x_end*/ -sw_error_t -cmd_data_check_prefer_medium(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_fiber_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); -/*qca808x_start*/ -sw_error_t -cmd_data_check_interface_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); -/*qca808x_end*/ -sw_error_t -cmd_data_check_port_eee_config(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_port_eee_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_src_filter_config(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -void -cmd_data_print_src_filter_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_switch_port_loopback_config(char *cmd_str, void * val, - a_uint32_t size); -void -cmd_data_print_switch_port_loopback_config(a_uint8_t * param_name, - a_uint32_t * buf, a_uint32_t size); -sw_error_t -cmd_data_check_newadr_lrn(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_newaddr_lrn_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_stamove(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_stamove_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_vsi_member(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_vsi_member_entry(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_vsi_counter(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_mtu_entry(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_mru_entry(char *cmd_str, void * val, a_uint32_t size); -/*qca808x_start*/ -void -cmd_data_print_crossover_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_crossover_status(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -/*qca808x_end*/ - -void -cmd_data_print_prefer_medium(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_fiber_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -/*qca808x_start*/ - -void -cmd_data_print_interface_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_counter_info(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_register_info(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_phy_register_info(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_debug_register_info(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); -/*qca808x_end*/ - -void -cmd_data_print_mtu_info(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_mru_info(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_global_qinqmode(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_global_qinqmode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_qinqmode(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_port_qinqmode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_tpid(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_tpid(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ingress_filter(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ingress_filter(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_default_vid_en(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_port_default_vid_en(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_vlan_tag(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_port_vlan_tag(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_vlan_direction(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -void -cmd_data_print_port_vlan_direction(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_vlan_translation_adv_rule(char *info, fal_vlan_trans_adv_rule_t *val, a_uint32_t size); - -void -cmd_data_print_port_vlan_translation_adv_rule(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_vlan_translation_adv_action(char *info, fal_vlan_trans_adv_action_t *val, a_uint32_t size); - -void -cmd_data_print_port_vlan_translation_adv_action(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_port_vlan_counter(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_tag_propagation(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_tag_propagation(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_egress_vsi_tag(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_egress_vsi_tag(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_egress_mode(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_egress_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ctrlpkt_profile(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ctrlpkt_profile(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_servcode_config(char *info, fal_servcode_config_t *val, a_uint32_t size); - -void -cmd_data_print_servcode_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_rss_hash_mode(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_rss_hash_config(char *info, fal_rss_hash_config_t *val, a_uint32_t size); - -void -cmd_data_print_rss_hash_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_policer_config(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_policer_cmd_config(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_port_policer_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_policer_cmd_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_acl_policer_config(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_acl_policer_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_policer_counter_infor(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_policer_global_counter_infor(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_port_scheduler_resource(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_port_shaper_token_config(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_shaper_token_config(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_port_shaper_config(char *cmd_str, void * val, a_uint32_t size); - -sw_error_t -cmd_data_check_shaper_config(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_port_shaper_token_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_shaper_token_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_port_shaper_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_shaper_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_module(char *cmd_str, a_uint32_t * arg_val, a_uint32_t size); - -void -cmd_data_print_module(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_func_ctrl(char *cmd_str, void * val, a_uint32_t size); - -void -cmd_data_print_func_ctrl(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -void -cmd_data_print_module_func_ctrl(a_uint32_t module, fal_func_ctrl_t *p); - -sw_error_t -cmd_data_check_debug_port_counter_status(char *info, fal_counter_en_t *val, a_uint32_t size); - -void -cmd_data_print_debug_port_counter_status(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_config(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_config(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_reference_clock(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_reference_clock(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_rx_timestamp_mode(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_rx_timestamp_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_direction(char *info, void *val, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_pkt_info(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_pkt_info(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_time(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_time(a_char_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_grandmaster_mode(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_grandmaster_mode(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_security(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_security(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_pps_sig_ctrl(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_pps_sig_ctrl(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_asym_correction(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_asym_correction(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_waveform(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_waveform(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_tod_uart(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_tod_uart(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_enhanced_timestamp_engine(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_enhanced_timestamp_engine(a_uint8_t * param_name, a_uint32_t * buf, - a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_trigger(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_trigger(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_capture(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_capture(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_ptp_interrupt(char *info, void *val, a_uint32_t size); - -void -cmd_data_print_ptp_interrupt(a_uint8_t * param_name, a_uint32_t * buf, a_uint32_t size); - -sw_error_t -cmd_data_check_sfp_ccode_type(char *cmdstr, fal_sfp_cc_type_t *arg_val, a_uint32_t size); - -sw_error_t -cmd_data_check_sfp_data(char *cmd_str, void *arg_val, a_uint32_t size); - -void -cmd_data_print_sfp_data(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_dev_type(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_transc_code(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_rate_encode(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_link_length(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_vendor_info(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_laser_wavelength(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_option(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_ctrl_rate(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_enhanced_cfg(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_diag_threshold(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_diag_cal_const(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_diag_realtime(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_ctrl_status(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); - -void -cmd_data_print_sfp_alarm_warn_flag(a_uint8_t *param_name, a_ulong_t *buf, a_uint32_t size); -/*qca808x_start*/ -#endif -/*qca808x_end*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_lib.h b/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_lib.h deleted file mode 100755 index a6f824a97..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_lib.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _SW_SHELL_LIB_H -#define _SW_SHELL_LIB_H - -#ifdef __cplusplus -extern "C" { -#endif - - int next_cmd(char *out_cmd); - ssize_t getline(char **lineptr, size_t *n, FILE *stream); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SW_SHELL_LIB_H */ - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_sw.h b/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_sw.h deleted file mode 100755 index 6eaa9caef..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/include/shell/shell_sw.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/*qca808x_start*/ -#ifndef _SHELL_SW_H_ -#define _SHELL_SW_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "sw.h" - - int get_devid(void); - int set_devid(int dev_id); - sw_error_t cmd_set_devid(a_ulong_t *arg_val); -/*qca808x_end*/ - sw_error_t cmd_show_fdb(a_ulong_t *arg_val); - sw_error_t cmd_show_vlan(a_ulong_t *arg_val); - sw_error_t cmd_show_resv_fdb(a_ulong_t *arg_val); - sw_error_t cmd_show_host(a_ulong_t *arg_val); - sw_error_t cmd_show_host_ipv4(a_ulong_t *arg_val); - sw_error_t cmd_show_host_ipv6(a_ulong_t *arg_val); - sw_error_t cmd_show_host_ipv4M(a_ulong_t *arg_val); - sw_error_t cmd_show_host_ipv6M(a_ulong_t *arg_val); - sw_error_t cmd_show_flow_ipv4_3tuple(a_ulong_t *arg_val); - sw_error_t cmd_show_flow_ipv4_5tuple(a_ulong_t *arg_val); - sw_error_t cmd_show_flow_ipv6_3tuple(a_ulong_t *arg_val); - sw_error_t cmd_show_flow_ipv6_5tuple(a_ulong_t *arg_val); - sw_error_t cmd_show_nat(a_ulong_t *arg_val); - sw_error_t cmd_show_napt(a_ulong_t *arg_val); - sw_error_t cmd_show_intfmac(a_ulong_t *arg_val); - sw_error_t cmd_show_pubaddr(a_ulong_t *arg_val); - sw_error_t cmd_show_flow(a_ulong_t *arg_val); - sw_error_t cmd_show_ctrlpkt(a_ulong_t *arg_val); - sw_error_t cmd_show_ptvlan_entry(a_ulong_t *arg_val); -/*qca808x_start*/ -#ifdef __cplusplus -} -#endif /* __cplusplus */ -/*qca808x_start*/ - -#endif /* _SHELL_SW_H_ */ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/make/components.mk b/feeds/ipq807x/qca-ssdk-shell/src/make/components.mk deleted file mode 100755 index 71f9fb86e..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/make/components.mk +++ /dev/null @@ -1,36 +0,0 @@ - -ifeq (linux, $(OS)) - ifeq (KSLIB, $(MODULE_TYPE)) - ifeq (TRUE, $(KERNEL_MODE)) - COMPONENTS = HSL SAL INIT UTIL REF - ifeq (TRUE, $(FAL)) - COMPONENTS += FAL - endif - else - COMPONENTS = HSL SAL INIT REF - endif - - ifeq (TRUE, $(UK_IF)) - COMPONENTS += API - endif - endif - - ifeq (USLIB, $(MODULE_TYPE)) - ifneq (TRUE, $(KERNEL_MODE)) - COMPONENTS = HSL SAL INIT UTIL REF - ifeq (TRUE, $(FAL)) - COMPONENTS += FAL - endif - else - COMPONENTS = UK_IF SAL REF - endif - - ifeq (TRUE, $(UK_IF)) - COMPONENTS += API - endif - endif - - ifeq (SHELL, $(MODULE_TYPE)) - COMPONENTS = SHELL - endif -endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/make/config.mk b/feeds/ipq807x/qca-ssdk-shell/src/make/config.mk deleted file mode 100755 index 027c9bba3..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/make/config.mk +++ /dev/null @@ -1,91 +0,0 @@ - -include $(PRJ_PATH)/config - -ifndef SYS_PATH - $(error SYS_PATH isn't defined!) -endif - -ifndef TOOL_PATH - $(error TOOL_PATH isn't defined!) -endif - -#define cpu type such as PPC MIPS ARM X86 -ifndef CPU - CPU=mips -endif - -#define os type such as linux netbsd vxworks -ifndef OS - OS=linux -endif - -ifndef OS_VER - OS_VER=2_6 -endif - -#support chip type such as ATHENA GARUDA -ifndef CHIP_TYPE - SUPPORT_CHIP = GARUDA -else - ifeq (GARUDA, $(CHIP_TYPE)) - SUPPORT_CHIP = GARUDA - endif - - ifeq (ATHENA, $(CHIP_TYPE)) - SUPPORT_CHIP = ATHENA - endif - - ifeq (SHIVA, $(CHIP_TYPE)) - SUPPORT_CHIP = SHIVA - endif - - ifeq (HORUS, $(CHIP_TYPE)) - SUPPORT_CHIP = HORUS - endif - - ifeq (ISIS, $(CHIP_TYPE)) - SUPPORT_CHIP = ISIS - endif - - ifeq (ISISC, $(CHIP_TYPE)) - SUPPORT_CHIP = ISISC - endif - - ifeq (ALL_CHIP, $(CHIP_TYPE)) - ifneq (TRUE, $(FAL)) - $(error FAL must be TRUE when CHIP_TYPE is defined as ALL_CHIP!) - endif - SUPPORT_CHIP = GARUDA SHIVA HORUS ISIS ISISC - endif - - ifndef SUPPORT_CHIP - $(error defined CHIP_TYPE isn't supported!) - endif -endif - -#define compile tool prefix -ifndef TOOLPREFIX - TOOLPREFIX=$(CPU)-$(OS)-uclibc- -endif - -DEBUG_ON=FALSE -OPT_FLAG= -LD_FLAG= - -SHELLOBJ=ssdk_sh -US_MOD=ssdk_us -KS_MOD=ssdk_ks - -ifeq (TRUE, $(KERNEL_MODE)) - RUNMODE=km -else - RUNMODE=um -endif - -BLD_DIR=$(PRJ_PATH)/build/$(OS) -BIN_DIR=$(PRJ_PATH)/build/bin - -VER=2.0.0 -BUILD_NUMBER=$(shell cat $(PRJ_PATH)/make/.build_number) -VERSION=$(VER) -BUILD_DATE=$(shell date -u +%F-%T) diff --git a/feeds/ipq807x/qca-ssdk-shell/src/make/defs.mk b/feeds/ipq807x/qca-ssdk-shell/src/make/defs.mk deleted file mode 100755 index 7d1c75bb9..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/make/defs.mk +++ /dev/null @@ -1,28 +0,0 @@ -DST_DIR=$(BLD_DIR)/$(MODULE_TYPE) - -SUB_DIR=$(patsubst %/, %, $(dir $(wildcard ./*/Makefile))) - -ifeq (,$(findstring $(LIB), $(COMPONENTS))) - SRC_LIST= -endif - -SRC_FILE=$(addprefix $(PRJ_PATH)/$(LOC_DIR)/, $(SRC_LIST)) - -OBJ_LIST=$(SRC_LIST:.c=.o) -OBJ_FILE=$(addprefix $(DST_DIR)/, $(OBJ_LIST)) - -DEP_LIST=$(SRC_LIST:.c=.d) -DEP_FILE=$(addprefix $(DST_DIR)/, $(DEP_LIST)) - -vpath %.c $(PRJ_PATH)/$(LOC_DIR) -vpath %.c $(PRJ_PATH)/app/nathelper/linux -vpath %.c $(PRJ_PATH)/app/nathelper/linux/lib -vpath %.o $(DST_DIR) -vpath %.d $(DST_DIR) - -DEP_LOOP=$(foreach i, $(SUB_DIR), $(MAKE) -C $(i) dep || exit 1;) -OBJ_LOOP=$(foreach i, $(SUB_DIR), $(MAKE) -C $(i) obj || exit 1;) -CLEAN_LOOP=$(foreach i, $(SUB_DIR), $(MAKE) -C $(i) clean;) -CLEAN_OBJ_LOOP=$(foreach i, $(SUB_DIR), $(MAKE) -C $(i) clean_o;) -CLEAN_DEP_LOOP=$(foreach i, $(SUB_DIR), $(MAKE) -C $(i) clean_d;) - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/make/linux_opt.mk b/feeds/ipq807x/qca-ssdk-shell/src/make/linux_opt.mk deleted file mode 100755 index e9a98079b..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/make/linux_opt.mk +++ /dev/null @@ -1,328 +0,0 @@ -ifeq (TRUE, $(IN_ACL)) - MODULE_CFLAG += -DIN_ACL -endif - -ifeq (TRUE, $(IN_FDB)) - MODULE_CFLAG += -DIN_FDB -endif - -ifeq (TRUE, $(IN_IGMP)) - MODULE_CFLAG += -DIN_IGMP -endif - -ifeq (TRUE, $(IN_LEAKY)) - MODULE_CFLAG += -DIN_LEAKY -endif - -ifeq (TRUE, $(IN_LED)) - MODULE_CFLAG += -DIN_LED -endif - -ifeq (TRUE, $(IN_MIB)) - MODULE_CFLAG += -DIN_MIB -endif - -ifeq (TRUE, $(IN_MIRROR)) - MODULE_CFLAG += -DIN_MIRROR -endif - -ifeq (TRUE, $(IN_MISC)) - MODULE_CFLAG += -DIN_MISC -endif - -ifeq (TRUE, $(IN_PORTCONTROL)) - MODULE_CFLAG += -DIN_PORTCONTROL -endif - -ifeq (TRUE, $(IN_PORTVLAN)) - MODULE_CFLAG += -DIN_PORTVLAN -endif - -ifeq (TRUE, $(IN_QOS)) - MODULE_CFLAG += -DIN_QOS -endif - -ifeq (TRUE, $(IN_RATE)) - MODULE_CFLAG += -DIN_RATE -endif - -ifeq (TRUE, $(IN_STP)) - MODULE_CFLAG += -DIN_STP -endif - -ifeq (TRUE, $(IN_VLAN)) - MODULE_CFLAG += -DIN_VLAN -endif - -ifeq (TRUE, $(IN_REDUCED_ACL)) - MODULE_CFLAG += -DIN_REDUCED_ACL -endif - -ifeq (TRUE, $(IN_COSMAP)) - MODULE_CFLAG += -DIN_COSMAP -endif - -ifeq (TRUE, $(IN_IP)) - MODULE_CFLAG += -DIN_IP -endif - -ifeq (TRUE, $(IN_NAT)) - MODULE_CFLAG += -DIN_NAT -endif - -ifeq (TRUE, $(IN_TRUNK)) - MODULE_CFLAG += -DIN_TRUNK -endif - -ifeq (TRUE, $(IN_SEC)) - MODULE_CFLAG += -DIN_SEC -endif - -ifeq (TRUE, $(IN_QM)) - MODULE_CFLAG += -DIN_QM -endif - -ifeq (TRUE, $(IN_BM)) - MODULE_CFLAG += -DIN_BM -endif - -ifeq (TRUE, $(IN_FLOW)) - MODULE_CFLAG += -DIN_FLOW -endif - -ifeq (TRUE, $(IN_NAT_HELPER)) - MODULE_CFLAG += -DIN_NAT_HELPER -endif - -ifeq (TRUE, $(IN_INTERFACECONTROL)) - MODULE_CFLAG += -DIN_INTERFACECONTROL -endif - -ifeq (TRUE, $(IN_CTRLPKT)) - MODULE_CFLAG += -DIN_CTRLPKT -endif - -ifeq (TRUE, $(IN_SERVCODE)) - MODULE_CFLAG += -DIN_SERVCODE -endif - -ifeq (TRUE, $(IN_RSS_HASH)) - MODULE_CFLAG += -DIN_RSS_HASH -endif - -ifeq (TRUE, $(IN_MACBLOCK)) - MODULE_CFLAG += -DIN_MACBLOCK -endif - -ifeq (TRUE, $(IN_VSI)) - MODULE_CFLAG += -DIN_VSI -endif - -ifeq (TRUE, $(IN_POLICER)) - MODULE_CFLAG += -DIN_POLICER -endif - -ifeq (TRUE, $(IN_SHAPER)) - MODULE_CFLAG += -DIN_SHAPER -endif - -ifeq (TRUE, $(IN_PTP)) - MODULE_CFLAG += -DIN_PTP -endif - -ifeq (TRUE, $(IN_SFP)) - MODULE_CFLAG += -DIN_SFP -endif - -ifeq (TRUE, $(IN_PPPOE)) - MODULE_CFLAG += -DIN_PPPOE -endif - -ifneq (TRUE, $(FAL)) - MODULE_CFLAG += -DHSL_STANDALONG -endif - -ifeq (TRUE, $(UK_IF)) - MODULE_CFLAG += -DUK_IF -endif - -#ifdef UK_NL_PROT - MODULE_CFLAG += -DUK_NL_PROT=$(UK_NL_PROT) -#endif - -#ifdef UK_MINOR_DEV - MODULE_CFLAG += -DUK_MINOR_DEV=$(UK_MINOR_DEV) -#endif - -ifeq (TRUE, $(API_LOCK)) - MODULE_CFLAG += -DAPI_LOCK -endif - -ifeq (TRUE, $(REG_ACCESS_SPEEDUP)) - MODULE_CFLAG += -DREG_ACCESS_SPEEDUP -endif - -ifeq (TRUE, $(DEBUG_ON)) - MODULE_CFLAG += -g -endif - -MODULE_CFLAG += $(OPT_FLAG) -Wall -Werror -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DCPU=\"$(CPU)\" -DOS=\"$(OS)\" - -MODULE_INC += -I$(PRJ_PATH)/include \ - -I$(PRJ_PATH)/include/common \ - -I$(PRJ_PATH)/include/api \ - -I$(PRJ_PATH)/include/fal \ - -I$(PRJ_PATH)/include/ref \ - -I$(PRJ_PATH)/include/hsl \ - -I$(PRJ_PATH)/include/hsl/phy \ - -I$(PRJ_PATH)/include/sal/os \ - -I$(PRJ_PATH)/include/sal/os/linux_user \ - -I$(PRJ_PATH)/include/sal/sd \ - -I$(PRJ_PATH)/include/sal/sd/linux/hydra_howl \ - -I$(PRJ_PATH)/include/sal/sd/linux/uk_interface \ - -I$(PRJ_PATH)/include/init - -ifneq (,$(findstring ATHENA, $(SUPPORT_CHIP))) - MODULE_INC += -I$(PRJ_PATH)/include/hsl/athena - MODULE_CFLAG += -DATHENA -endif - -ifneq (,$(findstring GARUDA, $(SUPPORT_CHIP))) - MODULE_INC += -I$(PRJ_PATH)/include/hsl/garuda - MODULE_CFLAG += -DGARUDA -endif - -ifneq (,$(findstring SHIVA, $(SUPPORT_CHIP))) - MODULE_INC += -I$(PRJ_PATH)/include/hsl/shiva - MODULE_CFLAG += -DSHIVA -endif - -ifneq (,$(findstring HORUS, $(SUPPORT_CHIP))) - MODULE_INC += -I$(PRJ_PATH)/include/hsl/horus - MODULE_CFLAG += -DHORUS -endif - -ifneq (,$(findstring ISIS, $(SUPPORT_CHIP))) - ifneq (ISISC, $(SUPPORT_CHIP)) - MODULE_INC += -I$(PRJ_PATH)/include/hsl/isis - MODULE_CFLAG += -DISIS - endif -endif - -ifneq (,$(findstring ISISC, $(SUPPORT_CHIP))) - MODULE_INC += -I$(PRJ_PATH)/include/hsl/isisc - MODULE_CFLAG += -DISISC -endif - -# check for GCC version -ifeq (4, $(GCC_VER)) - MODULE_CFLAG += -DGCCV4 -endif - -ifeq (KSLIB, $(MODULE_TYPE)) - - ifeq (3_4, $(OS_VER)) - MODULE_CFLAG += -DKVER34 - MODULE_CFLAG += -DKVER32 - MODULE_CFLAG += -DLNX26_22 - MODULE_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/source/include \ - -I$(SYS_PATH)/source/arch/arm/mach-msm/include \ - -I$(SYS_PATH)/source/arch/arm/include \ - -I$(SYS_PATH)/source/arch/arm/include/asm \ - -I$(SYS_PATH)/arch/arm/include/generated \ - -I$(SYS_PATH)/source/arch/arm/include/asm/mach \ - -I$(SYS_PATH)/usr/include - - endif - - ifeq (3_2, $(OS_VER)) - MODULE_CFLAG += -DKVER32 - MODULE_CFLAG += -DLNX26_22 - ifeq (mips, $(CPU)) - MODULE_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/arch/mips/include \ - -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \ - -I$(SYS_PATH)/arch/mips/include/asm/mach-generic \ - -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7 \ - -I$(SYS_PATH)/usr/include - - #CPU_CFLAG = -G 0 -mno-abicalls -fno-pic -pipe -mabi=32 -march=mips32r2 - ifndef CPU_CFLAG - CPU_CFLAG = -Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing \ - -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB - endif - else - MODULE_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/arch/arm/include \ - -I$(SYS_PATH)/arch/arm/include/asm \ - -I$(SYS_PATH)/arch/arm/mach-fv16xx/include \ - -I$(SYS_PATH)/arch/arm/include/generated \ - -I$(SYS_PATH)/include/generated \ - -I$(SYS_PATH)/usr/include - endif - - - endif - - ifeq (2_6, $(OS_VER)) - MODULE_CFLAG += -DKVER26 - MODULE_CFLAG += -DLNX26_22 - ifeq (mips, $(CPU)) - MODULE_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/arch/mips/include \ - -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \ - -I$(SYS_PATH)/arch/mips/include/asm/mach-generic \ - -I$(SYS_PATH)/usr/include - - #CPU_CFLAG = -G 0 -mno-abicalls -fno-pic -pipe -mabi=32 -march=mips32r2 - ifndef CPU_CFLAG - CPU_CFLAG = -Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing \ - -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB - endif - else - MODULE_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/arch/arm/include \ - -I$(SYS_PATH)/arch/arm/include/asm \ - -I$(SYS_PATH)/arch/arm/mach-fv16xx/include \ - -I$(SYS_PATH)/arch/arm/include/generated \ - -I$(SYS_PATH)/include/generated \ - -I$(SYS_PATH)/usr/include - endif - - - endif - - MODULE_CFLAG += -D__KERNEL__ -DKERNEL_MODULE $(CPU_CFLAG) - - -endif - -ifeq (SHELL, $(MODULE_TYPE)) - MODULE_INC += -I$(PRJ_PATH)/include/shell - - ifeq (2_6, $(OS_VER)) - MODULE_CFLAG += -DKVER26 - else - MODULE_CFLAG += -DKVER24 - endif - - ifneq (TRUE, $(KERNEL_MODE)) - MODULE_CFLAG += -DUSER_MODE - endif - -endif - -ifneq (TRUE, $(KERNEL_MODE)) - ifneq (SHELL, $(MODULE_TYPE)) - MODULE_CFLAG += -DUSER_MODE - endif -endif - -EXTRA_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG) -fpie -EXTRA_LDFLAGS += -pie diff --git a/feeds/ipq807x/qca-ssdk-shell/src/make/target.mk b/feeds/ipq807x/qca-ssdk-shell/src/make/target.mk deleted file mode 100755 index ddb3bd12f..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/make/target.mk +++ /dev/null @@ -1,49 +0,0 @@ - -include $(PRJ_PATH)/make/$(OS)_opt.mk - -include $(PRJ_PATH)/make/tools.mk - -obj: $(OBJ_LIST) - $(OBJ_LOOP) - -dep: build_dir $(DEP_LIST) - $(DEP_LOOP) - -$(OBJ_LIST): %.o : %.c %.d - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $(DST_DIR)/$@ - -$(DEP_LIST) : %.d : %.c - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< > $(DST_DIR)/$@.tmp - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $(DST_DIR)/$@.tmp > $(DST_DIR)/$@ - $(RM) -f $(DST_DIR)/$@.tmp; - -build_dir: $(DST_DIR) - -$(DST_DIR): - $(MKDIR) -p $(DST_DIR) - -.PHONY: clean -clean: clean_o clean_d - $(CLEAN_LOOP) - -.PHONY: clean_o -clean_o: clean_obj - $(CLEAN_OBJ_LOOP) - -.PHONY: clean_d -clean_d: clean_dep - $(CLEAN_DEP_LOOP) - -clean_obj: -ifneq (,$(word 1, $(OBJ_FILE))) - $(RM) -f $(OBJ_FILE) -endif - -clean_dep: -ifneq (,$(word 1, $(DEP_FILE))) - $(RM) -f $(DEP_FILE) -endif - -ifneq (,$(word 1, $(DEP_FILE))) - sinclude $(DEP_FILE) -endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/make/tools.mk b/feeds/ipq807x/qca-ssdk-shell/src/make/tools.mk deleted file mode 100755 index 6ed387298..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/make/tools.mk +++ /dev/null @@ -1,12 +0,0 @@ - -ifeq (linux, $(OS)) - CC=$(TOOL_PATH)/$(TOOLPREFIX)gcc - AR=$(TOOL_PATH)/$(TOOLPREFIX)ar - LD=$(TOOL_PATH)/$(TOOLPREFIX)ld - STRIP=$(TOOL_PATH)/$(TOOLPREFIX)strip - MAKE=make -S - CP=cp - MKDIR=mkdir - RM=rm - PERL=perl -endif diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/api/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/src/api/Makefile deleted file mode 100755 index 25c788a90..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/api/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -LOC_DIR=src/sal -LIB=API - -include $(PRJ_PATH)/make/config.mk - -SRC_LIST=$(wildcard *.c) - -include $(PRJ_PATH)/make/components.mk -include $(PRJ_PATH)/make/defs.mk -include $(PRJ_PATH)/make/target.mk - -all: dep obj \ No newline at end of file diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/api/api_access.c b/feeds/ipq807x/qca-ssdk-shell/src/src/api/api_access.c deleted file mode 100755 index 3c7b334e5..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/api/api_access.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (c) 2014,2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/*qca808x_start*/ -#include "sw.h" -#include "fal.h" -/*qca808x_end*/ -#include "ref_vlan.h" -#if (defined(KERNEL_MODULE)) -#include "hsl.h" -#include "hsl_dev.h" -#if defined ATHENA -#include "fal_igmp.h" -#include "fal_leaky.h" -#include "athena_mib.h" -#include "athena_port_ctrl.h" -#include "athena_portvlan.h" -#include "athena_fdb.h" -#include "athena_vlan.h" -#include "athena_init.h" -#include "athena_reg_access.h" -#include "athena_reg.h" -#elif defined GARUDA -#include "garuda_mib.h" -#include "garuda_qos.h" -#include "garuda_rate.h" -#include "garuda_port_ctrl.h" -#include "garuda_portvlan.h" -#include "garuda_fdb.h" -#include "garuda_vlan.h" -#include "garuda_mirror.h" -#include "garuda_stp.h" -#include "garuda_misc.h" -#include "garuda_leaky.h" -#include "garuda_igmp.h" -#include "garuda_acl.h" -#include "garuda_led.h" -#include "garuda_init.h" -#include "garuda_reg_access.h" -#include "garuda_reg.h" -#elif defined SHIVA -#include "shiva_mib.h" -#include "shiva_qos.h" -#include "shiva_rate.h" -#include "shiva_port_ctrl.h" -#include "shiva_portvlan.h" -#include "shiva_fdb.h" -#include "shiva_vlan.h" -#include "shiva_mirror.h" -#include "shiva_stp.h" -#include "shiva_misc.h" -#include "shiva_leaky.h" -#include "shiva_igmp.h" -#include "shiva_acl.h" -#include "shiva_led.h" -#include "shiva_init.h" -#include "shiva_reg_access.h" -#include "shiva_reg.h" -#elif defined HORUS -#include "horus_mib.h" -#include "horus_qos.h" -#include "horus_rate.h" -#include "horus_port_ctrl.h" -#include "horus_portvlan.h" -#include "horus_fdb.h" -#include "horus_vlan.h" -#include "horus_mirror.h" -#include "horus_stp.h" -#include "horus_misc.h" -#include "horus_leaky.h" -#include "horus_igmp.h" -#include "horus_led.h" -#include "horus_init.h" -#include "horus_reg_access.h" -#include "horus_reg.h" -#elif defined ISIS -#include "isis_mib.h" -#include "isis_qos.h" -#include "isis_cosmap.h" -#include "isis_rate.h" -#include "isis_port_ctrl.h" -#include "isis_portvlan.h" -#include "isis_fdb.h" -#include "isis_vlan.h" -#include "isis_mirror.h" -#include "isis_stp.h" -#include "isis_misc.h" -#include "isis_leaky.h" -#include "isis_igmp.h" -#include "isis_acl.h" -#include "isis_led.h" -#include "isis_cosmap.h" -#include "isis_ip.h" -#include "isis_nat.h" -#include "isis_trunk.h" -#include "isis_sec.h" -#include "isis_interface_ctrl.h" -#include "isis_init.h" -#include "isis_reg_access.h" -#include "isis_reg.h" -#elif defined ISISC -#include "isisc_mib.h" -#include "isisc_qos.h" -#include "isisc_cosmap.h" -#include "isisc_rate.h" -#include "isisc_port_ctrl.h" -#include "isisc_portvlan.h" -#include "isisc_fdb.h" -#include "isisc_vlan.h" -#include "isisc_mirror.h" -#include "isisc_stp.h" -#include "isisc_misc.h" -#include "isisc_leaky.h" -#include "isisc_igmp.h" -#include "isisc_acl.h" -#include "isisc_led.h" -#include "isisc_cosmap.h" -#include "isisc_ip.h" -#include "isisc_nat.h" -#include "isisc_trunk.h" -#include "isisc_sec.h" -#include "isisc_interface_ctrl.h" -#include "isisc_init.h" -#include "isisc_reg_access.h" -#include "isisc_reg.h" -#endif -#endif -/*qca808x_start*/ -#include "sw_api.h" -#include "api_desc.h" -/*qca808x_end*/ -#if (((!defined(USER_MODE)) && defined(KERNEL_MODULE)) || (defined(USER_MODE) && (!defined(KERNEL_MODULE)))) -#ifdef HSL_STANDALONG -#if defined ATHENA -#include "athena_api.h" -#elif defined GARUDA -#include "garuda_api.h" -#elif defined SHIVA -#include "shiva_api.h" -#elif defined HORUS -#include "horus_api.h" -#elif defined ISIS -#include "isis_api.h" -#elif defined ISISC -#include "isisc_api.h" -#endif -#else -#include "ref_api.h" -#include "fal_api.h" -#endif -#elif (defined(USER_MODE)) -#if defined ATHENA -#include "athena_api.h" -#elif defined GARUDA -#include "garuda_api.h" -#elif defined SHIVA -#include "shiva_api.h" -#elif defined HORUS -#include "horus_api.h" -#elif defined ISIS -#include "isis_api.h" -#elif defined ISISC -#include "isisc_api.h" -#endif -#else -#include "ref_api.h" -/*qca808x_start*/ -#include "fal_api.h" -/*qca808x_end*/ -#endif -/*qca808x_start*/ -static sw_api_func_t sw_api_func[] = { -/*qca808x_end*/ - SSDK_REF_API -/*qca808x_start*/ - SSDK_API }; -static sw_api_param_t sw_api_param[] = { -/*qca808x_end*/ - SSDK_REF_PARAM -/*qca808x_start*/ - SSDK_PARAM }; - -sw_api_func_t * -sw_api_func_find(a_uint32_t api_id) -{ - a_uint32_t i = 0; - static a_uint32_t save = 0; - - if(api_id == sw_api_func[save].api_id) - return &sw_api_func[save]; - - do - { - if (api_id == sw_api_func[i].api_id) - { - save = i; - return &sw_api_func[i]; - } - - } - while (++i < (sizeof(sw_api_func)/sizeof(sw_api_func[0]))); - - return NULL; -} - -sw_api_param_t * -sw_api_param_find(a_uint32_t api_id) -{ - a_uint32_t i = 0; - static a_uint32_t save = 0; - - if(api_id == sw_api_param[save].api_id) - return &sw_api_param[save]; - - do - { - if (api_id == sw_api_param[i].api_id) - { - save = i; - return &sw_api_param[i]; - } - } - while (++i < (sizeof(sw_api_param)/sizeof(sw_api_param[0]))); - - return NULL; -} - -a_uint32_t -sw_api_param_nums(a_uint32_t api_id) -{ - a_uint32_t i = 0; - sw_api_param_t *p = NULL; - static sw_api_param_t *savep = NULL; - static a_uint32_t save = 0; - - p = sw_api_param_find(api_id); - if (!p) - { - return 0; - } - - if (p == savep) - { - return save; - } - - savep = p; - while (api_id == p->api_id) - { - p++; - i++; - } - - /*error*/ - if(i >= sizeof(sw_api_param)/sizeof(sw_api_param[0])) - { - savep = NULL; - save = 0; - return 0; - } - save = i; - - return i; -} - -sw_error_t -sw_api_get(sw_api_t *sw_api) -{ - if(!sw_api) - return SW_FAIL; - - if ((sw_api->api_fp = sw_api_func_find(sw_api->api_id)) == NULL) - return SW_NOT_SUPPORTED; - - if ((sw_api->api_pp = sw_api_param_find(sw_api->api_id)) == NULL) - return SW_NOT_SUPPORTED; - - if((sw_api->api_nr = sw_api_param_nums(sw_api->api_id)) == 0) - return SW_NOT_SUPPORTED; - - return SW_OK; -} -/*qca808x_end*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/Makefile deleted file mode 100755 index 34612d390..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/Makefile +++ /dev/null @@ -1,141 +0,0 @@ -LOC_DIR=src/fal_uk -LIB=UK_IF - -include $(PRJ_PATH)/make/config.mk - -SRC_LIST=fal_init.c fal_uk_if.c fal_reg_access.c - -ifeq (TRUE, $(IN_ACL)) - SRC_LIST += fal_acl.c -endif - -ifeq (TRUE, $(IN_FDB)) - SRC_LIST += fal_fdb.c -endif - -ifeq (TRUE, $(IN_IGMP)) - SRC_LIST += fal_igmp.c -endif - -ifeq (TRUE, $(IN_LEAKY)) - SRC_LIST += fal_leaky.c -endif - -ifeq (TRUE, $(IN_LED)) - SRC_LIST += fal_led.c -endif - -ifeq (TRUE, $(IN_MIB)) - SRC_LIST += fal_mib.c -endif - -ifeq (TRUE, $(IN_MIRROR)) - SRC_LIST += fal_mirror.c -endif - -ifeq (TRUE, $(IN_MISC)) - SRC_LIST += fal_misc.c -endif - -ifeq (TRUE, $(IN_PORTCONTROL)) - SRC_LIST += fal_port_ctrl.c -endif - -ifeq (TRUE, $(IN_PORTVLAN)) - SRC_LIST += fal_portvlan.c -endif - -ifeq (TRUE, $(IN_QOS)) - SRC_LIST += fal_qos.c -endif - -ifeq (TRUE, $(IN_RATE)) - SRC_LIST += fal_rate.c -endif - -ifeq (TRUE, $(IN_STP)) - SRC_LIST += fal_stp.c -endif - -ifeq (TRUE, $(IN_VLAN)) - SRC_LIST += fal_vlan.c -endif - -ifeq (TRUE, $(IN_COSMAP)) - SRC_LIST += fal_cosmap.c -endif - -ifeq (TRUE, $(IN_IP)) - SRC_LIST += fal_ip.c -endif - -ifeq (TRUE, $(IN_NAT)) - SRC_LIST += fal_nat.c -endif - -ifeq (TRUE, $(IN_SEC)) - SRC_LIST += fal_sec.c -endif - -ifeq (TRUE, $(IN_TRUNK)) - SRC_LIST += fal_trunk.c -endif - -ifeq (TRUE, $(IN_INTERFACECONTROL)) - SRC_LIST += fal_interface_ctrl.c -endif - -ifeq (TRUE, $(IN_CTRLPKT)) - SRC_LIST += fal_ctrlpkt.c -endif - -ifeq (TRUE, $(IN_SERVCODE)) - SRC_LIST += fal_servcode.c -endif - -ifeq (TRUE, $(IN_RSS_HASH)) - SRC_LIST += fal_rss_hash.c -endif - -ifeq (TRUE, $(IN_VSI)) - SRC_LIST += fal_vsi.c -endif - -ifeq (TRUE, $(IN_QM)) - SRC_LIST += fal_qm.c -endif - - -ifeq (TRUE, $(IN_FLOW)) - SRC_LIST += fal_flow.c -endif - -ifeq (TRUE, $(IN_PPPOE)) - SRC_LIST += fal_pppoe.c -endif - -ifeq (TRUE, $(IN_BM)) - SRC_LIST += fal_bm.c -endif - -ifeq (TRUE, $(IN_SHAPER)) - SRC_LIST += fal_shaper.c -endif - -ifeq (TRUE, $(IN_POLICER)) - SRC_LIST += fal_policer.c -endif - -ifeq (TRUE, $(IN_PTP)) - SRC_LIST += fal_ptp.c -endif - -ifeq (TRUE, $(IN_SFP)) - SRC_LIST += fal_sfp.c -endif - -include $(PRJ_PATH)/make/components.mk -include $(PRJ_PATH)/make/defs.mk -include $(PRJ_PATH)/make/target.mk - -all: dep obj diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_acl.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_acl.c deleted file mode 100755 index 9f97bf300..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_acl.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#include "sw_ioctl.h" -#include "fal_acl.h" -#include "fal_uk_if.h" - -sw_error_t -fal_acl_list_creat(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t prio) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_LIST_CREAT, dev_id, list_id, prio); - return rv; -} - -sw_error_t -fal_acl_list_destroy(a_uint32_t dev_id, a_uint32_t list_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_LIST_DESTROY, dev_id, list_id); - return rv; -} - -sw_error_t -fal_acl_rule_add(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t rule_id, - a_uint32_t rule_nr, fal_acl_rule_t * rule) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_RULE_ADD, dev_id, list_id, rule_id, - rule_nr, rule); - return rv; -} - -sw_error_t -fal_acl_rule_delete(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t rule_id, - a_uint32_t rule_nr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_RULE_DELETE, dev_id, list_id, rule_id, rule_nr); - return rv; -} - -sw_error_t -fal_acl_rule_query(a_uint32_t dev_id, a_uint32_t list_id, a_uint32_t rule_id, - fal_acl_rule_t * rule) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_RULE_QUERY, dev_id, list_id, rule_id, rule); - return rv; -} - -sw_error_t -fal_acl_list_bind(a_uint32_t dev_id, a_uint32_t list_id, - fal_acl_direc_t direc, fal_acl_bind_obj_t obj_t, - a_uint32_t obj_idx) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_LIST_BIND, dev_id, list_id, direc, obj_t, obj_idx); - return rv; -} - -sw_error_t -fal_acl_list_unbind(a_uint32_t dev_id, a_uint32_t list_id, - fal_acl_direc_t direc, fal_acl_bind_obj_t obj_t, - a_uint32_t obj_idx) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_LIST_UNBIND, dev_id, list_id, direc, obj_t, obj_idx); - return rv; -} - -sw_error_t -fal_acl_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_STATUS_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_acl_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_acl_list_dump(a_uint32_t dev_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_LIST_DUMP, dev_id); - return rv; -} - -sw_error_t -fal_acl_rule_dump(a_uint32_t dev_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_RULE_DUMP, dev_id); - return rv; -} - -sw_error_t -fal_acl_port_udf_profile_set(a_uint32_t dev_id, fal_port_t port_id, - fal_acl_udf_type_t udf_type, a_uint32_t offset, a_uint32_t length) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_PT_UDF_PROFILE_SET, dev_id, port_id, udf_type, offset, length); - return rv; -} - -sw_error_t -fal_acl_port_udf_profile_get(a_uint32_t dev_id, fal_port_t port_id, - fal_acl_udf_type_t udf_type, a_uint32_t * offset, a_uint32_t * length) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_PT_UDF_PROFILE_GET, dev_id, port_id, - udf_type, offset, length); - return rv; -} - -sw_error_t -fal_acl_rule_active(a_uint32_t dev_id, a_uint32_t list_id, - a_uint32_t rule_id, a_uint32_t rule_nr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_RULE_ACTIVE, dev_id, list_id, rule_id, rule_nr); - return rv; -} - -sw_error_t -fal_acl_rule_deactive(a_uint32_t dev_id, a_uint32_t list_id, - a_uint32_t rule_id, a_uint32_t rule_nr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_RULE_DEACTIVE, dev_id, list_id, rule_id, rule_nr); - return rv; -} - -sw_error_t -fal_acl_rule_src_filter_sts_set(a_uint32_t dev_id, - a_uint32_t rule_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_RULE_SRC_FILTER_STS_SET, dev_id, rule_id, enable); - return rv; -} - -sw_error_t -fal_acl_rule_src_filter_sts_get(a_uint32_t dev_id, - a_uint32_t rule_id, a_bool_t* enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_RULE_SRC_FILTER_STS_GET, dev_id, rule_id, enable); - return rv; -} - -sw_error_t -fal_acl_udf_profile_set(a_uint32_t dev_id, fal_acl_udf_pkt_type_t pkt_type, - a_uint32_t udf_idx, fal_acl_udf_type_t udf_type, a_uint32_t offset) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_UDF_SET, dev_id, pkt_type, udf_idx, udf_type, offset); - return rv; -} - -sw_error_t -fal_acl_udf_profile_get(a_uint32_t dev_id, fal_acl_udf_pkt_type_t pkt_type, - a_uint32_t udf_idx, fal_acl_udf_type_t *udf_type, a_uint32_t *offset) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ACL_UDF_GET, dev_id, pkt_type, udf_idx, udf_type, offset); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_bm.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_bm.c deleted file mode 100755 index c822a867b..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_bm.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_bm.h" -#include "fal_uk_if.h" - -sw_error_t -fal_port_bufgroup_map_get(a_uint32_t dev_id, fal_port_t port, - a_uint8_t *group) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_PORTGROUP_MAP_GET, dev_id, port, group); - return rv; -} - -sw_error_t -fal_port_bufgroup_map_set(a_uint32_t dev_id, fal_port_t port, - a_uint8_t group) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_PORTGROUP_MAP_SET, dev_id, port, group); - return rv; -} - -sw_error_t -fal_bm_port_reserved_buffer_get(a_uint32_t dev_id, fal_port_t port, - a_uint16_t *prealloc_buff, a_uint16_t *react_buff) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_PORT_RSVBUFFER_GET, dev_id, port, - prealloc_buff, react_buff); - return rv; -} - -sw_error_t -fal_bm_port_reserved_buffer_set(a_uint32_t dev_id, fal_port_t port, - a_uint16_t prealloc_buff, a_uint16_t react_buff) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_PORT_RSVBUFFER_SET, dev_id, port, - prealloc_buff, react_buff); - return rv; -} - -sw_error_t -fal_bm_bufgroup_buffer_get(a_uint32_t dev_id, a_uint8_t group, - a_uint16_t *buff_num) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_GROUP_BUFFER_GET, dev_id, group, - buff_num); - return rv; -} - -sw_error_t -fal_bm_bufgroup_buffer_set(a_uint32_t dev_id, a_uint8_t group, - a_uint16_t buff_num) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_GROUP_BUFFER_SET, dev_id, group, - buff_num); - return rv; -} - -sw_error_t -fal_bm_port_dynamic_thresh_get(a_uint32_t dev_id, fal_port_t port, - fal_bm_dynamic_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_DYNAMIC_THRESH_GET, dev_id, port, - cfg); - return rv; -} - -sw_error_t -fal_bm_port_dynamic_thresh_set(a_uint32_t dev_id, fal_port_t port, - fal_bm_dynamic_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_DYNAMIC_THRESH_SET, dev_id, port, - cfg); - return rv; -} - -sw_error_t -fal_port_bm_ctrl_get(a_uint32_t dev_id, fal_port_t port, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_CTRL_GET, dev_id, port, - enable); - return rv; -} - -sw_error_t -fal_port_bm_ctrl_set(a_uint32_t dev_id, fal_port_t port, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_CTRL_SET, dev_id, port, - enable); - return rv; -} - -sw_error_t -fal_bm_port_static_thresh_get(a_uint32_t dev_id, fal_port_t port, - fal_bm_static_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_STATIC_THRESH_GET, dev_id, port, - cfg); - return rv; -} - -sw_error_t -fal_bm_port_static_thresh_set(a_uint32_t dev_id, fal_port_t port, - fal_bm_static_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_STATIC_THRESH_SET, dev_id, port, - cfg); - return rv; -} - -sw_error_t -fal_bm_port_counter_get(a_uint32_t dev_id, fal_port_t port, - fal_bm_port_counter_t *counter) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BM_PORT_COUNTER_GET, dev_id, port, - counter); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_cosmap.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_cosmap.c deleted file mode 100755 index 9b086884a..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_cosmap.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_cosmap.h" -#include "fal_uk_if.h" - - -sw_error_t -fal_cosmap_dscp_to_pri_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t pri) -{ - sw_error_t rv; - - rv= sw_uk_exec(SW_API_COSMAP_DSCP_TO_PRI_SET, dev_id, dscp, pri); - return rv; -} - -sw_error_t -fal_cosmap_dscp_to_pri_get(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t * pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_DSCP_TO_PRI_GET, dev_id, dscp, pri); - return rv; -} - -sw_error_t -fal_cosmap_dscp_to_dp_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t dp) -{ - sw_error_t rv; - - rv= sw_uk_exec(SW_API_COSMAP_DSCP_TO_DP_SET, dev_id, dscp, dp); - return rv; -} - -sw_error_t -fal_cosmap_dscp_to_dp_get(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t * dp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_DSCP_TO_DP_GET, dev_id, dscp, dp); - return rv; -} - -sw_error_t -fal_cosmap_up_to_pri_set(a_uint32_t dev_id, a_uint32_t up, a_uint32_t pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_TO_PRI_SET, dev_id, up, pri); - return rv; -} - -sw_error_t -fal_cosmap_up_to_pri_get(a_uint32_t dev_id, a_uint32_t up, a_uint32_t * pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_TO_PRI_GET, dev_id, up, pri); - return rv; -} - -sw_error_t -fal_cosmap_up_to_dp_set(a_uint32_t dev_id, a_uint32_t up, a_uint32_t dp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_TO_DP_SET, dev_id, up, dp); - return rv; -} - -sw_error_t -fal_cosmap_up_to_dp_get(a_uint32_t dev_id, a_uint32_t up, a_uint32_t * dp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_TO_DP_GET, dev_id, up, dp); - return rv; -} - -sw_error_t -fal_cosmap_pri_to_queue_set(a_uint32_t dev_id, a_uint32_t pri, - a_uint32_t queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_PRI_TO_QU_SET, dev_id, pri, queue); - return rv; -} - -sw_error_t -fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri, - a_uint32_t * queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_PRI_TO_QU_GET, dev_id, pri, queue); - return rv; -} - -sw_error_t -fal_cosmap_pri_to_ehqueue_set(a_uint32_t dev_id, a_uint32_t pri, - a_uint32_t queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_PRI_TO_EHQU_SET, dev_id, pri, queue); - return rv; -} - -sw_error_t -fal_cosmap_pri_to_ehqueue_get(a_uint32_t dev_id, a_uint32_t pri, - a_uint32_t * queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_PRI_TO_EHQU_GET, dev_id, pri, queue); - return rv; -} - -sw_error_t -fal_cosmap_egress_remark_set(a_uint32_t dev_id, a_uint32_t tbl_id, - fal_egress_remark_table_t * tbl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_EG_REMARK_SET, dev_id, tbl_id, tbl); - return rv; -} - -sw_error_t -fal_cosmap_egress_remark_get(a_uint32_t dev_id, a_uint32_t tbl_id, - fal_egress_remark_table_t * tbl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_EG_REMARK_GET, dev_id, tbl_id, tbl); - return rv; -} - -sw_error_t -fal_cosmap_dscp_to_ehpri_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t pri) -{ - sw_error_t rv; - - rv= sw_uk_exec(SW_API_COSMAP_DSCP_TO_EHPRI_SET, dev_id, dscp, pri); - return rv; -} - -sw_error_t -fal_cosmap_dscp_to_ehpri_get(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t * pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_DSCP_TO_EHPRI_GET, dev_id, dscp, pri); - return rv; -} - -sw_error_t -fal_cosmap_dscp_to_ehdp_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t dp) -{ - sw_error_t rv; - - rv= sw_uk_exec(SW_API_COSMAP_DSCP_TO_EHDP_SET, dev_id, dscp, dp); - return rv; -} - -sw_error_t -fal_cosmap_dscp_to_ehdp_get(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t * dp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_DSCP_TO_EHDP_GET, dev_id, dscp, dp); - return rv; -} - -sw_error_t -fal_cosmap_up_to_ehpri_set(a_uint32_t dev_id, a_uint32_t up, a_uint32_t pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_TO_EHPRI_SET, dev_id, up, pri); - return rv; -} - -sw_error_t -fal_cosmap_up_to_ehpri_get(a_uint32_t dev_id, a_uint32_t up, a_uint32_t * pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_TO_EHPRI_GET, dev_id, up, pri); - return rv; -} - -sw_error_t -fal_cosmap_up_to_ehdp_set(a_uint32_t dev_id, a_uint32_t up, a_uint32_t dp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_TO_EHDP_SET, dev_id, up, dp); - return rv; -} - -sw_error_t -fal_cosmap_up_to_ehdp_get(a_uint32_t dev_id, a_uint32_t up, a_uint32_t * dp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_TO_EHDP_GET, dev_id, up, dp); - return rv; -} \ No newline at end of file diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ctrlpkt.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ctrlpkt.c deleted file mode 100755 index af661c9fe..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ctrlpkt.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_ctrlpkt.h" -#include "fal_uk_if.h" - -sw_error_t -fal_mgmtctrl_ethtype_profile_set(a_uint32_t dev_id, a_uint32_t profile_id, a_uint32_t ethtype) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET, dev_id, profile_id, - (a_uint32_t) ethtype); - return rv; -} - -sw_error_t -fal_mgmtctrl_ethtype_profile_get(a_uint32_t dev_id, a_uint32_t profile_id, a_uint32_t * ethtype) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MGMTCTRL_ETHTYPE_PROFILE_GET, dev_id, profile_id, - ethtype); - return rv; -} - -sw_error_t -fal_mgmtctrl_rfdb_profile_set(a_uint32_t dev_id, a_uint32_t profile_id, fal_mac_addr_t *addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MGMTCTRL_RFDB_PROFILE_SET, dev_id, profile_id, - addr); - return rv; -} - -sw_error_t -fal_mgmtctrl_rfdb_profile_get(a_uint32_t dev_id, a_uint32_t profile_id, fal_mac_addr_t *addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MGMTCTRL_RFDB_PROFILE_GET, dev_id, profile_id, - addr); - return rv; -} - -sw_error_t -fal_mgmtctrl_ctrlpkt_profile_add(a_uint32_t dev_id, fal_ctrlpkt_profile_t *ctrlpkt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MGMTCTRL_CTRLPKT_PROFILE_ADD, dev_id, ctrlpkt); - return rv; -} - -sw_error_t -fal_mgmtctrl_ctrlpkt_profile_del(a_uint32_t dev_id, fal_ctrlpkt_profile_t *ctrlpkt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MGMTCTRL_CTRLPKT_PROFILE_DEL, dev_id, ctrlpkt); - return rv; -} - -sw_error_t -fal_mgmtctrl_ctrlpkt_profile_getfirst(a_uint32_t dev_id, fal_ctrlpkt_profile_t *ctrlpkt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETFIRST, dev_id, ctrlpkt); - return rv; -} - -sw_error_t -fal_mgmtctrl_ctrlpkt_profile_getnext(a_uint32_t dev_id, fal_ctrlpkt_profile_t *ctrlpkt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MGMTCTRL_CTRLPKT_PROFILE_GETNEXT, dev_id, ctrlpkt); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_fdb.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_fdb.c deleted file mode 100755 index 1f62e278b..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_fdb.c +++ /dev/null @@ -1,459 +0,0 @@ -/* - * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_fdb.h" -#include "fal_uk_if.h" - -sw_error_t -fal_fdb_entry_add(a_uint32_t dev_id, const fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_ADD, dev_id, entry); - return rv; -} - -sw_error_t -fal_fdb_entry_flush(a_uint32_t dev_id, a_uint32_t flag) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_DELALL, dev_id, flag); - return rv; -} - -sw_error_t -fal_fdb_entry_del_byport(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t flag) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_DELPORT, dev_id, port_id, flag); - return rv; -} - -sw_error_t -fal_fdb_entry_del_bymac(a_uint32_t dev_id, const fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_DELMAC, dev_id, entry); - return rv; -} - -sw_error_t -fal_fdb_entry_getfirst(a_uint32_t dev_id, fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_FIRST, dev_id, entry); - return rv; -} - -sw_error_t -fal_fdb_entry_getnext(a_uint32_t dev_id, fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_NEXT, dev_id, entry); - return rv; -} - -sw_error_t -fal_fdb_entry_search(a_uint32_t dev_id, fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_FIND, dev_id, entry); - return rv; -} - -sw_error_t -fal_fdb_port_learn_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_LEARN_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_fdb_port_learn_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_LEARN_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_fdb_port_learning_ctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_NEWADDR_LEARN_SET, dev_id, port_id, - enable, cmd); - return rv; -} - -sw_error_t -fal_fdb_port_learning_ctrl_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable, fal_fwd_cmd_t *cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_NEWADDR_LEARN_GET, dev_id, port_id, - enable, cmd); - return rv; -} - -sw_error_t -fal_fdb_port_stamove_ctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_STAMOVE_SET, dev_id, port_id, - enable, cmd); - return rv; -} - -sw_error_t -fal_fdb_port_stamove_ctrl_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable, fal_fwd_cmd_t *cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_STAMOVE_GET, dev_id, port_id, - enable, cmd); - return rv; -} - -sw_error_t -fal_fdb_aging_ctrl_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_AGE_CTRL_SET, dev_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_fdb_aging_ctrl_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_AGE_CTRL_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_fdb_learning_ctrl_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_LEARN_CTRL_SET, dev_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_fdb_learning_ctrl_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_LEARN_CTRL_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_fdb_vlan_ivl_svl_set(a_uint32_t dev_id, fal_fdb_smode smode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_VLAN_IVL_SVL_SET, dev_id, (a_uint32_t) smode); - return rv; -} - -sw_error_t -fal_fdb_vlan_ivl_svl_get(a_uint32_t dev_id, fal_fdb_smode* smode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_VLAN_IVL_SVL_GET, dev_id, smode); - return rv; -} - -sw_error_t -fal_fdb_aging_time_set(a_uint32_t dev_id, a_uint32_t * time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_AGE_TIME_SET, dev_id, time); - return rv; -} - -sw_error_t -fal_fdb_aging_time_get(a_uint32_t dev_id, a_uint32_t * time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_AGE_TIME_GET, dev_id, time); - return rv; -} - -sw_error_t -fal_fdb_entry_getnext_byindex(a_uint32_t dev_id, a_uint32_t * iterator, fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_ITERATE, dev_id, iterator, entry); - return rv; -} - -sw_error_t -fal_fdb_entry_extend_getnext(a_uint32_t dev_id, fal_fdb_op_t * option, - fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_EXTEND_NEXT, dev_id, option, entry); - return rv; -} - -sw_error_t -fal_fdb_entry_extend_getfirst(a_uint32_t dev_id, fal_fdb_op_t * option, - fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_EXTEND_FIRST, dev_id, option, entry); - return rv; -} - -sw_error_t -fal_fdb_entry_update_byport(a_uint32_t dev_id, fal_port_t old_port, fal_port_t new_port, - a_uint32_t fid, fal_fdb_op_t * option) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_TRANSFER, dev_id, old_port, new_port, fid, option); - return rv; -} - -sw_error_t -fal_fdb_port_learned_mac_counter_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * cnt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FDB_LEARN_COUNTER_GET, dev_id, port_id, cnt); - return rv; -} - -sw_error_t -fal_port_fdb_learn_limit_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable, a_uint32_t cnt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FDB_LEARN_LIMIT_SET, dev_id, port_id, enable, cnt); - return rv; -} - -sw_error_t -fal_port_fdb_learn_limit_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable, a_uint32_t * cnt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FDB_LEARN_LIMIT_GET, dev_id, port_id, enable, cnt); - return rv; -} - -sw_error_t -fal_port_fdb_learn_exceed_cmd_set(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FDB_LEARN_EXCEED_CMD_SET, dev_id, port_id, (a_uint32_t)cmd); - return rv; -} - -sw_error_t -fal_port_fdb_learn_exceed_cmd_get(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FDB_LEARN_EXCEED_CMD_GET, dev_id, port_id, cmd); - return rv; -} - -sw_error_t -fal_fdb_learn_limit_set(a_uint32_t dev_id, a_bool_t enable, a_uint32_t cnt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_LEARN_LIMIT_SET, dev_id, enable, cnt); - return rv; -} - -sw_error_t -fal_fdb_learn_limit_get(a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * cnt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_LEARN_LIMIT_GET, dev_id, enable, cnt); - return rv; -} - -sw_error_t -fal_fdb_learn_exceed_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_LEARN_EXCEED_CMD_SET, dev_id, (a_uint32_t)cmd); - return rv; -} - -sw_error_t -fal_fdb_learn_exceed_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_LEARN_EXCEED_CMD_GET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_fdb_resv_add(a_uint32_t dev_id, fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_RESV_ADD, dev_id, entry); - return rv; -} - -sw_error_t -fal_fdb_resv_del(a_uint32_t dev_id, fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_RESV_DEL, dev_id, entry); - return rv; -} - -sw_error_t -fal_fdb_resv_find(a_uint32_t dev_id, fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_RESV_FIND, dev_id, entry); - return rv; -} - -sw_error_t -fal_fdb_resv_iterate(a_uint32_t dev_id, a_uint32_t * iterator, fal_fdb_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_RESV_ITERATE, dev_id, iterator, entry); - return rv; -} - -sw_error_t -fal_fdb_port_learn_static_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_LEARN_STATIC_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_fdb_port_learn_static_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_LEARN_STATIC_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_fdb_port_add(a_uint32_t dev_id, a_uint32_t fid, fal_mac_addr_t * addr, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PORT_ADD, dev_id, fid, addr, port_id); - return rv; -} - -sw_error_t -fal_fdb_port_del(a_uint32_t dev_id, a_uint32_t fid, fal_mac_addr_t * addr, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PORT_DEL, dev_id, fid, addr, port_id); - return rv; -} - -sw_error_t -fal_fdb_rfs_set(a_uint32_t dev_id, fal_fdb_rfs_t *rfs) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_RFS_SET, dev_id, rfs); - return rv; -} - -sw_error_t -fal_fdb_rfs_del(a_uint32_t dev_id, fal_fdb_rfs_t *rfs) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_RFS_DEL, dev_id, rfs); - return rv; -} - -sw_error_t -fal_fdb_port_maclimit_ctrl_set(a_uint32_t dev_id, fal_port_t port_id, fal_maclimit_ctrl_t * maclimit_ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_MACLIMIT_CTRL_SET, dev_id, port_id, maclimit_ctrl); - return rv; -} - -sw_error_t -fal_fdb_port_maclimit_ctrl_get(a_uint32_t dev_id, fal_port_t port_id, fal_maclimit_ctrl_t * maclimit_ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_PT_MACLIMIT_CTRL_GET, dev_id, port_id, maclimit_ctrl); - return rv; -} - -sw_error_t -fal_fdb_entry_del_byfid(a_uint32_t dev_id, a_uint16_t fid, a_uint32_t flag) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FDB_DEL_BY_FID, dev_id, fid, flag); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_flow.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_flow.c deleted file mode 100755 index 8276c0eae..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_flow.c +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_flow.h" -#include "fal_uk_if.h" - - -sw_error_t -fal_flow_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_STATUS_SET, dev_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_flow_status_get(a_uint32_t dev_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_flow_age_timer_set(a_uint32_t dev_id, fal_flow_age_timer_t *age_timer) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_AGE_TIMER_SET, dev_id, age_timer); - return rv; -} - -sw_error_t -fal_flow_age_timer_get(a_uint32_t dev_id, fal_flow_age_timer_t *age_timer) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_AGE_TIMER_GET, dev_id, age_timer); - return rv; -} - -sw_error_t -fal_flow_mgmt_set( - a_uint32_t dev_id, - fal_flow_pkt_type_t type, - fal_flow_direction_t dir, - fal_flow_mgmt_t *mgmt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_CTRL_SET, dev_id, type, dir, mgmt); - return rv; -} - -sw_error_t -fal_flow_mgmt_get( - a_uint32_t dev_id, - fal_flow_pkt_type_t type, - fal_flow_direction_t dir, - fal_flow_mgmt_t *mgmt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_CTRL_GET, dev_id, type, dir, mgmt); - return rv; -} - -sw_error_t -fal_flow_entry_add( - a_uint32_t dev_id, - a_uint32_t add_mode, /*index or hash*/ - fal_flow_entry_t *flow_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_ENTRY_ADD, dev_id, add_mode, flow_entry); - return rv; -} - -sw_error_t -fal_flow_entry_del( - a_uint32_t dev_id, - a_uint32_t del_mode, - fal_flow_entry_t *flow_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_ENTRY_DEL, dev_id, del_mode, flow_entry); - return rv; -} - -sw_error_t -fal_flow_entry_next( - a_uint32_t dev_id, - a_uint32_t next_mode, - fal_flow_entry_t *flow_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOWENTRY_NEXT, dev_id, next_mode, flow_entry); - return rv; -} - -sw_error_t -fal_flow_entry_get( - a_uint32_t dev_id, - a_uint32_t get_mode, - fal_flow_entry_t *flow_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_ENTRY_GET, dev_id, get_mode, flow_entry); - return rv; -} - -sw_error_t -fal_flow_global_cfg_get( - a_uint32_t dev_id, - fal_flow_global_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_GLOBAL_CFG_GET, dev_id, cfg); - return rv; -} - -sw_error_t -fal_flow_global_cfg_set( - a_uint32_t dev_id, - fal_flow_global_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_GLOBAL_CFG_SET, dev_id, cfg); - return rv; -} - -sw_error_t -fal_flow_host_add( - a_uint32_t dev_id, - a_uint32_t add_mode, /*index or hash*/ - fal_flow_host_entry_t *flow_host_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_HOST_ADD, dev_id, add_mode, flow_host_entry); - return rv; -} - -sw_error_t -fal_flow_host_del( - a_uint32_t dev_id, - a_uint32_t del_mode, - fal_flow_host_entry_t *flow_host_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_HOST_DEL, dev_id, del_mode, flow_host_entry); - return rv; -} - -sw_error_t -fal_flow_host_get( - a_uint32_t dev_id, - a_uint32_t get_mode, - fal_flow_host_entry_t *flow_host_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_HOST_GET, dev_id, get_mode, flow_host_entry); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_igmp.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_igmp.c deleted file mode 100755 index b0728fd97..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_igmp.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_igmp.h" -#include "fal_uk_if.h" - -sw_error_t -fal_port_igmps_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_IGMPS_MODE_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_igmps_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_IGMPS_MODE_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_MLD_CMD_SET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_igmp_mld_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_MLD_CMD_GET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_port_igmp_mld_join_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_PT_JOIN_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_igmp_mld_join_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_PT_JOIN_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_igmp_mld_leave_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_PT_LEAVE_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_igmp_mld_leave_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_PT_LEAVE_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_rp_set(a_uint32_t dev_id, fal_pbmp_t pts) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_RP_SET, dev_id, pts); - return rv; -} - -sw_error_t -fal_igmp_mld_rp_get(a_uint32_t dev_id, fal_pbmp_t * pts) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_RP_GET, dev_id, pts); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_creat_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_CREAT_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_creat_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_CREAT_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_static_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_STATIC_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_static_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_STATIC_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_leaky_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_LEAKY_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_leaky_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_LEAKY_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_v3_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_V3_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_v3_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_V3_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_queue_set(a_uint32_t dev_id, a_bool_t enable, a_uint32_t queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_QUEUE_SET, dev_id, enable, queue); - return rv; -} - -sw_error_t -fal_igmp_mld_entry_queue_get(a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_ENTRY_QUEUE_GET, dev_id, enable, queue); - return rv; -} - -sw_error_t -fal_port_igmp_mld_learn_limit_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable, a_uint32_t cnt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_IGMP_LEARN_LIMIT_SET, dev_id, port_id, enable, cnt); - return rv; -} - -sw_error_t -fal_port_igmp_mld_learn_limit_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable, a_uint32_t * cnt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_IGMP_LEARN_LIMIT_GET, dev_id, port_id, enable, cnt); - return rv; -} - -sw_error_t -fal_port_igmp_mld_learn_exceed_cmd_set(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET, dev_id, port_id, cmd); - return rv; -} - -sw_error_t -fal_port_igmp_mld_learn_exceed_cmd_get(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET, dev_id, port_id, cmd); - return rv; -} - -sw_error_t -fal_igmp_sg_entry_set(a_uint32_t dev_id, fal_igmp_sg_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_SG_ENTRY_SET, dev_id, entry); - return rv; -} - -sw_error_t -fal_igmp_sg_entry_clear(a_uint32_t dev_id, fal_igmp_sg_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_SG_ENTRY_CLEAR, dev_id, entry); - return rv; -} - -sw_error_t -fal_igmp_sg_entry_show(a_uint32_t dev_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_SG_ENTRY_SHOW, dev_id); - return rv; -} - -sw_error_t -fal_igmp_sg_entry_query(a_uint32_t dev_id, fal_igmp_sg_info_t * info) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IGMP_SG_ENTRY_QUERY, dev_id, info); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_init.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_init.c deleted file mode 100755 index 0654a9c94..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_init.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/*qca808x_start*/ -#include "sw.h" -#include "sw_ioctl.h" -#include "ssdk_init.h" -#include "fal_init.h" -#include "fal_uk_if.h" -/*qca808x_end*/ -sw_error_t -fal_reset(a_uint32_t dev_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SWITCH_RESET, dev_id); - return rv; -} -/*qca808x_start*/ -sw_error_t -fal_ssdk_cfg(a_uint32_t dev_id, ssdk_cfg_t *ssdk_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SSDK_CFG, dev_id, ssdk_cfg); - return rv; -} -/*qca808x_end*/ -sw_error_t -fal_module_func_ctrl_set(a_uint32_t dev_id, a_uint32_t module, fal_func_ctrl_t *func_ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MODULE_FUNC_CTRL_SET, dev_id, module, func_ctrl); - return rv; -} - -sw_error_t -fal_module_func_ctrl_get(a_uint32_t dev_id, a_uint32_t module, fal_func_ctrl_t *func_ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MODULE_FUNC_CTRL_GET, dev_id, module, func_ctrl); - return rv; -} - - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_interface_ctrl.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_interface_ctrl.c deleted file mode 100755 index ef26a72c6..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_interface_ctrl.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_interface_ctrl.h" -#include "fal_uk_if.h" - -sw_error_t -fal_port_3az_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_3AZ_STATUS_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_3az_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_3AZ_STATUS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_interface_mac_mode_set(a_uint32_t dev_id, fal_port_t port_id, fal_mac_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MAC_MODE_SET, dev_id, port_id, config); - return rv; -} - -sw_error_t -fal_interface_mac_mode_get(a_uint32_t dev_id, fal_port_t port_id, fal_mac_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MAC_MODE_GET, dev_id, port_id, config); - return rv; -} - -sw_error_t -fal_interface_phy_mode_set(a_uint32_t dev_id, a_uint32_t phy_id, fal_phy_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PHY_MODE_SET, dev_id, phy_id, config); - return rv; -} - -sw_error_t -fal_interface_phy_mode_get(a_uint32_t dev_id, a_uint32_t phy_id, fal_phy_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PHY_MODE_GET, dev_id, phy_id, config); - return rv; -} - -sw_error_t -fal_interface_fx100_ctrl_set(a_uint32_t dev_id, fal_fx100_ctrl_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FX100_CTRL_SET, dev_id, config); - return rv; -} - -sw_error_t -fal_interface_fx100_ctrl_get(a_uint32_t dev_id, fal_fx100_ctrl_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FX100_CTRL_GET, dev_id, config); - return rv; -} - -sw_error_t -fal_interface_fx100_status_get(a_uint32_t dev_id, a_uint32_t *status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FX100_STATUS_GET, dev_id, status); - return rv; -} - -sw_error_t -fal_interface_mac06_exch_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MAC06_EXCH_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_interface_mac06_exch_get(a_uint32_t dev_id, a_bool_t* enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MAC06_EXCH_GET, dev_id, enable); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ip.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ip.c deleted file mode 100755 index 59f9cd6eb..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ip.c +++ /dev/null @@ -1,728 +0,0 @@ -/* - * Copyright (c) 2014, 2015, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_ip.h" -#include "fal_uk_if.h" - - -sw_error_t -fal_ip_host_add(a_uint32_t dev_id, fal_host_entry_t * host_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_HOST_ADD, dev_id, host_entry); - return rv; -} - -sw_error_t -fal_ip_host_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_host_entry_t * host_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_HOST_DEL, dev_id, del_mode, host_entry); - return rv; -} - -sw_error_t -fal_ip_host_get(a_uint32_t dev_id, a_uint32_t get_mode, fal_host_entry_t * host_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_HOST_GET, dev_id, get_mode, host_entry); - return rv; -} - -sw_error_t -fal_ip_host_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_host_entry_t * host_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_HOST_NEXT, dev_id, next_mode, host_entry); - return rv; -} - -sw_error_t -fal_ip_host_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id, a_uint32_t cnt_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_HOST_COUNTER_BIND, dev_id, entry_id, cnt_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_ip_host_pppoe_bind(a_uint32_t dev_id, a_uint32_t entry_id, a_uint32_t pppoe_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_HOST_PPPOE_BIND, dev_id, entry_id, pppoe_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_ip_pt_arp_learn_set(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t flags) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PT_ARP_LEARN_SET, dev_id, port_id, flags); - return rv; -} - -sw_error_t -fal_ip_pt_arp_learn_get(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t * flags) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PT_ARP_LEARN_GET, dev_id, port_id, flags); - return rv; -} - -sw_error_t -fal_ip_arp_learn_set(a_uint32_t dev_id, fal_arp_learn_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_ARP_LEARN_SET, dev_id, (a_uint32_t)mode); - return rv; -} - -sw_error_t -fal_ip_arp_learn_get(a_uint32_t dev_id, fal_arp_learn_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_ARP_LEARN_GET, dev_id, mode); - return rv; -} - -sw_error_t -fal_ip_source_guard_set(a_uint32_t dev_id, fal_port_t port_id, fal_source_guard_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_SOURCE_GUARD_SET, dev_id, port_id, (a_uint32_t)mode); - return rv; -} - -sw_error_t -fal_ip_source_guard_get(a_uint32_t dev_id, fal_port_t port_id, fal_source_guard_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_SOURCE_GUARD_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_ip_arp_guard_set(a_uint32_t dev_id, fal_port_t port_id, fal_source_guard_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_ARP_GUARD_SET, dev_id, port_id, (a_uint32_t)mode); - return rv; -} - -sw_error_t -fal_ip_arp_guard_get(a_uint32_t dev_id, fal_port_t port_id, fal_source_guard_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_ARP_GUARD_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_ip_route_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_ROUTE_STATUS_SET, dev_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_ip_route_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_ROUTE_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_ip_intf_entry_add(a_uint32_t dev_id, fal_intf_mac_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_INTF_ENTRY_ADD, dev_id, entry); - return rv; -} - -sw_error_t -fal_ip_intf_entry_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_intf_mac_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_INTF_ENTRY_DEL, dev_id, del_mode, entry); - return rv; -} - -sw_error_t -fal_ip_intf_entry_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_intf_mac_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_INTF_ENTRY_NEXT, dev_id, next_mode, entry); - return rv; -} - -sw_error_t -fal_ip_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_UNK_SOURCE_CMD_SET, dev_id, (a_uint32_t) cmd); - return rv; -} - -sw_error_t -fal_ip_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_UNK_SOURCE_CMD_GET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_arp_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ARP_UNK_SOURCE_CMD_SET, dev_id, (a_uint32_t) cmd); - return rv; -} - -sw_error_t -fal_arp_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ARP_UNK_SOURCE_CMD_GET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_ip_age_time_set(a_uint32_t dev_id, a_uint32_t * time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_AGE_TIME_SET, dev_id, time); - return rv; -} - -sw_error_t -fal_ip_age_time_get(a_uint32_t dev_id, a_uint32_t * time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_AGE_TIME_GET, dev_id, time); - return rv; -} - -sw_error_t -fal_ip_wcmp_hash_mode_set(a_uint32_t dev_id, a_uint32_t hash_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_WCMP_HASH_MODE_SET, dev_id, hash_mode); - return rv; -} - -sw_error_t -fal_ip_wcmp_hash_mode_get(a_uint32_t dev_id, a_uint32_t * hash_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_WCMP_HASH_MODE_GET, dev_id, hash_mode); - return rv; -} - -sw_error_t -fal_ip_vrf_base_addr_set(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VRF_BASE_ADDR_SET, dev_id, vrf_id, addr); - return rv; -} - -sw_error_t -fal_ip_vrf_base_addr_get(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t * addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VRF_BASE_ADDR_GET, dev_id, vrf_id, addr); - return rv; -} - -sw_error_t -fal_ip_vrf_base_mask_set(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VRF_BASE_MASK_SET, dev_id, vrf_id, addr); - return rv; -} - -sw_error_t -fal_ip_vrf_base_mask_get(a_uint32_t dev_id, a_uint32_t vrf_id, fal_ip4_addr_t * addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VRF_BASE_MASK_GET, dev_id, vrf_id, addr); - return rv; -} - -sw_error_t -fal_ip_default_route_set(a_uint32_t dev_id, a_uint32_t droute_id, - fal_default_route_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_DEFAULT_ROUTE_SET, dev_id, droute_id, entry); - return rv; -} - -sw_error_t -fal_ip_default_route_get(a_uint32_t dev_id, a_uint32_t droute_id, - fal_default_route_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_DEFAULT_ROUTE_GET, dev_id, droute_id, entry); - return rv; -} - -sw_error_t -fal_ip_host_route_set(a_uint32_t dev_id, a_uint32_t hroute_id, - fal_host_route_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_HOST_ROUTE_SET, dev_id, hroute_id, entry); - return rv; -} - -sw_error_t -fal_ip_host_route_get(a_uint32_t dev_id, a_uint32_t hroute_id, - fal_host_route_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_HOST_ROUTE_GET, dev_id, hroute_id, entry); - return rv; -} - -sw_error_t -fal_ip_wcmp_entry_set(a_uint32_t dev_id, a_uint32_t wcmp_id, - fal_ip_wcmp_t * wcmp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_WCMP_ENTRY_SET, dev_id, wcmp_id, wcmp); - return rv; -} - - -sw_error_t -fal_ip_wcmp_entry_get(a_uint32_t dev_id, a_uint32_t wcmp_id, - fal_ip_wcmp_t * wcmp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_WCMP_ENTRY_GET, dev_id, wcmp_id, wcmp); - return rv; -} - -sw_error_t -fal_ip_rfs_ip4_rule_set(a_uint32_t dev_id, - fal_ip4_rfs_t * rfs) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_RFS_IP4_SET, dev_id, rfs); - return rv; -} - -sw_error_t -fal_ip_rfs_ip6_rule_set(a_uint32_t dev_id, - fal_ip6_rfs_t * rfs) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_RFS_IP6_SET, dev_id, rfs); - return rv; -} - -sw_error_t -fal_ip_rfs_ip4_rule_del(a_uint32_t dev_id, - fal_ip4_rfs_t * rfs) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_RFS_IP4_DEL, dev_id, rfs); - return rv; -} - -sw_error_t -fal_ip_rfs_ip6_rule_del(a_uint32_t dev_id, - fal_ip6_rfs_t * rfs) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_RFS_IP6_DEL, dev_id, rfs); - return rv; -} - -sw_error_t -fal_default_flow_cmd_set(a_uint32_t dev_id, a_uint32_t vrf_id, - fal_flow_type_t type, fal_default_flow_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_DEFAULT_FLOW_CMD_SET, dev_id, vrf_id, type, (a_uint32_t) cmd); - return rv; -} - -sw_error_t -fal_default_flow_cmd_get(a_uint32_t dev_id, a_uint32_t vrf_id, - fal_flow_type_t type, fal_default_flow_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_DEFAULT_FLOW_CMD_GET, dev_id, vrf_id, type, cmd); - return rv; -} - -sw_error_t -fal_default_rt_flow_cmd_set(a_uint32_t dev_id, a_uint32_t vrf_id, - fal_flow_type_t type, fal_default_flow_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_DEFAULT_RT_FLOW_CMD_SET, dev_id, vrf_id, type, (a_uint32_t) cmd); - return rv; -} - -sw_error_t -fal_default_rt_flow_cmd_get(a_uint32_t dev_id, a_uint32_t vrf_id, - fal_flow_type_t type, fal_default_flow_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_DEFAULT_RT_FLOW_CMD_GET, dev_id, vrf_id, type, cmd); - return rv; -} - -sw_error_t -fal_ip_vsi_arp_sg_cfg_set(a_uint32_t dev_id, a_uint32_t vsi, - fal_arp_sg_cfg_t *arp_sg_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VIS_ARP_SG_CFG_SET, dev_id, vsi, arp_sg_cfg); - return rv; -} - -sw_error_t -fal_ip_vsi_arp_sg_cfg_get(a_uint32_t dev_id, a_uint32_t vsi, - fal_arp_sg_cfg_t *arp_sg_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VIS_ARP_SG_CFG_GET, dev_id, vsi, arp_sg_cfg); - return rv; -} - -sw_error_t -fal_ip_network_route_add(a_uint32_t dev_id, - a_uint32_t index, - fal_network_route_entry_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_NETWORK_ROUTE_ADD, dev_id, index, entry); - return rv; -} - -sw_error_t -fal_ip_network_route_get(a_uint32_t dev_id, - a_uint32_t index, a_uint8_t type, - fal_network_route_entry_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_NETWORK_ROUTE_GET, dev_id, index, type, entry); - return rv; -} - -sw_error_t -fal_ip_intf_set( - a_uint32_t dev_id, - a_uint32_t index, - fal_intf_entry_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_INTF_SET, dev_id, index, entry); - return rv; -} - -sw_error_t -fal_ip_intf_get( - a_uint32_t dev_id, - a_uint32_t index, - fal_intf_entry_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_INTF_GET, dev_id, index, entry); - return rv; -} - -sw_error_t -fal_ip_vsi_intf_set(a_uint32_t dev_id, a_uint32_t vsi, fal_intf_id_t *id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VSI_INTF_SET, dev_id, vsi, id); - return rv; -} - -sw_error_t -fal_ip_vsi_intf_get(a_uint32_t dev_id, a_uint32_t vsi, fal_intf_id_t *id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VSI_INTF_GET, dev_id, vsi, id); - return rv; -} - -sw_error_t -fal_ip_port_intf_set(a_uint32_t dev_id, fal_port_t port_id, fal_intf_id_t *id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PORT_INTF_SET, dev_id, port_id, id); - return rv; -} - -sw_error_t -fal_ip_port_intf_get(a_uint32_t dev_id, fal_port_t port_id, fal_intf_id_t *id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PORT_INTF_GET, dev_id, port_id, id); - return rv; -} - -sw_error_t -fal_ip_nexthop_set(a_uint32_t dev_id, a_uint32_t index, - fal_ip_nexthop_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_NEXTHOP_SET, dev_id, index, entry); - return rv; -} - -sw_error_t -fal_ip_nexthop_get(a_uint32_t dev_id, a_uint32_t index, - fal_ip_nexthop_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_NEXTHOP_GET, dev_id, index, entry); - return rv; -} - -sw_error_t -fal_ip_port_sg_cfg_set(a_uint32_t dev_id, fal_port_t port_id, - fal_sg_cfg_t *sg_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PORT_SG_SET, dev_id, port_id, sg_cfg); - return rv; -} - -sw_error_t -fal_ip_port_sg_cfg_get(a_uint32_t dev_id, fal_port_t port_id, - fal_sg_cfg_t *sg_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PORT_SG_GET, dev_id, port_id, sg_cfg); - return rv; -} - -sw_error_t -fal_ip_vsi_sg_cfg_get(a_uint32_t dev_id, a_uint32_t vsi, - fal_sg_cfg_t *sg_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VSI_SG_GET, dev_id, vsi, sg_cfg); - return rv; -} - -sw_error_t -fal_ip_vsi_sg_cfg_set(a_uint32_t dev_id, a_uint32_t vsi, - fal_sg_cfg_t *sg_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VSI_SG_SET, dev_id, vsi, sg_cfg); - return rv; -} - -sw_error_t -fal_ip_pub_addr_set(a_uint32_t dev_id, a_uint32_t index, - fal_ip_pub_addr_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PUB_IP_SET, dev_id, index, entry); - return rv; -} - -sw_error_t -fal_ip_network_route_del(a_uint32_t dev_id, a_uint32_t index, a_uint8_t type) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_NETWORK_ROUTE_DEL, dev_id, index, type); - return rv; -} - -sw_error_t -fal_ip_pub_addr_get(a_uint32_t dev_id, a_uint32_t index, fal_ip_pub_addr_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PUB_IP_GET, dev_id, index, entry); - return rv; -} - -sw_error_t - fal_ip_port_macaddr_set(a_uint32_t dev_id, fal_port_t port_id, - fal_macaddr_entry_t *macaddr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PORT_MAC_SET, dev_id, port_id, macaddr); - return rv; -} - -sw_error_t -fal_ip_port_macaddr_get(a_uint32_t dev_id, fal_port_t port_id, - fal_macaddr_entry_t *macaddr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PORT_MAC_GET, dev_id, port_id, macaddr); - return rv; -} - -sw_error_t -fal_ip_route_mismatch_action_set(a_uint32_t dev_id, fal_fwd_cmd_t action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_ROUTE_MISS_SET, dev_id, (a_uint32_t)action); - return rv; -} - -sw_error_t -fal_ip_route_mismatch_action_get(a_uint32_t dev_id, fal_fwd_cmd_t *action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_ROUTE_MISS_GET, dev_id, action); - return rv; -} - -sw_error_t -fal_ip_port_arp_sg_cfg_set(a_uint32_t dev_id, fal_port_t port_id, - fal_arp_sg_cfg_t *arp_sg_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PORT_ARP_SG_SET, dev_id, port_id, arp_sg_cfg); - return rv; -} - -sw_error_t -fal_ip_port_arp_sg_cfg_get(a_uint32_t dev_id, fal_port_t port_id, - fal_arp_sg_cfg_t *arp_sg_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_PORT_ARP_SG_GET, dev_id, port_id, arp_sg_cfg); - return rv; -} - -sw_error_t -fal_ip_vsi_mc_mode_set(a_uint32_t dev_id, a_uint32_t vsi, - fal_mc_mode_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VSI_MC_MODE_SET, dev_id, vsi, cfg); - return rv; -} - -sw_error_t -fal_ip_vsi_mc_mode_get(a_uint32_t dev_id, a_uint32_t vsi, - fal_mc_mode_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_IP_VSI_MC_MODE_GET, dev_id, vsi, cfg); - return rv; -} - -sw_error_t -fal_ip_global_ctrl_get(a_uint32_t dev_id, fal_ip_global_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_GLOBAL_CTRL_GET, dev_id, cfg); - return rv; -} - -sw_error_t -fal_ip_global_ctrl_set(a_uint32_t dev_id, fal_ip_global_cfg_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_GLOBAL_CTRL_SET, dev_id, cfg); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_leaky.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_leaky.c deleted file mode 100755 index 917fd4497..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_leaky.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_leaky.h" -#include "fal_uk_if.h" - -sw_error_t -fal_uc_leaky_mode_set(a_uint32_t dev_id, fal_leaky_ctrl_mode_t ctrl_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UC_LEAKY_MODE_SET, dev_id, ctrl_mode); - return rv; -} - -sw_error_t -fal_uc_leaky_mode_get(a_uint32_t dev_id, fal_leaky_ctrl_mode_t * ctrl_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UC_LEAKY_MODE_GET, dev_id, ctrl_mode); - return rv; -} - -sw_error_t -fal_mc_leaky_mode_set(a_uint32_t dev_id, fal_leaky_ctrl_mode_t ctrl_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MC_LEAKY_MODE_SET, dev_id, ctrl_mode); - return rv; -} - -sw_error_t -fal_mc_leaky_mode_get(a_uint32_t dev_id, fal_leaky_ctrl_mode_t * ctrl_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MC_LEAKY_MODE_GET, dev_id, ctrl_mode); - return rv; -} - -sw_error_t -fal_port_arp_leaky_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ARP_LEAKY_MODE_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_arp_leaky_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ARP_LEAKY_MODE_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_uc_leaky_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_UC_LEAKY_MODE_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_uc_leaky_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_UC_LEAKY_MODE_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_mc_leaky_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MC_LEAKY_MODE_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_mc_leaky_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MC_LEAKY_MODE_GET, dev_id, port_id, enable); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_led.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_led.c deleted file mode 100755 index 996ea2a90..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_led.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_led.h" -#include "fal_uk_if.h" - - -sw_error_t -fal_led_ctrl_pattern_set(a_uint32_t dev_id, led_pattern_group_t group, - led_pattern_id_t id, led_ctrl_pattern_t * pattern) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_LED_PATTERN_SET, dev_id, group, - id, pattern); - return rv; -} - -sw_error_t -fal_led_ctrl_pattern_get(a_uint32_t dev_id, led_pattern_group_t group, - led_pattern_id_t id, led_ctrl_pattern_t * pattern) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_LED_PATTERN_GET, dev_id, group, - id, pattern); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_mib.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_mib.c deleted file mode 100755 index aa24b7413..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_mib.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_mib.h" -#include "fal_uk_if.h" - -sw_error_t -fal_get_mib_info(a_uint32_t dev_id, fal_port_t port_id, - fal_mib_info_t * mib_Info) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MIB_GET, dev_id, port_id, mib_Info); - return rv; -} - -sw_error_t -fal_get_xgmib_info(a_uint32_t dev_id, fal_port_t port_id, - fal_xgmib_info_t * mib_Info) -{ - sw_error_t rv; - rv = sw_uk_exec(SW_API_PT_XGMIB_GET, dev_id, port_id, mib_Info); - return rv; -} -sw_error_t -fal_mib_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIB_STATUS_SET, dev_id, (a_uint32_t)enable); - return rv; -} - -sw_error_t -fal_mib_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIB_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_mib_port_flush_counters(a_uint32_t dev_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MIB_FLUSH_COUNTERS, dev_id, port_id); - return rv; -} - -sw_error_t -fal_mib_cpukeep_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIB_CPU_KEEP_SET, dev_id, (a_uint32_t)enable); - return rv; -} - -sw_error_t -fal_mib_cpukeep_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIB_CPU_KEEP_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_mib_counter_get(a_uint32_t dev_id, fal_port_t port_id, - fal_mib_counter_t * mib_Info) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MIB_COUNTER_GET, dev_id, port_id, mib_Info); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_mirror.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_mirror.c deleted file mode 100755 index 32b03a52a..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_mirror.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_mirror.h" -#include "fal_uk_if.h" - -sw_error_t -fal_mirr_analysis_port_set(a_uint32_t dev_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIRROR_ANALY_PT_SET, dev_id, port_id); - return rv; -} - -sw_error_t -fal_mirr_analysis_port_get(a_uint32_t dev_id, fal_port_t * port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIRROR_ANALY_PT_GET, dev_id, - port_id); - return rv; -} - -sw_error_t -fal_mirr_port_in_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIRROR_IN_PT_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_mirr_port_in_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIRROR_IN_PT_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_mirr_port_eg_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIRROR_EG_PT_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_mirr_port_eg_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIRROR_EG_PT_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_mirr_analysis_config_set(a_uint32_t dev_id, fal_mirr_direction_t direction, fal_mirr_analysis_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIRROR_ANALYSIS_CONFIG_SET, dev_id, direction, config); - return rv; -} - -sw_error_t -fal_mirr_analysis_config_get(a_uint32_t dev_id, fal_mirr_direction_t direction, fal_mirr_analysis_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MIRROR_ANALYSIS_CONFIG_GET, dev_id, direction, config); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_misc.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_misc.c deleted file mode 100755 index de7d21148..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_misc.c +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_misc.h" -#include "fal_uk_if.h" - -sw_error_t -fal_arp_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ARP_STATUS_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_arp_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ARP_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_frame_max_size_set(a_uint32_t dev_id, a_uint32_t size) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FRAME_MAX_SIZE_SET, dev_id, size); - return rv; -} - -sw_error_t -fal_frame_max_size_get(a_uint32_t dev_id, a_uint32_t * size) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FRAME_MAX_SIZE_GET, dev_id, size); - return rv; -} - -sw_error_t -fal_port_unk_sa_cmd_set(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_UNK_SA_CMD_SET, dev_id, port_id, - cmd); - return rv; -} - -sw_error_t -fal_port_unk_sa_cmd_get(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_UNK_SA_CMD_GET, dev_id, port_id, - cmd); - return rv; -} - -sw_error_t -fal_port_unk_uc_filter_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_UNK_UC_FILTER_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_unk_uc_filter_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_UNK_UC_FILTER_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_unk_mc_filter_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_UNK_MC_FILTER_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_unk_mc_filter_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_UNK_MC_FILTER_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_bc_filter_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_BC_FILTER_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_bc_filter_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_BC_FILTER_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_cpu_port_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_CPU_PORT_STATUS_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_cpu_port_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_CPU_PORT_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_bc_to_cpu_port_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BC_TO_CPU_PORT_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_bc_to_cpu_port_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BC_TO_CPU_PORT_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_port_dhcp_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DHCP_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_dhcp_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DHCP_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_arp_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ARP_CMD_SET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_arp_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_ARP_CMD_GET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_eapol_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_EAPOL_CMD_SET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_eapol_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_EAPOL_CMD_GET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_eapol_status_set(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_EAPOL_STATUS_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_eapol_status_get(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_EAPOL_STATUS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_ripv1_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RIPV1_STATUS_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_ripv1_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RIPV1_STATUS_GET, dev_id, enable); - return rv; -} - - -sw_error_t -fal_port_arp_req_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_ARP_REQ_STATUS_SET, dev_id, port_id, enable); - return rv; -} - - -sw_error_t -fal_port_arp_req_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_ARP_REQ_STATUS_GET, dev_id, port_id, enable); - return rv; -} - - -sw_error_t -fal_port_arp_ack_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_ARP_ACK_STATUS_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_arp_ack_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_ARP_ACK_STATUS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_intr_mask_set(a_uint32_t dev_id, a_uint32_t intr_mask) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_MASK_SET, dev_id, intr_mask); - return rv; -} - -sw_error_t -fal_intr_mask_get(a_uint32_t dev_id, a_uint32_t * intr_mask) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_MASK_GET, dev_id, intr_mask); - return rv; -} - -sw_error_t -fal_intr_status_get(a_uint32_t dev_id, a_uint32_t * intr_status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_STATUS_GET, dev_id, intr_status); - return rv; -} - -sw_error_t -fal_intr_status_clear(a_uint32_t dev_id, a_uint32_t intr_status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_STATUS_CLEAR, dev_id, intr_status); - return rv; -} - -sw_error_t -fal_intr_port_link_mask_set(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t intr_mask) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_PORT_LINK_MASK_SET, dev_id, port_id, intr_mask); - return rv; -} - -sw_error_t -fal_intr_port_link_mask_get(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t * intr_mask) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_PORT_LINK_MASK_GET, dev_id, port_id, intr_mask); - return rv; -} - -sw_error_t -fal_intr_port_link_status_get(a_uint32_t dev_id, a_uint32_t port_id, a_uint32_t * intr_mask) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_PORT_LINK_STATUS_GET, dev_id, port_id, intr_mask); - return rv; -} - -sw_error_t -fal_intr_mask_mac_linkchg_set(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_MASK_MAC_LINKCHG_SET, dev_id, port_id, enable); - return rv; -} - - -sw_error_t -fal_intr_mask_mac_linkchg_get(a_uint32_t dev_id, a_uint32_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_MASK_MAC_LINKCHG_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_intr_status_mac_linkchg_get(a_uint32_t dev_id, fal_pbmp_t *port_bitmap) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_STATUS_MAC_LINKCHG_GET, dev_id, port_bitmap); - return rv; -} - -sw_error_t -fal_cpu_vid_en_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_CPU_VID_EN_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_cpu_vid_en_get(a_uint32_t dev_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_CPU_VID_EN_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_intr_status_mac_linkchg_clear(a_uint32_t dev_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR, dev_id); - return rv; -} - -sw_error_t -fal_global_macaddr_set(a_uint32_t dev_id, fal_mac_addr_t * addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_GLOBAL_MACADDR_SET, dev_id, addr); - return rv; -} - -sw_error_t -fal_global_macaddr_get(a_uint32_t dev_id, fal_mac_addr_t * addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_GLOBAL_MACADDR_GET, dev_id, addr); - return rv; -} - -sw_error_t -fal_lldp_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_LLDP_STATUS_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_lldp_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_LLDP_STATUS_GET, dev_id, enable); - return rv; -} - - -sw_error_t -fal_frame_crc_reserve_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FRAME_CRC_RESERVE_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_frame_crc_reserve_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FRAME_CRC_RESERVE_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_debug_port_counter_enable(a_uint32_t dev_id, fal_port_t port_id, fal_counter_en_t * cnt_en) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DEBUG_PORT_COUNTER_ENABLE, dev_id, port_id, cnt_en); - return rv; -} - -sw_error_t -fal_debug_port_counter_status_get(a_uint32_t dev_id, fal_port_t port_id, fal_counter_en_t * cnt_en) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DEBUG_PORT_COUNTER_STATUS_GET, dev_id, port_id, cnt_en); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_nat.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_nat.c deleted file mode 100755 index ec5d0586b..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_nat.c +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright (c) 2014, 2015, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_nat.h" -#include "fal_uk_if.h" - -sw_error_t -fal_nat_add(a_uint32_t dev_id, fal_nat_entry_t * nat_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_ADD, dev_id, nat_entry); - return rv; -} - - -sw_error_t -fal_nat_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_nat_entry_t * nat_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_DEL, dev_id, del_mode, nat_entry); - return rv; -} - - -sw_error_t -fal_nat_get(a_uint32_t dev_id, a_uint32_t get_mode, fal_nat_entry_t * nat_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_GET, dev_id, get_mode, nat_entry); - return rv; -} - -sw_error_t -fal_nat_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_nat_entry_t * nat_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_NEXT, dev_id, next_mode, nat_entry); - return rv; -} - -sw_error_t -fal_nat_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id, a_uint32_t cnt_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_COUNTER_BIND, dev_id, entry_id, cnt_id, enable); - return rv; -} - - -sw_error_t -fal_napt_add(a_uint32_t dev_id, fal_napt_entry_t * napt_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_ADD, dev_id, napt_entry); - return rv; -} - -sw_error_t -fal_napt_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_napt_entry_t * napt_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_DEL, dev_id, del_mode, napt_entry); - return rv; -} - -sw_error_t -fal_napt_get(a_uint32_t dev_id, a_uint32_t get_mode, fal_napt_entry_t * napt_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_GET, dev_id, get_mode, napt_entry); - return rv; -} - -sw_error_t -fal_napt_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_napt_entry_t * napt_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_NEXT, dev_id, next_mode, napt_entry); - return rv; -} - -sw_error_t -fal_napt_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id, a_uint32_t cnt_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_COUNTER_BIND, dev_id, entry_id, cnt_id, enable); - return rv; -} - -sw_error_t -fal_flow_add(a_uint32_t dev_id, fal_napt_entry_t * napt_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_ADD, dev_id, napt_entry); - return rv; -} - -sw_error_t -fal_flow_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_napt_entry_t * napt_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_DEL, dev_id, del_mode, napt_entry); - return rv; -} - -sw_error_t -fal_flow_get(a_uint32_t dev_id, a_uint32_t get_mode, fal_napt_entry_t * napt_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_GET, dev_id, get_mode, napt_entry); - return rv; -} - -sw_error_t -fal_flow_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_napt_entry_t * napt_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_NEXT, dev_id, next_mode, napt_entry); - return rv; -} - -sw_error_t -fal_flow_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id, a_uint32_t cnt_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_COUNTER_BIND, dev_id, entry_id, cnt_id, enable); - return rv; -} - -sw_error_t -fal_nat_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_STATUS_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_nat_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_nat_hash_mode_set(a_uint32_t dev_id, a_uint32_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_HASH_MODE_SET, dev_id, mode); - return rv; -} - -sw_error_t -fal_nat_hash_mode_get(a_uint32_t dev_id, a_uint32_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_HASH_MODE_GET, dev_id, mode); - return rv; -} - -sw_error_t -fal_napt_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_STATUS_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_napt_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_napt_mode_set(a_uint32_t dev_id, fal_napt_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_MODE_SET, dev_id, mode); - return rv; -} - -sw_error_t -fal_napt_mode_get(a_uint32_t dev_id, fal_napt_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAPT_MODE_GET, dev_id, mode); - return rv; -} - -sw_error_t -fal_nat_prv_base_addr_set(a_uint32_t dev_id, fal_ip4_addr_t addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PRV_BASE_ADDR_SET, dev_id, addr); - return rv; -} - -sw_error_t -fal_nat_prv_base_addr_get(a_uint32_t dev_id, fal_ip4_addr_t * addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PRV_BASE_ADDR_GET, dev_id, addr); - return rv; -} - -sw_error_t -fal_nat_prv_base_mask_set(a_uint32_t dev_id, fal_ip4_addr_t addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PRV_BASE_MASK_SET, dev_id, addr); - return rv; -} - -sw_error_t -fal_nat_prv_base_mask_get(a_uint32_t dev_id, fal_ip4_addr_t * addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PRV_BASE_MASK_GET, dev_id, addr); - return rv; -} - -sw_error_t -fal_nat_prv_addr_mode_set(a_uint32_t dev_id, a_bool_t map_en) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PRV_ADDR_MODE_SET, dev_id, map_en); - return rv; -} - -sw_error_t -fal_nat_prv_addr_mode_get(a_uint32_t dev_id, a_bool_t * map_en) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PRV_ADDR_MODE_GET, dev_id, map_en); - return rv; -} - -sw_error_t -fal_nat_pub_addr_add(a_uint32_t dev_id, fal_nat_pub_addr_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PUB_ADDR_ENTRY_ADD, dev_id, entry); - return rv; -} - -sw_error_t -fal_nat_pub_addr_del(a_uint32_t dev_id, a_uint32_t del_mode, fal_nat_pub_addr_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PUB_ADDR_ENTRY_DEL, dev_id, del_mode, entry); - return rv; -} - -sw_error_t -fal_nat_pub_addr_next(a_uint32_t dev_id, a_uint32_t next_mode, fal_nat_pub_addr_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PUB_ADDR_ENTRY_NEXT, dev_id, next_mode, entry); - return rv; -} - -sw_error_t -fal_nat_unk_session_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_UNK_SESSION_CMD_SET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_nat_unk_session_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_UNK_SESSION_CMD_GET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_nat_global_set(a_uint32_t dev_id, a_bool_t enable, - a_bool_t sync_cnt_enable, a_uint32_t portbmp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NAT_GLOBAL_SET, dev_id, enable, - sync_cnt_enable, portbmp); - return rv; -} - -sw_error_t -fal_flow_cookie_set(a_uint32_t dev_id, fal_flow_cookie_t * flow_cookie) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_COOKIE_SET, dev_id, flow_cookie); - return rv; -} - -sw_error_t -fal_flow_rfs_set(a_uint32_t dev_id, a_uint8_t action, fal_flow_rfs_t * rfs) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_RFS_SET, dev_id, action, rfs); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_policer.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_policer.c deleted file mode 100755 index 3897562ad..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_policer.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_policer.h" -#include "fal_uk_if.h" - - -sw_error_t -fal_policer_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_TIMESLOT_SET, dev_id, timeslot); - return rv; -} - -sw_error_t -fal_policer_timeslot_get(a_uint32_t dev_id, a_uint32_t *timeslot) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_TIMESLOT_GET, dev_id, timeslot); - return rv; -} - -sw_error_t -fal_port_policer_counter_get(a_uint32_t dev_id, fal_port_t port_id, - fal_policer_counter_t *counter) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_PORT_COUNTER_GET, dev_id, port_id, - counter); - return rv; -} - -sw_error_t -fal_acl_policer_counter_get(a_uint32_t dev_id, a_uint32_t index, - fal_policer_counter_t *counter) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_ACL_COUNTER_GET, dev_id, index, - counter); - return rv; -} - -sw_error_t -fal_port_policer_compensation_byte_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t length) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_COMPENSATION_SET, dev_id, port_id, length); - return rv; -} - -sw_error_t -fal_port_policer_compensation_byte_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t *length) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_COMPENSATION_GET, dev_id, port_id, - length); - return rv; -} - -sw_error_t -fal_port_policer_entry_set(a_uint32_t dev_id, fal_port_t port_id, - fal_policer_config_t *policer, fal_policer_action_t *action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_PORT_ENTRY_SET, dev_id, port_id, - policer, action); - return rv; -} - -sw_error_t -fal_port_policer_entry_get(a_uint32_t dev_id, fal_port_t port_id, - fal_policer_config_t *policer, fal_policer_action_t *action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_PORT_ENTRY_GET, dev_id, port_id, - policer, action); - return rv; -} - -sw_error_t -fal_acl_policer_entry_set(a_uint32_t dev_id, a_uint32_t index, - fal_policer_config_t *policer, fal_policer_action_t *action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_ACL_ENTRY_SET, dev_id, index, - policer, action); - return rv; -} - -sw_error_t -fal_acl_policer_entry_get(a_uint32_t dev_id, a_uint32_t index, - fal_policer_config_t *policer, fal_policer_action_t *action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_ACL_ENTRY_GET, dev_id, index, - policer, action); - return rv; -} - -sw_error_t -fal_policer_global_counter_get(a_uint32_t dev_id,fal_policer_global_counter_t *counter) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_POLICER_GLOBAL_COUNTER_GET, dev_id, - counter); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_port_ctrl.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_port_ctrl.c deleted file mode 100755 index 018b38535..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_port_ctrl.c +++ /dev/null @@ -1,956 +0,0 @@ -/* - * Copyright (c) 2014,2016-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/*qca808x_start*/ -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_port_ctrl.h" -#include "fal_uk_if.h" - -sw_error_t -fal_port_duplex_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_duplex_t duplex) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DUPLEX_SET, dev_id, port_id, - duplex); - return rv; -} - -sw_error_t -fal_port_duplex_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_duplex_t * pduplex) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DUPLEX_GET, dev_id, port_id, pduplex); - return rv; -} - -sw_error_t -fal_port_speed_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_speed_t speed) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_SPEED_SET, dev_id, port_id, - speed); - return rv; -} - -sw_error_t -fal_port_speed_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_speed_t * pspeed) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_SPEED_GET, dev_id, port_id, pspeed); - return rv; -} - -sw_error_t -fal_port_autoneg_status_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_AN_GET, dev_id, port_id, status); - return rv; -} - -sw_error_t -fal_port_autoneg_enable(a_uint32_t dev_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_AN_ENABLE, dev_id, port_id); - return rv; -} - -sw_error_t -fal_port_autoneg_restart(a_uint32_t dev_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_AN_RESTART, dev_id, port_id); - return rv; -} - -sw_error_t -fal_port_autoneg_adv_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t autoadv) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_AN_ADV_SET, dev_id, port_id, autoadv); - return rv; -} - -sw_error_t -fal_port_autoneg_adv_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * autoadv) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_AN_ADV_GET, dev_id, port_id, autoadv); - return rv; -} -/*qca808x_end*/ -sw_error_t -fal_port_hdr_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_HDR_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_hdr_status_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_HDR_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FLOWCTRL_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_flowctrl_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FLOWCTRL_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_flowctrl_forcemode_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FLOWCTRL_MODE_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_flowctrl_forcemode_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FLOWCTRL_MODE_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_powersave_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_POWERSAVE_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_powersave_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_POWERSAVE_GET, dev_id, port_id, enable); - return rv; -} -/*qca808x_start*/ -sw_error_t -fal_port_hibernate_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_HIBERNATE_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_hibernate_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_HIBERNATE_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_cdt(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t mdi_pair, - a_uint32_t *cable_status, a_uint32_t *cable_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_CDT, dev_id, port_id, mdi_pair, - cable_status, cable_len); - return rv; -} -/*qca808x_end*/ -sw_error_t -fal_port_rxhdr_mode_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_header_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_RXHDR_SET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_rxhdr_mode_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_header_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_RXHDR_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_txhdr_mode_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_header_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_TXHDR_SET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_txhdr_mode_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_header_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_TXHDR_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_header_type_set(a_uint32_t dev_id, a_bool_t enable, a_uint32_t type) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_HEADER_TYPE_SET, dev_id, enable, type); - return rv; -} - -sw_error_t -fal_header_type_get(a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * type) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_HEADER_TYPE_GET, dev_id, enable, type); - return rv; -} - -sw_error_t -fal_port_txmac_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TXMAC_STATUS_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_txmac_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TXMAC_STATUS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_rxmac_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RXMAC_STATUS_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_rxmac_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RXMAC_STATUS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_txfc_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TXFC_STATUS_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_txfc_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TXFC_STATUS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_rxfc_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RXFC_STATUS_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_rxfc_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RXFC_STATUS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_bp_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BP_STATUS_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_bp_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_BP_STATUS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_link_forcemode_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_LINK_MODE_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_link_forcemode_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_LINK_MODE_GET, dev_id, port_id, enable); - return rv; -} -/*qca808x_start*/ -sw_error_t -fal_port_link_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_LINK_STATUS_GET, dev_id, port_id, status); - return rv; -} -/*qca808x_end*/ -sw_error_t -fal_ports_link_status_get(a_uint32_t dev_id, a_uint32_t * status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTS_LINK_STATUS_GET, dev_id, status); - return rv; -} - -sw_error_t -fal_port_mac_loopback_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MAC_LOOPBACK_SET, dev_id, port_id, enable); - return rv; -} - - -sw_error_t -fal_port_mac_loopback_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MAC_LOOPBACK_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_congestion_drop_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t queue_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_CONGESTION_DROP_SET, dev_id, port_id, queue_id, enable); - return rv; -} - - -sw_error_t -fal_port_congestion_drop_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t queue_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_CONGESTION_DROP_GET, dev_id, port_id, queue_id, enable); - return rv; -} - -sw_error_t -fal_ring_flow_ctrl_thres_set(a_uint32_t dev_id, a_uint32_t ring_id, - a_uint8_t on_thres, a_uint8_t off_thres) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_RING_FLOW_CTRL_THRES_SET, dev_id, ring_id, on_thres, off_thres); - return rv; -} - - -sw_error_t -fal_ring_flow_ctrl_thres_get(a_uint32_t dev_id, a_uint32_t ring_id, - a_uint8_t *on_thres, a_uint8_t *off_thres) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_RING_FLOW_CTRL_THRES_GET, dev_id, ring_id, on_thres, off_thres); - return rv; -} -/*qca808x_start*/ -sw_error_t -fal_port_8023az_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_8023AZ_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_8023az_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_8023AZ_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_mdix_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_mdix_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MDIX_SET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_mdix_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_mdix_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MDIX_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_mdix_status_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_mdix_status_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MDIX_STATUS_GET, dev_id, port_id, mode); - return rv; -} -/*qca808x_end*/ -sw_error_t -fal_port_combo_prefer_medium_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_medium_t medium) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_COMBO_PREFER_MEDIUM_SET, dev_id, port_id, medium); - return rv; -} - -sw_error_t -fal_port_combo_prefer_medium_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_medium_t * medium) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_COMBO_PREFER_MEDIUM_GET, dev_id, port_id, medium); - return rv; -} - -sw_error_t -fal_port_combo_medium_status_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_medium_t * medium) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_COMBO_MEDIUM_STATUS_GET, dev_id, port_id, medium); - return rv; -} - -sw_error_t -fal_port_combo_fiber_mode_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_fiber_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_COMBO_FIBER_MODE_SET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_combo_fiber_mode_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_fiber_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_COMBO_FIBER_MODE_GET, dev_id, port_id, mode); - return rv; -} -/*qca808x_start*/ -sw_error_t -fal_port_local_loopback_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_LOCAL_LOOPBACK_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_local_loopback_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_LOCAL_LOOPBACK_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_remote_loopback_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_REMOTE_LOOPBACK_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_remote_loopback_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_REMOTE_LOOPBACK_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_reset(a_uint32_t dev_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_RESET, dev_id, port_id); - return rv; -} - -sw_error_t -fal_port_power_off(a_uint32_t dev_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_POWER_OFF, dev_id, port_id); - return rv; -} - -sw_error_t -fal_port_power_on(a_uint32_t dev_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_POWER_ON, dev_id, port_id); - return rv; -} - - sw_error_t - fal_port_magic_frame_mac_set (a_uint32_t dev_id, fal_port_t port_id, - fal_mac_addr_t * mac) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MAGIC_FRAME_MAC_SET, dev_id, port_id, mac); - return rv; - -} - - sw_error_t - fal_port_magic_frame_mac_get (a_uint32_t dev_id, fal_port_t port_id, - fal_mac_addr_t * mac) -{ - - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MAGIC_FRAME_MAC_GET, dev_id, port_id, mac); - return rv; - - -} - sw_error_t - fal_port_phy_id_get (a_uint32_t dev_id, fal_port_t port_id, - a_uint16_t * org_id, a_uint16_t * rev_id) - { - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_PHY_ID_GET, dev_id, port_id, org_id, rev_id); - return rv; - } - sw_error_t - fal_port_wol_status_set (a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_WOL_STATUS_SET, dev_id, port_id, enable); - return rv; - - } - sw_error_t - fal_port_wol_status_get (a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) - - { - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_WOL_STATUS_GET, dev_id, port_id,enable); - return rv; - } - /*qca808x_end*/ -sw_error_t -fal_port_interface_mode_set (a_uint32_t dev_id, fal_port_t port_id, - fal_port_interface_mode_t mode) -{ - sw_error_t rv; - rv = sw_uk_exec(SW_API_PT_INTERFACE_MODE_SET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_interface_mode_get (a_uint32_t dev_id, fal_port_t port_id, - fal_port_interface_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INTERFACE_MODE_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_interface_mode_apply (a_uint32_t dev_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INTERFACE_MODE_APPLY, dev_id); - return rv; -} -/*qca808x_start*/ -sw_error_t -fal_port_interface_mode_status_get (a_uint32_t dev_id, fal_port_t port_id, - fal_port_interface_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INTERFACE_MODE_STATUS_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_debug_phycounter_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DEBUG_PHYCOUNTER_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_debug_phycounter_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DEBUG_PHYCOUNTER_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_debug_phycounter_show(a_uint32_t dev_id, fal_port_t port_id, - fal_port_counter_info_t * port_counter_info) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DEBUG_PHYCOUNTER_SHOW, dev_id, port_id, port_counter_info); - return rv; -} -/*qca808x_end*/ -sw_error_t -fal_port_mtu_set(a_uint32_t dev_id, fal_port_t port_id, - fal_mtu_ctrl_t *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MTU_SET, dev_id, port_id, ctrl); - return rv; -} - -sw_error_t -fal_port_mtu_get(a_uint32_t dev_id, fal_port_t port_id, - fal_mtu_ctrl_t *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MTU_GET, dev_id, port_id, ctrl); - return rv; -} - -sw_error_t -fal_port_mru_set(a_uint32_t dev_id, fal_port_t port_id, - fal_mru_ctrl_t *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MRU_SET, dev_id, port_id, ctrl); - return rv; -} - -sw_error_t -fal_port_mru_get(a_uint32_t dev_id, fal_port_t port_id, - fal_mru_ctrl_t *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MRU_GET, dev_id, port_id, ctrl); - return rv; -} - -sw_error_t -fal_port_source_filter_enable(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_SOURCE_FILTER_SET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_source_filter_status_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_SOURCE_FILTER_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_max_frame_size_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t max_frame) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FRAME_MAX_SIZE_SET, dev_id, port_id, - max_frame); - return rv; -} - -sw_error_t -fal_port_max_frame_size_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t* max_frame) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FRAME_MAX_SIZE_GET, dev_id, port_id, max_frame); - return rv; -} -sw_error_t -fal_port_interface_3az_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INTERFACE_3AZ_STATUS_SET, dev_id, port_id, enable); - - return rv; -} -sw_error_t -fal_port_interface_3az_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INTERFACE_3AZ_STATUS_GET, dev_id, port_id, enable); - - return rv; - - return rv; -} -sw_error_t -fal_port_promisc_mode_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_PROMISC_MODE_SET, dev_id, port_id, enable); - - return rv; -} - -sw_error_t -fal_port_promisc_mode_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_PROMISC_MODE_GET, dev_id, port_id, enable); - - return rv; -} -sw_error_t -fal_port_interface_eee_cfg_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_eee_cfg_t *port_eee_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INTERFACE_EEE_CFG_SET, dev_id, port_id, port_eee_cfg); - - return rv; -} -sw_error_t -fal_port_interface_eee_cfg_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_eee_cfg_t *port_eee_cfg) - -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INTERFACE_EEE_CFG_GET, dev_id, port_id, port_eee_cfg); - - return rv; -} - -sw_error_t -fal_port_source_filter_config_set(a_uint32_t dev_id, - fal_port_t port_id, fal_src_filter_config_t *src_filter_config) - -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_SOURCE_FILTER_CONFIG_SET, dev_id, port_id, - src_filter_config); - - return rv; -} - -sw_error_t -fal_port_source_filter_config_get(a_uint32_t dev_id, - fal_port_t port_id, fal_src_filter_config_t *src_filter_config) - -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_SOURCE_FILTER_CONFIG_GET, dev_id, port_id, - src_filter_config); - - return rv; -} - -sw_error_t -fal_switch_port_loopback_set(a_uint32_t dev_id, fal_port_t port_id, - fal_loopback_config_t *loopback_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_SWITCH_PORT_LOOPBACK_SET, dev_id, - port_id, loopback_cfg); - - return rv; -} -sw_error_t -fal_switch_port_loopback_get(a_uint32_t dev_id, fal_port_t port_id, - fal_loopback_config_t *loopback_cfg) - -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_SWITCH_PORT_LOOPBACK_GET, dev_id, port_id, - loopback_cfg); - - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_portvlan.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_portvlan.c deleted file mode 100755 index 8aeea7225..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_portvlan.c +++ /dev/null @@ -1,754 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_portvlan.h" -#include "fal_uk_if.h" - -sw_error_t -fal_port_1qmode_set(a_uint32_t dev_id, fal_port_t port_id, - fal_pt_1qmode_t port_1qmode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_ING_MODE_SET, dev_id, port_id, - (a_uint32_t) port_1qmode); - return rv; -} - -sw_error_t -fal_port_1qmode_get(a_uint32_t dev_id, fal_port_t port_id, - fal_pt_1qmode_t * pport_1qmode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_ING_MODE_GET, dev_id, port_id, - pport_1qmode); - return rv; -} - -sw_error_t -fal_port_egvlanmode_set(a_uint32_t dev_id, fal_port_t port_id, - fal_pt_1q_egmode_t port_egvlanmode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_EG_MODE_SET, dev_id, port_id, - (a_uint32_t) port_egvlanmode); - return rv; -} - -sw_error_t -fal_port_egvlanmode_get(a_uint32_t dev_id, fal_port_t port_id, - fal_pt_1q_egmode_t * pport_egvlanmode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_EG_MODE_GET, dev_id, port_id, - pport_egvlanmode); - return rv; -} - -sw_error_t -fal_portvlan_member_add(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t mem_port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_MEM_ADD, dev_id, port_id, - (a_uint32_t) mem_port_id); - return rv; -} - -sw_error_t -fal_portvlan_member_del(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t mem_port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_MEM_DEL, dev_id, port_id, - (a_uint32_t) mem_port_id); - return rv; -} - -sw_error_t -fal_portvlan_member_update(a_uint32_t dev_id, fal_port_t port_id, - fal_pbmp_t mem_port_map) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_MEM_UPDATE, dev_id, port_id, - (a_uint32_t) mem_port_map); - return rv; -} - -sw_error_t -fal_portvlan_member_get(a_uint32_t dev_id, fal_port_t port_id, - fal_pbmp_t * mem_port_map) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_MEM_GET, dev_id, port_id, - mem_port_map); - return rv; -} - -sw_error_t -fal_port_default_vid_set(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t vid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DEF_VID_SET, dev_id, port_id, - vid); - return rv; -} - -sw_error_t -fal_port_default_vid_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * vid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DEF_VID_GET, dev_id, port_id, - vid); - return rv; -} - -sw_error_t -fal_port_force_default_vid_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FORCE_DEF_VID_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_port_force_default_vid_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FORCE_DEF_VID_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_force_portvlan_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FORCE_PORTVLAN_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_port_force_portvlan_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_FORCE_PORTVLAN_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_port_nestvlan_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_NESTVLAN_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_port_nestvlan_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_NESTVLAN_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_nestvlan_tpid_set(a_uint32_t dev_id, a_uint32_t tpid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NESTVLAN_TPID_SET, dev_id, tpid); - return rv; -} - -sw_error_t -fal_nestvlan_tpid_get(a_uint32_t dev_id, a_uint32_t * tpid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NESTVLAN_TPID_GET, dev_id, tpid); - return rv; -} - -sw_error_t -fal_port_invlan_mode_set(a_uint32_t dev_id, fal_port_t port_id, - fal_pt_invlan_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_IN_VLAN_MODE_SET, dev_id, port_id, (a_uint32_t) mode); - return rv; -} - -sw_error_t -fal_port_invlan_mode_get(a_uint32_t dev_id, fal_port_t port_id, - fal_pt_invlan_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_IN_VLAN_MODE_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_tls_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_TLS_SET, dev_id, port_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_port_tls_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_TLS_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_pri_propagation_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_PRI_PROPAGATION_SET, dev_id, port_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_port_pri_propagation_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_PRI_PROPAGATION_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_default_svid_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t vid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DEF_SVID_SET, dev_id, port_id, vid); - return rv; -} - -sw_error_t -fal_port_default_svid_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * vid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DEF_SVID_GET, dev_id, port_id, vid); - return rv; -} - -sw_error_t -fal_port_default_cvid_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t vid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DEF_CVID_SET, dev_id, port_id, vid); - return rv; -} - -sw_error_t -fal_port_default_cvid_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * vid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DEF_CVID_GET, dev_id, port_id, vid); - return rv; -} - -sw_error_t -fal_port_vlan_propagation_set(a_uint32_t dev_id, fal_port_t port_id, - fal_vlan_propagation_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_PROPAGATION_SET, dev_id, port_id, (a_uint32_t)mode); - return rv; -} - -sw_error_t -fal_port_vlan_propagation_get(a_uint32_t dev_id, fal_port_t port_id, - fal_vlan_propagation_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_PROPAGATION_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_vlan_trans_add(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_TRANS_ADD, dev_id, port_id, entry); - return rv; -} - -sw_error_t -fal_port_vlan_trans_del(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_TRANS_DEL, dev_id, port_id, entry); - return rv; -} - -sw_error_t -fal_port_vlan_trans_get(a_uint32_t dev_id, fal_port_t port_id, fal_vlan_trans_entry_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_TRANS_GET, dev_id, port_id, entry); - return rv; -} - -sw_error_t -fal_qinq_mode_set(a_uint32_t dev_id, fal_qinq_mode_t mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QINQ_MODE_SET, dev_id, (a_uint32_t)mode); - return rv; -} - -sw_error_t -fal_qinq_mode_get(a_uint32_t dev_id, fal_qinq_mode_t * mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QINQ_MODE_GET, dev_id, mode); - return rv; -} - -sw_error_t -fal_port_qinq_role_set(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role_t role) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_QINQ_ROLE_SET, dev_id, port_id, (a_uint32_t)role); - return rv; -} - -sw_error_t -fal_port_qinq_role_get(a_uint32_t dev_id, fal_port_t port_id, fal_qinq_port_role_t * role) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_QINQ_ROLE_GET, dev_id, port_id, role); - return rv; -} - -sw_error_t -fal_port_vlan_trans_iterate(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * iterator, fal_vlan_trans_entry_t * entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_TRANS_ITERATE, dev_id, port_id, - iterator,entry); - return rv; -} - -sw_error_t -fal_port_mac_vlan_xlt_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MAC_VLAN_XLT_SET, dev_id, port_id, (a_uint32_t)enable); - return rv; -} - -sw_error_t -fal_port_mac_vlan_xlt_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_MAC_VLAN_XLT_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_netisolate_set(a_uint32_t dev_id, a_uint32_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NETISOLATE_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_netisolate_get(a_uint32_t dev_id, a_uint32_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_NETISOLATE_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_eg_trans_filter_bypass_en_set(a_uint32_t dev_id, a_uint32_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_EG_FLTR_BYPASS_EN_SET, dev_id, enable); - return rv; -} - -sw_error_t -fal_eg_trans_filter_bypass_en_get(a_uint32_t dev_id, a_uint32_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_EG_FLTR_BYPASS_EN_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_port_vrf_id_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t vrf_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VRF_ID_SET, dev_id, port_id, vrf_id); - return rv; -} - -sw_error_t -fal_port_vrf_id_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * vrf_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VRF_ID_GET, dev_id, port_id, vrf_id); - return rv; -} - -sw_error_t -fal_global_qinq_mode_set(a_uint32_t dev_id, fal_global_qinq_mode_t *mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_GLOBAL_QINQ_MODE_SET, dev_id, mode); - return rv; -} - -sw_error_t -fal_global_qinq_mode_get(a_uint32_t dev_id, fal_global_qinq_mode_t *mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_GLOBAL_QINQ_MODE_GET, dev_id, mode); - return rv; -} - -sw_error_t -fal_port_qinq_mode_set(a_uint32_t dev_id, fal_port_t port_id, fal_port_qinq_role_t *mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_QINQ_MODE_SET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_port_qinq_mode_get(a_uint32_t dev_id, fal_port_t port_id, fal_port_qinq_role_t *mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_QINQ_MODE_GET, dev_id, port_id, mode); - return rv; -} - -sw_error_t -fal_ingress_tpid_set(a_uint32_t dev_id, fal_tpid_t *tpid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TPID_SET, dev_id, tpid); - return rv; -} - -sw_error_t -fal_ingress_tpid_get(a_uint32_t dev_id, fal_tpid_t *tpid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TPID_GET, dev_id, tpid); - return rv; -} - -sw_error_t -fal_egress_tpid_set(a_uint32_t dev_id, fal_tpid_t *tpid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_EGRESS_TPID_SET, dev_id, tpid); - return rv; -} - -sw_error_t -fal_egress_tpid_get(a_uint32_t dev_id, fal_tpid_t *tpid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_EGRESS_TPID_GET, dev_id, tpid); - return rv; -} - -sw_error_t -fal_port_ingress_vlan_filter_set(a_uint32_t dev_id, fal_port_t port_id, fal_ingress_vlan_filter_t *filter) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INGRESS_VLAN_FILTER_SET, dev_id, port_id, filter); - return rv; -} - -sw_error_t -fal_port_ingress_vlan_filter_get(a_uint32_t dev_id, fal_port_t port_id, fal_ingress_vlan_filter_t *filter) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_INGRESS_VLAN_FILTER_GET, dev_id, port_id, filter); - return rv; -} - -sw_error_t -fal_port_default_vlantag_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_vlan_direction_t direction, fal_port_default_vid_enable_t *default_vid_en, - fal_port_vlan_tag_t *default_tag) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DEFAULT_VLANTAG_SET, dev_id, port_id, (a_uint32_t) direction, - default_vid_en, default_tag); - return rv; -} - -sw_error_t -fal_port_default_vlantag_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_vlan_direction_t direction, fal_port_default_vid_enable_t *default_vid_en, - fal_port_vlan_tag_t *default_tag) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_DEFAULT_VLANTAG_GET, dev_id, port_id, (a_uint32_t) direction, - default_vid_en, default_tag); - return rv; -} - -sw_error_t -fal_port_tag_propagation_set(a_uint32_t dev_id, fal_port_t port_id, fal_port_vlan_direction_t direction, - fal_vlantag_propagation_t *prop) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_TAG_PROPAGATION_SET, dev_id, port_id, (a_uint32_t) direction, prop); - return rv; -} - -sw_error_t -fal_port_tag_propagation_get(a_uint32_t dev_id, fal_port_t port_id, fal_port_vlan_direction_t direction, - fal_vlantag_propagation_t *prop) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_TAG_PROPAGATION_GET, dev_id, port_id, (a_uint32_t) direction, prop); - return rv; -} - -sw_error_t -fal_port_vlan_xlt_miss_cmd_set(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_XLT_MISS_CMD_SET, dev_id, port_id, (a_uint32_t) cmd); - return rv; -} - -sw_error_t -fal_port_vlan_xlt_miss_cmd_get(a_uint32_t dev_id, fal_port_t port_id, - fal_fwd_cmd_t *cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_XLT_MISS_CMD_GET, dev_id, port_id, cmd); - return rv; -} - -sw_error_t -fal_port_vlantag_egmode_set(a_uint32_t dev_id, fal_port_t port_id, - fal_vlantag_egress_mode_t *port_egvlanmode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLANTAG_EGMODE_SET, dev_id, port_id, port_egvlanmode); - return rv; -} - -sw_error_t -fal_port_vlantag_egmode_get(a_uint32_t dev_id, fal_port_t port_id, - fal_vlantag_egress_mode_t *port_egvlanmode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLANTAG_EGMODE_GET, dev_id, port_id, port_egvlanmode); - return rv; -} - -sw_error_t -fal_port_vsi_egmode_set(a_uint32_t dev_id, a_uint32_t vsi, a_uint32_t port_id, fal_pt_1q_egmode_t egmode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VSI_EGMODE_SET, dev_id, vsi, port_id, (a_uint32_t) egmode); - return rv; -} - -sw_error_t -fal_port_vsi_egmode_get(a_uint32_t dev_id, a_uint32_t vsi, a_uint32_t port_id, fal_pt_1q_egmode_t * egmode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VSI_EGMODE_GET, dev_id, vsi, port_id, egmode); - return rv; -} - -sw_error_t -fal_port_vlantag_vsi_egmode_enable(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET, dev_id, port_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_port_vlantag_vsi_egmode_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_port_vlan_trans_adv_add(a_uint32_t dev_id, fal_port_t port_id, fal_port_vlan_direction_t direction, - fal_vlan_trans_adv_rule_t * rule, fal_vlan_trans_adv_action_t * action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_TRANS_ADV_ADD, dev_id, port_id, (a_uint32_t) direction, - rule, action); - return rv; -} - -sw_error_t -fal_port_vlan_trans_adv_del(a_uint32_t dev_id, fal_port_t port_id, fal_port_vlan_direction_t direction, - fal_vlan_trans_adv_rule_t * rule, fal_vlan_trans_adv_action_t * action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_TRANS_ADV_DEL, dev_id, port_id, (a_uint32_t) direction, - rule, action); - return rv; -} - -sw_error_t -fal_port_vlan_trans_adv_getfirst(a_uint32_t dev_id, fal_port_t port_id, fal_port_vlan_direction_t direction, - fal_vlan_trans_adv_rule_t * rule, fal_vlan_trans_adv_action_t * action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_TRANS_ADV_GETFIRST, dev_id, port_id, (a_uint32_t) direction, - rule, action); - return rv; -} - -sw_error_t -fal_port_vlan_trans_adv_getnext(a_uint32_t dev_id, fal_port_t port_id, fal_port_vlan_direction_t direction, - fal_vlan_trans_adv_rule_t * rule, fal_vlan_trans_adv_action_t * action) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_TRANS_ADV_GETNEXT, dev_id, port_id, (a_uint32_t) direction, - rule, action); - return rv; -} - -sw_error_t -fal_port_vlan_counter_get(a_uint32_t dev_id, a_uint32_t cnt_index, fal_port_vlan_counter_t * counter) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_COUNTER_GET, dev_id, cnt_index, counter); - return rv; -} - -sw_error_t -fal_port_vlan_counter_cleanup(a_uint32_t dev_id, a_uint32_t cnt_index) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PT_VLAN_COUNTER_CLEANUP, dev_id, cnt_index); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_pppoe.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_pppoe.c deleted file mode 100755 index 4c7817c33..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_pppoe.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_pppoe.h" -#include "fal_uk_if.h" - -sw_error_t -fal_pppoe_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_CMD_SET, dev_id, (a_uint32_t) cmd); - return rv; -} - -sw_error_t -fal_pppoe_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_CMD_GET, dev_id, cmd); - return rv; -} - -sw_error_t -fal_pppoe_status_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_STATUS_SET, dev_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_pppoe_status_get(a_uint32_t dev_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_STATUS_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_pppoe_session_add(a_uint32_t dev_id, a_uint32_t session_id, a_bool_t strip_hdr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_SESSION_ADD, dev_id, session_id, (a_uint32_t)strip_hdr); - return rv; -} - -sw_error_t -fal_pppoe_session_del(a_uint32_t dev_id, a_uint32_t session_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_SESSION_DEL, dev_id, session_id); - return rv; -} - -sw_error_t -fal_pppoe_session_get(a_uint32_t dev_id, a_uint32_t session_id, a_bool_t * strip_hdr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_SESSION_GET, dev_id, session_id, strip_hdr); - return rv; -} - -sw_error_t -fal_pppoe_session_table_add(a_uint32_t dev_id, fal_pppoe_session_t * session_tbl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_SESSION_TABLE_ADD, dev_id, session_tbl); - return rv; -} - -sw_error_t -fal_pppoe_session_table_del(a_uint32_t dev_id, fal_pppoe_session_t * session_tbl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_SESSION_TABLE_DEL, dev_id, session_tbl); - return rv; -} - -sw_error_t -fal_pppoe_session_table_get(a_uint32_t dev_id, fal_pppoe_session_t * session_tbl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_SESSION_TABLE_GET, dev_id, session_tbl); - return rv; -} - -sw_error_t -fal_pppoe_session_id_set(a_uint32_t dev_id, a_uint32_t index, - a_uint32_t id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_SESSION_ID_SET, dev_id, index, id); - return rv; -} - -sw_error_t -fal_pppoe_session_id_get(a_uint32_t dev_id, a_uint32_t index, - a_uint32_t * id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_SESSION_ID_GET, dev_id, index, id); - return rv; -} - -sw_error_t -fal_rtd_pppoe_en_set(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RTD_PPPOE_EN_SET, dev_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_rtd_pppoe_en_get(a_uint32_t dev_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RTD_PPPOE_EN_GET, dev_id, enable); - return rv; -} - -sw_error_t -fal_pppoe_l3intf_enable(a_uint32_t dev_id, a_uint32_t l3_if, a_uint32_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_EN_SET, dev_id, l3_if, (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_pppoe_l3intf_status_get(a_uint32_t dev_id, a_uint32_t l3_if, a_uint32_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PPPOE_EN_GET, dev_id, l3_if, enable); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ptp.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ptp.c deleted file mode 100755 index 4ad27e5c8..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_ptp.c +++ /dev/null @@ -1,497 +0,0 @@ -/* - * Copyright (c) 2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_ptp.h" -#include "fal_uk_if.h" - -sw_error_t -fal_ptp_config_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_config_t *config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_CONFIG_SET, dev_id, port_id, - config); - return rv; -} - -sw_error_t -fal_ptp_config_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_config_t *config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_CONFIG_GET, dev_id, port_id, - config); - return rv; -} - -sw_error_t -fal_ptp_reference_clock_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_reference_clock_t ref_clock) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_REFERENCE_CLOCK_SET, dev_id, port_id, - ref_clock); - return rv; -} - -sw_error_t -fal_ptp_reference_clock_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_reference_clock_t *ref_clock) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_REFERENCE_CLOCK_GET, dev_id, port_id, - ref_clock); - return rv; -} - -sw_error_t -fal_ptp_rx_timestamp_mode_set(a_uint32_t dev_id, - a_uint32_t port_id, fal_ptp_rx_timestamp_mode_t ts_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RX_TIMESTAMP_MODE_SET, dev_id, port_id, - ts_mode); - return rv; -} - -sw_error_t -fal_ptp_rx_timestamp_mode_get(a_uint32_t dev_id, - a_uint32_t port_id, fal_ptp_rx_timestamp_mode_t *ts_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RX_TIMESTAMP_MODE_GET, dev_id, port_id, - ts_mode); - return rv; -} - -sw_error_t -fal_ptp_timestamp_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_direction_t direction, - fal_ptp_pkt_info_t *pkt_info, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_TIMESTAMP_GET, dev_id, port_id, - direction, pkt_info, time); - return rv; -} - -sw_error_t -fal_ptp_pkt_timestamp_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_PKT_TIMESTAMP_SET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_pkt_timestamp_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_PKT_TIMESTAMP_GET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_grandmaster_mode_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_grandmaster_mode_t *gm_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_GRANDMASTER_MODE_SET, dev_id, port_id, - gm_mode); - return rv; -} - -sw_error_t -fal_ptp_grandmaster_mode_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_grandmaster_mode_t *gm_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_GRANDMASTER_MODE_GET, dev_id, port_id, - gm_mode); - return rv; -} - -sw_error_t -fal_ptp_rtc_time_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RTC_TIME_GET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_rtc_time_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RTC_TIME_SET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_rtc_time_clear(a_uint32_t dev_id, a_uint32_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RTC_TIME_CLEAR, dev_id, port_id); - return rv; -} - -sw_error_t -fal_ptp_rtc_adjtime_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RTC_ADJTIME_SET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_rtc_adjfreq_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RTC_ADJFREQ_SET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_rtc_adjfreq_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RTC_ADJFREQ_GET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_link_delay_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_LINK_DELAY_SET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_link_delay_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_time_t *time) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_LINK_DELAY_GET, dev_id, port_id, - time); - return rv; -} - -sw_error_t -fal_ptp_security_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_security_t *sec) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_SECURITY_SET, dev_id, port_id, - sec); - return rv; -} - -sw_error_t -fal_ptp_security_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_security_t *sec) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_SECURITY_GET, dev_id, port_id, - sec); - return rv; -} - -sw_error_t -fal_ptp_pps_signal_control_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_pps_signal_control_t *sig_control) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_PPS_SIGNAL_CONTROL_SET, dev_id, port_id, - sig_control); - return rv; -} - -sw_error_t -fal_ptp_pps_signal_control_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_pps_signal_control_t *sig_control) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_PPS_SIGNAL_CONTROL_GET, dev_id, port_id, - sig_control); - return rv; -} - -sw_error_t -fal_ptp_rx_crc_recalc_enable(a_uint32_t dev_id, a_uint32_t port_id, - a_bool_t status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RX_CRC_RECALC_SET, dev_id, port_id, - status); - return rv; -} - -sw_error_t -fal_ptp_rx_crc_recalc_status_get(a_uint32_t dev_id, a_uint32_t port_id, - a_bool_t *status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RX_CRC_RECALC_GET, dev_id, port_id, - status); - return rv; -} - -sw_error_t -fal_ptp_asym_correction_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_asym_correction_t *asym_cf) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_ASYM_CORRECTION_SET, dev_id, port_id, - asym_cf); - return rv; -} - -sw_error_t -fal_ptp_asym_correction_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_asym_correction_t* asym_cf) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_ASYM_CORRECTION_GET, dev_id, port_id, - asym_cf); - return rv; -} - -sw_error_t -fal_ptp_output_waveform_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_output_waveform_t *waveform) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_OUTPUT_WAVEFORM_SET, dev_id, port_id, - waveform); - return rv; -} - -sw_error_t -fal_ptp_output_waveform_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_output_waveform_t *waveform) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_OUTPUT_WAVEFORM_GET, dev_id, port_id, - waveform); - return rv; -} - -sw_error_t -fal_ptp_rtc_time_snapshot_enable(a_uint32_t dev_id, a_uint32_t port_id, - a_bool_t status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RTC_TIME_SNAPSHOT_SET, dev_id, port_id, - status); - return rv; -} - -sw_error_t -fal_ptp_rtc_time_snapshot_status_get(a_uint32_t dev_id, a_uint32_t port_id, - a_bool_t *status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_RTC_TIME_SNAPSHOT_GET, dev_id, port_id, - status); - return rv; -} - -sw_error_t -fal_ptp_increment_sync_from_clock_enable(a_uint32_t dev_id, - a_uint32_t port_id, a_bool_t status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_SET, dev_id, port_id, - status); - return rv; -} - -sw_error_t -fal_ptp_increment_sync_from_clock_status_get(a_uint32_t dev_id, - a_uint32_t port_id, a_bool_t *status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_INCREMENT_SYNC_FROM_CLOCK_GET, dev_id, port_id, - status); - return rv; -} - -sw_error_t -fal_ptp_tod_uart_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_tod_uart_t *tod_uart) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_TOD_UART_SET, dev_id, port_id, - tod_uart); - return rv; -} - -sw_error_t -fal_ptp_tod_uart_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_tod_uart_t *tod_uart) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_TOD_UART_GET, dev_id, port_id, - tod_uart); - return rv; -} - -sw_error_t -fal_ptp_enhanced_timestamp_engine_set(a_uint32_t dev_id, - a_uint32_t port_id, fal_ptp_direction_t direction, - fal_ptp_enhanced_ts_engine_t *ts_engine) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_SET, dev_id, port_id, - direction, ts_engine); - return rv; -} - -sw_error_t -fal_ptp_enhanced_timestamp_engine_get(a_uint32_t dev_id, - a_uint32_t port_id, fal_ptp_direction_t direction, - fal_ptp_enhanced_ts_engine_t *ts_engine) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_ENHANCED_TIMESTAMP_ENGINE_GET, dev_id, port_id, - direction, ts_engine); - return rv; -} - -sw_error_t -fal_ptp_trigger_set(a_uint32_t dev_id, a_uint32_t port_id, - a_uint32_t trigger_id, fal_ptp_trigger_t *triger) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_TRIGGER_SET, dev_id, port_id, - trigger_id, triger); - return rv; -} - -sw_error_t -fal_ptp_trigger_get(a_uint32_t dev_id, a_uint32_t port_id, - a_uint32_t trigger_id, fal_ptp_trigger_t *triger) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_TRIGGER_GET, dev_id, port_id, - trigger_id, triger); - return rv; -} - -sw_error_t -fal_ptp_capture_set(a_uint32_t dev_id, a_uint32_t port_id, - a_uint32_t capture_id, fal_ptp_capture_t *capture) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_CAPTURE_SET, dev_id, port_id, - capture_id, capture); - return rv; -} - -sw_error_t -fal_ptp_capture_get(a_uint32_t dev_id, a_uint32_t port_id, - a_uint32_t capture_id, fal_ptp_capture_t *capture) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_CAPTURE_GET, dev_id, port_id, - capture_id, capture); - return rv; -} - -sw_error_t -fal_ptp_interrupt_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_interrupt_t *interrupt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_INTERRUPT_SET, dev_id, port_id, - interrupt); - return rv; -} - -sw_error_t -fal_ptp_interrupt_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_ptp_interrupt_t *interrupt) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PTP_INTERRUPT_GET, dev_id, port_id, - interrupt); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_qm.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_qm.c deleted file mode 100755 index 09b8c341e..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_qm.c +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_qm.h" -#include "fal_uk_if.h" - -sw_error_t -fal_ac_ctrl_set( - a_uint32_t dev_id, - fal_ac_obj_t *obj, - fal_ac_ctrl_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_AC_CTRL_SET, dev_id, obj, cfg); - return rv; -} - -sw_error_t -fal_ac_ctrl_get( - a_uint32_t dev_id, - fal_ac_obj_t *obj, - fal_ac_ctrl_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_AC_CTRL_GET, dev_id, obj, cfg); - return rv; -} - -sw_error_t -fal_ac_prealloc_buffer_set( - a_uint32_t dev_id, - fal_ac_obj_t *obj, - a_uint16_t num) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_AC_PRE_BUFFER_SET, dev_id, obj, num); - return rv; -} - -sw_error_t -fal_ac_prealloc_buffer_get( - a_uint32_t dev_id, - fal_ac_obj_t *obj, - a_uint16_t *num) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_AC_PRE_BUFFER_GET, dev_id, obj, num); - return rv; -} - -sw_error_t -fal_ac_queue_group_set( - a_uint32_t dev_id, - a_uint32_t queue_id, - a_uint8_t group_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_GROUP_SET, dev_id, queue_id, group_id); - return rv; -} - -sw_error_t -fal_ac_queue_group_get( - a_uint32_t dev_id, - a_uint32_t queue_id, - a_uint8_t *group_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_GROUP_GET, dev_id, queue_id, group_id); - return rv; -} - -sw_error_t -fal_ac_static_threshold_set( - a_uint32_t dev_id, - fal_ac_obj_t *obj, - fal_ac_static_threshold_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_STATIC_THRESH_SET, dev_id, obj, cfg); - return rv; -} - -sw_error_t -fal_ac_static_threshold_get( - a_uint32_t dev_id, - fal_ac_obj_t *obj, - fal_ac_static_threshold_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_STATIC_THRESH_GET, dev_id, obj, cfg); - return rv; -} - -sw_error_t -fal_ac_dynamic_threshold_set( - a_uint32_t dev_id, - a_uint32_t queue_id, - fal_ac_dynamic_threshold_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DYNAMIC_THRESH_SET, dev_id, queue_id, cfg); - return rv; -} - -sw_error_t -fal_ac_dynamic_threshold_get( - a_uint32_t dev_id, - a_uint32_t queue_id, - fal_ac_dynamic_threshold_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DYNAMIC_THRESH_GET, dev_id, queue_id, cfg); - return rv; -} - -sw_error_t -fal_ac_group_buffer_set( - a_uint32_t dev_id, - a_uint8_t group_id, - fal_ac_group_buffer_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_GOURP_BUFFER_SET, dev_id, group_id, cfg); - return rv; -} - -sw_error_t -fal_ac_group_buffer_get( - a_uint32_t dev_id, - a_uint8_t group_id, - fal_ac_group_buffer_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_GOURP_BUFFER_GET, dev_id, group_id, cfg); - return rv; -} - -sw_error_t -fal_ucast_queue_base_profile_set( - a_uint32_t dev_id, - fal_ucast_queue_dest_t *queue_dest, - a_uint32_t queue_base, a_uint8_t profile) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UCAST_QUEUE_BASE_PROFILE_SET, dev_id, queue_dest, queue_base, profile); - return rv; -} - -sw_error_t -fal_ucast_queue_base_profile_get( - a_uint32_t dev_id, - fal_ucast_queue_dest_t *queue_dest, - a_uint32_t *queue_base, a_uint8_t *profile) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UCAST_QUEUE_BASE_PROFILE_GET, dev_id, queue_dest, queue_base, profile); - return rv; -} - -sw_error_t -fal_ucast_priority_class_set( - a_uint32_t dev_id, - a_uint8_t profile, - a_uint8_t priority, - a_uint8_t class) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UCAST_PRIORITY_CLASS_SET, dev_id, profile, priority, class); - return rv; -} - -sw_error_t -fal_ucast_priority_class_get( - a_uint32_t dev_id, - a_uint8_t profile, - a_uint8_t priority, - a_uint8_t *class) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UCAST_PRIORITY_CLASS_GET, dev_id, profile, priority, class); - return rv; -} - -sw_error_t -fal_ucast_hash_map_set( - a_uint32_t dev_id, - a_uint8_t profile, - a_uint8_t rss_hash, - a_int8_t queue_hash) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UCAST_HASH_MAP_SET, dev_id, profile, rss_hash, queue_hash); - return rv; -} - -sw_error_t -fal_ucast_hash_map_get( - a_uint32_t dev_id, - a_uint8_t profile, - a_uint8_t rss_hash, - a_int8_t *queue_hash) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UCAST_HASH_MAP_GET, dev_id, profile, rss_hash, queue_hash); - return rv; -} - -sw_error_t -fal_mcast_cpu_code_class_set( - a_uint32_t dev_id, - a_uint8_t cpu_code, - a_uint8_t queue_class) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MCAST_CPUCODE_CLASS_SET, dev_id, cpu_code, queue_class); - return rv; -} - -sw_error_t -fal_mcast_cpu_code_class_get( - a_uint32_t dev_id, - a_uint8_t cpu_code, - a_uint8_t *queue_class) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MCAST_CPUCODE_CLASS_GET, dev_id, cpu_code, queue_class); - return rv; -} - -sw_error_t -fal_port_mcast_priority_class_set( - a_uint32_t dev_id, - fal_port_t port, - a_uint8_t priority, - a_uint8_t queue_class) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MCAST_PRIORITY_CLASS_SET, dev_id, port, priority, queue_class); - return rv; -} - -sw_error_t -fal_port_mcast_priority_class_get( - a_uint32_t dev_id, - fal_port_t port, - a_uint8_t priority, - a_uint8_t *queue_class) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_MCAST_PRIORITY_CLASS_GET, dev_id, port, priority, queue_class); - return rv; -} - -sw_error_t -fal_queue_flush( - a_uint32_t dev_id, - fal_port_t port, - a_uint16_t queue_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_FLUSH, dev_id, port, queue_id); - return rv; -} - -sw_error_t -fal_ucast_default_hash_set( - a_uint32_t dev_id, - a_uint8_t hash_value) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UCAST_DFLT_HASH_MAP_SET, dev_id, hash_value); - return rv; -} - -sw_error_t -fal_ucast_default_hash_get( - a_uint32_t dev_id, - a_uint8_t *hash_value) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UCAST_DFLT_HASH_MAP_GET, dev_id, hash_value); - return rv; -} - -sw_error_t -fal_queue_counter_ctrl_set(a_uint32_t dev_id, a_bool_t cnt_en) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_CNT_CTRL_SET, dev_id, cnt_en); - return rv; -} - -sw_error_t -fal_queue_counter_ctrl_get(a_uint32_t dev_id, a_bool_t *cnt_en) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_CNT_CTRL_GET, dev_id, cnt_en); - return rv; -} - -sw_error_t -fal_queue_counter_get( - a_uint32_t dev_id, - a_uint32_t queue_id, - fal_queue_stats_t *info) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_CNT_GET, dev_id, queue_id, info); - return rv; -} - -sw_error_t -fal_queue_counter_cleanup(a_uint32_t dev_id, a_uint32_t queue_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_CNT_CLEANUP, dev_id, queue_id); - return rv; -} - -sw_error_t -fal_qm_enqueue_ctrl_set(a_uint32_t dev_id, a_uint32_t queue_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QM_ENQUEUE_CTRL_SET, dev_id, queue_id, enable); - return rv; -} - -sw_error_t -fal_qm_enqueue_ctrl_get(a_uint32_t dev_id, a_uint32_t queue_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QM_ENQUEUE_CTRL_GET, dev_id, queue_id, enable); - return rv; -} - -sw_error_t -fal_qm_port_source_profile_set( - a_uint32_t dev_id, fal_port_t port, - a_uint32_t src_profile) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QM_SOURCE_PROFILE_SET, dev_id, port, src_profile); - return rv; -} - -sw_error_t -fal_qm_port_source_profile_get( - a_uint32_t dev_id, fal_port_t port, - a_uint32_t *src_profile) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QM_SOURCE_PROFILE_GET, dev_id, port, src_profile); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_qos.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_qos.c deleted file mode 100644 index e48faa3c9..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_qos.c +++ /dev/null @@ -1,612 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_qos.h" -#include "fal_uk_if.h" - -sw_error_t -fal_qos_sch_mode_set(a_uint32_t dev_id, - fal_sch_mode_t mode, const a_uint32_t weight[]) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_SCH_MODE_SET, dev_id, mode, - weight); - return rv; -} - -sw_error_t -fal_qos_sch_mode_get(a_uint32_t dev_id, - fal_sch_mode_t * mode, a_uint32_t weight[]) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_SCH_MODE_GET, dev_id, mode, - weight); - return rv; -} - -sw_error_t -fal_qos_queue_tx_buf_status_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_QU_TX_BUF_ST_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_qos_queue_tx_buf_status_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_QU_TX_BUF_ST_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_qos_queue_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id, - fal_queue_t queue_id, a_uint32_t * number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_QU_TX_BUF_NR_SET, dev_id, port_id, queue_id, - number); - return rv; -} - -sw_error_t -fal_qos_queue_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id, - fal_queue_t queue_id, a_uint32_t * number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_QU_TX_BUF_NR_GET, dev_id, port_id, queue_id, - number); - return rv; -} - -sw_error_t -fal_qos_port_tx_buf_status_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_TX_BUF_ST_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_qos_port_tx_buf_status_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_TX_BUF_ST_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_qos_port_red_en_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_RED_EN_SET, dev_id, port_id, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_qos_port_red_en_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t* enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_RED_EN_GET, dev_id, port_id, - enable); - return rv; -} - -sw_error_t -fal_qos_port_tx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_TX_BUF_NR_SET, dev_id, port_id, - number); - return rv; -} - -sw_error_t -fal_qos_port_tx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_TX_BUF_NR_GET, dev_id, port_id, - number); - return rv; -} - -sw_error_t -fal_qos_port_rx_buf_nr_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_RX_BUF_NR_SET, dev_id, port_id, - number); - return rv; -} - -sw_error_t -fal_qos_port_rx_buf_nr_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_RX_BUF_NR_GET, dev_id, port_id, - number); - return rv; -} - -sw_error_t -fal_cosmap_up_queue_set(a_uint32_t dev_id, a_uint32_t up, fal_queue_t queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_QU_SET, dev_id, up, - (a_uint32_t) queue); - return rv; -} - -sw_error_t -fal_cosmap_up_queue_get(a_uint32_t dev_id, a_uint32_t up, - fal_queue_t * queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_UP_QU_GET, dev_id, up, - queue); - return rv; -} - -sw_error_t -fal_cosmap_dscp_queue_set(a_uint32_t dev_id, a_uint32_t dscp, fal_queue_t queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_DSCP_QU_SET, dev_id, dscp, - (a_uint32_t) queue); - return rv; -} - -sw_error_t -fal_cosmap_dscp_queue_get(a_uint32_t dev_id, a_uint32_t dscp, - fal_queue_t * queue) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_COSMAP_DSCP_QU_GET, dev_id, dscp, - queue); - return rv; -} - -sw_error_t -fal_qos_port_mode_set(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_mode_t mode, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_MODE_SET, dev_id, port_id, mode, - (a_uint32_t) enable); - return rv; -} - -sw_error_t -fal_qos_port_mode_get(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_mode_t mode, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_MODE_GET, dev_id, port_id, mode, - enable); - return rv; -} - -sw_error_t -fal_qos_port_mode_pri_set(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_mode_t mode, a_uint32_t pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_MODE_PRI_SET, dev_id, port_id, mode, pri); - return rv; -} - -sw_error_t -fal_qos_port_mode_pri_get(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_mode_t mode, a_uint32_t * pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_MODE_PRI_GET, dev_id, port_id, mode, - pri); - return rv; -} - -sw_error_t -fal_qos_port_default_up_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t up) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_DEF_UP_SET, dev_id, port_id, up); - return rv; -} - -sw_error_t -fal_qos_port_default_up_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * up) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_DEF_UP_GET, dev_id, port_id, up); - return rv; -} - -sw_error_t -fal_qos_port_sch_mode_set(a_uint32_t dev_id, a_uint32_t port_id, - fal_sch_mode_t mode, const a_uint32_t weight[]) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_SCH_MODE_SET, dev_id, port_id, mode, - weight); - return rv; -} - -sw_error_t -fal_qos_port_sch_mode_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sch_mode_t * mode, a_uint32_t weight[]) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_SCH_MODE_GET, dev_id, port_id, mode, - weight); - return rv; -} - -sw_error_t -fal_qos_port_default_spri_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t spri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_DEF_SPRI_SET, dev_id, port_id, spri); - return rv; -} - -sw_error_t -fal_qos_port_default_spri_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * spri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_DEF_SPRI_GET, dev_id, port_id, spri); - return rv; -} - -sw_error_t -fal_qos_port_default_cpri_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t cpri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_DEF_CPRI_SET, dev_id, port_id, cpri); - return rv; -} - -sw_error_t -fal_qos_port_default_cpri_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * cpri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_DEF_CPRI_GET, dev_id, port_id, cpri); - return rv; -} - -sw_error_t -fal_qos_port_force_spri_status_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_FORCE_SPRI_ST_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_qos_port_force_spri_status_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t* enable) -{ - sw_error_t rv; - rv = sw_uk_exec(SW_API_QOS_PT_FORCE_SPRI_ST_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_qos_port_force_cpri_status_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_FORCE_CPRI_ST_SET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_qos_port_force_cpri_status_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t* enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PT_FORCE_CPRI_ST_GET, dev_id, port_id, enable); - return rv; -} - -sw_error_t -fal_qos_queue_remark_table_set(a_uint32_t dev_id, fal_port_t port_id, - fal_queue_t queue_id, a_uint32_t tbl_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_QUEUE_REMARK_SET, dev_id, port_id, queue_id, tbl_id, enable); - return rv; -} - - -sw_error_t -fal_qos_queue_remark_table_get(a_uint32_t dev_id, fal_port_t port_id, - fal_queue_t queue_id, a_uint32_t * tbl_id, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_QUEUE_REMARK_GET, dev_id, port_id, queue_id, tbl_id, enable); - return rv; -} - -sw_error_t -fal_qos_port_group_set(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_group_t *group) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_GROUP_SET, dev_id, port_id, group); - return rv; -} - -sw_error_t -fal_qos_port_group_get(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_group_t *group) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_GROUP_GET, dev_id, port_id, group); - return rv; -} - -sw_error_t -fal_qos_port_pri_precedence_set(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_pri_precedence_t *pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_PRI_SET, dev_id, port_id, pri); - return rv; -} - -sw_error_t -fal_qos_port_pri_precedence_get(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_pri_precedence_t *pri) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_PRI_GET, dev_id, port_id, pri); - return rv; -} - -sw_error_t -fal_qos_port_remark_set(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_remark_enable_t *remark) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_REMARK_SET, dev_id, port_id, remark); - return rv; -} - -sw_error_t -fal_qos_port_remark_get(a_uint32_t dev_id, fal_port_t port_id, - fal_qos_remark_enable_t *remark) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_REMARK_GET, dev_id, port_id, remark); - return rv; -} - -sw_error_t -fal_qos_cosmap_pcp_set(a_uint32_t dev_id, a_uint8_t group_id, - a_uint8_t pcp, fal_qos_cosmap_t *cosmap) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PCP_MAP_SET, dev_id, group_id, pcp, cosmap); - return rv; -} - -sw_error_t -fal_qos_cosmap_pcp_get(a_uint32_t dev_id, a_uint8_t group_id, - a_uint8_t pcp, fal_qos_cosmap_t *cosmap) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PCP_MAP_GET, dev_id, group_id, pcp, cosmap); - return rv; -} - -sw_error_t -fal_qos_cosmap_flow_set(a_uint32_t dev_id, a_uint8_t group_id, - a_uint16_t flow, fal_qos_cosmap_t *cosmap) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_FLOW_MAP_SET, dev_id, group_id, flow, cosmap); - return rv; -} - -sw_error_t -fal_qos_cosmap_flow_get(a_uint32_t dev_id, a_uint8_t group_id, - a_uint16_t flow, fal_qos_cosmap_t *cosmap) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_FLOW_MAP_GET, dev_id, group_id, flow, cosmap); - return rv; -} - -sw_error_t -fal_qos_cosmap_dscp_set(a_uint32_t dev_id, a_uint8_t group_id, - a_uint8_t dscp, fal_qos_cosmap_t *cosmap) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_DSCP_MAP_SET, dev_id, group_id, dscp, cosmap); - return rv; -} - -sw_error_t -fal_qos_cosmap_dscp_get(a_uint32_t dev_id, a_uint8_t group_id, - a_uint8_t dscp, fal_qos_cosmap_t *cosmap) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_DSCP_MAP_GET, dev_id, group_id, dscp, cosmap); - return rv; -} - -sw_error_t -fal_queue_scheduler_set(a_uint32_t dev_id, a_uint32_t node_id, - fal_queue_scheduler_level_t level, fal_port_t port_id, - fal_qos_scheduler_cfg_t *scheduler_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_QUEUE_SCHEDULER_SET, dev_id, node_id, level, port_id, scheduler_cfg); - return rv; -} - -sw_error_t -fal_queue_scheduler_get(a_uint32_t dev_id, a_uint32_t node_id, - fal_queue_scheduler_level_t level, fal_port_t *port_id, - fal_qos_scheduler_cfg_t *scheduler_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_QUEUE_SCHEDULER_GET, dev_id, node_id, level, port_id, scheduler_cfg); - return rv; -} - -sw_error_t -fal_edma_ring_queue_map_set(a_uint32_t dev_id, - a_uint32_t ring_id, fal_queue_bmp_t *queue_bmp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_RING_QUEUE_MAP_SET, dev_id, ring_id, queue_bmp); - return rv; -} - -sw_error_t -fal_edma_ring_queue_map_get(a_uint32_t dev_id, - a_uint32_t ring_id, fal_queue_bmp_t *queue_bmp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_RING_QUEUE_MAP_GET, dev_id, ring_id, queue_bmp); - return rv; -} - -sw_error_t -fal_port_queues_get(a_uint32_t dev_id, - fal_port_t port_id, fal_queue_bmp_t *queue_bmp) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_QUEUES_GET, dev_id, port_id, queue_bmp); - return rv; -} - -sw_error_t -fal_scheduler_dequeue_ctrl_set(a_uint32_t dev_id, a_uint32_t queue_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET, dev_id, queue_id, enable); - return rv; -} - -sw_error_t -fal_scheduler_dequeue_ctrl_get(a_uint32_t dev_id, a_uint32_t queue_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET, dev_id, queue_id, enable); - return rv; -} - -sw_error_t -fal_port_scheduler_cfg_reset(a_uint32_t dev_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_SCHEDULER_CFG_RESET, dev_id, port_id); - return rv; -} - -sw_error_t -fal_port_scheduler_resource_get( - a_uint32_t dev_id, - fal_port_t port_id, - fal_portscheduler_resource_t *cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET, dev_id, port_id, cfg); - return rv; -} \ No newline at end of file diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_rate.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_rate.c deleted file mode 100755 index f53ea1bbf..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_rate.c +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_rate.h" -#include "fal_uk_if.h" - -sw_error_t -fal_rate_queue_egrl_set(a_uint32_t dev_id, fal_port_t port_id, - fal_queue_t queue_id, a_uint32_t * speed, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_QU_EGRL_SET, dev_id, port_id, queue_id, - speed, enable); - return rv; -} - -sw_error_t -fal_rate_queue_egrl_get(a_uint32_t dev_id, fal_port_t port_id, - fal_queue_t queue_id, a_uint32_t * speed, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_QU_EGRL_GET, dev_id, port_id, queue_id, - speed, enable); - return rv; -} - -sw_error_t -fal_rate_port_egrl_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * speed, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PT_EGRL_SET, dev_id, port_id, - speed, enable); - return rv; -} - -sw_error_t -fal_rate_port_egrl_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * speed, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PT_EGRL_GET, dev_id, port_id, - speed, enable); - return rv; -} - -sw_error_t -fal_rate_port_inrl_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * speed, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PT_INRL_SET, dev_id, port_id, - speed, enable); - return rv; -} - -sw_error_t -fal_rate_port_inrl_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * speed, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PT_INRL_GET, dev_id, port_id, - speed, enable); - return rv; -} - -sw_error_t -fal_storm_ctrl_frame_set(a_uint32_t dev_id, fal_port_t port_id, - fal_storm_type_t frame_type, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_STORM_CTRL_FRAME_SET, dev_id, port_id, - frame_type, enable); - return rv; -} - -sw_error_t -fal_storm_ctrl_frame_get(a_uint32_t dev_id, fal_port_t port_id, - fal_storm_type_t frame_type, a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_STORM_CTRL_FRAME_GET, dev_id, port_id, - frame_type, enable); - return rv; -} - -sw_error_t -fal_storm_ctrl_rate_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * rate) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_STORM_CTRL_RATE_SET, dev_id, port_id, - rate); - return rv; -} - -sw_error_t -fal_storm_ctrl_rate_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t * rate) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_STORM_CTRL_RATE_GET, dev_id, port_id, - rate); - return rv; -} - -sw_error_t -fal_rate_port_policer_set(a_uint32_t dev_id, fal_port_t port_id, - fal_port_policer_t * policer) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PORT_POLICER_SET, dev_id, port_id, - policer); - return rv; -} - -sw_error_t -fal_rate_port_policer_get(a_uint32_t dev_id, fal_port_t port_id, - fal_port_policer_t * policer) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PORT_POLICER_GET, dev_id, port_id, - policer); - return rv; -} - -sw_error_t -fal_rate_port_shaper_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable, fal_egress_shaper_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PORT_SHAPER_SET, dev_id, port_id, - enable, shaper); - return rv; -} - -sw_error_t -fal_rate_port_shaper_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t * enable, fal_egress_shaper_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PORT_SHAPER_GET, dev_id, port_id, - enable, shaper); - return rv; -} - -sw_error_t -fal_rate_queue_shaper_set(a_uint32_t dev_id, fal_port_t port_id, - fal_queue_t queue_id, a_bool_t enable, - fal_egress_shaper_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_QUEUE_SHAPER_SET, dev_id, port_id, queue_id, - enable, shaper); - return rv; -} - -sw_error_t -fal_rate_queue_shaper_get(a_uint32_t dev_id, fal_port_t port_id, - fal_queue_t queue_id, a_bool_t * enable, - fal_egress_shaper_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_QUEUE_SHAPER_GET, dev_id, port_id, queue_id, - enable, shaper); - return rv; -} - -sw_error_t -fal_rate_acl_policer_set(a_uint32_t dev_id, a_uint32_t policer_id, - fal_acl_policer_t * policer) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_ACL_POLICER_SET, dev_id, policer_id, policer); - return rv; -} - -sw_error_t -fal_rate_acl_policer_get(a_uint32_t dev_id, a_uint32_t policer_id, - fal_acl_policer_t * policer) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_ACL_POLICER_GET, dev_id, policer_id, policer); - return rv; -} - -sw_error_t -fal_rate_port_add_rate_byte_set(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PT_ADDRATEBYTE_SET, dev_id, port_id, number); - return rv; -} - -sw_error_t -fal_rate_port_add_rate_byte_get(a_uint32_t dev_id, fal_port_t port_id, - a_uint32_t *number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PT_ADDRATEBYTE_GET, dev_id, port_id, number); - return rv; -} - -sw_error_t -fal_rate_port_gol_flow_en_set(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PT_GOL_FLOW_EN_SET, dev_id, port_id, enable); - return rv; -} - - -sw_error_t -fal_rate_port_gol_flow_en_get(a_uint32_t dev_id, fal_port_t port_id, - a_bool_t* enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RATE_PT_GOL_FLOW_EN_GET, dev_id, port_id, enable); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_reg_access.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_reg_access.c deleted file mode 100755 index 6825836b5..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_reg_access.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/*qca808x_start*/ -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_reg_access.h" -#include "fal_uk_if.h" - -sw_error_t -fal_phy_get(a_uint32_t dev_id, a_uint32_t phy_addr, - a_uint32_t reg, a_uint16_t * value) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PHY_GET, dev_id, phy_addr, reg, value); - return rv; -} - -sw_error_t -fal_phy_set(a_uint32_t dev_id, a_uint32_t phy_addr, - a_uint32_t reg, a_uint16_t value) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PHY_SET, dev_id, phy_addr, reg, value); - return rv; -} -/*qca808x_end*/ -sw_error_t -fal_reg_get(a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t value[], - a_uint32_t value_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_REG_GET, dev_id, reg_addr, value, value_len); - return rv; -} - -sw_error_t -fal_reg_set(a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t value[], - a_uint32_t value_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_REG_SET, dev_id, reg_addr, value, value_len); - return rv; -} - -sw_error_t -fal_psgmii_reg_get(a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t value[], - a_uint32_t value_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PSGMII_REG_GET, dev_id, reg_addr, value, value_len); - return rv; -} - -sw_error_t -fal_psgmii_reg_set(a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t value[], - a_uint32_t value_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PSGMII_REG_SET, dev_id, reg_addr, value, value_len); - return rv; -} - -sw_error_t -fal_reg_field_get(a_uint32_t dev_id, a_uint32_t reg_addr, - a_uint32_t bit_offset, a_uint32_t field_len, - a_uint8_t value[], a_uint32_t value_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_REG_FIELD_GET, dev_id, reg_addr, bit_offset, field_len, value, value_len); - return rv; -} - - -sw_error_t -fal_reg_field_set(a_uint32_t dev_id, a_uint32_t reg_addr, - a_uint32_t bit_offset, a_uint32_t field_len, - const a_uint8_t value[], a_uint32_t value_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_REG_FIELD_SET, dev_id, reg_addr, bit_offset, field_len, value, value_len); - return rv; -} - -sw_error_t -fal_reg_dump(a_uint32_t dev_id, a_uint32_t reg_idx,fal_reg_dump_t *reg_dump) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_REG_DUMP, dev_id, reg_idx, reg_dump); - return rv; -} - - -sw_error_t -fal_dbg_reg_dump(a_uint32_t dev_id,fal_reg_dump_t *reg_dump) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DBG_REG_DUMP, dev_id, reg_dump); - return rv; -} - -sw_error_t -fal_debug_psgmii_self_test(a_uint32_t dev_id, a_bool_t enable, - a_uint32_t times, a_uint32_t * result) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_DBG_PSGMII_SELF_TEST, dev_id, enable, times, result); - return rv; -} -sw_error_t -fal_phy_dump(a_uint32_t dev_id, a_uint32_t phy_addr, a_uint32_t reg_idx,fal_phy_dump_t *phy_dump) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PHY_DUMP, dev_id, phy_addr, reg_idx, phy_dump); - return rv; -} - -sw_error_t -fal_uniphy_reg_get(a_uint32_t dev_id, a_uint32_t index, a_uint32_t reg_addr, - a_uint8_t value[], a_uint32_t value_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UNIPHY_REG_GET, dev_id, index, reg_addr, value, value_len); - return rv; -} - -sw_error_t -fal_uniphy_reg_set(a_uint32_t dev_id, a_uint32_t index, a_uint32_t reg_addr, - a_uint8_t value[], a_uint32_t value_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_UNIPHY_REG_SET, dev_id, index, reg_addr, value, value_len); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_rss_hash.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_rss_hash.c deleted file mode 100755 index 28b67b5a3..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_rss_hash.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_rss_hash.h" -#include "fal_uk_if.h" - -sw_error_t -fal_rss_hash_config_set(a_uint32_t dev_id, fal_rss_hash_mode_t mode, fal_rss_hash_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RSS_HASH_CONFIG_SET, dev_id, mode, - config); - return rv; -} - -sw_error_t -fal_rss_hash_config_get(a_uint32_t dev_id, fal_rss_hash_mode_t mode, fal_rss_hash_config_t * config) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_RSS_HASH_CONFIG_GET, dev_id, mode, - config); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_sec.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_sec.c deleted file mode 100755 index 60627a40d..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_sec.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_sec.h" -#include "fal_uk_if.h" - -sw_error_t -fal_sec_norm_item_set(a_uint32_t dev_id, fal_norm_item_t item, void * value) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SEC_NORM_SET, dev_id, item, value); - return rv; -} - -sw_error_t -fal_sec_norm_item_get(a_uint32_t dev_id, fal_norm_item_t item, void * value) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SEC_NORM_GET, dev_id, item, value); - return rv; -} - -sw_error_t -fal_sec_l3_excep_ctrl_set(a_uint32_t dev_id, a_uint32_t excep_type, fal_l3_excep_ctrl_t *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SEC_EXP_CTRL_SET, dev_id, excep_type, ctrl); - return rv; -} - -sw_error_t -fal_sec_l3_excep_ctrl_get(a_uint32_t dev_id, a_uint32_t excep_type, fal_l3_excep_ctrl_t *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SEC_EXP_CTRL_GET, dev_id, excep_type, ctrl); - return rv; -} - -sw_error_t -fal_sec_l4_excep_parser_ctrl_get(a_uint32_t dev_id, fal_l4_excep_parser_ctrl *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SEC_L4_PARSER_CTRL_GET, dev_id, ctrl); - return rv; -} - -sw_error_t -fal_sec_l4_excep_parser_ctrl_set(a_uint32_t dev_id, fal_l4_excep_parser_ctrl *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SEC_L4_PARSER_CTRL_SET, dev_id, ctrl); - return rv; -} - -sw_error_t -fal_sec_l3_excep_parser_ctrl_set(a_uint32_t dev_id, fal_l3_excep_parser_ctrl *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SEC_L3_PARSER_CTRL_SET, dev_id, ctrl); - return rv; -} - -sw_error_t -fal_sec_l3_excep_parser_ctrl_get(a_uint32_t dev_id, fal_l3_excep_parser_ctrl *ctrl) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SEC_L3_PARSER_CTRL_GET, dev_id, ctrl); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_servcode.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_servcode.c deleted file mode 100755 index 5bc9194ea..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_servcode.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_servcode.h" -#include "fal_uk_if.h" - -sw_error_t fal_servcode_config_set(a_uint32_t dev_id, a_uint32_t servcode_index, - fal_servcode_config_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SERVCODE_CONFIG_SET, dev_id, servcode_index, - entry); - return rv; -} - -sw_error_t fal_servcode_config_get(a_uint32_t dev_id, a_uint32_t servcode_index, - fal_servcode_config_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SERVCODE_CONFIG_GET, dev_id, servcode_index, - entry); - return rv; -} - -sw_error_t fal_servcode_loopcheck_en(a_uint32_t dev_id, a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SERVCODE_LOOPCHECK_EN, dev_id, (a_uint32_t) enable); - return rv; -} - -sw_error_t fal_servcode_loopcheck_status_get(a_uint32_t dev_id, a_bool_t *enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SERVCODE_LOOPCHECK_STATUS_GET, dev_id, enable); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_sfp.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_sfp.c deleted file mode 100755 index 9b320c040..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_sfp.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_sfp.h" -#include "fal_uk_if.h" - -sw_error_t -fal_sfp_eeprom_data_get(a_uint32_t dev_id, a_uint32_t port_id, fal_sfp_data_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_DATA_GET, dev_id, port_id, entry); - return rv; -} - -sw_error_t -fal_sfp_eeprom_data_set(a_uint32_t dev_id, a_uint32_t port_id, fal_sfp_data_t *entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_DATA_SET, dev_id, port_id, entry); - - return rv; -} - -sw_error_t -fal_sfp_device_type_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_dev_type_t *sfp_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_DEV_TYPE_GET, dev_id, port_id, - sfp_id); - return rv; -} - -sw_error_t -fal_sfp_transceiver_code_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_transc_code_t *transc_code) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_TRANSC_CODE_GET, dev_id, port_id, - transc_code); - return rv; -} - -sw_error_t -fal_sfp_rate_encode_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_rate_encode_t *encode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_RATE_ENCODE_GET, dev_id, port_id, - encode); - return rv; -} - -sw_error_t -fal_sfp_link_length_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_link_length_t *link_len) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_LINK_LENGTH_GET, dev_id, port_id, - link_len); - return rv; -} - -sw_error_t -fal_sfp_vendor_info_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_vendor_info_t *vender_info) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_VENDOR_INFO_GET, dev_id, port_id, - vender_info); - return rv; -} - -sw_error_t -fal_sfp_laser_wavelength_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_laser_wavelength_t *laser_wavelen) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_LASER_WAVELENGTH_GET, dev_id, port_id, - laser_wavelen); - return rv; -} - -sw_error_t -fal_sfp_option_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_option_t *option) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_OPTION_GET, dev_id, port_id, - option); - return rv; -} - -sw_error_t -fal_sfp_ctrl_rate_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_rate_t *rate_limit) - -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_CTRL_RATE_GET, dev_id, port_id, - rate_limit); - return rv; -} -sw_error_t -fal_sfp_enhanced_cfg_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_enhanced_cfg_t *enhanced_feature) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_ENHANCED_CFG_GET, dev_id, port_id, - enhanced_feature); - return rv; -} - -sw_error_t -fal_sfp_diag_internal_threshold_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_internal_threshold_t *threshold) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_DIAG_THRESHOLD_GET, dev_id, port_id, - threshold); - return rv; -} - -sw_error_t -fal_sfp_diag_extenal_calibration_const_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_cal_const_t *cal_const) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_DIAG_CAL_CONST_GET, dev_id, port_id, - cal_const); - return rv; -} - -sw_error_t -fal_sfp_diag_realtime_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_realtime_diag_t *real_diag) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_DIAG_REALTIME_GET, dev_id, port_id, - real_diag); - return rv; -} - -sw_error_t -fal_sfp_diag_ctrl_status_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_ctrl_status_t *ctrl_status) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_DIAG_CTRL_STATUS_GET, dev_id, port_id, - ctrl_status); - return rv; -} - -sw_error_t -fal_sfp_diag_alarm_warning_flag_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_alarm_warn_flag_t *alarm_warn_flag) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_DIAG_ALARM_WARN_FLAG_GET, dev_id, port_id, - alarm_warn_flag); - return rv; -} - -sw_error_t -fal_sfp_checkcode_get(a_uint32_t dev_id, a_uint32_t port_id, - fal_sfp_cc_type_t cc_type, a_uint8_t *ccode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SFP_CHECKCODE_GET, dev_id, port_id, (a_ulong_t)cc_type, - ccode); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_shaper.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_shaper.c deleted file mode 100755 index e579307fe..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_shaper.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_shaper.h" -#include "fal_uk_if.h" - - -sw_error_t -fal_port_shaper_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_SHAPER_TIMESLOT_SET, dev_id, timeslot); - return rv; -} - -sw_error_t -fal_port_shaper_timeslot_get(a_uint32_t dev_id, a_uint32_t *timeslot) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_SHAPER_TIMESLOT_GET, dev_id, timeslot); - return rv; -} - -sw_error_t -fal_flow_shaper_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_SHAPER_TIMESLOT_SET, dev_id, timeslot); - return rv; -} - -sw_error_t -fal_flow_shaper_timeslot_get(a_uint32_t dev_id, a_uint32_t *timeslot) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_SHAPER_TIMESLOT_GET, dev_id, timeslot); - return rv; -} - -sw_error_t -fal_queue_shaper_timeslot_set(a_uint32_t dev_id, a_uint32_t timeslot) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_SHAPER_TIMESLOT_SET, dev_id, timeslot); - return rv; -} - -sw_error_t -fal_queue_shaper_timeslot_get(a_uint32_t dev_id, a_uint32_t *timeslot) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_SHAPER_TIMESLOT_GET, dev_id, timeslot); - return rv; -} - -sw_error_t -fal_port_shaper_token_number_set(a_uint32_t dev_id, fal_port_t port_id, - fal_shaper_token_number_t * token_number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_SHAPER_TOKEN_NUMBER_SET, dev_id, port_id, - token_number); - return rv; -} - -sw_error_t -fal_port_shaper_token_number_get(a_uint32_t dev_id, fal_port_t port_id, - fal_shaper_token_number_t * token_number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_SHAPER_TOKEN_NUMBER_GET, dev_id, port_id, - token_number); - return rv; -} - -sw_error_t -fal_flow_shaper_token_number_set(a_uint32_t dev_id, a_uint32_t flow_id, - fal_shaper_token_number_t * token_number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_SHAPER_TOKEN_NUMBER_SET, dev_id, flow_id, - token_number); - return rv; -} - -sw_error_t -fal_flow_shaper_token_number_get(a_uint32_t dev_id, a_uint32_t flow_id, - fal_shaper_token_number_t * token_number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_SHAPER_TOKEN_NUMBER_GET, dev_id, flow_id, - token_number); - return rv; -} - -sw_error_t -fal_queue_shaper_token_number_set(a_uint32_t dev_id, a_uint32_t queue_id, - fal_shaper_token_number_t * token_number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_SET, dev_id, queue_id, - token_number); - return rv; -} - -sw_error_t -fal_queue_shaper_token_number_get(a_uint32_t dev_id, a_uint32_t queue_id, - fal_shaper_token_number_t * token_number) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_SHAPER_TOKEN_NUMBER_GET, dev_id, queue_id, - token_number); - return rv; -} - -sw_error_t -fal_port_shaper_set(a_uint32_t dev_id, fal_port_t port_id, fal_shaper_config_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_SHAPER_SET, dev_id, port_id, - shaper); - return rv; -} - -sw_error_t -fal_port_shaper_get(a_uint32_t dev_id, fal_port_t port_id, fal_shaper_config_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_SHAPER_GET, dev_id, port_id, - shaper); - return rv; -} - -sw_error_t -fal_flow_shaper_set(a_uint32_t dev_id, a_uint32_t flow_id, fal_shaper_config_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_SHAPER_SET, dev_id, flow_id, - shaper); - return rv; -} - -sw_error_t -fal_flow_shaper_get(a_uint32_t dev_id, a_uint32_t flow_id, fal_shaper_config_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_FLOW_SHAPER_GET, dev_id, flow_id, - shaper); - return rv; -} - -sw_error_t -fal_queue_shaper_set(a_uint32_t dev_id, a_uint32_t queue_id, fal_shaper_config_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_SHAPER_SET, dev_id, queue_id, - shaper); - return rv; -} - -sw_error_t -fal_queue_shaper_get(a_uint32_t dev_id, a_uint32_t queue_id, fal_shaper_config_t * shaper) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_QUEUE_SHAPER_GET, dev_id, queue_id, - shaper); - return rv; -} - -sw_error_t -fal_shaper_ipg_preamble_length_set(a_uint32_t dev_id, a_uint32_t ipg_pre_length) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SHAPER_IPG_PRE_SET, dev_id, ipg_pre_length); - return rv; -} - -sw_error_t -fal_shaper_ipg_preamble_length_get(a_uint32_t dev_id, a_uint32_t *ipg_pre_length) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_SHAPER_IPG_PRE_GET, dev_id, ipg_pre_length); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_stp.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_stp.c deleted file mode 100755 index dce40792a..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_stp.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_stp.h" -#include "fal_uk_if.h" - -sw_error_t -fal_stp_port_state_set(a_uint32_t dev_id, a_uint32_t st_id, - fal_port_t port_id, fal_stp_state_t state) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_STP_PT_STATE_SET, dev_id, st_id, port_id, - (a_uint32_t) state); - return rv; -} - -sw_error_t -fal_stp_port_state_get(a_uint32_t dev_id, a_uint32_t st_id, - fal_port_t port_id, fal_stp_state_t * state) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_STP_PT_STATE_GET, dev_id, st_id, port_id, - state); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_trunk.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_trunk.c deleted file mode 100755 index d509d41f8..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_trunk.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_trunk.h" -#include "fal_uk_if.h" - - -sw_error_t -fal_trunk_group_set(a_uint32_t dev_id, a_uint32_t trunk_id, - a_bool_t enable, fal_pbmp_t member) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TRUNK_GROUP_SET, dev_id, trunk_id, enable, - (a_uint32_t) member); - return rv; -} - -sw_error_t -fal_trunk_group_get(a_uint32_t dev_id, a_uint32_t trunk_id, - a_bool_t * enable, fal_pbmp_t * member) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TRUNK_GROUP_GET, dev_id, trunk_id, enable, - member); - return rv; -} - -sw_error_t -fal_trunk_hash_mode_set(a_uint32_t dev_id, a_uint32_t hash_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TRUNK_HASH_SET, dev_id, hash_mode); - return rv; -} - -sw_error_t -fal_trunk_hash_mode_get(a_uint32_t dev_id, a_uint32_t * hash_mode) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TRUNK_HASH_GET, dev_id, hash_mode); - return rv; -} - -sw_error_t -fal_trunk_manipulate_sa_set(a_uint32_t dev_id, fal_mac_addr_t * addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TRUNK_MAN_SA_SET, dev_id, addr); - return rv; -} - -sw_error_t -fal_trunk_manipulate_sa_get(a_uint32_t dev_id, fal_mac_addr_t * addr) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TRUNK_MAN_SA_GET, dev_id, addr); - return rv; -} - -sw_error_t -fal_trunk_failover_enable(a_uint32_t dev_id, a_bool_t failover) - -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TRUNK_FAILOVER_EN_SET, dev_id, failover); - return rv; -} - -sw_error_t -fal_trunk_failover_status_get(a_uint32_t dev_id, a_bool_t *failover) - -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_TRUNK_FAILOVER_EN_GET, dev_id, failover); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_uk_if.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_uk_if.c deleted file mode 100755 index 891ef938d..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_uk_if.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#include -#include "sw.h" -#include "ssdk_init.h" -#include "sw_api.h" -#include "sw_api_us.h" -#include "api_access.h" - -sw_error_t -sw_uk_exec(a_uint32_t api_id, ...) -{ - unsigned long value[SW_MAX_API_PARAM] = { 0 }; - unsigned long rtn = SW_OK, i; - va_list arg_ptr; - a_uint32_t nr_param = 0; - - if((nr_param = sw_api_param_nums(api_id)) == 0) - { - return SW_NOT_SUPPORTED; - } - - value[0] = (unsigned long)api_id; - value[1] = (unsigned long)&rtn; - - va_start(arg_ptr, api_id); - for (i = 0; i < nr_param; i++) - { - value[i + 2] = va_arg(arg_ptr, unsigned long); - } - va_end(arg_ptr); - sw_uk_if(value); - - return rtn; -} - -sw_error_t -ssdk_init(a_uint32_t dev_id, ssdk_init_cfg * cfg) -{ - sw_error_t rv; - - rv = sw_uk_init(cfg->nl_prot); - return rv; -} - -sw_error_t -ssdk_cleanup(void) -{ - sw_error_t rv; - - rv = sw_uk_cleanup(); - return rv; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_vlan.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_vlan.c deleted file mode 100755 index eef60b186..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_vlan.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - - -#include "sw.h" -#include "sw_ioctl.h" -#include "fal_vlan.h" -#include "fal_uk_if.h" - -sw_error_t -fal_vlan_entry_append(a_uint32_t dev_id, fal_vlan_t * vlan_entry) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_APPEND, dev_id, vlan_entry); - return rv; -} - - -sw_error_t -fal_vlan_create(a_uint32_t dev_id, a_uint32_t vlan_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_ADD, dev_id, vlan_id); - return rv; -} - -sw_error_t -fal_vlan_next(a_uint32_t dev_id, a_uint32_t vlan_id, fal_vlan_t * p_vlan) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_NEXT, dev_id, vlan_id, p_vlan); - return rv; -} - -sw_error_t -fal_vlan_find(a_uint32_t dev_id, a_uint32_t vlan_id, fal_vlan_t * p_vlan) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_FIND, dev_id, vlan_id, p_vlan); - return rv; -} - -sw_error_t -fal_vlan_member_update(a_uint32_t dev_id, a_uint32_t vlan_id, - fal_pbmp_t member, fal_pbmp_t u_member) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_MEM_UPDATE, dev_id, vlan_id, member, - u_member); - return rv; -} - -sw_error_t -fal_vlan_delete(a_uint32_t dev_id, a_uint32_t vlan_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_DEL, dev_id, vlan_id); - return rv; -} - -sw_error_t -fal_vlan_flush(a_uint32_t dev_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_FLUSH, dev_id); - return rv; -} - -sw_error_t -fal_vlan_fid_set(a_uint32_t dev_id, a_uint32_t vlan_id, a_uint32_t fid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_FID_SET, dev_id, vlan_id, fid); - return rv; -} - -sw_error_t -fal_vlan_fid_get(a_uint32_t dev_id, a_uint32_t vlan_id, a_uint32_t * fid) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_FID_GET, dev_id, vlan_id, fid); - return rv; -} - -sw_error_t -fal_vlan_member_add(a_uint32_t dev_id, a_uint32_t vlan_id, - fal_port_t port_id, fal_pt_1q_egmode_t port_info) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_MEMBER_ADD, dev_id, vlan_id, port_id, port_info); - return rv; -} - -sw_error_t -fal_vlan_member_del(a_uint32_t dev_id, a_uint32_t vlan_id, fal_port_t port_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_MEMBER_DEL, dev_id, vlan_id, port_id); - return rv; -} - -sw_error_t -fal_vlan_learning_state_set(a_uint32_t dev_id, a_uint32_t vlan_id, - a_bool_t enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_LEARN_STATE_SET, dev_id, vlan_id, enable); - return rv; -} - -sw_error_t -fal_vlan_learning_state_get(a_uint32_t dev_id, a_uint32_t vlan_id, - a_bool_t * enable) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VLAN_LEARN_STATE_GET, dev_id, vlan_id, enable); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_vsi.c b/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_vsi.c deleted file mode 100755 index ddfe8c623..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/fal_uk/fal_vsi.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#include "sw_ioctl.h" -#include "fal_vsi.h" -#include "fal_uk_if.h" - -sw_error_t -fal_port_vsi_get(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t *vsi_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_VSI_GET, dev_id, port_id, vsi_id); - return rv; -} - -sw_error_t -fal_port_vlan_vsi_set(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t stag_vid, a_uint32_t ctag_vid, a_uint32_t vsi_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_VLAN_VSI_SET, dev_id, port_id, stag_vid, ctag_vid, vsi_id); - return rv; -} - -sw_error_t -fal_vsi_free(a_uint32_t dev_id, a_uint32_t vsi) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_FREE, dev_id, vsi); - return rv; -} - -sw_error_t -fal_port_vlan_vsi_get(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t stag_vid, a_uint32_t ctag_vid, a_uint32_t *vsi_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_VLAN_VSI_GET, dev_id, port_id, stag_vid, ctag_vid, vsi_id); - return rv; -} - -sw_error_t -fal_port_vsi_set(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t vsi_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_PORT_VSI_SET, dev_id, port_id, vsi_id); - return rv; -} - -sw_error_t -fal_vsi_alloc(a_uint32_t dev_id, a_uint32_t *vsi) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_ALLOC, dev_id, vsi); - return rv; -} - -sw_error_t -fal_vsi_tbl_dump(a_uint32_t dev_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_TBL_DUMP, dev_id); - return rv; -} - -sw_error_t -fal_vsi_stamove_set(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_stamove_t *stamove) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_STAMOVE_SET, dev_id, vsi_id, stamove); - return rv; -} -sw_error_t -fal_vsi_stamove_get(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_stamove_t *stamove) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_STAMOVE_GET, dev_id, vsi_id, stamove); - return rv; -} -sw_error_t -fal_vsi_newaddr_lrn_get(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_newaddr_lrn_t *newaddr_lrn) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_NEWADDR_LRN_GET, dev_id, vsi_id, newaddr_lrn); - return rv; -} -sw_error_t -fal_vsi_newaddr_lrn_set(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_newaddr_lrn_t *newaddr_lrn) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_NEWADDR_LRN_SET, dev_id, vsi_id, newaddr_lrn); - return rv; -} -sw_error_t -fal_vsi_member_get(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_member_t *vsi_member) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_MEMBER_GET, dev_id, vsi_id, vsi_member); - return rv; -} -sw_error_t -fal_vsi_member_set(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_member_t *vsi_member) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_MEMBER_SET, dev_id, vsi_id, vsi_member); - return rv; -} - -sw_error_t -fal_vsi_counter_get(a_uint32_t dev_id, a_uint32_t vsi_id, fal_vsi_counter_t *counter) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_COUNTER_GET, dev_id, vsi_id, counter); - return rv; -} - -sw_error_t -fal_vsi_counter_cleanup(a_uint32_t dev_id, a_uint32_t vsi_id) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_VSI_COUNTER_CLEANUP, dev_id, vsi_id); - return rv; -} - - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/ref/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/src/ref/Makefile deleted file mode 100755 index f92ae6c45..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/ref/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -LOC_DIR=src/ref -LIB=REF - -include $(PRJ_PATH)/make/config.mk - -SRC_LIST= - -ifeq (TRUE, $(IN_VLAN)) - SRC_LIST += ref_vlan.c -endif - -include $(PRJ_PATH)/make/components.mk -include $(PRJ_PATH)/make/defs.mk -include $(PRJ_PATH)/make/target.mk - -all: dep obj diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/ref/ref_vlan.c b/feeds/ipq807x/qca-ssdk-shell/src/src/ref/ref_vlan.c deleted file mode 100755 index d1af39455..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/ref/ref_vlan.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include "sw.h" -#include "sw_ioctl.h" -#include "ref_vlan.h" -#include "fal_uk_if.h" - -sw_error_t -qca_lan_wan_cfg_set(a_uint32_t dev_id, qca_lan_wan_cfg_t *lan_wan_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_LAN_WAN_CFG_SET, dev_id, lan_wan_cfg); - return rv; -} - -sw_error_t -qca_lan_wan_cfg_get(a_uint32_t dev_id, qca_lan_wan_cfg_t *lan_wan_cfg) -{ - sw_error_t rv; - - rv = sw_uk_exec(SW_API_LAN_WAN_CFG_GET, dev_id, lan_wan_cfg); - return rv; -} diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/src/sal/Makefile deleted file mode 100755 index 805ae0f63..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -LOC_DIR=src/sal -LIB=SAL - -include $(PRJ_PATH)/make/config.mk - -SRC_LIST=$(wildcard *.c) - -include $(PRJ_PATH)/make/components.mk -include $(PRJ_PATH)/make/defs.mk -include $(PRJ_PATH)/make/target.mk - -all: dep obj diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/Makefile deleted file mode 100755 index 74c50e2eb..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -LOC_DIR=src/sal/sd -LIB=SAL - -include $(PRJ_PATH)/make/config.mk - -SRC_LIST=$(wildcard *.c) - -include $(PRJ_PATH)/make/components.mk -include $(PRJ_PATH)/make/defs.mk -include $(PRJ_PATH)/make/target.mk - -all: dep obj \ No newline at end of file diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/Makefile deleted file mode 100755 index a038efc6d..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -LOC_DIR=src/sal/sd/linux -LIB=SAL - -include $(PRJ_PATH)/make/config.mk - -SRC_LIST=$(wildcard *.c) - -include $(PRJ_PATH)/make/components.mk -include $(PRJ_PATH)/make/defs.mk -include $(PRJ_PATH)/make/target.mk - -all: dep obj \ No newline at end of file diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/Makefile deleted file mode 100755 index a4bac32fe..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -LOC_DIR=src/sal/sd/linux/uk_interface -LIB=SAL - -include $(PRJ_PATH)/make/config.mk - -SRC_LIST= - -ifeq (TRUE, $(UK_IF)) -ifeq (KSLIB, $(MODULE_TYPE)) - ifeq (TRUE, $(UK_NETLINK)) - SRC_LIST=sw_api_ks_netlink.c - endif - - ifeq (TRUE, $(UK_IOCTL)) - SRC_LIST=sw_api_ks_ioctl.c - endif -endif - -ifeq (USLIB, $(MODULE_TYPE)) - ifeq (TRUE, $(UK_NETLINK)) - SRC_LIST=sw_api_us_netlink.c - endif - - ifeq (TRUE, $(UK_IOCTL)) - SRC_LIST=sw_api_us_ioctl.c - endif -endif -endif - -include $(PRJ_PATH)/make/components.mk -include $(PRJ_PATH)/make/defs.mk -include $(PRJ_PATH)/make/target.mk - -all: dep obj \ No newline at end of file diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/sw_api_us_ioctl.c b/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/sw_api_us_ioctl.c deleted file mode 100755 index 6e977726f..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/sw_api_us_ioctl.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2014, 2017-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "sw.h" -#include "sw_api.h" -#include "sw_api_us.h" - -#define MISC_CHR_DEV 10 -static int glb_socket_fd = 0; - -sw_error_t -sw_uk_if(unsigned long arg_val[SW_MAX_API_PARAM]) -{ - ioctl(glb_socket_fd, SIOCDEVPRIVATE, arg_val); - return SW_OK; -} - -#ifndef SHELL_DEV -#define SHELL_DEV "/dev/switch_ssdk" -#endif -#define MISC_DEV "/proc/misc" - -static int sw_device_minor_get(a_uint32_t *device_minor) -{ - char buf[200] = {0}; - FILE *fp; - char *p; - - fp = fopen(MISC_DEV, "r"); - if (!fp) { - printf("failed to open %s\n", MISC_DEV); - return -1; - } - fseek(fp, 0, SEEK_SET); - while (fgets(buf, 200, fp) != NULL) { - p = strstr(buf, "switch_ssdk"); - if (p) { - sscanf(buf,"%d",device_minor); - fclose(fp); - return 0; - } - } - - fclose(fp); - return -1; -} - -static void sw_device_check(void) -{ - struct stat buf; - a_uint32_t file_minor; - a_uint32_t device_minor; - int rv; - - memset(&buf, 0, sizeof(buf)); - - if (stat( SHELL_DEV, &buf) < 0) { - printf("failed to stat!\n"); - return; - } - if (S_ISCHR(buf.st_mode)) { - file_minor = minor(buf.st_rdev); - rv = sw_device_minor_get(&device_minor); - if (!rv) { - if (device_minor != file_minor) - printf("device:%x file:%x mismatch!\n", - device_minor, file_minor); - else - printf("device:%x file:%x match!\n", - device_minor, file_minor); - } - } - -} - - -sw_error_t -sw_uk_init(a_uint32_t nl_prot) -{ - if (!glb_socket_fd) - { - /* even mknod fail we not quit, perhaps the device node exist already */ -#if defined UK_MINOR_DEV - mknod(SHELL_DEV, S_IFCHR, makedev(MISC_CHR_DEV, UK_MINOR_DEV)); -#else - mknod(SHELL_DEV, S_IFCHR, makedev(MISC_CHR_DEV, nl_prot)); -#endif - if ((glb_socket_fd = open(SHELL_DEV, O_RDWR)) < 0) - { - sw_device_check(); - return SW_INIT_ERROR; - } - } - - return SW_OK; -} - -sw_error_t -sw_uk_cleanup(void) -{ - close(glb_socket_fd); - glb_socket_fd = 0; -#if 0 - remove("/dev/switch_ssdk"); -#endif - return SW_OK; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/sw_api_us_netlink.c b/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/sw_api_us_netlink.c deleted file mode 100755 index d3a448000..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/linux/uk_interface/sw_api_us_netlink.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include "sw.h" -#include "sw_api.h" -#include "sw_api_us.h" - -#define SSDK_SOCK_SEND_TRY_NUM 1000 -#define SSDK_SOCK_RCV_TRY_NUM 1000 -#define SSDK_SOCK_FD_NUM 16 -typedef struct -{ - a_uint32_t ssdk_sock_pid; - a_int32_t ssdk_sock_fd; -} ssdk_sock_t; -ssdk_sock_t ssdk_sock[SSDK_SOCK_FD_NUM]; - -static a_uint32_t ssdk_sock_prot = 0; -static struct nlmsghdr *nl_hdr = NULL; -#if defined(API_LOCK) -static aos_lock_t ssdk_sock_lock; -#define SOCK_LOCKER_INIT aos_lock_init(&ssdk_sock_lock) -#define SOCK_LOCKER_LOCK aos_lock(&ssdk_sock_lock) -#define SOCK_LOCKER_UNLOCK aos_unlock(&ssdk_sock_lock) -#else -#define SOCK_LOCKER_INIT -#define SOCK_LOCKER_LOCK -#define SOCK_LOCKER_UNLOCK -#endif - -static ssdk_sock_t * -ssdk_sock_alloc(a_uint32_t pid) -{ - a_uint32_t i; - - for (i = 0; i < SSDK_SOCK_FD_NUM; i++) - { - if (!ssdk_sock[i].ssdk_sock_pid) - { - return &ssdk_sock[i]; - } - else - { - if (0 != kill(ssdk_sock[i].ssdk_sock_pid, 0)) - { - return &ssdk_sock[i]; - } - } - } - - return NULL; -} - -static ssdk_sock_t * -ssdk_sock_find(a_uint32_t pid) -{ - a_uint32_t i; - - for (i = 0; i < SSDK_SOCK_FD_NUM; i++) - { - if (ssdk_sock[i].ssdk_sock_pid == pid) - { - return &ssdk_sock[i]; - } - } - - return NULL; -} - -sw_error_t -sw_uk_if(a_uint32_t arg_val[SW_MAX_API_PARAM]) -{ - struct sockaddr_nl src_addr; - struct sockaddr_nl dest_addr; - struct msghdr msg; - struct iovec iov; - struct nlmsghdr *nlh; - ssdk_sock_t * sock; - a_int32_t sock_fd; - a_uint32_t curr_pid; - sw_error_t rv = SW_OK; - a_uint32_t i, j, flag; - - curr_pid = getpid(); - - SOCK_LOCKER_LOCK; - sock = ssdk_sock_find(curr_pid); - if (!sock) - { - sock = ssdk_sock_alloc(curr_pid); - if (!sock) - { - SW_OUT_ON_ERROR(SW_NO_RESOURCE); - } - - sock_fd = socket(PF_NETLINK, SOCK_RAW, ssdk_sock_prot); - aos_mem_set(&src_addr, 0, sizeof(src_addr)); - src_addr.nl_family = AF_NETLINK; - src_addr.nl_pid = curr_pid; - src_addr.nl_groups = 0; - bind(sock_fd, (struct sockaddr*)&src_addr, sizeof(src_addr)); - - sock->ssdk_sock_fd = sock_fd; - sock->ssdk_sock_pid = curr_pid; - } - else - { - sock_fd = sock->ssdk_sock_fd; - } - - aos_mem_set(&dest_addr, 0, sizeof(dest_addr)); - dest_addr.nl_family = AF_NETLINK; - dest_addr.nl_pid = 0; - dest_addr.nl_groups = 0; - - nlh = nl_hdr; - aos_mem_set(nlh, 0, NLMSG_SPACE(SW_MAX_PAYLOAD)); - nlh->nlmsg_len = NLMSG_SPACE(SW_MAX_PAYLOAD); - nlh->nlmsg_pid = curr_pid; - nlh->nlmsg_flags = 0; - aos_mem_copy(NLMSG_DATA(nlh), arg_val, SW_MAX_PAYLOAD); - - iov.iov_base = (void *)nlh; - iov.iov_len = nlh->nlmsg_len; - - aos_mem_set(&msg, 0, sizeof(msg)); - msg.msg_name = (void *)&dest_addr; - msg.msg_namelen = sizeof(dest_addr); - msg.msg_iov = &iov; - msg.msg_iovlen = 1; - - for (i = 0; i < SSDK_SOCK_SEND_TRY_NUM; i++) - { - if (0 < sendmsg(sock_fd, &msg, MSG_DONTWAIT)) - { - break; - } - } - - if (SSDK_SOCK_SEND_TRY_NUM <= i) - { - SW_OUT_ON_ERROR(SW_TIMEOUT); - } - - flag = 0; - aos_mem_set(nlh, 0, NLMSG_SPACE(SW_MAX_PAYLOAD)); - for (i = 0; i < SSDK_SOCK_RCV_TRY_NUM; i++) - { - for (j = 0; j < 1000; j++) - { - if (0 < recvmsg(sock_fd, &msg, MSG_DONTWAIT)) - { - flag = 1; - break; - } - } - - if (flag) - { - break; - } - else - { - aos_mdelay(10); - } - } - - if (SSDK_SOCK_RCV_TRY_NUM <= i) - { - SW_OUT_ON_ERROR(SW_TIMEOUT); - } - -out: - SOCK_LOCKER_UNLOCK; - return rv; -} - -sw_error_t -sw_uk_init(a_uint32_t nl_prot) -{ - if (!nl_hdr) - { - nl_hdr = (struct nlmsghdr *)aos_mem_alloc(NLMSG_SPACE(SW_MAX_PAYLOAD)); - } - - if (!nl_hdr) - { - return SW_NO_RESOURCE; - } - -#if defined UK_NL_PROT - ssdk_sock_prot = UK_NL_PROT; -#else - ssdk_sock_prot = nl_prot; -#endif - SOCK_LOCKER_INIT; - aos_mem_zero(ssdk_sock, sizeof(ssdk_sock_t) * SSDK_SOCK_FD_NUM); - return SW_OK; -} - -sw_error_t -sw_uk_cleanup(void) -{ - aos_mem_zero(ssdk_sock, sizeof(ssdk_sock_t) * SSDK_SOCK_FD_NUM); - - if (nl_hdr) - { - aos_mem_free(nl_hdr); - nl_hdr = NULL; - } - - return SW_OK; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/sd.c b/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/sd.c deleted file mode 100755 index 9b7037c95..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/sal/sd/sd.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -#include "sw.h" -#include "ssdk_init.h" -#include "sd.h" -#include "sw_api.h" -#if ((!defined(KERNEL_MODULE)) && defined(UK_IF)) -#include "sw_api_us.h" -#endif - -mdio_reg_set ssdk_mdio_set = NULL; -mdio_reg_get ssdk_mdio_get = NULL; -hdr_reg_set ssdk_hdr_reg_set = NULL; -hdr_reg_get ssdk_hdr_reg_get = NULL; -uniphy_reg_set ssdk_uniphy_reg_set = NULL; -uniphy_reg_get ssdk_uniphy_reg_get = NULL; -mii_reg_set ssdk_mii_reg_set = NULL; -mii_reg_get ssdk_mii_reg_get = NULL; - -sw_error_t -sd_reg_mdio_set(a_uint32_t dev_id, a_uint32_t phy, a_uint32_t reg, - a_uint16_t data) -{ - sw_error_t rv = SW_OK; - - if (NULL != ssdk_mdio_set) - { - rv = ssdk_mdio_set(dev_id, phy, reg, data); - } - else - { - return SW_NOT_SUPPORTED; - } - - return rv; -} - -sw_error_t -sd_reg_mdio_get(a_uint32_t dev_id, a_uint32_t phy, a_uint32_t reg, a_uint16_t * data) -{ - sw_error_t rv = SW_OK; - - if (NULL != ssdk_mdio_get) - { - rv = ssdk_mdio_get(dev_id, phy, reg, data); - } - else - { - return SW_NOT_SUPPORTED; - } - - return rv; -} - -sw_error_t -sd_reg_hdr_set(a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t * reg_data, a_uint32_t len) -{ - sw_error_t rv; - - if (NULL != ssdk_hdr_reg_set) - { - rv = ssdk_hdr_reg_set(dev_id, reg_addr, reg_data, len); - } - else - { - return SW_NOT_SUPPORTED; - } - - return rv; -} - -sw_error_t -sd_reg_hdr_get(a_uint32_t dev_id, a_uint32_t reg_addr, a_uint8_t * reg_data, a_uint32_t len) -{ - sw_error_t rv; - - if (NULL != ssdk_hdr_reg_get) - { - rv = ssdk_hdr_reg_get(dev_id, reg_addr, reg_data, len); - } - else - { - return SW_NOT_SUPPORTED; - } - - return rv; -} - -sw_error_t -sd_reg_uniphy_set(a_uint32_t dev_id, a_uint32_t index, a_uint32_t reg_addr, - a_uint8_t * reg_data, a_uint32_t len) -{ - sw_error_t rv; - - if (NULL != ssdk_uniphy_reg_set) - { - rv = ssdk_uniphy_reg_set(dev_id, index, reg_addr, reg_data, len); - } - else - { - return SW_NOT_SUPPORTED; - } - - return rv; -} - -sw_error_t -sd_reg_uniphy_get(a_uint32_t dev_id, a_uint32_t index, a_uint32_t reg_addr, - a_uint8_t * reg_data, a_uint32_t len) -{ - sw_error_t rv; - - if (NULL != ssdk_uniphy_reg_get) - { - rv = ssdk_uniphy_reg_get(dev_id, index, reg_addr, reg_data, len); - } - else - { - return SW_NOT_SUPPORTED; - } - - return rv; -} - -void -sd_reg_mii_set(a_uint32_t reg, a_uint32_t val) -{ - if (NULL != ssdk_mii_reg_set) - { - ssdk_mii_reg_set(reg, val); - } -} - -a_uint32_t -sd_reg_mii_get(a_uint32_t reg) -{ - a_uint32_t value = 0; - - if (NULL != ssdk_mii_reg_get) - { - value = ssdk_mii_reg_get(reg); - } - - return value; -} - -sw_error_t -sd_init(a_uint32_t dev_id, ssdk_init_cfg * cfg) -{ - if (NULL != cfg->reg_func.mdio_set) - { - ssdk_mdio_set = cfg->reg_func.mdio_set; - } - - if (NULL != cfg->reg_func.mdio_get) - { - ssdk_mdio_get = cfg->reg_func.mdio_get; - } - - if (NULL != cfg->reg_func.header_reg_set) - { - ssdk_hdr_reg_set = cfg->reg_func.header_reg_set; - } - - if (NULL != cfg->reg_func.header_reg_get) - { - ssdk_hdr_reg_get = cfg->reg_func.header_reg_get; - } - if (NULL != cfg->reg_func.uniphy_reg_set) - { - ssdk_uniphy_reg_set = cfg->reg_func.uniphy_reg_set; - } - - if (NULL != cfg->reg_func.uniphy_reg_get) - { - ssdk_uniphy_reg_get = cfg->reg_func.uniphy_reg_get; - } - - if (NULL != cfg->reg_func.mii_reg_set) - { - ssdk_mii_reg_set = cfg->reg_func.mii_reg_set; - } - - if (NULL != cfg->reg_func.mii_reg_get) - { - ssdk_mii_reg_get = cfg->reg_func.mii_reg_get; - } - - return SW_OK; -} - diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/shell/Makefile b/feeds/ipq807x/qca-ssdk-shell/src/src/shell/Makefile deleted file mode 100755 index 668a48a4a..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/shell/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -LOC_DIR=src/shell -LIB=SHELL - -include $(PRJ_PATH)/make/config.mk -include $(PRJ_PATH)/make/components.mk - -SRC_LIST=$(wildcard *.c) -ifeq (,$(findstring SHELL, $(COMPONENTS))) -all: dep obj -else -all: dep obj lib -endif - -include $(PRJ_PATH)/make/defs.mk -include $(PRJ_PATH)/make/target.mk - -ifeq (TRUE, $(API_LOCK)) - PT_LIB=-lpthread -else - PT_LIB= -endif - -lib: - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJ_FILE) $(BIN_DIR)/$(US_MOD)_$(RUNMODE).a -o $(DST_DIR)/$(SHELLOBJ) $(PT_LIB) diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/shell/shell.c b/feeds/ipq807x/qca-ssdk-shell/src/src/shell/shell.c deleted file mode 100755 index fe583ba0c..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/shell/shell.c +++ /dev/null @@ -1,858 +0,0 @@ -/* - * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/*qca808x_start*/ -#include -#include -#include -#include "shell.h" -#include "shell_io.h" -#include "shell_sw.h" -#include "shell_lib.h" -#include "shell_config.h" -#include "api_access.h" -#include "fal_uk_if.h" - -a_ulong_t *ioctl_buf = NULL; -ssdk_init_cfg init_cfg = def_init_cfg; -ssdk_cfg_t ssdk_cfg; -static a_uint32_t flag = 0; - -static a_ulong_t *ioctl_argp; -static FILE * out_fd; -char dev_id_path[] = "/sys/ssdk/dev_id"; -#ifndef SSDK_STR -#define SSDK_STR "SSDK" -#endif -static char *err_info[] = -{ - "Operation succeeded", /*SW_OK*/ - "Operation failed", /*SW_FAIL*/ - "Illegal value ", /*SW_BAD_VALUE*/ - "Value is out of range ", /*SW_OUT_OF_RANGE*/ - "Illegal parameter(s) ", /*SW_BAD_PARAM*/ - "Illegal pointer value ", /*SW_BAD_PTR*/ - "Wrong length", /*SW_BAD_LEN*/ - "Wrong state of state machine ", /*SW_BAD_STATE*/ - "Read operation failed ", /*SW_READ_ERROR*/ - "Write operation failed ", /*SW_WRITE_ERROR*/ - "Fail in creating an entry ", /*SW_CREATE_ERROR*/ - "Fail in deleteing an entry ", /*SW_DELETE_ERROR*/ - "Entry not found ", /*SW_NOT_FOUND*/ - "The parameter(s) is the same ", /*SW_NO_CHANGE*/ - "No more entry found ", /*SW_NO_MORE*/ - "No such entry ", /*SW_NO_SUCH*/ - "Tried to create existing entry ", /*SW_ALREADY_EXIST*/ - "Table is full ", /*SW_FULL*/ - "Table is empty ", /*SW_EMPTY*/ - "This request is not support ", /*SW_NOT_SUPPORTED*/ - "This request is not implemented", /*SW_NOT_IMPLEMENTED*/ - "The item is not initialized ", /*SW_NOT_INITIALIZED*/ - "Operation is still running", /*SW_BUSY*/ - "Operation Time Out ", /*SW_TIMEOUT*/ - "Operation is disabled ", /*SW_DISABLE*/ - "Resource not available (memory ...)", /*SW_NO_RESOURCE*/ - "Error occured while INIT process", /*SW_INIT_ERROR*/ - "The other side is not ready yet", /*SW_NOT_READY */ - "Cpu memory allocation failed. ", /*SW_OUT_OF_MEM */ - "Operation has been aborted. ", /*SW_ABORTED*/ -} ; - -void -cmd_print_error(sw_error_t rtn) -{ - dprintf("\n%s\n\n", err_info[abs(rtn)]); -} - -void -cmd_print(char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - if(out_fd) - vfprintf(out_fd, fmt, args); - else - vfprintf(stdout, fmt, args); - va_end(args); -} - -static sw_error_t -cmd_input_parser(a_ulong_t *arg_val, a_uint32_t arg_index, sw_api_param_t *pp) -{ - a_int16_t i; - a_ulong_t *pbuf; - a_uint16_t rtn_size = 1; - sw_api_param_t *pptmp = pp; - - pbuf = ioctl_buf + rtn_size; /*reserve for return value */ - - for (i = 0; i < arg_index; i++) - { - pptmp = pp + i; - if (pptmp->param_type & SW_PARAM_PTR) - { - pbuf += (pptmp->data_size + 3) / 4; - } - } - if ((pbuf - ioctl_buf + (pptmp->data_size + 3) / 4) > (IOCTL_BUF_SIZE/4)) - { - return SW_NO_RESOURCE; - } - - *arg_val = (a_ulong_t) pbuf; - - return SW_OK; -} - -static sw_error_t -cmd_api_func(sw_api_func_t *fp, a_uint32_t nr_param, a_ulong_t * args) -{ - a_ulong_t *p = &args[2]; - sw_error_t rv; - sw_error_t(*func) (); - - func = fp->func; - - switch (nr_param) - { - case 0: - rv = (func) (); - break; - case 1: - rv = (func) (p[0]); - break; - case 2: - rv = (func) (p[0], p[1]); - break; - case 3: - rv = (func) (p[0], p[1], p[2]); - break; - case 4: - rv = (func) (p[0], p[1], p[2], p[3]); - break; - case 5: - rv = (func) (p[0], p[1], p[2], p[3], p[4]); - break; - case 6: - rv = (func) (p[0], p[1], p[2], p[3], p[4], p[5]); - break; - case 7: - rv = (func) (p[0], p[1], p[2], p[3], p[4], p[5], p[6]); - break; - case 8: - rv = (func) (p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); - break; - case 9: - rv = (func) (p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]); - break; - case 10: - rv = (func) (p[0], p[1], p[2], p[3], p[4], p[5], - p[6], p[7], p[8], p[9]); - break; - default: - rv = SW_OUT_OF_RANGE; - } - - *(a_ulong_t *) args[1] = rv; - - return rv; -} - -static sw_error_t -cmd_api_output(sw_api_param_t *pp, a_uint32_t nr_param, a_ulong_t * args) -{ - a_uint16_t i; - a_ulong_t *pbuf; - a_uint16_t rtn_size = 1; - sw_error_t rtn = (sw_error_t) (*ioctl_buf); - sw_api_param_t *pptmp = NULL; - - if (rtn != SW_OK) - { - cmd_print_error(rtn); - return rtn; - } - - pbuf = ioctl_buf + rtn_size; - for (i = 0; i < nr_param; i++) - { - pptmp = pp + i; - if (pptmp->param_type & SW_PARAM_PTR) - { - - if (pptmp->param_type & SW_PARAM_OUT) - { - - sw_data_type_t *data_type; - if (!(data_type = cmd_data_type_find(pptmp->data_type))) - return SW_NO_SUCH; - - if (data_type->show_func) - { - data_type->show_func(pptmp->param_name, pbuf, pptmp->data_size); -/*qca808x_end*/ - if(strcmp((a_char_t *)pptmp->param_name, "Function bitmap") == 0) - { - cmd_data_print_module_func_ctrl(args[3], (fal_func_ctrl_t *)pbuf); - } -/*qca808x_start*/ - } - else - { - dprintf("\n Error, not define output print function!"); - } - } - - if ((pbuf - ioctl_buf + - (pptmp->data_size + 3) / 4) > (IOCTL_BUF_SIZE/4)) - return SW_NO_RESOURCE; - - pbuf += (pptmp->data_size + 3) / 4; - - } - } - return SW_OK; -} - -void -cmd_strtol(char *str, a_uint32_t * arg_val) -{ - if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) - sscanf(str, "%x", arg_val); - else - sscanf(str, "%d", arg_val); -} - -static sw_error_t -cmd_parse_api(char **cmd_str, a_ulong_t * arg_val) -{ - char *tmp_str; - a_uint32_t arg_index, arg_start = 2, reserve_index = 1; /*reserve for dev_id */ - a_uint32_t last_param_in = 0; - a_ulong_t *temp; - void *pentry; - sw_api_param_t *pptmp = NULL; - sw_api_t sw_api; - a_uint32_t ignorecnt = 0, jump = 0; - sw_api.api_id = arg_val[0]; - SW_RTN_ON_ERROR(sw_api_get(&sw_api)); - - /*set device id */ - arg_val[arg_start] = get_devid(); - - for (arg_index = reserve_index; arg_index < sw_api.api_nr; arg_index++) - { - tmp_str = NULL; - pptmp = sw_api.api_pp + arg_index; - - if (!(pptmp->param_type & SW_PARAM_IN)) - { - ignorecnt++; - } - - if (pptmp->param_type & SW_PARAM_IN) - { - tmp_str = cmd_str[arg_index - reserve_index - ignorecnt + jump]; - last_param_in = arg_index; - if((pptmp->api_id == 314) && last_param_in == 2) last_param_in = 4;//SW_API_FDB_EXTEND_NEXT wr - if((pptmp->api_id == 327) && last_param_in == 2) last_param_in = 4;//SW_API_FDB_EXTEND_FIRST wr - } - temp = &arg_val[arg_start + arg_index]; - - sw_data_type_t *data_type; - if (!(data_type = cmd_data_type_find(pptmp->data_type))) - return SW_NO_SUCH; - - pentry = temp; - if (pptmp->param_type & SW_PARAM_PTR) - { - if (cmd_input_parser(temp, arg_index, sw_api.api_pp) != SW_OK) - return SW_NO_RESOURCE; - - pentry = (void *) *temp; - } - - if (pptmp->param_type & SW_PARAM_IN) - { -#if 1 - if(pptmp->param_type & SW_PARAM_PTR) //quiet mode - { - if(!get_talk_mode()) - set_full_cmdstrp((char **)(cmd_str + (last_param_in - reserve_index) + jump)); - } -#endif - /*check and convert input param */ - if (data_type->param_check != NULL) - { - if (data_type->param_check(tmp_str, pentry, pptmp->data_size) != SW_OK) - return SW_BAD_PARAM; - if(!get_talk_mode() && (pptmp->param_type & SW_PARAM_PTR)) { - if (get_jump()) - jump += get_jump() -1; - } - - } - } - } - - /*superfluous args */ - /* - if(cmd_str[last_param_in] != NULL) - return SW_BAD_PARAM; - */ - - return SW_OK; -} - -static sw_error_t -cmd_parse_sw(char **cmd_str, a_ulong_t * arg_val) -{ - char *tmp_str; - a_uint32_t arg_index = 0, tmp = 0; - a_uint32_t api_id = arg_val[0]; - - tmp_str = cmd_str[arg_index]; - while (tmp_str) - { - arg_index++; - cmd_strtol(tmp_str, &tmp); - arg_val[arg_index] = tmp; - tmp_str = cmd_str[arg_index]; - } - - /*args number check */ - if ( (arg_index == 0 && ( api_id == SW_CMD_VLAN_SHOW || - api_id == SW_CMD_FDB_SHOW || - api_id == SW_CMD_RESV_FDB_SHOW || - api_id == SW_CMD_HOST_SHOW || - api_id == SW_CMD_HOST_IPV4_SHOW || - api_id == SW_CMD_HOST_IPV6_SHOW || - api_id == SW_CMD_HOST_IPV4M_SHOW || - api_id == SW_CMD_HOST_IPV6M_SHOW || - api_id == SW_CMD_FLOW_IPV43T_SHOW || - api_id == SW_CMD_FLOW_IPV63T_SHOW || - api_id == SW_CMD_FLOW_IPV45T_SHOW || - api_id == SW_CMD_FLOW_IPV65T_SHOW || - api_id == SW_CMD_NAT_SHOW || - api_id == SW_CMD_NAPT_SHOW || - api_id == SW_CMD_FLOW_SHOW || - api_id == SW_CMD_CTRLPKT_SHOW || - api_id == SW_CMD_INTFMAC_SHOW || - api_id == SW_CMD_PUBADDR_SHOW )) || - ( arg_index == 1 && api_id == SW_CMD_SET_DEVID) || - ( arg_index == 2 && api_id == SW_CMD_PT_VLAN_TRANS_ADV_SHOW) ) - return SW_OK; - - return SW_BAD_PARAM; -} - -/*user command api*/ -sw_error_t -cmd_exec_api(a_ulong_t *arg_val) -{ - sw_error_t rv; - sw_api_t sw_api; - - sw_api.api_id = arg_val[0]; - SW_RTN_ON_ERROR(sw_api_get(&sw_api)); - - /*save cmd return value */ - arg_val[1] = (a_ulong_t) ioctl_buf; - /*save set device id */ - arg_val[2] = get_devid(); - - rv = cmd_api_func(sw_api.api_fp, sw_api.api_nr, arg_val); - SW_RTN_ON_ERROR(rv); - - rv = cmd_api_output(sw_api.api_pp, sw_api.api_nr, arg_val); - SW_RTN_ON_ERROR(rv); - - return rv; -} - - -void -cmd_print_usage (int cmd_index, int cmd_index_sub) -{ - if(GCMD_NAME(cmd_index)) - dprintf("usage: %s", GCMD_NAME(cmd_index)); - - if (GCMD_SUB_NAME(cmd_index, cmd_index_sub)) - dprintf(" %s", GCMD_SUB_NAME(cmd_index, cmd_index_sub)); - - if(GCMD_SUB_ACT(cmd_index, cmd_index_sub) && GCMD_SUB_USAGE(cmd_index, cmd_index_sub)) - dprintf(" %s %s\n\n", GCMD_SUB_ACT(cmd_index, cmd_index_sub), - GCMD_SUB_USAGE(cmd_index, cmd_index_sub)); -} -/* - main function - input args: - arg_val[0] = cmd_num - arg_val[1] = rtn_code - arg_val[2] = dev_id - arg_val[3] = dbg_cmd_num or other -*/ - -/*command string lookup*/ -a_uint32_t -cmd_lookup(char **cmd_str, int *cmd_index, int *cmd_index_sub) -{ - a_uint32_t no, sub_no; - a_uint32_t cmd_deepth = 0; - - *cmd_index = GCMD_DESC_NO_MATCH; - *cmd_index_sub = GCMD_DESC_NO_MATCH; - - if (cmd_str[0] == NULL) - return cmd_deepth; - - for (no = 0; GCMD_DESC_VALID(no); no++) - { - if (strcasecmp(cmd_str[0], GCMD_NAME(no))) - continue; - - for (sub_no = 0; GCMD_SUB_DESC_VALID(no, sub_no); sub_no++) - { - if (cmd_str[1] != NULL && cmd_str[2] != NULL) - { - - if (GCMD_SUB_NAME(no, sub_no) && GCMD_SUB_ACT(no, sub_no) - && !strcasecmp(cmd_str[1], GCMD_SUB_NAME(no, sub_no)) - && !strcasecmp(cmd_str[2], GCMD_SUB_ACT(no, sub_no))) - { - *cmd_index = no; - *cmd_index_sub = sub_no; - cmd_deepth = 3; - return cmd_deepth; - } - - else if (!GCMD_SUB_NAME(no, sub_no) && GCMD_SUB_ACT(no, sub_no) - && !strcasecmp(cmd_str[1], GCMD_SUB_ACT(no, sub_no))) - { - *cmd_index = no; - *cmd_index_sub = sub_no; - cmd_deepth = 2; - return cmd_deepth; - } - } - else if (cmd_str[1] != NULL && cmd_str[2] == NULL) - { - - if (!GCMD_SUB_NAME(no, sub_no) && GCMD_SUB_ACT(no, sub_no) - && !strcasecmp(cmd_str[1], GCMD_SUB_ACT(no, sub_no))) - { - *cmd_index = no; - *cmd_index_sub = sub_no; - cmd_deepth = 2; - return cmd_deepth; - } - } - } - } - - return cmd_deepth; -} - -static a_ulong_t * -cmd_parse(char *cmd_str, int *cmd_index, int *cmd_index_sub) -{ - int cmd_nr = 0; - a_ulong_t *arg_val = ioctl_argp; - char *tmp_str[CMDSTR_ARGS_MAX], *str_save; - - if (cmd_str == NULL) - return NULL; - - memset(arg_val, 0, CMDSTR_ARGS_MAX * sizeof (a_ulong_t)); - - /* split string into array */ - if ((tmp_str[cmd_nr] = (void *) strtok_r(cmd_str, " ", &str_save)) == NULL) - return NULL; - - /*handle help */ - if (!strcasecmp(tmp_str[cmd_nr], "help")) - { - dprintf("input ? get help\n\n"); - return NULL; - } - - while (tmp_str[cmd_nr]) - { - if (++cmd_nr == 3) - break; - tmp_str[cmd_nr] = (void *) strtok_r(NULL, " ", &str_save); - } - - /*commond string lookup */ - int cmd_depth = cmd_lookup(tmp_str, cmd_index, cmd_index_sub); - - if (*cmd_index == GCMD_DESC_NO_MATCH || *cmd_index_sub == GCMD_DESC_NO_MATCH) - { - dprintf("invalid or incomplete command.\n\n"); - return NULL; - } - - /*parse param */ - cmd_nr = 0; - if (cmd_depth == 2) - { - tmp_str[cmd_nr] = tmp_str[2]; - cmd_nr++; - } - - tmp_str[cmd_nr] = (void *) strtok_r(NULL, " ", &str_save); - while (tmp_str[cmd_nr]) - { - if (++cmd_nr == CMDSTR_ARGS_MAX) - break; - tmp_str[cmd_nr] = (void *) strtok_r(NULL, " ", &str_save); - } - - arg_val[0] = GCMD_SUB_API(*cmd_index, *cmd_index_sub); - arg_val[1] = (a_ulong_t) ioctl_buf; - - int rtn_code; - if (arg_val[0] < SW_API_MAX) - { - /*api command parse */ - rtn_code = cmd_parse_api(tmp_str, arg_val); - - } - else if (arg_val[0] > SW_API_MAX) - { - /*user command parse */ - rtn_code = cmd_parse_sw(tmp_str, arg_val); - - } - else - { - rtn_code = SW_BAD_PARAM; - } - - if(rtn_code != SW_OK) - { - cmd_print_error(rtn_code); - - if(rtn_code == SW_BAD_PARAM) - cmd_print_usage(*cmd_index, *cmd_index_sub); - - return NULL; - } - - return arg_val; -} - -static int -cmd_exec(a_ulong_t *arg_val, int cmd_index, int cmd_index_sub) -{ - a_uint32_t api_id = arg_val[0]; - sw_error_t rtn = SW_OK; - - if( api_id < SW_API_MAX ) - { - rtn = cmd_exec_api(arg_val); - - } - else if ((api_id > SW_API_MAX ) && (api_id < SW_CMD_MAX)) - { - if (GCMD_SUB_FUNC(cmd_index, cmd_index_sub)) - rtn = GCMD_SUB_FUNC(cmd_index, cmd_index_sub)(arg_val); - } - else - { - rtn = SW_BAD_PARAM; - } - - if(rtn != SW_OK) - cmd_print_error(rtn); - else - dprintf("\noperation done.\n\n"); - - return 0; -} - -static sw_error_t -cmd_socket_init(int dev_id) -{ - sw_error_t rv; - - init_cfg.cpu_mode = HSL_CPU_1; - init_cfg.reg_mode = HSL_MDIO; -#if defined UK_MINOR_DEV - init_cfg.nl_prot = UK_MINOR_DEV; -#else - init_cfg.nl_prot = 30; -#endif - init_cfg.chip_type=CHIP_UNSPECIFIED; -/*qca808x_end*/ - init_cfg.reg_func.mdio_set = NULL; - init_cfg.reg_func.mdio_get = NULL; -/*qca808x_start*/ - rv = ssdk_init(dev_id, &init_cfg); - if (SW_OK == rv) - { - dprintf("\n %s Init OK!", SSDK_STR); - } - else - { - dprintf("\n %s Init Fail! RV[%d]", SSDK_STR, rv); - } - - if (flag == 0) - { - aos_mem_set(&ssdk_cfg, 0 ,sizeof(ssdk_cfg_t)); - rv = sw_uk_exec(SW_API_SSDK_CFG, dev_id, &ssdk_cfg); - flag = 1; - } - return rv; -} - -static sw_error_t -cmd_init(void) -{ - ioctl_buf = (a_ulong_t *) malloc(IOCTL_BUF_SIZE); - ioctl_argp = (a_ulong_t *) malloc(CMDSTR_ARGS_MAX * sizeof (a_ulong_t)); - FILE *dev_id_fd = NULL; - int dev_id_value = 0; - if((dev_id_fd = fopen(dev_id_path, "r")) != NULL) - { - fscanf(dev_id_fd, "%d", &dev_id_value); - } - - set_devid(dev_id_value); - cmd_socket_init(dev_id_value); - - return SW_OK; -} - -static sw_error_t -cmd_exit(void) -{ - free(ioctl_buf); - free(ioctl_argp); - ssdk_cleanup(); - flag = 0; - return SW_OK; -} - -static sw_error_t -cmd_run_one(char *cmd_str) -{ - a_ulong_t *arg_list; - int cmd_index = 0, cmd_index_sub = 0; - - if ((arg_list = cmd_parse(cmd_str, &cmd_index, &cmd_index_sub)) != NULL) - { - cmd_exec(arg_list, cmd_index, cmd_index_sub); - } - - return SW_OK; -} - -int -cmd_is_batch(const char *cmd_str) -{ - char batch_cmd[] = "run"; - - if(!strncmp(cmd_str, batch_cmd, strlen(batch_cmd))) - return 1; - return 0; -} - -static void -cmd_batch_help(void) -{ - dprintf("usage:run \n"); -} - -static sw_error_t -cmd_run_batch (char *cmd_str) -{ - FILE *in_fd = NULL; - char * line = NULL, *str_save; - char *tmp_str[3]; - - if (cmd_str == NULL) - return SW_BAD_PARAM; - - /*usage: run cmd result*/ - if((tmp_str[0] = (void *) strtok_r(cmd_str, " ", &str_save)) == NULL) - return SW_BAD_PARAM; - - /*check again*/ - if(!cmd_is_batch(tmp_str[0])) - return SW_BAD_PARAM; - - if((tmp_str[1] = (void *) strtok_r(NULL, " ", &str_save))== NULL) - return SW_BAD_PARAM; - if((tmp_str[2] = (void *) strtok_r(NULL, " ", &str_save))== NULL) - return SW_BAD_PARAM; - - if((in_fd = fopen(tmp_str[1], "r")) == NULL) - { - dprintf("can't open cmd file %s\n", tmp_str[1]); - return SW_FAIL; - } - if((out_fd = fopen(tmp_str[2], "w+")) == NULL) - { - dprintf("can't open result file %s\n", tmp_str[2]); - return SW_FAIL; - } - - size_t len = 0; - ssize_t read; - - set_talk_mode(0); - while ((read = getline(&line, &len, in_fd)) != -1) - { - //dprintf("(%d)%s",read, line); - if (read <= 1 ) - { - continue; - } - - if (line[strlen(line)-1] == '\n') - { - line[strlen(line)-1] = '\0'; - } - - if (!strncmp(line, "echo", 4)) - { - dprintf("%s\n", line+strlen("echo ")); - continue; - } - else - { - dprintf("%s\n", line); - } - cmd_run_one(line); - } - set_talk_mode(1); - - if (line) free(line); - - fclose(out_fd); - fclose(in_fd); - out_fd = 0; - in_fd =0; - - return SW_OK; - -} - -static sw_error_t -cmd_args(char *cmd_str, int argc, const char *argv[]) -{ - /*quiet mode*/ - set_talk_mode(0); - - if(cmd_is_batch(argv[1])) - { - if(argc != 4) - { - cmd_batch_help(); - return SW_FAIL; - } - - snprintf(cmd_str, CMDSTR_BUF_SIZE, "%s %s %s", argv[1], argv[2], argv[3]); - cmd_run_batch(cmd_str); - - } - else - { - int argi; - for(argi = 1; argi < argc; argi++) - { - strlcat(cmd_str, argv[argi], CMDSTR_BUF_SIZE); - strlcat(cmd_str, " ", CMDSTR_BUF_SIZE); - } - cmd_run_one(cmd_str); - } - - return SW_OK; -} - -int -cmd_is_exit(char *cmd_str) -{ - if ((!strcasecmp(cmd_str, "q")) || (!strcasecmp(cmd_str, "quit"))) - { - return 1; - } - return 0; -} - -void cmd_welcome() -{ - char *ver = "", *date = ""; -#ifdef VERSION - ver = VERSION; -#endif - -#ifdef BUILD_DATE - date = BUILD_DATE; -#endif - dprintf("\n Welcome to %s Shell version: %s, at %s.\n", SSDK_STR, ver, date); -} - -/* Dummy function to avoid linker complaints */ -void __aeabi_unwind_cpp_pr0(void) -{ -}; -void __aeabi_unwind_cpp_pr1(void) -{ -}; - -int -main(int argc, const char *argv[]) -{ - char cmd_str[CMDSTR_BUF_SIZE]; - cmd_init(); - - if(argc > 1) - { - memset(cmd_str, 0, sizeof(cmd_str)); - cmd_args(cmd_str, argc, argv); - cmd_exit(); - return 0; - } - - cmd_welcome(); - - /*main loop*/ - while (1) - { - memset(cmd_str, 0, sizeof(cmd_str)); - - if(next_cmd(cmd_str) == 0)/*loop through if '\n'*/ - continue; - - if (cmd_is_exit(cmd_str)) - break; - - if(cmd_is_batch(cmd_str)) - { - if(cmd_run_batch(cmd_str)!= SW_OK) - cmd_batch_help(); - } - else - { - cmd_run_one(cmd_str); - } - } - - cmd_exit(); - return 0; -} -/*qca808x_end*/ diff --git a/feeds/ipq807x/qca-ssdk-shell/src/src/shell/shell_config.c b/feeds/ipq807x/qca-ssdk-shell/src/src/shell/shell_config.c deleted file mode 100755 index e123f9b4a..000000000 --- a/feeds/ipq807x/qca-ssdk-shell/src/src/shell/shell_config.c +++ /dev/null @@ -1,1451 +0,0 @@ -/* - * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/*qca808x_start*/ -#include "shell_config.h" -#include "shell_sw.h" - - -/*cmdline tree descript*/ -struct cmd_des_t gcmd_des[] = -{ - /*port ctrl*/ -/*qca808x_end*/ -#ifdef IN_PORTCONTROL -/*qca808x_start*/ - { - "port", "config port control", - { - {"duplex", "get", "get duplex mode of a port", "" , SW_API_PT_DUPLEX_GET, - NULL}, - {"duplex", "set", "set duplex mode of a port", " ", - SW_API_PT_DUPLEX_SET, NULL}, - {"speed", "get", "get speed mode of a port", "", SW_API_PT_SPEED_GET, - NULL}, - {"speed", "set", "set speed mode of a port", - " <10|100|1000|2500|5000|10000>", SW_API_PT_SPEED_SET, NULL}, - {"autoAdv", "get", "get auto-negotiation advertisement of a port", "", - SW_API_PT_AN_ADV_GET, NULL}, - {"autoAdv", "set", "set auto-negotiation advertisement of a port", - " ", SW_API_PT_AN_ADV_SET, NULL}, - {"autoNeg", "get", "get auto-negotiation status of a port", "", - SW_API_PT_AN_GET, NULL}, - {"autoNeg", "enable", "enable auto-negotiation of a port", "", - SW_API_PT_AN_ENABLE, NULL}, - {"autoNeg", "restart", "restart auto-negotiation process of a port", "", - SW_API_PT_AN_RESTART, NULL}, -/*qca808x_end*/ - {"header", "set", "set atheros header/tag status of a port", - " ", SW_API_PT_HDR_SET, NULL}, - {"header", "get", "get atheros header/tag status of a port", "", - SW_API_PT_HDR_GET, NULL}, - {"txhdr", "set", "set tx frame atheros header/tag status of a port", - " ", SW_API_PT_TXHDR_SET, NULL}, - {"txhdr", "get", "get tx frame atheros header/tag status of a port", "", - SW_API_PT_TXHDR_GET, NULL}, - {"rxhdr", "set", "set rx frame atheros header/tag status of a port", - " ", SW_API_PT_RXHDR_SET, NULL}, - {"rxhdr", "get", "get rx frame atheros header/tag status of a port", "", - SW_API_PT_RXHDR_GET, NULL}, - {"hdrtype", "set", "set atheros header/tag type", - " ", SW_API_HEADER_TYPE_SET, NULL}, - {"hdrtype", "get", "get atheros header/tag type", "", - SW_API_HEADER_TYPE_GET, NULL}, - {"flowCtrl", "set", "set flow control status of a port", - " ", SW_API_PT_FLOWCTRL_SET, NULL}, - {"flowCtrl", "get", "get flow control status of a port", "", - SW_API_PT_FLOWCTRL_GET, NULL}, - {"flowCtrlforcemode", "set", "set flow control force mode of a port", - " ", SW_API_PT_FLOWCTRL_MODE_SET, NULL}, - {"flowCtrlforcemode", "get", "get flow control force mode of a port", - "", SW_API_PT_FLOWCTRL_MODE_GET, NULL}, - {"powersave", "set", "set powersave status of a port", - " ", SW_API_PT_POWERSAVE_SET, NULL}, - {"powersave", "get", "get powersave status of a port", "", - SW_API_PT_POWERSAVE_GET, NULL}, -/*qca808x_start*/ - {"hibernate", "set", "set hibernate status of a port", - " ", SW_API_PT_HIBERNATE_SET, NULL}, - {"hibernate", "get", "get hibernate status of a port", "", - SW_API_PT_HIBERNATE_GET, NULL}, - {"cdt", "run", "run cable diagnostic test of a port", - " ", SW_API_PT_CDT, NULL}, -/*qca808x_end*/ - {"txmacstatus", "set", "set txmac status of a port", - " ", SW_API_TXMAC_STATUS_SET, NULL}, - {"txmacstatus", "get", "get txmac status of a port", "", - SW_API_TXMAC_STATUS_GET, NULL}, - {"rxmacstatus", "set", "set rxmac status of a port", " ", - SW_API_RXMAC_STATUS_SET, NULL}, - {"rxmacstatus", "get", "get rxmac status of a port", "", - SW_API_RXMAC_STATUS_GET, NULL}, - {"txfcstatus", "set", "set tx flow control status of a port", - " ", SW_API_TXFC_STATUS_SET, NULL}, - {"txfcstatus", "get", "get tx flow control status of a port", "", - SW_API_TXFC_STATUS_GET, NULL}, - {"rxfcstatus", "set", "set rx flow control status of a port", - " ", SW_API_RXFC_STATUS_SET, NULL}, - {"rxfcstatus", "get", "get rx flow control status of a port", "", - SW_API_RXFC_STATUS_GET, NULL}, - {"bpstatus", "set", "set back pressure status of a port", - " ", SW_API_BP_STATUS_SET, NULL}, - {"bpstatus", "get", "get back pressure status of a port", "", - SW_API_BP_STATUS_GET, NULL}, - {"linkforcemode", "set", "set link force mode of a port", - " ", SW_API_PT_LINK_MODE_SET, NULL}, - {"linkforcemode", "get", "get link force mode of a port", "", - SW_API_PT_LINK_MODE_GET, NULL}, -/*qca808x_start*/ - {"linkstatus", "get", "get link status of a port", "", - SW_API_PT_LINK_STATUS_GET, NULL}, -/*qca808x_end*/ - {"macLoopback", "set", "set mac level loop back mode of port", - " ", SW_API_PT_MAC_LOOPBACK_SET, NULL}, - {"macLoopback", "get", "get mac level loop back mode of port", "", - SW_API_PT_MAC_LOOPBACK_GET, NULL}, - {"ptslinkstatus", "get", "get link status of all ports", "", - SW_API_PTS_LINK_STATUS_GET, NULL}, - {"congedrop", "set", "set congestion drop of port queue", - " ", SW_API_PT_CONGESTION_DROP_SET, - NULL}, - {"congedrop", "get", "get congestion drop of port queue", - " ", SW_API_PT_CONGESTION_DROP_GET, NULL}, - {"ringfcthres", "set", "set ring flow ctrl of ring", - " ", SW_API_PT_RING_FLOW_CTRL_THRES_SET, - NULL}, - {"ringfcthres", "get", "get ring flow ctrl of ring", "", - SW_API_PT_RING_FLOW_CTRL_THRES_GET, NULL}, -/*qca808x_start*/ - {"Ieee8023az", "set", "set 8023az status of a port", " ", - SW_API_PT_8023AZ_SET, NULL}, - {"Ieee8023az", "get", "get 8023az status of a port", "", - SW_API_PT_8023AZ_GET, NULL}, - {"crossover", "set", "set crossover mode of a port", " ", - SW_API_PT_MDIX_SET, NULL}, - {"crossover", "get", "get crossover mode of a port", "", - SW_API_PT_MDIX_GET, NULL}, - {"crossover", "status", "get current crossover status of a port", "", - SW_API_PT_MDIX_STATUS_GET, NULL}, -/*qca808x_end*/ - {"preferMedium", "set", "set prefer medium of a combo port", - " ", SW_API_PT_COMBO_PREFER_MEDIUM_SET, NULL}, - {"preferMedium", "get", "get prefer medium of a combo port", "", - SW_API_PT_COMBO_PREFER_MEDIUM_GET, NULL}, - {"mediumType", "get", "get current medium status of a combo port", "", - SW_API_PT_COMBO_MEDIUM_STATUS_GET, NULL}, - {"fiberMode", "set", "set fiber mode of a combo fiber port", - " <100fx|1000bx |10g_r>", SW_API_PT_COMBO_FIBER_MODE_SET, NULL}, - {"fiberMode", "get", "get fiber mode of a combo fiber port", "", - SW_API_PT_COMBO_FIBER_MODE_GET, NULL}, -/*qca808x_start*/ - {"localLoopback", "set", "set local loopback of a port", - " ", SW_API_PT_LOCAL_LOOPBACK_SET, NULL}, - {"localLoopback", "get", "get local loopback of a port", "", - SW_API_PT_LOCAL_LOOPBACK_GET, NULL}, - {"remoteLoopback", "set", "set remote loopback of a port", - " ", SW_API_PT_REMOTE_LOOPBACK_SET, NULL}, - {"remoteLoopback", "get", "get remote loopback of a port", "", - SW_API_PT_REMOTE_LOOPBACK_GET, NULL}, - {"reset", "set", "reset phy of a port", "", SW_API_PT_RESET, NULL}, - {"poweroff", "set", "power off phy of a port", "", - SW_API_PT_POWER_OFF, NULL}, - {"poweron", "set", "power on phy of a port", "", SW_API_PT_POWER_ON, NULL}, - {"magicFrameMac", "set", "set magic frame mac address of a port", - " ", SW_API_PT_MAGIC_FRAME_MAC_SET, NULL}, - {"magicFrameMac", "get", "get magic frame mac address of a port", "", - SW_API_PT_MAGIC_FRAME_MAC_GET, NULL}, - {"phyId", "get", "get phy id of a port", "", SW_API_PT_PHY_ID_GET, NULL}, - {"wolstatus", "set", "set wol status of a port", " ", - SW_API_PT_WOL_STATUS_SET, NULL}, - {"wolstatus", "get", "get wol status of a port", "", - SW_API_PT_WOL_STATUS_GET, NULL}, -/*qca808x_end*/ - {"interfaceMode", "set", "set interface mode of phy", " ",\ - SW_API_PT_INTERFACE_MODE_SET, NULL}, - {"interfaceMode", "get", "get interface mode of phy", "", - SW_API_PT_INTERFACE_MODE_GET, NULL}, - {"interfaceMode", "apply", "apply interface mode","", - SW_API_PT_INTERFACE_MODE_APPLY, NULL}, -/*qca808x_start*/ - {"interfaceMode", "status", "get current interface mode of phy", "", - SW_API_PT_INTERFACE_MODE_STATUS_GET, NULL}, -/*qca808x_end*/ - {"interface3az", "set", "set interface and phy 3az info", - " ", SW_API_PT_INTERFACE_3AZ_STATUS_SET, NULL}, - {"interface3az", "get", "get interface and phy 3az info", "", - SW_API_PT_INTERFACE_3AZ_STATUS_GET, NULL}, - {"promiscmode", "set", "set port promisc mode", " ", - SW_API_PT_PROMISC_MODE_SET, NULL}, - {"promiscmode", "get", "get port promisc mode", "", - SW_API_PT_PROMISC_MODE_GET, NULL}, - {"mtu", "set", "set port mtu value", "", SW_API_PT_MTU_SET, NULL}, - {"mtu", "get", "get port mtu value", "", SW_API_PT_MTU_GET, NULL}, - {"mru", "set", "set port mru value", "", SW_API_PT_MRU_SET, NULL}, - {"mru", "get", "get port mru value", "", SW_API_PT_MRU_GET, NULL}, - {"srcfilter", "set", "set port source filter bypass", " ", - SW_API_PT_SOURCE_FILTER_SET, NULL}, - {"srcfilter", "get", "get port source filter bypass", "", - SW_API_PT_SOURCE_FILTER_GET, NULL}, - {"frameMaxSize", "get", "get port frame max size", "", - SW_API_PT_FRAME_MAX_SIZE_GET}, - {"frameMaxSize", "set", "set port frame max size", " ", - SW_API_PT_FRAME_MAX_SIZE_SET}, - {"eeecfg", "set", "set interface eee info", "", - SW_API_PT_INTERFACE_EEE_CFG_SET, NULL}, - {"eeecfg", "get", "get interface eee info", "", - SW_API_PT_INTERFACE_EEE_CFG_GET, NULL}, - {"srcfiltercfg", "set", "set port source filter configure", "", - SW_API_PT_SOURCE_FILTER_CONFIG_SET, NULL}, - {"srcfiltercfg", "get", "get port source filter configure", "", - SW_API_PT_SOURCE_FILTER_CONFIG_GET, NULL}, - {"switchportloopback", "set", "set switch port loopback", "", - SW_API_PT_SWITCH_PORT_LOOPBACK_SET, NULL}, - {"switchportloopback", "get", "get switch port loopback", "", - SW_API_PT_SWITCH_PORT_LOOPBACK_GET, NULL}, -/*qca808x_start*/ - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL},/*end of desc*/ - }, - }, -/*qca808x_end*/ -#endif - - /*vlan*/ -#ifdef IN_VLAN - { - "vlan", "config VLAN table", - { - {"entry", "create", "create a VLAN entry", "", SW_API_VLAN_ADD, NULL}, - {"entry", "del", "delete a VLAN entryn", "", SW_API_VLAN_DEL, NULL}, - {"entry", "update", "update port member of a VLAN entry", - " <0>", SW_API_VLAN_MEM_UPDATE, NULL}, - {"entry", "find", "find a VLAN entry by VLAN id", "", SW_API_VLAN_FIND, NULL}, - {"entry", "next", "find next VLAN entry by VLAN id", - "",SW_API_VLAN_NEXT, NULL}, - {"entry", "append", "append a VLAN entry", "", SW_API_VLAN_APPEND, NULL}, - {"entry", "flush", "flush all VLAN entries", "",SW_API_VLAN_FLUSH, NULL}, - {"entry", "show", "show whole VLAN entries", "", SW_CMD_VLAN_SHOW, cmd_show_vlan}, - {"fid", "set", "set VLAN entry fid", " ",SW_API_VLAN_FID_SET, NULL}, - {"fid", "get", "get VLAN entry fid", "",SW_API_VLAN_FID_GET, NULL}, - {"member", "add", "add VLAN entry member", - " ", - SW_API_VLAN_MEMBER_ADD, NULL}, - {"member", "del", "del VLAN entry member", - " ", SW_API_VLAN_MEMBER_DEL, NULL}, - {"learnsts", "set", "set VLAN entry learn status", - " ", SW_API_VLAN_LEARN_STATE_SET, NULL}, - {"learnsts", "get", "get VLAN entry learn status", - "", SW_API_VLAN_LEARN_STATE_GET, NULL}, - {"lan_wan_cfg", "set", "set lan & wan configuration", - "", SW_API_LAN_WAN_CFG_SET, NULL}, - {"lan_wan_cfg", "get", "get lan & wan configuration", - "", SW_API_LAN_WAN_CFG_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*portvlan*/ -#ifdef IN_PORTVLAN - { - "portVlan", "config port base VLAN", - { - {"ingress", "get", "get ingress VLAN mode of a port", - "", SW_API_PT_ING_MODE_GET, NULL}, - {"ingress", "set", "set ingress VLAN mode of a port", - " ", SW_API_PT_ING_MODE_SET, NULL}, - {"egress", "get", "get egress VLAN mode of a port", - "", SW_API_PT_EG_MODE_GET, NULL}, - {"egress", "set", "set egress VLAN mode of a port", - " ", - SW_API_PT_EG_MODE_SET, NULL}, - {"member", "add", "add a member to the port based VLAN of a port", - " ", SW_API_PT_VLAN_MEM_ADD, NULL}, - {"member", "del", "delete a member from the port based VLAN of a port", - " ", SW_API_PT_VLAN_MEM_DEL, NULL}, - {"member", "update", "update members of the port based VLAN of a port", - " ", SW_API_PT_VLAN_MEM_UPDATE, NULL}, - {"member", "get", "get members of the port based VLAN of a port", - "", SW_API_PT_VLAN_MEM_GET, NULL}, - {"defaultVid", "get", "get default VLAN id of a port", - "", SW_API_PT_DEF_VID_GET, NULL}, - {"defaultVid", "set", "set default VLAN id of a port", - " ", SW_API_PT_DEF_VID_SET, NULL}, - {"forceVid", "set", "set VLAN id enforcement status of a port", - " ", SW_API_PT_FORCE_DEF_VID_SET, NULL}, - {"forceVid", "get", "get VLAN id enforcement status of a port", - "", SW_API_PT_FORCE_DEF_VID_GET, NULL}, - {"forceMode", "set", "set port based VLAN enforcement status of a port", - " ", SW_API_PT_FORCE_PORTVLAN_SET, NULL}, - {"forceMode", "get", "get port based VLAN enforcement status of a port", - "", SW_API_PT_FORCE_PORTVLAN_GET, NULL}, - {"nestVlan", "set", "set nest VLAN status of a port", - " ", SW_API_PT_NESTVLAN_SET, NULL}, - {"nestVlan", "get", "get nest VLAN status of a port", - "", SW_API_PT_NESTVLAN_GET, NULL}, - {"sVlanTPID", "set", "set service VLAN tpid", - "", SW_API_NESTVLAN_TPID_SET, NULL}, - {"sVlanTPID", "get", "get service VLAN tpid", - "", SW_API_NESTVLAN_TPID_GET, NULL}, - /*shiva*/ - {"invlan", "set", "set port invlan mode", - " ", - SW_API_PT_IN_VLAN_MODE_SET, NULL}, - {"invlan", "get", "get port invlan mode", - "", SW_API_PT_IN_VLAN_MODE_GET, NULL}, - {"tlsMode", "set", "set TLS mode", - " ", SW_API_PT_TLS_SET, NULL}, - {"tlsMode", "get", "get TLS mode", - "", SW_API_PT_TLS_GET, NULL}, - {"priPropagation", "set", "set priority propagation", - " ", SW_API_PT_PRI_PROPAGATION_SET, NULL}, - {"priPropagation", "get", "get priority propagation", - "", SW_API_PT_PRI_PROPAGATION_GET, NULL}, - {"defaultSVid", "set", "set default SVID", - " ", SW_API_PT_DEF_SVID_SET, NULL}, - {"defaultSVid", "get", "get default SVID", - "", SW_API_PT_DEF_SVID_GET, NULL}, - {"defaultCVid", "set", "set default CVID", - " ", SW_API_PT_DEF_CVID_SET, NULL}, - {"defaultCVid", "get", "get default CVID", - "", SW_API_PT_DEF_CVID_GET, NULL}, - {"vlanPropagation", "set", "set vlan propagation", - " ", SW_API_PT_VLAN_PROPAGATION_SET, NULL}, - {"vlanPropagation", "get", "get vlan propagation", - "", SW_API_PT_VLAN_PROPAGATION_GET, NULL}, - {"translation", "add", "add vlan translation", - "", SW_API_PT_VLAN_TRANS_ADD, NULL}, - {"translation", "del", "del vlan translation", - "", SW_API_PT_VLAN_TRANS_DEL, NULL}, - {"translation", "get", "get vlan translation", - "", SW_API_PT_VLAN_TRANS_GET, NULL}, - {"translation", "iterate", "iterate vlan translation tables", - " ", SW_API_PT_VLAN_TRANS_ITERATE, NULL}, - {"qinqMode", "set", "set qinq mode", - "", SW_API_QINQ_MODE_SET, NULL}, - {"qinqMode", "get", "get qinq mode", - "", SW_API_QINQ_MODE_GET, NULL}, - {"qinqRole", "set", "set qinq role", - " ", SW_API_PT_QINQ_ROLE_SET, NULL}, - {"qinqRole", "get", "get qinq role", - "", SW_API_PT_QINQ_ROLE_GET, NULL}, - {"macvlanxlt", "set", "set mac vlan xlt status", - " ", SW_API_PT_MAC_VLAN_XLT_SET, NULL}, - {"macvlanxlt", "get", "set mac vlan xlt status", - "", SW_API_PT_MAC_VLAN_XLT_GET, NULL}, - {"netiso", "set", "enable public/private net isolate", - "", SW_API_NETISOLATE_SET, NULL}, - {"netiso", "get", "get public/private net isolate status", - "", SW_API_NETISOLATE_GET, NULL}, - {"egbypass", "set", "enable egress translation filter bypass", - "", SW_API_EG_FLTR_BYPASS_EN_SET, NULL}, - {"egbypass", "get", "get the status of egress translation filter bypass", - "", SW_API_EG_FLTR_BYPASS_EN_GET, NULL}, - {"ptvrfid", "set", "set port VRF ID", - " ", SW_API_PT_VRF_ID_SET, NULL}, - {"ptvrfid", "get", "get port VRF ID", - "", SW_API_PT_VRF_ID_GET, NULL}, - {"globalqinqmode", "set", "set global qinq mode", - "", SW_API_GLOBAL_QINQ_MODE_SET, NULL}, - {"globalqinqmode", "get", "get global qinq mode", - "", SW_API_GLOBAL_QINQ_MODE_GET, NULL}, - {"ptqinqmode", "set", "set port qinq mode", - "", SW_API_PORT_QINQ_MODE_SET, NULL}, - {"ptqinqmode", "get", "get port qinq mode", - "", SW_API_PORT_QINQ_MODE_GET, NULL}, - {"intpid", "set", "set ingress tpid", "", SW_API_TPID_SET, NULL}, - {"intpid", "get", "get ingress tpid", "", SW_API_TPID_GET, NULL}, - {"egtpid", "set", "set egress tpid", "", SW_API_EGRESS_TPID_SET, NULL}, - {"egtpid", "get", "get egress tpid", "", SW_API_EGRESS_TPID_GET, NULL}, - {"ingressfilter", "set", "set port ingress filter", - "", SW_API_PT_INGRESS_VLAN_FILTER_SET, NULL}, - {"ingressfilter", "get", "get port ingress filter", - "", SW_API_PT_INGRESS_VLAN_FILTER_GET, NULL}, - {"defaultvlantag", "set", "set port default vlan tag", - " ", SW_API_PT_DEFAULT_VLANTAG_SET, NULL}, - {"defaultvlantag", "get", "get port default vlan tag", - " ", SW_API_PT_DEFAULT_VLANTAG_GET, NULL}, - {"tagpropagation", "set", "set port tag propagation", - " ", SW_API_PT_TAG_PROPAGATION_SET, NULL}, - {"tagpropagation", "get", "get port tag propagation", - " ", SW_API_PT_TAG_PROPAGATION_GET, NULL}, - {"egmode", "set", "set port egress vlan mode", - "", SW_API_PT_VLANTAG_EGMODE_SET, NULL}, - {"egmode", "get", "get port egress vlan mode", - "", SW_API_PT_VLANTAG_EGMODE_GET, NULL}, - {"translationmissaction", "set", "set port xlt miss command", - " ", - SW_API_PT_VLAN_XLT_MISS_CMD_SET, NULL}, - {"translationmissaction", "get", "get port xlt miss command", - "", SW_API_PT_VLAN_XLT_MISS_CMD_GET, NULL}, - {"vsiegmode", "set", "set a vsi port egress tag", - " ", - SW_API_PT_VSI_EGMODE_SET, NULL}, - {"vsiegmode", "get", "get a vsi port egress tag", - " ", SW_API_PT_VSI_EGMODE_GET, NULL}, - {"vsiegmodeen", "set", "set port vlan tag vsi egress mode enable or not", - " ", SW_API_PT_VLANTAG_VSI_EGMODE_EN_SET, NULL}, - {"vsiegmodeen", "get", "get port vlan tag vsi egress mode enable or not", - "", SW_API_PT_VLANTAG_VSI_EGMODE_EN_GET, NULL}, - {"translationAdv", "add", "add a vlan translation entry based on port and direction", - " ", SW_API_PT_VLAN_TRANS_ADV_ADD, NULL}, - {"translationAdv", "del", "del a vlan translation entry based on port and direction", - " ", SW_API_PT_VLAN_TRANS_ADV_DEL, NULL}, - {"translationAdv", "getfirst", "get first vlan entry based on port and direction", - " ", SW_API_PT_VLAN_TRANS_ADV_GETFIRST, NULL}, - {"translationAdv", "getnext", "get next vlan entry based on port and direction", - " ", SW_API_PT_VLAN_TRANS_ADV_GETNEXT, NULL}, - {"translationAdv", "show", "get all vlan entries based on port and direction", - " <1:ingress|2:egress>", - SW_CMD_PT_VLAN_TRANS_ADV_SHOW, cmd_show_ptvlan_entry}, - {"counter", "set", "clean up port vlan counter", - "", SW_API_PT_VLAN_COUNTER_CLEANUP, NULL}, - {"counter", "get", "get port vlan counter", - "", SW_API_PT_VLAN_COUNTER_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*fdb*/ -#ifdef IN_FDB - { - "fdb", "config FDB table", - { - {"entry", "add", "add a FDB entry", "", SW_API_FDB_ADD, NULL}, - {"entry", "del", "delete a FDB entry", "", SW_API_FDB_DELMAC, NULL}, - {"entry", "flush", "flush all FDB entries", "<0:dynamic only|1:dynamic and static>", SW_API_FDB_DELALL, NULL}, - {"entry", "show", "show whole FDB entries", "", SW_CMD_FDB_SHOW, cmd_show_fdb}, - {"entry", "find", "find a FDB entry", "", SW_API_FDB_FIND, NULL}, - {"entry", "iterate", "iterate all FDB entries", "", SW_API_FDB_ITERATE, NULL}, - {"entry", "extendnext", "find next FDB entry in extend mode", "", SW_API_FDB_EXTEND_NEXT, NULL}, - {"entry", "extendfirst", "find first FDB entry in extend mode", "", SW_API_FDB_EXTEND_FIRST, NULL}, - {"entry", "transfer", "transfer port info in FDB entry", " ", SW_API_FDB_TRANSFER, NULL}, - {"portEntry", "flush", "flush all FDB entries by a port", " <0:dynamic only|1:dynamic and static>", SW_API_FDB_DELPORT, NULL}, - {"firstEntry", "find", "find the first FDB entry", "", SW_API_FDB_FIRST, NULL}, - {"nextEntry", "find", "find next FDB entry", "", SW_API_FDB_NEXT, NULL}, - {"portLearn", "set", "set FDB entry learning status of a port", " ", SW_API_FDB_PT_LEARN_SET, NULL}, - {"portLearn", "get", "get FDB entry learning status of a port", "", SW_API_FDB_PT_LEARN_GET, NULL}, - {"ptLearnCtrl", "set", "set new address learning and forward", " ", SW_API_FDB_PT_NEWADDR_LEARN_SET, NULL}, - {"ptLearnCtrl", "get", "get new address learning and forward", "", SW_API_FDB_PT_NEWADDR_LEARN_GET, NULL}, - {"ptStationMove", "set", "set station move learning and forward", " ", SW_API_FDB_PT_STAMOVE_SET, NULL}, - {"ptStationMove", "get", "get station move learning and forward", "", SW_API_FDB_PT_STAMOVE_GET, NULL}, - {"ageCtrl", "set", "set FDB entry aging status", "", SW_API_FDB_AGE_CTRL_SET, NULL}, - {"ageCtrl", "get", "get FDB entry aging status", "", SW_API_FDB_AGE_CTRL_GET, NULL}, - {"learnCtrl", "set", "set FDB entry learn status", "", SW_API_FDB_LEARN_CTRL_SET, NULL}, - {"learnCtrl", "get", "get FDB entry learn status", "", SW_API_FDB_LEARN_CTRL_GET, NULL}, - {"vlansmode", "set", "set FDB vlan search mode", "", SW_API_FDB_VLAN_IVL_SVL_SET, NULL}, - {"vlansmode", "get", "get FDB vlan search mode", "", SW_API_FDB_VLAN_IVL_SVL_GET, NULL}, - {"ageTime", "set", "set FDB entry aging time", "", SW_API_FDB_AGE_TIME_SET, NULL}, - {"ageTime", "get", "get FDB entry aging time", "", SW_API_FDB_AGE_TIME_GET, NULL}, - {"ptlearncounter", "get", "get port FDB entry learn counter", "", SW_API_PT_FDB_LEARN_COUNTER_GET, NULL}, - {"ptlearnlimit", "set", "set port FDB entry learn limit", " ", SW_API_PT_FDB_LEARN_LIMIT_SET, NULL}, - {"ptlearnlimit", "get", "get port FDB entry learn limit", "", SW_API_PT_FDB_LEARN_LIMIT_GET, NULL}, - {"ptlearnexceedcmd", "set", "set port forwarding cmd when exceed learn limit", " ", SW_API_PT_FDB_LEARN_EXCEED_CMD_SET, NULL}, - {"ptlearnexceedcmd", "get", "get port forwarding cmd when exceed learn limit", "", SW_API_PT_FDB_LEARN_EXCEED_CMD_GET, NULL}, - {"learnlimit", "set", "set FDB entry learn limit", " ", SW_API_FDB_LEARN_LIMIT_SET, NULL}, - {"learnlimit", "get", "get FDB entry learn limit", "", SW_API_FDB_LEARN_LIMIT_GET, NULL}, - {"learnexceedcmd", "set", "set forwarding cmd when exceed learn limit", "", SW_API_FDB_LEARN_EXCEED_CMD_SET, NULL}, - {"learnexceedcmd", "get", "get forwarding cmd when exceed learn limit", "", SW_API_FDB_LEARN_EXCEED_CMD_GET, NULL}, - {"resventry", "add", "add a reserve FDB entry", "", SW_API_FDB_RESV_ADD, NULL}, - {"resventry", "del", "delete reserve a FDB entry", "", SW_API_FDB_RESV_DEL, NULL}, - {"resventry", "find", "find a reserve FDB entry", "", SW_API_FDB_RESV_FIND, NULL}, - {"resventry", "iterate", "iterate all reserve FDB entries", "", SW_API_FDB_RESV_ITERATE, NULL}, - {"resventry", "show", "show whole resv FDB entries", "", SW_CMD_RESV_FDB_SHOW, cmd_show_resv_fdb}, - {"ptLearnstatic", "set", "set FDB entry learning static status of a port", " ", SW_API_FDB_PT_LEARN_STATIC_SET, NULL}, - {"ptLearnStatic", "get", "get FDB entry learning static status of a port", "", SW_API_FDB_PT_LEARN_STATIC_GET, NULL}, - {"port", "add", "add one port to a FDB entry", " ", SW_API_FDB_PORT_ADD, NULL}, - {"port", "del", "del one port from a FDB entry", " ", SW_API_FDB_PORT_DEL, NULL}, - {"fdbrfs", "set", "add a FDB rfs", "", SW_API_FDB_RFS_SET, NULL}, - {"fdbrfs", "del", "delete a FDB rfs", "", SW_API_FDB_RFS_DEL, NULL}, - {"ptmaclimitctrl", "set", "set port maclimit ctrl", "", SW_API_FDB_PT_MACLIMIT_CTRL_SET, NULL}, - {"ptmaclimitctrl", "get", "get port maclimit ctrl", "", SW_API_FDB_PT_MACLIMIT_CTRL_GET, NULL}, - {"fidEntry", "flush", "flush all FDB entries by a fid", " <0:dynamic only|1:dynamic and static>", SW_API_FDB_DEL_BY_FID, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*acl*/ -#ifdef IN_ACL - { - "acl", "config ACL", - { - {"list", "create", "create an ACL list", " ", SW_API_ACL_LIST_CREAT, NULL}, - {"list", "destroy", "destroy an ACL list", "", SW_API_ACL_LIST_DESTROY, NULL}, - {"list", "bind", "bind an ACL list to a port", " <0-0:direction> <0-0:objtype> ", SW_API_ACL_LIST_BIND, NULL}, - {"list", "unbind", "unbind an ACL list from a port", " <0-0:direction> <0-0:objtype> ", SW_API_ACL_LIST_UNBIND, NULL}, - {"rule", "add", "add ACL rules to an ACL list", " ", SW_API_ACL_RULE_ADD, NULL}, - {"rule", "del", "delete ACL rules from an ACL list", " ", SW_API_ACL_RULE_DELETE, NULL}, - {"rule", "query", "query a ACL rule", " ", SW_API_ACL_RULE_QUERY, NULL}, - {"rule", "active", "active ACL rules in an ACL list", " ", SW_API_ACL_RULE_ACTIVE, NULL}, - {"rule", "deactive", "deactive ACL rules in an ACL list", " ", SW_API_ACL_RULE_DEACTIVE, NULL}, - {"srcfiltersts", "set", "set status of ACL rules source filter", " ", SW_API_ACL_RULE_SRC_FILTER_STS_SET, NULL}, - {"srcfiltersts", "get", "get status of ACL rules source filter", "", SW_API_ACL_RULE_SRC_FILTER_STS_GET, NULL}, - {"status", "set", "set status of ACL engine", "", SW_API_ACL_STATUS_SET, NULL}, - {"status", "get", "get status of ACL engine", "", SW_API_ACL_STATUS_GET, NULL}, - {"udfprofile", "set", "set port udf profile", " ", SW_API_ACL_PT_UDF_PROFILE_SET, NULL}, - {"udfprofile", "get", "get port udf profile", " ", SW_API_ACL_PT_UDF_PROFILE_GET, NULL}, - {"udf", "set", "set udf", " <0-3> ", SW_API_ACL_UDF_SET, NULL}, - {"udf", "get", "get udf", " <0-3>", SW_API_ACL_UDF_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*qos*/ -#ifdef IN_QOS - { - "qos", "config Qos", - { - {"schMode", "set", "set traffic scheduling mode", " ", SW_API_QOS_SCH_MODE_SET, NULL}, - {"schMode", "get", "get traffic scheduling mode", "", SW_API_QOS_SCH_MODE_GET, NULL}, - {"qTxBufSts", "set", "set queue tx buffer counting status of a port", " ", SW_API_QOS_QU_TX_BUF_ST_SET, NULL}, - {"qTxBufSts", "get", "get queue tx buffer counting status of a port", "", SW_API_QOS_QU_TX_BUF_ST_GET, NULL}, - {"qTxBufNr", "set", "set queue tx buffer number", " ", SW_API_QOS_QU_TX_BUF_NR_SET, NULL}, - {"qTxBufNr", "get", "get queue tx buffer number", " ", SW_API_QOS_QU_TX_BUF_NR_GET, NULL}, - {"ptTxBufSts", "set", "set port tx buffer counting status of a port", " ", SW_API_QOS_PT_TX_BUF_ST_SET, NULL}, - {"ptTxBufSts", "get", "get port tx buffer counting status of a port", "", SW_API_QOS_PT_TX_BUF_ST_GET, NULL}, - {"ptRedEn", "set", "set status of port wred of a port", " ", SW_API_QOS_PT_RED_EN_SET, NULL}, - {"ptRedEn", "get", "get status of port wred of a port", "", SW_API_QOS_PT_RED_EN_GET, NULL}, - {"ptTxBufNr", "set", "set port tx buffer number", " ", SW_API_QOS_PT_TX_BUF_NR_SET, NULL}, - {"ptTxBufNr", "get", "get port tx buffer number", "", SW_API_QOS_PT_TX_BUF_NR_GET, NULL}, - {"ptRxBufNr", "set", "set port rx buffer number", " ", SW_API_QOS_PT_RX_BUF_NR_SET, NULL}, - {"ptRxBufNr", "get", "get port rx buffer number", "", SW_API_QOS_PT_RX_BUF_NR_GET, NULL}, - {"up2q", "set", "set user priority to queue mapping", " ", SW_API_COSMAP_UP_QU_SET, NULL}, - {"up2q", "get", "get user priority to queue mapping", "", SW_API_COSMAP_UP_QU_GET, NULL}, - {"dscp2q", "set", "set dscp to queue mapping", " ", SW_API_COSMAP_DSCP_QU_SET, NULL}, - {"dscp2q", "get", "get dscp to queue mapping", "", SW_API_COSMAP_DSCP_QU_GET, NULL}, - {"ptMode", "set", "set Qos mode of a port", " ", SW_API_QOS_PT_MODE_SET, NULL}, - {"ptMode", "get", "get Qos mode of a port", " ", SW_API_QOS_PT_MODE_GET, NULL}, - {"ptModePri", "set", "set the priority of Qos modes of a port", " ", SW_API_QOS_PT_MODE_PRI_SET, NULL}, - {"ptModePri", "get", "get the priority of Qos modes of a port", " ", SW_API_QOS_PT_MODE_PRI_GET, NULL}, - {"ptDefaultUp", "set", "set default user priority for received frames of a port", " ", SW_API_QOS_PORT_DEF_UP_SET, NULL}, - {"ptDefaultUp", "get", "get default user priority for received frames of a port", "", SW_API_QOS_PORT_DEF_UP_GET, NULL}, - {"ptschMode", "set", "set port traffic scheduling mode", " ", SW_API_QOS_PORT_SCH_MODE_SET, NULL}, - {"ptschMode", "get", "get port traffic scheduling mode", "", SW_API_QOS_PORT_SCH_MODE_GET, NULL}, - {"ptDefaultSpri", "set", "set default stag priority for received frames of a port", " ", SW_API_QOS_PT_DEF_SPRI_SET, NULL}, - {"ptDefaultSpri", "get", "get default stag priority for received frames of a port", "", SW_API_QOS_PT_DEF_SPRI_GET, NULL}, - {"ptDefaultCpri", "set", "set default ctag priority for received frames of a port", " ", SW_API_QOS_PT_DEF_CPRI_SET, NULL}, - {"ptDefaultCpri", "get", "get default ctag priority for received frames of a port", "", SW_API_QOS_PT_DEF_CPRI_GET, NULL}, - {"ptFSpriSts", "set", "set port force Stag priority status for received frames of a port", " ", SW_API_QOS_PT_FORCE_SPRI_ST_SET, NULL}, - {"ptFSpriSts", "get", "get port force Stag priority status for received frames of a port", "", SW_API_QOS_PT_FORCE_SPRI_ST_GET, NULL}, - {"ptFCpriSts", "set", "set port force Ctag priority status for received frames of a port", " ", SW_API_QOS_PT_FORCE_CPRI_ST_SET, NULL}, - {"ptFCpriSts", "get", "get port force Ctag priority status for received frames of a port", "", SW_API_QOS_PT_FORCE_CPRI_ST_GET, NULL}, - {"ptQuRemark", "set", "set egress queue based remark", " ", SW_API_QOS_QUEUE_REMARK_SET, NULL}, - {"ptQuRemark", "get", "get egress queue based remark", " ", SW_API_QOS_QUEUE_REMARK_GET, NULL}, - {"ptgroup", "set", "set port group", " ", SW_API_QOS_PORT_GROUP_SET, NULL}, - {"ptgroup", "get", "get port group", "", SW_API_QOS_PORT_GROUP_GET, NULL}, - {"ptpriprece", "set", "set port priority precedence", "", SW_API_QOS_PORT_PRI_SET, NULL}, - {"ptPriprece", "get", "get port priority precedence", "", SW_API_QOS_PORT_PRI_GET, NULL}, - {"ptremark", "set", "set port remark", " ", SW_API_QOS_PORT_REMARK_SET, NULL}, - {"ptremark", "get", "get port remark", "", SW_API_QOS_PORT_REMARK_GET, NULL}, - {"pcpmap", "set", "set pcp map", " ", SW_API_QOS_PCP_MAP_SET, NULL}, - {"pcpmap", "get", "get pcp map", " ", SW_API_QOS_PCP_MAP_GET, NULL}, - {"flowmap", "set", "set flow map", " ", SW_API_QOS_FLOW_MAP_SET, NULL}, - {"flowmap", "get", "get flow map", " ", SW_API_QOS_FLOW_MAP_GET, NULL}, - {"dscpmap", "set", "set dscp map", " ", SW_API_QOS_DSCP_MAP_SET, NULL}, - {"dscpmap", "get", "get dscp map", " ", SW_API_QOS_DSCP_MAP_GET, NULL}, - {"qscheduler", "set", "set queue scheduler", " ", SW_API_QOS_QUEUE_SCHEDULER_SET, NULL}, - {"qscheduler", "get", "get queue scheduler", " ", SW_API_QOS_QUEUE_SCHEDULER_GET, NULL}, - {"ringqueue", "set", "set ring queue map", " ", SW_API_QOS_RING_QUEUE_MAP_SET, NULL}, - {"ringqueue", "get", "get ring queue map", "", SW_API_QOS_RING_QUEUE_MAP_GET, NULL}, - {"portqueues", "get", "get queues belong to port", "", SW_API_QOS_PORT_QUEUES_GET, NULL}, - {"dequeue", "get", "dequeue control get", "", SW_API_QOS_SCHEDULER_DEQUEU_CTRL_GET, NULL}, - {"dequeue", "set", "dequeue control set", " ", SW_API_QOS_SCHEDULER_DEQUEU_CTRL_SET, NULL}, - {"portscheduler", "reset", "reset queue scheduler config", "", SW_API_QOS_PORT_SCHEDULER_CFG_RESET, NULL}, - {"schedulerresource", "get", "get port scheduler resource", "", SW_API_QOS_PORT_SCHEDULER_RESOURCE_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*igmp*/ -#ifdef IN_IGMP - { - "igmp", "config IGMP/MLD", - { - {"mode", "set", "set IGMP/MLD snooping status of a port", " ", SW_API_PT_IGMPS_MODE_SET, NULL}, - {"mode", "get", "get port IGMP/MLD snooping status", "", SW_API_PT_IGMPS_MODE_GET, NULL}, - {"cmd", "set", "set IGMP/MLD frames forwarding command", "", SW_API_IGMP_MLD_CMD_SET, NULL}, - {"cmd", "get", "get IGMP/MLD frames forwarding command", "", SW_API_IGMP_MLD_CMD_GET, NULL}, - {"portJoin", "set", "set IGMP/MLD hardware joining status", " ", SW_API_IGMP_PT_JOIN_SET, NULL}, - {"portJoin", "get", "get IGMP/MLD hardware joining status", "", SW_API_IGMP_PT_JOIN_GET, NULL}, - {"portLeave", "set", "set IGMP/MLD hardware leaving status", " ", SW_API_IGMP_PT_LEAVE_SET, NULL}, - {"portLeave", "get", "get IGMP/MLD hardware leaving status", "", SW_API_IGMP_PT_LEAVE_GET, NULL}, - {"rp", "set", "set IGMP/MLD router ports", "", SW_API_IGMP_RP_SET, NULL}, - {"rp", "get", "get IGMP/MLD router ports", "", SW_API_IGMP_RP_GET, NULL}, - {"createStatus", "set", "set IGMP/MLD ability for creating entry", "", SW_API_IGMP_ENTRY_CREAT_SET, NULL}, - {"createStatus", "get", "get IGMP/MLD ability for creating entry", "", SW_API_IGMP_ENTRY_CREAT_GET, NULL}, - {"static", "set", "set IGMP/MLD static status for creating entry", "", SW_API_IGMP_ENTRY_STATIC_SET, NULL}, - {"static", "get", "get IGMP/MLD static status for creating entry", "", SW_API_IGMP_ENTRY_STATIC_GET, NULL}, - {"leaky", "set", "set IGMP/MLD leaky status for creating entry", "", SW_API_IGMP_ENTRY_LEAKY_SET, NULL}, - {"leaky", "get", "get IGMP/MLD leaky status for creating entry", "", SW_API_IGMP_ENTRY_LEAKY_GET, NULL}, - {"version3", "set", "set IGMP v3/MLD v2 status for creating entry", "", SW_API_IGMP_ENTRY_V3_SET, NULL}, - {"version3", "get", "get IGMP v3/MLD v2 status for creating entry", "", SW_API_IGMP_ENTRY_V3_GET, NULL}, - {"queue", "set", "set IGMP/MLD queue status for creating entry", " ", SW_API_IGMP_ENTRY_QUEUE_SET, NULL}, - {"queue", "get", "get IGMP/MLD queue status for creating entry", "", SW_API_IGMP_ENTRY_QUEUE_GET, NULL}, - {"ptlearnlimit", "set", "set port Multicast entry learn limit", " ", SW_API_PT_IGMP_LEARN_LIMIT_SET, NULL}, - {"ptlearnlimit", "get", "get port Multicast entry learn limit", "", SW_API_PT_IGMP_LEARN_LIMIT_GET, NULL}, - {"ptlearnexceedcmd", "set", "set port forwarding cmd when exceed multicast learn limit", " ", SW_API_PT_IGMP_LEARN_EXCEED_CMD_SET, NULL}, - {"ptlearnexceedcmd", "get", "get port forwarding cmd when exceed multicast learn limit", "", SW_API_PT_IGMP_LEARN_EXCEED_CMD_GET, NULL}, - {"multi", "set", "set igmp/mld entry", "", SW_API_IGMP_SG_ENTRY_SET, NULL}, - {"multi", "clear", "clear igmp/mld entry", "", SW_API_IGMP_SG_ENTRY_CLEAR, NULL}, - {"multi", "show", "show all igmp/mld entry", "", SW_API_IGMP_SG_ENTRY_SHOW, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*leaky*/ -#ifdef IN_LEAKY - { - "leaky", "config leaky", - { - {"ucMode", "set", "set unicast packets leaky mode", "", SW_API_UC_LEAKY_MODE_SET, NULL}, - {"ucMode", "get", "get unicast packets leaky mode", "", SW_API_UC_LEAKY_MODE_GET, NULL}, - {"mcMode", "set", "set multicast packets leaky mode", "", SW_API_MC_LEAKY_MODE_SET, NULL}, - {"mcMode", "get", "get multicast packets leaky mode", "", SW_API_MC_LEAKY_MODE_GET, NULL}, - {"arpMode", "set", "set arp packets leaky mode", " ", SW_API_ARP_LEAKY_MODE_SET, NULL}, - {"arpMode", "get", "get arp packets leaky mode", "", SW_API_ARP_LEAKY_MODE_GET, NULL}, - {"ptUcMode", "set", "set unicast packets leaky status of a port", " ", SW_API_PT_UC_LEAKY_MODE_SET, NULL}, - {"ptUcMode", "get", "get unicast packets leaky status of a port", "", SW_API_PT_UC_LEAKY_MODE_GET, NULL}, - {"ptMcMode", "set", "set multicast packets leaky status of a port", " ", SW_API_PT_MC_LEAKY_MODE_SET, NULL}, - {"ptMcMode", "get", "get multicast packets leaky status of a port", "", SW_API_PT_MC_LEAKY_MODE_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*mirror*/ -#ifdef IN_MIRROR - { - "mirror", "config mirror", - { - {"analyPt", "set", "set mirror analysis port", "", SW_API_MIRROR_ANALY_PT_SET, NULL}, - {"analyPt", "get", "get mirror analysis port", "", SW_API_MIRROR_ANALY_PT_GET, NULL}, - {"ptIngress", "set", "set ingress mirror status of a port", " ", SW_API_MIRROR_IN_PT_SET, NULL}, - {"ptIngress", "get", "get ingress mirror status of a port", "", SW_API_MIRROR_IN_PT_GET, NULL}, - {"ptEgress", "set", "set egress mirror status of a port", " ", SW_API_MIRROR_EG_PT_SET, NULL}, - {"ptEgress", "get", "get egress mirror status of a port", "", SW_API_MIRROR_EG_PT_GET, NULL}, - {"analyCfg", "set", "set analysis configure", "", SW_API_MIRROR_ANALYSIS_CONFIG_SET, NULL}, - {"analyCfg", "get", "get analysis configure", "", SW_API_MIRROR_ANALYSIS_CONFIG_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*rate*/ -#ifdef IN_RATE - { - "rate", "config rate limit", - { - {"qEgress", "set", "set egress rate limit of a queue", " ", SW_API_RATE_QU_EGRL_SET, NULL}, - {"qEgress", "get", "get egress rate limit of a queue", " ", SW_API_RATE_QU_EGRL_GET, NULL}, - {"ptEgress", "set", "set egress rate limit of a port", " ", SW_API_RATE_PT_EGRL_SET, NULL}, - {"ptEgress", "get", "get egress rate limit of a port", "", SW_API_RATE_PT_EGRL_GET, NULL}, - {"ptIngress", "set", "set ingress rate limit of a port", " ", SW_API_RATE_PT_INRL_SET, NULL}, - {"ptIngress", "get", "get ingress rate limit of a port", "", SW_API_RATE_PT_INRL_GET, NULL}, - {"stormCtrl", "set", "set storm control status of a particular frame type", " ", SW_API_STORM_CTRL_FRAME_SET, NULL}, - {"stormCtrl", "get", "get storm control status of a particular frame type", " ", SW_API_STORM_CTRL_FRAME_GET, NULL}, - {"stormCtrlRate", "set", "set storm ctrl rate", " ", SW_API_STORM_CTRL_RATE_SET, NULL}, - {"stormCtrlRate", "get", "get storm ctrl rate", "", SW_API_STORM_CTRL_RATE_GET, NULL}, - {"portpolicer", "set", "set port policer", "", SW_API_RATE_PORT_POLICER_SET, NULL}, - {"portpolicer", "get", "get port policer", "", SW_API_RATE_PORT_POLICER_GET, NULL}, - {"portshaper", "set", "set port egress shaper", " ", SW_API_RATE_PORT_SHAPER_SET, NULL}, - {"portshaper", "get", "get port egress shaper", "", SW_API_RATE_PORT_SHAPER_GET, NULL}, - {"queueshaper", "set", "set queue egress shaper", " ", SW_API_RATE_QUEUE_SHAPER_SET, NULL}, - {"queueshaper", "get", "get queue egress shaper", " ", SW_API_RATE_QUEUE_SHAPER_GET, NULL}, - {"aclpolicer", "set", "set acl policer", "", SW_API_RATE_ACL_POLICER_SET, NULL}, - {"aclpolicer", "get", "get acl policer", "", SW_API_RATE_ACL_POLICER_GET, NULL}, - {"ptAddRateByte", "set", "set add_rate_byte when cal rate ", " ", SW_API_RATE_PT_ADDRATEBYTE_SET, NULL}, - {"ptAddRateByte", "get", "get add_rate_byte when cal rate ", "", SW_API_RATE_PT_ADDRATEBYTE_GET, NULL}, - {"ptgolflowen", "set", "set status of port globle flow control", " ", SW_API_RATE_PT_GOL_FLOW_EN_SET, NULL}, - {"ptgolflowen", "get", "get status of port globle flow control", "", SW_API_RATE_PT_GOL_FLOW_EN_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - -#ifdef IN_SEC - { - "sec", "config security", - { - {"mac", "set", "set MAC layer related security", " ", SW_API_SEC_MAC_SET, NULL}, - {"mac", "get", "get MAC layer related security", "", SW_API_SEC_MAC_GET, NULL}, - {"ip", "set", "set IP layer related security", " ", SW_API_SEC_IP_SET, NULL}, - {"ip", "get", "get IP layer related security", "", SW_API_SEC_IP_GET, NULL}, - {"ip4", "set", "set IP4 related security", " ", SW_API_SEC_IP4_SET, NULL}, - {"ip4", "get", "get IP4 related security", "", SW_API_SEC_IP4_GET, NULL}, - {"ip6", "set", "set IP6 related security", " ", SW_API_SEC_IP6_SET, NULL}, - {"ip6", "get", "get IP6 related security", "", SW_API_SEC_IP6_GET, NULL}, - {"tcp", "set", "set TCP related security", " ", SW_API_SEC_TCP_SET, NULL}, - {"tcp", "get", "get TCP related security", "", SW_API_SEC_TCP_GET, NULL}, - {"udp", "set", "set UDP related security", " ", SW_API_SEC_UDP_SET, NULL}, - {"udp", "get", "get UDP related security", "", SW_API_SEC_UDP_GET, NULL}, - {"icmp4", "set", "set ICMP4 related security", " ", SW_API_SEC_ICMP4_SET, NULL}, - {"icmp4", "get", "get ICMP4 related security", "", SW_API_SEC_ICMP4_GET, NULL}, - {"icmp6", "set", "set ICMP6 related security", " ", SW_API_SEC_ICMP6_SET, NULL}, - {"icmp6", "get", "get ICMP6 related security", "", SW_API_SEC_ICMP6_GET, NULL}, - {"l3parser", "get", "get l3 parser ctrl", " ", SW_API_SEC_L3_PARSER_CTRL_GET, NULL}, - {"l3parser", "set", "set l3 parser ctrl", " ", SW_API_SEC_L3_PARSER_CTRL_SET, NULL}, - {"l4parser", "get", "get l4 parser ctrl", " ", SW_API_SEC_L4_PARSER_CTRL_GET, NULL}, - {"l4parser", "set", "set l4 parser ctrl", " ", SW_API_SEC_L4_PARSER_CTRL_SET, NULL}, - {"expctrl", "get", "get l3 exp ctrl", "", SW_API_SEC_EXP_CTRL_GET, NULL}, - {"expctrl", "set", "set l3 exp ctrl", "", SW_API_SEC_EXP_CTRL_SET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*stp*/ -#ifdef IN_STP - { - "stp", "config STP", - { - {"portState", "set", "set STP state of a port", " ", SW_API_STP_PT_STATE_SET, NULL}, - {"portState", "get", "get STP state of a port", " ", SW_API_STP_PT_STATE_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*mib*/ -#ifdef IN_MIB - { - "mib", "show MIB statistics information", - { - {"statistics", "get", "get statistics information of a port", "", SW_API_PT_MIB_GET, NULL}, - {"status", "set", "set mib status", "", SW_API_MIB_STATUS_SET, NULL}, - {"status", "get", "get mib status", "", SW_API_MIB_STATUS_GET, NULL}, - {"counters", "flush", "flush counters of a port", "", SW_API_PT_MIB_FLUSH_COUNTERS, NULL}, - {"cpuKeep", "set", "set cpu keep bit", "", SW_API_MIB_CPU_KEEP_SET, NULL}, - {"cpuKeep", "get", "get cpu keep bit", "", SW_API_MIB_CPU_KEEP_GET, NULL}, - {"xgstatistics","get", "get statistics information of a xg_port", "",SW_API_PT_XGMIB_GET}, - {"counter", "get", "get counter information of a port", "", SW_API_PT_MIB_COUNTER_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /* led */ -#ifdef IN_LED - { - "led", "set/get led control pattern", - { - {"ctrlpattern", "set", "set led control pattern", " ", SW_API_LED_PATTERN_SET, NULL}, - {"ctrlpattern", "get", "get led control pattern", " ", SW_API_LED_PATTERN_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /* cosmap */ -#ifdef IN_COSMAP - { - "cosmap", "set/get cosmap table", - { - {"dscp2pri", "set", "set dscp to priority map table", " ", SW_API_COSMAP_DSCP_TO_PRI_SET, NULL}, - {"dscp2pri", "get", "get dscp to priority map table", "", SW_API_COSMAP_DSCP_TO_PRI_GET, NULL}, - {"dscp2dp", "set", "set dscp to dp map table", " ", SW_API_COSMAP_DSCP_TO_DP_SET, NULL}, - {"dscp2dp", "get", "get dscp to dp map table", "", SW_API_COSMAP_DSCP_TO_DP_GET, NULL}, - {"up2pri", "set", "set dot1p to priority map table", " ", SW_API_COSMAP_UP_TO_PRI_SET, NULL}, - {"up2pri", "get", "get dot1p to priority map table", "", SW_API_COSMAP_UP_TO_PRI_GET, NULL}, - {"up2dp", "set", "set dot1p to dp map table", " ", SW_API_COSMAP_UP_TO_DP_SET, NULL}, - {"up2dp", "get", "get dot1p to dp map table", "", SW_API_COSMAP_UP_TO_DP_GET, NULL}, - {"dscp2ehpri", "set", "set dscp to priority map table for WAN port", " ", SW_API_COSMAP_DSCP_TO_EHPRI_SET, NULL}, - {"dscp2ehpri", "get", "get dscp to priority map table for WAN port", "", SW_API_COSMAP_DSCP_TO_EHPRI_GET, NULL}, - {"dscp2ehdp", "set", "set dscp to dp map table for WAN port", " ", SW_API_COSMAP_DSCP_TO_EHDP_SET, NULL}, - {"dscp2ehdp", "get", "get dscp to dp map table for WAN port", "", SW_API_COSMAP_DSCP_TO_EHDP_GET, NULL}, - {"up2ehpri", "set", "set dot1p to priority map table for WAN port", " ", SW_API_COSMAP_UP_TO_EHPRI_SET, NULL}, - {"up2ehpri", "get", "get dot1p to priority map table for WAN port", "", SW_API_COSMAP_UP_TO_EHPRI_GET, NULL}, - {"up2ehdp", "set", "set dot1p to dp map table for WAN port", " ", SW_API_COSMAP_UP_TO_EHDP_SET, NULL}, - {"up2ehdp", "get", "get dot1p to dp map table for WAN port", "", SW_API_COSMAP_UP_TO_EHDP_GET, NULL}, - {"pri2q", "set", "set priority to queue mapping", " ", SW_API_COSMAP_PRI_TO_QU_SET, NULL}, - {"pri2q", "get", "get priority to queue mapping", "", SW_API_COSMAP_PRI_TO_QU_GET, NULL}, - {"pri2ehq", "set", "set priority to enhanced queue mapping", " ", SW_API_COSMAP_PRI_TO_EHQU_SET, NULL}, - {"pri2ehq", "get", "get priority to enhanced queue mapping", "", SW_API_COSMAP_PRI_TO_EHQU_GET, NULL}, - {"egRemark", "set", "set egress remark table", "", SW_API_COSMAP_EG_REMARK_SET, NULL}, - {"egRemark", "get", "get egress remark table", "", SW_API_COSMAP_EG_REMARK_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /*misc*/ -#ifdef IN_MISC - { - "misc", "config miscellaneous", - { - {"arp", "set", "set arp packets hardware identification status", "", SW_API_ARP_STATUS_SET, NULL}, - {"arp", "get", "get arp packets hardware identification status", "", SW_API_ARP_STATUS_GET, NULL}, - {"frameMaxSize", "set", "set the maximal received frame size of the device", "", SW_API_FRAME_MAX_SIZE_SET, NULL}, - {"frameMaxSize", "get", "get the maximal received frame size of the device", "", SW_API_FRAME_MAX_SIZE_GET, NULL}, - {"ptUnkSaCmd", "set", "set forwarding command for frames with unknown source address", " ", SW_API_PT_UNK_SA_CMD_SET, NULL}, - {"ptUnkSaCmd", "get", "get forwarding command for frames with unknown source address", "", SW_API_PT_UNK_SA_CMD_GET, NULL}, - {"ptUnkUcFilter", "set", "set flooding status of unknown unicast frames", " ", SW_API_PT_UNK_UC_FILTER_SET, NULL}, - {"ptUnkUcFilter", "get", "get flooding status of unknown unicast frames", "", SW_API_PT_UNK_UC_FILTER_GET, NULL}, - {"ptUnkMcFilter", "set", "set flooding status of unknown multicast frames", " ", SW_API_PT_UNK_MC_FILTER_SET, NULL}, - {"ptUnkMcFilter", "get", "get flooding status of unknown multicast frames", "", SW_API_PT_UNK_MC_FILTER_GET, NULL}, - {"ptBcFilter", "set", "set flooding status of broadcast frames", " ", SW_API_PT_BC_FILTER_SET, NULL}, - {"ptBcFilter", "get", "get flooding status of broadcast frames", "", SW_API_PT_BC_FILTER_GET, NULL}, - {"cpuPort", "set", "set cpu port status", "", SW_API_CPU_PORT_STATUS_SET, NULL}, - {"cpuPort", "get", "get cpu port status", "", SW_API_CPU_PORT_STATUS_GET, NULL}, - {"bctoCpu", "set", "set broadcast frames to Cpu port status", "", SW_API_BC_TO_CPU_PORT_SET, NULL}, - {"bctoCpu", "get", "get broadcast frames to Cpu port status", "", SW_API_BC_TO_CPU_PORT_GET, NULL}, - {"PppoeCmd", "set", "set pppoe frames forwarding command", "", SW_API_PPPOE_CMD_SET, NULL}, - {"PppoeCmd", "get", "get pppoe frames forwarding command", "", SW_API_PPPOE_CMD_GET, NULL}, - {"Pppoe", "set", "set pppoe frames hardware identification status", "", SW_API_PPPOE_STATUS_SET, NULL}, - {"Pppoe", "get", "get pppoe frames hardware identification status", "", SW_API_PPPOE_STATUS_GET, NULL}, - {"ptDhcp", "set", "set dhcp frames hardware identification status", " ", SW_API_PT_DHCP_SET, NULL}, - {"ptDhcp", "get", "get dhcp frames hardware identification status", "", SW_API_PT_DHCP_GET, NULL}, - {"arpcmd", "set", "set arp packets forwarding command", "", SW_API_ARP_CMD_SET, NULL}, - {"arpcmd", "get", "get arp packets forwarding command", "", SW_API_ARP_CMD_GET, NULL}, - {"eapolcmd", "set", "set eapol packets forwarding command", "", SW_API_EAPOL_CMD_SET, NULL}, - {"eapolcmd", "get", "get eapol packets forwarding command", "", SW_API_EAPOL_CMD_GET, NULL}, - {"pppoesession", "add", "add a pppoe session entry", " ", SW_API_PPPOE_SESSION_ADD, NULL}, - {"pppoesession", "del", "del a pppoe session entry", "", SW_API_PPPOE_SESSION_DEL, NULL}, - {"pppoesession", "get", "get a pppoe session entry", "", SW_API_PPPOE_SESSION_GET, NULL}, - {"eapolstatus", "set", "set eapol frames hardware identification status", " ", SW_API_EAPOL_STATUS_SET, NULL}, - {"eapolstatus", "get", "get eapol frames hardware identification status", "", SW_API_EAPOL_STATUS_GET, NULL}, - {"rip", "set", "set rip packets hardware identification status", "", SW_API_RIPV1_STATUS_SET, NULL}, - {"rip", "get", "get rip packets hardware identification status", "", SW_API_RIPV1_STATUS_GET, NULL}, - {"ptarpreq", "set", "set arp request packets hardware identification status", " ", SW_API_PT_ARP_REQ_STATUS_SET, NULL}, - {"ptarpreq", "get", "get arp request packets hardware identification status", "", SW_API_PT_ARP_REQ_STATUS_GET, NULL}, - {"ptarpack", "set", "set arp ack packets hardware identification status", " ", SW_API_PT_ARP_ACK_STATUS_SET, NULL}, - {"ptarpack", "get", "get arp ack packets hardware identification status", "", SW_API_PT_ARP_ACK_STATUS_GET, NULL}, - {"extendpppoe", "add", "add a pppoe session entry", "", SW_API_PPPOE_SESSION_TABLE_ADD, NULL}, - {"extendpppoe", "del", "del a pppoe session entry", "", SW_API_PPPOE_SESSION_TABLE_DEL, NULL}, - {"extendpppoe", "get", "get a pppoe session entry", "", SW_API_PPPOE_SESSION_TABLE_GET, NULL}, - {"pppoeid", "set", "set a pppoe session id entry", " ", SW_API_PPPOE_SESSION_ID_SET, NULL}, - {"pppoeid", "get", "get a pppoe session id entry", "", SW_API_PPPOE_SESSION_ID_GET, NULL}, - {"intrmask", "set", "set switch interrupt mask", "", SW_API_INTR_MASK_SET, NULL}, - {"intrmask", "get", "get switch interrupt mask", "", SW_API_INTR_MASK_GET, NULL}, - {"intrstatus", "get", "get switch interrupt status", "", SW_API_INTR_STATUS_GET, NULL}, - {"intrstatus", "clear", "clear switch interrupt status", "", SW_API_INTR_STATUS_CLEAR, NULL}, - {"intrportlinkmask", "set", "set link interrupt mask of a port", " ", SW_API_INTR_PORT_LINK_MASK_SET, NULL}, - {"intrportlinkmask", "get", "get link interrupt mask of a port", "", SW_API_INTR_PORT_LINK_MASK_GET, NULL}, - {"intrportlinkstatus", "get", "get link interrupt status of a port", "", SW_API_INTR_PORT_LINK_STATUS_GET, NULL}, - {"intrmaskmaclinkchg", "set", "set switch interrupt mask for mac link change", " ", SW_API_INTR_MASK_MAC_LINKCHG_SET, NULL}, - {"intrmaskmaclinkchg", "get", "get switch interrupt mask for mac link change", "", SW_API_INTR_MASK_MAC_LINKCHG_GET, NULL}, - {"intrstatusmaclinkchg", "get", "get switch interrupt status for mac link change", "", SW_API_INTR_STATUS_MAC_LINKCHG_GET, NULL}, - {"intrstatusmaclinkchg", "clear", "clear switch interrupt status for mac link change", "", SW_API_INTR_STATUS_MAC_LINKCHG_CLEAR, NULL}, - {"cpuVid", "set", "set to_cpu vid status", "", SW_API_CPU_VID_EN_SET, NULL}, - {"cpuVid", "get", "get to_cpu vid status", "", SW_API_CPU_VID_EN_GET, NULL}, - {"rtdPppoe", "set", "set RM_RTD_PPPOE_EN status", "", SW_API_RTD_PPPOE_EN_SET, NULL}, - {"rtdPppoe", "get", "get RM_RTD_PPPOE_EN status", "", SW_API_RTD_PPPOE_EN_GET, NULL}, - {"pppoeen", "set", "set a l3 interface pppoe status", " ", SW_API_PPPOE_EN_SET, NULL}, - {"pppoeen", "get", "get a l3 interface pppoe status", "", SW_API_PPPOE_EN_GET, NULL}, - {"glomacaddr", "set", "set global macaddr", "", SW_API_GLOBAL_MACADDR_SET, NULL}, - {"glomacaddr", "get", "get global macaddr", "", SW_API_GLOBAL_MACADDR_GET, NULL}, - {"lldp", "set", "set lldp frames hardware identification status", "", SW_API_LLDP_STATUS_SET, NULL}, - {"lldp", "get", "get lldp frames hardware identification status", "", SW_API_LLDP_STATUS_GET, NULL}, - {"framecrc", "set", "set frame crc reserve enable", "", SW_API_FRAME_CRC_RESERVE_SET, NULL}, - {"framecrc", "get", "get frame crc reserve enable", "", SW_API_FRAME_CRC_RESERVE_GET, NULL}, - {NULL, NULL, NULL, NULL, SW_API_INVALID, NULL}/*end of desc*/ - }, - }, -#endif - - /* IP */ -#ifdef IN_IP - { - "ip", "config ip", - { - {"hostentry", "add", "add host entry", "", SW_API_IP_HOST_ADD, NULL}, - {"hostentry", "del", "del host entry", "", SW_API_IP_HOST_DEL, NULL}, - {"hostentry", "get", "get host entry", "", SW_API_IP_HOST_GET, NULL}, - {"hostentry", "next", "next host entry", "", SW_API_IP_HOST_NEXT, NULL}, - {"hostentry", "show", "show whole host entries", "", SW_CMD_HOST_SHOW, cmd_show_host}, - {"hostipv4entry", "show", "show whole ipv4U host entries", "", SW_CMD_HOST_IPV4_SHOW, cmd_show_host_ipv4}, - {"hostipv6entry", "show", "show whole ipv6u host entries", "", SW_CMD_HOST_IPV6_SHOW, cmd_show_host_ipv6}, - {"hostipv4Mentry", "show", "show whole ipv4M host entries", "", SW_CMD_HOST_IPV4M_SHOW, cmd_show_host_ipv4M}, - {"hostipv6Mentry", "show", "show whole ipv6M host entries", "", SW_CMD_HOST_IPV6M_SHOW, cmd_show_host_ipv6M}, - {"hostentry", "bindcnt", "bind counter to host entry", " ", SW_API_IP_HOST_COUNTER_BIND, NULL}, - {"hostentry", "bindpppoe", "bind pppoe to host entry", " ", SW_API_IP_HOST_PPPOE_BIND, NULL}, - {"ptarplearn", "set", "set port arp learn flag, bit0 req bit1 ack", " ", SW_API_IP_PT_ARP_LEARN_SET, NULL}, - {"ptarplearn", "get", "get port arp learn flag, bit0 req bit1 ack", "", SW_API_IP_PT_ARP_LEARN_GET, NULL}, - {"arplearn", "set", "set arp learn mode", "", SW_API_IP_ARP_LEARN_SET, NULL}, - {"arplearn", "get", "get arp learn mode", "", SW_API_IP_ARP_LEARN_GET, NULL}, - {"ptipsrcguard", "set", "set ip source guard mode", " ", SW_API_IP_SOURCE_GUARD_SET, NULL}, - {"ptipsrcguard", "get", "get ip source guard mode", "", SW_API_IP_SOURCE_GUARD_GET, NULL}, - {"ptarpsrcguard", "set", "set arp source guard mode", " ", SW_API_IP_ARP_GUARD_SET, NULL}, - {"ptarpsrcguard", "get", "get arp source guard mode", "", SW_API_IP_ARP_GUARD_GET, NULL}, - {"routestatus", "set", "set ip route status", "", SW_API_IP_ROUTE_STATUS_SET, NULL}, - {"routestatus", "get", "get ip route status", "", SW_API_IP_ROUTE_STATUS_GET, NULL}, - {"intfentry", "add", "add interface mac address", "", SW_API_IP_INTF_ENTRY_ADD, NULL}, - {"intfentry", "del", "del interface mac address", "", SW_API_IP_INTF_ENTRY_DEL, NULL}, - {"intfentry", "show", "show whole interface mac entries", "", SW_CMD_INTFMAC_SHOW, cmd_show_intfmac}, - {"ipunksrc", "set", "set ip unkown source command", "", SW_API_IP_UNK_SOURCE_CMD_SET, NULL}, - {"ipunksrc", "get", "get ip unkown source command", "", SW_API_IP_UNK_SOURCE_CMD_GET, NULL}, - {"arpunksrc", "set", "set arp unkown source command", "", SW_API_ARP_UNK_SOURCE_CMD_SET, NULL}, - {"arpunksrc", "get", "get arp unkown source command", "", SW_API_ARP_UNK_SOURCE_CMD_GET, NULL}, - {"ipagetime", "set", "set dynamic ip entry age time", "